query
stringlengths
9
9.05k
document
stringlengths
10
222k
metadata
dict
negatives
listlengths
30
30
negative_scores
listlengths
30
30
document_score
stringlengths
4
10
document_rank
stringclasses
2 values
Sets the org_apache_felix_jetty_gzip_included_paths of this OrgApacheFelixHttpProperties.
def org_apache_felix_jetty_gzip_included_paths(self, org_apache_felix_jetty_gzip_included_paths: ConfigNodePropertyArray): self._org_apache_felix_jetty_gzip_included_paths = org_apache_felix_jetty_gzip_included_paths
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def org_apache_felix_jetty_gzip_included_paths(self) -> ConfigNodePropertyArray:\n return self._org_apache_felix_jetty_gzip_included_paths", "def org_apache_felix_jetty_gzip_excluded_paths(self, org_apache_felix_jetty_gzip_excluded_paths: ConfigNodePropertyArray):\n\n self._org_apache_felix_jetty_g...
[ "0.72814023", "0.6815239", "0.65494156", "0.6281999", "0.6279541", "0.61835283", "0.59572554", "0.5699541", "0.54085815", "0.52071905", "0.5186127", "0.5165024", "0.51406497", "0.5057689", "0.5044036", "0.5007892", "0.49969727", "0.49527168", "0.48988962", "0.48697796", "0.48...
0.8183289
0
Gets the org_apache_felix_jetty_gzip_excluded_paths of this OrgApacheFelixHttpProperties.
def org_apache_felix_jetty_gzip_excluded_paths(self) -> ConfigNodePropertyArray: return self._org_apache_felix_jetty_gzip_excluded_paths
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def org_apache_felix_jetty_gzip_included_paths(self) -> ConfigNodePropertyArray:\n return self._org_apache_felix_jetty_gzip_included_paths", "def org_apache_felix_jetty_gzip_excluded_paths(self, org_apache_felix_jetty_gzip_excluded_paths: ConfigNodePropertyArray):\n\n self._org_apache_felix_jetty_g...
[ "0.7664793", "0.755466", "0.71894544", "0.6854936", "0.6747863", "0.6717936", "0.6661041", "0.6292526", "0.59868807", "0.59426415", "0.58985263", "0.5872978", "0.5845391", "0.57460874", "0.56098026", "0.55324715", "0.550655", "0.54484224", "0.54354405", "0.5385288", "0.533953...
0.8602508
0
Sets the org_apache_felix_jetty_gzip_excluded_paths of this OrgApacheFelixHttpProperties.
def org_apache_felix_jetty_gzip_excluded_paths(self, org_apache_felix_jetty_gzip_excluded_paths: ConfigNodePropertyArray): self._org_apache_felix_jetty_gzip_excluded_paths = org_apache_felix_jetty_gzip_excluded_paths
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def org_apache_felix_jetty_gzip_excluded_paths(self) -> ConfigNodePropertyArray:\n return self._org_apache_felix_jetty_gzip_excluded_paths", "def org_apache_felix_jetty_gzip_included_paths(self, org_apache_felix_jetty_gzip_included_paths: ConfigNodePropertyArray):\n\n self._org_apache_felix_jetty_g...
[ "0.73312", "0.6721894", "0.64388037", "0.64170027", "0.6315897", "0.6179333", "0.60733014", "0.5924842", "0.57383174", "0.5684811", "0.56573874", "0.5620455", "0.5342405", "0.5341773", "0.53177553", "0.52853596", "0.52180296", "0.50882804", "0.5034334", "0.48919365", "0.48573...
0.79911524
0
Gets the org_apache_felix_jetty_gzip_included_mime_types of this OrgApacheFelixHttpProperties.
def org_apache_felix_jetty_gzip_included_mime_types(self) -> ConfigNodePropertyArray: return self._org_apache_felix_jetty_gzip_included_mime_types
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def org_apache_felix_jetty_gzip_included_mime_types(self, org_apache_felix_jetty_gzip_included_mime_types: ConfigNodePropertyArray):\n\n self._org_apache_felix_jetty_gzip_included_mime_types = org_apache_felix_jetty_gzip_included_mime_types", "def org_apache_felix_jetty_gzip_excluded_mime_types(self) -> C...
[ "0.7882282", "0.7741241", "0.687413", "0.6550321", "0.64034975", "0.60768574", "0.5863483", "0.5809866", "0.56989354", "0.5532147", "0.5517617", "0.5490475", "0.5480388", "0.54086906", "0.5342103", "0.5271495", "0.5217648", "0.5194284", "0.5113195", "0.5049082", "0.49985638",...
0.88149124
0
Sets the org_apache_felix_jetty_gzip_included_mime_types of this OrgApacheFelixHttpProperties.
def org_apache_felix_jetty_gzip_included_mime_types(self, org_apache_felix_jetty_gzip_included_mime_types: ConfigNodePropertyArray): self._org_apache_felix_jetty_gzip_included_mime_types = org_apache_felix_jetty_gzip_included_mime_types
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def org_apache_felix_jetty_gzip_included_mime_types(self) -> ConfigNodePropertyArray:\n return self._org_apache_felix_jetty_gzip_included_mime_types", "def org_apache_felix_jetty_gzip_excluded_mime_types(self, org_apache_felix_jetty_gzip_excluded_mime_types: ConfigNodePropertyArray):\n\n self._org_...
[ "0.76558256", "0.74655026", "0.6808436", "0.62108487", "0.5826314", "0.55636775", "0.556074", "0.5519447", "0.54764766", "0.53906035", "0.53241843", "0.5211381", "0.51962066", "0.5180828", "0.51409984", "0.512985", "0.5088649", "0.5085278", "0.5022681", "0.49057752", "0.48752...
0.8373357
0
Gets the org_apache_felix_jetty_gzip_excluded_mime_types of this OrgApacheFelixHttpProperties.
def org_apache_felix_jetty_gzip_excluded_mime_types(self) -> ConfigNodePropertyArray: return self._org_apache_felix_jetty_gzip_excluded_mime_types
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def org_apache_felix_jetty_gzip_included_mime_types(self) -> ConfigNodePropertyArray:\n return self._org_apache_felix_jetty_gzip_included_mime_types", "def org_apache_felix_jetty_gzip_excluded_mime_types(self, org_apache_felix_jetty_gzip_excluded_mime_types: ConfigNodePropertyArray):\n\n self._org_...
[ "0.8096301", "0.78604734", "0.6767221", "0.67533714", "0.66217756", "0.64377946", "0.6267546", "0.6009801", "0.59769696", "0.59420717", "0.5840183", "0.575336", "0.56591237", "0.5629573", "0.5563937", "0.5517507", "0.5375173", "0.5352545", "0.51818913", "0.5176541", "0.517422...
0.8787211
0
Sets the org_apache_felix_jetty_gzip_excluded_mime_types of this OrgApacheFelixHttpProperties.
def org_apache_felix_jetty_gzip_excluded_mime_types(self, org_apache_felix_jetty_gzip_excluded_mime_types: ConfigNodePropertyArray): self._org_apache_felix_jetty_gzip_excluded_mime_types = org_apache_felix_jetty_gzip_excluded_mime_types
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def org_apache_felix_jetty_gzip_excluded_mime_types(self) -> ConfigNodePropertyArray:\n return self._org_apache_felix_jetty_gzip_excluded_mime_types", "def org_apache_felix_jetty_gzip_included_mime_types(self, org_apache_felix_jetty_gzip_included_mime_types: ConfigNodePropertyArray):\n\n self._org_...
[ "0.7721878", "0.7150851", "0.6898612", "0.63561344", "0.6181627", "0.5800203", "0.5683951", "0.5612671", "0.54054135", "0.53159565", "0.52980393", "0.5160608", "0.5096038", "0.503808", "0.49808657", "0.49463513", "0.49146417", "0.48810196", "0.4846096", "0.47825828", "0.47354...
0.83199024
0
Gets the org_apache_felix_http_session_invalidate of this OrgApacheFelixHttpProperties.
def org_apache_felix_http_session_invalidate(self) -> ConfigNodePropertyBoolean: return self._org_apache_felix_http_session_invalidate
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def org_apache_felix_http_session_invalidate(self, org_apache_felix_http_session_invalidate: ConfigNodePropertyBoolean):\n\n self._org_apache_felix_http_session_invalidate = org_apache_felix_http_session_invalidate", "def auth_invalidate_session(self) -> None:\n self.__logger.debug('Eva.auth_invali...
[ "0.7217652", "0.62059575", "0.554804", "0.53198594", "0.50600505", "0.5036488", "0.4939528", "0.4923382", "0.4796819", "0.47919518", "0.47808963", "0.4733047", "0.46928778", "0.4659546", "0.4607059", "0.4606501", "0.45678967", "0.45677337", "0.4553705", "0.45413536", "0.45328...
0.7086756
1
Sets the org_apache_felix_http_session_invalidate of this OrgApacheFelixHttpProperties.
def org_apache_felix_http_session_invalidate(self, org_apache_felix_http_session_invalidate: ConfigNodePropertyBoolean): self._org_apache_felix_http_session_invalidate = org_apache_felix_http_session_invalidate
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def org_apache_felix_http_session_invalidate(self) -> ConfigNodePropertyBoolean:\n return self._org_apache_felix_http_session_invalidate", "def org_apache_felix_http_session_timeout(self, org_apache_felix_http_session_timeout: ConfigNodePropertyInteger):\n\n self._org_apache_felix_http_session_time...
[ "0.68846256", "0.5935194", "0.5732186", "0.51594085", "0.511239", "0.49642003", "0.4930626", "0.4889229", "0.48802778", "0.48659036", "0.47784737", "0.47330034", "0.46047753", "0.45323482", "0.45041436", "0.44938076", "0.44748378", "0.44606805", "0.4450914", "0.4450914", "0.4...
0.8399019
0
Gets the org_apache_felix_http_session_uniqueid of this OrgApacheFelixHttpProperties.
def org_apache_felix_http_session_uniqueid(self) -> ConfigNodePropertyBoolean: return self._org_apache_felix_http_session_uniqueid
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def org_apache_felix_http_session_uniqueid(self, org_apache_felix_http_session_uniqueid: ConfigNodePropertyBoolean):\n\n self._org_apache_felix_http_session_uniqueid = org_apache_felix_http_session_uniqueid", "def session_id(self) -> str:\n return self._session_id", "def get_sessionid(self):\n ...
[ "0.6747569", "0.6661827", "0.65855795", "0.65626913", "0.6464378", "0.63789254", "0.6297064", "0.62230587", "0.6094951", "0.6089729", "0.6038436", "0.6000553", "0.59570223", "0.59272194", "0.58490086", "0.5816694", "0.5774036", "0.5772387", "0.5772387", "0.5772387", "0.577238...
0.73061305
0
Sets the org_apache_felix_http_session_uniqueid of this OrgApacheFelixHttpProperties.
def org_apache_felix_http_session_uniqueid(self, org_apache_felix_http_session_uniqueid: ConfigNodePropertyBoolean): self._org_apache_felix_http_session_uniqueid = org_apache_felix_http_session_uniqueid
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def org_apache_felix_http_session_uniqueid(self) -> ConfigNodePropertyBoolean:\n return self._org_apache_felix_http_session_uniqueid", "def org_apache_felix_http_session_timeout(self, org_apache_felix_http_session_timeout: ConfigNodePropertyInteger):\n\n self._org_apache_felix_http_session_timeout ...
[ "0.7016722", "0.6048987", "0.5852379", "0.54893565", "0.54460126", "0.52044636", "0.5184681", "0.51788116", "0.5120198", "0.5074298", "0.5041709", "0.5030468", "0.5007963", "0.49998662", "0.49792632", "0.49787027", "0.496626", "0.4916027", "0.49080864", "0.49074236", "0.48660...
0.8104783
0
Join dataframes by resampling on milliseconds and join on datetimeindex.
def _join_on_millisec(dfs: list): # Resample to milliseconds befor joining for idx, df in enumerate(dfs): df["sys_time_dt"] = pd.to_datetime(df["sys_time"], unit="ms") df = df.set_index("sys_time_dt") df = df.drop(columns=["sys_time"]) df = df[~df.index.duplicated(keep="last")] ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def join(df: DataFrame, other_df: DataFrame,\n df_alias: str, other_df_alias: str,\n on: str, how: str = \"left\") -> DataFrame:\n\n base_df_ts = col(f\"{df_alias}.ts\")\n other_df_ts = col(f\"{other_df_alias}.ts\")\n window_spec = Window.partitionBy...
[ "0.5861676", "0.57164484", "0.57051706", "0.55964965", "0.54426515", "0.54371125", "0.5421133", "0.54204875", "0.5400217", "0.53991127", "0.53930044", "0.52991986", "0.5261319", "0.525653", "0.525153", "0.52278084", "0.52173066", "0.5192161", "0.5179339", "0.5173237", "0.5153...
0.7643946
0
Read CSVs of intertial sensor to dataframes. The three sensors CSVs red from disk and joined by timestamp into a single table.
def _read_sensors(session_path: Path): subject = session_path.parent.name session = session_path.name # Read all sensor files sensor_dfs = [] for filename in DATA_FILES: df = pd.read_csv( session_path / filename, names=DATA_FILE_COLUMNS, usecols=["x", "y"...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _read_trajectory_files(self):\n dflist = []\n self.Ntimes = {}\n for downD in self.case.downstreamD:\n outputs = self.case.get_outputs(self.method,downD)\n print(outputs['trajectory_file'])\n df = pd.read_csv(outputs['trajectory_file'],\n ...
[ "0.66842204", "0.6533941", "0.6304058", "0.6269054", "0.62516725", "0.6149453", "0.6144662", "0.6085041", "0.6061771", "0.5997839", "0.59718335", "0.5971198", "0.59701777", "0.59618956", "0.59373224", "0.593337", "0.5908655", "0.5892451", "0.5883747", "0.58696353", "0.5865705...
0.65834403
1
Add meta info to sensors DF based on timestamps in activity DF. Also maps the 24 different task_ids into 6 different task types.
def _join_activity(df_activity: pd.DataFrame, df_sens: pd.DataFrame): df_sens["task_id"] = 0 for idx, row in df_activity.iterrows(): df_sens.loc[ (df_sens["sys_time"] >= row["start_time"]) & (df_sens["sys_time"] <= row["end_time"]), "task_id", ] = row["task_id...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_ingestion_metadata_task(\n df: pd.DataFrame,\n):\n df2 = df.copy(deep=True)\n df2[\"_viadot_downloaded_at_utc\"] = datetime.now(timezone.utc).replace(microsecond=0)\n return df2", "def _make_meta(self):\n available_meas_times = list()\n available_intervals = list()\n dril...
[ "0.61292684", "0.5416358", "0.53845924", "0.52447414", "0.5218356", "0.5165839", "0.5148912", "0.5109014", "0.5070019", "0.50598127", "0.5047217", "0.50084674", "0.4988053", "0.49841473", "0.49822265", "0.4978784", "0.49709165", "0.4964251", "0.49591193", "0.49555197", "0.494...
0.5956733
1
Creates a chatrooms communicator for the given input token.
def make_communicator(token): return WebsocketCommunicator(TokenAuthMiddlewareStack( URLRouter( websocket_urlpatterns ) ), '/ws/chat/?token=' + token)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_chatroom(request):\n title = request.POST['title'].strip()\n psk = request.POST['psk']\n \n # If thread already exists\n if models.MessageThread.objects.filter(title=title).exists():\n thread = models.MessageThread.objects.get(title=title)\n if thread.psk != psk:\n #...
[ "0.5637438", "0.5523975", "0.55051774", "0.54330796", "0.54073066", "0.53283787", "0.53062826", "0.5287932", "0.5229703", "0.5221418", "0.52044666", "0.5171826", "0.5073271", "0.5067419", "0.5032029", "0.50144166", "0.49957344", "0.49951404", "0.4987254", "0.49871126", "0.498...
0.75251323
0
Attempts a profile retrieval using a given token.
async def attempt_profile(token, expect=200): response = await database_sync_to_async(MyProfileView.as_view())(factory.get('/profile', HTTP_AUTHORIZATION='Token ' + token)) assert response.status_code == expect
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_profile(profile_id, token):\n url = '{}{}/'.format(PROFILE_ENDPOINT, profile_id)\n res = requests.get(url, headers={\n 'Content-Type': 'application/json',\n 'Authorization': 'Token {}'.format(token)\n })\n return res.json()", "async def test_not_retrieve_profile_with_account_tok...
[ "0.68144375", "0.6709642", "0.66583216", "0.6256965", "0.6099129", "0.6031647", "0.59498155", "0.5881905", "0.58400744", "0.5807715", "0.5780331", "0.5726177", "0.57129955", "0.5694952", "0.5694952", "0.55700994", "0.5545229", "0.5544591", "0.55419356", "0.5518681", "0.551555...
0.729398
0
Attempts a logout using a given token.
async def attempt_logout(token, expect=204): response = await database_sync_to_async(UserLogoutView.as_view())(factory.post('/logout', HTTP_AUTHORIZATION='Token ' + token)) assert response.status_code == expect
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def auth_logout(token):\n if verify_token(token):\n return { \"is_success\": True }\n else:\n raise AccessError(description=\"Logout failed. Token is invalid\")", "def logout(_host, _token):\n url = _host + '/api/v1/users/logout'\n headers = {\n 'Content-Type': 'application/json'...
[ "0.7278216", "0.68836224", "0.6859607", "0.67861867", "0.6770758", "0.6694835", "0.66294277", "0.6611441", "0.64591223", "0.64591223", "0.64254606", "0.63770396", "0.63576144", "0.634561", "0.6340409", "0.62441546", "0.6227763", "0.6221606", "0.62151426", "0.619917", "0.61847...
0.77047193
0
Attempts a websocket channel connection and expects to receive a MOTD.
async def should_be_websocket_welcome(token): communicator = make_communicator(token) connected, _ = await communicator.connect() assert connected message = await communicator.receive_json_from() await communicator.disconnect() assert message.get('type') == 'notification' assert message.get...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async def connect(self) -> None:\n exceptions = (\n OSError,\n ConnectionClosed,\n aiohttp.ClientError,\n asyncio.TimeoutError,\n errors.HTTPException,\n )\n\n async def throttle() -> None:\n now = time.monotonic()\n ...
[ "0.64464635", "0.6210147", "0.6181521", "0.61647856", "0.6162948", "0.6138284", "0.6119366", "0.6101342", "0.60932285", "0.6045619", "0.6020593", "0.6005463", "0.6004269", "0.5911575", "0.58692455", "0.58346134", "0.58307046", "0.58235204", "0.5798333", "0.5785222", "0.576996...
0.6423359
1
Attempts a websocket channel connection and expects to receive a rejection because the user is not logged in (invalid token).
async def should_be_websocket_rejected_because_anonymous(token): communicator = make_communicator(token) connected, _ = await communicator.connect() assert connected message = await communicator.receive_json_from() await communicator.disconnect() assert message.get('type') == 'fatal' assert...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_invalid_channel(self, mock_get, mock_subscribe):\n mock_get.return_value = {'XXX': False}\n token = jwt.encode({'room': '123', 'uuid': 'XXX'}, 'XXXX').decode('utf-8')\n ws = yield self.ws_connect('/socket?token={}&channel=ABC'.format(token))\n self.assertSocketError(ws, 4300, '...
[ "0.63569295", "0.6157", "0.60669607", "0.6048544", "0.59831417", "0.58894384", "0.58818215", "0.5854295", "0.5843035", "0.57614714", "0.5727695", "0.5673268", "0.56722736", "0.5671324", "0.56529385", "0.5622091", "0.55809", "0.55794907", "0.5520937", "0.55131423", "0.5498307"...
0.6747004
0
Tests the whole chatrooms interaction, given a valid token, with several simultaneous users.
async def test_chatrooms_accounts(rooms): # Register all the users. for name in USERS: username = name password = name * 2 + '$12345' email = name + '@example.org' await attempt_register(username, password, email) # Login all the users. tokens = {} for name in USERS...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async def test_chatroom_commands():\n\n # Login all the users.\n tokens = {}\n for name in USERS:\n username = name\n password = name * 2 + '$12345'\n tokens[name] = await attempt_login(username, password)\n\n # Alice will:\n # 1. Connect and retrieve MOTD.\n # 2. List rooms,...
[ "0.72217304", "0.6655384", "0.6091954", "0.60038173", "0.5890071", "0.57427335", "0.56996506", "0.5660185", "0.5533575", "0.5516244", "0.549884", "0.54945004", "0.5488156", "0.54860985", "0.5470775", "0.5467824", "0.54579467", "0.544405", "0.54231054", "0.5410716", "0.5400262...
0.69260347
1
Tests all the commands exchanged via the chatrooms. This includes doublejoin and doublepart.
async def test_chatroom_commands(): # Login all the users. tokens = {} for name in USERS: username = name password = name * 2 + '$12345' tokens[name] = await attempt_login(username, password) # Alice will: # 1. Connect and retrieve MOTD. # 2. List rooms, and expect the ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_multiple_commands_at_same_time(self):", "def helper_commands():\n # Test HELP\n try:\n check = check50.run(run_command).stdin(\"HELP\")\n for help in help_statement:\n check.stdout(help)\n except check50.Failure as error:\n raise check50.Failure(f\"HELP did not p...
[ "0.6896309", "0.67278975", "0.65846676", "0.6491539", "0.6435943", "0.63337386", "0.6243607", "0.62340873", "0.6171158", "0.6107857", "0.60933584", "0.60725754", "0.6030929", "0.59952533", "0.5960336", "0.59528023", "0.5928129", "0.59240675", "0.59043515", "0.5903812", "0.588...
0.7290664
0
Initializes a ConditionalConvnet object.
def __init__(self, num_blocks=3, layers_per_block=2, base_num_channels=16, upconv=False, fc_layer_sizes=None, upconv_reshape_size=None, conditioning_layer_sizes=None, channels_out=3, alpha=0.3, conditioning_postprocessing=None, final_sigmoid=False, conditionin...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self, conv_layer: Conv2D,\n guest_is_larger: Optional[bool] = None,\n guest_first: bool = True):\n self.conv_layer = conv_layer\n self.guest_is_larger = guest_is_larger\n self.guest_first = guest_first", "def init(self):\n self.reparam_layers = []\n ...
[ "0.6307894", "0.62516075", "0.6212562", "0.6199809", "0.61927176", "0.6144121", "0.61221516", "0.6115666", "0.6100876", "0.6072859", "0.6065201", "0.6063435", "0.60456663", "0.59873235", "0.5961926", "0.59572375", "0.5943566", "0.5940094", "0.59339577", "0.5929681", "0.590637...
0.72267705
0
Select a slope, if required. Notes
def select_single_slope(self, **kwargs): if self.verbose > 1: print("MultiLinearSpectra.select_single_slope()") for m in self.mess: if m["class"] == "batch": warnings.warn("MultiLinearSpectra.select_single_slope(): slope should be selected before batche...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _on_slope_change(self, _):\n self.slope = self.slope_slider.value\n self.redraw_slope()", "def set_slope(self, slope: float) -> None:\r\n self.slope = slope", "def __init__(self, slope):\n self.slope = slope", "def slope(self):\n if self.b == 0:\n return None...
[ "0.70611864", "0.69255155", "0.6277614", "0.6218594", "0.6095415", "0.60038364", "0.5952847", "0.59119874", "0.5888782", "0.5880145", "0.5864116", "0.5850078", "0.5848201", "0.583642", "0.58140606", "0.5761579", "0.5753976", "0.57129383", "0.5664197", "0.5655621", "0.5625292"...
0.72659767
0
This function will make a new xaxis. It will look at the number of data points on the old and new xaxis, if the old xaxis has bin_above (default = 2) or more times more data points, it will bin the data. Otherwise it will interpolate it. If min_x and/or max_x are not given, then the lowest and/or highest values in self...
def make_uniform_x(self, x_resolution, min_x = None, max_x = None, bin_above = 2.0, **kwargs): if min_x is None or max_x is None: a, b = self.get_min_max_x(**kwargs) if min_x is None: min_x = a if max_x is None: max_x = b ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update_bins_to_view(self, *args):\n with delay_callback(self, 'hist_x_min', 'hist_x_max'):\n if self.x_max > self.x_min:\n self.hist_x_min = self.x_min\n self.hist_x_max = self.x_max\n else:\n self.hist_x_min = self.x_max\n ...
[ "0.6070046", "0.6070046", "0.58124596", "0.58124596", "0.5680742", "0.5637928", "0.5504903", "0.5313853", "0.53103", "0.530034", "0.5242136", "0.5198289", "0.5183262", "0.51824766", "0.5178394", "0.5122132", "0.5113222", "0.5103701", "0.51011974", "0.5083347", "0.5024227", ...
0.6091164
0
Calculate the signal. Objects need to be from classes that conform to LinearSpectrum. Optionally, objects can be excluded from calculating the signal. Arguments
def calculate_signal(self, exclude = [], **kwargs): if self.verbose > 1: print("MultiLinearSpectra.calculate_signal()") for m in range(len(self.mess)): if m not in exclude and self.mess[m]["class"] not in exclude: if hasattr(self.mess[m]["object"], "calc...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _filtering(cls, signal, system):\r\n\r\n if np.iscomplexobj(signal):\r\n _, filtered_signal_r, _ = sc_sig.dlsim(system, np.real(signal))\r\n _, filtered_signal_i, _ = sc_sig.dlsim(system, np.imag(signal))\r\n filtered_signal = filtered_signal_r + 1j * filtered_signal_i\r...
[ "0.582007", "0.5640397", "0.55906636", "0.5515562", "0.5370433", "0.52759707", "0.5209679", "0.51941854", "0.5187894", "0.5175926", "0.5142204", "0.5102005", "0.50907665", "0.5066592", "0.5065132", "0.5058387", "0.5002485", "0.49882856", "0.4976684", "0.4972855", "0.4956877",...
0.7872795
0
A function that extracts chunks from datafiles
def extract_chunks(the_files, the_bands=None): ds_config = {} gdal_ptrs = [] datatypes = [] for the_file in the_files: g = gdal.Open(the_file) gdal_ptrs.append(gdal.Open(the_file)) datatypes.append(GDAL2NUMPY[g.GetRasterBand(1).DataType]) block_size = g.GetRasterBand(1).GetB...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getChunks():", "def test_chunks(year, day, part_number):\n chunks = []\n chunk_index = -1\n data_file_lines(part_number).each do |line|\n if line[0] == '#'\n chunk_index += 1\n chunks[chunk_index] = [line[1..-1].strip, []]\n elsif chunk_index >= 0\n chunks[chunk_index]...
[ "0.71130896", "0.6830764", "0.6782417", "0.6715846", "0.667817", "0.6514174", "0.64776266", "0.63899785", "0.6382798", "0.6382149", "0.630955", "0.6306718", "0.6290901", "0.62592876", "0.62214875", "0.62158453", "0.62141967", "0.62119377", "0.6189095", "0.61417973", "0.614090...
0.71403193
0
Create a batch of URLs for pulling timeseries objects from Halo.
def create_url_batch(cls, path, batch_size, params={}): url_list = [] for page in range(1, batch_size + 1): params["page"] = page url = (path, dict(params)) url_list.append(url) return url_list
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def download_all(conn, logger):\n # setup slices, 24 in total\n slices = [f'year{x}month{y}' for x in [2, 1] for y in range(12, 0, -1)]\n for slice in slices:\n download_intraday_extended(conn, logger, slice)", "def UrlGenerator(head, end, start):\n urllist = []\n urlhead = head\n delta = time...
[ "0.62782913", "0.61778706", "0.5907445", "0.5905333", "0.57796603", "0.5722891", "0.5697067", "0.5626108", "0.5601909", "0.55823594", "0.55752623", "0.5555578", "0.55554163", "0.55433315", "0.55048054", "0.54210556", "0.5396725", "0.5391007", "0.5382943", "0.53774333", "0.534...
0.65828794
0
Gets the next batch of timeseries items from the Halo API
def get_next_batch(self): url_list = self.create_url_batch(self.start_url, self.batch_size, self.params) pages = self.get_pages(url_list) adjustment_factor = self.get_adjustment_factor(pages, self.page_size, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _Next(self, count=None):\n if count is not None and (not isinstance(count, (int, long)) or count <= 0):\n raise datastore_errors.BadArgumentError(\n 'Argument to _Next must be an int greater than 0; received %s (a %s)' %\n (count, typename(count)))\n\n if self.__buffer:\n if count...
[ "0.6152826", "0.6136084", "0.6109296", "0.6071321", "0.6053608", "0.58972186", "0.58925384", "0.58786076", "0.58652157", "0.58604544", "0.58361346", "0.58221257", "0.58177155", "0.58131826", "0.5763761", "0.5760355", "0.5737006", "0.5702543", "0.5676999", "0.56377476", "0.563...
0.71298516
0
Determine number of empty pages from list of pages.
def get_number_of_empty_pages(cls, pages, item_key): empty = [page for page in pages if page[item_key] == []] return len(empty)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_number_of_full_pages(cls, pages, page_size, item_key):\n full = [page for page in pages if len(page[item_key]) == page_size]\n return len(full)", "def num_pages(self):\n if self.count == 0 and not self.allow_empty_first_page:\n return 0\n hits = max(1, self.count + ...
[ "0.6968454", "0.6964381", "0.69400054", "0.65524155", "0.64453053", "0.63995045", "0.6375952", "0.6373464", "0.6291651", "0.6288349", "0.6280372", "0.62778735", "0.626527", "0.62141216", "0.61845714", "0.6140578", "0.61326563", "0.61308753", "0.61158437", "0.6084466", "0.6050...
0.8104307
0
Raise CloudPassageValidation if `start_url` is invalid.
def verify_start_url(cls, start_url): if start_url not in cls.allowed_urls: exc_msg = "This URL is unsupported for TimeSeries: %s" % start_url raise CloudPassageValidation(exc_msg) return
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def validate_url(self):\n pass", "def check_url_and_raise_errors(url: str) -> None:\n if not url:\n raise_error(\"Url can not be empty\", 400)\n\n try:\n URL_REGEX.match(url).span()[1] - URL_REGEX.match(url).span()[0] == len(url)\n except AttributeError:\n raise_error(\"Url s...
[ "0.6495124", "0.6365665", "0.5986806", "0.5980897", "0.5966514", "0.5952704", "0.5844769", "0.582063", "0.5806983", "0.57794064", "0.5755256", "0.57282627", "0.56958735", "0.5690138", "0.5598804", "0.55730754", "0.55513805", "0.55021673", "0.55015725", "0.5486201", "0.5482193...
0.829017
0
Update the clock time. Only needs to be caled when the clock runs in externally clocked mode, which is done by calling reset/start with the current clock time. If called when the clock runs in realtime mode, does nothing.
def update(self, time=None): if self.realtime: return if time is None: # clock in externally-clocked mode, need valid time return self._time = time
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _update_system_clock(self):\n if self.platform in RASPBERRY_PI_PLATFORMS:\n LOG.info('Updating the system clock via NTP...')\n if self.is_paired:\n # Only display time sync message when paired because the prompt\n # to go to home.mycroft.ai will be dis...
[ "0.7382141", "0.7280795", "0.715636", "0.70415646", "0.6851223", "0.6786854", "0.67185956", "0.6634915", "0.65945804", "0.65783584", "0.65637106", "0.65293413", "0.6465509", "0.6462791", "0.64522076", "0.6451686", "0.6383177", "0.6361214", "0.6351433", "0.6348467", "0.633714"...
0.78453046
0
Whether the clock is running in realtime mode.
def realtime(self): return self._time is None
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_real_time(self):\n return time.time() - self.timestamp < self._DEADLINE_SEC", "def realtime():\n return timemodule.time()", "def is_on(self):\n return self.device.override_time != 0", "def test_clock_realtime():\n clock = Clock()\n assert clock.realtime\n old_time = clock.tim...
[ "0.7016662", "0.66893965", "0.66435194", "0.6613927", "0.6612546", "0.65303993", "0.65255374", "0.6505397", "0.65028715", "0.6433543", "0.6398667", "0.63965267", "0.63770014", "0.6296478", "0.62463707", "0.6225969", "0.6223736", "0.6192421", "0.6138805", "0.6115815", "0.61126...
0.7951804
0
Clock time when timeout will occur.
def timeout_time(self): if self.start_time is None: return None return self.start_time + self.timeout
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_time(self, timeout=None):\n self._event.wait(timeout)\n return self._time", "def get_timeout(self) -> int:", "def get_time2(self, timeout=None):\n self._event.wait(timeout)\n return self._time2", "def clock(self):\r\n return self.__clock", "def _clock_time(self):\...
[ "0.72348344", "0.68059045", "0.6645698", "0.6645481", "0.6644638", "0.6630814", "0.65420157", "0.6535578", "0.6516644", "0.6508539", "0.650651", "0.64768165", "0.64610153", "0.6453034", "0.6443049", "0.6419919", "0.64109814", "0.6393732", "0.6378195", "0.635275", "0.6332481",...
0.73910815
0
Amount of time remaining before timeout.
def remaining(self): if not self.enabled: return None duration = self.timeout - self.elapsed if self.timed_out: # check timed_out after duration for real-time correctness return 0 return duration
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def remaining(self):\n return self._timeout - (time.time() - self._start_time)", "def Remaining(self):\n if self._timeout is None:\n return None\n\n # Get start time on first calculation\n if self._start_time is None:\n self._start_time = self._time_fn()\n\n # Calculate remaining tim...
[ "0.8075747", "0.79891056", "0.7745984", "0.7732044", "0.75319827", "0.7490149", "0.740348", "0.73530316", "0.7337123", "0.7259376", "0.719823", "0.7169936", "0.7129035", "0.7103739", "0.7059992", "0.7045254", "0.70066863", "0.700246", "0.699799", "0.69962406", "0.69094265", ...
0.8037652
1
filter Tasks by my List obj
def get_tasks(self, obj): qs = Task.objects.filter(list=obj) qs_serializer = TaskModelSerializer(qs, many=True).data return qs_serializer
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def filter_tasks(tasks, task_list):\n qs = [tasks.filter(name=n) for n in task_list]\n return list(map(lambda o: o[0] if o else None, qs))", "def get_tasks(**filters):\n return db.task.find(filters) if filters else db.task.find()", "def get_tasks(taskid_list, module):\n tasks = module.client.api.ge...
[ "0.7971365", "0.67491955", "0.6684011", "0.6569972", "0.6455445", "0.63282394", "0.6286252", "0.6277132", "0.6255373", "0.6024815", "0.5982457", "0.59775424", "0.5921261", "0.5860859", "0.58547467", "0.58400625", "0.5826508", "0.58254695", "0.58115506", "0.57952225", "0.57818...
0.6802642
1
Use weights to classify data points and check the accuracy
def check_accuracy (data, labels, weights): count = 0 gs = [] rs = [] for x in range(0,len(data)): results = dot(data[x], weights) guess = unit_step(results) gs.append(guess) # append prediction rs.append(labels[x]) # append result if guess - labels[x] == 0: count += 1 percentage = ((float(count) / l...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_weighted_accuracy(self):\n total_accuracy, weights = losses.weighted_accuracy(\n logits=self.logits, targets=self.targets, weights=self.targets >= 0)\n\n expected_accuracy = 2 / 3\n\n self.assertEqual(weights, 3)\n self.assertAlmostEqual(total_accuracy / weights, expected_accuracy)", ...
[ "0.70390934", "0.68235767", "0.67985964", "0.6642697", "0.65643245", "0.6527223", "0.6506123", "0.64952445", "0.6493317", "0.64669216", "0.6463251", "0.64184594", "0.64130056", "0.64007723", "0.63961643", "0.6394636", "0.63843155", "0.63546777", "0.6347009", "0.6340083", "0.6...
0.70010304
1
make a mask considering only the list_of_body_parts
def select_body_parts(mask, list_of_body_parts): new_mask = np.zeros(mask.shape).astype(np.bool) for body_part in list_of_body_parts: idxs = body_parts[body_part] for idx in idxs: m_ = (mask == idx) new_mask = np.bitwise_or(new_mask, m_) return new_mask.astype(np....
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_part_mask(densepose_map):\r\n # Group of body parts. Each group contains IDs of body labels in DensePose.\r\n # The 9 groups here are: background, torso, hands, feet, upper legs, lower legs,\r\n # upper arms, lower arms, head.\r\n part_groups = [[0], [1, 2], [3, 4], [5, 6], [7, 9, 8, 10], [11, ...
[ "0.61990356", "0.60066074", "0.5917666", "0.58902127", "0.5703398", "0.55054516", "0.5479234", "0.5406589", "0.5364245", "0.53532046", "0.53532046", "0.5335742", "0.52789414", "0.51581067", "0.51506364", "0.5140562", "0.51351595", "0.5124637", "0.5110115", "0.510529", "0.5060...
0.7947181
0
"Function takes text file parameter, and counts instances of team face offs by iterating though each lines. Distinction of readable line made by presence of character "v" in line.
def count_matches(reading): dictionary = {} the_list = list() with open(reading, "r") as text_file: for lines in text_file: sentence = lines.strip() if not sentence or sentence.find("v") < 0: continue else: tup = tuple(sentence.split(" v ")) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_line_count(self):\n self.assertEqual(analyze_text(self.filename)[0], 11)", "def test_line_count(self):\n self.assertEqual(analyze_text(self.filename)[0], 4)", "def test_line_count(self):\n self.assertEqual(analyze_text(self.filename)[0], 4)", "def countChaptersVerses(filename):\...
[ "0.5773035", "0.575675", "0.575675", "0.5693809", "0.5687128", "0.56646866", "0.5577447", "0.55631375", "0.5443837", "0.54132473", "0.5392287", "0.538056", "0.5354688", "0.5338032", "0.5318795", "0.53123796", "0.53035545", "0.5301292", "0.5290238", "0.5274351", "0.5263779", ...
0.6466942
0
returns the interests for the category.
def all(self, list_id, category_id, **kwargs): return self._mc_client._get( url=self._build_path(list_id, 'interest-categories', category_id, 'interests'), **kwargs )
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def interests(self):\n if \"interests\" in self._prop_dict:\n return self._prop_dict[\"interests\"]\n else:\n return None", "def get(self, list_id, category_id, interest_id):\n return self._mc_client._get(\n url=self._build_path(list_id, 'interest-categories'...
[ "0.7233376", "0.6845424", "0.6362905", "0.59505403", "0.5945664", "0.57679194", "0.5734994", "0.5648778", "0.5561602", "0.5554436", "0.54485667", "0.5437664", "0.5421697", "0.5412767", "0.53375494", "0.53321195", "0.5257061", "0.5234549", "0.5228752", "0.5152548", "0.51335615...
0.7139124
1
returns information about a specific interest category, or Group Title.
def get(self, list_id, category_id, interest_id): return self._mc_client._get( url=self._build_path(list_id, 'interest-categories', category_id, 'interests', interest_id))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getCategory():", "def category(self):\r\n return self._get('category', {})", "def category(self):\n return self._ctx.get(\"name\", self._ctx[\"id\"])", "def category(self) -> str:\n return pulumi.get(self, \"category\")", "def category_title(self):\n categories = {c[0]:c[1] ...
[ "0.6102256", "0.5793752", "0.5774473", "0.57672524", "0.5699058", "0.5508172", "0.54925686", "0.5485171", "0.5441007", "0.5441007", "0.5441007", "0.5441007", "0.5364656", "0.53638065", "0.53515863", "0.53429925", "0.53126425", "0.52534324", "0.525046", "0.5194649", "0.5173863...
0.610781
0
Configure a pair of moving and fixed images and a pair of moving and fixed labels as model input and returns model input tf.keras.Input TODO do we absolutely need the batch_size in Input?
def build_inputs( moving_image_size: tuple, fixed_image_size: tuple, index_size: int, batch_size: int, labeled: bool, ) -> [tf.keras.Input, tf.keras.Input, tf.keras.Input, tf.keras.Input, tf.keras.Input]: moving_image = tf.keras.Input( shape=moving_image_size, batch_size=batch_size, name...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def build_inputs(\n moving_image_size: tuple,\n fixed_image_size: tuple,\n index_size: int,\n batch_size: int,\n labeled: bool,\n) -> [tf.keras.Input, tf.keras.Input, tf.keras.Input, tf.keras.Input, tf.keras.Input]:\n moving_image = tf.keras.Input(\n shape=(*moving_image_size,), batch_size...
[ "0.74781317", "0.7020652", "0.68205154", "0.6803613", "0.6758614", "0.6745477", "0.6561226", "0.6530336", "0.6488972", "0.6451771", "0.6401803", "0.62725765", "0.62625706", "0.6262408", "0.6254835", "0.616202", "0.6155952", "0.6150882", "0.6128436", "0.6106122", "0.60909444",...
0.7470435
1
Add regularization loss of ddf into model.
def add_ddf_loss( model: tf.keras.Model, ddf: tf.Tensor, loss_config: dict ) -> tf.keras.Model: loss_reg = tf.reduce_mean( deform_loss.local_displacement_energy(ddf, **loss_config["regularization"]) ) weighted_loss_reg = loss_reg * loss_config["regularization"]["weight"] model.add_loss(weigh...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def loss(self, X, Y, lmd):\n P, _ = self.forward(X)\n loss = np.mean(-np.log(np.einsum('ij,ji->i', Y.T, P)))\n\n reg = 0 # Regularization term\n for w in self.W:\n reg += np.sum(np.square(w))\n\n reg *= lmd\n\n cost = loss + reg\n\n return cost", "def...
[ "0.63455456", "0.61667484", "0.60805756", "0.60757357", "0.60324085", "0.59627956", "0.58883804", "0.58510906", "0.58356464", "0.5817414", "0.58129907", "0.58129907", "0.5783318", "0.5706253", "0.5695184", "0.5648697", "0.5603422", "0.55787474", "0.5576006", "0.5574673", "0.5...
0.7613506
1
Add image dissimilarity loss of ddf into model.
def add_image_loss( model: tf.keras.Model, fixed_image: tf.Tensor, pred_fixed_image: tf.Tensor, loss_config: dict, ) -> tf.keras.Model: if loss_config["dissimilarity"]["image"]["weight"] > 0: loss_image = tf.reduce_mean( image_loss.dissimilarity_fn( y_true=fixed_i...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def train_D(self, images):\n\n # Sample noise z, generate output G(z)\n noise = self.compute_noise(images.shape[0], self.model.z_dim)\n G_output = self.model.G(noise)\n\n # Classify the generated and real batch images\n DX_score = self.model.D(images) # D(x)\n DG_score = ...
[ "0.6279302", "0.6276216", "0.6276216", "0.56417763", "0.5641206", "0.56169605", "0.54915816", "0.5467536", "0.54571056", "0.5449515", "0.536803", "0.5303079", "0.5301417", "0.5299759", "0.5276228", "0.5274409", "0.52681893", "0.5266836", "0.52594036", "0.5251588", "0.52275616...
0.6664222
1
Handles the ESC% sequence.
def escPercent(self) : if self.minfile[self.pos : self.pos+7] == r"-12345X" : #self.logdebug("Generic ESCAPE sequence at %08x" % self.pos) self.pos += 7 buffer = [] quotes = 0 char = chr(self.readByte()) while ((char < ASCIILIMIT) or (quote...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def cb_check_esc(data, remaining_calls):\n global esc_pressed, vi_buffer, cmd_text, catching_keys_data\n if last_signal_time == float(data):\n esc_pressed += 1\n set_mode(\"NORMAL\")\n # Cancel any current partial commands.\n vi_buffer = \"\"\n cmd_text = \"\"\n weec...
[ "0.6812342", "0.645406", "0.6427925", "0.61390394", "0.6042245", "0.597142", "0.5786621", "0.57699805", "0.57557946", "0.57549417", "0.5721573", "0.5646723", "0.5550067", "0.55322945", "0.5531788", "0.5458349", "0.543286", "0.5431437", "0.54196364", "0.54120016", "0.54112536"...
0.6592571
1
Handles Canon ImageRunner tags.
def handleImageRunner(self) : tag = self.readByte() if tag == ord(self.imagerunnermarker1[-1]) : oldpos = self.pos-2 codop = self.minfile[self.pos:self.pos+2] length = unpack(">H", self.minfile[self.pos+6:self.pos+8])[0] self.pos += 18 if codop...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def process_image(self):\n pass", "def __call__(self, images, targets):\n pass", "def process(self, image):", "def on_image(self, image):", "def on_process_image(self, img, prefix):\n\t\traise NotImplementedError(\"You need to implement this to tweet to timeline (or pass if you don't want to)...
[ "0.6645309", "0.6427157", "0.6351128", "0.63281864", "0.62446356", "0.6240594", "0.6175346", "0.60579926", "0.60579926", "0.60159016", "0.60159016", "0.60156727", "0.6013718", "0.5928864", "0.58572084", "0.5823431", "0.5798933", "0.57932264", "0.5709512", "0.57068586", "0.568...
0.70048636
0
Return PUBLISHED message based on the PUBLISH message received.
def process(self): received_message = PublishMessage(*self.message.value) allow, msg = customize.authorize_publication(received_message.topic, self.connection) answer = None if allow: publication_id = create_global_id() self.broadcast_messages, response = customiz...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def on_publish(client, userdata, mid):\n print(\"Message Published.\")", "def publish(request):\n issue = request.issue\n if issue.edit_allowed:\n form_class = PublishForm\n else:\n form_class = MiniPublishForm\n draft_message = None\n if not request.POST.get('message_only', None):\n query = mod...
[ "0.6156396", "0.5943395", "0.5853581", "0.5687853", "0.56821215", "0.55945885", "0.558449", "0.5567416", "0.55304414", "0.5491364", "0.54436356", "0.5389817", "0.53799397", "0.53675115", "0.52919793", "0.5285353", "0.5283519", "0.5240137", "0.52175355", "0.5157807", "0.514947...
0.6062522
1
Calls registered shift action for the given grammar symbol.
def _call_shift_action(self, context): debug = self.debug token = context.token sem_action = token.symbol.action if self.build_tree: # call action for building tree node if tree building is enabled if debug: h_print("Building terminal node", ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _call_shift_action(self, context):\n debug = self.debug\n token = context.token\n sem_action = token.symbol.action\n\n if self.build_tree:\n # call action for building tree node if tree building is enabled\n if debug:\n h_print(\"Building termina...
[ "0.64362437", "0.58083284", "0.5472519", "0.5405932", "0.534024", "0.5325374", "0.5295643", "0.5295643", "0.5265304", "0.5261245", "0.5103639", "0.5092218", "0.49588338", "0.49423075", "0.49236375", "0.48676485", "0.48510936", "0.4850286", "0.48325142", "0.47916", "0.47611374...
0.60593754
1
Calls registered reduce action for the given grammar symbol.
def _call_reduce_action(self, context, subresults): debug = self.debug result = None bt_result = None production = context.production if self.build_tree: # call action for building tree node if enabled. if debug: h_print("Building non-term...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _call_reduce_action(self, context, subresults):\n debug = self.debug\n result = None\n bt_result = None\n production = context.production\n\n if self.build_tree:\n # call action for building tree node if enabled.\n if debug:\n h_print(\"Bu...
[ "0.57662225", "0.5551271", "0.53377557", "0.52707666", "0.52382267", "0.52345824", "0.5143216", "0.51314694", "0.50739235", "0.49302822", "0.49294648", "0.48488995", "0.4841632", "0.48236185", "0.47548437", "0.47397217", "0.47113505", "0.45758638", "0.45712143", "0.45620832", ...
0.5647278
1
For the given list of matched tokens apply disambiguation strategy.
def _lexical_disambiguation(self, tokens): if self.debug: h_print("Lexical disambiguation.", " Tokens: {}".format([x for x in tokens]), level=1) if len(tokens) <= 1: return tokens # Longest-match strategy. max_len = max((len(x.value) for x i...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def disambiguateWords(self, word_list, tag_list):\n\t\t# print u\" \".join(word_list).encode('utf8');\n\t\t# print u\" \".join(tag_list).encode('utf8');\n\t\n\t\tif len(word_list)==0 or len(word_list)!=len(tag_list):\n\t\t\treturn word_list;\n\t\telse:\n\t\t\tnewwordlist=[];\n\t\t\twordtaglist=list(zip(word_list,t...
[ "0.6592729", "0.64651644", "0.6100285", "0.57694244", "0.57575583", "0.5470414", "0.54121065", "0.5405158", "0.5329084", "0.53212726", "0.52661914", "0.5216783", "0.52162904", "0.5212118", "0.5187984", "0.515725", "0.5138664", "0.5132483", "0.510651", "0.508598", "0.508598", ...
0.6760126
0
The default recovery strategy is to search from the current location for expected terminals. Returns True if successful, False otherwise.
def default_error_recovery(self, head): while head.position < len(head.input_str): head.position += 1 token = self._next_token(head) if token: head.token_ahead = token return True return False
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _terminal_test(self, game, depth):\n if self.time_left() < self.TIMER_THRESHOLD:\n self.timeout_depths.append(depth)\n raise SearchTimeout()\n\n beyond_search_depth = depth >= self.search_depth\n no_legal_moves = len(game.get_legal_moves()) == 0\n\n return beyo...
[ "0.542259", "0.542259", "0.5314984", "0.53074527", "0.52782655", "0.5156155", "0.5131019", "0.51145136", "0.5065869", "0.50623226", "0.49963906", "0.49698153", "0.48765576", "0.4871227", "0.48605087", "0.48404363", "0.4815467", "0.47997767", "0.46984255", "0.46935907", "0.468...
0.5593158
0
Finds all the minimal functional dependencies X>rhs with X subset of lhs. Usually lhs = U\rhs where U is the set of attributes in the relation. The idea of this function is to eliminate unnecessary computation using the fact that, if the fd X>E does not hold, then for all Y subset of X, Y>E doesn't hold either. db_part...
def find_fds_rhs(lhs, rhs, db_partition, test_mode=False): x = {tuple(lhs)} e0 = set() # set with the non-satisfied fds e1 = set() # set with the satisfied fds set_len = lhs.__len__() while x.__len__() != 0 and set_len > 0: level = set() # each level tries the proper subsets of X with len...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def find_LHSs(rhs, attrs, df, partitions, accuracy, masks):\n lhs_attrs = attrs.difference(set([rhs]))\n seeds = nodes_from_seeds(sorted(list(lhs_attrs)))\n min_deps = LHSs(lhs_attrs)\n max_non_deps = LHSs(lhs_attrs)\n trace = []\n while seeds != []:\n node = seeds[0] # should this actual...
[ "0.62974924", "0.5865606", "0.5735515", "0.5554457", "0.53682923", "0.5271781", "0.52280307", "0.5218041", "0.52048236", "0.50691766", "0.48889202", "0.48751596", "0.48490342", "0.4838506", "0.4830531", "0.48198992", "0.4782947", "0.4776574", "0.4747381", "0.47241384", "0.472...
0.66442513
0
Finds the subsets of cardinality k for each element (set) of the list x
def subsets(x, k): sub_set = set() for i in x: sub_set = sub_set.union(set(combinations(i, k))) return list(sub_set)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def k_subsets(set_, k):\n ensure_countable(set_)\n\n if not isinstance(k, Integral):\n raise TypeError(\"subset cardinality must be a number\")\n if not (k >= 0):\n raise ValueError(\"subset cardinality must be positive\")\n if not (k <= len(set_)):\n raise ValueError(\"subset card...
[ "0.7720204", "0.72854334", "0.7243107", "0.7168222", "0.69899297", "0.69096446", "0.68885064", "0.68423504", "0.6712827", "0.6528964", "0.64861095", "0.64861095", "0.6458022", "0.64492786", "0.6430704", "0.6393705", "0.6287829", "0.62864715", "0.62657607", "0.62625057", "0.62...
0.839665
0
Tests if the fds lhs>rhs is satisfied in fds. This function is only for testing purposes
def test_fds_test(lhs, rhs, fds): closure = fds.attribute_closure(lhs) return rhs[0] in closure
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __gt__(self, vs) -> bool:\n return vs <= self", "def fp_gt(x: float, y: float) -> bool:\n return not fp_eq(x, y) and x > y", "def _cmp_fstruct(self, s1, s2, frac_tol, mask):\n if len(s2) > len(s1):\n raise ValueError(\"s1 must be larger than s2\")\n if mask.shape != (len(...
[ "0.58796936", "0.57489437", "0.5731534", "0.5666526", "0.5645582", "0.5642558", "0.5614026", "0.5610124", "0.5603615", "0.5603615", "0.55949885", "0.55658036", "0.554568", "0.55397534", "0.5535892", "0.5522948", "0.55229074", "0.54996073", "0.5495589", "0.54946375", "0.543718...
0.7160488
0
Removes the elements in set_of_sets that are super sets of sub_set
def remove_super_sets(sub_set, set_of_sets): return [x for x in set_of_sets if not set(x).issuperset(set(sub_set))]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def remove_pruned_subsets(subsets, min_deps):\n for n in subsets[:]:\n if min_deps.contains_superset(n.attrs):\n subsets.remove(n)", "def remove_subset(set_, subset):\n ensure_set(set_)\n ensure_iterable(subset)\n\n for elem in subset:\n set_.remove(elem)", "def remove_prun...
[ "0.7332789", "0.7161458", "0.70739305", "0.6937012", "0.69058263", "0.6827412", "0.66181725", "0.65181637", "0.6417106", "0.63042456", "0.62337095", "0.61942023", "0.6188511", "0.6163847", "0.6162156", "0.6138481", "0.61357856", "0.60712695", "0.6062938", "0.60583323", "0.601...
0.9116026
0
Get or set the triangsamples object. The parameter `triangsamples` has to be an instance of the class `spharapy.trimesh.TriMesh`. Setting the triangsamples object will simultaneously check if it in the correct format.
def triangsamples(self): return self._triangsamples
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def sampleTau(self):\n # perform Cholesky factorization Rbar = Lbar.T dot Lbar\n LbarField = self._choleskyRMFields(self.Rbar, self.nCell_cfd)\n # Generate nSample identity random matrix fields, (LFields)\n GFields = self.randomMatrix.sample(self.nSample, self.pOrder)\n for isamp...
[ "0.55859154", "0.53676873", "0.49243876", "0.4758033", "0.47214693", "0.4715205", "0.46934715", "0.46811655", "0.46724606", "0.45840403", "0.45816875", "0.45716864", "0.4570878", "0.45601994", "0.45363176", "0.4531265", "0.4520595", "0.45133793", "0.44980806", "0.447963", "0....
0.63555366
0
Return the SPHARA basis for the triangulated sample points The method determines a SPHARA basis for spatially distributed sampling points described by a triangular mesh. A discrete LaplaceBeltrami operator in matrix form is determined for the given triangular grid. The discretization methods for determining the Laplace...
def basis(self): # lazy evaluation, compute the basis at the first request and store # it until the triangular mesh or the discretization method is changed if self._basis is None or self._frequencies is None: if self.mode == 'fem': self._massmatrix = (self.triangsamp...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_hyperbolic_tiles(self):\n import itertools\n\n s = space(curvature=-1)\n\n # turning constants in radians\n t1_ref = 6.28318530717958647692528676655867\n t2_ref = t1_ref / 2\n t4_ref = t1_ref / 4\n\n def make_triangle(f, v):\n f = t1_ref / f\n ...
[ "0.59415287", "0.5810972", "0.5460677", "0.53912824", "0.537836", "0.5234978", "0.521264", "0.5190832", "0.5172464", "0.5166259", "0.5152519", "0.51436037", "0.51390684", "0.5131656", "0.51265067", "0.5109335", "0.5104018", "0.5094834", "0.50901693", "0.50835675", "0.50709367...
0.62006503
0
Return the massmatrix The method returns the mass matrix of the triangular mesh.
def massmatrix(self): # lazy evaluation, compute the mass matrix at the first request and # store it until the triangular mesh or the discretization method # is changed if self._massmatrix is None: self._massmatrix = self.triangsamples.massmatrix(mode='normal') retur...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def Mass_Matrix(self):\n self.mass_matrix = np.empty((self.N,self.N))\n for n1 in range(self.N):\n for n2 in range(self.N):\n self.mass_matrix[n1,n2] = integrate.quad(lambda x:self.basis[n1](x)*self.basis[n2](x),-1,1)[0]", "def material_matrix(self):\n out = Tmatrix...
[ "0.7246817", "0.70758045", "0.7053071", "0.6931438", "0.65270054", "0.64959997", "0.6477681", "0.6448242", "0.6388519", "0.63806444", "0.6350266", "0.63291156", "0.63291156", "0.62858677", "0.628041", "0.6222232", "0.621956", "0.6169165", "0.61493695", "0.61330867", "0.606264...
0.8440911
0
Return a MIME bundle for display in Jupyter frontends.
def _repr_mimebundle_(self, include, exclude): return renderers.get()(self.to_dict())
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def app_bundle(self) -> str:\n if self.minimize:\n js_url = f\"https://cdn.jsdelivr.net/gh/salesforce/cloudsplaining@{__version__}/cloudsplaining/output/dist/js/index.js\"\n bundle = f'<script type=\"text/javascript\" src=\"{js_url}\"></script>'\n return bundle\n else...
[ "0.61310464", "0.55794567", "0.5460762", "0.5446731", "0.54235196", "0.5399325", "0.53911847", "0.53861356", "0.5315898", "0.5268542", "0.52289283", "0.522581", "0.5222383", "0.5213547", "0.51955634", "0.5189331", "0.51724833", "0.5170243", "0.51659167", "0.5088028", "0.50521...
0.7133241
0
Used when creating the album, as it needs to be related to the creator
def add_album_with_contributor(title, username): album = Album(title=title) album.save() ContributorAlbum(slug=album.slug, username=username).save() return album
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def perform_create(self, serializer):\n serializer.save(owner=self.request.user)", "def perform_create(self, serializer):\n serializer.save(owner=self.request.user)", "def perform_create(self, serializer):\n serializer.save(owner=self.request.user)", "def perform_create(self, serializer)...
[ "0.65831757", "0.65831757", "0.65831757", "0.65831757", "0.65831757", "0.6488359", "0.6439454", "0.64283496", "0.64183915", "0.6306739", "0.62202275", "0.6189925", "0.611416", "0.6101035", "0.6100576", "0.6100576", "0.6100576", "0.6034475", "0.59486526", "0.59470713", "0.5914...
0.6782147
0
Used when adding an existent contributor to an existent album
def add_contributor_album(slug, username): contrib = Contributor.get(username) album = Album.get(slug) ContributorAlbum(slug=album.slug, username=contrib.username).save()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_album_with_contributor(title, username):\n album = Album(title=title) \n album.save()\n ContributorAlbum(slug=album.slug, username=username).save()\n return album", "def test_post_add_album_contrib_as_owner(self):\n self.make_logged_in_owner()\n\n # get our manage page with f...
[ "0.74803764", "0.65657246", "0.65415776", "0.6436727", "0.64360774", "0.62320966", "0.6168189", "0.6168189", "0.61587274", "0.6062143", "0.595339", "0.595339", "0.5950093", "0.5899336", "0.5891353", "0.5877098", "0.58582014", "0.5845494", "0.58208936", "0.58176625", "0.579798...
0.7505874
0
Album deletion can only be done based on slug, thus no conflicts
def delete_album_by_slug(slug): album = get_album_by_slug(slug) [x.delete() for x in ContributorAlbum.scan({"slug": condition.EQ(album.slug)})] album.delete()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def delete(request, slug, username):\n delete_album_contributor(slug, username)\n \n response = HttpResponse(status=204)\n response['Cache-Control'] = 'no-cache'\n return response", "def cmd_album_delete(client, args):\n delete_album = client.album_delete(args.album_id)\n generate_output({'d...
[ "0.6888736", "0.6556271", "0.6163622", "0.5952389", "0.59495986", "0.5918944", "0.58567643", "0.58391935", "0.5832632", "0.5774268", "0.57660323", "0.5679342", "0.5658493", "0.5637132", "0.5582927", "0.5533151", "0.54873204", "0.54847586", "0.5484405", "0.54693687", "0.545955...
0.7940032
0
Get the items in a collection using limitoffset paging.
def get_items( self, limit: Optional[int] = None, offset: int = 0, fields: Iterable[str] = None ) -> 'BoxObjectCollection': return LimitOffsetBasedObjectCollection( self.session, self.get_url('items'), limit=limit, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_slice(self, limit, offset):\r\n if limit == 0:\r\n return self.objects[offset:]\r\n\r\n return self.objects[offset:offset + limit]", "def get_slice(self, limit, offset):\n # Always get the first page\n return super(NoLimitPaginator, self).get_slice(0, 0)", "def ge...
[ "0.69478124", "0.6779926", "0.67551893", "0.6744978", "0.66462934", "0.66391194", "0.6632975", "0.64881206", "0.645165", "0.63969266", "0.63845307", "0.6366552", "0.6357993", "0.632409", "0.632126", "0.6318585", "0.6283258", "0.6261407", "0.62570524", "0.6219417", "0.62056285...
0.76009315
0
Load a Bert Client
def load_bert_client() -> BertClient: return BertClient()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def load_breadboard_client():\n\n import json\n import sys\n import os\n with open(os.path.join(os.path.dirname(__file__), \"breadboard_path_config.json\")) as my_file:\n breadboard_dict = json.load(my_file)\n breadboard_repo_path = breadboard_dict.get(\"breadboard_repo_path\")\n i...
[ "0.64598465", "0.5767674", "0.56796074", "0.5656902", "0.56332827", "0.5606863", "0.55343646", "0.5477369", "0.5460385", "0.5430609", "0.5386382", "0.5313879", "0.53099513", "0.529109", "0.52668875", "0.5258861", "0.52381545", "0.52267784", "0.5216198", "0.5202173", "0.520087...
0.83506197
0
Find target number from list of ints
def find_num(target: int, numbers: List[int]) -> int: for i, num in enumerate(numbers): if num == target: return i return -1
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def linearSearch(values: list, target: int) -> int:\n for i in range(len(values)):\n if target == values[i]:\n return i\n \n return -1", "def pick(self, target: int) -> int:\n\t\tans = None\n cnt = 0\n for i, x in enumerate(self.nums): \n if x == target: \n cnt ...
[ "0.6897303", "0.685705", "0.6728179", "0.6685797", "0.668036", "0.6587649", "0.658512", "0.6526802", "0.65027165", "0.6445933", "0.6339752", "0.62850904", "0.6272045", "0.6240765", "0.62220865", "0.6179218", "0.6173291", "0.6168471", "0.61567307", "0.61140484", "0.6111365", ...
0.8206071
0
Find the last occurance of a number from a list of ints
def last_occurance(target: int, numbers: List[int]) -> int: pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def last_index_of(my_list, my_value):\n return len(my_list) - my_list[::-1].index(my_value)", "def findlastindex(iteratee, seq):\n iteratee = fnc.iteratee(iteratee)\n return next((i for i, value in reversed(tuple(enumerate(seq))) if iteratee(value)), -1)", "def latest(scores: list) -> int:\n re...
[ "0.67861885", "0.6606951", "0.65986973", "0.6564986", "0.64735246", "0.64663184", "0.64490235", "0.6440646", "0.6426665", "0.6395515", "0.63938034", "0.6376038", "0.63716", "0.6364949", "0.6308313", "0.624321", "0.6206382", "0.61868846", "0.6134968", "0.6130991", "0.6116956",...
0.7794958
0
Return information about FB User ID
def get_user_info(self, user_id): uri = '{}/?fields={}&access_token={}&appsecret_proof={}'.format( user_id, FB_USER_FIELDS, self.access_token, self.app_secret_proof) try: response = requests.get(self.url + uri) except Exception: LOGGER.exception('Error conne...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def fb_id(self):\n social_auth = self.social_auth.latest('id')\n return social_auth.uid", "def user_info(user_id):\n return User.query.filter_by(id=user_id).first()", "def user_info(self):\r\n param = {}\r\n param['appid'] = self.apiKey\r\n param['nonce'] = int(time.time()...
[ "0.70822185", "0.6976761", "0.69598633", "0.6939922", "0.6908411", "0.68796605", "0.6850435", "0.6764032", "0.67587334", "0.66086555", "0.66081285", "0.6605946", "0.65709525", "0.65701866", "0.65701866", "0.6562627", "0.6548991", "0.65472597", "0.6517094", "0.64992124", "0.64...
0.70641524
1
Extracts all nouns from the sentence_string.
def get_nouns(self): word_punct_token = WordPunctTokenizer().tokenize(self.sentence_string) clean_tokens = [] for token in word_punct_token: token = token.lower() # remove any value that are not alphabetical new_token = re.sub(r"[^a-zA-Z]+", "", token) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_nouns(self):\n\t\tblob = TextBlob(self.raw_string)\n\n\t\tfor word, tag in blob.tags:\n\t\t\tif tag in ['NNP', 'NN']:\n\t\t\t\tself.nouns.append(word.lemmatize())", "def __get_relevant_words(sentence):\n nouns = None\n try:\n if sentence:\n tokens = nltk.word_tokenize(sentence)\n ...
[ "0.704041", "0.6643563", "0.65388167", "0.63166046", "0.62674236", "0.6093397", "0.59018886", "0.5853606", "0.5843458", "0.5821036", "0.581984", "0.56462425", "0.55715865", "0.553758", "0.54761577", "0.54706633", "0.54552656", "0.54124594", "0.5382601", "0.53791887", "0.53776...
0.7327907
0
Return the number of columns of this Kakuro instance.
def ncolumns(self): return self.__ncols
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def column_count(self):\n return self.column_length", "def GetNumColumns(self):\n return len(self.columns)", "def num_cols(self):\n return len(self.rows[0])", "def ncolumns(self):\n return len(self.__column_list)", "def n_cols(self):\n\n return len(self.plaincolumns)", "def...
[ "0.8542264", "0.8457889", "0.8427655", "0.84257317", "0.84095126", "0.84091353", "0.8408543", "0.83684427", "0.83465314", "0.8269028", "0.8212129", "0.81745464", "0.80785227", "0.80070645", "0.7957829", "0.7950505", "0.7938426", "0.79372364", "0.79028684", "0.79005444", "0.78...
0.8535313
1
Return a string representing the kakuro instance with the given solution.
def str_with_solution(self, solution): bak = self.__data.copy() for k, v in solution.items(): self.__data[k] = v res = str(self) self.__data = bak return res
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __str__(self):\n return f'{self.text}: {self.chs}, correct answer: {self.solution}'", "def __str__(self):\n output = \"Solution for \" + self.vrpdata.InstanceName + \":\\n\"\n output += \"Total distance: \" + str(round(self.objective, 2)) + \"\\n\"\n output += \"Solution valid: \"...
[ "0.6657387", "0.63881916", "0.6257972", "0.6257151", "0.6128489", "0.61164916", "0.59598804", "0.5901943", "0.59001094", "0.5859933", "0.5855426", "0.58453375", "0.5817911", "0.57616097", "0.57536525", "0.574048", "0.5737571", "0.5736057", "0.5731489", "0.5730198", "0.5717515...
0.6712024
0
This function will make out generators to provide our model with both train and validation data.
def make_generators(): # All images will be rescaled by 1./255 train_datagen = ImageDataGenerator(rescale=1./255) test_datagen = ImageDataGenerator(rescale=1./255) train_generator = train_datagen.flow_from_directory( TRAIN_DATA_PATH, target_size= (150, 150), ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def train(self):\n self.dataGenerator.printDataStatistics()\n sE = len(self.dataGenerator.ids[\"train\"])// 32\n sV = len(self.dataGenerator.ids[\"validation\"])// 32\n self.model.fit_generator(\n generator=self.dataGenerator.trainingGenerator,\n steps_per_epoch= s...
[ "0.70969266", "0.7074017", "0.70614856", "0.70605785", "0.699151", "0.69356424", "0.6889953", "0.6871072", "0.68467623", "0.680157", "0.6774476", "0.67295635", "0.6717706", "0.67161566", "0.6681554", "0.66807485", "0.66589004", "0.665683", "0.66468203", "0.6622943", "0.658983...
0.76590663
0
This function will plot and save the history of the training of model to two external png file. One for the model loss over the epochs and one for the model accuracy over the epochs.
def plotHistory(history): acc = history.history['acc'] val_acc = history.history['val_acc'] loss = history.history['loss'] val_loss = history.history['val_loss'] epochs = range(len(acc)) # Make and save the plot for our accuracy plt.plot(epochs, acc, 'bo', label='Training acc') ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def plot_train_history(modell=config.model):\n history = pd.read_csv(f'model/this/{modell}_history.csv')\n epochs = len(history.epoch)\n\n plt.style.use(\"ggplot\")\n plt.rcParams['figure.figsize'] = (5, 9)\n plt.plot(np.arange(0, epochs), history[\"accuracy\"], label=\"model accuracy\", color=\"red...
[ "0.7977149", "0.78650296", "0.78495806", "0.7803552", "0.7779729", "0.776749", "0.7753306", "0.77321535", "0.77168226", "0.77015525", "0.7658724", "0.76476336", "0.76449656", "0.76299965", "0.7609301", "0.75890297", "0.7568557", "0.7522234", "0.7485536", "0.74618995", "0.7457...
0.82532877
0
This function will create, compile, train, plot the history of, and save the model that will predict between many bass guitar notes.
def main(): model = make_model() train_generator, validation_generator = make_generators() history = model.fit_generator( train_generator, steps_per_epoch=350, epochs=30, validation_data=validation_generator, validation_steps=70) model.save('2ndMelSpecModel30Epoc...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def main():\n \n # Load the notes used to train the model\n notes = pickle.load(open('data/notes', 'rb'))\n \n # Load the notes from all video games combined\n all_notes = pickle.load(open('data/all_notes', 'rb'))\n \n # Get number of unique notes, rests, and chords in the midi files\n n...
[ "0.6482984", "0.6248759", "0.6107442", "0.60848117", "0.6071356", "0.6057766", "0.59756935", "0.596948", "0.5928477", "0.58596635", "0.58493274", "0.5839817", "0.5836883", "0.5824653", "0.5790684", "0.5768602", "0.57625675", "0.5759772", "0.5756882", "0.57428855", "0.5741854"...
0.6890652
0
BPM file with PROVHISTORY (old name for HISTORY)
def BPM_PROVHISTORY(): return download_from_archive("bpm_20220128_gmos-s_Ham_11_full_12amp.fits")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def history():", "def phist():\n history = hist();\n for line in history:\n print(line, \":\", history[line])", "def get_history(hdr):\n return hdr['HISTORY']", "def history():\n return apology(\"TODO\")", "def history():\n return apology(\"TODO\")", "def history():\n ...
[ "0.57269067", "0.5609817", "0.5568867", "0.55137694", "0.55137694", "0.55137694", "0.55124533", "0.5498292", "0.54757226", "0.5428406", "0.5398429", "0.5387263", "0.5287365", "0.5286495", "0.52550834", "0.5235499", "0.5219656", "0.5213459", "0.51678", "0.516655", "0.51558787"...
0.7360491
0
Convert AST to C{NetworkX.DiGraph} for graphics.
def ast_to_labeled_graph(tree, detailed): g = nx.DiGraph() for u in tree: if hasattr(u, 'operator'): label = u.operator elif hasattr(u, 'value'): label = u.value else: raise TypeError( 'AST node must be Operator or Terminal, ' ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def onnx_to_graphviz(g, include_attrs=False):\n\n def get_attribute_value(attr):\n # pylint: disable=len-as-condition, no-else-return\n # For Python2:\n # - str(long) has 'L' as suffix, cast it to int\n # - always decode from utf-8 bytes to avoid 'b' prefix\n if attr.HasField(...
[ "0.6587515", "0.63597286", "0.6294866", "0.627144", "0.6201967", "0.6074532", "0.60174185", "0.6013258", "0.5817947", "0.58172935", "0.57610655", "0.5738357", "0.57218426", "0.5716704", "0.5716428", "0.5704641", "0.5683666", "0.5681228", "0.5667547", "0.5666186", "0.5664986",...
0.7188409
0
Check that types in C{tree} are incompatible with C{domains}.
def check_for_undefined_identifiers(tree, domains): for u in tree: if u.type == 'var' and u.value not in domains: var = u.value raise ValueError( ('Undefined variable "{var}" missing from ' 'symbol table:\n\t{doms}\n' 'in subformula:\...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def check_tree_type(tree):\n return tree.type in ref", "def test_change_domain_type_assignment_rule(self):\n pass", "def enforce_node_consistency(self):\n # Loop over each variable (space for word) in the crossword\n # Use copy to prevent domains from being modified while loopin...
[ "0.60200727", "0.597314", "0.5825701", "0.5775754", "0.57678396", "0.5748894", "0.5740573", "0.56898326", "0.5574514", "0.5513598", "0.5471777", "0.5386306", "0.53780425", "0.53614146", "0.5352406", "0.53448987", "0.53350884", "0.53203106", "0.52765816", "0.5265692", "0.52645...
0.6137138
0
Find variable under L{Binary} operator above given node. First move up from C{nd}, stop at first L{Binary} node. Then move down, until first C{Var}. This assumes that only L{Unary} operators appear between a L{Binary} and its variable and constant operands. May be extended in the future, depending on what the tools sup...
def pair_node_to_var(tree, c): # find parent Binary operator while True: old = c c = next(iter(tree.predecessors(c))) if c.type == 'operator': if len(c.operands) == 2: break p, q = tree.successors(c) v = p if q == old else q # go down until termina...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _expr2bddnode(expr):\n\t# print(\"_expr2bddnode\")\n\tif expr.is_zero():\n\t\treturn BDDNODEZERO\n\telif expr.is_one():\n\t\treturn BDDNODEONE\n\telse:\n\t\ttop = expr.top\n\n\t\t# Register this variable\n\t\t_ = bddvar(top.names, top.indices)\n\n\t\troot = top.uniqid\n\t\tlo = _expr2bddnode(expr.restrict({top...
[ "0.5339228", "0.52295554", "0.50677377", "0.5041437", "0.5031985", "0.49616277", "0.48720962", "0.48576695", "0.4832301", "0.48263368", "0.47855213", "0.4772769", "0.47136208", "0.46906525", "0.46764454", "0.46512195", "0.46261036", "0.46183684", "0.46052608", "0.45750728", "...
0.59162974
0
Raise exception if set intersects existing variable name, or values. Values refers to arbitrary finite data types.
def _check_var_conflicts(s, variables): # check conflicts with variable names vars_redefined = {x for x in s if x in variables} if vars_redefined: raise Exception('Variables redefined: {v}'.format(v=vars_redefined)) # check conflicts with values of arbitrary finite data types for var, domain...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_badxvaluewithsets(self):\n Rectangle.reset_objects()\n with self.assertRaises(TypeError) as e:\n r1 = Square(1, {1, 2, 3}, 2, 3)\n self.assertEqual(str(e.exception), 'x must be an integer')", "def test_badyvaluewithsets(self):\n Rectangle.reset_objects()\n w...
[ "0.61296064", "0.5936811", "0.577528", "0.5726689", "0.56829995", "0.5656397", "0.5629316", "0.55581087", "0.5551229", "0.55102354", "0.54137504", "0.53667116", "0.534853", "0.5334453", "0.5313276", "0.530166", "0.53014976", "0.52841115", "0.52704513", "0.5249702", "0.5235442...
0.6406304
0
Setter method for peer_group_name, mapped from YANG variable /network_instances/network_instance/protocols/protocol/bgp/peer_groups/peer_group/config/peer_group_name (string)
def _set_peer_group_name(self, v, load=False): if hasattr(v, "_utype"): v = v._utype(v) try: t = YANGDynClass( v, base=six.text_type, is_leaf=True, yang_name="peer-group-name", parent=self, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _set_evpn_neighbor_peergroup_name(self, v, load=False):\n parent = getattr(self, \"_parent\", None)\n if parent is not None and load is False:\n raise AttributeError(\"Cannot set keys directly when\" +\n \" within an instantiated list\")\n\n if hasattr(v, \"_utype\"):\...
[ "0.6388651", "0.55820066", "0.55820066", "0.555519", "0.5260953", "0.48957533", "0.48141342", "0.48051596", "0.47079813", "0.4597745", "0.45123902", "0.44226515", "0.43617657", "0.43595254", "0.43145773", "0.43107888", "0.43107888", "0.42116663", "0.42069572", "0.41871294", "...
0.78954
1
Setter method for route_flap_damping, mapped from YANG variable /network_instances/network_instance/protocols/protocol/bgp/peer_groups/peer_group/config/route_flap_damping (boolean)
def _set_route_flap_damping(self, v, load=False): if hasattr(v, "_utype"): v = v._utype(v) try: t = YANGDynClass( v, base=YANGBool, default=YANGBool("false"), is_leaf=True, yang_name="route-flap-dampi...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _get_route_flap_damping(self):\n return self.__route_flap_damping", "def _get_route_flap_damping(self):\n return self.__route_flap_damping", "def flap(self) -> None:\n self.delta_time = 0.2\n self.velocity = 37", "def disable_bgp_route_propagation(self) -> Optional[pulumi.Inpu...
[ "0.6670155", "0.6670155", "0.50464815", "0.49564946", "0.49564946", "0.4852906", "0.47725207", "0.45903733", "0.44792357", "0.42650697", "0.4256708", "0.42126364", "0.41603813", "0.4116638", "0.41036993", "0.40746707", "0.40386954", "0.4013948", "0.40102044", "0.40004253", "0...
0.8421709
1
Setter method for peer_group_name, mapped from YANG variable /network_instances/network_instance/protocols/protocol/bgp/peer_groups/peer_group/config/peer_group_name (string)
def _set_peer_group_name(self, v, load=False): if hasattr(v, "_utype"): v = v._utype(v) try: t = YANGDynClass( v, base=six.text_type, is_leaf=True, yang_name="peer-group-name", parent=self, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _set_evpn_neighbor_peergroup_name(self, v, load=False):\n parent = getattr(self, \"_parent\", None)\n if parent is not None and load is False:\n raise AttributeError(\"Cannot set keys directly when\" +\n \" within an instantiated list\")\n\n if hasattr(v, \"_utype\"):\...
[ "0.63907355", "0.5583477", "0.5583477", "0.55552965", "0.5261759", "0.48967224", "0.48166996", "0.48066276", "0.4708673", "0.45989397", "0.45126435", "0.4424181", "0.43623227", "0.43602124", "0.43156803", "0.43112826", "0.43112826", "0.42138124", "0.42072046", "0.41854343", "...
0.7895534
0
Setter method for route_flap_damping, mapped from YANG variable /network_instances/network_instance/protocols/protocol/bgp/peer_groups/peer_group/config/route_flap_damping (boolean)
def _set_route_flap_damping(self, v, load=False): if hasattr(v, "_utype"): v = v._utype(v) try: t = YANGDynClass( v, base=YANGBool, default=YANGBool("false"), is_leaf=True, yang_name="route-flap-dampi...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _get_route_flap_damping(self):\n return self.__route_flap_damping", "def _get_route_flap_damping(self):\n return self.__route_flap_damping", "def flap(self) -> None:\n self.delta_time = 0.2\n self.velocity = 37", "def disable_bgp_route_propagation(self) -> Optional[pulumi.Inpu...
[ "0.6670411", "0.6670411", "0.50461954", "0.495629", "0.495629", "0.4852504", "0.47718793", "0.45903903", "0.4479416", "0.4264815", "0.4255928", "0.4213232", "0.41593775", "0.41157565", "0.41016784", "0.40750417", "0.40383345", "0.4013707", "0.4010021", "0.39996752", "0.397272...
0.8421727
0
Setter method for description, mapped from YANG variable /network_instances/network_instance/protocols/protocol/bgp/peer_groups/peer_group/config/description (string)
def _set_description(self, v, load=False): if hasattr(v, "_utype"): v = v._utype(v) try: t = YANGDynClass( v, base=six.text_type, is_leaf=True, yang_name="description", parent=self, pa...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def description(self, description: ConfigNodePropertyString):\n\n self._description = description", "def get_description(self):\n if CONFIG_KEY not in self:\n return\n if hasattr(self[CONFIG_KEY], DESC_KEY):\n desc_str = str(self[CONFIG_KEY][DESC_KEY])\n if n...
[ "0.61069083", "0.56617916", "0.5597504", "0.55908495", "0.5535336", "0.5373763", "0.53228736", "0.5321155", "0.5290115", "0.52707696", "0.5243526", "0.52357316", "0.52219355", "0.5220431", "0.5206525", "0.5178723", "0.51558536", "0.51558536", "0.51558536", "0.51558536", "0.51...
0.5761193
1
Get IP from a long int
def get_ip_from_long(long_ip): return socket.inet_ntoa(struct.pack('!L', long_ip))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def longToIp(longIp):\n stringIp = socket.inet_ntoa(struct.pack(\"!L\", longIp))\n return stringIp", "def ipToLong(ip):\n packedIP = socket.inet_aton(ip)\n return struct.unpack(\"!L\", packedIP)[0]", "def long2ip(lint):\n return socket.inet_ntoa(struct.pack(\"!I\", lint))", "de...
[ "0.7891864", "0.78559524", "0.7835024", "0.7710035", "0.76549864", "0.7576421", "0.7519363", "0.7221749", "0.71280265", "0.69111276", "0.6889263", "0.6782304", "0.6636306", "0.6530735", "0.63172203", "0.6299375", "0.6286875", "0.62551147", "0.6231494", "0.6223852", "0.62189",...
0.8287169
0
Convert OpenFlow Datapath ID to human format
def datapath_id(a): if isinstance(a, str): dpid = "%s:%s:%s:%s:%s:%s:%s:%s" % ( a[0:2], a[2:4], a[4:6], a[6:8], a[8:10], a[10:12], a[12:14], a[14:16]) else: string = "%.2x:%.2x:%.2x:%.2x:%.2x:%.2x:%.2x:%.2x" if isinstance(a, bytes): a = a.decode("latin") d...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_lacp_sys_id(device):\n res = device.execute(\"show lacp sys-id\")\n #cli output for 'show lacp sys-id' example res: 32768, 70d3.7984.aa80\n res = ''.join([res[i] for i in range(len(res)) if i > 6])\n #Now the value in res: 70d3.7984.aa80\n res1 = ''.join([res[i] for i in range(len(res)) if r...
[ "0.64157075", "0.61956793", "0.6142641", "0.61137575", "0.61104363", "0.60973483", "0.59823877", "0.5975986", "0.59632874", "0.59317726", "0.59248674", "0.5884124", "0.586361", "0.5790779", "0.5767062", "0.5758811", "0.5721861", "0.5718079", "0.5702139", "0.5702121", "0.56987...
0.6462999
0
Print TCP/IP header. It uses command line option p to print 'mininal' or 'full' headers
def print_headers(pkt, overwrite_min=0): if PrintingOptions().is_minimal_headers() and overwrite_min == 0: print_minimal(pkt.position, pkt.l1.time, pkt.l1.caplen, pkt.l3, pkt.l4) else: print_position(pkt.position) print_layer1(pkt.l1.time, pkt.l1.caplen, pkt.l1.trun...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def displayTCP(tcp):\n\n print \"[TCP Header]\"\n print \"\\t Source Port: \" + str(tcp.sport)\n print \"\\t Destination Port: \" + str(tcp.dport)\n print \"\\t Sequence Number: \" + str(tcp.seq)\n print \"\\t Acknowledgment Number: \" + str(tcp.ack)\n print \"\\t Data Offset: \" + str(tcp.dataof...
[ "0.68259215", "0.68247175", "0.63290894", "0.62992567", "0.60704964", "0.60693145", "0.5978117", "0.5895332", "0.585004", "0.5826223", "0.58216", "0.5788322", "0.5776013", "0.573323", "0.5729823", "0.57296735", "0.5714077", "0.5712118", "0.56988066", "0.5692439", "0.5672327",...
0.6886594
0
Print TCP/IP header with minimal information
def print_minimal(position, date, getlen, ip_addr, tcp): string = 'Packet #%s - %s %s:%s -> %s:%s Size: %s Bytes' source = OFProxy().get_name(ip_addr.s_addr, tcp.source_port) dest = OFProxy().get_name(ip_addr.d_addr, tcp.dest_port) print(string % (position, date, cyan(source), cyan(tcp.source_port), ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def displayTCP(tcp):\n\n print \"[TCP Header]\"\n print \"\\t Source Port: \" + str(tcp.sport)\n print \"\\t Destination Port: \" + str(tcp.dport)\n print \"\\t Sequence Number: \" + str(tcp.seq)\n print \"\\t Acknowledgment Number: \" + str(tcp.ack)\n print \"\\t Data Offset: \" + str(tcp.dataof...
[ "0.77554166", "0.7025853", "0.6953015", "0.6674366", "0.6625914", "0.66170645", "0.65838134", "0.65690565", "0.6557152", "0.6511575", "0.65036327", "0.64393747", "0.6331855", "0.6302267", "0.62660515", "0.62660515", "0.62430453", "0.61718196", "0.6171234", "0.61542714", "0.61...
0.7096347
1
Just prints that the TCP connection was terminated (FIN or RST flag).
def print_connection_terminated(pkt): print_headers(pkt, overwrite_min=0) print(red("!!!! Attention: TCP/OpenFlow Connection Terminated!!\n"))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def tcp_fin(self):\n return self.tcp_flags & dpkt.tcp.TH_FIN != 0", "def eof_received(self):\n logger.debug(\"EOF from client, closing.\")\n self.connection_lost(None)", "def outConnectionLost(self):\n self.logger('stdout closed by process %d' % self._pid)", "def on_connection_end...
[ "0.6347258", "0.6250159", "0.6225721", "0.6224855", "0.61981726", "0.6002705", "0.5983145", "0.59824896", "0.5968627", "0.59684265", "0.5964312", "0.59535646", "0.59128535", "0.58037907", "0.5780889", "0.5776544", "0.57739186", "0.57569766", "0.5739121", "0.57353306", "0.5718...
0.769878
0
Just prints that a new TCP connection is being established.
def print_connection_being_established(pkt): print_headers(pkt, overwrite_min=0) print(green("!!!! New TCP/OpenFlow Connection being established!!\n"))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def on_connection_start(self) -> None:\r\n print(\r\n \"Connected with: {}:{}\\n\".format(\r\n self.connection_info[\"host\"], self.connection_info[\"port\"]\r\n )\r\n )", "def connect():\n logging.info('Client connected')", "def connectionMade(self):\n ...
[ "0.7560201", "0.71477664", "0.68863255", "0.67417765", "0.67133015", "0.661822", "0.64948887", "0.64504004", "0.6437214", "0.6415456", "0.63819456", "0.6380913", "0.6280628", "0.62490803", "0.62355256", "0.6143209", "0.6108159", "0.6106273", "0.6080479", "0.6068739", "0.60646...
0.8331354
0
Create Django view for given SOAP soaplib services and tns
def __init__(self, services, tns): return super(DjangoSoapApp, self).__init__(Application(services, tns))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def call_service(func, api_kwargs, context, request):\n pattern = request.matched_route.pattern\n service = request.registry['soap_services'].get(pattern)\n request.META = request.headers.environ # to be used by soapbox, like django\n request.service = service\n\n SOAP = service.version\n\n if r...
[ "0.56936353", "0.5549895", "0.5401282", "0.5395464", "0.53373414", "0.52628684", "0.5209494", "0.52003735", "0.5165469", "0.5165354", "0.5142136", "0.506702", "0.4981452", "0.49758002", "0.495154", "0.49393404", "0.4938176", "0.49051088", "0.489236", "0.4879681", "0.487864", ...
0.7150832
0
Values tagged True are right, those tagged False are left. >>> partition([(True, 1), (False, 2), (True, 3)]) ([2], [1, 3])
def partition(xs): left, right = [], [] for b, x in xs: if b: right.append(x) else: left.append(x) return left, right
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def partition(is_included_fn, items):\n item_by_exclusion = { True : [], False : [] }\n for item in items:\n # \"not\" to normalise all values to either True or False\n item_by_exclusion[not is_included_fn(item)].append(item)\n return (item_by_exclusion[False], item_by_exclusion[True])", "...
[ "0.6702738", "0.6410004", "0.63018924", "0.61310256", "0.5890226", "0.5880578", "0.5873819", "0.58590937", "0.5840328", "0.5830201", "0.5793266", "0.5698566", "0.56066245", "0.55598056", "0.5480577", "0.54560906", "0.53937507", "0.5380315", "0.5350227", "0.53156364", "0.51864...
0.6741035
0
Increase the indentation of a string or a list of lines. >>> print(indent(['ab','cd'])) ab cd >>> print(indent('ab'+chr(10)+'cd')) ab cd >>> indent(['ab','cd'], join=False) [' ab', ' cd']
def indent(lines_or_str, indent_str=' ', join=True): if isinstance(lines_or_str, str): lines = lines_or_str.split('\n') else: lines = lines_or_str indented = (indent_str + line.rstrip() for line in lines) if join: return '\n'.join(indented) else: return list(indented...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _add_indent(script, indent=2):\n if not isinstance(script, list):\n script = [script]\n\n indent = ' ' * indent\n return [indent + s for s in script]", "def out_indent(indent, *args):\n s = \"\"\n s += indent * \" \"\n s += \" \".join(args)\n return s", "def _tex...
[ "0.6404776", "0.6222365", "0.62022024", "0.606965", "0.6027597", "0.5771415", "0.57700354", "0.57553583", "0.57324594", "0.57014495", "0.56932503", "0.5672846", "0.56462896", "0.5641806", "0.5585611", "0.55051905", "0.5477424", "0.5429202", "0.53347677", "0.5225045", "0.52219...
0.64578503
0
Runs the test expressed in test.yaml in this directory. Returns an info tuple (bad, good) where bad is empty if test succeeded.
def run_test(test_dir, verbose, cleanup=False): try: with open(path.join(test_dir, 'test.yaml'), 'r') as y: lines = yaml.load(y) except Exception as e: return ['Error when loading test.yaml:', str(e)], [] if not isinstance(lines, list): lines = [lines] ### # Run...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def run_and_parse(test_description: Tuple[str, str, List[str]]):\n test_executable, test_name, performance_counters = test_description\n try:\n test_output = run_test(test_executable, test_name, performance_counters)\n print(f'Finished running test {test_name}', file=sys.stderr)\n return (test_name, par...
[ "0.62012964", "0.61662644", "0.6133187", "0.6129144", "0.61103195", "0.6104685", "0.6086023", "0.6045092", "0.6040847", "0.6023762", "0.5999768", "0.5942272", "0.5941968", "0.5941968", "0.5941968", "0.5941968", "0.59351724", "0.59348893", "0.59168726", "0.5899236", "0.5897983...
0.66893864
0
Removes the goal_ prefix the last part of a path. >>> goal_('test/example/goal_stdout') 'test/example/stdout'
def goal_(s): a, b = path.split(s) return path.join(a, b[len('goal_'):])
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _cleanup_path(path):\n return string.join(filter(None, string.split(path, '/')), '/')", "def remove_upper_level_references(path):\n return os.path.normpath(\"/\" + path).lstrip(\"/\")", "def noTrailingSlash(path):\n return path.split('/')[0]", "def clean_path(path: str) -> str:\n previous_p...
[ "0.60307145", "0.57229716", "0.5715473", "0.5688186", "0.5674716", "0.5644565", "0.56161475", "0.55927324", "0.5566452", "0.54711074", "0.5469103", "0.53800195", "0.53389007", "0.531018", "0.52937573", "0.5282302", "0.527961", "0.5251023", "0.5239179", "0.52235764", "0.520575...
0.7695428
0
Checks that files starting with goal_ match those without the prefix, and same for files immediately under directories with the goal_ prefix.
def check_goal_diffs(test_dir, verbose): for dir, _, files in os.walk(test_dir): if path.split(dir)[1].startswith('goal_'): for filename in files: yield match(path.join(dir, filename), path.join(goal_(dir), filename), verbos...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _verify_prefix(prefix, files):\n for f in files:\n f = os.path.join(prefix, f)\n if not os.path.exists(f):\n return False\n else:\n return True", "def test_matches__directories_only(self):\n path_rule1 = gitignore_parser(\"z/?u*ns/\")[0]\n \"This is a direc...
[ "0.66083395", "0.61296135", "0.583389", "0.5791732", "0.5715193", "0.570771", "0.5669999", "0.5637614", "0.5604362", "0.558369", "0.55686224", "0.55355316", "0.5531146", "0.5530527", "0.55255556", "0.55255556", "0.54851806", "0.54774755", "0.5474746", "0.5471383", "0.5463467"...
0.650246
1
Returns the subdirectories that has a test.yaml file.
def dirs_with_test_yaml(dirs): for root in dirs or ['tests/']: for dir, subdirs, files in os.walk(root): if 'test.yaml' in files: yield dir
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def find_yaml_files(path):\n return glob.glob(path + \"/*.yml\")", "def _include_dir_list_yaml(\n loader: SafeLineLoader, node: yaml.nodes.Node\n) -> List[JSON_TYPE]:\n loc = os.path.join(os.path.dirname(loader.name), node.value)\n return [load_yaml(f) for f in _find_files(loc, \"*.yaml\")]", "def ...
[ "0.66035277", "0.65594333", "0.64663523", "0.643186", "0.63550246", "0.63149697", "0.62718517", "0.62025845", "0.616682", "0.6156252", "0.61524206", "0.61174434", "0.6068756", "0.6063016", "0.6062418", "0.59867674", "0.5979589", "0.5973867", "0.5966642", "0.59132445", "0.5907...
0.73936975
0
Runs all tests in the directories in dirs. Returns a stream of booleans answering "Success?".
def run_tests(dirs, verbose=False, cleanup=False): for dir in dirs: if verbose: print(dir) errors, checked = run_test(dir, verbose=verbose, cleanup=cleanup) if errors: print('fail: ' + dir) print(indent(list(map(indent, errors)))) yield False ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def run_all_tests():\n successes = 0\n testsrun = 0\n testsdir = tests_dirpath()\n for test in os.listdir(testsdir):\n path = os.path.join(testsdir, test)\n if os.path.isdir(path):\n testsrun += 1\n if run_test(path):\n successes += 1\n print(\"--- ...
[ "0.75694424", "0.70750535", "0.64101243", "0.63706607", "0.62386507", "0.6132275", "0.6126261", "0.6087806", "0.60795885", "0.6002059", "0.5946204", "0.59053445", "0.5825426", "0.5796565", "0.57917863", "0.5771267", "0.5758229", "0.5734138", "0.57273924", "0.57239646", "0.570...
0.81278753
0
Returns the stream of .py files reachable from the current directory.
def pyfiles(): for dir, _, files in os.walk('.'): for f in files: if f.endswith('.py'): name = path.join(dir, f) if name.startswith('./'): yield name[2:] else: yield name
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _get_files(self):\n # pylint: disable=unused-variable\n for dirpath, __, filenames in os.walk(self.start_location):\n for file_ in filenames:\n if file_.endswith('.py'):\n yield \"{0}{1}\".format(dirpath, file_)", "def source(self):\n return s...
[ "0.64829564", "0.57618725", "0.57601637", "0.57460487", "0.5703258", "0.56198907", "0.55846214", "0.548047", "0.54259604", "0.5422842", "0.541674", "0.54144967", "0.5414251", "0.53836733", "0.5323467", "0.5261406", "0.52353126", "0.523354", "0.52130747", "0.5198661", "0.51954...
0.601096
1
Gets the GROMACS installed version and returns it as an int(3) for versions older than 5.1.5 and an int(5) for 20XX versions filling the gaps with '0' digits.
def get_gromacs_version(gmx: str = "gmx") -> int: unique_dir = fu.create_unique_dir() out_log, err_log = fu.get_logs(path=unique_dir, can_write_console=False) cmd = [gmx, "-version"] try: cmd_wrapper.CmdWrapper(cmd, out_log, err_log).launch() pattern = re.compile(r"GROMACS version:\s+(.+...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_version():\n major=c_int_t(0)\n minor=c_int_t(0)\n patch=c_int_t(0)\n safe_call(backend.get().af_get_version(c_pointer(major), c_pointer(minor), c_pointer(patch)))\n return major.value,minor.value,patch.value", "def get_version():\n return '%d.%d.%d' % version_info", "def getversion()...
[ "0.65095896", "0.65088385", "0.6415477", "0.64125276", "0.6376649", "0.63351995", "0.6302721", "0.62614006", "0.62154704", "0.62043744", "0.61745983", "0.60750234", "0.6064383", "0.60511655", "0.604701", "0.60310704", "0.60179377", "0.5979122", "0.5956135", "0.59463084", "0.5...
0.70138144
0
Creates an MDP file using the following hierarchy mdp_properties_dict > input_mdp_path > preset_dict
def create_mdp(output_mdp_path: str, input_mdp_path: str = None, preset_dict: Mapping[str, str] = None, mdp_properties_dict: Mapping[str, str] = None) -> str: mdp_dict = {} if preset_dict: for k, v in preset_dict.items(): mdp_dict[k] = v if input_mdp_path: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def make_data_raw (mdp,do_makedata,filename):\n #\n fin = open(filename,'r')\n for line in fin:\n lsp = line.split(' ')\n if len(lsp) > 1: # skip empty lines\n if lsp[0] == \"for\": # indicates when to get correlator\n lsp.pop(0)\n update_params(mdp,lsp)\n ## -- do_makedata tells it to go ahead with g...
[ "0.5505155", "0.54537225", "0.54450774", "0.5346326", "0.53137314", "0.52562153", "0.5215968", "0.51548755", "0.5151159", "0.5133407", "0.5107904", "0.508078", "0.50662065", "0.5035198", "0.5001301", "0.4993961", "0.49878114", "0.49868137", "0.49628305", "0.49551043", "0.4952...
0.8359074
0
Perform the calculation to apply image normalization. The given region in the given extension (``ext``) of the given frame is either multiplied or divided by (as determined by ``operand``) the ``norm_value``.
def apply_norm(frame, operand, norm_value, region): # Determine region if region == 'regionAorC': x1 = 0 x2 = 2048 elif region == 'regionBorD': x1 = 2048 x2 = 4096 elif region == 'None': x1 = 0 x2 = 4096 # Apply gain to specific region if operand...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def normalize_image(self, factor, luminosity=None):\n if not luminosity:\n luminosity = self.average_luminosity()\n\n for i in range(len(self.pixels)):\n self.pixels[i] = self.pixels[i] * (factor / luminosity)", "def _normalize(self):\r\n self.dataframe['norm_in...
[ "0.55131394", "0.5412408", "0.53855616", "0.5378237", "0.537775", "0.53257436", "0.53024244", "0.5246205", "0.52232647", "0.52215457", "0.5218962", "0.51996726", "0.5157911", "0.5149881", "0.5131564", "0.5130251", "0.51260364", "0.512515", "0.51034755", "0.5097461", "0.509342...
0.74371934
0