query
stringlengths
9
3.4k
document
stringlengths
9
87.4k
metadata
dict
negatives
listlengths
4
101
negative_scores
listlengths
4
101
document_score
stringlengths
3
10
document_rank
stringclasses
102 values
Path to the main executable. For an app, this is app itself. For a Framework, this is the main framework
def get_executable_path(self): executable_name = None if 'CFBundleExecutable' in self.info: executable_name = self.info['CFBundleExecutable'] else: executable_name, _ = splitext(basename(self.path)) executable_name = utils.remove_control_char(executable_name) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_executable(self) -> str:\n ...", "def GetLauncherPath(self):\n return os.path.dirname(__file__)", "def GetLauncherPath(self):\n return os.path.dirname(__file__)", "def this_folder():\n if getattr(sys, 'frozen', False):\n # The application is frozen\n return os.path.dirna...
[ "0.69457704", "0.6923044", "0.6923044", "0.6894284", "0.6816904", "0.67749614", "0.6739322", "0.67294186", "0.6697168", "0.66547674", "0.6633224", "0.6616876", "0.6615852", "0.6609995", "0.6549488", "0.65441966", "0.6451003", "0.6433944", "0.6424938", "0.6412598", "0.63580215...
0.653631
16
Sign all the dylibs in this directory
def sign_dylibs(self, signer, path): for dylib_path in glob.glob(join(path, '*.dylib')): dylib = signable.Dylib(self, dylib_path, signer) dylib.sign(self, signer)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def sign_dylibs(self, cms_signer, path):\n for dylib_path in glob.glob(join(path, '*.dylib')):\n dylib = signable.Dylib(self, dylib_path, cms_signer)\n dylib.sign(self, cms_signer)", "def sign(self, signer):\n # log.debug(\"SIGNING: %s\" % self.path)\n frameworks_path =...
[ "0.8432315", "0.6325134", "0.59998757", "0.5821335", "0.5536926", "0.5455998", "0.53087306", "0.51840645", "0.5171187", "0.5158678", "0.5043617", "0.4983382", "0.49256852", "0.4905008", "0.48366326", "0.48080102", "0.47965342", "0.47516686", "0.47421157", "0.47248307", "0.470...
0.8295412
1
Sign everything in this bundle, recursively with subbundles
def sign(self, signer): # log.debug("SIGNING: %s" % self.path) frameworks_path = join(self.path, 'Frameworks') if exists(frameworks_path): # log.debug("SIGNING FRAMEWORKS: %s" % frameworks_path) # sign all the frameworks for framework_name in os.listdir(framew...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def resign(self, deep, cms_signer, provisioner):\n # log.debug(\"SIGNING: %s\" % self.path)\n if deep:\n plugins_path = join(self.path, 'PlugIns')\n if exists(plugins_path):\n # sign the appex executables\n appex_paths = glob.glob(join(plugins_path,...
[ "0.5995381", "0.5584379", "0.55598193", "0.55531466", "0.55146366", "0.54876906", "0.52974087", "0.52845377", "0.5166314", "0.51473546", "0.5102368", "0.50621337", "0.50598043", "0.5002848", "0.49882516", "0.49192393", "0.4897663", "0.48194253", "0.48167092", "0.48128116", "0...
0.59542173
1
signs bundle, modifies in place
def resign(self, signer): self.sign(signer) log.debug("Resigned bundle at <%s>", self.path)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def sign(self, object):\n pass", "def sign(self, payload):\n raise NotImplementedError", "def _re_codesign(app_path, signing_identity, provision_path=None):\n bundle_type = PackageType.get_type(app_path)\n logger.debug('Re-codesigning %s...' % (bundle_type,))\n if bundle_type == PackageT...
[ "0.6849241", "0.65445966", "0.6377147", "0.6371257", "0.63314426", "0.6310475", "0.62609345", "0.61872184", "0.61623085", "0.6129731", "0.61247724", "0.607729", "0.6056486", "0.60021913", "0.59386194", "0.59081775", "0.58716357", "0.5862046", "0.5852787", "0.58021504", "0.577...
0.66369
1
Given a path to a provisioning profile, return the entitlements encoded therein
def extract_entitlements(provision_path): cmd = [ 'smime', '-inform', 'der', '-verify', # verifies content, prints verification status to STDERR, # outputs content to STDOUT. In our case, will be an XML plist '-noverify', # accept se...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def resign(self, signer, provisioning_profile, alternate_entitlements_path=None):\n\n # TODO all this mucking about with entitlements feels wrong. The entitlements_path is\n # not actually functional, it's just a way of passing it to later stages of signing.\n # Maybe we should determine entit...
[ "0.5083228", "0.49126115", "0.49077302", "0.47404766", "0.4691661", "0.4553458", "0.454329", "0.4531003", "0.4473628", "0.44085193", "0.4406375", "0.44050503", "0.439604", "0.43790016", "0.43628758", "0.4326153", "0.43213052", "0.43070796", "0.43030575", "0.42926168", "0.4262...
0.7646078
0
Write entitlements to self.entitlements_path. This actually doesn't matter to the app, it's just used later on by other parts of the signing process.
def write_entitlements(self, entitlements): biplist.writePlist(entitlements, self.entitlements_path, binary=False) log.debug("wrote Entitlements to {0}".format(self.entitlements_path))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def entitlements(self) -> Entitlements:\n return self.__entitlements", "def resign(self, signer, provisioning_profile, alternate_entitlements_path=None):\n\n # TODO all this mucking about with entitlements feels wrong. The entitlements_path is\n # not actually functional, it's just a way of ...
[ "0.54211116", "0.5367477", "0.51338154", "0.51240337", "0.50888306", "0.508606", "0.4937517", "0.48715833", "0.48602337", "0.48598403", "0.48598403", "0.4844882", "0.48447084", "0.4842885", "0.48324612", "0.48164335", "0.47696745", "0.4747149", "0.4736882", "0.46891227", "0.4...
0.7737914
0
signs app in place
def resign(self, signer, provisioning_profile, alternate_entitlements_path=None): # TODO all this mucking about with entitlements feels wrong. The entitlements_path is # not actually functional, it's just a way of passing it to later stages of signing. # Maybe we should determine entitlements d...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def package_app(\n self, app: BaseConfig, sign_app=True, identity=None, adhoc_sign=False, **kwargs\n ):\n if sign_app:\n if adhoc_sign:\n identity = \"-\"\n\n print()\n print(\"[{app.app_name}] Signing app with adhoc identity...\".format(app=...
[ "0.6645783", "0.57181567", "0.57020706", "0.56410366", "0.5603273", "0.5575135", "0.5537196", "0.550395", "0.5460537", "0.5450264", "0.54468817", "0.54375774", "0.5419112", "0.5402969", "0.5399384", "0.5386594", "0.5349695", "0.53493875", "0.5327894", "0.5327894", "0.5280954"...
0.0
-1
creates the Tk object, the socket and starts running the entire code.
def __init__(self, host_ip="127.0.0.1", dst_port=2000): self.my_socket = socket.socket() try: self.my_socket.connect((host_ip, dst_port)) print("Connected to server successfully") except socket.error: print("no server is waiting...") sys.e...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def start(self):\n self.root.mainloop()", "def gui(host, port):\n class GUI:\n def __init__(self, window, host, port):\n self.window = window\n self.server = None\n self.scanner = None\n\n try:\n import Tkinter\n except Import...
[ "0.6866942", "0.6787806", "0.670932", "0.66793466", "0.6656448", "0.6599677", "0.6566132", "0.6566132", "0.650566", "0.6502823", "0.6465216", "0.6464862", "0.64515907", "0.6450801", "0.6447126", "0.64432055", "0.64035016", "0.63944876", "0.63612664", "0.6329764", "0.63289315"...
0.0
-1
this is the closing protocol. this function closes all Tk objects that might exist in order to close the program entirely.
def close_root(self): if self.messages_window is not None: self.messages_window.destroy() self.root.destroy()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def exit(self):\n \t\troot.destroy()\n \t\tpass", "def close(self):\n self.master.destroy()\n root.quit()", "def close_window(self):\n # Window - END\n self.root.destroy()", "def quit(self) -> None:\n global tcl_interp\n\n for child in tuple(self._children.values...
[ "0.76227576", "0.7615387", "0.74897474", "0.7447964", "0.7378788", "0.7371572", "0.7316284", "0.7227022", "0.7165061", "0.7121428", "0.7119809", "0.7099502", "0.7061996", "0.70610315", "0.70588726", "0.7033408", "0.7003686", "0.699336", "0.6988916", "0.6986488", "0.69839627",...
0.66862065
53
after 3 wrong attempts, this function will block the user from signing/logging in for 60 seconds.
def after_3_wrong_attempts(self, str_from_where): self.clear_screen() def timer_tick(seconds): """ this is an inner-function that is responsible for the timer after3 failed attempts at logging/signing in. :param seconds: :return: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def login():\n tries = 0\n username = ''\n while True:\n try:\n username = input(f'{Fore.YELLOW}please enter your username:{Fore.RESET}')\n check = check_lock(username)\n if not check:\n print(Fore.LIGHTRED_EX, 'your account is lock try later', Fore.R...
[ "0.6183937", "0.61305475", "0.60963434", "0.59451866", "0.59349215", "0.5923862", "0.5923862", "0.5903164", "0.58763486", "0.58410287", "0.5828673", "0.5819729", "0.5799313", "0.57935447", "0.5790253", "0.5775508", "0.5775508", "0.5775508", "0.5775508", "0.5775508", "0.577550...
0.5937697
4
this is an innerfunction that is responsible for the timer after3 failed attempts at logging/signing in.
def timer_tick(seconds): if seconds > 0: timer_label['text'] = "You had 3 wrong attempts.\nTry again in " + \ str(seconds) + " seconds." self.root.after(1000, lambda: timer_tick(seconds - 1)) else: if str...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def after_3_wrong_attempts(self, str_from_where):\r\n self.clear_screen()\r\n\r\n def timer_tick(seconds):\r\n \"\"\"\r\n this is an inner-function that is responsible for the\r\n timer after3 failed attempts at logging/signing in.\r\n :param seconds:\r\n ...
[ "0.7018955", "0.6663694", "0.65989476", "0.63709235", "0.6331907", "0.58595014", "0.5848615", "0.57283294", "0.5696457", "0.56867135", "0.568213", "0.5636375", "0.5482261", "0.54760987", "0.54586434", "0.5451943", "0.5442569", "0.5427316", "0.5427316", "0.54147637", "0.539198...
0.64727724
3
this function shows the log in window
def log_in(self): self.clear_screen() lbl_log_in = Label(self.root, text="Welcome. Please log in to the system.", font=self.title_font, bg=self.bg_color) lbl_log_in.pack(pady=5, padx=10) user_name = Label(self.root, text="ente...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def log_in(self):\n\t\tpass", "def show(self, window):\r\n\r\n return", "def iniciaUI(self):\n\n self.setGeometry(100,100, 250, 250)\n self.setWindowTitle(\"Login\")\n self.displayWidgets()\n\n self.show()", "def OnShowLog(self, event):\n dlg = LogViewer(self)\n ...
[ "0.6801101", "0.6755017", "0.6737144", "0.66676944", "0.65847325", "0.6565406", "0.655964", "0.64743286", "0.6425789", "0.64248353", "0.6400713", "0.63787353", "0.6243237", "0.624312", "0.62406", "0.62182665", "0.62177074", "0.6210246", "0.61971325", "0.61968756", "0.61666393...
0.685493
0
this function sends to the server the data and returns whether the client logged in successfully or not.
def submit_log_in(self, user_name, password, passcode): username_txt = user_name.get() password_txt = password.get() passcode_txt = passcode.get() self.my_socket.send(dumps("log in")) now = datetime.now() current_time = now.strftime("%H:%M:%S").split(":") t...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def login(self, input_user, input_pass):\n\n self.failed = False\n try:\n self.send_message('/login [' + input_user + '] [' + input_pass + ']\\r')\n\n except:\n sys.stderr.write('failed to login to server. \\n') \n Self.failed = True\n return False\n...
[ "0.6768166", "0.6648105", "0.6625738", "0.6543316", "0.6504854", "0.64551735", "0.6399411", "0.6391859", "0.6326033", "0.62819505", "0.6268547", "0.62323344", "0.62271833", "0.62131685", "0.61791146", "0.61692303", "0.6164457", "0.6153566", "0.6137831", "0.6118876", "0.611581...
0.6190278
14
this function shows the sign in window
def sign_in(self): self.clear_screen() lbl_sign_in = Label(self.root, text="Welcome. Please sign in to the system.", font=self.title_font, bg=self.bg_color) lbl_sign_in.pack(pady=5, padx=10) user_name = Label(self.root, text="enter user name", font=self...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def display():\n return render_template(\"signin.html\")", "def signin():\n return render_template(\n 'signin.html',\n title='Signin',\n time=datetime.now(),\n message='only for administrator'\n )", "def OnButtonSignInButton(self, event):\r\n\t\tself.staticTextSignedIn.SetL...
[ "0.715081", "0.6884875", "0.66977865", "0.6528256", "0.648015", "0.6424218", "0.6366826", "0.63019854", "0.6266997", "0.6252133", "0.6251155", "0.62202835", "0.61962193", "0.61757565", "0.6158013", "0.61518556", "0.6116523", "0.61122763", "0.6092992", "0.6079997", "0.6074448"...
0.67017686
2
this function sends to the server the data and returns whether the user was created successfully or not.
def submit_sign_in(self, user_name, id_widget, password1, password2, passcode): username_txt = user_name.get() id_txt = id_widget.get() password1_txt = password1.get() password2_txt = password2.get() passcode_txt = passcode.get() self.my_socket.send(dumps("sign in...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def post(self):\n data = UserRegister.parser.parse_args()\n\n if UserModel.find_by_id(data['username']):\n print(\"Failed\", file=sys.stderr)\n return {\n 'message':\n \"A user with name '{}' already exists.\"\n .format(data['username...
[ "0.7700298", "0.76356184", "0.7605254", "0.7489048", "0.74458635", "0.7436668", "0.7430833", "0.742777", "0.73581654", "0.7321634", "0.7161986", "0.71573776", "0.7126827", "0.71160984", "0.7112433", "0.7072901", "0.7072577", "0.70628417", "0.70024604", "0.6998687", "0.6992374...
0.0
-1
this function shows the paths window. the client may choose what to do.
def choose_path(self): if not self.receive_thread.is_alive(): self.receive_thread.start() self.clear_screen() self.refresh_button = None user_label = Label(self.root, text="Hello " + self.username, font=self.title_font, bg=self.bg_color, heigh...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def show_paths(self):\r\n print(\"------------------------\")\r\n print(\"######### ALL PATHS #########\")\r\n\r\n if self.size == 0:\r\n print(\"Empty tree!\")\r\n else:\r\n for i in range(1, self.root.size_tree + 1):\r\n node = self.select(i)\r\n ...
[ "0.6825162", "0.6483774", "0.63352376", "0.6284325", "0.6282731", "0.62729084", "0.6136906", "0.6114865", "0.6085493", "0.6074004", "0.6042653", "0.60341257", "0.59863263", "0.5984935", "0.5983212", "0.5978311", "0.5958783", "0.593991", "0.5929046", "0.5928629", "0.592335", ...
0.5589428
48
this function shows the read window. it allows the client to read all the messages. both received and sent.
def read_messages(self, msg_num): self.clear_screen() user_label = Label(self.root, text="Hello " + self.username, font=self.title_font, bg=self.bg_color, height=2) user_label.pack(pady=5, padx=50) lbl_msg = Label(self.root, text="Message " + str(msg_num),...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def show_messages(self):\n for msg in self.messages:\n print msg['text']", "def show(self):\n self.set_text(self.read())", "def show_messages(self):\n self.masterlog.revealme()", "def read(self):\n from x84.bbs import getch\n from x84.bbs.session import getsession\...
[ "0.67919517", "0.6346908", "0.6337899", "0.6265047", "0.6182557", "0.618034", "0.6140841", "0.6108053", "0.6107602", "0.60914344", "0.6021179", "0.5947622", "0.58789885", "0.5855277", "0.58248854", "0.5822408", "0.5808994", "0.5804789", "0.58033186", "0.57892084", "0.5787142"...
0.6980507
0
this function refreshes the read messages page.
def refresh(self, msg_num): if self.messages_window is not None: self.messages_window.destroy() self.messages_window = None self.read_messages(msg_num)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async def chat_refresh(self, label):\n room = await self.get_room(label)\n messages = await self.fetch_all_message(room)\n await self.send_json(\n return_value(ACTION_REFRESH_CHAT, label, self.user.username, MSG_MESSAGE, messages)\n )", "def read_messages(self, msg_num):\r...
[ "0.6961772", "0.67089885", "0.66341877", "0.65815735", "0.6418059", "0.6338058", "0.6332131", "0.63038486", "0.6238911", "0.6234152", "0.62187123", "0.621134", "0.621134", "0.6167453", "0.6129225", "0.5976966", "0.5967419", "0.5957173", "0.59484446", "0.5933708", "0.5933708",...
0.76593846
0
this function makes sure that when going back from the read window, all windows work properly.
def go_back_read(self): if self.messages_window is not None: self.messages_window.destroy() self.messages_window = None self.choose_path()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __window_back(self):\n pass", "def ev_windowrestored(self, event: WindowEvent) -> None:", "def __window_forward(self):\n pass", "def TransferToWindow(self):\n return True", "def TransferFromWindow(self):\n return True", "def ev_windowrestored(self, event: tcod.event.WindowEvent) -...
[ "0.66543084", "0.64756507", "0.6218632", "0.61270016", "0.6059469", "0.5967816", "0.59462374", "0.5911877", "0.5886296", "0.5857155", "0.5838113", "0.5830953", "0.5825556", "0.58215696", "0.5817999", "0.5753222", "0.5739507", "0.5733871", "0.57087755", "0.5703051", "0.5699966...
0.68879884
0
opens a new window that contains all the messages.
def new_window_messages(self, button_see_all_msgs): # changing the button command to closing the window button_see_all_msgs.config(command=lambda: self.close_window(button_see_all_msgs)) # creating the chat Tk object self.messages_window = Tk() self.messages_window.resizab...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _open_window(self):\r\n\t\t# Creating the window\r\n\t\tself._window = Window(self, Locations.RESTAL)", "def open_main_window(self):\r\n track_terms_dic = ''\r\n sg.theme(self.look)\r\n\r\n layout = [[sg.Text('Welcome to tweeet monitor ')],\r\n [sg.Text('Please enter Det...
[ "0.71605724", "0.6652545", "0.6622106", "0.6552646", "0.65350586", "0.6522257", "0.6512286", "0.64399976", "0.6398846", "0.6395453", "0.63476604", "0.6302807", "0.6253829", "0.6239314", "0.6238414", "0.6192727", "0.6176429", "0.6140522", "0.6134743", "0.61296725", "0.60993296...
0.7269994
0
closing the second Tk object
def close_window(self, button_msgs): if self.messages_window is not None: self.messages_window.destroy() self.messages_window = None button_msgs.config(command=lambda: self.new_window_messages(button_msgs))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def exit(self):\n \t\troot.destroy()\n \t\tpass", "def destroy(self):\n tk.Frame.destroy(self)", "def close_and_run(self, master, window):\r\n self.main_gui(master)\r\n window.destroy()", "def close(event):\n event.widget.destroy()", "def close_window(self):\n # Window - EN...
[ "0.70907074", "0.69646", "0.696005", "0.6930957", "0.69069535", "0.6878592", "0.6849327", "0.68154705", "0.675188", "0.6751682", "0.6737973", "0.66876215", "0.66687185", "0.6583281", "0.65789247", "0.65704244", "0.65456504", "0.6526659", "0.6495618", "0.64723223", "0.6447673"...
0.0
-1
this function is the send window. it allows the client to send a message.
def send_messages(self): self.clear_screen() user_label = Label(self.root, text="Hello " + self.username, font=self.title_font, bg=self.bg_color, height=2) user_label.pack(pady=10, padx=50) messages_frame = Frame(self.root) messages_frame.pack(pad...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def send(self, msg):\n pass", "def send(self, msg):\n pass", "def send(self, msg):\n pass", "def send(self, msg):\n self.message('Me', msg)", "def send(self, message):\n pass", "def send_message(self, message):\n pass", "def transmit(self, msg):\r\n # send o...
[ "0.76155233", "0.76155233", "0.76155233", "0.7408198", "0.7336569", "0.7297874", "0.72387856", "0.72170043", "0.7180501", "0.7176217", "0.71481776", "0.7098309", "0.70943516", "0.70592934", "0.69874233", "0.6976361", "0.69505566", "0.6949229", "0.6911619", "0.6911581", "0.690...
0.6597856
62
this function creates a thread that will listen to users input in microphone
def create_speech_thread(self, text_widget): if not self.thread_speech_is_running: thread_speech = Thread(target=self.speech_recognizer_function, args=(text_widget,), daemon=True) thread_speech.start() self.thread_speech_is_running = Tr...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def listen(self):\n self.processor_thread = Thread(target = self.event_loop, name=\"InputThread-\"+str(self.thread_index), args=(self.thread_index, ))\n self.thread_index += 1\n self.processor_thread.daemon = True\n self.processor_thread.start()", "def start(self):\n self.has_e...
[ "0.7250806", "0.6790421", "0.64903635", "0.6438565", "0.64301026", "0.632874", "0.6247852", "0.61793077", "0.6145515", "0.61154944", "0.61059767", "0.6097376", "0.6059375", "0.6045819", "0.6040814", "0.60348105", "0.58494747", "0.5843194", "0.5823038", "0.58070415", "0.577889...
0.60714114
12
this function recognizes the input of the microphone and turns it into text. the text is inserted to the text widget and then the user will be able to send it as a message
def speech_recognizer_function(self, text_widget): label_listening = Label(self.root, text="listening to input...", font=self.text_font, bg=self.bg_color) label_listening.pack(pady=10) recognizer = speech_recognition.Recognizer() microphone = speech_r...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def mic_input():\n try:\n r = sr.Recognizer()\n with sr.Microphone() as source:\n print('Say something...')\n r.pause_threshold = 1\n r.adjust_for_ambient_noise(source, duration=1)\n audio = r.listen(source)\n try:\n command = r.recogni...
[ "0.63976574", "0.6331272", "0.6316408", "0.62616754", "0.6221507", "0.6133672", "0.60445386", "0.6034115", "0.599703", "0.5995486", "0.59736764", "0.5960848", "0.5958265", "0.59164345", "0.58853114", "0.5819938", "0.58131707", "0.5773462", "0.57678306", "0.57649124", "0.57376...
0.72579855
0
this function colors the encrypted letter label in the simulator for 300 milliseconds
def color_letter(self, letter, lst_labels, plain_text_widget, encrypted_text_widget): new_letter, txt_encryption = self.simulator_enigma.encrypt_letter(letter) lst_encryption_letter_stages = [i[-1] for i in txt_encryption.split("\n")] lst_encryption_letter_stages.remove(')') self.sim...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def ColorizeDNA(self, text):\n if (text == 'A'):\n escape = '\\033[92m' # Green\n elif (text == 'G'):\n escape = '\\033[93m' # Yellow\n elif (text == 'T'):\n escape = '\\033[91m' # Red\n elif (text == 'C'):\n escape = '\\033[96m' # Blue\n ...
[ "0.6488497", "0.64416146", "0.6429084", "0.6220818", "0.62159586", "0.61817086", "0.6160907", "0.61200315", "0.61137754", "0.6078523", "0.60778445", "0.6075475", "0.6072182", "0.6067036", "0.606216", "0.60522145", "0.602722", "0.6022543", "0.60124403", "0.59898627", "0.597070...
0.801215
0
displays the enigma simulator
def simulator(self, rotors_settings=(1, 2, 3, 'A', 'A', 'A'), plugboard_settings=None, plain_text=""): self.clear_screen() user_label = Label(self.root, text="Hello " + self.username, font=self.title_font, bg=self.bg_color, height=2) user_label.g...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def display_eng(self):\n self.clear_terminal()\n self.menu_eng()\n self.handle_selection_eng()", "def display(self):\n viewer = SpectraViewer(spectrometer=self)\n viewer.display()", "def display(self):\n viewer = SpectraViewer(spectrometer=self)\n viewer.display...
[ "0.6631773", "0.6175526", "0.6175526", "0.61313206", "0.6080019", "0.5969126", "0.5952151", "0.5921271", "0.5917744", "0.59115", "0.59061027", "0.5887677", "0.58850664", "0.5868575", "0.583884", "0.5790793", "0.5734754", "0.5731992", "0.5710725", "0.57077515", "0.5699957", ...
0.6890839
0
this function lets the user change the settings of the simulator
def change_settings(self): self.clear_screen() # making sure the screen grid will be organized label_line = Label(self.root, text=" ", font=self.text_font, bg=self.bg_color) label_line.grid(row=0, column=0) label_line = Label(self.root, text=" ", font=self.text_font, b...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_settings_devices(self):\n self.set_thermostat, self.set_humidifier, self.set_sprinklers, self.set_ventilation = self.settings[3:]", "def test_change_config(self):\n browser = Browser(self.app)\n portalURL = self.portal.absolute_url()\n browser.addHeader('Authorization', 'Basic...
[ "0.67250514", "0.6616514", "0.6587167", "0.6572284", "0.65574336", "0.65571165", "0.65545833", "0.6387912", "0.6380834", "0.6380834", "0.6371281", "0.63633394", "0.63439715", "0.61811125", "0.6178413", "0.61066014", "0.60833853", "0.6053914", "0.6019179", "0.60047317", "0.599...
0.7095382
0
this function saves the changes in the simulator settings made by the user.
def save_settings(self, rotor_num1, rotor_num2, rotor_num3, rotor_l1, rotor_l2, rotor_l3): dict_rotor_num = {"I": 1, "II": 2, "III": 3, "IV": 4, "V": 5} label_txt = "" rotor_num1 = dict_rotor_num[rotor_num1] rotor_num2 = dict_rotor_num[rotor_num2] rotor_num3 = dict_rotor_num...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def saveSettings(self):\n self.userFiles.applyData()\n self.userPersonal.applyData()", "def save_settings(self):\n settings = {'camera': self.comboCamera.currentIndex(),\n 'rotation': self.comboRotation.currentIndex(),\n 'colors': {\n ...
[ "0.76047224", "0.7509991", "0.7410456", "0.7324456", "0.7254209", "0.72053295", "0.71797514", "0.7078135", "0.703043", "0.70278335", "0.7012316", "0.7006509", "0.6991482", "0.69491667", "0.69386387", "0.6928301", "0.690888", "0.6904757", "0.6899911", "0.6898468", "0.68815815"...
0.0
-1
this function adds a letter to the plugboard
def add_letter_in_plugboard(self, letter, lst_buttons): self.simulator_enigma.plugboard.add_letter(letter) self.set_plugboard(lst_buttons)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_letter(self, letter):\r\n if (len(self.plugboard1) < 10 or\r\n (len(self.plugboard1) == 10 and self.plugboard2[-1] is None)) and \\\r\n letter not in self.plugboard1 and letter not in self.plugboard2:\r\n if len(self.plugboard1) == 0 or (len(self.plugboard1) < 10...
[ "0.74521935", "0.6864215", "0.6653494", "0.6578328", "0.6481865", "0.64462173", "0.64435834", "0.6416639", "0.6378046", "0.61352384", "0.61273557", "0.60847396", "0.60462296", "0.60263854", "0.60161275", "0.597719", "0.5976378", "0.5974929", "0.596187", "0.59597677", "0.59399...
0.84619296
0
this function sets the plugboard in the simulator settings and lets the user edit it.
def set_plugboard(self, lst_buttons): colors = ['purple', 'yellow', 'blue', 'orange', 'coral4', 'pink', 'cyan', 'SpringGreen2', 'red', 'green'] used_colors = list(filter(lambda button_bg: button_bg != "khaki", [i['bg'] for i in lst_buttons])) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def updateSettingsUI(self):\n\n pass", "def change_settings(self):\r\n self.clear_screen()\r\n # making sure the screen grid will be organized\r\n label_line = Label(self.root, text=\" \", font=self.text_font, bg=self.bg_color)\r\n label_line.grid(row=0, column=0)\r\n ...
[ "0.60254747", "0.6003152", "0.5903891", "0.58452857", "0.5839012", "0.5837211", "0.5816409", "0.57903934", "0.57348806", "0.5674967", "0.5640835", "0.56229097", "0.55756176", "0.555146", "0.55273783", "0.5479405", "0.54654926", "0.54645574", "0.5461459", "0.5450382", "0.54115...
0.5971404
2
this function shows the encryption process in the enigma.
def show_simulator_encryption(self, rotors_settings, plugboard_settings, plain_text, letter_number=1): self.clear_screen() if len(self.simulator_encryption) > 0: user_label = Label(self.root, text="Hello " + self.username, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def encrypt(event=None): # event is passed by binders.\n msg = inputText.get(\"1.0\",tkinter.END)\n outText.delete('1.0', tkinter.END)\n\n f = open(myTmpDir + 'pt' + str(identity) + '.bin','wb')\n f.write(msg)\n f.close()\n\n os.popen(\"rsa.exe e \" + myTmpDir + \"pt\" + str(identity) + \".bin \...
[ "0.61503357", "0.60890895", "0.6056018", "0.60102695", "0.5848196", "0.5827546", "0.58185095", "0.581306", "0.58001035", "0.5777466", "0.5757728", "0.5731634", "0.5707361", "0.57026505", "0.56965256", "0.5668564", "0.5661669", "0.5643876", "0.5641259", "0.56192094", "0.560030...
0.5880569
4
this function shows the About the Project window. it shows information regarding the project.
def about_screen(self): self.clear_screen() user_label = Label(self.root, text="Hello " + self.username, font=self.title_font, bg=self.bg_color, height=2) user_label.pack(pady=10, padx=50) about_text = """My name is Jasmin, I am 17 years old and this is my...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def show():\n info(str(Project))", "def aboutmenu(self):\n tkMessageBox.showinfo(\"About This Program\", \"The project of PSIT subject in 2014.\\nThis program is unit converter program.\")", "def about_developer(self):\r\n self.pop_window(title=\"About\", \r\n msg=\"ChikonEye Version: 2...
[ "0.7788291", "0.7652768", "0.7533267", "0.75056034", "0.74691767", "0.74680126", "0.7466024", "0.7465043", "0.74397117", "0.7409726", "0.74092597", "0.73757994", "0.7321502", "0.73042005", "0.7288934", "0.72532016", "0.723343", "0.722521", "0.7187642", "0.7187137", "0.7175867...
0.0
-1
clears the screen from widgets.
def clear_screen(self): lst_grid = self.root.grid_slaves() for widget in lst_grid: widget.destroy() lst_pack = self.root.pack_slaves() for widget in lst_pack: widget.destroy()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def clear(self) -> None:\n self.screen.clear()", "def clear(screen):\n screen.clear()\n screen.refresh()", "def clear_widgets(self):\n self.json_progress = None\n self.progress_message_bar = None\n self.json_progress_message_bar = None\n if self.progress_message_bar_wid...
[ "0.8092894", "0.803967", "0.78183275", "0.7779582", "0.77743113", "0.7751474", "0.7615676", "0.76115173", "0.7582601", "0.75689197", "0.74467134", "0.7411865", "0.74054694", "0.7385278", "0.7318546", "0.7276925", "0.72769", "0.72769", "0.72497535", "0.7242884", "0.7230591", ...
0.86054236
0
this is a thread method. it receives messages from sever and then decrypts them.
def receive(self): print("waiting for messages") finish = False morse_object = Morse() while not finish: enigma_sim = Enigma() try: chunks = [] bytes_recd = 0 msg_length = loads(self.my_socket.recv(8000)) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def read(self):\n buff = self.conn.recv(4096)\n if (self.algo == \"rsa\"):\n buff = self.rsa_decrypt(buff)\n if (self.algo == \"des\"):\n buff = self.des_decrypt(buff)\n if (self.algo == \"3des\"):\n buff = self.triple_des_decrypt(buff)\n if (self...
[ "0.744655", "0.6937561", "0.68522006", "0.67841697", "0.66552895", "0.66094726", "0.6527624", "0.6526651", "0.6401564", "0.63021964", "0.6296313", "0.62897265", "0.62491965", "0.62269497", "0.6191575", "0.6179099", "0.613436", "0.60896724", "0.60787946", "0.6019799", "0.60061...
0.6854434
2
send a message to the rest of the clients. if from the send box encrypts according to the time. otherwise, from the simulator encrypts according to its settings.
def send(self, text_box, rotors_settings=None, plugboard_settings=None): morse_instance = Morse() enigma_sim = Enigma() if plugboard_settings is None and rotors_settings is None: enigma_sim.set_random_settings() else: enigma_sim.rotors.set_rotors(rotors_sett...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def sendToClient(plaintext):\n signature = userKeys.signUsingPrivateKey(plaintext)\n encryptedText = userKeys.encrypt(plaintext, contactKey)\n s.send(encryptedText)\n time.sleep(1)\n s.send(signature)", "def send(event=None): # event is passed by binders.\n msg = my_msg.get...
[ "0.72709787", "0.6771924", "0.65045714", "0.64544195", "0.63171625", "0.63171625", "0.63171625", "0.630371", "0.6284336", "0.62738705", "0.6248401", "0.6222988", "0.62097204", "0.6184484", "0.6150045", "0.61194193", "0.60920644", "0.60865146", "0.607641", "0.6057104", "0.6055...
0.66178226
2
this function customizes the text so it can be encrypted.
def manage_text(msg): msg = msg.upper() msg_final = "" for i in msg: if i.isalpha(): msg_final += i return msg_final
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _encrypt(self, text, **options):\n\n raise CoreNotImplementedError()", "def __encrypt_text_aes__(self, text, password):\n BLOCK_SIZE = 32\n PADDING_CHAR = b'^'\n iv = Random.new().read(16)\n # key must be 32 bytes for AES-256, so the password is hashed with md5 first\n ...
[ "0.6969536", "0.69532967", "0.6782029", "0.6768376", "0.6672109", "0.656223", "0.6561474", "0.65578926", "0.6497807", "0.6438681", "0.6425754", "0.6420916", "0.6402289", "0.630223", "0.63020754", "0.63016236", "0.6272338", "0.6262189", "0.6205668", "0.6191833", "0.6173925", ...
0.0
-1
Retrieve fastq files for the given lane, ready to process.
def get_fastq_files(directory, work_dir, item, fc_name, bc_name=None, glob_ext="_fastq.txt", config=None, unpack=True): if "files" in item and bc_name is None: names = item["files"] if isinstance(names, basestring): names = [names] files = [x if os.path.isabs(...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def find_fastqs(location, project_id, sample_id, lane=None):\n basename = '*.fastq.gz'\n if lane:\n basename = '*L00' + str(lane) + basename\n\n pattern = os.path.join(location, project_id, sample_id, basename)\n fastqs = find_files(pattern)\n app_logger.debug('Found %s fastq files for %s', l...
[ "0.74992424", "0.5997929", "0.5949587", "0.59173447", "0.5860292", "0.5804238", "0.55708313", "0.55603546", "0.54513943", "0.5397355", "0.53798234", "0.53523076", "0.5351622", "0.534139", "0.5237773", "0.52329355", "0.5212102", "0.5193668", "0.5143916", "0.5136838", "0.511812...
0.61918277
1
Convert BAM input file into FASTQ files.
def convert_bam_to_fastq(in_file, work_dir, config): out_dir = safe_makedir(os.path.join(work_dir, "fastq_convert")) out_files = [os.path.join(out_dir, "{0}_{1}.fastq".format( os.path.splitext(os.path.basename(in_file))[0], x)) for x in ["1", "2"]] if _is_paired(in_file): ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def to_fastq(self, prefix='', threads=1):\n # Write to uncompressed FASTQ for speed\n fastqs = [\n f'{prefix}_{i+1}.fastq.gz' if prefix else f'{i+1}.fastq.gz'\n for i in range(self.technology.n_files)\n ]\n logger.info(f'Splitting BAM file into FASTQs {\", \".join(...
[ "0.70499676", "0.6740654", "0.672978", "0.64483637", "0.63435805", "0.60342306", "0.5887938", "0.58241993", "0.58233976", "0.5711803", "0.56742835", "0.5673183", "0.5609216", "0.5567203", "0.54960185", "0.54638755", "0.54510033", "0.5442137", "0.5425194", "0.5418631", "0.5411...
0.64614826
3
Convert barcode id to sample description, changing extension from _fastq.txt to .fastq in the process
def convert_barcode_id_to_name(multiplex, fc_name, fq): fqout = list([None, None]) if multiplex is None: fqout[0] = fq[0] if not fq[1] == None: fqout[1] = fq[1] else: bcid2name = dict([(mp['barcode_id'], mp['name']) for mp in multiplex]) for bcid in bcid2name.keys...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def convert_name_to_barcode_id(multiplex, fc_name, fq):\n fqout = list([None, None])\n name2bcid = dict([(mp['name'], mp['barcode_id']) for mp in multiplex])\n for name in name2bcid.keys():\n mstr = \"%s_%s_\" % (fc_name, name) \n if fq[0].find(mstr) != -1:\n from_str = \"%s_%s_\"...
[ "0.6623599", "0.63540995", "0.59808934", "0.5929442", "0.58410364", "0.57554716", "0.5716192", "0.5710112", "0.5637982", "0.5631498", "0.5599545", "0.5590032", "0.5577469", "0.55256295", "0.5518841", "0.5507794", "0.5507233", "0.5487758", "0.5482285", "0.54775095", "0.5447416...
0.6429612
1
Convert sample description to barcode id, changing extension from .fastq to _fastq.txt in the process
def convert_name_to_barcode_id(multiplex, fc_name, fq): fqout = list([None, None]) name2bcid = dict([(mp['name'], mp['barcode_id']) for mp in multiplex]) for name in name2bcid.keys(): mstr = "%s_%s_" % (fc_name, name) if fq[0].find(mstr) != -1: from_str = "%s_%s_" %(fc_name, nam...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def convert_barcode_id_to_name(multiplex, fc_name, fq):\n fqout = list([None, None])\n if multiplex is None:\n fqout[0] = fq[0]\n if not fq[1] == None:\n fqout[1] = fq[1]\n else:\n bcid2name = dict([(mp['barcode_id'], mp['name']) for mp in multiplex])\n for bcid in b...
[ "0.635295", "0.6289378", "0.6153358", "0.59830755", "0.5973969", "0.59590584", "0.59040374", "0.58626246", "0.5838718", "0.57817864", "0.5680377", "0.5662274", "0.5659372", "0.56566316", "0.5644152", "0.5641196", "0.5615736", "0.5564444", "0.5530782", "0.5522661", "0.54676783...
0.6725366
0
Create a schema from a commaseparated list of field specifications.
def ReadSchema(schema, bigquery_messages): return bigquery_messages.TableSchema( fields=[ _TableFieldSchemaForEntry(entry, bigquery_messages) for entry in schema.split(',')])
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def make_field_list(field_desc_list, names):\n for index, field_desc in enumerate(field_desc_list):\n yield RecordSchema._make_field(index, field_desc, names)", "def from_fields(cls, field_list):\n field_dict = dict(field_list)\n return cls(**field_dict)", "def build_schema(self...
[ "0.64310926", "0.63509125", "0.6165725", "0.60274005", "0.586239", "0.57277334", "0.56566375", "0.5651166", "0.5536092", "0.5491589", "0.5431351", "0.5414425", "0.53576344", "0.5345713", "0.532309", "0.5318973", "0.5298094", "0.5284337", "0.5270332", "0.52690184", "0.5243194"...
0.0
-1
Create a schema message from the name of a file containing a JSON schema.
def ReadSchemaFile(schema_file, bigquery_messages): if os.path.exists(schema_file): with open(schema_file, mode='r') as f: try: def UpperOrNone(string): return string and string.upper() field_schemas = [ bigquery_messages.TableFieldSchema( name=json_obj...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def load_schema(filename):\n with open(filename) as f:\n schema = json.load(f)\n\n return schema", "def _load_json_schema(filename: str):\n relative_path = path.join('schemas', filename)\n absolute_path = path.join(path.dirname(__file__), relative_path)\n\n with open(absolute_path, 'r', enc...
[ "0.7130944", "0.7071065", "0.7037193", "0.6999802", "0.67850494", "0.6669903", "0.6631411", "0.66249794", "0.6621027", "0.6499103", "0.64794594", "0.64401793", "0.64254344", "0.6370778", "0.6337134", "0.6103374", "0.60779864", "0.60144544", "0.59893954", "0.5973443", "0.59529...
0.67639804
5
Drop alembic table for gdrive migrations. For db_reset, this table isn't supposed to exist since the migration chain is disabled. For existing databases, this table exists but won't be used since the migration chain is disabled.
def upgrade(): try: op.drop_table("ggrc_gdrive_integration_alembic_version") except sa.exc.OperationalError as e: code, _ = e.orig.args if code == 1051: # doesn't exist # we're in a new DB with no trace of the removed chain pass else: raise # The following duplicates a part of ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def drop():\n if prompt_bool(\"Are you sure you want to lose all your data\"):\n db.drop_all()\n db.engine.execute(\"drop table if exists alembic_version\")", "def drop_table(cls)->None:\n database.cursor.execute(\n \"DROP TABLE IF EXISTS {}\".format(cls.table_name))\n d...
[ "0.72148544", "0.71591735", "0.71193475", "0.6952644", "0.6881675", "0.6875262", "0.68424946", "0.68139595", "0.6792357", "0.67086965", "0.6690821", "0.66735405", "0.66718906", "0.6636215", "0.6631251", "0.66307104", "0.66115475", "0.66045314", "0.660408", "0.6603744", "0.659...
0.6836839
7
Restore alembic table for gdrive migrations with latest correct content. Since the migration chain is disabled, this table won't be used. If the migration chain gets enabled, this table will contain correct tag for downgrades.
def downgrade(): op.execute(""" CREATE TABLE ggrc_gdrive_integration_alembic_version ( version_num varchar(32) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8 """) op.execute(""" INSERT INTO ggrc_gdrive_integration_alembic_version (version_num) VALUES ('3f64d03c6c01') """)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def downgrade():\n # # commands auto generated by Alembic - please adjust! ###\n op.drop_table('downstream_map')\n # # end Alembic commands ###", "def upgrade():\n try:\n op.drop_table(\"ggrc_gdrive_integration_alembic_version\")\n except sa.exc.OperationalError as e:\n code, _ = e.orig.args\n ...
[ "0.6851007", "0.68070155", "0.6506316", "0.64786386", "0.64288044", "0.6319381", "0.61630434", "0.59586895", "0.5892953", "0.5826305", "0.58031607", "0.57475394", "0.57333404", "0.5704555", "0.566395", "0.5661779", "0.56194675", "0.5548934", "0.5502293", "0.549745", "0.548365...
0.70814365
0
call the registered function and return its results
def get(name,**kwargs): try: f = MyRegister._REGISTERED[name] except KeyError: raise KeyError("Dataset:'{} is registered Available dataset are:{}".format(name,",".join(MyRegister._REGISTERED.keys())) ) return f(**kwargs)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __call__(self):\n return self.fn()", "def test_runs_given_function(self):\n from furious.processors import _handle_results\n\n processor = Mock()\n\n _handle_results({'_process_results': processor})\n\n processor.assert_called_once_with()", "def call(self, data):\n\t\tret...
[ "0.675645", "0.6693326", "0.6510391", "0.6497139", "0.6425742", "0.6425742", "0.64201176", "0.63799745", "0.6349983", "0.63358104", "0.6335209", "0.6309102", "0.6287538", "0.62626725", "0.62462807", "0.6244996", "0.62310064", "0.62300724", "0.61896855", "0.6153306", "0.614721...
0.0
-1
Get HartreeFock values for H2
def get_hf_value_by_dist(basis_set, distance): try: # Round to one because the actual distances might vary a little because of the psi4 issue. distance = round(distance, 1) if basis_set == "sto-3g": if distance in sto_3g.keys(): return sto_3g[distance] ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def extract_h(f1):\n h_5_in = f1.Get(\"neutron_spectrum_tof_in4.69keVnr\")\n h_5_out = f1.Get(\"neutron_spectrum_tof_out4.69keVnr\")\n h_8_in = f1.Get(\"neutron_spectrum_tof_in8.33keVnr\")\n h_8_out = f1.Get(\"neutron_spectrum_tof_out8.33keVnr\")\n h_15_in = f1.Get(\"neutron_spectrum_tof_in14.75keVn...
[ "0.6044786", "0.5959901", "0.55953676", "0.5572713", "0.55250454", "0.5487814", "0.54236287", "0.5314009", "0.53044504", "0.5291509", "0.5269112", "0.524244", "0.51941276", "0.5174624", "0.5120342", "0.5103384", "0.507804", "0.5052936", "0.5041796", "0.5024648", "0.5020925", ...
0.0
-1
Browse the folder to locate the json file
def browse_folder(self): # Get the file name from the user selection filename = tkinter.filedialog.askopenfilename(initialdir=".", title="Select JSON file", filetypes=(("json files", "*.json"), ("txt files", "*.txt"), ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def json_file():\r\n urlretrieve(URL, PATH)\r\n return PATH", "def json_file():\r\n urlretrieve(URL, PATH)\r\n return PATH", "def test_files(self, location):\n for filename in os.listdir(location):\n with open(location + '/' + filename) as json_file:\n data = json.l...
[ "0.62802076", "0.62802076", "0.6238737", "0.61273605", "0.60416484", "0.5966435", "0.59093004", "0.59044904", "0.5819813", "0.5813722", "0.57989556", "0.5781541", "0.56752443", "0.5675066", "0.5660146", "0.5640253", "0.56322503", "0.5631106", "0.5621598", "0.56130177", "0.560...
0.7507324
0
Build/load the barcode use the json file
def build_barcode(self): # Get the file name/path to the json file filename = self.filename_entry.get() # Check if the filename is given if not os.path.exists(filename): showerror("JSON File Not Exists", "JSON file not exists.\n" ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def build(self):\n # open json, len 161,260\n at_json = open_json(self.json_names[0])\n link_json = open_json(self.json_names[1])\n # if need preprocessing, do it\n if self.args.img_preprocessing:\n print(\"resize imgs\")\n for i in tqdm(range(len(link_json)...
[ "0.58827484", "0.578684", "0.5714043", "0.56993884", "0.5639737", "0.5583572", "0.54636484", "0.5450821", "0.54405653", "0.54265416", "0.5424942", "0.5409185", "0.53689647", "0.53638726", "0.5357695", "0.5356618", "0.53302157", "0.5321161", "0.53171873", "0.53061134", "0.5295...
0.78892285
0
this function create folder for the captured frames and videos
def dirCapture(parameter, path): # N should be argument of instances NO. N = parameter # set path for the captured frames cpath = path + '%d' % N + '/' # create directory if not exist while (os.path.exists(cpath)): # print('instance N%d' % N + ' exists') N = N + 1 ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def generate_video(image_folder, video_name, video_frames_path):\n \n try:\n os.stat(video_frames_path)\n except:\n os.makedirs(video_frames_path)\n \n images = [img for img in os.listdir(image_folder)\n if img.endswith(\".jpg\") or\n img.endswith(\".jpeg\") o...
[ "0.701783", "0.70178145", "0.70023805", "0.66897815", "0.6628432", "0.6599192", "0.6571847", "0.6534987", "0.64688194", "0.64438266", "0.64366823", "0.63567317", "0.6308261", "0.62857354", "0.6236522", "0.62322396", "0.62297314", "0.62270474", "0.62222314", "0.62166524", "0.6...
0.66204894
5
this function save resizer performence info to .txt file
def printInfo(totaltime, vid, cpath): infotxt = open(cpath + 'Resize Info' + '.txt', 'a') info = str('executeTime: %f' % totaltime + '\n') converageRate = totaltime / (vid.get(7)) info += str('average converage rate is: %f' % converageRate + 'f/s' + '\n') frameNum = vid.get(7) info += str(...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def save_results(self, name):\n # metrics in npz format\n # filename = join(self.out_dir, '%s_metrics.npz' % name)\n # np.savez(filename, tel_r=self.tel_r, cable_length=self.cable_length,\n # cable_length_2=self.cable_length_2, uv_hist=self.uv_hist)\n\n if self.cable_len...
[ "0.6311785", "0.61142427", "0.5883345", "0.5869845", "0.5838297", "0.58195186", "0.5771335", "0.57199216", "0.5712982", "0.57044137", "0.55961275", "0.5577182", "0.55757207", "0.5559564", "0.554992", "0.5543646", "0.5524419", "0.5517075", "0.55147904", "0.55009633", "0.549900...
0.0
-1
this function resize the recived video to size(480,480) and captured resized frames during the process
def resizeVideo(n, format, vpath, cpath): start_time = time.time() t = time.process_time() vidcap = cv2.VideoCapture(vpath) success, image = vidcap.read() cv2.namedWindow('image') cv2.imshow('image', image) cv2.waitKey(1) count = 0 CODE = 'XVID' # default save to avi ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def resize(frame: Frame):\n\n frame.img = cv2.resize(frame.img, (720, 480))\n frame.orginal_img = cv2.resize(frame.orginal_img, (720, 480))\n\n return frame", "def resize_video(frames, width: int = UNIVERSAL_RESIZE):\n if frames.size < 1:\n raise ValueError('Must provide at least o...
[ "0.6975515", "0.6965948", "0.6840254", "0.66904473", "0.6561962", "0.65187913", "0.64801097", "0.6479887", "0.6456022", "0.64197224", "0.64138234", "0.63360685", "0.6334037", "0.6292876", "0.62918407", "0.62625307", "0.62448573", "0.61914134", "0.61655945", "0.6139185", "0.61...
0.74632716
0
this function is action for the resize buttons to use, mainly call the resizeVideo methods
def resizeButton(format,vpath,cpath): if os.path.exists(cpath): cPath=cpath+'/vid-instance' if os.path.exists(vpath): vPath=vpath N, cPath = dirCapture(1, cPath) resizeVideo(N, format, vPath, cPath)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def handleResize(self):\n pass", "def resize(self):\n pass", "def resize(self, event=None):\n #self.render()\n self.__resize_background(event)\n #self.__delete_background()\n #self.__create_background(self._imfname)\n for sym in self.itersymbols():\n ...
[ "0.7466857", "0.67581195", "0.6693336", "0.6686181", "0.6664426", "0.66365945", "0.6623954", "0.6581972", "0.65713274", "0.6529807", "0.6507639", "0.6472563", "0.6404809", "0.6373768", "0.63407046", "0.632196", "0.63161606", "0.62875193", "0.62567973", "0.624347", "0.62312657...
0.74494356
1
this function manage a multiprocessing resize through keeping all the process in the pool
def multicore(format, filenames, cpath): start = time.time() po = multiprocessing.Pool(P) file = str(filenames).split(',') for file in filenames: print(file) po.apply_async(func=resizeButton, args=(format, file, cpath)) time.sleep(M) print("Done") po.close() ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def resize_all_images(image_dir, width, height, resize_type):\n if width == \"\" and height == \"\":\n return 0\n print(\"Enter resizing image.\")\n print(\"Enter resizing.\", width)\n pool = Pool(1)\n pool.starmap(resize_image, zip(\n image_dir, itertools.repeat(width), itertools.repe...
[ "0.63549966", "0.6220944", "0.59649426", "0.59593916", "0.59510225", "0.58933437", "0.58215255", "0.5820519", "0.58105135", "0.57659066", "0.5631996", "0.5616365", "0.5570653", "0.5546573", "0.5539349", "0.55334586", "0.5523554", "0.5502881", "0.5492138", "0.5492138", "0.5480...
0.61451405
2
this function is called when the saveButton is clicked
def getCapturePath(self): global cpath cpath = askdirectory()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def save():\n pass", "def save():", "def save (self):\n pass", "def save(self):\n pass", "def save(self):\n pass", "def save(self):\n pass", "def save(self):\n pass", "def save(self):\n pass", "def save(self):\n # TODO (Pierre): code", "def ...
[ "0.8244069", "0.82181466", "0.808178", "0.8036641", "0.8036641", "0.8036641", "0.8036641", "0.8036641", "0.8025759", "0.79084253", "0.790276", "0.78900355", "0.78506833", "0.77407193", "0.7713274", "0.769706", "0.769706", "0.76262254", "0.76262254", "0.76262254", "0.74757344"...
0.0
-1
this function is called when the openButton is clicked
def getVideosPath(self): videoTypes = [ ('MP4 files', '*.mp4'), ('3GP files', '*.3gp'), ('WMV files', '*.wmv'), ('FLV files', '*.flv'), ('AVI files', '*.avi'), ] global filenames filenames = askopenfilenames(title="Sele...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def onOpen(self):", "def open(self):\n self.state = True\n self.mainwindow.sendMessage('a')\n print(\"opening \" + self.name)", "def on_lookpushButton_clicked(self):\n # TODO: not implemented yet\n self.openFile()", "def trigger_open(self):\n self.get_selected()\n ...
[ "0.7722792", "0.7232599", "0.70331657", "0.69601965", "0.69194776", "0.68946415", "0.6837131", "0.68361264", "0.6835772", "0.67767406", "0.6758912", "0.6709013", "0.66670215", "0.6662738", "0.66621774", "0.66406375", "0.66406375", "0.66406375", "0.66406375", "0.6637556", "0.6...
0.0
-1
this function is called when startButton is called and will use resizeButton() function to resize videos sequentially
def startResizing(self): # total running times global totaltime start = time.time() try: str(cpath) try: file = str(filenames).split(',')[0].strip("('") if os.path.exists(file): print(file) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def resizeButton(format,vpath,cpath):\r\n if os.path.exists(cpath):\r\n cPath=cpath+'/vid-instance'\r\n if os.path.exists(vpath):\r\n vPath=vpath\r\n N, cPath = dirCapture(1, cPath)\r\n resizeVideo(N, format, vPath, cPath)", "def init_gui(self):\r\n self.root.title('Video...
[ "0.6814723", "0.6706321", "0.6082444", "0.60067904", "0.6005091", "0.59289396", "0.59223634", "0.5910596", "0.58606327", "0.5837265", "0.5814798", "0.58082414", "0.5801105", "0.57729465", "0.57504654", "0.571494", "0.57109207", "0.5694669", "0.5657087", "0.5645747", "0.562265...
0.6654774
2
this function is called when multiStartButton is called and will use multicore() function to resize videos in parallel
def startMultiResizing(self): global totaltime try: str(cpath) try: str(filenames) try: print(filenames) totaltime = multicore(Format, filenames, cpath) self.resultLabel['text'] =...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def multicore(format, filenames, cpath):\r\n start = time.time()\r\n po = multiprocessing.Pool(P)\r\n file = str(filenames).split(',')\r\n for file in filenames:\r\n print(file)\r\n po.apply_async(func=resizeButton, args=(format, file, cpath))\r\n time.sleep(M)\r\n print(\"Done\...
[ "0.6563744", "0.64110225", "0.5975478", "0.59674823", "0.59062296", "0.5873052", "0.58316374", "0.58308446", "0.578684", "0.5743147", "0.5654799", "0.56200457", "0.5559133", "0.55516684", "0.5550606", "0.5521735", "0.546656", "0.54456455", "0.5401045", "0.5391771", "0.5387132...
0.69108474
0
this function will create information string used to display in the resultLabel
def Results(self): try: numOfFiles = 0 file = str(filenames).split(',') for file in filenames: if os.path.exists(file): numOfFiles += 1 print('%d' % numOfFiles + ' videos resized!') info = 'totaltime:...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __str__(self):\n if len(self.label) > 0:\n descr = [\"'%s', target='%s' [%s]\" % (self.label, self.target.name, self.target.body_type)]\n else:\n descr = [\"target='%s' [%s]\" % (self.target.name, self.target.body_type)]\n if self.baseline:\n descr[0] += ',...
[ "0.6842208", "0.670873", "0.67032593", "0.670306", "0.6628362", "0.654801", "0.65101", "0.6500394", "0.6484612", "0.6476954", "0.64659363", "0.6436427", "0.6426024", "0.64189446", "0.6418149", "0.64093786", "0.64064646", "0.64030755", "0.63778704", "0.63757837", "0.63677", ...
0.0
-1
this function build the GUI
def init_gui(self): self.root.title('Video Resizer') self.root.option_add('*tearOff', 'FALSE') self.grid(column=0, row=0, sticky='nsew') # Buttons getvideos, save videos, start resize self.openButton = ttk.Button(self, width=8, text="Browse", command=self.getVideosPath) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def build_UI(self):\n\n #Common local coordinates to change the UI positions\n common_x = 0\n common_y = 5\n\n #Create the Main Title\n self.titleFont = font.Font(family = FONTS[\"lucida grande\"], size = 30)\n self.title = cGUIf.get_TextLabel(self,\n ...
[ "0.7662315", "0.76499087", "0.7620427", "0.749656", "0.7488436", "0.7481345", "0.74784184", "0.74288124", "0.73963094", "0.7382726", "0.7380994", "0.7349861", "0.73217744", "0.7301817", "0.7283657", "0.7255085", "0.7252039", "0.72487587", "0.72324187", "0.72228116", "0.719720...
0.66845316
68
button clicked to select video type called when action is clicked
def clickMe(): global Format Format = typeToChoose.get() print(Format) action.configure(text='selected ' + Format) # show the selected item after clicked action.configure(state='disabled') # button disabled after clicked
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def onclick_load_video(self):\n video_source = select_file(\n \"Select Video Files\",\n \"../\",\n \"Video Files (*.mp4 *.avi *.mpg *.gif *.mov)\")\n if video_source:\n param_name = select_file(\n \"Select Parameter\", \"../\", \"Parameter Fi...
[ "0.6792233", "0.64212275", "0.6258068", "0.6204305", "0.60913473", "0.59596056", "0.5902013", "0.58849704", "0.5827223", "0.5816501", "0.58017844", "0.57247883", "0.5711773", "0.5698065", "0.5668826", "0.5657517", "0.5654947", "0.5625984", "0.56113243", "0.5544811", "0.552534...
0.55848324
19
Add metadata info to the header.
def add_metadata(self, column_name, data_type=None, version=None, description=None, dbname=None, delimiter='\t'): data_line = '##COLUMNNAME='+'"'+ column_name +'"' if column_name not in self.metadata: if data_type: if data_type not in ['Float', 'String', 'Integer']: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_metadata(self, metadata: dict) -> None:", "def add_metadata(self, key, value):\n self._h5.attrs[key] = value", "def add_file_metadata(self):\n metadata = self.__file.require_group(METADATA)\n self.__write_value(metadata, DATE_CREATED, date.today().strftime(\"%Y-%m-%d\"))\n s...
[ "0.7814327", "0.7194901", "0.70095164", "0.6962156", "0.69360846", "0.68795687", "0.68465805", "0.6778648", "0.6778648", "0.6666871", "0.6661003", "0.65671706", "0.6526206", "0.6526206", "0.6526206", "0.6526206", "0.6526206", "0.6526206", "0.6526206", "0.6518479", "0.65116614...
0.6448522
23
Add an entry to the header line. The entry must be specified among the metadata lines first.
def add_header(self, header_name): self.check_header(header_name) if header_name not in self.header: self.header.append(header_name) return
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_header(self, delta, header):\n\n if not delta or not header:\n return\n\n header_line = f\"{header}\\n\"\n\n delta.insert(0, header_line)", "def add_header( name, value ):", "def add_new_header(self, hdr):\n # if there are any lines in the unchanged-lines buff...
[ "0.7299191", "0.6941185", "0.6682752", "0.66754097", "0.66357225", "0.64103943", "0.64103943", "0.6305915", "0.6265915", "0.6251994", "0.6190674", "0.61357397", "0.6116551", "0.6010695", "0.59882915", "0.598272", "0.59807855", "0.59691834", "0.59167445", "0.5910145", "0.59081...
0.625466
9
Returns a list with the metadata lines on correct format.
def get_headers_for_print(self): lines_for_print = [] for header in self.metadata: lines_for_print.append(self.metadata[header]) lines_for_print.append('\t'.join(self.header)) lines_for_print[-1] = '#' + lines_for_print[-1] return lines_for_print
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getMetadataList(self):\n return [ x.toTuple() for x in self.metadata ]", "def get_metadata_header_lines(input_file):\n # type: (str) -> List[str]\n if not FileSystems.exists(input_file):\n raise ValueError('{} does not exist'.format(input_file))\n return[line for line in _header_line_generator(input...
[ "0.6990839", "0.6778577", "0.67761546", "0.6596873", "0.6596873", "0.64930004", "0.63260543", "0.6162002", "0.61361414", "0.61300284", "0.61048824", "0.60900474", "0.6013875", "0.60055214", "0.59965605", "0.59938395", "0.5990799", "0.5955255", "0.5949237", "0.59370655", "0.59...
0.6469205
6
All entrys in the header must be specified in the metadata lines.
def check_header(self, entry): if entry not in self.metadata: raise SyntaxError("Header entry must be described in the metadata lines. Entry: %s is not in metadata." % entry)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_check_header_missing_fields(self):\r\n\r\n # Default header, should not generate any errors/warnings\r\n header = ['AAA', 'XXX', 'YYY',\r\n 'ZZZ']\r\n errors = []\r\n warnings = []\r\n\r\n errors, warnings = check_header(header,\r\n ...
[ "0.6268195", "0.6264674", "0.62105215", "0.6196427", "0.6144928", "0.6113776", "0.60642403", "0.60047483", "0.5985811", "0.5964642", "0.59487873", "0.5914528", "0.5880523", "0.58377224", "0.58223", "0.58066964", "0.5804777", "0.5768354", "0.5765713", "0.57347786", "0.5703136"...
0.7916447
0
Test selection of a leaf node
def testSelectLeaf(self): menu = self.menu items = self.items assertTrue = self.assertTrue assertIsNone = self.assertIsNone menu.select(tag="a11") assertTrue(menu.selected) assertTrue(items["a1"].selected) assertTrue(items["a11"].selected) asse...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def IsLeaf(self):\n return not self.subtests", "def is_leaf(node):\n return node.children == {}", "def check_leaf_node(df):\r\n \r\n return len(set(df['class'])) == 1", "def is_leaf(self, p):\n return self.num_children(p) == 0", "def test_is_leaf(self):\n self.assertEqual(True, co...
[ "0.7235153", "0.6678625", "0.66372824", "0.66100496", "0.6575179", "0.65703756", "0.6556593", "0.6548734", "0.6526366", "0.65042156", "0.6485087", "0.6446794", "0.6434655", "0.6423185", "0.63771605", "0.6371146", "0.63690525", "0.6355469", "0.63342595", "0.63308424", "0.63199...
0.7547813
0
Test selection of a branch
def testSelectBranch(self): menu = self.menu items = self.items assertTrue = self.assertTrue assertIsNone = self.assertIsNone menu.select(tag="a2") assertTrue(menu.selected) assertIsNone(items["a1"].selected) assertIsNone(items["a11"].selected) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _check_branch(opt, params):\n\n # Check the current branch and hash\n _get_branch(opt)\n\n if params.git_branch != opt.git_branch or params.git_hash != opt.git_hash:\n msg = 'You are not on the right branch or commit. Please run the following in the repository: \\n'\n msg += f'git checko...
[ "0.648244", "0.6446408", "0.64247346", "0.63390535", "0.62524986", "0.6216893", "0.6167209", "0.61396754", "0.6128586", "0.60267806", "0.60020113", "0.59735584", "0.5965118", "0.5926897", "0.58735794", "0.58632785", "0.5858319", "0.5858319", "0.58455837", "0.58444524", "0.584...
0.7612395
0
Test selection of specific nodes
def testSelectSpecificNode(self): menu = self.menu items = self.items assertTrue = self.assertTrue assertIsNone = self.assertIsNone items["a2"].select() assertTrue(menu.selected) assertIsNone(items["a1"].selected) assertIsNone(items["a11"].selected) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_node_selection(self, node: dict, selection_type: SelectionType):\n assert ListSelectedExecutor.node_selection(node) == selection_type", "def test_selecting_nodes_clicking_them_discovered(self):\n with Nodes()as n:\n for node in n.nodes_discovered:\n node.parent.cl...
[ "0.70753044", "0.69574356", "0.66272986", "0.65160197", "0.63747287", "0.62622404", "0.6255423", "0.6250882", "0.61456066", "0.6128836", "0.61121875", "0.60613096", "0.6057898", "0.5994398", "0.5972796", "0.5919818", "0.5912785", "0.5878819", "0.58584577", "0.57744914", "0.57...
0.72523385
0
Test selection with nonexistent tag
def testSelectNonexistentTag(self): menu = self.menu items = self.items assertTrue = self.assertTrue assertIsNone = self.assertIsNone # Make a selection menu.select(tag="a21") assertTrue(menu.selected) assertIsNone(items["a1"].selected) assertI...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_tags_tag_search_invalid_tag(self):\n\n po = self.catalog.load_pageobject('TagsPage')\n po.goto_page()\n\n global NON_EXISTENT_TAG\n\n # perform the search\n self.browser.proxy_client.new_har(\"page\")\n po.search_for_tags(NON_EXISTENT_TAG)\n har_entry = sel...
[ "0.6625541", "0.6273861", "0.62554324", "0.60222036", "0.58781713", "0.584287", "0.5800551", "0.5729907", "0.5698181", "0.5698148", "0.5659998", "0.56520003", "0.5631423", "0.5631034", "0.55683744", "0.55287963", "0.550021", "0.5499857", "0.5495857", "0.5495131", "0.5466072",...
0.7399087
0
Test consecutive manual selects
def testSwitchSelection(self): menu = self.menu items = self.items assertTrue = self.assertTrue assertIsNone = self.assertIsNone # First selection menu.select(tag="a11") assertTrue(menu.selected) assertTrue(items["a1"].selected) assertTrue(item...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_boolean_and_selection(self):\n\n # The selection loop:\n sel = list(mol_res_spin.residue_loop(\"#Ap4Aase:4 & :Pro\"))\n\n # Test:\n self.assertEqual(len(sel), 1)\n for res in sel:\n self.assert_(res.name == \"Pro\" and res.num == 4)", "def test_select_same_e...
[ "0.6418896", "0.61642396", "0.61210763", "0.6017917", "0.5952653", "0.58946407", "0.5882359", "0.58499354", "0.5843929", "0.58132553", "0.58132553", "0.5807956", "0.56424063", "0.56390774", "0.56188494", "0.55462873", "0.54957587", "0.5488348", "0.54776096", "0.54506606", "0....
0.5476562
19
Attach a text label above each bar displaying its height
def autolabel(rects):
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def autolabel(rects, ax):\n global BAR_NUMBER_SIZE\n for rect in rects:\n height = rect.get_height()\n ax.text(rect.get_x() + rect.get_width()/2.,\n height,\n str(round(height, 1)),\n ha ='center',\n va ='bottom',\n size...
[ "0.738665", "0.7127214", "0.706221", "0.70598906", "0.6995252", "0.6801717", "0.6792009", "0.6772195", "0.6765225", "0.676024", "0.67559797", "0.6748383", "0.6728958", "0.67258143", "0.67216814", "0.6714292", "0.6711156", "0.6692474", "0.6655147", "0.66464627", "0.6645916", ...
0.6127119
73
Read and parse NEXUS input (a filename, filehandle, or string).
def read(self, input): # 1. Assume we have the name of a file in the execution dir or a # file-like object. # Note we need to add parsing of the path to dir/filename try: with File.as_handle(input, 'rU') as fp: file_contents = fp.r...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def read_nexus(filename):\n f = open(filename)\n return parse_nexus(f)", "def parse(self, infile):\r\n raise NotImplementedError()", "def _parse(self, infile):\n raise NotImplementedError()", "def read_input(infile):\n #Some utility functions to read in particular types of input\n def r...
[ "0.5987714", "0.59453547", "0.58234787", "0.58072245", "0.57432646", "0.5646696", "0.5598178", "0.557389", "0.5563821", "0.5482843", "0.5413918", "0.5413375", "0.53326714", "0.53081083", "0.53040534", "0.5293794", "0.52868974", "0.5284766", "0.526946", "0.52602595", "0.523994...
0.7064549
0
Run the solution in the exact specified directory
def _run_exact_solution(solution_dir, test=False): sys.path.append(solution_dir) # add to allow util.py import from day's directory sys.path.append(os.path.dirname(solution_dir)) import solution if test: try: solution.run except AttributeError: solution_file...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def run_workdir(self, path):\n pass", "def _run_simulator(self):\n os.chdir(self.test_cases_path)\n\n simulator_config_filename = self.simulator_config_filename\n script, options = runner.parse_commands(simulator_config_filename)\n\n if sys.platform.startswith('win'):\n ...
[ "0.66220284", "0.64217085", "0.63024724", "0.61351603", "0.61159885", "0.6102285", "0.6092397", "0.6064275", "0.6035573", "0.6030033", "0.60200626", "0.59267926", "0.5919935", "0.59048945", "0.5890944", "0.58701456", "0.58694714", "0.58693445", "0.58487374", "0.57848525", "0....
0.59686
11
Perform singular values decomposisiton on a document term matrix A. A = T S D^T A ~ T'S'D'^T Where T', S', and D' have a fewer columns than T, S, and D.
def computeTruncatedSVD(docTermMatrix, dim=500): T, S, D = np.linalg.svd(np.transpose(docTermMatrix), full_matrices=False) diagS = np.diag(S) shape = np.shape(diagS) if dim <= shape[0] and dim <= shape[1]: subT = T[:,:dim] subS = diagS[:dim,:dim] subD = np.transpose(D)...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def singular_decomp(A):\n # Initialization\n n, m = A.shape\n U = np.zeros((n, m), dtype='float64')\n\n # Diagonalization of A^T * A\n rot, e, V = eigen.diag(np.dot(np.transpose(A), A))\n\n # Calculate U\n U = np.dot(A, V)\n for i in range(m):\n e[i] = np.sqrt(e[i])\n U[:, i] ...
[ "0.6640744", "0.58657926", "0.58088976", "0.57761854", "0.57290536", "0.5726822", "0.5711986", "0.5658731", "0.5601522", "0.55621266", "0.5544685", "0.5520135", "0.54970425", "0.5486736", "0.5445198", "0.54431707", "0.5406663", "0.53682363", "0.53435516", "0.529848", "0.52955...
0.6557088
1
Writes to db_filename somehow.
def __init__(self, db_filename): self._conn = sqlite3.connect(db_filename) self._conn.text_factory = str self._cursor = self._conn.cursor()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def write_db(db):\n\n # Look for database in the same folder as this script\n script_dir = os.path.dirname(os.path.realpath(__file__))\n db_filepath = os.path.join(script_dir, 'cn_loads_database.dat')\n\n with open(db_filepath, 'w') as f:\n f.write(yaml.dump(db, default_flow_style=False))", "d...
[ "0.7135077", "0.7029683", "0.70190406", "0.67046505", "0.66948396", "0.668093", "0.6621175", "0.6610708", "0.6508839", "0.6508839", "0.6502612", "0.6467026", "0.64418215", "0.64383954", "0.6423064", "0.6422576", "0.636483", "0.6363369", "0.6310691", "0.62984604", "0.6294062",...
0.0
-1
Selects all entries such that entry.timestamp >= timestamps[entry.client] window_size
def select(self, timestamps): pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def do_search_coincidences(timestamps, window=200000):\n coincidences = []\n\n # traverse all timestamps\n for i in xrange(len(timestamps)):\n\n # build coincidence, starting with the current timestamp\n c = [i]\n t0 = timestamps[i][0]\n\n # traverse the rest of the timestamps\...
[ "0.54318", "0.5304614", "0.5213484", "0.50306123", "0.5017064", "0.50053144", "0.4959315", "0.49128497", "0.48927337", "0.48854557", "0.48687822", "0.48336253", "0.48201647", "0.47550848", "0.47432086", "0.47310567", "0.4719693", "0.4709526", "0.46631616", "0.4658335", "0.465...
0.45346963
33
Trigger sai ptf test here.
def test_sai(sai_testbed, sai_test_env_check, creds, duthost, ptfhost, ptf_sai_test_case, request, create_sai_test_interface_param): dut_ip = duthost.host.options['inventory_manager'].get_host( duthost.hostname).vars[...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def runtest(self):", "def test():\n pass", "def testing(self):\n print('test successful')", "def test(self,*args,**kwargs):\n print(\"[TEMPLATE ENGINE] 'testing' function not implemented\")\n pass", "def _test(self):\n pass", "def _test(self):\n pass", "def _te...
[ "0.65121084", "0.64988273", "0.647771", "0.6437519", "0.63721097", "0.63721097", "0.63721097", "0.6358594", "0.63234115", "0.62675816", "0.62112737", "0.62007904", "0.6182577", "0.6182577", "0.6182577", "0.6182577", "0.6182577", "0.61620486", "0.61444914", "0.6125484", "0.612...
0.0
-1
IaasUcsdManagedInfraAllOf a model defined in OpenAPI
def __init__(self, advanced_catalog_count=None, bm_catalog_count=None, container_catalog_count=None, esxi_host_count=None, external_group_count=None, hyperv_host_count=None, local_group_count=None, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def openapi_types():\n return {\n \"account\": (str,), # noqa: E501\n \"address_city\": (str,), # noqa: E501\n \"address_country\": (str,), # noqa: E501\n \"address_line1\": (str,), # noqa: E501\n \"address_line1_check\": (str,), # noqa: E501\n ...
[ "0.5080883", "0.50748086", "0.49696618", "0.4908364", "0.48975128", "0.48663056", "0.48609036", "0.4858573", "0.48343837", "0.47895467", "0.47518623", "0.47351536", "0.47230732", "0.4704432", "0.46940196", "0.46839136", "0.4650198", "0.46466818", "0.46428332", "0.46342972", "...
0.0
-1
Sets the advanced_catalog_count of this IaasUcsdManagedInfraAllOf.
def advanced_catalog_count(self, advanced_catalog_count): self._advanced_catalog_count = advanced_catalog_count
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def bm_catalog_count(self, bm_catalog_count):\n\n self._bm_catalog_count = bm_catalog_count", "def container_catalog_count(self, container_catalog_count):\n\n self._container_catalog_count = container_catalog_count", "def standard_catalog_count(self, standard_catalog_count):\n\n self._stan...
[ "0.57526886", "0.5751853", "0.56568986", "0.46540743", "0.46511573", "0.45186806", "0.4483399", "0.43547434", "0.43004668", "0.4271701", "0.4244447", "0.42245948", "0.42140615", "0.41743332", "0.4168656", "0.41071948", "0.41035506", "0.40634376", "0.4060891", "0.4047798", "0....
0.8002607
0
Sets the bm_catalog_count of this IaasUcsdManagedInfraAllOf.
def bm_catalog_count(self, bm_catalog_count): self._bm_catalog_count = bm_catalog_count
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def container_catalog_count(self, container_catalog_count):\n\n self._container_catalog_count = container_catalog_count", "def standard_catalog_count(self, standard_catalog_count):\n\n self._standard_catalog_count = standard_catalog_count", "def advanced_catalog_count(self, advanced_catalog_count...
[ "0.67917866", "0.62580836", "0.60013944", "0.5060284", "0.4933995", "0.4909605", "0.48784313", "0.48781607", "0.47947842", "0.4782925", "0.47474197", "0.47474197", "0.46623227", "0.46587622", "0.4638956", "0.46326226", "0.46316606", "0.46220344", "0.4605496", "0.45846856", "0...
0.7878276
0
Sets the container_catalog_count of this IaasUcsdManagedInfraAllOf.
def container_catalog_count(self, container_catalog_count): self._container_catalog_count = container_catalog_count
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def bm_catalog_count(self, bm_catalog_count):\n\n self._bm_catalog_count = bm_catalog_count", "def standard_catalog_count(self, standard_catalog_count):\n\n self._standard_catalog_count = standard_catalog_count", "def advanced_catalog_count(self, advanced_catalog_count):\n\n self._advanced...
[ "0.6810308", "0.6344454", "0.59025335", "0.5486347", "0.51642656", "0.5138865", "0.50294644", "0.5021692", "0.50136554", "0.49914697", "0.48896855", "0.4718432", "0.46324363", "0.45579195", "0.45579195", "0.44740677", "0.4469012", "0.44313428", "0.44271842", "0.44019943", "0....
0.8005635
0
Sets the esxi_host_count of this IaasUcsdManagedInfraAllOf.
def esxi_host_count(self, esxi_host_count): self._esxi_host_count = esxi_host_count
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def hyperv_host_count(self, hyperv_host_count):\n\n self._hyperv_host_count = hyperv_host_count", "def hosts_every(self, hosts_every):\n\n self._hosts_every = hosts_every", "def vcpu_set(vm_hostname, count, offline=False):\n with ExitStack() as es:\n vm = es.enter_context(_get_vm(vm_hos...
[ "0.59950227", "0.5260858", "0.50562745", "0.50244135", "0.49948582", "0.48857233", "0.48497176", "0.48385507", "0.482034", "0.4762812", "0.47252673", "0.4718971", "0.47022638", "0.46596396", "0.46280846", "0.45461932", "0.45392084", "0.45244592", "0.45231992", "0.45225677", "...
0.8037844
0
Sets the external_group_count of this IaasUcsdManagedInfraAllOf.
def external_group_count(self, external_group_count): self._external_group_count = external_group_count
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def local_group_count(self, local_group_count):\n\n self._local_group_count = local_group_count", "def external_ids(self, external_ids):\n\n self._external_ids = external_ids", "def esxi_host_count(self, esxi_host_count):\n\n self._esxi_host_count = esxi_host_count", "def set_all_data_ex...
[ "0.53656894", "0.4734468", "0.4715213", "0.4630498", "0.46285418", "0.4532851", "0.45295992", "0.44841346", "0.44807005", "0.44654495", "0.44654495", "0.44654495", "0.44536784", "0.4435368", "0.43804", "0.42757764", "0.42720485", "0.42300162", "0.42260072", "0.4207612", "0.41...
0.75556606
0
Sets the hyperv_host_count of this IaasUcsdManagedInfraAllOf.
def hyperv_host_count(self, hyperv_host_count): self._hyperv_host_count = hyperv_host_count
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def esxi_host_count(self, esxi_host_count):\n\n self._esxi_host_count = esxi_host_count", "def vcpu_set(vm_hostname, count, offline=False):\n with ExitStack() as es:\n vm = es.enter_context(_get_vm(vm_hostname))\n\n if vm.dataset_obj['datacenter_type'] != 'kvm.dct':\n raise Not...
[ "0.66588247", "0.5818077", "0.5640094", "0.5640094", "0.5394924", "0.5279623", "0.5277185", "0.52716357", "0.5202823", "0.50858754", "0.5027976", "0.4993971", "0.4947955", "0.4938431", "0.48995036", "0.4849338", "0.4816406", "0.4814211", "0.48059392", "0.47629017", "0.4759356...
0.7839512
0
Sets the local_group_count of this IaasUcsdManagedInfraAllOf.
def local_group_count(self, local_group_count): self._local_group_count = local_group_count
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def external_group_count(self, external_group_count):\n\n self._external_group_count = external_group_count", "def _set_group_resource(self, _g):\n\n if isinstance(_g, Server):\n return\n\n for _, sg in _g.subgroups.items():\n self._set_group_resource(sg)\n _...
[ "0.5947293", "0.509726", "0.4911288", "0.4911288", "0.4911288", "0.4881376", "0.4801572", "0.4801572", "0.4801572", "0.4801572", "0.46374658", "0.46280244", "0.46024618", "0.46024618", "0.46024618", "0.46024618", "0.45948556", "0.45816755", "0.45816755", "0.45816755", "0.4581...
0.76894385
0
Sets the standard_catalog_count of this IaasUcsdManagedInfraAllOf.
def standard_catalog_count(self, standard_catalog_count): self._standard_catalog_count = standard_catalog_count
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def container_catalog_count(self, container_catalog_count):\n\n self._container_catalog_count = container_catalog_count", "def bm_catalog_count(self, bm_catalog_count):\n\n self._bm_catalog_count = bm_catalog_count", "def advanced_catalog_count(self, advanced_catalog_count):\n\n self._adva...
[ "0.57423514", "0.5616781", "0.50827426", "0.4542607", "0.44935066", "0.44344246", "0.43874955", "0.43789217", "0.4358185", "0.43167907", "0.43059853", "0.4270202", "0.42586276", "0.4214198", "0.42093727", "0.4138831", "0.41344634", "0.41310257", "0.41012546", "0.40627837", "0...
0.81387305
0
Sets the user_count of this IaasUcsdManagedInfraAllOf.
def user_count(self, user_count): self._user_count = user_count
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _set_usr_ping_count(self, v, load=False):\n if hasattr(v, \"_utype\"):\n v = v._utype(v)\n try:\n t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name=\"usr-ping-count\", rest_name=\"usr-ping-count\", pa...
[ "0.61215466", "0.5793492", "0.54216063", "0.54033273", "0.532203", "0.5165332", "0.5099306", "0.5092787", "0.5068327", "0.5068107", "0.5022238", "0.5022238", "0.49769667", "0.49539578", "0.49485537", "0.4900824", "0.48729518", "0.48636237", "0.48355436", "0.4805139", "0.48023...
0.72169346
1
Sets the vdc_count of this IaasUcsdManagedInfraAllOf.
def vdc_count(self, vdc_count): self._vdc_count = vdc_count
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def vm_count(self, vm_count):\n\n self._vm_count = vm_count", "def vm_count(self, vm_count):\n\n self._vm_count = vm_count", "def set_cpu_count(self, nVmCpuCount):\n\t\tcall_sdk_function('PrlVmCfg_SetCpuCount', self.handle, nVmCpuCount)", "def set_count(self, count, asset=None):\n self._...
[ "0.5437181", "0.5437181", "0.531096", "0.5136232", "0.50647324", "0.49089286", "0.47968695", "0.4710327", "0.46992522", "0.46300593", "0.46219018", "0.46113285", "0.46049786", "0.4604565", "0.45997623", "0.45524865", "0.45503348", "0.45477548", "0.45165822", "0.45023248", "0....
0.7397312
0
Sets the vm_count of this IaasUcsdManagedInfraAllOf.
def vm_count(self, vm_count): self._vm_count = vm_count
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_cpu_count(self, nVmCpuCount):\n\t\tcall_sdk_function('PrlVmCfg_SetCpuCount', self.handle, nVmCpuCount)", "def vdc_count(self, vdc_count):\n\n self._vdc_count = vdc_count", "def lun_count(self, lun_count):\n\n self._lun_count = lun_count", "def vcpus(self, vcpus):\n self._vcpus = ...
[ "0.60274035", "0.5922383", "0.5739843", "0.5628235", "0.56280166", "0.5574185", "0.55255973", "0.53965175", "0.5285271", "0.5197171", "0.5193007", "0.5076765", "0.5026433", "0.5026433", "0.50207126", "0.49862435", "0.4984859", "0.49740753", "0.4924906", "0.49171144", "0.49162...
0.7385598
1
Sets the guid of this IaasUcsdManagedInfraAllOf.
def guid(self, guid): self._guid = guid
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def guid(self, guid):\n self._guid = guid", "def cmd_set_guid(argv,o):\n LibIBOpts.setup(o);\n (args,values) = o.parse_args(argv);\n lib = LibIBOpts(o,args,values,3,(tmpl_target,tmpl_int,tmpl_port_guid));\n\n if len(values) != 3:\n raise CmdError(\"Not enough arguments\");\n\n with l...
[ "0.5373949", "0.5280875", "0.46020597", "0.45552626", "0.4523249", "0.45016184", "0.43972918", "0.4326833", "0.42316926", "0.42313373", "0.4229026", "0.42265818", "0.4208345", "0.4155647", "0.41291952", "0.41291952", "0.41068876", "0.4092342", "0.40804192", "0.40481693", "0.4...
0.5306522
3
Returns the model properties as a dict
def to_dict(self): result = {} for attr, _ in six.iteritems(self.openapi_types): value = getattr(self, attr) if isinstance(value, list): result[attr] = list( map(lambda x: x.to_dict() if hasattr(x, "to_dict") else x, va...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def to_dict(self):\n return self.properties", "def to_dict(self):\n return self.properties", "def get_properties(self):\n return self.properties", "def asdict(self):\n return self._prop_dict", "def json(self):\n rv = {\n prop: getattr(self, prop)\n f...
[ "0.775081", "0.775081", "0.7338297", "0.73333067", "0.7296288", "0.7277521", "0.7159291", "0.71573424", "0.714855", "0.714855", "0.71273863", "0.71261555", "0.7122034", "0.71070296", "0.7060047", "0.7043975", "0.7032398", "0.7023222", "0.6964265", "0.6958815", "0.68987364", ...
0.0
-1
Returns the string representation of the model
def to_str(self): return pprint.pformat(self.to_dict())
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __str__(self):\n return super().__str__() + self.model.__str__()", "def __str__(self) -> str:\n # noinspection PyUnresolvedReferences\n opts = self._meta\n if self.name_field:\n result = str(opts.get_field(self.name_field).value_from_object(self))\n else:\n ...
[ "0.85856134", "0.7814518", "0.77898884", "0.7751367", "0.7751367", "0.7712228", "0.76981676", "0.76700574", "0.7651133", "0.7597206", "0.75800353", "0.7568254", "0.7538184", "0.75228703", "0.7515832", "0.7498764", "0.74850684", "0.74850684", "0.7467648", "0.74488163", "0.7442...
0.0
-1
For `print` and `pprint`
def __repr__(self): return self.to_str()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def pprint(*args, **kwargs):\n if PRINTING:\n print(*args, **kwargs)", "def print_out():\n pass", "def custom_print(*objects):\n print(*objects, sep=OFS, end=ORS)", "def _print(self, *args):\n return _ida_hexrays.vd_printer_t__print(self, *args)", "def _printable(self):\n ...
[ "0.75577617", "0.73375154", "0.6986672", "0.698475", "0.6944995", "0.692333", "0.6899106", "0.6898902", "0.68146646", "0.6806209", "0.6753795", "0.67497987", "0.6744008", "0.6700308", "0.6691256", "0.6674591", "0.6658083", "0.66091245", "0.6606931", "0.6601862", "0.6563738", ...
0.0
-1
Returns true if both objects are equal
def __eq__(self, other): if not isinstance(other, IaasUcsdManagedInfraAllOf): return False return self.to_dict() == other.to_dict()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __eq__(self, other):\n return are_equal(self, other)", "def __eq__(self, other):\n return are_equal(self, other)", "def __eq__(self,other):\n try: return self.object==other.object and isinstance(self,type(other))\n except: return False", "def __eq__(self, other):\n if i...
[ "0.8088132", "0.8088132", "0.8054589", "0.7982687", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", ...
0.0
-1
Returns true if both objects are not equal
def __ne__(self, other): if not isinstance(other, IaasUcsdManagedInfraAllOf): return True return self.to_dict() != other.to_dict()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __ne__(self, other: object) -> bool:\n if self.__eq__(other):\n return False\n return True", "def __ne__(self, other: object) -> bool:\n return not self.__eq__(other)", "def __ne__(self, other) -> bool:\n return not self.__eq__(other)", "def __eq__(self, other):\n ...
[ "0.84560555", "0.83913696", "0.8143685", "0.81403786", "0.8131871", "0.8093231", "0.80915105", "0.80915105", "0.80915105", "0.8084564", "0.8084564", "0.8075547", "0.8075547", "0.8065006", "0.80417657", "0.80417657", "0.80417657", "0.80417657", "0.80417657", "0.80417657", "0.8...
0.0
-1
Formats ``path`` with the rank zero values.
def _format_path_with_rank_zero(path: str) -> str: return path.format( rank=0, local_rank=0, node_rank=0, )
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _get_local_rank_zero_path(path: Optional[str]) -> str:\n local_rank_zero = dist.get_global_rank() - dist.get_local_rank()\n paths = dist.all_gather_object(path)\n local_rank_zero_path = paths[local_rank_zero]\n assert local_rank_zero_path is not None, 'local rank zero provides the path'\n return...
[ "0.6743314", "0.6682493", "0.5183608", "0.51139396", "0.51139396", "0.51139396", "0.50459886", "0.49452367", "0.49336353", "0.49094725", "0.4861403", "0.48274943", "0.48119223", "0.48062816", "0.47794765", "0.47726187", "0.4767327", "0.47632933", "0.47430956", "0.4704121", "0...
0.890424
0
Formats ``path`` formatted with the current rank values.
def _format_path_with_current_rank(path: str) -> str: return path.format( rank=dist.get_global_rank(), local_rank=dist.get_local_rank(), node_rank=dist.get_node_rank(), )
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _format_path_with_rank_zero(path: str) -> str:\n return path.format(\n rank=0,\n local_rank=0,\n node_rank=0,\n )", "def format_path(path):\n if len(path) > 1:\n result = [crayons.yellow(path[0].name)]\n\n previous = path[0]\n for item in path[1:]:\n ...
[ "0.7308434", "0.6294355", "0.6030438", "0.58486265", "0.58486265", "0.58486265", "0.5666408", "0.5501491", "0.54912573", "0.5491005", "0.5487094", "0.5456914", "0.5407116", "0.53897357", "0.5379467", "0.5378536", "0.53413504", "0.5290244", "0.5282369", "0.5271615", "0.5261161...
0.8522862
0
Load a checkpoint from a local file, URI, or cloud object store into ``state``.
def load_checkpoint( path: str, state: State, logger: Logger, object_store: Optional[Union[ObjectStore, LoggerDestination]] = None, load_weights_only: bool = False, strict_model_weights: bool = False, progress_bar: bool = True, ignore_keys: Optional[Union[List[str], Callable[[Dict], None...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def load_checkpoint(self, checkpoint: str, **kwargs) -> None:\n with open(checkpoint, \"rb\") as f:\n state = SafePickle.load(f)\n\n state_id = ray.put(state)\n ray.get([worker.set_state.remote(state_id, **kwargs) for worker in self.remote_workers])", "def load_from_checkpoint(sel...
[ "0.8046602", "0.7789368", "0.7547819", "0.7534057", "0.744159", "0.74061614", "0.73822767", "0.7316122", "0.72855556", "0.7279566", "0.7265061", "0.7259501", "0.7259501", "0.71900815", "0.71689534", "0.7152443", "0.7132168", "0.712835", "0.7123272", "0.7122712", "0.7074052", ...
0.67693573
48
Broadcasts the ``path`` from the LOCAL rank zero to all LOCAL ranks.
def _get_local_rank_zero_path(path: Optional[str]) -> str: local_rank_zero = dist.get_global_rank() - dist.get_local_rank() paths = dist.all_gather_object(path) local_rank_zero_path = paths[local_rank_zero] assert local_rank_zero_path is not None, 'local rank zero provides the path' return local_ran...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def send_path(self, path):\n self.clear_path()\n for coordinate in path:\n self.send_coordinate(coordinate)\n time.sleep(0.05)", "def broadcast(value, root_rank, name=None):\n return _impl.broadcast(K, value, root_rank, name)", "def extern_to_local_path(self, path: PurePa...
[ "0.558918", "0.5540478", "0.5262298", "0.5138672", "0.51280296", "0.5033147", "0.4981683", "0.4957514", "0.4915474", "0.4859186", "0.4790848", "0.4757363", "0.47432727", "0.4711225", "0.47017384", "0.4673872", "0.46665725", "0.46487427", "0.4647647", "0.46301493", "0.46140268...
0.639906
0
Download the checkpoint stored at ``path``, potentially in ``object_store``, to ``node_checkpoint_folder``. Returns a tuple of (``composer_states_filepath``, ``extracted_checkpoint_folder``, ``extracted_rank_n``). The ``composer_states_filepath``, is the path to the composer states, which can be passed into
def download_checkpoint(path: str, node_checkpoint_folder: str, object_store: Optional[Union[ObjectStore, LoggerDestination]], progress_bar: bool, fsdp_sharded_state_dict_enabled: bool = False, deepsp...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def load_checkpoint(\n path: str,\n state: State,\n logger: Logger,\n object_store: Optional[Union[ObjectStore, LoggerDestination]] = None,\n load_weights_only: bool = False,\n strict_model_weights: bool = False,\n progress_bar: bool = True,\n ignore_keys: Optional[Union[List[str], Callable...
[ "0.62694466", "0.61993414", "0.6029626", "0.5934021", "0.5839948", "0.5779024", "0.5675783", "0.5657235", "0.55893075", "0.5551518", "0.5551518", "0.55440056", "0.55313367", "0.5514979", "0.5417088", "0.54159427", "0.5401518", "0.5353508", "0.53150314", "0.529472", "0.5274455...
0.7012607
0
Recursively flatten the keys of a dictionary or list into a set of paths.
def _flatten_keys(obj: Any, paths: List[str], existing_path: str): # Store path when we reach end, which is either non-Dict or empty Dict if isinstance(obj, list) and len(obj) > 0: for i, elm in enumerate(obj): _flatten_keys(elm, paths, f'{existing_path}/{i}') elif isinstance(obj, dict) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def flatten_keys(in_keys):\n return_keys = []\n if isinstance(in_keys, str):\n return [in_keys]\n if isinstance(in_keys, Iterable):\n for key in in_keys:\n if isinstance(key, Iterable):\n return_keys += flatten_keys(key)\n else:\n return_ke...
[ "0.6875952", "0.6714829", "0.6393634", "0.6268066", "0.6147617", "0.60040855", "0.5961839", "0.58822143", "0.5856093", "0.58354765", "0.5823535", "0.58075947", "0.58066595", "0.5770507", "0.57541543", "0.5746323", "0.574392", "0.57279015", "0.5708329", "0.5703219", "0.5697986...
0.7069572
0