query stringlengths 9 9.05k | document stringlengths 10 222k | metadata dict | negatives listlengths 30 30 | negative_scores listlengths 30 30 | document_score stringlengths 4 10 | document_rank stringclasses 2
values |
|---|---|---|---|---|---|---|
Derive the XRP Ledger classic address for a given public key. See `Address Derivation | def derive_classic_address(public_key: str) -> str:
account_id = get_account_id(bytes.fromhex(public_key))
return addresscodec.encode_classic_address(account_id) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def public_key_to_address(public_key: PublicKey) -> Address:\n key_bytes = public_key.format(compressed=False)\n return Address(keccak(key_bytes[1:])[-20:])",
"def make_address(pubkeys, n):\n return (str(len(pubkeys)) + str(n) +\n base58_encode(det_hash({str(n): pubkeys}))[0:29])",
"def add... | [
"0.6908002",
"0.65739316",
"0.6494099",
"0.64582336",
"0.6417738",
"0.62695605",
"0.6239572",
"0.61835045",
"0.61489314",
"0.6091104",
"0.60560876",
"0.6004907",
"0.5947979",
"0.5947319",
"0.58912",
"0.58856183",
"0.5885251",
"0.5810801",
"0.57976496",
"0.57869506",
"0.576505... | 0.79825044 | 0 |
>>> transform(["A1", "a12", "C3", "a"], ... pipelines = ["lower", "wordlen", "digit"]) ['aDIGIT', 'aDIGITDIGIT', 'cDIGIT'] >>> transform("A1 a12 C3", pipelines = ["lower", "digit"]) 'aDIGIT aDIGITDIGIT cDIGIT' >>> transform("Giving it to me generously", pipelines = ["tokenize", "stem"]) [u'give', 'it', 'to', 'me', u'ge... | def transform(stuff, pipelines=DEFAULT_PIPELINE_NAMES):
global _pipelines
for name in pipelines:
p = load_pipeline(name)
stuff = p.transform(stuff)
return stuff | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def preprocess(tokens):\n result = []\n for token in tokens:\n result.append(token.lower())\n return result",
"def transform():",
"def lowercase(tokens):\n if not lowercase_activated:\n return tokens\n output = [token.lower() for token in tokens]\n return output",
"def pipeline(args) :\n ... | [
"0.60125333",
"0.5829286",
"0.56065935",
"0.5538371",
"0.5499318",
"0.5442214",
"0.543752",
"0.5435842",
"0.54205114",
"0.532932",
"0.528591",
"0.52655125",
"0.5255835",
"0.52517915",
"0.5249377",
"0.52475965",
"0.5235342",
"0.5220681",
"0.521549",
"0.5214038",
"0.51283956",
... | 0.6446863 | 0 |
If this project is at path, what's the current env prefix?. | def env_prefix(self, path):
if self.is_default:
return self.root # FIXME: Is this guaranteed to be the right one?
return os.sep.join([path, PROJECT_ENVS_FOLDER,
self.default_environment]) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def home():\n if sys.prefix == sys.exec_prefix:\n return sys.prefix\n else:\n return ':'.join((sys.prefix, sys.exec_prefix))",
"def sys_prefix(self):\n return self._path_sys_prefix",
"def env_path(env):\n host = socket.gethostname()\n if host.startswith('maven-iuvs-itf'):\n ... | [
"0.7150446",
"0.6895923",
"0.67592335",
"0.6513812",
"0.64808065",
"0.6462334",
"0.6434505",
"0.6434505",
"0.63780916",
"0.63779354",
"0.6370792",
"0.6351106",
"0.6319227",
"0.628509",
"0.6247382",
"0.6235313",
"0.61978865",
"0.6190227",
"0.61851305",
"0.6182196",
"0.61596155... | 0.76831925 | 0 |
Report curated stopwords lists in database | def query_stopwords_lists():
found = flask.g.db.find(tesserae.db.entities.StopwordsList.collection)
return flask.jsonify({'list_names': [a.name for a in found]}) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def getStopWords(self):\n\t\treturn self.stop_words",
"def build_stopwords():\r\n\tprint('\\nbuilding stopwords')\r\n\t\r\n\tif load_stopwords():\r\n\t\treturn\r\n\r\n\tglobal stopwords\r\n\tstopwords = nltk.corpus.stopwords.words('english')\r\n\tfor f in os.listdir(paths.path_data_stopwords):\r\n\t\tpath_stopwo... | [
"0.678712",
"0.6768676",
"0.6751135",
"0.67284197",
"0.6684778",
"0.6610801",
"0.6582758",
"0.6491409",
"0.6442",
"0.6439823",
"0.643774",
"0.638284",
"0.63779664",
"0.6335158",
"0.6313454",
"0.63112855",
"0.6294782",
"0.62929267",
"0.6278759",
"0.62734073",
"0.6237022",
"0... | 0.7189156 | 0 |
Validates the given password in a request data. First, checks if it exists, then check if the password has the necessary length | def validate_password(data):
if "password" not in data:
return False
password = data["password"]
if len(password) < 4 or len(password) > 16:
return False
return True | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def validate(self, data):\n password = data['password']\n if data['password'] == data['password2'] and re.fullmatch(r'[A-Za-z0-9@#$%^&+=]{8,}', password):\n return data\n raise serializers.ValidationError(\"Password should be match and password must have number,special char,1-capita... | [
"0.75851166",
"0.74440527",
"0.7292162",
"0.72649544",
"0.7264225",
"0.72577757",
"0.7219791",
"0.7198216",
"0.71466994",
"0.7124518",
"0.711993",
"0.7094221",
"0.70784444",
"0.70513403",
"0.70257604",
"0.702355",
"0.70204043",
"0.70114267",
"0.70080715",
"0.7007405",
"0.7006... | 0.8300383 | 0 |
Check if the given parameter is the the data request. If max or min parameters are present, it checks for the parameter length | def check_parameter(data, parameter, min_length=None, max_length=None):
if parameter not in data:
return False
if min_length is not None and len(data[parameter]) < min_length:
return False
if max_length is not None and len(data[parameter]) > max_length:
return False
return Tr... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _check_parameter(self, data):\n return self._pre_process_record(data) is not None",
"def _check_params_do(name, val):\n if name == 'info_hash':\n return len(val) == 20\n elif name == 'peer_id':\n return len(val) == 20 and STORAGE.check_peer(val)\n elif name == 'numwant':\n ... | [
"0.6822853",
"0.65631634",
"0.6378732",
"0.6279042",
"0.6272768",
"0.62700856",
"0.61766195",
"0.61737126",
"0.614143",
"0.6139324",
"0.59103984",
"0.5892264",
"0.5885295",
"0.58831775",
"0.5879124",
"0.58140653",
"0.5812621",
"0.5802322",
"0.5733666",
"0.572215",
"0.5705977"... | 0.8038426 | 0 |
Sets the slug of this Project. | def slug(self, slug):
if self.local_vars_configuration.client_side_validation and slug is None: # noqa: E501
raise ValueError("Invalid value for `slug`, must not be `None`") # noqa: E501
self._slug = slug | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_slug(self, slug):\n if self.slug is None:\n self.slug = slug",
"def set_slug(self):\n if not self.slug:\n self.slug = slugify(self.name)[:50]",
"def slug(self, slug):\n if slug is None:\n raise ValueError(\"Invalid value for `slug`, must not be `Non... | [
"0.796629",
"0.7526107",
"0.6902236",
"0.681357",
"0.6725959",
"0.65915906",
"0.6463094",
"0.64255965",
"0.63822144",
"0.62079984",
"0.61545795",
"0.615259",
"0.6099709",
"0.6099709",
"0.59585214",
"0.582201",
"0.5819328",
"0.5795239",
"0.5752186",
"0.56858486",
"0.5665566",
... | 0.7589352 | 1 |
Use matplotlib to plot the distribution for this dataset and save to a distribution folder. | def VisualizeDistribution(dataset, distribution, title, filename):
# create the output directory if it doesn't exist
if not os.path.exists('distributions'):
os.mkdir('distributions')
if not os.path.exists('distributions/{}'.format(dataset)):
os.mkdir('distributions/{}'.format(dataset))
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def make_distplot(data, output_f, title, xlabel, prefix):\n\n plt.figure(figsize=(8, 8), dpi=1200)\n displot = sns.distplot(data, hist=False, rug=True, color=\"b\")\n out_name = prefix + \"_\" + title + \"_\" + output_f.split(\".\")[0] + \".pdf\"\n plt.title(title)\n plt.xlabel(xlabel)\n plt.ylab... | [
"0.7060648",
"0.6796554",
"0.67723703",
"0.6626907",
"0.66211027",
"0.6552075",
"0.6536823",
"0.6517081",
"0.6473652",
"0.6473216",
"0.64082044",
"0.6380164",
"0.6362191",
"0.6336681",
"0.6335067",
"0.6296804",
"0.6282182",
"0.6239267",
"0.6237701",
"0.617915",
"0.6177249",
... | 0.6926774 | 1 |
Plot function distributions for the dataset given the traces. Traces should contain all of the request types. | def FunctionDistribution(traces):
dataset = traces[0].dataset
# not implemented for xtrace
assert (not dataset == 'xtrace')
trace_functions = GetUniqueFunctions(traces)
# begin to keep track of the distributions
timestamp_distributions = {}
for function in trace_functions:
timestam... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def RequestTypesDistribution(traces):\n dataset = traces[0].dataset\n trace_request_types = request_types_per_dataset[dataset]\n\n # begin to keep track of the distributions\n timestamp_distributions = {}\n for request_type in trace_request_types:\n timestamp_distributions[request_type] = []\... | [
"0.67744714",
"0.56076676",
"0.55734074",
"0.5566542",
"0.54650396",
"0.5451446",
"0.538683",
"0.5368104",
"0.5338481",
"0.5286707",
"0.5284831",
"0.5279412",
"0.5274037",
"0.52355736",
"0.5234768",
"0.52345073",
"0.52033955",
"0.5146973",
"0.51464826",
"0.51106936",
"0.51006... | 0.6823208 | 0 |
Plot request type distributions for the dataset given the traces. Traces should contain all of the request types. | def RequestTypesDistribution(traces):
dataset = traces[0].dataset
trace_request_types = request_types_per_dataset[dataset]
# begin to keep track of the distributions
timestamp_distributions = {}
for request_type in trace_request_types:
timestamp_distributions[request_type] = []
for tra... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def plotTrace(trace):\n for t in trace:\n plt.plot(range(len(t)),t,alpha=0.5)\n plt.ylabel(\"Trace\")\n plt.xlabel(\"Step\")\n\n return",
"def plot_dists(types, color='b', labels=None, scale=0):\n bottom = 0\n for type in types:\n if len(type) > 100:\n plot(type + botto... | [
"0.54799914",
"0.5460333",
"0.53947544",
"0.53878444",
"0.5232395",
"0.521433",
"0.51769793",
"0.51486534",
"0.5123348",
"0.51012653",
"0.50285596",
"0.50115",
"0.49778795",
"0.49646565",
"0.49596384",
"0.49208415",
"0.49081427",
"0.48714355",
"0.4849813",
"0.48449668",
"0.48... | 0.8093829 | 0 |
Implementation of the EM algorithm for Gaussian Mixtures | def em(means=None, filename='sample-data.txt', visualize=False):
data = load_data(filename)
if means is None:
means = [min(data), max(data)]
num_of_mixtures, dimensions = len(data), 1 # Number of mixtures, dimension of mixture
num_of_measures = len(means) # Number of Gaussians
for iterati... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_gaussian_em():\n fname = \"gmm-3-10-0.7.npz\"\n gmm = GaussianMixtureModel.generate( fname, 3, 3 )\n k, d, M, S, w = gmm.k, gmm.d, gmm.means, gmm.sigmas, gmm.weights\n N, n = 1e6, 1e5\n\n\n X = gmm.sample( N, n )\n\n algo = GaussianMixtureEM(k, d)\n\n def report( i, O_, lhood ):\n ... | [
"0.77984655",
"0.66064805",
"0.64965653",
"0.6347482",
"0.634626",
"0.63440096",
"0.6274878",
"0.6264507",
"0.62508804",
"0.62486583",
"0.6203272",
"0.6155886",
"0.61462516",
"0.60989",
"0.607767",
"0.6058191",
"0.6032664",
"0.6017044",
"0.60167384",
"0.59975773",
"0.59806633... | 0.6811105 | 1 |
Returns GUID for UAttribute identifying assembly | def AssemblyGUID(*args):
return _XCAFDoc.xcafdoc_AssemblyGUID(*args) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def guid():\n return _guid64()",
"def read_guid(self):\n return ''.join(self.hextostring(i) for i in self.read('bytes:16'))",
"def cal_guid(self):\n return 'setup' + str(self.id) + '@lnldb'",
"def external_id(self) -> str:\n return self._search_in_properties(ATTR_GUID)",
"def get_ui... | [
"0.6078024",
"0.5897933",
"0.58824354",
"0.5790208",
"0.577738",
"0.57680875",
"0.5707162",
"0.5700074",
"0.5648697",
"0.56345814",
"0.5631691",
"0.5631691",
"0.56027085",
"0.5575865",
"0.55649006",
"0.553303",
"0.55290157",
"0.55278707",
"0.54960537",
"0.5478506",
"0.5461718... | 0.6179877 | 0 |
GetHandle(XCAFDoc_Area self) > Handle_XCAFDoc_Area | def GetHandle(self):
return _XCAFDoc.XCAFDoc_Area_GetHandle(self) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def GetHandle(self):\n return _XCAFDoc.XCAFDoc_DocumentTool_GetHandle(self)",
"def GetHandle(self):\n return _XCAFDoc.XCAFDoc_Location_GetHandle(self)",
"def GetHandle(self):\n return _XCAFDoc.XCAFDoc_ShapeTool_GetHandle(self)",
"def GetHandle(self):\n return _XCAFDoc.XCAFDoc_Datu... | [
"0.7658978",
"0.7427052",
"0.68759",
"0.663946",
"0.6438312",
"0.6387188",
"0.6387188",
"0.6387188",
"0.635635",
"0.6247943",
"0.61221",
"0.6118313",
"0.6048052",
"0.60293967",
"0.5949275",
"0.59240675",
"0.5905359",
"0.5880251",
"0.58611053",
"0.5831334",
"0.57279545",
"0.... | 0.85335845 | 0 |
GetHandle(XCAFDoc_Centroid self) > Handle_XCAFDoc_Centroid | def GetHandle(self):
return _XCAFDoc.XCAFDoc_Centroid_GetHandle(self) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def GetHandle(self):\n return _XCAFDoc.XCAFDoc_Area_GetHandle(self)",
"def GetHandle(self):\n return _XCAFDoc.XCAFDoc_Location_GetHandle(self)",
"def GetHandle(self):\n return _XCAFDoc.XCAFDoc_ShapeTool_GetHandle(self)",
"def GetHandle(self):\n return _XCAFDoc.XCAFDoc_Datum_GetHan... | [
"0.69679046",
"0.67520833",
"0.64800406",
"0.63999414",
"0.63876307",
"0.62216216",
"0.6220428",
"0.6173015",
"0.6099408",
"0.57988256",
"0.5797227",
"0.57547003",
"0.5705365",
"0.5642578",
"0.56314695",
"0.5601655",
"0.549372",
"0.5471202",
"0.5463457",
"0.54530865",
"0.5436... | 0.8943006 | 0 |
GetHandle(XCAFDoc_Color self) > Handle_XCAFDoc_Color | def GetHandle(self):
return _XCAFDoc.XCAFDoc_Color_GetHandle(self) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def GetHandle(self):\n return _XCAFDoc.XCAFDoc_ColorTool_GetHandle(self)",
"def xcafdoc_ColorRefGUID(*args):\n return _XCAFDoc.xcafdoc_ColorRefGUID(*args)",
"def ColorRefGUID(*args):\n return _XCAFDoc.xcafdoc_ColorRefGUID(*args)",
"def _get_color(self):\n return self.__color",
"def _get_c... | [
"0.8104613",
"0.66229",
"0.65994316",
"0.6442314",
"0.6442314",
"0.6442314",
"0.6442314",
"0.6187657",
"0.6181179",
"0.6150998",
"0.6041303",
"0.6041303",
"0.6041303",
"0.60338604",
"0.6011496",
"0.6010033",
"0.59847313",
"0.59754735",
"0.59510344",
"0.5942515",
"0.58972985",... | 0.8912441 | 0 |
Returns True if label belongs to a colortable and is a color definition | def IsColor(self, *args):
return _XCAFDoc.XCAFDoc_ColorTool_IsColor(self, *args) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def hasColor(self, color):\n if type(color) is not int:\n raise TypeError( \"Color must be of type int.\" )\n else:\n return color in self.__colordict__",
"def _is_color(cls, obj: Any) -> bool:\n\n return isinstance(obj, Color)",
"def isColor(self,color):\n ret... | [
"0.64526236",
"0.62971026",
"0.6285392",
"0.62022775",
"0.6110802",
"0.6031384",
"0.59021604",
"0.58788764",
"0.5845031",
"0.5823279",
"0.5791389",
"0.57898664",
"0.57714206",
"0.57447094",
"0.57083994",
"0.56679016",
"0.5656221",
"0.56216264",
"0.5603148",
"0.5591806",
"0.55... | 0.64202386 | 1 |
Removes color from the colortable | def RemoveColor(self, *args):
return _XCAFDoc.XCAFDoc_ColorTool_RemoveColor(self, *args) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def remove_color(image):\n return image[:, :, 0]",
"def remove_color(image):\n return image[:, :, 0]",
"def clear_colors(self):\n for r in range(0, self.maze.get_nrows()):\n for c in range(0, self.maze.get_ncols()):\n self.set_color((r, c), 'white', draw=False)\n\n ... | [
"0.6786826",
"0.6786826",
"0.66612566",
"0.6644778",
"0.6595698",
"0.6406655",
"0.6383399",
"0.63792944",
"0.63675344",
"0.6313082",
"0.62956643",
"0.61715037",
"0.61315024",
"0.60875416",
"0.59666085",
"0.5956003",
"0.59323496",
"0.5929157",
"0.5890619",
"0.5843861",
"0.5829... | 0.72043014 | 0 |
GetHandle(XCAFDoc_ColorTool self) > Handle_XCAFDoc_ColorTool | def GetHandle(self):
return _XCAFDoc.XCAFDoc_ColorTool_GetHandle(self) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def GetHandle(self):\n return _XCAFDoc.XCAFDoc_Color_GetHandle(self)",
"def ColorTool(*args):\n return _XCAFDoc.XCAFDoc_DocumentTool_ColorTool(*args)",
"def GetHandle(self):\n return _XCAFDoc.XCAFDoc_LayerTool_GetHandle(self)",
"def XCAFDoc_DocumentTool_ColorTool(*args):\n return _XCAFD... | [
"0.8098736",
"0.6836184",
"0.682535",
"0.6717605",
"0.66324335",
"0.6359272",
"0.63113564",
"0.61795515",
"0.61737233",
"0.6116002",
"0.60427934",
"0.60427934",
"0.60427934",
"0.60427934",
"0.59252006",
"0.59164727",
"0.5911416",
"0.58341306",
"0.583385",
"0.57374656",
"0.563... | 0.8993267 | 0 |
GetHandle(XCAFDoc_DataMapNodeOfDataMapOfShapeLabel self) > Handle_XCAFDoc_DataMapNodeOfDataMapOfShapeLabel | def GetHandle(self):
return _XCAFDoc.XCAFDoc_DataMapNodeOfDataMapOfShapeLabel_GetHandle(self) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def GetHandle(self):\n return _XCAFDoc.XCAFDoc_ShapeMapTool_GetHandle(self)",
"def GetHandle(self):\n return _XCAFDoc.XCAFDoc_Datum_GetHandle(self)",
"def GetHandle(self):\n return _XCAFDoc.XCAFDoc_GraphNode_GetHandle(self)",
"def GetHandle(self):\n return _XCAFDoc.XCAFDoc_ShapeTo... | [
"0.6366256",
"0.61955047",
"0.5681903",
"0.56116325",
"0.5543956",
"0.5464214",
"0.5448683",
"0.5275408",
"0.5266241",
"0.52305824",
"0.516179",
"0.51140016",
"0.51061136",
"0.50952727",
"0.5081437",
"0.5066383",
"0.50352293",
"0.49858585",
"0.49293312",
"0.49205905",
"0.4912... | 0.9172001 | 0 |
GetHandle(XCAFDoc_Datum self) > Handle_XCAFDoc_Datum | def GetHandle(self):
return _XCAFDoc.XCAFDoc_Datum_GetHandle(self) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def GetHandle(self):\n return _XCAFDoc.XCAFDoc_DocumentTool_GetHandle(self)",
"def GetHandle(self):\n return _XCAFDoc.XCAFDoc_Location_GetHandle(self)",
"def _handle(self):\n return self.__handle",
"def _handle(self):\n return self.__handle",
"def _handle(self):\n return ... | [
"0.75528026",
"0.6996127",
"0.6816913",
"0.6816913",
"0.6816913",
"0.68045187",
"0.67667145",
"0.6572347",
"0.63444126",
"0.63263375",
"0.6244135",
"0.62307805",
"0.6171986",
"0.61591685",
"0.6135778",
"0.6020051",
"0.6020051",
"0.59376246",
"0.59116167",
"0.59023327",
"0.588... | 0.84550434 | 0 |
GetHandle(XCAFDoc_DimTol self) > Handle_XCAFDoc_DimTol | def GetHandle(self):
return _XCAFDoc.XCAFDoc_DimTol_GetHandle(self) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def GetHandle(self):\n return _XCAFDoc.XCAFDoc_DimTolTool_GetHandle(self)",
"def IsDimTol(self, *args):\n return _XCAFDoc.XCAFDoc_DimTolTool_IsDimTol(self, *args)",
"def xcafdoc_DimTolRefGUID(*args):\n return _XCAFDoc.xcafdoc_DimTolRefGUID(*args)",
"def DimTolRefGUID(*args):\n return _X... | [
"0.74729156",
"0.63717234",
"0.6266116",
"0.62398034",
"0.6237406",
"0.6140706",
"0.5869023",
"0.57485473",
"0.54284316",
"0.5396972",
"0.5301787",
"0.5051785",
"0.50461966",
"0.50461966",
"0.5042676",
"0.49681082",
"0.47810858",
"0.47597393",
"0.47546908",
"0.47365847",
"0.4... | 0.7904426 | 0 |
Returns True if label belongs to a dimtoltable and is a DimTol definition | def IsDimTol(self, *args):
return _XCAFDoc.XCAFDoc_DimTolTool_IsDimTol(self, *args) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def has_dimension(self, dim):\n\n return self.units.dimensions == dim",
"def is_label_dataframe(label, df):\n\n setdiff = set(label) - set(df.columns.tolist())\n\n if len(setdiff) == 0:\n return True\n else:\n return False",
"def IsDatum(self, *args):\n return _XCAFDoc.XCAF... | [
"0.58551264",
"0.5809031",
"0.5772506",
"0.5668312",
"0.55064434",
"0.54686344",
"0.5461858",
"0.5439535",
"0.5414709",
"0.54123586",
"0.5410039",
"0.54077226",
"0.5405389",
"0.5403629",
"0.5369551",
"0.5365091",
"0.536253",
"0.5361802",
"0.53552604",
"0.5322496",
"0.5321924"... | 0.7310294 | 0 |
Adds a dimtol definition to a DGTtable and returns its label | def AddDimTol(self, *args):
return _XCAFDoc.XCAFDoc_DimTolTool_AddDimTol(self, *args) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create_dimension_labels(gll, parameters: list):\n dimstr = '[ ' + ' | '.join(parameters) + ' ]'\n gll['MODEL/data'].dims[0].label = 'element'\n gll['MODEL/data'].dims[1].label = dimstr\n gll['MODEL/data'].dims[2].label = 'point'",
"def test_get_dim_label_with_label(self):\n\n dim = self.oe... | [
"0.59738964",
"0.5906462",
"0.57940304",
"0.5609852",
"0.54768217",
"0.543794",
"0.5385241",
"0.53756875",
"0.5288455",
"0.52536017",
"0.52069294",
"0.5200376",
"0.517597",
"0.51514083",
"0.50938714",
"0.5077574",
"0.5065387",
"0.5061257",
"0.5026648",
"0.49902347",
"0.498502... | 0.5967316 | 1 |
Returns ShapeL defined for label DimTolL Returns False if the DimTolL is not in DGTtable | def GetRefShapeLabel(self, *args):
return _XCAFDoc.XCAFDoc_DimTolTool_GetRefShapeLabel(self, *args) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def IsDimTol(self, *args):\n return _XCAFDoc.XCAFDoc_DimTolTool_IsDimTol(self, *args)",
"def GetDimTolLabels(self, *args):\n return _XCAFDoc.XCAFDoc_DimTolTool_GetDimTolLabels(self, *args)",
"def is_lattice(self):\n return hasattr(self,\"uc\") and len(self.maximals())==1 and type(self.get_... | [
"0.57014185",
"0.5184365",
"0.51309747",
"0.5129677",
"0.5125075",
"0.5070401",
"0.5048329",
"0.5008115",
"0.49986407",
"0.4974987",
"0.4951889",
"0.49402174",
"0.4930865",
"0.48698083",
"0.48636153",
"0.48332042",
"0.4811649",
"0.48056126",
"0.47954533",
"0.47868782",
"0.477... | 0.5756969 | 0 |
Returns True if label belongs to a dimtoltable and is a Datum definition | def IsDatum(self, *args):
return _XCAFDoc.XCAFDoc_DimTolTool_IsDatum(self, *args) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def isDataLabel(self, label):\n\n if label in self._data:\n return True\n else:\n try:\n return self._getData(label) is not None\n except:\n return False",
"def is_label_dataframe(label, df):\n\n setdiff = set(label) - set(df.columns... | [
"0.6272274",
"0.617111",
"0.60161626",
"0.5917395",
"0.58208036",
"0.5818427",
"0.56999505",
"0.56813335",
"0.5640628",
"0.56257695",
"0.5604382",
"0.5597692",
"0.55590403",
"0.55531365",
"0.5552956",
"0.55464333",
"0.55000174",
"0.5476007",
"0.54670805",
"0.54667634",
"0.543... | 0.67929995 | 0 |
Adds a datum definition to a DGTtable and returns its label | def AddDatum(self, *args):
return _XCAFDoc.XCAFDoc_DimTolTool_AddDatum(self, *args) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def add_dt_needed(self, op):\n d_tag = AssemblerVariable((\"d_tag, DT_NEEDED = 1\", PlatformVar(\"addr\"), 1))\n d_un = AssemblerVariable((\"d_un, library name offset in strtab\", PlatformVar(\"addr\"), \"strtab_%s - strtab\" % labelify(op)))\n self.__data[0:0] = [d_tag, d_un]\n self.refresh_name_label... | [
"0.5844228",
"0.5499535",
"0.5489146",
"0.54649323",
"0.5431003",
"0.54011226",
"0.53575957",
"0.53434986",
"0.53230244",
"0.5302561",
"0.5277871",
"0.5272544",
"0.5255399",
"0.5239526",
"0.5228931",
"0.52080935",
"0.5200731",
"0.516772",
"0.5158996",
"0.5149601",
"0.5135362"... | 0.5766687 | 1 |
GetHandle(XCAFDoc_DimTolTool self) > Handle_XCAFDoc_DimTolTool | def GetHandle(self):
return _XCAFDoc.XCAFDoc_DimTolTool_GetHandle(self) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def GetHandle(self):\n return _XCAFDoc.XCAFDoc_DimTol_GetHandle(self)",
"def XCAFDoc_DocumentTool_DimTolTool(*args):\n return _XCAFDoc.XCAFDoc_DocumentTool_DimTolTool(*args)",
"def DimTolTool(*args):\n return _XCAFDoc.XCAFDoc_DocumentTool_DimTolTool(*args)",
"def XCAFDoc_DimTolTool_Set(*args):... | [
"0.74157774",
"0.65544873",
"0.64640605",
"0.6126373",
"0.5983598",
"0.59341",
"0.58824724",
"0.5862566",
"0.5714889",
"0.56342876",
"0.54033387",
"0.5318052",
"0.5240431",
"0.5207045",
"0.5171256",
"0.51223946",
"0.512039",
"0.4930363",
"0.4930363",
"0.4929334",
"0.48016128"... | 0.7914567 | 0 |
Creates (if it does not exist) ColorTool attribute on ColorsLabel(). | def ColorTool(*args):
return _XCAFDoc.XCAFDoc_DocumentTool_ColorTool(*args) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def XCAFDoc_ColorTool_Set(*args):\n return _XCAFDoc.XCAFDoc_ColorTool_Set(*args)",
"def BaseLabel(self, *args):\n return _XCAFDoc.XCAFDoc_ColorTool_BaseLabel(self, *args)",
"def AddColor(self, *args):\n return _XCAFDoc.XCAFDoc_ColorTool_AddColor(self, *args)",
"def XCAFDoc_DocumentTool_ColorsL... | [
"0.6334686",
"0.630706",
"0.62998337",
"0.62438565",
"0.61255366",
"0.6032502",
"0.59864783",
"0.59810394",
"0.5910097",
"0.58813584",
"0.577475",
"0.5732262",
"0.5665521",
"0.56618524",
"0.5659319",
"0.5612831",
"0.5605165",
"0.56006634",
"0.56006634",
"0.56006634",
"0.56006... | 0.6335173 | 0 |
Creates (if it does not exist) LayerTool attribute on LayersLabel(). | def LayerTool(*args):
return _XCAFDoc.XCAFDoc_DocumentTool_LayerTool(*args) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def name(self):\n return \"Separate Layers\"",
"def CreateLayer(self,layername):\n\t\treturn self.acad.ActiveDocument.Layers.Add(layername)",
"def LayersLabel(*args):\n return _XCAFDoc.XCAFDoc_DocumentTool_LayersLabel(*args)",
"def AddLayer(self, *args):\n return _XCAFDoc.XCAFDoc_LayerTo... | [
"0.6139833",
"0.606272",
"0.60071105",
"0.5996474",
"0.59876555",
"0.5961572",
"0.5845542",
"0.5706362",
"0.56754786",
"0.5649459",
"0.56273097",
"0.5604624",
"0.5571931",
"0.55158263",
"0.54785407",
"0.54752815",
"0.54628843",
"0.5453345",
"0.54445577",
"0.54272723",
"0.5426... | 0.6250534 | 0 |
Creates (if it does not exist) DimTolTool attribute on DGTsLabel(). | def DimTolTool(*args):
return _XCAFDoc.XCAFDoc_DocumentTool_DimTolTool(*args) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def XCAFDoc_DimTolTool_Set(*args):\n return _XCAFDoc.XCAFDoc_DimTolTool_Set(*args)",
"def BaseLabel(self, *args):\n return _XCAFDoc.XCAFDoc_DimTolTool_BaseLabel(self, *args)",
"def AddDimTol(self, *args):\n return _XCAFDoc.XCAFDoc_DimTolTool_AddDimTol(self, *args)",
"def XCAFDoc_DocumentTool_D... | [
"0.5961165",
"0.59201443",
"0.5907676",
"0.56737274",
"0.5530479",
"0.5432595",
"0.54286987",
"0.5425379",
"0.5400868",
"0.51807266",
"0.5127742",
"0.51109487",
"0.5058018",
"0.50395733",
"0.50299007",
"0.50273126",
"0.49820763",
"0.4964433",
"0.4959769",
"0.49110803",
"0.489... | 0.60123426 | 0 |
GetHandle(XCAFDoc_DocumentTool self) > Handle_XCAFDoc_DocumentTool | def GetHandle(self):
return _XCAFDoc.XCAFDoc_DocumentTool_GetHandle(self) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def GetHandle(self):\n return _XCAFDoc.XCAFDoc_LayerTool_GetHandle(self)",
"def GetHandle(self):\n return _XCAFDoc.XCAFDoc_ShapeTool_GetHandle(self)",
"def GetHandle(self):\n return _XCAFDoc.XCAFDoc_Location_GetHandle(self)",
"def GetHandle(self):\n return _XCAFDoc.XCAFDoc_DimTolT... | [
"0.7455754",
"0.6931428",
"0.66476345",
"0.6623934",
"0.6550869",
"0.6501895",
"0.6431861",
"0.63170695",
"0.63170695",
"0.63170695",
"0.62756765",
"0.62405974",
"0.61775637",
"0.6002958",
"0.5924853",
"0.5886811",
"0.5752713",
"0.5705441",
"0.5695233",
"0.5656978",
"0.564949... | 0.8623809 | 0 |
returns True if is father of . | def IsFather(self, *args):
return _XCAFDoc.XCAFDoc_GraphNode_IsFather(self, *args) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def islchild(self):\n\t\tif (self.parent() and self.parent().lchild() is self): #TODO is or == here\n\t\t\treturn True\n\t\treturn False",
"def hasSiblings():",
"def _is_child(self, parent, child): # type: (str, str) -> bool\n return child != parent and child.startswith(parent + \".\")",
"def semilea... | [
"0.70178443",
"0.66002506",
"0.65074867",
"0.6407762",
"0.63835037",
"0.63127315",
"0.62792045",
"0.6268684",
"0.6250241",
"0.62382215",
"0.6223886",
"0.619892",
"0.61479896",
"0.6115113",
"0.61002964",
"0.60839266",
"0.60812485",
"0.6068538",
"0.6056713",
"0.59988207",
"0.59... | 0.7007414 | 1 |
GetHandle(XCAFDoc_GraphNode self) > Handle_XCAFDoc_GraphNode | def GetHandle(self):
return _XCAFDoc.XCAFDoc_GraphNode_GetHandle(self) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def GetHandle(self):\n return _XCAFDoc.XCAFDoc_SequenceNodeOfGraphNodeSequence_GetHandle(self)",
"def GetHandle(self):\n return _XCAFDoc.XCAFDoc_Datum_GetHandle(self)",
"def handle(self) -> int:\n return self.obj.handle",
"def _handle(self):\n return self.__handle",
"def _handle... | [
"0.71779406",
"0.6487147",
"0.62877727",
"0.6204641",
"0.6204641",
"0.6204641",
"0.6115982",
"0.6114502",
"0.61003995",
"0.59996766",
"0.59311026",
"0.59248745",
"0.58747214",
"0.58697426",
"0.58584565",
"0.58584565",
"0.58161473",
"0.57734334",
"0.57058376",
"0.5705069",
"0.... | 0.89129454 | 0 |
Finds a Layer definition in a Layertable and returns its label if found Returns False if Layer is not found in Layertable | def FindLayer(self, *args):
return _XCAFDoc.XCAFDoc_LayerTool_FindLayer(self, *args) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def find_layer_by_name(self, layer_name):\n return next(x for x in self.layers if x.name == layer_name)",
"def findLayer(job, layer):\n return Layer(Cuebot.getStub('layer').FindLayer(\n job_pb2.LayerFindLayerRequest(job=job, layer=layer), timeout=Cuebot.Timeout).layer)",
"def find_layer_from_n... | [
"0.66557556",
"0.64497113",
"0.6439253",
"0.64353395",
"0.6270746",
"0.6222217",
"0.6154202",
"0.6135019",
"0.60864544",
"0.60630524",
"0.59940374",
"0.5992934",
"0.59700507",
"0.59536654",
"0.5893273",
"0.5880945",
"0.58316004",
"0.5825735",
"0.5773521",
"0.5771699",
"0.5756... | 0.673959 | 0 |
Adds a Layer definition to a Layertable and returns its label (returns existing label if the same Layer is already defined) | def AddLayer(self, *args):
return _XCAFDoc.XCAFDoc_LayerTool_AddLayer(self, *args) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def add_layer(self, layer_name, layer_def):\n\n layer_idx, datatype = layer_def.split(\"/\")\n layer_idx = int(layer_idx)\n datatype = int(datatype)\n self.layers[layer_name] = LayerInfo(layer_idx, datatype, layer_name)",
"def add_layer(self, layer):\n idx = len(self.dict_topo)... | [
"0.7414225",
"0.68206793",
"0.66381377",
"0.66049254",
"0.6564238",
"0.6521873",
"0.65167004",
"0.6282692",
"0.62406117",
"0.6181209",
"0.6162818",
"0.61272866",
"0.61198175",
"0.61023545",
"0.6062883",
"0.6055864",
"0.6014945",
"0.5976023",
"0.5968406",
"0.5953451",
"0.59342... | 0.6847159 | 1 |
Set the visibility of layer. If layer is invisible when on it's layer will set UAttribute with corresponding GUID. | def SetVisibility(self, *args):
return _XCAFDoc.XCAFDoc_LayerTool_SetVisibility(self, *args) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_layer_visibility(self, layer_visibility):\n # type: (Map, str) -> None\n\n if not layer_visibility:\n raise ValueError(\"Layer visibility cannot be None.\")\n\n try:\n (layers_op, layers_list) = [s.strip() for s in layer_visibility.split(\":\")]\n layer... | [
"0.70014507",
"0.63828754",
"0.63828754",
"0.63828754",
"0.62218803",
"0.6174513",
"0.6147173",
"0.60279775",
"0.5532496",
"0.5522544",
"0.55200034",
"0.5509768",
"0.5469404",
"0.54626036",
"0.5449305",
"0.5449305",
"0.54353184",
"0.542113",
"0.5417737",
"0.5323441",
"0.53098... | 0.67609614 | 1 |
GetHandle(XCAFDoc_LayerTool self) > Handle_XCAFDoc_LayerTool | def GetHandle(self):
return _XCAFDoc.XCAFDoc_LayerTool_GetHandle(self) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def GetHandle(self):\n return _XCAFDoc.XCAFDoc_MaterialTool_GetHandle(self)",
"def XCAFDoc_DocumentTool_LayerTool(*args):\n return _XCAFDoc.XCAFDoc_DocumentTool_LayerTool(*args)",
"def GetHandle(self):\n return _XCAFDoc.XCAFDoc_DocumentTool_GetHandle(self)",
"def GetHandle(self):\n retu... | [
"0.68513864",
"0.67969126",
"0.6793304",
"0.675534",
"0.67431355",
"0.66945094",
"0.6641841",
"0.65670335",
"0.6145601",
"0.58399326",
"0.58338124",
"0.55501807",
"0.5541221",
"0.5532987",
"0.5518243",
"0.5518243",
"0.5518243",
"0.5434558",
"0.54152423",
"0.53158253",
"0.5280... | 0.89320946 | 0 |
GetHandle(XCAFDoc_Location self) > Handle_XCAFDoc_Location | def GetHandle(self):
return _XCAFDoc.XCAFDoc_Location_GetHandle(self) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def GetHandle(self):\n return _XCAFDoc.XCAFDoc_DocumentTool_GetHandle(self)",
"def GetHandle(self):\n return _XCAFDoc.XCAFDoc_Area_GetHandle(self)",
"def GetHandlePosition(self):\n ...",
"def GetHandle(self):\n return _XCAFDoc.XCAFDoc_ShapeTool_GetHandle(self)",
"def GetHandle(s... | [
"0.78898233",
"0.71070284",
"0.6917807",
"0.66946834",
"0.663635",
"0.636673",
"0.626138",
"0.626138",
"0.626138",
"0.60402787",
"0.59602517",
"0.5924701",
"0.59037566",
"0.58825636",
"0.5851078",
"0.5825668",
"0.5660734",
"0.5648803",
"0.5578014",
"0.55683166",
"0.5539888",
... | 0.85158664 | 0 |
GetHandle(XCAFDoc_Material self) > Handle_XCAFDoc_Material | def GetHandle(self):
return _XCAFDoc.XCAFDoc_Material_GetHandle(self) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def GetHandle(self):\n return _XCAFDoc.XCAFDoc_MaterialTool_GetHandle(self)",
"def GetHandle(self):\n return _XCAFDoc.XCAFDoc_DocumentTool_GetHandle(self)",
"def GetMaterial(self, *args):\n return _XCAFDoc.XCAFDoc_MaterialTool_GetMaterial(self, *args)",
"def GetHandle(self):\n ret... | [
"0.8033203",
"0.6446962",
"0.62563556",
"0.6252928",
"0.6160748",
"0.61424917",
"0.6104038",
"0.59616387",
"0.59473735",
"0.58785295",
"0.58785295",
"0.58785295",
"0.5850317",
"0.58366525",
"0.58366525",
"0.5833014",
"0.5825073",
"0.57015985",
"0.5686052",
"0.5629596",
"0.560... | 0.89828026 | 0 |
GetHandle(XCAFDoc_MaterialTool self) > Handle_XCAFDoc_MaterialTool | def GetHandle(self):
return _XCAFDoc.XCAFDoc_MaterialTool_GetHandle(self) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def GetHandle(self):\n return _XCAFDoc.XCAFDoc_Material_GetHandle(self)",
"def GetHandle(self):\n return _XCAFDoc.XCAFDoc_LayerTool_GetHandle(self)",
"def GetHandle(self):\n return _XCAFDoc.XCAFDoc_ColorTool_GetHandle(self)",
"def MaterialTool(*args):\n return _XCAFDoc.XCAFDoc_Doc... | [
"0.8003122",
"0.7115956",
"0.6973178",
"0.69343424",
"0.68230647",
"0.65301853",
"0.6489179",
"0.64331436",
"0.6332257",
"0.63238364",
"0.627463",
"0.60040414",
"0.57511234",
"0.5648535",
"0.55219454",
"0.55219454",
"0.55219454",
"0.5512995",
"0.5476625",
"0.54569155",
"0.543... | 0.9001202 | 0 |
Find referred material and return density from it if no material > return 0 | def XCAFDoc_MaterialTool_GetDensityForShape(*args):
return _XCAFDoc.XCAFDoc_MaterialTool_GetDensityForShape(*args) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def Density(material):\n if material == \"mild\":\n return 7850.0\n else:\n if material == \"al\":\n return 2700.0\n else:\n raise ValueError(\"Invalid material `\"+material+\"'\")",
"def GetDensityForShape(*args):\n return _XCAFDoc.XCAFDoc_MaterialTool_Get... | [
"0.7589287",
"0.63408643",
"0.62882704",
"0.6159724",
"0.6006733",
"0.5957398",
"0.5923891",
"0.58745974",
"0.58428085",
"0.58428085",
"0.58428085",
"0.57628113",
"0.57490605",
"0.57490605",
"0.5667478",
"0.5646339",
"0.5644401",
"0.5639201",
"0.56154007",
"0.561445",
"0.5597... | 0.64043057 | 1 |
GetHandle(XCAFDoc_SequenceNodeOfGraphNodeSequence self) > Handle_XCAFDoc_SequenceNodeOfGraphNodeSequence | def GetHandle(self):
return _XCAFDoc.XCAFDoc_SequenceNodeOfGraphNodeSequence_GetHandle(self) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def GetHandle(self):\n return _Bnd.Bnd_SequenceNodeOfSeqOfBox_GetHandle(self)",
"def GetHandle(self):\n return _XCAFDoc.XCAFDoc_GraphNode_GetHandle(self)",
"def _get_sequence(self):\n return self.__sequence",
"def _get_sequence(self):\n return self.__sequence",
"def _get_sequence(self):... | [
"0.7840239",
"0.71157944",
"0.57293063",
"0.57293063",
"0.57293063",
"0.57293063",
"0.57293063",
"0.57293063",
"0.57293063",
"0.57293063",
"0.57293063",
"0.57293063",
"0.57293063",
"0.57293063",
"0.57293063",
"0.57293063",
"0.57293063",
"0.57293063",
"0.57293063",
"0.57293063",... | 0.9142417 | 0 |
Checks whether shape is subshape of shape stored on label shapeL | def IsSubShape(self, *args):
return _XCAFDoc.XCAFDoc_ShapeMapTool_IsSubShape(self, *args) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def IsSubShape(self, *args):\n return _XCAFDoc.XCAFDoc_ShapeTool_IsSubShape(self, *args)",
"def isValidPcbShape(g):\n return g.GetShape() != pcbnew.S_SEGMENT or g.GetLength() > 0",
"def _check_shape(placeholder_shape, data_shape):\n\n return True",
"def locate_shape(shape):",
"def _shape_compa... | [
"0.6880785",
"0.6640455",
"0.6547641",
"0.63600343",
"0.6247915",
"0.6211077",
"0.61451787",
"0.60911214",
"0.6032316",
"0.5935418",
"0.5932601",
"0.5919724",
"0.5904724",
"0.5874897",
"0.5866337",
"0.58459413",
"0.5819828",
"0.5813317",
"0.5747277",
"0.57207114",
"0.5714335"... | 0.68659204 | 1 |
GetHandle(XCAFDoc_ShapeMapTool self) > Handle_XCAFDoc_ShapeMapTool | def GetHandle(self):
return _XCAFDoc.XCAFDoc_ShapeMapTool_GetHandle(self) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def GetHandle(self):\n return _XCAFDoc.XCAFDoc_ShapeTool_GetHandle(self)",
"def GetHandle(self):\n return _XCAFDoc.XCAFDoc_LayerTool_GetHandle(self)",
"def XCAFDoc_ShapeMapTool_Set(*args):\n return _XCAFDoc.XCAFDoc_ShapeMapTool_Set(*args)",
"def GetHandle(self):\n return _XCAFDoc.XCAFDo... | [
"0.8099828",
"0.7169637",
"0.65948564",
"0.63960946",
"0.63606286",
"0.6353273",
"0.6273324",
"0.6212486",
"0.61965203",
"0.6187231",
"0.61489075",
"0.6140915",
"0.60665923",
"0.59917367",
"0.5981497",
"0.5946992",
"0.5926408",
"0.5898514",
"0.58942646",
"0.57461804",
"0.5745... | 0.9002812 | 0 |
Returns True if the label represents a shape (simple shape, assembly or reference) | def IsShape(*args):
return _XCAFDoc.XCAFDoc_ShapeTool_IsShape(*args) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def XCAFDoc_ShapeTool_IsShape(*args):\n return _XCAFDoc.XCAFDoc_ShapeTool_IsShape(*args)",
"def IsSimpleShape(*args):\n return _XCAFDoc.XCAFDoc_ShapeTool_IsSimpleShape(*args)",
"def XCAFDoc_ShapeTool_IsSimpleShape(*args):\n return _XCAFDoc.XCAFDoc_ShapeTool_IsSimpleShape(*args)",
"def isValidPcbShap... | [
"0.73205435",
"0.72397965",
"0.71569157",
"0.68861264",
"0.6486496",
"0.64800316",
"0.6410618",
"0.6324826",
"0.62938905",
"0.6190594",
"0.61813533",
"0.6066991",
"0.60276425",
"0.6025243",
"0.6014371",
"0.59925807",
"0.59788185",
"0.59661585",
"0.5962064",
"0.59539837",
"0.5... | 0.73977554 | 0 |
Return true if is a located instance of other shape i.e. reference | def IsReference(*args):
return _XCAFDoc.XCAFDoc_ShapeTool_IsReference(*args) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __eq__(self, other):\n result = False\n if isinstance(other, Shape) and (self.area == other.area):\n return True\n else:\n return False",
"def __le__(self, other):\n result = False\n if isinstance(other, Shape) and (self.area <= other.area):\n ... | [
"0.6730229",
"0.65275335",
"0.65251565",
"0.6511745",
"0.6373149",
"0.6368978",
"0.63362604",
"0.6317186",
"0.6317031",
"0.61995226",
"0.6189776",
"0.61658394",
"0.61530143",
"0.61379826",
"0.6132612",
"0.6132612",
"0.6114783",
"0.61140394",
"0.60546815",
"0.6036164",
"0.6025... | 0.6580324 | 1 |
Returns True if the label is a label of compound, i.e. contains some sublabels This is relevant only if IsShape() is True | def IsCompound(*args):
return _XCAFDoc.XCAFDoc_ShapeTool_IsCompound(*args) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _is_label(self) -> bool:\n return self.lines[self.counter].startswith(\"(\") and self.lines[\n self.counter\n ].endswith(\")\")",
"def XCAFDoc_ShapeTool_IsCompound(*args):\n return _XCAFDoc.XCAFDoc_ShapeTool_IsCompound(*args)",
"def is_label(self, label: str) -> bool:\n ret... | [
"0.71586144",
"0.6814756",
"0.65736383",
"0.653009",
"0.6388997",
"0.63127124",
"0.62533617",
"0.61665684",
"0.6134257",
"0.60927904",
"0.6024126",
"0.5982182",
"0.5963731",
"0.5953084",
"0.5946107",
"0.5936237",
"0.5927572",
"0.58915186",
"0.588115",
"0.58613366",
"0.5833645... | 0.7069179 | 1 |
Return true if is subshape of the toplevel shape | def IsSubShape(self, *args):
return _XCAFDoc.XCAFDoc_ShapeTool_IsSubShape(self, *args) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def IsSubShape(self, *args):\n return _XCAFDoc.XCAFDoc_ShapeMapTool_IsSubShape(self, *args)",
"def IsTopLevel(self, *args):\n return _XCAFDoc.XCAFDoc_ShapeTool_IsTopLevel(self, *args)",
"def has_shape(node):\n allowed_shapes = (\n pm.nt.Mesh,\n pm.nt.NurbsCurve,\n pm.nt.Nu... | [
"0.74443215",
"0.7122763",
"0.66717887",
"0.6433657",
"0.6328645",
"0.6247062",
"0.6247062",
"0.61701775",
"0.616254",
"0.6146353",
"0.6134166",
"0.6128871",
"0.61154497",
"0.608888",
"0.6051705",
"0.60085213",
"0.5998481",
"0.5961193",
"0.59471107",
"0.59313315",
"0.5929196"... | 0.74131143 | 1 |
Returns the label corresponding to shape S (searches among toplevel shapes, not including subcomponents of assemblies) If findInstance is False (default), searches for the nonlocated shape (i.e. among original shapes) If findInstance is True, searches for the shape with the same location, including shape instances Retu... | def FindShape(self, *args):
return _XCAFDoc.XCAFDoc_ShapeTool_FindShape(self, *args) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def locate_shape(shape):",
"def Search_lable(self, address):\r\n ret = False\r\n for i in self.Labels_names:\r\n if self.Labels_names[i] == address:\r\n return True\r\n return ret",
"def _findLabel(self, label):\n if self.label == label:\n return... | [
"0.59722465",
"0.53929764",
"0.52751315",
"0.5254238",
"0.5193796",
"0.5099238",
"0.5076147",
"0.5017655",
"0.49151278",
"0.49044073",
"0.48783287",
"0.4873952",
"0.4812156",
"0.4794809",
"0.4761801",
"0.47094634",
"0.47023195",
"0.46782938",
"0.46691796",
"0.46669328",
"0.46... | 0.59343153 | 1 |
Removes shape (whole label and all its sublabels) If removeCompletely is true, removes complete shape If removeCompletely is false, removes instance(location) only Returns False (and does nothing) if shape is not free or is not toplevel shape | def RemoveShape(self, *args):
return _XCAFDoc.XCAFDoc_ShapeTool_RemoveShape(self, *args) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def delete_current_shape(self):\n print(\"deleting shape!\")\n self.shapes.remove(self.current_shape)\n self.current_shape = None\n self.changed()",
"def delete(self):\n if self.shape is not None:\n self.shape.delete()\n if self in shared.obstacles:\n ... | [
"0.58636904",
"0.57029474",
"0.5678611",
"0.5533344",
"0.552993",
"0.5476715",
"0.5392009",
"0.5392009",
"0.5239862",
"0.5235666",
"0.5228995",
"0.5225066",
"0.51900065",
"0.51814896",
"0.5164573",
"0.5164227",
"0.51384616",
"0.5128036",
"0.51236194",
"0.5120873",
"0.510273",... | 0.6359014 | 0 |
Returns a sequence of all toplevel shapes which are free (i.e. not referred by any other) | def GetFreeShapes(self, *args):
return _XCAFDoc.XCAFDoc_ShapeTool_GetFreeShapes(self, *args) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def shapes(self):\n return [load_node(item) for item in self.get_attribute('shapes')]",
"def top_level(self):\n top = set(self)\n for cell in self:\n top.difference_update(cell.get_dependencies())\n return list(top)",
"def getshapes(self):\n return sorted(self._sha... | [
"0.57692116",
"0.57578677",
"0.5750069",
"0.5702949",
"0.5687929",
"0.5603761",
"0.5574683",
"0.5513797",
"0.55105925",
"0.54631317",
"0.5427171",
"0.53805506",
"0.5369883",
"0.53469443",
"0.5346843",
"0.5340972",
"0.5324399",
"0.52838767",
"0.5277023",
"0.5276765",
"0.527676... | 0.65225166 | 0 |
Update an assembly at label | def UpdateAssembly(self, *args):
return _XCAFDoc.XCAFDoc_ShapeTool_UpdateAssembly(self, *args) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def UpdateLabel(self) -> _n_6_t_0:",
"def update(self, src, labels): # real signature unknown; restored from __doc__\n pass",
"def cg_label(self, cmd):\n label = self.makeLabel(cmd)\n self.asm(f\"({label})\")",
"def updatelabel(task, label, eid):\n ServerManager.get()\n result = Se... | [
"0.67722905",
"0.6193768",
"0.57781476",
"0.5612701",
"0.5563958",
"0.5551546",
"0.5536291",
"0.5437013",
"0.54345787",
"0.5416627",
"0.53958666",
"0.53958666",
"0.53958666",
"0.53958666",
"0.53958666",
"0.5366115",
"0.53564084",
"0.531586",
"0.531586",
"0.531586",
"0.5300295... | 0.6353798 | 1 |
Adds a label for subshape of shape stored on label shapeL Returns Null label if it is not subshape | def AddSubShape(self, *args):
return _XCAFDoc.XCAFDoc_ShapeTool_AddSubShape(self, *args) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_label_shape(label):\n label.set_shape([1])\n return label",
"def label(self):\n return self._label_shape",
"def draw_shape_label(self, label, xform, colour):\n #TODO deal with alignment, rotation\n pos = xform.chain(Point(label.x, label.y))\n self.canvas.text((pos.x, p... | [
"0.6596485",
"0.58629817",
"0.5853605",
"0.57315755",
"0.54680437",
"0.54167217",
"0.5354997",
"0.5340805",
"0.5269248",
"0.524213",
"0.5200187",
"0.51849526",
"0.5182629",
"0.5173576",
"0.51546913",
"0.51529175",
"0.51316917",
"0.51097757",
"0.5108188",
"0.5102643",
"0.51005... | 0.60389626 | 1 |
Returns True if the label is a label of external references, i.e. there are some reference on the nostep files, which are described in document only their names | def IsExternRef(*args):
return _XCAFDoc.XCAFDoc_ShapeTool_IsExternRef(*args) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def is_ref_known(self):\r\n \r\n if \"N\" in self.ref:\r\n return False\r\n else:\r\n return True",
"def __contains__(self, doc_label):\n return doc_label in self.docs",
"def XCAFDoc_ShapeTool_IsExternRef(*args):\n return _XCAFDoc.XCAFDoc_ShapeTool... | [
"0.6630042",
"0.6446989",
"0.63765246",
"0.62456656",
"0.614453",
"0.6132044",
"0.613197",
"0.6121163",
"0.6110954",
"0.59896314",
"0.5986823",
"0.59578395",
"0.5955602",
"0.5954197",
"0.59516585",
"0.5948518",
"0.5929033",
"0.59128714",
"0.5814828",
"0.5814461",
"0.58120793"... | 0.6483862 | 1 |
Sets the SHUO structure between upper_usage and next_usage create multylevel (if number of labels > 2) SHUO from first to last Initialise out by main upper_usage SHUO attribute. Returns False if some of labels in not component label | def SetSHUO(self, *args):
return _XCAFDoc.XCAFDoc_ShapeTool_SetSHUO(self, *args) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def SetInstanceSHUO(self, *args):\n return _XCAFDoc.XCAFDoc_ShapeTool_SetInstanceSHUO(self, *args)",
"def make_summary(otu_table,\r\n level,\r\n upper_percentage,\r\n lower_percentage,\r\n md_as_string=False,\r\n md_identifier... | [
"0.49316132",
"0.44922057",
"0.4483101",
"0.4483101",
"0.44817603",
"0.44751006",
"0.4429746",
"0.44230792",
"0.44188675",
"0.4407",
"0.437901",
"0.43633786",
"0.43488336",
"0.43254998",
"0.43104666",
"0.42851523",
"0.4277522",
"0.426736",
"0.42572984",
"0.42538342",
"0.42501... | 0.4889102 | 1 |
Searchs the SHUO by labels of components from upper_usage componet to next_usage Returns null attribute if no SHUO found | def FindSHUO(*args):
return _XCAFDoc.XCAFDoc_ShapeTool_FindSHUO(*args) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def XCAFDoc_ShapeTool_FindSHUO(*args):\n return _XCAFDoc.XCAFDoc_ShapeTool_FindSHUO(*args)",
"def _find_huc(source, shply, crs, hint):\n logging.debug('searching: %s'%hint)\n hint_level = len(hint)\n search_level = hint_level + 2\n if search_level > source.lowest_level:\n ... | [
"0.5876024",
"0.5692772",
"0.53797704",
"0.52790064",
"0.5214555",
"0.50445753",
"0.49717766",
"0.49151835",
"0.48682773",
"0.4808125",
"0.48071635",
"0.47748905",
"0.46330044",
"0.4632234",
"0.45891908",
"0.4565584",
"0.45610827",
"0.455963",
"0.45328975",
"0.45328975",
"0.4... | 0.59294575 | 0 |
GetHandle(XCAFDoc_ShapeTool self) > Handle_XCAFDoc_ShapeTool | def GetHandle(self):
return _XCAFDoc.XCAFDoc_ShapeTool_GetHandle(self) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def GetHandle(self):\n return _XCAFDoc.XCAFDoc_ShapeMapTool_GetHandle(self)",
"def GetHandle(self):\n return _XCAFDoc.XCAFDoc_LayerTool_GetHandle(self)",
"def GetHandle(self):\n return _XCAFDoc.XCAFDoc_DocumentTool_GetHandle(self)",
"def XCAFDoc_DocumentTool_ShapeTool(*args):\n return _... | [
"0.8145045",
"0.7409737",
"0.7100401",
"0.69403154",
"0.6935258",
"0.6849974",
"0.6769479",
"0.6629896",
"0.66019756",
"0.65360236",
"0.6433135",
"0.6376726",
"0.6338123",
"0.6324201",
"0.6315614",
"0.62413406",
"0.6217501",
"0.6155564",
"0.60077333",
"0.60077333",
"0.6007733... | 0.8850904 | 0 |
Returns True if the label represents a shape (simple shape, assembly or reference) | def XCAFDoc_ShapeTool_IsShape(*args):
return _XCAFDoc.XCAFDoc_ShapeTool_IsShape(*args) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def IsShape(*args):\n return _XCAFDoc.XCAFDoc_ShapeTool_IsShape(*args)",
"def IsSimpleShape(*args):\n return _XCAFDoc.XCAFDoc_ShapeTool_IsSimpleShape(*args)",
"def XCAFDoc_ShapeTool_IsSimpleShape(*args):\n return _XCAFDoc.XCAFDoc_ShapeTool_IsSimpleShape(*args)",
"def isValidPcbShape(g):\n r... | [
"0.73977554",
"0.72397965",
"0.71569157",
"0.68861264",
"0.6486496",
"0.64800316",
"0.6410618",
"0.6324826",
"0.62938905",
"0.6190594",
"0.61813533",
"0.6066991",
"0.60276425",
"0.6025243",
"0.6014371",
"0.59925807",
"0.59788185",
"0.59661585",
"0.5962064",
"0.59539837",
"0.5... | 0.73205435 | 1 |
Searchs the SHUO by labels of components from upper_usage componet to next_usage Returns null attribute if no SHUO found | def XCAFDoc_ShapeTool_FindSHUO(*args):
return _XCAFDoc.XCAFDoc_ShapeTool_FindSHUO(*args) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def FindSHUO(*args):\n return _XCAFDoc.XCAFDoc_ShapeTool_FindSHUO(*args)",
"def _find_huc(source, shply, crs, hint):\n logging.debug('searching: %s'%hint)\n hint_level = len(hint)\n search_level = hint_level + 2\n if search_level > source.lowest_level:\n return hint\... | [
"0.5926087",
"0.56914735",
"0.53767383",
"0.527768",
"0.52115136",
"0.50411975",
"0.49702275",
"0.49130422",
"0.4864735",
"0.4809252",
"0.4804273",
"0.47728866",
"0.46308988",
"0.46301258",
"0.45888206",
"0.45647296",
"0.45596683",
"0.45581827",
"0.45318738",
"0.45318738",
"0... | 0.5872663 | 1 |
GetHandle(XCAFDoc_Volume self) > Handle_XCAFDoc_Volume | def GetHandle(self):
return _XCAFDoc.XCAFDoc_Volume_GetHandle(self) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def volume():\n vol = sonos.volume\n return vol",
"def get_volume(self):\n import fcntl\n import struct\n knob = bytearray(struct.pack(\"III\", 0, 0, 0)) # VOLUME_DEVICE_ID, VOLUME_KNOB_ID, <Unused>\n try:\n fcntl.ioctl(self.mixer_fd, 2, knob, True)\n _,_,v... | [
"0.64146054",
"0.6255795",
"0.6191152",
"0.6147762",
"0.60522765",
"0.60192573",
"0.60192573",
"0.6007111",
"0.60043895",
"0.5968156",
"0.5937467",
"0.5937467",
"0.59204704",
"0.59009874",
"0.58413506",
"0.58413506",
"0.58413506",
"0.5833584",
"0.58248204",
"0.57923627",
"0.5... | 0.8818248 | 0 |
Change ont port admin state to down. | def down(self):
self.update(admin_state='0') | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def admin_state_up(self, state):\n self.neutron.update_port(self._provision_port_id, {'port': {'admin_state_up': state}})",
"def set_all_ports_admin_disabled(self):\n pass",
"def power_off(self, port):\n port = int(port)\n self._validate_port(\"power_off\", port)\n self.set_mode(OFF, por... | [
"0.7392183",
"0.7054633",
"0.6471384",
"0.64549065",
"0.6411743",
"0.62972623",
"0.6167715",
"0.6161766",
"0.61578876",
"0.61390173",
"0.61337453",
"0.6093141",
"0.6076133",
"0.60588557",
"0.60459024",
"0.6029793",
"0.6024064",
"0.6008006",
"0.5993049",
"0.5948721",
"0.592832... | 0.7643764 | 0 |
Change ont port admin state to up. | def up(self):
self.update(admin_state='1') | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def admin_state_up(self, state):\n self.neutron.update_port(self._provision_port_id, {'port': {'admin_state_up': state}})",
"def _assert_on_port_admin_state(self, port_data, device_owner):\n if (device_owner == l3_db.DEVICE_OWNER_ROUTER_INTF or\n device_owner == l3_db.DEVICE_OWNER_ROUTER... | [
"0.8624906",
"0.6940723",
"0.6933148",
"0.6553685",
"0.6207796",
"0.6177507",
"0.6027318",
"0.59879273",
"0.5880546",
"0.5879599",
"0.5833772",
"0.57730824",
"0.5750982",
"0.57055825",
"0.56649095",
"0.5652485",
"0.5624576",
"0.5606126",
"0.5593546",
"0.55624604",
"0.5560607"... | 0.7084217 | 1 |
Return cumulative minimum over a DataFrame or Series axis. Returns a DataFrame or Series of the same size containing the cumulative minimum. | def cummin(self: FrameLike, skipna: bool = True) -> FrameLike:
return self._apply_series_op(lambda psser: psser._cum(F.min, skipna), should_resolve=True) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def cummin(self):\n return self._lift(lambda c: c.cummin)",
"def idxmin(self, **kwargs): # noqa: PR02\n return DataFrameDefault.register(pandas.DataFrame.idxmin)(self, **kwargs)",
"def argmin(self, axis: str = 'rows') -> 'DataFrame':\n return self._stat_funcs('argmin', axis)",
"def min(... | [
"0.739754",
"0.70453143",
"0.7016353",
"0.70126134",
"0.6791421",
"0.66697174",
"0.6666445",
"0.6643355",
"0.64552176",
"0.6437716",
"0.6398935",
"0.63874406",
"0.62631714",
"0.6200742",
"0.6159252",
"0.6154657",
"0.61493796",
"0.6117522",
"0.61076707",
"0.61076707",
"0.60595... | 0.7585967 | 0 |
Return cumulative maximum over a DataFrame or Series axis. Returns a DataFrame or Series of the same size containing the cumulative maximum. | def cummax(self: FrameLike, skipna: bool = True) -> FrameLike:
return self._apply_series_op(lambda psser: psser._cum(F.max, skipna), should_resolve=True) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def cummax(self):\n return self._lift(lambda c: c.cummax)",
"def argmax(self, axis: str = 'rows') -> 'DataFrame':\n return self._stat_funcs('argmax', axis)",
"def max(self, axis=0, **kwargs) -> \"Dataset\":\n return self.aggregate(axis=axis, func=np.max, **kwargs)",
"def idxmax(self, **k... | [
"0.734381",
"0.68771905",
"0.6835404",
"0.653421",
"0.6530266",
"0.6508927",
"0.64322835",
"0.63791645",
"0.6326454",
"0.62930155",
"0.62792915",
"0.6269563",
"0.6256807",
"0.6190875",
"0.6171233",
"0.61086094",
"0.61086094",
"0.610821",
"0.60462475",
"0.6005255",
"0.59923947... | 0.7139514 | 1 |
Return counts of unique dtypes in this object. | def get_dtype_counts(self) -> pd.Series:
warnings.warn(
"`get_dtype_counts` has been deprecated and will be "
"removed in a future version. For DataFrames use "
"`.dtypes.value_counts()",
FutureWarning,
)
if not isinstance(self.dtypes, Iterable):
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def sum_obj_cols (df):\n df_obj = obj_df(df)\n obj_cols = pd.DataFrame(df_obj.dtypes, columns=['dtypes'])\n obj_cols['unique_values'] = df_obj.nunique()\n return obj_cols",
"def dtypes(self):\n return self.to_pandas().dtypes",
"def _nunique(self, drop_null=True):\n res = {}\n r... | [
"0.6665577",
"0.66507554",
"0.6399604",
"0.63064414",
"0.6182933",
"0.6146768",
"0.61421317",
"0.61267495",
"0.6080777",
"0.6015942",
"0.60043824",
"0.600151",
"0.58992946",
"0.5883157",
"0.5861943",
"0.58599627",
"0.58283705",
"0.5826433",
"0.5816421",
"0.57850796",
"0.57842... | 0.69385576 | 0 |
Return a Series/DataFrame with absolute numeric value of each element. Returns | def abs(self: FrameLike) -> FrameLike:
def abs(psser: "Series") -> Union["Series", Column]:
if isinstance(psser.spark.data_type, BooleanType):
return psser
elif isinstance(psser.spark.data_type, NumericType):
return psser._with_new_scol(
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def abs(self):\n return DataFrameDefault.register(pandas.DataFrame.abs)(self)",
"def __abs__(self):\n v = zeros_como(self)\n\n for i in range(self.n):\n v[i] = abs(self[i])\n\n return v",
"def get_negatives(self):\n negative_values = (self.df[self.col_name]<0).sum()\n ... | [
"0.72867054",
"0.64076155",
"0.6370848",
"0.6250469",
"0.601447",
"0.60031515",
"0.59910417",
"0.5975337",
"0.5957762",
"0.5934569",
"0.58766943",
"0.5847459",
"0.5816648",
"0.5793899",
"0.5785676",
"0.57727915",
"0.57466084",
"0.5725787",
"0.57183194",
"0.5678503",
"0.567487... | 0.67583376 | 1 |
Retrieves the index of the first valid value. Returns scalar, tuple, or None Examples Support for DataFrame | def first_valid_index(self) -> Optional[Union[Scalar, Tuple[Scalar, ...]]]:
data_spark_columns = self._internal.data_spark_columns
if len(data_spark_columns) == 0:
return None
cond = reduce(lambda x, y: x & y, map(lambda x: x.isNotNull(), data_spark_columns))
with sql_conf... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def first_valid_index(self):\n return (\n DataFrameDefault.register(pandas.DataFrame.first_valid_index)(self)\n .to_pandas()\n .squeeze()\n )",
"def last_valid_index(self) -> Optional[Union[Scalar, Tuple[Scalar, ...]]]:\n data_spark_columns = self._internal.d... | [
"0.6924053",
"0.66161823",
"0.65560144",
"0.64668363",
"0.64263797",
"0.6421347",
"0.63923746",
"0.62542737",
"0.6219861",
"0.62142843",
"0.61727315",
"0.6169093",
"0.6134989",
"0.61293644",
"0.61064273",
"0.6058676",
"0.6031218",
"0.60283",
"0.60248256",
"0.6012006",
"0.5999... | 0.76989704 | 0 |
Return index for last nonNA/null value. Returns scalar, tuple, or None Notes This API only works with PySpark >= 3.0. Examples Support for DataFrame | def last_valid_index(self) -> Optional[Union[Scalar, Tuple[Scalar, ...]]]:
data_spark_columns = self._internal.data_spark_columns
if len(data_spark_columns) == 0:
return None
cond = reduce(lambda x, y: x & y, map(lambda x: x.isNotNull(), data_spark_columns))
last_valid_row... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def first_valid_index(self) -> Optional[Union[Scalar, Tuple[Scalar, ...]]]:\n data_spark_columns = self._internal.data_spark_columns\n\n if len(data_spark_columns) == 0:\n return None\n\n cond = reduce(lambda x, y: x & y, map(lambda x: x.isNotNull(), data_spark_columns))\n\n ... | [
"0.6803496",
"0.6440539",
"0.6205881",
"0.59493214",
"0.56690997",
"0.55862904",
"0.5338115",
"0.5327893",
"0.53059",
"0.5290752",
"0.52524054",
"0.5245491",
"0.52171314",
"0.52170146",
"0.52158266",
"0.5210693",
"0.5109578",
"0.5073314",
"0.5067518",
"0.5067154",
"0.5056564"... | 0.77271783 | 0 |
Squeeze 1 dimensional axis objects into scalars. Series or DataFrames with a single element are squeezed to a scalar. DataFrames with a single column or a single row are squeezed to a Series. Otherwise the object is unchanged. This method is most useful when you don't know if your object is a Series or DataFrame, but y... | def squeeze(self, axis: Optional[Axis] = None) -> Union[Scalar, "DataFrame", "Series"]:
if axis is not None:
axis = "index" if axis == "rows" else axis
axis = validate_axis(axis)
if isinstance(self, ps.DataFrame):
from pyspark.pandas.series import first_series
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def squeeze(self, axis=None):\n # print 'input axis:', axis\n sh = self.data.shape\n if axis is None:\n axis = [a for i, a in enumerate(self.axes_names) if sh[i] == 1]\n else:\n assert self.has_axes(axis)\n ssh = np.array([sh[self.get_axis_id(a)] for a i... | [
"0.7281115",
"0.69403094",
"0.69190294",
"0.6775399",
"0.6762715",
"0.6732418",
"0.6589858",
"0.6406284",
"0.638457",
"0.63553905",
"0.6077735",
"0.5993625",
"0.59202224",
"0.5787143",
"0.57546335",
"0.5611305",
"0.5586695",
"0.5558105",
"0.5554411",
"0.55141306",
"0.55054265... | 0.78269047 | 0 |
Truncate a Series or DataFrame before and after some index value. This is a useful shorthand for boolean indexing based on index values above or below certain thresholds. | def truncate(
self,
before: Optional[Any] = None,
after: Optional[Any] = None,
axis: Optional[Axis] = None,
copy: bool_type = True,
) -> DataFrameOrSeries:
from pyspark.pandas.series import first_series
axis = validate_axis(axis)
indexes = self.index
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def dataendclean(df, x, inplace=False):\r\n # Examine Mean Values\r\n if inplace:\r\n df = df\r\n else:\r\n df = df.copy()\r\n\r\n jump = df[abs(df.loc[:, x].diff()) > 1.0]\r\n try:\r\n for i in range(len(jump)):\r\n if jump.index[i] < df.index[50]:\r\n ... | [
"0.5765668",
"0.5567851",
"0.5430082",
"0.53692096",
"0.51678723",
"0.5129183",
"0.51253074",
"0.5113544",
"0.5109115",
"0.5009243",
"0.50037444",
"0.5000955",
"0.49962112",
"0.49358776",
"0.49220943",
"0.4916079",
"0.49013975",
"0.48026115",
"0.48024952",
"0.47973102",
"0.47... | 0.59307736 | 0 |
FlaskLogin token_loader callback. The token_loader function asks this function to take the token that was stored on the users computer process it to check if its valid and then return a User Object if its valid or None if its not valid. | def load_token(token):
#The Token itself was generated by User.get_auth_token. So it is up to
#us to known the format of the token data itself.
#The Token was encrypted using itsdangerous.URLSafeTimedSerializer which
#allows us to have a max_age on the token itself. When the cookie is stored
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def load_token(token):\n \n #The Token itself was generated by User.get_auth_token. So it is up to \n #us to known the format of the token data itself. \n \n #The Token was encrypted using itsdangerous.URLSafeTimedSerializer which \n #allows us to have a max_age on the token itself. When the cookie ... | [
"0.7510489",
"0.666416",
"0.6657804",
"0.6657804",
"0.65564126",
"0.65416473",
"0.6499296",
"0.64926356",
"0.64700323",
"0.64562577",
"0.63866186",
"0.6324399",
"0.63235253",
"0.6306848",
"0.63053805",
"0.6226999",
"0.6138921",
"0.61359614",
"0.61306226",
"0.6088777",
"0.6048... | 0.7729311 | 0 |
Returns the path to the subvolume hdf5 file Similar to gcPath() from illustris_python, modified to load specific subvolumes. | def file_path(base_path, subvolume, file_name):
return '{}/{}_{}_{}/{}.hdf5'.format(base_path, *subvolume, file_name) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def gcPath(basePath, snapNum, chunkNum=0):\n gcPath = basePath + '/groups_%03d/' % snapNum\n filePath1 = gcPath + 'groups_%03d.%d.hdf5' % (snapNum, chunkNum)\n filePath2 = gcPath + 'fof_subhalo_tab_%03d.%d.hdf5' % (snapNum, chunkNum)\n\n if isfile(filePath1):\n return filePath1\n return fileP... | [
"0.64840996",
"0.64576006",
"0.61922055",
"0.5976765",
"0.59732467",
"0.58877313",
"0.5750205",
"0.5621003",
"0.54073274",
"0.5390143",
"0.5382494",
"0.53788185",
"0.536471",
"0.5353347",
"0.5347091",
"0.5330392",
"0.53302646",
"0.5316109",
"0.5295307",
"0.5278924",
"0.525593... | 0.7345979 | 0 |
Returns a specific subvolume's haloprop for all snapshots. | def load_haloprop(base_path, subvolume, fields=None, matches=False):
return load_subvolume(base_path, subvolume, 'Haloprop', fields, matches, True) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def load_snapshot_halos(base_path, snap_num, subvolumes, fields=None, matches=False):\n return load_snapshot(base_path, snap_num, subvolumes, \"Haloprop\", fields, matches)",
"def load_snapshot_subhalos(base_path, snap_num, subvolumes, fields=None, matches=False):\n return load_snapshot(base_path, snap_num... | [
"0.737634",
"0.6752368",
"0.5708394",
"0.5665622",
"0.54714185",
"0.53694797",
"0.53482205",
"0.5279797",
"0.5241383",
"0.5183638",
"0.51408726",
"0.51291984",
"0.5111896",
"0.50619394",
"0.5051639",
"0.5008617",
"0.49795783",
"0.4974681",
"0.49703518",
"0.4960137",
"0.494212... | 0.7398969 | 0 |
Returns a specific subvolume's galprop for all snapshots. | def load_galprop(base_path, subvolume, fields=None, matches=False):
return load_subvolume(base_path, subvolume, 'Galprop', fields, matches, True) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def load_snapshot_subhalos(base_path, snap_num, subvolumes, fields=None, matches=False):\n return load_snapshot(base_path, snap_num, subvolumes, \"Galprop\", fields, matches)",
"def volume(self, tolerance=1e-9):\n props = GProp_GProps()\n brepgprop_VolumeProperties(self.topods_solid(), props, to... | [
"0.6436749",
"0.5248258",
"0.52080214",
"0.5136601",
"0.51212853",
"0.5104739",
"0.51002455",
"0.50757885",
"0.50716",
"0.5062265",
"0.5062007",
"0.50290185",
"0.50179803",
"0.49849924",
"0.4937764",
"0.4934748",
"0.49291837",
"0.4924746",
"0.48838946",
"0.48733607",
"0.48701... | 0.7527435 | 0 |
Returns all halos from queried subvolumes at a specific snapshot. | def load_snapshot_halos(base_path, snap_num, subvolumes, fields=None, matches=False):
return load_snapshot(base_path, snap_num, subvolumes, "Haloprop", fields, matches) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def load_snapshot_subhalos(base_path, snap_num, subvolumes, fields=None, matches=False):\n return load_snapshot(base_path, snap_num, subvolumes, \"Galprop\", fields, matches)",
"def get_snapshot_children(self, snapshot):\n LOG.debug('get_snapshot_children starts.')\n pool_name = self.configurati... | [
"0.67438954",
"0.65540177",
"0.65498096",
"0.6192958",
"0.59856457",
"0.58624345",
"0.5820786",
"0.58172685",
"0.57641685",
"0.5721317",
"0.56183326",
"0.56176245",
"0.5610879",
"0.56034636",
"0.55932194",
"0.5524852",
"0.5520669",
"0.55010444",
"0.54795873",
"0.54771215",
"0... | 0.71945095 | 0 |
Returns all subhalos from queried subvolumes at a specific snapshot. | def load_snapshot_subhalos(base_path, snap_num, subvolumes, fields=None, matches=False):
return load_snapshot(base_path, snap_num, subvolumes, "Galprop", fields, matches) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_snapshot_children(self, snapshot):\n LOG.debug('get_snapshot_children starts.')\n pool_name = self.configuration.rbd_pool\n volume_name = \\\n 'volume-%s' % encodeutils.safe_encode(snapshot[\"volume_id\"])\n snap_name = 'snapshot-%s' % encodeutils.safe_encode(snapshot... | [
"0.6874409",
"0.6752895",
"0.65722495",
"0.6562206",
"0.63684887",
"0.6252225",
"0.6100838",
"0.60460883",
"0.580239",
"0.5787517",
"0.5778293",
"0.57681584",
"0.5701584",
"0.56923544",
"0.5691405",
"0.56483513",
"0.56458294",
"0.5624223",
"0.56061447",
"0.55796653",
"0.54780... | 0.7094288 | 0 |
Returns the header from a queried subvolume. | def load_header(base_path, subvolume):
with h5py.File(file_path(base_path, subvolume, 'subvolume'), 'r') as f:
header = dict(f['Header'].attrs.items())
header.update({key: f['Header'][key][:] for key in f['Header'].keys()})
return header | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def header(self):\n return self[0]",
"def getHeader(self):\n return self.data.header",
"def get_header(self):\n return self._header",
"def getHeader():\n return _HEADER",
"def header(self):\r\n return self.__header",
"def get_subheader(self):\n element = self.driver.... | [
"0.649995",
"0.64035386",
"0.63615084",
"0.6319671",
"0.6286268",
"0.62795854",
"0.62575436",
"0.62575436",
"0.62575436",
"0.61220676",
"0.60273165",
"0.6026679",
"0.5995545",
"0.5977807",
"0.5970066",
"0.5962919",
"0.5959653",
"0.5910981",
"0.590013",
"0.5847704",
"0.5845606... | 0.7542032 | 0 |
Describe cost management exports. | def describe_cost_management_exports(self):
return [{"name": self.export_name, "container": self.container, "directory": self.directory}] | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def outputs_for_detailed_tab(self):\n result = []\n if self.in_distributed_mode:\n row = {\n 'project_id_with_serial': self.project_name,\n 'module': type(self).__name__,\n 'type': 'variable',\n 'variable_df_key_col_name': 'total_... | [
"0.59530383",
"0.585853",
"0.5752477",
"0.56681556",
"0.5590126",
"0.53734535",
"0.5334831",
"0.5293427",
"0.5277016",
"0.5255848",
"0.5239629",
"0.5203968",
"0.5178137",
"0.5149369",
"0.51247513",
"0.5091049",
"0.5084311",
"0.50588226",
"0.5050241",
"0.5047609",
"0.5042017",... | 0.8384965 | 0 |
Test to verify Azure downloader is initialized. | def test_get_azure_client(self, _):
client = self.downloader._get_azure_client(self.azure_credentials, self.azure_data_source)
self.assertIsNotNone(client) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_download_host(self):\n pass",
"def test_empty_azure_config_dir():\n pass",
"def test_download(self):\n pass",
"async def test_initialization(self):\n assert self.webhook_connection.address == self.identity.address",
"def test_init(self):\n print os.path.abspath(os.pa... | [
"0.65175086",
"0.63173556",
"0.6300495",
"0.62036026",
"0.60204816",
"0.6019838",
"0.5970795",
"0.59150636",
"0.5911918",
"0.58765125",
"0.5875793",
"0.58343214",
"0.5822522",
"0.5817103",
"0.5785272",
"0.57287914",
"0.57285786",
"0.5727994",
"0.5725547",
"0.5700613",
"0.5683... | 0.68517065 | 0 |
Test that report path is built correctly. | def test_get_report_path(self):
self.assertEqual(self.downloader.directory, self.mock_data.directory)
self.assertEqual(self.downloader.export_name, self.mock_data.export_name)
self.assertEqual(self.downloader._get_report_path(self.mock_data.test_date), self.mock_data.report_path) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __set_report_path(self):\n self.report_path = os.path.join(self.get_report_path(), \"cyclomatic_report\")\n Path(self.report_path).mkdir(parents=True, exist_ok=True)",
"def report_path(self):\r\n return os.path.join(self._html_dir, 'build.html')",
"def report(self, output_dir):",
"def te... | [
"0.67673934",
"0.6759964",
"0.6628434",
"0.65410334",
"0.65354156",
"0.64221627",
"0.64067876",
"0.63896894",
"0.6370111",
"0.6358249",
"0.6251617",
"0.62396336",
"0.61127716",
"0.6086123",
"0.60145944",
"0.59791654",
"0.5965357",
"0.5964692",
"0.59504694",
"0.59435797",
"0.5... | 0.7389257 | 0 |
Test to get the local file path for a report. | def test_get_local_file_for_report(self):
expected_local_file = self.mock_data.export_file
local_file = self.downloader.get_local_file_for_report(self.mock_data.export_key)
self.assertEqual(expected_local_file, local_file) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_report_path(self):\n report_path = os.path.join(logPath, \"report.html\")\n return report_path",
"def test_get_report_path(self):\n self.assertEqual(self.downloader.directory, self.mock_data.directory)\n self.assertEqual(self.downloader.export_name, self.mock_data.export_name)... | [
"0.73260146",
"0.71147996",
"0.6804765",
"0.6615577",
"0.6594698",
"0.65260744",
"0.65142334",
"0.6483118",
"0.6443149",
"0.64397013",
"0.6418888",
"0.6418888",
"0.6418888",
"0.6324459",
"0.62705266",
"0.6254916",
"0.6232416",
"0.62196046",
"0.62161463",
"0.6207858",
"0.61861... | 0.7950066 | 0 |
Test that error is thrown when getting manifest with an unexpected report name. | def test_get_manifest_unexpected_report_name(self):
with self.assertRaises(AzureReportDownloaderError):
self.downloader._get_manifest(self.mock_data.bad_test_date) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_invalid_manifest_filepath(self):\n load_manifest(\"./ehiiehaiehnatheita\")",
"def test_sa_invalid_manifest_file_unknown_error(self, _mock_depfinder):\n with open(str(Path(__file__).parent.parent.parent) +\n '/data/manifests/400/npmlist.json', 'rb') as fp:\n fs =... | [
"0.6667474",
"0.6577864",
"0.6442794",
"0.6417424",
"0.64108133",
"0.6280289",
"0.6221659",
"0.6167222",
"0.6077581",
"0.6064105",
"0.60215175",
"0.6004537",
"0.5949171",
"0.5923836",
"0.5915513",
"0.5878765",
"0.5867618",
"0.58581245",
"0.5856836",
"0.58340645",
"0.58209306"... | 0.83767325 | 0 |
Test that Azure report is not downloaded for incorrect key. | def test_download_missing_file(self):
key = "badkey"
with self.assertRaises(AzureReportDownloaderError):
self.downloader.download_file(key) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_get_report_wrong_api_key(self):\n vt_analyses_wrong_api_key = VirusTotalAPIAnalyses('test_api_key')\n vt_analyses_wrong_api_key.get_report('test_object_id')\n http_err = vt_analyses_wrong_api_key.get_last_http_error()\n self.assertEqual(http_err, vt_analyses_wrong_api_key.HTTP_... | [
"0.72874945",
"0.65340036",
"0.6392282",
"0.6335407",
"0.6285832",
"0.62685525",
"0.6220093",
"0.6134964",
"0.6126072",
"0.61171114",
"0.6113606",
"0.6110157",
"0.59444654",
"0.5941738",
"0.59193254",
"0.5917145",
"0.58990806",
"0.58965915",
"0.58551496",
"0.5852845",
"0.5847... | 0.7490197 | 0 |
Given a character, predict the next character and hidden state. | def predict(net, char, h=None, top_k=None):
x = np.array([[net.char2int[char]]])
x = one_hot_encode(x, len(net.chars))
inputs = torch.from_numpy(x)
h = tuple([each.data for each in h])
out, h = net(inputs, h)
p = F.softmax(out, dim=1).data
if top_k is None:
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def predict_next_char(text, tokenizer, max_id, model):\n X_new = preprocess_input([text], tokenizer, max_id)\n Y_pred = model.predict_classes(X_new)\n pred_char = tokenizer.sequences_to_texts(Y_pred + 1)[0][-1]\n return pred_char",
"def predict(self, latent, temp=1):\n\n # Scale inputs if mode... | [
"0.617682",
"0.61426497",
"0.60795456",
"0.5996923",
"0.593739",
"0.59076214",
"0.58787155",
"0.58676875",
"0.58667165",
"0.5838156",
"0.5837437",
"0.57577115",
"0.5742885",
"0.57363844",
"0.56677395",
"0.5663863",
"0.5650765",
"0.5639272",
"0.5634483",
"0.56161994",
"0.56148... | 0.6197953 | 0 |
replaces ' ' with '', that's it | def just_replace_strings_with_nothing(self, artist: str) -> str:
data = re.sub(' ', '', artist)
return data | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def replace_empty(s):\n if s == \"\":\n return \" \"\n else:\n return s",
"def strip_space():\n pass",
"def remove_space(user_inputs):\r\n return user_inputs.replace(\" \", \"\")",
"def clean(val):\n\n val = re.sub(r'/s+', r'/s', val)\n return val.strip()",
"def removeSingle... | [
"0.74222213",
"0.7214014",
"0.71315086",
"0.7111131",
"0.70598346",
"0.69853747",
"0.6979336",
"0.69351786",
"0.6903794",
"0.68412364",
"0.6828154",
"0.66562057",
"0.66539776",
"0.66539776",
"0.6588545",
"0.65866727",
"0.6571573",
"0.6559311",
"0.65471077",
"0.65401584",
"0.6... | 0.7280059 | 1 |
gets page of lyrics from genius | def get_genius_page(self, artist: str, song: str) -> str:
artist = self.just_replace_strings_with_dashes(artist)
song = self.just_replace_strings_with_dashes(song)
url = self.gen_url + artist + '-' + song + '-lyrics'
resp = requests.get(url)
if resp.status_code == 200:
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def fetch_lyrics(self, url):\n # data=requests.get(url,proxies=proxyDict) # will be used when internet is accessed via proxy server\n page = requests.get(url) # for accessing internet without proxy server\n # Regex out the lyrics from the html content\n lyrics = re.search(b'<!-- start ... | [
"0.689459",
"0.6729387",
"0.6606836",
"0.6526861",
"0.6415186",
"0.63996136",
"0.6395148",
"0.6362258",
"0.63577193",
"0.6265763",
"0.6187649",
"0.61579233",
"0.6151253",
"0.61404127",
"0.6061178",
"0.60324085",
"0.6024961",
"0.60221934",
"0.59880483",
"0.59838563",
"0.597753... | 0.787524 | 0 |
Gets all songs lyrics for a given artist artist input should look like "queens of the stone age" | def get_all_artists_lyrics(self, artist: str) -> List[Dict]:
artist = artist.lower()
song_list = self.get_song_list(artist)
lyric_dict = {}
for i in song_list:
lyrics = self.get_genius_page(artist, i)
lyric_dict[i] = lyrics
return lyric_dict | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_existing_lyrics_of_artist(self, artist_name=None, artist_id=None):\n\t\tif artist_name:\n\t\t\tsongs = self.db.artists.find_one({'name': str(artist_name).lower()})\n\t\t\tlyrics = []\n\t\t\tfor song in songs:\n\t\t\t\tlyrics.append((song, self.get_existing_lyrics(song)))\n\t\t\treturn lyrics\n\t\tif artist... | [
"0.7337023",
"0.7273111",
"0.7094758",
"0.7002123",
"0.69559246",
"0.6906283",
"0.68769586",
"0.67845184",
"0.6732645",
"0.6729208",
"0.67228436",
"0.66736853",
"0.64525306",
"0.64420724",
"0.64257854",
"0.64139456",
"0.62639374",
"0.6260215",
"0.6256235",
"0.6239402",
"0.622... | 0.73320913 | 1 |
Count the number of word appearence in the tokenized sentences | def count_words(tokenized_sentences):
word_counts = {}
# Loop through each sentence
for sentence in tokenized_sentences: # complete this line
for token in sentence: # complete this line
# If the token is not in the dictionary yet, set the count to 1
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def count_words(sent):\n words = word_tokenize(sent)\n return len(words)",
"def sentence_count(self, doc):\n\n return len(sent_tokenize(doc))",
"def word_count(text, word):\n \n #answer\n word_list = text.split(\" \")\n return (word_list.count(word))\n \n #return (text.count(word... | [
"0.7617381",
"0.7462791",
"0.7449279",
"0.7415982",
"0.74034137",
"0.7386679",
"0.7309361",
"0.72987705",
"0.7293668",
"0.72902036",
"0.7278598",
"0.72138023",
"0.7211503",
"0.7164739",
"0.7159316",
"0.71319926",
"0.7125319",
"0.7078794",
"0.7071918",
"0.70216846",
"0.7019571... | 0.7493141 | 1 |
Replace words not in the given vocabulary with '' token. | def replace_oov_words_by_unk(tokenized_sentences, vocabulary, unknown_token="<unk>"):
# Place vocabulary into a set for faster search
vocabulary = set(vocabulary)
# Initialize a list that will hold the sentences
# after less frequent words are replaced by the unknown token
replaced_... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _replace_oov(original_vocab, line):\n return u\" \".join([\n word if word in original_vocab else u\"<UNK>\" for word in line.split()\n ])",
"def remove_unused_words(text_list, vocab):\n vocabset = set(vocab)\n for i in range(0, len(text_list)):\n tokens = word_tokenize(text_list[i])... | [
"0.6602431",
"0.6342179",
"0.6128151",
"0.611547",
"0.60829765",
"0.5990552",
"0.59486204",
"0.59422237",
"0.59266746",
"0.59201443",
"0.59078217",
"0.5900242",
"0.5871093",
"0.5836927",
"0.5815773",
"0.5811374",
"0.5806493",
"0.57967186",
"0.578845",
"0.5749576",
"0.5745214"... | 0.7081734 | 0 |
Preprocess data, i.e., Find tokens that appear at least N times in the training data. Replace tokens that appear less than N times by "" both for training and test data. | def preprocess_data(train_data, test_data, count_threshold):
vocabulary = get_words_with_nplus_frequency(train_data, count_threshold)
train_data_replaced = replace_oov_words_by_unk(train_data, vocabulary, unknown_token="<unk>")
test_data_replaced = replace_oov_words_by_unk(test_data, vocabu... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _preprocess_training_model(self, data):\n def _pre_process(raw_data):\n \"\"\" Pre-process raw data. \"\"\"\n pattern = re.compile(\n r\"((?<=')\\w\\d.*?(?=')|(?<=\\\")\\w\\d.*?(?=\\\")|[\\w\\d]+)\")\n words = re.findall(pattern, raw_data)\n ret... | [
"0.6061158",
"0.6003799",
"0.59167343",
"0.5882328",
"0.58252066",
"0.57640445",
"0.5758573",
"0.57493186",
"0.5744078",
"0.5735459",
"0.5712312",
"0.5704892",
"0.5697948",
"0.56947964",
"0.56652105",
"0.5663462",
"0.56568533",
"0.56415796",
"0.56392795",
"0.56379956",
"0.560... | 0.6746698 | 0 |
Estimate the probabilities of a next word using the ngram counts with ksmoothing | def estimate_probability(word, previous_n_gram,
n_gram_counts, n_plus1_gram_counts, vocabulary_size, k=1.0):
# Note : 1 . Here we are actually not considering the end token or start token as a part of a vocabulary.
# 2 . Although the literature says we need to prepend the n-... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def estimate_probabilities(previous_n_gram, n_gram_counts, n_plus1_gram_counts, vocabulary, k=1.0):\r\n \r\n previous_n_gram = tuple(previous_n_gram)\r\n \r\n # add <e> <unk> to the vocabulary\r\n # <s> is not needed since it should not appear as the next word\r\n vocabulary = vocabulary + [\"<e>... | [
"0.74821526",
"0.74173266",
"0.6932313",
"0.688375",
"0.6883651",
"0.68540484",
"0.6772214",
"0.6771649",
"0.6733969",
"0.6725363",
"0.67179155",
"0.6700296",
"0.6697444",
"0.6677283",
"0.667139",
"0.6662837",
"0.66225934",
"0.65881705",
"0.654686",
"0.65243745",
"0.6520518",... | 0.7778338 | 0 |
Estimate the probabilities of next words using the ngram counts with ksmoothing | def estimate_probabilities(previous_n_gram, n_gram_counts, n_plus1_gram_counts, vocabulary, k=1.0):
previous_n_gram = tuple(previous_n_gram)
# add <e> <unk> to the vocabulary
# <s> is not needed since it should not appear as the next word
vocabulary = vocabulary + ["<e>", "<unk>"]
v... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def estimate_probability(word, previous_n_gram, \r\n n_gram_counts, n_plus1_gram_counts, vocabulary_size, k=1.0):\r\n # Note : 1 . Here we are actually not considering the end token or start token as a part of a vocabulary.\r\n # 2 . Although the literature says we need to pre... | [
"0.7615251",
"0.73693436",
"0.7088111",
"0.6850206",
"0.68482757",
"0.68276954",
"0.6827658",
"0.67789626",
"0.6686724",
"0.6685362",
"0.6677109",
"0.6668146",
"0.6667171",
"0.66660374",
"0.6639589",
"0.66377604",
"0.66056037",
"0.6548708",
"0.6537098",
"0.6529498",
"0.652188... | 0.7573231 | 1 |
Tests if synchronization of BatchNorm running variables is done correctly. If not, the test sometimes fails depending on the timing. | def test_batchnorm_backward_synchronization(variable):
ctx = mx.test_utils.default_context()
for _ in range(20):
layer = nn.BatchNorm()
layer.initialize(ctx=ctx)
for _ in range(3):
data = mx.nd.random.normal(loc=10, scale=2, shape=(1, 3, 10, 10), ctx=ctx)
with mx... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_accurate(self):\n M = simulation.StateMonitor(self.G, ['v', 'a', 'b'])\n sim = simulation.Simulation(self.G, M, dt=self.dt)\n sim.run(self.t_max)\n\n v_expected = np.array([i*(M.t+self.dt) for i in xrange(self.N)])\n a_expected = np.array([(M.t+self.dt) for i in xrange(2)])\n b_expected ... | [
"0.5811565",
"0.5776147",
"0.57297295",
"0.5717188",
"0.5704598",
"0.56966186",
"0.5672458",
"0.5672458",
"0.5664334",
"0.56633675",
"0.5663177",
"0.56511474",
"0.56041586",
"0.55342144",
"0.55163217",
"0.55150723",
"0.5511531",
"0.5488517",
"0.5475028",
"0.5462357",
"0.54623... | 0.64638484 | 0 |
This test will test gluon Conv2d computation with ndarray reshape and slice | def test_reshape_conv_slice_conv():
class Net(gluon.HybridBlock):
def __init__(self, **kwargs):
super(Net, self).__init__(**kwargs)
self.conv0 = nn.Conv2D(16, (3, 3))
self.conv1 = nn.Conv2D(32, (3, 3))
def hybrid_forward(self, F, x):
x_reshape = x.res... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_on_conv_transpose_2d_stride(self):\n\n # Channels/Colors, #filters, filter_size (square)\n conv_filter = objax.nn.ConvTranspose2D(1, 1, 2, strides=2, padding=objax.ConvPadding.VALID)\n weights = objax.TrainVar(jn.array([[[[1., 2.], [3., 4.]]]]).transpose((2, 3, 0, 1)))\n conv_f... | [
"0.64521396",
"0.6350162",
"0.6259762",
"0.62232983",
"0.5972081",
"0.58870715",
"0.58732164",
"0.58533806",
"0.58028793",
"0.5777304",
"0.5774341",
"0.5769469",
"0.57545286",
"0.57238346",
"0.5693811",
"0.5691685",
"0.5674894",
"0.56746215",
"0.56586695",
"0.56216735",
"0.56... | 0.746777 | 0 |
test of the deformable convolution layer with possible combinations of arguments, currently this layer only supports gpu | def test_DeformableConvolution():
try:
ctx = mx.gpu()
_ = mx.nd.array([0], ctx=ctx)
except mx.base.MXNetError:
pytest.skip("deformable_convolution only supports GPU")
net = nn.HybridSequential()
net.add(
nn.DeformableConvolution(10, kernel_size=(3, 3), strides=1, padding=... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_convolution():\n # Default test\n inputs_shape = [3,3,4,5,3]\n filters_shape = [3,1,4,4,3]\n test_convolution_for_parameters(inputs_shape, filters_shape,\n \"Default test\")\n # All dimensions 1\n inputs_shape = [1,1,1,1,1]\n filters_shape = [1,1,1,1,1]\n test_convolution_fo... | [
"0.7269497",
"0.6683888",
"0.66708",
"0.6657417",
"0.65726745",
"0.6570255",
"0.65093976",
"0.6430958",
"0.64284265",
"0.64011234",
"0.6392936",
"0.6368816",
"0.63625634",
"0.6359098",
"0.6351884",
"0.6337893",
"0.6317088",
"0.63127106",
"0.6303878",
"0.6287933",
"0.6275435",... | 0.72274894 | 1 |
Decode data using Base58 with checksum + validate binary prefix against known kinds and cut in the end. | def base58_decode(v: bytes) -> bytes:
try:
prefix_len = next(
len(encoding[2])
for encoding in base58_encodings
if len(v) == encoding[1] and v.startswith(encoding[0])
)
except StopIteration:
raise ValueError('Invalid encoding, prefix or length mismatch... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def decode(data): #@NoSelf",
"def decode_base58(v):\n prefix = b''\n while v.startswith(B58[0]):\n prefix += b'\\0' \n v = v[1:]\n if v:\n return prefix + bytes(changebase(map(B58.index,v),58,256))\n else:\n return prefix",
"def decode_base58(smartAddress, length):\n ... | [
"0.6602605",
"0.64927113",
"0.64443916",
"0.62492216",
"0.62080365",
"0.619027",
"0.61788976",
"0.6170863",
"0.6149853",
"0.6147521",
"0.61274546",
"0.60597515",
"0.6044749",
"0.6037242",
"0.60230505",
"0.5963487",
"0.5961462",
"0.5904631",
"0.58395714",
"0.5832637",
"0.58282... | 0.6563954 | 1 |
Encode data using Base58 with checksum and add an according binary prefix in the end. | def base58_encode(v: bytes, prefix: bytes) -> bytes:
try:
encoding = next(
encoding
for encoding in base58_encodings
if len(v) == encoding[3] and prefix == encoding[0]
)
except StopIteration:
raise ValueError('Invalid encoding, prefix or length mismatc... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def encode_base58(v):\n prefix = ''\n while v.startswith(b'\\0'):\n prefix += B58[0]\n v = v[1:]\n if v:\n return prefix + \"\".join(map(B58.__getitem__,changebase(v,256,58)))\n else:\n return prefix",
"def encodeBase58(b):\n\n # Convert big-endian bytes to integer\n ... | [
"0.70724696",
"0.6632244",
"0.6603221",
"0.6598464",
"0.64405864",
"0.6418468",
"0.6358167",
"0.6353305",
"0.6276732",
"0.62214285",
"0.620784",
"0.61473995",
"0.61473995",
"0.61406887",
"0.60909486",
"0.60333896",
"0.59782445",
"0.5919662",
"0.5898684",
"0.5800322",
"0.57676... | 0.6900391 | 1 |
Ensure parameter is a signature (starts with b'edsig', b'spsig', b'p2sig', b'sig') | def validate_sig(v):
return _validate(v, prefixes=[b'edsig', b'spsig', b'p2sig', b'sig']) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def handle_signature(self, sig, signode):\n raise NotImplementedError",
"def verify_signature(self, inputs, signature):\n pass",
"def verify_signature(self, inputs, signature):\n pass",
"def is_sig(v) -> bool:\n try:\n validate_sig(v)\n except (ValueError, TypeError):\n ... | [
"0.6984241",
"0.6863024",
"0.6863024",
"0.6688042",
"0.65859014",
"0.65519154",
"0.6541594",
"0.6447844",
"0.64444005",
"0.6391872",
"0.6352082",
"0.62802094",
"0.6272137",
"0.62499684",
"0.6246215",
"0.62437516",
"0.62152314",
"0.62086046",
"0.6207301",
"0.62011003",
"0.6181... | 0.7479288 | 0 |
Check if value is a public key hash. | def is_pkh(v) -> bool:
try:
validate_pkh(v)
except (ValueError, TypeError):
return False
return True | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def is_hashable(v):\n try:\n hash(v)\n except TypeError:\n return False\n return True",
"def isPubKeyScript(script):\n return extractPubKey(script) is not None",
"def is_valid_openssh_pubkey(pubkey):\n try:\n key_type, data64 = map(_encode, pubkey.split()[0:2])\n except (... | [
"0.67409515",
"0.659099",
"0.64974666",
"0.63446534",
"0.6257852",
"0.6159801",
"0.61466223",
"0.61129725",
"0.60186255",
"0.60045224",
"0.5983083",
"0.59496933",
"0.5892566",
"0.5889949",
"0.5885266",
"0.58637184",
"0.58532447",
"0.58523494",
"0.58180124",
"0.581712",
"0.581... | 0.7120274 | 0 |
Check if value is a signature. | def is_sig(v) -> bool:
try:
validate_sig(v)
except (ValueError, TypeError):
return False
return True | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def signature_check(dummy, *args, **kwargs):\n try:\n dummy(*args, **kwargs)\n return True\n\n except TypeError:\n return False",
"def validate_signature(self):\n return self.signature == 0xAA55",
"def test_getSignature(self):\n self.assertTrue(ChangeType().getSignature... | [
"0.68957675",
"0.6686011",
"0.66773546",
"0.6527772",
"0.6527772",
"0.65027124",
"0.64748037",
"0.644731",
"0.64070964",
"0.63563985",
"0.63101876",
"0.628181",
"0.62342256",
"0.623201",
"0.62298864",
"0.6224969",
"0.62241024",
"0.6198478",
"0.6162049",
"0.6135398",
"0.612058... | 0.7492645 | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.