code stringlengths 4 4.48k | docstring stringlengths 1 6.45k | _id stringlengths 24 24 |
|---|---|---|
def userRenamed(self, old, new): <NEW_LINE> <INDENT> log.msg("User renamed %r->%r" % (old, new)) <NEW_LINE> self.user_modes[new] = self.user_modes.pop(old, MODE_NORMAL) | When a user is renamed, re-cache permissions | 625941c5a934411ee375169b |
def _to_array(self, itaper, normalization='4pi', csphase=1): <NEW_LINE> <INDENT> coeffs = _shtools.SHVectorToCilm(self.tapers[:, itaper]) <NEW_LINE> if normalization == 'schmidt': <NEW_LINE> <INDENT> for l in range(self.lwin + 1): <NEW_LINE> <INDENT> coeffs[:, l, :l+1] *= _np.sqrt(2.0 * l + 1.0) <NEW_LINE> <DEDENT> <DE... | Return the spherical harmonic coefficients of taper i as an
array, where i=0 is the best concentrated. | 625941c54f6381625f114a44 |
def _parallel_fitting( distribution: indices.Distribution, shared_arrays: Dict, input_var_names: Dict, output_var_names: Dict, input_type: InputType, number_of_workers: int, args: Dict, ): <NEW_LINE> <INDENT> if len(set([shared_arrays[var][_KEY_SHAPE] for var in output_var_names.values()])) != 1: <NEW_LINE> <INDENT> ra... | TODO document this function
:param distribution:
:param Dict shared_arrays:
:param Dict input_var_names:
:param Dict output_var_names:
:param InputType input_type:
:param number_of_workers: number of worker processes to use
:param args:
:return: | 625941c5956e5f7376d70e76 |
@register.filter <NEW_LINE> def truncate(value, arg): <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> length = int(arg) <NEW_LINE> <DEDENT> except ValueError: <NEW_LINE> <INDENT> return value <NEW_LINE> <DEDENT> if not isinstance(value, basestring): <NEW_LINE> <INDENT> value = str(value) <NEW_LINE> <DEDENT> if (len(value)... | Truncates a string after a given number of chars
Argument: Number of chars to truncate after | 625941c531939e2706e4ce74 |
def __init__(self, keys, num_sigs=None, sort=True, complete=True, netcode='BTC', cache=None): <NEW_LINE> <INDENT> super(MultisigAccount, self).__init__(netcode, cache) <NEW_LINE> self._keys = keys <NEW_LINE> self._local_key = next(iter([key for key in keys if key.is_private()]), None) <NEW_LINE> self._public_keys = [st... | Create a multisig account with multiple participating keys
:param keys: non-oracle deterministic keys
:type keys: list[BIP32Node]
:param num_sigs: number of required signatures
:param complete: whether we need additional keys to complete the configuration of this account | 625941c5d486a94d0b98e14d |
def get_opportunities_groups(self, **kwargs): <NEW_LINE> <INDENT> kwargs['_return_http_data_only'] = True <NEW_LINE> if kwargs.get('callback'): <NEW_LINE> <INDENT> return self.get_opportunities_groups_with_http_info(**kwargs) <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> (data) = self.get_opportunities_groups_with_http... | Get opportunities groups
Return a list of opportunities groups --- This route is cached for up to 3600 seconds
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please define a `callback` function
to be invoked when receiving the response.
>>> def callback_function(respons... | 625941c5ad47b63b2c509f88 |
@pytest.fixture <NEW_LINE> def git_config_file(tmp_path, monkeypatch): <NEW_LINE> <INDENT> config_file = tmp_path / "git_config" <NEW_LINE> config_file.touch() <NEW_LINE> monkeypatch.setitem(os.environ, "GIT_CONFIG", str(config_file)) <NEW_LINE> return config_file | Create a temporary git config file, and monkeypatch $GIT_CONFIG to point to it. | 625941c5fb3f5b602dac369a |
def _retrievePublicKey(self, keyurl, repo=None, getSig=True): <NEW_LINE> <INDENT> msg = _('Retrieving key from %s') % keyurl <NEW_LINE> self.logger.info(msg) <NEW_LINE> try: <NEW_LINE> <INDENT> with dnf.util.urlopen(keyurl, repo) as fh: <NEW_LINE> <INDENT> rawkey = fh.read() <NEW_LINE> <DEDENT> <DEDENT> except IOError ... | Retrieve a key file
@param keyurl: url to the key to retrieve
Returns a list of dicts with all the keyinfo | 625941c58a349b6b435e817b |
def restore_builtins(): <NEW_LINE> <INDENT> if sys.version_info[0] == 2: <NEW_LINE> <INDENT> __builtin__.file = original_file <NEW_LINE> <DEDENT> __builtin__.open = original_open | restore the original file and open to the builtin module | 625941c5f548e778e58cd585 |
def maxDepth(self, root): <NEW_LINE> <INDENT> if root == None: <NEW_LINE> <INDENT> return 0 <NEW_LINE> <DEDENT> if root.left == None and root.right == None: <NEW_LINE> <INDENT> return 1 <NEW_LINE> <DEDENT> left = self.maxDepth(root.left) <NEW_LINE> right = self.maxDepth(root.right) <NEW_LINE> return left + 1 if left > ... | :type root: TreeNode
:rtype: int | 625941c5379a373c97cfab4c |
def save_records_plot(file_path, ls_monitors, name, n_train_batches, legend_loc="upper right"): <NEW_LINE> <INDENT> lines = ["--", "-", "-.",":"] <NEW_LINE> linecycler = cycle(lines) <NEW_LINE> plt.figure() <NEW_LINE> for m in ls_monitors: <NEW_LINE> <INDENT> X = [i/float(n_train_batches) for i in m.history_minibatch] ... | Save a plot of a list of monitors' history.
Args:
file_path (string): the folder path where to save the plot
ls_monitors: the list of statistics to plot
name: name of file to be saved
n_train_batches: the total number of training batches | 625941c5d6c5a10208144052 |
def delete_max(self): <NEW_LINE> <INDENT> raise NotImplementedError | Deletion for RedBlackTree is not implemented. | 625941c5507cdc57c6306ce0 |
def collectGarbage(self) -> None: <NEW_LINE> <INDENT> for checker in self.resource_checkers: <NEW_LINE> <INDENT> checker.cleanResources() | Cleans up any resources that are left after a cluster has been removed. | 625941c56fb2d068a760f0a4 |
def unresolved(mctx, x): <NEW_LINE> <INDENT> getargs(x, 0, 0, _("unresolved takes no arguments")) <NEW_LINE> if mctx.ctx.rev() is not None: <NEW_LINE> <INDENT> return [] <NEW_LINE> <DEDENT> ms = merge.mergestate(mctx.ctx._repo) <NEW_LINE> return [f for f in mctx.subset if f in ms and ms[f] == 'u'] | ``unresolved()``
File that is marked unresolved according to the resolve state. | 625941c53617ad0b5ed67f01 |
def test_retrieve_single_contour(self): <NEW_LINE> <INDENT> url = "/contours/1/" <NEW_LINE> data = { "id": 1, "data": { "type": "Polygon", "coordinates": [ [0, 0.0], [10.0, 0.0], [10.0, 20.0], [0, 20.0] ] } } <NEW_LINE> response = self.client.get(url, format='json') <NEW_LINE> self.assertEqual(response.status_code, sta... | Ensure we can retrieve a single point. | 625941c58da39b475bd64f7a |
def _copy(srcpath, dstpath, files_installed): <NEW_LINE> <INDENT> dstdirtop = split(dstpath)[0] <NEW_LINE> if not exists(dstdirtop): <NEW_LINE> <INDENT> created = [] <NEW_LINE> dstdir = dstdirtop <NEW_LINE> while not exists(dstdir): <NEW_LINE> <INDENT> assert dstdir, 'no such directory: %r' % srcpath <NEW_LINE> created... | Copy file from srcpath to dstpath.
Parent directories of dstpath are created if necessary.
Created directories and the installed file are appended to
files_installed. | 625941c5a934411ee375169c |
def c1(self, c1_p1): <NEW_LINE> <INDENT> SeqDiagBuilder.recordFlow() | :param c1_p1:
:seqdiag_return Cc1Return
:return: | 625941c5377c676e912721b1 |
def receive_messages(self): <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> connection, addr = self._listeningSocket.accept() <NEW_LINE> data = connection.recv(1024) <NEW_LINE> if data: <NEW_LINE> <INDENT> message = cPickle.loads(data) <NEW_LINE> self.logger.info("empfangen: " + message.printToString()) <NEW_LINE> self.pr... | * Empfaengt eine Nachricht auf dem Port auf dem der Prozess hoert.
* Deserialisiert die Nachricht
* loggt die Nachricht
* verarbeitet die Nachricht in der abstrakten Methode process_received_message()
* wartet allerdings nur bis zum Timeout, danach wird ueberprueft ob ein Deadlock vorliegt | 625941c5f7d966606f6aa00b |
def GetNumberOfStreamDivisions(self): <NEW_LINE> <INDENT> return _itkImageFileWriterPython.itkImageFileWriterIRGBUC2_GetNumberOfStreamDivisions(self) | GetNumberOfStreamDivisions(self) -> unsigned int | 625941c5656771135c3eb875 |
def forward(self, words, seq_len=None): <NEW_LINE> <INDENT> if self.embed ==None: <NEW_LINE> <INDENT> with torch.no_grad(): <NEW_LINE> <INDENT> words_bert_id =words <NEW_LINE> words_embed,_ = self.bert_model(words_bert_id,output_all_encoded_layers =False) <NEW_LINE> <DEDENT> x =words_embed <NEW_LINE> <DEDENT> else: <NE... | :param (str | list for words) words: 一个整句或者句子的字列表
XXX:param torch.LongTensor words: [batch_size, seq_len],句子中word的index
:param torch.LongTensor seq_len: [batch,] 每个句子的长度
:return output: dict of torch.LongTensor, [batch_size, num_classes] | 625941c530bbd722463cbdcd |
def _cut_rod_memoized(prices, length, the_memo): <NEW_LINE> <INDENT> if the_memo[length] >= 0: <NEW_LINE> <INDENT> return the_memo[length] <NEW_LINE> <DEDENT> value = 0 <NEW_LINE> if length > 0: <NEW_LINE> <INDENT> value = _MINIMUM_VALUE <NEW_LINE> for x in range(1, length + 1): <NEW_LINE> <INDENT> value = max(value, p... | The recursive function for calculating the greatest value using memoization.
:param list prices: The list of prices.
:param int length: The length of the rod.
:param list the_memo: A memo where calculated values are stored for each rod length.
:return: the greatest value possible for the rod of length length.
:rtype: ... | 625941c5097d151d1a222e64 |
def poly(d=None, hyp=None, x=None, z=None, hi=None, dg=None): <NEW_LINE> <INDENT> if x is None: <NEW_LINE> <INDENT> return '2' <NEW_LINE> <DEDENT> if z is None: <NEW_LINE> <INDENT> z = numpy.array([[]]) <NEW_LINE> <DEDENT> if dg is None: <NEW_LINE> <INDENT> dg = False <NEW_LINE> <DEDENT> xeqz = numpy.size(z) == 0 <NEW_... | Polynomial covariance function. The covariance function is parameterized as:
k(x^p,x^q) = sf^2 * ( c + (x^p)'*(x^q) )^d
The hyperparameters are:
hyp = [ log(c)
log(sf) ] | 625941c5f8510a7c17cf9704 |
def test_00_VpnConditionType_IncomingClient(self): <NEW_LINE> <INDENT> value = pykerio.enums.VpnConditionType(name='IncomingClient') <NEW_LINE> self.assertEquals(value.dump(), 'IncomingClient') <NEW_LINE> self.assertEquals(value.get_name(), 'IncomingClient') <NEW_LINE> self.assertEquals(value.get_value(), 0) | Test VpnConditionType with IncomingClient | 625941c5d164cc6175782d56 |
def plotF0(fromTuple, toTuple, mergeTupleList, fnFullPath): <NEW_LINE> <INDENT> _matplotlibCheck() <NEW_LINE> plt.hold(True) <NEW_LINE> fig, (ax0) = plt.subplots(nrows=1) <NEW_LINE> plot1 = ax0.plot(fromTuple[0], fromTuple[1], color='red', linewidth=2, label="From") <NEW_LINE> plot2 = ax0.plot(toTuple[0], toTuple[1], c... | Plots the original data in a graph above the plot of the dtw'ed data | 625941c556ac1b37e62641db |
def test_find_by_properties_fail(): <NEW_LINE> <INDENT> artifact = party.Party() <NEW_LINE> flexmock(artifact).should_receive("query_artifactory").and_return(None) <NEW_LINE> assert_equals(artifact.find_by_properties(testprops), None) <NEW_LINE> assert_equals(artifact.files, []) <NEW_LINE> with assert_raises(AttributeE... | find_by_properties: Handles list of zero files as expected. | 625941c5be8e80087fb20c4d |
def ReplaceEntries(image_fname, input_fname, indir, entry_paths, do_compress=True, allow_resize=True, write_map=False): <NEW_LINE> <INDENT> image = Image.FromFile(image_fname) <NEW_LINE> if input_fname: <NEW_LINE> <INDENT> if not entry_paths: <NEW_LINE> <INDENT> raise ValueError('Must specify an entry path to read with... | Replace the data from one or more entries from input files
Args:
image_fname: Image filename to process
input_fname: Single input filename to use if replacing one file, None
otherwise
indir: Input directory to use (for any number of files), else None
entry_paths: List of entry paths to replace
... | 625941c582261d6c526ab4a6 |
def tempFile(name): <NEW_LINE> <INDENT> return os.path.join(QDir.tempPath(), name) | Returns a temp file. | 625941c54428ac0f6e5ba7fa |
def genre_search(self, **kwargs): <NEW_LINE> <INDENT> endpoint = "/GenreSearch" <NEW_LINE> return self._request(endpoint, kwargs) | ジャンル検索
Required parameters
---------
floor_id: int
フロア一覧から取得できるfloor_id 例: 91(VRch)
Returns
---------
ジャンル一覧: dict
Docs
---------
https://affiliate.dmm.com/api/v3/genresearch.html | 625941c57d43ff24873a2ca8 |
def dropbase_upload(file_paths): <NEW_LINE> <INDENT> for file in file_paths.keys(): <NEW_LINE> <INDENT> pre_sign = generate_presigned_url(file_paths[file]) <NEW_LINE> if pre_sign and pre_sign['success']: <NEW_LINE> <INDENT> upload_success = upload_file(pre_sign['upload_url'], file) <NEW_LINE> if not upload_success or n... | Uploads CSV data to dropbase database using their Beta REST API
:param file_paths: Dictionary {paths to CSV files : Pipeline tokens}
:return: None | 625941c5a4f1c619b28b0045 |
def update_observation_data(api, sites, observations, start, end, *, gaps_only=False): <NEW_LINE> <INDENT> sites = common.filter_by_networks(sites, ['PNNL']) <NEW_LINE> for site in sites: <NEW_LINE> <INDENT> common.update_site_observations( api, fetch, site, observations, start, end, gaps_only=gaps_only) | Post new observation data to all PNNL observations from
start to end.
Parameters
----------
api : solarforecastarbiter.io.api.APISession
An active Reference user session.
sites: list
List of all reference sites as Objects
observations: list of solarforecastarbiter.datamodel.Observation
List of all referenc... | 625941c532920d7e50b281d8 |
@aws('s3') <NEW_LINE> @pytest.mark.parametrize('read_order', ['LEXICOGRAPHICAL', 'TIMESTAMP']) <NEW_LINE> def test_s3_restart_pipeline_with_changed_common_prefix(sdc_builder, sdc_executor, aws, read_order): <NEW_LINE> <INDENT> s3_key = f'{S3_SANDBOX_PREFIX}/{get_random_string()}/sdc' <NEW_LINE> n_files = 10 <NEW_LINE> ... | This test is for xml data format, which was not working properly when reset with file offset.
It checks that no stage error happens after the pipeline is restarted with an offset halfway in the file.
s3_origin >> trash | 625941c563f4b57ef0001126 |
def _modify_response(self, response: web.Response) -> None: <NEW_LINE> <INDENT> response.headers.update( { 'Access-Control-Allow-Origin': self._allowed_origin, 'Access-Control-Allow-Headers': 'Content-Type, Authorization' } ) <NEW_LINE> allowed_methods = response.headers.get('Allow') <NEW_LINE> if allowed_methods is no... | Appends CORS headers to the specified response
:param response: HTTP response to be altered
:return: None | 625941c594891a1f4081bab1 |
def add_series(self, options): <NEW_LINE> <INDENT> if 'values' not in options: <NEW_LINE> <INDENT> warn("Must specify 'values' in add_series()") <NEW_LINE> return <NEW_LINE> <DEDENT> if self.requires_category and 'categories' not in options: <NEW_LINE> <INDENT> warn("Must specify 'categories' in add_series() " "for thi... | Add a data series to a chart.
Args:
options: A dictionary of chart series options.
Returns:
Nothing. | 625941c5009cb60464c633bb |
def _binning(data, bin_size): <NEW_LINE> <INDENT> lower_multiples = min(data) // bin_size <NEW_LINE> upper_multiples = max(data) // bin_size <NEW_LINE> upper_multiples += 1 <NEW_LINE> lower_lim = lower_multiples * bin_size <NEW_LINE> upper_lim = upper_multiples * bin_size + (bin_size / 2.0) <NEW_LINE> return np.arange(... | Creates smarter bins for the histogram function.
The default binning often makes bins of very strange size, that don't
align well with integer values of the x-axis, making interpretation hard.
This uses the minimum and maximum of the data, along with the specified
bin size, to create bin boundaries that are integer mu... | 625941c599fddb7c1c9de39a |
def isRunning(self): <NEW_LINE> <INDENT> return self.__plugin.getWorkflowJob().isRunning() | @rtype: bool | 625941c5a79ad161976cc14e |
def obtainRatings(site, reqUrl): <NEW_LINE> <INDENT> rating = "NA" <NEW_LINE> if site == "codechef": <NEW_LINE> <INDENT> rating = ccfor(reqUrl) <NEW_LINE> <DEDENT> elif site == "codeforces": <NEW_LINE> <INDENT> rating = cfsor(reqUrl) <NEW_LINE> <DEDENT> elif site == "hackerearth": <NEW_LINE> <INDENT> rating = heor(reqU... | Obtains Rating From Corresponding Site.
Arguments:
site = Name of the Site
reqUrl = Url of the user profile
Returns:
Actual ratings if successfully retrieved, NA otherwise | 625941c5460517430c394191 |
def get_batch_aug_fast(self, batch_size, max_queue_size=30): <NEW_LINE> <INDENT> if hasattr(self, 'aug_queue') == False: <NEW_LINE> <INDENT> queue_thread = threading.Thread(target=self.add_batch_aug_queue, args=(batch_size, max_queue_size)) <NEW_LINE> queue_thread.start() <NEW_LINE> <DEDENT> while hasattr(self, 'aug_qu... | A fast function for get augmentation batch.Use another thread to get batch and put into a queue.
:param batch_size: batch size
:param max_queue_size: the max capacity of the queue
:return: An image batch with shape [batch_size, height, width, 3]
and a label batch with shape [batch_size, height, width, 1] | 625941c529b78933be1e56b7 |
def friendships_pending(self): <NEW_LINE> <INDENT> res = self._call_api('friendships/pending/') <NEW_LINE> if self.auto_patch and res.get('users'): <NEW_LINE> <INDENT> [ClientCompatPatch.list_user(u, drop_incompat_keys=self.drop_incompat_keys) for u in res.get('users', [])] <NEW_LINE> <DEDENT> return res | Get pending follow requests | 625941c55510c4643540f3f1 |
def _outputAction(self, director, container): <NEW_LINE> <INDENT> sA = container.section(Class="qe-section-text-output") <NEW_LINE> sA.add(lc.htmldocument(text="Outputs: ")) <NEW_LINE> sB = container.section(Class="qe-section-output") <NEW_LINE> docOutput = lc.document(id=ID_OUTPUTS) <NEW_LINE> docO... | Simulation output files | 625941c515fb5d323cde0b17 |
def build_route_models(route,variant=0): <NEW_LINE> <INDENT> all_stops = prep_data(route) <NEW_LINE> from dbanalysis.classes import stop_link_model as slm <NEW_LINE> stops_dictionary = json.loads(open('/home/student/dbanalysis/stops_trimmed.json','r').read()) <NEW_LINE> rts_dictionary = rts=json.loads(open('/home/stude... | For a variant of a route, construct a set of models representing that route | 625941c58c3a8732951583c2 |
def Verify(self, completely=False): <NEW_LINE> <INDENT> res = super(Block, self).Verify() <NEW_LINE> if not res: <NEW_LINE> <INDENT> return False <NEW_LINE> <DEDENT> logger.debug("Verifying BLOCK!!") <NEW_LINE> from neo.Blockchain import GetBlockchain, GetConsensusAddress <NEW_LINE> if self.Transactions[0].Type != Tran... | Verify the integrity of the block.
Args:
completely: (Not functional at this time).
Returns:
bool: True if valid. False otherwise. | 625941c5099cdd3c635f0c64 |
def is_commentable_cohorted(course_key, commentable_id): <NEW_LINE> <INDENT> course = courses.get_course_by_id(course_key) <NEW_LINE> course_cohort_settings = get_course_cohort_settings(course_key) <NEW_LINE> if not course_cohort_settings.is_cohorted: <NEW_LINE> <INDENT> ans = False <NEW_LINE> <DEDENT> elif ( commentab... | Args:
course_key: CourseKey
commentable_id: string
Returns:
Bool: is this commentable cohorted?
Raises:
Http404 if the course doesn't exist. | 625941c576e4537e8c35167a |
def append(self, timeframe, new_results): <NEW_LINE> <INDENT> if set(new_results.keys()) - set(AC_TYPES): <NEW_LINE> <INDENT> raise KeyError('new_results must be a combination of ' + str(AC_TYPES)) <NEW_LINE> <DEDENT> super(TotalEnergyResults, self).append(timeframe, new_results) | Append a single result.
e.g. append(TimeFrame(start, end), {'apparent': 34, 'active': 43}) | 625941c55fdd1c0f98dc023c |
def test_error_serialization(self): <NEW_LINE> <INDENT> error_model_json = {} <NEW_LINE> error_model_json['code'] = 'testString' <NEW_LINE> error_model_json['message'] = 'testString' <NEW_LINE> error_model = Error.from_dict(error_model_json) <NEW_LINE> assert error_model != False <NEW_LINE> error_model_dict = Error.fro... | Test serialization/deserialization for Error | 625941c55166f23b2e1a5162 |
def print_sorted(self): <NEW_LINE> <INDENT> print(sorted(self)) | prints the list, but sorted | 625941c56e29344779a6261c |
def copy_to(self, mol): <NEW_LINE> <INDENT> newprops = self.__class__(mol, positions=self.positions) <NEW_LINE> for name, val in self.items(): <NEW_LINE> <INDENT> if name == 'positions': <NEW_LINE> <INDENT> continue <NEW_LINE> <DEDENT> elif hasattr(val, 'copy_to'): <NEW_LINE> <INDENT> newprops[name] = val.copy_to(mol) ... | Args:
mol (moldesign.Molecule): molecule to copy these properties to
Returns:
MolecularProperties: copied instance, associated with the new molecule | 625941c54c3428357757c332 |
def _output_accessibility_aggregated(min_travel_times, interval_num, zones, ats, output_dir='.'): <NEW_LINE> <INDENT> with open(output_dir+'/accessibility_aggregated.csv', 'w', newline='') as f: <NEW_LINE> <INDENT> time_budgets = [ 'TT_'+str(MIN_TIME_BUDGET+BUDGET_TIME_INTVL*i) for i in range(interval_num) ] <NEW_LINE... | output aggregated accessibility matrix for each agent type | 625941c5091ae35668666f69 |
def get_config(filepath="~/.twilio.cfg"): <NEW_LINE> <INDENT> expanded_path = os.path.expanduser(filepath) <NEW_LINE> if not os.path.exists(expanded_path): <NEW_LINE> <INDENT> raise Exception("cannot find file at {0}".format(expanded_path)) <NEW_LINE> <DEDENT> parser = SafeConfigParser() <NEW_LINE> parser.read(expanded... | Pull credentials. The file should look like this:
[credentials]
account=fake_account
token=fake_token
[sms]
from_number=fake_
dest_number=fake_destination_number | 625941c57d847024c06be2c3 |
def infiniteFlux(t, v, De, R, deg, x, c0, n, N): <NEW_LINE> <INDENT> Vs = inversion.stehfestCoeff(N) <NEW_LINE> rt = math.log(2.0) / t <NEW_LINE> Sum = 0 <NEW_LINE> for i in range(1, N+1): <NEW_LINE> <INDENT> s = i * rt <NEW_LINE> Sum = Sum + Vs[i - 1] * (((c0 * n) / s) * ((v - (De * ((v - ((v ** 2) + (4 * De * R * (s ... | t is time (T), v is velocity (L/T), De is effective hydrodynamic dispersion (including diffusion) (L^2/T),
R is retardation (-), deg is first order decay constant (1/T), x is position along path (L),
c0 is source concentration (M/L^3), n is effective porosity (-), N is input variable stehfestCoeff().
Return flux at po... | 625941c53539df3088e2e354 |
def _webassets_cmd(cmd): <NEW_LINE> <INDENT> from webassets.script import CommandLineEnvironment <NEW_LINE> logger = logging.getLogger('webassets') <NEW_LINE> logger.addHandler(logging.StreamHandler()) <NEW_LINE> logger.setLevel(logging.DEBUG) <NEW_LINE> cmdenv = CommandLineEnvironment(current_app.jinja_env.assets_envi... | Helper to run a webassets command. | 625941c5d53ae8145f87a27b |
def save(image, filename): <NEW_LINE> <INDENT> mosaic = pil_image_from_lists(image) <NEW_LINE> output_dir = os.path.dirname(filename) <NEW_LINE> if os.path.exists(filename): <NEW_LINE> <INDENT> print("Error: can not save to file: ", filename, ". File already exists.") <NEW_LINE> return <NEW_LINE> <DEDENT> if output_dir... | save an image (as list of lists) to a file | 625941c5de87d2750b85fd9a |
def validate_base32(number): <NEW_LINE> <INDENT> number = compact(number) <NEW_LINE> if len(number) != 6: <NEW_LINE> <INDENT> raise InvalidLength() <NEW_LINE> <DEDENT> return validate_base10(from_base32(number)) | Check if a string is a valid BASE32 representation of an AIC. | 625941c566656f66f7cbc1b3 |
def __init__(self, parameters): <NEW_LINE> <INDENT> self.parameters = dict() <NEW_LINE> self.parameters.update(parameters) | Constructor | 625941c53317a56b86939c65 |
def get_survey_contacts_0(self, id, **kwargs): <NEW_LINE> <INDENT> kwargs['_return_http_data_only'] = True <NEW_LINE> if kwargs.get('callback'): <NEW_LINE> <INDENT> return self.get_survey_contacts_0_with_http_info(id, **kwargs) <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> (data) = self.get_survey_contacts_0_with_http_... | Get Survey Contacts
Get a list of contacts for a given survey.
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please define a `callback` function
to be invoked when receiving the response.
>>> def callback_function(response):
>>> pprint(response)
>>>
>>> thread = api.... | 625941c57047854f462a1415 |
def format(self, force): <NEW_LINE> <INDENT> return "%s %s" % (self.__typeid.format(force), "".join(map(lambda x: x.format(force), self._children))) | Return formatted output. | 625941c51f037a2d8b946207 |
def format_kvps(mapping, prefix=''): <NEW_LINE> <INDENT> kvp_list = [] <NEW_LINE> for k, v in mapping.iteritems(): <NEW_LINE> <INDENT> if hasattr(v, 'keys'): <NEW_LINE> <INDENT> new_prefix = prefix + '.' + k if prefix else k <NEW_LINE> kvps = format_kvps(v, prefix=new_prefix) <NEW_LINE> kvp_list.append(kvps) <NEW_LINE>... | Formats a mapping as key=value pairs.
Values may be strings, numbers, or nested mappings.
Nested mappings, e.g. host:{ip:'0.0.0.1',name:'the.dude.abides'},
will be handled by prefixing keys in the sub-mapping with the key,
e.g.: host.ip=0.0.0.1 host.name=the.dude.abides. | 625941c5f8510a7c17cf9705 |
def build_pipeline(inputs, output_dir): <NEW_LINE> <INDENT> def _pipeline(root): <NEW_LINE> <INDENT> interactions = ( create_data.read_interactions(root, inputs, name="input") | "DropKey" >> beam.Map(beam.Values()) | "ToRetrievalExample" >> beam.FlatMap(_to_retrieval_interaction_fn) | "Reshuffle" >> beam.transforms.uti... | Builds the pipeline. | 625941c57b180e01f3dc480a |
def projection_onto_weighted_l1_norm_ball(y, weights, radius): <NEW_LINE> <INDENT> y_sign = np.sign(y) <NEW_LINE> y_proj = y_sign * y <NEW_LINE> active_index = range(len(y)) <NEW_LINE> while True: <NEW_LINE> <INDENT> y_proj_active = y_proj[active_index] <NEW_LINE> weights_active = weights[active_index] <NEW_LINE> x_pro... | projection onto a weighted L1-ball
formally,
min 0.5 * ||x - y||_2^2
s.t. weights^T |x| = radius,
where |x|_i = |x_i|
:parameter radius: the radius of the weighted L1-ball
:parameter weights: the weight vector
:parameter y: the point to be projected
:return: x_proj: projection of y onto the weighted L1 ball | 625941c50a366e3fb873e822 |
def avoid_lint_errors(): <NEW_LINE> <INDENT> pass | No-op function to avoid "unused import" linting errors.
Marking the import with # noqa would achieve the same effect,
but also disable IDE suggestions. | 625941c52ae34c7f2600d13b |
def remove(self, irc, msg, args, words): <NEW_LINE> <INDENT> set = self.words() <NEW_LINE> for word in words: <NEW_LINE> <INDENT> set.discard(word) <NEW_LINE> <DEDENT> self.words.setValue(set) <NEW_LINE> irc.replySuccess() | <word> [<word> ...]
Removes <word>s from the list of words being censored. | 625941c56fece00bbac2d746 |
def __init__(self, consumer, token, http_request, oauth_parameters={}, realm = ''): <NEW_LINE> <INDENT> if not consumer: <NEW_LINE> <INDENT> report_error("no consumer specified") <NEW_LINE> <DEDENT> if len(set(oauth_parameters.keys()) & set(OAuthRequest.DEFAULT_PARAMETERS)) > 0: <NEW_LINE> <INDENT> report_error("some o... | Create an OAuth request, independent of transport code.
consumer and token are for oauth authentication
consumer cannot be null, token may be null but only if explicitly specified
if token is null, then the request will be consumer-signed only,
e.g. for requesting a request token.
method and url indicate the resource... | 625941c594891a1f4081bab2 |
def generate_tree_postorder(node_lst, root_index): <NEW_LINE> <INDENT> return generate_tree_postorder_rec(node_lst, root_index)[1] | Return the root of the Huffman tree corresponding
to node_lst[root_index].
The function assumes that the list represents a tree in postorder.
@param list[ReadNode] node_lst: a list of ReadNode objects
@param int root_index: index in the node list
@rtype: HuffmanNode
>>> lst = [ReadNode(0, 5, 0, 7), ReadNode(0, 10, 0... | 625941c523e79379d52ee56e |
def bprop(self, deltas, alpha=1.0, beta=0.0): <NEW_LINE> <INDENT> self.dW[:] = 0 <NEW_LINE> if self.in_deltas is None: <NEW_LINE> <INDENT> self.in_deltas = get_steps(deltas, self.out_shape) <NEW_LINE> self.prev_in_deltas = self.in_deltas[-1:] + self.in_deltas[:-1] <NEW_LINE> <DEDENT> params = (self.xs, self.h, self.h_p... | Backward propagation of errors through recurrent layer.
Arguments:
deltas (Tensor): tensors containing the errors for
each step of model unrolling. Expected 2D shape
is (output_size, sequence_length * batch_size)
alpha (float, optional): scale to apply to input for ac... | 625941c5d268445f265b4e78 |
def p_expr_block_tail_empty(p): <NEW_LINE> <INDENT> p[0] = [] | expr_block_tail : | 625941c5ad47b63b2c509f89 |
def __init__(self,timeout=2): <NEW_LINE> <INDENT> self.timeout = timeout | :rtype: | 625941c5236d856c2ad447e2 |
def __init__(self, model: foolbox.models.Model, criterion: foolbox.criteria.Criterion, p : float, directions: int, search_steps: int, search_epsilon: float, finetuning_precision: float, max_batch_size: int = 50, random_state: np.random.RandomState = None): <NEW_LINE> <INDENT> foolbox_distance = utils.p_to_foolbox(p) <N... | Initializes the attack.
Parameters
----------
model : foolbox.models.Model
The model that will be attacked. Can be overriden during the call by passing
a foolbox.Adversarial with a different model.
criterion : foolbox.criteria.Criterion
The criterion that will be used. Can be overriden during the call by p... | 625941c530bbd722463cbdce |
def simulate(original_status, action): <NEW_LINE> <INDENT> status = original_status.clone() <NEW_LINE> simulate_in_place(status, action) <NEW_LINE> return status | Simulate a movement given a Status.
Arguments:
original_status (Status): the game status. This will not be modified.
action (Action): the action to simulate.
Returns:
Status: the next status (a new object). | 625941c560cbc95b062c654c |
def train_filter_test(self): <NEW_LINE> <INDENT> return self.batch_peters_filter( self.test_set_X, self.test_set_domain, self.train_pool_X, self.train_pool_y, self.train_pool_domain, self.Base_Classifier, cluster_factor=self.cluster_factor, rand_seed=self.rand_seed, classifier_params=self.classifier_params ) | Train classifier on filtered training data using the k-means heuristic
and return class predictions and class-prediction probabilities. This
method calls batch_peters_filter with class attributes.
Returns:
confidence: List of class-prediction probabilities, the ith entry
of which gives the confidence for t... | 625941c58e7ae83300e4afd5 |
def z_detect(a, nsta): <NEW_LINE> <INDENT> m = len(a) <NEW_LINE> sta = np.zeros(len(a), dtype=np.float64) <NEW_LINE> pad_sta = np.zeros(nsta) <NEW_LINE> for i in range(nsta): <NEW_LINE> <INDENT> sta = sta + np.concatenate((pad_sta, a[i:m - nsta + i] ** 2)) <NEW_LINE> <DEDENT> a_mean = np.mean(sta) <NEW_LINE> a_std = np... | Z-detector.
:param nsta: Window length in Samples.
.. seealso:: [Withers1998]_, p. 99 | 625941c5167d2b6e31218b9f |
def levelOrder(self, root: TreeNode) -> List[List[int]]: <NEW_LINE> <INDENT> if root is None: <NEW_LINE> <INDENT> return [] <NEW_LINE> <DEDENT> result = [] <NEW_LINE> def add_to_result(level, node): <NEW_LINE> <INDENT> if level > len(result) - 1: <NEW_LINE> <INDENT> result.append([]) <NEW_LINE> <DEDENT> result[level].a... | 递归法 | 625941c57b25080760e39463 |
def __init__(self, model, periods=1, freq='30min', lag_X=True): <NEW_LINE> <INDENT> super(self.__class__, self).__init__(model, periods, freq) <NEW_LINE> self.lag_X = lag_X | Markov lagged dataset
:periods: Number of timesteps to lag by | 625941c5711fe17d82542378 |
def opt_out_recipient(self, list_id, email='', columns=None, mailing_id=None, recipient_id=None, job_id=None): <NEW_LINE> <INDENT> root, action_node = self._envelope('OptOutRecipient') <NEW_LINE> self._insert_text_node('LIST_ID', str(list_id), action_node) <NEW_LINE> if email: <NEW_LINE> <INDENT> self._insert_text_node... | Opt-out a contact. The last three parameters is for Opt-out
at mailing level.
:params list_id: Identifies the ID of the database
from which to opt out the contact.
:params email: The contact email address to opt out.
:params columns: Optional dict defining optional <COLUMN> tags.
:params mailing_id: ... | 625941c5ff9c53063f47c1fe |
def test_ordered_number_keys(self): <NEW_LINE> <INDENT> self.skip["4"] = True <NEW_LINE> self.skip["2"] = True <NEW_LINE> self.skip["5"] = True <NEW_LINE> self.skip["1"] = True <NEW_LINE> self.skip["3"] = True <NEW_LINE> keys = self.skip.keys() <NEW_LINE> self.assertEqual(keys[0], "1") <NEW_LINE> self.assertEqual(keys[... | Test that .keys() returns keys in sorted order with numbers | 625941c58e7ae83300e4afd6 |
def test_logger_output(self): <NEW_LINE> <INDENT> docker_instance = Docker() <NEW_LINE> docker_instance.pull('gentoo', 'stage3-amd64') <NEW_LINE> docker_instance.add_sh_command("echo Log Text!") <NEW_LINE> docker_instance.run() <NEW_LINE> self.assertEqual(docker_instance.log, "Log Text!\n") | Test the log file output | 625941c5a05bb46b383ec82d |
def similar_images(orig_image, new_image, tol=1.0e-6): <NEW_LINE> <INDENT> orig_image = orig_image.convert('RGB') <NEW_LINE> new_image = orig_image.convert('RGB') <NEW_LINE> orig_data = np.array(orig_image, dtype=np.int16) <NEW_LINE> new_data = np.array(new_image, dtype=np.int16) <NEW_LINE> changed = new_data - orig_da... | Compare two PIL image objects and return a boolean True/False of whether
they are similar (True) or not (False). "tol" is a unitless float between
0-1 that does not depend on the size of the images. | 625941c55f7d997b87174aa0 |
def test_claiming_pending_request(self, client): <NEW_LINE> <INDENT> name = 'test claiming pending request' <NEW_LINE> template = 'test claiming pending request template' <NEW_LINE> resp = self._setup_user(name='originator', email='originator@localhost.local') <NEW_LINE> originator = resp.content['id'] <NEW_LINE> resp ... | Test case for updating pending request to claimed | 625941c585dfad0860c3ae64 |
def testCase040(self): <NEW_LINE> <INDENT> global jval <NEW_LINE> global sval <NEW_LINE> global configdata <NEW_LINE> global appname <NEW_LINE> global schemafile <NEW_LINE> kargs = {} <NEW_LINE> kargs['datafile'] = datafile <NEW_LINE> kargs['schemafile'] = schemafile <NEW_LINE> kargs['nodefaultpath'] = True <NEW_LINE> ... | Replace object with a new including validator - ConfigData.MODE_SCHEMA_DRAFT3.
| 625941c538b623060ff0adf8 |
def smallest(self): <NEW_LINE> <INDENT> heap = self._heap <NEW_LINE> v, k = heap[0] <NEW_LINE> while k not in self or self[k] != v: <NEW_LINE> <INDENT> heappop(heap) <NEW_LINE> v, k = heap[0] <NEW_LINE> <DEDENT> return PriorityValuePair(v, k) | Return the item with the lowest priority as a named tuple
(priority, value).
Raises IndexError if the object is empty. | 625941c5baa26c4b54cb112b |
def bin_median_3d(mat, window=10, exclude_nans=True): <NEW_LINE> <INDENT> T, d1, d2, d3 = np.shape(mat) <NEW_LINE> if T < window: <NEW_LINE> <INDENT> window = T <NEW_LINE> <DEDENT> num_windows = np.int(old_div(T, window)) <NEW_LINE> num_frames = num_windows * window <NEW_LINE> if exclude_nans: <NEW_LINE> <INDENT> img =... | compute median of 4D array in along axis o by binning values
Args:
mat: ndarray
input 4D matrix, (T, h, w, z)
window: int
number of frames in a bin
Returns:
img:
median image
Raises:
Exception 'Path to template does not exist:'+template | 625941c563b5f9789fde70ef |
def exportThisDynamicProperties(self): <NEW_LINE> <INDENT> l_xml = [] <NEW_LINE> for l_dp in self.getDynamicPropertiesTool().getDynamicSearchableProperties(self.meta_type): <NEW_LINE> <INDENT> l_xml.append('%s="%s"' % (self.utXmlEncode(l_dp.id), self.utXmlEncode(self.getPropertyValue(l_dp.id)))) <NEW_LINE> <DEDENT> ret... | exports dynamic properties | 625941c5435de62698dfdc56 |
def calibrate_freq_twice_device(freqchange: list) -> int: <NEW_LINE> <INDENT> seenfreqs={} <NEW_LINE> frequency=0 <NEW_LINE> while True: <NEW_LINE> <INDENT> for freq in freqchange: <NEW_LINE> <INDENT> if frequency not in seenfreqs.keys(): <NEW_LINE> <INDENT> seenfreqs[frequency]=1 <NEW_LINE> <DEDENT> elif seenfreqs[fre... | Returns the first frequency to be seen twice given a list of changes.
Note: freqchange is a list of strs prefixed with a + or -. | 625941c5283ffb24f3c5590d |
def is_valid_move(self, block, direction): <NEW_LINE> <INDENT> block += direction <NEW_LINE> hor_move = 0 <= block.inf.x and self.width > block.sup.x <NEW_LINE> ver_move = 0 <= block.inf.y and self.height > block.sup.y <NEW_LINE> return hor_move and ver_move | Verifies if the new position for the given block is valid
according to the dimensions of the discrete grid.
:param block:
:param direction:
:return: | 625941c530c21e258bdfa4a6 |
def test_underline(self): <NEW_LINE> <INDENT> self.assertEqual( text.assembleFormattedText(A.underline["Hello, world."]), "\x1b[4mHello, world.", ) | The underline formatting attribute, L{A.underline}, emits the VT102
control sequence to enable underlining when flattened. | 625941c57cff6e4e81117990 |
def check_presence_download(filename, backup_url): <NEW_LINE> <INDENT> import os <NEW_LINE> if not os.path.exists(filename): <NEW_LINE> <INDENT> from .readwrite import download_progress <NEW_LINE> dr = os.path.dirname(filename) <NEW_LINE> try: <NEW_LINE> <INDENT> os.makedirs(dr) <NEW_LINE> <DEDENT> except FileExistsErr... | Check if file is present otherwise download. | 625941c54e4d5625662d43e4 |
def reveal_computer_grid(self): <NEW_LINE> <INDENT> j = 0 <NEW_LINE> print(' 1 2 3 4 5 6 7 8 9 10') <NEW_LINE> letters = ['J ','I ','H ','G ','F ','E ','D ','C ','B ','A '] <NEW_LINE> for element in self.computer_grid: <NEW_LINE> <INDENT> to_print = letters.pop() + '|' <NEW_LINE> j += 1 <NEW_LINE> ... | Reveals the full computer grid. For testing purposes | 625941c5cc40096d6159595b |
def calculate_call_graph_distance(static_call_graph, method_index, change_a, change_b): <NEW_LINE> <INDENT> ln_a = change_a.line_number <NEW_LINE> ln_b = change_b.line_number <NEW_LINE> method_a = None <NEW_LINE> method_b = None <NEW_LINE> try: <NEW_LINE> <INDENT> for line_range, method_name in method_index[change_a.so... | Calcualates the distance between two changes in the call graph.
This value is defined as 1 divided by the number of edges between the two nodes.
:param static_call_graph: The static call graph to traverse.
:type static_call_graph: dict[str, list[str]]
:param method_index: An index of all the methods and line numbers th... | 625941c531939e2706e4ce76 |
def clean_duplicate_entries(refined_tag_bulk): <NEW_LINE> <INDENT> index = 0 <NEW_LINE> for element in refined_tag_bulk: <NEW_LINE> <INDENT> if index < len(refined_tag_bulk): <NEW_LINE> <INDENT> if refined_tag_bulk[index] in refined_tag_bulk[index-1]: <NEW_LINE> <INDENT> del refined_tag_bulk[index-1] <NEW_LINE> <DEDENT... | This function is my solution to the problem of data tables being nested
within a table, so when I search for the tables containing words I want,
it also contains a virtually identical parent table filled with some
bloat I do not want. The ordering of the tables is such that narrow_tags()
will always produce an even n... | 625941c51b99ca400220aabb |
def format_alarm_time(alarm_time): <NEW_LINE> <INDENT> if not isinstance(alarm_time, datetime.time): <NEW_LINE> <INDENT> alarm_time = datetime.datetime(alarm_time).time() <NEW_LINE> <DEDENT> return alarm_time.strftime('%I:%M %p') | Formats a datetime.time object for human-friendly output.
Used within Jinja templates. | 625941c571ff763f4b549693 |
def get_graphic_set_lookups(game_version): <NEW_LINE> <INDENT> game_edition = game_version[0] <NEW_LINE> if game_edition.game_id == "ROR": <NEW_LINE> <INDENT> return ror_internal.GRAPHICS_SET_LOOKUPS <NEW_LINE> <DEDENT> if game_edition.game_id == "AOC": <NEW_LINE> <INDENT> return aoc_internal.GRAPHICS_SET_LOOKUPS <NEW_... | Return the name lookup dicts for civ graphic sets.
:param game_version: Game edition and expansions for which the lookups should be.
:type game_version: tuple | 625941c59f2886367277a898 |
def forward(self,feat_conv,hidden): <NEW_LINE> <INDENT> batch_size,c,w,h = feat_conv.size() <NEW_LINE> c_ctx = self.channle_attention(feat_conv,hidden) <NEW_LINE> weighted_feat_conv = feat_conv.reshape(batch_size,c,-1) * c_ctx.unsqueeze(2) * c <NEW_LINE> weighted_feat_conv = weighted_feat_conv.reshape(batch_size,channl... | fea_conv batch * c * w * h
c_ctx batch * c
s_ctx batch * (w*h) | 625941c5507cdc57c6306ce2 |
def _fail_if_publish_binary_not_installed(binary, publish_target, install_link): <NEW_LINE> <INDENT> if not shutil.which(binary): <NEW_LINE> <INDENT> click.secho( "Publishing to {publish_target} requires {binary} to be installed and configured".format( publish_target=publish_target, binary=binary, ), bg='red', fg='whit... | Exit (with error message) if ``binary` isn't installed | 625941c5d6c5a10208144054 |
def __init__(self, handler, env): <NEW_LINE> <INDENT> self.handler = handler <NEW_LINE> self.env = env | Initialize the context.
Args:
handler: controllers.utils.BaseHandler. The server runtime.
env: dict. A dict of values shared shared between instances of
the tag on the same page. Values stored in this dict will be
available to subsequent calls to render() on the same page,
and to the ca... | 625941c5f548e778e58cd587 |
def copy_key(self, new_key_name, src_bucket_name, src_key_name, metadata=None): <NEW_LINE> <INDENT> src = '%s/%s' % (src_bucket_name, urllib.quote(src_key_name)) <NEW_LINE> if metadata: <NEW_LINE> <INDENT> headers = {self.connection.provider_headers.copy_source_header : src, self.connection.provider_headers.metadata_di... | Create a new key in the bucket by copying another existing key.
:type new_key_name: string
:param new_key_name: The name of the new key
:type src_bucket_name: string
:param src_bucket_name: The name of the source bucket
:type src_key_name: string
:param src_key_name: The name of the source key
:type metadata: dict
... | 625941c555399d3f055886be |
def test_sha_inserts(self): <NEW_LINE> <INDENT> self.do_test_sha_inserts(self.m, self.k, 16) <NEW_LINE> self.do_test_sha_inserts(14, 8, 16) <NEW_LINE> self.do_test_sha_inserts(13, 8, 16) <NEW_LINE> self.do_test_sha_inserts(12, 8, 16) <NEW_LINE> self.do_test_sha_inserts(14, 7, 16) <NEW_LINE> self.do_test_sha_inserts(13,... | Test BloomSHA for various parameter settings. | 625941c5377c676e912721b3 |
def confusion_matrix (actual, desired, outp_length): <NEW_LINE> <INDENT> confusion = np.zeros((outp_length, outp_length)) <NEW_LINE> for indx in range(len(actual)): <NEW_LINE> <INDENT> i = desired[indx].tolist().index(1) <NEW_LINE> j = actual[indx].argmax() <NEW_LINE> confusion[i][j] += 1 <NEW_LINE> <DEDENT> return con... | Gets confusion matrix for a networks output. | 625941c5498bea3a759b9aba |
def cmd_auth(self,*args,**kwargs): <NEW_LINE> <INDENT> data = args[0] <NEW_LINE> print('cmd_auth',data) <NEW_LINE> if data.get('username') is None or data.get('password') is None: <NEW_LINE> <INDENT> self.send_response(252) <NEW_LINE> <DEDENT> ret = self.authenticate(data.get('username'),data.get('password')) <NEW_LINE... | 检查接收参数合法性 | 625941c50a50d4780f666e9b |
@sender("coffee") <NEW_LINE> def coffee(repl, text, view=None): <NEW_LINE> <INDENT> default_sender(repl, text.replace("\n", u'\uFF00') + "\n", view) | use CoffeeScript multiline hack
http://coffeescript.org/documentation/docs/repl.html | 625941c5f7d966606f6aa00d |
def read_temp_c(): <NEW_LINE> <INDENT> global last_reading <NEW_LINE> last_reading = random.uniform(0, 100) <NEW_LINE> return last_reading | Read the temp in Celsius
Returns
-------
temp: float
The temp from the sensor in Celsius.
Raises
------
DeviceReadError
Unable to read values from the temp sesnsor. | 625941c58c0ade5d55d3e9c4 |
def test_noIndicesForNonDataNode(self): <NEW_LINE> <INDENT> self.assertNotIn( 'es.nodes.es-proxy.indices.docs.count', self.result) <NEW_LINE> self.assertNotIn( 'es.nodes.logstash.indices.docs.count', self.result) <NEW_LINE> self.assertNotIn( 'es.nodes.graylog2.indices.docs.count', self.result) | Non data nodes do not have indices paths. | 625941c58e71fb1e9831d7b4 |
def login(self): <NEW_LINE> <INDENT> uname = self.usernameInput.get() <NEW_LINE> passw = self.passwordInput.get() <NEW_LINE> self.usernameInput.delete(0, len(self.usernameInput.get())) <NEW_LINE> self.passwordInput.delete(0, len(self.passwordInput.get())) <NEW_LINE> if self.checkBoxState.get() == 0: <NEW_LINE> <INDENT>... | Provera username-a i password-a i prikazivanje sledeceg odgovrajuceg frejma | 625941c524f1403a92600b72 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.