query stringlengths 9 9.05k | document stringlengths 10 222k | negatives listlengths 19 20 | metadata dict |
|---|---|---|---|
directory (str).........folder to search for duplicate/similar images show_imgs (bool)........True = shows the duplicate/similar images found in output False = doesn't show found images similarity (str)........"high" = searches for duplicate images, more precise "low" = finds similar images compression (int).......reco... | def compare_group_images(directory, show_imgs=True, similarity="high", compression=100):
# list where the found duplicate/similar images are stored
duplicates = []
lower_res = []
imgs_matrix = create_imgs_matrix(directory, compression)
# search for similar images
if similarity == "low":
... | [
"def find_same_images():\n if (os.path.exists(\"results\")):\n shutil.rmtree(\"results\")\n\n os.makedirs(\"results\")\n source_image = Image.open(sys.argv[2])\n #source_image.save(\"results/query.png\")\n\n results = {}\n for target in os.listdir(\"words2\"):\n target_image = Image.... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This function takes in the array of books and a string sorting to do a selection sort on the array. | def selection_sort(book_array, sorting):
if sorting == "author":
for i in range(len(book_array)):
min_index = i
for b in range(i + 1, len(book_array)):
author1 = str(book_array[min_index].author)
author2 = str(book_array[b].author)
... | [
"def choice_sort(A):\n pass",
"def shell_sort(input_list):",
"def selectionsort(arr):\n for i in range(len(arr)):\n minindex = i\n for j in range(i, len(arr)):\n if arr[j] < arr[minindex]:\n minindex = j\n temp = arr[minindex]\n arr[minindex] = arr[i]\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Gets the alternate message for an original one i.e., the pending or approved messages. | def get_alternate(self, altype) -> Optional['Message']:
query = self.base_query & (where('altype') == int(altype))
result = self.handle.table(ALTERNATES_TABLE_NAME).get(query)
return None if result is None else \
Message(self.handle, channel_id=result['message_cid'],
... | [
"def private_link_approval_message(self) -> Optional[pulumi.Input[str]]:\n return pulumi.get(self, \"private_link_approval_message\")",
"def private_link_approval_message(self) -> pulumi.Output[Optional[str]]:\n return pulumi.get(self, \"private_link_approval_message\")",
"def get_message(self):\n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sets the alternate message for an original one i.e., the pending or approved messages. | def set_alternate(self, message, altype):
channel_id = 0
message_id = 0
if isinstance(message, discord.Message):
channel_id = message.channel.id
message_id = message.id
else: # This class.
channel_id = message.channel_id
message_i... | [
"def step_impl_the_msg_to_is_set_to_alternative_respondent(context):\n step_impl_the_msg_to_is_set_to(context, context.bdd_helper.alternative_respondent_id)",
"async def approval_message_edit(\n message: Message,\n approve_text: str,\n rejection: bool = False\n ) -> None:\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Checks if this message is a registered comment hook of another message. A comment hook is a message that, when replied to, adds a comment onto the original message. | def is_comment_hook(self) -> bool:
query = (where('message_cid') == self.channel_id) & \
(where('message_mid') == self.message_id) & \
(where('altype') == int(AlternateType.COMMENT))
return self.handle.table(ALTERNATES_TABLE_NAME).get(query) is not None | [
"def is_comment(self):\n return self.action == Action.COMMENTED",
"def supports_comment_notification(self):\n return False",
"def check_replied(comment):\n # change column replied to replied_id for naming comprehension\n comment_result = session.query(reddb.comment_id, reddb.replied).filter(... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Test case for poets_get | def test_poets_get(self):
pass | [
"def test_poets_id_get(self):\n pass",
"def test_get_pets(self):\n response = self.client.open(\n '/pet',\n method='GET')\n self.assert200(response,\n 'Response body is : ' + response.data.decode('utf-8'))",
"def test_get_pet(self, mock_get):\n\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Test case for poets_id_get | def test_poets_id_get(self):
pass | [
"def test_solareclipses_id_get(self):\n pass",
"def test_volleyballcoachs_id_get(self):\n pass",
"def test_by_pet_id():\n\n pets_repo = PetsRepositorySpy()\n find_pet = FindPet(pets_repo)\n\n attributes = {\"pet_id\": faker.random_number(digits=2)}\n\n response = find_pet.by_pet_id(pet... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Creates a tree node with the specified item and no children. | def __init__(self, item=None):
self.item = item
self.children = [] #List to hold all child nodes of this Node | [
"def _create_node(self, item: Item) -> Dict[str, Any]:\n node = {'text': item.title,\n 'item-id': item.id,\n 'nodes': []}\n icon = self.icon_name(item)\n if icon:\n node['icon'] = 'glyphicon glyphicon-{}'.format(icon)\n node['item_title'] = item.t... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Method that sets the Node to contain the provided item. | def set_item(self, item):
self.item = item | [
"def setitem(self, item):\n self.data = [item]",
"def set_item(self, new_item):\n self.item = new_item",
"def makeSet(self, item):\n if not self.find(item):\n # add the item as an independant set and make root as itself\n self.__items[item] = item",
"def replace(self... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Method that returns the number of children the Node has. | def get_num_children(self):
return len(self.children) | [
"def child_count(self):\n\t\treturn len(self._children)",
"def child_count(self):\n return len(self.children)",
"def get_childcount(self):\n return len(self._childrenlist)",
"def children_count(self):\n\n cnt = 0\n if self.left:\n cnt += 1\n if self.right:\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Method that deletes the provided child node from the children of self. | def delete_child(self, child):
for i, c in enumerate(self.children): #For each child in the Node's children
if c is child and c.is_leaf(): #If that child is the one we're looking for and it has no children
del... | [
"def del_child(self, child):\n\n try:\n self.children.remove(child)\n except ValueError:\n pass\n else:\n self.rebuild_children_dict()",
"def remove_child(self, child):\n\n self.children.remove(child)",
"def deleteChild(self, childName):\n self... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Method that sets the Node's specified child to contain the provided node. | def set_child(self, child_index, node):
try:
self.children[child_index] = node #Set the node to be the child at the provided index.
except: #If the index is invalid,
pass ... | [
"def put(self, node, child):\n node.add_child(child)",
"def set_child(self, index, child):\n\n if index == 0:\n self.left = child\n else:\n self.right = child",
"def replace_node(self, child, node):\n is_left = self.left is child\n is_right = self.right i... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Method that checks if the Node is a leaf (ie, has no children). | def is_leaf(self):
if len(self.children) == 0: #If the Node has no children, it's a leaf
return True
else:
return False | [
"def is_leaf(node):\n if not node.descendants:\n return True\n\n return False",
"def __is_leaf(node: NodeAVL) -> bool:\n return not (node.left or node.right)",
"def is_leaf(node):\n return node.children == {}",
"def is_leaf(self) -> bool:\n return isinstance(self.tree... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
return pure background image around the character in char_pos position. | def get_raw_background(char_pos, size=394):
full_back = Image.open(WORLD_MAP).convert("RGBA")
# get terrain part in radius size/2 from your position
cropbox = (char_pos[0] - size//2, char_pos[1] - size//2, char_pos[0] + size//2, char_pos[1] + size//2)
full_back = full_back.crop(cropbox)
return full_... | [
"def get_font_image(self, char):\n im = Image.new(\"RGB\", (self.size, self.size), (255, 255, 255))\n dr = ImageDraw.Draw(im)\n font = ImageFont.truetype(self.input_path, self.size)\n dr.text((0, self.y_offset), char, font=font, fill=\"#000000\")\n im = im.convert('1')\n re... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
turn background into 9x9 marked field | def field_markup(background):
# transparent background for markup
markup = Image.new('RGBA', background.size, (0,0,0,0))
# draw on markup using drawer
drawer = ImageDraw.Draw(markup)
for c in range(1, 9):
# x0 = (one_column_width + line_width) * line_index
# y0 = (one_row_height + li... | [
"def generateTransparentBackground(sizex, sizey):\n\tsizex += sizex % 16\n\tsizey += sizey % 16\n\tsingleTileData = (\n\t\t\"GdkP\"\n\t\t\"\\0\\0\\0\\263\"\n\t\t\"\\2\\1\\0\\2\"\n\t\t\"\\0\\0\\0@\"\n\t\t\"\\0\\0\\0\\20\"\n\t\t\"\\0\\0\\0\\20\"\n\t\t\"\\210jjj\\377\\210\\233\\233\\233\\377\\210jjj\\377\\210\\233\\23... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Encode a value which will be sent to memcached to bytes | def _encode_value(self, value):
return pickle.dumps(value) | [
"def _encode_value(self, value) -> bytes:\n pass",
"def encode(self, value):\r\n pass",
"def encode(self, value):\r\n # type: (Union[Tuple, List, OrderedDict, Dict, bool, int, str, bytes]) -> bytes\r\n return self.encoder.encode(value)",
"def encode(self, value: Any) -> Any:",
"d... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Decode a value recived from memcached (which is an Items object with a pickled 'value' attribute) from bytes | def _decode_value(self, value):
return pickle.loads(value.value) if value else value | [
"def deserialize(self, value: bytes) -> VALUE:\n raise NotImplementedError",
"def deserialize(self, value):\r\n return pickle.loads(value)",
"def _decode(self, value):\n if isinstance(value, list):\n return [self._decode(v) for v in value]\n elif isinstance(value, dict):\n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns a current window number. Provides a workaround for Neovim. | def get_current_window():
try:
return vim.current.window.number - 1
except AttributeError:
return int(vim.eval('winnr()')) - 1 | [
"def getwinnr(self):\n return int(vim.eval(\"bufwinnr('\" + self.name + \"')\"))",
"def get_current_workspace_num(i3: i3ipc.Connection):\n return i3.get_tree().find_focused().workspace().num",
"def _current_window_for_event(event):\n return find_window_for_buffer_name(event.cli, event.cli.current_b... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns a buffer with specfied number. Provides a workaround for Neovim. Note that vim.buffers may not contain all buffers with sequential numbers. | def get_buffer(number):
buffers = [buffer for buffer in vim.buffers if buffer.number == number]
assert len(buffers) == 1
return buffers[0] | [
"def create_or_get_buffer(self, name):\n for b in self.nvim.buffers:\n bname = path.basename(b.name)\n if bname == name:\n return b\n\n # Create new buffer\n self.nvim.command('set splitbelow')\n self.nvim.command('new')\n self.nvim.command('se... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Data structures obtained from vim under python3 will return bytestrings. Neovim under python3 will return str. Make sure we can handle that. | def decode_bytes(var):
if NEOVIM:
return var
if isinstance(var, bytes):
return var.decode()
if isinstance(var, list):
return list([decode_bytes(element) for element in var])
if isinstance(var, dict) or 'vim.dictionary' in str(type(var)):
return {
decode_b... | [
"def debugger_dump_ascii_string():",
"def ascii(p_object): # real signature unknown; restored from __doc__\n return \"\"",
"def get_bytestring(self, eieio_type):",
"def bytestring(cls, value: bytes) -> \"YAMLDocument.ByteString\":\n return cls.ByteString(value)",
"def _to_json_string(data_from_db)... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Determines if given datetime object is set to midnight. | def is_midnight(dt):
return dt.hour == 0 and dt.minute == 0 and dt.second == 0 | [
"def midnight(when, tz=None):\n if isinstance(when, datetime):\n mid_night = when.replace(hour=0, minute=0, second=0, microsecond=0)\n if mid_night.tzinfo is None:\n mid_night = mid_night.replace(tzinfo=(tz or localtz))\n return mid_night\n assert isinstance(when, date)\n re... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
List all columns if requested by user. | def list_all_columns(data):
# Print columns to user.
print("\nFeatures in our original dataset include (one at a time, please!):")
print("-" * 30)
print("")
# Print each column in our DataFrame.
for index, column in enumerate(data.columns.values):
print("[{}] {}".format(index, column))... | [
"def list_columns(ctx, param, value):\n if not value or ctx.resilient_parsing:\n return\n print_columns()\n ctx.exit()",
"def list_columns():\n return list(_COLUMNS.keys())",
"def show_columns(self):\n print self.columns",
"def show_columns(self):\n print(self.columns)",
"de... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Pack items into n bins while minimising the variance of weight accumulated in each bin. The function uses a greedy algorithm, which doesn't not guarantee a perfect result. | def binpack(nbins: int, weight: Callable[[T], Number], items: Sequence[T]) \
-> List[List[int]]:
if len(items) < nbins:
raise ValueError('There should be at lest `nbins` items')
weighted = [(i, weight(item)) for i, item in enumerate(items)]
return (F(map, F(map, op.itemgetter(0)) >> list) >>... | [
"def fit_n_bins(self, n):\n\n # Lazily evaluate all replacement-combinations of the defined bin\n # sizes.\n combinations = itertools.combinations_with_replacement(\n self.bins, r=n\n )\n\n # Initialize the minimum capacity as a infinite number.\n capacity_min = ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Merge sources within bins and stack them on top of each other. | def merge_bins(sources: Union[np.ndarray, Sequence[np.ndarray]],
bins: Sequence[Sequence[int]], dtype=None) -> np.ndarray:
if not len(sources):
raise ValueError('no `sources`')
extracted = (
F(binextract) >> (map, np.concatenate) >> list
)(sources, bins)
return preproc... | [
"def merge_chip_and_input(windows, nb_cpu):\n\n windows = iter(windows)\n merged = next(windows)\n\n for chromosome_dfs in windows:\n merged = merge_two_bin_dfs(merged, chromosome_dfs, nb_cpu)\n\n return merged",
"def merge(): #Status: WIP\r\n pass",
"def run_merge(args):\n tiles, co... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Breaks `merged` into binned objects corresponding to the original objects in a binned Sequence | def unmerge_bins(merged: np.ndarray, bins: Sequence[Sequence[int]],
lengths: Sequence[int]) -> List[List[np.ndarray]]:
lengths_ = np.array(lengths)
indices = [lengths_[bin_] for bin_ in bins]
return [list(np.split(line, np.cumsum(l_indices)))[:-1]
for line, l_indices in zip(merg... | [
"def bin_binarise(self):\n pass",
"def merge(self, merge_obj):\n while (~self.value_vec.mask).sum() > 1:\n minimum = np.amin(self.value_vec)\n min_vec = self.value_vec == minimum\n where_min = np.where(min_vec)[0]\n count = len(where_min)\n if c... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
utility method to get the status of a slicing job resource, but also used to initialize slice objects by location | def _get_status(self):
if self._state in ["processed", "error"]:
return self._state
get_resp = requests.get(self.location, cookies={"session": self.session})
self._state = get_resp.json()["status"]
self.slice_time = get_resp.json()["slice_time"]
ret... | [
"def _get_sliceid(self):\n return self.__sliceid",
"def create_call_status(job, internal_storage):\n monitoring_backend = job.config['lithops']['monitoring']\n Status = getattr(lithops.worker.status, '{}CallStatus'\n .format(monitoring_backend.capitalize()))\n return Status(job, in... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Inicializa y carga lista de stopwords desde el path recibido | def __init__(self,dir_stopwords):
arc = open(dir_stopwords, "r", encoding='utf-8')
self.stp_wrds = [line.strip() for line in arc]
arc.close() | [
"def load_stopwords(path):\n try:\n with open(path, encoding=\"utf-8\", mode=\"r+\") as f:\n stopwords = []\n for line in f.readlines():\n stopwords.append(line.strip())\n return stopwords\n except:\n # do not strop stopwords\n return []",
... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Remueve los urls de un texto | def remocion_de_urls(self, texto):
texto = re.sub(r'http\S+', '', texto)
return texto | [
"def remove_urls(text):\n pass",
"def remove_urls(self, text):\n return re.sub(r'http.?://[^\\s]+[\\s]?', '', text)",
"def _remove_urls(self, text: str) -> str:\n pattern = r\"http\\S+\"\n return re.sub(pattern, \" \", str(text))",
"def remove_urls(lista_tweets):\n\n novos_tweets = ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Remueve todos los signos de puntuación de un texto | def remocion_de_puntuaciones(self, texto):
translator = str.maketrans(dict.fromkeys(string.punctuation + "¿¡´’"))
texto = texto.translate(translator)
return texto | [
"async def textemote(self, ctx, *, msg):\n try:\n await ctx.message.delete()\n except discord.Forbidden:\n pass\n\n if msg != None:\n out = msg.lower()\n text = out.replace(' ', ' ').replace('10', '\\u200B:keycap_ten:')\\\n .re... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get course by ID. | def get_course_by_id(course_id):
course = Courses.query. \
filter_by(id=course_id). \
first_or_404()
return course | [
"def get(id):\n return Course._all[id]",
"def get_course(self, id):\n id = str(id)\n for i in range(len(self.courses)):\n if self.courses[i].id == id:\n return self.courses[i]",
"def getCourseById(self, request):\n C = Course.objects.get(courseId=request[\"c... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Make sure cube values lie between min_value and max_value. (The regridding produces spurious large and small values.) | def clean_data(cube, max_value, min_value):
data_clean = numpy.where(cube.data < min_value, min_value, cube.data)
data_clean = numpy.where(data_clean > max_value, max_value, data_clean)
return data_clean | [
"def testMinMax(self, value):\n\t\tif value > self.oldmax:\n\t\t\tself.oldmax = value\n\t\t\tself.maxBox.SetValue(str(value).encode('utf-8'))\n\t\telif value < self.oldmin:\n\t\t\tself.oldmin = value\n\t\t\tself.minBox.SetValue(str(value).encode('utf-8'))",
"def test_change_min_max(self):\n\n datarange = s... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Recursive Low Pass filter applied to signal to detect abrupt changes in data. | def RecursiveLowPassFast(signal, coeff, self):
# Creates running mean value of the input
ml = scipy.signal.lfilter([1 - coeff['a'], 0], [1, -coeff['a']], signal)
# Plot Running threshold value at the current plot
self.p1.plot(self.t, ml, pen=pg.mkPen(color=(246, 178, 255), width=3))
# Creates runn... | [
"def lowpass_filter(self, data, reset=False):\n data = np.asarray(data)\n if self._lowpass_sos is not None:\n if self._lowpass_state is None or reset:\n self.lowpass_filter_reset(data)\n data, self._lowpass_state = scipy.signal.sosfilt(\n self._lowpass_sos, data, zi=self._lowpass_sta... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
convert the hextstring to a length n list of booleans be careful of the order of indexing. | def __init__(self,hexstr,n=32):
binary=bin(int(hexstr,16))[2:]
binary=list(reversed(binary))
self.boolVals=[]
self.n=n
for i in range(len(binary)):
if binary[i]=="1":
self.boolVals.append(True)
else:
self.boolVals.append(Fa... | [
"def result_string_to_list(result: str) -> List[bool]:\n return [(True if c == '1' else False) for c in result[::-1]]",
"def convert_into_bool(s):\r\n result = []\r\n temp = map(int, s.split(\",\"))\r\n for itm in temp:\r\n if itm == 0:\r\n result.append(False)\r\n else:\r\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
__str__ is called when you 'print' a BoolArray object it should return a string of 0's and 1's or T's and F's | def __str__(self):
t=self.boolVals[:]
t.reverse()
bitstring=""
for i in range(len(t)):
if t[i]:
bitstring +="1"
else:
bitstring +="0"
return bitstring | [
"def __str__(self):\n return (str(self.array))",
"def convertToStringArray(booleanArray: typing.List[bool]) -> typing.List[str]:\n ...",
"def __str__(self):\n return 'true' if self.value is True else 'false'",
"def bool_to_str(boolean):\n if boolean:\n return \"1... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
return a string representing the current value in base 16 eg a string whose current barray is [True,False,False,True,False] should return "09" the number of hex digits should be len//4 rounded up | def toHex(self):
t=self.boolVals[:]
t.reverse()
string=str(self)
string=hex(int(string,2))
string=string[2:]
d=ceil(self.n/4)-len(string)
string=d*"0"+string
return string | [
"def repr_as_binary(value):\n b = bin(value)[2:]\n return b.zfill(len(b) + -len(b) % 8)",
"def _ConvertValueBinaryDataToStringBase16(self, value):\n if value:\n return value.encode('hex')\n\n return None",
"def makeBinary(self):\r\n\t\tls = 5.12 #limite superior\r\n\t\tli = -5.12 #limit... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
extracts a subarray of bits from indices left through rightplus including left and upto but not including rightplus e.g. getBits(7,10) a BoolArray object with bits equal to bits 7 through 9 inclusive | def subArray(self,left,rightplus):
lst=self.boolVals[:]
sm=""
for i in range(len(lst)):
if lst[i]:
sm+="1"
else:
sm+="0"
newlst=sm[left:rightplus]
newlst=newlst[::-1]
final=hex(int(newlst,2))
final=f... | [
"def binary_permutations(n_bits):\n return np.right_shift(np.arange(2**n_bits)[:, None], np.arange(n_bits-1, -1, -1)[None, :]) & 1",
"def extract_bits_from_bytes(data, start_bit, num_bits):\n b = bitarray(endian='big')\n b.frombytes(data)\n out = b[start_bit:start_bit+num_bits]\n return out",
"de... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
sets the ith bit of the array to the value boolval | def setBit(self,i,boolval):
self.boolVals[i]=boolval | [
"def gguf_set_val_bool(ctx: ffi.CData, key: ffi.CData, val: bool) -> None:\n ...",
"def setbit(n, i, val=1):\r\n if val:\r\n return n | (1 << i)\r\n else:\r\n return n & ~ (1 << i)",
"def set_bit(self, index: int) -> None:\r\n\t\tself.bitfield |= self.to_bitfield(index)",
"def PLCTYPE_A... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
returns a new BoolArray Object whose bits are those of self with bits of barray concatenated on the high end. partly courtsey of Wu & Nick | def catHigh(self,barrayobj):
n=len(barrayobj)+len(self)
ans=BoolArray("0",n)
for i in range(len(self)):
ans.setBit(i,self.getBit(i))
for i in range(len(barrayobj)):
k=len(self)+i
ans.setBit(k,barrayobj.getBit(i))
return ans | [
"def BitArray(self):\n from bitstring import BitArray,BitStream\n b = BitArray(bin=str(self))\n return b",
"def create_bit_array(self):\n return data_manipulation.convert_binary_array_to_single_array(self.binary_array, self.byte_size)",
"def convertToByteArray(booleanArray: typing.Li... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
make the parent temp dir directory | def makeTempDirParent():
if not os.path.exists(os.path.join(os.curdir, '.tempTestDir')):
os.mkdir(os.path.join(os.curdir, '.tempTestDir')) | [
"def _temp_dir(self):\n tmp_dir = os.path.join(self.output_dir, self.config.find_tune[\"run_dir\"])\n try:\n os.makedirs(tmp_dir)\n except OSError:\n pass\n os.chdir(tmp_dir)\n self.tmp_dir = \"./\"",
"def _insure_temp_dir(self):\n if not os.path.isd... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
remove the parent temp dir directory | def removeTempDirParent():
if os.path.exists(os.path.join(os.curdir, '.tempTestDir')):
shutil.rmtree(os.path.join(os.curdir, '.tempTestDir')) | [
"def remove_tmp_dir(self):",
"def rm_temp_dir():\n\n if os.path.exists(_tmp_path):\n shutil.rmtree(_tmp_path)",
"def delete_temp_dir(tmp_dir):\r\n #Check if the directory exists\r\n if os.path.exists(tmp_dir):\r\n shutil.rmtree(tmp_dir)",
"def delete_temp_files(self):\n try:\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Tests the conversion of chromosome/transcript/cds coordinates into individual amino acids. | def test_amino_acid_slicing(self):
chrom_result = [None, None, None, None, "R", "R", None, "R", "A", "A", None, None,
"A", None, None, None]
for i in xrange(len(chrom_result)):
self.assertEqual(self.t.chromosome_coordinate_to_amino_acid(i, self.chrom_seq), chrom_resul... | [
"def test_amino_acid_slicing(self):\n chrom_result = [None, \"Y\", \"Y\", \"Y\", None, None, None]\n for i in xrange(len(chrom_result)):\n self.assertEqual(self.t.chromosome_coordinate_to_amino_acid(i, self.chrom_seq), chrom_result[i])\n cds_result = [\"Y\", \"Y\", \"Y\", None]\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Check all possible chromosome translations for correct result | def test_chromosome_coordinate_translations(self):
cds_result = [None, 0, 1, 2, None, None, None]
transcript_result = [0, 1, 2, 3, 4, 5, None]
for i in xrange(6):
self.assertEqual(self.t.chromosome_coordinate_to_cds(i), cds_result[i])
self.assertEqual(self.t.chromosome_co... | [
"def test_chromosome_coordinate_translations(self):\n cds_result = [4, 3, 2, 1, 0, None, None]\n transcript_result = [5, 4, 3, 2, 1, 0, None]\n for i in xrange(7):\n self.assertEqual(self.t.chromosome_coordinate_to_cds(i), cds_result[i])\n self.assertEqual(self.t.chromosom... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Tests the conversion of chromosome/transcript/cds coordinates into individual amino acids. | def test_amino_acid_slicing(self):
chrom_result = [None, "Y", "Y", "Y", None, None, None]
for i in xrange(len(chrom_result)):
self.assertEqual(self.t.chromosome_coordinate_to_amino_acid(i, self.chrom_seq), chrom_result[i])
cds_result = ["Y", "Y", "Y", None]
for i in xrange(le... | [
"def test_amino_acid_slicing(self):\n chrom_result = [None, None, None, None, \"R\", \"R\", None, \"R\", \"A\", \"A\", None, None,\n \"A\", None, None, None]\n for i in xrange(len(chrom_result)):\n self.assertEqual(self.t.chromosome_coordinate_to_amino_acid(i, self.ch... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Tests that the proper sequences are created from the intervals | def test_sequences(self):
self.assertEqual(self.t.get_mrna(self.chrom_seq), self.transcript_seq)
self.assertEqual(self.t.get_cds(self.chrom_seq), self.cds_seq)
self.assertEqual(self.t.get_protein_sequence(self.chrom_seq), self.amino_acid)
self.assertEqual(self.t.get_intron_sequences(self... | [
"def test_make_sequences(self):\n self.assertEqual(self.sequence.sequences[:3],['SSSSSSSSSSS', 'SSSSSSSSSD', 'SSSSSSSSDS'])",
"def test_intervals(self):\n # test against the correct input file\n with open(self.__correct_file) as input_file:\n parser = Reader(input_file)\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Check all possible chromosome translations for correct result | def test_chromosome_coordinate_translations(self):
cds_result = [4, 3, 2, 1, 0, None, None]
transcript_result = [5, 4, 3, 2, 1, 0, None]
for i in xrange(7):
self.assertEqual(self.t.chromosome_coordinate_to_cds(i), cds_result[i])
self.assertEqual(self.t.chromosome_coordina... | [
"def test_chromosome_coordinate_translations(self):\n cds_result = [None, 0, 1, 2, None, None, None]\n transcript_result = [0, 1, 2, 3, 4, 5, None]\n for i in xrange(6):\n self.assertEqual(self.t.chromosome_coordinate_to_cds(i), cds_result[i])\n self.assertEqual(self.t.chr... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Tests that the proper sequences are created from the intervals | def test_sequences(self):
self.assertEqual(self.t.get_mrna(self.chrom_seq), self.transcript_seq)
self.assertEqual(self.t.get_cds(self.chrom_seq), self.cds_seq)
self.assertEqual(self.t.get_protein_sequence(self.chrom_seq), self.amino_acid)
self.assertEqual(self.t.get_intron_sequences(self... | [
"def test_make_sequences(self):\n self.assertEqual(self.sequence.sequences[:3],['SSSSSSSSSSS', 'SSSSSSSSSD', 'SSSSSSSSDS'])",
"def test_intervals(self):\n # test against the correct input file\n with open(self.__correct_file) as input_file:\n parser = Reader(input_file)\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Test reciprocal translations between coordinate spaces | def test_reciprocal_translations(self):
for i in xrange(-1, 12):
tmp = self.t.chromosome_coordinate_to_transcript(i)
#can't have reciprocal connection once None appears
if tmp is not None:
self.assertEqual(self.t.transcript_coordinate_to_chromosome(tmp), i)
... | [
"def test__inverse_transform_continuous(self):",
"def testCalculateTranslationDiff(self):\n # Test Identity\n transform1 = numpy.eye(4)\n transform2 = numpy.eye(4)\n (result, _) = self.evaluator._calculateDifference(transform1, transform2)\n self.assertEqual(result, 0.0)\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Test reciprocal translations between coordinate spaces | def test_reciprocal_translations(self):
for i in xrange(-1, 12):
tmp = self.t.chromosome_coordinate_to_transcript(i)
#can't have reciprocal connection once None appears
if tmp is not None:
self.assertEqual(self.t.transcript_coordinate_to_chromosome(tmp), i)
... | [
"def test__inverse_transform_continuous(self):",
"def testCalculateTranslationDiff(self):\n # Test Identity\n transform1 = numpy.eye(4)\n transform2 = numpy.eye(4)\n (result, _) = self.evaluator._calculateDifference(transform1, transform2)\n self.assertEqual(result, 0.0)\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Gets the first X, Y, ModelGeneratorBase set and resets the iteration | def _first(self) -> Tuple[np.ndarray, np.ndarray, ModelGeneratorBase]:
pass | [
"def _next(self) -> Tuple[np.ndarray, np.ndarray, ModelGeneratorBase]:\n pass",
"def _temp():\n yield self_or_cls.x\n yield from iterables",
"def __next__(self) -> Tuple[np.array, Tuple[int, int, int], int]:\n cur_edge_type = self.ordered_edge_types[self.iter % len(se... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Increments the iterator and gets the next X, Y, ModelGeneratorBase set | def _next(self) -> Tuple[np.ndarray, np.ndarray, ModelGeneratorBase]:
pass | [
"def __next__(self):\n if self.iterator < len(self.points):\n iterator = self.iterator\n self.iterator += 1\n return self.points[iterator]\n else:\n raise StopIteration",
"def __next__(self):\n if self.iterator < len(self.points):\n self.... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Calculates the transitive closure of the types in _required_types. Returns a tuple containing the list of struct types and the list of enum types. The list of struct types is ordered such that no type depends on a type later in the list. | def _ResolveTypeDependencies(self):
if self._namespace.functions:
for function in self._namespace.functions.itervalues():
self._FindFunctionDependencies(function)
if self._namespace.events:
for event in self._namespace.events.itervalues():
self._FindFunctionDependencies(event)
r... | [
"def get_enum_dependencies(*objs):\n\n return [\n obj for obj in get_dependencies(*objs) if isinstance(obj, schema.Enum)\n ]",
"def get_nested_enums(*objs):\n\n deps = []\n for obj in objs:\n if isinstance(obj, schema.File):\n deps.extend(get_nested_enums(*obj.enum_list))\n deps.extend(get_n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns a tuple of the fullyqualified name of an entity. | def _NameComponents(entity):
names = []
while entity:
if (not isinstance(entity, model.Type) or
entity.property_type != model.PropertyType.ARRAY):
names.append(entity.name)
entity = entity.parent
return tuple(reversed(names[:-1])) | [
"def entity_name(self):\n return self.entity.name",
"def entity_name(self):\n return self.__entity_name",
"def entity_name(self) -> str:\n return self._entity_name",
"def get_name(name_or_entity):\n if isinstance(name_or_entity, (Subject, SubjectType)):\n return name_or_entity.n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns a string containing the name of the Pepper C type for |type_|. If array is True, returns the name of an array of |type_|. If optional is True, returns the name of an optional |type_|. If both array and optional are True, returns the name of an optional array of |type_|. | def ToPpapiType(self, type_, array=False, optional=False):
if isinstance(type_, model.Function) or type_.property_type in (
model.PropertyType.OBJECT, model.PropertyType.ENUM):
return self._FormatPpapiTypeName(
array, optional, '_'.join(
cpp_util.Classname(s) for s in self._Nam... | [
"def type_name(attr_type: AttrType) -> str:\n return attr_type.native_name or class_name(attr_type.name)",
"def ggml_type_name(type: int) -> ffi.CData:\n ...",
"def _GetTypeName(cls: Optional[TypeHinter]) -> str:\n if isinstance(cls, FieldDescriptor):\n # First, check for the `sem_type` protobuf optio... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns True if an optional |type_| is required. | def NeedsOptional(self, type_):
return self._NameComponents(type_) in self._optional_types | [
"def _is_optional_type(t):\n return hasattr(t, \"__args__\") and len(t.__args__) == 2 and t.__args__[-1] is type(None)",
"def _is_valid_optional(content_type: str) -> bool:\n content_type = content_type.strip()\n\n if not content_type.startswith(\"pt:optional\"):\n return False\n\n if not _has_... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns True if an array of |type_| is required. | def NeedsArray(self, type_):
return self._NameComponents(type_) in self._array_types | [
"def NeedsOptionalArray(self, type_):\n return self._NameComponents(type_) in self._optional_array_types",
"def is_array(type):\n nake_type = remove_alias(type)\n nake_type = remove_reference(nake_type)\n nake_type = remove_cv(nake_type)\n return isinstance(nake_type, cpptypes.array_t)",
"def is_... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns True if an optional array of |type_| is required. | def NeedsOptionalArray(self, type_):
return self._NameComponents(type_) in self._optional_array_types | [
"def NeedsArray(self, type_):\n return self._NameComponents(type_) in self._array_types",
"def NeedsOptional(self, type_):\n return self._NameComponents(type_) in self._optional_types",
"def containsOptionalProps(modelTypes):\n\n for type in modelTypes:\n if isinstance(type, model.ComplexType):\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Formats the type of a parameter or property. | def FormatParamType(self, param):
return self.ToPpapiType(param.type_, optional=param.optional) | [
"def type_name(self):\n return \"%s %s\" % (self.param_type, self.name)",
"def show_type(self, arg):\n return (str(arg), str(type(arg)), arg)",
"def __get_type__(self, param):\r\n\t\tif isinstance(param, dbTableColumn):\r\n\t\t\tif param.__data__['type'] in ['INTEGER']:\r\n\t\t\t\treturn 'int'\r\n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns a string containing the name for an enum value. | def EnumValueName(self, enum_value, enum_type):
return '%s_%s' % (self.ToPpapiType(enum_type).upper(),
enum_value.name.upper()) | [
"def get_name(self, value: Any) -> str:\n try:\n return self._reverse_values[value].name\n except KeyError:\n raise UnknownEnumValue(\n \"Invalid value %r for enum %s\" % (value, self.name)\n )",
"def to_enum_value_name(name):\n return _re_enum_valu... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns True if the function produces any arrays as outputs. This includes arrays that are properties of other objects. | def HasArrayOuts(self, function):
if function.callback:
for param in function.callback.params:
if self._IsOrContainsArray(param.type_):
return True
return function.returns and self._IsOrContainsArray(function.returns) | [
"def _is_array(obj):\r\n return isinstance(obj, np.ndarray)",
"def is_array(a):\n return has_shape(a) and jnp.ndim(a) > 0",
"def is_duck_array(value: Any) -> bool:\n if isinstance(value, np.ndarray):\n return True\n return (\n hasattr(value, \"ndim\")\n and hasattr(value, \"shap... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Function to generate response time modelling table for supervised model rolling data used | def create_resp_time_model_table(log_df, path):
# IMPORTANT!! - deleting all logs without a response time (errors) - this loses key information but should simplify the problem while preserving the basic relationship
log_df.dropna(inplace=True)
# Feature transformations
log_df.resp_time = log_df.resp... | [
"def create_metrics_table(request):\n\n try:\n data = json.loads(request.body)\n except Exception:\n return JsonResponse({\"status\": \"fail\", \"reason\": \"Json could not be parsed.\"})\n\n # Retrieving the metrics that the user wants to compute\n try:\n metrics = data['metrics']\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
If the acl migration script is present, then run it for either upgrade or downgrade. That script was introduced in JDP 2.3.4.0 and requires stopping all clickhouse server first. Requires configs to be present. | def run_migration(env, upgrade_type):
pass | [
"def apply_migrations():\n config = Config(ALEMBIC_CONFIG)\n upgrade(config, 'head')",
"def env_need_upgrade(dbManager):",
"def env_do_upgrade(dbManager):",
"def migrate() -> None:\n typer.echo('Starting migration...')\n subprocess.run(['alembic', 'upgrade', 'head'])",
"def run_env(self, context... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Ensure that the requested application IDs exist in the credential store | def _valid_app_ids(app_ids):
for app_id in app_ids:
try:
app_data = KNACK_CREDENTIALS[app_id]
except KeyError:
return False
return True | [
"def test_list_application_credentials(self):\n self.create_application_credential()\n self.create_application_credential()\n\n app_creds = self._list_app_creds()\n self.assertEqual(2, len(app_creds))",
"def test_query_application_credentials(self):\n self.create_application_cre... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Digitally rotates a movie. | def digi_rotate(t0, t1, rpm, path):
# film given
vid = cv2.VideoCapture(path)
# collecting frame values from film
fps = int(vid.get(cv2.CAP_PROP_FPS))
width = int(vid.get(cv2.CAP_PROP_FRAME_WIDTH))
height = int(vid.get(cv2.CAP_PROP_FRAME_HEIGHT))
dim = (width, height)
# find the starti... | [
"def rotate90(self):",
"def rotate(self):\n pass",
"def rotate(self,direction):\n if direction == 0:\n self.rot_idx = ( self.rot_idx + 1 ) % 4\n elif direction == 1:\n self.rot_idx = ( self.rot_idx - 1 ) % 4",
"def rotation(self, params):\n pass",
"def rotat... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Create a map of yyyymmdd date to the effective Firefox version on the release channel. | def create_date_to_version(release_info):
# Combine major and minor releases into a map of day -> version
# Keep only the highest version available for a day range.
observed_dates = set(release_info["major"].values())
observed_dates |= set(release_info["minor"].values())
# Skip old versions.
sd ... | [
"def get_release_info():\n major_info = fetch_json(\n \"https://product-details.mozilla.org/1.0/\" \"firefox_history_major_releases.json\"\n )\n if major_info is None:\n raise Exception(\"Failed to fetch major version info\")\n minor_info = fetch_json(\n \"https://product-details.mo... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Logically compare two Firefox version strings. Split the string into pieces, and compare each piece numerically. Returns 1, 0, or 1 depending on whether a is less than, equal to, or greater than b. | def compare_ver(a, b):
if a == b:
return 0
ap = [int(p) for p in a.split(".")]
bp = [int(p) for p in b.split(".")]
lap = len(ap)
lbp = len(bp)
# min # of pieces
mp = lap
if lbp < mp:
mp = lbp
for i in range(mp):
if ap[i] < bp[i]:
return -1
... | [
"def compare_version(version_str1, version_str2):\n compare_result = 0\n pattern = '([^\\.]+)\\.?([^\\.]*)\\.?([^\\.]*)'\n match1 = re.match(pattern, version_str1.strip())\n match2 = re.match(pattern, version_str2.strip())\n major2 = match2.group(1)\n major1 = match1.group(1)\n minor2 = match2.... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Fetch information about Firefox release dates. | def get_release_info():
major_info = fetch_json(
"https://product-details.mozilla.org/1.0/" "firefox_history_major_releases.json"
)
if major_info is None:
raise Exception("Failed to fetch major version info")
minor_info = fetch_json(
"https://product-details.mozilla.org/1.0/"
... | [
"def get_update_info():\n url = 'https://api.github.com/repos/gpodder/gpodder/releases/latest'\n data = urlopen(url).read().decode('utf-8')\n info = json.loads(data)\n\n latest_version = info.get('tag_name','').replace('gpodder-','')\n release_date = info['published_at']\n\n release_parsed = datet... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Create the effective version table. This will download the Firefox release history and map the date to a particular version. | def create_effective_version_table(spark):
d2v = create_date_to_version(get_release_info())
rows = [Row(date, version) for date, version in d2v.items()]
df = spark.createDataFrame(rows, ["date", "effective_version"])
return df | [
"def getFileVersionHistoryTable(self) -> str: # noqa: N802\n lines = []\n for info in self.get_file_history().values():\n dimension = '{width}×{height} px ({size} bytes)'.format(\n **info.__dict__)\n lines.append('| {timestamp} || {user} || {dimension} |'\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get the predicted taxid of a cluster | def predict_tax_id_of(self, cluster, lowest_predicted_novelty=None):
assert isinstance(cluster, list)
assert isinstance(lowest_predicted_novelty, dict)
list_of_valid_iid, set_of_ncbi_taxid = self.load_lineages(cluster)
root = {"count": 0, "c": {}, 'p': None}
# Build tree based from lineage of known referenc... | [
"def predict_cluster_class(self, x):\n try:\n prediction = self.__cluster.predict(x)\n except AttributeError:\n raise ValueError(self.__cluster_type + ' is not able to predict points')\n\n if len(prediction) == 1:\n return prediction[0]\n return predictio... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Compares the lineages of two ids for inconsistencies | def has_consistent_lineage(self, iid1, iid2):
assert isinstance(iid1, basestring)
assert isinstance(iid2, basestring)
set1 = set(self._iid_to_tid_lineage[iid1])
set2 = set(self._iid_to_tid_lineage[iid2])
if None in set1:
set1.remove(None)
if None in set2:
set2.remove(None)
if len(set2) > len(set1):
... | [
"def issueIdCompare (x, y):\n return int(x) - int(y)",
"def testCompareId(self):\n id1 = moose.vec('A', n=2, dtype='Neutral')\n id2 = moose.vec('B', n=4, dtype='Neutral')\n id3 = moose.vec('A')\n self.assertTrue(id1 < id2)\n self.assertEqual(id1, id3)\n self.assertTrue... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Receives messages through the given socket and upon receiving messages, passes them to the given callback, if provided. | def receive_message(socket, callback = None):
while not exit_flag:
try:
message = socket.recv(1024)
if message:
if callback:
callback(json.loads(message))
except Exception as err:
if err.message == "timed out":
p... | [
"def on_recv_stream(self, callback, copy=True):\n if callback is None:\n self.stop_on_recv()\n else:\n self.on_recv(lambda msg: callback(self, msg), copy=copy)",
"def on_recv(self, callback):\n return self.message_client.on_recv(callback)",
"def receive(self, sock: soc... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Safely sends messages from the given queue through the given socket. | def send_message(socket, queue_lock, message_queue):
while not exit_flag:
queue_lock.acquire() # do we need this because it is the only thread accessing the queue?
if not message_queue.empty():
message = message_queue.get()
socket.send(json.dumps(message))... | [
"def try_send(self,message,socket):\n try:\n socket.send(message)\n except:\n pass",
"def msgsFromSock(self, send_queue):\n\t\twhile True:\n\t\t\ttry:\n\t\t\t\tmsg = send_queue.get(True)\n\t\t\t\tif isinstance(msg, ms.IPLayer):\n\t\t\t\t\tself.nic.send(msg)\n\t\t\texcept q.Empt... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Converts a RFC 2822 date string to a Python datetime | def rfc2822_to_datetime(rfc_date):
timestamp = mktime_tz(parsedate_tz(rfc_date))
raw_dt = datetime.datetime.utcfromtimestamp(timestamp)
return raw_dt.replace(tzinfo=pytz.utc) | [
"def str2date(s):\n return datetime.strptime(s.decode(), \"%Y-%m-%d %H:%M:%S\")",
"def date_parse(date_string) -> datetime:\n return datetime.strptime(date_string, DATE_FMT)",
"def str_to_date(date_string):\n if date_string[-3] == ':':\n date_string = date_string[:-3] + date_string[-... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Converts a date to an ISO 8601 date | def date_to_iso8601(date):
return '%s-%02d-%02d' % (date.year, date.month, date.day) | [
"def date_to_iso(date):\n return date.isoformat()",
"def convertFromISODate(date):\n if date:\n try:\n datetime_object = datetime.datetime.strptime(date, '%Y-%m-%dT%H:%M:%S.%fZ')\n except ValueError:\n return date\n else:\n re... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Converts a date/time to an ISO8601 date string | def datetime_to_iso8601(date_time):
assert not date_time.utcoffset()
return date_time.strftime('%Y-%m-%dT%H:%M:%S.%f') + 'Z' | [
"def iso_date(self, t=None):\n if t is None:\n t = time.time()\n time_str = time.strftime(\"%Y-%m-%d %H:%M:%S\", time.localtime(t))\n\n return time_str",
"def formatISO2str(self, iso_time, timezone=8):\n # iso8601 读取\n datetime_UTC = iso8601.parse_date(iso_time)\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Create the recipe_submitters group and add permissions for the recipes models. | def set_groups_and_permissions_for_recipes(apps, schema_editor):
# In a migration from scratch, Django creates all of the models from all of the migrations, then runs
# post-migrate signals that create the matching contenttypes and permissions for those models. So to
# have the permissions available as need... | [
"def test_bulk_create_submission_review_permissions(self):\n instances = self.xform.instances.all()\n submission_data = [\n {\"note\": \"Nope!!\", \"instance\": _.id, \"status\": SubmissionReview.REJECTED}\n for _ in instances\n ]\n\n self._create_user_and_login(\"d... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Delete the recipe_submitters group and remove permissions for the recipes models. | def delete_groups_and_permissions_for_recipes(apps, schema_editor):
Group = apps.get_model('auth', 'Group')
Permission = apps.get_model('auth', 'Permission')
# Delete the recipe_submitters group.
recipe_submitters = Group.objects.get(name='recipe_submitters')
recipe_submitters.delete()
# Remove ... | [
"def set_groups_and_permissions_for_recipes(apps, schema_editor):\n # In a migration from scratch, Django creates all of the models from all of the migrations, then runs\n # post-migrate signals that create the matching contenttypes and permissions for those models. So to\n # have the permissions available... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Write out a LAMMPS input data file from all available held data (particles, bonds, angles, dihedrals) | def writeInput(self, inputName):
n_atoms = len(self.strucC.ptclC) # Obtaining particle size from container
n_bonds = len(self.strucC.bondC) # " "
n_angles = 0
n_dihedrals = 0
n_impropers = 0
ptclTypeInfo = self.strucC.ptclC.getTypeInfoDict() # map of "type":[typeInde... | [
"def create_file_empty_particles( self, fullpath, iteration,\n time, dt, select_nglobal_dict=None ):\n # Create the file (can be done by one proc or in parallel)\n f = self.open_file( fullpath,\n parallel_open=self.write_metadata_parallel )\n\n # Set... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This function returns the similarity functions that can be used for blocking purposes. | def get_sim_funs_for_blocking():
return get_sim_funs() | [
"def get_sim_funs_for_matching():\n return get_sim_funs()",
"def get_sim_funs():\n # Get all the functions\n functions = [affine,\n hamming_dist, hamming_sim,\n lev_dist, lev_sim,\n jaro,\n jaro_winkler,\n needleman_wunsch,\n smith_waterman,\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This function returns the similarity functions that can be used for matching purposes. | def get_sim_funs_for_matching():
return get_sim_funs() | [
"def get_similarity_function(self):\n if 'dot_product' in self.similarity_function:\n return TextSimilarityHead.dot_product_scores\n elif 'cosine' in self.similarity_function:\n return TextSimilarityHead.cosine_scores",
"def support(self, *mass_functions):\n result = 0\n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This function returns all the similarity functions supported by py_entitymatching. | def get_sim_funs():
# Get all the functions
functions = [affine,
hamming_dist, hamming_sim,
lev_dist, lev_sim,
jaro,
jaro_winkler,
needleman_wunsch,
smith_waterman,
overlap_coeff, jaccard, dice,
monge_elkan, cosine,
... | [
"def get_similarity_function(self):\n if 'dot_product' in self.similarity_function:\n return TextSimilarityHead.dot_product_scores\n elif 'cosine' in self.similarity_function:\n return TextSimilarityHead.cosine_scores",
"def get_sim_funs_for_matching():\n return get_sim_funs... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This function computes the affine measure between the two input strings. | def affine(s1, s2):
if s1 is None or s2 is None:
return np.NaN
if pd.isnull(s1) or pd.isnull(s2):
return np.NaN
# Create the similarity measure object
measure = sm.Affine()
# if not isinstance(s1, six.string_types):
# s1 = six.u(str(s1))
#
# if isinstance(s1, bytes)... | [
"def calculate_ac(str1, str2):\n\n total_letters = len(str1)\n ocr_letters = len(str2)\n if total_letters == 0 and ocr_letters == 0:\n acc_by_char = 1.0\n return acc_by_char\n diff = difflib.SequenceMatcher(None, str1, str2)\n correct_letters = 0\n for block in diff.get_matching_bloc... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This function computes the Jaro measure between the two input strings. | def jaro(s1, s2):
if s1 is None or s2 is None:
return np.NaN
if pd.isnull(s1) or pd.isnull(s2):
return np.NaN
# Create the similarity measure object
measure = sm.Jaro()
s1 = gh.convert_to_str_unicode(s1)
s2 = gh.convert_to_str_unicode(s2)
# Call the function to compute th... | [
"def jaro_distance(s1, s2):\n\n # If the strings are equal\n if (s1 == s2):\n return 1.0\n\n # Length of two strings\n len1 = len(s1)\n len2 = len(s2)\n\n if (len1 == 0 or len2 == 0):\n return 0.0\n\n # Maximum distance upto which matching is allowed\n max_dist = (max(len(s1), ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This function computes the Jaro Winkler measure between the two input strings. | def jaro_winkler(s1, s2):
if s1 is None or s2 is None:
return np.NaN
if pd.isnull(s1) or pd.isnull(s2):
return np.NaN
# Create the similarity measure object
measure = sm.JaroWinkler()
s1 = gh.convert_to_str_unicode(s1)
s2 = gh.convert_to_str_unicode(s2)
# Call the functio... | [
"def werCalc(s1, s2):\n\n # build mapping of words to integers\n b = set(s1.split() + s2.split())\n word2char = dict(zip(b, range(len(b))))\n\n # map the words to a char array (Levenshtein packages only accepts\n # strings)\n w1 = [chr(word2char[w]) for w in s1.split()]\n w2 = [chr(word2char[w]... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This function computes the NeedlemanWunsch measure between the two input strings. | def needleman_wunsch(s1, s2):
if s1 is None or s2 is None:
return np.NaN
if pd.isnull(s1) or pd.isnull(s2):
return np.NaN
# Create the similarity measure object
measure = sm.NeedlemanWunsch()
s1 = gh.convert_to_str_unicode(s1)
s2 = gh.convert_to_str_unicode(s2)
# Call the... | [
"def werCalc(s1, s2):\n\n # build mapping of words to integers\n b = set(s1.split() + s2.split())\n word2char = dict(zip(b, range(len(b))))\n\n # map the words to a char array (Levenshtein packages only accepts\n # strings)\n w1 = [chr(word2char[w]) for w in s1.split()]\n w2 = [chr(word2char[w]... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This function computes the SmithWaterman measure between the two input strings. | def smith_waterman(s1, s2):
if s1 is None or s2 is None:
return np.NaN
if pd.isnull(s1) or pd.isnull(s2):
return np.NaN
# Create the similarity measure object
measure = sm.SmithWaterman()
s1 = gh.convert_to_str_unicode(s1)
s2 = gh.convert_to_str_unicode(s2)
# Call the fun... | [
"def werCalc(s1, s2):\n\n # build mapping of words to integers\n b = set(s1.split() + s2.split())\n word2char = dict(zip(b, range(len(b))))\n\n # map the words to a char array (Levenshtein packages only accepts\n # strings)\n w1 = [chr(word2char[w]) for w in s1.split()]\n w2 = [chr(word2char[w]... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This function computes the cosine measure between the two input lists/sets. | def cosine(arr1, arr2):
if arr1 is None or arr2 is None:
return np.NaN
if not isinstance(arr1, list):
arr1 = [arr1]
if any(pd.isnull(arr1)):
return np.NaN
if not isinstance(arr2, list):
arr2 = [arr2]
if any(pd.isnull(arr2)):
return np.NaN
# Create cosine ... | [
"def cosine_sim_collections(a, b):\n setab = sorted(set(a) | set(b))\n countera, counterb = Counter(a), Counter(b)\n veca = [countera[element] if element in a else 0 for element in setab]\n vecb = [counterb[element] if element in b else 0 for element in setab]\n return dot(veca, vecb) / (norm(veca) *... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This function computes the overlap coefficient between the two input lists/sets. | def overlap_coeff(arr1, arr2):
if arr1 is None or arr2 is None:
return np.NaN
if not isinstance(arr1, list):
arr1 = [arr1]
if any(pd.isnull(arr1)):
return np.NaN
if not isinstance(arr2, list):
arr2 = [arr2]
if any(pd.isnull(arr2)):
return np.NaN
# Create ... | [
"def overlap_coe1(inter, x, y):\n return float(inter)/min(x, y)",
"def overlap_coefficient(filter1, filter2):\n\n if (type(filter1) is NullField) or (type(filter2) is NullField):\n return 0\n\n xy = filter1.intersection(filter2).filter.count(True)\n x = filter1.filter.count(True)\n y = filter2... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This function computes the Dice score between the two input lists/sets. | def dice(arr1, arr2):
if arr1 is None or arr2 is None:
return np.NaN
if not isinstance(arr1, list):
arr1 = [arr1]
if any(pd.isnull(arr1)):
return np.NaN
if not isinstance(arr2, list):
arr2 = [arr2]
if any(pd.isnull(arr2)):
return np.NaN
# Create Dice obj... | [
"def dice(l1, l2):\r\n l1 = set(l1)\r\n l2 = set(l2)\r\n a1 = l1.intersection(l2)\r\n a2 = l1.difference(l2)\r\n a3 = l2.difference(l1)\r\n dice = (2* float(len(a1))) /((2*float(len(a1))) + len(a2) + len(a3))\r\n dice = 1 - dice\r\n return dice",
"def distribution(dice1, dice2):\n # gen... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This function computes the MongeElkan measure between the two input lists/sets. Specifically, this function uses JaroWinkler measure as the secondary function to compute the similarity score. | def monge_elkan(arr1, arr2):
if arr1 is None or arr2 is None:
return np.NaN
if not isinstance(arr1, list):
arr1 = [arr1]
if any(pd.isnull(arr1)):
return np.NaN
if not isinstance(arr2, list):
arr2 = [arr2]
if any(pd.isnull(arr2)):
return np.NaN
# Create Mo... | [
"def similarity_score(analyte1, analyte2, mass_offset):\n spectrum1 = analyte1.relative_experiment_mass_spectrum\n spectrum2 = analyte2.relative_experiment_mass_spectrum\n\n # Create list of 'consensus' masses, including both exact masses, and masses that match with the mass offset\n\n consensus_mass_li... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This function computes the relative difference between two numbers | def rel_diff(d1, d2):
if d1 is None or d2 is None:
return np.NaN
if pd.isnull(d1) or pd.isnull(d2):
return np.NaN
try:
d1 = float(d1)
d2 = float(d2)
except ValueError:
return np.NaN
if d1 == 0.0 and d2 == 0.0:
return 0
else:
# Compute the ... | [
"def difference(num1, num2):\n\n # Return the calculated value\n return abs(num1 - num2)",
"def absolute_difference(n1,n2):\n \n return abs(n1-n2)",
"def relative_error(self, a, b):\n return np.abs(a - b) / np.maximum(0, np.abs(a) + np.abs(b))",
"def relative_change(nr1, nr2):\n\n return... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This function computes the absolute norm similarity between two numbers | def abs_norm(d1, d2):
if d1 is None or d2 is None:
return np.NaN
if pd.isnull(d1) or pd.isnull(d2):
return np.NaN
try:
d1 = float(d1)
d2 = float(d2)
except ValueError:
return np.NaN
if d1 == 0.0 and d2 == 0.0:
return 0
else:
# Compute abso... | [
"def compute_similarity(site_a, site_b):\n return np.linalg.norm(site_a - site_b)",
"def normalized_distance(_a, _b) -> float:\n b = _b.astype(int)\n a = _a.astype(int)\n norm_diff = np.linalg.norm(b - a)\n norm1 = np.linalg.norm(b)\n norm2 = np.linalg.norm(a)\n return norm_diff / (norm1 + no... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get balance from account dictionary | def balance(self, account_number: int):
return self._accounts[account_number][1] | [
"def get_account_balance(self):\n return int(self.request('get', 'fort/accounts')['balance'])",
"def balance():\n response = requests.get(\n f'https://api.twilio.com/2010-04-01/Accounts/{account_sid}/Balance.json',\n auth=(\n account_sid,\n auth_token))\n result = ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Utility to make sure blocks of some types are not changed by middleware. | def assert_block_does_not_change(
block_type: str, middleware: Middleware, same_instance: Optional[bool]
):
block_type = block_type.lower()
if block_type == "preamble":
block = Preamble(
start_line=5, raw="@Preamble{a_x + b_x^2}", value="a_x + b_x^2"
)
elif block_type == "imp... | [
"def check_block(self, block):\n pass",
"def test_block_bad_signature(self):\n pass",
"def test_block_branch_not_changed_by_preview_handler(self, default_store):\n client = Client()\n client.login(username=self.user.username, password=self.user_password)\n\n with self.store.de... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Verify all attributes of entry (except `fields`) are identical. | def assert_nonfield_entry_attributes_unchanged(original_copy, transformed_entry):
assert transformed_entry.start_line == original_copy.start_line
assert transformed_entry.raw == original_copy.raw
assert transformed_entry.entry_type == original_copy.entry_type
assert transformed_entry.key == original_cop... | [
"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, test2)",
"def test_SameNumberOfFields(self):\n pass",
"def check_attributes(test_object, attribute_map):\n for at... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Here we expect a line in the format sizespec = "N=" intnumber "L=" intnumber | def parse_sizespec(self):
line_splitted = self.line.split()
for argument_unit in line_splitted:
# words[0] is the identifier of the argument
# and words[1] is the argument value.
words = self.split_argument_unit(argument_unit)
if words[0] == 'N':
self.node_number = int(words[1])
elif word... | [
"def calcsize(fmt: str) -> int:\n ...",
"def test_min_property_size_in_a_line(self):\n field = [[1],[0],[0]]\n self.assertEquals(persimmon.property_finder(field, (1,1)), 1)",
"def calcsize(fmt: str | bytes, /,) -> int:",
"def test_size_pretty_intonly(self):\n assert smdba.basegate.Base... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Here we expect a line int he format node = "I=" intnumber { "t=" floatnumber | "W=" string | "s=" string | "L=" string | "v=" intnumber } | def parse_node(self):
line_splitted = self.line.split()
i=t=w=s=l=v=None
for argument_unit in line_splitted:
words = self.split_argument_unit(argument_unit)
if words[0] == 'I':
i = words[1]
elif words[0] == 't':
t = float(words[1])
elif words[0] == 'W':
w = words[1]
elif words[0] == '... | [
"def typed_line(line, parser):\n user, item, rating = parser(line)\n return int(user), int(item), float(rating)",
"def parse_nbest_line(line):\n fields=[ x.strip() for x in line.strip().split('|||') ]\n fields[0]=int(fields[0])\n fields[3]=float(fields[3])\n return fields",
"def parse_line(li... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
We expect a lattice file with at least the nodes and links specifications | def parse(self, lat_file):
self.line_number = 0
for self.line in open(lat_file):
self.line_number = self.line_number + 1
if self.line.startswith(self.COMMENT_CHAR) or self.line.strip() == '':
continue
self.current_arg_name = self.line.split()[0].split('=')[0]
if self.current_arg_name == ... | [
"def find_lattice(lattice_params):\n meshfn = find_meshfn(lattice_params)\n xyload = np.loadtxt(meshfn + '_xy.txt', delimiter=',', skiprows=1, usecols=(0, 1)) # , unpack=True)\n NLload = np.loadtxt(meshfn + '_NL.txt', delimiter=',', skiprows=1)\n KLload = np.loadtxt(meshfn + '_KL.txt', delimiter=',', s... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Basic dynamics of xdot = u + w X = [x, y, theta, v] U = [a, thetadot] | def xdot(self, t, x, u, w):
a= u[0]
thetadot = u[1]
theta = x[2]
v = x[3]
w = w * self.w_scale
return np.array([v*np.cos(theta), v*np.sin(theta), thetadot, a]) + np.array([np.cos(theta) * w[0] - np.sin(theta) * w[1], np.sin(theta) * w[0] + np.cos(theta) * w[1], v * w[2], ... | [
"def dot(u, v, w, a, b):\n u_1, u_2 = u\n v_1, v_2 = v\n return (w*u_1 + b*u_2)*(w*v_1 + b*v_2) + abs(a)*u_1*v_1",
"def _compute_omega_dot(self, x, omega_cmd):\r\n phi = x[PHI_IDX]\r\n psi = x[PSI_IDX]\r\n\r\n beta_dot = x[BETA_DOT_IDX]\r\n phi_dot = x[PHI_DOT_IDX]\r\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Find jacobian of xdot wrt x, u, w | def jacobian(self, t, x, u, w):
a= u[0]
theta = x[2]
v = x[3]
fx = np.array([[0, 0, 0, 0],
[0, 0, 0, 0],
[-v*np.sin(theta), v*np.cos(theta), 0, 0],
[np.cos(theta), np.sin(theta), 0, 0]])
fu = np.array([[0, 0, 0,... | [
"def jacobian(x, u):\n yaw = x[2, 0]\n v = u[0, 0]\n jac = np.array([\n [1.0, 0.0, -dt * v * math.sin(yaw), dt * math.cos(yaw)],\n [0.0, 1.0, dt * v * math.cos(yaw), dt * math.sin(yaw)],\n [0.0, 0.0, 1.0, 0.0],\n [0.0, 0.0, 0.0, 1.0]])\n\n return jac",
"def jacobianF(self):... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Set cached/overridden repo name | def repo_name(self, value):
self._repo_name = value | [
"def _set_repo_name(self):\n system = sys.platform.lower()\n bitness = 64 if sys.maxsize > 2**32 else 32\n machine = platform.machine()\n fname = [None, None]\n\n if 'win' in system:\n fname[0] = 'win'\n elif 'lin' in system:\n fname[0] = 'linux'\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |