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 |
|---|---|---|---|---|---|---|
Given the id of an image, return the image and the corresponding confidence maps and the parts affinity fields. | def __getitem__(self, idx):
# Get a specific image id from the list of image ids.
img_index = self.img_indices[idx]
# Load the image
img_name = os.path.join(self.img_dir, get_image_name(img_index))
img = cv2.imread(img_name).transpose(1, 0, 2)/255
original... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _get_annotation(self, image_id):\n annotation_file = self.image_sets_dir / f'{image_id}.xml'\n objects = ET.parse(annotation_file).findall('object')\n boxes = []\n labels = []\n is_difficult = []\n for obj in objects:\n class_name = obj.find('name').text.low... | [
"0.6299146",
"0.6093956",
"0.60191196",
"0.60121113",
"0.59690326",
"0.5941114",
"0.58664304",
"0.58652186",
"0.5772321",
"0.5732799",
"0.5696221",
"0.56892323",
"0.5653866",
"0.5650987",
"0.56138176",
"0.5601995",
"0.5597743",
"0.5572222",
"0.5568251",
"0.5546608",
"0.552037... | 0.0 | -1 |
Converts a number to raindrops.. If it is a factor of 3, 5 or 7. Returns the number if it is not a factor. | def convert(number: int) -> str:
sounds = [(3, "Pling"), (5, "Plang"), (7, "Plong")]
result = [sound for divisor, sound in sounds if number % divisor == 0]
return "".join(result) or f"{number}" | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def rof(number):\n\n return round(number * 2) / 2",
"def rounddown(number):\n\n # Return the answer\n return math.floor(number)",
"def radicale(n):\n r = 1\n for p in primi(n+1):\n if p>n:\n break\n if n%p==0:\n r *= p\n n = n//p\n return r",... | [
"0.6595456",
"0.6485929",
"0.57271487",
"0.55308765",
"0.55007154",
"0.54595137",
"0.5454034",
"0.5449595",
"0.54256505",
"0.54254377",
"0.5363342",
"0.5357585",
"0.5308972",
"0.53020155",
"0.5272639",
"0.5270034",
"0.5247558",
"0.5231972",
"0.5230555",
"0.5228767",
"0.522667... | 0.0 | -1 |
Helper function to convert the GPS coordinates stored in the EXIF to degress in float format | def _convert_to_degress(self, value):
d = float(value.values[0].num) / float(value.values[0].den)
m = float(value.values[1].num) / float(value.values[1].den)
s = float(value.values[2].num) / float(value.values[2].den)
return d + (m / 60.0) + (s / 3600.0) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def points2float(gpx_track):\n \n points = np.empty([gpx_track.get_points_no(), 2])\n elevation = np.empty([gpx_track.get_points_no(), 1])\n n = 0\n for segment in gpx_track.segments:\n for point in segment.points:\n points[n, 0] = point.longitude\n points[n, 1] = point.... | [
"0.6406915",
"0.6319931",
"0.6221876",
"0.6214761",
"0.61687136",
"0.6155302",
"0.61133623",
"0.5993817",
"0.5936768",
"0.59306395",
"0.5844533",
"0.5819735",
"0.5801073",
"0.5728349",
"0.572484",
"0.5718356",
"0.5695207",
"0.568167",
"0.56566536",
"0.56566536",
"0.5641971",
... | 0.6074233 | 7 |
Return the experiment version. | def version(self):
versions = []
for logger in self._loggers:
versions.append(logger.version)
return versions | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_experiments_version():\n with open(\"mlt-templates/experiments/EXPERIMENTS_VERSION.txt\", \"r\") as fh:\n experiments_version = fh.read()\n return experiments_version.strip()",
"def get_version(self):\n return self.version",
"def version(self) -> str:\n return pulumi.get(self... | [
"0.8197149",
"0.78365195",
"0.78034556",
"0.78034556",
"0.78034556",
"0.78034556",
"0.7770439",
"0.77446127",
"0.77446127",
"0.77446127",
"0.77446127",
"0.77446127",
"0.7737636",
"0.76615673",
"0.76615673",
"0.76615673",
"0.764565",
"0.7634588",
"0.7634588",
"0.7627138",
"0.7... | 0.0 | -1 |
Return the experiment version. | def version(self):
versions = []
for key, logger in self._loggers.items():
versions[key] = logger.version
return versions | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_experiments_version():\n with open(\"mlt-templates/experiments/EXPERIMENTS_VERSION.txt\", \"r\") as fh:\n experiments_version = fh.read()\n return experiments_version.strip()",
"def get_version(self):\n return self.version",
"def version(self) -> str:\n return pulumi.get(self... | [
"0.8197149",
"0.78365195",
"0.78034556",
"0.78034556",
"0.78034556",
"0.78034556",
"0.7770439",
"0.77446127",
"0.77446127",
"0.77446127",
"0.77446127",
"0.77446127",
"0.7737636",
"0.76615673",
"0.76615673",
"0.76615673",
"0.764565",
"0.7634588",
"0.7634588",
"0.7627138",
"0.7... | 0.0 | -1 |
Runs convertFCS to create an FCSdata object containing flow data from FCS file Converts data values and keys (channel names) to a PANDAS dataframe | def convertDF(fcs, sample_number=0):
# Create an FCSdata object holding data from the FCS file
FCSdata = convertFCS(fcs, sample_number)
# Convert the cleaned FCS data into a PANDAS dataframe
# Clean up the df by converting to int since values after decimal won't change the analysis
df = pd.Data... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def read_data(self, fcs):\r\n text = self.text_keywords\r\n\r\n # $TOT: FCS keyword for number of events in the data set\r\n num_events = text[\"$TOT\"]\r\n # $PAR: FCS keyword for Parameters (channels) recorded for each event i.e. enabled channels in the experiment\r\n num_param... | [
"0.62538564",
"0.5832299",
"0.5698743",
"0.5584407",
"0.55328083",
"0.54838204",
"0.5482408",
"0.5451396",
"0.5427865",
"0.5406247",
"0.5401104",
"0.5395025",
"0.5375973",
"0.53718936",
"0.5354261",
"0.532564",
"0.5314141",
"0.5308277",
"0.53005165",
"0.52576363",
"0.52545565... | 0.7205643 | 0 |
Returns True if entity has component. | def has_component(self, component):
return component.name in self.components | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def has(self, entity):\n\t\treturn entity.has_component(self.component_type)",
"def has_visible_entity(self):\n ret = False\n for e in self:\n if e.is_visible() == True:\n ret = True\n break\n return ret",
"def _enabled_entity_exists(self) -> bool:\... | [
"0.8861548",
"0.71051353",
"0.705232",
"0.6910215",
"0.6815837",
"0.67669857",
"0.6760536",
"0.66882503",
"0.66452456",
"0.65509987",
"0.65090513",
"0.6413804",
"0.6358695",
"0.633121",
"0.6313268",
"0.6309975",
"0.6285276",
"0.62819284",
"0.62755585",
"0.62164724",
"0.615680... | 0.7512222 | 1 |
Returns the distance to another object. | def distance_to(self, other):
dx = other.x - self.x
dy = other.y - self.y
return math.sqrt(dx ** 2 + dy ** 2) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _object_distance(self, object1, object2):\n return np.linalg.norm(np.array(object1) - np.array(object2))",
"def distance_to(self, obj):\n\t\tx, y = self.position\n\t\tobj_x, obj_y = obj.position\n\t\treturn hypot(x - obj_x, y - obj_y)",
"def dist(self, other):\n return math.sqrt((self.x - oth... | [
"0.8309515",
"0.8065621",
"0.8017887",
"0.80168116",
"0.7982547",
"0.79745",
"0.7942343",
"0.7939424",
"0.79339415",
"0.7933468",
"0.79149383",
"0.78916895",
"0.7888354",
"0.7866638",
"0.7864547",
"0.7836776",
"0.7836448",
"0.7828537",
"0.7780376",
"0.7744214",
"0.7742656",
... | 0.80660194 | 1 |
Returns a list of coin records that are used in this SpendBundle | async def get_locked_coins_in_spend_bundle(
self, bundle: SpendBundle
) -> Dict[bytes32, WalletCoinRecord]:
result = {}
removals = bundle.removals()
for coin in removals:
coin_record = await self.wallet_state_manager.wallet_store.get_coin_record_by_coin_id(
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_coins(self):\n if self.coins:\n return self.coins.keys()\n else:\n return []",
"def get_biases(self):\n return []",
"def get_all_coins() -> List[CoinInfo]:\n coins = list(registry.coin_dict.values())\n coins.extend(daos.get_all_coins())\n\n coins = _d... | [
"0.62239385",
"0.5984173",
"0.59575623",
"0.58777404",
"0.58546066",
"0.58470273",
"0.57957447",
"0.57684815",
"0.5691523",
"0.5679063",
"0.5564973",
"0.5554979",
"0.553434",
"0.5518511",
"0.5517748",
"0.5516127",
"0.551431",
"0.5509376",
"0.55086476",
"0.5494193",
"0.5490643... | 0.6051995 | 1 |
Offer is dictionary of wallet ids and amount | async def _create_offer_for_ids(
self, offer: Dict[int, int]
) -> Tuple[bool, Optional[TradeRecord], Optional[str]]:
spend_bundle = None
try:
for id in offer.keys():
amount = offer[id]
wallet_id = uint32(int(id))
wallet = self.walle... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"async def get_locked_coins(\n self, wallet_id: int = None\n ) -> Dict[bytes32, WalletCoinRecord]:\n all_pending = []\n pending_accept = await self.get_offers_with_status(TradeStatus.PENDING_ACCEPT)\n pending_confirm = await self.get_offers_with_status(TradeStatus.PENDING_CONFIRM)\n ... | [
"0.6101357",
"0.5911638",
"0.56609356",
"0.5653375",
"0.5647531",
"0.56332016",
"0.5602458",
"0.55545485",
"0.55399454",
"0.5489649",
"0.54758894",
"0.5467307",
"0.54462403",
"0.5425534",
"0.5418933",
"0.5407706",
"0.5401529",
"0.5352505",
"0.53324074",
"0.52398604",
"0.51972... | 0.70207 | 0 |
Receives a sentence string along with a word embedding model and returns the vector representation of the sentence | def to_vector(texto,model,idf):
tokens = normalizer(texto).split() # splits the text by space and returns a list of words
vec = np.zeros(300) # creates an empty vector of 300 dimensions
for word in tokens: # iterates over the sentence
if (word in model) & (word in idf): # checks if the word is both ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def sentence_to_vec(s, embeddings_dict, stop_words, tokenizer):\n \n words = str(s).lower()\n words = tokenizer(words)\n # remove stop words, if any, and only alpha-numeric tokens\n words = [w for w in words if not w in stop_words and w.isalpha()]\n \n embeddings = []\n for w in words:\n ... | [
"0.7996944",
"0.7980737",
"0.7706222",
"0.7669914",
"0.7492081",
"0.73864347",
"0.73641425",
"0.7199389",
"0.7179083",
"0.71744967",
"0.71681434",
"0.7105892",
"0.70191973",
"0.69683003",
"0.6927414",
"0.68552476",
"0.68122995",
"0.67687",
"0.6709537",
"0.66740495",
"0.665433... | 0.7817139 | 2 |
Initialize a new camera position descriptor. | def __init__(self, position, focal_point, viewup):
self._position = position
self._focal_point = focal_point
self._viewup = viewup | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _init(self, position):\n\t\tself._position = position",
"def initialize_camera(self, distance, yaw, pitch, x=0, y=0, z=0):\n lookat = [x, y, z]\n\n self._env.unwrapped._p.resetDebugVisualizerCamera(\n distance, yaw, pitch, lookat)",
"def setup_camera(self) -> None:\n self.wo... | [
"0.67903894",
"0.64479625",
"0.6393975",
"0.63804454",
"0.63804215",
"0.6345668",
"0.6291514",
"0.62674296",
"0.61936706",
"0.6153577",
"0.60632646",
"0.6061454",
"0.6051353",
"0.6049952",
"0.59930915",
"0.5965778",
"0.5910078",
"0.5865168",
"0.5865168",
"0.5865168",
"0.58540... | 0.673606 | 1 |
Convert to a list of the position, focal point, and viewup. Returns list List of the position, focal point, and view up of the camera. Examples >>> import pyvista >>> pl = pyvista.Plotter() >>> pl.camera_position.to_list() [(0.0, 0.0, 1.0), (0.0, 0.0, 0.0), (0.0, 1.0, 0.0)] | def to_list(self):
return [self._position, self._focal_point, self._viewup] | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def to_list(self):\n return [self.x, self.y, self.z]",
"def position(self):\n return self._pos.to_list()",
"def get_position(self):\n return list(self.position)",
"def get_coordinates(self):\r\n coordinates_list = []\r\n for i in range(self.__length):\r\n if self... | [
"0.6476367",
"0.62984",
"0.62919134",
"0.6126211",
"0.60634047",
"0.59971035",
"0.5995792",
"0.5966459",
"0.5910988",
"0.5769173",
"0.5746046",
"0.5713925",
"0.57111275",
"0.57096773",
"0.5679928",
"0.5653658",
"0.56482947",
"0.5628945",
"0.56250006",
"0.56054765",
"0.5603261... | 0.78701466 | 0 |
Location of the camera in world coordinates. | def position(self):
return self._position | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def camera_location(self) -> CameraLocationType:\n return self._location",
"def camera_position(self):\n return CameraPosition(\n scale_point(self.camera, self.camera.position, invert=True),\n scale_point(self.camera, self.camera.focal_point, invert=True),\n self.ca... | [
"0.7374123",
"0.7141978",
"0.7055122",
"0.68606865",
"0.67762446",
"0.6740445",
"0.67253697",
"0.6608069",
"0.6598835",
"0.656908",
"0.6556641",
"0.6512802",
"0.6511051",
"0.65003717",
"0.6498714",
"0.64662963",
"0.6450918",
"0.6433619",
"0.6380905",
"0.6378359",
"0.6371096",... | 0.0 | -1 |
Location of the camera's focus in world coordinates. | def focal_point(self):
return self._focal_point | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def camera_position(self):\n return CameraPosition(\n scale_point(self.camera, self.camera.position, invert=True),\n scale_point(self.camera, self.camera.focal_point, invert=True),\n self.camera.up,\n )",
"def camera_location(self) -> CameraLocationType:\n re... | [
"0.6644721",
"0.65299755",
"0.649212",
"0.63354135",
"0.63354135",
"0.63354135",
"0.62518",
"0.62518",
"0.6249192",
"0.6219972",
"0.61748606",
"0.6167681",
"0.6102118",
"0.60940456",
"0.6089569",
"0.6086582",
"0.6086582",
"0.6050958",
"0.60409784",
"0.60131216",
"0.5974156",
... | 0.5708425 | 42 |
Viewup vector of the camera. | def viewup(self):
return self._viewup | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def view_vector(self, vector, viewup=None, render=True):\n focal_pt = self.center\n if viewup is None:\n viewup = self._theme.camera['viewup']\n cpos = CameraPosition(vector + np.array(focal_pt), focal_pt, viewup)\n self.camera_position = cpos\n self.reset_camera(rende... | [
"0.78134674",
"0.7271212",
"0.6743524",
"0.6743524",
"0.64612675",
"0.6284524",
"0.60810137",
"0.60640615",
"0.5962724",
"0.5947102",
"0.59320784",
"0.58362174",
"0.576407",
"0.57160175",
"0.57059145",
"0.56943345",
"0.5683601",
"0.568341",
"0.5679278",
"0.5675734",
"0.566542... | 0.6415359 | 5 |
Get or set whether this camera has been configured. | def camera_set(self) -> bool:
if self.camera is None: # pragma: no cover
return False
return self.camera.is_set | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def is_on(self):\n camera = self.coordinator.data[self._camera_id]\n if self._switch_type == \"record_motion\":\n enabled = True if camera[\"recording_mode\"] == TYPE_RECORD_MOTION else False\n elif self._switch_type == \"record_always\":\n enabled = True if camera[\"reco... | [
"0.66845506",
"0.6617645",
"0.65581816",
"0.63469446",
"0.6334555",
"0.6293225",
"0.62919086",
"0.6261713",
"0.6168983",
"0.6155826",
"0.61438465",
"0.609567",
"0.6053022",
"0.60207355",
"0.5939763",
"0.5888694",
"0.58779764",
"0.5874042",
"0.58306825",
"0.5811862",
"0.574902... | 0.7928176 | 0 |
Return next color from this renderer's color cycler. | def next_color(self):
if self._color_cycle is None:
return self._theme.color
return next(self._color_cycle)['color'] | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def getnextcolor(self):\n self.usedcc = [line.get_c() for line in self.axes.lines]\n for c in self.cc:\n if c not in self.usedcc:\n return c\n\n # Only gets here if all colors already used...\n i = len(self.axes.lines)\n numc = len(self.cc)\n i = ... | [
"0.8234981",
"0.7788944",
"0.75411344",
"0.7377343",
"0.7372973",
"0.65539384",
"0.6496401",
"0.6496338",
"0.6471264",
"0.6416286",
"0.6416286",
"0.6404888",
"0.63695973",
"0.63695973",
"0.63695973",
"0.63695973",
"0.6367257",
"0.63184136",
"0.6311353",
"0.62983453",
"0.62919... | 0.8391353 | 0 |
Reset the camera clipping range based on the bounds of the visible actors. This ensures that no props are cut off | def reset_camera_clipping_range(self):
self.ResetCameraClippingRange() | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def resetCamera(self, bounds):\n\n center = 0.5 * (bounds[0] + bounds[1])\n radius = numpy.linalg.norm(0.5 * (bounds[1] - bounds[0]))\n if radius == 0.: # bounds are all collapsed\n radius = 1.\n\n if isinstance(self.intrinsic, transform.Perspective):\n # Get the ... | [
"0.69563466",
"0.63943154",
"0.6289811",
"0.6274044",
"0.62611425",
"0.6072329",
"0.6013888",
"0.5960976",
"0.5889132",
"0.5841507",
"0.5830585",
"0.57290673",
"0.5729017",
"0.5724514",
"0.5716218",
"0.5694633",
"0.5691615",
"0.56456757",
"0.5598638",
"0.5567777",
"0.55051404... | 0.7952063 | 0 |
Return the active camera for the rendering scene. | def camera(self):
return self._camera | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def camera(self):\n return self.__camera",
"def current_camera(self):\n n = ct.c_long() # current camera handler\n self.lib.GetCurrentCamera(ct.pointer(n))\n return n.value",
"def _get_camera(self):\n rect = (self._dim[0], self._dim[2], self._dim[1] - self._dim[0],\n ... | [
"0.77300924",
"0.7217394",
"0.71555066",
"0.6977217",
"0.67631495",
"0.6611181",
"0.65489227",
"0.6541998",
"0.6541998",
"0.6482501",
"0.639992",
"0.63398176",
"0.61835515",
"0.6168995",
"0.6165372",
"0.6064254",
"0.6062406",
"0.60450935",
"0.60058284",
"0.5945104",
"0.590427... | 0.7788729 | 1 |
Return the length of the diagonal of the bounding box of the scene. Returns float Length of the diagional of the bounding box. | def length(self):
return pyvista.Box(self.bounds).length | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def diagonal_size(self):\n b = self.GetBounds()\n return np.sqrt((b[1] - b[0]) ** 2 + (b[3] - b[2]) ** 2)",
"def diagonal(self):\r\n return math.sqrt((self.width ** 2) + (self.height ** 2))",
"def getlen(self):\n if self.onlydiag():\n return self.lendiag()\n else:\... | [
"0.7783756",
"0.7370988",
"0.65690464",
"0.6530001",
"0.65181583",
"0.6455151",
"0.61577594",
"0.6155944",
"0.61422324",
"0.61062217",
"0.61004806",
"0.6067818",
"0.6061304",
"0.6045054",
"0.59732956",
"0.59732026",
"0.5965042",
"0.5937104",
"0.5895358",
"0.58913976",
"0.5834... | 0.6806367 | 2 |
Return if the renderer has a border. | def has_border(self):
return self._border_actor is not None | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def HasBorder(self):\r\n \r\n return self.HasFlag(self.optionPaneBorder)",
"def has_border(self, x, y, border):\n return self.__board[y][x] & self.BORDERS[border]",
"def border(self):\r\n\t\treturn self._border",
"def border(self):\n return self._border",
"def border(self):\n ... | [
"0.78990096",
"0.73252356",
"0.7023692",
"0.69474614",
"0.69474614",
"0.68066156",
"0.65659505",
"0.65605944",
"0.6503742",
"0.6409397",
"0.64052165",
"0.63717437",
"0.62892467",
"0.6183824",
"0.61292744",
"0.61292744",
"0.6086626",
"0.59882987",
"0.5983166",
"0.5968996",
"0.... | 0.85111946 | 0 |
Return the border color. | def border_color(self):
if self.has_border:
return Color(self._border_actor.GetProperty().GetColor())
return None | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def border_color(self) -> int:\n return self._border_color",
"def borderColor( self ):\n return self._borderColor",
"def border_color(self):\n return self._border_rgba",
"def bordercolor(self):\n return self[\"bordercolor\"]",
"def get_border(self):\n return self._border"... | [
"0.91616243",
"0.90390056",
"0.8996708",
"0.8511283",
"0.77999514",
"0.76540136",
"0.76540136",
"0.7641755",
"0.7583416",
"0.7178384",
"0.71017474",
"0.68595165",
"0.68026644",
"0.67944974",
"0.6631913",
"0.6555812",
"0.64894867",
"0.6456548",
"0.6343738",
"0.63379586",
"0.63... | 0.8797848 | 3 |
Return whether this renderer has charts. | def has_charts(self):
return self.__charts is not None | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def axes_enabled(self):\n if hasattr(self, 'axes_widget'):\n return bool(self.axes_widget.GetEnabled())\n return False",
"def has_report(self):\n return self.report is not None",
"def is_chart_enabled(dbapi, app_name, chart_name, namespace):\n try:\n db_app = find_kube... | [
"0.65800506",
"0.64014155",
"0.621095",
"0.6104169",
"0.6026237",
"0.60140544",
"0.6001484",
"0.5996199",
"0.5923102",
"0.5907532",
"0.58804476",
"0.5871745",
"0.58710253",
"0.58572125",
"0.5842687",
"0.5824167",
"0.58132637",
"0.5808506",
"0.5797006",
"0.5775964",
"0.5768393... | 0.89454913 | 0 |
Remove a chart from this renderer. | def remove_chart(self, chart_or_index):
# Make sure we don't create the __charts object if this renderer has no charts yet.
if self.has_charts:
self._charts.remove_chart(chart_or_index) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def onChartRemoveSeries(self):\n self.chart().removeAllSeries()\n self.series = {}\n self.yaxis = {}\n self.pen = {}\n self.ymin = {}\n self.ymax = {}",
"def erase_plot(self, line_position=0):\n self.axplot.lines.pop(line_position).remove\n self.fig.canvas.... | [
"0.70534337",
"0.6401293",
"0.6233668",
"0.608586",
"0.6079203",
"0.60678726",
"0.60285455",
"0.59787",
"0.59191287",
"0.5820142",
"0.57463604",
"0.5730512",
"0.57163864",
"0.5688322",
"0.5665282",
"0.56645054",
"0.5632822",
"0.56304836",
"0.56114876",
"0.5607921",
"0.5606347... | 0.8217053 | 0 |
Hide the axes orientation widget. Examples >>> import pyvista as pv >>> pl = pv.Plotter() >>> pl.hide_axes() | def hide_axes(self):
if hasattr(self, 'axes_widget') and self.axes_widget.GetEnabled():
self.axes_widget.EnabledOff()
self.Modified() | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def hide_axes(plot, axes=('x', 'y')):\n if isinstance(axes, str):\n axes = tuple(axes)\n\n for label in axes:\n axis = getattr(plot, label + 'axis')\n axis = axis[0]\n axis.major_label_text_alpha = 0.0\n axis.major_label_text_font_size = '0pt'\n axis.axis_line_alpha ... | [
"0.7598415",
"0.6403457",
"0.62881356",
"0.6244384",
"0.6228581",
"0.6123471",
"0.61130154",
"0.60614675",
"0.6040783",
"0.5998478",
"0.59787893",
"0.5846813",
"0.5805988",
"0.58012855",
"0.5790344",
"0.57818097",
"0.576112",
"0.5734393",
"0.573244",
"0.5707164",
"0.57033414"... | 0.8070392 | 0 |
Show the axes orientation widget. Examples >>> import pyvista >>> pl = pyvista.Plotter() >>> pl.show_axes() | def show_axes(self):
if hasattr(self, 'axes_widget'):
self.axes_widget.EnabledOn()
self.axes_widget.SetCurrentRenderer(self)
else:
self.add_axes()
self.Modified() | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def showaxes(axl: Union[object, List], whichaxes: str = \"xy\"):\n\n axl = _ax_tolist(axl)\n for ax in axl:\n if ax is None:\n continue\n if \"x\" in whichaxes:\n ax.spines[\"bottom\"].set_visible(True)\n ax.tick_params(bottom=True, labelbottom=True)\n if... | [
"0.66247433",
"0.6482623",
"0.64165163",
"0.63583106",
"0.6348607",
"0.6142449",
"0.6122898",
"0.5950817",
"0.5900472",
"0.58445096",
"0.5836059",
"0.5829572",
"0.5823087",
"0.5823087",
"0.5816784",
"0.5739508",
"0.56960964",
"0.56948054",
"0.5693767",
"0.56863064",
"0.568630... | 0.718688 | 0 |
Return ``True`` when axes are enabled. Examples >>> import pyvista >>> pl = pyvista.Plotter() >>> pl.hide_axes() >>> pl.renderer.axes_enabled False | def axes_enabled(self):
if hasattr(self, 'axes_widget'):
return bool(self.axes_widget.GetEnabled())
return False | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def hide_axes(self):\n if hasattr(self, 'axes_widget') and self.axes_widget.GetEnabled():\n self.axes_widget.EnabledOff()\n self.Modified()",
"def show_axes(self):\n if hasattr(self, 'axes_widget'):\n self.axes_widget.EnabledOn()\n self.axes_widget.SetCur... | [
"0.76007104",
"0.70384896",
"0.6794622",
"0.6445691",
"0.6445691",
"0.6368987",
"0.63298655",
"0.60395694",
"0.59397376",
"0.58218336",
"0.5802313",
"0.57584256",
"0.5714825",
"0.55680645",
"0.55680645",
"0.55275",
"0.5520673",
"0.5520673",
"0.550967",
"0.54688853",
"0.546821... | 0.841753 | 0 |
Set camera position to a point. | def set_position(self, point, reset=False, render=True):
if isinstance(point, np.ndarray):
if point.ndim != 1:
point = point.ravel()
self.camera.position = scale_point(self.camera, point, invert=False)
if reset:
self.reset_camera(render=render)
sel... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def setPoint(self, point):\n self.position = point.position",
"def set_focus(self, point):\n if isinstance(point, np.ndarray):\n if point.ndim != 1:\n point = point.ravel()\n self.camera.focal_point = scale_point(self.camera, point, invert=False)\n self.camer... | [
"0.7645881",
"0.7488684",
"0.7475947",
"0.74032354",
"0.7359109",
"0.7132762",
"0.70494425",
"0.7040286",
"0.6799234",
"0.67778254",
"0.6647049",
"0.6606636",
"0.6558724",
"0.64978683",
"0.6431256",
"0.6407188",
"0.6406936",
"0.6401082",
"0.6369806",
"0.6368297",
"0.6348451",... | 0.83831567 | 0 |
Return parallel projection state of active render window. Examples >>> import pyvista >>> pl = pyvista.Plotter() >>> pl.parallel_projection = False >>> pl.parallel_projection False | def parallel_projection(self):
return self.camera.parallel_projection | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def parallel_projection(self, state):\n self.camera.parallel_projection = state\n self.Modified()",
"def enable_parallel_projection(self):\n # Fix the 'reset camera' effect produced by the VTK when parallel\n # projection is enabled.\n angle = np.radians(self.camera.view_angle)... | [
"0.7330841",
"0.6968439",
"0.6624476",
"0.60746086",
"0.5848254",
"0.5833127",
"0.5824897",
"0.5702614",
"0.56675005",
"0.56675005",
"0.56157506",
"0.5584779",
"0.55381554",
"0.54970443",
"0.549184",
"0.5477387",
"0.5476439",
"0.5415312",
"0.53330064",
"0.52858025",
"0.528163... | 0.74887276 | 0 |
Point the camera in the direction of the given vector. | def view_vector(self, vector, viewup=None, render=True):
focal_pt = self.center
if viewup is None:
viewup = self._theme.camera['viewup']
cpos = CameraPosition(vector + np.array(focal_pt), focal_pt, viewup)
self.camera_position = cpos
self.reset_camera(render=render) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def project_vector(self, vector: array_like) -> Vector:\n point_in_space = self.point + vector\n point_on_plane = self.project_point(point_in_space)\n\n return Vector.from_points(self.point, point_on_plane)",
"def project_vector(u, v):\n u_np = np.array([u.get_x(), u.get_y()])\n v_np =... | [
"0.71940917",
"0.63560545",
"0.63367784",
"0.6330268",
"0.6313555",
"0.6259582",
"0.6245223",
"0.6243039",
"0.62397844",
"0.6223476",
"0.620688",
"0.6206377",
"0.6173179",
"0.6159651",
"0.6122384",
"0.6090436",
"0.6072005",
"0.6066956",
"0.6023519",
"0.6020296",
"0.601881",
... | 0.71872896 | 1 |
View the YZ plane. | def view_yz(self, negative=False, render=True):
self.view_vector(*view_vectors('yz', negative=negative), render=render) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def view_zy(self, negative=False, render=True):\n self.view_vector(*view_vectors('zy', negative=negative), render=render)",
"def rotateYRight(self):\n MV = self.MV\n MV[:3, 0] = 0, 1, 0 # 1st col is right vector, make it point along y axis\n # set middle middle and middle right values... | [
"0.6547223",
"0.6058228",
"0.6058228",
"0.5986503",
"0.5887358",
"0.5791194",
"0.57788897",
"0.562064",
"0.5609948",
"0.5572713",
"0.5554533",
"0.5554533",
"0.55535686",
"0.5550166",
"0.55456746",
"0.5544094",
"0.5542231",
"0.55362636",
"0.55157757",
"0.55035675",
"0.5497981"... | 0.737181 | 0 |
Add blurring. This can be added several times to increase the degree of blurring. Examples Add two blurring passes to the plotter and show it. >>> import pyvista as pv >>> pl = pv.Plotter() >>> _ = pl.add_mesh(pv.Sphere(), show_edges=True) >>> pl.add_blurring() >>> pl.add_blurring() >>> pl.show() | def add_blurring(self):
self._render_passes.add_blur_pass() | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def blur(self, shape, dist_fr, dist_to, amount):\r\n shape.unif[42] = dist_fr # shader unif[14]\r\n shape.unif[43] = dist_to\r\n shape.unif[44] = amount\r\n shape.unif[45] = 1.0/self.ix # shader unif[15]\r\n shape.unif[46] = 1.0/self.iy\r\n shape.draw(self.shader, [self], 0.0, 0.0)",
"def blurS... | [
"0.63303065",
"0.57988286",
"0.57859975",
"0.5540293",
"0.5527051",
"0.550341",
"0.5461891",
"0.5442216",
"0.536958",
"0.5348567",
"0.5331645",
"0.5325369",
"0.5276398",
"0.5275773",
"0.52567476",
"0.521002",
"0.5167451",
"0.51604134",
"0.51434654",
"0.51434654",
"0.50643075"... | 0.71542597 | 0 |
Disable surface space ambient occlusion (SSAO). | def disable_ssao(self):
self._render_passes.disable_ssao_pass() | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def disable_amplitude_modulation(self):\n self.write(\":SOUR:AM:STAT OFF\")",
"def turnLightingSystemOff():\n dislin.light('OFF')",
"def flagUntexturedObject(self, object):\n object.setShaderInput(\"texDisable\", 1, 1, 1, 1)",
"def setProtectSurfaces():\n dislin.shlsur()",
"def enable_textu... | [
"0.61489666",
"0.60204923",
"0.5950103",
"0.5777201",
"0.57301265",
"0.5539065",
"0.5511989",
"0.5511989",
"0.54441816",
"0.5379625",
"0.52964354",
"0.52944326",
"0.5266819",
"0.5259515",
"0.5251592",
"0.5227988",
"0.52260506",
"0.52209044",
"0.5212857",
"0.5205171",
"0.51978... | 0.66822845 | 0 |
Get the pick position/area as ``x0, y0, x1, y1``. Returns tuple Pick position as ``x0, y0, x1, y1``. | def get_pick_position(self):
x0 = int(self.GetPickX1())
x1 = int(self.GetPickX2())
y0 = int(self.GetPickY1())
y1 = int(self.GetPickY2())
return x0, y0, x1, y1 | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def coordinates(self) -> Tuple[int, int]:\n return self.x, self.y",
"def coordinates(self) -> Tuple[float, float, float, float, float]:\n return (self.x, self.y, self.x + self.width, self.y + self.height)",
"def get_pos(self):\n return (self.x, self.y)",
"def coordinate(self):\n\t\tif se... | [
"0.7284192",
"0.7170218",
"0.7149962",
"0.7121954",
"0.7115006",
"0.70753956",
"0.6951286",
"0.6862104",
"0.6849299",
"0.6796798",
"0.671746",
"0.6699772",
"0.6687364",
"0.6633278",
"0.66132516",
"0.6610069",
"0.65979475",
"0.6583282",
"0.65821236",
"0.6569422",
"0.656549",
... | 0.82525593 | 0 |
Return or set the current layer of this renderer. | def layer(self):
return self.GetLayer() | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def layer( self ):\n return self._layer",
"def layer(self):\n return self._layer",
"def get_current_render_layer(scene):\r\n active_layer_index = scene.luxcore.active_layer_index\r\n\r\n # If active layer index is -1 we are trying to access it\r\n # in an incorrect situation, e.g. viewpo... | [
"0.76540786",
"0.76350665",
"0.7186025",
"0.70600086",
"0.7008223",
"0.6732119",
"0.66044",
"0.65086544",
"0.62625355",
"0.623732",
"0.61371714",
"0.6122914",
"0.60888094",
"0.607863",
"0.6065662",
"0.60500073",
"0.5976525",
"0.59344697",
"0.5889004",
"0.585121",
"0.5800875",... | 0.7781568 | 0 |
Height of the renderer. | def height(self):
_, ymin, _, ymax = self.viewport
return self.parent.window_size[1] * (ymax - ymin) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def getHeight(self):\n return self.height",
"def getHeight(self):\n return self.height",
"def get_grid_height(self):\r\n return self.height",
"def height (self):\n return self._h",
"def get_height(self):\r\n return self._height",
"def get_height(self):\r\n return... | [
"0.7929188",
"0.7929188",
"0.7837875",
"0.7837522",
"0.7828301",
"0.7828301",
"0.7828301",
"0.7815573",
"0.77933425",
"0.7765057",
"0.7765036",
"0.7754871",
"0.77456665",
"0.772672",
"0.7709255",
"0.7709255",
"0.7709255",
"0.7709255",
"0.76867217",
"0.76863873",
"0.76863873",... | 0.7832416 | 4 |
! Return a HeavyFootprint containing the flux apportioned to this peak. [in] strayFlux include stray flux also? | def getFluxPortion(self, strayFlux=True):
if self.templateFootprint is None or self.fluxPortion is None:
return None
heavy = afwDet.makeHeavyFootprint(self.templateFootprint, self.fluxPortion)
if strayFlux:
if self.strayFlux is not None:
heavy = afwDet.mer... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def calculate_flux(self, band):\n\n if (self.wavelength[0] > band.wavelength[0] or\n self.wavelength[-1] < band.wavelength[-1]):\n\n warn('Spectrum does not cover the whole bandpass, '\n 'extrapolating...')\n dw = np.median(np.diff(self.wavelength.value))... | [
"0.6568866",
"0.6026025",
"0.60091984",
"0.57948583",
"0.5710291",
"0.569109",
"0.5652298",
"0.55734104",
"0.5543463",
"0.5537051",
"0.55363387",
"0.55297583",
"0.55109626",
"0.5480033",
"0.54797477",
"0.54627854",
"0.5445631",
"0.5388139",
"0.53712696",
"0.53667307",
"0.5363... | 0.7391438 | 0 |
Home page of app with form | def home():
return "<h1>Not Much Going On Here</h1>" | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def home():\n return render_template('home.html', form=None)",
"def home():\n form = AddCupcakeForm()\n return render_template(\"home.html\", form=form)",
"def home():\n\n form = HomePageForm()\n if form.validate_on_submit():\n return redirect(url_for('character'))\n return render_temp... | [
"0.8036328",
"0.78751135",
"0.7652378",
"0.75973994",
"0.7335234",
"0.72964084",
"0.72769946",
"0.7130869",
"0.7130062",
"0.7061084",
"0.7052415",
"0.6994364",
"0.6938332",
"0.68757415",
"0.6873102",
"0.68598795",
"0.6853291",
"0.68531024",
"0.67979205",
"0.6771299",
"0.67646... | 0.0 | -1 |
Simulate a corrupt JSON response from K8s. | def test_request_err_json(self, method, m_requests):
# Dummies for K8s API URL and `requests` session.
url = 'http://examples.com/'
client = k8s.requests.Session()
# Construct a response with a corrupt JSON string.
corrupt_json = "{this is not valid] json;"
m_requests.re... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"async def test_unmarshall_k8s_error_response(self):\n # An actual error response sent by K8s during testing.\n k8s_err = {\n 'type': 'ERROR',\n 'object': {\n 'kind': 'Status', 'apiVersion': 'v1', 'metadata': {},\n 'status': 'Failure',\n ... | [
"0.7075015",
"0.59463435",
"0.5772302",
"0.544379",
"0.54182076",
"0.53815514",
"0.5340672",
"0.53308845",
"0.52847105",
"0.5282746",
"0.52798104",
"0.527385",
"0.524647",
"0.524647",
"0.52415794",
"0.5232432",
"0.5221458",
"0.52145404",
"0.51883495",
"0.5171841",
"0.51658905... | 0.6221612 | 1 |
Simulate an unsuccessful K8s response for GET request. | def test_request_connection_err(self, method, m_requests, nosleep):
# Dummies for K8s API URL and `requests` session.
url = 'http://examples.com/'
client = k8s.requests.Session()
# Construct the ConnectionError exception with a fake request object.
# The fake is necessary to ens... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_response_200_on_get(self):\n pass",
"def test_trucks_api_error(self):\n resp = self.app.get('/asfdasdf')\n self.assertEqual(resp.status_code, 404)\n assert \"NOT FOUND\" in resp.status",
"async def test_unmarshall_k8s_error_response(self):\n # An actual error respons... | [
"0.66334254",
"0.6453428",
"0.63435835",
"0.6325352",
"0.62887865",
"0.624398",
"0.6184689",
"0.61401105",
"0.6128633",
"0.612064",
"0.6110895",
"0.6106053",
"0.6097958",
"0.6094087",
"0.6094087",
"0.6050304",
"0.60185015",
"0.60136455",
"0.59992063",
"0.5991137",
"0.59851044... | 0.0 | -1 |
Simulate successful DELETE, GET, PATCH, POST requests. This test is for the various wrappers around the `request` function, which is why we mock it so as to return an HTTP code that constitutes a successful transaction for the respective request. | def test_delete_get_patch_post_ok(self, m_req):
# Dummy values.
client = "client"
path = "path"
payload = "payload"
response = "response"
# K8s DELETE request was successful iff its return status is 200 or 202
# (202 means deleting was scheduled but is still pend... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_request():\n return make_response(\"ok\")",
"def test_request(self):\n client = RestClient(host=self.host, username='')\n rest_url = 'some/url/'\n\n # Mock good get response\n with responses.RequestsMock() as rsps:\n rsps.add(responses.GET, f'{self.host}/{rest_u... | [
"0.7209447",
"0.67923886",
"0.67276996",
"0.6605493",
"0.6568527",
"0.6530386",
"0.652629",
"0.65112245",
"0.64949375",
"0.64517397",
"0.64386207",
"0.6435384",
"0.63577616",
"0.63520163",
"0.6336054",
"0.63077456",
"0.63029766",
"0.6271505",
"0.62623614",
"0.623353",
"0.6233... | 0.6408196 | 12 |
Verify with a Namespace resource. This one is a special case because it is not namespaced but Square's MetaManifest may specify a `namespace` for them, which refers to their actual name. This is a necessary implementation detail to properly support the selectors. | def test_resource_namespace(self, integrationtest, k8sconfig):
# Fixtures.
config = self.k8sconfig(integrationtest, k8sconfig)
MM = MetaManifest
for src in ["", "v1"]:
# A particular Namespace.
res, err = k8s.resource(config, MM(src, "Namespace", None, "name"))
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_namespaceFound(self):\n xp = XPathQuery(\"/foo[@xmlns='testns']/bar\")\n self.assertEqual(xp.matches(self.e), 1)",
"def test_get_namespace(self):\n pass",
"def _get_namespace(self, data):\n ns_name = data['filename'].namespace\n try:\n return models.Namesp... | [
"0.6741465",
"0.6544986",
"0.6478834",
"0.6335777",
"0.6283167",
"0.6167026",
"0.6142375",
"0.6082803",
"0.60709655",
"0.60656166",
"0.5975379",
"0.5975379",
"0.5975379",
"0.5975379",
"0.5975379",
"0.5975379",
"0.5975379",
"0.5975379",
"0.5975379",
"0.5975379",
"0.5975379",
... | 0.71492606 | 0 |
Test case for otoroshi_controllers_adminapi_tcp_service_api_controller_bulk_patch_action | def test_otoroshi_controllers_adminapi_tcp_service_api_controller_bulk_patch_action(self):
pass | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_otoroshi_controllers_adminapi_tcp_service_api_controller_bulk_update_action(self):\n pass",
"def test_otoroshi_controllers_adminapi_tcp_service_api_controller_bulk_create_action(self):\n pass",
"def test_otoroshi_controllers_adminapi_tcp_service_api_controller_bulk_delete_action(self):\n... | [
"0.89587057",
"0.79859084",
"0.77814156",
"0.7351222",
"0.6798079",
"0.6592704",
"0.6206686",
"0.6186444",
"0.6156153",
"0.6141608",
"0.61236334",
"0.6114982",
"0.61129117",
"0.60986435",
"0.605086",
"0.6048132",
"0.6021875",
"0.59981215",
"0.5995738",
"0.5982147",
"0.5972742... | 0.9590716 | 0 |
Test case for otoroshi_controllers_adminapi_tcp_service_api_controller_patch_entity_action | def test_otoroshi_controllers_adminapi_tcp_service_api_controller_patch_entity_action(self):
pass | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_otoroshi_controllers_adminapi_tcp_service_api_controller_update_entity_action(self):\n pass",
"def test_otoroshi_controllers_adminapi_tcp_service_api_controller_bulk_patch_action(self):\n pass",
"def test_partial_update(self):\n\n action = ActionFactory.create(id=22)\n data... | [
"0.8554642",
"0.75501543",
"0.7063065",
"0.67835885",
"0.67672884",
"0.6672659",
"0.6641402",
"0.6640722",
"0.6588741",
"0.6573359",
"0.655098",
"0.65479195",
"0.65155846",
"0.65155846",
"0.65155846",
"0.6502837",
"0.6482056",
"0.64605016",
"0.6458824",
"0.6447331",
"0.644112... | 0.94470406 | 0 |
Test case for otoroshi_controllers_adminapi_tcp_service_api_controller_update_entity_action | def test_otoroshi_controllers_adminapi_tcp_service_api_controller_update_entity_action(self):
pass | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_otoroshi_controllers_adminapi_tcp_service_api_controller_patch_entity_action(self):\n pass",
"def test_otoroshi_controllers_adminapi_tcp_service_api_controller_bulk_update_action(self):\n pass",
"def test_update_case(self):\n pass",
"def test_update(self):\n pass",
"def... | [
"0.8598254",
"0.74579716",
"0.7391294",
"0.7240276",
"0.7240276",
"0.7240276",
"0.7185599",
"0.7130445",
"0.7082372",
"0.6926615",
"0.6922648",
"0.6897682",
"0.6882747",
"0.6863802",
"0.6840213",
"0.6753261",
"0.6701399",
"0.66398615",
"0.66384304",
"0.6619335",
"0.6610379",
... | 0.95261025 | 0 |
Roll the dice until the same side appears multiple times in a row. 'Number of runs' can determine the number of consecutive repetitions. | def main():
print("Let's flip a coin!")
num_run = int(input('Number of runs: '))
repeat = 0
# 1st roll
roll = r.randint(1, 2)
ans = str(roll)
while True:
roll = r.randint(1, 2)
ans += str(roll)
# 2nd roll: Same as the latter.
if len(ans) == 2:
if ans[0] == ans[1]:
repeat += 1
# Continuous rol... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def roll(self):\n rolls = []\n if self.dice_array is not None:\n for dice in self.dice_array:\n rolls.append(np.random.randint(1, dice+1))\n else:\n for _ in range(0,self.number):\n rolls.append(np.random.randint(1, self.sides+1))\n #F... | [
"0.65195346",
"0.6328663",
"0.6250035",
"0.6164906",
"0.6100922",
"0.6084927",
"0.6076667",
"0.6068354",
"0.60316",
"0.6027927",
"0.5997847",
"0.5989442",
"0.598811",
"0.59758145",
"0.5973122",
"0.59565693",
"0.59347486",
"0.59183997",
"0.59183997",
"0.59183997",
"0.59183997"... | 0.54625833 | 45 |
Verifica que no este repetido el email | def api_check_email(request):
email = request.matchdict['email']
check_email = RepositorioUsario.check_email(request, email)
return check_email | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_duplicate_email(self):\n self.signup('Bo', 'Theo', 'Bo_theo5@example.com', 'Bo1995', 'Bo1995')\n rv = self.signup('Bo', 'Theo', 'Bo_theo5@example.com', 'Bo1995', 'Bo1995')\n self.assertIn(b'Sorry email already exist', rv.data)",
"def testEmailAlreadyThere(self):\r\n res = sel... | [
"0.67455435",
"0.6672261",
"0.6653048",
"0.6636306",
"0.66355145",
"0.66070724",
"0.66065395",
"0.6565752",
"0.6537923",
"0.65200835",
"0.6517968",
"0.6506951",
"0.649924",
"0.64724565",
"0.64579415",
"0.6435193",
"0.64318085",
"0.6413526",
"0.63983244",
"0.6370386",
"0.63566... | 0.6033285 | 64 |
Transform the bbox format from x1y1x2y2 to xywh. | def xyxy2xywh(bbox_xyxy):
bbox_xywh = bbox_xyxy.copy()
bbox_xywh[:, 2] = bbox_xywh[:, 2] - bbox_xywh[:, 0] + 1
bbox_xywh[:, 3] = bbox_xywh[:, 3] - bbox_xywh[:, 1] + 1
return bbox_xywh | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def convert_bbox(bbox, width, height):\n min_x, min_y, max_x, max_y = bbox\n # scale X axis\n min_x *= width\n max_x *= width\n # invert Y axis and scale\n min_y = (1 - min_y) * height\n max_y = (1 - max_y) * height\n\n return min_x, min_y, max_x, max_y",
"def xywh_xyxy(boxes):\n bbox ... | [
"0.7292092",
"0.7161883",
"0.69186175",
"0.6808849",
"0.6656869",
"0.66403186",
"0.66323435",
"0.6618338",
"0.6593587",
"0.6586213",
"0.6535281",
"0.6492691",
"0.6446967",
"0.6424917",
"0.64235795",
"0.64152396",
"0.6402823",
"0.6401354",
"0.6401021",
"0.63842607",
"0.6377467... | 0.7297566 | 0 |
This encodes bbox(x,y,w,h) into (center, scale) | def box2cs(box):
input_size = (256, 256)
x, y, w, h = box[:4]
aspect_ratio = input_size[0] / input_size[1]
center = np.array([x + w * 0.5, y + h * 0.5], dtype=np.float32)
if w > aspect_ratio * h:
h = w * 1.0 / aspect_ratio
elif w < aspect_ratio * h:
w = h * aspect_rat... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def convert_bbox(bbox, width, height):\n min_x, min_y, max_x, max_y = bbox\n # scale X axis\n min_x *= width\n max_x *= width\n # invert Y axis and scale\n min_y = (1 - min_y) * height\n max_y = (1 - max_y) * height\n\n return min_x, min_y, max_x, max_y",
"def bbox_center(bbox):\n y, x... | [
"0.75232863",
"0.7178448",
"0.6820508",
"0.680587",
"0.680587",
"0.6712534",
"0.6692981",
"0.6637324",
"0.6603371",
"0.6579222",
"0.65749794",
"0.65723354",
"0.6563476",
"0.65543187",
"0.6522507",
"0.6513551",
"0.65109605",
"0.6496731",
"0.6485101",
"0.6481753",
"0.64767355",... | 0.6177024 | 53 |
Checks whether two character chromosome elements are equal. This is provided for fullness of the system the core implementation is within the Optimisation.Chromosome.__eq__ method overwrite. | def is_equal(self, a, b):
return a == b | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __eq__(self, other):\n # for each gene in each chromosome\n for g in range(len(self.genes)):\n # if any gene values don't match, then the chromosomes aren't equal\n if self.genes[g].value != other.genes[g].value:\n return False\n # everything matched, s... | [
"0.7376069",
"0.69511425",
"0.6924126",
"0.6920197",
"0.6726079",
"0.6539885",
"0.65397084",
"0.65056235",
"0.643451",
"0.64267546",
"0.6422568",
"0.6413613",
"0.6403758",
"0.6367756",
"0.6359378",
"0.6341404",
"0.6326723",
"0.63120025",
"0.63069785",
"0.62948734",
"0.6293651... | 0.623808 | 28 |
Compute the distance between two unaligned speech waveforms | def mel_cep_dtw_dist(target, converted):
total_cost = 0
total_frames = 0
for (tar, conv) in zip(target, converted):
tar, conv = tar.astype('float64'), conv.astype('float64')
cost, _ = dtw.dtw(tar, conv, mt.logSpecDbDist)
frames = len(tar)
total_cost += cost
total_fra... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _calc_distance(hmm1, hmm2, seqs2):\n p12 = hmm1.calc_loglikelihood(seqs2)\n p22 = hmm2.calc_loglikelihood(seqs2)\n # calc total number of elements in all sequences\n # TODO: consider the case when number of elements vary from seq to seq\n n_elements = len(seqs2) * len(seqs2[0])\n return (p22 ... | [
"0.66275364",
"0.6621299",
"0.6472255",
"0.6430095",
"0.6425751",
"0.64048135",
"0.6392346",
"0.63088095",
"0.6304871",
"0.63025373",
"0.6296252",
"0.62877095",
"0.6285541",
"0.6255369",
"0.6242844",
"0.62423277",
"0.62411255",
"0.6225788",
"0.62246895",
"0.62234914",
"0.6222... | 0.0 | -1 |
Returns all image paths with the given extensions in the directory. | def get_feature_paths(start_dir, extensions = ['dcm']):
if start_dir is None:
start_dir = os.getcwd()
img_paths = []
for roots,dirs,files in os.walk(start_dir):
for name in files:
for e in extensions:
if name.endswith('.' + e):
img_paths.append... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def find_images(folder_path, extensions=('.png', '.jpg', '.tif')):\n image_full_paths = []\n for filename in os.listdir(folder_path):\n basename, extension = os.path.splitext(filename)\n if extension.lower() in extensions:\n image_full_paths.append(os.path.join(folder_path, filename)... | [
"0.8455729",
"0.79074585",
"0.777719",
"0.76999205",
"0.764755",
"0.7619192",
"0.7556975",
"0.74782246",
"0.7451435",
"0.7433362",
"0.74103874",
"0.7395848",
"0.7359271",
"0.7328922",
"0.7274254",
"0.7243583",
"0.7243583",
"0.72068715",
"0.7173131",
"0.71607155",
"0.71459913"... | 0.7424227 | 10 |
Get only nummer from the string | def get_nummeric_only(text):
nummeric_string =""
for character in text:
if character.isnumeric():
nummeric_string+=character
return nummeric_string | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def find_number(self, string):\n #string = string.encode('ascii', 'ignore')\n #return int(filter(str.isdigit, string))\n s = (re.findall('\\d+', string))\n return int(''.join(s))",
"def get_number(word):\n return int(re.match(NUMBER, word).group(1))",
"def get_number(x):\n\n r... | [
"0.72549516",
"0.7053949",
"0.69787556",
"0.68994635",
"0.6691953",
"0.6683544",
"0.6632851",
"0.6539088",
"0.64736855",
"0.6467642",
"0.64394635",
"0.6403154",
"0.639297",
"0.6373588",
"0.6364703",
"0.6335249",
"0.62866586",
"0.62499136",
"0.6241501",
"0.62414855",
"0.618654... | 0.75300103 | 0 |
Function to create tensorflow diagonal matrix with input diagonal entries. | def diag(diag_elements):
return tf.diag(tf.reshape(diag_elements, [-1])) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_diagonal(matrix):\n\tdegree_vector = tf.reduce_sum(matrix, 1)\n\tdiagonal = tf.diag(degree_vector, name = 'diagonal')\n\treturn diagonal",
"def diagonal(\n self, kernel: Kernel, inputs: Float[Array, \"N D\"]\n ) -> DiagonalLinearOperator:\n diag = vmap(lambda x: kernel(x, x))(inputs)\n\n... | [
"0.7452761",
"0.7068915",
"0.6893716",
"0.684906",
"0.68299454",
"0.68269825",
"0.67879814",
"0.67195463",
"0.6702948",
"0.67005247",
"0.6593233",
"0.6524967",
"0.63910055",
"0.63697654",
"0.63635975",
"0.6308815",
"0.6303916",
"0.6286338",
"0.6277062",
"0.6267886",
"0.625350... | 0.756098 | 0 |
Return the next node Returns _QueueNode or None Return the next node. `None` will be returned if there is no next node. | def next(self):
return self.my_next | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def next(self, node):\n if node is None:\n self.my_next = None\n else:\n if type(node) == type(_QueueNode(0)):\n self.my_next = node\n else:\n raise ValueError(\"Invalid type\")",
"def next_ele(self):\n\t\ttry:\n\t\t\tret = self._queue.... | [
"0.7482299",
"0.7025978",
"0.70203733",
"0.69917697",
"0.69917697",
"0.69917697",
"0.6956978",
"0.6883775",
"0.6857518",
"0.68393016",
"0.67897546",
"0.6717794",
"0.6699381",
"0.66742355",
"0.6664037",
"0.66408074",
"0.6603975",
"0.6516147",
"0.6513893",
"0.64649516",
"0.6406... | 0.0 | -1 |
Removes the item from the front of the queue. And return the value of the removed item. Returns int or None The value of the removed item. If the queue is empty, `None` will be returned. | def dequeue(self) -> int:
if self._tail:
temp = self._tail
self._tail = temp._previous
self._tail.next = None
self._size -= 1
return temp.data
return None | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def pop(self) -> int:\n cur = None\n if(not self.empty()):\n cur = self.queue[0] \n self.queue = self.queue[1:] \n return cur",
"def dequeue(self):\n if not self.front:\n raise AttributeError(\"Can't dequeue from an empty queue\")\n\n removed = ... | [
"0.7803077",
"0.75311047",
"0.7485364",
"0.7350754",
"0.7331083",
"0.72728825",
"0.7271808",
"0.7221793",
"0.72201943",
"0.7218898",
"0.71885103",
"0.7176328",
"0.71460044",
"0.71365976",
"0.71365976",
"0.7121378",
"0.7092396",
"0.70655817",
"0.7051443",
"0.7028444",
"0.70175... | 0.72844565 | 5 |
Evaluate an XPath expression on the stanza XML node. The expression will be evaluated in context where the common namespace | def xpath_eval(node,expr,namespaces=None):
ctxt = common_doc.xpathNewContext() #@UndefinedVariable
ctxt.setContextNode(node)
ctxt.xpathRegisterNs("ns",COMMON_NS)
if namespaces:
for prefix,uri in namespaces.items():
ctxt.xpathRegisterNs(unicode(prefix),uri)
ret=ctxt.xpathEv... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def xpath(self, expr=''):\n from xml.dom.ext import GetAllNs\n from xml import xpath\n \n dom = self.get_dom(self(method='xml'))\n context = xpath.Context.Context(dom,\n processorNss=GetAllNs(dom.documentElement))\n return xpath.Evalu... | [
"0.67246246",
"0.6415816",
"0.6191323",
"0.6064416",
"0.58050174",
"0.5767982",
"0.56192315",
"0.560801",
"0.560801",
"0.5591657",
"0.5541949",
"0.5515451",
"0.5297762",
"0.5267096",
"0.5260832",
"0.5250742",
"0.5249531",
"0.5221063",
"0.5194316",
"0.5177213",
"0.51482666",
... | 0.65267986 | 1 |
Instantiates the CIFAR ResNet architecture described in section 4.2 of the paper. Arguments | def SmallResNet(n = 9, filters = [16, 32, 64],
include_top=True, weights=None,
input_tensor=None, input_shape=None,
pooling='avg', regularizer=regularizers.l2(0.0002), activation = 'relu',
top_activation='softmax',
conv_shortcut=False, bn=T... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __init__(self, **kwargs):\n super(CIFAR10Classifier, self).__init__() #pylint: disable=super-with-arguments\n self.model_conv = models.resnet50(pretrained=True)\n for param in self.model_conv.parameters():\n param.requires_grad = False\n num_ftrs = self.model_conv.fc.in_... | [
"0.6779336",
"0.65928525",
"0.65919155",
"0.6205415",
"0.6192039",
"0.6173868",
"0.61688954",
"0.6076978",
"0.60657364",
"0.6007815",
"0.59915596",
"0.5985954",
"0.5975323",
"0.5942597",
"0.5898195",
"0.5881672",
"0.5881672",
"0.5881672",
"0.5870501",
"0.5853579",
"0.58440006... | 0.0 | -1 |
Round a datetime object to any time lapse in seconds | def round_time(dt=None, round_to=60):
if dt == None : dt = datetime.now()
seconds = (dt.replace(tzinfo=None) - dt.min).seconds
rounding = (seconds+round_to/2) // round_to * round_to
return dt + timedelta(0,rounding-seconds,-dt.microsecond) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def round_time(time):\n t_min = time.minute % 5\n t_sec = time.second\n t_mic = time.microsecond\n time = time - timedelta(minutes=t_min, seconds=t_sec, microseconds=t_mic)\n return time",
"def _round_time(dt=None, round_to=60):\n if hasattr(dt, 'tzinfo'):\n dt.replace(tzinfo=None)\n ... | [
"0.7319746",
"0.71509767",
"0.7098589",
"0.70558184",
"0.69927",
"0.69684905",
"0.6829757",
"0.6818082",
"0.68054426",
"0.66659987",
"0.6533629",
"0.63276696",
"0.6323017",
"0.63170487",
"0.6301285",
"0.6299775",
"0.6283563",
"0.622859",
"0.6186915",
"0.6161188",
"0.6160083",... | 0.71368575 | 2 |
Compute bounding boxes from masks. | def extract_bboxes(mask):
boxes = np.zeros([mask.shape[-1], 4], dtype=np.int32)
for i in range(mask.shape[-1]):
m = mask[:, :, i]
# Bounding box.
horizontal_indicies = np.where(np.any(m, axis=0))[0]
vertical_indicies = np.where(np.any(m, axis=1))[0]
if horizontal_i... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def extract_bboxes(mask):\n boxes = np.zeros([mask.shape[-1], 4], dtype=np.int32)\n for i in range(mask.shape[-1]):\n m = mask[:, :, i]\n # Bounding box.\n horizontal_indicies = np.where(np.any(m, axis=0))[0]\n vertical_indicies = np.where(np.any(m, axis=1))[0]\n if horizon... | [
"0.7822369",
"0.78139836",
"0.7725928",
"0.7461299",
"0.73264146",
"0.73167074",
"0.7166775",
"0.70373887",
"0.70283306",
"0.6982371",
"0.6840199",
"0.6770545",
"0.6766585",
"0.66791236",
"0.6641104",
"0.66124547",
"0.6609052",
"0.6588485",
"0.6554284",
"0.64965963",
"0.64940... | 0.78476 | 0 |
Creates database tables. Use migrations instead. | def db_create_models():
# db_createall doesn't work if the models aren't imported
import_string('models', silent=True)
for blueprint_name, blueprint in app.blueprints.items():
import_string('%s.models' % blueprint.import_name, silent=True)
db.create_all() | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create_tables():\n db.create_all()",
"def create_tables():\n db.create_all()",
"def create_tables():\n db.create_all()",
"def create_database_tables():\n with APP.app_context():\n DB.create_all()",
"def create_tables() -> None:\n print(\"Creating database tables using SQLA... | [
"0.8667129",
"0.8667129",
"0.8500174",
"0.8233372",
"0.81565076",
"0.8037983",
"0.78211665",
"0.7708469",
"0.7664109",
"0.7630137",
"0.75919974",
"0.75763303",
"0.75576335",
"0.7531149",
"0.75054634",
"0.75054634",
"0.75054634",
"0.75054634",
"0.75054634",
"0.75054634",
"0.75... | 0.68218213 | 96 |
Creates app folder structure. Optionally, scaffolds the app with models, forms, views and templates. \b Eg. \b Create blueprint with scaffold. | def create_blueprint(name, scaffold=False, fields=''):
print(sp.check_output('mkdir -p blueprints/%(name)s/templates/%(name)s' % locals(), shell=True), end=' ')
for static_dir in ('css', 'js', 'img'):
print(sp.check_output('mkdir -p blueprints/%(name)s/static/%(static_dir)s' % locals(), shell=True), end... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def new_app(project_name,app_name ):\n from flask_create_app.core.commands.cmd_newapp import create_new_app\n proj_dir = os.getcwd()\n create_new_app(app_name, proj_dir,project_name)",
"def make_app(app_name,test_path_name):\n os.chdir(\"%s/applications/%s\" % (os.environ['WEB2PY_PATH'], app_name))\n... | [
"0.6841619",
"0.67879504",
"0.6647413",
"0.64234865",
"0.639497",
"0.63812584",
"0.6364389",
"0.63250196",
"0.61987513",
"0.6194237",
"0.6183108",
"0.6163945",
"0.6118564",
"0.60593677",
"0.6032852",
"0.60165757",
"0.6006623",
"0.59915215",
"0.59889686",
"0.59878004",
"0.5983... | 0.6541894 | 3 |
Onehot encoding of nominal values | def to_categorical(x, n_col=None):
if not n_col:
n_col = np.amax(x) + 1
one_hot = np.zeros((x.shape[0], n_col))
one_hot[np.arange(x.shape[0]), x] = 1
return one_hot | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def one_hot_encoding(data):\n\n data_encoded = pd.get_dummies(data)\n\n return data_encoded",
"def one_hot_encode(df, ohe_cols):\n return pd.get_dummies(df, columns=ohe_cols)",
"def one_hot_encode(df, col):\n return pd.get_dummies(df, columns=[col], drop_first=True)",
"def make_onehot(x,num_label... | [
"0.8417778",
"0.82630193",
"0.82184345",
"0.81815094",
"0.81639904",
"0.81592536",
"0.81583315",
"0.8143522",
"0.8124081",
"0.8082504",
"0.8045998",
"0.80186814",
"0.79987645",
"0.7984237",
"0.7973227",
"0.7966908",
"0.7959543",
"0.7958623",
"0.79191023",
"0.79183227",
"0.788... | 0.76345474 | 63 |
Returns the mean squared error between y_true and y_pred | def mean_squared_error(y_true, y_pred):
mse = np.mean(np.power(y_true - y_pred, 2))
return mse | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def mean_squared_error(y_true, y_pred):\n mse = np.mean((y_true - y_pred)**2)\n return mse",
"def mean_squared_error(y_true, y_pred):\n\tmse = np.mean(np.power(y_true, y_pred, 2))\n\treturn mse",
"def error(self, y_true, y_pred):\n\n return mean_squared_error(y_true, y_pred)",
"def rmse(y_true, ... | [
"0.89604354",
"0.8950837",
"0.8636927",
"0.8554371",
"0.85378283",
"0.85158247",
"0.85120547",
"0.8506143",
"0.8479394",
"0.8465045",
"0.84644735",
"0.835464",
"0.8324895",
"0.8304797",
"0.81430644",
"0.8137651",
"0.8132751",
"0.8130582",
"0.8104543",
"0.79954034",
"0.7970443... | 0.89354074 | 2 |
Linearizes a network for a set of inputs. For each input in (n_inputs x in_dims), the linearization of the network around that input point is computed and returned as a FullyConnectedLayer. | def linearize_network(inputs, network):
if not network.layers:
return [FullyConnectedLayer(np.eye(inputs.shape[1]),
np.zeros(shape=(inputs.shape[1])))
for i in range(len(inputs))]
biases = network.compute(inputs)
# We get (... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def tensor_network_linear(inputs, states, output_size, bias, bias_start=0.0):\n # each coordinate of hidden state is independent- parallel\n states_tensor = nest.flatten(states)\n total_inputs = [inputs]\n total_inputs.extend(states)\n output = _linear(total_inputs, output_size, True)\n return o... | [
"0.71852475",
"0.7052541",
"0.67577904",
"0.64969784",
"0.6379175",
"0.63174474",
"0.62346095",
"0.6225414",
"0.620823",
"0.61990017",
"0.6181556",
"0.6168546",
"0.61642456",
"0.6151027",
"0.6085933",
"0.60823536",
"0.6081339",
"0.6074677",
"0.6064095",
"0.6043337",
"0.602631... | 0.7805938 | 0 |
Reduce truncated residual(=r_at) to residual(=pred_r). | def Reduce(r_at,param,reuse=False):
with tf.variable_scope('TrResidual') as scope:
if reuse:
scope.reuse_variables()
#pred_r = (-1/param) * tf.log((1/r_at) - 1)
pred_r = 1/param * tf.log(r_at/(1-r_at + 1e-8))
return pred_r | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def compute_residuals(r):\n global conv_residuals\n conv_residuals.append(r)\n return",
"def _residual_v1(self, x, kernel_size, in_filter, out_filter, stride, activate_before_residual=False):\n\n del activate_before_residual\n with tf.name_scope(\"residual_v1\") as name_scope:\... | [
"0.6064858",
"0.5904775",
"0.58542275",
"0.58452564",
"0.58433616",
"0.58408254",
"0.5792652",
"0.57523024",
"0.5631459",
"0.56284606",
"0.5614107",
"0.5600225",
"0.5576867",
"0.5548064",
"0.5540776",
"0.55265146",
"0.5487336",
"0.5469007",
"0.54467",
"0.5422139",
"0.5421005"... | 0.5647098 | 8 |
Do not return anything, modify rooms inplace instead. | def wallsAndGates(self, rooms: List[List[int]]) -> None:
if rooms == []:
return
row = len(rooms)
column = len(rooms[0])
visited = [[False for i in range(column)] for j in range(row)]
def valid(row_index, column_index):
if row_index < row and row_i... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def rooms(self, rooms):\n\n self._rooms = rooms",
"def _add_rooms(self):\r\n rooms = self.model.get_all_rooms()\r\n\r\n for room in rooms:\r\n self._add_room(room)",
"def rooms(*args):\n send.system_message('\\n'.join(rooms()))",
"def all_rooms(self):\n pass",
... | [
"0.67922723",
"0.6150443",
"0.5985418",
"0.59520423",
"0.5938853",
"0.5910455",
"0.5802791",
"0.5788961",
"0.57677865",
"0.56960684",
"0.56584203",
"0.56518275",
"0.5649922",
"0.56375164",
"0.5580176",
"0.5570199",
"0.5540112",
"0.5534412",
"0.5534412",
"0.5529608",
"0.549605... | 0.49137658 | 89 |
Do not return anything, modify rooms inplace instead. | def wallsAndGates(self, rooms: List[List[int]]) -> None:
if rooms == []:
return
row = len(rooms)
column = len(rooms[0])
visited = [[False for i in range(column)] for j in range(row)]
def valid(row_index, column_index):
if row_index < row and row_i... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def rooms(self, rooms):\n\n self._rooms = rooms",
"def _add_rooms(self):\r\n rooms = self.model.get_all_rooms()\r\n\r\n for room in rooms:\r\n self._add_room(room)",
"def rooms(*args):\n send.system_message('\\n'.join(rooms()))",
"def all_rooms(self):\n pass",
... | [
"0.67922723",
"0.6150443",
"0.5985418",
"0.59520423",
"0.5938853",
"0.5910455",
"0.5802791",
"0.5788961",
"0.57677865",
"0.56960684",
"0.56584203",
"0.56518275",
"0.5649922",
"0.56375164",
"0.5580176",
"0.5570199",
"0.5540112",
"0.5534412",
"0.5534412",
"0.5529608",
"0.549605... | 0.0 | -1 |
Export the data as csv as a string. | def export_csv(header, data):
with StringIO() as tmp:
writer = csv.DictWriter(tmp, fieldnames=header)
writer.writeheader()
writer.writerows(data)
data = tmp.getvalue()
return data | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_csv_string(self):\n df = None\n for d in self.data:\n if df is None:\n df = d.as_dataframe()\n else:\n df = df.append(d.as_dataframe())\n\n if df is None:\n return \"\"\n else:\n return df.to_csv(index=Fal... | [
"0.7818861",
"0.75051194",
"0.7365046",
"0.7247712",
"0.7151429",
"0.7137313",
"0.71001154",
"0.709342",
"0.7073753",
"0.70726496",
"0.7064882",
"0.7014092",
"0.7014092",
"0.70108575",
"0.69683474",
"0.6914852",
"0.69141084",
"0.6911863",
"0.68883586",
"0.6887966",
"0.6878339... | 0.7359944 | 3 |
Finds all blocks of a given layout. | def getBlocks(bal: "BKAlignedLayout"):
blocks = defaultdict(list)
for layer in bal.layeredGraph.layers:
for node in layer:
root = bal.root[node]
blockContents = blocks[root]
blockContents.append(node)
return blocks | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def find_blockages(self):\n debug.info(1,\"Finding blockages.\") \n for layer in [self.vert_layer_number,self.horiz_layer_number]:\n self.retrieve_blockages(layer)",
"def find_blocks(self, area, tags, count=None, order=None, point=None):\n\t\tif count != None:\n\t\t\traise NotImpl... | [
"0.645141",
"0.6361234",
"0.61563736",
"0.58998257",
"0.58987355",
"0.58616567",
"0.5830054",
"0.58044136",
"0.5767913",
"0.5762106",
"0.5729591",
"0.56962764",
"0.5663309",
"0.56315386",
"0.56241405",
"0.5604145",
"0.560213",
"0.5577769",
"0.5509176",
"0.5506606",
"0.5504003... | 0.6544498 | 0 |
Return a view of the list of tokens from [i, j). | def slice(self, i=None, j=None):
new_tokens = copy.copy(self)
new_tokens.data = self.data[i: j]
return new_tokens | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def getTokens(self):\n list = []\n for i in range(self.startIdx, self.endIdx + 1):\n token = self.sentence[i]\n list.append(token)\n return list",
"def return_tag_tokens(self, tags_indexes, observations):\n tag_pred = []\n for tag_index in tags_indexes:\n tag... | [
"0.6420934",
"0.5870301",
"0.58690697",
"0.58190936",
"0.5788967",
"0.57726216",
"0.5756984",
"0.5721273",
"0.57205",
"0.5691513",
"0.56850785",
"0.568055",
"0.5671691",
"0.56669706",
"0.56259185",
"0.5594656",
"0.5594656",
"0.5594656",
"0.5587629",
"0.55673075",
"0.55442655"... | 0.69673723 | 1 |
Returns a list of the text of each token | def words(self, uncased=False):
if uncased:
return [t[self.TEXT].lower() for t in self.data]
else:
return [t[self.TEXT] for t in self.data] | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_token_list(text):\n return text.split()",
"def getTokens(self):\n list = []\n for i in range(self.startIdx, self.endIdx + 1):\n token = self.sentence[i]\n list.append(token)\n return list",
"def get_tokens(self) -> List[str]:\n return self.tokens",
"... | [
"0.7831765",
"0.7553254",
"0.75081605",
"0.74014765",
"0.73847663",
"0.73690164",
"0.735633",
"0.73305035",
"0.7258611",
"0.7233778",
"0.72116613",
"0.7197483",
"0.7197483",
"0.7197483",
"0.71930826",
"0.71677893",
"0.7146377",
"0.7119637",
"0.7116125",
"0.710533",
"0.7080622... | 0.0 | -1 |
Returns a list of [start, end) character offsets of each token. | def offsets(self):
return [t[self.SPAN] for t in self.data] | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_tokens(self):\n\t\treturn self.get_starttokens() + self.get_endtokens()",
"def token_positions(separation):\n offsets = (-separation, 0, separation)\n for x_pos in offsets:\n for y_pos in offsets:\n yield x_pos, y_pos",
"def convert_idx(text, tokens):\n current = 0\n spans... | [
"0.7488291",
"0.6970794",
"0.66514665",
"0.66432625",
"0.6558616",
"0.6440407",
"0.63480353",
"0.6329038",
"0.63192546",
"0.62382144",
"0.623288",
"0.6215841",
"0.61828405",
"0.6164689",
"0.6144047",
"0.6141013",
"0.61344206",
"0.6122571",
"0.60886264",
"0.60227",
"0.6001985"... | 0.66103053 | 5 |
Returns a list of namedentityrecognition tags of each token. Returns None if this annotation was not included. | def entities(self):
if 'ner' not in self.annotators:
return None
return [t[self.NER] for t in self.data] | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def tags(self) -> Optional[pulumi.Input[Sequence[pulumi.Input['ExtensionAssociationTagArgs']]]]:\n return pulumi.get(self, \"tags\")",
"def tags(self) -> Optional[Any]:\n return pulumi.get(self, \"tags\")",
"def tags(self) -> Optional[Sequence[str]]:\n return pulumi.get(self, \"tags\")",
... | [
"0.6343892",
"0.63352984",
"0.62661695",
"0.62595373",
"0.6200785",
"0.61777395",
"0.61777395",
"0.6146293",
"0.6142111",
"0.6139963",
"0.61359984",
"0.6134838",
"0.61318386",
"0.61318386",
"0.61318386",
"0.61318386",
"0.61318386",
"0.61318386",
"0.61318386",
"0.61318386",
"0... | 0.62355465 | 5 |
Returns a list of all ngrams from length 1 to n. | def ngrams(self, n=1, uncased=False, filter_fn=None, as_strings=True):
def _skip(gram):
if not filter_fn:
return False
return filter_fn(gram)
words = self.words(uncased)
ngrams = [(s, e + 1)
for s in range(len(words))
f... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def ngrams(text, n):\n grams = zip(*[text[i:] for i in range(n)])\n return [''.join(gram) for gram in grams]",
"def ngrams(text, n):\n return chain(*[ngrams_(text, i) for i in range(n + 1)])",
"def get_ngrams(seq, n):\n return",
"def ngrams(words, n=1):\n return [tuple(words[j:j + n]) ... | [
"0.86101174",
"0.8502931",
"0.8441258",
"0.8434175",
"0.8414284",
"0.83849615",
"0.8335904",
"0.8312085",
"0.8242242",
"0.8135404",
"0.8132783",
"0.81266886",
"0.80864936",
"0.80320215",
"0.80265075",
"0.8024729",
"0.8016537",
"0.7979087",
"0.7966552",
"0.7959912",
"0.7935775... | 0.7615313 | 32 |
From a `Mask2D` get its origin for plotter, which is only extracted if an origin is not already in `self.visuals` and with `True` entries in the `Include2D` object are extracted for plotting. | def origin_via_mask_from(self, mask: Mask2D) -> Grid2DIrregular:
return self.get("origin", Grid2DIrregular(values=[mask.origin])) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def via_mask_from(self, mask: Mask2D) -> Visuals2D:\r\n origin = self.origin_via_mask_from(mask=mask)\r\n mask_visuals = self.get(\"mask\", mask)\r\n border = self.get(\"border\", mask.derive_grid.border_sub_1.binned)\r\n\r\n return self.visuals + self.visuals.__class__(\r\n ... | [
"0.67957056",
"0.5915571",
"0.54504776",
"0.5341723",
"0.5312308",
"0.52889234",
"0.52393883",
"0.51417446",
"0.5126154",
"0.5116535",
"0.5108155",
"0.5087901",
"0.50755525",
"0.50606495",
"0.5051707",
"0.503693",
"0.5007401",
"0.5007401",
"0.5007401",
"0.49772084",
"0.494971... | 0.73298883 | 0 |
From a `Mask2D` get its attributes that can be plotted and return them in a `Visuals2D` object. Only attributes not already in `self.visuals` and with `True` entries in the `Include2D` object are extracted for plotting. | def via_mask_from(self, mask: Mask2D) -> Visuals2D:
origin = self.origin_via_mask_from(mask=mask)
mask_visuals = self.get("mask", mask)
border = self.get("border", mask.derive_grid.border_sub_1.binned)
return self.visuals + self.visuals.__class__(
origin=origin, mask=m... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def via_grid_from(self, grid: Grid2DLike) -> Visuals2D:\r\n if not isinstance(grid, Grid2D):\r\n return self.visuals\r\n\r\n origin = self.origin_via_mask_from(mask=grid.mask)\r\n\r\n return self.visuals + self.visuals.__class__(origin=origin)",
"def get_params2D(ima, xform = \"xf... | [
"0.5621481",
"0.52429175",
"0.51223534",
"0.5120332",
"0.5071792",
"0.5067556",
"0.4972231",
"0.49085614",
"0.48752496",
"0.47747084",
"0.47348034",
"0.46465057",
"0.46200225",
"0.46137384",
"0.46064192",
"0.46021077",
"0.45991465",
"0.4598747",
"0.45880556",
"0.45564288",
"0... | 0.69218785 | 0 |
Calculates a random value from the mean & standard deviation for a normal distribution. Seed is used to set the point on the lognormal curve 0100% and var is the % variation allowed around that point. | def calcRandNorm(mean,std,seed,var):
varR = (seed*(1.0+var)-seed*(1.0-var))
val = np.random.random(size=np.size(varR))*varR+seed
np.clip(val,0.01,0.99,out=val)
val = sps.norm.ppf(val,loc=mean,scale=std)
return val | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def normal(mean, std):\n\n return random.gauss(mean, std)",
"def random_normal():\r\n return inverse_normal_cdf(random.random())",
"def normalDist(x, mean, var):\n\n if (var != 0):\n return -(x - mean)**2/(2*var) - 0.5*np.log(2*np.pi*var)\n else:\n return 0",
"def random_normal():\n ... | [
"0.74418104",
"0.727839",
"0.7239607",
"0.72173154",
"0.6997832",
"0.68671256",
"0.68299586",
"0.6813323",
"0.664916",
"0.6622569",
"0.6545723",
"0.652389",
"0.65081125",
"0.64917815",
"0.6473979",
"0.6466487",
"0.64575326",
"0.6431877",
"0.6403476",
"0.6388818",
"0.6385024",... | 0.8174164 | 0 |
Assign a unique identifier to the unit instance. | def guid(self, guid):
self._guid = guid | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _set_id(self):\n raise NotImplementedError()",
"def unique_identifier(self, unique_identifier):\n\n self._unique_identifier = unique_identifier",
"def setId(self, identifier):\n self.identifier = identifier",
"def identifier(self, identifier):\n self._identifier = identifier",... | [
"0.65741825",
"0.6564744",
"0.65594155",
"0.6308034",
"0.6308034",
"0.6251753",
"0.62211865",
"0.6218895",
"0.61827576",
"0.6176742",
"0.61508524",
"0.61508524",
"0.61508524",
"0.61508524",
"0.615083",
"0.61117065",
"0.6106036",
"0.6104656",
"0.6100143",
"0.6095097",
"0.60626... | 0.595287 | 28 |
Name property for the unit. | def name(self):
return self._name | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def getName(self):\n return _libsbml.UnitDefinition_getName(self)",
"def name(self):\n return str(self.name)",
"def get_name(self) -> str:\r\n return self.name",
"def name(self):\n return self.properties.get('name')",
"def name(self):\n return self.properties.get('name')"... | [
"0.7773994",
"0.7270462",
"0.722922",
"0.7223204",
"0.7223204",
"0.72152674",
"0.7197392",
"0.7197392",
"0.7197392",
"0.71891737",
"0.7136978",
"0.7136978",
"0.7136978",
"0.7136978",
"0.7136978",
"0.7130037",
"0.7130037",
"0.71161026",
"0.71154183",
"0.7103265",
"0.7103265",
... | 0.0 | -1 |
Set the name for the unit. | def name(self, name):
self._name = name | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def setName(self, name):\n self.name = str(name)",
"def setName(self, *args):\n return _libsbml.UnitDefinition_setName(self, *args)",
"def set_name(self, name):\n\t\tself.name_ = name",
"def set_name(self, name):\n self.name = name",
"def set_name(self, name):\n self.name = name... | [
"0.7942399",
"0.7940122",
"0.7939814",
"0.78587",
"0.78587",
"0.78587",
"0.78587",
"0.78587",
"0.78235364",
"0.7802141",
"0.7777701",
"0.7777701",
"0.7773648",
"0.7744992",
"0.7710195",
"0.7698737",
"0.76952964",
"0.7684363",
"0.7681706",
"0.7681706",
"0.7635434",
"0.763543... | 0.7432954 | 47 |
Set the plural name for the unit. | def plural(self, plural):
self._plural = plural | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def plural(unit, amount):\n if amount == 1:\n return unit\n else:\n return unit + 's'",
"def pluralisation(self, plural):\n return \"item\"",
"def plural(self):\n return self._plural",
"def t_plural(cls, partial_msg_id: str, num: int = 2) -> str:\n return lang.t_plura... | [
"0.67817175",
"0.64680135",
"0.6358984",
"0.6270587",
"0.6264949",
"0.6206428",
"0.6008478",
"0.59093565",
"0.5881909",
"0.5850094",
"0.5850094",
"0.5850094",
"0.5805438",
"0.57385546",
"0.5719308",
"0.5675906",
"0.56563",
"0.565594",
"0.56162536",
"0.55990475",
"0.5595597",
... | 0.7808533 | 0 |
Set the abbreviated name for the unit. | def abbreviation(self, abbreviation):
self._abbreviation = abbreviation | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def setName(self, *args):\n return _libsbml.UnitDefinition_setName(self, *args)",
"def set_abbreviation(self, abbreviation_name_prefix):\n abbreviation_name = abbreviation_name_prefix + self.vendor_unique_id\n self.set_value_into_input_field(self.abbreviation_textbox_locator, abbreviation_na... | [
"0.71546113",
"0.69179565",
"0.6754661",
"0.66233575",
"0.6546605",
"0.6546605",
"0.6546605",
"0.6537992",
"0.6516904",
"0.6487339",
"0.6429103",
"0.63089305",
"0.62886935",
"0.6248015",
"0.62468237",
"0.623667",
"0.6223128",
"0.6163963",
"0.61254203",
"0.61254203",
"0.612542... | 0.6732753 | 3 |
Set defaults for the LSST Scheduler's Driver. | def setDefaults(self) -> None:
self.night_boundary = -12.0
self.new_moon_phase_threshold = 20.0 | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def load_defaults(self):\n self.set_motor_limits(self.MOTOR_LEFT, self.LEFT_DEFAULT)\n self.set_motor_limits(self.MOTOR_RIGHT, self.RIGHT_DEFAULT)\n self.set_servo(self.SERVO_1, self.MIDPOINT)",
"def load_defaults(self):\n self.set_motor_limits(self.MOTOR_LEFT, self.LEFT_DEFAULT)\n ... | [
"0.65300804",
"0.65300804",
"0.65300804",
"0.64028084",
"0.6391427",
"0.6253156",
"0.6252221",
"0.6245879",
"0.623059",
"0.6205422",
"0.61827433",
"0.61700505",
"0.60782987",
"0.6073008",
"0.6067981",
"0.60252726",
"0.60207146",
"0.5980837",
"0.5945693",
"0.5912952",
"0.59118... | 0.5734153 | 32 |
Get the current state of the scheduling algorithm as a file object. Returns | def get_state_as_file_object(self) -> io.BytesIO:
raise NotImplementedError("Get state as file object not implemented.") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_file_state(self, filename):\n # load the pickle file\n pkl_fid = open(OUTPUT_PATH + '/sio.pckl')\n sio_db = pickle.load(pkl_fid)\n pkl_fid.close()\n\n # get the file state for this filename\n return sio_db.file_state.get(filename)",
"def file(self):\n if s... | [
"0.6348901",
"0.6293761",
"0.61412954",
"0.61315054",
"0.6072039",
"0.606558",
"0.60648406",
"0.600452",
"0.59892523",
"0.59650356",
"0.596104",
"0.596104",
"0.596104",
"0.58628327",
"0.58396065",
"0.5815005",
"0.5806809",
"0.57971644",
"0.5784248",
"0.5770416",
"0.5757695",
... | 0.70320934 | 0 |
Add annotation to the graph between times t1 and t2 | def add_edge(self, t1, t2, key=None, attr_dict=None, **attrs):
t1 = T(t1)
t2 = T(t2)
# make sure Ts are connected in correct chronological order
if t1.anchored and t2.anchored:
assert t1 <= t2
super(Transcription, self).add_edge(t1, t2, key=key, attr_dict=attr_dict,... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def timeSpaceDiagramMethod(self):\n fig, ax1 = plt.subplots()\n\n ax1.set_xlabel('Time (s)', fontsize=24, fontweight='bold')\n ax1.set_ylabel('Distance (m)', fontsize=24, fontweight='bold')\n max_x_limit = self.xAxisRange-100\n plt.xlim([0, max_x_limit])\n plt.ylim([0, max... | [
"0.6410203",
"0.6172774",
"0.5992546",
"0.5906229",
"0.5897106",
"0.57135123",
"0.5706056",
"0.56808233",
"0.56760347",
"0.562518",
"0.55780005",
"0.55492127",
"0.5536095",
"0.5533227",
"0.5522974",
"0.547539",
"0.5459312",
"0.5456926",
"0.545654",
"0.5406246",
"0.5377059",
... | 0.5169668 | 41 |
Ordering graph t1 > t2 in the ordering graph indicates that t1 happens before t2. A missing edge simply means that it is not clear yet. | def ordering_graph(self):
g = nx.DiGraph()
# add times
for t in self.nodes_iter():
g.add_node(t)
# add existing edges
for t1, t2 in self.edges_iter():
g.add_edge(t1, t2)
# connect every pair of anchored times
anchored = sorted(self.anch... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def compare(self, t2) -> bool:\n return True if self.get_edge(t2) >= 0 else False",
"def __gt__(self, other):\n return self.head_vertex > other.head_vertex and self.tail_vertex > other.tail_vertex",
"def __gt__(self, other):\n if self.head_vertex <= other.head_vertex:\n return F... | [
"0.6983687",
"0.6545409",
"0.6490181",
"0.6490181",
"0.62972766",
"0.62957525",
"0.62957525",
"0.62712896",
"0.62509745",
"0.62067235",
"0.6178168",
"0.6178168",
"0.61543816",
"0.60998136",
"0.60998136",
"0.6078478",
"0.60550284",
"0.6001574",
"0.6000123",
"0.5976091",
"0.595... | 0.57706195 | 42 |
Returns a point in the segment considered as an offset from the start of the segment. The offset is considered assuming the direction defined as if the line segment was a vector going from point a to point b | def point_at_offset(self, offset):
if offset > self.length():
raise ValueError("Offset ({0})is greater than segment length ({1})".format(offset, self.length()))
dx = self.b.x - self.a.x
dy = self.b.y - self.a.y
linelen = math.hypot(dx, dy)
return Point(self.a.x + dx ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def getOffsetLine(self, distance, side=c.INSIDE):\n StartA = np.array([self.start.x, self.start.y])\n EndA = np.array([self.end.x, self.end.y])\n r = StartA - EndA #The slope vector of self\n rn = np.array([-r[c.Y], r[c.X]]) #flip x and y and inverse y to get the normal vector of the sl... | [
"0.6827126",
"0.6763146",
"0.6671995",
"0.6598249",
"0.6504402",
"0.6475355",
"0.64282185",
"0.6409229",
"0.6343149",
"0.62978053",
"0.627086",
"0.6261065",
"0.62378895",
"0.6229276",
"0.6216285",
"0.62120485",
"0.6202114",
"0.6191976",
"0.61870503",
"0.6181785",
"0.6143937",... | 0.7088706 | 0 |
Test to verify instance if ImportCustomer | def test_create_import_customer_object(self):
self.assertIsInstance(self.import_customer, ImportCustomer) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_import_csv_file_return_customer_object(self):\n\n self.assertIsInstance(self.customers[0], Customer)",
"def test_data_when_import_customer_with_data(self):\n\n customer = self.customers[0]\n self.assertEqual(\"Jimena\", customer.get_first_name())\n self.assertEqual(\"Sanabria... | [
"0.7942317",
"0.7804885",
"0.75188947",
"0.6964507",
"0.6836435",
"0.68194115",
"0.658146",
"0.6421789",
"0.6418644",
"0.6226976",
"0.6214251",
"0.61750406",
"0.6172272",
"0.61514455",
"0.61141646",
"0.6092201",
"0.6090226",
"0.6078903",
"0.60705185",
"0.60683066",
"0.6052186... | 0.8294378 | 0 |
Test to verify that a customer is created with code only and empty data | def test_import_customer_without_data(self):
customer = self.import_customer.create_customer_object("cust002010", {})
self.assertIsInstance(customer, Customer) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_customer_create(self):\n self._create_model(\"customer\", self.customer_data, [\"name\", \"email\", \"phone\"])",
"def test_create_customer_success(self):\n customer = Customer.objects.create(**customer_data)\n\n self.assertTrue(isinstance(customer, Customer))\n self.assertEq... | [
"0.7644472",
"0.75496864",
"0.7515606",
"0.7355217",
"0.71650374",
"0.7134495",
"0.6981273",
"0.689978",
"0.686669",
"0.685966",
"0.6843557",
"0.67317975",
"0.66622066",
"0.6656827",
"0.66545933",
"0.66542614",
"0.6602282",
"0.65984833",
"0.65852183",
"0.6581964",
"0.65791243... | 0.737132 | 3 |
way of parsing an alphabet from a string ================= ======= alphabet property char ================= ======= ASCII_LOWER l ASCII_UPPER u ASCII_PUNCTUATION p ASCII_DIGITS d ================= ======= | def rep_to_alphabet(alph_chars: str):
# perfect fits
if np.sum([a in alph_chars for a in ['gw', 'iam', 'rimes']]) > 1:
raise ValueError('multiple perfect fitting alphabets defeat purpose')
if 'gw' in alph_chars:
return [Alphabet.PERFECT_GW]
if 'iam' in alph_chars:
return [Alphabe... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def alphametics(s):\n words = re.findall(\"[A-Za-z]+\", s)\n chars = set(\"\".join(words)) # Characters to be substituted.\n assert len(chars) <= 10 # There are only ten possible digits.\n firsts = set(w[0] for w in words) # First letters of each of word.\n chars = \"\".join(fi... | [
"0.63431126",
"0.63203204",
"0.6232049",
"0.61889064",
"0.61889064",
"0.61889064",
"0.6184948",
"0.61659956",
"0.61447066",
"0.61392987",
"0.6061643",
"0.60600716",
"0.6025021",
"0.60113186",
"0.59666806",
"0.5938459",
"0.5914417",
"0.5912746",
"0.5904687",
"0.58972263",
"0.5... | 0.6763334 | 0 |
way of parsing an alphabet to a string ================= ======= alphabet property char ================= ======= ASCII_LOWER l ASCII_UPPER u ASCII_PUNCTUATION p ASCII_DIGITS d ================= ======= | def alphabet_to_rep(alphabet: List[Alphabet]):
# perfect fits
if np.sum([a in alphabet for a in [Alphabet.PERFECT_GW, Alphabet.PERFECT_IAM, Alphabet.PERFECT_RIMES]]) > 1:
raise ValueError('multiple perfect fitting alphabets defeat purpose')
if Alphabet.PERFECT_GW in alphabet:
return 'gw'
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def rep_to_alphabet(alph_chars: str):\n # perfect fits\n if np.sum([a in alph_chars for a in ['gw', 'iam', 'rimes']]) > 1:\n raise ValueError('multiple perfect fitting alphabets defeat purpose')\n if 'gw' in alph_chars:\n return [Alphabet.PERFECT_GW]\n if 'iam' in alph_chars:\n ret... | [
"0.6895167",
"0.681369",
"0.678661",
"0.678661",
"0.678661",
"0.66782624",
"0.66186816",
"0.65606254",
"0.65606254",
"0.65587384",
"0.65565574",
"0.649866",
"0.64790523",
"0.6463456",
"0.64039975",
"0.62596565",
"0.6222003",
"0.6188658",
"0.6178018",
"0.6147855",
"0.6134472",... | 0.58502 | 40 |
Splits a given matrix into quarters. | def separa(matrix):
linha, coluna = matrix.shape
linha2, coluna2 = linha//2, coluna//2
return matrix[:linha2, :coluna2], matrix[:linha2, coluna2:], matrix[linha2:, :coluna2], matrix[linha2:, coluna2:] | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_quaternion_hamilton():\n q_ij = pr.concatenate_quaternions(pr.q_i, pr.q_j)\n assert_array_equal(pr.q_k, q_ij)\n q_ijk = pr.concatenate_quaternions(q_ij, pr.q_k)\n assert_array_equal(-pr.q_id, q_ijk)",
"def generate_quarter_boundaries(start_year:int, start_month:int, num_qtrs:int, logger:lg.L... | [
"0.5571932",
"0.5418115",
"0.53602463",
"0.5314134",
"0.5235886",
"0.5206524",
"0.5193117",
"0.5176697",
"0.5166605",
"0.5126955",
"0.51215327",
"0.50583017",
"0.50418717",
"0.50084364",
"0.4974146",
"0.49560624",
"0.49458736",
"0.49418595",
"0.4889774",
"0.4879297",
"0.48626... | 0.0 | -1 |
Returns the current user information. | def me(self):
return self.client._get(self._url()) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def current_user_info():\n\n return current_user",
"def user_info(self):\n return self.auth.get_user_by_session()",
"def user_info(self):\n \n return self.auth.get_user_by_session()",
"def user_info(self):\n response = self.query('user_info')\n return response",
"def useri... | [
"0.9055003",
"0.8654444",
"0.85291815",
"0.85110545",
"0.8469878",
"0.824273",
"0.8116876",
"0.8090181",
"0.8069488",
"0.8032989",
"0.7984763",
"0.7812883",
"0.7769921",
"0.7734967",
"0.77012867",
"0.7665808",
"0.7641438",
"0.762869",
"0.7607173",
"0.75737655",
"0.75459963",
... | 0.0 | -1 |
Return the index of the given letter in an alphabet list. | def letter_to_index(letter):
return ord(letter.lower()) - CHAR_A | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def alphabet_position(letter):\n\n alphabet='abcdefghijklmnopqrstuvwxyz'\n ALPHABET='ABCDEFGHIJKLMNOPQRSTUVWXYZ'\n\n if letter.isupper() == True:\n for x in ALPHABET:\n if letter == x:\n position = ALPHABET.index(x)\n return position\n\n else:\n fo... | [
"0.78031665",
"0.77974206",
"0.76734906",
"0.7583449",
"0.7554691",
"0.7432476",
"0.7423165",
"0.7180686",
"0.7029244",
"0.6769329",
"0.6769329",
"0.6769329",
"0.6688472",
"0.6613892",
"0.6590025",
"0.658861",
"0.65874064",
"0.6517312",
"0.64405686",
"0.63059664",
"0.63059664... | 0.81031424 | 0 |
Calls requests.patch with proper authentication | def __patch(self, url):
res = requests.patch(url, headers=self.auth_header)
res.raise_for_status()
return res | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def patch(self, request, *args, **kwargs):\n verify_secure(request)\n return super().patch(request, args, kwargs)",
"def patch(self, request, *args, **kwargs):\n verify_secure(request)\n return super().patch(request, args, kwargs)",
"def test_client_can_do_patch_request(self):\n ... | [
"0.7267678",
"0.7267678",
"0.7033772",
"0.6935502",
"0.685355",
"0.65013194",
"0.6473944",
"0.6459513",
"0.6402536",
"0.6351379",
"0.63492787",
"0.6224028",
"0.6212599",
"0.6173099",
"0.6172091",
"0.617039",
"0.6152998",
"0.61394364",
"0.6108802",
"0.6073967",
"0.6000535",
... | 0.7253243 | 2 |
Need to cast X or y to float32 | def to_float32(elem):
return elem.astype(np.float32) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def data_convert2float32 (self, data):\r\n data = data.astype(np.float32)\r\n\r\n return data",
"def read_float32(self):\n return self.read(BitTypes.FLOAT_LE_32.value)",
"def to_float32(n):\n return np.cast[\"float32\"](n)",
"def ts_float32(val):\n return np.float64(val)",
"def f... | [
"0.72121584",
"0.68592405",
"0.6763474",
"0.6665686",
"0.6577044",
"0.65580606",
"0.6541234",
"0.64049256",
"0.6355414",
"0.6317263",
"0.6317263",
"0.63104033",
"0.62292147",
"0.61804193",
"0.61711663",
"0.6080844",
"0.58363974",
"0.58045274",
"0.5804468",
"0.5790965",
"0.578... | 0.66579336 | 4 |
Get a list of all variables used in this expression. | def get_all_variables(self):
raise NotImplementedError() | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_all_variables(self):\n return []",
"def get_all_variables(self):\n return self.item.get_all_variables()",
"def variables(self):\n return [term.variable for term in self.terms]",
"def variables(self):\n return {u for u in self if u.type == 'var'}",
"def get_all_variables_... | [
"0.80978125",
"0.7943349",
"0.79398817",
"0.7904174",
"0.7858665",
"0.77603346",
"0.7740691",
"0.7729506",
"0.7729506",
"0.7729506",
"0.771654",
"0.7668793",
"0.76653355",
"0.766425",
"0.7626891",
"0.76187885",
"0.75356245",
"0.75185627",
"0.7511451",
"0.74843293",
"0.7452525... | 0.7537116 | 16 |
Get a list of all variables used in this expression. | def get_all_variables(self):
return [] | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_all_variables(self):\n return self.item.get_all_variables()",
"def variables(self):\n return [term.variable for term in self.terms]",
"def variables(self):\n return {u for u in self if u.type == 'var'}",
"def get_all_variables_names(self):\n return self.project.get_variabl... | [
"0.7943349",
"0.79398817",
"0.7904174",
"0.7858665",
"0.77603346",
"0.7740691",
"0.7729506",
"0.7729506",
"0.7729506",
"0.771654",
"0.7668793",
"0.76653355",
"0.766425",
"0.7626891",
"0.76187885",
"0.7537116",
"0.75356245",
"0.75185627",
"0.7511451",
"0.74843293",
"0.74525255... | 0.80978125 | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.