query stringlengths 10 2k | document stringlengths 20 51.2k | metadata dict | negatives listlengths 0 101 | negative_scores listlengths 0 101 | document_score stringlengths 3 10 | document_rank stringclasses 102
values |
|---|---|---|---|---|---|---|
Test that conversion/creation of a molecule to and from a OEMol is consistent. | def test_to_from_oemol(self, molecule):
from openforcefield.utils.toolkits import UndefinedStereochemistryError
# Known failures raise an UndefinedStereochemistryError, but
# the round-trip SMILES representation with the OpenEyeToolkit
# doesn't seem to be affected.
# ZINC test ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_to_from_oemol(self, molecule):\n from openff.toolkit.utils.toolkits import UndefinedStereochemistryError\n\n # Known failures raise an UndefinedStereochemistryError, but\n # the round-trip SMILES representation with the OpenEyeToolkit\n # doesn't seem to be affected.\n #... | [
"0.82583815",
"0.73012424",
"0.73012424",
"0.71082246",
"0.7058801",
"0.68407565",
"0.6821443",
"0.671145",
"0.6653839",
"0.6643768",
"0.6643768",
"0.66434765",
"0.6641016",
"0.66356105",
"0.66356105",
"0.66201884",
"0.65998924",
"0.65998924",
"0.65876347",
"0.65823036",
"0.6... | 0.8324088 | 0 |
Test the backend toolkits in enumerating the stereo centers in a molecule. | def test_enumerating_stereocenters(self, toolkit_class):
if toolkit_class.is_available():
toolkit = toolkit_class()
mol = Molecule.from_smiles(
"NC(Cl)(F)O", toolkit_registry=toolkit, allow_undefined_stereo=True
)
isomers = mol.enumerate_stereois... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_enumerating_stereobonds(self, toolkit_class):\n\n if toolkit_class.is_available():\n toolkit = toolkit_class()\n mol = Molecule.from_smiles(\n \"ClC=CCl\", allow_undefined_stereo=True, toolkit_registry=toolkit\n )\n\n # use the default opti... | [
"0.7157327",
"0.7157327",
"0.70622164",
"0.7057003",
"0.59361756",
"0.577735",
"0.5671695",
"0.5393179",
"0.536632",
"0.5321081",
"0.51404494",
"0.51288855",
"0.5120504",
"0.5090461",
"0.50812054",
"0.5012612",
"0.49996713",
"0.4958146",
"0.49500802",
"0.49466363",
"0.4905868... | 0.6923712 | 5 |
Test the ability to make a valid molecule using RDKit and SMILES together | def test_from_pdb_and_smiles(self):
# try and make a molecule from a pdb and smiles that don't match
with pytest.raises(InvalidConformerError):
mol = Molecule.from_pdb_and_smiles(
get_data_file_path("molecules/toluene.pdb"), "CC"
)
# make a molecule from ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_to_from_rdkit(self, molecule):\n # import pickle\n from openforcefield.utils.toolkits import UndefinedStereochemistryError\n\n undefined_stereo = molecule.name in rdkit_drugbank_undefined_stereo_mols\n\n toolkit_wrapper = RDKitToolkitWrapper()\n\n rdmol = molecule.to_rdk... | [
"0.69082093",
"0.68554944",
"0.6579094",
"0.65135026",
"0.6504531",
"0.6489517",
"0.64114195",
"0.6182903",
"0.6182903",
"0.6100246",
"0.6096413",
"0.60949",
"0.6094857",
"0.60316676",
"0.60316676",
"0.60291517",
"0.6025501",
"0.60045904",
"0.59858847",
"0.5966739",
"0.595387... | 0.59253067 | 23 |
Recurses through an attribute chain to get the ultimate value. | def deepgetattr(obj, attr):
return reduce(getattr, attr.split('.'), obj) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def next(self):\n nextattr = self.iterobj.next()\n return (nextattr.name, self.attrs[nextattr.name])",
"def MoveToNextAttribute(self):\n ret = libxml2mod.xmlTextReaderMoveToNextAttribute(self._o)\n return ret",
"def anchor(self):\n # self.attributes cannot be empty; will cause an... | [
"0.6245542",
"0.5892809",
"0.57735795",
"0.56988555",
"0.5631888",
"0.5629462",
"0.5474027",
"0.5471676",
"0.5432267",
"0.539955",
"0.5399531",
"0.5380925",
"0.5324794",
"0.52837795",
"0.5256184",
"0.5241891",
"0.52075005",
"0.5186021",
"0.51850945",
"0.5178596",
"0.5164916",... | 0.5162175 | 21 |
View function for home page of site. | def index(request):
# Generate counts of some of the main objects
num_inventions = Invention.objects.all().count()
inventions = Invention.objects.order_by('-date_of_invention')
inventions_to_random = list(Invention.objects.all())
random_invention = random.choice(inventions_to_random)
context =... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def home(request):\n\treturn render(request, \"compta/home.html\")",
"def home_page(request):\r\n return render(request, 'ez_main/home_page.html')",
"def home(request):\r\n return render(request, 'home.html')",
"def homepage(request):\n\treturn render(request, 'core/homepage.html')",
"def homepage(req... | [
"0.84922695",
"0.8426602",
"0.8340574",
"0.8330692",
"0.82977676",
"0.82949847",
"0.8276351",
"0.82544136",
"0.8214832",
"0.81321204",
"0.81241804",
"0.8121797",
"0.81211257",
"0.81044704",
"0.80983806",
"0.80930847",
"0.80930847",
"0.80930847",
"0.80930847",
"0.80930847",
"0... | 0.0 | -1 |
to check if a point is contained in the rectangle or not | def in_rectangle(rect, point):
if point[0] < rect[0]:
return False
elif point[1] < rect[1]:
return False
elif point[0] > rect[0] + rect[2]:
return False
elif point[1] > rect[1] + rect[3]:
return False
return True | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def inside(point, rectangle):\n\n ll = rectangle.getP1() # assume p1 is ll (lower left)\n ur = rectangle.getP2() # assume p2 is ur (upper right)\n\n return ll.getX() < point.getX() < ur.getX() and ll.getY() < point.getY() < ur.getY()",
"def inside(point, rectangle):\r\n\r\n ll = rectangle.getP1() # assu... | [
"0.8310883",
"0.8241955",
"0.81068945",
"0.80331653",
"0.7967455",
"0.78360134",
"0.77460456",
"0.77460456",
"0.7730189",
"0.7724261",
"0.76543295",
"0.7641363",
"0.76203346",
"0.7611343",
"0.7551089",
"0.7551089",
"0.75337815",
"0.7530262",
"0.75177115",
"0.7512302",
"0.7488... | 0.8450774 | 0 |
Returns a tuple of field names. | def field_names(cls) -> tuple:
return tuple((field.name for field in fields(cls))) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_field_names() -> Sequence[str]:\n raise NotImplementedError",
"def get_field_names(self):\n return {rv[0] for rv in self.iter_fields()}",
"def field_names(self):\r\n return self._names",
"def get_field_names(self):\n return self._keys",
"def field_names(self):\n .... | [
"0.78421026",
"0.77883655",
"0.75145245",
"0.7439225",
"0.73496604",
"0.7274087",
"0.7273737",
"0.7246884",
"0.71890664",
"0.7170742",
"0.7016583",
"0.6918991",
"0.68049383",
"0.6802004",
"0.67555517",
"0.6730604",
"0.66912097",
"0.6675862",
"0.6635355",
"0.6614477",
"0.66084... | 0.89433205 | 0 |
Returns atomic number from atomic symbol. Takes advantage of the fact that sym indices match atomic numbers. | def get_num(elem):
if isinstance(elem, str):
return _find_index(elem)
else:
for atm in elem:
if atm not in sym and atm[0] not in ['X', 'D']:
raise ValueError('Unrecognized atomic symbol \'' + atm +
'\'. Use X prefix for dummy atoms.')
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def atomic_number(sym):\n return _atomic_number[sym]",
"def sym2num(self, sym):\n try:\n atomic_number = qcel.periodictable.to_Z(sym)\n return atomic_number\n except:\n raise KeyError('{} is not defined.'.format(sym))",
"def atomic_number(self):\n return... | [
"0.85590076",
"0.75819165",
"0.730242",
"0.721978",
"0.6977734",
"0.6967528",
"0.6754133",
"0.6716392",
"0.6709546",
"0.66599625",
"0.64305854",
"0.63859236",
"0.6379038",
"0.63148457",
"0.6274584",
"0.62233114",
"0.61982584",
"0.61742985",
"0.61668146",
"0.6157897",
"0.61395... | 0.6779381 | 6 |
Returns atomic mass from atomic symbol. | def get_mass(elem):
return mass[get_num(elem)] | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_mass(atomic_symbol: str) -> float:\n\n if atomic_symbol in _masses.keys():\n return _masses[atomic_symbol]\n\n else:\n return 0",
"def mass(self):\n self.check_symbols()\n return self._tree_mass(self._tokentree())",
"def atoms(self, symbol): \n # this is a stub ... | [
"0.84908104",
"0.7461335",
"0.71745545",
"0.7171534",
"0.706067",
"0.6800476",
"0.668391",
"0.6642328",
"0.65357614",
"0.6503221",
"0.6500108",
"0.6500108",
"0.64525014",
"0.6429461",
"0.6383675",
"0.6369142",
"0.63540107",
"0.63485736",
"0.62571347",
"0.6242836",
"0.62148595... | 0.71365196 | 4 |
Returns a unit vector aligned with a given vector. | def unit_vec(v):
vlen = np.linalg.norm(v)
if np.isclose(vlen, 0):
raise ValueError('Cannot make unit vector from zero vector.')
else:
return v / vlen | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def unit_vector(vector):\r\n return vector / np.linalg.norm(vector)",
"def unit_vector(vector):\r\n return vector / np.linalg.norm(vector)",
"def unit_vector(vector):\r\n return vector / np.linalg.norm(vector)",
"def unit_vector(vector):\n return vector / np.linalg.norm(vector)",
"def cal_u... | [
"0.75052565",
"0.75052565",
"0.75052565",
"0.75004476",
"0.7491232",
"0.7485972",
"0.7485972",
"0.7485972",
"0.7485972",
"0.7485972",
"0.7485972",
"0.7485972",
"0.7485972",
"0.7485972",
"0.7485972",
"0.7485972",
"0.7416823",
"0.74041307",
"0.7322439",
"0.7313993",
"0.72790015... | 0.69144756 | 27 |
Returns one array of zeros of width 'width' and height 'height'. | def createBoard(width, height):
board = []
for i in range(height):
board = board+[createOneRow(width)]
return board
# or
| {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def zeroes(height, width):\n g = [[0.0 for _ in range(width)] for __ in range(height)]\n return Matrix(g)",
"def zeroes(height, width):\n g = [[0.0 for _ in range(width)] for __ in range(height)]\n return Matrix(g)",
"def zeroMatrix(width, height):\n returnvalue = Matrix()\n for i in ... | [
"0.77574855",
"0.7726719",
"0.71535176",
"0.69896567",
"0.68397814",
"0.6793865",
"0.654905",
"0.6485378",
"0.64687663",
"0.63293135",
"0.63075435",
"0.6288157",
"0.6254956",
"0.62060666",
"0.6189029",
"0.6173044",
"0.61704206",
"0.616605",
"0.6149521",
"0.6107413",
"0.61015"... | 0.54595923 | 91 |
Returns a wrapped CNN model constructor. | def get_cnn_fn(model, num_classes):
model = model.lower()
assert model == "cnn"
if num_classes != 10:
raise ValueError(
f"Model {model} supports only 10 classes, {num_classes} given.")
def cnn_model_fn(*args, **kwargs):
return cnn.CifarNet(*args, **kwargs)
return cnn_model_fn | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def C(cls, *args, **kwargs):\n return cls(*args, model_type='classifier', **kwargs)",
"def create_model():\n\n class Net(nn.Cell):\n def construct(self, x, y):\n return x\n\n net = Net()\n model_simple = Model(net)\n\n return model_simple",
"def create_cnn_model() -> tf.ker... | [
"0.667096",
"0.66347814",
"0.64850247",
"0.6474756",
"0.64209986",
"0.62750787",
"0.61927235",
"0.61323243",
"0.61217165",
"0.61148286",
"0.6091219",
"0.6090807",
"0.60760176",
"0.60310566",
"0.6005526",
"0.60045373",
"0.5984382",
"0.5968784",
"0.5967929",
"0.5967693",
"0.596... | 0.5817169 | 36 |
Returns a wrapped EfficientNet model constructor. | def get_efficientnet_fn(model, num_classes,
spatial_res):
model = model.lower()
assert model in EFFICIENTNET_FNS
efficientnet_fn = EFFICIENTNET_FNS[model]
model_config = efficientnet_fn.keywords["config"]
expected_res = model_config.resolution
assert spatial_res == expected_res
d... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create_model():\n\n class Net(nn.Cell):\n def construct(self, x, y):\n return x\n\n net = Net()\n model_simple = Model(net)\n\n return model_simple",
"def _model(self):\n\n model = glmnet.ElasticNet(\n alpha=self.alpha,\n n_lambda=self.n_lambda,\n ... | [
"0.6801406",
"0.652543",
"0.6444488",
"0.64072645",
"0.6260032",
"0.6028678",
"0.6027558",
"0.6001161",
"0.5996849",
"0.5982603",
"0.59799415",
"0.59487045",
"0.5924774",
"0.5916198",
"0.5906381",
"0.58712703",
"0.58695173",
"0.58648163",
"0.58566266",
"0.58239526",
"0.582169... | 0.58274144 | 19 |
Returns a model constructor for the given dataset. | def get_model_fn(model, num_classes, spatial_res):
model = model.lower()
if model == "cnn": return get_cnn_fn(model, num_classes)
if model in RESNET_FNS: return get_resnet_fn(model, num_classes, spatial_res)
if model in VIT_FNS: return get_vit_fn(model, num_classes, spatial_res)
if model in EFFICIENTNET_FNS:... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get(dataset_name: str, split: Union[Tuple[str, float], str, tfds.Split],\n **hyperparameters: Any) -> BaseDataset:\n hyperparameters_py = {\n k: (v.numpy().tolist() if isinstance(v, tf.Tensor) else v)\n for k, v in hyperparameters.items()\n }\n logging.info('Building dataset %s with additio... | [
"0.62687635",
"0.6252294",
"0.6173669",
"0.6159556",
"0.6089584",
"0.6054897",
"0.60505676",
"0.6034766",
"0.60226125",
"0.5949359",
"0.58896005",
"0.5851889",
"0.5850449",
"0.58474064",
"0.58121055",
"0.57985777",
"0.5783102",
"0.578021",
"0.57589734",
"0.5758166",
"0.575199... | 0.0 | -1 |
Assert that add_to_section returns a 500 response on missing section id | def test_add_to_section_raises_exception_on_missing_section_id(self, log_replacement, add_to_section_replacement):
request = self.add_to_section_stub()
request_body = copy.deepcopy(self.add_to_section_stub_body)
del request_body['section_id']
request.body = json.dumps(request_body)
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_add_to_section_raises_exception_on_missing_enrollment_id(self, log_replacement,\n add_to_section_replacement):\n request = self.add_to_section_stub()\n request_body = copy.deepcopy(self.add_to_section_stub_body)\n de... | [
"0.79564923",
"0.71091634",
"0.71000695",
"0.7062644",
"0.7009703",
"0.69811726",
"0.69702625",
"0.669115",
"0.6609586",
"0.65188605",
"0.6345448",
"0.62681305",
"0.62654775",
"0.62614805",
"0.62379235",
"0.6233521",
"0.61657935",
"0.6151126",
"0.6126622",
"0.61231154",
"0.60... | 0.85912484 | 0 |
Assert that add_to_section returns a 500 response when the enrollment_user_id is missing | def test_add_to_section_raises_exception_on_missing_enrollment_id(self, log_replacement,
add_to_section_replacement):
request = self.add_to_section_stub()
request_body = copy.deepcopy(self.add_to_section_stub_body)
del request... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_add_to_section_raises_exception_on_missing_section_id(self, log_replacement, add_to_section_replacement):\n request = self.add_to_section_stub()\n request_body = copy.deepcopy(self.add_to_section_stub_body)\n del request_body['section_id']\n request.body = json.dumps(request_bo... | [
"0.73721343",
"0.7199879",
"0.6951588",
"0.66903543",
"0.6499271",
"0.6488857",
"0.63532686",
"0.6320457",
"0.6229216",
"0.6103467",
"0.6087641",
"0.60826296",
"0.6049243",
"0.60354567",
"0.6034584",
"0.60172343",
"0.5996058",
"0.5948266",
"0.5924394",
"0.5912905",
"0.5908914... | 0.8048934 | 0 |
Computes the MAE (Absolute mean error) of a model and it's estimation. | def MAE(y,yhat):
y = np.asarray(y)
yhat = np.asarray(yhat)
if y.size != yhat.size:
raise(ValueError("y and yhat should be of same size now\n\
size(y) = %d and size(yhat) = %d"%(y.size,yhat.size)))
N = yhat.size
y = y.reshape(N,)
yhat = yhat.reshape(N,)
res ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def compute_MAE(e):\n\n return np.mean(np.abs(e))",
"def mae(t, y):\n\treturn mean_absolute_error(t, y)",
"def calculate_mae(e):\n return np.mean(np.abs(e))",
"def compute_mae(e):\n return np.mean(np.abs(e))",
"def evaluate_mae(y_true, y_pred):\n\n mae_eval = mean_absolute_error(y_true, y_pred)... | [
"0.7279308",
"0.7156518",
"0.70256644",
"0.70224005",
"0.6782374",
"0.6677394",
"0.65602106",
"0.6478774",
"0.6435798",
"0.6390062",
"0.6319024",
"0.6311888",
"0.628916",
"0.6272632",
"0.6176508",
"0.61370945",
"0.60777014",
"0.59942853",
"0.5986643",
"0.59841144",
"0.5968866... | 0.64310086 | 9 |
This function computes the sigmoid function for input of any shape. | def sigmoid(x):
s = 1 / (1 + np.exp(-x))
return s | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def sigmoid(x: np.ndarray \n ) -> np.ndarray:\n return 1/(1+np.exp(-x))",
"def sigmoid(X):\n if isinstance(X,(list,tuple)):\n X=np.array(X)\n return 1/(1+np.exp(-X))\n #return np.exp(X)/(1+np.exp(X))",
"def sigmoid(input, inplace=False):\n return FunctionLib.apply(\n ... | [
"0.8066344",
"0.8038076",
"0.7825029",
"0.78241545",
"0.7824091",
"0.7819388",
"0.78188354",
"0.78188354",
"0.78188354",
"0.78188354",
"0.78188354",
"0.78188354",
"0.7802458",
"0.7792177",
"0.77921164",
"0.77920294",
"0.7782615",
"0.7775444",
"0.7747167",
"0.7735811",
"0.7735... | 0.75871724 | 26 |
Break a path apart into a list for each path element. | def path_split(path):
res = []
while path:
path, tail = os.path.split(path)
res.insert(0, tail)
if path == '/':
res.insert(0, '/')
break
return res | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def path_elements(path):\n result = []\n (head, tail) = os.path.split(path)\n while tail != \"\":\n result.insert(0, tail)\n (head, tail) = os.path.split(head)\n result.insert(0, head)\n return result",
"def get_path_list(path):\n # Build the path from end back to beginning.\n ... | [
"0.77347565",
"0.71221983",
"0.71000063",
"0.6955657",
"0.69539255",
"0.67349064",
"0.6597032",
"0.6562261",
"0.65471804",
"0.6535775",
"0.6526729",
"0.65114266",
"0.65045553",
"0.6471561",
"0.644182",
"0.63971245",
"0.6394897",
"0.6376945",
"0.63757855",
"0.63747025",
"0.636... | 0.68024445 | 5 |
Returns array of indices along axis, for all other axes | def axis_index(shape, axis=-1):
return operator.getitem(numpy.mgrid, [slice(i) for i in shape])[axis] | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def atom_idxs(self):\n\n return np.array([atom.atom_idxs for atom in self])",
"def indices(self) -> np.ndarray:\n return self.impl.indices",
"def mapping_to_indices(coords, batch_size):\n h, w = coords.shape[:2]\n indices_axis_0 = list(np.repeat(np.arange(batch_size), h * w))\n indices_a... | [
"0.70322984",
"0.692507",
"0.676278",
"0.6667636",
"0.66450703",
"0.65533537",
"0.6547579",
"0.6493251",
"0.6441472",
"0.64175105",
"0.6391537",
"0.63064754",
"0.62541765",
"0.62367296",
"0.6224504",
"0.6192762",
"0.6188242",
"0.61473554",
"0.614311",
"0.61364454",
"0.6125790... | 0.666541 | 4 |
Display the home page | def home():
columns_to_hide = ('vautoid', 'carfaxid', 'body_type', 'created_at')
db_handler = DBHandler()
records = db_handler.get_all_potential_records()
table_headers = list(records[0].keys())
make_model_records = db_handler.get_all_make_models()
make_model = defaultdict(list)
for record i... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def home():\n\n return render_template('home_page.html')",
"def home():\n\n\treturn render_template('index.html', title='Home Page',\n\t\t\t\t\t\t year=datetime.now().year)",
"def home():\n return render_template(\n 'home.html',\n title='Home Page',\n year=datetime.now().year,\n ... | [
"0.84154546",
"0.8336359",
"0.8303906",
"0.8283079",
"0.82613885",
"0.82608587",
"0.8207477",
"0.8204498",
"0.8197835",
"0.81842333",
"0.8171562",
"0.8171562",
"0.8171562",
"0.8171562",
"0.8171562",
"0.8171562",
"0.8171562",
"0.8171562",
"0.8171562",
"0.8171562",
"0.8171562",... | 0.0 | -1 |
Gets and sets the ageGroup | def age_group(self):
if "ageGroup" in self._prop_dict:
return self._prop_dict["ageGroup"]
else:
return None | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_age(self):\n return self.glb[iage]",
"def set_age(self, age):\n self.__age = age",
"def set_age(self, newage):\n self.age = newage",
"def age(self, age):\n\n self._age = age",
"def age(self, age):\n\n self._age = age",
"def setAge(self, age):\n self._age ... | [
"0.6436036",
"0.62792027",
"0.62474054",
"0.62106186",
"0.62106186",
"0.618945",
"0.61576265",
"0.6142905",
"0.61323005",
"0.6097176",
"0.60894567",
"0.60492367",
"0.60492367",
"0.60492367",
"0.604198",
"0.60255456",
"0.6011024",
"0.6008636",
"0.5994709",
"0.5988051",
"0.5956... | 0.8097874 | 0 |
Gets and sets the assignedLicenses | def assigned_licenses(self):
if "assignedLicenses" in self._prop_dict:
return AssignedLicensesCollectionPage(self._prop_dict["assignedLicenses"])
else:
return None | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def licenses(self) -> Sequence[str]:\n return pulumi.get(self, \"licenses\")",
"def getLicenseList(self):\n\n res = self.getRequest('licenses')\n licenses = list()\n if res:\n for item in iter(res['items']):\n lic = vsdModels.License(**item)\n ... | [
"0.6897708",
"0.6254715",
"0.61177564",
"0.609027",
"0.60361576",
"0.59345907",
"0.5908067",
"0.5903719",
"0.59017825",
"0.58795035",
"0.58350414",
"0.5832295",
"0.57833743",
"0.57775646",
"0.5727853",
"0.57235974",
"0.57022923",
"0.5647265",
"0.56455535",
"0.5622698",
"0.558... | 0.76799256 | 0 |
Gets and sets the companyName | def company_name(self):
if "companyName" in self._prop_dict:
return self._prop_dict["companyName"]
else:
return None | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def company_name(self) -> Optional[str]:\n return pulumi.get(self, \"company_name\")",
"def company_name(self, company_name):\n\n self._company_name = company_name",
"def get_company_name(self):\n\t\treturn call_sdk_function('PrlLic_GetCompanyName', self.handle)",
"def get_company(self, name):\... | [
"0.8165078",
"0.7987054",
"0.766596",
"0.74528766",
"0.7445594",
"0.7256456",
"0.72514653",
"0.7121977",
"0.7121977",
"0.67730284",
"0.67238736",
"0.6648773",
"0.6646196",
"0.655062",
"0.65222317",
"0.6515245",
"0.6515245",
"0.64932334",
"0.64740187",
"0.64345896",
"0.6304762... | 0.8366031 | 0 |
Gets and sets the displayName | def display_name(self):
if "displayName" in self._prop_dict:
return self._prop_dict["displayName"]
else:
return None | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def display_name(self):\n return self.properties.get(\"displayName\", None)",
"def display_name(self):\n return self.settings['displayName']",
"def displayName( self ):\n if ( not self._displayName ):\n return projex.text.pretty(self.objectName())\n return self._displayNa... | [
"0.8024549",
"0.79686785",
"0.770907",
"0.7293372",
"0.7293372",
"0.7293372",
"0.72066224",
"0.71439695",
"0.7096268",
"0.70412254",
"0.70148575",
"0.69626147",
"0.69534314",
"0.69334805",
"0.69321233",
"0.69321233",
"0.69321233",
"0.69321233",
"0.69321233",
"0.69321233",
"0.... | 0.80308217 | 1 |
Gets and sets the givenName | def given_name(self):
if "givenName" in self._prop_dict:
return self._prop_dict["givenName"]
else:
return None | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_name(self, name):\n\t\tself.name_ = name",
"def set_name(self, newname=\"\"):\n self.name = newname",
"def set_name(self, name):\n self.name = name # overwrite the existing name with the input name",
"def set_name(self, name):\n self.name = name # overwrite the existing name wi... | [
"0.74591374",
"0.72956353",
"0.729209",
"0.729209",
"0.72335297",
"0.7214102",
"0.7197493",
"0.71869636",
"0.71608263",
"0.71608263",
"0.71608263",
"0.71608263",
"0.71608263",
"0.7156019",
"0.7133252",
"0.71250564",
"0.71087",
"0.7074283",
"0.7062414",
"0.7062414",
"0.7062414... | 0.0 | -1 |
Gets and sets the jobTitle | def job_title(self):
if "jobTitle" in self._prop_dict:
return self._prop_dict["jobTitle"]
else:
return None | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_job_title(self, job_name):\n return ''",
"def job_title(self, job_title):\n if job_title is not None and len(job_title) > 1024:\n raise ValueError(\"Invalid value for `job_title`, length must be less than or equal to `1024`\") # noqa: E501\n\n self._job_title = job_title"... | [
"0.7751471",
"0.7429871",
"0.70529306",
"0.6987032",
"0.6912253",
"0.68738854",
"0.6861136",
"0.6861136",
"0.6861136",
"0.686059",
"0.686059",
"0.6854103",
"0.6796334",
"0.67932844",
"0.67806476",
"0.67806476",
"0.67806476",
"0.6723765",
"0.67198044",
"0.6706125",
"0.6689609"... | 0.8460252 | 0 |
Gets and sets the mailNickname | def mail_nickname(self):
if "mailNickname" in self._prop_dict:
return self._prop_dict["mailNickname"]
else:
return None | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def nickname(self):\n if (self.__email and self.__auth_domain and\n self.__email.endswith('@' + self.__auth_domain)):\n suffix_len = len(self.__auth_domain) + 1\n return self.__email[:-suffix_len]\n else:\n return self.__email",
"def get_nickname(self):\n return self._nick",
... | [
"0.73338854",
"0.718998",
"0.69004154",
"0.6647959",
"0.66387933",
"0.65298927",
"0.62826717",
"0.62164223",
"0.6182699",
"0.6182329",
"0.59796834",
"0.5952569",
"0.58784133",
"0.5858976",
"0.57478607",
"0.5725018",
"0.57170886",
"0.56794924",
"0.56790537",
"0.5664596",
"0.56... | 0.82559615 | 0 |
Gets and sets the onPremisesLastSyncDateTime | def on_premises_last_sync_date_time(self):
if "onPremisesLastSyncDateTime" in self._prop_dict:
return datetime.strptime(self._prop_dict["onPremisesLastSyncDateTime"].replace("Z", ""), "%Y-%m-%dT%H:%M:%S.%f")
else:
return None | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_last_sync(self):\n return self.app.sync_thread.last_sync.strftime('%H:%M')",
"def sync_time(self):\n return self.get_sync_time()",
"def on_premises_sync_enabled(self):\n if \"onPremisesSyncEnabled\" in self._prop_dict:\n return self._prop_dict[\"onPremisesSyncEnabled\"]\... | [
"0.632846",
"0.58777946",
"0.5856565",
"0.5856565",
"0.5851894",
"0.5776239",
"0.5776239",
"0.57247806",
"0.56911623",
"0.5652216",
"0.56261235",
"0.5572975",
"0.55634695",
"0.55447304",
"0.5527806",
"0.55213827",
"0.55021805",
"0.55021805",
"0.55021805",
"0.55021805",
"0.550... | 0.80932313 | 0 |
Gets and sets the passwordProfile | def password_profile(self):
if "passwordProfile" in self._prop_dict:
if isinstance(self._prop_dict["passwordProfile"], OneDriveObjectBase):
return self._prop_dict["passwordProfile"]
else :
self._prop_dict["passwordProfile"] = PasswordProfile(self._prop_dic... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def setting_profile(request):\n page = \"profile\"\n if request.method == \"POST\":\n form = PasswordChangeForm(request.user, request.POST)\n if form.is_valid():\n user = form.save()\n update_session_auth_hash(request, user) # Important!\n messages.success(requ... | [
"0.68734336",
"0.662896",
"0.6317065",
"0.62789845",
"0.62410146",
"0.62261796",
"0.6208864",
"0.61750966",
"0.60990584",
"0.6061727",
"0.6061065",
"0.6053913",
"0.5991453",
"0.59701633",
"0.5964061",
"0.5964061",
"0.5964061",
"0.59484845",
"0.593158",
"0.59205973",
"0.589489... | 0.8019172 | 0 |
Gets and sets the officeLocation | def office_location(self):
if "officeLocation" in self._prop_dict:
return self._prop_dict["officeLocation"]
else:
return None | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_location(self):\r\n return self.__location",
"def get_location(self):\n\t\treturn self.location",
"def _get_location(self):\n return industry.Location(itemID=self.locationID, flagID=self.locationFlagID, ownerID=self.ownerID, typeID=self.locationTypeID)",
"def get_location(self):\n ... | [
"0.65635866",
"0.64980894",
"0.64892936",
"0.64839494",
"0.6423581",
"0.6407762",
"0.6311838",
"0.63054234",
"0.6297608",
"0.6297608",
"0.62311643",
"0.62212193",
"0.6188513",
"0.6135908",
"0.61327225",
"0.6107569",
"0.60830134",
"0.5959776",
"0.5928723",
"0.591015",
"0.58917... | 0.83027864 | 0 |
Gets and sets the postalCode | def postal_code(self):
if "postalCode" in self._prop_dict:
return self._prop_dict["postalCode"]
else:
return None | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def postal_code(self):\n return self._postal_code",
"def postal_code(self, postal_code):\n\n self._postal_code = postal_code",
"def postal_code(self, postal_code):\n\n self._postal_code = postal_code",
"def postal_code(self, postal_code):\n\n self._postal_code = postal_code",
"d... | [
"0.8068069",
"0.7782636",
"0.7782636",
"0.7782636",
"0.7749391",
"0.7616022",
"0.7616022",
"0.7616022",
"0.7592657",
"0.750524",
"0.73879284",
"0.71881807",
"0.71881807",
"0.6699865",
"0.66058904",
"0.66058904",
"0.66058904",
"0.6463677",
"0.6463677",
"0.64158225",
"0.6307012... | 0.783056 | 1 |
Gets and sets the surname | def surname(self):
if "surname" in self._prop_dict:
return self._prop_dict["surname"]
else:
return None | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def surname(self):\n return self.__surname",
"def surname(self):\n return self._surname",
"def surname(self):\n return self._surname",
"def surname(self, surname):\n\n self._surname = surname",
"def change_surname(change_account):\n change_data(change_account, changed_data='s... | [
"0.84982705",
"0.8477126",
"0.8477126",
"0.803546",
"0.7066075",
"0.67260754",
"0.6708207",
"0.66683334",
"0.6317216",
"0.62853986",
"0.6251304",
"0.620658",
"0.62041837",
"0.6196445",
"0.6186058",
"0.61498255",
"0.6120866",
"0.61172587",
"0.60973257",
"0.6023495",
"0.5980638... | 0.83260864 | 3 |
Gets and sets the usageLocation | def usage_location(self):
if "usageLocation" in self._prop_dict:
return self._prop_dict["usageLocation"]
else:
return None | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_usage(self, usage):\r\n self._usage = usage",
"def usage(self, usage):\n\n self._usage = usage",
"def usage(self, usage):\n\n self._usage = usage",
"def usage(self, usage):\n\n self._usage = usage",
"def get_location(self):\r\n return self.__location",
"def get_loca... | [
"0.7063971",
"0.6857429",
"0.6857429",
"0.6857429",
"0.6593344",
"0.6529003",
"0.6417323",
"0.63813573",
"0.62553126",
"0.62553126",
"0.62553126",
"0.6241921",
"0.6241921",
"0.6241921",
"0.6241921",
"0.6224283",
"0.6217997",
"0.6217997",
"0.6209649",
"0.6192832",
"0.6192832",... | 0.8254147 | 0 |
Gets and sets the userPrincipalName | def user_principal_name(self):
if "userPrincipalName" in self._prop_dict:
return self._prop_dict["userPrincipalName"]
else:
return None | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def user_principal_name(self) -> Optional[str]:\n return pulumi.get(self, \"user_principal_name\")",
"def user_principal_name(self) -> Optional[str]:\n return pulumi.get(self, \"user_principal_name\")",
"def user_principal_name(self) -> Optional[pulumi.Input[str]]:\n return pulumi.get(self... | [
"0.71647626",
"0.71647626",
"0.6875519",
"0.645407",
"0.64127046",
"0.6389478",
"0.6380349",
"0.61885303",
"0.6155197",
"0.60399354",
"0.5994666",
"0.5991886",
"0.5983348",
"0.5925807",
"0.5915816",
"0.58755696",
"0.585765",
"0.58545786",
"0.5847192",
"0.58241165",
"0.5824116... | 0.7778325 | 0 |
Gets and sets the userType | def user_type(self):
if "userType" in self._prop_dict:
return self._prop_dict["userType"]
else:
return None | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def user_type(self) -> Optional[pulumi.Input[str]]:\n return pulumi.get(self, \"user_type\")",
"def user_type(self) -> Optional[pulumi.Input[str]]:\n return pulumi.get(self, \"user_type\")",
"def user_type(self) -> pulumi.Output[Optional[str]]:\n return pulumi.get(self, \"user_type\")",
... | [
"0.78173876",
"0.78173876",
"0.77183044",
"0.7585847",
"0.70010346",
"0.68465567",
"0.63878286",
"0.62217206",
"0.62055767",
"0.6176946",
"0.6143398",
"0.6023611",
"0.5873717",
"0.5847675",
"0.5831374",
"0.5830435",
"0.5830435",
"0.5811845",
"0.5811845",
"0.5769981",
"0.57699... | 0.82102245 | 0 |
Gets and sets the mailboxSettings | def mailbox_settings(self):
if "mailboxSettings" in self._prop_dict:
if isinstance(self._prop_dict["mailboxSettings"], OneDriveObjectBase):
return self._prop_dict["mailboxSettings"]
else :
self._prop_dict["mailboxSettings"] = MailboxSettings(self._prop_dic... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def SetSettings (self, settings) :\n\t\treturn self.run(\"SetSettings\", settings)",
"def get_settings(self):\n return self.settings",
"def settings(self):\n if self._settings is not None:\n return self._settings\n\n settings = self.binaries['KeeAgent.settings'].content\n ... | [
"0.58159494",
"0.57402426",
"0.5619234",
"0.55739355",
"0.55739355",
"0.5517437",
"0.54961646",
"0.54815507",
"0.5449086",
"0.5448791",
"0.5448791",
"0.5441",
"0.53598195",
"0.5356315",
"0.5298742",
"0.5278064",
"0.52577966",
"0.52021325",
"0.51979196",
"0.51953304",
"0.51923... | 0.80045044 | 0 |
Gets and sets the birthday | def birthday(self):
if "birthday" in self._prop_dict:
return datetime.strptime(self._prop_dict["birthday"].replace("Z", ""), "%Y-%m-%dT%H:%M:%S.%f")
else:
return None | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def setBirthday(self, month, day, year):\n if self.birthday == None:\n raise ValueError\n return datetime.date(year, month, day)",
"def setBirthday(self, birthdate):\r\n self.birthday = birthdate",
"def setBirthday(self,month,day,year):\n self.birthday = datetime.date(yea... | [
"0.825104",
"0.82395047",
"0.81962544",
"0.81962544",
"0.81087404",
"0.80916",
"0.8079532",
"0.75535035",
"0.74813676",
"0.7460522",
"0.74341714",
"0.7373968",
"0.7281756",
"0.72758114",
"0.72460496",
"0.72287947",
"0.7010542",
"0.70067024",
"0.6930146",
"0.68944186",
"0.6867... | 0.7568968 | 7 |
Gets and sets the preferredName | def preferred_name(self):
if "preferredName" in self._prop_dict:
return self._prop_dict["preferredName"]
else:
return None | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def name(self):\n\n if not hasattr(self, \"_name\"):\n name = Doc.get_text(self.doc.find(\"PreferredName\", \"\"))\n self._name = name.strip()\n return self._name",
"def preferred_client_name(self):\n return self.secondary_client_name() or self.client_na... | [
"0.7743915",
"0.68044865",
"0.6591322",
"0.6551515",
"0.6475937",
"0.6436104",
"0.64182997",
"0.6392777",
"0.63540995",
"0.63115364",
"0.63115364",
"0.63115364",
"0.6311532",
"0.63051933",
"0.6291931",
"0.6291931",
"0.6291931",
"0.6291931",
"0.6291931",
"0.6291931",
"0.629193... | 0.8724281 | 0 |
Gets and sets the ownedDevices | def owned_devices(self):
if "ownedDevices" in self._prop_dict:
return OwnedDevicesCollectionPage(self._prop_dict["ownedDevices"])
else:
return None | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def devices(self):\n return self._devices",
"def devices(self):\n return self._devices",
"def devices(self):\n return self._devices",
"def devices(self):\n return self._devices",
"def devices(self):\n\n return self.__devices",
"def devices(self, devices):\n\n sel... | [
"0.6226039",
"0.6226039",
"0.6226039",
"0.6226039",
"0.608641",
"0.6037067",
"0.6037067",
"0.5917313",
"0.5866604",
"0.584147",
"0.583933",
"0.581459",
"0.5798166",
"0.57495743",
"0.573032",
"0.57301414",
"0.5721619",
"0.56927645",
"0.56724316",
"0.5637534",
"0.5598906",
"0... | 0.73852354 | 0 |
Gets and sets the licenseDetails | def license_details(self):
if "licenseDetails" in self._prop_dict:
return LicenseDetailsCollectionPage(self._prop_dict["licenseDetails"])
else:
return None | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def refresh(self):\n self._get_license_details()",
"def License(self, default=None):\n return self.data.get('license', default)",
"def license(self, license):\n\n self._license = license",
"def license(self): # noqa: A003\n logger.debug(\"Get license\")\n return self._... | [
"0.6890207",
"0.65756893",
"0.6570144",
"0.652004",
"0.64334667",
"0.6323015",
"0.6308535",
"0.6256399",
"0.6230181",
"0.62268",
"0.61868614",
"0.61082876",
"0.6027059",
"0.6007122",
"0.58913285",
"0.5888839",
"0.5870757",
"0.57794595",
"0.5752226",
"0.5708739",
"0.56828564",... | 0.75616187 | 0 |
Gets and sets the activities | def activities(self):
if "activities" in self._prop_dict:
return ActivitiesCollectionPage(self._prop_dict["activities"])
else:
return None | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def activities(self, activities):\n \n self._activities = activities",
"def activities(self, activities):\n\n self._activities = activities",
"def get_activities():\n pass",
"def activities(self):\n return self._activities",
"def activities(self):\r\n return activities... | [
"0.7553734",
"0.74218595",
"0.73397416",
"0.7227254",
"0.7071605",
"0.7024751",
"0.69418925",
"0.6761372",
"0.641617",
"0.6243218",
"0.6240948",
"0.6240948",
"0.6240948",
"0.6240948",
"0.61992544",
"0.61822855",
"0.59766287",
"0.592842",
"0.589108",
"0.5890687",
"0.58867764",... | 0.6076178 | 16 |
Turns a string into a datetime. Enter date string using format 'MM/DD/YYYY' | def datemake(datestring):
return dtt.datetime.strptime(datestring,'%m/%d/%Y') | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def convert_date(date_str):\n return datetime.strptime(date_str, \"%d/%m/%Y\")",
"def str_2_date(str_date):\n str_format = \"%m/%d/%y\"\n return datetime.strptime(str_date, str_format)",
"def parse_date(date_str):\n date_str = re.sub(r\"[ .-]\", '/', date_str.strip())\n date_time = datetime.strp... | [
"0.8105266",
"0.8030499",
"0.80027556",
"0.7994425",
"0.7927148",
"0.7856649",
"0.7811338",
"0.75486976",
"0.7484627",
"0.74627537",
"0.74360245",
"0.7426461",
"0.74163437",
"0.7415409",
"0.7409252",
"0.7263977",
"0.7238835",
"0.7223823",
"0.71767616",
"0.7154988",
"0.7148846... | 0.8238195 | 0 |
Generate a proxy pandas object for the given PCollection element_type. Currently only supports generating a DataFrame proxy from a schemaaware PCollection or a Series proxy from a primitively typed PCollection. | def generate_proxy(element_type):
# type: (type) -> pd.DataFrame
dtype = dtype_from_typehint(element_type)
if dtype is not object:
return pd.Series(dtype=dtype)
else:
fields = named_fields_from_element_type(element_type)
proxy = pd.DataFrame(columns=[name for name, _ in fields])
for name, typehi... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def element_type_from_dataframe(proxy, include_indexes=False):\n # type: (pd.DataFrame, bool) -> type\n return element_typehint_from_dataframe_proxy(proxy, include_indexes).user_type",
"def cudf_dtype_from_pa_type(typ):\n if pa.types.is_list(typ):\n return cudf.core.dtypes.ListDtype.from_arrow(typ)\n... | [
"0.6202658",
"0.5480378",
"0.5335099",
"0.5198785",
"0.48740312",
"0.48055643",
"0.47982708",
"0.47716716",
"0.47594512",
"0.47202855",
"0.46620736",
"0.46311733",
"0.46167687",
"0.46099213",
"0.45937997",
"0.4593529",
"0.45692798",
"0.45692798",
"0.4549548",
"0.44996423",
"0... | 0.8392807 | 0 |
The method to set the value to id | def set_id(self, id):
if id is not None and not isinstance(id, int):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: id EXPECTED TYPE: int', None, None)
self.__id = id
self.__key_modified['id'] = 1 | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _set_id(self, value):\n pass",
"def id(self, value):\n self._id = value",
"def id(self, value: str):\n self._id = value",
"def _set_id(self):\n raise NotImplementedError()",
"def id(self, val: str) -> None:\n\n self._id = val",
"def set_id(self, id):\n self.d... | [
"0.8927177",
"0.8380246",
"0.80124736",
"0.78584903",
"0.771348",
"0.7605801",
"0.76036084",
"0.7592122",
"0.7539707",
"0.74881977",
"0.74170256",
"0.738453",
"0.73400855",
"0.73400855",
"0.73400855",
"0.73400855",
"0.73400855",
"0.73400855",
"0.73400855",
"0.73400855",
"0.73... | 0.0 | -1 |
Read input file into pandas DataFrame. | def read_file(file_name, nrows=None):
try:
file_handle = open(file_name)
except PermissionError as err:
print('File IO error: ', err, file=STDE)
else:
return pandas.read_table(
file_handle, nrows=nrows, low_memory=False,
na_valu... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def load_file_to_dataframe(self, file_path: str) -> pd.DataFrame:\n return pd.read_csv(file_path, sep=\"\\t\")",
"def load_data(input_file):\n print('loading file:', input_file)\n df = pd.DataFrame()\n show_progress = make_show_progress()\n chunk_iterator = pd.read_csv(input_file,\n ... | [
"0.7490383",
"0.7428419",
"0.7319465",
"0.7288895",
"0.7176885",
"0.7176885",
"0.7176885",
"0.71596533",
"0.71432143",
"0.71399903",
"0.702095",
"0.6973488",
"0.692178",
"0.68642193",
"0.68609923",
"0.68301487",
"0.6815635",
"0.68064404",
"0.67737126",
"0.6771714",
"0.6741611... | 0.0 | -1 |
Extract the SoundCloud Id from the article and also extract it from the Wikidata Item. Then compare, if they're equal stop and return True as there's nothing to do. If they're not equal return their values for further processing. | def compare_soundcloud_ids(page, wiki):
result = import_enwiki_soundcloud_id.get_soundcloud_id(wiki, page.title())
if result:
articleId = result['value'] # extracted from article
repoId = result['repo_value'] # extracted from repo
if repoId == articleId:
return True
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def check_soundcloud_ids_mismatch():\n wiki = pywikibot.Site('en', 'wikipedia')\n category = pywikibot.Category(wiki, CATEGORY)\n pages = pagegenerators.CategorizedPageGenerator(category)\n\n total_pages = 0\n processed = 0\n result = []\n\n for page in pages:\n total_pages += 1\n ... | [
"0.65900254",
"0.5092881",
"0.4959266",
"0.49365824",
"0.4927626",
"0.47560316",
"0.47294056",
"0.4696455",
"0.46595338",
"0.46287888",
"0.4606953",
"0.45863813",
"0.4582147",
"0.45787907",
"0.45409548",
"0.45381036",
"0.4537581",
"0.45333284",
"0.4532137",
"0.4500532",
"0.44... | 0.69783413 | 0 |
Determines if two photons are identical (same energy and direction). | def __eq__(self, candidate):
if (self.energy() == candidate.energy() and
self.unitDirectionVector() == candidate.unitDirectionVector()):
return True
return False | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def is_identical(self, other):\n if self.is_input != other.is_input:\n return False\n\n if self.is_raw() and other.is_raw():\n return True\n if self.is_raw() or other.is_raw():\n return False\n return self.structure.is_identical(other.structure)",
"def... | [
"0.6638553",
"0.65926087",
"0.65528303",
"0.65246534",
"0.6479986",
"0.6447146",
"0.64337194",
"0.64279294",
"0.6381961",
"0.6361249",
"0.6352506",
"0.6345261",
"0.6344853",
"0.63042796",
"0.62650555",
"0.6250472",
"0.6249563",
"0.62296087",
"0.6191971",
"0.61672384",
"0.6164... | 0.0 | -1 |
Determines if two photons are not identical (same energy and direction). | def __ne__(self, candidate):
return not (self == candidate) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __ne__(self, other):\n return np.all(self.grid != other.grid) or np.all(self.pos != other.pos)",
"def __ne__(self, other):\r\n return self._real != other.real or self._imag != other.imag",
"def __ne__(self, other):\r\n if isinstance(other, vec4):\r\n return self.x!=other.x o... | [
"0.7190145",
"0.7036748",
"0.69054574",
"0.68446076",
"0.6681751",
"0.6613953",
"0.6544744",
"0.6444852",
"0.6386282",
"0.63379204",
"0.63253695",
"0.63201314",
"0.63194823",
"0.630604",
"0.62992847",
"0.6294044",
"0.6286307",
"0.6263199",
"0.6228222",
"0.6200077",
"0.6198333... | 0.0 | -1 |
Assert view redirects to error page when apikey is missing and in debug mode. | def assert_fetch_redirects(self, view_name, args=None, kwargs=None):
response = response_from_view(view_name, args=args, kwargs=kwargs)
self.assertRedirects(response, reverse('openstates:api-key-required')) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_api_key_error(api):\n\twith pytest.raises(top_stories.APIKeyError):\n\t\tmissingAPI = top_stories.TopStoriesAPI()",
"def test_login_view_fail(self):\n url = reverse('xds_api:login')\n\n response = self.client.post(url, self.userDict_login_fail)\n\n self.assertEqual(response.status_c... | [
"0.6888574",
"0.67519873",
"0.6679428",
"0.6606721",
"0.65326184",
"0.6465275",
"0.6427704",
"0.63562447",
"0.62843555",
"0.62507343",
"0.61714876",
"0.6170321",
"0.6169239",
"0.6153389",
"0.6150258",
"0.6132735",
"0.6108964",
"0.60974944",
"0.60852104",
"0.60797703",
"0.6070... | 0.6124101 | 16 |
Assert view raises error when apikey is missing and in debug mode. | def assert_fetch_raises(self, view_name, args=None, kwargs=None):
with self.assertRaises(ImproperlyConfigured):
response_from_view(view_name, args=args, kwargs=kwargs) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_api_key(self):\n self.assertEqual(self.route4me.key, '11111111111111111111111111111111')",
"def test_api_key_error(api):\n\twith pytest.raises(top_stories.APIKeyError):\n\t\tmissingAPI = top_stories.TopStoriesAPI()",
"def test_missing_api_key(self):\n with self.assertRaises(TypeError):\n... | [
"0.70076543",
"0.6992732",
"0.69251525",
"0.67435306",
"0.6673423",
"0.65322036",
"0.6498433",
"0.6468095",
"0.64243925",
"0.6397286",
"0.63596463",
"0.63464224",
"0.63342005",
"0.63342005",
"0.6333741",
"0.6318289",
"0.62867486",
"0.627555",
"0.6266053",
"0.62411964",
"0.620... | 0.5803777 | 50 |
Check if 'strWord' is a cardinal number. | def _isCardinalNumber(strWord):
return NumberFormula.CARDINALNUMBERREGEX.match(strWord) != None | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _isOrdinalNumber(strWord):\n return NumberFormula.ORDINALNUMBERREGEX.match(strWord) != None",
"def isNumber(word):\n try:\n int(word)\n return True\n except ValueError:\n return False",
"def is_number(c):\n return '0' <= c <= '9'",
"def isAllDigits(self, word):\n r... | [
"0.73925495",
"0.7062405",
"0.68368006",
"0.669777",
"0.6612324",
"0.6605833",
"0.65747327",
"0.652581",
"0.6517201",
"0.6440602",
"0.64295846",
"0.6389067",
"0.63823307",
"0.6377445",
"0.63651204",
"0.6360172",
"0.6344014",
"0.6327493",
"0.6288336",
"0.62612003",
"0.62546206... | 0.88209033 | 0 |
Check if 'strWord' is a decimal number. A decimal number contains a decimal symbol that can be a comma or a dot. | def _isDecimalNumber(strWord):
return NumberFormula.DECIMALNUMBERREGEX.match(strWord) != None | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def is_valid_decimal(string: str) -> bool:\n try:\n float(string)\n except ValueError:\n return False\n else:\n return True",
"def isNumber(st):\n\treturn st.replace('.','',1).isdigit()",
"def isnum(self, x):\n\n return x in '1234567890.-'",
"def is_number_char(c: str) ->... | [
"0.71254176",
"0.6925669",
"0.6923309",
"0.6882824",
"0.688052",
"0.67968076",
"0.6719804",
"0.6687407",
"0.66177404",
"0.65875906",
"0.65658325",
"0.6560297",
"0.6553391",
"0.6543359",
"0.6534273",
"0.65135854",
"0.6505796",
"0.6478286",
"0.6440673",
"0.638525",
"0.63741523"... | 0.88654786 | 0 |
Return ISO 8601 formatted date time. | def formatIsoDate(dt, tm):
iso = ''
if dt != '':
match = re.search(r'^(\d{2})/(\d{2})/(\d{4})$', dt)
if not match:
raise RuntimeError("Failed to extract date from %s." % dt)
iso += "%s-%s-%sT" % (match.group(3), match.group(1), match.group(2))
if tm != '':
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def iso_date(self, t=None):\n if t is None:\n t = time.time()\n time_str = time.strftime(\"%Y-%m-%d %H:%M:%S\", time.localtime(t))\n\n return time_str",
"def ISO8601(self):\n if self.timezoneNaive():\n return \"%0.4d-%0.2d-%0.2dT%0.2d:%0.2d:%0.2d\" % (\n ... | [
"0.8289353",
"0.7772337",
"0.7702581",
"0.7414069",
"0.74106807",
"0.7380784",
"0.7372137",
"0.7353004",
"0.72987914",
"0.72626615",
"0.7218334",
"0.72139716",
"0.7108287",
"0.7074461",
"0.7074204",
"0.7032",
"0.700669",
"0.70063704",
"0.6940193",
"0.6934937",
"0.69234526",
... | 0.0 | -1 |
Return OpenSearch formatted bbox. | def formatBbox(minLon, minLat, maxLon, maxLat):
for val in [minLon, minLat, maxLon, maxLat]:
if val in [None, '']: return ''
return ','.join([minLon, minLat, maxLon, maxLat]) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def bbox_format(self) -> bbox_utils.BBoxFormat:\n raise NotImplementedError",
"def to_bounding_box(self):\n if self.bbox is not None:\n return self.bbox\n from .bbox import BBox\n\n xx = self.xx\n yy = self.yy\n self.bbox = BBox(xmin=min(xx), xmax=max(xx), ymin=mi... | [
"0.756435",
"0.7266132",
"0.7074864",
"0.69839364",
"0.69170713",
"0.68156403",
"0.6644256",
"0.66120785",
"0.6610886",
"0.64872956",
"0.64325356",
"0.64325356",
"0.6383455",
"0.6371296",
"0.62943506",
"0.6291902",
"0.6279188",
"0.6279188",
"0.62672126",
"0.62574506",
"0.6254... | 0.57470113 | 79 |
Take a gradient step from the current last recorded parameters (self.W[1]). After the step, update self.objective, self.W. If the gradient step does not increase the objective function value, decrement self.alpha = self.alpha/2. | def gradient_step(self):
n = 3 #Granularity of line search
grad = self.gradient()
#grad = grad/np.linalg.norm(grad, 2)
W = project(self.W[-1] + grad)
A = np.linspace(0., 1., n+2)[1:-1]
Objective = map(self, [(1. - a)*self.W[-1] + a*W for a in A])
a = A[np.argmax(O... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def gradient_step(self):\n n = 10 #Granularity of line search\n grad = self.gradient()\n W = project(self.W[-1] + grad)\n A = np.linspace(0., self.alpha, n+2)[1:-1]\n Objective = map(self, [(1. - a)*self.W[-1] + a*W for a in A])\n a = A[np.argmax(Objective)]\n W = (... | [
"0.82304937",
"0.6644419",
"0.65771115",
"0.65195256",
"0.65099394",
"0.6493592",
"0.6476875",
"0.64614",
"0.6460024",
"0.64598954",
"0.645407",
"0.6423537",
"0.6423537",
"0.63753706",
"0.6349371",
"0.6342205",
"0.6340144",
"0.6333563",
"0.6333563",
"0.63191324",
"0.63103807"... | 0.7960844 | 1 |
Take a gradient step from the current last recorded parameters (self.W[1]). After the step, update self.objective, self.W. If the gradient step does not increase the objective function value, decrement self.alpha = self.alpha/2. | def gradient_step(self):
n = 10 #Granularity of line search
grad = self.gradient()
W = project(self.W[-1] + grad)
A = np.linspace(0., self.alpha, n+2)[1:-1]
Objective = map(self, [(1. - a)*self.W[-1] + a*W for a in A])
a = A[np.argmax(Objective)]
W = (1. - a)*self... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def gradient_step(self):\n n = 3 #Granularity of line search\n grad = self.gradient()\n #grad = grad/np.linalg.norm(grad, 2)\n W = project(self.W[-1] + grad)\n A = np.linspace(0., 1., n+2)[1:-1]\n Objective = map(self, [(1. - a)*self.W[-1] + a*W for a in A])\n a = A... | [
"0.79620165",
"0.66460335",
"0.6577995",
"0.65207726",
"0.6511474",
"0.6494311",
"0.6480516",
"0.6463393",
"0.64631104",
"0.64620763",
"0.64545375",
"0.6423686",
"0.6423686",
"0.6375953",
"0.6351453",
"0.63423574",
"0.63407296",
"0.6334037",
"0.6334037",
"0.6319517",
"0.63101... | 0.8230772 | 0 |
Get the front element. | def peek(self) -> int:
return self._stack.peek() | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def getFront(self):\n\t\tfront = self.queue[self.front]\n\t\treturn front\n\t\tpass",
"def getFront(self):\n if not self.isEmpty():\n return self._data[0]\n else:\n return -1",
"def front(self):\n return self.queue[0] if not self.empty() else None",
"def peek_front(... | [
"0.82009244",
"0.79261875",
"0.7852642",
"0.7791182",
"0.77886623",
"0.75723046",
"0.752337",
"0.7510604",
"0.7478953",
"0.7379256",
"0.7379256",
"0.734284",
"0.7323573",
"0.7320296",
"0.7291721",
"0.72772557",
"0.7269801",
"0.72657627",
"0.7253295",
"0.72355044",
"0.72213495... | 0.0 | -1 |
Returns whether the queue is empty. | def empty(self) -> bool:
return self._stack.empty() | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def is_empty(self):\n return len(self.the_queue) == 0",
"def is_empty(self):\n return len(self.__queue) > 0",
"def is_empty(self):\n return len(self.queue) == 0",
"def is_empty(self):\n return len(self.queue) == 0",
"def is_empty(self):\n return self.queue == []",
"def ... | [
"0.9270249",
"0.92506766",
"0.923635",
"0.923635",
"0.9155843",
"0.9098441",
"0.9095006",
"0.90922606",
"0.90731245",
"0.9053733",
"0.89205354",
"0.89137155",
"0.8877591",
"0.88436323",
"0.88436323",
"0.8835949",
"0.88038146",
"0.8758203",
"0.87577534",
"0.87310195",
"0.86462... | 0.0 | -1 |
Creates initial hidden states. | def init_hidden(self, batch_size, device):
return (torch.zeros(batch_size, self.hidden_dim, self.height, self.width, device=device, requires_grad=True),
torch.zeros(batch_size, self.hidden_dim, self.height, self.width, device=device, requires_grad=True)) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def init_hidden(self):\n # TODO ========================\n # initialize the hidden states to zero\n\n initial_hidden = torch.zeros(self.num_layers, self.batch_size, self.hidden_size)\n return initial_hidden # a parameter tensor of shape (self.num_layers, self.batch_size, self.hidden_si... | [
"0.7228932",
"0.7126479",
"0.7126479",
"0.70105827",
"0.6925434",
"0.6862272",
"0.6790497",
"0.676607",
"0.661804",
"0.6599861",
"0.6599861",
"0.6599861",
"0.65571153",
"0.65503615",
"0.65129495",
"0.64925617",
"0.6477774",
"0.6477774",
"0.64530563",
"0.6444708",
"0.6444708",... | 0.60481256 | 63 |
Determines whether an event is relevant for test execution (based on the file extension) | def _is_relevant(self, event):
relevant = False
if isinstance(event, FileMovedEvent):
path = event.dest_path
if self._filter(path):
relevant = True
else:
path = False
# for any event
if self._filter(event.src_path):
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def is_test_filename(filename):\n return 'test' in filename",
"def verify_event(event):\n event_details = event['event']\n file_subtype = event_details.get('subtype')\n\n if file_subtype != 'file_share':\n print('Not a file_shared event- ignoring event...')\n return False\n\n file_de... | [
"0.6656496",
"0.6446269",
"0.6165872",
"0.6141867",
"0.6044927",
"0.6000731",
"0.59895635",
"0.5945514",
"0.5901001",
"0.58767897",
"0.5862338",
"0.58544886",
"0.5838319",
"0.58376414",
"0.58319384",
"0.57939965",
"0.57421243",
"0.5733684",
"0.5729772",
"0.5719063",
"0.571426... | 0.6117063 | 4 |
Return true if the binary_sensor is on. | def is_on(self):
return self._controller.is_on | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def is_on(self):\n return self._sensor_state()",
"def is_on(self):\n return getattr(self.coordinator.data[0], self._sensor) is True",
"def is_on(self):\n data = self.sensor_data\n if data and data[\"model\"] == \"SML\" and data[\"changed\"]:\n return data[\"state\"] == ST... | [
"0.78868204",
"0.7742902",
"0.74755037",
"0.7357702",
"0.7112291",
"0.71043164",
"0.7089417",
"0.7089417",
"0.7089417",
"0.7088156",
"0.7019857",
"0.7019857",
"0.7013154",
"0.6917863",
"0.6903743",
"0.6867859",
"0.68601996",
"0.6846498",
"0.682878",
"0.68254995",
"0.68190086"... | 0.6341805 | 90 |
Return the state attributes of the device. | def device_state_attributes(self):
attr = {}
attr["enabled"] = self._controller.enabled
attr["zone_count"] = len(self._controller._zones)
attr["zones"] = ""
current = self._controller.runs.current_run
if current is not None:
attr["current_zone"] = current.inde... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def device_state_attributes(self):\r\n return self.attributes",
"def device_state_attributes(self):\r\n return self._attributes",
"def device_state_attributes(self):\n return self._state_attrs",
"def device_state_attributes(self):\n return self._state_attrs",
"def device_state_a... | [
"0.92739",
"0.92050403",
"0.9150762",
"0.9150762",
"0.91485494",
"0.91485494",
"0.91482216",
"0.91482216",
"0.91482216",
"0.91482216",
"0.91482216",
"0.91482216",
"0.91482216",
"0.91482216",
"0.91482216",
"0.91482216",
"0.91482216",
"0.91482216",
"0.91482216",
"0.9137126",
"0... | 0.7583922 | 83 |
Return true if the binary_sensor is on. | def is_on(self):
return self._zone.is_on | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def is_on(self):\n return self._sensor_state()",
"def is_on(self):\n return getattr(self.coordinator.data[0], self._sensor) is True",
"def is_on(self):\n data = self.sensor_data\n if data and data[\"model\"] == \"SML\" and data[\"changed\"]:\n return data[\"state\"] == ST... | [
"0.7884619",
"0.7740934",
"0.74744123",
"0.7355086",
"0.711196",
"0.7103455",
"0.70885575",
"0.70885575",
"0.70885575",
"0.70857835",
"0.70182335",
"0.70182335",
"0.70131624",
"0.6916831",
"0.6902558",
"0.6866156",
"0.68592364",
"0.68461555",
"0.6827404",
"0.68255574",
"0.681... | 0.0 | -1 |
Return the state attributes of the device. | def device_state_attributes(self):
attr = {}
attr["enabled"] = self._zone.enabled and self._controller.enabled
attr["status"] = self._zone.status
attr["schedule_count"] = len(self._zone.schedules)
attr["schedules"] = ""
attr["adjustment"] = self._zone.adjustment.as_string... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def device_state_attributes(self):\r\n return self.attributes",
"def device_state_attributes(self):\r\n return self._attributes",
"def device_state_attributes(self):\n return self._state_attrs",
"def device_state_attributes(self):\n return self._state_attrs",
"def device_state_a... | [
"0.92738223",
"0.92053986",
"0.91516256",
"0.91516256",
"0.9148889",
"0.9148889",
"0.9148889",
"0.9148889",
"0.9148889",
"0.9148889",
"0.9148889",
"0.9148889",
"0.9148889",
"0.9148889",
"0.9148889",
"0.9148889",
"0.9148889",
"0.9148746",
"0.9148746",
"0.9137698",
"0.9110632",... | 0.7156385 | 98 |
String representation of the Appearance object | def __repr__(self):
return str(self.__dict__) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __repr__(self):\n args = []\n if self.name != \"alpha\":\n args.append(repr(self.name))\n if self.propertiesstr:\n args.append(repr(self.propertiesstr))\n elif self.propertiesstr:\n args.append(\"attr=%r\" % self.propertiesstr)\n retur... | [
"0.64293605",
"0.6391784",
"0.6374717",
"0.63444585",
"0.63097686",
"0.62868035",
"0.62600845",
"0.62467074",
"0.6239638",
"0.6219139",
"0.62183964",
"0.6202385",
"0.61947733",
"0.61922055",
"0.61862284",
"0.6169936",
"0.61599654",
"0.6151132",
"0.61450064",
"0.6123127",
"0.6... | 0.60953826 | 28 |
String representation of the Database object | def __repr__(self):
return str(self.__dict__) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __str__(self):\n tablename = self.tablename()\n attrs = {}\n if Registry.SCHEMAS.has_key(tablename):\n for key in Registry.SCHEMAS[tablename]:\n attrs[key] = getattr(self, key, None)\n return \"<%s object: %s>\" % (self.__class__.__name__, str(attrs))",
"... | [
"0.7615614",
"0.7059295",
"0.7051558",
"0.70249987",
"0.70249987",
"0.6990987",
"0.6916201",
"0.68992233",
"0.6863929",
"0.6807094",
"0.6733465",
"0.6724944",
"0.6673304",
"0.66662866",
"0.6664986",
"0.6661266",
"0.6597362",
"0.6592786",
"0.65823424",
"0.65544116",
"0.6517741... | 0.0 | -1 |
String representation of the Database object | def __repr__(self):
return str(self.index) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __str__(self):\n tablename = self.tablename()\n attrs = {}\n if Registry.SCHEMAS.has_key(tablename):\n for key in Registry.SCHEMAS[tablename]:\n attrs[key] = getattr(self, key, None)\n return \"<%s object: %s>\" % (self.__class__.__name__, str(attrs))",
"... | [
"0.7615614",
"0.7059295",
"0.7051558",
"0.70249987",
"0.70249987",
"0.6990987",
"0.6916201",
"0.68992233",
"0.6863929",
"0.6807094",
"0.6733465",
"0.6724944",
"0.6673304",
"0.66662866",
"0.6664986",
"0.6661266",
"0.6597362",
"0.6592786",
"0.65823424",
"0.65544116",
"0.6517741... | 0.0 | -1 |
Return a string representation of the model. | def __str__(self):
return '{}, {}'.format(self.last_name, self.first_name) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __str__(self):\n return super().__str__() + self.model.__str__()",
"def __repr__(self):\n\n mod = f\"{self.__class__.__name__} Model\"\n try:\n mod += f': {self.filename}'\n except AttributeError:\n pass\n s = [mod]\n for name, v in self.metadat... | [
"0.8550562",
"0.78680784",
"0.7859392",
"0.7820475",
"0.78200865",
"0.78200865",
"0.78024864",
"0.7667491",
"0.7658678",
"0.7652298",
"0.7619285",
"0.75894105",
"0.7587887",
"0.7541158",
"0.75327915",
"0.75327915",
"0.75173604",
"0.7495425",
"0.7490489",
"0.7479993",
"0.74670... | 0.0 | -1 |
Raises an exception if provided address is not the bank. | def _assert_is_bank(address: str):
if address != bank_account:
raise ValueError("'{} is not the bank".format(address)) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def validate_address(address: str) -> None:\n data: bytes = base58.b58decode_check(address)\n if len(data) != len(types.UInt160.zero()) + 1:\n raise ValueError(f\"The address is wrong, because data (address value in bytes) length should be \"\n f\"{len(types.UIn... | [
"0.6609735",
"0.65820926",
"0.62308615",
"0.62253165",
"0.61941797",
"0.618498",
"0.6095034",
"0.6075879",
"0.603748",
"0.60227144",
"0.59909004",
"0.59697646",
"0.5950317",
"0.59450454",
"0.5888646",
"0.5887511",
"0.58568305",
"0.5823994",
"0.58218026",
"0.57189554",
"0.5712... | 0.83320385 | 0 |
Destroy tokens. Tokens are withdrawn from sender's account. Returns new total supply. | def burn(amount: int) -> int:
global total_supply
_assert_is_bank(context.sender)
total_supply = base.burn(balance_of, total_supply, context.sender, amount)
return total_supply | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def RemoveTokens(self, tokens):\n self.LocalUpdate()\n self.status['tokensLeft'] -= tokens",
"def __del__(self):\n self.token_revoke()",
"def remove_token(self, amount):\n self.M -= amount",
"def teardown(self):\n for acct, token_id in [\n (k, x) for k, v in self... | [
"0.6488619",
"0.60322964",
"0.57464206",
"0.5649027",
"0.5625",
"0.55597275",
"0.54697937",
"0.5396416",
"0.53897643",
"0.53831047",
"0.5317023",
"0.5313197",
"0.52998275",
"0.52076155",
"0.5197736",
"0.5125489",
"0.50732774",
"0.50648344",
"0.5018667",
"0.50124246",
"0.49960... | 0.0 | -1 |
Return the resource corresponding to all the support queues. | def support_queues(self):
return support_queues.SupportQueues(self) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def support_queues(self):\r\n return support_queues.SupportQueues(self)",
"def _get_queues(self):\n return self.__queues",
"def _get_queues(self):\n return self.__queues",
"def _get_queues(self):\n return self.__queues",
"def _get_queues(self):\n return self.__queues",
"def _get_queues... | [
"0.7525037",
"0.6741674",
"0.6741674",
"0.6741674",
"0.6741674",
"0.6741674",
"0.6741674",
"0.6741674",
"0.6741674",
"0.6741674",
"0.66001564",
"0.6442839",
"0.63554645",
"0.63447565",
"0.62543947",
"0.6226701",
"0.6211482",
"0.61988103",
"0.6141937",
"0.6063048",
"0.5991709"... | 0.73946834 | 1 |
Return the resource corresponding to a UserVoice subdomain. | def subdomain(self, subdomain):
return subdomains.Subdomain(self, subdomain) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def subdomain(self, subdomain):\r\n return subdomains.Subdomain(self, subdomain)",
"async def fetch_subdomain(self, subdomain: str):\n value = await self.http.check_subdomain(subdomain)\n if (value or {}).get('exists') is True:\n # currently this endpoint returns {} if the subdoma... | [
"0.61574084",
"0.6071135",
"0.5925243",
"0.5894778",
"0.5831165",
"0.5815013",
"0.5686056",
"0.56554943",
"0.56464046",
"0.5641134",
"0.5558",
"0.5535394",
"0.5499313",
"0.5430878",
"0.5391436",
"0.53455603",
"0.5315503",
"0.52796054",
"0.52599305",
"0.52186024",
"0.52186024"... | 0.59983885 | 2 |
Return the resource corresponding a single topic. | def topic(self, topic_id):
return topics.Topic(self, topic_id) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_by_topic(cls, topic):\n\t\treturn cls.get_by_key_name(get_hash_key_name(topic))",
"def topic(self, topic_id):\r\n return topics.Topic(self, topic_id)",
"def topic(self, topic_id):\r\n return contents.Topic(self, topic_id)",
"def get(cls, topic_info):\n try: #to treat topic info a... | [
"0.77947825",
"0.7669331",
"0.7613893",
"0.74762815",
"0.7415203",
"0.7414779",
"0.7397937",
"0.7222904",
"0.7074583",
"0.70252377",
"0.70127773",
"0.697672",
"0.6854198",
"0.6819582",
"0.6699644",
"0.66385716",
"0.65841687",
"0.6530415",
"0.64672196",
"0.64555025",
"0.644133... | 0.74274266 | 4 |
Return the resource corresponding to a single user. If user_id is `None`, the returned resource is the currently authenticated user, otherwise it is the user with the given ID number. | def user(self, user_id=None):
if user_id is None:
return users.CurrentUser(self)
return users.User(self, user_id) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def user(self, user_id=None):\r\n if user_id is None:\r\n return resources.CurrentUser(self)\r\n return resources.User(self, user_id)",
"def user(self, user_id):\r\n return resources.User(self, user_id)",
"def get(self, user_id):\n user = UserServices(public_id=user_id).g... | [
"0.8213958",
"0.8067923",
"0.78559506",
"0.78145343",
"0.7774979",
"0.77716804",
"0.7709795",
"0.77029943",
"0.76376396",
"0.76356786",
"0.76143116",
"0.7598275",
"0.7565272",
"0.7542568",
"0.7525858",
"0.75222385",
"0.75086266",
"0.7469456",
"0.74632627",
"0.7443691",
"0.743... | 0.74779594 | 17 |
Return the resource corresponding to all the comments. | def comments(self):
return comments.Comments(self) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_comments(self):\n\t\treturn self._client.get_comments(self)",
"def _get(self, query=None):\n comments = DB_COMMENT_TABLE.all()\n for comment in comments:\n comment['_links'] = self.make_links({\n 'self' : Comment.get_self_url(comment.doc_id)\n })\n ... | [
"0.673307",
"0.67244184",
"0.65852386",
"0.65852386",
"0.65852386",
"0.6408551",
"0.6312615",
"0.6305851",
"0.6305851",
"0.6305851",
"0.6305368",
"0.6303296",
"0.6279591",
"0.6269185",
"0.62205243",
"0.619106",
"0.61810684",
"0.6168891",
"0.61303675",
"0.6115814",
"0.6114384"... | 0.62862086 | 12 |
Method to check whether the fleet can be positioned from the input starting cell or not. | def can_position_fleet(self, starting_cell, board):
are_rows_available = starting_cell.row + self.total_rows_req <= board.rows
are_columns_available = starting_cell.column + self.total_column_req <= board.columns
if are_columns_available and are_rows_available:
return True
re... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def is_valid_position(self, x, y):\n if (x > self.n_cols-1 or y > self.n_rows-1) or (x < 0 or y < 0):\n return False\n\n elif self.grid[x][y] == 3:\n return False\n\n return True",
"def is_valid_position(self, current_piece, offset_x = 0, offset_y = 0):\n for x i... | [
"0.7087908",
"0.6952588",
"0.69333625",
"0.6836448",
"0.6728499",
"0.67179173",
"0.6691771",
"0.6639149",
"0.6609889",
"0.65796894",
"0.65485525",
"0.64877814",
"0.64858186",
"0.6452394",
"0.64388996",
"0.6408777",
"0.6392359",
"0.6380133",
"0.63659626",
"0.63494027",
"0.6343... | 0.7996898 | 0 |
Return ``True`` if the host is either an exact match or a match to the wildcard pattern. Any pattern beginning with a period matches a domain and all of its subdomains. (e.g. ``.example.com`` matches ``example.com`` and ``foo.example.com``). Anything else is an exact string match. | def is_same_domain(host, pattern):
if not pattern:
return False
pattern = pattern.lower()
return (
pattern[0] == "."
and (host.endswith(pattern) or host == pattern[1:])
or pattern == host
) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def match_host(host, domainlist):\n if not host:\n return False\n for domain in domainlist:\n if domain.startswith('.'):\n if host.endswith(domain):\n return True\n elif host == domain:\n return True\n return False",
"def matches_host(self, host:... | [
"0.6859789",
"0.64834476",
"0.6310265",
"0.6274386",
"0.626298",
"0.62439597",
"0.6223475",
"0.61436886",
"0.60896343",
"0.6067401",
"0.60602343",
"0.60365915",
"0.5915722",
"0.5913799",
"0.5765827",
"0.5749738",
"0.5744169",
"0.57018024",
"0.56959105",
"0.5685564",
"0.568391... | 0.7240702 | 0 |
Return ``True`` if the url uses an allowed host and a safe scheme. Always return ``False`` on an empty url. If ``require_https`` is ``True``, only 'https' will be considered a valid scheme, as opposed to 'http' and 'https' with the default, ``False``. | def url_has_allowed_host_and_scheme(url, allowed_hosts, require_https=False):
if url is not None:
url = url.strip()
if not url:
return False
if allowed_hosts is None:
allowed_hosts = set()
elif isinstance(allowed_hosts, str):
allowed_hosts = {allowed_hosts}
# Chrome t... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def validate_url(self, v):\n u = urlparse.urlparse(v)\n if u.scheme.lower() not in ('http', 'https'):\n raise ValueError('URL scheme must be either http:// or https://')\n if not u.netloc:\n raise ValueError('URL must specify a network location.')\n return u.scheme.lower() == 'https'",
"def... | [
"0.6889656",
"0.68266284",
"0.66039807",
"0.655322",
"0.6500615",
"0.6483375",
"0.6346882",
"0.63377696",
"0.6259449",
"0.62539536",
"0.6245586",
"0.6214837",
"0.61948025",
"0.6160173",
"0.6146635",
"0.61445713",
"0.6118254",
"0.60961634",
"0.609458",
"0.609458",
"0.6073871",... | 0.7568531 | 1 |
Returns a size.x size.y maze as a string | def create_maze(size):
dots = MazeGenerator.generate_dot_positions(size.x, size.y)
maze = MazeGenerator.create_grid_string(dots, size.x, size.y)
return maze | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __str__(self):\n\n maze_rows = ['-' * self.nx * 2]\n for y in range(self.ny):\n maze_row = ['|']\n for x in range(self.nx):\n prefix = \" \"\n if self.cell_at(x, y).is_current_position:\n prefix = \"*\"\n if sel... | [
"0.73779637",
"0.68080413",
"0.6685126",
"0.6330519",
"0.62965095",
"0.6271721",
"0.61923486",
"0.6185289",
"0.6139641",
"0.6104388",
"0.6077928",
"0.6058521",
"0.603613",
"0.6034531",
"0.6016817",
"0.6009964",
"0.6001697",
"0.59935623",
"0.59846616",
"0.5978404",
"0.59782887... | 0.67448604 | 2 |
Get all devices under a group. | def _ListGroupDevices(self, group):
for run_target in six.itervalues(group.run_targets):
for d in six.itervalues(run_target.devices):
yield d | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_devices(self):\n return self.api_request('GET', self.url + '/device', {})",
"def get_devices(self):\n return get_devices(self.api_key)",
"async def find_devices() -> List[DeviceInfo]:\n return await Discovery.search_devices()",
"def get_devices():\n devices = []\n for devic... | [
"0.70568705",
"0.70392174",
"0.68304425",
"0.6768732",
"0.6714005",
"0.6641697",
"0.6640418",
"0.66003174",
"0.65955645",
"0.6576329",
"0.65478283",
"0.6473682",
"0.6473682",
"0.64064264",
"0.63681287",
"0.6345439",
"0.63357896",
"0.6331724",
"0.6313741",
"0.6311225",
"0.6294... | 0.801191 | 0 |
Remove the devices' groups in the host. The devices must exist in the device tree. And this method will remove those devices and their groups' devices from the device tree, since the group is in use. | def RemoveDeviceGroups(self, devices):
for d in devices:
# delete the group from the device tree
group = self._groups.pop(d.run_target.group.name, None)
if not group:
continue
# delete all devices under the group from the _run_target_index
for d_in_group in self._ListGroupDevic... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def del_from_groups(self, username, groups):\n pass",
"def clear_Groups(self):\n\n\t\tself.__groups[:] = []",
"def cleanup_user_groups(event):\n name = event.object.name\n\n if name.startswith(\"group:\"):\n principals = get_principals()\n users_groups = [p for p in principals if nam... | [
"0.65515375",
"0.65458214",
"0.64813197",
"0.63427466",
"0.6342232",
"0.632154",
"0.6110929",
"0.61018246",
"0.6091364",
"0.590709",
"0.5847675",
"0.5798373",
"0.57900935",
"0.5751328",
"0.57386637",
"0.5736338",
"0.57198966",
"0.5719321",
"0.56466836",
"0.5631757",
"0.562541... | 0.81288666 | 0 |
path > dirname, basename, extension | def split_path_dir_base_ext(path, dir_ext=True) -> T.Tuple[str, str, str]:
split = os.path.split
splitext = os.path.splitext
p, b = split(path)
if not dir_ext and os.path.isdir(path):
n, e = b, ''
else:
n, e = splitext(b)
return p, n, e | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_file_name_with_ext(path: str) -> str:\n return os.path.basename(path)",
"def get_filename(path):\n return path.split('/')[-1]",
"def getfilename(path):\r\n return path.split('\\\\').pop().split('/').pop().rsplit('.', 1)[0]",
"def basename(path):\r\n return split(path)[1]",
"def path_sho... | [
"0.75053674",
"0.7455976",
"0.74283063",
"0.7373169",
"0.7273756",
"0.72431165",
"0.72227114",
"0.72217405",
"0.7216857",
"0.7203572",
"0.7197691",
"0.71829367",
"0.7167866",
"0.7142377",
"0.7114344",
"0.7092331",
"0.7010141",
"0.7008051",
"0.7001621",
"0.69894",
"0.6910791",... | 0.6526989 | 51 |
Find the privacy policy url for the page. If no policy url is found, return None | def find_privacy_policy_url(url):
split_url = urlsplit(url)
html = download_html(url=url) # Find page html
links = get_site_tags(html=html, tags=["a"]) # Get all links on page
privacy_policy_link = find_privacy_link(
links=links
) # Find privacy link, if None, research on homepage
ret... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def privacy_statement_url(self) -> Optional[pulumi.Input[str]]:\n return pulumi.get(self, \"privacy_statement_url\")",
"def privacy_statement_url(self) -> Optional[pulumi.Input[str]]:\n return pulumi.get(self, \"privacy_statement_url\")",
"def privacy_statement_url(self) -> pulumi.Output[Optional... | [
"0.70527893",
"0.70527893",
"0.68086046",
"0.6349007",
"0.6120768",
"0.61198634",
"0.61198634",
"0.59636605",
"0.59104854",
"0.5803639",
"0.57697797",
"0.5534133",
"0.5534133",
"0.5534133",
"0.54875165",
"0.54875165",
"0.54875165",
"0.54875165",
"0.54875165",
"0.54875165",
"0... | 0.7596737 | 0 |
Initialize learning rate based on self.FLAGS. | def initialize_learning_rate(self):
if (self.FLAGS.learning_rate_decay is "exponential"):
self.learning_rate = tf.train.exponential_decay(
self.FLAGS.learning_rate,
self.global_step,
self.FLAGS.decay_s... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __init__(self, initialLearnRate):\n self.initialLearnRate = initialLearnRate",
"def __init__(self, learning_rate, momentum_coef):\n self.learning_rate = learning_rate\n self.momentum_coef = momentum_coef",
"def __init__(self, lr: float):\n super().__init__()\n self.lr = l... | [
"0.748128",
"0.7175863",
"0.6994292",
"0.6982365",
"0.6971826",
"0.6940242",
"0.6887795",
"0.6851538",
"0.68351144",
"0.6825774",
"0.6825774",
"0.67670816",
"0.6739127",
"0.6710322",
"0.66932064",
"0.6668788",
"0.6647041",
"0.6636886",
"0.6631704",
"0.66075283",
"0.6591165",
... | 0.8429504 | 0 |
Run the session with inputs from feed_dict and return the outputs listed in the list outputs. | def evaluate(self, sess, outputs, dSet=None, dataX=None, dataY=None):
feed_dict = {self.isTraining : False}
if (dataX is not None) and (dataY is not None):
feed_dict[self.features] = dataX
feed_dict[self.labels] = dataY
return sess.run(output, feed_dict)
if dSet is "train":
ses... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def run(self, sess, ops, feed_list, dropout_prob):\n questions, answers, labels = feed_list\n answers = np.reshape(answers, [len(answers), 1])\n feed_dict = {\n self.questions: questions,\n self.answers: answers,\n self.labels: labels,\n self.dropout... | [
"0.64619416",
"0.6376603",
"0.6343705",
"0.63356614",
"0.6058807",
"0.5981644",
"0.59762394",
"0.5940789",
"0.59115434",
"0.58205914",
"0.5818718",
"0.5798133",
"0.57249117",
"0.57085896",
"0.5674568",
"0.56663847",
"0.564182",
"0.5625055",
"0.55932903",
"0.55897",
"0.5581191... | 0.6240952 | 4 |
Write a single summary value to tensorboard | def writeSummary(self, value, tag, summaryWriter, global_step):
summary = tf.Summary()
summary.value.add(tag=tag, simple_value=value)
summaryWriter.add_summary(summary, global_step) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def write_summary(value, tag, summary_writer, global_step):\n summary = tf.Summary()\n summary.value.add(tag=tag, simple_value=value)\n summary_writer.add_summary(summary, global_step)",
"def scalar_summary(self, tag, value, step):\n with self.writer.as_default():\n tf.summary.scalar(n... | [
"0.76693326",
"0.7424265",
"0.7346214",
"0.7346214",
"0.7346214",
"0.7255747",
"0.70672417",
"0.7037515",
"0.70122087",
"0.7000477",
"0.6957464",
"0.6911966",
"0.6908891",
"0.6880707",
"0.686772",
"0.6857955",
"0.68418956",
"0.68370825",
"0.6821709",
"0.6794511",
"0.67150164"... | 0.7692856 | 0 |
Return list of the artifacts which will be used to unify this task. This used to distinguish the particular task instance from the others, since the statistics could be changed. | def get_artifacts(self): # noqa
return [] | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def build_artifacts(self):\n return self._build_artifacts",
"def unpack(self):\n deps = []\n if isinstance(self.from_task, _Unpackable):\n deps.extend(self.from_task.unpack())\n if isinstance(self.to_task, _Unpackable):\n deps.extend(self.to_task.unpack())\n ... | [
"0.67519724",
"0.631079",
"0.6270857",
"0.61925143",
"0.6175143",
"0.6154125",
"0.6074285",
"0.6065324",
"0.6017001",
"0.6003107",
"0.5910507",
"0.5886267",
"0.5886267",
"0.5886267",
"0.5886267",
"0.58840483",
"0.58412904",
"0.58380806",
"0.5819328",
"0.5724208",
"0.56926036"... | 0.765743 | 0 |
Normalize the image data with MinMax scaling to a range of [0.1, 0.9] | def normalize(image_data, a=0.1, b=0.9):
# Implement Min-Max scaling for image data
return a + (((image_data-np.min(image_data)) * (b - a)) / (np.max(image_data) - np.min(image_data))) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def normalize_minmax(data):\n _min = np.float(np.min(data))\n _max = np.float(np.max(data))\n if (_max-_min)!=0:\n img = (data - _min) / (_max-_min)\n else:\n img = np.zeros_like(data) \n return img",
"def normalize_data(data, min=0, max=1):\r\n import numpy as np\r\n ... | [
"0.8564607",
"0.80318826",
"0.79484576",
"0.77709514",
"0.7741051",
"0.768168",
"0.76730704",
"0.7651922",
"0.7650084",
"0.75722075",
"0.7537708",
"0.7527553",
"0.75258815",
"0.7488847",
"0.7479918",
"0.7427292",
"0.7404922",
"0.7404922",
"0.7383618",
"0.7361875",
"0.7314438"... | 0.7371918 | 19 |
Create default spark session | def create_spark_session():
spark = SparkSession \
.builder \
.config("spark.jars.packages", "org.apache.hadoop:hadoop-aws:2.7.0") \
.getOrCreate()
return spark | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create_sparksession():\n return SparkSession.builder.\\\n appName(\"Transforming the historical parking occupancy and blockface datasets\").\\\n getOrCreate()",
"def create_spark_session():\n return SparkSession.builder \\\n .appName(\"Dataframe Reader\") \\... | [
"0.82489145",
"0.80367774",
"0.7908369",
"0.78492945",
"0.77564085",
"0.77505285",
"0.77456814",
"0.7738547",
"0.7738547",
"0.7738547",
"0.7738547",
"0.7738547",
"0.7738547",
"0.7738547",
"0.7738547",
"0.7738547",
"0.7701725",
"0.7671838",
"0.7640828",
"0.76396954",
"0.763788... | 0.7735459 | 17 |
Compute softmax values for each sets of scores in x. | def softmax(x):
exps = np.exp(x - np.max(x, axis=0))
return exps / exps.sum(axis=0) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def softmax(self, scores):\n\n\n # for each sample, for each class ,caclulate\n # np.exp(scores) : still (n_samples, n_classes)\n\n # axis = 1\n # a00, a01, a02 as a sinlge one to perfrom np_sum\n # which is the same sample \n # sum_exp : still (n_samples, 1)\n\n # ... | [
"0.77969456",
"0.7763414",
"0.776002",
"0.7756276",
"0.7657138",
"0.7657138",
"0.7657138",
"0.7657138",
"0.7589408",
"0.7434718",
"0.741048",
"0.739668",
"0.73613614",
"0.7320335",
"0.7271765",
"0.7265511",
"0.7264893",
"0.7259145",
"0.7232469",
"0.7217473",
"0.7205054",
"0... | 0.7018904 | 72 |
Get properties of polygon that contains input point. Assumes polygons do not overlap. | def point_in_poly(
points=None,
polys=None,
row_property_key="cell_id",
feature_property_key="id",
geom_key="geometry",
null_val=None
):
start_time = time.time()
count = 0
# create grid cell index
idx = inde... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def point_in_polygon(pnt, poly): # pnt_in_poly(pnt, poly): #\r\n x, y = pnt\r\n N = len(poly)\r\n for i in range(N):\r\n x0, y0, xy = [poly[i][0], poly[i][1], poly[(i + 1) % N]]\r\n c_min = min([x0, xy[0]])\r\n c_max = max([x0, xy[0]])\r\n if c_min < x <= c_max:\r\n ... | [
"0.6828267",
"0.67175186",
"0.6681977",
"0.6392235",
"0.6378791",
"0.6350491",
"0.6308446",
"0.62759066",
"0.62680393",
"0.6228602",
"0.6213215",
"0.6211722",
"0.6188564",
"0.6154515",
"0.6145886",
"0.6111578",
"0.61061966",
"0.6094427",
"0.6092774",
"0.6066715",
"0.6048478",... | 0.6078671 | 19 |
Custom weights initialization called on netG and netD right after model initialization | def weights_init(model):
classname = model.__class__.__name__
if classname.find('Conv') != -1:
nn.init.normal_(model.weight.data, 0.0, 0.02)
elif classname.find('BatchNorm') != -1:
nn.init.normal_(model.weight.data, 1.0, 0.02)
nn.init.constant_(model.bias.data, 0) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def init_weight(self):\n init_layer(self.conv1)\n init_layer(self.conv2)\n init_bn(self.norm1)\n init_bn(self.norm2)",
"def init_weights(model):\n ...",
"def initialize_weights(self):\n for layer in self._cnn_layers:\n weights_initializer.WeightsInitializer.initialize... | [
"0.8117624",
"0.80605996",
"0.8007431",
"0.77811384",
"0.7688543",
"0.7652412",
"0.7590346",
"0.75745",
"0.75676495",
"0.7544915",
"0.7537222",
"0.7532819",
"0.7521435",
"0.75052196",
"0.750165",
"0.7485618",
"0.74751526",
"0.7473282",
"0.74381334",
"0.74194723",
"0.74131286"... | 0.7549563 | 9 |
Gets the model name from the associated type | def get_model_name(model_type):
# mapping model type to it's name
if model_type in model_type_to_name_mapper:
return model_type_to_name_mapper[model_type]
# raising an exception for unknown model type
raise Exception('Unknown model type received.') | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def model_name(self):\n return self.get_queryset().model._meta.model_name",
"def model_name(self):\n return self.get_queryset().model._meta.model_name # pylint: disable=protected-access",
"def get_model_name(instance):\n return '{}.{}'.format(\n instance._meta.app_label,\n insta... | [
"0.75734043",
"0.7444617",
"0.7382649",
"0.7291634",
"0.716676",
"0.7147321",
"0.71214145",
"0.7098752",
"0.7000254",
"0.69906133",
"0.68833905",
"0.6868552",
"0.684525",
"0.6828543",
"0.67964625",
"0.67838734",
"0.67127603",
"0.66301394",
"0.66282237",
"0.6608396",
"0.658948... | 0.7355666 | 3 |
Create slices of the input array along the first dimension, with given frame_size and hop_size The other dimensions are preserved | def frame_ndarray(a, frame_size, hop_size):
n = a.shape[0]
nframes = 1 + (n - frame_size) // hop_size
other_dim = a.shape[1:]
if(nframes < 0):
nframes = 0
b = np.zeros([nframes, frame_size] + list(other_dim), dtype=a.dtype)
for i in range(nframes):
b[i] = a[i * hop_size: i * hop... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def make_slices(data, win_size):\n rows = data.shape[0] - win_size[0] + 1\n cols = data.shape[1] - win_size[1] + 1\n slices = []\n for i in range(win_size[0]):\n for j in range(win_size[1]):\n slices.append(data[i:rows+i, j:cols+j])\n return slices",
"def _slice(tensor, size, i):\n ... | [
"0.68964744",
"0.62929475",
"0.62584895",
"0.6170051",
"0.6137495",
"0.59449804",
"0.5893646",
"0.5830014",
"0.581169",
"0.5802531",
"0.58008146",
"0.5782168",
"0.5780379",
"0.577486",
"0.5769203",
"0.57616377",
"0.5742104",
"0.573392",
"0.5726501",
"0.56946117",
"0.56946117"... | 0.7558214 | 0 |
Given app is sessionwide, sets up a app context per test to ensure that app and request stack is not shared between tests. | def _setup_app_context_for_test():
ctx = application.app_context()
ctx.push()
yield # tests will run here
ctx.pop() | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def testapp(request, app):\n ctx = app.app_context()\n ctx.push()\n\n def teardown():\n ctx.pop()\n\n request.addfinalizer(teardown)\n\n return app",
"def test_app():\n param = {\n 'DEBUG': True,\n 'TESTING': True\n }\n _app = create_app(settings_override=param)\n\n ... | [
"0.7777927",
"0.7744633",
"0.7721974",
"0.7721974",
"0.7721974",
"0.76316226",
"0.74417377",
"0.7404311",
"0.7281511",
"0.72686625",
"0.7214887",
"0.7050797",
"0.70152307",
"0.6872111",
"0.68441236",
"0.6838134",
"0.68148524",
"0.67990583",
"0.6784746",
"0.67626",
"0.6675053"... | 0.82579345 | 0 |
get gc content of nucleotide string | def GetGC(flanks):
gc = 0
total = 0
for i in flanks:
if i != "N":
total += 1
if i == "C" or i == "G": gc += 1
return gc*1.0/total | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_gc_content(sequence):\n # get the sequence length and \n # make all the sequence characters upper case\n seq_len, sequence = len(sequence), sequence.upper()\n # count all gs and cs\n c = sequence.count('C')\n g = sequence.count('G')\n # returns the gc content from a sequence\n # sum... | [
"0.7056958",
"0.69149774",
"0.66151595",
"0.65842545",
"0.6502577",
"0.6018455",
"0.59811974",
"0.5954418",
"0.5904019",
"0.5898219",
"0.5898219",
"0.58760196",
"0.5807432",
"0.5803881",
"0.5699267",
"0.56167173",
"0.5427373",
"0.5422634",
"0.54177547",
"0.5357929",
"0.534826... | 0.0 | -1 |
get sequence entropy of nucleotide string | def GetEntropy(flanks):
countA = 0
countT = 0
countG = 0
countC = 0
for i in flanks:
if i == "A":
countA += 1
elif i == "T":
countT += 1
elif i == "C":
countC += 1
elif i == "G":
countG += 1
else: pass
total ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def entropy(string):\n p, lns = Counter(string), float(len(string))\n return -sum(count/lns * math.log(count/lns, 2) for count in p.values())",
"def sequence_entropy(sequence):\n c = Counter(sequence.upper())\n tot = float(sum(c.values()))\n c = {k: v / tot for k, v in c.items()}\n return -1 * ... | [
"0.7723619",
"0.69847256",
"0.69129014",
"0.68642175",
"0.67930067",
"0.67226386",
"0.6649973",
"0.661058",
"0.65022457",
"0.65022457",
"0.64421517",
"0.6263534",
"0.6217442",
"0.606598",
"0.6064648",
"0.6024633",
"0.5975352",
"0.596677",
"0.5941412",
"0.5931562",
"0.5922936"... | 0.0 | -1 |
Test email is present. | def test_signup_with_blank_email_false(self):
user = {
"Email": "",
"Password": "pass1234",
"Confirm Password": "pass5678"
}
res = self.client().post('/api/v1/auth/signup', data=user)
self.assertEqual(res.status_code, 400)
res = res.get_json()
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def isEmailUsed(self, email):\n\n\t\ttestq = {\"email\": email};\n\t\ttest_result = self.db.request(\"getOne\", testq);\n\n\t\tif test_result:\n\t\t\treturn True;\n\t\telse:\n\t\t\treturn False;",
"def test_is_valid_email(self):\n self.assertTrue(is_valid_email('abc@example.com'))",
"def test_email(self... | [
"0.7553329",
"0.7361899",
"0.731712",
"0.73033464",
"0.7284686",
"0.72527",
"0.71457624",
"0.71346086",
"0.71315265",
"0.7092227",
"0.707806",
"0.70550776",
"0.6985742",
"0.6976053",
"0.6971855",
"0.6970675",
"0.6963905",
"0.69633967",
"0.69582564",
"0.6957617",
"0.6935579",
... | 0.0 | -1 |
Test user cannot login with false credentials. | def test_login_wrong_credentials_false(self):
res = self.client().post('/api/v1/auth/signup', data=self.user)
self.assertEqual(res.status_code, 201)
logins = {
"Email": "user@example.com",
"Password": "pass4567"
}
resp = self.client().post('/api/v1/auth/lo... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_login_without_registration_false(self):\n logins = {\"email\": \"esta@x.com\", \"Password\": \"pass234\"}\n res = self.client().post('/api/v1/auth/login', data=logins)\n self.assertTrue(res.status_code, 403)",
"def test_login_not_activated(self):\n self.user.is_active = False... | [
"0.7738805",
"0.76381713",
"0.7616314",
"0.757128",
"0.7566164",
"0.75389755",
"0.74638844",
"0.7395982",
"0.73590374",
"0.7312937",
"0.7290937",
"0.7284764",
"0.72782385",
"0.7272676",
"0.7272676",
"0.7272676",
"0.7272676",
"0.72590643",
"0.7252548",
"0.72374606",
"0.7220257... | 0.76244324 | 2 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.