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
Check all files against the defined precommit hooks.
def lint(session): session.install("pre-commit") session.run("pre-commit", "run", "--all-files")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def precommit(exit=True):\n tmpdir = tempfile.mkdtemp()\n\n try:\n copy_index(tmpdir)\n\n modified = check_output(['git', 'diff', '--cached', '--name-only',\n '--diff-filter=ACMRT'])\n modified = [name.strip() for name in modified.splitlines()]\n pa...
[ "0.6876963", "0.68466324", "0.67995423", "0.6654954", "0.6572371", "0.6481038", "0.64283687", "0.63959146", "0.6318683", "0.63177663", "0.6232557", "0.6230077", "0.6152871", "0.6043679", "0.60293245", "0.6020104", "0.6003532", "0.59991527", "0.5969695", "0.59456915", "0.58171...
0.70069766
0
Run integration tests, unit tests, and doctests sequentially
def run_quick(session): run_tests(session) run_doctests(session)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def runalltests():\n doctest.testmod()", "def _run_ci_integration_test():\n _run_install(False)\n _run_integration_tests_on_github(False)", "def main():\n run_test_all()", "def runTests(self):\n \n pass", "def run_doctests(session):\n session.run_always(\"pip\", \"install\", \"-e\"...
[ "0.74199253", "0.714732", "0.71423995", "0.71035886", "0.705361", "0.6876069", "0.67916864", "0.67511946", "0.6729915", "0.6713778", "0.6660046", "0.6654544", "0.66172045", "0.6584335", "0.65719473", "0.6557498", "0.6537281", "0.6525023", "0.6501568", "0.6495328", "0.64940125...
0.7066262
4
Load the EEG data, which is a particular split of the first trial of subject 337 in the large training data.
def load(extended=False): _fetch_large() if extended: return _load(cache_experiment_extended, _parse_experiment) else: return _load(cache_experiment, _parse_experiment)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def readEEGepoch(eegfilename, mainDir):\n # subject = 'ES9007' \n datapath = os.path.join(mainDir)\n os.chdir(datapath)\n \n folders = os.listdir(datapath)\n \n for dir in folders:\n \n os.chdir(os.path.join(datapath, dir))\n file =...
[ "0.6603588", "0.6308554", "0.62607586", "0.62329745", "0.6205543", "0.60054445", "0.60021067", "0.5892239", "0.58778375", "0.58696485", "0.5865206", "0.58328277", "0.58099234", "0.57833", "0.5776546", "0.57653904", "0.5742434", "0.5740489", "0.57217824", "0.5721316", "0.57048...
0.0
-1
Load the full EEG data.
def load_full(): _fetch_full() return _load(cache_full, _parse_full)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def load_data(self) -> None:", "def load_data(self):", "def load(self) -> None:\n self._load_data()\n self._load_poses()\n self._load_timestamps()", "def _read_eeg(eeg_file):\r\n pass", "def load_data(self):\n raise NotImplementedError()", "def load(self):\n pass", ...
[ "0.7056107", "0.6855266", "0.64944243", "0.6453749", "0.6389463", "0.6356763", "0.6356763", "0.6356763", "0.6356763", "0.6346757", "0.63448316", "0.628291", "0.62805426", "0.6273152", "0.6271349", "0.6236898", "0.6213318", "0.61869174", "0.6132568", "0.6101102", "0.60924596",...
0.0
-1
Fetch the large training and test data set.
def _fetch_large(): # Large training data: resource( target=data_path("eeg", "SMNI_CMI_TRAIN.tar.gz"), url="https://kdd.ics.uci.edu/databases/eeg/SMNI_CMI_TRAIN.tar.gz", ) dependency( target=data_path("eeg", "train"), source=data_path("eeg", "SMNI_CMI_TRAIN.tar.gz"), ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _load_training_and_test_sets(normalize):\n class_labels = []\n test_labels = []\n norm = None\n if normalize == True:\n norm = loading.get_normalize_vector()\n\n for i in range(0, 10):\n [training, test] = loading.load_number_set(i, 0.7, norm_vector=norm)\n labels = [str(i)]...
[ "0.6598382", "0.6573951", "0.6541831", "0.6520022", "0.64941293", "0.6416177", "0.6404021", "0.64026076", "0.63473725", "0.6340111", "0.6321149", "0.6319699", "0.63178426", "0.6309703", "0.6307903", "0.6301534", "0.6286118", "0.62821674", "0.6274003", "0.6271432", "0.62667745...
0.7176988
0
Fetch the full data set.
def _fetch_full(): resource( target=data_path("eeg", "eeg_full.tar"), url="https://kdd.ics.uci.edu/databases/eeg/eeg_full.tar", ) dependency( target=data_path("eeg", "full"), source=data_path("eeg", "eeg_full.tar"), commands=[ "mkdir full", "ta...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _fetch_data(self):\n pass", "def fetch_data(self):", "def fetch_data():\n data.fetch_data()\n data.start_updating()", "def fetch(self):\n # type: () -> List[List[Any]]\n if self._request.next_uri is None:\n self._finished = True\n return []\n respon...
[ "0.7292134", "0.7166098", "0.69632185", "0.68717474", "0.68225473", "0.6602098", "0.6591393", "0.6559346", "0.6547175", "0.6547175", "0.6523688", "0.64388525", "0.6358625", "0.6345627", "0.6340102", "0.63101643", "0.6285294", "0.6239476", "0.62394583", "0.6239034", "0.618789"...
0.0
-1
Trim string to fit on terminal (assuming 80column display)
def trim(s): return s if len(s) <= 80 else s[:77] + "..."
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def truncate(string):", "def trim(string, left=True, right=True):\n lspaces=0;\n rspaces=0;\n if (left):\n for i in range (len(string)):\n if not (string[i] == ' ' or string[i] == '\\t' or string[i] == '\\r' or string[i] == '\\n'):\n break;\n ...
[ "0.70734745", "0.6830786", "0.6794939", "0.6749982", "0.6673864", "0.6670376", "0.6625764", "0.65689117", "0.6558081", "0.652869", "0.64897746", "0.64516795", "0.6439728", "0.6387328", "0.6361083", "0.62939423", "0.62538517", "0.62494695", "0.6247001", "0.62291694", "0.622815...
0.74525046
3
This method is used to get appropriate error messages from the exception.
def _get_error_message_from_exception(self, e): error_code = AWSSECURITYHUB_ERR_CODE_UNAVAILABLE error_msg = AWSSECURITYHUB_ERR_MSG_UNAVAILABLE try: if e.args: if len(e.args) > 1: error_code = e.args[0] error_msg = e.args[1] ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def error(self, e):\n return \"{}: {} ({})\".format(e.__class__.__name__, e.__doc__, e.message)", "def get_error_message(self):\n return self.error_message.get_error_message()", "def exception(self) -> exceptions.ErrorMessageException:\n\n return ErrorMessage.ERROR_CODES_TO_EXCEPTIONS.get(...
[ "0.7292581", "0.7146587", "0.71316063", "0.70570153", "0.7033765", "0.7033765", "0.7033765", "0.70254177", "0.7002314", "0.69653606", "0.6963725", "0.6946914", "0.694056", "0.69257855", "0.68925625", "0.6857166", "0.6846722", "0.68250126", "0.6807385", "0.67811245", "0.678112...
0.6984752
9
This method is to check if the provided input parameter value is a nonzero positive integer and returns the integer value of the parameter itself.
def _validate_integer(self, action_result, parameter, key, allow_zero=False): if parameter is not None: try: if not float(parameter).is_integer(): return action_result.set_status(phantom.APP_ERROR, AWSSECURITYHUB_VALID_INT_MSG.format(param=key)), None ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def positive_int(arg):\n try:\n n = int(arg)\n assert n > 0\n return n\n except (ValueError, AssertionError):\n raise argparse.ArgumentTypeError('%s is not a positive integer' % arg)", "def posint_zero_p(value):\n # check if the value has the expected ...
[ "0.74226147", "0.74018186", "0.7358888", "0.7341269", "0.72722924", "0.7248723", "0.72295064", "0.7205128", "0.71804637", "0.7158422", "0.7157822", "0.7041932", "0.70318663", "0.6935737", "0.69280696", "0.6923878", "0.68814045", "0.6756427", "0.6744842", "0.6740722", "0.67209...
0.65633446
28
This function is used to create the container in Phantom using finding data.
def _create_container(self, finding): container_dict = {} container_dict['name'] = finding['Title'] container_dict['source_data_identifier'] = finding['Id'] container_dict['description'] = finding['Description'] container_creation_status, container_creation_msg, container_id = ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_create_container(self):\n pass", "def createContainer(tag, data={}): #@NoSelf", "def container_factory(self, name):", "def container_factory(self, name):", "def container_factory(self, name):", "def container_factory(self, name):", "def container_factory(self, name):", "def __create_...
[ "0.5875233", "0.58578813", "0.5711849", "0.5711849", "0.5711849", "0.5711849", "0.5711849", "0.5676269", "0.5545769", "0.5408113", "0.53612626", "0.5329194", "0.5291496", "0.5263945", "0.5263945", "0.51851237", "0.5161798", "0.5128938", "0.5122123", "0.51019007", "0.50853336"...
0.65444756
0
This function is used to create artifacts in given container using finding data.
def _create_artifacts(self, finding, container_id): artifacts = [] for resource in finding.pop('Resources'): resource_artifact = {} resource_artifact['name'] = '{} Resource Artifact'.format(resource['Type']) resource_artifact['container_id'] = container_id ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _create_container(self, finding):\n\n container_dict = {}\n container_dict['name'] = finding['Title']\n container_dict['source_data_identifier'] = finding['Id']\n container_dict['description'] = finding['Description']\n\n container_creation_status, container_creation_msg, con...
[ "0.62061214", "0.57416934", "0.573482", "0.573116", "0.56448776", "0.5568765", "0.55421925", "0.55335236", "0.54728556", "0.5449445", "0.54188776", "0.53918684", "0.53792435", "0.5363252", "0.5348222", "0.5341792", "0.52852637", "0.52717286", "0.5253826", "0.52310616", "0.523...
0.73780525
0
This function is used to handle on_poll.
def _handle_on_poll(self, param): self.save_progress("In action handler for: {0}".format(self.get_action_identifier())) action_result = self.add_action_result(ActionResult(dict(param))) config = self.get_config() container_count = int(param.get(phantom.APP_JSON_CONTAINER_COUNT)) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def poll(self, poll_input):", "def poll(self):\n self.poll_function(self.connection)", "def poll(self):\n raise NotImplementedError()", "def setup_poll(self):\n while True:\n try:\n self.do_polling()\n time.sleep(0.01)\n except Keyboard...
[ "0.76818335", "0.7355514", "0.7202711", "0.7128685", "0.71189326", "0.7010415", "0.7010415", "0.7010415", "0.7010415", "0.7010415", "0.7010415", "0.7010415", "0.7010415", "0.7010415", "0.7010415", "0.7010415", "0.7010415", "0.7010415", "0.7010415", "0.7010415", "0.69312245", ...
0.0
-1
Return collected metadata of a dataproduct.
def dataproduct(self, identity, dataproduct_id): metadata = {} permissions = self.permission.dataproduct_permissions( dataproduct_id, identity ) or {} session = self.config_models.session() # find Group or Data layer object OWSLayer = self.config_models.mod...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_metadata(self):\n return self.client._perform_json(\n \"GET\", \"/projects/%s/recipes/%s/metadata\" % (self.project_key, self.recipe_name))", "def summarize_metadata(self):\n meta_dict = {}\n for comp in self.dataset.data_vars:\n for mkey, mvalue in self.dat...
[ "0.6686516", "0.6594631", "0.65593004", "0.6541971", "0.6431339", "0.6426287", "0.6409416", "0.63947934", "0.638867", "0.6377498", "0.63504374", "0.6335236", "0.63153744", "0.6300704", "0.627984", "0.6277133", "0.62743515", "0.62743515", "0.62743515", "0.62743515", "0.6274351...
0.75031686
0
Recursively collect metadata of a dataproduct.
def dataproduct_metadata(self, ows_layer, permissions, session): metadata = {} # type sublayers = None data_set_view = None searchterms = [] if ows_layer.type == 'group': if ows_layer.name not in permissions.get('group_layers', []): # group la...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def dataproduct(self, identity, dataproduct_id):\n metadata = {}\n\n permissions = self.permission.dataproduct_permissions(\n dataproduct_id, identity\n ) or {}\n\n session = self.config_models.session()\n\n # find Group or Data layer object\n OWSLayer = self.co...
[ "0.62223345", "0.6028894", "0.5872434", "0.5834364", "0.5798437", "0.575176", "0.5705367", "0.55762815", "0.5575156", "0.5539546", "0.5454352", "0.54196703", "0.54158056", "0.5383527", "0.5330761", "0.5273302", "0.5259924", "0.5257529", "0.5253101", "0.52238184", "0.521929", ...
0.52869976
15
Collect metadata of a basic DataSet dataproduct.
def basic_dataset_metadata(self, data_set_view, session): metadata = {} contacts = self.basic_dataset_contacts(data_set_view, session) metadata = { 'identifier': data_set_view.name, 'display': data_set_view.data_set.data_set_name, 'type': 'datasetview', ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def dataproduct(self, identity, dataproduct_id):\n metadata = {}\n\n permissions = self.permission.dataproduct_permissions(\n dataproduct_id, identity\n ) or {}\n\n session = self.config_models.session()\n\n # find Group or Data layer object\n OWSLayer = self.co...
[ "0.67701876", "0.6577738", "0.6516718", "0.6471045", "0.62507623", "0.62314963", "0.62190706", "0.6218088", "0.62123156", "0.62123156", "0.61886233", "0.6174235", "0.6168924", "0.6141858", "0.612278", "0.6120039", "0.60999846", "0.60504276", "0.6031817", "0.59935963", "0.5977...
0.7206746
0
Return contacts metadata for a dataproduct.
def dataproduct_contacts(self, ows_layer, session): # collect contacts for layer and related GDI resources gdi_oids = [ows_layer.gdi_oid] if ows_layer.type == 'data': # include data source gdi_oids.append( ows_layer.data_set_view.data_set.gdi_oid_data_sour...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def dataproduct(self, identity, dataproduct_id):\n metadata = {}\n\n permissions = self.permission.dataproduct_permissions(\n dataproduct_id, identity\n ) or {}\n\n session = self.config_models.session()\n\n # find Group or Data layer object\n OWSLayer = self.co...
[ "0.63011616", "0.6096609", "0.59576094", "0.5945618", "0.59220904", "0.5815128", "0.57454026", "0.56265146", "0.56265146", "0.56265146", "0.5608655", "0.5568946", "0.54889625", "0.5485552", "0.5429544", "0.5420704", "0.53999895", "0.53758997", "0.53610945", "0.5360896", "0.53...
0.593956
4
Return contacts metadata for a basic DataSet dataproduct.
def basic_dataset_contacts(self, data_set_view, session): # collect contacts for basic DataSet and related GDI resources gdi_oids = [ data_set_view.gdi_oid, data_set_view.data_set.gdi_oid_data_source ] return self.contacts(gdi_oids, session)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def basic_dataset_metadata(self, data_set_view, session):\n metadata = {}\n\n contacts = self.basic_dataset_contacts(data_set_view, session)\n\n metadata = {\n 'identifier': data_set_view.name,\n 'display': data_set_view.data_set.data_set_name,\n 'type': 'datas...
[ "0.70957017", "0.6029492", "0.60244423", "0.5971579", "0.5823789", "0.5810419", "0.5684084", "0.5576861", "0.55693126", "0.5546394", "0.554111", "0.5482603", "0.54492116", "0.54473823", "0.5446493", "0.5446493", "0.5446493", "0.54323864", "0.5393266", "0.538147", "0.5356055",...
0.72183543
0
Return contacts metadata for a list of resource IDs.
def contacts(self, gdi_oids, session): contacts = [] ResourceContact = self.config_models.model('resource_contact') Contact = self.config_models.model('contact') query = session.query(ResourceContact) \ .filter(ResourceContact.gdi_oid_resource.in_(gdi_oids)) \ .o...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getcontacts():\n contacts = {}\n\n try:\n #get list of contact ids\n contactids = r.smembers(\"contacts\")\n\n #for each contact id get data\n for contactid in contactids:\n contacts.update(_getcontact(str(contactid)))\n return contacts\n except:\n ...
[ "0.6895001", "0.6349526", "0.62968177", "0.6285123", "0.61312366", "0.60384965", "0.6011176", "0.5951977", "0.5888752", "0.5837271", "0.5823244", "0.5820674", "0.576577", "0.57647824", "0.57629967", "0.57116294", "0.5709567", "0.5701766", "0.5696976", "0.5671242", "0.56564695...
0.58337533
10
Return datasource metadata for a dataproduct.
def dataproduct_datasource(self, ows_layer, session): metadata = {} if ows_layer.type == 'group': # group layer return metadata data_set = ows_layer.data_set_view.data_set data_source = data_set.data_source if data_source.connection_type == 'database': ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def dataproduct(self, identity, dataproduct_id):\n metadata = {}\n\n permissions = self.permission.dataproduct_permissions(\n dataproduct_id, identity\n ) or {}\n\n session = self.config_models.session()\n\n # find Group or Data layer object\n OWSLayer = self.co...
[ "0.74106634", "0.6391926", "0.60912377", "0.60485494", "0.57594264", "0.5758313", "0.5735054", "0.56168944", "0.55876154", "0.55693054", "0.5500405", "0.54809636", "0.5465075", "0.54416764", "0.5426445", "0.53999317", "0.5371702", "0.53709596", "0.5331371", "0.53281933", "0.5...
0.61659366
2
Return table metadata for a data_set.
def dataset_info(self, data_source_id, table_name): # NOTE: form field returns 'None' as string if not set if not table_name or table_name == 'None': # empty table name return None # parse schema and table name parts = table_name.split('.') if len(parts) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def basic_dataset_metadata(self, data_set_view, session):\n metadata = {}\n\n contacts = self.basic_dataset_contacts(data_set_view, session)\n\n metadata = {\n 'identifier': data_set_view.name,\n 'display': data_set_view.data_set.data_set_name,\n 'type': 'datas...
[ "0.7403433", "0.6452928", "0.6423298", "0.6297942", "0.62787217", "0.6275273", "0.62073505", "0.62066114", "0.6149771", "0.605354", "0.60337037", "0.5911093", "0.59013206", "0.58804536", "0.587467", "0.586729", "0.5864545", "0.5843912", "0.58337164", "0.57818174", "0.577952",...
0.6074714
9
Return primary key, geometry columns, types and srids from a PostGIS table.
def postgis_metadata(self, data_source_id, schema, table_name): metadata = {} try: engine = self.engine_for_data_source(data_source_id) if engine is None: return { 'error': "FEHLER: DataSource nicht gefunden" } # c...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_table_info(self):\n epsg = None\n meta = MetaData()\n table_obj = Table(self._table, meta,\n autoload=True, autoload_with=self._engine)\n if not self._columns:\n self._columns = table_obj.columns.keys()\n geo_cols = [(col.name, col.type...
[ "0.67692256", "0.675476", "0.62519324", "0.60473233", "0.5883852", "0.58504605", "0.5701166", "0.5491535", "0.5480299", "0.5475951", "0.5452421", "0.53603435", "0.5338191", "0.5314427", "0.52559847", "0.52456456", "0.5243877", "0.5240255", "0.52377796", "0.5215144", "0.521342...
0.696644
0
Return SQLAlchemy engine for a data_source.
def engine_for_data_source(self, data_source_id): engine = None # find data_source DataSource = self.config_models.model('data_source') session = self.config_models.session() query = session.query(DataSource) \ .filter_by(gdi_oid=data_source_id) data_source =...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_database_engine() -> Engine:\n return engine", "def get_db_engine():\n # get database connection url\n connection_url = get_db_connection_url()\n\n # Create engine from connection url\n engine = create_engine(connection_url)\n\n return engine", "def get_engine(self, db_name):\n ...
[ "0.7026651", "0.6842614", "0.67209196", "0.6679287", "0.6633262", "0.6460196", "0.6328281", "0.6285054", "0.6285054", "0.62150884", "0.61740327", "0.61366487", "0.61350334", "0.6116982", "0.60951006", "0.60835916", "0.6050043", "0.5965481", "0.5956415", "0.59335893", "0.58849...
0.87228316
0
Return any WMS datasource for a dataproduct.
def dataproduct_wms(self, ows_layer, session): wms_datasource = None # get WMS root layer root_layer = None WmsWfs = self.config_models.model('wms_wfs') query = session.query(WmsWfs).filter_by(ows_type='WMS') # eager load relation query = query.options( ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_datasource_of():\n global datasource_of\n\n if not datasource_of:\n datasource_of = stixhelpers.datasource_of()\n \n return datasource_of", "def get_datasource(self):\n return None", "def get_datasource_list():\n global datasource_list\n\n if not datasource_list:\n ...
[ "0.71008384", "0.6631266", "0.598743", "0.59302306", "0.59302306", "0.59197843", "0.58158386", "0.577935", "0.5589404", "0.55361176", "0.55361176", "0.55361176", "0.55361176", "0.5373815", "0.5368272", "0.52805233", "0.52325875", "0.52294", "0.52106684", "0.5157559", "0.51001...
0.6252136
2
Recursively check if layer is a WMS layer.
def layer_in_ows(self, ows_layer, root_layer): if root_layer is None: # no WMS root layer return False in_wms = False # get parent groups parents = [p.group for p in ows_layer.parents] for parent in parents: if parent.gdi_oid == root_layer.gdi...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_layer(obj):\n # TODO(b/110718070): Replace with isinstance(obj, base_layer.Layer).\n return hasattr(obj, \"_is_layer\") and not isinstance(obj, type)", "def is_feature_layer(layer):\n return getattr(layer, '_is_feature_layer', False)", "def IsLayer(self, *args):\n return _XCAFDoc.XCAFDoc_Layer...
[ "0.69694364", "0.6235193", "0.6218354", "0.593918", "0.5923161", "0.58760947", "0.5860823", "0.5807114", "0.5681459", "0.55938524", "0.5574623", "0.5512457", "0.5449315", "0.54430646", "0.53812546", "0.53716415", "0.53391325", "0.5313924", "0.5287635", "0.52501976", "0.524820...
0.76703054
0
Return ows_metadata for a layer.
def ows_metadata(self, layer): ows_metadata = {} if layer.ows_metadata: try: # load JSON from ows_metadata ows_metadata = json.loads(layer.ows_metadata) except ValueError as e: self.logger.warning( "Invalid JSON...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def dataproduct_metadata(self, ows_layer, permissions, session):\n metadata = {}\n\n # type\n sublayers = None\n data_set_view = None\n searchterms = []\n if ows_layer.type == 'group':\n if ows_layer.name not in permissions.get('group_layers', []):\n ...
[ "0.6738899", "0.62456894", "0.59765214", "0.56073684", "0.5586877", "0.5581771", "0.5532094", "0.5492781", "0.54767776", "0.54743665", "0.5456338", "0.54506356", "0.54184407", "0.53791165", "0.5372126", "0.53449667", "0.53406215", "0.5337875", "0.5326182", "0.5314207", "0.530...
0.81569564
0
Split comma separated values into list.
def split_values(self, value): if value: return [s.strip() for s in value.split(',')] else: return []
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def split_by_comma(s):\n return s.strip().split(\",\")", "def separate_comma(s):\n return s.split(',')", "def to_python(self, value):\n # Return an empty list if no input was given.\n if not value:\n return []\n return value.split(',')", "def pure_list(comma_list):\n ...
[ "0.78025526", "0.76226556", "0.7475591", "0.72795135", "0.7144818", "0.69944984", "0.69677824", "0.6933669", "0.6908274", "0.68442553", "0.6830242", "0.6824286", "0.67987007", "0.67562747", "0.6737418", "0.6710399", "0.67035455", "0.66600406", "0.6642529", "0.6638843", "0.660...
0.8507184
0
Update QML with embedded symbols.
def update_qml(self, qml): if qml is None: return qml try: # parse XML root = ElementTree.fromstring(qml) # embed symbols self.embed_qml_symbols(root, 'SvgMarker', 'name') self.embed_qml_symbols(root, 'SVGFill', 'svgFile') ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def embed_qml_symbols(self, root, layer_class, prop_key):\n for svgprop in root.findall(\".//layer[@class='%s']/prop[@k='%s']\" %\n (layer_class, prop_key)):\n symbol_path = svgprop.get('v')\n path = os.path.abspath(\n os.path.join(QGS_...
[ "0.67538667", "0.5128117", "0.509659", "0.5053252", "0.4964151", "0.49451157", "0.4761072", "0.4732717", "0.47295678", "0.46906155", "0.4686383", "0.46371529", "0.46117783", "0.4515449", "0.4510255", "0.4473232", "0.44729185", "0.44690013", "0.4440391", "0.4439548", "0.443494...
0.76550114
0
Embed symbol resources as base64 in QML.
def embed_qml_symbols(self, root, layer_class, prop_key): for svgprop in root.findall(".//layer[@class='%s']/prop[@k='%s']" % (layer_class, prop_key)): symbol_path = svgprop.get('v') path = os.path.abspath( os.path.join(QGS_RESOURCES_DI...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update_qml(self, qml):\n if qml is None:\n return qml\n\n try:\n # parse XML\n root = ElementTree.fromstring(qml)\n\n # embed symbols\n self.embed_qml_symbols(root, 'SvgMarker', 'name')\n self.embed_qml_symbols(root, 'SVGFill', 'sv...
[ "0.55629766", "0.54794717", "0.5280593", "0.49432886", "0.49401248", "0.48893714", "0.48839408", "0.48512277", "0.48236877", "0.48004314", "0.47988746", "0.47885874", "0.47874668", "0.4764687", "0.47481993", "0.47099677", "0.46938792", "0.46663794", "0.4606227", "0.45966935", ...
0.66117233
0
Change the time unit from epoch time to hours since 1800
def change_time_units(var): century18 = dt.datetime(1800,1,1,0) #for i,j in enumerate(var[:]): # date = dt.datetime.utcfromtimestamp(j) # seconds = (date - century18).total_seconds() # hours = int( seconds / 60 / 60 ) # var[i] = hours def change_unit(date): date = dt.date...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _unit_hr(self):\n return self.time_base * 60.0", "def unit_hr(self):\n return self.time_base * 60.0", "def itow2utc(itow: int) -> datetime.time:\r\n\r\n utc = datetime(1980, 1, 6) + timedelta(seconds=(itow / 1000) - (35 - 19))\r\n return utc.time()", "def epoch_time(when):\n if not...
[ "0.6538163", "0.6491768", "0.6192531", "0.5787748", "0.572735", "0.572301", "0.571299", "0.57039964", "0.5693369", "0.5687686", "0.5628768", "0.56278694", "0.5623892", "0.56043375", "0.5601073", "0.55941534", "0.5590749", "0.55859935", "0.55822754", "0.55742246", "0.555413", ...
0.6157713
3
Adds human readable date variable. Assumes date is in seconds since epoch. time_var is netCDF.Variable object.
def add_utc_date(nc, time_var): # Create Variable utc = nc.createVariable('utc_time', int, ('time')) setattr(utc, 'standard_name', "time") setattr(utc, 'long_name', "UTC date yyyy-mm-dd hh:00:00 as yyyymmddhh") setattr(utc, "units","Gregorian_year month day hour") toUTC = lambda d: int(dt.datet...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def date_info_day(date_str, infile):\n #date_str = str(sys.argv[1])\n #infile = './' + date_str + '.nc'\n\n # prepare date\n year,mon,day = date_str.split('-')\n year_num = int(float(year))\n mon_num = int(float(mon))\n day_num = int(float(day))\n\n\n datesec_calc = []\n val_pr_day = 4\n...
[ "0.53371304", "0.52994335", "0.5053854", "0.5022046", "0.5021961", "0.5021961", "0.50010127", "0.4921834", "0.49154162", "0.48844352", "0.48474166", "0.48312527", "0.4828444", "0.48283142", "0.47912452", "0.47758126", "0.4751266", "0.47495", "0.47279778", "0.46959502", "0.465...
0.63723165
0
Return True if variable has missing start and end
def check_if_reduce_needed(vars_to_modify): for var in vars_to_modify: if len(var.dimensions) > 2 and var[0,0,:].mask.all() and \ var[-1,1,:,:].mask.all(): return True return False
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def isUndefinedRange(program: ghidra.program.model.listing.Program, startAddress: ghidra.program.model.address.Address, endAddress: ghidra.program.model.address.Address) -> bool:\n ...", "def isEmpty(self):\n return self.start == -1 and self.end == -1", "def isValid(self, start, end):\n fo...
[ "0.68972343", "0.6854934", "0.6404567", "0.63445413", "0.62717694", "0.62168694", "0.62168694", "0.6185749", "0.6160765", "0.6113537", "0.6075577", "0.60534394", "0.60275", "0.60223347", "0.5987251", "0.59226704", "0.58350503", "0.5816686", "0.5812118", "0.58019555", "0.57760...
0.0
-1
Adds a time bounds variable to variable. Assumes time dimension is called 'time'
def add_time_bounds(nc, varname): THREE_HOURS = 60*60*3 # in seconds bnds_name = 'time_bnds' bounds_dim = 'nv' # Create bounds dimension nc.createDimension(bounds_dim, 2) # Get variable matching varname time_var = nc.variables['time'] time_var.setncattr('bounds', bnds_name) time_d...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __define_variable_time(self, initial_guess, minimum, maximum):\n i = 0\n for nlp in self.nlp:\n if isinstance(nlp[\"tf\"], self.CX):\n time_bounds = Bounds(minimum[i], maximum[i], interpolation=InterpolationType.CONSTANT)\n time_init = InitialConditions(in...
[ "0.6587515", "0.6190563", "0.5912615", "0.587993", "0.58253014", "0.56894726", "0.56684715", "0.56504494", "0.5623413", "0.5619893", "0.55306077", "0.55090916", "0.5483374", "0.5463484", "0.5454657", "0.5432568", "0.5394258", "0.53902286", "0.53509086", "0.5346871", "0.534403...
0.7952806
0
Changes fill value for all variables in file
def change_fill_value(nc, fill_value): outfile = 'tmp' + str(random.randint(1,100000)) + '.nc' out_nc = copync.copy_dimensions(nc, outfile) copync.copy_variables(nc, out_nc, new_fill_value=fill_value) out_nc.close() return outfile
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def setupVariables(self, file, variables, wordsize):\n file.write(self.getStringForVariables(variables, wordsize) + '\\n')\n return", "def fill(self, file = None):\n\t\tif file == None:\n\t\t\tself.prefill = {}\n\t\telse:\n\t\t\tf = open('sudoku.txt')\n\t\t\tself.prefill = f.read()\n\t\t\tf.close()...
[ "0.63592917", "0.6181873", "0.61443293", "0.6081401", "0.602255", "0.5872441", "0.572699", "0.5706657", "0.5658155", "0.5626804", "0.56069094", "0.55748194", "0.5568049", "0.54713637", "0.5433601", "0.542916", "0.5417756", "0.5386758", "0.5309297", "0.530289", "0.52563107", ...
0.60068417
5
Creates a maze path from current cursor to the finish. The returns true if a path is found, false if not the. NOTE unlike rest of the game, this solution is recusive, adn highlights why NOT to use recursion, as depth errors are encountered easily
def create_solution(self, cursor): self._visited = [cursor.get_current_cell()] try: solved = self._recursive_solve(cursor) except RecursionError as re: logging.warning("No solution found due to recusion limit - this is why we use iterative !!!") solved = Fal...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def maze_solver_rec(maze, start, end):\r\n def find_path(maze, pos, end):\r\n mark(maze, pos)\r\n if pos == end:\r\n print(pos, end=' ')\r\n return True\r\n for i in range(4):\r\n nextp = pos[0]+dirs[i][0], pos[1]+dirs[i][1]\r\n if passable(maze, ...
[ "0.7348416", "0.69578207", "0.68458307", "0.6739615", "0.6575507", "0.6509359", "0.64783865", "0.64704174", "0.63894373", "0.6322013", "0.631913", "0.6312608", "0.62871957", "0.6240864", "0.6233506", "0.6221758", "0.61917", "0.61521137", "0.6146944", "0.61003155", "0.6091624"...
0.0
-1
Use inspect_links to get a list of all the external links in the site
def cleanup_links(path, inspect_links=False): with open(path) as f: text = f.read() # if 'BokehJS does not appear to have successfully loaded' in text: # for k, v in BOKEH_REPLACEMENTS.items(): # text = text.replace(k, v) text = component_links(text, path) soup = BeautifulSoup...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getlinks(url):\n page = Linkfetcher(url)\n page.linkfetch()\n for i, url in enumerate(page):\n print(\"%d ==> %s\" % (i, url))", "def getLinks(self):\n\t\threfs = []\n\t\tfor link in self.bsource.find_all('a'):\n\t\t\threfs.append(link.get('href'))\n\t\treturn hrefs", "def __url_list(self, ...
[ "0.7155601", "0.6977096", "0.6939031", "0.68616354", "0.68225676", "0.6807519", "0.67517316", "0.6705572", "0.6699865", "0.669449", "0.669449", "0.669449", "0.669449", "0.669449", "0.6660218", "0.66458374", "0.6635376", "0.6626044", "0.66240597", "0.6589426", "0.6579488", "...
0.0
-1
Calculate the probability of of creating an offspring with a dominant allele
def calculate_probability(k: int, m: int, n: int) -> float: population = ["AA" for _ in range(k)] + ["Aa" for _ in range(m)] + ["aa" for _ in range(n)] pairings = it.combinations(population, 2) probabilities = [PROBABILITIES[pairing] for pairing in pairings] output = sum(probabilities) / len(probabiliti...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def pr_dominant_offpring(offspring_zygosity):\n\n homozygous_dominant, heterozygous, homozygous_recessive = offspring_zygosity\n\n total = homozygous_dominant + heterozygous + homozygous_recessive\n dominant = homozygous_dominant + heterozygous\n\n pr_dominant = dominant / total\n\n return pr_domina...
[ "0.71508455", "0.7009012", "0.68244606", "0.64912534", "0.63507146", "0.6219815", "0.6198249", "0.61633426", "0.60935193", "0.60492826", "0.60419685", "0.6011867", "0.59874773", "0.59808606", "0.5976723", "0.5940034", "0.59356415", "0.59274435", "0.59157497", "0.589901", "0.5...
0.0
-1
Initialize some callbacks inline Use this constructor to provide credentials and certificate callbacks inline, instead of defining your own class for these ones. You can e.g. also pass in one of the credential objects as 'credentials' instead of creating a function which returns a hardcoded object.
def __init__(self, credentials=None, certificate=None): if credentials is not None: self.credentials = credentials if certificate is not None: self.certificate = certificate
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self, req, credentials_fn):\n self.req = req\n self.credentials_fn = credentials_fn", "def __init__(self, cred=None, max_tries=5, callback=newcred):\n self.set_cred(cred)\n self.try_count = 1\n self.max_tries = max_tries\n self.callback = callback", "def _...
[ "0.65539837", "0.64415884", "0.6256035", "0.6152882", "0.61327577", "0.6122212", "0.60726905", "0.5963776", "0.5948654", "0.5945171", "0.5938793", "0.59084725", "0.59006447", "0.58869493", "0.5884443", "0.5865886", "0.58515286", "0.5847019", "0.57956296", "0.5794808", "0.5778...
0.7311035
0
Progress output callback Override this function with your own progress reporting function
def sideband_progress(self, string):
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def OnProgress(bytes_read, total_bytes, percent):\n sys.stdout.write(\"progress: %.2f%% \\r\" % (percent))\n sys.stdout.flush()", "def reportProgress(self):\n \n pass", "def doProgress(self,progress,message):\n pass", "def progress(self, arg, num_done, info=''):\n pass", "def ge...
[ "0.7794072", "0.7742129", "0.7723824", "0.7527916", "0.727533", "0.7107738", "0.70911974", "0.7045239", "0.70367855", "0.7021728", "0.6993632", "0.69873875", "0.6929215", "0.6918921", "0.6918631", "0.68901145", "0.687302", "0.6857004", "0.6809645", "0.67812383", "0.6764005", ...
0.6427917
57
Credentials callback If the remote server requires authentication, this function will be called and its return value used for authentication. Override it if you want to be able to perform authentication.
def credentials(self, url, username_from_url, allowed_types): raise Passthrough
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def remote_auth(self, auth_info: Optional[Dict[str, str]] = None) -> Dict[str, str]:\n if not self._connected:\n return None\n if auth_info is not None:\n self._remote_auth = auth_info\n return self._remote_auth", "def authenticate_credentials(self, **credentials):\n ...
[ "0.65524274", "0.6089398", "0.58988243", "0.5894323", "0.5894309", "0.5875045", "0.5870578", "0.58598083", "0.58362657", "0.57793766", "0.577223", "0.56979597", "0.56545985", "0.56085044", "0.5590495", "0.5579785", "0.5576196", "0.5566388", "0.55437064", "0.5538214", "0.54772...
0.53605944
27
Certificate callback Override with your own function to determine whether the accept the server's certificate.
def certificate_check(self, certificate, valid, host): raise Passthrough
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def verify_server_certificate(self):\n return self._verify_server_certificate", "def verify_server_certificate(self) -> Optional[pulumi.Input[bool]]:\n return pulumi.get(self, \"verify_server_certificate\")", "def verify_server_certificate(self) -> bool:\n return pulumi.get(self, \"verify_...
[ "0.69057816", "0.6904875", "0.6790211", "0.646486", "0.63657093", "0.61513364", "0.6096049", "0.60317755", "0.5979905", "0.5940069", "0.5871149", "0.58208966", "0.57788336", "0.5753447", "0.57468694", "0.574129", "0.570776", "0.56400156", "0.5629674", "0.56151485", "0.5603868...
0.7030046
0
Transfer progress callback Override with your own function to report transfer progress.
def transfer_progress(self, stats):
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def onTransferUpdate(self, api, transfer):\n logging.info('Transfer update ({} {});'\n ' Progress: {} KB of {} KB, {} KB/s'\n .format(transfer,\n transfer.getFileName(),\n transfer.getTransferredBytes() / 1024,\n...
[ "0.7220874", "0.7112329", "0.69391227", "0.69087076", "0.68912673", "0.6877024", "0.6770549", "0.67233896", "0.67167825", "0.6671872", "0.66329044", "0.6622333", "0.66127753", "0.65370864", "0.65070117", "0.64977056", "0.6437404", "0.6410456", "0.63769513", "0.6359364", "0.63...
0.7890586
0
Update tips callabck Override with your own function to report reference updates
def update_tips(self, refname, old, new):
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __editShowCallTips(self):\n self.activeWindow().callTip()", "def update_tips(self, usageText):\r\n try:\r\n self.widgetList[13].config(text=usageText, justify=LEFT)\r\n except TclError:\r\n kT.debug_log(\"Changed menu\", sys.exc_info()[2])\r\n return", "def...
[ "0.6555432", "0.64051604", "0.5982053", "0.58614695", "0.5771405", "0.570853", "0.5652499", "0.5582469", "0.5555294", "0.5554527", "0.55478805", "0.5545224", "0.5434774", "0.5425506", "0.5390354", "0.5354941", "0.53439796", "0.53439796", "0.53439796", "0.5318367", "0.5292375"...
0.8590424
0
Push update reference callback Override with your own function to report the remote's acceptace or rejection of reference updates.
def push_update_reference(self, refname, message):
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def ref_updated(self, event):\n pass", "def _notify_update(self, cuds_object):", "def notify(self, ref_output=None, moves_made=None):\n pass", "def update_callback(app):\n print(\"Update callback invoked for %s\" % app.name)\n\n # TODO: Add integration tests here\n return True", "def...
[ "0.700554", "0.586919", "0.58252454", "0.55110234", "0.5484074", "0.5471983", "0.5470453", "0.5423666", "0.5410064", "0.53476197", "0.53475934", "0.5346236", "0.5307683", "0.528483", "0.5284799", "0.52797055", "0.5253185", "0.52331346", "0.5220044", "0.5199602", "0.5196633", ...
0.7560829
0
The constructor is for internal use only
def __init__(self, repo, ptr): self._repo = repo self._remote = ptr self._stored_exception = None
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self):\n raise NotImplementedError", "def __init__(self):\n raise NotImplementedError", "def __init__(self):\n raise NotImplementedError", "def __init__(self):\n raise NotImplementedError", "def __init__(self) -> None:\n # TODO: Provide the complete construct...
[ "0.83402354", "0.83402354", "0.83402354", "0.83402354", "0.82908845", "0.8187017", "0.8024304", "0.79844433", "0.7911797", "0.7875458", "0.78700167", "0.78700167", "0.78700167", "0.78700167", "0.78700167", "0.78700167", "0.78700167", "0.78700167", "0.78700167", "0.78700167", ...
0.0
-1
Name of the remote
def name(self): return maybe_string(C.git_remote_name(self._remote))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def remote_hostname(self):\n return pn_connection_remote_hostname(self._impl)", "def get_remote_name(self, file_path: str, remote_name: str):\n if remote_name is None:\n remote_name = os.path.basename(file_path)\n return remote_name", "def getRemoteHost():", "def server_name(s...
[ "0.7341725", "0.7134672", "0.7032486", "0.696617", "0.693461", "0.6897008", "0.68189836", "0.67615247", "0.6744413", "0.67394644", "0.67394644", "0.6712816", "0.67052776", "0.6688957", "0.66647696", "0.65945596", "0.65823656", "0.6563257", "0.65593636", "0.6494698", "0.648166...
0.7960541
0
Url of the remote
def url(self): return maybe_string(C.git_remote_url(self._remote))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def remote_url(self) -> str:\n return f\"https://api.figma.com/v1/files/{self.file_id}\"", "def url(self):\n url = self.url\n return url", "def getRemoteUrl(self):\n # try getting the remote object by unique id\n remote_url = self._getRemoteUrlTheOldWay()\n remote_obj ...
[ "0.7809164", "0.7752618", "0.7744077", "0.76482004", "0.76482004", "0.76167583", "0.7611277", "0.7611277", "0.76024985", "0.7592173", "0.7590239", "0.7567472", "0.75656253", "0.75656253", "0.7537656", "0.7537656", "0.7537656", "0.7537656", "0.7537656", "0.7537656", "0.7537656...
0.7905048
0
Push url of the remote
def push_url(self): return maybe_string(C.git_remote_pushurl(self._remote))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_push_url(self, name, url):\n err = C.git_remote_set_pushurl(self._repo._repo, to_bytes(name), to_bytes(url))\n check_error(err)", "def remote_push(self, pNamespace):", "def push(self):\n origin = self.git_repo.remotes.origin\n origin.push()", "def push(args):\n if args....
[ "0.7094837", "0.6979935", "0.68169296", "0.67966676", "0.66819257", "0.6680206", "0.66366327", "0.6635456", "0.6486271", "0.6448664", "0.64341855", "0.62836725", "0.625129", "0.62458855", "0.62370825", "0.62095743", "0.6193338", "0.61739475", "0.6118299", "0.60442275", "0.602...
0.7172953
0
Save a remote to its repository's configuration.
def save(self): err = C.git_remote_save(self._remote) check_error(err)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def remote_save(self, file_path=None, delete_local=False, remote_target=None):\n if not file_path:\n file_path = self.fname\n\n f = File()\n if not remote_target:\n remote_target = self.remote.get('target', None)\n LOG.info(\"Saving picture %s to %s\" % (file_path,...
[ "0.6913942", "0.6310363", "0.6138643", "0.6070944", "0.5944239", "0.59436154", "0.5880474", "0.58746165", "0.5848079", "0.5820438", "0.57785755", "0.57339436", "0.56392133", "0.56184226", "0.5592695", "0.55855554", "0.5575766", "0.556263", "0.5523025", "0.55052197", "0.548237...
0.78605765
0
Perform a fetch against this remote. Returns a object.
def fetch(self, refspecs=None, message=None, callbacks=None): fetch_opts = ffi.new('git_fetch_options *') err = C.git_fetch_init_options(fetch_opts, C.GIT_FETCH_OPTIONS_VERSION) if callbacks is None: callbacks = RemoteCallbacks() callbacks._fill_fetch_options(fetch_opts) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def fetch(self, remote, *args):\n return self.cmd('fetch', remote, *args)", "def fetch(self) -> Fetch:\n return self._fetch", "def do_fetch(self):\n pass", "def Fetch(self, request, global_params=None):\n config = self.GetMethodConfig('Fetch')\n return self._RunMethod(\n ...
[ "0.80714464", "0.75665337", "0.7185627", "0.7021557", "0.6945869", "0.6904508", "0.6821936", "0.6758298", "0.67004114", "0.67004114", "0.658733", "0.6578733", "0.6369617", "0.6337702", "0.63221866", "0.63072085", "0.62113595", "0.6193085", "0.6188289", "0.61807245", "0.615491...
0.0
-1
Total number of refspecs in this remote
def refspec_count(self): return C.git_remote_refspec_count(self._remote)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def n_refs(self):\n return self._n_refs", "def get_total_rehashes(self):\n return self.count_rehashes", "def __len__(self):\n total_objs = 0\n\n if self._shelve is not None:\n total_objs += len(self._shelve)\n\n if self._dict is not None:\n total_objs +=...
[ "0.6764848", "0.644436", "0.64315546", "0.6388287", "0.63136035", "0.63098884", "0.62839144", "0.62362033", "0.6197885", "0.61837137", "0.6138996", "0.6132474", "0.6095574", "0.6055916", "0.60469747", "0.60452753", "0.6015536", "0.5992", "0.59615195", "0.5940339", "0.5924425"...
0.85212857
0
Return the object at the given position.
def get_refspec(self, n): spec = C.git_remote_get_refspec(self._remote, n) return Refspec(self, spec)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getObjectFromPosition(position):\n for object in self.objects:\n if (int(self.position[0]) == int(object.position[0])) and (int(self.position[1]) == int(object.position[1])):\n return object\n\n return None", "def get_object_...
[ "0.80690587", "0.7702966", "0.75877064", "0.7253439", "0.7253439", "0.711118", "0.70315605", "0.69795954", "0.6899463", "0.6829157", "0.6797154", "0.6665862", "0.66282725", "0.6590538", "0.6577159", "0.65110797", "0.64988065", "0.64636296", "0.64549494", "0.6383208", "0.63799...
0.0
-1
Refspecs that will be used for fetching
def fetch_refspecs(self): specs = ffi.new('git_strarray *') err = C.git_remote_get_fetch_refspecs(specs, self._remote) check_error(err) return strarray_to_strings(specs)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def resolve_references(self):\n self.specs = self._resolve_partial(self.parsed_url, self.specs, ())", "def list_refs(self):\n pass", "def list_defect_refs(self):\n print('-----------\\nDEFECT_REFs\\n-----------')\n self._print_dict(self.defect_refs)", "def refs(self):\n return ...
[ "0.7066698", "0.68261486", "0.6297913", "0.6244789", "0.6160808", "0.60727483", "0.6071554", "0.60701585", "0.60671026", "0.60483557", "0.5974551", "0.59565634", "0.5944758", "0.5904378", "0.58879405", "0.5882945", "0.58410007", "0.58331317", "0.5822716", "0.5815069", "0.5786...
0.64266026
2
Refspecs that will be used for pushing
def push_refspecs(self): specs = ffi.new('git_strarray *') err = C.git_remote_get_push_refspecs(specs, self._remote) check_error(err) return strarray_to_strings(specs)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def list_refs(self):\n pass", "def push_update_reference(self, refname, message):", "def refs(self):\n return self._refs", "def updateScptRefs(self):\n for scpt in self.refs_scpt.keys():\n self.refs_scpt[scpt] = scpt.getRef()\n self.scptRefs = set(self.refs_scpt.values(...
[ "0.6074251", "0.6062355", "0.5899434", "0.5841198", "0.57566303", "0.5702181", "0.56438404", "0.5604831", "0.55328727", "0.5516635", "0.55016184", "0.54588157", "0.54560244", "0.5452985", "0.5420332", "0.53919894", "0.53701526", "0.53461057", "0.5345899", "0.53423005", "0.534...
0.63625705
0
Push the given refspec to the remote. Raises ``GitError`` on protocol error or unpack failure.
def push(self, specs, callbacks=None): push_opts = ffi.new('git_push_options *') err = C.git_push_init_options(push_opts, C.GIT_PUSH_OPTIONS_VERSION) if callbacks is None: callbacks = RemoteCallbacks() callbacks._fill_push_options(push_opts) # Build custom callback ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_push(self, name, refspec):\n\n err = C.git_remote_add_push(self._repo._repo, to_bytes(name), to_bytes(refspec))\n check_error(err)", "def _push(project: Project):\n repo = project.repo\n remote_name = project.config.get('github.remote')\n remote = repo.remote(remote_name)\n resu...
[ "0.75390047", "0.66317374", "0.65131384", "0.6271647", "0.6256484", "0.61509675", "0.60761815", "0.60623205", "0.59913486", "0.5926646", "0.59092313", "0.59082264", "0.5887252", "0.5856967", "0.5835155", "0.58231914", "0.57830864", "0.5763566", "0.57582784", "0.573426", "0.57...
0.6599917
2
Call fn and return the credentials object
def get_credentials(fn, url, username, allowed): url_str = maybe_string(url) username_str = maybe_string(username) creds = fn(url_str, username_str, allowed) credential_type = getattr(creds, 'credential_type', None) credential_tuple = getattr(creds, 'credential_tuple', None) if not credential...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_creds():\n\tcredentials = None\n\tif os.path.exists('token.pickle'):\n\t\twith open('token.pickle', 'rb') as token:\n\t\t\tcredentials = pickle.load(token)\n\t# If there are no (valid) credentials available, let the user log in.\n\tif not credentials or not credentials.valid:\n\t\tif credentials and creden...
[ "0.60266757", "0.59413564", "0.5846529", "0.581955", "0.58150387", "0.58117324", "0.58065265", "0.5805673", "0.57518536", "0.57470065", "0.57216364", "0.5717514", "0.5700105", "0.56918997", "0.56840074", "0.56808466", "0.5680676", "0.5675405", "0.56722444", "0.5664514", "0.56...
0.6949153
0
Create a new remote with the given name and url. Returns a object. If 'fetch' is provided, this fetch refspec will be used instead of the default
def create(self, name, url, fetch=None): cremote = ffi.new('git_remote **') if fetch: err = C.git_remote_create_with_fetchspec(cremote, self._repo._repo, to_bytes(name), to_bytes(url), to_bytes(fetch)) else: err = C.git_remote_create(cremote, self._repo._repo, to_bytes(...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_remote(self, name: str, url: str, **kwargs: Any) -> Remote:\n return Remote.create(self, name, url, **kwargs)", "def fetch(self, remote, *args):\n return self.cmd('fetch', remote, *args)", "def add_fetch(self, name, refspec):\n\n err = C.git_remote_add_fetch(self._repo._repo, to...
[ "0.75323445", "0.65989864", "0.6469159", "0.63439584", "0.6275085", "0.5893828", "0.57484573", "0.5714986", "0.5672253", "0.55887216", "0.5522805", "0.54660064", "0.5437272", "0.5430468", "0.5422879", "0.5369303", "0.5340879", "0.5239376", "0.5218165", "0.52128315", "0.520344...
0.8370093
0
Rename a remote in the configuration. The refspecs in standard format will be renamed. Returns a list of fetch refspecs (list of strings) which were not in the standard format and thus could not be remapped.
def rename(self, name, new_name): if not new_name: raise ValueError("Current remote name must be a non-empty string") if not new_name: raise ValueError("New remote name must be a non-empty string") problems = ffi.new('git_strarray *') err = C.git_remote_rename(...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __gitRenameRemote(self):\n remotes = self.vcs.gitGetRemotesList(self.project.getProjectPath())\n remote, ok = QInputDialog.getItem(\n None,\n self.tr(\"Rename\"),\n self.tr(\"Select a remote repository:\"),\n remotes,\n 0, False)\n if ...
[ "0.63354367", "0.59142274", "0.5644527", "0.5351181", "0.52948046", "0.5238612", "0.5197955", "0.5156204", "0.51546645", "0.51463294", "0.5122313", "0.50963366", "0.509136", "0.50567704", "0.5055112", "0.5046217", "0.5033727", "0.5026965", "0.50152934", "0.50002825", "0.49920...
0.6283107
1
Remove a remote from the configuration All remotetracking branches and configuration settings for the remote will be removed.
def delete(self, name): err = C.git_remote_delete(self._repo._repo, to_bytes(name)) check_error(err)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __gitRemoveRemote(self):\n remotes = self.vcs.gitGetRemotesList(self.project.getProjectPath())\n remote, ok = QInputDialog.getItem(\n None,\n self.tr(\"Remove\"),\n self.tr(\"Select a remote repository:\"),\n remotes,\n 0, False)\n if ...
[ "0.70583093", "0.6800985", "0.66090995", "0.6535535", "0.6374104", "0.61728114", "0.6059473", "0.59848565", "0.59562194", "0.5875511", "0.58684534", "0.58503515", "0.57999897", "0.57549345", "0.5706319", "0.56782377", "0.5565795", "0.55190265", "0.55089784", "0.54649514", "0....
0.53543514
24
Set the URL for a remote
def set_url(self, name, url): err = C.git_remote_set_url(self._repo._repo, to_bytes(name), to_bytes(url)) check_error(err)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def setRemoteUrl(self, value, **kwargs):\n if value:\n value = urlparse.urlunparse(urlparse.urlparse(value))\n self.getField('remoteUrl').set(self, value, **kwargs)", "def _set_url(self): \n self.url = self.geturl()", "def set_url(self, url):\n self.url = url", "def ...
[ "0.84798807", "0.7785831", "0.75199544", "0.7435115", "0.74106765", "0.73305047", "0.72442555", "0.6981874", "0.6786525", "0.67801994", "0.67682236", "0.67159164", "0.67159164", "0.67159164", "0.67159164", "0.67159164", "0.67159164", "0.67159164", "0.6587842", "0.65743047", "...
0.75991076
2
Set the pushURL for a remote
def set_push_url(self, name, url): err = C.git_remote_set_pushurl(self._repo._repo, to_bytes(name), to_bytes(url)) check_error(err)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def git_remote_url(self, git_remote_url):\n self._git_remote_url = git_remote_url", "def push_url(self):\n\n return maybe_string(C.git_remote_pushurl(self._remote))", "def setRemoteUrl(self, value, **kwargs):\n if value:\n value = urlparse.urlunparse(urlparse.urlparse(value))\n ...
[ "0.72324055", "0.71841437", "0.69710207", "0.66419417", "0.6640427", "0.6405677", "0.61682636", "0.6008587", "0.5950349", "0.5879518", "0.5878566", "0.5850352", "0.5836166", "0.5828629", "0.58109", "0.5789106", "0.57801384", "0.5705603", "0.5705531", "0.5667261", "0.56259835"...
0.77281153
0
Add a fetch refspec (str) to the remote
def add_fetch(self, name, refspec): err = C.git_remote_add_fetch(self._repo._repo, to_bytes(name), to_bytes(refspec)) check_error(err)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_push(self, name, refspec):\n\n err = C.git_remote_add_push(self._repo._repo, to_bytes(name), to_bytes(refspec))\n check_error(err)", "def fetch_pull(ref):\n origin.fetch(tags=True)\n repo.git.checkout(\"{}\".format(ref))\n repo.git.pull(\"origin\", \"{}\".fo...
[ "0.65405554", "0.63312775", "0.5966933", "0.57998365", "0.5740081", "0.5735921", "0.57280624", "0.57224613", "0.5703283", "0.56584454", "0.56575096", "0.5571788", "0.55627555", "0.55626905", "0.5540516", "0.548836", "0.5485281", "0.5485032", "0.5458031", "0.54532164", "0.5430...
0.8219534
0
Add a push refspec (str) to the remote
def add_push(self, name, refspec): err = C.git_remote_add_push(self._repo._repo, to_bytes(name), to_bytes(refspec)) check_error(err)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_fetch(self, name, refspec):\n\n err = C.git_remote_add_fetch(self._repo._repo, to_bytes(name), to_bytes(refspec))\n check_error(err)", "def cmd_push_review(remote):\n return ['git', 'push', remote]", "def _git_add(repo, path, contents='example!\\n'):\n path.write_text(contents)\n ...
[ "0.68458635", "0.6618803", "0.6397485", "0.627628", "0.61030674", "0.6059851", "0.6020045", "0.60113615", "0.59857327", "0.59671175", "0.5963221", "0.59560585", "0.59545165", "0.59238607", "0.5921502", "0.5911289", "0.58821833", "0.5830431", "0.5815642", "0.5809405", "0.58039...
0.7897243
0
Downloads the 6B GloVe embeddings (approx. 1GB)
def download_glove (): # Get the URL ... print("Downloading https://nlp.stanford.edu/data/glove.6B.zip ...") res = requests.get("https://nlp.stanford.edu/data/glove.6B.zip", stream=True) if res.status_code != 200: print("Could not download the 6B GloVe Dataset! The server responded with code " + res.status_...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_glove_embedding():\n embedding = {}\n N = 400_000\n print(\"Reading glove embedding...\")\n with open(GLOVE_EMBD_PATH, \"rb\") as f:\n for line in tqdm(f, total=N):\n line = line.decode().split()\n word = line[0].lower()\n vector = np.array(line[1:]).asty...
[ "0.7076395", "0.64558613", "0.6354679", "0.61358154", "0.61284745", "0.60184133", "0.6010079", "0.59805787", "0.5972328", "0.59562606", "0.5899516", "0.5830953", "0.57806957", "0.5730951", "0.5724267", "0.57074106", "0.5684446", "0.5642139", "0.5635222", "0.5618081", "0.56131...
0.7243812
0
Runs the Stanza module
def run_stanza (arguments): if arguments.download: # Download the full Stanza dataset result = input("ATTENTION! This will download the full English Stanza corpus (approx. 400 MB). Do you wish to continue (y/n)? ") if result == "y" or result == "yes": # For a list of processors, see https://stanford...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def run():\n main()", "def run(self, args):\n pass", "def main():\n\ttoken = os.getenv(\"BOT_TOKEN\")\n\tapplication = Application.builder().token(token).read_timeout(30).write_timeout(30).build()\n\tload_interactions(application)\n\tprint(\"Simple Media Converter instance started!\")\n\tapplication....
[ "0.6028765", "0.59991264", "0.5996253", "0.5902331", "0.5847812", "0.58472365", "0.58472365", "0.58472365", "0.58472365", "0.58472365", "0.58472365", "0.58472365", "0.58472365", "0.58472365", "0.58472365", "0.58472365", "0.58472365", "0.58472365", "0.58472365", "0.58472365", ...
0.6173642
0
Runs the GloVe module
def run_glove (arguments): if arguments.download: # Download the 6B GloVe dataset result = input("ATTENTION! This will download approximately 1GB of data. Do you wish to continue (y/n)? ") if result == "y" or result == "yes": download_glove() sys.exit(0) # Afterwards exit normally
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def main():\n obj = VplexStorageview()\n obj.perform_module_operation()", "def main():\n\timport docopt\n\targs = docopt.docopt(main.__doc__)\n\tv = Ventilator(args[\"--port\"], int(args[\"--speed\"]))\n\tif args[\"--debug\"]:\n\t\tlogging.basicConfig(level=logging.DEBUG)\n\telse:\n\t\tlogging.basicConfig(...
[ "0.6183873", "0.61158395", "0.6082892", "0.60333556", "0.5949687", "0.59383035", "0.5913861", "0.58946764", "0.5856102", "0.58391666", "0.58317477", "0.5813667", "0.5773393", "0.5761071", "0.57519263", "0.5735813", "0.5703431", "0.56931114", "0.569222", "0.569222", "0.5691295...
0.6541627
0
Runs the Data module
def run_data (arguments): if arguments.define_labels: data.define_labels() elif arguments.preprocess: # Preprocess from data_raw --> data_preprocessed data.preprocess() elif arguments.annotate: # Annotate from data_preprocessed --> data_annotated reverse = False # DEBUG annotator.annotate(...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def run(self):\n\t\tself.print_header_information()\n\n\t\t#self.get_number_of_instances_from_user()\n\n\t\t#self.compile_dataframe(self.number_of_instances)\n\n\t\tprint \"\\n{}\".format(self.data)\n\n\t\t# Uncomment these lines for debugging\n\t\tself.compile_dataframe_default()\n\t\t# print \"\\n{}\".format(sel...
[ "0.7152246", "0.6843876", "0.6765248", "0.66976744", "0.66915", "0.6601861", "0.6464472", "0.64639926", "0.6440317", "0.6437759", "0.64203024", "0.6409332", "0.6399841", "0.63861287", "0.63166547", "0.6303447", "0.6303447", "0.6303447", "0.6303447", "0.6303447", "0.6303447", ...
0.6965196
1
Runs the Model module
def run_model (arguments): if arguments.train is not None: # Train a new model, optionally with a certain number of epochs predictor = None if len(arguments.train) > 0: predictor = train(n_epochs=arguments.train[0]) else: predictor = train() # Afterwards save it now = datetime.now(...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def RunModel(self):\n raise UnimplementedMethodException()", "def _doRun(self, model: Model):\n raise Exception(\"Not implemented\")", "def run(self) -> None:\n self.model = self.trainer.train_model(self.model, self.data)", "def run():\n print('*-----------------------------------*')...
[ "0.74780583", "0.74485666", "0.7332655", "0.6933836", "0.6836743", "0.6831378", "0.68108004", "0.67838705", "0.67409885", "0.6730487", "0.6706073", "0.6684699", "0.6684699", "0.6684699", "0.6684699", "0.6684699", "0.6632394", "0.66102797", "0.6589398", "0.6587255", "0.6561436...
0.6601213
18
Starts up a console to interact with a predictor.
def tinker (predictor): col_size = predictor.max_label_length() while True: try: sentence = input('\nEnter a sentence to classify ("exit" to quit): ') if sentence == 'exit': print("Goodbye!") sys.exit(0) print("") results = predictor.predict(sentence) print(f"Index ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def console():\n start_console()", "def start_console(self):\n return", "def main():\n print_title()\n run_terminal()", "def console():\r\n while True:\r\n interpret_command(input(\"POM> \"))", "def interactive_shell(model):\n model.logger.info(\"\"\"\nThis is an interactive mo...
[ "0.7140405", "0.67129403", "0.66399276", "0.66183984", "0.6476843", "0.6476411", "0.64149994", "0.6340279", "0.6307932", "0.61199385", "0.609409", "0.6075318", "0.60666025", "0.59807616", "0.5940575", "0.5931328", "0.5929386", "0.5908151", "0.5894459", "0.58894145", "0.588659...
0.0
-1
x.__init__(...) initializes x; see x.__class__.__doc__ for signaturex.__init__(...) initializes x; see x.__class__.__doc__ for signaturex.__init__(...) initializes x; see x.__class__.__doc__ for signature
def __init__(self,*args): pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self, *args, **kwargs): # real signature unknown; restored from __doc__\n pass", "def __init__(self, *args, **kwargs): # real signature unknown\n pass", "def __init__(self, *args, **kwargs): # real signature unknown\n pass", "def __init__(self, *args, **kwargs): # real signa...
[ "0.7274706", "0.72482175", "0.72482175", "0.72482175", "0.711465", "0.711465", "0.711465", "0.711465", "0.711465", "0.711465", "0.711465", "0.711465", "0.711465", "0.711465", "0.711465", "0.711465", "0.711465", "0.711465", "0.711465", "0.711465", "0.711465", "0.711465", "...
0.0
-1
tests where symbols are looked up properly
def test_symbol_lookup(self): def check_lookup(symbol, expected): op = BaseWhereOperator.get_operator(symbol) self.assertEqual(op, expected) check_lookup('EQ', EqualsOperator) check_lookup('IN', InOperator) check_lookup('GT', GreaterThanOperator) check_l...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_symbol_lookup(self):\r\n\r\n def check_lookup(symbol, expected):\r\n op = BaseWhereOperator.get_operator(symbol)\r\n self.assertEqual(op, expected)\r\n\r\n check_lookup('EQ', EqualsOperator)\r\n check_lookup('IN', InOperator)\r\n check_lookup('GT', Greater...
[ "0.7615396", "0.68382215", "0.6708252", "0.659964", "0.64436066", "0.6381638", "0.63209176", "0.6301587", "0.6294034", "0.62852746", "0.62724996", "0.62620026", "0.61632264", "0.61437625", "0.6124064", "0.61073846", "0.6088397", "0.6071878", "0.60535747", "0.60304224", "0.602...
0.7542443
1
tests symbols are rendered properly
def test_operator_rendering(self): self.assertEqual("=", six.text_type(EqualsOperator())) self.assertEqual("IN", six.text_type(InOperator())) self.assertEqual(">", six.text_type(GreaterThanOperator())) self.assertEqual(">=", six.text_type(GreaterThanOrEqualOperator())) self.asser...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_greek(self):\r\n self.assertEquals(preview.latex_preview('pi'), r'\\pi')", "def test_assembleNormal(self):\n self.assertEqual(irc.assembleFormattedText(A.normal[\"hello\"]), \"\\x0fhello\")", "def test_metrics_symmetry(self):\n font = robofab.world.OpenFont(self.operator.path)\n\n...
[ "0.6552125", "0.6234604", "0.623234", "0.62025", "0.61964214", "0.61918604", "0.6165361", "0.61635154", "0.61174566", "0.6103421", "0.6103421", "0.6051215", "0.6034262", "0.6032363", "0.60313624", "0.60218436", "0.6020844", "0.5986874", "0.59701574", "0.59653497", "0.59608334...
0.54867905
92
matrix_set_diag operator implemented in numpy. Returns a numpy array with the diagonals of input array replaced with the provided diagonal values.
def matrix_set_diag(input_np, diagonal, k=0, align="RIGHT_LEFT"): out = np.array(input_np, copy=True) cols = input_np.shape[-1] rows = input_np.shape[-2] onlyOneDiagonal = True if isinstance(k, (tuple, list)): if len(k) < 2 or k[0] == k[1]: k = k[0] else: on...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_diag(x, new_diag):\n arr_shape = x.shape\n off_diag = (1 - _torch.eye(arr_shape[-1])) * x\n diag = _torch.einsum(\"ij,...i->...ij\", _torch.eye(new_diag.shape[-1]), new_diag)\n return diag + off_diag", "def set_mat_diag(mat, diag=0, val=0):\n m = mat.shape[0]\n step = m + 1\n start =...
[ "0.74522567", "0.7357435", "0.71183485", "0.67566574", "0.6728996", "0.6719767", "0.65984404", "0.65970296", "0.6580404", "0.65264386", "0.65135664", "0.64551324", "0.64260054", "0.6417673", "0.63621813", "0.6301156", "0.62709117", "0.62459886", "0.6244929", "0.6234028", "0.6...
0.7570219
0
Calculates the position that the robot should go to in order to grab the can
def make_goal(self): # TODO: prevent calculating positions too close to a wall # TODO: visualize this process better # TODO: publish goal in map frame to prevent errors if the robot moves in time global ms rospy.loginfo('Calculating navigation goal') if self.objective =...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getRobotPosition(self):\n return self.position", "def getRobotPosition(self):\n return self.position", "def getMovement(self):\n # store the robot's current location and set the directional movement to 0,0 so that the robot won't move by default\n currentLocation = (self.me['x']...
[ "0.69911605", "0.69911605", "0.6852636", "0.67995936", "0.67995936", "0.67509824", "0.67409366", "0.6737135", "0.6691059", "0.6644769", "0.64602256", "0.6424652", "0.6421678", "0.6356969", "0.6341534", "0.6329218", "0.63217485", "0.62897986", "0.62783897", "0.62641644", "0.62...
0.0
-1
A python generator function to create a list of points to try visiting.
def generate_points(self, userdata): # TODO: generate along multiple axes x, y, _ = userdata.initial_point x, y = 0, 0 i = 0 for _ in range(self.num_points): point = PointStamped() point.header.frame_id = "map" point.point.x = x + i * self.spa...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def points_generator(self):\n rows, cols = self.game.board.board_size\n points = [Point(i, j) for i, j in product(range(rows), range(cols))]\n for point in points:\n yield point", "def __iter__(self):\n for point in self.points:\n yield point", "def iter_points...
[ "0.76917976", "0.73582846", "0.7342994", "0.69955987", "0.6941514", "0.67175186", "0.67048067", "0.65479225", "0.6507981", "0.6483514", "0.6348818", "0.63456964", "0.6335949", "0.6255297", "0.62488467", "0.62213814", "0.6162217", "0.6159257", "0.61049867", "0.61001927", "0.60...
0.65718514
7
Handles the update of a standard pre computed function.
def standard_handler(args_dict: dict): color_sequence = args_dict['color_sequence'] step = args_dict['step'] # Updating step for the next iteration. args_dict['step'] = (step + 1) % args_dict['sequence_len'] return color_sequence[step]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def precalculate():\n pass", "def precalculate():\n pass", "def update_fn(self, x, t):\n pass", "def update_normalization_function(self):\n self._cache[\"input\"][\"function\"] = self.function.currentText()\n\n indices = range(5, 10)\n\n # If the function is a spline, then i...
[ "0.70787203", "0.70787203", "0.6705146", "0.65600014", "0.6420105", "0.6341481", "0.6067209", "0.59551567", "0.5861058", "0.5829065", "0.5824679", "0.5819529", "0.5812678", "0.5810944", "0.5807107", "0.5793102", "0.57898974", "0.57892376", "0.57845485", "0.5782907", "0.574194...
0.0
-1
The stream effect has the colors of the LEDs move like a stream, where the color of a LEDs is given to its neighbor in the next update step.
def stream_handler(args_dict: dict): color_sequence = args_dict['color_sequence'] color_seq_len = args_dict['color_seq_len'] color_itr = args_dict['color_itr'] n_leds = args_dict['n_leds'] step_sequence = [color_sequence[c % color_seq_len] for c in range(color_itr, n_leds + color_itr)] # Upda...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def show(self):\n\t\tself.processQueue()\n\t\tself.flattenLayers()\n\t\tcount = 0\n\t\tfor v in self.ledsColorBuffer:\n\t\t\tself.strip.setPixelColor(count, v)\n\t\t\tcount += 1\n\t\tself.strip.show()", "def demo(self):\n self.clear()\n\n white = neo.Color(255, 255, 255)\n black = neo.Color(...
[ "0.6599297", "0.65627533", "0.6331775", "0.62021", "0.6179241", "0.61761546", "0.6153618", "0.59917074", "0.59736294", "0.59636015", "0.5950049", "0.59427375", "0.5905459", "0.5854121", "0.58495724", "0.5800509", "0.57976097", "0.5783879", "0.577515", "0.57635885", "0.5758384...
0.67854285
0
Handles the update of a wave function.
def wave_handler(args_dict: dict): color_sequence = args_dict['color_sequence'] wave = args_dict['wave'] color_delay = args_dict['color_delay'] n_leds = args_dict['n_leds'] delay_itr = args_dict['delay_itr'] color_itr = args_dict['color_itr'] step_sequence = [] color_seq_len = args_di...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update(self):\n\n if self._old:\n # delete wave from last update cycle\n self._pi.wave_delete(self._old)\n self._old = None\n\n # show power state\n self._pi.write(pins.Q4, self._state.powered)\n\n # update wave\n if self._state.ready:\n ...
[ "0.6819183", "0.6701062", "0.63038915", "0.62662625", "0.62470883", "0.6141726", "0.61200964", "0.59765255", "0.5942967", "0.58980507", "0.5840194", "0.58309966", "0.579967", "0.579967", "0.57926077", "0.57561326", "0.5737451", "0.5725876", "0.57178116", "0.5711229", "0.56968...
0.5560634
28
The breathe effect is comprised of all LEDs changing intensity in a sinusoidal manner, imitating an inflating balloon.
def breathe_handler(args_dict: dict): color_sequence = args_dict['color_sequence'] wave = args_dict['wave'] color_delay = args_dict['color_delay'] n_leds = args_dict['n_leds'] delay_itr = args_dict['delay_itr'] color_itr = args_dict['color_itr'] color_seq_len = args_dict['color_seq_len'] ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async def breathe(self, params):\n intensity = params.get('intensity', 255)\n wait_ms = params.get('wait_ms', 2)\n try:\n while True:\n await self.lights.breathe(intensity, wait_ms=wait_ms)\n except KeyboardInterrupt:\n pass", "def high_bri(self):\...
[ "0.6964535", "0.6239078", "0.6162239", "0.60917026", "0.60406834", "0.59964126", "0.5932551", "0.58437055", "0.58312666", "0.57445794", "0.5697897", "0.5670556", "0.5610512", "0.55797124", "0.5572094", "0.5562731", "0.55571395", "0.55501294", "0.5548731", "0.55295014", "0.551...
0.6069812
4
Setup step for build classes, in which they compute any of the values that are constant across simulation timesteps.
def pre_build(cls, ops, signals, rng): logger.debug("===================") logger.debug("PRE BUILD %s", ops) logger.debug("sets %s", [op.sets for op in ops]) logger.debug("incs %s", [op.incs for op in ops]) logger.debug("reads %s", [op.reads for op in ops]) logger.debug(...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def build_step(self):\n\n pass", "def setUpClass(self):\n self.tmin, self.tmax, self.dt = (0, 10.0, 0.1)\n self.start = { 'x' : 100.0, 'y' : 100.0, 'z' : 100.0,\n 'psi' : 30.0, 'theta' : 0.0, 'phi' : 0.0,\n 'v': 1.0, 'weight' : 100.0, 'fuel' : 100....
[ "0.614566", "0.61346555", "0.6083438", "0.6083438", "0.6077321", "0.60715204", "0.59854054", "0.5961216", "0.5942173", "0.5899589", "0.5819842", "0.580994", "0.5805824", "0.5779355", "0.5774248", "0.5766029", "0.5758788", "0.5754554", "0.57363355", "0.5700088", "0.5699738", ...
0.0
-1
Build the computations implementing a single simulator timestep.
def build(cls, ops, signals): logger.debug("===================") logger.debug("BUILD %s", ops) if ops not in cls.op_builds: raise BuildError("Operators build has not been initialized " "(missed pre-build step)") output = cls.op_builds[ops].bui...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def build(self):\n #print('ntimes=%s nelements=%s ntotal=%s' % (self.ntimes, self.nelements, self.ntotal))\n #print('self.IDs', self.data)\n self.itime = 0\n self.ielement = 0\n self.itotal = 0\n\n assert self.ntimes > 0, 'ntimes=%s' % self.ntimes\n assert self.nele...
[ "0.6338849", "0.6307557", "0.6180494", "0.61792386", "0.6127942", "0.6053869", "0.6036666", "0.5997529", "0.5973617", "0.5908682", "0.59040534", "0.5851188", "0.5851188", "0.5825474", "0.5798762", "0.57727605", "0.57400477", "0.5735636", "0.5731924", "0.57221514", "0.57075906...
0.0
-1
A decorator for adding a class to the build function registry.
def register(cls, nengo_op): def register_builder(build_class): if not issubclass(build_class, OpBuilder): warnings.warn("Build classes should inherit from OpBuilder") if nengo_op in cls.builders: warnings.warn("Operator '%s' already has a builder. " ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def extension(klass):\n registry.register(klass)\n return klass", "def register(name):\n def func(cls):\n \"\"\"\n See register\n \"\"\"\n REGISTRY[name] = cls()\n return cls\n return func", "def setup_callable_class(builder: IRBuilder) -> None:\n # Check to se...
[ "0.6521618", "0.6413174", "0.6319414", "0.62337", "0.62155426", "0.60622054", "0.60152584", "0.59121466", "0.59074944", "0.5901764", "0.5901582", "0.58695376", "0.5853394", "0.5813251", "0.5687428", "0.56729025", "0.5658591", "0.5650654", "0.56480503", "0.56203526", "0.562035...
0.5497395
29
This function builds whatever computations need to be executed in each simulation timestep.
def build_step(self, signals): raise BuildError("OpBuilders must implement a `build_step` function")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def make_simulations(self):\n pass", "def step(self, actions):\n\n representative_data = []\n original_data = []\n\n actions = np.array(actions).reshape(3, -1)\n\n for np_data, df_data, calculator, som, action in zip(self.np_data_list, self.df_data_list, self.calculators, self....
[ "0.64679617", "0.62343687", "0.61193407", "0.60880333", "0.6070247", "0.6005587", "0.59664106", "0.5957791", "0.59144515", "0.5898824", "0.58904433", "0.5888304", "0.587554", "0.5850894", "0.5832759", "0.5809431", "0.57444245", "0.5740893", "0.5739802", "0.57186806", "0.57119...
0.0
-1
Init the python user log
def init_log(): log_op = LogOp() log_op.config_log(logging.DEBUG)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def user_init(self):\n pass", "def startLogFiles():\n #global techLog\n global userl\n _generic_startLogFiles(True)", "def init_log():\n os.system('rm -rf /target/testdriver.log || true')\n os.system('touch /target/testdriver.log')\n os.system(f\"chown {uid_gid_output} /target/testdriv...
[ "0.70920324", "0.6949306", "0.6900478", "0.6739623", "0.6732682", "0.66928965", "0.6689308", "0.66476536", "0.6639534", "0.6600425", "0.6592752", "0.64675075", "0.64674103", "0.64523363", "0.64106053", "0.63840264", "0.6368207", "0.63438475", "0.63296264", "0.63265544", "0.63...
0.63439995
17
Retrieve al cursos from graph
def get_cursos(request): if request.method == 'GET': cursos = Curso.nodes.all() cursos_list = [] for i in range(0, len(cursos)): cursos_list.append(cursos[i].__dict__["nombre"]) return JsonResponse({"cursos": cursos_list})
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _get_full_graph(self):", "def graph(self):\n ...", "def download_chicago_graph():\n\n\tG = ox.graph_from_place(\"Chicago,IL, United States\", network_type='drive')\n\treturn G", "def getData(graph, request):\r\n results = list(graph.query(request))\r\n return results", "def get_graph(self)...
[ "0.60265046", "0.5684899", "0.5633646", "0.56242675", "0.5566034", "0.5564065", "0.55356544", "0.55326086", "0.5355961", "0.53407145", "0.5306177", "0.5233318", "0.52299714", "0.51916367", "0.51910627", "0.5189231", "0.51728517", "0.5166251", "0.5166251", "0.51599175", "0.515...
0.57523143
1
Retrieve al cursos from graph
def get_curso_fecha_inicio(request): if request.method == 'GET': serializer = CursoSerializer(data=request.data) if serializer.is_valid(): serializer.save() if "curso" in serializer.validated_data: try: curso = Curso.nodes.get(nombre__icont...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _get_full_graph(self):", "def get_cursos(request):\n if request.method == 'GET':\n cursos = Curso.nodes.all()\n cursos_list = []\n for i in range(0, len(cursos)):\n cursos_list.append(cursos[i].__dict__[\"nombre\"])\n return JsonResponse({\"cursos\": cursos_list})", ...
[ "0.60265046", "0.57523143", "0.5684899", "0.5633646", "0.56242675", "0.5566034", "0.5564065", "0.55356544", "0.55326086", "0.5355961", "0.53407145", "0.5306177", "0.5233318", "0.52299714", "0.51916367", "0.51910627", "0.5189231", "0.51728517", "0.5166251", "0.5166251", "0.515...
0.0
-1
Retrieve al cursos from graph
def get_curso_inscripcion(request): if request.method == 'GET': serializer = CursoSerializer(data=request.data) if serializer.is_valid(): serializer.save() if "curso" in serializer.validated_data: try: curso = Curso.nodes.get(nombre__iconta...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _get_full_graph(self):", "def get_cursos(request):\n if request.method == 'GET':\n cursos = Curso.nodes.all()\n cursos_list = []\n for i in range(0, len(cursos)):\n cursos_list.append(cursos[i].__dict__[\"nombre\"])\n return JsonResponse({\"cursos\": cursos_list})", ...
[ "0.60265046", "0.57523143", "0.5684899", "0.5633646", "0.56242675", "0.5566034", "0.5564065", "0.55356544", "0.55326086", "0.5355961", "0.53407145", "0.5306177", "0.5233318", "0.52299714", "0.51916367", "0.51910627", "0.5189231", "0.51728517", "0.5166251", "0.5166251", "0.515...
0.0
-1
Retrieve al cursos from graph
def get_curso_prerequisitos(request): if request.method == 'GET': serializer = CursoSerializer(data=request.data) if serializer.is_valid(): serializer.save() if "curso" in serializer.validated_data: try: curso = Curso.nodes.get(nombre__icon...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _get_full_graph(self):", "def get_cursos(request):\n if request.method == 'GET':\n cursos = Curso.nodes.all()\n cursos_list = []\n for i in range(0, len(cursos)):\n cursos_list.append(cursos[i].__dict__[\"nombre\"])\n return JsonResponse({\"cursos\": cursos_list})", ...
[ "0.60265046", "0.57523143", "0.5684899", "0.5633646", "0.56242675", "0.5566034", "0.5564065", "0.55356544", "0.55326086", "0.5355961", "0.53407145", "0.5306177", "0.5233318", "0.52299714", "0.51916367", "0.51910627", "0.5189231", "0.51728517", "0.5166251", "0.5166251", "0.515...
0.0
-1
This method returns database object.
def get_db(self): self.logger.info('in get_db()') try: return self.client[self.db_name] except Exception as e: self.logger.error(f'Error occurred while getting client {e}')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def db(self) -> Database:\n return self.impl.db", "def db(self):\n return DbManager(self)", "def _get_db(self):\n return DB(\n ClientStorage.ClientStorage((self.server, self.port))\n )", "def get_db(self):\n return self._db", "def get_db():\n # this is a bit...
[ "0.86168927", "0.8025105", "0.79949725", "0.7977423", "0.79444736", "0.7923698", "0.77936614", "0.77742386", "0.7715764", "0.77024984", "0.7693181", "0.76827276", "0.76591754", "0.76430446", "0.7642511", "0.7626138", "0.7614707", "0.7599347", "0.7566285", "0.7554123", "0.7538...
0.70857936
78
This method saves single record.
def save_single_record(self, record, collection_name): try: self.logger.info('in save_single_record()') collection = self.get_db()[collection_name] record_id = collection.insert_one(record) self.logger.info('out save_single_record()') return record_id ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def save(self, record):\n self.collection.insert(record)\n self.record = record\n\n return self", "def save_record(record):\n record. save_details()", "def save(self, record):\n pass", "def save(self):\n if self.id:\n self.update()\n else:\n self...
[ "0.76350296", "0.75677395", "0.7516946", "0.74222285", "0.7256106", "0.7197828", "0.7089604", "0.70852476", "0.70795155", "0.7063954", "0.70558286", "0.7047323", "0.704174", "0.7036781", "0.70347714", "0.7025638", "0.7003997", "0.7003997", "0.6996204", "0.6996204", "0.6996204...
0.71013534
6
This method saves multiple record.
def save_multiple_records(self, records, collection_name): try: self.logger.info('in save_multiple_records()') collection = self.get_db()[collection_name] record_ids = collection.insert_many(records) self.logger.info('out save_multiple_records()') ret...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def save_all(self, obj_list):\n\n for obj in obj_list:\n self.save(obj)", "def save_all(self):\r\n for index in range(self.count()):\r\n self.save(index)", "def save(self, values):", "def save_many(self, reports: List[Report]):\n for report in reports:\n ...
[ "0.7074574", "0.6988772", "0.69310373", "0.66361165", "0.6571776", "0.6490498", "0.64761966", "0.64698094", "0.63603204", "0.6359975", "0.6303776", "0.628135", "0.6271079", "0.6242702", "0.62330705", "0.6218874", "0.6204224", "0.6177481", "0.6177481", "0.6177481", "0.6158188"...
0.6909438
3
This method returns single record.
def get_record(self, collection_name, filter): try: self.logger.info('in get_record()') collection = self.get_db()[collection_name] record = collection.find_one(filter) self.logger.info('in get_record()') return record except Exception as e: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def single(self):\n records = list(self)\n num_records = len(records)\n if num_records == 0:\n raise ResultError(\"Cannot retrieve a single record, because this result is empty.\")\n elif num_records != 1:\n raise ResultError(\"Expected a result with a single recor...
[ "0.77948505", "0.74141467", "0.71552324", "0.7137933", "0.7098952", "0.70341307", "0.6938491", "0.6912008", "0.6770571", "0.67072624", "0.66781634", "0.664886", "0.6641641", "0.66205245", "0.6617445", "0.66103", "0.6580788", "0.6577504", "0.65559554", "0.6552827", "0.6549993"...
0.73423696
2
This method updates record.
def update_record(self, collection_name, update_record, update_condition): try: self.logger.info('in update_record()') collection = self.get_db()[collection_name] collection.update_one(update_condition, {"$set": update_record}) self.logger.info('out update_record(...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update(self):\n self.getDbRecord().update()", "def test_update_record(self):\n pass", "def update(self, record):\n record = dict_for_mongo(record)\n id_dict = {'_id': self.record['_id']}\n self.collection.update(id_dict, {'$set': record})\n\n # Set record to the la...
[ "0.7799289", "0.72846174", "0.7275487", "0.7256945", "0.7204704", "0.7160709", "0.7111528", "0.7063098", "0.70586115", "0.7034917", "0.6997285", "0.69445753", "0.68872887", "0.6810321", "0.67267716", "0.67267716", "0.6694292", "0.668465", "0.66819084", "0.66540956", "0.665283...
0.7225001
4
This method deletes record.
def delete_record(self, collection_name, delete_condition): try: self.logger.info('in delete_record()') collection = self.get_db()[collection_name] collection.delete_one(delete_condition) self.logger.info('out delete_record()') except Exception as e: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def delete_record(self, record_id):\r\n self.record.deleteObject(id=record_id)", "def delete_record(records):\n delete_record()", "def delete_record(self):\r\n try:\r\n db.session.delete(self)\r\n db.session.commit()\r\n return {\"error\": False}\r\n exc...
[ "0.8355644", "0.7927568", "0.7882613", "0.78776604", "0.78410935", "0.7828673", "0.77133566", "0.74574685", "0.7367979", "0.73655236", "0.73345995", "0.72475743", "0.71694946", "0.7153106", "0.70947415", "0.70702696", "0.70161307", "0.70099473", "0.7000162", "0.69995856", "0....
0.72149444
12
This method return multiple record.
def get_records(self, collection_name,num_records): try: self.logger.info('in get_records()') collection = self.get_db()[collection_name] records = collection.find().limit(num_records) self.logger.info('out get_records()') return records excep...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def records(self):\r\n return Records(self)", "def get_records(self) -> List[DBModelInstance]:\n return self._get_all_records()", "async def get_entries(self, *args,convert = True, listed=False, as_dict=False):\r\n consts = args\r\n condition = condition = \" AND \".join(consts)\r\n...
[ "0.66132104", "0.620525", "0.6192388", "0.6140267", "0.61181104", "0.61163604", "0.60370296", "0.60240805", "0.597363", "0.5935963", "0.5874714", "0.586277", "0.58496785", "0.5838122", "0.5794863", "0.57405573", "0.5740384", "0.5723769", "0.57133895", "0.5712744", "0.56913215...
0.5455201
44
Predict the BDEs of each bond in a list of molecules.
def predict(smiles_list, drop_duplicates=True, batch_size=1, verbose=False): molecule_list = [Molecule(smiles=smiles) for smiles in smiles_list] smiles_list = [mol.smiles for mol in molecule_list] pred_df = pd.concat( ( get_fragments(mol, drop_duplicates=drop_duplicates) fo...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def predict(smiles_list, drop_duplicates=True, verbose=True):\n\n is_valid = pd.Series({smiles: not check_input(smiles)[0] for smiles in smiles_list}, name='is_valid')\n pred_df = pd.concat([predict_bdes(smiles, draw=False) for smiles in smiles_list])\n pred_df = pred_df.merge(is_valid, left_on='molecule'...
[ "0.6377305", "0.57994026", "0.56501853", "0.52041197", "0.5169816", "0.5126491", "0.51183426", "0.51093304", "0.50972986", "0.50279194", "0.5017863", "0.49950963", "0.49750766", "0.4968196", "0.49513084", "0.4942393", "0.49264514", "0.49236074", "0.4922351", "0.4922289", "0.4...
0.58677953
1
This function organise the data base to a difficult build
def dbase(): albums_data = {} song_dict = {} songs_list = [] with open(PATH, 'r') as f: data = f.read() temp = data.split("#") for album in temp[1:]: index = album.find("::") albums_data[album[:index]] = "" for album in temp[1:]: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _do_build ():\n if os.path.exists(\"./database\"):\n data_path = \"./database/\"\n elif os.path.exists(\"../database\"):\n data_path = \"../database/\"\n elif os.path.exists(\"../../database\"):\n data_path = \"../../database/\"\n else:\n data_path = \".\"\n\n dir_spe...
[ "0.6698447", "0.65494096", "0.6505635", "0.6406873", "0.63481224", "0.62501156", "0.62164736", "0.612963", "0.6124272", "0.6096875", "0.6047516", "0.60284543", "0.6016084", "0.5973622", "0.5927254", "0.59236556", "0.5918624", "0.59123254", "0.59106165", "0.59070426", "0.58868...
0.0
-1
this func is from using insde the data file
def simple_songs_list(name_of_album): songs = [] data1 = dbase() data1 = data1[name_of_album][0] for song in data1.keys(): songs += [song] return songs
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def load_data(self):", "def _read_data(self):", "def load_data(self) -> None:", "def read(self):", "def _load(self):\n\n # number of non-data header details at top of data file\n header = 1\n\n # open file\n weatherData = []\n with open(self.wfile) as myfile:\n ...
[ "0.7388499", "0.7290581", "0.71939653", "0.65396297", "0.6443839", "0.6359168", "0.6344289", "0.622777", "0.62194926", "0.6214607", "0.6213822", "0.6159157", "0.61423117", "0.6136031", "0.6111043", "0.6104353", "0.60962135", "0.60925573", "0.6089976", "0.6075218", "0.6048531"...
0.0
-1
this func is from using insde the data file
def simple_album_list(): album_list = [] data = dbase() for album in data.keys(): album_list += [album] return album_list
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def load_data(self):", "def _read_data(self):", "def load_data(self) -> None:", "def read(self):", "def _load(self):\n\n # number of non-data header details at top of data file\n header = 1\n\n # open file\n weatherData = []\n with open(self.wfile) as myfile:\n ...
[ "0.7388499", "0.7290581", "0.71939653", "0.65396297", "0.6443839", "0.6359168", "0.6344289", "0.622777", "0.62194926", "0.6214607", "0.6213822", "0.6159157", "0.61423117", "0.6136031", "0.6111043", "0.6104353", "0.60962135", "0.60925573", "0.6089976", "0.6075218", "0.6048531"...
0.0
-1
this func makes a list of all the album
def album_list_for_user(): answer = "" data = dbase() for album in data.keys(): answer += album + ", " return answer[:-2]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def album_list(self):\n\n artist_id = self.addon_args[\"artist_id\"][0]\n\n xbmcplugin.setContent(self.addon_handle, \"albums\")\n\n for album in self.connection.walk_artist(artist_id):\n self.add_album(album)\n\n xbmcplugin.addSortMethod(\n self.addon_handle, xbmc...
[ "0.8068434", "0.80611455", "0.80573", "0.80511075", "0.76079464", "0.7442075", "0.73546255", "0.73167896", "0.7289843", "0.724343", "0.7202005", "0.7099588", "0.70723593", "0.7056376", "0.705161", "0.7005844", "0.6928635", "0.68897617", "0.6879395", "0.6865144", "0.68555135",...
0.7306566
8
This function makes a list of all the songs in album
def songs_list(name_of_album): songs = "" data = dbase() data = data[name_of_album][0] for song in data.keys(): songs += song songs += ", " return songs[:-2]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def simple_songs_list(name_of_album):\r\n songs = []\r\n data1 = dbase()\r\n data1 = data1[name_of_album][0]\r\n for song in data1.keys():\r\n songs += [song]\r\n return songs", "def album_list(self):\n\n artist_id = self.addon_args[\"artist_id\"][0]\n\n xbmcplugin.setContent(...
[ "0.8295144", "0.78646994", "0.78634316", "0.7836907", "0.7691762", "0.76080465", "0.75683284", "0.7421076", "0.738293", "0.7337441", "0.7323385", "0.7289032", "0.7279224", "0.72707593", "0.7217044", "0.7155472", "0.71446615", "0.7133181", "0.71268225", "0.7097782", "0.7070707...
0.81815284
1