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 |
|---|---|---|---|---|---|---|
Get Company Details Retrieve Company details as specified by company.pk. Middleware See SETTINGS for active Middleware. Decorators request.method must be POST request.is_ajax() must be True request.user.is_authenticated() must be True | def get(request, company_id):
try:
company = Company.objects.get(pk=company_id)
if not (request.user.company_id == int(company_id) or request.user.is_admin == True):
raise Exception("Fobiden: requesting user doesn't have permission to specified Company.")
return format_ajax_res... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_contacts(request, company_id):\n try:\n company = Company.objects.get(pk=company_id)\n\n if not (request.user.company_id == int(company_id) or request.user.is_admin == True):\n raise Exception(\"Fobiden: requesting user doesn't have permission to specified Company.\")\n\n ... | [
"0.6472101",
"0.6458227",
"0.63715136",
"0.62051415",
"0.6121976",
"0.61095303",
"0.6072107",
"0.5906681",
"0.58258545",
"0.58154255",
"0.57842207",
"0.57787067",
"0.57527775",
"0.5749963",
"0.5716147",
"0.5715119",
"0.5683333",
"0.56442165",
"0.56063",
"0.5605094",
"0.558990... | 0.6798655 | 0 |
Cut raw/untreated text into sentences | def cut_text_raw(self,p):
undesirable_chars=['?','http','www','@']
if (not True in [i in p for i in undesirable_chars]) and (len(self.remove_non_alpha(p))>=100) and (len(self.remove_non_alpha(p).split())>=7):
self.parser_raw.append(re.sub(' +', ' ', p))
return None | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def extract_sentences_from_text(self, text_data):\n pass",
"def split(text):\n doc = nlp(text)\n sentences = [x.text_with_ws for x in doc.sents]\n return sentences",
"def get_sentences(text):\n \n return text.split('.')",
"def parse_text(self, text):\r\n MAXLEN = 100\... | [
"0.72918415",
"0.7239849",
"0.72275776",
"0.7221401",
"0.7090515",
"0.70563084",
"0.7010927",
"0.6996374",
"0.69914514",
"0.6917327",
"0.6863096",
"0.6860393",
"0.6810187",
"0.6802875",
"0.67777795",
"0.6769783",
"0.6739027",
"0.67186797",
"0.6715184",
"0.6714714",
"0.6670719... | 0.0 | -1 |
Helper function for _sqlalchemy_head_pandas. MetaData that is used by pd.read_sql_table cannot work on a temp table with pandas < 1.4.0. If it fails, we try to get the data using read_sql instead(). | def _sqlalchemy_head_pandas_less_than14(
selectable: sa.sql.selectable.Selectable,
execution_engine: SqlAlchemyExecutionEngine,
metric_value_kwargs: dict,
n_rows: int,
) -> pd.DataFrame:
stmt = sa.select("*").select_from(selectable)
fetch_all = metric_value_kwargs["fe... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _read_metadata(self, conn, tbl_name): \n # Split table name in libname and actual table name\n name, schema = tuple(tbl_name.split('.'))\n # Query the Vertica dictionary to get types and formats\n query = \"\"\"\n SELECT column_name as NAME, data_type as TYPE, data_typ... | [
"0.69113576",
"0.6673402",
"0.61742604",
"0.5950591",
"0.5889882",
"0.5859881",
"0.58435726",
"0.5828671",
"0.5785025",
"0.5729416",
"0.57142603",
"0.57083625",
"0.56786096",
"0.5669301",
"0.564038",
"0.5630667",
"0.5605177",
"0.5597092",
"0.5589849",
"0.5579843",
"0.55647147... | 0.6056809 | 3 |
Determines the minimum sampling size for detecting column type. | def _get_sample_size(self, df_series):
len_df = len(df_series)
if len_df <= self._min_sample_size:
return int(len_df)
return max(int(self._sampling_ratio * len_df), self._min_sample_size) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _min_col_samples_used(self):\n return min([col.sample_size for col in self._profile], default=0)",
"def minimum_size(self):\n # TODO: Allow `Source` to understand when this returns None?\n return 3.",
"def _min_sampled_from_batch(self):\n return min([col._last_batch_size for col... | [
"0.74104",
"0.66937983",
"0.6606417",
"0.6326651",
"0.6304324",
"0.6202108",
"0.618548",
"0.6168693",
"0.61232555",
"0.6111823",
"0.61049545",
"0.60159904",
"0.5889781",
"0.58824676",
"0.58625174",
"0.5817938",
"0.5798276",
"0.57752866",
"0.5723526",
"0.5711418",
"0.57087785"... | 0.5811894 | 16 |
Profiler type specific checks to ensure two profiles can be added together. | def _add_error_checks(self, other):
raise NotImplementedError() | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def checkProfileEquality(self, profile1, profile2):\n if len(profile1) != len(profile2) or len(profile1[0]) != len(profile2[0]):\n return False\n for gram1 in profile1:\n contains = False\n for gram2 in profile2:\n if gram1 == gram2:\n ... | [
"0.6656498",
"0.6642737",
"0.664148",
"0.6609635",
"0.64207286",
"0.6354362",
"0.61685836",
"0.6095683",
"0.5939507",
"0.5809915",
"0.57287544",
"0.57161385",
"0.5682982",
"0.5618921",
"0.55628663",
"0.5452614",
"0.54100657",
"0.53874177",
"0.5367221",
"0.5367211",
"0.5354104... | 0.0 | -1 |
Determines the minimum sampling size for profiling the dataset. | def _get_sample_size(self, data):
if self._samples_per_update:
return self._samples_per_update
len_data = len(data)
if len_data <= self._min_sample_size:
return int(len_data)
return max(int(self._sampling_ratio * len_data), self._min_sample_size) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _min_sampled_from_batch(self):\n return min([col._last_batch_size for col in self._profile], default=0)",
"def minimum_samples(cls):\n return DEFAULT_MINIMUM_SAMPLE_COUNT",
"def graph_data_size_min(self) -> int:\n return int(self.graph_tuple_stats.graph_data_size_min or 0)",
"def minimum... | [
"0.78626704",
"0.7719135",
"0.7546743",
"0.7514383",
"0.7280522",
"0.71674645",
"0.6989423",
"0.6910904",
"0.67547816",
"0.67214346",
"0.6669322",
"0.6647937",
"0.6573493",
"0.6509399",
"0.6432551",
"0.6399228",
"0.6369545",
"0.6333601",
"0.6327938",
"0.6295367",
"0.6257536",... | 0.7042845 | 6 |
Update the profile for data provided. User can specify the sample size to profile the data with. Additionally, the user can specify the minimum number of nonnull samples to profile. | def update_profile(self, data, sample_size=None, min_true_samples=None):
encoding = None
file_type = None
if min_true_samples is not None \
and not isinstance(min_true_samples, int):
raise ValueError('`min_true_samples` must be an integer or `None`.')
if isi... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _update_profile_from_chunk(self, data, sample_size,\n min_true_samples=None):\n raise NotImplementedError()",
"def _update_profile_from_chunk(self, data, sample_size,\n min_true_samples=None):\n\n if isinstance(data, pd.DataFra... | [
"0.7644867",
"0.70104134",
"0.69110256",
"0.6688802",
"0.6359749",
"0.6350097",
"0.6291065",
"0.62499136",
"0.60969275",
"0.59624434",
"0.5898665",
"0.5791329",
"0.573878",
"0.56589913",
"0.56242186",
"0.5503593",
"0.54629844",
"0.53960574",
"0.5392725",
"0.539259",
"0.538879... | 0.7959158 | 0 |
Obtains the necessary dependent properties of the data (mean/stddev) for calculating correlation. By default, it will compute it on all columns in the profiler, but if a batch is given, it will compute it only for the columns in the batch. | def _get_correlation_dependent_properties(self, batch=None):
dependent_properties = {
'mean': np.full(len(self._profile), np.nan),
'std': np.full(len(self._profile), np.nan),
'count': np.full(len(self._profile), np.nan)
}
for id in range(len(self._profile)):
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _get_correlation(self, clean_samples, batch_properties):\n columns = self.options.correlation.columns\n clean_column_ids = []\n if columns is None:\n for idx in range(len(self._profile)):\n data_type = self._profile[idx].\\\n profiles[\"data_typ... | [
"0.6543829",
"0.58071977",
"0.5765004",
"0.5603006",
"0.551769",
"0.55142343",
"0.54706013",
"0.53798467",
"0.533148",
"0.53247535",
"0.5292666",
"0.52890366",
"0.52753836",
"0.52690125",
"0.5263794",
"0.52482486",
"0.5229271",
"0.5226609",
"0.5206253",
"0.51780534",
"0.51248... | 0.73599654 | 0 |
Read appid, appsecret, and redirecturl from environmental variables. Returns (appid, appsecret, redirecturl) or None if error. | def readappkeys():
appid = os.environ.get('APPID')
appsecret = os.environ.get('APPSECRET')
redirecturi = os.environ.get('REDIRECTURI')
return(appid, appsecret, redirecturi) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def app_env():\n cred = tk.config_from_environment()\n if any(i is None for i in cred):\n skip_or_fail(KeyError, \"No application credentials!\")\n\n return cred",
"def read_environment(self):\n # Setup credentials\n if os.getenv(\"DO_API_TOKEN\"):\n self.api_token = os.g... | [
"0.63460076",
"0.58910257",
"0.5842346",
"0.5721869",
"0.5652995",
"0.5646803",
"0.560213",
"0.55571395",
"0.55218273",
"0.54677224",
"0.5446364",
"0.5434131",
"0.5432622",
"0.5430791",
"0.5372942",
"0.53725934",
"0.53678125",
"0.53613985",
"0.5312967",
"0.530705",
"0.5304469... | 0.7499686 | 0 |
this is an imporvised way to clear stdin implied \n termination of input | def clear_in():
c = sys.stdin.read(1)
while(c!='\n'):
c = sys.stdin.read(1) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def emptyline(self):\n self.handle_async_input(\"\")",
"def clean(self):\n self._prompt.read()",
"def _replace_stdin(self, text):\n orig = sys.stdin\n sys.stdin = StringIO(text)\n yield\n sys.stdin = orig",
"def clear_input_buffer(ser):\n sys.stderr.write(\"\\n\")... | [
"0.6879322",
"0.68665296",
"0.66856897",
"0.6423752",
"0.6327638",
"0.62975913",
"0.62819856",
"0.6259778",
"0.6248719",
"0.6216768",
"0.62135494",
"0.61535877",
"0.6148009",
"0.61072683",
"0.60890156",
"0.60730284",
"0.60414994",
"0.5943371",
"0.5939904",
"0.5906058",
"0.582... | 0.8788584 | 0 |
Returns the value to which the specified key is mapped, or 1 if this map contains no mapping for the key | def get(self, key):
ha = self.myhash(key)
if key not in self.hashmap[ha][0]:
return -1
else:
return self.hashmap[ha][1][self.hashmap[ha][0].index(key)] | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get(self, key: int) -> int:\n if key not in self.map:\n return -1\n return self.map[key]",
"def get(self, key: int) -> int:\n if key in self.hashmap.keys():return self.hashmap[key]\n else:return -1",
"def get(self, key: int) -> int:\n sh = key % 37\n if ... | [
"0.8003855",
"0.7909785",
"0.7629588",
"0.75557077",
"0.75292987",
"0.752584",
"0.74930453",
"0.7373835",
"0.72940224",
"0.7293404",
"0.722199",
"0.7216566",
"0.71810514",
"0.71771294",
"0.7161406",
"0.6980998",
"0.6927306",
"0.6784852",
"0.67564756",
"0.673313",
"0.66121215"... | 0.7564755 | 3 |
Heroes are objects for summarizing and doing operations on hero state data in a dota 2 match replay. | def __init__(self, name='', data=[]):
self.name = name
self._update_(data) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __init__(self) -> None:\n self.heroes: List[Hero] = []",
"def view_all_heroes(self):\n for hero in self.heroes:\n print(hero.name)",
"async def update_heroes(self):\n heroes = self.steam_api.get_heroes()\n\n with open(\"Dota/heroes.json\", 'w') as f:\n json... | [
"0.6786174",
"0.668766",
"0.65227",
"0.6400006",
"0.6071208",
"0.6064834",
"0.60216314",
"0.60138863",
"0.5999855",
"0.5999792",
"0.59933555",
"0.5959685",
"0.5853519",
"0.57365745",
"0.5695503",
"0.5676037",
"0.5636991",
"0.55454654",
"0.55387646",
"0.54743445",
"0.5425541",... | 0.0 | -1 |
Updates self with new data. Should not be run directly. Instead create a new Hero. | def _update_(self, data):
# imports
from intervals import Interval, LinkedIntervalSet
# create a LinkedIntervalSet to store the time-based states for this
# hero
states = [Interval(dict((HER_KWD_MAP.get(k, k), d[1][k]) for k in d[1]), d[0]) for d in data]
self.... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _update_(self, data):\n self.heroes = dict((hero, Hero(hero, data[hero])) for hero in data)",
"def add_hero(self, Hero):\n self.heroes.append(Hero)",
"async def update_heroes(self):\n heroes = self.steam_api.get_heroes()\n\n with open(\"Dota/heroes.json\", 'w') as f:\n ... | [
"0.70824665",
"0.68813235",
"0.6779755",
"0.6738753",
"0.64364856",
"0.6137261",
"0.5678662",
"0.552045",
"0.5062934",
"0.49958265",
"0.4916811",
"0.49019733",
"0.48467857",
"0.4837711",
"0.48127484",
"0.47286293",
"0.47006518",
"0.4694779",
"0.4679115",
"0.46473065",
"0.4639... | 0.0 | -1 |
Creates a new Replays from a list of Replay objects and associated times. Assumes that replays, when orderd by time, form the bounds of their neighbors. | def from_replays(replays):
sortedReplays = sorted(replays, key=lambda r: r[0])
intervals = [Interval(replays[i][1], replays[i][0], replays[i+1][0]) for i in xrange(len(replays)-1)]
intervals.append(Interval(replays[-1][1], replays[-1][0]))
return Replays(intervals) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __init__(self, noPlayers, noLaps):\n\t\tself.noPlayers = noPlayers\n\t\tself.noLaps = noLaps\n\t\tself.players = []\n\t\tself.laps = dict()\n\t\tfor pNo in range(0, noPlayers-1):\n\t\t\tplayer = Player()\n\t\t\tself.players.append(player)\n\t\t\tself.laps[id(player)] = 0",
"def __init__(self, players=None):\... | [
"0.55274963",
"0.5183369",
"0.51816726",
"0.5082968",
"0.50238746",
"0.49924326",
"0.49093726",
"0.48299545",
"0.4764783",
"0.47645402",
"0.4760217",
"0.47454637",
"0.4729661",
"0.4728966",
"0.4701701",
"0.46965262",
"0.4687181",
"0.46763533",
"0.46707588",
"0.4653027",
"0.46... | 0.7556579 | 0 |
Converts the continuous action vector to a set of binary actions. | def map_state_to_actions(self, state: types.StateSpace, **override_args: Any) \
-> types.ActionProcess:
z_star = self.max_weight_policy(state)
actions = self.mpc_policy.obtain_actions(z_star=z_star, num_mpc_steps=1)
return actions | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def singletonActions(self,vector):\n resources = self.world.getValue(stateKey(self.name,self.resourceName),vector)\n return [ActionSet([Action({'subject': self.name,\n 'verb': self.verbName,\n 'object': target,\n ... | [
"0.62727326",
"0.59814316",
"0.5794064",
"0.56937844",
"0.5649121",
"0.5603299",
"0.557508",
"0.5543767",
"0.5532787",
"0.5530783",
"0.5515701",
"0.5491204",
"0.54902756",
"0.5451192",
"0.5435388",
"0.54257137",
"0.5405129",
"0.5398439",
"0.53936917",
"0.5366872",
"0.5352832"... | 0.0 | -1 |
Returns true if this term is a concept type term. | def is_concept_type(self):
return 'general concept' == self._concept_type | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def isNodeType(self, t):\n return isinstance(self, t)",
"def is_type(self, type_name):\n\n return type_name in self._symtab",
"def is_typespace(schema_obj):\n\n return isinstance(schema_obj, schema.Typespace)",
"def is_type(self, typ):\n return typ == self.__class__.__name__",
"def is_valid_t... | [
"0.63202304",
"0.62854767",
"0.62846947",
"0.62147",
"0.60967153",
"0.60003895",
"0.5937966",
"0.5882429",
"0.58378375",
"0.5810849",
"0.57914466",
"0.5771077",
"0.5744802",
"0.57084507",
"0.5685316",
"0.5661164",
"0.5639873",
"0.5596815",
"0.55878305",
"0.558563",
"0.557785"... | 0.7766356 | 0 |
Returns true if this term is a verb concept type. | def is_verb_concept(self):
return self._concept_type is not None and self._concept_type.find('verb') != -1 | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def is_verb(tag_string):\n result = True if tag_string in POS.POS_tags.verb_tags else False\n return result",
"def __isVerb__(self, word):\n self.verbs = ('go', 'stop', 'kill', 'eat')\n for verb in self.verbs:\n if verb == word:\n return ('verb', word), True\n ... | [
"0.68637556",
"0.6685841",
"0.64029986",
"0.63204163",
"0.6224308",
"0.5863588",
"0.58120996",
"0.5789542",
"0.56542397",
"0.5651814",
"0.56352395",
"0.55353075",
"0.5351473",
"0.5259479",
"0.52053064",
"0.51695687",
"0.5165745",
"0.5161813",
"0.5134475",
"0.51242185",
"0.507... | 0.8665575 | 0 |
Compute the correlation coefficient between our ranking of meaning classes by stability against three other published rankings. | def compute_ranking_correls(ranked_means):
ranked_means = [w.split(":")[-1].lower() for (r,w) in ranked_means]
ranked_means = [w[:-4] if w.endswith(" (v)") else w for w in ranked_means]
correlations = []
starostin = load_starostin_ranking()
starostin = [s for s in starostin if s in ranked_means]
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def compute_correlation_separability_score(self) -> float:\n sep_scores = pd.DataFrame.from_dict(self.separability_scores).to_numpy()\n sep_scores = minmax_scale(sep_scores)\n corrs = {}\n for tumor_pair in range(sep_scores.shape[1]):\n corr_sep_score = np.corrcoef(PATHO_PRIO... | [
"0.6417425",
"0.63066024",
"0.60983026",
"0.6029664",
"0.59808564",
"0.59426844",
"0.58619016",
"0.58186805",
"0.58000666",
"0.5777069",
"0.5773545",
"0.57674664",
"0.5765",
"0.5739846",
"0.5713514",
"0.5706043",
"0.56996334",
"0.56965256",
"0.56709963",
"0.56552345",
"0.5640... | 0.59032565 | 6 |
Get the softmax probabilities to all possible clusters. | def all_clusters_prob(self, embeddings: np.ndarray, use_softmax: bool = False) -> Tuple[List[str], np.ndarray]:
assert self._centroids != {} # Centroids must be set in advance
# Setup known database
cluster_ids, cluster_embs = zip(*sorted(self._centroids.items(), key=lambda x: x[0] if ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def softmax(self):\n return self.feats",
"def class_probability(self, x):\n # permutation before softmax b x a x c x spatial dims --> b x c x a x spatial dims\n # as expected by PyTorch Softmax the class axis = 1 \n return self._class_prob(x.permute([0, 2, 1, 3, 4]))",
"def softmax... | [
"0.65676475",
"0.6480111",
"0.62179625",
"0.6160386",
"0.6113759",
"0.61060214",
"0.61060214",
"0.61060214",
"0.61060214",
"0.603956",
"0.6009748",
"0.59942895",
"0.5994138",
"0.598116",
"0.596167",
"0.5945065",
"0.59115404",
"0.5910554",
"0.58920425",
"0.5843125",
"0.5822612... | 0.58938867 | 18 |
Get the clusterID of the given item. | def get_cluster_id(self, item: str) -> str:
assert item in self._clusters.keys()
return self._clusters[item] | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def cluster_id(self) -> str:\n return pulumi.get(self, \"cluster_id\")",
"def cluster_id(self) -> str:\n return pulumi.get(self, \"cluster_id\")",
"def cluster_id(self) -> str:\n return pulumi.get(self, \"cluster_id\")",
"def cluster_id(self) -> str:\n return pulumi.get(self, \"cl... | [
"0.7100083",
"0.7100083",
"0.7100083",
"0.7100083",
"0.7100083",
"0.68882734",
"0.6861125",
"0.6861125",
"0.6856141",
"0.68117636",
"0.68117636",
"0.68117636",
"0.67667615",
"0.67667615",
"0.67667615",
"0.67667615",
"0.6545693",
"0.65015024",
"0.63151765",
"0.6012407",
"0.599... | 0.9124539 | 0 |
Indicates whether or not the data channel guarantees inorder delivery of messages. | def ordered(self) -> bool:
return self.__parameters.ordered | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def noqueue(self) -> bool:\n return not self.orders",
"def check_sync(self):\r\n if not self.awaiting_sync:\r\n return True\r\n self.check_ack_queue()\r\n return not self.awaiting_sync",
"def ack_required(self):\n v = self[22]\n v = v >> 1\n return (v... | [
"0.607541",
"0.5688595",
"0.56803644",
"0.56745297",
"0.5671963",
"0.5648089",
"0.55850124",
"0.554729",
"0.54872376",
"0.54669565",
"0.5459107",
"0.5423768",
"0.54061925",
"0.5402116",
"0.5393828",
"0.53597593",
"0.5348221",
"0.53384775",
"0.5338179",
"0.53333884",
"0.532947... | 0.5278228 | 26 |
Contrastperpixel measure, normalized. Calculated as the average difference in greylevel between adjacent pixels. Slightly modified from [1] to support 3D images and so that the result is normalized based on the size of the neighborhood (8 for 2D images and 26 for 3D images). Additionally, differences are not taken with... | def contrast_per_pixel(im):
from numpy import abs # pylint: disable=redefined-builtin
from .util import get_diff_slices
im = im.astype(float, copy=False)
tmp = empty(im.shape)
total = 0
for slc_pos, slc_neg in get_diff_slices(im.ndim):
tmp_x = tmp[slc_neg]
abs(subtract(im[slc_pos... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def estimate_contrast(self):\n\n if self.avg_standard_lum == 0:\n self.estimate_brightness()\n\n intensity = self._get_intensity()\n\n self.avg_contrast = math.sqrt(\n (np.sum(intensity ** 2) / (self.img_height * self.img_width)) - (self.avg_standard_lum ** 2))",
"def i... | [
"0.6340341",
"0.6195896",
"0.6017329",
"0.5995515",
"0.59881955",
"0.58637714",
"0.5741216",
"0.5740604",
"0.5716379",
"0.56499153",
"0.563204",
"0.5622675",
"0.56179935",
"0.56179935",
"0.5608106",
"0.55802524",
"0.55648077",
"0.55565935",
"0.5547483",
"0.5498917",
"0.548044... | 0.74430794 | 0 |
Performs contrast enhancement by degrading an image with degrade_image then performing histogram equalization to restore the original histogram and hopefully the original image. The restored image and the number of failures (or None if not available) is returned. Other metrics, such as PSNR or SSIM, can be performed wi... | def contrast_restoration(im, method, remove_bits=1, blur_sigma=0, **kwargs):
from .util import imhist
from .classical import histeq
from .exact import histeq_exact
hist = imhist(im)
degraded = degrade_image(im, remove_bits, blur_sigma)
return (histeq(degraded, hist, **kwargs), None) if method ==... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def enhanceContrast(image, mask, target_path, name, save=False):\n \n\n \n # Contrast stretching\n p2, p98 = np.percentile(image, (2, 98))\n image_rescale = exposure.rescale_intensity(image, in_range=(p2, p98))\n \n # Equalization\n image_eq = exposure.equalize_hist(image)\n \n # Adap... | [
"0.6226322",
"0.61714876",
"0.57533675",
"0.5671843",
"0.56223106",
"0.5518422",
"0.54778224",
"0.54307353",
"0.542747",
"0.53356785",
"0.5330007",
"0.5312039",
"0.5306235",
"0.5290015",
"0.52711403",
"0.5265611",
"0.52430683",
"0.5232284",
"0.521228",
"0.5184543",
"0.5182028... | 0.66449046 | 0 |
Return the color of this agent. | def player(self):
return self._color | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_color(self):\n\n return self.color",
"def get_color(self):\n return self.color",
"def get_color(self):\n return self._color",
"def get_color(self):\n return self._color",
"def get_color(self):\n\n return self._color",
"def color(self):\n return self.__col... | [
"0.85092896",
"0.8472295",
"0.8459215",
"0.8459215",
"0.8446996",
"0.84452224",
"0.8426294",
"0.8426294",
"0.83962995",
"0.83887976",
"0.8375684",
"0.83724076",
"0.83058375",
"0.8277621",
"0.8277621",
"0.8277621",
"0.8258265",
"0.82096404",
"0.81652945",
"0.81449527",
"0.8088... | 0.69077605 | 93 |
Return first item in sequence where f(item) == True. | def find(ss, list_seq):
for item in list_seq:
if item in ss:
return True
return False | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def finditem(func, seq):\n return next((item for item in seq if func(item)))",
"def find(f, seq):\n for item in seq:\n if f(item): \n return item",
"def first_true(iterable, default=False, pred=None):\n return next(filter(pred, iterable), default)",
"def _first(self, \n iterable,... | [
"0.7381792",
"0.7369114",
"0.6982856",
"0.6804567",
"0.67566013",
"0.6728139",
"0.6665735",
"0.6629342",
"0.6596448",
"0.6463202",
"0.64401174",
"0.6314448",
"0.63141847",
"0.6313151",
"0.628845",
"0.6252063",
"0.6172812",
"0.61699855",
"0.61531734",
"0.61531734",
"0.6067265"... | 0.0 | -1 |
Convert the timestamp into a valid datetime object | def validate_timestamp(self, timestamp):
if timestamp is None:
return None
# Ensure a int value
try:
timestamp = int(timestamp)
except ValueError as exc:
raise InvalidPage(exc)
# convert the timestamp to a date object
d = datetime.dat... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _timestamp_to_datetime(timestamp):\n return datetime.fromtimestamp(timestamp * 0.001, tz=timezone.utc)",
"def fromtimestamp(cls, timestamp, tz=None):\n return datetime()",
"def convert_timestamp(data):\n try:\n return datetime.datetime.fromtimestamp(float(data))\n except ValueErr... | [
"0.77302796",
"0.7562761",
"0.7423706",
"0.7394872",
"0.72604805",
"0.72505355",
"0.71962976",
"0.7150784",
"0.7118786",
"0.70397687",
"0.69528866",
"0.694535",
"0.68686324",
"0.68078715",
"0.67811185",
"0.6751276",
"0.6710828",
"0.6710495",
"0.6710092",
"0.6709308",
"0.66848... | 0.6915635 | 12 |
The number of auxiliary trails in the topology diagram. Return | def number_of_auxiliary_trails(self):
return len(list(self.auxiliary_trails())) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def nb_triples(self) -> int:\n return 0",
"def number_of_trail_edges(self):\n return len(list(self.trail_edges()))",
"def auxiliary_trail_length(self):\n return self.attributes[\"_aux_length\"]",
"def depth(self):\n return len(self.topology)",
"def num_trajs(self):\n retu... | [
"0.7044501",
"0.69089276",
"0.67750597",
"0.6712533",
"0.669457",
"0.66807127",
"0.6651241",
"0.6614515",
"0.66012824",
"0.66012144",
"0.6544235",
"0.65411437",
"0.6522801",
"0.6522801",
"0.6513438",
"0.64867294",
"0.6456346",
"0.6439175",
"0.6431844",
"0.6425357",
"0.6421811... | 0.7570029 | 0 |
The number of trail edges in the topology diagram. Return | def number_of_trail_edges(self):
return len(list(self.trail_edges())) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def number_of_edges(self) -> int:\n return self.graph.number_of_edges()",
"def _number_of_edges(self):\n if self._edges is None:\n return 0\n return len(self._edges)",
"def num_edges(self):\n return (self.n * (self.L.size() - 1) - self.num_loop_vertices()) // (1 + int(not... | [
"0.7601283",
"0.75097096",
"0.7468747",
"0.7467483",
"0.7400774",
"0.73861575",
"0.7358506",
"0.73473877",
"0.7322266",
"0.7279467",
"0.727494",
"0.71929413",
"0.7162437",
"0.7157937",
"0.71145564",
"0.7108654",
"0.7034921",
"0.6984435",
"0.69638205",
"0.69557846",
"0.694299"... | 0.8699743 | 0 |
The number of deviation edges in the topology diagram. Return | def number_of_deviation_edges(self):
return len(list(self.deviation_edges())) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def number_of_direct_deviation_edges(self):\n return len(list(self.direct_deviation_edges()))",
"def number_of_indirect_deviation_edges(self):\n return len(list(self.indirect_deviation_edges()))",
"def e_size(self) -> int:\n return self.edges_on_graph",
"def num_edges(self):\r\n r... | [
"0.8076206",
"0.7928172",
"0.7554701",
"0.747331",
"0.7330685",
"0.73005146",
"0.72874546",
"0.72837764",
"0.7266576",
"0.7265215",
"0.7207048",
"0.7194614",
"0.7176811",
"0.71767676",
"0.7153365",
"0.7143165",
"0.7140974",
"0.71161765",
"0.71088845",
"0.7108306",
"0.7082955"... | 0.8585822 | 0 |
Finds the direct deviation edges connected to a node. | def _connected_direct_deviation_edges(self, node):
return self._connected_edges_predicate(node, self.is_direct_deviation_edge) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def connected_deviation_edges(self, node):\n return self._connected_edges_predicate(node, self.is_deviation_edge)",
"def _connected_indirect_deviation_edges(self, node):\n return self._connected_edges_predicate(node, self.is_indirect_deviation_edge)",
"def deviation_edges(self, data=False):\n ... | [
"0.7746356",
"0.7613282",
"0.711842",
"0.7040557",
"0.6969098",
"0.67360103",
"0.6691822",
"0.6421893",
"0.6420071",
"0.60896915",
"0.5962135",
"0.594176",
"0.592399",
"0.58114165",
"0.5777936",
"0.5774727",
"0.57315594",
"0.5615458",
"0.5540943",
"0.55381745",
"0.55232066",
... | 0.78968555 | 0 |
Finds the indirect deviation edges connected to a node. | def _connected_indirect_deviation_edges(self, node):
return self._connected_edges_predicate(node, self.is_indirect_deviation_edge) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _connected_direct_deviation_edges(self, node):\n return self._connected_edges_predicate(node, self.is_direct_deviation_edge)",
"def connected_deviation_edges(self, node):\n return self._connected_edges_predicate(node, self.is_deviation_edge)",
"def indirect_deviation_edges(self, data=False):\... | [
"0.75387955",
"0.74253654",
"0.73088944",
"0.7211598",
"0.6857312",
"0.6772637",
"0.6724114",
"0.6608114",
"0.6260523",
"0.62508255",
"0.62089515",
"0.585106",
"0.5799822",
"0.57546514",
"0.5650767",
"0.5636533",
"0.56276506",
"0.55947894",
"0.5592409",
"0.55640054",
"0.55181... | 0.8016556 | 0 |
Checks if a node is an origin node. | def is_node_origin(self, node):
return self.node_attribute(key=node, name="type") == "_origin" | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def check_origin(self, origin):\n return True",
"def check_origin(self, origin):\n return True",
"def check_origin(self, origin):\n return True",
"def check_origin(self, origin):\n return True",
"def is_origin(self) -> bool:\n return self.x == 0 and self.y == 0",
"def c... | [
"0.7339161",
"0.7339161",
"0.7339161",
"0.7339161",
"0.7083342",
"0.66724044",
"0.6501736",
"0.62388426",
"0.6213145",
"0.59829634",
"0.59723777",
"0.58401096",
"0.5828292",
"0.5748004",
"0.57374823",
"0.57260656",
"0.5662456",
"0.56272626",
"0.56256527",
"0.56112534",
"0.558... | 0.9030153 | 0 |
Tests whether or not an edge is the edge of an auxiliary trail. | def is_auxiliary_trail_edge(self, edge):
if edge in set(self.auxiliary_trails()):
return True
return False | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def is_trail_edge(self, edge):\n if self.edge_attribute(edge, \"type\") == \"trail\":\n return True\n return False",
"def isEdge(self,x,y):\n\t\treturn y in self._dictOut[x]",
"def is_edge(self):\n if self._row == 0 or self._row == 9 or self._column == 0 or self._column == 9:\n ... | [
"0.7260778",
"0.62282276",
"0.6216499",
"0.61682105",
"0.6073006",
"0.60723937",
"0.6065873",
"0.6018313",
"0.60002065",
"0.5964768",
"0.59640783",
"0.59454966",
"0.59321123",
"0.58850014",
"0.58129597",
"0.57804537",
"0.5764166",
"0.5724673",
"0.5719514",
"0.5707743",
"0.566... | 0.8203265 | 0 |
Tests if a deviation edge is direct. | def is_direct_deviation_edge(self, edge):
def predicate(x):
a, b = self.edge_sequence(edge)
if a == b:
return True
return self._is_deviation_edge_predicate(edge, predicate) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def is_deviation_edge(self, edge):\n if self.edge_attribute(edge, \"type\") == \"deviation\":\n return True\n return False",
"def is_indirect_deviation_edge(self, edge):\n def predicate(x):\n a, b = self.edge_sequence(edge)\n if a != b:\n retur... | [
"0.77797675",
"0.77320784",
"0.7241019",
"0.6869515",
"0.6697148",
"0.6432534",
"0.62430686",
"0.6108364",
"0.6041649",
"0.6022647",
"0.6015736",
"0.59478",
"0.58903164",
"0.58610886",
"0.58601797",
"0.5825777",
"0.5759491",
"0.5746902",
"0.5737291",
"0.573119",
"0.5730742",
... | 0.8417599 | 0 |
Tests if a deviation edge is indirect. | def is_indirect_deviation_edge(self, edge):
def predicate(x):
a, b = self.edge_sequence(edge)
if a != b:
return True
return self._is_deviation_edge_predicate(edge, predicate) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def is_direct_deviation_edge(self, edge):\n def predicate(x):\n a, b = self.edge_sequence(edge)\n if a == b:\n return True\n\n return self._is_deviation_edge_predicate(edge, predicate)",
"def is_deviation_edge(self, edge):\n if self.edge_attribute(edge, \... | [
"0.78870946",
"0.734168",
"0.7045992",
"0.7035475",
"0.67097896",
"0.6360159",
"0.6193624",
"0.6019307",
"0.5848258",
"0.57469225",
"0.5694206",
"0.56707793",
"0.56028533",
"0.56000394",
"0.55883616",
"0.55708766",
"0.55647206",
"0.5563885",
"0.555447",
"0.5530992",
"0.551303... | 0.8589796 | 0 |
Gets the sequence a node is assigned to. | def node_sequence(self, node):
k = self.node_attribute(key=node, name="_k")
if k is None:
msg = "Node {} doesn't belong to a sequence yet. Try adding trails first."
raise ValueError(msg.format(node))
return k | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def getSequence(self):\n if self.sequence != None: # a sequence has been assigned\n return self.sequence\n elif self.seqscores != None: # inferred by parsimony but not yet assigned\n return None # determine most parsimonous sequence, not yet implemented",
"def _get_sequence... | [
"0.76642406",
"0.7427849",
"0.7427849",
"0.7427849",
"0.7427849",
"0.7427849",
"0.7427849",
"0.7427849",
"0.7427849",
"0.7427849",
"0.7427849",
"0.7427849",
"0.7427849",
"0.7427849",
"0.7427849",
"0.7427849",
"0.7427849",
"0.7427849",
"0.7427849",
"0.7399108",
"0.7399108",
... | 0.6791373 | 28 |
The key of the last sequence in the topology diagram. Returns | def sequence_last(self):
return max(list(self.nodes_attribute(name="_k"))) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def last_key(self):\n return self._last_key",
"def getMaxKey(self):\n if self.last is None:\n return \"\"\n return self.last.first.key",
"def getMaxKey(self):\n if self.head.next_cl and self.head.next_cl != self.tail:\n return self.head.next_cl._next.key\n ... | [
"0.8124566",
"0.80322444",
"0.784394",
"0.7811908",
"0.74581724",
"0.73740095",
"0.7371953",
"0.7310097",
"0.70696753",
"0.69851625",
"0.69769984",
"0.69617045",
"0.6946917",
"0.69406617",
"0.6939314",
"0.6933144",
"0.68954647",
"0.6889584",
"0.68879414",
"0.6857436",
"0.6857... | 0.7348755 | 7 |
Generate dummy head node. | def dummy_head_node(mocker):
mocker.patch(
"pcluster.config.cluster_config.HeadNodeNetworking.availability_zone",
new_callable=PropertyMock(return_value="us-east-1a"),
)
head_node_networking = HeadNodeNetworking(
subnet_id="dummy-subnet-1", proxy=Proxy(http_proxy_address="http://10.0... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create_empty_node():\n from linked_list import Node\n return Node()",
"def create_dummy_node(self, name):\n dummy = DummyNode(name, self)\n self.append_node(dummy)\n return dummy",
"def __init__(self):\n self.head = PrefixNode('', False)",
"def _dummy_node(self) -> CFNod... | [
"0.70929587",
"0.7035901",
"0.6847529",
"0.6774798",
"0.63325405",
"0.62699807",
"0.6202143",
"0.6188543",
"0.6116241",
"0.6084235",
"0.6058816",
"0.603622",
"0.603622",
"0.603622",
"0.603622",
"0.6003193",
"0.6001361",
"0.5999151",
"0.5994336",
"0.59763515",
"0.5960462",
"... | 0.6651391 | 4 |
Test for EMR origin stage. We do so by putting data to a test S3 bucket using AWS S3 client and having a pipeline which reads that data using EMR origin stage and writes to S3 destination. Data is then asserted from destination S3 bucket to what is put by S3 client. | def test_provision_emr_origin_to_s3(sdc_builder, sdc_executor, aws):
_test_emr_origin_to_s3(sdc_builder, sdc_executor, aws) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_existing_emr_origin_to_s3(sdc_builder, sdc_executor, aws):\n pipeline_configs = {'amazonEMRConfig.clusterId': aws.emr_cluster_id}\n _test_emr_origin_to_s3(sdc_builder, sdc_executor, aws, pipeline_configs)",
"def test_existing_emr_origin_to_s3(sdc_builder, sdc_executor, aws):\n _test_emr_origin_... | [
"0.7542889",
"0.7389558",
"0.7358297",
"0.72870684",
"0.7090937",
"0.70660573",
"0.7048072",
"0.70207",
"0.68134373",
"0.6743333",
"0.67369306",
"0.6715333",
"0.66083133",
"0.6587891",
"0.65816885",
"0.6580921",
"0.655032",
"0.6501615",
"0.6459622",
"0.6459377",
"0.6436702",
... | 0.7142591 | 4 |
Test for EMR origin stage. We do so by putting data to a test S3 bucket using AWS S3 client and having a pipeline which reads that data using EMR origin stage and writes to S3 destination. Data is then asserted from destination S3 bucket to what is put by S3 client. | def test_existing_emr_origin_to_s3(sdc_builder, sdc_executor, aws):
_test_emr_origin_to_s3(sdc_builder, sdc_executor, aws) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_existing_emr_origin_to_s3(sdc_builder, sdc_executor, aws):\n pipeline_configs = {'amazonEMRConfig.clusterId': aws.emr_cluster_id}\n _test_emr_origin_to_s3(sdc_builder, sdc_executor, aws, pipeline_configs)",
"def test_s3_executor_create_object(sdc_builder, sdc_executor, aws):\n # setup test stat... | [
"0.75436145",
"0.73587376",
"0.7287456",
"0.7143251",
"0.7091081",
"0.7066013",
"0.7048129",
"0.70215493",
"0.6813232",
"0.6743677",
"0.6737705",
"0.6715935",
"0.6608327",
"0.6587884",
"0.6581273",
"0.6581157",
"0.6550589",
"0.65021855",
"0.6459455",
"0.64584494",
"0.6435879"... | 0.7390355 | 1 |
Converts the last feature dimension to 0 or 1 based on sign. | def code_stroke_tags(predictions):
condition = predictions[:, :, -1:] > 0
# condition = False # set all to 0
stroke_tags = tf.where(condition,
tf.ones_like(predictions[:, :, -1:]),
tf.zeros_like(predictions[:, :, -1:]))
return tf.concat([prediction... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def sign(tensor):\n raise NotImplementedError",
"def sign(self):\n return 1 - 2 * self._ltz()",
"def sign(num: float):\n return 1 if num >= 0 else -1",
"def sign(x):\n if x < 0.0:\n sign = -1\n elif x == 0.0:\n sign = 0\n elif x > 0.0:\n sign = 1\n return sign",
... | [
"0.6119208",
"0.6029055",
"0.6001119",
"0.58862704",
"0.5741043",
"0.5732999",
"0.5607708",
"0.5606348",
"0.5597204",
"0.55847067",
"0.55740184",
"0.5572358",
"0.55193967",
"0.55171233",
"0.5498743",
"0.5484696",
"0.5448059",
"0.54445094",
"0.543792",
"0.54196507",
"0.5390989... | 0.0 | -1 |
Converts the LSTM state to a sketch coordinate. | def decode_state(cells, weights, b_o):
return tf.tensordot(cells, weights, axes=1) + b_o | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def state_to_location(self, state):\n location, time = divmod(state, self.max_time)\n x, y = divmod(location, self.width)\n return (int(x), int(y)), time",
"def state_to_coords(self, state):\n x, _, theta, _ = state\n cart_coords = (x, self.y)\n pole_coords = ([x, x + 2*... | [
"0.6140679",
"0.568803",
"0.5682946",
"0.5632258",
"0.55985415",
"0.54754347",
"0.54247516",
"0.54092497",
"0.52717566",
"0.52425754",
"0.52123857",
"0.5209244",
"0.5194405",
"0.5193457",
"0.5181389",
"0.5162398",
"0.5145633",
"0.5139722",
"0.5123395",
"0.51151925",
"0.511244... | 0.0 | -1 |
Build or fetch the effective stop words list. Returns | def get_stop_words(self):
self._normalize_params()
return self.stop_words | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def construct_stop_words():\n stop_words_list = [\"uk\", \"ceo\", \"apple\", \"wal\", \"st\", \"q1\", \"q2\", \"q3\", \"q4\",\n \"bp\", \"wednesday\", \"tuesday\", \"monday\", \"thursday\", \"friday\", \"sept\", \"johnson\", \"inc\",\n \"david\", \"amazon.com\"]\n\n ... | [
"0.73688877",
"0.72765994",
"0.72072124",
"0.6897151",
"0.6889932",
"0.6884705",
"0.66693544",
"0.66546726",
"0.658677",
"0.6466151",
"0.63885045",
"0.6359658",
"0.6357782",
"0.6337321",
"0.63047796",
"0.62800604",
"0.62525994",
"0.6249913",
"0.62208766",
"0.6203219",
"0.6188... | 0.6799939 | 6 |
404 Error handler method. | def not_found(error):
return render_template('errors/404.html'), 404 | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def handleStatus_404(self):\n log.err('HTTP Error 404')",
"def handler404(request, *args, **argv):\n response = render_to_response('404.html', {})\n response.status_code = 404\n return response",
"def not_found():\n return HttpError(404)",
"def handler404(request):\n response = render_t... | [
"0.8561561",
"0.8176858",
"0.81680256",
"0.8096524",
"0.80738646",
"0.7975455",
"0.783502",
"0.7825378",
"0.7824048",
"0.78184605",
"0.78184605",
"0.78007555",
"0.77760434",
"0.7737401",
"0.773228",
"0.773228",
"0.773228",
"0.773228",
"0.773228",
"0.773228",
"0.773228",
"0.... | 0.7139949 | 78 |
Calculate mean absolute error between two np arrays | def get_MAE(prediction, actual_values):
prediction_vector = prediction.flatten()
diffs = np.abs(prediction_vector - actual_values)
return np.mean(diffs) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def rmse_calc(arr1, arr2):\n assert arr1.shape==arr2.shape\n \n return np.sqrt(np.mean((arr2-arr1)**2))",
"def _mean_diff(x, y):\n return np.mean(x) - np.mean(y)",
"def calculate_absolute_mean_diff(a1, a2):\n diff = np.array(a1) - np.array(a2)\n diff_abs = np.absolute(diff)\n mean_diff = diff... | [
"0.74976206",
"0.7449652",
"0.74155915",
"0.7349849",
"0.71976316",
"0.7037319",
"0.6994199",
"0.69689465",
"0.69624233",
"0.69224364",
"0.6921124",
"0.69139844",
"0.6913167",
"0.6906849",
"0.68856883",
"0.6882827",
"0.68383944",
"0.68327343",
"0.68287265",
"0.6817275",
"0.67... | 0.0 | -1 |
Yield successive nsized chunks from l. | def chunks(l, n):
for i in range(0, len(l), n):
yield l[i:i + n] | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _chunk(self, l, n):\n for i in range(0, len(l) + 1, n):\n yield l[i:i + n]",
"def chunks(self, l, n):\n for i in range(0, len(l), n):\n yield l[i:i + n]",
"def __chunks(l, n):\n for i in range(0, len(l), n):\n yield l[i:i + n]",
"def get_chunks(self, ... | [
"0.8038813",
"0.79248375",
"0.7923423",
"0.7885103",
"0.78773195",
"0.7815877",
"0.77655786",
"0.77556044",
"0.77441615",
"0.7731815",
"0.77288336",
"0.772473",
"0.77028215",
"0.76889825",
"0.76889825",
"0.7664208",
"0.76570904",
"0.7655856",
"0.7655856",
"0.76458347",
"0.764... | 0.7448925 | 52 |
Returns a normalized vector. | def normalize(self, vec):
length = math.sqrt( vec[0,0]*vec[0,0] + vec[0,1]*vec[0,1] + vec[0,2]*vec[0,2] )
vnorm = vec / length
return vnorm | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def getNormalizedVector(self):\n return self.scalarMultiplication(self.norm() ** -1.0)",
"def normalized(self):\n try:\n m = abs(self)\n return self / m\n except ZeroDivisionError as e:\n raise Exception(\"Attempted to normalize a zero vector, return a unit v... | [
"0.83684117",
"0.8343514",
"0.83411586",
"0.83152103",
"0.82179683",
"0.8217815",
"0.81618494",
"0.8075002",
"0.8048106",
"0.8002621",
"0.79868144",
"0.7948173",
"0.7925488",
"0.790664",
"0.7865606",
"0.77696586",
"0.7756306",
"0.7748541",
"0.77229935",
"0.77080375",
"0.76905... | 0.7873532 | 14 |
Return the state of the Tree as a list of arbitrary elements. It is mainly used for pickling a Tree object. | def getstate(self):
return [elem.getstate() for elem in self] | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def getList(self):\r\n node = self.root\r\n list = []\r\n return self.inOrderTraverse(node, list)",
"def state_list(self) -> Sequence[TState]:\n pass",
"def subtrees(self):\n return list(iter(self))",
"def __getstate__(self):\n\n return self.list",
"def to_list(sel... | [
"0.675098",
"0.6683108",
"0.66095114",
"0.6579048",
"0.65198016",
"0.6519615",
"0.65170074",
"0.6481557",
"0.64774346",
"0.64618856",
"0.6434679",
"0.6423028",
"0.63884944",
"0.63671976",
"0.6358392",
"0.6340605",
"0.6338968",
"0.6335147",
"0.6323886",
"0.6287445",
"0.6262866... | 0.7687686 | 0 |
Return the number of nodes in the tree. The size of a node is the number of descendants it has including itself. | def size(self):
return sum(elem.size for elem in self) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_tree_size(self, node):\n\n # If the tree has not been created yet.\n if node == None:\n return 0\n n_nodes = 1\n for child in node.children:\n n_nodes += self.get_tree_size(node.children[child])\n return n_nodes",
"def node_count(self):\n re... | [
"0.8746438",
"0.84441775",
"0.8373756",
"0.83344567",
"0.8238084",
"0.8234173",
"0.8204348",
"0.81605345",
"0.81348383",
"0.8098174",
"0.79994607",
"0.79994607",
"0.79890174",
"0.79222214",
"0.79108953",
"0.7894459",
"0.7859761",
"0.7827288",
"0.7824542",
"0.78073",
"0.779081... | 0.0 | -1 |
Return a generator function that iterates on the leaf of the tree in linear time using depth first algorithm. >>> t = Tree([1,2,3,[4,5,[6,7]],8]) >>> [i for i in t.iter_leaf] [2, 3, 5, 7, 8] | def iter_leaf(self):
for elem in self[1:]:
if isinstance(elem, Tree):
for elem2 in elem.iter_leaf:
yield elem2
else:
yield elem | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"async def leaf_it(d):\n async for _parent, _key, leaf in _walk({}, None, d):\n yield leaf",
"def leaves_iterator(node):\n if 0 == node.children_count:\n yield node\n else:\n for child in node.children:\n yield from leaves_iterator(child)",
"def depth_first_traverse(self... | [
"0.70251983",
"0.678294",
"0.6732749",
"0.6640105",
"0.66332984",
"0.6625135",
"0.6558049",
"0.64798075",
"0.64483774",
"0.64009655",
"0.63451266",
"0.6217975",
"0.617959",
"0.6104678",
"0.60896397",
"0.60789",
"0.6051464",
"0.6050373",
"0.60450476",
"0.6017358",
"0.60086113"... | 0.7617655 | 0 |
Get the specified index for all elements in the list. | def getidx(self, ind: Union[str, int]) -> List[Any]:
output = []
for data in self.data:
output.append(data[ind])
return output | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def getall(l, idx):\n return [l[i] for i in idx]",
"def __getitem__(self, index):\n try:\n return next(islice(self.__iter__(), index, index+1))\n except TypeError:\n return list(islice(self.__iter__(), index.start, index.stop,\n index.step))",
... | [
"0.7432687",
"0.7086382",
"0.6852719",
"0.67603403",
"0.6673309",
"0.6644717",
"0.659062",
"0.65542203",
"0.65521574",
"0.6535456",
"0.6504914",
"0.6414861",
"0.640099",
"0.6393468",
"0.6363662",
"0.63497746",
"0.63489425",
"0.63391966",
"0.63391966",
"0.6312897",
"0.6239448"... | 0.60581 | 36 |
Get the specified index for all elements in the list. | def getidx(self, ind: Union[str, int]) -> List[Any]:
output = []
for data in self.data:
output.append(data[ind])
return output | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def getall(l, idx):\n return [l[i] for i in idx]",
"def __getitem__(self, index):\n try:\n return next(islice(self.__iter__(), index, index+1))\n except TypeError:\n return list(islice(self.__iter__(), index.start, index.stop,\n index.step))",
... | [
"0.7432687",
"0.7086382",
"0.6852719",
"0.67603403",
"0.6673309",
"0.6644717",
"0.659062",
"0.65542203",
"0.65521574",
"0.6535456",
"0.6504914",
"0.6414861",
"0.640099",
"0.6393468",
"0.6363662",
"0.63497746",
"0.63489425",
"0.63391966",
"0.63391966",
"0.6312897",
"0.6239448"... | 0.5994918 | 41 |
Compute function for plot_diff([df...]) | def compare_multiple_df(
df_list: List[dd.DataFrame], cfg: Config, dtype: Optional[DTypeDef]
) -> Intermediate:
# pylint: disable=too-many-branches, too-many-locals
dfs = Dfs(df_list)
dfs_cols = dfs.columns.apply("to_list").data
labeled_cols = dict(zip(cfg.diff.label, dfs_cols))
baseline: int ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def diff_plot(df, **kwargs):\n # calculate difference between each column\n for comb in itertools.combinations(df.columns, 2):\n df[\"%s-%s\" % (comb[0], comb[1])] = df[comb[0]] - df[comb[1]]\n\n barcols = [x for x in df.columns if \"-\" in x]\n linecols = [x for x in df.columns if \"-\" not in ... | [
"0.706879",
"0.6573321",
"0.6358953",
"0.63298297",
"0.62465423",
"0.61625046",
"0.587379",
"0.58723384",
"0.5681161",
"0.565969",
"0.5626195",
"0.5588836",
"0.55775887",
"0.556315",
"0.5553513",
"0.5524145",
"0.5518994",
"0.5510232",
"0.549868",
"0.547993",
"0.5457066",
"0... | 0.0 | -1 |
Return the other player, for a player PLAYER numbered 0 or 1. >>> other(0) 1 >>> other(1) 0 | def other(player):
return 1 - player | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def otherPlayer(cls, player):\n return 0 if player == 1 else 1",
"def other_player(cls, player):\n return 0 if player == 1 else 1",
"def other_player(self, player):\n if player == self.__opponent:\n return self.__pid\n else:\n return self.__opponent",
"def __... | [
"0.81841356",
"0.8132211",
"0.7925993",
"0.7877487",
"0.7710803",
"0.7093829",
"0.68467593",
"0.6807922",
"0.6621171",
"0.6621171",
"0.6579509",
"0.6475284",
"0.6457067",
"0.64251137",
"0.63885665",
"0.6376348",
"0.6363664",
"0.6363664",
"0.6335919",
"0.6230273",
"0.6199266",... | 0.780462 | 4 |
Create a TimeStamp. Currently ignores the time zone. | def __init__(self, timeString: str):
#Example of input String and format
#Jan 11, 2015, 11:21:12 PM EDT
#"%b %-d, %Y, %-I:%M:%S %p %Z"
dateList = timeString.split(',')
self._month = dateList[0][0:3]
self._day = int(dateList[0][-2:])
self._year = int(dateLis... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create_timestamp(self):\n return self._create_ts",
"def _make_timestamp(self):\r\n\t\tlogger.debug(\"Get a timestamp\")\r\n\t\treturn time.mktime(datetime.today().timetuple())",
"def create(cls, *args, **kwargs):\n now = get_now()\n obj = cls(\n *args,\n **kwargs,... | [
"0.6850203",
"0.6751536",
"0.6401124",
"0.63345385",
"0.63162696",
"0.626704",
"0.6213237",
"0.6129085",
"0.6068222",
"0.60664326",
"0.6002868",
"0.59978896",
"0.5988129",
"0.59638304",
"0.5944028",
"0.5896486",
"0.58377236",
"0.5783644",
"0.5760853",
"0.5760826",
"0.5740998"... | 0.0 | -1 |
Adjust hour to be on 24 hour scale. | def _adjustHour(hour: int, meridiem: str) -> int:
if(meridiem == "PM" and hour < 12):
hour += 12
elif(meridiem == "AM" and hour == 12):
hour = 0
return hour | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def convert_to_24_hours(time, ap):\r\n if ap.lower() == 'p' and time <= 12:\r\n time += 12\r\n\r\n return time",
"def get_24h(self):\n records = self.level_model.get_for_period(1)\n self.set_attributes(records, '24 hours')",
"def h_24(self):\n return self._hour",
"def hourOf... | [
"0.70636743",
"0.6780292",
"0.67022425",
"0.65169847",
"0.6465387",
"0.6286777",
"0.6161269",
"0.60851765",
"0.60604805",
"0.60126525",
"0.59762275",
"0.5962379",
"0.59472466",
"0.5924533",
"0.58843994",
"0.58200336",
"0.581521",
"0.5770087",
"0.5747004",
"0.57267064",
"0.559... | 0.6636833 | 3 |
Hour of the TimeStamp. | def hour(self) -> int:
return self._hour | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def hour(self) -> int:\n return pulumi.get(self, \"hour\")",
"def hour(self):\n return self._hour",
"def hour(self):\n return \"%s:00:00\" % self.timestamp[:13]",
"def getHour(self):\n return _libsbml.Date_getHour(self)",
"def run_hour(self) -> int:\n return self.timestam... | [
"0.83992654",
"0.8395782",
"0.83903277",
"0.82140255",
"0.7933324",
"0.779347",
"0.779347",
"0.779347",
"0.77800584",
"0.7694325",
"0.75258327",
"0.74349874",
"0.73776776",
"0.7356084",
"0.7211531",
"0.71774024",
"0.70938694",
"0.70683277",
"0.6946723",
"0.6854109",
"0.685077... | 0.84716344 | 1 |
Month of the TimeStamp. | def month(self) -> str:
return self._month | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def month(self):\n return self.__month",
"def month(self):\n return 0",
"def month(self):\n return 0",
"def month(self):\n return self._month",
"def month(self):\n return self._month",
"def month(self):\n return gocept.month.Month(self.calendar_month, self.calend... | [
"0.82756954",
"0.81989443",
"0.81989443",
"0.8192804",
"0.8192804",
"0.81622595",
"0.8047782",
"0.8045633",
"0.79295874",
"0.79048383",
"0.78925204",
"0.7785133",
"0.77207136",
"0.7686959",
"0.76343954",
"0.75480735",
"0.74557924",
"0.7424542",
"0.74220586",
"0.7408867",
"0.7... | 0.7895035 | 10 |
Minute of the TimeStamp. | def minute(self) -> int:
return self._minute | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def getMinute(self):\n return _libsbml.Date_getMinute(self)",
"def minute(self) -> Optional[pulumi.Input[int]]:\n return pulumi.get(self, \"minute\")",
"def minute(self) -> Optional[pulumi.Input[int]]:\n return pulumi.get(self, \"minute\")",
"def minute(self) -> Optional[pulumi.Input[int... | [
"0.8369689",
"0.7700283",
"0.7700283",
"0.7700283",
"0.7700283",
"0.76464844",
"0.7520762",
"0.7380577",
"0.7380396",
"0.72031844",
"0.71014583",
"0.70504296",
"0.70144486",
"0.68652695",
"0.6773303",
"0.6766956",
"0.6739494",
"0.66862124",
"0.66754436",
"0.66517705",
"0.6619... | 0.8349448 | 1 |
Second of the TimeStamp. | def second(self) -> int:
return self._second | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def getSecond(self):\n return _libsbml.Date_getSecond(self)",
"def t_sec(self):\n return self.t/self.parameters['time_conversion']",
"def sec(self):\n # my clock uses seconds internally\n return self.read()",
"def seconds(self):\n return int(self)",
"def SECOND(time):\n\n... | [
"0.78467304",
"0.7766666",
"0.76843977",
"0.7509325",
"0.7417629",
"0.7392701",
"0.738256",
"0.72185695",
"0.695134",
"0.695134",
"0.69443285",
"0.6932041",
"0.6878987",
"0.6842883",
"0.6829345",
"0.6824687",
"0.6817214",
"0.6802941",
"0.67004645",
"0.66807926",
"0.6644491",
... | 0.7769269 | 1 |
Hour of the TimeStamp. | def hour(self) -> int:
return self._hour | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def hour(self) -> int:\n return pulumi.get(self, \"hour\")",
"def hour(self):\n return self._hour",
"def hour(self):\n return \"%s:00:00\" % self.timestamp[:13]",
"def getHour(self):\n return _libsbml.Date_getHour(self)",
"def run_hour(self) -> int:\n return self.timestam... | [
"0.83992654",
"0.8395782",
"0.83903277",
"0.82140255",
"0.7933324",
"0.779347",
"0.779347",
"0.779347",
"0.77800584",
"0.7694325",
"0.75258327",
"0.74349874",
"0.73776776",
"0.7356084",
"0.7211531",
"0.71774024",
"0.70938694",
"0.70683277",
"0.6946723",
"0.6854109",
"0.685077... | 0.84716344 | 0 |
Convert a TimeStamp to a datetime. | def toDateTime(self, interval: Optional[str] = 'day') -> datetime.datetime:
if not isinstance(interval, str):
raise TypeError("interval must be of type str")
if interval not in {'day', 'month', 'year'}:
raise ValueError("interval must be one of 'month', 'day', or 'year'")
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _timestamp_to_datetime(timestamp):\n return datetime.fromtimestamp(timestamp * 0.001, tz=timezone.utc)",
"def timestamp_to_datetime(timestamp: int) -> datetime:\n return datetime.fromtimestamp(timestamp, tz=timezone.utc)",
"def _time_to_datetime(value):\r\n assert isinstance(value, datetime.ti... | [
"0.70553946",
"0.69894284",
"0.69072",
"0.6644596",
"0.6606644",
"0.6542306",
"0.6500672",
"0.6470977",
"0.6441954",
"0.63973707",
"0.6381951",
"0.634015",
"0.6295444",
"0.6248182",
"0.6247528",
"0.62315816",
"0.6227938",
"0.62226474",
"0.6188631",
"0.6180727",
"0.61799186",
... | 0.0 | -1 |
Use a query to create a csv file | def write_rating_data():
with open('outward.csv', 'w') as f:
out = csv.writer(f)
for item in Rating.query.filter(Rating.score != None).all():
out.writerow([item.user_id, item.book_id, item.score]) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create_query_csv(self):\n\n self.query_df.to_csv(self.query_output_file)",
"def to_csv(self, path):\n for table in ['datasets', 'dataruns', 'hyperpartitions', 'classifiers']:\n df = pd.read_sql('SELECT * FROM %s' % table, self.session.bind)\n df.to_csv(os.path.join(path, '... | [
"0.79529333",
"0.73045",
"0.71351135",
"0.7082771",
"0.7064246",
"0.70542014",
"0.6976933",
"0.6875712",
"0.6875417",
"0.68234885",
"0.68215996",
"0.6800643",
"0.6737782",
"0.67337596",
"0.6724612",
"0.67097455",
"0.6678255",
"0.6658575",
"0.66374505",
"0.6622798",
"0.6605897... | 0.0 | -1 |
Indetifies the actiated voxels and returns their indices | def get_activated_indices(metabolic_map_path, metabolic_map_path_double_check=None):
metabolic_map_flat, shape = load_metabolic_map(metabolic_map_path)
# Most of the voxels are not activated. They contain the a fix baseline value
baseline = np.bincount(metabolic_map_flat).argmax()
# Get the index of al... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_vacancy_indices(array):\t\n\tvacancy_indices = np.argwhere(array == 0)\n\treturn vacancy_indices",
"def vir_indices(self):\n indices = []\n for index,item in enumerate(self):\n if item==0:\n indices.append(index)\n return indices",
"def get_agent_indices(a... | [
"0.64152896",
"0.6295252",
"0.6178203",
"0.60258514",
"0.6009226",
"0.6009226",
"0.5949142",
"0.5911795",
"0.57831174",
"0.5761881",
"0.5755146",
"0.5735931",
"0.5673003",
"0.5629726",
"0.5629475",
"0.5593912",
"0.55776614",
"0.5573319",
"0.55222476",
"0.5515842",
"0.54938436... | 0.5627862 | 15 |
Initialize the internal cache dictionary | def __init__(self, cachefile=None):
self.cache = dict()
self.sites = []
if cachefile:
try:
with open(cachefile, 'rb') as cf:
saved_sites = pickle.load(cf)
for sitename, popularity, latency, content in saved_sites:
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def init_cache(self):\n if self.cacheable:\n self._instance._cache[self.name] = {}",
"def __init__(self, *args, **kwargs):\n self._cachedict = {}",
"def __init__(self):\n self.ts = dict()\n self.cache = dict()",
"def __init__(self, persistent=True):\n super().__i... | [
"0.8541456",
"0.80963737",
"0.7533873",
"0.71342224",
"0.7134196",
"0.71016836",
"0.71007794",
"0.7044584",
"0.70396084",
"0.70109737",
"0.6994977",
"0.6966075",
"0.6966075",
"0.692434",
"0.6903103",
"0.6894314",
"0.6876934",
"0.68444985",
"0.68261456",
"0.6817257",
"0.681641... | 0.66933864 | 24 |
Constructor. Any message fields that are implicitly/explicitly set to None will be assigned a default value. The recommend use is keyword arguments as this is more robust to future message changes. You cannot mix inorder arguments and keyword arguments. | def __init__(self, *args, **kwds):
if args or kwds:
super(DetectedPerson, self).__init__(*args, **kwds)
#message fields cannot be None, assign default values for those that are
if self.detection_id is None:
self.detection_id = 0
if self.confidence is None:
self.confidence = 0... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __init__(self, *args, **kwds):\n if args or kwds:\n super(KomodoSpeechRecCommand, self).__init__(*args, **kwds)\n #message fields cannot be None, assign default values for those that are\n if self.header is None:\n self.header = std_msgs.msg.Header()\n if self.cmd is None:\n ... | [
"0.7794938",
"0.77218187",
"0.77218187",
"0.76881015",
"0.7627416",
"0.75650686",
"0.7441556",
"0.7418871",
"0.7351959",
"0.7308522",
"0.7280604",
"0.72376406",
"0.7227385",
"0.72258365",
"0.72258365",
"0.72192574",
"0.7213339",
"0.7213339",
"0.7213339",
"0.7213339",
"0.72133... | 0.0 | -1 |
Gets or sets the Resource Group Uri. | def resource_group_id(self) -> Optional[pulumi.Input[str]]:
return pulumi.get(self, "resource_group_id") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def getURI(self, *args):\n return _libsbml.GroupsExtension_getURI(self, *args)",
"def get_uri(self):\n if self._uri is None:\n self._uri = \"{0}{1}/{2}\".format(\n self.session.resource_prefix,\n self.base_uri,\n self.ip_or_ifname_or_group_nam... | [
"0.69652045",
"0.6934922",
"0.6911968",
"0.67406297",
"0.65219486",
"0.6379909",
"0.63504183",
"0.62961465",
"0.62961465",
"0.62961465",
"0.62961465",
"0.62961465",
"0.62961465",
"0.62167126",
"0.6176411",
"0.61288637",
"0.6084417",
"0.6056617",
"0.6044599",
"0.5932094",
"0.5... | 0.0 | -1 |
DatasourceType of the resource. | def datasource_type(self) -> Optional[pulumi.Input[str]]:
return pulumi.get(self, "datasource_type") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def datasource_type(self) -> Optional[str]:\n return pulumi.get(self, \"datasource_type\")",
"def datasource_type(self) -> Optional[str]:\n return pulumi.get(self, \"datasource_type\")",
"def resource_type(cls):\n pass",
"def datasource_types(self) -> Sequence[str]:\n return pulum... | [
"0.8333773",
"0.8333773",
"0.6921719",
"0.6772679",
"0.6758087",
"0.6752731",
"0.6752731",
"0.6677363",
"0.66157275",
"0.6560598",
"0.65535",
"0.65535",
"0.65535",
"0.65535",
"0.65535",
"0.6501328",
"0.63855106",
"0.6337367",
"0.63088006",
"0.6159757",
"0.61206067",
"0.6119... | 0.8127408 | 3 |
Resource Type of Datasource. | def resource_type(self) -> Optional[pulumi.Input[str]]:
return pulumi.get(self, "resource_type") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def resource_type(cls):\n pass",
"def resource_type(self) -> str:\n return 'TABLE'",
"def datasource_type(self) -> Optional[str]:\n return pulumi.get(self, \"datasource_type\")",
"def datasource_type(self) -> Optional[str]:\n return pulumi.get(self, \"datasource_type\")",
"def d... | [
"0.7715713",
"0.7293414",
"0.7189991",
"0.7189991",
"0.7006099",
"0.7006099",
"0.7006099",
"0.7006099",
"0.69505984",
"0.69505984",
"0.6874316",
"0.6779358",
"0.663781",
"0.6331858",
"0.6200698",
"0.6200294",
"0.609024",
"0.609024",
"0.609024",
"0.609024",
"0.6067112",
"0.6... | 0.67527145 | 12 |
DatasourceType of the resource. | def datasource_type(self) -> Optional[pulumi.Input[str]]:
return pulumi.get(self, "datasource_type") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def datasource_type(self) -> Optional[str]:\n return pulumi.get(self, \"datasource_type\")",
"def datasource_type(self) -> Optional[str]:\n return pulumi.get(self, \"datasource_type\")",
"def resource_type(cls):\n pass",
"def datasource_types(self) -> Sequence[str]:\n return pulum... | [
"0.8332458",
"0.8332458",
"0.6924982",
"0.6771135",
"0.6762105",
"0.6757145",
"0.6757145",
"0.6676432",
"0.6616782",
"0.65630734",
"0.6558074",
"0.6558074",
"0.6558074",
"0.6558074",
"0.6558074",
"0.65022177",
"0.6381401",
"0.63401395",
"0.63123864",
"0.61606944",
"0.6122727"... | 0.8126562 | 2 |
Resource Type of Datasource. | def resource_type(self) -> Optional[pulumi.Input[str]]:
return pulumi.get(self, "resource_type") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def resource_type(cls):\n pass",
"def resource_type(self) -> str:\n return 'TABLE'",
"def datasource_type(self) -> Optional[str]:\n return pulumi.get(self, \"datasource_type\")",
"def datasource_type(self) -> Optional[str]:\n return pulumi.get(self, \"datasource_type\")",
"def d... | [
"0.7718459",
"0.72933275",
"0.7186887",
"0.7186887",
"0.7003474",
"0.7003474",
"0.7003474",
"0.7003474",
"0.6952752",
"0.6952752",
"0.68766326",
"0.67813873",
"0.66403383",
"0.6333464",
"0.6201142",
"0.61990076",
"0.6091342",
"0.6091342",
"0.6091342",
"0.6091342",
"0.60659766... | 0.6755116 | 13 |
The identityType which can be either SystemAssigned or None | def type(self) -> Optional[pulumi.Input[str]]:
return pulumi.get(self, "type") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def type(self) -> Optional[pulumi.Input[Union[str, 'ManagedIdentityType']]]:\n return pulumi.get(self, \"type\")",
"def identity_type(self) -> Optional[pulumi.Input[Union[str, 'CmkIdentityType']]]:\n return pulumi.get(self, \"identity_type\")",
"def type(self) -> Optional[pulumi.Input[Union[str, ... | [
"0.75812453",
"0.74348366",
"0.740076",
"0.72293144",
"0.6954207",
"0.67862004",
"0.6709025",
"0.66474575",
"0.662278",
"0.66005605",
"0.65865296",
"0.65865296",
"0.65089244",
"0.6441229",
"0.6381797",
"0.63551277",
"0.6247597",
"0.61750036",
"0.61646503",
"0.61646503",
"0.61... | 0.0 | -1 |
Gets or sets the DataStore Parameters | def data_store_parameters_list(self) -> Optional[pulumi.Input[Sequence[pulumi.Input['AzureOperationalStoreParametersArgs']]]]:
return pulumi.get(self, "data_store_parameters_list") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_db_params(self):\n return self.get_section_config('db')",
"def data_store(self) -> pulumi.Input['DataStoreInfoBaseArgs']:\n return pulumi.get(self, \"data_store\")",
"def data_store_parameters_list(self) -> Optional[Sequence['outputs.AzureOperationalStoreParametersResponse']]:\n re... | [
"0.6543305",
"0.6396027",
"0.62810415",
"0.60769933",
"0.60487574",
"0.59728533",
"0.5954893",
"0.5902878",
"0.5873714",
"0.5806075",
"0.5778994",
"0.5533632",
"0.55123836",
"0.53959596",
"0.53892213",
"0.53793097",
"0.5341296",
"0.5333229",
"0.5328833",
"0.53278583",
"0.5304... | 0.6497708 | 1 |
Gets or sets the type of the datastore. | def data_store_type(self) -> Optional[pulumi.Input[Union[str, 'StorageSettingStoreTypes']]]:
return pulumi.get(self, "data_store_type") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def datastore_type(self) -> Optional[str]:\n return pulumi.get(self, \"datastore_type\")",
"def datastore_type(self) -> Optional[pulumi.Input[Union[str, 'StorageSettingStoreTypes']]]:\n return pulumi.get(self, \"datastore_type\")",
"def data_store_type(self) -> str:\n return pulumi.get(sel... | [
"0.8384261",
"0.7675057",
"0.72825634",
"0.72825634",
"0.7005972",
"0.7005972",
"0.7005972",
"0.68387705",
"0.6687405",
"0.6655847",
"0.66409904",
"0.6622544",
"0.66166395",
"0.66166395",
"0.66059047",
"0.65617853",
"0.65617853",
"0.65506536",
"0.65069467",
"0.6490971",
"0.64... | 0.6755592 | 8 |
Gets or sets the type. | def type(self) -> Optional[pulumi.Input[Union[str, 'StorageSettingTypes']]]:
return pulumi.get(self, "type") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_type(self):\n return self.type",
"def get_type(self):\n return self.type",
"def get_type(self):\n return self._type",
"def get_type(self):\n return self._type",
"def type(self):\n return self._getValue('type')",
"def get_type(self):\n return self._TYPE",
... | [
"0.8533302",
"0.8533302",
"0.844054",
"0.844054",
"0.8312111",
"0.827963",
"0.8276462",
"0.82763165",
"0.81963736",
"0.8196329",
"0.8196329",
"0.8196329",
"0.8196329",
"0.8196329",
"0.8196329",
"0.8196329",
"0.8196329",
"0.8196329",
"0.8196329",
"0.8196329",
"0.8196329",
"0... | 0.0 | -1 |
The email parameter must be an Email object. | def send(self, email):
smtp = smtplib.SMTP(self.server, self.port)
smtp.ehlo()
if self.tls:
smtp.starttls()
smtp.ehlo()
if self.user and self.passwd:
smtp.login(self.user, self.passwd)
smtp.sendmail(email.from_address, ema... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def email(self, email):\n\n self._email = email",
"def email(self, email):\n\n self._email = email",
"def email(self, email):\n\n self._email = email",
"def email(self, email):\n\n self._email = email",
"def email(self, email):\n\n self._email = email",
"def email(self,... | [
"0.7562615",
"0.7562615",
"0.7562615",
"0.7562615",
"0.7562615",
"0.7562615",
"0.7562615",
"0.7562615",
"0.7562615",
"0.7562615",
"0.7464227",
"0.7311624",
"0.7243365",
"0.72348195",
"0.7110957",
"0.71018714",
"0.7072816",
"0.6838006",
"0.67900455",
"0.67810637",
"0.67188054"... | 0.0 | -1 |
Split a list into smaller lists of maximum size chunk_size. | def chunk(items, chunk_size):
start_index = 0
for start_index in xrange(0, len(items), chunk_size):
end_index = min(start_index+chunk_size, len(items))
yield items[start_index:end_index] | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def split_chunk(list, chunk_size):\n for i in range(0, len(list), chunk_size):\n yield list[i:i + chunk_size]",
"def split_to_chunks(of_list, chunk_size):\n assert of_list is not None\n\n for i in range(0, len(of_list), chunk_size):\n yield of_list[i:i + chunk_size]",
"def chunke... | [
"0.84589875",
"0.8418729",
"0.8337752",
"0.8181122",
"0.8137123",
"0.8079236",
"0.7944111",
"0.7884139",
"0.7852615",
"0.78174394",
"0.77850735",
"0.77827466",
"0.77691466",
"0.7695345",
"0.76584876",
"0.7611956",
"0.7611727",
"0.7545638",
"0.75438654",
"0.749044",
"0.7485917... | 0.0 | -1 |
Remove all sentences that only contain one word. | def remove_one_word_sentences(df):
df['length'] = df.text.apply(lambda text: len(word_tokenize(text)))
df = df[df.length > 1]
df.drop('length', axis=1, inplace=True)
return df | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def simple_clean(sentence):\n return re.sub(f\"[{PUNCT}]\", ' ', remove_stopwords(sentence).strip().lower()).replace(' ', ' ')",
"def get_un_searched_single_word(self, content, stop_words):\n content = re.sub(r\"[^\\w\\s]\", \"\", content)\n content = re.sub(r\"[0-9]+\", \"\", content)\n ... | [
"0.68267596",
"0.6809877",
"0.65810907",
"0.6469793",
"0.6420568",
"0.639408",
"0.6373943",
"0.6359472",
"0.632633",
"0.6315746",
"0.63145214",
"0.6312127",
"0.6259876",
"0.62487",
"0.61953694",
"0.61770195",
"0.6148875",
"0.614449",
"0.6142595",
"0.61413753",
"0.61343867",
... | 0.7168902 | 0 |
compute the origin of the plane | def _calculate_origin(self):
if 'x' in self._name:
assert len(np.unique(self._vertices[:, 0])) == 1, 'vertices are wrong!'
self._normal = np.array([1, 0, 0]) * self._sign
x_origin = self._vertices[0, 0]
y_origin = (min(self._vertices[:, 1]) + max(self._vertic... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def origin():\n\n # indices: [axis, point]\n return numpy.zeros((3, 1))",
"def get_origin(self):\n return self.coord_cls(x=0, y=0, z=0, system=self)",
"def get_reconstruction_origin(r) -> np.ndarray:\n s = r.scale\n pose = pygeometry.Pose(np.array([r.rx, r.ry, r.rz]), np.array([r.tx / s, r.t... | [
"0.7113468",
"0.7025068",
"0.6998653",
"0.6914106",
"0.68113065",
"0.6765085",
"0.6712746",
"0.66696155",
"0.6549219",
"0.64747614",
"0.6386205",
"0.6327369",
"0.63162893",
"0.63115245",
"0.6311318",
"0.6272922",
"0.6263615",
"0.6209621",
"0.6187435",
"0.618109",
"0.6155398",... | 0.7550948 | 0 |
checks if ray intersects plane | def is_intersecting(self, ray):
intersecting_point = self._sympy_plane.intersection(ray.sympy_line)[0]
if 'x' in self._name:
if self._within_y_bounds(intersecting_point.y) and self._within_z_bounds(intersecting_point.z):
return True, np.array(map(float, [intersecting_point... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def intersects(self, ray):\n theta = 45\n H = 512\n W = 512\n A = self.origin\n B = Point(W, A.y, A.z)\n C = Point(B.x, (int)(H * math.sin(theta * math.pi / 180)), (int)(H * math.cos(math.pi * theta / 180)))\n D = Point(A.x, (int)(H * math.sin(theta * math.pi / 180)... | [
"0.7696719",
"0.71019363",
"0.67699015",
"0.6639869",
"0.6576905",
"0.6569612",
"0.6560293",
"0.6484351",
"0.64092886",
"0.6364233",
"0.6362687",
"0.6348939",
"0.6325618",
"0.6322131",
"0.6318155",
"0.6251878",
"0.6219726",
"0.6171037",
"0.616899",
"0.61462265",
"0.61215687",... | 0.7301419 | 1 |
Initialisation of the DLEP router; Starts the DLEP Session for all configured interfaces | def dlep_router_init(conf: dict, loop, addr_lst: list):
sessions = []
for addr in addr_lst:
session = DLEPSession(conf, addr, loop=loop, update_callback=update_webview)
log.debug("run dlep-router for {}".format(addr))
loop.run_until_complete(session.start())
sessions.append(sessi... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def initialize(self):\n LOGGER.info('Set %d initializing...', self.port_set)\n # There is a race condition here with ovs assigning ports, so wait a bit.\n time.sleep(2)\n shutil.rmtree(self.tmpdir, ignore_errors=True)\n networking_name = 'gw%02d' % self.port_set\n networki... | [
"0.62912273",
"0.6256661",
"0.61832666",
"0.6055879",
"0.6040032",
"0.5991741",
"0.5991741",
"0.59722525",
"0.5951307",
"0.5938117",
"0.58919376",
"0.58620334",
"0.5855563",
"0.5850748",
"0.5834281",
"0.5824847",
"0.57907575",
"0.5787589",
"0.57833755",
"0.57764643",
"0.57630... | 0.74535006 | 0 |
Mute the listener system. | def handle_mic_mute(_):
loop.mute() | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def mute():\n request_command(tv_command=TVCommand.mute)",
"def mute(self) -> None:\n self.system.notify(\"Jarvis::Muted\")\n self.media.mute(True)",
"def disable_mute(self):\n self.mute = False",
"def mute(self, status=None):\n if status is not None:\n st = ... | [
"0.7768342",
"0.7634151",
"0.7572053",
"0.7352609",
"0.7343957",
"0.71518993",
"0.7043327",
"0.70270044",
"0.69301414",
"0.6868569",
"0.6864702",
"0.6733866",
"0.667974",
"0.6666806",
"0.6655882",
"0.6643774",
"0.6641673",
"0.65949035",
"0.65859264",
"0.6577715",
"0.65775746"... | 0.6594539 | 18 |
Return val coerced to closest number in the ``valstep`` grid. | def _stepped_value(self, val):
if isinstance(self.valstep, Number):
val = (self.valmin
+ round((val - self.valmin) / self.valstep) * self.valstep)
elif self.valstep is not None:
valstep = np.asanyarray(self.valstep)
if valstep.ndim != 1:
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def compute_val(self, val: Union[int, float]) -> Union[int, float]:\n\n return (val - self.min) / (self.max - self.min)",
"def find_nearest(arr, val):\n arr = np.asarray(arr)\n idx = (np.abs(arr - val)).argmin()\n return idx, arr[idx]",
"def find_nearest(arr, val):\n\n arr = np.asarray(arr)\... | [
"0.66790783",
"0.6412513",
"0.63850456",
"0.6317257",
"0.6241803",
"0.5851016",
"0.5826771",
"0.57214725",
"0.57163876",
"0.5713571",
"0.56940675",
"0.5689613",
"0.5576329",
"0.5546513",
"0.5534824",
"0.5501633",
"0.5477997",
"0.54618186",
"0.54618186",
"0.54565406",
"0.54384... | 0.7435168 | 0 |
Set slider value to val. | def set_val(self, val):
xy = self.poly.xy
if self.orientation == 'vertical':
xy[1] = .25, val
xy[2] = .75, val
self._handle.set_ydata([val])
else:
xy[2] = val, .75
xy[3] = val, .25
self._handle.set_xdata([val])
self.... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def SetValue(self, val):\n self.spin.SetValue(val)\n self.slider.SetValue(100*(val-self.minval)/(self.maxval-self.minval))",
"def setval(self, val):\r\n self.value = val",
"def set_value(self, val):\n self.value = val",
"def set_val(self, val):\n val = int(val)\n # v... | [
"0.8494439",
"0.78948486",
"0.7801245",
"0.769454",
"0.76674706",
"0.7590819",
"0.7590819",
"0.755966",
"0.7330893",
"0.72467864",
"0.7202306",
"0.71976876",
"0.7159081",
"0.7142454",
"0.7009001",
"0.70003444",
"0.69746125",
"0.69746125",
"0.6919497",
"0.6905802",
"0.6898388"... | 0.7009815 | 14 |
Ensure the new min value is between valmin and self.val[1]. | def _min_in_bounds(self, min):
if min <= self.valmin:
if not self.closedmin:
return self.val[0]
min = self.valmin
if min > self.val[1]:
min = self.val[1]
return self._stepped_value(min) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_minVal(self, val):\n self.minVal = val",
"def set_min(self, min):\n self.set_val((min, self.val[1]))",
"def _value_in_bounds(self, val):\n val = self._stepped_value(val)\n\n if val <= self.valmin:\n if not self.closedmin:\n return\n val =... | [
"0.79729515",
"0.77659774",
"0.69997895",
"0.68599635",
"0.68599635",
"0.68599635",
"0.6858788",
"0.6858788",
"0.681666",
"0.66978955",
"0.66978955",
"0.66656876",
"0.6618084",
"0.6618084",
"0.64975077",
"0.64348674",
"0.64136946",
"0.64088005",
"0.63661957",
"0.63611984",
"0... | 0.7903454 | 1 |
Ensure the new max value is between valmax and self.val[0]. | def _max_in_bounds(self, max):
if max >= self.valmax:
if not self.closedmax:
return self.val[1]
max = self.valmax
if max <= self.val[0]:
max = self.val[0]
return self._stepped_value(max) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_maxVal(self, val):\n self.maxVal = val",
"def set_max(self, max):\n self.set_val((self.val[0], max))",
"def set_max(self, val):\n self._max = val",
"def check_valid_range(val, max_val):\n if val < 0:\n val = 0\n elif val > max_val:\n val = max_... | [
"0.8000541",
"0.7735373",
"0.7555319",
"0.74363005",
"0.7155426",
"0.7155426",
"0.7019678",
"0.7019678",
"0.700133",
"0.700133",
"0.700133",
"0.6871334",
"0.68296313",
"0.67205715",
"0.6682442",
"0.6635573",
"0.66281533",
"0.66281533",
"0.65829086",
"0.6553103",
"0.65482205",... | 0.7834248 | 1 |
Set slider value to val. | def set_val(self, val):
val = np.sort(val)
_api.check_shape((2,), val=val)
# Reset value to allow _value_in_bounds() to work.
self.val = (self.valmin, self.valmax)
vmin, vmax = self._value_in_bounds(val)
self._update_selection_poly(vmin, vmax)
if self.orientation ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def SetValue(self, val):\n self.spin.SetValue(val)\n self.slider.SetValue(100*(val-self.minval)/(self.maxval-self.minval))",
"def setval(self, val):\r\n self.value = val",
"def set_value(self, val):\n self.value = val",
"def set_val(self, val):\n val = int(val)\n # v... | [
"0.8494439",
"0.78948486",
"0.7801245",
"0.769454",
"0.76674706",
"0.7590819",
"0.7590819",
"0.755966",
"0.7330893",
"0.72467864",
"0.7202306",
"0.71976876",
"0.7142454",
"0.7009815",
"0.7009001",
"0.70003444",
"0.69746125",
"0.69746125",
"0.6919497",
"0.6905802",
"0.6898388"... | 0.7159081 | 12 |
Convenience method to get all animated artists of the figure containing this widget, excluding those already present in self.artists. | def _get_animated_artists(self):
return tuple(a for ax_ in self.ax.get_figure().get_axes()
for a in ax_.get_children()
if a.get_animated() and a not in self.artists) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def artists(self):\n handles_artists = getattr(self, '_handles_artists', ())\n return (self._selection_artist,) + handles_artists",
"def expose(self):\n arts = [a.art() for a in self.artists]\n return arts",
"def get_all_artists(self):\n self.all_artists = get_artist_list()\n... | [
"0.6681268",
"0.6672516",
"0.6385249",
"0.6150645",
"0.61244226",
"0.5964024",
"0.5953601",
"0.58641243",
"0.584757",
"0.5829638",
"0.5822397",
"0.58085346",
"0.56969386",
"0.56966597",
"0.563508",
"0.5578683",
"0.5569832",
"0.5427685",
"0.537198",
"0.53181994",
"0.5308744",
... | 0.79978496 | 0 |
Set the direction of the span selector. | def direction(self, direction):
_api.check_in_list(['horizontal', 'vertical'], direction=direction)
if hasattr(self, '_direction') and direction != self._direction:
# remove previous artists
self._selection_artist.remove()
if self._interactive:
self._e... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def setdirection(self, *args, **kwargs):\n return _coordsys.coordsys_setdirection(self, *args, **kwargs)",
"def set_direction(self, dir):\n if dir == 0:\n self.direction = [0, -1]\n elif dir == 1:\n self.direction = [1, 0]\n elif dir == 2:\n self.direc... | [
"0.6023297",
"0.58441085",
"0.57625324",
"0.5703619",
"0.55823743",
"0.5528689",
"0.5405569",
"0.53627384",
"0.5273403",
"0.51266545",
"0.51266545",
"0.504836",
"0.50420666",
"0.49683774",
"0.49592626",
"0.49585593",
"0.49360603",
"0.49106586",
"0.49104866",
"0.49104866",
"0.... | 0.5348002 | 8 |
Return True if event is within the patch. | def _contains(self, event):
return self._selection_artist.contains(event, radius=0)[0] | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_is_on(self, event: Event | None) -> bool:\n if event is None:\n return False\n\n now = dt_util.utcnow()\n value = now > event.start\n if value and event.end is not None and now > event.end:\n value = False\n\n return value",
"def is_happening(self)... | [
"0.68102735",
"0.62505597",
"0.62421864",
"0.60306054",
"0.59336966",
"0.5925863",
"0.59047306",
"0.58877647",
"0.5874139",
"0.5870086",
"0.5868836",
"0.58629495",
"0.58519256",
"0.5849901",
"0.5835692",
"0.5772151",
"0.57554907",
"0.57504535",
"0.5748574",
"0.57412213",
"0.5... | 0.6167673 | 3 |
Midpoint of rectangle edges in data coordinates from left, moving anticlockwise. | def edge_centers(self):
x0, y0, width, height = self._rect_bbox
w = width / 2.
h = height / 2.
xe = x0, x0 + w, x0 + width, x0 + w
ye = y0 + h, y0, y0 + h, y0 + height
transform = self._get_rotation_transform()
coords = transform.transform(np.array([xe, ye]).T).T
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def midleft(self):\n return (self.left, self.centery)",
"def midright(self):\n return (self.right, self.centery)",
"def _rect_left(self):\n\treturn min(self.x, self.x + self.w)",
"def getMidPoint(self):\n return p.Point((self.start.normalVector + self.end.normalVector)/2.0)",
"def midp... | [
"0.70347476",
"0.6690122",
"0.66506374",
"0.65912557",
"0.631912",
"0.61390716",
"0.61322004",
"0.61233956",
"0.603602",
"0.5949601",
"0.5949601",
"0.5934195",
"0.5895475",
"0.5890365",
"0.58701557",
"0.5846423",
"0.58354336",
"0.5832231",
"0.5828801",
"0.58251435",
"0.581014... | 0.0 | -1 |
Return (xmin, xmax, ymin, ymax) in data coordinates as defined by the bounding box before rotation. | def extents(self):
x0, y0, width, height = self._rect_bbox
xmin, xmax = sorted([x0, x0 + width])
ymin, ymax = sorted([y0, y0 + height])
return xmin, xmax, ymin, ymax | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def bounding_box(self):\n latlon00 = self.ij_to_latlon(-1,-1)\n latlon01 = self.ij_to_latlon(-1,self.domain_size[1]+1)\n latlon11 = self.ij_to_latlon(self.domain_size[0]+1,self.domain_size[1]+1)\n latlon10 = self.ij_to_latlon(self.domain_size[0]+1,-1)\n return (latlon00,latlon01,... | [
"0.7413732",
"0.73486453",
"0.7339893",
"0.708864",
"0.70150703",
"0.6938459",
"0.69249594",
"0.67445874",
"0.6718181",
"0.6705178",
"0.6672323",
"0.6632236",
"0.6628007",
"0.6572528",
"0.65691304",
"0.65691304",
"0.6562845",
"0.65294623",
"0.65095353",
"0.6504744",
"0.648533... | 0.6682127 | 10 |
Return True if event is within the patch. | def _contains(self, event):
return self._selection_artist.contains(event, radius=0)[0] | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_is_on(self, event: Event | None) -> bool:\n if event is None:\n return False\n\n now = dt_util.utcnow()\n value = now > event.start\n if value and event.end is not None and now > event.end:\n value = False\n\n return value",
"def is_happening(self)... | [
"0.68097365",
"0.6249414",
"0.6240539",
"0.60287076",
"0.59334576",
"0.59243244",
"0.59047866",
"0.5887211",
"0.5874871",
"0.5868592",
"0.5866798",
"0.58610576",
"0.58525825",
"0.58495754",
"0.5835791",
"0.5771264",
"0.5755383",
"0.5749268",
"0.5747215",
"0.57399887",
"0.5734... | 0.6167264 | 4 |
The polygon vertices, as a list of ``(x, y)`` pairs. | def verts(self):
return self._xys[:-1] | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def vertices(self):\n return self.pointlist",
"def vertices(self) -> list[Point]:\n first_polygon_index = self.rank - max(self.pdim - 1, 1) - 1\n new_shape = self.shape[:first_polygon_index] + (-1, self.shape[-1])\n array = self.array.reshape(new_shape)\n return list(distinct(P... | [
"0.8057411",
"0.791635",
"0.77566165",
"0.75631547",
"0.7559738",
"0.74582577",
"0.7447767",
"0.7346837",
"0.73202676",
"0.72934866",
"0.72559774",
"0.7254463",
"0.7254463",
"0.72213954",
"0.7210078",
"0.7199707",
"0.7162274",
"0.7133891",
"0.7120692",
"0.71128",
"0.71124804"... | 0.67006326 | 46 |
Constructs a ResNet50 model. | def resnet50(num_classes, pretrained=False, **kwargs):
model = RetinaNet(num_classes, Bottleneck, [3, 4, 6, 3], **kwargs)
if pretrained:
model.load_state_dict(model_zoo.load_url(model_urls['resnet50'], model_dir='.'), strict=False)
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.67330164 | 21 |
Random hue color generation. Default coloring method. This just picks a random hue with value 80% and lumination 50%. | def random_color_func(word=None, font_size=None, position=None,
orientation=None, font_path=None, random_state=None):
if random_state is None:
random_state = Random()
return "hsl(%d, 80%%, 50%%)" % random_state.randint(0, 255) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _random_color():\n return random.randint(0, 255)",
"def random_color():\n colormode(255)\n return randint(0, 255), randint(0, 255), randint(0, 255)",
"def create_color():\n r = random.randint(0,255)\n g = random.randint(0,255)\n b = random.randint(0,255)\n a = random.randint(0,255)\n ... | [
"0.70620346",
"0.6891997",
"0.6792419",
"0.67835176",
"0.66990495",
"0.66986734",
"0.66773784",
"0.66443443",
"0.6620034",
"0.6615722",
"0.6573702",
"0.65287983",
"0.6527681",
"0.6524073",
"0.64940244",
"0.648225",
"0.6475802",
"0.64727634",
"0.64420676",
"0.64420676",
"0.644... | 0.66840106 | 6 |
Create a word_cloud from words and frequencies. Alias to generate_from_frequencies. | def fit_words(self, frequencies):
return self.generate_from_frequencies(frequencies) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def generate_word_cloud(frequencies):\n\n # Instantiate word cloud\n cloud = wordcloud.WordCloud()\n # Create a word_cloud from words and frequencie\n cloud.generate_from_frequencies(frequencies)\n # Export to image file.\n cloud.to_file(image_name(fname))\n # returns a numpy array\n return... | [
"0.81212765",
"0.7812255",
"0.7484308",
"0.73218256",
"0.71825165",
"0.6895883",
"0.68789667",
"0.6797427",
"0.67695713",
"0.67419934",
"0.6679116",
"0.6590123",
"0.6460475",
"0.6359317",
"0.63040876",
"0.62853265",
"0.6285213",
"0.60926384",
"0.60917515",
"0.6025833",
"0.596... | 0.65527594 | 12 |
Create a word_cloud from words and frequencies. | def generate_from_frequencies(self, frequencies, max_font_size=None): # noqa: C901
# make sure frequencies are sorted and normalized
frequencies = sorted(frequencies.items(), key=itemgetter(1), reverse=True)
if len(frequencies) <= 0:
raise ValueError("We need at least 1 word to plot... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def generate_word_cloud(frequencies):\n\n # Instantiate word cloud\n cloud = wordcloud.WordCloud()\n # Create a word_cloud from words and frequencie\n cloud.generate_from_frequencies(frequencies)\n # Export to image file.\n cloud.to_file(image_name(fname))\n # returns a numpy array\n return... | [
"0.79277295",
"0.7778919",
"0.7627412",
"0.7244997",
"0.72068214",
"0.7046453",
"0.6846549",
"0.679306",
"0.67867976",
"0.67807436",
"0.6545358",
"0.6418542",
"0.62571275",
"0.6164652",
"0.6162475",
"0.61487585",
"0.6134651",
"0.61208534",
"0.6112711",
"0.6064324",
"0.6006627... | 0.6606264 | 10 |
Splits a long text into words, eliminates the stopwords. | def process_text(self, text):
flags = (re.UNICODE if sys.version < '3' and type(text) is unicode # noqa: F821
else 0)
pattern = r"\w[\w']*" if self.min_word_length <= 1 else r"\w[\w']+"
regexp = self.regexp if self.regexp is not None else pattern
words = re.findall(re... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def remove_stopwords(text):\r\n text_split=text.split()\r\n text_split=[word for word in text_split if word not in stopwords.words('spanish')]\r\n return text_split",
"def clean_stopwords(text):\n tokens = tokenize(text)\n tokens = stopwordsRem(tokens)\n return tokens",
"def remove_stopwords(... | [
"0.75614023",
"0.7543922",
"0.72137696",
"0.71166587",
"0.71092314",
"0.70897734",
"0.70509166",
"0.7037476",
"0.70352",
"0.70307934",
"0.6969702",
"0.69339776",
"0.69157785",
"0.68782735",
"0.6873098",
"0.6834546",
"0.6821382",
"0.68197334",
"0.68114877",
"0.6799497",
"0.678... | 0.0 | -1 |
Generate wordcloud from text. The input "text" is expected to be a natural text. If you pass a sorted list of words, words will appear in your output twice. To remove this duplication, set ``collocations=False``. Calls process_text and generate_from_frequencies. | def generate_from_text(self, text):
words = self.process_text(text)
self.generate_from_frequencies(words)
return self | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create_wordcloud(self, text):\n text = ' '.join(f\"{word}\" for word in text)\n mask = np.array(Image.open(os.path.join(CURRDIR, \"cloud.png\")))\n wc = WordCloud(background_color=\"white\",\n max_words=200,\n mask=mask)\n wc.generate(text... | [
"0.7637387",
"0.7367456",
"0.68192714",
"0.6804349",
"0.67227453",
"0.6548806",
"0.6470718",
"0.6401429",
"0.628048",
"0.6260374",
"0.61283123",
"0.61060333",
"0.6075345",
"0.6032096",
"0.5981898",
"0.5936928",
"0.59244967",
"0.5919554",
"0.587042",
"0.58579004",
"0.5796464",... | 0.66931945 | 5 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.