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 |
|---|---|---|---|---|---|---|
Purpose Image transformation by conditional thickening. Synopsis y = cthick(f, g, Iab=None, n=1, theta=45, DIRECTION="CLOCKWISE") Input | def cthick(f, g, Iab=None, n=-1, theta=45, DIRECTION="CLOCKWISE"):
from numpy import product
from string import upper
if Iab is None: Iab = homothick()
DIRECTION = upper(DIRECTION)
assert isbinary(f),'f must be binary image'
if n == -1: n = product(f.shape)
y = f
old = y
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def cthin(f, g, Iab=None, n=-1, theta=45, DIRECTION=\"CLOCKWISE\"):\n from numpy import product\n from string import upper\n if Iab is None: Iab = homothin()\n DIRECTION = upper(DIRECTION) \n assert isbinary(f),'f must be binary image'\n if n == -1: n = product(f.shape)\n y = f\n ... | [
"0.7186102",
"0.66919863",
"0.57495654",
"0.5407749",
"0.5375289",
"0.5359107",
"0.53198385",
"0.52804685",
"0.5203509",
"0.51588786",
"0.5124516",
"0.51022315",
"0.5088075",
"0.50790465",
"0.5073469",
"0.50663704",
"0.50469434",
"0.50314844",
"0.4978179",
"0.4945249",
"0.493... | 0.81029683 | 0 |
Purpose Image transformation by conditional thinning. Synopsis y = cthin(f, g, Iab=None, n=1, theta=45, DIRECTION="CLOCKWISE") Input | def cthin(f, g, Iab=None, n=-1, theta=45, DIRECTION="CLOCKWISE"):
from numpy import product
from string import upper
if Iab is None: Iab = homothin()
DIRECTION = upper(DIRECTION)
assert isbinary(f),'f must be binary image'
if n == -1: n = product(f.shape)
y = f
old = y
fo... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def cthick(f, g, Iab=None, n=-1, theta=45, DIRECTION=\"CLOCKWISE\"):\n from numpy import product\n from string import upper\n if Iab is None: Iab = homothick()\n DIRECTION = upper(DIRECTION) \n assert isbinary(f),'f must be binary image'\n if n == -1: n = product(f.shape)\n y = f\n ... | [
"0.71805936",
"0.68326634",
"0.64208144",
"0.60235196",
"0.5585978",
"0.5452408",
"0.54444486",
"0.5421539",
"0.5237136",
"0.5114649",
"0.49922898",
"0.498708",
"0.49766493",
"0.48924604",
"0.48754922",
"0.4868891",
"0.48308513",
"0.48260248",
"0.4815466",
"0.48078087",
"0.48... | 0.77953696 | 0 |
Purpose Detection of watershed from markers. Synopsis Y = cwatershed(f, g, Bc=None, LINEREG="LINES") Input | def cwatershed(f, g, Bc=None, LINEREG="LINES"):
from numpy import ones, zeros, nonzero, array, put, take, argmin, transpose, compress, concatenate
if Bc is None: Bc = secross()
return g
print 'starting'
withline = (LINEREG == 'LINES')
if isbinary(g):
g = label(g,Bc)
print 'before 1. ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def watershed(f, Bc=None, LINEREG=\"LINES\"):\n from string import upper\n if Bc is None: Bc = secross()\n return cwatershed(f,regmin(f,Bc),upper(LINEREG))\n return y",
"def watershed(self, debug=False):\n kernel = cv2.getStructuringElement(cv2.MORPH_CROSS, (3, 3))\n opening = cv2.morph... | [
"0.7911685",
"0.70751756",
"0.70505095",
"0.7000329",
"0.6691826",
"0.66913867",
"0.61921716",
"0.6146594",
"0.5988197",
"0.59779143",
"0.58939046",
"0.58072364",
"0.5494056",
"0.5413352",
"0.5371904",
"0.53518903",
"0.51690936",
"0.5094091",
"0.50496864",
"0.49610332",
"0.49... | 0.7665355 | 1 |
Purpose Dilate an image by a structuring element. Synopsis y = dilate(f, b=None) Input | def dilate(f, b=None):
from numpy import maximum, newaxis, ones, int32
if b is None: b = secross()
if len(f.shape) == 1: f = f[newaxis,:]
h,w = f.shape
x,v = mat2set(b)
if len(x)==0:
y = (ones((h,w),int32) * limits(f)[0]).astype(f.dtype)
else:
if isbinary(v):
v = ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def dilate(img, kernel = (5,5), iterations = 1):\n\ttmp = grayscale(img)\n\tk = np.ones(kernel, np.uint8)\n\tdilation = cv2.dilate(tmp, k, iterations = iterations)\n\treturn dilation",
"def dilate_image(img, kernelSize=(4,4), iterations=2):\n\n kernel = np.ones(kernelSize, np.uint8)\n return cv.dilate(img,... | [
"0.66704196",
"0.6609579",
"0.655228",
"0.6546741",
"0.64058995",
"0.6367679",
"0.63575417",
"0.61807394",
"0.61687386",
"0.6155476",
"0.61377674",
"0.60211205",
"0.60068196",
"0.59917486",
"0.5978079",
"0.59643334",
"0.59438497",
"0.5935499",
"0.580871",
"0.5806114",
"0.5768... | 0.7743869 | 0 |
Purpose Superpose points, rectangles and lines on an image. Synopsis y = drawv(f, data, value, GEOM) Input | def drawv(f, data, value, GEOM):
from numpy import array, newaxis, zeros, Int, put, ravel, arange, floor
from string import upper
GEOM = upper(GEOM)
data = array(data)
value = array(value)
y = array(f)
lin, col = data[1,:], data[0,:]
i = lin*f.shape[1] + col; i = i.astype(Int)
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def drawVector(x0,y0,x1,y1,vtype='normal fill', ucoords=1):\n ivec = vectordict[vtype]\n if ucoords:\n dislin.rlvec(x0,y0,x1,y1,ivec)\n else:\n dislin.vector(x0,y0,x1,y1,ivec)",
"def drawVectorField(x0list,y0list,x1list,y1list,vtype='normal'):\n ivec = vectordict[vtype]\n dislin.fiel... | [
"0.62331104",
"0.6017471",
"0.5915684",
"0.58610076",
"0.5761394",
"0.56521666",
"0.5610682",
"0.5576975",
"0.55655783",
"0.55615306",
"0.5476508",
"0.5452408",
"0.53764546",
"0.5270365",
"0.5263229",
"0.52362597",
"0.5224492",
"0.5218242",
"0.5208938",
"0.52043664",
"0.51836... | 0.76579046 | 0 |
Purpose Display a distance transform image with an isoline color table. Synopsis y = dtshow(f, n=10) Input | def dtshow(f, n=10):
import adpil
if (isbinary(f)) or (len(f.shape) != 2):
print 'Error, dtshow: works only for grayscale labeled image'
return
y=gdtshow(f, n)
adpil.adshow(y)
return
return y | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def gdtshow(X, N=10):\n from numpy import newaxis, ravel, ceil, zeros, ones, transpose, repeat, concatenate, arange, reshape, floor\n\n def apply_lut(img, lut):\n def lut_map(intens, lut=lut): return lut[intens]\n g = reshape(transpose(map(lut_map, ravel(img))), (3,img.shape[0],img.shape[1]))\n... | [
"0.5782526",
"0.5621896",
"0.5560631",
"0.53401285",
"0.5336751",
"0.53000146",
"0.5275068",
"0.52466846",
"0.5197803",
"0.5192929",
"0.51922214",
"0.51823264",
"0.5177604",
"0.51623607",
"0.5161627",
"0.5155025",
"0.5110944",
"0.50969225",
"0.50870544",
"0.5075007",
"0.50588... | 0.7908403 | 0 |
Purpose Interval to detect endpoints. Synopsis Iab = endpoints(OPTION="LOOP") Input | def endpoints(OPTION="LOOP"):
from string import upper
Iab = None
OPTION = upper(OPTION)
if OPTION == 'LOOP':
Iab = se2hmt(binary([[0,0,0],
[0,1,0],
[0,0,0]]),
binary([[0,0,0],
[1,0... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def endpoints(self) -> pulumi.Input[Sequence[pulumi.Input['EndpointDependencyArgs']]]:\n return pulumi.get(self, \"endpoints\")",
"def endpoints(self) -> Optional[pulumi.Input[Sequence[pulumi.Input['LiveEventEndpointArgs']]]]:\n return pulumi.get(self, \"endpoints\")",
"def endpoints(self) -> Opt... | [
"0.5921654",
"0.56585324",
"0.56585324",
"0.54782075",
"0.5406631",
"0.52959657",
"0.5201416",
"0.51873255",
"0.5180209",
"0.51309377",
"0.5101611",
"0.5054283",
"0.50306106",
"0.5028355",
"0.49852458",
"0.49333733",
"0.49054667",
"0.48765346",
"0.48694932",
"0.48453733",
"0.... | 0.7361432 | 0 |
Purpose Erode an image by a structuring element. Synopsis y = erode(f, b=None) Input | def erode(f, b=None):
if b is None: b = secross()
y = neg(dilate(neg(f),sereflect(b)))
return y | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def erode(image, kernel_size=(5, 5)):\n kernel = np.ones(kernel_size, np.uint8)\n image = cv2.erode(image, kernel)\n return image",
"def erode(image, kernel_size=(5, 5)):\n kernel = np.ones(kernel_size, np.uint8)\n image = cv2.erode(image, kernel)\n return image",
"def __cv_erode(src, kernel,... | [
"0.6978548",
"0.6978548",
"0.68740195",
"0.68499464",
"0.68358105",
"0.6545843",
"0.62674016",
"0.6104139",
"0.60299265",
"0.595797",
"0.56418025",
"0.5456657",
"0.53834635",
"0.5264286",
"0.5183037",
"0.5131226",
"0.50896865",
"0.5060021",
"0.5044961",
"0.4954856",
"0.487703... | 0.75029975 | 0 |
Purpose Control automatic data type conversion. Synopsis Y = freedom(L=5) Input | def freedom(L=5):
Y = -1
return Y | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_check_y_casts_to_numerical(wage_X_y, wage_gam):\n X, y = wage_X_y\n y = y.astype('object')\n\n y = check_y(y, wage_gam.link, wage_gam.distribution)\n assert y.dtype == 'float'",
"def ytrain(self,value: list)->None:",
"def _model_fit_term(self):\r\n if self.likelihood.YYT is None:\r\... | [
"0.52298915",
"0.51165634",
"0.5111446",
"0.49991885",
"0.4929472",
"0.48691973",
"0.4853456",
"0.48361403",
"0.48330933",
"0.48093462",
"0.48026165",
"0.47438735",
"0.47346342",
"0.47113565",
"0.47081566",
"0.47069696",
"0.46895796",
"0.46701077",
"0.4663292",
"0.46438667",
... | 0.7145576 | 0 |
Purpose Geodesic Distance Transform. Synopsis y = gdist(f, g, Bc=None, METRIC=None) Input | def gdist(f, g, Bc=None, METRIC=None):
if Bc is None: Bc = secross()
assert METRIC is None,'Does not support EUCLIDEAN'
fneg,gneg = neg(f),neg(g)
y = gray(gneg,'uint16',1)
ero = intersec(y,0)
aux = y
i = 1
while not isequal(ero,aux):
aux = ero
ero = cerode(gneg,fneg,Bc,i... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def Gdist(tG,ZG):\n try:\n tZ= ZG(tG)\n tjac= numpy.fabs(ZG.derivatives(tG)[0]/tZ/numpy.log(10.))\n except ValueError:\n return 0.\n # Add Jacobian\n return localfehdist(isodist.Z2FEH(tZ,zsolar=0.017))*tjac",
"def g(lat, z) :\n return (g0(lat) - (3.085462 * 1.e-4 + 2.27 * 1.e-... | [
"0.6017094",
"0.5529793",
"0.55131626",
"0.5478113",
"0.54179114",
"0.5343872",
"0.53087807",
"0.5239527",
"0.51940274",
"0.511945",
"0.50437737",
"0.50371695",
"0.50321895",
"0.50282276",
"0.5027644",
"0.5022881",
"0.501526",
"0.49601406",
"0.49435052",
"0.49363357",
"0.4933... | 0.8241349 | 0 |
Purpose Morphological gradient. Synopsis y = gradm(f, Bdil=None, Bero=None) Input | def gradm(f, Bdil=None, Bero=None):
if Bdil is None: Bdil = secross()
if Bero is None: Bero = secross()
y = subm(dilate(f,Bdil),erode(f,Bero))
return y | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def objective_grad(self, wb, X, y):\n N, D = X.shape\n w = wb[:-1]\n b = wb[-1]\n loss_grad = np.zeros(D+1) \n # grad wrt regularization\n loss_grad[-1] = 2 * self.reg_param * (b - self.b0) # grad_b\n loss_grad[:-1] = 2 * self.reg_param * (w - self.w0) # gra... | [
"0.59924555",
"0.5991799",
"0.5845124",
"0.5811336",
"0.57579035",
"0.5728873",
"0.57286304",
"0.56980044",
"0.56884855",
"0.5676776",
"0.56755286",
"0.5667203",
"0.56139827",
"0.56127024",
"0.5565181",
"0.5542475",
"0.5537614",
"0.5527842",
"0.5526885",
"0.5523017",
"0.55134... | 0.8399418 | 0 |
Purpose Grayscale statistics for each labeled region. Synopsis y = grain(fr, f, measurement, option="image") Input | def grain(fr, f, measurement, option="image"):
from numpy import newaxis, ravel, zeros, sum, nonzero, put, take, array, mean, std
from string import upper
measurement = upper(measurement)
option = upper(option)
if len(fr.shape) == 1:
fr = fr[newaxis,:]
n = fr.max()
if option ==... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def analyze_fringes(self, f0=None):\r\n phase_roi, plot_roi = self.phase_roi, self.plot_roi\r\n roi_phase = (slice(phase_roi[2], phase_roi[3]),\r\n slice(phase_roi[0], phase_roi[1]))\r\n roi_plot = (slice(plot_roi[0] - phase_roi[2], plot_roi[1] - phase_roi[2]),\r\n ... | [
"0.5485481",
"0.49810374",
"0.48445684",
"0.47545916",
"0.46607816",
"0.4622817",
"0.4606842",
"0.45798513",
"0.4560187",
"0.4542003",
"0.45324814",
"0.45285997",
"0.45258287",
"0.4525101",
"0.4517709",
"0.4502691",
"0.44976562",
"0.44817522",
"0.44807193",
"0.44794443",
"0.4... | 0.7067432 | 0 |
Purpose Convert a binary image into a grayscale image. Synopsis y = gray(f, TYPE="uint8", k1=None) Input | def gray(f, TYPE="uint8", k1=None):
from numpy import array
if k1 is None: k1 = maxleveltype(TYPE)
if type(f) is list: f = binary(f)
assert isbinary(f), 'f must be binary'
if TYPE == 'uint8' : y = to_uint8(f*k1)
elif TYPE == 'uint16': y = to_uint16(f*k1)
elif TYPE == 'int32' : y = to_int32... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def grayscale_image(input_image):\n return cv2.cvtColor(input_image, cv2.COLOR_BGR2GRAY)",
"def binary_to_gray(self, num):\n return num ^ (num >> 1)",
"def grayscale(img):\n\tif img is None:\n\t\tprint \"Img is None\"\n\t\tsys.exit()\n\tif len(img.shape) > 2:\n\t\treturn cv2.cvtColor(img, cv2.COLOR_B... | [
"0.6852529",
"0.6762533",
"0.66867715",
"0.66641396",
"0.65817684",
"0.65817684",
"0.6549761",
"0.6524596",
"0.6505666",
"0.6505666",
"0.6505666",
"0.6505666",
"0.6502915",
"0.6467407",
"0.6350221",
"0.6327184",
"0.6289869",
"0.6289869",
"0.6289869",
"0.6289869",
"0.6289869",... | 0.831837 | 0 |
Purpose Remove basins with contrast less than h. Synopsis y = hmin(f, h=1, Bc=None) Input | def hmin(f, h=1, Bc=None):
if Bc is None: Bc = secross()
g = addm(f,h)
y = suprec(g,f,Bc);
return y | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def hmax(f, h=1, Bc=None):\n\n if Bc is None: Bc = secross()\n g = subm(f,h)\n y = infrec(g,f,Bc);\n return y",
"def regmin(f, Bc=None, option=\"binary\"):\n\n if option != 'binary':\n raise ValueError, \"mmorph.regmin only implements option 'binary'\"\n if Bc is None: Bc = secross()\n ... | [
"0.6023699",
"0.59712356",
"0.5790688",
"0.54633355",
"0.53233856",
"0.5300857",
"0.5262827",
"0.52214754",
"0.5100732",
"0.5071677",
"0.5031745",
"0.5017887",
"0.5010742",
"0.50060475",
"0.49698767",
"0.4965862",
"0.49162155",
"0.4871063",
"0.48607337",
"0.4858998",
"0.48582... | 0.77210134 | 0 |
Purpose Remove domes with volume less than v. Synopsis y = vmax(f, v=1, Bc=None) Input | def vmax(f, v=1, Bc=None):
if Bc is None: Bc = secross()
raise 'Not implemented yet'
return None
return y | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def vmax(self):\n return self._vmax",
"def compute_vmax(particle, fieldset, time):\n if particle.active == 1:\n particle.vmax = fieldset.vscale*(particle.SCL**fieldset.d)",
"def minmaxdenorm(v, minv, maxv):\n v *= maxv - minv\n v += minv\n return v",
"def limits_va(self, v):\n ... | [
"0.6188019",
"0.58317304",
"0.58165246",
"0.5775183",
"0.5767705",
"0.5508368",
"0.543444",
"0.5355073",
"0.53393376",
"0.53101015",
"0.5284814",
"0.5269611",
"0.520316",
"0.51887983",
"0.51884425",
"0.5166918",
"0.5155837",
"0.5145339",
"0.5138134",
"0.5126543",
"0.5064422",... | 0.78641963 | 0 |
Purpose Remove peaks with contrast less than h. Synopsis y = hmax(f, h=1, Bc=None) Input | def hmax(f, h=1, Bc=None):
if Bc is None: Bc = secross()
g = subm(f,h)
y = infrec(g,f,Bc);
return y | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def extract_max_value(h: np.ndarray):\n return np.argmax(h, axis=1)",
"def peak_height(self):\n return np.array([max(self.waveform[ch]) for ch in range(self.nchannels)])",
"def regmax(f, Bc=None):\n\n if Bc is None: Bc = secross()\n y = regmin(neg(f),Bc)\n return y",
"def get_heat_source_maxim... | [
"0.62974113",
"0.59380364",
"0.5912741",
"0.5693626",
"0.56909144",
"0.55044633",
"0.54535717",
"0.5449627",
"0.5415535",
"0.53984797",
"0.5383747",
"0.53652817",
"0.5323983",
"0.52991194",
"0.5294941",
"0.5292746",
"0.52705365",
"0.5255601",
"0.51819545",
"0.5159434",
"0.513... | 0.7727234 | 0 |
Purpose Interval for homotopic thinning. Synopsis Iab = homothin() Output | def homothin():
Iab = se2hmt(binary([[0,0,0],
[0,1,0],
[1,1,1]]),
binary([[1,1,1],
[0,0,0],
[0,0,0]]))
return Iab | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create_ham(self):\n from tcc.interaction import HAM_SPINLESS_RI_CORE\n return HAM_SPINLESS_RI_CORE(self)",
"def create_ham(self):\n from tcc.interaction import HAM_SPINLESS_RI_CORE\n return HAM_SPINLESS_RI_CORE(self)",
"def H(self):\n if self._H is None:\n fp =... | [
"0.5832084",
"0.5832084",
"0.574311",
"0.562119",
"0.55742675",
"0.55742675",
"0.55444133",
"0.55409324",
"0.5519444",
"0.5498801",
"0.54708415",
"0.5470563",
"0.54473585",
"0.5360541",
"0.5344117",
"0.5325123",
"0.5308296",
"0.53042954",
"0.5287544",
"0.52293766",
"0.5228757... | 0.67719203 | 0 |
Purpose Create a structuring element from a pair of images. Synopsis B = img2se(fd, FLAT="FLAT", f=None) Input | def img2se(fd, FLAT="FLAT", f=None):
from string import upper
from numpy import choose, ones
assert isbinary(fd),'First parameter must be binary'
FLAT = upper(FLAT)
if FLAT == 'FLAT':
return seshow(fd)
else:
B = choose(fd, (limits(to_int32([0]))[0]*ones(fd.shape),f) )
B = se... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def skelm(f, B=None, option=\"binary\"):\n from string import upper\n from numpy import asarray\n if B is None: B = secross()\n assert isbinary(f),'Input binary image only'\n option = upper(option)\n k1,k2 = limits(f)\n y = gray(intersec(f, k1),'uint16')\n iszero = asarray(y)\n nb = sesu... | [
"0.55532235",
"0.5487505",
"0.5345038",
"0.5322503",
"0.5303553",
"0.5286986",
"0.5229742",
"0.5223543",
"0.521153",
"0.52023494",
"0.51971203",
"0.5195199",
"0.5180237",
"0.51768094",
"0.5175936",
"0.51754564",
"0.51398426",
"0.5133034",
"0.51320565",
"0.51115865",
"0.509118... | 0.7908716 | 0 |
Purpose Intersection of infgenerating operators. Synopsis y = infcanon(f, Iab, theta=45, DIRECTION="CLOCKWISE") Input | def infcanon(f, Iab, theta=45, DIRECTION="CLOCKWISE"):
from string import upper
DIRECTION = upper(DIRECTION)
y = union(f,1)
for t in xrange(0,360,theta):
Irot = interot( Iab, t, DIRECTION )
y = intersec( y, infgen(f, Irot))
return y | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def infgen(f, Iab):\n\n A,Bc = Iab\n y = union(dilate(f, A),dilate(neg(f), Bc))\n return y",
"def supcanon(f, Iab, theta=45, DIRECTION=\"CLOCKWISE\"):\n from string import upper\n\n DIRECTION = upper(DIRECTION) \n y = intersec(f,0)\n for t in xrange(0,360,theta):\n Irot = i... | [
"0.6952435",
"0.62638015",
"0.583172",
"0.53959024",
"0.52833",
"0.52185166",
"0.5204863",
"0.5155506",
"0.51313055",
"0.50766265",
"0.5029092",
"0.4967422",
"0.4924951",
"0.488243",
"0.4845948",
"0.48257983",
"0.48164117",
"0.47798005",
"0.47440803",
"0.47407198",
"0.4740690... | 0.8670983 | 0 |
Purpose Infgenerating. Synopsis y = infgen(f, Iab) Input | def infgen(f, Iab):
A,Bc = Iab
y = union(dilate(f, A),dilate(neg(f), Bc))
return y | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def infcanon(f, Iab, theta=45, DIRECTION=\"CLOCKWISE\"):\n from string import upper\n\n DIRECTION = upper(DIRECTION) \n y = union(f,1)\n for t in xrange(0,360,theta):\n Irot = interot( Iab, t, DIRECTION )\n y = intersec( y, infgen(f, Irot))\n return y",
"def supgen(f, INTE... | [
"0.6574958",
"0.6467247",
"0.63544095",
"0.62120664",
"0.57097834",
"0.5636406",
"0.55534416",
"0.5477603",
"0.5457145",
"0.53559756",
"0.5352104",
"0.53507304",
"0.5311042",
"0.5290795",
"0.5257727",
"0.5246704",
"0.5240601",
"0.52195835",
"0.5218468",
"0.51788646",
"0.51765... | 0.8151236 | 0 |
Purpose Infreconstruction. Synopsis y = infrec(f, g, bc=None) Input | def infrec(f, g, bc=None):
from numpy import product
if bc is None: bc = secross()
n = product(f.shape)
y = cdilate(f,g,bc,n);
return y | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def openrec(f, bero=None, bc=None):\n\n if bero is None: bero = secross()\n if bc is None: bc = secross()\n y = infrec(erode(f,bero),f,bc)\n return y",
"def infgen(f, Iab):\n\n A,Bc = Iab\n y = union(dilate(f, A),dilate(neg(f), Bc))\n return y",
"def suprec(f, g, Bc=None):\n from numpy ... | [
"0.6876291",
"0.67545205",
"0.62351763",
"0.6234454",
"0.5855003",
"0.5766121",
"0.5559217",
"0.53417313",
"0.5270898",
"0.5269632",
"0.5217665",
"0.52142024",
"0.5206176",
"0.5152899",
"0.51425385",
"0.511378",
"0.50948197",
"0.5080002",
"0.5074483",
"0.5039737",
"0.50297093... | 0.83287793 | 0 |
Purpose Minima imposition. Synopsis y = inpos(f, g, bc=None) Input | def inpos(f, g, bc=None):
if bc is None: bc = secross()
assert isbinary(f),'First parameter must be binary image'
fg = gray(neg(f),datatype(g))
k1 = limits(g)[1] - 1
y = suprec(fg, intersec(union(g, 1), k1, fg), bc)
return y | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def gini(y):\n p = _proba(y)\n return 1.0 - sum(list(map(lambda x: x * x, p)))",
"def infcanon(f, Iab, theta=45, DIRECTION=\"CLOCKWISE\"):\n from string import upper\n\n DIRECTION = upper(DIRECTION) \n y = union(f,1)\n for t in xrange(0,360,theta):\n Irot = interot( Iab, t, DI... | [
"0.49587741",
"0.4924325",
"0.4912809",
"0.48952273",
"0.4885258",
"0.4875944",
"0.47648594",
"0.47331625",
"0.4716797",
"0.467141",
"0.4640812",
"0.46171814",
"0.4607466",
"0.45900056",
"0.45826694",
"0.4562621",
"0.4543244",
"0.4526693",
"0.45265242",
"0.45122465",
"0.44965... | 0.7870356 | 0 |
Purpose Rotate an interval Synopsis Irot = interot(Iab, theta=45, DIRECTION="CLOCKWISE") Input | def interot(Iab, theta=45, DIRECTION="CLOCKWISE"):
from string import upper
DIRECTION = upper(DIRECTION)
A,Bc = Iab
if DIRECTION != 'CLOCKWISE':
theta = 360 - theta
Irot = se2hmt(serot(A, theta),
serot(Bc,theta))
return Irot | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def rotate_orbit(self):\n try:\n ang = self.orbit_speed * self.time_scale / self.refresh_rate\n self.obj.rotate(angle=ang, axis=vector(0, 1, 0), origin=self.star.obj.pos)\n self.sum_ang += ang\n except ZeroDivisionError:\n print(\"ERROR: REFRESH_RATE is 0\"... | [
"0.61113906",
"0.59354496",
"0.5901596",
"0.5887986",
"0.57631594",
"0.57554793",
"0.5753909",
"0.56799114",
"0.5667262",
"0.5655489",
"0.56445646",
"0.5627167",
"0.5625856",
"0.5608695",
"0.56003684",
"0.55931437",
"0.5551017",
"0.5531723",
"0.5521311",
"0.5519522",
"0.55122... | 0.79123783 | 0 |
Purpose Intersection of images. Synopsis y = intersec(f1, f2, f3=None, f4=None, f5=None) Input | def intersec(f1, f2, f3=None, f4=None, f5=None):
from numpy import minimum
y = minimum(f1,f2)
if f3 != None: y = minimum(y,f3)
if f4 != None: y = minimum(y,f4)
if f5 != None: y = minimum(y,f5)
y = y.astype(f1.dtype)
return y | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _intersection(self, ix, iy):\n im = ix + iy # cv2.bitwise_or(ix, iy)\n # freq = cytoolz.frequencies(im.ravel())\n # hx = freq.get(1, 0) # x alone\n # hy = freq.get(2, 0) # y alone\n # ha = freq.get(3, 0) # x & y\n\n freq = np.bincount(im.ravel().astype(np.int64))\n... | [
"0.5550678",
"0.5321925",
"0.51406676",
"0.5111686",
"0.5091838",
"0.5046774",
"0.5011251",
"0.49960968",
"0.49668634",
"0.49533305",
"0.4908762",
"0.4878161",
"0.4868135",
"0.4863189",
"0.48598722",
"0.48571467",
"0.4842575",
"0.4833724",
"0.48038805",
"0.48024225",
"0.47825... | 0.6872316 | 0 |
Purpose Visualize an interval. Synopsis s = intershow(Iab) Input | def intershow(Iab):
from numpy import array, product, reshape, choose
from string import join
assert (type(Iab) is tuple) and (len(Iab) == 2),'not proper fortmat of hit-or-miss template'
A,Bc = Iab
S = seunion(A,Bc)
Z = intersec(S,0)
n = product(S.shape)
one = reshape(array(n*'1','c'),... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def plot_i(im, Prior, nit, chi2_1, chi2_2, ipynb=False):\n\n plt.ion()\n plt.pause(0.00001)\n plt.clf()\n\n plt.imshow(im.reshape(Prior.ydim,Prior.xdim), cmap=plt.get_cmap('afmhot'), interpolation='gaussian')\n xticks = ticks(Prior.xdim, Prior.psize/RADPERAS/1e-6)\n yticks = ticks(Prior.ydim, Pri... | [
"0.5757846",
"0.5713726",
"0.53714246",
"0.5276241",
"0.5264594",
"0.5239132",
"0.5179675",
"0.51576793",
"0.51330775",
"0.5089651",
"0.5087073",
"0.5026945",
"0.4998704",
"0.49910372",
"0.4987193",
"0.49841288",
"0.49761367",
"0.49475637",
"0.49366847",
"0.49364328",
"0.4906... | 0.72195244 | 0 |
Purpose Check for binary image Synopsis bool = isbinary(f) Input | def isbinary(f):
return f.dtype == bool | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def is_binary(*args):\n return _ida_hexrays.is_binary(*args)",
"def is_binary(self):\n return self._vtype is self.BINARY",
"def verify_binary_image(self, image_path):\n raise NotImplementedError",
"def DataIsBinaryData(self):\n return self.data_type == definitions.REG_BINARY",
"def _is_binary... | [
"0.7580186",
"0.73578507",
"0.71543235",
"0.6975239",
"0.696654",
"0.6770387",
"0.6754604",
"0.67375267",
"0.6671645",
"0.6623334",
"0.661543",
"0.65633804",
"0.6537563",
"0.6478736",
"0.64759463",
"0.64583725",
"0.6397687",
"0.634126",
"0.6327053",
"0.63266563",
"0.6264424",... | 0.7810757 | 0 |
Purpose Verify if two images are equal Synopsis bool = isequal(f1, f2) Input | def isequal(f1, f2):
import numpy
if f1.shape != f2.shape:
return False
return numpy.all(f1 == f2) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def assert_image_equal(path1, path2):\n test_im = np.asarray(Image.open(path1))\n ref_im = np.asarray(Image.open(path2))\n npt.assert_array_equal(test_im, ref_im)",
"def is_equal(image_a, image_b, tolerance=0.0):\n return image_diff_percent(image_a, image_b) <= tolerance",
"def __compareImage(self,... | [
"0.7171124",
"0.6905145",
"0.67691016",
"0.67428064",
"0.6661723",
"0.65292877",
"0.65236276",
"0.6483344",
"0.64660984",
"0.6410994",
"0.63321173",
"0.6309696",
"0.62993515",
"0.6280322",
"0.62787986",
"0.6241418",
"0.6239211",
"0.620929",
"0.6196858",
"0.6182936",
"0.617962... | 0.77318853 | 0 |
Purpose Label the flat zones of grayscale images. Synopsis y = labelflat(f, Bc=None, _lambda=0) Input | def labelflat(f, Bc=None, _lambda=0):
from numpy import allclose, ravel, nonzero, array
if Bc is None: Bc = secross()
zero = binary(subm(f,f)) # zero image
faux = neg(zero)
r = array(zero)
label = 1
y = gray( zero,'uint16',0) # zero image (output)
while not allclose(faux,0... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def label(f, Bc=None):\n from numpy import allclose, ravel, nonzero, array\n if Bc is None: Bc = secross()\n assert isbinary(f),'Can only label binary image'\n zero = subm(f,f) # zero image\n faux=f\n r = array(zero)\n label = 1\n y = gray( f,'uint16',0) # zero image (o... | [
"0.70079833",
"0.53392905",
"0.51277876",
"0.51131576",
"0.5051741",
"0.5022834",
"0.49728134",
"0.4950022",
"0.49367398",
"0.48788965",
"0.48580185",
"0.48504183",
"0.48274547",
"0.48177698",
"0.481461",
"0.4807769",
"0.48049158",
"0.48013136",
"0.47956997",
"0.47846758",
"0... | 0.8556104 | 0 |
Purpose Last erosion. Synopsis y = lastero(f, B=None) Input | def lastero(f, B=None):
if B is None: B = secross()
assert isbinary(f),'Can only process binary images'
dt = dist(f,B)
y = regmax(dt,B)
return y | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def close(f, b=None):\n\n if b is None: b = secross()\n y = erode(dilate(f,b),b)\n return y",
"def LastImage(self, *args):\n return _BRepAlgo.BRepAlgo_Image_LastImage(self, *args)",
"def getLastFunction(self) -> ghidra.program.model.listing.Function:\n ...",
"def erode(f, b=None):\n\n ... | [
"0.56743246",
"0.53601795",
"0.5335905",
"0.514489",
"0.50374514",
"0.5001263",
"0.49751768",
"0.4970218",
"0.48929608",
"0.48907316",
"0.4794045",
"0.47785863",
"0.47500336",
"0.47499752",
"0.4701164",
"0.4699475",
"0.4693124",
"0.46776262",
"0.4637584",
"0.46161115",
"0.461... | 0.7462214 | 0 |
Purpose Display a labeled image assigning a random color for each label. Synopsis y = lblshow(f, option='noborder') Input | def lblshow(f, option='noborder'):
import string
import adpil
if (isbinary(f)) or (len(f.shape) != 2):
print 'Error, lblshow: works only for grayscale labeled image'
return
option = string.upper(option);
if option == 'NOBORDER':
border = 0.0;
elif option == 'BORDER':
bor... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def plot_labels(lbl: scipy.ndarray, lbl_count: int) -> None:\n color_map = scipy.rand(lbl_count, 3)\n color_map = matplotlib.colors.ListedColormap(color_map)\n plt.imshow(lbl, cmap=color_map)\n plt.show()",
"def show_label(lbl, ignore_background=True, ordering='channel_last'):\n assert(len(lbl.sha... | [
"0.72954917",
"0.65518343",
"0.6539599",
"0.6395783",
"0.6286244",
"0.6237904",
"0.60990024",
"0.6067688",
"0.6056163",
"0.59214073",
"0.58710533",
"0.5815144",
"0.5754062",
"0.57363784",
"0.57299906",
"0.5709761",
"0.569697",
"0.56848097",
"0.56744164",
"0.56590253",
"0.5658... | 0.75662404 | 0 |
Purpose Morphological opening. Synopsis y = open(f, b=None) Input | def open(f, b=None):
if b is None: b = secross()
y = dilate(erode(f,b),b)
return y | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def open_from(self, f: BinaryIO):\n raise NotImplementedError",
"def open(self):\n self.f = open(self.join(self.fname), 'rb')",
"def openth(f, b=None):\n\n if b is None: b = secross()\n y = subm(f, open(f,b))\n return y",
"def open(cls, a, b):\n return cls(a, b, True, True)",
... | [
"0.69539124",
"0.62820196",
"0.6009589",
"0.59265524",
"0.59174836",
"0.5817507",
"0.5735691",
"0.5693608",
"0.56841505",
"0.56465787",
"0.56172484",
"0.56172484",
"0.56172484",
"0.5608226",
"0.5608226",
"0.5556868",
"0.5539117",
"0.5526995",
"0.551417",
"0.548414",
"0.547248... | 0.6828697 | 1 |
Purpose Opening by reconstruction. Synopsis y = openrec(f, bero=None, bc=None) Input | def openrec(f, bero=None, bc=None):
if bero is None: bero = secross()
if bc is None: bc = secross()
y = infrec(erode(f,bero),f,bc)
return y | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def openrecth(f, bero=None, bc=None):\n\n if bero is None: bero = secross()\n if bc is None: bc = secross()\n y = subm(f, openrec( f, bero, bc))\n return y",
"def asfrec(f, SEQ=\"OC\", b=None, bc=None, n=1):\n from string import upper\n if b is None: b = secross()\n if bc is None: bc = secro... | [
"0.6756626",
"0.6454735",
"0.59388334",
"0.57303524",
"0.537819",
"0.5319065",
"0.5221635",
"0.51945436",
"0.5104948",
"0.50203484",
"0.49595824",
"0.49175397",
"0.49002182",
"0.4868304",
"0.48669523",
"0.48416635",
"0.4827117",
"0.48208258",
"0.47187746",
"0.47092536",
"0.46... | 0.8306411 | 0 |
Purpose OpenbyReconstruction TopHat. Synopsis y = openrecth(f, bero=None, bc=None) Input | def openrecth(f, bero=None, bc=None):
if bero is None: bero = secross()
if bc is None: bc = secross()
y = subm(f, openrec( f, bero, bc))
return y | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_tophat():\n savedImg = galsim.fits.read(os.path.join(imgdir, \"tophat_101.fits\"))\n myImg = galsim.ImageF(savedImg.bounds, scale=0.2)\n myImg.setCenter(0,0)\n test_flux = 1.8\n\n # There are numerical issues with using radius = 1, since many points are right on the edge\n # of the circl... | [
"0.554547",
"0.53712815",
"0.5331042",
"0.5286112",
"0.5060344",
"0.49874943",
"0.49864298",
"0.4905134",
"0.49026182",
"0.48963746",
"0.48657727",
"0.48414564",
"0.4839161",
"0.4817517",
"0.4799368",
"0.4794812",
"0.47883427",
"0.4780328",
"0.47744837",
"0.47574967",
"0.4754... | 0.74896884 | 0 |
Purpose Opening Top Hat. Synopsis y = openth(f, b=None) Input | def openth(f, b=None):
if b is None: b = secross()
y = subm(f, open(f,b))
return y | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def closeth(f, b=None):\n\n if b is None: b = secross()\n return subm( close(f,b), f)",
"def test_hof(a, b):\n def f(g, x):\n return g(x) * g(x + 10.0)\n\n def g(x):\n return x * b\n\n return f(g, a) + f(g, b)",
"def ifht(x_hat, N):\n y = (1.0/N)*fht(x_hat,N)\n return y",
"... | [
"0.54166555",
"0.5237505",
"0.5226613",
"0.49811536",
"0.49380755",
"0.48255906",
"0.48237592",
"0.47748217",
"0.47377032",
"0.47330248",
"0.4732951",
"0.47302523",
"0.47273284",
"0.4726421",
"0.4723599",
"0.4721565",
"0.47176003",
"0.47091225",
"0.46939802",
"0.4675775",
"0.... | 0.71408486 | 0 |
Purpose Open transform. Synopsis y = opentransf(f, type='OCTAGON', n=65535, Bc=None, Buser=None) Input | def opentransf(f, type='OCTAGON', n=65535, Bc=None, Buser=None):
import numpy
from string import find, upper
if Bc is None: Bc = secross()
if Buser is None: Buser = secross()
assert isbinary(f),'Error: input image is not binary'
type = upper(type)
rec_flag = find(type,'-REC')
if rec_flag... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def d2transf_df2(self,f):\r\n raise NotImplementedError",
"def asf(f, SEQ=\"OC\", b=None, n=1):\n from string import upper\n if b is None: b = secross()\n SEQ=upper(SEQ)\n y = f\n if SEQ == 'OC':\n for i in xrange(1,n+1):\n nb = sesum(b,i)\n y = open(close(y,nb)... | [
"0.557945",
"0.55373204",
"0.54732573",
"0.5471582",
"0.5462985",
"0.5365609",
"0.5350743",
"0.5281407",
"0.5233856",
"0.5174601",
"0.5071929",
"0.50640035",
"0.49359387",
"0.4932527",
"0.49059066",
"0.48738205",
"0.4815226",
"0.47871685",
"0.4767696",
"0.475772",
"0.4756761"... | 0.712125 | 0 |
Purpose Pattern spectrum (also known as granulometric size density). Synopsis h = patspec(f, type='OCTAGON', n=65535, Bc=None, Buser=None) Input | def patspec(f, type='OCTAGON', n=65535, Bc=None, Buser=None):
if Bc is None: Bc = secross()
if Buser is None: Buser = secross()
assert isbinary(f),'Error: input image is not binary'
g=opentransf(f,type,n,Bc,Buser)
h=histogram(g)
h=h[1:]
return h | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def plotspec(ant,freq=True,test=False):\n snap.write_int('rst',1)\n snap.write_int('antenna',ant);\n snap.write_int('rst',0)\n\n ## Test\n if (test):\n if ant in [2,3,6,7,10,11]:\n test = (np.linspace(256,511,num=256,dtype='uint64')**2)*(ACC_LEN/256)\n else:\n tes... | [
"0.5420577",
"0.538487",
"0.5344633",
"0.5169629",
"0.51451063",
"0.50772923",
"0.5032024",
"0.49716318",
"0.4956839",
"0.49158987",
"0.48930684",
"0.48874265",
"0.486744",
"0.4854648",
"0.48506615",
"0.48432308",
"0.48252663",
"0.48034978",
"0.4778246",
"0.47676772",
"0.4741... | 0.7168527 | 0 |
Purpose Read an image from a coercial file format and stores it as a grayscale image. Synopsis y = readgray(filename) Input | def readgray(filename):
import adpil
import numpy
y = adpil.adread(filename)
if (len(y.shape) == 3) and (y.shape[0] == 3):
if numpy.alltrue(numpy.alltrue(y[0,:,:] == y[1,:,:] and
y[0,:,:] == y[2,:,:])):
y = y[0,:,:]
else:
print... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def readGrayImage(filename):\n return cv2.cvtColor(cv2.imread(filename), cv2.COLOR_BGR2GRAY)",
"def read_image(filename, grayscale=False):\n # Convert to grayscale\n if grayscale:\n return cv2.imread(filename, cv2.IMREAD_GRAYSCALE)\n return cv2.imread(filename, cv2.IMREAD_COLOR... | [
"0.76040137",
"0.7300926",
"0.7279421",
"0.72097564",
"0.71466297",
"0.71089125",
"0.7061506",
"0.7040507",
"0.7030999",
"0.7015794",
"0.6977592",
"0.69375604",
"0.6933104",
"0.6828671",
"0.6808865",
"0.6715913",
"0.6560758",
"0.6468105",
"0.6447943",
"0.6437981",
"0.6437015"... | 0.79759306 | 0 |
Purpose Regional Maximum. Synopsis y = regmax(f, Bc=None) Input | def regmax(f, Bc=None):
if Bc is None: Bc = secross()
y = regmin(neg(f),Bc)
return y | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def hmax(f, h=1, Bc=None):\n\n if Bc is None: Bc = secross()\n g = subm(f,h)\n y = infrec(g,f,Bc);\n return y",
"def lastero(f, B=None):\n\n if B is None: B = secross()\n assert isbinary(f),'Can only process binary images'\n dt = dist(f,B)\n y = regmax(dt,B)\n return y",
"def f_max(c... | [
"0.64972466",
"0.61669475",
"0.60660964",
"0.6030758",
"0.6011582",
"0.5995874",
"0.5962057",
"0.58232",
"0.57518655",
"0.5708206",
"0.5704298",
"0.5638128",
"0.5589921",
"0.55670613",
"0.55462193",
"0.55293804",
"0.54998696",
"0.54763603",
"0.5439331",
"0.5431758",
"0.541684... | 0.8212994 | 0 |
Purpose Regional Minimum (with generalized dynamics). Synopsis y = regmin(f, Bc=None, option="binary") Input | def regmin(f, Bc=None, option="binary"):
if option != 'binary':
raise ValueError, "mmorph.regmin only implements option 'binary'"
if Bc is None: Bc = secross()
fplus = addm(f,1)
g = subm(suprec(fplus,f,Bc),f)
y = union(threshad(g,1),threshad(f,0,0))
return y | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def regmax(f, Bc=None):\n\n if Bc is None: Bc = secross()\n y = regmin(neg(f),Bc)\n return y",
"def hmin(f, h=1, Bc=None):\n\n if Bc is None: Bc = secross()\n g = addm(f,h)\n y = suprec(g,f,Bc);\n return y",
"def calculate_ucb_min(self, node):\n pass",
"def cmin(self):\n re... | [
"0.6711771",
"0.6691241",
"0.5898458",
"0.57957244",
"0.57913",
"0.5791215",
"0.5684166",
"0.5683734",
"0.5497896",
"0.5491771",
"0.5488561",
"0.548676",
"0.54769564",
"0.5431644",
"0.5412499",
"0.540621",
"0.5404174",
"0.5387355",
"0.5342296",
"0.52961373",
"0.5289252",
"0... | 0.8399605 | 0 |
Purpose Create an interval from a pair of structuring elements. Synopsis Iab = se2interval(a, b) Input | def se2interval(a, b):
Iab = (a,neg(b))
return Iab | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def by_two_intervals(s1,s2,interval):\n def fun(x,y):\n if isinstance(interval,int):\n return x.pitch.isInterval(interval,True).With(y.pitch)\n return x.pitch.isQualifiedInterval(interval).With(y.pitch)\n\n previous_interval = None\n for n1, n2 in tools.iter_melodies(s1,s2,alone=F... | [
"0.5948384",
"0.58329314",
"0.5748686",
"0.5635699",
"0.5541112",
"0.54089236",
"0.5391532",
"0.5372431",
"0.53481793",
"0.5342875",
"0.5324542",
"0.5296833",
"0.5254157",
"0.52398103",
"0.514211",
"0.5106963",
"0.50758666",
"0.50488985",
"0.50403476",
"0.503439",
"0.50271845... | 0.80450314 | 0 |
Purpose Create a HitorMiss Template (or interval) from a pair of structuring elements. Synopsis Iab = se2hmt(A, Bc) Input | def se2hmt(A, Bc):
Iab = (A,Bc)
return Iab | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def homothin():\n\n Iab = se2hmt(binary([[0,0,0],\n [0,1,0],\n [1,1,1]]),\n binary([[1,1,1],\n [0,0,0],\n [0,0,0]]))\n return Iab",
"def intershow(Iab):\n from numpy import a... | [
"0.5935628",
"0.5203947",
"0.5156816",
"0.5001209",
"0.49773547",
"0.49469954",
"0.4834421",
"0.4742898",
"0.47288653",
"0.46997464",
"0.46900135",
"0.46281734",
"0.45816383",
"0.45816183",
"0.45565605",
"0.4554336",
"0.45101285",
"0.44778553",
"0.44578913",
"0.44561213",
"0.... | 0.7443979 | 0 |
Purpose Create a box structuring element. Synopsis B = sebox(r=1) Input | def sebox(r=1):
B = sesum(binary([[1,1,1],
[1,1,1],
[1,1,1]]),r)
return B | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def make_box(stdscr, margin:int):\n sh, sw = stdscr.getmaxyx()\n\n box = (\n (margin, margin),\n (sh-margin, sw-margin)\n )\n rectangle(stdscr, box[0][0], box[0][1], box[1][0], box[1][1])\n stdscr.refresh()\n return box",
"def make_box(self, scale, color):\n box = Box()\n ... | [
"0.61443913",
"0.6077646",
"0.6077646",
"0.5998179",
"0.59882873",
"0.59826237",
"0.59245235",
"0.59116673",
"0.5769263",
"0.57278985",
"0.5692559",
"0.56453395",
"0.5620565",
"0.55625623",
"0.556157",
"0.5534646",
"0.55215067",
"0.5501973",
"0.5496666",
"0.5495837",
"0.54814... | 0.7607452 | 0 |
Purpose Diamond structuring element and elementary 3x3 cross. Synopsis B = secross(r=1) Input | def secross(r=1):
B = sesum(binary([[0,1,0],
[1,1,1],
[0,1,0]]),r)
return B | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def cross(a, b):\n c1 = a[1]*b[2] - a[2]*b[1]\n c2 = a[2]*b[0] - a[0]*b[2]\n c3 = a[0]*b[1] - a[1]*b[0]\n return sp.array([c1,c2,c3])",
"def unscrew( S ):\n S = asarray(S)\n assert allclose(S[...,:3,:3].transpose(0,1),-S[...,:3,:3]),\"S[...,:3,:3] is skew\"\n assert allclose(S[...,3,:],0),\"... | [
"0.56833214",
"0.55771077",
"0.5575954",
"0.5565609",
"0.5475021",
"0.5283409",
"0.5263648",
"0.5218264",
"0.51858205",
"0.5176886",
"0.51693314",
"0.51222295",
"0.50821733",
"0.5074825",
"0.50703686",
"0.50317425",
"0.5019279",
"0.500771",
"0.49952647",
"0.49905232",
"0.4979... | 0.6263531 | 0 |
Purpose Create a disk or a semisphere structuring element. Synopsis B = sedisk(r=3, DIM="2D", METRIC="EUCLIDEAN", FLAT="FLAT", h=0) Input | def sedisk(r=3, DIM="2D", METRIC="EUCLIDEAN", FLAT="FLAT", h=0):
from string import upper
from numpy import resize, transpose, arange
from numpy import sqrt, arange, transpose, maximum
METRIC = upper(METRIC)
FLAT = upper(FLAT)
assert DIM=='2D','Supports only 2D structuring element... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def makedisk(s=None, c=None, r=None, inside=1.0, outside=0.0, grey=None, t=None):\n\n \n # fft style or sft asymmetric style - center = nx/2, ny/2\n # see ellipseDriver.py for details on symm...\n\n disk = np.where(euclid2(s, c=c) <= r*r, inside, outside)\n return disk",
"def Disc(center=(0.0, 0.0... | [
"0.60519713",
"0.578708",
"0.54083234",
"0.53250074",
"0.52107286",
"0.51606816",
"0.5047988",
"0.4983169",
"0.49014157",
"0.4874242",
"0.48733363",
"0.4830094",
"0.48115158",
"0.48043427",
"0.47882792",
"0.4764162",
"0.47034746",
"0.4699651",
"0.46978298",
"0.4695904",
"0.46... | 0.7864535 | 0 |
Purpose Create a line structuring element. Synopsis B = seline(l=3, theta=0) Input | def seline(l=3, theta=0):
import numpy
from numpy import pi, tan, cos, sin, sign, floor, arange, transpose, array, ones
theta = pi*theta//180
if abs(tan(theta)) <= 1:
s = sign(cos(theta))
x0 = arange(0, l * cos(theta)-(s*0.5),s)
x1 = floor(x0 * tan(theta) + 0.5)
else:
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def line(l, color='k', **kwargs):\n ax.plot(wfl(nth(l, 0)), hfl(nth(l, 1)), color=color, **kwargs)",
"def createLineSegment(self):\n return _libsbml.Curve_createLineSegment(self)",
"def getLine(self, **kwargs):\n return Line(self.p1, self.angle, **kwargs)",
"def create_line(uniform = Tru... | [
"0.62474877",
"0.6006988",
"0.58282876",
"0.5787256",
"0.5750338",
"0.56996584",
"0.5695907",
"0.5674978",
"0.5670235",
"0.5636259",
"0.56338775",
"0.55811584",
"0.55447286",
"0.5528125",
"0.5523192",
"0.5521161",
"0.5507543",
"0.5501937",
"0.5496593",
"0.5456718",
"0.5447206... | 0.74614924 | 0 |
Purpose Rotate a structuring element. Synopsis BROT = serot(B, theta=45, DIRECTION="CLOCKWISE") Input | def serot(B, theta=45, DIRECTION="CLOCKWISE"):
from string import upper
from numpy import array, sin, cos, transpose
from numpy import cos, sin, pi, concatenate, transpose, array
DIRECTION = upper(DIRECTION)
if DIRECTION == "ANTI-CLOCKWISE":
theta = -theta
SA = mat2set(B)
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def rotate(self, theta, legs):\n U, onew = rotationTensor(theta, self.symmetries, legs)\n B = U @ self\n new = list(onew)\n old = list(legs)\n if B.internallegs != self.internallegs:\n old.append(self.internallegs[0])\n new.append(B.internallegs[0])\n ... | [
"0.6071138",
"0.581365",
"0.57985866",
"0.5787779",
"0.57080203",
"0.5698312",
"0.5628339",
"0.5620734",
"0.5615687",
"0.5613369",
"0.5574234",
"0.5572777",
"0.55222696",
"0.54714185",
"0.54517084",
"0.54351336",
"0.54227227",
"0.54202676",
"0.5413972",
"0.53928804",
"0.53844... | 0.75870544 | 0 |
Purpose Display a structuring element as an image. Synopsis y = seshow(B, option="NORMAL") Input | def seshow(B, option="NORMAL"):
from string import upper
option = upper(option)
if option=='NON-FLAT':
y=to_int32([0])
if isbinary(B):
B = intersec(gray(B,'int32'),0)
elif option=='NORMAL':
if isbinary(B): y=binary([1])
else:
y=to_i... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def visualize_svd():",
"def Show(orignal_img, sobel_image):\n # use imshow() function to show the images\n # syntax : cv2.imshow(winname, mat)\n cv2.imshow(\"Original_Image\", orignal_img)\n cv2.imshow(\"Sobel_Image\", sobel_image)\n cv2.waitKey(0)\n cv2.destroyAllWindows()",
"def lblshow(f, ... | [
"0.6048244",
"0.59566885",
"0.5860346",
"0.5810501",
"0.57726616",
"0.5683788",
"0.56204325",
"0.56149614",
"0.56018853",
"0.56009793",
"0.5586642",
"0.5583994",
"0.55368537",
"0.5524361",
"0.55139434",
"0.5503463",
"0.549414",
"0.5481992",
"0.5474241",
"0.5458113",
"0.543287... | 0.7857462 | 0 |
Purpose N1 iterative Minkowski additions Synopsis NB = sesum(B=None, N=1) Input | def sesum(B=None, N=1):
if B is None: B = secross()
if N==0:
if isbinary(B): return binary([1])
else: return to_int32([0]) # identity
NB = B
for i in xrange(N-1):
NB = sedilate(NB,B)
return NB | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def int_simpson_for_bessel(a, b, func, N, func_n, func_x):\r\n h = (b - a)/N\r\n sum_Odd = 0\r\n sum_Even = 0\r\n for k in range(1, N, 2):\r\n sum_Odd += func((a + (k * h)), func_n, func_x)\r\n for j in range(2, N, 2):\r\n sum_Even += func((a + (j * h)), func_n, func_x)\r\n return (... | [
"0.56477606",
"0.5616066",
"0.5561196",
"0.5561196",
"0.55421174",
"0.5490379",
"0.543925",
"0.53774047",
"0.5367669",
"0.53412735",
"0.5330676",
"0.53121674",
"0.52949905",
"0.5288876",
"0.52888703",
"0.5287724",
"0.5262316",
"0.52510536",
"0.52490634",
"0.5233328",
"0.52302... | 0.7622934 | 0 |
Purpose Translate a structuring element Synopsis Bo = setrans(Bi, t) Input | def setrans(Bi, t):
x,v=mat2set(Bi)
Bo = set2mat((x+t,v))
Bo = Bo.astype(Bi.dtype)
return Bo | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def to_se3(self, state: Vector) -> RigidTransform:\n return (state[:9],state[9:])",
"def transform():",
"def to_se3(self, state: Vector) -> RigidTransform:\n return (state[:9],state[9:12])",
"def transsp (arg):\r\n\r\n return s.translate(p.translate(arg))",
"def transform():\n pass"... | [
"0.56667125",
"0.56213605",
"0.5582642",
"0.5469088",
"0.54087114",
"0.53943187",
"0.53624475",
"0.5348053",
"0.5301874",
"0.5301874",
"0.52576727",
"0.52576727",
"0.5205815",
"0.51716805",
"0.51650065",
"0.5158294",
"0.51552373",
"0.5145296",
"0.5128321",
"0.50931877",
"0.50... | 0.7136782 | 0 |
Purpose Reflect a structuring element Synopsis Bo = sereflect(Bi) Input | def sereflect(Bi):
Bo = serot(Bi, 180)
return Bo | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def sitofp(self, typ):",
"def represent(self, elt):\n raise NotImplementedError",
"def bic(self, X):\n raise NotImplementedError",
"def element(self, element):\n pass",
"def _desc_op(attr_name):",
"def ElementType(self) -> _n_0_t_1:",
"def b(self):\n pass",
"def b(self):\n... | [
"0.5235562",
"0.5072968",
"0.50427866",
"0.4876433",
"0.48747474",
"0.48655817",
"0.4858718",
"0.4858718",
"0.4844144",
"0.4830589",
"0.4830589",
"0.4830589",
"0.4805259",
"0.47620785",
"0.47186315",
"0.47120416",
"0.47048888",
"0.46823135",
"0.46735406",
"0.4660134",
"0.4658... | 0.6032333 | 0 |
Purpose Dilate one structuring element by another Synopsis Bo = sedilate(B1, B2) Input | def sedilate(B1, B2):
from numpy import newaxis, array, int32
assert (isbinary(B1) or (B1.dtype == int32)) and (isbinary(B2) or B2.dtype == int32), 'pymorph.sedilate: s.e. must be binary or int32'
if len(B1.shape) == 1: B1 = B1[newaxis,:]
if len(B2.shape) == 1: B2 = B2[newaxis,:]
if B1.dtype==int32... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def dilate(h, d):\n pass",
"def merge(self, skel):\n return Skeleton.simple_merge((self, skel)).consolidate()",
"def dilation(img: torch.Tensor, structuring_element: torch.Tensor):\n if not torch.is_tensor(img):\n raise TypeError(f\"Input type is not a torch.Tensor. Got {typ... | [
"0.51845676",
"0.5112889",
"0.49238935",
"0.48495737",
"0.4694336",
"0.46332514",
"0.46196324",
"0.45879838",
"0.45544392",
"0.45449486",
"0.4543158",
"0.4525007",
"0.44721884",
"0.4464903",
"0.44527355",
"0.444316",
"0.44171098",
"0.44118404",
"0.4410986",
"0.4408205",
"0.44... | 0.73590773 | 0 |
Purpose Display binary or grayscale images and optionally overlay it with binary images. Synopsis show(f, f1=None, f2=None, f3=None, f4=None, f5=None, f6=None) Input | def show(f, f1=None, f2=None, f3=None, f4=None, f5=None, f6=None):
import adpil
if len(f.shape) != 2:
print "Error, show: can only process gray-scale and binary images."
return
if f1 == None: y = gshow(f)
elif f2 == None: y = gshow(f,f1)
elif f3 == None: y = gshow(f,f1,f2)
elif ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def dtshow(f, n=10):\n import adpil\n\n if (isbinary(f)) or (len(f.shape) != 2):\n print 'Error, dtshow: works only for grayscale labeled image'\n return\n y=gdtshow(f, n)\n adpil.adshow(y)\n return\n return y",
"def lblshow(f, option='noborder'):\n import string\n import adpil\... | [
"0.6954009",
"0.67955637",
"0.67686874",
"0.66398716",
"0.6074104",
"0.6042598",
"0.5944396",
"0.5923831",
"0.592012",
"0.5894355",
"0.58857346",
"0.58777785",
"0.5876695",
"0.5875871",
"0.5847373",
"0.5829668",
"0.5786779",
"0.5775828",
"0.57366836",
"0.5733731",
"0.5733714"... | 0.8956627 | 0 |
Purpose Morphological skeleton (Medial Axis Transform). Synopsis y = skelm(f, B=None, option="binary") Input | def skelm(f, B=None, option="binary"):
from string import upper
from numpy import asarray
if B is None: B = secross()
assert isbinary(f),'Input binary image only'
option = upper(option)
k1,k2 = limits(f)
y = gray(intersec(f, k1),'uint16')
iszero = asarray(y)
nb = sesum(B,0)
for r... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def skeleton(self) -> Skeleton:\n return self._skel",
"def skiz(f, Bc=None, LINEREG=\"LINES\", METRIC=None):\n from string import upper\n if Bc is None: Bc = secross()\n LINEREG = upper(LINEREG)\n if METRIC is not None: METRIC = upper(METRIC)\n d = dist( neg(f), Bc, METRIC)\n return cwat... | [
"0.5796672",
"0.5737103",
"0.5724736",
"0.5642636",
"0.54674464",
"0.5455851",
"0.5439899",
"0.5390987",
"0.5351297",
"0.5344696",
"0.52084625",
"0.5166703",
"0.5089321",
"0.50299186",
"0.4992209",
"0.4965207",
"0.4947632",
"0.48840582",
"0.48764592",
"0.48754197",
"0.4849102... | 0.70754075 | 0 |
Purpose Morphological skeleton reconstruction (Inverse Medial Axis Transform). Synopsis y = skelmrec(f, B=None) Input | def skelmrec(f, B=None):
from numpy import ravel
if B is None: B = secross()
y = binary(intersec(f, 0))
for r in xrange(f.max(),1,-1):
y = dilate(union(y,binary(f,r)), B)
y = union(y, binary(f,1))
return y | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def skelm(f, B=None, option=\"binary\"):\n from string import upper\n from numpy import asarray\n if B is None: B = secross()\n assert isbinary(f),'Input binary image only'\n option = upper(option)\n k1,k2 = limits(f)\n y = gray(intersec(f, k1),'uint16')\n iszero = asarray(y)\n nb = sesu... | [
"0.5718637",
"0.5307344",
"0.52512884",
"0.5198796",
"0.51254356",
"0.50770676",
"0.4987315",
"0.49628842",
"0.49048737",
"0.48472163",
"0.4817105",
"0.48124534",
"0.47990763",
"0.4789662",
"0.4777928",
"0.4736347",
"0.4721699",
"0.47163635",
"0.47100917",
"0.47002766",
"0.46... | 0.6574194 | 0 |
Purpose Skeleton of Influence Zone also know as Generalized Voronoi Diagram Synopsis y = skiz(f, Bc=None, LINEREG="LINES", METRIC=None) Input | def skiz(f, Bc=None, LINEREG="LINES", METRIC=None):
from string import upper
if Bc is None: Bc = secross()
LINEREG = upper(LINEREG)
if METRIC is not None: METRIC = upper(METRIC)
d = dist( neg(f), Bc, METRIC)
return cwatershed(d,f,Bc,LINEREG)
return y | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def drawfeilin(polylinedatasetdictlist,origindict):#polylinedatasetdictlist-一行中所有图层的字典的列表,其中字典为(key:图层名,value:一个outline中的该图层多段线列表) origindict-原始的未进行操作的字典 \r\n feilin=open(globalconfig.NAME_OF_FEILIN+'(总菲林)'+'.dxf','w')\r\n layernamelist=list(origindict.keys())\r\n layernamelist.append(\"Cutline\") #这里会... | [
"0.533428",
"0.52707845",
"0.5213046",
"0.5046017",
"0.5005625",
"0.49542868",
"0.48207745",
"0.47903123",
"0.4789229",
"0.4768798",
"0.47444606",
"0.47209102",
"0.46948388",
"0.46923578",
"0.46895358",
"0.4681331",
"0.46407914",
"0.4630461",
"0.4568996",
"0.45672408",
"0.456... | 0.72191495 | 0 |
Purpose Subtraction of two images, with saturation. Synopsis y = subm(f1, f2) Input | def subm(f1, f2):
from numpy import array, clip
if type(f2) is array:
assert f1.dtype == f2.dtype, 'Cannot have different datatypes:'
bottom,top=limits(f1)
y = clip(f1.astype('d') - f2, bottom, top)
y = y.astype(f1.dtype)
return y | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def mse(img1, img2):\n # TODO: implement this function.",
"def sub(input_a, input_b):\n sub_comp = input_b.duplicate()\n\n ImageBufAlgo.sub(sub_comp, input_a, input_b)\n\n if sub_comp.has_error:\n print \"Error merging subtracting:\", sub_comp.geterror()\n\n return sub_comp",
"def mse(sel... | [
"0.6993942",
"0.6327336",
"0.6240707",
"0.6164609",
"0.61589265",
"0.6106528",
"0.5934784",
"0.5890228",
"0.58845216",
"0.5857732",
"0.58460176",
"0.58219665",
"0.5807514",
"0.5804609",
"0.58032596",
"0.57593954",
"0.57345086",
"0.5695381",
"0.56557053",
"0.5645756",
"0.56418... | 0.6943555 | 1 |
Purpose Union of supgenerating or hitmiss operators. Synopsis y = supcanon(f, Iab, theta=45, DIRECTION="CLOCKWISE") Input | def supcanon(f, Iab, theta=45, DIRECTION="CLOCKWISE"):
from string import upper
DIRECTION = upper(DIRECTION)
y = intersec(f,0)
for t in xrange(0,360,theta):
Irot = interot( Iab, t, DIRECTION )
y = union( y, supgen(f, Irot))
return y | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def infcanon(f, Iab, theta=45, DIRECTION=\"CLOCKWISE\"):\n from string import upper\n\n DIRECTION = upper(DIRECTION) \n y = union(f,1)\n for t in xrange(0,360,theta):\n Irot = interot( Iab, t, DIRECTION )\n y = intersec( y, infgen(f, Irot))\n return y",
"def thick(f, Iab=N... | [
"0.64242256",
"0.5731057",
"0.5448134",
"0.5424091",
"0.5375071",
"0.531567",
"0.48940474",
"0.48541883",
"0.47028157",
"0.4701223",
"0.45724225",
"0.45618814",
"0.4534504",
"0.45128524",
"0.4489929",
"0.44629404",
"0.44618407",
"0.4454609",
"0.44462797",
"0.44271153",
"0.442... | 0.85487866 | 0 |
Purpose Supgenerating (hitmiss). Synopsis y = supgen(f, INTER) Input | def supgen(f, INTER):
A,Bc = INTER
y = intersec(erode(f,A),
erode(neg(f),Bc))
return y | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def inhomogenous_poisson_gen():\n pass",
"def phi_gauss(self,x,i):\n s = 0.1\n return np.exp(-(x-self.mu[i])**2/(2*s))",
"def Pup(self, f):\n d, g, a = f.unwrap()\n assert g == self or g == self.dual\n a = g.upsample(d)(a)\n if g.dimension == 1:\n a = [a]... | [
"0.5395698",
"0.5357534",
"0.5307747",
"0.5272257",
"0.5227863",
"0.5196995",
"0.5118164",
"0.5115864",
"0.5115729",
"0.51071376",
"0.50766695",
"0.50188214",
"0.4991354",
"0.4973613",
"0.49565026",
"0.48985314",
"0.48942164",
"0.48807043",
"0.48313233",
"0.48273173",
"0.4825... | 0.752543 | 0 |
Purpose Supreconstruction. Synopsis y = suprec(f, g, Bc=None) Input | def suprec(f, g, Bc=None):
from numpy import product
if Bc is None: Bc = secross()
n = product(f.shape)
y = cerode(f,g,Bc,n);
return y | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def infrec(f, g, bc=None):\n from numpy import product\n if bc is None: bc = secross()\n n = product(f.shape)\n y = cdilate(f,g,bc,n);\n return y",
"def supgen(f, INTER):\n\n A,Bc = INTER\n y = intersec(erode(f,A),\n erode(neg(f),Bc))\n return y",
"def Pup(self, f):\n ... | [
"0.53062695",
"0.5295013",
"0.52440745",
"0.5243553",
"0.49269965",
"0.49195215",
"0.47597554",
"0.47295818",
"0.47263744",
"0.46553987",
"0.46533364",
"0.46425545",
"0.46257916",
"0.46112236",
"0.45618019",
"0.45462653",
"0.4543052",
"0.45369297",
"0.4518882",
"0.45121497",
... | 0.7220997 | 0 |
Purpose Generate a graphical representation of overlaid binary images. Synopsis y = bshow(f1, f2=None, f3=None, factor=17) Input | def bshow(f1, f2=None, f3=None, factor=17):
import numpy
from numpy import newaxis, zeros, resize, transpose, floor, arange, array
if f1.shape == (): f1 = array([f1])
if len(f1.shape) == 1: f1 = f1[newaxis,:]
if (`f1.shape` != `f2.shape`) or \
(`f1.shape` != `f3.shape`) or \
(`f2.shap... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def show(f, f1=None, f2=None, f3=None, f4=None, f5=None, f6=None):\n import adpil\n\n if len(f.shape) != 2:\n print \"Error, show: can only process gray-scale and binary images.\"\n return\n if f1 == None: y = gshow(f)\n elif f2 == None: y = gshow(f,f1)\n elif f3 == None: y = gshow(f,f... | [
"0.77735025",
"0.6726642",
"0.62480086",
"0.5874973",
"0.58001167",
"0.5390868",
"0.5282849",
"0.5257245",
"0.52138716",
"0.5189458",
"0.51856047",
"0.51818156",
"0.5168935",
"0.51577765",
"0.5142339",
"0.5113775",
"0.5054836",
"0.50543505",
"0.50515974",
"0.5005273",
"0.4966... | 0.7890547 | 0 |
Purpose Detection of similaritybased watershed from markers. Synopsis y = swatershed(f, g, B=None, LINEREG="LINES") Input | def swatershed(f, g, B=None, LINEREG="LINES"):
if B is None: B = secross()
print 'Not implemented yet'
return None
return y | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def cwatershed(f, g, Bc=None, LINEREG=\"LINES\"):\n from numpy import ones, zeros, nonzero, array, put, take, argmin, transpose, compress, concatenate\n if Bc is None: Bc = secross()\n return g\n print 'starting'\n withline = (LINEREG == 'LINES')\n if isbinary(g):\n g = label(g,Bc)\n pr... | [
"0.7123692",
"0.6881982",
"0.66767395",
"0.6613663",
"0.6516717",
"0.64155334",
"0.63130635",
"0.6057454",
"0.57729834",
"0.5710434",
"0.5704734",
"0.56638974",
"0.5635029",
"0.5497284",
"0.5312971",
"0.5300154",
"0.52595633",
"0.52591205",
"0.5240655",
"0.5235068",
"0.511017... | 0.73576254 | 0 |
Purpose Syetric difference between two images Synopsis y = symdif(f1, f2) Input | def symdif(f1, f2):
y = union(subm(f1,f2),subm(f2,f1))
return y | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def mse(img1, img2):\n # TODO: implement this function.",
"def df(self, y1: torch.Tensor, y2: torch.Tensor) -> torch.Tensor:\n out = -y1\n div = y1 * y2\n div.exp_().add_(1)\n out.div_(div)\n return out",
"def ddf(self, y1: torch.Tensor, y2: torch.Tensor) -> torch.Tensor:\... | [
"0.6401439",
"0.61441344",
"0.60185415",
"0.59131885",
"0.5809381",
"0.5779762",
"0.5778992",
"0.57609177",
"0.57143646",
"0.56930345",
"0.5629375",
"0.56235373",
"0.5570933",
"0.55486166",
"0.5538047",
"0.55053735",
"0.54945266",
"0.54762053",
"0.54366446",
"0.5419595",
"0.5... | 0.7406953 | 0 |
Purpose Image transformation by thickening. Synopsis y = thick(f, Iab=None, n=1, theta=45, DIRECTION="CLOCKWISE") Input | def thick(f, Iab=None, n=-1, theta=45, DIRECTION="CLOCKWISE"):
from numpy import product
from string import upper
if Iab is None: Iab = homothick()
DIRECTION = upper(DIRECTION)
assert isbinary(f),'f must be binary image'
if n == -1: n = product(f.shape)
y = f
zero = intersec(... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def cthick(f, g, Iab=None, n=-1, theta=45, DIRECTION=\"CLOCKWISE\"):\n from numpy import product\n from string import upper\n if Iab is None: Iab = homothick()\n DIRECTION = upper(DIRECTION) \n assert isbinary(f),'f must be binary image'\n if n == -1: n = product(f.shape)\n y = f\n ... | [
"0.7377263",
"0.6911481",
"0.6790936",
"0.5704769",
"0.5363019",
"0.52692366",
"0.5068203",
"0.50417197",
"0.5038102",
"0.50283235",
"0.50264615",
"0.5009543",
"0.4975718",
"0.49724564",
"0.49697205",
"0.4944176",
"0.49387357",
"0.49320358",
"0.49202222",
"0.48846045",
"0.487... | 0.78430367 | 0 |
Purpose Image transformation by thinning. Synopsis y = thin(f, Iab=None, n=1, theta=45, DIRECTION="CLOCKWISE") Input | def thin(f, Iab=None, n=-1, theta=45, DIRECTION="CLOCKWISE"):
from numpy import product
from string import upper
if Iab is None: Iab = homothin()
DIRECTION = upper(DIRECTION)
assert isbinary(f),'f must be binary image'
if n == -1: n = product(f.shape)
y = f
zero = intersec(f,... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def thin(image, n_iter=None):\n return _bwmorph_luts(image, THIN_LUTS, n_iter=n_iter)",
"def thick(f, Iab=None, n=-1, theta=45, DIRECTION=\"CLOCKWISE\"):\n from numpy import product\n from string import upper\n if Iab is None: Iab = homothick()\n DIRECTION = upper(DIRECTION) \n asser... | [
"0.69944817",
"0.69784254",
"0.65778655",
"0.60025007",
"0.59191376",
"0.5594904",
"0.52796566",
"0.5194477",
"0.50055206",
"0.49992457",
"0.49725005",
"0.48775452",
"0.48443568",
"0.48405465",
"0.4774701",
"0.47667333",
"0.4753681",
"0.47339427",
"0.47312748",
"0.47170877",
... | 0.8197813 | 0 |
Purpose Union of images. Synopsis y = union(f1, f2, f3=None, f4=None, f5=None) Input | def union(f1, f2, f3=None, f4=None, f5=None):
from numpy import maximum
y = maximum(f1,f2)
if f3: y = maximum(y,f3)
if f4: y = maximum(y,f4)
if f5: y = maximum(y,f5)
y = y.astype(f1.dtype)
return y | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def union(first, second):\n # Put your code here.",
"def union(self, *args):\n return self.phy2abs.union(*args)",
"def union(set1, set2):",
"def UnionBitmap(*args, **kwargs):\n return _gdi_.Region_UnionBitmap(*args, **kwargs)",
"def find_union_mask(self, seg_tags, union_mask='MASK_UNION'):... | [
"0.6346501",
"0.6205143",
"0.6129891",
"0.602732",
"0.6022014",
"0.59550697",
"0.5922102",
"0.58533376",
"0.5831173",
"0.5710097",
"0.5705032",
"0.5670528",
"0.5655304",
"0.5635228",
"0.5622369",
"0.55878305",
"0.5547763",
"0.55428123",
"0.5540368",
"0.5509441",
"0.5504948",
... | 0.72797906 | 0 |
Purpose Watershed detection. Synopsis y = watershed(f, Bc=None, LINEREG="LINES") Input | def watershed(f, Bc=None, LINEREG="LINES"):
from string import upper
if Bc is None: Bc = secross()
return cwatershed(f,regmin(f,Bc),upper(LINEREG))
return y | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def swatershed(f, g, B=None, LINEREG=\"LINES\"):\n\n if B is None: B = secross()\n print 'Not implemented yet'\n return None\n return y",
"def watershed(self, debug=False):\n kernel = cv2.getStructuringElement(cv2.MORPH_CROSS, (3, 3))\n opening = cv2.morphologyEx(self.th[:, :, 0], cv2.M... | [
"0.73437136",
"0.71073806",
"0.70948005",
"0.69198877",
"0.67838186",
"0.66275465",
"0.60017586",
"0.58560956",
"0.5701863",
"0.56298834",
"0.5563376",
"0.5374262",
"0.5267185",
"0.5201022",
"0.5122826",
"0.5041086",
"0.49798903",
"0.49088696",
"0.48946705",
"0.48826241",
"0.... | 0.85451835 | 0 |
Purpose Returns the maximum value associated to an image datatype Synopsis max = maxleveltype(TYPE='uint8') Input | def maxleveltype(TYPE='uint8'):
max = 0
if TYPE == 'uint8' : max=255
elif TYPE == 'binary' : max=1
elif TYPE == 'uint16' : max=65535
elif TYPE == 'int32' : max=2147483647
else:
assert 0, 'does not support this data type:'+TYPE
return max | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def max_level(data: np.ndarray) -> int:\n shape = data.shape[1:] # exclude channel dimension\n return min(shape).bit_length() - 1",
"def max_level(self):\n return self.__max",
"def _maximum(self) -> float:\n if self._type == \"power\":\n return 5.0\n elif self._type == \"... | [
"0.664823",
"0.6647606",
"0.6606293",
"0.6573356",
"0.65679485",
"0.65679485",
"0.6517624",
"0.644482",
"0.64230394",
"0.64144516",
"0.64096117",
"0.6396367",
"0.63958275",
"0.6321711",
"0.6287342",
"0.626718",
"0.62576795",
"0.62556404",
"0.62458754",
"0.62254846",
"0.622512... | 0.8170591 | 0 |
Purpose Convert an image to an int32 image. Synopsis img = to_int32(f) Input | def to_int32(f):
from numpy import array, clip
img = array(clip(f,-2147483647,2147483647)).astype('i')
return img | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def float_to_int_32(x):\n return np.float32(x).view(np.int32)",
"def to_int(image):\n image = tf.clip_by_value(image, -1, 1)\n return tf.image.convert_image_dtype((image + 1.0) / 2.0, tf.uint8)",
"def convert2int(img):\n if img.min() == 0:\n return img\n if img.dtype == \"uint8\":\n ... | [
"0.74303514",
"0.7034025",
"0.6940749",
"0.68668425",
"0.67588574",
"0.62436527",
"0.60712034",
"0.6046119",
"0.59244174",
"0.59151924",
"0.5893568",
"0.57001203",
"0.5658917",
"0.5626006",
"0.56200904",
"0.5590826",
"0.55769676",
"0.55374193",
"0.5517334",
"0.5504136",
"0.54... | 0.8426328 | 0 |
Purpose Convert an image to an uint8 image. Synopsis img = to_uint8(f) Input | def to_uint8(f):
from numpy import array, clip, uint8
img = array(clip(f,0,255),uint8)
return img | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def to_uint8(image):\n\tnp.clip(image, 0, 255, out=image)\n\treturn image.astype(np.uint8)",
"def float32_to_uint8(inputs):\n return np.uint8(np.clip(np.round(inputs * 255), 0, 255))",
"def convert_image_np(inp):\n inp = inp.numpy().transpose((1, 2, 0))\n inp = (inp*255).astype(np.uint8)\n return i... | [
"0.75875145",
"0.67874116",
"0.64244807",
"0.6370332",
"0.6240629",
"0.6220163",
"0.62052065",
"0.62052065",
"0.61827034",
"0.60763305",
"0.6032741",
"0.5929978",
"0.57760197",
"0.56933105",
"0.5573403",
"0.5482651",
"0.5368634",
"0.5304349",
"0.52967614",
"0.5210761",
"0.518... | 0.83298105 | 0 |
Purpose Convert an image to a uint16 image. Synopsis img = to_uint16(f) Input | def to_uint16(f):
from numpy import array, clip
img = array(clip(f,0,65535)).astype('H')
return img | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def read_uint16(self):\n return self.read(BitTypes.UINT_16.value)",
"def read_u16(self) -> int:\n ...",
"def read_u16(self) -> int:",
"def u16(value: bytes, endian: str = \"little\", sign: bool = False) -> int:\n return unpack(value, 16, endian, sign)",
"def to_uint8(f):\n from numpy im... | [
"0.644322",
"0.6298343",
"0.6292515",
"0.6279018",
"0.6251793",
"0.6239747",
"0.62370324",
"0.6229319",
"0.61223716",
"0.60489815",
"0.5977147",
"0.5926655",
"0.5917304",
"0.58859867",
"0.58277243",
"0.5738994",
"0.56851804",
"0.5675535",
"0.5633856",
"0.5596929",
"0.55840623... | 0.8527541 | 0 |
Purpose Return the image datatype string Synopsis type = datatype(f) Input | def datatype(f):
from numpy import bool, uint8, uint16, int32
code = f.dtype
if code == bool: type='binary'
elif code == uint8: type='uint8'
elif code == uint16: type='uint16'
elif code == int32: type='int32'
else:
assert 0,'Does not accept this typecode: %s' % code
return type | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def type(self):\n return _image.image_type(self)",
"def datatype(self):\n # datatype is type of first dataarg\n return self[self.dataargs()[0]].typename",
"def get_type(ext):\n if ext.lower() in Asset.SUPPORTED_IMAGE_EXT['in']:\n return 'image'\n return 'file'",
... | [
"0.67190295",
"0.6381499",
"0.6355308",
"0.63472396",
"0.6280797",
"0.62741345",
"0.62738174",
"0.6248322",
"0.6243908",
"0.6219995",
"0.6206686",
"0.62040204",
"0.6195294",
"0.618702",
"0.6184788",
"0.6156099",
"0.6140352",
"0.6133268",
"0.61196274",
"0.61147815",
"0.6099795... | 0.71634406 | 0 |
Purpose Addition for dilation Synopsis a = add4dilate(f, c) Input | def add4dilate(f, c):
from numpy import asarray, minimum, maximum
if c:
y = asarray(f,'d') + c
k1,k2 = limits(f)
y = ((f==k1) * k1) + ((f!=k1) * y)
y = maximum(minimum(y,k2),k1)
a = y.astype(f.dtype)
else:
a = f
return a | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def dilate(X, d):\n\tn_ex, in_rows, in_cols, n_in = X.shape\n\tr_ix = np.repeat(np.arange(1, in_rows), d)\n\tc_ix = np.repeat(np.arange(1, in_cols), d)\n\tXd = np.insert(X, r_ix, 0, axis=1)\n\tXd = np.insert(Xd, c_ix, 0, axis=2)\n\treturn Xd",
"def dilate(f, b=None):\n from numpy import maximum, newaxis, ones... | [
"0.632937",
"0.6050472",
"0.59794503",
"0.5879187",
"0.56523824",
"0.5638528",
"0.56279993",
"0.5498008",
"0.546024",
"0.5393945",
"0.5389911",
"0.5362089",
"0.53117913",
"0.52866775",
"0.52795684",
"0.5279348",
"0.52731365",
"0.52052736",
"0.5153316",
"0.5132702",
"0.5108176... | 0.75624835 | 0 |
Purpose Converts image representation from matrix to set Synopsis CV = mat2set(A) Input | def mat2set(A):
from numpy import take, ravel, nonzero, transpose, newaxis
if len(A.shape) == 1: A = A[newaxis,:]
offsets = nonzero(ravel(A) - limits(A)[0])[0]
if len(offsets) == 0: return ([],[])
(h,w) = A.shape
x = [0,1]
x[0] = offsets//w - (h-1)//2
x[1] = offsets%w - (w-1)//2
x =... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set2mat(A):\n from numpy import put, ones, ravel, shape, newaxis, array, asarray, max, int32\n\n if len(A) == 2: \n x, v = A\n v = asarray(v)\n elif len(A) == 1:\n x = A[0]\n v = ones((len(x),), '1')\n else:\n raise TypeError, 'Argument must be a tuple ... | [
"0.5648504",
"0.55084527",
"0.5481719",
"0.51717937",
"0.5141645",
"0.49975014",
"0.4989248",
"0.49250114",
"0.48898375",
"0.48263064",
"0.47825715",
"0.47778195",
"0.47695413",
"0.4768827",
"0.47392964",
"0.47098663",
"0.4697833",
"0.46659982",
"0.46650678",
"0.4657821",
"0.... | 0.7775066 | 0 |
Purpose Converts image representation from set to matrix Synopsis M = set2mat(A) Input | def set2mat(A):
from numpy import put, ones, ravel, shape, newaxis, array, asarray, max, int32
if len(A) == 2:
x, v = A
v = asarray(v)
elif len(A) == 1:
x = A[0]
v = ones((len(x),), '1')
else:
raise TypeError, 'Argument must be a tuple of length 1 or ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def mat2set(A):\n from numpy import take, ravel, nonzero, transpose, newaxis\n\n if len(A.shape) == 1: A = A[newaxis,:]\n offsets = nonzero(ravel(A) - limits(A)[0])[0]\n if len(offsets) == 0: return ([],[])\n (h,w) = A.shape\n x = [0,1]\n x[0] = offsets//w - (h-1)//2\n x[1] = offsets%w - (w... | [
"0.6750568",
"0.5758029",
"0.5751836",
"0.5694696",
"0.56332994",
"0.5624198",
"0.5568922",
"0.5507948",
"0.5466626",
"0.54402024",
"0.54195136",
"0.5419218",
"0.53453505",
"0.53342026",
"0.5261797",
"0.5153861",
"0.51083034",
"0.5081621",
"0.50552106",
"0.50464743",
"0.50392... | 0.6789224 | 0 |
Purpose pad4n Synopsis y = pad4n(f, Bc, value, scale=1) Input | def pad4n(f, Bc, value, scale=1):
from numpy import ones, array
if type(Bc) is not array:
Bc = seshow(Bc)
Bh, Bw = Bc.shape
assert Bh%2 and Bw%2, 'structuring element must be odd sized'
ch, cw = scale * Bh/2, scale * Bw/2
g = value * ones( f.shape + scale * (array(Bc.shape) - ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def pad(input, pad, mode='constant', value=0):\n ndim = input.ndimension()\n pads_begin, pads_end = [0] * ndim, [0] * ndim\n for i in range(len(pad) // 2):\n pads_begin[ndim - 1 - i] = pad[i * 2]\n pads_end[ndim - 1 - i] = pad[i * 2 + 1]\n mode = {'constant': 'CONSTANT', 'reflect': 'REFLE... | [
"0.56802464",
"0.5659314",
"0.5468594",
"0.5427896",
"0.5400711",
"0.538203",
"0.53417796",
"0.533917",
"0.5328665",
"0.52524555",
"0.5239022",
"0.52284884",
"0.5216303",
"0.521083",
"0.5187389",
"0.5186164",
"0.505682",
"0.50010294",
"0.5000885",
"0.49870047",
"0.49828497",
... | 0.8421886 | 0 |
Purpose Plot a function. Synopsis fig = plot(plotitems=[], options=[], outfig=1, filename=None) Input | def plot(plotitems=[], options=[], outfig=-1, filename=None):
import matplotlib
import numpy
newfig = 0
if (plotitems == 'reset'):
__figs__[0] = None
__figs__[1:] = []
return 0
if len(plotitems) == 0:
# no plotitems specified: replot current figure
if __figs_... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def plot():\n pass",
"def plot(f):\n def wrapper(*args, **kwargs):\n logging.info('generating plot: %s', f.__name__)\n f(*args, **kwargs)\n\n fig = plt.gcf()\n\n plotfile = plotdir / '{}.png'.format(f.__name__)\n fig.savefig(str(plotfile))\n logging.info('wrote %s'... | [
"0.71241796",
"0.6713857",
"0.6663773",
"0.6600178",
"0.6366286",
"0.6234586",
"0.62165636",
"0.6182572",
"0.6152466",
"0.6080931",
"0.6066255",
"0.6015024",
"0.6008642",
"0.58418113",
"0.5825319",
"0.58237404",
"0.5818448",
"0.5813623",
"0.58062226",
"0.57927936",
"0.579054"... | 0.7255891 | 0 |
Finds face areas of Voronoi tesselation | def _get_vp_facearea(self, geom):
if geom.vp is None:
geom.voronoi(self.pbc, self.ratio)
f = geom.vp.vp_faces()
# TODO: Remove small VP faces (may be check pyvoro?)
# if rm_small:
# fa = self.vp.vp_face_area(f)
# f = self.vp.remove_small_faces(f, fa, e... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def calcFaceAreas(x,y,z):\n (nLonP1, nLatP1) = x.shape\n (nLon, nLat) = (nLonP1-1, nLatP1-1)\n\n area = numpy.zeros((nLon, nLat))\n\n for i in range(nLon):\n for j in range(nLat):\n left = distance( (x[i,j], y[i,j], z[i,j]), (x[i,j+1], y[i,j+1], z[i,j+1]) )\n right = distance( (x[i+1,j]... | [
"0.653391",
"0.6363107",
"0.627556",
"0.62113065",
"0.6028761",
"0.59491664",
"0.59409654",
"0.59152246",
"0.5914819",
"0.5905486",
"0.58764136",
"0.5859007",
"0.5853216",
"0.58425134",
"0.5839668",
"0.5786964",
"0.5757693",
"0.5732532",
"0.5720663",
"0.57141674",
"0.57108384... | 0.64256096 | 1 |
Computes the averaged impact across all quantiles for each feature | def averaged_impact(impact, normalize=True):
impact = pandas.DataFrame(impact)
average = pandas.Series(index=impact.columns, dtype=float)
for col in impact:
average[col] = impact[col].mean()
if normalize:
average /= average.sum()
return average | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def compute_impact(self, estimator, X, method='predict'):\n if self._quantiles is None:\n raise FeatureImpactError(\"make_quantiles() must be called first \"\n \"or the quantiles explicitly assigned\")\n if not hasattr(estimator, method):\n ra... | [
"0.65723354",
"0.5805368",
"0.5776619",
"0.570785",
"0.5693117",
"0.5666401",
"0.5637227",
"0.5636791",
"0.55789346",
"0.55769795",
"0.5576095",
"0.55592984",
"0.5559237",
"0.5506541",
"0.5490532",
"0.5481439",
"0.5476015",
"0.54598427",
"0.5455255",
"0.5449621",
"0.54449636"... | 0.656045 | 1 |
The quantiles corresponding to the features | def quantiles(self):
return self._quantiles | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def quantiles(self, q: int):\n return self.dist.quantiles(q)",
"def quantile(feature, bins):\n t = feature.sort_values().values\n w = round(len(t)/bins)\n return [t[w*i-1] for i in range(1, bins)]",
"def quantile(self, hypercube):\n raise NotImplementedError()",
"def test_profiled_quan... | [
"0.7665638",
"0.76528394",
"0.71875024",
"0.70389974",
"0.70126265",
"0.69704837",
"0.69322085",
"0.6846064",
"0.6841902",
"0.68319213",
"0.67076045",
"0.6676857",
"0.6661948",
"0.6650516",
"0.66478264",
"0.66478264",
"0.66478264",
"0.6621563",
"0.6536564",
"0.6535335",
"0.65... | 0.8084947 | 0 |
Generates the quantiles for each feature in X. The quantiles for one feature are computed such that the area between quantiles is the same throughout. The default quantiles are computed at the following | def make_quantiles(self, X, n_quantiles=9):
if n_quantiles < 1:
raise FeatureImpactError("n_quantiles must be at least one.")
X = pandas.DataFrame(X)
probs = numpy.linspace(0.0, 1.0, n_quantiles + 2)[1:-1]
self._quantiles = pandas.DataFrame(dtype=float)
for col in X:
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def quantiles(x, qlist=[2.5, 25, 50, 75, 97.5]):\n # Make a copy of trace\n x = x.copy()\n\n # For multivariate node\n if x.ndim > 1:\n # Transpose first, then sort, then transpose back\n sx = np.transpose(np.sort(np.transpose(x)))\n else:\n # Sort univariate node\n sx = ... | [
"0.70554554",
"0.6961914",
"0.6935193",
"0.68663985",
"0.6722963",
"0.6685941",
"0.65833944",
"0.65438044",
"0.6502006",
"0.6346135",
"0.6340859",
"0.6323469",
"0.63208634",
"0.6201339",
"0.61836976",
"0.61179936",
"0.61027896",
"0.61023414",
"0.6099939",
"0.60567063",
"0.604... | 0.69860053 | 1 |
Creates overlay with x_batch and mask_batch. Plots this into a figure, which is saved as a PNG file. | def save_as_fig(x_batch,
y_batch,
features_batch,
classes=None,
figname=None):
try:
nrows = 2
ncols = x_batch.shape[0]
figsize = (ncols, nrows) # (width, height)
fig, ax = plt.subplot... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def visualize_augmentation(X, y):\n n_samples = 10\n n_augmentations = 9\n Xbatches = DataFlow(X, y, 64)\n indices = Xbatches.indices[:n_samples]\n X_samples = X[indices]\n y_samples = y[indices]\n X_augmented = X_samples / 127.5 - 1.0\n for i in range(n_augmentations):\n x, _ = Xba... | [
"0.5980679",
"0.59785324",
"0.5818402",
"0.5818402",
"0.5781979",
"0.57677567",
"0.56843996",
"0.56303054",
"0.5610144",
"0.55972713",
"0.5480363",
"0.5475642",
"0.5459204",
"0.5441421",
"0.54376066",
"0.5428869",
"0.54168534",
"0.54026365",
"0.540043",
"0.53644663",
"0.53435... | 0.6120618 | 0 |
Predict the class of a point by using the knearest neighbor algorithm on the points of a dataframe. | def k_nn(frame, newPoint, colClass, k):
counts = []
# find all distances wrt the newPoint
dist = find_distances(frame, newPoint)
# find the nearest k points, extract their labels and save them in a list
labels = [label for distance,label in dist[:k]]
# for each class ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def nearest_neighbors_classifier(data):\n clf = KNeighborsClassifier(3, 'distance')\n clf.name = \"KNN\"\n train_predict_and_results(data, clf)",
"def knn_classification(x_test, df_training, attrib_column, k):\n return majority_vote(k_nearest_neighbors(x_test, df_training,k),df,attrib_column)",
"de... | [
"0.7069084",
"0.7037503",
"0.70101947",
"0.70004886",
"0.68263245",
"0.6732916",
"0.67243654",
"0.6711963",
"0.67113394",
"0.65996575",
"0.65978515",
"0.65827733",
"0.6528753",
"0.6506104",
"0.64556736",
"0.6389513",
"0.63801205",
"0.63324386",
"0.6315914",
"0.630624",
"0.628... | 0.74986935 | 0 |
Plot the frame with different label based on the string colorMap. | def colored_plot_pairs(frame, pairs, colorMap):
for i in range(len(pairs)):
x_label = pairs[i][0]
y_label = pairs[i][1]
for pattern in frame[colorMap].unique():
mask = (frame[colorMap] == pattern)
points = frame[mask]
x = points[x_label... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def plot_labels(lbl: scipy.ndarray, lbl_count: int) -> None:\n color_map = scipy.rand(lbl_count, 3)\n color_map = matplotlib.colors.ListedColormap(color_map)\n plt.imshow(lbl, cmap=color_map)\n plt.show()",
"def plot_colour(self, label):\n label = label.lower()\n pretty_colours = {}\n ... | [
"0.6639459",
"0.64076805",
"0.6137895",
"0.5981575",
"0.59255105",
"0.5884149",
"0.58813006",
"0.5815308",
"0.5789375",
"0.5751018",
"0.57497954",
"0.5738141",
"0.57178783",
"0.5714259",
"0.57056075",
"0.5693476",
"0.56923354",
"0.5682452",
"0.5679864",
"0.5661717",
"0.566109... | 0.7052949 | 0 |
Asigna roles de sistema a un usuario | def asignar_roles_sistema(request, usuario_id):
user = User.objects.get(username=request.user.username)
permisos = get_permisos_sistema(user)
usuario = get_object_or_404(User, id=usuario_id)
lista_roles = UsuarioRolSistema.objects.filter(usuario = usuario)
lista_permisos = RolPermiso.objects.filter(... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def admin_roles(request):\n user = User.objects.get(username=request.user.username)\n permisos = get_permisos_sistema(user)\n return render_to_response('admin/roles/roles.html',{'user':user,\n 'ver_roles':'Ver roles' in permisos,\n ... | [
"0.6243566",
"0.62145305",
"0.6162099",
"0.6108751",
"0.6046212",
"0.603192",
"0.60155725",
"0.59895617",
"0.5948144",
"0.59390855",
"0.59052676",
"0.59005255",
"0.5899944",
"0.58443844",
"0.58370525",
"0.5822423",
"0.58218026",
"0.58165574",
"0.58123285",
"0.57895297",
"0.57... | 0.6547618 | 0 |
Administracion general de roles | def admin_roles(request):
user = User.objects.get(username=request.user.username)
permisos = get_permisos_sistema(user)
return render_to_response('admin/roles/roles.html',{'user':user,
'ver_roles':'Ver roles' in permisos,
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def getRoles(self):",
"def manage_roles(_) -> int:\n return 1 << 28",
"def manage_roles(_) -> int:\n return 1 << 28",
"def role_command():",
"async def roles(self, ctx):\n\n pass",
"def get_roles():\r\n global _roles\r\n return _roles",
"def get_roles(role):",
"def test_lis... | [
"0.73631227",
"0.6999907",
"0.6999907",
"0.6967457",
"0.694598",
"0.6901707",
"0.6881969",
"0.6686965",
"0.66254485",
"0.66218156",
"0.6591556",
"0.65802133",
"0.6524354",
"0.6487158",
"0.64723384",
"0.6423434",
"0.6405185",
"0.6389672",
"0.6383682",
"0.6381005",
"0.6321508",... | 0.76791155 | 0 |
Muestra una pagina de confirmacion de exito | def terminar(peticion):
return render_to_response('operacion_exitosa.html'); | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _exit_exam(self):\n self.finger.back()\n self._goto(\"exit_exam\")\n self.finger.back()",
"def confirm_exit(self):\n return True",
"def do_quit(self, arg):\n cprint(('Thankyou for Using this todo Application!'), 'yellow')\n exit()",
"def exit(self):\n pass",... | [
"0.64773333",
"0.6395815",
"0.638707",
"0.63821304",
"0.63361096",
"0.62966603",
"0.6276467",
"0.6236315",
"0.623418",
"0.62100536",
"0.6202052",
"0.6177375",
"0.6140706",
"0.61195123",
"0.6105385",
"0.60974085",
"0.60958296",
"0.6091233",
"0.6083538",
"0.6068577",
"0.6061314... | 0.6845377 | 0 |
This function compares two RMG models and returns a list of common reactions as a dictionary, as well as a list of unique reactions for each model. | def compareModelReactions(model1, model2):
reactionList1 = model1.reactions[:]
reactionList2 = model2.reactions[:]
# remove reactions that have an unidentified species
to_remove = []
for reactionList in (reactionList1, reactionList2):
for reaction in reactionList:
for side i... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def compare_models(model1, model2):\n # at minimum, numbers of species and reactions should be the same\n if model1.n_species != model2.n_species:\n return False\n if model1.n_reactions != model2.n_reactions:\n return False\n\n for sp1, sp2 in zip(\n sorted(model1.species(), key=at... | [
"0.6585713",
"0.599063",
"0.5804649",
"0.5600738",
"0.5600162",
"0.5508105",
"0.54978204",
"0.54804873",
"0.5471653",
"0.5394088",
"0.5368724",
"0.53511035",
"0.51991004",
"0.51885515",
"0.51838666",
"0.51524454",
"0.5150569",
"0.5113208",
"0.5103385",
"0.5102723",
"0.5096432... | 0.8067344 | 0 |
Saves a model comparison HTML file based on two sets of chemkin and species dictionary files. | def saveCompareHTML(outputDir,chemkinPath1,speciesDictPath1,chemkinPath2,speciesDictPath2,readComments1=True,readComments2=True):
model1 = ReactionModel()
model1.species, model1.reactions = loadChemkinFile(chemkinPath1, speciesDictPath1, readComments = readComments1)
model2 = ReactionModel()
model2.spec... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def compareModels(request):\n diff = Diff()\n path = ''\n diff.deleteDir()\n\n if request.method == 'POST':\n diff.createDir()\n form = ModelCompareForm(request.POST, request.FILES, instance=diff)\n if form.is_valid():\n form.save()\n path = 'media/rmg/tools/c... | [
"0.59577495",
"0.5926005",
"0.573186",
"0.5727659",
"0.5696745",
"0.5624252",
"0.5504704",
"0.53998256",
"0.5378695",
"0.53785723",
"0.53564465",
"0.53094345",
"0.5289141",
"0.5286453",
"0.52835685",
"0.52722",
"0.52715427",
"0.5252483",
"0.52491575",
"0.52423245",
"0.5229179... | 0.7638288 | 0 |
Returns the enthalpy discrepancy between the same species in the two models | def enthalpyDiff(species):
thermo0 = species[0].thermo
thermo1 = species[1].thermo
if thermo0 and thermo1:
diff = species[0].thermo.discrepancy(species[1].thermo)
else:
diff = 99999999
return -1*diff | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def compareModelSpecies(model1, model2):\n\n commonSpecies = []\n uniqueSpecies1 = model1.species[:]\n uniqueSpecies2 = []\n \n for spec2 in model2.species:\n for spec1 in uniqueSpecies1[:]: # make a copy so you don't remove from the list you are iterating over\n if spec1.isIsomorp... | [
"0.65986085",
"0.65539795",
"0.6325017",
"0.58686215",
"0.57990116",
"0.57415426",
"0.57351303",
"0.5731766",
"0.5710188",
"0.56903064",
"0.56880873",
"0.5621557",
"0.5507705",
"0.5495699",
"0.54794365",
"0.54687446",
"0.5458123",
"0.5458123",
"0.5445323",
"0.54087037",
"0.53... | 0.6847657 | 0 |
Returns some measure of the discrepancy between two reactions in a model | def kineticsDiff(reaction):
kinetics0 = reaction[0].kinetics
kinetics1 = reaction[1].kinetics
if kinetics0 and kinetics1:
diff = reaction[0].kinetics.discrepancy(reaction[1].kinetics)
else:
diff = 9999999
return -1*diff | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def discrepancy(self):\n result = 0\n for focal, value in self.items():\n if focal.cardinal > 0:\n result -= value * math.log(self.betP(focal), 2)\n return round(result, 6)",
"def compareModelReactions(model1, model2):\n reactionList1 = model1.reactions[:]\n r... | [
"0.69190264",
"0.65132487",
"0.64299",
"0.5997757",
"0.59676397",
"0.590223",
"0.589551",
"0.5843382",
"0.5829309",
"0.5807735",
"0.5803185",
"0.5734845",
"0.56563556",
"0.56349826",
"0.5601114",
"0.5600864",
"0.5482544",
"0.5457472",
"0.5454299",
"0.54442346",
"0.5431001",
... | 0.70198035 | 0 |
get_engine() Get the search engine object of the Bing key | def get_engine(key):
return SearchEngine(key) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _get_search_provider(self, engine, api_key):\n\n if engine not in SearchProxy._engines:\n raise KeyError(\"No such engine found: \" + engine)\n\n # Use caching\n return SearchProxy._engines[engine](api_key)",
"def _get_search_engine(self):\n engine = self._search_config... | [
"0.7264146",
"0.66455466",
"0.6595155",
"0.6470766",
"0.64188844",
"0.63174134",
"0.6115965",
"0.6054404",
"0.5987662",
"0.59381175",
"0.58600116",
"0.58540565",
"0.5765756",
"0.5765756",
"0.57537675",
"0.5700451",
"0.5633768",
"0.55607945",
"0.5555633",
"0.54868114",
"0.5486... | 0.818207 | 0 |
format_query([, option={'url', 'file'}]) Format a query string formed from the query list | def format_query(query, option=''):
q_tmp = []
for s in query:
if option != 'url' or s.isalnum():
q_tmp.append(s)
else:
q_tmp.append('\"' + s.lower() + '\"')
if option == 'file':
sep = '_'
else:
sep = ' '
q = sep.join(q_tmp)
if option == '... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def query_options_to_url(self):\n return '&'.join(['$%s=%s' % (key, value) for (key, value) in self.query_options.items()])",
"def format_query(query):\n query = query.encode('utf-8')\n # all queries must start with 'c '!\n if not query.startswith('c '):\n query = 'c ' + query.strip()\n ... | [
"0.637468",
"0.63276315",
"0.60940194",
"0.6046103",
"0.5794506",
"0.57733756",
"0.57283187",
"0.57235926",
"0.56933373",
"0.56021154",
"0.55844563",
"0.5575377",
"0.55499744",
"0.54952496",
"0.54331154",
"0.5416671",
"0.5403305",
"0.5402847",
"0.5379728",
"0.53782284",
"0.53... | 0.84541553 | 0 |
set_key() Set the new Bing key to the search engine | def set_key(self, key):
self.key = key | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update_key(self, key):\n self._api_key = key",
"async def apikey_bing(self, ctx, key):\n settings = loadauth()\n settings['apikey'] = key\n saveauth(settings)\n return await self.bot.say(\"Bing API key saved.\")",
"def key(self, key):\n self._key = key",
"def key... | [
"0.68582433",
"0.67516553",
"0.66810936",
"0.66810936",
"0.6636144",
"0.6636144",
"0.6580474",
"0.6580474",
"0.65038407",
"0.64616615",
"0.6453623",
"0.6404311",
"0.6386789",
"0.6386789",
"0.6346212",
"0.63419825",
"0.62960887",
"0.62886304",
"0.61726725",
"0.61578023",
"0.61... | 0.72055596 | 0 |
search([, test=]) Use Bing to search for results with a query list test can be assigned with a previous result XML file for testing A XML object will be returned as result | def search(self, query, test=None):
if self.key == None:
print 'Error: There is no key'
return None
# Form the overall query URL
bing_url = 'https://api.datamarket.azure.com/Bing/Search/Web?Query='
search_option = '&$top=10&$format=Atom'
query = format_que... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def search(self, query):",
"def search(query_string):",
"def test_service_item_search(self):\n\n flag = \"user\"\n api = \"service.item.editsn\"\n #current_page = 1\n search_info = json.dumps({\n })\n sn_pre = '730300010036664'#'730300010034444'\n sn_after = '73... | [
"0.7067904",
"0.6937386",
"0.68910635",
"0.6699398",
"0.6679109",
"0.6659663",
"0.64970815",
"0.6473768",
"0.6470208",
"0.6470208",
"0.6470208",
"0.64000803",
"0.6350433",
"0.63322896",
"0.6317919",
"0.6307538",
"0.63036454",
"0.6294815",
"0.62760216",
"0.6274393",
"0.6263065... | 0.79605925 | 0 |
Favorite a character's quote | def favorite_character_quote(self, request, **kwargs):
serialized_data = FavoriteCharacterQuoteSerializer(
data={
"character_id": kwargs["character_id"],
"quote_id": kwargs["quote_id"],
},
context={"user": request.user},
)
if n... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def random_quote():\n quotes = [\n \"Growth is never by mere chance; it is the result of forces working together.\\n-James Cash Penney\",\n \"We cannot accomplish all that we need to do without working together\\n-Bill Richardson\",\n \"The power of one, if fearless and focused, is formidab... | [
"0.5758048",
"0.573653",
"0.5660546",
"0.56215745",
"0.55821496",
"0.55821043",
"0.55081457",
"0.54761726",
"0.5407176",
"0.5402307",
"0.5395603",
"0.5366124",
"0.5352576",
"0.53381526",
"0.52216214",
"0.52212644",
"0.52129316",
"0.5196205",
"0.5195594",
"0.5180084",
"0.51617... | 0.5964734 | 0 |
retrieve an image from mongodb gridfs | def getImage(filename):
if not fs.exists(filename=filename):
raise Exception("mongo file does not exist! {0}".format(filename))
im_stream = fs.get_last_version(filename)
im = Image.open(im_stream)
img_io = BytesIO()
im.save(img_io, 'JPEG', quality=70)
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_image(id_num):\n return sqldb.get_image(id_num)",
"def get_image(name):\r\n return nova.images.find(name=name)",
"def get_image_information(client):\n\n pipeline = [{\"$match\": {\"camera_views\": {\"$exists\": 1}}}, {\"$unwind\": {\"path\": \"$camera_views\"}}, {\"$addFields\": {\n \"c... | [
"0.69063425",
"0.6529986",
"0.6264723",
"0.6255379",
"0.6162864",
"0.6158136",
"0.6151979",
"0.6096529",
"0.6052046",
"0.60278034",
"0.595986",
"0.59472406",
"0.59261215",
"0.5925817",
"0.59070826",
"0.59031063",
"0.59011316",
"0.5889268",
"0.58828276",
"0.5870207",
"0.586516... | 0.77841043 | 0 |
Drop the maximum dose and related response values. | def drop_dose(self):
for fld in ("doses", "ns", "means", "stdevs"):
arr = getattr(self, fld)[:-1]
setattr(self, fld, arr)
self._validate() | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def drop_dose(self):\n individual_doses = np.array(self.individual_doses)\n responses = np.array(self.responses)\n\n mask = individual_doses != individual_doses.max()\n doses = individual_doses[mask].tolist()\n responses = responses[mask].tolist()\n\n summary_data = self._... | [
"0.7200658",
"0.62198234",
"0.5772812",
"0.5744219",
"0.56280816",
"0.55736995",
"0.5513809",
"0.54918855",
"0.54886866",
"0.54837",
"0.5429068",
"0.5419061",
"0.53948057",
"0.53888166",
"0.53503466",
"0.5337019",
"0.53281724",
"0.5226603",
"0.5226471",
"0.5201941",
"0.519972... | 0.64605606 | 1 |
Drop the maximum dose and related response values. | def drop_dose(self):
individual_doses = np.array(self.individual_doses)
responses = np.array(self.responses)
mask = individual_doses != individual_doses.max()
doses = individual_doses[mask].tolist()
responses = responses[mask].tolist()
summary_data = self._prepare_summa... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def drop_dose(self):\n for fld in (\"doses\", \"ns\", \"means\", \"stdevs\"):\n arr = getattr(self, fld)[:-1]\n setattr(self, fld, arr)\n self._validate()",
"def del_max(self):\r\n maxVal = self.find_max()\r\n if maxVal is not None:\r\n self.items[1] =... | [
"0.64582723",
"0.622028",
"0.5770182",
"0.5745489",
"0.5629807",
"0.5575314",
"0.5513428",
"0.5490371",
"0.54876935",
"0.5482849",
"0.543109",
"0.54207766",
"0.5394414",
"0.53877926",
"0.5351516",
"0.53369254",
"0.5329014",
"0.52281237",
"0.5226602",
"0.5202013",
"0.5201195",... | 0.7198417 | 0 |
Return a matplotlib figure of the doseresponse dataset. Examples >>> fig = dataset.plot() >>> fig.show() >>> fig.clear() | def plot(self) -> Figure:
ax = self.setup_plot()
ax.scatter(
self.individual_doses,
self.responses,
label="Data",
**plotting.DATASET_INDIVIDUAL_FORMAT,
)
ax.legend(**plotting.LEGEND_OPTS)
return ax.get_figure() | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def plot(data, interactive=False):\n if interactive:\n plt.ion()\n fig = plt.figure()\n fig.canvas.draw()\n image = call_imshow(data)\n else:\n fig = plt.figure()\n image = call_imshow(data)\n plt.show()\n return fig, image",
"def show_plot(self):\r\n\t\t... | [
"0.67712677",
"0.67145866",
"0.66705936",
"0.65010726",
"0.6476628",
"0.6472557",
"0.6450934",
"0.6450934",
"0.6450934",
"0.6422469",
"0.6392864",
"0.6350136",
"0.628649",
"0.6260816",
"0.6252041",
"0.62455577",
"0.62426764",
"0.6218855",
"0.62060815",
"0.61938506",
"0.618557... | 0.72564083 | 0 |
Attempt to locate MinGWw64 DLL directory (on Windows). This is intended to be used to add to a DLL search path. Does so by searching for ``libgfortran.dll``. This assumes the DLL is in the same directory as ``gfortran.exe`` based on the MinGWw64 layout (as of 20230730). | def _get_mingw_dll_dir():
gfortran_exe = shutil.which("gfortran")
if gfortran_exe is None:
return None
gfortran_exe = pathlib.Path(gfortran_exe)
bin_dir = gfortran_exe.resolve().parent
matches = list(bin_dir.glob("libgfortran*.dll"))
if len(matches) == 0:
return None
return... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def windows_dll_path_setup():\n global WINDOWS_PATH_SET\n if IS_WINDOWS and not WINDOWS_PATH_SET:\n try:\n out = subprocess.run(\n [\"where.exe\", \"tbb.dll\"], check=True, capture_output=True\n )\n tbb_path = os.path.dirname(out.stdout.decode().splitlin... | [
"0.6432864",
"0.5823498",
"0.5537997",
"0.54087585",
"0.53260607",
"0.5270546",
"0.51272947",
"0.500292",
"0.49681714",
"0.4951452",
"0.4937564",
"0.49153715",
"0.48663104",
"0.4832874",
"0.4818648",
"0.47737756",
"0.47437903",
"0.47352841",
"0.4660829",
"0.46443507",
"0.4629... | 0.83702564 | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.