query
stringlengths
9
9.05k
document
stringlengths
10
222k
metadata
dict
negatives
listlengths
30
30
negative_scores
listlengths
30
30
document_score
stringlengths
4
10
document_rank
stringclasses
2 values
Run the specified command, block until it completes, and return the exit code, stdout, and stderr. Extends os.environment['PATH'] with the 'add_to_PATH' setting. Additional parameters to Popen can be specified as keyword parameters.
def call_and_wait_with_input(command, input_string, **popen_kwargs): if subprocess.mswindows: startupinfo = subprocess.STARTUPINFO() startupinfo.dwFlags |= subprocess.STARTF_USESHOWWINDOW popen_kwargs['startupinfo'] = startupinfo # For the subprocess, extend the env PATH to include the ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def with_path(target: pathlib.Path, cmd):\n\n def null_handler(signum, frame):\n pass # pragma: no cover\n\n signal.signal(signal.SIGINT, null_handler)\n return subprocess.Popen(cmd, env=_setup_env(target)).wait()", "def _exec_and_wait(command):\n proc = subprocess.Popen(command, stdout=subpr...
[ "0.6000096", "0.59127134", "0.59019727", "0.5759366", "0.57587385", "0.57526255", "0.56961083", "0.56578356", "0.5656219", "0.56560415", "0.5616474", "0.5585318", "0.5571383", "0.55689794", "0.555987", "0.5557769", "0.5531829", "0.55151355", "0.5499775", "0.5474269", "0.54715...
0.664907
0
Return the path to the .cabal file project for the source file in the specified view. The view must show a saved file, the file must be Haskell source code, and the file must be under a directory containing a .cabal file. Otherwise, return None.
def get_cabal_project_dir_and_name_of_view(view): # Check that the view is showing a saved file: file_shown_in_view = view.file_name() if file_shown_in_view is None: return None, None # Check that the file is Haskell source code: syntax_file_for_view = view.settings().get('syntax').lower() ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_haskell_command_window_view_file_project(view = None):\n if view:\n return view.window(), view, view.file_name()\n\n window = sublime.active_window()\n view = None\n if window:\n view = window.active_view()\n file_name = None\n if view:\n file_name = view.file_name()\...
[ "0.692023", "0.61565953", "0.6044948", "0.59064406", "0.5871465", "0.5747196", "0.56763196", "0.56753814", "0.551977", "0.55024064", "0.5497378", "0.5460923", "0.54426795", "0.54357535", "0.5357909", "0.5339469", "0.5314552", "0.52898437", "0.528152", "0.5236368", "0.52077955...
0.8709198
0
Return the path to the .cabal file and name of project for the specified file.
def get_cabal_project_dir_and_name_of_file(filename): # Check that a .cabal file is present: directory_of_file = os.path.dirname(filename) cabal_file_path = find_file_in_parent_dir(directory_of_file, '*.cabal') if cabal_file_path is None: return None, None # Return the directory containing t...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_cabal_project_dir_of_file(filename):\n return get_cabal_project_dir_and_name_of_file(filename)[0]", "def get_path(self, project_file=None):\n root = os.path.abspath(\n os.path.join(os.path.dirname(__file__), '..', '..')\n )\n if project_file:\n return os....
[ "0.7966997", "0.736705", "0.72708976", "0.6886751", "0.67676115", "0.6633429", "0.6605615", "0.65427184", "0.6522352", "0.64868295", "0.63900405", "0.6311302", "0.63107634", "0.6290155", "0.62890893", "0.6288676", "0.62418056", "0.6203886", "0.61740804", "0.61244476", "0.6072...
0.7883086
1
Return the path to the .cabal file project for the specified file.
def get_cabal_project_dir_of_file(filename): return get_cabal_project_dir_and_name_of_file(filename)[0]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_cabal_project_dir_and_name_of_file(filename):\n # Check that a .cabal file is present:\n directory_of_file = os.path.dirname(filename)\n cabal_file_path = find_file_in_parent_dir(directory_of_file, '*.cabal')\n if cabal_file_path is None:\n return None, None\n # Return the directory c...
[ "0.74561596", "0.73180103", "0.71580964", "0.6853526", "0.6753858", "0.66615206", "0.6576154", "0.6364131", "0.6316146", "0.62228334", "0.6202379", "0.61490226", "0.6147563", "0.6135138", "0.6124829", "0.6124829", "0.6124829", "0.6124829", "0.60825664", "0.60792834", "0.60792...
0.799738
0
Return .cabal file for cabal directory
def get_cabal_in_dir(cabal_dir): for entry in os.listdir(cabal_dir): if entry.endswith(".cabal"): project_name = os.path.splitext(entry)[0] return (project_name, os.path.join(cabal_dir, entry)) return (None, None)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_cabal_project_dir_of_file(filename):\n return get_cabal_project_dir_and_name_of_file(filename)[0]", "def get_cabal_project_dir_and_name_of_file(filename):\n # Check that a .cabal file is present:\n directory_of_file = os.path.dirname(filename)\n cabal_file_path = find_file_in_parent_dir(direc...
[ "0.6857436", "0.6443552", "0.6218372", "0.6162597", "0.61501837", "0.59749025", "0.58708173", "0.58335906", "0.5774974", "0.5622375", "0.5552471", "0.5550998", "0.5538827", "0.5478476", "0.5463238", "0.54282224", "0.5380789", "0.5375571", "0.5356811", "0.5332843", "0.53325015...
0.7395051
0
Returns current cabaldev sandbox or 'cabal'
def current_cabal(): if get_setting_async('use_cabal_dev'): return get_setting_async('cabal_dev_sandbox') else: return 'cabal'
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def current_sandbox():\n if get_setting_async('use_cabal_dev'):\n return get_setting_async('cabal_dev_sandbox')\n else:\n return None", "def get_current_environment():\n # Search for the environment variable set by the hutch python setup\n env = os.getenv('CONDA_ENVNAME')\n # Otherwi...
[ "0.835338", "0.6345757", "0.6232153", "0.60873884", "0.5795384", "0.5764167", "0.57402873", "0.56656176", "0.56610507", "0.5602986", "0.5578876", "0.5535739", "0.5519411", "0.55081666", "0.5477867", "0.5453962", "0.54171276", "0.5415763", "0.5412264", "0.5366288", "0.5354206"...
0.84304273
0
Returns current cabaldef sandbox or None
def current_sandbox(): if get_setting_async('use_cabal_dev'): return get_setting_async('cabal_dev_sandbox') else: return None
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def current_cabal():\n if get_setting_async('use_cabal_dev'):\n return get_setting_async('cabal_dev_sandbox')\n else:\n return 'cabal'", "def get_current_environment():\n # Search for the environment variable set by the hutch python setup\n env = os.getenv('CONDA_ENVNAME')\n # Otherw...
[ "0.72634137", "0.5837862", "0.57205015", "0.57175374", "0.5588375", "0.5521489", "0.54138476", "0.54083264", "0.54012024", "0.53809434", "0.5343049", "0.53430235", "0.53191984", "0.53068745", "0.52762735", "0.5275435", "0.5256564", "0.52563494", "0.52349573", "0.5218031", "0....
0.7854318
0
Attach sandbox arguments to command
def attach_sandbox(cmd, sandbox = None): if not sandbox: sandbox = get_setting_async('cabal_dev_sandbox') if len(sandbox) > 0: return cmd + ['-s', sandbox] return cmd
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def attach_cabal_sandbox(cmd, cabal = None):\n if not cabal:\n cabal = current_cabal()\n if cabal == 'cabal':\n return cmd\n return cmd + ['-s', cabal]", "def update_sandbox_args(self):\n if self.is_sandbox:\n host, port = HubIO.deploy_public_sandbox(self.args)\n ...
[ "0.61616236", "0.6051999", "0.59887874", "0.5951741", "0.5905217", "0.589213", "0.5862534", "0.5858628", "0.58121336", "0.57942694", "0.57550293", "0.5726544", "0.5694076", "0.568686", "0.5657362", "0.56555444", "0.5640831", "0.5632509", "0.5610168", "0.5581524", "0.55605954"...
0.7170164
0
Attach sandbox if use_cabal_dev enabled
def try_attach_sandbox(cmd, sandbox = None): if not get_setting_async('use_cabal_dev'): return cmd return attach_sandbox(cmd, sandbox)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def attach_sandbox(cmd, sandbox = None):\n if not sandbox:\n sandbox = get_setting_async('cabal_dev_sandbox')\n if len(sandbox) > 0:\n return cmd + ['-s', sandbox]\n return cmd", "def attach_cabal_sandbox(cmd, cabal = None):\n if not cabal:\n cabal = current_cabal()\n if cabal...
[ "0.78566504", "0.71238124", "0.655829", "0.63934493", "0.6242372", "0.61629486", "0.58732474", "0.5855595", "0.5809142", "0.57875794", "0.56873125", "0.56806666", "0.5673753", "0.561629", "0.559554", "0.5568817", "0.5501705", "0.5478276", "0.54751986", "0.5448945", "0.5437901...
0.8150983
0
Get setting from any thread Note, that setting must be loaded before by get_setting from main thread
def get_setting_async(key, default=None): # Reload it in main thread for future calls of get_setting_async sublime.set_timeout(lambda: update_setting(key), 0) with sublime_haskell_settings as settings: if key not in settings: # Load it in main thread, but for now all we can do is result ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_setting(self, setting):\n return self.do_rpc(\"get_setting\", key=key)", "def _value(self):\n # If we have not been initialized, it means we're in a thread: take the\n # value from the root thread.\n if not hasattr(self._local, '_value'):\n self._local._value = self...
[ "0.62968093", "0.5868504", "0.5847329", "0.57795876", "0.5723847", "0.5720805", "0.55819225", "0.5538333", "0.55131453", "0.55077183", "0.5420485", "0.54081935", "0.5359615", "0.5357275", "0.53416437", "0.53305244", "0.53260916", "0.53233534", "0.53217125", "0.52909034", "0.5...
0.6773107
0
Gets ghc_opts, used in several tools, as list with extra 'packagedb' option and 'i' option if filename passed
def get_ghc_opts(filename = None, add_package_db = True, cabal = None): ghc_opts = get_setting_async('ghc_opts') if not ghc_opts: ghc_opts = [] if add_package_db: package_db = ghci_package_db(cabal = cabal) if package_db: ghc_opts.append('-package-db {0}'.format(package_d...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_ghc_opts_args(filename = None, add_package_db = True, cabal = None):\n opts = get_ghc_opts(filename, add_package_db, cabal)\n args = []\n for opt in opts:\n args.extend([\"-g\", \"\\\"\" + opt + \"\\\"\"])\n return args", "def get_glib_cflags():\n\tpkgcmd = os.popen(pkg_config_path +\n...
[ "0.81718946", "0.6188809", "0.608727", "0.5880468", "0.5850006", "0.5809449", "0.5800317", "0.5782982", "0.57427347", "0.5721177", "0.5685853", "0.5649535", "0.56332105", "0.5621673", "0.55657786", "0.555519", "0.55464023", "0.55315816", "0.5508323", "0.5473067", "0.54708487"...
0.84023046
0
Same as ghc_opts, but uses 'g' option for each option
def get_ghc_opts_args(filename = None, add_package_db = True, cabal = None): opts = get_ghc_opts(filename, add_package_db, cabal) args = [] for opt in opts: args.extend(["-g", "\"" + opt + "\""]) return args
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_ghc_opts(filename = None, add_package_db = True, cabal = None):\n ghc_opts = get_setting_async('ghc_opts')\n if not ghc_opts:\n ghc_opts = []\n if add_package_db:\n package_db = ghci_package_db(cabal = cabal)\n if package_db:\n ghc_opts.append('-package-db {0}'.form...
[ "0.6651563", "0.6354805", "0.592085", "0.58881575", "0.5699249", "0.56788296", "0.56633687", "0.5632041", "0.56160134", "0.5558771", "0.5539741", "0.5520189", "0.5505044", "0.5491396", "0.54796314", "0.54725266", "0.54648334", "0.5455812", "0.54525864", "0.54517794", "0.54455...
0.6837278
0
Calls ghcmod with the given arguments. Shows a sublime error message if ghcmod is not available.
def call_ghcmod_and_wait(arg_list, filename=None, cabal = None): ghc_opts_args = get_ghc_opts_args(filename, add_package_db = False, cabal = cabal) try: command = attach_cabal_sandbox(['ghc-mod'] + ghc_opts_args + arg_list, cabal) # log('running ghc-mod: {0}'.format(command)) # Set c...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def call_module(session, module, args, libgmt):\n c_call_module = libgmt.GMT_Call_Module\n c_call_module.argtypes = [ctypes.c_void_p, ctypes.c_char_p,\n ctypes.c_int, ctypes.c_void_p]\n c_call_module.restype = ctypes.c_int\n\n mode = get_constant('GMT_MODULE_CMD', libgmt)\n...
[ "0.5840715", "0.56021357", "0.5204634", "0.51858664", "0.51507634", "0.51308113", "0.5088549", "0.50507665", "0.50467485", "0.50138545", "0.4999077", "0.49715713", "0.4965294", "0.4958292", "0.49344245", "0.49234843", "0.49134326", "0.4890454", "0.4881104", "0.4840757", "0.48...
0.694366
0
Wait for window to appear on startup It's dirty hack, but I have no idea how to make it better
def wait_for_window(on_appear, seconds_to_wait=MAX_WAIT_FOR_WINDOW): sublime.set_timeout(lambda: wait_for_window_callback(on_appear, seconds_to_wait), 0)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def show_window(self):\n self._window.grab_set()\n self._window.wait_window()", "def wait_for_non_loading_screen():\n imagesearch_loop(image=SETTINGS['img_paths']['screens']['nav_box'])", "def on_window_ready(self):\n pass", "def window_ready(self):\n raise NotImplementedEr...
[ "0.7366119", "0.68966776", "0.6879436", "0.66401845", "0.6594568", "0.65923053", "0.6574993", "0.65206236", "0.64711106", "0.6462549", "0.628803", "0.6252549", "0.62243634", "0.61828715", "0.61514103", "0.61456996", "0.61317915", "0.6099083", "0.6092746", "0.60732037", "0.605...
0.6952012
1
Pure msg with 'SublimeHaskell' prefix and set_timeout
def sublime_status_message(msg): sublime.set_timeout(lambda: sublime.status_message(u'SublimeHaskell: {0}'.format(msg)), 0)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def show_status_message(msg, isok = None):\n mark = u'...'\n if isok is not None:\n mark = u' \\u2714' if isok else u' \\u2718'\n sublime_status_message(u'{0}{1}'.format(msg, mark))", "def hello(msg: str):\n time.sleep(2)\n print(msg)", "def stand_by_msg(msg: str = \"\"):\n print(m...
[ "0.6633884", "0.65065706", "0.63982236", "0.63648236", "0.6040968", "0.6024205", "0.5991832", "0.5898295", "0.5883243", "0.58658445", "0.585363", "0.58271706", "0.5820468", "0.5805097", "0.5802475", "0.57928026", "0.5781431", "0.572368", "0.5707808", "0.5666978", "0.56593597"...
0.8249199
0
Show status message with check mark (isok = true), ballot x (isok = false) or ... (isok = None)
def show_status_message(msg, isok = None): mark = u'...' if isok is not None: mark = u' \u2714' if isok else u' \u2718' sublime_status_message(u'{0}{1}'.format(msg, mark))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def show_status():\n\n pass", "def get_status(bool):\n if bool:\n return \"✓\"\n else:\n return \"...\"", "def show_msg(self):\n if self.result and self.success_msg:\n print color_str('g', '\\n'.join(self.success_msg))\n elif self.result == False and self.fail_ms...
[ "0.7192067", "0.70553553", "0.693006", "0.6778036", "0.67454696", "0.6574291", "0.65544564", "0.64763385", "0.647298", "0.641492", "0.6370576", "0.6364353", "0.63600254", "0.6341634", "0.63381004", "0.63074154", "0.63035965", "0.6262831", "0.6250647", "0.6245237", "0.6234227"...
0.75078595
0
Show status message for action with check mark or with ballot x Returns whether action exited properly
def with_status_message(msg, action): try: show_status_message(msg) action() show_status_message(msg, True) return True except SublimeHaskellError as e: show_status_message(msg, False) log(e.reason) return False
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def status(self, action, code):\n if code != 20002:\n print(action + \"returned with code %s \" % (ERROR_CODE[code]))\n elif self._verbosity:\n print(action + \"completed successfully %s \" % (ERROR_CODE[code]))", "def show_status():\n\n pass", "def print_confirmation(ac...
[ "0.6944858", "0.6900246", "0.6796138", "0.6772747", "0.661023", "0.6598143", "0.65870637", "0.65822226", "0.6541207", "0.6507563", "0.6398561", "0.6398561", "0.6398561", "0.6398561", "0.63913983", "0.6375343", "0.6375343", "0.6375343", "0.6375343", "0.6351", "0.6342937", "0...
0.691924
1
Same as show_status_message, but shows permanently until called with isok not None There can be only one message process in time, message with highest priority is shown For example, when building project, there must be only message about building
def show_status_message_process(msg, isok = None, timeout = 300, priority = 0): if isok is not None: if msg in StatusMessage.messages: StatusMessage.messages[msg].cancel() del StatusMessage.messages[msg] show_status_message(msg, isok) else: if msg in StatusMessage...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def show_status_message(msg, isok = None):\n mark = u'...'\n if isok is not None:\n mark = u' \\u2714' if isok else u' \\u2718'\n sublime_status_message(u'{0}{1}'.format(msg, mark))", "def StatusUpdate(msg):\r\n if verbosity > 0:\r\n print msg", "def StatusUpdate(msg):\n if verbosity > 0:\...
[ "0.7048016", "0.67162746", "0.66420096", "0.66131914", "0.6591852", "0.65696347", "0.6349315", "0.63219875", "0.6301423", "0.6263684", "0.62492645", "0.6239486", "0.6126138", "0.61258453", "0.6122738", "0.6040655", "0.60275555", "0.6011513", "0.60090643", "0.5951354", "0.5930...
0.7251171
0
Parse a bytestring into protobuf pairs and make sure that all pairs have a valid wire type.
def _parse_proto(raw: bytes) -> list[google_protobuf.GoogleProtobuf.Pair]: buf = google_protobuf.GoogleProtobuf(KaitaiStream(io.BytesIO(raw))) for pair in buf.pairs: if not isinstance( pair.wire_type, google_protobuf.GoogleProtobuf.Pair.WireTypes ): raise ValueError("Not ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def deserialize(self, str):\n try:\n end = 0\n start = end\n end += 1\n (self.success,) = _struct_B.unpack(str[start:end])\n self.success = bool(self.success)\n return self\n except struct.error as e:\n raise genpy.DeserializationError(e) #most likely buffer underfill", "...
[ "0.5879669", "0.5684503", "0.5643543", "0.55370086", "0.5533703", "0.54689133", "0.54638195", "0.54624766", "0.5462193", "0.54585314", "0.54543704", "0.54399306", "0.54338545", "0.5423133", "0.5416417", "0.54037285", "0.53990656", "0.5378643", "0.5371814", "0.53678614", "0.53...
0.7424675
0
Motivation calculate Green function at each grid point, 1/(4np.pir) where r is the distance from the origin (defined as the bottom left grid point)
def Green_func(self): if self.bc == True: size = self.grid_size else: size = 2*self.grid_size self.Green = np.zeros([size, size]) for x in range(len(self.Green[0])): for y in range(len(self.Green[1])): radius = np.sqrt(x**2 + y**2) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def compute_green_function(self,n):\n size = np.arange(n)\n xx,yy = np.meshgrid(size,size)\n vectors = np.array([xx.ravel(),yy.ravel()])\n norm = norm_on_grid(vectors)\n green = green_function(norm,self.grid,self.softner,self.G)\n try:\n green[n//2:, :n//2] = np...
[ "0.6719998", "0.6484538", "0.63384193", "0.6217472", "0.61065465", "0.6074154", "0.6056028", "0.6055694", "0.601197", "0.59702116", "0.5897934", "0.58701366", "0.5787443", "0.57663906", "0.57584745", "0.5739799", "0.5699504", "0.5698569", "0.56825197", "0.56825197", "0.566070...
0.7204011
0
Main Function to load data to S3 using spark.
def main(): spark = create_spark_session() print("Spark Session Created") #Print S3 bucket location s3_bucket=os.environ["s3_bucket"] s3_bucket = s3_bucket.replace("'", "") print (s3_bucket) #Invoke Functions to process data process_data(spark, s3_bucket)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def main():\n spark = create_spark_session()\n input_data = \"s3a://udacity-dend\"\n output_data = \"s3a://vivek1bucket\"\n \n process_song_data(spark, input_data, output_data) \n process_log_data(spark, input_data, output_data)", "def load_data_s3(filename):\n \n global s3_client\n\n ...
[ "0.7370762", "0.715791", "0.7133877", "0.6960661", "0.68328196", "0.67276514", "0.66941506", "0.6668002", "0.66598934", "0.66595316", "0.66366285", "0.6632237", "0.6623105", "0.6552732", "0.65286165", "0.6507679", "0.64956814", "0.6473381", "0.64483607", "0.63668793", "0.6254...
0.7849898
0
This method configures the storage card for flex controller.
def configure_storage_flex_flash_controller(handle, parent_dn, flex_id, operation_request, admin_slot_number="NA", wait_operation_completion=True): from ucsmsdk.mometa.storage.Storage...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _swift_storage_setup(self):\n with settings(hide('running', 'stdout', 'stderr', 'warnings')):\n self._pull_configs('storage')\n self._swift_install('storage')\n self._set_onhold('storage')\n self._final_install_touches('storage')", "def configure(self):\n ...
[ "0.6267908", "0.5450552", "0.5431179", "0.5417763", "0.5388782", "0.53604394", "0.5263753", "0.5210804", "0.5189316", "0.5099087", "0.50249135", "0.5016881", "0.5007975", "0.49474862", "0.491832", "0.4904749", "0.48967", "0.4894291", "0.48656672", "0.4863412", "0.48518494", ...
0.60565585
1
Count the number of rows in each child table. This function generates a derived column for each child table which contains the number of rows in each group. For example, if the target table is users, then it might generate a derived column containing the number of rows in the transaction table that belongs to each user...
def derive(self, dataset, table_name): seen = set() for fk in dataset.metadata.get_foreign_keys(table_name): if fk["table"] == table_name: # Skip this relationship if the target table is the child continue if not isinstance(fk["field"], str): ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def tran_count(df, *args):\n # Compute the count\n df_res = DataFrame(\n df.groupby([*args]).size()\n ).reset_index()\n # Change column name\n col = list(df_res.columns)\n col[-1] = \"n\"\n df_res.columns = col\n\n return df_res", "def get_row_count(self):\n\t\treturn self.iter_n_c...
[ "0.62143815", "0.5957996", "0.58934706", "0.586603", "0.58317906", "0.58317906", "0.5791479", "0.57313925", "0.572387", "0.56973296", "0.56972647", "0.5692116", "0.56797403", "0.56458545", "0.5645555", "0.556431", "0.5530153", "0.55279285", "0.55008435", "0.5498323", "0.54846...
0.72696996
0
Travels down 'prev_node' dictionary starting from 'goal' to retrieve final path
def reconstruct_path(goal: Vector2D, prev_node: dict) -> list: path = [] prev = prev_node[goal] # remove 'goal' from path while prev != None: path.append(prev) prev = prev_node[prev] path = path[:-1] # remove 'start' from path path.reverse() return path
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_path(prevs, goal, start):\n path = OD({goal: 0})\n cur = goal\n while cur != start:\n (cost, node) = prevs.get(cur)\n if node == None or node in path:\n print(\"ERROR: No path found from %s -> %s\" % (start, goal))\n return (0, None)\n path[node] = path[c...
[ "0.76366246", "0.6714076", "0.66328955", "0.66230744", "0.6548012", "0.6548012", "0.6480307", "0.64539653", "0.6448625", "0.6411175", "0.639965", "0.6389664", "0.63856983", "0.6358294", "0.6358294", "0.6350132", "0.6296223", "0.6257218", "0.6217862", "0.61913496", "0.6096948"...
0.7828255
0
L{AMPConfiguration.loginSystem}'s value should have been preserved.
def test_attributeCopied(self): self.assertIdentical( self.store.findUnique(AMPConfiguration).loginSystem, self.store.findUnique(LoginSystem))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def handleLogin(self):\n aVar = self.session.getAttribute(self.settings.authenvar)\n self.loggedin = False\n if not aVar:\n self.currenttemplate = self.settings.logintemplate \n self.logger.debug(\"Not logged in, Login-Mask activated.\")\n return\n\n self.loggedin = True...
[ "0.59746784", "0.5719948", "0.5649351", "0.55731213", "0.5564653", "0.5540984", "0.54208714", "0.5419399", "0.54147196", "0.53665185", "0.535784", "0.530902", "0.52943873", "0.5214523", "0.52131164", "0.5197204", "0.5189552", "0.5175516", "0.51715916", "0.5171096", "0.5171091...
0.5988753
0
L{AMPConfiguration} should be poweredup as L{IOneTimePadGenerator}.
def test_poweredUp(self): self.assertIdentical( IOneTimePadGenerator(self.store), self.store.findUnique(AMPConfiguration))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def setUp(self):\n SimTimePublisher._sim_time_setup_requested = False", "def alarm_in_setup_change():\n setup_write(\"!M1 meas interval\", \"00:01:00\")\n setup_write(\"!M2 meas interval\", \"00:01:00\")\n setup_write(\"!TX3 scheduled interval\", \"00:05:00\")", "def alarm_out_setup_change():\n...
[ "0.57115793", "0.5709222", "0.5679747", "0.55573237", "0.5534661", "0.55026096", "0.5355977", "0.5329291", "0.5252587", "0.51934695", "0.5169164", "0.51359546", "0.5126263", "0.51234514", "0.51205254", "0.5116021", "0.50793725", "0.5075598", "0.50483453", "0.5044166", "0.5044...
0.7668863
0
takes no arguments tells you whether the shack is open
def open(self, irc, msg, args): status = urlopen("http://portal.shack:8088/status").read() status = json.loads(status) if status['status'] == 'open': irc.reply("shack is open.", prefixNick=False) elif status['status'] == 'closed': irc.reply("shack is clos...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_opened(self):\n return self.hcam is not None", "def _isopen(self):\n return self.dp.state()==PyTango.DevState.OPEN", "def is_open(self):\n return self.name == \"open\"", "def is_open(self):\n return self.status == \"O\"", "def is_open(self) -> bool:\n pass", "def...
[ "0.6625783", "0.63928646", "0.6386583", "0.63821256", "0.6361494", "0.60981625", "0.6096714", "0.6096714", "0.60212904", "0.60153663", "0.5993093", "0.59350306", "0.5835401", "0.5713856", "0.5699672", "0.56935585", "0.5687463", "0.55865824", "0.5526816", "0.5520796", "0.55118...
0.65614134
1
If debug enabled, print a few rows from pandas DataFrame.
def debug_print_dataframe(data, num_rows=2, debug=False): if debug: with pandas.option_context('display.max_rows', None, 'display.max_columns', None): print(data[:num_rows])
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def df_print(df):\n with pd.option_context('display.max_rows', None, 'display.max_columns', 3):\n print(df)", "def cprint(df, nrows=None, sample=False):\n if not isinstance(df, (pd.DataFrame, dask.dataframe.DataFrame)):\n try:\n df = df.to_frame()\n except:\n rais...
[ "0.7231756", "0.72031224", "0.7066302", "0.6980092", "0.69064975", "0.68365467", "0.6729087", "0.6719289", "0.6586377", "0.65563864", "0.65167034", "0.6489442", "0.6413254", "0.6402485", "0.6384212", "0.6383193", "0.638104", "0.63448143", "0.63175225", "0.6285955", "0.6284466...
0.8408803
0
A helper print function for seeing the table row length.
def print_data_table_length(document_label, data_frame, debug=False): print('{}\n'.format(document_label), len(data_frame)) debug_print_dataframe(data_frame, debug=debug)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getPrintRowWidth(self):\n return len(self.getPrintMidRow(self.print_grid[0]))", "def getNumRows(self) -> int:\n ...", "def len(self, table):\n return self.get_table_nb_lines(table)", "def __len__(self) -> int:\n return len(self.tab10)", "def width(self):\n return len(...
[ "0.7322119", "0.6767042", "0.6706905", "0.6685182", "0.6622911", "0.6620944", "0.6620256", "0.65778", "0.6553249", "0.65431774", "0.6542534", "0.6528971", "0.64777565", "0.64595675", "0.6452299", "0.643426", "0.6423233", "0.6404735", "0.6400234", "0.6395396", "0.6381534", "...
0.68134004
1
find_popular_song_by_duration_in_min >>> popular_list=InternetStoreManager([Popular("numb",3,"linkin park",2003, Genre.rock),Popular("Astronimia",6,"tony igy",2010, Genre.electro),Popular("fire man",4,"miyagi&andy panda",2018, Genre.rap)]) >>> popular_list.find_popular_song_by_duration_in_min(3)
def find_popular_song_by_duration_in_min(self, duration_in_min): lists = list(filter(lambda song: song.duration_in_min == duration_in_min, self.popular_list)) return print("".join(str(output_list) for output_list in lists))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_songs_for_duration(cls, max_duration, all_songs):\n song_subset = []\n current_duration = 0\n max_duration = int(max_duration)\n\n #Making a list of available song indexes allows us to\n #avoid randomly selecting songs that have already been chosen,\n #without copy...
[ "0.53716487", "0.51814073", "0.5174019", "0.51538795", "0.51405525", "0.5042916", "0.5036311", "0.50250685", "0.4969032", "0.4893262", "0.48785412", "0.48685324", "0.48364592", "0.48360685", "0.4764326", "0.4705009", "0.46925095", "0.46369985", "0.46251017", "0.46218577", "0....
0.7866326
0
Add a custom watermark
def custom_watermark(self, canvas, doc): canvas.saveState() canvas.setFont('Helvetica', 45) canvas.setFillGray(0.80) canvas.rotate(self.watermark_rotation) canvas.drawCentredString( self.watermark_position_x, self.watermark_position_y, self.wat...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_watermark(self, image, watermark, position='scale', opacity=1, format=None):", "def add_watermark(self, text):\n self.watermark_text = text", "def __draw_watermark(self):\n if self.watermark_text is not None:\n self.fig.text(0.5, 0.5, self.watermark_text,\n ...
[ "0.8660328", "0.77343243", "0.7536439", "0.71656203", "0.691339", "0.68904936", "0.67886233", "0.6751995", "0.67197806", "0.67012537", "0.65708196", "0.62114424", "0.62076515", "0.6152636", "0.5576688", "0.5378215", "0.53417516", "0.52732134", "0.52050906", "0.51507163", "0.5...
0.7872143
1
draw page number with custom format and position
def draw_page_number(self, page_count, position_x=285, position_y=5): if page_count > 0: self.setFillGray(0.2) self.setFont("Helvetica", 8) self.drawRightString( position_x * mm, position_y * mm, "Page %d/%d" % (self._pageNumber, page_count))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def addPageNumber(canvas, doc):\n page_num = canvas.getPageNumber()\n text = \"Pag %s\" % page_num\n canvas.drawRightString(200*mm, 10*mm, text)", "def addPageNum(self, canvas, doc):\n canvas.saveState()\n canvas.setFont('Times-Roman', 10)\n page_num_txt = \"{}\".format(...
[ "0.7314251", "0.7025484", "0.6701537", "0.6379475", "0.6170192", "0.6163554", "0.577237", "0.57498544", "0.57090634", "0.5694067", "0.5661805", "0.56272167", "0.5580329", "0.5503398", "0.5494345", "0.5463141", "0.5442981", "0.54370016", "0.54126495", "0.5410783", "0.5399462",...
0.72042304
1
Containing service template (can be ``None``).
def service_template(cls): return relationship.many_to_one(cls, 'service_template')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def pre_service_template_create(self, resource_dict):\n pass", "def extract_service_template(\n templates: Dict[str, Any],\n namespace: Optional[str], service: Optional[str], color: Optional[str], purpose: str,\n) -> Optional[str]:\n for service_template in templates['service-templates']:...
[ "0.65468246", "0.6314868", "0.630622", "0.6282051", "0.6274042", "0.6265635", "0.6193551", "0.617738", "0.61689717", "0.6168473", "0.6168473", "0.6168473", "0.6115798", "0.60805887", "0.60344696", "0.59665096", "0.5942134", "0.5917847", "0.58779615", "0.587204", "0.5855393", ...
0.6931451
1
Containing service template (can be ``None``).
def service_template(cls): return relationship.many_to_one(cls, 'service_template')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def pre_service_template_create(self, resource_dict):\n pass", "def extract_service_template(\n templates: Dict[str, Any],\n namespace: Optional[str], service: Optional[str], color: Optional[str], purpose: str,\n) -> Optional[str]:\n for service_template in templates['service-templates']:...
[ "0.65468246", "0.6314868", "0.630622", "0.6282051", "0.6274042", "0.6265635", "0.6193551", "0.617738", "0.61689717", "0.6168473", "0.6168473", "0.6168473", "0.6115798", "0.60805887", "0.60344696", "0.59665096", "0.5942134", "0.5917847", "0.58779615", "0.587204", "0.5855393", ...
0.6931451
0
Containing interface template (can be ``None``).
def interface_template(cls): return relationship.many_to_one(cls, 'interface_template')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_wrapper_template(self, declaration):\n pass", "def template_name(self):\n\t\traise NotImplementedError('template_name must be defined')", "def api_template(self):\n return self._api_template", "def html_template_file(self):\n pass", "def getInterfaceElement(publication):\n\tret...
[ "0.613769", "0.6000744", "0.58852965", "0.588196", "0.58215547", "0.5813774", "0.5805094", "0.5805094", "0.57891446", "0.57747257", "0.5770222", "0.5768059", "0.5753489", "0.572612", "0.5716598", "0.5700995", "0.5679773", "0.5679773", "0.5679773", "0.5643575", "0.5635752", ...
0.66936964
0
Containing operation template (can be ``None``).
def operation_template(cls): return relationship.many_to_one(cls, 'operation_template')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def generate(self, namespace: Optional[str], template: str, func: Callable, call_args: Dict) -> str:", "def __operations(self, conf):\n result = \"\"\"## Operations [back to top](#toc)\nThe operations that this API implements are:\n\"\"\"\n ops = \"\\n\"\n\n for op in conf[\"conf_json\"][1:]...
[ "0.6400317", "0.6035519", "0.58393055", "0.57342166", "0.5658464", "0.56227475", "0.56215745", "0.55542743", "0.55517995", "0.549283", "0.5491671", "0.54662824", "0.5445574", "0.5438946", "0.5427028", "0.5427028", "0.5427028", "0.5409983", "0.53841996", "0.53784895", "0.53683...
0.6624776
1
Containing operation template (can be ``None``).
def operation_template(cls): return relationship.many_to_one(cls, 'operation_template')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def generate(self, namespace: Optional[str], template: str, func: Callable, call_args: Dict) -> str:", "def __operations(self, conf):\n result = \"\"\"## Operations [back to top](#toc)\nThe operations that this API implements are:\n\"\"\"\n ops = \"\\n\"\n\n for op in conf[\"conf_json\"][1:]...
[ "0.6400317", "0.6035519", "0.58393055", "0.57342166", "0.5658464", "0.56227475", "0.56215745", "0.55542743", "0.55517995", "0.549283", "0.5491671", "0.54662824", "0.5445574", "0.5438946", "0.5427028", "0.5427028", "0.5427028", "0.5409983", "0.53841996", "0.53784895", "0.53683...
0.6624776
0
Containing node template (can be ``None``).
def node_template(cls): return relationship.many_to_one(cls, 'node_template')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def node():\n return render_template('nodes.html')", "def template_inst_node(templ, names, starname, scope_key, copy):\n node = TemplateInstanceNode()\n node.template = templ.node.copy() if copy else templ.node\n node.names = names\n node.starname = starname\n node.scope_key = scope_key\n re...
[ "0.64174485", "0.60471845", "0.59339243", "0.5676368", "0.5582963", "0.5582963", "0.5582963", "0.5545829", "0.55227804", "0.5514528", "0.54810727", "0.54195976", "0.5377944", "0.53409594", "0.52285755", "0.5189039", "0.51764184", "0.5164795", "0.5147369", "0.51449037", "0.513...
0.68033797
1
Containing group template (can be ``None``).
def group_template(cls): return relationship.many_to_one(cls, 'group_template')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def default_template_group():\n favorites = get_oneoffixx_favorites()\n if favorites:\n return favorites.get('id')\n return None", "def render(self):\n context = {'groups': self._groups}\n\n return loader.render_to_string(self._template_path, dictionary=context)", "def getTemplateId(self)...
[ "0.5995668", "0.55353814", "0.549713", "0.54825306", "0.5408736", "0.5381201", "0.5372297", "0.53440267", "0.5334407", "0.53312266", "0.53138065", "0.5292473", "0.5263528", "0.52550113", "0.52242875", "0.5159786", "0.51527613", "0.5152485", "0.5151295", "0.51479954", "0.51479...
0.6622854
0
Containing policy template (can be ``None``).
def policy_template(cls): return relationship.many_to_one(cls, 'policy_template')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def policy(self) -> Optional[str]:\n return pulumi.get(self, \"policy\")", "def translate_policy(policy: dict):\n if 'PolicyName' in policy:\n # This is a normal policy that should not be expanded\n return policy\n template_name = next(iter(policy))\n template_parameters = policy[te...
[ "0.6316291", "0.62651443", "0.6225868", "0.6225868", "0.6225868", "0.62037975", "0.61918247", "0.6174849", "0.6130804", "0.6130804", "0.612628", "0.612628", "0.612628", "0.6042344", "0.60220027", "0.60220027", "0.60220027", "0.5976425", "0.595036", "0.59388083", "0.59338516",...
0.743814
0
Containing relationship template (can be ``None``).
def relationship_template(cls): return relationship.many_to_one(cls, 'relationship_template')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_get_relationship_templates(self):\n pass", "def node_template(cls):\n return relationship.many_to_one(cls, 'node_template')", "def node_template(cls):\n return relationship.many_to_one(cls, 'node_template')", "def __get_relation_decl_template__(self, name):\n return None"...
[ "0.693944", "0.64850837", "0.64850837", "0.6110025", "0.5950319", "0.5950319", "0.5766446", "0.5751177", "0.57241064", "0.5655169", "0.5648811", "0.555904", "0.555904", "0.5504096", "0.5423204", "0.54217476", "0.53719175", "0.5275422", "0.5266501", "0.5216848", "0.5172785", ...
0.78191453
0
Containing capability template (can be ``None``).
def capability_template(cls): return relationship.many_to_one(cls, 'capability_template')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def capability(self):\n return self.get(\"capabilityClass\")", "def capability(self):\r\n return PythonCapability(self.mixins().values())", "def __get_capability(self):\n requests = self.__get_capability_request()\n exception = self.__get_capability_exception()\n layers = self.__...
[ "0.6278463", "0.5980057", "0.595834", "0.5764513", "0.5763342", "0.5640052", "0.555022", "0.5526859", "0.5500742", "0.548394", "0.54164463", "0.5366599", "0.53424567", "0.53357553", "0.5281665", "0.52237916", "0.52165574", "0.52165514", "0.5214487", "0.5174662", "0.51608896",...
0.765948
0
Containing artifact template (can be ``None``).
def artifact_template(cls): return relationship.many_to_one(cls, 'artifact_template')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def template(self) -> str:\n manifest = self._get_manifest()\n\n return manifest[\"template\"]", "def template(self) -> Optional[pulumi.Input['InstanceTemplateSpecArgs']]:\n return pulumi.get(self, \"template\")", "def template(self):\n template_names = self.get_template_names()\n ...
[ "0.59665376", "0.59204185", "0.58463156", "0.57932895", "0.57932895", "0.57932895", "0.57725066", "0.57087284", "0.57073957", "0.5681926", "0.55569106", "0.55564433", "0.5535718", "0.5513889", "0.5480937", "0.54626405", "0.5416873", "0.53953314", "0.5364053", "0.5355155", "0....
0.7210834
0
Containing policy (can be ``None``).
def policy(cls): return relationship.many_to_one(cls, 'policy')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_policy(self):\n\n return", "def policy(self) -> Optional[pulumi.Input['ServicePolicyArgs']]:\n return pulumi.get(self, \"policy\")", "def policy(self) -> Optional[pulumi.Input['ServicePolicyArgs']]:\n return pulumi.get(self, \"policy\")", "def policy(self) -> HwPolicy:\n r...
[ "0.69903344", "0.6950854", "0.6950854", "0.69249064", "0.684503", "0.684503", "0.68335605", "0.6831312", "0.6753603", "0.6753603", "0.6753603", "0.6574157", "0.64631003", "0.64631003", "0.64193463", "0.633937", "0.63334304", "0.6315522", "0.6315522", "0.6315522", "0.627674", ...
0.710954
0
Containing capability (can be ``None``).
def capability(cls): return relationship.many_to_one(cls, 'capability')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def capability(self):\n return self.get(\"capabilityClass\")", "def capability(self):\n code, data, capabilities = (\n self.__send_command(\"CAPABILITY\", withcontent=True))\n if code == \"OK\":\n return capabilities\n return None", "def capabilities(self):\n ...
[ "0.75927895", "0.72914344", "0.718189", "0.7018625", "0.6919919", "0.68249065", "0.6526968", "0.6487997", "0.6449425", "0.63318765", "0.63246125", "0.63017005", "0.6299351", "0.6293566", "0.6192228", "0.61560893", "0.61313194", "0.60851055", "0.60422343", "0.59962285", "0.597...
0.7447812
1
Containing artifact (can be ``None``).
def artifact(cls): return relationship.many_to_one(cls, 'artifact')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def pipeline_artifact(self):\n pass", "def model_artifact(self):\n pass", "def artifacts(self) -> Optional[Dict[str, Digest]]:\n return None", "def test_read_artifact(self):\n pass", "def source_artifact(self) -> aws_cdk.aws_codepipeline.Artifact:\n return self._values.ge...
[ "0.613305", "0.5947775", "0.57809585", "0.57282263", "0.570947", "0.570947", "0.570947", "0.570947", "0.56932527", "0.5687165", "0.56693226", "0.56357676", "0.5614518", "0.55279726", "0.53656465", "0.5364205", "0.5352116", "0.5351566", "0.5331034", "0.53211945", "0.53174895",...
0.62213445
0
Containing node template (can be ``None``).
def node_template(cls): return relationship.many_to_one(cls, 'node_template')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def node():\n return render_template('nodes.html')", "def template_inst_node(templ, names, starname, scope_key, copy):\n node = TemplateInstanceNode()\n node.template = templ.node.copy() if copy else templ.node\n node.names = names\n node.starname = starname\n node.scope_key = scope_key\n re...
[ "0.64174485", "0.60471845", "0.59339243", "0.5676368", "0.5582963", "0.5582963", "0.5582963", "0.5545829", "0.55227804", "0.5514528", "0.54810727", "0.54195976", "0.5377944", "0.53409594", "0.52285755", "0.5189039", "0.51764184", "0.5164795", "0.5147369", "0.51449037", "0.513...
0.68033797
0
Method gets element XSD type It is used to determine if element is Simple or Complex
def _get_element_type(self, element): if (self._client == None): raise ValueError('Specification is not imported yet') el_type = None for value in self._client.wsdl.schema.types.values(): if (value.name == element): if ('Simple' in value.id): ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def element_type(self) -> global___Type:", "def get_element_type(cls):\r\n return cls._type_name(cls.element_type)", "def get_xsd_type(self, item):\n if not self.xsd_types or isinstance(self.xsd_types, AbstractSchemaProxy):\n return\n elif isinstance(item, str):\n xsd...
[ "0.72736764", "0.722056", "0.6940011", "0.6757222", "0.66647863", "0.66263944", "0.65083593", "0.6440158", "0.6327248", "0.6295785", "0.6289563", "0.59691966", "0.5947183", "0.593558", "0.5904554", "0.5894026", "0.5827158", "0.58177805", "0.5817279", "0.5742918", "0.5721618",...
0.81229097
0
Method gets element XSD namespace It is used to construct XML element with correct namespaces
def _get_element_ns(self, element): if (self._client == None): raise ValueError('Specification is not imported yet') ns = None for key in self._client.wsdl.schema.types.keys(): if (key[0] == element): ns = key[1] break return ns
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getElementNamespace(self):\n return _libsbml.SBasePlugin_getElementNamespace(self)", "def XmlNamespace(self) -> str:", "def getElementNamespace(self):\n return _libsbml.ASTBasePlugin_getElementNamespace(self)", "def XmlTypeNamespace(self) -> str:", "def _get_xml_namespace(root_tag):\n ...
[ "0.66575307", "0.6654778", "0.6570621", "0.6186082", "0.5894886", "0.5683964", "0.5675546", "0.5675546", "0.5671032", "0.56465137", "0.5588689", "0.5521909", "0.5517181", "0.55168736", "0.5438165", "0.53722274", "0.5356854", "0.5353586", "0.53495955", "0.5284108", "0.5281967"...
0.66584224
0
Method creates dummy WSDL file
def _create_dummy_wsdl(self, xsd): if (path.exists(xsd)): try: with open(xsd, 'r') as f: tns = search(r'targetNamespace="(.*)"', f.read()).group(1) if ('"' in tns): tns = tns[: tns.index('"')] filename ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self, wsdl, service=None, port=None, tracefile=None,\r\n typesmodule=None, nsdict=None, soapAction=None, ns=None, op_ns=None, use_wsdl=False):\r\n if not hasattr(wsdl, 'targetNamespace'):\r\n wsdl = wstools.WSDLTools.WSDLReader().loadFromURL(wsdl)\r\n\r\n# for ...
[ "0.6022396", "0.5883336", "0.5728767", "0.55943495", "0.55539846", "0.55471724", "0.54936373", "0.5455348", "0.5428752", "0.5413969", "0.540626", "0.53902024", "0.5372448", "0.5364672", "0.53638846", "0.53560615", "0.53251445", "0.5307387", "0.53072923", "0.5294391", "0.52858...
0.76609796
0
Saves model to with provided checkpoint prefix.
def _save_checkpoint(checkpoint, model_dir, checkpoint_prefix): checkpoint_path = os.path.join(model_dir, checkpoint_prefix) saved_path = checkpoint.save(checkpoint_path) logging.info('Saving model as TF checkpoint: %s', saved_path) return
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def save(self, checkpoint) -> None:\r\n self.model.save(checkpoint)", "def save(self, model_dir, model_prefix):\n self.saver.save(self.sess, os.path.join(model_dir, model_prefix))\n self.logger.info('Model saved in {}, with prefix {}.'.format(model_dir, model_prefix))", "def save(self, mod...
[ "0.77904266", "0.7546714", "0.7546714", "0.7546714", "0.74023366", "0.73534364", "0.73429215", "0.71731627", "0.7145754", "0.71317977", "0.7054621", "0.70112056", "0.69744194", "0.6946616", "0.6900278", "0.68473923", "0.6821522", "0.6706834", "0.67058194", "0.66915375", "0.66...
0.83787894
0
Gets the value of a floatvalue keras metric.
def _float_metric_value(metric): return metric.result().numpy().astype(float)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def value(self) -> float:", "def value(self) -> float:\n ...", "def value(self) -> float:\n ...", "def value(self) -> float:\n ...", "def process(self, value):\n return float(value)", "def value(self) -> pulumi.Input[float]:\n return pulumi.get(self, \"value\")", "def...
[ "0.74450177", "0.7331098", "0.7331098", "0.7331098", "0.70472765", "0.70437294", "0.70400786", "0.6967984", "0.6967984", "0.6967984", "0.68555367", "0.68555367", "0.68413436", "0.67594624", "0.6689194", "0.6636375", "0.6614009", "0.66107637", "0.6577705", "0.6536332", "0.6534...
0.84196854
0
turn magics dict into jsonable dict of the same structure replaces object instances with their class names as strings
def _jsonable(self): magic_dict = {} mman = self.magics_manager magics = mman.lsmagic() for key, subdict in magics.items(): d = {} magic_dict[key] = d for name, obj in subdict.items(): try: classname = obj.__self__._...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _to_json_compat(self):\n # add and __obj_type attribute, so it can be reconstructed\n dic = {\"__obj_type\": self.__class__.__qualname__}\n for attr, typ in self._attrs_to_save.items():\n dic[attr] = typ.to_json_compat(getattr(self, attr))\n return dic", "def json_friendly(self):", "def ...
[ "0.64698195", "0.6352211", "0.62407213", "0.62407213", "0.62073994", "0.6178874", "0.6178874", "0.6178874", "0.6178874", "0.6178874", "0.6178874", "0.6178874", "0.61352813", "0.6111564", "0.6106882", "0.60446674", "0.59984624", "0.59572893", "0.591312", "0.5908019", "0.589376...
0.806072
0
Pretty print the object and display it through a pager. %page [options] OBJECT If no object is given, use _ (last output).
def page(self, parameter_s=''): # After a function contributed by Olivier Aubert, slightly modified. # Process options/args opts, args = self.parse_options(parameter_s, 'r') raw = 'r' in opts oname = args and args or '_' info = self.shell._ofind(oname) if info....
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def page(self, s):\n s = str(s)\n if _bool_globals_check(s):\n txt = pydoc.getdoc(s.__class__)\n logging.warning('First')\n self.blocking_pager(txt)\n return\n\n # After a function contributed by Olivier Aubert, slightly modified.\n\n # Proces...
[ "0.6780552", "0.65511554", "0.64739186", "0.6339728", "0.6265685", "0.6238287", "0.5985079", "0.59702927", "0.58487546", "0.5844521", "0.58422196", "0.5799026", "0.577486", "0.56521225", "0.55933946", "0.5583898", "0.55789137", "0.554994", "0.5528508", "0.5522832", "0.5497350...
0.66688293
1
Switch color scheme for prompts, info system and exception handlers.
def colors(self, parameter_s=''): def color_switch_err(name): warn('Error changing %s color schemes.\n%s' % (name, sys.exc_info()[1]), stacklevel=2) new_scheme = parameter_s.strip() if not new_scheme: raise UsageError( "%colors: you must...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def magic_colors(self,parameter_s = ''):\n \n new_scheme = parameter_s.strip()\n if not new_scheme:\n print 'You must specify a color scheme.'\n return\n try:\n self.shell.outputcache.set_colors(new_scheme)\n except:\n warn('Error chang...
[ "0.7433381", "0.6887214", "0.63729423", "0.63710797", "0.63603973", "0.629525", "0.6271782", "0.6189585", "0.61557", "0.6053361", "0.59993213", "0.5978457", "0.59695995", "0.5927234", "0.58691555", "0.58490413", "0.5825732", "0.5795109", "0.5792986", "0.5791811", "0.575703", ...
0.72141385
1
Switch modes for the exception handlers.
def xmode(self, parameter_s=''): def xmode_switch_err(name): warn('Error changing %s exception modes.\n%s' % (name,sys.exc_info()[1])) shell = self.shell if parameter_s.strip() == "--show": shell.InteractiveTB.skip_hidden = False return ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def magic_xmode(self,parameter_s = ''):\n\n new_mode = parameter_s.strip().capitalize()\n try:\n self.InteractiveTB.set_mode(mode = new_mode)\n print 'Exception reporting mode:',self.InteractiveTB.mode\n except:\n warn('Error changing exception modes.\\n' + str...
[ "0.583411", "0.5706575", "0.53079116", "0.51270324", "0.5108741", "0.5082003", "0.50413734", "0.50372994", "0.5017392", "0.5017076", "0.5016354", "0.50078815", "0.49907133", "0.4926195", "0.49016225", "0.49016225", "0.4881836", "0.48597237", "0.48475686", "0.48342675", "0.480...
0.5915887
0
Show a quick reference sheet
def quickref(self, arg): from IPython.core.usage import quick_reference qr = quick_reference + self._magic_docs(brief=True) page.page(qr)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def front_sheet(entry, village=False, nurses=False):\n printing_resident_sheets(entry, rf'{constants.OUTPUTS_DIR}\\front_sheet.xlsx')\n printing_documents.create_front_sheet(village=village, nurses=nurses)", "def habHelp(self):\n rf = os.path.join('docs','helpButtons','prefsHabitat.html')\n s...
[ "0.60457397", "0.5635346", "0.5526505", "0.5496386", "0.5454774", "0.5425696", "0.5377825", "0.5344097", "0.5337569", "0.532759", "0.5317251", "0.52896017", "0.5273617", "0.526972", "0.52566123", "0.5226357", "0.52150506", "0.5193542", "0.51902145", "0.5117804", "0.5110794", ...
0.6298631
0
Toggle doctest mode on and off. This mode is intended to make IPython behave as much as possible like a plain Python shell, from the perspective of how its prompts, exceptions and output look. This makes it easy to copy and paste parts of a
def doctest_mode(self, parameter_s=''): # Shorthands shell = self.shell meta = shell.meta disp_formatter = self.shell.display_formatter ptformatter = disp_formatter.formatters['text/plain'] # dstore is a data store kept in the instance metadata bag to track any #...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def def_textface_doctests():", "def _test():\n import doctest\n doctest.testmod(verbose=1)", "def _test():\n import doctest", "def __integration_doctest():\n pass", "def scope_doctest():\n pass", "def test_expt(doctest):", "def _test():\n import doctest\n doctest.testmod()", "def...
[ "0.7015764", "0.66283673", "0.6589668", "0.65752", "0.65129524", "0.6500822", "0.6490754", "0.6490754", "0.6457266", "0.6448648", "0.6448648", "0.633206", "0.6255428", "0.6216896", "0.6101708", "0.59172535", "0.5887387", "0.5860228", "0.5779084", "0.5716441", "0.5701286", "...
0.71679336
0
Set floating point precision for pretty printing. Can set either integer precision or a format string. If numpy has been imported and precision is an int, numpy display precision will also be set, via ``numpy.set_printoptions``. If no argument is given, defaults will be restored. Examples
def precision(self, s=''): ptformatter = self.shell.display_formatter.formatters['text/plain'] ptformatter.float_precision = s return ptformatter.float_format
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def pretty(precision=None):\n\n global _pretty\n _pretty = True\n\n if precision is not None:\n print_precision(precision)", "def print_precision(newVal):\n\n global _print_precision\n _print_precision = newVal", "def change_precision(self, precision):\n if precision <= 0:\n ...
[ "0.757847", "0.73039174", "0.6959099", "0.6884991", "0.67243856", "0.67243856", "0.6718777", "0.67100877", "0.66339517", "0.6620663", "0.65527785", "0.65101314", "0.64424366", "0.6384509", "0.6360872", "0.6345577", "0.6247754", "0.61790705", "0.61421824", "0.6113953", "0.6089...
0.73425615
1
Export and convert IPython notebooks. This function can export the current IPython history to a notebook file. For example, to export the history to "foo.ipynb" do "%notebook foo.ipynb".
def notebook(self, s): args = magic_arguments.parse_argstring(self.notebook, s) outfname = os.path.expanduser(args.filename) from nbformat import write, v4 cells = [] hist = list(self.shell.history_manager.get_range()) if(len(hist)<=1): raise ValueError('His...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def export_notebook():\n #system(\"jupyter nbconvert --to HTML \\\"Look At Enron data set.ipynb\\\"\")\n system(\"jupyter nbconvert --to HTML --output=Look+At+Enron+data+set.html \\\"Look At Enron data set.ipynb\\\"\")\n return", "def write_ipynb(self):\n for nb in self.notebooks:\n nb...
[ "0.71642846", "0.68301135", "0.65881234", "0.6487903", "0.64567846", "0.5952403", "0.594547", "0.58961153", "0.5785317", "0.5723071", "0.57086545", "0.57086545", "0.56980693", "0.5676546", "0.56310064", "0.55674374", "0.5566094", "0.5562021", "0.5553838", "0.55506295", "0.544...
0.73101354
0
Allow to change the status of the autoawait option. This allow you to set a specific asynchronous code runner. If no value is passed, print the currently used asynchronous integration and whether it is activated.
def autoawait(self, parameter_s): param = parameter_s.strip() d = {True: "on", False: "off"} if not param: print("IPython autoawait is `{}`, and set to use `{}`".format( d[self.shell.autoawait], self.shell.loop_runner )) retur...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async def test_async_auto():\n\n # async_auto does not need the device to be turned on\n with patch(f\"{WinixDriver_TypeName}.auto\") as auto:\n wrapper = build_mock_wrapper()\n\n await wrapper.async_auto()\n assert auto.call_count == 1\n\n assert wrapper.is_auto\n assert n...
[ "0.5827595", "0.5567515", "0.5465915", "0.5392628", "0.53377235", "0.5308207", "0.5279893", "0.5268618", "0.52296335", "0.5152432", "0.5147058", "0.5127005", "0.51137936", "0.51014507", "0.5091649", "0.50755996", "0.50735295", "0.50704974", "0.5058925", "0.50251067", "0.49987...
0.7202524
0
Encode data_dict using torch.save.
def _encode_data_dict(self, data_dict: dict) -> dict: # If we have _BYTES_DATA_KEY or _FS_CHECKPOINT_KEY in the data dict, # that means this is a directory checkpoint which has already been # converted into bytes. We don't want to double-encode it. # See the definition of super().__gets...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def save(net, txt_dict, path):\n dict_m = net.state_dict()\n _ = txt_dict\n torch.save(dict_m,path)", "def save(net,dic,path):\n dict_m = net.state_dict()\n dict_m[\"word_dic\"] = dic \n torch.save(dict_m,path)", "def writeData(self, dataDict):\n pass", "def save(net,dic,path):\n ...
[ "0.67378116", "0.66537535", "0.6601616", "0.65924007", "0.64825916", "0.6221453", "0.6200792", "0.6186967", "0.6029914", "0.60286236", "0.5955084", "0.59085", "0.5901615", "0.58946824", "0.5874945", "0.58724374", "0.586951", "0.585371", "0.58361745", "0.582497", "0.5804959", ...
0.6654838
1
Decode data_dict using torch_load if needed.
def _decode_data_dict(self, data_dict: dict) -> dict: if ENCODED_DATA_KEY not in data_dict: return data_dict encoded_data = data_dict[ENCODED_DATA_KEY] _buffer = io.BytesIO(encoded_data) data_dict = torch.load( _buffer, map_location="cpu" ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _decode(self, input_dict):\n pass", "def _load(self, load_dict):\n self._data_ = load_dict", "def loads(data):\n return Decoder().decode(data)", "def _load(self, load_dict):\n try:\n self.v_protocol = load_dict.pop(PickleParameter.PROTOCOL)\n except KeyError:\n ...
[ "0.63978714", "0.61605734", "0.6151607", "0.6140488", "0.6051491", "0.6045838", "0.5949124", "0.58842343", "0.5842552", "0.5824361", "0.56547487", "0.56415886", "0.56407255", "0.56250125", "0.5587078", "0.5552399", "0.55227", "0.5518422", "0.5492177", "0.54862183", "0.5441891...
0.7985188
0
Sets the dt_land_slide_time of this LandslideViewModel.
def dt_land_slide_time(self, dt_land_slide_time): self._dt_land_slide_time = dt_land_slide_time
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def dt_land_slide_time_end(self, dt_land_slide_time_end):\n\n self._dt_land_slide_time_end = dt_land_slide_time_end", "def dt_off_land_slide_time(self, dt_off_land_slide_time):\n\n self._dt_off_land_slide_time = dt_off_land_slide_time", "def dt_off_land_slide_time_end(self, dt_off_land_slide_time...
[ "0.7219535", "0.69628906", "0.5803215", "0.56844133", "0.56503665", "0.56335217", "0.5616314", "0.5570946", "0.55504394", "0.5502447", "0.54805285", "0.5420679", "0.54078424", "0.536137", "0.53596956", "0.52255434", "0.5212031", "0.51737964", "0.5143329", "0.51330763", "0.511...
0.86971784
0
Sets the utm_north_stop of this LandslideViewModel.
def utm_north_stop(self, utm_north_stop): self._utm_north_stop = utm_north_stop
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def utm_north_start(self, utm_north_start):\n\n self._utm_north_start = utm_north_start", "def utm_east_stop(self, utm_east_stop):\n\n self._utm_east_stop = utm_east_stop", "def utm_east_start(self, utm_east_start):\n\n self._utm_east_start = utm_east_start", "def utm_zone_stop(self, utm...
[ "0.72398114", "0.68355227", "0.6309416", "0.6002716", "0.5524846", "0.54269755", "0.5410285", "0.51742584", "0.5165562", "0.5128192", "0.5115813", "0.50662047", "0.49616137", "0.49376932", "0.49376932", "0.4906015", "0.48639664", "0.48483402", "0.48411524", "0.4806164", "0.48...
0.87445486
0
Sets the utm_east_stop of this LandslideViewModel.
def utm_east_stop(self, utm_east_stop): self._utm_east_stop = utm_east_stop
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def utm_east_start(self, utm_east_start):\n\n self._utm_east_start = utm_east_start", "def utm_north_stop(self, utm_north_stop):\n\n self._utm_north_stop = utm_north_stop", "def utm_zone_stop(self, utm_zone_stop):\n\n self._utm_zone_stop = utm_zone_stop", "def onStopMovingEastCommand(sel...
[ "0.78431374", "0.7264851", "0.66989887", "0.6567594", "0.60068506", "0.593893", "0.59218353", "0.58796144", "0.57829034", "0.57131755", "0.5621675", "0.55729276", "0.5286213", "0.5201476", "0.5201476", "0.5183025", "0.5165239", "0.5152673", "0.5152673", "0.5152673", "0.510789...
0.91497594
0
Sets the utm_zone_stop of this LandslideViewModel.
def utm_zone_stop(self, utm_zone_stop): self._utm_zone_stop = utm_zone_stop
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def utm_east_stop(self, utm_east_stop):\n\n self._utm_east_stop = utm_east_stop", "def utm_north_stop(self, utm_north_stop):\n\n self._utm_north_stop = utm_north_stop", "def utm_zone_start(self, utm_zone_start):\n\n self._utm_zone_start = utm_zone_start", "def set_stop_time(self, stop_ti...
[ "0.6992202", "0.69020146", "0.61161387", "0.56973433", "0.56973433", "0.568038", "0.5528672", "0.5487052", "0.5480307", "0.5374373", "0.5200021", "0.5196107", "0.51804847", "0.5144764", "0.5099323", "0.50203323", "0.49972078", "0.49824843", "0.49533504", "0.4899301", "0.48568...
0.852716
0
Sets the land_slide_tid of this LandslideViewModel.
def land_slide_tid(self, land_slide_tid): self._land_slide_tid = land_slide_tid
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def land_slide_trigger_tid(self, land_slide_trigger_tid):\n\n self._land_slide_trigger_tid = land_slide_trigger_tid", "def land_slide_size_tid(self, land_slide_size_tid):\n\n self._land_slide_size_tid = land_slide_size_tid", "def land_slide_name(self, land_slide_name):\n\n self._land_slide...
[ "0.74662006", "0.74592316", "0.5954114", "0.5786251", "0.5719078", "0.5188832", "0.5188832", "0.5188832", "0.5188832", "0.5188832", "0.5054241", "0.5024024", "0.49792445", "0.49545458", "0.49208993", "0.4891214", "0.48605734", "0.48222616", "0.48222616", "0.48222616", "0.4822...
0.87264055
0
Sets the land_slide_name of this LandslideViewModel.
def land_slide_name(self, land_slide_name): self._land_slide_name = land_slide_name
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def land_slide_trigger_name(self, land_slide_trigger_name):\n\n self._land_slide_trigger_name = land_slide_trigger_name", "def land_slide_size_name(self, land_slide_size_name):\n\n self._land_slide_size_name = land_slide_size_name", "def set_name(self, _name):\n self.name = _name", "def ...
[ "0.75669974", "0.72538644", "0.619062", "0.61273307", "0.6058072", "0.6058072", "0.6058072", "0.6058072", "0.6058072", "0.6051759", "0.60234714", "0.60012084", "0.60012084", "0.5998968", "0.5988396", "0.5952358", "0.5950012", "0.59441054", "0.5933231", "0.5923952", "0.5905573...
0.8808541
0
Sets the land_slide_trigger_tid of this LandslideViewModel.
def land_slide_trigger_tid(self, land_slide_trigger_tid): self._land_slide_trigger_tid = land_slide_trigger_tid
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def land_slide_tid(self, land_slide_tid):\n\n self._land_slide_tid = land_slide_tid", "def land_slide_trigger_name(self, land_slide_trigger_name):\n\n self._land_slide_trigger_name = land_slide_trigger_name", "def trigger_id(self, trigger_id):\n\n self._trigger_id = trigger_id", "def lan...
[ "0.7079232", "0.62298405", "0.598309", "0.5893759", "0.52889764", "0.50392246", "0.48819435", "0.48145127", "0.48001224", "0.478176", "0.4780856", "0.4779004", "0.4731909", "0.4712493", "0.46451673", "0.46451673", "0.460823", "0.460823", "0.460823", "0.460823", "0.460823", ...
0.87317926
0
Sets the land_slide_trigger_name of this LandslideViewModel.
def land_slide_trigger_name(self, land_slide_trigger_name): self._land_slide_trigger_name = land_slide_trigger_name
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def land_slide_name(self, land_slide_name):\n\n self._land_slide_name = land_slide_name", "def trigger_name(self, trigger_name: \"str\"):\n self._attrs[\"triggerName\"] = trigger_name", "def land_slide_trigger_tid(self, land_slide_trigger_tid):\n\n self._land_slide_trigger_tid = land_slide...
[ "0.74336916", "0.7353381", "0.6264061", "0.60174197", "0.58826625", "0.544736", "0.53697306", "0.5366376", "0.5324842", "0.52707106", "0.52707106", "0.5261411", "0.5236614", "0.5236614", "0.52042437", "0.5202438", "0.5178088", "0.51763123", "0.51721793", "0.5154824", "0.51548...
0.8938869
0
Sets the land_slide_size_tid of this LandslideViewModel.
def land_slide_size_tid(self, land_slide_size_tid): self._land_slide_size_tid = land_slide_size_tid
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def land_slide_size_name(self, land_slide_size_name):\n\n self._land_slide_size_name = land_slide_size_name", "def land_slide_tid(self, land_slide_tid):\n\n self._land_slide_tid = land_slide_tid", "def set_size(self, size):\n \n self.width = size[0]\n self.height = size[1]", ...
[ "0.6876164", "0.65713716", "0.6247053", "0.6006086", "0.5982348", "0.58198637", "0.5738395", "0.5697445", "0.5697445", "0.56741", "0.5447388", "0.54145956", "0.5397633", "0.53933614", "0.53933614", "0.53933614", "0.53933614", "0.5389313", "0.5380527", "0.5369201", "0.536427",...
0.87594175
0
Sets the land_slide_size_name of this LandslideViewModel.
def land_slide_size_name(self, land_slide_size_name): self._land_slide_size_name = land_slide_size_name
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def land_slide_name(self, land_slide_name):\n\n self._land_slide_name = land_slide_name", "def land_slide_size_tid(self, land_slide_size_tid):\n\n self._land_slide_size_tid = land_slide_size_tid", "def land_slide_trigger_name(self, land_slide_trigger_name):\n\n self._land_slide_trigger_nam...
[ "0.70535576", "0.63898885", "0.5934846", "0.5727138", "0.5650719", "0.5535198", "0.5494513", "0.54402375", "0.542245", "0.54216695", "0.54216695", "0.539849", "0.53788596", "0.5378237", "0.5373643", "0.5373643", "0.5373643", "0.5373643", "0.535486", "0.5337886", "0.5326846", ...
0.88934284
0
Sets the dt_land_slide_time_end of this LandslideViewModel.
def dt_land_slide_time_end(self, dt_land_slide_time_end): self._dt_land_slide_time_end = dt_land_slide_time_end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def dt_off_land_slide_time_end(self, dt_off_land_slide_time_end):\n\n self._dt_off_land_slide_time_end = dt_off_land_slide_time_end", "def end_date_time(self, end_date_time):\n\n self._end_date_time = end_date_time", "def end_time(self, end_time):\n\n self._end_time = end_time", "def end...
[ "0.79389036", "0.72396976", "0.6889145", "0.6889145", "0.6889145", "0.6849814", "0.6849814", "0.67698175", "0.6728518", "0.6524322", "0.63764745", "0.63068783", "0.624188", "0.624188", "0.624188", "0.624188", "0.624188", "0.624188", "0.624188", "0.624188", "0.6231079", "0.6...
0.8900883
0
Sets the geo_hazard_tid of this LandslideViewModel.
def geo_hazard_tid(self, geo_hazard_tid): self._geo_hazard_tid = geo_hazard_tid
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def geo_hazard_name(self, geo_hazard_name):\n\n self._geo_hazard_name = geo_hazard_name", "def geo_hazard_name(self, geo_hazard_name):\n\n self._geo_hazard_name = geo_hazard_name", "def land_slide_trigger_tid(self, land_slide_trigger_tid):\n\n self._land_slide_trigger_tid = land_slide_trig...
[ "0.6491999", "0.6491999", "0.5534271", "0.5451261", "0.48015103", "0.4699138", "0.46929336", "0.46734938", "0.4603405", "0.45420662", "0.4509824", "0.44665295", "0.44623497", "0.44525886", "0.44516638", "0.44472566", "0.43302107", "0.43166965", "0.4311497", "0.42986602", "0.4...
0.8569157
1
Sets the geo_hazard_name of this LandslideViewModel.
def geo_hazard_name(self, geo_hazard_name): self._geo_hazard_name = geo_hazard_name
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def land_slide_trigger_name(self, land_slide_trigger_name):\n\n self._land_slide_trigger_name = land_slide_trigger_name", "def geo_hazard_tid(self, geo_hazard_tid):\n\n self._geo_hazard_tid = geo_hazard_tid", "def geo_hazard_tid(self, geo_hazard_tid):\n\n self._geo_hazard_tid = geo_hazard_...
[ "0.6323422", "0.62066716", "0.62066716", "0.6135837", "0.5927031", "0.5617146", "0.5609137", "0.5393717", "0.5380822", "0.5369574", "0.5369574", "0.5369574", "0.5369574", "0.5369574", "0.5360634", "0.5360634", "0.5356345", "0.5337057", "0.5329886", "0.5327257", "0.5286704", ...
0.88625747
1
Sets the activity_influenced_tid of this LandslideViewModel.
def activity_influenced_tid(self, activity_influenced_tid): self._activity_influenced_tid = activity_influenced_tid
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def activity_influenced_name(self, activity_influenced_name):\n\n self._activity_influenced_name = activity_influenced_name", "def set_tid(self, tid):\n self.__tid = tid", "def land_slide_tid(self, land_slide_tid):\n\n self._land_slide_tid = land_slide_tid", "def damage_extent_tid(self, ...
[ "0.6191259", "0.5337891", "0.5294225", "0.50677216", "0.5000091", "0.498436", "0.49567237", "0.49367005", "0.4885188", "0.47556373", "0.47388002", "0.47022346", "0.46489573", "0.46120813", "0.45767936", "0.45697528", "0.45691535", "0.45588946", "0.45266706", "0.45266706", "0....
0.8416941
0
Sets the activity_influenced_name of this LandslideViewModel.
def activity_influenced_name(self, activity_influenced_name): self._activity_influenced_name = activity_influenced_name
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def activity_influenced_tid(self, activity_influenced_tid):\n\n self._activity_influenced_tid = activity_influenced_tid", "def map_activity_name(self, name):\n newname = self.amappings.get(name)\n if newname is None:\n return 'Other'\n else:\n return newname", ...
[ "0.5815861", "0.569146", "0.5454217", "0.5454217", "0.5416236", "0.5375903", "0.5342271", "0.5341752", "0.5300046", "0.5294937", "0.5294937", "0.5227486", "0.51914984", "0.51880634", "0.51769996", "0.51763695", "0.5171618", "0.5165369", "0.5165369", "0.51511717", "0.51440233"...
0.8486172
0
Sets the forecast_accurate_tid of this LandslideViewModel.
def forecast_accurate_tid(self, forecast_accurate_tid): self._forecast_accurate_tid = forecast_accurate_tid
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def forecast_accurate_name(self, forecast_accurate_name):\n\n self._forecast_accurate_name = forecast_accurate_name", "def set_task_forecast(self):\n\n tasks = self._get_all_tasks()\n\n task_id = tasks[self.tasks_view.currentRow()].Id\n\n self.tasks_flow.set_status(task_id, 3)\n\n ...
[ "0.6580412", "0.5682055", "0.55744797", "0.55744797", "0.5312437", "0.49953452", "0.49438086", "0.49117878", "0.4676294", "0.46082634", "0.45858356", "0.45798764", "0.45777935", "0.44925314", "0.44822437", "0.4474174", "0.44695246", "0.4405273", "0.43961298", "0.4390987", "0....
0.8720378
0
Sets the forecast_accurate_name of this LandslideViewModel.
def forecast_accurate_name(self, forecast_accurate_name): self._forecast_accurate_name = forecast_accurate_name
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def forecast_accurate_tid(self, forecast_accurate_tid):\n\n self._forecast_accurate_tid = forecast_accurate_tid", "def forecast_date(self, forecast_date):\n self._forecast_date = forecast_date.strftime(\"%a %b %d\")", "def enable_forecast(self, enable_forecast):\n\n self._enable_forecast =...
[ "0.63823014", "0.5875882", "0.54834306", "0.54834306", "0.5477455", "0.51436794", "0.50890255", "0.49418095", "0.49239802", "0.48860207", "0.48726422", "0.4728403", "0.47278684", "0.4726796", "0.4726796", "0.47040147", "0.46323523", "0.46076682", "0.4540731", "0.45308232", "0...
0.8883575
0
Sets the damage_extent_tid of this LandslideViewModel.
def damage_extent_tid(self, damage_extent_tid): self._damage_extent_tid = damage_extent_tid
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def damage_extent_name(self, damage_extent_name):\n\n self._damage_extent_name = damage_extent_name", "def tower_damage(self, tower_damage):\n\n self._tower_damage = tower_damage", "def land_slide_size_tid(self, land_slide_size_tid):\n\n self._land_slide_size_tid = land_slide_size_tid", ...
[ "0.67297006", "0.5751202", "0.572754", "0.5525234", "0.51919156", "0.51038945", "0.50611943", "0.4992961", "0.4926995", "0.49112517", "0.49071825", "0.48969746", "0.48945266", "0.4827388", "0.4820465", "0.48068848", "0.48064297", "0.4769242", "0.47372717", "0.47367844", "0.47...
0.8567385
0
Sets the damage_extent_name of this LandslideViewModel.
def damage_extent_name(self, damage_extent_name): self._damage_extent_name = damage_extent_name
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def damage_extent_tid(self, damage_extent_tid):\n\n self._damage_extent_tid = damage_extent_tid", "def land_slide_size_name(self, land_slide_size_name):\n\n self._land_slide_size_name = land_slide_size_name", "def tower_damage(self, tower_damage):\n\n self._tower_damage = tower_damage", ...
[ "0.6534705", "0.59690756", "0.5644936", "0.55477685", "0.52566946", "0.52185076", "0.520311", "0.51807725", "0.5176838", "0.5176838", "0.51660454", "0.51587", "0.51218116", "0.51012367", "0.51012367", "0.51012367", "0.5090892", "0.5090892", "0.5090892", "0.5090892", "0.507553...
0.8837939
0
Sets the utm_zone_start of this LandslideViewModel.
def utm_zone_start(self, utm_zone_start): self._utm_zone_start = utm_zone_start
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def utm_north_start(self, utm_north_start):\n\n self._utm_north_start = utm_north_start", "def utm_east_start(self, utm_east_start):\n\n self._utm_east_start = utm_east_start", "def start(self, value):\n self.set_property(\"start\", DateTimeTimeZone.parse(value))", "def _set_start(self, ...
[ "0.70881575", "0.63403", "0.5869494", "0.58360475", "0.57101375", "0.56856775", "0.5582212", "0.5555666", "0.5542827", "0.5542827", "0.5542827", "0.5542827", "0.55192226", "0.55066764", "0.5444019", "0.5378686", "0.5377305", "0.53537965", "0.5269706", "0.5269706", "0.5269706"...
0.83880484
0
Sets the utm_north_start of this LandslideViewModel.
def utm_north_start(self, utm_north_start): self._utm_north_start = utm_north_start
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def utm_east_start(self, utm_east_start):\n\n self._utm_east_start = utm_east_start", "def utm_north_stop(self, utm_north_stop):\n\n self._utm_north_stop = utm_north_stop", "def utm_zone_start(self, utm_zone_start):\n\n self._utm_zone_start = utm_zone_start", "def _set_start(self, coordi...
[ "0.6495583", "0.642987", "0.6113982", "0.5918706", "0.56617165", "0.56316304", "0.5618837", "0.5609295", "0.5609295", "0.5609295", "0.5609295", "0.5536339", "0.551795", "0.5501733", "0.54976344", "0.54821616", "0.5468842", "0.54335153", "0.54309225", "0.5402876", "0.5390635",...
0.87721413
0
Sets the utm_east_start of this LandslideViewModel.
def utm_east_start(self, utm_east_start): self._utm_east_start = utm_east_start
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def utm_east_stop(self, utm_east_stop):\n\n self._utm_east_stop = utm_east_stop", "def utm_north_start(self, utm_north_start):\n\n self._utm_north_start = utm_north_start", "def utm_north_stop(self, utm_north_stop):\n\n self._utm_north_stop = utm_north_stop", "def utm_zone_start(self, ut...
[ "0.73017645", "0.7175089", "0.6257757", "0.61852336", "0.5865738", "0.56424665", "0.5599301", "0.5522874", "0.5509234", "0.54452366", "0.5277666", "0.51374996", "0.50918376", "0.49603474", "0.49385136", "0.48319417", "0.47520003", "0.47139794", "0.47064868", "0.46917704", "0....
0.89405537
0
Sets the dt_off_land_slide_time of this LandslideViewModel.
def dt_off_land_slide_time(self, dt_off_land_slide_time): self._dt_off_land_slide_time = dt_off_land_slide_time
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def dt_off_land_slide_time_end(self, dt_off_land_slide_time_end):\n\n self._dt_off_land_slide_time_end = dt_off_land_slide_time_end", "def dt_land_slide_time_end(self, dt_land_slide_time_end):\n\n self._dt_land_slide_time_end = dt_land_slide_time_end", "def dt_land_slide_time(self, dt_land_slide_...
[ "0.8221341", "0.6721935", "0.6354692", "0.63160694", "0.547847", "0.5462861", "0.54092073", "0.53370935", "0.5327686", "0.5325793", "0.5235885", "0.52342874", "0.5229858", "0.51600933", "0.5135518", "0.5135518", "0.5110766", "0.50869346", "0.50765985", "0.5069149", "0.5066656...
0.88813484
0
Sets the dt_off_land_slide_time_end of this LandslideViewModel.
def dt_off_land_slide_time_end(self, dt_off_land_slide_time_end): self._dt_off_land_slide_time_end = dt_off_land_slide_time_end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def dt_off_land_slide_time(self, dt_off_land_slide_time):\n\n self._dt_off_land_slide_time = dt_off_land_slide_time", "def dt_land_slide_time_end(self, dt_land_slide_time_end):\n\n self._dt_land_slide_time_end = dt_land_slide_time_end", "def end_date_time(self, end_date_time):\n\n self._en...
[ "0.8042958", "0.79574883", "0.68168366", "0.62984216", "0.62984216", "0.6278303", "0.6278303", "0.6278303", "0.6038268", "0.6024883", "0.599109", "0.599109", "0.599109", "0.599109", "0.599109", "0.599109", "0.599109", "0.599109", "0.59637755", "0.59442294", "0.5923649", "0....
0.89746404
0
Sets the urls of this LandslideViewModel.
def urls(self, urls): self._urls = urls
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def image_urls(self, image_urls):\n\n self._image_urls = image_urls", "def websites(self, websites):\n\n self._websites = websites", "def mutate_urls(self, mutator):", "def links(self, links):\n self._links = links", "def get_urls(self, **kwargs):\n pass # pragma: no cover", ...
[ "0.65364957", "0.6189246", "0.60900533", "0.6072757", "0.6005544", "0.5946692", "0.5946692", "0.5946692", "0.5946692", "0.5946692", "0.5946692", "0.5946692", "0.5946692", "0.5946692", "0.5946692", "0.5946692", "0.59408444", "0.57441276", "0.5731843", "0.57088363", "0.5703454"...
0.80072206
0
get the exact archaelogical SFH if at_birth is True, then use the birth masses of the stars (i.e., rewind stellar mass loss). otherwise uses the present masses of the stars
def get_archeological_sfh(self, at_birth=True, zero=True): from .histograms import cumulative_histogram xprop = 'form.scalefactor' aform = self.star_particle_prop('form.scalefactor') tform = self.star_particle_prop('form.time') if at_birth: mass = self.star_particle...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_amesdusty_atmosphere(metallicity=0, temperature=5000, gravity=4):\n sp = pysynphot.Icat('AMESdusty', temperature, metallicity, gravity)\n\n # Do some error checking\n idx = np.where(sp.flux != 0)[0]\n if len(idx) == 0:\n print( 'Could not find AMESdusty Allard+ 2000 atmosphere model for'...
[ "0.5413462", "0.5380975", "0.53352326", "0.53259385", "0.5298772", "0.5295151", "0.5104418", "0.5086355", "0.50784206", "0.5047286", "0.50337905", "0.50335413", "0.5010034", "0.4997089", "0.4979522", "0.49770796", "0.49486694", "0.4943231", "0.49335125", "0.49131578", "0.4887...
0.66441417
0
get different moments (i.e., important times) of the star formation history. returns a dictionary w/ entires 'time.'+percentiles[ii] corresponds to the cosmic time when the SFH hit each percentile. 'duration.'+durations[ii][0]+'.to.'+durations[ii][1] corresponds to the time difference between when the SFH hit the first...
def get_sfh_moments(self, sfh=None, percentiles=[5, 10, 25, 50, 90, 95, 100], durations=[[10, 90]], masses=[1e3, 1e4, 1e5, 1e6, 1e7, 1e8, 1e9, 1e10]): if sfh is None: if self.sfh is None: sfh = self.get_archeological_sfh() else: sfh = self.sfh res ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _extract_timings(self, outfile):\n f = open_general(outfile)\n tmptxt = f.readlines()\n f.close()\n search_keys = ['time until scf starts',\n 'vpot->tmat',\n 'gref->gmat',\n 'gonsite->density',\n ...
[ "0.54469705", "0.5436064", "0.53274053", "0.52636665", "0.5247591", "0.5159828", "0.5142936", "0.5122013", "0.51134354", "0.5101617", "0.50895876", "0.5063786", "0.50499344", "0.5018688", "0.4988214", "0.49591988", "0.49522528", "0.49399486", "0.49228936", "0.4917621", "0.491...
0.76178396
0
build/get the index in each hals[ii] of the main branch progenitor of this halo or of a host
def build_hals_main_branch_indices(self, do_host=False): def get_mmp_index(my_id, previous_hal, mmp_prop='vel.circ.max'): # first get the indices in the previous catalog where the descendant is my ID if not len(previous_hal): return -2**31 progenitor_indices...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_main_branch_indices(self):\n\n assert self.halt is not None\n prog_main_index = self.halt_index\n prog_main_indices = self.halt.prop(\n 'progenitor.main.indices', self.halt_index)\n self.main_branch_indices = prog_main_indices\n return prog_main_indices", "de...
[ "0.68868554", "0.6058372", "0.58520323", "0.58520323", "0.5714714", "0.5636622", "0.5634934", "0.558093", "0.558093", "0.5541081", "0.5500506", "0.5478552", "0.5448148", "0.54451066", "0.5343287", "0.5310476", "0.5292485", "0.5280178", "0.5280178", "0.5247493", "0.5242768", ...
0.7910391
0
set/return the indices of the main branch of the halo in the halt tree really just a thin wrapper around self.halt.prop('progenitor.main.indices')
def get_main_branch_indices(self): assert self.halt is not None prog_main_index = self.halt_index prog_main_indices = self.halt.prop( 'progenitor.main.indices', self.halt_index) self.main_branch_indices = prog_main_indices return prog_main_indices
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def build_hals_main_branch_indices(self, do_host=False):\n\n def get_mmp_index(my_id, previous_hal, mmp_prop='vel.circ.max'):\n # first get the indices in the previous catalog where the descendant is my ID\n if not len(previous_hal):\n return -2**31\n\n progen...
[ "0.710406", "0.6718186", "0.66938007", "0.63476104", "0.6212972", "0.6016585", "0.5990631", "0.59314156", "0.5869125", "0.5853409", "0.58192885", "0.5818838", "0.58116156", "0.5801271", "0.57553524", "0.5738894", "0.5733967", "0.5725843", "0.57231647", "0.5683751", "0.5672556...
0.8490454
0
gets + assigns distance from the host (or host2) as a function of scalefactor, time, and redshift pericentric distance xprop of pericentric distance first infall time (defined as crossing halt.prop('radius')) last infall time if infall_radius > 0, then use a fixed physical radius to define infall. otherwise, grabs halt...
def get_orbit_history(self, preferred_method='halt', wrt_host2=False, infall_radius=-1, interpolate=0): host = 'host' if wrt_host2: host = 'host2' dist_prop = host+'.distance.total' total_distance_evolution = self.get_prop_evolution( prop_name=dist_prop, preferre...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def interpolate(self, distance, normalized=...): # -> BaseGeometry:\n ...", "def InterpolateDerivs(self, , p_float=..., p_float=..., p_float=..., p_float=..., p_float=..., p_float=..., p_float=..., p_float=..., p_float=..., p_float=..., p_float=..., p_float=..., p_float=..., p_float=..., p_float=..., p_f...
[ "0.60712093", "0.58652836", "0.574965", "0.53956246", "0.5303069", "0.5111495", "0.5068122", "0.5034429", "0.503317", "0.4898204", "0.4831143", "0.4804419", "0.4772151", "0.4717473", "0.4717408", "0.47017497", "0.4698235", "0.4695093", "0.4691848", "0.46655902", "0.46295878",...
0.6104926
0
Provide the finalize interface but returns an empty bytestring.
def finalize(self): return b""
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def finalize(self):\n raise NotImplementedError('Must be implemented in subclasses.')", "def finalize():\n pass", "def finalize():\n pass", "def finalize():", "def finalize():", "def finalize():", "def finalize(self):\n # type: () -> bytes\n if self.finished:\n raise R...
[ "0.7043261", "0.7001078", "0.7001078", "0.69159186", "0.69159186", "0.69159186", "0.6863568", "0.6809864", "0.6806617", "0.6804474", "0.6700476", "0.6673396", "0.6575131", "0.6573966", "0.6554497", "0.65144736", "0.65144736", "0.65144736", "0.65144736", "0.65144736", "0.65144...
0.82662636
0
Build an instance of this padding type.
def build(self, block_size=None): # type: (int) -> Any return self.padding(mgf=self.mgf(algorithm=self.mgf_digest()), algorithm=self.digest(), label=None)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def build(self):\n pad_size_tmp = list(self.pad_size)\n\n # This handles the case where the padding is equal to the image size\n if pad_size_tmp[0] == self.input_size[0]:\n pad_size_tmp[0] -= 1\n pad_size_tmp[1] -= 1\n if pad_size_tmp[2] == self.input_size[1]:\n ...
[ "0.73508173", "0.64263195", "0.63907427", "0.6280838", "0.61482656", "0.608257", "0.5915885", "0.58838165", "0.5481579", "0.542678", "0.54138845", "0.5410868", "0.5301848", "0.52579415", "0.5243811", "0.5186286", "0.5161371", "0.51525074", "0.51280165", "0.51116925", "0.50556...
0.65495086
1
Determine whether the requested algorithm name is compatible with this cipher
def validate_algorithm(self, algorithm): # type: (Text) -> None if not algorithm == self.java_name: raise InvalidAlgorithmError( 'Requested algorithm "{requested}" is not compatible with cipher "{actual}"'.format( requested=algorithm, actual=self.java_name...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_compatibility(cipher, mode):\n\n chiper_obj = cipher_params(cipher, os.urandom(length_by_cipher[cipher]))[0] #need to be object, not interface, to validate_for_algorithm work\n if chiper_obj.name == \"ChaCha20\":\n return True\n mode_object = None\n if mode == 'CBC':\n mode_obje...
[ "0.7059006", "0.6156313", "0.601304", "0.5947606", "0.5947606", "0.5947606", "0.5947606", "0.59301275", "0.58890396", "0.58032167", "0.5748588", "0.57206565", "0.5707566", "0.570113", "0.5670079", "0.5629978", "0.5629978", "0.56100786", "0.5537851", "0.5515106", "0.5451762", ...
0.71650994
0
Catcher for algorithms that do not support encryption.
def _disabled_encrypt(self, *args, **kwargs): raise NotImplementedError('"encrypt" is not supported by the "{}" algorithm'.format(self.java_name))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def encryption_oracle(unknown_encryptor: Callable[[bytes, bytes], bytes]) -> str:\n my_bytes = b'This is 16 bytes'*3\n encrypted_bytes = unknown_encryptor(my_bytes, os.urandom(16))\n hamming_distance = average_hamming_distance_between_blocks(encrypted_bytes[16:], 16, 2)\n return 'ECB' if hamming_distan...
[ "0.63180155", "0.629584", "0.6019077", "0.6006186", "0.5998825", "0.5943577", "0.59168893", "0.5908598", "0.587573", "0.58579063", "0.57771105", "0.5704443", "0.56115013", "0.56064147", "0.56064147", "0.5599425", "0.559885", "0.55927294", "0.55466473", "0.552622", "0.5520515"...
0.65303123
0
Catcher for algorithms that do not support decryption.
def _disabled_decrypt(self, *args, **kwargs): raise NotImplementedError('"decrypt" is not supported by the "{}" algorithm'.format(self.java_name))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def operate_cipher(self):", "def decrypt(self, data):", "def test_endecrypt():\n\n e, d, c = keygen()\n\n test_encryption(e, c)\n test_decryption(d, c)\n key_cracker(e, c)", "def test_decrypt_format(self):\n with pytest.raises(EncryptionError):\n decrypt('message')", "def test...
[ "0.67000335", "0.66930264", "0.6556195", "0.65125716", "0.6437394", "0.6292988", "0.6241997", "0.62134707", "0.6170879", "0.61672276", "0.61314106", "0.6117576", "0.6113527", "0.6032689", "0.60208803", "0.5976708", "0.59284073", "0.5923089", "0.591916", "0.5895975", "0.588966...
0.6871992
0
Wrap key using AES keywrap.
def wrap(self, wrapping_key, key_to_wrap): # type: (bytes, bytes) -> bytes if self.java_name not in ("AES", "AESWrap"): raise NotImplementedError('"wrap" is not supported by the "{}" cipher'.format(self.java_name)) try: return keywrap.aes_key_wrap(wrapping_key=wrapping_k...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def aes_key_wrap(self, kek: bytes, key_to_wrap: bytes) -> bytes:\n return keywrap.aes_key_wrap(kek, key_to_wrap, default_backend())", "def wrap(self, key:bytes, credential:PublicKeyCredentialSource)->bytes:\n return keywrap.aes_key_wrap_with_padding(key,credential.get_bytes(True),default_backend())...
[ "0.85019183", "0.75690323", "0.72557336", "0.6901863", "0.6676436", "0.65213686", "0.6485825", "0.6472047", "0.64602166", "0.63891965", "0.6376438", "0.63255215", "0.6321324", "0.6256169", "0.6248275", "0.62136483", "0.62017894", "0.6161924", "0.61303157", "0.6125529", "0.608...
0.79771274
1
Unwrap key using AES keywrap.
def unwrap(self, wrapping_key, wrapped_key): # type: (bytes, bytes) -> bytes if self.java_name not in ("AES", "AESWrap"): raise NotImplementedError('"unwrap" is not supported by this cipher') try: return keywrap.aes_key_unwrap(wrapping_key=wrapping_key, wrapped_key=wrapp...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def aes_key_unwrap(self, kek: bytes, wrapped_key: bytes) -> bytes:\n return keywrap.aes_key_unwrap(kek, wrapped_key, default_backend())", "def aes_key_wrap(self, kek: bytes, key_to_wrap: bytes) -> bytes:\n return keywrap.aes_key_wrap(kek, key_to_wrap, default_backend())", "def unwrap(self, key:by...
[ "0.81411636", "0.69441694", "0.65963113", "0.64497554", "0.6405844", "0.6346691", "0.6330461", "0.63212574", "0.6320856", "0.63159627", "0.6076988", "0.6034282", "0.6028195", "0.6021996", "0.6013898", "0.6000653", "0.5965551", "0.5892046", "0.5886609", "0.5882251", "0.5850330...
0.7904383
1