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
calculates beam xy and other parameters.
def calculate_beam_xy(self): info = [] # Import relevant info pixel_size = self.info.pixel_size for i in [j.final for j in self.final_objects]: try: info.append( [ i, i["beamX"], ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def xy(self):\n ...", "def beam(xb,yb,zb,wx,wy,wavelen):\n\n zRx = np.pi * wx**2 / wavelen\n zRy = np.pi * wy**2 / wavelen \n \n sqrtX = np.sqrt( 1 + np.power(zb/zRx,2) ) \n sqrtY = np.sqrt( 1 + np.power(zb/zRy,2) ) \n intensity = np.exp( -2.*( np.power(xb/(wx*sqrtX ),2) \\\n ...
[ "0.6129466", "0.60761815", "0.6049173", "0.5987054", "0.59085387", "0.58142376", "0.58065397", "0.5801077", "0.5798147", "0.57459855", "0.57192415", "0.57188255", "0.5706152", "0.5704091", "0.5699249", "0.5691896", "0.5674206", "0.5672045", "0.5594236", "0.5586325", "0.556433...
0.73167294
0
Plot beam center coordinates and a histogram of distances from the median of beam center coordinates to each set of coordinates. Superpose a predicted misindexing shift by L +/ 1 (calculated for each axis).
def plot_beam_xy(self, write_files=False, return_values=False, threeD=False): import matplotlib.pyplot as plt # Get values ( beamX, beamY, cbeamX, cbeamY, obeamX, obeamY, beam_dist, distances, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def plot_averaged_amplitude(self):\r\n\r\n tremap = np.arange(0, self.period, 1./self.framerate)\r\n\r\n ipy_offset = -2\r\n\r\n # find center of image\r\n\r\n self.ipx = int(self.imageData.shape[1]/2.)\r\n\r\n self.ipy = int(self.imageData.shape[2]/2.)\r\n\r\n posx = rang...
[ "0.59229296", "0.58711404", "0.5804657", "0.57857805", "0.57540417", "0.57117033", "0.5675799", "0.56658244", "0.5662011", "0.5661819", "0.5587553", "0.5554073", "0.5548557", "0.5535812", "0.5503324", "0.5486324", "0.54851836", "0.54742026", "0.54716635", "0.54662895", "0.546...
0.5422894
24
Prints diagnostics from the final integration run.
def print_results(self, final_table=None): assert self.info if not final_table: final_table = ["\n\n{:-^80}\n".format("ANALYSIS OF RESULTS")] if not self.info.categories["integrated"]: final_table.append("NO IMAGES INTEGRATED!") else: label_lens = [...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def report(self):\r\n print(\"\".join(self.memory), self.error, self.steps)", "def print_results(self):\n pass", "def printReport(self):\n\t\tself.app.printflush('Fetched: ' + str(self.fetched_count), self.app.IGNORE_EXIT_FLAG)\n\t\tself.app.printflush('Processes: ' + str(self.processes), self.ap...
[ "0.6404051", "0.62685865", "0.61496735", "0.6147585", "0.60939384", "0.60691977", "0.60293907", "0.59640324", "0.5960282", "0.59163845", "0.5895703", "0.58707947", "0.5852592", "0.5839212", "0.5830497", "0.581424", "0.5782676", "0.57226", "0.57172406", "0.5713037", "0.5702594...
0.55977476
29
Calls unit cell analysis module, which uses hierarchical clustering (Zeldin, et al, Acta D, 2015) to split integration results according to detected morphological groupings (if any). Most useful with preliminary integration without target unit cell specified.
def unit_cell_analysis(self): # Will not run clustering if only one integration result found or if turned off if not self.info.categories["integrated"]: util.main_log( self.info.logfile, "\n\n{:-^80}\n".format(" UNIT CELL ANALYSIS "), True ) util.main...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def main(argv):\n args = process_command_line(argv)\n name = job_string(args)\n #That feel when no torison ;_;\n if args.dihed:\n raise Exception(\"Dihed is not supported right now\")\n #SDFS!\n if args.sdf:\n handle_sdf(args)\n #Conversion, pruning\n pybel_mols = convert_to_p...
[ "0.5610221", "0.5556858", "0.5512909", "0.546379", "0.54304254", "0.5370964", "0.536435", "0.53357214", "0.5281515", "0.5277882", "0.52746207", "0.5239652", "0.52363443", "0.5225614", "0.52088296", "0.52050596", "0.5199139", "0.5171439", "0.5166146", "0.51584786", "0.51337284...
0.75939274
0
Prints summary and appends to general log file. Also outputs some of it on stdout. Also writes out output list files.
def print_summary(self, write_files=True): assert self.info if not self.info.categories["integrated"]: util.main_log( self.info.logfile, "NO IMAGES SUCCESSFULLY PROCESSSED!", (not self.gui_mode), ) return summ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def summarise(thislog):\n\n # Logfile name\n print(\"Summary for \" + thislog.filename() + \"\\n\")\n # Was it from CCP4i?\n if thislog.isccp4i():\n print(\"This is a CCP4i logfile\\n\")\n # Number of programs or pseudo-programs\n print(str(thislog.nfragments()) + \" logfile fragments\\n\"...
[ "0.6720507", "0.657472", "0.6511565", "0.64218163", "0.63418883", "0.6279946", "0.62183446", "0.6165553", "0.6113296", "0.60181886", "0.60126966", "0.6002401", "0.5998294", "0.5992156", "0.5933482", "0.591959", "0.5911536", "0.5901738", "0.5840104", "0.5839231", "0.5829121", ...
0.6430065
3
Imports default PRIME input parameters, modifies correct entries and prints out a starting PHIL file to be used with PRIME.
def make_prime_input(self, filename="prime.phil", run_zero=False): assert self.info pixel_size = self.info.pixel_size hres = self.info.stats["res"] lres = self.info.stats["lres"] # If symmetry / unit cell were not overridden from GUI, set from INFO if not self.best_pg: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def Usage():\r\n print \"Correct Usage:\"\r\n print \"python primesBelow.py <integer>\"", "def pr(form, *args):\n # variables\n global lPr, lMaPr\n\n if lPr < lMaPr:\n for l in range(lPr + 1):\n sys.stdout.write('-')\n if len(args) == 0:\n print form\n ...
[ "0.57706285", "0.5497428", "0.5485556", "0.5466297", "0.54553556", "0.542836", "0.5421417", "0.53975254", "0.53920454", "0.53487873", "0.5346001", "0.5343639", "0.53339195", "0.5314539", "0.53113174", "0.5310713", "0.5290864", "0.52821314", "0.52764744", "0.5268802", "0.52430...
0.6344126
0
Get range obj by float
def float_range(start, stop, step): while start < stop: yield float(start) start += decimal.Decimal(step)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def range(self):\n lower, upper = sorted((self.y1, self.y2))\n return FloatRange(lower=lower, upper=upper)", "def _rangeQueryFloatFeature(self):\n\n # create args\n minToGet = c_double()\n maxToGet = c_double()\n\n errorCode = VimbaDLL.featureFloatRangeQuery(self._handle...
[ "0.71502924", "0.68753797", "0.64868176", "0.64425915", "0.642538", "0.64180946", "0.62441003", "0.62220085", "0.621806", "0.6217645", "0.6143057", "0.6125329", "0.6125329", "0.6114536", "0.6097614", "0.6091006", "0.606575", "0.6055309", "0.6042241", "0.60320693", "0.6020189"...
0.62341285
7
Get S&P500 current price and current time
def get_sp500(): sp500 = si.get_live_price("^GSPC") sp500_trim = "%.2f" % sp500 _time = datetime.datetime.now().timetuple() _time = time.mktime(tuple(_time)) _time_label = f"test" return float(sp500_trim), int(_time)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getprice():\n\n print(\"Get price\")\n latest_price = get_latest_price(item_code)\n return latest_price", "def getCurrentPrice(self,primary,secondary):\n pair = self.getTradedPair(primary,secondary)\n uri = \"https://www.bitstamp.net/api/v2/ticker/\"\n requestUrl = uri + pair\n jsonRespo...
[ "0.7215502", "0.7165495", "0.7139455", "0.71224046", "0.705337", "0.693749", "0.6831584", "0.680008", "0.67942756", "0.6649967", "0.65492207", "0.64216787", "0.6361455", "0.6216685", "0.6193378", "0.6148163", "0.611725", "0.6070562", "0.60117114", "0.6002141", "0.59859204", ...
0.6827049
7
Start app instance with proper exit
def main(): app = QtWidgets.QApplication(sys.argv) main = MainWindow() main.show() sys.exit(app.exec_())
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def startapp():", "def start(self):\n\n self.app.go()", "def start():\n app.run()", "def launch_instance(cls, argv=None, **kwargs):\n try:\n return super(JupyterApp, cls).launch_instance(argv=argv, **kwargs)\n except NoStart:\n return", "def create_and_run():\n...
[ "0.77904356", "0.699691", "0.66588265", "0.66432637", "0.6597644", "0.65634286", "0.65507096", "0.6539924", "0.65029126", "0.65029126", "0.65009236", "0.6488637", "0.64699376", "0.6443841", "0.643096", "0.6416083", "0.6415801", "0.6352434", "0.63469565", "0.63384414", "0.6306...
0.0
-1
Function to fetch the chain from a blockchain node, parse the data, and store it locally.
def fetch_posts(): get_chain_address = F"{CONNECTED_NODE_ADDRESS}/chain" response = requests.get(get_chain_address) if response.status_code == 200: content = [] chain = json.loads(response.content) for block in chain["chain"]: for tx in block["transactions"]: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_chain():\n response = {\n 'chain': blockchain.chain,\n 'length':len(blockchain.chain)\n }\n\n return jsonify(response), 200", "def get_chain(self):\n app_process = sqlite3.connect('app_process::memory:', check_same_thread=False)\n app_process_cursor = app_process.curs...
[ "0.60987407", "0.5816403", "0.56391543", "0.56332684", "0.54955184", "0.5480293", "0.54046446", "0.5368525", "0.5321379", "0.5166924", "0.51448447", "0.5138189", "0.5032647", "0.5009114", "0.50053024", "0.50045025", "0.49803552", "0.49783364", "0.49729702", "0.49098444", "0.4...
0.4319509
81
Endpoint to create a new transaction via our application
def submit_textarea(): post_content = request.form["content"] author = request.form["author"] post_object = { 'author': author, 'content': post_content } # Submit a tx new_tx_address = f"{CONNECTED_NODE_ADDRESS}/new_transaction" request.post(new_tx_address, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def CreateTransaction(self, request, context):\n context.code(beta_interfaces.StatusCode.UNIMPLEMENTED)", "def new_transaction():\n\n data = request.get_json()\n\n if not data:\n return \"No transation data passed\", 400\n\n required = ['sender', 'recipient', 'amount']\n\n if not (list(data...
[ "0.7857358", "0.7536667", "0.70489585", "0.69542104", "0.69542104", "0.6864688", "0.6804625", "0.67751205", "0.67617077", "0.67547923", "0.6747514", "0.6549574", "0.6468893", "0.64249974", "0.63687646", "0.63659436", "0.6288597", "0.6283322", "0.61438334", "0.6090528", "0.605...
0.0
-1
This function uses a numpy expression to evaluate the derivatives in the Laplacian, and calculates u[i,j] based on ui[i,j].
def evolve_ts(u, ui, a, dx, dy, dx2, dy2, dt): u[1:-1, 1:-1] = ui[1:-1, 1:-1] + a*dt*( (ui[2:, 1:-1] - 2*ui[1:-1, 1:-1] + ui[:-2, 1:-1])/dx2 + (ui[1:-1, 2:] - 2*ui[1:-1, 1:-1] + ui[1:-1, :-2])/dy2 )
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def laplacian(expr):\n\n delop = Del()\n if expr.is_Vector:\n return (gradient(divergence(expr)) - curl(curl(expr))).doit()\n return delop.dot(delop(expr)).doit()", "def grad(X, u):\r\n Jshape = list(u.shape)\r\n Jshape[1] -= 4 #subtract ghost cell count from shape\r\n Jshape.insert(0,3...
[ "0.6449859", "0.62042266", "0.60069555", "0.58933336", "0.57898957", "0.57525456", "0.5555429", "0.5512935", "0.5491546", "0.54524994", "0.54423004", "0.5431733", "0.5403716", "0.53978837", "0.5390353", "0.53868294", "0.53855324", "0.53829813", "0.5378176", "0.535542", "0.535...
0.0
-1
Initializes the command line argument parser.
def init_parser(): parser = argparse.ArgumentParser( description='Backup application code and data.') parser.add_argument('-a', '--app-id', required=True, help='the application ID to run the backup for') parser.add_argument('--source-code', action='store_true', default=False, help='backup the source c...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def setUp(self):\n self.parser = command_line.get_args()", "def init_args():\n parser = argparse.ArgumentParser(\n description=\"DeltaSherlock Client software.\")\n parser.add_argument('-v', '--version', action='version', version=VERSION)\n parser.add_argument('-c', '--config', action='sto...
[ "0.7601347", "0.7528685", "0.73878586", "0.7250815", "0.70950997", "0.7083153", "0.70421267", "0.6973221", "0.6948589", "0.6945047", "0.6919792", "0.6907576", "0.6905947", "0.69001305", "0.68913364", "0.6868113", "0.6822481", "0.6813597", "0.6809166", "0.6791391", "0.6789211"...
0.67097956
27
This main function allows you to run the backup manually.
def main(): parser = init_parser() args = parser.parse_args() # Set up logging. level = logging.INFO if args.debug: level = logging.DEBUG logging.basicConfig(format='%(asctime)s %(levelname)s %(filename)s:' \ '%(lineno)s %(message)s ', level=level) logging.info("Logging started") message = "B...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def run_backup():\n host = re.search(\"([\\w.-]+)[:]?\", env.host).group()\n date = time.strftime('%Y%m%d%H%M%S')\n fname = '%(host)s-backup-%(date)s.gz' % {'date': date, 'host': host}\n green(\"Ingrese la contraseña de la clave privada local.\")\n sudo(\"pg_dump kine | gzip > /tmp/%s\" % fname, use...
[ "0.7348714", "0.7322273", "0.72442436", "0.71869266", "0.7080326", "0.7026621", "0.6823129", "0.6735388", "0.66656953", "0.6550088", "0.6538847", "0.6439064", "0.63912153", "0.6356379", "0.63234514", "0.6314879", "0.6291406", "0.6277249", "0.62609226", "0.6228204", "0.6194076...
0.7343254
1
coregisters two images and returns the moving image warped to fit target_img and the respective transform matrix
def register_imgs(moving_img, target_img, rigid=True, rotation=False, warn_angle_deg=1, min_match_count=10, flann_index_kdtree = 0, flann_trees=5, flann_checks=50): if len(target_img.shape) > 2: target_img = cv2.cvtColor(target_img, cv2.COLOR_BGR2GRAY) if len(moving_img.shape) > 2: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def transform_images(img1,img2):", "def warp(img1, img2, M):\n\n # Get width and height of input images \n w1,h1 = img1.shape[:2]\n w2,h2 = img2.shape[:2]\n\n # Get the canvas dimesions\n img2_dims = np.float32([ [0,0], [0,w2], [h2, w2], [h2,0] ]).reshape(-1,1,2)\n img1_dims_temp = np.float32([...
[ "0.683274", "0.65072864", "0.6387012", "0.62673867", "0.6196402", "0.61312056", "0.5996735", "0.5901546", "0.5831172", "0.582552", "0.5818565", "0.580519", "0.5793256", "0.5696396", "0.5688733", "0.56839305", "0.56782573", "0.56660324", "0.5644482", "0.5641259", "0.5622318", ...
0.6298054
3
Root Route Landing page that allows users to login or register
def root(request): return render(request, 'users/index.html')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def home():\n\n if not current_user.is_authenticated:\n return redirect(url_for('login'))\n else:\n return redirect(url_for('show_registrations'))", "def index(self):\n\n # try and pull the user's data\n user = get_active_user_data()\n\n if not user:\n # they a...
[ "0.76603013", "0.7635915", "0.745675", "0.73755187", "0.7304202", "0.7227848", "0.72207665", "0.71749485", "0.7169285", "0.7164671", "0.7160158", "0.7159827", "0.7140134", "0.70964354", "0.7082033", "0.70733595", "0.7016662", "0.7015615", "0.69886833", "0.69692624", "0.693994...
0.6867386
27
Returns a function which takes Paths into the user data and returns csums.
def reverser(num_segs=3): r = re.compile("((\/([0-9]|[a-f])+){%d})$" % (num_segs+1)) def checksum_from_link(link): """Takes a path into the userdata, returns the matching csum.""" m = r.search(safetype(link)) if (m): csum_slash = m.group()[1:] csum = _remove_sep_(csum_slash) return csu...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def calculate(d):\r\n\r\n # Set correct slashes for the OS\r\n if sys.platform == 'windows':\r\n slash = '\\\\'\r\n elif sys.platform == 'linux':\r\n slash = '/'\r\n else:\r\n print('#Error. Unknown platform.')\r\n return\r\n\r\n print('Files in the current directory and ...
[ "0.5616519", "0.5510596", "0.54699963", "0.5451842", "0.54407364", "0.53760487", "0.5368446", "0.53618073", "0.5279357", "0.52358234", "0.52341944", "0.5196225", "0.5176148", "0.51656383", "0.51610726", "0.5154971", "0.5148992", "0.5138188", "0.5128646", "0.51273227", "0.5117...
0.59194446
0
Takes a path into the userdata, returns the matching csum.
def checksum_from_link(link): m = r.search(safetype(link)) if (m): csum_slash = m.group()[1:] csum = _remove_sep_(csum_slash) return csum else: raise ValueError("link %s checksum didn't parse" %(link))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def checksum(path):\n with open(path, 'r') as f:\n return md5(f.read()).digest()", "def ukey(self, path):\n out = self._call(\"GETFILECHECKSUM\", path=path, redirect=False)\n if \"Location\" in out.headers:\n location = self._apply_proxy(out.headers[\"Location\"])\n ...
[ "0.66359466", "0.6454005", "0.6149527", "0.6055664", "0.60017765", "0.5985765", "0.59681016", "0.59512496", "0.59177786", "0.59155154", "0.58767915", "0.58560187", "0.580235", "0.5780485", "0.5724725", "0.5703685", "0.56968105", "0.5696304", "0.5692348", "0.5671426", "0.55878...
0.5860333
11
Return string name of link relative to root
def _csum_to_name(self, csum): #TODO someday when csums are parameterized, we inject the has params here. return _checksum_to_path(csum)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def relName(self, cwd=None, root=None):\n return relName(self.path, cwd, root)", "def getRootURL():", "def get_filename(link):\r\n return link[link.rfind(\"/\") + 1:]", "def link_prefix(request):\n return request.application_url", "def relative_link(current_module: str, target_module: str) -> ...
[ "0.71634877", "0.68998414", "0.68714714", "0.6773158", "0.66814035", "0.665135", "0.66316783", "0.66170126", "0.65630275", "0.6537999", "0.6514251", "0.64748186", "0.64625055", "0.643648", "0.641618", "0.6411852", "0.6411852", "0.6408901", "0.6393389", "0.6387245", "0.6387178...
0.0
-1
Return absolute Path to a blob given a csum
def csum_to_path(self, csum): #TODO remove callers so we can make internal. return Path(self._csum_to_name(csum), self.root)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def link_to_blob(self, path, csum):\n new_link = self.csum_to_path(csum)\n ensure_symlink(path, new_link)\n ensure_readonly(path)", "def _csum_to_name(self, csum):\n #TODO someday when csums are parameterized, we inject the has params here.\n return _checksum_to_path(csum)", ...
[ "0.6760842", "0.6556648", "0.64958185", "0.6435036", "0.62205434", "0.58019423", "0.5726288", "0.55842215", "0.5583444", "0.5474924", "0.5454985", "0.5429763", "0.5375666", "0.5375143", "0.5340256", "0.5335034", "0.5317139", "0.53109914", "0.5301503", "0.5301253", "0.5236432"...
0.7445334
0
Takes a csum, and removes it from the blobstore
def delete_blob(self, csum): blob_path = self.csum_to_path(csum) blob_path.unlink(clean=self.root)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def remove():", "def remove(self, data):\n data_hash = hashlib.sha256(data).digest()\n self.denominator = (self.denominator * data_to_num3072(data_hash)) % self.MODULUS", "def __do_binary_delete(item):\n\n file_path = DTF_BINARIES_DIR + item.install_name\n\n if utils.delete_file(file_path) ...
[ "0.5757154", "0.5642187", "0.5564729", "0.5475264", "0.5464008", "0.5457136", "0.53968495", "0.5358681", "0.5354388", "0.5342333", "0.53273803", "0.5321266", "0.5296075", "0.52734", "0.5217147", "0.5210733", "0.5208237", "0.5182357", "0.5178936", "0.5171412", "0.5165453", "...
0.78742325
0
Adds a file to a blobstore via a hard link.
def import_via_link(self, path, csum): blob = self.csum_to_path(csum) duplicate = blob.exists() if not duplicate: ensure_link(blob, path) ensure_readonly(blob) return duplicate
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def link_to_blob(self, path, csum):\n new_link = self.csum_to_path(csum)\n ensure_symlink(path, new_link)\n ensure_readonly(path)", "def add_file(self, path):\n pass", "def add(self, link):\n # if path.exists(self.cachefile):\n with open(self.cachefile, 'a') as cache:\n ...
[ "0.6423228", "0.6287557", "0.61771405", "0.615078", "0.6123352", "0.6082482", "0.5928465", "0.59196544", "0.5893714", "0.5856453", "0.5776597", "0.57732725", "0.5737285", "0.5707831", "0.5680261", "0.5672629", "0.5669991", "0.5660367", "0.56599265", "0.5635269", "0.562064", ...
0.5209071
97
Forces path into a symlink to csum
def link_to_blob(self, path, csum): new_link = self.csum_to_path(csum) ensure_symlink(path, new_link) ensure_readonly(path)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def relink(f):\n if os.path.islink(f):\n linkto = os.path.join(NEW_LINK_BASE, os.path.basename(os.readlink(f)))\n #print 'Relinking %s-> %s from \\n %s' % (f, linkto, os.readlink(f))\n #print 'removing %s' % f\n os.remove(f)\n os.symlink(linkto, f)", "def symlink(self, req, li...
[ "0.6718929", "0.66228133", "0.6465445", "0.6442848", "0.6344745", "0.6339009", "0.6291033", "0.625382", "0.62475646", "0.62025553", "0.6126322", "0.61046165", "0.6099585", "0.6029164", "0.5990421", "0.5971646", "0.59707147", "0.5963814", "0.5950644", "0.5917308", "0.58955467"...
0.72160524
0
Iterator across all blobs
def blobs(self): blobs = pipeline( ftype_selector([FILE]), fmap(first), fmap(self.reverser), )(self.root.entries()) return blobs
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def blob_generator(self):\n for blob in self.data:\n yield blob", "def blobs(self):\n def blob_iterator():\n with s3conn(self.access_id, self.secret) as s3:\n key_iter = s3.list_bucket(self.bucket, prefix=self.prefix+\"/\")\n for key in key_iter:\...
[ "0.7579303", "0.7229534", "0.6972601", "0.64345145", "0.6410156", "0.62850124", "0.6241016", "0.61964935", "0.6173275", "0.61723167", "0.61494774", "0.6100578", "0.60827994", "0.6061901", "0.6057329", "0.60366875", "0.60343045", "0.6032287", "0.5957977", "0.5957977", "0.59544...
0.6484718
3
Returns a file like object which has the blob's contents
def read_handle(self): raise NotImplementedError()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _blob(self):\n return self._load_blob", "def read_blob(blob):\r\n if blob.hexsha != Diff.NULL_HEX_SHA:\r\n return blob.data_stream.read()\r\n else:\r\n with open(blob.path) as fp:\r\n return fp.read()", "def get_blob(file_path):\n f = open(file_path)\n article = f.read().decode('u...
[ "0.73875207", "0.734218", "0.7219361", "0.7122439", "0.7076649", "0.6893296", "0.6844561", "0.6710282", "0.6600551", "0.65756655", "0.65630215", "0.6554439", "0.65501714", "0.6519594", "0.65081966", "0.6476856", "0.64485663", "0.6427532", "0.6406273", "0.63686407", "0.6358167...
0.0
-1
Returns True when the blob's checksum matches. Returns False when there is a checksum corruption.
def verify_blob_checksum(self, blob): path = self.csum_to_path(blob) csum = path.checksum() return csum != blob
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def validate_checksum(self):\n return self.calculate_checksum() == self.checksum()", "def verify_checksum(self):\n return self.generate_header_checksum(omit_checksum=False) == 0", "def _verify_checksum(data, checksum):\n sha256_hash = hashlib.sha256(data).hexdigest().encode()\n return to_bi...
[ "0.7736474", "0.7485926", "0.74634707", "0.7280268", "0.71696", "0.71337336", "0.71063906", "0.7051834", "0.69469905", "0.6904954", "0.6893968", "0.68395376", "0.6808126", "0.6773289", "0.67445666", "0.673051", "0.6638136", "0.6498566", "0.6496091", "0.63991594", "0.6348812",...
0.8861687
0
Returns True when the blob's permissions is read only. Returns False when the blob is mutable.
def verify_blob_permissions(self, blob): path = self.csum_to_path(blob) return is_readonly(path)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def read_only(self):\n return bool(self.__read_only)", "def is_read_only(self):\n\t\treturn bool(call_sdk_function('PrlShare_IsReadOnly', self.handle))", "def is_read_only(self) -> pulumi.Output[Optional[bool]]:\n return pulumi.get(self, \"is_read_only\")", "def get_can_read(self):\n\t\tif not ...
[ "0.74087244", "0.7357655", "0.7207462", "0.7194548", "0.718061", "0.7174269", "0.7069815", "0.70423627", "0.70013654", "0.70013654", "0.6821539", "0.6797577", "0.67828053", "0.67828053", "0.67828053", "0.67828053", "0.6748725", "0.65980434", "0.65751696", "0.65058196", "0.650...
0.7997186
0
Iterator across all blobs
def blobs(self): def blob_iterator(): with s3conn(self.access_id, self.secret) as s3: key_iter = s3.list_bucket(self.bucket, prefix=self.prefix+"/") for key in key_iter: blob = key[len(self.prefix)+1:] yield blob return ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def blob_generator(self):\n for blob in self.data:\n yield blob", "def blob_stats(self):\n def blob_iterator():\n with s3conn(self.access_id, self.secret) as s3:\n key_iter = s3.list_bucket2(self.bucket, prefix=self.prefix+\"/\")\n for head in key...
[ "0.7579303", "0.6972601", "0.6484718", "0.64345145", "0.6410156", "0.62850124", "0.6241016", "0.61964935", "0.6173275", "0.61723167", "0.61494774", "0.6100578", "0.60827994", "0.6061901", "0.6057329", "0.60366875", "0.60343045", "0.6032287", "0.5957977", "0.5957977", "0.59544...
0.7229534
1
Iterator across all blobs, retaining the listing information
def blob_stats(self): def blob_iterator(): with s3conn(self.access_id, self.secret) as s3: key_iter = s3.list_bucket2(self.bucket, prefix=self.prefix+"/") for head in key_iter: blob = head[LIST_BUCKET_KEY][len(self.prefix)+1:] h...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def blobs(self):\n def blob_iterator():\n with s3conn(self.access_id, self.secret) as s3:\n key_iter = s3.list_bucket(self.bucket, prefix=self.prefix+\"/\")\n for key in key_iter:\n blob = key[len(self.prefix)+1:]\n yield blob\n ...
[ "0.68466896", "0.6780061", "0.6164148", "0.6107229", "0.60251284", "0.60030335", "0.5962732", "0.5953068", "0.58656806", "0.58382636", "0.5753683", "0.5752837", "0.5747022", "0.57239527", "0.57012093", "0.56974304", "0.56971043", "0.56695175", "0.56648165", "0.56566805", "0.5...
0.72505546
0
Returns a file like object which has the blob's contents
def read_handle(self): raise NotImplementedError()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _blob(self):\n return self._load_blob", "def read_blob(blob):\r\n if blob.hexsha != Diff.NULL_HEX_SHA:\r\n return blob.data_stream.read()\r\n else:\r\n with open(blob.path) as fp:\r\n return fp.read()", "def get_blob(file_path):\n f = open(file_path)\n article = f.read().decode('u...
[ "0.7388198", "0.7342988", "0.72202396", "0.7122696", "0.70757747", "0.68937564", "0.6845509", "0.6711367", "0.65987545", "0.6575547", "0.6563041", "0.6554713", "0.65501213", "0.6518357", "0.65070355", "0.64762455", "0.64488935", "0.64276737", "0.64051425", "0.63666874", "0.63...
0.0
-1
try to create animate function to plot mechanisms
def plot_animate(self, A): fig = plt.figure() fig.set_tight_layout(False) ax = plt.axes(projection='3d') global cnt cnt = ax global cur_A global cur_B cur_A = A[0] cur_B = self.B[0] def steps(count=1): for i in range(count): ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_animated(self,val):\n self.XP_Plotter.set_animated(val)\n # theoretical lines \n for line in self.lines_theory:\n line.set_animated(val)", "def animate(i):\r\n plot_x.set_data(history_samples[i][:, 0], history_samples[i][:, 1])", "def _animate(foo):\n si...
[ "0.6990524", "0.6984434", "0.68571776", "0.6801392", "0.6801392", "0.6801392", "0.6801392", "0.6801392", "0.6801392", "0.6801392", "0.6801392", "0.6801392", "0.6801392", "0.6801392", "0.67780936", "0.6755396", "0.67217463", "0.664098", "0.6625555", "0.6625555", "0.66246885", ...
0.6405008
38
reload a module, either larch or python
def _reload(mod,larch=None,**kw): if isinstance(mod, str): return larch.import_module(mod, do_reload=True) for k,v in chain(larch.symtable._sys.modules.iteritems(), sys.modules.iteritems()): if v == mod: modname = k break try: return larch.import_module(modn...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def reload_module(module_name):\n try:\n reload(eval(module_name))\n except:\n pass", "def reloadModule(module):\n\ttry:\n\t\treload # Python 2.7\n\texcept NameError:\n\t\ttry:\n\t\t\tfrom importlib import reload # Python 3.4+\n\t\texcept ImportError:\n\t\t\tfrom imp import reload # Python...
[ "0.80148953", "0.7742815", "0.7427528", "0.73654693", "0.7348668", "0.7205982", "0.7027763", "0.6984617", "0.69592416", "0.69405115", "0.6676888", "0.6640121", "0.6631857", "0.65679514", "0.655727", "0.6529555", "0.647623", "0.64265627", "0.639218", "0.6344517", "0.63303524",...
0.8660127
0
show lines of text in the style of more
def show_more(text,filename=None,writer=None,pagelength=30,prefix=''): # pragma: no cover pager(text)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def abbrev_help_more_text(self):\n pass", "def generate_excerpt():", "def echo(self):\n new_paragraph = True\n for line in self.msg.splitlines():\n if not line.strip():\n new_paragraph = True\n click.echo()\n elif new_paragraph:\n ...
[ "0.6258086", "0.61826456", "0.6127772", "0.5877098", "0.5868962", "0.5836664", "0.5801012", "0.57793504", "0.5729908", "0.57035375", "0.5700666", "0.5665235", "0.56474644", "0.56377524", "0.5631425", "0.56087565", "0.5605236", "0.5601699", "0.55921155", "0.55473125", "0.55454...
0.6663092
0
class that maintains all data related to the regulatory on the FContact
def __init__(self, contact = None): try: self.__contact = contact if not self.__contact: FRegulatoryLogger.ERROR(logger, "The name on the contact is the unique identifier of the contact. Kindly provide a valid acm.FContact object") return None ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def RegulatoryInfo(self):\n conactRegInfo = FContactRegulatoryInfo(self)\n return conactRegInfo", "def Attributes(self):\n return FRegulatoryUtils.log_attributes('FContactRegulatoryInfo', self)", "def __init__(self):\n\n\t\tself.__contacts = None\n\t\tself.__accounts = None\n\t\tself.__deals = Non...
[ "0.7621419", "0.6440766", "0.6052107", "0.58735913", "0.58644634", "0.56104106", "0.55951077", "0.55670434", "0.5546189", "0.5410019", "0.53739226", "0.5360233", "0.53541", "0.53510576", "0.52669334", "0.5263579", "0.5242533", "0.52414125", "0.521908", "0.5218182", "0.5214554...
0.6573449
1
returns the contact for which this wrapper has all the addinfo/column values
def Contact(self): return self.__contact
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def contact_info(self):\n return self._contact_info", "def contact(self):\n return self._contact", "def contact(self):\n return self._contact", "def get_contacts(self):\n\n\t\treturn self.__contacts", "def get_contacts(self):\n contacts = Membership.objects.filter(entity = self,...
[ "0.69202983", "0.65962774", "0.65962774", "0.63626295", "0.6341426", "0.6326005", "0.6319983", "0.60924613", "0.60568964", "0.60556304", "0.60275143", "0.5960803", "0.59009695", "0.58950126", "0.5835306", "0.5797833", "0.571309", "0.57005405", "0.5682633", "0.5680372", "0.567...
0.64397454
3
Date of birth of the concerned natural person
def DateOfBirth(self, reg_date_of_birth = VALUE_NOT_SET): ael_reg_dob = None if reg_date_of_birth != VALUE_NOT_SET: try: ael_reg_dob = ael.date_from_string(reg_date_of_birth) except: if reg_date_of_birth not in ['', None]: msg =...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def date_of_birth(self):\n return self.__date_of_birth", "def date_of_birth(self) -> str:\n return self._date_of_birth.strftime('%Y-%m-%d')", "def birth_date(self) -> str:\n return self._birth_date", "def birthdate_date(self):\n\n bday = self.birthdate\n if bday:\n ...
[ "0.8200823", "0.8171922", "0.8120067", "0.7951198", "0.79246074", "0.765754", "0.7473447", "0.745579", "0.7108592", "0.70574725", "0.6949984", "0.6891937", "0.68498445", "0.68213457", "0.6803174", "0.6754443", "0.6736698", "0.6733992", "0.6618441", "0.656881", "0.6553082", ...
0.71364975
8
First name of the concerned natural person
def FirstName(self, reg_first_name = VALUE_NOT_SET): if reg_first_name != VALUE_NOT_SET: self.__reg_first_name = reg_first_name try: self.__contact.AdditionalInfo().FirstName(self.__reg_first_name) except: pass else: if not ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_first_name(self) -> str:\n return self.first_name", "def first_name(self) -> str:\n return self._first_name", "def pref_first_name(self):\n return self.known_as if self.known_as else self.first_name", "def get_first_name(self):\n return self._first_name", "def first_name...
[ "0.7882423", "0.7805149", "0.77341115", "0.7712801", "0.7661111", "0.7661111", "0.7661111", "0.76325965", "0.7625189", "0.7625189", "0.7606487", "0.75807947", "0.75807947", "0.7543393", "0.75275517", "0.7521005", "0.7509602", "0.7509602", "0.7509602", "0.7509602", "0.7509602"...
0.711053
59
Last name of the concerned natural person
def LastName(self, reg_last_name = VALUE_NOT_SET): if reg_last_name != VALUE_NOT_SET: self.__reg_last_name = reg_last_name try: self.__contact.AdditionalInfo().LastName(self.__reg_last_name) except: pass else: if not self.__...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def last_name():\r\n\r\n return surnames()", "def get_last_name(self) -> str:\n return self.last_name", "def getLastname(self):\n return self.lastname", "def get_last_name(people, individual):\n surname = people[individual]['NAME'].split()\n return surname[1]", "def lastname(self):\n...
[ "0.8193164", "0.80822515", "0.80346006", "0.7993029", "0.79857093", "0.79683965", "0.79683965", "0.79683965", "0.79683965", "0.79683965", "0.79646444", "0.79491335", "0.79422885", "0.79334354", "0.79334354", "0.79180735", "0.79180735", "0.79180735", "0.79180735", "0.7912743", ...
0.76919675
21
NationalId of the concerned natural person
def NationalId(self, reg_national_id = VALUE_NOT_SET): if reg_national_id != VALUE_NOT_SET: self.__reg_national_id = reg_national_id try: self.__contact.AdditionalInfo().NationalId(self.__reg_national_id) except: pass else: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_NID():\n return NID", "def government_id_number(self) -> str:\n return self._government_id_number", "def get_person_id(person_data):\n person_ref = person_data['Casualty_Reference']\n veh_ref = person_data['Vehicle_Reference']\n acc_id = get_acc_id_from_data(person_data)\n person_...
[ "0.6752156", "0.64024127", "0.6256402", "0.6193446", "0.61844784", "0.6149932", "0.6149932", "0.61367977", "0.6133966", "0.6050021", "0.6030649", "0.6021784", "0.6012439", "0.59253937", "0.59218484", "0.58435404", "0.58401144", "0.5793599", "0.57825446", "0.57644486", "0.5758...
0.73979646
0
CrmId of the concerned natural person
def CrmId(self, crm_id = VALUE_NOT_SET): if crm_id != VALUE_NOT_SET: self.__reg_crm_id = crm_id try: self.__contact.AdditionalInfo().RegContactCrmId(self.__reg_crm_id) except: pass else: if not self.__reg_crm_id: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_person_id(person_data):\n person_ref = person_data['Casualty_Reference']\n veh_ref = person_data['Vehicle_Reference']\n acc_id = get_acc_id_from_data(person_data)\n person_id = common.get_gb_person_id(acc_id, int(veh_ref), int(person_ref))\n return person_id", "def get_orcid_id(self):\n ...
[ "0.6603497", "0.6412004", "0.6359146", "0.62600315", "0.6250896", "0.61515063", "0.614126", "0.61211526", "0.60835594", "0.6075564", "0.6075564", "0.60001755", "0.5949616", "0.5896278", "0.5895303", "0.58926725", "0.58770686", "0.58716244", "0.5861452", "0.5861452", "0.586145...
0.61229914
7
The identifier used towards/by an exchange to identify a person or legal entity, before the actual national id or the LEI is divulged.
def ExchangeId(self, exchange_id = VALUE_NOT_SET): if exchange_id != VALUE_NOT_SET: if str(exchange_id).isdigit(): self.__reg_exchange_id = int(exchange_id) elif str(exchange_id) in ['None', '']: self.__reg_exchange_id = None else: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_ident():\n return -1", "def party_id(self):\n pass", "def getIdent (self) :\n return self.id", "def get_identifier(self):", "def government_id_number(self) -> str:\n return self._government_id_number", "def identifier(self):\n return str(self._nfcid)", "de...
[ "0.6787299", "0.6757533", "0.65951097", "0.6572598", "0.6549644", "0.6535619", "0.6466146", "0.63963974", "0.6385991", "0.6370726", "0.6351748", "0.6342159", "0.63358164", "0.63045776", "0.62974083", "0.6294242", "0.62912565", "0.6278431", "0.627394", "0.62542075", "0.6243608...
0.0
-1
An optional unique name, if specified there can only be one contact with this name for each party.
def UniqueName(self, unique_name = VALUE_NOT_SET): if unique_name != VALUE_NOT_SET: try: if FIntegrationUtils.FIntegrationUtils.get_acm_version_override() >= 2017.2: self.__contact.UniqueName(unique_name) else: is_unique, contac...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def contact_name(self) -> str:\n return pulumi.get(self, \"contact_name\")", "def party_id(self):\n pass", "def create_contact(contact, party_type, party):\n\tcontact = contact\t.split(\" \")\n\n\tcontact = frappe.get_doc({\n\t\t\"doctype\":\"Contact\",\n\t\t\"first_name\":contact[0],\n\t\t\"last...
[ "0.58776766", "0.5617005", "0.56108975", "0.5571864", "0.556685", "0.556685", "0.5513689", "0.5500145", "0.5463818", "0.536946", "0.5348271", "0.53382397", "0.53270036", "0.5291315", "0.52906907", "0.5287689", "0.52846396", "0.52846396", "0.52688885", "0.52560043", "0.5240531...
0.70607924
0
returns the ClientType based on where the CrmId is found on the linked objects
def ClientType(self): self.__client_type = FRegulatoryUtils.getClientType(self.__contact) return self.__client_type
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def client_type(self) -> Optional[str]:\n return pulumi.get(self, \"client_type\")", "def type(self):\n return _internals.CorrelationId_type(self)", "def find_type(source, target):\n x = [r for r in source.synset_relations if r.target == target.id]\n if len(x) != 1:\n raise Exception...
[ "0.5487231", "0.5164598", "0.51574206", "0.51353335", "0.5011951", "0.49763677", "0.49734464", "0.49716905", "0.49659985", "0.49616665", "0.49428558", "0.49414885", "0.4923532", "0.49094817", "0.48822343", "0.48643944", "0.48532623", "0.48462522", "0.48260435", "0.48219457", ...
0.5837794
0
Another trader that jointly owns the account with this trader
def JointAccount(self): joint_accounts = [] if self.IsGeneralPartner(): for contact in self.__contact.Party().Contacts(): if contact.AdditionalInfo().RegGeneralPartner(): joint_accounts.append(contact) else: F...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def tribe(self, instance):\r\n return instance.user.profile.tribe", "def transaction_to_player(self, origin, amount, receiver):\r\n print(\"Transfering\", amount, origin, \"->\", receiver)\r\n try:\r\n origin.transfer(-amount)\r\n except:\r\n # the origin will be...
[ "0.5814136", "0.5709977", "0.56947994", "0.5616658", "0.5561894", "0.5512911", "0.5500826", "0.5494856", "0.540658", "0.53586686", "0.53467846", "0.53300697", "0.5320134", "0.53097206", "0.5293968", "0.5249603", "0.5240867", "0.5225998", "0.52059394", "0.5183462", "0.5179566"...
0.0
-1
General partner has responsibility for the actions of the business, can legally bind the business and is personally liable for all the business's debts and obligations.
def IsGeneralPartner(self, is_general_partner = VALUE_NOT_SET): if is_general_partner != VALUE_NOT_SET: self.__is_general_partner = FRegulatoryUtils.get_bool(is_general_partner, 'IsGeneralPartner') FRegulatoryLogger.DEBUG(logger, "The IsGeneralPartner is being set to <%s>."%(str(self.__i...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def make_eligible(self):\n pass", "def test_create_warranty(self):\n pass", "def safeWithdrawal(self):\n if self._after_dead_line():\n # each contributor can withdraw the amount they contributed if the goal was not reached\n if not self._funding_goal_reached.get():\n ...
[ "0.62831205", "0.6199623", "0.5960634", "0.5711672", "0.5653453", "0.56343335", "0.5625102", "0.5595211", "0.5571533", "0.55410933", "0.5500753", "0.54941815", "0.5458377", "0.5449559", "0.5422104", "0.54058695", "0.5389889", "0.53809947", "0.53775984", "0.5377101", "0.534418...
0.0
-1
Committing this instance will automatically commit all the RegulatorySupport related attributes on the contact
def Commit(self): try: acm.BeginTransaction() self.__contact.Commit() if FIntegrationUtils.FIntegrationUtils.get_acm_version_override() < 2015.4: self.__integration_utils.set_additional_info('DateOfBirth', self.__contact, self.__reg_date_of_birth) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def commit(self):\n self.cnx.commit()", "def commit(self):\n pass", "def commit(self):\n pass", "def commit(self):\n pass", "def commit(self):\n pass", "def commit(self):\n pass", "def commit(self):\n return", "def commitChanges(self):\n \n ...
[ "0.6179308", "0.6118413", "0.6118413", "0.6118413", "0.6118413", "0.6118413", "0.60592747", "0.6013804", "0.59319466", "0.5926993", "0.5916751", "0.5899212", "0.58974123", "0.5881195", "0.5875204", "0.5863884", "0.58605444", "0.5854823", "0.5801967", "0.5795815", "0.57171786"...
0.79224825
0
Deleting this instance automatically deletes all the attributes related to the reporting on the instrument or on the ContactRegulatoryInfo in the ADS
def Delete(self): FRegulatoryUtils.Delete(self.__contact, "Contact") FRegulatoryLogger.DEBUG(logger, "Deleted all AdditionalInfos on Contact related to Regulatory Reporting")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def cleanup_aai(cls):\n logger.info(\"####################### Start to clean up AAI settings\")\n aai = Customer.get_by_global_customer_id(\"5GCustomer\")\n aai.delete()", "def delete(self):\n self._instance.delete()\n self._instance = None\n self._data_defs = []", "de...
[ "0.6274676", "0.6151817", "0.60736465", "0.58964264", "0.58367074", "0.58200717", "0.58007216", "0.5781004", "0.57804185", "0.5743467", "0.5707958", "0.56463885", "0.56211966", "0.56100756", "0.5555345", "0.5555345", "0.5555345", "0.5555345", "0.55472887", "0.55391157", "0.55...
0.74394304
0
returns the attributes on the FContactRegulatoryInfoBase instance
def Attributes(self): return FRegulatoryUtils.log_attributes('FContactRegulatoryInfo', self)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def RegulatoryInfo(self):\n conactRegInfo = FContactRegulatoryInfo(self)\n return conactRegInfo", "def getAttributes(self):\n pass", "def get_attributes(self):\n return self.attributes", "def get_attributes(cls):\r\n return []", "def get_attributes(self):\n _attributes = {...
[ "0.76906836", "0.7054827", "0.67832905", "0.67631334", "0.6749298", "0.67152345", "0.66815585", "0.6680654", "0.6680654", "0.66506875", "0.66434884", "0.6618119", "0.65413237", "0.6490594", "0.64605737", "0.64063853", "0.6323494", "0.6309063", "0.63062006", "0.62716734", "0.6...
0.85865146
0
returns the FContactRegulatoryInfoBase instance for the given contact
def RegulatoryInfo(self): conactRegInfo = FContactRegulatoryInfo(self) return conactRegInfo
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self, contact = None):\n try:\n self.__contact = contact\n if not self.__contact:\n FRegulatoryLogger.ERROR(logger, \"The name on the contact is the unique identifier of the contact. Kindly provide a valid acm.FContact object\")\n return None\...
[ "0.71412814", "0.62537146", "0.58082145", "0.5799355", "0.55888337", "0.5545059", "0.55302864", "0.55302864", "0.54784495", "0.54784495", "0.54784495", "0.53763604", "0.532584", "0.5272704", "0.52715975", "0.52623534", "0.5120345", "0.51012933", "0.50584227", "0.50581264", "0...
0.76837945
0
Return a collection of FContactRegulatoryInfoBase instances matching constraint specified in the Select query
def Select(query): party = None if query.find('and party') != -1:#it means there is an additional condition added pos = query.find('and party') party_name = query[(pos + len('and party')):] query = query[0:pos] party_name = party_name.replace('=', '').replace("'", '') p...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def RegulatoryInfo(self):\n conactRegInfo = FContactRegulatoryInfo(self)\n return conactRegInfo", "def get_contacts(self):\n contacts = Membership.objects.filter(entity = self, key_contact = True).order_by('importance_to_entity')\n return contacts", "def Attributes(self):\n return FR...
[ "0.6478444", "0.54798746", "0.51769966", "0.50363517", "0.50300074", "0.50044805", "0.50035316", "0.50017864", "0.4927733", "0.49109888", "0.49109024", "0.4889764", "0.48388788", "0.47877604", "0.47697586", "0.4741461", "0.47025535", "0.4675752", "0.46756333", "0.46720454", "...
0.5390563
2
Set up and parse commandline arguments.
def parse_args(): parser = argparse.ArgumentParser(description=__doc__) return parser.parse_args()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def parse_arguments(args):", "def main():\n args = parse_args()\n process_args(args)", "def setUp(self):\n self.parser = command_line.get_args()", "def setup_args(cls, parser):\n pass", "def _setup_arguments(self):\n\n self._parser.add_argument(\"-a\", \"--area-interest\",\n ...
[ "0.74570394", "0.742756", "0.7389333", "0.73735505", "0.72907114", "0.7161568", "0.7140092", "0.7121027", "0.71085113", "0.710657", "0.7088012", "0.7032618", "0.7017465", "0.70092034", "0.70074636", "0.699794", "0.69776225", "0.69776225", "0.69619316", "0.6938218", "0.6922756...
0.0
-1
Main function... makes 'forward declarations' of helper functions unnecessary
def main(): # Constants groundstation_name = 'Wallops Antenna' groundstation_address = 'Radar Road, Temperanceville, VA 23442' satnum = 25544 # ISS = 25544 saturl="http://www.celestrak.com/NORAD/elements/stations.txt" gs_minimum_elevation_angle = 10.0 # Alternate constants gs_alt_lat =...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def main():\n pass", "def main() -> None:", "def main() -> None:", "def main() -> None:", "def main() -> None:", "def main():\n pass", "def main():\n pass", "def main():\n pass", "def main():\n pass", "def main():\n pass", "def main():\n pass", "def main():\n pass"...
[ "0.6937029", "0.6773711", "0.6773711", "0.6773711", "0.6773711", "0.6758369", "0.6758369", "0.6758369", "0.6758369", "0.6758369", "0.6758369", "0.6758369", "0.6758369", "0.6758369", "0.6758369", "0.6758369", "0.6758369", "0.6758369", "0.6758369", "0.6758369", "0.6758369", "...
0.0
-1
Function to print a header with satellite info for the satellite number
def print_satellite_header(st): # Retrieve TLE data print "Satellite Number/Launch Year/Launch Number of Year: %s/20%s/%s" % \ (st.get_satellite_number(), st.get_launch_year(), \ st.get_launch_year_number()) year = 2000 + int(st.get_epoch_year()) fracyear = timedelta(float(st.get_ep...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def print_header():\n print(\"STEM Center Temperature Project\")\n print(\"Shaotong Wen\")", "def print_header_information():\n\t\tprint \"Elijah Molloy\"\n\t\tprint \"70-510 - Spring 1 - 2018\"\n\t\tprint \"PROGRAMMING ASSIGNMENT #4\\n\"", "def print_the_header():\n print('-------------------')\n ...
[ "0.73586893", "0.71547425", "0.6722391", "0.64073485", "0.6397794", "0.6378043", "0.63605297", "0.6274469", "0.6251121", "0.6184243", "0.616818", "0.6158332", "0.61397535", "0.61184627", "0.6110125", "0.6110125", "0.6106982", "0.60947645", "0.60926664", "0.608937", "0.6087103...
0.8453364
0
Function to print a header for the inview info
def print_inview_header(minimum_elevation_angle, now, gs): print "Inviews (above %s degrees) on %s-%s-%s" % \ (minimum_elevation_angle, now.year, now.month, now.day) print "At %s: Lat/Lon/El: %s/%s/%s" % \ (gs.get_name(), gs.get_latitude(), gs.get_longitude(), gs.get_elevation_in...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def show_header():\n return {};", "def Show_Headers( self ):\r\n self.system.Change_Seq( \"Header\" )", "def print_header_information():\n\t\tprint \"Elijah Molloy\"\n\t\tprint \"70-510 - Spring 1 - 2018\"\n\t\tprint \"PROGRAMMING ASSIGNMENT #4\\n\"", "def print_the_header():\n print('----------...
[ "0.7747214", "0.763318", "0.761402", "0.74126256", "0.73512864", "0.7330032", "0.73006797", "0.7244701", "0.72426593", "0.7112192", "0.70161813", "0.701025", "0.6995395", "0.6979925", "0.69683486", "0.6944731", "0.6939936", "0.6909849", "0.6899858", "0.68321836", "0.6813634",...
0.7582373
3
Function to print the inviews
def print_inviews(gs, inviews): #print "Number of inviews from %s to %s: %d" % \ # (today_start.isoformat(), today_end.isoformat(),len(inviews)) for i in range(0, len(inviews)): #print "%s to %s" % (inviews[i][0].isoformat(), inviews[i][1].isoformat()) print_inview(inviews[i][0], invi...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def print_details(self):\n self.view.print_details()", "def print(self):\r\n self.print_avec_separateur()", "def print_out():\n pass", "def _print_inwards(middleware_name):\n if _VERBOSE_MODE:\n print('{}--->'.format(middleware_name))", "def pprint(self):\n # just here...
[ "0.67796624", "0.6479328", "0.6461996", "0.6318401", "0.63149685", "0.61923224", "0.61706716", "0.61218095", "0.6109504", "0.6102467", "0.6101652", "0.6087358", "0.60798454", "0.6077613", "0.60708314", "0.6038918", "0.60107464", "0.6009129", "0.5995637", "0.59919393", "0.5979...
0.75969446
0
Function to print a table of time, azimuth, elevation for each inview
def print_azeltables(inviews, ic): for i in range(0, len(inviews)): print " " print "Az/El for inview %s to %s" % (inviews[i][0], inviews[i][1]) azels = ic.compute_azels(inviews[i][0], inviews[i][1], 15) for j in range(0, len(azels)): print "At %s, azimuth=%8.2f, elevatio...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def print_inview_header(minimum_elevation_angle, now, gs):\n print \"Inviews (above %s degrees) on %s-%s-%s\" % \\\n (minimum_elevation_angle, now.year, now.month, now.day)\n print \"At %s: Lat/Lon/El: %s/%s/%s\" % \\\n (gs.get_name(), gs.get_latitude(), gs.get_longitude(),\n gs....
[ "0.7208172", "0.67271405", "0.6130861", "0.61259687", "0.59162146", "0.5775518", "0.57627594", "0.5703854", "0.56089044", "0.5606912", "0.56049377", "0.5569098", "0.5553486", "0.5533526", "0.54851115", "0.5451577", "0.54403365", "0.5424925", "0.54075736", "0.5402264", "0.5393...
0.7502286
0
Function to print a single inview
def print_inview(rise, set, gs): riselocal = rise + gs.get_utcoffset_ondate(rise.year, rise.month, rise.day) setlocal = set + gs.get_utcoffset_ondate(set.year, set.month, set.day) delta = set - rise print "%2d:%02d:%02d to %2d:%02d:%02d (%3d seconds) %2d:%02d:%02d to %2d:%02d:%02d" % \ (ri...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def print_inviews(gs, inviews):\n #print \"Number of inviews from %s to %s: %d\" % \\\n # (today_start.isoformat(), today_end.isoformat(),len(inviews))\n\n for i in range(0, len(inviews)):\n #print \"%s to %s\" % (inviews[i][0].isoformat(), inviews[i][1].isoformat())\n print_inview(inv...
[ "0.6761885", "0.64787924", "0.6355465", "0.6279782", "0.6215807", "0.61902606", "0.61406785", "0.61145645", "0.61145645", "0.61145645", "0.61145645", "0.59689873", "0.5934436", "0.59211826", "0.5917059", "0.59007823", "0.58670545", "0.5810057", "0.5791739", "0.5789504", "0.57...
0.5826345
17
We list all notebooks here, even those that are not
def _tested_notebooks(): all_notebooks = _list_all_notebooks() skipped_notebooks = functools.reduce( lambda a, b: a.union(b), list(set(glob.glob(g, recursive=True)) for g in SKIP_NOTEBOOKS), ) return sorted( os.path.abspath(n) for n in all_notebooks.difference(skipped_notebooks...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def list_notebooks(command):\n namespace = app.main(command)\n assert namespace.command == 'l' or namespace.command == \"list\"", "def listNotebooks(self, authenticationToken):\r\n pass", "def listLinkedNotebooks(self, authenticationToken):\r\n pass", "def GetNotebooks(self):\r\n\r\n if se...
[ "0.72980744", "0.7263471", "0.6903213", "0.6728304", "0.6664313", "0.65559214", "0.6496395", "0.64076346", "0.6331407", "0.6271838", "0.6045749", "0.5983143", "0.5825484", "0.5712624", "0.5645208", "0.56238604", "0.5619144", "0.55256057", "0.5506115", "0.547778", "0.5438583",...
0.68560046
3
Returns a pretty much unique 32bit hash for pretty much any python object.
def hashIt(*args): total = int(0) for x in args: if isinstance(x, dict): for k, key in enumerate(sorted(x.keys())): total += hashIt(k, key, x[key]) elif isinstance(x, (list, tuple)): for k, value in enumerate(x): total += hashIt(k, value) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def hash(obj):\n \n import hashlib\n import pickle\n \n sha = hashlib.sha256()\n sha.update(pickle.dumps(obj))\n \n return sha.hexdigest()", "def hashkey(obj, salt=0):\n if isinstance(obj, str):\n return zlib.adler32(obj.encode(), salt) & 0xffffffff\n elif isinstance(obj, byt...
[ "0.7476817", "0.73924834", "0.71622837", "0.7141496", "0.71407014", "0.7067109", "0.70340466", "0.70264083", "0.7020463", "0.69946253", "0.69786173", "0.6912701", "0.6904169", "0.6882359", "0.68673223", "0.6846751", "0.68304324", "0.6830188", "0.6830188", "0.68252647", "0.681...
0.0
-1
Use as a decorator to print info about the function and its result. Follows deferred results.
def showResult(f): def substitute(self, *args, **kw): def msg(result, callInfo): resultInfo = str(result) if len(callInfo) + len(resultInfo) > 70: callInfo += "\n" print("\n{} -> {}".format(callInfo, resultInfo)) return result SR_STUFF...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def print_result(func):\n def new_func(*args, **kwargs):\n result = func(*args, **kwargs)\n print(result)\n return result\n return new_func", "def print_log(func):\n @wraps(func)\n def wrapper(*args, **kwargs):\n n = func.__name__\n print('{} has started with argume...
[ "0.7564186", "0.69486636", "0.68396944", "0.67687505", "0.6661167", "0.6646779", "0.6636007", "0.6607297", "0.65720874", "0.6512646", "0.6510811", "0.65025723", "0.64824915", "0.6458015", "0.6400681", "0.639704", "0.63808566", "0.6372295", "0.6261466", "0.62549406", "0.622034...
0.78961205
0
Use as a decorator (after showResult) to include the current thread in the info about the function.
def whichThread(f): SR_STUFF[2] = True return f
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def showResult(f):\n def substitute(self, *args, **kw):\n def msg(result, callInfo):\n resultInfo = str(result)\n if len(callInfo) + len(resultInfo) > 70:\n callInfo += \"\\n\"\n print(\"\\n{} -> {}\".format(callInfo, resultInfo))\n return result...
[ "0.67912334", "0.6404033", "0.6282374", "0.6252713", "0.616354", "0.61556727", "0.6084007", "0.6083681", "0.60718924", "0.6068543", "0.60177517", "0.6006008", "0.5985451", "0.59275067", "0.59253156", "0.5914145", "0.58757865", "0.5848576", "0.5832424", "0.5822284", "0.5812835...
0.5666411
31
Returns the fully qualified name of the supplied string if it can be imported and then reflected back into the FQN, or C{None} if not.
def strToFQN(self, x): try: obj = reflect.namedObject(x) fqn = reflect.fullyQualifiedName(obj) except: return return fqn
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def try_import(import_str, default=None):\r\n try:\r\n return import_module(import_str)\r\n except ImportError:\r\n return default", "def get_qualified_class_name(o):\n module = o.__class__.__module__\n module = '' if module in IGNORABLE_MODULES else module\n module = module + '.' if...
[ "0.6144014", "0.6059056", "0.60289675", "0.6027369", "0.5973197", "0.5959286", "0.5954686", "0.58813894", "0.5866241", "0.5862896", "0.58329266", "0.58159465", "0.58044475", "0.5801065", "0.57967067", "0.5795597", "0.5794225", "0.57900107", "0.5770697", "0.57595575", "0.57583...
0.610944
1
Returns a string of the pickled object or C{None} if it couldn't be pickled and unpickled back again.
def objToPickle(self, x): try: xp = pickle.dumps(x) pickle.loads(xp) except: return return xp
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def serialize(obj):\n serial = repr(obj)\n try:\n if eval(serial) == obj:\n return serial\n except:\n pass\n try:\n serial = pickle.dumps(obj)\n return 'pickle.loads(%s)' % repr(serial)\n except:\n raise Exception #unable to serialize", "def try_pickle...
[ "0.70065063", "0.6877049", "0.68509924", "0.66886413", "0.6565445", "0.64063543", "0.6293955", "0.62600654", "0.62112856", "0.61454225", "0.6095842", "0.6067861", "0.60203993", "0.60195476", "0.5951163", "0.59425896", "0.5937268", "0.59203345", "0.58836335", "0.5877021", "0.5...
0.5900885
18
Returns the fully qualified name of the supplied object if it can be reflected into an FQN and back again, or C{None} if not.
def objToFQN(self, x): try: fqn = reflect.fullyQualifiedName(x) reflect.namedObject(fqn) except: return return fqn
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def full_object_name(obj):\n\n try:\n module = obj.__module__\n if module is None or module == str.__class__.__module__:\n return obj.__name__ # Avoid reporting __builtin__\n else:\n return module + '.' + obj.__name__\n except Exception:\n return None", "d...
[ "0.720825", "0.68506885", "0.68197757", "0.6692258", "0.669201", "0.66850084", "0.6678043", "0.6637933", "0.655427", "0.6363912", "0.6304597", "0.62705034", "0.6256707", "0.6187803", "0.6154", "0.6152605", "0.612782", "0.6108689", "0.603036", "0.60212445", "0.60132855", "0....
0.6943579
1
Attempts to convert the supplied object to a pickle and, failing that, to a fully qualified name.
def processObject(self, x): pickled = self.objToPickle(x) if pickled: return pickled return self.objToFQN(x)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def try_pickle_dumps(obj):\n try:\n return cloudpickle.dumps(obj)\n except Exception:\n pass\n\n try:\n return pickle.dumps(obj)\n except Exception:\n raise", "def pickle_object(obj, ofname: \"Path|str\"):\n ofname = Path(ofname)\n maybe_make_output_dir(ofname)\n ...
[ "0.7063126", "0.64876986", "0.60792595", "0.5974439", "0.58921015", "0.58882225", "0.58367944", "0.57654095", "0.5750935", "0.57494664", "0.5721882", "0.56769556", "0.5674027", "0.5642555", "0.56334174", "0.5625167", "0.5624294", "0.560091", "0.560091", "0.5558587", "0.555558...
0.6659083
1
Sets my current fargskw tuple, returning a reference to myself to allow easy method chaining. The function I{f} must be an actual callable object if you want to use L{nn}. Otherwise it can also be a string depicting a callable. You can specify I{args} with a second argument (as a list or tuple), and I{kw} with a third ...
def setCall(self, *metaArgs, **kw): if metaArgs: equiv = True if self.lastMetaArgs is None: equiv = False elif len(metaArgs) != len(self.lastMetaArgs): equiv = False else: for k, arg in enumerate(metaArgs): ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self, func, *args, **kwargs):\n self._func = func\n self._args = args\n self._kwargs = kwargs\n self._fully_bound = None", "def set_func_args(self, *args, **kwargs):\n self._func_args = args \n self._func_kw_args = kwargs", "def call(f):\n def g(*args, **kwds):\n ...
[ "0.5703724", "0.56538165", "0.55401057", "0.5524479", "0.54307365", "0.5427452", "0.54265815", "0.5302647", "0.52991205", "0.5291197", "0.5282004", "0.5254453", "0.5248723", "0.523779", "0.52307767", "0.52307767", "0.52307767", "0.52307767", "0.52307767", "0.52307767", "0.523...
0.6287769
0
Returns a unique ID for my current callable.
def ID(self): if hasattr(self, 'currentID'): return self.currentID if hasattr(self, 'callDict'): thisID = hashIt(self.callDict) if hasattr(self, 'pastInfo'): self.pastInfo[thisID] = {'callDict': self.callDict} else: thisID = None ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_id(self): # real signature unknown; restored from __doc__\n return \"\"", "def _get_unique_id(self):\n now = datetime.now()\n\n u_id = now.second + 60*(now.minute + 60*(now.hour + 24*(now.day + 31*(now.month + 366*(now.year)))))\n return \"instance\" + str(u_id)", "def gener...
[ "0.7378038", "0.70565146", "0.7052797", "0.69692785", "0.6922952", "0.685859", "0.68508834", "0.6849531", "0.6843613", "0.68147796", "0.68109673", "0.68109673", "0.68109673", "0.68109673", "0.6809885", "0.67909235", "0.67909235", "0.67909235", "0.67909235", "0.67909235", "0.6...
0.7128812
1
Use this whenever info won't be needed anymore for the specified call ID, to avoid memory leaks.
def forgetID(self, ID): if ID in getattr(self, 'pastInfo', {}): del self.pastInfo[ID]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _validate_call_id(self, call_id):\n\n self._validate_required_data(call_id, self.CALL_ID)\n\n query = CallRecord.objects.filter(call_id=call_id)\n\n if query.exists():\n raise NotAcceptable(\n detail='Call id is already in use. Please, choose another')", "def _s...
[ "0.5423897", "0.53597885", "0.5170545", "0.51276785", "0.5111587", "0.5107926", "0.50829285", "0.5059674", "0.50555295", "0.49963364", "0.49642846", "0.495139", "0.4910475", "0.48489508", "0.47891104", "0.4779412", "0.47645634", "0.47535005", "0.47411475", "0.4731908", "0.469...
0.59721094
0
Context manager for setting and getting call info. Call this context manager method with info about a particular call (same format as L{setCall} uses) and it yields an L{InfoHolder} object keyed to that call. It lets you get info about the call inside the context, without worrying about the ID or calling L{forgetID}, e...
def context(self, *metaArgs, **kw): if not hasattr(self, 'pastInfo'): raise Exception( "Can't use a context manager without saving call info") ID = self.setCall(*metaArgs, **kw).ID yield InfoHolder(self, ID) self.forgetID(ID)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def aboutCall(self, ID=None, nowForget=False):\n if ID:\n pastInfo = self.getInfo(ID, 'aboutCall', nowForget)\n if pastInfo:\n return pastInfo\n callDict = self.getInfo(ID, 'callDict')\n if not callDict:\n return \"\"\n func, args, kw = [c...
[ "0.6116589", "0.5598187", "0.55867136", "0.5528214", "0.53109026", "0.5237054", "0.51175916", "0.51127905", "0.50732195", "0.5064161", "0.5057853", "0.50216436", "0.50200754", "0.5004932", "0.50042874", "0.49915943", "0.4979725", "0.49719357", "0.49228385", "0.4916614", "0.49...
0.7960227
0
Provides info about a call. If the supplied name is 'callDict', returns the fargskwinstance dict for my current callable. The value of I{ID} is ignored in such case. Otherwise, returns the named information attribute for the previous call identified with the supplied ID.
def getInfo(self, ID, name, nowForget=False): def getCallDict(): if hasattr(self, 'callDict'): result = self.callDict if nowForget: del self.callDict else: result = None return result if hasa...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def aboutCall(self, ID=None, nowForget=False):\n if ID:\n pastInfo = self.getInfo(ID, 'aboutCall', nowForget)\n if pastInfo:\n return pastInfo\n callDict = self.getInfo(ID, 'callDict')\n if not callDict:\n return \"\"\n func, args, kw = [c...
[ "0.6510412", "0.5486511", "0.5346446", "0.52030444", "0.5146749", "0.5081739", "0.5034171", "0.50240844", "0.50165373", "0.4871073", "0.48639536", "0.48548323", "0.4849726", "0.48485854", "0.48369116", "0.48026302", "0.47847903", "0.4784088", "0.4783681", "0.47752234", "0.476...
0.6836767
0
Namespacename parser. For my current callable or a previous one identified by I{ID}, returns a 2tuple suitable for sending to a process worker via C{pickle}.
def nn(self, ID=None, raw=False): if ID: pastInfo = self.getInfo(ID, 'wireVersion') if pastInfo: return pastInfo result = None, None callDict = self.getInfo(ID, 'callDict') if not callDict: # No callable set return result ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _name(self):\n return self.arguments[0].split('(')[0]", "def _name(self):\n return self._arguments[0].split('(')[0]", "def _get_name(name):\n if \"::\" in name:\n return name.split(\"::\")[1]\n return name", "def _get_name(name):\n if \"::\" in name:\n ...
[ "0.6336964", "0.62239903", "0.59742975", "0.59742975", "0.5957465", "0.5944445", "0.5893739", "0.5789447", "0.57749027", "0.5652084", "0.561324", "0.56079495", "0.55954885", "0.5570692", "0.55608606", "0.55608606", "0.55608606", "0.55608606", "0.55608606", "0.55608606", "0.55...
0.0
-1
Returns an informative string describing my current function call or a previous one identified by ID.
def aboutCall(self, ID=None, nowForget=False): if ID: pastInfo = self.getInfo(ID, 'aboutCall', nowForget) if pastInfo: return pastInfo callDict = self.getInfo(ID, 'callDict') if not callDict: return "" func, args, kw = [callDict[x] for ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _function_name(func):\n return \"Calling the function: def {}()\".format(func.__name__)", "def get_call_string(self) -> Optional[str]: # noqa\n call_repr = get_call_string(self.func_name, self.args, self.kwargs, max_length=75)\n return call_repr", "def __repr__(self):\n\t\treturn self.fun...
[ "0.6560909", "0.6306112", "0.6107266", "0.6059423", "0.6059423", "0.6059423", "0.6059423", "0.6059423", "0.6059423", "0.6059423", "0.6059423", "0.6041999", "0.6041999", "0.6041999", "0.6029351", "0.6029351", "0.6029351", "0.6029351", "0.6029351", "0.60204625", "0.6013816", ...
0.71258074
0
Returns an informative string describing an exception raised from my function call or a previous one identified by ID, or one you supply (as an instance, not a class).
def aboutException(self, ID=None, exception=None, nowForget=False): if ID: pastInfo = self.getInfo(ID, 'aboutException', nowForget) if pastInfo: return pastInfo if exception: lineList = ["Exception '{}'".format(repr(exception))] else: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def ErrorString(self): # real signature unknown; restored from __doc__\n pass", "def __str__(self):\n error = '{0} ({1}): {2}'.format(self.__class__.__name__, self.code,\n self.args)\n return error", "def __str__(self):\n return \"Error: %s\"%s...
[ "0.64060336", "0.63906485", "0.62958705", "0.62437165", "0.6237594", "0.62264633", "0.61808884", "0.61449856", "0.6136974", "0.613228", "0.6131623", "0.61072975", "0.60843146", "0.60669607", "0.6061389", "0.60569376", "0.6030983", "0.60280555", "0.6019237", "0.6018687", "0.60...
0.6514721
0
Returns an informative string describing a Twisted failure raised from my function call or a previous one identified by ID. You can use this as an errback.
def aboutFailure(self, failureObj, ID=None, nowForget=False): if ID: pastInfo = self.getInfo(ID, 'aboutFailure', nowForget) if pastInfo: return pastInfo lineList = ["Failure '{}'".format(failureObj.getErrorMessage())] callInfo = self.aboutCall() if...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def repr_failure(self, excinfo):\n if excinfo.errisinstance(MypyError):\n return excinfo.value.args[0]\n return super().repr_failure(excinfo)", "def error_str(rc):\n return f\"{rc}: {mqtt.error_string(rc)}\"", "def fail(self, tup_id):\n pass", "def error(self, correlation_id: O...
[ "0.61884654", "0.6145118", "0.6071848", "0.6033766", "0.6013761", "0.5980293", "0.59666383", "0.5962902", "0.5958477", "0.5956995", "0.5916905", "0.5916794", "0.5888485", "0.5883418", "0.5870615", "0.583047", "0.57956845", "0.57738894", "0.5769685", "0.5768838", "0.57651407",...
0.5799822
16
Maps a string to a Python function, e.g., "relu" => `tf.nn.relu`.
def get_activation(self, activation_string): act = activation_string.lower() if act == "linear": return None elif act == "relu": return tf.nn.relu elif act == "gelu": return self.gelu elif act == "tanh": return tf.tanh else...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def map_string2func(funcname, clss, compute_capability):\n if \"_get_\" + funcname not in globals():\n raise AttributeError(\"kernel type '\" + funcname + \"' not understood\")\n return globals()[\"_get_\" + funcname](clss, compute_capability)", "def get_activation(activation_string):\n\n # We as...
[ "0.74201083", "0.66567653", "0.6612086", "0.6498102", "0.64282113", "0.6403409", "0.6328271", "0.6157566", "0.6062532", "0.60543394", "0.60218483", "0.60041183", "0.6000147", "0.59943116", "0.59920865", "0.5933514", "0.5877585", "0.5861618", "0.5804753", "0.57750344", "0.5756...
0.60603654
9
Gaussian Error Linear Unit. This is a smoother version of the RELU.
def gelu(self, input_tensor): cdf = 0.5 * (1.0 + tf.erf(input_tensor / tf.sqrt(2.0))) return input_tensor * cdf
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def GaussianGaussianLoss(mu_kl, log_var_kl, const_var=None) :\n if const_var is None : # Heteroscedastic\n def ggl(x, mu_log_var) :\n N = K.int_shape(mu_log_var)[1]\n mu = mu_log_var[:,:,0]\n log_var = mu_log_var[:,:,1]\n mu = mu[:,:,np.newaxis]\n lo...
[ "0.62770605", "0.6188238", "0.6133913", "0.6133913", "0.6133913", "0.6133913", "0.6133913", "0.6133913", "0.6133913", "0.6133913", "0.60705507", "0.60285944", "0.6002351", "0.600141", "0.58997333", "0.5882227", "0.58777744", "0.58719957", "0.5832293", "0.5832208", "0.5827699"...
0.5394218
89
Save model to disk under specified name
def save_model(name, model): # Load path project_dir = Path(__file__).resolve().parents[2] model_path = os.path.join(project_dir, 'models', name + '.h5') # Save model model.save(model_path)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def save_model(self, filename):\r\n pass", "def save_model(self, model_path: str):", "def model_save(model, name):\n extension = \".pickle\"\n\n save_model_name = os.path.join(MODEL_SAVE_DIR, name + extension)\n pk.dump(model, save_model_name)", "def save_model(model, file_name):\n with open(f...
[ "0.82611257", "0.8217925", "0.8182584", "0.8132696", "0.80981237", "0.799449", "0.79939955", "0.79629564", "0.79477155", "0.7947683", "0.79133636", "0.7908407", "0.7908407", "0.7806509", "0.78042966", "0.78005236", "0.7797508", "0.7795719", "0.77806854", "0.7769967", "0.77401...
0.81213886
4
Load model from disk at specified path
def load_model(name): # Load path project_dir = Path(__file__).resolve().parents[2] model_path = os.path.join(project_dir, 'models', name + '.h5') # Load model model = tf.keras.models.load_model(model_path) return model
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def load_model(self, model_path: str):", "def load_model(self, path):\n pass", "def load(path_to_model):\n pass", "def load(self, path):\n load_model(path, self)", "def load_model(self, filename):\r\n pass", "def load(\n self,\n modelLoadPath\n ):\n ...
[ "0.8960057", "0.89284486", "0.8905791", "0.86008734", "0.8230723", "0.8202744", "0.7990068", "0.7990068", "0.7990068", "0.79732126", "0.79470986", "0.79335487", "0.78644896", "0.78357434", "0.776193", "0.77609074", "0.7718646", "0.7691855", "0.76872164", "0.7647909", "0.76255...
0.0
-1
this method is invoked on the first turn. first player can puts only one stone on board. this method should return 2tuple, default is (10, 10)
def firstMove(self): return (10, 10)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def firstMove(board):\r\n x = board.size / 2\r\n return (x, x)", "def take_turn(self, board, other_player):\n\n # Always pick the middle box on the first round\n position = 4 if self.turn_count == 0 else None\n\n if self.turn_count == 1:\n # On the second turn, after the hum...
[ "0.75705034", "0.65747726", "0.65377414", "0.6350882", "0.6316932", "0.6271466", "0.61944956", "0.61604035", "0.61389923", "0.6138155", "0.61295015", "0.61253476", "0.6120447", "0.6111359", "0.61091137", "0.610629", "0.61005545", "0.6098801", "0.60883456", "0.60808027", "0.60...
0.75002813
1
the structure of board is a 2d list (21x21) the surroundings of board is always filled with Edge. you can put (x, y) where the range of x and y is 1 to 19. x represents vertical axis y represents horizontal axis this method should return list which contains two 2tuple (e.g [(6, 17), (12, 15)]).
def move(self, board): raise NotImplementedError
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def board(self):\n board = []\n if self.flop:\n board.extend(self.flop)\n if self.turn:\n board.append(self.turn)\n if self.river:\n board.append(self.river)\n return tuple(board) if board else None", "def make_board(row_...
[ "0.7138627", "0.6863729", "0.6824034", "0.6652067", "0.6637112", "0.65947896", "0.6561225", "0.6458626", "0.64301455", "0.6420492", "0.6367527", "0.6358973", "0.6356009", "0.63284135", "0.6282831", "0.62593085", "0.6249902", "0.6245804", "0.62330335", "0.6230744", "0.62263054...
0.0
-1
Initialize neural net and check output layer shape.
def test_init() -> None: neural_net = NeuralNetwork() assert neural_net.model.get_layer('output_layer').output_shape, (None, 4)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_init_net_simple(self):\n net = ecn.NeuralNet(2, (2,), 1)\n self.assertEqual(2, len(net.weights.keys()))\n self.assertEqual((2, 3), np.shape(net.weights['h0']))\n self.assertEqual((1, 3), np.shape(net.weights['y']))\n print('Finished testing simple neural net init\\n')", ...
[ "0.7603709", "0.7023699", "0.6976295", "0.69317013", "0.69186133", "0.6909801", "0.6901226", "0.6877522", "0.6854779", "0.6819741", "0.6771726", "0.67149144", "0.66965085", "0.66904634", "0.6672968", "0.66600806", "0.6655046", "0.6619668", "0.66193616", "0.6618829", "0.659733...
0.8320543
0
Evalute should only output nonlethal move options, if they exist.
def test_evaluate(head_x: int, head_y: int, food: bool) -> None: neural_net = NeuralNetwork() snake = ParSnake(neural_net=neural_net, grid_size_x=GRID_X, grid_size_y=GRID_Y, num_games=1) food_x = head_x+1 if head_x == 0 else head_x-1 if food: food_y = head_y else: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def choose_move(self):\r\n \r\n return None", "def make_random_move(self):\n choice = None\n options = []\n #generate full moves list\n for i in range(self.width):\n for j in range(self.height):\n #make sure move has not been made\n ...
[ "0.53914344", "0.53807575", "0.5276373", "0.5265685", "0.52453196", "0.52405983", "0.5215627", "0.51845443", "0.5165242", "0.5162842", "0.5154558", "0.51299995", "0.51283485", "0.5083587", "0.5081081", "0.507274", "0.503114", "0.5014693", "0.5007823", "0.49944317", "0.4944530...
0.0
-1
Calls remote pipeline via gRPC.
def __call__(self, *input_data): pb_ann = Any() pb_ann.Pack(annotation_to_protobuf.convert_annotation(input_data)) request = annotation_pb2.ProcessRequest(pipeline_name = self._pipeline_name, input_annotations = pb_ann) r...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def run(self, pipeline: pipeline_pb2.Pipeline) -> Optional[Any]:\n pass", "def pipeline(ctx):\n asyncio.run(pipeline_impl(ctx.obj[\"config\"]))", "async def call_rpc(self, rpc_message: RpcMessage, options: dict, bus_client: \"BusClient\"):\n raise NotImplementedError()", "def proc_exec_async(cmd...
[ "0.6544793", "0.6321018", "0.56702656", "0.5618317", "0.55825615", "0.55604964", "0.5502522", "0.53786516", "0.53683054", "0.53434986", "0.5316965", "0.52956116", "0.5292217", "0.52873677", "0.52846617", "0.52833116", "0.52823466", "0.5257544", "0.52436423", "0.5242128", "0.5...
0.0
-1
Funzione autogenerata al momento della creazione della classe a partire dal file .ui di QtDesigner Inizializza il contenuto testuale di tutti gli elementi inizializzati in setupUI
def retranslateUi(self, Dialog): _translate = QtCore.QCoreApplication.translate Dialog.setWindowTitle(_translate("Dialog", "Caricamento File Utilizzo")) self.label_2.setText(_translate("Dialog", "CARICAMENTO FILE DI UTILIZZO")) self.label_4.setText(_translate("Dialog", ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def prepare_UI(self):", "def init_ui(self):\n # Create GUI elements, set them in dict structure\n labelwidth = 150\n\n # Add parameter line edit for Factor Tm to Tp\n\n # Add line edit with browsebutton for swan result folder\n self.input_elements['hares folder'] = widgets.Exte...
[ "0.7513145", "0.7482161", "0.7362601", "0.7208887", "0.72026205", "0.7198728", "0.7198728", "0.71846974", "0.71774113", "0.7128159", "0.70827895", "0.7071562", "0.7046793", "0.70268977", "0.7019691", "0.6999024", "0.69660616", "0.6924613", "0.6892468", "0.68913066", "0.688663...
0.0
-1
update the list of d_bison_obs
def update_d_bison_obs(bison_i): for i in range(obs_n): d_bison_obs[i][bison_i] = calculate_d(bison_x[bison_i], bison_y[bison_i], obstacles[i][0], obstacles[i][1])
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update(self, bsd):\n raise NotImplementedError()", "def update_bison_obs(x_tan, y_tan, i, k):\n d_tan_bison = calculate_d(elude_bison[k][i][0], elude_bison[k][i][1], x_tan, y_tan)\n turn_v = math.sqrt(math.fabs(bison_v ** 2 - 10 * bison_v * (1 - math.cos(bison_angle[i]) ** 2) / math.cos(bison_an...
[ "0.6155102", "0.5999859", "0.59011286", "0.5888638", "0.58285916", "0.5765711", "0.5587305", "0.5576261", "0.5576261", "0.5572444", "0.55177706", "0.54821646", "0.54729325", "0.54384035", "0.54384035", "0.54246837", "0.54121697", "0.54096115", "0.53964806", "0.53757375", "0.5...
0.69077736
0
if the distance between bison_i and obs_i less than 2.5, it should elude this obstacle
def elude_obstacles(bison_i, k): # Ax+By+C=0 global predict_wolf r = obstacles[k][2] xk = obstacles[k][0] yk = obstacles[k][1] a = (bison_y[bison_i] - wolf_y[0]) / (bison_x[bison_i] - wolf_x[0]) b = -1 c = bison_y[bison_i] - (a * bison_x[bison_i]) d_obs_dir = math.fabs(a * xk + b * y...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def check_terminal(self,bump,DLightBump, AnalogBump, IR):\r\n terminal = False\r\n # signal returned from distance to obstacle /terminal 50 mm,5cm\r\n # by measurement, small obstacle (height = height of light bumper) in 2cm: signal 120 ~300\r\n # within 1cm >400\r\n # if big ob...
[ "0.62927634", "0.6241226", "0.620058", "0.6018024", "0.59719473", "0.59486395", "0.5917246", "0.59119254", "0.5910905", "0.58528554", "0.5772193", "0.5666695", "0.56637704", "0.5658386", "0.56462765", "0.5594453", "0.55852175", "0.5563984", "0.5561192", "0.55316013", "0.55280...
0.7006195
0
when sheep i encounters an obstacle, the wolf will make prediction
def update_wolf_predict(x_tan, y_tan, i, k): d_temp = math.sqrt((2 * x_tan - elude_bison[k][i][0] - predict_wolf[0][0]) ** 2 + (2 * y_tan - elude_bison[k][i][1] - predict_wolf[0][1]) ** 2) turn_v = math.sqrt(math.fabs(wolf_v ** ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def elude_obstacles(bison_i, k):\n # Ax+By+C=0\n global predict_wolf\n r = obstacles[k][2]\n xk = obstacles[k][0]\n yk = obstacles[k][1]\n a = (bison_y[bison_i] - wolf_y[0]) / (bison_x[bison_i] - wolf_x[0])\n b = -1\n c = bison_y[bison_i] - (a * bison_x[bison_i])\n d_obs_dir = math.fabs(...
[ "0.65113294", "0.58036506", "0.57595885", "0.5693709", "0.56864536", "0.56776464", "0.56260264", "0.56131107", "0.5607759", "0.5607257", "0.5589702", "0.55828494", "0.5573906", "0.5571394", "0.5564398", "0.55640703", "0.5563069", "0.55479985", "0.5524681", "0.55181146", "0.55...
0.0
-1
update position of sheep who is eluding an obstacle
def update_bison_obs(x_tan, y_tan, i, k): d_tan_bison = calculate_d(elude_bison[k][i][0], elude_bison[k][i][1], x_tan, y_tan) turn_v = math.sqrt(math.fabs(bison_v ** 2 - 10 * bison_v * (1 - math.cos(bison_angle[i]) ** 2) / math.cos(bison_angle[i]))) bison_x[i] = bison_x[i] + ((x_tan - elude_bison[k][i][0]) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _update_environment(self):\n\n # compute a distance matrix\n distance_matrix = np.zeros((self.num_sheep,self.num_sheep))\n for i in range(self.num_sheep):\n for j in range(i):\n dist = np.linalg.norm(self.sheep_poses[i,:] - self.sheep_poses[j,:])\n ...
[ "0.6596403", "0.6276996", "0.6205589", "0.619456", "0.6150602", "0.61237663", "0.6109519", "0.61021274", "0.609728", "0.6090564", "0.60674024", "0.6062633", "0.6029504", "0.5872343", "0.58682066", "0.58682066", "0.5838082", "0.5822439", "0.5815109", "0.5778401", "0.57713646",...
0.0
-1
find the index of minimum distance in list of d
def find_min_distance(): return np.argmin(d)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __idx_of_minimum(cls, lst: list) -> int:\n\t\treturn lst.index(min(lst))", "def _minimum_distance(self,arg):\n return min([abs(arg-e) for e in self if not e is arg])", "def min_distance(distance, spt_set, self_nodes):\n minimum = sys.maxsize\n minimum_node = None\n f...
[ "0.7192563", "0.71359694", "0.70440257", "0.7035856", "0.70053023", "0.69904137", "0.6925225", "0.6874505", "0.6810732", "0.67803216", "0.6676719", "0.66622704", "0.66444784", "0.6632789", "0.6621095", "0.66131043", "0.6592418", "0.6562787", "0.6508623", "0.649189", "0.647867...
0.8462347
0
Returns the streamfunction generated by a source/sink.
def get_stream_function(strength, x_source, y_source, X, Y): if isinstance(x_source, list): psi = [0.0] * len(x_source) for i in range(0, len(x_source)): psi[i] = strength[i] / (2 * numpy.pi) * numpy.arctan2((Y - y_source[i]), (X - x_source[i])) psi = sum(psi) else: p...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_function(self):\n return SSAFunction(self.get_graph())", "def get_stream_function_sink(strength, xs, ys, X, Y):\r\n psi = strength / (2 * math.pi) * numpy.arctan2((Y - ys), (X - xs))\r\n \r\n return psi", "def get_function(self):\n return subs(self.f.get_function(), self.sub_pre,...
[ "0.6196658", "0.613481", "0.6017871", "0.5849812", "0.58272237", "0.5810706", "0.5786503", "0.5692548", "0.56741154", "0.55982894", "0.5564781", "0.5542864", "0.5524242", "0.5510607", "0.546856", "0.5460594", "0.54391384", "0.54083943", "0.53916246", "0.53803605", "0.52523947...
0.56563514
9
Returns the velocity field generated by a doublet.
def get_velocity_doublet(strength, xd, yd, X, Y): if isinstance(xd, list): u = [0.0] * len(xd) v = [0.0] * len(yd) for i in range(0, len(xd)): u[i] = - strength[i] / (2 * math.pi) * ((X - xd[i]) ** 2 - (Y - yd[i]) ** 2) / ((X - xd[i]) ** 2 + ( Y - yd[i]) ** 2) ** ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getVelocity(self):\n return self.v", "def velocity(self):\n return self._velocity", "def velocity(self):\n return self._velocity", "def getVelocity(self):\n\n return self.vel", "def get_velocity(self):\n return self.momentum/self.mass", "def velocity_model(self):\n ...
[ "0.7200456", "0.6920105", "0.6920105", "0.6735759", "0.66176605", "0.66080326", "0.6602164", "0.6586435", "0.6560289", "0.64285827", "0.6413392", "0.62519425", "0.62133986", "0.6163308", "0.6040189", "0.60041803", "0.59976274", "0.5996631", "0.59051406", "0.58974963", "0.5889...
0.58727473
22
Returns the streamfunction generated by a doublet.
def get_stream_function_doublet(strength, xd, yd, X, Y): psi = - strength / (2 * math.pi) * (Y - yd) / ((X - xd) ** 2 + (Y - yd) ** 2) return psi
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_function(self):\n return subs(self.f.get_function(), self.sub_pre, self.sub_post)", "def getFunction(self) -> ghidra.program.model.listing.Function:\n ...", "def get_function(self):\n return SSAFunction(self.get_graph())", "def function(self) -> pulumi.Input[str]:\n return...
[ "0.5901997", "0.5898072", "0.58108723", "0.5600798", "0.5600798", "0.5600798", "0.55771285", "0.5531702", "0.5443946", "0.5401715", "0.54015255", "0.54015255", "0.53834504", "0.53663784", "0.5349206", "0.5320001", "0.530694", "0.5275393", "0.5273589", "0.52705175", "0.5259918...
0.5877548
2
Finds the max gap_score of the flanking reads. We use this value as the threshold for smith waterman filtering.
def compute_sw_threshold(flanking_reads, paf_dict, fasta_dict, window_size): max_scores = [] for query, target in itertools.product(flanking_reads, flanking_reads): if str(query + target) in paf_dict: overlap_info = paf_dict[query+target] elif str(target + query) in paf_dict: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def max_gap(self):\n return self._max_gap", "def max_score(self):\n return self.raw_possible", "def max_score(self):\r\n max_score = None\r\n if self.check_if_done_and_scored():\r\n max_score = self._max_score\r\n return max_score", "def max_score(self):\n ...
[ "0.65937996", "0.6442271", "0.6323267", "0.6321066", "0.62130624", "0.6183801", "0.6155798", "0.6139358", "0.61088455", "0.60916436", "0.60519683", "0.6035053", "0.6027988", "0.5917933", "0.59149694", "0.5904565", "0.5880489", "0.5870277", "0.586847", "0.58620393", "0.5844067...
0.6311884
4
runs a community detection algorithm on graph and returns a coloring of the nodes based on the found communities
def node_community_colors(graph, communities): colors = nx_helpers.generate_colors(len(communities)) def which_color(node): """finds which community node is in and returns its corresponding color """ for i, com in enumerate(communities): if node in com: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def community_detection(net_G):\r\n if list(nx.isolates(net_G)) == []:\r\n part = community.best_partition(net_G)\r\n #values = [part.get(node) for node in net_G.nodes()]\r\n #nx.draw_spring(net_G, cmap = plt.get_cmap('jet'), node_color = values, node_size=30, with_labels=False)\r\n ...
[ "0.7544369", "0.67278713", "0.67230785", "0.6600129", "0.6450803", "0.62319934", "0.62119263", "0.6207066", "0.62020797", "0.61163753", "0.61084396", "0.6086533", "0.5949669", "0.591313", "0.59082705", "0.5903655", "0.58992743", "0.58878565", "0.5877019", "0.58694255", "0.586...
0.7250731
1
finds which community node is in and returns its corresponding color
def which_color(node): for i, com in enumerate(communities): if node in com: return colors[i] return nx_helpers.rgb_to_hex((0, 0, 0))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def node_community_colors(graph, communities):\n colors = nx_helpers.generate_colors(len(communities))\n\n def which_color(node):\n \"\"\"finds which community node is in and returns\n its corresponding color\n \"\"\"\n for i, com in enumerate(communities):\n if node in...
[ "0.75510806", "0.69493985", "0.66909236", "0.66592944", "0.6608618", "0.64989406", "0.6450056", "0.64425915", "0.64138216", "0.6396164", "0.6335987", "0.6323094", "0.62105125", "0.6205423", "0.61846185", "0.617105", "0.6087763", "0.59781784", "0.5975609", "0.59191763", "0.590...
0.83000135
0
returns a list of colors for coloring nodes based on which set each node is in
def node_set_colors(nodes, spanset, gapset, preset, postset): node_colors = [] for n in nodes: if n in preset: node_colors.append(nx_helpers.rgb_to_hex((255, 0, 0))) elif n in postset: node_colors.append(nx_helpers.rgb_to_hex((255, 255, 0))) ## reads now may be m...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_groups(nodes):\n return list(set([node.color for node in nodes]))", "def get_colors(self):\n colors = [\"#244486\", \"#A6A6A6\", \"#B12122\"]\n cmap = LinearSegmentedColormap.from_list(\"mycmap\", colors)\n\n color_palette=[cmap(i) for i in np.linspace(0, 1, len(set(self.nodes_lis...
[ "0.78957987", "0.7514314", "0.712716", "0.69475394", "0.6675967", "0.66652167", "0.66599905", "0.66454685", "0.64734924", "0.6415016", "0.64149046", "0.6397059", "0.63902277", "0.63846207", "0.63146603", "0.6292402", "0.627562", "0.627562", "0.62653184", "0.62567157", "0.6220...
0.7795284
1
generates and returns overlap graph from .paf files
def generate_graph(params): alignedreads = read_paf(params, should_filter_paf=True) aligned = [(t, h) for t, h, _ in alignedreads] graph = nx.Graph() graph.add_edges_from(aligned) return graph
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def overlap_graph(input, overlap):\n\n sequence_dict = {}\n seq_id_list = []\n\n for seq_record in SeqIO.parse(input, \"fasta\"): # change input variable.\n sequence_dict[seq_record.id] = seq_record.seq\n seq_id_list.append(seq_record.id)\n\n adjacency_list= []\n\n index = overlap\n\n ...
[ "0.6383634", "0.61519605", "0.60640895", "0.5620521", "0.54954714", "0.5461694", "0.5433732", "0.54307693", "0.5381156", "0.53631675", "0.5311818", "0.5308905", "0.52986294", "0.52673423", "0.5267266", "0.52432793", "0.52378273", "0.52373457", "0.5227681", "0.5227558", "0.522...
0.64970756
0
removes nodes from graph in they are in communities smaller than n
def drop_small_communities(graph, communities, n=4): for community in communities: if len(community) < n: nx_helpers.remove_nodes(graph, community) communities = [c for c in communities if len(c) >= n] return graph, communities
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def keep_important_nodes(graph, number_of_nodes):\n sorted_dict = np.array(\n [\n [k, v]\n for k, v in sorted(\n dict(graph.degree()).items(),\n key=lambda item: item[1],\n )\n ]\n )\n use_nodes = sorted_dict[-number_of_nodes:, 0...
[ "0.69280136", "0.68292296", "0.67802733", "0.66563076", "0.6461734", "0.64381963", "0.64123416", "0.63864523", "0.6341436", "0.62839335", "0.6267461", "0.6262071", "0.6231139", "0.61691225", "0.6163174", "0.6140132", "0.61174977", "0.61075747", "0.61025345", "0.60737944", "0....
0.8111857
0
Determines the quality of the mapping (assignment of edges) based on the "ground truth" of spanset and gapset. Sums up number of edges between spanset and gapset. Assumes undirected graph see comments
def mapping_quality(graph, spanset, gapset): the_sum = sum(sum(1 for edge in graph.edges(node) if edge[1] in gapset) for node in spanset) # if directed graph, uncomment this: #the_sum += sum(sum(1 for edge in graph.edges(node) if edge[1] in spanset) for node in gapset) return the_sum
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def countEdges(self):\n n = 0\n for (hub, table) in self.totsupport.iteritems():\n n += len(table)\n return n", "def community_quality(communities, spanset, gapset):\n if len(communities) != 2:\n return -1\n\n com_sets = [set(c) for c in communities]\n spanset = se...
[ "0.55912036", "0.553591", "0.5377618", "0.53747284", "0.53365", "0.5324719", "0.5322185", "0.5320498", "0.5284785", "0.52796876", "0.5255801", "0.5249715", "0.5231621", "0.5206148", "0.51990473", "0.519828", "0.51928836", "0.51651835", "0.51341033", "0.5120622", "0.511521", ...
0.8308598
0
Determines the quality of the communities based on the "ground truth" of spanset and gapset. First, determines which community corresponds to gapset and spanset. Then, returns number of wrong nodes.
def community_quality(communities, spanset, gapset): if len(communities) != 2: return -1 com_sets = [set(c) for c in communities] spanset = set(spanset) gapset = set(gapset) spanset_0 = len(com_sets[0].difference(spanset)) spanset_1 = len(com_sets[1].difference(spanset)) gapset_0 =...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def mapping_quality(graph, spanset, gapset):\n the_sum = sum(sum(1 for edge in graph.edges(node) if edge[1] in gapset) for node in spanset)\n # if directed graph, uncomment this:\n #the_sum += sum(sum(1 for edge in graph.edges(node) if edge[1] in spanset) for node in gapset)\n return the_sum", "def c...
[ "0.63994", "0.58635193", "0.5778622", "0.5743064", "0.55880827", "0.555476", "0.53169554", "0.52722627", "0.52660155", "0.52518225", "0.52481997", "0.52412534", "0.5223429", "0.5208664", "0.5191661", "0.5173846", "0.51651204", "0.51604426", "0.51279247", "0.51213825", "0.5113...
0.75630814
0