code stringlengths 4 4.48k | docstring stringlengths 1 6.45k | _id stringlengths 24 24 |
|---|---|---|
def conv_backward_naive(dout, cache): <NEW_LINE> <INDENT> dx, dw, db = None, None, None <NEW_LINE> x, w, b, conv_param = cache <NEW_LINE> pad = conv_param['pad'] <NEW_LINE> stride = conv_param['stride'] <NEW_LINE> F, C, HH, WW = w.shape <NEW_LINE> N, C, H, W = x.shape <NEW_LINE> H_ = 1 + (H + 2 * pad - HH) // stride <N... | A naive implementation of the backward pass for a convolutional layer.
Inputs:
- dout: Upstream derivatives.(N,F,H',W')
- cache: A tuple of (x, w, b, conv_param) as in conv_forward_naive
Returns a tuple of:
- dx: Gradient with respect to x (N,C,H,W)
- dw: Gradient with respect to w (F,C,HH,WW)
- db: Gradient with res... | 625941e6435de62698dfe092 |
def expected_settings_change_initiated_event(self, setting, old, new, username=None, user_id=None): <NEW_LINE> <INDENT> return { 'username': username or self.username, 'referer': self.get_settings_page_url(), 'event': { 'user_id': user_id or self.user_id, 'setting': setting, 'old': old, 'new': new, } } | A dictionary representing the expected fields in a "settings change initiated" event. | 625941e65fc7496912cc3dc2 |
def search(self, request): <NEW_LINE> <INDENT> form = self.form_class(request.GET if request else None) <NEW_LINE> if not form.is_valid(): <NEW_LINE> <INDENT> raise form_errors(form) <NEW_LINE> <DEDENT> form_data = form.cleaned_data <NEW_LINE> no_filter = ( request.GET.get('filtering', '1') == '0' and acl.action_allowe... | Takes a request (expecting request.GET.q), and returns the serializer
and search query. | 625941e6d99f1b3c44c679cc |
def detectElementSidesOnPart(model, part, nset): <NEW_LINE> <INDENT> allElements = part.elements <NEW_LINE> allNodes = part.nodes <NEW_LINE> Nset = nset.nodes <NEW_LINE> NsetLabels = set(n.label for n in Nset) <NEW_LINE> face1 = [] <NEW_LINE> face2 = [] <NEW_LINE> face3 = [] <NEW_LINE> face4 = [] <NEW_LINE> face5 = [] ... | Returns a tuple of element numbers arry (a1, a2, a3, a4, a5, a6) to define a surface for a part.
a1 is the array of all elements with all nodes on side 1 in nset, and so on. | 625941e6baa26c4b54cb1560 |
def getMicroscope(): <NEW_LINE> <INDENT> global _microscope <NEW_LINE> if _microscope is None: <NEW_LINE> <INDENT> backend = getContainer(BACKEND_NAME, validate=False) <NEW_LINE> _microscope = backend.getRoot() <NEW_LINE> <DEDENT> return _microscope | return the microscope component managed by the backend
Note: if a connection has already been set up, it will reuse it, unless
you reset _microscope to None | 625941e65fc7496912cc3dc3 |
def getRow(self, rowIndex): <NEW_LINE> <INDENT> k = 1 <NEW_LINE> rows = [[0,1,0], [0,1,1,0]] <NEW_LINE> if rowIndex <= k: <NEW_LINE> <INDENT> return rows[rowIndex][1:-1] <NEW_LINE> <DEDENT> while k < rowIndex: <NEW_LINE> <INDENT> tmp = [0] <NEW_LINE> row = rows[-1] <NEW_LINE> for i in range(len(row)-1): <NEW_LINE> <IND... | :type rowIndex: int
:rtype: List[int] | 625941e6009cb60464c637f3 |
def update_robot_key(login_method, robot, key=None): <NEW_LINE> <INDENT> from invenio.websearch_webcoll import mymkdir <NEW_LINE> robot_keys = load_robot_keys() <NEW_LINE> if key is None and login_method in robot_keys and robot in robot_keys[login_method]: <NEW_LINE> <INDENT> del robot_keys[login_method][robot] <NEW_LI... | Utility to update the robot key store.
@param login_method: the login_method name as per L{CFG_EXTERNAL_AUTHENTICATION}.
It should correspond to a robot-enable login method.
@type: string
@param robot: the robot identifier
@type robot: string
@param key: the secret
@type key: string
@note: if the secret is empty th... | 625941e6bde94217f3683232 |
def handle_attrs(self, tag, attrs, text): <NEW_LINE> <INDENT> if not 'attrs' in [name for (name, value) in attrs]: <NEW_LINE> <INDENT> self.add('print("""{}""", end="")'.format(text), text) <NEW_LINE> return <NEW_LINE> <DEDENT> txt = '<{} '.format(tag) <NEW_LINE> simple = ['{}=\\"{}\\"'.format(name, value.replace("'", ... | Used for tags other than <py> ; if they have an attribute named
"attrs", its value must be of the form key1=value1, key2=value2... ;
this value is used as argument of dict(), and the resulting dictionary
is used to generate tag attributes "key1=value1 key2=value2 ...".
If the value associated with a key is True, only t... | 625941e6d58c6744b42580a3 |
def run(command, **kw): <NEW_LINE> <INDENT> stop_on_error = kw.pop('stop_on_error', True) <NEW_LINE> command_msg = "Running command: %s" % ' '.join(command) <NEW_LINE> stdin = kw.pop('stdin', None) <NEW_LINE> logger.info(command_msg) <NEW_LINE> terminal.write(command_msg) <NEW_LINE> terminal_logging = kw.pop('terminal_... | A real-time-logging implementation of a remote subprocess.Popen call where
a command is just executed on the remote end and no other handling is done.
:param command: The command to pass in to the remote subprocess.Popen as a list
:param stop_on_error: If a nonzero exit status is return, it raises a ``RuntimeError`` | 625941e6f8510a7c17cf9b44 |
@pytest.fixture() <NEW_LINE> def investor_login(): <NEW_LINE> <INDENT> user = { "mobile_phone": MidHandler.security_data["investor_phone"], "pwd": MidHandler.security_data["investor_pwd"] } <NEW_LINE> return login(user["mobile_phone"], user["pwd"]) | 登录接口: 普通用户登录,投资人
:return: response 响应数据 | 625941e64428ac0f6e5bac3b |
def gen_rmsd_scaff(l0, l1): <NEW_LINE> <INDENT> from common import pdb <NEW_LINE> pdb.loop_to_pdb("./l0.pdb", l0) <NEW_LINE> pdb.loop_to_pdb("./l1.pdb", l1) <NEW_LINE> try: <NEW_LINE> <INDENT> pro = subprocess.run(["pdbcalcrms", "-c", "./l0.pdb", "./l1.pdb" ], stdout=subprocess.PIPE) <NEW_LINE> tr = pro.stdout.decode()... | Given two loops, create two pdb files and compute the RMSD but don't do any fitting. | 625941e6a8370b7717052ce2 |
def attend(self, sequence1, sequence2, sequence1_lengths=None, sequence2_lengths=None, use_masking=False, reuse=False): <NEW_LINE> <INDENT> with tf.variable_scope('attend') as _: <NEW_LINE> <INDENT> transformed_sequence1 = self._transform_attend(sequence1, reuse) <NEW_LINE> transformed_sequence2 = self._transform_atten... | Attend phase.
Args:
sequence1: tensor with shape (batch_size, time_steps, num_units)
sequence2: tensor with shape (batch_size, time_steps, num_units)
sequence1_lengths: time_steps in sequence1
sequence2_lengths: time_steps in sequence2
use_masking: use masking
reuse: reuse variables
Returns:
... | 625941e6099cdd3c635f109e |
@BLUEPRINT_TOOLS.route('/tomato') <NEW_LINE> def tomato_timer(): <NEW_LINE> <INDENT> return render_template("pomodoro.html") | A pomodoro timer to help me focus | 625941e6d268445f265b52b4 |
def create_image_from_instance(self, instance_id, image_name, metadata={"reason": "instance_migrate"}): <NEW_LINE> <INDENT> LOG.debug( "Trying to create an image from instance %s ..." % instance_id) <NEW_LINE> instance = self.find_instance(instance_id) <NEW_LINE> if not instance: <NEW_LINE> <INDENT> LOG.debug("Instance... | This method creates a new image from a given instance.
It waits for this image to be in 'active' state before returning.
It returns the unique UUID of the created image if successful,
None otherwise.
:param instance_id: the uniqueid of
the instance to backup as an image.
:param image_name: the name of the image t... | 625941e6377c676e912725ec |
def isBalanced(self, root): <NEW_LINE> <INDENT> if not root: <NEW_LINE> <INDENT> return True <NEW_LINE> <DEDENT> if abs(self.height(root.left, 0) - self.height(root.right, 0)) > 1: <NEW_LINE> <INDENT> return False <NEW_LINE> <DEDENT> return self.isBalanced(root.left) and self.isBalanced(root.right) | :type root: TreeNode
:rtype: bool | 625941e63539df3088e2e790 |
def __ne__(self, other): <NEW_LINE> <INDENT> if not isinstance(other, FDSIDList): <NEW_LINE> <INDENT> return True <NEW_LINE> <DEDENT> return self.to_dict() != other.to_dict() | Returns true if both objects are not equal | 625941e6adb09d7d5db6cbd2 |
def grouper(iterable, n, fillvalue=None): <NEW_LINE> <INDENT> args = [iter(iterable)] * n <NEW_LINE> return zipl(*args, fillvalue=fillvalue) | Group iterable into n sized chunks.
See: http://stackoverflow.com/a/312644/758157 | 625941e68da39b475bd653be |
def min_max(box, width): <NEW_LINE> <INDENT> min_width = box.style['min_width'] <NEW_LINE> max_width = box.style['max_width'] <NEW_LINE> if min_width == 'auto' or min_width.unit == '%': <NEW_LINE> <INDENT> min_width = 0 <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> min_width = min_width.value <NEW_LINE> <DEDENT> if max... | Get box width from given width and box min- and max-widths. | 625941e6bf627c535bc13615 |
def get_llone_parsing_table(self): <NEW_LINE> <INDENT> first_set = self.get_first_set() <NEW_LINE> follow_set = self.get_follow_set() <NEW_LINE> nullables = self._cfg.get_nullable_symbols() <NEW_LINE> nullable_productions = [] <NEW_LINE> non_nullable_productions = [] <NEW_LINE> for production in self._cfg.productions: ... | Get the LL(1) parsing table
From:
https://www.slideshare.net/MahbuburRahman273/ll1-parser-in-compilers | 625941e6f548e778e58cd9c5 |
def test_S001_hostinfo(self): <NEW_LINE> <INDENT> self.logging.info('--> TestHostInfo.test_hostinfo()') <NEW_LINE> try: <NEW_LINE> <INDENT> self.logging.debug('Retrieve host static information') <NEW_LINE> resp = self.session.request_get_json(TestHostInfo.uri_host, [200]) <NEW_LINE> if resp is not None: <NEW_LINE> <IND... | Retrieve host static information | 625941e6462c4b4f79d1db15 |
def list_by_resource_group( self, resource_group_name: str, **kwargs: Any ) -> AsyncIterable["_models.ListP2SVpnGatewaysResult"]: <NEW_LINE> <INDENT> cls = kwargs.pop('cls', None) <NEW_LINE> error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } <NEW_LINE> error_map.update(... | Lists all the P2SVpnGateways in a resource group.
:param resource_group_name: The resource group name of the P2SVpnGateway.
:type resource_group_name: str
:keyword callable cls: A custom type or function that will be passed the direct response
:return: An iterator like instance of either ListP2SVpnGatewaysResult or th... | 625941e67b180e01f3dc4c3a |
def getPostureFamilyList(self): <NEW_LINE> <INDENT> if not self.proxy: <NEW_LINE> <INDENT> self.proxy = self.session.service("ALRobotPosture") <NEW_LINE> <DEDENT> return self.proxy.getPostureFamilyList() | Get the list of posture family names available.
:returns std::vector<std::string>: | 625941e610dbd63aa1bd2fe7 |
def validate_preprocess(self): <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> check_corpus_path(self.corpus_path) <NEW_LINE> check_vocabulary_size(self.vocabulary_size) <NEW_LINE> check_batch_size(self.batch_size) <NEW_LINE> check_skip_window(self.skip_window) <NEW_LINE> check_ngram_size(self.ngram_size) <NEW_LINE> check... | Check if the current settings are valid for pre processing.
:raises: ValueError if the validation fails | 625941e66fb2d068a760f4e9 |
def GetBWNCC(patch1, patch2, sigma_c=2.0, sigma_s=2.0): <NEW_LINE> <INDENT> patch1_weights = np.zeros(patch1.shape) <NEW_LINE> patch2_weights = np.zeros(patch2.shape) <NEW_LINE> y_range1, x_range1 = np.arange(patch1.shape[0]), np.arange(patch1.shape[1]) <NEW_LINE> y_gird1, x_grid1 = np.meshgrid(y_range1, x_range1) <NEW... | 计算双边权重NCC | 625941e6236d856c2ad44c25 |
def read_data(file_data, offset, number_of_bytes, string_data=None): <NEW_LINE> <INDENT> if number_of_bytes > 0: <NEW_LINE> <INDENT> data = file_data[offset:offset+number_of_bytes] <NEW_LINE> return data <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> return bytearray('') | Just reads the straight data with no endianness. | 625941e666673b3332b924d6 |
def getAccounts(self, username=None, since=None): <NEW_LINE> <INDENT> accounts_set = set() <NEW_LINE> for row in self.data: <NEW_LINE> <INDENT> if (since is None) or (row['date'] >= since): <NEW_LINE> <INDENT> if username: <NEW_LINE> <INDENT> if row['username'] == username: <NEW_LINE> <INDENT> accounts_set.add(row['acc... | Get a list of all slurm accounts in the database
Args:
username (string, optional): specify a user to get the account
list of
since (datetime, optional): filter out users with no activity
within the set date range
Returns:
list: all slurm accounts in the database | 625941e676e4537e8c351abb |
def main_is_frozen(): <NEW_LINE> <INDENT> return (hasattr(sys, "frozen") or hasattr(sys, "importers") or imp.is_frozen("__main__")) | Detect if B3 is running from b3_run.exe. | 625941e67c178a314d6ef8ac |
def __init__(self): <NEW_LINE> <INDENT> super(LogParser, self).__init__([CmdQueryHandler(), UpdateQueryHandler(), StandardQueryHandler(), TimeLineHandler()]) | Declares the QueryLineHandlers to use | 625941e66fb2d068a760f4ea |
def _quantity_check(self, item, qty): <NEW_LINE> <INDENT> num = 0 <NEW_LINE> for value in menus.values(): <NEW_LINE> <INDENT> for tuple_item in value: <NEW_LINE> <INDENT> if item == tuple_item[0]: <NEW_LINE> <INDENT> if qty > value[tuple_item]: <NEW_LINE> <INDENT> print("We don't have that many.") <NEW_LINE> return Fal... | This checks validity of order quantity | 625941e671ff763f4b549ad8 |
def getContext(self): <NEW_LINE> <INDENT> ctx = ClientContextFactory.getContext(self) <NEW_LINE> ctx.set_options(OP_NO_SSLv3) <NEW_LINE> return ctx | Get the parent context but disable SSLv3. | 625941e697e22403b379d3e1 |
def write(self, text): <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> file = open(self.file_path, self.WRITE_MODE_TRUNCATE) <NEW_LINE> file.write(text) <NEW_LINE> file.close() <NEW_LINE> <DEDENT> except IOError: <NEW_LINE> <INDENT> print('The file' + self.file_path + 'does not exist') | Method that write a text in the file located in the path self.file_path
string text - this is the text that will be saved in the file. | 625941e615fb5d323cde0f5b |
def twitter_hashtag_search(hashtag): <NEW_LINE> <INDENT> twitter = requests.get("https://twitter.com/hashtag/{0}?f=tweets&vertical=default&src=tyah&lang=en".format(hashtag), headers=headers) <NEW_LINE> soup = BeautifulSoup(twitter.content, 'html.parser') <NEW_LINE> return [ i.text for i in soup.findAll("div", {"class" ... | Search tweets by hashtag
Args:
hashtag (str)
Return:
list of strings | 625941e6627d3e7fe0d69297 |
def button_release_callback(self, event): <NEW_LINE> <INDENT> if event.inaxes is None: <NEW_LINE> <INDENT> return <NEW_LINE> <DEDENT> if event.button != 1: <NEW_LINE> <INDENT> return <NEW_LINE> <DEDENT> self.ind = None | Mouse button release callback.
Parameters
----------
event : TYPE
DESCRIPTION.
Returns
-------
None. | 625941e6097d151d1a22329d |
def _test_get_image_log_events(image): <NEW_LINE> <INDENT> logging.info("Testing that pcluster get-image-log-events is working as expected") <NEW_LINE> log_stream_name = f"{get_installed_parallelcluster_base_version()}/1" <NEW_LINE> initial_events = image.get_log_events(log_stream_name, limit=1, start_from_head=True) <... | Test pcluster get-image-log-events functionality. | 625941e650812a4eaa59c763 |
def setup_addon_modules(path, package_name): <NEW_LINE> <INDENT> def get_submodule_names(path = path[0], root = ""): <NEW_LINE> <INDENT> module_names = [] <NEW_LINE> for importer, module_name, is_package in pkgutil.iter_modules([path]): <NEW_LINE> <INDENT> if is_package: <NEW_LINE> <INDENT> sub_path = os.path.join(path... | Imports and reloads all modules in this addon.
path -- __path__ from __init__.py
package_name -- __name__ from __init__.py | 625941e656ac1b37e626460d |
def delete(self, deployment_id, include_logs=False, message=None, from_datetime=None, to_datetime=None, sort=None, **kwargs): <NEW_LINE> <INDENT> uri = '/events' <NEW_LINE> params = self._create_query(include_logs=include_logs, message=message, from_datetime=from_datetime, to_datetime=to_datetime, sort=sort, deployment... | Delete events connected to a Deployment ID
:param deployment_id: The ID of the deployment
:param include_logs: Whether to also get logs.
:param message: an expression used for wildcard search events
by their message text
:param from_datetime: search for events later or equal to datetime
:param to_datet... | 625941e624f1403a92600fa8 |
def _set_max_count(self, value): <NEW_LINE> <INDENT> self.__maxcount = value | Set maxcount for the warning | 625941e657b8e32f524838e3 |
def get_temp_dir_path(self): <NEW_LINE> <INDENT> return self._temp_dir | Get the path of the temporary directory. | 625941e6656771135c3ebcb9 |
def __init__(self, temboo_session): <NEW_LINE> <INDENT> Choreography.__init__(self, temboo_session, '/Library/GitHub/ReposAPI/Comments/ListCommitComments') | Create a new instance of the ListCommitComments Choreo. A TembooSession object, containing a valid
set of Temboo credentials, must be supplied. | 625941e6aad79263cf390e8d |
def _moments(self, inputs, reduction_axes, keep_dims): <NEW_LINE> <INDENT> shard_mean, shard_variance = super(TpuBatchNormalization, self)._moments( inputs, reduction_axes, keep_dims=keep_dims) <NEW_LINE> num_shards = tpu_function.get_tpu_context().number_of_shards or 1 <NEW_LINE> if num_shards <= 8: <NEW_LINE> <INDENT... | Compute the mean and variance: it overrides the original _moments. | 625941e6d4950a0f3b08c78f |
def quants_reserve(self, cr, uid, quants, move, link=False, context=None): <NEW_LINE> <INDENT> toreserve = [] <NEW_LINE> reserved_availability = move.reserved_availability <NEW_LINE> for quant, qty in quants: <NEW_LINE> <INDENT> if qty <= 0.0 or (quant and quant.qty <= 0.0): <NEW_LINE> <INDENT> raise osv.except_osv(_('... | This function reserves quants for the given move (and optionally given link). If the total of quantity reserved is enough, the move's state
is also set to 'assigned'
:param quants: list of tuple(quant browse record or None, qty to reserve). If None is given as first tuple element, the item will be ignored. Negative qu... | 625941e610dbd63aa1bd2fe8 |
def conv_csv_shadowserver(self, value): <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> int(value) <NEW_LINE> return value <NEW_LINE> <DEDENT> except ValueError: <NEW_LINE> <INDENT> if hasattr(value, '__len__') and not len(value): <NEW_LINE> <INDENT> return '' <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> return '"' + val... | Converts a dict to shadowservers csv quoting format.
Numeric: no quoting
Empty string: no quoting
Else: " quoting | 625941e6d58c6744b42580a4 |
def test_create_study_all_data(self): <NEW_LINE> <INDENT> self.info.update({ 'vamps_id': 'MBE_1111111', 'funding': 'FundAgency', 'spatial_series': True, 'metadata_complete': False, 'reprocess': True, 'first_contact': "10/24/2014 12:47PM", 'study_id': 3827 }) <NEW_LINE> obs = Study.create(User('test@foo.bar'), "Fried ch... | Insert a study into the database with every info field | 625941e62c8b7c6e89b35c03 |
def singleNumber(self, nums): <NEW_LINE> <INDENT> tmp = reduce(lambda x, y: x ^ y, nums, 0) <NEW_LINE> d = tmp & -tmp <NEW_LINE> ret = [0, 0] <NEW_LINE> for num in nums: <NEW_LINE> <INDENT> ret[(num & d) == 0] ^= num <NEW_LINE> <DEDENT> return ret | :type nums: List[int]
:rtype: List[int] | 625941e601c39578d7e75281 |
@register.simple_tag <NEW_LINE> def optional_docs_login(request): <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> login_url = reverse('jet_django.deps.rest_framework:login') <NEW_LINE> <DEDENT> except NoReverseMatch: <NEW_LINE> <INDENT> return 'log in' <NEW_LINE> <DEDENT> snippet = "<a href='{href}?next={next}'>log in</a>... | Include a login snippet if REST framework's login view is in the URLconf. | 625941e6f7d966606f6aa44f |
def newNode(self,name): <NEW_LINE> <INDENT> id = len(self.nodes) <NEW_LINE> tmp = Node(self,id,name) <NEW_LINE> self.nodes += [tmp] <NEW_LINE> return tmp | create a new node | 625941e62ae34c7f2600d576 |
def step1ab(self): <NEW_LINE> <INDENT> if self.b[self.k] == 's': <NEW_LINE> <INDENT> if self.ends("sses"): <NEW_LINE> <INDENT> self.k = self.k - 2 <NEW_LINE> <DEDENT> elif self.ends("ies"): <NEW_LINE> <INDENT> self.setto("i") <NEW_LINE> <DEDENT> elif self.b[self.k - 1] != 's': <NEW_LINE> <INDENT> self.k = self.k - 1 | step1ab() gets rid of plurals:
caresses -> caress
ponies -> poni
ties -> ti
caress -> caress
cats -> cat | 625941e6091ae3566866739d |
def followed_by_hillary_and_donald(users, twitter): <NEW_LINE> <INDENT> for user in users: <NEW_LINE> <INDENT> if user['screen_name'] == 'HillaryClinton': <NEW_LINE> <INDENT> friendsHilary = user['friends'] <NEW_LINE> <DEDENT> if user['screen_name'] == 'realDonaldTrump': <NEW_LINE> <INDENT> friendsDonald = user['friend... | Find and return the screen_name of the one Twitter user followed by both Hillary
Clinton and Donald Trump. You will need to use the TwitterAPI to convert
the Twitter ID to a screen_name. See:
https://dev.twitter.com/rest/reference/get/users/lookup
Params:
users.....The list of user dicts
twitter...The Twitter ... | 625941e64f88993c3716c4a9 |
def sort_dirs_by_omega(dirs,split=False): <NEW_LINE> <INDENT> match_number = re.compile('-?\ *[0-9]+\.?[0-9]*(?:[Ee]\ *-?\ *[0-9]+)?') <NEW_LINE> omegas = [[float(omega) for omega in re.findall(match_number, dirname)][6] for dirname in dirs] <NEW_LINE> if split is True: <NEW_LINE> <INDENT> dirslist = [] <NEW_LINE> for ... | Sorts names of directories by 7-th float in this name (it should be parameter of potential by default!).
@param dirs - list of directories with data (necessarly full with aspect ratio and mesh size).
@param split - if true returns list of lists where every list contains directories' names with the same interaction pa... | 625941e621a7993f00bc813d |
def __init__( self, island_map, ini_pop, seed, ymax_animals=None, cmax_animals=None, img_base=None, img_fmt="png", ): <NEW_LINE> <INDENT> self.map = Map(island_map) <NEW_LINE> self.island_map = island_map <NEW_LINE> self.seed = random.seed(seed) <NEW_LINE> self.current_year = 0 <NEW_LINE> self.sim_year = 0 <NEW_LINE> s... | The BioSim class will simulate an ecosystem on an island. You need
to input a string with the map geography and add animals such as
herbivores and carnivores to simulate. The class will display an
interface with a colored map of the island, a population graph and
three heatmaps, one for each of the three respective ani... | 625941e68a349b6b435e85b9 |
def getByOwner(owner, user=None): <NEW_LINE> <INDENT> pass | Return the submissions for the given person.
If a submission is marked as private, it is only returned if
user == HWSubmission.owner, or if user is an admin. | 625941e676d4e153a657ef78 |
def funcIxn(x0, y0, parome, n): <NEW_LINE> <INDENT> return x0**n*funcLimb(x0,y0,parome) | Computes x**n*B(x,y)*I(x,y) at the position (x0,y0)
x0 : x coordinates of the planet
y0 : y coordinates of the planet
pdata : limb-darkening coefficient
n : power of x | 625941e676d4e153a657ef79 |
def copy_smart_previews(local_catalog, cloud_catalog, local2cloud=True): <NEW_LINE> <INDENT> lcat_noext = local_catalog[0:local_catalog.rfind(".lrcat")] <NEW_LINE> ccat_noext = cloud_catalog[0:cloud_catalog.rfind(".lrcat")] <NEW_LINE> lsmart = join(dirname(local_catalog),"%s Smart Previews.lrdata"%basename(lcat_noext))... | Copy Smart Previews from local to cloud or
vica versa when 'local2cloud==False'
NB: nothing happens if source dir doesn't exist | 625941e6379a373c97cfaf8d |
@prof.log_call(trace_logger) <NEW_LINE> def remove_too_close_local_maxima(local_maxima, min_local_max_distance, **parameters): <NEW_LINE> <INDENT> too_close__local_maxima_label_mask__to_remove = numpy.zeros( local_maxima.props.shape, dtype=bool) <NEW_LINE> local_maxima_pairs = numpy.array( list(itertools.combinations(x... | Removes local maxima that are too close to each other.
Args:
local_maxima(ExtendedRegionProps): The local maxima to refine
min_local_max_distance(float): The minimum allowed
distance between local
maxima
... | 625941e62ae34c7f2600d577 |
def plot_matrix_data(matrix): <NEW_LINE> <INDENT> vector = matrix.flatten() <NEW_LINE> rank = np.argsort(vector) <NEW_LINE> vector_ranked = vector[rank] <NEW_LINE> plt.figure(figsize=(15,8)) <NEW_LINE> plt.plot(vector_ranked) <NEW_LINE> plt.title('The Distribution of Data within the Matrix',fontsize = 20) <NEW_LINE> pl... | This function plots the distribution of data within a matrix for the purpose of observation | 625941e6d486a94d0b98e58d |
def continous_prob(self,x,mean,sd): <NEW_LINE> <INDENT> p=1/(math.sqrt(2*math.pi)*sd)*math.exp(-(x-mean)**2/(2*sd**2)) <NEW_LINE> return p | 概率密度函数,这里假设连续变量服从正态分布 | 625941e67b25080760e3989d |
def __init__(self, model=None, spurious=False): <NEW_LINE> <INDENT> def __observe(*args, **kwargs): self.__original_observe(self, *args, **kwargs) <NEW_LINE> __observe.__name__ = self.observe.__name__ <NEW_LINE> __observe.__doc__ = self.observe.__doc__ <NEW_LINE> self.__original_observe = self.observe <NEW_LINE> self.o... | *model* is passed to :meth:`observe_model` if given.
*spurious* indicates interest to be notified even when
the value hasn't changed, like for: ::
model.prop = model.prop
.. versionadded:: 1.2.0
Before that observers had to filter out spurious
notifications themselves, as if the default was `True`. With
:c... | 625941e65e10d32532c5f36b |
def get_current_status(self, request_digit): <NEW_LINE> <INDENT> return self.make_status_request(request_digit) | get the current status by making the statusrequest
:param request_digit: char request digit, the pc should send to arduino
:return: current status. if not given, it is false | 625941e60fa83653e46573ff |
def admin_command_ignored(self, msg): <NEW_LINE> <INDENT> patterns = self.config_get('ignore', []) <NEW_LINE> patterns_text = ', '.join(patterns) if len(patterns) > 0 else 'none' <NEW_LINE> text = 'Ignored patterns: %s' % patterns_text <NEW_LINE> self.respond(msg, text) | Lists ignored patterns.
Syntax: ignored | 625941e6a8ecb033257d3512 |
def query_execution(client, dataset_id, sql): <NEW_LINE> <INDENT> job_config = bigquery.QueryJobConfig() <NEW_LINE> table_name = 'temp_' + str(random.randint(1, 10)) <NEW_LINE> table_ref = client.dataset(dataset_id).table(table_name) <NEW_LINE> job_config.destination = table_ref <NEW_LINE> query_job = client.query( sql... | Execute sql query to get the output | 625941e6a934411ee3751adb |
def plot_colored_line(x,y, color, cmap = 'spectral_r', line_width = 2): <NEW_LINE> <INDENT> segments = np.array([x, y]).T.reshape(-1, 1, 2); <NEW_LINE> segments = np.concatenate([segments[:-1], segments[1:]], axis=1); <NEW_LINE> lc = LineCollection(segments, cmap=cmap); <NEW_LINE> lc.set_array(np.array(color)); <NEW_LI... | Plot a line with color code | 625941e6283ffb24f3c55d43 |
def getT(self): <NEW_LINE> <INDENT> if self.T is None: <NEW_LINE> <INDENT> self.makeH() <NEW_LINE> <DEDENT> return self.T | Get T, the eigenvectors.
T is calculated on the first call of this function.
Returns
-------
ndarray:
2d array with the eigenvectors | 625941e699cbb53fe679302b |
def afficher_nouveau_tour(): <NEW_LINE> <INDENT> print('-' * 80) | Affiche une séparation nette entre l'ancien tour et le nouveau.
Exemples possibles (l'affichage exact dépend de l'implémentation) :
>>> afficher_nouveau_tour()
----------------------------------- | 625941e61d351010ab855f61 |
def function(self, simulation, period): <NEW_LINE> <INDENT> period = period.start.offset('first-of', 'month').period('month') <NEW_LINE> paje_base_montant = simulation.calculate('paje_base_montant', period) <NEW_LINE> apje_temp = simulation.calculate('apje_temp', period) <NEW_LINE> ape_temp = simulation.calculate('ape_... | L'allocation de base de la paje n'est pas cumulable avec le complément familial | 625941e6cb5e8a47e48b7eea |
def _summary(self): <NEW_LINE> <INDENT> class_name = self.__class__.__name__ <NEW_LINE> if self._data_loaded: <NEW_LINE> <INDENT> if self.data is None: <NEW_LINE> <INDENT> nrows = 0 <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> nrows = len(self.data) <NEW_LINE> <DEDENT> ncols = len(self.columns) <NEW_LINE> format = sel... | Summarize the HDU: name, dimensions, and formats. | 625941e67b180e01f3dc4c3b |
def numa_fit_instance_to_host( host_topology, instance_topology, limits_topology=None): <NEW_LINE> <INDENT> if (not (host_topology and instance_topology) or len(host_topology) < len(instance_topology)): <NEW_LINE> <INDENT> return <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> if limits_topology is None: <NEW_LINE> <INDE... | Fit the instance topology onto the host topology given the limits
:param host_topology: objects.NUMATopology object to fit an instance on
:param instance_topology: objects.InstanceNUMATopology to be fitted
:param limits_topology: VirtNUMALimitTopology that defines limits
Given a host and instance topology and optiona... | 625941e6be383301e01b58c3 |
def replace_extension(self, extension): <NEW_LINE> <INDENT> extension = Extension(extension) <NEW_LINE> base = os.path.splitext(self.basename)[0] <NEW_LINE> if extension == '': <NEW_LINE> <INDENT> return self.parent.with_child(base) <NEW_LINE> <DEDENT> return self.parent.with_child(base + extension.with_dot) | Return a new Path that has the same basename as this one, but with a
different extension. If this Path does not have any extension, it is
added. | 625941e6099cdd3c635f109f |
def upload_and_replace_file(Directory_file, ID_file_for_replace_content_file, initDict): <NEW_LINE> <INDENT> gauth = GoogleAuth() <NEW_LINE> gauth.LoadClientConfigFile(initDict['pathClientSecret']) <NEW_LINE> gauth.LoadCredentialsFile(initDict['pathTokenDrive']) <NEW_LINE> if gauth.credentials is None: <NEW_LINE> <INDE... | :param Directory_file: Directory file local to replace content a file in google drive
:param ID_file_for_replace_content_file: ID a file in google drive
:return: | 625941e6187af65679ca5567 |
def check(self): <NEW_LINE> <INDENT> return self._value | Check if the terminating condition has been fulfilled, and return True or False accordingly | 625941e6498bea3a759b9ef4 |
@login_required <NEW_LINE> def dashboard(request, workspace=None): <NEW_LINE> <INDENT> registered_plugins = get_user_plugins(request.user) <NEW_LINE> user_plugin_uids = [uid for uid, repr in registered_plugins] <NEW_LINE> dashboard_settings = get_or_create_dashboard_settings(request.user) <NEW_LINE> layout = get_layout... | Dashboard.
:param django.http.HttpRequest request:
:param string workspace: Workspace slug. If given, the workspace loaded.
Otherwise we deal with no workspace.
:return django.http.HttpResponse: | 625941e6be383301e01b58c4 |
def connect(self, code): <NEW_LINE> <INDENT> self.room_code = code <NEW_LINE> ip, port = room_decode(code) <NEW_LINE> print(ip, port) <NEW_LINE> self.clients.append((ip, port)) <NEW_LINE> self.listen() | Connect to an existing room | 625941e67d847024c06be706 |
def write_example_email_config(): <NEW_LINE> <INDENT> config = ConfigParser() <NEW_LINE> config.add_section("email_lib") <NEW_LINE> config.set("email_lib", "server", "smtp.example.com") <NEW_LINE> config.set("email_lib", "port", "587") <NEW_LINE> config.set("email_lib", "username", "USERNAME") <NEW_LINE> config.set("em... | Write an example email config.
Write an example configuration to allow people to edit.
Args:
None.
Returns:
Nothing. | 625941e6be7bc26dc91cda3f |
def __init__(self, url, userid, passwd, headers={}): <NEW_LINE> <INDENT> self.headers = headers <NEW_LINE> self.headers['Accept'] = ACCOUNT_INFO <NEW_LINE> self.passwd = passwd <NEW_LINE> self.url = url <NEW_LINE> self.userid = userid <NEW_LINE> self.http = Http(self.url, headers=self.headers) <NEW_LINE> self._get() | Initialize | 625941e6435de62698dfe093 |
def isSubtree(s, t): <NEW_LINE> <INDENT> return do_pre_order_traversal(t) in do_pre_order_traversal(s) | :type s: TreeNode
:type t: TreeNode
:rtype: bool | 625941e644b2445a339324d9 |
def p_transitions(self, p): <NEW_LINE> <INDENT> self.config['transitions'] = p[2] | transitions : TRANSITIONS transitions_body '}' | 625941e6627d3e7fe0d69298 |
def initialize_iteration(self): <NEW_LINE> <INDENT> self.gradient_moving = np.empty( shape=(self.moving_image.shape)+(self.dim,), dtype=floating) <NEW_LINE> for i, grad in enumerate(gradient(self.moving_image)): <NEW_LINE> <INDENT> self.gradient_moving[..., i] = grad <NEW_LINE> <DEDENT> if self.moving_spacing is not No... | Prepares the metric to compute one displacement field iteration.
Pre-computes the gradient of the input images to be used in the
computation of the forward and backward steps. | 625941e63d592f4c4ed1d4a8 |
def encoding_sentence(english_sentence): <NEW_LINE> <INDENT> cleand_english_sentence = get_cleaned_english_sentence(english_sentence) <NEW_LINE> result_sentence = list() <NEW_LINE> for sentence in cleand_english_sentence.split(" "): <NEW_LINE> <INDENT> result = list() <NEW_LINE> for ch in sentence: <NEW_LINE> <INDENT> ... | Input:
- english_sentence : 문자열 값으로 모스 부호로 변환이 가능한 영어문장
Output:
- 입력된 영어문장 문자열 값을 모스부호로 변환된 알파벳으로 변환한 문자열
단 양쪽 끝에 빈칸은 삭제한다.
Examples:
>>> import morsecode as mc
>>> mc.encoding_sentence("HI! Fine, Thank you.")
'.... .. ..-. .. -. . - .... .- -. -.- -.-- --- ..-'
>>> mc.encoding_sentence... | 625941e697e22403b379d3e2 |
def handle(self, *args: List[Any], **kwargs: Dict[str, Any]) -> None: <NEW_LINE> <INDENT> locale = kwargs.get("locale", self.ALL) <NEW_LINE> if all([locale == self.ALL, settings.LANGUAGES]): <NEW_LINE> <INDENT> for language in dict(settings.LANGUAGES): <NEW_LINE> <INDENT> self.convert(locale=language, **kwargs) <NEW_LI... | Run command.
:param args: additional args
:type args: List[Any]
:param kwargs: additional args
:type kwargs: Dict[str, Any] | 625941e6cc0a2c11143dd2d9 |
def sort_and_merge(data_set_left, data_set_right): <NEW_LINE> <INDENT> sorted_result = [] <NEW_LINE> l_pos = r_pos = 0 <NEW_LINE> while l_pos < len(data_set_left) and r_pos < len(data_set_right): <NEW_LINE> <INDENT> if data_set_left[l_pos] < data_set_right[r_pos]: <NEW_LINE> <INDENT> sorted_result.append(data_set_left[... | Applies remainder of top-down approach from the merge sort algorithm, returning sorted lists.
:param data_set_left: Left hand side of list to sort and merge
:param data_set_right: Right hand side of list to sort and merge
:return: Merged and sorted list | 625941e6fbf16365ca6f6614 |
def initUi(self): <NEW_LINE> <INDENT> self.setWindowTitle(u'K线工具') <NEW_LINE> self.pw = pg.PlotWidget() <NEW_LINE> self.lay_KL = pg.GraphicsLayout(border=(100,100,100)) <NEW_LINE> self.lay_KL.setContentsMargins(5, 5, 5, 5) <NEW_LINE> self.lay_KL.setSpacing(0) <NEW_LINE> self.lay_KL.setBorder(color=(100, 100, 100, 250),... | 初始化界面
leyout 如下:
------------------————————
\ 主图(K线/主图指标/交易信号 \ -----------------------------------
\ 副图1(成交量) -----------------------------------
\ 副图2(持仓量/副图指标) -----------------------------------
:return: | 625941e64f6381625f114e83 |
def get_distance(coord1, coord2): <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> e1, n1, zn1, zl1 = utm.from_latlon(coord1[0], coord1[1]) <NEW_LINE> e2, n2, zn2, zl2 = utm.from_latlon(coord2[0], coord2[1]) <NEW_LINE> dist = (e1-e2)**2 + (n1-n2)**2 <NEW_LINE> if np.sqrt(dist) > 3000: <NEW_LINE> <INDENT> return None <NEW_L... | Method to get the distance in meters between two points | 625941e67d43ff24873a30ea |
def unfilter_handler(self, msg): <NEW_LINE> <INDENT> self.filters.difference_update(msg.filter_types) | Handle an unfilter message by removing the filter. | 625941e69b70327d1c4e121e |
def start(task_id, release_id): <NEW_LINE> <INDENT> endpoint_url = current_app.config['DYNAMO_ENDPOINT'] <NEW_LINE> db = boto3.resource('dynamodb', endpoint_url=endpoint_url) <NEW_LINE> table = db.Table(current_app.config['TASK_TABLE']) <NEW_LINE> task = table.update_item( Key={'task_id': task_id}, UpdateExpression='SE... | Update a task's state to 'running' and start the background task | 625941e6ff9c53063f47c638 |
def save_np_array(txtfile, data, path="."): <NEW_LINE> <INDENT> if not isinstance(txtfile, str): <NEW_LINE> <INDENT> print("Please enter a text file name as a string") <NEW_LINE> os.abort() <NEW_LINE> <DEDENT> file = os.path.join(path, txtfile) <NEW_LINE> if txtfile in os.listdir(path): <NEW_LINE> <INDENT> open(file, '... | Save a numpy array as a text file, erases any text file with the same name previously
existing in the selected directory.
Parameters
----------
txtfile : str
Name of the textfile to write into with its extension (".txt")
data : numpy array
Data to save in the text file.
path : str, default : "."
Gives the ... | 625941e68e7ae83300e4b415 |
def clean_deposition_and_layer(self): <NEW_LINE> <INDENT> if "-" not in self.cleaned_data["deposition_and_layer"]: <NEW_LINE> <INDENT> raise ValidationError(_("Deposition and layer number must be separated by \"-\".")) <NEW_LINE> <DEDENT> deposition_number, layer_number = self.cleaned_data["deposition_and_layer"].rspli... | Convert the notation ``<deposition number>-<layer number>`` to
``(deposition ID, layer number)``. Additionaly, do some validity
tests. | 625941e64f88993c3716c4aa |
def prepare_dates(df, date_cols, month): <NEW_LINE> <INDENT> r <NEW_LINE> if df[date_cols[0]].dtype == np.float64: <NEW_LINE> <INDENT> df['com_year'] = df[date_cols[0]].fillna(1800).astype(np.int64) <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> df['com_year'] = pd.to_datetime(df[date_cols[0]].fillna( '1800-01-01')).dt.... | von Uwe | 625941e616aa5153ce3628bf |
def test_modify_role_case1(self): <NEW_LINE> <INDENT> self.assertTrue(self.login_page.open_browser(config.BASE_URL),u"打开首页失败") <NEW_LINE> r = self.login_page.login(**test_modify_role_case1) <NEW_LINE> self.assertTrue(r.result, r.msg) <NEW_LINE> r = self.role_page.add_role(**test_modify_role_case1) <NEW_LINE> self.asser... | 测试超市添加角色 | 625941e6dc8b845886cb597d |
def get_email_message_content(e_content_list): <NEW_LINE> <INDENT> print('\nWhich message would you like to send: ') <NEW_LINE> for choice in email_content_choices: <NEW_LINE> <INDENT> print(choice) <NEW_LINE> <DEDENT> content = input('\nYour Choice: ') <NEW_LINE> for x in e_content_list.keys(): <NEW_LINE> <INDENT> if ... | :returns a user's choice from the email content list | 625941e6596a897236089f02 |
def archive_card(self, card): <NEW_LINE> <INDENT> card_obj = self.get_card(card) <NEW_LINE> if not card_obj: <NEW_LINE> <INDENT> self.__log(make_red("could not find card:", card)) <NEW_LINE> return False <NEW_LINE> <DEDENT> url = "%s/cards/%s" % (self.base_url, card_obj.id) <NEW_LINE> response = self.__delete(url) <NEW... | Archives a card. Archived cards can still be restored.
Args:
card (str or Card): The card's ID or slug, or a Card object.
Returns:
bool: True if it was successful and False otherwise. | 625941e6ec188e330fd5abdd |
def _getDataFromFullname(self, dom, name): <NEW_LINE> <INDENT> dom = self._getRootParent(dom) <NEW_LINE> obj = dom <NEW_LINE> for part in name.split('.'): <NEW_LINE> <INDENT> Debug(2, "_getDataFromFullname(%s): [%s]" % (name, obj.name)) <NEW_LINE> if part == obj.name: <NEW_LINE> <INDENT> continue <NEW_LINE> <DEDENT> ob... | Take a fullname (blah.blah.blah) and locate
it in our data dom. | 625941e656b00c62f0f14aa3 |
@experimental(as_of="0.4.0") <NEW_LINE> def kempton_taylor_q(counts, lower_quantile=0.25, upper_quantile=0.75): <NEW_LINE> <INDENT> counts = _validate(counts) <NEW_LINE> n = len(counts) <NEW_LINE> lower = int(np.ceil(n * lower_quantile)) <NEW_LINE> upper = int(n * upper_quantile) <NEW_LINE> sorted_counts = np.sort(coun... | Calculate Kempton-Taylor Q index of alpha diversity.
Estimates the slope of the cumulative abundance curve in the interquantile
range. By default, uses lower and upper quartiles, rounding inwards.
Parameters
----------
counts : 1-D array_like, int
Vector of counts.
lower_quantile : float, optional
Lower bound... | 625941e6baa26c4b54cb1562 |
def __init__(self, world, map_id, height_pixels, width_pixels, extent): <NEW_LINE> <INDENT> super().__init__(world) <NEW_LINE> self.map_id =map_id <NEW_LINE> self.height_pixels = height_pixels <NEW_LINE> self.width_pixels = width_pixels <NEW_LINE> self.extent = extent <NEW_LINE> self.frame = np.zeros((height_pixels, wi... | Initialization | 625941e69c8ee82313fbbbbd |
def __init__(self, hdf5_file_path, label_file_path, class_num, normlize=True, train_batch_size=32, mask_aug_num=0): <NEW_LINE> <INDENT> super(DLDataSet, self).__init__() <NEW_LINE> self.data_file_path = hdf5_file_path <NEW_LINE> print('HDF5 File: %s' % hdf5_file_path) <NEW_LINE> label_df = pd.read_csv(label_file_path, ... | hdf5_file_path: 对应的hdf5文件提供每个sample的特征矩阵
label_file_path: csv文件,第一列必须为index_col, 必须有名为label列,
且索引和标签与hdf5文件中数据一一对应 | 625941e6004d5f362079a778 |
def get_doc_author(self, soup): <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> author = soup.find('div', {'class': 'BYLINE'}).string <NEW_LINE> author = author.replace('By ', '') <NEW_LINE> if author: <NEW_LINE> <INDENT> return author <NEW_LINE> <DEDENT> <DEDENT> except Exception as exc: <NEW_LINE> <INDENT> if self.verbo... | @param {BeautifulSoup} soup: a documentcontainer tag
@returns {str}: the author attribute of a document | 625941e666656f66f7cbc5f4 |
def gaussian(pdists, alpha, beta): <NEW_LINE> <INDENT> def neighborhood(t): <NEW_LINE> <INDENT> return alpha(t) * np.exp(-pdists ** 2 / (2 * beta(t))) <NEW_LINE> <DEDENT> return neighborhood | ガウス関数型の近傍関数を返す.
:param pdists: ニューロン間距離行列
:param alpha: 時刻 t におけるガウス関数の振幅を返す関数
:param beta: 時刻 t におけるガウス関数の分散を返す関数
:return: 時刻 t における各ニューロン間の近傍関数の値を返す関数 | 625941e6462c4b4f79d1db16 |
def normalize_advantage(self, advantages): <NEW_LINE> <INDENT> advantages = (advantages - np.mean(advantages)) / np.std(advantages) <NEW_LINE> return advantages | Normalizes the advantage. This function is called only if self.config.normalize_advantage is True.
Args:
advantages: the advantages
Returns:
adv: Normalized Advantage
Calculate the advantages, by normalizing the advantages.
TODO:
Normalize the advantages so that they have a mean of 0 and standard dev... | 625941e64428ac0f6e5bac3d |
def _bit_criteria_select(report: list[str], is_most: bool) -> int: <NEW_LINE> <INDENT> n_cols = len(report[0]) <NEW_LINE> for col_idx in range(n_cols): <NEW_LINE> <INDENT> select_bit = _common_bit(report, col_idx, is_most) <NEW_LINE> report = [row for row in report if row[col_idx] == select_bit] <NEW_LINE> if len(repor... | Locate the query value from the diagnostic report based on the provided bit criteria.
For the given report, report values are iterated over by bit position. For each position, the
most/least common value in the current bit position is calculated, only numbers with that bit in
that position are retained. In the event o... | 625941e626068e7796caf12d |
def test_chord_full_dotted(self): <NEW_LINE> <INDENT> mei_chord = ETree.Element(mei.CHORD,dur='4',dots='1') <NEW_LINE> ETree.SubElement(mei_chord, mei.NOTE,pname='c',octave='4') <NEW_LINE> ETree.SubElement(mei_chord, mei.NOTE,pname='d',octave='4') <NEW_LINE> abjad_chord = abjad.chord_to_chord(mei_chord) <NEW_LINE> self... | precondition: mei chord Element with dotted duration and two child note Elements
postcondition: abjad Chord with dotted duration and two child note Elements | 625941e6d268445f265b52b6 |
def __init__(self, dirname=Path.cwd(), files_wildcard="*"): <NEW_LINE> <INDENT> if not dirname.is_dir(): <NEW_LINE> <INDENT> raise LoadError(f"No such directory: {dirname}") <NEW_LINE> <DEDENT> self.filelist = sorted(dirname.glob(files_wildcard)) | Instantiate base loader.
Parameters
----------
dirname: pathlib.Path, optional
Path to the directory with tracking output.
files_wildcard: str, optional
Wildcard to find files in the directory. | 625941e623849d37ff7b34d3 |
def test_extend_volume_not_implemented_error(self): <NEW_LINE> <INDENT> inst_obj = objects.Instance(id=3, uuid=uuids.instance) <NEW_LINE> connection_info = {'foo': 'bar'} <NEW_LINE> bdm = objects.BlockDeviceMapping( source_type='volume', destination_type='volume', volume_id=uuids.volume_id, volume_size=10, instance_uui... | Tests the case where driver.extend_volume raises
NotImplementedError. | 625941e6d6c5a10208144495 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.