query
stringlengths
10
2k
document
stringlengths
20
51.2k
metadata
dict
negatives
listlengths
0
101
negative_scores
listlengths
0
101
document_score
stringlengths
3
10
document_rank
stringclasses
102 values
Layers will be in the order they are first used. Use this method declare the order of all layers initially if that is more convenient. Example svg.declare_layers(["foo", "bar"]) svg["bar"].circle(...) svg["foo"].circle(...)
def declare_layers(self, names): for name in names: self[name] return self
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def init_layers(self):\n\n # get caching layers activated\n caching_layers = G3WCachingLayer.objects.all()\n for caching_layer in caching_layers:\n self.add_layer(str(caching_layer), caching_layer)", "def _setLayer(items, layer):\n for i in items:\n i.setZValue(l...
[ "0.6518049", "0.6088882", "0.60712445", "0.6041019", "0.5981428", "0.59811604", "0.5903894", "0.5864813", "0.5643448", "0.5631956", "0.56109345", "0.56042975", "0.5582956", "0.55809575", "0.55217713", "0.5508424", "0.5501092", "0.5498657", "0.54783887", "0.54342675", "0.53980...
0.6691622
0
Get a config parameter.
def getcfg(self, key, default=None): return self._config.get(key, default)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_config(param):\n _config = loadConfig()\n try:\n click.echo(f\"{param}={rgetattr(_config, param)}\")\n except AttributeError as err:\n click.echo(err)", "def _getConfigParam(self, name, default=None):\n return self.config.get(self._configPrefix + name.lower(), default)", "...
[ "0.7765674", "0.77445865", "0.76195747", "0.7470028", "0.7209421", "0.7194922", "0.7148899", "0.7083033", "0.6972996", "0.6968454", "0.6918248", "0.68948", "0.68420726", "0.6830577", "0.68072855", "0.6805986", "0.67980874", "0.679541", "0.6745283", "0.6716918", "0.66994333", ...
0.0
-1
Mnemonic name in the pattern that is used as an anchor name for this pattern in the original graph. Used for the second round of the pattern application when only a part of instances is allowed for conversion.
def anchor(): return 'concat'
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_name(self):\n return self._pattern", "def regular_edge_name(name: str) -> str:\n regular = \"\"\n for char in name:\n if char.isalpha() or char.isdigit():\n regular = f\"{regular}{char}\"\n else:\n regular = f\"{regular}_\"\n ...
[ "0.6130321", "0.60024047", "0.5917285", "0.5908818", "0.5677223", "0.55871207", "0.55120426", "0.54457253", "0.54279524", "0.54170763", "0.54170763", "0.54170763", "0.5410826", "0.5370064", "0.5361531", "0.5299486", "0.52492785", "0.524747", "0.52373356", "0.52125674", "0.520...
0.0
-1
Patch a resource that does not exist.
def test_patch_a_resource_that_does_not_exist(): pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_patch_a_resource_that_exists():\n pass", "def patch(self, resource, data, target=None, verb='patch', **kwargs):\n return self._modify_resource(resource, data, target, verb, **kwargs)", "def test_partial_update_should_not_be_allowed(self):\n response = self.client.patch(self.get_url(),...
[ "0.757087", "0.66681165", "0.65451527", "0.6482913", "0.6449747", "0.6362866", "0.632937", "0.63254523", "0.6230159", "0.61761653", "0.61406714", "0.61162186", "0.6114416", "0.610804", "0.6103152", "0.6082894", "0.60821027", "0.60821027", "0.60821027", "0.6071081", "0.6056317...
0.81173146
0
Patch a resource that exists.
def test_patch_a_resource_that_exists(): pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_patch_a_resource_that_does_not_exist():\n pass", "def patch(self, resource, data, target=None, verb='patch', **kwargs):\n return self._modify_resource(resource, data, target, verb, **kwargs)", "def patch_resource(self, **kwargs):\n results = self.api.action.resource_patch(**kwargs)\n ...
[ "0.748302", "0.7117084", "0.71152043", "0.6791493", "0.6547214", "0.65021586", "0.64828354", "0.6405727", "0.6402518", "0.63826203", "0.63826203", "0.63826203", "0.63589907", "0.635854", "0.6339831", "0.63129514", "0.6304192", "0.62987024", "0.6289939", "0.62895", "0.6276004"...
0.7860705
0
Set up necessary mocks.
def setUp(self): self.mock_request = SimpleNamespace(**{ "app": { "db_conn": SimpleNamespace(**{ "add_share": asynctest.CoroutineMock(), "edit_share": asynctest.CoroutineMock(), "delete_share": asynctest.CoroutineMock(), ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def setUp(self):\n util.create_mocks()", "def setUp(self):\n util.create_mocks()", "def setUp(self):\n util.create_mocks()", "def setUp(self):\n util.create_mocks()", "def setUp(self):\n util.create_mocks()", "def setUp(self):\n util.create_mocks()", "def setup...
[ "0.83429885", "0.83429885", "0.83429885", "0.83429885", "0.83429885", "0.83429885", "0.76141965", "0.732216", "0.72956055", "0.7250134", "0.7236729", "0.722987", "0.7168788", "0.7143185", "0.7097275", "0.7021818", "0.7019232", "0.7002093", "0.69976366", "0.69880414", "0.69759...
0.0
-1
Set up necessary mocks.
def setUp(self): self.mock_request = SimpleNamespace(**{ "app": { "db_conn": SimpleNamespace(**{ "get_access_list": asynctest.mock.Mock( side_effect=InterfaceError('Lost connection') ), ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def setUp(self):\n util.create_mocks()", "def setUp(self):\n util.create_mocks()", "def setUp(self):\n util.create_mocks()", "def setUp(self):\n util.create_mocks()", "def setUp(self):\n util.create_mocks()", "def setUp(self):\n util.create_mocks()", "def setup...
[ "0.83434236", "0.83434236", "0.83434236", "0.83434236", "0.83434236", "0.83434236", "0.761329", "0.73211783", "0.72958976", "0.72513187", "0.72364044", "0.7230409", "0.7167704", "0.71439105", "0.7097649", "0.70216227", "0.7019274", "0.7002294", "0.6998239", "0.69877636", "0.6...
0.0
-1
Create a Google credentials object to use with Google APIs.
def google_credentials(secrets: Dict) -> GoogleCredentials: assert secrets.get( "access_token" ), """A Google access token is required. Please connect a Google account to your Stencila account at https://hub.stenci.la/me/social/connections/.""" return GoogleCredentials( access_token=secret...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def google_creds() -> object:\n # If modifying these scopes, delete the file token.pickle.\n SCOPES = ['https://www.googleapis.com/auth/drive.file',\n 'https://www.googleapis.com/auth/drive',\n 'https://www.googleapis.com/auth/drive.activity',\n 'https://www.googleapis....
[ "0.77518743", "0.73817676", "0.7317665", "0.7188884", "0.7187476", "0.6951302", "0.67126113", "0.671185", "0.66343063", "0.6633896", "0.66179305", "0.6569742", "0.6510294", "0.65030307", "0.64972836", "0.64972836", "0.6489057", "0.6488448", "0.6469982", "0.6434826", "0.642037...
0.75300974
1
List of sorted filenames in path, based on pattern.
def flist(file_pattern, *sorted_args, **sorted_kwargs): files = glob.glob(file_pattern) return sorted(files, *sorted_args, **sorted_kwargs)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getFilenameList(path, pattern='*.nii.gz'):\n\n filename = [os.path.basename(x) for x in sorted(glob.glob(os.path.join(path, pattern)))]\n\n return filename", "def sorted_files(self, pattern=None):\n return sorted(self.files(pattern))", "def find_files(path: str, filename_pattern: str, sort: bo...
[ "0.8076888", "0.8059111", "0.77775615", "0.77073944", "0.7696663", "0.7571147", "0.7473168", "0.7470296", "0.74005544", "0.719926", "0.71079266", "0.70722246", "0.7062575", "0.7055462", "0.70358264", "0.700608", "0.70027596", "0.6975414", "0.691335", "0.6885763", "0.6879086",...
0.73943526
9
Given a file in input return the name of the file format.
def get_file_format(file): flag = None with open(file) as f: for line in f.readlines(): MAT, MF, MT = read_control(line)[:3] if MF == 1 and MT == 451: i = 0 C, i = read_cont([line], i) flag = C.N1 break if flag i...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_file_name(file):\n return os.path.splitext(os.path.basename(file))[0]", "def get_name_from_file(filename):\n return filename.split(\".\")[0]", "def get_fname(a_file):\r\n fname, fext = os.path.splitext(a_file)\r\n return os.path.basename(fname)", "def get_fname(a_file):\r\n fname, fext...
[ "0.74809843", "0.7167439", "0.70396876", "0.70396876", "0.69910496", "0.69692165", "0.69370663", "0.6895506", "0.68937045", "0.6858792", "0.68532634", "0.6778418", "0.67516065", "0.67384994", "0.67334", "0.67194456", "0.67105556", "0.6709312", "0.6696907", "0.66908956", "0.66...
0.0
-1
Create the input point cloud as numpy array.
def createInputPointCloud(side_size:int, center_x:int, center_y:int, nb_pts:int): in_pts = np.zeros(shape=(nb_pts,2), dtype=np.float32) side_nb_pts = nb_pts / 4 ds = side_size / side_nb_pts for i in range(nb_pts): if i < side_nb_pts: in_pts[i][0] = center_x + i * ds - side_size * 0.5...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def convertcloud(points):\n pcd = open3d.geometry.PointCloud()\n pcd.points = open3d.utility.Vector3dVector(points)\n return pcd", "def pointcloud2_to_xyz_array(cloud_msg, remove_nans=True):\n return get_xyz_points(pointcloud2_to_array(cloud_msg), remove_nans=remove_nans)", "def create_point_cloud(...
[ "0.69385767", "0.67939407", "0.6625739", "0.6611402", "0.65498674", "0.63520616", "0.6300543", "0.6198448", "0.6152283", "0.6145474", "0.61424744", "0.61268926", "0.61203974", "0.6113671", "0.6109885", "0.6088556", "0.6087002", "0.6026734", "0.60205287", "0.6014845", "0.59741...
0.61972463
8
Return a list of tags selected by this field.
def get_tags(self, root): tags = root.xpath(self.path) return tags if self.many else tags[:1]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def tags(self) -> list[str]:\n _args: list[Arg] = []\n _ctx = self._select(\"tags\", _args)\n return _ctx.execute_sync(list[str])", "def get_tags(self) -> Set[Text]:\r\n return {tag for tag in self.tags}", "def get_tags(self):\n return self.tags", "def getTags(self,):\n\t\t...
[ "0.72415495", "0.72145015", "0.7205118", "0.72008705", "0.7195435", "0.7195435", "0.71468115", "0.7141378", "0.71070844", "0.70289785", "0.70289785", "0.70289785", "0.70289785", "0.70289785", "0.70289785", "0.70289785", "0.70289785", "0.6968254", "0.69681096", "0.6967028", "0...
0.0
-1
Function that, given a pandas dataframe, a text column name and token column name, applies tokenization, stopwords(english) and stemming(english). Returns dataframe with column tok_col_name added
def tokenization_stopwords_stemming(df, col_name='headline', tok_col_name='tok'): # Tokenization df[tok_col_name] = df[col_name].apply(word_tokenize) df_tok = df.explode(tok_col_name) # Convert tokens to lower case df_tok.loc[:,[tok_col_name]] = df_tok.apply(lambda x: str(x[tok_col_name]).lower...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def tokenize(self, df: DataFrame, text_col=\"text\") -> DataFrame:\n\n texts = df[text_col]\n if self.to_lower:\n texts = texts.apply(lambda text: text.lower())\n\n if self.use_remove_punctuation:\n texts = texts.apply(lambda text: self.remove_punctuation(text))\n\n ...
[ "0.8086429", "0.78374624", "0.77318347", "0.7164202", "0.7015281", "0.6715132", "0.6636676", "0.661218", "0.66035867", "0.65780497", "0.6567349", "0.64930165", "0.6434808", "0.63795674", "0.63553643", "0.6337118", "0.6319304", "0.6311945", "0.62806576", "0.62525356", "0.62313...
0.78858334
1
Function that loads model result files from given path and creates a Pandas dataframe with relevant information
def consolidate_results(path='./Data'): model_files = [load(os.path.join(path, f)) for f in os.listdir(path) if os.path.isfile(os.path.join(path, f)) and f.startswith('model_')] df_final = pd.DataFrame(columns=['model_name','train_accuracy','test_accuracy', ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def collect_results( results_dir = \"experiments\" ) :\n #%%\n import pandas as pd\n exps_fn = os.listdir( results_dir )\n dics = []\n for fname in exps_fn :\n with open( results_dir + \"/\" + fname, \"rt\", encoding=\"utf8\" ) as f_out :\n dics.append( json.load( f_out ) )\n\n ...
[ "0.6865518", "0.65930134", "0.6406159", "0.6392445", "0.63272965", "0.62657195", "0.6258487", "0.6214237", "0.6211748", "0.620592", "0.6197445", "0.6182253", "0.6165909", "0.61528045", "0.6123962", "0.6101334", "0.6086461", "0.6085877", "0.60796493", "0.6055155", "0.605096", ...
0.6649709
1
Convert a scipy sparse matrix to a torch sparse tensor.
def sparse_mx_to_torch_sparse_tensor(sparse_mx): sparse_mx = sparse_mx.tocoo().astype(np.float32) indices = torch.from_numpy( np.vstack((sparse_mx.row, sparse_mx.col)).astype(np.int64)) values = torch.from_numpy(sparse_mx.data) shape = torch.Size(sparse_mx.shape) return torch.sparse.FloatTen...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def csr2tensor(self, matrix: sp.csr_matrix):\n matrix = matrix.tocoo()\n x = torch.sparse.FloatTensor(\n torch.LongTensor(np.array([matrix.row, matrix.col])),\n torch.FloatTensor(matrix.data.astype(np.float32)),\n matrix.shape,\n ).to(self.device)\n retu...
[ "0.8299787", "0.8148542", "0.8045949", "0.80325705", "0.80134654", "0.79973555", "0.79973555", "0.7985302", "0.7985302", "0.7985302", "0.7977018", "0.79650825", "0.7754673", "0.7713117", "0.7429514", "0.7429514", "0.735423", "0.71969247", "0.7156927", "0.69882196", "0.6969645...
0.80300856
7
If we create a user, their password should be a hash
def test_password_is_hashed(self): self.request.json_body = deepcopy(self.new_account) result = users_post_view(self.request)['d'] user = self.session.query(User).one() expected = dict_from_row(user, remove_fields=removals) session = self.session.query(Session).one() expe...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_creation_with_password(self, user):\n user.password = \"is_god\"\n user.save()", "def user_created(self, user, password):\n\n if not self.check_prereqs():\n return False\n\n if self.has_user(user):\n return False\n\n hash = self.hash_method.genera...
[ "0.7726191", "0.7579204", "0.74620616", "0.7439605", "0.74393666", "0.73415995", "0.7335382", "0.7290797", "0.7253117", "0.72513354", "0.72508526", "0.72447515", "0.72222364", "0.72116524", "0.71739984", "0.7142977", "0.7129703", "0.7124952", "0.7111249", "0.7111221", "0.7101...
0.6987524
31
If we pass a bad email, get an error about it
def test_bad_emails(self): bad_email = 'invalid@spaced domain.com' email_result = {} try: validate_email(bad_email) # validate and get info self.fail('Validate email did not raise exception, fix the test') except EmailNotValidError as e: # email is not...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_invalid_email_when_logging_in(self):\n pass", "def test_bad_email(self):\n user = self.make_user()\n data = {\"email\": \"bogus\"}\n\n with self.login(user):\n response = self.post(\"referrals:create\", data=data)\n\n assert response.status_code == 302\n ...
[ "0.74792856", "0.7265454", "0.7150463", "0.7133641", "0.71047163", "0.70843005", "0.7062197", "0.7058937", "0.7051389", "0.7014133", "0.69064766", "0.6904623", "0.6868432", "0.6855807", "0.6827111", "0.68181306", "0.68108344", "0.6800277", "0.6797618", "0.6796466", "0.6794702...
0.6926722
10
Before running formatter, ensure that all needed files are present. If files are missing, raise error
def check_missing_files(self): files = [getattr(self, attr) for attr in self._required] try: utilities.check_missing_files(files) except utilities.MissingConstraintError as err: err.message += "\nSkipping {}\n".format(self.__class__.__name__) raise err
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def check_before_run(self, required_files):\n if isinstance(required_files, str):\n required_files = [required_files]\n\n for fpath in required_files:\n if not os.path.exists(fpath):\n raise RuntimeError('\"{}\" is not found'.format(fpath))", "def check_before_r...
[ "0.6565151", "0.651269", "0.6121124", "0.61044186", "0.6020436", "0.6014831", "0.5990034", "0.5987271", "0.5973467", "0.593405", "0.5931839", "0.59284055", "0.59284055", "0.59284055", "0.59284055", "0.59284055", "0.59284055", "0.59284055", "0.5910977", "0.5910511", "0.5908764...
0.59022653
21
Filter run time in minutes.
def filter_run_time(self) -> int: return self.raw["state"]["filterruntime"]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def filter_by_time(df, user):\n\n time = user.time_to_cook.replace('cooking_time_less_than_', '')\n\n return df.loc[df.minutes <= int(time)]", "def search_by_time(self, tl):\n print(\"Search by minutes\")\n minutes = input(\"Please enter the number of minutes for the task: \")\n try:\...
[ "0.6651707", "0.5987258", "0.5836726", "0.57126194", "0.5702359", "0.56346774", "0.56127495", "0.55244106", "0.54508096", "0.5399685", "0.5386669", "0.53768426", "0.5367354", "0.5330222", "0.5321342", "0.5310041", "0.5290718", "0.5287419", "0.5280552", "0.5208146", "0.5176441...
0.55677617
7
Sets a setting description. Entry must have already been created with createValue.
def setDescription(self, valueName, valueDescription): self.settings[valueName][1] = valueDescription
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def SetDescription(self, description):\n self.description = str(description)", "def set_description(self, description):\n self.description = description", "def set_description(self, desc: str) -> None:\n self.metadata.data[\"description\"] = desc", "def set_description(self, description)...
[ "0.7191677", "0.7170024", "0.70966184", "0.7033046", "0.6972985", "0.6917", "0.6809093", "0.680159", "0.66665894", "0.66665894", "0.66665894", "0.66665894", "0.66591215", "0.660125", "0.66001844", "0.66001844", "0.66001844", "0.66001844", "0.66001844", "0.66001844", "0.660018...
0.7507367
0
perform gradient descent for specified number of iterations, theta is a 1 by 2 row vector
def run_gradient_descent(data,theta,alpha,num_iters): population = data[:,0] prices = data[:,1] x = ones(shape=(len(population),2)) #add ones for theta0 x[:,1] = population x = transpose(x) error_history = zeros(shape=(num_iters,1)) for i in range(num_iters): predictions = thet...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def gradient_descent(features, values, theta, alpha, num_iterations):\r\n \r\n m = len(values)\r\n cost_history = []\r\n\r\n for i in range(num_iterations):\r\n # your code here\r\n cost = compute_cost(features, values, theta)/(2.0*m)\r\n cost_history.append([cost])\r\n \r\n...
[ "0.81894433", "0.81227314", "0.80990666", "0.80839133", "0.80733466", "0.7990222", "0.7950814", "0.7932632", "0.78085345", "0.77604413", "0.7753804", "0.774601", "0.77293676", "0.7535501", "0.75282127", "0.7490378", "0.7490378", "0.74698806", "0.74286115", "0.7412655", "0.740...
0.8083519
4
Parse results as tuples.
def _get_results(tree, year): projects = [] for t in tree.findAll('li', {'class': 'mdl-list__item mdl-list__item--one-line'}): org = _clean(t.findChildren('a')[0].text) a = t.findChildren('a')[0]['href'] org_url = 'https://www.google-melange.com' + a org_tree = _get_tree...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def parse(result):\n return {make_tuple(key[4:]): val for key, val in result.items()}", "def wrap_result(data: interpreter.TupleValue):\n return tuple(handle(d) for d in data)", "def _convert_to_tuple(r):\n if not r:\n return r\n else:\n return (r[\"token\"], r[\"value...
[ "0.68019086", "0.6605696", "0.6552559", "0.6460379", "0.6434282", "0.63798237", "0.6189959", "0.61393327", "0.613407", "0.6111463", "0.6088097", "0.6022935", "0.59827214", "0.59761107", "0.5965004", "0.59438485", "0.592414", "0.5904595", "0.5854066", "0.5852565", "0.5852518",...
0.0
-1
Funcion auxiliar para crear ventana sigmoidal para el taper
def sigmoid(x): S = np.ones((np.size(x),)) for i in range(len(x)): S[i] = 1/(1+np.exp(-x[i])) return S
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def sigmoid(z):\r\n \r\n return vSigmoid(z);", "def sigmoid(t):\n return np.exp(t)/(1+np.exp(t))", "def sigmoid(t):\n return 1 / (1 + np.exp(-t))", "def sigmoid(z):\n \n return 1 / (1 + np.exp(-z))#your code here", "def sigmoid(x):\n return 1 / (1 + math.exp(-x))", "def sigmoid(t):\n...
[ "0.78324723", "0.7620817", "0.76108587", "0.76092803", "0.7525165", "0.7516085", "0.7514245", "0.7513501", "0.75133824", "0.75059116", "0.75059116", "0.749376", "0.7464918", "0.74447083", "0.74392545", "0.74382293", "0.74382293", "0.74291277", "0.7402801", "0.7398452", "0.739...
0.0
-1
Return the CNAME (canonical name) for the given host.
def get_cname(self, host): cname = None if self.is_local(host): # Don't perform DNS lookup for localhost. cname = host else: self.log("Resolving host: " + host) try: ans = self._resolver.query(host, 'CNAME') if le...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def host_dns_name(self):\n res = self.search(base='', scope=ldb.SCOPE_BASE, attrs=['dNSHostName'])\n return str(res[0]['dNSHostName'][0])", "def gethostbycondorname(name):\n\n m = htcondor_ip_name_re.match(name)\n if m is not None:\n return m.group(1).replace('-', '.')\n else:\n return soc...
[ "0.6816097", "0.66600597", "0.66545564", "0.66010284", "0.6445976", "0.62895745", "0.62809193", "0.6279287", "0.62172496", "0.6196573", "0.61805034", "0.6177601", "0.61692774", "0.61671203", "0.61562747", "0.6141065", "0.6107723", "0.61046755", "0.60932076", "0.6082985", "0.6...
0.8620179
0
Return a list of (start, end) indexes, according to what is specified in s. It is up to the client to interpret the semantics of the ranges.
def parse_ranges(s): import re assert type(s) is type(""), "s must be string" assert not re.search(r"[\r\n]", s), "linebreaks not allowed" s = re.sub(r"\s+", "", s) # no spaces assert not re.search(r"[^0-9,-]", s), "invalid characters" ranges = [] for r in s.split(","): # Cas...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _slice_indices(self, s):\n\n if s.step is None:\n k = 1\n elif s.step == 0:\n raise ValueError(\"Slice step must be a non-zero integer.\")\n else:\n k = s.step\n\n i = self._index_normalize(s.start)\n j = self._index_normalize(s.stop)\n ...
[ "0.7368874", "0.66169167", "0.6588371", "0.63907087", "0.6381604", "0.636644", "0.631602", "0.6308611", "0.629392", "0.6273381", "0.6268601", "0.6249376", "0.62300104", "0.61884546", "0.6065533", "0.6003211", "0.5992091", "0.59684587", "0.5961834", "0.59606445", "0.5951673", ...
0.5600331
61
remove(html[, str][...]) > html Return the html with each string str removed (replaced with a blank space).
def remove(html, *args): reobj = re.compile("|".join(args), re.IGNORECASE) return reobj.sub(" ", html)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def stripHTMLTags (html):\n text = html\n \n # apply rules in given order!\n rules = [\n { r'>\\s+' : u'>'}, # remove spaces after a tag opens or closes\n { r'\\s+' : u' '}, # replace consecutive spaces\n { r'\\s*<br\\s*/?>\\s*' : u'\\n'}, # new...
[ "0.7153535", "0.71408784", "0.70857257", "0.70805275", "0.7079422", "0.6844753", "0.67021686", "0.6697875", "0.669147", "0.6687609", "0.6677942", "0.6655823", "0.66511637", "0.66471785", "0.6636097", "0.6626528", "0.66161716", "0.66073966", "0.6605001", "0.6600376", "0.660037...
0.81083566
0
remove_all_tags(html) > html Remove all tags from an HTML string.
def remove_all_tags(html): # remove all <...> reobj = re.compile(r"<[^>]*>", re.IGNORECASE|re.DOTALL) return reobj.sub(" ", html)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def remove_html_tags(text):\n import re\n clean = re.compile('<.*?>')\n return re.sub(clean, '', text)", "def remove_html_tags(text):\n import re\n clean = re.compile('<.*?>')\n return re.sub(clean, '', text)", "def remove_html_tags(self,text):\n #https://medium.com/@jorlugaqui/how-to-...
[ "0.7858917", "0.7858917", "0.7829913", "0.78219485", "0.7815287", "0.78113514", "0.78005314", "0.77978873", "0.7700117", "0.7698729", "0.76923096", "0.7691061", "0.76856667", "0.7672041", "0.7455673", "0.74443054", "0.73407227", "0.7337764", "0.7309515", "0.72639537", "0.7229...
0.9092758
0
collapse(s) > s, with runs of whitespace replaced with single spaces
def collapse(s): return ' '.join(s.split()).strip()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def compress_whitespace(cls, s):\n # Cast to string\n s = str(s).strip()\n\n # Sanity check\n if (len(s) == 0):\n return ''\n\n s = re.sub(r'\\s', ' ', s)\n s = re.sub(r' +', ' ', s)\n\n return s.strip()", "def spacify(string):\n return \" \" + \" ...
[ "0.6974289", "0.696337", "0.68700874", "0.6812064", "0.6750819", "0.6705925", "0.6705925", "0.6705925", "0.6705925", "0.6671498", "0.66438615", "0.6630951", "0.6629111", "0.66144305", "0.654648", "0.640693", "0.6328939", "0.6247228", "0.6207448", "0.6141989", "0.61185265", ...
0.86558825
0
the transfer function somatic voltage > firing rate which determines the firing intensity of the inhomogenuous poisson process, in our case a sigmoidal function (Eq. 2)
def phi(U, n): phi_params = n['phi'] return phi_params['r_max'] / (1 + np.exp(-phi_params['beta'] * (U - phi_params['alpha'])))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def sigmoid(x):\n return 1 / (1 - (power(e,-x)))", "def sigmoid(t):\n t[t >= 20] = 20\n t[t <= -20] = -20\n return np.exp(t)/(np.exp(t)+1)", "def sigmoid(t):\n return np.exp(t)/(1+np.exp(t))", "def sigmoid(x):\n\treturn 1 / (1 + m.exp(-x))", "def sigmoid(t):\n return 1 / (1 + np.exp(-t))"...
[ "0.66147673", "0.66083527", "0.6565199", "0.65524834", "0.6519066", "0.64956474", "0.648333", "0.6482464", "0.6477716", "0.6465851", "0.6446612", "0.6445882", "0.643568", "0.6400908", "0.6397027", "0.6397027", "0.6397027", "0.6397027", "0.6397027", "0.6397027", "0.6394404", ...
0.0
-1
computes the first derivative of the sigmoidal firing rate function
def phi_prime(U, n): phi_params = n['phi'] num = np.exp((U + phi_params["alpha"]) * phi_params["beta"]) * \ phi_params["r_max"] * phi_params["beta"] denom = (np.exp(U * phi_params["beta"]) + np.exp(phi_params["alpha"] * phi_params["beta"]))**2 return num / denom
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def sigmoid_derivative(x):\n return x * (1-x)", "def sigmoid_derivative(x):\r\n\r\n ### START CODE HERE ### (≈ 2 lines of code)\r\n s = 1.0 /(1 + 1/np.exp(x))\r\n ds = s*(1-s)\r\n ### END CODE HERE ###\r\n\r\n return ds", "def sigmoid_derivative(x):\n return x * (1.0 - x)", "def derivati...
[ "0.84251094", "0.83494544", "0.8340908", "0.82373846", "0.82373846", "0.81848806", "0.8173539", "0.75935006", "0.7520265", "0.7483188", "0.7400852", "0.73728925", "0.73263216", "0.7267426", "0.7204427", "0.71869236", "0.7167131", "0.7165208", "0.71245354", "0.71107477", "0.70...
0.0
-1
load requirements from a pip requirements file
def parse_requirements(filename): lineiter = (line.strip() for line in open(filename)) return [line for line in lineiter if line and not line.startswith("#")]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def read_requirements():\n reqs_path = path.join('.', 'requirements.txt')\n with open(reqs_path, 'r') as f:\n requirements = [line.rstrip() for line in f]\n return requirements", "def parse_requirements_from_pipfile():\n lineiter = (line.strip() for line in open('Pipfile'))\n requirements_p...
[ "0.7206639", "0.7191491", "0.7187297", "0.7138445", "0.7138277", "0.70911366", "0.70401156", "0.70233893", "0.70084476", "0.69288045", "0.6917543", "0.69035953", "0.69035953", "0.6900558", "0.6823832", "0.6820074", "0.6802556", "0.67198455", "0.6716624", "0.6715886", "0.66736...
0.0
-1
Convert Tensor to Numpy
def tensor2npy(x): out = x.detach().cpu().numpy().transpose(1, 2, 0) return out
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def to_numpy(tensor):\n raise NotImplementedError", "def tensor2np(x):\n return x.cpu().numpy()", "def _torch_to_numpy(tensor):\n return tensor.detach().cpu().numpy()", "def to_numpy(tensor):\n return tensor.detach().cpu().numpy() if tensor.requires_grad else tensor.cpu().numpy()", "def num...
[ "0.8548036", "0.81152195", "0.78565854", "0.77130866", "0.76051354", "0.7526764", "0.7488521", "0.74622494", "0.7323669", "0.72562754", "0.72369397", "0.7135432", "0.7123851", "0.7070265", "0.7054254", "0.70415086", "0.703413", "0.7005274", "0.70025784", "0.69977146", "0.6990...
0.7783742
3
Create single IAM profile v2 object.
def create(*args, **kwargs): factory = V2ProfileFactory() output = factory.create(export_json=True) click.echo(output)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create(profile, name):\n client = boto3client.get(\"iam\", profile)\n params = {}\n params[\"InstanceProfileName\"] = name\n return client.create_instance_profile(**params)", "def create(profile, name):\n # Make sure it doesn't exist already.\n if exists(profile, name):\n msg = \"Ins...
[ "0.76489985", "0.70479167", "0.69431937", "0.6910985", "0.68439764", "0.6792595", "0.6787274", "0.6766879", "0.6760496", "0.6733182", "0.6686861", "0.6683264", "0.6667707", "0.6575329", "0.655695", "0.6556808", "0.6556808", "0.6556808", "0.65425056", "0.64915764", "0.64851636...
0.7838268
0
set the level of the logger
def set_log_handler_level(level, name="rt1_consolehandler"): log = setup_logger() h = [val for val in log.handlers if val.name == name][0] h.setLevel(level)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def setlevel(self, lvl):\n self.logger.setLevel(lvl)", "def level(self, log_level):\n self.logger.setLevel(log_level)", "def set_level(self, level: str):\n self._logger.setLevel(getattr(logging, level))", "def set_log_level(self, level):\n if level == 'info':\n leve...
[ "0.8538155", "0.8391577", "0.83602947", "0.830342", "0.8136333", "0.8090477", "0.8084929", "0.8070407", "0.8015964", "0.79087347", "0.79015577", "0.78854465", "0.7865036", "0.78172094", "0.7808547", "0.77956814", "0.77778983", "0.7750224", "0.77479297", "0.7683901", "0.756160...
0.6602911
75
stop and remove an existing logging handler
def stop_log_to_file(name="rt1_filehandler"): log = setup_logger() handlers = groupby_unsorted(log.handlers, key=lambda x: x.name) # remove existing rt1_filehandler if name in handlers: for i, h in enumerate(handlers[name]): h.close() log.removeHandler(h) log...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def remove_handler():\n logging.getLogger('vaex').removeHandler(log_handler)\n logging.getLogger('vaex').addHandler(logging.NullHandler())", "def shut_down_logger(self):\n handlers = self.logger.handlers[:]\n for handler in handlers:\n handler.close()\n self.logger.remov...
[ "0.769051", "0.7403484", "0.73792464", "0.73711765", "0.7231137", "0.7192127", "0.7162655", "0.7045256", "0.704103", "0.6822284", "0.6775079", "0.6705096", "0.66324276", "0.66324276", "0.6588376", "0.65249515", "0.6506851", "0.6467064", "0.6457487", "0.6457487", "0.64326733",...
0.71351427
7
Returns True if the given user is the one who created the tournament. This should be used to make sure that only the tournament admin can make important changes to the tournament like adding props, closing props, and other adminsistrative duties.
def is_user_admin(self, user): return user == self.created_by
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_user_player(self, user):\n return self.user == user", "def belongs_to_user(self) -> bool:\n return flask.g.user is not None and flask.g.user.id == getattr(\n self, 'user_id', False\n )", "def has_user(self, user): # pylint: disable=unused-argument\r\n return False...
[ "0.7454721", "0.7333653", "0.73264134", "0.7271532", "0.70239675", "0.698357", "0.6918145", "0.69128066", "0.6824707", "0.67132014", "0.66926813", "0.6626887", "0.65653306", "0.65646744", "0.65263784", "0.65263784", "0.65146995", "0.65093553", "0.64664245", "0.64633304", "0.6...
0.71599746
4
Returns True if the user can join the tournament.
def can_add_player(self, user): user_profile = user.get_profile() if user_profile.credits < self.entrance_fee: return False if self.is_user_playing(user): return False return True
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def check_can_join(self, user):\n if not user.is_active or user.is_anonymous():\n return False\n\n membership = self.check_membership(user)\n\n if membership is not None and not membership.is_left():\n return False # Already joined\n\n if self.join_condition == 'A...
[ "0.75407803", "0.65974724", "0.6423619", "0.6299592", "0.629056", "0.61627233", "0.61608535", "0.61212534", "0.61212534", "0.61140984", "0.6106811", "0.60802096", "0.60224056", "0.60224056", "0.60224056", "0.6009075", "0.60019886", "0.60017484", "0.5999323", "0.5997874", "0.5...
0.5814657
37
Returns a string representation of the prop.
def __str__(self): return self.team_a + " vs " + self.team_b
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __str__(self):\n name=''\n for prop in self.properties.itervalues():\n name+=str(prop)\n return name", "def __repr__(self) -> str:\n return f\"Property(name={self.name}, property_type={self.property_type})\"", "def _prop(self):\n return [\"%s = %s\" % (str(k), ...
[ "0.7736785", "0.7546805", "0.7464594", "0.72445214", "0.72103155", "0.71811396", "0.7163005", "0.7039206", "0.7025576", "0.69980454", "0.69165593", "0.69064844", "0.6893781", "0.6875322", "0.68568015", "0.678757", "0.67648315", "0.67560834", "0.6750477", "0.6747767", "0.67350...
0.0
-1
Returns whether the proposition is open for betting.
def is_open_for_betting(self): return self.is_open
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _isopen(self):\n return self.dp.state()==PyTango.DevState.OPEN", "def is_open(self):\n return self.get_data(\"state\") == self.STATE_OPEN", "def is_won(self):\n return self.position == self.proposition.outcome and self.proposition.is_paid", "def open(self):\n\n return self._st...
[ "0.713321", "0.6985477", "0.6895413", "0.6846334", "0.66816384", "0.66669065", "0.66304326", "0.66219044", "0.65639836", "0.6540789", "0.64849776", "0.6395032", "0.6383999", "0.6312856", "0.6304879", "0.6304278", "0.6261491", "0.626078", "0.62575585", "0.6253095", "0.6239117"...
0.8493295
0
This function prints and plots the confusion matrix. Normalization can be applied by setting `normalize=True`.
def plot_confusion_matrix(cm, classes, normalize=False, title='Confusion matrix', cmap=plt.cm.Blues): plt.imshow(cm, interpolation='nearest', cmap=cmap) plt.title(title) plt.colorbar() tick_marks = np.arange(len(classes)) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def plot_confusion_matrix(cm, classes=[0,1], normalize=False, title='Confusion matrix', print_matrix=False):\n\n if normalize:\n cm = cm.astype('float') / cm.sum(axis=1)[:, np.newaxis]\n print(\"Normalized confusion matrix\")\n else:\n print('Confusion matrix, without normalization')\n\n...
[ "0.81940335", "0.8095006", "0.80290395", "0.8019189", "0.7993875", "0.7991161", "0.79809004", "0.7975263", "0.7961412", "0.7956938", "0.7937461", "0.7934524", "0.7934342", "0.7931134", "0.7926225", "0.79244965", "0.792367", "0.79231006", "0.7922885", "0.792215", "0.7917699", ...
0.7843544
50
Annotates a method or property as a GraphQL field.
def field( resolver: Optional[_RESOLVER_TYPE] = None, *, name: Optional[str] = None, is_subscription: bool = False, description: Optional[str] = None, permission_classes: Optional[List[Type[BasePermission]]] = None, federation: Optional[FederationFieldParams] = None, deprecation_reason: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def decorator(field):\n field._jeeves_label_for = field_names\n return field", "def add_field(self, field):\n self.add_field_sig(FieldSignature.from_field(field))", "def add_field(self, field):\n self.add_field_sig(FieldSignature.from_field(field))", "def field(self, field):\n\n ...
[ "0.574812", "0.5646463", "0.5646463", "0.5563031", "0.5433128", "0.5365852", "0.5336135", "0.52937496", "0.5227401", "0.5219059", "0.5213438", "0.51712334", "0.51480424", "0.5139129", "0.50287294", "0.50159055", "0.4984858", "0.49644443", "0.49612752", "0.4942885", "0.4929283...
0.5029924
14
Create a new Dataset and add features.
def setUp(self): self.dataset = get_test_dataset()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _createDatasets(self, datasetName):\r\n\r\n # Set the feature vector dtype\r\n if self.featureVectorDType == 'str':\r\n dt = h5py.special_dtype(vlen=str)\r\n else:\r\n dt = self.featureVectorDType\r\n\r\n\t\t# Initialize the datasets\r\n logger.debug('Creating ...
[ "0.7207528", "0.69448715", "0.6861516", "0.67120713", "0.6690845", "0.66580474", "0.66334987", "0.6625936", "0.6598784", "0.6598779", "0.65677094", "0.65573007", "0.65000963", "0.64832485", "0.647069", "0.6469692", "0.64545757", "0.6454397", "0.64457256", "0.64435077", "0.643...
0.0
-1
Remove and replace chars `.` and '' with '_'
def clean_table_name(table_name): path_underscore = table_name.translate(table_name.maketrans("-. ", "___")) return "_".join(filter(None, path_underscore.split("_")))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def sanitize(s):\n s = s.replace(\"_\", \"\\\\_\")\n return s", "def underscore(text):\n # return '__'+text.replace(' ','__') + '__'\n return text.replace(' ', '__')", "def descorize(s):\n return s.replace(\"_\", \" \")", "def clean(value):\r\n return re.sub('_+', '_', INVALID_CHARS.sub('_'...
[ "0.7532379", "0.72895736", "0.7241693", "0.72340506", "0.71396816", "0.7137455", "0.70473254", "0.7047209", "0.7042152", "0.7037295", "0.6999299", "0.69429725", "0.6941857", "0.69309306", "0.6924031", "0.68847656", "0.6842138", "0.6833714", "0.677698", "0.67735803", "0.677320...
0.6002922
100
Returns absolute directory path for a path.
def get_directory(path): path = os.path.expanduser(path) path = os.path.normpath(path) path = os.path.abspath(path) if not os.path.isdir(path): path = os.path.dirname(path) return path
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def abspath(path):\n if not os.path.isabs(path):\n cwd = os.getcwdu()\n path = os.path.join(cwd, path)\n return os.path.normpath(path)", "def getDirectory(path):\n\tfrom os.path import split\n\tpath = normalizePath(path)\n\treturn split(path)[0]", "def abspath(path):\n path = os.fspath(p...
[ "0.7655065", "0.749879", "0.7468637", "0.7373635", "0.7361517", "0.7353997", "0.73509705", "0.7303491", "0.72919846", "0.7269664", "0.7259744", "0.72390884", "0.7232995", "0.7218291", "0.7208864", "0.72079885", "0.7166668", "0.7112492", "0.70703435", "0.7058655", "0.70099974"...
0.7745246
0
Whether TypedDict has required keys.
def has_required(self) -> bool: return any(child.is_required() for child in self.children)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def dict_support_required(self):\n\t\treturn self.typemanager.has_dicts", "def is_typed_dict(self) -> bool:\n return True", "def has_keys(self) -> bool:\n \n for key, value in self.key_satified.items():\n if value is not True:\n return False\n return True",...
[ "0.77068025", "0.7219178", "0.714412", "0.7070686", "0.682091", "0.679452", "0.6783303", "0.67362493", "0.66741055", "0.6650233", "0.66378856", "0.662116", "0.65877026", "0.6580245", "0.65437514", "0.65371114", "0.65214443", "0.65093774", "0.6491238", "0.6474597", "0.64712495...
0.5982575
96
Whether TypedDict has both optional and required keys.
def has_both(self) -> bool: return self.has_required() and self.has_optional()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def dict_type(verifield, required):\n if verifield is None: return True\n if not isinstance(verifield, dict): return False\n all_of = [value or True for value in verifield.values() if isinstance(value, required) or value is None]\n return not verifield or (all(all_of or [False]) and len(all_of) == len(...
[ "0.76764864", "0.7497073", "0.7136481", "0.6870787", "0.6754337", "0.66725594", "0.6630047", "0.66299415", "0.65350217", "0.64515275", "0.64155775", "0.63414884", "0.62604934", "0.62559515", "0.6203189", "0.61366665", "0.61301863", "0.61299056", "0.61061436", "0.61009336", "0...
0.0
-1
Get a list of required attributes.
def get_required(self) -> list[TypedDictAttribute]: result: list[TypedDictAttribute] = [] for child in self.children: if child.is_required(): result.append(child) return result
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def hasRequiredAttributes(self):\n return _libsbml.ListOfMembers_hasRequiredAttributes(self)", "def hasRequiredAttributes(self):\n return _libsbml.Rule_hasRequiredAttributes(self)", "def required_props(props):\n return [prop_name for prop_name, prop in list(props.items())\n if prop[...
[ "0.75891113", "0.72928697", "0.724319", "0.7202559", "0.7169886", "0.7155947", "0.71491283", "0.71327496", "0.711281", "0.70973873", "0.7097367", "0.7062764", "0.7050323", "0.70131284", "0.6996463", "0.6967573", "0.696095", "0.69474167", "0.694736", "0.6869647", "0.6863659", ...
0.7796017
0
Get a list of optional attributes.
def get_optional(self) -> list[TypedDictAttribute]: result: list[TypedDictAttribute] = [] for child in self.children: if not child.is_required(): result.append(child) return result
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_attributes(cls):\r\n return []", "def get_attributes(cls):\r\n return [Attribute('file'),\r\n Attribute('missing', None)]", "def attributes(self) -> Optional[Mapping[str, Sequence[str]]]:\n return pulumi.get(self, \"attributes\")", "def attributes(self):\n a...
[ "0.7025676", "0.7025596", "0.69547063", "0.68331593", "0.68327326", "0.67491186", "0.67369694", "0.6729335", "0.6722412", "0.6722412", "0.6604701", "0.65996295", "0.6471347", "0.64504373", "0.6427477", "0.6388449", "0.63437617", "0.6343551", "0.63435245", "0.63422036", "0.632...
0.7247622
0
Check whether typed dict attributes are the same as `other`.
def is_same(self: _R, other: _R) -> bool: children = [i.render() for i in self.children] other_children = [i.render() for i in other.children] return other_children == children
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __eq__(self, other: 'Attribute') -> bool:\n if not isinstance(other, self.__class__):\n return False\n return self.__dict__ == other.__dict__", "def __eq__(self, other):\n if not isinstance(other, Attribute):\n return False\n\n return self.__dict__ == other._...
[ "0.75492984", "0.7393966", "0.73797673", "0.7312696", "0.71647304", "0.71326345", "0.71028036", "0.7094131", "0.708983", "0.70731777", "0.7050669", "0.7049489", "0.7044833", "0.7040868", "0.7019343", "0.7010896", "0.6989458", "0.69508874", "0.69456595", "0.69456595", "0.69447...
0.0
-1
Gets the user the lib is logged into.
async def get_self(self): if not ".ROBLOSECURITY" in self.request.cookies: raise NotAuthenticated("You must be authenticated to preform that action.") r = await self.request.request(url="https://www.roblox.com/my/profile", method="GET") data = r.json() return User(self.reques...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_logged_user():\n return get_from_session(KEY_USER)", "def get_logged_in_user(self):\n return self.session_mgr.get_logged_in_user()", "def get_current_user(self):\n return self.get_secure_cookie(\"user\")", "def get_current_user():\n request = get_current_request()\n return geta...
[ "0.8537205", "0.84123963", "0.81256795", "0.8100328", "0.8018552", "0.7997887", "0.79732174", "0.7966477", "0.78802824", "0.78559303", "0.78559303", "0.7824729", "0.77734524", "0.776813", "0.776813", "0.7753331", "0.774584", "0.7716376", "0.77106285", "0.77035785", "0.7675680...
0.0
-1
Gets a user using there username.
async def get_user_by_username(self, roblox_name: str) -> User: r = await self.request.request(url=f'https://api.roblox.com/users/get-by-username?username={roblox_name}', method="GET", noerror=True) json = r.json() if r.status_code != 200 or not json.get('Id') or not json.get('Username'): ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_user(self, username):\n\t\treturn self.users.get(username, None)", "def get_user(username):\n if custom_user_model:\n return get_user_model().objects.get_by_natural_key(username)\n else:\n return get_user_model().objects.get(username=username)", "def get_user(self, username):\n ...
[ "0.8520232", "0.8367787", "0.828487", "0.8280068", "0.8258801", "0.8160241", "0.8119154", "0.8105807", "0.8092793", "0.80217266", "0.79678017", "0.7955021", "0.786685", "0.78651845", "0.7856132", "0.78344315", "0.7833374", "0.7819375", "0.7818826", "0.7785045", "0.7764334", ...
0.7649657
24
Gets a user using there id.
async def get_user_by_id(self, roblox_id: int) -> User: r = await self.request.request(url=f'https://api.roblox.com/users/{roblox_id}', method="GET", noerror=True) json = r.json() if r.status_code != 200 or not json.get('Id') or not json.get('Username'): return None return Us...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_user_by_id(self, id):\n\t\treturn self.users.get(id)", "def get_user(id):\n pass", "def getUser(self, id : int) -> bbUser.bbUser:\n id = self.validateID(id)\n return self.users[id]", "def get(id):\n return User.query.filter_by(id=id).first()", "def get(self, id):\n\t\ttry:\n...
[ "0.8779876", "0.861515", "0.85779595", "0.8460382", "0.83757836", "0.82971644", "0.8271446", "0.8259049", "0.8244511", "0.8231814", "0.8221275", "0.8214295", "0.82141656", "0.82120275", "0.81672096", "0.81672096", "0.81672096", "0.81672096", "0.810748", "0.80944675", "0.80797...
0.8065184
22
Checks if the member is mentioned in the specified message.
def mentioned_in(self, message: Message) -> bool: if message.guild is None or message.guild.id != self.guild.id: return False if self._user.mentioned_in(message): return True return any(self._roles.has(role.id) for role in message.role_mentions)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def msg_found(self, msg, message):\n if msg in message:\n return True\n else:\n return False", "def mentioned(self, message: \"Message\") -> bool:\n raise NotImplementedError", "def contains_message(response, message):\n if len(response.context['messages']) != 1:\n...
[ "0.75145584", "0.72712505", "0.6967901", "0.6503796", "0.64504045", "0.62307453", "0.62024975", "0.61837035", "0.61702824", "0.614706", "0.6127961", "0.6124354", "0.6121136", "0.60934854", "0.6055906", "0.6042371", "0.6032818", "0.60295266", "0.5942797", "0.59364605", "0.5933...
0.7539923
0
|coro| Moves a member to a new voice channel (they must be connected first).
async def move_to(self, channel: Optional[VocalGuildChannel], *, reason: Optional[str] = None) -> None: await self.edit(voice_channel=channel, reason=reason)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async def move(self, ctx, *, channel):\n author = ctx.message.author\n current_channel = author.voice.channel\n voice_channels = ctx.guild.voice_channels\n members = current_channel.members\n for member in members:\n user = ctx.guild.get_member(member.id)\n ...
[ "0.74285895", "0.7317015", "0.72448987", "0.72005737", "0.71484435", "0.70480585", "0.7045712", "0.6980326", "0.6979525", "0.69726545", "0.69642913", "0.6906303", "0.6882215", "0.6820473", "0.6804063", "0.67232", "0.66677713", "0.66589797", "0.66205126", "0.6576343", "0.65603...
0.56634116
55
Returns 1 x^2 y^2 z^2 (1 )^n sqrt(tau+a)(tau+b)(tau+c)) tau+a tau+b tau+c
def _FracInt(x,y,z,a,b,c,tau,n): denom = np.sqrt((a + tau)*(b + tau)*(c + tau)) return (1. - x**2/(a + tau) - y**2/(b + tau) - z**2/(c + tau))**n / denom
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def tinker(self, sigma, z):\n \n aa = self.params[0]\n a = self.params[1]\n b = self.params[2]\n c = self.params[3]\n \n aa_z = aa * pow((1.e0+z), -0.14e0)\n a_z = a * pow((1.e0+z), -0.06e0)\n alpha = exp(-(pow(0.75e0/(log(200.e0/0.75e0)), 1.2e0)))\n b_z = b * pow((1.e0+z), -alpha)\n\n ...
[ "0.6663529", "0.64751434", "0.6386746", "0.63594264", "0.62556195", "0.6225488", "0.6225051", "0.6142588", "0.6119807", "0.6110339", "0.6102494", "0.61014444", "0.60399044", "0.6029397", "0.6019443", "0.60044444", "0.5965163", "0.5932008", "0.59149694", "0.59070635", "0.59006...
0.61174273
9
Constructs a ResNet10 model.
def resnet10(shortcut_type, num_classes, in_channels): model = ResNet(BasicBlock, [1, 1, 1, 1], shortcut_type, num_classes, in_channels) return model
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def resnet10(**kwargs):\n model = ResNet(BasicBlock, [1, 1, 1, 1], **kwargs)\n return model", "def _init_model(self):\r\n\r\n self.model = ResNet152V2(weights='imagenet')", "def modified_resnet10(self) -> torch.nn.Module:\n # initialize a Resnet-10 instance\n net = torchvision.models...
[ "0.7767007", "0.68262696", "0.6614998", "0.6586515", "0.6565403", "0.6510924", "0.6491994", "0.6428231", "0.6421525", "0.63803595", "0.6368321", "0.63668334", "0.6345308", "0.62552905", "0.62499124", "0.6238115", "0.62285364", "0.6226786", "0.6226014", "0.62232673", "0.621917...
0.7152067
1
Constructs a ResNet50 model.
def resnet50(shortcut_type, num_classes, in_channels): model = ResNet(Bottleneck, [3, 4, 6, 3], shortcut_type, num_classes, in_channels) return model
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def resnet50(pretrained=False, **kwargs):\n model = ResNet(Bottleneck, [3, 4, 6, 3], **kwargs)\n if pretrained:\n model.load_state_dict(model_zoo.load_url(model_urls['resnet50']))\n fc = transfer_fc(model.fc)\n model.fc = fc\n return model", "def resnet50(**kwargs):\n model = ResNet(...
[ "0.7557751", "0.75548905", "0.74759895", "0.74759895", "0.74759895", "0.74759895", "0.74557495", "0.7386862", "0.7386862", "0.73601955", "0.7355623", "0.724254", "0.724254", "0.7191571", "0.7158499", "0.7101107", "0.70165247", "0.69687796", "0.68687624", "0.6822836", "0.68010...
0.64078504
33
Constructs a ResNet10 model.
def resnet10_2D(num_classes, in_channels, ngf, last_sigmoid=False): model = ResNet2D(BasicBlock2D, [1, 1, 1, 1], num_classes, in_channels, ngf=ngf, last_sigmoid=last_sigmoid) return model
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def resnet10(**kwargs):\n model = ResNet(BasicBlock, [1, 1, 1, 1], **kwargs)\n return model", "def resnet10(shortcut_type, num_classes, in_channels):\n model = ResNet(BasicBlock, [1, 1, 1, 1], shortcut_type, num_classes, in_channels)\n return model", "def _init_model(self):\r\n\r\n self.mode...
[ "0.7767007", "0.7152067", "0.68262696", "0.6614998", "0.6586515", "0.6565403", "0.6510924", "0.6491994", "0.6428231", "0.6421525", "0.63803595", "0.6368321", "0.63668334", "0.6345308", "0.62552905", "0.62499124", "0.6238115", "0.62285364", "0.6226786", "0.6226014", "0.6223267...
0.5930688
80
One Hot Encode sequential input data for Action Detector.
def ohe_sequence(sequence, batch_size, seq_size, dict_size): bow_vec = np.zeros((batch_size, seq_size, dict_size), dtype=np.float32) for flow_num in range(batch_size): for action_num in range(seq_size): bow_vec[flow_num, action_num, sequence[flow_num][action_num]] = 1 return bow_vec
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _one_hot_encoder(self):\n ohe = preprocessing.OneHotEncoder()\n ohe.fit(self.dataframe[self.cat_feats])\n return ohe.transform(self.dataframe_d_copy[self.cat_feats])", "def one_hot_encoding(data):\r\n encoder = LabelEncoder()\r\n y = encoder.fit_transform(data)\r\n return(y)", ...
[ "0.70690954", "0.6903321", "0.686782", "0.68664306", "0.68626237", "0.673841", "0.6728612", "0.67247313", "0.6681477", "0.66458976", "0.6629581", "0.66090983", "0.6537137", "0.65211254", "0.65211254", "0.6517244", "0.6481515", "0.6463384", "0.64632004", "0.6449857", "0.642995...
0.0
-1
Constructs a PYACS Sinex instance from a P. Rebishung sinex instance
def from_sinex(cls, snx): ############################################################################### import pyacs.lib.astrotime from pyacs.sol.gpoint import Gpoint name = snx.file # estimate estimates = {} for r in snx.param: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_instance(c_instance):\n return MonoPedal(c_instance)", "def __init__(self, x, y, U, KEx=1, KEy=1, periodic_x=False, periodic_y=False, qx=0, qy=0, sparse_args=None,\n solve=True):\n self.x = x\n self.y = y\n self.U = U\n self.KEx = KEx\n self.KEy = ...
[ "0.5567487", "0.5518417", "0.5506833", "0.5439745", "0.5400459", "0.5314974", "0.52732784", "0.5234276", "0.52147347", "0.52147347", "0.52030903", "0.51847786", "0.5177762", "0.5123259", "0.5101349", "0.5080445", "0.50765896", "0.50699407", "0.5069854", "0.50684726", "0.50678...
0.7040052
0
Convert angle, unit vector pair (u is an iterable of x,y,z coords) to the corresponding rotation matrix.
def ev2mat(angle, u): l = math.sqrt(sum(map(lambda x: x**2, u))) u = list(map(lambda x: x/l, u)) k = np.array([[0, -u[2], u[1]], [u[2], 0, -u[0]], [-u[1], u[0], 0]]) k2 = np.dot(k, k) return np.identity(3) + math.sin(angle)*k + (1-math.cos(angle))*k2
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def angle_to_rotation_matrix(angle: torch.Tensor) -> torch.Tensor:\n ang_rad = deg2rad(angle)\n cos_a: torch.Tensor = torch.cos(ang_rad)\n sin_a: torch.Tensor = torch.sin(ang_rad)\n return torch.stack([cos_a, sin_a, -sin_a, cos_a], dim=-1).view(*angle.shape, 2, 2)", "def rotation_matrices_from_basis(...
[ "0.6807834", "0.6786632", "0.67772293", "0.6643915", "0.6643915", "0.6625383", "0.6601769", "0.6587891", "0.6547888", "0.65218616", "0.6516532", "0.65013105", "0.6419081", "0.6419081", "0.64056903", "0.64006215", "0.6388965", "0.63875026", "0.6387081", "0.63781905", "0.637282...
0.7103151
0
infix to postfix return as string.
def infix_to_postfix(infix:str) -> str: stack = deque() precedence = {'+':1, '-':1, '*':2, '/':2, '^':3, '(':-9 } output = "" for ch in infix: if ch not in {'+', '-', '*', '/', '^', '(', ')'}: output += ch elif ch == '(': ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def infix_to_postfix(self, expr: str) -> str:\n\n # The stack that we will be performing operations on\n stack: list[str] = []\n\n # The output\n output: str = \"\"\n\n # We always need surrounding parentheses\n expr = f\"({expr})\"\n\n # The tokenized expression\n ...
[ "0.76630485", "0.7573849", "0.75544673", "0.7495712", "0.74203503", "0.7419506", "0.7370929", "0.7369504", "0.72787434", "0.7257566", "0.72367686", "0.7225065", "0.7192678", "0.71387345", "0.70984614", "0.70968986", "0.70661294", "0.70245075", "0.6985763", "0.6962185", "0.694...
0.7602149
1
Tests whether ``parse_emoji`` works as intended.
def test__parse_emoji(): unicode_emoji = BUILTIN_EMOJIS['heart'] custom_emoji = Emoji.precreate(202305240006, name = 'Yukari') for input_data, expected_output in ( ({}, None), ({'emoji_name': None}, None), ({'emoji_name': unicode_emoji.unicode}, unicode_emoji), ({'emoji_...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_unicode_emoji(self):\n ...", "def is_custom_emoji(self):\n ...", "def test__parse_emoji__0():\n emoji_0 = BUILTIN_EMOJIS['x']\n emoji_1 = Emoji.precreate(202301010089, name = 'replica', animated = True)\n \n for input_value, expected_output in (\n (emoji_0.as_emoji, ...
[ "0.7469878", "0.7404741", "0.7385004", "0.6876694", "0.67725235", "0.67324543", "0.670896", "0.6565174", "0.64670384", "0.64018255", "0.635087", "0.6317866", "0.62293684", "0.6143516", "0.6028149", "0.6009839", "0.59378755", "0.5812487", "0.5782979", "0.56489134", "0.56366384...
0.78111887
0
Attempts to connect to the API and returns the encountered exception if not successful. If successful, returns `None`.
async def api_healthcheck(self) -> Optional[Exception]: try: await self._client.get("/health") return None except Exception as exc: return exc
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _try_connect(self):\n tuya = TuyaApi()\n try:\n tuya.init(\n self._username,\n self._password,\n self._country_code,\n self._platform,\n self._region,\n )\n except (TuyaAPIRateLimitException, T...
[ "0.7162162", "0.68685716", "0.68685716", "0.65050596", "0.6258712", "0.6107018", "0.6082739", "0.6038881", "0.59861463", "0.5881146", "0.583623", "0.5797388", "0.5786875", "0.5781273", "0.57419646", "0.57419646", "0.57172084", "0.5710312", "0.5705693", "0.5636744", "0.5632344...
0.600302
8
Create a tag concurrency limit in the Prefect API. These limits govern concurrently running tasks.
async def create_concurrency_limit( self, tag: str, concurrency_limit: int, ) -> UUID: concurrency_limit_create = ConcurrencyLimitCreate( tag=tag, concurrency_limit=concurrency_limit, ) response = await self._client.post( "/concurr...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def concurrent_tasks_limit(self):\n return self._concurrent_tasks_limit", "def createLimit(name, maxValue):\n return Limit(Cuebot.getStub('limit').Create(\n limit_pb2.LimitCreateRequest(name=name, max_value=maxValue), timeout=Cuebot.Timeout))", "def create_capacity_limiter(total_tokens: float)...
[ "0.6232334", "0.618272", "0.612369", "0.58665043", "0.5830021", "0.5826138", "0.558125", "0.5576764", "0.5507391", "0.54917455", "0.5479163", "0.5457086", "0.5319002", "0.52855396", "0.52708614", "0.5227085", "0.5219337", "0.52051264", "0.51742685", "0.51737857", "0.5162307",...
0.78655
0
Read the concurrency limit set on a specific tag.
async def read_concurrency_limit_by_tag( self, tag: str, ): try: response = await self._client.get( f"/concurrency_limits/tag/{tag}", ) except httpx.HTTPStatusError as e: if e.response.status_code == status.HTTP_404_NOT_FOUND: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async def read_concurrency_limits(\n self,\n limit: int,\n offset: int,\n ):\n\n body = {\n \"limit\": limit,\n \"offset\": offset,\n }\n\n response = await self._client.post(\"/concurrency_limits/filter\", json=body)\n return pydantic.parse...
[ "0.6840449", "0.6489943", "0.58449507", "0.57489157", "0.55690175", "0.53915924", "0.5388463", "0.529019", "0.5271145", "0.5263678", "0.5256704", "0.5176394", "0.5168776", "0.51676905", "0.5167265", "0.51522887", "0.5133509", "0.51195866", "0.51146615", "0.51146615", "0.50031...
0.85085845
0
Query the Prefect API for flow run notification policies. Only policies matching all criteria will be returned.
async def read_flow_run_notification_policies( self, flow_run_notification_policy_filter: FlowRunNotificationPolicyFilter, limit: Optional[int] = None, offset: int = 0, ) -> List[FlowRunNotificationPolicy]: body = { "flow_run_notification_policy_filter": ( ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _get_policies(self):\n flag, response = self._commcell_object._cvpysdk_object.make_request('GET', self._POLICY)\n\n if flag:\n if response.json() and 'taskDetail' in response.json():\n policies = response.json()['taskDetail']\n policies_dict = {}\n\n ...
[ "0.6362547", "0.62490875", "0.608653", "0.60465646", "0.59870994", "0.597366", "0.5963949", "0.58383083", "0.5834509", "0.5807091", "0.57846785", "0.57453364", "0.57015765", "0.56555855", "0.56485665", "0.5584599", "0.5525753", "0.5506811", "0.54594916", "0.5434705", "0.54311...
0.6441154
0
Retrieves queues for a work pool.
async def read_work_queues( self, work_pool_name: Optional[str] = None, work_queue_filter: Optional[WorkQueueFilter] = None, limit: Optional[int] = None, offset: Optional[int] = None, ) -> List[WorkQueue]: json = { "work_queues": ( work_que...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_queue_list(self):\n return self.manager.get_queue_list()", "def _get_queues(self):\n return self.__queues", "def _get_queues(self):\n return self.__queues", "def _get_queues(self):\n return self.__queues", "def _get_queues(self):\n return self.__queues", "def _get_queues(self):...
[ "0.75498915", "0.7482353", "0.7482353", "0.7482353", "0.7482353", "0.7482353", "0.7482353", "0.7482353", "0.7482353", "0.7482353", "0.74284166", "0.71747553", "0.7036755", "0.69970787", "0.6897057", "0.68086815", "0.67630076", "0.66307336", "0.6575834", "0.65531063", "0.65372...
0.68205285
15
Query the Prefect API for artifacts. Only artifacts matching all criteria will be returned.
async def read_artifacts( self, *, artifact_filter: ArtifactFilter = None, flow_run_filter: FlowRunFilter = None, task_run_filter: TaskRunFilter = None, sort: ArtifactSort = None, limit: int = None, offset: int = 0, ) -> List[Artifact]: body = ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def ListArtifacts(context=None):\n args = artifact_pb2.ApiListArtifactsArgs()\n\n items = context.SendIteratorRequest(\"ListArtifacts\", args)\n return utils.MapItemsIterator(\n lambda data: Artifact(data=data, context=context), items)", "def GetArtifacts(self, parameters):#This function will probably ne...
[ "0.66140264", "0.6613372", "0.659943", "0.61881626", "0.61800694", "0.60487574", "0.5992452", "0.5890933", "0.5883272", "0.5855176", "0.5753132", "0.56811106", "0.5560874", "0.54682827", "0.5441428", "0.54303944", "0.541044", "0.53890365", "0.53162175", "0.5311189", "0.528836...
0.55962485
12
Query the Prefect API for artifacts. Only artifacts matching all criteria will be returned.
async def read_latest_artifacts( self, *, artifact_filter: ArtifactCollectionFilter = None, flow_run_filter: FlowRunFilter = None, task_run_filter: TaskRunFilter = None, sort: ArtifactCollectionSort = None, limit: int = None, offset: int = 0, ) -> List...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def GetArtifacts(self, parameters):#This function will probably need to not do a result.json() if used... See Swagger\n # [GET] https://assets.falcon.crowdstrike.com/support/api/swagger.html#/falconx-sandbox/GetArtifacts\n FULL_URL = self.base_url+'/falconx/entities/artifacts/v1'\n HEADERS = c...
[ "0.661321", "0.66115046", "0.659934", "0.6188045", "0.6178173", "0.6049284", "0.59923095", "0.5889802", "0.5882602", "0.5854952", "0.575213", "0.568042", "0.55973446", "0.55628407", "0.5467422", "0.5441304", "0.543141", "0.54091674", "0.5387674", "0.53108025", "0.5290379", ...
0.5317366
19
Return the bold balise for color
def bold(self, color=None): ## Get balise if color != None: exec("balise = self.%s"%(color)) else: balise = "" ## Return bold color return self.BOLD + balise
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def bold(text):\n return '\\x1b[1;30m'+text+'\\x1b[0m' if text else '\\x1b[1;30m'+'\\x1b[0m'", "def bold(color):\n return tuple(_gamut(i * 2) for i in color)", "def bold(val: str):\n return colored(val, attrs=[\"bold\"])", "def bold(msg):\n return '\\033[1m%s\\033[0m' % msg", "def colored_text(...
[ "0.7805359", "0.7699036", "0.7632544", "0.7368062", "0.72365725", "0.71357626", "0.7104211", "0.6919972", "0.6888188", "0.68685246", "0.6761043", "0.6727002", "0.66978234", "0.6688123", "0.66621387", "0.66519564", "0.6546841", "0.65115654", "0.6457488", "0.6424497", "0.635107...
0.82376593
0
Get a variable from the git config file under the meta section
def config(self,item): config = GitConfigParser(environ['HOME']+"/.gitconfig") return config.get_value('meta', item)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def git_config(section, prop):\n pipe = Popen('git config %s.%s' % (section, prop), stdout=PIPE, shell=True)\n value = pipe.stdout.read().strip()\n if not value:\n raise ConfigAttributeError(section, prop)\n return value", "def meta():\n\n meta_version = lain_yaml(ignore_prepare=True).repo_meta_version...
[ "0.6822791", "0.63711226", "0.6262046", "0.6224376", "0.62160224", "0.6178164", "0.61696017", "0.6152546", "0.6152517", "0.61065865", "0.6097433", "0.6057891", "0.60434985", "0.6040398", "0.5996073", "0.59926915", "0.5983943", "0.59713775", "0.59711355", "0.59610677", "0.5951...
0.7731113
0
Returns the number of items in this queue.
def size(self): return self._N
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def size(self):\n return len(self._queue_items)", "def size(self):\n return len(self.__queue)", "def size(self):\n return len(self.queue)", "def size(self):\n return len(self.queue)", "def size(self):\n return len(self.queue)", "def size(self):\n return len(self....
[ "0.8667191", "0.83457345", "0.83320737", "0.83320737", "0.83320737", "0.83320737", "0.8306759", "0.82867163", "0.82867163", "0.80965966", "0.8010518", "0.80020136", "0.7999472", "0.79692554", "0.79523426", "0.79224926", "0.791557", "0.7897099", "0.7897099", "0.78098017", "0.7...
0.0
-1
Returns the item least recently added to this queue without removing it.
def peek(self): if self.isEmpty(): raise Exception("Queue underflow") return self._q[self._first]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def top(self): # O(1)\n if not self.queue:\n return None\n return self.queue[0]", "def top(self):\n return self.queue[0]", "def top(self):\n while not self.queue[self.tag].empty():\n temp = self.queue[self.tag].get()\n self.queu...
[ "0.789593", "0.7622173", "0.7471462", "0.74594915", "0.74254453", "0.7369603", "0.73552144", "0.73393995", "0.73353493", "0.7328831", "0.7328831", "0.7313511", "0.7313188", "0.7279993", "0.72556865", "0.7232177", "0.72168845", "0.7200341", "0.7180923", "0.7170056", "0.7164369...
0.70355225
29
Get a recommendation rule for an app. Get a recommendation rule for an app.
def get_rule_details_by_web_app( self, resource_group_name, site_name, name, update_seen=None, recommendation_id=None, custom_headers=None, raw=False, **operation_config): # Construct URL url = self.get_rule_details_by_web_app.metadata['url'] path_format_arguments = { 're...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getRule(self, *args):\n return _libsbml.Model_getRule(self, *args)", "def _get_rule(self, rule):\n for kbrule in self.rules:\n if rule == kbrule:\n return kbrule", "def _get_rule(self, rule):\n for kbrule in self.rules:\n if rule == kbrule:\n ...
[ "0.5947381", "0.58138865", "0.58138865", "0.58138865", "0.5602067", "0.55248034", "0.5519532", "0.54488564", "0.53920716", "0.5355413", "0.5314541", "0.5314541", "0.5314541", "0.5314541", "0.5314541", "0.5314541", "0.5314541", "0.53103226", "0.52185434", "0.52185434", "0.5218...
0.5481591
7
Given the training set and the indices of the labeled examples, return the indices of the unlabeled examples.
def get_unlabeled_idx(X_train, labeled_idx): return np.arange(X_train.shape[0])[np.logical_not(np.in1d(np.arange(X_train.shape[0]), labeled_idx))]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def labeled_indices(self):\n return self._labeled_indices", "def get_valid_indices(labels):\n idxs = (labels != invalid_labels[0])\n for l in invalid_labels[1:]:\n idxs = idxs & (labels != l)\n return idxs", "def inverse_transform_labels(self, indices):\n classes = self.classes_()...
[ "0.7193299", "0.70588857", "0.64156514", "0.63408804", "0.6234203", "0.62057215", "0.6166789", "0.61297077", "0.6120993", "0.60725325", "0.6032952", "0.59824014", "0.5970313", "0.5907578", "0.5872385", "0.5811533", "0.578538", "0.5759698", "0.5692951", "0.56539196", "0.561296...
0.79656047
0
Gets the version of the Portal Sharing API.
def get_version(self): r = self._create_operation_request(self, method="GET") root_info = send_session_request(self._session, r).json() return root_info["currentVersion"]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_version(self):\n return self.http_call(\"get\", url=f\"{self.base_url}/version\").json()", "def get_api_version(self):\n return self.connector.request('GET', '/app/webapiVersion')", "def GetVersion(self):\n return self._SendRequest(HTTP_GET, \"/version\", None, None)", "def get_versi...
[ "0.7095497", "0.70011467", "0.6988176", "0.68718106", "0.6773199", "0.67061347", "0.66724724", "0.6638439", "0.66367525", "0.64868253", "0.6426701", "0.64226055", "0.6415821", "0.6396657", "0.6395664", "0.6363036", "0.6344768", "0.63355726", "0.6333652", "0.63315797", "0.6326...
0.6469597
10
Returns the minimum comoving distance over which this tracer's radial kernel is defined, if it exists. For tracers with more than one contribution with an associated ``chi_min``, the lowest value is returned.
def chi_min(self): chis = [tr.chi_min for tr in self._trc] return min(chis) if chis else None
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_min_distance(self):\n return round(min(self.combined_euclidian_distance))", "def potential_min(self):\n\n return self._args.min", "def find_smallest(self):\n # add max value to covered rows and columns to ignore the covered cells\n maxval = self.C.max()\n C = self.C +...
[ "0.685987", "0.67053163", "0.6424497", "0.64055485", "0.63446844", "0.63044727", "0.63041127", "0.6191632", "0.6191632", "0.61619824", "0.61383766", "0.6135534", "0.60790473", "0.60230774", "0.60078716", "0.59868747", "0.5936763", "0.59001803", "0.5892908", "0.58747417", "0.5...
0.7310656
0
Returns the maximum comoving distance over which this tracer's radial kernel is defined, if it exists. For tracers with more than one contribution with an associated ``chi_max``, the highest value is returned.
def chi_max(self): chis = [tr.chi_max for tr in self._trc] return max(chis) if chis else None
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def potential_max(self):\n\n return self._args.max", "def __find_max_distance(self):\n return utils.find_max_distance(self.__game)", "def RISCC_max_confirmed_distance(self, max_distance=MAX_POSITION_DISTANCE):\n distances = []\n if self.RISCC_N_confirming_seqs(max_distance) + self.R...
[ "0.6583284", "0.6476502", "0.63089454", "0.6224928", "0.6206195", "0.61757606", "0.60314244", "0.60187525", "0.6006056", "0.5882565", "0.582979", "0.582465", "0.5820831", "0.5820416", "0.581736", "0.58001983", "0.5781446", "0.575247", "0.57196707", "0.571847", "0.57165927", ...
0.73344547
0
Constructor for tracers associated with a radial kernel of the form
def from_z_power(cls, cosmo, *, A, alpha, z_min=0., z_max=6., n_chi=1024): # noqa if z_min >= z_max: raise ValueError("z_min should be smaller than z_max.") tracer = cls() chi_min = cosmo.comoving_radial_distance(1./(1+z_min)) chi_max = cosmo.comoving_radial_distance(1./(1+...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self,r):\n self.radius = r\n self.uc_centered_a = r\n self.uc_centered_b = r*np.sqrt(3.0)", "def __init__(self, kernel_parameter: Union[int, float] = 1, nu=1.5):\n super().__init__(kernel_parameter)\n self.nu = nu", "def __init__(self, radius, length, power, pnnl...
[ "0.5877359", "0.5804194", "0.5770126", "0.572718", "0.572718", "0.57127327", "0.56895405", "0.5655531", "0.56536144", "0.5638094", "0.55963707", "0.55963707", "0.55701625", "0.55603254", "0.555079", "0.5548605", "0.55400735", "0.55019474", "0.5501051", "0.549028", "0.5467696"...
0.0
-1
Get the redshift distribution for this tracer.
def get_dndz(self, z): return self._dndz(z)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def distribution(self) -> str:\n return pulumi.get(self, \"distribution\")", "def get_distribution(self):\n return self._delegate.flush_distributions()", "def dist_by_rating(self):\n return ratings_distribution", "def distmod(self):\n if self._distmod is not None:\n ...
[ "0.6284422", "0.5967945", "0.5629136", "0.5524779", "0.54795116", "0.5423491", "0.52266", "0.52263993", "0.52263993", "0.5222327", "0.51845026", "0.5174904", "0.51580817", "0.5121033", "0.51191604", "0.5118895", "0.51091003", "0.5070924", "0.5048483", "0.5046697", "0.5028575"...
0.0
-1
Create an Nbin discrete colormap from the specified input map
def discrete_cmap(N, base_cmap=None): # Note that if base_cmap is a string or None, you can simply do # return plt.cm.get_cmap(base_cmap, N) # The following works for string, None, or a colormap instance: base = plt.cm.get_cmap(base_cmap) color_list = base(np.linspace(0, 1, N)) cmap_name = ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def discrete_cmap(N, base_cmap=None):\n base = plt.get_cmap(base_cmap)\n color_list = base(np.linspace(0, 1, N))\n cmap_name = base.name + str(N)\n return base.from_list(cmap_name, color_list, N)", "def discrete_cmap(N, base_cmap=None):\n # see https://gist.github.com/jakevdp/91077b0cae40f8f8244a\...
[ "0.7245269", "0.7168229", "0.69042087", "0.688099", "0.688099", "0.688099", "0.6864576", "0.68572843", "0.6851441", "0.67325586", "0.665973", "0.65992707", "0.65943605", "0.65881246", "0.65845996", "0.6507875", "0.6440995", "0.64069706", "0.6328573", "0.63173294", "0.6285455"...
0.6864597
8
Asks user to specify a city, month, and day to analyze.
def get_filters(): print('Hello! Let\'s explore some US bikeshare data!\n') #get user input for city (chicago, new york city, washington). HINT: Use a while loop to handle invalid inputs while True: try: city = input('Which city do you want to explore? chicago, new york, washington\n') ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def Raw_Data(city,month,day):\n print(\"The city you have entered is: \",city)\n print(\"The month you have entered is: \",month)\n print(\"The day you have entered is: \",day)", "def get_filters():\n city = None\n month = None\n day = None\n while day == None:\n # TO DO: get user input f...
[ "0.6672178", "0.65358925", "0.64600855", "0.6373334", "0.63493216", "0.6310637", "0.62873024", "0.6259576", "0.6230648", "0.6212208", "0.6205637", "0.6182021", "0.61714137", "0.6169872", "0.6159728", "0.61591697", "0.61540914", "0.6145264", "0.61325365", "0.61055607", "0.6103...
0.0
-1
Loads data for the specified city and filters by month and day if applicable.
def load_data(city, month, day): df = pd.read_csv(CITY_DATA[city]) #Converting time df['Start Time'] = pd.to_datetime(df['Start Time']) df['month'] = df['Start Time'].dt.month df['day_of_week'] = df['Start Time'].dt.weekday_name if month != 'all': month = MONTHS.index(month) + 1...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def load_data(city, month, day):\n df = pd.read_csv(CITY_DATA [city])\n \n # convert the Start Time column to datetime\n df['Start Time'] = pd.to_datetime(df['Start Time'])\n \n # extract month and day of week from Start Time to create new columns\n df['month'] = df['Start Time'].dt.month\n ...
[ "0.81320685", "0.8108889", "0.8045821", "0.8042514", "0.80090284", "0.80071104", "0.79991937", "0.7998333", "0.7988789", "0.797905", "0.79737365", "0.79610896", "0.7956163", "0.7947432", "0.79463065", "0.7908229", "0.7904569", "0.7900715", "0.78930074", "0.7889219", "0.788254...
0.7908287
15
Displays statistics on the most frequent times of travel.
def time_stats(df): print('\nCalculating The Most Frequent Times of Travel...\n') start_time = time.time() #display the most common month print('\nCalculating The Most Common Month to Travel...\n') common_month = df['month'].mode()[0] print('Most Common Month : {} Counts {}'.format(MONTHS...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def time_stats(df):\n\n print('\\nDisplaying the statistics on the most frequent times of '\n 'travel...\\n')\n start_time = time.time()\n\n # display the most common month\n most_common_month = df['Month'].mode()[0]\n print('For the selected filter, the month with the most travels is: ' +\...
[ "0.80247396", "0.80233026", "0.7915788", "0.78266186", "0.7822246", "0.78143597", "0.77659196", "0.7740343", "0.773628", "0.77344066", "0.76867086", "0.7668633", "0.7651731", "0.7644636", "0.76399267", "0.76367253", "0.7625196", "0.7623158", "0.7612803", "0.76002145", "0.7583...
0.73053837
58
Displays statistics on the most popular stations and trip.
def station_stats(df): print('\nCalculating The Most Popular Stations and Trip...\n') start_time = time.time() # TO DO: display most commonly used start station print('\nCalculating The Most Common Start Station to Travel...\n') common_start_station = df['Start Station'].mode()[0] print('M...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def station_stats(df):\n\n print('\\nCalculating The Most Popular Stations and Trip...\\n')\n start_time = time.time()\n\n # display most commonly used start station\n print(popular_start_station(df))\n\n # display most commonly used end station\n print(popular_end_station(df))\n\n # display m...
[ "0.7816376", "0.7662779", "0.7554007", "0.749191", "0.7475349", "0.7446666", "0.7431475", "0.7424602", "0.74180853", "0.74006534", "0.7387897", "0.73860437", "0.73657554", "0.7359602", "0.73570734", "0.7355466", "0.7352646", "0.7351677", "0.7350823", "0.73425794", "0.7341161"...
0.68844926
88
Displays statistics on the total and average trip duration.
def trip_duration_stats(df): print('\nCalculating Trip Duration...\n') start_time = time.time() #display total travel time print('\nCalculating The Total Travel Time...\n') total_duration = df['Trip Duration'].sum() total_days = total_duration /86400 total_hours = (total_duration/3600)%2...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def trip_duration_stats(data):\n print('\\nCalculating Trip Duration...\\n')\n start_time = time.time()\n # display total travel time\n total_trip_time= data['Trip Duration'].sum()\n print('The Total Travel Time is {} Hours'. format(total_trip_time/3600))\n # display mean travel time\n avg_tri...
[ "0.814274", "0.8025143", "0.80041367", "0.79496753", "0.7937415", "0.79312176", "0.7926815", "0.7915187", "0.79142886", "0.7908032", "0.79055744", "0.7900715", "0.7891682", "0.78894734", "0.7886722", "0.78851086", "0.7884266", "0.7882474", "0.78738385", "0.78686154", "0.78664...
0.0
-1
Loads a single image as a Numpy array and resizes it as desired. The default dimensions are consistent with those expected by the VGG models.
def load_image(image_path, dim=(224,224), channels=1): if channels == 1: image = cv2.imread(image_path, 0) else: image = cv2.imread(image_path, 1) image = cv2.resize(image, dim) #, interpolation = cv2.INTER_AREA return image
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def load_image(self, image_id):\n info = self.image_info[image_id]\n image_name = str(info['id']).zfill(6) + \"_10.png\"\n image = imageio.imread(\"./training/image_2/\" + image_name)\n image = cv2.resize(image, (self.width, self.height))\n if(image.shape[0] != self.height or ima...
[ "0.66326016", "0.6501599", "0.6339261", "0.6307436", "0.62996525", "0.6290514", "0.626625", "0.6220241", "0.61937165", "0.6191745", "0.6189404", "0.6182646", "0.6115669", "0.6104812", "0.6097814", "0.6076916", "0.60684294", "0.6057474", "0.6041241", "0.60310566", "0.5981227",...
0.55134296
80
Returns the mean squared haversine distance between arrays consisting of lattitudes and longitudes.
def haversine_loss(y_true, y_pred, denorm=(36.0, 4.0, -78.0, 4.0), R=3443.92): # Break inputs into lattitudes and longitudes for # convienience # Convert normalized lat and long into actuals lat_min, lat_range, long_min, long_range = denorm lat1 = y_true[:,0] * lat_range + lat_min lat2 = y_pr...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def meanHaversineDistance(lat_sub, lon_sub, lat_real, lon_real):\n return np.mean(HaversineDistance(lat_sub, lon_sub, lat_real, lon_real))", "def haversine_array(lon1, lat1, lon2, lat2):\n R = 6371.0 # radius of the earth in km\n\n lon1, lat1, lon2, lat2 = map(np.radians, [lon1, lat1, lon2, lat2])\n\n ...
[ "0.7071225", "0.6791072", "0.64981836", "0.6484345", "0.6483873", "0.6459155", "0.6451573", "0.64488745", "0.6431909", "0.63237107", "0.62464964", "0.6242091", "0.6141481", "0.6109003", "0.60848296", "0.6078064", "0.6062472", "0.60611945", "0.60374045", "0.6031964", "0.600466...
0.56446135
86
Convert a numpy.uint8 array into a string
def to_ascii(a): return str( a.tostring(), "UTF-8", errors='ignore' )
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def bit_array_to_string(array: Iterable) -> str:\n\n res = ''.join(\n [chr(int(y, 2)) for y in [''.join([str(x) for x in _bytes])\n for _bytes in Des.n_split(array, 8)]])\n return res", "def bit_array_to_string(array):\n result_string = ''.join(\n ...
[ "0.7582652", "0.7437961", "0.7185533", "0.70377785", "0.6882204", "0.6824309", "0.679452", "0.64508575", "0.63603663", "0.6344999", "0.63311327", "0.63206315", "0.6235426", "0.6228211", "0.61548597", "0.6139974", "0.61379766", "0.61123765", "0.6109314", "0.60669464", "0.60478...
0.0
-1
Convert a numpy.uint8 array into a string
def from_ascii(s): return numpy.array( [ ord(c) for c in s ], dtype=numpy.uint8 )
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def bit_array_to_string(array: Iterable) -> str:\n\n res = ''.join(\n [chr(int(y, 2)) for y in [''.join([str(x) for x in _bytes])\n for _bytes in Des.n_split(array, 8)]])\n return res", "def bit_array_to_string(array):\n result_string = ''.join(\n ...
[ "0.75842243", "0.7439501", "0.718564", "0.7037066", "0.68830633", "0.6824024", "0.67949414", "0.645187", "0.6361117", "0.6344544", "0.63315535", "0.63221234", "0.6234851", "0.6230118", "0.6156231", "0.61400497", "0.6138597", "0.61126256", "0.61096233", "0.6066255", "0.6046197...
0.0
-1
Return all columns that contain at least one string in the list of col_matches or all columns in cols list
def collect_cols(cols, col_matches, data_file): col_list = [] if cols is not None: if not isinstance(cols, list): raise TypeError("cols in collect_cols must be a list.") col_list = cols else: # Make list of column/feature names; exlcude error columns all_cols = li...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_matching_columns(self, columns):\n result = []\n for column in columns:\n if self.match(column):\n result.append(column)\n return result", "def __column_intersect(df, list_):\n return set(list_).intersection(set(df.columns.tolist()))", "def checkcolumns...
[ "0.7344555", "0.65525734", "0.65233374", "0.63708085", "0.6254224", "0.61764115", "0.6104417", "0.6092598", "0.5913084", "0.59106773", "0.5894381", "0.5798369", "0.57912594", "0.5763575", "0.5729407", "0.5716649", "0.56898123", "0.56626046", "0.5655126", "0.5617148", "0.55605...
0.66020375
1
Tests retrieving a list of ingredients.
def test_retrieve_ingredients(self): Ingredient.objects.create(user=self.user, name='Egg') Ingredient.objects.create(user=self.user, name='Salt') # Retrieve the ingredients belonging to user. response = self.client.get(URL_INGREDIENTS) # Retrieve ingredients from the database....
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_retrieve_ingredient_list(self):\n # sample ingredients\n Ingredient.objects.create(user=self.user, name='Potato')\n Ingredient.objects.create(user=self.user, name='Salt')\n\n response = self.client.get(INGREDIENTS_URL)\n\n ingredients = Ingredient.objects.all().order_by(...
[ "0.8424342", "0.83811915", "0.83359", "0.8259297", "0.80921954", "0.7973478", "0.79390174", "0.7601129", "0.7580292", "0.733944", "0.73162824", "0.73044705", "0.72229034", "0.7203588", "0.7192358", "0.7187585", "0.7133864", "0.71286523", "0.71098155", "0.7104828", "0.70963687...
0.8160612
4
Tests filtering ingredients by those assigned to recipes.
def test_retrieve_ingredients_assigned_to_recipes(self): # Create two tags, assign one of them to a recipe # while leaving the other one unassigned. ingredient1 = Ingredient.objects.create(user=self.user, name='Apple') ingredient2 = Ingredient.objects.create(user=self.user, name='Turkey...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_filter_recipes_by_ingredients(self):\n recipe1 = sample_recipe(self.user, title='Waxy box')\n recipe2 = sample_recipe(self.user, title='Waxy noodle beans')\n ingredient1 = sample_ingredient(self.user, name='box')\n ingredient2 = sample_ingredient(self.user, name='Wet noodle')\n...
[ "0.8435211", "0.8352018", "0.83492976", "0.824599", "0.8203963", "0.8200276", "0.80160546", "0.7759972", "0.7651485", "0.76378864", "0.7312401", "0.7175532", "0.7162861", "0.715368", "0.71257734", "0.70687664", "0.7032087", "0.7032013", "0.7003277", "0.6955003", "0.69470847",...
0.67669165
30
Tests filtering ingredients by assigned returns unique items.
def test_retrieve_ingredients_assigned_unique(self): ingredient = Ingredient.objects.create(user=self.user, name='Eggs') Ingredient.objects.create(user=self.user, name='Parmaggiano Cheese') recipe1 = Recipe.objects.create( title='Eggs Benedict', time_minutes=30, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_filtered_ingredients_unique(self):\n ing = Ingredient.objects.create(user=self.user, name='Eggs')\n Ingredient.objects.create(user=self.user, name='Lentils')\n recipe1 = Recipe.objects.create(\n title='Eggs Benedict',\n time_minutes=60,\n price=Decimal...
[ "0.82202876", "0.7652453", "0.76478827", "0.73668814", "0.73472726", "0.71881527", "0.6921477", "0.69028836", "0.6891823", "0.68829525", "0.6852682", "0.6781052", "0.67478716", "0.67347515", "0.6706835", "0.666653", "0.66594046", "0.656936", "0.65353274", "0.6449917", "0.6346...
0.74214464
3
The set of arguments for constructing a RateLimiting resource.
def __init__(__self__, *, authorize: pulumi.Input[str], login: pulumi.Input[str], communications_enabled: Optional[pulumi.Input[bool]] = None): pulumi.set(__self__, "authorize", authorize) pulumi.set(__self__, "login", login) if communications_e...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(__self__,\n resource_name: str,\n args: RateLimitingArgs,\n opts: Optional[pulumi.ResourceOptions] = None):\n ...", "def __init__(__self__,\n resource_name: str,\n opts: Optional[pulumi.ResourceOptions] = None,\n ...
[ "0.82046235", "0.65878874", "0.6541145", "0.65360254", "0.6518958", "0.6456201", "0.6442276", "0.63800454", "0.63700354", "0.6224684", "0.6177337", "0.61684674", "0.61195314", "0.61135733", "0.6087296", "0.60805005", "0.6068277", "0.60640574", "0.60581803", "0.6040193", "0.60...
0.0
-1
Get an existing RateLimiting resource's state with the given name, id, and optional extra properties used to qualify the lookup.
def get(resource_name: str, id: pulumi.Input[str], opts: Optional[pulumi.ResourceOptions] = None, authorize: Optional[pulumi.Input[str]] = None, communications_enabled: Optional[pulumi.Input[bool]] = None, login: Optional[pulumi.Input[str]] = None) -> 'RateLim...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get(resource_name: str,\n id: pulumi.Input[str],\n opts: Optional[pulumi.ResourceOptions] = None,\n custom_block_response_body: Optional[pulumi.Input[str]] = None,\n custom_block_response_status_code: Optional[pulumi.Input[int]] = None,\n custom_rules: Opt...
[ "0.6098223", "0.57649696", "0.5733246", "0.5511721", "0.5462739", "0.54429704", "0.53971404", "0.538348", "0.53790027", "0.53785926", "0.5371297", "0.5369553", "0.5369401", "0.5363439", "0.53533053", "0.5351313", "0.5350457", "0.5346995", "0.5335884", "0.5335439", "0.5332012"...
0.72437
0
Compute entropy on the string
def entropy(string): p, lns = Counter(string), float(len(string)) return -sum(count/lns * math.log(count/lns, 2) for count in p.values())
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def entropy(self, text):\n\n# text = self.myReplacer.replace(text)\n# text = self.tokenizer.tokenize(text)\n new_text = []\n for word in text:\n if word.count('\\'') > 0:\n words = word.split('\\'')\n for w in words:\n new_text...
[ "0.805246", "0.7864786", "0.77960837", "0.7709579", "0.7494554", "0.7468513", "0.7343411", "0.7225747", "0.7225747", "0.7156437", "0.7109428", "0.70703775", "0.7060242", "0.69873464", "0.693977", "0.68936217", "0.68575627", "0.68421316", "0.68298066", "0.68190074", "0.6779091...
0.8619641
0
Return image data from a raw PGM file as numpy array.
def read_pgm(filename, byteorder='>'): with open(filename, 'rb') as f: buffer = f.read() try: header, width, height, maxval = re.search( b"(^P5\s(?:\s*#.*[\r\n])*" b"(\d+)\s(?:\s*#.*[\r\n])*" b"(\d+)\s(?:\s*#.*[\r\n])*" b"(\d+)\s(?:\s*#.*[\r\n]\s)*...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def read_pgm(filename, byteorder='>'):\r\n with open(filename, 'rb') as f:\r\n buffer = f.read()\r\n try:\r\n header, width, height, maxval = re.search(\r\n b\"(^P5\\s(?:\\s*#.*[\\r\\n])*\"\r\n b\"(\\d+)\\s(?:\\s*#.*[\\r\\n])*\"\r\n b\"(\\d+)\\s(?:\\s*#.*[\\r\\n...
[ "0.7748824", "0.77299756", "0.7727519", "0.7712526", "0.74380463", "0.693373", "0.67342716", "0.6438904", "0.643014", "0.6368058", "0.6235226", "0.6227864", "0.62165743", "0.62102395", "0.6148964", "0.614161", "0.61345595", "0.61345595", "0.6133193", "0.61088204", "0.60848856...
0.754521
4
Returns a dictionary of ingame heroes, used to parse ids into localised names
def get_heroes(self, **kwargs): url = self.__build_url(urls.GET_HEROES, language=self.language, **kwargs) req = self.executor(url) if self.logger: self.logger.info('URL: {0}'.format(url)) if not self.__check_http_err(req.status_code): return response.build(req, ur...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_names(self):\n\n names = dict()\n for game in self.games:\n with open(os.path.join(self.data, game, \"demon_names.json\"), \"r\") as f:\n names[game] = json.load(f)\n return names", "def get_hero_name(self, i):\n for hero in self.heroes:\n ...
[ "0.6236875", "0.61732227", "0.6124863", "0.5988167", "0.5789089", "0.57843417", "0.57354295", "0.56683624", "0.56335765", "0.55551165", "0.54191506", "0.54107994", "0.5341419", "0.52805734", "0.5275863", "0.52728146", "0.52486086", "0.5150206", "0.5138794", "0.51016736", "0.5...
0.0
-1