query
stringlengths
10
2k
document
stringlengths
20
51.2k
metadata
dict
negatives
listlengths
0
101
negative_scores
listlengths
0
101
document_score
stringlengths
3
10
document_rank
stringclasses
102 values
Returns a random salt
def get_salt(): return os.urandom(32)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_salt(self):\n if not self.id and not self._salt:\n self._salt = b64encode(os.urandom(8))\n\n if isinstance(self._salt, str):\n self._salt = self._salt.encode('UTF-8')\n\n return self._salt", "def generate_salt(size):\n return hexlify(urandom(size)).decode()", "def gen_salt(sal...
[ "0.8208197", "0.8141332", "0.8120856", "0.76874363", "0.76276225", "0.753985", "0.753985", "0.7487075", "0.74458814", "0.7239344", "0.7210322", "0.6749319", "0.6642846", "0.65517455", "0.65449864", "0.6521097", "0.6417631", "0.63920826", "0.63829124", "0.6352779", "0.6329167"...
0.9010938
0
Returns whther `username` is a valid username
def valid_username(username): if username is None: # SQLite integrity check return False if len(username) > 32: # Arbitrary length cap return False if len(username) < 1: # Not-as-arbitrary length minimum return False for i in username: if i not in config.CHARSET: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _check_username(self, username):\n if self.username_regex.search(username) is not None:\n print(\"Correct username\")\n return True\n else: \n print(\"Wrong username\")\n return False", "def is_username_valid(username):\n user = User.objects.fi...
[ "0.8576425", "0.8561592", "0.8560917", "0.85375226", "0.84740156", "0.84674835", "0.84423506", "0.84391683", "0.8329774", "0.8281463", "0.8276092", "0.82279956", "0.8207331", "0.8156494", "0.8125877", "0.8100915", "0.8070714", "0.7977137", "0.7971118", "0.79438573", "0.792348...
0.8025782
17
Returns whether `password` is a valid password
def valid_password(password): if password is None: # SQLite integrity check return False if len(password) < 8: # Arbitrary length minimum return False return True
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_password_valid(password):\n #TODO : This should also be handled by the front_end\n pass", "def is_valid_password(self, password):\n rex = \"^[a-zA-Z0-9@_+-.]{3,}$\"\n return re.match(rex, password)", "def valid_password(self, password):\n return check_hash(password, se...
[ "0.87454367", "0.8660112", "0.8586293", "0.8528036", "0.8494582", "0.8441788", "0.8433028", "0.8433028", "0.84240866", "0.83845115", "0.8372505", "0.83517027", "0.8325985", "0.8317121", "0.8299054", "0.8296174", "0.82764715", "0.8269013", "0.82432264", "0.82229614", "0.819724...
0.8373025
10
Return user logged into session `session`
def get_logged_in_user(session): if is_logged_in(session): return session['user'] else: return None
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_logged_user():\n return get_from_session(KEY_USER)", "def logged_in_user():\n try:\n return session['user']\n except KeyError:\n raise NoLoggedInPlayerException()", "def get_user_from_session(session_id):\n if Configuration.enable_session:\n user = um.get_user_from_sess...
[ "0.7982769", "0.7766468", "0.7722101", "0.7675123", "0.721653", "0.7183063", "0.7122054", "0.71118444", "0.7054212", "0.70261055", "0.70214546", "0.6982469", "0.6974961", "0.6969549", "0.69221324", "0.69007117", "0.68710655", "0.6831449", "0.6805409", "0.67993087", "0.6791058...
0.85343933
0
check_password(str, str) > return Boolean
def check_password(hashed_password, password): return check_password_hash(hashed_password, password)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _check_password(self, password):\n if self.password_regex.search(password) is not None:\n print(\"Correct password\")\n return True\n else:\n print(\"Wrong password\")\n return False", "def test_check_password():\n assert check_password('Longpasswo...
[ "0.83673686", "0.82503486", "0.818368", "0.8129318", "0.8112791", "0.8098574", "0.80528426", "0.80272865", "0.80161875", "0.7981553", "0.79762876", "0.7971066", "0.79646784", "0.7963909", "0.7961851", "0.7961247", "0.7942472", "0.7918761", "0.79164815", "0.7915394", "0.791143...
0.73794585
85
checks if input somerow, somecol is a valid position on the board
def is_valid_position(self, somerow, somecol): valid_row = 0 <= somerow <= (self.size-1) valid_col = 0 <= somecol <= (self.size-1) #need to use self.size - 1 because while we're thinking of an 8x8 chess board, the computer is thinking of a 0x7 chess board return valid_row and valid_col
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def valid_move(board, row, col):\n return board[row][col] == '-'", "def attack(self, somerow, somecol):\n valid_move = True\n for i in range(self.size):\n if self.is_valid_position(somerow, i):\n if self.board[somerow][i] != \"0\":\n #checks the same ...
[ "0.7639755", "0.7625058", "0.7609505", "0.7515943", "0.7493321", "0.7408972", "0.7407812", "0.7331324", "0.7275376", "0.7235455", "0.72035295", "0.71923167", "0.71921295", "0.7175722", "0.7157514", "0.7129543", "0.7113458", "0.71117043", "0.7104877", "0.7096316", "0.70895207"...
0.86054844
0
The current running state of the scheduler.
def state(self) -> RunState: return self._async_scheduler.state
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def running(self):\n return self.scheduler.running", "def running_state(self) -> int | None:\n return self.cluster.get(\"running_state\")", "def running(self):\n info = self.info()\n return info['running']", "async def read_running_state(self):\n # PROTECTED REGION ID(Async...
[ "0.78625226", "0.77582985", "0.75168455", "0.74741316", "0.740753", "0.7257067", "0.71971244", "0.7186842", "0.71654296", "0.7161242", "0.711987", "0.70992297", "0.70930713", "0.70719624", "0.7069338", "0.7058646", "0.7048098", "0.704517", "0.7019892", "0.69975895", "0.699758...
0.83317935
0
Funcion que inicializa el RequestFactory y un usuario de prueba para realizar los test
def setUp(self): # Se crea el Request factory pars simular peticiones self.factory = RequestFactory() # Se crea el User que realiza las peticiones self.user = User.objects.create_user(username='testuser', email='test@test.com', password='test')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def setUp(self):\n self.factory = RequestFactory()", "def setUp(self):\n self.factory = RequestFactory()", "def setUp(self):\n self.factory = RequestFactory()", "def setUp(self):\n UsuarioFactory.create()\n self.user = Usuario.objects.get(username='admin')\n Proyecto...
[ "0.8152422", "0.8152422", "0.8152422", "0.80186886", "0.7303293", "0.72484493", "0.71102047", "0.7027854", "0.68202835", "0.68063843", "0.67635506", "0.673852", "0.6719423", "0.6669916", "0.66214174", "0.6508954", "0.64917874", "0.6479835", "0.64433044", "0.6442", "0.6397828"...
0.7998286
4
Creates a new flask app instance
def create_app(env='dev', services=dict()): # Create the flask app app = Flask(__name__) # Do everything in the app context with app.app_context(): from flask import current_app, g g._env = env # Load the config current_app.config.from_object('service.config.config_%s...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_app() -> Flask:\r\n app = Flask(__name__.split('.')[0])\r\n init_config(app)\r\n app.register_blueprint(observer)\r\n app.teardown_appcontext(close_db)\r\n app.cli.add_command(init_db)\r\n\r\n return app", "def app():\n return create_app()", "def make_app() -> Flask:\n logger...
[ "0.8474935", "0.8377801", "0.8351886", "0.8350974", "0.833775", "0.83145094", "0.8283512", "0.8275917", "0.82234687", "0.81837445", "0.8182019", "0.81813145", "0.8163062", "0.8162504", "0.8154517", "0.81239367", "0.81128496", "0.8102725", "0.80830365", "0.8078559", "0.8075497...
0.0
-1
Sets the allow_origins of this PoliciesCorsPolicy.
def allow_origins(self, allow_origins): self._allow_origins = allow_origins
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_cors(self, allow_origins):\n\n self._api_manager.set_cors(allow_origins)", "def allowed_origins(self):\n\n return self._allowed_origins", "def allow_origins(self) -> Optional[Sequence[str]]:\n return pulumi.get(self, \"allow_origins\")", "def __init__(__self__, *,\n ...
[ "0.7647578", "0.6897975", "0.68845975", "0.64569545", "0.6432927", "0.6404761", "0.6057163", "0.59002167", "0.56471646", "0.56174624", "0.5577251", "0.54534507", "0.5451014", "0.54480773", "0.5442722", "0.5437039", "0.5388862", "0.5354993", "0.5316266", "0.5298737", "0.529708...
0.8180758
0
Sets the handle_pre_flight of this PoliciesCorsPolicy.
def handle_pre_flight(self, handle_pre_flight): self._handle_pre_flight = handle_pre_flight
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self, allow_origins=None, handle_pre_flight=False, allow_headers=None, max_age=-1, allow_methods=None, allow_credentials=False, expose_headers=None): # noqa: E501 # noqa: E501\n\n self._allow_origins = None\n self._handle_pre_flight = None\n self._allow_headers = None\n s...
[ "0.50519", "0.5010759", "0.5008292", "0.48886257", "0.48626038", "0.48537427", "0.48124483", "0.4772793", "0.4754322", "0.47244585", "0.46515507", "0.46155578", "0.46040416", "0.45802784", "0.4566349", "0.45465562", "0.4544266", "0.45350984", "0.4530764", "0.4470253", "0.4469...
0.77318203
0
Sets the allow_headers of this PoliciesCorsPolicy.
def allow_headers(self, allow_headers): self._allow_headers = allow_headers
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def access_control_allow_headers(self) -> str:\n if self._access_control_allow_headers is None:\n access_control_allow_headers = self._get_env(\"ACCESS_CONTROL_ALLOW_HEADERS\")\n self._access_control_allow_headers = access_control_allow_headers\n\n return self._access_control_al...
[ "0.6678761", "0.6608605", "0.65186864", "0.65150666", "0.6292688", "0.62827146", "0.62311417", "0.61149555", "0.6017598", "0.597709", "0.59209776", "0.5904409", "0.58088833", "0.5795862", "0.5752888", "0.5707614", "0.569921", "0.569658", "0.56665033", "0.5613601", "0.558559",...
0.8209735
0
Sets the max_age of this PoliciesCorsPolicy.
def max_age(self, max_age): if (max_age is not None and max_age < -1): # noqa: E501 raise ValueError("Invalid value for `max_age`, must be a value greater than or equal to `-1`") # noqa: E501 self._max_age = max_age
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def max_age(self, max_age):\n\n self._max_age = max_age", "def max_age(self, max_age):\n self._max_age = max_age", "def org_eclipse_jetty_servlet_max_age(self, org_eclipse_jetty_servlet_max_age: ConfigNodePropertyInteger):\n\n self._org_eclipse_jetty_servlet_max_age = org_eclipse_jetty_ser...
[ "0.76007694", "0.75818765", "0.6181315", "0.60036486", "0.60036486", "0.5991255", "0.59530157", "0.5952936", "0.5570798", "0.5560669", "0.5554711", "0.5550679", "0.5514026", "0.5476603", "0.5476603", "0.542057", "0.53712803", "0.53712803", "0.5309323", "0.52821743", "0.516930...
0.6974845
2
Sets the allow_methods of this PoliciesCorsPolicy.
def allow_methods(self, allow_methods): self._allow_methods = allow_methods
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def allowed_methods(self) -> typing.List[\"HttpMethods\"]:\n return self._values.get('allowed_methods')", "def allowAllMethods(self):\n self._addMethod(\"Allow\", HttpVerb.ALL, \"*\", [])", "def set_cors(self, allow_origins):\n\n self._api_manager.set_cors(allow_origins)", "def allow_ori...
[ "0.6656358", "0.66477054", "0.63585037", "0.6190399", "0.6175036", "0.588851", "0.5887324", "0.587138", "0.5630361", "0.5620242", "0.5606626", "0.56046224", "0.56025434", "0.55465657", "0.5531737", "0.5527642", "0.5421097", "0.54193413", "0.5416426", "0.5416027", "0.5399164",...
0.7412258
0
Returns true if both objects are equal
def __eq__(self, other): if not isinstance(other, PoliciesCorsPolicy): return False return self.to_dict() == other.to_dict()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __eq__(self, other):\n return are_equal(self, other)", "def __eq__(self, other):\n return are_equal(self, other)", "def __eq__(self,other):\n try: return self.object==other.object and isinstance(self,type(other))\n except: return False", "def __eq__(self, other):\n if i...
[ "0.8088132", "0.8088132", "0.8054589", "0.7982687", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", ...
0.0
-1
Returns true if both objects are not equal
def __ne__(self, other): if not isinstance(other, PoliciesCorsPolicy): return True return self.to_dict() != other.to_dict()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __ne__(self, other: object) -> bool:\n if self.__eq__(other):\n return False\n return True", "def __ne__(self, other: object) -> bool:\n return not self.__eq__(other)", "def __ne__(self, other) -> bool:\n return not self.__eq__(other)", "def __eq__(self, other):\n ...
[ "0.845611", "0.8391477", "0.8144138", "0.81410587", "0.8132492", "0.8093973", "0.80920255", "0.80920255", "0.80920255", "0.8085325", "0.8085325", "0.8076365", "0.8076365", "0.8065748", "0.8042487", "0.8042487", "0.8042487", "0.8042487", "0.8042487", "0.8042487", "0.8042487", ...
0.0
-1
Sort apps, based on the tab_order property in the config, if it exists. Anything with a value specified comes before everything else, which is arbitrarily sorted at the end.
def _tab_order_sorter(app1, app2): app1_order = int(app1["taborder"]) if "taborder" in app1 else sys.maxsize app2_order = int(app2["taborder"]) if "taborder" in app2 else sys.maxsize return app1_order - app2_order
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_app_list(self, request):\n app_dict = self._build_app_dict(request)\n\n # Sort the apps alphabetically.\n app_list = sorted(app_dict.values(), key=lambda x: x['order'])\n\n # Sort the models alphabetically within each app.\n for app in app_list:\n app['models']...
[ "0.6152258", "0.604614", "0.5984999", "0.53825635", "0.5284853", "0.52329206", "0.522487", "0.51849484", "0.5095874", "0.5049147", "0.5045796", "0.5008434", "0.4995336", "0.49815857", "0.49733093", "0.49688753", "0.49669898", "0.49626705", "0.4935812", "0.4927117", "0.4916017...
0.68363637
0
Array with entry for each point. Each entry is (x, y, visible) Where visible is 1 for seen points, 0 for hidden. This will grab 21 points, starting at offset.
def get_hand_points(index, annotations, offset): # Get the index, and entry in array this_index = annotations[index]['uv_vis'] points = [None] * 21 # Grab all the points points[FINGER_MAP["Wrist"]] = this_index[offset + 0] points[FINGER_MAP["Thumb1"]] = this_index[offset + 1] points[...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_neighbors(point):\n pt = point.copy()\n output= [point.copy() for i in range(4)]\n output[0:2] = map(Point.setY, output[0:2], [pt.getY()+ i for i in range(-1,2,2)])\n output[2:4]= map(Point.setX, output[2:4], [pt.getX()+ i for i in range(-1,2,2)])\n return output", "def _collect_points(sel...
[ "0.61788267", "0.6125943", "0.6024688", "0.60170466", "0.59531415", "0.5947752", "0.59284425", "0.5914441", "0.5905948", "0.58377725", "0.5802081", "0.5800875", "0.57752895", "0.5765023", "0.5754854", "0.5714531", "0.569113", "0.5639593", "0.56307304", "0.5626553", "0.5624364...
0.60390353
2
Get all the points for the left hand.
def get_left_hand(index, annotations): return get_hand_points(index, annotations, 0)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_points(self):\n\t\treturn self.points", "def get_points(self):\r\n return self.points", "def get_lattice_points(self) -> List[np.ndarray]:\n lattice_points = []\n for factor in self.get_all_factors():\n lp = cast_integer_matrix(np.dot(self.left_inv, factor))\n ...
[ "0.68963695", "0.6827265", "0.68155766", "0.6739901", "0.6640089", "0.65664923", "0.65664923", "0.654761", "0.654761", "0.6474059", "0.64620525", "0.64620525", "0.64620525", "0.64620525", "0.64620525", "0.6426985", "0.6365052", "0.627833", "0.6242686", "0.62382686", "0.621840...
0.6600348
5
Compute the softmax of vector x.
def softmax(x): exps = np.exp(x) return exps / np.sum(exps)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def softmax(self, x):\n\n out = np.zeros(x.shape)\n for i in range(x.shape[0]):\n max_x = x[i] - np.max(x[i])\n out[i] = np.exp(max_x) / np.sum(np.exp(max_x), axis=0)\n\n return out", "def softmax(self, x):\n if x.ndim == 1:\n x = x.reshape((1, -1))\n ...
[ "0.9027024", "0.88849884", "0.88833356", "0.88713694", "0.886723", "0.8852517", "0.8851923", "0.8849374", "0.88411117", "0.88389105", "0.8815639", "0.8813908", "0.8813908", "0.8811473", "0.8801066", "0.8784654", "0.8777957", "0.8777957", "0.8777957", "0.8777957", "0.8777957",...
0.8567707
74
Compute the softmax of vector x in a numerically stable way.
def stablesoftmax(x): shiftx = x - np.max(x) exps = np.exp(shiftx) return exps / np.sum(exps)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def softmax(x):\n pass # TODO: Compute and return softmax(x)\n\n exp_x = np.exp(x)\n sum_x = np.sum(exp_x, axis=0)\n softmax = exp_x/sum_x\n \n return softmax", "def softmax(x):\n e_x = np.exp(x - np.max(x))\n return old_div(e_x, e_x.sum())", "def softmax(x):\n x_exp = (x - x.max(1)[0]...
[ "0.8924645", "0.8897543", "0.8855082", "0.88485944", "0.88447136", "0.88437134", "0.88332975", "0.88332975", "0.8805584", "0.88022864", "0.8801685", "0.8801685", "0.8801685", "0.8801685", "0.8801685", "0.8801685", "0.8801685", "0.8801685", "0.8801685", "0.8801685", "0.8801685...
0.8456407
75
return the base path.
def basepath(): return os.path.abspath( os.path.join( os.path.dirname(__file__), '..' ) )
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def base_path(self):\n return self._base_path", "def get_base_path(self) -> str:\n raise NotImplementedError()", "def base_path(self):\n return self.setup.base_path", "def base_path(self):\n return Path(self.path)", "def base(self):\n return os.path.basename(self.path)", ...
[ "0.9110709", "0.8914833", "0.8814698", "0.84620833", "0.83229417", "0.8201772", "0.8119839", "0.80450326", "0.80241483", "0.7979383", "0.79153943", "0.7729585", "0.75555825", "0.7534282", "0.7483297", "0.74384886", "0.7389192", "0.7376088", "0.7365747", "0.73435485", "0.73289...
0.8348918
4
Test Home page GET success
def test_given_home_page_behavior(self): res = self.client().get('/') self.assertEqual(res.status_code, 200) json_res = json.loads(res.get_data(as_text=True)) self.assertEqual('Home page', json_res['message'])
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_home(self):\n res = self.client.get(\"/\")\n data = res.data.decode(\"utf-8\")\n assert res.status == \"200 OK\"\n assert \"Gandalf\" in data", "def test_home(self):\n result = self.app.get('/')\n self.assertEqual(result.status_code, 200)", "def test_if_home_i...
[ "0.8031052", "0.79719555", "0.797003", "0.79347235", "0.79246193", "0.7870425", "0.7868509", "0.78464305", "0.77751285", "0.77422047", "0.77198935", "0.7689997", "0.766225", "0.766225", "0.7617628", "0.7592641", "0.7592641", "0.7585918", "0.7579558", "0.7539119", "0.75317514"...
0.80841446
0
Test Home page GET error
def test_404_home_page_not_found(self): res = self.client().get('/home') self.assertEqual(res.status_code, 404) json_res = json.loads(res.get_data(as_text=False)) self.assertEqual('Resource Not Found', json_res['message'])
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_homepage(self):\n rv = self.app.get('/')\n assert 'Enter your url here' in rv.data", "def test_home(self):\n result = self.app.get('/')\n self.assertEqual(result.status_code, 200)", "def test_home(self):\n response = self.app.get(\"/\")\n self.assertTrue(respo...
[ "0.77049184", "0.7659181", "0.7619436", "0.76083475", "0.7482214", "0.7394391", "0.73898375", "0.73769104", "0.73749995", "0.7361156", "0.73505974", "0.73457575", "0.73457575", "0.73378193", "0.7290617", "0.72474724", "0.7233395", "0.721047", "0.71503764", "0.7137017", "0.713...
0.7465136
5
Test '/categories' GET success
def test_get_categories(self): res = self.client().get('/categories') data = json.loads(res.data) self.assertEqual(res.status_code, 200) self.assertEqual(data['success'], True) self.assertTrue(data['categories']) self.assertTrue(data['total_categories'])
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_get_categories(self):\n res = self.client().get('/categories')\n data = json.loads(res.data)\n self.assertEqual(res.status_code, 200)\n self.assertEqual(data['success'], True)\n self.assertTrue(len(data['categories']))", "def test_get_categories(self):\n res = s...
[ "0.84284675", "0.83606726", "0.83544725", "0.8345605", "0.8221959", "0.81894773", "0.8124276", "0.77914757", "0.77671236", "0.77610147", "0.7706712", "0.76859045", "0.7595673", "0.75360304", "0.74500704", "0.7442432", "0.73736376", "0.7342269", "0.7264145", "0.7234178", "0.72...
0.8284719
4
Test '/categories' GET error
def test_404_total_categories_not_equals_seven(self): res = self.client().get('/categories/7') data = json.loads(res.data) self.assertEqual(res.status_code, 404) self.assertEqual(data['success'], False) self.assertEqual(data['message'], 'Resource Not Found')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_view_categories(self):\n res = self.client().post('/categories/', data=self.category)\n self.assertEqual(res.status_code, 201)\n res = self.client().get('/categories/')\n self.assertEqual(res.status_code, 200)\n self.assertIn('Stews', str(res.data))", "def test_get_cat...
[ "0.8111586", "0.8080501", "0.8048344", "0.80268043", "0.798437", "0.79640514", "0.79492235", "0.7913016", "0.7853913", "0.7811022", "0.7802958", "0.7779876", "0.76586115", "0.765487", "0.7631587", "0.75027007", "0.7428791", "0.7424328", "0.73896396", "0.73635405", "0.73587143...
0.7394302
18
Test '/search' POST error
def test_404_search_results_unprocesssable(self): data = {'searchTerm':'wxyz'} res = self.client().post('/search', data=json.dumps(data), content_type='application/json') self.data = json.loads(res.data) self.assertEqual(res.status_code, 404) json_res = json.loads(res.get_data...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_search(self):\n tester = app.test_client(self)\n response = tester.post('/search')\n self.assertEqual(response.status_code,200)", "def test_01_search(self):\r\n res = self.app.get('/search')\r\n err_msg = \"Search page should be accessible\"\r\n assert \"Search\...
[ "0.814297", "0.7933988", "0.7591145", "0.74356306", "0.74088854", "0.7394592", "0.7378304", "0.7319517", "0.7310906", "0.72914416", "0.7205557", "0.7169899", "0.71229935", "0.70662004", "0.70340776", "0.6979441", "0.6932809", "0.6890871", "0.6878727", "0.68515646", "0.6817503...
0.78727055
2
Test '/play', POST error
def test_422_invalid_play_quiz(self): data = {'previous_questions': '2', 'quiz_category': {}} res = self.client().post('/play', data=json.dumps(data), content_type='application/json') self.assertEqual(res.status_code, 422) json_res = json.loads(res.get_data(as_text=False))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_start_post(self):\n response = self.client.open('/start',\n method='POST')\n self.assert200(response, \"Response body is : \" + response.data.decode('utf-8'))", "def test_post(self):\n self.assertEqual(self.response.status_code, 200)", "def test_...
[ "0.66659236", "0.6577006", "0.6486296", "0.64708036", "0.6457246", "0.64063805", "0.63439244", "0.63433415", "0.63198334", "0.6281969", "0.6237531", "0.6169002", "0.6169002", "0.61351967", "0.6118383", "0.60827714", "0.60806495", "0.6079986", "0.60582453", "0.60472286", "0.60...
0.58753383
32
creates a dictionary of masks with key as train_name and value as the image ie the mask.
def get_mask_dictionary(train_names): masks={} for name in train_names: masks[name]=cv.imread("../dataset/masks/"+name+".png",cv.IMREAD_GRAYSCALE) return masks
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def compute_masks_for_splits(\n graph):\n masks = {}\n num_nodes = graph.num_nodes()\n for split, split_nodes in zip(\n ['train', 'validation', 'test'],\n [graph.train_nodes, graph.validation_nodes, graph.test_nodes]):\n split_mask = np.zeros(num_nodes, dtype=bool)\n split_mask[split_nodes] =...
[ "0.66378236", "0.6490183", "0.63510484", "0.63296914", "0.6242874", "0.6236185", "0.6181385", "0.6169227", "0.61527234", "0.6059589", "0.6059158", "0.60440946", "0.6028404", "0.60111594", "0.60075146", "0.59977734", "0.59973216", "0.59925765", "0.5972022", "0.595777", "0.5955...
0.8503898
0
This function returns all the predictions for a set of items. If users is set to 'None', it will return all the predictions for all the users (matrix of size [num_users x num_items]).
def predict_items(self, users=None, top=None): # Get shape of the matrix num_users, num_items = self.shape if users is not None: num_users = len(users) # Return top-k recommendations if top is not None: num_items = top tempItemsAvg = self.bias[...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def predict_all(self):\n # DONE return prediction for all users\n return self._user_factors.dot(self._item_factors.T)", "def predict(self, users, items):\n self.eval()\n users_t = torch.tensor(users, dtype=torch.int64, device=self.device)\n items_t = torch.tensor(items, dtype=t...
[ "0.7518572", "0.70929635", "0.70800906", "0.6605688", "0.65354633", "0.6520353", "0.63867706", "0.6351859", "0.6313127", "0.6312929", "0.6252412", "0.62416387", "0.621037", "0.61483467", "0.6137849", "0.61124796", "0.6110548", "0.6088755", "0.6052726", "0.6029989", "0.6022885...
0.7222417
1
This method returns the requested configuration value.
def get_configuration(self, configuration: str): return self.configurations.get(configuration)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_config_value(self, name):\r\n if name in self.config_values:\r\n return self.config_values[name]", "def value(self) -> str:\n return self._config.get('value')", "def _get_config_value(self, section, key):\n return config.get(section, key)", "def get(self, key):\n ...
[ "0.79605746", "0.7883946", "0.7579541", "0.7458888", "0.73769873", "0.7289189", "0.7254569", "0.72494525", "0.72343785", "0.7220295", "0.72149634", "0.7165166", "0.7158661", "0.7155588", "0.7145809", "0.7144928", "0.7122192", "0.71090996", "0.7094943", "0.7090694", "0.7071568...
0.6544153
61
Given a set of N people (numbered 1, 2, ..., N), we would like to split everyone into two groups of any size. Each person may dislike some other people, and they should not go into the same group. Formally, if dislikes[i] = [a, b], it means it is not allowed to put the people numbered a and b into the same group. Retur...
def possibleBipartition(self, N: int, dislikes: List[List[int]]) -> bool: color = {} def dfs(node, c=0): if node in color: return color[node] == c color[node] = c return all(dfs(num, c ^ 1) for num in dislikeDict[node]) dislikeDict = defaultd...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def possibleBipartition(self, N: int, dislikes: List[List[int]]) -> bool:\n ALT_COLOR = [1, 0]\n UNDYED = -1\n if not dislikes:\n return True\n graph = [[0] * N for _ in range(N)]\n for a, b in dislikes:\n graph[a - 1][b - 1] = graph[b - 1][a - 1] = 1\n ...
[ "0.59938604", "0.543122", "0.5425278", "0.54036534", "0.53969157", "0.53872716", "0.5381204", "0.52916723", "0.52485555", "0.5187252", "0.5122909", "0.5115946", "0.510404", "0.50999707", "0.50879896", "0.5057843", "0.5034724", "0.50267625", "0.50191677", "0.50175595", "0.5009...
0.63579357
0
Verify invalid data can NOT be inserted into domain table when there is an invalid column name.
def test_execute_statement_6(self): domain_data = test_data_utils.get_trixie_domain_data() statement = test_db_utils.domain_stmt(domain_data) statement = statement.replace("Name", "Name_invalid") results_tup = find_domains.execute_statement(self.connection, statement) result = re...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_validation_column(self):\n assert self.check.validation_column == \"foo_bar_is_unique_identifier\"", "def test_extract_invalid_column(self):\n self.dicom.extract_keywords([\"invalid\"])\n\n # ensure column was added\n columns = self.dicom.metadata.column_names\n if u'i...
[ "0.6972688", "0.68067086", "0.66346246", "0.65312326", "0.64913225", "0.6417255", "0.6416926", "0.6413295", "0.63948125", "0.6323537", "0.6323502", "0.6288173", "0.62496513", "0.62421227", "0.61802006", "0.6170339", "0.61670995", "0.616497", "0.6161495", "0.61442834", "0.6132...
0.0
-1
Verify invalid data can be inserted after '% w' is replaced with '%% w'.
def test_execute_statement_10(self): domain_data = test_data_utils.get_trixie_domain_data() # "Description": "ParB-like nuclease domain" description = domain_data["Description"] description = description.replace("nuclease domain", "nuclease % wdomain") domain_data["Description"] ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_valid(self):\n template = '{0} just right {1}'\n value_count = 2\n try:\n validate_str_substitution(template, value_count)\n except ValidationError:\n self.fail('Name raised ValidationError unexpectedly')", "def assert_clean(data):\n def _ensure_clean...
[ "0.5992635", "0.5858768", "0.5779868", "0.57725316", "0.5767164", "0.57373", "0.57113636", "0.5679382", "0.5599095", "0.5586738", "0.55469763", "0.55464494", "0.5539545", "0.5525969", "0.55158526", "0.55059", "0.54947853", "0.54716885", "0.5456682", "0.5438615", "0.5373101", ...
0.0
-1
Returns a list of players by their name
def _by_name(self, argument): players = {player.name: player for player in PlayerIter()} ## Fuzzywuzzy is used to trace a name to a player. name, percent = process.extractOne(argument, players.keys()) if percent <= 60: return self._add_player(players[name])
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def find_player(self, name):\n for index in range(0, len(self.player_list)):\n if self.player_list[index].name == name:\n return self.player_list[index]", "def search_player_by_name(players_table, name):\r\n result = players_table.search(Query().Nom == name)\r\n pri...
[ "0.7444549", "0.7286916", "0.71669084", "0.71356833", "0.7118854", "0.7060312", "0.70388955", "0.70053047", "0.69989634", "0.69889975", "0.6957113", "0.690269", "0.6900602", "0.6869226", "0.6838337", "0.68317175", "0.68274045", "0.68181723", "0.6816372", "0.6778543", "0.67578...
0.6284037
56
Returns a list of the minor xvalues
def minor_xvals(self): raise NotImplementedError("Derived class must implement this.")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def minor_xvals(self):\n return list(range(self.nMinorCols))", "def minor_xvals(self):\n return self.prepStrs", "def minor_yvals(self):\n return list(range(self.nMinorRows))", "def xvals(self):\n return self.Ls", "def xvals(self):\n return self.Ls", "def xminmax ( self ...
[ "0.8536963", "0.78333926", "0.7105045", "0.667972", "0.667972", "0.6530889", "0.6437862", "0.63203067", "0.6080389", "0.6043881", "0.6031606", "0.59958935", "0.5900932", "0.5899524", "0.57883686", "0.57671493", "0.5739332", "0.5727638", "0.5725913", "0.57221866", "0.5721607",...
0.80805826
1
Return the number of rows and columns contained in each plaquette of this CircuitStructure. Returns
def plaquette_rows_cols(self): return len(self.minor_yvals()), len(self.minor_xvals())
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def size(self):\n return self.__row_count * self.__col_count", "def plaquette_rows_cols(self):\n return self.nMinorRows, self.nMinorCols", "def size(self):\n return self.num_rows, self.num_cols", "def size(self):\n return self.num_rows, self.num_cols", "def voxel_count(self):\n ...
[ "0.762086", "0.7546922", "0.7405167", "0.7405167", "0.7396393", "0.73630697", "0.7344099", "0.7263803", "0.72509813", "0.71989316", "0.71561486", "0.7155653", "0.7122607", "0.7069642", "0.7020033", "0.70186126", "0.69988716", "0.69744986", "0.69614923", "0.6945587", "0.692618...
0.74404293
2
Returns a list of the minor xvalues
def minor_xvals(self): return self.prepStrs
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def minor_xvals(self):\n return list(range(self.nMinorCols))", "def minor_xvals(self):\n raise NotImplementedError(\"Derived class must implement this.\")", "def minor_yvals(self):\n return list(range(self.nMinorRows))", "def xvals(self):\n return self.Ls", "def xvals(self):\n ...
[ "0.8536963", "0.80805826", "0.7105045", "0.667972", "0.667972", "0.6530889", "0.6437862", "0.63203067", "0.6080389", "0.6043881", "0.6031606", "0.59958935", "0.5900932", "0.5899524", "0.57883686", "0.57671493", "0.5739332", "0.5727638", "0.5725913", "0.57221866", "0.5721607",...
0.78333926
2
Returns a copy of this `LsGermsStructure`.
def copy(self): cpy = LsGermsStructure(self.Ls, self.germs, self.prepStrs, self.effectStrs, self.aliases, self.sequenceRules) cpy.allstrs = self.allstrs[:] cpy.allstrs_set = self.allstrs_set.copy() cpy.unindexed = self.unindexed[:] cpy._plaquettes =...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def copy(self):\n cpy = LsGermsSerialStructure(self.Ls, self.germs, self.nMinorRows,\n self.nMinorCols, self.aliases, self.sequenceRules)\n cpy.allstrs = self.allstrs[:]\n cpy.allstrs_set = self.allstrs_set.copy()\n cpy.unindexed = self.unindexed[:]\n...
[ "0.77503604", "0.6539036", "0.6407928", "0.63663554", "0.6355048", "0.63133365", "0.62963444", "0.62859726", "0.62613755", "0.62566406", "0.62521607", "0.62347203", "0.62142944", "0.6204213", "0.6198179", "0.61895", "0.6188255", "0.6187756", "0.61809796", "0.61760896", "0.617...
0.8042172
0
Returns a copy of this `LsGermsSerialStructure`.
def copy(self): cpy = LsGermsSerialStructure(self.Ls, self.germs, self.nMinorRows, self.nMinorCols, self.aliases, self.sequenceRules) cpy.allstrs = self.allstrs[:] cpy.allstrs_set = self.allstrs_set.copy() cpy.unindexed = self.unindexed[:] cpy...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def copy(self):\n cpy = LsGermsStructure(self.Ls, self.germs, self.prepStrs,\n self.effectStrs, self.aliases, self.sequenceRules)\n cpy.allstrs = self.allstrs[:]\n cpy.allstrs_set = self.allstrs_set.copy()\n cpy.unindexed = self.unindexed[:]\n cpy._p...
[ "0.72593504", "0.6234023", "0.6216728", "0.62012905", "0.61814725", "0.61795455", "0.6171813", "0.6108199", "0.6097484", "0.60341233", "0.59217", "0.59086096", "0.589321", "0.589321", "0.589321", "0.589321", "0.589321", "0.589321", "0.589321", "0.589321", "0.589321", "0.589...
0.7885875
0
Test that the constructor raises an exception if an invalid folder name is given
def test_constructor_with_wrong_folder_name_should_raise_exception(self): with self.assertRaises(UploaderException) as cm: GDriveUploader(None, 'my_wrong_folder_name!') self.assertEqual( UploaderException.INVALID_DIR_NAME, cm.exception.code )
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_invalid_dir(self):\n self.assertRaises(OSError, awstats_reader.AwstatsReader, '/tmp/XYZ', 'example.com')", "def test_valid_dir_raises():\n with pytest.raises(ValueError):\n assert cli._valid_dir(__file__)", "def testNotADirectory(self):\n\n self.assertRaises(OSError,\n ...
[ "0.7181131", "0.7140343", "0.704015", "0.6952155", "0.6820856", "0.67233", "0.67044145", "0.6701676", "0.66677594", "0.6665724", "0.66566724", "0.6537332", "0.64243734", "0.6390643", "0.6385385", "0.6338195", "0.63330954", "0.6327341", "0.6325642", "0.630055", "0.62816304", ...
0.84119904
0
Return a generator to iterate over records for the provided zone.
def iterate_records(self, zone): records = self._to_records(zone) yield from records
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def yield_instances_in_zones(self, zones, instance_filter=None):\n for zone in zones:\n for instance in self.yield_instances_in_zone(zone, instance_filter):\n yield instance", "def list_records(self, zone):\n return self._zones[zone.id][\"records\"].values()", "def yield_instances_in_zone...
[ "0.6794877", "0.6582904", "0.6393611", "0.6242111", "0.61347115", "0.5951769", "0.59507793", "0.57590294", "0.5742277", "0.57317704", "0.57101995", "0.5706609", "0.5646988", "0.5645076", "0.5622916", "0.5600926", "0.5550696", "0.5543637", "0.5540973", "0.5503652", "0.54717153...
0.8712466
0
Return a Record instance.
def get_record(self, zone_id, record_id): zone = self.get_zone(zone_id) try: if int(record_id) not in range(1, MAX_RECORD_ENTRIES + 1): raise RecordDoesNotExistError( value="Record doesn't exists", driver=zone.driver, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_record_by_id(self, id_: str) -> Union[DBModelInstance, NoReturn]:\n return self._get(id_)", "def record(self):\r\n return self._record", "def records(self):\r\n return Records(self)", "def new_record(self, values=None):\n return Record(schema=self.table_schema, values=valu...
[ "0.6895917", "0.68712634", "0.6791444", "0.6761231", "0.6645053", "0.6645053", "0.66049945", "0.6463003", "0.64363194", "0.6402961", "0.6382908", "0.6356668", "0.6309943", "0.63080347", "0.6188471", "0.6171782", "0.6134258", "0.61277723", "0.6066824", "0.60664827", "0.6064408...
0.6247223
14
Return horizontal Coordinate Reference System.
def crs(self) -> CRS: # return horizontal crs by default to avoid errors downstream # with reproject / rasterize etc. if "crs_wkt" not in self.attrs: self.set_crs() if "crs_wkt" in self.attrs: crs = pyproj.CRS.from_user_input(self.attrs["crs_wkt"]) ret...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def horizontal(self):\n return self._horizontal", "def get_horizontal(self, position):\n pass", "def horiz_center(self):\n return self._horiz_center", "def horiz_center(self):\n return self._horiz_center", "def _horizontal_header(self):\n return self.horizontalHeader()", ...
[ "0.65235794", "0.630586", "0.6060452", "0.6060452", "0.5820745", "0.58152163", "0.58087015", "0.58087015", "0.5776991", "0.5542575", "0.5541281", "0.5541281", "0.5512561", "0.5512561", "0.54946166", "0.5469209", "0.54295236", "0.542135", "0.53974944", "0.538755", "0.5376193",...
0.5171154
42
Return the x coordinates.
def xcoords(self) -> xr.IndexVariable: xcoords = self._obj[self.x_dim] if self.x_dim not in self._obj.coords: for key in list(self._obj.coords.keys()): if key.startswith(self.x_dim): xcoords = self._obj.coords[key] break if xcoo...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def Getxcoord(self):\n return self.x_coord", "def get_x(self):\n return self.coords[0]", "def x(self):\n return self.coords[0]", "def x(self):\n if self._x is None:\n self.compute_coordinates()\n return self._x", "def x(self):\n return self._coords[0]", ...
[ "0.85279644", "0.833376", "0.82469004", "0.824256", "0.8168135", "0.8130609", "0.81052214", "0.80422014", "0.8039824", "0.8039096", "0.79882365", "0.7968397", "0.7813556", "0.77749443", "0.7768395", "0.77598083", "0.77354634", "0.77336967", "0.7689222", "0.7674849", "0.764491...
0.7087132
70
Return the y coordinates.
def ycoords(self) -> xr.IndexVariable: ycoords = self._obj[self.y_dim] if self.y_dim not in self._obj.coords: for key in list(self._obj.coords.keys()): if key.startswith(self.y_dim): ycoords = self._obj.coords[key] break if ycoo...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def y(self):\n return self.coords[1]", "def y(self):\n return self._coords[1]", "def get_y(self):\n return self.coords[1]", "def y(self):\n if self._y is None:\n self.compute_coordinates()\n return self._y", "def getY(self):\r\n\t\treturn self._y", "def y_coo...
[ "0.8654424", "0.8602437", "0.8506628", "0.84617984", "0.84500885", "0.8418269", "0.8372946", "0.83680576", "0.83570445", "0.83570445", "0.83252347", "0.8318577", "0.8271337", "0.8248058", "0.8147464", "0.81284636", "0.81257457", "0.8105233", "0.8104671", "0.8083133", "0.80775...
0.7571749
64
Return size of geospatial grid.
def size(self) -> int: return int(np.multiply(*self.shape))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def grid_size(self):\n return self._grid_size", "def getGridSize(self):\n # This is set by the mosaic module, but other modules need to\n # know the values to take the proper size grid.\n return self.grid_size", "def get_grid_width(self):\n return self._grid_width", "def ge...
[ "0.7920476", "0.7456652", "0.7227365", "0.7227365", "0.7227365", "0.7200335", "0.7193012", "0.71758896", "0.71585983", "0.71585983", "0.714411", "0.7123359", "0.70858335", "0.7056563", "0.70563567", "0.6927538", "0.6881736", "0.6881736", "0.68446124", "0.68411905", "0.6837507...
0.0
-1
Return origin of grid (x0, y0) tuple.
def origin(self) -> tuple[float, float]: xs, ys = self.xcoords.data, self.ycoords.data x0, y0 = 0, 0 dx, dy = self.res if xs.ndim == 1: x0, y0 = xs[0] - dx / 2, ys[0] - dy / 2 elif xs.ndim == 2: alpha = math.radians(self.rotation) beta = math.a...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_origin(self):\n return self.coord_cls(x=0, y=0, system=self)", "def get_origin(self):\n return self.coord_cls(x=0, y=0, z=0, system=self)", "def origin(self):\n return (self._x_origin, self._y_origin)", "def _coord(self, x, y):\n gridEdge = 7 # originally 5\n ...
[ "0.7786346", "0.77669007", "0.77029955", "0.72977597", "0.7290609", "0.7262505", "0.7190701", "0.71774894", "0.7169552", "0.7151905", "0.71281385", "0.7038532", "0.69809407", "0.695003", "0.6920378", "0.6916003", "0.68950975", "0.6872901", "0.68449736", "0.6763199", "0.673778...
0.7590653
3
Return True if other has an same grid as object (crs, transform, shape).
def identical_grid(self, other) -> bool: return ( ( self.crs is None or other.raster.crs is None or self.crs == other.raster.crs ) and np.allclose(self.transform, other.raster.transform, atol=1e-06) and np.allclose(s...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def sameGrid(A, B):\n if np.isscalar(A):\n # A is a scalar \n if not np.isscalar(B):\n return False\n else:\n return (A == B)\n else:\n # Assume two GriddedBasis objects \n if A.nd != B.nd or A.ng != B.ng:\n return False \n elif not n...
[ "0.79255545", "0.77819914", "0.77701086", "0.7600014", "0.7600014", "0.75598896", "0.74396455", "0.74385095", "0.7356286", "0.7314897", "0.71629375", "0.7061093", "0.70535", "0.7039138", "0.7027209", "0.6967742", "0.69376886", "0.69284993", "0.6859808", "0.6859808", "0.683556...
0.86927044
0
Mask nodata values with fill_value (default np.nan). Note that masking with np.nan will change integer dtypes to float.
def mask_nodata(self, fill_value=np.nan): _da = self._obj if self.nodata is not None and self.nodata != fill_value: mask = _da.notnull() if np.isnan(self.nodata) else _da != self.nodata _da = _da.where(mask, fill_value) _da.raster.set_nodata(fill_value) return...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def fillna_nb(a, value):\n return set_by_mask_nb(a, np.isnan(a), value)", "def fillna_1d_nb(a, value):\n return set_by_mask_1d_nb(a, np.isnan(a), value)", "def _maybe_fill(arr, fill_value=np.nan):\n if _is_na_compat(arr, fill_value):\n arr.fill(fill_value)\n return arr", "def to_array(self...
[ "0.74204946", "0.72800386", "0.7148342", "0.7076398", "0.69556", "0.6905956", "0.6870082", "0.6856123", "0.6845135", "0.67608434", "0.6720865", "0.6711933", "0.6681884", "0.65704376", "0.6557283", "0.65385985", "0.6530317", "0.6477339", "0.64632505", "0.641844", "0.6400353", ...
0.8272376
0
Returns true if the cells have the same position.
def __eq__(self, c): for i in range(SPACE_DIMENSION): if self[i]!=c[i]: return False return True
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _all_elem_same(self, row):\n return len(set(row)) == 1 and row[0] != self.BLANK_CELL_CHAR", "def similar(self, other):\r\n if self.rows == other.rows and self.columns == other.columns:\r\n return True\r\n else:\r\n return False", "def check_position_for_same_occup...
[ "0.73459154", "0.7024958", "0.6961639", "0.69514674", "0.6892043", "0.6856153", "0.67743605", "0.668304", "0.6622439", "0.6609773", "0.660939", "0.65941924", "0.65596807", "0.65435195", "0.65329444", "0.652664", "0.6516336", "0.6513846", "0.65000194", "0.6493103", "0.64923096...
0.6403926
34
extract the duration option in the option_set
def get_duration(option_set): return option_set & DURATION_MASK
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def option_max_duration(self):\n return six.next(six.itervalues(self.zap._request(self.zap.base + 'spider/view/optionMaxDuration/')))", "def adoption_time(self):\n return self._adoption_time", "def duration(self) -> Optional[str]:\n return pulumi.get(self, \"duration\")", "def duration(s...
[ "0.67026985", "0.64731175", "0.63879627", "0.63879627", "0.629576", "0.629576", "0.629576", "0.62948775", "0.62892413", "0.62805474", "0.62276673", "0.617944", "0.6094795", "0.6060802", "0.6040044", "0.6028666", "0.59947103", "0.59947103", "0.5988713", "0.59743196", "0.596760...
0.8014823
0
Add a vertex to the graph.
def add_vertex(self, vertex_id): self.vertices[vertex_id] = set()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_vertex(self, vertex):\n raise NotImplementedError", "def add_vertex(self, vertex):\n if isinstance(vertex, Vertex):\n self.vertices.append(vertex)\n return\n raise TypeError('Is not vertex instance!')", "def add_vertex(self, vertex_name: n):\n new_verte...
[ "0.87015903", "0.84329987", "0.8422056", "0.840923", "0.83646226", "0.8317027", "0.825337", "0.808519", "0.8081489", "0.8038682", "0.8035422", "0.78834563", "0.78711975", "0.7838118", "0.7838118", "0.77608305", "0.7757061", "0.77158874", "0.7711681", "0.76663774", "0.76616603...
0.7310487
34
Add a directed edge to the graph.
def add_edge(self, v1, v2): if v1 in self.vertices and v2 in self.vertices: self.vertices[v1].add(v2) else: print("ERROR ADDING EDGE: Vrtes not found")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_edge(self, edge):\n src = edge.get_source()\n dest = edge.get_destination()\n #weightEdge = WeightedEdge(src, dest, edge.get_total_distance(), edge.get_outdoor_distance())\n if not (src in self.edges and dest in self.edges):\n raise ValueError('Node not in graph')\n ...
[ "0.78169996", "0.77789694", "0.7618847", "0.761851", "0.75694674", "0.7547367", "0.7483565", "0.7437083", "0.74284625", "0.7422367", "0.741715", "0.7337182", "0.73281914", "0.7266331", "0.7227267", "0.7212267", "0.71977764", "0.7194343", "0.71735585", "0.7168542", "0.7152955"...
0.6603108
67
Get all neighbors (edges) of a vertex.
def get_neighbors(self, vertex_id): if vertex_id in self.vertices: return self.vertices[vertex_id] else: return None
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def neighbors_in(self, vertex):\n return list(self.neighbor_in_iterator(vertex))", "def neighbors_out(self, vertex):\n return list(self.neighbor_out_iterator(vertex))", "def get_neighbours(self, vertex):\n output = []\n \n if vertex in self.adjacency_list:\n for ne...
[ "0.8146008", "0.78266084", "0.78112674", "0.7634123", "0.76183206", "0.7559868", "0.7391218", "0.73596346", "0.73310196", "0.729323", "0.729323", "0.729323", "0.729323", "0.729323", "0.729323", "0.7279731", "0.71649474", "0.7128683", "0.7083494", "0.7077735", "0.7033856", "...
0.64611185
51
Apply LSH self attention mechanism from query_input to query_input(itself).
def call(self, query_input, padding_mask, training): # Linearly project the query, key and value using different learned # projections. Splitting heads is automatically done during the linear # projections --> [batch_size, length, num_heads, dim_per_head]. query = self.sharedQK_dense_layer(query_input) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __call__(self, query, state):\n previous_alignments = state\n with variable_scope.variable_scope(None, \"Location_Sensitive_Attention\", [query]):\n\n # processed_query shape [batch_size, query_depth] -> [batch_size, attention_dim]\n processed_query = self.query_layer(query)...
[ "0.58477765", "0.57359004", "0.5720317", "0.5710058", "0.56958", "0.5666707", "0.5489388", "0.5483693", "0.5456373", "0.5440928", "0.5440928", "0.54244137", "0.54224354", "0.5406815", "0.53864497", "0.53864497", "0.53783596", "0.5346256", "0.5337981", "0.53090763", "0.5297588...
0.59667206
0
Tests generate_config_data with fake appinfo.
def test_python_with_app_yaml_no_write(self): self.write_file('test.py', 'test file') config = testutil.AppInfoFake( runtime='python', entrypoint='run_me_some_python!') cfg_files = self.generate_config_data(appinfo=config, deploy=True) self.assert_genfile_exists_w...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_config():\n assert not sample.create_app().testing\n assert sample.create_app({\"TESTING\": True}).testing", "def test_config():\n assert not create_app().testing\n assert create_app(TestConfig).testing", "def test_config(app):\n assert app.testing", "def test_config():\n\n # asser...
[ "0.7212104", "0.7042689", "0.6876461", "0.6793209", "0.66245353", "0.6523642", "0.64819914", "0.63893026", "0.6367065", "0.6350326", "0.6341179", "0.6313558", "0.62555575", "0.62513393", "0.62328833", "0.6174062", "0.61644137", "0.610334", "0.60824406", "0.60783887", "0.60659...
0.6092181
18
Tests generate_config_data with fake appinfo, no entrypoint.
def test_python_app_yaml_no_entrypoint_no_write(self): self.write_file('test.py', 'test file') config = testutil.AppInfoFake(runtime='python') cfg_files = self.generate_config_data(appinfo=config, deploy=True) self.assert_genfile_exists_with_contents( cfg_files, '...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_config():\n assert not create_app().testing\n assert create_app(TestConfig).testing", "def test_config():\n assert not sample.create_app().testing\n assert sample.create_app({\"TESTING\": True}).testing", "def app():\n\n def _app(config_class):\n _app = create_app(config_class)\n...
[ "0.7226386", "0.7217688", "0.6839121", "0.68270427", "0.67723745", "0.6763274", "0.67273563", "0.66205436", "0.6474417", "0.6407464", "0.637323", "0.63201576", "0.63003564", "0.6284957", "0.62794596", "0.62646216", "0.6241843", "0.62123877", "0.61663866", "0.61315095", "0.611...
0.6933518
2
Tests generate_config_data with custom=True.
def test_python_custom_runtime_no_write(self): self.write_file('test.py', 'test file') cfg_files = self.generate_config_data(custom=True) with open(os.path.join(self.temp_path, 'app.yaml')) as f: app_yaml_contents = f.read() self.assertMultiLineEqual( app_yaml_con...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_generateconfig(self):\n args = mock.Mock()\n args.debug = None\n args.generateconfig = True\n args.config = None\n expected_text = ('Sample configuration file written to sample_config.json\\n'\n \"Replicate the site JSON for each site.\\n\"\n ...
[ "0.68596166", "0.63797575", "0.6337545", "0.6252908", "0.62360054", "0.6152789", "0.60651433", "0.6035876", "0.60146004", "0.59926254", "0.5906614", "0.5899224", "0.58865666", "0.5874942", "0.5869201", "0.5864263", "0.5844385", "0.5816007", "0.57999897", "0.5784814", "0.57831...
0.62890863
3
Test that a LABEL directive is added to the Dockerfile
def test_python_label(self): self.write_file('test.py', 'test file') config = testutil.AppInfoFake( runtime='python', entrypoint='run_me_some_python!', runtime_config=dict(python_version='3')) cfg_files = self.generate_config_data(appinfo=config, deploy=True) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_build_image(self):\n labels = {\"apple\": \"red\", \"grape\": \"green\"}\n self.docker.images.build(\n path=\"test/python/docker/build_labels\",\n labels=labels,\n tag=\"labels\",\n isolation=\"default\",\n )\n image = self.docker.ima...
[ "0.70627654", "0.6665901", "0.6508662", "0.644795", "0.63541335", "0.621771", "0.6188668", "0.6171969", "0.6104402", "0.5967373", "0.59158397", "0.5783527", "0.57752043", "0.5694908", "0.5687012", "0.5678598", "0.56709045", "0.56602865", "0.56509024", "0.5643603", "0.56104124...
0.7264857
0
Normalize all words in set
def save(self, *args, **kwargs): good_list = [] for word in self.words.lower().split('\n'): word = word.strip() if word and word not in good_list: good_list.append(word) self.words = '\n'.join(good_list) return super(WordSet, self).save(*args, **kw...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def normalize(words: list, language: str = 'english') -> list:\n words = to_lowercase(words)\n words = remove_punctuation(words)\n words = replace_numbers(words)\n words = remove_stopwords(words)\n words = stem_words(words, language)\n return words", "def words(self):\n # BEGIN Question ...
[ "0.70125175", "0.68871176", "0.6881254", "0.6879561", "0.68571216", "0.68385845", "0.6798746", "0.67700183", "0.67700183", "0.6688793", "0.66397196", "0.6596825", "0.65860605", "0.6580076", "0.6499905", "0.64709985", "0.64445734", "0.64404315", "0.642643", "0.64150393", "0.64...
0.59423614
72
Gets total time accumulated
def get(self): if self.running: return self.accumulated_time + pg.time.get_ticks() - self.start_time else: return self.accumulated_time
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getTotalTime(self):\n with self.lock:\n if self.tend == 0:\n total = -1\n else:\n total = self.tend - self.tstart\n return total", "def total_time(self):\n obs_times = self.clean_obs_times()\n return _np.sum(obs_times[:, 1] - obs...
[ "0.814135", "0.7808511", "0.7686771", "0.7596265", "0.71909803", "0.7130483", "0.7066036", "0.7063663", "0.7058031", "0.70568067", "0.7046302", "0.7016926", "0.7004792", "0.6951006", "0.69229656", "0.6915076", "0.69141394", "0.6881497", "0.68768615", "0.68675643", "0.68556017...
0.74175745
4
Constructor. Any message fields that are implicitly/explicitly set to None will be assigned a default value. The recommend use is keyword arguments as this is more robust to future message changes. You cannot mix inorder arguments and keyword arguments.
def __init__(self, *args, **kwds): if args or kwds: super(KltSettings, self).__init__(*args, **kwds) #message fields cannot be None, assign default values for those that are if self.max_features is None: self.max_features = 0 if self.window_size is None: self.window_size = 0 ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self, *args, **kwds):\n if args or kwds:\n super(KomodoSpeechRecCommand, self).__init__(*args, **kwds)\n #message fields cannot be None, assign default values for those that are\n if self.header is None:\n self.header = std_msgs.msg.Header()\n if self.cmd is None:\n ...
[ "0.7793408", "0.77199197", "0.77199197", "0.76861537", "0.76254076", "0.7563511", "0.7439333", "0.7416987", "0.73505336", "0.73078775", "0.7278874", "0.7236695", "0.7226162", "0.72238374", "0.72238374", "0.7217701", "0.7211448", "0.7211448", "0.7211448", "0.7211448", "0.72114...
0.0
-1
Constructs nested Dict from results of parsetolist.
def makeDict(result_list): result_dict = dict() for line in result_list: if line[0] == 'set_property' and line[3] == 'get_ports': if line[4] not in result_dict: result_dict[line[4]] = dict() result_dict[line[4]][line[1]] = line[2] return result_dict
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _make_par_struct(self, npars, par_dict):\n par_struct = {}\n par_struct['npar'] = npars\n par_struct['parnames'] = list(par_dict.keys())\n par_struct['parvals'] = [par_dict[k] for k in par_struct['parnames']]\n return par_struct", "def merge_par_results(res):\n nres = {}...
[ "0.64579207", "0.63446015", "0.6293405", "0.610813", "0.6066359", "0.58820325", "0.5815261", "0.5692215", "0.56725836", "0.56507736", "0.5625941", "0.5618343", "0.5596219", "0.55631423", "0.5561859", "0.5544689", "0.5515759", "0.5481585", "0.5466886", "0.54391456", "0.5432096...
0.6504124
0
Get the ram usage for a host such as a compute_node
def get_host_ram_usage(self, resource, period, aggregate, granularity=None): pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _get_host_utilization(context, host, ram_mb, disk_gb):\n instances = instance_get_all_by_host(context, host)\n vms = len(instances)\n free_ram_mb = ram_mb - FLAGS.reserved_host_memory_mb\n free_disk_gb = disk_gb - (FLAGS.reserved_host_disk_mb * 1024)\n\n work = 0\n for instance in instances:\...
[ "0.76257074", "0.7584651", "0.7559898", "0.7357826", "0.72865707", "0.72227097", "0.7176473", "0.7059463", "0.69488126", "0.68892616", "0.6887406", "0.68580884", "0.6848776", "0.6846633", "0.6846633", "0.68401146", "0.68392086", "0.681455", "0.681063", "0.6777468", "0.6742927...
0.72498614
5
Get the ram usage for an instance
def get_instance_ram_usage(self, resource, period, aggregate, granularity=None): pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_usage_ram_size(self):\n\t\treturn call_sdk_function('PrlStat_GetUsageRamSize', self.handle)", "def ram_size(self) -> pulumi.Output[float]:\n return pulumi.get(self, \"ram_size\")", "def _get_ram():\n try:\n from psutil import virtual_memory\n ram = virtual_memory().total / 1024....
[ "0.7731756", "0.75003433", "0.7447069", "0.73433405", "0.7305697", "0.7255464", "0.7194048", "0.71752506", "0.7155671", "0.7141507", "0.71346235", "0.71286124", "0.7051312", "0.70480275", "0.6997978", "0.6983432", "0.6967813", "0.6937242", "0.69265544", "0.69257313", "0.69175...
0.753702
1
Sets the accounting_integration of this Dashboard.
def accounting_integration(self, accounting_integration): self._accounting_integration = accounting_integration
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def integration_setting(self, integration_setting):\n\n self._integration_setting = integration_setting", "def set_integration(self, integration):\n self.integration = integration\n self.nt = numba_functions.pow2ceil(integration.size)\n self.nf = self.nt // 2\n\n dt = self.info...
[ "0.6932327", "0.6363463", "0.63496065", "0.5533148", "0.55131763", "0.5353951", "0.5131953", "0.5117665", "0.51025534", "0.5095815", "0.50857854", "0.50857854", "0.50857854", "0.50857854", "0.50756323", "0.50613534", "0.50168645", "0.5014883", "0.49406907", "0.49051017", "0.4...
0.8472462
0
Sets the accounting_integration_display_name of this Dashboard.
def accounting_integration_display_name(self, accounting_integration_display_name): self._accounting_integration_display_name = accounting_integration_display_name
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_display_name(self, display_name):\n self._call('set_display_name', display_name=display_name)", "def display_name(self, display_name):\n\n self._display_name = display_name", "def display_name(self, display_name):\n\n self._display_name = display_name", "def display_name(self, di...
[ "0.7446196", "0.70946866", "0.70946866", "0.70946866", "0.70946866", "0.70946866", "0.70946866", "0.7052709", "0.7052709", "0.7052709", "0.7052709", "0.7052709", "0.7052709", "0.7035668", "0.6486032", "0.62075293", "0.61698234", "0.6022502", "0.5906609", "0.56361794", "0.5596...
0.88748455
0
Sets the id of this Dashboard.
def id(self, id): self._id = id
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_id(self, id):\n self.data['id'] = id", "def set_id(self, id_):\n\n self.id_ = id_", "def set_id(self, id):\n self.__id = id", "def SetId(self, id):\n self.id = int(id)", "def id(self, id: int):\n\n self._id = id", "def id(self, id: int):\n\n self._id = id...
[ "0.78034365", "0.7740644", "0.7737124", "0.76245654", "0.7503708", "0.7503708", "0.7503708", "0.7503708", "0.7503708", "0.7503708", "0.7503708", "0.7503708", "0.7503708", "0.7503708", "0.7440295", "0.7422364", "0.741341", "0.741341", "0.741341", "0.73929185", "0.73534936", ...
0.7324366
95
Sets the leave_registrations_approved of this Dashboard.
def leave_registrations_approved(self, leave_registrations_approved): self._leave_registrations_approved = leave_registrations_approved
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def leave_registrations_pending(self, leave_registrations_pending):\n\n self._leave_registrations_pending = leave_registrations_pending", "def reimbursements_approved(self, reimbursements_approved):\n\n self._reimbursements_approved = reimbursements_approved", "def onchange_leave_date(self):\n ...
[ "0.6485045", "0.5657109", "0.5262917", "0.5140995", "0.5108446", "0.50992364", "0.4879557", "0.4879061", "0.4807412", "0.47820526", "0.47762007", "0.47605288", "0.4727932", "0.46352533", "0.45924172", "0.4560372", "0.45061448", "0.4503572", "0.44957384", "0.44439617", "0.4419...
0.85315037
0
Sets the leave_registrations_pending of this Dashboard.
def leave_registrations_pending(self, leave_registrations_pending): self._leave_registrations_pending = leave_registrations_pending
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def leave_registrations_approved(self, leave_registrations_approved):\n\n self._leave_registrations_approved = leave_registrations_approved", "def reimbursements_pending(self, reimbursements_pending):\n\n self._reimbursements_pending = reimbursements_pending", "def time_registrations_pending(self...
[ "0.76081914", "0.6306207", "0.53243005", "0.5314099", "0.50462234", "0.49146974", "0.47424987", "0.47243202", "0.4696082", "0.46942157", "0.46571726", "0.4615794", "0.46109623", "0.45924336", "0.45706", "0.45567647", "0.453043", "0.45270103", "0.45127395", "0.44771665", "0.44...
0.83982646
0
Sets the name of this Dashboard.
def name(self, name): self._name = name
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_name(self, name):\n self.name = name", "def set_name(self, name):\n self.name = name", "def set_name(self, name):\n self.name = name", "def set_name(self, name):\n self.name = name", "def set_name(self, name):\n self.name = name", "def set_name(self, name):\n ...
[ "0.7745642", "0.7745642", "0.7745642", "0.7745642", "0.7745642", "0.769691", "0.7662723", "0.7656584", "0.76374066", "0.76374066", "0.7619559", "0.7617421", "0.7585551", "0.75101525", "0.74979615", "0.747007", "0.73750985", "0.73750985", "0.7373796", "0.7344319", "0.7331432",...
0.0
-1
Sets the pay_rolls of this Dashboard.
def pay_rolls(self, pay_rolls): self._pay_rolls = pay_rolls
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def rolls(self, rolls):\n self._rolls = rolls", "def _set_scrolls(self, listOfScrolls):\n self._scrolls = listOfScrolls", "def create_rolls_list(self):\n for p in self.players_names:\n self._rolls_list.append(Roll(p))", "def update_total_rolls(self):\n\n # Incremene the...
[ "0.6883537", "0.5419645", "0.5324921", "0.5208451", "0.51615244", "0.5122487", "0.5066545", "0.5002941", "0.4981307", "0.4897883", "0.48859933", "0.48755318", "0.48749834", "0.48245534", "0.47334263", "0.47259802", "0.47183916", "0.47026637", "0.47000074", "0.4699175", "0.467...
0.83522946
0
Sets the payment_integration of this Dashboard.
def payment_integration(self, payment_integration): allowed_values = ["None", "NETS"] # noqa: E501 if self.local_vars_configuration.client_side_validation and payment_integration not in allowed_values: # noqa: E501 raise ValueError( "Invalid value for `payment_integration` ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def integration_setting(self, integration_setting):\n\n self._integration_setting = integration_setting", "def accounting_integration(self, accounting_integration):\n\n self._accounting_integration = accounting_integration", "def payment_id(self, payment_id):\n\n self._payment_id = payment...
[ "0.70271194", "0.677083", "0.60514224", "0.5952308", "0.5932854", "0.5795441", "0.5699409", "0.5486885", "0.5486885", "0.53960884", "0.53163755", "0.52384233", "0.51368695", "0.50320596", "0.5015539", "0.4982108", "0.4948977", "0.4941138", "0.4914533", "0.49020204", "0.489219...
0.69764733
1
Sets the reimbursements_pending of this Dashboard.
def reimbursements_pending(self, reimbursements_pending): self._reimbursements_pending = reimbursements_pending
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def car_allowances_pending(self, car_allowances_pending):\n\n self._car_allowances_pending = car_allowances_pending", "def reimbursements_approved(self, reimbursements_approved):\n\n self._reimbursements_approved = reimbursements_approved", "def leave_registrations_pending(self, leave_registratio...
[ "0.656912", "0.64694685", "0.58545125", "0.5605866", "0.5583177", "0.5581322", "0.54735434", "0.52813476", "0.52676255", "0.51309234", "0.51294446", "0.50747275", "0.50516725", "0.50116676", "0.49971324", "0.49892083", "0.48746416", "0.4836489", "0.48196113", "0.4800667", "0....
0.8781077
0
Sets the swipe_pending of this Dashboard.
def swipe_pending(self, swipe_pending): self._swipe_pending = swipe_pending
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def swipe_approved(self, swipe_approved):\n\n self._swipe_approved = swipe_approved", "def swipe_enabled(self, swipe_enabled):\n\n self._swipe_enabled = swipe_enabled", "def pending(self, pending):\n\n self._pending = pending", "def car_allowances_pending(self, car_allowances_pending):\n...
[ "0.6946486", "0.63023126", "0.54298574", "0.51138353", "0.5106844", "0.50831866", "0.47929892", "0.46352258", "0.46003398", "0.4582557", "0.4561724", "0.45205435", "0.44943097", "0.445714", "0.44468287", "0.44349745", "0.43952593", "0.43509316", "0.43436754", "0.43362805", "0...
0.81723535
0
Returns true if both objects are equal
def __eq__(self, other): if not isinstance(other, Dashboard): return False return self.to_dict() == other.to_dict()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __eq__(self, other):\n return are_equal(self, other)", "def __eq__(self, other):\n return are_equal(self, other)", "def __eq__(self,other):\n try: return self.object==other.object and isinstance(self,type(other))\n except: return False", "def __eq__(self, other):\n if i...
[ "0.8088132", "0.8088132", "0.8054589", "0.7982687", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", ...
0.0
-1
Returns true if both objects are not equal
def __ne__(self, other): if not isinstance(other, Dashboard): return True return self.to_dict() != other.to_dict()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __ne__(self, other: object) -> bool:\n if self.__eq__(other):\n return False\n return True", "def __ne__(self, other: object) -> bool:\n return not self.__eq__(other)", "def __ne__(self, other) -> bool:\n return not self.__eq__(other)", "def __eq__(self, other):\n ...
[ "0.845611", "0.8391477", "0.8144138", "0.81410587", "0.8132492", "0.8093973", "0.80920255", "0.80920255", "0.80920255", "0.8085325", "0.8085325", "0.8076365", "0.8076365", "0.8065748", "0.8042487", "0.8042487", "0.8042487", "0.8042487", "0.8042487", "0.8042487", "0.8042487", ...
0.0
-1
Send a list request.
def list(self, path): req = self.session.get(self.url + path + '/list', verify=False) jdata = req.json() if jdata['status'] != 'ok': raise Exception("Failed to query list: \n" + req.text) return jdata['data']
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_POST_send_list(self):\n\t\tself.POST_list()\n\t\tlist = self.GET_data('/api/list/' + self.list_id)\n\t\tself.POST_data('/api/list/' + self.list_id + '/send', data=list)", "def _list(self, **kwargs):\n\n return self._make_request(**kwargs)", "def List(self, request, global_params=None):\n c...
[ "0.7577054", "0.7303563", "0.70674", "0.70674", "0.70674", "0.70674", "0.70674", "0.70674", "0.70674", "0.70674", "0.70674", "0.70674", "0.70674", "0.70674", "0.70674", "0.70674", "0.70674", "0.70674", "0.70674", "0.70674", "0.70674", "0.70674", "0.70674", "0.70674", ...
0.0
-1
A string that describes the message.
def message(self) -> str: return self["Sns"]["Message"]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def message(self) -> str:\n return self.fields.get('msg', self.raw_string)", "def message(self) -> str:\r\n\r\n return self.__message", "def message(self) -> str:\n return typing.cast(\n str,\n self._properties.get(\"message\"),\n )", "def message(self) -> st...
[ "0.8171995", "0.80336803", "0.7873994", "0.78264594", "0.78264594", "0.78264594", "0.78264594", "0.78264594", "0.77336925", "0.7705845", "0.7672844", "0.7672844", "0.76694614", "0.76694614", "0.7648564", "0.76337725", "0.76215994", "0.7565829", "0.75310814", "0.7528613", "0.7...
0.7133522
43
The Amazon Resource Name (ARN) for the topic that this endpoint is subscribed to.
def topic_arn(self) -> str: return self["Sns"]["TopicArn"]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def topic_arn(self) -> str:\n return pulumi.get(self, \"topic_arn\")", "def sns_topic_arn(self) -> pulumi.Output[Optional[str]]:\n return pulumi.get(self, \"sns_topic_arn\")", "def sns_topic_arn(self) -> Optional[pulumi.Input[str]]:\n return pulumi.get(self, \"sns_topic_arn\")", "def sns...
[ "0.79663926", "0.7922786", "0.78171855", "0.78171855", "0.7683459", "0.7343698", "0.71429986", "0.7059559", "0.6987502", "0.6970178", "0.69018626", "0.68651736", "0.6732541", "0.6685686", "0.6626173", "0.6583653", "0.65645957", "0.6510756", "0.64786243", "0.63532364", "0.6337...
0.8189848
0
The Subject parameter specified when the notification was published to the topic.
def subject(self) -> str: return self["Sns"]["Subject"]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getSubject(self):\r\n return self.msg[\"Subject\"]", "def subject(self):\n return self.properties.get(\"subject\", None)", "def subject(self):\n return self.get(\"subject\")", "def subject(self):\n if \"subject\" in self._prop_dict:\n return self._prop_dict[\"subjec...
[ "0.7240037", "0.7037682", "0.69523156", "0.6946377", "0.6627567", "0.6622257", "0.6622257", "0.6584345", "0.65593636", "0.6491799", "0.64916843", "0.6481687", "0.64591897", "0.6446058", "0.64327526", "0.6418687", "0.6406904", "0.6406904", "0.63387203", "0.63211167", "0.628976...
0.70855045
1
Get Class name. Get the name of the class. Lots of output Classes inherit from Output, so this varies depending on which one we're looking at.
def getname(self): return self.__class__.__name__
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def className(self):\n namevalue = self.__class__.__name__\n return str(namevalue)", "def getClassName(self):\n n = type(self).__name__\n return n", "def _get_classname(cls):\n return cls.__name__", "def f_get_class_name(self):\n return self.__class__.__name__", "d...
[ "0.7939938", "0.7907919", "0.7862953", "0.7792295", "0.77751034", "0.768386", "0.7571485", "0.75675476", "0.7466607", "0.73774916", "0.73774916", "0.7193898", "0.7111963", "0.70230263", "0.6950269", "0.6938829", "0.69382256", "0.6923738", "0.68519294", "0.6817817", "0.6813531...
0.70055646
14
>>> combination_sum([2, 3, 5], 8) [[2, 2, 2, 2], [2, 3, 3], [3, 5]] >>> combination_sum([2, 3, 6, 7], 7) [[2, 2, 3], [7]] >>> combination_sum([8, 2.3, 0], 1)
def combination_sum(candidates: list, target: int) -> list: path = [] # type: list[int] answer = [] # type: list[int] backtrack(candidates, path, answer, target, 0) return answer
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def sum_app(*numbers_to_sum: typing.Tuple[int, ...]):\n return sum(numbers_to_sum)", "def sum_app(*numbers_to_sum: Required[typing.Tuple[int, ...]]):\n return sum(numbers_to_sum)", "def combinationSum2(self, candidates, target):\n if not candidates:\n return []\n...
[ "0.6623807", "0.6619953", "0.6406325", "0.64034677", "0.6338193", "0.6306873", "0.619892", "0.6122698", "0.6115969", "0.604374", "0.6030539", "0.59624815", "0.59097105", "0.58615535", "0.584495", "0.57819194", "0.5761072", "0.57548493", "0.575451", "0.5753943", "0.57172334", ...
0.6971807
0
Learning Rate Schedule Learning rate is scheduled to be reduced after 80, 120, 160, 180 epochs. Called automatically every epoch as part of callbacks during training. Arguments
def lr_schedule(epoch): lr = 1e-3 if epoch > 180: lr *= 0.5e-3 elif epoch > 160: lr *= 1e-3 elif epoch > 120: lr *= 1e-2 elif epoch > 80: lr *= 1e-1 print('Learning rate: ', lr) return lr
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def rnn_learning_rate_schedule(dataset):\n model, prefix = make_rnn(non_negative=True)\n # model.set_params(**{prefix + \"val\": 0.1})\n\n # base = no schedule\n print(\"Baseline RNN\")\n # model.set_params(**{prefix + \"history_file\": \"nn_default.csv\"})\n cross_validate(dataset, model)\n #...
[ "0.75226367", "0.74970424", "0.74850416", "0.7480781", "0.7407709", "0.7364352", "0.735358", "0.73470426", "0.73345935", "0.72661406", "0.72635627", "0.7226901", "0.72229683", "0.7196325", "0.7190341", "0.7099111", "0.7086345", "0.70776033", "0.7045473", "0.7024917", "0.70204...
0.7468542
6
ResNet Version 2 Model builder [b] Stacks of (1 x 1)(3 x 3)(1 x 1) BNReLUConv2D or also known as bottleneck layer First shortcut connection per layer is 1 x 1 Conv2D. Second and onwards shortcut connection is identity. At the beginning of each stage, the feature map size is halved (downsampled) by a convolutional layer...
def resnet_v2(input_shape, depth, num_classes=2): if (depth - 2) % 9 != 0: raise ValueError('depth should be 9n+2 (eg 56 or 110 in [b])') # Start model definition. num_filters_in = 16 num_res_blocks = int((depth - 2) / 9) inputs = Input(shape=input_shape) # v2 performs Conv2D with BN-Re...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def resnet_v2(input_shape, depth, num_classes=10):\n if (depth - 2) % 9 != 0:\n raise ValueError('depth should be 9n+2 (eg 56 or 110 in [b])')\n # Start model definition.\n inputs = Input(shape=input_shape)\n num_filters_in = 16\n num_filters_out = 64\n filter_multiplier = 4\n num_sub_b...
[ "0.69078916", "0.6848643", "0.6820924", "0.6782567", "0.6703485", "0.65902585", "0.6564222", "0.65625113", "0.6559187", "0.6498651", "0.6480996", "0.64685804", "0.6417236", "0.6404073", "0.6394508", "0.63656634", "0.63597244", "0.6347631", "0.63265795", "0.63223416", "0.63167...
0.65819204
6
Returns the drag acceleration for a given state.
def drag(s): r = np.linalg.norm(s[0:3]) v_atm = we*np.array([-s[1],s[0],0]) # calculate velocity of atmosphere v_rel = s[3:6] - v_atm rs = Re*(1-(ee*s[2]/r)**2) # calculate radius of surface h = r-rs p = 0.6*np.exp(-(h-175)*(29.4-0.012*h)/915) # in kg/km^3 coeff = 3.36131e-9 # in k...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def acceleration(self):\n return self.__accel", "def get_acceleration(self):\n return self.acceleration", "def calc_D(state):\n\t\tif t < thresh:\n\t\t\tstate.D_g[t] = 0.5\n\t\t\tstate.D_n[t] = 0.5\n\t\telse:\n\t\t\tif mod == \"constant\":\n\t\t\t\tstate.D_g[t] = D\n\t\t\t\tstate.D_n[t] = 1-D\n\t...
[ "0.6369209", "0.612541", "0.58314234", "0.5680976", "0.56517446", "0.5616175", "0.5608247", "0.5594059", "0.54494685", "0.54416424", "0.5423469", "0.5396429", "0.5393855", "0.53883487", "0.53797674", "0.5353152", "0.53521484", "0.53112257", "0.52840275", "0.5254928", "0.52526...
0.5092278
34
The distribution of G for the local metallicity distribution REWRITE TO TAKE A Z(G) FUNCTION OBTAINED THROUGH INTERPOLATION
def Gdist(tG,ZG): try: tZ= ZG(tG) tjac= numpy.fabs(ZG.derivatives(tG)[0]/tZ/numpy.log(10.)) except ValueError: return 0. # Add Jacobian return localfehdist(isodist.Z2FEH(tZ,zsolar=0.017))*tjac
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def G_jordi(g,gz):\n return g-0.1154-0.4175*gz-0.0497*gz**2.+0.0016*gz**3.", "def g(z):\n return 1. / (1. + np.exp(-z))", "def g(lat, z) :\n return (g0(lat) - (3.085462 * 1.e-4 + 2.27 * 1.e-7 * np.cos(2*lat*np.pi/180.)) * z\n + (7.254 * 1e-11 + 1e-13 * np.cos(2*lat*np.pi/180.)) * z**2\n ...
[ "0.67598766", "0.66744137", "0.66394216", "0.6628547", "0.65888226", "0.6343817", "0.63087803", "0.61585313", "0.609664", "0.60840666", "0.6068639", "0.6043819", "0.60178494", "0.5976935", "0.59437007", "0.5929409", "0.5899823", "0.58678865", "0.5862445", "0.58614236", "0.586...
0.54775673
89
Displays image and the topn predicted probabilities in a bar graph
def plot_preds(img_array, preds): preds_index = np.argmax(preds) preds_name = classes[preds_index] prob = np.max(preds) cv2.putText(img_array, 'AI guess it`s a {}'.format(preds_name), (10, 30), cv2.FONT_HERSHEY_SIMPLEX, 0.8, (0, 0, 255), 2) cv2.putText(img_array, 'probality is {:.2f}%'.format(...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def plot_preds(image, preds): \r\n #image\r\n plt.imshow(image)\r\n plt.axis('off')\r\n \r\n #bar graph\r\n plt.figure() \r\n order = list(reversed(range(len(preds)))) \r\n bar_preds = [pr[2] for pr in preds]\r\n labels = (pr[1] for pr in preds)\r\n plt.barh(order, bar_preds, alpha=0.5)\r\n plt.ytick...
[ "0.7922684", "0.77978665", "0.7721485", "0.769006", "0.7603528", "0.71370405", "0.70984143", "0.7009505", "0.68326867", "0.6766593", "0.6606671", "0.6594294", "0.6510035", "0.64082754", "0.63103276", "0.63035893", "0.62614477", "0.6234734", "0.6204136", "0.62028116", "0.61882...
0.76070917
4
W = DEBUGINITIALIZEWEIGHTS(len_out, len_in) initializes the weights of a layer with len_in incoming connections and len_out outgoing connections using a fix set of values.
def debugInitializeWeights(len_out, len_in): W = np.zeros((len_out, len_in + 1)) # Initialize W using "sin", this ensures that W is always of the same # values and will be useful for debugging c, r = W.shape W = np.reshape(np.sin(range(1, W.size+1)), (r, c)).T / 10 return W
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def init_weights(self, leveledinit: bool, kernel_size: int, bias: bool) -> None:\n if leveledinit:\n nn.init.normal_(self.conv1d.weight, std=1e-3)\n nn.init.normal_(self.conv1d.bias, std=1e-6)\n with torch.no_grad():\n self.conv1d.weight[:, 0, :] += 1.0 / kern...
[ "0.6643203", "0.6586218", "0.6586218", "0.65376747", "0.65376747", "0.65376747", "0.65139925", "0.6484172", "0.64773816", "0.6385904", "0.63799757", "0.63657266", "0.6363207", "0.6351127", "0.6272765", "0.6259417", "0.6229838", "0.61706126", "0.61596566", "0.61596566", "0.614...
0.76383674
0
Returns the accuracy by comparing the convoluted output Y_hat with the labels of the samples Y
def evaluation(Y_pred, Y): correct = tf.equal(tf.argmax(Y_pred, 1), tf.argmax(Y, 1)) accuracy = tf.reduce_mean(tf.cast(correct, tf.float32)) return accuracy
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def accuracy(y, y_hat):\n return np.mean(np.argmax(y, axis=1) == np.argmax(y_hat, axis=1))", "def accuracy(y_hat, y): #@save\n if len(y_hat.shape) > 1 and y_hat.shape[1] > 1:\n y_hat = d2l.argmax(y_hat, axis=1) \n cmp = d2l.astype(y_hat, y.dtype) == y\n return float(d2l.reduce_sum(d2l.as...
[ "0.8038202", "0.7960575", "0.7910892", "0.7892635", "0.78904176", "0.78331524", "0.75878394", "0.7523929", "0.74796814", "0.74724466", "0.7439126", "0.7439126", "0.743513", "0.74210894", "0.74191064", "0.73886716", "0.73880243", "0.7386731", "0.7296804", "0.7294372", "0.72862...
0.7220775
23
Creates a list of random mini_batches from (X, Y)
def supervised_random_mini_batches(X, Y, mini_batch_size, seed): np.random.seed(seed) m = X.shape[0] #number of examples in set n_classes = Y.shape[1] mini_batches=[] permutation = list(np.random.permutation(m)) shuffled_X = X[permutation,:] shuffled_Y = Y[permutation,:] #p...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def random_mini_batches(X, Y, mini_batch_size = 64):\n\n\n\tm = X.shape[1]\n\tmini_batches = []\n\n\t#Shuffling around the data randomly according to the 'permutation' list\n\tpermutation = list(np.random.permutation(m))\n\tshuffled_X = X[:, permutation]\n\tshuffled_Y = Y[:, permutation].reshape((1,m))\n\n\tcomple...
[ "0.81358165", "0.79854906", "0.79664856", "0.7933697", "0.79207736", "0.78797495", "0.7855775", "0.78445286", "0.77804965", "0.7778024", "0.7731136", "0.7714424", "0.73346597", "0.7299638", "0.724078", "0.7154381", "0.707257", "0.704754", "0.7042443", "0.699032", "0.69870824"...
0.75990486
12
Creates a list of random mini_batches from (X, Y)
def unsupervised_random_mini_batches(X, mini_batch_size, seed): np.random.seed(seed) m = X.shape[0] #number of examples in set mini_batches=[] permutation = list(np.random.permutation(m)) shuffled_X = X[permutation,:] #partition of shuffled_X except the last mini_batch num_...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def random_mini_batches(X, Y, mini_batch_size = 64):\n\n\n\tm = X.shape[1]\n\tmini_batches = []\n\n\t#Shuffling around the data randomly according to the 'permutation' list\n\tpermutation = list(np.random.permutation(m))\n\tshuffled_X = X[:, permutation]\n\tshuffled_Y = Y[:, permutation].reshape((1,m))\n\n\tcomple...
[ "0.81358165", "0.79854906", "0.79664856", "0.7933697", "0.79207736", "0.78797495", "0.7855775", "0.78445286", "0.77804965", "0.7778024", "0.7731136", "0.7714424", "0.75990486", "0.73346597", "0.7299638", "0.724078", "0.7154381", "0.707257", "0.704754", "0.699032", "0.69870824...
0.7042443
19
Get the Euclidean distance between.
def __GetBestGlints(self, glintProps, pupilCenter, numOfGlints): #<!---------------------------------------------------------------------------> #<!-- YOUR CODE HERE --> #<!--------------------------------------------------------------------...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def EuclideanDistance( self, a, b ):\n return sqrt( self.EuclideanDistanceSq(a,b) )", "def euclidean_distance(a, b):\n return np.linalg.norm(a - b)", "def euclidean(p1, p2):\n return p1.distance(p2)", "def euclidean_distance(x1, x2):\n return np.sqrt(np.sum(np.square(np.subtract(x1, x2))))", ...
[ "0.8070952", "0.7858878", "0.776366", "0.770001", "0.7698463", "0.76914376", "0.7685737", "0.7657802", "0.76443005", "0.76393646", "0.7601919", "0.758639", "0.758307", "0.75621355", "0.75569993", "0.7520769", "0.75163406", "0.74986315", "0.7488579", "0.7464511", "0.7454852", ...
0.0
-1
Find the boundary of the iris using the maximum gradient magnitude along the normals.
def __FindMaxGradientValueOnNormal(self, magnitude, orientation, p1, p2): # Create the output variable. maxPoint = (0, 0) # Get integer coordinates on the straight line between p1 and p2. points = getLineCoordinates(p1, p2) try: normalVals = magnitude[points[:, 1], p...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def max_norm() -> float:\n return 1.0", "def getMagBoundary(self):\n\n # Get the boundary of magnitude based on the filter\n lowMagnitude = nan\n highMagnitude = nan\n if (self.filter == self.FilterU):\n lowMagnitude = 7.94\n highMagnitude = 14.80\n\n eli...
[ "0.65031", "0.6011367", "0.59395814", "0.59288514", "0.5852088", "0.5780962", "0.56799847", "0.56446815", "0.56105894", "0.55805326", "0.5541225", "0.54976517", "0.54880565", "0.547522", "0.5473659", "0.53840685", "0.53713864", "0.5362857", "0.53543586", "0.5351599", "0.53121...
0.6428733
1
Drawing an ellipse around a detected blob.
def __DrawEllipse(self, image, rectangule, color): cv2.ellipse(image, rectangule, color, 2) points = cv2.boxPoints(rectangule) for i in range(4): cv2.line(image, tuple(np.array(points[i], np.int32)), tuple(np.array(points[(i + 1) % 4], np.int32)), color, 2)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def drawEllipse(img, center, axes, angle, startAngle=0, endAngle=360, color = (0,0,255), fill = -1):\n\tcv2.ellipse(img, center, axes, angle, startAngle, endAngle, color, fill)", "def ellipse(self):\n f = self.img\n x = self.x\n y = self.y\n x2 = self.x2\n y2 = self.y2\n xy = ...
[ "0.7576024", "0.74712306", "0.70329064", "0.6938057", "0.6912798", "0.683019", "0.6815984", "0.6768314", "0.6765661", "0.6706767", "0.666281", "0.6650551", "0.6620539", "0.66150665", "0.658102", "0.6555202", "0.6439544", "0.6393419", "0.63870317", "0.63784164", "0.6324931", ...
0.734845
2
The personal directory for settings storage. The settings location in the "home" directory for a user.
def personaldir(): if platform == 'windows': return os.path.join(os.environ['APPDATA'], 'automaton') else: return os.path.expanduser('~/.automaton/')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_user_config_dir(options):\n return '/root/.spinnaker'", "def findSettingsDirectory(appName=\"pyQode\"):\n home = os.path.expanduser(\"~\")\n if sys.platform == \"win32\":\n pth = os.path.join(home, appName)\n else:\n pth = os.path.join(home, \".%s\" % appName)\n if not os.pat...
[ "0.74594015", "0.7110981", "0.7075922", "0.7030838", "0.7029829", "0.6944032", "0.6924451", "0.6769799", "0.67460066", "0.6745339", "0.67053866", "0.67027885", "0.66847414", "0.6680716", "0.6651077", "0.6651077", "0.6625991", "0.6607157", "0.66036344", "0.6592801", "0.6570562...
0.74226433
1
The system directory for settings storage. Usually the default "/etc" directory.
def systemdir(): if platform == 'windows': return os.path.join(os.environ['ProgramFiles'], 'automaton') else: return "/etc/automaton/"
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def system_conf_dir(self):\n return buildconfig.SPD_CONF_PATH", "def get_config_dir() -> str:\n # Get the system app configuration standard location\n if 'APPDATA' in os.environ:\n return os.environ['APPDATA']\n elif 'XDG_CONFIG_HOME' in os.environ:\n return os.environ['XDG_CONFIG_H...
[ "0.7818157", "0.7521425", "0.7295348", "0.72870976", "0.7213437", "0.71715385", "0.70603204", "0.7051791", "0.6976202", "0.6920504", "0.6912682", "0.6906799", "0.69030756", "0.6893031", "0.68912697", "0.6889702", "0.6877458", "0.686358", "0.68574965", "0.685216", "0.6844898",...
0.73004836
2
Calculate the differential DC of given data.
def _get_diff_dc(self): self._diff_dc = tuple(encode_differential(self.data[:, 0, 0]))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def dc(z,h=0.7,omegalambda=0.7,omegam=0.3,omegak=0.0):\n return distcalc(z,h,omegalambda,omegam,omegak)['dc']", "def ddx(a):\n\t# avoid corner effects\n\tthick = 2\n\ta = np.concatenate((a[(thick-1)::-1],a,a[:-(thick+1):-1]))\n\tmode=\"same\"\n\tmode = \"valid\"\n\t\n\tK = np.array([-0.5,0,0.5])\n\tda = scig....
[ "0.66554075", "0.6413482", "0.62937135", "0.6247065", "0.6224965", "0.6184318", "0.6118709", "0.6088045", "0.603042", "0.6029362", "0.60263354", "0.6020339", "0.6007879", "0.6006958", "0.5994477", "0.5975029", "0.5964744", "0.5947611", "0.5928041", "0.5921935", "0.59042406", ...
0.65671873
1
!TXT! Return the contents of the specified Preset file.
def get_preset(self, filename): raise NotImplementedError
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _get_opt_name_content():\n path = os.path.join(os.path.dirname(__file__), \"nadamw_opt_list.txt\")\n return open(path).read()", "def read_file():\n # Create a file object called login_details, and give option to read file\n login_details = open(\"login_details.txt\",\"r\")\n # Create a list contai...
[ "0.553227", "0.5472507", "0.5359541", "0.53111434", "0.528159", "0.5275397", "0.52370745", "0.5173308", "0.5153723", "0.5140939", "0.51224416", "0.5080991", "0.50709033", "0.5057462", "0.5057462", "0.5006382", "0.5003277", "0.49992427", "0.498844", "0.49837115", "0.4958559", ...
0.5052578
15