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
Gets the state of the virtual dpad.
def handle_dpad(self): # pylint: disable=no-member x_raw = self.microbit.accelerometer.get_x() y_raw = self.microbit.accelerometer.get_y() minus_sens = self.sensitivity * -1 if x_raw < minus_sens: x_state = ('Absolute', 0x10, -1) elif x_raw > self.sensitivity:...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_state(self):\n\t\treturn call_sdk_function('PrlVmInfo_GetState', self.handle)", "def get_device_state(self):\n\t\treturn call_sdk_function('PrlSrvCfgDev_GetDeviceState', self.handle)", "def state(self):\n return self.coordinator.data[PVS_DEVICE_TYPE][self.base_unique_id][PVS_STATE]", "def stat...
[ "0.71247375", "0.70348924", "0.68135566", "0.6670066", "0.6650468", "0.66319525", "0.65097106", "0.6352869", "0.6319689", "0.63063043", "0.6206376", "0.620202", "0.61804473", "0.61751384", "0.6173688", "0.6146593", "0.6144406", "0.61177325", "0.6111116", "0.6110203", "0.61092...
0.0
-1
Create decoder network, top half of plumnet.
def decoder(encoder_activations, ngf, generator_output_channels, drop_prob=0.5, instancenorm=False): # decoder_5: [batch, 8, 8, ngf * 8 * 2] => [batch, 14, 14, ngf * 8 * 2] # decoder_4: [batch, 16, 16, ngf * 8 * 2] => [batch, 28, 28, ngf * 4 * 2] # decoder_3: [batch, 32, 32, ngf * 4 * 2] => [batch, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _define_decoder(self):\n self.decoder = nn.Sequential(nn.Linear(self.encoding_shape, 256), # B, 256\n View((-1, 256, 1, 1)), # B, 256, 1, 1\n nn.SELU(),\n nn.ConvTranspose2d(256, 64, 4), # B, 64, 4, 4\n ...
[ "0.73102534", "0.7261535", "0.6880061", "0.6485732", "0.6403696", "0.6255239", "0.6252306", "0.6240848", "0.62361217", "0.6171521", "0.6152959", "0.61515594", "0.60870564", "0.6065257", "0.59899706", "0.5960869", "0.5944484", "0.5937782", "0.58944184", "0.58939373", "0.589001...
0.56021464
55
Create torch dataloader from torch dataset.
def create_loader(dataset: Dataset, cfg: trainer_configs.BaseDatasetConfig, batch_size: int, *, collate_fn: Optional[Callable[[List[Any]], Any]] = None) -> DataLoader: # return DataLoader( # dataset, batch_size=batch_size, num_workers=cfg.num_workers, # drop_last=cfg.drop_last,...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def from_torch(\n dataset: \"torch.utils.data.Dataset\",\n) -> Dataset:\n return from_items(list(dataset))", "def train_dataloader(self) -> torch.utils.data.DataLoader: \n return torch.utils.data.DataLoader(self.dataset_train, **self.dl_kwargs)", "def create_dataloader(data):\r\n input_...
[ "0.82925516", "0.79915386", "0.7926132", "0.77298605", "0.72732043", "0.71640277", "0.707363", "0.69367343", "0.6928608", "0.68931335", "0.68251014", "0.68235946", "0.68205565", "0.6817058", "0.67434347", "0.6728299", "0.6725044", "0.67246693", "0.6678549", "0.6659566", "0.66...
0.6454544
32
Load a dictionary from a JSON file
def loadJSONFromPath(self, path): self.root = TreeNode(' '); content = codecs.open(path, 'r', 'utf-8').read() data = json.loads(content) self.root = TreeNode() self.root.loadJSON(data)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def load_json(file_path):\n\n \n with open(file_path, 'r') as json_file:\n # print(file_path)\n dictionary = json.loads(json_file.read())\n\n return dictionary", "def load_dict_from_json(filename):\n with open(filename, 'r') as f:\n loaded_dict = json.load(f)\n\n return loaded...
[ "0.81796145", "0.81756043", "0.81103545", "0.810198", "0.8025683", "0.80000037", "0.79209805", "0.7854995", "0.7847101", "0.7837682", "0.7832891", "0.7826102", "0.77649", "0.7735069", "0.76747024", "0.76601076", "0.7656784", "0.7642736", "0.76336455", "0.7619829", "0.7614993"...
0.0
-1
Loads parquet file into pandas dataframe
def load(file): return pq.read_table(file).to_pandas()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def parquet(path, *args, **kwargs):\n\n try:\n df = Spark.instance.spark.read.parquet(path, *args, **kwargs)\n except IOError as error:\n logging.error(error)\n raise\n\n return df", "def _pq2df(data_file):\n df = pd.read_parquet(data_file)\n re...
[ "0.77056766", "0.7632231", "0.71489424", "0.71328956", "0.6953971", "0.6713707", "0.6627586", "0.64559054", "0.6446183", "0.6426315", "0.6402503", "0.6397691", "0.6387135", "0.6380892", "0.63558275", "0.6339602", "0.6321456", "0.63107336", "0.6305603", "0.62834364", "0.628343...
0.7059969
4
Change a record list (usually from a REST API endpoint) to a column based dictionary (pandas dataframe).
def rec2col(rec, join=None, include=None, exclude=None, uuid_fields=None, types=None): if isinstance(rec, dict): rec = [rec] if len(rec) == 0: return Bunch() if include is None: include = rec[0].keys() if isinstance(rec, list) else rec.keys() if exclude is None: exclude =...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def to_dict_records(df):\r\n return df.to_dict('records')", "def extract_dataframe(self, resp_data):\n\n if not resp_data:\n return None\n\n # check if records needs to be converted into dicts\n if self.val_cols and self.key_col:\n ret = []\n for rec in re...
[ "0.6870809", "0.6831673", "0.66732347", "0.656266", "0.6525406", "0.6458262", "0.6368948", "0.6308678", "0.62108874", "0.61974293", "0.6151365", "0.610822", "0.6102326", "0.6092888", "0.60755765", "0.60064256", "0.59337145", "0.5913062", "0.5911421", "0.59049517", "0.58998716...
0.0
-1
Get all the contents of the file.
def read_all(self): if (not self.exists()): raise IOError("File at '{}' does not exist.".format(self.location)) with open(self.location, 'r') as f: return f.read()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def contents(file):\n with open(file) as f:\n return f.read()", "def get_file_contents(file_name):\n\n\tf = open(file_name)\n\tlines = f.readlines()\n\tf.close()\n\treturn lines", "def ReadFileContents(file_name): \n all_file_contents = open(file_name, 'r').readlines()\n return all_file_content...
[ "0.74506706", "0.7343296", "0.72649115", "0.72400385", "0.7186092", "0.7109437", "0.708824", "0.70775163", "0.70344055", "0.67526877", "0.67281365", "0.6709581", "0.66471994", "0.6645586", "0.6641932", "0.65975296", "0.6591232", "0.6589594", "0.6588563", "0.6569945", "0.65552...
0.74894214
0
Gets the dict built with self.feed(). Dict keys are tag kinds, values are lists of ctags_entry instances sporting that kind.
def get_data(self): return self.kinds
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def tags_dict(self):\n return ({'name': 'tag', 'attrs': {'k': k, 'v': v}} for k, v in self.tags.items())", "def get_tag_dict(self):\n return self.tag_dict", "def tag_dict(self):\n tag_dict = dict()\n for document in self.documents:\n for tag in document.tags:\n ...
[ "0.64971703", "0.6338285", "0.6278399", "0.61737776", "0.617257", "0.61501855", "0.60420644", "0.60289854", "0.6026101", "0.5831772", "0.5826877", "0.57666814", "0.57443905", "0.56703824", "0.5646946", "0.56228006", "0.5618187", "0.5601501", "0.55903405", "0.55847204", "0.556...
0.5371556
34
Create a ``Conv2d`` layer.
def __init__( self, n_filter, filter_size=3, strides=1, act=None, padding='SAME', data_format='channels_first', dilation_rate=1, W_init='glorot_uniform', b_init=None, in_channels=None, name=None, ): super().__ini...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_conv2d(x, W):\n return tf.nn.conv2d(x, W, strides=[1, 1, 1, 1], padding='SAME')", "def _conv2d_layer(self, inputs, filters_num, kernel_size, name, use_bias=False, strides=1):\n if strides > 1: # modified 0327\n inputs = tf.pad(inputs, paddings=[[0, 0], [1, 0], [1, 0], [0, 0]], mo...
[ "0.74791586", "0.7381662", "0.73599523", "0.73505414", "0.7339476", "0.7292833", "0.72889566", "0.7175426", "0.71629256", "0.71383077", "0.71236175", "0.71145546", "0.7113917", "0.70776135", "0.7033525", "0.70172703", "0.701693", "0.70053244", "0.6993083", "0.6975555", "0.697...
0.0
-1
Returns the number of days in the given month and year. Assumes that month 1 is January, month 2 is February, and so on.
def days_in_month(month, year): # Days in February depends on whether it's a leap year if month == 2: if is_leap_year(year): return 29 else: return 28 # April, June, September, November have 30 days elif month == 4 or month == 6 or month == 9 or month == 11: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def days_in_month(year, month):\n num_days = monthrange(year, month)[1]\n return num_days", "def numDays(month, year):\n\tif month in [9, 4, 6, 11]:\n\t\treturn 30\n\telif month == 2 and year % 4 == 0 and (year % 100 != 0 or year % 400 == 0):\n\t\treturn 29\n\telif month == 2:\n\t\treturn 28\n\telse:\n\t\t...
[ "0.8614313", "0.8398347", "0.8209615", "0.82022953", "0.8030093", "0.800625", "0.7987013", "0.7985357", "0.7968734", "0.79539454", "0.79398525", "0.7912807", "0.7912807", "0.7912807", "0.7911418", "0.7847122", "0.78415906", "0.7626141", "0.7566821", "0.75537306", "0.74636114"...
0.80534256
4
Formats a one or two digit integer to fit in four spaces. Returns a string of the formatted number string.
def format_number(num): result = " " + str(num) + " " if num < 10: result = result + " " return result
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def pad(number, width=0):\n return str(number).zfill(width)", "def _format_number(value, size):\n\n return '{:0>{}}'.format(value, size)", "def format(number):\n number = compact(number)\n return ' '.join((number[:2], number[2:5], number[5:8], number[8:]))", "def format_number(number):\n r...
[ "0.7063938", "0.68645406", "0.67753583", "0.67275816", "0.67236304", "0.6648164", "0.6632206", "0.65615296", "0.6498508", "0.64488953", "0.6448557", "0.6431686", "0.64126563", "0.64041156", "0.638862", "0.6388164", "0.6361103", "0.63593596", "0.629307", "0.627362", "0.6273511...
0.6639525
6
Build a heap from the given list of items
def build_heap(self, items): for key in items: self.insert(key)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def buildHeap(self, alist):\n i = len(alist) // 2\n self.currentSize = len(alist)\n self.heapList = [0] + alist[:]\n while (i>0):\n self.percDown(i)\n i = i - 1", "def heap_sort(items):\n heapq.heapify(items)\n items[:] = [heapq.heappop(items) for i...
[ "0.7312595", "0.72688735", "0.72688735", "0.7239988", "0.71944106", "0.71628654", "0.7153743", "0.7129963", "0.71176445", "0.7108007", "0.70677465", "0.69977707", "0.695483", "0.68939006", "0.68727845", "0.68079054", "0.68079054", "0.6770989", "0.6770568", "0.6770503", "0.675...
0.794129
0
Insert a new element in the heap
def insert(self, key): badIndex = self._append(key) # heap invariant might be violated at the new index while badIndex > 0 and not self.invariant(self.queue[self._parent(badIndex)], self.queue[badIndex]): self._swap(badIndex, self._parent(badIndex)) badIndex = self._pare...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def insert(self, element):\n if self.size >= self.maxsize:\n return\n self.size += 1\n self.heap[self.size] = element\n\n current = self.size\n\n while self.heap[current] < self.heap[self.parent(current)]:\n self.swap(current, sel...
[ "0.8297305", "0.82871103", "0.8199893", "0.81939006", "0.8155535", "0.79592925", "0.78542435", "0.7835472", "0.7772689", "0.7750564", "0.7728166", "0.77275497", "0.77172077", "0.77158546", "0.7702932", "0.7698201", "0.76740354", "0.76547915", "0.76503694", "0.7601831", "0.755...
0.71757615
43
Gets the locale indicating the localization preferences in effect for this session.
def get_locale(self): raise Unimplemented()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_locale(self):\n return self.locale", "def locale(self):\n return self.__locale", "def get_locale():\n setting = Setting.query.filter(Setting.name == 'default_language').first()\n\n if setting is not None:\n return setting.value\n\n # Return default language when none found...
[ "0.7804468", "0.7696088", "0.74375224", "0.7410962", "0.7078228", "0.70252097", "0.6997546", "0.6985966", "0.6979193", "0.6946607", "0.6714051", "0.6628206", "0.66240716", "0.6612936", "0.6522948", "0.65122175", "0.6497172", "0.6491735", "0.6491735", "0.64521194", "0.6435846"...
0.7092342
4
Gets the Id of the agent authenticated to this session. This is the agent for which credentials are used either acquired natively or via an OsidProxyManager.
def get_authenticated_agent_id(self): raise IllegalState()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def agent_id(self):\n return self._agent_id", "def getAgentID(self):\n\t\treturn self.agentID", "def agent_id(self) -> pulumi.Output[int]:\n return pulumi.get(self, \"agent_id\")", "def agent_id(self) -> pulumi.Input[int]:\n return pulumi.get(self, \"agent_id\")", "def agent_id(self) -...
[ "0.7752986", "0.7454657", "0.7396336", "0.7388006", "0.71379083", "0.6750845", "0.629788", "0.6269507", "0.6031791", "0.5958287", "0.5906277", "0.5901723", "0.5881248", "0.5858327", "0.5829377", "0.5829377", "0.5817326", "0.57355756", "0.5733917", "0.57338774", "0.57230216", ...
0.7519342
1
Gets the agent authenticated to this session. This is the agent for which credentials are used either acquired natively or via an OsidProxyManager.
def get_authenticated_agent(self): raise IllegalState()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def agent_session(self):\n return self._agent_session", "def agent(self) -> Entity:\n return self.__agent", "def agent(self):\n return self.__agent", "def get_authenticated_agent_id(self):\n raise IllegalState()", "def authentication(self):\n return self._authentication", "...
[ "0.736334", "0.63454455", "0.6252796", "0.62275326", "0.6124814", "0.6124814", "0.6124814", "0.60690343", "0.6015234", "0.6014764", "0.5955841", "0.59468573", "0.5800989", "0.57626945", "0.5744613", "0.5735423", "0.569829", "0.56845397", "0.56369615", "0.56341386", "0.5593551...
0.682912
1
Gets the Id of the effective agent in use by this session. If is_authenticated() is true, then the effective agent may be the same as the agent returned by get_authenticated_agent(). If is_authenticated() is false, then the effective agent may be a default agent used for authorization by an unknwon or anonymous user.
def get_effective_agent_id(self): raise Unimplemented()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_authenticated_agent_id(self):\n raise IllegalState()", "def agent_id(self):\n return self._agent_id", "def agent_id(self) -> pulumi.Output[int]:\n return pulumi.get(self, \"agent_id\")", "def getAgentID(self):\n\t\treturn self.agentID", "def agent_id(self) -> Optional[pulumi.In...
[ "0.7221963", "0.6807555", "0.67212653", "0.6650785", "0.66123754", "0.6557168", "0.6005485", "0.57500994", "0.57089233", "0.5552459", "0.54570925", "0.53353304", "0.5301107", "0.51133347", "0.50961167", "0.50832886", "0.5036813", "0.50328726", "0.5031787", "0.50028765", "0.49...
0.6844594
1
Gets the effective agent in use by this session. If is_authenticated() is true, then the effective agent may be the same as the agent returned by get_authenticated_agent(). If is_authenticated() is false, then the effective agent may be a default agent used for authorization by an unknwon or anonymous user.
def get_effective_agent(self): raise Unimplemented()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_authenticated_agent(self):\n raise IllegalState()", "def agent(self) -> Entity:\n return self.__agent", "def agent_session(self):\n return self._agent_session", "def agent(self):\n return self.__agent", "def _get_solver_agent(self):\n # Determine selectable agent(s)\n...
[ "0.6512123", "0.62206006", "0.6087181", "0.5974568", "0.57936454", "0.56758356", "0.55208504", "0.5484185", "0.5480098", "0.546138", "0.5431785", "0.53284425", "0.53271234", "0.5309125", "0.5288015", "0.52845126", "0.518744", "0.5185111", "0.5154808", "0.51448727", "0.5144332...
0.67028946
0
Gets the service date which may be the current date or the effective date in which this session exists.
def get_date(self): raise Unimplemented()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_date(self):\n return self.date", "def get_date(self):\n return self.date", "def get_date(self):\n return self.date", "def get_date(self):\n return self.date", "def get_date(self):\n return self.individual_session.session_date.strftime('%A')", "def founding_date(...
[ "0.64192826", "0.64192826", "0.64192826", "0.64192826", "0.6415561", "0.6355586", "0.6329772", "0.6117439", "0.6095147", "0.6077139", "0.6024811", "0.6024811", "0.6024811", "0.6016165", "0.60125643", "0.5981125", "0.5964845", "0.5911391", "0.5900735", "0.58788466", "0.5875984...
0.6090735
9
Gets the rate of the service clock.
def get_clock_rate(self): raise Unimplemented()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_clock_rate(self):\n return self.o.read_register(self.dev_id, CLOCK_RATE)", "def getRate(self, context):\n try:\n return VTypeHelper.toDouble(context.getDevice(\"rate\").read())\n except:\n return 60.0", "def get_clock_rate(self, mboard=0):\n return _uhd_swi...
[ "0.7856558", "0.7375736", "0.7199443", "0.7163289", "0.71292406", "0.7126433", "0.7089856", "0.7007626", "0.6974138", "0.69579595", "0.6814983", "0.6784404", "0.67698187", "0.67666143", "0.6732454", "0.66903704", "0.6634214", "0.660371", "0.6590845", "0.6501421", "0.6490368",...
0.79283404
0
Gets the ``DisplayText`` format ``Type`` preference in effect for this session.
def get_format_type(self): raise Unimplemented()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def type(self):\n return self.settings[\"type\"]", "def get_review_type(self):\n return self.currentText()", "def type_display_name(self):\n return self.properties.get('TypeDisplayName', None)", "def type(self):\n return self.config['type']", "def type(self) -> str:\n ret...
[ "0.6462867", "0.63397276", "0.62644506", "0.6220455", "0.61302227", "0.6056963", "0.6056963", "0.6056963", "0.6056963", "0.6056963", "0.6056963", "0.6056963", "0.6009008", "0.5981776", "0.59749043", "0.5966238", "0.5964747", "0.5964747", "0.5964747", "0.5964747", "0.5964747",...
0.5703646
96
Set cursor to initial position and reset any shifting.
def home(self): self.command(self.LCD_RETURNHOME) self._cursor_pos = (0, 0) self._msleep(2)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def setDefaultCursorPosition(self):\n self.srcEditor.setFocus()\n self.srcEditor.setCursorPosition(0,0)", "def reset_position(self):\n self.goto(STARTING_POSITION)", "def change_cursor(self, cursor):\n self.setCursor(cursor)", "def moveCursor(self):\n\n\t\tself._before = self.rect...
[ "0.7301333", "0.7156913", "0.6832239", "0.6753845", "0.6735567", "0.65881354", "0.65488964", "0.6537869", "0.6512461", "0.64741045", "0.6416567", "0.6410083", "0.6351167", "0.63482004", "0.63481396", "0.63375026", "0.63242936", "0.6317947", "0.62985647", "0.6290773", "0.62732...
0.0
-1
Create a given number of lists, each of random length, with members of random values.
def create_unique_lists(amount): _len_list = create_wild_lists(1, amount) box = [] i = 0 while i < amount: h = create_wild_lists(1, _len_list[i]) box.append(h) i += 1 return box
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def generate_list(size):\n items = [randint(0, MAX_NUM) for i in range(size)]\n return items", "def generate_list(length: int) -> list:\n\n return [randint(0, length + 1) for _ in range(length)]", "def create_wild_lists(amount,length):\r\n box = []\r\n\r\n k = 0\r\n while k < amount:\r\n ...
[ "0.7305028", "0.722813", "0.7150562", "0.7081302", "0.7042063", "0.69296753", "0.68264735", "0.68200797", "0.68099", "0.6770277", "0.6686843", "0.65391016", "0.65385437", "0.6511196", "0.6507703", "0.6505181", "0.64895916", "0.6468738", "0.64414966", "0.63877475", "0.63853675...
0.6645208
11
Creates an instance of this model from a dictionary
def from_dictionary(cls, dictionary): if dictionary is None: return None # Extract variables from the dictionary enabled = dictionary.get('enabled') last_updated_timestamp_secs = dictionary.get('lastUpdatedTimestampSecs') pinned_time_secs = di...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def from_dictionary(cls,\n dictionary):\n if dictionary is None:\n return None\n\n # Extract variables from the dictionary\n id = dictionary.get('id')\n name = dictionary.get('name')\n mtype = dictionary.get('type')\n usage_bytes = diction...
[ "0.83181584", "0.8168118", "0.8168118", "0.8118749", "0.8089047", "0.79787344", "0.7949278", "0.79231393", "0.7898951", "0.78923255", "0.788838", "0.7882321", "0.7882212", "0.7876749", "0.78585315", "0.7836853", "0.7801407", "0.7801407", "0.7801407", "0.7801407", "0.7801407",...
0.0
-1
Adds a shadow below the heraldry.
def transform(self, heraldry: Image.Image) -> Image.Image: heraldry = heraldry.convert('RGBA') orig_width, orig_height = heraldry.size new_height = int(self.height_change * orig_height) ell_img = Image.new('RGBA', (orig_width, new_height)) draw = ImageDraw.Draw(ell_img) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def main_shadow(self, w):\n bg = urwid.AttrWrap(urwid.SolidFill(u\"\\u2592\"), 'screen edge')\n shadow = urwid.AttrWrap(urwid.SolidFill(u\" \"), 'main shadow')\n\n bg = urwid.Overlay( shadow, bg,\n ('fixed left', 3), ('fixed right', 1),\n ('fixed top', 2), ('fixed bottom'...
[ "0.6632981", "0.6130922", "0.61181265", "0.5903479", "0.586537", "0.5839174", "0.5710017", "0.5542071", "0.5522388", "0.5430713", "0.5354235", "0.51987267", "0.51782453", "0.5175695", "0.5171645", "0.51545113", "0.5105237", "0.5093309", "0.50763696", "0.50645024", "0.5048948"...
0.0
-1
Split a posix path in a sequence of segments, ignoring leading and trailing slash. Return an empty sequence for an empty path and the root /.
def split(p): if not p: return [] p = p.strip('/').split('/') return [] if p == [''] else p
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def splitpath(path):\n\n # FIXME perhaps call op.split repetitively would be better.\n #s = string.split( path, '/' ) # we work with fwd slash only inside.\n\n#We have decided to use all kind of separator\n s = []\n while True:\n first, second = op.split(path)\n s.append(second)\n ...
[ "0.76887757", "0.7443808", "0.7363398", "0.72058743", "0.71917707", "0.71667725", "0.7108067", "0.70994675", "0.7040426", "0.7009445", "0.6993161", "0.69681865", "0.69562775", "0.69082594", "0.68829495", "0.6822004", "0.6809191", "0.67252743", "0.6716055", "0.6680443", "0.665...
0.65662193
29
Open and reformat an existing YAML file.
def re_dump(file_path: Union[Path, str]): file_: Path = Path(file_path) xyz = YAML(typ="safe", pure=True).load(file_.open().read()) with YAML(output=sys.stdout) as yaml: yaml.indent(mapping=2, sequence=4, offset=2) yaml.width = PAGE_WIDTH yaml.dump(xyz)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update_file(filename,d):\n if os.path.exists(filename):\n f_old = open(filename,'r')\n d_old = yaml.load(f_old)\n f_old.close()\n d_old.update(d)\n d = d_old\n f = open(filename, 'w')\n yaml.dump(d, f)\n f.close()", "def _open_yaml(stream, original_file=None, su...
[ "0.6552176", "0.6470362", "0.6302873", "0.62923497", "0.6249124", "0.6230844", "0.60740304", "0.60624915", "0.6007683", "0.5957554", "0.5952549", "0.5932447", "0.5922839", "0.5921699", "0.59083235", "0.59078455", "0.58742374", "0.58724976", "0.58721125", "0.58653986", "0.5844...
0.58613974
20
Generates a 2D color map over the full range of evaluated a_scale and c_scale values.
def plot_2d(self): fig = plt.figure(figsize=(10,8)) d = int(len(self.a_scale.flat)**0.5) a_scale = self.a_scale.reshape(d,d) c_scale = self.c_scale.reshape(d,d) E_coh = self.E_coh.reshape(d,d) plt.pcolormesh(a_scale, c_scale, E_coh) plt.xlabel('xy linear ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def generate_spi3d_from_colormap(colormap,\n cube_size=65,\n input_exp_range=(-12.473931189, 4.026068812),\n unclipped_exp_range=(-12.473931189, 4.026068812),\n centered=F...
[ "0.6406457", "0.6359", "0.62324107", "0.61863637", "0.61705345", "0.61130804", "0.60638773", "0.60593414", "0.6027312", "0.5983839", "0.5935139", "0.59160525", "0.57776666", "0.57385814", "0.5669307", "0.56633115", "0.5656815", "0.5628896", "0.5592407", "0.55864024", "0.55631...
0.55705374
20
String concatenation for 3 return 123
def f(n): nstr = '' for i in range(1, n + 1): nstr = nstr + str(i) return nstr
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def format_string_3(*tmp_tuple):\n\n total_items = len(tmp_tuple)\n formated_string = \"the {} numbers are: \"\n formated_string += \", \".join([\"{}\"] * total_items)\n result = formated_string.format(total_items, *tmp_tuple)\n\n print(result)\n return result", "def get_string(self, n):\n ...
[ "0.6349492", "0.62483776", "0.61320233", "0.6128319", "0.60556376", "0.603567", "0.5985412", "0.5970065", "0.59481984", "0.59479177", "0.59298694", "0.59252703", "0.5871543", "0.5871543", "0.5871543", "0.5871543", "0.58193415", "0.58039516", "0.5738851", "0.5738561", "0.57166...
0.61277544
4
Tests that setdefault() enforces type.
def testMapSetdefault(self): # We only use one map type since they all share the same implementation for # this logic. m = data_types.StepBuildStatsMap() with self.assertRaises(AssertionError): m.setdefault(1, data_types.BuildStats()) with self.assertRaises(AssertionError): m.setdefault(...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def testDefaultFields_Single(self):\n defaults = {\n messages.IntegerField: 10,\n messages.FloatField: 1.5,\n messages.BooleanField: False,\n messages.BytesField: b'abc',\n messages.StringField: u'abc',\n }\n\n def action(field_class):\n ...
[ "0.6519311", "0.6443023", "0.6395917", "0.6329813", "0.62367374", "0.62212765", "0.6211269", "0.6186846", "0.61577314", "0.61095285", "0.61051214", "0.6088404", "0.60230947", "0.6018941", "0.5994274", "0.5966088", "0.5951535", "0.5931466", "0.5914981", "0.59051716", "0.588685...
0.5766903
36
Gets the exception_message of this AnalyticsErrorData. Exception message
def exception_message(self): # type: () -> string_types return self._exception_message
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def exception_message(self) -> str:\n return pulumi.get(self, \"exception_message\")", "def get_error_message(self):\n try:\n return api.Api.get_error_message(self._session)\n except exceptions.UnknownException:\n return \"<error message irrecoverable>\"", "def get_er...
[ "0.8478082", "0.75352764", "0.7527172", "0.7469979", "0.74381447", "0.742549", "0.74037856", "0.74037856", "0.74037856", "0.7386042", "0.7323066", "0.7183981", "0.7155367", "0.69997376", "0.696728", "0.6961492", "0.6957033", "0.6957033", "0.6957033", "0.6957033", "0.6957033",...
0.8177682
1
Gets the additional_data of this AnalyticsErrorData. Additional error data
def additional_data(self): # type: () -> string_types return self._additional_data
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def additional_data(self):\n return self._additional_data", "def additional_data(self) -> pulumi.Output[Optional[Mapping[str, str]]]:\n return pulumi.get(self, \"additional_data\")", "def additional_data(self) -> pulumi.Output[Optional[Mapping[str, str]]]:\n return pulumi.get(self, \"addit...
[ "0.7174893", "0.658628", "0.658628", "0.6396251", "0.63079906", "0.6300258", "0.6218096", "0.6102035", "0.59971637", "0.5893539", "0.5884692", "0.5828716", "0.5824379", "0.57225764", "0.57067126", "0.5690784", "0.5609336", "0.5546386", "0.5519739", "0.5519739", "0.5519739", ...
0.6756437
1
Returns true if both objects are equal
def __eq__(self, other): if not isinstance(other, AnalyticsErrorData): return False return self.__dict__ == other.__dict__
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __eq__(self, other):\n return are_equal(self, other)", "def __eq__(self, other):\n return are_equal(self, other)", "def __eq__(self,other):\n try: return self.object==other.object and isinstance(self,type(other))\n except: return False", "def __eq__(self, other):\n if i...
[ "0.8088132", "0.8088132", "0.8054589", "0.7982687", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", ...
0.0
-1
Returns true if both objects are not equal
def __ne__(self, other): return not self == other
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __ne__(self, other: object) -> bool:\n if self.__eq__(other):\n return False\n return True", "def __ne__(self, other: object) -> bool:\n return not self.__eq__(other)", "def __ne__(self, other) -> bool:\n return not self.__eq__(other)", "def __eq__(self, other):\n ...
[ "0.845611", "0.8391477", "0.8144138", "0.81410587", "0.8132492", "0.8093973", "0.80920255", "0.80920255", "0.80920255", "0.8085325", "0.8085325", "0.8076365", "0.8076365", "0.8065748" ]
0.0
-1
Return the actual start and end indices for the scenario.
def _get_scenario_range(self, file_data_object): start = 0 end = self.file_data_object.ColumnCount() - 1 count = end - (start - 1) return start, end, count
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def mainIndices(self):\n return self.i1, self.i2", "def span(self):\r\n return self._start, self._end", "def getind(self,start,end,blk):\n\n if blk is None:\n # Return all blocks\n blk = np.arange(self.ind[start].size)\n\n ind=np.array([])\n for k,val in...
[ "0.6463832", "0.64213645", "0.64151794", "0.6393901", "0.62953895", "0.623555", "0.62239236", "0.62206364", "0.62168235", "0.618782", "0.61765003", "0.61485356", "0.61407834", "0.61121595", "0.6079777", "0.60702366", "0.606686", "0.60546255", "0.6034313", "0.6031219", "0.6020...
0.7130046
0
This functions calculate the symmetric mean absolute percentage error
def smape(true, predictions): true = np.array(true) predictions = np.array(predictions) return np.mean(np.abs(true - predictions) * 2/ (np.abs(true) + np.abs(predictions))) * 100
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _symmetric_mean_absolute_percentage_error_compute(sum_abs_per_error: Tensor, num_obs: int) ->Tensor:\n return sum_abs_per_error / num_obs", "def _mean_absolute_percentage_error_compute(sum_abs_per_error: Tensor, num_obs: int) ->Tensor:\n return sum_abs_per_error / num_obs", "def _symmetric_mean_absol...
[ "0.8291781", "0.7593155", "0.71223307", "0.70615196", "0.70566183", "0.6988929", "0.695041", "0.6942653", "0.6914424", "0.6914424", "0.67752194", "0.6751963", "0.6707073", "0.6665173", "0.6631768", "0.6574137", "0.65406275", "0.64946234", "0.6454658", "0.64500624", "0.6442887...
0.6008068
59
Initialize a leastbias MLE container.
def __init__(self, mubs, eigenvectors): self.mubs = mubs self.p = mubs.p self.n = mubs.n self.dim = mubs.dim # Construct the projector versions of the MUB vectors. self.projectors = self.generate_projectors(eigenvectors)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def init_bn(bn):\n bn.bias.data.fill_(0.)\n bn.weight.data.fill_(1.)", "def init_bn(bn):\n bn.bias.data.fill_(0.)\n bn.weight.data.fill_(1.)", "def init_bn(bn):\n bn.bias.data.fill_(0.)\n bn.weight.data.fill_(1.)", "def init_bn(bn):\n bn.bias.data.fill_(0.0)\n bn.weight.data.fill_(1.0...
[ "0.6902147", "0.6902147", "0.6902147", "0.6863267", "0.6810703", "0.6783141", "0.6746204", "0.6532718", "0.64296067", "0.63356227", "0.6315565", "0.6268932", "0.6081495", "0.6075826", "0.6075826", "0.6075826", "0.6052565", "0.5999604", "0.599758", "0.59904057", "0.59904057", ...
0.0
-1
Generate the summary of current model, including on which datasets it was trained and validated, and some performance indices. The summary will be output into a given file.
def output_summary(self, v, vhat, sk, logged_matrics, train_dataset_label, val_dataset_label, summary_folder_path): mse = np.sum((v-vhat)**2)/len(v) train_loss = logged_matrics["train_loss"] k = np.sum(p.numel() for p in self.parameters()) numOfSamples = len(sk) aic = 2*k + nu...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def model_summary():\n print(\"\\n\")\n print(\"=\" * 30 + \"Model Structure\" + \"=\" * 30)\n model_vars = tf.trainable_variables()\n slim.model_analyzer.analyze_vars(model_vars, print_info=True)\n print(\"=\" * 60 + \"\\n\")", "def add_summary(self):\n merged = tf.summary.merge_all()\n ...
[ "0.70949847", "0.7013575", "0.695076", "0.6895299", "0.6890566", "0.6825545", "0.6790239", "0.67900527", "0.6787803", "0.67534465", "0.67103666", "0.66237247", "0.6621788", "0.6586185", "0.65762806", "0.6570374", "0.65550524", "0.6529702", "0.64970154", "0.64957935", "0.64751...
0.70710313
1
This function calculates duration when given start and end times. An empty string is returned if either of the time formats does not match '_format' format else, the duration is returned
def calculate_duration(start_time, end_time): _format = "%Y-%m-%dT%H:%M:%S" try: _start = datetime.datetime.strptime(start_time[:19], _format) _end = datetime.datetime.strptime(end_time[:19], _format) except (TypeError, ValueError): return "" duration = (_end - _start).total_sec...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def compute_duration(duration_str, time_format='hour'):\n assert time_format in ['hour', 'minute'], \"Expected time_format should be either 'hour' or 'minute'\"\n duration = 0\n hour_arr = re.findall(r'\\d+h', duration_str)\n if len(hour_arr) > 0:\n if time_format == \"minute\":\n dur...
[ "0.70786375", "0.64201516", "0.62948984", "0.62119216", "0.61082214", "0.6072344", "0.6036459", "0.597245", "0.59367007", "0.5874113", "0.5848648", "0.58473426", "0.58371603", "0.5787057", "0.5753106", "0.5702904", "0.5699164", "0.5696649", "0.56864434", "0.56633043", "0.5596...
0.7125775
0
Get an existing Assessment resource's state with the given name, id, and optional extra properties used to qualify the lookup.
def get(resource_name: str, id: pulumi.Input[str], opts: Optional[pulumi.ResourceOptions] = None) -> 'Assessment': opts = pulumi.ResourceOptions.merge(opts, pulumi.ResourceOptions(id=id)) __props__ = dict() __props__["additional_data"] = None __props__["display_...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get(resource_name: str,\n id: pulumi.Input[str],\n opts: Optional[pulumi.ResourceOptions] = None) -> 'Assessment':\n opts = pulumi.ResourceOptions.merge(opts, pulumi.ResourceOptions(id=id))\n\n __props__ = AssessmentArgs.__new__(AssessmentArgs)\n\n __props__.__dict__[...
[ "0.6898669", "0.608855", "0.5846438", "0.5757699", "0.5648362", "0.55919707", "0.5582545", "0.55817664", "0.55264586", "0.55085826", "0.550386", "0.5496845", "0.54861027", "0.5467891", "0.54414856", "0.53757304", "0.53509825", "0.53232807", "0.5311685", "0.52735114", "0.52480...
0.6976486
0
List of Products. Returns a list of Products.
def get(self): return Product.query.all()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def list_products(self):\n return self._make_get_request(self._urls['products'])", "def list_products(self):\n url = self.base_url\n # TODO add filtering support when holvi api supports it\n obdata = self.connection.make_get(url)\n return ProductList(obdata, self)", "def list...
[ "0.87015533", "0.8497107", "0.7969578", "0.7821406", "0.77697885", "0.77051586", "0.7681446", "0.7656539", "0.754777", "0.74543273", "0.74203473", "0.74067324", "0.7367203", "0.73342514", "0.7328348", "0.7268896", "0.7201354", "0.71769154", "0.7154661", "0.71310234", "0.71209...
0.73290336
14
Get absolute path to resource, works for dev and for PyInstaller
def resource_path(relative_path) : try : # PyInstaller creates a temp folder and stores path in _MEIPASS base_path = sys._MEIPASS except : base_path = os.path.abspath(".") return os.path.join(base_path, relative_path)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_resource_path():\n return os.path.join(os.path.dirname(__file__), \"resources\") + os.path.sep", "def resourcePath(relative):\r\n try:\r\n # PyInstaller creates a temp folder and stores path in _MEIPASS\r\n base_path = sys._MEIPASS\r\n except Exception:\r\n base_path = os.pa...
[ "0.83695436", "0.8280479", "0.82485795", "0.8114118", "0.80985415", "0.80940944", "0.80797124", "0.80677074", "0.80673695", "0.8062465", "0.8062465", "0.8062465", "0.8062465", "0.8062465", "0.8062465", "0.8062465", "0.80569947", "0.80545217", "0.80448323", "0.80448323", "0.80...
0.8139178
3
Get absolute path to resource, works for dev and for PyInstaller
def resource_path(relative_path) : try : # PyInstaller creates a temp folder and stores path in _MEIPASS base_path = sys._MEIPASS except : base_path = os.path.abspath(".") return os.path.join(base_path, relative_path)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_resource_path():\n return os.path.join(os.path.dirname(__file__), \"resources\") + os.path.sep", "def resourcePath(relative):\r\n try:\r\n # PyInstaller creates a temp folder and stores path in _MEIPASS\r\n base_path = sys._MEIPASS\r\n except Exception:\r\n base_path = os.pa...
[ "0.83695436", "0.8280479", "0.82485795", "0.8139178", "0.8114118", "0.80985415", "0.80940944", "0.80797124", "0.80677074", "0.80673695", "0.8062465", "0.8062465", "0.8062465", "0.8062465", "0.8062465", "0.8062465", "0.8062465", "0.80569947", "0.80545217", "0.80448323", "0.804...
0.79434115
39
Sets the before_revision of this FileChange.
def before_revision(self, before_revision): self._before_revision = before_revision
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_valid_before(self, before=18446744073709551615):\n self.valid_before = before", "def inherit_predecessor(self, predecessor):\n predecessor = predecessor.current_revision\n self.previous_revision = predecessor\n self.deleted = predecessor.deleted\n self.locked = predeces...
[ "0.6202348", "0.5513073", "0.5319464", "0.5302615", "0.5298472", "0.52577066", "0.52544117", "0.5179237", "0.51743245", "0.5171376", "0.51636726", "0.5062394", "0.5034735", "0.4956128", "0.49531624", "0.49466315", "0.49409097", "0.49349663", "0.49184552", "0.49180207", "0.490...
0.87934744
0
Sets the change_type of this FileChange.
def change_type(self, change_type): self._change_type = change_type
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def change_type_comment(self, change_type_comment):\n\n self._change_type_comment = change_type_comment", "def set_filetype(self, filetype, bufnr=None):\n if bufnr:\n self._vim.command(str(bufnr) + 'bufdo set filetype=' + filetype)\n else:\n self._vim.command('set filet...
[ "0.6886162", "0.67108697", "0.66363424", "0.6518969", "0.64535236", "0.64535236", "0.6391326", "0.6333584", "0.62933916", "0.623873", "0.6228941", "0.6193701", "0.61822885", "0.6137471", "0.61371565", "0.6030581", "0.60119706", "0.5956398", "0.59044904", "0.5900229", "0.58877...
0.8040454
0
Sets the change_type_comment of this FileChange.
def change_type_comment(self, change_type_comment): self._change_type_comment = change_type_comment
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def change_type(self, change_type):\n\n self._change_type = change_type", "def set_comment(self, comment):\n\t\tself.comment_ = comment", "def set_comment(self, comment):\n self.comment_text = str(comment)", "def set_comment(self, obj, cursor):\n if isinstance(obj, typedesc.T):\n ...
[ "0.68443197", "0.63174605", "0.62499183", "0.6095674", "0.5972815", "0.59029317", "0.58620363", "0.58620363", "0.58620363", "0.58620363", "0.58620363", "0.58620363", "0.58620363", "0.58620363", "0.58620363", "0.58620363", "0.5816405", "0.58124036", "0.5710043", "0.5694816", "...
0.87136745
0
initialize dungeon 2D matrix at (0,0)
def __init__(self, nx, ny, ix=0, iy=0): self.__nx = nx self.__ny = ny self.__ix = ix self.__iy = iy self.__current_room = 0, 0 self.__maze = [[Room(x, y) for y in range(ny)] for x in range(nx)] self.__entrance_room = 0, 0 self.__exit_room = 0, 0 ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def initialize_board(self):\n self.board = np.zeros(shape=(BOARD_SIZE, BOARD_SIZE), dtype=np.int) # another way of defining board: [[for x in range(cm.BOARD_SIZE)] for x in range(cm.BOARD_SIZE)]\n center = int(BOARD_SIZE / 2)\n self.board[center-1][center-1] = self.board[center][center] = WH...
[ "0.6613497", "0.6560392", "0.6477615", "0.64108104", "0.6331541", "0.6319846", "0.62975204", "0.6283496", "0.62268895", "0.6204423", "0.61817783", "0.6147999", "0.6147266", "0.6121988", "0.60712343", "0.6066323", "0.6064501", "0.60114944", "0.5986255", "0.59663147", "0.5959",...
0.61818796
10
This function plots the locations received in locations. For each plane.
def plot_locations_np(self, c_img, locations, file_name_prefix=''): other_axes = [[1, 2], [2, 0], [1, 0]] shape_str = str(c_img.shape) create_folder(self._output_folder) for id_loc, c_loc in enumerate(locations): plt.subplots(1, 3, squeeze=True, figsize=(8 * 3, 8)) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _plot_map(self):\n\n # Plot points if they exist\n\n if len(self._laserX) > 0:\n self._plot_laser()\n\n if len(self._goalX) > 0:\n self._plot_goal()\n\n if len(self._summitX) > 0:\n self._plot_summit()\n\n self._plot_objects()\n\n # Upd...
[ "0.645177", "0.63118374", "0.6290234", "0.6243402", "0.61864", "0.6154986", "0.61119133", "0.60129184", "0.5971644", "0.5963406", "0.5945746", "0.59347254", "0.59287536", "0.5895862", "0.5885713", "0.58662426", "0.58484536", "0.58277434", "0.58275765", "0.58133143", "0.57569"...
0.67796236
0
Get lattice trajectory for this species
def getLatticeTrajectory(self, **kwargs): return self._sim.getLatticeTrajectory(species=self, **kwargs)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getLatticeTrajectory(self, regex=None, species=None, integrated=\"\", replicate=None, \n frameStart=None, frameEnd=None, timeStart=None, timeEnd=None):\n spIdList = self._speciesIdParse(regex, species, startIndex=1)\n replicateList = self._replicateParse(replicate)\n ...
[ "0.7017326", "0.6926714", "0.6447697", "0.64420426", "0.6381539", "0.62476164", "0.61814946", "0.61795", "0.61740625", "0.60476863", "0.60069007", "0.5940654", "0.58516616", "0.5834513", "0.5798589", "0.57394564", "0.5706165", "0.56750846", "0.56362385", "0.56204873", "0.5604...
0.8411809
0
A torch.nn.Linear layer modified to accept ND arrays. The function treats the last dimension of the input as the hidden dimension.
def __init__(self, *args): super(LinearND, self).__init__() self.fc = nn.Linear(*args)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def linear(*args, **kwargs):\n return nn.Linear(*args, **kwargs)", "def create_linear_layer(lin_fn, num_inputs):\n inputs = torch.randn(num_inputs, dtype=torch.float64).requires_grad_(True)\n bias = torch.ones((), dtype=torch.float64).requires_grad_(True)\n out = lin_fn(inputs, bias)\n layer = nn....
[ "0.7006662", "0.6864803", "0.68038845", "0.6651408", "0.65991056", "0.64609647", "0.6449197", "0.64406705", "0.6440056", "0.63175344", "0.6251693", "0.6213363", "0.61091083", "0.60789734", "0.6062596", "0.6052996", "0.6026013", "0.60021937", "0.5975619", "0.5975619", "0.59529...
0.6491541
5
Module which Performs a single attention step along the second axis of a given encoded input. The module uses both 'content' and 'location' based attention. The 'content' based attention is an inner product of the decoder hidden state with each timestep of the encoder state. The 'location' based attention performs a 1D...
def __init__(self, kernel_size=11, log_t=False): super(Attention, self).__init__() assert kernel_size % 2 == 1, "Kernel size should be odd for 'same' conv." padding = (kernel_size - 1) // 2 self.conv = nn.Conv1d(1, 1, kernel_size, padding=padding) self.log_t = log_t
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def attention(decoder_state, coverage=None, num_words_section=None, step=None):\n with variable_scope.variable_scope(\"Attention\"):\n # Pass the decoder state through a linear layer (this is W_s s_t + b_attn in the paper)\n # (W_s s_t) + b_att is decoder_features; s_t = decoder_state\n d...
[ "0.62389654", "0.58269596", "0.57273686", "0.57197255", "0.5690072", "0.5633591", "0.5618507", "0.55358034", "0.5471132", "0.5466309", "0.5400914", "0.5393043", "0.5391463", "0.53879094", "0.5381379", "0.5352664", "0.53351927", "0.53224415", "0.52958125", "0.52915615", "0.528...
0.0
-1
Does the Message model fail to create a new message without a valid user?
def test_create_new_message_fake_user(self): fakeuser = User() message = Message(text="User1 did it again!", user_id=fakeuser.id) db.session.add(message) with self.assertRaises(exc.IntegrityError) as context: db.session.commit() db.session.rollback() messa...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_invalid_user_input(self):\n m = Message(\n text=None, user_id=None\n )\n db.session.add(m)\n with self.assertRaises(exc.IntegrityError) as context:\n db.session.commit()", "def test_create_new_message_valid_user(self):\n\n message = Message(text=\...
[ "0.7403182", "0.73859286", "0.68559307", "0.6736397", "0.6666585", "0.6631041", "0.6593317", "0.65893406", "0.6588654", "0.65799457", "0.6579842", "0.6574248", "0.6573435", "0.65682435", "0.6566206", "0.6566206", "0.6566206", "0.6566206", "0.6566206", "0.6563363", "0.65576166...
0.717715
2
Close the session. This removes the session from the cache. Also invokes the session specific _close method
async def close(self): try: self.logger.debug("Closing session") if self.key in self._ALL_SESSIONS: del self._ALL_SESSIONS[self.key] finally: self.inc_counter("%s.closed" % self.objname) await self._close() if self._cmd_stream i...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def close_session(self):\n self.sess.close()", "def close(self):\n\n if self._session:\n sid = id(self._session)\n self._session.close()\n del self._session\n self._session = None\n\n if logging:\n msg = u'Internal requests Sessi...
[ "0.7730243", "0.77043116", "0.76863873", "0.7644618", "0.7644618", "0.7644618", "0.7586185", "0.7582353", "0.7582353", "0.7582353", "0.7582353", "0.7582353", "0.7582353", "0.74389434", "0.7250939", "0.7247569", "0.7241603", "0.71568507", "0.7137865", "0.71285945", "0.7117027"...
0.6951004
26
Change the identifier of the segment.
def rename(self, identifier): self._line[7] = self._speaker = identifier
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def segment_id(self, segment_id):\n\n self._segment_id = segment_id", "def set_segm_name(*args):\n return _ida_segment.set_segm_name(*args)", "def setId(self, identifier):\n self.identifier = identifier", "def set_id(self, refobj, identifier):\n cmds.setAttr(\"%s.identifier\" %refobj, i...
[ "0.7073178", "0.66745204", "0.64599574", "0.6352423", "0.6322253", "0.6322253", "0.628801", "0.62162435", "0.62162435", "0.6148436", "0.6101377", "0.60976195", "0.6068192", "0.6068192", "0.6068192", "0.6068192", "0.60515296", "0.6048288", "0.60070395", "0.5974675", "0.5960536...
0.61981857
9
Get the basename of the original file which belong the segment.
def get_basename(self): return self._basename
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_file_basename(self):\n return self._basename[:]", "def basename(self):\n return os.path.basename(self.filepath)", "def basename(self):\n return get_basename(self.filename)", "def get_basename(file: Union[str, FileStorage]) -> str:\n filename = _retrieve_filename(file)\n # s...
[ "0.80253524", "0.79687834", "0.7951818", "0.766886", "0.76359713", "0.7601622", "0.75831234", "0.75487036", "0.7534679", "0.7485783", "0.7458139", "0.7430497", "0.74216294", "0.73920643", "0.73787576", "0.7360817", "0.73464286", "0.7340316", "0.73129195", "0.7283998", "0.7223...
0.7475746
10
Get the duration of the segment in frames.
def get_duration(self): return self._duration
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_duration(self):\n frame_dur = self.get_frame_duration()\n num_frames = self.get_num_frames()\n motion_dur = frame_dur * (num_frames - 1)\n return motion_dur", "def get_duration(self):\n duration_ns = self.stream.InitialTimeToWaitGet()\n duration_ns += self.stream.NumberOfFramesG...
[ "0.79879093", "0.78732544", "0.7695085", "0.7688166", "0.75969994", "0.7584953", "0.7564719", "0.75522804", "0.75312513", "0.75020176", "0.74944216", "0.7471398", "0.7465103", "0.7464088", "0.7435096", "0.74231434", "0.7414718", "0.73845965", "0.73845965", "0.7380526", "0.735...
0.71796036
31
Get the mean of all the scores of all the tested speakers for the cluster.
def get_mean(self): try: return sum(self.speakers.values()) / len(self.speakers) except (ZeroDivisionError): return 0.0
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def global_average_scores(self):\n\n return np.mean(self.average_scores_all_subjects(), axis=0)", "def average_scores_all_subjects(self):\n\n # number of participants\n p_num = self.__data.shape[0]\n # output matrix\n out = np.zeros([p_num, 1])\n\n for n in range(1,6):\n...
[ "0.6926226", "0.67451257", "0.6706256", "0.6495938", "0.6320119", "0.6288724", "0.6260492", "0.6196821", "0.61864597", "0.6171327", "0.6153433", "0.6143123", "0.61343485", "0.61325634", "0.61306757", "0.61113346", "0.6105421", "0.60975885", "0.60751086", "0.6073779", "0.60003...
0.6891873
1
Get the cluster name assigned by the diarization process.
def get_name(self): return self._label
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def cluster_name(self) -> str:\n return pulumi.get(self, \"cluster_name\")", "def cluster_name(self) -> str:\n return pulumi.get(self, \"cluster_name\")", "def cluster_name(self) -> pulumi.Output[Optional[str]]:\n return pulumi.get(self, \"cluster_name\")", "def cluster_name(self):\n ...
[ "0.8726651", "0.8726651", "0.8613659", "0.85789484", "0.8527709", "0.8194999", "0.8194999", "0.8154644", "0.8154644", "0.8154644", "0.8154644", "0.8154644", "0.7700867", "0.75422853", "0.75422853", "0.75422853", "0.75422853", "0.7497749", "0.7462727", "0.7462727", "0.7462727"...
0.0
-1
Get the computed gender of the Cluster.
def get_gender(self): gen = {'M': 0, 'F': 0, 'U': 0} differ = False for seg in self._segments: ggg = seg.get_gender() if ggg != self.gender: differ = True gen[ggg] += seg.get_duration() if differ: if gen['M'] > gen['F']:...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_gender(self):\n return self._gender", "def get_gender(self):\n return self._gender", "def get_gender(self):\n genders = dict(GENDERS)\n return genders.get(self.gender, \"N/A\")", "def gender(self):\n return self._gender", "def gender(self):\n return self._g...
[ "0.7155781", "0.7155781", "0.7139811", "0.7103736", "0.7103736", "0.7088327", "0.70465493", "0.69824356", "0.6803729", "0.657426", "0.6566423", "0.6500933", "0.6346209", "0.62580127", "0.6185854", "0.6152301", "0.6016605", "0.58826834", "0.5873709", "0.58622324", "0.5803767",...
0.70063156
7
Get the distance between the best speaker score and the mean of all the speakers' scores.
def get_m_distance(self): value = max(self.speakers.values()) return abs(abs(value) - abs(self.get_mean()))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __score_by_avg_distance_from_players(self, source_iceberg, iceberg_to_score, simulation_data):\n ours_avg_distance, enemy_avg_distance = simulation_data.get_avg_distance_from_players(\n iceberg_to_score)\n\n score = (enemy_avg_distance - ours_avg_distance) * AVG_DISTANCE_FROM_PLAYERS_F...
[ "0.65668756", "0.6529025", "0.64823836", "0.64821345", "0.6472057", "0.6326368", "0.63147455", "0.6272914", "0.61822516", "0.61243105", "0.6005149", "0.59904414", "0.5932793", "0.593212", "0.5915684", "0.59090906", "0.5893719", "0.5886076", "0.5854646", "0.5850683", "0.584646...
0.6995156
0
A dictionary representation of a Cluster.
def to_dict(self): speaker = self.get_speaker() segs = [] for seg in self._segments: tmp = seg.get_line()[2:] tmp[-1] = speaker tmp[0] = int(seg.get_start()) tmp[1] = int(seg.get_end()) tmp.append(self.get_name()) tmp[3] = s...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_cluster_info(self) -> Dict[str, Any]:\n pass", "def get_cluster_entry(self):\n\n cert_data = self.cluster_description.get(\"certificateAuthority\", {}).get(\"data\", \"\")\n endpoint = self.cluster_description.get(\"endpoint\")\n arn = self.cluster_description.get(\"arn\")\n\n...
[ "0.7668061", "0.764446", "0.69203264", "0.6898244", "0.6874661", "0.68260485", "0.681854", "0.6807015", "0.68002766", "0.6641602", "0.6619998", "0.6599635", "0.65380716", "0.6503121", "0.6494254", "0.64781064", "0.6474969", "0.646024", "0.646024", "0.6451251", "0.64232576", ...
0.0
-1
Build a Voiceid object from json dictionary.
def from_dict(vdb, json_dict): vid = Voiceid(vdb, json_dict['url']) dirname = os.path.splitext(json_dict['url'])[0] try: for elm in json_dict['selections']: clu = vid.get_cluster(elm['speakerLabel']) if not clu: clu = Cluster(elm['s...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def from_json_file(vdb, json_filename):\n opf = open(json_filename, 'r')\n jdict = eval(opf.read())\n opf.close()\n return Voiceid.from_dict(vdb, jdict)", "def from_json(name, subscription_json):\n return CaseSubscription(name, subscriptions=subscription_json)", "def from_jso...
[ "0.69945544", "0.5648415", "0.5617641", "0.561439", "0.55966216", "0.55764276", "0.5550436", "0.5507606", "0.550027", "0.54920006", "0.54899466", "0.54551107", "0.5431207", "0.5408726", "0.5390638", "0.538844", "0.53882676", "0.5363679", "0.5361069", "0.5360452", "0.5356601",...
0.6747471
1
Get a string representation of the working status.
def get_working_status(self): #TODO: fix some issue on restarting and so on about current status return self.working_map[self.get_status()]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _get_status(self):\n return u'%s' % (self.get_status_display())", "def get_status_as_string(self):\n if self.downloaded == 0:\n return \"[Starting... ]\"\n return \"[%s, %s, %s]\" % self.get_status()", "def get_status_string(self, instance):\n return instance.get_stat...
[ "0.8019109", "0.7975699", "0.79198766", "0.75144947", "0.75144947", "0.75144947", "0.75144947", "0.75144947", "0.75144947", "0.75144947", "0.75144947", "0.75144947", "0.75144947", "0.75144947", "0.75144947", "0.75144947", "0.75144947", "0.75144947", "0.75144947", "0.75144947", ...
0.70604336
71
Get the name of the current working file.
def get_filename(self): return self._filename
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getCurrentFileName(self):\n return os.path.basename(self.filePath)", "def get_name(self) -> str:\n return os.path.split(os.getcwd())[-1]", "def get_file_name(self):\n return str(self.get_file())", "def name(self):\n try:\n return self._name\n except Attribute...
[ "0.8321261", "0.81622577", "0.7682307", "0.7539434", "0.752219", "0.7474185", "0.74405247", "0.7420354", "0.7371932", "0.7363822", "0.7363822", "0.73613465", "0.73482436", "0.7335862", "0.7331342", "0.72999376", "0.7289677", "0.7289677", "0.7289677", "0.7289677", "0.7289677",...
0.6773734
44
Get the basename of the current working file.
def get_file_basename(self): return self._basename[:]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getCurrentFileName(self):\n return os.path.basename(self.filePath)", "def basename(self):\n return os.path.basename(self.filepath)", "def basename(self):\n return get_basename(self.filename)", "def get_name(self) -> str:\n return os.path.split(os.getcwd())[-1]", "def basenam...
[ "0.8566013", "0.8267794", "0.8218406", "0.80445504", "0.79813904", "0.7963343", "0.7919816", "0.78478307", "0.78411263", "0.7695016", "0.76162845", "0.7531541", "0.74814236", "0.7455174", "0.7398454", "0.7353852", "0.7302331", "0.72477394", "0.7235953", "0.7223424", "0.718027...
0.8231696
2
Get a the cluster by a given label.
def get_cluster(self, label): try: return self._clusters[label] except KeyError: return None
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _find_cluster(clusters, label):\n for clst in clusters:\n if clst.label == label: return clst\n return None", "def get_one_cluster_by_name(ctx, cluster_name, project_name):\n project = ctx.obj.groups.byName[project_name].get().data\n cluster = ctx.obj.groups[project.id].clusters[cluster_na...
[ "0.80865425", "0.696269", "0.6649433", "0.6628766", "0.6443023", "0.6337753", "0.62819487", "0.6276757", "0.6247835", "0.60477424", "0.6032691", "0.6026451", "0.6008381", "0.60022515", "0.60011315", "0.5971974", "0.5909002", "0.59089", "0.5906325", "0.5886822", "0.5862034", ...
0.87666386
0
A dictionary map between speaker label and speaker name.
def get_speakers_map(self): speakers = {} for clu in self: speakers[clu] = self[clu].get_speaker() return speakers
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def find_speaker(spkname, surveysheet):\n spk = {}\n labels = surveysheet.row_values(0)\n for row_index in range(surveysheet.nrows):\n if surveysheet.cell(row_index, 0).value == spkname:\n speaker_row = surveysheet.row_values(row_index)\n for i in labels:\n spk....
[ "0.6003273", "0.5573023", "0.5573023", "0.5573023", "0.5573023", "0.5573023", "0.5573023", "0.5573023", "0.5573023", "0.53526247", "0.5348455", "0.533809", "0.52681375", "0.5250732", "0.52422416", "0.5241646", "0.51795095", "0.5129099", "0.51228416", "0.5084027", "0.5037615",...
0.70194346
0
Return a JSON representation for the clustering information.
def to_dict(self): # """ The JSON model used is like: # <code> #{ # "duration": 15, # "url": "url1", # "selections": [{ # "annotations": [{ # "author": "", # "description": "speaker", # "keyword": "john", # "lang": "EN" # }, # { # ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def to_json(self):\n\n tcluster = {\"clusters\": [], \"matchings\": None}\n if self.matching is not None:\n tcluster[\"matchings\"] = self.matching\n elif self.matched is not None:\n tcluster[\"matchings\"] = self.matched\n\n for tid in self.get_observation_ids():\...
[ "0.79477066", "0.74783784", "0.7406057", "0.7201003", "0.71693677", "0.7101315", "0.6866379", "0.68645537", "0.6557246", "0.655687", "0.6555862", "0.6553548", "0.64462173", "0.6427522", "0.6420563", "0.6383025", "0.63428354", "0.63428354", "0.6294106", "0.6280702", "0.6228394...
0.0
-1
Iterates over lines of Markdown, normalizing for individual display. Generated Markdown HTML cannot by itself be handled on a perlinebasis. Code blocks, for example, will consist of multiple lines of content contained within a tag. Likewise, lists will be a bunch of tags inside a tag, and individually do not form valid...
def iter_markdown_lines(markdown_html): nodes = get_markdown_element_tree(markdown_html) for node in nodes: if node.nodeType == node.ELEMENT_NODE: if (node.tagName == 'div' and node.attributes.get('class', 'codehilite')): # This is a code block, which will co...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def convert(md_text):\n # separate by line\n md_text = md_text.split('\\n')\n\n # save the html content for return\n html_text = ''\n\n # begin looping from the first line\n index = -1\n while index < len(md_text) - 1:\n index += 1\n line = md_text[index]\n\n # code segmen...
[ "0.6367926", "0.63417673", "0.6156236", "0.61144125", "0.6072423", "0.59815973", "0.5899683", "0.5897685", "0.58231497", "0.5807839", "0.5731576", "0.5624603", "0.55875534", "0.5586435", "0.5507304", "0.54774076", "0.54726857", "0.54354686", "0.5326293", "0.5302189", "0.52381...
0.79784155
0
Returns an XML element tree for Markdowngenerated HTML. This will build the tree and return all nodes representing the rendered Markdown content.
def get_markdown_element_tree(markdown_html): if isinstance(markdown_html, six.text_type): markdown_html = markdown_html.encode('utf-8') doc = parseString(b'<html>%s</html>' % markdown_html) return doc.childNodes[0].childNodes
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def tree(self):\n return html.fragment_fromstring(self.html)", "def gen_md(self):\n # https://pythonhosted.org/Markdown/extensions/index.html\n extensions = ['extra', 'codehilite', 'admonition',\n 'toc', 'smarty', 'sane_lists', 'wikilinks']\n # TODO\n exten...
[ "0.66214055", "0.64966714", "0.6360917", "0.6306511", "0.62469065", "0.62069374", "0.6103946", "0.6065871", "0.6001586", "0.5988472", "0.5916315", "0.5828224", "0.582414", "0.5819179", "0.5804732", "0.5772368", "0.57495826", "0.5692954", "0.5685884", "0.5685884", "0.5673443",...
0.67252696
0
This function prints and plots the confusion matrix. Normalization can be added by setting `normalize=True`
def plot_confusion_matrix(y_true, y_pred, classes, normalize=False, title=None, cmap=plt.cm.Blues): if not title: if normalize: title = 'Normalized confusion matrix' else: title = 'Confusion matrix, without normalization' # Compute confusion matrix cm = confusion_mat...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def plot_confusion_matrix(cm, classes=[0,1], normalize=False, title='Confusion matrix', print_matrix=False):\n\n if normalize:\n cm = cm.astype('float') / cm.sum(axis=1)[:, np.newaxis]\n print(\"Normalized confusion matrix\")\n else:\n print('Confusion matrix, without normalization')\n\n...
[ "0.81597805", "0.8098206", "0.8048627", "0.8033019", "0.80291116", "0.80098367", "0.79907125", "0.79894966", "0.79864585", "0.7983479", "0.7968744", "0.7954197", "0.79536504", "0.7952214", "0.79448426", "0.79444736", "0.7939714", "0.7939605", "0.7932992", "0.79303175", "0.792...
0.0
-1
return the associated column for a song enum, EnumSong.Artist. EnumSong.Title, etc
def getColumn(self,song_enum,check_hidden=False): for col in self.columns: if col.index == song_enum: return col if check_hidden: for col in self.columns_hidden: if col.index == song_enum: return col return N...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_enum_value_row(enum_field, enum_value):\n # Translate plural, if given\n enum_field = ENUM_PLURALS_TRANSLATE[enum_field] if enum_field in ENUM_PLURALS_TRANSLATE else enum_field\n return apps.get_model('ahj_app', enum_field).objects.get(Value=enum_value)", "def get_radio_column(self):\n #C...
[ "0.5182838", "0.5142454", "0.49371114", "0.48617473", "0.48571903", "0.48360357", "0.48263884", "0.47503945", "0.4734594", "0.4668488", "0.46427736", "0.4622428", "0.46041307", "0.46024114", "0.45868436", "0.45504448", "0.4544974", "0.4540331", "0.4539291", "0.45196822", "0.4...
0.65322256
0
Get the latest (last) point on the plot. Returns None if there are no points.
def get_latest(self): if len(self.points) == 0: return None return self.points[-1]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def pcurrent(self):\n return self.pointlist[-1]", "def latest(self):\n return self.series.tail(1)[0]", "def last_candle(self):\r\n if self.length() > 0:\r\n return self.candles[0]\r\n else:\r\n return None", "def last(self):\n return self.last and self...
[ "0.7270221", "0.72211266", "0.6671898", "0.66274965", "0.6573031", "0.6498714", "0.6471897", "0.6471897", "0.6471897", "0.64390147", "0.64125675", "0.64053965", "0.64010775", "0.63554054", "0.63535255", "0.63467973", "0.6319469", "0.6318203", "0.6262697", "0.62308115", "0.622...
0.8550339
0
Default formatter for XAxis labels.
def _format_value(self, v): return "%.4g" % v
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def x_formatter_cb( self, ax ):\n ax.set_xlim( xmin=self.begin_num,xmax=self.end_num )\n dl = common.PrettyDateLocator()\n df = common.PrettyDateFormatter( dl )\n ax.xaxis.set_major_locator( dl )\n ax.xaxis.set_major_formatter( df )\n ax.xaxis.set_clip_on(False)\n s...
[ "0.73315", "0.6664795", "0.6424091", "0.62352854", "0.6235065", "0.6230851", "0.6136259", "0.6132022", "0.61223793", "0.59372246", "0.591438", "0.58289975", "0.5807993", "0.5797432", "0.57358587", "0.5722705", "0.56184447", "0.56122273", "0.5515865", "0.54914325", "0.5474417"...
0.0
-1
Gets the description of this OrgApacheSlingCaconfigImplOverrideOsgiConfigurationOverrideProviProperties.
def description(self) -> ConfigNodePropertyString: return self._description
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def from_dict(cls, dikt) -> 'OrgApacheSlingCaconfigImplOverrideOsgiConfigurationOverrideProviProperties':\n return util.deserialize_model(dikt, cls)", "def sso_properties(self) -> Optional[pulumi.Input['DevToolPortalSsoPropertiesArgs']]:\n return pulumi.get(self, \"sso_properties\")", "def sso_pr...
[ "0.6093174", "0.5598702", "0.54712", "0.54712", "0.53227586", "0.5292757", "0.52438897", "0.49291903", "0.4915467", "0.48937482", "0.48899868", "0.4822074", "0.48068905", "0.4779492", "0.47431046", "0.47246364", "0.468339", "0.46542126", "0.46536496", "0.46378964", "0.4634466...
0.43335038
46
Gets the overrides of this OrgApacheSlingCaconfigImplOverrideOsgiConfigurationOverrideProviProperties.
def overrides(self) -> ConfigNodePropertyArray: return self._overrides
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def from_dict(cls, dikt) -> 'OrgApacheSlingCaconfigImplOverrideOsgiConfigurationOverrideProviProperties':\n return util.deserialize_model(dikt, cls)", "def ComponentOverrides(self):\n return tuple(self._json_obj.get('component_overrides', {}).items())", "def sso_properties(self) -> Optional[pulumi.In...
[ "0.61039174", "0.55866736", "0.5277075", "0.5277075", "0.5275095", "0.52136475", "0.52123785", "0.51725435", "0.5122069", "0.5065801", "0.5028448", "0.5019726", "0.5004688", "0.49773896", "0.4929419", "0.49036485", "0.4865083", "0.47658437", "0.47552878", "0.4752538", "0.4745...
0.6708256
0
Gets the enabled of this OrgApacheSlingCaconfigImplOverrideOsgiConfigurationOverrideProviProperties.
def enabled(self) -> ConfigNodePropertyBoolean: return self._enabled
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def enabled(self):\n return self._get('enabled')", "def Enabled(self):\n return self._get_attribute('enabled')", "def getEnabled(self):\n if getattr(self, 'installedversion', None) != __version__ :\n return False\n return self.getField('enabled').get(self)", "def get_pr...
[ "0.57977575", "0.57869214", "0.5623377", "0.5551315", "0.550527", "0.550527", "0.550527", "0.550527", "0.54871094", "0.5479335", "0.54778564", "0.54440695", "0.5432813", "0.5432813", "0.5432813", "0.5432813", "0.5432813", "0.5432813", "0.5432813", "0.5432813", "0.54133797", ...
0.57585007
2
Sets the enabled of this OrgApacheSlingCaconfigImplOverrideOsgiConfigurationOverrideProviProperties.
def enabled(self, enabled: ConfigNodePropertyBoolean): self._enabled = enabled
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_enabled(self, newval):\n rest_val = \"1\" if newval > 0 else \"0\"\n return self._setAttr(\"enabled\", rest_val)", "def enabled(self, enabled):\n \n self._enabled = enabled", "def setGatingOverride(self, channel, isEnabled, unitCode=0):\n resp = self.XAPCommand('GOVER...
[ "0.5043511", "0.5014367", "0.5003255", "0.4968908", "0.49519408", "0.4920339", "0.4874274", "0.4866013", "0.48560494", "0.48560494", "0.48452055", "0.4785608", "0.47832876", "0.47483513", "0.47364587", "0.47128072", "0.4711858", "0.46719593", "0.4663172", "0.46588907", "0.465...
0.49951005
3
Gets the service_ranking of this OrgApacheSlingCaconfigImplOverrideOsgiConfigurationOverrideProviProperties.
def service_ranking(self) -> ConfigNodePropertyInteger: return self._service_ranking
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def service_ranking(self, service_ranking: ConfigNodePropertyInteger):\n\n self._service_ranking = service_ranking", "def priority(self) -> int:\n return pulumi.get(self, \"priority\")", "def _get_properties_ranking(properties_ranking_file, partition_rule):\n properties_ranking = [x[\"name\"] ...
[ "0.6512247", "0.5217007", "0.512157", "0.50419366", "0.5017996", "0.49575096", "0.4955776", "0.49520838", "0.49472216", "0.4943995", "0.494351", "0.49380234", "0.4929892", "0.49287754", "0.4927562", "0.4927562", "0.4927562", "0.4927562", "0.4927562", "0.4922828", "0.49192476"...
0.81016016
0
Loads data from csv_file and returns it as pandas.DataFrame object
def load_dataset_from(csv_file: str) -> pd.DataFrame: print(">>> LOADING DATASET FROM FILE {filename}".format(filename=csv_file)) if not csv_file.endswith(".csv"): print("File has to be CSV type file!") exit(1) try: data = pd.read_csv(csv_file) print(">>> Finished loading d...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _parse_csv(csv_file: str) -> pd.DataFrame:\n return pd.read_csv(csv_file, header=0)", "def load_data(csv_path):\n df = pd.read_csv(csv_path)\n return df", "def data_from_csv(self, filepath):\n self.dataframe = pd.load_csv(filepath, separator='')", "def read_data_from_csv(filename):\n ...
[ "0.85336226", "0.8451108", "0.8347124", "0.8064328", "0.8063714", "0.80465996", "0.8023442", "0.7943575", "0.7898346", "0.78853995", "0.7843002", "0.7830943", "0.7830943", "0.7830943", "0.7796285", "0.7670498", "0.76673853", "0.7622854", "0.7597737", "0.7590228", "0.75793105"...
0.8073647
3
Function that is used to be the command for the button of the tkinter window to go to the link of the new playlist It uses the webbrowser module to open a new tab in your browser
def open_link(self) -> None: webbrowser.open_new(self.link)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def followlink(self, event):\n webbrowser.open(self.url)", "def newwindow(url):\n\n # Open the URL\n webbrowser.open_new(url)", "def newtab(url):\n\n # Open the URL\n webbrowser.open_new_tab(url)", "def button1_press(self):\n\n ext = nuke_link(str(self.lineEdit.text()))\n url...
[ "0.75957876", "0.74636394", "0.73313963", "0.72235125", "0.72084504", "0.70720553", "0.7031625", "0.6984218", "0.6905886", "0.68312657", "0.6817572", "0.6790589", "0.6786953", "0.6679177", "0.6620364", "0.6574613", "0.6573774", "0.6518846", "0.65152335", "0.64942515", "0.6433...
0.70491326
6
A Table view of the most common ticks per day.
def daily_most_common_ticks(): ticks = kisa.get_daily_popular_ticks(start_date, end_date) tick_source = {} dates, species, count = zip(*((dat, sp[0], sp[1]) for (dat, sp) in ticks)) tick_source['date'] = dates tick_source['species'] = species tick_source['count'] = count tick_source = Colu...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def daily_table(self):\n htable = [0 for i in range(7)]\n for i in range(self.dataset.shape[0]):\n stime = time.localtime(np.int32(self.dataset[i][2]))\n evtime = stime[6]\n htable[evtime] += 1\n return htable", "def time_stats(df):\n\n print('\\nCalculati...
[ "0.64882505", "0.631645", "0.62860227", "0.62296414", "0.6197239", "0.618066", "0.61390734", "0.611165", "0.6104516", "0.6102354", "0.6096322", "0.60797054", "0.6076675", "0.60751", "0.6042777", "0.60404587", "0.60048836", "0.6000628", "0.5991194", "0.59721273", "0.59620315",...
0.76210964
0
Initialize cell to all 0's, then fill with animals
def __init__(self, n, prey_cnt=0, predator_cnt=0): # print n, prey_cnt, predator_cnt self.grid_size = n self.grid = [] for i in range(n): row = [0]*n # row is a list of n zeros self.grid.append(row) self.init_animals(prey_cnt, predator_cnt)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def reset(self):\n width = len(self.cell)\n height = len(self.cell[0])\n self.cell = [ [EMPTY for r in range(height)] for c in range(width) ]", "def initialize_cells(self):\n for loc in np.ndindex(*self.shape): # TODO: see if nested for loop is faster than this\n c = Cell(l...
[ "0.6985707", "0.6679001", "0.6603603", "0.6489159", "0.64766634", "0.64509636", "0.6374465", "0.6273045", "0.62243223", "0.6192294", "0.61147714", "0.60842484", "0.6058907", "0.6055484", "0.6033597", "0.60143113", "0.5907699", "0.5871629", "0.5871403", "0.5850076", "0.5838814...
0.56754994
33
Initialize the animal's and their positions
def __init__(self, island, x = 0, y = 0, s="A"): self.island = island self.name = s self.x = x self.y = y
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def initialise_positions(self):\r\n #print(\"initialise_positions\")\r\n for i in range(self.numBoids):\r\n self.boids.append(Boid(random.randint(0, self.width), random.randint(self.height, self.height+5)))\r\n #self.boids.append(Boid(random.randint(0, self.width), random.randin...
[ "0.69364613", "0.6712378", "0.6678836", "0.65227574", "0.6286575", "0.62656987", "0.6218123", "0.62167066", "0.6154304", "0.6126599", "0.61238587", "0.6111937", "0.61109376", "0.6103946", "0.6029076", "0.60176736", "0.6014085", "0.6014085", "0.60026574", "0.59922147", "0.5956...
0.0
-1
Test the hash password function.
def test_hash_password(matrix, mock_check_output): result = matrix.hash_password("testpassword") assert result == "mocked-output"
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_hash_verification(self):\n pw = generate_password(8)\n for hash_method in (ldap_des_crypt, ldap_sha512_crypt, ldap_md5,\n ldap_salted_sha1):\n encrypted = hash_method.hash(pw)\n self.assertTrue(verify_password(pw, encrypted),\n ...
[ "0.8146534", "0.77001554", "0.76451445", "0.76297057", "0.746315", "0.74558365", "0.74466676", "0.73689425", "0.7308487", "0.7258669", "0.72390443", "0.7238273", "0.72381747", "0.7188765", "0.7182746", "0.7162788", "0.71475476", "0.71434075", "0.7131176", "0.7114588", "0.7086...
0.785187
1
Test returning the configured TLS state.
def test_get_tls(matrix): matrix.charm_config["enable-tls"] = True result = matrix.get_tls() assert result is True matrix.charm_config["enable-tls"] = False result = matrix.get_tls() assert result is False
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def tls(self) -> pulumi.Input[bool]:\n return pulumi.get(self, \"tls\")", "def get_tls(self):\n configured_value = self.charm_config[\"enable-tls\"]\n if configured_value:\n return configured_value\n return False", "def test_startTLS(self):\n disconnected = self.st...
[ "0.71331996", "0.7093791", "0.70150614", "0.66525596", "0.6585457", "0.65758455", "0.65515536", "0.6540033", "0.6508693", "0.64776725", "0.63517886", "0.63517886", "0.6312332", "0.63062304", "0.6303833", "0.6228943", "0.6228943", "0.6132377", "0.6132377", "0.6097615", "0.6077...
0.7428091
0
Tests getting bucketlist items.
def test_get_bucketlist_items(self): resp = self.client.post('/bucketlists', data=json.dumps(self.bucketlist), content_type="application/json", headers={ "Authorization": self.token ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_get_bucketlist_items(self):\r\n email = \"test@test.com\"\r\n _pword = \"test\"\r\n user = User.query.filter_by(email=email).first()\r\n bucketlist = BucketList.query.filter_by(user_id=user.id, id=1).first()\r\n items_no = len(bucketlist.bucketlist_items)\r\n head...
[ "0.8351025", "0.8049037", "0.7803362", "0.7580653", "0.755651", "0.75083226", "0.7471085", "0.7458265", "0.7417138", "0.74088967", "0.73989475", "0.731263", "0.72335464", "0.72296464", "0.72189665", "0.7163247", "0.71202266", "0.71008056", "0.7096285", "0.7022674", "0.7022037...
0.83745456
0
Tests updating a bucketlist by id.
def test_update_busketlistitem_by_id(self): resp = self.client.post('/bucketlists', data=json.dumps(self.bucketlist), content_type="application/json", headers={ "Authorization": self.token ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_api_edit_bucketlist(self):\n res_post = self.client().post('/bucketlist', data={'name': 'Wake up, Eat, Code, Sleep & Repeat'})\n self.assertEqual(res_post.status_code, 201)\n res_post_in_json = json.loads(res_post.data.decode('UTF-8').replace(\"'\", \"\\\"\"))\n id = res_post_i...
[ "0.7800197", "0.7541854", "0.7408882", "0.7407622", "0.723298", "0.71560085", "0.71419644", "0.70859915", "0.7085835", "0.69097227", "0.6782141", "0.6766907", "0.67269206", "0.67207694", "0.655483", "0.65543234", "0.65094066", "0.6507109", "0.64627445", "0.6435486", "0.637557...
0.83354676
0
Private function for rank a arrays. Compute the median ignoring Nan.
def _nanmedian(arr1d): # This only works on 1d arrays cond = 1-np.isnan(arr1d) x = np.sort(np.compress(cond,arr1d,axis=-1)) if x.size == 0: return np.nan return np.median(x)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def nanmedian(arr, **kwargs):\r\n return ma.median( ma.masked_where(arr!=arr, arr), **kwargs )", "def median_reduce_nb(col, a, *args):\n return np.nanmedian(a)", "def nanmedian_nb(a):\n out = np.empty(a.shape[1], dtype=np.float_)\n for col in range(a.shape[1]):\n out[col] = np.nanmedian(a[:,...
[ "0.7533602", "0.73017174", "0.72577894", "0.7184184", "0.715803", "0.7151017", "0.7146661", "0.70368415", "0.6862323", "0.680668", "0.67687476", "0.67524433", "0.67384106", "0.67260754", "0.67065895", "0.6671158", "0.6656524", "0.6656524", "0.6656524", "0.6650594", "0.6624592...
0.734957
1
Sort an array and provide the argsort.
def fastsort(a): # TODO: the wording in the docstring is nonsense. it = np.argsort(a) as_ = a[it] return as_, it
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def custom_sort(arr):\n pass", "def argsort(a, *args, **kwargs):\n warn('The function argsort is deprecated from JAMS. Use module pyjams.',\n category=DeprecationWarning)\n if isinstance(a, np.ma.MaskedArray):\n return np.ma.argsort(a, *args, **kwargs)\n elif isinstance(a, np.ndarray):...
[ "0.7891882", "0.76259416", "0.7067277", "0.6864901", "0.67765224", "0.67060477", "0.6685931", "0.662964", "0.6624978", "0.6585095", "0.6549422", "0.6436181", "0.6413552", "0.6359419", "0.6331791", "0.62727064", "0.62723017", "0.6231115", "0.6203391", "0.61998767", "0.61308885...
0.6456423
11
Checks Get Product Detail APIs work for all products in Get Products.
def check_products(self, adi): results = [] products = self.get_products(adi) for product in products["data"]["products"]: print("Checking product '{}'... ".format(product["name"]), end='') detail = self.get_product_detail(adi, product_id=product["productId"], produc...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_view_all_products(self):\n resp = self.admin_register()\n reply = self.admin_login()\n token = reply['token']\n product = dict(\n prod_name='NY_denims',\n category='denims',\n stock=20,\n price=150\n )\n resp = self.clie...
[ "0.6680456", "0.66601217", "0.66017115", "0.65717506", "0.65263736", "0.65211934", "0.65143", "0.6511113", "0.6509418", "0.6505598", "0.64900124", "0.6488298", "0.64830196", "0.6463925", "0.64000374", "0.6393503", "0.63350004", "0.6270354", "0.6194113", "0.61565024", "0.61455...
0.6702116
0
Checks the schema of the Get Product Detail response is correct.
def check_product_detail_schema(self, adi, product_id=None, product_name=None): product_detail = self.get_product_detail(adi, product_id, product_name) if product_detail is None: return self.sc.check(product_detail, {"$ref" : "ResponseBankingProductById"})
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_detail_format(self) -> None:\n r = self.perform_request('detail', True)\n self.assert_json_schema(r.json(), self.get_details_schema())", "def check_product_schema(self, adi):\r\n products = self.get_products(adi)\r\n self.sc.check(products, {\"$ref\" : \"ResponseBankingProduc...
[ "0.71004415", "0.6680121", "0.62991613", "0.6234262", "0.6231652", "0.61786276", "0.6178084", "0.61339396", "0.59602225", "0.58714896", "0.5828557", "0.5767552", "0.5761709", "0.5657776", "0.560335", "0.5575253", "0.55184716", "0.5506", "0.5504762", "0.5471077", "0.5461571", ...
0.7485323
0
Checks the schema of the Get Product response and of all listed Product Details are correct for a given ADI.
def one_click(self, adi): products = self.get_products(adi) self.sc.stack = [adi] self.sc.check(products, {"$ref" : "ResponseBankingProductList"}) for product in products["data"]["products"]: self.sc.stack = [adi, product["name"]] self.check_product_detail_s...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def check_product_schema(self, adi):\r\n products = self.get_products(adi)\r\n self.sc.check(products, {\"$ref\" : \"ResponseBankingProductList\"})", "def check_product_detail_schema(self, adi, product_id=None, product_name=None):\r\n product_detail = self.get_product_detail(adi, product_id,...
[ "0.79040796", "0.75987786", "0.7394865", "0.6421799", "0.6350588", "0.6137115", "0.61174387", "0.606553", "0.6062701", "0.6059254", "0.59885263", "0.5951403", "0.59510154", "0.5891715", "0.58626103", "0.5823334", "0.58204323", "0.5817409", "0.5788661", "0.57788587", "0.577162...
0.6498004
3
Feed input vector through the network and return output vector. Additionally store the activations and z values.
def feedforward(self, input): self.ys[0] = input for i in range(1, len(self.ws)): self.zs[i] = self.ws[i] @ self.ys[i - 1] + self.bs[i] self.ys[i] = self.g(self.zs[i]) return self.ys[-1]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def feed(self, vector):\n return vector", "def feed_forward(neural_network, input_vector):\n\n outputs = []\n\n for layer in neural_network:\n\n input_with_bias = input_vector + [1] # add a bias input\n output = [neuron_output(neuron, input_with_bias) # compute the output\n...
[ "0.7370377", "0.7106629", "0.7084625", "0.6910688", "0.6904303", "0.6786165", "0.66115224", "0.6574488", "0.6302253", "0.6220125", "0.6216346", "0.61868554", "0.6185115", "0.61694384", "0.6110264", "0.6108632", "0.61012197", "0.6089439", "0.60890317", "0.60735697", "0.6060347...
0.6337236
8
activation function derivative (sigmoid')
def g_d(self, z): a = self.g(z) return a * (1 - a)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def derivative_activation(z):\n return activation(z) * (1 - activation(z))", "def derivative_sigmoid(x):\n return x * (1 - x)", "def derivative_sigmoid(x):\n return x * (1 - x)", "def activation(z):\n # formula for sigmoid\n return 1 / (1 + np.exp(-z))", "def sigmoid_derivative(x):\n retu...
[ "0.8335384", "0.8029718", "0.8029718", "0.7995369", "0.7986111", "0.79320115", "0.7852003", "0.78242344", "0.7766425", "0.7762885", "0.76416934", "0.7617166", "0.7614981", "0.75696707", "0.7533349", "0.7532869", "0.7521406", "0.7513577", "0.7493299", "0.747452", "0.74701", ...
0.0
-1
Create a new oidc config from the provided dictionary.
def create_from_dict(cls, oidc_config_info: dict) -> OIDCConfig: if oidc_config_info: oidc_config = OIDCConfig() oidc_config.project_id = oidc_config_info['project_id'] oidc_config.client_id = oidc_config_info['client_id'] oidc_config.client_secret = oidc_config_i...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def from_dict(dict_, file_name='<from_dict>', root_name='<root>'):\n return Config(dict_, name=root_name, file_=file_name)", "def from_dict(cls, dict_obj):\n config = cls()\n for k, v in dict_obj.items():\n setattr(config, k, v)\n return config", "def from_dict(d):\n ...
[ "0.66674894", "0.66570145", "0.6382465", "0.63186336", "0.62118536", "0.61821294", "0.61743975", "0.6087044", "0.60511553", "0.60494083", "0.6019384", "0.5935051", "0.591208", "0.59108293", "0.59108293", "0.59108293", "0.5888635", "0.58822304", "0.5866827", "0.584539", "0.582...
0.7995336
0
Compute the softmax of each element along an axis of X.
def softmax(X, theta=1.0, axis=None): y = X # multiply y against the theta parameter, y = y * float(theta) # subtract the max for numerical stability y = y - np.max(y) # exponentiate y y = np.exp(y) # take the sum along the specified axis ax_sum = np.sum(y) # finally: divi...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def softmax(self, x):\n\n out = np.zeros(x.shape)\n for i in range(x.shape[0]):\n max_x = x[i] - np.max(x[i])\n out[i] = np.exp(max_x) / np.sum(np.exp(max_x), axis=0)\n\n return out", "def softmax(x: npt.NDArray) -> npt.NDArray:\n row_wise_max = np.max(x, axis=1).res...
[ "0.8648168", "0.8523443", "0.8501356", "0.845101", "0.8424965", "0.8401308", "0.83822155", "0.83788544", "0.8372522", "0.83631027", "0.835532", "0.8344603", "0.8326291", "0.8309666", "0.82737535", "0.8272703", "0.82659155", "0.824838", "0.824838", "0.8244414", "0.82432497", ...
0.0
-1
Applies the forward model to the model for the given solver.
def forward_model(self, shot, m0, frequencies, return_parameters=[]): # Local references solver = self.solver solver.model_parameters = m0 # this updates dt and the number of steps so that is appropriate for the current model mesh = solver.mesh d = solver.domain dt = s...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def solve(self, model, solver=\"cbc\", with_duals=False, **solver_kwargs):\n logging.info(\"Optimising using %s.\", solver)\n\n solver_kwargs[\"tee\"] = solver_kwargs.get(\"tee\", True)\n\n self.meta[\"solph_version\"] = solph.__version__\n self.meta[\"solver\"] = solver\n self.m...
[ "0.5913653", "0.58469105", "0.58298993", "0.57827353", "0.5702531", "0.5677223", "0.55754423", "0.55539143", "0.55520034", "0.55184275", "0.55123985", "0.5504104", "0.5488734", "0.5487102", "0.54781926", "0.5471877", "0.54642695", "0.54605424", "0.5420407", "0.54081655", "0.5...
0.6043375
0
Applies the forward model to the model for the given solver.
def linear_forward_model(self, shot, m0, m1, frequencies, return_parameters=[]): # Sanitize the input if not np.iterable(frequencies): frequencies = [frequencies] # Local references solver = self.solver solver.model_parameters = m0 # this updates dt and the number o...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def forward_model(self, shot, m0, frequencies, return_parameters=[]):\n\n # Local references\n solver = self.solver\n solver.model_parameters = m0 # this updates dt and the number of steps so that is appropriate for the current model\n\n mesh = solver.mesh\n\n d = solver.domain\n...
[ "0.6040747", "0.5918207", "0.5843809", "0.58275527", "0.57797116", "0.5700266", "0.56757987", "0.5573625", "0.55575603", "0.55494773", "0.55215293", "0.55164707", "0.55012584", "0.5486423", "0.5485438", "0.5475387", "0.5468614", "0.546214", "0.5459531", "0.5418266", "0.540553...
0.53923297
22
Defines !=. Not doing this always leads to annoying bugs...
def __ne__(self, other): return not self.__eq__(other)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __neq__(self, other): \n return not self == other", "def __ne__(self, other):\r\n\t\treturn (self.type != other.type or self.value != other.value)", "def ne (self, other):\n return not (self == other) # opposite of eq", "def __ne__(self,other):\n return not (s...
[ "0.7132524", "0.7015259", "0.69744724", "0.69661963", "0.6939496", "0.6931768", "0.6931768", "0.6931768", "0.6916292", "0.6914676", "0.6911523", "0.6878416", "0.68705916", "0.68705916", "0.6869327", "0.6869327", "0.68619365", "0.6860096", "0.68472654", "0.6842909", "0.6834163...
0.0
-1