code stringlengths 4 4.48k | docstring stringlengths 1 6.45k | _id stringlengths 24 24 |
|---|---|---|
def p_names(self, p): <NEW_LINE> <INDENT> if len(p) == 2: <NEW_LINE> <INDENT> p[0] = [p[1]] <NEW_LINE> return <NEW_LINE> <DEDENT> assert isinstance(p[1], list) <NEW_LINE> for n in p[1]: <NEW_LINE> <INDENT> if n == p[3]: <NEW_LINE> <INDENT> logging.error('[%s:%d] Duplicated state value: %s', self._filename, p.lineno(3),... | names : names ',' NAME
| NAME | 625941b85fc7496912cc37e0 |
def test_give_default_raise(self): <NEW_LINE> <INDENT> self.assertEqual(self.my_raise.give_raise(),40000) | проверка стандартной прибавки к окладу | 625941b81f037a2d8b946059 |
def __init__(self, pmf, player, name=''): <NEW_LINE> <INDENT> thinkbayes.Suite.__init__(self, pmf, name=name) <NEW_LINE> self.player = player | Constructs the suite.
pmf: prior distribution of price
player: Player object
name: string | 625941b8b830903b967e9771 |
def post(self, request, task_id): <NEW_LINE> <INDENT> self._validate_teacher_user(request) <NEW_LINE> task = get_object_or_404(Task, id=task_id) <NEW_LINE> responses = task.responses <NEW_LINE> scores = request.POST.getlist('inputs[]') <NEW_LINE> for i in range(len(responses)): <NEW_LINE> <INDENT> response = responses[... | Save changes to task scores. | 625941b891f36d47f21ac351 |
def test_change_deposit_schema_fails(app, draft_deposits): <NEW_LINE> <INDENT> with app.app_context(): <NEW_LINE> <INDENT> deposit = Deposit.get_record(draft_deposits[0].deposit_id) <NEW_LINE> del deposit['$schema'] <NEW_LINE> with pytest.raises(AlteredRecordError): <NEW_LINE> <INDENT> deposit.commit() | Test updating the $schema field fails. | 625941b8cc40096d615957ae |
def create(self, subsection, block_structure=None, read_only=False): <NEW_LINE> <INDENT> self._log_event( log.info, u"create, read_only: {0}, subsection: {1}".format(read_only, subsection.location) ) <NEW_LINE> block_structure = self._get_block_structure(block_structure) <NEW_LINE> subsection_grade = self._get_saved_gr... | Returns the SubsectionGrade object for the student and subsection.
If block_structure is provided, uses it for finding and computing
the grade instead of the course_structure passed in earlier.
If read_only is True, doesn't save any updates to the grades. | 625941b87d43ff24873a2afe |
def culaDeviceDgesvd(jobu, jobvt, m, n, a, lda, s, u, ldu, vt, ldvt): <NEW_LINE> <INDENT> status = _libcula.culaDeviceDgesvd(jobu, jobvt, m, n, int(a), lda, int(s), int(u), ldu, int(vt), ldvt) <NEW_LINE> culaCheckStatus(status) | SVD decomposition. | 625941b821a7993f00bc7b44 |
def draw_geff(t, title, h_name, h_bins, to_draw, denom_cut, extra_num_cut, opt = "", color = kBlue, marker_st = 1, marker_sz = 1.): <NEW_LINE> <INDENT> t.Draw(to_draw + ">>num_" + h_name + h_bins, TCut("%s && %s" %(denom_cut.GetTitle(), extra_num_cut.GetTitle())), "goff") <NEW_LINE> num = TH1F(gDirectory.Get("num_" + h... | Make an efficiency plot | 625941b8187af65679ca4f78 |
def get_scrambled(self, **kwargs): <NEW_LINE> <INDENT> kwargs['_return_http_data_only'] = True <NEW_LINE> if kwargs.get('async_req'): <NEW_LINE> <INDENT> return self.__get_scrambled_with_http_info(**kwargs) <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> (data) = self.__get_scrambled_with_http_info(**kwargs) <NEW_LINE> r... | get_scrambled # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.get_scrambled(async_req=True)
>>> result = thread.get()
:param async_req: bool
:param str value:
:return: str
If the method is called asynchro... | 625941b8cdde0d52a9e52e8a |
def setup_logging( default_path='logger_config.yaml', default_level=logging.INFO, env_key='LOG_CFG' ): <NEW_LINE> <INDENT> path = default_path <NEW_LINE> value = os.getenv(env_key, None) <NEW_LINE> if value: <NEW_LINE> <INDENT> path = value <NEW_LINE> <DEDENT> if os.path.exists(path): <NEW_LINE> <INDENT> with open(path... | Setup logging configuration | 625941b89f2886367277a6ec |
def __init__(self, seller_id='00-00000'): <NEW_LINE> <INDENT> self.id = seller_id + hex(timegm(datetime.datetime.now().utctimetuple()))[3:] | Generate a unique id with hexadecimal timestamp | 625941b8d7e4931a7ee9dd76 |
def resetError(self): <NEW_LINE> <INDENT> self.mError = false <NEW_LINE> return | Clear the previous error. | 625941b891af0d3eaac9b86f |
def findPlant(self, name): <NEW_LINE> <INDENT> if type(name) is str: <NEW_LINE> <INDENT> if name in self._plants: <NEW_LINE> <INDENT> return self._plants[name] <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> return None <NEW_LINE> <DEDENT> <DEDENT> else : <NEW_LINE> <INDENT> raise TypeError("Param 'name' given is not of ... | Find the plant in the dictionary having the given name
return None if there is no plant with this name in the dictionary | 625941b8a934411ee37514f6 |
def test_spell_activity_location_id_field(self): <NEW_LINE> <INDENT> field = self.spell_activity_record.find('field[@name=\'location_id\']') <NEW_LINE> self.assertEqual(field.attrib['ref'], 'nhc_def_conf_location_wa_b1', 'Incorrect location id on activity') | Make sure the location id field for the spell activity is correct | 625941b826068e7796caeb33 |
def create(self, context, metadata, data=None): <NEW_LINE> <INDENT> image_id = str(metadata.get('id', uuid.uuid4())) <NEW_LINE> metadata['id'] = image_id <NEW_LINE> if image_id in self.images: <NEW_LINE> <INDENT> raise exception.Duplicate() <NEW_LINE> <DEDENT> self.images[image_id] = copy.deepcopy(metadata) <NEW_LINE> ... | Store the image data and return the new image id.
:raises: Duplicate if the image already exist. | 625941b87c178a314d6ef2b4 |
def SCP(self, req: "_UPS", context: "PresentationContext") -> None: <NEW_LINE> <INDENT> if isinstance(req, N_CREATE): <NEW_LINE> <INDENT> self._n_create_scp(req, context) <NEW_LINE> <DEDENT> elif isinstance(req, N_EVENT_REPORT): <NEW_LINE> <INDENT> self._n_event_report_scp(req, context) <NEW_LINE> <DEDENT> elif isinsta... | The SCP implementation for Unified Procedure Step Service Class.
Parameters
----------
req : dimse_primitives.N_CREATE or C_FIND or N_SET or N_GET or N_EVENT_REPORT or N_ACTION
The N-CREATE, C-FIND, N-SET, N-GET, N-ACTION or N-EVENT-REPORT
request primitive sent by the peer.
context : presentation.Presentation... | 625941b8a05bb46b383ec688 |
def get_filelist(self, input_params, settings): <NEW_LINE> <INDENT> target_date = input_params['toi'] <NEW_LINE> access_path1 = settings['dataset.'+input_params['dataset']] <NEW_LINE> pos1 = str.index(access_path1, '://') <NEW_LINE> access_path = access_path1[pos1+3:] <NEW_LINE> base_flist = [] <NEW_LINE> base_mask_fli... | gets the listing of filenames of available: Base files, GFP files and Mask files | 625941b8bf627c535bc13031 |
@api_view(['POST']) <NEW_LINE> @permission_classes([IsAuthenticated]) <NEW_LINE> def tweet_create_view(request, *args, **kwargs): <NEW_LINE> <INDENT> serializer = TweetCreateSerializer(data=request.data) <NEW_LINE> if serializer.is_valid(raise_exception=True): <NEW_LINE> <INDENT> serializer.save(user=request.user) <NEW... | DRF creates tweet
returns tweet created | 625941b810dbd63aa1bd2a0a |
def mageck_printdict(dict0,args,sgdict,sampledict,sampleids): <NEW_LINE> <INDENT> dfmt="{:.5g}" <NEW_LINE> ofile=open(args.output_prefix+'.normalized.txt','w') <NEW_LINE> mapres_list=['']*len(sampledict) <NEW_LINE> for (k,v) in sampledict.items(): <NEW_LINE> <INDENT> mapres_list[v]=k <NEW_LINE> <DEDENT> if len(sampledi... | Write the normalized read counts to file
Parameters
----------
dict0 : dict
a {sgRNA: [read counts]} structure
args : class
a argparse class
sgdict: dict
a {sgrna:gene} dictionary
sampledict: dict
a {sample name: index} dict
sampleids: list
a list of sample index. Should include control+treatment | 625941b8baa26c4b54cb0f7e |
def lookup(self, symbol): <NEW_LINE> <INDENT> return self.symbols.get(symbol) | Look up the srcloc for a name in the symbol table. | 625941b87047854f462a1268 |
def _dereification_agenda(g, co_map): <NEW_LINE> <INDENT> agenda = {} <NEW_LINE> variables = g.variables() <NEW_LINE> fixed = {tgt for _, _, tgt in g.edges()}.union([g.top]) <NEW_LINE> for triple in g.triples(relation='instance'): <NEW_LINE> <INDENT> if triple.source not in fixed and triple.target in co_map: <NEW_LINE>... | Find eligible dereifications and return the replacements. | 625941b85e10d32532c5ed8a |
def get_due(self, index): <NEW_LINE> <INDENT> return self.__getitem__(index)['due'] | Return due of task with defined index. | 625941b885dfad0860c3acb4 |
def factorial(n): <NEW_LINE> <INDENT> if n == 1: <NEW_LINE> <INDENT> return 1 <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> return n * factorial(n-1) | Computes the factorial using recursion | 625941b8d486a94d0b98dfa8 |
def delete_list(self, filename_list): <NEW_LINE> <INDENT> remote_list = self.list() <NEW_LINE> for filename in filename_list[:]: <NEW_LINE> <INDENT> c = re.compile(r'%s(?:\.vol[\d+]*)?\.par2' % filename) <NEW_LINE> for remote_filename in remote_list: <NEW_LINE> <INDENT> if c.match(remote_filename): <NEW_LINE> <INDENT>... | delete given filename_list and all .par2 files that belong to them
| 625941b84428ac0f6e5ba64d |
def test_get_tag(self): <NEW_LINE> <INDENT> expected = self.tags <NEW_LINE> actual = self.post.tags <NEW_LINE> self.assertEqual(expected, actual) | Get list of tags from Blog Post | 625941b8a17c0f6771cbdeaf |
def record_statistic(self, event, record): <NEW_LINE> <INDENT> if event not in self.statistics: <NEW_LINE> <INDENT> self.statistics[event] = [record] <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> self.statistics[event].append(record) | Record a stat. | 625941b830bbd722463cbc1e |
def create_crawl_request(session: Session, crawl_uuid: UUID, request: Request): <NEW_LINE> <INDENT> upsert_url(session, request.url) <NEW_LINE> crawl_request = CrawlRequest( crawl_uuid=crawl_uuid, url_uuid=request.url.url_uuid, requested=datetime.utcnow().replace(tzinfo=timezone.utc), got_response=False, ) <NEW_LINE> s... | Record a request that was made | 625941b876d4e153a657e98b |
def sum_counts_by_consensus(otu_table, level, missing_name='Other'): <NEW_LINE> <INDENT> result = {} <NEW_LINE> sample_map = dict([(s,i) for i,s in enumerate(otu_table[0])]) <NEW_LINE> for counts, consensus in zip(otu_table[2], otu_table[3]): <NEW_LINE> <INDENT> n_ranks = len(consensus) <NEW_LINE> if n_ranks > level: <... | Returns a dict keyed by consensus, valued by otu counts
otu counts are summed together if they have the same consensus
if the consensus string doesn't reach to level, missing_name is appended on
until the taxonomy string is of length level | 625941b856ac1b37e626403b |
def log_values(args): <NEW_LINE> <INDENT> args = args.__dict__ <NEW_LINE> for section, name in zip(SECTIONS, NICE_NAMES): <NEW_LINE> <INDENT> entries = sorted((k for k in args.keys() if k.replace('_', '-') in SECTIONS[section])) <NEW_LINE> if entries: <NEW_LINE> <INDENT> LOG.debug(name) <NEW_LINE> for entry in entries:... | Log all values set in the args namespace.
Arguments are grouped according to their section and logged alphabetically
using the DEBUG log level thus --verbose is required. | 625941b8925a0f43d2549ccf |
def mocked_requests_post(url, data, *args, **kwargs): <NEW_LINE> <INDENT> class MockResponse: <NEW_LINE> <INDENT> def __init__(self, json_data, status_code): <NEW_LINE> <INDENT> self.json_data = json_data <NEW_LINE> self.status_code = status_code <NEW_LINE> <DEDENT> def json(self): <NEW_LINE> <INDENT> return self.json_... | Mock the response from the authentication server | 625941b83c8af77a43ae35fa |
def create_analysis_result( self, experiment_id: str, result_data: Dict, result_type: str, device_components: Optional[Union[List[Union[str, DeviceComponent]], str, DeviceComponent]] = None, tags: Optional[List[str]] = None, quality: Union[ResultQuality, str] = ResultQuality.UNKNOWN, verified: bool = False, result_id: ... | Create a new analysis result in the database.
Args:
experiment_id: ID of the experiment this result is for.
result_data: Result data to be stored.
result_type: Analysis result type.
device_components: Target device components, such as qubits.
tags: Tags to be associated with the analysis result.
... | 625941b87cff6e4e811177e1 |
def invalidate_memcache(self): <NEW_LINE> <INDENT> current_window = xbmcgui.getCurrentWindowId() <NEW_LINE> window = xbmcgui.Window(current_window) <NEW_LINE> try: <NEW_LINE> <INDENT> window.setProperty('memcache', pickle.dumps({}, protocol=0).decode('latin-1')) <NEW_LINE> <DEDENT> except EOFError: <NEW_LINE> <INDENT> ... | Invalidates the memory cache | 625941b8097d151d1a222cb7 |
def _repr_(self): <NEW_LINE> <INDENT> vals = self.augmentation_chain() <NEW_LINE> vals.reverse() <NEW_LINE> vals = [ "v(%s) = %s"%(v._phi, v._mu) if isinstance(v, AugmentedValuation_base) else str(v) for v in vals ] <NEW_LINE> return "[ %s ]"%", ".join(vals) | Return a printable representation of this valuation.
EXAMPLES::
sage: sys.path.append(os.getcwd()); from mac_lane import * # optional: standalone
sage: R.<u> = Qq(4, 5)
sage: S.<x> = R[]
sage: v = GaussValuation(S)
sage: w = v.augmentation(x^2 + x + u, 1/2)
sage: w # indirect doctest
[ Gau... | 625941b85166f23b2e1a4fb5 |
def collectBlockdev(): <NEW_LINE> <INDENT> data = blockdev() <NEW_LINE> devices = list() <NEW_LINE> try: <NEW_LINE> <INDENT> devlist = DiskUtil.getDevices() <NEW_LINE> cmd = "mount | awk '{if( $3==\"/\" ) print $1}' |" " sed 's/\/dev\///' | sed 's/[0-9]//'" <NEW_LINE> (status, output) = subprocess.getstatu... | function : Collector blockdev
input : NA
output : Instantion | 625941b863f4b57ef0000f7e |
def test_worker_api(self): <NEW_LINE> <INDENT> worker_name = "__abipy_worker_unittest__" <NEW_LINE> worker_dir = os.path.join(ABIPY_DIRPATH, "worker_" + worker_name) <NEW_LINE> if os.path.isdir(worker_dir): <NEW_LINE> <INDENT> remove(worker_dir) <NEW_LINE> <DEDENT> worker = AbipyWorker.new_with_name(worker_name=worker_... | Testing AbipyWorker. | 625941b8fbf16365ca6f6018 |
def AddProjectName(self, items): <NEW_LINE> <INDENT> self.projects[int(items[0])] = items[1] | Add a project name to the list of datasets. | 625941b8377c676e91272006 |
def ChkUnicomBarcode(code): <NEW_LINE> <INDENT> code = (code).strip() <NEW_LINE> if code.startswith('123706-') and len(code) == 15: <NEW_LINE> <INDENT> return True <NEW_LINE> <DEDENT> elif len(code)==8: <NEW_LINE> <INDENT> return True <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> return False | 验证是否联通公司资产编号
:rtype : Boolean
:param code:条形码 | 625941b830c21e258bdfa2f9 |
def update_known_hosts( self, node_labels=None, to_add=None, to_add_hosts=None, communication_list=None, name="http.host.update_known_hosts", ): <NEW_LINE> <INDENT> if to_add_hosts and to_add: <NEW_LINE> <INDENT> raise AssertionError( "Cannot specify both 'to_add_hosts' and 'to_add'" ) <NEW_LINE> <DEDENT> if to_add_hos... | Create a call for updating known hosts on the hosts.
node_labels list -- create success responses from these nodes
dict to_add -- records to add:
{host_name: {dest_list: [{"addr": , "port": ,}]}}
list to_add_hosts -- constructs to_add from host names
communication_list list -- create custom responses
name stri... | 625941b831939e2706e4cccc |
def toRawData(self, data): <NEW_LINE> <INDENT> pass | If a subclass needs to modify data before it is written to the cache
on disk, do it here | 625941b8e5267d203edcdafd |
def pop_back(self): <NEW_LINE> <INDENT> returnnode = self._tail <NEW_LINE> if self._tail == self._head: <NEW_LINE> <INDENT> self._head, self._tail = None,None <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> node = self._head <NEW_LINE> while node.next != self._tail: <NEW_LINE> <INDENT> node = node.next <NEW_LINE> <DEDENT... | Removes the last node of the linked list and returns it | 625941b8b7558d58953c4d77 |
def iterate_over(self, path: PathStr, ks001: KS001Str, data_type: DataTypeStr) -> Iterable[Any]: <NEW_LINE> <INDENT> yield from self.get_manager_of(data_type).iterate_over(self, path, ks001, data_type) | Open the resource specified and than perform an iteration of such resource.
The semantic of the implementation depends on the resource type loaded
:param path: the path of the resource to open
:param ks001:
:param data_type:
:return: | 625941b84d74a7450ccd401e |
def test_pubkeyhash(): <NEW_LINE> <INDENT> txn = make_synthetic_transaction(5) <NEW_LINE> indices = randomize_list(txn['vout']) <NEW_LINE> for ctr in list(range(len(indices))): <NEW_LINE> <INDENT> val = txn['vout'][indices[ctr]]['ScriptPubKey'][2] <NEW_LINE> val = rcrypt.make_RIPEMD160_hash(rcrypt.make_SHA256_hash(val)... | test a public key hash in scriptpubkey for a
valid RIPEMD-160 format | 625941b84d74a7450ccd401f |
def spawnCubes(numCols, numRows, numLayers, center=(0, 0, 0)): <NEW_LINE> <INDENT> tID_cube = addTexturedCubeTemplates(numCols, numRows, numLayers) <NEW_LINE> client = pyazrael.AzraelClient() <NEW_LINE> cube_size = 2 + 0.1 <NEW_LINE> positions = np.array(list(np.ndindex(numCols, numRows, numLayers))) <NEW_LINE> positio... | Spawn multiple cubes in a regular grid.
The number of cubes equals ``numCols`` * ``numRows`` * ``numLayers``. The
center of this "prism" is at ``center``.
Every cube has two boosters and two factories. The factories can themselves
spawn more (purely passive) cubes. | 625941b87b180e01f3dc4661 |
def _wrapJs(context, jsobj, var_name, val): <NEW_LINE> <INDENT> from javascript import JSContext, JSFunction <NEW_LINE> assert (isinstance(context, JSContext)) <NEW_LINE> if jsobj.IsFunction(context) and not isinstance(jsobj, JSFunction): <NEW_LINE> <INDENT> wrapped = JSFunction(context, obj=jsobj._object(), thisobj=NU... | Wrap a provided js object as a python object, with a given
js name. Can set a flag if js object is callable to make
it callable in python too. This is to be used only internally | 625941b83346ee7daa2b2bc5 |
def wait_for_fixation_end(self): <NEW_LINE> <INDENT> pass | desc: |
Returns time and gaze position when a fixation has ended;
function assumes that a 'fixation' has ended when a deviation of
more than self.pxfixtresh from the initial fixation position has
been detected (self.pxfixtresh is created in self.calibration,
based on self.fixtresh, a property define... | 625941b84428ac0f6e5ba64e |
def process_eaf(input_elan_file: str, tier_name: str) -> List[dict]: <NEW_LINE> <INDENT> input_directory, full_file_name = os.path.split(input_elan_file) <NEW_LINE> file_name, extension = os.path.splitext(full_file_name) <NEW_LINE> input_eaf = Eaf(input_elan_file) <NEW_LINE> if os.path.isfile(os.path.join(input_directo... | Method to process a particular tier in an eaf file (ELAN Annotation Format). It stores the transcriptions in the
following format:
{'speaker_id': <speaker_id>,
'audio_file_name': <file_name>,
'transcript': <transcription_label>,
'start_ms': <start_time_in... | 625941b876e4537e8c3514d3 |
def _summarize(self, d, level=1): <NEW_LINE> <INDENT> if 'header_key' in d.keys(): <NEW_LINE> <INDENT> print("""{}* header['{}'] '{}'""".format(' '*level, d['header_key'], d['value'])) <NEW_LINE> print('\n') <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> for k, v in d.items(): <NEW_LINE> <INDENT> func = eval('self._{... | Summarize function that will either print the lear values or will go
one level deeper. | 625941b897e22403b379cdf5 |
@data_set.command('list') <NEW_LINE> @click.option('--count', type=click.IntRange(1, 10000), default=1000, show_default=True, help='Maximum number of data to list') <NEW_LINE> @click.option('--id', help='id') <NEW_LINE> @click.option('--name', help='name') <NEW_LINE> @click.option('--memo', help='memo') <NEW_LINE> @cli... | List datasets filtered by conditions | 625941b8283ffb24f3c55768 |
def readWords(filename): <NEW_LINE> <INDENT> f = open(filename,'r') <NEW_LINE> strings = f.readlines() <NEW_LINE> words = [getWord(s) for s in strings] <NEW_LINE> return words | takes a file name and returns a list of vocabulary words from its data. | 625941b8adb09d7d5db6c5ef |
def lomo_sk(self, spin, kpoint): <NEW_LINE> <INDENT> return self._electron_state(spin, kpoint, 0) | Returns the LOMO state for the given spin, kpoint.
Args:
spin: Spin index
kpoint: Index of the kpoint or |Kpoint| object. | 625941b88e71fb1e9831d609 |
def _compute_centroids(self, X): <NEW_LINE> <INDENT> centroids=[] <NEW_LINE> for j in range(self.n_clusters): <NEW_LINE> <INDENT> arr = X[self.labels_==j] <NEW_LINE> if len(arr)-np.isnan(arr).sum()==0: <NEW_LINE> <INDENT> arr = X <NEW_LINE> <DEDENT> with warnings.catch_warnings(): <NEW_LINE> <INDENT> warnings.simplefil... | compute the centroids for the datapoints in X from the current values
of self.labels_
Parameters
----------
X : array-like or sparse matrix, shape=(n_samples, n_features)
Data points to assign to clusters based on distance metric
returns new centroids | 625941b88a349b6b435e7fd0 |
def find_neighbours(self, cell): <NEW_LINE> <INDENT> delta = [('W', (-1, 0)), ('E', (1, 0)), ('S', (0, 1)), ('N', (0, -1))] <NEW_LINE> neighbours = [] <NEW_LINE> for direction, (dx, dy) in delta: <NEW_LINE> <INDENT> x2, y2 = cell.x + dx, cell.y + dy <NEW_LINE> if (0 <= x2 < self.nx) and (0 <= y2 < self.ny): <NEW_LINE> ... | Return a list of all neighbours to cell. | 625941b8d10714528d5ffb3b |
def db_for_read(self, model, **hints): <NEW_LINE> <INDENT> if model._meta.app_label == 'WaterSaver': <NEW_LINE> <INDENT> return 'raspi' <NEW_LINE> <DEDENT> return None | Send all read operations on WaterSaver app models to `raspi`. | 625941b88e7ae83300e4ae28 |
def scroll_to_more_bottom(self): <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> js = "var q=document.documentElement.scrollTop=1000" <NEW_LINE> self.script(js) <NEW_LINE> time.sleep(2) <NEW_LINE> <DEDENT> except Exception as msg: <NEW_LINE> <INDENT> return "异常原因%s" % msg | 滑动到底部多点
:return:返回异常原因 | 625941b8dd821e528d63b007 |
def __auth(self, **kwargs): <NEW_LINE> <INDENT> username = kwargs.get('username') <NEW_LINE> password = kwargs.get('password') <NEW_LINE> if not username or not password: <NEW_LINE> <INDENT> return 99 <NEW_LINE> <DEDENT> user_auth = Auth() <NEW_LINE> result = user_auth.authentication(username, password) <NEW_LINE> if n... | 用户登录验证
:param kwargs:
:return: | 625941b8596a897236089926 |
def txtweet(self, sender, arguments): <NEW_LINE> <INDENT> if self.is_root(sender): <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> cmd, pattern = arguments.split() <NEW_LINE> if cmd.lower() in ["start", "stop"]: <NEW_LINE> <INDENT> rows = utils.search_db(self.conn, 'SELECT address, names, hashtags FROM btcaddresses') <NEW... | user: root
txtweet start|stop address|name1|hashtag2
will loop over all addresses and enable|disable tweeting live txs for those that match params | 625941b8460517430c393fea |
def _atoms_in_residues(top, residue_idxs, subset_of_atom_idxs=None, fallback_to_full_residue=True, MDlogger=None): <NEW_LINE> <INDENT> atoms_in_residues = [] <NEW_LINE> if subset_of_atom_idxs is None: <NEW_LINE> <INDENT> subset_of_atom_idxs = np.arange(top.n_atoms) <NEW_LINE> <DEDENT> special_residues = [] <NEW_LINE> f... | Returns a list of ndarrays containing the atom indices in each residue of :obj:`residue_idxs`
:param top: mdtraj.Topology
:param residue_idxs: list or ndarray (ndim=1) of integers
:param subset_of_atom_idxs : iterable of atom_idxs to which the selection has to be restricted. If None, all atoms considered
:param fallba... | 625941b83eb6a72ae02ec337 |
def p_value_to_stars(p_value, alpha=(0.05, 0.01, 0.001)): <NEW_LINE> <INDENT> return len([_alpha for _alpha in alpha if p_value <= _alpha]) * '*' | Return string containing as many stars as the number of significance
levels in alpha (a tuple of significance levels, order-independent)
that p_value is less than or equal to.
>>> p_value_to_stars(0.075)
''
>>> p_value_to_stars(0.05)
'*'
>>> p_value_to_stars(0.025)
'*'
>>> p_value_to_stars(0.0099)
'**'
>>> p_value_to_... | 625941b8d8ef3951e3243399 |
@deprecate("Call node.split_recursive instead.") <NEW_LINE> def bsp_split_recursive( node: tcod.bsp.BSP, randomizer: Optional[tcod.random.Random], nb: int, minHSize: int, minVSize: int, maxHRatio: int, maxVRatio: int, ) -> None: <NEW_LINE> <INDENT> node.split_recursive( nb, minHSize, minVSize, maxHRatio, maxVRatio, ran... | .. deprecated:: 2.0
Use :any:`BSP.split_recursive` instead. | 625941b8851cf427c661a377 |
def switch_mode(self, inference): <NEW_LINE> <INDENT> hasLUT = isinstance(self.layers[0], LookupTable) <NEW_LINE> cur_steps = self.in_shape[0] if hasLUT else self.in_shape[1] <NEW_LINE> if not inference: <NEW_LINE> <INDENT> old_size = cur_steps <NEW_LINE> new_size = self.full_steps <NEW_LINE> <DEDENT> else: <NEW_LINE> ... | Dynamically grow or shrink the number of time steps to perform
single time step fprop during inference. | 625941b8bde94217f3682c59 |
def test_output_shape(): <NEW_LINE> <INDENT> assert sm.summary(toy_data).shape[1] <= toy_data.shape[1] | Test that output has the correct shape. Can't have more output columns than data input columns | 625941b8cb5e8a47e48b790b |
def distance_from_region(label_mask, distance_mask=None, scale=1, ord=2): <NEW_LINE> <INDENT> if distance_mask is None: <NEW_LINE> <INDENT> distance_mask = np.ones(label_mask.shape, dtype=bool) <NEW_LINE> <DEDENT> assert label_mask.shape == distance_mask.shape <NEW_LINE> scale = np.array(scale) <NEW_LINE> output = np.z... | Find the distance at every point in an image from a set of labeled points.
Parameters
==========
label_mask : ndarray
A mask designating the points to find the distance from. A True value
indicates that the pixel is in the region, a False value indicates it is not.
distance_mask : ndarray
A mask inidicating... | 625941b838b623060ff0ac4b |
def MAP(scores,label_list): <NEW_LINE> <INDENT> sorted, indices = torch.sort(scores,descending=True) <NEW_LINE> map=0 <NEW_LINE> score_rank=0. <NEW_LINE> rel_num=0. <NEW_LINE> for index in indices: <NEW_LINE> <INDENT> score_rank+=1 <NEW_LINE> if label_list[index]==1: <NEW_LINE> <INDENT> rel_num+=1 <NEW_LINE> map+= rel_... | calculate the map of this rank problem
:param scores: tensor [0.9,0.9,0.5,0.8,....]这样的一维列表
:param label_list: [1,0,1,0,1,0,1,1,1,1] 这样的列表,都是整数,只能是1和0,1代表相关
:return: map score:float | 625941b8f9cc0f698b140462 |
def get_asset_vulnerabilities_with_http_info(self, id, **kwargs): <NEW_LINE> <INDENT> all_params = ['id', 'page', 'size', 'sort'] <NEW_LINE> all_params.append('async_req') <NEW_LINE> all_params.append('_return_http_data_only') <NEW_LINE> all_params.append('_preload_content') <NEW_LINE> all_params.append('_request_timeo... | Asset Vulnerabilities # noqa: E501
Retrieves all vulnerability findings on an asset. A finding may be `invulnerable` if all instances have exceptions applied. # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.get_as... | 625941b86e29344779a62472 |
def __getattr__(self, attr): <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> result = self.data_dict[attr] <NEW_LINE> <DEDENT> except KeyError: <NEW_LINE> <INDENT> raise errors.ModelAttributeError(attr + ' is not exist') <NEW_LINE> <DEDENT> return result | Access to resource data by attributes. | 625941b84a966d76dd550e69 |
def transform_data(data): <NEW_LINE> <INDENT> df_imoveis = clean_data(data) <NEW_LINE> le = LabelEncoder() <NEW_LINE> categorical_columns = ['Finalidade', 'Categoria', 'Bairro'] <NEW_LINE> for column in categorical_columns: <NEW_LINE> <INDENT> df_imoveis[column] = le.fit_transform(df_imoveis[column]) <NEW_LINE> <DEDENT... | Return the dataframe with categorical columns
encoded with label encoder and numerical columns standardized. | 625941b8cb5e8a47e48b790c |
def reset(self): <NEW_LINE> <INDENT> self.n_iter = 0 <NEW_LINE> self.t_fit = 0 <NEW_LINE> self.intercept_ = 0 <NEW_LINE> if self.coef_ is not None: <NEW_LINE> <INDENT> self.coef_[:] = 0 | Reset classifier parameters (weights, bias, and # iterations) | 625941b83539df3088e2e1a8 |
@receiver(reset_password_token_created) <NEW_LINE> def password_reset_token_created(sender, reset_password_token, *args, **kwargs): <NEW_LINE> <INDENT> email = reset_password_token.user.email <NEW_LINE> context = { 'username': reset_password_token.user.username, 'reset_password_url': settings.THIS_URL + "/password_chan... | Handles password reset tokens
When a token is created, an e-mail needs to be sent to the user
:param sender:
:param reset_password_token:
:param args:
:param kwargs:
:return: | 625941b891f36d47f21ac353 |
def main(): <NEW_LINE> <INDENT> while True: <NEW_LINE> <INDENT> user_socket_type = input("服务端udp协议选择0,服务端tcp协议选择1,客户端udp协议选择2,客户端tcp协议选择3:") <NEW_LINE> if user_socket_type not in ["0", "1", "2", "3"]: <NEW_LINE> <INDENT> print("wrong user_socket_type, try again!!") <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> break <N... | 主函数 | 625941b83c8af77a43ae35fb |
def __init__(self, riddle: dict, levels: dict, secret_levels: dict): <NEW_LINE> <INDENT> self.full_name = riddle['full_name'] <NEW_LINE> self.guild = get(bot.guilds, id=int(riddle['guild_id'])) <NEW_LINE> self.levels = OrderedDict() <NEW_LINE> for level in levels: <NEW_LINE> <INDENT> id = level['name'] <NEW_LINE> self.... | Build riddle object by row extracted from database. | 625941b88e71fb1e9831d60a |
def __init__(self, udpPort=4000, dataStore=None, routingTable=None, networkProtocol=None, **kwargs): <NEW_LINE> <INDENT> self.id = kwargs.get('id') <NEW_LINE> if not self.id: <NEW_LINE> <INDENT> self.id = self._generateID() <NEW_LINE> <DEDENT> self.port = udpPort <NEW_LINE> self.listener = None <NEW_LINE> self.refreshe... | @param dataStore: The data store to use. This must be class inheriting
from the C{DataStore} interface (or providing the
same API). How the data store manages its data
internally is up to the implementation of that data
store.
@type dataStore: enta... | 625941b8b830903b967e9773 |
def get_file_str(path, saltenv='base'): <NEW_LINE> <INDENT> fn_ = cache_file(path, saltenv) <NEW_LINE> if isinstance(fn_, six.string_types): <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> with salt.utils.fopen(fn_, 'r') as fp_: <NEW_LINE> <INDENT> return fp_.read() <NEW_LINE> <DEDENT> <DEDENT> except IOError: <NEW_LINE> ... | Download a file from a URL to the Minion cache directory and return the
contents of that file
Returns ``False`` if Salt was unable to cache a file from a URL.
CLI Example:
.. code-block:: bash
salt '*' cp.get_file_str salt://my/file | 625941b80383005118ecf441 |
def train_rdp_classifier_and_assign_taxonomy( training_seqs_file, taxonomy_file, seqs_to_classify, min_confidence=0.80, model_output_dir=None, classification_output_fp=None): <NEW_LINE> <INDENT> if model_output_dir is None: <NEW_LINE> <INDENT> training_dir = tempfile.mkdtemp(prefix='RdpTrainer_') <NEW_LINE> <DEDENT> el... | Train RDP Classifier and assign taxonomy in one fell swoop
The file objects training_seqs_file and taxonomy_file are used to
train the RDP Classifier (see RdpTrainer documentation for
details). Model data is stored in model_output_dir. If
model_output_dir is not provided, a temporary directory is created
and removed... | 625941b8377c676e91272007 |
def conv_backward_naive(dout, cache): <NEW_LINE> <INDENT> dx, dw, db = None, None, None <NEW_LINE> N,F,outH,outW = dout.shape <NEW_LINE> x, w, b, conv_param = cache <NEW_LINE> F,C,HH,WW = w.shape <NEW_LINE> N,C,H,W = x.shape <NEW_LINE> stride = conv_param['stride'] <NEW_LINE> pad = conv_param['pad'] <NEW_LINE> db = np.... | A naive implementation of the backward pass for a convolutional layer.
Inputs:
- dout: Upstream derivatives.
- cache: A tuple of (x, w, b, conv_param) as in conv_forward_naive
Returns a tuple of:
- dx: Gradient with respect to x
- dw: Gradient with respect to w
- db: Gradient with respect to b | 625941b87c178a314d6ef2b5 |
def write_to_dayone(dayone_list): <NEW_LINE> <INDENT> print("SCRIPT IS: echo \"" + dayone_list[0] + "\" | dayone2 " + dayone_list[1] + " new") <NEW_LINE> try: <NEW_LINE> <INDENT> retcode = call("echo \"" + dayone_list[0] + "\" | dayone2 " + dayone_list[1] + " new", shell=True) <NEW_LINE> if retcode < 0: <NEW_LINE> <IND... | Take a formatted list of text & everything else, run dayone2 cli | 625941b8c432627299f04aa1 |
def res_net(data_x, keep_prob, training): <NEW_LINE> <INDENT> with tf.name_scope("resnet_classify"): <NEW_LINE> <INDENT> data_logit = conv_net(data_x, (7, 7, 3, 64), (1, 2, 2, 1)) <NEW_LINE> data_logit = batch_normalization(data_logit, training) <NEW_LINE> data_logit = actv_net(data_logit) <NEW_LINE> data_logit = max_p... | create a resnet network
Returns:
data_x: tf.placeholder(). Input of the whole network. A 4-D shape [batch_size, height, width, channel]
training: tf.placeholder(). True/False. Used for batch_normalization
data_logit: Tensor. The predicted output | 625941b8462c4b4f79d1d52d |
def make_lower(arg): <NEW_LINE> <INDENT> if arg is not None: <NEW_LINE> <INDENT> if isinstance(arg, str): <NEW_LINE> <INDENT> arg = arg.tolower() <NEW_LINE> <DEDENT> <DEDENT> return arg | helper function to make lowercase or return original | 625941b863d6d428bbe4434c |
def __init__(self, experiment_id=experiment_id, create=True): <NEW_LINE> <INDENT> self.experiment_id = experiment_id <NEW_LINE> if create: <NEW_LINE> <INDENT> self.psm = self.get_or_create_cc_parameterset(create=True) <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> self.psm = self.get_or_create_cc_parameterset(create=Fal... | :param experiment_id: The id of the experiment
:type experiment_id: integer
:param create: If true, creates a new parameterset object to
hold the cc license
:type create: boolean | 625941b8091ae35668666dc2 |
def read_sleb(blob, offset): <NEW_LINE> <INDENT> result = 0 <NEW_LINE> shift = 0 <NEW_LINE> index = offset <NEW_LINE> end = len(blob) <NEW_LINE> done = False <NEW_LINE> while not done and index < end: <NEW_LINE> <INDENT> b = struct.unpack("B", blob[index])[0] <NEW_LINE> result |= ((b & 0x7f) << shift) <NEW_LINE> shift ... | Reads a number encoded as sleb128 | 625941b899cbb53fe6792a44 |
@pytest.fixture <NEW_LINE> def tesults_flag(request): <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> return request.config.getoption("--tesults") <NEW_LINE> <DEDENT> except Exception as e: <NEW_LINE> <INDENT> print("Exception when trying to run test: %s"%__file__) <NEW_LINE> print("Python says:%s"%str(e)) | pytest fixture for sending results to tesults | 625941b830dc7b76659017c7 |
def DoGetBestSize(self): <NEW_LINE> <INDENT> return wx.Size(*self._layouts[0].overall_size) | Gets the size which best suits the window: for a control, it would be the
minimal size which doesn't truncate the control, for a panel - the same size
as it would have after a call to `Fit()`.
:return: An instance of :class:`Size`.
:note: Overridden from :class:`Control`. | 625941b84527f215b584c2b8 |
def getAtEnergy( self, energy ) : <NEW_LINE> <INDENT> return( self.getSpectrumAtEnergy( energy ) ) | This method is deprecated, use getSpectrumAtEnergy. | 625941b88c3a87329515821b |
def load_data(self, all_data, *args, rowOffset=0, colOffset=0, **kwargs): <NEW_LINE> <INDENT> data = all_data.get_data() <NEW_LINE> columns = all_data.get_headers() <NEW_LINE> if rowOffset+data.shape[0] > self.rowCount()-10: <NEW_LINE> <INDENT> self.setRowCount(rowOffset+data.shape[0]+10) <NEW_LINE> <DEDENT> if colOffs... | Load data into the table
:param all_data: The data to load
:type all_data: Data | 625941b8925a0f43d2549cd0 |
@app.route('/results') <NEW_LINE> def results(): <NEW_LINE> <INDENT> city = request.args.get('city') <NEW_LINE> units = request.args.get('units') <NEW_LINE> params = { 'appid': API_KEY, 'q': city, 'units': units } <NEW_LINE> result_json = requests.get(API_URL, params=params).json() <NEW_LINE> pp.pprint(result_json) <NE... | Displays results for current weather conditions. | 625941b8d164cc6175782bab |
def _generate_tokens(self, administrator_id, with_refresh_token=True): <NEW_LINE> <INDENT> now = datetime.utcnow() <NEW_LINE> expiry = now + timedelta(hours=current_app.config['JWT_EXPIRY_HOURS']) <NEW_LINE> token = generate_jwt({'administrator_id': administrator_id, 'refresh': False}, expiry) <NEW_LINE> refresh_token ... | 生成token 和refresh_token
:param administrator_id: 管理员id
:return: token, refresh_token | 625941b821bff66bcd6847b2 |
def placer_reports_with_partitionable_graph( report_folder, hostname, graph, graph_mapper, placements, machine): <NEW_LINE> <INDENT> placement_report_with_partitionable_graph_by_vertex( report_folder, hostname, graph, graph_mapper, placements) <NEW_LINE> placement_report_with_partitionable_graph_by_core( report_folder,... | Reports that can be produced from placement given a partitionable graph's existence
:param report_folder: the folder to which the reports are being written
:param hostname: the machine's hostname to which the placer worked on
:param graph: the partitionable graph to which placements were built
:param graph_mappe... | 625941b8627d3e7fe0d68cac |
def test_get_attribute_request_GET_lang(self): <NEW_LINE> <INDENT> request = Request(self.factory.get('/', {'lang': 'lol'})) <NEW_LINE> assert request.GET['lang'] == 'lol' <NEW_LINE> mock_serializer = serializers.Serializer(context={'request': request}) <NEW_LINE> field = self.field_class() <NEW_LINE> self._test_expect... | Pass a lang in the query string, expect to have a single string
returned instead of an object. | 625941b87047854f462a126a |
def test_wikitext_revision_hash(revision_wikitext): <NEW_LINE> <INDENT> labeled = wikivision.label_version(revision_wikitext) <NEW_LINE> expected = revision_wikitext.wikitext.apply(wikivision.data._hash) <NEW_LINE> assert labeled.rev_sha1.tolist() == expected.tolist() | Labeling creates a column containing a hash of the wikitexts. | 625941b8adb09d7d5db6c5f0 |
def isochrone(self, age=1.e8, metallicity=0.0): <NEW_LINE> <INDENT> z_defined = self.z_solar * (10.**metallicity) <NEW_LINE> log_age = math.log10(age) <NEW_LINE> if ((log_age < np.min(self.age_list)) or (log_age > np.max(self.age_list))): <NEW_LINE> <INDENT> logger.error('Requested age {0} is out of bounds.'.format(log... | Extract an individual isochrone from the MISTv1
collection. | 625941b88da39b475bd64dd4 |
@request_utils.cluster_api_exception_handler <NEW_LINE> def ovdc_update(data, operation_context: ctx.OperationContext): <NEW_LINE> <INDENT> ovdc_spec = common_models.Ovdc(**data[RequestKey.INPUT_SPEC]) <NEW_LINE> return ovdc_service.update_ovdc(operation_context, ovdc_id=data[RequestKey.OVDC_ID], ovdc_spec=ovdc_spec) | Request handler for ovdc enable, disable operations.
Add or remove the respective cluster placement policies to enable or
disable cluster deployment of a certain kind in the OVDC.
Required data: k8s_runtime
:return: Dictionary with org VDC update task href. | 625941b8d6c5a10208143ea4 |
def on_canvas_configure(self, event): <NEW_LINE> <INDENT> self.canvas.itemconfigure("container", width=event.width) <NEW_LINE> self.canvas.configure(scrollregion=self.canvas.bbox("all")) | Reconfigure the widget. | 625941b81d351010ab85597b |
def test_duplicated_key_omitted(self): <NEW_LINE> <INDENT> cif = "_exptl.method foo\n_exptl.method .\n" <NEW_LINE> for real_file in (True, False): <NEW_LINE> <INDENT> h = GenericHandler() <NEW_LINE> h.omitted = 'OMIT' <NEW_LINE> self._read_cif(cif, real_file, {'_exptl': h}) <NEW_LINE> self.assertEqual(h.data, [{'method... | If a key is duplicated, we take the final (omitted) value | 625941b830bbd722463cbc20 |
@cli.command("merge-tables", short_help="for a sample, merge its eggnog and refseq tables") <NEW_LINE> @click.argument("refseq", type=click.File("r")) <NEW_LINE> @click.argument("eggnog", type=click.File("r")) <NEW_LINE> @click.argument("output", type=click.File("w")) <NEW_LINE> def merge_tables(refseq, eggnog, output)... | Takes the output from `refseq` and `eggnog` and combines them into a single TSV table.
Headers are required and should contain 'contig' and 'orf' column labels. | 625941b81f5feb6acb0c49b2 |
def get_quotes_for_words(conn, conn_i, words): <NEW_LINE> <INDENT> quotes = [] <NEW_LINE> for word in words: <NEW_LINE> <INDENT> candidates = db.get_quotes_i(conn_i, word) <NEW_LINE> if random.random() < IMAGE_PROBABILITY and len(candidates) > 0: <NEW_LINE> <INDENT> quotes.append(random.choice(candidates)) <NEW_LINE> <... | Retourne des citations texte ou image, associés aux mots words (une citation par mot)
Tient compte de la probabilité pour les images
:param conn: Connexion à la base texte
:param conn_i: Connexion à la base image
:param words: Mots à chercher
:return: Une liste avec une citation par mot | 625941b863b5f9789fde6f42 |
def convert_classes_to_indexes(labels, classes): <NEW_LINE> <INDENT> if all([l in classes for l in labels]): <NEW_LINE> <INDENT> labels = [classes.index(label) for label in labels] <NEW_LINE> <DEDENT> return labels | Convert a list of labels representing classes to their corresponding indexes.
More precisely, convert TripletDataset labels to the index of the class in the
dataset, while keeping the current label for a FolderDataset dataset.
:param labels: list of labels to convert.
:param classes: list of all the classes in the dat... | 625941b863b5f9789fde6f43 |
def recognize_package(location): <NEW_LINE> <INDENT> if not filetype.is_file(location): <NEW_LINE> <INDENT> return <NEW_LINE> <DEDENT> T = contenttype.get_type(location) <NEW_LINE> ftype = T.filetype_file.lower() <NEW_LINE> mtype = T.mimetype_file <NEW_LINE> for package_type in PACKAGE_TYPES: <NEW_LINE> <INDENT> metafi... | Return a Package object if one was recognized or None for this `location`. | 625941b8be7bc26dc91cd463 |
def rollback(): <NEW_LINE> <INDENT> with cd(_REMOTE_BASE_DIR): <NEW_LINE> <INDENT> r = run("ls -p -1") <NEW_LINE> files = [s[:-1] for s in RE_FILES.split(r) if s.startswith("www-") and s.endswith("/")] <NEW_LINE> files.sort(cmp=lambda s1, s2: 1 if s1 < s2 else -1) <NEW_LINE> r = run("ls -l www") <NEW_LINE> ss = r.spli... | rollback to previous version | 625941b8a8ecb033257d2f33 |
def read_into(self, buffer, *, alignment=1, write_offset=0) -> None: <NEW_LINE> <INDENT> if isinstance(buffer, Buffer): <NEW_LINE> <INDENT> buffer = buffer.mglo <NEW_LINE> <DEDENT> return self.mglo.read_into(buffer, alignment, write_offset) | Read the content of the texture into a buffer.
Args:
buffer (bytearray): The buffer that will receive the pixels.
viewport (tuple): The viewport.
Keyword Args:
alignment (int): The byte alignment of the pixels.
write_offset (int): The write offset. | 625941b876d4e153a657e98e |
def save_flow(video_flows, flow_path, format="flow{}_{:05d}.{}", ext="jpg", separate=True): <NEW_LINE> <INDENT> if not os.path.exists(flow_path): <NEW_LINE> <INDENT> os.makedirs(flow_path) <NEW_LINE> <DEDENT> for i, flow in enumerate(video_flows): <NEW_LINE> <INDENT> if separate: <NEW_LINE> <INDENT> cv2.imwrite(os.path... | Args:
video_flows (list): store the flow (numpy.ndarray)
flow_type (str): the path to store the flows.
format (str): using which formate to store the flow images.
Return: | 625941b85166f23b2e1a4fb7 |
def groupAsDict(group): <NEW_LINE> <INDENT> groupDict = {'groupID': group.key.id(), 'userID': group.userID, 'creatorName': group.creatorName, 'groupName': group.groupName, 'description': group.description} <NEW_LINE> return groupDict | Return a dict type group variable
Get detailed group data from input | 625941b8d6c5a10208143ea5 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.