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
Returns a dictionary that contains image, mask and some metadata image (tensor) an image in the input domain mask (tensor) corresponding mask
def _getitem(self, index: int) -> dict: image = nib.load(self.imgs_paths[index]).get_fdata() / 5000.0 mask = nib.load(self.masks_paths[index]).get_fdata() sample = self.transforms(image=image, mask=mask) image = sample["image"].type(torch.float) mask = sample["mask"].type(torch....
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def read_masks(self):\n structure_mask = self.read_image(\n self.filenames[\"structure_mask\"], grayscale=True\n ).astype(np.bool)\n unknown_mask = self.read_image(self.filenames[\"unknown_mask\"], grayscale=True).astype(\n np.bool\n )\n return structure_mas...
[ "0.6668313", "0.66036576", "0.6557145", "0.6307075", "0.6256759", "0.6245187", "0.6212932", "0.6175153", "0.6153459", "0.60603625", "0.60478514", "0.6033696", "0.6029397", "0.6025895", "0.5972971", "0.5971369", "0.5971138", "0.5957246", "0.5939027", "0.59378344", "0.5920179",...
0.61907905
7
Get Guassian Blurred image.
def gaussian_blurring(self,input_image,kernel_size,sigma): #Applying Gaussian Blur filter output_image=cv2.GaussianBlur(input_image,kernel_size,sigma) return output_image
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def Blur(image):\n\n return cv2.GaussianBlur(image,(7,7),0)", "def process(self):\n self.output_image = cv.GaussianBlur(self.input_image, (7, 7), 0)\n return self.output_image", "def reblur(inp_img):\n\n img = np.array(inp_img)\n kernel_deviation = 1.5\n y_img = cv2.GaussianBlur(img, ...
[ "0.67379725", "0.6453411", "0.6384918", "0.638463", "0.6369016", "0.63306564", "0.6323981", "0.62652594", "0.6174803", "0.6127377", "0.60797215", "0.60621375", "0.6060138", "0.597405", "0.597405", "0.59653515", "0.59157306", "0.59091026", "0.59063816", "0.589384", "0.5880857"...
0.5439365
68
A list of instances of subclasses of cls. Instantiate wit kw and return just the classes with instantiate=False.
def subclasses(cls, instantiate=True, **kw): lcls = cls.__subclasses__() rcls = lcls + list(chain.from_iterable([c.__subclasses__() for c in lcls])) for c in rcls: assert isinstance(c.priority, int), \ "type(%s . priority) = %s != int" % (repr(c), type(c.priority.name)) clss = sort...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_instances(cls, recursive=False):\n instances = list(cls._instances)\n if recursive:\n for Child in cls.__subclasses__():\n instances += Child.get_instances(recursive=recursive)\n\n # Remove duplicates from multiple inheritance.\n return list(set(instanc...
[ "0.6871181", "0.6545837", "0.6439868", "0.64320594", "0.6269298", "0.62508297", "0.62404335", "0.6205164", "0.6191548", "0.6186573", "0.61813664", "0.61344796", "0.61166656", "0.60832006", "0.605793", "0.604673", "0.6029998", "0.6024881", "0.6023906", "0.6020955", "0.6018505"...
0.7896501
0
Removes the current image pixmap from the scene if it exists.
def clearImage(self): if self.hasImage(): self.scene.removeItem(self._pixmapHandle) self._pixmapHandle = None self.zoom=-1 self.scene.clear()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def clearImage(self):\n if self.hasImage():\n self.scene.removeItem(self._image)\n self._image = None", "def removeScene(self):\n del self.scene, self.imgPixmapItem", "def clean_all(self):\n self.scene.clear()\n self.image.fill(Qt.color0)", "def removeAllItem...
[ "0.77999365", "0.7713607", "0.67679715", "0.67405856", "0.65732646", "0.6544404", "0.64183676", "0.6315416", "0.61870706", "0.61847377", "0.6176843", "0.6176843", "0.6145498", "0.61438185", "0.6076787", "0.60349584", "0.6034085", "0.59172475", "0.59157044", "0.5911925", "0.58...
0.7913454
0
Returns the scene's current image pixmap as a QPixmap, or else None if no image exists.
def pixmap(self): if self.hasImage(): return self._pixmapHandle.pixmap() return None
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def pixmap(self):\n if self.hasImage():\n return self._image.pixmap()\n return None", "def image(self):\n if self.hasImage():\n return self._pixmapHandle.pixmap().toImage()\n return None", "def image(self):\n if self.hasImage():\n return self....
[ "0.79953897", "0.75290245", "0.74141395", "0.67934173", "0.6428947", "0.61595285", "0.6098856", "0.58280176", "0.5742987", "0.5732158", "0.5682366", "0.56738436", "0.5643078", "0.56390196", "0.5633685", "0.5633685", "0.5633685", "0.56182927", "0.5591214", "0.5585604", "0.5509...
0.7835423
1
Returns the scene's current image pixmap as a QImage, or else None if no image exists.
def image(self): if self.hasImage(): return self._pixmapHandle.pixmap().toImage() return None
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def pixmap(self):\n if self.hasImage():\n return self._image.pixmap()\n return None", "def image(self):\n if self.hasImage():\n return self._image.pixmap().toImage()\n return None", "def pixmap(self):\n if self.hasImage():\n return self._pixma...
[ "0.7534999", "0.7408088", "0.73241574", "0.63724405", "0.6303458", "0.6048924", "0.591101", "0.5856372", "0.5803947", "0.5762845", "0.57427037", "0.5711618", "0.5697316", "0.56774807", "0.56774807", "0.56774807", "0.5677109", "0.56465185", "0.56242377", "0.55867916", "0.55746...
0.7390021
2
Push notebooks into Databricks from a local git repo.
def push(api_client, folder, verbose): local_folder, remote_folder = _get_local_and_remote_folders(folder) workspace = WorkspaceApi(api_client) def work(): workspace.import_workspace_dir(local_folder, remote_folder, True, False, verbose=verbose) if not ver...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def push():\n branch = git.current_branch().name\n shell.run('git push -u origin {}'.format(branch))", "def call_git_push():\n print(\"This will commit and push the git repo\")\n today = datetime.datetime.today()\n call([\"git\", \"add\", \".\"])\n call([\"git\", \"commit\", \"-...
[ "0.6482049", "0.62962586", "0.62225837", "0.59839976", "0.58946466", "0.5846567", "0.5827437", "0.5812541", "0.577135", "0.5769634", "0.5716181", "0.5708902", "0.5670819", "0.559688", "0.55952805", "0.5565112", "0.55613923", "0.5537981", "0.54978377", "0.5491885", "0.54419285...
0.5091466
53
Constructor. Any message fields that are implicitly/explicitly set to None will be assigned a default value. The recommend use is keyword arguments as this is more robust to future message changes. You cannot mix inorder arguments and keyword arguments.
def __init__(self, *args, **kwds): if args or kwds: super(Pressure, self).__init__(*args, **kwds) #message fields cannot be None, assign default values for those that are if self.hlive is None: self.hlive = 0 if self.hstate is None: self.hstate = 0 if self.hfinished is ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self, *args, **kwds):\n if args or kwds:\n super(KomodoSpeechRecCommand, self).__init__(*args, **kwds)\n #message fields cannot be None, assign default values for those that are\n if self.header is None:\n self.header = std_msgs.msg.Header()\n if self.cmd is None:\n ...
[ "0.7794351", "0.7719884", "0.7719884", "0.7686347", "0.76253426", "0.7562994", "0.74395365", "0.7416649", "0.73515975", "0.730761", "0.7279932", "0.72373426", "0.72264934", "0.7223775", "0.7223775", "0.72189564", "0.72111243", "0.72111243", "0.72111243", "0.72111243", "0.7211...
0.0
-1
Returns if the word is in the trie.
def search(self, word): current = self.root for i in word: if current.hash_map.get(i) is None: return False current = current.hash_map.get(i) if current.num != 0: return True return False
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def in_trie(self, trie, word):\n current_dict = trie\n for letter in word:\n if letter in current_dict:\n current_dict = current_dict[letter]\n else:\n return False\n else:\n if '_end_' in current_dict:\n return curr...
[ "0.838632", "0.8150416", "0.8123471", "0.7856802", "0.7830664", "0.77935004", "0.7792806", "0.77642965", "0.7753436", "0.7747724", "0.7711298", "0.76816714", "0.7677101", "0.7664614", "0.76506114", "0.76338875", "0.7628353", "0.76114196", "0.7577657", "0.75695884", "0.756079"...
0.7460392
31
Reformat MM/DD/YYYY string into YYYYMMDD string.
def reformat_date(mdy_date_string): date = mdy_date_string.split('/') return f"{date[2]}-{date[0]}-{date[1]}" # difficult to read
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def reformat_date(mdy_date_string):\n month, day, year = mdy_date_string.split('/')\n return f\"{year}-{month}-{day}\"", "def fix_date(oldfmt):\n dval = oldfmt.split('/')[-1]\n datev = datetime.strptime(dval, \"%Y-%m-%d\")\n return datev.strftime(\"%B %-d, %Y\")", "def reformatdate(self, date):\...
[ "0.7590982", "0.7325246", "0.72608", "0.70451754", "0.7040852", "0.69901127", "0.6932962", "0.6908399", "0.6899866", "0.68803024", "0.68683696", "0.6860244", "0.6844194", "0.68404895", "0.68115014", "0.6746559", "0.67172223", "0.67162967", "0.6706186", "0.67007065", "0.669680...
0.76452065
0
Reformat MM/DD/YYYY string into YYYYMMDD string.
def reformat_date(mdy_date_string): month, day, year = mdy_date_string.split('/') return f"{year}-{month}-{day}"
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def reformat_date(mdy_date_string):\n date = mdy_date_string.split('/')\n return f\"{date[2]}-{date[0]}-{date[1]}\" # difficult to read", "def fix_date(oldfmt):\n dval = oldfmt.split('/')[-1]\n datev = datetime.strptime(dval, \"%Y-%m-%d\")\n return datev.strftime(\"%B %-d, %Y\")", "def reformatd...
[ "0.76450646", "0.73248696", "0.72614366", "0.70452774", "0.70411724", "0.69885546", "0.693275", "0.6907699", "0.68995225", "0.6881078", "0.6868027", "0.6860654", "0.68446493", "0.68401796", "0.68116033", "0.67460465", "0.6716601", "0.67160594", "0.67066586", "0.6700637", "0.6...
0.7590522
1
Creates Rooms in a Facility
def create_rooms(self, room_type, rooms): if room_type not in ('living_space', 'office'): raise ValueError('Invalid Room Type') for room_name in rooms: if room_type == 'living_space': room_instance = LivingSpace(room_name) elif room_type == 'office': ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_room(self, name, typ):\n if typ == \"O\":\n if not name in self.all_rooms.keys():\n new_room = Office(name)\n self.offices[name] = {'room': new_room, \"occupants\": []}\n\n return \"Room created succesfully\"\n else:\n ...
[ "0.7346681", "0.67147386", "0.6503128", "0.6485863", "0.6440803", "0.64260656", "0.6399095", "0.63743764", "0.635276", "0.6288383", "0.62576246", "0.6251781", "0.6199282", "0.6173405", "0.6163636", "0.6119259", "0.60186136", "0.5997501", "0.5995277", "0.5994179", "0.5977011",...
0.66858554
2
Add staff members to a Facility Once a staff member is added, they can be allocated a Room
def add_staff(self, staff): for name in staff: staff_instance = Staff(name) staff_instance.save(self.db)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_member(self, db: Session, *, room: Room, user: User) -> Room:\n members = [x for x in room.members]\n members.append(user)\n return self.update(db=db, db_obj=room, obj_in={\"members\": members})", "def spawn_staff(self):\n\n for i in range(self.grid.width):\n for j ...
[ "0.66502416", "0.6341285", "0.6153963", "0.6037399", "0.5982103", "0.5913478", "0.57790923", "0.5708787", "0.57075113", "0.56588984", "0.56571347", "0.56462836", "0.5634728", "0.56229407", "0.5579242", "0.5573031", "0.55612683", "0.5516594", "0.54945344", "0.54789644", "0.544...
0.6355061
1
Return True if this Room has an available slot or False otherwise.
def has_vacancy(self): return len(self.occupants) < self.capacity
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def available(self) -> bool:\n return self._is_available", "def available(self) -> bool:\n return self._available", "def available(self) -> bool:\n return self._available", "def available(self) -> bool:\n return self._available", "def available(self) -> bool:\n return sel...
[ "0.7295", "0.7266367", "0.7266367", "0.7266367", "0.7266367", "0.7266367", "0.71675116", "0.7160094", "0.7128381", "0.71216375", "0.7119812", "0.7049077", "0.6970711", "0.6970711", "0.6965429", "0.6927405", "0.69237584", "0.68763614", "0.68529737", "0.68144107", "0.68144107",...
0.0
-1
The Amazon Resource Name (ARN) of the component.
def component_arn(self) -> Optional[str]: return pulumi.get(self, "component_arn")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def arn(self) -> str:\n return pulumi.get(self, \"arn\")", "def arn(self) -> str:\n return pulumi.get(self, \"arn\")", "def arn(self) -> str:\n return pulumi.get(self, \"arn\")", "def arn(self) -> str:\n return pulumi.get(self, \"arn\")", "def arn(self) -> str:\n return p...
[ "0.7191064", "0.7191064", "0.7191064", "0.7191064", "0.7191064", "0.70031494", "0.70031494", "0.70031494", "0.70031494", "0.70031494", "0.70031494", "0.70031494", "0.70031494", "0.70031494", "0.70031494", "0.70031494", "0.70031494", "0.70031494", "0.70031494", "0.70031494", "...
0.80252075
0
Use to override the device's volume size.
def volume_size(self) -> Optional[int]: return pulumi.get(self, "volume_size")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def extend_volume(self, volume, new_size):\n spdk_name = self._get_spdk_volume_name(volume.name)\n params = {'name': spdk_name, 'size': new_size * units.Gi}\n self._rpc_call('bdev_lvol_resize', params)", "def volume(self, v: int) -> None:\n # changed so it returns to the default volum...
[ "0.68184817", "0.6804653", "0.65552616", "0.65534765", "0.65534765", "0.65534765", "0.64906114", "0.64079595", "0.6380204", "0.6361022", "0.63458496", "0.63329816", "0.6247221", "0.6241781", "0.6234759", "0.62252325", "0.620123", "0.6125119", "0.6099092", "0.603824", "0.60080...
0.68020546
2
The device to which these mappings apply.
def device_name(self) -> Optional[str]: return pulumi.get(self, "device_name")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def device(self):\n return next(self.parameters()).device", "def device(self):\n return next(self.parameters()).device", "def device(self):\n return next(self.parameters()).device", "def device(self):\n return next(self.parameters()).device", "def device(self):\n return n...
[ "0.77708614", "0.77708614", "0.77708614", "0.77708614", "0.77708614", "0.7310554", "0.73008883", "0.7296386", "0.72774124", "0.7209638", "0.7097146", "0.6969169", "0.69496566", "0.6889768", "0.6840716", "0.677567", "0.6770793", "0.6706605", "0.66874987", "0.6666736", "0.66484...
0.0
-1
The name of the AMI distribution configuration.
def name(self) -> Optional[str]: return pulumi.get(self, "name")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def name(self):\n return self._config_name", "def name(self):\n return self._config.get(CONF_NAME)", "def name(self):\n return self.config[\"name\"]", "def name(self) -> str:\n name = self._config[\"name\"]\n assert isinstance(name, str) # noqa: S101\n return name",...
[ "0.71826684", "0.6885989", "0.68765247", "0.66551936", "0.6581755", "0.65440035", "0.65440035", "0.65398103", "0.6502259", "0.6475259", "0.6434749", "0.63589317", "0.6350924", "0.6278417", "0.6241691", "0.6233668", "0.622561", "0.6100214", "0.6078985", "0.606762", "0.60621", ...
0.0
-1
The description of the container distribution configuration.
def description(self) -> Optional[str]: return pulumi.get(self, "description")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def description(self) -> ConfigNodePropertyString:\n return self._description", "def description(self):\n return self.settings['description']", "def get_config_descr(self, name):\n return self.configs[name][1]", "def description(self):\n return self._domain.description", "def ge...
[ "0.70169866", "0.66577846", "0.6566839", "0.6484453", "0.64492756", "0.63934475", "0.63934475", "0.63934475", "0.63934475", "0.63934475", "0.63934475", "0.63934475", "0.63934475", "0.63934475", "0.63934475", "0.63934475", "0.63934475", "0.6391682", "0.63873327", "0.63645357", ...
0.0
-1
The owner account ID for the fastlaunch enabled Windows AMI.
def account_id(self) -> Optional[str]: return pulumi.get(self, "account_id")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def owner_account_id(self) -> pulumi.Output[str]:\n return pulumi.get(self, \"owner_account_id\")", "def owner_id(self) -> str:\n return pulumi.get(self, \"owner_id\")", "def owner_account_id(self) -> Optional[pulumi.Input[str]]:\n return pulumi.get(self, \"owner_account_id\")", "def own...
[ "0.79870206", "0.77915555", "0.761949", "0.7477551", "0.7381904", "0.71631205", "0.7094557", "0.7044732", "0.696285", "0.68757355", "0.68757355", "0.6729074", "0.66746116", "0.66407484", "0.66112775", "0.6593305", "0.6593273", "0.65680665", "0.656655", "0.654042", "0.6498285"...
0.5883037
94
The name of the launch template to use for faster launching for a Windows AMI.
def launch_template_name(self) -> Optional[str]: return pulumi.get(self, "launch_template_name")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def launch_template_name(self) -> pulumi.Output[Optional[str]]:\n return pulumi.get(self, \"launch_template_name\")", "def launch_template_name(self) -> Optional[pulumi.Input[str]]:\n return pulumi.get(self, \"launch_template_name\")", "def get_launch_template(lt_name):\n logger.info(f'Describ...
[ "0.76607496", "0.75907534", "0.6500886", "0.64402634", "0.64280105", "0.6420781", "0.63896555", "0.63896555", "0.6228604", "0.6207431", "0.62057006", "0.6137971", "0.61320853", "0.5956605", "0.5936516", "0.5917477", "0.5913817", "0.5869647", "0.5863787", "0.58053887", "0.5804...
0.7785544
0
The version of the launch template to use for faster launching for a Windows AMI.
def launch_template_version(self) -> Optional[str]: return pulumi.get(self, "launch_template_version")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def launch_template_name(self) -> Optional[str]:\n return pulumi.get(self, \"launch_template_name\")", "def get_launch_template_spec(instance_type):\n return {'LaunchTemplateId': launch_template_ids[instance_type], 'Version': '$Default'}", "def launch_template(self) -> Optional['outputs.Distribut...
[ "0.6512453", "0.6506118", "0.64709836", "0.64611137", "0.6301759", "0.6232857", "0.6199135", "0.61922336", "0.61188525", "0.60105467", "0.5981961", "0.5975101", "0.5975101", "0.59683067", "0.59683067", "0.59683067", "0.5916981", "0.58882636", "0.5873578", "0.5873578", "0.5873...
0.78969115
0
The ARN for an Amazon Web Services Organization that you want to share your AMI with.
def organization_arns(self) -> Optional[Sequence[str]]: return pulumi.get(self, "organization_arns")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def organization_arn(self) -> pulumi.Output[Optional[str]]:\n return pulumi.get(self, \"organization_arn\")", "def organization_arn(self) -> Optional[pulumi.Input[str]]:\n return pulumi.get(self, \"organization_arn\")", "def organization_arn(self) -> Optional[pulumi.Input[str]]:\n return p...
[ "0.6491133", "0.64370763", "0.64370763", "0.61768895", "0.61768895", "0.61768895", "0.61768895", "0.61768895", "0.608161", "0.608161", "0.608161", "0.608161", "0.608161", "0.608161", "0.608161", "0.608161", "0.608161", "0.608161", "0.608161", "0.608161", "0.608161", "0.6081...
0.57118946
61
The ARN for an Organizations organizational unit (OU) that you want to share your AMI with.
def organizational_unit_arns(self) -> Optional[Sequence[str]]: return pulumi.get(self, "organizational_unit_arns")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def organization_arn(self) -> pulumi.Output[Optional[str]]:\n return pulumi.get(self, \"organization_arn\")", "def organizational_unit_arn(self) -> pulumi.Output[Optional[str]]:\n return pulumi.get(self, \"organizational_unit_arn\")", "def organization_arn(self) -> Optional[pulumi.Input[str]]:\n ...
[ "0.6514189", "0.64210725", "0.63826585", "0.63826585", "0.6313867", "0.6313867", "0.604869", "0.604869", "0.604869", "0.604869", "0.604869", "0.60316145", "0.5997899", "0.5997899", "0.5997899", "0.5997899", "0.5997899", "0.5997899", "0.5997899", "0.5997899", "0.5997899", "0...
0.57041615
44
The name of the group.
def user_groups(self) -> Optional[Sequence[str]]: return pulumi.get(self, "user_groups")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def group_name(self) -> str:\n return pulumi.get(self, \"group_name\")", "def group_name(self):\n\n return self._group_name", "def get_group_name(self):\n return self.groupname", "def name(self):\n return f\"{self._group.friendly_name} {GROUP_SUFFIX}\"", "def group_name(self) ->...
[ "0.9249819", "0.9016461", "0.8926357", "0.86287326", "0.8597322", "0.8539834", "0.8430861", "0.8430861", "0.8359449", "0.8329936", "0.8194932", "0.8194932", "0.80562013", "0.8042796", "0.8042796", "0.7985607", "0.79016817", "0.79016817", "0.7889013", "0.78830576", "0.7882004"...
0.0
-1
The AWS account ID.
def user_ids(self) -> Optional[Sequence[str]]: return pulumi.get(self, "user_ids")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def account_id(self) -> str:\n return pulumi.get(self, \"account_id\")", "def account_id(self) -> str:\n return pulumi.get(self, \"account_id\")", "def account_id(self) -> str:\n return pulumi.get(self, \"account_id\")", "def account_id(self) -> str:\n return pulumi.get(self, \"ac...
[ "0.8054578", "0.8054578", "0.8054578", "0.8054578", "0.8054578", "0.8054578", "0.8054578", "0.8054578", "0.7759753", "0.77339196", "0.77339196", "0.77339196", "0.7692508", "0.76870245", "0.763928", "0.763928", "0.7575482", "0.75298274", "0.7520777", "0.75130975", "0.75069237"...
0.0
-1
The account ID that this configuration applies to.
def account_id(self) -> Optional[str]: return pulumi.get(self, "account_id")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def account_id(self):\n return self.config.account_id", "def account_id(self):\n return self._account_id", "def account_id(self) -> str:\n return self._account_id", "def account_id(self) -> str:\n return pulumi.get(self, \"account_id\")", "def account_id(self) -> str:\n r...
[ "0.9474707", "0.8826064", "0.8809587", "0.8801157", "0.8801157", "0.8801157", "0.8801157", "0.8801157", "0.8801157", "0.8801157", "0.8801157", "0.8777217", "0.85403967", "0.84571755", "0.84571755", "0.84571755", "0.8387263", "0.8340455", "0.8328375", "0.82334095", "0.82334095...
0.8491654
17
Contains settings for the SSM agent on your build instance.
def systems_manager_agent(self) -> Optional['outputs.ImageRecipeSystemsManagerAgent']: return pulumi.get(self, "systems_manager_agent")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def settings(self):\n if self._settings is not None:\n return self._settings\n\n settings = self.binaries['KeeAgent.settings'].content\n self._settings = objectify.fromstring(settings)\n return self._settings", "def get_settings(self):\n return {\n \"game_...
[ "0.6548634", "0.64419276", "0.5923232", "0.5742373", "0.5680411", "0.56509167", "0.55676943", "0.55676943", "0.5517533", "0.55012864", "0.5489477", "0.5477533", "0.5476079", "0.546783", "0.54672176", "0.5436635", "0.5424833", "0.53971535", "0.5386839", "0.5366283", "0.5366283...
0.0
-1
The Amazon Resource Name (ARN) of the component.
def component_arn(self) -> Optional[str]: return pulumi.get(self, "component_arn")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def arn(self) -> str:\n return pulumi.get(self, \"arn\")", "def arn(self) -> str:\n return pulumi.get(self, \"arn\")", "def arn(self) -> str:\n return pulumi.get(self, \"arn\")", "def arn(self) -> str:\n return pulumi.get(self, \"arn\")", "def arn(self) -> str:\n return p...
[ "0.7191064", "0.7191064", "0.7191064", "0.7191064", "0.7191064", "0.70031494", "0.70031494", "0.70031494", "0.70031494", "0.70031494", "0.70031494", "0.70031494", "0.70031494", "0.70031494", "0.70031494", "0.70031494", "0.70031494", "0.70031494", "0.70031494", "0.70031494", "...
0.80252075
1
Use to override the device's volume size.
def volume_size(self) -> Optional[int]: return pulumi.get(self, "volume_size")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def extend_volume(self, volume, new_size):\n spdk_name = self._get_spdk_volume_name(volume.name)\n params = {'name': spdk_name, 'size': new_size * units.Gi}\n self._rpc_call('bdev_lvol_resize', params)", "def volume(self, v: int) -> None:\n # changed so it returns to the default volum...
[ "0.68184817", "0.6804653", "0.65552616", "0.65534765", "0.65534765", "0.65534765", "0.64906114", "0.64079595", "0.6380204", "0.6361022", "0.63458496", "0.63329816", "0.6247221", "0.6241781", "0.6234759", "0.62252325", "0.620123", "0.6125119", "0.6099092", "0.603824", "0.60080...
0.68020546
3
The device to which these mappings apply.
def device_name(self) -> Optional[str]: return pulumi.get(self, "device_name")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def device(self):\n return next(self.parameters()).device", "def device(self):\n return next(self.parameters()).device", "def device(self):\n return next(self.parameters()).device", "def device(self):\n return next(self.parameters()).device", "def device(self):\n return n...
[ "0.7771324", "0.7771324", "0.7771324", "0.7771324", "0.7771324", "0.7310379", "0.7300264", "0.72962564", "0.7277042", "0.72101164", "0.7097666", "0.696802", "0.6949819", "0.68880427", "0.6841364", "0.67772", "0.6768175", "0.67065585", "0.6687681", "0.66658443", "0.6648081", ...
0.0
-1
Contains settings for the SSM agent on your build instance.
def __init__(__self__, *, uninstall_after_build: Optional[bool] = None): if uninstall_after_build is not None: pulumi.set(__self__, "uninstall_after_build", uninstall_after_build)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def settings(self):\n if self._settings is not None:\n return self._settings\n\n settings = self.binaries['KeeAgent.settings'].content\n self._settings = objectify.fromstring(settings)\n return self._settings", "def get_settings(self):\n return {\n \"game_...
[ "0.654885", "0.64432317", "0.59246373", "0.57439", "0.5680014", "0.56521434", "0.5569286", "0.5569286", "0.55196846", "0.55026966", "0.549086", "0.5478354", "0.5476615", "0.5469427", "0.54692465", "0.5437534", "0.5426405", "0.53963906", "0.5387106", "0.5367907", "0.5367907", ...
0.0
-1
Controls whether the SSM agent is removed from your final build image, prior to creating the new AMI. If this is set to true, then the agent is removed from the final image. If it's set to false, then the agent is left in, so that it is included in the new AMI. The default value is false.
def uninstall_after_build(self) -> Optional[bool]: return pulumi.get(self, "uninstall_after_build")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def remove_agent(self):\n self.model.grid.remove_agent(self)\n self.model.schedule.remove(self)\n\n if self.agent_type == \"zombie\":\n self.model.infected -= 1\n elif self.agent_type == \"human\":\n self.model.susceptible -= 1\n del self", "def test_compo...
[ "0.54542243", "0.517813", "0.505942", "0.5006941", "0.49519476", "0.49481696", "0.493447", "0.4934245", "0.4934245", "0.49324697", "0.48917982", "0.48220247", "0.47406355", "0.46717295", "0.46419892", "0.46239337", "0.46203905", "0.46091574", "0.45765468", "0.45710993", "0.45...
0.5522736
0
Hide the Editor frame
def hide_editor(self): self.frame.Hide()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def hide(self):\r\n\t\tself.frame.Show(False)", "def hide(self):\n self.frame.grid_forget()\n self.visible = False", "def hide(self):\n\n self.stop_repl()\n self.visible = False\n self.withdraw() # Hide window", "def hide(self):\n self.visible = False", "def hide(...
[ "0.8230112", "0.78343356", "0.76082706", "0.75906724", "0.7560318", "0.749467", "0.7476999", "0.74718237", "0.7314781", "0.7129418", "0.71185094", "0.7091876", "0.70750076", "0.70323706", "0.69532067", "0.6922021", "0.691673", "0.6901858", "0.68986416", "0.68986416", "0.68901...
0.93959975
0
Convert text line to dataframe.
def build_dataframe(textline): column_names = [] records = [line.split(u',') for line in textline] records = [pd.np.nan if token in (u'\\N', 'NULL') else token for token in records] # df_line = pd.read_csv(textline, header=None, names=column_names) df = pd.Dat...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def convert_text_to_df(text):\n new_list = [i.strip() for i in text.splitlines() if i.strip() != \"\"]\n new_dict = {}\n col_name = new_list[0].strip().split()\n index_name = new_list[1].strip()\n for item in new_list[2:]:\n index, *others = item.split()\n others = [float(i) for i in o...
[ "0.752172", "0.68173903", "0.6759135", "0.63702023", "0.6357456", "0.63191575", "0.62339556", "0.61799276", "0.6121947", "0.60799277", "0.6054078", "0.5966659", "0.59273255", "0.59195846", "0.5917633", "0.5856612", "0.5832698", "0.5824041", "0.58087665", "0.57946724", "0.5788...
0.7698173
0
by default, forward input to cost and subtree, and take output from the subtree
def init_state(self, network): subtree = self._children["subtree"].children cost = self._children["cost"].children # forward input to both children network.forward_input_to(subtree.name) network.forward_input_to(cost.name) # take output from the subtree network.ta...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def forward(self, input=None):\n if (input is not None) and (self.result is None):\n self.result = self.node(input)\n\n elif self.result is None:\n raise ValueError(\"There must be some input or a previously calculated result\")\n\n return self.result.view(*self.G.d_out)"...
[ "0.6293857", "0.6018126", "0.6018126", "0.5983648", "0.5983648", "0.5983648", "0.59182084", "0.5917874", "0.59096485", "0.58576286", "0.58372796", "0.5809666", "0.57992524", "0.577773", "0.5733227", "0.5709803", "0.5696223", "0.5680157", "0.56793106", "0.5677487", "0.5671001"...
0.60384303
1
Returns the offset in seconds to GMT from a specific timezone (tz) at a specific time (t). NB! The _tzoffset result is the same same sign as the time zone, i.e. GMT+2 has a 7200 second offset. This is the opposite sign of time.timezone which (confusingly) is 7200 for GMT+2.
def _tzoffset(tz, t): try: return _TZINFO[tz].info(t)[0] except Exception: if numericTimeZoneMatch(tz) is not None: return int(tz[0:3]) * 3600 + int(tz[0] + tz[3:5]) * 60 else: return 0 # ??
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_tz_offset_seconds() -> float:\n import time\n import datetime\n tval = time.time()\n utc_offset = (datetime.datetime.fromtimestamp(tval) -\n datetime.datetime.utcfromtimestamp(tval)).total_seconds()\n return utc_offset", "def tzoffset(self):\n return _tzoffset(self....
[ "0.74398166", "0.7062385", "0.6961967", "0.6942179", "0.6833366", "0.6768012", "0.67202467", "0.6718529", "0.6715143", "0.6622376", "0.65156436", "0.6492002", "0.6430788", "0.6341408", "0.62024295", "0.61872435", "0.6065287", "0.60378027", "0.60180354", "0.6009388", "0.598049...
0.8368048
0
Takes an offset, such as from _tzoffset(), and returns an rfc822 compliant zone specification. Please note that the result of _tzoffset() is the negative of what time.localzone and time.altzone is.
def _tzoffset2rfc822zone(seconds): return "%+03d%02d" % divmod((seconds // 60), 60)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def parse_offset(tz_offset: str, tz_name: str = None) -> tzoffset:\n\n def remove_prefixes(text, prefixes):\n for prefix in prefixes:\n if text.startswith(prefix):\n text = text[len(prefix) :] # noqa # black and flake8 fight over this one\n return text\n\n # Parse ho...
[ "0.6927584", "0.68985486", "0.6886012", "0.6314385", "0.6304599", "0.6231638", "0.62225014", "0.6150216", "0.6012236", "0.5900019", "0.58197796", "0.5769525", "0.5753338", "0.5732382", "0.5672894", "0.5657108", "0.56386375", "0.55873233", "0.5576582", "0.55571926", "0.5555352...
0.58378744
10
Takes an offset, such as from _tzoffset(), and returns an ISO 8601 compliant zone specification. Please note that the result of _tzoffset() is the negative of what time.localzone and time.altzone is.
def _tzoffset2iso8601zone(seconds): return "%+03d:%02d" % divmod((seconds // 60), 60)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_fixed_timezone(offset):\n\n if isinstance(offset, timedelta):\n offset = offset.total_seconds() // 60\n\n sign = \"-\" if offset < 0 else \"+\"\n hhmm = \"%02d%02d\" % divmod(abs(offset), 60)\n name = sign + hhmm\n\n return timezone(timedelta(minutes=offset), name)", "def get_fixed_...
[ "0.66648674", "0.6617603", "0.6598453", "0.6555272", "0.6091387", "0.6035639", "0.6020284", "0.59815", "0.593755", "0.5852733", "0.5837383", "0.58018744", "0.5772172", "0.57200205", "0.57058865", "0.5699742", "0.5685528", "0.5666741", "0.5643046", "0.56414855", "0.56214434", ...
0.5724988
13
Return a new datetime object. A DateTime object always maintains its value as an absolute UTC time, and is represented in the context of some timezone based on the arguments used to create the object. A DateTime object's methods return values based on the timezone context. Note that in all cases the local machine timez...
def _parse_args(self, *args, **kw): datefmt = kw.get('datefmt', getDefaultDateFormat()) d = t = s = None ac = len(args) microsecs = None if ac == 10: # Internal format called only by DateTime yr, mo, dy, hr, mn, sc, tz, t, d, s = args elif ac == ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def omniscient_datetime(*args):\n d = original_datetime(*args)\n if settings.USE_TZ:\n d = timezone.make_aware(d, timezone.utc)\n return d", "def dt(*args, **kwargs):\n \n if 'tz' in kwargs:\n tzinfo = kwargs.pop('tz')\n else:\n tzinfo = kwargs.pop('tzinfo', None)\n ...
[ "0.68761533", "0.6549881", "0.64921165", "0.6474643", "0.6409026", "0.6265559", "0.6256599", "0.6248402", "0.62375325", "0.6101833", "0.60786086", "0.6074848", "0.6063171", "0.605014", "0.60465616", "0.6044126", "0.60254955", "0.59829426", "0.59803814", "0.5968523", "0.593397...
0.0
-1
Return the date/time as a floatingpoint number in UTC, in the format used by the Python time module. Note that it is possible to create date/time values with DateTime that have no meaningful value to the time module.
def timeTime(self): return self._micros / 1000000.0
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _utc_date(self):\n if self.date_stamp == '0':\n return '0'\n else:\n if '.' in self.date_stamp:\n t = datetime.datetime.strptime(self.date_stamp,\n '%Y%m%d%H%M%S.%f')\n else:\n t = datetime.datetime.strptime(sel...
[ "0.7104952", "0.6783953", "0.6672905", "0.66581106", "0.6434604", "0.6318582", "0.6313438", "0.6269746", "0.62245", "0.6185268", "0.6175883", "0.61740094", "0.6121154", "0.6120147", "0.6072429", "0.6036648", "0.60229796", "0.5926571", "0.5921829", "0.5915268", "0.5889356", ...
0.0
-1
Return a DateTime with the value as the current object, represented in the indicated timezone.
def toZone(self, z): t, tz = self._t, _TZINFO._zmap[z.lower()] micros = self.micros() tznaive = False # you're performing a timzone change, can't be naive try: # Try to use time module for speed. yr, mo, dy, hr, mn, sc = safegmtime(t + _tzoffset(tz, t))[:6] ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def now(cls, tz=None):\n return datetime()", "def get_now(self, tz=None):\n return get_now(tz=tz, default_tz=self.default_tz)", "def now(self):\n if 'timezone' in self._data:\n return pytz.utc.localize(datetime.datetime.utcnow()).astimezone(pytz.timezone(self._data['timezone']))...
[ "0.7314753", "0.70316035", "0.6999923", "0.6996556", "0.68479586", "0.67914337", "0.67773145", "0.6744868", "0.6740367", "0.66061556", "0.65979177", "0.65448684", "0.65281063", "0.6521261", "0.64880246", "0.64704764", "0.64424086", "0.64108", "0.63647777", "0.63529146", "0.63...
0.5539054
91
Return true if this object represents a date/time that falls within the current month, in the context of this object's timezone representation.
def isCurrentMonth(self): t = time() gmt = safegmtime(t + _tzoffset(self._tz, t)) return gmt[0] == self._year and gmt[1] == self._month
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def isCurrentDay(self):\n t = time()\n gmt = safegmtime(t + _tzoffset(self._tz, t))\n return (gmt[0] == self._year and gmt[1] == self._month and\n gmt[2] == self._day)", "def is_startmonth(today):\n if isinstance(today, datetime):\n if today.day == 1:\n re...
[ "0.6662267", "0.66487384", "0.6518789", "0.6433111", "0.62040526", "0.615508", "0.6087373", "0.6054832", "0.5993255", "0.5969998", "0.5947868", "0.5923783", "0.5904356", "0.58151025", "0.57498646", "0.5699135", "0.56832695", "0.5680588", "0.56746984", "0.5670092", "0.5668495"...
0.8414254
0
Return true if this object represents a date/time that falls within the current day, in the context of this object's timezone representation.
def isCurrentDay(self): t = time() gmt = safegmtime(t + _tzoffset(self._tz, t)) return (gmt[0] == self._year and gmt[1] == self._month and gmt[2] == self._day)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def isCurrentHour(self):\n t = time()\n gmt = safegmtime(t + _tzoffset(self._tz, t))\n return (gmt[0] == self._year and gmt[1] == self._month and\n gmt[2] == self._day and gmt[3] == self._hour)", "def is_today(self, dt: datetime.datetime) -> bool:\n\n if self is Day.DAILY:\...
[ "0.705215", "0.67152447", "0.6633701", "0.6603249", "0.65439093", "0.64475363", "0.64147735", "0.63191307", "0.62806517", "0.62730324", "0.6235183", "0.62341785", "0.6231661", "0.6212905", "0.62096846", "0.6176303", "0.61473113", "0.6136239", "0.612664", "0.6125106", "0.61236...
0.82420146
0
Return true if this object represents a date/time that falls within the current hour, in the context of this object's timezone representation.
def isCurrentHour(self): t = time() gmt = safegmtime(t + _tzoffset(self._tz, t)) return (gmt[0] == self._year and gmt[1] == self._month and gmt[2] == self._day and gmt[3] == self._hour)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_home_hour(self, time_of_day):\n return time_of_day >= self.constants.HOME_HOUR_START / \\\n self.constants.DURATION_MAX", "def has_timezone(self):\n if self._meta is not None:\n if 'timezone' in self.meta:\n return True\n\n return False", "def ha...
[ "0.6866786", "0.68480355", "0.66172326", "0.65653026", "0.65132487", "0.6489922", "0.62828946", "0.62811536", "0.628075", "0.62296736", "0.6182676", "0.61325806", "0.6111242", "0.6110154", "0.60923934", "0.609238", "0.6053397", "0.60390365", "0.6015585", "0.6002123", "0.59996...
0.83877736
0
Return a new DateTime object that represents the earliest possible time (in whole seconds) that still falls within the current object's day, in the object's timezone context.
def earliestTime(self): return self.__class__( self._year, self._month, self._day, 0, 0, 0, self._tz)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def start(self):\n if self.start_time is None:\n time = datetime.time(hour=19, tzinfo=CET)\n else:\n time = self.start_time.replace(tzinfo=CET)\n return datetime.datetime.combine(self.date, time)", "def get_today_start():\n return datetime.combine(datetime.today(), t...
[ "0.6422922", "0.6374857", "0.62946504", "0.62443125", "0.61853343", "0.6055116", "0.60182786", "0.60182786", "0.6007353", "0.5965622", "0.59552246", "0.5939701", "0.588648", "0.5886107", "0.5886107", "0.587014", "0.58688027", "0.5825176", "0.5812672", "0.5789939", "0.57752943...
0.7126084
0
Return a new DateTime object that represents the latest possible time (in whole seconds) that still falls within the current object's day, in the object's timezone context.
def latestTime(self): return self.__class__( self._year, self._month, self._day, 23, 59, 59, self._tz)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def now(cls):\n return DateTime(*time.localtime())", "async def get_now(self) -> dt.datetime:\n now = await self.AD.sched.get_now()\n return now.astimezone(self.AD.tz)", "def now(cls, tz=None):\n return datetime()", "def get_now(self, tz=None):\n return get_now(tz=tz, defau...
[ "0.64946395", "0.64916605", "0.62016237", "0.61521375", "0.61336374", "0.6120772", "0.60995674", "0.6079213", "0.6050465", "0.60364693", "0.6006962", "0.59771186", "0.59534717", "0.5929396", "0.5908056", "0.5883468", "0.58737075", "0.58254325", "0.58051264", "0.57893664", "0....
0.6675551
0
Compare this DateTime object to another DateTime object OR a floating point number such as that which is returned by the Python time module. Returns true if the object represents a date/time greater than the specified DateTime or time module style time. Revised to give more correct results through comparison of long in...
def greaterThan(self, t): if t is None: return True if isinstance(t, (float, int)): return self._micros > long(t * 1000000) else: return self._micros > t._micros
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __gt__(self, other):\n return self.to_seconds() > other.to_seconds()", "def __gt__(self, other):\n return self.to_seconds() > other.to_seconds()", "def __cmp__(self, other):\n if not isinstance(other, datetime):\n types = (type(other), datetime)\n raise TypeError('Type mismatch: ...
[ "0.7010872", "0.7010872", "0.6873049", "0.67912716", "0.6762701", "0.65923715", "0.6503718", "0.6409109", "0.6323036", "0.6254817", "0.6229409", "0.62274665", "0.6158104", "0.6154421", "0.6074431", "0.60247546", "0.59869546", "0.595357", "0.5949988", "0.59094894", "0.58673847...
0.68673104
3
Compare this DateTime object to another DateTime object OR a floating point number such as that which is returned by the Python time module. Returns true if the object represents a date/time greater than or equal to the specified DateTime or time module style time. Revised to give more correct results through compariso...
def greaterThanEqualTo(self, t): if t is None: return True if isinstance(t, (float, int)): return self._micros >= long(t * 1000000) else: return self._micros >= t._micros
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __eq__(self, t):\n if not isinstance(t, DateTime):\n return False\n return (self._micros, self._tz) == (t._micros, t._tz)", "def __cmp__(self, other):\n if not isinstance(other, datetime):\n types = (type(other), datetime)\n raise TypeError('Type mismatch: %s not instanc...
[ "0.7061997", "0.69694746", "0.6886846", "0.6886846", "0.66619426", "0.65881145", "0.6561923", "0.6546217", "0.64894325", "0.6458336", "0.6361093", "0.62078923", "0.61832625", "0.61650395", "0.60501915", "0.59519696", "0.59218264", "0.5891299", "0.58857924", "0.586534", "0.585...
0.670183
4
Compare this DateTime object to another DateTime object OR a floating point number such as that which is returned by the Python time module. Returns true if the object represents a date/time equal to the specified DateTime or time module style time. Revised to give more correct results through comparison of long intege...
def equalTo(self, t): if t is None: return False if isinstance(t, (float, int)): return self._micros == long(t * 1000000) else: return self._micros == t._micros
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __eq__(self, t):\n if not isinstance(t, DateTime):\n return False\n return (self._micros, self._tz) == (t._micros, t._tz)", "def __cmp__(self, other):\n if not isinstance(other, datetime):\n types = (type(other), datetime)\n raise TypeError('Type mismatch: %s not instanc...
[ "0.74075615", "0.69543904", "0.67876285", "0.6473543", "0.63729185", "0.63729185", "0.6355418", "0.6289537", "0.6206174", "0.6205984", "0.6181677", "0.60360885", "0.6016017", "0.60047495", "0.5991009", "0.59349024", "0.59239626", "0.59175575", "0.59171367", "0.5879019", "0.58...
0.67172575
3
Compare this DateTime object to another DateTime object OR a floating point number such as that which is returned by the Python time module. Returns true if the object represents a date/time not equal to the specified DateTime or time module style time. Revised to give more correct results through comparison of long in...
def notEqualTo(self, t): return not self.equalTo(t)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __eq__(self, t):\n if not isinstance(t, DateTime):\n return False\n return (self._micros, self._tz) == (t._micros, t._tz)", "def __cmp__(self, other):\n if not isinstance(other, datetime):\n types = (type(other), datetime)\n raise TypeError('Type mismatch: %s not instanc...
[ "0.7316267", "0.69819915", "0.67882985", "0.657248", "0.6523489", "0.63893676", "0.63893676", "0.622479", "0.62172186", "0.6186166", "0.61330175", "0.611747", "0.6093826", "0.6074597", "0.60602456", "0.6027862", "0.6003813", "0.5904772", "0.5897975", "0.5890052", "0.58710015"...
0.0
-1
Compare this DateTime object to another DateTime object. Return True if their internal state is the same. Two objects representing the same time in different timezones are regared as unequal. Use the equalTo method if you are only interested in them referring to the same moment in time.
def __eq__(self, t): if not isinstance(t, DateTime): return False return (self._micros, self._tz) == (t._micros, t._tz)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def compare_datetime(self_datetime, other_datetime):\n # pylint: disable=superfluous-parens\n if (isinstance(self_datetime and other_datetime, (datetime, type(None)))):\n return (\n (self_datetime == other_datetime\n if all(str(_.time()) != \"00:00:00\"\n for _ in [se...
[ "0.71827286", "0.7085723", "0.7085715", "0.7014832", "0.6942006", "0.6761986", "0.6698628", "0.6665077", "0.6618728", "0.6562935", "0.6561812", "0.65552956", "0.6498031", "0.64860404", "0.6480493", "0.6464075", "0.6451856", "0.63861215", "0.6385311", "0.63629574", "0.63552946...
0.82303816
0
Compare this DateTime object to another DateTime object OR a floating point number such as that which is returned by the Python time module. Returns true if the object represents a date/time less than the specified DateTime or time module style time. Revised to give more correct results through comparison of long integ...
def lessThan(self, t): if t is None: return False if isinstance(t, (float, int)): return self._micros < long(t * 1000000) else: return self._micros < t._micros
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __cmp__(self, other):\n if not isinstance(other, datetime):\n types = (type(other), datetime)\n raise TypeError('Type mismatch: %s not instance of %s' % types)\n # pylint: disable=protected-access\n return (self._cmp(self._days, other._days)\n or self._cmp(self.seconds, other.seco...
[ "0.7109928", "0.6764142", "0.6764142", "0.6672138", "0.66532487", "0.6596538", "0.6579246", "0.65784633", "0.6400461", "0.61673385", "0.6140804", "0.61321425", "0.6105782", "0.6088082", "0.605102", "0.5959152", "0.59129643", "0.58819234", "0.5869536", "0.585081", "0.5846645",...
0.67896366
1
Compare this DateTime object to another DateTime object OR a floating point number such as that which is returned by the Python time module. Returns true if the object represents a date/time less than or equal to the specified DateTime or time module style time. Revised to give more correct results through comparison o...
def lessThanEqualTo(self, t): if t is None: return False if isinstance(t, (float, int)): return self._micros <= long(t * 1000000) else: return self._micros <= t._micros
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __cmp__(self, other):\n if not isinstance(other, datetime):\n types = (type(other), datetime)\n raise TypeError('Type mismatch: %s not instance of %s' % types)\n # pylint: disable=protected-access\n return (self._cmp(self._days, other._days)\n or self._cmp(self.seconds, other.seco...
[ "0.7132898", "0.68890226", "0.67965525", "0.67965525", "0.6735365", "0.6615772", "0.6611088", "0.66091555", "0.64684826", "0.6321959", "0.6294536", "0.62891334", "0.62388724", "0.61790293", "0.61707807", "0.61294353", "0.59575844", "0.5893718", "0.5806883", "0.5784637", "0.57...
0.66659397
5
Return the day of the year, in context of the timezone representation of the object.
def dayOfYear(self): d = int(self._d + (_tzoffset(self._tz, self._t) / 86400.0)) return int((d + jd1901) - _julianday(self._year, 1, 0))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def day_of_year(self):\n return int(self.date.strftime('%j'))", "def day_of_year(date=datetime.datetime.now()):\n return date.strftime(\"Its the %j day of %Y'th year.\")", "def dayofyear(self) -> Index:\n warnings.warn(\n \"`dayofyear` will return int32 index instead of int 64 index...
[ "0.8118851", "0.745819", "0.69404024", "0.6739889", "0.6683761", "0.6596866", "0.6568651", "0.656759", "0.64721876", "0.6465625", "0.6444715", "0.6385025", "0.63791275", "0.6372839", "0.6366738", "0.6366738", "0.63545626", "0.6334317", "0.6313267", "0.6245467", "0.62150574", ...
0.7713782
1
Return the timezone in which the object is represented.
def timezone(self): return self._tz
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def timezone(self) -> str:\n return self._tz", "def timezone():\n\n return time.timezone", "def timezone(self):\n return self._timezone", "def timezone(self):\n return self._timezone", "def timezone(self):\n return self._timezone", "def get_timezone(self) -> str:\n r...
[ "0.8220309", "0.81725204", "0.81574833", "0.81574833", "0.81574833", "0.81416744", "0.7949578", "0.79456395", "0.79272133", "0.7913764", "0.7906484", "0.78125167", "0.78043795", "0.76769066", "0.7551673", "0.7537004", "0.74641114", "0.7435267", "0.7422425", "0.72778606", "0.7...
0.8405555
0
Return the timezone offset for the objects timezone.
def tzoffset(self): return _tzoffset(self._tz, self._t)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_timzone_offset(self, timezone):\n raise NotImplementedError", "def tz_to_offset(timezone):\n return TIMEZONES.get(timezone, {'offset': 0})['offset']", "def get_tz_offset(self) -> float:\n return self.AD.tz.utcoffset(self.datetime()).total_seconds() / 60", "def get_timezone_offset():\...
[ "0.8115398", "0.8084765", "0.795837", "0.75896317", "0.7437852", "0.7223107", "0.7127522", "0.70258474", "0.699047", "0.6928254", "0.6919783", "0.69000185", "0.69000185", "0.69000185", "0.68485147", "0.6808744", "0.6785393", "0.6761063", "0.67139226", "0.67102146", "0.6702036...
0.82540286
0
Return the month of the object as an integer.
def month(self): return self._month
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def month(self) -> int:\n return self.arxiv_id.month", "def month(self) -> int:\n if self.is_old_style:\n return int(self.split('/', 1)[1][2:4])\n return int(self[2:4])", "def month(self):\n return 0", "def month(self):\n return 0", "def month(self):\n r...
[ "0.80295527", "0.80130506", "0.76479876", "0.76479876", "0.76445997", "0.75239444", "0.750398", "0.7449703", "0.7403727", "0.73710954", "0.7322865", "0.7201305", "0.71723", "0.70507526", "0.70115465", "0.7011525", "0.6987259", "0.6929041", "0.6859936", "0.68597853", "0.685435...
0.7559438
6
Return the full month name.
def Month(self): return self._fmon
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def monthname(self):\n return self.strftime(\"%B\")", "def get_month_name(month_of_year):\n return VALID_MONTHS[month_of_year - 1].title()", "def get_month_name(self, month):\n return self.month_names[month.month - 1]", "def _monthName(self, month):\n if month is not None:\n ...
[ "0.8575512", "0.83716327", "0.83389586", "0.8238305", "0.8230225", "0.81229097", "0.7794224", "0.7768879", "0.77261245", "0.76191294", "0.75272906", "0.7523165", "0.74153686", "0.739087", "0.7284282", "0.721602", "0.7213561", "0.7155259", "0.7119781", "0.7090696", "0.6957875"...
0.68175364
23
Return the abbreviated month name.
def aMonth(self): return self._amon
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_month_name(date, abbreviated_or_full):\n if abbreviated_or_full == constants.str_abbreviated:\n return date.strftime('%b')\n elif abbreviated_or_full == constants.str_full:\n return date.strftime('%B')\n else:\n err_msg = str_possible_values('abbreviated_or_full',\n ...
[ "0.8390816", "0.8168631", "0.7891294", "0.77244174", "0.76587903", "0.7622981", "0.7541841", "0.7468351", "0.7316828", "0.7254273", "0.72239524", "0.71780705", "0.71714354", "0.7164874", "0.7104584", "0.7064434", "0.68456453", "0.67228585", "0.6674572", "0.6560327", "0.645789...
0.6132179
29
Return the abbreviated (with period) month name.
def pMonth(self): return self._pmon
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_month_name(date, abbreviated_or_full):\n if abbreviated_or_full == constants.str_abbreviated:\n return date.strftime('%b')\n elif abbreviated_or_full == constants.str_full:\n return date.strftime('%B')\n else:\n err_msg = str_possible_values('abbreviated_or_full',\n ...
[ "0.8252416", "0.7983792", "0.79146296", "0.77985543", "0.77841014", "0.7652134", "0.76242405", "0.7577165", "0.7347374", "0.7343357", "0.73194426", "0.7284705", "0.7255145", "0.72380114", "0.72066957", "0.69427377", "0.68890977", "0.6647317", "0.6612862", "0.6603222", "0.6575...
0.6322185
25
Return the 12hour clock representation of the hour.
def h_12(self): return self._pmhour
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def hour(self):\n return \"%s:00:00\" % self.timestamp[:13]", "def convert_24hr_12ampm(military_hr): \n\t\n if military_hr == 0:\n hour_ampm_str = \"12am\"\n elif military_hr == 12:\n hour_ampm_str = \"12pm\"\n elif military_hr > 12:\n hour_ampm_str = str(military_hr ...
[ "0.7500053", "0.7410466", "0.7278863", "0.7108045", "0.70093334", "0.69480115", "0.66335976", "0.6534283", "0.6491415", "0.6364388", "0.63271576", "0.63213336", "0.6313354", "0.6284957", "0.627208", "0.6234081", "0.61735487", "0.61735487", "0.61406684", "0.6122422", "0.605614...
0.7956415
0
Return the 24hour clock representation of the hour.
def h_24(self): return self._hour
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def hour(self):\n return \"%s:00:00\" % self.timestamp[:13]", "def hours_to_24h_time(hours: float) -> str:\n return (\n dt.datetime(2001, 1, 2) + dt.timedelta(hours=hours)\n ).time().isoformat()", "def h_12(self):\n return self._pmhour", "def get_hour(self):\n hour = Non...
[ "0.76360065", "0.73559564", "0.69572026", "0.6950066", "0.6831114", "0.67670083", "0.67569953", "0.66353345", "0.66280746", "0.66280746", "0.6608543", "0.650902", "0.64828527", "0.6430704", "0.6422662", "0.641182", "0.63975024", "0.63842463", "0.6302358", "0.62911856", "0.627...
0.7796278
0
Return the appropriate time modifier (am or pm).
def ampm(self): return self._pm
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_time(self):\n now = datetime.datetime.now()\n hour = 12 if now.hour % 12 == 0 else now.hour % 12\n meridiem = \"AM\" if now.hour < 12 else \"PM\"\n return \"%d:%02d %s\" % (hour, now.minute, meridiem)", "def __timeRestriction():\n restriction = {\"M\": [\"7:00\", \"9:30...
[ "0.7136491", "0.6235085", "0.6215828", "0.6097539", "0.6091346", "0.6036924", "0.6020356", "0.60093856", "0.59944487", "0.5971673", "0.58741796", "0.58529407", "0.5851693", "0.5851693", "0.58168614", "0.5808225", "0.5771384", "0.5757634", "0.5751961", "0.5744717", "0.57269007...
0.0
-1
Return the 24hour clock representation of the hour.
def hour(self): return self._hour
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def h_24(self):\n return self._hour", "def hour(self):\n return \"%s:00:00\" % self.timestamp[:13]", "def hours_to_24h_time(hours: float) -> str:\n return (\n dt.datetime(2001, 1, 2) + dt.timedelta(hours=hours)\n ).time().isoformat()", "def h_12(self):\n return self._pmh...
[ "0.7796278", "0.76360065", "0.73559564", "0.69572026", "0.6950066", "0.67670083", "0.67569953", "0.66353345", "0.66280746", "0.66280746", "0.6608543", "0.650902", "0.64828527", "0.6430704", "0.6422662", "0.641182", "0.63975024", "0.63842463", "0.6302358", "0.62911856", "0.627...
0.6831114
5
The Python datetime module introduces the idea of distinguishing between timezone aware and timezone naive datetime values. For lossless conversion to and from datetime.datetime we record this information using True / False. DateTime makes no distinction, if we don't have any information we return None here.
def timezoneNaive(self): try: return self._timezone_naive except AttributeError: return None
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _is_timezone_aware(value):\n return value.utcoffset() is not None", "def test_freeze_with_timezone_aware_datetime_in_non_utc():\n utc_now = datetime.datetime.utcnow()\n assert utc_now.tzinfo is None\n assert utc_now == datetime.datetime(1970, 1, 1, 4)", "def is_aware(value: datetime) -> bool:\n...
[ "0.73367536", "0.702421", "0.69106853", "0.67724824", "0.6729957", "0.6693972", "0.6657824", "0.66287076", "0.64598334", "0.6433873", "0.63924426", "0.6386802", "0.6368418", "0.6357086", "0.63273984", "0.6273165", "0.621882", "0.62174845", "0.6216492", "0.6129552", "0.611153"...
0.6618191
8
Format the date/time using the current timezone representation.
def strftime(self, format): x = _calcDependentSecond2(self._year, self._month, self._day, self._hour, self._minute, self._second) ltz = self._calcTimezoneName(x, 0) tzdiff = _tzoffset(ltz, self._t) - _tzoffset(self._tz, self._t) zself = self + tzdiff / 8...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def format(self, format=None, tz=None, locale=LC_TIME):\n return parser.format_datetime(self, format, tz=tz, locale=locale)", "def get_current_time(format='%Y-%m-%d %H:%M:%S.%f %z'):\n return datetime.utcnow().replace(\n tzinfo=pytz.utc\n ).strftime(format)", "def getFormattedDate(self, dt)...
[ "0.7022353", "0.66235274", "0.6564061", "0.6281122", "0.6258079", "0.61674297", "0.6163886", "0.61490476", "0.6139578", "0.6128967", "0.61225677", "0.6098477", "0.6088605", "0.6075624", "0.6064814", "0.60594434", "0.60473263", "0.6008204", "0.6003585", "0.5998012", "0.5935703...
0.0
-1
Return the time string for an object not showing seconds.
def TimeMinutes(self): return '%2.2d:%2.2d' % (self._hour, self._minute)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def time_to_str(obj):\n if not obj:\n return False\n return obj.strftime(DEFAULT_SERVER_TIME_FORMAT)", "def get_time(self):\n return ''", "def time(self) -> str:\n return typing.cast(\n str,\n self._properties.get(\"time\"),\n )", "def time_to_string(va...
[ "0.72784823", "0.70134664", "0.69467926", "0.69301224", "0.69143933", "0.69127566", "0.68922037", "0.68790454", "0.68388647", "0.67393476", "0.6731548", "0.6722671", "0.6684562", "0.66178733", "0.65718204", "0.65694183", "0.6555445", "0.6553985", "0.65532374", "0.65379506", "...
0.0
-1
Return the time string for an object not showing seconds.
def AMPMMinutes(self): return '%2.2d:%2.2d %s' % (self._pmhour, self._minute, self._pm)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def time_to_str(obj):\n if not obj:\n return False\n return obj.strftime(DEFAULT_SERVER_TIME_FORMAT)", "def get_time(self):\n return ''", "def time(self) -> str:\n return typing.cast(\n str,\n self._properties.get(\"time\"),\n )", "def time_to_string(va...
[ "0.7276715", "0.7015263", "0.69472355", "0.6932595", "0.691648", "0.69140035", "0.68975997", "0.6882529", "0.6839711", "0.6740057", "0.67308426", "0.67234486", "0.6687528", "0.66202307", "0.6575566", "0.65687466", "0.6556502", "0.65561944", "0.6555991", "0.65391815", "0.65362...
0.0
-1
Return the time string for the object.
def PreciseTime(self): return '%2.2d:%2.2d:%06.3f' % (self._hour, self._minute, self._second)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def time(self) -> str:\n return typing.cast(\n str,\n self._properties.get(\"time\"),\n )", "def get_time_string(self):\n return f\"{self.year} {self.month:02} \" \\\n f\"{self.start_day:02} {self.start_hour:02} 00 {self.get_duration():6}\"", "def get_time(...
[ "0.81459254", "0.7911665", "0.78546524", "0.7848065", "0.7763673", "0.77608407", "0.7760569", "0.7648544", "0.7637771", "0.7630699", "0.757431", "0.75485456", "0.7502937", "0.74751306", "0.74745095", "0.7457451", "0.7432823", "0.74319446", "0.738877", "0.724358", "0.72125375"...
0.0
-1
Return the time string for the object.
def PreciseAMPM(self): return '%2.2d:%2.2d:%06.3f %s' % ( self._pmhour, self._minute, self._second, self._pm)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def time(self) -> str:\n return typing.cast(\n str,\n self._properties.get(\"time\"),\n )", "def get_time_string(self):\n return f\"{self.year} {self.month:02} \" \\\n f\"{self.start_day:02} {self.start_hour:02} 00 {self.get_duration():6}\"", "def get_time(...
[ "0.814566", "0.79118824", "0.78540576", "0.7849004", "0.7763867", "0.7761772", "0.7760395", "0.7649249", "0.763689", "0.7629953", "0.75744057", "0.7549466", "0.75023174", "0.7473992", "0.7473019", "0.7458499", "0.7434401", "0.7431502", "0.73893756", "0.724324", "0.7212408", ...
0.0
-1
Return month as a 2 digit string.
def mm(self): return '%02d' % self._month
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def monthname(self):\n return self.strftime(\"%B\")", "def year_month(cls,\n year: typing.Union[int, str],\n month: typing.Union[int, str])->str:\n yearstr: str\n if isinstance(year, int):\n yearstr = str(year)\n else:\n yearst...
[ "0.76541597", "0.76141465", "0.74202126", "0.73357284", "0.72388566", "0.71808374", "0.71740407", "0.7143689", "0.71284944", "0.711813", "0.7089262", "0.69924146", "0.69642", "0.6926073", "0.69012344", "0.68908286", "0.68850577", "0.6838241", "0.6795324", "0.6773195", "0.6769...
0.80739707
0
Return day as a 2 digit string.
def dd(self): return '%02d' % self._day
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def day_str(day):\n return str(day) if day >= 10 else '0' + str(day)", "def day_str(day):\n return str(day) if day >= 10 else '0' + str(day)", "def day_str(day):\n return str(day) if day >= 10 else '0' + str(day)", "def day(dt: datetime.datetime) -> str:\n day: str = dt.strftime(\"%A\")\n retu...
[ "0.8262863", "0.8262863", "0.8262863", "0.76570076", "0.72256327", "0.7037711", "0.7026473", "0.7025394", "0.69890344", "0.69530845", "0.69017965", "0.67641664", "0.6661215", "0.66382563", "0.6588777", "0.65552384", "0.653488", "0.653488", "0.650543", "0.6498834", "0.647837",...
0.76779515
3
Return the date in RFC 822 format.
def rfc822(self): tzoffset = _tzoffset2rfc822zone(_tzoffset(self._tz, self._t)) return '%s, %2.2d %s %d %2.2d:%2.2d:%2.2d %s' % ( self._aday, self._day, self._amon, self._year, self._hour, self._minute, self._nearsec, tzoffset)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def format_date(self, data):\r\n if self.datetime_formatting == 'rfc-2822':\r\n return format_date(data)\r\n\r\n return data.isoformat()", "def rfc3999(date):\n if not date: return ''\n date = date + datetime.timedelta(seconds = -time.timezone)\n if time.daylight:\n date ...
[ "0.739641", "0.7242609", "0.6836366", "0.6759257", "0.66857404", "0.64279026", "0.64248437", "0.6360331", "0.6323312", "0.6266395", "0.6250262", "0.6235384", "0.6186583", "0.6147521", "0.61394966", "0.61369145", "0.6085036", "0.6083033", "0.60578233", "0.60312426", "0.6023813...
0.5762338
45
Return the object in ISO standard format.
def ISO(self): return "%.4d-%.2d-%.2d %.2d:%.2d:%.2d" % ( self._year, self._month, self._day, self._hour, self._minute, self._second)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def to_isoformat(self) -> str:\n return self.isoformat()", "def isoformat(self):\n return \"\"", "def __str__(self):\n return self.isoformat(sep=\" \")", "def for_json(self) -> str:\n return self.isoformat()", "def dthandler(obj):\n if hasattr(obj, \"isoformat\"):\n re...
[ "0.7484331", "0.74281967", "0.73340505", "0.7290921", "0.7036024", "0.694165", "0.68375236", "0.6823892", "0.6749814", "0.6728786", "0.66877955", "0.66518193", "0.6645622", "0.663551", "0.6621834", "0.6501976", "0.6364008", "0.63534164", "0.6335463", "0.63161755", "0.63131934...
0.6825204
7
Return the object in the format used in the HTML4.0 specification, one of the standard forms in ISO8601.
def HTML4(self): newdate = self.toZone('UTC') return "%0.4d-%0.2d-%0.2dT%0.2d:%0.2d:%0.2dZ" % ( newdate._year, newdate._month, newdate._day, newdate._hour, newdate._minute, newdate._second)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def ISO8601(self):\n if self.timezoneNaive():\n return \"%0.4d-%0.2d-%0.2dT%0.2d:%0.2d:%0.2d\" % (\n self._year, self._month, self._day,\n self._hour, self._minute, self._second)\n tzoffset = _tzoffset2iso8601zone(_tzoffset(self._tz, self._t))\n return ...
[ "0.7421363", "0.7273152", "0.7188766", "0.6927814", "0.67410344", "0.6674254", "0.66669995", "0.6632951", "0.66047144", "0.6575497", "0.6539288", "0.6507121", "0.64760214", "0.6435863", "0.6332522", "0.63307995", "0.63106585", "0.62997305", "0.6266479", "0.624583", "0.6232179...
0.7264101
2
Return a standard library datetime.datetime
def asdatetime(self): tznaive = self.timezoneNaive() if tznaive: tzinfo = None else: tzinfo = _TZINFO[self._tz].tzinfo second = int(self._second) microsec = self.micros() % 1000000 dt = datetime(self._year, self._month, self._day, self._hour, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_date():\n return datetime(2000, 1, 1, 0, 0, 0, FLOOD_TIMEOUT+1)", "def datetime(when = None):\n if when is None:\n return xmlrpclib.DateTime(time.gmtime())\n else:\n return xmlrpclib.DateTime(time.gmtime(when))", "def datetime(self):\n return datetime.datetime(self.year, s...
[ "0.7020698", "0.699768", "0.67883617", "0.673259", "0.67171603", "0.66509205", "0.662728", "0.6618832", "0.6613371", "0.66110367", "0.6596779", "0.65641475", "0.65421116", "0.65396744", "0.65213436", "0.6494132", "0.64753246", "0.64578867", "0.64082116", "0.63944596", "0.6370...
0.69126666
2
Convert the time to UTC and return a timezone naive datetime object
def utcdatetime(self): utc = self.toZone('UTC') second = int(utc._second) microsec = utc.micros() % 1000000 dt = datetime(utc._year, utc._month, utc._day, utc._hour, utc._minute, second, microsec) return dt
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def ensure_utc_time(ts: datetime) -> datetime:\n if ts.tzinfo is None:\n return datetime(*ts.timetuple()[:6], tzinfo=UTC_TZ)\n elif str(ts.tzinfo) != str(UTC_TZ):\n return ts.astimezone(UTC_TZ)\n return ts", "def make_naive_utc(date_time: datetime.datetime) -> datetime.datetime:\n utc_t...
[ "0.7500589", "0.74305254", "0.73125994", "0.73125994", "0.72220695", "0.72220695", "0.72220695", "0.71179086", "0.7094749", "0.70471466", "0.6974847", "0.6931955", "0.6916906", "0.68520564", "0.6844777", "0.67881066", "0.6785604", "0.6749597", "0.67385894", "0.67226666", "0.6...
0.66065377
27
Either a DateTime or a number may be subtracted from a DateTime, however, a DateTime may not be subtracted from a number.
def __sub__(self, other): if hasattr(other, '_d'): return (self.micros() - other.micros()) / 86400000000.0 else: return self.__add__(-(other))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __sub__(self, other):\n if (not isinstance(other, self.__class__) and\n isinstance(other, datetime)):\n other = self.fromdatetime(other)\n\n result = super(self.__class__, self).__sub__(other)\n\n if isinstance(result, datetime):\n return self.fromdatet...
[ "0.67136145", "0.6514166", "0.6508847", "0.6499777", "0.6200779", "0.61754376", "0.6119978", "0.6088935", "0.6073483", "0.6073483", "0.607009", "0.60513943", "0.59848726", "0.5920464", "0.5916416", "0.58969706", "0.58969706", "0.5892407", "0.58912075", "0.58893615", "0.587674...
0.5583508
46
Convert a DateTime to a string that looks like a Python expression.
def __repr__(self): return '{}(\'{}\')'.format(self.__class__.__name__, str(self))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def expression(self):\n\n result = u\"{}({}\".format(self.function.lower(),\n self.metric_name)\n\n if self.dimensions_str:\n result += u\"{{{}}}\".format(self.dimensions_str)\n\n if self.deterministic:\n result += u\", deterministic\"\n\n ...
[ "0.5786874", "0.5763769", "0.57178944", "0.57045174", "0.57045174", "0.5686805", "0.5683455", "0.5676961", "0.5671849", "0.55069315", "0.54229575", "0.54123354", "0.5399925", "0.5399925", "0.5381179", "0.5373444", "0.5295424", "0.52926", "0.5289287", "0.5282674", "0.5270381",...
0.0
-1
Convert a DateTime to a string.
def __str__(self): y, m, d = self._year, self._month, self._day h, mn, s, t = self._hour, self._minute, self._second, self._tz if s == int(s): # A whole number of seconds -- suppress milliseconds. return '%4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d %s' % ( y, m, d...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def convert_datetime_to_string(dt):\n\treturn '{0}-{1}-{2}'.format(dt.year, dt.month, dt.day)", "def convert_datetime_to_string(dt):\n\treturn '{0}-{1}-{2}'.format(dt.year, dt.month, dt.day)", "def datetime_to_str(obj):\n return obj.strftime(\"%Y-%m-%d %H:%M:%S\")", "def datetime_to_str(date_time):\n\n\tr...
[ "0.79117006", "0.79117006", "0.7815086", "0.7733769", "0.77086914", "0.769606", "0.7597226", "0.75921404", "0.7480809", "0.7448039", "0.74377024", "0.7397062", "0.73960614", "0.7366059", "0.72787464", "0.7277611", "0.7222145", "0.7211117", "0.7147815", "0.71156037", "0.709971...
0.58804137
95
converts string to unicode
def TO_UNICODE(string): try: # wroks if string is unicode already return unicode(string, "utf-8") except: pass try: # works if string is iso8859-1 return unicode(string, "iso-8859-1") except: pass # try simple coding return unicode(string)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def to_unicode(string):\n\n if isinstance(string, str):\n return string.decode('utf-8')\n else:\n return unicode(string)", "def to_unicode(self, _string):\n if not isinstance(_string, unicode):\n try:\n _string = unicode(_string)\n except:\n ...
[ "0.8196139", "0.81463116", "0.8035327", "0.78704506", "0.7859127", "0.78492993", "0.7844166", "0.7776731", "0.7739471", "0.77283645", "0.7726108", "0.77184784", "0.7629644", "0.7608919", "0.7550884", "0.7543503", "0.7537567", "0.75191796", "0.75191796", "0.7469073", "0.745741...
0.7893894
3
returns lines with given colors
def colored(self, color, lines): return [ self.__color(color) + TO_UNICODE(line) + self.__reset() for line in lines ]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_line_colors(cmap, ncolors):\n cmap = getattr(plt.cm, cmap)\n stop = 0.8 * 255\n lcolors = [cmap(int(i)) for i in np.linspace(0, stop, ncolors)]\n return lcolors", "def get_colors(lines):\n\n patt = re.compile('\\#\\w+')\n\n return [\n patt.search(line).group(0)\n for line ...
[ "0.73459536", "0.7320949", "0.6898308", "0.6682935", "0.66028374", "0.6513473", "0.6413022", "0.6172733", "0.61353636", "0.61230916", "0.6101369", "0.609297", "0.6041533", "0.5933413", "0.59072274", "0.5899032", "0.5895735", "0.58484507", "0.58216065", "0.5782854", "0.5774434...
0.70109653
2
Initialize the _data attribute.
def init_data(self, obj): for col in self._category_aux: key_split = col.split(' ', 1) if len(key_split) > 1: key = key_split[1].replace(' ', '') minmax = key_split[0].lower() info_tuple = (key, minmax) if minmax ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _init_data(self, data):\n assert type(data) is dict, \"dict expected: %r\" % type(data)\n assert len(data) is 1, \"size of dict should be 1: %r\" % len(data)\n self._name = data.keys()[0]\n self._data = np.asarray(data[self._name])\n self._set = True", "def __init__(self, d...
[ "0.8103289", "0.7943673", "0.7901121", "0.7817221", "0.7817221", "0.7817221", "0.7817221", "0.77703625", "0.7699275", "0.7651114", "0.7613723", "0.75978", "0.74878275", "0.74426097", "0.74426097", "0.74426097", "0.74426097", "0.74426097", "0.74426097", "0.7421886", "0.7420932...
0.0
-1
Add all sites to the lattice.
def build_sites(self): for i in range(self.shape[0]): for j in range(self.shape[1]): for k in range(self.shape[2]): for s,site in enumerate(self.cell.sites): newsite = copy.deepcopy(site) coordinate = self.cell.a1*i+...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_site(self,site):\n if site.label==None:\n site.label = site_label_dir[str(self.Nsites)]\n if site.color==None:\n site.color = site_color_dir[str(self.Nsites)]\n self.sites.append(site)\n self.Nsites +=1", "def build_and_add(self,*args):\n lattice =...
[ "0.6309895", "0.6275667", "0.6090934", "0.6054217", "0.5896788", "0.58301216", "0.57959175", "0.543359", "0.5431688", "0.5389579", "0.5339891", "0.533849", "0.52933353", "0.5290242", "0.5213425", "0.5212648", "0.5191459", "0.51701784", "0.51521915", "0.5148904", "0.51416284",...
0.60979295
2
Given a file path to an h5 file assumed to house a tensor, load that tensor into memory and return a pointer.
def load_h5_file(file_path): # load fr = h5py.File(file_path, 'r') a_group_key = list(fr.keys())[0] data = list(fr[a_group_key]) # transform to appropriate numpy array data=data[0:] data = np.stack(data, axis=0) return data
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def loadh5(fname, path='/data'):\n fp = open_read(fname)\n slab = fp.get_node(path)\n mat = slab.read()\n fp.close()\n return mat", "def load_tensor(path: str, params: Optional[Params]) -> th.Tensor:\n path = get_path_with_hash(path, params)\n files = glob(f'{path}/*')\n return th.stack([th.tensor(...
[ "0.74386346", "0.7088237", "0.6420383", "0.6390996", "0.6390996", "0.6390679", "0.62577385", "0.61808825", "0.6088781", "0.60585237", "0.6040434", "0.6010217", "0.59895724", "0.59883887", "0.5960219", "0.5953363", "0.5927101", "0.59157044", "0.5912356", "0.59054774", "0.58810...
0.63854605
7
r"""Lists the indexes that match the specified filters. Datastore uses an. eventually consistent query to fetch the list of indexes and may occasionally return stale results.
def List(self, request, global_params=None): config = self.GetMethodConfig('List') return self._RunMethod( config, request, global_params=global_params)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def list_indexes(self):\n return AlgoliaUtils_request(self.headers, self.read_hosts, \"GET\", \"/1/indexes/\", self.timeout)", "def indexes(self):\n indexes = self.execute(self.commands.get_indexes(self.name))\n return [Index(*tup) for tup in indexes]", "def list_indexes(\n self,\n ...
[ "0.7166928", "0.6984735", "0.69812423", "0.6901423", "0.68977517", "0.6677398", "0.65527475", "0.6521577", "0.6449868", "0.64187646", "0.6399197", "0.62890285", "0.621794", "0.6211446", "0.618454", "0.59924066", "0.59858257", "0.5958255", "0.59540445", "0.59331757", "0.590530...
0.0
-1
Get color of plots from colormap. the color of plots should be change by the flag "color=next(color)"
def get_colors(n_curves): # Use offsets to avoid shitty crappy min/max colors (ugly yellow or white for example) first_step = 1. / (n_curves + 1.) last_step = 1. nb_steps = n_curves + 1 color_range = np.linspace(first_step, last_step, nb_steps) color = iter(plt.cm.hot(color_range)) return co...
{ "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.66673964", "0.66340584", "0.6528371", "0.64897525", "0.64897525", "0.6401957", "0.63796616", "0.63752025", "0.6363454", "0.6329437", "0.63135356", "0.6285648", "0.6285648", "0.62472534", "0.62011373", "0.61796063", "0.61766917", "0.6171971", "0.61602545", "0.6136812", "0.6...
0.0
-1
Return the gradient magnitude of the image using Sobel operator
def _get_grad(cls, image): rgb = True if len(image.shape) > 2 else False grad_x = cv2.Sobel(image, cv2.CV_64F, 1, 0, ksize=3) grad_y = cv2.Sobel(image, cv2.CV_64F, 0, 1, ksize=3) if rgb: # A very rough approximation for quick verification... grad_x = np.max(grad_x...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def compute_gradmag(image_arr):\n assert image_arr.ndim == 2\n dy = sobel(image_arr, axis=0)\n dx = sobel(image_arr, axis=1)\n return np.hypot(dx, dy)", "def SobelGradient(anImage):\n SobelXKernel = [[-1,0,1],[-2,0,2],[-1,0,1]]\n SobelYKernel = [[1,2,1],[0,0,0],[-1,-2,-1]]\n return ApplyGrad...
[ "0.7129523", "0.6630078", "0.65913546", "0.6577655", "0.65460044", "0.64911395", "0.6387012", "0.62743694", "0.62161976", "0.619595", "0.6084272", "0.5973833", "0.5926217", "0.58606005", "0.5850043", "0.5811828", "0.57850057", "0.5765125", "0.57628167", "0.57622105", "0.57440...
0.614504
10
Validate the blockchain, returns False if invalid previous hash is found Hash each block and compare to the next block's prev_hash, stopping at the last block.
def validate_chain(self): chain_length = len(self.chain) isValid = None if(chain_length == 1): return "Add blocks and then validate chain." for x in range(0, chain_length, 1): if(x < chain_length-1): # Hash the current block hash ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def chainIsValid(self):\n for i in range(1, len(self.blocks)):\n prev_block = self.blocks[i-1]\n cur_block = self.blocks[i]\n if cur_block.header['prevBlockH'] != getHashBlock(prev_block):\n return False\n return True", "def valid_chain(self, chain):\...
[ "0.7822906", "0.7528738", "0.7517534", "0.75117224", "0.7434074", "0.7354781", "0.73291004", "0.7302187", "0.72495735", "0.71486074", "0.7133101", "0.7103134", "0.7083091", "0.70758075", "0.70735294", "0.705067", "0.69841945", "0.6946074", "0.68062276", "0.6752413", "0.67239"...
0.77432895
1
Remove a group, if defaultGroupName parameter is specified, users belonging to group will be added to defaultGroup
def removeGroup(self, group, defaultGroup=''): return self.pm_getUserManager().removeGroup(self._unbox(group), self._unbox(defaultGroup))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def deleteGroup(groupName):\r\n Group.deleteGroup(groupName)", "def removeGroup(self, *args):\n return _libsbml.GroupsModelPlugin_removeGroup(self, *args)", "def remove_group():\n _id = request.form['_id']\n data, code, message = FIELD_SERVICE.remove_group(_id)\n return __result(data, co...
[ "0.758469", "0.72813445", "0.72337186", "0.7206924", "0.7107637", "0.7060166", "0.7005081", "0.6991681", "0.6966071", "0.69198585", "0.6779706", "0.67582583", "0.6740737", "0.66829383", "0.66750973", "0.66625386", "0.6646494", "0.66366994", "0.6573747", "0.65600723", "0.65352...
0.85222006
0
Returns all the Attachments on this page
def listAttachments(self, page): return tuple(AttachmentProxy.AttachmentProxy(attachmentDict) for attachmentDict in self.pm_getSpaceManager().listAttachments(self._unbox(page)))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def attachments(self):\n if \"attachments\" in self._prop_dict:\n return AttachmentsCollectionPage(self._prop_dict[\"attachments\"])\n else:\n return None", "def attachments(self):\n return self._attachments", "def attachments(self):\r\n return Attachments(self...
[ "0.772384", "0.76337385", "0.74775815", "0.71543306", "0.7011809", "0.69646555", "0.6808242", "0.6755822", "0.6719818", "0.65991324", "0.6590045", "0.64529496", "0.6447507", "0.6377839", "0.63595575", "0.6294113", "0.62877893", "0.6274989", "0.61571807", "0.6006687", "0.58928...
0.6914736
6
Get the height of the board.
def get_grid_height(self): return self._grid_height
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def height(self):\n return self.board.shape[0]", "def getHeight(self):\n return self.height", "def getHeight(self):\n return self.height", "def getHeight(self):\n return self._height", "def get_grid_height(self):\n return self._height", "def get_grid_height(self):\n ...
[ "0.85063905", "0.78268176", "0.78268176", "0.77902925", "0.77875626", "0.77875626", "0.77665955", "0.77665955", "0.77665955", "0.77665955", "0.7765325", "0.7761614", "0.7758976", "0.7755297", "0.77416444", "0.77371883", "0.77204704", "0.7695517", "0.7692841", "0.7692841", "0....
0.76299065
26
Compute distance of point from origin
def inside_unit_circle(point): distance = math.sqrt(point[0] ** 2 + point[1] ** 2) return distance < 1
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def distance_from_origin(self):\n return ((self.x ** 2) + (self.y ** 2)) ** 0.5", "def distance_from_origin(self):\n return ((self.x ** 2) + (self.y ** 2)) ** 0.5", "def distance_from_origin(self):\n return ((self.x ** 2) + (self.y ** 2)) ** 0.5", "def distance_from_origin(self):\n ...
[ "0.8592622", "0.8592622", "0.8592622", "0.8592622", "0.8592622", "0.8592622", "0.8592622", "0.8589194", "0.8426623", "0.8299649", "0.82555103", "0.8100407", "0.7637371", "0.75797254", "0.7438227", "0.7361935", "0.7350827", "0.7340323", "0.7242112", "0.7234952", "0.72301054", ...
0.0
-1
Open a window in the configured web browser
def open_browser_window(url): logger.debug('about to open url "{url}" in browser "{browser}"'.format(url=url, browser=BROWSER_NAME)) browser = webbrowser.get(BROWSER_NAME) browser.open(url, new=(1 if BROWSER_NEW_WINDOW else 2))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def open_browser(url):\n import webbrowser\n webbrowser.open_new(url)", "def newwindow(url):\n\n # Open the URL\n webbrowser.open_new(url)", "def open(url):\r\n webbrowser.open(url)", "def open_in_browser(self):\n webbrowser.open(self.url)", "def openurl(url):\n\n # Open the URL\n ...
[ "0.8304287", "0.82636064", "0.8236007", "0.8208047", "0.779236", "0.77756613", "0.7633263", "0.76270103", "0.7626843", "0.7561175", "0.7540367", "0.75382036", "0.750282", "0.74430615", "0.74001026", "0.73759526", "0.7350961", "0.7321711", "0.7318665", "0.726032", "0.725884", ...
0.8214391
3
Accepts an iterable of iterables and returns a flattened generator.
def flatten(nested_iterable): for item in nested_iterable: if hasattr(item, '__iter__') and not isinstance(item, str): for i in flatten(item): yield i else: yield item
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def deep_flatten(iterables):\n for item in iterables:\n if is_iterable(item):\n yield from deep_flatten(item)\n else:\n yield item", "def flatten(iterable):\n for element_iterable in iterable:\n for element in element_iterable:\n yield element", "def ...
[ "0.81040424", "0.80731213", "0.77567875", "0.75990325", "0.7535667", "0.7438778", "0.7310459", "0.72419536", "0.72322446", "0.7186526", "0.71714306", "0.7150428", "0.710171", "0.70805573", "0.70625925", "0.704042", "0.703847", "0.69895977", "0.6967132", "0.696174", "0.6882046...
0.6934915
20
Returns a 2D or 3D tensorflow sequence mask depending on the argument 'expand'
def sequence_mask(lengths, r, expand=True): max_len = tf.reduce_max(lengths) max_len = _round_up_tf(max_len, tf.convert_to_tensor(r)) if expand: return tf.expand_dims(tf.sequence_mask(lengths, maxlen=max_len, dtype=tf.float32), axis=-1) return tf.sequence_mask(lengths, maxlen=max_len, dtype=tf.f...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _expand_mask(mask: torch.Tensor, dtype: torch.dtype, tgt_len: Optional[int] = None):\n bsz, src_len = mask.size()\n tgt_len = tgt_len if tgt_len is not None else src_len\n\n expanded_mask = mask[:, None, None, :].expand(bsz, 1, tgt_len, src_len).to(dtype)\n\n inverted_mask = 1.0 - expanded_mask\n\n...
[ "0.61623263", "0.6123722", "0.604792", "0.5906779", "0.58720964", "0.5829154", "0.5808877", "0.57319707", "0.5713542", "0.56259024", "0.5621295", "0.5596571", "0.5527759", "0.55162674", "0.5507142", "0.54506266", "0.5442038", "0.5422795", "0.5405426", "0.53883827", "0.537968"...
0.62781715
0
Computes a masked SigmoidCrossEntropy with logits
def masked_sigmoid_cross_entropy(targets, outputs, targets_lengths, hparams, mask=None): # [batch_size, time_dimension] # example: # sequence_mask([1, 3, 2], 5) = [[1., 0., 0., 0., 0.], # [1., 1., 1., 0., 0.], # [1., 1., 0., 0., 0.]] # Note the maxlen argument that ensures m...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def masked_sigmoid_cross_entropy(logits, labels, mask):\n labels = tf.cast(labels, dtype=tf.float32)\n loss = tf.nn.sigmoid_cross_entropy_with_logits(logits=logits, labels=labels)\n loss=tf.reduce_mean(loss,axis=1)\n mask = tf.cast(mask, dtype=tf.float32)\n mask /= tf.reduce_mean...
[ "0.7653099", "0.73728734", "0.732673", "0.7305595", "0.7050474", "0.7024927", "0.6944452", "0.6899821", "0.6899821", "0.6899821", "0.688765", "0.6860611", "0.6832313", "0.68242794", "0.6760238", "0.67297477", "0.66642165", "0.6660755", "0.6624909", "0.656646", "0.64539164", ...
0.65404004
20
If provided 'pk' is "me" then return the current user.
def retrieve(self, request, pk=None): if pk == 'me': return Response(UserSerializer(request.user, context={ 'request': request }).data) return super(UserViewSet, self).retrieve(request, pk)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def me():\n return current_user.get()", "def current_user(self, **kwargs):\n return self.me(**kwargs)", "def current_user(self):\n user_dict = self.auth.get_user_by_session()\n return self.auth.store.user_model.get_by_id(user_dict['user_id'])", "def user(self):\n u = self.user_info\n re...
[ "0.74767625", "0.7396965", "0.72208893", "0.7129037", "0.7039044", "0.6958749", "0.6942254", "0.68535507", "0.68535507", "0.6849746", "0.68440413", "0.6815235", "0.6811996", "0.6811996", "0.6811996", "0.6811996", "0.6811996", "0.6742769", "0.67423195", "0.6727416", "0.6719681...
0.67216855
20
Selects the face contour depending on the reletive position of the head
def _find_dynamic_lmk_idx_and_bcoords(self, vertices, pose, dynamic_lmk_faces_idx, dynamic_lmk_b_coords, neck_kin_chain, dtype=torch.float32): batch_size = vertices.shape[0] aa_pose = torch.index_select(pose.view(batch_s...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def draw_face_landmarks(data):\n head = extract_head(data);\n landmarks = data['position_data']['face_landmarks'][data['i']];\n face_box = data['position_data']['face_box'][data['i']];\n if face_box is not None:\n for p in landmarks:\n cv2.circle(head,p,3,(255,0,0));\n else:\n ...
[ "0.6052296", "0.5932075", "0.58097047", "0.5795803", "0.5767945", "0.5749584", "0.5693097", "0.5686195", "0.56440824", "0.5623782", "0.5606021", "0.56010693", "0.5561627", "0.55550903", "0.5541423", "0.5538159", "0.5506437", "0.550113", "0.54518956", "0.54376554", "0.54372215...
0.0
-1