query
stringlengths
9
3.4k
document
stringlengths
9
87.4k
metadata
dict
negatives
listlengths
4
101
negative_scores
listlengths
4
101
document_score
stringlengths
3
10
document_rank
stringclasses
102 values
Convert the integer from decimal to hex
def _convert_to_hex(self, integer): hex_string = str(hex(int(integer)))[2:] length = len(hex_string) if length == 1: hex_string = str(0) + hex_string return hex_string
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def int_to_hex(num):\n return hex(num)", "def int_to_hex(n):\r\n #return \"0x%X\" % n\r\n return hex(n)", "def int2hex(n: int) -> str:", "def int_to_hex(a):\n return hex(a)", "def int_to_hexstr(data: int) -> str:\n return \"%0.2X\" % data", "def conv_hex(num):\n\n if num < 10:\n ...
[ "0.85311806", "0.8476238", "0.8375074", "0.8229931", "0.7800177", "0.76471466", "0.7494922", "0.74854594", "0.7398706", "0.7394598", "0.73338336", "0.7332243", "0.732811", "0.7318254", "0.721986", "0.71589303", "0.70401853", "0.7032715", "0.70237076", "0.7009764", "0.6910827"...
0.78436655
4
Assemble mac address from the list
def _get_mac_address(self, mac_numbers): mac = "" for num in mac_numbers: num = self._convert_to_hex(num) mac = ':'.join((mac, num)) mac = mac[1:] return mac
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def mac_address(self):\n mac = [\n self.random.randint(0x00, 0xff),\n self.random.randint(0x00, 0xff),\n self.random.randint(0x00, 0xff),\n self.random.randint(0x00, 0xff),\n self.random.randint(0x00, 0xff),\n self.random.randint(0x00, 0xff)\...
[ "0.7022228", "0.68802977", "0.6582795", "0.6570698", "0.6570698", "0.6570698", "0.6570698", "0.6556131", "0.6456271", "0.6389757", "0.63864744", "0.6316981", "0.6316593", "0.63095945", "0.6283913", "0.62120837", "0.6191361", "0.6191361", "0.61385566", "0.61184037", "0.6116887...
0.740949
0
Read private key and certificates from files. Return (private key, certificates) chain pair.
def read_chain_pair(private_key, certificates): with open(private_key, 'rb') as f: private_key = f.read() with open(certificates, 'rb') as f: certificates = f.read() return (private_key, certificates)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def load_key_and_cert(key_file, cert_file):\n with open(cert_file, 'rb') as f:\n cert = x509.load_pem_x509_certificate(f.read(), default_backend())\n with open(key_file, 'rb') as f:\n key = serialization.load_pem_private_key(f.read(), None, backend=default_backend())\n\n ...
[ "0.6391459", "0.62914973", "0.5971284", "0.59437066", "0.58221966", "0.57909185", "0.57617474", "0.5750648", "0.564614", "0.5595037", "0.5582063", "0.55411404", "0.54925364", "0.5485883", "0.54124856", "0.5362128", "0.5354524", "0.5340389", "0.5324609", "0.5308338", "0.526386...
0.8233212
0
If store is set it should be an EventStore object where we'll save events as they arrive
def __init__(self, store=None): self.sockets = [] self.poller = zmq.core.poll.Poller() self.mh = MessageHandler() self.store = store
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_store(self, store):\n self.store = store", "def setSessionStore(self, store):\n pass", "def _set_store(self, store):\n for method in list(self.methods.values()):\n method.__servicemethod__['store'] = store\n self._store = store", "def do(self, store: \"GrocerySt...
[ "0.7089652", "0.6831267", "0.6632132", "0.6583045", "0.62921906", "0.626166", "0.6146996", "0.60109043", "0.5977724", "0.5927897", "0.59195673", "0.58189577", "0.5815198", "0.5811567", "0.57356155", "0.57228196", "0.57043916", "0.5689016", "0.56362695", "0.5594212", "0.554945...
0.48892748
98
Add sock (a zmq socket) to list of sockets we'll listen for events on
def listen(self, sock): self.sockets.append(sock) self.poller.register(sock, zmq.POLLIN)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_socket(self, socket):\n self.add_sockets([socket])", "def add_sockets(self, sockets):\n if self.io_loop is None:\n self.io_loop = IOLoop.current()\n\n for sock in sockets:\n self._sockets[sock.fileno()] = sock\n self.io_loop.add_handler(sock.fileno(),...
[ "0.6908348", "0.675583", "0.66643906", "0.64296603", "0.60607636", "0.6004247", "0.5915704", "0.58805346", "0.5824161", "0.5776066", "0.56614673", "0.56568986", "0.56186587", "0.560656", "0.5605178", "0.5531999", "0.5525945", "0.55209213", "0.55099356", "0.547657", "0.5465054...
0.7839191
0
Get the next event. Wait for timeout milliseconds or forever if timeout is None
def getEvent(self, timeout=None): socks = self.poller.poll(timeout) if not socks: return msg = socks[0][0].recv() d = self.mh.unserialize(msg) e = Event.fromDict(d) if self.store: _id = self.store.addEvent(e) e.id = _id return e
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_next_event(self, timeout=None):\n ret = self.inq.Wait(timeout)\n return ret", "async def _read_event(self, timeout: int=None):\n event = None\n try:\n event = await wait_for(self.get_event(), timeout=timeout)\n except TimeoutError:\n pass\n\n ...
[ "0.87932193", "0.717155", "0.70189875", "0.66396683", "0.65838164", "0.65481365", "0.65381086", "0.65064025", "0.63976747", "0.6372901", "0.63268286", "0.63096327", "0.6288369", "0.62413335", "0.6240144", "0.6238906", "0.62270033", "0.6205946", "0.6071406", "0.6068982", "0.60...
0.5931091
24
Applies network layers and ops on input image(s) x.
def forward(self, x, test=False): sources = list() loc = list() conf = list() # apply bases layers and cache source layer outputs for k in range(len(self.base)): x = self.base[k](x) if k in self.feature_layer: if len(sources) == 0: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def apply_network(inputs):\n return apply_layer(tf.sigmoid(apply_layer(inputs, 64)), 1)", "def forward(self, x):\n for task_module_name in self.task_module_name_path[self.task_idx]:\n for layer in self.task_modules[task_module_name]:\n x = layer(x)\n #x = self.task_...
[ "0.65620095", "0.63693756", "0.6366089", "0.63534147", "0.6309185", "0.6308151", "0.6257753", "0.6208064", "0.6199206", "0.619269", "0.61763096", "0.616371", "0.6153872", "0.6143252", "0.61291367", "0.61276346", "0.61222804", "0.61158955", "0.6111172", "0.60992426", "0.608334...
0.0
-1
Get normalized strings for the group items in the group. Then sort them by frequency. Normalize the text for comparison by removing spaces and punctuation, and setting all letters to lower case. The exemplar for the group is the longest prenormalized value. So if we have three
def normalized_exact_matches(group, row_count) -> tuple[int, int, list[list]]: # Sort the fields by normalized values filled = defaultdict(list) for field in group: if key := re.sub(r"\W+", "", field.value).lower(): filled[key].append(field) # Bring the field with the longest value ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def main(str_text):\n\n frequencies = count_value(str_text)\n sorted_data = sort_dict(frequencies)\n\n return sorted_data", "def _textualize_group(group):\n # The final string. A list is used for performance.\n ret_str = []\n\n ones = int(group[2])\n tens = int(group[1])\n hundreds = int(...
[ "0.612385", "0.6013692", "0.5886225", "0.58484906", "0.5825418", "0.5696492", "0.5666141", "0.5631283", "0.56154144", "0.5601557", "0.55016863", "0.5499204", "0.5485176", "0.54496175", "0.5447808", "0.53935516", "0.5383511", "0.535823", "0.53225", "0.53172135", "0.5288765", ...
0.5639996
7
Return the best partial ratio match from fuzzywuzzy module.
def top_partial_ratio(group): scores = [] for c0, c1 in combinations(group, 2): score = fuzz.partial_ratio(c0.value, c1.value) field = c0 if len(c0.value) >= len(c1.value) else c1 scores.append(FuzzyRatioScore(score, field)) scores = sorted(scores, reverse=True, key=lambda s: (s.sco...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def fuzzy_partial_ratio(thing_1, thing_2):\n return fuzz.partial_ratio(thing_1, thing_2)", "def fuzzy_ratio(thing_1, thing_2):\n return fuzz.ratio(thing_1, thing_2)", "def find_best_match(fpl_teams: List[str], team: str) -> Tuple[str, int]:\n best_ratio = 0.0\n best_match = None\n for t in fpl_teams...
[ "0.767117", "0.706915", "0.7045623", "0.69615054", "0.688134", "0.68650913", "0.6457859", "0.62769884", "0.6275168", "0.60757107", "0.6075642", "0.60390335", "0.60216784", "0.60216784", "0.5956916", "0.5956916", "0.59508455", "0.59213847", "0.5902485", "0.5899878", "0.5849218...
0.7887274
0
Return the best token set ratio match from fuzzywuzzy module.
def top_token_set_ratio(group): scores = [] for c0, c1 in combinations(group, 2): score = fuzz.token_set_ratio(c0.value, c1.value) tokens_0 = len(c0.value.split()) tokens_1 = len(c1.value.split()) if tokens_0 > tokens_1: field = c0 tokens = tokens_0 ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def fuzzy_token_sort_ratio(thing_1, thing_2):\n return fuzz.token_sort_ratio(thing_1, thing_2)", "def find_best_match(fpl_teams: List[str], team: str) -> Tuple[str, int]:\n best_ratio = 0.0\n best_match = None\n for t in fpl_teams:\n if fuzz.partial_ratio(t, team) > best_ratio:\n best...
[ "0.7019757", "0.6915708", "0.6894662", "0.6811242", "0.6709782", "0.6509443", "0.62935543", "0.6287032", "0.62503135", "0.6221222", "0.62034714", "0.6132662", "0.6018528", "0.59871924", "0.59778166", "0.59441316", "0.59365857", "0.59181213", "0.58937454", "0.5874365", "0.5842...
0.75352436
0
Make pod specification for Kubernetes
def make_pod_spec(self): spec = { 'containers': [{ 'name': self.framework.model.app.name, 'imageDetails': { }, 'ports': [{ 'containerPort': self.framework.model.config['advertised-port'], ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def make_pod_spec():\n md = metadata()\n cfg = config()\n\n if cfg.get(\"enable-sidecar\"):\n with open(\"reactive/spec_template_ha.yaml\") as spec_file:\n pod_spec_template = spec_file.read()\n else:\n with open(\"reactive/spec_template.yaml\") as spec_file:\n pod_s...
[ "0.7959695", "0.7671487", "0.7217666", "0.67198086", "0.6675382", "0.6622293", "0.6397979", "0.6320169", "0.6240289", "0.60877234", "0.59261304", "0.5921372", "0.58255005", "0.5815334", "0.5736419", "0.56606907", "0.5654171", "0.5562911", "0.5464203", "0.5450449", "0.5433386"...
0.76017493
2
Return all arguments required to execute CLI
def get_arguments(self): args = self.parser.parse_args() config = None with open(args.config_file, "r") as f: config = json.load(f) if "collections" in config: if len(config["collections"]) > 0: collection = config["collections"][0] ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_cli_arguments(self):\n pass", "def __get_cli_args():\r\n parser = argparse.ArgumentParser()\r\n o = parser.add_mutually_exclusive_group()\r\n o.add_argument('-a', action='store_true')\r\n o.add_argument('-b', action='store_true')\r\n parser.add_argument('-suite', help='suite file na...
[ "0.8434595", "0.7754269", "0.7644272", "0.76297367", "0.76230663", "0.75364363", "0.74571276", "0.7417445", "0.7412155", "0.7406127", "0.7401388", "0.73903877", "0.73764217", "0.7358373", "0.73560494", "0.7318047", "0.73040634", "0.72991544", "0.7276237", "0.72737163", "0.725...
0.0
-1
Returns the API version based on the release track.
def GetApiVersion(cls): if cls.ReleaseTrack() == base.ReleaseTrack.ALPHA: return 'alpha' elif cls.ReleaseTrack() == base.ReleaseTrack.BETA: return 'beta' return 'v1'
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_version(self):\n return self.api_version", "def get_api_version(session: \"Session\") -> str:\n component_versions = get_component_versions(session)\n return str(component_versions.get(CoordConsts.KEY_API_VERSION, \"2.0.0\"))", "def api_version(self) -> Optional[str]:\n return pulum...
[ "0.7356627", "0.73361796", "0.73104286", "0.73104286", "0.73104286", "0.73104286", "0.73104286", "0.73104286", "0.73104286", "0.73104286", "0.73104286", "0.73104286", "0.73104286", "0.73104286", "0.73104286", "0.73104286", "0.73104286", "0.73104286", "0.73104286", "0.73104286",...
0.8126857
0
Returns the resource schema path.
def GetSchemaPath(cls, for_help=False): return export_util.GetSchemaPath( 'compute', cls.GetApiVersion(), 'BackendService', for_help=for_help)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_bundled_schema_path():\n return str(data.load_resource(\"schema\"))", "def _get_base_schema_path(base_schema: str = None) -> str:\n biothings_schema_path = LOADER.filename(\"data_models/biothings.model.jsonld\")\n base_schema_path = biothings_schema_path if base_schema is None else base_schema\n...
[ "0.8129537", "0.7225695", "0.7073041", "0.70640045", "0.68459177", "0.6833207", "0.67889005", "0.67540175", "0.67540175", "0.6610404", "0.64634776", "0.6445213", "0.6430494", "0.6416756", "0.6370232", "0.63636297", "0.62787116", "0.62350994", "0.6226971", "0.6226971", "0.6224...
0.7178181
2
Create Backend Services patch request.
def ComposePatchRequest(self, client, backend_service_ref, replacement): if backend_service_ref.Collection() == 'compute.regionBackendServices': return ( client.apitools_client.regionBackendServices, 'Patch', client.messages.ComputeRegionBackendServicesPatchRequest( ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def requestfactory_patch(self, path, data=None, content_type=client.MULTIPART_CONTENT, **extra):\r\n\r\n data = data or {}\r\n patch_data = self._encode_data(data, content_type)\r\n\r\n parsed = urlparse.urlparse(path)\r\n request = {\r\n 'CONTENT_LENGTH': len(patch_data),\r\n 'CONTENT_TY...
[ "0.6822116", "0.6498407", "0.6371376", "0.6356031", "0.6331954", "0.63101476", "0.618666", "0.61838037", "0.61745155", "0.61538756", "0.61318535", "0.6130529", "0.61251915", "0.6110662", "0.6103166", "0.6076066", "0.6054936", "0.6054936", "0.6054936", "0.6049838", "0.6041006"...
0.6702764
1
Resonsible for loading configs and setting up client
def load_config(self, config_file, usage): config = configparser.ConfigParser() config.read(config_file) auth_id = config.get('SMARTY STREETS', 'auth_id' ) auth_token = config.get('SMARTY STREETS', 'auth_token') api_credentials = StaticCredentials(auth_id, auth_token) cli...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def config():", "def config():", "def client_setup(self):\n self.client = Client()", "def configure(self):", "def configure(self):", "def configure(self):", "def configure(self):", "def _configure(self):\n pass", "def config():\n config_django()\n config_svisor()", "def __init...
[ "0.7131933", "0.7131933", "0.70558983", "0.68658847", "0.68658847", "0.68658847", "0.68658847", "0.68388593", "0.6827142", "0.68141896", "0.67925876", "0.67326516", "0.67191195", "0.6715665", "0.6709162", "0.6709162", "0.6655134", "0.6629441", "0.6599594", "0.65726084", "0.65...
0.6837061
8
Responsible for sending request to service
def send_request(self, params, address_data): try: # Stream considered a batch of one self.client.send_batch(address_data) return address_data except exceptions.SmartyException as err: print(err) return
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def ServiceRequest(self):\n #- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -\n pass", "def _send_request(self):\n route_chosen = self.comboBox_route_list.currentText()\n route_id = route_chosen.split(',')[0] #to get the id of the route\n trip_headsign_ch...
[ "0.7657708", "0.73205423", "0.7213784", "0.7085317", "0.6995092", "0.69075006", "0.68932", "0.681189", "0.66904163", "0.6668911", "0.66416377", "0.66416377", "0.6629037", "0.6605246", "0.65916795", "0.6575594", "0.6537439", "0.6485675", "0.64799434", "0.64799434", "0.6435945"...
0.0
-1
Reponsible for validating input addresses in stream or batch form. returns a list containing a single Address object for stream input and multiple for batch input.
def validate(self, params, address_input_data): processed_address_list = [] # check avoids redundancy for combined 'forward geocode and validate' # option as API does both by default if self.__is_address_list_processed: processed_address_list = address_input_data els...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __process_smarty_request_list(self, request_list, address_input_data ):\n assert(len(address_input_data) == self.__total_addresses_in_request_list)\n\n processed_address_list = []\n address_iterator = iter(address_input_data)\n for unprocessed_request in request_list: \n ...
[ "0.6725842", "0.6710126", "0.6240761", "0.6221789", "0.62037283", "0.6125183", "0.61011887", "0.61011887", "0.61011887", "0.6095425", "0.6018221", "0.5996222", "0.5996222", "0.59931666", "0.59471816", "0.5929042", "0.5874366", "0.5863718", "0.5857947", "0.5847198", "0.5830124...
0.7343851
0
Reponsible for forward geocoding input addresses in stream or batch form. returns a list containing a single Address object for stream input and multiple for batch input.
def forward_geocode(self, params, address_input_data ): processed_address_list = [] # check avoids redundancy for combined 'forward geocode and validate' # option as API does both by default if self.__is_address_list_processed: processed_address_list = address_input_data ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def addresses(self) -> pulumi.Input[Sequence[pulumi.Input[str]]]:\n return pulumi.get(self, \"addresses\")", "def validate(self, params, address_input_data):\n processed_address_list = []\n # check avoids redundancy for combined 'forward geocode and validate' \n # option as API does b...
[ "0.6530636", "0.64462525", "0.63802785", "0.6370371", "0.6355637", "0.616385", "0.6150521", "0.5960874", "0.5960874", "0.5960874", "0.5901883", "0.5866094", "0.58648705", "0.5802863", "0.5780841", "0.57634604", "0.57634604", "0.5756493", "0.57322425", "0.5726187", "0.56785333...
0.7548706
0
Returns a list of requests each containing SmartyAddressService.MAX_ADDRESSES_PER_REQUEST address input strings. Input Address strings are converted smarty street Lookup objects. The request list is a list of batch partitions, smarty street Batch objects, which serves as the overall address batch.
def __prepare_smarty_request_list(self, address_list): single_request_batch_partition = Batch() addresses_per_request = 0 request_list = [] for address in address_list: if addresses_per_request == SmartyAddressService.MAX_ADDRESSES_PER_REQUEST: request_list.ap...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __process_smarty_request_list(self, request_list, address_input_data ):\n assert(len(address_input_data) == self.__total_addresses_in_request_list)\n\n processed_address_list = []\n address_iterator = iter(address_input_data)\n for unprocessed_request in request_list: \n ...
[ "0.5991902", "0.50746", "0.50179887", "0.5004752", "0.4969774", "0.4932725", "0.48918006", "0.4872808", "0.48422703", "0.48400947", "0.48248988", "0.47963837", "0.4769254", "0.47649458", "0.47551847", "0.47398427", "0.4738118", "0.4730094", "0.47092748", "0.46977097", "0.4692...
0.7343559
0
Process request list through smarty streets API and assign response to corresponding address objects. Each individual request contains SmartyAddressService.MAX_ADDRESSES_PER_REQUEST address Lookups, which are assigned candidate addresses by their api. This function chooses the top candidate is chosen and assigns desire...
def __process_smarty_request_list(self, request_list, address_input_data ): assert(len(address_input_data) == self.__total_addresses_in_request_list) processed_address_list = [] address_iterator = iter(address_input_data) for unprocessed_request in request_list: params = {}...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __prepare_smarty_request_list(self, address_list):\n single_request_batch_partition = Batch()\n addresses_per_request = 0\n request_list = []\n for address in address_list:\n if addresses_per_request == SmartyAddressService.MAX_ADDRESSES_PER_REQUEST:\n requ...
[ "0.67963153", "0.56317437", "0.5481398", "0.54446745", "0.5351575", "0.5254347", "0.51797926", "0.50109726", "0.4875006", "0.48727018", "0.4871034", "0.4861196", "0.4853113", "0.48028946", "0.4739545", "0.47258613", "0.4718744", "0.470152", "0.46981382", "0.46929234", "0.4670...
0.6969019
0
Displays an options menu with the given options by executing dmenu with the provided list of arguments. Returns the chosen option or None if none of the given options was chosen.
def dmenu(options, args=[], path=DEFAULT_DMENU_PATH): dmenu = subprocess.Popen([path] + args, stdin=subprocess.PIPE, stdout=subprocess.PIPE) option_lines = '\n'.join(map(str, options)) option = dmenu.communicate(option_lines.encode('utf-8'))[0] \ ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def run(self, args=[], path=DEFAULT_DMENU_PATH):\n options = self.create_options()\n option = dmenu(options, args=args, path=path)\n if option:\n self.handle_option(option, options)", "def menuItem(*args):\n\toptionsWindow()", "def show(self):\n # Display the menu.\n ...
[ "0.69564426", "0.65855235", "0.6582707", "0.64486706", "0.64389974", "0.6281806", "0.6219096", "0.60309243", "0.6030296", "0.5987751", "0.5915396", "0.5903842", "0.5899842", "0.5889831", "0.58847314", "0.58633196", "0.5862723", "0.58552134", "0.5834016", "0.57824904", "0.5700...
0.79341877
0
Returns a list of options. Each option should have a __str__ function. To be overwritten by subclasses.
def create_options(self): return []
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _getOptions(self):\n args = []\n for iname, value in self.options:\n args.append('-' + iname)\n if value != 'true':\n args.append(value)\n return args", "def getOptionsNames(self) -> List[unicode]:\n ...", "def get_options(self):\n return []", "def all_options(self...
[ "0.7744731", "0.7684556", "0.7572338", "0.7344777", "0.7327094", "0.7252559", "0.7191892", "0.7009248", "0.6922074", "0.6905703", "0.68965507", "0.6893068", "0.6864366", "0.6856245", "0.6714529", "0.66810274", "0.66718227", "0.6670524", "0.665573", "0.6653253", "0.6648187", ...
0.6918581
9
Handles the option chosen in the dmenu. To be overwritten by subclasses.
def handle_option(self, option, options): pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getMenuOption():\n return menu_option", "def handle_select(self):\n #self.selected = input('>> ')\n self.selected = '0'\n if self.selected in ['Q', 'q']:\n sys.exit(1)\n elif self.selected in ['B', 'b']:\n self.back_to_menu = True\n return True\...
[ "0.673435", "0.66599476", "0.66203", "0.65081906", "0.6503948", "0.6503179", "0.64747703", "0.64747703", "0.6417105", "0.6362919", "0.63450885", "0.631465", "0.6263112", "0.6202966", "0.6188523", "0.61634606", "0.61166906", "0.60992646", "0.6090097", "0.60768914", "0.6067128"...
0.6845839
0
Creates the options with the create_options function and passes them to dmenu with the additional arguments. If an option was selected it is passed to the handle_option function.
def run(self, args=[], path=DEFAULT_DMENU_PATH): options = self.create_options() option = dmenu(options, args=args, path=path) if option: self.handle_option(option, options)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def menuItem(*args):\n\toptionsWindow()", "def optionMenu(*args, alwaysCallChangeCommand: bool=True, annotation: Union[AnyStr, bool]=\"\",\n backgroundColor: Union[List[float, float, float], bool]=None, beforeShowPopup:\n Script=None, changeCommand: Script=None, defineTemplate: AnyStr...
[ "0.65391994", "0.64011323", "0.6330111", "0.6309242", "0.62822783", "0.6005424", "0.60025024", "0.5913053", "0.5886426", "0.58417106", "0.57628626", "0.57540554", "0.5687309", "0.56249946", "0.5620401", "0.5612325", "0.5583547", "0.55540794", "0.5524454", "0.5461041", "0.5457...
0.68001723
0
Builds a simple TCN model for a classification task
def build_model(sequence_length: int, channels: int, filters: List[int], num_classes:int, kernel_size: int, return_sequence:bool = False): inputs = Input(shape=(sequence_length, channels), name="inputs") tcn_block = TCN(filters, ke...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def build_simple_cnn_text_classifier(\n tok2vec, nr_class, exclusive_classes: bool = ..., **cfg\n):\n ...", "def build_classifier_model():\n model = keras.Sequential([\n keras.layers.SimpleRNN(64, input_shape=(\n special_train_data.shape[1], special_train_data.shape[2])),\n kera...
[ "0.71211946", "0.69382614", "0.6906103", "0.68612593", "0.68130636", "0.67430156", "0.6741936", "0.6705188", "0.67038774", "0.6694892", "0.66709346", "0.6634681", "0.66216224", "0.6617651", "0.6607445", "0.6606493", "0.65538424", "0.6550777", "0.65458614", "0.653813", "0.6536...
0.63886184
35
Return a MatchUp dataset object for testing
def return_MatchUpTest_r__(): #################################################################################################################### # 1. Initialise test data #################################################################################################################### values = arr...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test(self) -> tf.contrib.data.Dataset:\n return self.__test_dataset", "def get_dataset(self):\n if self.mode == \"test\":\n return OnlineQueryDataset(self.mode, self.df, self.tokenizer)\n else:\n return OnlineQueryDataset(self.mode, self.df_reindex, self.tokenizer)"...
[ "0.60991913", "0.59801537", "0.590321", "0.58124125", "0.5796239", "0.5700579", "0.5692139", "0.56579125", "0.5635389", "0.56350327", "0.5593532", "0.5573973", "0.55623806", "0.5521337", "0.55109745", "0.5507842", "0.55040926", "0.5502235", "0.547906", "0.5468841", "0.5455943...
0.54437053
22
Return a MatchUp dataset object for testing
def return_MatchUpTest_rsw(): #################################################################################################################### # 1. Initialise test data #################################################################################################################### w2_matchup1 ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test(self) -> tf.contrib.data.Dataset:\n return self.__test_dataset", "def get_dataset(self):\n if self.mode == \"test\":\n return OnlineQueryDataset(self.mode, self.df, self.tokenizer)\n else:\n return OnlineQueryDataset(self.mode, self.df_reindex, self.tokenizer)"...
[ "0.6105403", "0.59885746", "0.5901588", "0.5820917", "0.5801885", "0.57081044", "0.5693726", "0.56677276", "0.56453776", "0.564505", "0.5599134", "0.55832756", "0.5564017", "0.552816", "0.55132306", "0.5511637", "0.55106306", "0.55045444", "0.54888856", "0.54743016", "0.54616...
0.0
-1
Return a MatchUp dataset object for testing
def return_MatchUpTest___w(): #################################################################################################################### # 1. Initialise test data #################################################################################################################### w1 = array([...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test(self) -> tf.contrib.data.Dataset:\n return self.__test_dataset", "def get_dataset(self):\n if self.mode == \"test\":\n return OnlineQueryDataset(self.mode, self.df, self.tokenizer)\n else:\n return OnlineQueryDataset(self.mode, self.df_reindex, self.tokenizer)"...
[ "0.6102343", "0.5986422", "0.5898837", "0.58181185", "0.5799401", "0.570617", "0.56921023", "0.5665207", "0.56421", "0.564138", "0.55963594", "0.5580343", "0.5563257", "0.55256814", "0.55107045", "0.5510297", "0.55078745", "0.55020255", "0.54860723", "0.5471566", "0.5458956",...
0.0
-1
Test for Transform2NormInd.run() for test ``eopy.matchup.matchupIO.MatchUp`` object with data for multiple matchup series random uncertainty type only
def test_run_multi_r__(self): # Test Description # ================ # # 1. This test intialises an example *eopy.matchup.matchupIO.MatchUp* object # # 2. Compare transformed dataset to expected value ##############################################################...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def return_MatchUpTest_r__():\n\n ####################################################################################################################\n # 1. Initialise test data\n ####################################################################################################################\n\n v...
[ "0.618169", "0.61430645", "0.59169275", "0.57321066", "0.57125336", "0.5702606", "0.5576436", "0.55339223", "0.5435399", "0.54145247", "0.53927404", "0.53498745", "0.534863", "0.5331139", "0.5256002", "0.5251248", "0.5210866", "0.5170504", "0.5157448", "0.51404893", "0.511381...
0.68906015
0
Test for Transform2NormInd.run() for test ``eopy.matchup.matchupIO.MatchUp`` object with data for multiple matchup series random uncertainty type only
def test_run_single___w(self): # Test Description # ================ # # 1. This test intialises an example *eopy.matchup.matchupIO.MatchUp* object # # 2. Compare transformed dataset to expected value #############################################################...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_run_multi_r__(self):\n\n # Test Description\n # ================\n #\n # 1. This test intialises an example *eopy.matchup.matchupIO.MatchUp* object\n #\n # 2. Compare transformed dataset to expected value\n\n ################################################...
[ "0.68889105", "0.6180161", "0.5917096", "0.57318056", "0.5712777", "0.5701163", "0.55743426", "0.5532345", "0.5433569", "0.5414042", "0.53910625", "0.5350428", "0.5347398", "0.5328523", "0.5253318", "0.52499676", "0.52101165", "0.5169099", "0.51579434", "0.5140735", "0.511289...
0.61428434
2
A simple NonRepairableRBD with three intermediate nodes in series.
def rbd_series() -> NonRepairableRBD: edges = [(1, 2), (2, 3), (3, 4), (4, 5)] reliabilities = { 2: surv.Weibull.from_params([20, 2]), 3: surv.Weibull.from_params([100, 3]), 4: surv.Weibull.from_params([50, 20]), } return NonRepairableRBD(edges, reliabilities)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def rbd_repeated_component_parallel() -> NonRepairableRBD:\n edges = [(1, 2), (1, 3), (1, 4), (1, 5), (2, 6), (3, 6), (4, 6), (5, 6)]\n reliabilities = {\n 2: FixedEventProbability.from_params(1 - 0.8),\n 3: FixedEventProbability.from_params(1 - 0.9),\n 4: FixedEventProbability.from_para...
[ "0.6469559", "0.64268315", "0.6084605", "0.57024527", "0.5674748", "0.56264883", "0.56160796", "0.5606025", "0.56040335", "0.5561237", "0.5558424", "0.5544655", "0.54072654", "0.5387844", "0.53377455", "0.53331965", "0.52934223", "0.5282019", "0.52817273", "0.52617866", "0.52...
0.6040757
3
A simple NonRepairableRBD with three intermediate nodes in parallel.
def rbd_parallel() -> NonRepairableRBD: edges = [(1, 2), (1, 3), (1, 4), (2, 5), (3, 5), (4, 5)] reliabilities = { 2: FixedEventProbability.from_params(1 - 0.8), 3: FixedEventProbability.from_params(1 - 0.9), 4: FixedEventProbability.from_params(1 - 0.85), } return NonRepairableR...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def rbd_repeated_component_parallel() -> NonRepairableRBD:\n edges = [(1, 2), (1, 3), (1, 4), (1, 5), (2, 6), (3, 6), (4, 6), (5, 6)]\n reliabilities = {\n 2: FixedEventProbability.from_params(1 - 0.8),\n 3: FixedEventProbability.from_params(1 - 0.9),\n 4: FixedEventProbability.from_para...
[ "0.6714331", "0.6077196", "0.5871187", "0.5761095", "0.575306", "0.57487047", "0.5707745", "0.5683427", "0.56822884", "0.5626346", "0.5609467", "0.5545553", "0.553127", "0.55290705", "0.55273926", "0.55230594", "0.5517176", "0.55019444", "0.547357", "0.5447232", "0.54407746",...
0.7042741
0
Example 6.10 from Modarres & Kaminskiy.
def rbd1() -> NonRepairableRBD: qp = 0.03 qv = 0.01 edges = [ ("source", "pump1"), ("source", "pump2"), ("pump1", "valve"), ("pump2", "valve"), ("valve", "sink"), ] reliabilities = { "pump1": FixedEventProbability.from_params(qp), "pump2": Fixe...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_pagination(self):\n self.check_pagination()", "def paginated(self) -> global___Snippet.Paginated:", "def test_pagination(self):\n for page in range(1, 5):\n self._test_one_page(page=page)", "def index(request):\n\n queryset_list = Todo.objects.all() #.order_by(\"-timestam...
[ "0.6430027", "0.63266945", "0.5850248", "0.58150655", "0.5708066", "0.56947297", "0.5693278", "0.56105494", "0.5602378", "0.5580202", "0.5572011", "0.55451834", "0.55417097", "0.5530029", "0.5465714", "0.5439728", "0.5436072", "0.54357344", "0.5380605", "0.5379788", "0.534536...
0.0
-1
Fig. 16.1 from "UNIT 16 RELIABILITY EVALUATION OF COMPLEX SYSTEMS" by
def rbd3() -> NonRepairableRBD: edges = [ (0, 1), (0, 3), (1, 2), (3, 4), (1, 5), (3, 5), (5, 2), (5, 4), (2, 6), (4, 6), ] reliabilities = { 1: FixedEventProbability.from_params(1 - 0.95), 2: FixedEventProbabili...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def exercise_b2_106():\r\n pass", "def exercise_b2_113():\r\n pass", "def exercise_b2_53():\r\n pass", "def exercise_b2_93():\r\n pass", "def exercise_b2_70():\r\n pass", "def exercise_b2_95():\r\n pass", "def exercise_b2_107():\r\n pass", "def exercise_b2_98():\r\n pass", "...
[ "0.64974594", "0.6486075", "0.6471702", "0.6450107", "0.64436185", "0.6400729", "0.6381994", "0.6331832", "0.6328109", "0.6320709", "0.6289737", "0.62463313", "0.61991066", "0.61939657", "0.6116703", "0.60365844", "0.6014344", "0.60068136", "0.5940624", "0.5919313", "0.584285...
0.0
-1
Basically rbd_parallel with a repeated component (component 2).
def rbd_repeated_component_parallel() -> NonRepairableRBD: edges = [(1, 2), (1, 3), (1, 4), (1, 5), (2, 6), (3, 6), (4, 6), (5, 6)] reliabilities = { 2: FixedEventProbability.from_params(1 - 0.8), 3: FixedEventProbability.from_params(1 - 0.9), 4: FixedEventProbability.from_params(1 - 0.8...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def rbd_parallel() -> NonRepairableRBD:\n edges = [(1, 2), (1, 3), (1, 4), (2, 5), (3, 5), (4, 5)]\n reliabilities = {\n 2: FixedEventProbability.from_params(1 - 0.8),\n 3: FixedEventProbability.from_params(1 - 0.9),\n 4: FixedEventProbability.from_params(1 - 0.85),\n }\n return No...
[ "0.66087776", "0.59290457", "0.5882417", "0.5852172", "0.5571424", "0.5562024", "0.55331624", "0.544469", "0.537368", "0.5371877", "0.5354507", "0.5273932", "0.5170079", "0.51246303", "0.50607854", "0.5056613", "0.50508237", "0.50475144", "0.50254637", "0.5022691", "0.4972075...
0.7394611
0
Example 6.10 from Modarres & Kaminskiy, w/ valve k=2.
def rbd1_koon() -> NonRepairableRBD: qp = 0.03 qv = 0.01 edges = [ ("source", "pump1"), ("source", "pump2"), ("pump1", "valve"), ("pump2", "valve"), ("valve", "sink"), ] reliabilities = { "pump1": FixedEventProbability.from_params(qp), "pump2":...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def k(x):\n if x < 3:\n return 1\n else:\n return 3", "def kthsmall(v, k):\n n=len(v)\n k-=1\n if k<0 or k >= n:\n return -1\n l=0\n u=n-1\n while True:\n m=part(v,l,u)\n if m==k: return v[m]\n if m<k: l = m+1\n else: u=m-1", "def test_k_rank_approximate(corpus):\n r...
[ "0.60299236", "0.59745216", "0.595954", "0.59423935", "0.584232", "0.57831573", "0.5767858", "0.5766451", "0.5740797", "0.57142466", "0.5708032", "0.56949073", "0.5677055", "0.56758654", "0.5663218", "0.5658442", "0.56492513", "0.56461674", "0.5622466", "0.56185037", "0.56175...
0.0
-1
rbd2 but k of node 7 is =2.
def rbd2_koon() -> NonRepairableRBD: edges = [(1, 2), (2, 3), (2, 4), (4, 7), (3, 5), (5, 6), (6, 7), (7, 8)] reliabilities = { 2: surv.Weibull.from_params([20, 2]), 3: surv.Weibull.from_params([100, 3]), 4: surv.Weibull.from_params([50, 20]), 5: surv.Weibull.from_params([15, 1.2...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def rbd3_koon2() -> NonRepairableRBD:\n edges, reliabilities = rbd3_nodes_edges_components()\n k = {2: 2}\n return NonRepairableRBD(edges, reliabilities, k)", "def rbd3_koon1() -> NonRepairableRBD:\n edges, reliabilities = rbd3_nodes_edges_components()\n k = {5: 2}\n return NonRepairableRBD(edg...
[ "0.64837515", "0.6033989", "0.58228284", "0.56298786", "0.5610498", "0.5605671", "0.55991936", "0.55821586", "0.5548604", "0.55299145", "0.5437083", "0.54195094", "0.53975606", "0.5387104", "0.53656757", "0.5359423", "0.5346822", "0.53252655", "0.53040564", "0.5302914", "0.52...
0.6389324
1
Fig. 16.1 from "UNIT 16 RELIABILITY EVALUATION OF COMPLEX SYSTEMS" by
def rbd3_koon1() -> NonRepairableRBD: edges, reliabilities = rbd3_nodes_edges_components() k = {5: 2} return NonRepairableRBD(edges, reliabilities, k)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def exercise_b2_106():\r\n pass", "def exercise_b2_113():\r\n pass", "def exercise_b2_53():\r\n pass", "def exercise_b2_93():\r\n pass", "def exercise_b2_70():\r\n pass", "def exercise_b2_95():\r\n pass", "def exercise_b2_107():\r\n pass", "def exercise_b2_98():\r\n pass", "...
[ "0.64974594", "0.6486075", "0.6471702", "0.6450107", "0.64436185", "0.6400729", "0.6381994", "0.6331832", "0.6328109", "0.6320709", "0.6289737", "0.62463313", "0.61991066", "0.61939657", "0.6116703", "0.60365844", "0.6014344", "0.60068136", "0.5940624", "0.5919313", "0.584285...
0.0
-1
Fig. 16.1 from "UNIT 16 RELIABILITY EVALUATION OF COMPLEX SYSTEMS" by
def rbd3_koon2() -> NonRepairableRBD: edges, reliabilities = rbd3_nodes_edges_components() k = {2: 2} return NonRepairableRBD(edges, reliabilities, k)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def exercise_b2_106():\r\n pass", "def exercise_b2_113():\r\n pass", "def exercise_b2_53():\r\n pass", "def exercise_b2_93():\r\n pass", "def exercise_b2_70():\r\n pass", "def exercise_b2_95():\r\n pass", "def exercise_b2_107():\r\n pass", "def exercise_b2_98():\r\n pass", "...
[ "0.6498275", "0.6486834", "0.64725345", "0.64507645", "0.6444394", "0.64013785", "0.6382778", "0.6332466", "0.63291615", "0.6320123", "0.6290228", "0.6246944", "0.6199687", "0.61948127", "0.61174875", "0.60374105", "0.60128015", "0.600762", "0.59412605", "0.59189135", "0.5842...
0.0
-1
Fig. 16.1 from "UNIT 16 RELIABILITY EVALUATION OF COMPLEX SYSTEMS" by
def rbd3_koon3() -> NonRepairableRBD: edges, reliabilities = rbd3_nodes_edges_components() k = {2: 2, 5: 2} return NonRepairableRBD(edges, reliabilities, k)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def exercise_b2_106():\r\n pass", "def exercise_b2_113():\r\n pass", "def exercise_b2_53():\r\n pass", "def exercise_b2_93():\r\n pass", "def exercise_b2_70():\r\n pass", "def exercise_b2_95():\r\n pass", "def exercise_b2_107():\r\n pass", "def exercise_b2_98():\r\n pass", "...
[ "0.6497635", "0.6486453", "0.6471992", "0.6449999", "0.6443822", "0.6400814", "0.6382336", "0.6332183", "0.63283956", "0.6321123", "0.6289827", "0.6246541", "0.6199174", "0.6194083", "0.61166835", "0.60365397", "0.6014905", "0.60070395", "0.5940377", "0.59195703", "0.58420813...
0.0
-1
A s31t NonRepairableRBD. Returns the {nodes, edges, reliabilities} dict, useful so k(4) can be changed.
def rbd_koon_parallel_args() -> dict: edges = [ ("s", 1), ("s", 2), ("s", 3), (1, "v"), (2, "v"), (3, "v"), ("v", "t"), ] reliabilities = { 1: FixedEventProbability.from_params(1 - 0.85), 2: FixedEventProbability.from_params(1 - 0.8), ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def rbd3() -> NonRepairableRBD:\n edges = [\n (0, 1),\n (0, 3),\n (1, 2),\n (3, 4),\n (1, 5),\n (3, 5),\n (5, 2),\n (5, 4),\n (2, 6),\n (4, 6),\n ]\n reliabilities = {\n 1: FixedEventProbability.from_params(1 - 0.95),\n 2:...
[ "0.63566744", "0.61939704", "0.6183409", "0.5971229", "0.5923295", "0.58287877", "0.57894695", "0.57524437", "0.56865156", "0.56339127", "0.55662555", "0.5546968", "0.55356383", "0.55251706", "0.5411057", "0.5369534", "0.5272418", "0.52036285", "0.5199326", "0.5199326", "0.51...
0.0
-1
A s2121t NonRepairableRBD. Returns the {nodes, edges, reliabilities} dict, useful so k("v1") and k("v2") can be changed.
def rbd_koon_composite_args() -> dict: edges = [ ("s", "a1"), ("s", "a2"), ("a1", "v1"), ("a2", "v1"), ("v1", "b1"), ("v1", "b2"), ("b1", "v2"), ("b2", "v2"), ("v2", "t"), ] reliabilities = { "a1": FixedEventProbability.from_par...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def rbd2_koon() -> NonRepairableRBD:\n edges = [(1, 2), (2, 3), (2, 4), (4, 7), (3, 5), (5, 6), (6, 7), (7, 8)]\n reliabilities = {\n 2: surv.Weibull.from_params([20, 2]),\n 3: surv.Weibull.from_params([100, 3]),\n 4: surv.Weibull.from_params([50, 20]),\n 5: surv.Weibull.from_para...
[ "0.6541109", "0.62995857", "0.6245844", "0.6200806", "0.5809427", "0.57995814", "0.5757092", "0.57419133", "0.5635102", "0.56157184", "0.5562107", "0.5405884", "0.53785056", "0.5335042", "0.5329623", "0.5286221", "0.518313", "0.51592094", "0.5080275", "0.5080275", "0.5011181"...
0.44809136
86
NonRepairableRBD that can easily trap an algorithm into including a nonminimal pathset.
def rbd_koon_nonminimal_args() -> dict: edges = [("s", 1), (1, 2), (2, "t"), (1, 3), (3, 4), (4, 5), (5, 2)] reliabilities = { 1: FixedEventProbability.from_params(1 - 0.85), 2: FixedEventProbability.from_params(1 - 0.8), 3: FixedEventProbability.from_params(1 - 0.9), 4: FixedEve...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def findPathsToBase(A,bSize):\n M,N = A.shape\n pressedPaths = []\n\n #For every two nodes in the base find all paths between them\n for b1 in range(bSize):\n for b2 in range(bSize):\n #Remove all other base nodes from the graph so that\n #we only find paths that go through...
[ "0.5449761", "0.52811486", "0.5208564", "0.5168064", "0.5162988", "0.51568395", "0.5100747", "0.5063701", "0.5040022", "0.5039273", "0.5003334", "0.4956348", "0.493884", "0.49005526", "0.48649785", "0.48636755", "0.48515064", "0.48509452", "0.4834413", "0.48296255", "0.480976...
0.0
-1
NonRepairableRBD arguments that make for a 12121 NonRepairableRBD.
def rbd_double_parallel_args() -> dict: edges = [ ("s", 1), ("s", 2), (1, 3), (2, 3), (3, 4), (3, 5), (4, "t"), (5, "t"), ] reliabilities = { 1: FixedEventProbability.from_params(1 - 0.85), 2: FixedEventProbability.from_params(1...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _fill_reserved(self) -> None:\n\n mpi_like_settings = [\n MpirunSettings,\n MpiexecSettings,\n OrterunSettings,\n PalsMpiexecSettings,\n ]\n for settings in mpi_like_settings:\n self._reserved_run_args[settings] = [\n \"...
[ "0.6048893", "0.5647877", "0.5194115", "0.51527035", "0.51167774", "0.5028656", "0.48770243", "0.48340666", "0.48278674", "0.48270103", "0.48165074", "0.48086333", "0.47527084", "0.47426146", "0.47352806", "0.47196856", "0.4709852", "0.46833894", "0.46754393", "0.4664449", "0...
0.0
-1
Compute the intersection area of a numpy array of boxes and a single box.
def intersection(boxes, box): ix = np.maximum(0, np.minimum(box[2], boxes[:,2]) - np.maximum(box[0], boxes[:,0])) iy = np.maximum(0, np.minimum(box[3], boxes[:,3]) - np.maximum(box[1], boxes[:,1])) return ix*iy
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def compute_inters(box, boxes, box_area):\n # Calculate intersection areas\n y1 = np.maximum(box[0], boxes[:, 0])\n y2 = np.minimum(box[2], boxes[:, 2])\n x1 = np.maximum(box[1], boxes[:, 1])\n x2 = np.minimum(box[3], boxes[:, 3])\n return np.divide(np.maximum(x2 - x1, 0) * np.maximum(y2 - y1, 0)...
[ "0.7640445", "0.73185265", "0.7236327", "0.7168402", "0.7168402", "0.7132642", "0.7098993", "0.70911914", "0.7082353", "0.70558786", "0.696013", "0.6940942", "0.6880113", "0.68699026", "0.6814332", "0.68049055", "0.6767781", "0.66969436", "0.66479206", "0.66479206", "0.664419...
0.78136355
0
Crop an image to a given area and transform target accordingly.
def crop(sample, crop_area, in_crop_threshold): transformed_sample = {} crop_area = np.array(crop_area) bboxes = sample["bboxes"] intersections = intersection(bboxes, crop_area) bbox_areas = (bboxes[:,2:] - bboxes[:,:2]).prod(axis=1) in_crop = (intersections/bbox_areas > in_crop_threshold) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def crop_image(input_image, output_image, start_x, start_y, width, height):\n box = (start_x, start_y, start_x + width, start_y + height)\n output_img = img.crop(box)\n output_img.save(output_image +\".png\")", "def crop_to_target(x, target):\n\n if target.ndim==3:\n t_h, t_w = target.shape[1]...
[ "0.7249574", "0.7102095", "0.69499886", "0.68971294", "0.6881923", "0.6724614", "0.6645402", "0.6645402", "0.6605522", "0.66024446", "0.6594706", "0.6582623", "0.65712684", "0.6554446", "0.6519422", "0.64856726", "0.6482021", "0.64787054", "0.64579284", "0.6450153", "0.644404...
0.5892808
57
Resize an image to given dimensions and transform the target accordingly.
def resize(sample, target_image_size, bbox_diag_threshold): transformed_sample = {} image = sample["image"] scale_factors = np.array(target_image_size)/np.array(_size(image)) bboxes = sample["bboxes"] bboxes = bboxes * np.tile(scale_factors, 2) not_too_small = np.linalg.norm(bboxes[:,2:] - bbo...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def resize(image_path, target_dimensions, image_format):\n with Image.open(image_path) as img:\n img = img.resize(target_dimensions, resample=Image.LANCZOS)\n if image_format == 'PNG':\n img = img.convert('RGBA')\n else:\n img = img.convert('RGB')\n img.save(ima...
[ "0.73642147", "0.7287396", "0.72173774", "0.71214217", "0.7111653", "0.7009032", "0.69824106", "0.6782985", "0.6747425", "0.67268914", "0.66843146", "0.66701424", "0.66636115", "0.6641147", "0.6636635", "0.6615918", "0.66053194", "0.65742534", "0.6569193", "0.65666544", "0.65...
0.0
-1
ensures that the correct number of keys and values are emitted
def test_has_correct_number_of_keys_and_values(self): self.has_correct_number_of_keys_and_values(2, 1)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_reduce(key, values):\n yield \"%s: %d\\n\" % (key, len(values))", "def iter_values_len(self):\n for key, values in self.data.items():\n yield key, len(values)", "def reduce_length(key, values):\n yield str((key, len(values)))", "def reducer(key, vals):\n count = 0\n for p i...
[ "0.5706788", "0.57027614", "0.55487025", "0.54131407", "0.539261", "0.53575903", "0.5339979", "0.5187678", "0.5187663", "0.5140506", "0.5138147", "0.5101639", "0.5050154", "0.50461453", "0.50327146", "0.50267106", "0.50193614", "0.4986483", "0.49846265", "0.49811524", "0.4981...
0.60382676
0
ensures that a line is emitted for each word in each file
def test_emits_line_for_each_word_in_each_file(self): with open(self.default_fixture) as f: output = self.run_mapper() input = f.readlines() num_files = len(input) total_words = 0 for line in input: total_words += len(line.strip().split...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def word_runner(self):\n with open(self.filename) as doc:\n text = doc.readlines()\n for line in text:\n for word in line.split():\n yield word", "def word_iterator(folder):\n for filename in glob.glob(os.path.join(folder, \"*.txt\")):\n with codecs.op...
[ "0.6799167", "0.6284839", "0.61223036", "0.60836124", "0.60295254", "0.5902215", "0.5849417", "0.5822456", "0.57699835", "0.57522106", "0.569624", "0.56763154", "0.56692684", "0.5667381", "0.56594104", "0.56553334", "0.5640591", "0.56372964", "0.56246144", "0.5605495", "0.559...
0.6906594
0
tests that 1 is appended to each line of output
def test_appends_one(self): ends_with_one = '.*1$' self.are_all_matches(re.compile(ends_with_one))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def outputStatus(self, line):\r\n for l in line.strip('\\r\\n').split('\\n'):\r\n self.output('%s: %s' % (ctime(), l), 0)", "def out(value):\n output.append(value)\n return False", "def flush_output():\n if len(buffered) == 1:\n code.add_line(\"append_result(%s)\" % b...
[ "0.61662585", "0.59604585", "0.57874274", "0.5667662", "0.56272227", "0.56033826", "0.5602316", "0.5590414", "0.5580968", "0.5541745", "0.55312794", "0.5523322", "0.55218935", "0.54936326", "0.54936326", "0.54936326", "0.54936326", "0.54936326", "0.54936326", "0.54883444", "0...
0.525319
43
ensures that the correct number of keys and values are emitted
def test_has_correct_number_of_keys_and_values(self): self.has_correct_number_of_keys_and_values(2, 1)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_reduce(key, values):\n yield \"%s: %d\\n\" % (key, len(values))", "def iter_values_len(self):\n for key, values in self.data.items():\n yield key, len(values)", "def reduce_length(key, values):\n yield str((key, len(values)))", "def reducer(key, vals):\n count = 0\n for p i...
[ "0.5707167", "0.5701873", "0.55485255", "0.5414439", "0.5392383", "0.53581417", "0.5340053", "0.51869917", "0.5186937", "0.51407546", "0.5138803", "0.51028943", "0.5050025", "0.5047798", "0.5033274", "0.5025732", "0.5018922", "0.49879548", "0.49855825", "0.49825802", "0.49825...
0.6038293
1
tests that each line is accounted for in the sum produced as output
def test_sum_of_output_equals_length_of_input(self): output_total_sum = 0 for line in self.run_reducer_tokenize(): output_total_sum += int(line[1][0]) with open(self.default_fixture) as f: input_len = len(f.readlines()) self.assertEqual(output_total_sum, input...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_expected_sum(inputs, expected):\n print(\"\\nRunning test_expected with {} as input and {} as expected output\".format(inputs, expected))\n assert inputs[0] + inputs[1] == expected", "def test_sum(n, m, o, result):\n from series import sum_series\n assert sum_series(n, m, o) == result", "d...
[ "0.6509527", "0.61868066", "0.61228985", "0.59584236", "0.59546816", "0.5910473", "0.59024125", "0.58850664", "0.5883609", "0.5875183", "0.585172", "0.58443475", "0.58325183", "0.5818679", "0.58184326", "0.58069396", "0.5782557", "0.5773281", "0.57656586", "0.5758806", "0.573...
0.6357645
1
copies the current's object polygon to a new target_class
def copy_site_poly_view(request): CLASSES = { 'Site': Site, 'ResearchEvent': ResearchEvent, 'ArchEnt': ArchEnt, 'MonumentProtection': MonumentProtection, } current_id = request.GET.get('current-id', '') current_class = request.GET.get('current-class', '') target_cla...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def deepcopy(self, exterior=None, label=None, **kwargs):\n return Polygon(\n exterior=np.copy(self.exterior) if exterior is None else exterior,\n label=self.label if label is None else label,\n **kwargs\n )", "def copy(self):\n return type(self)(self._geojson...
[ "0.6006419", "0.5972897", "0.5870376", "0.55767095", "0.5563367", "0.55278015", "0.55184525", "0.54930973", "0.5431373", "0.54146475", "0.54030544", "0.5359345", "0.5356176", "0.5337278", "0.52976567", "0.5295898", "0.5295589", "0.5265743", "0.5262307", "0.52414525", "0.52370...
0.57748646
3
General interactive prompt to guide the user through data collection.
def prompt(): # Inform the user on what price data has been taken print("\nCurrent available historical data for calibration: ") data_files = listdir('call_data/') for i in range(len(data_files)): print(data_files[i]) # Ask the user if they would like to sample more points done = False while done != True: i...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def build_dataset_prompt():\n\n print(\"\")\n print(\"Let's start by choosing what features you'd like to look at/explore!\")", "def do_prompt(self):\n # we need _something_ in the dictionary even if the user decides to use all defaults\n # otherwise for some unknown reason it won't work\n ...
[ "0.70390576", "0.66458213", "0.6361144", "0.6237969", "0.62158227", "0.6172849", "0.6152461", "0.61271065", "0.6122236", "0.6117527", "0.6057254", "0.6041768", "0.603955", "0.60375905", "0.5943918", "0.5861413", "0.5837267", "0.5837267", "0.58278203", "0.5807767", "0.5795216"...
0.65522325
2
Allows the user to select which portfolios to analyze
def analyze(): # Analyze the available data coins = '' params = [] done = False while done != True: S_0_dat, K_dat, V_dat, T, coin = analysis.load() theta, T = analysis.LM(S_0_dat, K_dat, V_dat, T) params.append([theta, T, coin]) if coins == '': coins = coin else: coins += ', ' + coin + '.' try:...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def project_visibility_menu():\n projects = [i.split('.')[0] for i in os.listdir('HousingPriceScraper/HousingPriceScraper/spiders/SpiderGroups')[:-1]]\n print('Available projects are:\\n')\n for project in enumerate(projects):\n print('\\t{} - {}'.format(project[0], project[1]))\n print('\\t{} -...
[ "0.56866527", "0.56662923", "0.54835486", "0.5365236", "0.530161", "0.5246109", "0.5241945", "0.5217639", "0.52151227", "0.5170465", "0.515381", "0.5141848", "0.5120152", "0.5090627", "0.5072182", "0.50395954", "0.5031503", "0.50193703", "0.50174224", "0.4972539", "0.49604633...
0.0
-1
Simple script for obaining the amount desired to invest
def invest(): done = False while done != True: inp = input("\nInitial investment into Crypto market: ") try: S_0 = float(inp) done = True except Exception: print("Unable to convert to suitable format. Please try again.") return S_0
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def deposit(amt) :\r\n\tglobal bal\r\n\tbal_in = bal\r\n\t#PREMISES FOR NEXT LINE: \r\n\t# (amt >= 0)\r\n\t# (bal >= 0)\r\n\t# (bal == bal_in)\r\n\tbal = bal + amt\r\n\t#PREMISES FOR ATTACHED PROOF, IF ANY: \r\n\t# (bal == (bal_old + amt))\r\n\t# (amt >= 0)\r\n\t# (bal_old >= 0)\r\n\t# (bal_old == bal_in)\r\n\t#PR...
[ "0.6801968", "0.6597183", "0.6584977", "0.63846654", "0.6377838", "0.63749546", "0.6327555", "0.629521", "0.6278848", "0.62471265", "0.6238845", "0.6189341", "0.6188443", "0.6178253", "0.6167095", "0.6157759", "0.6147748", "0.614369", "0.6135853", "0.6080904", "0.6078427", ...
0.5987601
35
This script analyzes possible portfolios based on the calculated parameters on the observed data, and the user inputted investment.
def generate_portfolio(S_0, params): public_client = gdax.PublicClient() allvar = [] sumvar = 0 for coin in params: theta = coin[0] v = theta[0] T = coin[1] prod_id = coin[2] # Get the current value of the coin, i.e. how much you bought name = prod_id + '-USD' stats = public_client.get_product_24hr_st...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def before_trading_start(context, data):\n factors = pipeline_output('ff_example')\n\n # get the data we're going to use\n returns = factors['returns']\n mkt_cap = factors.sort_values(['market_cap'], ascending=True)\n be_me = factors.sort_values(['be_me'], ascending=True)\n\n # to compose the six...
[ "0.6095031", "0.5822337", "0.58005035", "0.5798782", "0.5752552", "0.57133955", "0.5679745", "0.56412446", "0.5630844", "0.5596643", "0.5596643", "0.5586385", "0.55733144", "0.55497605", "0.55235076", "0.54996634", "0.54918146", "0.5452439", "0.54508233", "0.54480547", "0.537...
0.5986981
1
Convert the character in the [ ] for a task into a TaskStatus
def _get_status_from_char(char: str) -> TaskStatus: if char == "c": return TaskStatus.CANCELED elif char == "b": return TaskStatus.BLOCKED elif char == " ": return TaskStatus.UNSCHEDULED elif char == "x": return TaskStatus.DONE elif char == "?": return TaskSta...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def task_status():\n pass", "def task_status(self) -> str:\n return self._task_status", "async def get_task_status(task_id: TaskId):", "def fuota_task_status(self) -> Optional[str]:\n return pulumi.get(self, \"fuota_task_status\")", "def _parse_status(self, status):\n if status in (...
[ "0.6113151", "0.60610837", "0.5982466", "0.58361703", "0.5676092", "0.562448", "0.5620659", "0.5590581", "0.5534794", "0.5493304", "0.5449712", "0.5449053", "0.5443019", "0.54307556", "0.54105866", "0.53677195", "0.5367107", "0.53506756", "0.53475046", "0.5340073", "0.5264325...
0.7188169
0
Slices a panel once at an angle into two new panels
def single_slice_panels(page, horizontal_vertical=None, type_choice=None, skew_side=None, number_to_slice=0 ): # Remove panels which are too small relevant_panels = [] if len(page.childre...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _slice_at_axis(sl, axis):\n return (slice(None),) * axis + (sl,) + (...,)", "def animate_slices_multi(field='uu1', datadir1='data/', datadir2='data/', proc=-1, extension='xz',\n format='native', tmin=0., tmax=1.e38, wait=0.,\n amin=0., amax=1., transform='', oldfile=Fal...
[ "0.57020974", "0.5570688", "0.5558747", "0.545153", "0.5445056", "0.543105", "0.535599", "0.5348452", "0.5087993", "0.50807226", "0.50238377", "0.50055045", "0.5003114", "0.49961782", "0.49961782", "0.49851263", "0.49696037", "0.49594927", "0.49540603", "0.49380317", "0.49127...
0.63570553
0
This function move panel boundaries to transform them into trapezoids and rhombuses
def box_transform_panels(page, type_choice=None, pattern=None): if type_choice is None: type_choice_prob = np.random.random() if type_choice_prob < cfg.panel_box_trapezoid_ratio: type_choice = "trapezoid" else: type_choice = "rhombus" if type_choice == "trapezoi...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def adjust_mario_position(self):\n self.last_x_position = self.mario.rect.right\n self.mario.rect.x += round(self.mario.x_vel)\n self.check_mario_x_collisions()\n\n if self.mario.in_transition_state == False:\n self.mario.rect.y += round(self.mario.y_vel)\n self.check_mario_y_collisions()...
[ "0.6025496", "0.5948489", "0.58940256", "0.5790465", "0.5725575", "0.56771463", "0.5674935", "0.567056", "0.5657837", "0.56499887", "0.56087935", "0.55989015", "0.5590386", "0.55410814", "0.55279523", "0.54960006", "0.54941237", "0.54902667", "0.54861367", "0.5482337", "0.548...
0.5458356
21
This function takes all the first child panels of a page and moves them to form a zigzag or a rhombus pattern
def box_transform_page(page, direction_list=[]): if len(page.children) > 1: # For all children of the page for idx in range(0, len(page.children)-1): # Take two children at a time p1 = page.get_child(idx) p2 = page.get_child(idx+1) change_proportio...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def box_transform_panels(page, type_choice=None, pattern=None):\n\n if type_choice is None:\n type_choice_prob = np.random.random()\n if type_choice_prob < cfg.panel_box_trapezoid_ratio:\n type_choice = \"trapezoid\"\n else:\n type_choice = \"rhombus\"\n\n if type_c...
[ "0.6271615", "0.54973686", "0.5387132", "0.5235147", "0.52252686", "0.5174454", "0.5173184", "0.5033678", "0.5033185", "0.5014299", "0.5011081", "0.50006324", "0.49946687", "0.49603772", "0.49424213", "0.49365565", "0.49298054", "0.49220905", "0.49138784", "0.48819068", "0.48...
0.62816256
0
Adds panel boundary transformations to the page
def add_transforms(page): # Transform types # Allow choosing multiple transform_choice = ["slice", "box"] # Slicing panels into multiple panels # Works best with large panels if "slice" in transform_choice: page = single_slice_panels(page) # Makes v cuts happen more often 1/4 ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_main_panel(self):\n self.panel = wx.Panel(self)\n\n self.init_plot()\n self.canvas = FigCanvas(self.panel, -1, self.fig)\n\n self.control_box = VSControlBox(self.panel, -1, 'Information board')\n\n self.vbox = wx.BoxSizer(wx.VERTICAL)\n self.vbox.Add(self.canvas...
[ "0.5654674", "0.55271375", "0.5385923", "0.5355535", "0.53435576", "0.53429335", "0.5328772", "0.52715266", "0.5230099", "0.52209806", "0.5134633", "0.50963074", "0.50835866", "0.506619", "0.5044313", "0.50324744", "0.5028184", "0.5028184", "0.5023393", "0.500031", "0.4988787...
0.605634
0
Convert a package (as found by setuptools.find_packages) e.g. "foo.bar" to usable path e.g. "foo/bar" No idea if this works on windows
def package_to_path(package): return package.replace('.','/')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_package_path():\n package_name = get_package_name()\n return package_name.replace('.', '/')", "def get_packages_path_from_package(package):\n root = finder.get_package_root(package)\n\n if is_built_package(package):\n package_name_folder = os.path.dirname(root)\n\n return os.pat...
[ "0.7921618", "0.7368294", "0.7326123", "0.70896804", "0.70801365", "0.6791065", "0.6757227", "0.67504627", "0.6700731", "0.66353977", "0.66276276", "0.6621615", "0.6564424", "0.6564424", "0.65590894", "0.6505718", "0.63585734", "0.6354153", "0.62997335", "0.6271722", "0.62491...
0.8622001
0
Get the subdirectories within a package This will include resources (nonsubmodules) and submodules
def find_subdirectories(package): try: subdirectories = next(os.walk(package_to_path(package)))[1] except StopIteration: subdirectories = [] return subdirectories
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def walk_package(pkgname, root):\n dirs = []\n files = []\n for name in pkg_resources.resource_listdir(pkgname, str(root)):\n fullname = root / name\n if pkg_resources.resource_isdir(pkgname, str(fullname)):\n dirs.append(fullname)\n else:\n files.append(Path(nam...
[ "0.7408176", "0.6981932", "0.6977739", "0.69128346", "0.6908319", "0.6908319", "0.6908319", "0.68290293", "0.67712396", "0.6679647", "0.6656998", "0.6650802", "0.66113985", "0.65714127", "0.65617687", "0.6516385", "0.65129155", "0.65035087", "0.6490898", "0.64712936", "0.6428...
0.7587221
0
Find all files in a subdirectory and return paths relative to dir This is similar to (and uses) setuptools.findall However, the paths returned are in the form needed for package_data
def subdir_findall(dir, subdir): strip_n = len(dir.split('/')) path = '/'.join((dir, subdir)) return ['/'.join(s.split('/')[strip_n:]) for s in setuptools.findall(path)]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _find_files_to_package(self, path):\n for root, dirs, files in os.walk(path):\n root_parts = pathlib.Path(root).relative_to(path).parts\n if self._include_directory(root_parts):\n for f in files:\n if self._include_file(root_parts, f):\n ...
[ "0.7423802", "0.73017514", "0.72350556", "0.7135453", "0.7109446", "0.7099377", "0.7064924", "0.70476", "0.70066994", "0.6970505", "0.6923695", "0.6891978", "0.6889596", "0.6840696", "0.6823787", "0.6811101", "0.68091035", "0.6807877", "0.68076265", "0.6768948", "0.67390597",...
0.7272002
2
For a list of packages, find the package_data This function scans the subdirectories of a package and considers all nonsubmodule subdirectories as resources, including them in the package_data Returns a dictionary suitable for setup(package_data=)
def find_package_data(packages): package_data = {} for package in packages: package_data[package] = [] for subdir in find_subdirectories(package): if '.'.join((package, subdir)) in packages: # skip submodules logging.debug("skipping submodule %s/%s" % (package, subdir...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_package_data(package):\n walk = [(dirpath.replace(package + os.sep, '', 1), filenames)\n for dirpath, dirnames, filenames in os.walk(package)\n if not os.path.exists(os.path.join(dirpath, '__init__.py'))]\n\n filepaths = []\n for base, filenames in walk:\n filepaths.ex...
[ "0.74882954", "0.7475205", "0.7218244", "0.7056486", "0.68890065", "0.68552727", "0.66472167", "0.6606134", "0.6553142", "0.6551368", "0.6509173", "0.62634075", "0.6203264", "0.6189386", "0.61807597", "0.6176723", "0.61635065", "0.6163499", "0.6126401", "0.6013186", "0.601318...
0.76023054
0
r"""Compute the fixed point as described in the paper by Botev et al.
def _fixed_point(t, N, squared_integers, grid_data_dct2): # ell = 7 corresponds to the 5 steps recommended in the paper ell = tf.constant(7, ztypes.float) # Fast evaluation of |f^l|^2 using the DCT, see Plancherel theorem f = ( tf.constant(0.5, ztypes.float) * tf.math.pow( t...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def fixed_point(is_zero, plus, minus, f, x):\n\n @memo_Y\n def _fixed_point(fixed_point_fun):\n def __fixed_point(collected, new):\n diff = minus(new, collected)\n if is_zero(diff):\n return collected\n return fixed_point_fun(plus(collected, diff), f(dif...
[ "0.7288447", "0.63831216", "0.6331708", "0.6310987", "0.62785643", "0.6213673", "0.6211178", "0.61968625", "0.6118697", "0.6110409", "0.6091076", "0.6086669", "0.59297514", "0.5889126", "0.5873738", "0.58619815", "0.5842633", "0.5819706", "0.5756298", "0.5717596", "0.5702371"...
0.56695026
25
Root finding algorithm. Based on MATLAB implementation by Botev et al. >>> From the matlab code >>> ints = np.arange(1, 51) >>> ans = _root(_fixed_point, N=50, args=(50, ints, ints)) >>> np.allclose(ans, 9.237610787616029e05) True
def _find_root(function, N, squared_integers, grid_data_dct2): # From the implementation by Botev, the original paper author # Rule of thumb of obtaining a feasible solution N2 = tf.math.maximum( tf.math.minimum(tf.constant(1050, ztypes.float), N), tf.constant(50, ztypes.float), ) t...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def find_root(function, point_a, point_b, step, tol, max_iterations, \n show_process = False):\n left_point , right_point = search_interval_3d(function, point_a, point_b, \n step, tol, max_iterations,\n ...
[ "0.73860395", "0.70872056", "0.6967801", "0.69340694", "0.69075763", "0.68714964", "0.6838874", "0.6783198", "0.67171526", "0.6622454", "0.6563255", "0.65425867", "0.64857024", "0.64850307", "0.64433384", "0.64288294", "0.6416696", "0.64105165", "0.64094615", "0.6380394", "0....
0.65467143
11
Generate the save path for an image. If a modifier string is provided, this is added between the existing name and the extension. e.g. fname="moon.jpeg" modstirng="cropped" > "moon_cropped.jpeg". This is then joined with the output directory. If no modiifer, just returns joined path of outdir and fname.
def genSavePath(outdir, fname, modstring=None): if modstring: base,ext = os.path.splitext(fname) fname = f"{base}_{modstring}.{ext}" writepath = os.path.join(outdir, fname) return writepath
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def output_filename(self, modifier):\n fs = self._filesystem\n output_filename = fs.join(self._root_output_dir, self._test_name)\n return fs.splitext(output_filename)[0] + modifier", "def name_final_path(out_img_folder):\n if out_img_folder == None:\n return \"./.out_hidden_images\...
[ "0.6506808", "0.61701065", "0.5883275", "0.5868304", "0.5847001", "0.5811345", "0.5766814", "0.5759355", "0.57464373", "0.57153183", "0.5675875", "0.5666476", "0.5665445", "0.5655566", "0.56509286", "0.5640137", "0.562522", "0.55997884", "0.55983824", "0.5587275", "0.55767787...
0.731317
0
Convert image to a regular baseline JPEG. Quality option is ignored if useexistingqtables=True.
def savebaselineJPEG(image, fname, outpath, optimize=True, quality=75, recompressed=False, useexistingqtables=False, preserve_name=False): if not preserve_name: if recompressed: fpath = genSavePath(outpath, fname, modstring=f"recompressed_q{quality}") else: fpath = genSavePa...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def convert_to_jpeg(image, quality=90):\n\n\t# Load the image into a new BytesIO\n\tsImg = BytesIO(image)\n\n\t# Create an empty BytesIO for the new image\n\tsNewImg = BytesIO(b'')\n\n\t# Create a new Pillow instance from the raw data\n\toImg = Pillow.open(sImg)\n\n\t# If the mode is not valid\n\tif oImg.mode not ...
[ "0.54743165", "0.54736084", "0.5438891", "0.54282427", "0.541862", "0.53912777", "0.53576815", "0.52602875", "0.5242374", "0.52363783", "0.52289176", "0.521572", "0.5162085", "0.51128095", "0.51099354", "0.5074247", "0.50239307", "0.5019632", "0.5016915", "0.5016185", "0.4993...
0.7245555
0
Save a rotated version of theimage.
def saverotation(image, fname, outpath, degreescounterlockwise=90, preserve_name=False): if not preserve_name: fpath = genSavePath(outpath, fname, modstring=f"rotated_{degreescounterlockwise}") else: fpath = genSavePath(outpath, fname) im = copy(image) im = im.rotate(degreescounterlockwi...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def rotate(image_path):\n try:\n with Image.open(image_path) as img:\n img = ImageOps.exif_transpose(img)\n img.save(image_path, format=img.format, quality=95)\n except Exception as e:\n log.warn(f'Cannot rotate input image: [{e}]')", "def apply_rotation(image):\n\n\t# L...
[ "0.70346487", "0.68889385", "0.682253", "0.6747778", "0.6635483", "0.6627623", "0.6563121", "0.6496392", "0.6405352", "0.63929117", "0.63382024", "0.6252712", "0.61955154", "0.61868703", "0.61305135", "0.6124323", "0.61061513", "0.60409236", "0.60030663", "0.5996765", "0.5981...
0.7409973
0
Save a scaled copy of the image, uses a single scale factor for both x,y axes to maintain aspect ratio
def saverescale(image, fname, outpath, scalefactor=0.5, preserve_name=False): if not preserve_name: fpath = genSavePath(outpath, fname, modstring=f"resize_{scalefactor}") else: fpath = genSavePath(outpath, fname) newsize = (int(image.width * scalefactor), int(image.height * scalefactor)) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def exportImg(self):\n if self.superSampling:\n print(\"Exporting with size adjusted\")\n self.img = self.img.resize((int(self.width/2),int(self.height/2)),Image.NEAREST)\n self.img.save(self.fileName,\"PNG\")", "def save_image_with_scale(path, variable):\n\n arr = variable...
[ "0.7007898", "0.69334567", "0.6804052", "0.6749671", "0.6498489", "0.64127666", "0.63798004", "0.6349806", "0.6243057", "0.62239367", "0.61422914", "0.6138981", "0.61325663", "0.61003655", "0.61003655", "0.6086245", "0.60752183", "0.6060752", "0.6048594", "0.60214186", "0.600...
0.6704548
4
Save a thumbnail of the image, preserves aspect ratio, so longest side will be of size[max(x,y)]
def savethumb(image, fname, outpath, size=(128,128), preserve_name=False): if not preserve_name: fpath = genSavePath(outpath, fname, modstring=f"thumbnail_{size[0]}_{size[1]}") else: fpath = genSavePath(outpath, fname) im = copy(image) im.thumbnail(size) try: im.save(fpath, s...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def make_thumbnail(filepath):\n img = Image.open(filepath)\n thumb = None\n w, h = img.size\n\n # if it is exactly 128x128, do nothing\n if w == 128 and h == 128:\n return True\n\n # if the width and height are equal, scale down\n if w == h:\n thumb = img.resize((128, 128), Image...
[ "0.6931515", "0.68739617", "0.68509567", "0.68389434", "0.6793269", "0.6591011", "0.6537345", "0.6449486", "0.6414779", "0.6377539", "0.6353064", "0.63198406", "0.6311073", "0.6295751", "0.6291895", "0.6244799", "0.6227591", "0.6221736", "0.6218256", "0.62178695", "0.6205242"...
0.7045417
0
Save a cropped version of the image.
def savecrop(image, fname, outpath, cropabsolute=None, cropfactors=[0.2, 0.2, 0.2, 0.2], preserve_name=False): if cropabsolute: if type(cropabsolute) != list: raise Exception("cropabsolute must be a list of length 4.") else: if len(cropabsolute) !=4: raise Exc...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def Save_Image_Crop(img, x, y, width, height, filename = None, path = 'Predictions'):\n img = img[y:y+height, x:x+width,:]\n\n if filename is not None:\n try: \n os.mkdir(path)\n except OSError as error: \n print('') \n fig, ax = plt.subplots(figsize=(18, 20))\n ...
[ "0.7306745", "0.69884664", "0.6980087", "0.6949157", "0.687741", "0.6825131", "0.6791875", "0.66822034", "0.66574806", "0.66544116", "0.66482884", "0.66326034", "0.65988314", "0.6507213", "0.6493506", "0.6481142", "0.6444658", "0.63948953", "0.6392374", "0.63720816", "0.63054...
0.70799524
1
Flip the image on the x or y axis
def saveflip(image, fname, outpath, axis='x', preserve_name=False): if not preserve_name: fpath = genSavePath(outpath, fname, modstring=f"mirror_{axis}") else: fpath = genSavePath(outpath, fname) im = copy(image) if axis == 'x': im = im.transpose(Image.FLIP_LEFT_RIGHT) elif a...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def flip_image(img, vert=True):\n if vert:\n return img.transpose(Image.FLIP_TOP_BOTTOM)\n else:\n return img.transpose(Image.FLIP_LEFT_RIGHT)", "def vflip(img):\n #if not _is_pil_image(img):\n # raise TypeError('img should be PIL Image. Got {}'.format(type(img)))\n\n return img.t...
[ "0.76031363", "0.75496536", "0.75196064", "0.751224", "0.7474454", "0.7395922", "0.7393975", "0.73869336", "0.7386315", "0.7383523", "0.7346391", "0.73111284", "0.72888714", "0.7244896", "0.72281134", "0.7200845", "0.7131485", "0.7130178", "0.7129639", "0.71281487", "0.712679...
0.71528536
16
Save a watermarked version of the image. resize watermark to 10% of the image height, with a minimum height of 40
def savewatermarked(image, fname, outpath, watermark, preserve_name=False): im = image.copy() if not preserve_name: fpath = genSavePath(outpath, fname, modstring=f"watermarked") else: fpath = genSavePath(outpath, fname) targetheight = int(image.height / 10) waterwidthscaler = wa...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_watermark(self, image, watermark, position='scale', opacity=1, format=None):", "def watermark(im, credits, opacity=1):\n # First resize mark to make it appropriate size\n logoURL = 'https://s3.amazonaws.com/static.thecrimson.com' + \\\n '/images/feature/thc-logo-large.png'\n imfile = Stri...
[ "0.7318583", "0.6755734", "0.66474384", "0.6608156", "0.6311425", "0.5929534", "0.5910654", "0.58472747", "0.58287114", "0.58228457", "0.5805072", "0.56639534", "0.5578972", "0.55572283", "0.5513554", "0.5510311", "0.55005735", "0.5479865", "0.5456375", "0.5421586", "0.541545...
0.78452754
0
Perform colour enhancements to the image.
def saveenhanced(image, fname, outpath, colourfactor=1, brightnessfactor=1, contrastfactor=1, sharpnessfactor=1, preserve_name=False): estring = "col{}br{}con{}sh{}".format(colourfactor, brightnessfactor, contrastfactor, sharpnessfactor) if not preserve_name: fpath = genSavePath(outpath, fname, modstri...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __enhance_image(self, img):\n\n blue = self.g.clahe.apply(img[:,:,0])\n green = self.g.clahe.apply(img[:,:,1])\n red = self.g.clahe.apply(img[:,:,2])\n img[:,:,0] = blue\n img[:,:,1] = green\n img[:,:,2] = red\n return img", "def _adjust_color_img(self, result...
[ "0.79571605", "0.67238367", "0.6699741", "0.66279745", "0.66164297", "0.6579595", "0.65684307", "0.64621973", "0.63937193", "0.63469017", "0.63373184", "0.63109785", "0.6228176", "0.61978406", "0.61928", "0.61690545", "0.61679554", "0.6136985", "0.6136281", "0.6107434", "0.60...
0.0
-1
Save a version of the file with an added border, controlled by the colour and width parameters.
def saveborder(image, fname, outpath, width=20, colour="black", preserve_name=False): im = image.copy() if not preserve_name: fpath = genSavePath(outpath, fname, modstring=f"border{width}{colour}") else: fpath = genSavePath(outpath, fname) im = ImageOps.expand(im, border=width, fill=col...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def save_visualization_to_file(self, file_name, length = 90):\n session = self.capture_last(length)\n visualizer.animate(session , 0, length, name = file_name, min_x = -1, max_x = 1, min_y = -1, max_y = 1, show = False )", "def write(self, file_name, width=1500.0, height=1000.0):\n with ope...
[ "0.5784574", "0.56733894", "0.5626295", "0.5541043", "0.5428487", "0.5386171", "0.5383418", "0.53502595", "0.5343739", "0.5342087", "0.5294229", "0.5275449", "0.52629405", "0.5256234", "0.5255994", "0.52103263", "0.5183001", "0.5153634", "0.51445657", "0.5137024", "0.51188093...
0.72179383
0
Save a simulated fragmented file version of the file. Trunfactor specifies how much of the data, sequentially from the start of file, should be written to the new file.
def savefragment(filepath, fname, outpath, truncfactor=0.5, preserve_name=False): # Read data infile = open(filepath, 'rb') data = infile.read() infile.close() # Write truncated filepath if not preserve_name: fpath = genSavePath(outpath, fname, modstring=f"truncated{truncfactor}") ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def write_data(infbfile,begin_N,dur_N,outfbfile):\n infbfile.seek_to_sample(begin_N)\n for i in range(begin_N,(begin_N+dur_N)):\n data = infbfile.read_sample()\n data.tofile(outfbfile)", "def save(self, fname):\n lh_data = self.data[:len(self.lh_vertno)]\n rh_data = self.data[-l...
[ "0.53168994", "0.52053297", "0.50609237", "0.5041503", "0.5023959", "0.49947497", "0.49635452", "0.495652", "0.49504188", "0.49476227", "0.494738", "0.49422064", "0.49133167", "0.4913253", "0.49015784", "0.48993456", "0.48802665", "0.48687673", "0.4865208", "0.48493338", "0.4...
0.62867725
0
Detects Xepr instances which are waiting for connections from XeprAPI clients. For this to work, the API has to be enabled in Xepr (menu "Processing" > submenu "XeprAPI" > menu item "Enable Xepr API"). Xepr instances which already are connected to an XeprAPI client are not listed.
def getXeprInstances(): apilib = _loadapilib() instances = _findInst(apilib) return dict([(p, t) for p, t in instances])
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _wait_active(client, request_id, max_num):\n logging.info('Waiting for instances to be active')\n while True:\n res = client.describe_spot_fleet_instances(SpotFleetRequestId=request_id)\n if len(res['ActiveInstances']) == max_num:\n logging.info('Instances are active now.')\n ...
[ "0.6325874", "0.57466775", "0.55821526", "0.5577072", "0.54760903", "0.54682326", "0.543734", "0.5412187", "0.5394259", "0.53219014", "0.5313654", "0.52691233", "0.5248033", "0.5224936", "0.52046394", "0.5202071", "0.52012694", "0.5174187", "0.51666844", "0.51602364", "0.5159...
0.6125134
1
Creates Experiment object to create a new experiment or to access an experiment already set up by the operator of the Xepr application.
def XeprExperiment(self, *p, **k): # noinspection PyTypeChecker return Experiment(self, *p, **k)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_experiment_if_needed(tr):\n exp = tr.getExperiment(EXPERIMENT_ID)\n if None == exp:\n create_project_if_needed(tr)\n exp = tr.createNewExperiment(EXPERIMENT_ID, 'DEFAULT_EXPERIMENT')\n \n return exp", "def create_experiment(self):\n experiment = wandb.init(\n name=self._n...
[ "0.7578074", "0.7373269", "0.72146213", "0.7015423", "0.69071597", "0.6736371", "0.65408194", "0.64728445", "0.64639014", "0.6389977", "0.63315874", "0.62304384", "0.622714", "0.61377406", "0.6132721", "0.6109624", "0.6044673", "0.59917486", "0.5942433", "0.5940935", "0.59142...
0.7045335
3
Closes the API and tells Xepr to shut down its API support as well. After that, the API support of Xepr has to be re enabled manually by the Xepr operator (menu "Processing" > submenu "XeprAPI" > menu item "Enable Xepr API") to be able to establish the Xepr API again.
def XeprClose(self): with self._lock: for func in self._dynamicmethods: delattr(self, func) self._dynamicmethods = [] self._printmsg('Closing API...', newline=False) if self._API.XeprDisableAPI(1) == SUCCESS: self._printmsg('done....
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def close(self):\n self.__aceQLHttpApi.close()", "def _close(self):\n log.Debug('dpbx.close():')", "def close(self):\n self.controller.DisableDevice()\n self.controller.StopPolling()\n self.controller.Disconnect(False)", "def close(self):\n if self.dev_open:\n ...
[ "0.6518419", "0.6297029", "0.6261232", "0.6248867", "0.61627144", "0.6101848", "0.6072765", "0.60054755", "0.6004206", "0.6000544", "0.5971086", "0.5967516", "0.59390146", "0.593771", "0.5916162", "0.59158105", "0.59158105", "0.590212", "0.5895577", "0.5895577", "0.5895577", ...
0.83324784
0
Refreshes the Xepr GUI.
def XeprGUIrefresh(self): with self._lock: self._API.XeprRefreshGUI()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def refresh(self):\n\t\tself.win.refresh()\n\t\tfor c in self.components:\n\t\t\tc.refresh()", "def refresh_dialog(self):\n self._client.update_elements()", "def refresh(self):\n self.Refresh()", "def Refresh(self):\n pass", "def refresh(self):\n self.__refresh()", "def refresh(...
[ "0.7118413", "0.6885529", "0.6867989", "0.66451275", "0.65044814", "0.6423347", "0.6417798", "0.6398829", "0.63724816", "0.6371857", "0.63682497", "0.6328148", "0.63234603", "0.63234603", "0.6223904", "0.62109405", "0.6206273", "0.6206273", "0.6206273", "0.6157153", "0.609169...
0.85330975
0
Check whether dataset is available.
def datasetAvailable(self): dset = None try: dset = self._getcopy() except Exception: pass if dset is not None: self._parent.destroyDset(dset) return True return False
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def data_available(dataset_name=None):\r\n for file_list in data_resources[dataset_name]['files']:\r\n for file in file_list:\r\n if not os.path.exists(os.path.join(data_path, dataset_name, file)):\r\n return False\r\n return True", "def check_dataset_exists(dataset):\n ...
[ "0.7826292", "0.7441684", "0.72973037", "0.7230916", "0.7226951", "0.70393974", "0.7030351", "0.70008165", "0.6950723", "0.6928618", "0.6912717", "0.69047856", "0.683975", "0.6828007", "0.67924714", "0.667985", "0.6654125", "0.6600955", "0.6577739", "0.6553427", "0.6533301", ...
0.78361577
0
Get the list of functional units for the experiment.
def getFuList(self): if self._fupardict: return self._fupardict.keys() buf = self._parent.Xeprbuf(10000) self.aqGetExpFuList(buf, 10000) return buf.get_unicode_str().split(',')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_units(self) -> List[str]:\n result = []\n for elements in self._get_results_list():\n result.append(elements[3])\n return result", "def getListOfUnits(self, *args):\n return _libsbml.UnitDefinition_getListOfUnits(self, *args)", "def client_units(self) -> List[Flyi...
[ "0.7093225", "0.65067303", "0.6453618", "0.6437445", "0.6428049", "0.63517296", "0.6145797", "0.60083926", "0.59385496", "0.59025174", "0.5840358", "0.5831512", "0.5831512", "0.58269817", "0.58130693", "0.5776839", "0.57549787", "0.57283396", "0.5718893", "0.5671003", "0.5671...
0.5055429
91
Get the list of paramater names for the functional unit funame.
def getFuParList(self, funame): if not self._fupardict: buf = self._parent.Xeprbuf(10000) for fu in self.getFuList(): self.aqGetExpFuParList(fu, buf, 10000) parlist = [x for x in buf.get_unicode_str().split(',') if self.aqGetParType('%s.%s' % (fu, x)) != s...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def parameter_names(self) -> List[str]:", "def parameterNames(self, p_int): # real signature unknown; restored from __doc__\n return []", "def get_param_names(hf):\n parameters = get_params(hf)\n return [p.name for p in parameters]", "def get_str_param_names(self):\n # Exclude self.api an...
[ "0.7988936", "0.74989027", "0.7314254", "0.7287591", "0.72515583", "0.7218516", "0.71054345", "0.70339245", "0.7012955", "0.6996692", "0.6981282", "0.6979131", "0.69392234", "0.68479455", "0.68444264", "0.6826156", "0.6822841", "0.6799787", "0.67326", "0.6730319", "0.6724998"...
0.61655676
60
Finds the fully qualified parameter name for the name given by param
def findParam(self, param, findall=False): param = param.replace('*', '').strip() if not param: if not findall: return return [] if param in self._fuparhist and not findall: return self._fuparhist[param] p = param.split('.') if ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def param_name(p):\n prefix = ['limit_', 'error_', 'fix_']\n for prf in prefix:\n if p.startswith(prf):\n return p[len(prf):]\n return p", "def get_param_name(self, param_id, syselem):\n\n with self.__connection.cursor() as cursor:\n query = \"SELECT NAME FROM %s WHER...
[ "0.7109423", "0.6902756", "0.6839676", "0.68305796", "0.68224156", "0.68224156", "0.68224156", "0.68224156", "0.68224156", "0.6680651", "0.6656476", "0.6656476", "0.66398823", "0.66398823", "0.66398823", "0.6597125", "0.6567056", "0.65526336", "0.65026873", "0.6357738", "0.62...
0.66429484
12
Get the name of the experiment.
def aqGetExpName(self): return self._expname
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def experiment_name(self):\n # type: () -> string_types\n return self._experiment_name", "def get_name() -> str:\n pass", "def get_name() -> str:", "def name(self) -> pulumi.Output[str]:\n return pulumi.get(self, \"name\")", "def name(self) -> pulumi.Output[str]:\n return...
[ "0.8646592", "0.7509479", "0.7353975", "0.7329796", "0.7329796", "0.7329796", "0.7329796", "0.7329796", "0.7329796", "0.7329796", "0.7329796", "0.7329796", "0.7329796", "0.7329796", "0.7329796", "0.7329796", "0.7329796", "0.7329796", "0.7329796", "0.7329796", "0.7329796", "...
0.0
-1
Equivalent to using the operator [], except for the additional enum parameter.
def getParam(self, name, enum=None): return Parameter(self, name, enum)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_additional_properties_with_array_of_enums(self):\n pass", "def convertToEnumItemArray(byte: int, enumType: cern.japc.value.EnumType) -> typing.List[cern.japc.value.EnumItem]:\n ...", "def convertToEnumItemSetArray(byte: int, enumType: cern.japc.value.EnumType) -> typing.List[cern.japc.va...
[ "0.5966134", "0.586653", "0.57834995", "0.5671007", "0.5469387", "0.5347836", "0.51718843", "0.5109061", "0.5109061", "0.51058966", "0.50422406", "0.5024083", "0.49625045", "0.4904923", "0.49036974", "0.48679268", "0.48582023", "0.48460153", "0.48249942", "0.48193696", "0.481...
0.0
-1
Decrypt this guardian's share of one or more ballots
def decrypt_ballot_shares( request: DecryptBallotSharesRequest = Body(...), scheduler: Scheduler = Depends(get_scheduler), ) -> Any: ballots = [ CiphertextAcceptedBallot.from_json_object(ballot) for ballot in request.encrypted_ballots ] context = CiphertextElectionContext.from_json_o...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_pam_secret(self, key):\n\n\n privateKeyA=self.rand() \n privateKeyB=self.rand() \n publicKeyA = int(pow(genrated,privateKeyA,prime))\n publicKeyB = int(pow(genrated,privateKeyB,prime))\n\n resp = self.process(\n requests.get(f\"{self.api_url}/secretman/GetSecre...
[ "0.629344", "0.5591807", "0.5542672", "0.54974806", "0.54797286", "0.54184014", "0.540358", "0.53940344", "0.5366817", "0.5345882", "0.5340164", "0.522527", "0.51924723", "0.5167279", "0.51538104", "0.5105933", "0.5103906", "0.5103906", "0.5098788", "0.50672245", "0.5058073",...
0.6520781
0
Check the value for limits according to topic. If out of limit, notify over telegram
def limitsExsess(topic, value): if isNotifyTime(topic): if "temperature" in topic: val = float(value) if val < MIN_TEMPERATURE or val > MAX_TEMPERATURE: notifyTelegram("Temperature out of bounds: "+value+"degC") return True if "CO" in topic: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def allowedLimit(self, number, msg=None):\n return allowed_limit(number, msg)", "async def max(self, ctx, limit: int):\n self.data_check(ctx)\n server = ctx.message.server\n\n self.riceCog2[server.id][\"max\"] = limit\n dataIO.save_json(self.warning_settings,\n ...
[ "0.6885966", "0.6692245", "0.66228366", "0.6284632", "0.627446", "0.6245816", "0.62092686", "0.61613834", "0.613513", "0.609418", "0.6056963", "0.6042189", "0.60258657", "0.5984116", "0.59698874", "0.59312063", "0.59092206", "0.5906563", "0.58542055", "0.5850616", "0.5809356"...
0.78263
0
Gets valid user credentials from storage. If nothing has been stored, or if the stored credentials are invalid, the OAuth2 flow is completed to obtain the new credentials.
def get_credentials(): #home_dir = os.path.expanduser('~') home_dir = (HOME_DIR) credential_dir = os.path.join(home_dir, '.credentials') print("Credentials folder: ",credential_dir) if not os.path.exists(credential_dir): os.makedirs(credential_dir) credential_path = os.path.join(credenti...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _load_user_credentials(self, storage):\n # Set up a Flow object to be used if we need to authenticate.\n flow = client.flow_from_clientsecrets(\n self.client_secrets,\n scope=self.api_scopes,\n message=tools.message_if_missing(self.client_secrets))\n\n # Re...
[ "0.7571305", "0.7356556", "0.71548086", "0.711909", "0.70713574", "0.7026156", "0.6991323", "0.6962775", "0.69490343", "0.6940299", "0.6935988", "0.6906218", "0.6900573", "0.68998826", "0.6857519", "0.68309605", "0.6792369", "0.6785002", "0.67753786", "0.67753786", "0.6775378...
0.6240862
88
Converts encoded sequences into an array with sequence strings
def decode_one_hot(encoded_sequences): if len(encoded_sequences.shape) == 3: s = encoded_sequences.shape encoded_sequences = encoded_sequences.reshape(1, s[0], s[1], s[2]) #num_samples, _, _, seq_length = np.shape(encoded_sequences) _, num_samples, _, seq_length = np.shape(encoded_sequences...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def decode_sequence(self, sequence=list) -> str:\n try:\n out = []\n for word in sequence:\n out.append(self.decode(word))\n return(out)\n except Exception as error:\n print(f\"Error: self.decode_sequence({sequence}) -> {error}\")", "de...
[ "0.69954103", "0.68113625", "0.65563", "0.6483455", "0.64378685", "0.6263874", "0.6176669", "0.61550325", "0.61276937", "0.61096597", "0.6037147", "0.6029054", "0.5999388", "0.59981567", "0.59195274", "0.59060395", "0.5906004", "0.58647674", "0.5854323", "0.58464247", "0.5812...
0.5643979
32
Get a string that describes the target (for e.g. metadata).
def data_name(self): return "Bispectrum"
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getInfo(self):\n return self.name + \" [\" + self.target_type + \"]\"", "def target(self) -> Optional[str]:\n return pulumi.get(self, \"target\")", "def target_name(self):\n return self._target_name", "def name(self) -> str:\n return self.inst['targetname']", "def get_target...
[ "0.73063004", "0.72933376", "0.7276515", "0.7202048", "0.71281767", "0.696577", "0.6881676", "0.68652797", "0.6742786", "0.67377156", "0.6706205", "0.66736144", "0.6576408", "0.6562085", "0.6562085", "0.6562085", "0.6562085", "0.6562085", "0.6562085", "0.6562085", "0.6562085"...
0.0
-1
Get the feature dimension of this data.
def feature_size(self): return self.fingerprint_length
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def feature_dimension(self) -> int:\n return self._feature_dimension", "def feature_dim(self):\n return feature_dim_from_test_system(self)", "def features_dim(self):\n if not self.exposes_features:\n return None\n\n dim = self._features_op.outputs[0].get_shape().as_list()...
[ "0.89637285", "0.86458623", "0.8564586", "0.83512133", "0.8064637", "0.7931219", "0.78060144", "0.7794164", "0.77869695", "0.77869695", "0.77869695", "0.77869695", "0.7766574", "0.7721604", "0.7697934", "0.7682128", "0.7605907", "0.75448817", "0.75407034", "0.75349915", "0.75...
0.0
-1
Convert the units of a bispectrum descriptor. Since these do not really have units this function does nothing yet.
def convert_units(array, in_units="None"): if in_units == "None" or in_units is None: return array else: raise Exception("Unsupported unit for bispectrum descriptors.")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def convert_units(self):\n for prod in (\"ier\", \"ier_inc_rain\"):\n self.data[prod].data[:] /= 1e6", "def backconvert_units(array, out_units):\n if out_units == \"None\" or out_units is None:\n return array\n else:\n raise Exception(\"Unsupported unit for b...
[ "0.7362858", "0.697799", "0.68368673", "0.6746229", "0.67332226", "0.6689847", "0.6652228", "0.6625354", "0.6573514", "0.6546448", "0.65275437", "0.64689595", "0.6373749", "0.63324165", "0.6316742", "0.6294838", "0.6258834", "0.62498343", "0.6219283", "0.62110245", "0.6167998...
0.7536837
0
Convert the units of a bispectrum descriptor. Since these do not really have units this function does nothing yet.
def backconvert_units(array, out_units): if out_units == "None" or out_units is None: return array else: raise Exception("Unsupported unit for bispectrum descriptors.")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def convert_units(array, in_units=\"None\"):\n if in_units == \"None\" or in_units is None:\n return array\n else:\n raise Exception(\"Unsupported unit for bispectrum descriptors.\")", "def convert_units(self):\n for prod in (\"ier\", \"ier_inc_rain\"):\n sel...
[ "0.7536962", "0.7362253", "0.68372786", "0.674662", "0.6732477", "0.66885984", "0.665177", "0.6623838", "0.6573811", "0.65471977", "0.65269375", "0.64705104", "0.6375094", "0.6330455", "0.6316037", "0.62951684", "0.6259092", "0.6249572", "0.6218803", "0.6210326", "0.6170082",...
0.69773746
2
Perform actual bispectrum calculation.
def _calculate(self, atoms, outdir, grid_dimensions, **kwargs): use_fp64 = kwargs.get("use_fp64", False) lammps_format = "lammps-data" ase_out_path = os.path.join(outdir, "lammps_input.tmp") ase.io.write(ase_out_path, atoms, format=lammps_format) nx = grid_dimensions[0] ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def calculate_ft(self):\n \n # Create a function which is able to evaluate B**2\n ffunc = scipy.interpolate.interp1d(self.psigrid, self.e.getF()[self.tind])\n def b2_func(R, Z, psi):\n bt = ffunc(psi)/R\n br = -self.psifunc.ev(R, Z, dy=1)/R\n bz = self.p...
[ "0.6264825", "0.5765228", "0.57305443", "0.57027525", "0.5698685", "0.5697205", "0.56671035", "0.5649315", "0.5634285", "0.56256074", "0.5624231", "0.56226474", "0.5614191", "0.5581222", "0.55639535", "0.5559925", "0.5559376", "0.5537073", "0.5524306", "0.55227923", "0.551113...
0.0
-1
Sum up all 1's in a list, and calculate the product sum Return the original list and the summed If the list only contains one 1, dont calculate the sum >>> sum_ones((1, 1, 2), 112) [(1, 1, 2), (2, 2)], [2, 4] >>> sum_ones((1, 2), 2) [(1, 2)], [2] >>> sum_ones((2, ), 2) [(2,)], [2]
def sum_ones(part, prod): if part in sum_ones_memory: partList, prodList = sum_ones_memory[part] else: n1 = part.count(1) partList = [part] prodList = [prod] if n1 > 1: npart = tuple(filter(lambda x: x != 1, part)) npart = (n1,) + npart ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def sum_list(numbers):\n\t\n\tif len(numbers) == 0:\n\t\treturn 0 \n\n\tsum = numbers[0] +sum_list(numbers[1:])\n\treturn sum", "def zero_sum(list):\n if not list:\n return 0\n else:\n return sum(list)", "def mult_and_sum(*arg_list):\r\n result = numpy.empty(arg_list[0].shape, dtype=...
[ "0.595099", "0.58707553", "0.5846285", "0.5818005", "0.58091325", "0.5784409", "0.5705578", "0.5697676", "0.56917393", "0.5681991", "0.56177396", "0.555534", "0.5501804", "0.5495922", "0.546188", "0.546188", "0.5457171", "0.5431213", "0.5431213", "0.54213077", "0.53874594", ...
0.7017122
0