query
stringlengths
9
9.05k
document
stringlengths
10
222k
metadata
dict
negatives
listlengths
30
30
negative_scores
listlengths
30
30
document_score
stringlengths
4
10
document_rank
stringclasses
2 values
Pack a sequence of individual interventions into one batched intervention. All interventions must be in the same nodes and locations.
def pack_interventions( interventions: Sequence[Intervention], batch_dim: int = 0, non_batch_inputs: Optional[Sequence[str]] = None ) -> Tuple[Dict, Dict, Dict]: base_lists, ivn_lists = defaultdict(list), defaultdict(list) loc_dict = {} multi_loc_nodes = set() batch_size = len(interventions)...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def collate_fn(self, batch: List[Dict]) -> List[Dict]:\n # package up a list of individual interventions into multiple batched interventions\n # batch may contain interventions on different locations\n high_node_to_minibatches = defaultdict(list)\n for d in batch:\n high_node...
[ "0.60141784", "0.5004213", "0.4980384", "0.4872931", "0.48631522", "0.47958422", "0.4778473", "0.47028425", "0.4686376", "0.46838748", "0.4683811", "0.4666936", "0.46344525", "0.46170777", "0.46088699", "0.45872328", "0.45521164", "0.45509255", "0.45372292", "0.45364162", "0....
0.6625913
0
Find the largest difference between consecutive numbers in a list.
def find_largest_diff(list_of_nums): largest_diff = 0 for i in range(len(list_of_nums) - 1): diff = abs(list_of_nums[i] - list_of_nums[i+1]) if diff > largest_diff: largest_diff = diff return largest_diff
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def greatest_difference(num_list):", "def find_largest_adjacent_difference(nums):\n pass", "def array_maximal_adjacent_difference( arr ):\n length = len(arr) - 1\n diffs = [ abs( arr[i] - arr[i+1] ) for i in range( length ) ]\n return max(diffs)", "def max_in_list(list):\n x=list[0] #set x be the fi...
[ "0.80127186", "0.71614146", "0.7041943", "0.7025927", "0.6988836", "0.69851476", "0.6963076", "0.68893635", "0.674169", "0.67026246", "0.66979045", "0.6614405", "0.6588544", "0.6538631", "0.65331626", "0.6529724", "0.6506182", "0.6465983", "0.6441132", "0.6433797", "0.6396522...
0.84058464
0
Create a new Spirit object Ensures that the default type value is applied if it's missing
def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) if not self.tags('type').filled: self.tags('type').append('spirit')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self, type_=None, text=None, ssml=None):\n default_attr = dict(type=str(),\n text=str(),\n ssml=str())\n self.type = type_\n self.text = text\n self.ssml = ssml\n self._set_default_attr(default_attr)", "def __in...
[ "0.5977207", "0.5649694", "0.55729514", "0.55137086", "0.5467393", "0.5431013", "0.5268109", "0.52392423", "0.52261865", "0.5222359", "0.520309", "0.5161894", "0.51046956", "0.50672466", "0.50542367", "0.50511277", "0.5050167", "0.50404984", "0.5032374", "0.5022429", "0.50204...
0.6503574
0
Binary Search arr from index l to r for x
def bs(arr, l, r, x): while l <= r: mid = l + (r - l)//2 if arr[mid] == x: return mid elif arr[mid] < x: l = mid + 1 else: r = mid - 1 return r
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def bin_search(arr, x):\n \n low = 0\n hi = len(arr) - 1\n \n while(low <= hi): \n \n mid = int((low + hi) / 2) # find middle idx\n\n if( x >= arr[mid]): # if x on the right, change low idx and search right side\n low = mid + 1; \n else: # else search left...
[ "0.8095521", "0.76254034", "0.74995446", "0.73398685", "0.73267186", "0.7304711", "0.725838", "0.7249893", "0.72426206", "0.72374916", "0.71893203", "0.71111673", "0.71048427", "0.7081518", "0.7067945", "0.7062905", "0.70593274", "0.6954989", "0.69393975", "0.69384575", "0.69...
0.77745306
1
Loads a buffer with the render of the darkening around the halo.
def pre_render(self) -> None: self.buffer = Surface((self.render_width, self.render_height), SRCALPHA) self.buffer.fill(list(self.halo_texture.surfaces.values())[0].get_at((0, 0))) self.buffer.fill((0, 0, 0, 0), Rect( (self.render_width - self.halo_texture.get_width()) // 2, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _make_buffer(self, width, height):\n fb_prop = p3d.FrameBufferProperties(p3d.FrameBufferProperties.get_default())\n fb_prop.set_multisamples(self._multisamples)\n fb_prop.set_srgb_color(self._srgb_color)\n\n self._buffer = self._engine.make_output(\n self._pipe, name=\"of...
[ "0.56681794", "0.54977167", "0.5324041", "0.5287743", "0.5260473", "0.5205611", "0.51873535", "0.5163916", "0.5071536", "0.5049212", "0.5048237", "0.5035555", "0.50335544", "0.5024333", "0.50097406", "0.49990943", "0.49946952", "0.49940115", "0.49929282", "0.49905205", "0.498...
0.6222023
0
Renders the halo on the desired surface.
def render(self, surface: Surface) -> None: surface.blit(self.buffer, (self.render_position.x, self.render_position.y)) self.halo_texture.render(surface, Position( (self.render_width - self.halo_texture.get_width()) // 2, (self.render_height - self.halo_texture.get_height()) // 2...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def draw(self):\n\n surf = self.get_oxygen_surface()\n surf.set_alpha(255)\n self.screen.blit(surf, self.pos)", "def pre_render(self) -> None:\n self.buffer = Surface((self.render_width, self.render_height), SRCALPHA)\n self.buffer.fill(list(self.halo_texture.surfaces.values())...
[ "0.6726035", "0.6504167", "0.6232434", "0.6078131", "0.6019421", "0.5973637", "0.59126973", "0.5894387", "0.58872277", "0.58129996", "0.5808655", "0.5794351", "0.57840055", "0.5774184", "0.5767208", "0.57486993", "0.57462645", "0.5710917", "0.57049483", "0.5687367", "0.568633...
0.7035735
0
Expand the given first postioin (2length tuple or 2length list) to have numrep points by specifing horizontal or vertical interval.
def expand_by_interval(firstPos,numrep,horizontal=None,vertical=None): x0,y0 = firstPos poslist = [] if horizontal is not None: for num in range(numrep): xt,yt = (x0+horizontal*num,y0) poslist.append((xt,yt)) return poslist elif vertical is not None: for n...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def grids_augmented_with_number(part_grid, val, curr_row=0):\n if curr_row == len(part_grid):\n return [part_grid]\n else:\n res = []\n for option in grids_augmented_in_row(part_grid, val, curr_row):\n res += grids_augmented_with_number(option, val, curr_row + 1)\n retu...
[ "0.52478415", "0.51951337", "0.5072514", "0.5000615", "0.49894366", "0.4934885", "0.4900051", "0.48402202", "0.47977155", "0.4778517", "0.47763914", "0.47651535", "0.47565943", "0.4728484", "0.47228515", "0.47023296", "0.46736914", "0.46479553", "0.4616724", "0.45915994", "0....
0.6975873
0
Propagate the arg input to a (ordered)dict. The behaviour varies according to input of arg and itearg.
def _propagate(tags,arg,itearg=False): tagnum = len(tags) if isinstance(arg,list): if itearg: if isinstance(arg[0],(tuple,list,np.ndarray)): if len(arg) != tagnum: raise ValueError("""list length expected to be {0}""" ....
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _map_args_kwargs_to_input(self, *args, **kwargs) -> Dict[str, Any]:\n input_dict = {k: v for k, v in zip(self.inputs, args)}\n input_dict.update(kwargs)\n\n return input_dict", "def argdict(self):\n return dict((arg.name, val) for arg, val in zip(self.sig, self))", "def Dict(**a...
[ "0.66467035", "0.6391914", "0.63108075", "0.62305945", "0.61446375", "0.612977", "0.6094551", "0.60677683", "0.6064272", "0.5990363", "0.5974368", "0.5922521", "0.5919071", "0.5812439", "0.5783572", "0.57812166", "0.5690085", "0.5683032", "0.56811297", "0.56756127", "0.561973...
0.7073806
0
Generator for exported functions.
def _exported_functions(self): mod_base = self.obj_parent.DllBase exp_dir = self.obj_parent.export_dir() # PE files with a large number of functions will have arrays # that spans multiple pages. Thus the first entries may be valid, # last entries may be valid, but middle entri...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def exports():", "def get_functions():\n\treturn [f for f in globals() if f.startswith('make_')]", "def exports(self):\n\n try:\n data_dir = self.export_dir()\n except ValueError, why:\n raise StopIteration(why)\n\n expdir = obj.Object('_IMAGE_EXPORT_DIRECTORY',\n ...
[ "0.682521", "0.6562752", "0.64066714", "0.6176337", "0.61679244", "0.60143894", "0.5998909", "0.59507465", "0.5946031", "0.5929983", "0.5886861", "0.58813053", "0.5822374", "0.5819807", "0.5795701", "0.57572097", "0.5720245", "0.5719738", "0.5695228", "0.56891406", "0.5686481...
0.66660017
1
Return a String object for the name at the given RVA
def _name(self, name_rva): return obj.Object("String", offset = self.obj_parent.DllBase + name_rva, vm = self.obj_native_vm, length = 128)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _name(self, name_rva):\n return obj.Object(\"String\",\n offset = self.obj_parent.DllBase + name_rva,\n vm = self.obj_native_vm, length = 128)", "def getAName(self, v):\n return self.avars[v]", "def get_name() -> str:", "def get_name():", "def get...
[ "0.7861681", "0.68811107", "0.60367334", "0.6008466", "0.5906894", "0.59004587", "0.58106697", "0.5782724", "0.5740362", "0.5736517", "0.57215333", "0.5647274", "0.56344426", "0.5604475", "0.56030816", "0.56015515", "0.55886394", "0.55614364", "0.55610186", "0.55606437", "0.5...
0.7883464
0
Returns the name of the DLL for this IID
def dll_name(self): return self._name(self.Name)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def interface_name(self) -> pulumi.Output[str]:\n return pulumi.get(self, \"interface_name\")", "def module_name(self):\n return self.lib.get_module_name()", "def libraryName(self):\n ret=\"\"\n if self.kind == \"lib\":\n ret = self.name + \"Engine\"\n elif self.kind == \"exe\":\n ...
[ "0.658748", "0.6539247", "0.6489708", "0.636311", "0.62957597", "0.62046534", "0.61847323", "0.61674047", "0.61405915", "0.6040135", "0.60379577", "0.60340816", "0.6029928", "0.5979551", "0.59447545", "0.5925962", "0.5914885", "0.5880614", "0.5879981", "0.5864137", "0.5864069...
0.82039464
0
Generator for imported functions.
def _imported_functions(self): i = 0 while 1: thunk = obj.Object('_IMAGE_THUNK_DATA', offset = self.obj_parent.DllBase + self.OriginalFirstThunk + i * self.obj_vm.profile.get_obj_size('_IMAGE_THUNK_DATA'), vm = self.obj_na...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_functions():\n\treturn [f for f in globals() if f.startswith('make_')]", "def collect_functions(self):\n if not self.functions:\n for item in dir(self.file_import):\n new_function = getattr(self.file_import, item)\n # if it is a YMLMetadataCollector wrapper...
[ "0.6609343", "0.6466236", "0.6398134", "0.62762254", "0.619583", "0.6191924", "0.613506", "0.6125171", "0.6005815", "0.59317636", "0.5931635", "0.5896827", "0.582619", "0.58228326", "0.57856643", "0.57601804", "0.575943", "0.5733376", "0.5729741", "0.5694585", "0.5692064", ...
0.6907061
0
Return the _IMAGE_NT_HEADERS object
def _nt_header(self): try: dos_header = obj.Object("_IMAGE_DOS_HEADER", offset = self.DllBase, vm = self.obj_native_vm) return dos_header.get_nt_header() except ValueError: return obj.NoneObject("Failed initial sanity checks") ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_nt_header(self):\n\n if self.e_magic != 0x5a4d:\n raise ValueError('e_magic {0:04X} is not a valid DOS signature.'.format(self.e_magic))\n\n nt_header = obj.Object(\"_IMAGE_NT_HEADERS\",\n offset = self.e_lfanew + self.obj_offset,\n ...
[ "0.77482045", "0.65472335", "0.62982917", "0.629468", "0.6281683", "0.6223163", "0.6189997", "0.61775583", "0.6140071", "0.613318", "0.6096307", "0.6025481", "0.5988569", "0.59720755", "0.5940392", "0.5910091", "0.5899667", "0.58247423", "0.58247423", "0.58247423", "0.5807061...
0.7455477
1
Return the IMAGE_DEBUG_DIRECTORY for debug info
def debug_dir(self): return self._directory(6) # IMAGE_DEBUG_DIRECTORY
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_debug_directory(self):\n \n try:\n data_dir = self.debug_dir()\n except ValueError, why:\n return obj.NoneObject(str(why))\n\n return obj.Object(\"_IMAGE_DEBUG_DIRECTORY\", \n offset = self.DllBase + data_dir.VirtualAddress, \n ...
[ "0.8450183", "0.7843698", "0.6724272", "0.6555663", "0.6499181", "0.6438066", "0.6284945", "0.6233516", "0.6100424", "0.60697454", "0.5912636", "0.5892272", "0.588483", "0.58785224", "0.58783144", "0.5827344", "0.58154136", "0.57860655", "0.57479817", "0.57219386", "0.5719696...
0.9076247
0
Return the debug directory object for this PE
def get_debug_directory(self): try: data_dir = self.debug_dir() except ValueError, why: return obj.NoneObject(str(why)) return obj.Object("_IMAGE_DEBUG_DIRECTORY", offset = self.DllBase + data_dir.VirtualAddress, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getDebugDirectory(self) -> ghidra.app.util.bin.format.pe.debug.DebugDirectory:\n ...", "def debug_dir(self):\n return self._directory(6) # IMAGE_DEBUG_DIRECTORY", "def debug_filename(pe):\n if hasattr(pe, 'DIRECTORY_ENTRY_DEBUG'):\n for i in pe.DIRECTORY_ENTRY_DEBUG:\n if...
[ "0.851801", "0.78498775", "0.666689", "0.6380202", "0.63746494", "0.6281661", "0.6262398", "0.62353474", "0.6201577", "0.6109504", "0.6097475", "0.60705024", "0.59828883", "0.5972983", "0.5886844", "0.5879197", "0.5876597", "0.5818916", "0.5818242", "0.5777866", "0.5771645", ...
0.8507757
1
Generator for the PE's imported functions. The _DIRECTORY_ENTRY_IMPORT.VirtualAddress points to an array of _IMAGE_IMPORT_DESCRIPTOR structures. The end is reached when the IID structure is all zeros.
def imports(self): try: data_dir = self.import_dir() except ValueError, why: raise StopIteration(why) i = 0 desc_size = self.obj_vm.profile.get_obj_size('_IMAGE_IMPORT_DESCRIPTOR') while 1: desc = obj.Object('_IMAGE_IMPORT_DESCRIPTOR', ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _imported_functions(self):\n\n i = 0\n while 1:\n thunk = obj.Object('_IMAGE_THUNK_DATA',\n offset = self.obj_parent.DllBase + self.OriginalFirstThunk +\n i * self.obj_vm.profile.get_obj_size('_IMAGE_THUNK_DATA'),\n vm =...
[ "0.7978085", "0.6452974", "0.62089634", "0.61941874", "0.61730665", "0.60156834", "0.5757013", "0.56928056", "0.56683564", "0.5667785", "0.55959344", "0.5552405", "0.5497728", "0.54639316", "0.5418187", "0.5392681", "0.5231617", "0.52232295", "0.5129847", "0.510814", "0.50952...
0.812108
0
Get the NT header
def get_nt_header(self): if self.e_magic != 0x5a4d: raise ValueError('e_magic {0:04X} is not a valid DOS signature.'.format(self.e_magic)) nt_header = obj.Object("_IMAGE_NT_HEADERS", offset = self.e_lfanew + self.obj_offset, vm = self.obj...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _nt_header(self):\n\n try:\n dos_header = obj.Object(\"_IMAGE_DOS_HEADER\", offset = self.DllBase,\n vm = self.obj_native_vm)\n\n return dos_header.get_nt_header()\n except ValueError:\n return obj.NoneObject(\"Failed initial san...
[ "0.83684963", "0.70789915", "0.678403", "0.65934235", "0.6516757", "0.64691263", "0.64680433", "0.6467337", "0.6464013", "0.6449925", "0.64363486", "0.6402365", "0.6393405", "0.63418704", "0.63347447", "0.6304198", "0.6304198", "0.6304198", "0.6273747", "0.6260924", "0.625726...
0.81594086
1
Get the _VS_VERSION_INFO structure
def get_version_info(self): try: nt_header = self.get_nt_header() except ValueError, ve: return obj.NoneObject("PE file failed initial sanity checks: {0}".format(ve)) try: unsafe = self.obj_vm.get_config().UNSAFE except AttributeError: un...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def version_info(self):\n\n return __version_info__", "def get_version_info() -> Tuple[Text, Text]:", "def get_version_info(self):\n return self._jadeRpc('get_version_info')", "def info(self):\n version_str = self.version\n return Utils.version_str2tuple(version_str)", "def get_...
[ "0.7197638", "0.7100442", "0.7023496", "0.7013558", "0.6973527", "0.6866096", "0.68598795", "0.6841089", "0.6810265", "0.68088377", "0.66023237", "0.65580744", "0.6516995", "0.6495485", "0.6466568", "0.646222", "0.64489084", "0.6443668", "0.6442421", "0.64309174", "0.64292395...
0.7852839
0
Rounds down an address based on an alignment
def round(self, addr, align, up = False): if addr % align == 0: return addr else: if up: return (addr + (align - (addr % align))) return (addr - (addr % align))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def align_addr(addr, align = 16, dir = ALIGN_DOWN):\n\n if dir == ALIGN_DOWN:\n return addr - (addr % align)\n else:\n return addr + (align - addr % align)", "def _format_address(self,address):\n address = int(address)\n if address >=1 and address <= 250:\n address = hex(int(addre...
[ "0.7200445", "0.6091956", "0.60217863", "0.59502107", "0.5875949", "0.5678854", "0.55767566", "0.55569094", "0.55374366", "0.53665066", "0.5357269", "0.53529537", "0.5348658", "0.5348002", "0.5330257", "0.5318402", "0.5307727", "0.52861303", "0.52447337", "0.521914", "0.52187...
0.73834985
0
Replaces a field in a sector header
def replace_header_field(self, sect, header, item, value): field_size = item.size() start = item.obj_offset - sect.obj_offset end = start + field_size newval = struct.pack(item.format_string, int(value)) result = header[:start] + newval + header[end:] return result
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def setHeader(k, v):", "def set_header( name, value ):", "def update_header(self, key, value):\n if self.mode != 'write':\n raise IOError(\"Must open file in write mode to do this!\")\n\n if isinstance(value, CommentedSeq):\n # Always converted to a tuple because a commented...
[ "0.62390125", "0.59990454", "0.58095795", "0.57502204", "0.56584907", "0.56279963", "0.55969024", "0.5521237", "0.5509375", "0.5504716", "0.5496373", "0.5363723", "0.531794", "0.5293608", "0.5290567", "0.5276565", "0.52743393", "0.52416605", "0.5224283", "0.5224242", "0.52160...
0.7021669
0
returns a modified header buffer with the image base changed to the provided base address
def _fix_header_image_base(self, header, nt_header): imb_offs = nt_header.OptionalHeader.ImageBase.obj_offset - self.obj_offset imb = nt_header.OptionalHeader.ImageBase newval = struct.pack(imb.format_string, int(self.obj_offset)) return header[:imb_offs] + newval + header...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _read_header(self):\n f = self._open(self.filename, 'rb')\n idx = 0\n header = b''\n # reading the header \n while idx < 13: \n header += f.readline().rstrip() # removes the \"\\n\\r\" at the end\n idx += 1\n # \"magically\" compute the data offse...
[ "0.5801565", "0.5690087", "0.5652942", "0.56325054", "0.55486536", "0.54878336", "0.54709184", "0.5431581", "0.5403561", "0.53856033", "0.5357821", "0.5346563", "0.5325183", "0.5313993", "0.53054875", "0.5264218", "0.5193449", "0.5187051", "0.5177819", "0.5175555", "0.5143217...
0.687387
0
Determines the string value for or end location of the key
def _determine_key(self, findend = False): if self.Key != None: name = None for n in self.Key: if n == None: return n # If the letter's valid, then deal with it if n == 0: if findend: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def key_value_string_value(key_value_string, key):\n if key_value_string is None or key is None:\n return None\n words = key_value_string.split(' ')\n for i in range(0, len(words)-1):\n if words[i] == key + ':':\n return words[i+1]\n return None", "def get_value(self, key: st...
[ "0.7128954", "0.64660406", "0.6441887", "0.6365823", "0.62895465", "0.62735194", "0.6181749", "0.61817443", "0.61766124", "0.6114784", "0.61035806", "0.61035806", "0.60622257", "0.6052435", "0.6052435", "0.60078233", "0.5998765", "0.5990275", "0.59151965", "0.5914784", "0.589...
0.665368
1
Renders a UTF16 string
def display_unicode(self, string): if string is None: return '' return string.decode("utf16", "ignore").encode("ascii", 'backslashreplace')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _text16(self, font, text, x0, y0, color=WHITE, background=BLACK):\n for char in text:\n ch = ord(char)\n if (font.FIRST <= ch < font.LAST\n and x0+font.WIDTH <= self.width\n and y0+font.HEIGHT <= self.height):\n\n each = 16\n ...
[ "0.58147746", "0.568368", "0.565337", "0.5632572", "0.5459072", "0.5347117", "0.53401065", "0.5276823", "0.5213218", "0.5203724", "0.5197888", "0.5144833", "0.51248384", "0.5114635", "0.511052", "0.50886446", "0.50571483", "0.50373083", "0.5031097", "0.5031097", "0.50146073",...
0.62821937
0
Returns the file version
def file_version(self): return self.get_version(self.FileVerMS) + "." + self.get_version(self.FileVerLS)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def version(self):\n a = re.search('(?<=_V)\\d{1,2}', self.fname)\n if a is None:\n return None\n else:\n return int(a.group())", "def get_version():\n\n current_dir = os.path.dirname(os.path.realpath(__file__))\n version_path = os.path.join(current_dir, VERSION_F...
[ "0.81010616", "0.78354764", "0.772773", "0.7555567", "0.7484181", "0.74439764", "0.743952", "0.73560786", "0.7338772", "0.732837", "0.72691864", "0.72675997", "0.72669727", "0.7261523", "0.7258668", "0.7251823", "0.7247981", "0.72477627", "0.7239214", "0.7227263", "0.7225165"...
0.8548073
0
Returns the file's flags
def flags(self): data = struct.pack('=I', self.FileFlags & self.FileFlagsMask) addr_space = addrspace.BufferAddressSpace(self.obj_vm.get_config(), 0, data) bitmap = {'Debug': 0, 'Prerelease': 1, 'Patched': 2, 'Private Build': 3, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def flags(self):\n return self._flags", "def get_flags(self):\n\n return self._flags", "def flags(self):\n if self._flags is None:\n raise ValueError('Flags are not available since dataset '\n 'was opened with metadata only')\n return self._fla...
[ "0.74164915", "0.7365765", "0.7306501", "0.7034275", "0.69856757", "0.6956966", "0.693179", "0.691857", "0.69089735", "0.68848044", "0.6857017", "0.684196", "0.68312913", "0.6696304", "0.66916585", "0.66664183", "0.66175085", "0.6596741", "0.64871913", "0.6412913", "0.6397083...
0.7750857
0
Return a copy of hits shifted and trimmed to match self.truth. hits must have the same frequency as self.truth.
def alignshift(self, hits): return hits.shift(self.horizon, axis=0) \ .align(self.truth, axis=0, join='right')[0]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def cleaned(self, start_threshold=0.01, end_threshold=0.25, shifted=True):\n start_i, end_i = None, None\n\n max_i = np.nanargmax(self.ys)\n max_y = self.ys[max_i]\n\n if start_threshold is not None:\n # includes the value before threshold is met\n for i, y in enum...
[ "0.5625676", "0.53062385", "0.512562", "0.50831914", "0.5061793", "0.50101686", "0.4993119", "0.49484766", "0.49025172", "0.48564422", "0.48109755", "0.47933322", "0.47614375", "0.47234794", "0.47166798", "0.47092518", "0.47006017", "0.46792665", "0.46642837", "0.46602577", "...
0.5598753
1
Assumes myList is sorted. Returns closest value to myNumber. If two numbers are equally close, return the smallest number.
def takeClosest(myList, myNumber): pos = bisect_left(myList, myNumber) if pos == 0: return myList[0] if pos == len(myList): return myList[-1] before = myList[pos - 1] after = myList[pos] if after - myNumber < myNumber - before: return after else: retu...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def takeClosest(myList, myNumber):\n pos = bisect_left(myList, myNumber)\n if pos == 0:\n return 0 #myList[0]\n if pos == len(myList):\n return len(myList)-1 #myList[-1]\n\n before = myList[pos - 1]\n after = myList[pos]\n\n if after - myNumber < myNumber - before:\n return po...
[ "0.8521541", "0.76922435", "0.7656438", "0.7287982", "0.7014501", "0.6732125", "0.6697386", "0.66785496", "0.66401225", "0.66105974", "0.656588", "0.6560782", "0.64787084", "0.64621955", "0.6439355", "0.6437316", "0.641067", "0.6385044", "0.6370557", "0.63562495", "0.63331723...
0.8773185
0
Overlay the card on top of the src
def overlayCard(src: np.array, card: np.array, mask:np.array, top_left: Point) -> Any: max_y = src.shape[0] # if top left is outside the src if top_left.y >= max_y: return # get the ROI rows, cols, _ = mask.shape roi = src[top_left.y:max_y, top_left.x:top_left.x+cols] ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def make_card_icon(self):\n card_icon = pygame.Surface((card_dimensions[0]/2, card_dimensions[1]/2))\n card_icon.fill(self.color)\n pygame.draw.rect(card_icon, CARD_OUTLINE, (0,0,card_icon.get_width(), card_icon.get_height()), 1)\n #the picture\n pic = pygame.transform.scale(self...
[ "0.59966683", "0.59719294", "0.59591544", "0.59294903", "0.5928805", "0.59207386", "0.569979", "0.54795706", "0.5383957", "0.5292921", "0.5283945", "0.528266", "0.52679265", "0.5257612", "0.52402157", "0.5225715", "0.5220325", "0.5204619", "0.51837224", "0.5161136", "0.515696...
0.62227285
0
Generate a user card to overlay on top of the src
def addUserCard(src: np.array, alpha: float, current_y: float, top_left: tuple, bottom_right: tuple, background_color: tuple, foreground_color: tuple, identity: str, time: datetime, font_path: str, font_size: int=24) -> np.array: img = src.copy() # dimmed the source img = cv2.addWeighted(img, alp...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def oneplayer():\n return render_template('cards.html')", "def make_card_icon(self):\n card_icon = pygame.Surface((card_dimensions[0]/2, card_dimensions[1]/2))\n card_icon.fill(self.color)\n pygame.draw.rect(card_icon, CARD_OUTLINE, (0,0,card_icon.get_width(), card_icon.get_height()), 1)\n ...
[ "0.62067837", "0.60931987", "0.60509694", "0.60508245", "0.57916325", "0.5754831", "0.56826967", "0.5638378", "0.55915296", "0.5540149", "0.5523639", "0.54864603", "0.54524475", "0.54398614", "0.5433686", "0.54308635", "0.54275155", "0.54209024", "0.54202336", "0.5419586", "0...
0.65504867
0
forkmap.map(..., n=nprocessors), same as map(...). n must be a keyword arg; default n is number of physical processors.
def map(f, *a, **kw): def writeobj(pipe, obj): try: s = marshal.dumps(obj) s = struct.pack('i', len(s)) + s except: try: s = cPickle.dumps(obj) except: print obj s = cPickle.dumps(obj) s = struct.pack('i', -len(s)) + s os.write(pipe, s) def re...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def pfmap(func, workers=8):\n return fmap(func)", "def map(func, iterable, chunksize=None, ncpu=0, limit=True, progress=False):\n if (ncpu == 0):\n if (not progress):\n return _map(func, iterable)\n else:\n r = []\n if isinstance(progress, str):\n ...
[ "0.73466885", "0.7045566", "0.69555485", "0.6916925", "0.6867893", "0.6712211", "0.6629893", "0.6470534", "0.6378345", "0.6297177", "0.6100757", "0.6050541", "0.6016031", "0.601225", "0.5993307", "0.5915234", "0.5865009", "0.58327293", "0.58125037", "0.5781024", "0.5759589", ...
0.73086846
1
Check if the number is palindromic. O(1) timecomplexity O(1) spacecomplexity
def is_palindromic(n: int) -> bool: str_n = str(n) if str_n == str_n[::-1]: return True return False
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def isPalindromic(n: int):\n return str(n) == str(n)[::-1]", "def is_palindrome(n):\n d = digits(n)\n r = int(\"\".join([str(i) for i in d]))\n return n == r", "def is_palindrome(n):\n x, y = n, 0\n f = lambda: 10 * y + x % 10\n while x > 0:\n x, y = x // 10, f()\n return y == n"...
[ "0.8517692", "0.80143285", "0.7946466", "0.792349", "0.7887479", "0.7825143", "0.7789734", "0.7784462", "0.7754578", "0.77515846", "0.7744035", "0.7723485", "0.770385", "0.76945305", "0.7589223", "0.7582267", "0.75784665", "0.7555034", "0.7526849", "0.7496103", "0.74658847", ...
0.82342494
1
Calculate the sum of the digits in the number.
def sum_of_digits_in_number(n: int) -> int: return sum(int(digit) for digit in str(n))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def sumDigit():", "def calculate_digits_sum(number: int) -> int:\n\n # Return value\n ret = 0\n\n while number != 0:\n # Extract the last digit number and add it to ret\n ret += number % 10\n\n # Delete the last digit of the number\n number //= 10\n\n return ret", "def g...
[ "0.8373557", "0.8288675", "0.8287705", "0.8256345", "0.8218147", "0.8207546", "0.820222", "0.8192879", "0.81736803", "0.8165122", "0.8146696", "0.805993", "0.8045805", "0.8027341", "0.80214125", "0.7909749", "0.7819021", "0.7793516", "0.7512039", "0.75100523", "0.7226058", ...
0.8439344
0
Multiply all elements in array. O(n) timecomplexity O(1) spacecomplexity
def product(array: Iterable): product = 1 for i in array: product *= i return product
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def multiply(numbers):\n prod = 1\n for i in numbers:\n prod = prod*i\n return prod", "def prod(arg):\n ret = 1\n for i in range(0, len(arg)):\n ret = ret * arg[i]\n return ret", "def prod(iterable):\n \n return reduce(operator.mul, iterable, 1)", "def __mul__(self, i):\...
[ "0.68984216", "0.6817217", "0.68122405", "0.68080294", "0.6798158", "0.6798158", "0.6798158", "0.67805743", "0.67755836", "0.67672944", "0.6732547", "0.66867065", "0.6683021", "0.66712505", "0.66672236", "0.66325617", "0.6606041", "0.65941656", "0.6586031", "0.6581371", "0.65...
0.7929102
0
Find all divisors of a number. O(sqrt(n)) timecomplexity O(n) spacecomplexity
def find_divisors(n: int) -> Set[int]: divisors = {1, n} for i in range(2, int(n ** 0.5) + 1): if n % i == 0: divisors.add(i) divisors.add(n // i) return divisors
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getDivisors(n):", "def find_divisors(n):\n\n\tpd = [1]\n\n\tsqrtN = int(math.sqrt(n))\n\n\tfor d in range(2, sqrtN+1):\n\t\tif n % d == 0:\n\t\t\tpd.append(d)\n\t\t\tpair = int(n/d)\n\t\t\tif not pair == d:\n\t\t\t\tpd.append(pair)\n\n\treturn pd", "def divisors(n):\n d = []\n for i in range(1, int(m...
[ "0.8378229", "0.82921267", "0.8258386", "0.824777", "0.8161784", "0.81405884", "0.81158715", "0.80825186", "0.80824065", "0.8021525", "0.79500633", "0.79354244", "0.7930292", "0.7918839", "0.7914931", "0.7914827", "0.7891488", "0.788354", "0.78337795", "0.7827369", "0.7817869...
0.83815986
0
Check if a number is divisible by all numbers in array. O(n) timecomplexity O(1) spacecomplexity
def check_divisible(n: int, divisors: Iterable) -> bool: for i in divisors: if n % i != 0: return False return True
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def div_by(n, list_of_num):\n for num in list_of_num:\n if not n % num:\n return True\n return False", "def isGoodArray(self, nums: List[int]) -> bool:\n return functools.reduce(math.gcd, nums)==1", "def is_divisible(inpt:int, i:int) -> bool:\n return inpt%i == 0", "def is_d...
[ "0.7376041", "0.71703494", "0.7145728", "0.7145728", "0.6929325", "0.68242365", "0.6741569", "0.6678536", "0.6652018", "0.6615477", "0.655402", "0.655402", "0.6532272", "0.6516223", "0.64999205", "0.641369", "0.63702595", "0.631113", "0.6293705", "0.6261746", "0.62533575", ...
0.7214447
1
Compute len of Collatz sequence. O(1) spacecomplexity
def collatz_sequence_len(n: int) -> int: result = 1 while n != 1: if n % 2 == 0: n //= 2 else: n = 3 * n + 1 result += 1 return result
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def collatz_length(val):\r\n assert val >= 1\r\n \r\n # Seed the dictionary with collatz_length(1) = 1.\r\n if val == 1:\r\n collatz_len_dict[1] = 1\r\n return collatz_len_dict[1]\r\n \r\n # Return the collatz length if it exists in the dictionary.\r\n if val in collatz_len_dict:...
[ "0.726585", "0.70003325", "0.6974426", "0.6440774", "0.64402974", "0.63847375", "0.6323994", "0.6320161", "0.6246694", "0.62032574", "0.6161653", "0.61555225", "0.61552596", "0.61382324", "0.61251944", "0.6114598", "0.6080297", "0.60793746", "0.6055634", "0.6054138", "0.60317...
0.80468637
0
Fibonacci numbers generator that yields position of the number and number itself.
def fibonacci_generator(): fib_prev = 0 # prev fib number fib_cur = 1 # next fib number i = 1 # number position while True: yield i, fib_cur i += 1 fib_prev, fib_cur = fib_cur, fib_prev + fib_cur
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def yieldFibonacci():\n yield 1\n a = 1\n b = 2\n while True:\n yield b\n a, b = b, a + b", "def fibonacci_gen(n=1):\n a, b = 0, 1\n while True:\n yield a\n a, b = b, (a + b) * n", "def fib(number: int) -> int:\n return next(islice(generator(number), number, num...
[ "0.7914288", "0.78763527", "0.77993584", "0.7797588", "0.7692012", "0.76505595", "0.764296", "0.76354194", "0.76327753", "0.76297504", "0.75923735", "0.7549603", "0.75330853", "0.7509857", "0.7501625", "0.7491575", "0.7451226", "0.73421276", "0.73374224", "0.73136836", "0.730...
0.8405769
0
Prime numbers generator that yields position of the number and number itself.
def prime_generator(): i = 0 # prime numbers counter num = 0 # current number while True: num += 1 if is_prime(num): i += 1 yield i, num
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def gen_primes():\n\tyield 2\n\tyield 3\n\tprime_list = [2, 3]\n\twhile 1:\n\t\tnext = prime_list[-1] + 2\n\t\ti = 0\n\t\twhile i < len(prime_list):\n\t\t\tif next%prime_list[i] == 0:\n\t\t\t\tnext+=2\n\t\t\t\ti=0\n\t\t\telse:\n\t\t\t\ti+=1\n\t\tprime_list.append(next)\n\t\tyield next", "def gen_primes():\n\n ...
[ "0.7023231", "0.70171297", "0.69697934", "0.6942526", "0.6920672", "0.6914686", "0.67672896", "0.67672896", "0.67569935", "0.66785425", "0.6669284", "0.66367215", "0.6618157", "0.65434796", "0.64823705", "0.6432703", "0.6387829", "0.6363819", "0.6362022", "0.63597316", "0.630...
0.7427608
0
Sets the Group the Member is in. Needs to be set so tab order works properly.
def set_group(self, group): self._group = group
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_group(self, group: str) -> None:\n self.group = group", "def group(self, group):\n self._group = group", "def set_group(self, address, group):\n self.groups[address] = group", "def setGroup(self, group):\n\t\tself.config.GROUP = group", "def group(self, val):\n self.set_...
[ "0.7711096", "0.7326087", "0.72447264", "0.71994495", "0.709708", "0.7083411", "0.7083411", "0.7083411", "0.6929075", "0.68464977", "0.68303144", "0.67630804", "0.6596073", "0.65727514", "0.65307826", "0.65190583", "0.65161115", "0.65015715", "0.6412089", "0.6363025", "0.6358...
0.76793545
1
Gets the Group this Member is in. The Group this Member is in.
def get_group(self): return self._group
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getGroup(self):\n\t\treturn self.Group", "def get_group(self, group_name):\n\n return self._group[group_name]", "def group(self):\n return self._group", "def group(self):\n return self._group", "def group(self):\n return self._group", "def get_group(self) -> Optional[str]:\n ...
[ "0.7794998", "0.7636299", "0.7622602", "0.7622602", "0.7622602", "0.75684416", "0.74724185", "0.73655677", "0.7326051", "0.71922463", "0.71530706", "0.7129704", "0.7088261", "0.70684534", "0.70625037", "0.70310026", "0.70310026", "0.70310026", "0.70285153", "0.7016255", "0.69...
0.8379241
0
Sets the nickname of the Member
def set_nickname(self, nickname): if len(nickname) > globals.MAX_NICKNAME_LENGTH: nick = nickname[0:globals.MAX_NICKNAME_LENGTH-3]+"..." else: nick = nickname self._nickname.set_message(nick)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def nickname(self, new_nickname):\r\n self.set({\"nickname\": new_nickname})", "async def nickname(self, ctx, *, nickname=\"\"):\n # [p]set nickname <nickname>\n\n nickname = nickname.strip()\n if nickname == \"\":\n nickname = None\n try:\n await self.bot...
[ "0.8081207", "0.793872", "0.77112406", "0.7681544", "0.74439347", "0.71882993", "0.7137291", "0.70793533", "0.7025866", "0.6879157", "0.6874425", "0.687341", "0.6866829", "0.67659074", "0.6725574", "0.6692538", "0.6663959", "0.66156805", "0.65894735", "0.6530449", "0.65269184...
0.81594807
0
Gets the nickname of a Member
def get_nickname(self): return self._nick
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def nickname(self):\r\n if \"nickname\" in self.data:\r\n return self.data[\"nickname\"]\r\n return None", "def get_display_name(member):\n if member.nick is None:\n name = member.name\n else:\n name = member.nick\n if User.objects.get(id=member.id).is_ironman:\n ...
[ "0.7942136", "0.7683267", "0.7238209", "0.7235817", "0.7205748", "0.71453834", "0.6900149", "0.68039113", "0.6789344", "0.6717712", "0.6629654", "0.6436516", "0.64070326", "0.64070326", "0.63944316", "0.6376947", "0.63725275", "0.63725275", "0.6366259", "0.6364886", "0.636488...
0.8068357
0
Sets the status of the Member (offline, online, away, busy) offline (red) Unable to talk to Member. online (Green) Able to talk to Member. away (Grey) Able to send messages to Member, but don't expect a response. busy (Yellow) Member is there, but will not likely respond.
def set_status(self, status): if status == "offline": self._status.set_message("N") self._status.set_foreground_color("red") elif status == "online": self._status.set_message("Y") self._status.set_foreground_color("Green") ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async def set_status(self, ctx, *, status: str = \"online\"):\n\n try:\n status = discord.Status[status.lower()]\n except KeyError:\n await ctx.error(\"Invalid Status\", \"Only `online`, `idle` or `dnd` statuses are available.\")\n else:\n await self.bot.change...
[ "0.7392773", "0.735482", "0.68975866", "0.6805247", "0.66294175", "0.6618874", "0.6618874", "0.6618874", "0.6602507", "0.66011685", "0.6540653", "0.64994997", "0.6472553", "0.64587176", "0.6445178", "0.6426996", "0.63954735", "0.6344724", "0.6343002", "0.63307667", "0.6330766...
0.7881072
0
Sets the width of the border.
def set_border_width(self, width): self._border.set_border_width(width) self._border_width = width
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def fl_set_border_width(borderwidth):\n _fl_set_border_width = library.cfuncproto(\n library.load_so_libforms(), \"fl_set_border_width\",\\\n None, [cty.c_int],\\\n \"\"\"void fl_set_border_width(int bw)\"\"\")\n i_borderwidth = library.convert_to_intc(borderwidth)\n library.keep_elem...
[ "0.79277027", "0.74946475", "0.74399734", "0.73794276", "0.7376792", "0.7335927", "0.7126565", "0.70414203", "0.69472903", "0.69472903", "0.69472903", "0.69472903", "0.69472903", "0.69472903", "0.69472903", "0.69472903", "0.69472903", "0.69472903", "0.69472903", "0.69172925", ...
0.8855588
0
operator < (overloaded for sorting) True/False First based on Status, then on nickname (alphebitical decending).
def __lt__(self, other): status = self.get_status() Ostatus = other.get_status() if status == Ostatus: return self.get_nickname() < other.get_nickname() if status == "online": return True elif status == "away" and Ostatus != "online": ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __lt__(self, other):\n return self.first_name < other.first_name", "def __lt__(self, value):\n return self.name < value.name", "def __lt__(self, other):\r\n print 'eaating shit from Person'\r\n if self.lastName == other.lastName :\r\n return self.name < other.name\r\n...
[ "0.6422751", "0.6379365", "0.6377821", "0.63655895", "0.6361564", "0.633996", "0.6331967", "0.6331967", "0.6331967", "0.6331967", "0.6331967", "0.6277708", "0.6256252", "0.62428635", "0.6210801", "0.61500895", "0.61423683", "0.6133925", "0.6117654", "0.611592", "0.60967314", ...
0.749902
0
operator = (overloaded for sorting) True/False Whether the status and nickname are exactly equal.
def __eq__(self, other): return (self.get_status() == other.get_status() and self.get_nickname() == other.get_nickname() and self._email == other._email)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __eq__(a,b): #Todo: this needs major testing of reading, writing\n if not a.assigner.title() == b.assigner.title():\n return False\n if not a.description == b.description:\n return False\n if not a.starttime == b.starttime:\n return False\n if not a....
[ "0.6392048", "0.6031803", "0.5996846", "0.5926732", "0.5911945", "0.5871551", "0.58615893", "0.5776352", "0.57724035", "0.5771185", "0.5749959", "0.5705553", "0.56784385", "0.5667999", "0.5667999", "0.5667999", "0.5667999", "0.5667999", "0.5667999", "0.5667999", "0.5667999", ...
0.6560987
0
Select this Member, and deselect all other members.
def clicked(self, event): for member in Member.focus: member.select(False) self.select()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def deselect_me(self):\r\n\t\tself.active = False", "def deselectall(self):\n if self.selection:\n for node in self.selection[:]: node.deselect()", "def Unselect(self):\r\n\r\n if self._current:\r\n self._current.SetHilight(False)\r\n self.RefreshLine(self._current)\r\n\r\n...
[ "0.6832077", "0.6709428", "0.62388176", "0.6035515", "0.6020763", "0.5963187", "0.59248453", "0.59019464", "0.58477366", "0.57764304", "0.5769103", "0.56828064", "0.5629517", "0.56136143", "0.55669916", "0.5542779", "0.55427396", "0.5530634", "0.53993815", "0.5393986", "0.538...
0.6710304
1
Save directional fit plots (per BX) to PDF files
def plotPerDirectionBx(options): name = options['scan'] + '_'+ options['name'] + options['fitted'] if 'method' in options: name += '_' + options['method'] name += '_collected' f = openRootFileR(name) for bx in options['crossings']: plotname = plotName(name+'_bx'+str(bx), timestamp=Fa...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def plot_to_pdf(pdf_fname, cmts_directory, misfit_windows_collection, iterations_list, snr_threshold, event_depth):\n rep_key = sorted(misfit_windows_collection.keys())[0]\n all_events = sorted(misfit_windows_collection[rep_key].keys())\n with PdfPages(pdf_fname) as pdf:\n for each_event in tqdm.tq...
[ "0.6579656", "0.64710206", "0.646248", "0.6411696", "0.624837", "0.6235697", "0.62115884", "0.6149735", "0.61176234", "0.6107436", "0.60888684", "0.59961104", "0.5978463", "0.59609264", "0.5945123", "0.5909598", "0.5829063", "0.5823828", "0.581717", "0.58098584", "0.580651", ...
0.6693798
0
Save profile histograms per timestamp to PDF files
def plotPerTimeStamp(options): name = options['name'] + '_' + options['scan'] + '_perTime' if options['extra']: name += '_' + options['extra'] f = openRootFileR(options['name']+'_perTime') histname = plotName(name, timestamp=False) filename = plotName(name, timestamp=True) filepath = plo...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def writeProfile(fname,prof):\n t = np.linspace(0,1,prof.shape[0],endpoint=False)\n fh = open(fname,'w')\n for x in range(prof.shape[0]):\n fh.write('%.7e %.7e\\n' % (t[x],prof[x]))\n fh.close()", "def save_histogram(\n self, filename: [str, Path, BinaryIO], bins: int = 10, **kwargs\n ...
[ "0.62776744", "0.6167443", "0.61183095", "0.6048312", "0.5998362", "0.5981554", "0.5956513", "0.59421986", "0.5930612", "0.5912754", "0.5900994", "0.58697546", "0.5851763", "0.58115876", "0.57516927", "0.57259107", "0.57156265", "0.5687887", "0.568231", "0.5666851", "0.562067...
0.62126917
1
Camera projection mode, 0 for perspective and 1 for orthogonal.
def projection_mode(self, mode): self.ptr.projection_mode(mode)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def projection_matrix(self) -> TransformationMatrixType:\n if self._projection_matrix is None:\n if self.projection_mode == Projection.TOP_DOWN:\n self._projection_matrix = self.orthographic_matrix\n else:\n self._projection_matrix = self.perspective_matri...
[ "0.6761293", "0.644626", "0.6436744", "0.61794835", "0.6093503", "0.6069873", "0.60338855", "0.60327417", "0.59998", "0.5971919", "0.59537846", "0.593361", "0.59260374", "0.5902397", "0.5899235", "0.58973503", "0.58923215", "0.5890294", "0.5875006", "0.5875006", "0.5871123", ...
0.75059366
0
A FuzzyDateField can be assigned a value without anything blowing up
def test_fuzzy_date_field(self): fdf = FuzzyDateField(FuzzyDate(10, 2013))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_fuzzy_date_field_exception(self):\n with self.assertRaises(ValueError):\n fdf = FuzzyDateField(FuzzyDate(59, 2013))", "def test_fuzzy_date_input(self):\n fdi = FuzzyDateInput(required=False)\n\n tests = (\n ([None, None], None),\n ([], None),\n ...
[ "0.7273849", "0.7094691", "0.64702415", "0.5972673", "0.59609586", "0.5846607", "0.5500081", "0.54843104", "0.5471241", "0.5446694", "0.5375746", "0.528465", "0.5279556", "0.5270848", "0.5266763", "0.5193815", "0.5167447", "0.5148224", "0.51431924", "0.5132247", "0.51303554",...
0.8278529
0
Find a particular attribute in a device retrieved from database. Return the attribute, if found, 'None' otherwise
def find_attribute(orm_device, attr_name, attr_type): for template_id in orm_device['attrs']: for attr in orm_device['attrs'][template_id]: if (attr['label'] == attr_name) and (attr['type'] == attr_type): LOGGER.debug(f" retrieving attribute {attr}") return attr ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_attr(attributes, name):\n try:\n return attributes.getValue(name)\n except KeyError:\n return None", "def getAttribute(self, username, attribute):\n if username in self.contents:\n if attribute in self.contents[username]:\n return self.contents[usernam...
[ "0.6901232", "0.67547685", "0.66523165", "0.65910554", "0.65739346", "0.64429885", "0.64263874", "0.641367", "0.6385312", "0.6384112", "0.63745815", "0.6365594", "0.6340235", "0.6321027", "0.6303907", "0.62828785", "0.62793463", "0.62613136", "0.6258598", "0.62290764", "0.621...
0.79836303
0
Creates a new device id
def generate_device_id(): # TODO this is awful, makes me sad, but for now also makes demoing # easier We might want to look into an auto-configuration feature for # devices, such that ids are not input manually on devices _attempts = 0 generated_id = '' while _attempts ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_device(name, device_type, runtime):\n command = 'create \"%s\" \"%s\" \"%s\"' % (\n name, device_type.identifier, runtime.identifier)\n device_id = _run_command(command)\n\n # The device ID has a new line at the end. Strip it when returning.\n return device_id[:-1]", "def test_creat...
[ "0.7249364", "0.651375", "0.651375", "0.6454852", "0.64354026", "0.64354026", "0.6417076", "0.6392928", "0.63136935", "0.6307749", "0.6264777", "0.62547284", "0.6227422", "0.62167674", "0.6171738", "0.6131766", "0.6115982", "0.6034566", "0.60262775", "0.6024409", "0.59283864"...
0.70444405
1
Fetches the list of known device ids.
def list_ids(token): init_tenant_context(token, db) data = [] LOGGER.debug(f" Fetching list with known devices") for id in db.session.query(Device.id).all(): data.append(id[0]) return data
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async def find_devices() -> List[DeviceInfo]:\n return await Discovery.search_devices()", "def get_device_ids(self) -> list[bluetooth.BluetoothUuid]:\n return [bluetooth.BluetoothUuid(i) for i in self.deviceIds()]", "def get_devices(jwt: str) -> List:\n LOGGER.debug(\"Retrieving devices......
[ "0.7168416", "0.710372", "0.70740366", "0.70475334", "0.6912452", "0.68758357", "0.6864888", "0.6851874", "0.6843571", "0.6794221", "0.67756575", "0.677536", "0.6742102", "0.67125595", "0.6695285", "0.66945463", "0.6691035", "0.6688566", "0.6623563", "0.65172327", "0.6511924"...
0.8147232
0
Validates if the device id follows the rules implemented by dojot
def validate_device_id(device_id): regex = re.compile(r'^[0-9a-fA-F]{2,6}$') if regex.match(device_id) == None: raise ValidationError('Device ID must be 2-6 characters and must be hexadecimal (0-9,a-f,A-F).')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _valid_device(device):\n required_fields = ('name', 'type', 'group', 'canonical_name')\n if all(field in device for field in required_fields):\n return True\n return False", "def is_valid_pci_device_vendor_id(id):\n val = id.replace('0x', '').strip()\n if not is_valid_hex(id):\n ...
[ "0.6638264", "0.6557552", "0.6472533", "0.64402276", "0.64393127", "0.64205253", "0.6330009", "0.62676156", "0.61864066", "0.61861867", "0.6160878", "0.615324", "0.61483675", "0.6136146", "0.61361164", "0.611015", "0.6078391", "0.6041878", "0.60346705", "0.6021835", "0.600350...
0.73607147
0
Associates given template with device
def add_template_to_device(token, device_id, template_id): tenant = init_tenant_context(token, db) orm_device = assert_device_exists(device_id) orm_template = assert_template_exists(template_id) orm_device.templates.append(orm_template) try: db.session.commit() ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_create_device_template(self):\n pass", "def test_update_device_template(self):\n pass", "def test_get_device_template(self):\n pass", "def create_device(jwt: str, template_id: str, label: str) -> str:\n LOGGER.debug(\"Creating template...\")\n\n args = {\n ...
[ "0.7093963", "0.6741128", "0.6444731", "0.6202347", "0.5982737", "0.59544533", "0.58833015", "0.58833015", "0.58812666", "0.5825397", "0.57730305", "0.5758544", "0.5596477", "0.5593448", "0.55852723", "0.5574858", "0.5542204", "0.5521828", "0.5485388", "0.545827", "0.5449561"...
0.7004287
1
Disassociates given template with device
def remove_template_from_device(token, device_id, template_id): tenant = init_tenant_context(token, db) updated_device = assert_device_exists(device_id) relation = assert_device_relation_exists(device_id, template_id) # Here (for now) there are no more validations to perform, as templat...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_delete_device_template(self):\n pass", "def test_unshare_template_registration(self):\n pass", "def test_unregister_template(self):\n pass", "def delete_template(self):\n try:\n os.remove(self.path)\n except Exception:\n pass", "def untag_re...
[ "0.68235356", "0.64119965", "0.6262007", "0.5936887", "0.58706874", "0.58450484", "0.57327724", "0.5726559", "0.5720364", "0.5720364", "0.5720364", "0.57185036", "0.570645", "0.56290376", "0.56244653", "0.5588681", "0.55878305", "0.5567942", "0.55649894", "0.5563578", "0.5558...
0.6834273
0
Return a list of devices that have a particular template associated to it
def get_by_template(token, params, template_id): tenant = init_tenant_context(token, db) page = ( db.session.query(Device) .join(DeviceTemplateMap) .filter_by(template_id=template_id) .paginate(page=params.get('page_number'), per_page=para...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_get_device_templates(self):\n pass", "def attached_devices(template):\n\n url = base_url + \"/template/device/config/attached/{0}\".format(template)\n\n response = requests.get(url=url, headers=header,verify=False)\n if response.status_code == 200:\n items = response.json()['data'...
[ "0.6678167", "0.6473679", "0.62452865", "0.61165714", "0.58044285", "0.5667819", "0.564642", "0.56240433", "0.5623741", "0.553225", "0.5455962", "0.543212", "0.5390477", "0.534885", "0.53479457", "0.52998805", "0.52833533", "0.5272643", "0.5270288", "0.523041", "0.52300704", ...
0.67967194
0
Copies a pre shared key from a device attribute to another
def copy_psk(cls, token, src_device_id, src_attr, dest_device_id, dest_attr): tenant = init_tenant_context(token, db) src_device_orm = assert_device_exists(src_device_id, db.session) if not src_device_orm: raise HTTPRequestError(404, "No such device: {}".format(src_device_id)) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def shared_key(private_key,public_key):\n\treturn private_key.exchange(public_key)", "def genKey(self, otherKey):\n self.sharedSecret = self.genSecret(self.privateKey, otherKey)\n #print(\"Shared secret:\")\n #print(self.sharedSecret)\n s = hashlib.sha256()\n s.update(bytes(str...
[ "0.61895716", "0.60756516", "0.591246", "0.5636808", "0.56331825", "0.56129754", "0.5557372", "0.5489743", "0.5350086", "0.52919835", "0.5271251", "0.5263501", "0.52357495", "0.52305025", "0.5219102", "0.5215605", "0.51871455", "0.5154822", "0.5146113", "0.5121871", "0.511803...
0.6738275
0
Fetches known devices, potentially limited by a given value. Ordering might be userconfigurable too. Check API description for more information about request parameters and headers.
def flask_internal_get_devices(): try: # retrieve the authorization token token = retrieve_auth_token(request) # retrieve pagination page_number, per_page = get_pagination(request) params = { 'page_number': page_number, 'per_page': per_page, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_devices(self):\n return self.api_request('GET', self.url + '/device', {})", "def get_devices(token, params, sensitive_data=False):\n tenant = init_tenant_context(token, db)\n\n pagination = {'page': params.get('page_number'), 'per_page': params.get('per_page'), 'error_out': False}\n\...
[ "0.69358677", "0.6624522", "0.6621723", "0.66123044", "0.65878403", "0.6565869", "0.64921904", "0.64532816", "0.6450756", "0.64152664", "0.63179874", "0.625757", "0.62422895", "0.6160705", "0.60734993", "0.60325587", "0.6031738", "0.59549993", "0.5930714", "0.5890118", "0.587...
0.6713731
1
Runs layer normalization followed by dropout.
def layer_norm_and_dropout(input_tensor, dropout_prob, name=None, dropout_name=None): output_tensor = layer_norm(input_tensor, name) output_tensor = dropout(output_tensor, dropout_prob, dropout_name=dropout_name) return output_tensor
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def pre_post_process_layer(prev_out, out, process_cmd, dropout_rate=0.):\n for cmd in process_cmd:\n if cmd == \"a\": # add residual connection\n out = out + prev_out if prev_out else out\n elif cmd == \"n\": # add layer normalization\n out = layers.layer_norm(\n ...
[ "0.7032795", "0.6391331", "0.6328661", "0.62512356", "0.6220091", "0.6030707", "0.60122514", "0.58638924", "0.58638924", "0.58625156", "0.58561295", "0.58298075", "0.5814626", "0.5718249", "0.5709967", "0.56730735", "0.56632066", "0.56548005", "0.5653561", "0.5648844", "0.563...
0.66046226
1
Performs several types of attention 1) multiheaded attention from `from_tensor` to `to_tensor`. By default, this is an implementation of multiheaded attention based on "Attention is all you Need". If `from_tensor` and `to_tensor` are the same, then this is selfattention. Each timestep in `from_tensor` attends to the co...
def attention_layer(from_tensor, to_tensor, attention_mask=None, num_attention_heads=1, size_per_head=512, query_act=None, key_act=None, value_act=None, attenti...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def attention_layer(from_tensor,\n to_tensor,\n attention_mask=None,\n num_attention_heads=1,\n size_per_head=512,\n query_act=None,\n key_act=None,\n value_act=None,\n ...
[ "0.78216404", "0.65913695", "0.5948683", "0.58981717", "0.55256927", "0.54728514", "0.53279114", "0.529244", "0.5275274", "0.52608335", "0.5222576", "0.51994085", "0.5185228", "0.5127895", "0.5086893", "0.505606", "0.5044171", "0.49941444", "0.49187762", "0.48961437", "0.4890...
0.7887788
0
Computes and prints moments 02 to stdout.
def moments(path): g = from_file(path) h = 1.0 - g m1 = bgy3d.moments1(h) # Get the center of distribution center = m1[1:4] / m1[0] # Use center to compute 2nd momenta m2 = bgy3d.moments2nd(h, center) print "Moments from", path print "<1> = ", m1[0] print "<x> = ", m1[1] / ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def moments(self):", "def moments(infile):\n \n version = 0.0\n #ruler75###########################################\n # ALL THE IMPORT STUFF \n import read_sex\n import string\n from flags import addflag, allflags,isflagon\n from momsource import momsource, momcat\n from time import ti...
[ "0.67292076", "0.5867294", "0.55727154", "0.55620307", "0.54837894", "0.5482262", "0.5482262", "0.5463738", "0.5439306", "0.54296654", "0.54218966", "0.54009044", "0.53692555", "0.53471076", "0.5339355", "0.5326092", "0.527676", "0.52694386", "0.5255655", "0.52355766", "0.523...
0.5959959
1
Function to create the network module from provided model fn and flags
def create_model(self): model = self.model_fn(self.flags) print(model) return model
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def model_fn(model_dir):\n\n net = gluon.nn.SymbolBlock.imports('%s/model.json' % model_dir,\n ['data'], \n param_file='%s/model.params' % model_dir,\n ctx=mx.cpu())\n\n return net", "def model_fn(model_di...
[ "0.671422", "0.6646007", "0.63070667", "0.6304503", "0.6272501", "0.62541854", "0.62258416", "0.6205152", "0.61878914", "0.6128737", "0.6079335", "0.6076014", "0.606094", "0.60404265", "0.5982481", "0.5978807", "0.59529245", "0.59429884", "0.59308094", "0.5929518", "0.5910746...
0.6740473
0
Make the corresponding optimizer from the flags. Only below optimizers are allowed. Welcome to add more
def make_optimizer(self): # parameters = [self.encoder.parameters(), self.decoder.parameters(), self.spec_enc.parameters()] if self.flags.optim == 'Adam': op = torch.optim.Adam(self.model.parameters(), lr=self.flags.lr, weight_decay=self.flags.reg_scale) elif self.flags.optim == ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def setup_optimizers(self, *args, **kwargs):\n\n # self.optimizers.append(...)\n # self.loss.append(...)\n pass", "def _configure_optimizer(learning_rate):\n if FLAGS.optimizer == 'adadelta':\n optimizer = tf.train.AdadeltaOptimizer(\n learning_rate,\n rho=FLAGS.adadelta_rh...
[ "0.6734002", "0.6700126", "0.6692267", "0.6672637", "0.66392416", "0.6633101", "0.6613115", "0.6404118", "0.63944757", "0.6390522", "0.6347207", "0.6307785", "0.6301192", "0.6257054", "0.6233686", "0.6220153", "0.62087554", "0.6177149", "0.6150207", "0.6144948", "0.6144496", ...
0.7149734
0
Gets the active backend for this casepro instance
def get_backend(): global _ACTIVE_BACKEND if not _ACTIVE_BACKEND: _ACTIVE_BACKEND = locate(settings.SITE_BACKEND)() return _ACTIVE_BACKEND
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_profile_backend(self, profile):\n return self._get_attribute(profile, 'backend')", "def get_backend(self):\n return self.analyze_db_task(constants.TRAIN_DB).backend", "def get_backend():\n return __SETTINGS__._BACKEND", "def get_backend():\n return _BACKEND", "def backend(self):\n...
[ "0.75494736", "0.7513481", "0.7458784", "0.7404637", "0.73987234", "0.7319639", "0.7303815", "0.71876395", "0.7083139", "0.708233", "0.70689523", "0.7009284", "0.6922739", "0.69098556", "0.69017106", "0.69017106", "0.68886673", "0.6833785", "0.6833785", "0.6747233", "0.666991...
0.7887652
0
Pulls contacts modified in the given time window
def pull_contacts(self, org, modified_after, modified_before, progress_callback=None): pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_recent_contacts(user, limit=5, timespan_days=14) -> typing.List[Contact]:\n timespan_recent = datetime.now().astimezone() - timedelta(days=timespan_days)\n contacts_recent = (\n Contact.objects.filter(interactions__was_at__gt=timespan_recent)\n .filter(user=user)\n .annotate(coun...
[ "0.6372907", "0.56030774", "0.53730536", "0.52406937", "0.51859474", "0.51588595", "0.51582783", "0.5062291", "0.49823055", "0.49673826", "0.49304265", "0.49119183", "0.4893238", "0.48634708", "0.48569855", "0.4847088", "0.4834561", "0.4832907", "0.4832073", "0.4830561", "0.4...
0.6342501
1
Pulls all contact fields
def pull_fields(self, org): pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get(self):\n args = GET_PARSER.parse_args()\n print(f'args={args}')\n\n return Contacts().get_all(\n args[\"phonetypeOne\"],\n args[\"phonetypeTwo\"],\n args[\"phonetypeThree\"],\n ...
[ "0.6611348", "0.6416279", "0.63586295", "0.62937874", "0.6180672", "0.61634904", "0.61201644", "0.61004156", "0.60794693", "0.60475147", "0.6044251", "0.60372907", "0.6014031", "0.5993656", "0.59730715", "0.5948702", "0.59382004", "0.59350777", "0.5933707", "0.593277", "0.591...
0.6581018
1
Pulls messages modified in the given time window
def pull_messages(self, org, modified_after, modified_before, as_handled=False, progress_callback=None): pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_messages(self, since_timestamp=0):\n return filter(lambda x: x.timestamp > since_timestamp,\n self.chat_messages)", "def _get_messages(self):\n try:\n messages = self.channel.get_messages(int(self.get_argument('since_timestamp', 0)))\n\n except ValueEr...
[ "0.5940991", "0.5776993", "0.57537824", "0.57378644", "0.5713814", "0.56254584", "0.549043", "0.5456706", "0.5432054", "0.5430087", "0.5368939", "0.5348661", "0.533533", "0.53292567", "0.5229311", "0.52072114", "0.5195331", "0.5186423", "0.5154368", "0.5151444", "0.51347214",...
0.6059442
0
Adds the given contact to a group
def add_to_group(self, org, contact, group): pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async def add_contact_to_contact_group(dbcon: DBConnection, contact_group_id: int, contact_id: int) -> None:\n if not await contact_group_exists(dbcon, contact_group_id):\n raise errors.InvalidArguments('contact group does not exist')\n if not await contact_exists(dbcon, contact_id):\n raise er...
[ "0.7749197", "0.77469045", "0.715298", "0.71111506", "0.69037414", "0.6896029", "0.68665344", "0.6827527", "0.6824475", "0.67674", "0.67276967", "0.64900553", "0.63950515", "0.63912946", "0.63846886", "0.6381403", "0.63315827", "0.62689406", "0.622115", "0.6212235", "0.617421...
0.8768964
0
Removes the given contact from a group
def remove_from_group(self, org, contact, group): pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async def delete_contact_from_contact_group(dbcon: DBConnection, contact_group_id: int, contact_id: int) -> None:\n q = \"\"\"delete from contact_group_contacts where contact_group_id=%s and contact_id=%s\"\"\"\n q_args = (contact_group_id, contact_id)\n await dbcon.operation(q, q_args)", "def RemoveCon...
[ "0.7738712", "0.75844175", "0.7367516", "0.73304904", "0.7268021", "0.7024257", "0.69580394", "0.69009084", "0.6803163", "0.67921567", "0.66546595", "0.66142553", "0.65734607", "0.6561294", "0.6542721", "0.6524597", "0.6427319", "0.6416925", "0.6344568", "0.6335024", "0.63288...
0.8879491
0
Stops any ongoing flow runs for the given contact
def stop_runs(self, org, contact): pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def stop() -> None:", "def stop(self) -> None:\n ...", "def stop(self):\n self._run = False", "def stop (self):\n pass", "def stop (self):\n pass", "def stop(self) -> None:", "def stop(self) -> None:", "def stop(self):\n pass", "def stop(self):\n pass", "...
[ "0.5933513", "0.58750427", "0.5862508", "0.58500177", "0.58500177", "0.58467513", "0.58467513", "0.58322924", "0.58322924", "0.58322924", "0.58322924", "0.58322924", "0.58322924", "0.58322924", "0.58322924", "0.58322924", "0.58322924", "0.58322924", "0.5822106", "0.5822106", ...
0.8120205
0
Adds a label to the given messages
def label_messages(self, org, messages, label): pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def addLabel(*args):", "def label_messages(self, messages, label=None, label_uuid=None):\n payload = self._build_params(messages=messages, action='label', label=label, label_uuid=label_uuid)\n self._post('message_actions', None, payload)", "def addmessageslabels(self, uidlist, labels):\n\n ...
[ "0.75261736", "0.74693096", "0.71880233", "0.6999815", "0.69119644", "0.68023497", "0.6617087", "0.65335524", "0.6471467", "0.64527583", "0.6380113", "0.6318893", "0.6234198", "0.61687577", "0.6146832", "0.6146832", "0.6146832", "0.6146832", "0.6146832", "0.61147046", "0.6102...
0.81872386
0
Removes a label from the given messages
def unlabel_messages(self, org, messages, label): pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def unlabel_messages(self, messages, label=None, label_uuid=None):\n payload = self._build_params(messages=messages, action='unlabel', label=label, label_uuid=label_uuid)\n self._post('message_actions', None, payload)", "def deletemessageslabels(self, uidlist, labels):\n\n labels = labels - ...
[ "0.80253", "0.7788127", "0.73874354", "0.71699005", "0.70764935", "0.7037179", "0.6937076", "0.6839757", "0.6730904", "0.66412556", "0.65370417", "0.65187776", "0.6510565", "0.6479989", "0.64494795", "0.64099365", "0.64099365", "0.63469744", "0.62426597", "0.6208268", "0.6190...
0.8519321
0
Archives the given messages
def archive_messages(self, org, messages): pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def archive_messages(self, messages):\n self._post('message_actions', None, self._build_params(messages=messages, action='archive'))", "def unarchive_messages(self, messages):\n self._post('message_actions', None, self._build_params(messages=messages, action='unarchive'))", "def _archive_logs(sel...
[ "0.8038418", "0.65381896", "0.6135404", "0.6130519", "0.58608985", "0.5820875", "0.5799502", "0.56735307", "0.56417036", "0.56386155", "0.5579611", "0.5579611", "0.55789346", "0.5469102", "0.5454764", "0.5426546", "0.5292785", "0.5283879", "0.5280061", "0.52529144", "0.524585...
0.79814565
1
Archives all messages for the given contact
def archive_contact_messages(self, org, contact): pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def archive_contacts(self, contacts):\n self._post('contact_actions', None, self._build_params(contacts=contacts, action='archive'))", "def archive_messages(self, org, messages):\n pass", "def archive_messages(self, messages):\n self._post('message_actions', None, self._build_params(messag...
[ "0.70698756", "0.65666515", "0.6257201", "0.55854166", "0.51264703", "0.5064041", "0.4993844", "0.49865454", "0.49637476", "0.4916462", "0.49034166", "0.48514304", "0.48303494", "0.47683123", "0.4719243", "0.47067264", "0.47029313", "0.46990845", "0.46645817", "0.46523926", "...
0.80612326
0
Restores (unarchives) the given messages
def restore_messages(self, org, messages): pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def unarchive_messages(self, messages):\n self._post('message_actions', None, self._build_params(messages=messages, action='unarchive'))", "def archive_messages(self, messages):\n self._post('message_actions', None, self._build_params(messages=messages, action='archive'))", "def archive_messages(...
[ "0.77775854", "0.65339184", "0.6420946", "0.62216944", "0.5984249", "0.5519885", "0.54908043", "0.54738826", "0.54212093", "0.54081935", "0.53895754", "0.53652024", "0.533392", "0.53127706", "0.5307849", "0.5288503", "0.5266448", "0.5256292", "0.5251975", "0.5245401", "0.5212...
0.7322216
1
Flags the given messages
def flag_messages(self, org, messages): pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def unflag_messages(self, org, messages):\n pass", "def mark_messages_flagged(self, mbox, msgset):\n self._add_flag(mbox, msgset, r'(\\Flagged)')", "def test_filter_messages_non_message(self):\n pass", "def test_flag(self):\n recipient = self.create_user()\n thread = self.c...
[ "0.62548643", "0.60290325", "0.59306383", "0.59045357", "0.5755508", "0.57112575", "0.5688638", "0.5659094", "0.5653459", "0.5653459", "0.56464344", "0.5549997", "0.5515646", "0.55129987", "0.5499277", "0.5494998", "0.54843855", "0.548197", "0.5480137", "0.5478573", "0.547290...
0.79243565
0
Unflags the given messages
def unflag_messages(self, org, messages): pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def mark_messages_unflagged(self, mbox, msgset):\n self._remove_flag(mbox, msgset, r'(\\Flagged)')", "def unlabel_messages(self, org, messages, label):\n pass", "def unarchive_messages(self, messages):\n self._post('message_actions', None, self._build_params(messages=messages, action='unar...
[ "0.68880147", "0.67857444", "0.6343915", "0.6263609", "0.6074593", "0.59990966", "0.58899224", "0.5773783", "0.5693331", "0.56825656", "0.56801707", "0.5496917", "0.5395119", "0.532583", "0.5256164", "0.5232614", "0.5206068", "0.5148679", "0.51203686", "0.5083705", "0.5058738...
0.8338598
0
Fetches a contact's incoming and outgoing messages to display on a case timeline
def fetch_contact_messages(self, org, contact, created_after, created_before): pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def receiveContactList(self, contactList):", "def contacts(request):\n User = get_user_model()\n ids = set(request.user.chatmessage_set.all().values_list(\"recipients\", flat=True))\n context = {\n 'contacts': User.objects.filter(pk__in=ids)\n }\n return render(request, \"chat/contacts.html...
[ "0.6432034", "0.62822866", "0.5982838", "0.59174776", "0.58405066", "0.5831497", "0.5693382", "0.5687555", "0.5653335", "0.5652404", "0.5585191", "0.55604875", "0.55467224", "0.55259675", "0.5523025", "0.55170584", "0.5491223", "0.54852605", "0.5484155", "0.5483405", "0.54712...
0.77379125
0
Set items. Does not have to be strings. If items is a dictionary the string of the values are show to the user and the key is returned from GetAny If it is just an iterable the string of the values are shown and the raw equivalent input is returned.
def SetItems(self, items: Union[Iterable, dict]): if not items: return if isinstance(items, dict): items = [[key, str(value)] for key, value in items.items()] if self._sorted: items = sorted(items, key=lambda x: x[1]) self._items = [key for...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def put_in(self, items):\n try:\n if items[0] not in self.items:\n print(\"you don't have a \" + str(items[0]))\n return self\n if items[2] not in self.items:\n print(\"you don't have a \" + str(items[1]))\n return self\n ...
[ "0.62009406", "0.5768462", "0.56391984", "0.5633274", "0.5621747", "0.55339104", "0.5429804", "0.5320381", "0.53021246", "0.52935237", "0.5275827", "0.52436066", "0.52289635", "0.5216234", "0.51963955", "0.5189505", "0.5189501", "0.51155585", "0.5114263", "0.50838286", "0.506...
0.7074095
0
Check if two boards are equal
def board_equals(board, newboard): return (newboard == board).all()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __eq__(self, other) -> None:\n\t\tfor k, v in enumerate(self.board):\n\t\t\tif v != other.board[k]:\n\t\t\t\treturn False\n\t\treturn True", "def __eq__(self, other):\n for row in range( self.n ):\n if self.board[row] != other.board[row]:\n return False\n return True",...
[ "0.76765525", "0.7590167", "0.7520879", "0.73166174", "0.7049794", "0.6997381", "0.69779974", "0.696249", "0.69501203", "0.6933911", "0.6929893", "0.68988365", "0.6865647", "0.68118745", "0.6808368", "0.67976785", "0.67858136", "0.6755733", "0.673824", "0.67163175", "0.660529...
0.7748529
0
Cog unload handler. This removes any event hooks that were registered.
def cog_unload(self): self.bot.lavalink._event_hooks.clear()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def cog_unload(self):\n self.bot.lavalink_event_hooks.clear()", "def on_unload(self):\n pass", "def unloaded():\n pass", "async def cog_unload(self) -> None:\n self.update_guild_boost.stop()", "def cog_unload(self):\n\n self._check_to_send_cookie.cancel()", "def unload(self...
[ "0.8657892", "0.72803473", "0.7020988", "0.698424", "0.691849", "0.68781596", "0.6846889", "0.6832737", "0.6830664", "0.6765117", "0.6765117", "0.67053455", "0.6661772", "0.6613284", "0.6599922", "0.658577", "0.6564507", "0.6502889", "0.6488965", "0.64649194", "0.6411848", ...
0.87310874
0
Returns embed with no title as fancier way of replying.
def reply_embed(self, message: str): embed = discord.Embed(color=discord.Color.blurple()) embed.title = "" embed.description = message return embed
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def embed():", "async def get_hack_embed(self, channel: discord.TextChannel, perpetrator_id: int, target_id: int,) -> discord.Embed:\n\n timestamp = await self.get_timestamp()\n\n hack_embed = discord.Embed(\n title=\"Someone just got Hacked and lost Control of Everything!\",\n ...
[ "0.6679662", "0.59994054", "0.5966713", "0.5960028", "0.59088314", "0.58046204", "0.57281506", "0.5677738", "0.566666", "0.5624049", "0.56213224", "0.5620119", "0.55971074", "0.5560919", "0.5556021", "0.55310297", "0.54588825", "0.54498017", "0.5408814", "0.53532535", "0.5351...
0.6799117
0
Parses human readable duration to ms.
def parse_duration_str(self, duration): try: dl = duration.split(":") except Exception: return None if len(dl) > 4: return None while len(dl) < 4: dl.insert(0, 0) ret = int(dl[0]) * 60 * 60 * 24 + int(dl[1]) * \ 60 * 60...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def parse_duration_string_ms(duration):\n pattern = r'(?P<value>[0-9]+\\.?[0-9]*?)(?P<units>\\D+)'\n matches = list(re.finditer(pattern, duration))\n assert matches, 'Failed to parse duration string %s' % duration\n\n times = {'h': 0, 'm': 0, 's': 0, 'ms': 0}\n for match in matches:\n parsed = match.groupd...
[ "0.7170057", "0.64764357", "0.64503825", "0.64143217", "0.641086", "0.63711834", "0.636905", "0.63616914", "0.6334855", "0.62753356", "0.6236887", "0.6220458", "0.6178621", "0.6171785", "0.6161835", "0.6149162", "0.6109983", "0.6077356", "0.6068427", "0.6047436", "0.60183203"...
0.67639077
1
Get the dates where this series has values ts.get_dates() gets all dates where ts has values ts.get_dates(start=d1,end=d2) get all valid dates, d, where d1<=d<=d2 ts.get_dates(candidates=dates) get all valid dates, d, for d in dates
def get_dates(self, candidates=None, start=None, end=None): if candidates is not None: return [date for date in candidates if date in self.data] if start is None: start = self.first_date if end is None: end = self.last_date return [date for date in sel...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def dates(self):\n dates = []\n d = self.date_a\n while d < self.date_b:\n dates.append(d)\n d += datetime.timedelta(1)\n\n return dates", "def get_date_values(self, all_dates):\n\n if self.day_value == 'all':\n working_dates = all_dates[:]\n ...
[ "0.64756805", "0.6388395", "0.6278105", "0.624782", "0.6238439", "0.617077", "0.6128857", "0.60810596", "0.60660315", "0.60517985", "0.59450334", "0.59196717", "0.58980954", "0.5856224", "0.5839549", "0.5835172", "0.58209354", "0.5815195", "0.5815195", "0.5802644", "0.5764602...
0.70858955
0
Get the values for the specified dates.
def get_values(self, dates): ret = [] for d in dates: ret.append(self.data[d]) return ret
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_returns(self, dates):\n return get_price_returns(self, dates)", "def get_returns(self, dates):\n return get_price_returns(self, dates)", "def Dates(self):\n data = self.DictData()\n dates = [ row[ \"Date\"] for row in data ]\n return dates", "def get_date_values(sel...
[ "0.6465752", "0.6465752", "0.6337017", "0.63190037", "0.6302423", "0.63015485", "0.6172592", "0.6114428", "0.6096258", "0.60900587", "0.60705006", "0.6069238", "0.60506237", "0.6049215", "0.6042307", "0.59802204", "0.59703356", "0.59669536", "0.5939113", "0.59387743", "0.5902...
0.8803145
0
Calculate the Pearson correlation coefficient between this series and another on all days when they both have values. Uses scipy.stats.pearsonr to calculate it.
def correlation(self, other): dates=self.get_dates(other.get_dates()) #print(len(self.get_values(dates))) #print(len(other.get_values(dates))) #print(self.get_values(dates)) r,p=stats.pearsonr(self.get_values(dates), other.get_values(dates)) return r
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def pearsonCorrelation(x, y):\n\tsum_sq_x = 0\n\tsum_sq_y = 0\n\tsum_coproduct = 0\n\tmean_x = x[0]\n\tmean_y = y[0]\n\tif len(x) != len(y):\n\t\traise StatsError(\"Data sets are of different lengths.\")\n\tn = len(x)\n\tfor i in range(1,n):\n\t\tsweep = i / (i+1.0)\n\t\tdelta_x = x[i] - mean_x\n\t\tdelta_y = y[i]...
[ "0.7360399", "0.7208227", "0.7155166", "0.713183", "0.71158606", "0.711191", "0.70218587", "0.6996039", "0.6992368", "0.69837546", "0.6965201", "0.6962038", "0.69537663", "0.6944156", "0.68943065", "0.68788373", "0.6865398", "0.6854346", "0.6850651", "0.6850651", "0.6850651",...
0.8398194
0
Move all nodes in cluster1 to cluster2. And kill cluster1.
def combine_cluster_from_to(cl1, cl2): for node_id in clusters[cl1]: nodes[node_id] = cl2 clusters[cl2].append(node_id) clusters.pop(cl1)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def leave_cluster(\n self,\n nodes_names,\n ):\n for node_name in nodes_names:\n # Gets the node IP address.\n ip = self.get_node_ip(node_name)\n\n # Gets the token.\n docker_utils.swarm_leave(\n hostname=ip,\n ...
[ "0.6145484", "0.61324465", "0.5954599", "0.5924748", "0.58999866", "0.5896793", "0.5887858", "0.56757903", "0.56663275", "0.5655591", "0.5650627", "0.5638231", "0.5611794", "0.56020385", "0.559868", "0.5595428", "0.5595001", "0.55839825", "0.55317724", "0.55285084", "0.552544...
0.6545622
0
get all neighbours that are 1 or 2 steps away from node.
def get_2_step_neighbours(node): for i in range(len(node)): yield node[0:i] + (flip(node[i]),) + node[i+1:] for i, j in itertools.permutations(range(len(node)), 2): if i < j: yield node[0:i] + (flip(node[i]),) + node[i+1:j] + (flip(node[j]),) + node[j+1:]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_further_neighbours(self, cell):\n\t\tneighs = self.get_neighbours(cell)\n\t\ti, j = cell.find_id()\n\t\tneighbours = []\n\t\tfor neigh in neighs:\n\t\t\tx, y = neigh.find_id()\n\t\t\tif abs(x-i)+abs(y-j) > 1 or abs(x-i)+abs(y-j) == 0: \n\t\t\t\tneighbours.append(self.space[y,x])\n\t\treturn neighbours", ...
[ "0.7377711", "0.72533816", "0.717392", "0.7123747", "0.7041916", "0.70339006", "0.6999877", "0.69711643", "0.69493777", "0.69083476", "0.69074553", "0.6895527", "0.68819803", "0.6857781", "0.6856988", "0.684746", "0.6839912", "0.6798075", "0.6754088", "0.67450863", "0.6741007...
0.7481798
0
Translate with a given direction scaled by dist
def translate(self, axis: Vector, dist: float): self.origin = self.origin + axis * dist
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _define_transdist(self, loc: torch.Tensor, scale: torch.Tensor):\n\n return _define_transdist(loc, scale, self.increment_dist, self.ndim)", "def ty(self, dist: float) -> \"Mate\":\n self.translate(self.y_dir, dist)\n return self", "def zoom(self, dr):\n d = self.getDistance()\n ...
[ "0.64987594", "0.63573056", "0.6215362", "0.619352", "0.61720383", "0.6116733", "0.6090099", "0.6078002", "0.60694516", "0.60694516", "0.60559475", "0.60549414", "0.601227", "0.6008165", "0.5907597", "0.58837587", "0.5868495", "0.5858269", "0.5742285", "0.57237685", "0.571494...
0.7711936
0
Return a new mate moved by the given Location
def moved(self, loc: Location) -> "Mate": def move(origin: Vector, vec: Vector, loc: Location) -> Tuple[Vector, Vector]: reloc = cast(Edge, Edge.makeLine(origin, origin + vec).moved(loc)) v1, v2 = reloc.startPoint(), reloc.endPoint() return v1, v2 - v1 origin, x_dir...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def move(self, deltaX, deltaY):\n\t\treturn Location(self.x + deltaX, self.y + deltaY)", "def move(self, deltaX, deltaY):\n return Location(self.x + deltaX, self.y + deltaY)", "def navigateNew(self, location):\r\n self.history = self.history[:self.currLoc+1]\r\n self.currLoc += 1\r\n ...
[ "0.6578063", "0.6445667", "0.64384043", "0.63514256", "0.6349512", "0.6325681", "0.62559164", "0.62311095", "0.61734366", "0.6162421", "0.6156318", "0.59647125", "0.5897715", "0.58834577", "0.58276635", "0.5812422", "0.57135344", "0.5685478", "0.56570804", "0.5655626", "0.564...
0.77116907
0
Add document to the termdocument matrix.
def add_doc(self, document): # Split document up into list of strings #words = self.tokenize(document) words = document # Count word frequencies in this document word_counts = {} for word in words: word_counts[word] = word_counts.get(word, 0) + 1 # Add...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_document(self, document: Document) -> None:\n self._index[document.url] = document", "def add(self, document):\n #words=[word.lower() for word in words if word.isalpha()] #added on 0415\n for token in [t.lower() for t in nltk.word_tokenize(document)]:\n if not token.isal...
[ "0.6929864", "0.6883895", "0.65847003", "0.65210354", "0.64119345", "0.63931704", "0.6141145", "0.6057907", "0.60547733", "0.60378766", "0.59707755", "0.5894285", "0.58623147", "0.58588594", "0.5857861", "0.5845867", "0.58418286", "0.5770271", "0.5749252", "0.57470435", "0.57...
0.7465959
0
Write termdocument matrix to a CSV file. filename is the name of the output file (e.g. 'mymatrix.csv'). cutoff is an integer that specifies only words which appear in 'cutoff' or more documents should be written out as columns in the matrix.
def write_csv(self, filename, cutoff=2): f = csv.writer(open(filename, 'wb')) for row in self.rows(cutoff=cutoff): f.writerow(row)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def write_out(matrix, filename):\n with open(filename, 'w') as csvfile:\n writer = csv.writer(csvfile)\n for r in matrix:\n writer.writerow(r)\n print(filename + ' writen!')", "def WriteToCsv(matrix, csvFileName, csvDelimiter=','):\r\n \r\n if os.path.isfile(csvFileName) == T...
[ "0.69864655", "0.63416266", "0.61624026", "0.61446565", "0.5999539", "0.59739774", "0.59661436", "0.59453785", "0.5905278", "0.59002036", "0.58691335", "0.58681005", "0.5839974", "0.58317584", "0.5826506", "0.58209157", "0.58209157", "0.5786416", "0.5757284", "0.575689", "0.5...
0.74569845
0
Returns the name of the channel for the given radio and channel.
def channel_name(radio_id: int, channel_id: int) -> str: return f"COMM{radio_id} Ch {channel_id}"
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def channelName(self):\n channel_list = (\"Neutral\",\n \"BBC1\",\n \"BBC2\",\n \"ITV\",\n \"Channel 4\",\n \"Channel 5\")\n channel_name = channel_list[self.channel]\n return cha...
[ "0.72019213", "0.7178412", "0.7178412", "0.7178412", "0.7178412", "0.7178412", "0.7178412", "0.7178412", "0.7178412", "0.7178412", "0.7178412", "0.7178412", "0.7178412", "0.7178412", "0.7178412", "0.7178412", "0.7178412", "0.7178412", "0.7178412", "0.7178412", "0.70424455", ...
0.8595431
0
List of playable units in the flight.
def client_units(self) -> List[FlyingUnit]: return [u for u in self.units if u.is_human()]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_alive_units(self):\n alive_units = []\n for unit in self.units:\n if not unit.is_alive():\n continue\n alive_units.append(unit)\n return alive_units", "def get_units(self) -> List[str]:\n result = []\n for elements in self._get_resul...
[ "0.7038853", "0.69471025", "0.6792572", "0.674546", "0.65399146", "0.6447552", "0.6128354", "0.60884583", "0.60884583", "0.60749876", "0.6040792", "0.60030854", "0.59831977", "0.58550435", "0.5834707", "0.57983744", "0.5797732", "0.57909584", "0.5786042", "0.57521987", "0.572...
0.6965238
1
Returns the type of aircraft in this flight.
def aircraft_type(self) -> FlyingType: return self.units[0].unit_type
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getAircraft(self, code):\n \t\n return self.aircraftDict[code.upper()]", "def landing_airport(self, **kwargs: Any) -> \"Airport\":\n\n from ..core.distance import guess_airport\n\n # The following cast secures the typing\n self = cast(\"Flight\", self)\n\n data = self.da...
[ "0.6327988", "0.6149255", "0.6035162", "0.59869665", "0.5729768", "0.56378406", "0.55666333", "0.5497275", "0.5460754", "0.5430962", "0.53903615", "0.5380597", "0.53774005", "0.5364313", "0.535924", "0.53532493", "0.5348655", "0.5333701", "0.5304017", "0.5296175", "0.5294151"...
0.84770125
0
Returns the number of preset channels for the given radio.
def num_radio_channels(self, radio_id: int) -> int: # Note: pydcs only initializes the radio presets for client slots. return self.client_units[0].num_radio_channels(radio_id)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_num_channels():\r\n check_mixer()\r\n return sdl.Mix_GroupCount(-1)", "def num_channels(chip):\n return int(utils.readstr_all(os.path.join(_CHIP_PATH(chip), \"npwm\")))", "def num_channels(self):\n with audioread.audio_open(self.path) as f:\n return f.channels", "def n_...
[ "0.70029294", "0.6583076", "0.6431523", "0.6311275", "0.61871827", "0.61813056", "0.6068922", "0.6058218", "0.6054343", "0.6016357", "0.5975814", "0.5950489", "0.5895036", "0.5827683", "0.5824527", "0.57661426", "0.5753626", "0.5744624", "0.5721213", "0.5715618", "0.568809", ...
0.7514637
0
Returns the radio and channel number for the given frequency.
def channel_for( self, frequency: RadioFrequency) -> Optional[ChannelAssignment]: return self.frequency_to_channel_map.get(frequency, None)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_frequency(self):\r\n _debug('simq03b_api.get_frequency')\r\n \r\n x = self.query('SOUR:FREQ:CW?')\r\n if x == None: return None\r\n return float(x)", "def get_frequency(self, c, channel=-1):\n if (channel == -1):\n channel = self.guess_channel()\n\n ...
[ "0.6490108", "0.6414235", "0.6379573", "0.6330263", "0.6316427", "0.6316427", "0.62827206", "0.61941063", "0.6178761", "0.61771286", "0.61676437", "0.6102844", "0.60944504", "0.5997203", "0.59923995", "0.5978198", "0.5965196", "0.5921212", "0.59142876", "0.58896494", "0.58850...
0.6561942
0
Assigns a preset radio channel to the given frequency.
def assign_channel(self, radio_id: int, channel_id: int, frequency: RadioFrequency) -> None: for unit in self.client_units: unit.set_radio_channel_preset(radio_id, channel_id, frequency.mhz) # One frequency could be bound to multiple channels. Prefer the first, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_frequency(self, frequency):\n\n if frequency == 1:\n self.__rtcconfig = self.__helper.updatebyte(self.__rtcconfig, 0, 0)\n self.__rtcconfig = self.__helper.updatebyte(self.__rtcconfig, 1, 0)\n if frequency == 2:\n self.__rtcconfig = self.__helper.updatebyte(se...
[ "0.6795375", "0.6594799", "0.65484196", "0.6417588", "0.63847566", "0.6349733", "0.6272557", "0.62402856", "0.62306625", "0.6048603", "0.6048603", "0.60219395", "0.60067165", "0.6002149", "0.59168196", "0.59141624", "0.5895643", "0.58917177", "0.58648485", "0.5853643", "0.584...
0.67176265
1