query
stringlengths
9
3.4k
document
stringlengths
9
87.4k
metadata
dict
negatives
listlengths
4
101
negative_scores
listlengths
4
101
document_score
stringlengths
3
10
document_rank
stringclasses
102 values
This test ensures that an access token is seen as expired if storyboard is installed in multiple timezones.
def test_expired_access_token_time(self): expired = datetime.datetime.now(pytz.utc) - datetime.timedelta( minutes=6) # Store the old TZ info, if it exists. old_tz = None if 'TZ' in os.environ: old_tz = os.environ['TZ'] # Convert now into every possible ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_valid_access_token_time(self):\n\n # Store the old TZ info, if it exists.\n old_tz = None\n if 'TZ' in os.environ:\n old_tz = os.environ['TZ']\n\n # Convert now into every possible timezone out there :)\n for name in self.tested_timezones:\n\n # Ove...
[ "0.77153397", "0.68467736", "0.68020415", "0.66638994", "0.655659", "0.6532942", "0.6463671", "0.64408976", "0.64147025", "0.64067024", "0.6335219", "0.63339216", "0.6268353", "0.62255085", "0.621401", "0.6190267", "0.6190267", "0.6190267", "0.6190267", "0.6190267", "0.619026...
0.7908679
0
This test ensures that invalid grant_type parameters get the appropriate error response.
def test_invalid_grant_type(self): # Generate a valid auth token with base.HybridSessionManager(): authorization_code = auth_api.authorization_code_save({ 'user_id': 2, 'state': 'test_state', 'code': 'test_valid_code', 'expires...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def testInvalidGrantType(self):\n request = self.generateValidTokenRequest(arguments={'grant_type': b'grantType\\xFF\\xFF'},\n authentication=self._VALID_CLIENT)\n result = self._TOKEN_RESOURCE.render_POST(request)\n self.assertFailedTokenRequest...
[ "0.772801", "0.72654927", "0.726257", "0.70829815", "0.68463784", "0.677205", "0.6727337", "0.6633874", "0.651238", "0.6486372", "0.6486188", "0.64548945", "0.6451076", "0.6325722", "0.62595737", "0.6252418", "0.6246032", "0.6237852", "0.6236558", "0.6236232", "0.61953956", ...
0.8002551
0
This test ensures that invalid grant_type parameters get the appropriate error response.
def test_invalid_access_token(self): content_type = 'application/x-www-form-urlencoded' # POST with content: application/x-www-form-urlencoded response = self.app.post('/v1/openid/token', params={ 'code': 'invalid_access_toke...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_invalid_grant_type(self):\n\n # Generate a valid auth token\n with base.HybridSessionManager():\n authorization_code = auth_api.authorization_code_save({\n 'user_id': 2,\n 'state': 'test_state',\n 'code': 'test_valid_code',\n ...
[ "0.8002551", "0.772801", "0.72654927", "0.70829815", "0.68463784", "0.677205", "0.6727337", "0.6633874", "0.651238", "0.6486372", "0.6486188", "0.64548945", "0.6451076", "0.6325722", "0.62595737", "0.6252418", "0.6246032", "0.6237852", "0.6236558", "0.6236232", "0.61953956", ...
0.726257
3
This test ensures that a valid refresh token can be converted into a valid access token, and cleans up after itself.
def test_valid_refresh_token(self): # Generate a valid access code with base.HybridSessionManager(): authorization_code = auth_api.authorization_code_save({ 'user_id': 2, 'state': 'test_state', 'code': 'test_valid_code' }) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_authtoken_refresh(self):\n hagrid = models.User(username='hagrid', fullname='Rubeus Hagrid')\n auth_token = models.AuthToken(user=hagrid, algorithm='hmac-sha-1')\n existing_token = auth_token.token\n existing_secret = auth_token.secret\n auth_token.refresh()\n sel...
[ "0.75595343", "0.74704844", "0.7360822", "0.7301422", "0.7252117", "0.72328687", "0.72013396", "0.7191407", "0.71329045", "0.7123395", "0.71109587", "0.7087008", "0.7076181", "0.70589894", "0.70476675", "0.69455695", "0.6916871", "0.6894391", "0.6884534", "0.68592453", "0.683...
0.76067364
0
This test ensures that an invalid refresh token can be converted into a valid access token.
def test_invalid_refresh_token(self): content_type = 'application/x-www-form-urlencoded' # Generate an auth and a refresh token. resp_1 = self.app.post('/v1/openid/token', params={ 'refresh_token': 'invalid_refresh_token', ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_legacy_client_invalid_refresh_token_expired_access_token(self):\n self.legacy_client._client._expires_at = 1\n self.legacy_client.token['refresh_token'] = 'invalidrefreshtoken'\n response = self.legacy_client.request('GET', urljoin(BASE_URL, MOCK_ENDPOINT))\n self.assertEquals(...
[ "0.77855164", "0.7776032", "0.76719224", "0.76533115", "0.73654115", "0.7338942", "0.7290583", "0.7267676", "0.7238647", "0.71473265", "0.7119978", "0.7110751", "0.70527965", "0.7029916", "0.69989884", "0.69802237", "0.69181126", "0.6860301", "0.68478835", "0.6846695", "0.682...
0.8209073
0
tf graph construction functions that should only be called once will find this decorator useful
def one_use(func): attribute = "_cache_" + func.__name__ @property @functools.wraps(func) def decorated(self): if not hasattr(self, attribute): setattr(self, attribute, func(self)) return getattr(self, attribute) return decorated
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def build_tf_graph(self):\n raise NotImplementedError", "def _setup_graph(self):\n sess = tf.Session()\n\n ### PROBLEM 1\n ### YOUR CODE HERE\n # raise NotImplementedError\n state_ph, action_ph, next_state_ph, reward_ph = self._setup_placeholders()\n next_state_pred =...
[ "0.7813687", "0.67951167", "0.6487856", "0.64693004", "0.6440981", "0.64293563", "0.6407516", "0.6406886", "0.6392622", "0.6383422", "0.6368613", "0.63588506", "0.6348229", "0.6332977", "0.63262916", "0.63185185", "0.6299399", "0.62839144", "0.6265422", "0.6258548", "0.624859...
0.0
-1
Test retrieving all players
def test_retrieve_players(self): Player.objects.create(name='Mayita', victories=0, defeats=0) Player.objects.create(name='Moiso', victories=0, defeats=0) res = self.client.get(PLAYERS_URL) players = Player.objects.all().order_...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_gridironfootballplayers_get(self):\n pass", "def test_get_player(self):\n pass", "def test_player_index(self):\n player = Player(first_name='George', last_name='Smith')\n player.save()\n response = self.client.get(reverse('players'))\n self.assertQuerysetEqual...
[ "0.7851354", "0.7392498", "0.7249521", "0.7195039", "0.7023699", "0.69242185", "0.6841736", "0.68325335", "0.6792121", "0.6791838", "0.67904574", "0.6744118", "0.67069584", "0.6672156", "0.6652354", "0.6647714", "0.6608296", "0.6586247", "0.6585509", "0.6544839", "0.6533784",...
0.80052656
0
Test creating a new player
def test_create_player_successful(self): payload = {'name': 'Mayita', 'victories': 0, 'defeats': 0} self.client.post(PLAYERS_URL, payload) print('PLAYERS_URL: ',PLAYERS_URL) exists = Player.objects.filter( name=payload['name'] ).exists() self.assertTrue(exist...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_new_player(new_player, new_room):\n\n try:\n uuid.UUID(str(new_player.id), version=4)\n except ValueError:\n raise ValueError('new_player id is not valid uuid4')\n assert new_player.order_of_turn == 1\n assert new_player.score == 0\n assert new_player.token_presence is False\n...
[ "0.78461397", "0.78237635", "0.7688674", "0.76077133", "0.76061386", "0.75966895", "0.7172569", "0.711341", "0.6966639", "0.6960186", "0.6928948", "0.6839228", "0.67893827", "0.6780713", "0.67705965", "0.67641246", "0.6749246", "0.6720765", "0.66819185", "0.6681674", "0.66775...
0.8110652
0
Test creating a new player with invalid payload
def test_create_player_invalid(self): payload = {'name': ''} res = self.client.post(PLAYERS_URL, payload) self.assertEqual(res.status_code, status.HTTP_400_BAD_REQUEST)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_player_created(self):\n res = self.client().post('api/v1/players/new', headers={'Content-Type': 'application/json'}, data=json.dumps(self.player))\n json_data = json.loads(res.data)\n self.assertTrue(json_data.get('jwt_token'))\n self.assertEqual(res.status_code, 201)", "def test_create_play...
[ "0.7495499", "0.74699783", "0.738127", "0.718221", "0.69524", "0.67708266", "0.6658256", "0.66042596", "0.6594715", "0.6582349", "0.6539508", "0.6506546", "0.6504157", "0.6490392", "0.6451788", "0.64410824", "0.6428347", "0.64130753", "0.6399742", "0.6389613", "0.63864726", ...
0.8654237
0
Return the basic info of the current tree. return
def info(self): return nx.info(self.tree) # def children(self): """ Return the children of the current node. """ # return self.left, self.right
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def show_info(self):\r\n if not self.parent and self.key:\r\n print(\"######### ROOT #########\")\r\n print(\"------------------------\")\r\n print(\"key: %s\" % self.key)\r\n print(\"value: %s\" % self.value)\r\n print(\"color: %s\" % self.get_color())\r\n\r\n ...
[ "0.71606535", "0.6920607", "0.6735312", "0.6625062", "0.6625062", "0.6621492", "0.6614933", "0.6579641", "0.65775186", "0.6573978", "0.65506", "0.65506", "0.64760476", "0.64760476", "0.64760476", "0.64760476", "0.6467341", "0.64480984", "0.64376783", "0.6396005", "0.63847786"...
0.7387961
0
Create an iterator of the tree(from the left child to the right child). return The tuple combined of the children
def __iter__(self): if not self.left and not self.right: raise StopIteration return self.children().__iter__() # def SP_traverse(self): """ Return a string of series-parallel partial order. A recursion way to implement in-order traversal. return --...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __iter__(self):\n if self:\n if self.hasLeftChild():\n for elem in self.leftChild:\n yield elem\n yield self.key\n if self.hasRightChild():\n for elem in self.rightChild:\n yield elem", "def children(s...
[ "0.715448", "0.71510625", "0.6918973", "0.6918973", "0.6918973", "0.6883914", "0.6847021", "0.6766102", "0.6698186", "0.66943794", "0.6653978", "0.6564375", "0.65446883", "0.65330976", "0.65119195", "0.64003897", "0.6357534", "0.6283187", "0.62315375", "0.61949253", "0.618647...
0.6466656
15
Return a list of leaves based on deepfirst search algorithm. the order is from left to right parameter
def dfs_leaves(self, node=None): if not node: node = self.get_nodes_from_position('root')[0] bfs_all_nodes = list(nx.dfs_edges(self.tree, node)) leaves = [j for i, j in bfs_all_nodes if self.tree.out_degree(j) == 0] # new a list to reduce the duplicate leaves. leav...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def leaves(i, node):\n L = []\n if len(node.kids) > 1:\n for l in node.kids:\n L.extend(i.leaves(l))\n return L\n elif len(node.kids) == 1:\n return [node.kids]\n else:\n return [node]", "def get_leaves(self):\n\n nodes = self._heads[:]\n leaves = []\n\n ...
[ "0.67351824", "0.6643884", "0.65953434", "0.6591712", "0.6552699", "0.6486841", "0.64844644", "0.6421153", "0.63751054", "0.6361763", "0.633479", "0.6301599", "0.6286276", "0.6259352", "0.6251843", "0.6209863", "0.61855686", "0.617653", "0.61444813", "0.61244607", "0.60891026...
0.6211913
15
Return a list of operators based on deepfirst search algorithm. the order is from left to right parameter
def dfs_operators(self, node=None): if not node: node = self.get_nodes_from_position('root')[0] bfs_all_nodes = list(nx.dfs_edges(self.tree, node)) operators = [i for i, j in bfs_all_nodes] # operators = [i for i, j in bfs_all_nodes if self.tree.out_degree(j) == 0] ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _search_brother_ops(self, graph, op_node):\n visited = [op_node.idx()]\n stack = []\n brothers = []\n for op in graph.next_ops(op_node):\n if (op.type() != 'conv2d') and (op.type() != 'fc') and (\n not op._is_bwd_op()):\n stack.append(op)...
[ "0.6276911", "0.5942017", "0.58628064", "0.57594097", "0.56592035", "0.56488216", "0.5646335", "0.5536815", "0.55339974", "0.5520272", "0.5457814", "0.54213226", "0.5388805", "0.53401655", "0.5337534", "0.53144145", "0.52870244", "0.52579343", "0.52437997", "0.52392375", "0.5...
0.63426775
0
Return a list of events and operators of the arithmetic expression. the order is from left to right parameter
def arithmetic_expression(self, node=None): if not node: node = self.get_nodes_from_position('root')[0] leaves = self.dfs_leaves() arithmetic_expression = [] for i in leaves: arithmetic_expression.append(i) parent = self.tree.predecessors(i)[0] ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def arithmetic_eval(expr):\n tokens = tokenize(expr)\n\n operands = []\n operators = []\n\n def apply_operator(op, left, right):\n if op == '+':\n return left + right\n elif op == '-':\n return left - right\n elif op == '*':\n return left * right\n ...
[ "0.70439696", "0.6826249", "0.6800645", "0.6676217", "0.6637651", "0.6609008", "0.65761817", "0.65715873", "0.6563607", "0.65300995", "0.64735717", "0.64566135", "0.641922", "0.641922", "0.6378129", "0.63739306", "0.62892663", "0.624509", "0.62416655", "0.6231425", "0.6205041...
0.6308601
16
Return a new nonisomorphic binary construction tree. The more details of the operation is introduced by "Global partial orders from sequential data." return BinaryConstructionTree
def BCT_operators(self): leaves_original = [node for node, degree in self.tree.out_degree().items() if degree == 0] def split(node): # ## # Return bin-tuple of the orphaned tree # # Parameter: # node: string # # Return:...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _gen_test_tree_2():\n tree = BinaryNode(5)\n tree.left = BinaryNode(3)\n tree.left.left = BinaryNode(2)\n tree.left.left.left = BinaryNode(1)\n tree.left.right = BinaryNode(4)\n tree.right = BinaryNode(7)\n tree.right.left = BinaryNode(6)\n tree.right.right = BinaryNode(8)\n tree.right.right.right = B...
[ "0.65642774", "0.6500897", "0.6352472", "0.63450235", "0.63373", "0.62749153", "0.61108404", "0.6084624", "0.6027772", "0.59640837", "0.59385914", "0.5929737", "0.58415216", "0.577208", "0.5737982", "0.56831825", "0.56814563", "0.56281656", "0.5611284", "0.5605383", "0.557073...
0.56648934
17
Return a path of the list of nodes. parameter
def series_partial_order_representation(self, node=None): try: # Regard sp_order_list as a stack. sp_order_stack = list(nx.dfs_preorder_nodes(self.tree, node)) sp_order_stack.reverse() # # New a stack to store the lower operation priority element. # temp_stac...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_path(self):\n node_list = []\n node = self\n while node is not None:\n node_list.append(node)\n node = node.parent\n\n path = \"\"\n for i in range(len(node_list) - 1, -1, -1):\n path += node_list[i].__repr__()\n return path", "de...
[ "0.7074202", "0.67950255", "0.66713", "0.6528603", "0.6484949", "0.64777464", "0.6464166", "0.64154226", "0.635313", "0.6333363", "0.63091266", "0.63091266", "0.6288563", "0.6286276", "0.6277729", "0.62769395", "0.62750196", "0.6266853", "0.6245123", "0.62409425", "0.6190915"...
0.0
-1
Return a list of nodes of the position. parameter
def get_nodes_from_position(self, position=None): return [nodes for nodes, positions in self.tree.nodes(data=True) if positions["position"] == position]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def nodes(self): \n return [n for n in self.iternodes()]", "def get_nodes(self):\n pass", "def get_node_list(self):\n return []", "def getNodes(self, pos=None):\n\t\tif pos==None: pos=self.pos\n\t\tW=self.plantAreaW\n\t\tL=self.plantAreaL\n\t\tcart=self.m.getCartesian\n\t\tpC=self.m.getC...
[ "0.77235353", "0.73504615", "0.73303485", "0.7233757", "0.71931404", "0.713033", "0.7059593", "0.70508826", "0.7001874", "0.6970905", "0.69392806", "0.6934877", "0.69146484", "0.6897836", "0.68802404", "0.68802404", "0.68802404", "0.6878907", "0.6866242", "0.6832237", "0.6695...
0.7450987
1
Return a float value of inclusion probability. pi_i = n / N, where n = |sequence| = |s| N = |population| = |M|
def inclusion_probability(M, s): # initialize a dictionary to store events with inclusion probabilites s_with_inclusion_probabilites = {} # calculating the events of intersection and difference. V = [i for i in M.tree.nodes() if not (i.__contains__('parallel') or i.__contains__('series'))] s_in_M ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def probability_of_generating_containing_events(M, s):\n\n # initialize the probabilities of generating containing events.\n f = 1\n\n s_with_inclusion_probabilities = inclusion_probability(M, s)\n for v, p in s_with_inclusion_probabilities.items():\n f *= p\n\n return f", "def prob1(n):\n#...
[ "0.6631667", "0.64187765", "0.63519084", "0.6297203", "0.62468183", "0.61480355", "0.61434984", "0.609498", "0.6062884", "0.6046621", "0.6035067", "0.60236925", "0.60080016", "0.59939605", "0.598396", "0.59779894", "0.5967327", "0.5939666", "0.59200907", "0.5919952", "0.59193...
0.6789651
0
Return a float value of inclusion probability. f(pv, s) = product_{v in s}(pv) product_{v not in s}(1 pv)
def probability_of_generating_containing_events(M, s): # initialize the probabilities of generating containing events. f = 1 s_with_inclusion_probabilities = inclusion_probability(M, s) for v, p in s_with_inclusion_probabilities.items(): f *= p return f
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def inclusion_probability(M, s):\n\n # initialize a dictionary to store events with inclusion probabilites\n s_with_inclusion_probabilites = {}\n\n # calculating the events of intersection and difference.\n V = [i for i in M.tree.nodes() if not (i.__contains__('parallel') or i.__contains__('series'))]\...
[ "0.65426224", "0.61161095", "0.61135066", "0.5821492", "0.57806534", "0.5777198", "0.5777198", "0.5770672", "0.57525903", "0.5751081", "0.5734077", "0.5697218", "0.5689497", "0.5657795", "0.5614329", "0.55981725", "0.5575849", "0.5567694", "0.5567694", "0.5539852", "0.5490724...
0.63304335
1
Return a int value of whether the sequence is compatible with the model M.
def compatable_with_SP(M, s): # To ensure partial order M has heteromorphic # if not M.heteromorphism: # M.BCT_operators() # for m in M.heteromorphism: # m_leaves = M.dfs_leaves() # print m_leaves # print s[0], s[-1] # # if s[0] in m_leaves: # m_leaves = m_leaves[m_leaves....
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def validate_sequence_numbers(self):\n return self.hive_sequence1() == self.hive_sequence2()", "def is_compatible(self):\n if not self.compatible:\n raise\n return self.compatible", "def match_seq_num(self):\n return self._get(\"match_seq_num\")", "def models_compatible...
[ "0.59719247", "0.5597058", "0.55415404", "0.55074286", "0.55017793", "0.54941636", "0.53980356", "0.53844905", "0.52919215", "0.526573", "0.523655", "0.52261317", "0.52143365", "0.5174949", "0.5169537", "0.5164727", "0.51573336", "0.51371944", "0.5136686", "0.51179135", "0.51...
0.0
-1
Return a int value of the number of completed extension of the SPorder. We store the number of extension of each subtree(subpartial order) such each node can have its partial order information with its current number of extension.
def number_of_extensions(M, root=None): sp_order_formula = [i for i in M.series_partial_order_representation(root) if (i.__contains__('series') or i.__contains__('parallel'))] while sp_order_formula: # Extend the children of the current operator operator = sp_order_for...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_number_of_parts(score): \n number_of_parts = 0\n for e in score.recurse().parts:\n number_of_parts = number_of_parts + 1\n\n return( number_of_parts ) # get_number_of_parts ", "def depht(self, p):\n if self.is_root(p):\n return 0\n else:\n ...
[ "0.5881316", "0.5866302", "0.5593788", "0.5586631", "0.5544093", "0.5523313", "0.5400796", "0.5370281", "0.5363735", "0.53597265", "0.53486913", "0.5302492", "0.5282759", "0.52362657", "0.52335614", "0.5229352", "0.5222564", "0.5211037", "0.5194625", "0.5190381", "0.518178", ...
0.65274924
0
Returns a random number of closes based on close_parens_probabilities. close_parens_probabilities defaults to [0.772, 0.206, 0.021, 0.001]. This is roughly equivalent to each selection coming from a binomial distribution with n=4 and p=1/16.
def generate_close_count(self): prob = random.random() close_probabilities = reductions( lambda i, j: i + j, self.close_parens_probabilities ) + [1.0] parens = 0 while prob > close_probabilities[1]: parens += 1 del close_probabilit...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def random_coefficients(self, n=3, max_range = 10):\n return np.random.uniform(-1*max_range, max_range, n)", "def generate_close_count(self):\n return 0", "def chance(n, p):\n total = 0.0\n for k in range(n+1):\n total += comb(n, k, exact=False) * p**k * (1-p) ** (n-k)\n return to...
[ "0.5542607", "0.5430894", "0.53839785", "0.53698313", "0.5318463", "0.530422", "0.5260695", "0.52213675", "0.5187429", "0.51843035", "0.5050707", "0.5049101", "0.50225484", "0.502187", "0.5020095", "0.5019308", "0.49802074", "0.4975735", "0.49733624", "0.49695677", "0.4961603...
0.7580884
0
Converts an atom into a plush gene.
def atom_to_plush_gene(self, atom): is_literal = False proc_atom = None if callable(atom): # If it is callable, then it is likely a function that will # produce a literal. fn_element = atom() if callable(fn_element): # It's another function! ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def convert_atom(self, atom):\n\t\treturn atom", "def from_symbol_to_entrez_gene_id(row):\r\n\tgene_entry = annotation_client.get_entrez_gene_id_from_symbol(row['symb'])\r\n\t# import pdb; pdb.set_trace()\r\n\tegid = str(gene_entry['entrez_gene_id'][0]) if gene_entry is not None else \"0\"\r\n\treturn egid", "...
[ "0.6376666", "0.54954624", "0.5164283", "0.5075839", "0.49984407", "0.49653354", "0.4889176", "0.48709634", "0.47833455", "0.4767029", "0.47523892", "0.47412694", "0.47290564", "0.47286844", "0.47149265", "0.47015738", "0.46589604", "0.4652836", "0.46481746", "0.46437928", "0...
0.7106877
0
Returns a random plush gene given atom_generators and epigeneticmarkers. Returns A random Plush gene from the ``atom_generators``.
def random_plush_gene(self): atom = random.choice(list(self.atom_generators)) return self.atom_to_plush_gene(atom)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __generate_random_gene_sequence(self):\n genes = []\n for j in range(self.chromosome_size):\n genes.append(random.choice(self.gene_pool))\n\n return genes", "def random_gene(self):\n size = random.randint(1,50)\n gene = \"\"\n for i in range(0,size,1):\n ...
[ "0.62055737", "0.61462736", "0.6118242", "0.59235466", "0.5799568", "0.5753317", "0.57463783", "0.5726904", "0.56850755", "0.5670097", "0.5586955", "0.55046254", "0.5476053", "0.54712176", "0.5389296", "0.5357205", "0.5284238", "0.5267698", "0.52539104", "0.52085936", "0.5170...
0.741422
0
Returns a random Plush genome with size ``genome_size``.
def random_plush_genome_with_size(self, genome_size): atoms = rand.choice(list(self.atom_generators), size=genome_size) return [self.atom_to_plush_gene(atom) for atom in atoms]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def random_plush_genome(self, max_genome_size):\n genome_size = random.randint(1, max_genome_size)\n return self.random_plush_genome_with_size(genome_size)", "def get_random_genome(self):\n return random.choice(self.genomes)", "def generate_random_population(pop_size):\n\n random_popula...
[ "0.78010154", "0.6555178", "0.6489522", "0.639668", "0.6082051", "0.60245764", "0.5986952", "0.57938874", "0.5732188", "0.57120425", "0.5651485", "0.56411", "0.5639163", "0.5633647", "0.5595927", "0.55193704", "0.5512438", "0.54670936", "0.5464544", "0.54443496", "0.54303193"...
0.82965225
0
Returns a random Plush genome with size limited by max_genome_size.
def random_plush_genome(self, max_genome_size): genome_size = random.randint(1, max_genome_size) return self.random_plush_genome_with_size(genome_size)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def random_plush_genome_with_size(self, genome_size):\n atoms = rand.choice(list(self.atom_generators), size=genome_size)\n return [self.atom_to_plush_gene(atom) for atom in atoms]", "def get_random_genome(self):\n return random.choice(self.genomes)", "def _make_random_genome(evo_config):\...
[ "0.753748", "0.7089966", "0.6752933", "0.6277186", "0.6107495", "0.6055105", "0.60515046", "0.602981", "0.5952698", "0.5886196", "0.57833123", "0.57707804", "0.57010764", "0.5688395", "0.566979", "0.5648049", "0.5640551", "0.56156576", "0.55757904", "0.5574941", "0.5560186", ...
0.87570876
0
Returns a random Push expression with size limited by max_points.
def random_push_code(self, max_points): max_genome_size = max(int(max_points / 2), 1) genome = self.random_plush_genome(max_genome_size) return genome_to_program(genome)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def random_plush_genome(self, max_genome_size):\n genome_size = random.randint(1, max_genome_size)\n return self.random_plush_genome_with_size(genome_size)", "def random_plush_gene(self):\n atom = random.choice(list(self.atom_generators))\n return self.atom_to_plush_gene(atom)", "de...
[ "0.64721805", "0.57280564", "0.5667171", "0.5605492", "0.5529688", "0.5511735", "0.54048395", "0.5329024", "0.5326156", "0.5317445", "0.531234", "0.5264657", "0.51636416", "0.51634496", "0.5159698", "0.5148549", "0.51481014", "0.51468843", "0.51397496", "0.5133279", "0.513049...
0.7029213
0
Returns 0 to keep the genomes/programs linear Returns 0
def generate_close_count(self): return 0
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def ramfinc(self):\n return 0", "def run_phaseg(locus_file, gam_file, vg_file, canu_alignments, true_haps):\n\trecombrate=1.26\n\tmax_coverage = 15\n\tall_heterozygous = False\n\tdistrust_genotypes = True\n\twith ExitStack() as stack:\n\t\tnode_seq_list, edge_connections = vg_graph_reader(vg_file)\n\t\tal...
[ "0.586807", "0.53676265", "0.5351368", "0.5346757", "0.52909267", "0.5276123", "0.5243458", "0.523338", "0.5231497", "0.5229762", "0.5203795", "0.5187067", "0.51788396", "0.5146674", "0.514014", "0.51186925", "0.5114372", "0.5111758", "0.5100067", "0.50800157", "0.50736725", ...
0.0
-1
Return the Ground State Energies
def _get_gs_energies(self): energy = [] for ground_state in self._ground_states: gs_energy = 0.0 for key in ground_state["eci"].keys(): gs_energy += ground_state["eci"][key] * ground_state["cf"][key] energy.append(len(ground_state["atoms"]) * gs_energy...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def gEs(self):\n try:\n return self._gEs\n except AttributeError:\n try:\n self._gEs = pd.read_csv(\n os.path.join(self.loc, self.gs_out),\n index_col=0)\n print(\"Reading ground spin states from...
[ "0.6230123", "0.61784995", "0.6009308", "0.5999785", "0.5996852", "0.59820014", "0.5958661", "0.5931075", "0.5889137", "0.5888036", "0.5803028", "0.576005", "0.57563055", "0.5721198", "0.5711022", "0.5687426", "0.5670511", "0.56288415", "0.56270766", "0.56044376", "0.55956", ...
0.6506218
0
Computes the chemical potential at which the two phases coexists at zero kelvin
def _get_init_chem_pot(self): num_singlets = len(self._ground_states) - 1 matrix = np.zeros((num_singlets, num_singlets)) energy_vector = np.zeros(num_singlets) gs_energies = self._get_gs_energies() for i in range(num_singlets): for j in range(num_singlets): ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def h2_force_pov(x: float) -> float:\n\n # Start with the perspectic of one atom. Calculate the interaction between\n # its nucleus and the other atom's nucleus, and electron.\n\n # Our convention will be that towards our POV nucleus is positive;\n # repulusion from it is negative.\n H = Hydrogen3d(...
[ "0.6127528", "0.6124719", "0.6094938", "0.6066795", "0.60511374", "0.5985482", "0.59383833", "0.59134203", "0.59107715", "0.58049095", "0.5749026", "0.5744926", "0.57408077", "0.5733566", "0.5712416", "0.57103974", "0.5691079", "0.5662279", "0.56480646", "0.5645383", "0.56409...
0.6098597
2
Print message for logging
def _log(self, msg, mode="info"): if mode == "info": self._logger.info(msg) elif mode == "warning": self._logger.warning(msg)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def log(self, msg):\n print(msg)", "def log_and_print(self, message):\n self.f.write(message + \"\\n\")\n print message", "def print_message(self, message):\n print(message)", "def print_message(self, message):\n print(message)", "def logprint(self, message):\n pri...
[ "0.83646685", "0.82188475", "0.8121581", "0.8121581", "0.81110984", "0.8036673", "0.7981615", "0.78936964", "0.78833944", "0.7857071", "0.7788213", "0.77871025", "0.7698346", "0.7696792", "0.76729774", "0.76205695", "0.761563", "0.75975364", "0.75837284", "0.75765586", "0.754...
0.0
-1
Sets the integration direction.
def _set_integration_direction(self, T0, Tend): if Tend is None: # Use the default which is increasing from 0K return if T0 > Tend: self._integration_direction = "decreasing" else: self._integration_direction = "increasing"
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def setDirection(self,stepDir = 2):\n pass", "def setdirection(self, *args, **kwargs):\n return _coordsys.coordsys_setdirection(self, *args, **kwargs)", "def direction(self, direction):\n\n self._direction = direction", "def set_direction(self, new_dir):\n self.__direction = new_d...
[ "0.7542952", "0.7146989", "0.69682", "0.69272983", "0.69205153", "0.68018293", "0.68018293", "0.67248225", "0.67248225", "0.6560766", "0.649372", "0.6449591", "0.6381216", "0.6296564", "0.6294324", "0.6231282", "0.61218536", "0.60626364", "0.60610044", "0.6020907", "0.6015768...
0.76403767
0
Returns true if we reached the temperature end point.
def _reached_temperature_end_point(self, T, Tend): if Tend is None: # End point not give return False if self._integration_direction == "increasing": if T > Tend: return True elif self._integration_direction == "decreasing": if T <...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_done(self):\n return True if self.t >= self.max_ep_len else False", "def if_end(self, **kwargs):\n\n index = self.get('_index')\n\n if index and index >= len(self.steps)-1:\n return True # all steps have been used\n\n return False", "def isFinished(self):\n ...
[ "0.68749845", "0.6486663", "0.64634204", "0.640316", "0.6394104", "0.6357551", "0.6345655", "0.63410616", "0.6326322", "0.63182914", "0.62896657", "0.62468636", "0.6238003", "0.6207513", "0.62044257", "0.6198576", "0.6184775", "0.61823577", "0.6150872", "0.61056906", "0.60730...
0.83553135
0
Stores backup data to hdf5 file
def _backup(self, data, dsetname="data"): with h5.File(self._backupfile, 'a') as hfile: grp = hfile.create_group( dsetname + "{}".format( self._current_backup_indx)) for key, value in data.items(): if value is None: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def save_as_hdf5(self, filename):", "def save_backup(\n self):\n self.backup = self.data", "def to_hdf5(self, filepath, **kwargs):\n hdf = pd.HDFStore(filepath, **kwargs)\n hdf.put(self.INDEXDATAFRAME, self.df, format='fixed', data_columns=True)\n hdf.close()", "def save_h5...
[ "0.73253554", "0.6622011", "0.6496483", "0.64814097", "0.647887", "0.6392372", "0.63609046", "0.63100886", "0.62743527", "0.6262256", "0.6217909", "0.6199056", "0.61985654", "0.6194896", "0.61822635", "0.61728513", "0.6162515", "0.6148715", "0.6139941", "0.6126298", "0.610742...
0.6652448
1
Check which singlet states are higher
def _singlet_comparison(self, thermo): indicators = [] for comb in combinations(thermo, 2): indicators.append([comb[0][get_singlet_name( name)] > comb[1][get_singlet_name(name)] for name in self._singlet_names]) return indicators
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def check(self):\n if (sum(self.state) == 0):\n return -1\n elif (self.state[-1] >= 1):\n return 1\n else:\n return 0", "def check_solvability(self, state):\n\n inversion = 0\n for i in range(len(state)):\n for j in range(i, len(state...
[ "0.6204821", "0.6036369", "0.59422725", "0.5926956", "0.5911003", "0.58704495", "0.5846135", "0.57653826", "0.57541627", "0.5722884", "0.5689112", "0.5683934", "0.5656638", "0.5580243", "0.55534613", "0.552234", "0.550453", "0.549214", "0.5471285", "0.54633", "0.54565346", ...
0.0
-1
Check if composition changes too much from one step to another
def _system_changed_phase(self, prev_comp, comp): return np.abs(prev_comp - comp) > self._max_singlet_change
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def check_if_can_evolve(self):\n # This sounds similar to generate actions\n pass", "def converged(self) -> bool:", "def converged(self) -> bool:", "def converged(self) -> bool:", "def _compositions_swapped(self, thermo):\n assert self._ref_indicators is not None\n\n indicators ...
[ "0.6158223", "0.609395", "0.609395", "0.609395", "0.60568446", "0.6024883", "0.5987834", "0.5795023", "0.574844", "0.5735461", "0.57305664", "0.5709299", "0.5709299", "0.5688929", "0.5688929", "0.56603444", "0.5645165", "0.5631118", "0.562156", "0.5614584", "0.560819", "0.5...
0.61296654
1
Returns a dictionary of chem_pot based on the values in a numby array
def _get_chem_pot_dict(self, chem_pot_vec): chem_pot_dict = {} for i, name in enumerate(self._singlet_names): chem_pot_dict[name] = chem_pot_vec[i] return chem_pot_dict
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _get_eci_chem_pot(self):\n bf = self.atoms.get_calculator().BC.basis_functions\n bf_change_vec = np.zeros((1, len(bf)))\n for i, func in enumerate(bf):\n for key, num in self.groups[0].items():\n bf_change_vec[0, i] += func[key] * num\n\n for key, num i...
[ "0.6678077", "0.5988651", "0.5700197", "0.56657284", "0.55269814", "0.5509061", "0.54769254", "0.5416831", "0.5388763", "0.5379346", "0.5364361", "0.53621304", "0.53251886", "0.53189", "0.5315777", "0.5315777", "0.53001475", "0.52954715", "0.5255046", "0.52543575", "0.5249257...
0.57369226
2
Computes the right hand side of the phase boundary equation
def _get_rhs(self, thermo, chem_pot_array, beta): num_singlets = len(self._ground_states) - 1 matrix = np.zeros((num_singlets, num_singlets)) energy_vector = np.zeros(num_singlets) for i in range(num_singlets): for j in range(num_singlets): ref_singlet = therm...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def phase(self):\r\n return 0.2 * self.weights", "def _body_phase(acc_z, hz):\n phase = _phase_detect(acc_z)\n\n # Determing start and end of movement phase for right foot\n change = np.ediff1d(phase, to_begin=0)\n start_mov = np.where(change == 1)[0]\n end_mov = np.where(change == -1)[0]\n...
[ "0.6507278", "0.6443325", "0.6184058", "0.6179666", "0.61649007", "0.59894365", "0.598203", "0.59144634", "0.58875966", "0.58682543", "0.58609354", "0.5809357", "0.5801888", "0.5801637", "0.5801375", "0.5764909", "0.57172143", "0.5671528", "0.5667217", "0.56574345", "0.565262...
0.0
-1
Return array of the singlet terms
def _get_singlet_array(self, thermo): singlets = [] for entry in thermo: singlets.append([entry[get_singlet_name(name)] for name in self._singlet_names]) return singlets
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _get_terms(self):\n return self.__terms", "def _get_terms(self):\n return self.__terms", "def _get_terms(self):\n return self.__terms", "def _get_terms(self):\n return self.__terms", "def _get_terms(self):\n return self.__terms", "def _get_terms(self):\n return self.__terms", "def...
[ "0.69178885", "0.69178885", "0.69178885", "0.69178885", "0.69178885", "0.69178885", "0.69178885", "0.69178885", "0.69178885", "0.67557126", "0.66699016", "0.6567775", "0.63677454", "0.6355416", "0.6226497", "0.6089282", "0.6078308", "0.6078308", "0.6032249", "0.60092956", "0....
0.6973103
0
Check if the compositions overlap
def _compositions_swapped(self, thermo): assert self._ref_indicators is not None indicators = self._singlet_comparison(thermo) for list1, list2 in zip(indicators, self._ref_indicators): comp_swapped = True for ind1, ind2 in zip(list1, list2): if ind1 == ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def can_overlap(self):\n return False", "def overlap(component1, component2):\n if component1[0].start <= component2[0].stop and component2[0].start <= component1[0].stop:\n if component1[1].start <= component2[1].stop and component2[1].start <= component1[1].stop:\n return True\n ...
[ "0.7887731", "0.7477381", "0.7129265", "0.7078379", "0.7077774", "0.7077774", "0.7059529", "0.69029295", "0.68743813", "0.68664634", "0.68338937", "0.68276906", "0.6818039", "0.6789297", "0.67759794", "0.6754707", "0.67486566", "0.6746217", "0.6745359", "0.67083615", "0.66782...
0.0
-1
Check if one of the systems changed phase
def _one_system_changed_phase(self, thermo, ref_values): singlet_array = self._get_singlet_array(thermo) for cur_array, ref_array in zip(singlet_array, ref_values): for cur_val, ref_val in zip(cur_array, ref_array): if self._system_changed_phase(cur_val, ref_val): ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _system_changed_phase(self, prev_comp, comp):\n return np.abs(prev_comp - comp) > self._max_singlet_change", "def has_state_changed(self) -> bool:\r\n ...", "def check_device_state(self):", "def check_change(self, state_variables):\n for control in self.__control_list:\n i...
[ "0.758044", "0.6362879", "0.61289746", "0.59745437", "0.5927031", "0.5877956", "0.58395505", "0.5811819", "0.58104575", "0.5734162", "0.57106453", "0.5701636", "0.5695618", "0.568467", "0.5654003", "0.56400806", "0.5624871", "0.56106794", "0.5610273", "0.56056416", "0.5599556...
0.7447519
1
Checks if the predicted and the computed values match
def _prediction_match(self, thermo, ref_values, eps=0.05): singlet_array = self._get_singlet_array(thermo) for cur_array, ref_array in zip(singlet_array, ref_values): for cur_val, ref_val in zip(cur_array, ref_array): if abs(cur_val - ref_val) > eps: retur...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def check_prediction(self):\n predicted_scores = self.sess.run(self.NET.output_with_relu, feed_dict={self.NET.input: self.test_image if len(self.test_image.shape)==4 else [self.test_image]})\n self.original_confidence = np.max(predicted_scores)\n if np.argmax(predicted_scores,1) != self.origin...
[ "0.6819916", "0.6686152", "0.6664491", "0.66569054", "0.658159", "0.65720046", "0.65405303", "0.65399057", "0.6520549", "0.6491463", "0.64827454", "0.6441679", "0.64338255", "0.6414647", "0.6393218", "0.6378676", "0.6371993", "0.6312835", "0.6306903", "0.6305888", "0.62949526...
0.6692643
1
Perform one ODE step
def _step(self, temperature, mc_args): self._log("Current temperature {}K. Current chemical_potential:" " {} eV/atom".format( int(temperature), mc_args["chem_potential"])) thermo = [] for i, sgc in enumerate(self._sgc_obj): self._log("Running MC...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def ode(self, **kwargs):\n pass", "def ODEStep1(u, t, dt, F):\n up = u + 0.5*dt*dt*F(u, t)\n return up", "def ODEStep(u, um, t, dt, F):\n up = 2*u - um + dt*dt*F(u, t)\n return up", "def call_odeint(particle_object,dt,omega):\n \n# print \n# print '##########################'\n# ...
[ "0.75857884", "0.69290644", "0.68714005", "0.6588182", "0.64232326", "0.63321984", "0.63314575", "0.63240635", "0.6302493", "0.62737596", "0.6264755", "0.62275726", "0.6207058", "0.61914486", "0.6180464", "0.61667496", "0.6134018", "0.6125435", "0.611092", "0.60967124", "0.60...
0.0
-1
Initialize the SGC MC objects
def _init_sgc(self, init_temp, symbols): self._sgc_obj = [] for ground_state in self._ground_states: self._sgc_obj.append( SGCMonteCarlo( ground_state["atoms"], init_temp, symbols=symbols))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self):\r\n\r\n self.Helpers = Helpers(\"Movidius\")\r\n self.confs = self.Helpers.confs\r\n\r\n self.classes = []\r\n self.ncsGraph = None\r\n self.ncsDevice = None\r\n self.reqsize = None\r\n\r\n self.mean = 128\r\n self.std = 1 / 128\r\n\r\n ...
[ "0.67107725", "0.6539785", "0.6507728", "0.64441645", "0.64169127", "0.64014566", "0.6322285", "0.6314256", "0.6253781", "0.62345904", "0.62134373", "0.62134373", "0.62134373", "0.62134373", "0.62134373", "0.62134373", "0.62134373", "0.62134373", "0.6211918", "0.62051463", "0...
0.68712074
0
Solve the differential equation using adaptive euler
def separation_line_adaptive_euler( self, init_temp=100, min_step=1, stepsize=100, mc_args=None, symbols=None, init_mu=None, Tend=None): self._set_integration_direction(init_temp, Tend) if mc_args is None: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def solve_differential_equation(f_derivatives, initial, oldest=120):\n bunch = solve_ivp(f_derivatives, t_span=(0, oldest), y0=initial, vectorized=True, dense_output=True)\n return bunch.sol", "def solve(self,\n notifications = False\n ):\n\n if notifications:\n ...
[ "0.6648875", "0.65434873", "0.65434873", "0.6455188", "0.6390553", "0.6390553", "0.6283026", "0.6276709", "0.6240829", "0.6157647", "0.6154488", "0.6099942", "0.6091433", "0.608815", "0.60833484", "0.6074646", "0.6057117", "0.60456204", "0.60365635", "0.60327774", "0.60143703...
0.0
-1
Convert matplotlib figure instance to a png
def fig2rgb(fig): fig.canvas.draw() # Get RGB values width, height = fig.canvas.get_width_height() buf = np.fromstring(fig.canvas.tostring_rgb(), dtype=np.uint8) buf.shape = (height, width, 3) greyscale = 0.2989 * buf[:, :, 0] + 0.5870 * \ buf[:, :, 1] + 0.1140 * buf[:, :, 2] greysc...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _plt_to_png(self):\n import matplotlib.pyplot as plt\n from io import BytesIO\n\n with BytesIO() as file_obj:\n plt.savefig(file_obj, format='png')\n plt.close() # supress plot output\n file_obj.seek(0)\n png = file_obj.read()\n return png...
[ "0.80217075", "0.75794524", "0.7427175", "0.7253379", "0.7250348", "0.7245872", "0.72144306", "0.71553206", "0.71553206", "0.7060798", "0.70427436", "0.70322573", "0.70000625", "0.6988974", "0.69756204", "0.6965958", "0.6965958", "0.6965958", "0.69592714", "0.69592714", "0.69...
0.0
-1
Check that the ground_state arguments contain the correct fields
def check_gs_argument(ground_state): required_fields = ["bc", "cf", "eci", "atoms"] keys = ground_state.keys() for key in keys: if key not in required_fields: raise ValueError( "The GS argument has to contain {} keys. Given {}".format( required_fields,...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _verify_command_states(cls, kwargs):\n return kwargs", "def check_state(self):\n pass", "def _check_params(self):\n pass", "def validate_ground_input(ground: tuple) -> None:\n\n if not isinstance(ground, tuple):\n raise InvalidGroundValueError(\n f\"O...
[ "0.65441775", "0.6414534", "0.61819196", "0.6114851", "0.6088804", "0.5971366", "0.59573877", "0.5891864", "0.5886692", "0.5885214", "0.58631516", "0.580721", "0.5800338", "0.5740057", "0.57381886", "0.57213455", "0.57193244", "0.5703734", "0.5701963", "0.56963843", "0.569578...
0.77645344
0
Performs a prediction of the next composition value based on history
def predict_composition( comp, temperatures, target_temp, target_comp): # With this backend one does not need a screen (useful for clusters) has_matplotlib = True try: from matplotlib import pyplot as plt plt.switch_backend("Agg") except ImportError as exc: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def predict(self, observation):\n # input must contain past state, so we get it\n (state_mean, state_covariance) = self.update_state()\n\n # print(\"Update state:\", state_mean, state_covariance)\n # predict new state\n # print(\"Previous state:\", state_mean[0],\"\\nObservation:...
[ "0.67681056", "0.66855013", "0.6618457", "0.63929164", "0.63849556", "0.62970465", "0.6244604", "0.6154298", "0.6149331", "0.61291045", "0.6107751", "0.6107728", "0.6084543", "0.6028389", "0.6010402", "0.60076755", "0.59941256", "0.59893703", "0.59893703", "0.5982842", "0.598...
0.55322534
95
Return the history of one particular singlet term in one phase
def get_singlet_evolution(singlet_history, phase_indx, singlet_indx): history = np.zeros(len(singlet_history)) for i, entry in enumerate(singlet_history): history[i] = entry[phase_indx][singlet_indx] return history
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def logP(self, history, word):", "def history():", "def get_history(self, name):\n return self._scalar_history.get_history(name)", "def get_history(self, name):\n return self._scalar_history.get_history(name)", "def get_history(self):\n\t\t#state = (np.array(self._history['state'])).rehsape(\...
[ "0.6790911", "0.67153114", "0.6266664", "0.6266664", "0.6164173", "0.6145959", "0.6120264", "0.6120264", "0.6120264", "0.61089617", "0.60943365", "0.59732455", "0.596799", "0.59036946", "0.59036314", "0.5857355", "0.5850595", "0.58445555", "0.58193225", "0.5817156", "0.580244...
0.60034454
11
Returns the singlet name as stored in the thermodictionary
def get_singlet_name(orig_name): return "singlet_{}".format(orig_name)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def name(self) -> str:\n return f\"{self._inst} {self._sid_data['sid']} {self._data[self._sid_data['sid_name']]}\"", "def species_name(self):\n return self.get(self._names[\"species_name\"])", "def get_name():", "def name(self) -> str:\n return pulumi.get(self, \"name\")", "def name(se...
[ "0.6928742", "0.67757905", "0.6712813", "0.66612947", "0.66612947", "0.66612947", "0.66612947", "0.66612947", "0.66612947", "0.66612947", "0.66612947", "0.66612947", "0.66612947", "0.66612947", "0.66612947", "0.66612947", "0.66612947", "0.66612947", "0.66612947", "0.66612947", ...
0.7363678
0
Call me before using any of the tables or classes in the model
def init_model(engine): ## Reflected tables must be defined and mapped here #global reflected_table #reflected_table = sa.Table("Reflected", meta.metadata, autoload=True, # autoload_with=engine) #orm.mapper(Reflected, reflected_table) # meta.Session.configure(bind=e...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def init_model(self):\n pass", "def prepare_model(self, **kwargs):\n pass", "def _before_execute(self, db):\n pass", "def initialize_model(self):\n pass", "def _tables(self):\n assert False, \"subclass responsibility\"", "def db_table(self):", "def setUp(self):\n ...
[ "0.6825682", "0.66925555", "0.65603507", "0.6557848", "0.6490436", "0.64750445", "0.6459619", "0.6445887", "0.6356443", "0.63530535", "0.63427633", "0.6291204", "0.62848616", "0.62848616", "0.62848616", "0.62848616", "0.62848616", "0.62677914", "0.62582606", "0.6251876", "0.6...
0.6419579
8
Invite NOVA to your own server
async def invite(self, ctx): embed = discord.Embed(title='Invite links for NOVA', description='[<:news:730866149109137520> Required Permissions](https://discord.com/api/' 'oauth2/authorize?client_id=709922850953494598&permissions=1573252215...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async def invite(self):\n link = \"https://discordapp.com/oauth2/authorize?client_id=282765243862614016&scope=bot&permissions=19456\"\n await self.bot.say(\"Invite me to your server with this link!\\n\" + link)", "async def invite(self, ctx):\n await ctx.send(f'🐱You can invite me to your se...
[ "0.71325", "0.71233284", "0.6979875", "0.69756466", "0.66353047", "0.6621585", "0.65409034", "0.6487022", "0.64629596", "0.64278716", "0.6398631", "0.63980633", "0.62614393", "0.6224702", "0.61598957", "0.61565995", "0.61436397", "0.6119477", "0.59885275", "0.59364223", "0.58...
0.68731844
4
Generate a link to join NOVA's discord server!
async def discord(self, ctx): embed = discord.Embed(title='Join the discord today!', color=0x5643fd, description="This server is where " "all of " ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async def _discord(self, ctx: Context):\n\n await ctx.send(\n f\"You can join the Brawlcord community server by using this link: {COMMUNITY_SERVER}\"\n )", "async def links(self, ctx):\n await ctx.send(\"https://discordapp.com/channels/566451504332931073/681617252814159904/7554891...
[ "0.744386", "0.74403054", "0.73418206", "0.6963503", "0.6712524", "0.6543829", "0.64864606", "0.64027345", "0.63167614", "0.6239005", "0.6230791", "0.6185466", "0.61589724", "0.6143686", "0.6100748", "0.6073349", "0.60667723", "0.6044719", "0.6034835", "0.60256135", "0.601409...
0.7089395
3
Count how many words are in your document or sentence.
async def words(self, ctx, *, message): doc = str(message) res = str(sum([i.strip(string.punctuation).isalpha() for i in doc.split()])) final = "" if res == "1": final += "Your message is only **1** word." else: final += f'Your message is **{res}** words l...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def wordCount(document):\n return float(len(document.split(None)))", "def count_word(doc):\n count = count = 0\n for w in document.split(\" \"):\n count = count + 1\n return count", "def word_count(self, doc):\n\n return len(self.tokenize_doc_simple(doc))", "def count_words_...
[ "0.8210586", "0.81963086", "0.798802", "0.7895146", "0.7777426", "0.7696269", "0.76504457", "0.76361614", "0.7625369", "0.7624852", "0.7613233", "0.76092404", "0.7575838", "0.75728005", "0.7549857", "0.7539744", "0.75247324", "0.75237066", "0.75014144", "0.74710536", "0.74561...
0.0
-1
Role selection menu setup
async def rolemenu_create(self, interaction: discord.Interaction, name: str, channel: discord.TextChannel, mode: int, color: str, placeholde...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def role_command():", "def create_menus( self ):", "async def rolemenu(self, message, args):\n if \"-h\" in args or \"--help\" in args or \"--ahelp\" in args:\n await self._print_rolemenu_help(message.channel)\n return\n update_reactions = not is_key_in_args(args, \"--no-upd...
[ "0.7028201", "0.68254995", "0.66383755", "0.6535435", "0.6312337", "0.6191973", "0.6126963", "0.6125286", "0.60541356", "0.604882", "0.6041334", "0.6040062", "0.60379934", "0.6028039", "0.602484", "0.5967787", "0.5899883", "0.5894053", "0.58809334", "0.58574563", "0.58452135"...
0.60896236
8
Edit any parameter of a previosuly created rolemenu
async def rolemenu_edit(self, interaction: discord.Interaction, name: str, channel: discord.TextChannel = None, mode: int = None, color: str = None, pla...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def changeRoleInfo(self, role, info):", "def changeRole(self, node, role):", "async def edit(self, *, name, roles: Optional[Any] = ..., reason: Optional[Any] = ...):\n ...", "def modify_role():\n\n id_hash = request.args.get('id')\n\n if not id_hash or id_hash=='':\n flash('There is no id...
[ "0.7070591", "0.65158117", "0.6447683", "0.633241", "0.62679654", "0.6186953", "0.61848", "0.606558", "0.6040411", "0.6034643", "0.6011833", "0.59572345", "0.59400433", "0.5912626", "0.5906268", "0.5882015", "0.58179575", "0.5813266", "0.5810648", "0.5810553", "0.579611", "...
0.6477038
2
Delete a previously created rolemenu
async def rolemenu_delete(self, interaction: discord.Interaction, name: str): doc = await self.db.find_one({ "guild_id": interaction.guild.id, "name": name }) if not doc: return await interaction.response.send_message( ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def delete_menu():", "async def roledelete(ctx):\r\n await ctx.message.delete()\r\n roles = ctx.guild.roles\r\n roles.pop(0)\r\n for role in roles:\r\n if ctx.guild.roles[-1] > role:\r\n try:\r\n await role.delete()\r\n except:\r\n print(f\"{...
[ "0.7695256", "0.71618533", "0.7062838", "0.69895333", "0.6775688", "0.675535", "0.6746418", "0.67404985", "0.67155915", "0.6577805", "0.652319", "0.64278144", "0.64047396", "0.6371427", "0.63324994", "0.63156474", "0.63074523", "0.63068837", "0.6301148", "0.6283026", "0.62599...
0.78972113
0
Role selection menu setup
async def rolemenu_add_role(self, interaction: discord.Interaction, name: str, role: discord.Role, emoji: str = None, description: str = None): doc = aw...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def role_command():", "def create_menus( self ):", "async def rolemenu(self, message, args):\n if \"-h\" in args or \"--help\" in args or \"--ahelp\" in args:\n await self._print_rolemenu_help(message.channel)\n return\n update_reactions = not is_key_in_args(args, \"--no-upd...
[ "0.7028201", "0.68254995", "0.66383755", "0.6535435", "0.6312337", "0.6191973", "0.6126963", "0.6125286", "0.60896236", "0.60541356", "0.604882", "0.6041334", "0.6040062", "0.60379934", "0.6028039", "0.602484", "0.5967787", "0.5899883", "0.5894053", "0.58809334", "0.58574563"...
0.5843842
22
Remove a role from a menu
async def rolemenu_remove_role(self, interaction: discord.Interaction, name: str, role: str): try: role_id = int(role) except ValueError: return await interaction.response.send_message( "The role provided " "is no...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def remove_menu(menu_name):\n\n pass", "async def rolemenu_delete(self, interaction: discord.Interaction,\n name: str):\n doc = await self.db.find_one({\n \"guild_id\": interaction.guild.id,\n \"name\": name\n })\n if not doc:\n ...
[ "0.76884437", "0.747322", "0.7270676", "0.71565264", "0.712966", "0.70907384", "0.69873995", "0.6899004", "0.6845092", "0.68170446", "0.6810149", "0.68007976", "0.67884195", "0.67334276", "0.6684447", "0.6681211", "0.66589636", "0.66485894", "0.6637888", "0.662638", "0.661526...
0.81111044
0
Convert an infix expression into a postfix expression. Assumes valid inputs.
def infix_to_postfix(infix_expr): # Append adds new item to list # Concat creates a new list every time instead opstack = StackArray() res = [] lstr = infix_expr.split() # l_para = r_para = 0 # operator precedence dict prec = { # higher val = higher prec "(" : 4, "^" : 3...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def infix_to_postfix(expr):\n # you may find the following precedence dictionary useful\n prec = {'*': 2, '/': 2,\n '+': 1, '-': 1}\n ops = Stack()\n postfix = []\n toks = expr.split()\n ### BEGIN SOLUTION\n opp = {'*', '/','+', '-'}\n for x in toks:\n if str.isdigit(x):\n...
[ "0.8245655", "0.81716263", "0.81700593", "0.80590487", "0.8047456", "0.79754585", "0.7934097", "0.7881377", "0.78311", "0.78090227", "0.77986723", "0.7725289", "0.7692288", "0.7676367", "0.76296026", "0.7615798", "0.7514298", "0.740857", "0.72536755", "0.72062165", "0.7127465...
0.81546026
3
to evaluate a postfix expression into a value. Use the postfix_valid function described below to check the validity of the expression
def postfix_eval(postfix_expr): s = StackArray() expr = postfix_expr.split() for token in expr: if token[0] in '0123456789': res = token s.push(res) else: # token is operator op2 = s.pop() op2 = float(op2) if s.is_empty(): # token i...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def evaluatePostfixExp(self, postfixExpr):\n\n operandStack = []\n tokenList = postfixExpr.split(\" \")\n\n for token in tokenList:\n if self.isOperand(token):\n if \".\" in token:\n token = float(token)\n else:\n t...
[ "0.7719225", "0.74093944", "0.7368014", "0.7160753", "0.7056071", "0.6832468", "0.680652", "0.67106664", "0.67052156", "0.6677665", "0.6639799", "0.65545446", "0.64869434", "0.6457488", "0.64207363", "0.64158213", "0.6396951", "0.63920987", "0.6357941", "0.6345688", "0.631739...
0.7796605
0
To test for an invalid postfix expression. You may assume that what is passed in is a string that only contains numbers and operators. These are separated into valid tokens by spaces so you can use split and join as necessary.
def postfix_valid(postfix_expr): expr = postfix_expr.split() count = 0 if postfix_expr == "": return False for token in expr: if token[0] in '0123456789': count += 1 elif token == '~': pass else: # all other binary operators count -= 1 ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def validate(string):\n \n tokens = string.split()\n \n # Remembers if the previous token was an operator\n opflag = True\n \n ## Highly inefficient validity checking begins here ##\n \n # List of operators as they would appear in the infix expression\n operators = ['+', '-', '*', '/'...
[ "0.7520136", "0.6987341", "0.69246596", "0.6914398", "0.67455107", "0.6717881", "0.6708455", "0.67051095", "0.66992074", "0.6603976", "0.6578779", "0.6534092", "0.646224", "0.6458865", "0.6412046", "0.63550186", "0.63059497", "0.62621725", "0.6261374", "0.6159734", "0.6157778...
0.7960342
0
Bootstraps initial objects in the system from configuration (pyon.yml) via EMS calls.
def on_initial_bootstrap(self, process, config, **kwargs): # get default org_id # @TODO: single org assumed for now org_ids = process.container.resource_registry.find_resources(RT.Org, id_only=True) if not (len(org_ids) and len(org_ids[0]) == 1): raise StandardError("Could n...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _do_bootstrap(self, configs=None):\n pass", "def bootstrap(self):\n None", "def initialize():\n environment = Environment()\n environment.setup()", "def setup_early(self):\n\n # create all helper/manager components first\n self.create_allcomponents()\n\n # set up ...
[ "0.6675012", "0.66043246", "0.65268815", "0.6421426", "0.6403606", "0.6393362", "0.6323588", "0.627832", "0.6215635", "0.6152451", "0.61210865", "0.6095265", "0.60762393", "0.604019", "0.6027066", "0.5998311", "0.5998311", "0.59957886", "0.59953094", "0.59916615", "0.5989767"...
0.64609313
3
Handles bootstrapping of system restart for exchange resources and broker state. Ensures ExchangePoint and ExchangeSpace resources in system have a properly declared AMQP exchange Ensures ExchangeName resources in system have a properly declared queue Logs all exchanges/queues it didn't understand Purges all service qu...
def on_restart(self, process, config, **kwargs): ex_manager = process.container.ex_manager old_use_ems = ex_manager.use_ems ex_manager.use_ems = False # get list of queues from broker with full props that have to do with our sysname all_queues = ex_manager._list_q...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def on_initial_bootstrap(self, process, config, **kwargs):\n\n # get default org_id\n # @TODO: single org assumed for now\n org_ids = process.container.resource_registry.find_resources(RT.Org, id_only=True)\n if not (len(org_ids) and len(org_ids[0]) == 1):\n raise StandardErr...
[ "0.5795612", "0.55824107", "0.54487985", "0.54377425", "0.52643657", "0.5207759", "0.51595104", "0.51521397", "0.5136054", "0.5055962", "0.5046804", "0.49983096", "0.49463856", "0.49236155", "0.48859736", "0.48449838", "0.47945452", "0.477098", "0.47691527", "0.4756401", "0.4...
0.6884117
0
Adds a persistence interval as child to this along with its points
def appendChild(self, child): self.points += child.points.copy() self.children.append(child)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def append(self, interval):\n self.intervals.append(copy.deepcopy(interval))", "def add_child(self, child: UIComponent):\n child.parent = self\n child.set_chronometer(self._chronometer)\n self.children.append(child)\n if self.props.resize_mode == ResizeMode.AUTO:\n s...
[ "0.5290929", "0.52899754", "0.5150174", "0.5115925", "0.50472325", "0.49198186", "0.48833942", "0.4872159", "0.48698753", "0.4853984", "0.48440596", "0.48227778", "0.4820813", "0.48132288", "0.4789898", "0.47870472", "0.47661018", "0.47631806", "0.47591513", "0.47563797", "0....
0.5965832
0
Adds a poit to the set
def appendPoint(self, point): self.points.append(point)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add(self, item):\n if not (item in self.set):\n self.set[item] = True\n heapq.heappush(self.heap, item)", "def add(self, item):\n self.update(set([item]))", "def add(self, item):\n item = self._prepare_item(len(self), item)\n if item not in self._data:\n ...
[ "0.67320746", "0.66231155", "0.6503665", "0.63087", "0.6169644", "0.6162645", "0.6100729", "0.60407484", "0.5965007", "0.59499776", "0.5876474", "0.58748174", "0.5830567", "0.58104765", "0.57965404", "0.5775558", "0.5771606", "0.57556725", "0.57540786", "0.5746541", "0.571193...
0.0
-1
Returns the position of the set
def getPosition(self): return self.target, min(self.points), max(self.points)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_pos_index(self):\n return [self.row-1, self.col-1]", "def position(self) -> int:\n return self.__pos", "def get_position(self) -> Tuple[int]:\n return self.position.copy()", "def position(self) -> int:\n return self._position", "def position(self) -> int:\n return...
[ "0.6859874", "0.6829911", "0.6805826", "0.67513704", "0.67513704", "0.6703119", "0.66213673", "0.6594951", "0.65801644", "0.65507245", "0.65507245", "0.65316844", "0.65316015", "0.652383", "0.64963824", "0.64877045", "0.64877045", "0.64877045", "0.64748806", "0.6474069", "0.6...
0.0
-1
Gets the coordinates of the set on persistence diagram
def getCoord(self): return (self.birth, self.death)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def coordinates(self):\n return self.xy", "def get_coords(self):\n return self.coords", "def get_coordinates(self, sets=None):\n if sets is None:\n if self.sets is not None:\n sets = self.sets\n else:\n raise ValueError(\"sets and self.se...
[ "0.697728", "0.68564075", "0.68263465", "0.67826504", "0.6770375", "0.67588824", "0.6693697", "0.6693697", "0.6649111", "0.65402836", "0.65038276", "0.64575964", "0.64472723", "0.64332116", "0.6421785", "0.6391206", "0.6385983", "0.63749003", "0.63695455", "0.6349029", "0.629...
0.57575256
85
Gets the coordinates of the set on persistence diagram
def getRelevance(self): assert self.death is not None, "Trying to get relevance of set with missing death." return self.death - self.birth
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def coordinates(self):\n return self.xy", "def get_coords(self):\n return self.coords", "def get_coordinates(self, sets=None):\n if sets is None:\n if self.sets is not None:\n sets = self.sets\n else:\n raise ValueError(\"sets and self.se...
[ "0.697728", "0.68564075", "0.68263465", "0.67826504", "0.6770375", "0.67588824", "0.6693697", "0.6693697", "0.6649111", "0.65402836", "0.65038276", "0.64575964", "0.64472723", "0.64332116", "0.6421785", "0.6391206", "0.6385983", "0.63749003", "0.63695455", "0.6349029", "0.629...
0.0
-1
Computes the filtration of the function which values are stored in x Return a single persistence interval which is the father of all the others
def get_filtration(self, x): n = x.shape[0] s = sorted([(i, x[i]) for i in range(n)], key=lambda x: x[1]) selected = [False for i in range(n)] sets = {} ancestor = {i: i for i in range(n)} i = 0 while False in selected: newpoint = s[i] ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def evaluate_filter(self, x):\n raise NotImplementedError", "def __call__(self,x):\n\n arr = np.array(x,copy=False,dtype=float)\n return self._filterfunc(arr,*self.parvals)", "def x_density_function(self, x):\n return self.wavefunction(x) * self.wavefunction(x)", "def apply(cls, x...
[ "0.66155213", "0.6502836", "0.6244583", "0.6191562", "0.6171329", "0.60968804", "0.5972131", "0.58754563", "0.58578396", "0.583398", "0.58136237", "0.5768855", "0.57474226", "0.57474226", "0.5723264", "0.5715423", "0.57015836", "0.568552", "0.5681059", "0.56740314", "0.563692...
0.73229456
0
gets the list of segments from a given list of persistence interval and a threshold epsilon (self.epsilon)
def get_segments(self, sets=None): if sets is None: if self.sets is not None: sets = self.sets else: raise ValueError("sets and self.sets attributes are None, \ you need either to pass an origin argument to get_segments or \ ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_segments(self, threshold):\n # Perform median smoothing.\n self.confidence[\"median\"] = self.confidence[\"conf\"].rolling(5).median()\n self.confidence[\"median\"] = self.confidence[\"median\"].fillna(\n method=\"bfill\"\n )\n self.confidence[\"median\"] = sel...
[ "0.6295242", "0.6181546", "0.61601466", "0.59612644", "0.5765922", "0.57451177", "0.5709716", "0.5632255", "0.55225986", "0.5480222", "0.5394818", "0.5344036", "0.52407193", "0.5232289", "0.5227992", "0.5167823", "0.5154864", "0.5153185", "0.5120246", "0.51157445", "0.5081227...
0.57683307
4
gets the coordinates of all persistence interval on the persistence diagram
def get_coordinates(self, sets=None): if sets is None: if self.sets is not None: sets = self.sets else: raise ValueError("sets and self.sets attributes are None, \ you need either to pass an origin argument to get_coordinates or \ ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _get_xy_lims(self):\n \n x = self.datapos[0] - 1\n y = self.datapos[1] - 1\n\n return x, y", "def getPosicion(self):\r\n\t\treturn [self._x, self._y]", "def getpos(self):\n return self.pos.cartesianas()", "def coordinates(self):", "def get_coords(self):\n xTK =...
[ "0.59722954", "0.5828671", "0.5814233", "0.57858604", "0.57756937", "0.5626123", "0.5603557", "0.56022096", "0.5553897", "0.55469334", "0.55350506", "0.5529984", "0.54791397", "0.5454862", "0.54421395", "0.5437653", "0.542577", "0.5403498", "0.5395973", "0.5376222", "0.535058...
0.0
-1
Plots the persistence diagram with threshold
def show_diagram(self, sets=None): if sets is None: if self.sets is not None: sets = self.sets else: raise ValueError("sets and self.sets attributes are None, \ you need either to pass an origin argument to show_diagram or \ ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def plotThresholds (df, attack_df): \n global episod_limit\n \n ret = getThresholds (df, attack_df)\n thresholds = ret[0]\n rewards = ret[1]\n rewards_constant = ret[2]\n\n plt.plot(np.arange (0, episod_limit + 2, 1), thresholds, marker = 'None',\n linestyle = '-', color = 'k', labe...
[ "0.6225204", "0.6191241", "0.6152159", "0.6111641", "0.5967095", "0.5890814", "0.58733743", "0.5839112", "0.58273214", "0.58213043", "0.5811727", "0.57639945", "0.5759053", "0.5747193", "0.57467556", "0.57435143", "0.5733958", "0.57197344", "0.57014346", "0.56992245", "0.5697...
0.0
-1
Gets the list of segmented line from a given image
def transform(self, imgList): res = [] for img in tqdm(imgList): y_mean = np.mean(img, axis=1) self.get_filtration(y_mean) seg = self.get_segments() seg = sorted(seg, key=lambda x:x[0]) res.append(seg) return res
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_lines(self):\n\n\t\t# create a copy of original picture\n\t\tcolor_image = np.copy(self.original)\n\n\t\t# remove colors channel\n\t\tgrey_image = cv2.cvtColor(color_image, cv2.COLOR_BGR2GRAY)\n\n\t\t# apply threshold to distinguish lines better\n\t\tret, thresh = cv2.threshold(grey_image, THRESHOLD, WHITE...
[ "0.7135116", "0.708101", "0.70535976", "0.7001392", "0.68646914", "0.682499", "0.6784878", "0.67720443", "0.6763724", "0.6710374", "0.665738", "0.6582863", "0.65518916", "0.6523917", "0.64719874", "0.64563", "0.6452474", "0.6431002", "0.64243317", "0.6417658", "0.6415583", ...
0.0
-1
Testing {% ageid %} with now
def test_with_now(self): self.assertEqual(ageid(self.now), 'age1')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_with_now_minus_1_day(self):\n self.assertEqual(ageid(self.now - timedelta(1)), 'age2')", "def test_with_now_minus_4_days(self):\n self.assertEqual(ageid(self.now - timedelta(4)), 'age5')", "def test_with_now_minus_2_days(self):\n self.assertEqual(ageid(self.now - timedelta(2)), 'a...
[ "0.69662714", "0.6784399", "0.66615933", "0.6583668", "0.5942472", "0.5604099", "0.5554456", "0.54843175", "0.54843175", "0.54263604", "0.53355616", "0.51519006", "0.51454365", "0.5122762", "0.51186895", "0.5117891", "0.5117891", "0.50775474", "0.50633246", "0.5044899", "0.50...
0.735791
0
Testing {% ageid %} with yesterday
def test_with_now_minus_1_day(self): self.assertEqual(ageid(self.now - timedelta(1)), 'age2')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_with_now_minus_2_days(self):\n self.assertEqual(ageid(self.now - timedelta(2)), 'age3')", "def test_with_now_minus_4_days(self):\n self.assertEqual(ageid(self.now - timedelta(4)), 'age5')", "def test_with_now_minus_3_days(self):\n self.assertEqual(ageid(self.now - timedelta(3)), '...
[ "0.6852591", "0.68312496", "0.6746986", "0.63439506", "0.55546343", "0.5394519", "0.5380408", "0.53524274", "0.532431", "0.53095055", "0.5292067", "0.5264989", "0.52530444", "0.5232551", "0.5178952", "0.5160872", "0.5160872", "0.51382077", "0.5128389", "0.51267356", "0.512673...
0.71235526
0
Testing {% ageid %} with two days ago
def test_with_now_minus_2_days(self): self.assertEqual(ageid(self.now - timedelta(2)), 'age3')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_with_now_minus_1_day(self):\n self.assertEqual(ageid(self.now - timedelta(1)), 'age2')", "def test_with_now_minus_3_days(self):\n self.assertEqual(ageid(self.now - timedelta(3)), 'age4')", "def test_with_now_minus_4_days(self):\n self.assertEqual(ageid(self.now - timedelta(4)), 'a...
[ "0.7187669", "0.71045613", "0.69863856", "0.6409827", "0.6115783", "0.6011794", "0.59129065", "0.58910406", "0.5766613", "0.57489073", "0.570259", "0.5692219", "0.56637126", "0.5635098", "0.56275165", "0.5569759", "0.5563165", "0.5558488", "0.55378413", "0.5536425", "0.551116...
0.74781424
0
Testing {% ageid %} with three days ago
def test_with_now_minus_3_days(self): self.assertEqual(ageid(self.now - timedelta(3)), 'age4')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_with_now_minus_2_days(self):\n self.assertEqual(ageid(self.now - timedelta(2)), 'age3')", "def test_with_now_minus_4_days(self):\n self.assertEqual(ageid(self.now - timedelta(4)), 'age5')", "def test_with_now_minus_1_day(self):\n self.assertEqual(ageid(self.now - timedelta(1)), 'a...
[ "0.72407234", "0.71853626", "0.69618046", "0.6308967", "0.5874855", "0.5764519", "0.57058084", "0.5670079", "0.5669819", "0.56191695", "0.55904025", "0.5588826", "0.5547945", "0.55410856", "0.54885393", "0.5463492", "0.54514664", "0.5433101", "0.5414855", "0.5414855", "0.5396...
0.7658383
0
Testing {% ageid %} with four days ago
def test_with_now_minus_4_days(self): self.assertEqual(ageid(self.now - timedelta(4)), 'age5')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_with_now_minus_3_days(self):\n self.assertEqual(ageid(self.now - timedelta(3)), 'age4')", "def test_with_now_minus_2_days(self):\n self.assertEqual(ageid(self.now - timedelta(2)), 'age3')", "def test_with_now_minus_1_day(self):\n self.assertEqual(ageid(self.now - timedelta(1)), 'a...
[ "0.74405986", "0.7243347", "0.7164045", "0.64622", "0.61869997", "0.5989337", "0.5977138", "0.59006375", "0.58485234", "0.58320135", "0.5765161", "0.57545257", "0.5669327", "0.56675255", "0.5645776", "0.56452954", "0.5626133", "0.56260896", "0.5614728", "0.5614728", "0.560904...
0.76875675
0
Testing {% ageid %} with nondatetime object
def test_with_non_datetime(self): class Foo: def __init__(self, now): self.day = now.day self.month = now.month self.year = now.year self.assertEqual(ageid(Foo(self.now)), 'age1')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_with_now(self):\n self.assertEqual(ageid(self.now), 'age1')", "def test_with_now_minus_1_day(self):\n self.assertEqual(ageid(self.now - timedelta(1)), 'age2')", "def test_with_now_minus_4_days(self):\n self.assertEqual(ageid(self.now - timedelta(4)), 'age5')", "def test_with_now...
[ "0.63388425", "0.63034344", "0.62018883", "0.5981848", "0.5964965", "0.54276353", "0.53872085", "0.5364365", "0.5332901", "0.5280744", "0.5114568", "0.5074603", "0.5051021", "0.50412714", "0.5040437", "0.5022143", "0.50190246", "0.5007389", "0.49899918", "0.4977157", "0.49450...
0.6560905
0
Testing {% attr %} with value
def test_with_value(self): t = Template('{% load djblets_utils %}' '<span{% attr "class" %}\n' '{% if some_bool %}truthy{% endif %}\n' '{% endattr %}>') self.assertEqual( t.render(Context({ 'some_bool': True, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_escapes_value(self):\n t = Template('{% load djblets_utils %}'\n '<span{% attr \"data-foo\" %}<hello>{% endattr %}>')\n\n self.assertEqual(\n t.render(Context()),\n '<span data-foo=\"&lt;hello&gt;\">')", "def test_without_value(self):\n t = ...
[ "0.6986304", "0.64239806", "0.62053716", "0.60444796", "0.6013152", "0.5872319", "0.57564497", "0.5672158", "0.5657833", "0.5617325", "0.5616147", "0.55541307", "0.55276436", "0.55276436", "0.5515096", "0.53856736", "0.5377886", "0.5365207", "0.53558373", "0.5329564", "0.5322...
0.7152068
0
Testing {% attr %} with no value
def test_without_value(self): t = Template('{% load djblets_utils %}' '<span{% attr "class" %}\n' '{% if some_bool %}falsy{% endif %}\n' '{% endattr %}>') self.assertEqual( t.render(Context({ 'some_bool': False,...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_with_nocondense_preserves_whitespace(self):\n t = Template('{% load djblets_utils %}'\n '<span{% attr \"data-foo\" nocondense %}\\n'\n 'some \\n\\n'\n 'value\\n'\n '{% endattr %}>')\n\n self.assertEqual(\n ...
[ "0.6310917", "0.61786014", "0.6155865", "0.61103326", "0.6076733", "0.60245657", "0.60144234", "0.5987151", "0.59353393", "0.5877451", "0.57956505", "0.5780371", "0.5739188", "0.57341295", "0.570383", "0.5699017", "0.56983703", "0.56973076", "0.56841075", "0.5683129", "0.5657...
0.7473954
0
Testing {% attr %} escapes value
def test_escapes_value(self): t = Template('{% load djblets_utils %}' '<span{% attr "data-foo" %}<hello>{% endattr %}>') self.assertEqual( t.render(Context()), '<span data-foo="&lt;hello&gt;">')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_condenses_whitespace(self):\n t = Template('{% load djblets_utils %}'\n '<span{% attr \"data-foo\" %}\\n'\n 'some \\n\\n'\n 'value\\n'\n '{% endattr %}>')\n\n self.assertEqual(\n t.render(Context())...
[ "0.68725014", "0.66181767", "0.6570079", "0.6313018", "0.6299173", "0.6291482", "0.62913966", "0.62795967", "0.62727976", "0.625454", "0.6089015", "0.6058828", "0.6058828", "0.60290384", "0.59374166", "0.5875695", "0.5865545", "0.58360916", "0.5792689", "0.5773664", "0.576730...
0.8348637
0
Testing {% attr %} condenses/strips extra whitespace by default
def test_condenses_whitespace(self): t = Template('{% load djblets_utils %}' '<span{% attr "data-foo" %}\n' 'some \n\n' 'value\n' '{% endattr %}>') self.assertEqual( t.render(Context()), '<spa...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_with_nocondense_preserves_whitespace(self):\n t = Template('{% load djblets_utils %}'\n '<span{% attr \"data-foo\" nocondense %}\\n'\n 'some \\n\\n'\n 'value\\n'\n '{% endattr %}>')\n\n self.assertEqual(\n ...
[ "0.75899607", "0.6015355", "0.60029346", "0.599833", "0.59812284", "0.590307", "0.58477765", "0.5798002", "0.5767309", "0.57589287", "0.5736964", "0.57327765", "0.566209", "0.555631", "0.55304635", "0.5522477", "0.55130064", "0.55026585", "0.55026585", "0.5475007", "0.5445276...
0.7845027
0
Testing {% attr %} with "nocondense" option preserves whitespace
def test_with_nocondense_preserves_whitespace(self): t = Template('{% load djblets_utils %}' '<span{% attr "data-foo" nocondense %}\n' 'some \n\n' 'value\n' '{% endattr %}>') self.assertEqual( t.render(Co...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_condenses_whitespace(self):\n t = Template('{% load djblets_utils %}'\n '<span{% attr \"data-foo\" %}\\n'\n 'some \\n\\n'\n 'value\\n'\n '{% endattr %}>')\n\n self.assertEqual(\n t.render(Context())...
[ "0.76482457", "0.6110049", "0.6032022", "0.60097104", "0.59339833", "0.58609396", "0.5809474", "0.5775858", "0.57260346", "0.57034314", "0.5422834", "0.5383639", "0.5341832", "0.5255964", "0.51910955", "0.5153591", "0.5108174", "0.51074314", "0.50881976", "0.50743866", "0.504...
0.87957716
0
Testing {% definevar %}
def test_basic_usage(self): t = Template('{% load djblets_utils %}' '{% definevar "myvar" %}\n' 'test{{num}}\n' '{% enddefinevar %}' '{{myvar}}') self.assertEqual( t.render(Context({ 'num': 1...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_with_global(self):\n t = Template(\n '{% load djblets_utils %}'\n '{% block main %}'\n '{% block inner %}'\n '{% definevar \"myvar\" global %}{{num}}{% enddefinevar %}'\n '{% endblock %}'\n '{% endblock %}'\n '[{{myvar...
[ "0.7557205", "0.6654228", "0.66269934", "0.64311785", "0.6370524", "0.5851564", "0.58426505", "0.58310306", "0.58013564", "0.5758977", "0.5751494", "0.5745439", "0.5702883", "0.5684491", "0.5683458", "0.5608868", "0.5593703", "0.5558762", "0.55465716", "0.55460024", "0.553575...
0.73995805
1
Testing {% definevar %} with global option
def test_with_global(self): t = Template( '{% load djblets_utils %}' '{% block main %}' '{% block inner %}' '{% definevar "myvar" global %}{{num}}{% enddefinevar %}' '{% endblock %}' '{% endblock %}' '[{{myvar}}]') ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_basic_usage(self):\n t = Template('{% load djblets_utils %}'\n '{% definevar \"myvar\" %}\\n'\n 'test{{num}}\\n'\n '{% enddefinevar %}'\n '{{myvar}}')\n\n self.assertEqual(\n t.render(Context({\n ...
[ "0.6690785", "0.6217259", "0.58671683", "0.57850444", "0.57299507", "0.56862706", "0.56507456", "0.55629444", "0.5521804", "0.5510736", "0.55011946", "0.5426911", "0.5374006", "0.5332082", "0.52935004", "0.5253905", "0.5244905", "0.5229635", "0.52291816", "0.5228609", "0.5226...
0.76271826
0
Testing {% definevar %} with strip option
def test_with_strip(self): t = Template('{% load djblets_utils %}' '{% definevar "myvar" strip %}\n' '<span>\n' ' <strong>\n' ' test{{num}}\n' ' </strong>\n' '</span>\n' ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_with_spaceless(self):\n t = Template('{% load djblets_utils %}'\n '{% definevar \"myvar\" spaceless %}\\n'\n '<span>\\n'\n ' <strong>\\n'\n ' test{{num}}\\n'\n ' </strong>\\n'\n ...
[ "0.67545617", "0.6157952", "0.5923703", "0.5849991", "0.5803739", "0.57914233", "0.5790824", "0.5713735", "0.55374765", "0.54750603", "0.54729444", "0.5461906", "0.5449159", "0.54380345", "0.5423991", "0.54140425", "0.5406714", "0.5388676", "0.53626126", "0.53512734", "0.5298...
0.8216071
0
Testing {% definevar %} with spaceless option
def test_with_spaceless(self): t = Template('{% load djblets_utils %}' '{% definevar "myvar" spaceless %}\n' '<span>\n' ' <strong>\n' ' test{{num}}\n' ' </strong>\n' '</span>\n' ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_with_strip(self):\n t = Template('{% load djblets_utils %}'\n '{% definevar \"myvar\" strip %}\\n'\n '<span>\\n'\n ' <strong>\\n'\n ' test{{num}}\\n'\n ' </strong>\\n'\n '</span>...
[ "0.7116686", "0.67886454", "0.67262304", "0.64860123", "0.6057726", "0.6020129", "0.59924453", "0.59869397", "0.5836771", "0.58309156", "0.57882994", "0.57387507", "0.5709727", "0.57092327", "0.56692076", "0.5519866", "0.5509027", "0.5428919", "0.53868854", "0.5332345", "0.52...
0.7949295
0
Testing {% definevar %} with unsafe option
def test_with_unsafe(self): t = Template('{% load djblets_utils %}' '{% definevar "myvar" unsafe %}<hello>{% enddefinevar %}' '{{myvar}}') self.assertEqual(t.render(Context()), '&lt;hello&gt;')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_with_strip(self):\n t = Template('{% load djblets_utils %}'\n '{% definevar \"myvar\" strip %}\\n'\n '<span>\\n'\n ' <strong>\\n'\n ' test{{num}}\\n'\n ' </strong>\\n'\n '</span>...
[ "0.64857894", "0.64418113", "0.61597216", "0.61581916", "0.59256214", "0.58586115", "0.58135176", "0.57546264", "0.5553935", "0.5450713", "0.54189855", "0.54012203", "0.5380707", "0.5361904", "0.5353325", "0.5328995", "0.532316", "0.52441657", "0.51985097", "0.5165681", "0.51...
0.81571186
0
Testing {{...|escapespaces}} with single space
def test_with_single_space(self): self.assertEqual(escapespaces('Hi there'), 'Hi there')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_with_spaceless(self):\n t = Template('{% load djblets_utils %}'\n '{% definevar \"myvar\" spaceless %}\\n'\n '<span>\\n'\n ' <strong>\\n'\n ' test{{num}}\\n'\n ' </strong>\\n'\n ...
[ "0.68032426", "0.67486656", "0.6638375", "0.62644416", "0.60793024", "0.6068157", "0.59095526", "0.5902652", "0.5900635", "0.5815562", "0.5795822", "0.577586", "0.5750066", "0.57357484", "0.5699933", "0.5664234", "0.56113553", "0.5590534", "0.5538899", "0.55047613", "0.545144...
0.70163834
0
Testing {{...|escapespaces}} with multiple consecutive spaces
def test_with_multiple_spaces(self): self.assertEqual(escapespaces('Hi there'), 'Hi&nbsp; there')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_with_single_space(self):\n self.assertEqual(escapespaces('Hi there'),\n 'Hi there')", "def test_with_spaceless(self):\n t = Template('{% load djblets_utils %}'\n '{% definevar \"myvar\" spaceless %}\\n'\n '<span>\\n'\n ...
[ "0.67469984", "0.6433338", "0.63909113", "0.61706376", "0.616987", "0.603858", "0.57823545", "0.5732287", "0.5717638", "0.55804926", "0.55595803", "0.5544655", "0.5468769", "0.5451948", "0.5430117", "0.5414154", "0.538847", "0.53717864", "0.5336291", "0.52358156", "0.5225007"...
0.6839661
0
Testing {{...|escapespaces}} with newline
def test_with_newline(self): self.assertEqual(escapespaces('Hi there\n'), 'Hi&nbsp; there<br />')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_newlines(self):\n self.assertValue({\n \"foo\": \"something\\nwith\\nnewlines\",\n },\n \"foo: something_with_newlines\\n\")", "def test_code(self):\n self.assertEquals(\"\\n\\tline1\\n\\tline2\",\n trans(\"{{{\\nline1\\nline2\\n}}}\"))", ...
[ "0.66250724", "0.6362418", "0.6012879", "0.5941337", "0.5929384", "0.5918962", "0.5874929", "0.5810262", "0.5764275", "0.5755598", "0.57518566", "0.57145613", "0.56923354", "0.5679629", "0.565067", "0.5621903", "0.55415255", "0.55312526", "0.55049425", "0.5420975", "0.5402391...
0.68857753
0
Testing {{...|humanize_list}} with empty list
def test_with_empty_list(self): self.assertEqual(humanize_list([]), '')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_with_1_item(self):\n self.assertEqual(humanize_list(['a']),\n 'a')", "def test_with_2_items(self):\n self.assertEqual(humanize_list(['a', 'b']),\n 'a and b')", "def test_with_4_items(self):\n self.assertEqual(humanize_list(['a', 'b',...
[ "0.7209216", "0.6821816", "0.6803753", "0.6747265", "0.60909104", "0.6047052", "0.5889234", "0.576699", "0.5730108", "0.5727563", "0.5638082", "0.5527138", "0.54196876", "0.5410036", "0.53933257", "0.53890765", "0.53756136", "0.5358281", "0.5352746", "0.5332928", "0.5312761",...
0.84898084
0
Testing {{...|humanize_list}} with 1 item
def test_with_1_item(self): self.assertEqual(humanize_list(['a']), 'a')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_with_4_items(self):\n self.assertEqual(humanize_list(['a', 'b', 'c', 'd']),\n 'a, b, c, and d')", "def test_with_2_items(self):\n self.assertEqual(humanize_list(['a', 'b']),\n 'a and b')", "def test_with_3_items(self):\n self.assertE...
[ "0.74867344", "0.7485351", "0.7454677", "0.6828147", "0.67824715", "0.6465609", "0.63791704", "0.58145946", "0.58145946", "0.58145946", "0.58145946", "0.5766288", "0.5729722", "0.572213", "0.57021636", "0.56853616", "0.56729215", "0.5652388", "0.5632467", "0.56143266", "0.555...
0.8221179
0
Testing {{...|humanize_list}} with 2 items
def test_with_2_items(self): self.assertEqual(humanize_list(['a', 'b']), 'a and b')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_with_1_item(self):\n self.assertEqual(humanize_list(['a']),\n 'a')", "def test_with_3_items(self):\n self.assertEqual(humanize_list(['a', 'b', 'c']),\n 'a, b and c')", "def test_with_4_items(self):\n self.assertEqual(humanize_list(['...
[ "0.7770209", "0.7701434", "0.7694392", "0.67632717", "0.65721804", "0.6350669", "0.63303834", "0.57339954", "0.5732924", "0.5719008", "0.5717518", "0.56404835", "0.56404835", "0.56404835", "0.56404835", "0.562351", "0.5592338", "0.5560638", "0.5533705", "0.5500018", "0.547888...
0.7984499
0
Testing {{...|humanize_list}} with 3 items
def test_with_3_items(self): self.assertEqual(humanize_list(['a', 'b', 'c']), 'a, b and c')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_with_4_items(self):\n self.assertEqual(humanize_list(['a', 'b', 'c', 'd']),\n 'a, b, c, and d')", "def test_with_1_item(self):\n self.assertEqual(humanize_list(['a']),\n 'a')", "def test_with_2_items(self):\n self.assertEqual(humaniz...
[ "0.7959641", "0.76548904", "0.7512626", "0.6840446", "0.6606152", "0.6386993", "0.6284902", "0.59038913", "0.5873438", "0.5778882", "0.57520056", "0.5720628", "0.56403565", "0.5628272", "0.561915", "0.561915", "0.561915", "0.561915", "0.5571809", "0.5539878", "0.55234474", ...
0.8175464
0
Testing {{...|humanize_list}} with 4 items
def test_with_4_items(self): self.assertEqual(humanize_list(['a', 'b', 'c', 'd']), 'a, b, c, and d')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_with_3_items(self):\n self.assertEqual(humanize_list(['a', 'b', 'c']),\n 'a, b and c')", "def test_with_1_item(self):\n self.assertEqual(humanize_list(['a']),\n 'a')", "def test_with_2_items(self):\n self.assertEqual(humanize_list(['...
[ "0.7818746", "0.75763154", "0.73760206", "0.6708089", "0.6705747", "0.63406163", "0.63235223", "0.59415454", "0.57278186", "0.56521595", "0.56213796", "0.5577789", "0.5576578", "0.5571174", "0.55692714", "0.55645466", "0.5553006", "0.5546997", "0.5542719", "0.554077", "0.5516...
0.8308927
0
Testing {% include_as_string %}
def test_basic_usage(self): t = Template('{% load djblets_utils %}' '{% include_as_string template_name %}') self.assertEqual( t.render(Context({ 'template_name': 'testing/foo.html', 'foo': 1, 'bar': 2, })), ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def include_string(parser, token):\n\tbits = token.split_contents()\n\tif len(bits) != 2:\n\t\traise TemplateSyntaxError(\"%r tag takes one argument: the template string to be included\" % bits[0])\n \tstring = parser.compile_filter(bits[1])\n\treturn IncludeStringNode(string)", "def test_includes(self):\n ...
[ "0.72237074", "0.7058335", "0.6938502", "0.69019485", "0.6657269", "0.66082406", "0.6418754", "0.623286", "0.620674", "0.5977595", "0.5906052", "0.5865723", "0.58279705", "0.5799238", "0.5733636", "0.57208425", "0.57152575", "0.5704218", "0.5651656", "0.5632499", "0.56095517"...
0.7729179
0
Testing {{...|indent}} with default indentation level
def test_with_default_indent(self): self.assertEqual(indent('foo'), ' foo')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_with_custom_indent(self):\n self.assertEqual(indent('foo', 3), ' foo')", "def test_adjust_indent():\n hr.Element.indent = 2\n\n body = hr.Body()\n body.append(hr.P(\"some text\"))\n html = hr.Html(body)\n\n file_contents = render_result(html)\n\n print(file_contents)\n line...
[ "0.778307", "0.65845025", "0.64145744", "0.640567", "0.6320119", "0.6283757", "0.6254726", "0.62319493", "0.61933684", "0.6110476", "0.6092362", "0.60786456", "0.60786456", "0.60785407", "0.6023838", "0.59295094", "0.5891613", "0.58672994", "0.58418995", "0.5767337", "0.57017...
0.76486266
1