query stringlengths 10 2k | document stringlengths 20 51.2k | metadata dict | negatives listlengths 0 101 | negative_scores listlengths 0 101 | document_score stringlengths 3 10 | document_rank stringclasses 102
values |
|---|---|---|---|---|---|---|
Check behaviour of view_all_categories if no category exists. We should not get any errors | def test_view_all_categories_without_any_records(self):
self.client.login(username='hodor', password='hodor')
Perms.objects.create(user=self.user, access_level=2).save()
Category.objects.all().delete()
response = self.client.get('/categories/')
self.assertEqual(response.status_co... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_no_categorys(self):\n response = self.client.get(reverse('closetclient:index'))\n self.assertEqual(response.status_code, 200)\n self.assertContains(response, \"No Categorys are available.\")\n self.assertQuerysetEqual(response.context['latest_category_list'], [])",
"def _veri... | [
"0.77666897",
"0.7501498",
"0.7445073",
"0.73836553",
"0.7130899",
"0.6778781",
"0.6734663",
"0.6679412",
"0.66671926",
"0.6444569",
"0.64389026",
"0.6423348",
"0.6385631",
"0.63782746",
"0.6318286",
"0.62828165",
"0.6267523",
"0.6264924",
"0.62387925",
"0.6234147",
"0.622098... | 0.6971685 | 5 |
Return the name of the component. | def name(self):
return self._name | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_component_name(self):\n return self._name",
"def get_name(self):\n return COMPONENT_LIST[self.index][0]",
"def getComponentName(self):\n if self.componentName:\n return self.componentName\n else:\n raise Warning(\"No component name has been currently de... | [
"0.91371554",
"0.8698335",
"0.85936517",
"0.8376385",
"0.8376385",
"0.75839764",
"0.7580546",
"0.7580546",
"0.7580546",
"0.75484234",
"0.75484234",
"0.75484234",
"0.75484234",
"0.7544465",
"0.7531962",
"0.747979",
"0.7463664",
"0.74601024",
"0.74586856",
"0.7458095",
"0.74430... | 0.0 | -1 |
Return the type of the component. | def type(self):
return None | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def component_type(self):\n return self._component_type",
"def component_type(self) -> ComponentType:\n return self.configuration.component_type",
"def type(self):\n return self.container['type']",
"def type(self):\n return self.container['type']",
"def get_type(self):\n ... | [
"0.8959532",
"0.8686335",
"0.7777388",
"0.7777388",
"0.7660598",
"0.7660598",
"0.7613113",
"0.7593781",
"0.7593781",
"0.75596756",
"0.75567967",
"0.75511634",
"0.7525565",
"0.75236934",
"0.7496737",
"0.7488863",
"0.74818015",
"0.74776536",
"0.7474762",
"0.7474762",
"0.7474762... | 0.0 | -1 |
Return the max score of the external activity. Also called by courseware.grades.get_score function. | def max_score(self):
return self.points | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def max_score(self):\r\n return self.lcp.get_max_score()",
"def max_score(self):\r\n max_score = None\r\n if self.check_if_done_and_scored():\r\n max_score = self._max_score\r\n return max_score",
"def max_score(self):\n return max(self._extract_set('score') or [0]... | [
"0.76258975",
"0.73420715",
"0.71733063",
"0.69574475",
"0.6939704",
"0.6736889",
"0.67094874",
"0.67093694",
"0.66632974",
"0.66603607",
"0.66297615",
"0.6612063",
"0.65175396",
"0.65156597",
"0.6509731",
"0.65008605",
"0.647493",
"0.64476365",
"0.6352829",
"0.6341534",
"0.6... | 0.7122568 | 3 |
Return an iterator for n values read from stdin | def readValues(n):
for i in xrange(n):
yield int(raw_input().strip()) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def read_input():\n f = open(INPUT_FILE, 'r')\n \n number_of_lines = int(f.readline())\n for i in range(number_of_lines):\n yield [i+1, f.readline().split()]\n f.close()",
"def readlines(self, n = None):\n\t\tif not self._input: raise PlumberExceptions.PipeTypeException(self)\n\t\tresult = ... | [
"0.70085996",
"0.69129467",
"0.6558335",
"0.63903594",
"0.6183207",
"0.6130468",
"0.6129349",
"0.6078857",
"0.6024505",
"0.6015382",
"0.5960974",
"0.5921466",
"0.58719397",
"0.58542323",
"0.5843615",
"0.5838862",
"0.5816557",
"0.58084816",
"0.5800977",
"0.579929",
"0.5766893"... | 0.7974478 | 0 |
Compute ranges for x and y axes of the plot. Make sure that the ranges for x and yaxes are | def _compute_equal_axes_ranges(x_min, x_max, y_min, y_max):
x_axis_min, x_axis_max, y_axis_min, y_axis_max = x_min, x_max, y_min, y_max
x_range, y_range = abs(x_max - x_min), abs(y_max - y_min)
if x_range > y_range:
y_center = (y_max + y_min) / 2
y_ax... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _axes_domain(self, *args, **kwargs):\n # See _add_gridline_label for detials\n lon_0 = self.axes.projection.proj4_params.get('lon_0', 0)\n x_range, y_range = type(self)._axes_domain(self, *args, **kwargs)\n x_range = np.asarray(x_range) + lon_0\n return x_range, y_range",
"def compute_axes(sel... | [
"0.7668413",
"0.7588332",
"0.6826602",
"0.67001593",
"0.6668948",
"0.6553018",
"0.6468367",
"0.64180905",
"0.6371516",
"0.63218063",
"0.6316232",
"0.63160247",
"0.6247077",
"0.6185481",
"0.61751956",
"0.6082733",
"0.6076485",
"0.6050816",
"0.60503405",
"0.6037247",
"0.6019884... | 0.7637142 | 1 |
Create 3D array for rgb image. | def make_cube(r, g, b):
if r is None and g is None and b is None:
logger.error("'make_cube': 'r', 'g' and 'b' input arrays are all None")
R, G, B, RGB = None
else:
for arr in [r, g, b]:
if arr is not None:
ny, nx = arr.shape
break
R =... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def load_rgb_image_as_3d_array(filename):\n image = np.asarray(Image.open(filename))\n image_shape = image.shape\n image_dim = len(image_shape)\n assert(image_dim == 2 or image_dim == 3)\n if(image_dim == 2):\n image = np.expand_dims(image, axis = 0)\n else:\n # transpose rgb imag... | [
"0.741688",
"0.6642165",
"0.6636302",
"0.6581668",
"0.65347934",
"0.64957666",
"0.64123946",
"0.63724655",
"0.6344529",
"0.6341446",
"0.63170564",
"0.6267427",
"0.61441535",
"0.6131804",
"0.6129639",
"0.61043936",
"0.6077907",
"0.6073759",
"0.6043462",
"0.5968481",
"0.5963114... | 0.0 | -1 |
r""" Helper function for projecting global features to RKHS. | def _project_global(self, global_feat):
global_feat_sc = self.global_nrkhs_sc(global_feat)
global_feat = self.global_nrkhs_a(global_feat)
global_feat = self.activation(global_feat)
global_feat = self.global_nrkhs_b(global_feat)
global_feat += global_feat_sc
return globa... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def project_features(self, local_feat, global_feat):\n local_feat = self._project_local(\n local_feat) # (N, C, H, W) --> (N, nrkhs, H, W)\n global_feat = self._project_global(\n global_feat) # (N, C) --> (N, nrkhs)\n\n return local_feat, global_feat",
"def JS_J_WINP_... | [
"0.5446056",
"0.5273819",
"0.5260508",
"0.52567494",
"0.5240935",
"0.52226657",
"0.5220418",
"0.52196336",
"0.5191914",
"0.5187935",
"0.51813114",
"0.51652265",
"0.5156152",
"0.5155798",
"0.5154486",
"0.5153735",
"0.5115062",
"0.51107174",
"0.5110631",
"0.5103962",
"0.5095758... | 0.608461 | 0 |
Initialize a MagnitudeMetric object. Note, all metrics should define an attribute called mapkeys which specifies the types of data that they expect. Arguments | def __init__(self, ministry, zbins=None, magbins=None,
catalog_type=None, tag=None, **kwargs):
if magbins is None:
magbins = np.linspace(-25,-15, 40)
self.magbins = magbins
self.aschema = 'galaxyonly'
self.unitmap = {'appmag':'mag', 'luminosity':'mag'}
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __init__(self, ministry, central_only=False, zbins=None, magbins=None,\n catalog_type=['galaxycatalog'], tag=None, CMASS=False,\n lightcone=True, **kwargs):\n\n if zbins is None:\n zbins = np.linspace(ministry.minz, ministry.maxz, 5)\n\n if magbins is No... | [
"0.6818694",
"0.651567",
"0.5869607",
"0.57156825",
"0.56756175",
"0.5649172",
"0.5643384",
"0.5634026",
"0.55834264",
"0.5519457",
"0.5516718",
"0.5466704",
"0.5450874",
"0.53789",
"0.5318448",
"0.52917504",
"0.5289632",
"0.5268562",
"0.5267883",
"0.5261546",
"0.5260227",
... | 0.61124706 | 2 |
Integrate the luminosity function between lmin and lmax at a particular redshift. | def integrate(self, lmin, lmax, z, band=1):
if not hasattr(self, 'lummean'):
self.magmean = np.array([(self.magbins[i]+self.magbins[i+1])/2
for i in range(len(self.magbins)-1)])
if not hasattr(self, 'zmean'):
self.zmean = np.array([(self.zbin... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def luminosity_function(abs_mag, redshift):\n\n # L/L_*(z) = 10**(0.4 * (M_*(z) - M))\n L_L_star = 10 ** (0.4 * (m_star(redshift) - abs_mag))\n\n # Phi*(z) = 10**(log(Phi*(z))\n phi_star = 10 ** log_phi_star(redshift) * (cosmo.h / u.Mpc) ** 3\n\n # QLF slopes\n alpha1 = -3.35 # alpha in Table 2\... | [
"0.6588533",
"0.6121012",
"0.595501",
"0.58470184",
"0.5795053",
"0.5641701",
"0.5562499",
"0.5562275",
"0.5544644",
"0.54601765",
"0.5423088",
"0.5398232",
"0.5366655",
"0.5360008",
"0.53222686",
"0.53155625",
"0.5252602",
"0.51516885",
"0.51399475",
"0.51354986",
"0.5126596... | 0.5827533 | 4 |
Calculate the great circle distance between two points in m on the earth (specified in decimal degrees) | def haversine(lon1, lat1, lon2, lat2):
# convert decimal degrees to radians
lon1, lat1, lon2, lat2 = list(map(radians, [lon1, lat1, lon2, lat2]))
# haversine formula
dlon = lon2 - lon1
dlat = lat2 - lat1
a = sin(dlat/2)**2 + cos(lat1) * cos(lat2) * sin(dlon/2)**2
c = 2 * asin(sqrt(a))
km... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def great_circle(lat_1, long_1, lat_2, long_2):\n long_1 = m.radians(long_1)\n lat_1 = m.radians(lat_1)\n long_2 = m.radians(long_2)\n lat_2 = m.radians(lat_2)\n\n d = 2 * 6367.45 * m.asin(\n m.sqrt(haversine(lat_2 - lat_1)\n + m.cos(lat_1)*m.cos(lat_2) *\n haversine(long... | [
"0.7906926",
"0.76293033",
"0.7590916",
"0.7547818",
"0.7461984",
"0.7450057",
"0.74444985",
"0.74214184",
"0.7393572",
"0.7392403",
"0.7359445",
"0.73191655",
"0.7277885",
"0.72512245",
"0.7238409",
"0.72376406",
"0.72205794",
"0.7207194",
"0.7195172",
"0.71827614",
"0.71817... | 0.0 | -1 |
Home file that will handle all home requests | def home(request):
obj_dict = States.objects.all()
if request.method == 'POST':
form = DeathForm(request.POST)
if form.is_valid():
state = form.cleaned_data['states']
death_count = (form.cleaned_data.get('death_count'))
data_update(state, death_count)
for... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def home(self, *args, **kwargs):\n pass",
"def home():\n return response(\"OK\")",
"def homepage():\r\n print(__name__ + \" invoked\")",
"def home():\n logging.info('Entering route: HOME')\n\n logging.info('Rendering template: main.html')\n return render_template('main.html')",
"def i... | [
"0.8038175",
"0.76617646",
"0.73549205",
"0.725541",
"0.7186171",
"0.7126228",
"0.71130216",
"0.7038828",
"0.70309633",
"0.70045465",
"0.6991472",
"0.69855845",
"0.6972144",
"0.6966559",
"0.6956139",
"0.6955458",
"0.6931605",
"0.6931191",
"0.6918811",
"0.6911046",
"0.6901987"... | 0.0 | -1 |
A function to compute the mimimum of the absolute value of the maximum likelihood estimator using a particle swarm optimization | def fit_pso(model,data,parNames,states,bounds,samples=None,disp=True,maxiter=30,popsize=10, processes=mp.cpu_count()-1):
# -------------------------------------------
# Run pso algorithm on SSE objective function
# -------------------------------------------
p_hat, obj_fun_val, pars_final_swarm, obj_fu... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def maximum_likelihood_loss(z, log_det_J, **args):\n\n return tf.reduce_mean(input_tensor=0.5 * tf.square(tf.norm(tensor=z, axis=-1)) - log_det_J)",
"def optimal_max(board):\n # Board full?\n if terminal(board):\n return [None, utility(board)]\n\n available_actions = list(actions(board))\n\n ... | [
"0.62780595",
"0.6276187",
"0.62353736",
"0.62311363",
"0.6225962",
"0.62020177",
"0.61881506",
"0.61724675",
"0.6124931",
"0.6094487",
"0.6086328",
"0.6065781",
"0.6061097",
"0.60388595",
"0.60230094",
"0.60200405",
"0.6008203",
"0.59752023",
"0.5971087",
"0.5950657",
"0.592... | 0.0 | -1 |
Run layer normalization on the last dimension of the tensor. | def layer_norm(input_tensor, name=None):
# return tf.contrib.layers.layer_norm(
# inputs=input_tensor, begin_norm_axis=-1, begin_params_axis=-1, scope=name)
return tf.keras.layers.LayerNormalization(axis=-1, epsilon=1e-12, center=False, scale=False)(inputs=input_tensor) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def norm_layer( x, training, name):\n top = tf.layers.batch_normalization( x, \n axis=3, # channels last \n training=training,\n name=name )\n return... | [
"0.7188471",
"0.69629765",
"0.69441414",
"0.67970544",
"0.67868984",
"0.67468345",
"0.6699458",
"0.66058177",
"0.6587076",
"0.65642875",
"0.6561795",
"0.6557462",
"0.6551223",
"0.6541247",
"0.65286005",
"0.6526391",
"0.65231514",
"0.65183055",
"0.6511796",
"0.6501839",
"0.649... | 0.6747918 | 5 |
Returns the color of the circle | def getColor(self):
return self.__color | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def value_circle(self):\r\n return self.circle",
"def GetCircle(circle):\r\n pass",
"def get_color(self):\n return self.color",
"def get_color(self):\r\n return self.__color",
"def get_color(self):\r\n return self._color",
"def get_color(self):\n return self._col... | [
"0.727764",
"0.70808893",
"0.7038515",
"0.7006561",
"0.70031154",
"0.6952446",
"0.6952446",
"0.69466203",
"0.69137627",
"0.690849",
"0.68616456",
"0.6857539",
"0.67989683",
"0.67621505",
"0.67280626",
"0.67280626",
"0.6719233",
"0.6719233",
"0.6718903",
"0.6717954",
"0.669790... | 0.6798711 | 15 |
Remove a set of keys from a dictionary. | def _remove_keys(results: dict, remove: list) -> dict:
removed = {}
for key, val in results.items():
if key not in remove:
removed[key] = val
return removed | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _filter_dict(src_dict, key_set):\n for k in set(src_dict.keys()) - key_set:\n src_dict.pop(k)",
"def keep_in_dictionary(self,dictionary,*keys):\r\n remove_keys = [k for k in dictionary if k not in keys]\r\n self.remove_from_dictionary(dictionary,*remove_keys)",
"def remove_keys_from... | [
"0.82830334",
"0.785168",
"0.76254576",
"0.75625604",
"0.7551612",
"0.7526013",
"0.74125165",
"0.7398286",
"0.73847413",
"0.73714226",
"0.73630935",
"0.71923006",
"0.7173672",
"0.7099648",
"0.7094521",
"0.697857",
"0.69439185",
"0.68971515",
"0.6861611",
"0.68174064",
"0.6797... | 0.6887262 | 18 |
Creates a 3D array of 3D world object points. If you want to calibrate 2plane, you should make objectpoints as that. grid_size = (x_num, y_num, z_num) | def two_plane_obj_points(grid_size, dx):
objp_xy = np.zeros((grid_size[0]*grid_size[1], 3), np.float32)
objp_yz = np.zeros((grid_size[1]*grid_size[2], 3), np.float32)
objp_xy[:,:2] = np.mgrid[0:grid_size[0], 0:grid_size[1]].T.reshape(-1, 2)
objp_yz[:,1:3] = np.mgrid[0:grid_size[1], 0:grid_size[2]].T... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def obj_points(grid_size, dx):\r\n objp = np.zeros((grid_size[0]*grid_size[1], 3), np.float32)\r\n objp[:,:2] = np.mgrid[0:grid_size[0], 0:grid_size[1]].T.reshape(-1, 2)\r\n\r\n return objp*dx",
"def MakeCoordinates3D(self):\n\n self.points = np.concatenate((self.points, np.zeros((self.points.sha... | [
"0.6956415",
"0.6871657",
"0.63504577",
"0.6305604",
"0.6150675",
"0.60865784",
"0.6083869",
"0.60663855",
"0.6029143",
"0.59978664",
"0.59638613",
"0.59534365",
"0.5946846",
"0.5908095",
"0.59039986",
"0.590372",
"0.5893489",
"0.5875465",
"0.58524495",
"0.5851192",
"0.585033... | 0.6699848 | 2 |
Creates a 3D array of 3D world object points. Z coordinate for every point is assumed to be zero | def obj_points(grid_size, dx):
objp = np.zeros((grid_size[0]*grid_size[1], 3), np.float32)
objp[:,:2] = np.mgrid[0:grid_size[0], 0:grid_size[1]].T.reshape(-1, 2)
return objp*dx | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def xyz(self) -> np.ndarray:\n return np.vstack((self.x, self.y, self.z)).transpose()",
"def MakeCoordinates3D(self):\n\n self.points = np.concatenate((self.points, np.zeros((self.points.shape[0],1)) ), axis=1)\n self.points = np.ascontiguousarray(self.points)",
"def cvt2array(tuples):\n ... | [
"0.71590316",
"0.7000325",
"0.68111104",
"0.6687257",
"0.6652061",
"0.6636498",
"0.6503225",
"0.6460843",
"0.645857",
"0.64573276",
"0.6432986",
"0.63974595",
"0.6281455",
"0.6267496",
"0.6224516",
"0.62016857",
"0.6163322",
"0.6145564",
"0.6140731",
"0.6135993",
"0.6131219",... | 0.0 | -1 |
Creates a 3D array of 3D world object points. Z coordinate for every point is assumed to be zero | def right_obj_points(grid_size, dx):
objp = np.zeros((grid_size[0]*grid_size[1], 3), np.float32)
objp[:,:2] = np.mgrid[1:grid_size[0]+1, 0:grid_size[1]].T.reshape(-1, 2)
return objp*dx | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def xyz(self) -> np.ndarray:\n return np.vstack((self.x, self.y, self.z)).transpose()",
"def MakeCoordinates3D(self):\n\n self.points = np.concatenate((self.points, np.zeros((self.points.shape[0],1)) ), axis=1)\n self.points = np.ascontiguousarray(self.points)",
"def cvt2array(tuples):\n ... | [
"0.7159152",
"0.70004964",
"0.68105024",
"0.6687646",
"0.6652693",
"0.6636521",
"0.6503862",
"0.64612997",
"0.6458343",
"0.6457769",
"0.6433366",
"0.6396867",
"0.6282248",
"0.6267545",
"0.622522",
"0.6201884",
"0.61642736",
"0.6145888",
"0.61405104",
"0.61365885",
"0.61313325... | 0.0 | -1 |
Creates a 3D array of 3D world object points. X coordinate for every point is assumed to be zero | def left_obj_points(grid_size, dx):
objp = np.zeros((grid_size[1] * grid_size[2], 3), np.float32)
objp[:,1:3] = np.mgrid[0:grid_size[2], 0:grid_size[1]].T.reshape(-1, 2)
u=objp.T; y=0*u; y[1]=u[2]; y[2]=u[1]
return y.T * dx | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def MakeCoordinates3D(self):\n\n self.points = np.concatenate((self.points, np.zeros((self.points.shape[0],1)) ), axis=1)\n self.points = np.ascontiguousarray(self.points)",
"def xyz(self) -> np.ndarray:\n return np.vstack((self.x, self.y, self.z)).transpose()",
"def cvt2array(tuples):\n ... | [
"0.72336006",
"0.72242546",
"0.674793",
"0.670637",
"0.6645193",
"0.6525643",
"0.6496316",
"0.6466273",
"0.6454112",
"0.6375829",
"0.6356054",
"0.63363755",
"0.63122916",
"0.63056666",
"0.6287191",
"0.62543935",
"0.62518483",
"0.61903405",
"0.61754805",
"0.6139416",
"0.612624... | 0.0 | -1 |
Check if the attribute has keyframe in the current frame | def current_frame_has_key(attr):
k = pm.keyframe(attr, query=True, time=pm.currentTime())
if k:
return True | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def channel_has_animation(attr):\n k = cmds.keyframe(attr, query=True)\n if k:\n return True",
"def __bool__(self):\n return _osgAnimation.vectorVec3Keyframe___bool__(self)",
"def __bool__(self):\n return _osgAnimation.vectorVec4Keyframe___bool__(self)",
"def __bool__(self):\n ... | [
"0.7819775",
"0.66093826",
"0.65196204",
"0.6500611",
"0.6460843",
"0.6405242",
"0.63498026",
"0.63399935",
"0.6314102",
"0.6279381",
"0.6241291",
"0.60813606",
"0.6029613",
"0.5837364",
"0.5787127",
"0.57587916",
"0.5683129",
"0.56743085",
"0.5646003",
"0.5644488",
"0.562016... | 0.8474909 | 0 |
Skips the first entries of this result set. | def skip(self, skip):
self.query = self.query.skip(skip)
self._has_skip = True
return self | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def skip(self, skip):\n self._evaluated = False\n self._offset = skip\n return self",
"def skip_rows(reader, n):\n for i in range(n):\n next(reader)",
"def skip(self, skip):\n\n self._skip = skip",
"def skip(self, skip):\n\n self._skip = skip\n return self",
"def ski... | [
"0.6547221",
"0.64715946",
"0.64025074",
"0.6337534",
"0.62512887",
"0.6135879",
"0.61354864",
"0.6121187",
"0.6088065",
"0.60749716",
"0.60235095",
"0.59365004",
"0.59159976",
"0.5839844",
"0.5778818",
"0.57404953",
"0.5718574",
"0.57068175",
"0.5676668",
"0.5617569",
"0.552... | 0.67080784 | 0 |
Returns the number of documents returned by this query. | def count(self):
return self.query.count(with_limit_and_skip = True) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_count(self):\n connection = self.__get_database_connection()\n response = self.__make_request(connection, '/%s' % (self.database_name))\n return response.get('doc_count', 0)",
"async def count(self) -> int:\n return (\n await self.document_model.get_motor_collection... | [
"0.8337345",
"0.8287085",
"0.81594795",
"0.8137729",
"0.78821033",
"0.77255785",
"0.7679622",
"0.7679622",
"0.7676329",
"0.76175874",
"0.7602115",
"0.7572826",
"0.7533432",
"0.74863744",
"0.73947823",
"0.73635274",
"0.7325006",
"0.73239166",
"0.727974",
"0.72676206",
"0.72548... | 0.73179775 | 18 |
Converts a pymongo document dictionary into a valid document object instance. | def _to_document(self, document):
obj = self.document()
obj._set_from_db(document)
return obj | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def from_mongo(cls, data: dict) -> Union[\"MongoModel\", Dict]:\n if not data:\n return data\n id = data.pop('_id', None)\n return cls(**dict(data, id=id))",
"def build_from_mongo(cls, data, use_cls=True):\n # If a _cls is specified, we have to use this document class\n if u... | [
"0.7376199",
"0.679948",
"0.6655679",
"0.6619633",
"0.6327637",
"0.62113893",
"0.60903984",
"0.6074768",
"0.59807473",
"0.5961137",
"0.59598356",
"0.5950308",
"0.594393",
"0.5930427",
"0.59177494",
"0.59102196",
"0.5881701",
"0.5865606",
"0.585971",
"0.58388865",
"0.58154225"... | 0.71614736 | 1 |
Skips the first entries of this result set. | def skip(self, skip):
self._evaluated = False
self._offset = skip
return self | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def skip(self, skip):\n self.query = self.query.skip(skip)\n self._has_skip = True\n return self",
"def skip_rows(reader, n):\n for i in range(n):\n next(reader)",
"def skip(self, skip):\n\n self._skip = skip",
"def skip(self, skip):\n\n self._skip = skip\n return self... | [
"0.67069906",
"0.6471434",
"0.64006656",
"0.63355756",
"0.62503874",
"0.613458",
"0.61340994",
"0.6121521",
"0.60875076",
"0.6073741",
"0.6023148",
"0.59348124",
"0.5915648",
"0.5839352",
"0.57775354",
"0.5739357",
"0.57175505",
"0.5706402",
"0.56765467",
"0.56159693",
"0.552... | 0.65455544 | 1 |
Create and configure a new app instance for each test. | def app():
# create the app with common test config
app = create_app({"DB_CONNECT": TEST_DB_CONNECT})
# create the database and load test data
with app.app_context():
get_db()
aa = g.db.execute(_data_sql).fetchone() # 用来测试, 实际使用的时候应该是清理或初始化需要的数据
yield app
# 可以在这里做一些清理工作
p... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_app():\n param = {\n 'DEBUG': True,\n 'TESTING': True\n }\n _app = create_app(settings_override=param)\n\n ctx = _app.app_context()\n ctx.push()\n yield _app\n ctx.pop()",
"def create_app(self):\n app.config.from_object('config.TestingConfig')\n return ap... | [
"0.7984731",
"0.7973278",
"0.7952626",
"0.7774617",
"0.7610121",
"0.75586873",
"0.7514867",
"0.748489",
"0.7457632",
"0.7457632",
"0.7457632",
"0.7423435",
"0.74221593",
"0.7392862",
"0.7378533",
"0.73515075",
"0.7331986",
"0.7303747",
"0.7297693",
"0.7282327",
"0.7275915",
... | 0.69582385 | 61 |
Add headers to both force latest IE rendering engine or Chrome Frame, and also to cache the rendered page for 10 minutes. | def add_header(response):
response.headers['X-UA-Compatible'] = 'IE=Edge,chrome=1'
response.headers['Cache-Control'] = 'public, max-age=60'
return response | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def add_header(response):\n response.headers['X-UA-Compatible'] = 'IE=Edge,chrome=1'\n response.headers['Cache-Control'] = 'public, max-age=600'\n return response",
"def add_header(response):\n response.headers['X-UA-Compatible'] = 'IE=Edge,chrome=1'\n response.headers['Cache-Control'] = 'public, ... | [
"0.8222085",
"0.8222085",
"0.8222085",
"0.8222085",
"0.819543",
"0.8162872",
"0.8162872",
"0.8162872",
"0.8162872",
"0.8162872",
"0.8162872",
"0.8162872",
"0.8162872",
"0.8162872",
"0.8162872",
"0.8162872",
"0.8162872",
"0.8162872",
"0.8162872",
"0.8162872",
"0.8162872",
"0... | 0.82229227 | 0 |
Apply func to each element of a collection, or value of a dictionary. If the value is not a collection, return it unmodified | def map_collection(func, collection):
datatype = type(collection)
if isinstance(collection, Mapping):
return datatype((key, func(val)) for key, val in collection.items())
if is_string(collection):
return collection
elif isinstance(collection, Iterable):
return datatype(map(func, ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def walk_values_rec(f, coll):\n if is_mapping(coll):\n return f(walk_values(walk_values_rec(f), coll))\n elif is_list(coll):\n return f(list(map(walk_values_rec(f), coll)))\n else:\n return f(coll)",
"def apply_to_collection(data: Any, dtype: Union[type, tuple], function: Callable, ... | [
"0.71441704",
"0.6956387",
"0.6694411",
"0.62626463",
"0.6200003",
"0.6001378",
"0.5918556",
"0.5914313",
"0.58524376",
"0.58330405",
"0.5776887",
"0.57607365",
"0.5739621",
"0.56303555",
"0.5624981",
"0.56235015",
"0.56084394",
"0.5600193",
"0.55982894",
"0.55879223",
"0.553... | 0.7135692 | 1 |
A string representation of the model. | def __str__(self):
return self.location_name | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __str__(self):\n return super().__str__() + self.model.__str__()",
"def __repr__(self):\n\n mod = f\"{self.__class__.__name__} Model\"\n try:\n mod += f': {self.filename}'\n except AttributeError:\n pass\n s = [mod]\n for name, v in self.metadat... | [
"0.8567286",
"0.80320746",
"0.7939547",
"0.78144956",
"0.78115743",
"0.7782607",
"0.7757796",
"0.7757796",
"0.773894",
"0.77152467",
"0.7714009",
"0.7679083",
"0.7661709",
"0.765754",
"0.7645759",
"0.7645759",
"0.7628557",
"0.762749",
"0.75903344",
"0.75903344",
"0.7569605",
... | 0.0 | -1 |
A string representation of the model. | def __str__(self):
return '{0} : {1} : {2}'.format(self.location_det_info.location_id, self.location_det_info.location_name, self.photo_link) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __str__(self):\n return super().__str__() + self.model.__str__()",
"def __repr__(self):\n\n mod = f\"{self.__class__.__name__} Model\"\n try:\n mod += f': {self.filename}'\n except AttributeError:\n pass\n s = [mod]\n for name, v in self.metadat... | [
"0.85663986",
"0.803271",
"0.79394376",
"0.78149664",
"0.7810674",
"0.77822584",
"0.77570075",
"0.77570075",
"0.77393293",
"0.77159613",
"0.77150387",
"0.76797277",
"0.7662907",
"0.76580936",
"0.7644709",
"0.7644709",
"0.7629082",
"0.76272035",
"0.75906587",
"0.75906587",
"0.... | 0.0 | -1 |
A string representation of the model. | def __str__(self):
return '{0}: {1} | {2} : {3} | {4}'.format(self.user_id.id, self.user_id.email, self.location_id.location_id, self.location_id.location_name, self.updated_time) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __str__(self):\n return super().__str__() + self.model.__str__()",
"def __repr__(self):\n\n mod = f\"{self.__class__.__name__} Model\"\n try:\n mod += f': {self.filename}'\n except AttributeError:\n pass\n s = [mod]\n for name, v in self.metadat... | [
"0.85668004",
"0.80330515",
"0.79402775",
"0.781453",
"0.78113",
"0.7783454",
"0.77579135",
"0.77579135",
"0.7740315",
"0.77159655",
"0.77138305",
"0.76785606",
"0.76623255",
"0.76586974",
"0.7645179",
"0.7645179",
"0.76295626",
"0.76276153",
"0.7589816",
"0.7589816",
"0.7571... | 0.0 | -1 |
Reshaping happens during the call to forward. | def reshape(self, bottom, top):
pass | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def forward(self, input):\n batch_size = input.size(0)\n shape = (batch_size, *self.shape)\n out = input.reshape(shape)\n return out",
"def _reshape(self):\n self._frame._setup(width=self._width,height=self._height,\n startx=self._x,starty=self._y)",
... | [
"0.70523924",
"0.6610369",
"0.6552763",
"0.6552763",
"0.6444607",
"0.6263049",
"0.62191755",
"0.6207382",
"0.62042695",
"0.6125206",
"0.6125206",
"0.6097465",
"0.6092736",
"0.6090612",
"0.6085355",
"0.60790575",
"0.6075612",
"0.6063214",
"0.6062157",
"0.6055766",
"0.60474175"... | 0.5745745 | 86 |
This is the sieve of Erosthenes, as implemented by David Eppstein, UC Irvine, 28 Feb 2002 For the method of calculating primes that I came up with myself, see my solution to problem 7 | def prime_generator():
# map of composites (key) with at least one prime factor in list as value
D = {}
# first number to test if prime
q = 2
while 1:
if q not in D:
# next prime found
yield q
# add it's square as a composite to D
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def er_sieve(s):\n sis = [True] * (s + 1)\n\n sis[0] = False\n sis[1] = False\n p = 2\n\n while (p ** 2) <= s:\n if sis[p]:\n for i in range(p * 2, s + 1, p):\n sis[i] = False\n p += 1\n\n primes = []\n\n for j... | [
"0.79081774",
"0.7791447",
"0.7771241",
"0.775611",
"0.7721861",
"0.7718852",
"0.7712618",
"0.7701185",
"0.76994807",
"0.76991796",
"0.7672956",
"0.7672956",
"0.7576873",
"0.7576152",
"0.7573356",
"0.7567757",
"0.7567402",
"0.755636",
"0.75506777",
"0.7496662",
"0.7492551",
... | 0.0 | -1 |
Recursively merge dict2 into dict1 (in place) | def _merge_dicts(dict1, dict2, path=None):
if path is None:
path = []
for key, value2 in six.iteritems(dict2):
if key not in dict1:
dict1[key] = value2
continue
value1 = dict1[key]
if value1 == value2:
continue
elif isinstance(value1, d... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _merge_dicts(d1, d2):\n for key, value in d2.items():\n if key in d1:\n if isinstance(d1[key], dict) and isinstance(value, dict):\n _merge_dicts(d1[key], value)\n continue\n d1[key] = value",
"def merge_dictionaries(d1, d2):\n\n if d2 is None: \n ... | [
"0.80399597",
"0.79884166",
"0.7935461",
"0.78855747",
"0.7836948",
"0.76888674",
"0.7673042",
"0.76711994",
"0.76711994",
"0.7658636",
"0.7657581",
"0.7606851",
"0.75493306",
"0.75251645",
"0.75092447",
"0.74775165",
"0.7456558",
"0.7408299",
"0.7393379",
"0.7371348",
"0.736... | 0.8028046 | 1 |
return a keras model with the same setup | def clone_keras_model(target, custom_objects=None):
new_model = model_from_json(target.to_json(),custom_objects)
new_model.set_weights(target.get_weights())
return new_model | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_model():\r\n model = Sequential([\r\n\r\n Lambda(normalize, input_shape=(66, 200, 3)),\r\n\r\n Convolution2D(16, (3, 3), padding='same', activation='relu', strides=2),\r\n Convolution2D(16, (3, 3), padding='same', activation='relu', strides=1),\r\n Convolution2D(24, (3, 3), p... | [
"0.77413577",
"0.76577276",
"0.7527948",
"0.7482939",
"0.7410151",
"0.7401882",
"0.73722875",
"0.73719454",
"0.73517644",
"0.7339805",
"0.7328387",
"0.7316164",
"0.7307587",
"0.72834766",
"0.7275323",
"0.72604656",
"0.725212",
"0.7219951",
"0.718237",
"0.71755457",
"0.7174741... | 0.6877451 | 54 |
Return a list of uninitialized tf variables. | def get_uninitialized_variables(variables=None):
sess = tf.get_default_session()
if variables is None:
variables = tf.global_variables()
else:
variables = list(variables)
if len(variables) == 0:
return []
if semver.match(tf.__version__, '<1.0.0'):
init_flag = sess.r... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def initialize_uninitialized_variables(sess):\n uninit_vars = []\n uninit_tensors = []\n for var in tf.global_variables():\n uninit_vars.append(var)\n uninit_tensors.append(tf.is_variable_initialized(var))\n uninit_bools = sess.run(uninit_tensors)\n uninit = zip(uninit_bools, uninit... | [
"0.7841744",
"0.7496129",
"0.7198177",
"0.71766186",
"0.7040041",
"0.6945067",
"0.69365084",
"0.68995523",
"0.6888753",
"0.68063164",
"0.67433554",
"0.66923213",
"0.6515283",
"0.64900374",
"0.64650863",
"0.64212316",
"0.64074284",
"0.64032453",
"0.6367547",
"0.6326609",
"0.63... | 0.8299286 | 0 |
Return list of target model update ops. These are soft target updates. Meaning that the target values are slowly adjusted, rather than directly copied over from the source model. | def get_soft_target_model_updates(target, source, tau):
target_weights = target.get_weights()
tau_values = np.ones(np.shape(target_weights)) * tau
new_weights = (1 - tau_values) * target.get_weights() + tau_values * source.get_weights()
target.set_weights(new_weights)
return target | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_hard_target_model_updates(target, source):\n target.set_weights(source.get_weights())\n\n return target",
"def get_target_updates(_vars, target_vars, tau, verbose=0):\n if verbose >= 2:\n print('setting up target updates ...')\n\n soft_updates = []\n init_updates = []\n assert le... | [
"0.680939",
"0.66979945",
"0.61962277",
"0.6159392",
"0.5961591",
"0.5920616",
"0.58885896",
"0.57637775",
"0.57501525",
"0.57432735",
"0.5694672",
"0.5693133",
"0.55955386",
"0.5538365",
"0.55011755",
"0.54881394",
"0.54881394",
"0.5424445",
"0.54207546",
"0.5393336",
"0.537... | 0.68320936 | 0 |
Test for the presence of an exchange, and optionally whether it has an alternate exchange set to a known value. | def query_exchange(self, exchange_name, alt_exchange_name=None):
return self._query(exchange_name, "exchange", "org.apache.qpid.broker", alt_exchange_name) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def check_exchange_exists(self, exchange_name):\n try:\n yield from self.exchange_declare(exchange_name, passive=True)\n except asyncio.exceptions.ChannelClosed:\n return False\n exchange = self.http_client.get_exchange(self.VHOST, exchange_name)\n return exchange ... | [
"0.67719275",
"0.6318865",
"0.62033266",
"0.59151757",
"0.5833259",
"0.581084",
"0.55504566",
"0.53638417",
"0.5237897",
"0.5213223",
"0.51355743",
"0.51055527",
"0.50568295",
"0.50498784",
"0.4957506",
"0.49200758",
"0.4916098",
"0.4913207",
"0.48822218",
"0.48819906",
"0.48... | 0.5098686 | 12 |
Test for the presence of an exchange, and optionally whether it has an alternate exchange set to a known value. | def query_queue(self, queue_name, alt_exchange_name=None):
return self._query(queue_name, "queue", "org.apache.qpid.broker", alt_exchange_name) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def check_exchange_exists(self, exchange_name):\n try:\n yield from self.exchange_declare(exchange_name, passive=True)\n except asyncio.exceptions.ChannelClosed:\n return False\n exchange = self.http_client.get_exchange(self.VHOST, exchange_name)\n return exchange ... | [
"0.6770636",
"0.63190055",
"0.6202528",
"0.59146357",
"0.583146",
"0.58103025",
"0.5549937",
"0.5363096",
"0.5237259",
"0.52099144",
"0.5134406",
"0.5105851",
"0.5096687",
"0.5057867",
"0.50499105",
"0.4957202",
"0.492103",
"0.49151775",
"0.49101487",
"0.48828304",
"0.4881117... | 0.0 | -1 |
Check if a queue is empty (has no messages waiting) | def queue_empty(self, queue_name):
return self.queue_message_count(queue_name) == 0 | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def is_empty(self):\n return len(self.queue) == 0",
"def is_empty(self):\n return len(self.queue) == 0",
"def is_empty(self):\n return self.queue == []",
"def is_empty(self):\n return len(self.the_queue) == 0",
"def is_empty(self):\n return len(self.__queue) > 0",
"def ... | [
"0.8563155",
"0.8563155",
"0.856003",
"0.8520078",
"0.84958243",
"0.8355925",
"0.8341753",
"0.834009",
"0.83279884",
"0.83177894",
"0.829032",
"0.8267508",
"0.825383",
"0.82482827",
"0.8191616",
"0.81884384",
"0.8186372",
"0.8149118",
"0.81480026",
"0.8113768",
"0.8071125",
... | 0.8461983 | 5 |
Check if a queue is empty (has no more messages) | def _chk_empty(self, queue, receiver):
try:
msg = receiver.fetch(timeout=0)
self.assert_(False, "Queue \"%s\" not empty: found message: %s" % (queue, msg))
except Empty:
pass | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def is_empty(self):\n return self.queue == []",
"def is_empty(self):\n return len(self.queue) == 0",
"def is_empty(self):\n return len(self.queue) == 0",
"def is_empty(self):\n return len(self.__queue) > 0",
"def is_empty(self):\n return len(self.the_queue) == 0",
"def ... | [
"0.8489192",
"0.84731364",
"0.84731364",
"0.84247255",
"0.8419345",
"0.83326113",
"0.82777584",
"0.8260492",
"0.8238599",
"0.8233666",
"0.82004493",
"0.81588924",
"0.809562",
"0.808904",
"0.80711395",
"0.8027008",
"0.8018088",
"0.79885304",
"0.7953359",
"0.793655",
"0.7916652... | 0.83180344 | 6 |
Assert an item is in the response body. | def assertContains(self, response, item):
self.assertTrue(item in response.body) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_correctitemid_correctresponsebody(self):\r\n config = self.__load_config()\r\n url = f\"http://{config['api']['host']}:{config['api']['port']}/gs/api/v1/54590\"\r\n r = requests.get(url)\r\n\r\n expected = {\r\n 'itemId': 54590,\r\n 'name': 'Sharpened Twil... | [
"0.6967266",
"0.6836119",
"0.6726765",
"0.67165565",
"0.6494212",
"0.6480021",
"0.63034284",
"0.62851477",
"0.6265313",
"0.6256769",
"0.6230533",
"0.62298334",
"0.619795",
"0.6194481",
"0.61930746",
"0.61762273",
"0.6117838",
"0.6096125",
"0.6093593",
"0.60832757",
"0.6074354... | 0.8396542 | 0 |
Create a new data bag item. Pass the initial value for any keys as keyword arguments. | def create(cls, bag, name, key, api=None, **kwargs):
api = api or ChefAPI.get_global()
obj = cls(bag, name, key, api, skip_load=True)
for key, value in six.iteritems(kwargs):
obj[key] = value
obj.save()
if isinstance(bag, EncryptedDataBag) and name not in bag.names:
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _create_item(self, item_id: str, data: dict) -> Pipeline:\n return Pipeline(id=item_id, **data)",
"def create(self):\n item = BasketItem.create()\n self._baskets[item.code] = item\n return item.code",
"def __init__(self, key, value):\n self.key = key\n self.value =... | [
"0.6193863",
"0.5993691",
"0.5989944",
"0.59822065",
"0.5879012",
"0.5858341",
"0.584953",
"0.58321166",
"0.58321166",
"0.57810235",
"0.57786286",
"0.5777314",
"0.5752967",
"0.575122",
"0.575122",
"0.575122",
"0.575122",
"0.575122",
"0.575122",
"0.575122",
"0.575122",
"0.57... | 0.6786038 | 0 |
Return a user by its id. | async def get_user_byid(request):
user_id = request.match_info["user_id"]
try:
user_id = int(user_id)
except (ValueError, TypeError):
return web.Response(text="Incorrect value for user_id", status=400)
currentuser = (
request.cirrina.db_session.query(User)
.filter(User.u... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_user_by_id(self, id):\n\t\treturn self.users.get(id)",
"def find_by_id(cls, _id):\n user = cls.query.filter_by(id=_id).first()\n return user",
"def getUser(self, id : int) -> bbUser.bbUser:\n id = self.validateID(id)\n return self.users[id]",
"def get(id):\n return ... | [
"0.8989497",
"0.86999327",
"0.86902523",
"0.8682047",
"0.86731964",
"0.8641115",
"0.85874337",
"0.85419333",
"0.8509774",
"0.8494728",
"0.848963",
"0.8441403",
"0.84342724",
"0.8433056",
"0.8433056",
"0.8433056",
"0.8433056",
"0.8418924",
"0.8376678",
"0.8343175",
"0.8268276"... | 0.81730914 | 32 |
the id of bulk record Corresponds to the 'Id' field in the bulk file. | def id(self):
return self._id | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def id(self):\n return self.get_data(\"id\")",
"def id(self):\n return str(self.get_data(\"id\"))",
"def id(self):\n return self.raw_resource[\"id\"]",
"def id(self):\n\t\tif self._record is not None:\n\t\t return self._record.id\n\t\telse:\n\t\t return \"NO_ID_ASSIGNED\"",
"def ... | [
"0.75862163",
"0.75683075",
"0.7532247",
"0.7523961",
"0.75215757",
"0.74835855",
"0.7478835",
"0.7477398",
"0.7453414",
"0.7453414",
"0.7442327",
"0.7326288",
"0.7236644",
"0.72340614",
"0.71738935",
"0.71606654",
"0.715806",
"0.71532977",
"0.7151689",
"0.7141299",
"0.712193... | 0.72178876 | 53 |
the value of ad customizer attribute Corresponds to the 'AdCustomizer AttributeValue' field in the bulk file. | def attribute_value(self):
return self._attribute_value | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def attribute_value(self) -> str:\n return pulumi.get(self, \"attribute_value\")",
"def value(self):\n return self.raw.get_attribute(\"value\")",
"def value(self):\n return self.element.get_attribute('value')",
"def value(self):\n return self.element.get_attribute('value')",
"def va... | [
"0.62839144",
"0.60764915",
"0.602967",
"0.602967",
"0.602967",
"0.60003376",
"0.590117",
"0.5815305",
"0.57211477",
"0.567954",
"0.56634533",
"0.56456804",
"0.56100965",
"0.5596023",
"0.55585593",
"0.55261123",
"0.549329",
"0.5488646",
"0.52902913",
"0.528557",
"0.526337",
... | 0.6285789 | 0 |
the parent id of bulk record Corresponds to the 'ParentId' field in the bulk file. | def parent_id(self):
return self._parent_id | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def parent_id(self) -> str:\n return self._db_data.parent_id",
"def parent_id(self) -> pulumi.Output[int]:\n return pulumi.get(self, \"parent_id\")",
"def get_parentID(self):\n parent = Collection.find(self.resource.container)\n return parent.uuid",
"def parent_id(self) -> int:\n ... | [
"0.8123638",
"0.78920895",
"0.7870857",
"0.78471476",
"0.780203",
"0.7636215",
"0.7636215",
"0.7542416",
"0.73776096",
"0.73776096",
"0.73776096",
"0.73776096",
"0.71930164",
"0.71748734",
"0.7137856",
"0.7137856",
"0.71269906",
"0.70943177",
"0.68721473",
"0.686579",
"0.6841... | 0.79778546 | 2 |
the editorial status of ad customizer attribute Corresponds to the 'Editorial Status' field in the bulk file. | def editorial_status(self):
return self._editorial_status | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def editorial_status(self):\n\n return self._editorial_status",
"def get_status_instructor():\n if self.status == self.CH_SUBMITTED:\n return \"Submitted\"\n \n elif self.status == self.CH_AUTOGRADED:\n if self.autograderresult.visible:\n retur... | [
"0.74443287",
"0.6334042",
"0.63017523",
"0.6132932",
"0.59302324",
"0.5911544",
"0.5816745",
"0.57952416",
"0.57461816",
"0.57442856",
"0.5735055",
"0.57297575",
"0.5721885",
"0.5719453",
"0.5699855",
"0.56896436",
"0.5665827",
"0.56407344",
"0.5633577",
"0.56131107",
"0.560... | 0.75428087 | 0 |
initializes parameters. shapes are the shape of filters/weights | def initialize_parameters():
W1 = tf.get_variable('W1', [3,3,3,64], initializer=tf.contrib.layers.xavier_initializer(seed = 0))
W2 = tf.get_variable('W2', [3,3,64,128], initializer=tf.contrib.layers.xavier_initializer(seed = 0))
W3 = tf.get_variable('W3', [3,3,128,256], initializer=tf.contrib.layers.xavier... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def init_parameters(self):\n # Create the weights and biases\n for i in range(1, len(self.layer_dimensions)):\n # Initialization from He et al.\n mu = 0\n var = 2 / self.layer_dimensions[i]\n sigma = np.sqrt(var)\n weight_shape = (self.layer_dime... | [
"0.71550333",
"0.70845807",
"0.68195206",
"0.68161696",
"0.6775269",
"0.67617357",
"0.671342",
"0.6655029",
"0.6634684",
"0.6555452",
"0.65547395",
"0.6523196",
"0.65135413",
"0.6511257",
"0.6497331",
"0.6494804",
"0.6492845",
"0.64643216",
"0.64510685",
"0.64328694",
"0.6424... | 0.627161 | 44 |
Case in which the node's uncle is red. Whether the uncle is the right or left child of node's grandparent is irrelevant for case 1. | def test_insert_fixup_both_case_1():
# setup
tree = RedBlackTree()
make_black_a = tree.insert(5)
uncle = tree.insert(3)
parent = tree.insert(7)
node = tree.insert(6)
make_black_a.color = Color.BLACK
# run
tree.insert_fixup(node)
# assert
assert_that(parent.color, equal_to(C... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __fix_double_reds(self, node):\r\n grand_parent_node = node.parent.parent\r\n parent_node = node.parent\r\n\r\n if grand_parent_node.left_child.color == grand_parent_node.right_child.color:\r\n uncle_node_red = True\r\n else:\r\n uncle_node_red = False\r\n\r\n ... | [
"0.740203",
"0.67045254",
"0.64168966",
"0.633078",
"0.6292774",
"0.62227017",
"0.59912103",
"0.5926634",
"0.58722556",
"0.5675005",
"0.5620131",
"0.54945254",
"0.54452735",
"0.5440835",
"0.5380705",
"0.534453",
"0.533917",
"0.533917",
"0.533917",
"0.53052825",
"0.52868384",
... | 0.5336379 | 19 |
Compares the properties of IOCs in a component/configuration. | def _compare_ioc_properties(old: Dict[str, IOC], new: Dict[str, IOC]):
new_iocs = set()
changed_iocs = set()
removed_iocs = set()
_attributes = ["macros", "pvs", "pvsets", "simlevel", "restart", "autostart"]
for ioc_name in new.keys():
if ioc_name not in old.keys():
# If not in... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def compare_cpes(lhs: ImageCpe, rhs: ImageCpe):\n vendor_cmp = compare_fields(lhs.vendor, rhs.vendor)\n if vendor_cmp != 0:\n return vendor_cmp\n\n name_cmp = compare_fields(lhs.name, rhs.name)\n if name_cmp != 0:\n return name_cmp\n\n version_cmp = compare_fields(lhs.version, rhs.vers... | [
"0.57017356",
"0.55988294",
"0.555233",
"0.5428344",
"0.5325737",
"0.53129596",
"0.5299363",
"0.5284372",
"0.5272075",
"0.5189261",
"0.5165812",
"0.5164523",
"0.5158793",
"0.5151063",
"0.5145858",
"0.5134723",
"0.5105723",
"0.5093771",
"0.50659186",
"0.5053895",
"0.50453097",... | 0.6497148 | 0 |
Reduced healing will be max 75% of highest recorded heal. Just remove all heals below 75% of max heal. | def filter_out_reduced_healing(raw_heals):
max_heal = max(raw_heals)
threshold = 0.75 * max_heal
selector = raw_heals > threshold
return raw_heals[selector] | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def heal_damage(self, heal):\n if self.hp + heal < self.max_hp:\n self.hp += heal\n else:\n self.hp = self.max_hp",
"def heal(gladiator):\n if gladiator['rage'] >= 10:\n gladiator['health'] += 5\n gladiator['rage'] -= 10",
"def reduceResist(self, ammt = .5):... | [
"0.6723648",
"0.600925",
"0.59612036",
"0.58990496",
"0.5812814",
"0.5743378",
"0.5740142",
"0.5730601",
"0.5691914",
"0.5622821",
"0.5601312",
"0.5578159",
"0.55779105",
"0.5545223",
"0.55423796",
"0.5541719",
"0.55403614",
"0.5538204",
"0.5510481",
"0.5504634",
"0.54938686"... | 0.7941897 | 0 |
mili timestamp, 41 bits | def GenerateTime(self):
return str(bin(int(round(time.time() * 1000))))[2:] | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __timestamp():\n today = time.time()\n return struct.pack(b'=L', int(today))",
"def timestamp():\n\tn = datetime.datetime.now()\n\treturn \"%04d-%02d-%02dT%02d:%02d:%02d\" % (\n\t\tn.year, n.month, n.day, n.hour, n.minute, n.second\n\t)",
"def timestamp():\n return int(time.time())",
"def timest... | [
"0.7616278",
"0.7507826",
"0.747849",
"0.7427114",
"0.7256611",
"0.7186101",
"0.7062725",
"0.7057877",
"0.6972369",
"0.6924803",
"0.69153595",
"0.6874996",
"0.68562937",
"0.6836577",
"0.68191546",
"0.67749727",
"0.6764506",
"0.6750483",
"0.67407113",
"0.6739135",
"0.67345214"... | 0.6027623 | 97 |
Wrapper for layers batchnorm. | def batch(
bottom,
name,
scale=True,
center=True,
fused=False,
renorm=False,
data_format='NHWC',
dtype=tf.float32,
reuse=False,
momentum=0.99,
training=True,
trainable=None):
if trainable is None:
trainable = tra... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def batch_norm(self, inputs):\n x = inputs\n x = self.bn(x)\n return x",
"def batch_norm(x: tf.Tensor) -> tf.Tensor:\n return slim.batch_norm(x, activation_fn=tf.nn.relu, scope='postnorm')",
"def batch_norm(inputs, training, data_format):\n # We set fused=True for a significant per... | [
"0.79399246",
"0.76744854",
"0.76086",
"0.76083946",
"0.75586706",
"0.75245696",
"0.7512843",
"0.7436727",
"0.7420089",
"0.740336",
"0.7390213",
"0.7329941",
"0.73198295",
"0.7191291",
"0.71347713",
"0.7118562",
"0.71154714",
"0.7115071",
"0.7108132",
"0.7107261",
"0.70764756... | 0.63023084 | 87 |
Wrapper for layers batchnorm. | def instance(
bottom,
scale=True,
center=True,
data_format='NHWC',
dtype=tf.float32,
reuse=False,
scope=None,
training=True):
if data_format is not 'NHWC' or data_format is not 'channels_last':
pass
elif data_format is not 'NCHW' or data_fo... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def batch_norm(self, inputs):\n x = inputs\n x = self.bn(x)\n return x",
"def batch_norm(x: tf.Tensor) -> tf.Tensor:\n return slim.batch_norm(x, activation_fn=tf.nn.relu, scope='postnorm')",
"def batch_norm(inputs, training, data_format):\n # We set fused=True for a significant per... | [
"0.7939793",
"0.76741517",
"0.7608547",
"0.7608113",
"0.75583655",
"0.7524594",
"0.75127965",
"0.7436721",
"0.74201155",
"0.74034303",
"0.7389237",
"0.7330305",
"0.7320411",
"0.7191528",
"0.71353745",
"0.71179646",
"0.71158296",
"0.71150136",
"0.71087587",
"0.71063703",
"0.70... | 0.0 | -1 |
Wrapper for layers batchnorm. | def group(
bottom,
scale=True,
center=True,
data_format='NHWC',
dtype=tf.float32,
reuse=False,
scope=None,
training=True):
if data_format is not 'NHWC' or data_format is not 'channels_last':
pass
elif data_format is not 'NCHW' or data_forma... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def batch_norm(self, inputs):\n x = inputs\n x = self.bn(x)\n return x",
"def batch_norm(x: tf.Tensor) -> tf.Tensor:\n return slim.batch_norm(x, activation_fn=tf.nn.relu, scope='postnorm')",
"def batch_norm(inputs, training, data_format):\n # We set fused=True for a significant per... | [
"0.79399246",
"0.76744854",
"0.76086",
"0.76083946",
"0.75586706",
"0.75245696",
"0.7512843",
"0.7436727",
"0.7420089",
"0.740336",
"0.7390213",
"0.7329941",
"0.73198295",
"0.7191291",
"0.71347713",
"0.7118562",
"0.71154714",
"0.7115071",
"0.7108132",
"0.7107261",
"0.70764756... | 0.0 | -1 |
Wrapper for contrib layers batchnorm. | def batch_contrib(
bottom,
name,
scale=True,
center=True,
fused=None,
renorm=False,
recurrent_scale=False,
dtype=tf.float32,
data_format='NHWC',
reuse=False,
scope=None,
training=True,
trainable=None):
if trainab... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def batch_norm(self, inputs):\n x = inputs\n x = self.bn(x)\n return x",
"def batch_norm(x, train, init, act=None, name=None, eps=1e-5, decay=0.9):\n\n return tf.contrib.layers.batch_norm(x,\n decay=decay,\n eps... | [
"0.7462724",
"0.7455881",
"0.74439543",
"0.7372382",
"0.7274812",
"0.72515386",
"0.7130472",
"0.708064",
"0.7063466",
"0.6972831",
"0.6895466",
"0.6843173",
"0.6840718",
"0.67942894",
"0.67790097",
"0.6773353",
"0.6728839",
"0.6693149",
"0.6675066",
"0.6670323",
"0.664867",
... | 0.6957809 | 10 |
Returns the name of the device. | def name(self):
return self._name | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def name(self):\n return self._device.name",
"def name(self):\n return self._device.name",
"def name(self):\n return self._device.name",
"def name(self):\n return self.device.name()",
"def name(self):\n return f\"{get_device_name(self._data, 0, self._name)}\"",
"def nam... | [
"0.8953898",
"0.8953898",
"0.8953898",
"0.8888795",
"0.87647814",
"0.8677973",
"0.8656231",
"0.8642633",
"0.8642633",
"0.8527192",
"0.8527192",
"0.8502799",
"0.84858316",
"0.8457005",
"0.84082323",
"0.82633626",
"0.8255659",
"0.82379365",
"0.8133598",
"0.80842537",
"0.8068259... | 0.0 | -1 |
Duration of current playing media in seconds. | def media_duration(self):
if 'duration' in self._status:
return int(float(self._status['duration'])) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def media_duration(self):\n return self._table.active_track_total_time.total_seconds()",
"def media_duration(self):\n if (self._playing_localfile or self._playing_spotify or self._slave_mode or self._playing_mediabrowser or self._playing_mass) and self._state != STATE_UNAVAILABLE:\n retu... | [
"0.8430437",
"0.83350956",
"0.8319396",
"0.8277547",
"0.8222846",
"0.8074198",
"0.7930464",
"0.77950245",
"0.7728481",
"0.76677555",
"0.7623571",
"0.7617211",
"0.7516809",
"0.75139743",
"0.74583423",
"0.74476355",
"0.74476355",
"0.74476355",
"0.74476355",
"0.74476355",
"0.744... | 0.8223884 | 4 |
mute (true) or unmute (false) media player. | def mute_volume(self, mute):
mute_numeric = '1' if mute else '0'
self._lms.query(self._id, 'mixer', 'muting', mute_numeric)
self.update_ha_state() | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def mute():\n request_command(tv_command=TVCommand.mute)",
"def mute(self) -> bool:\n return bool(self.audio_mixer.getmute()[0])",
"async def set_mute(self, value: bool):\n await self._pytheos.api.player.set_mute(self.id, value)",
"def mute(self, value: bool) -> None:\n self.audio_mix... | [
"0.79038787",
"0.7827026",
"0.7726738",
"0.758196",
"0.7559455",
"0.75329906",
"0.75014323",
"0.7495204",
"0.7462061",
"0.7451629",
"0.7430995",
"0.7420074",
"0.74111503",
"0.7388469",
"0.7365407",
"0.7312141",
"0.7303691",
"0.72663677",
"0.72321564",
"0.72243595",
"0.7209028... | 0.73160547 | 15 |
turn the media player on. | def turn_on(self):
self._lms.query(self._id, 'power', '1')
self.update_ha_state() | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def media_play(self):\n self._state = STATE_PLAYING",
"def media_play(self):\n self._state = STATE_PLAYING",
"def turn_on(self) -> None:\n self._state = self._player.turn_on()",
"def turn_on(self) -> None:\n\n chromecast = self._get_chromecast()\n if not chromecast.is_idle:... | [
"0.74443585",
"0.74443585",
"0.73016983",
"0.7087575",
"0.70783293",
"0.6964901",
"0.68145245",
"0.6729235",
"0.67087793",
"0.67023337",
"0.66976917",
"0.66646045",
"0.6657361",
"0.65989614",
"0.65970445",
"0.6537041",
"0.6473687",
"0.6464411",
"0.645821",
"0.64446086",
"0.64... | 0.59280527 | 89 |
Computes the principal branch W_0(z) of the Lambert W function. | def _w0(z):
# Treat -1 / exp(1) separately as special.lambertw() suffers from numerical
# precision erros exactly at the boundary of z == exp(1)^(-1).
if isinstance(z, float) and np.abs(z - (-1. / np.exp(1.))) < 1e-9:
return -1.
# This is a complex valued return value.
return scipy_special.lambertw(z, k... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def w_DE(self, z):\n return self.w0+self.wa*z/(1.+z)",
"def project_L1(w, a):\n z = 1.0 / (a * a)\n if np.linalg.norm(w, 1) <= z:\n return w\n mu = -np.sort(-w)\n cs = np.cumsum(mu)\n rho = -1\n for j in range(len(w)):\n if mu[j] - (1.0 / (j + 1)) * (cs[j] - z) > 0:\n ... | [
"0.6321504",
"0.61060584",
"0.605185",
"0.6040656",
"0.6018995",
"0.60020334",
"0.59609735",
"0.5952679",
"0.59058553",
"0.5863454",
"0.5858252",
"0.58168644",
"0.58127844",
"0.58106387",
"0.57933074",
"0.5790801",
"0.5781062",
"0.57702035",
"0.5739269",
"0.573203",
"0.572829... | 0.7400969 | 0 |
Tests the approximation of the LambertW function. | def testLambertWApproxmiation(self, value):
exact = _w0(value)
value = tf.convert_to_tensor(value)
approx = tfp.math.lambertw_winitzki_approx(value)
self.assertAllClose(approx, exact, rtol=0.05) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def testLambertWKnownIdentities(self, value, expected):\n scipy_wz = _w0(value)\n value = tf.convert_to_tensor(value)\n self.assertAllClose(tfp.math.lambertw(value), expected)\n self.assertAllClose(tfp.math.lambertw(value), scipy_wz)",
"def testLambertWGradient(self, value, expected):\n x = tf.con... | [
"0.7580664",
"0.74156666",
"0.7329144",
"0.6524092",
"0.63733405",
"0.6208108",
"0.61809456",
"0.6174264",
"0.61529404",
"0.6127637",
"0.607613",
"0.6061438",
"0.60441244",
"0.5984336",
"0.59397197",
"0.59160805",
"0.5893355",
"0.58907866",
"0.585672",
"0.58308905",
"0.581220... | 0.813536 | 0 |
Test the courses string representation | def test_course_str(self):
course = models.Course.objects.create(
name='Office systems',
description='office systems',
category=models.Category.objects.create(
id=1
),
logo='someLogo',
contact=models.Contact.objects.create(... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_str_and_repr(self):\n pce = self._create_completed_program_course_enrollment()\n assert str(pce) == \"[ProgramCourseEnrollment id=1]\"\n # The course enrollment contains timestamp information,\n # so to avoid dealing with that, let's just test the parts of the repr()\n #... | [
"0.7474091",
"0.6729933",
"0.6489683",
"0.64799255",
"0.6413223",
"0.64059645",
"0.63883346",
"0.6331285",
"0.63292736",
"0.62608415",
"0.62328774",
"0.6230333",
"0.6117816",
"0.6113605",
"0.6071866",
"0.6062397",
"0.6043616",
"0.6021038",
"0.6016928",
"0.60042644",
"0.599271... | 0.73407423 | 1 |
Returns the number as a pretty number. i.e. 2,971,821,278 is returned as '2.97 GBytes' | def pretty_size(number):
float_bytes = float(number)
scale_factor = 0
while float_bytes >= 1000 and scale_factor < len(SCALE_UNITS) - 1:
scale_factor += 1
float_bytes /= 1000
return "{0:,.2f} {1:}Bytes".format(float_bytes, SCALE_UNITS[scale_factor]) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def format_num(num):\n return str(PmemHelpers.py3_round(num / 1024, 2)) + \" GB\"",
"def compact_number(value: int) -> str:\n value = float('{:.3g}'.format(value))\n magnitude = 0\n while abs(value) >= 1000:\n magnitude += 1\n value /= 1000.0\n return '{}{}'.format(\n '{:f... | [
"0.72205323",
"0.7069971",
"0.6771682",
"0.67487323",
"0.67319065",
"0.66436505",
"0.66285163",
"0.651859",
"0.65109146",
"0.64887613",
"0.6477504",
"0.64724046",
"0.64689654",
"0.6445454",
"0.64080465",
"0.6378966",
"0.63787633",
"0.6371047",
"0.63676316",
"0.6355433",
"0.63... | 0.69262886 | 2 |
The IP address range in the CIDR scheme. | def __init__(__self__, *,
address: Optional[pulumi.Input[str]] = None,
name: Optional[pulumi.Input[str]] = None,
subnet_prefix_length: Optional[pulumi.Input[int]] = None):
if address is not None:
pulumi.set(__self__, "address", address)
if n... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_ip_range(self):\n return self._ip_range",
"def get_local_address_range(self):\n return str(self.min_local_ip), str(self.max_local_ip)",
"def cidr(self):\n return self._cidr",
"def cidr(self) -> pulumi.Input[str]:\n return pulumi.get(self, \"cidr\")",
"def cidr(self) -> p... | [
"0.7735327",
"0.6893198",
"0.68366396",
"0.68269676",
"0.68269676",
"0.678918",
"0.678918",
"0.67885625",
"0.67885625",
"0.675582",
"0.6730095",
"0.6712136",
"0.66905975",
"0.6656267",
"0.66074497",
"0.65777427",
"0.6574144",
"0.6574144",
"0.6566463",
"0.6512474",
"0.64769727... | 0.0 | -1 |
The encoding preset name. This value is specified at creation time and cannot be updated. | def preset_name(self) -> Optional[pulumi.Input[str]]:
return pulumi.get(self, "preset_name") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def preset_mode(self) -> str | None:\n state = self._state\n return state.custom_preset or _PRESETS.from_esphome(\n state.preset_compat(self._api_version)\n )",
"def preset_mode(self) -> Optional[str]:\n return self._preset",
"def codec(self):\n codec_name = None\n... | [
"0.6892625",
"0.67337835",
"0.6288014",
"0.6118686",
"0.60646117",
"0.6062096",
"0.5988804",
"0.5964738",
"0.5964738",
"0.59248835",
"0.59235173",
"0.5891426",
"0.5876386",
"0.5861859",
"0.5772118",
"0.57616353",
"0.5710838",
"0.5679361",
"0.55716777",
"0.55446255",
"0.545735... | 0.7768891 | 0 |
ISO 8601 timespan duration of the key frame interval duration. | def key_frame_interval_duration(self) -> Optional[pulumi.Input[str]]:
return pulumi.get(self, "key_frame_interval_duration") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def half_duration(self):\n if self._interval is not None:\n a, b = self._interval\n return (b - a) * .5\n else:\n return self.interval_duration * .5",
"def window_duration(self) -> float:\n return min(self.max_duration, pytimeparse.parse(str(self.slo.config.d... | [
"0.6305337",
"0.62587285",
"0.6207755",
"0.61459064",
"0.60831195",
"0.60538447",
"0.60359234",
"0.599413",
"0.5984428",
"0.58736426",
"0.58653736",
"0.58653736",
"0.58601606",
"0.5856649",
"0.58458495",
"0.5821064",
"0.58059514",
"0.58055615",
"0.57883656",
"0.5784583",
"0.5... | 0.7275632 | 0 |
The output track name. | def track_name(self) -> pulumi.Input[str]:
return pulumi.get(self, "track_name") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def name(self):\n return self._output_name",
"def output_name(self) -> str:\n return jsii.get(self, \"outputName\")",
"def full_name(self):\n return \"output.%s\" % self.name",
"def _get_track_name(self, filename):\n return os.path.basename(filename)",
"def getName(self):\n ... | [
"0.7638152",
"0.7323133",
"0.7310847",
"0.7233535",
"0.69460213",
"0.6831797",
"0.68302023",
"0.6814678",
"0.6770369",
"0.6725864",
"0.6720688",
"0.6644239",
"0.6644239",
"0.6644239",
"0.6644239",
"0.6644239",
"0.6644239",
"0.6644239",
"0.6644239",
"0.6644239",
"0.6644239",
... | 0.7996617 | 0 |
The identifier of the preview locator in Guid format. Specifying this at creation time allows the caller to know the preview locator url before the event is created. If omitted, the service will generate a random identifier. This value cannot be updated once the live event is created. | def preview_locator(self) -> Optional[pulumi.Input[str]]:
return pulumi.get(self, "preview_locator") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def unique_id(self):\n return f\"{DOMAIN}_{self._name}_camera\"",
"def link_id(self):\n return uuid.uuid4().hex",
"def unique_id(self):\n return f\"{DOMAIN}_{self._cam_name}_{self._obj_name}_snapshot\"",
"def unique_id(self) -> str:\n return get_frigate_entity_unique_id(\n ... | [
"0.623951",
"0.6227885",
"0.6193714",
"0.61325794",
"0.61180764",
"0.6043522",
"0.60363317",
"0.5952569",
"0.59312534",
"0.5909744",
"0.5909744",
"0.5904929",
"0.5878489",
"0.5861216",
"0.5837863",
"0.58257705",
"0.57966846",
"0.5790659",
"0.5781632",
"0.5778037",
"0.5769865"... | 0.6173725 | 3 |
The name of streaming policy used for the LiveEvent preview. This value is specified at creation time and cannot be updated. | def streaming_policy_name(self) -> Optional[pulumi.Input[str]]:
return pulumi.get(self, "streaming_policy_name") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def policy_name(self):\n return self._policy_name",
"def policy_name(self) -> Optional[str]:\n return pulumi.get(self, \"policy_name\")",
"def policy_name(self) -> Optional[str]:\n return pulumi.get(self, \"policy_name\")",
"def policy_name(self) -> pulumi.Input[str]:\n return pul... | [
"0.71497774",
"0.69299406",
"0.69299406",
"0.6834202",
"0.6834202",
"0.6834202",
"0.6834202",
"0.6834202",
"0.6834202",
"0.6834202",
"0.675502",
"0.6750331",
"0.674577",
"0.6434261",
"0.6376393",
"0.62645596",
"0.62645596",
"0.6167344",
"0.6167344",
"0.6167344",
"0.61572564",... | 0.82607937 | 0 |
Public method to set the start and end points of the line. | def setPoints(self, xa, ya, xb, yb):
self._origin = QPointF(xa, ya)
self._end = QPointF(xb, yb) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def setEndPoint(self, x, y):\n self._end = QPointF(x, y)",
"def set_start(self, start_line):\n self.__start_line = start_line",
"def __init__(self, start, end, oldLine = None):\n self.__start = start\n self.__end = end\n if(self.__start == self.__end):\n \"\"\"\n ... | [
"0.7010528",
"0.68627",
"0.6831736",
"0.68200016",
"0.6792651",
"0.67842644",
"0.6672764",
"0.6634873",
"0.6613768",
"0.661266",
"0.660819",
"0.65821135",
"0.65693235",
"0.6486703",
"0.6464205",
"0.6451329",
"0.64396",
"0.64208204",
"0.6411727",
"0.64063805",
"0.63656014",
... | 0.6743921 | 6 |
return true if given owner_type is a part of type list Approved list may include owners prefix or/and full owner names | def is_port_owner_of_type(owner_type, type_list):
for sub_type in type_list:
if sub_type in owner_type:
return True
return False | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def items_should_contain_owner_object(context):\n items = context.response.json()['items']\n existing_owner_fields = [\n 'accept_rate', 'display_name', 'link', 'profile_image', 'reputation',\n 'user_id', 'user_type'\n ]\n non_existing_owner_fields = ['display_name', 'user_type']\n\n fo... | [
"0.56557274",
"0.5556847",
"0.54887503",
"0.5434244",
"0.53741854",
"0.53553694",
"0.5339122",
"0.5328851",
"0.5323509",
"0.5273833",
"0.5273501",
"0.52484",
"0.5240438",
"0.517371",
"0.5151953",
"0.51370883",
"0.5132961",
"0.5128176",
"0.5123485",
"0.510547",
"0.5098587",
... | 0.6952755 | 0 |
A samtoolsstyle region string. | def region_str(self):
return "%s:%s-%s" % (self.seqid, self.start, self.end) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def region(self):\n # type: () -> string_types\n return self._region",
"def region(self) -> str:\n return self.__region",
"def region(self) -> pulumi.Output[str]:\n return pulumi.get(self, \"region\")",
"def region(self) -> pulumi.Output[str]:\n return pulumi.get(self, \"re... | [
"0.7144861",
"0.71290696",
"0.7092565",
"0.7092565",
"0.7092565",
"0.7092565",
"0.7092565",
"0.7092565",
"0.7014297",
"0.7014297",
"0.7014297",
"0.7014297",
"0.7014297",
"0.7014297",
"0.6992264",
"0.6812229",
"0.6812229",
"0.6812229",
"0.6766495",
"0.66514283",
"0.66052777",
... | 0.7974678 | 0 |
Parse a Fortran variable declaration line and return a list of Var objects representing the variables declared on . | def parse_fortran_var_decl(line, source, logger=None):
########################################################################
context = source.context
sline = line.strip()
# Strip comments first
if '!' in sline:
sline = sline[0:sline.index('!')].rstrip()
# End if
tobject = Ftype_factor... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def parseVars(fp):\n\n try:\n ln = fp.readline()\n p = re.compile(r'^Variaveis\\s*(?:#.*)?$')\n m = p.match(ln)\n if m == None:\n raise ParseError(ParseError.rnamesMsg)\n\n ln = fp.readline()\n p = re.compile(r'^\\{\\s*(.*)\\s*\\}\\s*(?:#.*)?$')\n m = ... | [
"0.7123143",
"0.6825857",
"0.66069865",
"0.6567656",
"0.6517356",
"0.65036553",
"0.64374137",
"0.63672733",
"0.6318817",
"0.6225102",
"0.6223774",
"0.6223089",
"0.620743",
"0.6186204",
"0.61861557",
"0.61418307",
"0.6137256",
"0.6129909",
"0.61197627",
"0.6115155",
"0.6037952... | 0.81169283 | 0 |
Append the value to the default in append mode. | def append(self, option, value):
default = self.defaults.get(option.dest)
if value is None or default is None:
return value
if option.type == "string" and not value.startswith(","):
value = "," + value
return default + value | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def append_value(self, value):\n self.value += value",
"def append(self, val):\n self.val.append(val)",
"def append(self, value):\n self.data.append(None)\n self.data[len(self.data)-1] = value",
"def append(self, value):\n self.values.append(value)\n return value",
... | [
"0.6652476",
"0.64158446",
"0.62320656",
"0.6200175",
"0.61405873",
"0.6038013",
"0.5963938",
"0.5860349",
"0.58539677",
"0.5817073",
"0.5689977",
"0.56889176",
"0.5657187",
"0.55895734",
"0.5574269",
"0.5573205",
"0.5564398",
"0.5521759",
"0.5513076",
"0.5437002",
"0.5422588... | 0.69364935 | 0 |
Subtract the value from the default in subtract mode. | def subtract(self, option, value):
default = self.defaults.get(option.dest)
if value is None or default is None:
return value
if option.type == "string" and not value.startswith(","):
default = set(default.split(","))
value = set(value.split(","))
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def subtract(self, value):\n return self.number - value",
"def subtract(val, otherval=None):\n if otherval is None:\n return val\n\n try:\n answer = val - int(otherval)\n return answer\n except ValueError:\n return val",
"def subtract(self):\n return self.... | [
"0.6985783",
"0.670144",
"0.6471347",
"0.6471347",
"0.6471347",
"0.6437797",
"0.6326257",
"0.63254285",
"0.6166896",
"0.6150405",
"0.613621",
"0.61225915",
"0.60861963",
"0.6084109",
"0.60716033",
"0.60692877",
"0.6018418",
"0.60144895",
"0.60000366",
"0.59950745",
"0.5992453... | 0.69274414 | 1 |
Lemmatizing words based on their POS tag | def lemmatize_tagged_words(tagged_words):
wordnet_lemmatizer = WordNetLemmatizer()
lemmed_words = []
for token in tagged_words:
tokenStr = str(token[1])
word_pos = get_wordnet_pos(tokenStr)
lemmed_words.append(wordnet_lemmatizer.lemmatize(token[0], word_pos))
return lemmed_words | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def lemmatize(token, pos_tag):\n lemmatizer = TextPreprocessor.LEMMATIZER\n return lemmatizer.lemmatize(token, pos_tag)",
"def lemmatisation(tokens):\n pos_tag = nltk.pos_tag(tokens)\n lemmatiser = nltk.WordNetLemmatizer()\n wornet_tags = {\"J\": wordnet.ADJ, \"N\": wordnet.NOUN, \"V\": wo... | [
"0.7673262",
"0.7467335",
"0.74575996",
"0.7307582",
"0.7282423",
"0.7265623",
"0.721458",
"0.7206695",
"0.71687704",
"0.7162845",
"0.7138664",
"0.70982724",
"0.7052242",
"0.7038138",
"0.6989637",
"0.69493264",
"0.69103557",
"0.6900645",
"0.689828",
"0.6885235",
"0.68728185",... | 0.7087549 | 12 |
Remove all forms of url from text | def url_removal(text):
return re.sub(r'''(?i)\b((?:https?://|www\d{0,3}[.]|[a-z0-9.\-]+[.][a-z]\
{2,4}/)(?:[^\s()<>]+|\(([^\s()<>]+|(\([^\s()<>]+\)))*\))+(?:\(([^\s()<>]\
+|(\([^\s()<>]+\)))*\)|[^\s`!()\[\]{};:'".,<>?«»“”‘’]))''', '', text) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def remove_urls(self, text):\n return re.sub(r'http.?://[^\\s]+[\\s]?', '', text)",
"def remove_url(txt):\n\n return \" \".join(re.sub(\"([^0-9A-Za-z \\t])|(\\w+:\\/\\/\\S+)\", \"\", txt).split())",
"def remove_url(txt):\n\n return \" \".join(re.sub(\"([^0-9A-Za-z \\t])|(\\w+:\\/\\/\\S+)\", \"\",... | [
"0.853861",
"0.84962195",
"0.8431622",
"0.842742",
"0.84144205",
"0.8387463",
"0.8353455",
"0.8303272",
"0.8183877",
"0.8113611",
"0.79882824",
"0.7896764",
"0.76951164",
"0.76161957",
"0.75862634",
"0.75818574",
"0.74817795",
"0.7425046",
"0.7409076",
"0.7246712",
"0.7150767... | 0.8136083 | 9 |
Remove stopword from list of tagged words | def stopword_removal_from_taggedwords(tagged_words):
stops = set(stopwords.words('english'))
tagged_words = [w for w in tagged_words if not w[0] in stops]
return tagged_words | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def remove_stopwords_fun(self):\n tokens = str(self.doc).split()\n cleaned_tokens = [token for token in tokens\n if token.lower() not in self.stopword_list]\n self.doc = ' '.join(cleaned_tokens)",
"def remove_stopwords(words):\n new_words = []\n for word in wor... | [
"0.81069314",
"0.79780436",
"0.7960596",
"0.78395855",
"0.7834491",
"0.7776065",
"0.76990324",
"0.7679836",
"0.7657716",
"0.76565593",
"0.76565593",
"0.76565593",
"0.76565593",
"0.76397294",
"0.7637587",
"0.76305836",
"0.76238376",
"0.7618848",
"0.76150966",
"0.7596808",
"0.7... | 0.8644507 | 0 |
Remove stopword from list of words | def stopword_removal(words):
stops = set(stopwords.words('english'))
words = [w for w in words if w not in stops]
return words | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def remove_stopwords_fun(self):\n tokens = str(self.doc).split()\n cleaned_tokens = [token for token in tokens\n if token.lower() not in self.stopword_list]\n self.doc = ' '.join(cleaned_tokens)",
"def remove_stopwords(words):\n new_words = []\n for word in wor... | [
"0.8678259",
"0.8677832",
"0.8487351",
"0.8397406",
"0.83695227",
"0.83473504",
"0.8310459",
"0.829706",
"0.82802165",
"0.8270351",
"0.8270351",
"0.8270351",
"0.8270351",
"0.8235899",
"0.8232217",
"0.8228195",
"0.82244295",
"0.8208495",
"0.8205208",
"0.8174243",
"0.81445575",... | 0.85623884 | 2 |
Function to convert a text document to a sequence of words. 1. [Optional] remove urls and html markups 2. [Optional] remove nonletter characters 3. [Optional] convert text to lowercase 4. Split text into list of words 5. Tag words with Part of Speech (POS) 6. [Optional] remove stopwords 7. [Optional] lemmatize the word... | def text_to_wordlist(text, remove_html_related=True, remove_non_letter=True,
to_lowercase=True, remove_stopwords=False, use_lem=False):
if remove_html_related:
text = url_removal(text)
# Remove HTML using BeautifulSoup
text = BeautifulSoup(text, 'lxml').get_text()
#... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def text_to_corpus(text, accented_chars=True,\n convert_num=True, extra_whitespace=True, \n lemmatization=True, lowercase=True, punctuations=True,\n remove_html=True, remove_num=True, special_chars=True, \n stop_words=True): \n \n\n \"... | [
"0.7869229",
"0.71740586",
"0.7147658",
"0.69338405",
"0.68859154",
"0.68182284",
"0.6780607",
"0.6776372",
"0.67494184",
"0.673519",
"0.67217404",
"0.67196584",
"0.6699143",
"0.6680851",
"0.6635146",
"0.6627868",
"0.66019917",
"0.6599758",
"0.6598231",
"0.6582368",
"0.658051... | 0.7101023 | 3 |
Function to split a text into parsed sentences 1. [Optional] remove urls and html markups 2. Use the NLTK tokenizer to split the paragraph into sentences 3. For each sentence, call text_to_wordlist | def text_to_sentences(text, tokenizer, remove_html_related=True,
remove_non_letter=True, to_lowercase=True,
remove_stopwords=False, use_lem=False):
# Function to split a text into parsed sentences.
# Returns a list of sentences, where each sentence is a list of words
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def split(text):\n doc = nlp(text)\n sentences = [x.text_with_ws for x in doc.sents]\n return sentences",
"def split_sentences(text):\n # sentence_delimiters = re.compile(r'(?<!\\w\\.\\w.)(?<![A-Z][a-z]\\.)(?<=\\.|\\?)\\s')\n # sentences = sentence_delimiters.split(text)\n sentences... | [
"0.80741143",
"0.791229",
"0.7724805",
"0.7580235",
"0.7507237",
"0.744146",
"0.7362008",
"0.735591",
"0.7330652",
"0.7263298",
"0.7227417",
"0.7170323",
"0.7159727",
"0.7083676",
"0.7063462",
"0.70547885",
"0.7050716",
"0.70208097",
"0.7014157",
"0.69933",
"0.69706774",
"0... | 0.7819128 | 2 |
Function to cparse a text to a string of words Simply call text_to_wordlist then join all the words to a string | def text_to_words(text, remove_html_related=True, remove_non_letter=True,
to_lowercase=True, remove_stopwords=False, use_lem=False):
(words, tagged_words) = text_to_wordlist(text,
remove_html_related,
remove_... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def txt_to_word_list(text):\r\n return [w for w in text.split()]",
"def _get_word_list(text):\n return re.findall('\\w+', text)",
"def get_words(text):\n return re.compile('\\w+').findall(text)",
"def text_to_words(the_text):\n\n my_substitutions = the_text.maketrans(\n # If you find any of ... | [
"0.7974603",
"0.74149823",
"0.7244185",
"0.7153732",
"0.7153732",
"0.7115066",
"0.7109555",
"0.708922",
"0.7050829",
"0.69429964",
"0.69051504",
"0.6903048",
"0.682321",
"0.6817025",
"0.6807829",
"0.68036824",
"0.6799253",
"0.6784438",
"0.67705953",
"0.6747924",
"0.67470837",... | 0.7083673 | 8 |
r"""Apply nonmaximum suppression to input. The output will be sorted in descending order according to `score`. Boxes with overlaps larger than `overlap_thresh` and smaller scores will be removed and filled with 1, the corresponding position will be recorded for backward propogation. During backpropagation, the gradient... | def box_nms(data=None, overlap_thresh=_Null, topk=_Null, coord_start=_Null, score_index=_Null, id_index=_Null, force_suppress=_Null, in_format=_Null, out_format=_Null, out=None, name=None, **kwargs):
return (0,) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def box_non_maximum_suppression(data=None, overlap_thresh=_Null, topk=_Null, coord_start=_Null, score_index=_Null, id_index=_Null, force_suppress=_Null, in_format=_Null, out_format=_Null, out=None, name=None, **kwargs):\n return (0,)",
"def apply_non_max_suppression(boxes, scores, iou_thresh=.45, top_k=200):\... | [
"0.698738",
"0.6653693",
"0.66151094",
"0.63676256",
"0.6327279",
"0.62539196",
"0.61798346",
"0.6095488",
"0.600345",
"0.59958696",
"0.59296393",
"0.5881307",
"0.58444506",
"0.58285594",
"0.5740606",
"0.57039136",
"0.57007617",
"0.5682835",
"0.5569186",
"0.5532014",
"0.55175... | 0.5335969 | 32 |
r"""Apply nonmaximum suppression to input. The output will be sorted in descending order according to `score`. Boxes with overlaps larger than `overlap_thresh` and smaller scores will be removed and filled with 1, the corresponding position will be recorded for backward propogation. During backpropagation, the gradient... | def box_non_maximum_suppression(data=None, overlap_thresh=_Null, topk=_Null, coord_start=_Null, score_index=_Null, id_index=_Null, force_suppress=_Null, in_format=_Null, out_format=_Null, out=None, name=None, **kwargs):
return (0,) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def apply_non_max_suppression(boxes, scores, iou_thresh=.45, top_k=200):\n\n selected_indices = np.zeros(shape=len(scores))\n if boxes is None or len(boxes) == 0:\n return selected_indices\n x_min = boxes[:, 0]\n y_min = boxes[:, 1]\n x_max = boxes[:, 2]\n y_max = boxes[:, 3]\n areas = ... | [
"0.6653628",
"0.6615353",
"0.63678175",
"0.6326423",
"0.6253104",
"0.61789644",
"0.6097067",
"0.6003441",
"0.59952044",
"0.59316695",
"0.5883134",
"0.58453053",
"0.58264285",
"0.5742013",
"0.57033294",
"0.5702934",
"0.56823313",
"0.55691516",
"0.5532944",
"0.55167705",
"0.550... | 0.698872 | 0 |
r"""Quantize a input tensor from float to `out_type`, with userspecified `min_range` and `max_range`. [min_range, max_range] are scalar floats that spcify the range for | def quantize(input=None, min_range=None, max_range=None, out_type=_Null, out=None, name=None, **kwargs):
return (0,) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def fake_quant_with_min_max_vars_per_channel(input_data, input_min, input_max, num_bits=8, narrow_range=False):\n\n # get shape and check\n shape_inputs = get_shape(input_data)\n shape_min = get_shape(input_min)\n shape_max = get_shape(input_max)\n utils.elemwise_shape_check(shape_min, shape_max)\n ... | [
"0.64175385",
"0.63953936",
"0.5781781",
"0.5659914",
"0.5628652",
"0.547455",
"0.547455",
"0.54714906",
"0.5403918",
"0.5397043",
"0.5370309",
"0.52955306",
"0.5262761",
"0.52312845",
"0.5217996",
"0.52127427",
"0.5208973",
"0.52033246",
"0.5125996",
"0.5111679",
"0.50456834... | 0.7950404 | 0 |
go to home page | def seeHome(self, waitFor=0):
print ("seeHome")
self.driver.get(self.base_url)
time.sleep(waitFor) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def go_home(self):\r\n if self.home_url is not None:\r\n self.set_url(self.home_url)",
"def home(self):\n self.goto(0, 0)",
"def go_home(request):\n\n url = request.route_url('home', _app_url=get_app_url(request))\n return HTTPFound(location=url)",
"def go_to_home_page():\n ... | [
"0.8196084",
"0.8010585",
"0.78844774",
"0.77969044",
"0.7792258",
"0.7769329",
"0.7769329",
"0.7727629",
"0.7683297",
"0.7655845",
"0.7655103",
"0.74710375",
"0.7449792",
"0.7370409",
"0.7333565",
"0.73165864",
"0.7283202",
"0.727773",
"0.727773",
"0.727773",
"0.7265415",
... | 0.0 | -1 |
Initialize the stack with an optional initial array. | def __init__(self, initial_arr=[]):
self.arr = initial_arr
self.size = len(self.arr) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __init__(self, initial=[]):\n self.the_stack = copy.copy(initial)",
"def __init__(self):\n self.data = ArrayStack(10)",
"def __init__(self):\n \n self.stack = [];\n self.min = None;",
"def create(self):\n if self.size == 0:\n self.size = int(input(\"En... | [
"0.68169117",
"0.66922873",
"0.65461093",
"0.6391502",
"0.62785435",
"0.61517847",
"0.61413175",
"0.6140859",
"0.60995626",
"0.6071202",
"0.6053537",
"0.60435086",
"0.6022193",
"0.6021856",
"0.60196346",
"0.60151064",
"0.60140103",
"0.60041255",
"0.59821624",
"0.5956865",
"0.... | 0.6281562 | 4 |
Returns whether the stack is empty. | def is_empty(self):
return self.size == 0 | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def is_empty(self):\n return len(self.the_stack) == 0",
"def is_empty(self):\n return len(self.stack) == 0",
"def empty(self) -> bool:\n return len(self.stack) == 0",
"def isEmpty(self):\n return len(self.stack) == 0",
"def empty(self):\n return len(self.stack) == 0",
"... | [
"0.9207258",
"0.91276956",
"0.90185934",
"0.9000551",
"0.89481044",
"0.89481044",
"0.8914844",
"0.8904091",
"0.8881541",
"0.88791907",
"0.8867761",
"0.87955654",
"0.8768181",
"0.8748518",
"0.87393755",
"0.8728073",
"0.8719241",
"0.87090814",
"0.87090814",
"0.85431594",
"0.850... | 0.7618219 | 84 |
Returns the top of the stack, without popping it. | def top(self):
return self.arr[-1] | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def top(self):\n if self.stack == []:\n return None\n return self.stack[-1]",
"def top(self):\n if self.stack:\n return self.stack[-1]\n raise ValueError",
"def top(stack):\n if empty_stack(stack):\n raise IndexError(\"Stack is empty!\")\n else:\n ... | [
"0.872368",
"0.8543128",
"0.84303164",
"0.83613914",
"0.8358929",
"0.81730795",
"0.81565326",
"0.81459594",
"0.813695",
"0.813695",
"0.81307876",
"0.8114976",
"0.8103422",
"0.8071567",
"0.8063605",
"0.79831505",
"0.7940744",
"0.7940561",
"0.7841507",
"0.78313196",
"0.77826154... | 0.6720479 | 98 |
This property return and set the name of the control | def name(self, value):
self.form.setObjectName(value) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def name(self, name):\n return self.name",
"def setName(self, name):\n\t\tself.label.setText(name)",
"def name(self, name):\n\n return self.name",
"def _build_name(self):\n self.ctrl_name = NameUtils.get_unique_name(self.asset,\n self.sid... | [
"0.70066977",
"0.69573003",
"0.69243085",
"0.6907456",
"0.68773085",
"0.6874144",
"0.6831195",
"0.6817226",
"0.6778645",
"0.6778645",
"0.6778645",
"0.6774971",
"0.6751658",
"0.6708743",
"0.67084897",
"0.6702504",
"0.6702504",
"0.6702504",
"0.6702504",
"0.6689204",
"0.6681061"... | 0.7720451 | 0 |
Returns IDS for tokenized text | def get_ids(self, text):
tokens = [token.orth for token in self.tokenizer(text)]
ids = []
for token in tokens:
try:
id = self._vocab.vectors.key2row[token]
except KeyError:
id = self.oov_id
ids.append(id)
return ids | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_ids(cls, text):\n tokens = TokenizerContainer.TOKENIZER.tokenize(text)\n token_ids = TokenizerContainer.TOKENIZER.convert_tokens_to_ids(tokens)\n input_ids = token_ids + [0] * (cls.MAX_LEN-len(token_ids))\n return tokens, input_ids",
"def get_ids(self, text):\n\n tokens... | [
"0.8190661",
"0.78699213",
"0.7717034",
"0.7155416",
"0.7136169",
"0.7115929",
"0.7016006",
"0.69986427",
"0.6958998",
"0.6902399",
"0.6895608",
"0.6883649",
"0.6879544",
"0.6834638",
"0.68314797",
"0.6776832",
"0.67077386",
"0.67036253",
"0.6612313",
"0.66102",
"0.65904737",... | 0.7803446 | 2 |
add_vertex add vertex to graph's vertices if there is not other vertex with same id | def add_vertex(self, vertex):
if vertex.id not in self.vertices.keys():
self.vertices[vertex.id] = vertex | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def add_vertex(self, vertex_id): # O(1) time complexity\n self.vertices[vertex_id] = set() \n\n # additional options (class)\n '''\n if vertex_id not in self.vertices:\n self.vertices[vertex_id] = {}\n\n else:\n return \"Vertex is already in Graph\"\... | [
"0.858405",
"0.8393133",
"0.83201754",
"0.8280701",
"0.8274728",
"0.8153364",
"0.81434816",
"0.81434816",
"0.81434816",
"0.81434816",
"0.7952165",
"0.7950935",
"0.77145684",
"0.76846874",
"0.76662445",
"0.76662445",
"0.7569469",
"0.7479635",
"0.74553406",
"0.74151415",
"0.736... | 0.83325845 | 2 |
Add edge to source edges if there is no other edge with same source and target | def add_edge(self, edge, directed=False, auto=False):
(v1, v2) = edge.get_id()
if v1 in self.vertices.keys() and v2 in self.vertices.keys():
if directed:
if auto:
self.edges[edge.get_id()] = edge
else:
if v1 != v2:
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _append_source_and_target(self, graph):\n graph.add_node( \"source\" )\n graph.add_node( \"target\" )\n \n for leave in (n for n,d in graph.out_degree_iter() if d==0):\n if leave is not \"source\" and leave is not \"target\":\n graph.add_edge( leave, \"targ... | [
"0.7390725",
"0.7377863",
"0.7355607",
"0.71085644",
"0.7099892",
"0.6990844",
"0.6965541",
"0.6944537",
"0.6836359",
"0.6739404",
"0.6729934",
"0.6707287",
"0.66616774",
"0.66508",
"0.6623038",
"0.66080207",
"0.66016793",
"0.6533456",
"0.6471978",
"0.64500767",
"0.6368295",
... | 0.0 | -1 |
Method to return the path as MEDIA_ROOT//filename | def questionDirectoryPath(instance, filename):
return "phanluot/{}/{}".format(instance.questionID, filename) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def full_path(self):\n return os.path.join(settings.MEDIA_ROOT, self.path)",
"def get_media_path(self, filename):\n return join(settings.CMS_PAGE_MEDIA_PATH, \"%d\" % self.id, filename)",
"def file_path(self, request, response=None, info=None):\n url = request.url\n media_guid = has... | [
"0.7960551",
"0.7510529",
"0.737149",
"0.7355144",
"0.7166454",
"0.7154108",
"0.7092798",
"0.708826",
"0.7053925",
"0.7034147",
"0.7020586",
"0.70186085",
"0.69583243",
"0.6943425",
"0.691107",
"0.6907448",
"0.6849383",
"0.6834726",
"0.68125516",
"0.67965156",
"0.6767675",
... | 0.0 | -1 |
Compare two lists without taking the order into consideration | def checkLists(self, l1, l2):
self.assertListEqual(sorted(l1), sorted(l2)) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def compare_lists(self, list1, list2):\n matching_items = []\n\n list1 = list1.copy()\n list2 = list2.copy()\n\n for item in list1:\n if item in list2:\n matching_items.append(item)\n\n for m in matching_items:\n for c in range(list1.count(m))... | [
"0.7628443",
"0.72834605",
"0.72683793",
"0.7195924",
"0.70293605",
"0.6941735",
"0.69215536",
"0.6905223",
"0.6828773",
"0.68057007",
"0.6803519",
"0.67878985",
"0.6742826",
"0.67348975",
"0.6726726",
"0.6709742",
"0.6694492",
"0.66872334",
"0.66866904",
"0.66778636",
"0.667... | 0.7087442 | 4 |
Initialises and plots figure. | def __init__(self, dat, frame, box_size, centre,
arrow_width=_arrow_width,
arrow_head_width=_arrow_head_width,
arrow_head_length=_arrow_head_length,
pad=_colormap_label_pad,
label=False, **kwargs):
super().__init__(dat, frame, box_size, centre,
arrow_width=ar... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _setup_plot(x: float, y: float) -> plt.figure:\n LOG.debug(\"Initializing plot.\")\n plt.ion()\n fig = plt.figure(figsize=(x, y), num=\"GlacierFlowModel\")\n fig.patch.set_facecolor(\"black\")\n return fig",
"def init_plot(self):\n self.dpi = 100\n self.fig = ... | [
"0.8165424",
"0.80349463",
"0.7848055",
"0.78003544",
"0.7565268",
"0.7397783",
"0.73798895",
"0.73665226",
"0.7346693",
"0.7346693",
"0.72906274",
"0.7215201",
"0.7176519",
"0.7152798",
"0.7118978",
"0.711853",
"0.70984125",
"0.70891875",
"0.7084235",
"0.7079322",
"0.7056446... | 0.0 | -1 |
Initialises and plots figure. | def __init__(self, dat, frame, box_size, centre,
arrow_width=_arrow_width,
arrow_head_width=_arrow_head_width,
arrow_head_length=_arrow_head_length,
pad=_colormap_label_pad, dt=1,jump=1,
label=False, **kwargs):
super().__init__(dat, frame, box_size, centre,
a... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _setup_plot(x: float, y: float) -> plt.figure:\n LOG.debug(\"Initializing plot.\")\n plt.ion()\n fig = plt.figure(figsize=(x, y), num=\"GlacierFlowModel\")\n fig.patch.set_facecolor(\"black\")\n return fig",
"def init_plot(self):\n self.dpi = 100\n self.fig = ... | [
"0.8165424",
"0.80349463",
"0.7848055",
"0.78003544",
"0.7565268",
"0.7397783",
"0.73798895",
"0.73665226",
"0.7346693",
"0.7346693",
"0.72906274",
"0.7215201",
"0.7176519",
"0.7152798",
"0.7118978",
"0.711853",
"0.70984125",
"0.70891875",
"0.7084235",
"0.7079322",
"0.7056446... | 0.0 | -1 |
Initialises and plots figure. | def __init__(self, dat, frame, box_size, centre,
arrow_width=_arrow_width,
arrow_head_width=_arrow_head_width,
arrow_head_length=_arrow_head_length,
pad=_colormap_label_pad,
label=False, **kwargs):
super().__init__(dat, frame, box_size, centre,
arrow_width=ar... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _setup_plot(x: float, y: float) -> plt.figure:\n LOG.debug(\"Initializing plot.\")\n plt.ion()\n fig = plt.figure(figsize=(x, y), num=\"GlacierFlowModel\")\n fig.patch.set_facecolor(\"black\")\n return fig",
"def init_plot(self):\n self.dpi = 100\n self.fig = ... | [
"0.8165424",
"0.80349463",
"0.7848055",
"0.78003544",
"0.7565268",
"0.7397783",
"0.73798895",
"0.73665226",
"0.7346693",
"0.7346693",
"0.72906274",
"0.7215201",
"0.7176519",
"0.7152798",
"0.7118978",
"0.711853",
"0.70984125",
"0.70891875",
"0.7084235",
"0.7079322",
"0.7056446... | 0.0 | -1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.