query
stringlengths
10
2k
document
stringlengths
20
51.2k
metadata
dict
negatives
listlengths
0
101
negative_scores
listlengths
0
101
document_score
stringlengths
3
10
document_rank
stringclasses
102 values
Return a metadata dictionary for the given attribute.
def attribute_metadata(attr: Attr, parent_namespace: Optional[str]) -> Dict: metadata = dict( name=None if attr.is_nameless or attr.local_name == attribute_name(attr.name) else attr.local_name, type=attr.xml_type, namespace=attr.namespace if parent_namespace != attr.n...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_metadata(self, attribute):\n return self.metadata.get(attribute, None)", "def attributes_metadata(self):\n\n attribute_meta = collections.defaultdict(dict)\n\n for attribute in self.attributes:\n attribute_meta[attribute.name]['valuemap'] = attribute.valuemap\n ...
[ "0.80611295", "0.6640201", "0.6310064", "0.6282465", "0.62235844", "0.6186647", "0.61527765", "0.6104153", "0.60708326", "0.59096164", "0.58917516", "0.5883121", "0.5864295", "0.58617693", "0.5850732", "0.5843104", "0.58422196", "0.5841524", "0.5826108", "0.58245003", "0.5811...
0.7190434
1
Generate the field default value/factory for the given attribute.
def attribute_default(attr: Attr, ns_map: Optional[Dict] = None) -> Any: if attr.is_list: return "list" if attr.is_map: return "dict" if not isinstance(attr.default, str): return attr.default data_types = { attr_type.native_code: attr_type.native_type for attr_ty...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _uifield_from_attrs(field: Attribute) -> UiField:\n from attrs import NOTHING, Factory\n\n default = field.default if field.default is not NOTHING else Undefined\n default_factory = None\n if isinstance(default, Factory):\n default_factory = default.factory\n default = Undefined\n\n ...
[ "0.6389327", "0.6322483", "0.6116227", "0.589786", "0.58924073", "0.5888131", "0.5888131", "0.5888131", "0.5848045", "0.5845973", "0.5842988", "0.57989615", "0.57691306", "0.57691306", "0.5736699", "0.5731367", "0.5723616", "0.5711687", "0.56436974", "0.5641029", "0.56033814"...
0.5475348
24
Return the string representation of this JID.
def full(self): if self.user: if self.resource: return u"%s@%s/%s" % (self.user, self.host, self.resource) else: return u"%s@%s" % (self.user, self.host) else: if self.resource: return u"%s/%s" % (self.host, self.resourc...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def to_str(self):\n\n return str(self.project_id)", "def id(self):\n return str(self.jid)", "def __repr__(self):\n return 'JID(%r)' % self.full()", "def __str__(self):\n return str(self._id())", "def to_str(self) -> str:\n\n return json.dumps(\n {\n ...
[ "0.7426563", "0.7422702", "0.7308826", "0.7280616", "0.7264664", "0.7140616", "0.7103659", "0.7103659", "0.7101938", "0.7098328", "0.7049065", "0.7046476", "0.7037667", "0.6987454", "0.6946221", "0.6927895", "0.6927895", "0.691683", "0.691683", "0.691683", "0.691683", "0.69...
0.0
-1
Equality comparison. L{JID}s compare equal if their user, host and resource parts all compare equal. When comparing against instances of other types, it uses the default comparison.
def __eq__(self, other): if isinstance(other, JID): return (self.user == other.user and self.host == other.host and self.resource == other.resource) else: return NotImplemented
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __eq__(self, other):\n return (self.get_status() == other.get_status() and \n self.get_nickname() == other.get_nickname() and \n self._email == other._email)", "def __eq__(self, other):\n return self.storage_ip == other.storage_ip and self.client_port == other.clie...
[ "0.64084405", "0.6358773", "0.61814576", "0.61358035", "0.61164385", "0.59621245", "0.58854353", "0.58666533", "0.585381", "0.58394694", "0.5784352", "0.57822114", "0.57656825", "0.57505447", "0.57491875", "0.5747596", "0.57352936", "0.5717275", "0.57146823", "0.5706218", "0....
0.74519265
0
Inequality comparison. This negates L{__eq__} for comparison with JIDs and uses the default comparison for other types.
def __ne__(self, other): result = self.__eq__(other) if result is NotImplemented: return result else: return not result
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __ne__(self, oth):\n return int(self) == oth", "def __ne__(self, other):\n return int.__eq__(self, other)", "def __eq__(self, other):\n return int.__ne__(self, other)", "def __ne__(self, other):\n return not (self == other) # opposite of __eq__", "def __ne__(self, o...
[ "0.70248646", "0.69780046", "0.6973793", "0.69362265", "0.68947756", "0.68663895", "0.68650854", "0.67956626", "0.67847085", "0.67847085", "0.67847085", "0.67847085", "0.6774166", "0.6768892", "0.6765927", "0.6765927", "0.6765927", "0.6765927", "0.6765927", "0.6765927", "0.67...
0.0
-1
Get unicode representation. Return the string representation of this JID as a unicode string.
def __unicode__(self): return self.full()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def toString(self) -> unicode:\n ...", "def toString(self) -> unicode:\n ...", "def __unicode__(self):\n return str(self).decode('ascii')", "def __str__(self):\n return self.__unicode__().encode('utf-8').decode()", "def get_id(self):\n return unicode(self.id)", "def __s...
[ "0.7284489", "0.7284489", "0.7064411", "0.70184565", "0.69510996", "0.6935268", "0.69069403", "0.6847881", "0.6847881", "0.6764083", "0.67510027", "0.67132187", "0.67065805", "0.6687612", "0.6669283", "0.6643542", "0.66284806", "0.65897703", "0.658734", "0.6583768", "0.657345...
0.0
-1
Get object representation. Returns a string that would create a new JID object that compares equal to this one.
def __repr__(self): return 'JID(%r)' % self.full()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def id_str(self):\n if hasattr(self, 'id'):\n return str(self.id)\n else:\n return 'obj%s' % id(self)", "def __str__(self):\n return str(self._id())", "def __str__(self):\n return str(self.serialize())", "def to_string(self):\n return json.dumps(self.t...
[ "0.6973016", "0.69135034", "0.6621119", "0.6567352", "0.65636516", "0.6547005", "0.6458368", "0.64452475", "0.64262766", "0.64256775", "0.6408302", "0.6408302", "0.6408302", "0.6408302", "0.6388713", "0.6388713", "0.6388713", "0.6342257", "0.63334346", "0.6319515", "0.6308198...
0.66363335
2
Returns a dataframe that contains the results of the statement.
def query(statement, con=None, params=None): if con is None: con = get_connection() table = pd.io.sql.read_sql(statement, con, params=params) return table
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_df(self) -> pd.DataFrame:\n return pd.DataFrame(self.fetchall(), columns=self.headers())", "def run_query(query):\n db.query(query)\n dbResult = db.store_result()\n dbFetched = dbResult.fetch_row(maxrows = 0, how = 2)\n df = pd.DataFrame.from_records(dbFetched)\n return df", "def ...
[ "0.7152821", "0.6969833", "0.6947844", "0.6945339", "0.6869997", "0.6869997", "0.68237275", "0.67375433", "0.6727", "0.66758007", "0.6659355", "0.6659223", "0.6658207", "0.6602367", "0.65329915", "0.65250367", "0.65031457", "0.64772046", "0.6473642", "0.6462457", "0.64423496"...
0.62896967
29
Returns the slipped price per share for an order.
def calculate_price(self, order: Order, price: float, quantity: float, bar: Bar, volume_used: float): raise NotImplementedError()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def bid_ask_spread(orders: pandas.DataFrame):\n return best_bid_price(orders) - best_ask_price(orders)", "def spread(self):\n if self.bid and self.offer:\n return self.offer[0].price - self.bid[-1].price\n\n return 0", "def get_order_price(self):\r\n if self.price is not None...
[ "0.5477907", "0.5236032", "0.51641077", "0.5158731", "0.51148874", "0.5105893", "0.51017535", "0.5088184", "0.50534195", "0.4987114", "0.49851453", "0.49842557", "0.4949354", "0.49146435", "0.4899321", "0.4865036", "0.48559096", "0.48128808", "0.48036277", "0.47860503", "0.47...
0.44513234
76
Convert a value in Hertz to Mels
def hz2mel(hz): return 2595 * np.log10(1+hz/700.0)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def mel_to_hertz(self, mel):\n # return 700.0 * (10**(mel / 2595.0)) - 700.0\n return 250.0 * (9**(mel / 3340.0)) - 250.0", "def hertz_to_mel(self, freq):\n return 3340.0 * log(1 + (freq / 250.0), 9)", "def hertz_to_mel(freq: float, mel_scale: str = \"htk\") -> float:\n\n if mel_scale n...
[ "0.6562281", "0.64037156", "0.6180278", "0.61466455", "0.61109316", "0.602301", "0.6009003", "0.600111", "0.59200937", "0.58808076", "0.58377075", "0.5740704", "0.5724527", "0.5709943", "0.5707225", "0.5699766", "0.56717217", "0.5622939", "0.5597856", "0.55874133", "0.5579861...
0.5328971
36
Convert a value in Mels to Hertz
def mel2hz(mel): return 700*(10**(mel/2595.0)-1)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def mel_to_hertz(self, mel):\n # return 700.0 * (10**(mel / 2595.0)) - 700.0\n return 250.0 * (9**(mel / 3340.0)) - 250.0", "def torch_mel_to_hertz(frequencies_mel):\r\n # return _MEL_BREAK_FREQUENCY_HERTZ * (\r\n # tf.math.exp(frequencies_mel / _MEL_HIGH_FREQUENCY_Q) - 1.)\r\n ret...
[ "0.7050474", "0.62311673", "0.6166904", "0.6111613", "0.6007273", "0.5893435", "0.58479744", "0.5803646", "0.57042795", "0.57033795", "0.56962776", "0.5662375", "0.5657948", "0.56506306", "0.5649922", "0.56447536", "0.56268424", "0.5604601", "0.5570622", "0.55185694", "0.5517...
0.0
-1
Calculates the distance between two points on the earth
def get_distance_between_point(test_long, test_lat, lab_long, lab_lat): test = (test_lat, test_long) lab = (lab_lat, lab_long) return geodesic(test, lab).miles
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def earth_distance(lat1: float, lon1: float, lat2: float, lon2: float)\\\n -> float:\n # R = 6373.0 # earth radius in km\n R = 3963.0 # earth radius in miles\n lat1 = radians(lat1)\n lon1 = radians(lon1)\n lat2 = radians(lat2)\n lon2 = radians(lon2)\n dlon = lon2 - lon1\n dlat = la...
[ "0.77019244", "0.7672922", "0.75489223", "0.74602526", "0.74377084", "0.7431398", "0.7424306", "0.7373982", "0.7368455", "0.7330059", "0.7311306", "0.7230495", "0.7222236", "0.721677", "0.7213821", "0.7206384", "0.72018963", "0.7190489", "0.7184047", "0.71696115", "0.71651906...
0.0
-1
Parse the supply and price information returned by requestMarketCap.
def parseMarketCap(jsonDump, currency, includeVolume=False): data = [] rawData = json.loads(jsonDump) # Covert data in document to wide format dataIntermediate = {} targetFields = [str(key.replace('_data', '')) for key in rawData.keys()] targetFields.remove('x_min') targetFields.remove('x_m...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __parse(self, crypto, response, _date):\n crypto.open = response['1a. open (USD)']\n crypto.high = response['2a. high (USD)']\n crypto.low = response['3a. low (USD)']\n crypto.close = response['4a. close (USD)']\n crypto.volume = response['5. volume']\n crypto.market_c...
[ "0.63937193", "0.6208565", "0.61313295", "0.6056644", "0.6043968", "0.5862597", "0.57959163", "0.56450766", "0.5586157", "0.53498745", "0.53171486", "0.5249453", "0.5213558", "0.5188836", "0.5161587", "0.5158522", "0.51500934", "0.5140428", "0.5137574", "0.5134186", "0.511736...
0.5775096
7
Modify the transmission type to transmit continuously.
def settrafficcontinuous(trafficItemName): queryData = {'from': '/traffic', 'nodes': [{'node': 'trafficItem', 'properties': ['name'], 'where': [{'property': 'name', 'regex': trafficItemName}]}, {'node': 'configElement', 'properties': [], 'where': []}]} queryResponse =...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def transmission(self):\n return 1", "def send_signal():\n print(\"... run {0} transmission\".format(SendSignal.__SIGNAL_SETTINGS['repeats']))\n SendSignal.__SIGNAL_OBJ.RFxmit(SendSignal.__SIGNAL_SETTINGS['text_message'] *\n SendSignal.__SIGNAL_SETTINGS[...
[ "0.6400284", "0.60427666", "0.6033574", "0.60051787", "0.5951145", "0.5736143", "0.56648743", "0.56156105", "0.5524116", "0.5514024", "0.5508814", "0.5507001", "0.54315495", "0.5419062", "0.53944224", "0.5374579", "0.5374579", "0.5333122", "0.5322994", "0.531291", "0.531291",...
0.0
-1
Returns a median value from the values in the given list.
def getMean(list): return sum(list) / len(list)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_median(numlist):\n return np.median(numlist)", "def get_median(values_list):\n try:\n for item in values_list:\n assert isinstance(item, Number)\n except AssertionError:\n return 0\n\n values_list.sort()\n list_len = len(values_list)\n\n if list_len < 1:\n ...
[ "0.8381727", "0.8244031", "0.8065128", "0.8022523", "0.7901576", "0.7888796", "0.7851978", "0.7785097", "0.77303964", "0.7689559", "0.7668722", "0.7570903", "0.7564612", "0.7547091", "0.75173473", "0.73224753", "0.731337", "0.73126715", "0.72649974", "0.7226379", "0.7225822",...
0.58989316
92
Method for checking for collision. This method checks if the character collides with the given rectangle.
def is_colliding(self, rect): return rect.colliderect(self._collision_rect)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_rectangle_colliding(self, rectangle):\n for obstacle in self.obstacle_iterator():\n if rectangle.colliderect(obstacle.rect):\n return True\n return False", "def _rect_intersects(self, rect):\n\tb = (self.left() > rect.right() or \n\t\tself.right() < rect.left() or \...
[ "0.730277", "0.6724298", "0.6697419", "0.65453184", "0.6415739", "0.63965297", "0.6376389", "0.6362594", "0.62146425", "0.6156322", "0.614393", "0.61296123", "0.6116402", "0.6114953", "0.6092828", "0.6074997", "0.6062565", "0.6056596", "0.6054194", "0.6039231", "0.60241175", ...
0.65745413
3
Returns the x coordinate. This method returns the x coordinate of the character.
def get_x(self): return self._collision_rect.x + 14
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _get_x(self):\n return self.position.x", "def get_x_position(self):\n return self.rect.x", "def get_pos_x(self):\n return self.__pos_x", "def Getxcoord(self):\n return self.x_coord", "def get_x(self):\n return self.posX", "def x(self):\r\n return self.position.x"...
[ "0.80208147", "0.790338", "0.7883578", "0.7870256", "0.7805071", "0.758715", "0.7567573", "0.75654596", "0.7467081", "0.73661095", "0.73489124", "0.73364383", "0.732262", "0.7291067", "0.724748", "0.7189719", "0.7159587", "0.712666", "0.7081514", "0.70242137", "0.6955583", ...
0.73150456
13
Returns the y coordinate. This method returns the y coordinate of the character.
def get_y(self): return self._collision_rect.y + 25
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _get_y(self):\n return self.position.y", "def getY(self):\n return self.position.getY()", "def getY(self):\r\n\t\treturn self._y", "def getY(self):\n return self.y", "def getY(self):\n return self.y", "def getY(self):\n return self.__y", "def getYCoordinate(self) ...
[ "0.8032946", "0.7868", "0.7855157", "0.7855057", "0.7855057", "0.78522664", "0.78515464", "0.78142136", "0.7795042", "0.7791374", "0.775957", "0.77457523", "0.77239853", "0.77211833", "0.7716618", "0.77143157", "0.7704015", "0.76841295", "0.767208", "0.76286626", "0.76092905"...
0.7452111
22
Returns the lives. This method returns the current live count of the character.
def get_lives(self): return self._lives
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def lives(self) -> int:\n return self.__state.lives()", "def get_life(self):\r\n return self.__lives", "def lives_counter(self):\n count = 15\n for row in self.board:\n for column in row:\n if column == HITSHIP:\n count -= 1\n ...
[ "0.75438994", "0.7184832", "0.6957298", "0.6694374", "0.6658258", "0.6657273", "0.6654807", "0.6542124", "0.6331505", "0.63177305", "0.63129306", "0.6256183", "0.6226817", "0.6029694", "0.5901248", "0.586796", "0.57940716", "0.5735311", "0.5733305", "0.56925744", "0.56839806"...
0.57738805
17
Returns the invincible flag. This method returns if the character is invincible at the moment.
def is_invincible(self): return self._invincible
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_invincible(self):\n return self._invincible", "def is_invulnerable(self) -> bool:\n return self.invul_timer != 0", "def set_invincible(self, status: bool):\n self._invincible = status\n if self._invincible: # if become invincible\n self._invincible_time = time.ti...
[ "0.7656525", "0.6588657", "0.63137937", "0.60371584", "0.591419", "0.591419", "0.5842657", "0.57927805", "0.57826865", "0.57741624", "0.5744857", "0.5685791", "0.56763095", "0.5623978", "0.5610776", "0.55723834", "0.5566047", "0.556545", "0.5552466", "0.55102605", "0.5475462"...
0.7825228
0
Given two integers a and b, finds their least common multiple. The least common multiple LCM(a, b) of two positive integers a and b is the least positive integer m that is divisible by both a and b. For any two positive integers a and b, LCM(a, b) GCD(a, b) = a b. Therefore, LCM(a, b) = (a b) / GCD(a, b)
def lcm(a, b): return (a * b) // gcd(a, b)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def calculate_lcm(a, b):\n return a * b / calculate_gcd(a, b)", "def lcm(a, b):\n\n\treturn (a * b)/gcd(a, b)", "def lcm(a, b):\r\n return a * b // gcd(a, b)", "def lcm(a, b):\n\treturn a * b // gcm(a, b)", "def lcm(a, b):\n return a * b // gcd(a, b)", "def lcm(a, b):\n return a * b // gcd(a,...
[ "0.8782869", "0.85283905", "0.8509114", "0.85059446", "0.8486167", "0.8486167", "0.8486167", "0.8486167", "0.8486167", "0.8486167", "0.8486167", "0.8486167", "0.8486167", "0.8473189", "0.84652066", "0.84428245", "0.84285027", "0.8406225", "0.8405893", "0.8405893", "0.8405893"...
0.8516658
3
Tests that a ValueError is raised when the wire ID validator is given a wire ID which does not exist in the circuit.
def test_validate_fake_wire(self, circuit): with pytest.raises(ValueError, match=r"Wire ID 4 falls outside the range \[0, 4\)."): circuit._validate_wire_ids(wire_ids=[4])
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_validate_duplicate_wire(self, circuit):\n with pytest.raises(ValueError, match=\"Wire ID 0 is specified more than once.\"):\n circuit._validate_wire_ids(wire_ids=[0, 0])", "def test_validate_closed_wire(self, circuit):\n circuit._wires[0].closed = True\n with pytest.raise...
[ "0.7399734", "0.64560306", "0.6391251", "0.6233081", "0.61214924", "0.6034951", "0.596639", "0.58693725", "0.5864796", "0.58510524", "0.5816543", "0.5799251", "0.5794194", "0.5768328", "0.5767905", "0.5762057", "0.5745894", "0.5705201", "0.57006115", "0.56926525", "0.5692062"...
0.7833013
0
Tests that a ValueError is raised when the wire ID validator is given a wire ID associated with a closed wire.
def test_validate_closed_wire(self, circuit): circuit._wires[0].closed = True with pytest.raises(ValueError, match="Wire 0 is closed."): circuit._validate_wire_ids(wire_ids=[0])
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_validate_fake_wire(self, circuit):\n with pytest.raises(ValueError, match=r\"Wire ID 4 falls outside the range \\[0, 4\\).\"):\n circuit._validate_wire_ids(wire_ids=[4])", "def test_validate_duplicate_wire(self, circuit):\n with pytest.raises(ValueError, match=\"Wire ID 0 is spe...
[ "0.7409358", "0.6821989", "0.6598069", "0.63145036", "0.6239532", "0.60208607", "0.59807926", "0.5949928", "0.59442824", "0.5895871", "0.5835191", "0.5819017", "0.5814549", "0.57856417", "0.57807565", "0.57674545", "0.57464504", "0.57340866", "0.57327795", "0.5730672", "0.571...
0.75784063
0
Tests that a ValueError is raised when a gate is appended to the circuit with the wrong number of wires.
def test_append_dangling_gate(self, circuit): match = ( r"Number of wire IDs \(2\) must match the number of wires connected to the gate \(1\)." ) gate = jet.GateFactory.create("H") with pytest.raises(ValueError, match=match): circuit.append_gate(gate, wire_ids=[0,...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_append_dangling_state(self, circuit):\n match = (\n r\"Number of wire IDs \\(2\\) must match the number of wires connected to the state \\(1\\).\"\n )\n state = jet.Qubit()\n with pytest.raises(ValueError, match=match):\n circuit.append_state(state, wire_i...
[ "0.6854521", "0.6836738", "0.67337847", "0.6718168", "0.665965", "0.64184624", "0.6181125", "0.6179961", "0.6141218", "0.6083717", "0.6060905", "0.5981744", "0.59775215", "0.59605175", "0.5960355", "0.595905", "0.59514016", "0.5939995", "0.5939389", "0.5934823", "0.58973897",...
0.7463739
0
Tests that a quantum circuit which flips a single qubit can be converted into a tensor network.
def test_tensor_network_flip(self): circuit = jet.Circuit(num_wires=1) circuit.append_gate(jet.PauliX(), wire_ids=[0]) tn = circuit.tensor_network() tensor = tn.contract() assert tensor.indices == ["0-1"] assert tensor.shape == [2] assert tensor.data == pytest.ap...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_tensor_network_bell(self):\n circuit = jet.Circuit(num_wires=2)\n circuit.append_gate(jet.GateFactory.create(\"H\"), wire_ids=[0])\n circuit.append_gate(jet.GateFactory.create(\"CNOT\"), wire_ids=[0, 1])\n\n tn = circuit.tensor_network()\n tensor = tn.contract()\n\n ...
[ "0.6933007", "0.65071034", "0.6307535", "0.6273592", "0.62580836", "0.61781937", "0.61629564", "0.6133837", "0.60858136", "0.60668755", "0.60201436", "0.6019835", "0.6000448", "0.5999736", "0.59751964", "0.59688", "0.5956865", "0.59442925", "0.59434444", "0.5925863", "0.59034...
0.7173593
0
Asks user to specify a city, month, and day to analyze.
def get_filters(): print('Hello! Let\'s explore some US bikeshare data! \n') print('-'*40) # TO DO: get user input for city (chicago, new york city, washington). HINT: Use a while loop to handle invalid inputs city = input('Enter your city \n').lower() while city not in cities: print("Yo...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def Raw_Data(city,month,day):\n print(\"The city you have entered is: \",city)\n print(\"The month you have entered is: \",month)\n print(\"The day you have entered is: \",day)", "def get_filters():\n city = None\n month = None\n day = None\n while day == None:\n # TO DO: get user input f...
[ "0.6671077", "0.65363395", "0.64597565", "0.6374352", "0.6349016", "0.6310872", "0.62599736", "0.62324905", "0.62140554", "0.6205851", "0.6182028", "0.6172251", "0.61696005", "0.61590976", "0.6159067", "0.6153877", "0.6145122", "0.6132135", "0.61053854", "0.61032546", "0.6091...
0.6287443
6
Loads data for the specified city and filters by month and day if applicable.
def load_data(city, month, day): # load data file into a dataframe df = pd.read_csv(CITY_DATA[city]) # convert the Start Time column to datetime df['Start Time'] = pd.to_datetime(df['Start Time']) # extract month and day of week from Start Time to create new columns df['month'] = df['Start Tim...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def load_data(city, month, day):\n df = pd.read_csv(CITY_DATA [city])\n \n # convert the Start Time column to datetime\n df['Start Time'] = pd.to_datetime(df['Start Time'])\n \n # extract month and day of week from Start Time to create new columns\n df['month'] = df['Start Time'].dt.month\n ...
[ "0.81320685", "0.8108889", "0.8045821", "0.8042514", "0.80090284", "0.80071104", "0.79991937", "0.7998333", "0.7988789", "0.797905", "0.79737365", "0.79610896", "0.7956163", "0.7947432", "0.79463065", "0.7908287", "0.7908229", "0.7904569", "0.7900715", "0.78930074", "0.788921...
0.7763616
43
Displays statistics on the most frequent times of travel.
def time_stats(df): print('\nCalculating The Most Frequent Times of Travel...\n') start_time = time.time() # TO DO: display the most common month # find the most common month popular_month = df['month'].mode()[0] # display the most frequent Month print('Most Frequent Month is:',months[po...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def time_stats(df):\n\n print('\\nDisplaying the statistics on the most frequent times of '\n 'travel...\\n')\n start_time = time.time()\n\n # display the most common month\n most_common_month = df['Month'].mode()[0]\n print('For the selected filter, the month with the most travels is: ' +\...
[ "0.80247396", "0.80233026", "0.7915788", "0.78266186", "0.7822246", "0.78143597", "0.77659196", "0.7740343", "0.773628", "0.77344066", "0.76867086", "0.7668633", "0.7651731", "0.7644636", "0.76399267", "0.76367253", "0.7625196", "0.7623158", "0.7612803", "0.76002145", "0.7583...
0.69480705
100
Displays statistics on the total and average trip duration.
def trip_duration_stats(df): print('\nCalculating Trip Duration...\n') start_time = time.time() # TO DO: display total travel time tot_duration = (pd.to_datetime(df['End Time']) - pd.to_datetime(df['Start Time'])).sum() df['Total Duration'] = tot_duration days = tot_duration.days hour...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def trip_duration_stats(data):\n print('\\nCalculating Trip Duration...\\n')\n start_time = time.time()\n # display total travel time\n total_trip_time= data['Trip Duration'].sum()\n print('The Total Travel Time is {} Hours'. format(total_trip_time/3600))\n # display mean travel time\n avg_tri...
[ "0.8143788", "0.8025597", "0.8004826", "0.7950089", "0.7937902", "0.79316837", "0.7927231", "0.7915687", "0.7914976", "0.79086065", "0.79061425", "0.79011726", "0.7892046", "0.7890013", "0.7887204", "0.7885618", "0.7884607", "0.78830457", "0.7874646", "0.78690827", "0.7866999...
0.0
-1
Displays statistics on the most popular station and trip.
def station_stats(df): print('\nCalculating The Most Popular Station and Trip...\n') start_time = time.time() # Display most common start station most_start_station = df['Start Station'].mode()[0] print("The Most Used Start Station is {}".format(most_start_station)) # Display most common...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def station_stats(df):\n\n print('\\nCalculating The Most Popular Stations and Trip...\\n')\n start_time = time.time()\n\n # display most commonly used start station\n print(popular_start_station(df))\n\n # display most commonly used end station\n print(popular_end_station(df))\n\n # display m...
[ "0.7856668", "0.77058613", "0.76310027", "0.7573001", "0.7546759", "0.7512356", "0.75078356", "0.7478494", "0.74707913", "0.74231315", "0.742215", "0.7419298", "0.7414002", "0.74133426", "0.7412281", "0.7412267", "0.74085104", "0.740037", "0.73933005", "0.7386985", "0.7384136...
0.7413586
13
The IAM action to grant or revoke permissions on.
def actions(self) -> pulumi.Input[Sequence[pulumi.Input[str]]]: return pulumi.get(self, "actions")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def grant(self, grantee: aws_cdk.aws_iam.IGrantable, *actions: str) -> aws_cdk.aws_iam.Grant:\n ...", "def action_role(self) -> aws_cdk.aws_iam.IRole:\n return self._values.get(\"action_role\")", "def action(self, action):\n allowed_values = [\"DELETE\", \"NONE\"]\n if action not in...
[ "0.6024496", "0.5983584", "0.5948987", "0.57792735", "0.5744172", "0.57281816", "0.56105244", "0.55893177", "0.55773", "0.5561767", "0.555488", "0.5531113", "0.5531113", "0.5531113", "0.5531113", "0.5531113", "0.5531113", "0.5528863", "0.5511036", "0.54444623", "0.5440689", ...
0.48247457
74
The Amazon Resource Name (ARN) of the principal. This can be one of the
def principal(self) -> pulumi.Input[str]: return pulumi.get(self, "principal")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def role_arn(self) -> str:\n return pulumi.get(self, \"role_arn\")", "def role_arn(self) -> Optional[str]:\n return pulumi.get(self, \"role_arn\")", "def role_arn(self) -> Optional[str]:\n return pulumi.get(self, \"role_arn\")", "def principal(self) -> pulumi.Output[str]:\n return...
[ "0.7072746", "0.6928671", "0.6928671", "0.69080997", "0.6905084", "0.68264866", "0.68264866", "0.68264866", "0.68264866", "0.68264866", "0.6810841", "0.6810841", "0.6810841", "0.68082505", "0.6734451", "0.6734451", "0.6734451", "0.6734451", "0.66793", "0.66793", "0.66691506",...
0.66550356
23
The rowlevel security configuration for the dataset.
def __init__(__self__, *, arn: pulumi.Input[str], permission_policy: pulumi.Input['DataSetRowLevelPermissionPolicy'], format_version: Optional[pulumi.Input['DataSetRowLevelPermissionFormatVersion']] = None, namespace: Optional[pulumi.Input[str]] = None...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def security(self) -> ModelDeploymentSecurityConfig:\n return self._security", "def get_security(self):\n return self.cloudant_database.get_security_document()", "def security_entries(self):\n return self._security_entries", "def security(self):\n return self._security", "def se...
[ "0.59713185", "0.57716787", "0.56102043", "0.5594016", "0.55641913", "0.53759253", "0.5228762", "0.49991766", "0.49645537", "0.4953094", "0.48713434", "0.48366454", "0.4801516", "0.4782204", "0.47728473", "0.47728473", "0.4756237", "0.4738713", "0.47349328", "0.4708833", "0.4...
0.4679462
20
The column name that a tag key is assigned to.
def column_name(self) -> pulumi.Input[str]: return pulumi.get(self, "column_name")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def columnName(self):\n return self.__column", "def get_name(self):\n return self.col_name", "def column_name(self) -> Optional[str]:\n return pulumi.get(self, \"column_name\")", "def get_column_name(self) -> str:\n if self.is_shared():\n assert self._shared_id is not N...
[ "0.8030961", "0.79194254", "0.79128087", "0.7381009", "0.72073376", "0.70881635", "0.68607724", "0.68607724", "0.68247503", "0.68247503", "0.68197745", "0.679339", "0.6792754", "0.67778975", "0.6766317", "0.66594696", "0.6655805", "0.6643536", "0.65621233", "0.6551131", "0.65...
0.7826582
3
A string that you want to use to delimit the values when you pass the values at run time. For example, you can delimit the values with a comma.
def tag_multi_value_delimiter(self) -> Optional[pulumi.Input[str]]: return pulumi.get(self, "tag_multi_value_delimiter")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def GenerateValueAsString(self, delim=None):\n if not delim:\n delim = self.GetAttribute(\"Delimiter\")\n if not delim:\n delim = ','\n\n ls = self.GetValue()\n if delim == '\"' or delim == \"'\":\n text = ' '.join(['%s%s%s' % (delim, a, delim) f...
[ "0.65257835", "0.64751285", "0.6306053", "0.62965155", "0.62490594", "0.6231549", "0.62028694", "0.61940694", "0.6180194", "0.6159536", "0.6157168", "0.6152101", "0.6140416", "0.61302304", "0.6019438", "0.6014293", "0.58914006", "0.5868245", "0.5849067", "0.5845133", "0.58234...
0.5487129
57
The Amazon Elasticsearch Service domain.
def domain(self) -> pulumi.Input[str]: return pulumi.get(self, "domain")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def elasticsearch_service_url(self) -> str:\n return pulumi.get(self, \"elasticsearch_service_url\")", "def domain(self):\n return self['domain']", "def getDomain(self):\n return self.domain", "def domain(self):\n return self._domain", "def domain(self):\n return self._do...
[ "0.6927939", "0.64867777", "0.63882214", "0.6367993", "0.6367993", "0.6367993", "0.6325212", "0.6325212", "0.63138855", "0.6242466", "0.62301654", "0.61762094", "0.61403817", "0.61301094", "0.6115946", "0.60959244", "0.60959244", "0.5974728", "0.5969446", "0.59646", "0.594818...
0.587936
29
The workgroup that Amazon Athena uses.
def work_group(self) -> Optional[pulumi.Input[str]]: return pulumi.get(self, "work_group")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def group(self) -> Optional[str]:\n return pulumi.get(self, \"group\")", "def group(self) -> str:\n return pulumi.get(self, \"group\")", "def resource_group(self) -> str:\n return pulumi.get(self, \"resource_group\")", "def resource_group(self) -> pulumi.Output[str]:\n return pulu...
[ "0.6655448", "0.6627361", "0.6547339", "0.6449984", "0.6449984", "0.6437312", "0.6414578", "0.6383316", "0.6379054", "0.6377494", "0.63682145", "0.6334348", "0.6333496", "0.63194156", "0.63194156", "0.63194156", "0.63194156", "0.63194156", "0.63194156", "0.63194156", "0.63194...
0.79905075
0
The Amazon Resource Name (ARN) of a data source that has the credential pair that you want to use. When CopySourceArn is not null, the credential pair from the data source in the ARN is used as the credentials for the DataSourceCredentials structure.
def copy_source_arn(self) -> Optional[pulumi.Input[str]]: return pulumi.get(self, "copy_source_arn")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def event_source_arn(self) -> Optional[pulumi.Input[str]]:\n return pulumi.get(self, \"event_source_arn\")", "def __init__(__self__, *,\n copy_source_arn: Optional[pulumi.Input[str]] = None,\n credential_pair: Optional[pulumi.Input['DataSourceCredentialPairArgs']] = None,\n...
[ "0.5956146", "0.58244294", "0.5712033", "0.5520228", "0.5442974", "0.54001635", "0.52754414", "0.52550375", "0.5189455", "0.5189455", "0.5189455", "0.5189455", "0.5189455", "0.5189455", "0.5189455", "0.5167626", "0.51218367", "0.5049946", "0.4980212", "0.4980212", "0.49440473...
0.73049253
0
The Amazon Resource Name (ARN) of the secret associated with the data source in Amazon Secrets Manager.
def secret_arn(self) -> Optional[pulumi.Input[str]]: return pulumi.get(self, "secret_arn")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def secret_arn(self) -> pulumi.Output[str]:\n return pulumi.get(self, \"secret_arn\")", "def aws_credentials_secret_name(self) -> Optional[str]:\n return pulumi.get(self, \"aws_credentials_secret_name\")", "def resource_arn(self) -> pulumi.Output[str]:\n return pulumi.get(self, \"resource_...
[ "0.7862364", "0.71168846", "0.69094926", "0.6817251", "0.67641574", "0.67295563", "0.6725533", "0.6725533", "0.6725533", "0.6725533", "0.6725533", "0.6725533", "0.6725533", "0.6590017", "0.6470485", "0.64622486", "0.64622486", "0.64580774", "0.6416953", "0.6416953", "0.635145...
0.75659275
2
The HTTP Path of the Databricks data source.
def sql_endpoint_path(self) -> pulumi.Input[str]: return pulumi.get(self, "sql_endpoint_path")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def url(self) -> str:\n return self.DATASET_URLS[self.name]", "def get_url(self):\n return self.db_url", "def db_url(self) -> pulumi.Input[str]:\n return pulumi.get(self, \"db_url\")", "def __data_url(self):\n path = AGENT_DATA_PATH % self.from_.pid\n return \"http://%s:%s/...
[ "0.6748139", "0.66677326", "0.6541198", "0.6487965", "0.6445583", "0.6328719", "0.63136953", "0.629791", "0.62941855", "0.62600845", "0.62600845", "0.6236892", "0.61701363", "0.6023229", "0.6013294", "0.60057783", "0.60057783", "0.59549415", "0.59505117", "0.5949763", "0.5935...
0.6807307
0
Cluster ID. This field can be blank if the Host and Port are provided.
def cluster_id(self) -> Optional[pulumi.Input[str]]: return pulumi.get(self, "cluster_id")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def cluster_id(self) -> str:\n return pulumi.get(self, \"cluster_id\")", "def cluster_id(self) -> str:\n return pulumi.get(self, \"cluster_id\")", "def cluster_id(self) -> str:\n return pulumi.get(self, \"cluster_id\")", "def cluster_id(self) -> str:\n return pulumi.get(self, \"cl...
[ "0.78050256", "0.78050256", "0.78050256", "0.78050256", "0.78050256", "0.7747276", "0.7747276", "0.7478172", "0.7448746", "0.744796", "0.744796", "0.744796", "0.744796", "0.72174865", "0.6688771", "0.65523297", "0.65523297", "0.6549342", "0.6549342", "0.6549342", "0.6549342",...
0.78104603
2
Host. This field can be blank if ClusterId is provided.
def host(self) -> Optional[pulumi.Input[str]]: return pulumi.get(self, "host")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def host_id(self) -> str:\n return pulumi.get(self, \"host_id\")", "def getHost(self):\n return \"Host:PID:\" + str(self.transport.pid)", "def host(self) -> Host:\n _args: list[Arg] = []\n _ctx = self._select(\"host\", _args)\n return Host(_ctx)", "def host(self):\n ...
[ "0.65320975", "0.65128714", "0.6504529", "0.6395003", "0.6395003", "0.6395003", "0.6395003", "0.6395003", "0.6395003", "0.6395003", "0.6376436", "0.63238275", "0.631532", "0.62730116", "0.6260575", "0.6257277", "0.6254463", "0.6214182", "0.6204697", "0.6193642", "0.61926365",...
0.64163285
4
The IAM action to grant or revoke permissions on.
def actions(self) -> pulumi.Input[Sequence[pulumi.Input[str]]]: return pulumi.get(self, "actions")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def grant(self, grantee: aws_cdk.aws_iam.IGrantable, *actions: str) -> aws_cdk.aws_iam.Grant:\n ...", "def action_role(self) -> aws_cdk.aws_iam.IRole:\n return self._values.get(\"action_role\")", "def action(self, action):\n allowed_values = [\"DELETE\", \"NONE\"]\n if action not in...
[ "0.6024496", "0.5983584", "0.5948987", "0.57792735", "0.5744172", "0.57281816", "0.56105244", "0.55893177", "0.55773", "0.5561767", "0.555488", "0.5531113", "0.5531113", "0.5531113", "0.5531113", "0.5531113", "0.5531113", "0.5528863", "0.5511036", "0.54444623", "0.5440689", ...
0.48247457
73
The Amazon Resource Name (ARN) of the principal. This can be one of the
def principal(self) -> pulumi.Input[str]: return pulumi.get(self, "principal")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def role_arn(self) -> str:\n return pulumi.get(self, \"role_arn\")", "def role_arn(self) -> Optional[str]:\n return pulumi.get(self, \"role_arn\")", "def role_arn(self) -> Optional[str]:\n return pulumi.get(self, \"role_arn\")", "def principal(self) -> pulumi.Output[str]:\n return...
[ "0.7074069", "0.6929468", "0.6929468", "0.69071704", "0.69061553", "0.68299687", "0.68299687", "0.68299687", "0.68299687", "0.68299687", "0.6813845", "0.6813845", "0.6813845", "0.681006", "0.67352235", "0.67352235", "0.67352235", "0.67352235", "0.6679005", "0.6679005", "0.667...
0.6653802
22
A Boolean option to control whether SSL should be disabled.
def disable_ssl(self) -> Optional[pulumi.Input[bool]]: return pulumi.get(self, "disable_ssl")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def insecure_ssl(self):\n # type: () -> bool\n return self._insecure_ssl", "def ssl(self) -> Optional[bool]:\n return pulumi.get(self, \"ssl\")", "def org_apache_felix_https_enable(self) -> ConfigNodePropertyBoolean:\n return self._org_apache_felix_https_enable", "def sslEnabled(s...
[ "0.7623181", "0.7606146", "0.74819165", "0.7416215", "0.727059", "0.72394764", "0.72240597", "0.71625936", "0.71554965", "0.70870537", "0.70870537", "0.70870537", "0.70467234", "0.7043288", "0.7039419", "0.7016583", "0.7016583", "0.69126475", "0.68824536", "0.68615746", "0.68...
0.84839267
0
The Amazon Resource Name (ARN) for the VPC connection.
def vpc_connection_arn(self) -> pulumi.Input[str]: return pulumi.get(self, "vpc_connection_arn")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def vpc_connector_arn(self) -> pulumi.Output[str]:\n return pulumi.get(self, \"vpc_connector_arn\")", "def resource_arn(self) -> pulumi.Output[str]:\n return pulumi.get(self, \"resource_arn\")", "def bucket_arn(self) -> str:\n ...", "def bucket_arn(self) -> str:\n return jsii.get(...
[ "0.73539484", "0.66186315", "0.6425604", "0.6423647", "0.6423647", "0.6378119", "0.6136214", "0.6136214", "0.6136214", "0.6136214", "0.6136214", "0.6136214", "0.61335963", "0.6131213", "0.6122081", "0.6112958", "0.6112958", "0.6112958", "0.6112958", "0.6112958", "0.6112958", ...
0.80848604
0
The day scheduled for refresh.
def __init__(__self__, *, day_of_month: Optional[pulumi.Input[str]] = None, day_of_week: Optional[pulumi.Input['RefreshScheduleMapScheduleFrequencyPropertiesRefreshOnDayPropertiesDayOfWeek']] = None): if day_of_month is not None: pulumi.set(__self__, "day_of_month",...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def refresh_on_day(self) -> Optional[pulumi.Input['RefreshScheduleMapScheduleFrequencyPropertiesRefreshOnDayPropertiesArgs']]:\n return pulumi.get(self, \"refresh_on_day\")", "def refresh_period(self):\n return int(self.__get_option('refresh_period'))", "def scheduled(self):\n return str(s...
[ "0.6828935", "0.647418", "0.64335036", "0.62916785", "0.62757003", "0.62536675", "0.616392", "0.611016", "0.60861844", "0.606615", "0.606615", "0.60515726", "0.6016612", "0.6002623", "0.59769905", "0.59216154", "0.590255", "0.5893433", "0.58629566", "0.5848034", "0.58448404",...
0.53236926
85
The Day Of Month for scheduled refresh.
def day_of_month(self) -> Optional[pulumi.Input[str]]: return pulumi.get(self, "day_of_month")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def day_of_month(self):\n return self.__day_of_month", "def day_of_month():\n return datetime.date.today().day", "def day_of_month(self) -> pulumi.Input[int]:\n return pulumi.get(self, \"day_of_month\")", "def day_of_month(self) -> pulumi.Input[int]:\n return pulumi.get(self, \"day_of...
[ "0.7707862", "0.7613374", "0.7583899", "0.7583899", "0.6894733", "0.689461", "0.6755203", "0.67093056", "0.67001355", "0.66608447", "0.6615905", "0.6602384", "0.6602384", "0.6515777", "0.6515777", "0.6515777", "0.6461839", "0.64013153", "0.6333836", "0.6267382", "0.62601924",...
0.7156502
4
The day scheduled for refresh.
def refresh_on_day(self) -> Optional[pulumi.Input['RefreshScheduleMapScheduleFrequencyPropertiesRefreshOnDayPropertiesArgs']]: return pulumi.get(self, "refresh_on_day")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def refresh_period(self):\n return int(self.__get_option('refresh_period'))", "def scheduled(self):\n return str(self.day) if self.day else '-'", "def day(self):\n try:\n return self.schedule.day\n except Schedule.DoesNotExist:\n return None", "def get_next_d...
[ "0.647418", "0.64335036", "0.62916785", "0.62757003", "0.62536675", "0.616392", "0.611016", "0.60861844", "0.606615", "0.606615", "0.60515726", "0.6016612", "0.6002623", "0.59769905", "0.59216154", "0.590255", "0.5893433", "0.58629566", "0.5848034", "0.58448404", "0.5844611",...
0.6828935
0
The timezone for scheduled refresh.
def time_zone(self) -> Optional[pulumi.Input[str]]: return pulumi.get(self, "time_zone")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def timezone(self):\n return self._tz", "def timezone(self):\n return self._timezone", "def timezone(self):\n return self._timezone", "def timezone(self):\n return self._timezone", "def local_tz(self):\n return pytz.timezone(self.calendar.timezone)", "def time_zone():\n...
[ "0.80972856", "0.80344176", "0.80344176", "0.80344176", "0.793545", "0.79192334", "0.7830254", "0.77870613", "0.7734961", "0.76967096", "0.76783925", "0.7605422", "0.7594147", "0.75662017", "0.7556828", "0.75139314", "0.7425432", "0.7304076", "0.72367847", "0.72084826", "0.70...
0.6932986
24
An unique identifier for the refresh schedule.
def schedule_id(self) -> Optional[pulumi.Input[str]]: return pulumi.get(self, "schedule_id")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _get_unique_id(self):\n now = datetime.now()\n\n u_id = now.second + 60*(now.minute + 60*(now.hour + 24*(now.day + 31*(now.month + 366*(now.year)))))\n return \"instance\" + str(u_id)", "def __create_periodic_id() -> str:\n now = datetime.now()\n return now.strftime(\"%m%d%...
[ "0.72309506", "0.7126533", "0.6993511", "0.67968726", "0.67614174", "0.6724264", "0.67003465", "0.66369903", "0.6623119", "0.6609948", "0.6585341", "0.65763015", "0.6569544", "0.65686643", "0.6529642", "0.65214", "0.6516577", "0.64943385", "0.64937484", "0.646986", "0.6419824...
0.67424923
5
Removes the SteamAPI_ prefix from a name.
def unprefix(name): return name.partition("SteamAPI_")[2]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _bcl_scrub_name(name):\n return re.sub('[^0-9a-zA-Z\\-\\_]+', '_', name)", "def removeNamespaceFromString(cls, influenceName):\n tokens = influenceName.split('|')\n result = ''\n\n for i, tokens in enumerate(tokens):\n if i > 0:\n result += '|'\n\n ...
[ "0.6858332", "0.6816422", "0.6690248", "0.66881835", "0.6569286", "0.65246564", "0.64971155", "0.647125", "0.64655906", "0.6448326", "0.642811", "0.6409779", "0.6377758", "0.631595", "0.630828", "0.63008916", "0.628623", "0.6268554", "0.62525827", "0.62328345", "0.61898863", ...
0.9013951
0
Compute cost for logistic regression using theta as the parameters.
def logit_cost(self, theta, X, y): cost = 0.0 ### YOUR CODE HERE sig = utils.sigmoid(theta) for i in range(0, X.shape[0]): cost += (y[i]-1)*theta[i] + np.log(sig[i]) ### END YOUR CODE cost = cost #+ 0.01 * self.regularizer[0](self.weights) r...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def cost(theta, X, y, learning_rate):\n m = len(y) \n theta = theta.reshape((-1,1))\n h = sigmoid(np.dot(X, theta))\n\n first = (1/m)*np.sum(np.dot(-y.T, np.log(h)) - np.dot((1-y).T, np.log(1-h)), axis=0)\n second = (learning_rate/(2*m))*np.sum(theta[1:]**2)\n J = fir...
[ "0.79370785", "0.7895597", "0.77826315", "0.77157617", "0.77063984", "0.76551366", "0.76456136", "0.7568617", "0.7460623", "0.74518436", "0.74240047", "0.7328153", "0.7295483", "0.72414076", "0.7232718", "0.7138538", "0.71082187", "0.7081317", "0.707899", "0.7068826", "0.7061...
0.85694146
0
Return a datetime representing the current selected date.
def selection(self): if not self._selection: return None year, month = self._date.year, self._date.month return self.datetime(year, month, int(self._selection[0]))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def current_datetime(self):\n return DateAccessor().today()", "def get_current_date():\n return datetime.datetime.today().strftime(constants.DATE_FORMAT)", "def getActiveDate(self):\n dateAsQDate = self.workCalendar.selectedDate()\n dateString = str(dateAsQDate.toString('dd/MM/yyyy'...
[ "0.7593795", "0.7487077", "0.7192208", "0.6952059", "0.6941804", "0.6923644", "0.68453515", "0.6812885", "0.6794715", "0.6773453", "0.67528844", "0.6748852", "0.674398", "0.67234397", "0.6689601", "0.6637448", "0.6609131", "0.6597001", "0.6590164", "0.6588638", "0.658004", ...
0.6941494
5
This function will bounce the ball off a horizontal surface (not a vertical one)
def bounce(self, diff): self.direction = (180 - self.direction) % 360 self.direction -= diff
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def bounce(self):\n \n if self.x > width - self.size:\n self.x = 2*(width - self.size) - self.x\n self.angle = self.angle * -1\n self.speed *= elasticity # Added to all to account for elasticity\n elif self.x < self.size:\n self.x = 2*self.size - self.x\n ...
[ "0.79389983", "0.7752862", "0.7560852", "0.75099826", "0.7218843", "0.7192475", "0.71663773", "0.704917", "0.69996685", "0.6991321", "0.697959", "0.6975978", "0.69712824", "0.6956424", "0.6850701", "0.6842054", "0.6791183", "0.6787205", "0.67668873", "0.67412186", "0.67239654...
0.66645
22
Return the length of this vector. >>> v = ICRS([1.0, 1.0, 0.0]) >>> print(v.distance()) 1.41421 au
def distance(self): return Distance(length_of(self.position.au))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def length(self):\n points = [Point(v, crs=self.crs) for v in self.vertices]\n distances = [a.distance(b) for a, b in zip(points[:-1], points[1:])]\n return sum(distances)", "def length(self) -> float:\n return pos.distance(self.start, self.end)", "def length(self) -> npt.NDArray[np...
[ "0.7729525", "0.7558571", "0.75251544", "0.7484685", "0.73882675", "0.7382802", "0.73772055", "0.72371733", "0.7182606", "0.71690214", "0.7164337", "0.6994425", "0.69733137", "0.6971549", "0.6917565", "0.69008744", "0.68922746", "0.6882692", "0.6857539", "0.68091285", "0.6791...
0.69414675
14
Compute where this Earth location was in space on a given date.
def __call__(self, jd): e = self.ephemeris.earth(jd) tpos_au, tvel_au_per_d = self._position_and_velocity(jd) t = Barycentric(e.position.au + tpos_au, e.velocity.au_per_d + tvel_au_per_d, jd) t.geocentric = False # test, then get rid of th...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def night_center(self, date=None):\n sunset = self.sunset(date=date)\n sunrise = self.sunrise(date=sunset)\n center = sunset + timedelta(0, (sunrise - sunset).total_seconds() / 2.0)\n center = self.date_to_local(center)\n return center", "def cal_location(self):\n return...
[ "0.65783864", "0.6370783", "0.595267", "0.5951165", "0.5771055", "0.5768479", "0.574938", "0.5742815", "0.57253826", "0.57253826", "0.57102215", "0.56514406", "0.5648563", "0.5648563", "0.5648563", "0.5648563", "0.5648563", "0.5648563", "0.5648563", "0.5648563", "0.5648563", ...
0.0
-1
Return the apparent position where this will appear in the sky. This method determines how relativity affects an image, and
def apparent(self): jd = self.jd position_au = self.position.au.copy() observer = self.observer if observer.geocentric: include_earth_deflection = array((False,)) else: limb_angle, nadir_angle = compute_limb_angle( position_au, observer.po...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def current_cover_position(self):\n return 50", "def get_pixel_pos(self):\n\n c = self.get_center()\n\n return Tank.three_by_three(c[0],c[1])", "def relative_position(self) -> Tuple[int, int]:\n return self.position[0] - self.region.rect.x, self.position[1] - self.region.rect.y", ...
[ "0.6487075", "0.62500244", "0.6233114", "0.6233114", "0.61285526", "0.6115537", "0.61042124", "0.6068984", "0.6048913", "0.60425776", "0.6040635", "0.60155046", "0.5960999", "0.59450406", "0.5937865", "0.5933687", "0.5894622", "0.58923954", "0.5886457", "0.58405775", "0.58047...
0.5718061
27
Returns the list of field names in this struct definition. The ordering of fields is not preserved.
def get_field_names(self): return self._keys
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _fields_names(cls) -> List:\n return list(field.name for field in dataclasses.fields(cls))", "def field_names(self):\r\n return self._names", "def get_field_names(self):\n return {rv[0] for rv in self.iter_fields()}", "def fieldNames(self):\n return self.__fieldNames", "def ...
[ "0.82878006", "0.81597227", "0.8044491", "0.80375636", "0.80013037", "0.79365295", "0.7786707", "0.7749508", "0.7742077", "0.7711053", "0.7686051", "0.7650752", "0.7572203", "0.7552599", "0.7489526", "0.7484646", "0.73870504", "0.73498654", "0.7347014", "0.73414904", "0.73322...
0.79053503
6
Returns the target structure definition of this reference.
def target(self): return self._definition
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_definition(self):\n return self.definition", "def definition(self):\n return self._definition", "def definition(self):\n\n return self._definition", "def definition(self):\n\n return self._definition", "def getTarget(self):\n return self._target", "def get_struc...
[ "0.65596825", "0.65205646", "0.63990223", "0.63990223", "0.628636", "0.62558365", "0.62109584", "0.6207814", "0.62034917", "0.61827767", "0.61812204", "0.6143241", "0.6143241", "0.6143241", "0.6143241", "0.61338335", "0.6109766", "0.6099357", "0.6099357", "0.60923666", "0.608...
0.75648546
0
Check if the reference is resolved or not
def check_resolved(self): if self._definition is None: msg = message_factory.get_message( 'vapi.data.structref.not.resolved', self.name) logger.debug(msg) raise CoreException(msg)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_ref_known(self):\r\n \r\n if \"N\" in self.ref:\r\n return False\r\n else:\r\n return True", "def needsResolution (self):\n return self.__unresolvedComponents is not None", "def is_resolved(self) -> bool:\n return self._target_object i...
[ "0.7375877", "0.736655", "0.7351351", "0.71739393", "0.6731276", "0.6697827", "0.6682957", "0.6668092", "0.6590499", "0.64975375", "0.64936054", "0.6445533", "0.64373463", "0.62721056", "0.62599283", "0.6218162", "0.62117434", "0.61839545", "0.6182112", "0.6131597", "0.612894...
0.73201627
3
Apart from the validation checks specified in the validate method of DataDefinition class, this method does some additional checks. Since this is an OptionalValue, validation will succeed if the element value is None. If the element value is not None, validation will fail if element in the OptionalValue does not valida...
def validate(self, value): errors = DataDefinition.validate(self, value) if errors: return errors if value.value is None: # None is a valid value for optional pass elif value.is_set(): errors = self.element_type.validate(value.value) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _validate_on_value(self, value: Any) -> None:\n if not self._is_nullable and value is None:\n msg = \"Non-nullable field cannot have None value\"\n if self._resolve_field_name() is not None:\n msg += f\" (field name = '{self._resolve_field_name()}')\"\n ra...
[ "0.6950646", "0.6625702", "0.64273924", "0.63619816", "0.6338633", "0.6300556", "0.6205431", "0.61945575", "0.6145354", "0.6135071", "0.6128928", "0.6108875", "0.6108875", "0.6081401", "0.6060048", "0.6045035", "0.5995266", "0.59526455", "0.58844376", "0.58036214", "0.5760312...
0.78893626
0
Check if triangle is valid
def validate_triangle(sides: list) -> bool: if 0 in sides: return False if sum(sides[:2]) < sides[2]\ or sum([sides[0], sides[2]]) < sides[1]\ or sum(sides[1:]) < sides[0]: return False return True
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_case_05_not_legal_triangle(self):\n self.__assert_equals_test_case([(4, 6, 11)], 'NotATriangle')", "def test_case_04_legal_triangle(self):\n self.__assert_not_equal_test_case([(4, 4, 8), (4, 5, 8)], 'NotATriangle')", "def is_triangle(a, b, c):\n a, b, c = sorted([a, b, c])\n return...
[ "0.7912915", "0.7763951", "0.737915", "0.7302371", "0.72741616", "0.7211095", "0.71129364", "0.7094147", "0.7047826", "0.70209104", "0.7017687", "0.7011692", "0.6970932", "0.69038194", "0.69032353", "0.6899017", "0.68607736", "0.68443024", "0.6828515", "0.67982316", "0.675844...
0.74625057
2
Check if triangle is scalene
def scalene(sides: list) -> bool: return validate_triangle(sides) and len(set(sides)) == 3
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_scalene_triangle(self):\n self.assertEqual(classify_triangle(4, 5, 6), 'Scalene', '4,5,6 is Scalene')\n self.assertEqual(classify_triangle(6, 5, 4), 'Scalene', '6,5,4 is Scalene')\n self.assertEqual(classify_triangle(5, 4, 6), 'Scalene', '5,4,6 is Scalene')\n self.assertEqual(c...
[ "0.7430481", "0.71175534", "0.6783696", "0.6768329", "0.67533517", "0.6717007", "0.6666302", "0.660217", "0.64858675", "0.64797467", "0.64449716", "0.6442864", "0.64312285", "0.6422197", "0.6403348", "0.63783133", "0.637417", "0.6329534", "0.63118273", "0.6308857", "0.6296189...
0.68361163
2
Write the current epoch summary text to tensorboard.
def write_epoch_summary_text(self): self._write_text_to_tensorboard( tag="MLRun", text=self._generate_epoch_text(), step=self._training_iterations, )
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def write_final_summary_text(self):\n # Log the run's final summary:\n self._write_text_to_tensorboard(\n tag=\"MLRun\",\n text=self._generate_run_end_text(),\n step=(\n self._validation_iterations\n if self._training_iterations == 0\n ...
[ "0.75044054", "0.7380753", "0.7129599", "0.69459665", "0.68921155", "0.68886703", "0.68288", "0.67818093", "0.6717844", "0.66299486", "0.6595157", "0.65778697", "0.65341544", "0.6497247", "0.6341723", "0.62380105", "0.6234283", "0.6216354", "0.6215422", "0.62150705", "0.61993...
0.8697257
0
Write the current epoch weights histograms to tensorboard.
def write_weights_histograms(self): for weight_name, weight in self._weights.items(): self._write_weight_histogram_to_tensorboard( name=f"{self._Sections.WEIGHTS}/{weight_name}", weight=weight, step=self._epochs, )
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _write_weight_histogram_to_tensorboard(\n self, name: str, weight: DLTypes.WeightType, step: int\n ):\n pass", "def _log_weights(self, epoch):\r\n writer = self._get_writer(self._train_run_name)\r\n with context.eager_mode(), \\\r\n writer.as_default(), \\\r\n summary...
[ "0.72961915", "0.7213711", "0.71149606", "0.6782466", "0.6682782", "0.6663308", "0.655283", "0.6541244", "0.63911843", "0.63299906", "0.6316944", "0.6269461", "0.61544704", "0.61517924", "0.60838366", "0.6042814", "0.6025663", "0.6019615", "0.5941379", "0.59316427", "0.591860...
0.77118766
0
Write the current epoch weights statistics to tensorboard.
def write_weights_images(self): for weight_name, weight in self._weights.items(): self._write_weight_image_to_tensorboard( name=f"{self._Sections.WEIGHTS}/{weight_name}", weight=weight, step=self._epochs, )
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def write_weights_statistics(self):\n for statistic, weights in self._weights_statistics.items():\n for weight_name, epoch_values in weights.items():\n self._write_scalar_to_tensorboard(\n name=f\"{self._Sections.WEIGHTS}/{weight_name}:{statistic}\",\n ...
[ "0.787859", "0.72606087", "0.72280467", "0.6903707", "0.6897223", "0.6839694", "0.6806561", "0.6684141", "0.6590282", "0.655129", "0.6471296", "0.6416018", "0.6386048", "0.6347983", "0.62237746", "0.6148527", "0.613548", "0.6128361", "0.6127849", "0.6083681", "0.607638", "0...
0.6604003
8
Write the current epoch weight statistics to tensorboard.
def write_weights_statistics(self): for statistic, weights in self._weights_statistics.items(): for weight_name, epoch_values in weights.items(): self._write_scalar_to_tensorboard( name=f"{self._Sections.WEIGHTS}/{weight_name}:{statistic}", val...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _log_weights(self, epoch):\r\n writer = self._get_writer(self._train_run_name)\r\n with context.eager_mode(), \\\r\n writer.as_default(), \\\r\n summary_ops_v2.always_record_summaries():\r\n for layer in self.model.layers:\r\n for weight in layer.weights:\r\n weight...
[ "0.7187344", "0.71168846", "0.7091846", "0.6841387", "0.68072194", "0.6633424", "0.65917826", "0.6538716", "0.6525023", "0.64637655", "0.64495414", "0.6420451", "0.63753295", "0.63381076", "0.61671674", "0.6118715", "0.60602504", "0.6056762", "0.60536736", "0.59599286", "0.59...
0.7750512
0
Function to calculate the Deviation in Tetrahedrality of the tetrahedra in the Delaunay Construct. A value closer to one signifies that the tetrahedra in question is near to the ideal.
def DevTetra(lengths): AvgL = (sum(lengths) / len(lengths)) T = 0.0 i = 0 while i < 5: j = i + 1 while j < 6: T += (lengths[i] - lengths[j])**2 j = j + 1 i = i + 1 den = (15.0 * (AvgL ** 2)) return round (float(T / den), 4)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def dL_dtheta(self):\r\n dL_dtheta = self.kern.dK_dtheta(self.dL_dKmm, self.Z)\r\n if self.has_uncertain_inputs:\r\n dL_dtheta += self.kern.dpsi0_dtheta(self.dL_dpsi0, self.Z, self.X, self.X_variance)\r\n dL_dtheta += self.kern.dpsi1_dtheta(self.dL_dpsi1, self.Z, self.X, self.X_...
[ "0.6225153", "0.6096269", "0.5933895", "0.5693641", "0.565614", "0.5650925", "0.56074613", "0.55613965", "0.55580056", "0.55461174", "0.55289024", "0.55288535", "0.55012727", "0.5485975", "0.54742515", "0.54128414", "0.5377931", "0.53760487", "0.53584313", "0.5341215", "0.528...
0.6466657
0
Gets body from post's HTML content.
def get_body(post_content): post_body = post_content.find("section", {"id": "postingbody"}) body_attr = {"body": ""} if post_body is not None: # Remove elements with null attributes. post_body_text = ( getattr(element, "text", element) for element in post_body ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_body_text(self):\n if self.body_type != 'HTML':\n return self.body\n\n try:\n soup = bs(self.body, 'html.parser')\n except RuntimeError:\n return self.body\n else:\n return soup.body.text", "def get_body(html_page):\n soup = Beaut...
[ "0.74789244", "0.72175753", "0.721036", "0.70023644", "0.6894915", "0.6888041", "0.6792714", "0.678816", "0.6710232", "0.6594182", "0.6450804", "0.64420563", "0.63576674", "0.63381356", "0.6320232", "0.63156754", "0.62880784", "0.6185732", "0.6172415", "0.617149", "0.6129224"...
0.695642
4
Test if self and `other` are equivalent.
def is_equivalent(self, other, name, logger, tolerance=0.): if not isinstance(other, Vector): logger.debug('other is not a Vector object.') return False for component in ('x', 'y', 'z', 'r', 't'): if not self._check_equivalent(other, name, component, logger, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def equivalent(self, other):\n return id(self) == id(other)", "def same_as(self, other):\n return super().__eq__(other)", "def equals(self, other): # -> bool:\n ...", "def __eq__(self, other):\n return are_equal(self, other)", "def __eq__(self, other):\n return are_equal...
[ "0.8722713", "0.82927567", "0.81840724", "0.8157414", "0.8157414", "0.8113604", "0.8113604", "0.80457914", "0.80290604", "0.79913795", "0.79913795", "0.79829127", "0.7979422", "0.7979422", "0.7979422", "0.79572046", "0.7918132", "0.7914299", "0.7913752", "0.7908362", "0.79035...
0.0
-1
Rotate about the Y axis.
def rotate_about_y(self, deg): if self.x is None: raise AttributeError('rotate_about_y: no X component') if self.z is None: raise AttributeError('rotate_about_y: no Z component') sine = sin(radians(deg)) cosine = cos(radians(deg)) x_new = self.x*cosine...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def rot_y_rad(self):\n return self._rot_y_rad", "def rot_y_deg(self):\n # TODO describe which axis this is\n return math.degrees(self._rot_y_rad)", "def rotate_y(self, angle):\n angle *= np.pi / 180\n return self.transform(np.matrix([[np.cos(angle), 0, np.sin(angle)],\n ...
[ "0.76155317", "0.7610588", "0.74899566", "0.73286587", "0.72751987", "0.72174114", "0.7047361", "0.69927084", "0.68301487", "0.6704588", "0.6681487", "0.6672138", "0.66646034", "0.66298133", "0.6627404", "0.6592389", "0.6592389", "0.6574587", "0.65547645", "0.64312756", "0.64...
0.6990377
8
Returns a 204 response code, for any server id'
def delete_server(self, request, tenant_id, server_id): response_data = delete_server(server_id) request.setResponseCode(response_data[1]) return json.dumps(response_data[0])
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def err_204(e):\n return jsonify(dict(\n errno=0,\n alert=\"Not found.\"\n )), 204", "def create_204_response() -> bytes:\n date = datetime.datetime.now(datetime.timezone.utc).strftime(\"%a, %d %b %Y %H:%M:%S GMT\")\n\n header = \"HTTP/1.1 204 No Content\" + \"\\r\\nDate: \" + d...
[ "0.66891235", "0.6668691", "0.6567677", "0.65348697", "0.6408199", "0.61418235", "0.6119534", "0.59477574", "0.5918536", "0.5828642", "0.5751", "0.57213086", "0.5716951", "0.56241953", "0.55655724", "0.55284053", "0.5526982", "0.5494396", "0.5493324", "0.5480996", "0.54778534...
0.633616
5
Find root of project. Assumes that this is a project that has been created using poetry and therefore has at least a pyproject.toml or poetry.lock file at its root
def _find_root() -> pathlib.Path: cwd = pathlib.Path.cwd() while not ( pathlib.Path(cwd, "pyproject.toml").exists() or pathlib.Path(cwd, "poetry.lock").exists() or pathlib.Path("/") == cwd ): cwd = cwd.parent return cwd
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def project_root() -> Path:\n return PROJECT_ROOT", "def get_project_root() -> Path:\n return Path(__file__).parent.parent", "def get_project_root() -> Path:\n return Path(__file__).parent.parent", "def get_project_root() -> Path:\n return Path(__file__).parent.parent", "def get_project_root() ...
[ "0.7686565", "0.76277137", "0.76277137", "0.76277137", "0.76277137", "0.7612965", "0.7603588", "0.73184943", "0.7252913", "0.7252913", "0.71369594", "0.7086837", "0.70728964", "0.7017162", "0.6989941", "0.69442296", "0.69287175", "0.6901742", "0.68765444", "0.6809213", "0.676...
0.8345094
0
Check whether there is a pyproject.toml file.
def has_pyproject_toml() -> bool: return pathlib.Path(_find_root(), "pyproject.toml").exists()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_use_pep517_rejects_setup_cfg_only(shared_data: TestData) -> None:\n src = shared_data.src.joinpath(\"pep517_setup_cfg_only\")\n req = InstallRequirement(None, None)\n req.source_dir = os.fspath(src) # make req believe it has been unpacked\n with pytest.raises(InstallationError) as e:\n ...
[ "0.63984954", "0.6216204", "0.6052389", "0.60095394", "0.60044986", "0.5944357", "0.5942831", "0.5898408", "0.58765316", "0.5869062", "0.5812681", "0.58080417", "0.58059883", "0.5755952", "0.57454455", "0.5732133", "0.57171494", "0.569891", "0.5687982", "0.56460166", "0.56396...
0.90284526
0
Filter out network attributes not required for a create.
def filter_create_network_attributes(network, context): try_del(network, ['status', 'subnets'])
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def filter_update_network_attributes(network, context):\n try_del(network, ['id', 'status', 'subnets', 'tenant_id'])", "def filter_create_subnet_attributes(subnet, context):\n pass", "def _filterAttr(self, node, skip):\n attr = {}\n for key, val in node.items():\n if not ...
[ "0.6163237", "0.5901298", "0.58773476", "0.57378006", "0.56892425", "0.5660168", "0.56502974", "0.56502974", "0.5562711", "0.55564475", "0.55296284", "0.5469728", "0.543502", "0.5410741", "0.5405205", "0.5397971", "0.534201", "0.53049344", "0.52802825", "0.5275776", "0.525349...
0.7409776
0
Reads the data file using pandas
def read_data(self, filename, predicton=False): try: if predicton is False: resource = self.s3_resource s3_object = resource.Object(self.bucket_name, str(self.training_data_dir) + str(filename)) object_response = s3_object.get() data = ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def read_data(filepath):\n df = pd.read_csv(filepath)\n return df", "def read_data(filepath):\n df = pd.read_csv(filepath)\n return df", "def read_data(filepath):\n df = pd.read_csv(filepath)\n return df", "def read(self):\n \n self.df = pd.read_csv(sel...
[ "0.7775849", "0.7775849", "0.7775849", "0.7660651", "0.74783057", "0.74608845", "0.7337814", "0.7337814", "0.7330669", "0.7330669", "0.7308383", "0.7278815", "0.7278815", "0.7250354", "0.7182797", "0.7178427", "0.71462494", "0.7130737", "0.7116337", "0.71077746", "0.70906895"...
0.0
-1
Function to transform a one channel array to a three channel colored array.
def colorfilter(FilteredMask): FilteredMask3channels=np.stack((FilteredMask,)*3, axis=-1) for i in range(len(FilteredMask)): for j in range(len(FilteredMask[0])): if FilteredMask[i,j]==0: FilteredMask3channels[i,j]=[0,0,0] if FilteredMask[i,j]==1: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def to_green(array):\n result = np.zeros(array.shape)\n\n for row in range(result.shape[0]):\n for pixel in range(result.shape[1]):\n result[row][pixel][1] = array[row][pixel][1]\n\n return result", "def split_3d_array_into_channels(arr):\n return [arr[:, :, i] for...
[ "0.70087004", "0.6901813", "0.68700415", "0.6867", "0.66483223", "0.6638427", "0.6575109", "0.6572835", "0.63465595", "0.61537945", "0.6123368", "0.60442126", "0.5945572", "0.5871841", "0.58643836", "0.5853348", "0.5841215", "0.58404416", "0.58298504", "0.5798143", "0.5788773...
0.6383345
8
Set the text description
def setTextDescription (self, text): self.textDownQLabel.setText(text)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def setTextDescriptionBis (self, text):\n self.textDown2QLabel.setText(text)", "def set_description(self, description):\n self.description = description", "def setSessionDescription(self, text):\n self.textEdit.setHtml(text)", "def set_description(self, description):\r\n self.__de...
[ "0.7965433", "0.7901943", "0.788726", "0.78599024", "0.7815113", "0.78052634", "0.7795672", "0.7744947", "0.7672229", "0.7637109", "0.7625047", "0.7625047", "0.7625047", "0.7625047", "0.7621195", "0.7618171", "0.76074135", "0.7566118", "0.7488722", "0.7488722", "0.7488722", ...
0.8285855
0
Set the text description
def setTextDescriptionBis (self, text): self.textDown2QLabel.setText(text)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def setTextDescription (self, text):\n self.textDownQLabel.setText(text)", "def set_description(self, description):\n self.description = description", "def setSessionDescription(self, text):\n self.textEdit.setHtml(text)", "def set_description(self, description):\r\n self.__descri...
[ "0.8285855", "0.7901943", "0.788726", "0.78599024", "0.7815113", "0.78052634", "0.7795672", "0.7744947", "0.7672229", "0.7637109", "0.7625047", "0.7625047", "0.7625047", "0.7625047", "0.7621195", "0.7618171", "0.76074135", "0.7566118", "0.7488722", "0.7488722", "0.7488722", ...
0.7965433
1
Preprocess the article text (title + body) removing stop words, stemming, transforming in lowercase and return the tokens of the text.
def get_terms(line): stemming = PorterStemmer() stops = set(stopwords.words("english")) ## START CODE line = line.lower() ## Transform in lowercase line = re.sub(r'http\S+', '', line) line = re.sub(r'&amp', '', line) line = re.sub(r'\d+', '', line) line = re.sub(r'\W', ' ', line) l...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def preprocess(self,text):\n return preprocess.get_tokens(text)", "def pre_process(text):\n # replace (,.'\") with ''\n text = text.replace(',', '')\n text = text.replace('.', '')\n text = text.replace(\"'\", '')\n text = text.replace(\"\\\"\", '')\n\n # tokenize into words\n tokens =...
[ "0.768005", "0.76353693", "0.7468833", "0.73928475", "0.73446375", "0.73376334", "0.73189825", "0.72519547", "0.72416055", "0.7239954", "0.7237164", "0.71994245", "0.7174329", "0.7170102", "0.7146017", "0.71389693", "0.71361256", "0.71126467", "0.7009391", "0.70029086", "0.69...
0.0
-1
Return an object of type itk.MattesMutualInformation
def mattes_mutual_information(fixed, moving, bins_count=24, pixels_fraction=None, **kwargs) : pixels_count = 0 if isinstance(fixed, medipy.base.Image) : pixels_count = numpy.prod(fixed.shape) FixedImageType = medipy.itk.itk_image_type(fixed) else : pixels_count = numpy.prod(fixe...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def mutual_information_estimate(self, approx_prob=False):\n \n # this might be not the right approach\n q_n = self.receptor_activity_estimate(approx_prob=approx_prob)\n q_nm = self.receptor_crosstalk_estimate(approx_prob=approx_prob)\n \n # calculate the approximate ...
[ "0.61221486", "0.59710157", "0.5878559", "0.5817122", "0.56093544", "0.55782276", "0.557772", "0.55642015", "0.54815537", "0.548138", "0.54560643", "0.54384774", "0.54259044", "0.54200506", "0.5363332", "0.5362712", "0.5343739", "0.53334254", "0.5333204", "0.5321971", "0.5306...
0.6126368
0
Return an object of type itk.Euler3DTransform. If initialize is True, then the fixed and moving must be medipy.base.Image. The value of moments indicates wether momentsbased or geometrybased initialization is performed.
def euler_3d_transform(initialize=False, fixed=None, moments=True) : transform = itk.Euler3DTransform[itk.D].New() if initialize : fixed_itk = medipy.itk.medipy_image_to_itk_image(fixed, False) #moving_itk = medipy.itk.medipy_image_to_itk_image(moving, False) fixedIndex = fixe...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def affine_transform(initialize=False, fixed=None, moments=True) :\n \n transform = itk.AffineTransform[itk.D, fixed.ndim].New()\n \n if initialize :\n fixed_itk = medipy.itk.medipy_image_to_itk_image(fixed, False)\n #moving_itk = medipy.itk.medipy_image_to_itk_image(moving, False)\n\n ...
[ "0.6390018", "0.55947506", "0.54429406", "0.5408161", "0.53750986", "0.5283284", "0.52396065", "0.5225955", "0.5191156", "0.5174126", "0.5159437", "0.515186", "0.5150101", "0.5064727", "0.5035468", "0.49454072", "0.49423203", "0.49396285", "0.4927384", "0.4886816", "0.4877381...
0.82055116
0
Retrun an object of type itk.RegularStepGradientDescentOptimizer
def rsgd(transform, maximum_step_length=0.2, minimum_step_length=0.001, max_iterations=300, set_relaxation_factor=0.8, scales=None) : optimizer = itk.RegularStepGradientDescentOptimizer.New() optimizer.MinimizeOn() optimizer.SetMaximumStepLength(maximum_step_length) optimizer.SetMinimumStepLength(minimu...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def sgd_optim(config = None, global_step = None):\n learning_rate = config[\"learning_rate\"]\n \n train_step = tf.train.GradientDescentOptimizer(learning_rate)\n #train_step = tf.train.GradientDescentOptimizer(learning_rate)\n return train_step", "def getCnnOptimizerOp(self, global_step):\n ...
[ "0.6662196", "0.6359438", "0.6074853", "0.6012541", "0.6006215", "0.5985591", "0.59345776", "0.5856308", "0.58561736", "0.5848436", "0.57937086", "0.57730895", "0.5747753", "0.5746218", "0.5729249", "0.5722781", "0.571616", "0.57158387", "0.5709391", "0.5706607", "0.56981415"...
0.6224375
2
Initializes a TeekoPlayer object by randomly selecting red or black as its piece color.
def __init__(self): self.my_piece = random.choice(self.pieces) self.opp = self.pieces[0] if self.my_piece == self.pieces[1] else self.pieces[1]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self, color):\n self.id = Piece.PIECE_ID\n self.crowned = False\n self.color = color\n\n Piece.PIECE_ID += 1", "def __init__(self, colour):\n self.colour = colour\n self.name = \"Player\"", "def randomcolour(self):\n r = random.randrange(1, 255)\n ...
[ "0.6459741", "0.6420424", "0.64024836", "0.63747764", "0.62974155", "0.6232123", "0.62234735", "0.6195422", "0.6195422", "0.60699993", "0.6066465", "0.60413754", "0.60352397", "0.6031672", "0.6020379", "0.599743", "0.59968346", "0.59959275", "0.5988636", "0.59838605", "0.5972...
0.6149699
9
Create a random 64bit unsigned long.
def _uniq_id(): return random.getrandbits(64)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _guid64():\n return _base91(random.randint(0, 2**64 - 1))", "def create_default_identifier():\n return random.randint(0, constants.UINT64_MAX)", "def generate_random_num():\n return (long(hexlify(urandom(7)), 16) >> 3) * 2**(-53)", "def gensalt():\n return hexlify(os.urandom(24)).decode()", ...
[ "0.70864767", "0.64895475", "0.6479981", "0.6473861", "0.646384", "0.64530855", "0.62532324", "0.6214184", "0.61601347", "0.61029345", "0.6088484", "0.60285187", "0.60101676", "0.59885985", "0.5974776", "0.5973437", "0.5919605", "0.59121567", "0.58437043", "0.58383954", "0.58...
0.616994
8
Split input_image channels and return only the green channel
def green_channel(input_image): return input_image[:, :, 1]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def split_image_into_channels(image):\n red_channel = image[:, :, 0]\n green_channel = image[:, :, 1]\n blue_channel = image[:, :, 2]\n return red_channel, green_channel, blue_channel", "def green_channel(img):\n\n green = np.zeros(img.shape,dtype=float)\n\n green[:,:,1] = np.copy(img[:,:,1])\n...
[ "0.78634256", "0.7284566", "0.7073703", "0.6762714", "0.6619386", "0.65729517", "0.6550677", "0.6550677", "0.64550775", "0.64519364", "0.6436186", "0.64163595", "0.6353538", "0.6353538", "0.63453937", "0.622314", "0.6195948", "0.61760736", "0.6170904", "0.61632556", "0.606557...
0.8281006
0
Cut off randomly part of the top and bottom of input_image and reshape it to the original dimensions
def top_bottom_cut(input_image): height = input_image.shape[0] width = input_image.shape[1] input_dtype = input_image.dtype top = int(np.random.uniform(.325, .425) * height) bottom = int(np.random.uniform(.075, .175) * height) input_image = input_image[top:-bottom, :] img = Image.fromarray(i...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def random_crop_params(self, img, output_size):\n w, h = img.size\n th, tw = output_size\n if w == tw and h == th:\n return 0, 0, h, w\n\n i = random.randint(0, h - th)\n j = random.randint(0, w - tw) \n return i, j, th, tw", "def crop(img):\n new_shape = m...
[ "0.66582704", "0.6609253", "0.6582989", "0.65746564", "0.6558829", "0.6496972", "0.6394478", "0.63857466", "0.6382927", "0.6363086", "0.63624793", "0.6353855", "0.63457674", "0.6325388", "0.63077796", "0.6299848", "0.62816364", "0.62275195", "0.6227163", "0.62142", "0.6204052...
0.68733716
0
Blur input_image with a Gaussian convolution
def gaussian_blur(input_image, kernel_size=5): blur = cv2.GaussianBlur(input_image, (kernel_size, kernel_size), 0) return blur
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __gaussian_blur(self, img, kernel_size=3):\n return cv2.GaussianBlur(img, (kernel_size, kernel_size), 0)", "def blurImage1(in_image: np.ndarray, kernel_size: np.ndarray) -> np.ndarray:\r\n size = kernel_size[0]\r\n sigma = 1\r\n x, y = np.mgrid[-size:size + 1, -size:size + 1]\r\n normal = ...
[ "0.8089824", "0.79220146", "0.7907814", "0.78579783", "0.78252", "0.78252", "0.78252", "0.78252", "0.78252", "0.78252", "0.78252", "0.78252", "0.78252", "0.78252", "0.78252", "0.78252", "0.78252", "0.78252", "0.78252", "0.7788145", "0.7707945", "0.77043325", "0.7691285", ...
0.77550554
20
Creates a string representation of minutes and seconds from the given time.
def get_time_string(time): mins = time // 60 secs = time % 60 time_string = '' if mins < 10: time_string += ' ' elif mins < 100: time_string += ' ' time_string += '%dm ' % mins if secs < 10: time_string += ' ' time_string += '%ds' % secs ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def format_time(self, time):\n hours = time // 3600\n time = time - hours*3600\n minutes = time // 60\n seconds = time - minutes*60\n return ('%d:%d:%d' %(hours, minutes, seconds))", "def time_string(minutes):\n \n if minutes < 60:\n return \"{} minute{}\".format(m...
[ "0.75801", "0.7148438", "0.71150726", "0.7083532", "0.70771515", "0.7058532", "0.7001111", "0.6904223", "0.68835086", "0.6838333", "0.6832209", "0.6824194", "0.678623", "0.6782694", "0.6713535", "0.6703341", "0.6687926", "0.66826063", "0.6668589", "0.6667183", "0.6659665", ...
0.78954464
0
Join a group in which you are not a member.
def group_join( *, group_id: uuid.UUID, identity: Optional[ParsedIdentity], request: bool, login_manager: LoginManager, ): auth_client = login_manager.get_auth_client() groups_client = login_manager.get_groups_client() action = "request_join" if request else "join" if identity: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_to_group(self, group):\n\n if not self.in_group(group):\n self.secondary_groups.append(group)\n return self", "async def join(self, gid):\n\t\tif self.group != None:\n\t\t\tif self.group.gid == gid:\n\t\t\t\traise exceptions.ClientError('IN_GROUP')\n\n\t\tif gid a...
[ "0.6366197", "0.63007146", "0.6231125", "0.61739105", "0.61373067", "0.61092645", "0.59598553", "0.59439266", "0.5920629", "0.5877869", "0.5869052", "0.5794663", "0.576797", "0.57455814", "0.57422316", "0.5741413", "0.569075", "0.5616445", "0.5600026", "0.55784506", "0.557164...
0.5644763
17
Construct a DataLoader instance
def __init__(self, id_prefix='', header_file=None): self.id_prefix = id_prefix
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def to_DataLoader(self, **kwargs):\r\n return DataLoader(self, **kwargs)", "def __init__(self, **kwargs):\n DataLoader.__init__(self, **kwargs)", "def __init__(self, **kwargs):\n DataLoader.__init__(self, **kwargs)\n \n self._results_ = None", "def _create_data_loader(self,...
[ "0.8182849", "0.7986711", "0.76008606", "0.75618577", "0.74605215", "0.74464846", "0.74454254", "0.74234617", "0.73894024", "0.731747", "0.7315038", "0.7259584", "0.7220424", "0.7215782", "0.716769", "0.7136377", "0.70992565", "0.70815575", "0.70655906", "0.70523274", "0.7041...
0.0
-1
Add BERT tokens, attention masks and padding of the input text to sample.
def add_tokens(self, sample): # Text inputs = self._tokenizer.encode_plus(sample['text'], add_special_tokens=True, max_length=self._max_text_length, padding='max_length', # TODO padding here or in model (together with item_glove)? truncatio...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_text_and_mention(self, sample):\n inputs = self._tokenizer.encode_plus(\n text = sample['text'], # text\n text_pair = sample['item_name'], # mention\n add_special_tokens=True,\n max_length=self._max_text_length,\n padding='ma...
[ "0.70163286", "0.6117736", "0.6046797", "0.5811368", "0.57960486", "0.57605207", "0.5606701", "0.5562219", "0.5516331", "0.5497761", "0.54812765", "0.54549044", "0.5452276", "0.5440272", "0.54381686", "0.54370797", "0.54187596", "0.5395939", "0.53944826", "0.5384646", "0.5360...
0.7249845
0
Return all elements (if any) in the List after the given value. Raises ValueError if multiple matches are found.
def after(self, value: Any) -> List: matches = self._slice_helper(value, multiple_matches_forbidden=True) return type(self.parent)() if not matches else type(self.parent)(self.parent[matches[0]+1:])
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def after_first(self, value: Any) -> List:\n matches = self._slice_helper(value, multiple_matches_forbidden=False)\n return type(self.parent)() if not matches else type(self.parent)(self.parent[matches[0]+1:])", "def following(lst, content):\n if content not in lst:\n return lst\n i = ...
[ "0.6628517", "0.6498769", "0.64955515", "0.632073", "0.6288756", "0.62235457", "0.61650926", "0.58965576", "0.58473283", "0.5644072", "0.5584421", "0.55153906", "0.5439314", "0.537073", "0.5294268", "0.5263151", "0.52019984", "0.5114767", "0.5104634", "0.508398", "0.5001553",...
0.6662767
0
Return all elements (if any) in the List after the first instance of the given value.
def after_first(self, value: Any) -> List: matches = self._slice_helper(value, multiple_matches_forbidden=False) return type(self.parent)() if not matches else type(self.parent)(self.parent[matches[0]+1:])
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def until_first(self, value: Any) -> List:\n matches = self._slice_helper(value, multiple_matches_forbidden=False)\n return type(self.parent)() if not matches else type(self.parent)(self.parent[:matches[0]+1])", "def until(self, value: Any) -> List:\n matches = self._slice_helper(value, mult...
[ "0.71894765", "0.69087934", "0.68971527", "0.6862926", "0.6801699", "0.6733945", "0.64581436", "0.6382424", "0.6287358", "0.6282072", "0.61528593", "0.6034938", "0.60243404", "0.59773815", "0.59578544", "0.5947204", "0.5894391", "0.5863618", "0.5799248", "0.57785404", "0.5735...
0.7423569
0
Return all elements (if any) in the List until the given value, including itself. Raises ValueError if multiple matches are found.
def until(self, value: Any) -> List: matches = self._slice_helper(value, multiple_matches_forbidden=True) return type(self.parent)() if not matches else type(self.parent)(self.parent[:matches[0]+1])
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def until_first(self, value: Any) -> List:\n matches = self._slice_helper(value, multiple_matches_forbidden=False)\n return type(self.parent)() if not matches else type(self.parent)(self.parent[:matches[0]+1])", "def until_last(self, value: Any) -> List:\n matches = self._slice_helper(value,...
[ "0.71134514", "0.63509667", "0.6172609", "0.58191687", "0.5671673", "0.56686366", "0.5563154", "0.55431", "0.553699", "0.5485952", "0.54493546", "0.5428286", "0.5377651", "0.5370145", "0.5365954", "0.53459316", "0.52811795", "0.52800894", "0.5237043", "0.52339774", "0.5225725...
0.7537045
0
Return all elements (if any) in the List until the first instance of the given value (including itself).
def until_first(self, value: Any) -> List: matches = self._slice_helper(value, multiple_matches_forbidden=False) return type(self.parent)() if not matches else type(self.parent)(self.parent[:matches[0]+1])
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def until(self, value: Any) -> List:\n matches = self._slice_helper(value, multiple_matches_forbidden=True)\n return type(self.parent)() if not matches else type(self.parent)(self.parent[:matches[0]+1])", "def after_first(self, value: Any) -> List:\n matches = self._slice_helper(value, multi...
[ "0.7503036", "0.6682409", "0.65420246", "0.6454493", "0.62613744", "0.62120116", "0.61201507", "0.6069243", "0.6051372", "0.5902285", "0.58878857", "0.5882214", "0.5865108", "0.5856516", "0.5723749", "0.5709245", "0.5685299", "0.56652063", "0.5643091", "0.5635964", "0.5607801...
0.771976
0
Same as list.append(), but returns self and thus allows chaining.
def append(self, item: Any) -> BaseList: super().append(item) return self
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def append(self, *args):\n return _libsbml.ListOf_append(self, *args)", "def append(self, value):\n self.__list += [value]\n return self.__list", "def append(self, this):\n return self.add(this)", "def appendFrom(self, *args):\n return _libsbml.ListOf_appendFrom(self, *args...
[ "0.7793487", "0.7477305", "0.72566026", "0.7142567", "0.6872121", "0.67923886", "0.67827463", "0.67686456", "0.6729563", "0.6714961", "0.6632728", "0.66069674", "0.6594593", "0.65648603", "0.6553785", "0.65537816", "0.64927447", "0.6472972", "0.6459722", "0.6456689", "0.64079...
0.7555611
1
Same as list.extend(), but returns self and thus allows chaining.
def extend(self, item: Any) -> BaseList: super().extend(item) return self
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def listExtend(lst, items):\n if lst is None:\n return list(items)\n else:\n lst.extend(items)\n return lst", "def extend(self, items):\n # type: (Iterable[Any]) -> None\n return list.extend(self, self._refs(items))", "def extend(self, items):\n\t\tfor item in items:\n\t\t\...
[ "0.74607843", "0.7273891", "0.7092229", "0.70536894", "0.70169026", "0.69401026", "0.68390185", "0.6815908", "0.6694044", "0.66721934", "0.6619608", "0.6593652", "0.6578073", "0.6561644", "0.65457165", "0.6541929", "0.64328", "0.64272773", "0.64108014", "0.64085793", "0.63429...
0.7836899
0
Same as list.insert(), but returns self and thus allows chaining.
def insert(self, index: int, item: Any) -> BaseList: super().insert(index, item) return self
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def insert(self, *args):\n return _libsbml.ListOf_insert(self, *args)", "def insert(self, index, item):\n # type: (int, Any) -> None\n return list.insert(self, index, self.ref(item))", "def insert(self, *a):\r\n return self.stack.insert(*a)", "def insert(self, index, value):\n ...
[ "0.7182341", "0.7056873", "0.6722274", "0.666025", "0.65120107", "0.6464783", "0.643192", "0.6425117", "0.6408613", "0.63987815", "0.6346241", "0.63191396", "0.62735695", "0.62469363", "0.6181347", "0.61659217", "0.6154132", "0.61498445", "0.61323017", "0.61244565", "0.607926...
0.73483765
0