query
stringlengths
9
3.4k
document
stringlengths
9
87.4k
metadata
dict
negatives
listlengths
4
101
negative_scores
listlengths
4
101
document_score
stringlengths
3
10
document_rank
stringclasses
102 values
2nd phase of a password reset
def change_password(self, reset_token, new_password_hash): try: self.logger.debug('change_password running') nosqldb = self.pers.nosql_db reset_request = nosqldb['passwordResets'].find_one( {'resetToken': reset_token} ) if reset_reques...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def request_password_reset():", "def reset_password():\n pass", "def reset_password(newpass, challenge):", "def reset_password(self):\n self.password = passwordResetter(self.user_id, self.password)", "def password_resetenter(request, uidb64=None, token=None):\n\n\tcontext_dict = {}\n\tif request....
[ "0.86657006", "0.80415004", "0.7938155", "0.737976", "0.71992946", "0.7177475", "0.7124738", "0.709721", "0.7061638", "0.7055998", "0.70170945", "0.70140517", "0.6993483", "0.69895256", "0.6966978", "0.6951727", "0.69464535", "0.6938807", "0.69106615", "0.69029784", "0.689742...
0.6364059
84
Sanity check for the object
def is_valid_password_reset_request(self, test_obj, goal): result = '' try: allowed_keys = [ 'passwd', 'resetToken', 'username', 'email' ] #block unauthorized Keys for key in test_obj: if key not in allowed_keys: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def sanity_check(self):\n pass", "def sanity_check(self):\n return True", "def _check_validity(self):\n pass", "def __validate(self):\n pass", "def __check(self):\n assert self.name is not None, \"Empty name!\"\n assert self.in_spc, \"Empty in_spc!\"\n asser...
[ "0.8423362", "0.79663914", "0.74403775", "0.7284628", "0.71955985", "0.7148018", "0.7102331", "0.7100689", "0.70695645", "0.70695645", "0.70695645", "0.70695645", "0.70622414", "0.7037906", "0.70157534", "0.69545573", "0.69402754", "0.68112826", "0.6771085", "0.67207015", "0....
0.0
-1
Get random int32 number (signed)
def get_random_id(message_id): r = random.Random(message_id) return r.getrandbits(31) * r.choice([-1, 1])
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def generate_random_num():\n return (long(hexlify(urandom(7)), 16) >> 3) * 2**(-53)", "def _generate_uint32():\n\t\treturn str(randint(1, 4294967295))", "def get_random_integer():\n return random.randint(-MAX_GENERATED_NUMBER_RANGE, MAX_GENERATED_NUMBER_RANGE)", "def _random(self, key):\n\n if h...
[ "0.7358228", "0.7337801", "0.6933558", "0.6921282", "0.6847398", "0.6782168", "0.6741858", "0.67321783", "0.6671734", "0.6657917", "0.6639712", "0.6635135", "0.6635135", "0.6613837", "0.6603353", "0.65989554", "0.65890145", "0.6579512", "0.6578802", "0.6578802", "0.6535927", ...
0.58408546
80
The homepage is loaded using a combination of .write and .markdown. Contains description how app works
def load_homepage() -> None: st.image("iwakka.png", use_column_width=True) st.header("Hello! This dashboard will help you to analize data from iWakka device") st.write("Here are some step to process data: ") st.header(" II. Download data") st.write("Here you can download data") ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def home() :\n st.markdown(\"This application provides 3 mains modules :\")\n st.markdown(\"* **The prediction module :** enables you to assess client's liability based on its file\")\n st.markdown(\"* **The explorer module :** enables you to dig deeper into your client informations,\"\n \"...
[ "0.80281425", "0.71578765", "0.6982044", "0.68896574", "0.6870078", "0.68403995", "0.6818947", "0.6801335", "0.6782138", "0.6779921", "0.6769249", "0.6699216", "0.6699216", "0.6691474", "0.6685022", "0.6680601", "0.66717446", "0.66556436", "0.6655127", "0.6645696", "0.6633345...
0.7181079
1
Create the layout of dashboard
def create_layout() -> None: st.sidebar.title("Menu") app_mode = st.sidebar.selectbox("Please select a page", [' I. Homepage', "II. Download data" , "III. Statistic Data", ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def createLayout(dash_instance):\n\t\n\tcreateInitialChildren(dash_instance)\n\tdash_instance.createDashboardLayout()", "def create_layout( self ):", "def _generate_layout(self):\n\n pass", "def main_aqa_layout():\n\n layout = html.Div(\n [\n # html.Div(\n # id=serv...
[ "0.7688357", "0.7632143", "0.72650033", "0.715922", "0.7146765", "0.6989146", "0.696046", "0.6857477", "0.6835692", "0.67169154", "0.6692603", "0.66796535", "0.6660154", "0.66572654", "0.66372734", "0.6608882", "0.6602748", "0.6599948", "0.6548602", "0.65331995", "0.6515139",...
0.70724016
5
Create a downsampling block. The downsampling block is described as two 3x3x3 convolutions followed by a 1x2x2 max pooling operation.
def downconv_block(i, filters, shape, activation='relu', padding='same', data_format='channels_first'): c1 = Conv3D(filters, shape, activation=activation, padding=padding, data_format=data_format)(i) c2 = Conv3D(filters, shape, activation=activation, padding=pa...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def make_block(self, block_ix, downsample, ker_size, block_len):\n stride = int(downsample) + 1\n n_in_filters = self.filters[block_ix]\n n_filters = self.filters[block_ix+1]\n mult_fact = 1 if block_ix == 0 else 6\n\n block = [MBConv(n_in_filters, n_filters, ker_size, stride, mu...
[ "0.70585674", "0.6955576", "0.67640316", "0.65235853", "0.64880985", "0.60835993", "0.60550314", "0.60276735", "0.60021603", "0.5985553", "0.59654474", "0.594975", "0.5921387", "0.59201896", "0.59051275", "0.5888936", "0.5883343", "0.587548", "0.5830204", "0.5791073", "0.5788...
0.5430085
55
Create an upconvolution block. The UpConv block is described as two 3x3x3 convolutions followed by a 1x2x2 upsampling and a 1x2x2 convolution.
def upconv_block(i, filters, shape, activation='relu', padding='same', data_format='channels_first'): c1 = Conv3D(filters, shape, activation=activation, padding=padding, data_format=data_format)(i) c2 = Conv3D(filters, shape, activation=activation, padding=paddin...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def TransitionUp(skip_connection, block_to_upsample, n_filters_keep):\n\n # Upsample\n l = ConcatLayer(block_to_upsample)\n l = Deconv2DLayer(l, n_filters_keep, filter_size=3, stride=2,\n crop='valid', W=HeUniform(gain='relu'), nonlinearity=linear)\n # Concatenate with skip connect...
[ "0.75059754", "0.7405827", "0.7343056", "0.7191787", "0.7009756", "0.67640203", "0.6476993", "0.6149223", "0.61063606", "0.60550946", "0.6042839", "0.5964783", "0.5945483", "0.58963466", "0.5880264", "0.58630115", "0.58589673", "0.5828326", "0.5823696", "0.5789642", "0.576217...
0.70525795
4
Crop data for concatenation of bypass connections.
def crop(larger, smaller): cs = float(larger._keras_shape[2] - smaller._keras_shape[2]) / 2.0 csZ = float(larger._keras_shape[1] - smaller._keras_shape[1]) / 2.0 if cs != 0: xy = (int(cs), int(cs)) # (int(math.floor(cs)), int(math.ceil(cs))) z = (int(csZ), int(csZ)) # (int(math.floor(csZ))...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _crop_concat(self, upsampled, bypass):\n c = (bypass.size()[2] - upsampled.size()[2]) // 2\n bypass = F.pad(bypass, (-c, -c, -c, -c))\n\n return torch.cat((upsampled, bypass), 1)", "def crop_and_concat(self, upsampled, bypass, crop=False):\n logging.debug(\"Before - Upsampled: {}\...
[ "0.69484794", "0.6423994", "0.6156482", "0.6059482", "0.5907848", "0.5738482", "0.55779403", "0.5532889", "0.55025214", "0.54559135", "0.5372384", "0.53380084", "0.52198166", "0.52116674", "0.52114594", "0.5158932", "0.5151389", "0.5144641", "0.5126979", "0.51120806", "0.5087...
0.0
-1
Create a UNet model using 3D operations. This model is based on the 3D UNet model described by Cicek et al [UNET3D]_ for solving membrane segmentation in electron microscopic images.
def unet3d(input_shape, data_format='channels_first'): i = Input(shape=input_shape) down1, c1 = downconv_block(i, 16, 3) down2, c2 = downconv_block(down1, 32, 3) down3, c3 = downconv_block(down2, 64, 3) up1 = upconv_block(down3, 128, 3) crop1 = crop(c3, up1) merge_block = [up1, crop1] ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_unet_3d(self):\n for model_class in [UNet3D, UNetPlus3D]:\n b, d, h, w = 4, 8, 64, 64\n in_channel, out_channel = 1, 3\n x = torch.rand(b, in_channel, d, h, w)\n model = model_class(block_type='residual', in_channel=in_channel,\n ...
[ "0.74566793", "0.69313484", "0.6902316", "0.687786", "0.6713262", "0.65693206", "0.65354615", "0.6512889", "0.64145637", "0.6372629", "0.63473874", "0.6343035", "0.6316669", "0.6280747", "0.62306607", "0.62199247", "0.6216385", "0.62071687", "0.61754984", "0.6156091", "0.6141...
0.72291464
1
Set development PVs so values are close to the quads
def setdevs(): #q1,q2,q3,q4 = (epics.caget("QUAD:LTU1:620:BCTRL"),epics.caget("QUAD:LTU1:640:BCTRL"),epics.caget("QUAD:LTU1:660:BCTRL"),epics.caget("QUAD:LTU1:680:BCTRL")) q1 = -79.7640302 q2 = 79.67962984 q3 = -83.36844826 q4 = 68.4844249 print q1,q2,q3,q4 ep...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_set_vp(self):\n s = State(substance=\"water\")\n s.vp = Q_(0.4772010021515822, \"m**3/kg\"), Q_(101325.0, \"Pa\")\n # Pylance does not support NumPy ufuncs\n assert np.isclose(s.T, Q_(373.1242958476843, \"K\")) # type: ignore\n assert np.isclose(s.p, Q_(101325.0, \"Pa\"...
[ "0.60114425", "0.58355266", "0.5784473", "0.5768977", "0.5711314", "0.5639918", "0.55325764", "0.5516248", "0.5495726", "0.5483956", "0.54167116", "0.5401861", "0.5379428", "0.5364082", "0.53518796", "0.53475326", "0.53298587", "0.5317118", "0.5309196", "0.5305602", "0.525912...
0.5028491
49
Checks in a beer for a user
def checkin( self, gmt_offset: int, timezone: str, beer_id: str, foursquare_id: Optional[str] = None, geolat: Optional[int] = None, geolng: Optional[int] = None, shout: Optional[str] = None, rating: Optional[float] = None, facebook: Optiona...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def verify_user_existance(self, user):\n for client in self.clients:\n if user == client.get_name():\n return True\n return False", "def test_check_user(self):\n self.new_user.save_user()\n test_user = User(\"Test\", \"user\", \"test\", \"walIas15\")\n ...
[ "0.61282104", "0.6077737", "0.603353", "0.6022186", "0.6020786", "0.5909407", "0.58889693", "0.5874851", "0.5846579", "0.5840172", "0.5829486", "0.58165723", "0.5813922", "0.580728", "0.5805073", "0.57955945", "0.5746554", "0.5744196", "0.57206106", "0.57166", "0.57139003", ...
0.0
-1
Adds a comment to a checkin
def add_comment(self, checkin_id: str, comment: str) -> Dict: method = "checkin/addcomment/" + checkin_id auth = self._get_access_token() if len(comment) > 140: raise ValueError( f"Check-in comment is {len(comment)} characters whereas Untappd only supports comments up...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def cli(ctx, comment, metadata=\"\"):\n return ctx.gi.cannedcomments.add_comment(comment, metadata=metadata)", "def add_comment(self, issue, comment):\n return self.get_jira().add_comment(issue, comment)", "def comment():", "def __add_comment(self, issue_id, comment):\n import httplib2\n ...
[ "0.7102078", "0.66819334", "0.61690533", "0.61546576", "0.61425036", "0.6140449", "0.61339134", "0.6081882", "0.60638744", "0.6055927", "0.60003436", "0.5983363", "0.5982767", "0.59778225", "0.5976688", "0.59765553", "0.59236735", "0.5921192", "0.59078676", "0.59078676", "0.5...
0.8196651
0
Removes a comment on a checkin
def remove_comment(self, comment_id: str) -> Dict: method = "checkin/deletecomment/" + comment_id auth = self._get_access_token() return self._do_post(method, auth, {})
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def delete_comment(self, uid: str):\n pass", "def issues_comments_undelete(self, mar, request):\n return self.aux_delete_comment(mar, request, False)", "def remove(self, channel, nick, comment=\"\"):\n time.sleep(1)\n self.s.send(\"REMOVE %s %s%s\\n\" % (channel, nick, (comment and (\" ...
[ "0.6411806", "0.61087275", "0.5990724", "0.5918164", "0.5896276", "0.58793694", "0.58626604", "0.5818508", "0.57703024", "0.57703024", "0.57332915", "0.5706563", "0.5685093", "0.5648533", "0.562702", "0.5555107", "0.55467623", "0.54898906", "0.5439831", "0.54275584", "0.54192...
0.657487
0
Toggles the toast option on a checkin for a user
def toast(self, checkin_id: str) -> Dict: method = "checkin/toast/" + checkin_id auth = self._get_access_token() return self._do_post(method, auth, {})
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def toggle_infomail(request):\n if request.is_ajax():\n if request.method == 'POST':\n request.user.infomail = not request.user.infomail\n request.user.save()\n\n return HttpResponse(status=200, content=json.dumps({'state': request.user.infomail}))\n raise Http404", ...
[ "0.58784485", "0.5861943", "0.5841624", "0.57901263", "0.5636422", "0.56321335", "0.56169176", "0.5606937", "0.55604094", "0.55299765", "0.5519682", "0.5495518", "0.546312", "0.54475945", "0.5433726", "0.5392489", "0.5364981", "0.5341955", "0.5329888", "0.5313089", "0.5285594...
0.5622305
6
Adds a beer to a users wishlist
def add_to_wishlist(self, beer_id: str) -> Dict: method = "user/wishlist/add" auth = self._get_access_token() params = {"bid": beer_id} return self._do_get(method, auth, params)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_to_wish_list(self, user_id, caption):\n with self.connection:\n return self.cursor.execute(\"INSERT INTO 'wish_list' (`user_id`, `wish_list`) VALUES(?,?)\", (user_id,caption))", "def test_add_remove_from_wishlist(self):\n url = reverse('add-to-wishlist')\n data = {\n ...
[ "0.67660224", "0.62912786", "0.6265778", "0.62621766", "0.62581646", "0.6205359", "0.6201952", "0.6182023", "0.61050695", "0.6082546", "0.6066206", "0.60658205", "0.6046209", "0.6035353", "0.60304606", "0.5989473", "0.59838045", "0.5909522", "0.5875938", "0.5861446", "0.58604...
0.7936551
0
Removes a beer from a users wishlist
def remove_from_wishlist(self, beer_id: str): method = "user/wishlist/delete" auth = self._get_access_token() params = {"bid": beer_id} return self._do_get(method, auth, params)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def remove_wish_list(self, user_id, caption):\n with self.connection:\n data = self.cursor.execute(\"SELECT wish_list FROM Wish_list WHERE user_id=?\", (user_id,)).fetchall()\n for row in data:\n new_row = ''.join(row)\n if new_row == caption:\n ...
[ "0.7259753", "0.6906275", "0.6864111", "0.67099994", "0.66733855", "0.66321814", "0.65928495", "0.65331244", "0.64332575", "0.63253903", "0.6217423", "0.6194978", "0.61807096", "0.61729836", "0.6157014", "0.61554927", "0.6153164", "0.61204636", "0.6090897", "0.6069139", "0.60...
0.82368296
0
Creates a dataset for given indices.
def create_dataset(f, idxs, dir, prefix, column_types): vertex_offsets = f['NumberVertices']['value'].cumsum() - f['NumberVertices']['value'] N_vertices_squared = f['NumberVertices']['value']**2 distances_offsets = N_vertices_squared.cumsum() - N_vertices_squared N_events = idxs.shape[0] N_vertice...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def make_tf_dataset(arraysets,\n keys: Sequence[str] = None,\n index_range: slice = None,\n shuffle: bool = True):\n warnings.warn(\"Dataloaders are experimental in the current release.\", UserWarning)\n gasets = GroupedAsets(arraysets, keys, index_ran...
[ "0.69580275", "0.6838277", "0.6562803", "0.65386677", "0.6451008", "0.6352824", "0.6223742", "0.617341", "0.61549306", "0.6129327", "0.6103181", "0.6091469", "0.6040924", "0.5985238", "0.59806925", "0.59120625", "0.5899482", "0.58715457", "0.5867696", "0.5812711", "0.5798089"...
0.60707647
12
Set data and set ContentLength header.
def set_data(self, data): self.data = data self.headers['Content-Length'] = len(data)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_body(self, data):\n self._body = data\n self.add_header('Content-Length', len(self._body))", "def content_len(self, value):\n self.set_header('CONTENT-LENGTH', value)", "def set_est_rsp_header(self, data_len):\n self.send_response(200)\n self.send_header('Content-type...
[ "0.7739068", "0.69663864", "0.69061565", "0.6790839", "0.6772394", "0.6772394", "0.6516417", "0.6474555", "0.63574344", "0.6337354", "0.6207637", "0.6076806", "0.6076806", "0.6067116", "0.60512626", "0.60157615", "0.5981222", "0.5978075", "0.5978043", "0.5919072", "0.5870608"...
0.8999144
0
Get octets of Response.
def get_octets(self): if self.method == 'GET': return '{}{}{}{}'.format(self._get_status_line(), self._get_headers(), 2 * CRLF, self.data) else: return '{}{}{}'.format(s...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_response_byte(self):\n raise NotImplementedError", "def sitetotalresponsebytes(self) :\n\t\ttry :\n\t\t\treturn self._sitetotalresponsebytes\n\t\texcept Exception as e:\n\t\t\traise e", "def receive_primitive_execution_response(self):\n resp = self.read_response_buffer(ATI_RESPONSE_BUFFER...
[ "0.67584234", "0.624266", "0.58819395", "0.5852249", "0.5794166", "0.576959", "0.5674074", "0.55672896", "0.5560961", "0.55547404", "0.552938", "0.5471753", "0.5431196", "0.5413688", "0.5413688", "0.53808963", "0.5376896", "0.5372647", "0.53635085", "0.53618985", "0.53502715"...
0.76032627
0
Create Date header value.
def _create_date(self): return strftime("%a, %d %b %Y %H:%M:%S GMT", gmtime())
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _build_date_header_string(self, date_value):\n if isinstance(date_value, datetime):\n date_value = time.mktime(date_value.timetuple())\n if not isinstance(date_value, basestring):\n date_value = formatdate(date_value, localtime=True)\n return date_value", "def get_h...
[ "0.7888366", "0.76979434", "0.6422578", "0.6305962", "0.62553376", "0.61973256", "0.619118", "0.6128621", "0.6094166", "0.6093011", "0.5935989", "0.5932305", "0.5916864", "0.5904021", "0.5868135", "0.58624315", "0.5833907", "0.5817723", "0.5810932", "0.5806107", "0.58052635",...
0.6258012
4
This function evaluates the classification model using the accuracy score given a model_object, X, and y
def evaluate(model_object, X, y): # calcuated accuracy accuracy = model_object.score(X, y) return accuracy
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def evaluate_model(model, X_test, Y_test, category_names):\n Y_pred=model.predict(X_test)\n acc=[]\n for i,c in enumerate(Y_test.columns):\n print(c)\n print(classification_report(Y_test[c], Y_pred[:,i]))\n acc.append(accuracy_score(Y_test[c], Y_pred[:,i]))\n print('Accuracy :',np....
[ "0.7515988", "0.7515214", "0.7514516", "0.74553627", "0.73694795", "0.7287006", "0.72798187", "0.7275241", "0.726499", "0.72494537", "0.7248431", "0.72239125", "0.721681", "0.72078854", "0.72075343", "0.7166369", "0.71446836", "0.71296114", "0.7124664", "0.711983", "0.7105154...
0.8825581
0
Movement and game logic
def on_update(self, delta_time): super().on_update(delta_time) if self.do_attack: self.do_attack = False self.player.attack(self.npcs) for npc in self.npcs: if npc.fainted(): npc.change_x = 0 npc.change_x = 0 np...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def player_movement(self):", "def movement(self):", "def update(self):\r\n if self.able_to_move:\r\n self.pix_pos += self.direction*self.speed\r\n if self.time_to_move():\r\n if self.stored_direction != None:\r\n self.direction = self.stored_direction\r\n ...
[ "0.77960426", "0.7713729", "0.7203033", "0.7116673", "0.7010355", "0.69804865", "0.69772404", "0.69259804", "0.6906099", "0.6900028", "0.68835425", "0.68440866", "0.67894185", "0.67791975", "0.6756328", "0.6746469", "0.67458266", "0.67324334", "0.6731295", "0.66950244", "0.66...
0.0
-1
The container identifier specified by the remote peer for this connection.
def remote_container(self): return pn_connection_remote_container(self._impl)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def containerID(self):\n return self._container", "def container_id(self) -> pulumi.Output[Optional[str]]:\n return pulumi.get(self, \"container_id\")", "def cont_to_id(self):\n return self.client.containers.get(self.container).id", "def container_id(self) -> Optional[pulumi.Input[str]]:...
[ "0.7823247", "0.7631334", "0.7505652", "0.72765577", "0.6903428", "0.6780837", "0.6612907", "0.6609533", "0.6499414", "0.64055985", "0.6392983", "0.6380359", "0.63076925", "0.63030875", "0.6295007", "0.62870884", "0.6277265", "0.6234463", "0.61574477", "0.6150299", "0.6100687...
0.5996209
27
The hostname specified by the remote peer for this connection.
def remote_hostname(self): return pn_connection_remote_hostname(self._impl)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def hostname(self):\n return self._hostname", "def get_hostname(self):\n return self.name", "def get_host(self) -> str:\n return self.socket.getsockname()[0]", "def peername(self):\n return self.socket_.getpeername()", "def hostname(self) -> str:\n _args: list[Arg] = []\n...
[ "0.7981605", "0.7919443", "0.781819", "0.77913344", "0.7728555", "0.77235633", "0.763241", "0.7623107", "0.7621482", "0.7620361", "0.76036936", "0.7573506", "0.75652593", "0.7543359", "0.7532723", "0.7520042", "0.7489005", "0.74886316", "0.7482386", "0.7454292", "0.7451588", ...
0.8748257
0
The capabilities offered by the remote peer for this connection.
def remote_offered_capabilities(self): return dat2obj(pn_connection_remote_offered_capabilities(self._impl))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def remote_desired_capabilities(self):\n return dat2obj(pn_connection_remote_desired_capabilities(self._impl))", "def capabilities(self) -> dto.Capabilities:\n raise NotImplementedError", "def capabilities(self) -> Optional[Sequence[str]]:\n return pulumi.get(self, \"capabilities\")", "d...
[ "0.83162785", "0.79504555", "0.7814097", "0.78076786", "0.7772001", "0.77595013", "0.76035404", "0.758808", "0.758808", "0.7584968", "0.7534433", "0.750084", "0.7456392", "0.7377317", "0.73753893", "0.7295936", "0.71078223", "0.7074651", "0.7071122", "0.7013151", "0.7007092",...
0.7790038
4
The capabilities desired by the remote peer for this connection.
def remote_desired_capabilities(self): return dat2obj(pn_connection_remote_desired_capabilities(self._impl))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def capabilities(self) -> dto.Capabilities:\n raise NotImplementedError", "def capabilities(self):\n pass", "def remote_offered_capabilities(self):\n return dat2obj(pn_connection_remote_offered_capabilities(self._impl))", "def capability(self):\n code, data, capabilities = (\n ...
[ "0.7864362", "0.77226967", "0.7706095", "0.75981325", "0.75973034", "0.7499757", "0.7499757", "0.74835926", "0.74506027", "0.74074715", "0.7262458", "0.7234038", "0.7208045", "0.71269935", "0.7114823", "0.70935553", "0.69573575", "0.69261956", "0.69241446", "0.68688613", "0.6...
0.83942115
0
The properties specified by the remote peer for this connection.
def remote_properties(self): return dat2obj(pn_connection_remote_properties(self._impl))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def extract_connection_properties(self):\n try:\n localdict = {\"MQTT\" : {\\\n \"address\" : self.config_handle['MQTT']['MQTTBrokerAddress'],\\\n \"port\" : int(self.config_handle['MQTT']['MQTTBrokerPort']),\\\n ...
[ "0.68456537", "0.653772", "0.62828326", "0.6195585", "0.6195585", "0.6192706", "0.6192706", "0.6146062", "0.6144435", "0.61440533", "0.61283886", "0.6063591", "0.60155845", "0.59984654", "0.5973957", "0.5965847", "0.59370947", "0.59279245", "0.5921653", "0.5910656", "0.590705...
0.78266364
0
Opens the connection. In more detail, this moves the local state of the connection to the ACTIVE state and triggers an open frame to be sent to the peer. A connection is fully active once both peers have opened it.
def open(self): obj2dat(self.offered_capabilities, pn_connection_offered_capabilities(self._impl)) obj2dat(self.desired_capabilities, pn_connection_desired_capabilities(self._impl)) obj2dat(self.properties, pn_connection_properties(self._impl)) pn_connecti...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def opened(self):\n self.logger.info(\"Socket connection open\")\n # Send a connection request\n self.sender.send_packet(52)", "def _connect(self):\n hostport = self.getHost()\n channelOpenData = forwarding.packOpen_direct_tcpip((self.host, self.port), (hostport.host, hostport....
[ "0.699216", "0.6720545", "0.66052824", "0.65688837", "0.6461779", "0.6403845", "0.6403845", "0.630622", "0.6226646", "0.6225425", "0.6225425", "0.61711425", "0.6162814", "0.6161016", "0.61437017", "0.6132527", "0.6126176", "0.61228085", "0.60389924", "0.6021844", "0.60051084"...
0.7019765
0
Closes the connection. In more detail, this moves the local state of the connection to the CLOSED state and triggers a close frame to be sent to the peer. A connection is fully closed once both peers have closed it.
def close(self): self._update_cond() pn_connection_close(self._impl) if hasattr(self, '_session_policy'): # break circular ref del self._session_policy
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def close_connection(self):\n if not self.is_open():\n return\n if self._active_result is not None:\n self._active_result.fetch_all()\n self.protocol.send_connection_close()\n self.protocol.read_ok()\n self.stream.close()", "def close(self):\r\n try...
[ "0.7268217", "0.7223244", "0.7131109", "0.70874816", "0.7033391", "0.7004915", "0.6967818", "0.69668645", "0.6956662", "0.6955861", "0.6908576", "0.689257", "0.6885123", "0.6839743", "0.6832992", "0.6830288", "0.68019927", "0.67983353", "0.6764126", "0.67514753", "0.6750007",...
0.0
-1
The state of the connection as a bit field. The state has a local and a remote component. Each of these can be in one of three
def state(self): return pn_connection_state(self._impl)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_connection_state(self):\n return self.connection_state", "def state(self):\n return {\n 'port' : self.self.__port.port, #port name/number as set by the user\n 'baudrate' : self.self.__port.baudrate, #current baudrate setting\n 'bytesize' : self.sel...
[ "0.6482273", "0.6433013", "0.6314307", "0.6302431", "0.6208477", "0.61879957", "0.60750175", "0.60722756", "0.6067025", "0.6039174", "0.6039174", "0.6036067", "0.60196996", "0.60196996", "0.6016638", "0.60139465", "0.5980345", "0.5980345", "0.5980345", "0.5972967", "0.5972287...
0.69306684
0
Returns a new session on this connection.
def session(self): ssn = pn_session(self._impl) if ssn is None: raise (SessionException("Session allocation failed.")) else: return Session(ssn)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def new_session(self):\n return self.Session()", "def new_session(self):\n return self._SessionLocal()", "def session(self):\n if not self._session: #Create new session if none exists\n return self._new_session()\n return self._session", "def new_session(self):\n ...
[ "0.87472516", "0.8538848", "0.82636046", "0.8147998", "0.7816199", "0.78104186", "0.7774068", "0.7762847", "0.77171135", "0.7702307", "0.76919633", "0.76516485", "0.76498824", "0.76144505", "0.7558834", "0.7452149", "0.7364417", "0.7301111", "0.7244297", "0.72338074", "0.7216...
0.7744462
8
Opens the link. In more detail, this moves the local state of the link to the ACTIVE state and triggers an attach frame to be sent to the peer. A link is fully active once both peers have attached it.
def open(self): pn_link_open(self._impl)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def open_link(self) -> None:\n\n webbrowser.open_new(self.link)", "def open_link(self):\n try:\n webbrowser.open(self.url)\n except:\n self.ids.link.text=self.link_message", "def open(self):\n self._isOpen = True", "def opened(self):\n self.send({\n ...
[ "0.66080314", "0.61079884", "0.5837042", "0.583461", "0.5769809", "0.5760496", "0.57441324", "0.5630137", "0.56034017", "0.5572188", "0.5553864", "0.54710066", "0.54184073", "0.5356799", "0.5356799", "0.5354793", "0.53493524", "0.53319454", "0.52859795", "0.52533734", "0.5253...
0.64356446
1
Closes the link. In more detail, this moves the local state of the link to the CLOSED state and triggers an detach frame (with the closed flag set) to be sent to the peer. A link is fully closed once both peers have detached it.
def close(self): self._update_cond() pn_link_close(self._impl)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def closeLink(self):\n if self.isOpen:\n self.SerClient.close()\n print(\"Closed serial port {0}\".format(self.port))", "def close(self):\n if self._closed:\n return\n\n self.listening = False\n\n self.ssl_enabled = False\n\n if self._slave:\n self._...
[ "0.66938305", "0.6307246", "0.6277232", "0.608229", "0.60567176", "0.60388726", "0.6008762", "0.5995509", "0.59896326", "0.5943243", "0.5884415", "0.5849329", "0.5798474", "0.5789303", "0.578923", "0.5788571", "0.5781019", "0.5773587", "0.5770286", "0.5757257", "0.57390946", ...
0.687574
0
The state of the link as a bit field. The state has a local and a remote component. Each of these can be in one of three
def state(self): return pn_link_state(self._impl)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getState():\n # TODO: this isn't nearly as meaningful as it used to be", "def network_state(self):\n states = {\n 0: \"NETWORK_EMPTY\",\n 1: \"NETWORK_IDLE\",\n 2: \"NETWORK_LOADING\",\n 3: \"NETWORK_NO_SOURCE\",\n }\n return states[self...
[ "0.5690449", "0.5668708", "0.5668708", "0.5588153", "0.5585658", "0.55679953", "0.5543208", "0.552515", "0.55232596", "0.55221283", "0.55136484", "0.55097944", "0.5471529", "0.54571605", "0.545629", "0.54281", "0.5419869", "0.5415876", "0.5415876", "0.5400457", "0.5400457", ...
0.6756402
0
The source of the link as described by the local peer.
def source(self): return Terminus(pn_link_source(self._impl))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getSourceURL(self):\n return self.SourceURL", "def URL(self):\n return self._sourceurl", "def source_url(self):\n return self._source_url", "def SourceURL(self):\n return self._sourceurl", "def Source(self):\r\n\t\treturn self._get_attribute('source')", "def getSource(self...
[ "0.7041766", "0.68555504", "0.6821124", "0.681184", "0.6769867", "0.67663276", "0.67365265", "0.67353255", "0.66216224", "0.66191083", "0.6404673", "0.6404673", "0.6404673", "0.6404673", "0.6404673", "0.6404673", "0.6387282", "0.6370913", "0.6370913", "0.6370913", "0.6370913"...
0.54868746
79
The target of the link as described by the local peer.
def target(self): return Terminus(pn_link_target(self._impl))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getTarget(self):\n return self.Target", "def target(self):\n return self._properties.get('target')", "def getTarget(self):\n return self._target", "def get_target(self, ):\n return self.get_parameter('target')", "def get_target_url(self):\n return self.TARGET_URL", ...
[ "0.7052099", "0.70114666", "0.70029765", "0.6997016", "0.6982346", "0.687299", "0.685604", "0.68135744", "0.68135744", "0.68135744", "0.68135744", "0.680265", "0.6791707", "0.67411995", "0.66501266", "0.6642805", "0.66061807", "0.66061807", "0.65446347", "0.6518504", "0.64418...
0.56541145
78
The source of the link as described by the remote peer.
def remote_source(self): return Terminus(pn_link_remote_source(self._impl))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getSourceURL(self):\n return self.SourceURL", "def URL(self):\n return self._sourceurl", "def source_url(self):\n return self._source_url", "def SourceURL(self):\n return self._sourceurl", "def getSource(self):\n return urllib2.urlopen(Parser.SOURCE_URL)", "def getSourc...
[ "0.7094799", "0.6976171", "0.69505227", "0.68743765", "0.6836253", "0.66263443", "0.6614134", "0.65620095", "0.6555404", "0.64828783", "0.64474493", "0.63550836", "0.6342443", "0.6265865", "0.6263848", "0.6263848", "0.6263848", "0.6262939", "0.6262939", "0.6262939", "0.626293...
0.60443276
35
The target of the link as described by the remote peer.
def remote_target(self): return Terminus(pn_link_remote_target(self._impl))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_target_url(self):\n return self.TARGET_URL", "def targetURL(self):\n target = self.getTargetObject()\n if target:\n return target.absolute_url()\n return '#'", "def target(self):\n return self._properties.get('target')", "def getTarget(self):\n ret...
[ "0.73012364", "0.7150003", "0.70841163", "0.7064123", "0.69711554", "0.6932053", "0.6926805", "0.6845658", "0.6799366", "0.6799366", "0.6799366", "0.6799366", "0.67205757", "0.66954017", "0.6675209", "0.6628549", "0.6628549", "0.65607524", "0.65509427", "0.65509427", "0.64903...
0.61445475
35
The connection on which this link was attached.
def connection(self): return self.session.connection
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def connection(self):\n return self.get_connection()", "def connection(self):\n return self._connection", "def connection(self):\n return self._connection", "def connection(self):\n return self._connection", "def get_connection(self):\n return self.connection", "def get...
[ "0.75485224", "0.7531321", "0.7531321", "0.7531321", "0.7392917", "0.7392917", "0.7345737", "0.72684246", "0.72684246", "0.70642954", "0.70222425", "0.69111305", "0.690412", "0.6849452", "0.68444145", "0.6827608", "0.6749153", "0.67223597", "0.6687479", "0.66853684", "0.66526...
0.7522981
4
The amount of outstanding credit on this link.
def credit(self): return pn_link_credit(self._impl)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def amount(self):\n return self.__amount", "def amount(self):\n return self.__amount", "def amount(self) -> int:\n return self._amount", "def amount(self):\n return self._amount", "def outstanding(self):\n return sum(\n transfer.lock.amount\n for tra...
[ "0.7061197", "0.7061197", "0.6934856", "0.69232464", "0.67710584", "0.6735133", "0.6720134", "0.66693854", "0.6662066", "0.6662066", "0.6599678", "0.6540254", "0.65398085", "0.6531563", "0.65017945", "0.64607364", "0.6458802", "0.6445135", "0.64262676", "0.633675", "0.6322698...
0.6979985
2
Returns the name of the link
def name(self): return utf82unicode(pn_link_name(self._impl))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_name(tab):\n return tab.find(\"a\").get_text(strip=True).title().replace(' ', '')", "def __str__(self):\n\t\treturn '{0} ({1})'.format (self.name, self.link)", "def get_name_link_html(self):\n url_text = \"{{% url 'trait_browser:source:studies:pk:detail' pk={} %}} \".format(self.pk)\n ...
[ "0.71299154", "0.7034757", "0.6980485", "0.6919076", "0.6919076", "0.6902483", "0.68388283", "0.68203676", "0.6820108", "0.6798065", "0.67772627", "0.67275065", "0.67275065", "0.67275065", "0.6723569", "0.6722679", "0.6702163", "0.6701957", "0.66948295", "0.66948295", "0.6690...
0.84673464
0
Returns true if this link is a sender.
def is_sender(self): return pn_link_is_sender(self._impl)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def has_sender(self):\n return self.balance > 0", "def sender(self):\n l = self.link\n if l and l.is_sender:\n return l\n else:\n return None", "def is_sender_public_id(self) -> bool:\n return PublicId.is_valid_str(self.sender)", "def is_receiver(self)...
[ "0.7136295", "0.70802164", "0.6921599", "0.64989007", "0.6169625", "0.6168362", "0.60093373", "0.5877719", "0.58769935", "0.57950914", "0.57574874", "0.5721971", "0.5685329", "0.56846696", "0.56842625", "0.5654095", "0.5632591", "0.56324697", "0.56242245", "0.56125104", "0.55...
0.8751801
0
Returns true if this link is a receiver.
def is_receiver(self): return pn_link_is_receiver(self._impl)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_sender(self):\n return pn_link_is_sender(self._impl)", "def receiver(self):\n l = self.link\n if l and l.is_receiver:\n return l\n else:\n return None", "def has_receiver(self):\n return self.balance < 0", "def is_connected_to(self, receiver: Sk...
[ "0.69650966", "0.6852672", "0.6732397", "0.6217352", "0.60657305", "0.6023268", "0.5935235", "0.58936906", "0.5808235", "0.5745558", "0.5674144", "0.56644243", "0.56486523", "0.562267", "0.5561293", "0.5532493", "0.5508603", "0.5465453", "0.54512715", "0.54389626", "0.5393733...
0.85351586
0
Send specified data as part of the current delivery
def stream(self, data): return self._check(pn_link_send(self._impl, data))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _send_data(self):\n pass", "def send(self, data):\n self.sent.put(data)", "def _send_data(self, data, time):\n pass", "def send(self, data):", "def send (self, data):\n return self.sending.send(data)", "def send(self, data):\n pass", "def send(self, data):\n\n ...
[ "0.76012737", "0.75091344", "0.7463606", "0.7434955", "0.742471", "0.74245644", "0.7260803", "0.72457904", "0.723998", "0.7208165", "0.71942306", "0.7188694", "0.71861374", "0.7067616", "0.70101404", "0.69554144", "0.6945786", "0.69001", "0.68201077", "0.6800163", "0.6775448"...
0.0
-1
Send specified object over this sender; the object is expected to have a send() method on it that takes the sender and an optional tag as arguments. Where the object is a Message, this will send the message over this link, creating a new delivery for the purpose.
def send(self, obj, tag=None): if hasattr(obj, 'send'): return obj.send(self, tag=tag) else: # treat object as bytes return self.stream(obj)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def send(self, obj):\n\t\tif not isinstance(obj, NotificationMessage):\n\t\t\traise ValueError, u\"You can only send NotificationMessage objects.\"\n\t\tself._send_queue.put(obj)", "def _send_object(object: Any, src: int, dst: int, group: ProcessGroup) -> None:\n # then broadcast safely\n _broadcast_object...
[ "0.67527705", "0.62086815", "0.61746854", "0.60819185", "0.5953311", "0.5948292", "0.5933821", "0.58370566", "0.5820838", "0.58184326", "0.5754726", "0.5753957", "0.5739397", "0.57023257", "0.56995153", "0.5694203", "0.56670904", "0.5650131", "0.5615801", "0.561462", "0.56141...
0.7246263
0
Increases the credit issued to the remote sender by the specified number of messages.
def flow(self, n): pn_link_flow(self._impl, n)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def increment_number_served(self, amount):\n self.number_served += amount", "def increment(self, amount):\n pass", "def increase_count(self, number=1):\n self.count += number", "def message_count(self, message_count):\r\n\r\n self._message_count = message_count", "def increment_...
[ "0.5859504", "0.5858063", "0.58558345", "0.5826707", "0.57393926", "0.56193966", "0.5581988", "0.5581988", "0.55269355", "0.55049926", "0.5441741", "0.54332596", "0.54298687", "0.5428229", "0.54040366", "0.5397765", "0.5345099", "0.5308578", "0.5287698", "0.52823144", "0.5267...
0.0
-1
The address that identifies the source or target node
def _get_address(self): return utf82unicode(pn_terminus_get_address(self._impl))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def addr(self):\r\n return self._addr", "def Address(self) -> _n_5_t_0:", "def LocalAddress(self) -> _n_5_t_0:", "def address(self):\n return self._ref_address", "def getNodeAddress(self, node):\n return self.backend.configuration.getAddress(node)", "def address(self):\n \n ret...
[ "0.6868119", "0.6861988", "0.67475843", "0.6747422", "0.6624311", "0.65962154", "0.6393517", "0.6331735", "0.63286245", "0.6327144", "0.6304179", "0.6304179", "0.6304179", "0.6304179", "0.6304179", "0.6285709", "0.6252448", "0.6219399", "0.621825", "0.6213015", "0.6213015", ...
0.0
-1
Indicates whether the source or target node was dynamically created
def _is_dynamic(self): return pn_terminus_is_dynamic(self._impl)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_gentarget(self, target):\r\n raise NotImplementedError", "def isSource(self):\n return (len(self.parents()) == 0)", "def _is_sink() -> bool:\n\n def _is_inplace(n: Node):\n \"\"\"Get the inplace argument from ``torch.fx.Node``\n \"\"\"\n ...
[ "0.6197211", "0.5891024", "0.5883482", "0.58428156", "0.5734207", "0.5549199", "0.55418414", "0.552234", "0.5510017", "0.55010146", "0.54775196", "0.54439205", "0.5443841", "0.54384166", "0.5418937", "0.53778434", "0.5365268", "0.53625435", "0.53625435", "0.5349826", "0.53343...
0.0
-1
Properties of a dynamic source or target.
def properties(self): return Data(pn_terminus_properties(self._impl))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getProperties(targets):", "def source_properties(self):\n\n return self._source_properties", "def script_properties():\n props = obs.obs_properties_create()\n p = obs.obs_properties_add_list(props, \"source\", \"Text Source\",\n obs.OBS_COMBO_TYPE_EDITABLE,\n...
[ "0.67164874", "0.57122445", "0.5666978", "0.5399408", "0.53323853", "0.5325601", "0.52713484", "0.52527875", "0.52527875", "0.52527875", "0.52481174", "0.51705605", "0.5138541", "0.5130201", "0.5058721", "0.5015949", "0.49719658", "0.49544406", "0.49439204", "0.494218", "0.49...
0.0
-1
Capabilities of the source or target.
def capabilities(self): return Data(pn_terminus_capabilities(self._impl))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def capabilities(self):\n pass", "def capabilities(self) -> dto.Capabilities:\n raise NotImplementedError", "def to_capabilities(self):", "def capabilities(self):\n return None", "def capabilities(self):\n return []", "def default_capabilities(self):", "def test_capabilities...
[ "0.65837884", "0.6417727", "0.631415", "0.6130875", "0.58929014", "0.5859484", "0.56354576", "0.56294805", "0.55609107", "0.5484127", "0.5441752", "0.54386663", "0.5409349", "0.53413063", "0.5340517", "0.5271849", "0.5212924", "0.52105296", "0.52105296", "0.51739717", "0.5166...
0.0
-1
A filter on a source allows the set of messages transfered over the link to be restricted
def filter(self): return Data(pn_terminus_filter(self._impl))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_filter_messages(self):\n pass", "def test_filter_messages_non_message(self):\n pass", "def on_privmsg(self, raw_msg, msg, source, **kwargs):", "def _copy(source, track, filter_f=lambda x: True, coef=1000):\n for msg in source:\n if filter_f(msg):\n trac...
[ "0.6043161", "0.58508396", "0.58061045", "0.5748286", "0.55756426", "0.55499357", "0.5549867", "0.55231225", "0.55040914", "0.54838353", "0.5401952", "0.53996754", "0.53563625", "0.5346964", "0.5346759", "0.5298815", "0.5266575", "0.5228859", "0.520577", "0.51964724", "0.5192...
0.0
-1
define your own reward computation function
def reward_shaping(self, state_desc): # Reward for not falling down reward = 10.0 yaw = state_desc['joint_pos']['ground_pelvis'][2] current_v_x, current_v_z = rotate_frame( state_desc['body_vel']['pelvis'][0], state_desc['body_vel']['pelvis'][2], yaw) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def reward_function(self):\r\n def R(state, decision, nodes):\r\n return -1.0/1000*nodes['G'].get_preds_value(state)*(decision['G:R_1']+decision['G:L'])\r\n \r\n return R", "def __generate_reward_function(self):\n K = -3\n self.reward = np.array([[10, 0, K],\n ...
[ "0.7868609", "0.7797033", "0.7595664", "0.7571865", "0.7542965", "0.74668586", "0.74668586", "0.74668586", "0.74668586", "0.74668586", "0.74668586", "0.7463074", "0.7379171", "0.7370518", "0.7367835", "0.7327939", "0.72619116", "0.7261856", "0.724054", "0.7235462", "0.7217431...
0.0
-1
Initialize the name, price, and publisher attributes
def __init__(self, name, price, publisher): # passes self which means itself. only defines name, price, and publisher self.name = name self.price = price self.publisher = publisher # any of these variables are available with the instances below. # called attributes
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self, name, price, publisher):\n\n\t\tself.name = name\n\t\tself.price = price\n\t\tself.publisher = publisher", "def __init__(self, name, price, description):\n self.name = name\n self.price = price\n self.description = description", "def __init__(self, _name, _price):\n ...
[ "0.8742281", "0.77766323", "0.77635586", "0.7575418", "0.715278", "0.71475065", "0.71269536", "0.710719", "0.7004891", "0.69697315", "0.69262815", "0.68820333", "0.686704", "0.6838979", "0.6791007", "0.6776866", "0.67628205", "0.67525285", "0.6721511", "0.66995883", "0.660679...
0.85595906
1
Simulate a hardback book.
def hardback(self): print(self.name.title() + " is a hardback book.") # only one parameter
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def hardback(self):\n\t\tprint(self.name.title() + \" is a hardback book.\")", "def softback(self):\n\t\tprint(self.name.title() + \" is a softback book.\")", "def softback(self):\n\t\tprint(self.name.title() + \" is a softback book.\")", "def back(self):\n self.book.back()\n self.book.save()\n...
[ "0.7480994", "0.706025", "0.706025", "0.64167446", "0.6053993", "0.6037747", "0.5956165", "0.5890169", "0.5888886", "0.58675635", "0.5793995", "0.57767373", "0.5775367", "0.5751254", "0.56818205", "0.56769484", "0.56444496", "0.56236523", "0.5599918", "0.54684776", "0.5436778...
0.7633511
0
Simulate a book being a softback book.
def softback(self): print(self.name.title() + " is a softback book.")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def hardback(self):\n\t\tprint(self.name.title() + \" is a hardback book.\")", "def hardback(self):\n\t\tprint(self.name.title() + \" is a hardback book.\")\n\t\t# only one parameter ", "def give_book(self):\n pass", "def back(self):\n self.book.back()\n self.book.save()\n self.sa...
[ "0.7039198", "0.70243394", "0.6402143", "0.6281067", "0.5441984", "0.52874064", "0.51413476", "0.51136416", "0.5065948", "0.504675", "0.50445867", "0.5042364", "0.5027885", "0.5027778", "0.4997183", "0.49717447", "0.49711064", "0.4962445", "0.49496996", "0.4947928", "0.491111...
0.7562381
1
Check if obj is function(lambda function or user defined method) or not
def is_function(obj): return isinstance(obj, (types.FunctionType, types.MethodType, types.LambdaType))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_function(obj):\n if type(obj) is types.FunctionType:\n return True\n if not is_object(obj):\n return False\n if not hasattr(obj, '__class__'):\n return False\n module = obj.__class__.__module__\n name = obj.__class__.__name__\n return (module == '__builtin__' and\n ...
[ "0.8406804", "0.81598043", "0.8006852", "0.77947617", "0.7518819", "0.74505544", "0.7450269", "0.7407909", "0.7402401", "0.73496395", "0.733957", "0.7261521", "0.71794486", "0.7146296", "0.71161747", "0.7082738", "0.7004352", "0.68949264", "0.6871542", "0.68401486", "0.670495...
0.8658715
0
Check if obj is Chainer dataset instance or not
def is_dataset(obj): return isinstance(obj, (DictDataset, ImageDataset, LabeledImageDataset, TupleDataset, DatasetMixin))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_pyvista_dataset(obj):\n return isinstance(obj, (pyvista.DataSet, pyvista.MultiBlock))", "def is_dataset(self):\n return self._dataset is not None", "def is_dataclass_instance(obj: Any) -> bool:\n return dataclasses.is_dataclass(obj) and not isinstance(obj, type)", "def _is_dataclass_instance(...
[ "0.770893", "0.739313", "0.729949", "0.7168334", "0.6819271", "0.6281159", "0.61960447", "0.6142162", "0.6134108", "0.6121551", "0.59871554", "0.59129447", "0.5847221", "0.5837641", "0.5763372", "0.5737771", "0.57180643", "0.570669", "0.57029617", "0.5697987", "0.5680553", ...
0.76800853
1
Extract only necessary number of arguments from `args_tuple` for `fn` For example if fn is defined as `fn(x)`, and `args = (x, y)`, you want to pass only `x` to `fn`. However `fn(args)` will fail. Instead, you can use `fn(filter_args(fn, args))` to pass only first argument `x` to `fn`.
def filter_args(fn, args_tuple): sig = inspect.signature(fn) flag_var_positional = any([ inspect.Parameter.VAR_POSITIONAL == value.kind for value in sig.parameters.values()]) if flag_var_positional: return args_tuple else: num_args = len(sig.parameters.items()) re...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _handle_func_args(func, *args, **kwargs):\n if not isinstance(func, (types.FunctionType, types.MethodType)):\n raise RuntimeError('fn {} is not function or method'.format(func))\n if kwargs:\n bound_arguments = inspect.signature(func).bind(*args, **kwargs)\n bound_arguments.apply_def...
[ "0.5690902", "0.55679125", "0.5562832", "0.55326533", "0.54733473", "0.5434962", "0.5408235", "0.5394954", "0.536647", "0.5345054", "0.5256749", "0.52392966", "0.5222291", "0.51986945", "0.5194496", "0.51747423", "0.5167758", "0.5150224", "0.5120675", "0.50989544", "0.5081835...
0.79530096
0
Check type of X and y. It updates the format of X and y (such as dtype, convert sparse matrix to matrix format etc) if necessary. `X` and `y` might be array (numpy.ndarray or sparse matrix) for sklearn interface, but `X` might be chainer dataset.
def _check_X_y(self, X, y=None): return X, y
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _check_x_y(X, y):\n return check_X_y(X, y,\n accept_sparse=['csr', 'csc'], # Accept sparse csr, csc\n order=None, # Make no C or Fortran imposition\n copy=False, # Do not trigger copying\n force_all_fini...
[ "0.7357704", "0.71228385", "0.6991068", "0.68687665", "0.67003375", "0.6683965", "0.66768664", "0.6642364", "0.66209364", "0.6410842", "0.638924", "0.6302818", "0.6280338", "0.6188695", "0.6162823", "0.614365", "0.61106133", "0.61106133", "0.61106133", "0.6007301", "0.5995192...
0.60455394
19
build predictor This function is used when `predictor` is not set at `__init__`.
def build(self): if self.predictor_constructor is None: print('[ERROR] build_predictor_fn not set, skip.') else: if hasattr(self, 'predictor'): print( "[WARNING] predictor is already set, predictor is overridden") del self.predi...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _build_predictor(self):\n try: \n predict_fn = tf.contrib.predictor.from_saved_model(self.saved_path)\n except OSError as err: \n print(f\"OSError: {err}\")\n self._predict_fn = predict_fn", "def build_predictor(self):\n if self.library == \"yolov5\":\n ...
[ "0.7997393", "0.74647427", "0.7036349", "0.69404703", "0.68318325", "0.66644275", "0.6648286", "0.6613312", "0.6613312", "0.6613312", "0.65086025", "0.65041876", "0.6477833", "0.64506423", "0.63864267", "0.6300349", "0.62879354", "0.6251706", "0.6243861", "0.622155", "0.61992...
0.79013455
1
Computes the loss value for an input and label pair. It also computes accuracy and stores it to the attribute.
def __call__(self, *args): assert len(args) >= 2 x = args[:-1] t = args[-1] self.y = None self.loss = None self.accuracy = None self.y = self.predictor(*x) self.loss = self.lossfun(self.y, t) reporter.report({'loss': self.loss}, self) if se...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def loss_calc(pred, label, device):\r\n # out shape batch_size x channels x h x w -> batch_size x channels x h x w\r\n # label shape h x w x 1 x batch_size -> batch_size x 1 x h x w\r\n label = label.long().to(device)\r\n return cross_entropy_2d(pred, label)", "def calc_loss(predictions, labels):\n ...
[ "0.6953716", "0.6927435", "0.66778916", "0.6653483", "0.665128", "0.660612", "0.6591823", "0.6517802", "0.6488865", "0.64844507", "0.6472367", "0.64487875", "0.6446951", "0.6435649", "0.64180297", "0.64180297", "0.6347753", "0.63466513", "0.63127905", "0.6281808", "0.628104",...
0.0
-1
Forward computation without backward. Predicts by the model's output by returning `predictor`'s output
def _forward(self, *args, calc_score=False): with chainer.using_config('train', False), chainer.no_backprop_mode(): if calc_score: self(*args) return self.y else: if self.predictor is None: print("[ERROR] predictor is no...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def forward(self, x: torch.Tensor) -> torch.Tensor:\n x = self.cnn.extractor.forward(x)\n return self.cnn.regressor(x)", "def predict(self):\n\n self.eval()\n return self.forward(self.data)", "def _forward(self, inputs):\n if is_tf_available():\n # TODO trace model...
[ "0.6860968", "0.68073976", "0.669606", "0.6645282", "0.6645282", "0.6601591", "0.65974206", "0.6564332", "0.65571326", "0.6553761", "0.6515261", "0.64808273", "0.64766705", "0.64733636", "0.6463601", "0.6450425", "0.6378297", "0.63688016", "0.63637966", "0.6338201", "0.631666...
0.65510225
10
Accuracy is used for score when self.accuracy is True, otherwise, `loss` is used for score calculation.
def forward_batch(self, *args, batchsize=16, retain_inputs=False, calc_score=False, converter=concat_examples): # data may be "train_x array" or "chainer dataset" data = args[0] data, _ = self._check_X_y(data) input_list = None output_list = None to...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def train_accuracy(self):\n # Train accuarcy\n add = np.ones(len(self.X_train))\n X_add1 = np.c_[add, self.X_train]\n pred_train = np.dot(X_add1, self.w_result.T)\n pred_train[pred_train > 0] = 1\n pred_train[pred_train < 0] = 0\n print(pred_train)\n train_ch...
[ "0.70093673", "0.6966926", "0.6917287", "0.6880325", "0.6856395", "0.6846561", "0.68240464", "0.68013245", "0.67854166", "0.67408675", "0.67352164", "0.67267776", "0.66686094", "0.66261667", "0.65337867", "0.65244293", "0.6517965", "0.65142536", "0.6501487", "0.64760125", "0....
0.0
-1
If hyper parameters are set to None, then instance's variable is used, this functionality is used Grid search with `set_params` method. Also if instance's variable is not set, _default_hyperparam is used.
def fit(self, X, y=None, **kwargs): kwargs = self.filter_sk_params(self.fit_core, kwargs) return self.fit_core(X, y, **kwargs)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_hyperparams(self, params):", "def overwrite_hyperparams(self):\n try:\n default_hyperparams = self.hyperparams\n for key in default_hyperparams:\n try:\n flag = self.FLAGS[key]\n param_value = flag.value\n ...
[ "0.6941055", "0.6868162", "0.6503105", "0.632722", "0.63074577", "0.62625915", "0.62121147", "0.6124921", "0.61127967", "0.603672", "0.600084", "0.593414", "0.59233576", "0.5909416", "0.58828896", "0.58315045", "0.57978684", "0.5788695", "0.57843053", "0.577673", "0.5775699",...
0.0
-1
get_params is used to clone this estimator
def get_params(self, deep=True): res = copy.deepcopy(self.sk_params) res.update({ 'lossfun': self.lossfun, 'accfun': self.accfun, 'device': self.device, }) if hasattr(self, 'predictor'): res.update({'predictor': self.predictor}) els...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_params(self, **params): # pylint: disable=unused-argument\n res = copy.deepcopy(self.sk_params)\n res.update({'build_fn': self.build_fn})\n return res", "def get_params(self):", "def get_parameters(self):\n return(_deepcopy(self.parameters))", "def get_params(self):\n raise No...
[ "0.6887171", "0.6813362", "0.6811358", "0.6755363", "0.6736471", "0.66621155", "0.66507924", "0.6552451", "0.65461105", "0.6531043", "0.64356965", "0.6422804", "0.63650274", "0.6340062", "0.6338547", "0.63206744", "0.63206744", "0.63148725", "0.63033503", "0.6301306", "0.6301...
0.6364625
13
set_params is used to set Grid parameters
def set_params(self, **parameters): for parameter, value in parameters.items(): if parameter == 'predictor': if isinstance(value, chainer.Link): del self.predictor with self.init_scope(): self.predictor = value ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_params(self, params):", "def set_params(self, **kwargs):\n ...", "def set_params(self):\r\n pass", "def set_params(self):\n raise NotImplementedError", "def setParams(self, paramSet):\r\n pass", "def set_parameters(self,params):\n K3Supervisor.set_parameters(self,pa...
[ "0.8242275", "0.8031304", "0.7931486", "0.78110415", "0.77648544", "0.7731401", "0.74740833", "0.7461525", "0.7444127", "0.738653", "0.7323594", "0.73199934", "0.7163258", "0.71245563", "0.7099512", "0.70852375", "0.7066454", "0.7006044", "0.6966681", "0.69654024", "0.6933797...
0.0
-1
3x3 convolution with padding.
def conv3x3(in_ch, out_ch, stride=1): return nn.Conv2d(in_ch, out_ch, kernel_size=3, stride=stride, padding=1)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def conv3x3(in_planes, out_planes, stride=1, dilation=1, padding=1):\n return nn.Conv2d(in_planes,\n out_planes,\n kernel_size=3,\n stride=stride,\n padding=padding,\n dilation=dilation,\n bia...
[ "0.7665533", "0.750533", "0.73832965", "0.7380516", "0.73474073", "0.73350036", "0.7330572", "0.72955906", "0.72836083", "0.72836083", "0.72783107", "0.72783107", "0.72783107", "0.72783107", "0.72783107", "0.72783107", "0.72783107", "0.7255366", "0.72535574", "0.7239327", "0....
0.7397168
2
3x3 subpixel convolution for upsampling.
def subpel_conv3x3(in_ch, out_ch, r=1): # return nn.Sequential( # nn.Conv2d(in_ch, out_ch * r**2, kernel_size=3, padding=1), # nn.PixelShuffle(r)) # change return nn.SequentialCell([nn.Conv2d(in_ch, out_ch * r**2, kernel_size=3, padding=1), # # TODO BY J : n...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def upsample(img):\n\n filtered = sp.signal.convolve2d(img, guassianFilter, 'same')\n i, j = img.shape\n upsampled = np.zeros((i*2, j*2))\n for r in range(i):\n upsampled[2 * r, ::2] = img[r, ::]\n for c in range(j):\n upsampled[::2, 2 * c] = img[::, c]\n\n # Need to raise values of...
[ "0.6943332", "0.665393", "0.6633777", "0.6423359", "0.6412302", "0.6387215", "0.63617104", "0.6355875", "0.63346636", "0.6319892", "0.6302869", "0.61695826", "0.61299837", "0.61078674", "0.6094001", "0.60805935", "0.60144705", "0.6009432", "0.5987273", "0.5937372", "0.5910003...
0.6479388
3
For whatever reason, determiner part of speech is never explicitly marked in this dataset. Words with a definiteness annotation and no explicit part of speech are regarded here as determiners, but other parts of speech override it.
def set_tagtype(tagvec, tagtype, tag, lang_name): if tagtype == "Definiteness" and tagvec[0] is None: set_tagtype(tagvec, "POS", "DET", lang_name) i = TAGTYPE_INDICES[tagtype] if tagvec[i] is not None and tagvec[i] != tag and tagvec[i] != "DET": if lang_name in UNIMORPH_CONFLICT_RESOLUTIO...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def discriminant(self, words):\n indicators = self.evaluate_indicators(words)\n indicators = array(indicators, ndmin=2) # I am fine with 1d arrays but scikit-learn raises deprecation warning\n prediction = self.model.predict(indicators)\n return prediction", "def _preprocess_word_tes...
[ "0.55654466", "0.55610865", "0.5530565", "0.54185295", "0.53863215", "0.53613085", "0.53151375", "0.52959526", "0.5295588", "0.528022", "0.52491087", "0.5244267", "0.51662785", "0.51616746", "0.51567394", "0.51498985", "0.51485217", "0.51472175", "0.5130869", "0.5119427", "0....
0.0
-1
Take a list of tags in arbitrary order and convert to a vector where each position corresponds to a particular category of tag, e.g., tagvec[0] is part of speech, tagvec[1] is grammatical person, etc. Many tags are liable to be ignored.
def encode_tags(taglist, lang_name): tagvec = [None]*len(UNIMORPH_CATEGORIES) for tag in taglist: if tag in UNIMORPH_TAGTYPES: tagtype = UNIMORPH_TAGTYPES[tag] set_tagtype(tagvec, tagtype, tag, lang_name) if tag in UNIMORPH_POS_MAP: pos = UNIMORPH_POS_MAP[tag...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def build_taglist(tags):\n taglist = []\n for tag in tags:\n taglist.append(tag['value'].lower())\n return taglist", "def process_tags(tags=list):\n new_tag_list = list()\n for tag in tags:\n new_tag = tag.replace(\"<\", \" \")\n new_tag = new_tag.replace(\">\", \" \")\n ...
[ "0.65852666", "0.65625983", "0.6401724", "0.5976778", "0.5954396", "0.59000534", "0.5882231", "0.58056265", "0.5777922", "0.5743458", "0.57354516", "0.57318646", "0.5717215", "0.5706954", "0.5682867", "0.566913", "0.5664755", "0.5604232", "0.56017196", "0.5593573", "0.5589931...
0.70481676
0
Produce a dictionary of dictionaries, which indexes all inflected forms primarily by part of speech, and secondarily by lemma. Each entry records a tag vector and the inflected form. e.g., {
def get_encoded_forms(lang_name): triplets = get_language_training_data(lang_name) by_lemma = {} for triplet in triplets: lemma = triplet["lemma"] form = triplet["inflected_form"] try: tagvec = encode_tags(triplet["unimorph_tags"].split(";"), lang_name) except ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def keyword_extraction(file_content):\n\n # [question, question....]\n for key, value in file_content.items():\n seg, hidden = ltp.seg([key])\n # ner: [[('Nh', 2, 2)]]\n ner = ltp.ner(hidden)\n # keywords: [('PERSON', \"吴轩\")], tuple_item: ('Nh', 2, 2)\n keywords = [(tag_t...
[ "0.6260083", "0.6084667", "0.60658395", "0.6039075", "0.59498996", "0.5932371", "0.58884287", "0.58660764", "0.58531505", "0.5827168", "0.582249", "0.57876813", "0.5762694", "0.575759", "0.5756045", "0.5737842", "0.57028764", "0.5680881", "0.5674194", "0.5671517", "0.56706685...
0.6908251
0
Returns a method that can be used in argument parsing to check that the argument is greater or equal to `threshold`.
def int_greater_or_equal(threshold: int) -> Callable: def check_greater_equal(value_to_check): value_to_check = int(value_to_check) if value_to_check < threshold: raise argparse.ArgumentTypeError("must be greater or equal to %d." % threshold) return value_to_check return ch...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _check_threshold(threshold, value):\r\n return threshold[0](value, threshold[1])", "def para_lower_than(threshold):\n\n return lambda step, curr_obj, curr_optimized_obj, extra_para: extra_para<threshold", "def check_threshold(threshold, data, percentile_func, name=\"threshold\"):\n if isinstance(t...
[ "0.7370649", "0.6820717", "0.6663611", "0.6351839", "0.6257886", "0.6181709", "0.6176472", "0.61548364", "0.6131899", "0.5963718", "0.59134835", "0.583714", "0.57841104", "0.57519346", "0.5749945", "0.571507", "0.57088745", "0.57036436", "0.56767607", "0.5676653", "0.56705195...
0.7772039
0
Get strings one byte at a time
def get_string(addr, size): output = '' for offset in range(size): output += chr(getByte(addr)) addr = addr.add(1) return output
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def copy_string(s, copies=100):\n copied_strings = []\n for i in range(copies):\n copied_strings.append(s)\n return copied_strings", "def ej08a(texto):\n indice = 0\n resultado = []\n current_byte = \"\"\n\n for i in texto:\n current_byte += i # se agrega el nuevo caracter al ...
[ "0.6075005", "0.60214555", "0.59702146", "0.569725", "0.56870294", "0.5686719", "0.56572413", "0.55854017", "0.551215", "0.54828984", "0.5463846", "0.54560965", "0.543026", "0.5423685", "0.54076964", "0.5385192", "0.537536", "0.5355074", "0.53514504", "0.5324246", "0.5241192"...
0.0
-1
Use XOR to decode string with key
def decode(encoded_key, encoded_string, size): decoded_string = '' i = 0 for i in range(0, size): decoded_string = decoded_string + chr(ord(encoded_string[i]) ^ ord(encoded_key[i % len(encoded_key)])) return str(decoded_string)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def xor_decode(data, key):\n if not data:\n return \"\"\n if not key:\n raise exceptions.DecryptError\n data = binascii.a2b_hex(data.encode(\"utf-8\")).decode(\"utf-8\")\n return ''.join(chr(ord(a) ^ ord(b)) for a, b in zip(data, key))", "def xor_single_char(str_bytes, key):\n output...
[ "0.7991848", "0.7306632", "0.7247322", "0.70577437", "0.70343864", "0.7019007", "0.6985263", "0.6967711", "0.6917603", "0.68332607", "0.68273264", "0.68106115", "0.6791771", "0.67914444", "0.6774599", "0.67738247", "0.6680433", "0.66658175", "0.664195", "0.662221", "0.6550633...
0.67061913
16
Get the header/identifier of the protein sequence
def protein_fref(self): # if no (main) protein file is set -> return None if not self.protein_file: return None header, descr = parseSingleFastaHeaderFromFile(self.protein_file) return header
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _get_seq_header_string(sequence_len: int) -> str:\n return \"SQ SEQUENCE {} AA; {} MW; {} CRC64;\".format(\n sequence_len,\n 12345, # Does not need to be set for ProtGraph\n \"45D66B0D27B69FCD\" # Does not need to be set for ProtGraph\n )", "def get_geneID(header):\n gen...
[ "0.6994466", "0.66686326", "0.66443473", "0.66335607", "0.64757615", "0.64612216", "0.64019", "0.63863087", "0.6367533", "0.63309807", "0.6327891", "0.6291266", "0.6252634", "0.62449926", "0.62280643", "0.61766165", "0.6130438", "0.61271536", "0.6099016", "0.6081716", "0.6062...
0.6457443
6
Get the header/identifier of the unigene (> TC00000, ... )
def unigene_fref(self): # if no (main) unigene file is set -> return None if not self.unigene_file: return None return gnamefromgfftuple(parsegfffile(self.unigene_file)[0])
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_geneID(header):\n geneID = header[31:43].replace('B',' ').replace('ac', ' ')\n return geneID", "def getHeader():\n return _HEADER", "def get_header(header, pkt):\n try:\n str_pkt = str(pkt)\n\n init_header = str_pkt.index( header )\n after_header = str_pkt[ ( init_hea...
[ "0.67088073", "0.64894015", "0.6450184", "0.6439348", "0.64023453", "0.6292808", "0.62545466", "0.6235979", "0.6127953", "0.6072726", "0.6070554", "0.6060154", "0.6055612", "0.60288817", "0.6013468", "0.6001597", "0.5991763", "0.5978171", "0.5973944", "0.5957726", "0.59528774...
0.0
-1
Get the header/identifier of the DNA sequence file / e.g. the locus dir name
def dna_fref(self): return os.path.basename( self.dirname )
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_fasta_get_id(self):\r\n\r\n header_records = mfau.get_record_headers(full_file_name)\r\n\r\n self.assertGreaterEqual(len(header_records), 0)\r\n\r\n unique_id = mfau.get_record_id(header_records[0])\r\n\r\n # checks agains the first id in the first record in the supplied data f...
[ "0.6870631", "0.67745036", "0.6690249", "0.6581836", "0.6437996", "0.6403705", "0.63679934", "0.63410324", "0.6326713", "0.6274688", "0.62192285", "0.61473405", "0.6036395", "0.60117966", "0.60072935", "0.599143", "0.59842074", "0.59809774", "0.5960432", "0.5904946", "0.59032...
0.5942314
19
Get the header/identifier of the locus (> chromosome, contig)
def locus_fref(self): return open(self.locus_file).read().split('\t')[0]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_geneID(header):\n geneID = header[31:43].replace('B',' ').replace('ac', ' ')\n return geneID", "def get_contig_name(header):\n contig_header_string = get_contig_header_string()\n match = re.search(\"^({}).*\".format(contig_header_string), header, flags=re.I)\n return match.groups()[0]", ...
[ "0.68925667", "0.6679853", "0.6339763", "0.6236484", "0.6204143", "0.6138393", "0.61318994", "0.6121601", "0.609627", "0.6043013", "0.5975092", "0.5974807", "0.59572047", "0.59379894", "0.59207666", "0.5870733", "0.5869077", "0.5857757", "0.5856443", "0.5788842", "0.57628846"...
0.0
-1
Get the start position of the gene locus
def locus_start(self): return int(open(self.locus_file).read().split('\t')[3])
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_start_loc(self) -> Tuple[int, int]:\n assert self.pos_marker\n return self.pos_marker.working_loc", "def start_loc(self) -> str:\n return self._start_loc", "def starting_position(self) -> pulumi.Output[Optional[str]]:\n return pulumi.get(self, \"starting_position\")", "def...
[ "0.77073485", "0.74084705", "0.71206504", "0.7031793", "0.7027435", "0.70186096", "0.69944763", "0.68277234", "0.6802845", "0.6798797", "0.6798797", "0.6798797", "0.67664516", "0.67396003", "0.67304647", "0.6725751", "0.670482", "0.6681209", "0.6661813", "0.66093403", "0.6602...
0.7950396
0
Get the stop position of the gene locus
def locus_stop(self): return int(open(self.locus_file).read().split('\t')[4])
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_end_loc(self) -> Tuple[int, int]:\n assert self.pos_marker\n return self.pos_marker.working_loc_after(\n self.raw,\n )", "def get_feature_start_end(feature_record):\n return (feature_record.location.start.position+1, feature_record.location.end.position)", "def get_re...
[ "0.67176384", "0.6519938", "0.63851106", "0.62137026", "0.61599874", "0.60957605", "0.6017166", "0.5999214", "0.5970096", "0.59533167", "0.58981377", "0.58107245", "0.56889755", "0.56417394", "0.5638737", "0.5631604", "0.5626625", "0.5593594", "0.55803275", "0.55604434", "0.5...
0.7825671
0
Get the DNAsequence of this locus directory
def dnasequence(self): return parseSingleFasta(open(self.dna_file).readlines())[1]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_seq(self):\n dna_seq = ''\n\n for exon in self.exons: \n dna_seq += self.rna.gene.polymer.get_subseq(\n start=exon.start, end=exon.end)\n\n if self.rna.gene.strand==core.PolymerStrand.negative:\n dna_seq = dna_seq.reverse_compleme...
[ "0.6546175", "0.6482111", "0.62228996", "0.60724056", "0.60136324", "0.5968651", "0.5957638", "0.589398", "0.58743834", "0.5781113", "0.57661885", "0.57573223", "0.5678389", "0.5626131", "0.5626131", "0.5626131", "0.5626131", "0.5626131", "0.5626131", "0.5626131", "0.5626131"...
0.68442
0
Is there a noncanonical splice site in the unigene alignment?
def has_unigene_implausible_splice_sites(self): HAS_IMPLAUSIBLE_SPLICE_SITES = False warnings = [] if self.unigene_file: # read gff file to list of tuples locusgff = parsegfffile(self.locus_file) # define offset and length from locusgff offset = ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def local2align(seq):\n lookup = []\n for i in xrange(len(seq)):\n if seq[i] == \"-\":\n continue\n lookup.append(i)\n return lookup", "def test_align_unaligned_seqs(self):\n res = align_unaligned_seqs(self.seqs1_fp, RNA)\n self.assertEqual(res.toFasta(), self.seqs...
[ "0.5697754", "0.55327564", "0.5487735", "0.5486325", "0.54607797", "0.5405099", "0.53820276", "0.5363385", "0.53443295", "0.53379434", "0.5330011", "0.5304727", "0.5275631", "0.52500397", "0.52316725", "0.5217126", "0.5213405", "0.52056897", "0.5178568", "0.51767623", "0.5170...
0.0
-1
Create a (logical) organismbased stringtag for this locus
def _create_auto_key(self,identifier2organism={}): # when this is a locus in a dbwarehouse, abstract the genomedirname realdirname = os.path.realpath(self.dirname) if realdirname.find("/loci/") > 0: key = os.path.basename(realdirname[0:realdirname.find("/loci/")]) if key:...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def tag(self):\n \n tag = super(self.__class__, self).tag();\n tag = als.tag_join(tag, als.stra(self.strain));\n tag = als.tag_join(tag, als.stra(self.dtype));\n tag = als.tag_join(tag, 'w=%s' % als.stra(self.wid)); \n tag = als.tag_join(tag, 's=%s' % als.stra(self.stage));\n #tag = analysis...
[ "0.6019185", "0.55335134", "0.5340194", "0.5291355", "0.5280373", "0.5257014", "0.5218892", "0.52083755", "0.5180307", "0.5176566", "0.5175204", "0.5143851", "0.5091529", "0.5086643", "0.506967", "0.5057126", "0.50526357", "0.5033586", "0.5029629", "0.5018323", "0.5013509", ...
0.0
-1
Run getorf and parse the output into Orf objects
def rungetorf(self,input={}): # handle potentially applied input argument self._handle_input_subdict(input) # check if orfs already predicted (in self.input data structure) if not self.input['orfs']: # predict ORFs on the dna sequence _retstruct = rungetorf( { sel...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_orfs(gtf, args, config, is_annotated=False, is_de_novo=False):\n\n call = not args.do_not_call\n chr_name_file = os.path.join(config[\"star_index\"], \"chrName.txt\")\n chr_name_str = \"--chr-name-file {}\".format(chr_name_file)\n\n logging_str = logging_utils.get_logging_options_string(args)\n...
[ "0.6290331", "0.62656677", "0.60413593", "0.5640268", "0.55594075", "0.5259529", "0.51389754", "0.5081033", "0.5069715", "0.50307995", "0.49715823", "0.4971297", "0.4934135", "0.49177998", "0.49091518", "0.48981243", "0.4882644", "0.48787394", "0.48621264", "0.48614228", "0.4...
0.6281931
1
Parse the input gff file(s) into gene and the unigene tracks
def parseinputgff(self,input={}): # handle potentially applied input argument self._handle_input_subdict(input) # check if gff is already parsed (in self.input data structure) if not self.input.has_key('gff-gene'): # parse gff file(s) _retstruct = parseinputgff({ ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def GFFParse(gff_file):\n genes, utr5, exons=dict(), dict(), dict()\n transcripts, utr3, cds=dict(), dict(), dict()\n # TODO Include growing key words of different non-coding/coding transcripts \n features=['mrna', 'transcript', 'ncrna', 'mirna', 'pseudogenic_transcript', 'rrna', 'snorna', 'snrna', 'tr...
[ "0.72519743", "0.6647155", "0.6512921", "0.64128184", "0.62922543", "0.6217145", "0.61969656", "0.61226493", "0.6065525", "0.60630286", "0.6056564", "0.6033501", "0.6002628", "0.5918242", "0.58857226", "0.58429736", "0.5807663", "0.58062756", "0.57929873", "0.5778425", "0.576...
0.656914
2
Get annotated gene structure as ExonOnOrf objects
def as_exons(self,input={}): # handle potentially applied input argument self._handle_input_subdict(input) # parse data in the AbgpGeneLocusDir self.parseinputgff() self.rungetorf() # we need abgp_geneconfirmation.geneconfirmation first! geneconfirmation( { self._...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def parse_anno_from_gtf(options, contigs):\n\n anno = dict()\n idx2gene = dict()\n gene2idx = dict()\n\n if options.verbose:\n print >> sys.stderr, \"Parsing annotation from %s ...\" % options.anno\n \n ### init genome structure\n for c in contigs:\n if options.verbose:\n ...
[ "0.6250873", "0.6153665", "0.6077418", "0.5979615", "0.5911517", "0.574981", "0.5716723", "0.569521", "0.5629893", "0.56066877", "0.5606171", "0.55866843", "0.5579722", "0.55459327", "0.5497925", "0.54559666", "0.5447423", "0.54424953", "0.5439569", "0.54341114", "0.54222876"...
0.6078476
2
Get Orf object from input['orfs'] by nt coords
def _get_orf_object_by_coords(self,start,end): for orfobj in self.input['orfs'].orfs: if orfobj.start == start and orfobj.end == end: return orfobj elif start == None and orfobj.end == end: # used in case of SignalP output -> no Orf start coord given! ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def rungetorf(self,input={}):\n # handle potentially applied input argument\n self._handle_input_subdict(input)\n # check if orfs already predicted (in self.input data structure)\n if not self.input['orfs']:\n # predict ORFs on the dna sequence\n _retstruct = runge...
[ "0.619472", "0.5608206", "0.558664", "0.542973", "0.52548337", "0.5221989", "0.51791555", "0.5147351", "0.51416075", "0.5098306", "0.5067999", "0.5055612", "0.50485295", "0.5022125", "0.4952155", "0.49333888", "0.49302658", "0.48542315", "0.48506433", "0.4842785", "0.4842272"...
0.8008028
0
Helper function which makes a (nearempty) AbgpGeneLocusDirectory from a provided hdr and sequence
def make_abgpgenelocusdirectory_from_fasta(hdr,sequence,outdir): safe_header = hdr.translate(NONLETTERS_TRANS).replace("_","") unique_string = get_random_string_tag(10) if not safe_header: safe_header = unique_string locus_dirname = os.path.join(outdir,"%s_%s" % (safe_header,unique_string)) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_fasta_seqrecord(header, sequence_string):\n seq = Seq(sequence_string, alphabet=IUPAC.unambiguous_dna)\n seqrecord = SeqRecord(seq, description=header)\n return seqrecord", "def make_beddir():\n bname = op.basename(ref).split(\".fa\")[0]\n beddir = makedir(op.join(op.dirname(ref), 'bedf...
[ "0.5109767", "0.5049386", "0.48798478", "0.48655432", "0.4839329", "0.48375845", "0.4768329", "0.46519515", "0.4636762", "0.4630872", "0.4607291", "0.4541173", "0.4538897", "0.45248216", "0.4523164", "0.4519078", "0.45128307", "0.44850436", "0.44771925", "0.4461075", "0.44587...
0.7870412
0
Predict 5 days using 2000 data points
def sell_function(data_points, n_days): prediction_df = model_arima(data_points, n_days) # Calculates the profit for each day predicted taking into account running # costs and compares it with the highest profit so far. profit_array = [None] * (n_days + 1) for count in range(n_days): pric...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def predict(self, requested_day):\n\n df = load_data()\n\n # preprocess\n df = preprocess(df)\n df = filter_by_country(df, self.country_code)\n\n # separate cases from data\n dates, Y = separate(df)\n\n # normalize Y\n Y = normalize(Y)\n\n # apply look...
[ "0.69090486", "0.6893756", "0.64486086", "0.6347395", "0.62824327", "0.6215847", "0.6212239", "0.6188363", "0.6178175", "0.6146872", "0.6104417", "0.6078267", "0.6075024", "0.6062178", "0.6029341", "0.601674", "0.6000416", "0.5977849", "0.59406096", "0.5929347", "0.5906462", ...
0.651763
2
Webscrapes and returns current market price for oil
def showCurrentPrice(): page = requests.get( "https://markets.businessinsider.com/commodities/oil-price?type=wti" ) soup = BeautifulSoup(page.text, "html.parser") currentPrices = soup.find(class_="push-data") price = str(currentPrices.next) return price
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getprice():\n\n print(\"Get price\")\n latest_price = get_latest_price(item_code)\n return latest_price", "def track_price():\n r = requests.get('https://finance.yahoo.com/quote/EURPLN=X?p=EURPLN%3DX&.tsrc=fin-srch&guce_referrer'\n '=aHR0cHM6Ly9maW5hbmNlLnlhaG9vLmNvbS8...
[ "0.707251", "0.70618635", "0.7043081", "0.68868905", "0.6844024", "0.68342733", "0.6802147", "0.6749037", "0.670365", "0.6656732", "0.6621097", "0.65562546", "0.6541665", "0.6535046", "0.6507033", "0.6505526", "0.6440425", "0.64329547", "0.6429208", "0.6409872", "0.6402895", ...
0.76197255
0
Function to create tkinter label.
def createLabel(root): var = tk.StringVar() label = tk.Label(root, textvariable=var, anchor="e", fg="white", bg="black") var.set("Default") return label, var
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_label(self, on, text: str):\n return tk.Label(on, font=self.FONT, bg=self.BG_COLOR, text=text)", "def _create_label(self, x, y, text, width=50, **config):\n\n self.main_canvas.create_text(x, y, text='%6s' % text, width=width, **config)", "def create_label(self):\n\n self.pc_label = ...
[ "0.84251785", "0.8078906", "0.73597234", "0.7352519", "0.72833204", "0.71151215", "0.7094819", "0.70676327", "0.7017179", "0.69791627", "0.69739217", "0.69370806", "0.6932625", "0.6901021", "0.68934005", "0.6872074", "0.6852492", "0.68524647", "0.6783533", "0.67717147", "0.67...
0.7659796
2
Displays a graph on a tkinter frame
def diplayGraph(root, df, side, title, color): figure = plt.Figure(figsize=(5, 4), dpi=100) figure.patch.set_facecolor("black") ax = figure.add_subplot(111) line = FigureCanvasTkAgg(figure, root) line.get_tk_widget().pack(side= side, fill=tk.BOTH) df.plot(kind="line", legend=True, ax=ax, color=...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def makeGraph(self):\n self.graphFrame = Frame(height=400, width=400, bd=10, bg='black')\n self.graphFrame.grid(row=1, column=0)", "def showGraph():\n from booklist import monthly\n\n # Creating a window\n statsWin = Tk()\n statsWin.title(\"Book Popularity\")\n statsWin.geometry(\"10...
[ "0.7309917", "0.7017462", "0.6862233", "0.68201643", "0.67719024", "0.67184496", "0.6665507", "0.66358805", "0.66210634", "0.659594", "0.6539151", "0.65304124", "0.6472328", "0.6430929", "0.6418689", "0.6403626", "0.6373523", "0.6372171", "0.6358165", "0.63577944", "0.6345901...
0.657382
10
Tick function which runs each tkinter tick
def tick(): global time1 # get the current local time from the PC time2 = time.strftime("%H:%M:%S") # if time string has changed, update it if time2 != time1: time1 = time2 timeLabel.config(text=time2) # calls itself every 200 milliseconds # to update the time display as nee...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def tick(self):", "def tick(self, dt):\n pass", "def tick(self):\r\n pass", "def tick(self):\n pass", "def tick(self):\n pass", "def on_tick(self, tick: TickData):\n self.bg5.update_tick(tick)", "def tick(self, tick):\n pass", "def tick(self, tick):\n ...
[ "0.7382439", "0.72446513", "0.7239237", "0.71693593", "0.71693593", "0.7134555", "0.7101185", "0.7101185", "0.70454943", "0.698367", "0.6971162", "0.67934287", "0.6789373", "0.6779245", "0.67427534", "0.6678195", "0.6653672", "0.6618427", "0.6484289", "0.6475375", "0.63795495...
0.67222255
15
Upload a file to an S3 bucket
def upload_file(file_name, bucket, object_name=None): # If S3 object_name was not specified, use file_name if object_name is None: object_name = file_name # Upload the file try: response = s3_client.upload_file(file_name, bucket, object_name) except ClientError as e: loggin...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _upload_s3(self, filename, bucket, objectKey):\n return s3_client.upload_file(filename, bucket, objectKey)", "def upload(filename, bucket):\n print(\"Uploading {} to S3\".format(filename.lower().replace('_', '-')))\n url = \"https://s3.ca-central-1.amazonaws.com/{}/{}\".format(bucket,\n ...
[ "0.87235487", "0.86594856", "0.8603333", "0.851218", "0.85043377", "0.84550345", "0.83306247", "0.83018315", "0.8250505", "0.8155704", "0.80791247", "0.8058864", "0.8024221", "0.8009732", "0.7968962", "0.7964086", "0.7959839", "0.7955395", "0.7954518", "0.7954518", "0.7953141...
0.8027351
12
wird aufgerufen, wenn Polymerase noch nicht gebunden ist, Helikase bindet mit def. Bindungswahrscheinlichkeit und startet Strangauftrennung (und damit ATPVerbrauch). Falls Abstand HelikasePolymerase Mindestabstand erreicht hat, bindet Polymerase mit def. Bindungswahrscheinlichkeit.
def initiate(self, DNA, Pol, Hel):
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def erase(self):\n pass", "def revise():", "def erase(self):\r\n self.start = None\r\n self.end = None", "def erase(self):\r\n self.in_arrow = None\r\n self.out_arrow = None", "def disarm(self):\n pass", "def update(self):\n #self.model.states[Polymerase]....
[ "0.63083416", "0.6037906", "0.58477604", "0.57597125", "0.5641044", "0.5612513", "0.56048584", "0.55713207", "0.5521821", "0.5387579", "0.5377646", "0.537194", "0.5364851", "0.53398025", "0.53177893", "0.53041536", "0.53035074", "0.52953607", "0.5279134", "0.5274398", "0.5268...
0.0
-1
Wird aufgerufen, wenn Polymerase und Helicase gebunden sind. Testet, ob genug ATP Molekuele und Nukelotide vorhanden sind. Verlaengert pro Step um 100 Nukelotide oder die maximal moegliche Anzahl bei ATP/Nukleotid Begrenzung. Der maximale Abstand zwischen Helikase und Polymerase ist 3000, der minimale 1500.
def elongate(self,DNA, Pol, Hel): Helicase = Hel PolymeraseIII = Pol if self.ATP_molecules >= 100 and (Helicase.position - PolymeraseIII.position) < 3000: #genug ATP, Abstand klein genug Helicase.position += 100 self.ATP_molecules -= 100 if self.Nucleotide >=...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def sweep50T(self):\n return 35.6", "def eval_sltp(self):\n\n pos_size = float(self.get_position()['positionAmt'])\n if pos_size == 0:\n return\n # tp\n tp_order = self.get_open_order('TP') \n \n is_tp_full_size = False \n is_sl_full_size = Fal...
[ "0.62613857", "0.58898103", "0.586885", "0.5563487", "0.55308366", "0.54732174", "0.54482967", "0.54408836", "0.5423163", "0.53586036", "0.53586036", "0.53586036", "0.53557336", "0.53481734", "0.5347627", "0.5342981", "0.53356946", "0.5331449", "0.5323895", "0.5321739", "0.53...
0.55101335
5
Beendet die Replikation. Wird aufgerufen, wenn die Helicase nicht mehr gebunden ist. Wenn genug Nucleotide vorhanden sind, wird die Polymerase pro Step um 100 Nukelotide verschoben, sonst um die maximal moegliche Anzahl. Ist die Mitte der DNA erreicht, wird die Polymerase abgeloest
def terminate(self,DNA, Pol, Hel): Helicase = Hel PolymeraseIII = Pol #print self.DNA.length, PolymeraseIII.position #wenn pos= length helicase + polyIII fallen ab if PolymeraseIII.bound == True: if self.Nucleotide >= 200 : PolymeraseIII.position += 100 ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def elongate(self,DNA, Pol, Hel):\n Helicase = Hel\n PolymeraseIII = Pol\n if self.ATP_molecules >= 100 and (Helicase.position - PolymeraseIII.position) < 3000: #genug ATP, Abstand klein genug\n Helicase.position += 100 \n self.ATP_molecules -= 100\n if self.Nu...
[ "0.59319", "0.5858611", "0.56021625", "0.5557642", "0.5428448", "0.53653425", "0.53559273", "0.5313522", "0.52209216", "0.52209216", "0.52209216", "0.52209216", "0.52209216", "0.5220617", "0.521062", "0.5195131", "0.5175415", "0.5171143", "0.5150962", "0.51477975", "0.5145308...
0.59928906
0
Testet, ob ein Gen schon doppelt oder einfach vorliegt. Uebergeben werden muessen die DNAPolymerasen, sowie Start und Endpunkt des Gens auf dem Strang. return=2 fuer Gene, die schon repliziert wurden return=1 fuer noch nicht repliziert wurden
def gene_check(self,DNA,Pol_ac,Pol_c,gene_begin,gene_end): PolymeraseIII_ac = Pol_ac PolymeraseIII_c = Pol_c if (gene_end < PolymeraseIII_c.position) or (gene_begin > (2*self.DNA.length-PolymeraseIII_ac.position)): return 2 else: return 1
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def gene_finder(dna):\n all_orfs_both_strands = find_all_ORFs_both_strands(dna)\n longest_fake_orf = longest_ORF_noncoding(dna, 20)\n for element in all_orfs_both_strands:\n if len(element) > longest_fake_orf:\n a_a_string = coding_strand_to_AA(element)\n else:\n a_a_st...
[ "0.58322114", "0.5767576", "0.5685688", "0.5657304", "0.5654366", "0.5649262", "0.5512859", "0.5488095", "0.54644287", "0.54175705", "0.53916204", "0.5375912", "0.5336228", "0.53010494", "0.5297189", "0.52929634", "0.5282707", "0.5276658", "0.5259528", "0.52401114", "0.522686...
0.57869226
1
Returns eigenvalues of the Laplacian of G
def laplacian_spectrum(G, weight="weight"): import scipy as sp return sp.linalg.eigvalsh(nx.laplacian_matrix(G, weight=weight).todense())
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def laplacian_spectrum(G,weight='weight'):\n\n try:\n import numpy as np\n except ImportError:\n raise ImportError(\n \"laplacian_spectrum() requires NumPy: http://scipy.org/ \")\n return np.linalg.eigvals(laplacian(G,weight=weight))", "def normalized_laplacian_spectrum(G, weight=...
[ "0.7259915", "0.7060399", "0.67791516", "0.67284614", "0.65521836", "0.64682174", "0.6402569", "0.6390024", "0.634835", "0.63384664", "0.63020295", "0.62860316", "0.62048584", "0.62014985", "0.61464214", "0.61155266", "0.60952044", "0.60862386", "0.6040493", "0.60269195", "0....
0.7270116
0
Return eigenvalues of the normalized Laplacian of G
def normalized_laplacian_spectrum(G, weight="weight"): import scipy as sp return sp.linalg.eigvalsh( nx.normalized_laplacian_matrix(G, weight=weight).todense() )
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def normalized_laplacian_eig(A, k=None):\n n, m = A.shape\n ##\n ## TODO: implement checks on the adjacency matrix\n ##\n degs = _flat(A.sum(axis=1))\n # the below will break if\n inv_root_degs = [d ** (-1 / 2) if d > _eps else 0 for d in degs]\n inv_rootD = sps.spdiags(inv_root_degs, [0], ...
[ "0.7213387", "0.7147146", "0.7072728", "0.6660331", "0.6454285", "0.64340556", "0.64190364", "0.63966185", "0.637547", "0.63489413", "0.62351114", "0.6224991", "0.61925143", "0.61410123", "0.61347854", "0.6046363", "0.60389954", "0.6030647", "0.6021971", "0.5990303", "0.59651...
0.75299346
0