query
stringlengths
9
9.05k
document
stringlengths
10
222k
metadata
dict
negatives
listlengths
30
30
negative_scores
listlengths
30
30
document_score
stringlengths
4
10
document_rank
stringclasses
2 values
Generate a batch of non linear data and store it into numpy structures
def make_nonlinear_batch_data(self): self.reset_batch() g = SampleGenerator() for i in range(self.batch_size): # Draw a random sample on the interval [0,1] x = np.random.random() y = g.generate_non_linear_samples(x) self.x_data.append(x) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def make_linear_batch_data(self):\n self.reset_batch()\n g = SampleGenerator()\n for i in range(self.batch_size):\n # Draw a random sample on the interval [0,1]\n x = np.random.random()\n y = g.generate_linear_samples(x)\n self.x_data.append(x)\n ...
[ "0.69023687", "0.6657422", "0.65740246", "0.6552211", "0.6543923", "0.6525947", "0.652149", "0.64986634", "0.6427317", "0.6416945", "0.6410946", "0.6362014", "0.63412833", "0.633792", "0.63310975", "0.6317198", "0.63154197", "0.6303581", "0.62988424", "0.62969756", "0.6296537...
0.7060218
0
Generate a batch of linear data and store it into numpy structures
def make_linear_batch_data(self): self.reset_batch() g = SampleGenerator() for i in range(self.batch_size): # Draw a random sample on the interval [0,1] x = np.random.random() y = g.generate_linear_samples(x) self.x_data.append(x) self....
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def make_nonlinear_batch_data(self):\n self.reset_batch()\n g = SampleGenerator()\n for i in range(self.batch_size):\n # Draw a random sample on the interval [0,1]\n x = np.random.random()\n y = g.generate_non_linear_samples(x)\n self.x_data.append(x...
[ "0.6630902", "0.64705443", "0.626827", "0.6255618", "0.61779076", "0.6143719", "0.61349833", "0.6093019", "0.60913867", "0.60872954", "0.6078541", "0.60360956", "0.6005945", "0.5993744", "0.59579694", "0.59538275", "0.5936795", "0.59321797", "0.59284955", "0.5920302", "0.5916...
0.73512393
0
Returns the minimum path sum from root to a leaf. For example, the minimum path in this tree is [10, 5, 1, 1], which has sum 15. 10 / \ 5 5 | | 2 1 / 1
def minimum_path_sum(self, root) -> int: def minimum_path_sum_aux(root, path=None): path.append(root.value) new_path = path[:] # Stop condition if root.is_leaf(): return else: if root.left is not None: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def min_depth(t):\n if is_leaf(t):\n return 0\n h = float('inf')\n for b in branches(t):\n # Still works fine!\n h = min(h, 1 + min_depth(b))\n return h", "def minDepth(self, root: TreeNode) -> int:\n return self.bfs(root)", "def max_single_path(self, root: Optional[TreeNode...
[ "0.6976607", "0.6895128", "0.66671705", "0.6653948", "0.6637505", "0.6618621", "0.6516666", "0.64048195", "0.6392322", "0.63633066", "0.6349397", "0.629449", "0.6274608", "0.6259616", "0.6218573", "0.62072426", "0.60357225", "0.60211045", "0.59939396", "0.59901595", "0.598875...
0.85443187
0
Build the API 'create node' payload specific to DEPOSITUS.
def payload_for_create(cls, nickname, **kwargs): payload = super(DepositUsNode, cls).payload_for_create('DEPOSIT-US', nickname=nickname, **kwargs) return payload
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def node_create(self, **kwargs):\n node = self.ironic_client.node.create(**kwargs)\n self.addCleanup(self.node_delete, node)\n return node", "def makeTree(node,baseName,baseAddress,nodes,parentNode,vars,isGenerated):\n \n if (isGenerated == None or isGenerated == False) and node.get('g...
[ "0.6475023", "0.61691827", "0.60279626", "0.5982535", "0.58847415", "0.5812112", "0.57377934", "0.56656283", "0.5662233", "0.56440794", "0.5619852", "0.5604117", "0.5601905", "0.5594947", "0.5551773", "0.55489177", "0.5476511", "0.54458004", "0.5400765", "0.53761464", "0.5349...
0.72631043
0
function used for load gene ontology file gene ontology should in OBO format
def load_gene_ontology(self, file_path): pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def load_obo_file(self, obo_file, optional_attrs, load_obsolete, prt):\n reader = OBOReader(obo_file, optional_attrs)\n\n # Save alt_ids and their corresponding main GO ID. Add to GODag after populating GO Terms\n alt2rec = {}\n i = 0\n for rec in reader:\n # Save reco...
[ "0.67056936", "0.649405", "0.60760856", "0.60657376", "0.60421205", "0.60260266", "0.59746313", "0.59107745", "0.5878593", "0.5770445", "0.57476443", "0.5575497", "0.5566608", "0.551246", "0.55002576", "0.5498977", "0.54912657", "0.54823756", "0.54741764", "0.54462695", "0.54...
0.7840323
0
function used for load gene annotation file gene annotation file should in GAF format
def load_gene_annotation(self, file_path): pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def load_gene_ontology(self, file_path):\n\t\tpass", "def parse(fname, format=\"gaf\", evidence_codes=None):\n if evidence_codes:\n if evidence_codes == 'exp':\n ecode_policy = anno_parsers.ExperimentalEvidencePolicy()\n else:\n ecode_policy = anno_parsers.AllowedSetEvidence...
[ "0.66905075", "0.6432617", "0.6350883", "0.627544", "0.62443864", "0.61875546", "0.61622775", "0.6161676", "0.61342305", "0.6079505", "0.60508186", "0.6028002", "0.6026591", "0.60153025", "0.60118026", "0.60092837", "0.600845", "0.600644", "0.5981259", "0.5959721", "0.5946091...
0.7997125
0
function used for evaluation with PPI dataset
def evaluate(self, dataset): pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def evaluate(self, plot):", "def evaluate_design(self): # to update the pr object", "def evaluate(self, prediction_fn):\n pass", "def test_predictor():", "def evaluate(self,p):\n if not self.initialized: self.__initialize__()\n if self.vp0: p_ = 1-p\n else: p_ = p\n if self.ids_to_consi...
[ "0.63488966", "0.62352973", "0.62028337", "0.6166929", "0.60389817", "0.603585", "0.601392", "0.601392", "0.5865932", "0.58606446", "0.5839742", "0.58377177", "0.5827857", "0.5818832", "0.5813053", "0.5810459", "0.58043694", "0.57498485", "0.5742421", "0.5736939", "0.57332903...
0.67466784
0
Decorator for views that checks that the user passes the given test, redirecting to the login page if necessary. The test should be a callable that takes the user object and returns True if the user passes.
def user_passes_test(test_func, login_url=None, redirect_field_name=REDIRECT_FIELD_NAME): if not login_url: login_url = LOGIN_URL def decorator(view_func): def _wrapped_view(request, *args, **kwargs): if test_func(request): return view_func(request, *args, **kwa...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def request_passes_test(test_func, login_url=None, redirect_field_name=REDIRECT_FIELD_NAME):\n if not login_url:\n login_url = settings.LOGIN_URL\n\n def decorator(view_func):\n def _wrapped_view(request, *args, **kwargs):\n if test_func(request):\n return view_func(re...
[ "0.81273854", "0.7381807", "0.73482054", "0.72734046", "0.7270463", "0.72175115", "0.72175115", "0.7205731", "0.7179196", "0.716704", "0.71667445", "0.71552765", "0.71374995", "0.7130772", "0.7118831", "0.70776236", "0.7057909", "0.70545197", "0.70490575", "0.70335615", "0.70...
0.8669284
0
Test translation of one word
def test_word_translation(self): self.assertEqual(translator.translate_word("hour"), "ourhay") self.assertEqual(translator.translate_word(""), "") self.assertEqual(translator.translate_word("aaa"), "aaayay")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_translation_smoke():\n english_to_morse = get_translator(\"english\", \"morse\")\n morse_to_english = get_translator(\"morse\", \"english\")\n morse = english_to_morse.translate(\"hello world\")\n english = morse_to_english.translate(morse)\n assert english == \"HELLO WORLD\"", "def trans...
[ "0.7597297", "0.74136245", "0.73001736", "0.7175371", "0.7151106", "0.7067673", "0.6857479", "0.6792205", "0.6749835", "0.66606575", "0.6636238", "0.6636003", "0.6418098", "0.6397569", "0.6391174", "0.63768405", "0.63734776", "0.6352836", "0.6352223", "0.63490295", "0.6339953...
0.86208665
0
Makes the CWP and pprof file names consistent. For the same function, it may happen for some file paths to differ slightly in the CWP data compared to the pprof output. In a file name, for each tuple element of the list, we substitute the first element with the second one.
def MakeCWPAndPprofFileNamesConsistent(file_name): file_name = file_name.replace(', ', '; ') for replacing_pair_string in FILE_NAME_REPLACING_PAIR_STRINGS: file_name = file_name.replace(replacing_pair_string[0], replacing_pair_string[1]) return file_name
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def MakePprofFunctionKey(function_and_file_name):\n # TODO(evelinad): Use pprof --topproto instead of pprof --top to parse\n # protobuffers instead of text output. Investigate if there is an equivalent\n # for pprof --tree that gives protobuffer output.\n #\n # In the CWP output, we replace the , with ; as a ...
[ "0.6336867", "0.6131035", "0.5696922", "0.55790573", "0.55010515", "0.54772717", "0.5450916", "0.5304689", "0.5298604", "0.5282132", "0.52429986", "0.5242389", "0.5162972", "0.51255804", "0.51252884", "0.510435", "0.5082193", "0.50774354", "0.5064152", "0.5051272", "0.5046412...
0.7195294
0
Creates the function key from the function and file name. Parsing the the pprof top and tree outputs is difficult due to the fact that it hard to extract the function and file name (i.e the function names can have a lot of unexpected charachters such as spaces, operators etc). For the moment, we used FUNCTION_FILE_SEPA...
def MakePprofFunctionKey(function_and_file_name): # TODO(evelinad): Use pprof --topproto instead of pprof --top to parse # protobuffers instead of text output. Investigate if there is an equivalent # for pprof --tree that gives protobuffer output. # # In the CWP output, we replace the , with ; as a workaround...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def generate_function_key(fn):\n return hashlib.md5(fn.func_code.co_code).hexdigest()", "def file_key(filename):\n return FILE_PREFIX + filename", "def fname(func):\n return \"%s.%s\" % (func.__module__, func.__name__)", "def generate_key(*args, **kwargs):\n parts = []\n\n ...
[ "0.6344893", "0.61733", "0.61548144", "0.6029061", "0.59346366", "0.5924424", "0.5907838", "0.5815705", "0.58027244", "0.57330346", "0.5722702", "0.56463015", "0.5637381", "0.5543911", "0.5503695", "0.5477241", "0.5434116", "0.54224616", "0.5410873", "0.53719246", "0.53501993...
0.780996
0
Computes the cumulative inclusive count value of a function. A function might appear declared in multiple files or objects. When computing the fraction of the inclusive count value from a child function to the parent function, we take into consideration the sum of the inclusive_count count values from all the ocurences...
def ComputeCWPCummulativeInclusiveStatistics(cwp_inclusive_count_statistics): cwp_inclusive_count_statistics_cumulative = defaultdict(int) for function_key, function_statistics \ in cwp_inclusive_count_statistics.iteritems(): function_name, _ = function_key.split(',') cwp_inclusive_count_statistics_c...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def ComputeCWPChildFunctionsFractions(cwp_inclusive_count_statistics_cumulative,\n cwp_pairwise_inclusive_count_statistics):\n\n pairwise_inclusive_count_fractions = {}\n\n for parent_function_key, child_functions_metrics in \\\n cwp_pairwise_inclusive_count_statistics.i...
[ "0.597441", "0.55660766", "0.5475768", "0.54315376", "0.5387883", "0.53473026", "0.5299066", "0.52987206", "0.52914274", "0.52319247", "0.5216198", "0.51691157", "0.5139399", "0.51383424", "0.5124791", "0.5121849", "0.50887746", "0.5069851", "0.50526094", "0.5018618", "0.4969...
0.6362533
0
Computes the fractions of the inclusive count values for child functions. The fraction represents the inclusive count value of a child function over the one of the parent function.
def ComputeCWPChildFunctionsFractions(cwp_inclusive_count_statistics_cumulative, cwp_pairwise_inclusive_count_statistics): pairwise_inclusive_count_fractions = {} for parent_function_key, child_functions_metrics in \ cwp_pairwise_inclusive_count_statistics.iteritems(): ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def denominator(self, ???):", "def numerator(self, ???):", "def fractionPassing(self):\n return self.cut.entries / self.entries", "def calculate_vote_fractions():\n return _calculate_vote_fractions(models.get_candidate_to_vote_count())", "def fractions():\n\n pi = 22 / 7\n print(\"22/7\\n==...
[ "0.60595304", "0.58882415", "0.5839464", "0.5791325", "0.57302094", "0.56365466", "0.55660135", "0.5556466", "0.5539381", "0.5531349", "0.54849494", "0.5468713", "0.544012", "0.5428886", "0.5428331", "0.54159963", "0.5400832", "0.5396846", "0.53820527", "0.5370296", "0.535310...
0.60914195
0
Parses the contents of the function groups file.
def ParseFunctionGroups(cwp_function_groups_lines): # The order of the groups mentioned in the cwp_function_groups file # matters. A function declared in a file will belong to the first # mentioned group that matches its path to the one of the file. # It is possible to have multiple paths that belong to the sam...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def parse(options):\n global p_entering_group_block, p_exiting_group_block, p_group_next, p_group_name, p_group_set\n \n in_group_block = False\n \n group_list = []\n group_elem = {}\n \n order_keys = []\n \n with open(options.input_file, mode=fd_read_options) as fd_input:\n fo...
[ "0.66318685", "0.65091795", "0.6411748", "0.62168884", "0.614106", "0.613057", "0.6062225", "0.60367906", "0.5948503", "0.5924105", "0.59104806", "0.590227", "0.586359", "0.5841075", "0.5809704", "0.57882077", "0.5773083", "0.568154", "0.5659379", "0.5616858", "0.5614927", ...
0.71220386
0
Parses a file that contains the output of the pprof top command.
def ParsePprofTopOutput(file_name): pprof_top_statistics = {} # In the pprof top output, the statistics of the functions start from the # 6th line. with open(file_name) as input_file: pprof_top_content = input_file.readlines()[6:] for line in pprof_top_content: function_statistic_match = FUNCTION_S...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def ParsePprofTreeOutput(file_name):\n\n # In the pprof output, the statistics of the functions start from the 9th\n # line.\n with open(file_name) as input_file:\n pprof_tree_content = input_file.readlines()[9:]\n\n pprof_tree_statistics = defaultdict(lambda: defaultdict(float))\n track_child_functions = ...
[ "0.66381496", "0.60057384", "0.59760386", "0.57892656", "0.5726717", "0.56621575", "0.5601552", "0.5589054", "0.55685717", "0.5450823", "0.54446125", "0.5419087", "0.5403299", "0.53546697", "0.5340686", "0.53404295", "0.5312534", "0.5310855", "0.5305642", "0.53044057", "0.530...
0.7867616
0
Parses a file that contains the output of the pprof tree command.
def ParsePprofTreeOutput(file_name): # In the pprof output, the statistics of the functions start from the 9th # line. with open(file_name) as input_file: pprof_tree_content = input_file.readlines()[9:] pprof_tree_statistics = defaultdict(lambda: defaultdict(float)) track_child_functions = False # Th...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def ParsePprofTopOutput(file_name):\n\n pprof_top_statistics = {}\n\n # In the pprof top output, the statistics of the functions start from the\n # 6th line.\n with open(file_name) as input_file:\n pprof_top_content = input_file.readlines()[6:]\n\n for line in pprof_top_content:\n function_statistic_mat...
[ "0.66067183", "0.6017137", "0.59014267", "0.58663404", "0.5841529", "0.5826687", "0.5749238", "0.5748941", "0.5733292", "0.5695029", "0.5656529", "0.56446993", "0.55805326", "0.55548406", "0.55548406", "0.55536187", "0.55310863", "0.5505214", "0.55027777", "0.5502458", "0.549...
0.79150075
0
Parses the CWP inclusive count files. A line should contain the name of the function, the file name with the declaration, the inclusive count and inclusive count fraction out of the total extracted inclusive count values.
def ParseCWPInclusiveCountFile(file_name): cwp_inclusive_count_statistics = defaultdict(lambda: ('', 0, 0.0, 0)) with open(file_name) as input_file: statistics_reader = csv.DictReader(input_file, delimiter=',') for statistic in statistics_reader: function_name = statistic['function'] file_name ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def ParseCWPPairwiseInclusiveCountFile(file_name):\n pairwise_inclusive_count_statistics = defaultdict(lambda: defaultdict(float))\n\n with open(file_name) as input_file:\n statistics_reader = csv.DictReader(input_file, delimiter=',')\n\n for statistic in statistics_reader:\n parent_function_name, chi...
[ "0.65325326", "0.5770873", "0.5255738", "0.5147463", "0.5132285", "0.5097598", "0.50919753", "0.50912225", "0.507354", "0.5055528", "0.5017052", "0.50100046", "0.4995706", "0.49907556", "0.49840093", "0.49835533", "0.4940733", "0.49401423", "0.49015447", "0.48846525", "0.4854...
0.71798396
0
Parses the CWP pairwise inclusive count files. A line of the file should contain a pair of a parent and a child function, concatenated by the PARENT_CHILD_FUNCTIONS_SEPARATOR, the name of the file where the child function is declared and the inclusive count fractions of the pair of functions out of the total amount of ...
def ParseCWPPairwiseInclusiveCountFile(file_name): pairwise_inclusive_count_statistics = defaultdict(lambda: defaultdict(float)) with open(file_name) as input_file: statistics_reader = csv.DictReader(input_file, delimiter=',') for statistic in statistics_reader: parent_function_name, child_function_...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def ParseCWPInclusiveCountFile(file_name):\n cwp_inclusive_count_statistics = defaultdict(lambda: ('', 0, 0.0, 0))\n\n with open(file_name) as input_file:\n statistics_reader = csv.DictReader(input_file, delimiter=',')\n for statistic in statistics_reader:\n function_name = statistic['function']\n ...
[ "0.65458274", "0.56343454", "0.49421835", "0.48282015", "0.47991893", "0.47809947", "0.46508983", "0.46498537", "0.46464705", "0.46307102", "0.46042892", "0.45846727", "0.45683825", "0.45669442", "0.45614496", "0.45445207", "0.4517693", "0.45140862", "0.4451195", "0.44409293", ...
0.70118713
0
Given the block size and the desired block index, return the slice of bytes from 0 to the end of the given block.
def bytes_to_block(block_size: int, i: int) -> slice: return slice(0, block_size * (i + 1))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def bytes_in_block(block_size: int, i: int) -> slice:\n return slice(block_size * i, block_size * (i + 1))", "def get_block(self, idx):\n self.input_file.seek(idx * self.blocksize)\n return self.input_file.read(self.blocksize)", "def read(self, size=-1):\n if not self._buf:\n ...
[ "0.80001956", "0.638865", "0.63013935", "0.6273106", "0.6159458", "0.6123575", "0.5852839", "0.5841076", "0.5801677", "0.57806903", "0.5606504", "0.5605544", "0.5587722", "0.55432785", "0.55123276", "0.549337", "0.5320378", "0.53183264", "0.5302764", "0.52887833", "0.5285994"...
0.7709877
1
Given the block size and the desired block index, return the slice of interesting bytes.
def bytes_in_block(block_size: int, i: int) -> slice: return slice(block_size * i, block_size * (i + 1))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def bytes_to_block(block_size: int, i: int) -> slice:\n return slice(0, block_size * (i + 1))", "def get_block(self, idx):\n self.input_file.seek(idx * self.blocksize)\n return self.input_file.read(self.blocksize)", "def read(self, size=-1):\n if not self._buf:\n self._buf.ap...
[ "0.7297683", "0.64004445", "0.61794794", "0.6134597", "0.58951896", "0.586929", "0.58357203", "0.58036876", "0.575804", "0.5738425", "0.5701645", "0.5659119", "0.5560989", "0.55597043", "0.5514207", "0.5506305", "0.55037373", "0.5469516", "0.5417936", "0.54173195", "0.5410381...
0.79082745
0
Given a buffer and the key len, split the buffer into blocks.
def split_blocks(b: bytes, k_len: int) -> tuple: assert len(b) >= k_len return tuple( bytes( b[j] for j in range(i, len(b), k_len) ) for i in range(0, k_len) )
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _buff_split(self, upload_buffer):\n if upload_buffer.intent_count() == 0:\n return\n tail_buffer = upload_buffer\n while True:\n if tail_buffer.length < self.recommended_upload_part_size + self.min_part_size:\n # `EmergePlanner_buff_partition` can split...
[ "0.61693007", "0.611693", "0.59779125", "0.5802576", "0.5779824", "0.5730315", "0.5620192", "0.5557428", "0.55036813", "0.54738647", "0.5424786", "0.53956705", "0.5385404", "0.53824395", "0.5314768", "0.52782834", "0.52711946", "0.52539396", "0.5253796", "0.523956", "0.523672...
0.71291816
0
A naive padding implementation. Given the block size, pad the input buffer with '\x00' bytes, so that the result is a multiple of the specified size. If the buffer is greater than 0, but already a multiple of `size` it's returned unmodified.
def naive_block_padding(b: bytes, size: int) -> bytes: assert size <= 0xff l = len(b) if l > 0 and l % size == 0: return b return b + b'\x00' * (size - (l % size))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def Pad(value, block_size):\n assert block_size < 256\n pad_length = block_size - (len(value) % block_size)\n if not pad_length:\n # Always pad at least 1 block.\n pad_length = block_size\n padding = [random.randint(0, 255) for _ in range(pad_length)]\n padding[-1] = len(padding)\n padding = struct.pac...
[ "0.70165694", "0.65415794", "0.65264106", "0.6474348", "0.64708847", "0.6293283", "0.6265598", "0.6215768", "0.61022586", "0.6072546", "0.6051565", "0.5936931", "0.59051484", "0.5872826", "0.5849457", "0.583683", "0.58303237", "0.5825839", "0.5821051", "0.57902086", "0.577236...
0.83171093
0
PKCS7 un_padding. Remove padding from the bytes. If padding is invalid, throws an exception.
def un_pkcs_7(b: bytes, size: int) -> bytes: b = bytearray(b) padding = b[-1] if padding <= 0 or padding > size: raise BadPaddingException for i in range(-padding, 0): if b[i] != padding: raise BadPaddingException return bytes(b[:-padding])
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def remove_padding(paddedMsg, block_size): \n try:\n if not valid_padding(paddedMsg, block_size):\n raise ValueError\n except ValueError:\n print(f\"{ paddedMsg } has invalid PKCS#7 padding.\")\n return\n \n last_byte = paddedMsg[-1]\n unpadded = paddedMsg[:-last_byte...
[ "0.7573973", "0.6920545", "0.65433896", "0.63635516", "0.61938757", "0.6060388", "0.5942703", "0.5744001", "0.57044625", "0.5590399", "0.5486308", "0.54624707", "0.54142153", "0.54136795", "0.5382624", "0.5271841", "0.522418", "0.51658076", "0.5146927", "0.5141305", "0.497971...
0.78874135
0
PKCS1.5 unpadding. Check whether padding is correct, remote it and return the message.
def un_pkcs_1_5(b: int, size: int) -> bytes: unpadded = b.to_bytes(size, "big") if not (unpadded[0] == 0x00 and unpadded[1] == 0x02): raise BadPaddingException unpadded = unpadded[2:] i = 0 while unpadded[i] == 0xff: i += 1 unpadded = unpadded[i:] if not (unpadded[0] == 0x...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def remove_padding(paddedMsg, block_size): \n try:\n if not valid_padding(paddedMsg, block_size):\n raise ValueError\n except ValueError:\n print(f\"{ paddedMsg } has invalid PKCS#7 padding.\")\n return\n \n last_byte = paddedMsg[-1]\n unpadded = paddedMsg[:-last_byte...
[ "0.7033483", "0.67119503", "0.6185447", "0.6130692", "0.6012814", "0.58991176", "0.5789447", "0.57747304", "0.57602435", "0.56955993", "0.5692743", "0.5626397", "0.5573706", "0.5565686", "0.55546814", "0.5532581", "0.5451245", "0.5402548", "0.53575903", "0.53340465", "0.52554...
0.6907179
1
Return a string representation of the variable.
def __str__(self): return f"Variable(type={self._type}, id={self._id}, value={self.status}, init={self.init})"
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __str__(self):\n s = \"\"\n for field in self.fields:\n if field.size not in VAR_PREFIXES:\n s += field.name + \": \" + str(field.size) + \" bits with value \" + str(field.value) + \".\\n\"\n else:\n s += field.name + \": variable size: \" + str...
[ "0.77372766", "0.7536459", "0.7536459", "0.7536459", "0.7536459", "0.7536459", "0.734657", "0.7323082", "0.71180147", "0.70616055", "0.7044013", "0.69827473", "0.69788533", "0.6974818", "0.6907385", "0.6889123", "0.6874353", "0.6863303", "0.6850354", "0.684109", "0.6835305", ...
0.7576983
1
Return the last edit time.
def last_edited(self): return self._last_edited
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def last_edit(self) -> datetime.datetime:\n self.update_status()\n return datetime.datetime.fromtimestamp(self._last_edit)", "def get_last_update_time(self):\n return self.last_update_time", "def last_modified_time(self) -> str:\n return pulumi.get(self, \"last_modified_time\")", ...
[ "0.8686858", "0.7587613", "0.7560448", "0.7560448", "0.7485426", "0.74718714", "0.745587", "0.7413081", "0.7365227", "0.7365227", "0.7359187", "0.7351504", "0.7343039", "0.7298599", "0.7298599", "0.72727555", "0.72685224", "0.72622776", "0.7254894", "0.7254894", "0.72354203",...
0.8167432
1
Function that implements the algorithm for the inversion of a LTI system. The output of the algorithm uhat is such that this signal, filtered by the system produces the signal y.
def stbinv(A, B, C, D, y, t): # Description to help the user # calculate the number of samples of the output N = np.shape(y)[ 1 ] # the number of samples is the number of columns of the data matrix y # calculate system's dimensions: number of states and number of inputs m = B.shape[1]...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def I(x, y):\n plug_length = 2\n if isinstance(x, ndarray) and isinstance(y, ndarray):\n # vectorized version\n u = zeros((x.shape[0], y.shape[1]))\n #u1 = less(x, Lx/2.0 - 0.1)\n #u1 += greater(x, Lx/2.0 + 0.1)\n #put(u, u1, 2.0) does not work, ...
[ "0.61993027", "0.6093398", "0.60126185", "0.59149575", "0.5895828", "0.5891714", "0.5883189", "0.58782166", "0.5834867", "0.58016485", "0.57893735", "0.57810235", "0.5741158", "0.5739637", "0.5727934", "0.5716083", "0.5700649", "0.56995004", "0.56938654", "0.5658236", "0.5645...
0.6189042
1
Function that does the transformation of a MIMO transfer function to a statespace model.
def mtf2ss(G): # Description to help the user # calculating the number of outputs p = len(G) # calculating the number of inputs m = len(G[0]) # creating a list for each matrix A = [] B = [] C = [] D = [] nss = 0 # loop that get the SISO state-space transformations ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def forward(self, x):\n return torch.mm(x, self.matrixS)", "def forward(self, state):\n x = self._format(state)\n x = self.activation_fc(self.input_layer(x))\n for hidden_layer in self.hidden_layers:\n x = self.activation_fc(hidden_layer(x))\n x = self.output_layer(x...
[ "0.5455332", "0.5412556", "0.53700584", "0.5354151", "0.5343223", "0.5263439", "0.52409655", "0.5220827", "0.51881456", "0.5185633", "0.5157912", "0.5157735", "0.51349413", "0.5131477", "0.5121507", "0.5115568", "0.5115541", "0.51097274", "0.5103481", "0.50699323", "0.5063509...
0.58319175
0
Evaluate version and git revision and save it to a version file Evaluation is based on VERSION variable and git describe if .git directory is present in tree. In case when .git is not available version and git_revision is taken from get_distribution call
def provide_git_revision(cls): version = str(VERSION) git_revision = str(GIT_REVISION) git_date = str(GIT_DATE) if os.path.exists(".git"): from subprocess import check_output command = 'git describe --tags --long --dirty' version_string = check_output(...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_target_git_version():\n if os.path.exists(os.path.join(ROOT_DIR, '.git_bleeding_edge')):\n git_version_file = 'git_version_bleeding_edge.txt'\n else:\n git_version_file = 'git_version.txt'\n with open(os.path.join(THIS_DIR, git_version_file)) as f:\n return f.read().strip()", "def write_versi...
[ "0.70678526", "0.68655723", "0.6796388", "0.6708447", "0.65252197", "0.64766747", "0.6476001", "0.64697593", "0.6447515", "0.6442917", "0.6426894", "0.6379362", "0.6362795", "0.6267706", "0.62258583", "0.62182444", "0.6217623", "0.61762476", "0.61670643", "0.6155937", "0.6109...
0.73866886
0
Helper method to save version.py with current version and git_revision
def _save_version_file(cls, hivemind_version, git_revision, git_date): with open("hive/version.py", 'w') as version_file: version_file.write("# generated by setup.py\n") version_file.write("# contents will be overwritten\n") version_file.write("VERSION = '{}'\n".format(hivemi...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def GenerateRevisionFile(self):\n\n print 'Saving revision to %s' % self.revisions_path\n Write(\n self.revisions_path,\n ('{\"chromium_revision\":%d, \"webkit_revision\":%d, '\n '\"v8_revision\":%d}') % (self._chromium_revision,\n self._webkit_revision,\...
[ "0.6732105", "0.6625021", "0.65620464", "0.6561149", "0.64542365", "0.63980365", "0.6322233", "0.6319752", "0.62847656", "0.6251861", "0.6206942", "0.6136045", "0.6086098", "0.6048948", "0.60261697", "0.601439", "0.59903044", "0.59877247", "0.59568715", "0.5952817", "0.593056...
0.7704217
0
Read structured entity from metadata store for a given project directory context Context object containing projectDir, the path of the project whose metadata store is to be read from fqId String representing the fully qualified ID of the entity Implementations should return an instance of themselves containing data rea...
def readFromMetadata(cls, context, fqId): pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def read_metadata(dirname, use_gpu):\n try:\n if not os.path.isdir(dirname):\n pass\n elif not os.path.exists(os.path.join(dirname, 'metadata.json')):\n pass\n else:\n with open(os.path.join(dirname, 'metadata.json')) as f:\n metadata = json.load(f)\n if use_gpu and ('container...
[ "0.5949139", "0.5893366", "0.5757676", "0.5671569", "0.56597054", "0.55556333", "0.5489248", "0.5458346", "0.5440958", "0.53803843", "0.5339604", "0.5311802", "0.5290315", "0.5249724", "0.5208021", "0.5197425", "0.516491", "0.51528895", "0.51199585", "0.50983113", "0.5068694"...
0.60476655
0
Write ClimatePointStation data to climate point section of metadata for a given project directory context Context object containing projectDir, the path of the project whose metadata store is to be written to
def writeToMetadata(self, context): fqId = self.type + GenericMetadata.COMPOUND_KEY_SEP + self.id fqId = fqId.lower() climatePoints = GenericMetadata.readClimatePointEntries(context) try: stations = climatePoints['stations'].split(GenericMetadata.VALUE_DELIM) except ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def writeClimatePointEntries(context, keys, values):\n GenericMetadata._writeEntriesToSection(context.projectDir, GenericMetadata.CLIMATE_POINT_SECTION, keys, values)", "def writeClimatePointEntry(context, key, value):\n GenericMetadata.writeEntryToSection(context, GenericMetadata.CLIMATE_POINT_SEC...
[ "0.6422649", "0.63623416", "0.5904371", "0.5384812", "0.53518283", "0.53402686", "0.5301591", "0.5273172", "0.5256313", "0.52478206", "0.52091837", "0.52091837", "0.5190675", "0.5180507", "0.5165975", "0.5148435", "0.5120567", "0.510558", "0.50966644", "0.5089502", "0.5077285...
0.73874813
0
Write ModelRun data to model run section of metadata for a given project directory Will set run number to value to be stored in metadata context Context object containing projectDir, the path of the project whose metadata store is to be written to Exception if model type has not known Exception if section is not a vali...
def writeToMetadata(self, context): if self.modelType not in GenericMetadata.MODEL_TYPES: raise Exception("Model type %s is not among known model types: %s" % (self.modelType, str(GenericMetadata.MODEL_TYPES) ) ) modelRunEntries = GenericMetadata.readModelRunEntries(context) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def writeModelRunEntries(context, keys, values):\n GenericMetadata._writeEntriesToSection(context.projectDir, GenericMetadata.MODEL_RUN_SECTION, keys, values)", "def run_metadata(self, run_metadata):\n\n if run_metadata is not None:\n run_metadata = self._validate_run_metadata(run_metada...
[ "0.67631894", "0.55094665", "0.54853433", "0.53479904", "0.50316596", "0.4959625", "0.49440154", "0.4917791", "0.48888582", "0.48095495", "0.4801151", "0.4781151", "0.47765702", "0.47687408", "0.47333437", "0.47103244", "0.4694231", "0.46878308", "0.46798983", "0.46664116", "...
0.74479276
0
Write AssetProvenance data to provenance section of metadata for a given project directory context Context object containing projectDir, the path of the project whose metadata store is to be written to Exception if section is not a valid GenericMetadata section
def writeToMetadata(self, context): fqId = self.section + GenericMetadata.COMPOUND_KEY_SEP + self.name fqId = fqId.lower() # Write self to the appropriate section GenericMetadata.writeEntryToSection(context, self.section, self.name, self.dcIdentifier) # Write to...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def writeProvenanceEntries(context, keys, values):\n GenericMetadata._writeEntriesToSection(context.projectDir, GenericMetadata.PROVENANCE_SECTION, keys, values)", "def writeProvenanceEntry(context, key, value):\n GenericMetadata.writeEntryToSection(context, GenericMetadata.PROVENANCE_SECTION, key,...
[ "0.60347295", "0.60217524", "0.5577184", "0.5552108", "0.553339", "0.55101997", "0.5417018", "0.53029364", "0.52820504", "0.5193149", "0.5164625", "0.5141724", "0.5113907", "0.5058686", "0.50282586", "0.50007135", "0.49816483", "0.4901674", "0.48992616", "0.48467356", "0.4813...
0.67359984
0
Return string representing original command line, as close as possible, used to run the command. Will convert all paths in the command line to absolute path, if a nonpath element has spaces in it, they will be quoted. String with each element of sys.argv separated by a space
def getCommandLine(): import sys, os cmdline = os.path.abspath(sys.argv[0]) for elem in sys.argv[1:]: cmdline += ' ' + ecohydrolib.util.getAbsolutePathOfItem(elem) return cmdline
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_cli_string():\n return os.path.basename(sys.argv[0]) + \" \" + \" \".join(sys.argv[1:])", "def cmdstr(cmd):\n if isinstance(cmd, str):\n return cmd\n\n quoted = []\n for arg in cmd:\n if isinstance(arg, Path):\n arg = str(arg)\n if ' ' in arg:\n arg ...
[ "0.69824934", "0.6724259", "0.6527682", "0.6467328", "0.6254741", "0.6226238", "0.60794044", "0.60746896", "0.60577667", "0.6052372", "0.60297465", "0.59857696", "0.5983711", "0.58930767", "0.5883761", "0.5880378", "0.5875304", "0.58608395", "0.5846903", "0.5805317", "0.57934...
0.7480482
0
Check if metadata store is compatible with current version of ecohydrolib. Accepts project directory as this method is used in the constructor to the Context class. projectDir, the path of the project whose metadata store is to be written to MetadataVersionError if a version already exists in the metadata store and is ...
def checkMetadataVersion(projectDir): metadataFilepath = os.path.join(projectDir, GenericMetadata.METADATA_FILENAME) if os.path.exists(metadataFilepath): if not os.access(metadataFilepath, os.R_OK): raise IOError(errno.EACCES, "Unable to read metadata store for project %s" % ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _check_version(self, project, targetdir):\r\n versionfile = os.path.join(targetdir, 'project.version')\r\n if (os.path.exists(versionfile)):\r\n file_ = open(versionfile, \"r\")\r\n projectname = file_.read().strip()\r\n file_.close()\r\n if (projectnam...
[ "0.65770215", "0.55975527", "0.5539493", "0.5345174", "0.5288473", "0.52460235", "0.5190399", "0.5163017", "0.51418436", "0.51215893", "0.51166844", "0.50982404", "0.5070804", "0.5055564", "0.5011875", "0.49932083", "0.496476", "0.49626192", "0.4957123", "0.49514368", "0.4948...
0.7714848
0
Write EcohydroLib version to ECOHYDROLIB_SECION of metadata. config ConfigParser to write version information to MetadataVersionError if a version already exists in the metadata store and is different than GenericMetadata._ecohydrolibVersion
def _writeVersionToMetadata(config): if not config.has_section(GenericMetadata.ECOHYDROLIB_SECION): config.add_section(GenericMetadata.ECOHYDROLIB_SECION) if not config.has_option(GenericMetadata.ECOHYDROLIB_SECION, \ GenericMetadata.VERSION_KEY): ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def bumpversion(path=\"setup.cfg\"):\n config = ConfigParser()\n config.read(path)\n cfg = open(path, 'w')\n new_version = \"0.0.0\"\n if config.has_option('metadata', 'version'):\n old_version = config.get('metadata', 'version')\n major, minor, patch = old_version.split(\".\")\n ...
[ "0.6119199", "0.5910067", "0.58422333", "0.57873607", "0.54968417", "0.5398081", "0.5384361", "0.53475744", "0.5263908", "0.5156256", "0.5146889", "0.50837433", "0.5076105", "0.50752836", "0.5016316", "0.49923375", "0.49213877", "0.48776528", "0.48719254", "0.48652685", "0.48...
0.8542046
0
Delete an entry from the given section of the metadata store for a given project. context Context object containing projectDir, the path of the project whose metadata store is to be deleted from section The section the key is to be deleted from key The key to be deleted from the given section of the project metadata ca...
def deleteEntryFromSection(context, section, key, callback=None): projectDir = context.projectDir if section not in GenericMetadata.SECTIONS: raise Exception( "%s is an unknown section" % (section,) ) lockFilepath = os.path.join(projectDir, GenericMetadata.METADATA_LOCKFILE) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def writeEntryToSection(context, section, key, value, callback=None):\n projectDir = context.projectDir\n if section not in GenericMetadata.SECTIONS:\n raise Exception( \"%s is an unknown section\" % (section,) )\n lockFilepath = os.path.join(projectDir, GenericMetadata.METADATA_LOC...
[ "0.5888773", "0.542328", "0.5296165", "0.52698547", "0.5267947", "0.52364236", "0.5207931", "0.51816064", "0.5181545", "0.5153849", "0.51224846", "0.50526917", "0.50315636", "0.50260997", "0.50242794", "0.5008035", "0.4993641", "0.49846393", "0.49762422", "0.4963163", "0.4955...
0.7882322
0
Write an entry in the given section to the metadata store for a given project. Will overwrite the value for a key that already exists context Context object containing projectDir, the path of the project whose metadata store is to be written to section The section the key is to be written to key The key to be written t...
def writeEntryToSection(context, section, key, value, callback=None): projectDir = context.projectDir if section not in GenericMetadata.SECTIONS: raise Exception( "%s is an unknown section" % (section,) ) lockFilepath = os.path.join(projectDir, GenericMetadata.METADATA_LOCKFILE) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _writeEntriesToSection(projectDir, section, keys, values, callback=None):\n numKeys = len(keys)\n if numKeys != len(values):\n raise Exception( \"%d keys specified for %d values\" % (numKeys, len(values)) )\n \n lockFilepath = os.path.join(projectDir, GenericMetadata.META...
[ "0.73840284", "0.6628399", "0.571443", "0.5646245", "0.5634331", "0.5582677", "0.554375", "0.5497565", "0.54227996", "0.5291703", "0.52288014", "0.5225978", "0.5219223", "0.5213694", "0.5208545", "0.5141916", "0.513379", "0.510092", "0.50690436", "0.50044626", "0.49892816", ...
0.8193251
0
Write entries in the given section to the metadata store for a given project. Will overwrite the value for each key that already exists projectDir Path of the project whose metadata store is to be written to section The section the keys are to be written to keys List of keys to be written to the given section of the pr...
def _writeEntriesToSection(projectDir, section, keys, values, callback=None): numKeys = len(keys) if numKeys != len(values): raise Exception( "%d keys specified for %d values" % (numKeys, len(values)) ) lockFilepath = os.path.join(projectDir, GenericMetadata.METADATA_LOCKFIL...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def writeEntryToSection(context, section, key, value, callback=None):\n projectDir = context.projectDir\n if section not in GenericMetadata.SECTIONS:\n raise Exception( \"%s is an unknown section\" % (section,) )\n lockFilepath = os.path.join(projectDir, GenericMetadata.METADATA_LOC...
[ "0.73303044", "0.6265618", "0.5696074", "0.5662361", "0.5601739", "0.5511251", "0.5383638", "0.53310764", "0.5270173", "0.52505934", "0.5145473", "0.5057608", "0.50152016", "0.50072145", "0.49906647", "0.49845642", "0.49584794", "0.4947538", "0.49214426", "0.49152473", "0.488...
0.83927697
0
Write a manifest entry to the metadata store for a given project. Will overwrite the value for a key that already exists context Context object containing projectDir, the path of the project whose metadata store is to be written to key The key to be written to the manifest section of the project metadata value The valu...
def writeManifestEntry(context, key, value): GenericMetadata.writeEntryToSection(context, GenericMetadata.MANIFEST_SECTION, key, value)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def writeEntryToSection(context, section, key, value, callback=None):\n projectDir = context.projectDir\n if section not in GenericMetadata.SECTIONS:\n raise Exception( \"%s is an unknown section\" % (section,) )\n lockFilepath = os.path.join(projectDir, GenericMetadata.METADATA_LOC...
[ "0.6259716", "0.57655275", "0.5742039", "0.5524634", "0.5496938", "0.5429347", "0.54233384", "0.5390245", "0.53718156", "0.536669", "0.5344699", "0.5332121", "0.5274322", "0.52674514", "0.5239261", "0.52279717", "0.5213678", "0.50975734", "0.5095109", "0.50944406", "0.5087725...
0.71485126
0
Write a study area entry to the metadata store for a given project. Will overwrite the value for a key that already exists context Context object containing projectDir, the path of the project whose metadata store is to be written to key The key to be written to the study area section of the project metadata value The ...
def writeStudyAreaEntry(context, key, value): GenericMetadata.writeEntryToSection(context, GenericMetadata.STUDY_AREA_SECTION, key, value)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def writeEntryToSection(context, section, key, value, callback=None):\n projectDir = context.projectDir\n if section not in GenericMetadata.SECTIONS:\n raise Exception( \"%s is an unknown section\" % (section,) )\n lockFilepath = os.path.join(projectDir, GenericMetadata.METADATA_LOC...
[ "0.56092906", "0.55380523", "0.5533075", "0.5486322", "0.5415097", "0.5412373", "0.52140784", "0.5208131", "0.5167864", "0.51001203", "0.5078394", "0.5048557", "0.49965262", "0.4960082", "0.4948646", "0.48635966", "0.48555365", "0.4849937", "0.48480463", "0.48332018", "0.4832...
0.7742472
0
Write a GRASS entry to the metadata store for a given project. Typically used to record the location within a project directory of a GRASS location and mapset, as well as to note the existence of particular datasets stored in the mapset Will overwrite the value for a key that already exists context Context object conta...
def writeGRASSEntry(context, key, value): GenericMetadata.writeEntryToSection(context, GenericMetadata.GRASS_SECTION, key, value)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def writeEntryToSection(context, section, key, value, callback=None):\n projectDir = context.projectDir\n if section not in GenericMetadata.SECTIONS:\n raise Exception( \"%s is an unknown section\" % (section,) )\n lockFilepath = os.path.join(projectDir, GenericMetadata.METADATA_LOC...
[ "0.57098305", "0.5499765", "0.54096854", "0.5396995", "0.53238463", "0.5178773", "0.5174975", "0.5169251", "0.5139384", "0.5127704", "0.50935525", "0.5081287", "0.5065597", "0.4993995", "0.498795", "0.4984682", "0.4982508", "0.49815756", "0.49772733", "0.49714443", "0.4957697...
0.71451133
0
Write a point climate entry to the metadata store for a given project. Will overwrite the value for a key that already exists context Context object containing projectDir, the path of the project whose metadata store is to be written to key The key to be written to the point climate section of the project metadata valu...
def writeClimatePointEntry(context, key, value): GenericMetadata.writeEntryToSection(context, GenericMetadata.CLIMATE_POINT_SECTION, key, value)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def writeClimatePointEntries(context, keys, values):\n GenericMetadata._writeEntriesToSection(context.projectDir, GenericMetadata.CLIMATE_POINT_SECTION, keys, values)", "def writeToMetadata(self, context):\n fqId = self.type + GenericMetadata.COMPOUND_KEY_SEP + self.id\n fqId = fqId.lower()\...
[ "0.7367401", "0.6412568", "0.62726176", "0.59334", "0.5545114", "0.5398628", "0.5321518", "0.5314684", "0.53015107", "0.5264374", "0.52064365", "0.50884044", "0.5035485", "0.5029372", "0.50156707", "0.4898175", "0.48908222", "0.4814849", "0.4801623", "0.4764186", "0.4760266",...
0.78591615
0
Write a point climate entries to the metadata store for a given project. Will overwrite the value for keys that already exist context Context object containing projectDir, the path of the project whose metadata store is to be written to keys List of keys to be written to the point climate section of the project metadat...
def writeClimatePointEntries(context, keys, values): GenericMetadata._writeEntriesToSection(context.projectDir, GenericMetadata.CLIMATE_POINT_SECTION, keys, values)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def writeClimateGridEntries(context, keys, values):\n GenericMetadata._writeEntriesToSection(context.projectDir, GenericMetadata.CLIMATE_GRID_SECTION, keys, values)", "def writeClimatePointEntry(context, key, value):\n GenericMetadata.writeEntryToSection(context, GenericMetadata.CLIMATE_POINT_SECTI...
[ "0.67549765", "0.66737044", "0.66195965", "0.6296745", "0.6239152", "0.59280026", "0.54196686", "0.5238751", "0.51865333", "0.5180364", "0.5136568", "0.512455", "0.5122717", "0.49809092", "0.49597445", "0.49249732", "0.49174872", "0.49159452", "0.48960033", "0.4796764", "0.47...
0.80713403
0
Write a grid climate entry to the metadata store for a given project. Will overwrite the value for a key that already exists context Context object containing projectDir, the path of the project whose metadata store is to be read from key The key to be written to the grid climate section of the project metadata value T...
def writeClimateGridEntry(context, key, value): GenericMetadata.writeEntryToSection(context, GenericMetadata.CLIMATE_GRID_SECTION, key, value)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def writeClimateGridEntries(context, keys, values):\n GenericMetadata._writeEntriesToSection(context.projectDir, GenericMetadata.CLIMATE_GRID_SECTION, keys, values)", "def writeClimatePointEntry(context, key, value):\n GenericMetadata.writeEntryToSection(context, GenericMetadata.CLIMATE_POINT_SECTI...
[ "0.6694937", "0.63357854", "0.6136591", "0.581763", "0.5691291", "0.5482182", "0.53957677", "0.525952", "0.52572453", "0.52550113", "0.52379483", "0.51842844", "0.51610136", "0.5108495", "0.50271004", "0.5011402", "0.4947504", "0.4934356", "0.49206182", "0.48853344", "0.48771...
0.7376574
0
Write a HydroShare entry to the metadata store for a given project. Will overwrite the value for a key that already exists context Context object containing projectDir, the path of the project whose metadata store is to be written to key The key to be written to the study area section of the project metadata value The ...
def writeHydroShareEntry(context, key, value): GenericMetadata.writeEntryToSection(context, GenericMetadata.HYDROSHARE_SECTION, key, value)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def writeEntryToSection(context, section, key, value, callback=None):\n projectDir = context.projectDir\n if section not in GenericMetadata.SECTIONS:\n raise Exception( \"%s is an unknown section\" % (section,) )\n lockFilepath = os.path.join(projectDir, GenericMetadata.METADATA_LOC...
[ "0.6070559", "0.5985404", "0.57395643", "0.5506189", "0.5480306", "0.53947574", "0.5374139", "0.5336701", "0.5335403", "0.53242046", "0.5319031", "0.5252505", "0.52357906", "0.5161735", "0.51210135", "0.51179457", "0.50932795", "0.507933", "0.50530195", "0.5035785", "0.501492...
0.72641283
0
Delete an entry from the manifest section of the metadata store for a given project. context Context object containing projectDir, the path of the project whose metadata store is to be deleted from key The key to be deleted from the given section of the project metadata IOError(errno.EACCES) if the metadata store for t...
def deleteManifestEntry(context, key): GenericMetadata.deleteEntryFromSection(context, GenericMetadata.MANIFEST_SECTION, key)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def deleteEntryFromSection(context, section, key, callback=None):\n projectDir = context.projectDir\n if section not in GenericMetadata.SECTIONS:\n raise Exception( \"%s is an unknown section\" % (section,) )\n lockFilepath = os.path.join(projectDir, GenericMetadata.METADATA_LOCKFIL...
[ "0.68024397", "0.6111268", "0.6022293", "0.5909736", "0.588682", "0.58015454", "0.57910436", "0.5750921", "0.57077354", "0.5683751", "0.5682426", "0.56275785", "0.56221336", "0.5618329", "0.56145746", "0.5569288", "0.55320674", "0.5485642", "0.54798424", "0.5467747", "0.54651...
0.68855435
0
Delete an entry from the study area section of the metadata store for a given project. context Context object containing projectDir, the path of the project whose metadata store is to be deleted from key The key to be deleted from the given section of the project metadata IOError(errno.EACCES) if the metadata store for...
def deleteStudyAreaEntry(context, key): GenericMetadata.deleteEntryFromSection(context, GenericMetadata.STUDY_AREA_SECTION, key)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def deleteEntryFromSection(context, section, key, callback=None):\n projectDir = context.projectDir\n if section not in GenericMetadata.SECTIONS:\n raise Exception( \"%s is an unknown section\" % (section,) )\n lockFilepath = os.path.join(projectDir, GenericMetadata.METADATA_LOCKFIL...
[ "0.639799", "0.5758851", "0.57235366", "0.57130414", "0.5666655", "0.56168956", "0.55672556", "0.5476324", "0.54678047", "0.5369297", "0.5334535", "0.53198314", "0.53188354", "0.5314964", "0.53112054", "0.5301273", "0.52748704", "0.5268022", "0.52541924", "0.52227664", "0.521...
0.70406127
0
Delete an entry from the GRASS section of the metadata store for a given project. context Context object containing projectDir, the path of the project whose metadata store is to be deleted from key The key to be deleted from the given section of the project metadata IOError(errno.EACCES) if the metadata store for the ...
def deleteGRASSEntry(context, key): GenericMetadata.deleteEntryFromSection(context, GenericMetadata.GRASS_SECTION, key)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def deleteEntryFromSection(context, section, key, callback=None):\n projectDir = context.projectDir\n if section not in GenericMetadata.SECTIONS:\n raise Exception( \"%s is an unknown section\" % (section,) )\n lockFilepath = os.path.join(projectDir, GenericMetadata.METADATA_LOCKFIL...
[ "0.663183", "0.6198806", "0.5947854", "0.58994526", "0.58258384", "0.57844085", "0.57791597", "0.57316333", "0.569258", "0.5681562", "0.56727916", "0.5644133", "0.5620544", "0.56173795", "0.55573726", "0.5517395", "0.5476237", "0.5459271", "0.54587215", "0.5442384", "0.543942...
0.67057467
0
Delete an entry from the point climate section of the metadata store for a given project. context Context object containing projectDir, the path of the project whose metadata store is to be deleted from key The key to be deleted from the given section of the project metadata IOError(errno.EACCES) if the metadata store ...
def deleteClimatePointEntry(context, key): GenericMetadata.deleteEntryFromSection(context, GenericMetadata.CLIMATE_POINT_SECTION, key)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def deleteClimateGridEntry(context, key):\n GenericMetadata.deleteEntryFromSection(context, GenericMetadata.CLIMATE_GRID_SECTION, key)", "def deleteEntryFromSection(context, section, key, callback=None):\n projectDir = context.projectDir\n if section not in GenericMetadata.SECTIONS:\n ...
[ "0.657034", "0.64909166", "0.59813344", "0.5950042", "0.5759556", "0.57526565", "0.5573513", "0.55714506", "0.5553916", "0.5483869", "0.5475279", "0.5436373", "0.54319376", "0.5418876", "0.5379181", "0.5350449", "0.531416", "0.52881044", "0.5284254", "0.52753764", "0.52735746...
0.7254461
0
Delete an entry from the grid climate section of the metadata store for a given project. context Context object containing projectDir, the path of the project whose metadata store is to be deleted from key The key to be deleted from the given section of the project metadata IOError(errno.EACCES) if the metadata store f...
def deleteClimateGridEntry(context, key): GenericMetadata.deleteEntryFromSection(context, GenericMetadata.CLIMATE_GRID_SECTION, key)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def deleteEntryFromSection(context, section, key, callback=None):\n projectDir = context.projectDir\n if section not in GenericMetadata.SECTIONS:\n raise Exception( \"%s is an unknown section\" % (section,) )\n lockFilepath = os.path.join(projectDir, GenericMetadata.METADATA_LOCKFIL...
[ "0.6503831", "0.64400357", "0.6210888", "0.61607176", "0.6114747", "0.5806895", "0.57731616", "0.5720591", "0.5711945", "0.5704156", "0.5704014", "0.5659985", "0.56278455", "0.556038", "0.54745364", "0.54652095", "0.54497516", "0.54400027", "0.54372054", "0.5431896", "0.54317...
0.6943208
0
Delete an entry from the HydroShare section of the metadata store for a given project. context Context object containing projectDir, the path of the project whose metadata store is to be deleted from key The key to be deleted from the given section of the project metadata IOError(errno.EACCES) if the metadata store for...
def deleteHydroShareEntry(context, key): GenericMetadata.deleteEntryFromSection(context, GenericMetadata.HYDROSHARE_SECTION, key)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def deleteEntryFromSection(context, section, key, callback=None):\n projectDir = context.projectDir\n if section not in GenericMetadata.SECTIONS:\n raise Exception( \"%s is an unknown section\" % (section,) )\n lockFilepath = os.path.join(projectDir, GenericMetadata.METADATA_LOCKFIL...
[ "0.66969836", "0.6114704", "0.59135765", "0.58948624", "0.58330137", "0.5749956", "0.5720702", "0.5715892", "0.5683251", "0.56806993", "0.5660069", "0.56545544", "0.5646248", "0.5645598", "0.56452", "0.56423646", "0.56192744", "0.56175125", "0.5605478", "0.5603749", "0.556898...
0.6612039
1
Write grid climate entries to the metadata store for a given project. Will overwrite the value for keys that already exist context Context object containing projectDir, the path of the project whose metadata store is to be read from key List of keys to be written to the grid climate section of the project metadata valu...
def writeClimateGridEntries(context, keys, values): GenericMetadata._writeEntriesToSection(context.projectDir, GenericMetadata.CLIMATE_GRID_SECTION, keys, values)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def writeClimatePointEntries(context, keys, values):\n GenericMetadata._writeEntriesToSection(context.projectDir, GenericMetadata.CLIMATE_POINT_SECTION, keys, values)", "def _writeEntriesToSection(projectDir, section, keys, values, callback=None):\n numKeys = len(keys)\n if numKeys != len(va...
[ "0.67957145", "0.66655767", "0.6512811", "0.6203893", "0.56767184", "0.54653037", "0.5448667", "0.52735066", "0.52370846", "0.5186844", "0.50501317", "0.5009672", "0.49810913", "0.49324104", "0.48789868", "0.48425463", "0.48071223", "0.48050776", "0.47918886", "0.47881624", "...
0.7622373
0
Write a provenance entry to the metadata store for a given project. Will overwrite a the value for a key that already exists context Context object containing projectDir, the path of the project whose metadata store is to be written to key The key to be written to the provenance section of the project metadata value Th...
def writeProvenanceEntry(context, key, value): GenericMetadata.writeEntryToSection(context, GenericMetadata.PROVENANCE_SECTION, key, value)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def writeProvenanceEntries(context, keys, values):\n GenericMetadata._writeEntriesToSection(context.projectDir, GenericMetadata.PROVENANCE_SECTION, keys, values)", "def writeToMetadata(self, context):\n fqId = self.section + GenericMetadata.COMPOUND_KEY_SEP + self.name\n fqId = fqId.lower()\...
[ "0.702613", "0.60999066", "0.5898809", "0.5638033", "0.55177164", "0.5379722", "0.52836007", "0.52061015", "0.51149523", "0.50688386", "0.50665015", "0.5016869", "0.50116354", "0.4975159", "0.4963921", "0.49586692", "0.49479687", "0.49324423", "0.4919253", "0.49008313", "0.48...
0.7517834
0
Write model run entries to the metadata store for a given project. Will overwrite the values of keys that already exist context Context object containing projectDir, the path of the project whose metadata store is to be written to keys The keys to be written to the model run section of the project metadata values The v...
def writeModelRunEntries(context, keys, values): GenericMetadata._writeEntriesToSection(context.projectDir, GenericMetadata.MODEL_RUN_SECTION, keys, values)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def writeToMetadata(self, context):\n if self.modelType not in GenericMetadata.MODEL_TYPES:\n raise Exception(\"Model type %s is not among known model types: %s\" % (self.modelType, str(GenericMetadata.MODEL_TYPES) ) )\n \n modelRunEntries = GenericMetadata.readModelRunEntries(conte...
[ "0.70324004", "0.624896", "0.5617584", "0.5436556", "0.5102913", "0.50380903", "0.5019441", "0.5013116", "0.48381904", "0.4805784", "0.4781773", "0.47577384", "0.47417828", "0.47400704", "0.47357443", "0.47232473", "0.4700202", "0.4680056", "0.46675187", "0.4654608", "0.46476...
0.8042498
0
Write provenance entries to the metadata store for a given project. Will overwrite the values of keys that already exist context Context object containing projectDir, the path of the project whose metadata store is to be written to keys The keys to be written to the provenance section of the project metadata values The...
def writeProvenanceEntries(context, keys, values): GenericMetadata._writeEntriesToSection(context.projectDir, GenericMetadata.PROVENANCE_SECTION, keys, values)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def writeProvenanceEntry(context, key, value):\n GenericMetadata.writeEntryToSection(context, GenericMetadata.PROVENANCE_SECTION, key, value)", "def _writeEntriesToSection(projectDir, section, keys, values, callback=None):\n numKeys = len(keys)\n if numKeys != len(values):\n raise...
[ "0.6461782", "0.61798054", "0.57821673", "0.5684524", "0.553569", "0.5147128", "0.51318043", "0.5116621", "0.5025456", "0.49987754", "0.4958191", "0.49401796", "0.4920296", "0.49061567", "0.49038157", "0.4880907", "0.484493", "0.48360598", "0.48308468", "0.48263413", "0.47989...
0.7994784
0
Read all entries for the given section from the metadata store for a given project projectDir Absolute path of the project whose metadata are to be read section The section the key is to be written to A dictionary of key/value pairs from the given section of the project metadata
def _readEntriesForSection(projectDir, section): sectionDict = dict() metadataFilepath = os.path.join(projectDir, GenericMetadata.METADATA_FILENAME) if os.path.exists(metadataFilepath): if not os.access(metadataFilepath, os.R_OK): raise IOError(errno.EACCES, "Unable t...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _writeEntriesToSection(projectDir, section, keys, values, callback=None):\n numKeys = len(keys)\n if numKeys != len(values):\n raise Exception( \"%d keys specified for %d values\" % (numKeys, len(values)) )\n \n lockFilepath = os.path.join(projectDir, GenericMetadata.META...
[ "0.6082751", "0.59797823", "0.5723508", "0.57017773", "0.5615351", "0.54072076", "0.5341342", "0.5338873", "0.5323583", "0.52857554", "0.5253614", "0.52374613", "0.52353126", "0.50894105", "0.5071754", "0.5071219", "0.5067303", "0.50422764", "0.50369376", "0.5034055", "0.5032...
0.8505662
0
Read all manifest entries from the metadata store for a given project context Context object containing projectDir, the path of the project whose metadata store is to be read from A dictionary of key/value pairs from the manifest section of the project metadata
def readManifestEntries(context): return GenericMetadata._readEntriesForSection(context.projectDir, GenericMetadata.MANIFEST_SECTION)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _readEntriesForSection(projectDir, section):\n sectionDict = dict()\n metadataFilepath = os.path.join(projectDir, GenericMetadata.METADATA_FILENAME)\n if os.path.exists(metadataFilepath):\n if not os.access(metadataFilepath, os.R_OK):\n raise IOError(errno.EACCES,...
[ "0.6394254", "0.6376437", "0.62439424", "0.6131808", "0.60059315", "0.5966567", "0.5847774", "0.5758215", "0.57482386", "0.568868", "0.56461066", "0.5581038", "0.55642676", "0.5561107", "0.55594665", "0.5524265", "0.5524265", "0.55144745", "0.54978037", "0.5488108", "0.548344...
0.7806468
0
Read all study area entries from the metadata store for a given project context Context object containing projectDir, the path of the project whose metadata store is to be read from A dictionary of key/value pairs from the study area section of the project metadata
def readStudyAreaEntries(context): return GenericMetadata._readEntriesForSection(context.projectDir, GenericMetadata.STUDY_AREA_SECTION)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _readEntriesForSection(projectDir, section):\n sectionDict = dict()\n metadataFilepath = os.path.join(projectDir, GenericMetadata.METADATA_FILENAME)\n if os.path.exists(metadataFilepath):\n if not os.access(metadataFilepath, os.R_OK):\n raise IOError(errno.EACCES,...
[ "0.5813684", "0.5588683", "0.53330386", "0.5267538", "0.52265596", "0.5189714", "0.51646703", "0.51445687", "0.5102872", "0.5077357", "0.50310695", "0.5018051", "0.49929735", "0.4955393", "0.49027565", "0.48494425", "0.48395818", "0.48371568", "0.48293978", "0.48228657", "0.4...
0.78608793
0
Read all GRASS entries from the metadata store for a given project context Context object containing projectDir, the path of the project whose metadata store is to be read from A dictionary of key/value pairs from the GRASS section of the project metadata
def readGRASSEntries(context): return GenericMetadata._readEntriesForSection(context.projectDir, GenericMetadata.GRASS_SECTION)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _readEntriesForSection(projectDir, section):\n sectionDict = dict()\n metadataFilepath = os.path.join(projectDir, GenericMetadata.METADATA_FILENAME)\n if os.path.exists(metadataFilepath):\n if not os.access(metadataFilepath, os.R_OK):\n raise IOError(errno.EACCES,...
[ "0.6236531", "0.55502063", "0.54002386", "0.5369209", "0.5348187", "0.5330783", "0.528488", "0.5277649", "0.5223101", "0.521148", "0.52064604", "0.5200986", "0.5190385", "0.5173091", "0.5053825", "0.504017", "0.5016032", "0.49565023", "0.49422446", "0.49338242", "0.491178", ...
0.7260052
0
Read all point model run entries from the metadata store for a given project context Context object containing projectDir, the path of the project whose metadata store is to be read from A dictionary of key/value pairs from the model run section of the project metadata
def readModelRunEntries(context): return GenericMetadata._readEntriesForSection(context.projectDir, GenericMetadata.MODEL_RUN_SECTION)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def readModelRuns(context):\n modelRunObjects = []\n modelRuns = GenericMetadata.readModelRunEntries(context)\n try:\n runs = modelRuns['runs'].split(GenericMetadata.VALUE_DELIM)\n for run in runs:\n modelRunObjects.append(ModelRun.readFromMetadata(context,...
[ "0.59670794", "0.5889647", "0.5816284", "0.5717778", "0.5466364", "0.52447045", "0.52259123", "0.51424", "0.5129271", "0.50799537", "0.49862528", "0.4979997", "0.49188805", "0.49156836", "0.49127826", "0.49025348", "0.48849607", "0.48842287", "0.4880458", "0.48771808", "0.487...
0.7738944
0
Read all model runs from metadata and store in ModelRun instances. context Context object containing projectDir, the path of the project whose metadata store is to be read from A list of ModelRun objects
def readModelRuns(context): modelRunObjects = [] modelRuns = GenericMetadata.readModelRunEntries(context) try: runs = modelRuns['runs'].split(GenericMetadata.VALUE_DELIM) for run in runs: modelRunObjects.append(ModelRun.readFromMetadata(context, run)) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def readModelRunEntries(context):\n return GenericMetadata._readEntriesForSection(context.projectDir, GenericMetadata.MODEL_RUN_SECTION)", "def writeToMetadata(self, context):\n if self.modelType not in GenericMetadata.MODEL_TYPES:\n raise Exception(\"Model type %s is not among known mod...
[ "0.7975116", "0.66243535", "0.5843691", "0.5701001", "0.56369174", "0.55518204", "0.5430202", "0.5383377", "0.53384364", "0.5260111", "0.5252604", "0.52399814", "0.5229123", "0.52053994", "0.5201298", "0.51903266", "0.5172383", "0.51055664", "0.50917447", "0.50577384", "0.505...
0.75045604
1
Read all point climate entries from the metadata store for a given project context Context object containing projectDir, the path of the project whose metadata store is to be read from A dictionary of key/value pairs from the point climate section of the project metadata
def readClimatePointEntries(context): return GenericMetadata._readEntriesForSection(context.projectDir, GenericMetadata.CLIMATE_POINT_SECTION)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def readClimateGridEntries(context):\n return GenericMetadata._readEntriesForSection(context.projectDir, GenericMetadata.CLIMATE_GRID_SECTION)", "def writeClimatePointEntries(context, keys, values):\n GenericMetadata._writeEntriesToSection(context.projectDir, GenericMetadata.CLIMATE_POINT_SECTION, ...
[ "0.65940845", "0.60609496", "0.58755904", "0.57020724", "0.5674292", "0.5553107", "0.5467524", "0.54135525", "0.5330131", "0.5210221", "0.5012895", "0.501239", "0.50113815", "0.50112027", "0.49934754", "0.49894994", "0.49829355", "0.4965743", "0.4952534", "0.49039957", "0.488...
0.78822577
0
Read all climate point stations from metadata and store in ClimatePointStation instances. context Context object containing projectDir, the path of the project whose metadata store is to be read from A list of ClimatePointStation objects
def readClimatePointStations(context): stationObjects = [] climatePoints = GenericMetadata.readClimatePointEntries(context) try: stations = climatePoints['stations'].split(GenericMetadata.VALUE_DELIM) for station in stations: stationObjects.append(ClimateP...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def readClimatePointEntries(context):\n return GenericMetadata._readEntriesForSection(context.projectDir, GenericMetadata.CLIMATE_POINT_SECTION)", "def readFromMetadata(cls, context, fqId):\n newInstance = ClimatePointStation()\n (newInstance.type, newInstance.id) = fqId.split(GenericMetadat...
[ "0.6891495", "0.6260505", "0.60463357", "0.5638666", "0.5469626", "0.53563493", "0.52621317", "0.5249585", "0.5202059", "0.51837224", "0.5047539", "0.5045007", "0.49937794", "0.4993661", "0.49833637", "0.49792498", "0.49386016", "0.4915742", "0.49026728", "0.48896354", "0.486...
0.7727756
0
Read all grid climate entries from the metadata store for a given project context Context object containing projectDir, the path of the project whose metadata store is to be read from A dictionary of key/value pairs from the grid climate section of the project metadata
def readClimateGridEntries(context): return GenericMetadata._readEntriesForSection(context.projectDir, GenericMetadata.CLIMATE_GRID_SECTION)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def readClimatePointEntries(context):\n return GenericMetadata._readEntriesForSection(context.projectDir, GenericMetadata.CLIMATE_POINT_SECTION)", "def writeClimateGridEntries(context, keys, values):\n GenericMetadata._writeEntriesToSection(context.projectDir, GenericMetadata.CLIMATE_GRID_SECTION, ...
[ "0.67343694", "0.60257065", "0.5869046", "0.5570541", "0.5408377", "0.5368976", "0.5334755", "0.5279146", "0.5261112", "0.520745", "0.5160814", "0.509415", "0.5077306", "0.50602674", "0.50406206", "0.5021482", "0.50120205", "0.50023395", "0.49895978", "0.49739048", "0.4973186...
0.776974
0
Read all HydroShare entries from the metadata store for a given project context Context object containing projectDir, the path of the project whose metadata store is to be read from A dictionary of key/value pairs from the study area section of the project metadata
def readHydroShareEntries(context): return GenericMetadata._readEntriesForSection(context.projectDir, GenericMetadata.HYDROSHARE_SECTION)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def readStudyAreaEntries(context):\n return GenericMetadata._readEntriesForSection(context.projectDir, GenericMetadata.STUDY_AREA_SECTION)", "def _readEntriesForSection(projectDir, section):\n sectionDict = dict()\n metadataFilepath = os.path.join(projectDir, GenericMetadata.METADATA_FILENAM...
[ "0.6450273", "0.57527316", "0.56171817", "0.5374528", "0.52916473", "0.52504206", "0.5133669", "0.50766104", "0.5059053", "0.50468785", "0.50408566", "0.5025768", "0.50213546", "0.5007927", "0.5003622", "0.49593022", "0.4933783", "0.4924062", "0.49204034", "0.48943752", "0.48...
0.71390635
0
Read all provenance entries from the metadata store for a given project context Context object containing projectDir, the path of the project whose metadata store is to be read from A dictionary of key/value pairs from the provenance section of the project metadata
def readProvenanceEntries(context): return GenericMetadata._readEntriesForSection(context.projectDir, GenericMetadata.PROVENANCE_SECTION)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def readAssetProvenanceObjects(context):\n assetProvenanceObjects = []\n provenance = GenericMetadata.readProvenanceEntries(context)\n try:\n assets = provenance['entities'].split(GenericMetadata.VALUE_DELIM)\n for asset in assets:\n assetProvenanceObjects....
[ "0.6217764", "0.5992833", "0.59291553", "0.5594025", "0.52970666", "0.52535784", "0.52164847", "0.51783854", "0.5124159", "0.51027024", "0.50449044", "0.4907859", "0.48889193", "0.48857158", "0.48617345", "0.48610404", "0.4849621", "0.48259637", "0.4825313", "0.48153925", "0....
0.7970474
0
Read all asset provenance objects from metadata and store in AssetProvenance instances. context Context object containing projectDir, the path of the project whose metadata store is to be read from A list of AssetProvenance objects
def readAssetProvenanceObjects(context): assetProvenanceObjects = [] provenance = GenericMetadata.readProvenanceEntries(context) try: assets = provenance['entities'].split(GenericMetadata.VALUE_DELIM) for asset in assets: assetProvenanceObjects.append(Asse...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def readProvenanceEntries(context):\n return GenericMetadata._readEntriesForSection(context.projectDir, GenericMetadata.PROVENANCE_SECTION)", "def readFromMetadata(cls, context, fqId):\n newInstance = AssetProvenance()\n (newInstance.section, newInstance.name) = fqId.split(GenericMetadata.CO...
[ "0.7364113", "0.5579493", "0.5348965", "0.5258582", "0.5069704", "0.5014022", "0.49614912", "0.47507623", "0.4680159", "0.46775454", "0.46405664", "0.45859373", "0.45534492", "0.45287368", "0.44924214", "0.4465639", "0.44465446", "0.4427319", "0.44135317", "0.44028857", "0.43...
0.8090247
0
Get processing history stored in the project metadata context Context object containing projectDir, the path of the project whose metadata store is to be written to List containing strings representing history items
def getProcessingHistoryList(context): projectDir = context.projectDir steps = [] history = GenericMetadata._readEntriesForSection(projectDir, GenericMetadata.HISTORY_SECTION) try: idx = int(history['numsteps']) + 1 for i in xrange(1, idx): key = G...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def history(self):\n return self.info['history']", "def History(self):\n return self.historydict.get('history', [])", "def get_history(self):\n return self.history", "def history():", "def appendProcessingHistoryItem(context, item):\n projectDir = context.projectDir\n history...
[ "0.63497823", "0.61489075", "0.60992277", "0.6044155", "0.5910439", "0.5873644", "0.5873644", "0.5873545", "0.58652145", "0.5827695", "0.5823784", "0.58060896", "0.58035296", "0.5702808", "0.567759", "0.5677286", "0.5677286", "0.5677286", "0.5669729", "0.5659796", "0.5648869"...
0.75734115
0
Write an item to the processing history stored in the project metadata context Context object containing projectDir, the path of the project whose metadata store is to be written to item String representing item to be written to processing history
def appendProcessingHistoryItem(context, item): projectDir = context.projectDir history = GenericMetadata._readEntriesForSection(projectDir, GenericMetadata.HISTORY_SECTION) try: idx = int(history['numsteps']) except KeyError: idx = 0 idx += 1 ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def writeRecentItems(self, filename):\n if self.recent_items == None:\n return\n else:\n try:\n file_open = open(filename, 'w')\n text = \"\"\n for key in self.recent_items:\n full_path = self.recent_items[key] + ke...
[ "0.5538956", "0.54137826", "0.5284954", "0.5267855", "0.5262807", "0.52533287", "0.5198412", "0.5144163", "0.50825036", "0.5042891", "0.50389177", "0.50350785", "0.5034479", "0.50320613", "0.5019872", "0.50136083", "0.5003788", "0.49449867", "0.48960865", "0.4886148", "0.4882...
0.73133624
0
Evaluate the sum of all the amicable numbers under > number
def sum_of_amicable_numbers(number: int): start_time = time.time() amicable = set() for n in range(1, number): if n not in amicable: a = sum_of_proper_divisors(n) b = sum_of_proper_divisors(a) if (n == b) and not (n == b == a): amicable.add(n) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def sum_of_numbers(numbers):\r\n return sum(numbers)", "def solution(number):\n\n # a is a list with all the numbers below input that are multiples of 3 or 5\n a = [x for x in range(1,number) if x % 3 == 0 or x % 5 == 0]\n return sum(a)", "def sum_amnicable(limit):\n return sum(map(lambda num: num * i...
[ "0.6975791", "0.6823644", "0.6765109", "0.6445833", "0.6376807", "0.6357019", "0.6341432", "0.6254372", "0.62135017", "0.62022454", "0.6195927", "0.6166796", "0.61620706", "0.61299115", "0.6123273", "0.6048174", "0.6036229", "0.60346645", "0.602642", "0.602642", "0.6026195", ...
0.70709777
0
Get an instance of the event loop manager for this factory.
def manager(self): if not self._manager: self._manager = TwistedEventLoopManager() return self._manager
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_event_loop():\n try:\n return asyncio.get_running_loop()\n except RuntimeError:\n return asyncio.new_event_loop()", "def get_event_loop(*args, **kwargs):\r\n\r\n return get_loop(*args, **kwargs)", "def get_event_loop() -> KivyEventLoop:\n return asyncio.get_event_loop()", "d...
[ "0.74030995", "0.73900837", "0.6850553", "0.675802", "0.6663396", "0.66488266", "0.65802383", "0.63889515", "0.63624215", "0.633409", "0.6304668", "0.62948436", "0.6289953", "0.6274178", "0.6228322", "0.62256956", "0.6130377", "0.59798896", "0.596554", "0.5839572", "0.5799308...
0.78999525
0
Set the maximum delay in seconds for reconnecting to rosbridge (3600 seconds by default).
def set_max_delay(cls, max_delay): LOGGER.debug("Updating max delay to {} seconds".format(max_delay)) # See https://twistedmatrix.com/documents/19.10.0/api/twisted.internet.protocol.ReconnectingClientFactory.html cls.maxDelay = max_delay
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_retry_timeout(self, retry_timeout):", "def set_timeout(self, timeout):\n self.timeout = timeout", "def setTimeOut(self, timeout=6.0):\n self.timeout = timeout", "def settimeout(self,timeout=10):\r\n # Update\r\n self.timeout = timeout", "def set_timeout(self, seconds):\n self...
[ "0.6883001", "0.6444856", "0.64174986", "0.64024204", "0.6298543", "0.6273594", "0.6224674", "0.6222063", "0.6192602", "0.614306", "0.6132622", "0.6123391", "0.6113951", "0.6093116", "0.60815483", "0.60418", "0.6031176", "0.60070217", "0.6000383", "0.5989497", "0.5939702", ...
0.7337287
0
Set the initial delay in seconds for reconnecting to rosbridge (1 second by default).
def set_initial_delay(cls, initial_delay): LOGGER.debug("Updating initial delay to {} seconds".format(initial_delay)) # See https://twistedmatrix.com/documents/19.10.0/api/twisted.internet.protocol.ReconnectingClientFactory.html cls.initialDelay = initial_delay
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def reconnect(self, seconds: int) -> None:", "def set_retry_timeout(self, retry_timeout):", "def attempt_reconnect(self):\n time.sleep(self.reconnect_delay)\n self.connect_to()", "def reset_time_out(self):\n self.reconnect()\n self.reconnect_params()", "def delay():\r\n time....
[ "0.63564193", "0.63120914", "0.6191868", "0.61457485", "0.60059255", "0.596495", "0.5907743", "0.5899166", "0.58699244", "0.58644134", "0.5837313", "0.578545", "0.576132", "0.5743831", "0.57401067", "0.5719824", "0.57179666", "0.5700087", "0.56863904", "0.5656275", "0.5645644...
0.7081216
0
Set the maximum number or connection retries when the rosbridge connection is lost (no limit by default).
def set_max_retries(cls, max_retries): LOGGER.debug("Updating max retries to {}".format(max_retries)) # See https://twistedmatrix.com/documents/19.10.0/api/twisted.internet.protocol.ReconnectingClientFactory.html cls.maxRetries = max_retries
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def max_retries(self, max_retries: ConfigNodePropertyInteger):\n\n self._max_retries = max_retries", "def set_connectionretry(value):\n environ[\"XRD_CONNECTIONRETRY\"] = str(value)", "def max_retries(self) -> ConfigNodePropertyInteger:\n return self._max_retries", "def set_max_retries(self,...
[ "0.7256527", "0.7019554", "0.6741667", "0.6694928", "0.6693451", "0.64660996", "0.61524314", "0.61477476", "0.6094627", "0.60413826", "0.5966964", "0.59602076", "0.5908201", "0.58888686", "0.5843294", "0.5831719", "0.58292305", "0.58066034", "0.57978034", "0.5777352", "0.5754...
0.7344416
0
Call the given function from a thread, and wait for the result synchronously for as long as the timeout will allow.
def blocking_call_from_thread(self, callback, timeout): result_placeholder = defer.Deferred() if timeout: result_placeholder.addTimeout(timeout, reactor, onTimeoutCancel=self.raise_timeout_exception) return threads.blockingCallFromThread(reactor, callback, result_placeholder)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def call_in_waiting_thread(\n __call: Union[Callable[[], T], Call[T]],\n thread: threading.Thread,\n timeout: Optional[float] = None,\n ) -> T:\n raise NotImplementedError()", "def process_and_join_thread(thread, timeout=0.1):\n def test_func():\n thread.join(timeout)\n ...
[ "0.7358714", "0.6953007", "0.6871666", "0.68064636", "0.6705682", "0.66787475", "0.66639745", "0.65851456", "0.65605766", "0.64959145", "0.6363027", "0.6351364", "0.63138753", "0.6275723", "0.62373906", "0.6194692", "0.6164229", "0.6100586", "0.6081948", "0.607668", "0.607663...
0.7449713
0
Get the callback which, when called, provides result_placeholder with the result.
def get_inner_callback(self, result_placeholder): def inner_callback(result): result_placeholder.callback({"result": result}) return inner_callback
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_inner_errback(self, result_placeholder):\n\n def inner_errback(error):\n result_placeholder.callback({\"exception\": error})\n\n return inner_errback", "def placeholder():\n return ResultProxy(TaskResult())", "def on_result(self, callback):\n self.result_callback = ca...
[ "0.69873226", "0.6811237", "0.6682561", "0.60813755", "0.59589845", "0.5794099", "0.57086885", "0.5683732", "0.56691265", "0.55882865", "0.5580149", "0.5574545", "0.5567593", "0.5566626", "0.55497885", "0.55393505", "0.5519004", "0.55113274", "0.5498118", "0.5496209", "0.5481...
0.835267
0
Get the errback which, when called, provides result_placeholder with the error.
def get_inner_errback(self, result_placeholder): def inner_errback(error): result_placeholder.callback({"exception": error}) return inner_errback
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def repr_failure(self, excinfo):\n if excinfo.errisinstance(MypyError):\n return excinfo.value.args[0]\n return super().repr_failure(excinfo)", "def errback(result):\n append(result)\n return None", "def result_stderr(result):\n return result[1][1]", "def err...
[ "0.653857", "0.64817667", "0.62341356", "0.6198013", "0.6175378", "0.59674317", "0.59652656", "0.58356804", "0.5834942", "0.5793907", "0.57484853", "0.57245123", "0.5630114", "0.5626561", "0.56203365", "0.56203365", "0.5619572", "0.561235", "0.56108445", "0.56080973", "0.5576...
0.8095896
0
Prepare the texture cache
def initTextureCache(): global textureCache textureCache = {}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def prepare_texture(resource):\n global tex\n image = pygame.image.load(resource)\n image = pygame.transform.scale(image, (Case.pixel_size, Case.pixel_size))\n image_rect = image.get_rect()\n return image, image_rect", "def populate_texture(self, texture):\n texture.blit_buffer(self._cbuffe...
[ "0.6436398", "0.61779374", "0.61091405", "0.6104321", "0.6104049", "0.6022134", "0.5968218", "0.5916947", "0.59023964", "0.58662575", "0.5826121", "0.5810249", "0.56719536", "0.56409365", "0.56295377", "0.56141543", "0.56082964", "0.5571378", "0.5571103", "0.5556055", "0.5555...
0.8022769
0
Draw the triangles in the array. GL_T2F_C4F_N3F_V3F
def drawFromArray(array, textured): if textured: npt = 36 # Number of things per traingle else: npt = 30 vC = len(array) / npt # Veretex count npv = npt / 3 # Number of things per vertex glBegin(GL_TRIANGLES) if textured: for j in range(vC): for i in range(3): cV = j * npt +...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def draw_triangle(tup):\n x, y, z = tup[0], tup[1], tup[2]\n t_draw = turtle.Turtle()\n for index in range(3):\n t_draw.forward()", "def drawTriangle(t, color, x, y):\n ## t.color(color)\n ## t.begin_fill()\n for i in range(3):\n t.forward(x)\n t.right(y)", "def drawNormals...
[ "0.67465776", "0.654085", "0.64874524", "0.64179724", "0.6185056", "0.6159797", "0.60921663", "0.60909677", "0.5993798", "0.5980469", "0.5941917", "0.5735626", "0.572072", "0.5639475", "0.55550486", "0.5534714", "0.5518024", "0.5507215", "0.5502695", "0.5499609", "0.5481365",...
0.66250885
1
This method is to find DB2 version from the unzip binary
def get_db2_binary_fixpack_version(STAGE_DIRECTORY): val = "" path_for_base_db2_file = "" db2_version_list = ['10.1', '10.5', '9.7', '9.5'] dir_list = glob.glob("%s/*" % (STAGE_DIRECTORY)) for elm in dir_list: fixpack_type = os.path.split(elm)[-1] if fixpack_type.startswith('u...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_db2_binary_build_version(STAGE_DIRECTORY):\r\n val = \"\"\r\n path_for_base_db2_file = \"\"\r\n db2_version_list = ['10.1', '10.5', '9.7', '9.5']\r\n dir_list = glob.glob(\"%s/*\" % (STAGE_DIRECTORY))\r\n for elm in dir_list:\r\n fixpack_type = os.path.split(elm)[-1]\r\n if fix...
[ "0.7822165", "0.64030504", "0.6169352", "0.6081289", "0.59697837", "0.5912215", "0.5901315", "0.58462954", "0.575202", "0.5719525", "0.57052153", "0.5702572", "0.5686477", "0.56752723", "0.56657815", "0.5625068", "0.56241447", "0.56233686", "0.56189835", "0.56164765", "0.5613...
0.76075125
1
Test the open and close functionality using an identifier.
def testOpenCloseIdentifier(self): path_spec = path_spec_factory.Factory.NewPathSpec( definitions.TYPE_INDICATOR_TSK, inode=self._IDENTIFIER_PASSWORDS_TXT, parent=self._bde_path_spec) file_object = tsk_file_io.TSKFile(self._resolver_context, path_spec) self._TestOpenCloseIdentifier(file_obj...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_auto_open(self):\n # todo implement", "def testOpenCloseInode(self):\n self._TestOpenCloseInode(self._tsk_partition_path_spec)", "def testOpenCloseInode(self):\n self._TestOpenCloseInode(self._tsk_partition_path_spec)", "def test_cover_open_close(self):\n with patch.dict(TYPES, {...
[ "0.64999694", "0.63243794", "0.63243794", "0.6233374", "0.5917162", "0.58881676", "0.5855626", "0.5776896", "0.5713112", "0.55846924", "0.5579715", "0.54898465", "0.54159117", "0.53447366", "0.5338322", "0.5319229", "0.5319229", "0.5319229", "0.5319229", "0.5319229", "0.52860...
0.7052777
1
Test the seek functionality.
def testSeek(self): path_spec = path_spec_factory.Factory.NewPathSpec( definitions.TYPE_INDICATOR_TSK, location='/a_directory/another_file', inode=self._IDENTIFIER_ANOTHER_FILE, parent=self._bde_path_spec) file_object = tsk_file_io.TSKFile(self._resolver_context, path_spec) self._TestSeek(f...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def testSeek(self):\n self._TestSeek(self._tsk_partition_path_spec)", "def testSeek(self):\n self._TestSeek(self._tsk_partition_path_spec)", "def seekable(self):\n ...", "def seek(self, *args) -> \"int\":\n return _ida_fpro.qfile_t_seek(self, *args)", "def test_seek_tell(self):\n ...
[ "0.7948346", "0.7948346", "0.72462237", "0.71158445", "0.7113932", "0.70292354", "0.67135704", "0.6571655", "0.6559805", "0.6557865", "0.65500414", "0.65049493", "0.63947237", "0.6227877", "0.6180919", "0.61479574", "0.6112446", "0.6111428", "0.60112697", "0.5997623", "0.5995...
0.7980517
0
Test the open and close functionality using an identifier.
def testOpenCloseIdentifier(self): path_spec = path_spec_factory.Factory.NewPathSpec( definitions.TYPE_INDICATOR_TSK, inode=self._IDENTIFIER_PASSWORDS_TXT, parent=self._bde_path_spec) file_object = tsk_file_io.TSKFile(self._resolver_context, path_spec) self._TestOpenCloseIdentifier(file_obj...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_auto_open(self):\n # todo implement", "def testOpenCloseInode(self):\n self._TestOpenCloseInode(self._tsk_partition_path_spec)", "def testOpenCloseInode(self):\n self._TestOpenCloseInode(self._tsk_partition_path_spec)", "def test_cover_open_close(self):\n with patch.dict(TYPES, {...
[ "0.650188", "0.6326021", "0.6326021", "0.6236123", "0.5919346", "0.5891023", "0.5856933", "0.5779075", "0.57124746", "0.5586663", "0.5581367", "0.54916066", "0.54180956", "0.5346649", "0.5339649", "0.5322929", "0.5322929", "0.5322929", "0.5322929", "0.5322929", "0.52880347", ...
0.70521885
0
Test the seek functionality.
def testSeek(self): path_spec = path_spec_factory.Factory.NewPathSpec( definitions.TYPE_INDICATOR_TSK, location='/a_directory/another_file', inode=self._IDENTIFIER_ANOTHER_FILE, parent=self._bde_path_spec) file_object = tsk_file_io.TSKFile(self._resolver_context, path_spec) self._TestSeek(f...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def testSeek(self):\n self._TestSeek(self._tsk_partition_path_spec)", "def testSeek(self):\n self._TestSeek(self._tsk_partition_path_spec)", "def seekable(self):\n ...", "def seek(self, *args) -> \"int\":\n return _ida_fpro.qfile_t_seek(self, *args)", "def test_seek_tell(self):\n ...
[ "0.7948346", "0.7948346", "0.72462237", "0.71158445", "0.7113932", "0.70292354", "0.67135704", "0.6571655", "0.6559805", "0.6557865", "0.65500414", "0.65049493", "0.63947237", "0.6227877", "0.6180919", "0.61479574", "0.6112446", "0.6111428", "0.60112697", "0.5997623", "0.5995...
0.7980517
1
Load a graph matrix from Matlab file
def load_graph(graphname,path='./data/',mname='A'): data=sio.loadmat(path+graphname) return data[mname]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def read_graph(graph_path):\n print(\"\\nTarget matrix creation started.\\n\")\n graph = nx.from_edgelist(pd.read_csv(graph_path).values.tolist())\n graph.remove_edges_from(graph.selfloop_edges())\n return graph", "def load_file(filename):\n # Create matrix from csv lines\n with open(filename) ...
[ "0.722248", "0.7186501", "0.70386183", "0.6996951", "0.69011986", "0.68942666", "0.67839843", "0.6767686", "0.6647032", "0.66407907", "0.6560666", "0.6553847", "0.6541998", "0.6532575", "0.65297693", "0.65271306", "0.6526533", "0.64736503", "0.64715844", "0.6471263", "0.64670...
0.75700504
0
Returns the Clang version number given an executable.
def _getClangVersion(clangExe): args = [getPath(clangExe), '--version'] try: p = subprocess.Popen( args=args, stdout=subprocess.PIPE, ) except EnvironmentError, e: raise EnvironmentError( "cake: failed to launch %s: %s\n" % (args[0], str(e)) ) stdoutText = p.stdout.readline...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def GetClangVersion(clang_path):\n\n version_re = re.compile(r'clang version (\\d+)\\.(\\d+)')\n output = subprocess.check_output([clang_path, '--version'])\n match = version_re.search(output)\n if match:\n major = int(match.group(1))\n minor = int(match.group(2))\n else:\n print >> sys.stderr, outpu...
[ "0.7412703", "0.7406646", "0.698086", "0.6378129", "0.62712646", "0.61881644", "0.6167377", "0.60677725", "0.59315634", "0.58684695", "0.5847262", "0.5826577", "0.57785463", "0.577731", "0.5769445", "0.5765052", "0.5748158", "0.57396495", "0.57374156", "0.5718005", "0.5716017...
0.7883222
0
Seeks all numbers in the dict objects and squares them
def seekNumbersAndSquare(dictionary): print("Squaring objects with integers") for key in dictionary: if isinstance(dictionary[key], (int, float)): dictionary[key] = math.pow(dictionary[key], 2) return dictionary
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def seekNumbersAndSquareInLists(dictionary):\n for key in dictionary:\n if isinstance(dictionary[key], list):\n dictionary[key] = [math.pow(item, 2) if isinstance(item, (int, float)) else item for item in dictionary[key] ]\n \n return dictionary", "def fill_given_numbers(square, ro...
[ "0.66149116", "0.58740765", "0.5765753", "0.5512213", "0.5443256", "0.54291236", "0.541231", "0.53813", "0.53510463", "0.5307061", "0.53039116", "0.5298743", "0.52881813", "0.5285586", "0.5282342", "0.52787817", "0.5258328", "0.5250214", "0.52262485", "0.5218104", "0.521059",...
0.7583046
0
Seeks all lists in the dict objects then squares numbers in those dictionaries
def seekNumbersAndSquareInLists(dictionary): for key in dictionary: if isinstance(dictionary[key], list): dictionary[key] = [math.pow(item, 2) if isinstance(item, (int, float)) else item for item in dictionary[key] ] return dictionary
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def seekNumbersAndSquare(dictionary):\n print(\"Squaring objects with integers\")\n for key in dictionary:\n if isinstance(dictionary[key], (int, float)):\n dictionary[key] = math.pow(dictionary[key], 2)\n \n return dictionary", "def dict_fun(obj):\n dict_memory_sum = 0 # ca...
[ "0.704333", "0.61906844", "0.59104836", "0.59045947", "0.5815408", "0.5467958", "0.5410325", "0.5372194", "0.53586155", "0.5355751", "0.5331904", "0.5262356", "0.5239842", "0.52345526", "0.522166", "0.5198905", "0.5185901", "0.51802784", "0.5179829", "0.50994056", "0.5074193"...
0.71875894
0
Remove nodes whose associated component sequence is shorter than min_len.
def filter_by_seq_len(self, min_len): if not isinstance(min_len, numbers.Number): raise TypeError("min_len must be a number") # Iterate over the nodes and remove any nodes shorter than min_len old_nodes = set(self.nodes) for n in old_nodes: comp_name = n[:-2] ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def delete_small_strings(self, min_string_length):\n\n self.__corpora = [string for string in self.__corpora if len(string) >= min_string_length]", "def remove_shorts(word_list, minimum_length):\n\tworking_word_list = []\n\tfor word in word_list:\n\t\tif len(word) >= minimum_length:\n\t\t\tworking_word_li...
[ "0.6422194", "0.61645573", "0.5984004", "0.5932776", "0.5850423", "0.58373356", "0.5711098", "0.56887233", "0.55182254", "0.5453946", "0.54460245", "0.5416913", "0.53723514", "0.533372", "0.5279013", "0.5275511", "0.5242233", "0.52177817", "0.5207964", "0.52019596", "0.517883...
0.9105574
0
Remove edges with weight less than w.
def filter_by_weight(self, w): G = nx.Graph() for u, v in self.edges: if self.graph[u][v]["weight"] >= w: # Add the nodes first in case they have data G.add_node(u, **self.nodes(data=True)[u]) G.add_node(v, **self.nodes(data=True)[v]) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def remove_heavier_than(self, w):\n G = nx.DiGraph()\n for u, v in self.edges:\n if self.graph[u][v][\"weight\"] <= w:\n G.add_edge(u, v, weight=self.graph[u][v][\"weight\"], alignment=self.graph[u][v][\"alignment\"])\n self.graph = G", "def trim_edges(g, weight=1):...
[ "0.8140378", "0.74055135", "0.62548697", "0.6137488", "0.61238205", "0.60734946", "0.6054999", "0.60355353", "0.6000572", "0.5942194", "0.5858607", "0.58000296", "0.57271606", "0.5666711", "0.5632245", "0.56165063", "0.5598718", "0.55903673", "0.55457175", "0.5539666", "0.553...
0.7758672
1
Remove edges where the weight is not equal to one.
def filter_non_one(self): G = nx.Graph() for u, v in self.edges: if self.graph[u][v]["weight"] == 1: # Add the nodes first in case they have data G.add_node(u, **self.nodes(data=True)[u]) G.add_node(v, **self.nodes(data=True)[v]) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def trim_edges(g, weight=1):\n g2 = nx.Graph()\n for fnode, tonode, edgedata in g.edges(data=True):\n if edgedata[\"weight\"] > weight:\n g2.add_edge(fnode, tonode, **edgedata)\n return g2", "def remove_heavier_than(self, w):\n G = nx.DiGraph()\n for u, v in self.edges:\n...
[ "0.7693412", "0.6992114", "0.6946491", "0.69120675", "0.65813303", "0.6574783", "0.6481754", "0.64104885", "0.6400494", "0.6344421", "0.6318638", "0.6294974", "0.6269559", "0.62638175", "0.62178195", "0.6197531", "0.6176533", "0.61634064", "0.59876657", "0.5881332", "0.587132...
0.75805086
1
Replace weights with matching weights from a new scaffold graph. All other edge data remains.
def steal_weights_from(self, in_sg): G = ScaffoldGraph(self.components_fasta_fname) for u, v in self.edges: if in_sg.has_edge(u, v): # Make a copy of the edge data and remove the weight new_edge_data = dict(self.graph[u][v]) new_edge_data.pop("...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _reweight(self):\n self._seed_weights = [self._graph.degree(seed) for seed in self._seeds]\n weight_sum = np.sum(self._seed_weights)\n self._seed_weights = [float(weight)/weight_sum for weight in self._seed_weights]", "def reassignWeights(self,weights):\n\t\n\t\tbranches = self.collectA...
[ "0.6404683", "0.6398367", "0.631176", "0.6254147", "0.62163275", "0.6184205", "0.60976106", "0.6038473", "0.60075223", "0.59709936", "0.58987814", "0.58407134", "0.58398473", "0.5817509", "0.5817509", "0.58084476", "0.5761213", "0.5685151", "0.5646441", "0.56451553", "0.56200...
0.6553183
0
Combine edges connecting the same nodes. Return a new SG graph.
def merge(self): G = ScaffoldGraph(self.components_fasta_fname) # TODO implement an add_nodes_from wrapper so direct access is unnecessary G.graph.add_nodes_from(self.nodes(data=True)) for u, v, c in self.graph.edges: edge_data_list = [self.graph[u][v][i] for i in self.graph...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_edges(self):\n for u in self.G.nodes():\n for v in self.G.nodes():\n if u != v and u != \"Sink\" and v != \"Source\":\n self.G.add_edge(\n u, v, cost=self.manhattan(u, v), time=self.manhattan(u, v)\n )", "def co...
[ "0.6441835", "0.6406052", "0.63969254", "0.63897246", "0.6340736", "0.6339551", "0.63006055", "0.62655014", "0.62605125", "0.6246468", "0.62380224", "0.62217516", "0.6177223", "0.61563164", "0.6108449", "0.60815537", "0.6053574", "0.6048477", "0.60336834", "0.60213846", "0.60...
0.67115784
0
Update the graph given AGP files.
def add_agps(self, in_agps, in_weights=None, exclusion_set=None): if exclusion_set is None: exclusion_set = set() if in_weights is None: in_weights = [1] * len(in_agps) else: if len(in_agps) != len(in_weights): raise ValueError("Must assign on...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update(self, paths):\n raise NotImplementedError", "def update_graph(graph):\n\n if not isinstance(graph, WeightedGraph):\n raise TypeError('update_graph(graph): graph must be a WeightedGraph object')\n\n # check if graph has been already updated\n if graph.updated >= 1:\n retur...
[ "0.58074886", "0.56377", "0.55851614", "0.55292803", "0.54849255", "0.5454546", "0.54253596", "0.5414197", "0.5399051", "0.5384302", "0.5313532", "0.52659905", "0.5249226", "0.524616", "0.52403075", "0.5229307", "0.5228529", "0.5216199", "0.5182244", "0.51628125", "0.5146706"...
0.5825942
0
Remove edges with weight > w
def remove_heavier_than(self, w): G = nx.DiGraph() for u, v in self.edges: if self.graph[u][v]["weight"] <= w: G.add_edge(u, v, weight=self.graph[u][v]["weight"], alignment=self.graph[u][v]["alignment"]) self.graph = G
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def trim_edges(g, weight=1):\n g2 = nx.Graph()\n for fnode, tonode, edgedata in g.edges(data=True):\n if edgedata[\"weight\"] > weight:\n g2.add_edge(fnode, tonode, **edgedata)\n return g2", "def filter_by_weight(self, w):\n G = nx.Graph()\n\n for u, v in self.edges:\n ...
[ "0.7666064", "0.7618665", "0.6603214", "0.6586793", "0.6484665", "0.6472489", "0.64522976", "0.6375308", "0.62455815", "0.6229252", "0.61846286", "0.61768115", "0.61122054", "0.6103859", "0.6095987", "0.60443485", "0.6027359", "0.6025895", "0.60210896", "0.5985605", "0.597972...
0.78451276
0
Return a new PatchScaffoldGraph that is a matching
def max_weight_matching(self): undirected_sg = nx.Graph() for u, v in self.edges: undirected_sg.add_edge(u, v, weight=self.graph[u][v]["weight"]) matching = nx.max_weight_matching(G=undirected_sg) # Remove any cycles that would result from adding intra-sequence edges ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_matching(self):\n verts, plaqs, d_verts, d_plaqs = self.get_stabs()\n\n # def get_matching(anyons, d_anyons):\n # edges = self.get_edges(anyons)\n # for i0, i1, weight in edges:\n # nxgraph.add_edge(i0, i1, weight=-weight)\n # output = nx.algori...
[ "0.5528811", "0.5522304", "0.5502465", "0.5262912", "0.51598346", "0.5142724", "0.5116374", "0.49745867", "0.4946554", "0.49250278", "0.49031502", "0.48919278", "0.48642075", "0.48015532", "0.48003212", "0.4798948", "0.47783658", "0.47769517", "0.47430834", "0.47409213", "0.4...
0.6056853
0
A convolution is compatible with a CheckpointedHistory only if it contains a history that is compatible for each suboptimizer.
def compatible(self, history): return (isinstance(history, CheckpointedMultipleHistory) and np.array([self.mapHistory(s, history) is not None for s in self.subs]).all())
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_conv_consistency(self) -> None:\n x = Input(\n 'const1',\n [1, 3, 3, 3],\n Float32(),\n )\n w = Constant(\n 'weight',\n Float32(),\n np.zeros([1, 2, 2, 3])\n )\n input_ops = {'X': cast(Operator, x), 'W': c...
[ "0.5629616", "0.55029637", "0.5458144", "0.5418558", "0.53147036", "0.5189352", "0.50939095", "0.5077204", "0.50636894", "0.5061421", "0.50255704", "0.501963", "0.49810603", "0.49770007", "0.49766997", "0.49694854", "0.49628457", "0.4959388", "0.4954533", "0.4947943", "0.4938...
0.5650857
0
Writes tabular metrics in latex format.
def perf2latex(latex_fn, all_perf, metrics_name, slice_v, cam_v): slice_num = slice_v.shape[0] f = open('%s'%latex_fn, 'w') f.write("\\documentclass{article}\n") f.write("\\usepackage[utf8]{inputenc}\n") f.write("\\usepackage{booktabs} \n") f.write("\\usepackage[]{float}\n") f.write("\\usep...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def out(lam, eng, mat): # {{{1\n print(\"\\\\begin{table}[!htbp]\")\n print(\" \\\\renewcommand{\\\\arraystretch}{1.2}\")\n txt = \" \\\\caption{{\\\\label{{tab:{0}}}properties of {0}}}\"\n # Raw underscores in LaTeX text mode produce “Missing $” errors.\n texlname = lam.name.replace('_', '\\_')\...
[ "0.6714302", "0.65567935", "0.64777684", "0.6454308", "0.62580484", "0.6248004", "0.60726035", "0.60565686", "0.6048208", "0.5996834", "0.59627306", "0.593798", "0.59338284", "0.5898554", "0.5889402", "0.58879846", "0.5881314", "0.58484817", "0.58275473", "0.5825261", "0.5816...
0.67665
0