query stringlengths 9 9.05k | document stringlengths 10 222k | metadata dict | negatives listlengths 30 30 | negative_scores listlengths 30 30 | document_score stringlengths 4 10 | document_rank stringclasses 2
values |
|---|---|---|---|---|---|---|
append name with postfix | def append_name(name, postfix):
if name is None:
ret = None
elif name == '':
ret = postfix
else:
ret = '%s_%s' % (name, postfix)
return ret | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def print_name(name):\r\n\r\n\r\n return name + \"-apple\"",
"def add_name(self, node):\n if 'name' in self.options:\n name = nodes.fully_normalize_name(self.options.pop('name'))\n if 'name' in node:\n del(node['name'])\n node['names'].append(name)\n ... | [
"0.6697877",
"0.662184",
"0.6614897",
"0.6473923",
"0.6254014",
"0.6248267",
"0.6226696",
"0.6212746",
"0.62123245",
"0.60669625",
"0.6044965",
"0.6044965",
"0.6044435",
"0.60033596",
"0.5903342",
"0.5898558",
"0.588601",
"0.5874177",
"0.5855147",
"0.58351374",
"0.5803622",
... | 0.8279311 | 0 |
Lands the rover, and makes it part of the grid Throws an exception if A rover with that name already existed The rover being landed has a bad direction The rovers coordinates are off the grid A rover already exists on the gird at the rover's coordinates | def land_rover(self, rover):
if self.rovers.get(rover.name):
raise RoverException(ExceptionMessages.ROVER_ALREADY_LANDED)
if not Rover.valid_direction(rover.direction):
raise RoverException(ExceptionMessages.BAD_DIRECTION)
if not self._is_coordinate_in_the_grid(rover.c... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def make_move(self):\n self.owner = self.game.current_turn\n self.status = 'X' if self.owner == self.game.creator else 'O'\n ####\n #Random turn??\n ####\n self.save(update_fields=['status', 'owner'])\n\n # Add log entry for move\n self.game.add_log(f'cell ma... | [
"0.62105554",
"0.620282",
"0.59880394",
"0.5978847",
"0.5967129",
"0.5945851",
"0.5943394",
"0.59243786",
"0.5899155",
"0.5898589",
"0.5803447",
"0.5776576",
"0.5759452",
"0.5755554",
"0.5738934",
"0.57336867",
"0.5733618",
"0.5726307",
"0.57162607",
"0.5699025",
"0.5692675",... | 0.68636113 | 0 |
Tries to navigate and reposition the rover on the gird. Throws an exception if It cannot find that rover on the grid A bad instruction is passed Executing the instruction string will cause a collision with another rover on the gird | def navigate_rover(self, name, instruction_str):
rover = self.rovers.get(name)
if not rover:
raise RoverException(ExceptionMessages.BAD_NAME)
coordinate = copy.deepcopy(rover.coordinate)
direction = rover.direction
for instruction in instruction_str:
i... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def process_rover(grid, start_at, instructions, name='rover'):\n plateu = None\n try:\n if isinstance(grid, str):\n x_end, y_end = grid.split(' ')\n x_end = int(x_end)\n y_end = int(y_end)\n plateu = Plateu(x_end, y_end, name)\n\n elif isinstance(grid... | [
"0.6312876",
"0.60473263",
"0.5894628",
"0.5894628",
"0.5836864",
"0.5819794",
"0.581422",
"0.5812412",
"0.5812412",
"0.58097583",
"0.58019125",
"0.5792342",
"0.57617646",
"0.5753274",
"0.57401913",
"0.5738901",
"0.5717236",
"0.5713577",
"0.57098556",
"0.57092357",
"0.5694141... | 0.6905907 | 0 |
Basically a state machine Given a instruction('R' or 'L') and a direction('N' or 'S' or 'E' or 'W'), returns the new direction Throws an exception in case of bad instruction | def _direction_after_turning(self, direction, instruction):
next_left_states = {'N':'W', 'W': 'S', 'S': 'E', 'E': 'N'}
next_right_states = {'N': 'E', 'E': 'S', 'S': 'W', 'W': 'N'}
if instruction == 'R':
return next_right_states[direction]
elif instruction == 'L':
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def go_one_step(old_state, direction):\n assert direction in ['R', 'L', 'U', 'D']\n\n x, y = old_state\n if direction == 'R':\n return (x+1, y)\n if direction == 'L':\n return (x-1, y)\n if direction == 'U':\n return (x, y+1)\n if direction == 'D':\n return (x, y-1)",
... | [
"0.6593464",
"0.62368506",
"0.61913526",
"0.5976613",
"0.57964754",
"0.5683937",
"0.5672923",
"0.5668834",
"0.5567708",
"0.5457504",
"0.5439745",
"0.5427397",
"0.54177237",
"0.53752434",
"0.5332933",
"0.53058296",
"0.53014976",
"0.52971196",
"0.5290954",
"0.5269749",
"0.52675... | 0.77884203 | 0 |
Returns a new coordinate after moving the rover, Based on the direction, it applies a movement of one grid and calculates the new coordinates. Its throws an exception if the new coordinate is off grid the new coordinate results in an collision with another rover | def _coordinate_after_moving(self, direction, coordinate):
if direction == 'N':
new_coordinate = Coordinate(coordinate.x, coordinate.y + 1)
elif direction == 'S':
new_coordinate = Coordinate(coordinate.x, coordinate.y - 1)
elif direction == 'W':
new_coordinat... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _calculate_move_location(self, direction):\n current_row = self._current_loc.get_row()\n current_column = self._current_loc.get_column()\n\n # Calculate the new location for a left move\n if (direction == \"l\"):\n return Location(current_row, current_column - 1)\n ... | [
"0.6662709",
"0.6605978",
"0.6600228",
"0.6573474",
"0.6549251",
"0.65067387",
"0.6477407",
"0.6455114",
"0.64177567",
"0.6393052",
"0.6361281",
"0.6359388",
"0.6349698",
"0.63481045",
"0.63376284",
"0.63300747",
"0.63202614",
"0.6316886",
"0.630494",
"0.62923414",
"0.6275278... | 0.7444775 | 0 |
Return any binary tree that matches the given preorder and postorder traversals. Values in the traversals pre and post are distinct positive integers. | def constructFromPrePost(self, pre, post):
if not pre and not post:
return None
root = TreeNode(pre[0])
if len(pre) == 1 and len(post) == 1:
return root
if pre[1] == post[-2]:
lpre, lpost = pre[1:], post[:len(post)-1]
ltree = self.construc... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def buildTree(self, inorder: 'List[int]', postorder: 'List[int]') -> 'TreeNode':\n self.post_index = len(postorder) - 1\n dict = {}\n for i, num in enumerate(inorder):\n dict[num] = i\n \n def helper(in_left, in_right):\n if in_left > in_right:\n ... | [
"0.6668872",
"0.6449099",
"0.6396742",
"0.6088152",
"0.60584265",
"0.5841729",
"0.57979167",
"0.5787835",
"0.5776373",
"0.5711486",
"0.55507797",
"0.5525655",
"0.5513274",
"0.5498472",
"0.54892987",
"0.5478768",
"0.54738367",
"0.5418973",
"0.53901404",
"0.53882676",
"0.536626... | 0.66620654 | 1 |
Create and return an instance of the Isort plugin. | def setup_isort_tool_plugin(custom_rsc_path=None):
arg_parser = argparse.ArgumentParser()
if custom_rsc_path is not None:
resources = Resources([custom_rsc_path])
else:
resources = Resources(
[os.path.join(os.path.dirname(statick_tool.__file__), "plugins")]
)
config ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def sorter(Plugin):\n return Plugin.order",
"def create_plugin(self, **kwargs):\n return self.plugin_class(**kwargs)",
"def new(self, sort, properties=None):\n if sort is None:\n sort = UNKNOWNSORT\n # find next available vid\n vid, index = self.vid, self.index... | [
"0.5880008",
"0.572811",
"0.5263633",
"0.5135936",
"0.5086754",
"0.5085847",
"0.5052518",
"0.5052518",
"0.5028125",
"0.5018764",
"0.5011754",
"0.49714696",
"0.49462602",
"0.48368236",
"0.48352364",
"0.4823109",
"0.48152107",
"0.48114508",
"0.48113042",
"0.479689",
"0.47876537... | 0.59617186 | 0 |
Test that the plugin manager can find the Isort plugin. | def test_isort_tool_plugin_found():
if sys.version_info.major == 3 and sys.version_info.minor < 6:
pytest.skip("isort is only available for Python 3.6+, unable to test")
manager = PluginManager()
# Get the path to statick_tool/__init__.py, get the directory part, and
# add 'plugins' to that to g... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_plugins(self):\n from omtk import plugin_manager\n pm = plugin_manager.plugin_manager\n\n loaded_plugin_names = [plugin.cls.__name__ for plugin in pm.get_loaded_plugins_by_type('modules')]\n\n builtin_plugin_names = (\n 'Arm',\n 'FK',\n 'Additiv... | [
"0.66552377",
"0.6554768",
"0.6273206",
"0.62442213",
"0.6233943",
"0.62220126",
"0.60991585",
"0.60933506",
"0.6089562",
"0.5941484",
"0.59386533",
"0.59242934",
"0.5922501",
"0.58955973",
"0.58816534",
"0.58793914",
"0.58021533",
"0.57796365",
"0.57335883",
"0.57034636",
"0... | 0.8355158 | 0 |
Verify that we can parse the normal output of isort. | def test_isort_tool_plugin_parse_valid():
itp = setup_isort_tool_plugin()
total_output = []
output = "/tmp/x.py"
total_output.append(output)
output = "/tmp/y.py"
total_output.append(output)
issues = itp.parse_output(total_output)
assert len(issues) == 2
assert issues[0].filename == "... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_isort(self):\n chdir(REPO_ROOT)\n cmd = [\"isort\", \"-df\", \"-rc\", \"-c\", *SRC_DIRS]\n print(\"running:\", \" \".join(str(part) for part in cmd))\n proc = run(cmd, capture_output=True)\n assert proc.returncode == 0, f\"isort issues:\\n{proc.stdout.decode('utf-8')}\""... | [
"0.6781174",
"0.6635181",
"0.6309134",
"0.62981886",
"0.61402726",
"0.6060493",
"0.60508925",
"0.59607303",
"0.5936084",
"0.59126383",
"0.587762",
"0.58522105",
"0.5729688",
"0.56102586",
"0.5577316",
"0.55231833",
"0.5521064",
"0.55136585",
"0.55019987",
"0.54842657",
"0.548... | 0.77473277 | 0 |
Test what happens when a CalledProcessError is raised (usually means isort hit an error). | def test_isort_tool_plugin_scan_calledprocesserror(mock_subprocess_check_output):
mock_subprocess_check_output.side_effect = subprocess.CalledProcessError(
0, "", output="mocked error"
)
itp = setup_isort_tool_plugin()
package = Package(
"valid_package", os.path.join(os.path.dirname(__fi... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_make_tool_plugin_scan_calledprocesserror(mock_subprocess_check_output):\n mock_subprocess_check_output.side_effect = subprocess.CalledProcessError(1, '', output=\"mocked error\")\n mtp = setup_make_tool_plugin()\n package = Package('valid_package', os.path.join(os.path.dirname(__file__),\n ... | [
"0.66911113",
"0.64319515",
"0.63943857",
"0.63668126",
"0.6338667",
"0.63044673",
"0.63034093",
"0.6283694",
"0.62171775",
"0.6183645",
"0.61580575",
"0.6093192",
"0.6079444",
"0.603348",
"0.6027173",
"0.5997922",
"0.59800065",
"0.59751534",
"0.59546334",
"0.5954266",
"0.595... | 0.6745141 | 0 |
Get the release history from pypi Use the json API to get the release history from pypi. The returned json structure includes a 'releases' dictionary which has keys that are release numbers and the value is an array of uploaded files. While we don't have a 'release time' per say (only the upload time on each of the fil... | def get_releases_for_package(name, since):
f = urlreq.urlopen("http://pypi.org/project/%s/json" % name)
jsondata = f.read()
data = json.loads(jsondata)
releases = []
for relname, rellist in data['releases'].iteritems():
for rel in rellist:
if rel['python_version'] == 'source':
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def list_releases():\n response = requests.get(PYPI_URL.format(package=PYPI_PACKAGE_NAME))\n if response:\n data = response.json()\n\n releases_dict = data.get('releases', {})\n\n if releases_dict:\n for version, release in releases_dict.items():\n release_forma... | [
"0.6942631",
"0.66807014",
"0.6496823",
"0.6251065",
"0.6223727",
"0.61681485",
"0.607848",
"0.605974",
"0.6022348",
"0.5989354",
"0.59570056",
"0.59270537",
"0.5916981",
"0.58646035",
"0.5862971",
"0.5855767",
"0.5854523",
"0.5853826",
"0.58354694",
"0.5833912",
"0.58016866"... | 0.6868364 | 1 |
Calculates X values for given list of Y values in range defined by a and b parameters. X values are simply calculated by dividing given X range by number of nodes, so they are distributed in even range. | def prepare_initial_nodes(x_start, x_end, nodes_y):
nodes_x = [float(x_start + ((x_end - x_start) / (len(nodes_y) - 1)) * i) for i in range(0, len(nodes_y))]
nodes_y = [float(y) for y in nodes_y]
print(nodes_x)
print(nodes_y)
nodes = list(zip(nodes_x, nodes_y))
return nodes | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def projectionX(xdata, ydata, nbins, xrange=None, yrange=None):\n xmin, xmax = (np.min(xdata), np.max(xdata)) if xrange is None else xrange\n ymin, ymax = (np.min(ydata), np.max(ydata)) if yrange is None else yrange\n\n x_out = np.linspace(xmin, xmax, nbins+1)\n y_out = np.empty(nbins)\n dx = np.dif... | [
"0.58776325",
"0.5662537",
"0.5642036",
"0.5495832",
"0.5469611",
"0.5420076",
"0.5375376",
"0.53669316",
"0.53453207",
"0.53439814",
"0.53289247",
"0.5299425",
"0.5295588",
"0.52585924",
"0.52468276",
"0.5246785",
"0.5245637",
"0.5245567",
"0.52296543",
"0.5221779",
"0.52137... | 0.58207065 | 1 |
Takes list of divided differences nodes and calculates new divided differences node from each pair of nodes_to_compute. In other words, it computes next level of so called Newton's second interpolation form tree. | def calculate_divided_differences_row(nodes_to_compute):
divided_differences = []
if len(nodes_to_compute) == 1:
return None
for i in range(0, len(nodes_to_compute) - 1):
child = DividedDifferenceNode.create_child_node(nodes_to_compute[i], nodes_to_compute[i + 1])
child.calculate_v... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def calculate_divided_differences(nodes):\n nodes_to_compute = []\n divided_differences = []\n for node in nodes:\n nodes_to_compute.append(DividedDifferenceNode(x=node[0], divided_difference=node[1]))\n\n divided_differences.append(tuple(nodes_to_compute))\n\n while len(nodes_to_compute) > 1... | [
"0.65839136",
"0.57315016",
"0.567347",
"0.55890775",
"0.55738044",
"0.5463602",
"0.54403263",
"0.5439998",
"0.5405277",
"0.53822875",
"0.5344752",
"0.5334331",
"0.5325484",
"0.5318365",
"0.53122985",
"0.53017414",
"0.5295547",
"0.5275849",
"0.52737594",
"0.52574426",
"0.5230... | 0.6325345 | 1 |
Calculates divided differences for given interpolation nodes. It is assumed, that at least two interpolation nodes are provided. Each tuple of returned list represents one level of divided differences tree. | def calculate_divided_differences(nodes):
nodes_to_compute = []
divided_differences = []
for node in nodes:
nodes_to_compute.append(DividedDifferenceNode(x=node[0], divided_difference=node[1]))
divided_differences.append(tuple(nodes_to_compute))
while len(nodes_to_compute) > 1:
nex... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def calculate_divided_differences_row(nodes_to_compute):\n divided_differences = []\n\n if len(nodes_to_compute) == 1:\n return None\n\n for i in range(0, len(nodes_to_compute) - 1):\n child = DividedDifferenceNode.create_child_node(nodes_to_compute[i], nodes_to_compute[i + 1])\n chil... | [
"0.7081299",
"0.526944",
"0.52446645",
"0.5239564",
"0.523342",
"0.51974493",
"0.51963425",
"0.5140926",
"0.50798607",
"0.5076724",
"0.50607145",
"0.5054353",
"0.5047319",
"0.49978474",
"0.49799216",
"0.49528977",
"0.49478018",
"0.49372533",
"0.49131808",
"0.490018",
"0.48992... | 0.77134573 | 0 |
Creates polynomial from given list of divided differences. Polynomial string is created according to equation provided in project docs. | def calculate_newton_interpolation(divided_differences):
polynomial = []
for i, divided_differences_row in enumerate(divided_differences):
polynomial_part = '({0})'.format(divided_differences_row[0].divided_difference)
for j in range(0, i):
polynomial_part += '*(x-{0})'.format(divid... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def list_to_poly(polynomial_list):\n max_degree = len(polynomial_list) - 1\n strings = []\n opts = ['x', '']\n for index, num in enumerate(polynomial_list):\n if num == 0:\n continue\n if index < max_degree - 1:\n string = '{}x^{}'.format(num, max_degree - index)\n ... | [
"0.6846461",
"0.65011793",
"0.6292352",
"0.6274255",
"0.62225056",
"0.61097145",
"0.60969347",
"0.6090148",
"0.60779357",
"0.60200155",
"0.60196537",
"0.59783614",
"0.5969226",
"0.5965326",
"0.5856345",
"0.5849811",
"0.58080703",
"0.5775723",
"0.5735005",
"0.5733751",
"0.5722... | 0.70788777 | 0 |
Draws interpolation plot for given interpolation polynomial and nodes. | def draw_interpolation_plot(start_x, end_x, interpolation_polynomial, nodes, freq=200, additional_polynomial=None,
additional_nodes=None):
# TODO: calculate figure size dynamically
plt.figure(figsize=(8, 6), dpi=80)
x = numpy.linspace(start_x, end_x, freq)
# TODO: eval should... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def drawPolynomial(self, index, color, precision=200):\n graph = self.graphs[index]\n if len(graph) > 1:\n p = PolynomialInterpolation(graph, color)\n p.show(self.context, precision)",
"def plot_interpolation(self):\r\n self.plot_all_logcalls(True)\r\n print_log(... | [
"0.61234254",
"0.5854555",
"0.58188057",
"0.5757321",
"0.57179767",
"0.5697689",
"0.5670117",
"0.56530726",
"0.56499636",
"0.5633391",
"0.56109315",
"0.56016254",
"0.5506603",
"0.5506603",
"0.5494239",
"0.5491141",
"0.5464488",
"0.54549974",
"0.5449367",
"0.5433634",
"0.53791... | 0.7956468 | 0 |
This method generates a header file containing the data contained in the numpy array provided. It is used to capture the tensor data (for both inputs and expected outputs) to be bundled into the standalone application. | def _create_header_file(tensor_name, npy_data, output_path, data_linkage):
file_path = pathlib.Path(f"{output_path}/" + tensor_name).resolve()
# create header file
raw_path = file_path.with_suffix(".h").resolve()
with open(raw_path, "w") as header_file:
header_file.write("#include <stddef.h>\n")... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def write_header(_metadata, rename_padding=False):\n template = \"\"\"\\\n VERSION {version}\n FIELDS {fields}\n SIZE {size}\n TYPE {type}\n COUNT {count}\n WIDTH {width}\n HEIGHT {height}\n VIEWPOINT {viewpoint}\n POINTS {points}\n D... | [
"0.62532175",
"0.6250455",
"0.6128656",
"0.61236686",
"0.61083066",
"0.60900545",
"0.6076962",
"0.60498697",
"0.6037466",
"0.6030116",
"0.5991017",
"0.59467375",
"0.5944712",
"0.59186554",
"0.5880443",
"0.5877636",
"0.587325",
"0.5867404",
"0.5816105",
"0.58092946",
"0.580886... | 0.7628469 | 0 |
Convert a tflite model buffer in a Relay module | def convert_to_relay(tflite_model_buf, bind_params_by_name=True):
# TFLite.Model.Model has changed to TFLite.Model from 1.14 to 2.1
try:
import tflite.Model # pylint: disable=import-outside-toplevel
tflite_model = tflite.Model.Model.GetRootAsModel(tflite_model_buf, 0)
except AttributeError... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create_relay_module_and_inputs_from_tflite_file(tflite_model_file, bind_params_by_name=True):\n with open(tflite_model_file, \"rb\") as f:\n tflite_model_buf = f.read()\n mod, params = convert_to_relay(tflite_model_buf, bind_params_by_name)\n\n inputs = dict()\n for param in mod[\"main\"].pa... | [
"0.6981948",
"0.6846798",
"0.6283583",
"0.61803657",
"0.5930052",
"0.5720828",
"0.5706919",
"0.56350565",
"0.5599901",
"0.5577139",
"0.55073345",
"0.55071956",
"0.5415228",
"0.53956825",
"0.53790677",
"0.5360498",
"0.5250914",
"0.52445364",
"0.5237697",
"0.52300274",
"0.52069... | 0.7927206 | 0 |
Generate reference data through executing the relay module | def generate_ref_data(mod, input_data, params=None, target="llvm"):
with tvm.transform.PassContext(opt_level=3, config={"tir.disable_vectorize": True}):
lib = relay.build(mod, target=target, params=params)
lib_name = "mod.so"
temp = utils.tempdir()
lib_path = temp.relpath(lib_name)
lib.expo... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def run(self):\n self.parser.parse_args()\n\n sys.stdout.write(\"ref: %s\\n\\n\" % self.gen_ref())",
"def make_reference(self):\n self.make_reference2()",
"def generate(self):",
"def genReferences( self, aWeb ):\n try:\n for t in self.commands:\n ref= t.r... | [
"0.61367774",
"0.573806",
"0.56130826",
"0.5543687",
"0.55034256",
"0.55034256",
"0.55034256",
"0.55034256",
"0.55034256",
"0.55034256",
"0.55034256",
"0.55034256",
"0.55034256",
"0.55034256",
"0.5495478",
"0.5490769",
"0.54810923",
"0.544518",
"0.5430902",
"0.5426326",
"0.54... | 0.61549 | 0 |
A helper function to create a Relay IRModule with inputs and params from a tflite file | def create_relay_module_and_inputs_from_tflite_file(tflite_model_file, bind_params_by_name=True):
with open(tflite_model_file, "rb") as f:
tflite_model_buf = f.read()
mod, params = convert_to_relay(tflite_model_buf, bind_params_by_name)
inputs = dict()
for param in mod["main"].params:
n... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def tflite_load_model(model_file):\n interpreter = tf.lite.Interpreter(model_path=model_file)\n interpreter.allocate_tensors()\n return interpreter",
"def convert_to_relay(tflite_model_buf, bind_params_by_name=True):\n # TFLite.Model.Model has changed to TFLite.Model from 1.14 to 2.1\n try:\n ... | [
"0.63068986",
"0.6023051",
"0.5813477",
"0.5714911",
"0.5690382",
"0.5531973",
"0.55067134",
"0.5490141",
"0.5472677",
"0.54595083",
"0.5441401",
"0.5435935",
"0.5368517",
"0.5319013",
"0.5307069",
"0.5298142",
"0.5294426",
"0.5289352",
"0.52519286",
"0.5250053",
"0.5224872",... | 0.8060826 | 0 |
2. SELECTION PHASE. If a tree does not reproduce, it becomes extinct. Thus, this leads to the requirement of a competitive exclusion in order to eliminate those trees with lower metric values. This is done to limit the maximum number of trees in the forest. Initially, fast reproduction of trees take place and all of th... | def select(self):
def truncate(self):
""" Truncates forest to maximum number of trees. """
self.population = self.population[:self.max_number_trees]
def SortOnItem(list_, item_loc):
""" Sorts based on a given item. """
templist = [elmt[item_loc] for el... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _prune( tree, impurity_crit, dataSet, treeSeq ):\n\n\t\tsaved = {}\n\n\t\ttotal_leaf_impurity, num_leaves = DecisionTree._fetch(tree, impurity_crit, dataSet, saved)\n\n\t\tnodes, sets, G = saved['node'], saved['set'], saved['G']\n\n\t\t# choose TreeNode such that g is minimum to prune\n\t\tmin_g_ind = np.argmi... | [
"0.62971836",
"0.62759644",
"0.6227639",
"0.6085251",
"0.6084228",
"0.6072655",
"0.6057905",
"0.6017821",
"0.6007997",
"0.5916229",
"0.58216655",
"0.5750822",
"0.5743819",
"0.5695105",
"0.5636572",
"0.56322336",
"0.5611677",
"0.5590373",
"0.5590373",
"0.55826205",
"0.55778784... | 0.7099714 | 0 |
Truncates forest to maximum number of trees. | def truncate(self):
self.population = self.population[:self.max_number_trees] | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def max_depth_forest(self):\n return max(x.tree_.max_depth for x in self.result.estimators_)",
"def reset_max_depth(self) -> None:\n # The max depth is now calculated on the fly, so this is a no-op.\n pass",
"def truncate_features(self):\n num_variable = len(self.Train_data['X'][0])... | [
"0.60658157",
"0.5753063",
"0.57320607",
"0.5690253",
"0.56196177",
"0.557107",
"0.5399001",
"0.53606296",
"0.5356624",
"0.5334575",
"0.53127694",
"0.529486",
"0.5244779",
"0.52287835",
"0.52241135",
"0.5215633",
"0.5206999",
"0.51637185",
"0.5151103",
"0.5127064",
"0.5113451... | 0.7533811 | 0 |
3. REPRODUCTION PHASE. The trees will produce seeds based on their relative fitness which will then be spread over the problem space. Each seed, in turn, will grow into a new tree depending on external factors. A linear increase in the number of seeds produced by the trees of the forest is considered from max_seeds for... | def reproduce(self):
def compute_seeds(fitness):
""" Computes the number of seeds given a fitness value. """
seeds = (fitness-min_fitness) / (max_fitness-min_fitness) * \
(self.max_seeds-self.min_seeds) + self.min_seeds
return round(seeds)
# ev... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __init__(self,\n lower, upper ,\n fun ,\n max_std, min_std ,\n init_numb_trees = 10 ,\n max_numb_trees = 20 ,\n max_seeds = 10 ,\n min_seeds ... | [
"0.6857431",
"0.6693448",
"0.620608",
"0.61089987",
"0.60859585",
"0.60058355",
"0.59534144",
"0.5926585",
"0.5920129",
"0.59118456",
"0.58440024",
"0.5819384",
"0.5805844",
"0.5803149",
"0.5793257",
"0.5775363",
"0.5769751",
"0.5761044",
"0.5759271",
"0.5751068",
"0.5741327"... | 0.784303 | 0 |
Computes the number of seeds given a fitness value. | def compute_seeds(fitness):
seeds = (fitness-min_fitness) / (max_fitness-min_fitness) * \
(self.max_seeds-self.min_seeds) + self.min_seeds
return round(seeds) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def calculate_fitness(self, **kwargs):\n self.__fitness = self.fitness_function.calculate(self.__genes, **kwargs)\n self.num_fitness_eval += 1\n return self.__fitness",
"def fitness(self):\n # TO BE DECIDED\n return 1",
"def calcFitness (self) :\n fitnessArray = [[8, ... | [
"0.6422853",
"0.63974106",
"0.62456286",
"0.6235945",
"0.612314",
"0.60374177",
"0.6036776",
"0.59866303",
"0.5981496",
"0.5973722",
"0.5966571",
"0.59424984",
"0.5921845",
"0.5910393",
"0.5909234",
"0.5907262",
"0.59053224",
"0.5892766",
"0.58769244",
"0.5876505",
"0.5841656... | 0.7105341 | 0 |
Draws a random float number from a uniform distribution given by U[lower, upper]. | def uniform(lower, upper):
return lower + random.random() * (upper - lower) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _rand_float(self, low, high):\n\n return self.np_random.uniform(low, high)",
"def draw_random_u(d):\n mu = np.zeros(d)\n cov = np.eye(d)\n u = multivariate_normal.rvs(mean=mu, cov=cov)\n return u / np.linalg.norm(u)",
"def rand_uni_val() -> float:\n return random.uniform(0, 1)",
"de... | [
"0.7035064",
"0.67842853",
"0.66727394",
"0.65749025",
"0.650535",
"0.64895654",
"0.6346513",
"0.63048273",
"0.62389475",
"0.61971956",
"0.6175181",
"0.6122292",
"0.61146706",
"0.61146706",
"0.6104602",
"0.6089752",
"0.60430914",
"0.6024726",
"0.6020649",
"0.597315",
"0.59624... | 0.73602164 | 0 |
initmethod = ['random', 'pca'] algos = ['seq','batch'] all_neigh = ['gaussian','manhatan','bubble','cut_gaussian','epanechicov' ] alfa_types = ['linear','inv','power'] | def set_algorithm(self, initmethod = 'pca', algtype = 'batch', neighborhoodmethod = 'gaussian', alfatype = 'inv', alfaini = .5, alfafinal = .005):
self.initmethod = initmethod
self.algtype = algtype
self.alfaini = alfaini
self.alfafinal = alfafinal
self.neigh = neighborhoodmethod | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __init__(self, options, is_training=False):\n self.options = options\n self.is_training = is_training\n self.add_bi_directional_edges = None\n self.add_self_loop_edges = None\n self.use_reverse_edges = None",
"def __init__(self, algorithm, iters, **params):\n self.algorithm=algorithm\n ... | [
"0.5801649",
"0.57721746",
"0.57621926",
"0.5752019",
"0.570017",
"0.5656524",
"0.5650794",
"0.558717",
"0.55626065",
"0.5558151",
"0.55303484",
"0.55301005",
"0.5512373",
"0.55113596",
"0.5471883",
"0.5464631",
"0.54539907",
"0.54456383",
"0.5424106",
"0.54218847",
"0.541595... | 0.7114801 | 0 |
som and bmu_ind depending on the lattice "hexa" or "rect" we have different grid distance functions. bmu_ind is a number between 0 and number of nodes1. depending on the map size bmu_coord will be calculated and then distance matrix in the map will be returned | def grid_dist(self,bmu_ind):
try:
lattice = getattr(self, 'lattice')
except:
lattice = 'hexa'
print 'lattice not found! Lattice as hexa was set'
if lattice == 'rect':
return rect_dist(self,bmu_ind)
elif lattice == 'hexa':
try:
msize = getattr(self... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _get_nbh_distance_weight_matrix(\n self, neighborhood_func: float, bmu_pos: Tuple[int, int]\n ) -> np.ndarray:\n dist_mat = np.linalg.norm(self.node_list_ - bmu_pos, axis=1)\n\n pseudogaussian = np.exp(\n -np.divide(\n np.power(dist_mat, 2), (2 * np.power(neigh... | [
"0.57011366",
"0.5595913",
"0.5572306",
"0.5561625",
"0.5546656",
"0.5420969",
"0.5410991",
"0.53931206",
"0.5357705",
"0.5275946",
"0.5256405",
"0.5252467",
"0.52403647",
"0.52389497",
"0.52355295",
"0.5224548",
"0.5204496",
"0.5180344",
"0.51797044",
"0.51730376",
"0.514120... | 0.752086 | 0 |
helper function to get the next ocurring monday as a date object | def _get_next_monday(self):
today = datetime.date.today()
weekday_int = today.weekday()
if weekday_int == 0:
return today
next_mon = today + timedelta(7 - weekday_int)
return next_mon | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_next_monday(date):\n return date + datetime.timedelta(days=-date.weekday(), weeks=1)",
"def wkday_on_first(yr, mon): # returns day of week of first of month of the given year (1/1/2016)\r\n TotalDays = 0\r\n for x in range(1754, yr):\r\n YearNum = yeardays(x)\r\n TotalDays += Year... | [
"0.80878097",
"0.69910073",
"0.67567307",
"0.67550325",
"0.6671787",
"0.66657865",
"0.65446717",
"0.65446717",
"0.65441513",
"0.6513178",
"0.64433354",
"0.6440269",
"0.6345591",
"0.63378316",
"0.62782484",
"0.6256524",
"0.62425745",
"0.6242084",
"0.61851376",
"0.61851376",
"0... | 0.8260075 | 0 |
Helper function adding some known todo list items for the test user | def _add_todo_items(self):
todo_list = ToDoList(day=self.day, user=self.user.user.rolllistuser)
todo_list.save()
items = [
'feed the cats',
'drive to work',
'read a book',
'eat some food',
]
todo_items = []
for item in ite... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_can_add_todo_list():\n scheduler = Scheduler()\n new_id = uuid.uuid4()\n\n scheduler.add_todo_list(new_id, \"my todo list\")\n\n Is(scheduler.get_amount_of_todo_lists()).not_none.integer.has_same_truth_of(1)",
"def test_given_a_user_when_I_add_a_todo_Then_I_can_access_it_from... | [
"0.67881167",
"0.6779041",
"0.67479783",
"0.6636232",
"0.65715206",
"0.6420959",
"0.63876003",
"0.63576937",
"0.6330586",
"0.62917775",
"0.62856203",
"0.6273896",
"0.62697417",
"0.6185657",
"0.6137805",
"0.6080443",
"0.60529596",
"0.60524225",
"0.601782",
"0.6005775",
"0.5996... | 0.74570924 | 0 |
Helper function adding some known todo list items for the test user for the previous day | def _backfill_todo_items_for_previous_day(self):
previous_day_date = self.day.date - timedelta(days=1)
day, created = Day.get_or_create(date=previous_day_date)
todo_list = ToDoList(day=day, user=self.user.user.rolllistuser)
todo_list.save()
items = [
'cut the grass'... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _add_todo_items(self):\n\n todo_list = ToDoList(day=self.day, user=self.user.user.rolllistuser)\n todo_list.save()\n\n items = [\n 'feed the cats',\n 'drive to work',\n 'read a book',\n 'eat some food',\n ]\n todo_items = []\n ... | [
"0.7035588",
"0.63662964",
"0.62633353",
"0.5987224",
"0.59500104",
"0.5935984",
"0.59221303",
"0.5910842",
"0.5875174",
"0.5867453",
"0.5842675",
"0.5828082",
"0.5801755",
"0.5759313",
"0.5746675",
"0.5741539",
"0.5722921",
"0.5661359",
"0.56570214",
"0.5634428",
"0.5626967"... | 0.73899007 | 0 |
Helper function adding some known schedule items for the test user | def _add_schedule_items(self):
schedules = [
{
'start_time': '9:30 AM',
'end_time': '10:00 AM',
'title': 'Daily Scrum',
'location': 'Hogwarts',
'day': self.day,
'user': self.user.user.rolllistuser,
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_add_recurring_schedule(self):\n pass",
"def test_list_schedules(self):\n pass",
"def _create_schedules(self):\n\n ''''''",
"def add_schedule(doc_user, date, schedule, logger):\n #my_calendar = col_calendar.find_one({\"User\": doc_user[\"_id\"]})\n my_calendar = col_calenda... | [
"0.68778497",
"0.6814362",
"0.67497754",
"0.6255919",
"0.5921792",
"0.58371866",
"0.58195525",
"0.5796732",
"0.57783014",
"0.5733727",
"0.5705526",
"0.5705507",
"0.5691883",
"0.5643566",
"0.5565707",
"0.5564822",
"0.5547369",
"0.5525819",
"0.552174",
"0.5512991",
"0.5498908",... | 0.7738 | 0 |
Creates a list of victory conditions based on the size of the board | def create_victory_conditions(size): #Written by Cody West. Not used in current program, could be used to make boards of different sizes
victory_conditions = []
for i in range(size):
horizontal_victory = []
for n in range(size):
horizontal_victory.append(size*i+n)
victory_co... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create_board(size) -> list:\n return list(itertools.product([i for i in range(size)], repeat=2))",
"def create_board(self, size, cars):\n board = [[None for i in range(size)] for j in range(size)]\n\n for car in cars.values():\n for i in range(car.length):\n if car.... | [
"0.66391665",
"0.62301445",
"0.6140845",
"0.60436356",
"0.6038024",
"0.5961014",
"0.5920955",
"0.58922297",
"0.5841574",
"0.581635",
"0.57947874",
"0.5757776",
"0.57379335",
"0.57237613",
"0.570596",
"0.56783783",
"0.5668432",
"0.56344336",
"0.5629953",
"0.56038624",
"0.56017... | 0.8714315 | 0 |
Calculates rscu values for each codon | def calculate_rscu(handle: str, genetic_code_num: int, min_len_threshold: int = 200, gene_analysis: bool = False,
save_file: bool = False, file_name: str = 'RSCU_report', folder_path: str = 'Report') -> \
dict[str, float | dict[str, float]]:
records = parse(handle, 'fasta')
references... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def SumaryCompras(vj):\n\n vj.CompasCUC = vj.MontoPrecios = vj.GanancPrecios = 0.0\n\n for row in vj.tbCompras.rows.values():\n prec = vj.MD.Convert( row.precio, row.moneda, MD.Cuc ) # Siempre lleva el precio a CUC\n\n vj.MontoPrecios += ( prec * row.count )\n vj.CompasCUC ... | [
"0.56749076",
"0.5645466",
"0.5644362",
"0.5638017",
"0.56055605",
"0.55989563",
"0.5504229",
"0.54844487",
"0.54743993",
"0.54574186",
"0.54527915",
"0.5400491",
"0.53917223",
"0.53822356",
"0.53790843",
"0.5347198",
"0.5308095",
"0.530323",
"0.5293776",
"0.5282645",
"0.5274... | 0.58999944 | 0 |
return a set of nodes who are within max_dist of self | def neighbors(self, max_dist=3):
# TODO: this may have problems because the set doesn't
# compare object id but uses user defined comparison methods
# TODO: outgoing edges are no longer saved
found = set()
found.add(self)
queue = [(self, 0)]
while queue:
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def eligible_nodes(self):\n return [v for v in self.G if self.eligible_node(v)]",
"def getMaximumDistances(self):\n pass",
"def find(self, value, max_distance):\n\t\t# type: (Any, int) -> List[Tuple[int, Any]]\n\n\t\tnode = self.root\n\t\tret = [] # type: List[Tuple[int, Any]]\n\n\t\tif node is N... | [
"0.6185975",
"0.61843127",
"0.6099087",
"0.60814947",
"0.6033172",
"0.60061944",
"0.5881994",
"0.58049726",
"0.5757084",
"0.57157856",
"0.57139254",
"0.5710196",
"0.57095784",
"0.5681697",
"0.5668638",
"0.56296057",
"0.56086",
"0.5608161",
"0.5601407",
"0.5596248",
"0.55825",... | 0.7041858 | 0 |
show the neighborhood of this node in a picture | def show_neighborhood(self, max_dist=3, detailed=True):
dotstr = ''
for node in self.neighbors(max_dist):
if node is self:
dotstr += node.dot(color='dodgerblue', detailed=detailed)
else:
dotstr += node.dot(detailed=detailed)
dotstr = 'digra... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def show(self):\n data = []\n for row in self.grid:\n mid, bottom = [], []\n for node in row:\n \tmid += [0, int(node.right)]\n \tbottom += [int(node.down), 1]\n data += mid + [0] + bottom + [0] \n data[self.width*2+1] = 1\n data[-1] = 1\n data += (s... | [
"0.7047486",
"0.6181761",
"0.6136457",
"0.61287487",
"0.59386134",
"0.59066224",
"0.5844902",
"0.5810311",
"0.5801892",
"0.57685393",
"0.5745063",
"0.5735822",
"0.5733103",
"0.57241136",
"0.57115674",
"0.56976724",
"0.56679213",
"0.56657785",
"0.5641514",
"0.56204975",
"0.559... | 0.73047006 | 0 |
subpaths is a list of paths on tail nodes. return a new path generated by concatenating this edge. this is used in kbest paths generation. | def make_path(self, subpaths):
assert len(self.tail) == len(subpaths), '%s' % self
path = Path(self, subpaths)
weight = self.hg.one
for p in subpaths:
if p is not None:
weight = self.hg.prod(weight, p.weight)
weight = self.hg.prod(weight, self.hg.w(sel... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def decompose_paths_rec(node_inner, path):\n if node_inner.is_leaf():\n path = np.append(path, str(node_inner.value))\n return path[None]\n else:\n paths = np.array([])\n for edge_name in node_inner.child_nodes:\n ... | [
"0.59228057",
"0.5917371",
"0.5893389",
"0.5885784",
"0.58473676",
"0.57791805",
"0.5497774",
"0.54971564",
"0.5475109",
"0.5418675",
"0.5359241",
"0.5319792",
"0.5247005",
"0.51880467",
"0.51860625",
"0.516922",
"0.51333255",
"0.5104041",
"0.5086994",
"0.5030389",
"0.5015719... | 0.65290594 | 0 |
top down topo sort. nodes that don't reach the target node are thrown away | def topo_sort(self):
# TODO: detect cycles
self.find_reachable_nodes()
# save list of nodes in topo order
self.nodes = []
# assign each node an id field incrementally
cur_id = 0
# count visited outgoing edges for each node
unvisited = {}
for nid, n... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _reset_topological_order(self):\n self._topological_order = self._input_nodes[:]\n self.sorted = False",
"def topologicalSort(self):\r\n visited = [False]*self.vertices \r\n stack =[]\r\n \"\"\"\r\n using stack, problems with using code given by\r\n professor ... | [
"0.6479977",
"0.64079857",
"0.63420755",
"0.63285846",
"0.62891173",
"0.62466025",
"0.6230972",
"0.6165624",
"0.61602473",
"0.6127933",
"0.6103531",
"0.6076643",
"0.60480684",
"0.60202795",
"0.5990248",
"0.5957457",
"0.59298575",
"0.59276503",
"0.592397",
"0.59147286",
"0.584... | 0.7133982 | 0 |
Read a file and return a toposorted hypergraph. | def deserialize(self, filename):
f = open(filename)
edges_tails = []
nodes = []
# first pass adds incoming edges to nodes
for line in f:
if '->' in line: # edge
edge = self.edge_class()
tail_ids, head_id = edge.deserialize(line)
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def read_graph(filename):\n G = Hypergraph()\n\n f = open(filename, 'r', encoding='utf8')\n lines = f.readlines()\n if args.weighted:\n for line in lines:\n line = line.split()\n edge_name = line[0]\n weight = line[1]\n G.add_edge(edge_name, line[2:], ... | [
"0.7323825",
"0.6937586",
"0.68380326",
"0.67994225",
"0.67790306",
"0.6770359",
"0.6753334",
"0.669916",
"0.6612476",
"0.65449065",
"0.6532908",
"0.6516059",
"0.64703196",
"0.64033914",
"0.63891566",
"0.6366815",
"0.63625896",
"0.634472",
"0.6317197",
"0.6311096",
"0.6296221... | 0.7031254 | 1 |
Standard backtracking approach to find the optimal opmesh assignment, starting with the optimal number of stages (best_n_stages). The return is a list [((layer_start, next_layer_start), submesh_shape_idx, sharding_config_idx)] where (layer_start, next_layer_start) is [) slice of the ops and submesh_shape_idx is the sub... | def get_optimal_submesh_assignments(
best_n_stages, F_argmin, n_devices, n_ops, submesh_sizes
):
current_s = best_n_stages
current_layer = 0
current_devices = n_devices
optimal_layer_submesh_assignments = []
while current_s > 0 and current_layer < n_ops and current_devices > 0:
next_sta... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def inter_op_dp_inner_loop(\n n_layers, n_devices, submesh_sizes, valid_idxs_costs, max_n_succ_stages\n):\n F = np.full((n_layers + 1, n_layers + 1, n_devices + 1), np.inf, dtype=np.float32)\n F_stage_max = np.full(\n (n_layers + 1, n_layers + 1, n_devices + 1), 0.0, dtype=np.float32\n )\n F_... | [
"0.59374243",
"0.5722452",
"0.51469857",
"0.51208717",
"0.51167727",
"0.5081394",
"0.50553244",
"0.50473976",
"0.5028678",
"0.5010286",
"0.49406895",
"0.49098796",
"0.48995638",
"0.4865513",
"0.48511472",
"0.48335147",
"0.48096806",
"0.47716156",
"0.4743922",
"0.47341198",
"0... | 0.7721114 | 0 |
Count the number of times elem appears in the reversed iterator. | def count(self, elem):
return self.iter.count(elem) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def sequence_sorted_count(self, x, reverse=False):\n c = 0\n if reverse: it = reversed(self)\n else: it = iter(self)\n for v in it:\n if x == v:\n c += 1\n break\n for v in it:\n if x == v: c += 1\n else: break\n return c",
"def count(self):\n\n count = 0\n x = self.begin\n... | [
"0.710874",
"0.67030925",
"0.65069044",
"0.6468267",
"0.6360811",
"0.6293502",
"0.62844634",
"0.6255483",
"0.62217087",
"0.6204283",
"0.61864936",
"0.6095033",
"0.6027348",
"0.5992894",
"0.5981212",
"0.59621656",
"0.59607416",
"0.5958107",
"0.59503806",
"0.593788",
"0.5935426... | 0.70186836 | 1 |
Find the index of elem in the reversed iterator. | def index(self, elem):
return _coconut.len(self.iter) - self.iter.index(elem) - 1 | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def r_index(sequence, element):\n\n for i, e in enumerate(reversed(sequence)):\n if element == e:\n return len(sequence) - 1 - i\n else:\n raise ValueError(\"r_index(sequence, element):\\\n element not in the sequence\")",
"def index(self, elem):\n ... | [
"0.7337428",
"0.7109907",
"0.67639583",
"0.6708626",
"0.66251403",
"0.6604515",
"0.6553324",
"0.65205306",
"0.6481329",
"0.6373556",
"0.6335034",
"0.6285708",
"0.6278031",
"0.6270351",
"0.62547594",
"0.6241182",
"0.62061155",
"0.6160364",
"0.6146057",
"0.61259276",
"0.6125455... | 0.7336818 | 1 |
consume(iterable, keep_last) fully exhausts iterable and return the last keep_last elements. | def consume(iterable, keep_last=0):
return _coconut.collections.deque(iterable, maxlen=keep_last) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def last(iterable):\n d = deque(iterable, maxlen=1)\n try:\n return d.pop()\n except IndexError:\n raise ValueError(\"Cannot return last item from empty iterable {!r}\".format(iterable))",
"def last(iterable):\n it = iter(iterable)\n item = next(it)\n for item in it:\n pass... | [
"0.65945584",
"0.6441955",
"0.6378709",
"0.6298682",
"0.62027675",
"0.5920305",
"0.58600926",
"0.56532353",
"0.5636033",
"0.5536152",
"0.54646903",
"0.5434246",
"0.5425633",
"0.53895926",
"0.5381128",
"0.5375591",
"0.5357746",
"0.5334514",
"0.5308047",
"0.52714187",
"0.526574... | 0.7717289 | 0 |
Construct an object of the given data_type containing the given arguments. | def makedata(data_type, *args):
if _coconut.hasattr(data_type, "_make") and _coconut.issubclass(data_type, _coconut.tuple):
return data_type._make(args)
if _coconut.issubclass(data_type, (_coconut.map, _coconut.range, _coconut.abc.Iterator)):
return args
if _coconut.issubclass(data_type, _co... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __init__(self, data_type=None):\n self.type = data_type",
"def from_data(cls, data):\n return object.__new__(cls)",
"def create(cls, data=None):\n # allow create() calls with no input\n if not data:\n data = {}\n\n return cls(**data)",
"def __init__(self,\n ... | [
"0.65806115",
"0.6494723",
"0.6493428",
"0.6436474",
"0.63050216",
"0.61820936",
"0.6163499",
"0.61415094",
"0.60745573",
"0.6070686",
"0.6051727",
"0.60087764",
"0.6002497",
"0.5975732",
"0.5947289",
"0.58672804",
"0.5859592",
"0.58576393",
"0.5827365",
"0.5820931",
"0.58127... | 0.7436465 | 0 |
fmap(func, obj) creates a copy of obj with func applied to its contents. Override by defining obj.__fmap__(func). | def fmap(func, obj):
if _coconut.hasattr(obj, "__fmap__"):
return obj.__fmap__(func)
if obj.__class__.__module__ == "numpy":
from numpy import vectorize
return vectorize(func)(obj)
return _coconut_makedata(obj.__class__, *(_coconut_starmap(func, obj.items()) if _coconut.isinstance(ob... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def fmap(function, descriptor):\n return MappedDescriptor(descriptor, function)",
"def map(self, func):\n return _(map(func, self._))",
"def map(self, function):\n return FunctionalWrapper(map(function, self.data))",
"def fmap(self, func):\n @wraps(self.v)\n def state_mapper(st... | [
"0.6220919",
"0.5839332",
"0.5682536",
"0.56519437",
"0.55576444",
"0.5554828",
"0.54123265",
"0.53920573",
"0.5390306",
"0.53785086",
"0.5342291",
"0.5333462",
"0.53316593",
"0.532099",
"0.526166",
"0.52036095",
"0.52029043",
"0.51939046",
"0.5186709",
"0.51471406",
"0.50727... | 0.80145234 | 0 |
Thread loop. This is an infinite loop. The iter method calls self.sql_queue.get() which blocks if there are not values in the queue. As soon as values are placed into the queue the process will continue. If many executes happen at once it will churn through them all before calling commit() to speed things up by reducin... | def run(self):
logging.debug("run: Thread started")
execute_count = 0
for token, query, values in iter(self.sql_queue.get, None):
logging.debug("sql_queue: %s", self.sql_queue.qsize())
if token != self.exit_token:
logging.debug("run: %s", query)
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def run():\r\n num_workers = g.num_query_queue_workers\r\n wq = WorkQueue(num_workers = num_workers)\r\n wq.start()\r\n\r\n while True:\r\n job = None\r\n #limit the total number of jobs in the WorkQueue. we don't\r\n #need to load the entire db queue right away (the db queue can\r... | [
"0.7164139",
"0.6617921",
"0.6452826",
"0.6395609",
"0.6328278",
"0.62974733",
"0.62549317",
"0.6231184",
"0.616941",
"0.60640925",
"0.6058464",
"0.5961299",
"0.588708",
"0.5882663",
"0.5875031",
"0.5870313",
"0.5865822",
"0.5852583",
"0.5845655",
"0.5839005",
"0.5820537",
... | 0.7875983 | 0 |
Get the query results for a specific token. | def query_results(self, token):
delay = .001
while True:
if token in self.results:
return_val = self.results[token]
del self.results[token]
return return_val
# Double back on the delay to a max of 8 seconds. This prevents
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def listSearches(self, authenticationToken):\r\n pass",
"async def _perform_get_results(self, login_token, result_token):\n data = {\"resultSetToken\": result_token, \"token\": login_token}\n return await self._perform_request(\"get-results\", data, lambda r: r.json())",
"def get_query_results... | [
"0.6801665",
"0.67875",
"0.67327553",
"0.62611675",
"0.6151787",
"0.6134605",
"0.5989142",
"0.596726",
"0.5918041",
"0.5917684",
"0.5901937",
"0.5862396",
"0.5783096",
"0.5776911",
"0.57683307",
"0.5756532",
"0.5746983",
"0.5745782",
"0.571591",
"0.57145137",
"0.5698427",
"... | 0.7163675 | 0 |
Returns the 2nd largest value from a given list. | def second_largest(values: List[int]) -> int:
try:
return sorted(set(values))[-2]
except IndexError:
raise ValueError("second_largest() needs at least two distinct values") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def two_largest(inlist):\n largest = second_largest = 0\n it1 = it2 = 0\n\n for i,item in enumerate(inlist):\n if item > largest:\n largest = item\n it1 = i\n elif largest > item > second_largest:\n second_largest = item\n it2 = i\n # Return the... | [
"0.79893696",
"0.7755604",
"0.76443726",
"0.75765264",
"0.7529355",
"0.75202054",
"0.75019395",
"0.746542",
"0.7456516",
"0.738916",
"0.7388165",
"0.733121",
"0.7291496",
"0.7259317",
"0.7139178",
"0.713446",
"0.70853615",
"0.7072863",
"0.6986864",
"0.6984842",
"0.6957062",
... | 0.8168143 | 0 |
Try to get the path to pdb.py and return it in a list. | def GetPdbArgs(python):
# Usually, python is /usr/bin/pythonxx and pdb is /usr/lib/pythonxx/pdb.py
components = python.split('/')
if len(components) >= 2:
pdb_path = '/'.join(components[0:-2] + ['lib'] +
components[-1:] + ['pdb.py'])
if os.access(pdb_path, os.R_OK):
return [p... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def pdbfile_list():\n import glob, os\n os.chdir(\"../Data\")\n file_list = []\n for file in glob.glob(\"*.pdb\"):\n file_list.append(file)\n return file_list",
"def pdbfile_list():\n \n import glob, os\n os.chdir(\"../Data\")\n file_list = []\n for file in glob.glob(\"*.pdb\... | [
"0.7001057",
"0.6927535",
"0.6694564",
"0.5969401",
"0.5900031",
"0.58544034",
"0.5816103",
"0.58008647",
"0.58002234",
"0.57855517",
"0.57504606",
"0.5737899",
"0.5679186",
"0.5636797",
"0.55898374",
"0.5576825",
"0.54973745",
"0.53993475",
"0.53957206",
"0.53377414",
"0.532... | 0.72876877 | 0 |
Print usage for the stub script. | def PrintOurUsage():
print 'Stub script %s (auto-generated). Options:' % sys.argv[0]
print ('--helpstub '
'Show help for stub script.')
print ('--debug_binary '
'Run python under debugger specified by --debugger.')
print ('--debugger=<debugger> '
"Debugger f... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def usage():",
"def usage():",
"def print_usage():\n print(helptxt)\n sys.exit(2)",
"def usage():\n pass",
"def usage() :\n\n print usage.__doc__",
"def usage():\n print(__doc__.strip())",
"def display_usage():\n print >> sys.stderr, __doc__",
"def print_usage():\r\n print(\... | [
"0.810532",
"0.810532",
"0.80087817",
"0.7974354",
"0.7823985",
"0.7744431",
"0.7735299",
"0.760537",
"0.76011324",
"0.76011324",
"0.7589592",
"0.7553557",
"0.7550795",
"0.75118643",
"0.7472906",
"0.746817",
"0.7346284",
"0.7329634",
"0.7301601",
"0.7280952",
"0.7278727",
"... | 0.8339372 | 0 |
Run a module as a script. Locates the module's file and runs it in the current interpreter, or optionally a debugger. | def RunScriptModule(module):
args = sys.argv[1:]
debug_binary = False
debugger = 'gdb --args'
debug_script = False
show_command_and_exit = False
while args:
if args[0] == '--helpstub':
PrintOurUsage()
sys.exit(0)
if args[0] == '--debug_binary':
debug_binary = True
args = ar... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def run_python_script(package=None, module=None, args=[], p_args=[]):\n assert module is not None\n assert isinstance(args, (tuple, list)) and isinstance(p_args, (tuple, list))\n path = python_script_exists(package, module)\n run_program(sys.executable, p_args + [path] + args)",
"def run_script(exten... | [
"0.6864769",
"0.6780037",
"0.6562564",
"0.65126973",
"0.63618916",
"0.62197036",
"0.6204552",
"0.6153162",
"0.6135312",
"0.61225456",
"0.61223215",
"0.61039793",
"0.60877556",
"0.6078428",
"0.603614",
"0.5902457",
"0.5856509",
"0.58559155",
"0.5846937",
"0.58052075",
"0.57135... | 0.84551585 | 0 |
Generates a dict of dicts from dot separated keys. Yet without associated values. | def make_tree(dot_separated_keys):
tree = {}
for item in dot_separated_keys:
inside_tree = tree
for part in item.split('.'):
inside_tree = inside_tree.setdefault(part, {})
return tree | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def undotted_keys(dict):\n return {k.lstrip(\".\"): v for k, v in dict.items()}",
"def hdict(keys, value, sep=\".\"):\n return reduce(lambda v, k: {k: v}, reversed(keys.split(sep)), value)",
"def create_recursive_dot_dict(data: Dict[str, Any], cls=DotDict) -> Union[DotDict, DotDefaultDict]:\n res = cl... | [
"0.73150593",
"0.666839",
"0.6528275",
"0.647951",
"0.6416033",
"0.639155",
"0.6269472",
"0.6193029",
"0.6132605",
"0.6059191",
"0.5956652",
"0.59102404",
"0.5872739",
"0.5800979",
"0.57487774",
"0.5689122",
"0.5673279",
"0.562703",
"0.5615472",
"0.5609791",
"0.56088036",
"... | 0.73592526 | 0 |
Sum of the factorials of the digits of a number x | def factsum(x):
return sum(list(map(lambda x: factorial(x), getdigits(x)))) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def factorial_digit_sum(n):\n sum = 0\n factStr = str(factorial(n))\n for digit in factStr:\n sum += int(digit)\n return sum",
"def Sum_Numbers_x_Power_Digits(x):\n totalSum = 0 \n for i in xrange(10, 999999):\n if i == sum([int(j)**x for j in str(i)]):\n totalSum +=... | [
"0.7923695",
"0.75797725",
"0.75408524",
"0.7531802",
"0.7449112",
"0.73583555",
"0.7314269",
"0.7309004",
"0.7186043",
"0.7158655",
"0.71404076",
"0.7107824",
"0.70873946",
"0.70631707",
"0.7045362",
"0.7043718",
"0.7035779",
"0.70124704",
"0.6972245",
"0.6952173",
"0.694104... | 0.8542544 | 0 |
Clone a `Sequential` model instance. Model cloning is similar to calling a model on new inputs, except that it creates new layers (and thus new weights) instead of sharing the weights of the existing layers. Arguments | def _clone_sequential_model(model, input_tensors=None):
if not isinstance(model, Sequential):
raise ValueError('Expected `model` argument '
'to be a `Sequential` model instance, '
'but got:', model)
def clone(layer):
return layer.__class__.from_... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def clone_model(model, input_tensors=None):\n if isinstance(model, Sequential):\n return _clone_sequential_model(model, input_tensors=input_tensors)\n else:\n return _clone_functional_model(model, input_tensors=input_tensors)",
"def clone(self):\n return _libsbml.Model_clone(self)",
... | [
"0.7385709",
"0.66616267",
"0.6578116",
"0.6526493",
"0.6467478",
"0.62646365",
"0.62586915",
"0.6220581",
"0.6103913",
"0.60691476",
"0.6056226",
"0.6018872",
"0.6015779",
"0.6011683",
"0.5961887",
"0.5907166",
"0.58924145",
"0.5868687",
"0.58646977",
"0.584091",
"0.58357793... | 0.7651821 | 0 |
Clone any `Model` instance. Model cloning is similar to calling a model on new inputs, except that it creates new layers (and thus new weights) instead of sharing the weights of the existing layers. Arguments | def clone_model(model, input_tensors=None):
if isinstance(model, Sequential):
return _clone_sequential_model(model, input_tensors=input_tensors)
else:
return _clone_functional_model(model, input_tensors=input_tensors) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def clone(self):\n return _libsbml.Model_clone(self)",
"def clone(self):\n return _libsbml.ModelCreator_clone(self)",
"def copy(self):\n new_model = Model(\n name=self.name,\n functions=copy.deepcopy(self.functions),\n domain=self.domain.copy(),\n ... | [
"0.7209398",
"0.70578766",
"0.6805522",
"0.6779844",
"0.6744178",
"0.6651548",
"0.66036665",
"0.64693105",
"0.6441572",
"0.64124787",
"0.6412031",
"0.64043045",
"0.63693136",
"0.636181",
"0.6343172",
"0.6320473",
"0.6242863",
"0.6219034",
"0.61284405",
"0.6126675",
"0.6014657... | 0.7679161 | 0 |
Initialize the joystick components | def init(self):
pygame.init()
pygame.joystick.init()
self.controller = pygame.joystick.Joystick(0)
self.controller.init()
self.x=0
self.y=0 | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __init__(self):\n self.isMoving = 0#0 is stop, 1 is moving forward, -1 is moving backward\n self.isRoutating = False\n pygame.init()\n pygame.joystick.init()\n self.controller = pygame.joystick.Joystick(0)\n self.controller.init()\n if not self.axis_data:\n ... | [
"0.77946836",
"0.7709619",
"0.7708428",
"0.7690953",
"0.76627296",
"0.7585769",
"0.7510696",
"0.7043306",
"0.69623667",
"0.68985695",
"0.6756267",
"0.67009485",
"0.65528977",
"0.6516639",
"0.64917547",
"0.63566685",
"0.63212687",
"0.6281358",
"0.61667794",
"0.612322",
"0.6119... | 0.82271236 | 0 |
Shift the colormap by dragging the cursor left or right. Stretch the colormap by dragging the cursor up or down. | def ms_contrast(self, viewer, event, data_x, data_y, msg=True):
if not self.cancmap:
return False
event.accept()
msg = self.settings.get('msg_contrast', msg)
x, y = self.get_win_xy(viewer)
if event.state == 'move':
self._tweak_colormap(viewer, x, y, 'pre... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def shift_cmap(cmap, start=0., locpoint=0.5, stop=1.0, name='centered'):\r\n\r\n # declare a colour + transparency dictionary\r\n cdict={'red':[], 'green':[], 'blue':[], 'alpha':[]}\r\n\r\n # regular index to compute the colors\r\n RegInd = np.linspace(start, stop, cmap.N)\r\n\r\n # shifted index to... | [
"0.5790858",
"0.57863927",
"0.5722508",
"0.56208885",
"0.5615264",
"0.56151456",
"0.54330593",
"0.54213333",
"0.52664816",
"0.52410126",
"0.5228845",
"0.5213258",
"0.520547",
"0.5198562",
"0.5171602",
"0.5124414",
"0.5097131",
"0.5093487",
"0.5091165",
"0.5089418",
"0.5084612... | 0.58629936 | 0 |
An interactive way to restore the colormap contrast settings after a warp operation. | def ms_contrast_restore(self, viewer, event, data_x, data_y, msg=True):
if not self.cancmap:
return False
event.accept()
if event.state == 'down':
self.restore_contrast(viewer, msg=msg) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def ms_contrast(self, viewer, event, data_x, data_y, msg=True):\n if not self.cancmap:\n return False\n event.accept()\n msg = self.settings.get('msg_contrast', msg)\n\n x, y = self.get_win_xy(viewer)\n\n if event.state == 'move':\n self._tweak_colormap(view... | [
"0.63572615",
"0.6100809",
"0.5673598",
"0.5571644",
"0.55231154",
"0.551467",
"0.547287",
"0.5454797",
"0.5436428",
"0.53191686",
"0.52949184",
"0.52944916",
"0.52695817",
"0.5267348",
"0.5224302",
"0.52170444",
"0.5212828",
"0.52027863",
"0.5189108",
"0.5177404",
"0.5158237... | 0.64222914 | 0 |
This decorator is meant to decorate management commands. Any exceptions raised in the command's handle method will be logged and reraised. | def log_exceptions(cls):
class NewClass(cls):
def handle(self, *args, **options):
try:
super().handle(args, options)
except Exception:
logger.exception("Management command '{}' failed. Traceback follows: ".format(sys.argv[1]))
raise
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def command(login_required=True):\n def decorate(f):\n def wrapper(self, *args):\n try:\n return f(self, *args)\n except ApiError as e:\n log_exception(e)\n raise BackendException('dpbx api error \"%s\"' % (e,))\n except Except... | [
"0.5904763",
"0.578845",
"0.5735835",
"0.56567407",
"0.56270766",
"0.5600731",
"0.5581101",
"0.5554357",
"0.5539104",
"0.55316645",
"0.5529846",
"0.55071104",
"0.5505431",
"0.5505338",
"0.5483254",
"0.54173476",
"0.54166645",
"0.53439975",
"0.53280574",
"0.5321739",
"0.526793... | 0.62160754 | 0 |
Creates a list of random minibatches from (X, Y) | def random_mini_batches(X, Y, mini_batch_size = 64, seed = 0):
np.random.seed(seed) # To make your "random" minibatches the same as ours
m = X.shape[1] # number of training examples
mini_batches = []
# Step 1: Shuffle (X, Y)
permutation = list(np.random.perm... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def random_mini_batches(X, Y, mini_batch_size = 64):\n\n\n\tm = X.shape[1]\n\tmini_batches = []\n\n\t#Shuffling around the data randomly according to the 'permutation' list\n\tpermutation = list(np.random.permutation(m))\n\tshuffled_X = X[:, permutation]\n\tshuffled_Y = Y[:, permutation].reshape((1,m))\n\n\tcomple... | [
"0.65385675",
"0.6229042",
"0.6218775",
"0.62119395",
"0.62032425",
"0.61461645",
"0.6137679",
"0.60998034",
"0.6097758",
"0.60959524",
"0.60723096",
"0.60708946",
"0.6014316",
"0.5990937",
"0.5940285",
"0.5884059",
"0.5871586",
"0.5844728",
"0.58423215",
"0.5820612",
"0.5779... | 0.6306558 | 1 |
Tests that Predictor instances are not serializable. | def test_serialization():
# Class is serializable.
ray.put(DummyPredictor)
# Instance is not serializable.
predictor = DummyPredictor()
with pytest.raises(PredictorNotSerializableException):
ray.put(predictor) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_deserialize_bad_data(self):\n data = \"this is not a dictionary\"\n recommendation = Recommendation()\n self.assertRaises(DataValidationError, recommendation.deserialize, data)",
"def test_valid_serialization_unfit_model(self):\n instance = GammaUnivariate()\n result =... | [
"0.58206624",
"0.58120334",
"0.5762754",
"0.57272524",
"0.56799954",
"0.56695384",
"0.56055886",
"0.5602577",
"0.5546996",
"0.5540443",
"0.5539814",
"0.55207306",
"0.54866004",
"0.5472597",
"0.5461503",
"0.5412684",
"0.53859967",
"0.537395",
"0.535977",
"0.53534746",
"0.53437... | 0.7470269 | 0 |
Adds player calendar to team_cal and returns filled teams | def match_with_player(self, name, player_cal):
updated_team_cal = self.team_cal.copy()
filled_team_keys = []
for loc in player_cal.stack().index:
current_player_count = self.team_cal.at[loc]
if self.price_cal.at[loc] <= player_cal.at[loc]:
if current_play... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_teams():",
"def _create_teams(self):\n\t\tself.teamsDict = {}\n\t\tself.teamNamesList = []\n\t\tfor team in range(self.numberOfTeams):\n\t\t\tname = 'TEAM_'+str(team+1)\n\t\t\tself.teamNamesList.append(name)\n\t\t\tself.teamsDict[name] = app.game.team.Team(sport_type=self.gameData['sportType'])",
"def ... | [
"0.6536402",
"0.59650755",
"0.5887284",
"0.58515286",
"0.5829555",
"0.579289",
"0.5745127",
"0.57173425",
"0.57036144",
"0.56878537",
"0.56028706",
"0.55922323",
"0.5529244",
"0.5521643",
"0.54728687",
"0.54638255",
"0.54560107",
"0.5452628",
"0.5441508",
"0.5441441",
"0.5440... | 0.6215539 | 1 |
Sends message to RabbitMQ exchange | def send_message(msg, exchange, key=None):
print(msg)
connection = pika.BlockingConnection(pika.ConnectionParameters(host='rabbitmq'))
channel = connection.channel()
exchange_type = 'direct' if exchange == 'other' else 'topic'
channel.exchange_declare(exchange=exchange, exchange_type=exchange_type)
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def send_rabbit_message (params ):\n print \"sending message to rabbitmq exchange\"\n logging.basicConfig()\n rabbitmq_host = params.get( 'host' )\n rabbitmq_port = params.get( 'port' )\n rabbitmq_username = params.get( 'user-name' )\n rabbitmq_password = params.get( 'password' )\n exchange_na... | [
"0.7955153",
"0.73282826",
"0.69862974",
"0.6899452",
"0.68242073",
"0.676501",
"0.6764902",
"0.6729278",
"0.669033",
"0.668374",
"0.66331697",
"0.66054446",
"0.65912455",
"0.6582951",
"0.6516775",
"0.64865685",
"0.6484264",
"0.64665216",
"0.64554477",
"0.6451518",
"0.643939"... | 0.75768226 | 1 |
Email summary of results to user. | def EmailResults(recipient, error_mesg, topdir, dumpfile, logfile, motcor_summary):
#*********************************************************************************
if recipient is None:
return
elif 'noname' in recipient:
return
sender = 'preprocess'
if 'Abnormal' in error_mesg > 0:
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _show_summary(self):\n print 'Summary:'\n print ' Reports downloaded successfully: %d' % self.counts\n print ' Reports not downloaded: %d\\n' % self.failed",
"def publish_summary(self, jobs):\n pass",
"def report(self, results):\n self.notice(\"Test Report\\n\")\n\n ... | [
"0.6340017",
"0.6205421",
"0.6195181",
"0.61352056",
"0.60605377",
"0.60505825",
"0.5933892",
"0.5929879",
"0.5912047",
"0.57762545",
"0.57740766",
"0.57343775",
"0.56606674",
"0.56550497",
"0.5646071",
"0.56351393",
"0.5634105",
"0.5610652",
"0.5604074",
"0.56035924",
"0.559... | 0.648858 | 0 |
Synthesize yaml header filename from directory name. | def _yaml_filename(self, path):
fullpath = os.path.abspath(path)
if not os.path.isdir(fullpath):
dirname = os.path.dirname(fullpath)
else:
dirname = path
if dirname.endswith('/'):
dirname = dirname[:-1]
fname = dirname.split('/')[-1] + '.yaml'
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _get_file_name(name: types.TSeedName) -> str:\n return f\"{name}.yml\"",
"def format_filename(title: str, id: Any, ext: str = \".\", dirFormat=None):\r\n ...",
"def file_title(self):\n basename = os.path.basename(self.__path)\n index_dot = basename.rfind(\".\")\n if index_dot... | [
"0.63299215",
"0.6177597",
"0.6154436",
"0.6145138",
"0.61193216",
"0.6117771",
"0.60900265",
"0.6084294",
"0.59812474",
"0.59652424",
"0.5949886",
"0.59462756",
"0.5918559",
"0.59006333",
"0.5891024",
"0.58728975",
"0.5864215",
"0.5860745",
"0.5852123",
"0.58312166",
"0.5803... | 0.6754749 | 0 |
Create list of epis in pfile format (epi_series) and of epis in dicom format (epirt_paths) | def _EpiInfo(self, info, path):
epi_vals = {'tdim':self.hdr['tdim'], 'plane':self.hdr['plane'], \
'SeriesNumber':self.hdr['subhdr']['SeriesNumber']}
for key in self.epi_keys.keys():
if self.epi_keys[key] != str(epi_vals[key]):
# Return None, which will caus... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def AssignEpiNames(self):\n# Sort each run in the series by its acquisition time.\n epi_sort = self.epi_times.keys()\n epi_sort.sort()\n# Rewrite pfiles as an ordered list of p-files to be reconstructed.\n for idx in xrange(len(epi_sort)):\n entry = self.epi_times[epi_so... | [
"0.6314016",
"0.59568083",
"0.5881365",
"0.5844795",
"0.5802068",
"0.5752258",
"0.56392115",
"0.54253495",
"0.5387592",
"0.5376296",
"0.53625387",
"0.5316459",
"0.52880996",
"0.5277681",
"0.52515364",
"0.52128714",
"0.5204417",
"0.5186836",
"0.5180629",
"0.5144857",
"0.514438... | 0.63749075 | 0 |
Pair up each epi with a fieldmap. | def _SetFmapInfo(self):
for epi in self.pfiles + self.epirt_paths:
self.info[epi]['fmapname'] = None
self.info[epi]['fmap_entry'] = None
for entry in self.entry_map['fmap']:
fmap_name = self.info[entry]['imgfile'] + self.info[entry]['suffix']
i... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def MakeFieldmaps(self):\n if self.verbose:\n print 'Compute fieldmaps.'\n for entry in self.info:\n if self.info[entry]['type'] == 'fmap':\n if self.info[entry]['imgfile'] == None:\n# Fieldmap data not found.\n return\n# ... | [
"0.5794583",
"0.56985533",
"0.56411123",
"0.5450113",
"0.5425905",
"0.5395057",
"0.53146863",
"0.5253061",
"0.52433765",
"0.5232632",
"0.5187637",
"0.51365435",
"0.511374",
"0.5107384",
"0.51051044",
"0.51040184",
"0.50853544",
"0.50818384",
"0.50797653",
"0.5053735",
"0.5050... | 0.6167625 | 0 |
Find the hires structural image that was acquired nearest to "acqtime" | def _FindNearestAnat(self, acqtime):
tdiff_min = 1e6
for anat in self.entry_map['anat']:
if self.info[anat]['type'] == 'T1High' and \
self.info[anat]['InversionTime'] > 0.:
tdiff = abs(acqtime - self.info[anat]['acqtime'])
if tdiff ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def closest_in_time(images, target):\n\n tgt_mjd = fits.getheader(target, ext=1)['mjd-obs']\n mjds = np.array([fits.getheader(i, ext=1)['mjd-obs'] for i in images])\n\n return images[abs(mjds - tgt_mjd).argsort()[0]]",
"def find(image):\n keypoint, description = describe(image)\n # load keypoints, des... | [
"0.61136955",
"0.5495255",
"0.53449804",
"0.53088015",
"0.5267729",
"0.5264703",
"0.52540445",
"0.51978594",
"0.51893973",
"0.5173132",
"0.5172842",
"0.517216",
"0.5133897",
"0.51184076",
"0.50679076",
"0.50616145",
"0.5060293",
"0.5051561",
"0.5042053",
"0.5037389",
"0.50302... | 0.58393806 | 1 |
Create structures defining acquisition time for fieldmaps and anatomicals. First find the fieldmap (or hires structural if no fieldmap was collected) nearest (on average) to the epis. Then define this series as the one that should be in register with the epis. | def _SetAnatTgts(self):
anat_candidates = {}
fmap_candidates = {}
for entry in self.entry_map['anat']:
if self.info[entry]['type'] == 'T1High':
anat_candidates[entry] = self.info[entry]['acqtime']
# Find the valid anatomical acquired nearest to fieldmap.
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def GetEpiAcqTimes(self, series):\n# Find minimum and maximum start times for each acquistion in series.\n self.epi_times = {}\n for entry in self.entry_map['epi']:\n# Loop through each file in this series.\n if self.info[entry]['series'] == series and \\\n ... | [
"0.62284875",
"0.5733199",
"0.54121506",
"0.53654045",
"0.5362718",
"0.53480995",
"0.53380924",
"0.5298414",
"0.5262806",
"0.52612984",
"0.52312875",
"0.5173023",
"0.5139651",
"0.5129809",
"0.5126058",
"0.5113684",
"0.51000977",
"0.5095595",
"0.5085868",
"0.5080458",
"0.50771... | 0.59192055 | 1 |
Create a text string summarizing how the motion correction was done. | def SummarizeMotionTargets(self):
text = '\nSummary of motion-correction: \n'
for epi in self.entry_map['epi']:
info = self.info[epi]
text += self.GetBase(epi, '')
base = self.GetBase(info['base_entry'], '')
text += ' ->3dvolreg-> %s[%s]' % (base, info['ba... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def prescription(self):\n prescription = \"\\n{0:>10}\\t{1:>10}\\t{2:>10}\\t{3:>10}\\n\".format(\"R\",\"Material\",\"d\",\"diameter\")\n for surface in self.lensSurfaces():\n prescription += \"{0:>10.2f}\\t{1:>10}\\t{2:>10.2f}\\t{3:>10.2f}\\n\".format(surface.R, str(surface.mat), surface.s... | [
"0.6384936",
"0.634679",
"0.63305056",
"0.63101876",
"0.62891483",
"0.62351215",
"0.62246543",
"0.6216952",
"0.61375284",
"0.6118015",
"0.6031679",
"0.597089",
"0.59577096",
"0.59560966",
"0.5955112",
"0.59385556",
"0.5877444",
"0.58648694",
"0.58440596",
"0.58404136",
"0.583... | 0.69408065 | 0 |
Find the correct ref.dat file for each pfile. | def _GetRefdat(self):
for rfile in self.refdats.keys():
# Get times for ref.dat files with a time-stamp.
words = rfile.replace('.','_').split('_')
if len(words) == 6 and words[-2].count(':') == 20:
# This file was time-stamped by the sequence. Get the
# ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def read_reference_data():\n return {f:read_local_file(f) for f in os.listdir(DATA_DIR)}",
"def get_input_file(self, *args, refsep='$', docopy=True):\n # filename = self.get_data(*args, docopy=docopy)\n filename = args[1]\n ref_files = ref_from_image(filename, ['IDCTAB', 'OFFTAB', 'NPOLFI... | [
"0.5827411",
"0.55954766",
"0.5543815",
"0.5515996",
"0.5477217",
"0.5447455",
"0.5424407",
"0.54009223",
"0.5372652",
"0.5370227",
"0.5364059",
"0.5320857",
"0.5294063",
"0.52870816",
"0.5261717",
"0.5260605",
"0.5242285",
"0.52146846",
"0.51936823",
"0.51909316",
"0.5184307... | 0.6289985 | 0 |
Assign names to each epi file based on information in the template. | def AssignEpiNames(self):
# Sort each run in the series by its acquisition time.
epi_sort = self.epi_times.keys()
epi_sort.sort()
# Rewrite pfiles as an ordered list of p-files to be reconstructed.
for idx in xrange(len(epi_sort)):
entry = self.epi_times[epi_sort[idx]]
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _add_filename_metadata(self, extra_metadata): \n \n # Make sure product_info section exists\n extra_metadata.setdefault('product_info', {})\n \n file_name = os.path.basename(self.fname)\n fn_comps = file_name.split(\"_\")\n \n if self.__class__ == SA... | [
"0.5765641",
"0.5753263",
"0.5717375",
"0.5547444",
"0.55394816",
"0.54884017",
"0.54623926",
"0.53843206",
"0.5353627",
"0.531927",
"0.52712166",
"0.5261715",
"0.523186",
"0.52143687",
"0.51853824",
"0.51815045",
"0.51764005",
"0.5170443",
"0.5149673",
"0.51465887",
"0.51442... | 0.72918445 | 0 |
Dump the info object to a yaml file. | def DumpInfo(self):
if self.logdir is None:
return
self.dumpfile = '%s/preprocess_info.yaml' % (self.logdir)
try:
f = open(self.dumpfile,'w')
f.write(yaml.dump(self.info,default_flow_style=False, indent=4))
f.close()
except IOError:
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def write(self, file=sys.stdout):\n d = self.to_dict()\n if d:\n yaml.dump([d], file, default_flow_style=False)",
"def __exit__(self, *_):\n with self._info_yaml_file_path.open(\"w\") as info:\n self._yml.dump(self._info, info)",
"def write(self):\n self.f.writ... | [
"0.7140269",
"0.6745914",
"0.67231625",
"0.6591301",
"0.6522555",
"0.6498975",
"0.64982736",
"0.6444522",
"0.63701254",
"0.62643826",
"0.62501603",
"0.61706054",
"0.60966444",
"0.60667735",
"0.6060812",
"0.6049239",
"0.6019757",
"0.60015565",
"0.60012335",
"0.59733576",
"0.59... | 0.7883224 | 0 |
Convert anatomical images from dicom or ifiles to briks or niftis. | def ConvertAnat(self):
if self.verbose:
print 'Convert T1 and T2 images...'
for entry in self.info:
info = self.info[entry]
if self.info[entry]['imgfile'] is None:
continue
if self.info[entry]['type'] in self.anat_types:
ke... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def main(input_folder, output_images_folder, output_files_folder, bb_file,\n archive_folder, name_mapping):\n\n output_images_folder = Path(output_images_folder)\n output_files_folder = Path(output_files_folder)\n archive_folder = Path(archive_folder)\n output_images_folder.mkdir(exist_ok=True)... | [
"0.5878483",
"0.5656656",
"0.5646914",
"0.5597715",
"0.5594963",
"0.55353117",
"0.5508064",
"0.54495406",
"0.54446286",
"0.5424856",
"0.5355759",
"0.5332224",
"0.5326884",
"0.53148586",
"0.52936196",
"0.5291717",
"0.52617556",
"0.5258072",
"0.5257662",
"0.525628",
"0.52407",
... | 0.5975682 | 0 |
Create the fieldmap(s) and the corresponding magnitude images. | def MakeFieldmaps(self):
if self.verbose:
print 'Compute fieldmaps.'
for entry in self.info:
if self.info[entry]['type'] == 'fmap':
if self.info[entry]['imgfile'] == None:
# Fieldmap data not found.
return
# Make... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def AlignFieldmaps(self):\n for entry in self.entry_map['fmap']:\n info = self.info[entry]\n\n# Register the magnitude image at the shortest TR to the T1-IR\n# structural image.\n target = self.info[self.norm_src]['imgfile'] + \\\n ... | [
"0.677067",
"0.64014757",
"0.62887424",
"0.6082136",
"0.58927894",
"0.58386827",
"0.58132875",
"0.57924163",
"0.57924163",
"0.57452226",
"0.5743414",
"0.57319504",
"0.57206607",
"0.57153034",
"0.563697",
"0.5628693",
"0.56157184",
"0.5559617",
"0.55475587",
"0.5537074",
"0.55... | 0.7716374 | 0 |
Create links to BRIK, HEAD, and .nii files. | def LinkFiles(self, srcdir, target):
if '+orig' in target:
tgt_prefix = target.replace('.BRIK','')
tgt_prefix = tgt_prefix.replace('.HEAD','')
linkfiles = ['%s.HEAD'%tgt_prefix, '%s.BRIK' %tgt_prefix]
else:
linkfiles = [target]
for linkfile in link... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _create_links(self):\n for line in self.iter_files_to_install():\n arcname, link = line.split()\n if link == 'False':\n continue\n self.files.append(create_link(arcname, link, self.prefix))",
"def makeLinks(self):\n self.deleteIndexFileIfExists()\... | [
"0.667778",
"0.59682673",
"0.5959984",
"0.567664",
"0.5635121",
"0.55980814",
"0.553239",
"0.5522011",
"0.54892784",
"0.54057527",
"0.5380412",
"0.5370104",
"0.53354234",
"0.5332412",
"0.5303601",
"0.5300853",
"0.52821183",
"0.5264791",
"0.5261789",
"0.5261702",
"0.5261481",
... | 0.6162017 | 1 |
Extract the initial EPIs stored in dicom format. | def ExtractFirstEpi(self):
for entry in self.info:
if self.info[entry]['type'] == 'first_epi':
epiname = self.info[entry]['imgfile']
cmd = 'convert_file %s -f0 %s %s %s' % \
(self.flip_opts, entry,epiname, self.info[entry]['filetype'])
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def dicom_load():\n # Identify folders with EPI data\n dirs = [i for i in os.listdir(dcm_dir) if os.path.isdir(os.path.join(dcm_dir, i))]\n d_cnt = 0\n for d in dirs:\n dcm_file = os.path.join(dcm_dir,d,os.listdir(os.path.join(dcm_dir,d))[0])\n try:\n dcm_data = pydicom.dcmread... | [
"0.6132044",
"0.59762484",
"0.5642774",
"0.53444785",
"0.52427983",
"0.52217543",
"0.5216209",
"0.51387924",
"0.5125599",
"0.50237185",
"0.5018066",
"0.5001039",
"0.49862388",
"0.49604324",
"0.4950634",
"0.49402615",
"0.49259216",
"0.49019468",
"0.48623866",
"0.4825966",
"0.4... | 0.6886132 | 0 |
Reconstruct the EPIs from pfiles. | def ReconEpis(self):
run = zeros(100)
if self.verbose:
print 'Reconstruct EPIs'
for pfile in self.pfiles_recon:
if self.info[pfile]['refdat'] is None:
# Find the ref.dat file later.
continue
if self.info[pfile]['compression'] is n... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def AssignEpiNames(self):\n# Sort each run in the series by its acquisition time.\n epi_sort = self.epi_times.keys()\n epi_sort.sort()\n# Rewrite pfiles as an ordered list of p-files to be reconstructed.\n for idx in xrange(len(epi_sort)):\n entry = self.epi_times[epi_so... | [
"0.64974564",
"0.61578393",
"0.57928175",
"0.57109356",
"0.5541757",
"0.5491878",
"0.5438996",
"0.54297066",
"0.5325947",
"0.5219759",
"0.52026135",
"0.5192286",
"0.5152777",
"0.51420754",
"0.5114544",
"0.5093096",
"0.50334144",
"0.5020539",
"0.5005299",
"0.49603912",
"0.4959... | 0.64618903 | 1 |
Eliminate entries in epi recon table that have already been reconstructed. I don't remember why this is here but I know that at one time it was important. | def PruneEpiEntries(self):
pruned = {}
basefiles = []
baseentries = {}
for entry in self.entry_map['epi']:
if baseentries.has_key(self.info[entry]['basefile']):
baseentries[self.info[entry]['basefile']].append(entry)
else:
baseentri... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def elimination_ofconc(a2_data):\n for data in a2_data.values():\n data.pop('conc')\n return a2_data",
"def nonphysicalxs_remotion(a2_data,res_nufi_removal):\n for i in a2_data['I'].keys():\n if i=='MACR' and res_nufi_removal==True:\n if 'nufi' in a2_data['I'][i]['R'].keys():\n ... | [
"0.6324132",
"0.59182566",
"0.5790216",
"0.57542723",
"0.57150894",
"0.5654134",
"0.55529314",
"0.5501398",
"0.54495615",
"0.5417837",
"0.5416808",
"0.5410812",
"0.53797144",
"0.53654283",
"0.5352083",
"0.5328368",
"0.53084546",
"0.530087",
"0.5300535",
"0.5298115",
"0.529656... | 0.6166888 | 1 |
Convert epis reconstructed on the scanner. | def ConvertRtEpis(self):
if self.verbose:
print 'Convert EPIs to brik'
for entry in self.entry_map['epi']:
if ('epirt' in self.info[entry]['psdname'] or \
self.info[entry]['psdname'] == 'epi' or \
self.info[entry]['psdname'] == '*epfid2d1_64') and ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def ReconEpis(self):\n run = zeros(100)\n if self.verbose:\n print 'Reconstruct EPIs'\n for pfile in self.pfiles_recon:\n if self.info[pfile]['refdat'] is None:\n# Find the ref.dat file later.\n continue\n if self.info[pfile]['compr... | [
"0.5776446",
"0.5423936",
"0.5320594",
"0.5170984",
"0.51104087",
"0.5029466",
"0.5025242",
"0.50205046",
"0.48759243",
"0.4801463",
"0.47459334",
"0.47000486",
"0.46995685",
"0.4694864",
"0.46835348",
"0.467961",
"0.4648427",
"0.46379155",
"0.46379155",
"0.4625023",
"0.45730... | 0.6517192 | 0 |
Correct for motion and call SliceTimeCorrect. | def CorrectMotion(self):
if self.verbose:
print "Correct for motion"
for entry in self.entry_map['epi']:
info = self.info[entry]
if os.path.exists(info['imgfile_m'] + info['suffix']):
return
# Always use brik for 3dDeconvolve.
su... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def prepare_drift_correction(self, pos):\n\n\t\tprint(\"function not supported yet\")",
"def refframe_correct(self, ra, dec, obstime, sobjs=None):\n # Correct Telescope's motion\n refframe = self.par['calibrations']['wavelengths']['refframe']\n if refframe in ['heliocentric', 'barycentric'] ... | [
"0.60318804",
"0.54270923",
"0.53947157",
"0.53792375",
"0.5303855",
"0.5262295",
"0.5260591",
"0.52238935",
"0.5190531",
"0.5141736",
"0.5131086",
"0.50906426",
"0.5085911",
"0.5074954",
"0.50716",
"0.506681",
"0.50448614",
"0.50436366",
"0.50436366",
"0.50377357",
"0.503135... | 0.6062027 | 0 |
Call the jump_censor program to characterize the degree of motion. | def JumpCensor(self):
if self.verbose:
print 'Computing censor files.'
for entry in self.entry_map['epi']:
if self.censor_interleave:
input_file = '%s+orig' % self.info[entry]['imgfile']
interleave = '--interleave'
else:
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def censoring_fcn(self, q):\n return 1.0",
"def jump(self):\n\t\tself.vel = -10\n\t\tself.tick_count = 0\n\t\tself.height = self.y",
"def on_jump_press(self) -> None:\r\n if not self.node:\r\n return\r\n if don.jumpFly:\r\n self.node.handlemessage(\"impulse\",self.nod... | [
"0.59280413",
"0.541607",
"0.5290688",
"0.52872306",
"0.5283519",
"0.51918846",
"0.5162083",
"0.5111304",
"0.50946474",
"0.50678855",
"0.5063725",
"0.50507736",
"0.50380087",
"0.5027665",
"0.50178564",
"0.49831063",
"0.4976855",
"0.4957412",
"0.49509645",
"0.49407175",
"0.491... | 0.7094361 | 0 |
Compute the temporal SNR for each epi, save in a nifti file, and store a summmary in a png file. | def ComputeSNR(self):
for epi in self.entry_map['epi']:
epifile = self.info[epi]['imgfile_final'] + self.info[epi]['suffix']
prefix = self.info[epi]['imgfile_final'] + '_snr'
if not os.path.exists('%s_snr.png' % prefix):
if self.verbose:
pr... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def calculate_SNR(snid: int, photo_data: pd.DataFrame, \n head_data: pd.DataFrame, code_zenodo: int, \n snana_file_index: int, code_snana: int):\n \n types_names = {90: 'Ia', 62: 'Ibc', 42: 'II', 67: '91bg', 52: 'Iax',\n 64:'KN', 95: 'SLSN', 994: 'PISN', 99... | [
"0.5856596",
"0.58353704",
"0.58029324",
"0.5760767",
"0.57194346",
"0.5685501",
"0.565635",
"0.5610267",
"0.5596072",
"0.5580801",
"0.5550373",
"0.55146116",
"0.55122143",
"0.54595554",
"0.53850317",
"0.53831476",
"0.53568536",
"0.5345135",
"0.53432506",
"0.5322765",
"0.5319... | 0.78557074 | 0 |
Empties the models within the bag | def empty_bag(self):
if self.peds is not None:
for _, model in self.peds.items():
model.reset()
self.drone.reset()
self.subject.reset() | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def clear():\n\t\tModel.counter = 0",
"def ClearModels(self):\n self._modelFileNames = []\n self._models = []\n self.Modified(readAgain=True)",
"def clearmodels(self):\n \n dbpath, config = self._start() \n ModelDescriptionTable(dbpath).empty()\n... | [
"0.77507436",
"0.76478666",
"0.7637113",
"0.74050826",
"0.7388874",
"0.73118776",
"0.7252325",
"0.709604",
"0.7079502",
"0.6967123",
"0.69053054",
"0.6871042",
"0.68186563",
"0.6815605",
"0.68100023",
"0.68016225",
"0.6794553",
"0.6774137",
"0.67709094",
"0.67597353",
"0.6744... | 0.8674077 | 0 |
Determines if an input is a float. | def is_float(self, input):
try:
float(input)
return True
except ValueError:
return False | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def is_float(x):\r\n try:\r\n float(x)\r\n except ValueError:\r\n return False\r\n return True",
"def isfloat(value):\r\n try:\r\n float(value)\r\n return True\r\n except ValueError:\r\n return False",
"def isFloat(value): \n try:\n float(value... | [
"0.82458997",
"0.8190943",
"0.81595534",
"0.81558645",
"0.81085587",
"0.8093256",
"0.807079",
"0.807079",
"0.80703425",
"0.8061959",
"0.8060793",
"0.8011374",
"0.7838578",
"0.7823464",
"0.77867234",
"0.77559304",
"0.7752695",
"0.7747797",
"0.7746936",
"0.77243704",
"0.7696662... | 0.884747 | 0 |
gpu_model_to_scale is a dict from model string to scale. | def avail_gpu_compute(self, gpu_model_to_scale):
self._check_spy_stats_available()
l = []
for u, model in zip(self._util.gpu_compute, self._capacity.gpu_model):
found = False
for k, scale in gpu_model_to_scale.items():
if k in model:
found = True
break
if found... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def scale_model(model, scale):\n params = model.named_parameters()\n dict_params = dict(params)\n with torch.no_grad():\n for name, param in dict_params.items():\n dict_params[name].set_(dict_params[name].data * scale)",
"def scale_model(model,scaleparname='A',scaleval=1):\n model =... | [
"0.67240673",
"0.6272403",
"0.5994706",
"0.5941544",
"0.5833461",
"0.5681746",
"0.5676147",
"0.5382901",
"0.5348",
"0.53371793",
"0.5301205",
"0.52537143",
"0.52262044",
"0.51800525",
"0.51736313",
"0.5139863",
"0.512118",
"0.5083435",
"0.50683033",
"0.50677323",
"0.50584626"... | 0.6472911 | 1 |
From all the data, it takes the columns TopicID, and count the topic based on the gender | def get_data_frame_count_male_gender_by_topic(data_frame: DataFrame) -> pb.DataFrame:
data_frame_topic = data_frame \
.filter(data_frame["Stratification1"].contains("Male")) \
.distinct() \
.groupBy("TopicID") \
.count() \
.sort("TopicID")
print("The following table repr... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_male_female_topicsDF(data_dict, gender):\n dataDF = pd.DataFrame.from_dict(data_dict[gender], orient='index')\n outlet_gender_topicsDF = pd.json_normalize(dataDF['topic_mean'])\n outlet_gender_topicsDF.index = dataDF.index\n outlet_gender_topicsDF = outlet_gender_topicsDF.sort_index()\n outl... | [
"0.6474987",
"0.63504976",
"0.6320572",
"0.62746453",
"0.627228",
"0.6258495",
"0.61637425",
"0.6114557",
"0.5977991",
"0.58644605",
"0.5836324",
"0.5831244",
"0.5673213",
"0.5647648",
"0.5610889",
"0.5574155",
"0.5492381",
"0.54264843",
"0.53719985",
"0.53717935",
"0.5295619... | 0.80123305 | 0 |
From all the data, it takes the columns TopicID, and count the topic based on the ethnicity | def get_data_frame_count_black_ethnicity_by_topic(data_frame: DataFrame) -> pb.DataFrame:
data_frame_topic = data_frame \
.filter(data_frame["Stratification1"].contains("Black, non-Hispanic")) \
.distinct() \
.groupBy("TopicID") \
.count() \
.sort("TopicID")
print("The f... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_data_frame_count_male_gender_by_topic(data_frame: DataFrame) -> pb.DataFrame:\n data_frame_topic = data_frame \\\n .filter(data_frame[\"Stratification1\"].contains(\"Male\")) \\\n .distinct() \\\n .groupBy(\"TopicID\") \\\n .count() \\\n .sort(\"TopicID\")\n\n print... | [
"0.670414",
"0.6682198",
"0.6473323",
"0.63052845",
"0.6284073",
"0.5883223",
"0.58540165",
"0.5768975",
"0.56314296",
"0.5595589",
"0.55580306",
"0.5541051",
"0.5484164",
"0.54825205",
"0.5471465",
"0.5443077",
"0.53968257",
"0.5374345",
"0.5362987",
"0.5333066",
"0.5320533"... | 0.7382751 | 0 |
Plot a data frame with bar type | def plot_type_of_topic(data_frame: pb.DataFrame) -> None:
plt.interactive(False)
plt.figure()
data_frame.plot(kind='bar', x= data_frame['TopicID'])
plt.show() | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def compte(df):\n\n df.value_counts()[:100].plot(kind='bar')\n plt.show()",
"def bar_plot(df, data_pt):\n \n x=df.loc[data_pt]\n y= df.columns.tolist()\n sorte=x.tolist()\n a=sorted(zip(sorte, y))[-10:]\n y=[y for _, y in a]\n ## soru burda yapıp altı ona göre duzeliyecegim birde\n ... | [
"0.72341543",
"0.7051117",
"0.7032588",
"0.702026",
"0.6910697",
"0.6906154",
"0.68671536",
"0.67882943",
"0.6782081",
"0.6735545",
"0.6699668",
"0.6685477",
"0.66498506",
"0.663799",
"0.6616477",
"0.6604195",
"0.6479067",
"0.6469803",
"0.64694345",
"0.64263964",
"0.6424513",... | 0.7253609 | 0 |
Returns the account for the given client. If it does not exist a new one is created and returned | def get_account(self, client: int):
try:
return self.accounts[client]
except KeyError:
return self._create_account(client) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_client(self, clientname):\n client = self.dbsession.query(Client).filter_by(clientname=clientname).all()\n if not client:\n return self.create_client({'clientname': clientname})\n else:\n return client[0]",
"def get_client(self, user_id: int, client_name: str) -... | [
"0.66133344",
"0.6345957",
"0.6296915",
"0.62183553",
"0.6195077",
"0.61447585",
"0.6143067",
"0.61124474",
"0.6101005",
"0.6082482",
"0.6080354",
"0.60321856",
"0.60321856",
"0.60195756",
"0.5999535",
"0.59913605",
"0.5953246",
"0.5937958",
"0.5926711",
"0.59228164",
"0.5893... | 0.9063625 | 0 |
Calculate Linke turbidity using Kasten pyrheliometric formula. Note that broadband aerosol optical depth (AOD) can be approximated by AOD measured at 700 nm according to Molineaux [4] . Bird and Hulstrom offer an alternate approximation using AOD measured at 380 nm and 500 nm. Based on original implementation by Armel ... | def kasten96_lt(airmass_absolute, precipitable_water, aod_bb):
# "From numerically integrated spectral simulations done with Modtran
# (Berk, 1989), Molineaux (1998) obtained for the broadband optical depth
# of a clean and dry atmospshere (fictitious atmosphere that comprises only
# the effects of Rayl... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def estimate_lwdown(tairK, rh):\n zeroC = 273.15\n\n sat_vapress = 611.2 * np.exp(17.67 * ((tairK - zeroC) / (tairK - 29.65)))\n vapress = np.maximum(5.0, rh) / 100. * sat_vapress\n lw_down = 2.648 * tairK + 0.0346 * vapress - 474.0\n\n return lw_down",
"def derive_RiekeLebofsky(wavelength):\n ... | [
"0.6074756",
"0.60489684",
"0.6021683",
"0.58620036",
"0.5819184",
"0.5817391",
"0.5701168",
"0.56542647",
"0.5622918",
"0.5620226",
"0.5618999",
"0.55917037",
"0.55595964",
"0.5550017",
"0.5537136",
"0.5530169",
"0.5526478",
"0.5487843",
"0.5477624",
"0.5460396",
"0.54503703... | 0.64853966 | 0 |
input h (meters) and the coefficients for the linear profile for the free troposphere theta (ft_intercept (K) and slope gamma (K/m)) return the free tropospher theta at height h | def theta_ft(h,ft_intercept,gamma):
theta_top = ft_intercept + h*gamma
return theta_top | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_theta_surf_hex_h(theta_hs_in_h: float, theta_hs_out_h: float, v_hs: float) -> float:\n\n c = get_specific_heat()\n rho = get_air_density()\n\n # sensible heating capacity of heat source for heating, W\n q_hs_h = (theta_hs_out_h - theta_hs_in_h) * c * rho * v_hs / 3600\n\n # sensible heat tra... | [
"0.5862929",
"0.5850773",
"0.57733494",
"0.5686483",
"0.56282175",
"0.5592743",
"0.55332625",
"0.55067706",
"0.55043215",
"0.5491298",
"0.5484844",
"0.5470747",
"0.5449616",
"0.5431975",
"0.5429191",
"0.5417069",
"0.54054326",
"0.5379685",
"0.53791565",
"0.5375629",
"0.536189... | 0.75179046 | 0 |
the_vars[0]= thetabar the_vars[1] = h the_vars[2] = qv surface flux from drag law with subsidence and diagnosed deltheta | def dmixed_vars(the_vars,tstep,coeffs):
deltheta = theta_ft(the_vars[1],coeffs.ft_intercept,coeffs.ft_gamma) - the_vars[0]
F0 = coeffs.U*coeffs.Cd*(coeffs.sst - the_vars[0]) #surface heat flux
Fqv0 = coeffs.U*coeffs.Cd*(coeffs.qsfc - the_vars[2]) #surface vapor flux
Fint = -coeffs.k*F0 #entrainment ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def ha(env, cstate=0):\n T1 = 10\n T2 = 10\n thM = 20\n thm = 5\n vr = 10.5\n v1 = -1.3\n v2 = -2.7\n assert(T1 == T2)\n\n delta = None # None to cause failure\n # The continous variables used in this ha\n x = T1 # clock1 variable\n y = T2 ... | [
"0.6345493",
"0.6289429",
"0.6155934",
"0.6074104",
"0.60056967",
"0.5953673",
"0.59231526",
"0.5861008",
"0.5852607",
"0.5842901",
"0.58290935",
"0.58032346",
"0.57665646",
"0.576412",
"0.57412446",
"0.57161164",
"0.5708992",
"0.5680603",
"0.56741995",
"0.5667289",
"0.565103... | 0.7249938 | 0 |
NichollsTurton entrainment parameterization the_vars and coeffs are inputs into dmixed_vars deltheta, F0, Fqv0 are calculated in dmixed_vars | def calc_went_NT(the_vars, coeffs, deltheta, F0, Fqv0):
thetal_m = the_vars[0]
qt_m = the_vars[2]
zi = the_vars[1]
dth = deltheta
thetal_ft = thetal_m + dth
qt_ft = coeffs.ft_qv
dqt = qt_ft - qt_m
# calculate thetal at z = 3000 m (take qt(z = 3000m) = qt(z = h), so delta_q... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def dmixed_vars(the_vars,tstep,coeffs):\n\n deltheta = theta_ft(the_vars[1],coeffs.ft_intercept,coeffs.ft_gamma) - the_vars[0]\n F0 = coeffs.U*coeffs.Cd*(coeffs.sst - the_vars[0]) #surface heat flux\n Fqv0 = coeffs.U*coeffs.Cd*(coeffs.qsfc - the_vars[2]) #surface vapor flux\n Fint = -coeffs.k*F0 #en... | [
"0.80656624",
"0.5865987",
"0.5693037",
"0.5615564",
"0.55575585",
"0.55294347",
"0.55230105",
"0.5521183",
"0.5503675",
"0.5450836",
"0.540424",
"0.53514105",
"0.5325137",
"0.53189623",
"0.5317447",
"0.5312849",
"0.5308044",
"0.5304588",
"0.530239",
"0.5301694",
"0.5296928",... | 0.73483014 | 1 |
find the lcl (in m) for a row in the dataframe | def calc_lcl(row,psfc):
Tdew = tf.tmr(row['qv'],psfc)
LCL = tf.LCL(Tdew,row['theta'],psfc) #kPa
#
# rough approximation: 10 kPa = 1 km
#
delp=psfc - LCL
lcl_h = delp*100.
return lcl_h | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_index_lm(l, m):\n return (l+1)**2 -1 -l + m",
"def compute_kl(self, df):\n value_counts = [df[col].value_counts() for col in self.hist_cols]\n next_hists = self.value_counts_to_hists(value_counts)\n\n if self.prev_hists is None:\n self.prev_hists = next_hists\n ... | [
"0.59105355",
"0.57944614",
"0.5768694",
"0.5714691",
"0.5706475",
"0.5483352",
"0.5476161",
"0.5426626",
"0.53980875",
"0.5363862",
"0.53620285",
"0.5346637",
"0.530857",
"0.5301486",
"0.52655256",
"0.52437156",
"0.52226084",
"0.52145016",
"0.5176464",
"0.51718956",
"0.51507... | 0.60421354 | 0 |
Adapted from interactive_vaporflux.ipynb sst, sea surface temperature (K) ft_qv, mixedlayer top qv (kg kg^1) use_NT, True or False outputs csv and json files with equilibrium values | def run_main(sst, ft_qv, use_NT):
dtout=10. #minutes
end_time=8*24. #hours
del_time=dtout*60. #seconds
end_time=end_time*3600. #seconds
#sst=297
D=5.e-6 #s-1
U=7 #m/s
psfc=100. #kPa
qsfc=tf.qs_tp(sst,psfc)
ft_intercept = 292 #K
ft_gamma = 6.e-3 #K/m
#ft_qv = 2.e-3
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def calc_equil(sst, ft_qv, use_NT=False):\n \n run_main(sst, ft_qv, use_NT)\n \n # grab csv file\n with open('dumpmodel.csv','r') as f:\n df_result=pd.read_csv(f)\n\n # last time step into named tupple\n out=df_result.iloc[-1]\n steady_state=make_tuple(out.to_dict())\n steady_stat... | [
"0.6243293",
"0.5701022",
"0.5552244",
"0.5491569",
"0.5487227",
"0.5479191",
"0.54358137",
"0.54272795",
"0.5394585",
"0.5392419",
"0.53615534",
"0.533306",
"0.53179353",
"0.5315923",
"0.5295476",
"0.5265205",
"0.52420974",
"0.5239961",
"0.52259064",
"0.52226466",
"0.5221569... | 0.64122236 | 0 |
Adapted from nicholls_turton.ipynb sst, sea surface temperature (K) ft_qv, mixedlayer top qv (kg kg^1) use_NT, True or False | def calc_equil(sst, ft_qv, use_NT=False):
run_main(sst, ft_qv, use_NT)
# grab csv file
with open('dumpmodel.csv','r') as f:
df_result=pd.read_csv(f)
# last time step into named tupple
out=df_result.iloc[-1]
steady_state=make_tuple(out.to_dict())
steady_state
#... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def run_main(sst, ft_qv, use_NT):\n\n dtout=10. #minutes\n end_time=8*24. #hours\n del_time=dtout*60. #seconds\n end_time=end_time*3600. #seconds\n #sst=297\n D=5.e-6 #s-1\n U=7 #m/s\n psfc=100. #kPa\n qsfc=tf.qs_tp(sst,psfc)\n ft_intercept = 292 #K\n ft_gamma = 6.e-3 #K/m\n ... | [
"0.60827553",
"0.5971266",
"0.57040036",
"0.5694853",
"0.56882703",
"0.5666581",
"0.5637644",
"0.5630418",
"0.56049395",
"0.55450636",
"0.54949796",
"0.5493195",
"0.54648805",
"0.54205227",
"0.5363305",
"0.53159505",
"0.5269913",
"0.52530104",
"0.524438",
"0.52441275",
"0.521... | 0.65542036 | 0 |
Checks a service's replication levels based on how the service's replication should be monitored. (smartstack or mesos) | def check_service_replication(
instance_config,
all_tasks,
smartstack_replication_checker,
):
expected_count = instance_config.get_instances()
log.info("Expecting %d total tasks for %s" % (expected_count, instance_config.job_id))
proxy_port = marathon_tools.get_proxy_port_for_instance(
n... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def mmo_configsrv_replication_status(self, mmo_connection):\n replication_state = []\n if self.mmo_is_mongos(mmo_connection):\n configsrv = self.mmo_config_servers(mmo_connection)[0]\n auth_dic = self.mmo_get_auth_details_from_connection(mmo_connection)\n c = self.mmo... | [
"0.59834796",
"0.5918712",
"0.537204",
"0.5249215",
"0.52178967",
"0.5167108",
"0.5149234",
"0.5141773",
"0.5053718",
"0.50021493",
"0.49990278",
"0.49700785",
"0.48497504",
"0.4836432",
"0.48359025",
"0.47858948",
"0.4753289",
"0.47522944",
"0.4747612",
"0.47456878",
"0.4742... | 0.59363264 | 1 |
Traverses backwards through predecessors from end | def _deconstruct_path(predecessors, end):
if end not in predecessors:
return None
current = end
path = []
while current:
path.append(current)
current = predecessors.get(current)
return list(reversed(path)) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __backward(self):\n if self.is_empty():\n raise StopIteration\n\n current = self._tail\n yield current._data\n while current._previ:\n current = current._previ\n yield current._data",
"def reverse_iterative(self):\n \"\"\"O(n) / O(1) solutio... | [
"0.69886434",
"0.69002724",
"0.6687282",
"0.659495",
"0.6564393",
"0.655781",
"0.6412653",
"0.63977957",
"0.63977957",
"0.63977957",
"0.6395437",
"0.63730013",
"0.6367989",
"0.6310967",
"0.6306441",
"0.6306441",
"0.6306441",
"0.63061464",
"0.62905055",
"0.6285904",
"0.6272839... | 0.7261165 | 0 |
Recursively creates Level_Pair nodes from start up to end. Assumes that end's attack and strength are greater than start's. Neighbours for a node are stored in graph[node]. Distances between neighbours are stored in graph[nodeA][nodeB]. | def populate_graph(
graph, start, end, attack_bonus, strength_bonus):
# Check if already created
if start in graph:
return
graph[start] = dict()
# Recursively create neighbouring level pairs
if start.attack < end.attack:
inc_attack = Level_Pair(start.attack + 1, start.... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def astar_map(map, start, end):\n\n # Create start and end node\n start_node = Node3(None, start)\n start_node.g = start_node.h = start_node.f = 0\n end_node = Node3(None, end)\n end_node.g = end_node.h = end_node.f = 0\n\n # Initialize both open and closed list\n open_list = []\n closed_li... | [
"0.58267266",
"0.5793475",
"0.56011593",
"0.55371314",
"0.55277735",
"0.55161214",
"0.55161214",
"0.55161214",
"0.54637635",
"0.5456182",
"0.5430679",
"0.5403021",
"0.5386815",
"0.53318155",
"0.5256505",
"0.5214026",
"0.5162665",
"0.51556855",
"0.5142307",
"0.5126955",
"0.508... | 0.7375074 | 0 |
Runs simulations to determine time (ticks) to level up attack or strength Enemy is set as sand crab (60hp, 1 def, 0 def bonus) Weapon is best available scimitar | def level_time_simulate(start_levels, attack_style, attack_bonus, strength_bonus):
ticks_per_attack = 4 # Scimitar attack speed
enemy_health = 60 # Sand crab health
max_hit, accuracy = get_max_hit_and_accuracy(
start_levels, attack_style, attack_bonus, strength_bonus)
if attack_st... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def testrandom(self):\n for i in range(100):\n WeaponAbility()",
"def scenario1(height, speed):\n time = math.sqrt((2 * height) / 9.81)\n result = speed * time\n return result",
"def attack(health_meter):\n hit_list = 4 * ['igrac'] + 6 * ['neprijatelj']\n injured_unit = random.... | [
"0.6155685",
"0.6128568",
"0.61060804",
"0.6067592",
"0.6018623",
"0.5902906",
"0.5877961",
"0.5872772",
"0.5862628",
"0.58594483",
"0.57941294",
"0.5765011",
"0.57348096",
"0.5728712",
"0.57282984",
"0.5714876",
"0.5714854",
"0.5682435",
"0.56775427",
"0.5648126",
"0.5637001... | 0.6836062 | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.