code stringlengths 1 18.2k |
|---|
def swagger_schema(self, request): """Render API Schema.""" if self.parent is None: return {} spec = APISpec( self.parent.name, self.parent.cfg.get('VERSION', ''), plugins=['apispec.ext.marshmallow'], basePatch=self.prefix ) for paths, handler in self.handlers.items(): spec.add_tag({ 'name': handler.name, 'description'... |
def Box(*args, **kw): """Axis-aligned box domain (same as AABox for now) WARNING: Deprecated, use AABox instead. This domain will mean something different in future versions of lepton """ import warnings warnings.warn("lepton.domain.Box is deprecated, use AABox instead. " "This domain class will mean something differen... |
def update_pzone(**kwargs): """Update pzone data in the DB""" pzone = PZone.objects.get(**kwargs) # get the data and loop through operate_on, applying them if necessary when = timezone.now() data = pzone.data for operation in pzone.operations.filter(when__lte=when, applied=False): data = operation.apply(data) operation... |
def operate_on(self, when=None, apply=False, **kwargs): """Do something with operate_on. If apply is True, all transactions will be applied and saved via celery task.""" # get pzone based on id pzone = self.get(**kwargs) # cache the current time now = timezone.now() # ensure we have some value for when if when is None:... |
pending_operations: data = operation.apply(data) # reassign data pzone.data = data if apply and pending_operations.exists(): # there are operations to apply, do celery task update_pzone.delay(**kwargs) # return pzone, modified if apply was True return pzone |
def preview(self, when=timezone.now(), **kwargs): """Preview transactions, but don't actually save changes to list.""" return self.operate_on(when=when, apply=False, **kwargs) |
def get_download_link(self): """ Get direct download link with soudcloud's redirect system. """ url = None if not self.get("downloadable"): try: url = self.client.get_location( self.client.STREAM_URL % self.get("id")) except serror as e: print(e) if not url: try: url = self.client.get_location( self.client.DOWNLOAD_URL... |
def get_file_extension(self, filepath): """ This method check mimetype to define file extension. If it can't, it use original-format metadata. """ mtype = magic.from_file(filepath, mime=True) if type(mtype) == bytes: mtype = mtype.decode("utf-8") if mtype == "audio/mpeg": ext = ".mp3" elif mtype == "audio/x-wav": ext =... |
def gen_localdir(self, localdir): """ Generate local directory where track will be saved. Create it if not exists. """ directory = "{0}/{1}/".format(localdir, self.get("username")) if not os.path.exists(directory): os.makedirs(directory) return directory |
def track_exists(self, localdir): """ Check if track exists in local directory. """ path = glob.glob(self.gen_localdir(localdir) + self.gen_filename() + "*") if len(path) > 0 and os.path.getsize(path[0]) > 0: return True return False |
def get_ignored_tracks(self, localdir): """ Get ignored tracks list. """ ignore_file = "%s/.ignore" % localdir list = [] if os.path.exists(ignore_file): f = open(ignore_file) ignored = f.readlines() f.close() for i in ignored: list.append("%s/%s" % (localdir, i.rstrip())) return list |
def download(self, localdir, max_retry): """ Download a track in local directory. """ local_file = self.gen_localdir(localdir) + self.gen_filename() if self.track_exists(localdir): print("Track {0} already downloaded, skipping!".format( self.get("id"))) return False if local_file in self.get_ignored_tracks(localdir): p... |
file removed.") self.filepath = local_file + self.get_file_extension(local_file) os.rename(local_file, self.filepath) print("Downloaded => %s" % self.filepath) self.downloaded = True return True |
def process_tags(self, tag=None): """Process ID3 Tags for mp3 files.""" if self.downloaded is False: raise serror("Track not downloaded, can't process tags..") filetype = magic.from_file(self.filepath, mime=True) if filetype != "audio/mpeg": raise serror("Cannot process tags for file type %s." % filetype) print("Proces... |
def convert(self): """Convert file in mp3 format.""" if self.downloaded is False: raise serror("Track not downloaded, can't convert file..") filetype = magic.from_file(self.filepath, mime=True) if filetype == "audio/mpeg": print("File is already in mp3 format. Skipping convert.") return False rootpath = os.path.dirname... |
def download_artwork(self, localdir, max_retry): """ Download track's artwork and return file path. Artwork's path is saved in track's metadata as 'artwork-path' key. """ if self.get("artwork-url") == "None": self.metadata["artwork-path"] = None return None artwork_dir = localdir + "/artworks" if not os.path.isdir(artw... |
def _progress_hook(self, blocknum, blocksize, totalsize): """ Progress hook for urlretrieve. """ read = blocknum * blocksize if totalsize > 0: percent = read * 1e2 / totalsize s = "\r%d%% %*d / %d" % ( percent, len(str(totalsize)), read, totalsize) sys.stdout.write(s) if read >= totalsize: sys.stdout.write("\n") else: ... |
def load_id3(self, track): """ Load id3 tags from strack metadata """ if not isinstance(track, strack): raise TypeError('strack object required') timestamp = calendar.timegm(parse(track.get("created-at")).timetuple()) self.mapper[TIT1] = TIT1(text=track.get("description")) self.mapper[TIT2] = TIT2(text=track.get("title... |
def write_id3(self, filename): """ Write id3 tags """ if not os.path.exists(filename): raise ValueError("File doesn't exists.") self.mapper.write(filename) |
def _atlas_from_images(images): """Create a pyglet texture atlas from a sequence of images. Return a tuple of (atlas, textures) """ import pyglet widest = max(img.width for img in images) height = sum(img.height for img in images) atlas = pyglet.image.atlas.TextureAtlas( width=_nearest_pow2(widest), height=_nearest_pow... |
def create_point_texture(size, feather=0): """Create and load a circular grayscale image centered in a square texture with a width and height of size. The radius of the circle is size / 2. Since size is used as the texture width and height, it should typically be a power of two. Feather determines the softness of the e... |
size**2)() r = size / 2.0 c = feather + 1.0 for y in coords: col = y * size for x in coords: d = math.sqrt((x - r)**2 + (y - r)**2) if d < r and (1.0 - 1.0 / (d / r - 1.0)) < 100: texel[x + col] = c**2 / c**(1.0 - 1.0 / (d / r - 1.0)) else: texel[x + col] = 0 id = gl.GLuint() gl.glGenTextures(1, ctypes.byref(id)) gl.gl... |
def from_images(cls, images, weights=None, filter=None, wrap=None, aspect_adjust_width=False, aspect_adjust_height=False): """Create a SpriteTexturizer from a sequence of Pyglet images. Note all the images must be able to fit into a single OpenGL texture, so their combined size should typically be less than 1024x1024 "... |
def parse_querystring(querystring): """ Return parsed querystring in dict """ if querystring is None or len(querystring) == 0: return {} qs_dict = parse.parse_qs(querystring, keep_blank_values=True) for key in qs_dict: if len(qs_dict[key]) != 1: continue qs_dict[key] = qs_dict[key][0] if qs_dict[key] == '': qs_dict[key... |
def to_json(self, pretty=True): """ to_json will call to_dict then dumps into json format """ data_dict = self.to_dict() if pretty: return json.dumps( data_dict, sort_keys=True, indent=2) return json.dumps(data_dict, sort_keys=True) |
def to_dict(self): """ to_dict will clean all protected and private properties """ return dict( (k, self.__dict__[k]) for k in self.__dict__ if k.find("_") != 0) |
def match(self, route): """ Match input route and return new Message instance with parsed content """ _resource = trim_resource(self.resource) self.method = self.method.lower() resource_match = route.resource_regex.search(_resource) if resource_match is None: return None # build params and querystring params = resource... |
def to_response(self, sign, code=200, data=None): """ transform message to response message Notice: this method will return a deepcopy """ msg = copy.deepcopy(self) msg.data = data setattr(msg, 'code', code) for _ in ["query", "param", "tunnel"]: if not hasattr(msg, _): continue delattr(msg, _) if hasattr(msg, 'sign') ... |
def to_event(self): """ get rid of id, sign, tunnel and update message type Notice: this method will return a deepcopy """ msg = copy.deepcopy(self) for _ in ["id", "sign", "tunnel", "query", "param"]: if not hasattr(msg, _): continue delattr(msg, _) msg._type = Message.get_message_type(msg.__dict__) return msg |
def get_message_type(message): """ Return message's type """ for msg_type in MessageType.FIELDS: if Message.is_type(msg_type, message): return msg_type return MessageType.UNKNOWN |
def is_type(msg_type, msg): """ Return message's type is or not """ for prop in MessageType.FIELDS[msg_type]["must"]: if msg.get(prop, False) is False: return False for prop in MessageType.FIELDS[msg_type]["prohibit"]: if msg.get(prop, False) is not False: return False return True |
def add(self, f, name=None, types=None, required=None): """ Adds a new method to the jsonrpc service. Arguments: f -- the remote function name -- name of the method in the jsonrpc service types -- list or dictionary of the types of accepted arguments required -- list of required keyword arguments If name argument is no... |
is not None: self.method_data[fname]['types'] = types if required is not None: self.method_data[fname]['required'] = required |
def stopServing(self, exception=None): """ Returns a deferred that will fire immediately if there are no pending requests, otherwise when the last request is removed from self.pending. """ if exception is None: exception = ServiceUnavailableError self.serve_exception = exception if self.pending: d = self.out_of_service... |
def call(self, jsondata): """ Calls jsonrpc service's method and returns its return value in a JSON string or None if there is none. Arguments: jsondata -- remote method call in jsonrpc format """ result = yield self.call_py(jsondata) if result is None: defer.returnValue(None) else: defer.returnValue(json.dumps(result)... |
def call_py(self, jsondata): """ Calls jsonrpc service's method and returns its return value in python object format or None if there is none. This method is same as call() except the return value is a python object instead of JSON string. This method is mainly only useful for debugging purposes. """ try: try: rdata = ... |
default values for error handling request_ = self._get_default_vals() try: self._fill_request(request_, rdata_) except InvalidRequestError, e: err = self._get_err(e, request_['id']) if err: responds.append(err) continue except JSONRPCError, e: err = self._get_err(e, request_['id']) if err: responds.append(err) continue... |
def _get_err(self, e, id=None, jsonrpc=DEFAULT_JSONRPC): """ Returns jsonrpc error message. """ # Do not respond to notifications when the request is valid. if not id \ and not isinstance(e, ParseError) \ and not isinstance(e, InvalidRequestError): return None respond = {'id': id} if isinstance(jsonrpc, int): # v1.0 re... |
def _man_args(self, f): """ Returns number of mandatory arguments required by given function. """ argcount = f.func_code.co_argcount # account for "self" getting passed to class instance methods if isinstance(f, types.MethodType): argcount -= 1 if f.func_defaults is None: return argcount return argcount - len(f.func_de... |
def _max_args(self, f): """ Returns maximum number of arguments accepted by given function. """ if f.func_defaults is None: return f.func_code.co_argcount return f.func_code.co_argcount + len(f.func_defaults) |
def _get_id(self, rdata): """ Returns jsonrpc request's id value or None if there is none. InvalidRequestError will be raised if the id value has invalid type. """ if 'id' in rdata: if isinstance(rdata['id'], basestring) or \ isinstance(rdata['id'], int) or \ isinstance(rdata['id'], long) or \ isinstance(rdata['id'], f... |
def _get_method(self, rdata): """ Returns jsonrpc request's method value. InvalidRequestError will be raised if it's missing or is wrong type. MethodNotFoundError will be raised if a method with given method name does not exist. """ if 'method' in rdata: if not isinstance(rdata['method'], basestring): raise InvalidRequ... |
def _get_params(self, rdata): """ Returns a list of jsonrpc request's method parameters. """ if 'params' in rdata: if isinstance(rdata['params'], dict) \ or isinstance(rdata['params'], list) \ or rdata['params'] is None: return rdata['params'] else: # wrong type raise InvalidRequestError else: return None |
def _fill_request(self, request, rdata): """Fills request with data from the jsonrpc call.""" if not isinstance(rdata, dict): raise InvalidRequestError request['jsonrpc'] = self._get_jsonrpc(rdata) request['id'] = self._get_id(rdata) request['method'] = self._get_method(rdata) request['params'] = self._get_params(rdata... |
def _call_method(self, request): """Calls given method with given params and returns it value.""" method = self.method_data[request['method']]['method'] params = request['params'] result = None try: if isinstance(params, list): # Does it have enough arguments? if len(params) < self._man_args(method): raise InvalidParam... |
def _handle_request(self, request): """Handles given request and returns its response.""" if 'types' in self.method_data[request['method']]: self._validate_params_types(request['method'], request['params']) if self.serve_exception: raise self.serve_exception() d = self._call_method(request) self.pending.add(d) if self.... |
defer.returnValue(respond) |
def _validate_params_types(self, method, params): """ Validates request's parameter types. """ if isinstance(params, list): if not isinstance(self.method_data[method]['types'], list): raise InvalidParamsError( 'expected keyword params, not positional') for param, type, posnum in zip(params, self.method_data[method]['ty... |
def startService(self): """ Start the service and connect the JSONRPCClientFactory. """ self.clientFactory.connect().addErrback( log.err, 'error starting the JSON-RPC client service %r' % (self,)) service.Service.startService(self) |
def callRemote(self, *a, **kw): """ Make a callRemote request of the JSONRPCClientFactory. """ if not self.running: return defer.fail(ServiceStopped()) return self.clientFactory.callRemote(*a, **kw) |
def dumps(self): """Return the Exception data in a format for JSON-RPC.""" error = {'code': self.code, 'message': str(self.message)} if self.data is not None: error['data'] = self.data return error |
def add(self, parent, obj_type, **attributes): """ IXN API add command @param parent: object parent - object will be created under this parent. @param object_type: object type. @param attributes: additional attributes. @return: STC object reference. """ response = self.post(self.server_url + parent.ref + '/' + obj_type... |
def stringize( self, rnf_profile=RnfProfile(), ): """Create RNF representation of this read. Args: read_tuple_id_width (int): Maximal expected string length of read tuple ID. genome_id_width (int): Maximal expected string length of genome ID. chr_id_width (int): Maximal expected string length of chromosome ID. coor_wid... |
def destringize(self, string): """Get RNF values for this read from its textual representation and save them into this object. Args: string(str): Textual representation of a read. Raises: ValueError """ # todo: assert -- starting with (, ending with ) # (prefix,read_tuple_id,segments_t,suffix)=(text).split("__") # segm... |
def construct(name, exec_, terminal=False, additional_opts={}): '''Construct a .desktop file and return it as a string. Create a standards-compliant .desktop file, returning it as a string. Args: name (str) : The program's name. exec\_ (str) : The command. terminal (bool): Determine if program should be run in a termin... |
def execute(desktop_file, files=None, return_cmd=False, background=False): '''Execute a .desktop file. Executes a given .desktop file path properly. Args: desktop_file (str) : The path to the .desktop file. files (list): Any files to be launched by the .desktop. Defaults to empty list. return_cmd (bool): Return the com... |
dependency desktop_file_exec = eval( ('__import__("libdesktop").applications.terminal(exec_="%s",' ' keep_open_after_cmd_exec=True, return_cmd=True)') % desktop_file_exec) if return_cmd: return desktop_file_exec desktop_file_proc = sp.Popen([desktop_file_exec], shell=True) if not background: desktop_file_proc.wait() |
def locate(desktop_filename_or_name): '''Locate a .desktop from the standard locations. Find the path to the .desktop file of a given .desktop filename or application name. Standard locations: - ``~/.local/share/applications/`` - ``/usr/share/applications`` Args: desktop_filename_or_name (str): Either the filename of a... |
def parse(desktop_file_or_string): '''Parse a .desktop file. Parse a .desktop file or a string with its contents into an easy-to-use dict, with standard values present even if not defined in file. Args: desktop_file_or_string (str): Either the path to a .desktop file or a string with a .desktop file as its contents. Re... |
def as_completed(fs, timeout=None): """An iterator over the given futures that yields each as it completes. Args: fs: The sequence of Futures (possibly created by different Executors) to iterate over. timeout: The maximum number of seconds to wait. If None, then there is no limit on the wait time. Returns: An iterator ... |
yield future pending.remove(future) except Timeout as e: if timer is not e: raise raise TimeoutError('%d (of %d) futures unfinished' % (len(pending), len(fs))) finally: timer.cancel() for f in fs: f._waiters.remove(waiter) |
def map(self, fn, *iterables, **kwargs): """Returns a iterator equivalent to map(fn, iter). Args: fn: A callable that will take take as many arguments as there are passed iterables. timeout: The maximum number of seconds to wait. If None, then there is no limit on the wait time. Returns: An iterator equivalent to: map(... |
required. def result_iterator(): try: for future in fs: if timeout is None: yield future.get() else: yield future.get(end_time - loop.time()) finally: for future in fs: future.cancel() return result_iterator() |
def set_server(self, wsgi_app, fnc_serve=None): """ figures out how the wsgi application is to be served according to config """ self.set_wsgi_app(wsgi_app) ssl_config = self.get_config("ssl") ssl_context = {} if self.get_config("server") == "gevent": if ssl_config.get("enabled"): ssl_context["certfile"] = ssl_config.g... |
def pre_save(self, instance, add): """ Auto-generate the slug if needed. """ # get currently entered slug value = self.value_from_object(instance) slug = None # auto populate (if the form didn't do that already). # If you want unique_with logic, use django-autoslug instead. # This model field only allows parameters whi... |
def FirstSlotSlicer(primary_query, secondary_query, limit=30): # noqa """ Inject the first object from a queryset into the first position of a reading list. :param primary_queryset: djes.LazySearch object. Default queryset for reading list. :param secondary_queryset: djes.LazySearch object. first result leads the readi... |
def register_queryset(self, queryset, validator=None, default=False): """ Add a given queryset to the iterator with custom logic for iteration. :param queryset: List of objects included in the reading list. :param validator: Custom logic to determine a queryset's position in a reading_list. Validators must accept an in... |
def get_month_start_date(self): """Returns the first day of the current month""" now = timezone.now() return timezone.datetime(day=1, month=now.month, year=now.year, tzinfo=now.tzinfo) |
def _yield_all(self, l): ''' Given a iterable like list or tuple the function yields each of its items with _yield ''' if l is not None: if type(l) in [list, tuple]: for f in l: for x in self._yield(f): yield x else: for x in self._yield(l): yield x |
def post(self, resource_path: str, data: dict, administration_id: int = None): """ Performs a POST request to the endpoint identified by the resource path. POST requests are usually used to add new data. Example: >>> from moneybird import MoneyBird, TokenAuthentication >>> moneybird = MoneyBird(TokenAuthentication('acc... |
def delete(self, resource_path: str, administration_id: int = None): """ Performs a DELETE request to the endpoint identified by the resource path. DELETE requests are usually used to (permanently) delete existing data. USE THIS METHOD WITH CAUTION. From a client perspective, DELETE requests behave similarly to GET req... |
def renew_session(self): """ Clears all session data and starts a new session using the same settings as before. This method can be used to clear session data, e.g., cookies. Future requests will use a new session initiated with the same settings and authentication method. """ logger.debug("API session renewed") self.s... |
def _get_url(cls, administration_id: int, resource_path: str): """ Builds the URL to the API endpoint specified by the given parameters. :param administration_id: The ID of the administration (may be None). :param resource_path: The path to the resource. :return: The absolute URL to the endpoint. """ url = urljoin(cls.... |
def _process_response(response: requests.Response, expected: list = []) -> dict: """ Processes an API response. Raises an exception when appropriate. The exception that will be raised is MoneyBird.APIError. This exception is subclassed so implementing programs can easily react appropriately to different exceptions. The... |
None, 204: None, 400: MoneyBird.Unauthorized, 401: MoneyBird.Unauthorized, 403: MoneyBird.Throttled, 404: MoneyBird.NotFound, 406: MoneyBird.NotFound, 422: MoneyBird.InvalidData, 429: MoneyBird.Throttled, 500: MoneyBird.ServerError, } logger.debug("API request: %s %s\n" % (response.request.method, response.request.url)... |
def search_videohub(cls, query, filters=None, status=None, sort=None, size=None, page=None): """searches the videohub given a query and applies given filters and other bits :see: https://github.com/theonion/videohub/blob/master/docs/search/post.md :see: https://github.com/theonion/videohub/blob/master/docs/search/get.m... |
:param page: the page number of the results :type page: int :default page: None :example page: {"page": 2} # note, you should use `size` in conjunction with `page` :return: a dictionary of results and meta information :rtype: dict """ # construct url url = getattr(settings, "VIDEOHUB_API_SEARCH_URL", cls.DEFAULT_VIDEOH... |
200: res.raise_for_status() # parse and return response return json.loads(res.content) |
def get_hub_url(self): """gets a canonical path to the detail page of the video on the hub :return: the path to the consumer ui detail page of the video :rtype: str """ url = getattr(settings, "VIDEOHUB_VIDEO_URL", self.DEFAULT_VIDEOHUB_VIDEO_URL) # slugify needs ascii ascii_title = "" if isinstance(self.title, str): a... |
def get_embed_url(self, targeting=None, recirc=None): """gets a canonical path to an embedded iframe of the video from the hub :return: the path to create an embedded iframe of the video :rtype: str """ url = getattr(settings, "VIDEOHUB_EMBED_URL", self.DEFAULT_VIDEOHUB_EMBED_URL) url = url.format(self.id) if targeting... |
def get_api_url(self): """gets a canonical path to the api detail url of the video on the hub :return: the path to the api detail of the video :rtype: str """ url = getattr(settings, 'VIDEOHUB_API_URL', None) # Support alternate setting (used by most client projects) if not url: url = getattr(settings, 'VIDEOHUB_API_BA... |
def remove(self, node): """Remove a node from the list. The *node* argument must be a node that was previously inserted in the list """ if node is None or node._prev == -1: return if node._next is None: self._last = node._prev # last node else: node._next._prev = node._prev if node._prev is None: self._first = node._ne... |
def get_all_outcome_links_for_context_accounts(self, account_id, outcome_group_style=None, outcome_style=None): """ Get all outcome links for context. """ path = {} data = {} params = {} # REQUIRED - PATH - account_id """ID""" path["account_id"] = account_id # OPTIONAL - outcome_style """The detail level of the outcome... |
def get_all_outcome_links_for_context_courses(self, course_id, outcome_group_style=None, outcome_style=None): """ Get all outcome links for context. """ path = {} data = {} params = {} # REQUIRED - PATH - course_id """ID""" path["course_id"] = course_id # OPTIONAL - outcome_style """The detail level of the outcomes. De... |
def create_link_outcome_global_outcome_id(self, id, outcome_id, calculation_int=None, calculation_method=None, description=None, display_name=None, mastery_points=None, ratings_description=None, ratings_points=None, title=None, vendor_guid=None): """ Create/link an outcome. Link an outcome into the outcome group. The o... |
description, ratings, and mastery points; the title is required but all other fields are optional. The new outcome is then linked into the outcome group. If ratings are provided when creating a new outcome, an embedded rubric criterion is included in the new outcome. This criterion's mastery_points default to the maxim... |
outcome to link.""" path["outcome_id"] = outcome_id # OPTIONAL - title """The title of the new outcome. Required if outcome_id is absent.""" if title is not None: data["title"] = title # OPTIONAL - display_name """A friendly name shown in reports for outcomes with cryptic titles, such as common core standards names."""... |
rubric criterion.""" if ratings_description is not None: data["ratings[description]"] = ratings_description # OPTIONAL - ratings[points] """The points corresponding to a rating level for the embedded rubric criterion.""" if ratings_points is not None: data["ratings[points]"] = ratings_points # OPTIONAL - calculation_me... |
def list_subgroups_global(self, id): """ List subgroups. List the immediate OutcomeGroup children of the outcome group. Paginated. """ path = {} data = {} params = {} # REQUIRED - PATH - id """ID""" path["id"] = id self.logger.debug("GET /api/v1/global/outcome_groups/{id}/subgroups with query params: {params} and form ... |
def list_subgroups_accounts(self, id, account_id): """ List subgroups. List the immediate OutcomeGroup children of the outcome group. Paginated. """ path = {} data = {} params = {} # REQUIRED - PATH - account_id """ID""" path["account_id"] = account_id # REQUIRED - PATH - id """ID""" path["id"] = id self.logger.debug("... |
def create_subgroup_global(self, id, title, description=None, vendor_guid=None): """ Create a subgroup. Creates a new empty subgroup under the outcome group with the given title and description. """ path = {} data = {} params = {} # REQUIRED - PATH - id """ID""" path["id"] = id # REQUIRED - title """The title of the ne... |
def update_single_grading_period(self, id, course_id, grading_periods_end_date, grading_periods_start_date, grading_periods_weight=None): """ Update a single grading period. Update an existing grading period. """ path = {} data = {} params = {} # REQUIRED - PATH - course_id """ID""" path["course_id"] = course_id # REQU... |
params=params, no_data=True) |
def delete_grading_period_accounts(self, id, account_id): """ Delete a grading period. <b>204 No Content</b> response code is returned if the deletion was successful. """ path = {} data = {} params = {} # REQUIRED - PATH - account_id """ID""" path["account_id"] = account_id # REQUIRED - PATH - id """ID""" path["id"] = ... |
def list_appointment_groups(self, context_codes=None, include=None, include_past_appointments=None, scope=None): """ List appointment groups. Retrieve the list of appointment groups that can be reserved or managed by the current user. """ path = {} data = {} params = {} # OPTIONAL - scope """Defaults to "reservable""""... |
id, start time and end time of reservations the current user has made) "all_context_codes":: all context codes associated with this appointment group""" if include is not None: self._validate_enum(include, ["appointments", "child_events", "participant_count", "reserved_times", "all_context_codes"]) params["include"] = ... |
def create_appointment_group(self, appointment_group_title, appointment_group_context_codes, appointment_group_description=None, appointment_group_location_address=None, appointment_group_location_name=None, appointment_group_max_appointments_per_participant=None, appointment_group_min_appointments_per_participant=None... |
If a group category is specified, students will sign up in groups and the participant_type will be "Group" instead of "User".""" if appointment_group_sub_context_codes is not None: data["appointment_group[sub_context_codes]"] = appointment_group_sub_context_codes # REQUIRED - appointment_group[title] """Short title for... |
appointment_group_publish # OPTIONAL - appointment_group[participants_per_appointment] """Maximum number of participants that may register for each time slot. Defaults to null (no limit).""" if appointment_group_participants_per_appointment is not None: data["appointment_group[participants_per_appointment]"] = appointm... |
signed up for a particular time slot "protected":: participants can see who has signed up. Defaults to "private".""" if appointment_group_participant_visibility is not None: self._validate_enum(appointment_group_participant_visibility, ["private", "protected"]) data["appointment_group[participant_visibility]"] = appoin... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.