Code stringlengths 103 85.9k | Summary listlengths 0 94 |
|---|---|
Please provide a description of the function:def serialize(self, items):
r = StringIO()
for key, value in items.items():
if isinstance(value, list):
# handle special case of lists
value = "["+", ".join(map(str, value))+"]"
r.write("%s = %s... | [
"Does the inverse of config parsing by taking parsed values and\n converting them back to a string representing config file contents.\n "
] |
Please provide a description of the function:def parse(self, stream):
yaml = self._load_yaml()
try:
parsed_obj = yaml.safe_load(stream)
except Exception as e:
raise ConfigFileParserException("Couldn't parse config file: %s" % e)
if not isinstance(parsed... | [
"Parses the keys and values from a config file."
] |
Please provide a description of the function:def serialize(self, items, default_flow_style=False):
# lazy-import so there's no dependency on yaml unless this class is used
yaml = self._load_yaml()
# it looks like ordering can't be preserved: http://pyyaml.org/ticket/29
items =... | [
"Does the inverse of config parsing by taking parsed values and\n converting them back to a string representing config file contents.\n\n Args:\n default_flow_style: defines serialization format (see PyYAML docs)\n "
] |
Please provide a description of the function:def parse_args(self, args = None, namespace = None,
config_file_contents = None, env_vars = os.environ):
args, argv = self.parse_known_args(args = args,
namespace = namespace,
config_file_contents = config_file_cont... | [
"Supports all the same args as the ArgumentParser.parse_args(..),\n as well as the following additional args.\n\n Additional Args:\n args: a list of args as in argparse, or a string (eg. \"-x -y bla\")\n config_file_contents: String. Used for testing.\n env_vars: Dicti... |
Please provide a description of the function:def parse_known_args(self, args = None, namespace = None,
config_file_contents = None, env_vars = os.environ):
if args is None:
args = sys.argv[1:]
elif isinstance(args, str):
args = args.split()
... | [
"Supports all the same args as the ArgumentParser.parse_args(..),\n as well as the following additional args.\n\n Additional Args:\n args: a list of args as in argparse, or a string (eg. \"-x -y bla\")\n config_file_contents: String. Used for testing.\n env_vars: Dicti... |
Please provide a description of the function:def write_config_file(self, parsed_namespace, output_file_paths, exit_after=False):
for output_file_path in output_file_paths:
# validate the output file path
try:
with open(output_file_path, "w") as output_file:
... | [
"Write the given settings to output files.\n\n Args:\n parsed_namespace: namespace object created within parse_known_args()\n output_file_paths: any number of file paths to write the config to\n exit_after: whether to exit the program after writing the config files\n "... |
Please provide a description of the function:def get_command_line_key_for_unknown_config_file_setting(self, key):
key_without_prefix_chars = key.strip(self.prefix_chars)
command_line_key = self.prefix_chars[0]*2 + key_without_prefix_chars
return command_line_key | [
"Compute a commandline arg key to be used for a config file setting\n that doesn't correspond to any defined configargparse arg (and so\n doesn't have a user-specified commandline arg key).\n\n Args:\n key: The config file key that was being set.\n "
] |
Please provide a description of the function:def get_items_for_config_file_output(self, source_to_settings,
parsed_namespace):
config_file_items = OrderedDict()
for source, settings in source_to_settings.items():
if source == _COMMAND_LINE_SO... | [
"Converts the given settings back to a dictionary that can be passed\n to ConfigFormatParser.serialize(..).\n\n Args:\n source_to_settings: the dictionary described in parse_known_args()\n parsed_namespace: namespace object created within parse_known_args()\n Returns:\n ... |
Please provide a description of the function:def convert_item_to_command_line_arg(self, action, key, value):
args = []
if action is None:
command_line_key = \
self.get_command_line_key_for_unknown_config_file_setting(key)
else:
command_line_key =... | [
"Converts a config file or env var key + value to a list of\n commandline args to append to the commandline.\n\n Args:\n action: The argparse Action object for this setting, or None if this\n config file setting doesn't correspond to any defined\n configargpars... |
Please provide a description of the function:def get_possible_config_keys(self, action):
keys = []
# Do not write out the config options for writing out a config file
if getattr(action, 'is_write_out_config_file_arg', None):
return keys
for arg in action.option_str... | [
"This method decides which actions can be set in a config file and\n what their keys will be. It returns a list of 0 or more config keys that\n can be used to set the given action's value in a config file.\n "
] |
Please provide a description of the function:def _open_config_files(self, command_line_args):
# open any default config files
config_files = [open(f) for files in map(glob.glob, map(os.path.expanduser, self._default_config_files))
for f in files]
# list actions ... | [
"Tries to parse config file path(s) from within command_line_args.\n Returns a list of opened config files, including files specified on the\n commandline as well as any default_config_files specified in the\n constructor that are present on disk.\n\n Args:\n command_line_args... |
Please provide a description of the function:def format_values(self):
source_key_to_display_value_map = {
_COMMAND_LINE_SOURCE_KEY: "Command Line Args: ",
_ENV_VAR_SOURCE_KEY: "Environment Variables:\n",
_CONFIG_FILE_SOURCE_KEY: "Config File (%s):\n",
_DE... | [
"Returns a string with all args and settings and where they came from\n (eg. commandline, config file, enviroment variable or default)\n "
] |
Please provide a description of the function:def eval(lisp):
'''
plash lisp is one dimensional lisp.
'''
macro_values = []
if not isinstance(lisp, list):
raise EvalError('eval root element must be a list')
for item in lisp:
if not isinstance(item, list):
raise EvalErr... | [] |
Please provide a description of the function:def plash_map(*args):
from subprocess import check_output
'thin wrapper around plash map'
out = check_output(['plash', 'map'] + list(args))
if out == '':
return None
return out.decode().strip('\n') | [] |
Please provide a description of the function:def defpm(name, *lines):
'define a new package manager'
@register_macro(name, group='package managers')
@shell_escape_args
def package_manager(*packages):
if not packages:
return
sh_packages = ' '.join(pkg for pkg in packages)
... | [] |
Please provide a description of the function:def layer(command=None, *args):
'hints the start of a new layer'
if not command:
return eval([['hint', 'layer']]) # fall back to buildin layer macro
else:
lst = [['layer']]
for arg in args:
lst.append([command, arg])
... | [] |
Please provide a description of the function:def import_env(*envs):
'import environment variables from host'
for env in envs:
parts = env.split(':', 1)
if len(parts) == 1:
export_as = env
else:
env, export_as = parts
env_val = os.environ.get(env)
i... | [] |
Please provide a description of the function:def write_file(fname, *lines):
'write lines to a file'
yield 'touch {}'.format(fname)
for line in lines:
yield "echo {} >> {}".format(line, fname) | [] |
Please provide a description of the function:def eval_file(file):
'evaluate file content as expressions'
fname = os.path.realpath(os.path.expanduser(file))
with open(fname) as f:
inscript = f.read()
sh = run_write_read(['plash', 'eval'], inscript.encode()).decode()
# we remove an possibly... | [] |
Please provide a description of the function:def eval_string(stri):
'evaluate expressions passed as string'
tokens = shlex.split(stri)
return run_write_read(['plash', 'eval'], '\n'.join(tokens).encode()).decode() | [] |
Please provide a description of the function:def eval_stdin():
'evaluate expressions read from stdin'
cmd = ['plash', 'eval']
p = subprocess.Popen(cmd, stdin=sys.stdin, stdout=sys.stdout)
exit = p.wait()
if exit:
raise subprocess.CalledProcessError(exit, cmd) | [] |
Please provide a description of the function:def entrypoint_script(*lines):
'write lines to /entrypoint and hint it as default command'
lines = list(lines)
if lines and not lines[0].startswith('#!'):
lines.insert(0, '#!/bin/sh')
return eval([['entrypoint', '/entrypoint'],
['writ... | [] |
Please provide a description of the function:def from_map(map_key):
'use resolved map as image'
image_id = subprocess.check_output(['plash', 'map',
map_key]).decode().strip('\n')
if not image_id:
raise MapDoesNotExist('map {} not found'.format(repr(map_key)))
... | [] |
Please provide a description of the function:def from_github(user_repo_pair, file='plashfile'):
"build and use a file (default 'plashfile') from github repo"
from urllib.request import urlopen
url = 'https://raw.githubusercontent.com/{}/master/{}'.format(
user_repo_pair, file)
with utils.catch_a... | [] |
Please provide a description of the function:def fields(self):
fields = super(DynamicFieldsMixin, self).fields
if not hasattr(self, '_context'):
# We are being called before a request cycle
return fields
# Only filter if this is the root serializer, or if the p... | [
"\n Filters the fields according to the `fields` query parameter.\n\n A blank `fields` parameter (?fields) will remove all fields. Not\n passing `fields` will pass all fields individual fields are comma\n separated (?fields=id,name,url,email).\n\n "
] |
Please provide a description of the function:def setup_admin_on_rest_handlers(admin, admin_handler):
add_route = admin.router.add_route
add_static = admin.router.add_static
static_folder = str(PROJ_ROOT / 'static')
a = admin_handler
add_route('GET', '', a.index_page, name='admin.index')
ad... | [
"\n Initialize routes.\n "
] |
Please provide a description of the function:async def index_page(self, request):
context = {"initial_state": self.schema.to_json()}
return render_template(
self.template,
request,
context,
app_key=TEMPLATE_APP_KEY,
) | [
"\n Return index page with initial state for admin\n "
] |
Please provide a description of the function:async def logout(self, request):
if "Authorization" not in request.headers:
msg = "Auth header is not present, can not destroy token"
raise JsonValidaitonError(msg)
response = json_response()
await forget(request, res... | [
"\n Simple handler for logout\n "
] |
Please provide a description of the function:def json_datetime_serial(obj):
if isinstance(obj, (datetime, date)):
serial = obj.isoformat()
return serial
if ObjectId is not None and isinstance(obj, ObjectId):
# TODO: try to use bson.json_util instead
return str(obj)
rai... | [
"JSON serializer for objects not serializable by default json code"
] |
Please provide a description of the function:def validate_query_structure(query):
query_dict = dict(query)
filters = query_dict.pop('_filters', None)
if filters:
try:
f = json.loads(filters)
except ValueError:
msg = '_filters field can not be serialized'
... | [
"Validate query arguments in list request.\n\n :param query: mapping with pagination and filtering information\n "
] |
Please provide a description of the function:def to_json(self):
endpoints = []
for endpoint in self.endpoints:
list_fields = endpoint.fields
resource_type = endpoint.Meta.resource_type
table = endpoint.Meta.table
data = endpoint.to_dict()
... | [
"\n Prepare data for the initial state of the admin-on-rest\n "
] |
Please provide a description of the function:def resources(self):
resources = []
for endpoint in self.endpoints:
resource_type = endpoint.Meta.resource_type
table = endpoint.Meta.table
url = endpoint.name
resources.append((resource_type, {'table... | [
"\n Return list of all registered resources.\n "
] |
Please provide a description of the function:def get_type_of_fields(fields, table):
if not fields:
fields = table.primary_key
actual_fields = [
field for field in table.c.items() if field[0] in fields
]
data_type_fields = {
name: FIELD_TYPE... | [
"\n Return data types of `fields` that are in `table`. If a given\n parameter is empty return primary key.\n\n :param fields: list - list of fields that need to be returned\n :param table: sa.Table - the current table\n :return: list - list of the tuples `(field_name, fields_type)... |
Please provide a description of the function:def get_type_for_inputs(table):
return [
dict(
type=INPUT_TYPES.get(
type(field_type.type), rc.TEXT_INPUT.value
),
name=name,
isPrimaryKey=(name in table.primary_... | [
"\n Return information about table's fields in dictionary type.\n\n :param table: sa.Table - the current table\n :return: list - list of the dictionaries\n "
] |
Please provide a description of the function:def _setup(app, *, schema, title=None, app_key=APP_KEY, db=None):
admin = web.Application(loop=app.loop)
app[app_key] = admin
loader = jinja2.FileSystemLoader([TEMPLATES_ROOT, ])
aiohttp_jinja2.setup(admin, loader=loader, app_key=TEMPLATE_APP_KEY)
... | [
"Initialize the admin-on-rest admin"
] |
Please provide a description of the function:def to_dict(self):
data = {
"name": self.name,
"canEdit": self.can_edit,
"canCreate": self.can_create,
"canDelete": self.can_delete,
"perPage": self.per_page,
"showPage": self.generate_d... | [
"\n Return dict with the all base information about the instance.\n "
] |
Please provide a description of the function:def generate_data_for_edit_page(self):
if not self.can_edit:
return {}
if self.edit_form:
return self.edit_form.to_dict()
return self.generate_simple_data_page() | [
"\n Generate a custom representation of table's fields in dictionary type\n if exist edit form else use default representation.\n\n :return: dict\n "
] |
Please provide a description of the function:def generate_data_for_create_page(self):
if not self.can_create:
return {}
if self.create_form:
return self.create_form.to_dict()
return self.generate_simple_data_page() | [
"\n Generate a custom representation of table's fields in dictionary type\n if exist create form else use default representation.\n\n :return: dict\n "
] |
Please provide a description of the function:async def register(self, request):
session = await get_session(request)
user_id = session.get('user_id')
if user_id:
return redirect(request, 'timeline')
error = None
form = None
if request.method == 'POST... | [
"Registers the user."
] |
Please provide a description of the function:async def follow_user(self, request):
username = request.match_info['username']
session = await get_session(request)
user_id = session.get('user_id')
if not user_id:
raise web.HTTPNotAuthorized()
whom_id = await ... | [
"Adds the current user as follower of the given user."
] |
Please provide a description of the function:async def add_message(self, request):
session = await get_session(request)
user_id = session.get('user_id')
if not user_id:
raise web.HTTPNotAuthorized()
form = await request.post()
if form.get('text'):
... | [
"Registers a new message for the user."
] |
Please provide a description of the function:def robo_avatar_url(user_data, size=80):
hash = md5(str(user_data).strip().lower().encode('utf-8')).hexdigest()
url = "https://robohash.org/{hash}.png?size={size}x{size}".format(
hash=hash, size=size)
return url | [
"Return the gravatar image for the given email address."
] |
Please provide a description of the function:def waitgrab(self, timeout=60, autocrop=True, cb_imgcheck=None):
'''start process and create screenshot.
Repeat screenshot until it is not empty and
cb_imgcheck callback function returns True
for current screenshot.
:param autocrop: T... | [] |
Please provide a description of the function:def redirect_display(self, on):
'''
on:
* True -> set $DISPLAY to virtual screen
* False -> set $DISPLAY to original screen
:param on: bool
'''
d = self.new_display_var if on else self.old_display_var
if d is... | [] |
Please provide a description of the function:def start(self):
'''
start display
:rtype: self
'''
if self.use_xauth:
self._setup_xauth()
EasyProcess.start(self)
# https://github.com/ponty/PyVirtualDisplay/issues/2
# https://github.com/ponty/Py... | [] |
Please provide a description of the function:def stop(self):
'''
stop display
:rtype: self
'''
self.redirect_display(False)
EasyProcess.stop(self)
if self.use_xauth:
self._clear_xauth()
return self | [] |
Please provide a description of the function:def _setup_xauth(self):
'''
Set up the Xauthority file and the XAUTHORITY environment variable.
'''
handle, filename = tempfile.mkstemp(prefix='PyVirtualDisplay.',
suffix='.Xauthority')
self.... | [] |
Please provide a description of the function:def _clear_xauth(self):
'''
Clear the Xauthority file and restore the environment variables.
'''
os.remove(self._xauth_filename)
for varname in ['AUTHFILE', 'XAUTHORITY']:
if self._old_xauth[varname] is None:
... | [] |
Please provide a description of the function:def GetSecurityToken(self, username, password):
url = 'https://login.microsoftonline.com/extSTS.srf'
body = % (username, password, self.share_point_site)
headers = {'accept': 'application/json;odata=verbose'}
response = requests.pos... | [
"\n Grabs a security Token to authenticate to Office 365 services\n ",
"\n <s:Envelope xmlns:s=\"http://www.w3.org/2003/05/soap-envelope\"\n xmlns:a=\"http://www.w3.org/2005/08/addressing\"\n xmlns:u=\"http://docs.oasis-open.org/wss/2004/01/oasis-2004... |
Please provide a description of the function:def GetCookies(self):
sectoken = self.GetSecurityToken(self.Username, self.Password)
url = self.share_point_site+ '/_forms/default.aspx?wa=wsignin1.0'
response = requests.post(url, data=sectoken)
return response.cookies | [
"\n Grabs the cookies form your Office Sharepoint site\n and uses it as Authentication for the rest of the calls\n "
] |
Please provide a description of the function:def AddList(self, listName, description, templateID):
templateIDs = {'Announcements': '104',
'Contacts': '105',
'Custom List': '100',
'Custom List in Datasheet View': '120',
... | [
"Create a new List\n Provide: List Name, List Description, and List Template\n Templates Include:\n Announcements\n Contacts\n Custom List\n Custom List in Datasheet View\n DataSources\n Discussion Board\n ... |
Please provide a description of the function:def DeleteList(self, listName):
# Build Request
soap_request = soap('DeleteList')
soap_request.add_parameter('listName', listName)
self.last_request = str(soap_request)
# Send Request
response = self._session.post(ur... | [
"Delete a List with given name"
] |
Please provide a description of the function:def GetListCollection(self):
# Build Request
soap_request = soap('GetListCollection')
self.last_request = str(soap_request)
# Send Request
response = self._session.post(url=self._url('SiteData'),
... | [
"Returns List information for current Site"
] |
Please provide a description of the function:def GetUsers(self, rowlimit=0):
# Build Request
soap_request = soap('GetListItems')
soap_request.add_parameter('listName', 'UserInfo')
# Set Row Limit
soap_request.add_parameter('rowLimit', str(rowlimit))
self.last_r... | [
"Get Items from current list\n rowlimit defaulted to 0 (no limit)\n "
] |
Please provide a description of the function:def List(self, listName, exclude_hidden_fields=False):
return _List(self._session, listName, self._url, self._verify_ssl, self.users, self.huge_tree, self.timeout, exclude_hidden_fields=exclude_hidden_fields) | [
"Sharepoint Lists Web Service\n Microsoft Developer Network:\n The Lists Web service provides methods for working\n with SharePoint lists, content types, list items, and files.\n "
] |
Please provide a description of the function:def _convert_to_internal(self, data):
for _dict in data:
keys = list(_dict.keys())[:]
for key in keys:
if key not in self._disp_cols:
raise Exception(key + ' not a column in current List.')
... | [
"From 'Column Title' to 'Column_x0020_Title'"
] |
Please provide a description of the function:def _convert_to_display(self, data):
for _dict in data:
keys = list(_dict.keys())[:]
for key in keys:
if key not in self._sp_cols:
raise Exception(key + ' not a column in current List.')
... | [
"From 'Column_x0020_Title' to 'Column Title'"
] |
Please provide a description of the function:def _python_type(self, key, value):
try:
field_type = self._sp_cols[key]['type']
if field_type in ['Number', 'Currency']:
return float(value)
elif field_type == 'DateTime':
# Need to remov... | [
"Returns proper type from the schema"
] |
Please provide a description of the function:def _sp_type(self, key, value):
try:
field_type = self._disp_cols[key]['type']
if field_type in ['Number', 'Currency']:
return value
elif field_type == 'DateTime':
return value.strftime('%Y-... | [
"Returns proper type from the schema"
] |
Please provide a description of the function:def GetListItems(self, viewname=None, fields=None, query=None, rowlimit=0, debug=False):
# Build Request
soap_request = soap('GetListItems')
soap_request.add_parameter('listName', self.listName)
# Convert Displayed View Name to View ... | [
"Get Items from current list\n rowlimit defaulted to 0 (unlimited)\n "
] |
Please provide a description of the function:def GetList(self):
# Build Request
soap_request = soap('GetList')
soap_request.add_parameter('listName', self.listName)
self.last_request = str(soap_request)
# Send Request
response = self._session.post(url=self._url... | [
"Get Info on Current List\n This is run in __init__ so you don't\n have to run it again.\n Access from self.schema\n "
] |
Please provide a description of the function:def GetView(self, viewname):
# Build Request
soap_request = soap('GetView')
soap_request.add_parameter('listName', self.listName)
if viewname == None:
views = self.GetViewCollection()
for view in views:
... | [
"Get Info on View Name\n "
] |
Please provide a description of the function:def GetViewCollection(self):
# Build Request
soap_request = soap('GetViewCollection')
soap_request.add_parameter('listName', self.listName)
self.last_request = str(soap_request)
# Send Request
response = self._sessio... | [
"Get Views for Current List\n This is run in __init__ so you don't\n have to run it again.\n Access from self.views\n "
] |
Please provide a description of the function:def UpdateListItems(self, data, kind):
if type(data) != list:
raise Exception('data must be a list of dictionaries')
# Build Request
soap_request = soap('UpdateListItems')
soap_request.add_parameter('listName', self.listNa... | [
"Update List Items\n kind = 'New', 'Update', or 'Delete'\n\n New:\n Provide data like so:\n data = [{'Title': 'New Title', 'Col1': 'New Value'}]\n\n Update:\n Provide data like so:\n data = [{'ID': 23, 'Title': 'Updated Title'},\n ... |
Please provide a description of the function:def GetAttachmentCollection(self, _id):
# Build Request
soap_request = soap('GetAttachmentCollection')
soap_request.add_parameter('listName', self.listName)
soap_request.add_parameter('listItemID', _id)
self.last_request = st... | [
"Get Attachments for given List Item ID"
] |
Please provide a description of the function:def changes(new_cmp_dict, old_cmp_dict, id_column, columns):
update_ldict = []
same_keys = set(new_cmp_dict).intersection(set(old_cmp_dict))
for same_key in same_keys:
# Get the Union of the set of keys
# for both dictionaries to account
... | [
"Return a list dict of the changes of the\n rows that exist in both dictionaries\n User must provide an ID column for old_cmp_dict\n "
] |
Please provide a description of the function:def unique(new_cmp_dict, old_cmp_dict):
newkeys = set(new_cmp_dict)
oldkeys = set(old_cmp_dict)
unique = newkeys - oldkeys
unique_ldict = []
for key in unique:
unique_ldict.append(new_cmp_dict[key])
return unique_ldict | [
"Return a list dict of\n the unique keys in new_cmp_dict\n "
] |
Please provide a description of the function:def full_dict(ldict, keys):
if type(keys) == str:
keys = [keys]
else:
keys = keys
cmp_dict = {}
for line in ldict:
index = []
for key in keys:
index.append(str(line.get(key, '')))
index = '-'.join(inde... | [
"Return Comparison Dictionaries\n from list dict on keys\n keys: a list of keys that when\n combined make the row in the list unique\n "
] |
Please provide a description of the function:def BooleanSlice(input_vertex: vertex_constructor_param_types, dimension: int, index: int, label: Optional[str]=None) -> Vertex:
return Boolean(context.jvm_view().BooleanSliceVertex, label, cast_to_vertex(input_vertex), cast_to_integer(dimension), cast_to_integer(in... | [
"\n Takes the slice along a given dimension and index of a vertex\n \n :param input_vertex: the input vertex\n :param dimension: the dimension to extract along\n :param index: the index of extraction\n "
] |
Please provide a description of the function:def BooleanTake(input_vertex: vertex_constructor_param_types, index: Collection[int], label: Optional[str]=None) -> Vertex:
return Boolean(context.jvm_view().BooleanTakeVertex, label, cast_to_vertex(input_vertex), cast_to_long_array(index)) | [
"\n A vertex that extracts a scalar at a given index\n \n :param input_vertex: the input vertex to extract from\n :param index: the index to extract at\n "
] |
Please provide a description of the function:def Bernoulli(prob_true: vertex_constructor_param_types, label: Optional[str]=None) -> Vertex:
return Boolean(context.jvm_view().BernoulliVertex, label, cast_to_double_vertex(prob_true)) | [
"\n One to one constructor for mapping some shape of probTrue to\n a matching shaped Bernoulli.\n \n :param prob_true: probTrue with same shape as desired Bernoulli tensor or scalar\n "
] |
Please provide a description of the function:def Addition(left: vertex_constructor_param_types, right: vertex_constructor_param_types, label: Optional[str]=None) -> Vertex:
return Double(context.jvm_view().AdditionVertex, label, cast_to_double_vertex(left), cast_to_double_vertex(right)) | [
"\n Adds one vertex to another\n \n :param left: a vertex to add\n :param right: a vertex to add\n "
] |
Please provide a description of the function:def ArcTan2(x: vertex_constructor_param_types, y: vertex_constructor_param_types, label: Optional[str]=None) -> Vertex:
return Double(context.jvm_view().ArcTan2Vertex, label, cast_to_double_vertex(x), cast_to_double_vertex(y)) | [
"\n Calculates the signed angle, in radians, between the positive x-axis and a ray to the point (x, y) from the origin\n \n :param x: x coordinate\n :param y: y coordinate\n "
] |
Please provide a description of the function:def Difference(left: vertex_constructor_param_types, right: vertex_constructor_param_types, label: Optional[str]=None) -> Vertex:
return Double(context.jvm_view().DifferenceVertex, label, cast_to_double_vertex(left), cast_to_double_vertex(right)) | [
"\n Subtracts one vertex from another\n \n :param left: the vertex that will be subtracted from\n :param right: the vertex to subtract\n "
] |
Please provide a description of the function:def Division(left: vertex_constructor_param_types, right: vertex_constructor_param_types, label: Optional[str]=None) -> Vertex:
return Double(context.jvm_view().DivisionVertex, label, cast_to_double_vertex(left), cast_to_double_vertex(right)) | [
"\n Divides one vertex by another\n \n :param left: the vertex to be divided\n :param right: the vertex to divide\n "
] |
Please provide a description of the function:def MatrixMultiplication(left: vertex_constructor_param_types, right: vertex_constructor_param_types, label: Optional[str]=None) -> Vertex:
return Double(context.jvm_view().MatrixMultiplicationVertex, label, cast_to_double_vertex(left), cast_to_double_vertex(right)) | [
"\n Matrix multiplies one vertex by another. C = AB\n \n :param left: vertex A\n :param right: vertex B\n "
] |
Please provide a description of the function:def Max(left: vertex_constructor_param_types, right: vertex_constructor_param_types, label: Optional[str]=None) -> Vertex:
return Double(context.jvm_view().MaxVertex, label, cast_to_double_vertex(left), cast_to_double_vertex(right)) | [
"\n Finds the maximum between two vertices\n \n :param left: one of the vertices to find the maximum of\n :param right: one of the vertices to find the maximum of\n "
] |
Please provide a description of the function:def Min(left: vertex_constructor_param_types, right: vertex_constructor_param_types, label: Optional[str]=None) -> Vertex:
return Double(context.jvm_view().MinVertex, label, cast_to_double_vertex(left), cast_to_double_vertex(right)) | [
"\n Finds the minimum between two vertices\n \n :param left: one of the vertices to find the minimum of\n :param right: one of the vertices to find the minimum of\n "
] |
Please provide a description of the function:def Multiplication(left: vertex_constructor_param_types, right: vertex_constructor_param_types, label: Optional[str]=None) -> Vertex:
return Double(context.jvm_view().MultiplicationVertex, label, cast_to_double_vertex(left), cast_to_double_vertex(right)) | [
"\n Multiplies one vertex by another\n \n :param left: vertex to be multiplied\n :param right: vertex to be multiplied\n "
] |
Please provide a description of the function:def Power(base: vertex_constructor_param_types, exponent: vertex_constructor_param_types, label: Optional[str]=None) -> Vertex:
return Double(context.jvm_view().PowerVertex, label, cast_to_double_vertex(base), cast_to_double_vertex(exponent)) | [
"\n Raises a vertex to the power of another\n \n :param base: the base vertex\n :param exponent: the exponent vertex\n "
] |
Please provide a description of the function:def Abs(input_vertex: vertex_constructor_param_types, label: Optional[str]=None) -> Vertex:
return Double(context.jvm_view().AbsVertex, label, cast_to_double_vertex(input_vertex)) | [
"\n Takes the absolute of a vertex\n \n :param input_vertex: the vertex\n "
] |
Please provide a description of the function:def ArcCos(input_vertex: vertex_constructor_param_types, label: Optional[str]=None) -> Vertex:
return Double(context.jvm_view().ArcCosVertex, label, cast_to_double_vertex(input_vertex)) | [
"\n Takes the inverse cosine of a vertex, Arccos(vertex)\n \n :param input_vertex: the vertex\n "
] |
Please provide a description of the function:def ArcSin(input_vertex: vertex_constructor_param_types, label: Optional[str]=None) -> Vertex:
return Double(context.jvm_view().ArcSinVertex, label, cast_to_double_vertex(input_vertex)) | [
"\n Takes the inverse sin of a vertex, Arcsin(vertex)\n \n :param input_vertex: the vertex\n "
] |
Please provide a description of the function:def ArcTan(input_vertex: vertex_constructor_param_types, label: Optional[str]=None) -> Vertex:
return Double(context.jvm_view().ArcTanVertex, label, cast_to_double_vertex(input_vertex)) | [
"\n Takes the inverse tan of a vertex, Arctan(vertex)\n \n :param input_vertex: the vertex\n "
] |
Please provide a description of the function:def Ceil(input_vertex: vertex_constructor_param_types, label: Optional[str]=None) -> Vertex:
return Double(context.jvm_view().CeilVertex, label, cast_to_double_vertex(input_vertex)) | [
"\n Applies the Ceiling operator to a vertex.\n This maps a vertex to the smallest integer greater than or equal to its value\n \n :param input_vertex: the vertex to be ceil'd\n "
] |
Please provide a description of the function:def Cos(input_vertex: vertex_constructor_param_types, label: Optional[str]=None) -> Vertex:
return Double(context.jvm_view().CosVertex, label, cast_to_double_vertex(input_vertex)) | [
"\n Takes the cosine of a vertex, Cos(vertex)\n \n :param input_vertex: the vertex\n "
] |
Please provide a description of the function:def Exp(input_vertex: vertex_constructor_param_types, label: Optional[str]=None) -> Vertex:
return Double(context.jvm_view().ExpVertex, label, cast_to_double_vertex(input_vertex)) | [
"\n Calculates the exponential of an input vertex\n \n :param input_vertex: the vertex\n "
] |
Please provide a description of the function:def Floor(input_vertex: vertex_constructor_param_types, label: Optional[str]=None) -> Vertex:
return Double(context.jvm_view().FloorVertex, label, cast_to_double_vertex(input_vertex)) | [
"\n Applies the Floor operator to a vertex.\n This maps a vertex to the biggest integer less than or equal to its value\n \n :param input_vertex: the vertex to be floor'd\n "
] |
Please provide a description of the function:def LogGamma(input_vertex: vertex_constructor_param_types, label: Optional[str]=None) -> Vertex:
return Double(context.jvm_view().LogGammaVertex, label, cast_to_double_vertex(input_vertex)) | [
"\n Returns the log of the gamma of the inputVertex\n \n :param input_vertex: the vertex\n "
] |
Please provide a description of the function:def Log(input_vertex: vertex_constructor_param_types, label: Optional[str]=None) -> Vertex:
return Double(context.jvm_view().LogVertex, label, cast_to_double_vertex(input_vertex)) | [
"\n Returns the natural logarithm, base e, of a vertex\n \n :param input_vertex: the vertex\n "
] |
Please provide a description of the function:def Round(input_vertex: vertex_constructor_param_types, label: Optional[str]=None) -> Vertex:
return Double(context.jvm_view().RoundVertex, label, cast_to_double_vertex(input_vertex)) | [
"\n Applies the Rounding operator to a vertex.\n This maps a vertex to the nearest integer value\n \n :param input_vertex: the vertex to be rounded\n "
] |
Please provide a description of the function:def Sigmoid(input_vertex: vertex_constructor_param_types, label: Optional[str]=None) -> Vertex:
return Double(context.jvm_view().SigmoidVertex, label, cast_to_double_vertex(input_vertex)) | [
"\n Applies the sigmoid function to a vertex.\n The sigmoid function is a special case of the Logistic function.\n \n :param input_vertex: the vertex\n "
] |
Please provide a description of the function:def Sin(input_vertex: vertex_constructor_param_types, label: Optional[str]=None) -> Vertex:
return Double(context.jvm_view().SinVertex, label, cast_to_double_vertex(input_vertex)) | [
"\n Takes the sine of a vertex. Sin(vertex).\n \n :param input_vertex: the vertex\n "
] |
Please provide a description of the function:def Slice(input_vertex: vertex_constructor_param_types, dimension: int, index: int, label: Optional[str]=None) -> Vertex:
return Double(context.jvm_view().SliceVertex, label, cast_to_double_vertex(input_vertex), cast_to_integer(dimension), cast_to_integer(index)) | [
"\n Takes the slice along a given dimension and index of a vertex\n \n :param input_vertex: the input vertex\n :param dimension: the dimension to extract along\n :param index: the index of extraction\n "
] |
Please provide a description of the function:def Sum(input_vertex: vertex_constructor_param_types, label: Optional[str]=None) -> Vertex:
return Double(context.jvm_view().SumVertex, label, cast_to_double_vertex(input_vertex)) | [
"\n Performs a sum across all dimensions\n \n :param input_vertex: the vertex to have its values summed\n "
] |
Please provide a description of the function:def Take(input_vertex: vertex_constructor_param_types, index: Collection[int], label: Optional[str]=None) -> Vertex:
return Double(context.jvm_view().TakeVertex, label, cast_to_double_vertex(input_vertex), cast_to_long_array(index)) | [
"\n A vertex that extracts a scalar at a given index\n \n :param input_vertex: the input vertex to extract from\n :param index: the index to extract at\n "
] |
Please provide a description of the function:def Tan(input_vertex: vertex_constructor_param_types, label: Optional[str]=None) -> Vertex:
return Double(context.jvm_view().TanVertex, label, cast_to_double_vertex(input_vertex)) | [
"\n Takes the tangent of a vertex. Tan(vertex).\n \n :param input_vertex: the vertex\n "
] |
Please provide a description of the function:def Beta(alpha: vertex_constructor_param_types, beta: vertex_constructor_param_types, label: Optional[str]=None) -> Vertex:
return Double(context.jvm_view().BetaVertex, label, cast_to_double_vertex(alpha), cast_to_double_vertex(beta)) | [
"\n One to one constructor for mapping some tensorShape of alpha and beta to\n a matching tensorShaped Beta.\n \n :param alpha: the alpha of the Beta with either the same tensorShape as specified for this vertex or a scalar\n :param beta: the beta of the Beta with either the same tensorShape as speci... |
Please provide a description of the function:def ChiSquared(k: vertex_constructor_param_types, label: Optional[str]=None) -> Vertex:
return Double(context.jvm_view().ChiSquaredVertex, label, cast_to_integer_vertex(k)) | [
"\n One to one constructor for mapping some shape of k to\n a matching shaped ChiSquared.\n \n :param k: the number of degrees of freedom\n "
] |
Please provide a description of the function:def Dirichlet(concentration: vertex_constructor_param_types, label: Optional[str]=None) -> Vertex:
return Double(context.jvm_view().DirichletVertex, label, cast_to_double_vertex(concentration)) | [
"\n Matches a vector of concentration values to a Dirichlet distribution\n \n :param concentration: the concentration values of the dirichlet\n "
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.