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
Sets the window_glazing_type of this AdditionalFeatures.
def window_glazing_type(self, window_glazing_type): self._window_glazing_type = window_glazing_type
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_type(self, type_balle):\n self.type_balle = type_balle", "def setHgType(self, hgTypeToSet):\n self.hgType = hgTypeToSet", "def setHgType(self, hgTypeToSet):\n self.huntGroup.setHgType(hgTypeToSet)", "def SetAGWWindowStyleFlag(self, agwStyle):\r\n \r\n self._agwStyle...
[ "0.57397866", "0.57030624", "0.55855316", "0.50848544", "0.5073721", "0.5049477", "0.5046113", "0.50177735", "0.5008673", "0.49510878", "0.4948846", "0.49217704", "0.4882645", "0.4882032", "0.487688", "0.48735413", "0.48560783", "0.4835571", "0.481089", "0.47649255", "0.47649...
0.8794708
0
Sets the annual_heating_cost_in_pounds of this AdditionalFeatures.
def annual_heating_cost_in_pounds(self, annual_heating_cost_in_pounds): self._annual_heating_cost_in_pounds = annual_heating_cost_in_pounds
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def annual_hot_water_cost_in_pounds(self, annual_hot_water_cost_in_pounds):\n\n self._annual_hot_water_cost_in_pounds = annual_hot_water_cost_in_pounds", "def annual_lighting_cost_in_pounds(self, annual_lighting_cost_in_pounds):\n\n self._annual_lighting_cost_in_pounds = annual_lighting_cost_in_pou...
[ "0.7388474", "0.6862976", "0.59728867", "0.5376974", "0.5345229", "0.5297986", "0.5190811", "0.5188631", "0.5119922", "0.5081771", "0.50787556", "0.50479627", "0.50388014", "0.50256276", "0.49889365", "0.49553746", "0.49267343", "0.4907583", "0.48827207", "0.48795566", "0.487...
0.847852
0
Sets the annual_hot_water_cost_in_pounds of this AdditionalFeatures.
def annual_hot_water_cost_in_pounds(self, annual_hot_water_cost_in_pounds): self._annual_hot_water_cost_in_pounds = annual_hot_water_cost_in_pounds
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def annual_heating_cost_in_pounds(self, annual_heating_cost_in_pounds):\n\n self._annual_heating_cost_in_pounds = annual_heating_cost_in_pounds", "def annual_lighting_cost_in_pounds(self, annual_lighting_cost_in_pounds):\n\n self._annual_lighting_cost_in_pounds = annual_lighting_cost_in_pounds", ...
[ "0.7188057", "0.6531353", "0.5473915", "0.52946043", "0.51886946", "0.5110022", "0.506461", "0.50551677", "0.5053791", "0.504716", "0.5011629", "0.5000343", "0.49592116", "0.49584126", "0.49444562", "0.4944142", "0.49421972", "0.49002343", "0.48932138", "0.4882531", "0.484439...
0.8700374
0
Sets the annual_lighting_cost_in_pounds of this AdditionalFeatures.
def annual_lighting_cost_in_pounds(self, annual_lighting_cost_in_pounds): self._annual_lighting_cost_in_pounds = annual_lighting_cost_in_pounds
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def annual_heating_cost_in_pounds(self, annual_heating_cost_in_pounds):\n\n self._annual_heating_cost_in_pounds = annual_heating_cost_in_pounds", "def annual_hot_water_cost_in_pounds(self, annual_hot_water_cost_in_pounds):\n\n self._annual_hot_water_cost_in_pounds = annual_hot_water_cost_in_pounds"...
[ "0.6885476", "0.646175", "0.5166921", "0.51460433", "0.5105837", "0.50874466", "0.5086904", "0.48893318", "0.48871922", "0.4864471", "0.48582357", "0.48044312", "0.47992", "0.47737738", "0.47731444", "0.47694278", "0.47639585", "0.47530136", "0.4731688", "0.4727233", "0.46955...
0.8697074
0
Returns true if both objects are equal
def __eq__(self, other): if not isinstance(other, AdditionalFeatures): return False return self.__dict__ == other.__dict__
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __eq__(self, other):\n return are_equal(self, other)", "def __eq__(self, other):\n return are_equal(self, other)", "def __eq__(self,other):\n try: return self.object==other.object and isinstance(self,type(other))\n except: return False", "def __eq__(self, other):\n if i...
[ "0.8088132", "0.8088132", "0.8054589", "0.7982687", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", ...
0.0
-1
Returns true if both objects are not equal
def __ne__(self, other): return not self == other
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __ne__(self, other: object) -> bool:\n if self.__eq__(other):\n return False\n return True", "def __ne__(self, other: object) -> bool:\n return not self.__eq__(other)", "def __ne__(self, other) -> bool:\n return not self.__eq__(other)", "def __eq__(self, other):\n ...
[ "0.845611", "0.8391477", "0.8144138", "0.81410587", "0.8132492", "0.8093973", "0.80920255", "0.80920255", "0.80920255", "0.8085325", "0.8085325", "0.8076365", "0.8076365", "0.8065748" ]
0.0
-1
Onehot encoded tensor of string
def string_to_tensor(str, chars_index, include_eos=True, unknown_replace=True): tensor_length = len(str) + 1 if include_eos else len(str) tensor = torch.zeros(1, tensor_length, len(chars_index)) for li, letter in enumerate(str): if letter in chars_index: tensor[0, li, chars_index[letter]...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def one_hot_enc(self, word):\n word = self.text_to_int(word)\n word = Variable(torch.tensor(word))\n word = torch.nn.functional.one_hot(word, len(self.index_map))\n return word.transpose(0, 1)", "def one_hot_encode(x):\n # TODO: Implement Function\n output = np.zeros((len(x), 10...
[ "0.81329143", "0.7836819", "0.7769942", "0.7740352", "0.7671784", "0.76670223", "0.7609004", "0.7585184", "0.75791216", "0.756206", "0.7525315", "0.75058067", "0.7494086", "0.747759", "0.74726266", "0.7472051", "0.74386954", "0.74347407", "0.742705", "0.7375787", "0.73711103"...
0.0
-1
Onehot encoded tensor of list of words
def words_to_tensor(words, words_lookup_index, include_eos=True, numbers_replace=True, unknown_replace=True): if type(words) != list: raise Exception("Expected a list (not a string etc)") tensor_length = len(words) + 1 if include_eos else len(words) # tensor = np.zeros((1, tensor_length, len(words_lookup_in...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def one_hot_enc(self, word):\n word = self.text_to_int(word)\n word = Variable(torch.tensor(word))\n word = torch.nn.functional.one_hot(word, len(self.index_map))\n return word.transpose(0, 1)", "def encode_one_hot(s):\n all = []\n for c in s:\n x = np.zeros((INPUT_VOCAB_...
[ "0.80627745", "0.7716486", "0.77139974", "0.7699393", "0.7683449", "0.7665923", "0.7664355", "0.7661299", "0.76292604", "0.7620598", "0.7541594", "0.7492656", "0.74861956", "0.7448153", "0.7445126", "0.7432858", "0.74162346", "0.74150234", "0.74150234", "0.7389879", "0.738590...
0.0
-1
Attach a lot of summaries to a Tensor (for TensorBoard visualization).
def variable_summaries(self, var): if not self.MP.DISABLE_SUMMARY: with tf.name_scope('summaries'): mean = tf.reduce_mean(var) tf.summary.scalar('mean', mean) with tf.name_scope('stddev'): stddev = tf.sqrt(tf.reduce_mean(tf.square(var - mean))) tf.summary.scalar('stdd...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def build_summary(self):\n for k, v in self.metrics.items():\n tf.summary.scalar(k, v)\n \n self.summary_op = tf.summary.merge_all()", "def build_summaries(self):\n\n # Loss summary.\n tf.summary.scalar('loss', self.loss)\n\n merged = tf.summary.merge_all()\n self.summary_op = merged\n ...
[ "0.7071791", "0.6970259", "0.6970259", "0.6800256", "0.67872906", "0.67407334", "0.66669947", "0.66576326", "0.66193783", "0.66085786", "0.6595776", "0.65836215", "0.6581151", "0.655297", "0.6500364", "0.6459978", "0.64145213", "0.6294558", "0.62718755", "0.62713677", "0.6265...
0.5688791
68
Creates a safe prime of n_bits bits
def get_prime(n_bits: int) -> int: prime = None while True: prime = _generate_possible_prime(n_bits) if _check_is_prime(prime) and _check_is_prime((prime - 1) >> 1): # Safe prime break return prime
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _generate_possible_prime(n_bits: int = 128) -> int:\n xorshift = XORShift()\n possible_prime = xorshift.getrandbits(n_bits)\n\n # Make sure it is at least of the size n_bits bits\n possible_prime |= (1 << (n_bits - 1))\n\n # Make sure it is odd\n possible_prime |= 1\n\n return possible_pri...
[ "0.8424074", "0.7952582", "0.7518133", "0.742822", "0.73530567", "0.7227309", "0.70004624", "0.69871116", "0.6972627", "0.696377", "0.69620395", "0.6960163", "0.6945166", "0.69306606", "0.6926512", "0.6905931", "0.6899738", "0.68928635", "0.68928635", "0.68888646", "0.6887792...
0.7790044
2
Given a list of unordered data, return the fps neighbors (first neighbor is the sampled point).
def __init__(self, points, knn=16, **kwargs): super(FPSKNNGrouper, self).__init__() self.points = points # points number of Farthest Points Sampling self.knn = knn # number of k neighbors
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _find_neighbours(self):\n\n neighbours = []\n for i, p in enumerate(self.frame_0):\n nearests = np.where(np.linalg.norm(self.frame_0 - p, axis=1) <= self.R_n)[0]\n # delete self index\n index = np.argwhere(nearests==i)\n nearests = np.delete(nearests, i...
[ "0.64099556", "0.63660526", "0.5958945", "0.5950437", "0.5902727", "0.58451885", "0.5680398", "0.5640774", "0.5637594", "0.56226444", "0.5603767", "0.5523127", "0.55198956", "0.5514452", "0.54987186", "0.5475265", "0.54498756", "0.54331726", "0.54331726", "0.5415203", "0.5412...
0.0
-1
Validator for image uploading
def validate_image(attached): size = attached.file.size if size > settings.GIZA_IMAGE_SIZE_LIMIT: raise ValidationError("사진 파일은 100KB 이하로 올려주세요.")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def validate_image(image):\n msg = image_validation(image)\n if msg:\n raise ValidationError(msg)", "def validate_image(avatar_name):\n if avatar_name is None:\n return True\n\n ok_formats = [\n \".png\",\n \".jpg\",\n \".jpeg\"\n ]\n\n avatar_name = str(avata...
[ "0.7802354", "0.6967605", "0.69461703", "0.69047123", "0.6875441", "0.67250717", "0.67145497", "0.6631862", "0.6630777", "0.66226584", "0.6621506", "0.6616627", "0.6588324", "0.6547479", "0.65394026", "0.6501633", "0.6467978", "0.641413", "0.64106417", "0.6379215", "0.6356545...
0.7135189
1
Return true if at least one command is found on the command line.
def hasCommand(): args = sys.argv[1:] if '--help' in args: return False if '-h' in args: return False for arg in args: if arg and not arg.startswith('-'): return True return False
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_command_ancillary(args):\n # pylint: disable=bad-continuation\n if (\n # skip the parent check and only\n # determine if the parameter is present\n is_valid_executes(args, skip=True)\n ):\n return True\n return False", "def is_valid_command(args):\n if args.comma...
[ "0.75476253", "0.7315652", "0.7177804", "0.70393574", "0.681452", "0.67429733", "0.6677546", "0.6630747", "0.66033745", "0.65875995", "0.652084", "0.6506183", "0.64890695", "0.64350784", "0.6398998", "0.63341105", "0.6330846", "0.6327992", "0.63226783", "0.6311894", "0.630724...
0.77489024
0
Check if file is empty by confirming if its size is 0 bytes
def is_file_empty(file_path): # Check if file exist and it is empty return os.path.exists(file_path) and os.stat(file_path).st_size == 0
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def file_is_empty(file_name):\n try:\n if os.stat(file_name).st_size > 0:\n return False\n except Exception: # pylint: disable=broad-except\n pass\n\n return True", "def found_empty_file(self):\n self.is_empty = True", "def is_empty_file(fpath):...
[ "0.82181215", "0.8140408", "0.8068378", "0.78488314", "0.7599648", "0.7596634", "0.74580604", "0.7405964", "0.727476", "0.7051939", "0.7044965", "0.70049536", "0.6968705", "0.68893236", "0.68577814", "0.68557173", "0.68475395", "0.68218964", "0.68195176", "0.68195176", "0.679...
0.85844964
0
Get next value with lock for concurrent access.
async def locked_next(): async with lock: try: next_value = await anext(iterator) except StopAsyncIteration: return None return next_value
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def next_value(self):\n self._lock.acquire()\n try:\n id = self._next_id\n self._next_id += 1\n finally:\n self._lock.release()\n return id", "def get(self):\n # we use the with-statement here to automatically\n # release the lock whe...
[ "0.7766037", "0.7073409", "0.6818339", "0.6753151", "0.6640604", "0.66125697", "0.6603093", "0.65289444", "0.6525621", "0.65114576", "0.6497521", "0.6497521", "0.64617753", "0.640742", "0.6392871", "0.6357994", "0.6334995", "0.63230234", "0.63156945", "0.6292079", "0.62857634...
0.79237884
0
Tests that seasonal resolution hindcast predictions work.
def test_seasonal_resolution_hindcast(monthly_initialized, monthly_obs): seasonal_hindcast = ( monthly_initialized.rolling(lead=3, center=True).mean().dropna(dim="lead") ) seasonal_hindcast = seasonal_hindcast.isel(lead=slice(0, None, 3)) seasonal_obs = monthly_obs.rolling(time=3, center=True).m...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_pentadal_resolution_hindcast(daily_initialized, daily_obs):\n pentadal_hindcast = daily_initialized.resample(init=\"5D\").mean()\n pentadal_obs = daily_obs.resample(time=\"5D\").mean()\n pentadal_hindcast.lead.attrs[\"units\"] = \"pentads\"\n assert compute_hindcast(pentadal_hindcast, pentadal...
[ "0.7095887", "0.69212794", "0.69098943", "0.68421084", "0.67686075", "0.674219", "0.64660704", "0.63922846", "0.63648415", "0.6269937", "0.6237292", "0.61016476", "0.60239846", "0.5929092", "0.580805", "0.5796893", "0.5782806", "0.5770261", "0.5746235", "0.5683293", "0.566051...
0.78237224
0
Returns session config proto.
def create_config_proto(params): config = tf.ConfigProto() config.allow_soft_placement = True config.intra_op_parallelism_threads = params.num_intra_threads config.inter_op_parallelism_threads = params.num_inter_threads config.gpu_options.force_gpu_compatible = params.force_gpu_compatible return config
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def component_configuration():\n return ProtocolConfig(\"a_protocol\", \"an_author\", \"0.1.0\")", "def get_pb(cls):\n if cls.pb_singleton is None:\n # Init the config by reading conf file.\n with open(gflags.FLAGS.conf, 'r') as conf_file:\n cls.pb_singleton = text_...
[ "0.6063571", "0.5993571", "0.5940212", "0.59311754", "0.5809161", "0.5804188", "0.5694371", "0.5694371", "0.5680273", "0.5639866", "0.56208193", "0.5617359", "0.55974823", "0.55949265", "0.55916214", "0.5587071", "0.5583146", "0.55823916", "0.5579282", "0.55536556", "0.555229...
0.0
-1
Sets up the environment that BenchmarkCNN should run in.
def setup(params): os.environ['TF_ENABLE_WINOGRAD_NONFUSED'] = '1' os.environ['TF_SYNC_ON_FINISH'] = str(int(params.sync_on_finish)) argparse.ArgumentParser( formatter_class=argparse.ArgumentDefaultsHelpFormatter) # Sets GPU thread settings params = params._replace(gpu_thread_mode=params.gpu_thread_mo...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def setup_tf_environment() -> None:\n _setup_cpu_environment()\n _setup_gpu_environment()", "def _setup_test_infra(world_rank, world_size):\n os.environ['RANK'] = str(world_rank)\n os.environ['WORLD_SIZE'] = str(world_size)\n os.environ['MASTER_ADDR'] = '127.0.0.1'\n os.environ['MASTER_PORT'] =...
[ "0.7039897", "0.6370933", "0.6356852", "0.6353399", "0.6344304", "0.6198385", "0.6176934", "0.6174108", "0.6139378", "0.6128797", "0.60959816", "0.6062517", "0.6056935", "0.6046158", "0.5997585", "0.59735215", "0.5972749", "0.5954929", "0.5905744", "0.5900848", "0.5888725", ...
0.58541393
26
Loading VGG16 weights trained on ImageNet. Pytorch library has set of pretrained weights for VGG16. It can be find in below link
def load_pretrained_layers(self): # Current state of base state_dict = self.state_dict() param_names = list(state_dict.keys()) # VGG base with pretrained weights pretrained_state_dict = torchvision.models.vgg16(pretrained=True).state_dict() pretrained_param_names = list(...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def vgg16(pretrained=False, **kwargs):\n if pretrained:\n kwargs['init_weights'] = False\n model = VGG(make_layers(cfg['D']), **kwargs)\n if pretrained:\n model.load_state_dict(model_zoo.load_url(model_urls['vgg16']), strict=False)\n return model", "def vgg16(pretrained=False, **kwargs)...
[ "0.71958834", "0.69498736", "0.6946103", "0.6930777", "0.6882998", "0.686881", "0.6824245", "0.67993087", "0.67415476", "0.67379135", "0.6729036", "0.6677453", "0.6614767", "0.65058744", "0.6454305", "0.64470965", "0.6441963", "0.63713574", "0.6365838", "0.6363166", "0.633335...
0.7079707
1
View function for home page of site.
def index(request): # Generate counts of some of the main objects num_posts = Post.objects.all().count() num_category = Category.objects.all().count() # The 'all()' is implied by default. num_authors = Author.objects.count() context = { 'num_posts': num_posts, 'num...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def home(request):\n\treturn render(request, \"compta/home.html\")", "def home_page(request):\r\n return render(request, 'ez_main/home_page.html')", "def home(request):\r\n return render(request, 'home.html')", "def homepage(request):\n\treturn render(request, 'core/homepage.html')", "def homepage(req...
[ "0.8493426", "0.84268916", "0.83415145", "0.83306193", "0.82976943", "0.8295291", "0.8276345", "0.82545686", "0.82155704", "0.8132563", "0.81246215", "0.81224865", "0.8121264", "0.81049734", "0.8098485", "0.80935514", "0.80935514", "0.80935514", "0.80935514", "0.80935514", "0...
0.0
-1
Compute the constrained softmax (csoftmax);
def constrained_softmax(input_tensor, b, temp): # input_tensor = tf.reduce_mean(input_tensor) z = tf.reduce_sum(tf.exp(input_tensor / temp), axis=1, keep_dims=True) a = tf.exp(input_tensor / temp) * (b / temp) / z # a = tf.exp(input_tensor/temp) * b / z u = t...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def softmax(x):\n pass # TODO: Compute and return softmax(x)\n\n exp_x = np.exp(x)\n sum_x = np.sum(exp_x, axis=0)\n softmax = exp_x/sum_x\n \n return softmax", "def softmax(x):\n \"\"\"\"\"\"\n return exp(x) / sum(exp(x), axis=0)", "def softmax(x):\n #pass # TODO: Compute and...
[ "0.78560466", "0.7835292", "0.7820282", "0.77575976", "0.7694138", "0.76709664", "0.76704526", "0.7662938", "0.7661082", "0.7656146", "0.7652721", "0.7651058", "0.7638108", "0.76260686", "0.76043034", "0.76043034", "0.76043034", "0.76043034", "0.76043034", "0.76043034", "0.76...
0.76578796
9
Sun position unit vector
def unit_sun_r(sun_pos): return sun_pos / vector_magnitude(sun_pos[0], sun_pos[1], sun_pos[2])
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def unit(self):\r\n return Vector(self.x/self.length(), self.y/self.length())", "def unit():\n return Vec2d(0, 1)", "def tangeant_unit_vector(self, t):\n a = self.a0 + t * self.da\n ca = cos(a)\n sa = sin(a)\n v = Vector((sa, -ca))\n if self.da > 0:\n ...
[ "0.6851483", "0.6771579", "0.6357444", "0.61726576", "0.61319935", "0.6098751", "0.60735273", "0.607041", "0.60634553", "0.6035099", "0.6001652", "0.5976225", "0.59704524", "0.59430546", "0.59178925", "0.59092987", "0.5897357", "0.58889973", "0.5882439", "0.5877219", "0.58728...
0.7924792
0
Determines if the current page is the last one showing listings.
def is_last_page(soup): meta = soup.find("meta", {"property": "og:url"}) if meta.has_attr("content"): page_number = re.search(r".*/(\d+)_p/", meta.attrs["content"]) if page_number: return page_number.group(1) == "20" if re.search(r"/rentals/$", meta.attrs["content"]): ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_last_page(self):\n return self.page == self.last_page", "def is_last(self) -> Optional[bool]:\n return pulumi.get(self, \"is_last\")", "def is_last_allowable_page(self):\n if self.countable:\n return False\n if self.is_last_page:\n return False\n\n ...
[ "0.7672648", "0.67728835", "0.66980845", "0.6516898", "0.6355717", "0.6306561", "0.62889564", "0.62769735", "0.62538326", "0.62464654", "0.6204267", "0.61994034", "0.6089153", "0.60855496", "0.6039939", "0.6039939", "0.60371155", "0.602113", "0.602113", "0.602113", "0.6013965...
0.69576514
1
Given a command, mode, and a PATH string, return the path which conforms to the given mode on the PATH, or None if there is no such file. `mode` defaults to os.F_OK | os.X_OK. `path` defaults to the result of os.environ.get("PATH"), or can be overridden with a custom search path.
def which(cmd, mode=os.F_OK | os.X_OK, path=None): # Check that a given file can be accessed with the correct mode. # Additionally check that `file` is not a directory, as on Windows # directories pass the os.access check. def _access_check(fn, mode): retu...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def which(cmd, mode=os.F_OK | os.X_OK, path=None):\n # Check that a given file can be accessed with the correct mode.\n # Additionally check that `file` is not a directory, as on Windows\n # directories pass the os.access check.\n def _access_check(fn, mode):\n return (os.pat...
[ "0.74613327", "0.7454271", "0.72772473", "0.6944246", "0.6540553", "0.63965267", "0.6081426", "0.59041977", "0.58812714", "0.58786947", "0.5753893", "0.5733103", "0.5709695", "0.5671653", "0.5577198", "0.557545", "0.55516636", "0.54997337", "0.5452385", "0.5445319", "0.542585...
0.77115226
0
Path to test data directory.
def data_dir(uncover): return os.path.join(uncover, 'tests', 'test_data')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_data_dir(self):\n return os.path.join(os.path.dirname(os.path.abspath(__file__)), 'data')", "def data_dir():\n return os.path.join(os.path.dirname(_here), 'test', 'data')", "def data_dir():\n return os.path.join(os.path.dirname(__file__), 'test', 'data')", "def get_test_data_path():\n ...
[ "0.93090916", "0.9228948", "0.90788084", "0.8958091", "0.864455", "0.85699105", "0.81022733", "0.8095879", "0.8082996", "0.8054517", "0.80501175", "0.804273", "0.801872", "0.79468805", "0.792793", "0.78461945", "0.78139955", "0.78120965", "0.7735267", "0.7686884", "0.76713324...
0.8281919
6
Path to bootstrap output directory.
def sirsam_bs_out(sirsam_bootstrap, sirsam_target_path): return os.path.join(sirsam_bootstrap, 'out')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def outputdir():\n return __OUTPUT_DIR__", "def get_output_path():\n return os.getcwd() + \"/output/\"", "def output_path(self):\r\n return '%s/%s' % (os.path.abspath(os.path.dirname(__file__) + 'outputs'),\r\n self.identifier)", "def output_dir(self):\n return os...
[ "0.78226775", "0.75091505", "0.74435955", "0.741438", "0.73034644", "0.7293515", "0.7096003", "0.7057922", "0.69811285", "0.6971088", "0.6921561", "0.6900578", "0.68579984", "0.68556315", "0.6840672", "0.6832471", "0.6815121", "0.67833996", "0.6763623", "0.6721809", "0.665743...
0.6722821
19
Path to bootstrap config.
def sirsam_bs_conf(sirsam_bootstrap): return os.path.join(sirsam_bootstrap, 'bootstrapping.yaml')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def configPath(self):\n return os.path.dirname(__file__)", "def config_path():\n dir_ = os.path.dirname(__file__)\n demo_dir = os.path.join(dir_, '../..')\n return os.path.join(demo_dir, 'mike_dev.ini')", "def get_config_file_location():\n\n return './' + CONFIG_FILE_NAME", "def get_config...
[ "0.7491028", "0.7277288", "0.7198955", "0.7089994", "0.70728725", "0.70307755", "0.68940914", "0.6858863", "0.68588036", "0.68543637", "0.6846163", "0.6830477", "0.68003565", "0.6797498", "0.6796525", "0.6767383", "0.67546785", "0.6743908", "0.67113745", "0.67014086", "0.6696...
0.77958906
0
Path to resampling config.
def sirsam_rs_conf(sirsam_resample): return os.path.join(sirsam_resample, 'resampling.yaml')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def sirsam_resample(data_sirsam):\n return os.path.join(data_sirsam, 'resampling')", "def full_path(self, config_path=CONFIG_PATH):\n return os.path.join(config_path, self.filename)", "def config_data_path(experiment_name: str) -> Path: # pragma: no cover\n return experiment_dir(experiment_name) ...
[ "0.6881207", "0.5867884", "0.582824", "0.57341564", "0.56176305", "0.55958325", "0.5574562", "0.55086046", "0.54715735", "0.54648596", "0.5445687", "0.54362184", "0.5435501", "0.5434435", "0.5423719", "0.54234105", "0.5397872", "0.53904104", "0.53851056", "0.53814703", "0.536...
0.7818898
0
Transform literal to its string form. Looking up the variable in a literal is a matter of dividing by two, which is the same as a bitwise shift to the right.
def literal_to_string(self, literal): s = '!' if is_negated(literal) else '' return s + self.variables[literal >> 1]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def cython_literal(self, lit):\n if isinstance(lit, Number):\n cy_lit = str(lit).replace('-', 'Neg').replace('+', 'Pos')\\\n .replace('.', 'point')\n elif isinstance(lit, basestring):\n cy_lit = repr(lit)\n return cy_lit", "def format_literal...
[ "0.6115746", "0.60395455", "0.59917223", "0.5940928", "0.5854459", "0.5820236", "0.5741875", "0.55726326", "0.55214185", "0.54745287", "0.54635787", "0.5453568", "0.5339531", "0.5322462", "0.52889454", "0.52889454", "0.5287417", "0.52544516", "0.5246208", "0.5184462", "0.5171...
0.72383296
0
Forms a dict where for each component's number we have all the vertices in it.
def nodes_in_components( components: DefaultDict[int, int] ) -> DefaultDict[int, List]: content = defaultdict(list) for node, comp in components.items(): content[comp].append(node) return content
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_vertices(self):\n return str(self.vert_dict.keys())", "def criaGrafo(vertices):\n grafo = {}\n \n # cria uma lista de 1 a numero de vertices\n for v in range(1, vertices+1):\n grafo[v] = []\n \n return grafo", "def vertices(self):\n return list(self.graph_dict...
[ "0.6711244", "0.6648429", "0.6542306", "0.6473419", "0.6468677", "0.6421165", "0.6421165", "0.6421165", "0.640545", "0.6392779", "0.6334015", "0.6280855", "0.6201225", "0.6170471", "0.615769", "0.6145397", "0.6142944", "0.61419284", "0.613994", "0.6130737", "0.61163497", "0...
0.58261055
42
Computes the precision for the specified values of k
def accuracy(output, target, topk=(1,)): with torch.no_grad(): maxk = max(topk) batch_size = target.size(0) _, pred = output.topk(maxk, 1, True, True) pred = pred.t() correct = pred.eq(target.view(1, -1).expand_as(pred)) res = [] for k in topk: c...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def precision(gt, pred, k):\n k = min(len(pred), k)\n den = min(len(gt), k)\n return sum([int(pred[i] in gt) for i in range(k)]) / den", "def precision_at_k(r, k):\n assert k >= 1\n r = np.asarray(r)[:k] != 0\n if r.size != k:\n raise ValueError('Relevance score length < k')\...
[ "0.76427615", "0.74189496", "0.7418079", "0.72710466", "0.72456723", "0.72446615", "0.7237539", "0.72213703", "0.7210107", "0.7058935", "0.6852219", "0.6786084", "0.67836976", "0.6768417", "0.67273885", "0.67181736", "0.67181736", "0.67181736", "0.67181736", "0.67181736", "0....
0.0
-1
Change to bold + italics, as that's our style.
def visit_title_reference(self, node): self.body.append('\\emph{\\textbf{')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def asBoldItalic(self):\n\t\treturn TextFont( self.name[0:2]+'IB', self.size)", "def bold(string):\n return BOLD + string + RESETFORMAT", "def asBold(self):\n\t\treturn TextFont( self.name[0:2]+'B', self.size)", "def bold(self, string):\n return self.wrap(bold(string))", "def embolden(string):\n ...
[ "0.769831", "0.7124498", "0.7003055", "0.6908303", "0.6890068", "0.6794942", "0.6792447", "0.6708449", "0.67083156", "0.6652179", "0.6580752", "0.65469474", "0.6527881", "0.6407647", "0.6394216", "0.63806015", "0.63746125", "0.634515", "0.6237879", "0.62150794", "0.6194891", ...
0.54307437
62
Create HTML for run length encoding table.
def add_run_length_encoding_table(self, tag, line, rows, columns, row_labels=None, underline=False): if row_labels: columns += 1 with tag("table"): with tag("tbody"): for row_index in range(rows): with tag("tr"): for co...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_html_layout(self):\n page = \"\"\"<!DOCTYPE html>\n <!doctype html>\n <html lang=\"en\">\n <head>\n <meta charset=\"utf-8\">\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1, shrink-to-fit=no\">\n </head>\n </html...
[ "0.6594432", "0.63051206", "0.6278174", "0.62763023", "0.6197059", "0.61847097", "0.6164546", "0.6160518", "0.6137205", "0.6049625", "0.6006883", "0.59981126", "0.59635264", "0.59628034", "0.59621364", "0.5959026", "0.5952446", "0.59419113", "0.5933154", "0.5923689", "0.59076...
0.7343104
0
Calculate the KL divergence between p and q distributions on a grid of the feature space. Use only up to 3 dimensions, otherwise turns computationally expensive and intensive.
def kl_divergence(p_dist, q_dist, n_samples_per_axis=30, n_axis=2): global COUNTER if n_axis == 2: x = np.linspace(-1.0, 1.0, n_samples_per_axis) y = np.linspace(-1.0, 1.0, n_samples_per_axis) grids = np.meshgrid(x, y) elif n_axis == 3: x = np.linspace(-1.0, 1.0, n_sam...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def kl_divergence(self, params_q, params_p):\n means_q = params_q[:, :, 0]\n log_std_q = params_q[:, :, 1]\n\n means_p = params_p[:, :, 0]\n log_std_p = params_p[:, :, 1]\n\n std_q = torch.exp(log_std_q)\n std_p = torch.exp(log_std_p)\n\n kl_div = log_std_p - log_st...
[ "0.7582083", "0.7468207", "0.7441536", "0.72506154", "0.7139358", "0.7039632", "0.6946458", "0.6876695", "0.6834531", "0.6784169", "0.6720736", "0.67007035", "0.6687194", "0.66023445", "0.65938723", "0.65904456", "0.6588315", "0.65816873", "0.6546122", "0.6538691", "0.6499524...
0.75979996
0
Sets the model to stochastic evaluation mode. Override this to set your module to stochastic mode.
def stochastic_eval(self): if self.training: self.eval() self.stochastic = True # All recursive submodules, including self for module in self.modules(): if module is not self and isinstance(module, StochasticModule): module.stochastic_eval() ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_mode(self, mode):\n if mode == self._model_modes.INFERENCE:\n self.network.eval()\n else:\n self.network.train()\n return self", "def model_switch_to_training(self):\n pass", "def set_mode_train(self):\n self._set_mode('train')\n return se...
[ "0.6359612", "0.6211335", "0.6179895", "0.61752695", "0.6022713", "0.5916781", "0.58898914", "0.58591306", "0.5817347", "0.57757354", "0.5755513", "0.57445616", "0.5719638", "0.56991076", "0.56963784", "0.5668365", "0.56326824", "0.56243575", "0.5618857", "0.56135666", "0.558...
0.71500707
0
Strip no backspace characters out of the output
def test_strip_no_backspaces(): text = "Writing something" output = BaseConnection.strip_backspaces(text) assert output == "Writing something"
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def scrub_output(output):\n ansi_escape = re.compile(r'\\x1b[^m]*m')\n return ansi_escape.sub('', output)", "def strip_other_charcter():\n pass", "def squeeze(value):\r\n return re.sub(r\"[\\x00-\\x20]+\", \" \", value).strip()", "def test_strip_one_backspaces():\n text = \"Writing\\x08somethi...
[ "0.7086674", "0.6978313", "0.6797572", "0.6757039", "0.67523134", "0.66713244", "0.66710985", "0.66591233", "0.6636382", "0.66243845", "0.65375507", "0.6513357", "0.64421564", "0.64118475", "0.6386427", "0.63023925", "0.6301879", "0.63013834", "0.6292409", "0.62529516", "0.62...
0.6561933
10
Strip one backspace character out of the output
def test_strip_one_backspaces(): text = "Writing\x08something" output = BaseConnection.strip_backspaces(text) assert output == "Writingsomething"
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_strip_backspaces():\n text = \"Writing\\x08something\\x08\"\n output = BaseConnection.strip_backspaces(text)\n assert output == \"Writingsomething\"", "def scrub_output(output):\n ansi_escape = re.compile(r'\\x1b[^m]*m')\n return ansi_escape.sub('', output)", "def backspace(entry):\n ...
[ "0.6879016", "0.6864058", "0.68088466", "0.67938316", "0.6780626", "0.66877925", "0.6606588", "0.6563648", "0.65594405", "0.6495283", "0.6458312", "0.64496064", "0.6421529", "0.63885844", "0.6370434", "0.63115174", "0.62903535", "0.62670755", "0.6254752", "0.6247414", "0.6242...
0.71228254
0
Strip any backspace characters out of the output
def test_strip_backspaces(): text = "Writing\x08something\x08" output = BaseConnection.strip_backspaces(text) assert output == "Writingsomething"
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def scrub_output(output):\n ansi_escape = re.compile(r'\\x1b[^m]*m')\n return ansi_escape.sub('', output)", "def strip_other_charcter():\n pass", "def test_strip_one_backspaces():\n text = \"Writing\\x08something\"\n output = BaseConnection.strip_backspaces(text)\n assert output == \"Writings...
[ "0.710811", "0.690284", "0.68992615", "0.67880905", "0.66545844", "0.6594827", "0.65848833", "0.65636224", "0.6557524", "0.65460235", "0.6538637", "0.64922243", "0.6487964", "0.6485732", "0.64854014", "0.64391035", "0.64279306", "0.64158803", "0.6394289", "0.63304806", "0.633...
0.6837518
3
Threshold globally everything below the median to zero, and then MaxPool over a 7x7 kernel. This will fill every entry in the subgrids with the maximum value in the neighborhood. Binarize the image according to locations that are equal to their maximum (i.e. 1 when it is equal to the maximum value and 0 otherwise), and...
def forward(self, x: torch.Tensor) -> torch.Tensor: median = torch.median(x) global_threshold = torch.where(x < median, torch.tensor([0.]), x) maxpool = nn.MaxPool2d(7, stride=1, padding=3) pooled = maxpool(global_threshold) binarize = torch.where(pooled == x, torch.tens...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def max_pooling(img):\n result_img = img.copy()\n heignt, width, _ = result_img.shape\n for h in range(0, heignt, 8):\n for w in range(0, width, 8):\n result_img[h:h+8, w:w+8, 0] = np.max(result_img[h:h+8, w:w+8, 0])\n result_img[h:h+8, w:w+8, 1] = np.max(result_img[h:h+8, w:w...
[ "0.70798296", "0.60064656", "0.6003229", "0.59821975", "0.5846234", "0.5826767", "0.5822811", "0.5811246", "0.5801195", "0.57726026", "0.57537115", "0.5741464", "0.57412094", "0.5740231", "0.5740231", "0.5728427", "0.57163906", "0.5714878", "0.5713629", "0.5708152", "0.570760...
0.57934994
9
struct.unpack 64bit unsigned int
def unpack64(data): return struct.unpack('<Q', data)[0]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def u64(value: bytes, endian: str = \"little\", sign: bool = False) -> int:\n return unpack(value, 64, endian, sign)", "def unpack_int64(data):\n value = unpack(DecodeUtils.INT64_BYTE_FORMAT, data[:8])[0]\n return value, 8", "def ReadUInt64(self, endian=\"<\"):\n return self.unpack('%sQ...
[ "0.7337515", "0.7291455", "0.70735544", "0.70528245", "0.6859246", "0.6752526", "0.6628481", "0.6615263", "0.6587468", "0.6587468", "0.6580051", "0.6574504", "0.657394", "0.6571775", "0.6461917", "0.64502436", "0.6379707", "0.63772327", "0.6362134", "0.6348984", "0.6336245", ...
0.74838567
0
struct.unpack 32bit unsigned int
def unpack32(data): return struct.unpack('<I', data)[0]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def u32(d):\n return unpack('<I', d)[0]", "def unpack_uint32(data):\n value = unpack(DecodeUtils.UINT32_BYTE_FORMAT, data[:4])[0]\n return value, 4", "def read_uint32(self):\n bytes = self.data[:4]\n value = struct.unpack('!I',bytes)[0]\n self.data = self.data[4:]\n ...
[ "0.7671511", "0.74603957", "0.74409455", "0.7307866", "0.7171026", "0.71099955", "0.6816044", "0.6803274", "0.679638", "0.67508364", "0.6709867", "0.6625973", "0.6625973", "0.6561455", "0.6561455", "0.6543186", "0.6540487", "0.6536308", "0.646474", "0.6462641", "0.64550704", ...
0.8090075
0
Generates a JWT encoding the data in `dictionary` with an additional keyvalue entry which describes how long from now the token expires.
def generate_token(dictionary: dict, expiration: datetime.timedelta): dictionary['expiration'] = (datetime.datetime.utcnow() + expiration).timestamp() return jwt.encode(dictionary, current_app.config['TOKEN_SECRET_KEY'], algorithm='HS256')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _generate_jwt_token(self):\n import jwt\n from datetime import datetime, timedelta\n from django.conf import settings\n\n dt = datetime.now() + timedelta(days=60)\n\n token = jwt.encode({\n 'id': self.pk,\n 'username': self.username,\n 'exp': ...
[ "0.65434813", "0.6512368", "0.63321507", "0.6095236", "0.60330266", "0.6012122", "0.60032386", "0.5992282", "0.5899493", "0.5899071", "0.5895014", "0.5850155", "0.5837455", "0.5821893", "0.58200026", "0.57397145", "0.57029384", "0.56895727", "0.56874955", "0.56823957", "0.567...
0.79876447
0
Load a valid YAML config
def test_load(self): with NamedTemporaryFile(suffix=".yaml") as config: with open(config.name, "w") as write_stream: write_stream.write( """ pipeline: - !LinearController low_utilisation: 0.9 ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def load_yaml(config):\n try:\n return yaml.safe_load(config)\n except yaml.YAMLError as e:\n raise Exception('Error occurred while parsing YAML: {}'.format(e))", "def load_config(filename):\n with open(filename, \"r\") as stream:\n try:\n global CONFIG\n CONFI...
[ "0.78422004", "0.7696944", "0.7660286", "0.7658057", "0.75203407", "0.75120354", "0.7475227", "0.7423036", "0.7402705", "0.73566264", "0.7343501", "0.73430413", "0.7334165", "0.7333319", "0.7317944", "0.7307667", "0.7276558", "0.7270611", "0.7262618", "0.7260277", "0.7246272"...
0.0
-1
Sets the property zip code
def zipcode(self, zipcode): self._zipcode = zipcode
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def zip_code(self, zip_code):\n\n self._zip_code = zip_code", "def zip_code(self, value):\n regex = config.get('validators', 'zip_code')\n zipcode = re.search(regex,\n value)\n if not zipcode:\n raise ZipCodeError(\"ZipCodeError: 'zip_code' must b...
[ "0.8063274", "0.72263193", "0.7218265", "0.69565064", "0.6854635", "0.6693834", "0.6617669", "0.6424577", "0.6424577", "0.6424577", "0.64047813", "0.6381943", "0.6219688", "0.6131205", "0.60806584", "0.57415175", "0.57322216", "0.57199264", "0.57005495", "0.5653463", "0.56534...
0.8280006
0
Returns a list with the named_predictions (or more depending on ) Also returns a saliency map of the imgs
def _visualize_cam_w_s(self, imgs, names="2DPositions"): feed_dict = {} feed_dict[self.images_tf] = imgs conv6_val, output_val = self.sess.run([self.conv6, self.output],feed_dict=feed_dict) preds = output_val preds_order = preds.argsort( axis=1 )[:,::-1] best_preds = preds.argmax( axis=1 ) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def predict_all(self, imgs):\n return self._predict(imgs)", "def convert_predictions_to_image_summaries(hook_args):\n decode_hparams = hook_args.decode_hparams\n if not decode_hparams.display_decoded_images:\n return []\n predictions = hook_args.predictions[0]\n\n # Display ten random inputs and ou...
[ "0.64799243", "0.6398349", "0.6308719", "0.622036", "0.62094873", "0.6194067", "0.61841846", "0.61537486", "0.61372584", "0.6130253", "0.61022663", "0.6050701", "0.600578", "0.59851444", "0.5947488", "0.5937418", "0.59310234", "0.59310067", "0.5928132", "0.59254014", "0.59181...
0.0
-1
Returns a list with the named_predictions (or more depending on ) Also returns a saliency map of the imgs
def _visualize_cam_s(self, imgs, summed_filters=True, names="2DPositions"): feed_dict = {} feed_dict[self.images_tf] = imgs conv6_val, output_val = self.sess.run([self.conv6, self.output],feed_dict=feed_dict) preds = output_val # <preds> to confidence (to softmax) softmaxs = f_sotfmax(preds) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def predict_all(self, imgs):\n return self._predict(imgs)", "def convert_predictions_to_image_summaries(hook_args):\n decode_hparams = hook_args.decode_hparams\n if not decode_hparams.display_decoded_images:\n return []\n predictions = hook_args.predictions[0]\n\n # Display ten random inputs and ou...
[ "0.64799243", "0.6398349", "0.6308719", "0.622036", "0.62094873", "0.6194067", "0.61841846", "0.61537486", "0.61372584", "0.6130253", "0.61022663", "0.6050701", "0.600578", "0.59851444", "0.5947488", "0.5937418", "0.59310234", "0.59310067", "0.5928132", "0.59254014", "0.59181...
0.0
-1
Initialize a Linear or Convolutional layer.
def init_layer(layer, nonlinearity='leaky_relu'): nn.init.kaiming_uniform_(layer.weight, nonlinearity=nonlinearity) if hasattr(layer, 'bias'): if layer.bias is not None: layer.bias.data.fill_(0.)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def init_layer(layer):\n \n if layer.weight.ndimension() == 4:\n (n_out, n_in, height, width) = layer.weight.size()\n n = n_in * height * width\n \n elif layer.weight.ndimension() == 2:\n (n_out, n) = layer.weight.size()\n\n std = math.sqrt(2. / n)\n scale = std * math.sqrt...
[ "0.71585476", "0.6946555", "0.675435", "0.67083526", "0.6665737", "0.665054", "0.66405225", "0.66383994", "0.6587422", "0.6569476", "0.6534945", "0.6534624", "0.65278125", "0.6458321", "0.6450799", "0.6441936", "0.64249116", "0.6423872", "0.6368915", "0.63685584", "0.6366803"...
0.65386915
10
Initialize a Batchnorm layer.
def init_bn(bn): bn.bias.data.fill_(0.) bn.running_mean.data.fill_(0.) bn.weight.data.fill_(1.) bn.running_var.data.fill_(1.)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def batchnorm_init(m, kernelsize=3):\r\n n = kernelsize**2 * m.num_features\r\n m.weight.data.normal_(0, math.sqrt(2. / (n)))\r\n m.bias.data.zero_()", "def dncnn_batchnorm_init(m, kernelsize=3, b_min=0.025):\n n = kernelsize**2 * m.num_features\n m.weight.data.normal_(0, math.sqrt(2. / (n)))\n ...
[ "0.7382624", "0.71817577", "0.7181327", "0.6949718", "0.67419326", "0.6725722", "0.66990584", "0.66967344", "0.66012853", "0.65898055", "0.65177745", "0.64865506", "0.6468668", "0.64600116", "0.6428001", "0.64219517", "0.6387554", "0.63616383", "0.6357548", "0.635414", "0.632...
0.5826963
93
Returns the corrupted version of the input x.
def get_corrupted_input(x, corrupt_lvl): mask = np.random.RandomState(1).binomial(size=x.shape, n=1, p=(1. - corrupt_lvl)) return mask.astype(np.float32) * x
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _corrupt(self, x):\n noise = self.s_rng.normal(\n size=x.shape,\n avg=0.,\n std=self.corruption_level,\n dtype=theano.config.floatX\n )\n\n return noise * self.variance_map + x", "def get_corrupted_input(self, input):\n return self.thean...
[ "0.6968712", "0.6322659", "0.6209984", "0.62051606", "0.5759763", "0.57580286", "0.5696416", "0.55372584", "0.54685783", "0.54180473", "0.5317328", "0.53071034", "0.52875096", "0.5271531", "0.52702314", "0.5257406", "0.52477264", "0.52360266", "0.5225359", "0.519407", "0.5192...
0.6804757
1
Return whether two IP sets contain exactly the same addresses.
def __eq__(self, other): if not isinstance(other, IPSet): return False return ipset.ipset_is_equal(self.set, other.set)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def are_equal(self, sp1, sp2):\n set1 = set(sp1.elements)\n set2 = set(sp2.elements)\n return set1.issubset(set2) or set2.issubset(set1)", "def is_same_set(self, item1, item2):\n res = False\n for s in self._data:\n if item1 in s and item2 in s:\n res ...
[ "0.7218479", "0.68672657", "0.6617279", "0.6606687", "0.6606687", "0.655697", "0.65538234", "0.6546258", "0.6541315", "0.6509365", "0.64934313", "0.6431487", "0.6408266", "0.6399278", "0.63746685", "0.6364972", "0.6360046", "0.6347552", "0.633242", "0.6332059", "0.6325906", ...
0.68722737
1
Return whether an IP set is empty.
def is_empty(self): return ipset.ipset_is_empty(self.set)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __nonzero__(self):\n\n return not ipset.ipset_is_empty(self.set)", "def is_empty(self):\n\n return ipset.ipmap_is_empty(self.map)", "def isEmpty(self):\n return len(self._pool) == 0", "def is_empty(self):\n return len(self._pool) == 0", "def is_empty(self) -> bool:\n ...
[ "0.8127448", "0.7930414", "0.7647775", "0.7524034", "0.73700166", "0.7339079", "0.73206925", "0.73206925", "0.73117894", "0.73114514", "0.73091435", "0.73082113", "0.7304617", "0.7291456", "0.7291456", "0.7291456", "0.7291456", "0.7291456", "0.7291456", "0.7291456", "0.728926...
0.8762385
0
Return whether an IP map is empty.
def is_empty(self): return ipset.ipmap_is_empty(self.map)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __nonzero__(self):\n\n return not ipset.ipmap_is_empty(self.map)", "def is_empty(self):\n\n return ipset.ipset_is_empty(self.set)", "def isEmpty(map ):\n empty = True\n for pos in range(lt.size(map['table'])):\n entry = lt.getElement (map['table'], pos+1)\n if (entry['key'...
[ "0.83483917", "0.75399715", "0.7489818", "0.72315997", "0.7129968", "0.7102832", "0.7068059", "0.7054125", "0.7046441", "0.7046441", "0.7043564", "0.7029271", "0.70288944", "0.70288944", "0.70193815", "0.7010226", "0.7004682", "0.7001407", "0.69977313", "0.6992701", "0.698996...
0.8998053
0
Computes the total energy of the system for a given position
def total_energy(positions: pd.DataFrame, velocities: pd.DataFrame ) -> int: pot = positions.abs().sum(axis=1) kin = velocities.abs().sum(axis=1) return sum(pot*kin)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def compute_system_energy(positions: pd.DataFrame,\n steps: int = 10\n ) -> int:\n\n velocities = pd.DataFrame({'x': [0]*len(positions),\n 'y': [0]*len(positions),\n 'z': [0]*len(positions)})\n\n for...
[ "0.7529577", "0.7446199", "0.74258494", "0.7417685", "0.7409086", "0.7384921", "0.7366527", "0.730405", "0.7216314", "0.72028726", "0.7181386", "0.7167144", "0.7158759", "0.712209", "0.705574", "0.692149", "0.69153076", "0.68737227", "0.679874", "0.6792858", "0.6779364", "0...
0.7319196
7
Helper function to determine if a variable x is null or not.
def _is_nan(self, x: any) -> bool: return isinstance(x, float) and math.isnan(x)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def exist(x):\n return x is not None", "def has_value(var) :\n return var != None", "def is_null(var):\r\n if var is None or not var: return True\r\n if any(isinstance(var, s) for s in [str, list, tuple, set]) and len(var) == 0: return True\r\n if isinstance(var, str) and var == '': return True\r\...
[ "0.7328554", "0.71155214", "0.6900641", "0.66914225", "0.6663548", "0.6407877", "0.63091034", "0.6227551", "0.62274116", "0.6156314", "0.60532653", "0.6002863", "0.59732443", "0.59719497", "0.5966999", "0.5964991", "0.5900165", "0.58760357", "0.58600163", "0.58230263", "0.581...
0.5905992
16
Crossentropy loss function, naive implementation (with loops) Inputs have dimension D, there are C classes, and we operate on minibatches of N examples.
def cross_entropoy_loss_naive(W, X, y, reg): # pylint: disable=too-many-locals # Initialize the loss and gradient to zero. loss = 0.0 dW = np.zeros_like(W) ############################################################################ # TODO: Compute the cross-entropy loss and its gradient using ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def cross_entropy(\n **kwargs\n) -> Callable:\n return categorical_crossentropy", "def cross_entropy(X, y, using_onehot=True):\n\tM = y.shape[0]\n\tif using_onehot :\n\t\tlog_likelihood = -np.log(np.max(X * y, -1))\n\telse:\n\t\tlog_likelihood = -np.log(X[range(M), y]) # 找到y对应的那个类别所对应的logit\n\tloss = n...
[ "0.69495684", "0.69177157", "0.68428034", "0.6814304", "0.6758068", "0.6702218", "0.6642081", "0.6596823", "0.6578491", "0.65644884", "0.6563975", "0.65403014", "0.65192664", "0.65192664", "0.6503482", "0.6499705", "0.64945656", "0.64891076", "0.6480807", "0.6467565", "0.6458...
0.63205487
33
Crossentropy loss function, vectorized version. Inputs and outputs are the same as in cross_entropoy_loss_naive.
def cross_entropoy_loss_vectorized(W, X, y, reg): # Initialize the loss and gradient to zero. loss = 0.0 dW = np.zeros_like(W) ############################################################################ # TODO: Compute the cross-entropy loss and its gradient without explicit # # loops. Store...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def cross_entropy_loss():\n return nn.CrossEntropyLoss()", "def cross_entropy(y_prob,y):\n from numpy import log, sum\n m = y.shape[0]\n p = y_prob\n log_likelihood = -log(p[range(m),y])\n loss = sum(log_likelihood) / m\n return loss", "def cross_entropy(true, pred, axis=-1, epsilon=1e-7):...
[ "0.73509604", "0.7306688", "0.72734684", "0.7256321", "0.7250249", "0.72487295", "0.724559", "0.72013646", "0.7191307", "0.7190898", "0.7174809", "0.7104302", "0.7094377", "0.7070888", "0.70589197", "0.7036073", "0.70332295", "0.70327854", "0.70228267", "0.7020257", "0.698976...
0.6828674
29
Set instance attributes and create slack client
def __init__(self, config): self.config = config self.slack_client = SlackClient(self.config.SLACK_TOKEN)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self, config):\n self._slack_client = self._connect(config[\"slack_bot_token\"])\n self.bot_id = self._get_user_id()\n self.default_channel = config[\"default_channel\"]", "def __init__(self):\n super().__init__(\n websocket=Mock(),\n slack_access_to...
[ "0.6797116", "0.67638814", "0.6660995", "0.6396746", "0.63272035", "0.6321388", "0.62868756", "0.6227542", "0.62020427", "0.61476713", "0.61382717", "0.61299807", "0.6118268", "0.6053337", "0.60437185", "0.6025882", "0.5986845", "0.5973288", "0.59551275", "0.59497654", "0.594...
0.71584666
0
Post to Slack channel defined in configuration
def post_to_channel(self, text): self.slack_client.api_call( "chat.postMessage", channel=self.config.SLACK_CHANNEL, text=text, username='pybot', icon_emoji=':robot_face:' )
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def slack_post(title=\"Test\", message=\"Hello world!\", color=\"#999999\"):\n attach = dict(fallback=message, title=title, text=message, color=color)\n r = client.chat_postMessage(\n channel=CHANNEL, attachments=[attach], username=f\"{HOSTNAME} DBA alert\"\n )\n return r", "def post_slack_msg...
[ "0.6974925", "0.68494374", "0.68440264", "0.68244267", "0.6739935", "0.66531885", "0.65750635", "0.65197766", "0.6519005", "0.6491231", "0.648801", "0.6487364", "0.648424", "0.6365831", "0.63640493", "0.6212058", "0.6177811", "0.6165628", "0.6150504", "0.6147322", "0.61369663...
0.75266784
0
Return True if the user is authenticated.
def is_authenticated(self): return self.authenticated
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_authenticated(self):\n return self.user is not None and self.state == AuthenticationOptions.authenticated", "def is_authenticated(self):\n return bool(get_auth_token())", "def is_authenticated(self):\n return True", "def is_authenticated(self):\n return True", "def is_aut...
[ "0.8739372", "0.87086535", "0.86574197", "0.86574197", "0.86574197", "0.86574197", "0.86574197", "0.86574197", "0.86574197", "0.8613915", "0.8609252", "0.8578436", "0.83723366", "0.83587176", "0.8258534", "0.82273275", "0.8209421", "0.8200795", "0.8174884", "0.81280386", "0.8...
0.8580474
20
False, as anonymous users aren't supported.
def is_anonymous(self): return False
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_anonymous():\n return False", "def is_anonymous(self):\r\n return False", "def is_anonymous(self):\n return False", "def is_anonymous_access_allowed(self):\n return self._is_anonymous_access_allowed", "def is_authenticated(self):\n return False", "def _is_anonymous_u...
[ "0.85624325", "0.83800477", "0.82456774", "0.7815806", "0.7576082", "0.72904116", "0.72619915", "0.72347337", "0.72347337", "0.72347337", "0.72347337", "0.72347337", "0.72347337", "0.72347337", "0.72338396", "0.715833", "0.7106215", "0.70944613", "0.70567185", "0.70209265", "...
0.8360155
15
We perform several subprocess.check_output calls, but we want to only mock one of them at a time. This function helps us do that.
def mock_subprocess(case_tuple): def fn(inputs, **kwargs): while len(inputs) >= 2 and inputs[1] in ['--git-dir', '--work-tree']: # Remove `--git-dir <arg>` from git command. # This is just a convenience / increased readability conditional inputs = inputs[0:1] + inputs[3:]...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def run_output(mocker):\n return mocker.patch('d.subprocess.check_output')", "def run(mocker):\n return mocker.patch('d.subprocess.check_call')", "def test_subprocess_check_command_type(self, mocker):\n mocker.stopall()\n\n test_command = [\"who\", \"-b\"]\n test_name = \"test_who\"\...
[ "0.8127237", "0.7088371", "0.6627398", "0.6595417", "0.65784854", "0.6552999", "0.6530796", "0.6462103", "0.6422113", "0.6417455", "0.6387821", "0.6315237", "0.6315186", "0.6289824", "0.6253521", "0.62160534", "0.6207354", "0.6163086", "0.61532134", "0.6119532", "0.61189353",...
0.69764817
2
Utility method that returns the first child element identified by its name.
def getChildElementByTagName(element: org.w3c.dom.Element, string: str) -> org.w3c.dom.Element: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def first(self, name: str) -> etree.Element:\n return self.from_name(name)[0]", "def first_child(tree, name, recurse = False):\n name = name.lower()\n if not tree.hasChildNodes():\n return None\n for child in tree.childNodes:\n if child.nodeType != child.ELEMENT_NODE:\n c...
[ "0.83441937", "0.7863166", "0.78584886", "0.7703127", "0.7387351", "0.7372053", "0.72751904", "0.72557247", "0.71973526", "0.7178503", "0.71554446", "0.70782673", "0.7065373", "0.7054879", "0.696399", "0.68811095", "0.68765306", "0.67918646", "0.67334455", "0.67287636", "0.66...
0.5961317
36
Givne a sent as str return ngrams as a list of tuple
def word_ngrams(sent, n): # EXAMPLES # > word_ngrams(tokenize('hello world'), 1) # [('hello',), ('world',)] # > word_ngrams(tokenize('hello world'), 2) # [('<s>', 'hello'), ('hello', 'world'), ('world', '</s>')] # YOUR CODE HERE tokenized_sent = tokenize(sent) if n != 1: tokenized_sent.insert(0, '<s>') ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def iter_ngrams(self, sentence, n):\n return [tuple(sentence[i : i+n]) for i in range(len(sentence)-n+1)]", "def sent2ngrams(text, n=3):\n if n == \"word\":\n return text.split()\n return list(chain(*[word2ngrams(i,n) for i in text.lower().split()]))", "def ngrams(words, n=1):\n return [...
[ "0.7276324", "0.7268101", "0.7165608", "0.7099095", "0.7023482", "0.6944611", "0.6894021", "0.6889632", "0.6856115", "0.6845594", "0.6821956", "0.6743374", "0.6728121", "0.6705199", "0.66921085", "0.65555626", "0.654637", "0.6523114", "0.65055984", "0.64340365", "0.6419373", ...
0.71661574
2
reinitialize all servers and their channels
def set_servers(self, server_infos): self.remove_servers_channels() for server_info in server_infos: server_section = server_info['server'] server_name = server_section.name self._init_section_id(server_section) self._sections[self._server_hash(server_name...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def reset_servers(self):\n\n servers = []\n for _, g in self.groups.items():\n g.get_servers(servers)\n\n for s in servers:\n self.servers[s.vid] = s", "def reinitialize_all(cls):\n cls._inited.clear()", "async def reinit_manager(ctx):\n await ext_manager.re...
[ "0.7014916", "0.6924551", "0.6457707", "0.6437192", "0.6390924", "0.63441694", "0.6144403", "0.609468", "0.60830975", "0.5959147", "0.5954305", "0.5942178", "0.59123576", "0.58808565", "0.5879842", "0.58571106", "0.5795714", "0.57858443", "0.57686675", "0.5763447", "0.5761091...
0.5573355
39
This function prints and plots the confusion matrix. Normalization can be applied by setting `normalize=True`.
def plot_confusion_matrix(cm, classes, normalize=False, title='Confusion matrix', cmap=plt.cm.Blues): if normalize: #cm = cm.astype('float') / cm.sum(axis=1)[:, np.newaxis] cm = cm.astype('float') / np.sum(cm.ravel()) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def plot_confusion_matrix(cm, classes=[0,1], normalize=False, title='Confusion matrix', print_matrix=False):\n\n if normalize:\n cm = cm.astype('float') / cm.sum(axis=1)[:, np.newaxis]\n print(\"Normalized confusion matrix\")\n else:\n print('Confusion matrix, without normalization')\n\n...
[ "0.8194862", "0.80949175", "0.8029915", "0.79941195", "0.7991258", "0.7980955", "0.7976606", "0.79610753", "0.79590565", "0.79378676", "0.7934962", "0.7934504", "0.79313844", "0.7926313", "0.7924577", "0.79241234", "0.7923211", "0.7923023", "0.7921931", "0.7917871", "0.791609...
0.8019153
3
Set the log level for given logger and all handlers
def set_level(log_or_name, level): if isinstance(log_or_name, str): log = get_logger(log_or_name) else: log = log_or_name log.setLevel(level) for handler in log.handlers: handler.setLevel(level)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def setLevel(self, level):\n handlers = self.logger.handlers\n for handler in handlers:\n handler.setLevel(level)", "def setLevel(level:int)->None:\n for logger in loggers:\n logger.setLevel(level)", "def configure(logger, level):\n logger.setLevel(level)\n for d_handler in...
[ "0.7544083", "0.74587137", "0.7368688", "0.7325677", "0.7323056", "0.7320412", "0.73035693", "0.72241944", "0.7175546", "0.7122466", "0.7071112", "0.69899726", "0.6974298", "0.6961429", "0.69023854", "0.68229544", "0.68148625", "0.67883754", "0.674714", "0.67307884", "0.67267...
0.7812011
0
A property to set the start date from which the metric is fetched
def start(self): return self._from
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_start_date(self, date):\n pass", "def start_date(self, start_date):\n self._start_date = start_date", "def start_date(self, start_date):\n \n self._start_date = start_date", "def start_date(self, start_date):\n\n self._start_date = start_date", "def start_date(sel...
[ "0.7651095", "0.74797356", "0.73640335", "0.73112905", "0.73112905", "0.73112905", "0.73112905", "0.73112905", "0.73112905", "0.73112905", "0.73112905", "0.73112905", "0.722052", "0.71963406", "0.7039021", "0.7039021", "0.7039021", "0.7039021", "0.6943389", "0.6943389", "0.69...
0.0
-1
A property to set the end date from which the metric is fetched
def end(self): return self._until
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_end_date(self, date):\n pass", "def end_date(self, end_date):\n self._end_date = end_date", "def end_date(self):\n return self.__end_date", "def end_date(self, end_date):\n\n self._end_date = end_date", "def end_date(self, end_date):\n\n self._end_date = end_date"...
[ "0.76984525", "0.753401", "0.7386682", "0.7355923", "0.7355923", "0.7355923", "0.7355923", "0.7355923", "0.7355923", "0.7355923", "0.7355923", "0.71979177", "0.71979177", "0.71979177", "0.7192801", "0.7052094", "0.7039563", "0.7039563", "0.7025651", "0.6996496", "0.68688715",...
0.0
-1
Check if a matrix is symmetric positivedefinite.
def check_matrix_symmetric_positive_definite(matrix): try: if len(matrix.shape) != 2 or matrix.shape[0] != matrix.shape[1]: # Not 2-dimensional or square, so not simmetric. return False np.linalg.cholesky(matrix) return True except np.linalg.LinAlgError: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def symmetric(matrix):\n return sp.allclose(matrix, matrix.T)", "def is_symmetric(mat):\n return np.allclose(mat.T, mat)", "def is_symmetric(mat, eps=None):\n if eps is None:\n eps = np.finfo(mat.dtype).eps\n\n assert mat.ndim == 2\n if mat.shape[0] != mat.shape[1]:\n return False\...
[ "0.81164634", "0.7551254", "0.7257886", "0.7103587", "0.70027435", "0.69661516", "0.6822792", "0.6735763", "0.67137986", "0.6709991", "0.6610399", "0.6609868", "0.65940386", "0.6574847", "0.6566285", "0.64804894", "0.646248", "0.6462106", "0.6434021", "0.6391697", "0.6352792"...
0.86486775
0
Initialze the tag. Takes on argument of type String
def __init__(self, tag): self.tag = tag.lower()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self, tag):\n self.tag = tag", "def __init__(self, tag):\n self.tag = tag.lower()\n self.attrs = {}\n self.contents = ()", "def __init__(self):\n self.tag = None", "def for_tag(self, tag):\n if not isinstance(tag, str):\n raise TypeError('Tag ...
[ "0.72686875", "0.71819913", "0.699681", "0.67347914", "0.6734112", "0.6644734", "0.6598448", "0.6582968", "0.65582913", "0.6546194", "0.6439252", "0.6411006", "0.6397095", "0.636618", "0.62935704", "0.62808144", "0.6278395", "0.6267621", "0.62641025", "0.6255274", "0.62535197...
0.7232194
1
Evaluates the fitness of each individual, in terms of similarity.
def eval_fitness(individual, comparison): adjacency = individual.network.loc[:,['in']+stocks] for i in individual.network.index: individual.network.loc[i,'age'] += 1 return jaccard(adjacency,comparison),
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def fitness(self):\n pass", "def _evaluate_fitness(self, population: Population):\n for n, individual in enumerate(population.individuals):\n\n # Dataset extraction using individual features\n X_data = self._create_dataset(individual, self._X)\n\n # Get scores for e...
[ "0.7028236", "0.7027537", "0.6962035", "0.6937548", "0.6771565", "0.67507744", "0.6725496", "0.6593573", "0.65333354", "0.65192664", "0.6507758", "0.6474501", "0.6470134", "0.6466546", "0.64599156", "0.6453565", "0.6447242", "0.64172465", "0.635991", "0.63503724", "0.63485926...
0.58489895
61
Convert a scipy sparse matrix to a torch sparse tensor.
def sparse_mx_to_torch_sparse_tensor(sparse_mx): sparse_mx = sparse_mx.tocoo().astype(np.float32) indices = torch.from_numpy(np.vstack((sparse_mx.row, sparse_mx.col)).astype(np.int64)) values = torch.from_numpy(sparse_mx.data) shape = torch.Size(sparse_mx.shape) return torch.sparse.FloatTensor(indic...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def csr2tensor(self, matrix: sp.csr_matrix):\n matrix = matrix.tocoo()\n x = torch.sparse.FloatTensor(\n torch.LongTensor(np.array([matrix.row, matrix.col])),\n torch.FloatTensor(matrix.data.astype(np.float32)),\n matrix.shape,\n ).to(self.device)\n retu...
[ "0.83033675", "0.8148503", "0.8032235", "0.8029749", "0.8029749", "0.8029749", "0.8029749", "0.8029749", "0.8029749", "0.8029749", "0.8029749", "0.8029749", "0.8029749", "0.8029749", "0.8029749", "0.8029749", "0.80132157", "0.7997072", "0.7997072", "0.7984944", "0.7984944", ...
0.8045674
2
Gets the identifier of this VersionedConnection. The component's unique identifier
def identifier(self): return self._identifier
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def component_id(self) -> str:\n return pulumi.get(self, \"component_id\")", "def component_id(self) -> str:\n return pulumi.get(self, \"component_id\")", "def component_id(self) -> pulumi.Output[str]:\n return pulumi.get(self, \"component_id\")", "def component_id(self) -> ComponentId:\...
[ "0.78510314", "0.78510314", "0.76195484", "0.7616397", "0.7576878", "0.747728", "0.7219206", "0.71355915", "0.7094497", "0.7048979", "0.6985249", "0.6969072", "0.69526106", "0.6937948", "0.69326395", "0.6885128", "0.6848697", "0.683053", "0.6819454", "0.68151546", "0.6814432"...
0.677848
26
Sets the identifier of this VersionedConnection. The component's unique identifier
def identifier(self, identifier): self._identifier = identifier
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def setId(self, identifier):\n self.identifier = identifier", "def _set_id(self):\n raise NotImplementedError()", "def setIdentifier(self, identifier):\n self._config['identifier'] = identifier", "def setIdentifier(self, identifier):\n self._config['identifier'] = identifier", "...
[ "0.6714855", "0.64746994", "0.63887763", "0.63887763", "0.6382856", "0.6382856", "0.6350311", "0.6349375", "0.6309655", "0.6275971", "0.62643385", "0.6234821", "0.6218606", "0.61523587", "0.61245376", "0.6109239", "0.60927093", "0.6067607", "0.6061418", "0.60599065", "0.60599...
0.63267934
10
Gets the instance_identifier of this VersionedConnection. The instance ID of an existing component that is described by this VersionedComponent, or null if this is not mapped to an instantiated component
def instance_identifier(self): return self._instance_identifier
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_instance_id(self):\n return self.instance_id", "def instance_id(self) -> str:\n return pulumi.get(self, \"instance_id\")", "def component_id(self) -> str:\n return pulumi.get(self, \"component_id\")", "def component_id(self) -> str:\n return pulumi.get(self, \"component_id...
[ "0.71567833", "0.7110711", "0.7094666", "0.7094666", "0.7085142", "0.7053215", "0.7053215", "0.7053215", "0.7038276", "0.7038276", "0.7038276", "0.7038276", "0.6979187", "0.6979187", "0.6979187", "0.69450146", "0.69450146", "0.69450146", "0.69450146", "0.69450146", "0.6945014...
0.7401791
0
Sets the instance_identifier of this VersionedConnection. The instance ID of an existing component that is described by this VersionedComponent, or null if this is not mapped to an instantiated component
def instance_identifier(self, instance_identifier): self._instance_identifier = instance_identifier
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def instance_id(self, instance_id):\n\n self._instance_id = instance_id", "def __init__(__self__, *,\n instance_id: pulumi.Input[int]):\n pulumi.set(__self__, \"instance_id\", instance_id)", "def __init__(__self__, *,\n instance_id: Optional[pulumi.Input[int]] = No...
[ "0.6863868", "0.6251302", "0.61940706", "0.5996129", "0.58834374", "0.5672411", "0.5672411", "0.5672411", "0.5672411", "0.5672411", "0.55814195", "0.55692", "0.550248", "0.55002433", "0.5481638", "0.5461459", "0.5461459", "0.5461459", "0.5461459", "0.5426572", "0.5426572", ...
0.71732706
0
Gets the name of this VersionedConnection. The component's name
def name(self): return self._name
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def connection_name(self) -> pulumi.Output[str]:\n return pulumi.get(self, \"connection_name\")", "def get_component_name(self):\n return self._name", "def connection_name(self) -> str:\n return pulumi.get(self, \"connection_name\")", "def name(self):\n return _version._NAME # py...
[ "0.77749544", "0.77625465", "0.7752423", "0.74572194", "0.71108466", "0.7099396", "0.70917237", "0.70859003", "0.7077464", "0.7077464", "0.7064276", "0.7030168", "0.7030168", "0.7030168", "0.7026887", "0.6983804", "0.6955677", "0.6955677", "0.6955677", "0.6955677", "0.6951921...
0.0
-1
Sets the name of this VersionedConnection. The component's name
def name(self, name): self._name = name
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_name(self, name):\n self.__name = name", "def set_name(self, name):\n self.__name = name", "def set_name(self, name):\r\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, na...
[ "0.7306374", "0.7306374", "0.72857684", "0.7272484", "0.7251567", "0.7251567", "0.7251567", "0.7251567", "0.7251567", "0.7246867", "0.7212615", "0.7121809", "0.70949745", "0.70943546", "0.69884944", "0.69769275", "0.69769275", "0.69769275", "0.69769275", "0.69571126", "0.6953...
0.68741834
94
Sets the comments of this VersionedConnection. The usersupplied comments for the component
def comments(self, comments): self._comments = comments
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def comments(self, comments):\n\n self.container['comments'] = comments", "def change_comments(self, new_comments):\n\n self.comments = new_comments", "def comments(self, comments):\n if comments is not None and len(comments) > 1000:\n raise ValueError(\"Invalid value for `comme...
[ "0.7456346", "0.6909691", "0.6811351", "0.67852646", "0.6639198", "0.6522824", "0.63997614", "0.6371351", "0.6371351", "0.6333562", "0.63295907", "0.63295907", "0.63295907", "0.63295907", "0.63295907", "0.63295907", "0.63295907", "0.63295907", "0.63295907", "0.63295907", "0.6...
0.76170665
2
Gets the position of this VersionedConnection. The component's position on the graph
def position(self): return self._position
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def position(self):\r\n return self._position", "def get_position(self):\n return self._pos", "def get_position(self):\n return self._pos", "def get_position(self):\n return self.__position", "def get_position(self):\n return self._position", "def position(self):\n ...
[ "0.7344115", "0.73411053", "0.73411053", "0.7332435", "0.7332214", "0.73077065", "0.73077065", "0.73077065", "0.7282161", "0.7278244", "0.72649384", "0.72649384", "0.7245624", "0.72257674", "0.72051096", "0.71659034", "0.715127", "0.71269375", "0.7110756", "0.70821744", "0.70...
0.7313003
13
Sets the source of this VersionedConnection. The source of the connection.
def source(self, source): self._source = source
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def source(self, source: Source):\n self._source = source", "def set_source(self, source):\n self.data['source'] = source", "def _set_source(self, source):\n if source != self._source:\n self._source = source\n self._channel = \"\"\n self._channel_name = \"...
[ "0.7144581", "0.7139723", "0.7095864", "0.69880015", "0.6860365", "0.67446506", "0.65222204", "0.6520544", "0.64635473", "0.64635473", "0.63877237", "0.6372306", "0.6218164", "0.61966336", "0.6185863", "0.6123103", "0.61074394", "0.61041737", "0.6036746", "0.60270965", "0.602...
0.7195893
5
Sets the destination of this VersionedConnection. The destination of the connection.
def destination(self, destination): self._destination = destination
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_destination(self, value):\n try:\n self._destination = value\n self._repository = hg.repository(ui.ui(), self._destination)\n except:\n self._repository = None", "def destination_config(self, destination_config):\n self._destination_config = destinati...
[ "0.69039255", "0.641365", "0.6377837", "0.63580644", "0.61866975", "0.6149715", "0.594955", "0.58278173", "0.57887083", "0.57559043", "0.5727966", "0.56784093", "0.5650666", "0.55692583", "0.5546389", "0.55313677", "0.55067194", "0.5497181", "0.5369489", "0.5366947", "0.53302...
0.73776555
0
Gets the label_index of this VersionedConnection. The index of the bend point where to place the connection label.
def label_index(self): return self._label_index
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def labelIndex(self, label):\n for idx, taskDef in enumerate(self):\n if taskDef.label == label:\n return idx\n return -1", "def get_index(self, label):\n if label in self.labels:\n return self.labels.index(label)\n else:\n self.labels.a...
[ "0.6727862", "0.66204184", "0.66039765", "0.6571471", "0.6556231", "0.6408738", "0.63165253", "0.62246567", "0.6137593", "0.61325324", "0.60939205", "0.6070093", "0.6070093", "0.6070093", "0.6070093", "0.6070093", "0.6070093", "0.6070093", "0.6070093", "0.6070093", "0.6070093...
0.802188
0
Gets the z_index of this VersionedConnection. The z index of the connection.
def z_index(self): return self._z_index
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getz_index(self):\n return self._getz_index", "def getz_index(self, getz_index):\n\n self._getz_index = getz_index", "def idx_z(self, zval):\r\n iz = np.around((zval - self.oz) / self.dz)\r\n return int(iz)", "def z_index(self, z_index):\n\n self._z_index = z_index", ...
[ "0.77253675", "0.6177417", "0.6173166", "0.6049642", "0.5866268", "0.58088696", "0.57979256", "0.57634187", "0.5742695", "0.5736248", "0.571728", "0.57069707", "0.5670593", "0.56654567", "0.56356966", "0.5614658", "0.5614658", "0.5550554", "0.5550554", "0.5550554", "0.5550554...
0.78977776
0
Gets the back_pressure_object_threshold of this VersionedConnection. The object count threshold for determining when back pressure is applied. Updating this value is a passive change in the sense that it won't impact whether existing files over the limit are affected but it does help feeder processors to stop pushing t...
def back_pressure_object_threshold(self): return self._back_pressure_object_threshold
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def back_pressure_object_threshold(self, back_pressure_object_threshold):\n\n self._back_pressure_object_threshold = back_pressure_object_threshold", "def back_pressure_data_size_threshold(self):\n return self._back_pressure_data_size_threshold", "def back_pressure_data_size_threshold(self, back_...
[ "0.77181", "0.7069356", "0.6146903", "0.5801722", "0.5776382", "0.5658145", "0.5658145", "0.5492331", "0.5375743", "0.5353464", "0.530409", "0.528614", "0.5284323", "0.5245156", "0.5240441", "0.5236909", "0.5203275", "0.51861197", "0.5134054", "0.50981814", "0.5080911", "0....
0.8643123
0
Sets the back_pressure_object_threshold of this VersionedConnection. The object count threshold for determining when back pressure is applied. Updating this value is a passive change in the sense that it won't impact whether existing files over the limit are affected but it does help feeder processors to stop pushing t...
def back_pressure_object_threshold(self, back_pressure_object_threshold): self._back_pressure_object_threshold = back_pressure_object_threshold
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def back_pressure_object_threshold(self):\n return self._back_pressure_object_threshold", "def back_pressure_data_size_threshold(self, back_pressure_data_size_threshold):\n\n self._back_pressure_data_size_threshold = back_pressure_data_size_threshold", "def threshold(tobject, min_value):\n\n ...
[ "0.71884716", "0.67659616", "0.5780856", "0.5717957", "0.5623481", "0.5440922", "0.5435245", "0.5223511", "0.51386034", "0.50720525", "0.5012596", "0.5006339", "0.49869636", "0.49370492", "0.4936689", "0.4902464", "0.48768574", "0.48541486", "0.47297552", "0.4721113", "0.4664...
0.86187595
0
Gets the back_pressure_data_size_threshold of this VersionedConnection. The object data size threshold for determining when back pressure is applied. Updating this value is a passive change in the sense that it won't impact whether existing files over the limit are affected but it does help feeder processors to stop pu...
def back_pressure_data_size_threshold(self): return self._back_pressure_data_size_threshold
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def back_pressure_data_size_threshold(self, back_pressure_data_size_threshold):\n\n self._back_pressure_data_size_threshold = back_pressure_data_size_threshold", "def back_pressure_object_threshold(self):\n return self._back_pressure_object_threshold", "def back_pressure_object_threshold(self, ba...
[ "0.78312105", "0.77389544", "0.6767024", "0.60794735", "0.6065001", "0.59814817", "0.5893117", "0.5890803", "0.5836023", "0.57315356", "0.5621337", "0.5621337", "0.5587822", "0.55608565", "0.5558321", "0.55280036", "0.5505283", "0.5491662", "0.54877007", "0.54628205", "0.5447...
0.84260064
0
Sets the back_pressure_data_size_threshold of this VersionedConnection. The object data size threshold for determining when back pressure is applied. Updating this value is a passive change in the sense that it won't impact whether existing files over the limit are affected but it does help feeder processors to stop pu...
def back_pressure_data_size_threshold(self, back_pressure_data_size_threshold): self._back_pressure_data_size_threshold = back_pressure_data_size_threshold
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def back_pressure_object_threshold(self, back_pressure_object_threshold):\n\n self._back_pressure_object_threshold = back_pressure_object_threshold", "def back_pressure_data_size_threshold(self):\n return self._back_pressure_data_size_threshold", "def back_pressure_object_threshold(self):\n ...
[ "0.7592268", "0.6924934", "0.6211695", "0.6131989", "0.5838929", "0.5402543", "0.53954256", "0.5345035", "0.52865946", "0.5257443", "0.5248578", "0.52220213", "0.5212786", "0.5186569", "0.51818734", "0.5174471", "0.5170987", "0.5151566", "0.513395", "0.51082796", "0.5104749",...
0.85663825
0
Sets the flow_file_expiration of this VersionedConnection. The amount of time a flow file may be in the flow before it will be automatically aged out of the flow. Once a flow file reaches this age it will be terminated from the flow the next time a processor attempts to start work on it.
def flow_file_expiration(self, flow_file_expiration): self._flow_file_expiration = flow_file_expiration
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def flow_file_expiration(self):\n return self._flow_file_expiration", "def token_expiration(self, token_expiration):\n\n self._token_expiration = token_expiration", "def expiration_interval(self, expiration_interval):\n\n self._expiration_interval = expiration_interval", "def set_expirat...
[ "0.7241933", "0.5858315", "0.57438356", "0.56768394", "0.5660425", "0.54408616", "0.5379142", "0.53784305", "0.5113526", "0.5093958", "0.4972095", "0.49653235", "0.49210674", "0.48974377", "0.48956004", "0.48558742", "0.47897676", "0.47897676", "0.4775504", "0.4770185", "0.47...
0.89278555
0
Gets the bends of this VersionedConnection. The bend points on the connection.
def bends(self): return self._bends
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_bonds(self):\n return self._graph.get_all_links()", "def bends(self, bends):\n\n self._bends = bends", "def bends(self, bends):\n\n self._bends = bends", "def get_blists(self):\n return self.blists[:]", "def getBolts(self):\r\n return self._bolts", "def getLinkE...
[ "0.64364254", "0.61045074", "0.61045074", "0.59877867", "0.5963126", "0.5871168", "0.586563", "0.5792517", "0.56854707", "0.56720257", "0.5645555", "0.5645555", "0.56248957", "0.56197447", "0.56197447", "0.56197447", "0.56197447", "0.55867547", "0.55863756", "0.55644625", "0....
0.8002686
0
Gets the load_balance_compression of this VersionedConnection. Whether or not compression should be used when transferring FlowFiles between nodes
def load_balance_compression(self): return self._load_balance_compression
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def load_balance_compression(self, load_balance_compression):\n allowed_values = [\"DO_NOT_COMPRESS\", \"COMPRESS_ATTRIBUTES_ONLY\", \"COMPRESS_ATTRIBUTES_AND_CONTENT\"]\n if load_balance_compression not in allowed_values:\n raise ValueError(\n \"Invalid value for `load_bala...
[ "0.65132606", "0.63576114", "0.63247293", "0.59485686", "0.5838227", "0.5780729", "0.56748044", "0.55482644", "0.54467434", "0.54363036", "0.5413613", "0.529667", "0.5263979", "0.5160585", "0.51479065", "0.51212233", "0.5091362", "0.5073302", "0.50611496", "0.5047145", "0.501...
0.8167347
0
Sets the load_balance_compression of this VersionedConnection. Whether or not compression should be used when transferring FlowFiles between nodes
def load_balance_compression(self, load_balance_compression): allowed_values = ["DO_NOT_COMPRESS", "COMPRESS_ATTRIBUTES_ONLY", "COMPRESS_ATTRIBUTES_AND_CONTENT"] if load_balance_compression not in allowed_values: raise ValueError( "Invalid value for `load_balance_compression`...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def load_balance_compression(self):\n return self._load_balance_compression", "def set_compression(self, compression):\n converter = geowave_pkg.datastore.redis.config.RedisOptions.CompressionConverter()\n self._java_ref.setCompression(converter.convert(compression))", "def jobconf(self):\...
[ "0.668837", "0.658266", "0.5714903", "0.5628727", "0.56237054", "0.55810106", "0.5554623", "0.55520606", "0.55103916", "0.53882295", "0.5272379", "0.5176328", "0.5114425", "0.491287", "0.49071902", "0.48037845", "0.47800833", "0.47138026", "0.46342933", "0.4593201", "0.454723...
0.76771533
0
Gets the component_type of this VersionedConnection.
def component_type(self): return self._component_type
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def component_type(self) -> ComponentType:\n return self.configuration.component_type", "def connection_type(self):\n return self._connection_type", "def connection_type(self):\n return self._connection_type", "def component_type(self):\n return 'ct'", "def connection_type(self)...
[ "0.80864406", "0.6882048", "0.6882048", "0.68408436", "0.66137916", "0.6586359", "0.65048647", "0.6451614", "0.6442098", "0.6225689", "0.6149628", "0.6135824", "0.61290544", "0.61290544", "0.61135983", "0.61135983", "0.61135983", "0.61135983", "0.61135983", "0.61135983", "0.6...
0.82667226
0
Sets the component_type of this VersionedConnection.
def component_type(self, component_type): allowed_values = ["CONNECTION", "PROCESSOR", "PROCESS_GROUP", "REMOTE_PROCESS_GROUP", "INPUT_PORT", "OUTPUT_PORT", "REMOTE_INPUT_PORT", "REMOTE_OUTPUT_PORT", "FUNNEL", "LABEL", "CONTROLLER_SERVICE", "REPORTING_TASK", "PARAMETER_CONTEXT", "PARAMETER_PROVIDER", "TEMPLATE"...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_electrical_type(self, connection_etype):\n self.etype = connection_etype", "def use(self, compo_type):\n self.compo_type = compo_type", "def component_type(self):\n return self._component_type", "def _set_component_type_params(self, component_type):\n self.component_type =...
[ "0.6194599", "0.6170398", "0.61031866", "0.5946605", "0.59419096", "0.5828146", "0.5766248", "0.5700997", "0.5684735", "0.5623629", "0.5623629", "0.5613562", "0.55535066", "0.55379295", "0.5529855", "0.54915607", "0.54915607", "0.5484373", "0.5484373", "0.5476122", "0.5475181...
0.75809443
0
Gets the group_identifier of this VersionedConnection. The ID of the Process Group that this component belongs to
def group_identifier(self): return self._group_identifier
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def group_id(self):\n return self._group_id", "def group_id(self):\n return self._group_id", "def group_id(self):\n return self._group_id", "def group_id(self):\n return self._id", "def group_id(self) -> str:\n return pulumi.get(self, \"group_id\")", "def group_id(self)...
[ "0.8137948", "0.8137948", "0.8137948", "0.7986834", "0.79201996", "0.79201996", "0.7862726", "0.7856324", "0.7752291", "0.7655195", "0.7446769", "0.74325734", "0.74001175", "0.7289883", "0.7289883", "0.7289883", "0.72281563", "0.72281563", "0.72281563", "0.72281563", "0.72281...
0.8127684
3
Sets the group_identifier of this VersionedConnection. The ID of the Process Group that this component belongs to
def group_identifier(self, group_identifier): self._group_identifier = group_identifier
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def group_id(self, group_id):\n\n self._group_id = group_id", "def group_id(self, group_id):\n\n self._group_id = group_id", "def group_id(self, group_id):\n\n self._group_id = group_id", "def group_id(self, group_id):\n\n self._group_id = group_id", "def group_id(self, group_id...
[ "0.7518294", "0.7518294", "0.7518294", "0.7518294", "0.7518294", "0.7518294", "0.7239649", "0.7166395", "0.7149654", "0.69653267", "0.67212975", "0.67196935", "0.66776764", "0.6651987", "0.6651987", "0.6651987", "0.65640146", "0.6560181", "0.654211", "0.64872617", "0.6426295"...
0.776042
0
Returns true if both objects are equal
def __eq__(self, other): if not isinstance(other, VersionedConnection): return False return self.__dict__ == other.__dict__
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __eq__(self, other):\n return are_equal(self, other)", "def __eq__(self, other):\n return are_equal(self, other)", "def __eq__(self,other):\n try: return self.object==other.object and isinstance(self,type(other))\n except: return False", "def __eq__(self, other):\n if i...
[ "0.808826", "0.808826", "0.8054592", "0.79827315", "0.79666996", "0.79666996", "0.79666996", "0.79666996", "0.79666996", "0.79666996", "0.79666996", "0.79666996", "0.79666996", "0.79666996", "0.79666996", "0.79666996", "0.79666996", "0.79666996", "0.79666996", "0.79666996", "...
0.0
-1
Returns true if both objects are not equal
def __ne__(self, other): return not self == other
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __ne__(self, other: object) -> bool:\n if self.__eq__(other):\n return False\n return True", "def __ne__(self, other: object) -> bool:\n return not self.__eq__(other)", "def __ne__(self, other) -> bool:\n return not self.__eq__(other)", "def __eq__(self, other):\n ...
[ "0.845611", "0.8391477", "0.8144138", "0.81410587", "0.8132492", "0.8093973", "0.80920255", "0.80920255", "0.80920255", "0.8085325", "0.8085325", "0.8076365", "0.8076365", "0.8065748" ]
0.0
-1
Check whether 'other' is equal to self. By default, 'other' is considered equal if it is a string matching 'self.name'. it is an instance of this type.
def __eq__(self, other): if isinstance(other, six.string_types): return other == self.name elif isinstance(other, type(self)): return self.xnd_dtype == other.xnd_dtype else: return False
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __eq__(self, other):\n\n return (self.name) == (other.name)", "def __eq__(self, other):\n return self.name == other.name", "def __eq__(self, other):\n return self.getName() == other.getName()", "def __eq__(self, other):\n if type(self) != type(other):\n return False...
[ "0.83886224", "0.82446945", "0.82067055", "0.7938492", "0.7933023", "0.7933023", "0.7906893", "0.7819593", "0.7775793", "0.7775793", "0.77651256", "0.7688113", "0.75874805", "0.75733924", "0.7571596", "0.7561163", "0.7560877", "0.7560877", "0.7548304", "0.7507894", "0.7483374...
0.72562903
47
A character code (one of 'biufcmMOSUV'), default 'O' This should match the NumPy dtype used when the array is converted to an ndarray, which is probably 'O' for object if the extension type cannot be represented as a builtin NumPy type. See Also numpy.dtype.kind
def kind(self): # type () -> str return np.dtype(self.type).kind
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test05(self):\n a = np.array([u\"aŀle\", u\"eñe\", u\"açò\"], dtype=\"U4\")\n ac = bcolz.carray(a, dtype='U4')\n self.assertTrue(ac.dtype == np.dtype('U4'))\n self.assertTrue(a.dtype == ac.dtype)\n # print \"ac-->\", `ac`\n assert_array_equal(a, ac, \"Arrays are not eq...
[ "0.57914084", "0.57651645", "0.5710867", "0.5653062", "0.5472397", "0.5444641", "0.5427665", "0.54223734", "0.54131496", "0.54018694", "0.5363088", "0.53498995", "0.5341477", "0.53250295", "0.5318825", "0.5315053", "0.5311933", "0.53070295", "0.52940696", "0.52760965", "0.527...
0.6083046
0