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
Tokenize characters in smiles to integers
def smiles_to_seq(self, smiles): smiles_len = len(smiles) seq = [0] keys = self.char_dict.keys() i = 0 while i < smiles_len: # Skip all spaces if smiles[i:i + 1] == ' ': i = i + 1 # For 'Cl', 'Br', etc. elif smiles[i:i + 2] in keys: seq.append(self.char_dict[s...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def tokenize(s):\n return split_words(replace_numbers(r' \\1 ', s))", "def _basic_tokenizer(line,normalize_digits=False): \r\n _DIGIT_RE = re.compile(r\"\\d+\") ## find digits \r\n \r\n words = []\r\n tokens = list(jieba.cut(line.strip().lower()))\r\n if normalize_digits:\r\n for tok...
[ "0.61190283", "0.6033673", "0.5904087", "0.58450264", "0.58429366", "0.58330625", "0.57852733", "0.5714979", "0.57129794", "0.5698022", "0.56933874", "0.5686359", "0.5679133", "0.5671616", "0.56612736", "0.5652623", "0.5607286", "0.55938447", "0.5568788", "0.5545565", "0.5540...
0.51383936
93
Split into multiple small array, each of them have `size` elements, except the last one
def split_by_size(array: Iterable[T], size: int) -> Iterable[List[T]]: chunk = [] for e in array: chunk.append(e) if len(chunk) == size: yield chunk chunk = [] if len(chunk) > 0: yield chunk
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def split_array(array, size):\n arrays = []\n while len(array) > size:\n pice = array[:size]\n arrays.append(pice)\n array = array[size:]\n arrays.append(array)\n return arrays", "async def split_list(arr, size=100):\n\n arrs = []\n\n while len(arr) > size:\n ...
[ "0.77473474", "0.74481887", "0.74357074", "0.734155", "0.6925974", "0.6919109", "0.6903625", "0.6888142", "0.68084294", "0.6806716", "0.6781167", "0.67339826", "0.67309153", "0.66950613", "0.6665813", "0.66406906", "0.66233885", "0.66089714", "0.655217", "0.65496635", "0.6517...
0.76630163
1
Get content of this wrapper
def get_value(self) -> Union[Iterable[T], List[T]]: return self.array
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_content(self):\n return self.content", "def content (self):\n return self.__content", "def get_contents(self):\n return self.contents", "def content(self):\n return self._content", "def content(self):\n return self._content", "def content(self):\n return ...
[ "0.850132", "0.81951433", "0.8136741", "0.8118551", "0.8118551", "0.8118551", "0.8118551", "0.8115479", "0.8071315", "0.7896508", "0.7874863", "0.7728276", "0.7709806", "0.77057123", "0.7698179", "0.7671481", "0.7671481", "0.7671481", "0.7596609", "0.7558301", "0.746939", "...
0.0
-1
Return new array that every item is result of func
def map(self, func: Callable[[T], V]) -> 'List[V]': return [func(v) for v in self.array]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _listarr(self, func):\n return [func(self.ptr, i) for i in range(len(self))]", "def map(self, func):\n return List(map(func, self))", "def oper_array(fct, arr, init):\n result = []\n for i, item in enumerate(arr):\n result.append(fct(result[i-1] if result else init, item))\n r...
[ "0.7046186", "0.6664048", "0.64633167", "0.6424108", "0.6361219", "0.6230683", "0.6144653", "0.6102472", "0.6059488", "0.6054769", "0.6025662", "0.597819", "0.58929294", "0.5881807", "0.5856998", "0.58393294", "0.58230454", "0.5812086", "0.58107144", "0.57919014", "0.5783789"...
0.7358695
0
Join all elements of a list/iterable separated by delimiter. Elements are autoconverted to string by via str function
def join(self, delimiter: str) -> str: return delimiter.join((str(x) for x in self.array))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def join(self, iterable) -> String:\n pass", "def join_list(items: Iterable[str]) -> str:\n\n return ITEM_SEPARATOR.join(items)", "def _convertListToString(self, list_of_objects):\n return (';').join(list_of_objects)", "def list_join(the_list):\n return ' '.join(the_list)", "def join(sep, xs):\...
[ "0.77321285", "0.7724553", "0.7301904", "0.72402406", "0.7220645", "0.71383774", "0.7110151", "0.7064598", "0.69973946", "0.6995412", "0.6994151", "0.69156146", "0.6834919", "0.6825805", "0.6805006", "0.67962915", "0.67852664", "0.67824876", "0.6755309", "0.6722159", "0.66973...
0.74802405
2
Return if a given voltage is above the configured threshold for the high/on/rising voltage for this fixture.
def is_voltage_above_on_threshold(self, voltage: float) -> bool: bk_target_voltage_threshold_rising = self.get_arg_covariant(self.fixture_arguments, 'target_voltage_threshold_rising', ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_voltage_below_off_threshold(self, voltage: float) -> bool:\n falling_threshold_voltage = self.get_arg_covariant(self.fixture_arguments,\n 'target_voltage_threshold_falling',\n 0)\n ...
[ "0.77306426", "0.68501085", "0.68012923", "0.6616971", "0.6317906", "0.62629694", "0.62177557", "0.6198737", "0.6175452", "0.60803443", "0.6029836", "0.60143626", "0.6010803", "0.6010803", "0.6010803", "0.595671", "0.5950449", "0.5949048", "0.59235835", "0.5914401", "0.585031...
0.8581661
0
Return if a given voltage is below the configured threshold for the low/off/falling voltage for this fixture.
def is_voltage_below_off_threshold(self, voltage: float) -> bool: falling_threshold_voltage = self.get_arg_covariant(self.fixture_arguments, 'target_voltage_threshold_falling', 0) return...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_voltage_above_on_threshold(self, voltage: float) -> bool:\n bk_target_voltage_threshold_rising = self.get_arg_covariant(self.fixture_arguments,\n 'target_voltage_threshold_rising',\n ...
[ "0.8299032", "0.7133236", "0.69201803", "0.65442", "0.64816636", "0.6253797", "0.6249845", "0.61251426", "0.60882974", "0.6076998", "0.6065308", "0.6021714", "0.5969996", "0.5940183", "0.58787537", "0.5872486", "0.5868808", "0.5825154", "0.58058536", "0.5803932", "0.5803932",...
0.8018871
1
Connects to the mongoDB. Pass through the password, returns the db
def mongo_connect( password, user='RCD2021', dbname='myFirstDatabase' ): client = pymongo.MongoClient(f"mongodb+srv://{user}:{password}\ @cluster0.z3tac.mongodb.net/{dbname}?retryWrites=true&w=majority") db = client.test return db
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def connect_mongo_db():\n host = parsed_mongodb_url['host']\n port = parsed_mongodb_url['port']\n database = parsed_mongodb_url['database']\n username = parsed_mongodb_url['username']\n password = parsed_mongodb_url['password']\n\n connection = Connection(host, port)\n\n if username and passwo...
[ "0.881511", "0.81782997", "0.8147984", "0.80809915", "0.796008", "0.7956284", "0.7940631", "0.79266685", "0.79010135", "0.78500664", "0.78465617", "0.777564", "0.7739609", "0.77123797", "0.7608925", "0.7596632", "0.75803083", "0.7548107", "0.7474176", "0.74546975", "0.7437807...
0.8553886
1
Get user by id
async def get_user(id: int): service = SearchService() return await service.get_user(id)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_user_by_id(self, id):\n\t\treturn self.users.get(id)", "def get_user(id):\n pass", "def get(id):\n return User.query.filter_by(id=id).first()", "def getUser(self, id : int) -> bbUser.bbUser:\n id = self.validateID(id)\n return self.users[id]", "def get_single_user(self, id):...
[ "0.8873811", "0.88707125", "0.87658477", "0.8525675", "0.85058427", "0.84312195", "0.84294516", "0.8414046", "0.84003544", "0.839886", "0.83409226", "0.826507", "0.82554895", "0.8248595", "0.8222798", "0.8222798", "0.8222798", "0.8222798", "0.8204112", "0.8201288", "0.8189301...
0.8265451
11
Fetch the configuration key.
def __getitem__(self, key): if hasattr(self, key): return getattr(self, key) else: raise KeyError('No such option `{}`.'.format(key))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getKey( self, key ):\n if key in self.conf:\n return self.conf[key]\n else:\n return None", "def get(self, key):\n return self.config.get(key)", "def get_config(self, key):\n return self.data[key]", "def getconfig(self, key):\n return self.config[k...
[ "0.7470462", "0.74067944", "0.73321396", "0.72304887", "0.7209066", "0.7139708", "0.6973374", "0.6915105", "0.68978006", "0.67694426", "0.67246675", "0.67217326", "0.6676926", "0.66233563", "0.66131926", "0.66079587", "0.6604322", "0.6596047", "0.65746206", "0.656907", "0.656...
0.0
-1
Test the ``validate_inputs`` validator for invalid scale inputs.
def test_validate_inputs_scale(ctx, generate_eos_inputs): base_values = generate_eos_inputs() value = copy.deepcopy(base_values) assert eos.validate_inputs( value, ctx ) == 'neither `scale_factors` nor the pair of `scale_count` and `scale_increment` were defined.' value = copy.deepcopy(bas...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_validate_beta_scale():\n assert validate_beta_scale(1 / 9) == 1 / 9\n\n with pytest.raises(ValueError):\n validate_beta_scale(-1)\n\n assert validate_beta_scale(1) == 1", "def test_to_scaler_non_allowed_value_error(self):\n\n with pytest.raises(\n ValueError,\n ...
[ "0.6876793", "0.67950356", "0.6627188", "0.66158503", "0.6501047", "0.6475344", "0.6461625", "0.64342606", "0.64093435", "0.64026356", "0.6369724", "0.6360621", "0.632549", "0.631703", "0.6307841", "0.6277771", "0.6217689", "0.61729026", "0.61707366", "0.61656445", "0.6140699...
0.7242582
0
Test the `validate_scale_count` validator.
def test_validate_scale_count(ctx): assert eos.validate_scale_count(None, ctx) is None assert eos.validate_scale_count(orm.Int(3), ctx) is None assert eos.validate_scale_count(orm.Int(2), ctx) == 'need at least 3 scaling factors.'
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_validate_scale_factors(ctx):\n assert eos.validate_scale_factors(None, ctx) is None\n assert eos.validate_scale_factors(orm.List(list=[0.98, 1, 1.02]), ctx) is None\n assert eos.validate_scale_factors(orm.List(list=[0, 1]), ctx) == 'need at least 3 scaling factors.'", "def test_validate_scale_i...
[ "0.6806991", "0.67012596", "0.6590901", "0.62809515", "0.6266783", "0.619833", "0.6106783", "0.60532546", "0.6020951", "0.5985356", "0.5946034", "0.59089077", "0.5900792", "0.57455856", "0.5741947", "0.57395303", "0.5707025", "0.56487167", "0.5639003", "0.5581505", "0.557721"...
0.85366595
0
Determines if two instances are equal.
def __eq__(self, other) -> bool: return str(self) == str(other)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __eq__(self, other):\n return self is other", "def __eq__(self, other):\n return self is other", "def __eq__(self, other):\n if not isinstance(other, InstanceCreate):\n return False\n\n return self.__dict__ == other.__dict__", "def __eq__(self, other):\n retu...
[ "0.7959046", "0.7959046", "0.7943258", "0.7920624", "0.7920624", "0.7918186", "0.7911599", "0.7911599", "0.7911599", "0.7893859", "0.7889761", "0.7881151", "0.7878904", "0.7856153", "0.78183234", "0.77922845", "0.77922845", "0.77922845", "0.77922845", "0.77922845", "0.7792284...
0.0
-1
Determines if the instance is less than the other.
def __lt__(self, other) -> bool: return str(self) < str(other)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __lt__(self, other):\n return self.get_distance() < other.get_distance()", "def __lt__(self, other):\n return self.lessThan(other)", "def __lt__(self, other):\n\n # seems like this should be == -1 but we're using a min heap\n return self._comparator.compare_measurements(self, ot...
[ "0.8345154", "0.8313539", "0.8281034", "0.825368", "0.8180172", "0.8099745", "0.8099745", "0.80957335", "0.80957335", "0.805858", "0.80491775", "0.8034751", "0.8020018", "0.8003331", "0.79533756", "0.79466254", "0.791329", "0.79058963", "0.7883819", "0.7873136", "0.78686035",...
0.0
-1
The raw label key as defined in the ProblemStatement.
def raw_label_key(self) -> str: # TODO(nikhilmehta): Change the task object to allow label_key to be a list. task_type = self._problem_statement.tasks[0].type if task_type.HasField('multi_class_classification'): return task_type.multi_class_classification.label if task_type.HasField('binary_class...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def transformed_label_key(self) -> str:\n\n return self.raw_label_key", "def get_label(self, key):\n return self.labels.get(key, None)", "def label(self) -> str:\n return self.keysym.label", "def label(self) -> str:\n return self[\"label\"]", "def get_label(self):\n return se...
[ "0.76852953", "0.68692154", "0.6830917", "0.6780623", "0.67738575", "0.67221177", "0.66975427", "0.6637066", "0.65952593", "0.65860814", "0.65860814", "0.6568156", "0.6568156", "0.6568156", "0.6568156", "0.6568156", "0.6568156", "0.6568156", "0.6568156", "0.6568156", "0.65681...
0.8213031
0
The label key after applying TensorFlow Transform to the Examples.
def transformed_label_key(self) -> str: return self.raw_label_key
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def raw_label_key(self) -> str:\n\n # TODO(nikhilmehta): Change the task object to allow label_key to be a list.\n task_type = self._problem_statement.tasks[0].type\n if task_type.HasField('multi_class_classification'):\n return task_type.multi_class_classification.label\n if task_type.HasField('b...
[ "0.6945242", "0.6294156", "0.62779814", "0.62649274", "0.62220025", "0.6199699", "0.6159763", "0.6103938", "0.6097182", "0.6079141", "0.60770434", "0.60770434", "0.60770434", "0.60770434", "0.6056869", "0.6054666", "0.6054666", "0.6030054", "0.60116947", "0.59944475", "0.5987...
0.7389862
0
Returns the Estimator Head for this task.
def head(self) -> tf.estimator.Head: task_type = self._problem_statement.tasks[0].type if task_type.HasField('one_dimensional_regression'): return tf.estimator.RegressionHead() num_classes = ( self._tf_transform_output.num_buckets_for_transformed_feature( self.raw_label_key)) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def head(self) -> TaskHead:\n return self._model.head", "def estimated_heading(self):\n return self._estimates[2].item(0)", "def get_heading(self):\n return self.__heading", "def get_heading(self):\n return self.__heading", "def head(self):\n if not RerankingParser._parse...
[ "0.7851193", "0.6761012", "0.6378977", "0.6378977", "0.6303703", "0.629308", "0.62548715", "0.6229577", "0.61900723", "0.61486423", "0.61486423", "0.6031511", "0.59659743", "0.58921", "0.5837884", "0.57720685", "0.5698001", "0.56032324", "0.5598741", "0.5590286", "0.5586843",...
0.8017886
0
Returns the list of sparse FeatureColumns to be fed into the model.
def get_sparse_feature_columns(self) -> List[FeatureColumn]: return self._get_numeric_feature_columns( ) + self._get_sparse_categorical_feature_columns()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def sparse_col(self):\n if not self.col_name_mapping or \"sparse_col\" not in self.col_name_mapping:\n return EmptyFeature\n return Feature(\n name=list(self.col_name_mapping[\"sparse_col\"].keys()),\n index=list(self.col_name_mapping[\"sparse_col\"].values()),\n ...
[ "0.7777502", "0.76273423", "0.7262173", "0.700719", "0.6915634", "0.6808054", "0.6639383", "0.63721895", "0.6323643", "0.6264074", "0.62528586", "0.6196295", "0.61387503", "0.6127688", "0.6124196", "0.6112903", "0.6110041", "0.60970175", "0.609062", "0.60681653", "0.60466367"...
0.89280576
0
Get queryset with custom annotations.
def get_queryset(self): base_query_set = super(PeeringSessionManager, self).get_queryset() query_set = base_query_set.annotate( session_state=models.Case( models.When(provisioning_state=2, then=models.Case( models.When(admin_state=2, then=models.Case( ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def annotate(self, **annotations):\n return AnnotatedQuery(self, annotations)", "def overview(cls, queryset, *annotations):\n if select_related := cls.select_related:\n queryset = queryset.select_related(*select_related)\n if prefetch_related := cls.prefetch_related:\n ...
[ "0.7111231", "0.66121894", "0.65157735", "0.6412332", "0.6352211", "0.6352211", "0.6288018", "0.61499923", "0.61052215", "0.6100128", "0.6094886", "0.6090788", "0.5880232", "0.5714176", "0.5704589", "0.56150657", "0.5571465", "0.5568022", "0.5554091", "0.55057067", "0.5482574...
0.0
-1
Get queryset with custom annotations.
def get_queryset(self): query_set = super(InternetExchangeProxyManager, self).get_queryset() return query_set.annotate( participants=models.Count('ixlan_set__netixlan_set__asn', distinct=True), )
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def annotate(self, **annotations):\n return AnnotatedQuery(self, annotations)", "def overview(cls, queryset, *annotations):\n if select_related := cls.select_related:\n queryset = queryset.select_related(*select_related)\n if prefetch_related := cls.prefetch_related:\n ...
[ "0.7111231", "0.66121894", "0.65157735", "0.6412332", "0.6352211", "0.6352211", "0.6288018", "0.61499923", "0.61052215", "0.6100128", "0.6094886", "0.6090788", "0.5880232", "0.5714176", "0.5704589", "0.56150657", "0.5571465", "0.5568022", "0.5554091", "0.55057067", "0.5482574...
0.0
-1
Get queryset with custom annotations.
def get_queryset(self): query_set = super(NetworkProxyManager, self).get_queryset() return query_set
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def annotate(self, **annotations):\n return AnnotatedQuery(self, annotations)", "def overview(cls, queryset, *annotations):\n if select_related := cls.select_related:\n queryset = queryset.select_related(*select_related)\n if prefetch_related := cls.prefetch_related:\n ...
[ "0.71102184", "0.6611364", "0.6515494", "0.641225", "0.6352882", "0.6352882", "0.62888086", "0.615031", "0.6106056", "0.60995924", "0.60955495", "0.60911536", "0.58799887", "0.5713939", "0.57053864", "0.56150967", "0.55709636", "0.55690503", "0.55554366", "0.5506568", "0.5482...
0.0
-1
Configure the platform and add the sensors.
async def async_setup_platform( hass, config, async_add_entities, discovery_info=None): name = config.get(CONF_NAME) latitude = config.get(CONF_LATITUDE, hass.config.latitude) longitude = config.get(CONF_LONGITUDE, hass.config.longitude) language = config.get(CONF_LANGUAGE) _LOGGER.debug("U...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def setup_sensors(self, configs):\n self.__sensors = self.setup_components(configs, 'scale_client.sensors')", "def setup_platform(hass, config, add_sensors_callback, discovery_info=None):\n\n flo = hass.data[FLO_SERVICE]\n if flo is None or not flo.is_connected:\n LOG.warning(\"No connection ...
[ "0.748485", "0.7239416", "0.7238486", "0.7237859", "0.710073", "0.6981587", "0.69638777", "0.6957731", "0.6949644", "0.69455737", "0.6945002", "0.6940697", "0.6871586", "0.6851643", "0.6828366", "0.6806935", "0.678929", "0.6771974", "0.67604375", "0.6748191", "0.673941", "0...
0.6424368
53
Return the device state attributes.
def device_state_attributes(self): if self.airly.data_available: if self.type == ATTR_CAQI_DESCRIPTION: self._attrs[ATTR_CAQI_ADVICE] = (self.airly.data [ATTR_CAQI_ADVICE]) if self.type == ATTR_CAQI: self._attrs[ATTR_CAQI_LEVEL] = s...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def device_state_attributes(self):\r\n return self.attributes", "def device_state_attributes(self):\r\n return self._attributes", "def device_state_attributes(self):\n return self._attrs", "def device_state_attributes(self):\n return self.attr", "def device_state_attributes(self...
[ "0.93173087", "0.9245708", "0.92207897", "0.92147964", "0.92147964", "0.9210798", "0.9210798", "0.91909975", "0.91909975", "0.91909975", "0.91909975", "0.91909975", "0.91909975", "0.91909975", "0.91909975", "0.91909975", "0.91909975", "0.91909975", "0.91909975", "0.91909975", ...
0.78787047
76
Return a unique_id for this entity.
def unique_id(self): return '{}-{}-{}'.format(self.airly.latitude, self.airly.longitude, self.type)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def unique_id(self):\n return self._id", "def unique_id(self):\n return self._id", "def unique_id(self):\n return self._uuid", "def unique_id(self):\n return self._uuid", "def unique_id(self) -> str:\n return self._unique_id", "def unique_id(self) -> str:\n retur...
[ "0.8326303", "0.8326303", "0.8272535", "0.8272535", "0.82369304", "0.82369304", "0.82369304", "0.82369304", "0.82369304", "0.82369304", "0.82369304", "0.82369304", "0.82107615", "0.82107615", "0.82107615", "0.82107615", "0.82107615", "0.82107615", "0.82107615", "0.82107615", ...
0.0
-1
Gets a list of projects accessible to the user.
def get_projects(self): response = self.request(verb=requests.get, address="projects") # FIXME: if no results, must we raise an exception? return response["results"] if "results" in response else response
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_accessible_projects(user):\n query = Q(deprecated_files=False)\n\n query &= get_public_projects_query()\n\n if user.is_authenticated:\n query |= get_restricted_projects_query(user)\n\n if user.is_credentialed:\n query |= get_credentialed_projects_query(user)\n\n query |= get_pr...
[ "0.81165284", "0.78454465", "0.77744263", "0.7611985", "0.7599327", "0.7597037", "0.75431144", "0.75133187", "0.74744916", "0.74576074", "0.7445283", "0.7421303", "0.74208295", "0.7405858", "0.7377553", "0.7354221", "0.73310965", "0.72823554", "0.7277075", "0.7198156", "0.719...
0.7552719
6
Makes a request to the Brandwatch API.
def request(self, verb, address, params=None, data=None): return BWUser.bare_request(verb=verb, address_root=self.api_url, address_suffix=address, access_token=self.token, params=params or dict(), ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_get_model_breach(requests_mock):\n from DarktraceMBs import Client, get_model_breach_command\n\n # GIVEN an integration is configured to Darktrace\n mock_api_response = util_load_json('test_data/get_breach.json')\n requests_mock.get('https://mock.darktrace.com/modelbreaches?pbid=95',\n ...
[ "0.54784626", "0.54199266", "0.54009145", "0.5381244", "0.5372688", "0.5324735", "0.52948314", "0.5253", "0.52312446", "0.51644444", "0.5138369", "0.512951", "0.51141256", "0.5103499", "0.5103499", "0.5103452", "0.50867605", "0.5060832", "0.5053627", "0.5030785", "0.5025953",...
0.49498695
32
Makes a request to the Brandwatch API.
def bare_request(verb, address_root, address_suffix, access_token="", params=None, data=None): params = params or dict() data = data or dict() url = "%s%s" % (address_root, address_suffix) if access_token: params["access_token"] = access_token t...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_get_model_breach(requests_mock):\n from DarktraceMBs import Client, get_model_breach_command\n\n # GIVEN an integration is configured to Darktrace\n mock_api_response = util_load_json('test_data/get_breach.json')\n requests_mock.get('https://mock.darktrace.com/modelbreaches?pbid=95',\n ...
[ "0.5475603", "0.5401603", "0.53826493", "0.53758925", "0.53254837", "0.52993226", "0.5254074", "0.5232981", "0.5163139", "0.51408297", "0.51310325", "0.5114292", "0.5106049", "0.5106049", "0.5103286", "0.50890124", "0.5061842", "0.50531536", "0.50317085", "0.5025219", "0.5023...
0.5420072
1
Makes a project level PUT request
def put(self, endpoint, params=None, data=None): params = params or dict() data = data or dict() return self.request(verb=requests.put, address=self.project_address + endpoint, params=params, data=data)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _put(self, *args, **kwargs):\n return self._request('put', *args, **kwargs)", "def put(self, *args, **kwargs):\n self.request(\"put\", *args, **kwargs)", "def _put(self, path=\"\", **kwargs):\n uri = force_json(self.uri + path)\n return self.client.request(uri, method=\"PUT\", *...
[ "0.77759606", "0.7536418", "0.7412014", "0.7391799", "0.7324844", "0.7284414", "0.7281632", "0.7258294", "0.7258294", "0.7258294", "0.7249349", "0.71901125", "0.7170682", "0.71283567", "0.7080139", "0.7063283", "0.70615494", "0.70427966", "0.7039901", "0.7036298", "0.7020713"...
0.6795165
33
Makes a project level PATCH request
def patch(self, endpoint, params=None, data=None): params = params or dict() data = data or dict() return self.request(verb=requests.patch, address=self.project_address + endpoint, params=params, data=data)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def patch(self, request , pk=None):\n return Response({'message':'PATCH'})", "def patch(self, *args, **kwargs):\n self.request(\"patch\", *args, **kwargs)", "def simulate_patch(app, path, **kwargs) -> _ResultBase:\n return simulate_request(app, 'PATCH', path, **kwargs)", "def patch(self , re...
[ "0.7414447", "0.738381", "0.7376826", "0.73596", "0.7306892", "0.72349507", "0.72255653", "0.72255653", "0.72255653", "0.7203817", "0.7201034", "0.7181048", "0.7179009", "0.7176277", "0.71471167", "0.71437323", "0.7136026", "0.71139544", "0.71114653", "0.70922846", "0.7072007...
0.7070502
22
Layer normalize the tensor x, averaging over the last dimension.
def layer_norm(x, filters=None, epsilon=1e-6, name=None, reuse=None): if filters is None: filters = x.get_shape()[-1] with tf.variable_scope( name, default_name="layer_norm", values=[x], reuse=reuse): scale = tf.get_variable( ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def normalize(self, x, train=True):\n if train is not None:\n mean, variance = tf.nn.moments(x, [0,1,2])\n assign_mean = self.mean.assign(mean)\n assign_variance = self.variance.assign(variance)\n with tf.control_dependencies([assign_mean, assign_variance]):\n return tf.nn.batch_norm_...
[ "0.7025246", "0.7000931", "0.69984037", "0.6946193", "0.6926463", "0.6913268", "0.6907985", "0.68715054", "0.6863467", "0.6787572", "0.6776529", "0.67483455", "0.6723166", "0.6712802", "0.6702004", "0.66976094", "0.6691674", "0.66691875", "0.6619964", "0.6619837", "0.65780723...
0.6047941
79
Return a random string where characters are drawn from a fixed set of characters.
def RandomString(): return "".join(random.choice(CHARACTER_SET) for _ in range(STRING_LENGTH))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def rand_string():\n out = ''\n for _ in range(24):\n out += choice(ascii_letters)\n return out", "def random_chars(char_set, length):\n s = \"\"\n sz = len(char_set)-1\n r = random.SystemRandom()\n for i in range(0, length+1):\n n = r.randint(0, sz)\n s = s + char_set[n...
[ "0.8113231", "0.7946145", "0.79120827", "0.7856756", "0.78565127", "0.78538257", "0.78078026", "0.7802891", "0.7795389", "0.7779298", "0.77750844", "0.77531236", "0.7749553", "0.7718717", "0.7696623", "0.7678719", "0.76537216", "0.7653492", "0.7625127", "0.7624491", "0.761965...
0.7649158
18
A convenience method that directly creates a new instance from a passed dictionary (that probably came from a JSON response from the server.
def from_dict(dict): return SIO_SDC(**dict)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _from_dict(cls, _dict):\n return cls.from_dict(_dict)", "def _from_dict(cls, _dict):\n return cls.from_dict(_dict)", "def _from_dict(cls, _dict):\n return cls.from_dict(_dict)", "def _from_dict(cls, _dict):\n return cls.from_dict(_dict)", "def _from_dict(cls, _dict):\n ...
[ "0.8192101", "0.8192101", "0.8192101", "0.8192101", "0.8192101", "0.8192101", "0.8192101", "0.8192101", "0.8192101", "0.8192101", "0.8192101", "0.8192101", "0.8192101", "0.8192101", "0.8192101", "0.8192101", "0.8192101", "0.8192101", "0.8192101", "0.8192101", "0.8192101", "...
0.0
-1
>>> get_gt_hom_idxs(0) 0/0 [0] >>> get_gt_hom_idxs(1) 0/0, 0/1, 1/1 [0, 2] >>> get_gt_hom_idxs(2) 0/0, 0/1, 1/1, 0/2, 1/2, 2/2 [0, 2, 5] >>> get_gt_hom_idxs(3) [0, 2, 5, 9]
def get_gt_hom_idxs(alt_num): last = -1 hom_idxs = [] for a in range(alt_num + 1): last = last + (a + 1) hom_idxs.append(last) return hom_idxs
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def hoggar_indices():\n return list(product([0,1], repeat=6))", "def master_ndindex(self): # itermaster_indices(self):\n return itertools_product(\n *[range(*r) for r in self.location]\n ) # TODO check", "def get_child_indices(idx: int):\n return 2 * idx + 1, 2 * idx + 2", "d...
[ "0.6421442", "0.59066916", "0.58690584", "0.5763293", "0.569858", "0.56806093", "0.5659324", "0.56189686", "0.5591787", "0.5539958", "0.55100554", "0.54911804", "0.5477589", "0.54528195", "0.5437977", "0.5414168", "0.5386413", "0.5370047", "0.53599024", "0.5350413", "0.534704...
0.82530576
0
Construct an empty priority queue.
def __init__(self, contents=()): self._data = [self._Item(k, v) for k,v in contents] # empty by default if len(self._data) > 1: self._heapify()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def make_empty_queue():\n return Queue(0, None, None)", "def empty_queue():\n return Queue()", "def empty_queue():\n return Queue()", "def priority_queue_full():\n from src.priorityq import PriorityQueue\n priority_queue = PriorityQueue()\n priority_queue.insert(15, 5)\n priority_queue.i...
[ "0.805189", "0.73131335", "0.73131335", "0.73012674", "0.7085521", "0.6290989", "0.620198", "0.60821944", "0.6052215", "0.6049975", "0.6049317", "0.60206825", "0.59892666", "0.5940884", "0.5937808", "0.59070545", "0.59040225", "0.59003806", "0.58879364", "0.5862676", "0.58528...
0.0
-1
Return the number of items in the priority queue.
def __len__(self): return len(self._data)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def size(self):\n return len(self._queue_items)", "def queue_count(self):\n with self.mutex:\n return len(self.queues)", "def get_num_items(self):\r\n return self.num_items", "def size(self): #returns the size or number of items in the stack\n if self...
[ "0.73094535", "0.7214424", "0.71406925", "0.7130484", "0.7051237", "0.7051237", "0.7051237", "0.7051237", "0.7050724", "0.7050724", "0.70315284", "0.70315284", "0.70139974", "0.6985575", "0.6979711", "0.69724464", "0.6955107", "0.6938039", "0.6901929", "0.681586", "0.6785586"...
0.0
-1
Return True if the priority queue is empty.
def is_empty(self): return len(self) == 0
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_empty(self):\n return len(self.priority_queue) == 0", "def is_empty(self):\n return len(self.the_queue) == 0", "def is_empty(self):\n return len(self.queue) == 0", "def is_empty(self):\n return len(self.queue) == 0", "def is_empty(self):\n return self.queue == []",...
[ "0.9179846", "0.8469489", "0.8437107", "0.8437107", "0.8436066", "0.838734", "0.836409", "0.8344005", "0.83305556", "0.83305556", "0.83042455", "0.83034027", "0.82889843", "0.82803255", "0.8267934", "0.8259419", "0.82293385", "0.8219118", "0.82072806", "0.8198649", "0.8182699...
0.0
-1
Return the index of parent.
def _parent(self, j): return (j - 1) // 2
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_parent_index(self):\n return (self.index - 1) // 2", "def get_parent_index(i):\n # Indexing for i_parent == i // 2 is NOT ZERO-INDEXED\n pos = i + 1\n parent_pos = pos // 2\n parent_index = parent_pos - 1\n return parent_index", "def parent(self, index):\n ...
[ "0.88523114", "0.84068686", "0.83859366", "0.83794373", "0.83381116", "0.831047", "0.8292658", "0.8126485", "0.8123494", "0.7984645", "0.7973278", "0.7969792", "0.7860637", "0.77875227", "0.7669214", "0.76445746", "0.7616312", "0.7567693", "0.75354713", "0.753447", "0.7427498...
0.731654
26
Return the index of left child
def _left(self, j): return 2 * j + 1
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_left_child_index(self):\n return (2 * self.index) + 1", "def left_child(self, index):\n return 2 * index + 1", "def left_child(self, index):\n return 2 * index", "def get_left_child_index(self, parent):\n return 2*parent+1", "def left_child(self, pos): \n return 2...
[ "0.91958576", "0.89187956", "0.88115436", "0.87078595", "0.8406982", "0.8348161", "0.83287567", "0.83287567", "0.7953452", "0.7804877", "0.77424127", "0.76655513", "0.7506037", "0.7479933", "0.7473451", "0.74623054", "0.7337348", "0.7330639", "0.7288073", "0.7225832", "0.7203...
0.68971956
33
Return the index of right child.
def _right(self, j): return 2 * j + 2
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_right_child_index(self):\n return (2 * self.index) + 2", "def get_right_child_index(self, parent):\n return 2*parent+2", "def right_child(self, index):\n return 2 * index + 1", "def right_child(self, index):\n return 2 * index + 2", "def rightChild(self, pos):\n ...
[ "0.92920136", "0.89123756", "0.87969095", "0.8676418", "0.85004306", "0.85004306", "0.8477611", "0.8297501", "0.80839413", "0.7759199", "0.7714767", "0.75826806", "0.7569398", "0.74809146", "0.74102217", "0.7365759", "0.7345707", "0.72459966", "0.7243666", "0.7212194", "0.715...
0.63150597
54
Bubbling the element identified by `j` down.
def _down_heap(self, j): if self._has_left(j): small = self._left(j) if self._has_right(j): right = self._right(j) if self._data[small] > self._data[right]: small = right if self._data[j] > self._data[small]: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def forward(self, j=1):\n if j < 0:\n return self.backward(-j)\n self.__i += j\n return self[self.__i - j:self.__i]", "def forward(self, j=1):\n if j < 0:\n return self.backward(-j)\n self.__i += j\n return self[self.__i-j:self.__i]", "def bubble_...
[ "0.5617376", "0.5594953", "0.5517073", "0.551445", "0.5418004", "0.54037386", "0.54037386", "0.53903675", "0.5357077", "0.5243988", "0.49508595", "0.48599544", "0.47243688", "0.47243688", "0.47194177", "0.47174054", "0.46797574", "0.46436283", "0.46277377", "0.46143728", "0.4...
0.5111574
10
Do a bottomup heap construction.
def _heapify(self): start = self._parent(len(self) - 1) for i in range(start, -1, -1): self._down_heap(i)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def build_heap(data):\n size = len(data)\n for i in range(size//2, -1,-1):\n shiftDown(data, i)", "def build_heap(self):\n n = int((len(self.array) / 2) - 1)\n\n while n >= 0:\n self.heapify_top_down(n)\n n -= 1", "def build_heap(arr):\n for i in range(len(ar...
[ "0.7398819", "0.7373493", "0.7128891", "0.70331573", "0.68688476", "0.6812924", "0.6748717", "0.673803", "0.6599716", "0.6594262", "0.6590596", "0.65709054", "0.6565626", "0.6487256", "0.64317", "0.6431595", "0.63976145", "0.63963735", "0.6386745", "0.6373046", "0.6365643", ...
0.6677855
8
return all extensions being considered i.e. jpg, jpeg, png
def img_extensions(): return [".JPG"]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_file_extensions(self):\n return [ 'img', 'qcow', 'qcow2' ]", "def collect_image_files():\n negs = [] # Non image files found\n for filename in os.listdir('.'):\n if filename.lower().endswith('.jpg') or filename.lower().\\\n endswith('.jpeg'):\n jpg_files.app...
[ "0.78561896", "0.7290533", "0.72052455", "0.716067", "0.71313787", "0.7124166", "0.7113873", "0.70675", "0.6955492", "0.6789657", "0.67688596", "0.67430735", "0.66921145", "0.6691617", "0.66694444", "0.6662907", "0.6653264", "0.6645472", "0.66333157", "0.6631114", "0.6595369"...
0.82684064
0
Sets all values to default.
def dispose(self): self.__playerName="???" self.__difficulty=0 self.__highScore=0 self.__bestStepRun=0 self.__levelReached=1 self.__songDictionary={} self.__filename = ""
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_defaults(self):\n\n for k, v in self.DEFAULTS.items():\n if not getattr(self, k, None):\n setattr(self, k, v)", "def set_initial_values(self):\n\n pass", "def set_defaults(self):\r\n for name, option in self.options.iteritems():\r\n if not optio...
[ "0.7860561", "0.7616374", "0.7608209", "0.7513861", "0.74160504", "0.739448", "0.72385925", "0.71804094", "0.7124414", "0.71033216", "0.7100495", "0.70212346", "0.69523466", "0.689952", "0.6755493", "0.6709823", "0.6692402", "0.6692402", "0.6684488", "0.66272336", "0.6622013"...
0.0
-1
Plot the adapt image of a galaxy.
def figure_adapt_model_image(self, adapt_model_image: aa.Array2D): self.mat_plot_2d.plot_array( array=adapt_model_image, visuals_2d=self.get_visuals_2d(), auto_labels=aplt.AutoLabels( title="adapt image", filename="adapt_model_image" ), ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def figure_adapt_galaxy_image(self, galaxy_image: aa.Array2D):\r\n self.mat_plot_2d.plot_array(\r\n array=galaxy_image,\r\n visuals_2d=self.get_visuals_2d(),\r\n auto_labels=aplt.AutoLabels(\r\n title=\"galaxy Image\", filename=\"adapt_galaxy_image\"\r\n ...
[ "0.77073085", "0.64474416", "0.62014794", "0.6153183", "0.6121531", "0.60791826", "0.59728044", "0.58779246", "0.5871628", "0.58626986", "0.5845781", "0.58426213", "0.5841411", "0.5770292", "0.57224154", "0.57178", "0.57064533", "0.57042474", "0.5702702", "0.56973904", "0.565...
0.6343304
2
Plot the galaxy image of a galaxy.
def figure_adapt_galaxy_image(self, galaxy_image: aa.Array2D): self.mat_plot_2d.plot_array( array=galaxy_image, visuals_2d=self.get_visuals_2d(), auto_labels=aplt.AutoLabels( title="galaxy Image", filename="adapt_galaxy_image" ), )
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def plot(self, param):\n # process param to be lowercase and without spaces\n param = str(param).lower().replace(\" \", \"\")\n plt.ion() # enable interactive mode\n\n # making plot according to param\n if param == \"illuminantenergy\": # energy of illuminant\n self....
[ "0.6429617", "0.6013196", "0.5969649", "0.59120136", "0.5857666", "0.5815539", "0.57454026", "0.5694297", "0.56765664", "0.5668978", "0.5632633", "0.56229776", "0.5604926", "0.55940866", "0.55939925", "0.5560272", "0.5529433", "0.55293584", "0.55172914", "0.55121243", "0.5502...
0.723637
0
Plots a subplot of the galaxy image of all galaxies. This uses the `adapt_galaxy_image_path_dict` which is a dictionary mapping each galaxy to its corresponding to galaxy image.
def subplot_adapt_images_of_galaxies( self, adapt_galaxy_image_path_dict: Dict[Galaxy, aa.Array2D] ): if adapt_galaxy_image_path_dict is None: return self.open_subplot_figure(number_subplots=len(adapt_galaxy_image_path_dict)) for path, galaxy_image in adapt_gala...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def figure_adapt_galaxy_image(self, galaxy_image: aa.Array2D):\r\n self.mat_plot_2d.plot_array(\r\n array=galaxy_image,\r\n visuals_2d=self.get_visuals_2d(),\r\n auto_labels=aplt.AutoLabels(\r\n title=\"galaxy Image\", filename=\"adapt_galaxy_image\"\r\n ...
[ "0.73054737", "0.6793398", "0.63942105", "0.63073295", "0.60548747", "0.6032299", "0.6032299", "0.6032299", "0.59846544", "0.5893336", "0.5854182", "0.58026206", "0.57587886", "0.5743003", "0.5740605", "0.5696411", "0.56705105", "0.5667904", "0.56602514", "0.56335175", "0.563...
0.8380626
0
Displacement of the mean of the data from the origin.
def gen_m(self, n_dims): m = np.random.randint(-1000, 1000, n_dims).astype(float) return m
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def mean(self):\n\n\t\tif not self._masked:\n\t\t\t\n\t\t\treturn self.data.mean()\n\t\t\n\t\telse:\n\t\t\t\n\t\t\tif not hasattr(self,\"_full_mask\"):\n\t\t\t\tself.maskBoundaries()\n\t\t\t\n\t\t\treturn self.data[self._full_mask].mean()", "def get_mean(self):\n return numpy.mean(self._x) - numpy.mean(se...
[ "0.72801834", "0.7214286", "0.7134578", "0.712177", "0.70132357", "0.70042986", "0.69960624", "0.6886174", "0.684742", "0.68454003", "0.6834306", "0.68179494", "0.6811251", "0.6791517", "0.6773372", "0.67618364", "0.67607796", "0.6757741", "0.6739905", "0.67349046", "0.673490...
0.0
-1
Return the _OneQState at the given qubit.
def __getitem__(self, qubit): for oneq_state in self.states: if oneq_state.qubit == qubit: return oneq_state raise IndexError()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_state(self):\n return ONEUP_STATES[self.state][0]", "def pick_a_state(Q):\n all_states = Q.statetracker.state_probabilities()\n all_visited_states = [state for state in all_states if all_states[state] > 0]\n index_choice = np.random.randint(len(all_visited_states))\n state = all_visite...
[ "0.6318529", "0.6158064", "0.6157777", "0.58019364", "0.5780136", "0.57543325", "0.5737401", "0.5737401", "0.57324916", "0.5702599", "0.5702599", "0.5702599", "0.5702599", "0.5702599", "0.5702599", "0.5702599", "0.5702599", "0.5702599", "0.5702599", "0.5702599", "0.5702599", ...
0.7962742
0
Construct a PauliTerm operator by taking the nonidentity singlequbit operator at each qubit position. This function will return ``None`` if the input operators do not share a natural tensor product basis. For example, the max_weight_operator of ["XI", "IZ"] is "XZ". Asking for the max weight operator of something like ...
def _max_weight_operator(ops: Iterable[PauliTerm]) -> Union[None, PauliTerm]: mapping = dict() # type: Dict[int, str] for op in ops: for idx, op_str in op: if idx in mapping: if mapping[idx] != op_str: return None else: mapping...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def qubitop_to_pauliop(n_qubits, qubit_operator):\n if not isinstance(qubit_operator, QubitOperator):\n raise TypeError(\"qubit_operator must be an openFermion QubitOperator object.\")\n paulis = []\n\n for qubit_terms, coefficient in qubit_operator.terms.items():\n count=0\n pauli_la...
[ "0.61999893", "0.61304766", "0.592701", "0.58670783", "0.5797058", "0.5693715", "0.56606096", "0.5626051", "0.55829257", "0.55493224", "0.5520556", "0.549517", "0.54718876", "0.54706854", "0.54655415", "0.5465124", "0.5453243", "0.54489344", "0.54489344", "0.54383487", "0.540...
0.69963306
0
Computes the orientation of the Baxter's left endeffector given the joint state.
def baxter_forward_kinematics_from_joint_state(joint_state): angles = np.zeros(7) angles = joint_state.position[2:9] return baxter_forward_kinematics_from_angles(angles) print(baxter_forward_kinematics_from_angles(angles))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def left_rotation(self, ang_vel):\n vel = self.om_right_max * self.R - ang_vel * self.L\n om_left = (vel - ang_vel * self.L) / self.R -1\n return vel, om_left", "def left (x):\n\n return Sinary(side(x.v,1))", "def align(self) -> np.ndarray:\n vel = self.state[:, :, Boids.Attr...
[ "0.63801736", "0.6011719", "0.5640813", "0.5603242", "0.55896014", "0.5549157", "0.5506519", "0.54936016", "0.5436179", "0.5422546", "0.5420507", "0.5399368", "0.53921026", "0.53817236", "0.53622013", "0.53512573", "0.5351158", "0.534967", "0.53358006", "0.533528", "0.5328567...
0.0
-1
x (Tensor) is the feature from ROI pooling/align. e.g. x.size = (1000, 256, 7, 7) y (Tensor) is the feature from backbone.
def forward(self, x, y): x = torch.div(x, x.norm()) y = torch.div(y, y.norm()) if not self.is_cat: #x = x.mean(dim=0).unsqueeze(0) # addition over channels, x.shape = (1,256,7,7) x = torch.sum(x, dim=0).unsqueeze(0) else: x = x.reshape(-1) # und...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def convert_features(self,b_x):\n # reshape\n b,_=b_x.shape\n default_xy=self.default_xy[None].expand(b,-1,-1,-1,-1).type_as(b_x)\n # here shape to be [b,side,side,(num*(coords+rescore)+classes)]\n b_x=b_x.view(b,self.side,self.side,(self.num*(self.coords+self.rescore)+self.class...
[ "0.6641982", "0.6483555", "0.6362949", "0.63191074", "0.62588996", "0.6242583", "0.6093684", "0.6073511", "0.6041009", "0.5986934", "0.5975485", "0.5958275", "0.5948272", "0.59259933", "0.5922988", "0.59070253", "0.5895744", "0.58936125", "0.58734447", "0.5864338", "0.5852185...
0.597011
11
Rate an item. Return type is RatingAssociation.
def rate_item(self, trans, user, item, rating, comment=''): item_rating = self.get_user_item_rating(trans.sa_session, user, item, webapp_model=trans.model) if not item_rating: # User has not yet rated item; create rating. item_rating_assoc_class = self._get_item_rating_assoc_clas...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def rate(request, item_id, user_id):\n q = \"\"\"SELECT u FROM (SELECT item_id, user_id, AVG(usefulness) AS u\n FROM rating GROUP BY item_id, user_id) r\n WHERE item_id = %s AND user_id = %s\"\"\"\n\n if request.method == 'POST':\n if not request.user.is_authenticated:\n ...
[ "0.63127685", "0.58665", "0.5723079", "0.5678973", "0.5598166", "0.557866", "0.55126345", "0.54044944", "0.53995824", "0.53653866", "0.53625494", "0.53620464", "0.531321", "0.5287787", "0.5279655", "0.52754354", "0.5257843", "0.524187", "0.524187", "0.5176579", "0.5168848", ...
0.7351503
0
Whether the passed job pair has an associated filter reason. This function should be used to decide whether to skip a jobpair that has already been filtered. Relies on the fact that the default value assocaited with FILTERED_REASON_KEY is None.
def jobpair_is_filtered(jp): return bool(jp[FILTERED_REASON_KEY])
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _filter(self):\n if self.properties['reason'] in PoliceReport.reason_filter:\n return False\n return True", "def validate_filterval(filterval):\n if filterval != 'description' and filterval != 'fulldescription' and filterval != 'completed':\n return False\n e...
[ "0.6475612", "0.56003875", "0.554142", "0.5362846", "0.53555804", "0.52335614", "0.5198767", "0.50483173", "0.5032212", "0.5015778", "0.50153613", "0.4979651", "0.49677342", "0.49467126", "0.4938192", "0.4923432", "0.49198565", "0.48927096", "0.48806497", "0.4874358", "0.4866...
0.7634059
0
Get the path of the original log for the job identified by the passed job ID.
def get_orig_log_path(job_id) -> str: return os.path.join(ORIGINAL_LOG_DIR, '{}-orig.log'.format(job_id))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def logpath(self):\n return self.outpath", "def get_result_path(self):\n return logPath", "def get_log_path():\n return LOG_PATH", "def getJobLog(self, jobId):\n params = {'id': jobId}\n try:\n resp = self.gc.get(JobUtils.JOB_ID_PATH, parameters=params)\n ...
[ "0.6663802", "0.63415766", "0.63330805", "0.6307663", "0.6213428", "0.6210081", "0.61813563", "0.60702413", "0.60621226", "0.5931708", "0.58903736", "0.57767165", "0.5710701", "0.5709609", "0.56985813", "0.56858516", "0.5680996", "0.5678624", "0.5672717", "0.56619763", "0.564...
0.8995187
0
Generate dataset to test
def generate_dataset(error_rate): test_case = [randint(500, 600)] for _ in range(randint(5, 10)): test_case.append(test_case[-1] - randint(10, 30)) for _ in range(randint(5, 10)): test_case.append(test_case[-1] + randint(10, 30)) # Allow for error. error_window = ceil(len(test...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def generate_dataset(self):\n sets = {\n \"train\": 10,\n \"test\": 5,\n }\n\n fields = {\n \"strings_list\": lambda x: str_to_ascii(self.generate_string_list(x)),\n \"data\": lambda x: np.random.randint(0, 10, (x, 10)),\n \"number\": lamb...
[ "0.7775823", "0.76934594", "0.7514942", "0.7325774", "0.7283979", "0.72182417", "0.7199076", "0.7081371", "0.7068466", "0.7038486", "0.70270467", "0.6986364", "0.69762874", "0.6967292", "0.69476205", "0.6929576", "0.6904908", "0.68990797", "0.6889853", "0.6885068", "0.6877968...
0.0
-1
Returns True if the two lists have the same sequences of values, i.e. if self.get(i) == other.get(i) for all i.
def __eq__(self, other): return self._to_pylist() == other._to_pylist()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def equals(self, other):\n # Check keys\n diff = set(self.keys()).symmetric_difference(\n other.keys())\n if len(diff) != 0:\n return False\n for key in self.keys():\n if type(self[key]) != type(other[key]):\n return False\n this_value = self[key]\n other_value = other...
[ "0.7357986", "0.72600216", "0.72305584", "0.7162971", "0.71537644", "0.70946956", "0.7081359", "0.7045598", "0.70261216", "0.7023412", "0.6908311", "0.6868657", "0.6867506", "0.6850822", "0.68375933", "0.683541", "0.6833878", "0.6828941", "0.67776185", "0.67731947", "0.673830...
0.6638758
29
default equality method that checks if all of the saved attributes are equal
def __eq__(self, other): for attr in self._attrs_to_save: try: if getattr(self, attr) != getattr(other, attr): return False except AttributeError: return False return True
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __eq__(self, other):\n\t\treturn all((getattr(self, attr, None) == getattr(other, attr, None) for attr in self.attrs))", "def test_attributes_equal(self):\n test1 = self.Test({ 'id': 2, 'name': 'Poop Head' })\n test2 = self.Test({ 'id': 2, 'name': 'Poop Head' })\n self.assertEqual(test1,...
[ "0.7648471", "0.7374077", "0.73199904", "0.7270609", "0.72359306", "0.72087514", "0.717317", "0.71673864", "0.71179193", "0.71100724", "0.70793015", "0.7078396", "0.7043264", "0.7016385", "0.6985569", "0.6981357", "0.6950724", "0.6945876", "0.6945275", "0.6941493", "0.6941493...
0.81146955
0
creates an instance of this class populated by the contents of the json compatible dict the object is created with __new__ before setting the attributes
def _from_json_dict(cls, dic): # create a new object obj = cls.__new__(cls) for attr, typ in cls._attrs_to_save.items(): setattr(obj, attr, typ.to_python(dic[attr])) return obj
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __json_init__(cls, **kwargs):\n return cls(**kwargs)", "def __init__(self, dict):\n self.dict = dict", "def __init__(self, dict):\n self.dict = dict", "def __init__(self, json_dict, endpoint):\n self._values = json_dict\n self._endpoint = endpoint", "def _from_dict(cl...
[ "0.80707294", "0.7650491", "0.7650491", "0.7514158", "0.734011", "0.734011", "0.734011", "0.734011", "0.734011", "0.734011", "0.734011", "0.734011", "0.734011", "0.734011", "0.734011", "0.734011", "0.734011", "0.734011", "0.734011", "0.734011", "0.734011", "0.734011", "0....
0.7522148
3
factory function that creates an arbitrary JsonSaveable object from a jsoncompatible dict.
def from_json_dict(j_dict): # determine the class it is. obj_type = j_dict["__obj_type"] obj = Saveable.ALL_SAVEABLES[obj_type].from_json_dict(j_dict) return obj
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _from_json_dict(cls, dic):\n # create a new object\n obj = cls.__new__(cls)\n for attr, typ in cls._attrs_to_save.items():\n setattr(obj, attr, typ.to_python(dic[attr]))\n return obj", "def from_dict(cls, obj):\r\n raise NotImplementedError", "def fromJson(json):\r\n raise ...
[ "0.78258455", "0.6662084", "0.66089404", "0.6352645", "0.6333177", "0.63276803", "0.6321228", "0.62884074", "0.62820095", "0.6280435", "0.626635", "0.620492", "0.61964595", "0.61784995", "0.6102055", "0.6089292", "0.6079874", "0.6075353", "0.60666823", "0.60666823", "0.606668...
0.79242706
0
Factory function that recreates a JsonSaveable object from a json string or file
def from_json(_json): if isinstance(_json, (str, Path)): return from_json_dict(json.loads(_json)) else: # assume a file-like object return from_json_dict(json.load(_json))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def from_json(cls, filepath):\n #If file cannot be found, create an empty file and write an empty cls data into it.\n import os\n if (os.path.isfile(filepath) == False):\n empty_cls = cls()\n empty_cls.to_json(filepath)\n print('New Json Created: Type=', empty_...
[ "0.69445276", "0.66135836", "0.65723944", "0.6508084", "0.64000374", "0.6388198", "0.6240328", "0.6237702", "0.62323046", "0.62283117", "0.6221963", "0.621985", "0.62079245", "0.6188826", "0.6187869", "0.61836946", "0.61450255", "0.6126107", "0.6120357", "0.6112698", "0.61107...
0.65494806
3
Set mass flow and pressure drop to zero if the heat balance is negative.
def calc_optimal_mass_flow_2(m, q, dp): for time in range(8760): if q[time] <= 0: m[time] = 0 dp[time] = 0 return m, dp
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def turn_aux_heat_off(self):\n self.set_operation_mode(STATE_HEAT)", "def resetMass(self):\n self.cm = np.array([0, 0, 0])\n self.m = 0\n self.iT = np.identity([3,3])", "async def async_turn_aux_heat_off(self) -> None:\n await self._set_aux_heat(False)", "def set_mass_flow(...
[ "0.6076105", "0.5823363", "0.57231724", "0.5628678", "0.5476825", "0.5470909", "0.5470527", "0.53888476", "0.5366528", "0.5353049", "0.5353005", "0.5347691", "0.53414404", "0.5338863", "0.5338863", "0.53350526", "0.53313553", "0.53090703", "0.52976644", "0.52874917", "0.52667...
0.0
-1
Collects information about the current environment and creates a new `BenchmarkMetadata` with it.
def create(suite_name: str) -> "BenchmarkMetadata": suite_name = suite_name argv = sys.argv script_name = Path(argv[0]).stem user = getpass.getuser() hostname = gethostname() timestamp = _get_timestamp() py_ver = python_version() tf_ver = tf.__version__ ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def CreateMetadataDict(benchmark_spec):\n metadata = {\n 'use_tpu': bool(benchmark_spec.tpus),\n 'data_dir': benchmark_spec.data_dir,\n 'model_dir': benchmark_spec.model_dir,\n 'train_steps': benchmark_spec.train_steps,\n 'eval_steps': benchmark_spec.eval_steps,\n 'commit': cloud_tpu...
[ "0.63644177", "0.62700367", "0.6192663", "0.59702843", "0.59066504", "0.5599776", "0.5581139", "0.5349809", "0.5332134", "0.5316265", "0.5269379", "0.5268498", "0.5257831", "0.52022696", "0.51699764", "0.51545966", "0.51422364", "0.5114252", "0.5107405", "0.5075036", "0.50673...
0.7099767
0
Test API cannot post the menu by a regular user (POST request).
def test_regular_user_cannot_post_a_menu_for_the_day(self): res = self.login_user() access_token = json.loads(res.data.decode())['access_token'] response = self.client().post('/api/v2/menu/1', headers={"x-access-token": access_token}, data = json.dumps( self.meal_data), content_type = 'application/jso...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_post_creation_unauthorized(self):\n url = reverse('post-list')\n user_url = reverse('user-detail', kwargs={'pk': self.superuser.id})\n title = 'Test Title'\n body = 'Test Body'\n response = self.client.post(url, {'title': title, 'body': body, 'user': user_url}, format='j...
[ "0.7284266", "0.6974583", "0.69628066", "0.69342715", "0.69314605", "0.69065505", "0.6871267", "0.68007195", "0.67025477", "0.6697823", "0.6691671", "0.66282713", "0.6606737", "0.65967745", "0.6586416", "0.65827394", "0.6573329", "0.65536433", "0.6542431", "0.6539563", "0.653...
0.77602476
0
Return whether the argument lyst is in nondecreasing order.
def isSorted(lyst): #Cute list comprehension way that doesn't short-circuit. #return len([x for x in # [a - b for a,b in zip(lyst[1:], lyst[0:-1])] # if x < 0]) == 0 for i in range(1, len(lyst)): if lyst[i] < lyst[i-1]: return False return True
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_nondecreasing_vec(x):\n return jnp.all(jnp.diff(x) >= 0)", "def is_not_in_descending_order(a):\n for i in range(len(a) - 1):\n if a[i] > a[i + 1]:\n return False\n return True", "def is_not_in_descending_order(a):\n for i in range(len(a)-1):\n if a[i] > a[i+1]:\n ...
[ "0.71008873", "0.70913", "0.7075413", "0.7016619", "0.6758934", "0.6577197", "0.6557398", "0.6530358", "0.6507176", "0.6455119", "0.6392722", "0.63779473", "0.63386", "0.6306364", "0.61892086", "0.6136342", "0.6122633", "0.607214", "0.60716456", "0.6036293", "0.60209435", "...
0.6882985
4
Return the op reduction root directory which is a subdirectory of `build_dir`.
def _get_op_reduction_root(build_dir: Path): return Path(build_dir, OP_REDUCTION_DIR)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def output_dir(self):\n return self.c.build_dir.join(self.c.build_config_fs)", "def build_directory(self) -> Optional[str]:\n return self.configuration.build_directory", "def get_build_dir(package_dir):\n return os.path.split(makepkg([\"--packagelist\"], True, package_dir)[0])[0]", "def _get...
[ "0.7252696", "0.68412584", "0.6808593", "0.66555095", "0.6575185", "0.65254927", "0.65154254", "0.6469604", "0.6457611", "0.644798", "0.642649", "0.6426296", "0.64116573", "0.63883084", "0.6382274", "0.63343316", "0.6293184", "0.62905604", "0.6248518", "0.62445927", "0.624459...
0.85088044
0
Gets a collection of `InputExample`s for the train set.
def get_train_examples(self, data_dir): raise NotImplementedError()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_train_inputs(self, example):\n return example", "def get_train_examples(self):\n raise NotImplementedError()", "def get_train_examples(self, input_file):\r\n raise NotImplementedError()", "def _create_examples(self, data, set_type):\n examples = []\n for (i, elem) in en...
[ "0.73499966", "0.7173421", "0.7126833", "0.65602446", "0.64204013", "0.64052176", "0.63422555", "0.6290186", "0.6282746", "0.625262", "0.62499267", "0.6233708", "0.62225735", "0.62225735", "0.6205607", "0.6205607", "0.6205607", "0.6205607", "0.6205607", "0.6205607", "0.620560...
0.62466323
15
Gets a collection of `InputExample`s for the dev set.
def get_dev_examples(self, data_dir): raise NotImplementedError()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_dev_examples(self, input_file):\r\n raise NotImplementedError()", "def get_train_inputs(self, example):\n return example", "def get_examples(self, env):\n return self.fam.c_get_examples(self, env)", "def get_dev_examples(self):\n raise NotImplementedError()", "def _create_ex...
[ "0.68112403", "0.6588688", "0.655683", "0.6552607", "0.64272827", "0.63816285", "0.6255956", "0.61930686", "0.61160946", "0.6094262", "0.6054992", "0.6051947", "0.5989807", "0.5927489", "0.5922901", "0.5920675", "0.59200704", "0.59155166", "0.59155166", "0.59155166", "0.59155...
0.5994604
17
Gets a collection of `InputExample`s for the test set.
def get_test_examples(self, data_dir): raise NotImplementedError()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _create_examples(self, data, set_type):\n examples = []\n for (i, elem) in enumerate(data):\n guid = \"%s-%s\" % (set_type, i)\n text = elem[0]\n label = elem[1]\n examples.append(\n InputExample(guid=guid, text=text, label=label))\n ...
[ "0.6849201", "0.68117833", "0.6449045", "0.64120954", "0.6390244", "0.6380512", "0.63573486", "0.631445", "0.63001204", "0.6285433", "0.62853587", "0.62804675", "0.6272988", "0.626253", "0.6261441", "0.62613", "0.6256415", "0.62528956", "0.62511957", "0.62481475", "0.62390435...
0.0
-1
Reads a json file for tasks in sentiment analysis.
def _read_json(cls, input_file): with open(input_file) as f: return json.load(f)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def read_tweets():\n data = []\t\n try:\n with open(os.path.dirname(__file__) + '/../tweet_input/tweets.txt') as f:\n for line in f:\n jfile = json.loads(''.join(line))\n data.append(jfile)\n return data\n except:\n print(\"File not found\")\n...
[ "0.65445757", "0.6503671", "0.6331834", "0.61480767", "0.61231667", "0.609587", "0.6082202", "0.603356", "0.59773785", "0.5883814", "0.5838767", "0.5820376", "0.5787014", "0.5786265", "0.5735494", "0.5723909", "0.57066137", "0.5660704", "0.5639974", "0.55948913", "0.55443263"...
0.56211346
20
function to initialize weight. The weights initialized by xavier_init should have 2/(fan_in+fan_out) as it's variance
def xavier_init(fan_in, fan_out, constant=1): low = -constant * np.sqrt(6.0 / (fan_in + fan_out)) high = constant * np.sqrt(6.0 / (fan_in + fan_out)) return tf.random_uniform((fan_in, fan_out), minval=low, maxval=high, dtype=tf.float32)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def init_weight(self):\r\n xavier_init(self.output_proj, distribution='uniform', bias=0.)", "def _init_weights(self):\n nn.init.xavier_normal_(self.out.weight)", "def XavierInit(self):\n\n raw_std = (2 / (self.num_input + self.num_output))**0.5\n if 'relu' == self.act_function:\n ...
[ "0.8545656", "0.8004582", "0.76515335", "0.76364887", "0.7509605", "0.7394737", "0.7394737", "0.7355793", "0.73297745", "0.7298216", "0.7243964", "0.7231625", "0.72174966", "0.72068506", "0.7176914", "0.71471995", "0.7146275", "0.7128672", "0.7126944", "0.7124045", "0.7123507...
0.69904286
32
Removing stop words Synsets english words into sets of synonyms Tokenization is breaking the sentence into words and punctuation.
def sents_2(list_of_tweets): stopwords = nltk.corpus.stopwords.words('english') contextTerms = [] for sent in list_of_tweets: for word in sent.split(): word_lemmatizer = WordNetLemmatizer() word = word_lemmatizer.lemmatize(word.lower()) if wordnet.synsets(word) an...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def remove_stopwords_set(sentence: str, stop_words: Collection[str]) -> str:\n return \" \".join([w for w in word_tokenize(sentence) if w not in stop_words])", "def remove_stopwords(setence):\n sent = setence.lower().strip()\n stopwords = load_stopwords(stopword_path)\n tokens = tokenizer.tokenize(s...
[ "0.7184773", "0.71743345", "0.7136949", "0.70418584", "0.7012902", "0.7000172", "0.6973088", "0.69280106", "0.69265443", "0.6865417", "0.6839775", "0.68321383", "0.6823569", "0.6816358", "0.67053634", "0.66897154", "0.6675423", "0.6669013", "0.6662516", "0.6647865", "0.664643...
0.0
-1
Returns the score for the board based on the pieces of the two players. White pieces are worth positive points and black pieces are worth negative points. Checkmate and stalemate are worth a constant value.
def evaluate_board(self, board, white_checkmate, black_checkmate, draw): score = 0 if white_checkmate: return self.WHITE_CHECKMATE if black_checkmate: return self.BLACK_CHECKMATE if draw: return self.STALEMATE for piece in board.white_pieces +...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def custom_score_2(game, player):\n # TODO: finish this function!\n if game.is_loser(player):\n #print(\"You lose!\")\n return -math.inf\n if game.is_winner(player):\n #print(\"You win\")\n return math.inf\n\n # center\n width = game.width / 2\n height = game.height / ...
[ "0.7116177", "0.70798063", "0.7035624", "0.6945842", "0.6938992", "0.69386923", "0.69379556", "0.69210756", "0.69152623", "0.6881724", "0.68747544", "0.6826493", "0.67944044", "0.6788806", "0.67313457", "0.6697762", "0.6696495", "0.66962236", "0.6665189", "0.66271377", "0.658...
0.7253927
0
Generate anchor (reference) windows by enumerating aspect ratios X sizes wrt a reference (stride 1) window.
def _generate_anchors(stride, sizes): anchor = np.array([0, stride], dtype=np.float) anchors = _scale_enum(anchor, sizes) return torch.from_numpy(anchors)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def generate_anchors(\n stride=16, sizes=(32, 64, 128, 256, 512), aspect_ratios=(0.5, 1, 2)\n):\n return _generate_anchors(\n stride,\n np.array(sizes, dtype=np.float) / stride,\n np.array(aspect_ratios, dtype=np.float),\n )", "def generate_anchors(self):\n self.anchors = np....
[ "0.6608679", "0.6424068", "0.62622625", "0.6191001", "0.6141703", "0.600115", "0.5998773", "0.5990838", "0.59845877", "0.5982844", "0.59516937", "0.5866746", "0.5819845", "0.58065146", "0.58065146", "0.57970005", "0.5776249", "0.574043", "0.57301915", "0.56856835", "0.5567426...
0.60744005
5
Constructor of the FileTreeCtrl.
def __init__(self, parent, name=wx.PanelNameStr): super(FilesTreeViewCtrl, self).__init__(parent, name) # Create an instance of our model and associate to the view. self._model = FilesTreeViewModel() self.AssociateModel(self._model) self._model.DecRef() # Create the col...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def init_file_tree(self):\r\n # layout for the file explorer\r\n path=QtCore.QDir.currentPath()\r\n\r\n # file system model init\r\n self.model = QtWidgets.QFileSystemModel()\r\n self.model.setRootPath(path)\r\n self.model.setNameFilterDisables(False)\r\n \r\n ...
[ "0.7682549", "0.72655356", "0.693589", "0.6454574", "0.64237654", "0.63540375", "0.63313216", "0.63232327", "0.63232327", "0.6321612", "0.63037163", "0.63037163", "0.6265242", "0.6251252", "0.6251252", "0.6250256", "0.623478", "0.6225447", "0.62064266", "0.6184077", "0.614373...
0.78433406
0
Yield successive nsized chunks from l.
def chunks(l, n): for i in xrange(0, len(l), n): yield l[i:i+n]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _chunk(self, l, n):\n for i in range(0, len(l) + 1, n):\n yield l[i:i + n]", "def chunks(self, l, n):\n for i in range(0, len(l), n):\n yield l[i:i + n]", "def __chunks(l, n):\n for i in range(0, len(l), n):\n yield l[i:i + n]", "def get_chunks(self, ...
[ "0.8038813", "0.79248375", "0.7923423", "0.7885103", "0.78773195", "0.7815877", "0.77655786", "0.77556044", "0.77441615", "0.7731815", "0.77288336", "0.772473", "0.77028215", "0.76889825", "0.76889825", "0.7664208", "0.76570904", "0.7655856", "0.7655856", "0.76458347", "0.764...
0.0
-1
Joining list of list with space separator
def _join_list_of_list(lst): int_list = [list(map(int, each)) for each in lst] # print(*int_list, sep="\n") str_list = [",".join(map(str, each)) for each in int_list] # print(*int_list, sep="\n") # print(str_list) final_str = " ".join(str_list) # print(final_str) return final_str
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def list_join(the_list):\n return ' '.join(the_list)", "def join_list(items: Iterable[str]) -> str:\n\n return ITEM_SEPARATOR.join(items)", "def join(sep, xs):\n return str(sep).join(xs)", "def join_recursive(lst, sep):\n msg = ''\n for i in lst:\n if isinstance(i, tuple) or isinstance(...
[ "0.8244581", "0.8045867", "0.75583977", "0.7411882", "0.73671335", "0.7302663", "0.7274353", "0.7207168", "0.7207168", "0.7207168", "0.7207168", "0.71913916", "0.7147679", "0.71076375", "0.7079727", "0.7078891", "0.70673424", "0.7023668", "0.70139235", "0.69604486", "0.695833...
0.73451626
5
Close connection to the target.
def close(self): self._fuzz_data_logger.log_info('Closing target connection...') self._target_connection.close() self._fuzz_data_logger.log_info('Connection closed.')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __close_conn(self, target_host_socket):\n self.__client.close()\n target_host_socket.close()\n logging.info(\"Client <> Target closed\")", "def close_connection(self):\n\n self._connection.close()\n print(\"Closed connection....\")", "def close(self):\n self.connec...
[ "0.7807088", "0.76912695", "0.7663574", "0.7493893", "0.74566114", "0.74423784", "0.74423784", "0.744026", "0.74156606", "0.738696", "0.7376113", "0.7364263", "0.7361066", "0.7350804", "0.7342525", "0.7318986", "0.73095423", "0.73095423", "0.73095423", "0.73095423", "0.730954...
0.8117213
0
Number of total mutations in the graph. The logic of this routine is identical to that of fuzz(). See fuzz() for inline comments. The member variable self.total_num_mutations is updated appropriately by this routine.
def num_mutations(self, this_node=None, path=()): if this_node is None: this_node = self.root self.total_num_mutations = 0 if isinstance(path, tuple): path = list(path) for edge in self.edges_from(this_node.id): next_node = self.nodes[edge.dst] ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def num_mutations(self):\n return sum(len(site.mutations) for site in self.sites())", "def num_mutations(self):\n return len(self.fuzz_library)", "def fuzz(self):\n self.total_mutant_index = 0\n self.total_num_mutations = self.num_mutations()\n\n self._main_fuzz_loop(self._it...
[ "0.7557352", "0.7530203", "0.65087146", "0.64787376", "0.6133735", "0.6033649", "0.59475315", "0.5936507", "0.5752328", "0.57289994", "0.57289994", "0.5667567", "0.56216055", "0.56193405", "0.55978876", "0.55697644", "0.5561469", "0.5527241", "0.55178183", "0.55159503", "0.54...
0.68025446
2
returning all elements names from ``EvidenceVariableCategory`` according specification, with preserving original sequence order.
def elements_sequence(cls): return [ "id", "extension", "modifierExtension", "name", "valueCodeableConcept", "valueQuantity", "valueRange", ]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def variable_names(self):\n \n return [x['variable'] for x in self.variable_dicts()]", "def get_variable_names(self):\n return [var[1] for var in self.variables]", "def get_element_variable_names(self):\n return [b\"\".join(_i).strip().decode()\n for _i in self._f.var...
[ "0.6751923", "0.64514303", "0.6289793", "0.62864155", "0.6256326", "0.6120118", "0.61115116", "0.5924779", "0.58667034", "0.5842922", "0.5826737", "0.57772017", "0.5671861", "0.5632851", "0.56302226", "0.5627173", "0.5616691", "0.55790293", "0.55654716", "0.55540085", "0.5506...
0.0
-1
Use a contextmanager in a test setUp that persists until teardown.
def setup_with_context_manager(testcase, cm): val = cm.__enter__() testcase.addCleanup(cm.__exit__, None, None, None) return val
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def setUp(self):\n super(ExtensionTestsMixin, self).setUp()\n\n self.manager = None", "def _setup_app_context_for_test():\n ctx = application.app_context()\n ctx.push()\n yield # tests will run here\n ctx.pop()", "def setUp(self) -> None:\n self.manager = Manager()", "def se...
[ "0.7319921", "0.7249502", "0.7123806", "0.6686967", "0.6686967", "0.6657548", "0.66480863", "0.66480863", "0.66473985", "0.6628427", "0.6570192", "0.6542804", "0.65339327", "0.64785016", "0.63933253", "0.6393187", "0.6384208", "0.6384208", "0.63714457", "0.6360595", "0.632887...
0.81593835
0
Converts strings that look like lists into actual lists of ints and saves a pickle of the repaired dataframe.
def convert_tsv_to_pkl( chunk_size: int, input_path: str, output_path: str, ): converter_dict = { col: lambda x: [int(y) for y in x.strip("[]").split(", ")] for col in [ "input_ids", "attention_mask", "token_type_ids", "masked_lm_labels", ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def parse_data(lst):\n\tfinallist = []\n\tfor element in lst:\n\t\tfinallist.append(parse_string_to_listint(element))\n\treturn finallist", "def _string_to_list(self, string):\n try:\n new_value = literal_eval(string)\n if isinstance(new_value, tuple):\n new_value = li...
[ "0.61151195", "0.59839565", "0.5974332", "0.58210355", "0.5757274", "0.57556516", "0.55773574", "0.55509937", "0.5486864", "0.5476954", "0.5440533", "0.53923553", "0.536124", "0.5351893", "0.5322014", "0.53092617", "0.52864146", "0.5284569", "0.52823085", "0.52330726", "0.521...
0.0
-1
Sets the entrez_gene_id of this DependencyValue.
def entrez_gene_id(self, entrez_gene_id: int): self._entrez_gene_id = entrez_gene_id
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def entrez_gene_id(self) -> int:\n return self._entrez_gene_id", "def setId(self, *args):\n return _libsbml.GeneProductRef_setId(self, *args)", "def geneset(self, value: Union[str, int, Geneset, List[str]]):\n # Geneset can be set only once, prevent modifications\n if self._geneset ...
[ "0.67873615", "0.61403245", "0.611064", "0.6075367", "0.6057369", "0.6039984", "0.59940135", "0.5907952", "0.58979064", "0.5892573", "0.58249176", "0.5787447", "0.57865304", "0.56604666", "0.56604666", "0.55464584", "0.55387324", "0.55053866", "0.54871595", "0.54668796", "0.5...
0.8379158
0
Gets the depmap_id of this DependencyValue.
def depmap_id(self) -> str: return self._depmap_id
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def depmap_id(self, depmap_id: str):\n\n self._depmap_id = depmap_id", "def get_id_from_map(self, map_storage):\n return self.map_to_id_dict[tuple(map_storage)]", "def config_map_key_ref(self) -> Optional[pulumi.Input['ConfigMapKeySelectorArgs']]:\n return pulumi.get(self, \"config_map_key...
[ "0.6746631", "0.6344805", "0.6061256", "0.6057096", "0.6054216", "0.60033745", "0.59501535", "0.5949619", "0.5876926", "0.5874605", "0.58658916", "0.5856508", "0.58435076", "0.58355504", "0.5834262", "0.58219707", "0.58077824", "0.57847595", "0.57827413", "0.57396287", "0.573...
0.85968
0
Gets the value of this DependencyValue.
def value(self) -> float: return self._value
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getValue(self):\n \n return self._value", "def get_value(self):\n return self._value", "def get_value(self):\n return self._value", "def get_value(self):\n return self._value", "def get_value(self):\n return self._value", "def get_value(self):\n ...
[ "0.8195019", "0.81398314", "0.81398314", "0.81398314", "0.80909437", "0.80909437", "0.8063737", "0.8063737", "0.8063737", "0.8051154", "0.8022494", "0.80180967", "0.8005264", "0.79721385", "0.79348075", "0.787489", "0.7847749", "0.7832519", "0.7832519", "0.7832519", "0.779700...
0.7164395
83
Sets the value of this DependencyValue.
def value(self, value: float): self._value = value
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_value(self, value):\n self.value = value", "def set_value(self, value):\n self.value = value", "def set_value(self, value):\n self.value = value", "def set_value(self, value):\n self.value = value\n return self", "def set_value(self, val):\n self._value = v...
[ "0.80339533", "0.80339533", "0.80339533", "0.7945059", "0.790969", "0.790969", "0.7848599", "0.77426815", "0.7470272", "0.7470272", "0.7470272", "0.7470272", "0.7470272", "0.7470272", "0.74376965", "0.73716277", "0.7341762", "0.7266695", "0.7243642", "0.7228463", "0.7228463",...
0.7112056
31
Get the value of an option as a BitArray.
def convert_to_raw(number, value, length): if length == 0: return BitArray() name, value_type, repeatable, default = defines.options[number] if value_type == defines.INTEGER: return BitArray(uint=value, length=length * 8) else: return BitArray(bytes=va...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def to_python(self, value):\n if value is None:\n return value\n value = super(BitOptionsField, self).to_python(value)\n return BitOptions(self.options.flags, value)", "def BitArray(self):\n from bitstring import BitArray,BitStream\n b = BitArray(bin=str(self))\n ...
[ "0.66437566", "0.6402383", "0.58543867", "0.58016294", "0.56171936", "0.5560527", "0.5466358", "0.5439997", "0.54380333", "0.5354907", "0.5350621", "0.5345034", "0.5332084", "0.5310892", "0.52912754", "0.52743125", "0.52704674", "0.52638006", "0.5239625", "0.52252233", "0.521...
0.61483306
2
create the flask application
def create_app(config_name): app = Flask(__name__) app.register_blueprint(v1, url_prefix="/api/v1/") return app
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def make_app() -> Flask:\n logger.info('creating flask application')\n app = Flask(\n 'pasta',\n static_url_path='/static',\n static_folder='./static',\n template_folder='./views')\n config.flask.SECRET_KEY = os.urandom(32)\n config.flask.SERVER_NAME = None\n app.config.f...
[ "0.83375126", "0.82552433", "0.82456756", "0.8193555", "0.8122414", "0.8114295", "0.8094171", "0.80241644", "0.8019721", "0.799822", "0.79981095", "0.7996134", "0.7979546", "0.79776955", "0.7973924", "0.7960496", "0.7957157", "0.7949987", "0.7945488", "0.79383224", "0.7930132...
0.0
-1
Provides the list of layer identifiers contained in the sample image configuration.
def image_layers() -> List: return [ "sha256:94b2db70f7476c98f4c4a1b7a922136e0c5600d2d74905407ad364dcca2bf852", "sha256:22426f366c51f26105aa9a6c6c9aea9fff0f21b7aabfc97870727577edaa3260", ]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getLayerNames(self):\n\t\treturn self._fileSystem.getLayerNames()", "def get_layer_ids(\n self,\n ):\n name_to_id = {}\n for n, _ in self.named_parameters():\n name_to_id[n] = 0\n return name_to_id", "def layer_names(self):\n return self._layer_names", "de...
[ "0.7185288", "0.7090247", "0.706421", "0.70301783", "0.67912436", "0.6676521", "0.6649249", "0.66144145", "0.63985777", "0.6390437", "0.62542367", "0.62128335", "0.610846", "0.6103511", "0.60818756", "0.60330904", "0.6018722", "0.601814", "0.6014871", "0.60119367", "0.6008937...
0.69504356
4
Provides the PGP signature value used in the signed sample image configuration.
def signature(request) -> str: return get_test_data(request, __name__, "signature", "r")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def signature(self):\n return self._signature", "def signature(self):\n return self._signature", "def signature(self):\n return self._signature", "def gpgSignMessage(message):\n sig = gpg.sign(message, default_key=primary, passphrase=passphrase)\n if sig and sig.data:\n ...
[ "0.6443978", "0.6443978", "0.6443978", "0.6300194", "0.6258484", "0.6235686", "0.6178694", "0.6102699", "0.6028254", "0.5952987", "0.5952987", "0.58946794", "0.58919924", "0.5889862", "0.58475566", "0.5840651", "0.5829108", "0.5828446", "0.58258265", "0.579163", "0.57731014",...
0.5845877
15
The front page (i.e. the first one the user sees when opening the plugin)
def index(): INTERFACE.add_dir(u'RÚV', 'view_category', '1') INTERFACE.add_dir(u'RÚV Íþróttir', 'view_category', '10') INTERFACE.add_dir(u'RÁS 1', 'view_category', '2') INTERFACE.add_dir(u'RÁS 2', 'view_category', '3') INTERFACE.add_dir(u'Rondó', 'view_category', 'rondo') INTERFACE.add_dir(u'Kr...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async def first_page(self):\n await self.show_page(1)", "def getHomePage(self):\n return self.home_url", "def home_page(self) -> str:\n return self._home_page", "def home_page(wagtail_site):\n return wagtail_site.root_page", "def show_homepage():\n\n return render_template(\"blan...
[ "0.6813221", "0.67775565", "0.67364997", "0.6708867", "0.6567549", "0.6503041", "0.64002484", "0.6398863", "0.6365566", "0.6355184", "0.6355184", "0.6353884", "0.6346947", "0.6331552", "0.63211", "0.630931", "0.6298694", "0.62859315", "0.62776345", "0.6243308", "0.62384903", ...
0.0
-1
Modified version of local.getpreferredencoding() that takes into account LC_ALL, LC_CTYPE, LANG env vars on windows and falls back to UTF8.
def getpreferredencoding(): default_encoding = locale.getpreferredencoding() or "UTF-8" # On Windows, we mimic git/linux by trying to read the LC_ALL, LC_CTYPE, LANG env vars manually # (on Linux/MacOS the `getpreferredencoding()` call will take care of this). # We fallback to UTF-8 if PLATFORM_IS_...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getpreferredencoding() -> str:\n return locale.getpreferredencoding() or \"UTF-8\"", "def _decode_preferred_encoding(s):\n\n enc = locale.getpreferredencoding()\n try:\n try:\n return s.decode(enc)\n except LookupError:\n enc = _DEFAULT_ENCODING\n return s....
[ "0.8454878", "0.7277579", "0.7258256", "0.69867796", "0.69867796", "0.6891246", "0.67377573", "0.65504634", "0.6491128", "0.6486564", "0.6376852", "0.63602215", "0.6139486", "0.6133816", "0.6012735", "0.5989784", "0.5932289", "0.59146476", "0.5913473", "0.584135", "0.58347076...
0.826158
1
Python 2 and 3 utility method that converts an obj to a DEFAULT_ENCODING encoded string in python 2 and to unicode in python 3.
def sstr(obj): if IS_PY2: # For lists and tuples in python2, remove unicode string representation characters. # i.e. ensure lists are printed as ['a', 'b'] and not [u'a', u'b'] if type(obj) in [list]: return [sstr(item) for item in obj] # pragma: no cover # noqa elif type...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def as_unicode(obj):\n if sys.version_info.major < 3 and isinstance(obj, str):\n obj = obj.decode('utf-8')\n return unicode(obj)", "def _to_unicode(obj, encoding=\"UTF-8\"):\n if isinstance(obj, basestring):\n if not isinstance(obj, unicode):\n obj = unicode(obj, encoding)\n ...
[ "0.7644025", "0.755192", "0.7398103", "0.70115936", "0.69780326", "0.69780326", "0.69780326", "0.69780326", "0.69780326", "0.69780326", "0.6934066", "0.6873156", "0.6844388", "0.6820616", "0.67755437", "0.6667062", "0.66473895", "0.6606481", "0.6585242", "0.65016085", "0.6445...
0.5859706
78
Write a Python program to test whether a given integer is pandigital number or not. Go to the editor From Wikipedia, In mathematics, a pandigital number is an integer that in a given base has among its significant digits each digit used in the base at least once. For example, 1223334444555556666667777777888888889999999...
def exercise_b2_106(): pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_pandigital(n):\n # Accept both str and int\n if isinstance(n, int):\n n = str(n)\n\n digits = len(n)\n if digits >= 10:\n return False\n string_n = str(n)\n for i in range(1, digits + 1):\n if str(i) not in string_n:\n return False\n return True", "def ...
[ "0.76610917", "0.7649925", "0.73522854", "0.703387", "0.7001561", "0.68951815", "0.68575543", "0.68211806", "0.68155396", "0.6787828", "0.66553587", "0.6649804", "0.66427374", "0.63987124", "0.63979477", "0.63703173", "0.62281746", "0.5998854", "0.58998597", "0.5842166", "0.5...
0.0
-1
Write a Python program to check whether a given number is Oddish or Evenish. A number is called "Oddish" if the sum of all of its digits is odd, and a number is called "Evenish" if the sum of all of its digits is even.
def exercise_b2_107(): pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def oddish_evenish(x):\n sum_of_digits = 0\n for digit in str(x):\n sum_of_digits += int(digit)\n print(sum_of_digits)\n return \"evenish\" if sum_of_digits % 2 == 0 else \"oddish\"", "def is_odd(number):\n return (number%2)==1", "def is_odd(number):\r\n return number % 2 != 0", "def...
[ "0.8086316", "0.7833978", "0.7781367", "0.77573967", "0.7747852", "0.7741073", "0.7709558", "0.74859923", "0.74442536", "0.7411788", "0.7398074", "0.73937905", "0.73855734", "0.73473847", "0.7344213", "0.733858", "0.7331003", "0.7327115", "0.7314306", "0.72839427", "0.726776"...
0.0
-1
Given a list of tuples of (heading_level, heading, anchor) for a given post, converts it to an htmlformatted table of contents, returned as a string.
def build_toc_html(toc_list: List[Tuple[int, str, str]]) -> str: if len(toc_list) > 1: toc_md = '### Table of Contents\n' for (heading_level, heading_string, heading_anchor) in toc_list[1:]: if heading_level == 1: raise TocError('Post title should be the only h1 heading.'...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def build_toc_list(post: Dict[str, Union[str, list]]) -> List[Tuple[int, str, str]]:\n soup_post = BeautifulSoup(post['post_body'], features='html.parser')\n\n toc_list = [(1, post['post_title'], post['slug'])]\n\n for i, heading in enumerate(soup_post.find_all(['h2', 'h3', 'h4'])):\n heading_level...
[ "0.6351105", "0.5982657", "0.56243294", "0.56194437", "0.5540732", "0.5518099", "0.55171895", "0.54003805", "0.5388581", "0.53514713", "0.5327741", "0.53090435", "0.53075725", "0.5297567", "0.5293061", "0.52873874", "0.5284656", "0.5271767", "0.52671885", "0.5259047", "0.5251...
0.6869855
0
Set the current estimated rotation.
def set_estimated_rotation(self, estimated_rotation: Real): self.estimated_rotation = estimated_rotation
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_rotation(self, angle):\n self._rotation = angle\n self._reset_slot_bounds()", "def set_rotation(self, roll, yaw, pitch):\n self.cam['rotation'] = [float(roll), float(yaw), float(pitch)]\n\n roll, pitch, yaw = self._zyxEulDegree2zxyEulDegree(roll, yaw, pitch)\n\n cmd = '...
[ "0.6998121", "0.68571615", "0.6744387", "0.6648271", "0.6616824", "0.64428943", "0.6426726", "0.6413668", "0.6412472", "0.6398895", "0.639101", "0.63786805", "0.63027686", "0.62522554", "0.6243455", "0.6211757", "0.61902434", "0.61650974", "0.6150688", "0.6136501", "0.6123616...
0.8422652
0
Sets the name of this SolidCompressibleMaterial.
def name(self, name): self._name = name
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def setName(self, name):\n self.name = str(name)", "def set_name(self, name):\n\t\tself.name_ = name", "def set_name(self, name):\n self.name = name", "def set_name(self, name):\n self.name = name", "def set_name(self, name):\n self.name = name", "def set_name(self, name):\n ...
[ "0.6763178", "0.6652872", "0.6638683", "0.6638683", "0.6638683", "0.6638683", "0.6638683", "0.6632487", "0.6627232", "0.6627232", "0.6589336", "0.65806997", "0.65806997", "0.65806997", "0.65806997", "0.65725225", "0.656662", "0.6558928", "0.6558928", "0.6512679", "0.65058213"...
0.64475584
87
Sets the specie of this SolidCompressibleMaterial.
def specie(self, specie): self._specie = specie
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def SetMaterial(self, *args):\n return _XCAFDoc.XCAFDoc_MaterialTool_SetMaterial(self, *args)", "def setMaterial(self,massFraction,polymer):\n M = Materials()\n num = self.material['Detector']['mt']\n if polymer == 'PS':\n self.material['Detector']['matString'] = M.GetPSLiF...
[ "0.5999788", "0.5831133", "0.5685761", "0.5541193", "0.5527724", "0.5476332", "0.54588085", "0.54423875", "0.5405903", "0.53493947", "0.532255", "0.52900195", "0.524629", "0.5232676", "0.5232676", "0.52144104", "0.52008504", "0.51791173", "0.51650006", "0.51639855", "0.514154...
0.65529335
0
Sets the transport of this SolidCompressibleMaterial.
def transport(self, transport): self._transport = transport
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def transport(self) -> Optional[pulumi.Input['TransportArgs']]:\n return pulumi.get(self, \"transport\")", "def transport(cls):\n cls.slot_index = len(TransportTypes)\n TransportTypes.append(cls)\n return cls", "def connection_made(self, transport: BaseTransport) -> None:\n self.transpor...
[ "0.5634682", "0.5466358", "0.52724445", "0.5223493", "0.51089907", "0.50751287", "0.5055767", "0.49586788", "0.49409735", "0.49355987", "0.48759288", "0.48704803", "0.48523515", "0.48500386", "0.48346213", "0.4814758", "0.47866875", "0.47753513", "0.4768678", "0.4757164", "0....
0.69955
0
Sets the electric_conductivity_type of this SolidCompressibleMaterial.
def electric_conductivity_type(self, electric_conductivity_type): self._electric_conductivity_type = electric_conductivity_type
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_electrical_type(self, connection_etype):\n self.etype = connection_etype", "def cabletype(self, cabletype):\n\n self._cabletype = cabletype", "def xtype(self):\n if not hasattr(self, '_xtype'):\n if 'Magnetic' in self.__class__.__name__:\n self._xtype = 'm...
[ "0.5923338", "0.5377314", "0.5218552", "0.489", "0.48390242", "0.47446054", "0.4728454", "0.4712814", "0.47000897", "0.46944737", "0.4681175", "0.4670484", "0.46447814", "0.46390542", "0.46387002", "0.46376756", "0.46267024", "0.4578256", "0.45311698", "0.4529894", "0.4525669...
0.88086885
0