partition
stringclasses
3 values
func_name
stringlengths
1
134
docstring
stringlengths
1
46.9k
path
stringlengths
4
223
original_string
stringlengths
75
104k
code
stringlengths
75
104k
docstring_tokens
listlengths
1
1.97k
repo
stringlengths
7
55
language
stringclasses
1 value
url
stringlengths
87
315
code_tokens
listlengths
19
28.4k
sha
stringlengths
40
40
train
start_upsert
Helper function to facilitate upsert. Args: ini_date - the dictionary of info to run upsert Exit: 0 - good 1 - bad
stackility/command.py
def start_upsert(ini_data): """ Helper function to facilitate upsert. Args: ini_date - the dictionary of info to run upsert Exit: 0 - good 1 - bad """ stack_driver = CloudStackUtility(ini_data) poll_stack = not ini_data.get('no_poll', False) if stack_driver.upsert(...
def start_upsert(ini_data): """ Helper function to facilitate upsert. Args: ini_date - the dictionary of info to run upsert Exit: 0 - good 1 - bad """ stack_driver = CloudStackUtility(ini_data) poll_stack = not ini_data.get('no_poll', False) if stack_driver.upsert(...
[ "Helper", "function", "to", "facilitate", "upsert", "." ]
muckamuck/stackility
python
https://github.com/muckamuck/stackility/blob/b1696f02661134d31b99b4dea7c0d21d09482d33/stackility/command.py#L154-L212
[ "def", "start_upsert", "(", "ini_data", ")", ":", "stack_driver", "=", "CloudStackUtility", "(", "ini_data", ")", "poll_stack", "=", "not", "ini_data", ".", "get", "(", "'no_poll'", ",", "False", ")", "if", "stack_driver", ".", "upsert", "(", ")", ":", "lo...
b1696f02661134d31b99b4dea7c0d21d09482d33
train
read_config_info
Read the INI file Args: ini_file - path to the file Returns: A dictionary of stuff from the INI file Exits: 1 - if problems are encountered
stackility/command.py
def read_config_info(ini_file): """ Read the INI file Args: ini_file - path to the file Returns: A dictionary of stuff from the INI file Exits: 1 - if problems are encountered """ try: config = RawConfigParser() config.optionxform = lambda option: o...
def read_config_info(ini_file): """ Read the INI file Args: ini_file - path to the file Returns: A dictionary of stuff from the INI file Exits: 1 - if problems are encountered """ try: config = RawConfigParser() config.optionxform = lambda option: o...
[ "Read", "the", "INI", "file" ]
muckamuck/stackility
python
https://github.com/muckamuck/stackility/blob/b1696f02661134d31b99b4dea7c0d21d09482d33/stackility/command.py#L257-L284
[ "def", "read_config_info", "(", "ini_file", ")", ":", "try", ":", "config", "=", "RawConfigParser", "(", ")", "config", ".", "optionxform", "=", "lambda", "option", ":", "option", "config", ".", "read", "(", "ini_file", ")", "the_stuff", "=", "{", "}", "...
b1696f02661134d31b99b4dea7c0d21d09482d33
train
StackTool.print_stack_info
List resources from the given stack Args: None Returns: A dictionary filled resources or None if things went sideways
stackility/stack_tool.py
def print_stack_info(self): ''' List resources from the given stack Args: None Returns: A dictionary filled resources or None if things went sideways ''' try: rest_api_id = None deployment_found = False respon...
def print_stack_info(self): ''' List resources from the given stack Args: None Returns: A dictionary filled resources or None if things went sideways ''' try: rest_api_id = None deployment_found = False respon...
[ "List", "resources", "from", "the", "given", "stack" ]
muckamuck/stackility
python
https://github.com/muckamuck/stackility/blob/b1696f02661134d31b99b4dea7c0d21d09482d33/stackility/stack_tool.py#L39-L92
[ "def", "print_stack_info", "(", "self", ")", ":", "try", ":", "rest_api_id", "=", "None", "deployment_found", "=", "False", "response", "=", "self", ".", "_cf_client", ".", "describe_stack_resources", "(", "StackName", "=", "self", ".", "_stack_name", ")", "pr...
b1696f02661134d31b99b4dea7c0d21d09482d33
train
StackTool.print_stack_events
List events from the given stack Args: None Returns: None
stackility/stack_tool.py
def print_stack_events(self): ''' List events from the given stack Args: None Returns: None ''' first_token = '7be7981bd6287dd8112305e8f3822a6f' keep_going = True next_token = first_token current_request_token = None ...
def print_stack_events(self): ''' List events from the given stack Args: None Returns: None ''' first_token = '7be7981bd6287dd8112305e8f3822a6f' keep_going = True next_token = first_token current_request_token = None ...
[ "List", "events", "from", "the", "given", "stack" ]
muckamuck/stackility
python
https://github.com/muckamuck/stackility/blob/b1696f02661134d31b99b4dea7c0d21d09482d33/stackility/stack_tool.py#L94-L147
[ "def", "print_stack_events", "(", "self", ")", ":", "first_token", "=", "'7be7981bd6287dd8112305e8f3822a6f'", "keep_going", "=", "True", "next_token", "=", "first_token", "current_request_token", "=", "None", "rows", "=", "[", "]", "try", ":", "while", "keep_going",...
b1696f02661134d31b99b4dea7c0d21d09482d33
train
trac
Set up or update a trac project. This trac installation uses python2, git, sqlite (trac-default), gunicorn, and nginx. The connection is https-only and secured by a letsencrypt certificate. This certificate must be created separately with task setup.server_letsencrypt. This task installes or upd...
fabsetup/fabfile/setup/service/trac.py
def trac(): '''Set up or update a trac project. This trac installation uses python2, git, sqlite (trac-default), gunicorn, and nginx. The connection is https-only and secured by a letsencrypt certificate. This certificate must be created separately with task setup.server_letsencrypt. This ta...
def trac(): '''Set up or update a trac project. This trac installation uses python2, git, sqlite (trac-default), gunicorn, and nginx. The connection is https-only and secured by a letsencrypt certificate. This certificate must be created separately with task setup.server_letsencrypt. This ta...
[ "Set", "up", "or", "update", "a", "trac", "project", "." ]
theno/fabsetup
python
https://github.com/theno/fabsetup/blob/ced728abff93551ba5677e63bc1bdc0ef5ca5777/fabsetup/fabfile/setup/service/trac.py#L28-L120
[ "def", "trac", "(", ")", ":", "hostname", "=", "re", ".", "sub", "(", "r'^[^@]+@'", ",", "''", ",", "env", ".", "host", ")", "# without username if any", "sitename", "=", "query_input", "(", "question", "=", "'\\nEnter site-name of Your trac web service'", ",", ...
ced728abff93551ba5677e63bc1bdc0ef5ca5777
train
Wallabag.query
Do a query to the System API :param path: url to the API :param method: the kind of query to do :param params: a dict with all the necessary things to query the API :return json data
wallabag_api/wallabag.py
async def query(self, path, method='get', **params): """ Do a query to the System API :param path: url to the API :param method: the kind of query to do :param params: a dict with all the necessary things to query the API :return json data """ if ...
async def query(self, path, method='get', **params): """ Do a query to the System API :param path: url to the API :param method: the kind of query to do :param params: a dict with all the necessary things to query the API :return json data """ if ...
[ "Do", "a", "query", "to", "the", "System", "API" ]
push-things/wallabag_api
python
https://github.com/push-things/wallabag_api/blob/8d1e10a6ebc03d1ac9af2b38b57eb69f29b4216e/wallabag_api/wallabag.py#L60-L91
[ "async", "def", "query", "(", "self", ",", "path", ",", "method", "=", "'get'", ",", "*", "*", "params", ")", ":", "if", "method", "in", "(", "'get'", ",", "'post'", ",", "'patch'", ",", "'delete'", ",", "'put'", ")", ":", "full_path", "=", "self",...
8d1e10a6ebc03d1ac9af2b38b57eb69f29b4216e
train
Wallabag.handle_json_response
get the json data response :param responses: the json response :return the json data without 'root' node
wallabag_api/wallabag.py
async def handle_json_response(responses): """ get the json data response :param responses: the json response :return the json data without 'root' node """ json_data = {} if responses.status != 200: err_msg = HttpProcessingError(code=responses.status, ...
async def handle_json_response(responses): """ get the json data response :param responses: the json response :return the json data without 'root' node """ json_data = {} if responses.status != 200: err_msg = HttpProcessingError(code=responses.status, ...
[ "get", "the", "json", "data", "response", ":", "param", "responses", ":", "the", "json", "response", ":", "return", "the", "json", "data", "without", "root", "node" ]
push-things/wallabag_api
python
https://github.com/push-things/wallabag_api/blob/8d1e10a6ebc03d1ac9af2b38b57eb69f29b4216e/wallabag_api/wallabag.py#L94-L115
[ "async", "def", "handle_json_response", "(", "responses", ")", ":", "json_data", "=", "{", "}", "if", "responses", ".", "status", "!=", "200", ":", "err_msg", "=", "HttpProcessingError", "(", "code", "=", "responses", ".", "status", ",", "message", "=", "a...
8d1e10a6ebc03d1ac9af2b38b57eb69f29b4216e
train
Wallabag.__get_attr
get the value of a parm :param what: string parm :param type_attr: type of parm :param value_attr: :param kwargs: :return: value of the parm
wallabag_api/wallabag.py
def __get_attr(what, type_attr, value_attr, **kwargs): """ get the value of a parm :param what: string parm :param type_attr: type of parm :param value_attr: :param kwargs: :return: value of the parm """ if what in kwargs: value = int(k...
def __get_attr(what, type_attr, value_attr, **kwargs): """ get the value of a parm :param what: string parm :param type_attr: type of parm :param value_attr: :param kwargs: :return: value of the parm """ if what in kwargs: value = int(k...
[ "get", "the", "value", "of", "a", "parm", ":", "param", "what", ":", "string", "parm", ":", "param", "type_attr", ":", "type", "of", "parm", ":", "param", "value_attr", ":", ":", "param", "kwargs", ":", ":", "return", ":", "value", "of", "the", "parm...
push-things/wallabag_api
python
https://github.com/push-things/wallabag_api/blob/8d1e10a6ebc03d1ac9af2b38b57eb69f29b4216e/wallabag_api/wallabag.py#L118-L130
[ "def", "__get_attr", "(", "what", ",", "type_attr", ",", "value_attr", ",", "*", "*", "kwargs", ")", ":", "if", "what", "in", "kwargs", ":", "value", "=", "int", "(", "kwargs", "[", "what", "]", ")", "if", "type_attr", "==", "'int'", "else", "kwargs"...
8d1e10a6ebc03d1ac9af2b38b57eb69f29b4216e
train
Wallabag.get_entries
GET /api/entries.{_format} Retrieve all entries. It could be filtered by many options. :param kwargs: can contain one of the following filters archive: '0' or '1', default '0' filter by archived status. starred: '0' or '1', default '0' filter by starred status. sor...
wallabag_api/wallabag.py
async def get_entries(self, **kwargs): """ GET /api/entries.{_format} Retrieve all entries. It could be filtered by many options. :param kwargs: can contain one of the following filters archive: '0' or '1', default '0' filter by archived status. starred: '0' or...
async def get_entries(self, **kwargs): """ GET /api/entries.{_format} Retrieve all entries. It could be filtered by many options. :param kwargs: can contain one of the following filters archive: '0' or '1', default '0' filter by archived status. starred: '0' or...
[ "GET", "/", "api", "/", "entries", ".", "{", "_format", "}" ]
push-things/wallabag_api
python
https://github.com/push-things/wallabag_api/blob/8d1e10a6ebc03d1ac9af2b38b57eb69f29b4216e/wallabag_api/wallabag.py#L133-L177
[ "async", "def", "get_entries", "(", "self", ",", "*", "*", "kwargs", ")", ":", "# default values", "params", "=", "dict", "(", "{", "'access_token'", ":", "self", ".", "token", ",", "'sort'", ":", "'created'", ",", "'order'", ":", "'desc'", ",", "'page'"...
8d1e10a6ebc03d1ac9af2b38b57eb69f29b4216e
train
Wallabag.post_entries
POST /api/entries.{_format} Create an entry :param url: the url of the note to store :param title: Optional, we'll get the title from the page. :param tags: tag1,tag2,tag3 a comma-separated list of tags. :param starred entry already starred :param archive entry already ...
wallabag_api/wallabag.py
async def post_entries(self, url, title='', tags='', starred=0, archive=0, content='', language='', published_at='', authors='', public=1, original_url=''): """ POST /api/entries.{_format} Create an entry :param url: the url of the note to store :para...
async def post_entries(self, url, title='', tags='', starred=0, archive=0, content='', language='', published_at='', authors='', public=1, original_url=''): """ POST /api/entries.{_format} Create an entry :param url: the url of the note to store :para...
[ "POST", "/", "api", "/", "entries", ".", "{", "_format", "}" ]
push-things/wallabag_api
python
https://github.com/push-things/wallabag_api/blob/8d1e10a6ebc03d1ac9af2b38b57eb69f29b4216e/wallabag_api/wallabag.py#L179-L206
[ "async", "def", "post_entries", "(", "self", ",", "url", ",", "title", "=", "''", ",", "tags", "=", "''", ",", "starred", "=", "0", ",", "archive", "=", "0", ",", "content", "=", "''", ",", "language", "=", "''", ",", "published_at", "=", "''", "...
8d1e10a6ebc03d1ac9af2b38b57eb69f29b4216e
train
Wallabag.get_entry
GET /api/entries/{entry}.{_format} Retrieve a single entry :param entry: \w+ an integer The Entry ID :return data related to the ext
wallabag_api/wallabag.py
async def get_entry(self, entry): """ GET /api/entries/{entry}.{_format} Retrieve a single entry :param entry: \w+ an integer The Entry ID :return data related to the ext """ params = {'access_token': self.token} url = '/api/entries/{entry}.{ext}'.format...
async def get_entry(self, entry): """ GET /api/entries/{entry}.{_format} Retrieve a single entry :param entry: \w+ an integer The Entry ID :return data related to the ext """ params = {'access_token': self.token} url = '/api/entries/{entry}.{ext}'.format...
[ "GET", "/", "api", "/", "entries", "/", "{", "entry", "}", ".", "{", "_format", "}" ]
push-things/wallabag_api
python
https://github.com/push-things/wallabag_api/blob/8d1e10a6ebc03d1ac9af2b38b57eb69f29b4216e/wallabag_api/wallabag.py#L208-L220
[ "async", "def", "get_entry", "(", "self", ",", "entry", ")", ":", "params", "=", "{", "'access_token'", ":", "self", ".", "token", "}", "url", "=", "'/api/entries/{entry}.{ext}'", ".", "format", "(", "entry", "=", "entry", ",", "ext", "=", "self", ".", ...
8d1e10a6ebc03d1ac9af2b38b57eb69f29b4216e
train
Wallabag.patch_entries
PATCH /api/entries/{entry}.{_format} Change several properties of an entry :param entry: the entry to 'patch' / update :param kwargs: can contain one of the following title: string tags: a list of tags tag1,tag2,tag3 archive: '0' or '1', default '0' archive...
wallabag_api/wallabag.py
async def patch_entries(self, entry, **kwargs): """ PATCH /api/entries/{entry}.{_format} Change several properties of an entry :param entry: the entry to 'patch' / update :param kwargs: can contain one of the following title: string tags: a list of tags ...
async def patch_entries(self, entry, **kwargs): """ PATCH /api/entries/{entry}.{_format} Change several properties of an entry :param entry: the entry to 'patch' / update :param kwargs: can contain one of the following title: string tags: a list of tags ...
[ "PATCH", "/", "api", "/", "entries", "/", "{", "entry", "}", ".", "{", "_format", "}" ]
push-things/wallabag_api
python
https://github.com/push-things/wallabag_api/blob/8d1e10a6ebc03d1ac9af2b38b57eb69f29b4216e/wallabag_api/wallabag.py#L236-L276
[ "async", "def", "patch_entries", "(", "self", ",", "entry", ",", "*", "*", "kwargs", ")", ":", "# default values", "params", "=", "{", "'access_token'", ":", "self", ".", "token", ",", "'title'", ":", "''", ",", "'tags'", ":", "[", "]", "}", "if", "'...
8d1e10a6ebc03d1ac9af2b38b57eb69f29b4216e
train
Wallabag.delete_entries
DELETE /api/entries/{entry}.{_format} Delete permanently an entry :param entry: \w+ an integer The Entry ID :return result
wallabag_api/wallabag.py
async def delete_entries(self, entry): """ DELETE /api/entries/{entry}.{_format} Delete permanently an entry :param entry: \w+ an integer The Entry ID :return result """ params = {'Authorization': 'Bearer {}'.format(self.token)} path = '/api/entries/{en...
async def delete_entries(self, entry): """ DELETE /api/entries/{entry}.{_format} Delete permanently an entry :param entry: \w+ an integer The Entry ID :return result """ params = {'Authorization': 'Bearer {}'.format(self.token)} path = '/api/entries/{en...
[ "DELETE", "/", "api", "/", "entries", "/", "{", "entry", "}", ".", "{", "_format", "}" ]
push-things/wallabag_api
python
https://github.com/push-things/wallabag_api/blob/8d1e10a6ebc03d1ac9af2b38b57eb69f29b4216e/wallabag_api/wallabag.py#L308-L321
[ "async", "def", "delete_entries", "(", "self", ",", "entry", ")", ":", "params", "=", "{", "'Authorization'", ":", "'Bearer {}'", ".", "format", "(", "self", ".", "token", ")", "}", "path", "=", "'/api/entries/{entry}.{ext}'", ".", "format", "(", "entry", ...
8d1e10a6ebc03d1ac9af2b38b57eb69f29b4216e
train
Wallabag.entries_exists
GET /api/entries/exists.{_format} Check if an entry exist by url. :param url string true An url Url to check if it exists :param urls string false An array of urls (?urls[]=http...&urls[]=http...) Urls (as an array) to check if it exists :return result
wallabag_api/wallabag.py
async def entries_exists(self, url, urls=''): """ GET /api/entries/exists.{_format} Check if an entry exist by url. :param url string true An url Url to check if it exists :param urls string false An array of urls (?urls[]=http...&urls[]=http...) Urls (as an array...
async def entries_exists(self, url, urls=''): """ GET /api/entries/exists.{_format} Check if an entry exist by url. :param url string true An url Url to check if it exists :param urls string false An array of urls (?urls[]=http...&urls[]=http...) Urls (as an array...
[ "GET", "/", "api", "/", "entries", "/", "exists", ".", "{", "_format", "}" ]
push-things/wallabag_api
python
https://github.com/push-things/wallabag_api/blob/8d1e10a6ebc03d1ac9af2b38b57eb69f29b4216e/wallabag_api/wallabag.py#L323-L341
[ "async", "def", "entries_exists", "(", "self", ",", "url", ",", "urls", "=", "''", ")", ":", "params", "=", "{", "'access_token'", ":", "self", ".", "token", ",", "'url'", ":", "url", ",", "'urls'", ":", "urls", "}", "path", "=", "'/api/entries/exists....
8d1e10a6ebc03d1ac9af2b38b57eb69f29b4216e
train
Wallabag.post_entry_tags
POST /api/entries/{entry}/tags.{_format} Add one or more tags to an entry :param entry: \w+ an integer The Entry ID :param tags: list of tags (urlencoded) :return result
wallabag_api/wallabag.py
async def post_entry_tags(self, entry, tags): """ POST /api/entries/{entry}/tags.{_format} Add one or more tags to an entry :param entry: \w+ an integer The Entry ID :param tags: list of tags (urlencoded) :return result """ params = {'access_token': self...
async def post_entry_tags(self, entry, tags): """ POST /api/entries/{entry}/tags.{_format} Add one or more tags to an entry :param entry: \w+ an integer The Entry ID :param tags: list of tags (urlencoded) :return result """ params = {'access_token': self...
[ "POST", "/", "api", "/", "entries", "/", "{", "entry", "}", "/", "tags", ".", "{", "_format", "}" ]
push-things/wallabag_api
python
https://github.com/push-things/wallabag_api/blob/8d1e10a6ebc03d1ac9af2b38b57eb69f29b4216e/wallabag_api/wallabag.py#L359-L374
[ "async", "def", "post_entry_tags", "(", "self", ",", "entry", ",", "tags", ")", ":", "params", "=", "{", "'access_token'", ":", "self", ".", "token", ",", "'tags'", ":", "[", "]", "}", "if", "len", "(", "tags", ")", ">", "0", "and", "isinstance", "...
8d1e10a6ebc03d1ac9af2b38b57eb69f29b4216e
train
Wallabag.delete_entry_tag
DELETE /api/entries/{entry}/tags/{tag}.{_format} Permanently remove one tag for an entry :param entry: \w+ an integer The Entry ID :param tag: string The Tag :return data related to the ext
wallabag_api/wallabag.py
async def delete_entry_tag(self, entry, tag): """ DELETE /api/entries/{entry}/tags/{tag}.{_format} Permanently remove one tag for an entry :param entry: \w+ an integer The Entry ID :param tag: string The Tag :return data related to the ext """ params = {...
async def delete_entry_tag(self, entry, tag): """ DELETE /api/entries/{entry}/tags/{tag}.{_format} Permanently remove one tag for an entry :param entry: \w+ an integer The Entry ID :param tag: string The Tag :return data related to the ext """ params = {...
[ "DELETE", "/", "api", "/", "entries", "/", "{", "entry", "}", "/", "tags", "/", "{", "tag", "}", ".", "{", "_format", "}" ]
push-things/wallabag_api
python
https://github.com/push-things/wallabag_api/blob/8d1e10a6ebc03d1ac9af2b38b57eb69f29b4216e/wallabag_api/wallabag.py#L376-L389
[ "async", "def", "delete_entry_tag", "(", "self", ",", "entry", ",", "tag", ")", ":", "params", "=", "{", "'access_token'", ":", "self", ".", "token", "}", "url", "=", "'/api/entries/{entry}/tags/{tag}.{ext}'", ".", "format", "(", "entry", "=", "entry", ",", ...
8d1e10a6ebc03d1ac9af2b38b57eb69f29b4216e
train
Wallabag.get_tags
GET /api/tags.{_format} Retrieve all tags :return data related to the ext
wallabag_api/wallabag.py
async def get_tags(self): """ GET /api/tags.{_format} Retrieve all tags :return data related to the ext """ params = {'access_token': self.token} path = '/api/tags.{ext}'.format(ext=self.format) return await self.query(path, "get", **params)
async def get_tags(self): """ GET /api/tags.{_format} Retrieve all tags :return data related to the ext """ params = {'access_token': self.token} path = '/api/tags.{ext}'.format(ext=self.format) return await self.query(path, "get", **params)
[ "GET", "/", "api", "/", "tags", ".", "{", "_format", "}" ]
push-things/wallabag_api
python
https://github.com/push-things/wallabag_api/blob/8d1e10a6ebc03d1ac9af2b38b57eb69f29b4216e/wallabag_api/wallabag.py#L391-L401
[ "async", "def", "get_tags", "(", "self", ")", ":", "params", "=", "{", "'access_token'", ":", "self", ".", "token", "}", "path", "=", "'/api/tags.{ext}'", ".", "format", "(", "ext", "=", "self", ".", "format", ")", "return", "await", "self", ".", "quer...
8d1e10a6ebc03d1ac9af2b38b57eb69f29b4216e
train
Wallabag.delete_tag
DELETE /api/tags/{tag}.{_format} Permanently remove one tag from every entry :param tag: string The Tag :return data related to the ext
wallabag_api/wallabag.py
async def delete_tag(self, tag): """ DELETE /api/tags/{tag}.{_format} Permanently remove one tag from every entry :param tag: string The Tag :return data related to the ext """ path = '/api/tags/{tag}.{ext}'.format(tag=tag, ext=self.format) params = {'ac...
async def delete_tag(self, tag): """ DELETE /api/tags/{tag}.{_format} Permanently remove one tag from every entry :param tag: string The Tag :return data related to the ext """ path = '/api/tags/{tag}.{ext}'.format(tag=tag, ext=self.format) params = {'ac...
[ "DELETE", "/", "api", "/", "tags", "/", "{", "tag", "}", ".", "{", "_format", "}" ]
push-things/wallabag_api
python
https://github.com/push-things/wallabag_api/blob/8d1e10a6ebc03d1ac9af2b38b57eb69f29b4216e/wallabag_api/wallabag.py#L403-L414
[ "async", "def", "delete_tag", "(", "self", ",", "tag", ")", ":", "path", "=", "'/api/tags/{tag}.{ext}'", ".", "format", "(", "tag", "=", "tag", ",", "ext", "=", "self", ".", "format", ")", "params", "=", "{", "'access_token'", ":", "self", ".", "token"...
8d1e10a6ebc03d1ac9af2b38b57eb69f29b4216e
train
Wallabag.put_annotations
PUT /api/annotations/{annotation}.{_format} Updates an annotation. :param annotation \w+ string The annotation ID Will returns annotation for this entry :return data related to the ext
wallabag_api/wallabag.py
async def put_annotations(self, annotation): """ PUT /api/annotations/{annotation}.{_format} Updates an annotation. :param annotation \w+ string The annotation ID Will returns annotation for this entry :return data related to the ext """ params = {'a...
async def put_annotations(self, annotation): """ PUT /api/annotations/{annotation}.{_format} Updates an annotation. :param annotation \w+ string The annotation ID Will returns annotation for this entry :return data related to the ext """ params = {'a...
[ "PUT", "/", "api", "/", "annotations", "/", "{", "annotation", "}", ".", "{", "_format", "}" ]
push-things/wallabag_api
python
https://github.com/push-things/wallabag_api/blob/8d1e10a6ebc03d1ac9af2b38b57eb69f29b4216e/wallabag_api/wallabag.py#L462-L476
[ "async", "def", "put_annotations", "(", "self", ",", "annotation", ")", ":", "params", "=", "{", "'access_token'", ":", "self", ".", "token", "}", "url", "=", "'/api/annotations/{annotation}.{ext}'", ".", "format", "(", "annotation", "=", "annotation", ",", "e...
8d1e10a6ebc03d1ac9af2b38b57eb69f29b4216e
train
Wallabag.post_annotations
POST /api/annotations/{entry}.{_format} Creates a new annotation. :param entry \w+ integer The entry ID :return
wallabag_api/wallabag.py
async def post_annotations(self, entry, **kwargs): """ POST /api/annotations/{entry}.{_format} Creates a new annotation. :param entry \w+ integer The entry ID :return """ params = dict({'access_token': self.token, 'ranges': [], ...
async def post_annotations(self, entry, **kwargs): """ POST /api/annotations/{entry}.{_format} Creates a new annotation. :param entry \w+ integer The entry ID :return """ params = dict({'access_token': self.token, 'ranges': [], ...
[ "POST", "/", "api", "/", "annotations", "/", "{", "entry", "}", ".", "{", "_format", "}" ]
push-things/wallabag_api
python
https://github.com/push-things/wallabag_api/blob/8d1e10a6ebc03d1ac9af2b38b57eb69f29b4216e/wallabag_api/wallabag.py#L494-L517
[ "async", "def", "post_annotations", "(", "self", ",", "entry", ",", "*", "*", "kwargs", ")", ":", "params", "=", "dict", "(", "{", "'access_token'", ":", "self", ".", "token", ",", "'ranges'", ":", "[", "]", ",", "'quote'", ":", "''", ",", "'text'", ...
8d1e10a6ebc03d1ac9af2b38b57eb69f29b4216e
train
Wallabag.version
GET /api/version.{_format} Retrieve version number :return data related to the ext
wallabag_api/wallabag.py
async def version(self): """ GET /api/version.{_format} Retrieve version number :return data related to the ext """ params = {'access_token': self.token} url = '/api/version.{ext}'.format(ext=self.format) return await self.query(url, "get", **params)
async def version(self): """ GET /api/version.{_format} Retrieve version number :return data related to the ext """ params = {'access_token': self.token} url = '/api/version.{ext}'.format(ext=self.format) return await self.query(url, "get", **params)
[ "GET", "/", "api", "/", "version", ".", "{", "_format", "}" ]
push-things/wallabag_api
python
https://github.com/push-things/wallabag_api/blob/8d1e10a6ebc03d1ac9af2b38b57eb69f29b4216e/wallabag_api/wallabag.py#L521-L531
[ "async", "def", "version", "(", "self", ")", ":", "params", "=", "{", "'access_token'", ":", "self", ".", "token", "}", "url", "=", "'/api/version.{ext}'", ".", "format", "(", "ext", "=", "self", ".", "format", ")", "return", "await", "self", ".", "que...
8d1e10a6ebc03d1ac9af2b38b57eb69f29b4216e
train
Wallabag.get_token
POST /oauth/v2/token Get a new token :param host: host of the service :param params: will contain : params = {"grant_type": "password", "client_id": "a string", "client_secret": "a string", "username": "a login", ...
wallabag_api/wallabag.py
async def get_token(cls, host, **params): """ POST /oauth/v2/token Get a new token :param host: host of the service :param params: will contain : params = {"grant_type": "password", "client_id": "a string", "client_secret": "a string...
async def get_token(cls, host, **params): """ POST /oauth/v2/token Get a new token :param host: host of the service :param params: will contain : params = {"grant_type": "password", "client_id": "a string", "client_secret": "a string...
[ "POST", "/", "oauth", "/", "v2", "/", "token" ]
push-things/wallabag_api
python
https://github.com/push-things/wallabag_api/blob/8d1e10a6ebc03d1ac9af2b38b57eb69f29b4216e/wallabag_api/wallabag.py#L534-L556
[ "async", "def", "get_token", "(", "cls", ",", "host", ",", "*", "*", "params", ")", ":", "params", "[", "'grant_type'", "]", "=", "\"password\"", "path", "=", "\"/oauth/v2/token\"", "async", "with", "aiohttp", ".", "ClientSession", "(", ")", "as", "sess", ...
8d1e10a6ebc03d1ac9af2b38b57eb69f29b4216e
train
revealjs
Set up or update a reveals.js presentation with slides written in markdown. Several reveal.js plugins will be set up, too. More info: Demo: https://theno.github.io/revealjs_template http://lab.hakim.se/reveal-js/ https://github.com/hakimel/reveal.js plugins: https://github.com/...
fabsetup/fabfile/setup/revealjs.py
def revealjs(basedir=None, title=None, subtitle=None, description=None, github_user=None, github_repo=None): '''Set up or update a reveals.js presentation with slides written in markdown. Several reveal.js plugins will be set up, too. More info: Demo: https://theno.github.io/revealjs_te...
def revealjs(basedir=None, title=None, subtitle=None, description=None, github_user=None, github_repo=None): '''Set up or update a reveals.js presentation with slides written in markdown. Several reveal.js plugins will be set up, too. More info: Demo: https://theno.github.io/revealjs_te...
[ "Set", "up", "or", "update", "a", "reveals", ".", "js", "presentation", "with", "slides", "written", "in", "markdown", "." ]
theno/fabsetup
python
https://github.com/theno/fabsetup/blob/ced728abff93551ba5677e63bc1bdc0ef5ca5777/fabsetup/fabfile/setup/revealjs.py#L50-L90
[ "def", "revealjs", "(", "basedir", "=", "None", ",", "title", "=", "None", ",", "subtitle", "=", "None", ",", "description", "=", "None", ",", "github_user", "=", "None", ",", "github_repo", "=", "None", ")", ":", "basedir", "=", "basedir", "or", "quer...
ced728abff93551ba5677e63bc1bdc0ef5ca5777
train
tweak_css
Comment out some css settings.
fabsetup/fabfile/setup/revealjs.py
def tweak_css(repo_dir): '''Comment out some css settings.''' print_msg("* don't capitalize titles (no uppercase headings)") files = [ 'beige.css', 'black.css', 'blood.css', 'league.css', 'moon.css', 'night.css', 'serif.css', 'simple.css', 'sky.css', 'solarized.css', 'white.css', ...
def tweak_css(repo_dir): '''Comment out some css settings.''' print_msg("* don't capitalize titles (no uppercase headings)") files = [ 'beige.css', 'black.css', 'blood.css', 'league.css', 'moon.css', 'night.css', 'serif.css', 'simple.css', 'sky.css', 'solarized.css', 'white.css', ...
[ "Comment", "out", "some", "css", "settings", "." ]
theno/fabsetup
python
https://github.com/theno/fabsetup/blob/ced728abff93551ba5677e63bc1bdc0ef5ca5777/fabsetup/fabfile/setup/revealjs.py#L184-L218
[ "def", "tweak_css", "(", "repo_dir", ")", ":", "print_msg", "(", "\"* don't capitalize titles (no uppercase headings)\"", ")", "files", "=", "[", "'beige.css'", ",", "'black.css'", ",", "'blood.css'", ",", "'league.css'", ",", "'moon.css'", ",", "'night.css'", ",", ...
ced728abff93551ba5677e63bc1bdc0ef5ca5777
train
_create_github_remote_repo
More info: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ https://developer.github.com/v3/repos/#create https://stackoverflow.com/a/10325316
fabsetup/fabfile/setup/revealjs.py
def _create_github_remote_repo(basedir): '''More info: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ https://developer.github.com/v3/repos/#create https://stackoverflow.com/a/10325316 ''' github_user = _lazy('github_user') github_repo = _...
def _create_github_remote_repo(basedir): '''More info: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ https://developer.github.com/v3/repos/#create https://stackoverflow.com/a/10325316 ''' github_user = _lazy('github_user') github_repo = _...
[ "More", "info", ":", "https", ":", "//", "help", ".", "github", ".", "com", "/", "articles", "/", "adding", "-", "an", "-", "existing", "-", "project", "-", "to", "-", "github", "-", "using", "-", "the", "-", "command", "-", "line", "/", "https", ...
theno/fabsetup
python
https://github.com/theno/fabsetup/blob/ced728abff93551ba5677e63bc1bdc0ef5ca5777/fabsetup/fabfile/setup/revealjs.py#L318-L339
[ "def", "_create_github_remote_repo", "(", "basedir", ")", ":", "github_user", "=", "_lazy", "(", "'github_user'", ")", "github_repo", "=", "_lazy", "(", "'github_repo'", ",", "default", "=", "os", ".", "path", ".", "basename", "(", "basedir", ")", ")", "_ins...
ced728abff93551ba5677e63bc1bdc0ef5ca5777
train
decktape
Install DeckTape. DeckTape is a "high-quality PDF exporter for HTML5 presentation frameworks". It can be used to create PDFs from reveal.js presentations. More info: https://github.com/astefanutti/decktape https://github.com/hakimel/reveal.js/issues/1252#issuecomment-198270915
fabsetup/fabfile/setup/revealjs.py
def decktape(): '''Install DeckTape. DeckTape is a "high-quality PDF exporter for HTML5 presentation frameworks". It can be used to create PDFs from reveal.js presentations. More info: https://github.com/astefanutti/decktape https://github.com/hakimel/reveal.js/issues/1252#issuecomment-19...
def decktape(): '''Install DeckTape. DeckTape is a "high-quality PDF exporter for HTML5 presentation frameworks". It can be used to create PDFs from reveal.js presentations. More info: https://github.com/astefanutti/decktape https://github.com/hakimel/reveal.js/issues/1252#issuecomment-19...
[ "Install", "DeckTape", "." ]
theno/fabsetup
python
https://github.com/theno/fabsetup/blob/ced728abff93551ba5677e63bc1bdc0ef5ca5777/fabsetup/fabfile/setup/revealjs.py#L366-L395
[ "def", "decktape", "(", ")", ":", "run", "(", "'mkdir -p ~/bin/decktape'", ")", "if", "not", "exists", "(", "'~/bin/decktape/decktape-1.0.0'", ")", ":", "print_msg", "(", "'\\n## download decktape 1.0.0\\n'", ")", "run", "(", "'cd ~/bin/decktape && '", "'curl -L https:/...
ced728abff93551ba5677e63bc1bdc0ef5ca5777
train
revealjs_template
Create or update the template presentation demo using task `revealjs`.
fabsetup/fabfile/setup/revealjs.py
def revealjs_template(): '''Create or update the template presentation demo using task `revealjs`. ''' from config import basedir, github_user, github_repo run(flo('rm -f {basedir}/index.html')) run(flo('rm -f {basedir}/slides.md')) run(flo('rm -f {basedir}/README.md')) run(flo('rm -rf {bas...
def revealjs_template(): '''Create or update the template presentation demo using task `revealjs`. ''' from config import basedir, github_user, github_repo run(flo('rm -f {basedir}/index.html')) run(flo('rm -f {basedir}/slides.md')) run(flo('rm -f {basedir}/README.md')) run(flo('rm -rf {bas...
[ "Create", "or", "update", "the", "template", "presentation", "demo", "using", "task", "revealjs", "." ]
theno/fabsetup
python
https://github.com/theno/fabsetup/blob/ced728abff93551ba5677e63bc1bdc0ef5ca5777/fabsetup/fabfile/setup/revealjs.py#L401-L434
[ "def", "revealjs_template", "(", ")", ":", "from", "config", "import", "basedir", ",", "github_user", ",", "github_repo", "run", "(", "flo", "(", "'rm -f {basedir}/index.html'", ")", ")", "run", "(", "flo", "(", "'rm -f {basedir}/slides.md'", ")", ")", "run", ...
ced728abff93551ba5677e63bc1bdc0ef5ca5777
train
F1D.spatialDomainNoGrid
Superposition of analytical solutions without a gridded domain
gflex/f1d.py
def spatialDomainNoGrid(self): """ Superposition of analytical solutions without a gridded domain """ self.w = np.zeros(self.xw.shape) if self.Debug: print("w = ") print(self.w.shape) for i in range(len(self.q)): # More efficient if we have created some 0-load ...
def spatialDomainNoGrid(self): """ Superposition of analytical solutions without a gridded domain """ self.w = np.zeros(self.xw.shape) if self.Debug: print("w = ") print(self.w.shape) for i in range(len(self.q)): # More efficient if we have created some 0-load ...
[ "Superposition", "of", "analytical", "solutions", "without", "a", "gridded", "domain" ]
awickert/gFlex
python
https://github.com/awickert/gFlex/blob/3ac32249375b0f8d342a142585d86ea4d905a5a0/gflex/f1d.py#L143-L159
[ "def", "spatialDomainNoGrid", "(", "self", ")", ":", "self", ".", "w", "=", "np", ".", "zeros", "(", "self", ".", "xw", ".", "shape", ")", "if", "self", ".", "Debug", ":", "print", "(", "\"w = \"", ")", "print", "(", "self", ".", "w", ".", "shape...
3ac32249375b0f8d342a142585d86ea4d905a5a0
train
F1D.elasprepFD
dx4, D = elasprepFD(dx,Te,E=1E11,nu=0.25) Defines the variables (except for the subset flexural rigidity) that are needed to run "coeff_matrix_1d"
gflex/f1d.py
def elasprepFD(self): """ dx4, D = elasprepFD(dx,Te,E=1E11,nu=0.25) Defines the variables (except for the subset flexural rigidity) that are needed to run "coeff_matrix_1d" """ self.dx4 = self.dx**4 self.D = self.E*self.Te**3/(12*(1-self.nu**2))
def elasprepFD(self): """ dx4, D = elasprepFD(dx,Te,E=1E11,nu=0.25) Defines the variables (except for the subset flexural rigidity) that are needed to run "coeff_matrix_1d" """ self.dx4 = self.dx**4 self.D = self.E*self.Te**3/(12*(1-self.nu**2))
[ "dx4", "D", "=", "elasprepFD", "(", "dx", "Te", "E", "=", "1E11", "nu", "=", "0", ".", "25", ")", "Defines", "the", "variables", "(", "except", "for", "the", "subset", "flexural", "rigidity", ")", "that", "are", "needed", "to", "run", "coeff_matrix_1d"...
awickert/gFlex
python
https://github.com/awickert/gFlex/blob/3ac32249375b0f8d342a142585d86ea4d905a5a0/gflex/f1d.py#L164-L172
[ "def", "elasprepFD", "(", "self", ")", ":", "self", ".", "dx4", "=", "self", ".", "dx", "**", "4", "self", ".", "D", "=", "self", ".", "E", "*", "self", ".", "Te", "**", "3", "/", "(", "12", "*", "(", "1", "-", "self", ".", "nu", "**", "2...
3ac32249375b0f8d342a142585d86ea4d905a5a0
train
F1D.BC_Rigidity
Utility function to help implement boundary conditions by specifying them for and applying them to the elastic thickness grid
gflex/f1d.py
def BC_Rigidity(self): """ Utility function to help implement boundary conditions by specifying them for and applying them to the elastic thickness grid """ ######################################### # FLEXURAL RIGIDITY BOUNDARY CONDITIONS # #########################################...
def BC_Rigidity(self): """ Utility function to help implement boundary conditions by specifying them for and applying them to the elastic thickness grid """ ######################################### # FLEXURAL RIGIDITY BOUNDARY CONDITIONS # #########################################...
[ "Utility", "function", "to", "help", "implement", "boundary", "conditions", "by", "specifying", "them", "for", "and", "applying", "them", "to", "the", "elastic", "thickness", "grid" ]
awickert/gFlex
python
https://github.com/awickert/gFlex/blob/3ac32249375b0f8d342a142585d86ea4d905a5a0/gflex/f1d.py#L206-L262
[ "def", "BC_Rigidity", "(", "self", ")", ":", "#########################################\r", "# FLEXURAL RIGIDITY BOUNDARY CONDITIONS #\r", "#########################################\r", "# West\r", "if", "self", ".", "BC_W", "==", "'Periodic'", ":", "self", ".", "BC_Rigidity_W"...
3ac32249375b0f8d342a142585d86ea4d905a5a0
train
F1D.build_diagonals
Builds the diagonals for the coefficient array
gflex/f1d.py
def build_diagonals(self): """ Builds the diagonals for the coefficient array """ ########################################################## # INCORPORATE BOUNDARY CONDITIONS INTO COEFFICIENT ARRAY # ########################################################## # Roll to keep the pro...
def build_diagonals(self): """ Builds the diagonals for the coefficient array """ ########################################################## # INCORPORATE BOUNDARY CONDITIONS INTO COEFFICIENT ARRAY # ########################################################## # Roll to keep the pro...
[ "Builds", "the", "diagonals", "for", "the", "coefficient", "array" ]
awickert/gFlex
python
https://github.com/awickert/gFlex/blob/3ac32249375b0f8d342a142585d86ea4d905a5a0/gflex/f1d.py#L344-L377
[ "def", "build_diagonals", "(", "self", ")", ":", "##########################################################\r", "# INCORPORATE BOUNDARY CONDITIONS INTO COEFFICIENT ARRAY #\r", "##########################################################\r", "# Roll to keep the proper coefficients at the proper pla...
3ac32249375b0f8d342a142585d86ea4d905a5a0
train
F1D.BC_Periodic
Periodic boundary conditions: wraparound to the other side.
gflex/f1d.py
def BC_Periodic(self): """ Periodic boundary conditions: wraparound to the other side. """ if self.BC_E == 'Periodic' and self.BC_W == 'Periodic': # If both boundaries are periodic, we are good to go (and self-consistent) pass # It is just a shift in the coeff. matrix creation. el...
def BC_Periodic(self): """ Periodic boundary conditions: wraparound to the other side. """ if self.BC_E == 'Periodic' and self.BC_W == 'Periodic': # If both boundaries are periodic, we are good to go (and self-consistent) pass # It is just a shift in the coeff. matrix creation. el...
[ "Periodic", "boundary", "conditions", ":", "wraparound", "to", "the", "other", "side", "." ]
awickert/gFlex
python
https://github.com/awickert/gFlex/blob/3ac32249375b0f8d342a142585d86ea4d905a5a0/gflex/f1d.py#L379-L398
[ "def", "BC_Periodic", "(", "self", ")", ":", "if", "self", ".", "BC_E", "==", "'Periodic'", "and", "self", ".", "BC_W", "==", "'Periodic'", ":", "# If both boundaries are periodic, we are good to go (and self-consistent)\r", "pass", "# It is just a shift in the coeff. matri...
3ac32249375b0f8d342a142585d86ea4d905a5a0
train
F1D.BC_0Displacement0Slope
0Displacement0Slope boundary condition for 0 deflection. This requires that nothing be done to the edges of the solution array, because the lack of the off-grid terms implies that they go to 0 Here we just turn the cells outside the array into nan, to ensure that we are not accidentally including ...
gflex/f1d.py
def BC_0Displacement0Slope(self): """ 0Displacement0Slope boundary condition for 0 deflection. This requires that nothing be done to the edges of the solution array, because the lack of the off-grid terms implies that they go to 0 Here we just turn the cells outside the array into nan, to ensu...
def BC_0Displacement0Slope(self): """ 0Displacement0Slope boundary condition for 0 deflection. This requires that nothing be done to the edges of the solution array, because the lack of the off-grid terms implies that they go to 0 Here we just turn the cells outside the array into nan, to ensu...
[ "0Displacement0Slope", "boundary", "condition", "for", "0", "deflection", ".", "This", "requires", "that", "nothing", "be", "done", "to", "the", "edges", "of", "the", "solution", "array", "because", "the", "lack", "of", "the", "off", "-", "grid", "terms", "i...
awickert/gFlex
python
https://github.com/awickert/gFlex/blob/3ac32249375b0f8d342a142585d86ea4d905a5a0/gflex/f1d.py#L400-L434
[ "def", "BC_0Displacement0Slope", "(", "self", ")", ":", "if", "self", ".", "BC_W", "==", "'0Displacement0Slope'", ":", "i", "=", "0", "self", ".", "l2", "[", "i", "]", "=", "np", ".", "nan", "self", ".", "l1", "[", "i", "]", "=", "np", ".", "nan"...
3ac32249375b0f8d342a142585d86ea4d905a5a0
train
F1D.BC_0Slope0Shear
This boundary condition is esentially a Neumann 0-gradient boundary condition with that 0-gradient state extended over a longer part of the grid such that the third derivative also equals 0. This boundary condition has more of a geometric meaning than a physical meaning. It produces a state...
gflex/f1d.py
def BC_0Slope0Shear(self): i=0 """ This boundary condition is esentially a Neumann 0-gradient boundary condition with that 0-gradient state extended over a longer part of the grid such that the third derivative also equals 0. This boundary condition has more of a geometric meaning ...
def BC_0Slope0Shear(self): i=0 """ This boundary condition is esentially a Neumann 0-gradient boundary condition with that 0-gradient state extended over a longer part of the grid such that the third derivative also equals 0. This boundary condition has more of a geometric meaning ...
[ "This", "boundary", "condition", "is", "esentially", "a", "Neumann", "0", "-", "gradient", "boundary", "condition", "with", "that", "0", "-", "gradient", "state", "extended", "over", "a", "longer", "part", "of", "the", "grid", "such", "that", "the", "third",...
awickert/gFlex
python
https://github.com/awickert/gFlex/blob/3ac32249375b0f8d342a142585d86ea4d905a5a0/gflex/f1d.py#L436-L477
[ "def", "BC_0Slope0Shear", "(", "self", ")", ":", "i", "=", "0", "if", "self", ".", "BC_W", "==", "'0Slope0Shear'", ":", "i", "=", "0", "self", ".", "l2", "[", "i", "]", "=", "np", ".", "nan", "self", ".", "l1", "[", "i", "]", "=", "np", ".", ...
3ac32249375b0f8d342a142585d86ea4d905a5a0
train
F1D.BC_Mirror
Mirrors qs across the boundary on either the west (left) or east (right) side, depending on the selections. This can, for example, produce a scenario in which you are observing a mountain range up to the range crest (or, more correctly, the halfway point across the mountain range).
gflex/f1d.py
def BC_Mirror(self): """ Mirrors qs across the boundary on either the west (left) or east (right) side, depending on the selections. This can, for example, produce a scenario in which you are observing a mountain range up to the range crest (or, more correctly, the halfway point a...
def BC_Mirror(self): """ Mirrors qs across the boundary on either the west (left) or east (right) side, depending on the selections. This can, for example, produce a scenario in which you are observing a mountain range up to the range crest (or, more correctly, the halfway point a...
[ "Mirrors", "qs", "across", "the", "boundary", "on", "either", "the", "west", "(", "left", ")", "or", "east", "(", "right", ")", "side", "depending", "on", "the", "selections", ".", "This", "can", "for", "example", "produce", "a", "scenario", "in", "which...
awickert/gFlex
python
https://github.com/awickert/gFlex/blob/3ac32249375b0f8d342a142585d86ea4d905a5a0/gflex/f1d.py#L525-L558
[ "def", "BC_Mirror", "(", "self", ")", ":", "if", "self", ".", "BC_W", "==", "'Mirror'", ":", "i", "=", "0", "#self.l2[i] += np.nan\r", "#self.l1[i] += np.nan\r", "self", ".", "c0", "[", "i", "]", "+=", "0", "self", ".", "r1", "[", "i", "]", "+=", "se...
3ac32249375b0f8d342a142585d86ea4d905a5a0
train
F1D.calc_max_flexural_wavelength
Returns the approximate maximum flexural wavelength This is important when padding of the grid is required: in Flexure (this code), grids are padded out to one maximum flexural wavelength, but in any case, the flexural wavelength is a good characteristic distance for any truncation limit
gflex/f1d.py
def calc_max_flexural_wavelength(self): """ Returns the approximate maximum flexural wavelength This is important when padding of the grid is required: in Flexure (this code), grids are padded out to one maximum flexural wavelength, but in any case, the flexural wavelength is a good character...
def calc_max_flexural_wavelength(self): """ Returns the approximate maximum flexural wavelength This is important when padding of the grid is required: in Flexure (this code), grids are padded out to one maximum flexural wavelength, but in any case, the flexural wavelength is a good character...
[ "Returns", "the", "approximate", "maximum", "flexural", "wavelength", "This", "is", "important", "when", "padding", "of", "the", "grid", "is", "required", ":", "in", "Flexure", "(", "this", "code", ")", "grids", "are", "padded", "out", "to", "one", "maximum"...
awickert/gFlex
python
https://github.com/awickert/gFlex/blob/3ac32249375b0f8d342a142585d86ea4d905a5a0/gflex/f1d.py#L562-L578
[ "def", "calc_max_flexural_wavelength", "(", "self", ")", ":", "if", "np", ".", "isscalar", "(", "self", ".", "D", ")", ":", "Dmax", "=", "self", ".", "D", "else", ":", "Dmax", "=", "self", ".", "D", ".", "max", "(", ")", "# This is an approximation if ...
3ac32249375b0f8d342a142585d86ea4d905a5a0
train
F1D.fd_solve
w = fd_solve() where coeff is the sparse coefficient matrix output from function coeff_matrix and qs is the array of loads (stresses) Sparse solver for one-dimensional flexure of an elastic plate
gflex/f1d.py
def fd_solve(self): """ w = fd_solve() where coeff is the sparse coefficient matrix output from function coeff_matrix and qs is the array of loads (stresses) Sparse solver for one-dimensional flexure of an elastic plate """ if self.Debug: print("qs", self.qs.shape) ...
def fd_solve(self): """ w = fd_solve() where coeff is the sparse coefficient matrix output from function coeff_matrix and qs is the array of loads (stresses) Sparse solver for one-dimensional flexure of an elastic plate """ if self.Debug: print("qs", self.qs.shape) ...
[ "w", "=", "fd_solve", "()", "where", "coeff", "is", "the", "sparse", "coefficient", "matrix", "output", "from", "function", "coeff_matrix", "and", "qs", "is", "the", "array", "of", "loads", "(", "stresses", ")", "Sparse", "solver", "for", "one", "-", "dime...
awickert/gFlex
python
https://github.com/awickert/gFlex/blob/3ac32249375b0f8d342a142585d86ea4d905a5a0/gflex/f1d.py#L580-L621
[ "def", "fd_solve", "(", "self", ")", ":", "if", "self", ".", "Debug", ":", "print", "(", "\"qs\"", ",", "self", ".", "qs", ".", "shape", ")", "print", "(", "\"Te\"", ",", "self", ".", "Te", ".", "shape", ")", "self", ".", "calc_max_flexural_wavelengt...
3ac32249375b0f8d342a142585d86ea4d905a5a0
train
m2m_changed_handler
A model's save() never gets called on ManyToManyField changes, m2m_changed-signal is sent. sender = dynamically generated model in m2m-table instance = parent related_instance = instance being m2m'ed
djangohistory/signals.py
def m2m_changed_handler(sender, *args, **kwargs): """ A model's save() never gets called on ManyToManyField changes, m2m_changed-signal is sent. sender = dynamically generated model in m2m-table instance = parent related_instance = instance being m2m'ed """ action = kwargs['action'] inst...
def m2m_changed_handler(sender, *args, **kwargs): """ A model's save() never gets called on ManyToManyField changes, m2m_changed-signal is sent. sender = dynamically generated model in m2m-table instance = parent related_instance = instance being m2m'ed """ action = kwargs['action'] inst...
[ "A", "model", "s", "save", "()", "never", "gets", "called", "on", "ManyToManyField", "changes", "m2m_changed", "-", "signal", "is", "sent", ".", "sender", "=", "dynamically", "generated", "model", "in", "m2m", "-", "table", "instance", "=", "parent", "relate...
futurice/django-history
python
https://github.com/futurice/django-history/blob/8b618c331d50aa821182fed16090792993a1096b/djangohistory/signals.py#L47-L102
[ "def", "m2m_changed_handler", "(", "sender", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "action", "=", "kwargs", "[", "'action'", "]", "instance", "=", "kwargs", "[", "'instance'", "]", "logger", ".", "debug", "(", "\"m2m_changed: %s (%s) {%s}\"", ...
8b618c331d50aa821182fed16090792993a1096b
train
_gt_from_lt
Return a > b. Computed by @total_ordering from (not a < b) and (a != b).
pureyaml/_compat/total_ordering.py
def _gt_from_lt(self, other): """Return a > b. Computed by @total_ordering from (not a < b) and (a != b).""" op_result = self.__lt__(other) if op_result is NotImplemented: return NotImplemented return not op_result and self != other
def _gt_from_lt(self, other): """Return a > b. Computed by @total_ordering from (not a < b) and (a != b).""" op_result = self.__lt__(other) if op_result is NotImplemented: return NotImplemented return not op_result and self != other
[ "Return", "a", ">", "b", ".", "Computed", "by" ]
bionikspoon/pureyaml
python
https://github.com/bionikspoon/pureyaml/blob/784830b907ca14525c4cecdb6ae35306f6f8a877/pureyaml/_compat/total_ordering.py#L16-L21
[ "def", "_gt_from_lt", "(", "self", ",", "other", ")", ":", "op_result", "=", "self", ".", "__lt__", "(", "other", ")", "if", "op_result", "is", "NotImplemented", ":", "return", "NotImplemented", "return", "not", "op_result", "and", "self", "!=", "other" ]
784830b907ca14525c4cecdb6ae35306f6f8a877
train
_le_from_lt
Return a <= b. Computed by @total_ordering from (a < b) or (a == b).
pureyaml/_compat/total_ordering.py
def _le_from_lt(self, other): """Return a <= b. Computed by @total_ordering from (a < b) or (a == b).""" op_result = self.__lt__(other) return op_result or self == other
def _le_from_lt(self, other): """Return a <= b. Computed by @total_ordering from (a < b) or (a == b).""" op_result = self.__lt__(other) return op_result or self == other
[ "Return", "a", "<", "=", "b", ".", "Computed", "by" ]
bionikspoon/pureyaml
python
https://github.com/bionikspoon/pureyaml/blob/784830b907ca14525c4cecdb6ae35306f6f8a877/pureyaml/_compat/total_ordering.py#L24-L27
[ "def", "_le_from_lt", "(", "self", ",", "other", ")", ":", "op_result", "=", "self", ".", "__lt__", "(", "other", ")", "return", "op_result", "or", "self", "==", "other" ]
784830b907ca14525c4cecdb6ae35306f6f8a877
train
_ge_from_lt
Return a >= b. Computed by @total_ordering from (not a < b).
pureyaml/_compat/total_ordering.py
def _ge_from_lt(self, other): """Return a >= b. Computed by @total_ordering from (not a < b).""" op_result = self.__lt__(other) if op_result is NotImplemented: return NotImplemented return not op_result
def _ge_from_lt(self, other): """Return a >= b. Computed by @total_ordering from (not a < b).""" op_result = self.__lt__(other) if op_result is NotImplemented: return NotImplemented return not op_result
[ "Return", "a", ">", "=", "b", ".", "Computed", "by" ]
bionikspoon/pureyaml
python
https://github.com/bionikspoon/pureyaml/blob/784830b907ca14525c4cecdb6ae35306f6f8a877/pureyaml/_compat/total_ordering.py#L30-L35
[ "def", "_ge_from_lt", "(", "self", ",", "other", ")", ":", "op_result", "=", "self", ".", "__lt__", "(", "other", ")", "if", "op_result", "is", "NotImplemented", ":", "return", "NotImplemented", "return", "not", "op_result" ]
784830b907ca14525c4cecdb6ae35306f6f8a877
train
_ge_from_le
Return a >= b. Computed by @total_ordering from (not a <= b) or (a == b).
pureyaml/_compat/total_ordering.py
def _ge_from_le(self, other): """Return a >= b. Computed by @total_ordering from (not a <= b) or (a == b).""" op_result = self.__le__(other) if op_result is NotImplemented: return NotImplemented return not op_result or self == other
def _ge_from_le(self, other): """Return a >= b. Computed by @total_ordering from (not a <= b) or (a == b).""" op_result = self.__le__(other) if op_result is NotImplemented: return NotImplemented return not op_result or self == other
[ "Return", "a", ">", "=", "b", ".", "Computed", "by" ]
bionikspoon/pureyaml
python
https://github.com/bionikspoon/pureyaml/blob/784830b907ca14525c4cecdb6ae35306f6f8a877/pureyaml/_compat/total_ordering.py#L38-L43
[ "def", "_ge_from_le", "(", "self", ",", "other", ")", ":", "op_result", "=", "self", ".", "__le__", "(", "other", ")", "if", "op_result", "is", "NotImplemented", ":", "return", "NotImplemented", "return", "not", "op_result", "or", "self", "==", "other" ]
784830b907ca14525c4cecdb6ae35306f6f8a877
train
_lt_from_le
Return a < b. Computed by @total_ordering from (a <= b) and (a != b).
pureyaml/_compat/total_ordering.py
def _lt_from_le(self, other): """Return a < b. Computed by @total_ordering from (a <= b) and (a != b).""" op_result = self.__le__(other) if op_result is NotImplemented: return NotImplemented return op_result and self != other
def _lt_from_le(self, other): """Return a < b. Computed by @total_ordering from (a <= b) and (a != b).""" op_result = self.__le__(other) if op_result is NotImplemented: return NotImplemented return op_result and self != other
[ "Return", "a", "<", "b", ".", "Computed", "by" ]
bionikspoon/pureyaml
python
https://github.com/bionikspoon/pureyaml/blob/784830b907ca14525c4cecdb6ae35306f6f8a877/pureyaml/_compat/total_ordering.py#L46-L51
[ "def", "_lt_from_le", "(", "self", ",", "other", ")", ":", "op_result", "=", "self", ".", "__le__", "(", "other", ")", "if", "op_result", "is", "NotImplemented", ":", "return", "NotImplemented", "return", "op_result", "and", "self", "!=", "other" ]
784830b907ca14525c4cecdb6ae35306f6f8a877
train
_gt_from_le
Return a > b. Computed by @total_ordering from (not a <= b).
pureyaml/_compat/total_ordering.py
def _gt_from_le(self, other): """Return a > b. Computed by @total_ordering from (not a <= b).""" op_result = self.__le__(other) if op_result is NotImplemented: return NotImplemented return not op_result
def _gt_from_le(self, other): """Return a > b. Computed by @total_ordering from (not a <= b).""" op_result = self.__le__(other) if op_result is NotImplemented: return NotImplemented return not op_result
[ "Return", "a", ">", "b", ".", "Computed", "by" ]
bionikspoon/pureyaml
python
https://github.com/bionikspoon/pureyaml/blob/784830b907ca14525c4cecdb6ae35306f6f8a877/pureyaml/_compat/total_ordering.py#L54-L59
[ "def", "_gt_from_le", "(", "self", ",", "other", ")", ":", "op_result", "=", "self", ".", "__le__", "(", "other", ")", "if", "op_result", "is", "NotImplemented", ":", "return", "NotImplemented", "return", "not", "op_result" ]
784830b907ca14525c4cecdb6ae35306f6f8a877
train
_lt_from_gt
Return a < b. Computed by @total_ordering from (not a > b) and (a != b).
pureyaml/_compat/total_ordering.py
def _lt_from_gt(self, other): """Return a < b. Computed by @total_ordering from (not a > b) and (a != b).""" op_result = self.__gt__(other) if op_result is NotImplemented: return NotImplemented return not op_result and self != other
def _lt_from_gt(self, other): """Return a < b. Computed by @total_ordering from (not a > b) and (a != b).""" op_result = self.__gt__(other) if op_result is NotImplemented: return NotImplemented return not op_result and self != other
[ "Return", "a", "<", "b", ".", "Computed", "by" ]
bionikspoon/pureyaml
python
https://github.com/bionikspoon/pureyaml/blob/784830b907ca14525c4cecdb6ae35306f6f8a877/pureyaml/_compat/total_ordering.py#L62-L67
[ "def", "_lt_from_gt", "(", "self", ",", "other", ")", ":", "op_result", "=", "self", ".", "__gt__", "(", "other", ")", "if", "op_result", "is", "NotImplemented", ":", "return", "NotImplemented", "return", "not", "op_result", "and", "self", "!=", "other" ]
784830b907ca14525c4cecdb6ae35306f6f8a877
train
_ge_from_gt
Return a >= b. Computed by @total_ordering from (a > b) or (a == b).
pureyaml/_compat/total_ordering.py
def _ge_from_gt(self, other): """Return a >= b. Computed by @total_ordering from (a > b) or (a == b).""" op_result = self.__gt__(other) return op_result or self == other
def _ge_from_gt(self, other): """Return a >= b. Computed by @total_ordering from (a > b) or (a == b).""" op_result = self.__gt__(other) return op_result or self == other
[ "Return", "a", ">", "=", "b", ".", "Computed", "by" ]
bionikspoon/pureyaml
python
https://github.com/bionikspoon/pureyaml/blob/784830b907ca14525c4cecdb6ae35306f6f8a877/pureyaml/_compat/total_ordering.py#L70-L73
[ "def", "_ge_from_gt", "(", "self", ",", "other", ")", ":", "op_result", "=", "self", ".", "__gt__", "(", "other", ")", "return", "op_result", "or", "self", "==", "other" ]
784830b907ca14525c4cecdb6ae35306f6f8a877
train
_le_from_gt
Return a <= b. Computed by @total_ordering from (not a > b).
pureyaml/_compat/total_ordering.py
def _le_from_gt(self, other): """Return a <= b. Computed by @total_ordering from (not a > b).""" op_result = self.__gt__(other) if op_result is NotImplemented: return NotImplemented return not op_result
def _le_from_gt(self, other): """Return a <= b. Computed by @total_ordering from (not a > b).""" op_result = self.__gt__(other) if op_result is NotImplemented: return NotImplemented return not op_result
[ "Return", "a", "<", "=", "b", ".", "Computed", "by" ]
bionikspoon/pureyaml
python
https://github.com/bionikspoon/pureyaml/blob/784830b907ca14525c4cecdb6ae35306f6f8a877/pureyaml/_compat/total_ordering.py#L76-L81
[ "def", "_le_from_gt", "(", "self", ",", "other", ")", ":", "op_result", "=", "self", ".", "__gt__", "(", "other", ")", "if", "op_result", "is", "NotImplemented", ":", "return", "NotImplemented", "return", "not", "op_result" ]
784830b907ca14525c4cecdb6ae35306f6f8a877
train
_le_from_ge
Return a <= b. Computed by @total_ordering from (not a >= b) or (a == b).
pureyaml/_compat/total_ordering.py
def _le_from_ge(self, other): """Return a <= b. Computed by @total_ordering from (not a >= b) or (a == b).""" op_result = self.__ge__(other) if op_result is NotImplemented: return NotImplemented return not op_result or self == other
def _le_from_ge(self, other): """Return a <= b. Computed by @total_ordering from (not a >= b) or (a == b).""" op_result = self.__ge__(other) if op_result is NotImplemented: return NotImplemented return not op_result or self == other
[ "Return", "a", "<", "=", "b", ".", "Computed", "by" ]
bionikspoon/pureyaml
python
https://github.com/bionikspoon/pureyaml/blob/784830b907ca14525c4cecdb6ae35306f6f8a877/pureyaml/_compat/total_ordering.py#L84-L89
[ "def", "_le_from_ge", "(", "self", ",", "other", ")", ":", "op_result", "=", "self", ".", "__ge__", "(", "other", ")", "if", "op_result", "is", "NotImplemented", ":", "return", "NotImplemented", "return", "not", "op_result", "or", "self", "==", "other" ]
784830b907ca14525c4cecdb6ae35306f6f8a877
train
_gt_from_ge
Return a > b. Computed by @total_ordering from (a >= b) and (a != b).
pureyaml/_compat/total_ordering.py
def _gt_from_ge(self, other): """Return a > b. Computed by @total_ordering from (a >= b) and (a != b).""" op_result = self.__ge__(other) if op_result is NotImplemented: return NotImplemented return op_result and self != other
def _gt_from_ge(self, other): """Return a > b. Computed by @total_ordering from (a >= b) and (a != b).""" op_result = self.__ge__(other) if op_result is NotImplemented: return NotImplemented return op_result and self != other
[ "Return", "a", ">", "b", ".", "Computed", "by" ]
bionikspoon/pureyaml
python
https://github.com/bionikspoon/pureyaml/blob/784830b907ca14525c4cecdb6ae35306f6f8a877/pureyaml/_compat/total_ordering.py#L92-L97
[ "def", "_gt_from_ge", "(", "self", ",", "other", ")", ":", "op_result", "=", "self", ".", "__ge__", "(", "other", ")", "if", "op_result", "is", "NotImplemented", ":", "return", "NotImplemented", "return", "op_result", "and", "self", "!=", "other" ]
784830b907ca14525c4cecdb6ae35306f6f8a877
train
_lt_from_ge
Return a < b. Computed by @total_ordering from (not a >= b).
pureyaml/_compat/total_ordering.py
def _lt_from_ge(self, other): """Return a < b. Computed by @total_ordering from (not a >= b).""" op_result = self.__ge__(other) if op_result is NotImplemented: return NotImplemented return not op_result
def _lt_from_ge(self, other): """Return a < b. Computed by @total_ordering from (not a >= b).""" op_result = self.__ge__(other) if op_result is NotImplemented: return NotImplemented return not op_result
[ "Return", "a", "<", "b", ".", "Computed", "by" ]
bionikspoon/pureyaml
python
https://github.com/bionikspoon/pureyaml/blob/784830b907ca14525c4cecdb6ae35306f6f8a877/pureyaml/_compat/total_ordering.py#L100-L105
[ "def", "_lt_from_ge", "(", "self", ",", "other", ")", ":", "op_result", "=", "self", ".", "__ge__", "(", "other", ")", "if", "op_result", "is", "NotImplemented", ":", "return", "NotImplemented", "return", "not", "op_result" ]
784830b907ca14525c4cecdb6ae35306f6f8a877
train
total_ordering
Class decorator that fills in missing ordering methods
pureyaml/_compat/total_ordering.py
def total_ordering(cls): """Class decorator that fills in missing ordering methods""" convert = { # :off '__lt__': [('__gt__', _gt_from_lt), ('__le__', _le_from_lt), ('__ge__', _ge_from_lt)], '__le__': [('__ge__', _ge_from_le), ('__lt__',...
def total_ordering(cls): """Class decorator that fills in missing ordering methods""" convert = { # :off '__lt__': [('__gt__', _gt_from_lt), ('__le__', _le_from_lt), ('__ge__', _ge_from_lt)], '__le__': [('__ge__', _ge_from_le), ('__lt__',...
[ "Class", "decorator", "that", "fills", "in", "missing", "ordering", "methods" ]
bionikspoon/pureyaml
python
https://github.com/bionikspoon/pureyaml/blob/784830b907ca14525c4cecdb6ae35306f6f8a877/pureyaml/_compat/total_ordering.py#L109-L138
[ "def", "total_ordering", "(", "cls", ")", ":", "convert", "=", "{", "# :off", "'__lt__'", ":", "[", "(", "'__gt__'", ",", "_gt_from_lt", ")", ",", "(", "'__le__'", ",", "_le_from_lt", ")", ",", "(", "'__ge__'", ",", "_ge_from_lt", ")", "]", ",", "'__le...
784830b907ca14525c4cecdb6ae35306f6f8a877
train
createArchiveExample
Creates Combine Archive containing the given file. :param fileName: file to include in the archive :return: None
examples/python/createArchiveExample.py
def createArchiveExample(fileName): """ Creates Combine Archive containing the given file. :param fileName: file to include in the archive :return: None """ print('*' * 80) print('Create archive') print('*' * 80) archive = CombineArchive() archive.addFile( fileName, # file...
def createArchiveExample(fileName): """ Creates Combine Archive containing the given file. :param fileName: file to include in the archive :return: None """ print('*' * 80) print('Create archive') print('*' * 80) archive = CombineArchive() archive.addFile( fileName, # file...
[ "Creates", "Combine", "Archive", "containing", "the", "given", "file", "." ]
sbmlteam/libCombine
python
https://github.com/sbmlteam/libCombine/blob/d7c11a90129dedbcc8bdba8d204be03f1dd0c3e4/examples/python/createArchiveExample.py#L11-L57
[ "def", "createArchiveExample", "(", "fileName", ")", ":", "print", "(", "'*'", "*", "80", ")", "print", "(", "'Create archive'", ")", "print", "(", "'*'", "*", "80", ")", "archive", "=", "CombineArchive", "(", ")", "archive", ".", "addFile", "(", "fileNa...
d7c11a90129dedbcc8bdba8d204be03f1dd0c3e4
train
clean
Delete temporary files not under version control.
fabfile-dev.py
def clean(): '''Delete temporary files not under version control.''' basedir = dirname(__file__) print(cyan('delete temp files and dirs for packaging')) local(flo( 'rm -rf ' '{basedir}/.eggs/ ' '{basedir}/fabsetup.egg-info/ ' '{basedir}/dist ' '{basedir}/REA...
def clean(): '''Delete temporary files not under version control.''' basedir = dirname(__file__) print(cyan('delete temp files and dirs for packaging')) local(flo( 'rm -rf ' '{basedir}/.eggs/ ' '{basedir}/fabsetup.egg-info/ ' '{basedir}/dist ' '{basedir}/REA...
[ "Delete", "temporary", "files", "not", "under", "version", "control", "." ]
theno/fabsetup
python
https://github.com/theno/fabsetup/blob/ced728abff93551ba5677e63bc1bdc0ef5ca5777/fabfile-dev.py#L43-L72
[ "def", "clean", "(", ")", ":", "basedir", "=", "dirname", "(", "__file__", ")", "print", "(", "cyan", "(", "'delete temp files and dirs for packaging'", ")", ")", "local", "(", "flo", "(", "'rm -rf '", "'{basedir}/.eggs/ '", "'{basedir}/fabsetup.egg-info/ '", "'{...
ced728abff93551ba5677e63bc1bdc0ef5ca5777
train
pypi
Build package and upload to pypi.
fabfile-dev.py
def pypi(): '''Build package and upload to pypi.''' if not query_yes_no('version updated in ' '`fabsetup/_version.py`?'): print('abort') else: print(cyan('\n## clean-up\n')) execute(clean) basedir = dirname(__file__) # latest_pythons = _deter...
def pypi(): '''Build package and upload to pypi.''' if not query_yes_no('version updated in ' '`fabsetup/_version.py`?'): print('abort') else: print(cyan('\n## clean-up\n')) execute(clean) basedir = dirname(__file__) # latest_pythons = _deter...
[ "Build", "package", "and", "upload", "to", "pypi", "." ]
theno/fabsetup
python
https://github.com/theno/fabsetup/blob/ced728abff93551ba5677e63bc1bdc0ef5ca5777/fabfile-dev.py#L76-L97
[ "def", "pypi", "(", ")", ":", "if", "not", "query_yes_no", "(", "'version updated in '", "'`fabsetup/_version.py`?'", ")", ":", "print", "(", "'abort'", ")", "else", ":", "print", "(", "cyan", "(", "'\\n## clean-up\\n'", ")", ")", "execute", "(", "clean", ")...
ced728abff93551ba5677e63bc1bdc0ef5ca5777
train
calc_deviation
Calculate the standard deviation of a list of values @param values: list(float) @param average: @return:
serviceping/serviceping.py
def calc_deviation(values, average): """ Calculate the standard deviation of a list of values @param values: list(float) @param average: @return: """ size = len(values) if size < 2: return 0 calc_sum = 0.0 for number in range(0, size): calc_sum += math.sqrt((valu...
def calc_deviation(values, average): """ Calculate the standard deviation of a list of values @param values: list(float) @param average: @return: """ size = len(values) if size < 2: return 0 calc_sum = 0.0 for number in range(0, size): calc_sum += math.sqrt((valu...
[ "Calculate", "the", "standard", "deviation", "of", "a", "list", "of", "values" ]
yahoo/serviceping
python
https://github.com/yahoo/serviceping/blob/1f9df5ee5b3cba466426b1164262278472ba4977/serviceping/serviceping.py#L106-L120
[ "def", "calc_deviation", "(", "values", ",", "average", ")", ":", "size", "=", "len", "(", "values", ")", "if", "size", "<", "2", ":", "return", "0", "calc_sum", "=", "0.0", "for", "number", "in", "range", "(", "0", ",", "size", ")", ":", "calc_sum...
1f9df5ee5b3cba466426b1164262278472ba4977
train
StatsList.append
Append a value to the stats list Parameters ---------- value : float The value to add
serviceping/serviceping.py
def append(self, value): """ Append a value to the stats list Parameters ---------- value : float The value to add """ self.count += 1 if self.count == 1: self.old_m = self.new_m = value self.old_s = 0 else: ...
def append(self, value): """ Append a value to the stats list Parameters ---------- value : float The value to add """ self.count += 1 if self.count == 1: self.old_m = self.new_m = value self.old_s = 0 else: ...
[ "Append", "a", "value", "to", "the", "stats", "list" ]
yahoo/serviceping
python
https://github.com/yahoo/serviceping/blob/1f9df5ee5b3cba466426b1164262278472ba4977/serviceping/serviceping.py#L35-L54
[ "def", "append", "(", "self", ",", "value", ")", ":", "self", ".", "count", "+=", "1", "if", "self", ".", "count", "==", "1", ":", "self", ".", "old_m", "=", "self", ".", "new_m", "=", "value", "self", ".", "old_s", "=", "0", "else", ":", "self...
1f9df5ee5b3cba466426b1164262278472ba4977
train
pipeline
Chain results from a list of functions. Inverted reduce. :param (function) steps: List of function callbacks :param initial: Starting value for pipeline.
docs/github_docs.py
def pipeline(steps, initial=None): """ Chain results from a list of functions. Inverted reduce. :param (function) steps: List of function callbacks :param initial: Starting value for pipeline. """ def apply(result, step): return step(result) return reduce(apply, steps, initial)
def pipeline(steps, initial=None): """ Chain results from a list of functions. Inverted reduce. :param (function) steps: List of function callbacks :param initial: Starting value for pipeline. """ def apply(result, step): return step(result) return reduce(apply, steps, initial)
[ "Chain", "results", "from", "a", "list", "of", "functions", ".", "Inverted", "reduce", "." ]
bionikspoon/pureyaml
python
https://github.com/bionikspoon/pureyaml/blob/784830b907ca14525c4cecdb6ae35306f6f8a877/docs/github_docs.py#L186-L197
[ "def", "pipeline", "(", "steps", ",", "initial", "=", "None", ")", ":", "def", "apply", "(", "result", ",", "step", ")", ":", "return", "step", "(", "result", ")", "return", "reduce", "(", "apply", ",", "steps", ",", "initial", ")" ]
784830b907ca14525c4cecdb6ae35306f6f8a877
train
enver
%prog [<name>=[value]] To show all environment variables, call with no parameters: %prog To Add/Modify/Delete environment variable: %prog <name>=[value] If <name> is PATH or PATHEXT, %prog will by default append the value using a semicolon as a separator. Use -r to disable this behavior or -a to force it for...
jaraco/windows/environ.py
def enver(*args): """ %prog [<name>=[value]] To show all environment variables, call with no parameters: %prog To Add/Modify/Delete environment variable: %prog <name>=[value] If <name> is PATH or PATHEXT, %prog will by default append the value using a semicolon as a separator. Use -r to disable this behavio...
def enver(*args): """ %prog [<name>=[value]] To show all environment variables, call with no parameters: %prog To Add/Modify/Delete environment variable: %prog <name>=[value] If <name> is PATH or PATHEXT, %prog will by default append the value using a semicolon as a separator. Use -r to disable this behavio...
[ "%prog", "[", "<name", ">", "=", "[", "value", "]]" ]
jaraco/jaraco.windows
python
https://github.com/jaraco/jaraco.windows/blob/51811efed50b46ad08daa25408a1cc806bc8d519/jaraco/windows/environ.py#L172-L253
[ "def", "enver", "(", "*", "args", ")", ":", "from", "optparse", "import", "OptionParser", "parser", "=", "OptionParser", "(", "usage", "=", "trim", "(", "enver", ".", "__doc__", ")", ")", "parser", ".", "add_option", "(", "'-U'", ",", "'--user-environment'...
51811efed50b46ad08daa25408a1cc806bc8d519
train
RegisteredEnvironment.add
Add a value to a delimited variable, but only when the value isn't already present.
jaraco/windows/environ.py
def add(class_, name, value, sep=';'): """ Add a value to a delimited variable, but only when the value isn't already present. """ values = class_.get_values_list(name, sep) if value in values: return new_value = sep.join(values + [value]) winreg.SetValueEx( class_.key, name, 0, winreg.REG_EXPAND_...
def add(class_, name, value, sep=';'): """ Add a value to a delimited variable, but only when the value isn't already present. """ values = class_.get_values_list(name, sep) if value in values: return new_value = sep.join(values + [value]) winreg.SetValueEx( class_.key, name, 0, winreg.REG_EXPAND_...
[ "Add", "a", "value", "to", "a", "delimited", "variable", "but", "only", "when", "the", "value", "isn", "t", "already", "present", "." ]
jaraco/jaraco.windows
python
https://github.com/jaraco/jaraco.windows/blob/51811efed50b46ad08daa25408a1cc806bc8d519/jaraco/windows/environ.py#L84-L95
[ "def", "add", "(", "class_", ",", "name", ",", "value", ",", "sep", "=", "';'", ")", ":", "values", "=", "class_", ".", "get_values_list", "(", "name", ",", "sep", ")", "if", "value", "in", "values", ":", "return", "new_value", "=", "sep", ".", "jo...
51811efed50b46ad08daa25408a1cc806bc8d519
train
RegisteredEnvironment.notify
Notify other windows that the environment has changed (following http://support.microsoft.com/kb/104011).
jaraco/windows/environ.py
def notify(class_): """ Notify other windows that the environment has changed (following http://support.microsoft.com/kb/104011). """ # TODO: Implement Microsoft UIPI (User Interface Privilege Isolation) to # elevate privilege to system level so the system gets this notification # for now, this must be r...
def notify(class_): """ Notify other windows that the environment has changed (following http://support.microsoft.com/kb/104011). """ # TODO: Implement Microsoft UIPI (User Interface Privilege Isolation) to # elevate privilege to system level so the system gets this notification # for now, this must be r...
[ "Notify", "other", "windows", "that", "the", "environment", "has", "changed", "(", "following", "http", ":", "//", "support", ".", "microsoft", ".", "com", "/", "kb", "/", "104011", ")", "." ]
jaraco/jaraco.windows
python
https://github.com/jaraco/jaraco.windows/blob/51811efed50b46ad08daa25408a1cc806bc8d519/jaraco/windows/environ.py#L128-L146
[ "def", "notify", "(", "class_", ")", ":", "# TODO: Implement Microsoft UIPI (User Interface Privilege Isolation) to", "# elevate privilege to system level so the system gets this notification", "# for now, this must be run as admin to work as expected", "return_val", "=", "ctypes", ".", "...
51811efed50b46ad08daa25408a1cc806bc8d519
train
Info.current
Windows Platform SDK GetTimeZoneInformation
jaraco/windows/timezone.py
def current(class_): "Windows Platform SDK GetTimeZoneInformation" tzi = class_() kernel32 = ctypes.windll.kernel32 getter = kernel32.GetTimeZoneInformation getter = getattr(kernel32, 'GetDynamicTimeZoneInformation', getter) code = getter(ctypes.byref(tzi)) return code, tzi
def current(class_): "Windows Platform SDK GetTimeZoneInformation" tzi = class_() kernel32 = ctypes.windll.kernel32 getter = kernel32.GetTimeZoneInformation getter = getattr(kernel32, 'GetDynamicTimeZoneInformation', getter) code = getter(ctypes.byref(tzi)) return code, tzi
[ "Windows", "Platform", "SDK", "GetTimeZoneInformation" ]
jaraco/jaraco.windows
python
https://github.com/jaraco/jaraco.windows/blob/51811efed50b46ad08daa25408a1cc806bc8d519/jaraco/windows/timezone.py#L168-L175
[ "def", "current", "(", "class_", ")", ":", "tzi", "=", "class_", "(", ")", "kernel32", "=", "ctypes", ".", "windll", ".", "kernel32", "getter", "=", "kernel32", ".", "GetTimeZoneInformation", "getter", "=", "getattr", "(", "kernel32", ",", "'GetDynamicTimeZo...
51811efed50b46ad08daa25408a1cc806bc8d519
train
Info.dynamic_info
Return a map that for a given year will return the correct Info
jaraco/windows/timezone.py
def dynamic_info(self): "Return a map that for a given year will return the correct Info" if self.key_name: dyn_key = self.get_key().subkey('Dynamic DST') del dyn_key['FirstEntry'] del dyn_key['LastEntry'] years = map(int, dyn_key.keys()) values = map(Info, dyn_key.values()) # create a range mappi...
def dynamic_info(self): "Return a map that for a given year will return the correct Info" if self.key_name: dyn_key = self.get_key().subkey('Dynamic DST') del dyn_key['FirstEntry'] del dyn_key['LastEntry'] years = map(int, dyn_key.keys()) values = map(Info, dyn_key.values()) # create a range mappi...
[ "Return", "a", "map", "that", "for", "a", "given", "year", "will", "return", "the", "correct", "Info" ]
jaraco/jaraco.windows
python
https://github.com/jaraco/jaraco.windows/blob/51811efed50b46ad08daa25408a1cc806bc8d519/jaraco/windows/timezone.py#L198-L210
[ "def", "dynamic_info", "(", "self", ")", ":", "if", "self", ".", "key_name", ":", "dyn_key", "=", "self", ".", "get_key", "(", ")", ".", "subkey", "(", "'Dynamic DST'", ")", "del", "dyn_key", "[", "'FirstEntry'", "]", "del", "dyn_key", "[", "'LastEntry'"...
51811efed50b46ad08daa25408a1cc806bc8d519
train
Info._locate_day
Takes a SYSTEMTIME object, such as retrieved from a TIME_ZONE_INFORMATION structure or call to GetTimeZoneInformation and interprets it based on the given year to identify the actual day. This method is necessary because the SYSTEMTIME structure refers to a day by its day of the week and week of the month ...
jaraco/windows/timezone.py
def _locate_day(year, cutoff): """ Takes a SYSTEMTIME object, such as retrieved from a TIME_ZONE_INFORMATION structure or call to GetTimeZoneInformation and interprets it based on the given year to identify the actual day. This method is necessary because the SYSTEMTIME structure refers to a day by its ...
def _locate_day(year, cutoff): """ Takes a SYSTEMTIME object, such as retrieved from a TIME_ZONE_INFORMATION structure or call to GetTimeZoneInformation and interprets it based on the given year to identify the actual day. This method is necessary because the SYSTEMTIME structure refers to a day by its ...
[ "Takes", "a", "SYSTEMTIME", "object", "such", "as", "retrieved", "from", "a", "TIME_ZONE_INFORMATION", "structure", "or", "call", "to", "GetTimeZoneInformation", "and", "interprets", "it", "based", "on", "the", "given", "year", "to", "identify", "the", "actual", ...
jaraco/jaraco.windows
python
https://github.com/jaraco/jaraco.windows/blob/51811efed50b46ad08daa25408a1cc806bc8d519/jaraco/windows/timezone.py#L213-L254
[ "def", "_locate_day", "(", "year", ",", "cutoff", ")", ":", "# MS stores Sunday as 0, Python datetime stores Monday as zero", "target_weekday", "=", "(", "cutoff", ".", "day_of_week", "+", "6", ")", "%", "7", "# For SYSTEMTIMEs relating to time zone inforamtion, cutoff.day", ...
51811efed50b46ad08daa25408a1cc806bc8d519
train
no_redirect
Return a url matcher that will stop the redirect middleware and force Django to continue with regular URL matching. For use when you have a URL pattern you want to serve, and a broad catch-all pattern you want to redirect. :param pattern: regex URL patter that will definitely not redirect. :param locale...
redirect_urls/utils.py
def no_redirect(pattern, locale_prefix=True, re_flags=None): """ Return a url matcher that will stop the redirect middleware and force Django to continue with regular URL matching. For use when you have a URL pattern you want to serve, and a broad catch-all pattern you want to redirect. :param patte...
def no_redirect(pattern, locale_prefix=True, re_flags=None): """ Return a url matcher that will stop the redirect middleware and force Django to continue with regular URL matching. For use when you have a URL pattern you want to serve, and a broad catch-all pattern you want to redirect. :param patte...
[ "Return", "a", "url", "matcher", "that", "will", "stop", "the", "redirect", "middleware", "and", "force", "Django", "to", "continue", "with", "regular", "URL", "matching", ".", "For", "use", "when", "you", "have", "a", "URL", "pattern", "you", "want", "to"...
pmac/django-redirect-urls
python
https://github.com/pmac/django-redirect-urls/blob/21495194b0b2a2bdd1013e13ec0d54d34dd7f750/redirect_urls/utils.py#L104-L125
[ "def", "no_redirect", "(", "pattern", ",", "locale_prefix", "=", "True", ",", "re_flags", "=", "None", ")", ":", "if", "locale_prefix", ":", "pattern", "=", "pattern", ".", "lstrip", "(", "'^/'", ")", "pattern", "=", "LOCALE_RE", "+", "pattern", "if", "r...
21495194b0b2a2bdd1013e13ec0d54d34dd7f750
train
redirect
Return a url matcher suited for urlpatterns. pattern: the regex against which to match the requested URL. to: either a url name that `reverse` will find, a url that will simply be returned, or a function that will be given the request and url captures, and return the destination. permanent:...
redirect_urls/utils.py
def redirect(pattern, to, permanent=True, locale_prefix=True, anchor=None, name=None, query=None, vary=None, cache_timeout=12, decorators=None, re_flags=None, to_args=None, to_kwargs=None, prepend_locale=True, merge_query=False): """ Return a url matcher suited for urlpatterns. pa...
def redirect(pattern, to, permanent=True, locale_prefix=True, anchor=None, name=None, query=None, vary=None, cache_timeout=12, decorators=None, re_flags=None, to_args=None, to_kwargs=None, prepend_locale=True, merge_query=False): """ Return a url matcher suited for urlpatterns. pa...
[ "Return", "a", "url", "matcher", "suited", "for", "urlpatterns", "." ]
pmac/django-redirect-urls
python
https://github.com/pmac/django-redirect-urls/blob/21495194b0b2a2bdd1013e13ec0d54d34dd7f750/redirect_urls/utils.py#L128-L257
[ "def", "redirect", "(", "pattern", ",", "to", ",", "permanent", "=", "True", ",", "locale_prefix", "=", "True", ",", "anchor", "=", "None", ",", "name", "=", "None", ",", "query", "=", "None", ",", "vary", "=", "None", ",", "cache_timeout", "=", "12"...
21495194b0b2a2bdd1013e13ec0d54d34dd7f750
train
findpath
r""" Find a path from start to target where target is relative to start. >>> orig_wd = os.getcwd() >>> os.chdir('c:\\windows') # so we know what the working directory is >>> findpath('d:\\') 'd:\\' >>> findpath('d:\\', 'c:\\windows') 'd:\\' >>> findpath('\\bar', 'd:\\') 'd:\\bar' >>> find...
bugs/find_target_path.py
def findpath(target, start=os.path.curdir): r""" Find a path from start to target where target is relative to start. >>> orig_wd = os.getcwd() >>> os.chdir('c:\\windows') # so we know what the working directory is >>> findpath('d:\\') 'd:\\' >>> findpath('d:\\', 'c:\\windows') 'd:\\' >>> find...
def findpath(target, start=os.path.curdir): r""" Find a path from start to target where target is relative to start. >>> orig_wd = os.getcwd() >>> os.chdir('c:\\windows') # so we know what the working directory is >>> findpath('d:\\') 'd:\\' >>> findpath('d:\\', 'c:\\windows') 'd:\\' >>> find...
[ "r", "Find", "a", "path", "from", "start", "to", "target", "where", "target", "is", "relative", "to", "start", ".", ">>>", "orig_wd", "=", "os", ".", "getcwd", "()", ">>>", "os", ".", "chdir", "(", "c", ":", "\\\\", "windows", ")", "#", "so", "we",...
jaraco/jaraco.windows
python
https://github.com/jaraco/jaraco.windows/blob/51811efed50b46ad08daa25408a1cc806bc8d519/bugs/find_target_path.py#L3-L53
[ "def", "findpath", "(", "target", ",", "start", "=", "os", ".", "path", ".", "curdir", ")", ":", "return", "os", ".", "path", ".", "normpath", "(", "os", ".", "path", ".", "join", "(", "start", ",", "target", ")", ")" ]
51811efed50b46ad08daa25408a1cc806bc8d519
train
AllocatedTable.__get_table_size
Retrieve the size of the buffer needed by calling the method with a null pointer and length of zero. This should trigger an insufficient buffer error and return the size needed for the buffer.
jaraco/windows/inet.py
def __get_table_size(self): """ Retrieve the size of the buffer needed by calling the method with a null pointer and length of zero. This should trigger an insufficient buffer error and return the size needed for the buffer. """ length = ctypes.wintypes.DWORD() res = self.method(None, length, False) i...
def __get_table_size(self): """ Retrieve the size of the buffer needed by calling the method with a null pointer and length of zero. This should trigger an insufficient buffer error and return the size needed for the buffer. """ length = ctypes.wintypes.DWORD() res = self.method(None, length, False) i...
[ "Retrieve", "the", "size", "of", "the", "buffer", "needed", "by", "calling", "the", "method", "with", "a", "null", "pointer", "and", "length", "of", "zero", ".", "This", "should", "trigger", "an", "insufficient", "buffer", "error", "and", "return", "the", ...
jaraco/jaraco.windows
python
https://github.com/jaraco/jaraco.windows/blob/51811efed50b46ad08daa25408a1cc806bc8d519/jaraco/windows/inet.py#L49-L60
[ "def", "__get_table_size", "(", "self", ")", ":", "length", "=", "ctypes", ".", "wintypes", ".", "DWORD", "(", ")", "res", "=", "self", ".", "method", "(", "None", ",", "length", ",", "False", ")", "if", "res", "!=", "errors", ".", "ERROR_INSUFFICIENT_...
51811efed50b46ad08daa25408a1cc806bc8d519
train
AllocatedTable.get_table
Get the table
jaraco/windows/inet.py
def get_table(self): """ Get the table """ buffer_length = self.__get_table_size() returned_buffer_length = ctypes.wintypes.DWORD(buffer_length) buffer = ctypes.create_string_buffer(buffer_length) pointer_type = ctypes.POINTER(self.structure) table_p = ctypes.cast(buffer, pointer_type) res = self.meth...
def get_table(self): """ Get the table """ buffer_length = self.__get_table_size() returned_buffer_length = ctypes.wintypes.DWORD(buffer_length) buffer = ctypes.create_string_buffer(buffer_length) pointer_type = ctypes.POINTER(self.structure) table_p = ctypes.cast(buffer, pointer_type) res = self.meth...
[ "Get", "the", "table" ]
jaraco/jaraco.windows
python
https://github.com/jaraco/jaraco.windows/blob/51811efed50b46ad08daa25408a1cc806bc8d519/jaraco/windows/inet.py#L62-L74
[ "def", "get_table", "(", "self", ")", ":", "buffer_length", "=", "self", ".", "__get_table_size", "(", ")", "returned_buffer_length", "=", "ctypes", ".", "wintypes", ".", "DWORD", "(", "buffer_length", ")", "buffer", "=", "ctypes", ".", "create_string_buffer", ...
51811efed50b46ad08daa25408a1cc806bc8d519
train
AllocatedTable.entries
Using the table structure, return the array of entries based on the table size.
jaraco/windows/inet.py
def entries(self): """ Using the table structure, return the array of entries based on the table size. """ table = self.get_table() entries_array = self.row_structure * table.num_entries pointer_type = ctypes.POINTER(entries_array) return ctypes.cast(table.entries, pointer_type).contents
def entries(self): """ Using the table structure, return the array of entries based on the table size. """ table = self.get_table() entries_array = self.row_structure * table.num_entries pointer_type = ctypes.POINTER(entries_array) return ctypes.cast(table.entries, pointer_type).contents
[ "Using", "the", "table", "structure", "return", "the", "array", "of", "entries", "based", "on", "the", "table", "size", "." ]
jaraco/jaraco.windows
python
https://github.com/jaraco/jaraco.windows/blob/51811efed50b46ad08daa25408a1cc806bc8d519/jaraco/windows/inet.py#L77-L85
[ "def", "entries", "(", "self", ")", ":", "table", "=", "self", ".", "get_table", "(", ")", "entries_array", "=", "self", ".", "row_structure", "*", "table", ".", "num_entries", "pointer_type", "=", "ctypes", ".", "POINTER", "(", "entries_array", ")", "retu...
51811efed50b46ad08daa25408a1cc806bc8d519
train
owncloud
Set up owncloud. Package 'owncloud' pulls package 'mysql' which asks for a password.
fabsetup/fabfile/setup/service/__init__.py
def owncloud(): '''Set up owncloud. Package 'owncloud' pulls package 'mysql' which asks for a password. ''' hostname = re.sub(r'^[^@]+@', '', env.host) # without username if any sitename = query_input( question='\nEnter site-name of Your Owncloud web service', ...
def owncloud(): '''Set up owncloud. Package 'owncloud' pulls package 'mysql' which asks for a password. ''' hostname = re.sub(r'^[^@]+@', '', env.host) # without username if any sitename = query_input( question='\nEnter site-name of Your Owncloud web service', ...
[ "Set", "up", "owncloud", "." ]
theno/fabsetup
python
https://github.com/theno/fabsetup/blob/ced728abff93551ba5677e63bc1bdc0ef5ca5777/fabsetup/fabfile/setup/service/__init__.py#L23-L98
[ "def", "owncloud", "(", ")", ":", "hostname", "=", "re", ".", "sub", "(", "r'^[^@]+@'", ",", "''", ",", "env", ".", "host", ")", "# without username if any", "sitename", "=", "query_input", "(", "question", "=", "'\\nEnter site-name of Your Owncloud web service'",...
ced728abff93551ba5677e63bc1bdc0ef5ca5777
train
fdroid
Set up an F-Droid App Repo. More infos: * https://f-droid.org/wiki/page/Setup_an_FDroid_App_Repo * https://f-droid.org/wiki/page/Installing_the_Server_and_Repo_Tools
fabsetup/fabfile/setup/service/__init__.py
def fdroid(): '''Set up an F-Droid App Repo. More infos: * https://f-droid.org/wiki/page/Setup_an_FDroid_App_Repo * https://f-droid.org/wiki/page/Installing_the_Server_and_Repo_Tools ''' hostname = re.sub(r'^[^@]+@', '', env.host) # without username if any sitename = query_input( ...
def fdroid(): '''Set up an F-Droid App Repo. More infos: * https://f-droid.org/wiki/page/Setup_an_FDroid_App_Repo * https://f-droid.org/wiki/page/Installing_the_Server_and_Repo_Tools ''' hostname = re.sub(r'^[^@]+@', '', env.host) # without username if any sitename = query_input( ...
[ "Set", "up", "an", "F", "-", "Droid", "App", "Repo", "." ]
theno/fabsetup
python
https://github.com/theno/fabsetup/blob/ced728abff93551ba5677e63bc1bdc0ef5ca5777/fabsetup/fabfile/setup/service/__init__.py#L104-L187
[ "def", "fdroid", "(", ")", ":", "hostname", "=", "re", ".", "sub", "(", "r'^[^@]+@'", ",", "''", ",", "env", ".", "host", ")", "# without username if any", "sitename", "=", "query_input", "(", "question", "=", "'\\nEnter site-name of Your F-Droid web service'", ...
ced728abff93551ba5677e63bc1bdc0ef5ca5777
train
vnc_raspi_osmc
Install and configure dispmanx_vnc server on osmc (raspberry pi). More Infos: * https://github.com/patrikolausson/dispmanx_vnc * https://discourse.osmc.tv/t/howto-install-a-vnc-server-on-the-raspberry-pi/1517 * tightvnc: * http://raspberry.tips/raspberrypi-einsteiger/raspberry-pi-einsteiger-g...
fabsetup/fabfile/setup/service/__init__.py
def vnc_raspi_osmc(): '''Install and configure dispmanx_vnc server on osmc (raspberry pi). More Infos: * https://github.com/patrikolausson/dispmanx_vnc * https://discourse.osmc.tv/t/howto-install-a-vnc-server-on-the-raspberry-pi/1517 * tightvnc: * http://raspberry.tips/raspberrypi-einstei...
def vnc_raspi_osmc(): '''Install and configure dispmanx_vnc server on osmc (raspberry pi). More Infos: * https://github.com/patrikolausson/dispmanx_vnc * https://discourse.osmc.tv/t/howto-install-a-vnc-server-on-the-raspberry-pi/1517 * tightvnc: * http://raspberry.tips/raspberrypi-einstei...
[ "Install", "and", "configure", "dispmanx_vnc", "server", "on", "osmc", "(", "raspberry", "pi", ")", "." ]
theno/fabsetup
python
https://github.com/theno/fabsetup/blob/ced728abff93551ba5677e63bc1bdc0ef5ca5777/fabsetup/fabfile/setup/service/__init__.py#L191-L233
[ "def", "vnc_raspi_osmc", "(", ")", ":", "print", "(", "blue", "(", "'Install dependencies'", ")", ")", "install_packages", "(", "[", "'git'", ",", "'build-essential'", ",", "'rbp-userland-dev-osmc'", ",", "'libvncserver-dev'", ",", "'libconfig++-dev'", ",", "]", "...
ced728abff93551ba5677e63bc1bdc0ef5ca5777
train
lms
Install and start a Logitech Media Server (lms). More infos: * http://wiki.slimdevices.com/index.php/Logitech_Media_Server * http://wiki.slimdevices.com/index.php/DebianPackage * http://www.mysqueezebox.com/download * XSqueeze on Kodi: * http://kodi.wiki/view/Add-on:XSqueeze * htt...
fabsetup/fabfile/setup/service/__init__.py
def lms(): '''Install and start a Logitech Media Server (lms). More infos: * http://wiki.slimdevices.com/index.php/Logitech_Media_Server * http://wiki.slimdevices.com/index.php/DebianPackage * http://www.mysqueezebox.com/download * XSqueeze on Kodi: * http://kodi.wiki/view/Add-on:XSq...
def lms(): '''Install and start a Logitech Media Server (lms). More infos: * http://wiki.slimdevices.com/index.php/Logitech_Media_Server * http://wiki.slimdevices.com/index.php/DebianPackage * http://www.mysqueezebox.com/download * XSqueeze on Kodi: * http://kodi.wiki/view/Add-on:XSq...
[ "Install", "and", "start", "a", "Logitech", "Media", "Server", "(", "lms", ")", "." ]
theno/fabsetup
python
https://github.com/theno/fabsetup/blob/ced728abff93551ba5677e63bc1bdc0ef5ca5777/fabsetup/fabfile/setup/service/__init__.py#L237-L268
[ "def", "lms", "(", ")", ":", "# cf. http://wiki.slimdevices.com/index.php/DebianPackage#installing_7.9.0", "cmds", "=", "'''\\\nurl=\"http://www.mysqueezebox.com/update/?version=7.9.0&revision=1&geturl=1&os=deb\"\nlatest_lms=$(wget -q -O - \"$url\")\nmkdir -p ~/.logitech_media_server_sources\ncd ~/....
ced728abff93551ba5677e63bc1bdc0ef5ca5777
train
samba
Install smb server samba and create a share (common read-write-access). More infos: * https://wiki.ubuntuusers.de/Samba%20Server/
fabsetup/fabfile/setup/service/__init__.py
def samba(): '''Install smb server samba and create a share (common read-write-access). More infos: * https://wiki.ubuntuusers.de/Samba%20Server/ ''' username = env.user install_packages(['samba']) run(flo('sudo smbpasswd -a {username}')) path = '$HOME/shared' sharename = 'shared'...
def samba(): '''Install smb server samba and create a share (common read-write-access). More infos: * https://wiki.ubuntuusers.de/Samba%20Server/ ''' username = env.user install_packages(['samba']) run(flo('sudo smbpasswd -a {username}')) path = '$HOME/shared' sharename = 'shared'...
[ "Install", "smb", "server", "samba", "and", "create", "a", "share", "(", "common", "read", "-", "write", "-", "access", ")", "." ]
theno/fabsetup
python
https://github.com/theno/fabsetup/blob/ced728abff93551ba5677e63bc1bdc0ef5ca5777/fabsetup/fabfile/setup/service/__init__.py#L273-L291
[ "def", "samba", "(", ")", ":", "username", "=", "env", ".", "user", "install_packages", "(", "[", "'samba'", "]", ")", "run", "(", "flo", "(", "'sudo smbpasswd -a {username}'", ")", ")", "path", "=", "'$HOME/shared'", "sharename", "=", "'shared'", "comment",...
ced728abff93551ba5677e63bc1bdc0ef5ca5777
train
YAMLProductions.p_scalar__doublequote
scalar : DOUBLEQUOTE_START SCALAR DOUBLEQUOTE_END
pureyaml/grammar/productions.py
def p_scalar__doublequote(self, p): """ scalar : DOUBLEQUOTE_START SCALAR DOUBLEQUOTE_END """ scalar = re.sub('\n\s+', ' ', str(p[2])) p[0] = Str(scalar.replace('\\"', '"'))
def p_scalar__doublequote(self, p): """ scalar : DOUBLEQUOTE_START SCALAR DOUBLEQUOTE_END """ scalar = re.sub('\n\s+', ' ', str(p[2])) p[0] = Str(scalar.replace('\\"', '"'))
[ "scalar", ":", "DOUBLEQUOTE_START", "SCALAR", "DOUBLEQUOTE_END" ]
bionikspoon/pureyaml
python
https://github.com/bionikspoon/pureyaml/blob/784830b907ca14525c4cecdb6ae35306f6f8a877/pureyaml/grammar/productions.py#L202-L208
[ "def", "p_scalar__doublequote", "(", "self", ",", "p", ")", ":", "scalar", "=", "re", ".", "sub", "(", "'\\n\\s+'", ",", "' '", ",", "str", "(", "p", "[", "2", "]", ")", ")", "p", "[", "0", "]", "=", "Str", "(", "scalar", ".", "replace", "(", ...
784830b907ca14525c4cecdb6ae35306f6f8a877
train
YAMLProductions.p_scalar__literal
scalar : B_LITERAL_START scalar_group B_LITERAL_END
pureyaml/grammar/productions.py
def p_scalar__literal(self, p): """ scalar : B_LITERAL_START scalar_group B_LITERAL_END """ scalar_group = ''.join(p[2]) p[0] = ScalarDispatch('%s\n' % dedent(scalar_group).replace('\n\n\n', '\n'), cast='str')
def p_scalar__literal(self, p): """ scalar : B_LITERAL_START scalar_group B_LITERAL_END """ scalar_group = ''.join(p[2]) p[0] = ScalarDispatch('%s\n' % dedent(scalar_group).replace('\n\n\n', '\n'), cast='str')
[ "scalar", ":", "B_LITERAL_START", "scalar_group", "B_LITERAL_END" ]
bionikspoon/pureyaml
python
https://github.com/bionikspoon/pureyaml/blob/784830b907ca14525c4cecdb6ae35306f6f8a877/pureyaml/grammar/productions.py#L240-L245
[ "def", "p_scalar__literal", "(", "self", ",", "p", ")", ":", "scalar_group", "=", "''", ".", "join", "(", "p", "[", "2", "]", ")", "p", "[", "0", "]", "=", "ScalarDispatch", "(", "'%s\\n'", "%", "dedent", "(", "scalar_group", ")", ".", "replace", "...
784830b907ca14525c4cecdb6ae35306f6f8a877
train
YAMLProductions.p_scalar__folded
scalar : B_FOLD_START scalar_group B_FOLD_END
pureyaml/grammar/productions.py
def p_scalar__folded(self, p): """ scalar : B_FOLD_START scalar_group B_FOLD_END """ scalar_group = ''.join(p[2]) folded_scalar = fold(dedent(scalar_group)).rstrip() p[0] = ScalarDispatch('%s\n' % folded_scalar, cast='str')
def p_scalar__folded(self, p): """ scalar : B_FOLD_START scalar_group B_FOLD_END """ scalar_group = ''.join(p[2]) folded_scalar = fold(dedent(scalar_group)).rstrip() p[0] = ScalarDispatch('%s\n' % folded_scalar, cast='str')
[ "scalar", ":", "B_FOLD_START", "scalar_group", "B_FOLD_END" ]
bionikspoon/pureyaml
python
https://github.com/bionikspoon/pureyaml/blob/784830b907ca14525c4cecdb6ae35306f6f8a877/pureyaml/grammar/productions.py#L248-L254
[ "def", "p_scalar__folded", "(", "self", ",", "p", ")", ":", "scalar_group", "=", "''", ".", "join", "(", "p", "[", "2", "]", ")", "folded_scalar", "=", "fold", "(", "dedent", "(", "scalar_group", ")", ")", ".", "rstrip", "(", ")", "p", "[", "0", ...
784830b907ca14525c4cecdb6ae35306f6f8a877
train
YAMLProductions.p_scalar__indented_flow
scalar : INDENT scalar_group DEDENT
pureyaml/grammar/productions.py
def p_scalar__indented_flow(self, p): """ scalar : INDENT scalar_group DEDENT """ scalar_group = '\n'.join(p[2]) folded_scalar = fold(dedent(scalar_group)) p[0] = ScalarDispatch(folded_scalar, cast='str')
def p_scalar__indented_flow(self, p): """ scalar : INDENT scalar_group DEDENT """ scalar_group = '\n'.join(p[2]) folded_scalar = fold(dedent(scalar_group)) p[0] = ScalarDispatch(folded_scalar, cast='str')
[ "scalar", ":", "INDENT", "scalar_group", "DEDENT" ]
bionikspoon/pureyaml
python
https://github.com/bionikspoon/pureyaml/blob/784830b907ca14525c4cecdb6ae35306f6f8a877/pureyaml/grammar/productions.py#L257-L263
[ "def", "p_scalar__indented_flow", "(", "self", ",", "p", ")", ":", "scalar_group", "=", "'\\n'", ".", "join", "(", "p", "[", "2", "]", ")", "folded_scalar", "=", "fold", "(", "dedent", "(", "scalar_group", ")", ")", "p", "[", "0", "]", "=", "ScalarDi...
784830b907ca14525c4cecdb6ae35306f6f8a877
train
YAMLProductions.p_scalar__string_indented_multi_line
scalar : scalar INDENT SCALAR DEDENT
pureyaml/grammar/productions.py
def p_scalar__string_indented_multi_line(self, p): """ scalar : scalar INDENT SCALAR DEDENT """ scalar = '\n'.join([p[1].value, p[3]]) p[0] = ScalarDispatch(fold(scalar), cast='str')
def p_scalar__string_indented_multi_line(self, p): """ scalar : scalar INDENT SCALAR DEDENT """ scalar = '\n'.join([p[1].value, p[3]]) p[0] = ScalarDispatch(fold(scalar), cast='str')
[ "scalar", ":", "scalar", "INDENT", "SCALAR", "DEDENT" ]
bionikspoon/pureyaml
python
https://github.com/bionikspoon/pureyaml/blob/784830b907ca14525c4cecdb6ae35306f6f8a877/pureyaml/grammar/productions.py#L266-L272
[ "def", "p_scalar__string_indented_multi_line", "(", "self", ",", "p", ")", ":", "scalar", "=", "'\\n'", ".", "join", "(", "[", "p", "[", "1", "]", ".", "value", ",", "p", "[", "3", "]", "]", ")", "p", "[", "0", "]", "=", "ScalarDispatch", "(", "f...
784830b907ca14525c4cecdb6ae35306f6f8a877
train
YAMLProductions.p_scalar_group
scalar_group : SCALAR | scalar_group SCALAR
pureyaml/grammar/productions.py
def p_scalar_group(self, p): """ scalar_group : SCALAR | scalar_group SCALAR """ if len(p) == 2: p[0] = (str(p[1]),) if len(p) == 3: p[0] = p[1] + (str(p[2]),) if len(p) == 4: p[0] = p[1] + (str(p[3]),)
def p_scalar_group(self, p): """ scalar_group : SCALAR | scalar_group SCALAR """ if len(p) == 2: p[0] = (str(p[1]),) if len(p) == 3: p[0] = p[1] + (str(p[2]),) if len(p) == 4: p[0] = p[1] + (str(p[3]),)
[ "scalar_group", ":", "SCALAR", "|", "scalar_group", "SCALAR" ]
bionikspoon/pureyaml
python
https://github.com/bionikspoon/pureyaml/blob/784830b907ca14525c4cecdb6ae35306f6f8a877/pureyaml/grammar/productions.py#L275-L287
[ "def", "p_scalar_group", "(", "self", ",", "p", ")", ":", "if", "len", "(", "p", ")", "==", "2", ":", "p", "[", "0", "]", "=", "(", "str", "(", "p", "[", "1", "]", ")", ",", ")", "if", "len", "(", "p", ")", "==", "3", ":", "p", "[", "...
784830b907ca14525c4cecdb6ae35306f6f8a877
train
doctree_read_handler
Add 'orphan' to metadata for partials :type app: sphinx.application.Sphinx :type doctree: docutils.nodes.document
docs/source/conf.py
def doctree_read_handler(app, doctree): """ Add 'orphan' to metadata for partials :type app: sphinx.application.Sphinx :type doctree: docutils.nodes.document """ # noinspection PyProtectedMember docname = sys._getframe(2).f_locals['docname'] if docname.startswith('_partial'): ap...
def doctree_read_handler(app, doctree): """ Add 'orphan' to metadata for partials :type app: sphinx.application.Sphinx :type doctree: docutils.nodes.document """ # noinspection PyProtectedMember docname = sys._getframe(2).f_locals['docname'] if docname.startswith('_partial'): ap...
[ "Add", "orphan", "to", "metadata", "for", "partials" ]
bionikspoon/pureyaml
python
https://github.com/bionikspoon/pureyaml/blob/784830b907ca14525c4cecdb6ae35306f6f8a877/docs/source/conf.py#L26-L36
[ "def", "doctree_read_handler", "(", "app", ",", "doctree", ")", ":", "# noinspection PyProtectedMember", "docname", "=", "sys", ".", "_getframe", "(", "2", ")", ".", "f_locals", "[", "'docname'", "]", "if", "docname", ".", "startswith", "(", "'_partial'", ")",...
784830b907ca14525c4cecdb6ae35306f6f8a877
train
autodoc_skip_member_handler
Skip un parseable functions. :type app: sphinx.application.Sphinx :param str what: the type of the object which the docstring belongs to (one of "module", "class", "exception", "function", "method", "attribute") :param str name: the fully qualified name of the object :param type obj: the object...
docs/source/conf.py
def autodoc_skip_member_handler(app, what, name, obj, skip, options): """ Skip un parseable functions. :type app: sphinx.application.Sphinx :param str what: the type of the object which the docstring belongs to (one of "module", "class", "exception", "function", "method", "attribute") :para...
def autodoc_skip_member_handler(app, what, name, obj, skip, options): """ Skip un parseable functions. :type app: sphinx.application.Sphinx :param str what: the type of the object which the docstring belongs to (one of "module", "class", "exception", "function", "method", "attribute") :para...
[ "Skip", "un", "parseable", "functions", "." ]
bionikspoon/pureyaml
python
https://github.com/bionikspoon/pureyaml/blob/784830b907ca14525c4cecdb6ae35306f6f8a877/docs/source/conf.py#L39-L54
[ "def", "autodoc_skip_member_handler", "(", "app", ",", "what", ",", "name", ",", "obj", ",", "skip", ",", "options", ")", ":", "if", "'YAMLTokens'", "in", "name", ":", "return", "True", "return", "False" ]
784830b907ca14525c4cecdb6ae35306f6f8a877
train
Utility.configGet
Wraps a try / except and a check for self.filename around ConfigParser as it talks to the configuration file. Also, checks for existence of configuration file so this won't execute (and fail) when no configuration file is provided (e.g., running in coupled mode with CSDMS entirely with getters and set...
gflex/base.py
def configGet(self, vartype, category, name, optional=False, specialReturnMessage=None): """ Wraps a try / except and a check for self.filename around ConfigParser as it talks to the configuration file. Also, checks for existence of configuration file so this won't execute (and fail) when no config...
def configGet(self, vartype, category, name, optional=False, specialReturnMessage=None): """ Wraps a try / except and a check for self.filename around ConfigParser as it talks to the configuration file. Also, checks for existence of configuration file so this won't execute (and fail) when no config...
[ "Wraps", "a", "try", "/", "except", "and", "a", "check", "for", "self", ".", "filename", "around", "ConfigParser", "as", "it", "talks", "to", "the", "configuration", "file", ".", "Also", "checks", "for", "existence", "of", "configuration", "file", "so", "t...
awickert/gFlex
python
https://github.com/awickert/gFlex/blob/3ac32249375b0f8d342a142585d86ea4d905a5a0/gflex/base.py#L34-L88
[ "def", "configGet", "(", "self", ",", "vartype", ",", "category", ",", "name", ",", "optional", "=", "False", ",", "specialReturnMessage", "=", "None", ")", ":", "try", ":", "if", "vartype", "==", "'float'", ":", "var", "=", "self", ".", "config", ".",...
3ac32249375b0f8d342a142585d86ea4d905a5a0
train
Utility.greatCircleDistance
Returns the great circle distance between two points. Useful when using the SAS_NG solution in lat/lon coordinates Modified from http://www.johndcook.com/blog/python_longitude_latitude/ It should be able to take numpy arrays.
gflex/base.py
def greatCircleDistance(self, lat1, long1, lat2, long2, radius): """ Returns the great circle distance between two points. Useful when using the SAS_NG solution in lat/lon coordinates Modified from http://www.johndcook.com/blog/python_longitude_latitude/ It should be able to take numpy arrays. "...
def greatCircleDistance(self, lat1, long1, lat2, long2, radius): """ Returns the great circle distance between two points. Useful when using the SAS_NG solution in lat/lon coordinates Modified from http://www.johndcook.com/blog/python_longitude_latitude/ It should be able to take numpy arrays. "...
[ "Returns", "the", "great", "circle", "distance", "between", "two", "points", ".", "Useful", "when", "using", "the", "SAS_NG", "solution", "in", "lat", "/", "lon", "coordinates", "Modified", "from", "http", ":", "//", "www", ".", "johndcook", ".", "com", "/...
awickert/gFlex
python
https://github.com/awickert/gFlex/blob/3ac32249375b0f8d342a142585d86ea4d905a5a0/gflex/base.py#L100-L135
[ "def", "greatCircleDistance", "(", "self", ",", "lat1", ",", "long1", ",", "lat2", ",", "long2", ",", "radius", ")", ":", "# Convert latitude and longitude to", "# spherical coordinates in radians.", "degrees_to_radians", "=", "np", ".", "pi", "/", "180.0", "# theta...
3ac32249375b0f8d342a142585d86ea4d905a5a0
train
Utility.define_points_grid
This is experimental code that could be used in the spatialDomainNoGrid section to build a grid of points on which to generate the solution. However, the current development plan (as of 27 Jan 2015) is to have the end user supply the list of points where they want a solution (and/or for it to be provi...
gflex/base.py
def define_points_grid(self): """ This is experimental code that could be used in the spatialDomainNoGrid section to build a grid of points on which to generate the solution. However, the current development plan (as of 27 Jan 2015) is to have the end user supply the list of points where they want ...
def define_points_grid(self): """ This is experimental code that could be used in the spatialDomainNoGrid section to build a grid of points on which to generate the solution. However, the current development plan (as of 27 Jan 2015) is to have the end user supply the list of points where they want ...
[ "This", "is", "experimental", "code", "that", "could", "be", "used", "in", "the", "spatialDomainNoGrid", "section", "to", "build", "a", "grid", "of", "points", "on", "which", "to", "generate", "the", "solution", ".", "However", "the", "current", "development",...
awickert/gFlex
python
https://github.com/awickert/gFlex/blob/3ac32249375b0f8d342a142585d86ea4d905a5a0/gflex/base.py#L137-L184
[ "def", "define_points_grid", "(", "self", ")", ":", "# Grid making step", "# In this case, an output at different (x,y), e.g., on a grid, is desired", "# First, see if there is a need for a grid, and then make it", "# latlon arrays must have a pre-set grid", "if", "self", ".", "latlon", ...
3ac32249375b0f8d342a142585d86ea4d905a5a0
train
Utility.loadFile
A special function to replate a variable name that is a string file path with the loaded file. var is a string on input output is a numpy array or a None-type object (success vs. failure)
gflex/base.py
def loadFile(self, var, close_on_fail = True): """ A special function to replate a variable name that is a string file path with the loaded file. var is a string on input output is a numpy array or a None-type object (success vs. failure) """ out = None try: # First see if it is a ...
def loadFile(self, var, close_on_fail = True): """ A special function to replate a variable name that is a string file path with the loaded file. var is a string on input output is a numpy array or a None-type object (success vs. failure) """ out = None try: # First see if it is a ...
[ "A", "special", "function", "to", "replate", "a", "variable", "name", "that", "is", "a", "string", "file", "path", "with", "the", "loaded", "file", ".", "var", "is", "a", "string", "on", "input", "output", "is", "a", "numpy", "array", "or", "a", "None"...
awickert/gFlex
python
https://github.com/awickert/gFlex/blob/3ac32249375b0f8d342a142585d86ea4d905a5a0/gflex/base.py#L187-L225
[ "def", "loadFile", "(", "self", ",", "var", ",", "close_on_fail", "=", "True", ")", ":", "out", "=", "None", "try", ":", "# First see if it is a full path or directly links from the current", "# working directory", "out", "=", "np", ".", "load", "(", "var", ")", ...
3ac32249375b0f8d342a142585d86ea4d905a5a0
train
Plotting.surfplot
Plot if you want to - for troubleshooting - 1 figure
gflex/base.py
def surfplot(self, z, titletext): """ Plot if you want to - for troubleshooting - 1 figure """ if self.latlon: plt.imshow(z, extent=(0, self.dx*z.shape[0], self.dy*z.shape[1], 0)) #,interpolation='nearest' plt.xlabel('longitude [deg E]', fontsize=12, fontweight='bold') plt.ylabel('lati...
def surfplot(self, z, titletext): """ Plot if you want to - for troubleshooting - 1 figure """ if self.latlon: plt.imshow(z, extent=(0, self.dx*z.shape[0], self.dy*z.shape[1], 0)) #,interpolation='nearest' plt.xlabel('longitude [deg E]', fontsize=12, fontweight='bold') plt.ylabel('lati...
[ "Plot", "if", "you", "want", "to", "-", "for", "troubleshooting", "-", "1", "figure" ]
awickert/gFlex
python
https://github.com/awickert/gFlex/blob/3ac32249375b0f8d342a142585d86ea4d905a5a0/gflex/base.py#L376-L390
[ "def", "surfplot", "(", "self", ",", "z", ",", "titletext", ")", ":", "if", "self", ".", "latlon", ":", "plt", ".", "imshow", "(", "z", ",", "extent", "=", "(", "0", ",", "self", ".", "dx", "*", "z", ".", "shape", "[", "0", "]", ",", "self", ...
3ac32249375b0f8d342a142585d86ea4d905a5a0
train
Plotting.twoSurfplots
Plot multiple subplot figure for 2D array
gflex/base.py
def twoSurfplots(self): """ Plot multiple subplot figure for 2D array """ # Could more elegantly just call surfplot twice # And also could include xyzinterp as an option inside surfplot. # Noted here in case anyone wants to take that on in the future... plt.subplot(211) plt.title('Load ...
def twoSurfplots(self): """ Plot multiple subplot figure for 2D array """ # Could more elegantly just call surfplot twice # And also could include xyzinterp as an option inside surfplot. # Noted here in case anyone wants to take that on in the future... plt.subplot(211) plt.title('Load ...
[ "Plot", "multiple", "subplot", "figure", "for", "2D", "array" ]
awickert/gFlex
python
https://github.com/awickert/gFlex/blob/3ac32249375b0f8d342a142585d86ea4d905a5a0/gflex/base.py#L392-L422
[ "def", "twoSurfplots", "(", "self", ")", ":", "# Could more elegantly just call surfplot twice", "# And also could include xyzinterp as an option inside surfplot.", "# Noted here in case anyone wants to take that on in the future...", "plt", ".", "subplot", "(", "211", ")", "plt", "....
3ac32249375b0f8d342a142585d86ea4d905a5a0
train
Plotting.xyzinterp
Interpolates and plots ungridded model outputs from SAS_NG solution
gflex/base.py
def xyzinterp(self, x, y, z, titletext): """ Interpolates and plots ungridded model outputs from SAS_NG solution """ # Help from http://wiki.scipy.org/Cookbook/Matplotlib/Gridding_irregularly_spaced_data if self.Verbose: print("Starting to interpolate grid for plotting -- can be a slow pr...
def xyzinterp(self, x, y, z, titletext): """ Interpolates and plots ungridded model outputs from SAS_NG solution """ # Help from http://wiki.scipy.org/Cookbook/Matplotlib/Gridding_irregularly_spaced_data if self.Verbose: print("Starting to interpolate grid for plotting -- can be a slow pr...
[ "Interpolates", "and", "plots", "ungridded", "model", "outputs", "from", "SAS_NG", "solution" ]
awickert/gFlex
python
https://github.com/awickert/gFlex/blob/3ac32249375b0f8d342a142585d86ea4d905a5a0/gflex/base.py#L424-L488
[ "def", "xyzinterp", "(", "self", ",", "x", ",", "y", ",", "z", ",", "titletext", ")", ":", "# Help from http://wiki.scipy.org/Cookbook/Matplotlib/Gridding_irregularly_spaced_data", "if", "self", ".", "Verbose", ":", "print", "(", "\"Starting to interpolate grid for plotti...
3ac32249375b0f8d342a142585d86ea4d905a5a0
train
Flexure.outputDeflections
Outputs a grid of deflections if an output directory is defined in the configuration file If the filename given in the configuration file ends in ".npy", then a binary numpy grid will be exported. Otherwise, an ASCII grid will be exported.
gflex/base.py
def outputDeflections(self): """ Outputs a grid of deflections if an output directory is defined in the configuration file If the filename given in the configuration file ends in ".npy", then a binary numpy grid will be exported. Otherwise, an ASCII grid will be exported. """ ...
def outputDeflections(self): """ Outputs a grid of deflections if an output directory is defined in the configuration file If the filename given in the configuration file ends in ".npy", then a binary numpy grid will be exported. Otherwise, an ASCII grid will be exported. """ ...
[ "Outputs", "a", "grid", "of", "deflections", "if", "an", "output", "directory", "is", "defined", "in", "the", "configuration", "file", "If", "the", "filename", "given", "in", "the", "configuration", "file", "ends", "in", ".", "npy", "then", "a", "binary", ...
awickert/gFlex
python
https://github.com/awickert/gFlex/blob/3ac32249375b0f8d342a142585d86ea4d905a5a0/gflex/base.py#L762-L796
[ "def", "outputDeflections", "(", "self", ")", ":", "try", ":", "# If wOutFile exists, has already been set by a setter", "self", ".", "wOutFile", "if", "self", ".", "Verbose", ":", "print", "(", "\"Output filename provided.\"", ")", "# Otherwise, it needs to be set by an co...
3ac32249375b0f8d342a142585d86ea4d905a5a0
train
Flexure.coeffArraySizeCheck
Make sure that q0 and coefficient array are the right size compared to each other (for finite difference if loading a pre-build coefficient array). Otherwise, exit.
gflex/base.py
def coeffArraySizeCheck(self): """ Make sure that q0 and coefficient array are the right size compared to each other (for finite difference if loading a pre-build coefficient array). Otherwise, exit. """ if prod(self.coeff_matrix.shape) != long(prod(np.array(self.qs.shape,dtype=int64)+2)**2): ...
def coeffArraySizeCheck(self): """ Make sure that q0 and coefficient array are the right size compared to each other (for finite difference if loading a pre-build coefficient array). Otherwise, exit. """ if prod(self.coeff_matrix.shape) != long(prod(np.array(self.qs.shape,dtype=int64)+2)**2): ...
[ "Make", "sure", "that", "q0", "and", "coefficient", "array", "are", "the", "right", "size", "compared", "to", "each", "other", "(", "for", "finite", "difference", "if", "loading", "a", "pre", "-", "build", "coefficient", "array", ")", ".", "Otherwise", "ex...
awickert/gFlex
python
https://github.com/awickert/gFlex/blob/3ac32249375b0f8d342a142585d86ea4d905a5a0/gflex/base.py#L896-L905
[ "def", "coeffArraySizeCheck", "(", "self", ")", ":", "if", "prod", "(", "self", ".", "coeff_matrix", ".", "shape", ")", "!=", "long", "(", "prod", "(", "np", ".", "array", "(", "self", ".", "qs", ".", "shape", ",", "dtype", "=", "int64", ")", "+", ...
3ac32249375b0f8d342a142585d86ea4d905a5a0
train
Flexure.TeArraySizeCheck
Checks that Te and q0 array sizes are compatible For finite difference solution.
gflex/base.py
def TeArraySizeCheck(self): """ Checks that Te and q0 array sizes are compatible For finite difference solution. """ # Only if they are both defined and are arrays # Both being arrays is a possible bug in this check routine that I have # intentionally introduced if type(self.Te) == np.n...
def TeArraySizeCheck(self): """ Checks that Te and q0 array sizes are compatible For finite difference solution. """ # Only if they are both defined and are arrays # Both being arrays is a possible bug in this check routine that I have # intentionally introduced if type(self.Te) == np.n...
[ "Checks", "that", "Te", "and", "q0", "array", "sizes", "are", "compatible", "For", "finite", "difference", "solution", "." ]
awickert/gFlex
python
https://github.com/awickert/gFlex/blob/3ac32249375b0f8d342a142585d86ea4d905a5a0/gflex/base.py#L907-L921
[ "def", "TeArraySizeCheck", "(", "self", ")", ":", "# Only if they are both defined and are arrays", "# Both being arrays is a possible bug in this check routine that I have ", "# intentionally introduced", "if", "type", "(", "self", ".", "Te", ")", "==", "np", ".", "ndarray", ...
3ac32249375b0f8d342a142585d86ea4d905a5a0
train
Flexure.FD
Set-up for the finite difference solution method
gflex/base.py
def FD(self): """ Set-up for the finite difference solution method """ if self.Verbose: print("Finite Difference Solution Technique") # Used to check for coeff_matrix here, but now doing so in self.bc_check() # called by f1d and f2d at the start # # Define a stress-based qs = q0 ...
def FD(self): """ Set-up for the finite difference solution method """ if self.Verbose: print("Finite Difference Solution Technique") # Used to check for coeff_matrix here, but now doing so in self.bc_check() # called by f1d and f2d at the start # # Define a stress-based qs = q0 ...
[ "Set", "-", "up", "for", "the", "finite", "difference", "solution", "method" ]
awickert/gFlex
python
https://github.com/awickert/gFlex/blob/3ac32249375b0f8d342a142585d86ea4d905a5a0/gflex/base.py#L927-L1008
[ "def", "FD", "(", "self", ")", ":", "if", "self", ".", "Verbose", ":", "print", "(", "\"Finite Difference Solution Technique\"", ")", "# Used to check for coeff_matrix here, but now doing so in self.bc_check()", "# called by f1d and f2d at the start", "# ", "# Define a stress-bas...
3ac32249375b0f8d342a142585d86ea4d905a5a0
train
Flexure.SAS
Set-up for the rectangularly-gridded superposition of analytical solutions method for solving flexure
gflex/base.py
def SAS(self): """ Set-up for the rectangularly-gridded superposition of analytical solutions method for solving flexure """ if self.x is None: self.x = np.arange(self.dx/2., self.dx * self.qs.shape[0], self.dx) if self.filename: # Define the (scalar) elastic thickness self.Te...
def SAS(self): """ Set-up for the rectangularly-gridded superposition of analytical solutions method for solving flexure """ if self.x is None: self.x = np.arange(self.dx/2., self.dx * self.qs.shape[0], self.dx) if self.filename: # Define the (scalar) elastic thickness self.Te...
[ "Set", "-", "up", "for", "the", "rectangularly", "-", "gridded", "superposition", "of", "analytical", "solutions", "method", "for", "solving", "flexure" ]
awickert/gFlex
python
https://github.com/awickert/gFlex/blob/3ac32249375b0f8d342a142585d86ea4d905a5a0/gflex/base.py#L1017-L1045
[ "def", "SAS", "(", "self", ")", ":", "if", "self", ".", "x", "is", "None", ":", "self", ".", "x", "=", "np", ".", "arange", "(", "self", ".", "dx", "/", "2.", ",", "self", ".", "dx", "*", "self", ".", "qs", ".", "shape", "[", "0", "]", ",...
3ac32249375b0f8d342a142585d86ea4d905a5a0
train
Flexure.SAS_NG
Set-up for the ungridded superposition of analytical solutions method for solving flexure
gflex/base.py
def SAS_NG(self): """ Set-up for the ungridded superposition of analytical solutions method for solving flexure """ if self.filename: # Define the (scalar) elastic thickness self.Te = self.configGet("float", "input", "ElasticThickness") # See if it wants to be run in lat/lon ...
def SAS_NG(self): """ Set-up for the ungridded superposition of analytical solutions method for solving flexure """ if self.filename: # Define the (scalar) elastic thickness self.Te = self.configGet("float", "input", "ElasticThickness") # See if it wants to be run in lat/lon ...
[ "Set", "-", "up", "for", "the", "ungridded", "superposition", "of", "analytical", "solutions", "method", "for", "solving", "flexure" ]
awickert/gFlex
python
https://github.com/awickert/gFlex/blob/3ac32249375b0f8d342a142585d86ea4d905a5a0/gflex/base.py#L1047-L1138
[ "def", "SAS_NG", "(", "self", ")", ":", "if", "self", ".", "filename", ":", "# Define the (scalar) elastic thickness", "self", ".", "Te", "=", "self", ".", "configGet", "(", "\"float\"", ",", "\"input\"", ",", "\"ElasticThickness\"", ")", "# See if it wants to be ...
3ac32249375b0f8d342a142585d86ea4d905a5a0
train
_c3_merge
Merges MROs in *sequences* to a single MRO using the C3 algorithm. Adapted from http://www.python.org/download/releases/2.3/mro/.
pureyaml/_compat/singledispatch.py
def _c3_merge(sequences): # noqa """Merges MROs in *sequences* to a single MRO using the C3 algorithm. Adapted from http://www.python.org/download/releases/2.3/mro/. """ result = [] while True: sequences = [s for s in sequences if s] # purge empty sequences if not sequences: ...
def _c3_merge(sequences): # noqa """Merges MROs in *sequences* to a single MRO using the C3 algorithm. Adapted from http://www.python.org/download/releases/2.3/mro/. """ result = [] while True: sequences = [s for s in sequences if s] # purge empty sequences if not sequences: ...
[ "Merges", "MROs", "in", "*", "sequences", "*", "to", "a", "single", "MRO", "using", "the", "C3", "algorithm", "." ]
bionikspoon/pureyaml
python
https://github.com/bionikspoon/pureyaml/blob/784830b907ca14525c4cecdb6ae35306f6f8a877/pureyaml/_compat/singledispatch.py#L21-L46
[ "def", "_c3_merge", "(", "sequences", ")", ":", "# noqa", "result", "=", "[", "]", "while", "True", ":", "sequences", "=", "[", "s", "for", "s", "in", "sequences", "if", "s", "]", "# purge empty sequences", "if", "not", "sequences", ":", "return", "resul...
784830b907ca14525c4cecdb6ae35306f6f8a877
train
_c3_mro
Computes the method resolution order using extended C3 linearization. If no *abcs* are given, the algorithm works exactly like the built-in C3 linearization used for method resolution. If given, *abcs* is a list of abstract base classes that should be inserted into the resulting MRO. Unrelated ABCs ar...
pureyaml/_compat/singledispatch.py
def _c3_mro(cls, abcs=None): """Computes the method resolution order using extended C3 linearization. If no *abcs* are given, the algorithm works exactly like the built-in C3 linearization used for method resolution. If given, *abcs* is a list of abstract base classes that should be inserted into ...
def _c3_mro(cls, abcs=None): """Computes the method resolution order using extended C3 linearization. If no *abcs* are given, the algorithm works exactly like the built-in C3 linearization used for method resolution. If given, *abcs* is a list of abstract base classes that should be inserted into ...
[ "Computes", "the", "method", "resolution", "order", "using", "extended", "C3", "linearization", "." ]
bionikspoon/pureyaml
python
https://github.com/bionikspoon/pureyaml/blob/784830b907ca14525c4cecdb6ae35306f6f8a877/pureyaml/_compat/singledispatch.py#L49-L88
[ "def", "_c3_mro", "(", "cls", ",", "abcs", "=", "None", ")", ":", "for", "i", ",", "base", "in", "enumerate", "(", "reversed", "(", "cls", ".", "__bases__", ")", ")", ":", "if", "hasattr", "(", "base", ",", "'__abstractmethods__'", ")", ":", "boundar...
784830b907ca14525c4cecdb6ae35306f6f8a877
train
_compose_mro
Calculates the method resolution order for a given class *cls*. Includes relevant abstract base classes (with their respective bases) from the *types* iterable. Uses a modified C3 linearization algorithm.
pureyaml/_compat/singledispatch.py
def _compose_mro(cls, types): # noqa """Calculates the method resolution order for a given class *cls*. Includes relevant abstract base classes (with their respective bases) from the *types* iterable. Uses a modified C3 linearization algorithm. """ bases = set(cls.__mro__) # Remove entries w...
def _compose_mro(cls, types): # noqa """Calculates the method resolution order for a given class *cls*. Includes relevant abstract base classes (with their respective bases) from the *types* iterable. Uses a modified C3 linearization algorithm. """ bases = set(cls.__mro__) # Remove entries w...
[ "Calculates", "the", "method", "resolution", "order", "for", "a", "given", "class", "*", "cls", "*", "." ]
bionikspoon/pureyaml
python
https://github.com/bionikspoon/pureyaml/blob/784830b907ca14525c4cecdb6ae35306f6f8a877/pureyaml/_compat/singledispatch.py#L91-L137
[ "def", "_compose_mro", "(", "cls", ",", "types", ")", ":", "# noqa", "bases", "=", "set", "(", "cls", ".", "__mro__", ")", "# Remove entries which are already present in the __mro__ or unrelated.", "def", "is_related", "(", "_type", ")", ":", "return", "(", "# :of...
784830b907ca14525c4cecdb6ae35306f6f8a877
train
_find_impl
Returns the best matching implementation from *registry* for type *cls*. Where there is no registered implementation for a specific type, its method resolution order is used to find a more generic implementation. Note: if *registry* does not contain an implementation for the base *object* type, this f...
pureyaml/_compat/singledispatch.py
def _find_impl(cls, registry): """Returns the best matching implementation from *registry* for type *cls*. Where there is no registered implementation for a specific type, its method resolution order is used to find a more generic implementation. Note: if *registry* does not contain an implementation ...
def _find_impl(cls, registry): """Returns the best matching implementation from *registry* for type *cls*. Where there is no registered implementation for a specific type, its method resolution order is used to find a more generic implementation. Note: if *registry* does not contain an implementation ...
[ "Returns", "the", "best", "matching", "implementation", "from", "*", "registry", "*", "for", "type", "*", "cls", "*", "." ]
bionikspoon/pureyaml
python
https://github.com/bionikspoon/pureyaml/blob/784830b907ca14525c4cecdb6ae35306f6f8a877/pureyaml/_compat/singledispatch.py#L140-L166
[ "def", "_find_impl", "(", "cls", ",", "registry", ")", ":", "mro", "=", "_compose_mro", "(", "cls", ",", "registry", ".", "keys", "(", ")", ")", "match", "=", "None", "for", "t", "in", "mro", ":", "if", "match", "is", "not", "None", ":", "# If *mat...
784830b907ca14525c4cecdb6ae35306f6f8a877
train
singledispatch
Single-dispatch generic function decorator. Transforms a function into a generic function, which can have different behaviours depending upon the type of its first argument. The decorated function acts as the default implementation, and additional implementations can be registered using the register() ...
pureyaml/_compat/singledispatch.py
def singledispatch(function): # noqa """Single-dispatch generic function decorator. Transforms a function into a generic function, which can have different behaviours depending upon the type of its first argument. The decorated function acts as the default implementation, and additional implementa...
def singledispatch(function): # noqa """Single-dispatch generic function decorator. Transforms a function into a generic function, which can have different behaviours depending upon the type of its first argument. The decorated function acts as the default implementation, and additional implementa...
[ "Single", "-", "dispatch", "generic", "function", "decorator", "." ]
bionikspoon/pureyaml
python
https://github.com/bionikspoon/pureyaml/blob/784830b907ca14525c4cecdb6ae35306f6f8a877/pureyaml/_compat/singledispatch.py#L170-L235
[ "def", "singledispatch", "(", "function", ")", ":", "# noqa", "registry", "=", "{", "}", "dispatch_cache", "=", "WeakKeyDictionary", "(", ")", "def", "ns", "(", ")", ":", "pass", "ns", ".", "cache_token", "=", "None", "# noinspection PyIncorrectDocstring", "de...
784830b907ca14525c4cecdb6ae35306f6f8a877