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 |
|---|---|---|---|---|---|---|
Gets the id of this Stop. | def id(self):
return self._id | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_id(self):\n return self._id",
"def get_id(self):\n return self._id",
"def get_id(self):\n return self._id",
"def get_id(self):\n return self._id",
"def get_id(self):\n return self._id",
"def get_id(self):\n return self._id",
"def get_id(self):\n\n\t\tre... | [
"0.726365",
"0.726365",
"0.726365",
"0.726365",
"0.726365",
"0.726365",
"0.7178399",
"0.7169161",
"0.7169161",
"0.7169161",
"0.7169161",
"0.7169161",
"0.7169161",
"0.7169161",
"0.7169161",
"0.7169161",
"0.7169161",
"0.7169161",
"0.7169161",
"0.7169161",
"0.7169161",
"0.7169... | 0.7099034 | 88 |
Sets the id of this Stop. | def id(self, id):
if id is None:
raise ValueError("Invalid value for `id`, must not be `None`")
self._id = id | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def SetId(self, id):\n self.id = int(id)",
"def set_id(self, id_):\n\n self.id_ = id_",
"def set_id(self, id):\n self.__id = id",
"def set_id(self, id):\n self.data['id'] = id",
"def setID(self, id):\n self._id = id\n return self.callRemote('setID', id)",
"def se... | [
"0.77822155",
"0.77449405",
"0.77366966",
"0.7332938",
"0.7287493",
"0.72759295",
"0.72361386",
"0.72265327",
"0.72265327",
"0.72265327",
"0.72265327",
"0.72265327",
"0.7200683",
"0.7200683",
"0.7200683",
"0.7200683",
"0.7200683",
"0.7200683",
"0.7200683",
"0.7200683",
"0.720... | 0.7312525 | 6 |
Gets the rt_dep_time of this Stop. | def rt_dep_time(self):
return self._rt_dep_time | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def dep_time(self):\n return self._dep_time",
"def rt_dep_date(self):\n return self._rt_dep_date",
"def rt_dep_time(self, rt_dep_time):\n\n self._rt_dep_time = rt_dep_time",
"def rt_arr_time(self):\n return self._rt_arr_time",
"def dt(self) -> float:\n return self._dt",
... | [
"0.7687774",
"0.6996497",
"0.6530535",
"0.6455306",
"0.6324123",
"0.6318792",
"0.63162935",
"0.6249587",
"0.6228131",
"0.62086356",
"0.6193525",
"0.61871",
"0.615714",
"0.6152181",
"0.6151181",
"0.61334264",
"0.61334264",
"0.6128495",
"0.61010206",
"0.6100852",
"0.6090513",
... | 0.8912979 | 0 |
Gets the rt_arr_time of this Stop. | def rt_arr_time(self):
return self._rt_arr_time | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def arr_time(self):\n return self._arr_time",
"def time(self):\n return self.time_array",
"def get_reltriggertimes(self):\n return np.array(self.trtimes)-self.soundstarttime",
"def rt_dep_time(self):\n return self._rt_dep_time",
"def rt_arr_time(self, rt_arr_time):\n\n se... | [
"0.8017832",
"0.746074",
"0.7157835",
"0.677074",
"0.67252845",
"0.66943794",
"0.6660984",
"0.6593752",
"0.6570837",
"0.6544666",
"0.6460825",
"0.6440828",
"0.64387363",
"0.6393684",
"0.6337722",
"0.6313111",
"0.6310829",
"0.6244255",
"0.6242575",
"0.62391704",
"0.62271243",
... | 0.8984452 | 0 |
Gets the name of this Stop. Contains the name of the stop/station | def name(self):
return self._name | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def name(self):\n return self.device.get_station_name(self.station_number)",
"def get_name(self) -> str:\n\n return self.name_",
"def get_name(self) -> str:\n return self._name",
"def get_name(self) -> str:\n return self._name",
"def name(self) -> str:\n station_name = se... | [
"0.8053515",
"0.7189965",
"0.71258575",
"0.71258575",
"0.7095744",
"0.7083274",
"0.7083274",
"0.7083274",
"0.70703286",
"0.70423067",
"0.70423067",
"0.7030836",
"0.7030639",
"0.70195436",
"0.70195436",
"0.70195436",
"0.70195436",
"0.70195436",
"0.70195436",
"0.70195436",
"0.7... | 0.0 | -1 |
Sets the name of this Stop. Contains the name of the stop/station | def name(self, name):
if name is None:
raise ValueError("Invalid value for `name`, must not be `None`")
self._name = name | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def SetName(self, name):\n self.name = name",
"def set_name(self, name):\n self.name = name",
"def set_name(self, name):\n self.name = name",
"def set_name(self, name):\n self.name = name",
"def set_name(self, name):\n self.name = name",
"def set_name(self, name):\n ... | [
"0.73414344",
"0.72423595",
"0.72423595",
"0.72423595",
"0.72423595",
"0.72423595",
"0.7180623",
"0.7180623",
"0.71770436",
"0.7116638",
"0.7114985",
"0.7103173",
"0.7103173",
"0.7100634",
"0.70982856",
"0.7095412",
"0.7095412",
"0.7083179",
"0.7043341",
"0.7041491",
"0.70336... | 0.0 | -1 |
Gets the arr_time of this Stop. | def arr_time(self):
return self._arr_time | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def rt_arr_time(self):\n return self._rt_arr_time",
"def time(self):\n return self.time_array",
"def get_time(self):\n return numpy.linspace(self.header.time_gate_start, \\\n self.header.time_gate_stop, self.num_time_bins())",
"def get_time(self):\n return self._ticks",... | [
"0.83302146",
"0.8180744",
"0.70893806",
"0.7075647",
"0.6956804",
"0.69371176",
"0.6903963",
"0.6798404",
"0.67489356",
"0.6744157",
"0.67013144",
"0.67013144",
"0.6687147",
"0.66778773",
"0.66766655",
"0.66760975",
"0.6674431",
"0.66558224",
"0.66033995",
"0.6602461",
"0.65... | 0.87676215 | 0 |
Sets the arr_time of this Stop. | def arr_time(self, arr_time):
self._arr_time = arr_time | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def rt_arr_time(self, rt_arr_time):\n\n self._rt_arr_time = rt_arr_time",
"def set_imeastime(self, time):\n self.itime = time",
"def set_time(self, time):\n self._time = time",
"def time(self, time):\n\n self._time = time",
"def time(self, time):\n\n self._time = time",
... | [
"0.79546803",
"0.678734",
"0.6780257",
"0.6684396",
"0.6684396",
"0.6684396",
"0.6684396",
"0.6684396",
"0.6667317",
"0.66168123",
"0.6599118",
"0.65046334",
"0.6385064",
"0.63193184",
"0.6204772",
"0.6189676",
"0.6189676",
"0.6155533",
"0.61068195",
"0.606069",
"0.60595495",... | 0.8499057 | 0 |
Sets the rt_dep_date of this Stop. Realtime departure date in format YYYYMMDD, if available | def rt_dep_date(self, rt_dep_date):
self._rt_dep_date = rt_dep_date | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def rt_dep_time(self, rt_dep_time):\n\n self._rt_dep_time = rt_dep_time",
"def rt_dep_date(self):\n return self._rt_dep_date",
"def dep_date(self, dep_date):\n\n self._dep_date = dep_date",
"def set_rdate(self, rdate):\n self.__rdate = rdate",
"def rt_arr_date(self, rt_arr_date)... | [
"0.7451476",
"0.715419",
"0.6850008",
"0.6428117",
"0.634053",
"0.55860007",
"0.5501941",
"0.5489291",
"0.54415125",
"0.542317",
"0.54166496",
"0.53196955",
"0.527472",
"0.52321666",
"0.5226858",
"0.52175283",
"0.52150464",
"0.51844734",
"0.5161841",
"0.5150237",
"0.5140929",... | 0.87562996 | 0 |
Sets the rt_arr_date of this Stop. Realtime arrival date in format YYYYMMDD, if available | def rt_arr_date(self, rt_arr_date):
self._rt_arr_date = rt_arr_date | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def rt_dep_date(self, rt_dep_date):\n\n self._rt_dep_date = rt_dep_date",
"def rt_arr_time(self, rt_arr_time):\n\n self._rt_arr_time = rt_arr_time",
"def arr_date(self, arr_date):\n\n self._arr_date = arr_date",
"def rt_arr_date(self):\n return self._rt_arr_date",
"def set_rdate... | [
"0.71861106",
"0.70687103",
"0.6814935",
"0.67884266",
"0.6282097",
"0.62083244",
"0.5715029",
"0.54646194",
"0.5452729",
"0.534824",
"0.53146935",
"0.5242237",
"0.5218246",
"0.5197196",
"0.5193395",
"0.51716703",
"0.5146091",
"0.5146091",
"0.5133277",
"0.50986135",
"0.509339... | 0.8290899 | 0 |
Returns true if both objects are equal | def __eq__(self, other):
if not isinstance(other, Stop):
return False
return self.__dict__ == other.__dict__ | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __eq__(self, other):\n return are_equal(self, other)",
"def __eq__(self, other):\n return are_equal(self, other)",
"def __eq__(self,other):\n try: return self.object==other.object and isinstance(self,type(other))\n except: return False",
"def __eq__(self, other):\n if i... | [
"0.8088132",
"0.8088132",
"0.8054589",
"0.7982687",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
... | 0.0 | -1 |
Returns true if both objects are not equal | def __ne__(self, other):
return not self == other | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __ne__(self, other: object) -> bool:\n if self.__eq__(other):\n return False\n return True",
"def __ne__(self, other: object) -> bool:\n return not self.__eq__(other)",
"def __ne__(self, other) -> bool:\n return not self.__eq__(other)",
"def __eq__(self, other):\n ... | [
"0.845611",
"0.8391477",
"0.8144138",
"0.81410587",
"0.8132492",
"0.8093973",
"0.80920255",
"0.80920255",
"0.80920255",
"0.8085325",
"0.8085325",
"0.8076365",
"0.8076365",
"0.8065748"
] | 0.0 | -1 |
A decorator that redirects to index if the user is logged in. | def not_logged_in(f):
@wraps(f)
def decorated_function(*args, **kwargs):
if 'idToken' in session:
return redirect(url_for('index'))
else:
return f(*args, **kwargs)
return decorated_function | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def login_required(f):\n @wraps(f)\n def decorated_function(*args, **kwargs):\n if session.get(\"user_id\") is None:\n return redirect(url_for(\"index\"))\n return f(*args, **kwargs)\n return decorated_function",
"def require_logged_in():\n def handler(f, *args, **kwargs):\n ... | [
"0.77896225",
"0.7728219",
"0.74859095",
"0.73631585",
"0.73534447",
"0.73190653",
"0.73190653",
"0.7316723",
"0.724827",
"0.72439337",
"0.7230037",
"0.71956",
"0.7178547",
"0.7170036",
"0.711816",
"0.7113426",
"0.710824",
"0.7082113",
"0.7061863",
"0.7052488",
"0.704026",
... | 0.7381329 | 3 |
Parse a LookML file into a dictionary with keys for each of its primary properties and a list of values. | def read_data_from_file(self, local_lookml_project_path: str) -> dict:
logger.info(
"Parsing data from local LookML file {}".format(
self.lookml_file_name_and_path
)
)
with open(
utils.assemble_path(
local_lookml_project_path, s... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def parse_lookml_file(lookml_file_name: str) -> dict:\n logger.info(\"Parsing data from LookML file {}\".format(lookml_file_name))\n with open(lookml_file_name, \"r\") as lookml_file_stream:\n lookml_data = lkml.load(lookml_file_stream)\n\n return lookml_data",
"def medline_parser(filename):\n ... | [
"0.7154593",
"0.5802885",
"0.5632429",
"0.5624744",
"0.5611319",
"0.55730563",
"0.55182415",
"0.55140483",
"0.5488397",
"0.54710776",
"0.5430578",
"0.54044247",
"0.53895724",
"0.53690803",
"0.5354642",
"0.5333724",
"0.53087693",
"0.52718097",
"0.52662635",
"0.52570117",
"0.52... | 0.6288773 | 1 |
Parse a LookML file into a dictionary with keys for each of its primary properties and a list of values. | def parse_lookml_file(lookml_file_name: str) -> dict:
logger.info("Parsing data from LookML file {}".format(lookml_file_name))
with open(lookml_file_name, "r") as lookml_file_stream:
lookml_data = lkml.load(lookml_file_stream)
return lookml_data | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def read_data_from_file(self, local_lookml_project_path: str) -> dict:\n logger.info(\n \"Parsing data from local LookML file {}\".format(\n self.lookml_file_name_and_path\n )\n )\n with open(\n utils.assemble_path(\n local_lookml_... | [
"0.6288773",
"0.5802885",
"0.5632429",
"0.5624744",
"0.5611319",
"0.55730563",
"0.55182415",
"0.55140483",
"0.5488397",
"0.54710776",
"0.5430578",
"0.54044247",
"0.53895724",
"0.53690803",
"0.5354642",
"0.5333724",
"0.53087693",
"0.52718097",
"0.52662635",
"0.52570117",
"0.52... | 0.7154593 | 0 |
Create and save a User with the given email and password. | def _create_user(self, email, password, **extra_fields):
if not email:
raise ValueError('The given email must be set')
email = self.normalize_email(email)
user = self.model(email=email, **extra_fields)
user.set_password(password)
user.save(using=self._db)
retu... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _create_user(self, email, password, **extra_fields):\n if not email:\n raise ValueError('The given email must be set')\n email = self.normalize_email(email)\n user = self.model(email=email, **extra_fields)\n user.set_password(password)\n user.save(using=self._db)\n return user",
"def... | [
"0.85445017",
"0.8511888",
"0.850827",
"0.85025996",
"0.8502548",
"0.84896004",
"0.84896004",
"0.84888655",
"0.84888655",
"0.84888655",
"0.8486028",
"0.84772795",
"0.84767693",
"0.84570897",
"0.84570897",
"0.84570897",
"0.84544164",
"0.84484667",
"0.8445246",
"0.84436035",
"0... | 0.8475504 | 19 |
Displays ``Person`` object list. This is a short wrapper around the generic ``list_detail.object_list`` view. So, all context variables populated by that view will be available here. Additionally, any keyword arguments which are valid for this generic view will be accepted and passed to it. | def person_list(request, queryset=None, **kwargs):
if queryset is None:
queryset = Person.objects.all()
if 'queryset' in kwargs:
del kwargs['queryset']
if 'template_name' not in kwargs:
kwargs['template_name'] = 'flickrsets/person/list.html'
if 'template_object... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def list(self, request, **kwargs):\n queryset = self.get_queryset()\n filtered_queryset = self.filter_queryset(queryset)\n filtered_queryset = exclude_persons_without_registrations(request, filtered_queryset) \n\n page = self.paginate_queryset(filtered_queryset)\n if page is not ... | [
"0.65357625",
"0.64453477",
"0.6269414",
"0.6173619",
"0.61658984",
"0.6079124",
"0.60379803",
"0.59815264",
"0.5940873",
"0.5840392",
"0.5830503",
"0.5678174",
"0.5648108",
"0.5604328",
"0.5592674",
"0.55575436",
"0.5530109",
"0.55266225",
"0.5495391",
"0.5485941",
"0.548113... | 0.7846234 | 0 |
Docstring is inherited from the lightgbm.LGBMClassifier.__init__. | def __init__(
self,
boosting_type: str = 'gbdt',
num_leaves: int = 31,
max_depth: int = -1,
learning_rate: float = 0.1,
n_estimators: int = 100,
subsample_for_bin: int = 200000,
objective: Optional[Union[Callable, str]] = None,
class_weight: Option... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def train_default(X_train, Y_train):\n model = lgb.LGBMClassifier(objective = 'multiclass', num_class = \"6\", random_state = 42)\n model.fit(X_train, Y_train)\n return model",
"def __init__(self, X, y, sample_weights):\n self.name = \"Gaussian Naive Bayes\"\n self.clf = self.train(X, y, s... | [
"0.6429635",
"0.63709646",
"0.627782",
"0.62148213",
"0.60824156",
"0.60418713",
"0.60373324",
"0.6033039",
"0.6029882",
"0.6000455",
"0.598949",
"0.5944557",
"0.593533",
"0.59306335",
"0.5886373",
"0.58777094",
"0.5866529",
"0.5851644",
"0.58496803",
"0.5840083",
"0.5824482"... | 0.57389 | 26 |
Docstring is inherited from the lightgbm.LGBMClassifier.predict_proba. | def predict_proba(self, X: _DaskMatrixLike, **kwargs: Any) -> dask_Array:
return _predict(
model=self.to_local(),
data=X,
pred_proba=True,
**kwargs
) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def predict_proba(self):\n ...",
"def predict_proba(self, X):\n raise NotImplementedError()",
"def predict_proba(self, X, **kwargs):\n raise NotImplementedError",
"def predict_proba(self, test_data):\r\n return self.gs.predict_proba(test_data)",
"def predict_proba(self, X):\n ... | [
"0.74986655",
"0.7012414",
"0.69736665",
"0.6866382",
"0.66793036",
"0.66719663",
"0.66416246",
"0.66085607",
"0.6599807",
"0.6539933",
"0.65254825",
"0.64905876",
"0.64903504",
"0.64206034",
"0.6416573",
"0.6414869",
"0.6391795",
"0.635894",
"0.63503444",
"0.6341957",
"0.634... | 0.0 | -1 |
This method tests that the correct customers are displayed for the product_id | def test_show_rentals(self):
database.import_data('csvs', 'product_data.csv', 'customer_data.csv', 'rentals_data.csv')
actual_customers1 = database.show_rentals('prd002')
expected_customers1 = {'cst001': {'name': 'Charlie', 'address': '123 Fleet Street',
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_display_customers(self):\r\n create_empty_db()\r\n self.assertEqual([], display_customers())\r\n add_customer(**user_1)\r\n add_customer(**user_2)\r\n add_customer(**user_3)\r\n self.assertEqual(['Post Malone', 'Howard Moon', 'Vince Noir'],\r\n ... | [
"0.68576336",
"0.6846851",
"0.6747285",
"0.6618832",
"0.65362805",
"0.6521763",
"0.6520921",
"0.64983934",
"0.64967227",
"0.6480861",
"0.64760214",
"0.64717597",
"0.6457182",
"0.64373064",
"0.6432685",
"0.63893515",
"0.636952",
"0.63634014",
"0.63507",
"0.63500786",
"0.633699... | 0.601694 | 39 |
Initialise an instance using an existing variable The Variable instance needs to be part of a Group instance in order to gain access to other related variables and dimensions that are required for the coordinates mapping | def __init__(self, variable):
self.variable = variable
self.group = variable.group
# A field holds a list of its coordinates variables, ie. variables that describe
# the values assocated with all its dimensions
self.coordinates_variables = []
# The coordinates mapping dictionary maps between coordina... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __init__(self, name, variable, variable_info):\n self._name = name\n self.var_id = variable\n self.var_period = variable_info[0]\n self.var_type = variable_info[1]\n self.var_detail = variable_info[2]\n self.var_units = variable_info[3]\n self.var_icon = variabl... | [
"0.6788297",
"0.6594964",
"0.6577682",
"0.6431829",
"0.6404017",
"0.63923275",
"0.63878894",
"0.6116802",
"0.60677695",
"0.60594225",
"0.60086495",
"0.59977156",
"0.59968954",
"0.5996611",
"0.5992913",
"0.5992913",
"0.59919804",
"0.5987395",
"0.598687",
"0.5980395",
"0.597933... | 0.74736243 | 0 |
Returns a 2D numpy array of latitudes. If the latitude coordinate variable is 1D then it is extended to 2D. | def latlons(self):
# First check we have a grid feature type
if self.featuretype in ['Grid', 'GridSeries']:
latvar = self.latitude_variable
lonvar = self.longitude_variable
latdims = self.coordinates_mapping['latitude']['map']
londims = self.coordinates_mapping['longitude']['map']
# Create lati... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def convertLatLon(latCell, lonCell):\n cell_lats = np.array([])\n cell_lons = np.array([])\n for lat in latCell:\n cell_lats = np.append(cell_lats, lat * (180 / np.pi)) \n for lon in lonCell:\n cell_lons = np.append(cell_lons, lon * (180 / np.pi)) \n\n return cell_lats, cell_lons",
... | [
"0.6345822",
"0.6261727",
"0.6231209",
"0.61587626",
"0.6150579",
"0.6115615",
"0.6115161",
"0.6115161",
"0.61025774",
"0.59802324",
"0.5973856",
"0.59561515",
"0.5955485",
"0.59342444",
"0.58650833",
"0.5845648",
"0.58366835",
"0.582888",
"0.5814165",
"0.5769238",
"0.5748771... | 0.6128685 | 5 |
Return the training labels in a window for a scene. | def get_train_labels(self, window: Box, scene: Scene) -> Labels:
raise NotImplementedError() | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_train_labels(self, window, scene):\n pass",
"def get_train_labels(self, window: Box, scene: Scene) -> np.ndarray:\n label_store = scene.ground_truth_label_source\n return label_store.get_labels(window)",
"def get_train_windows(self, scene):\n pass",
"def get_train_windows(... | [
"0.8267031",
"0.7965654",
"0.7267892",
"0.66961306",
"0.6506633",
"0.62388337",
"0.5990519",
"0.5841788",
"0.5770139",
"0.5764061",
"0.57084584",
"0.57053065",
"0.56334287",
"0.55925506",
"0.55788904",
"0.557281",
"0.55300945",
"0.54728734",
"0.54728734",
"0.54529315",
"0.545... | 0.7797557 | 2 |
Return the vector of partial derivatives \partial C_x / \partial a for the output activations. | def cost_derivative(self, output_activations, y):
return (output_activations-y) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def compute_partials(self, inputs, partials):\n SOC = inputs['SOC']\n temperature = inputs['temperature']\n P_bat = inputs['P_bat']\n\n # dI_dP\n dV_dvoc = IR * self.exponential\n dV_dT = - IR * self.voc * np.exp(alpha*(temperature[4, :] - T0)/T0) * alpha / T0\n dVo... | [
"0.6179747",
"0.6113179",
"0.6110102",
"0.6063869",
"0.6060675",
"0.5840477",
"0.58356196",
"0.57909757",
"0.5785478",
"0.576321",
"0.56212157",
"0.5613195",
"0.56029624",
"0.56029624",
"0.56029624",
"0.56029624",
"0.5575484",
"0.5562849",
"0.5559713",
"0.5545122",
"0.5525026... | 0.56648666 | 10 |
Derivative of the sigmoid function. | def sigmoid_prime(z):
return sigmoid(z)*(1-sigmoid(z)) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def sigmoid_derivative(x):\n return x * (1-x)",
"def sigmoid_derivative(x):\n return x * (1.0 - x)",
"def sigmoid_derivative(x):\n\n return sigmoid(x) * (1 - sigmoid(x))",
"def derivative_sigmoid(x):\n return x * (1 - x)",
"def derivative_sigmoid(x):\n return x * (1 - x)",
"def sigmoid_der... | [
"0.84754366",
"0.8450928",
"0.8396931",
"0.83485264",
"0.83485264",
"0.8298343",
"0.80539966",
"0.7753385",
"0.77070266",
"0.7498153",
"0.7464916",
"0.7454039",
"0.7401582",
"0.7385017",
"0.73829913",
"0.7346935",
"0.7321687",
"0.73094004",
"0.7192053",
"0.7113881",
"0.709236... | 0.0 | -1 |
Compute softmax values for each sets of scores in x. | def softmax(x):
e_x = np.exp(x - np.max(x))
return e_x / e_x.sum(axis=0) # only difference
| {
"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.7800231",
"0.776332",
"0.7762483",
"0.77600384",
"0.76607925",
"0.76607925",
"0.76607925",
"0.76607925",
"0.7585753",
"0.7432371",
"0.7409777",
"0.73932534",
"0.7360278",
"0.731833",
"0.72708684",
"0.7263948",
"0.7262435",
"0.7257905",
"0.7231808",
"0.72159433",
"0.7203519... | 0.70370984 | 70 |
Derivative of the sigmoid function. | def cross_entropy(t,y):
#print(-1*t*np.log(y))
#print(np.shape(np.log(y)))
#print(np.shape(t))
return t*np.log(y)*(-1) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def sigmoid_derivative(x):\n return x * (1-x)",
"def sigmoid_derivative(x):\n return x * (1.0 - x)",
"def sigmoid_derivative(x):\n\n return sigmoid(x) * (1 - sigmoid(x))",
"def derivative_sigmoid(x):\n return x * (1 - x)",
"def derivative_sigmoid(x):\n return x * (1 - x)",
"def sigmoid_der... | [
"0.84754366",
"0.8450928",
"0.8396931",
"0.83485264",
"0.83485264",
"0.8298343",
"0.80539966",
"0.7753385",
"0.77070266",
"0.7498153",
"0.7464916",
"0.7454039",
"0.7401582",
"0.7385017",
"0.73829913",
"0.7346935",
"0.7321687",
"0.73094004",
"0.7192053",
"0.7113881",
"0.709236... | 0.0 | -1 |
Yield successive nsized chunks from l. | def chunks(l, n):
for i in xrange(0, len(l), n):
yield l[i:i+n] | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _chunk(self, l, n):\n for i in range(0, len(l) + 1, n):\n yield l[i:i + n]",
"def chunks(self, l, n):\n for i in range(0, len(l), n):\n yield l[i:i + n]",
"def __chunks(l, n):\n for i in range(0, len(l), n):\n yield l[i:i + n]",
"def get_chunks(self, ... | [
"0.8038751",
"0.7924752",
"0.7923082",
"0.78850657",
"0.78771824",
"0.7815519",
"0.77652335",
"0.775546",
"0.77440816",
"0.77313656",
"0.77284646",
"0.77244157",
"0.770246",
"0.76888484",
"0.76888484",
"0.766384",
"0.7655605",
"0.7655605",
"0.76455575",
"0.76455575",
"0.76455... | 0.7656689 | 16 |
Handle not found error. | def page_not_found(request, exception): # noqa
return render(request, 'misc/404.html', status=404) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def not_found(error):\n pass",
"def handleStatus_404(self):\n log.err('HTTP Error 404')",
"def handle_notfound( environ ):\n return 404, [], make_error( 'Not Found', environ[ 'PATH_INFO' ] )",
"def not_found():\n return HttpError(404)",
"def not_found_error_handler(error):\r\n return ren... | [
"0.8375228",
"0.77903163",
"0.7699582",
"0.7643736",
"0.75725836",
"0.75503904",
"0.75191194",
"0.7458749",
"0.7291103",
"0.7281352",
"0.7279621",
"0.7276413",
"0.7272537",
"0.72636575",
"0.72505176",
"0.72053206",
"0.7197839",
"0.71945566",
"0.71881104",
"0.71881104",
"0.718... | 0.6681971 | 83 |
Displays statistics on the most frequent times of travel. | def time_stats(df):
print('\nCalculating The Most Frequent Times of Travel...\n')
start_time = time.time()
# Calculates the most frequent month of travel
df['month'] = pd.to_datetime(df['Start Time']).dt.month
freq_month = df['month'].mode()[0]
print('The most common month: ',freq_month)
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def time_stats(df):\n\n print('\\nDisplaying the statistics on the most frequent times of '\n 'travel...\\n')\n start_time = time.time()\n\n # display the most common month\n most_common_month = df['Month'].mode()[0]\n print('For the selected filter, the month with the most travels is: ' +\... | [
"0.80247396",
"0.80233026",
"0.7915788",
"0.78266186",
"0.7822246",
"0.78143597",
"0.77659196",
"0.7740343",
"0.773628",
"0.77344066",
"0.76867086",
"0.7668633",
"0.7651731",
"0.7644636",
"0.76399267",
"0.76367253",
"0.7625196",
"0.7623158",
"0.7612803",
"0.76002145",
"0.7583... | 0.748398 | 34 |
Displays statistics on the most popular stations and trip. | def station_stats(df):
print('\nCalculating The Most Popular Stations and Trip...\n')
start_time = time.time()
# Calculates the most frequently used start station
freq_start_station = df['Start Station'].mode()[0]
print('The most commonly used start station: ',freq_start_station)
# Calculates... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def station_stats(df):\n\n print('\\nCalculating The Most Popular Stations and Trip...\\n')\n start_time = time.time()\n\n # display most commonly used start station\n print(popular_start_station(df))\n\n # display most commonly used end station\n print(popular_end_station(df))\n\n # display m... | [
"0.7815675",
"0.7662213",
"0.7553417",
"0.74914914",
"0.74748665",
"0.7446617",
"0.7428588",
"0.74237514",
"0.74177027",
"0.7400495",
"0.7387161",
"0.7385634",
"0.73647535",
"0.735934",
"0.73566747",
"0.73548365",
"0.7351854",
"0.7351274",
"0.735057",
"0.73421645",
"0.7340198... | 0.68482536 | 92 |
Displays statistics on the total and average trip duration. | def trip_duration_stats(df):
print('\nCalculating Trip Duration...\n')
start_time = time.time()
# Calculates the the total trip duration based on filter
total_tt = df['Trip Duration'].sum()
print('Total travel time: ',total_tt)
# Calculates the the total trip duration based on filter
mean_... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def trip_duration_stats(data):\n print('\\nCalculating Trip Duration...\\n')\n start_time = time.time()\n # display total travel time\n total_trip_time= data['Trip Duration'].sum()\n print('The Total Travel Time is {} Hours'. format(total_trip_time/3600))\n # display mean travel time\n avg_tri... | [
"0.8145283",
"0.80273277",
"0.800625",
"0.79516613",
"0.79394716",
"0.7933188",
"0.79289365",
"0.7917429",
"0.79167455",
"0.79100615",
"0.79077137",
"0.7902854",
"0.7893696",
"0.7891645",
"0.7888904",
"0.7887135",
"0.78862405",
"0.7884963",
"0.78764445",
"0.7870734",
"0.78687... | 0.77970666 | 49 |
Plot a bar graph showing the stationary distribution | def showStationaryDistrib(game, strats, stationary):
n = len(strats)
x = [i for i in range(n)]
fig = plt.figure()
plt.title(game)
ax = fig.add_subplot(111)
ax.set_ylabel("stationary distribution")
plt.xticks(x, strats)
for i in range (n):
plt.bar(x[i], stationary[i])
ax.sp... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def barGraph(listOfWord, listOfFrequency):\r\n\r\n\tindex = np.arange(len(listOfWord))\r\n\r\n\tplt.title(\"Frekuensi Kemunculan Kata\")\r\n\tplt.barh(index, listOfFrequency)\r\n\tplt.xlabel('Frekuensi')\r\n\tplt.yticks(index, listOfWord, fontsize=6)\r\n\r\n\tplt.show()",
"def plot(self):\n x = np.arange(... | [
"0.6849079",
"0.6740979",
"0.6694774",
"0.6570178",
"0.6556347",
"0.64954996",
"0.6417373",
"0.641051",
"0.6393068",
"0.6371199",
"0.630935",
"0.6294484",
"0.62397254",
"0.62231493",
"0.618022",
"0.61578",
"0.61442417",
"0.6070031",
"0.60445136",
"0.5997942",
"0.5992789",
"... | 0.6950608 | 0 |
Verify that Project object is successfully created for every example PEP | def test_serialization(self, example_pep_cfg_path):
td = tempfile.mkdtemp()
fn = os.path.join(td, "serialized_sample.yaml")
p = Project(cfg=example_pep_cfg_path)
sample = p.samples[0]
sample.set = set(["set"])
sample.dict = dict({"dict": "dict"})
sample.list = lis... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_create_project(self):\n pass",
"def test_create_project(self):\n pass",
"def test_create_project(self):\n pass",
"def test_add_project(self):\n pass",
"def test_create_project_request(self):\n pass",
"def test_project_creation(self):\n title = 'Project t... | [
"0.81139183",
"0.81139183",
"0.81139183",
"0.7593771",
"0.7542107",
"0.7512528",
"0.71821094",
"0.70566976",
"0.70373243",
"0.7002261",
"0.7002261",
"0.69527936",
"0.6909405",
"0.6902564",
"0.6881158",
"0.6878708",
"0.6862279",
"0.6858888",
"0.68428713",
"0.68428713",
"0.6818... | 0.0 | -1 |
Return a blob of all zeros of the given shape with the correct float or int data type. | def zeros(shape, int32=False):
return np.zeros(shape, dtype=np.int32 if int32 else np.float32) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def zeros(shape, dtype=None):\n\n return full(shape, 0, dtype)",
"def zeros(shape, dtype=None):\r\n if not isinstance(shape, (list, tuple, TensorVariable)):\r\n shape = [shape]\r\n if dtype is None:\r\n dtype = config.floatX\r\n return alloc(numpy.array(0, dtype=dtype), *shape)",
"def... | [
"0.72282934",
"0.68636596",
"0.6807702",
"0.6704859",
"0.6667875",
"0.66378874",
"0.63715976",
"0.63620853",
"0.6317387",
"0.6314163",
"0.6308092",
"0.62969506",
"0.62817484",
"0.62364775",
"0.6224989",
"0.61669636",
"0.61573875",
"0.61561126",
"0.61561126",
"0.6142382",
"0.6... | 0.7122343 | 2 |
Return a blob of all ones of the given shape with the correct float or int data type. | def ones(shape, int32=False):
return np.ones(shape, dtype=np.int32 if int32 else np.float32) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def ones(shape, dtype=None):\n\n return full(shape, 1, dtype)",
"def ones(shape, dtype=None):\n raise NotImplementedError",
"def ones(shape, dtype=None):\r\n if not isinstance(shape, (list, tuple, TensorVariable)):\r\n shape = [shape]\r\n if dtype is None:\r\n dtype = config.float... | [
"0.7285916",
"0.72152764",
"0.7031946",
"0.6864718",
"0.6554843",
"0.6412359",
"0.63802326",
"0.63202214",
"0.6320077",
"0.62536645",
"0.6206465",
"0.62026036",
"0.61742896",
"0.6135492",
"0.6126547",
"0.60673076",
"0.60272217",
"0.5983625",
"0.5934744",
"0.58622354",
"0.5798... | 0.7137641 | 3 |
Copy a numpy ndarray given as blob_in into the Caffe2 CPUTensor blob given as blob_out. Supports float32 and int32 blob data types. This function is intended for copying numpy data into a Caffe2 blob in PythonOps. | def py_op_copy_blob(blob_in, blob_out):
# Some awkward voodoo required by Caffe2 to support int32 blobs
needs_int32_init = False
try:
_ = blob.data.dtype # noqa
except Exception:
needs_int32_init = blob_in.dtype == np.int32
if needs_int32_init:
# init can only take a list (f... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def convert_array(self,blob):\n import io\n import array,numpy\n out = io.BytesIO(blob)\n out.seek(0)\n\n return numpy.load(out)",
"def convert_array(blob):\n out = io.BytesIO(blob)\n out.seek(0)\n\n return np.load(out)",
"def _copy_into(ndarray, nparray):\n asser... | [
"0.53912574",
"0.536932",
"0.48840538",
"0.48426747",
"0.4785386",
"0.47464415",
"0.4723978",
"0.47081098",
"0.4664089",
"0.46630275",
"0.46351993",
"0.45872542",
"0.4559445",
"0.45364606",
"0.45209974",
"0.45194095",
"0.45023206",
"0.44658765",
"0.4454143",
"0.44527698",
"0.... | 0.78645194 | 1 |
Return object's repr when not JSON serializable. | def default(self, o): # pylint: disable=E0202
# E0202 ignored in favor of compliance with documentation:
# https://docs.python.org/2/library/json.html#json.JSONEncoder.default
try:
return repr(o)
except Exception: # pylint: disable=W0703
return super(FailProofJS... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def repr_(object_):\n return repr(object_)",
"def srepr(obj):\n return repr(str(obj))",
"def __repr__(self):\n return repr(self.__dict__['_obj'])",
"def __repr__(self):\n\n result = json.dumps(self.__dict__, ensure_ascii=False)\n logger.debug('%s: %s', self.__class__.__name... | [
"0.80349576",
"0.7406908",
"0.73244435",
"0.7263724",
"0.7263724",
"0.7115097",
"0.70030326",
"0.6989556",
"0.69858974",
"0.6908359",
"0.68933475",
"0.68650883",
"0.6811189",
"0.6801968",
"0.6788987",
"0.6783819",
"0.6764391",
"0.67630416",
"0.67630416",
"0.67630416",
"0.6741... | 0.694877 | 9 |
Override it to convert fields of `json_record` to needed types. Default implementation converts `datetime` to string in ISO8601 format. | def mutate_json_record(self, json_record):
for attr_name in json_record:
attr = json_record[attr_name]
if isinstance(attr, datetime):
json_record[attr_name] = attr.isoformat()
return json_record | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def convert_for_json(obj):\n if isinstance(obj, datetime.datetime):\n return obj.__str__()\n return obj",
"def json_conversion_handler(x):\n if isinstance(x, datetime.datetime):\n return x.isoformat()\n raise TypeError(\"Unknown type\")",
"def json_serial2(self, obj):\n if isin... | [
"0.7333845",
"0.71693796",
"0.6951043",
"0.69337344",
"0.6900057",
"0.68766034",
"0.6843432",
"0.6779006",
"0.67584693",
"0.6723259",
"0.66961086",
"0.66923267",
"0.66548216",
"0.6640674",
"0.6540086",
"0.65330344",
"0.6523918",
"0.6512258",
"0.651127",
"0.6500101",
"0.648042... | 0.7563179 | 0 |
Finds the next available js device name. | def next_joystick_device():
for i in range(100):
dev = "/dev/input/js{0}".format(i)
if not os.path.exists(dev):
return dev | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _next_device(self):\n if self._num_gpus == 0:\n return ''\n dev = '/gpu:%d' % self._cur_gpu\n if self._num_gpus > 1:\n self._cur_gpu = (self._cur_gpu + 1) % (self._num_gpus-1)\n return dev",
"def find_iio_device_name(self):\n self.iio_device_dir()\n self.console.runcmd(f\"... | [
"0.67444885",
"0.61093616",
"0.6106118",
"0.6046665",
"0.6046665",
"0.6029043",
"0.59409964",
"0.59409964",
"0.58589995",
"0.5786157",
"0.5755604",
"0.5746992",
"0.5738526",
"0.5604021",
"0.5579018",
"0.55573934",
"0.554831",
"0.55335045",
"0.5528146",
"0.5525199",
"0.551216"... | 0.7388181 | 0 |
Adds a depthwise convolution block. A depthwise convolution block consists of a depthwise conv, batch normalization, relu6, pointwise convolution, batch normalization and relu6 activation. | def _depthwise_conv_block(inputs, pointwise_conv_filters, alpha,
depth_multiplier=1, strides=(1, 1), block_id=1,
dilation_rate=1):
channel_axis = 1 if K.image_data_format() == 'channels_first' else -1
pointwise_conv_filters = int(pointwise_conv_filters * alpha... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _depthwise_conv_block(inputs, pointwise_conv_filters, alpha,\n depth_multiplier=1, strides=(1, 1), block_id=1):\n channel_axis = 1 if K.image_data_format() == 'channels_first' else -1\n pointwise_conv_filters = int(pointwise_conv_filters * alpha)\n\n if strides == (1, 1):\n ... | [
"0.69558424",
"0.6695712",
"0.6448115",
"0.6446077",
"0.6383144",
"0.6340293",
"0.62563384",
"0.6205448",
"0.6204916",
"0.61858875",
"0.6173951",
"0.61019963",
"0.60959464",
"0.6016381",
"0.6016267",
"0.60086316",
"0.59901017",
"0.59851676",
"0.59697664",
"0.59540266",
"0.593... | 0.6983883 | 0 |
The kind of field it is e.g boolean_field. Useful for better semantic markup of field display based on type | def field_type(self):
return "" | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def type(self):\n return self._field.type",
"def setting_type(self):\n if self.is_bool():\n return 'boolean'\n\n elif self.is_int():\n return 'integer'\n\n elif self.is_model():\n return 'related field'\n\n else:\n return 'string'",
... | [
"0.7274476",
"0.7087004",
"0.6621983",
"0.6603038",
"0.6449844",
"0.6385825",
"0.6223658",
"0.61415523",
"0.61385006",
"0.6135059",
"0.6109853",
"0.61059016",
"0.6098142",
"0.60919863",
"0.60746455",
"0.6066741",
"0.60645247",
"0.6043078",
"0.6000959",
"0.5991569",
"0.5991569... | 0.7158313 | 1 |
Constructor for the GenerateConnectEmailResponseMultipleBorrowers class | def __init__(self,
links=None,
email_config=None,
additional_properties = {}):
# Initialize members of the class
self.links = links
self.email_config = email_config
# Add additional model properties to the instance
se... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __init__(self, coinid, page, limit, cids=None):\n\t\tself.limit = int(limit)\n\t\tself.coinid = coinid\n\t\ttry:\n\t\t\tself.page = int(page)\n\t\texcept:\n\t\t\tself.page = None\n\t\tself.last_blocks = {}\n\n\t\tif not cids:\n\t\t\tclient = SignedHTTPClient(settings.bridges[coinid])\n\t\t\ttry:\n\t\t\t\tcid =... | [
"0.52811897",
"0.5253467",
"0.51010275",
"0.50697225",
"0.4960693",
"0.49059728",
"0.48745036",
"0.4856478",
"0.48550487",
"0.48540875",
"0.48486677",
"0.4847886",
"0.48195577",
"0.4814461",
"0.48090544",
"0.4807091",
"0.48022527",
"0.48022527",
"0.47892064",
"0.47884735",
"0... | 0.0 | -1 |
Creates an instance of this model from a dictionary | def from_dictionary(cls,
dictionary):
if dictionary is None:
return None
# Extract variables from the dictionary
links = dictionary.get('links')
email_config = dictionary.get('emailConfig')
# Clean out expected properties from dictio... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def from_dictionary(cls,\n dictionary):\n if dictionary is None:\n return None\n\n # Extract variables from the dictionary\n id = dictionary.get('id')\n name = dictionary.get('name')\n mtype = dictionary.get('type')\n usage_bytes = diction... | [
"0.83181584",
"0.8168118",
"0.8168118",
"0.8118749",
"0.8089047",
"0.79787344",
"0.7949278",
"0.79231393",
"0.7898951",
"0.78923255",
"0.788838",
"0.7882321",
"0.7876749",
"0.78585315",
"0.7836853",
"0.7801407",
"0.7801407",
"0.7801407",
"0.7801407",
"0.7801407",
"0.7801407",... | 0.7882212 | 12 |
Compare two strings in constant time. | def const_compare(string1, string2):
if string1 is None or string2 is None:
return False
return string1 == string2 | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def compare(self, p_str, p_str_1): # real signature unknown; restored from __doc__\n return 0",
"def _strings_are_equal(self, value1, value2):\n if value1.lower().strip().replace('_', ' ') == value2.lower().strip().replace('_', ' '):\n return 1\n return 0",
"def EXACT(string1, s... | [
"0.76496494",
"0.7493996",
"0.7366436",
"0.7336212",
"0.7275708",
"0.7234278",
"0.7219642",
"0.71888804",
"0.7127351",
"0.71208024",
"0.7094906",
"0.7069277",
"0.70536083",
"0.6823035",
"0.6810568",
"0.67826366",
"0.6769625",
"0.6757837",
"0.67489207",
"0.6746674",
"0.6727927... | 0.7155424 | 8 |
Return True if the priority queue is empty. | def is_empty(self): # concrete method assuming abstract len
return len(self) == 0 | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def is_empty(self):\n return len(self.priority_queue) == 0",
"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 self.queue == []",... | [
"0.9179846",
"0.8469489",
"0.8437107",
"0.8437107",
"0.8436066",
"0.838734",
"0.836409",
"0.8344005",
"0.83305556",
"0.83305556",
"0.83042455",
"0.83034027",
"0.82889843",
"0.82803255",
"0.8267934",
"0.8259419",
"0.82293385",
"0.8219118",
"0.82072806",
"0.8198649",
"0.8182699... | 0.0 | -1 |
Return the number of items in the priority queue. | def __len__(self):
raise NotImplementedError('must be implemented by subclass') | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def size(self):\n return len(self._queue_items)",
"def queue_count(self):\n with self.mutex:\n return len(self.queues)",
"def get_num_items(self):\r\n return self.num_items",
"def size(self): #returns the size or number of items in the stack\n if self... | [
"0.7310777",
"0.7216109",
"0.7139692",
"0.71304846",
"0.7052705",
"0.7052705",
"0.7052705",
"0.7052705",
"0.70523244",
"0.70523244",
"0.7030757",
"0.7030757",
"0.7015526",
"0.69846207",
"0.698117",
"0.69712186",
"0.6953884",
"0.69398487",
"0.6903685",
"0.6813927",
"0.678333",... | 0.0 | -1 |
Create a new empty Priority Queue. | def __init__(self):
self._data = [] | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def make_empty_queue():\n return Queue(0, None, None)",
"def priority_queue():\n from src.priorityq import PriorityQueue\n priority_queue = PriorityQueue()\n return priority_queue",
"def priority_queue_full():\n from src.priorityq import PriorityQueue\n priority_queue = PriorityQueue()\n p... | [
"0.7893713",
"0.74452215",
"0.71636957",
"0.7081834",
"0.7081834",
"0.6581613",
"0.6313973",
"0.63086706",
"0.6265996",
"0.6179255",
"0.61486804",
"0.6126521",
"0.60874456",
"0.6058897",
"0.60504574",
"0.6046229",
"0.60360074",
"0.6026002",
"0.5990476",
"0.5980345",
"0.597111... | 0.0 | -1 |
Return the number of items in the priority queue. | def __len__(self):
return len(self._data) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def size(self):\n return len(self._queue_items)",
"def queue_count(self):\n with self.mutex:\n return len(self.queues)",
"def get_num_items(self):\r\n return self.num_items",
"def size(self): #returns the size or number of items in the stack\n if self... | [
"0.73094535",
"0.7214424",
"0.71406925",
"0.7130484",
"0.7051237",
"0.7051237",
"0.7051237",
"0.7051237",
"0.7050724",
"0.7050724",
"0.70315284",
"0.70315284",
"0.70139974",
"0.6985575",
"0.6979711",
"0.69724464",
"0.6955107",
"0.6938039",
"0.6901929",
"0.681586",
"0.6785586"... | 0.0 | -1 |
The absolute path of the unchecked homeworks. This path is valid on the storer machine. | def dir_unchecked():
return abspath('unchecked') | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def localPath(self):\n return self.home",
"def path_homeassistant(self) -> Path:\n return self.path_supervisor / HOMEASSISTANT_CONFIG",
"def rliPath():\r\n if isWindows():\r\n homeDir = win32api.GetShortPathName(os.path.expanduser('~'))\r\n return os.path.join(homeDir, 'AppData',... | [
"0.66988224",
"0.6570122",
"0.6493384",
"0.6490956",
"0.648976",
"0.63885",
"0.63796705",
"0.63651496",
"0.62819487",
"0.62489486",
"0.62104005",
"0.61903757",
"0.6175779",
"0.6174846",
"0.61661184",
"0.6142955",
"0.611489",
"0.6084906",
"0.6060247",
"0.598081",
"0.59448147",... | 0.5931455 | 22 |
The absolute path of the checked homeworks. This path is valid on the storer machine. | def dir_checked():
return abspath('checked') | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def localPath(self):\n return self.home",
"def path_homeassistant(self) -> Path:\n return self.path_supervisor / HOMEASSISTANT_CONFIG",
"def user_home_path(self):\n return path.join(env.user_home, self._user_home_path)",
"def homeDirectory(self):\n\t\treturn self.__homeDirectory",
"def... | [
"0.6920389",
"0.6662194",
"0.66560477",
"0.662489",
"0.65946144",
"0.6589683",
"0.6584511",
"0.6566853",
"0.65193725",
"0.64687705",
"0.6452608",
"0.64161146",
"0.6363495",
"0.6302905",
"0.62959796",
"0.6282288",
"0.6279519",
"0.62782437",
"0.62535274",
"0.6233634",
"0.622671... | 0.5723275 | 62 |
The absolute path of the test archives. This path is valid on the storer machine. | def dir_tests():
return abspath('tests') | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def tests_path(self, version):\n base = self.version_path(version)\n return osp.normpath(osp.join(base, os.pardir, os.pardir,\n \"share\", \"aster\", \"tests\"))",
"def archive_path(self):\n return os.path.join(self.destination_directory, self.__archive_na... | [
"0.68083435",
"0.6537597",
"0.65307593",
"0.6530499",
"0.63732994",
"0.63524437",
"0.6350328",
"0.63353866",
"0.630417",
"0.62661296",
"0.6255848",
"0.6248677",
"0.6221482",
"0.60972846",
"0.60685045",
"0.6056538",
"0.60508853",
"0.6048434",
"0.6017318",
"0.5979651",
"0.59587... | 0.63899916 | 4 |
The absolute path of the task queue directory. This path is valid on the tester machine. | def dir_queue():
return abspath('queue') | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_task_dir(self):\n return os.path.join(os.path.dirname(os.path.abspath(__file__)), 'tasks')",
"def data_abspath(self):\n return os.path.join(current_app.config['SNER_VAR'], 'scheduler', 'queue-%s' % self.id) if self.id else None",
"def queue_path(self, project, location, queue):\n # Th... | [
"0.72652483",
"0.72442883",
"0.68227845",
"0.6804063",
"0.6589113",
"0.64009976",
"0.63958615",
"0.6394727",
"0.63029563",
"0.6257836",
"0.62347347",
"0.61374766",
"0.6128083",
"0.6108508",
"0.60933024",
"0.6091193",
"0.6085624",
"0.6076332",
"0.6058051",
"0.6055608",
"0.6054... | 0.7642742 | 0 |
The absolute path of the directory where submission archives are unzipped. This path is valid on the tester machine. | def dir_tester_unzip_tmp():
return abspath('tmpunzip') | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def archive_path(self):\n return os.path.join(self.destination_directory, self.__archive_name__)",
"def getZipArchiveFullPath(self):\n\n if self._mode == \"zip\":\n return self._rootExportPath + \".zip\"\n\n return \"\"",
"def __get_ReportsZipPath(self):\n path_to_zip_fil... | [
"0.71736896",
"0.68773615",
"0.66714275",
"0.6599147",
"0.6507734",
"0.63751286",
"0.6359807",
"0.6333544",
"0.6248654",
"0.618832",
"0.6177074",
"0.61734146",
"0.61342746",
"0.60808975",
"0.60400134",
"0.6037259",
"0.60357",
"0.6011947",
"0.60108423",
"0.600013",
"0.5993723"... | 0.7390163 | 0 |
The absolute path of the directory where backups of tasks are kept. This path is valid on the storer machine. | def dir_backup():
return abspath('back') | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def local_backup_path(cls):\n # use the user home directory .stalker_local_backup\n from anima import defaults\n\n return os.path.normpath(\n os.path.expanduser(\"%s/projects_backup\" % defaults.local_cache_folder)\n ).replace(\"\\\\\", \"/\")",
"def get_backup_path(cls):\n... | [
"0.8276446",
"0.76228535",
"0.71501034",
"0.6910099",
"0.68249506",
"0.67407656",
"0.6716975",
"0.67084104",
"0.66766644",
"0.663463",
"0.6588792",
"0.65707934",
"0.6548158",
"0.6530528",
"0.64923614",
"0.6485893",
"0.6476997",
"0.6456925",
"0.6443835",
"0.6443298",
"0.644173... | 0.71951413 | 2 |
The absolute path of the database file | def db_file():
return abspath('vmchecker.db') | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_db_path():\n \n return(db_run.db_abs_path)",
"def database_file(file):\r\n fpath = path.join('databases', '{0}'.format(file))\r\n db_path = path.join(mod_path, fpath)\r\n return db_path",
"def db_path(self, host: str) -> str:\n app_path = os.path.abspath(os.getcwd())\n fold... | [
"0.83485335",
"0.7953599",
"0.78380835",
"0.77816886",
"0.7719128",
"0.7672414",
"0.7634273",
"0.7333221",
"0.7247714",
"0.7247216",
"0.71186674",
"0.7116691",
"0.70566916",
"0.70564115",
"0.6876917",
"0.6801224",
"0.66611964",
"0.66507506",
"0.66365117",
"0.66365117",
"0.662... | 0.8118952 | 1 |
Returns absolute path for the bin/ directory | def dir_bin():
return abspath('bin') | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_bin_dir():\n return os.path.abspath(os.path.join(get_root_dir(), 'bin/'))",
"def binpath(self):\n return self._query_config()['binpath']",
"def bin_path(self) -> Path:\n return self._root_path / \"stefan-on-software-api-client\" / \"bin\"",
"def bin_root(self):\n return os.pat... | [
"0.8858912",
"0.7781162",
"0.7780243",
"0.7450376",
"0.7437664",
"0.7295461",
"0.72801596",
"0.7243885",
"0.7237812",
"0.7211385",
"0.71752536",
"0.71548456",
"0.71193075",
"0.7113011",
"0.7103491",
"0.7088226",
"0.70845693",
"0.7011689",
"0.6985813",
"0.6976564",
"0.6943617"... | 0.8493657 | 1 |
Returns path to last user's assignment submission | def dir_user(assignment, user):
return os.path.join(repository, assignment, user) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_assignment_path(self):\n return os.path.join(self.course.get_course_path(), str(self.id))",
"def submission_dir(self):\n submissions_dir = osp.join(self.root, \"submissions\")\n date = '-'.join([\n f'{getattr(datetime.now(), x)}'\n for x in ['year', 'month', 'da... | [
"0.6637351",
"0.6330934",
"0.6078422",
"0.5949925",
"0.59488875",
"0.5706049",
"0.56629825",
"0.56528974",
"0.55487585",
"0.55384135",
"0.5484379",
"0.5477362",
"0.5462515",
"0.54575926",
"0.5443694",
"0.5442454",
"0.5440377",
"0.5436514",
"0.542231",
"0.5413842",
"0.5405689"... | 0.5404461 | 21 |
distance takes two points as tuples, and returns the distance between them | def distance(p1, p2):
return math.sqrt((math.pow((p2[0] - p1[0]), 2) + math.pow((p2[1] - p1[1]), 2))) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def distance_between(pt1: tuple, pt2: tuple) -> float:\r\n\r\n return ((pt2[1] - pt1[1])**2 + (pt2[0] - pt1[0])**2)**0.5",
"def distance(t1,t2):\n\n if len(t1) != len(t2):\n raise ValueError(\"distance: tuples must be the same length\")\n\n r = [0,] * len(t1)\n for i in range(0,len(t1)):\n ... | [
"0.7915921",
"0.7758231",
"0.7734983",
"0.77311844",
"0.7720422",
"0.7689004",
"0.76859725",
"0.76803917",
"0.7588798",
"0.75871706",
"0.7529972",
"0.7529972",
"0.75218534",
"0.75107044",
"0.7499297",
"0.74834406",
"0.74371284",
"0.7429197",
"0.7424233",
"0.73798585",
"0.7374... | 0.740267 | 19 |
Converts a list of edges to a boolean vector which is True if the corresponding edge is contained in the edge list. | def edge_vector(self, edges: Iterable[Tuple[V, V]]) -> np.ndarray:
edge_set = frozenset(edges)
return np.array([(edge in edge_set) for edge in self.edges]) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def contains(self, edge):\n return edge in self.edges",
"def __contains__(self, edge):\n return edge in self._edges",
"def containsEdge(self, e):\n return any(e.nvt in [self.vertices[i-2], self.vertices[i]] and self.vertices[i-1] == e.pvt for i in range(len(self.vertices)))",
"def any_ed... | [
"0.64609194",
"0.63961524",
"0.6382485",
"0.62299246",
"0.62087166",
"0.61070836",
"0.5957832",
"0.59238774",
"0.5913829",
"0.57748556",
"0.57677335",
"0.5724181",
"0.57089937",
"0.56130576",
"0.5527084",
"0.55059975",
"0.54805017",
"0.54664195",
"0.54341364",
"0.54321164",
"... | 0.67306185 | 0 |
The billing account to create the exclusion for. | def billing_account(self) -> pulumi.Input[str]:
return pulumi.get(self, "billing_account") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def billing_account(self) -> pulumi.Output[str]:\n return pulumi.get(self, \"billing_account\")",
"def billing_account(self) -> pulumi.Output[str]:\n return pulumi.get(self, \"billing_account\")",
"def billing_account(self) -> pulumi.Output[str]:\n return pulumi.get(self, \"billing_account... | [
"0.7224126",
"0.7224126",
"0.7224126",
"0.7119428",
"0.7119428",
"0.6581293",
"0.64127433",
"0.6322773",
"0.6322773",
"0.62994885",
"0.62994885",
"0.6282713",
"0.61905766",
"0.61555666",
"0.6056948",
"0.5983784",
"0.59658813",
"0.59561336",
"0.59462136",
"0.59235317",
"0.5888... | 0.7244844 | 0 |
The name of the logging exclusion. | def name(self) -> Optional[pulumi.Input[str]]:
return pulumi.get(self, "name") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def logger_name(self):\n return self.__class__.__name__",
"def log_name(self) -> Optional[str]:\n return self._log_name",
"def exclusions(self) -> Sequence['outputs.LogExclusionResponse']:\n return pulumi.get(self, \"exclusions\")",
"def name(cls):\n return \"access_denied_message... | [
"0.65373445",
"0.6201244",
"0.61872715",
"0.61523986",
"0.5980034",
"0.59338164",
"0.59338164",
"0.5917488",
"0.5813847",
"0.5804771",
"0.57529867",
"0.57340735",
"0.566134",
"0.5619294",
"0.55689615",
"0.5562249",
"0.55475444",
"0.5496449",
"0.5475577",
"0.5467786",
"0.54627... | 0.0 | -1 |
The billing account to create the exclusion for. | def billing_account(self) -> Optional[pulumi.Input[str]]:
return pulumi.get(self, "billing_account") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def billing_account(self) -> pulumi.Input[str]:\n return pulumi.get(self, \"billing_account\")",
"def billing_account(self) -> pulumi.Input[str]:\n return pulumi.get(self, \"billing_account\")",
"def billing_account(self) -> pulumi.Output[str]:\n return pulumi.get(self, \"billing_account\"... | [
"0.7249342",
"0.7249342",
"0.7228089",
"0.7228089",
"0.7228089",
"0.6584192",
"0.6413102",
"0.63229406",
"0.63229406",
"0.63000166",
"0.63000166",
"0.6280482",
"0.6188287",
"0.6156983",
"0.6058568",
"0.5982106",
"0.596628",
"0.5958414",
"0.5947225",
"0.5924273",
"0.589141",
... | 0.71228987 | 5 |
The name of the logging exclusion. | def name(self) -> Optional[pulumi.Input[str]]:
return pulumi.get(self, "name") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def logger_name(self):\n return self.__class__.__name__",
"def log_name(self) -> Optional[str]:\n return self._log_name",
"def exclusions(self) -> Sequence['outputs.LogExclusionResponse']:\n return pulumi.get(self, \"exclusions\")",
"def name(cls):\n return \"access_denied_message... | [
"0.6533208",
"0.61972487",
"0.61911637",
"0.6152301",
"0.5975815",
"0.5929995",
"0.5929995",
"0.5913879",
"0.58109283",
"0.5803052",
"0.57499206",
"0.57296",
"0.56571686",
"0.5622947",
"0.5565144",
"0.55605483",
"0.5543431",
"0.55013585",
"0.5475552",
"0.5464225",
"0.54607254... | 0.0 | -1 |
Get an existing BillingAccountExclusion resource's state with the given name, id, and optional extra properties used to qualify the lookup. | def get(resource_name: str,
id: pulumi.Input[str],
opts: Optional[pulumi.ResourceOptions] = None,
billing_account: Optional[pulumi.Input[str]] = None,
description: Optional[pulumi.Input[str]] = None,
disabled: Optional[pulumi.Input[bool]] = None,
f... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __init__(__self__,\n resource_name: str,\n args: BillingAccountExclusionArgs,\n opts: Optional[pulumi.ResourceOptions] = None):\n ...",
"def get_account(self, account_id, **kwargs):\r\n\r\n if 'mask' not in kwargs:\r\n kwargs['mask'] = ... | [
"0.5755047",
"0.5322901",
"0.5040129",
"0.4937458",
"0.48856664",
"0.47680885",
"0.47045177",
"0.4689548",
"0.45776927",
"0.44811374",
"0.44753614",
"0.4470048",
"0.4426179",
"0.44260782",
"0.44087026",
"0.44066954",
"0.43906662",
"0.43871456",
"0.43617857",
"0.43447426",
"0.... | 0.79832166 | 0 |
The billing account to create the exclusion for. | def billing_account(self) -> pulumi.Output[str]:
return pulumi.get(self, "billing_account") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def billing_account(self) -> pulumi.Input[str]:\n return pulumi.get(self, \"billing_account\")",
"def billing_account(self) -> pulumi.Input[str]:\n return pulumi.get(self, \"billing_account\")",
"def billing_account(self) -> Optional[pulumi.Input[str]]:\n return pulumi.get(self, \"billing_... | [
"0.7244844",
"0.7244844",
"0.7119428",
"0.7119428",
"0.6581293",
"0.64127433",
"0.6322773",
"0.6322773",
"0.62994885",
"0.62994885",
"0.6282713",
"0.61905766",
"0.61555666",
"0.6056948",
"0.5983784",
"0.59658813",
"0.59561336",
"0.59462136",
"0.59235317",
"0.5888037",
"0.5887... | 0.7224126 | 3 |
The name of the logging exclusion. | def name(self) -> pulumi.Output[str]:
return pulumi.get(self, "name") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def logger_name(self):\n return self.__class__.__name__",
"def log_name(self) -> Optional[str]:\n return self._log_name",
"def exclusions(self) -> Sequence['outputs.LogExclusionResponse']:\n return pulumi.get(self, \"exclusions\")",
"def name(cls):\n return \"access_denied_message... | [
"0.65373445",
"0.6201244",
"0.61872715",
"0.61523986",
"0.5980034",
"0.59338164",
"0.59338164",
"0.5917488",
"0.5813847",
"0.5804771",
"0.57529867",
"0.57340735",
"0.566134",
"0.5619294",
"0.55689615",
"0.5562249",
"0.55475444",
"0.5496449",
"0.5475577",
"0.5467786",
"0.54627... | 0.0 | -1 |
Name to use for storing application data. | def appdata_token(self) -> str:
return self._appdata_token | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def app_name(self, value):\n self._app_name = value",
"def name(self):\n return self.config[\"name\"]",
"def set_name(self, application_name):\r\n self._name = application_name",
"def app_name(self) -> str:\n return self._app_name",
"def app_name(self):\n return self._app_nam... | [
"0.65095806",
"0.6496195",
"0.64166266",
"0.638236",
"0.6369184",
"0.63573027",
"0.6344077",
"0.6344077",
"0.634241",
"0.6271505",
"0.62646794",
"0.6263877",
"0.6257906",
"0.62515676",
"0.62515676",
"0.62515676",
"0.62515676",
"0.6244877",
"0.6203015",
"0.61885977",
"0.615373... | 0.0 | -1 |
Calculate the great circle distance between two points on the earth (specified in decimal degrees) | def haversine(lon1, lat1, lon2, lat2):
# convert decimal degrees to radians
lon1, lat1, lon2, lat2 = map(radians, [lon1, lat1, lon2, lat2])
# haversine formula
dlon = lon2 - lon1
dlat = lat2 - lat1
a = sin(dlat/2)**2 + cos(lat1) * cos(lat2) * sin(dlon/2)**2
c = 2 * asin(sqrt(a))
r = 3... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def great_circle(lat_1, long_1, lat_2, long_2):\n long_1 = m.radians(long_1)\n lat_1 = m.radians(lat_1)\n long_2 = m.radians(long_2)\n lat_2 = m.radians(lat_2)\n\n d = 2 * 6367.45 * m.asin(\n m.sqrt(haversine(lat_2 - lat_1)\n + m.cos(lat_1)*m.cos(lat_2) *\n haversine(long... | [
"0.81450045",
"0.7863265",
"0.76322985",
"0.76064754",
"0.75978696",
"0.75965863",
"0.75944835",
"0.75720793",
"0.75630087",
"0.7555095",
"0.7528691",
"0.7517629",
"0.7492963",
"0.7467739",
"0.7452678",
"0.7434477",
"0.73914117",
"0.7357736",
"0.73484355",
"0.73318124",
"0.73... | 0.0 | -1 |
This function takes a json file as an input and parses it. It collects info about the pet and creates and saves the pet in their corresponding database table. | def addAnimalsToDb(petsInfo):
for pet in petsInfo['petfinder']['pets']['pet']:
#Parsing the json file to get individual information
animal = pet['animal']['$t']
name = pet['name']['$t']
pet_id = pet['id']['$t']
desc = pet['description']['$t... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __init__(self, pets=[]):\r\n with open(\"main_pets.json\", 'w') as outfile:\r\n json.dump(pets, outfile)\r\n\r\n with open(\"main_pets.json\", 'r') as infile:\r\n self.pet_file = json.load(infile)\r\n self.pet_file_name = \"main_pets.json\" # set name of json to ... | [
"0.6849575",
"0.6280231",
"0.6230346",
"0.61603683",
"0.606348",
"0.5808072",
"0.5787718",
"0.5780093",
"0.57480884",
"0.5716032",
"0.571324",
"0.56681573",
"0.56673944",
"0.5662366",
"0.56550163",
"0.5635198",
"0.55841386",
"0.558341",
"0.5567185",
"0.556637",
"0.5556236",
... | 0.727826 | 0 |
Get padding arg for 'same' type padding | def get_padding(kernel_size, dilation=1):
if isinstance(kernel_size, int) and isinstance(dilation, int):
return get_single_padding(kernel_size, dilation)
else:
if isinstance(kernel_size, int):
assert isinstance(dilation, (list, tuple))
kernel_size = (kernel_size,) * len(d... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_padding(x, padding_value=0, dtype=tf.float32):\n # print(\"get_padding\", dtype)\n with tf.name_scope(\"padding\"):\n return tf.cast(tf.equal(x, padding_value), dtype=dtype)",
"def padding(self):\n\t\treturn self.paddings_shape_param('W')",
"def padding_width(self):\n ...",
"def p... | [
"0.67689097",
"0.65448356",
"0.64720064",
"0.641168",
"0.63869214",
"0.63238126",
"0.63081867",
"0.6299274",
"0.6272706",
"0.6272706",
"0.6253616",
"0.61998004",
"0.6186017",
"0.61827564",
"0.6176897",
"0.6165069",
"0.61080676",
"0.6077968",
"0.60378814",
"0.60189337",
"0.601... | 0.62336934 | 11 |
Verify that balloon stats update correctly. | def test_stats_update(test_microvm_with_api):
test_microvm = test_microvm_with_api
test_microvm.spawn()
test_microvm.basic_config()
test_microvm.add_net_iface()
# Add a memory balloon with stats enabled.
test_microvm.api.balloon.put(
amount_mib=0,
deflate_on_oom=True,
st... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_out_of_date(self):\n self.assertTrue(update_available(0.0))",
"def updates_check():\n data = wait_for_callback(client, cb_updates_name)\n self.assertTrue(isinstance(data, dict))",
"def test_update_ban(self):\n pass",
"def test_bayes_updates_good_data(self):\r\n ... | [
"0.6160228",
"0.61007583",
"0.60407215",
"0.59873116",
"0.59398526",
"0.5925484",
"0.58750194",
"0.57825035",
"0.57751906",
"0.5755458",
"0.57160926",
"0.5709652",
"0.5676239",
"0.5647563",
"0.5645893",
"0.56430566",
"0.5626532",
"0.56240726",
"0.5605441",
"0.5569337",
"0.555... | 0.6209393 | 0 |
Boolean indicating whether the system controlled by the thermostat is capable of heating. For simulation purposes this is always true. | def can_heat(self) -> bool:
self._logger.debug(log_message_formatter(
"get", f"{self}", "can_heat"))
return True | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def is_heating(self) -> bool:\r\n self._logger.debug(log_message_formatter(\r\n \"get\", f\"{self}\", \"is_heating\"))\r\n return (self._ambient_temperature < self._target_temperature) \\\r\n and self.can_heat \\\r\n and (self._hvac_mode == \"heat\" or self._hvac_mode... | [
"0.7765403",
"0.7042639",
"0.70410836",
"0.692985",
"0.6884055",
"0.6779205",
"0.67493725",
"0.6671283",
"0.6635776",
"0.6604271",
"0.653154",
"0.6385226",
"0.6360093",
"0.6353062",
"0.63318706",
"0.6316022",
"0.6291913",
"0.62673074",
"0.6260079",
"0.62568456",
"0.6251746",
... | 0.7269104 | 1 |
Boolean indicating whether the system controlled by the thermostat is capable of cooling. For simulation purposes this is always true. | def can_cool(self) -> bool:
self._logger.debug(log_message_formatter(
"get", f"{self}", "can_cool"))
return True | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def is_cooling(self) -> bool:\r\n self._logger.debug(log_message_formatter(\r\n \"get\", f\"{self}\", \"is_cooling\"))\r\n return (self._ambient_temperature > self._target_temperature) \\\r\n and self.can_cool \\\r\n and (self._hvac_mode == \"cool\" or self._hvac_mode... | [
"0.7955684",
"0.7071816",
"0.70455354",
"0.6896844",
"0.6801211",
"0.6715336",
"0.66723305",
"0.6599151",
"0.6580837",
"0.6577723",
"0.65202886",
"0.64494234",
"0.64172846",
"0.63832116",
"0.63610584",
"0.6274685",
"0.6249829",
"0.6238794",
"0.62279296",
"0.62052214",
"0.6191... | 0.64091283 | 13 |
Getter for fan timer duration. | def fan_timer_duration(self) -> int:
self._logger.debug(log_message_formatter(
"get", f"{self}", "fan_timer_duration"))
return self._fan_timer_duration.seconds / 60 | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_duration(self):\n return self.duration",
"def get_duration(self):\n return self._duration",
"def duration(self):\n return self._get('duration')",
"def duration(self) -> datetime.timedelta:\n return self._duration",
"def duration(self):\n return self._get(\"duratio... | [
"0.74502724",
"0.7370194",
"0.7237263",
"0.72089785",
"0.72029513",
"0.7187921",
"0.7149618",
"0.7149618",
"0.7149618",
"0.7149618",
"0.7149618",
"0.7149618",
"0.7149618",
"0.7149618",
"0.7135839",
"0.7091431",
"0.704485",
"0.6976184",
"0.696261",
"0.6958498",
"0.6940953",
... | 0.8616632 | 0 |
Boolean indicating whether the system controlled by the thermostat has a fan. For simulation purposes this is always true. | def has_fan(self) -> bool:
self._logger.debug(log_message_formatter(
"get", f"{self}", "has_fan"))
return self._has_fan | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def is_on(self) -> bool:\n return self._device.fan_on",
"def fan_mode(self):\n return self._fan_mode",
"def fan_mode(self):\n return self._fan_mode",
"def fan_mode(self):\n if self._client.fan == self._client.FAN_ON:\n return FAN_ON\n return FAN_AUTO",
"def fan... | [
"0.7873943",
"0.7229795",
"0.7229795",
"0.7119907",
"0.7105398",
"0.70751476",
"0.7000183",
"0.6923606",
"0.691392",
"0.6866653",
"0.6821224",
"0.6816013",
"0.6816013",
"0.6703088",
"0.66636264",
"0.66214126",
"0.6583036",
"0.6519912",
"0.6462145",
"0.64337933",
"0.6425149",
... | 0.76953566 | 1 |
Boolean indicating whether the device is set to energysaving temperature. | def has_leaf(self) -> bool:
self._logger.debug(log_message_formatter(
"get", f"{self}", "has_leaf"))
return self._hvac_mode == "eco" | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def is_aux_heat_on(self):\n return self._device.mode == self._device.MODE_HEAT_EMERGENCY",
"def is_heating(self) -> bool:\r\n self._logger.debug(log_message_formatter(\r\n \"get\", f\"{self}\", \"is_heating\"))\r\n return (self._ambient_temperature < self._target_temperature) \\\r... | [
"0.6833779",
"0.66497856",
"0.65476835",
"0.65136737",
"0.65136737",
"0.64471745",
"0.64208215",
"0.6419306",
"0.6416124",
"0.6409716",
"0.6309562",
"0.6296766",
"0.6264087",
"0.62559056",
"0.61916363",
"0.61894625",
"0.616364",
"0.6147188",
"0.6147188",
"0.6147188",
"0.61390... | 0.0 | -1 |
Getter for the current HVAC mode. | def hvac_mode(self) -> str:
self._logger.debug(log_message_formatter(
"get", f"{self}", "hvac_mode"))
return self._hvac_mode | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def hvac_mode(self):\n if self.ac.status is None:\n _LOGGER.debug(f\"hvac_mode: status is None, returning None\")\n return None\n if self.ac.status.is_on:\n ac_mode = self.ac.status.ac_mode\n value = self.HVAC_MODE_MAPPING[ac_mode]\n _LOGGER.debu... | [
"0.814168",
"0.7908314",
"0.787006",
"0.78465",
"0.7787053",
"0.774381",
"0.773493",
"0.77252966",
"0.7630908",
"0.7625113",
"0.75310606",
"0.7526288",
"0.74734706",
"0.73986197",
"0.7392751",
"0.7368481",
"0.73421395",
"0.7258092",
"0.719067",
"0.719067",
"0.7158838",
"0.7... | 0.8095314 | 1 |
Getter method for usersettable device label. | def label(self) -> str:
self._logger.debug(log_message_formatter(
"get", f"{self}", "label"))
return self._name | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _get_label ( self ):\n if self._label is not None:\n return self._label\n return user_name_for( self.name )",
"def get_label(cls, obj, query):\n\n if hasattr(obj, 'config'):\n for item in obj.config.hardware.device:\n if query == item.key:\n ... | [
"0.7339035",
"0.7323636",
"0.7203392",
"0.71052605",
"0.71052605",
"0.71052605",
"0.71052605",
"0.70299846",
"0.69537103",
"0.69447845",
"0.6929857",
"0.6910628",
"0.68978006",
"0.68933654",
"0.6882453",
"0.6882453",
"0.6877425",
"0.6871672",
"0.684545",
"0.684545",
"0.680522... | 0.6364706 | 89 |
Getter for locked max temperature, in Celsius. | def locked_temp_max_c(self) -> float:
self._logger.debug(log_message_formatter(
"get", f"{self}", "locked_temp_max_c"))
return kelvin_to_celsius(self._locked_temp_max) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def locked_temp_max(self) -> int:\r\n # TODO: Force this to return an int.\r\n if self.temperature_scale == \"C\":\r\n return self.locked_temp_max_c\r\n elif self.temperature_scale == \"F\":\r\n return self.locked_temp_max_f\r\n else:\r\n return self._lo... | [
"0.8609536",
"0.838268",
"0.81076866",
"0.7986864",
"0.796274",
"0.79604316",
"0.79190487",
"0.7874076",
"0.7780435",
"0.76836115",
"0.7418269",
"0.7376021",
"0.7260256",
"0.7237769",
"0.7196424",
"0.71299005",
"0.7003533",
"0.700215",
"0.6965545",
"0.69594616",
"0.6920984",
... | 0.8433013 | 1 |
Getter for locked temp min. | def locked_temp_min(self) -> int:
# TODO: Force this to return an int.
if self.temperature_scale == "C":
return self.locked_temp_min_c
elif self.temperature_scale == "F":
return self.locked_temp_min_f
else:
return self._locked_temp_min
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def min_temp(self):\n return self._min_temp",
"def min_temp(self):\n return GH_MIN_TEMP",
"def min_temp(self):\n if self._min_temp:\n return self._min_temp\n\n # get default temp from super class\n return super().min_temp",
"def locked_temp_min_f(self) -> float:\... | [
"0.8013028",
"0.78157496",
"0.7807576",
"0.7727228",
"0.76362914",
"0.7530829",
"0.74552155",
"0.74479985",
"0.7350036",
"0.71267873",
"0.70640147",
"0.70640147",
"0.7048904",
"0.7044186",
"0.7009268",
"0.7009268",
"0.6961405",
"0.6925865",
"0.69128406",
"0.683721",
"0.681802... | 0.8619261 | 0 |
Getter for previous HVAC mode. | def previous_hvac_mode(self) -> str:
self._logger.debug(log_message_formatter(
"get", f"{self}", "previous_hvac_mode"))
return self._previous_hvac_mode | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def hvac_action(self):\n if self._hvac_mode == HVAC_MODE_OFF:\n return CURRENT_HVAC_OFF\n elif self._hvac_mode == HVAC_MODE_HEAT:\n return CURRENT_HVAC_HEAT\n elif self._hvac_mode == HVAC_MODE_COOL:\n return CURRENT_HVAC_COOL\n elif self._hvac_mode == HV... | [
"0.64595586",
"0.6255589",
"0.6248009",
"0.6226671",
"0.62167543",
"0.61902475",
"0.6172519",
"0.6157725",
"0.61087984",
"0.6072431",
"0.60711336",
"0.60510683",
"0.6039828",
"0.5978897",
"0.59699434",
"0.5957788",
"0.5950678",
"0.593104",
"0.59293693",
"0.59273183",
"0.59150... | 0.8527564 | 0 |
Setter for previous hvac mode. | def set_previous_hvac_mode(self, value: str):
if value in self._hvac_modes:
self._logger.info(log_message_formatter(
"set", f"{self}", "locked_temp_max_f", value))
self._previous_hvac_mode = value
else:
self._logger.warning(
"a... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_hvac_mode(self, hvac_mode: str) -> None:\n if hvac_mode == HVACMode.AUTO: # FollowSchedule\n self.svc_reset_zone_mode()\n elif hvac_mode == HVACMode.HEAT: # TemporaryOverride\n self.svc_set_zone_mode(mode=ZoneMode.PERMANENT, setpoint=25) # TODO:\n else: # HVAC... | [
"0.7210505",
"0.6970962",
"0.6891688",
"0.68127984",
"0.6733038",
"0.6730062",
"0.6724209",
"0.6707468",
"0.6691243",
"0.66692257",
"0.66662174",
"0.66270375",
"0.65692955",
"0.6531191",
"0.65210605",
"0.6515667",
"0.65048915",
"0.64969385",
"0.647615",
"0.64647686",
"0.63877... | 0.72051454 | 1 |
Setter for high temperature value. Assumes set units are the same as the current system units. | def set_target_temperature_high(self, value: int = 0):
if self._temperature_scale == "F":
self._target_temperature_high = celsius_to_kelvin(
fahrenheit_to_celsius(value)
)
elif self._temperature_scale == "C":
self._target_temperature_high = celsi... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_eco_temperature_high(self, value: int = 0):\r\n if self._temperature_scale == \"F\":\r\n self._eco_temperature_high = celsius_to_kelvin(\r\n fahrenheit_to_celsius(value)\r\n )\r\n elif self._temperature_scale == \"C\":\r\n self._eco_temperature_... | [
"0.80431557",
"0.7527424",
"0.73513764",
"0.73258656",
"0.7266517",
"0.7261214",
"0.7244778",
"0.72125614",
"0.71789587",
"0.71271175",
"0.71157455",
"0.7046698",
"0.7037592",
"0.70349413",
"0.6909908",
"0.69091845",
"0.6900373",
"0.68957293",
"0.68608415",
"0.6803499",
"0.67... | 0.8068546 | 0 |
Setter for low target temperature value. Assumes set units are the same as the current system units. | def set_target_temperature_low(self, value: int = 0):
if self._temperature_scale == "F":
self._target_temperature_low = celsius_to_kelvin(
fahrenheit_to_celsius(value)
)
elif self._temperature_scale == "C":
self._target_temperature_low = celsius_... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def target_temperature_low(self) -> float | None:\n return self._target_temperature_low",
"def target_temperature_low(self):\n return self._target_temperature_low",
"def set_eco_temperature_low(self, value: int = 0):\r\n if self._temperature_scale == \"F\":\r\n self._eco_tempera... | [
"0.7952553",
"0.7922734",
"0.78117687",
"0.78107804",
"0.7735026",
"0.7696726",
"0.76829076",
"0.7669028",
"0.7405848",
"0.7368785",
"0.72714424",
"0.7261236",
"0.7148526",
"0.7124998",
"0.70868874",
"0.6946748",
"0.69294804",
"0.6900801",
"0.6876887",
"0.6857196",
"0.6808950... | 0.8797775 | 0 |
Getter for the timetotemperature training mode. | def time_to_target_training(self) -> str:
# TODO: Figure out how to implement this.
self._logger.debug(log_message_formatter(
"get", f"{self}", "time_to_target_training"))
return self._training_modes[0] | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_time_step(self):\n return self._time_step",
"def train_op_ft(self):\r\n return self._train_op_ft",
"def target_temperature_step(self):\n return self._target_temperature_step",
"def avg_training_time(self):\n return self._avg_training_time",
"def target_temperature_step(self)... | [
"0.6346389",
"0.62929255",
"0.6197536",
"0.6175581",
"0.61631703",
"0.61529076",
"0.6152647",
"0.61284536",
"0.6119044",
"0.6119044",
"0.6119044",
"0.610887",
"0.6058542",
"0.6051269",
"0.6039329",
"0.6033116",
"0.60155916",
"0.59933376",
"0.59933376",
"0.5979747",
"0.5973493... | 0.7179265 | 0 |
Redis lua func to get timestamp from redis server, use this func to prevent time inconsistent across servers. | def _time(self):
return self.r.eval(self.LUA_TIME, 1, 1) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_timestamp():\n return int(time.time())",
"def timestamp():\n return time.time()",
"def _get_timestamp():\n return str(int(time.time()))",
"def timestamp():\n return int(time.time())",
"def timestamp():\n return round(datetime.datetime.utcnow().timestamp())",
"def get_timestamp(... | [
"0.6834203",
"0.67761517",
"0.6668308",
"0.6666679",
"0.6584357",
"0.64719635",
"0.64695",
"0.64652014",
"0.64567995",
"0.6436153",
"0.6407598",
"0.6374339",
"0.6357725",
"0.63406926",
"0.6329561",
"0.62301373",
"0.6215181",
"0.6208718",
"0.6205009",
"0.6203495",
"0.61961627"... | 0.0 | -1 |
Given an iterable of digits, return the portion of x and y that contain those digits. | def getDigitsFromDataset(digits, x, y):
mask = np.zeros_like(y, dtype=bool)
for digit in digits:
mask += (y == digit)
x = x[mask]
y = y[mask]
return x, y | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _range_overapped(self, x, y):\n xs = set( range(x[0], x[1]))\n ys = set( range(y[0], y[1]))\n return xs.intersection(ys)",
"def seg_x_in_y(self, x: str, y: str) -> bool:\n return len(set(x + y)) == len(y)",
"def argcrossfind(X, Y):\n\n nx, ny = len(X), len(Y)\n ix, iy = 0,... | [
"0.5705708",
"0.56688017",
"0.5640348",
"0.5625155",
"0.5597041",
"0.5497722",
"0.5489992",
"0.5463491",
"0.5451395",
"0.53960806",
"0.539283",
"0.5373492",
"0.5359683",
"0.5359357",
"0.5329965",
"0.53261477",
"0.5305657",
"0.5302476",
"0.53019404",
"0.52886564",
"0.52630496"... | 0.7365741 | 0 |
Sets a ceiling on the number of neurons of a given type that can be placed on a single core. This information is stored in dictionary in the dao and is referenced during the partition stage of the mapper. Note that each neuron type has a default value for this parameter that will be used if no override is given. | def set_number_of_neurons_per_core(neuronType, maxPermitted):
if not inspect.isclass(neuronType):
neuronType = globals()[neuronType]
if neuronType is None:
raise Exception("Unknown Vertex Type {}".format(neuronType))
if hasattr(neuronType, "custom_max_atoms_per_core"):
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def num_nodes(self, ntype: str = None) -> int:\n if ntype:\n return self.num_nodes_dict[ntype]\n else:\n return self.total_number_of_nodes",
"def number_of_nodes(self, ntype: str = None) -> int:\n return self.num_nodes(ntype)",
"def set_numcells(self, N = []):\n ... | [
"0.59034413",
"0.58283395",
"0.5465672",
"0.5432328",
"0.5232073",
"0.5229335",
"0.521293",
"0.51982903",
"0.5130504",
"0.50784206",
"0.50641626",
"0.5039602",
"0.50306505",
"0.5022691",
"0.498251",
"0.49522948",
"0.4947117",
"0.4944262",
"0.49342987",
"0.49248686",
"0.490970... | 0.70409745 | 0 |
Get parameters of the dynamic synapses for all connections in this Projection. | def getSynapseDynamics(self, parameter_name, format='list', gather=True):
raise NotImplementedError | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def parameters(self):\n return self.pars",
"def parameters(self):\n return [i.parameter for i in self.joints.values()]",
"def get_params(self):\n return {\n \"nspecies\": self.nspecies,\n \"lmax\": self.lmax,\n \"nmax\": self.nmax,\n \"rcut\": se... | [
"0.59664494",
"0.5961479",
"0.58707875",
"0.57593197",
"0.5719124",
"0.5716366",
"0.5694844",
"0.56888735",
"0.5619881",
"0.5619112",
"0.5550207",
"0.55424255",
"0.5515973",
"0.55143887",
"0.5507055",
"0.54469246",
"0.5441625",
"0.54304343",
"0.5418958",
"0.54148144",
"0.5414... | 0.0 | -1 |
Set weights to random values taken from rand_distr. | def randomizeWeights(self, rand_distr):
raise NotImplementedError | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def randomize(self):\n self.weights = np.random.rand(*self.weights.shape) - 0.5",
"def _random_weight_initialization(self, mean=0, stddev=1):\n self.slp_weights = np.random.normal(mean, stddev, size=(self.n_rbfs, self.n_targets))",
"def init_weights(self):\n \n self.w = np.random.ra... | [
"0.79889596",
"0.7319766",
"0.7257235",
"0.7144398",
"0.7136157",
"0.703121",
"0.6993822",
"0.69731367",
"0.69498444",
"0.6937413",
"0.6928632",
"0.6906302",
"0.68867594",
"0.67853034",
"0.67574394",
"0.6713749",
"0.6660219",
"0.66586196",
"0.6648114",
"0.66296285",
"0.660558... | 0.8538428 | 0 |
Return the total number of connections. only local connections, if gather is False, all connections, if gather is True (default) | def size(self, gather=True):
raise NotImplementedError | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def getconnectioncount(self):\n return self.proxy.getconnectioncount()",
"def totalConnections(analyzer):\n return model.totalConnections(analyzer)",
"def load(self):\n total = sum(self.connections.values())\n return total",
"def _created_connections(self):\n return len(self._a... | [
"0.73948556",
"0.73215467",
"0.70049953",
"0.68512636",
"0.6692326",
"0.6690283",
"0.6675384",
"0.6611485",
"0.6590529",
"0.653348",
"0.6463506",
"0.6441028",
"0.6425167",
"0.6407873",
"0.63523036",
"0.6262859",
"0.6260174",
"0.6258522",
"0.62402767",
"0.6218621",
"0.617374",... | 0.0 | -1 |
Returns the mean number of spikes per neuron. | def meanSpikeCount(self, gather=True):
raise NotImplementedError | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_mean(self):\n return self.serie.mean()",
"def mean(self):\r\n\t\treturn sum(self.sample)/len(self.sample)",
"def em_mean(self) -> float:\n if self.__total_pulls == 0:\n raise Exception('Number of pulls is 0. No empirical mean.')\n return self.__total_rewards / self.__total_pulls",
"... | [
"0.66117",
"0.6604204",
"0.6572368",
"0.65653586",
"0.6540787",
"0.6539733",
"0.6516644",
"0.64821166",
"0.64348525",
"0.637338",
"0.6364558",
"0.6364558",
"0.6355922",
"0.63250583",
"0.6302423",
"0.6295382",
"0.62873733",
"0.62818104",
"0.62657887",
"0.6240685",
"0.62234163"... | 0.6923684 | 0 |
Convert to [0, 255], then subtracting means, convert to BGR. | def scaling_tf(X, input_range_type):
if input_range_type == 1:
# The input data range is [0, 1].
# Convert to [0, 255] by multiplying 255
X = X*255
elif input_range_type == 2:
# The input data range is [-0.5, 0.5]. Convert to [0,255] by adding 0.5 element-wise.
X = (X+0... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def reverse_black_and_white(img):\n img = 255 - img\n\n return img",
"def _normalize_image(self, img: np.ndarray) -> np.ndarray:\n i2 = img.astype(float) - self.bg\n i2 /= i2.max()\n return i2",
"def negative(img): \n for pixel in img:\n x, y, col = pixel \n r, g, b... | [
"0.6585403",
"0.64665306",
"0.6423008",
"0.6386938",
"0.6362258",
"0.6339417",
"0.63090575",
"0.6257862",
"0.62251794",
"0.62142634",
"0.61538",
"0.60639465",
"0.6052781",
"0.6050312",
"0.6022905",
"0.601044",
"0.600279",
"0.5991956",
"0.5988704",
"0.59882575",
"0.59872586",
... | 0.0 | -1 |
Returns the absolute path of a file in my directory | def pathInDir(self, fileName):
path = os.path.abspath(os.path.join(self.myDir, fileName))
self.checkPath(path)
return path | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_abs_path(filename):\n dirname = os.path.dirname(os.path.abspath(__file__))\n return os.path.join(dirname, filename)",
"def abs_path(file_name: str, directory: str) -> str:\r\n return os.path.join(directory, file_name)",
"def _abs_path(fn):\n return os.path.join(os.path.dirname(__file__), fn)"... | [
"0.8068349",
"0.78838205",
"0.78415823",
"0.77674586",
"0.7746771",
"0.76659197",
"0.76642513",
"0.7625433",
"0.7538685",
"0.7534018",
"0.75298464",
"0.75240636",
"0.7500152",
"0.7470992",
"0.7447185",
"0.7421873",
"0.74158984",
"0.7403873",
"0.7388205",
"0.73875314",
"0.7347... | 0.71759206 | 35 |
Return a random letter | def random_letter(letters):
return random.choice(letters) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_random_char(letters: str) -> str:\n return letters[random.randint(0, len(letters) - 1)]",
"def get_random_alphabetic_string():\n return get_random_string(char_choice=string.ascii_letters)",
"def __getRandChar(self):\n return self.letterbag[random.randint(0,25)]",
"def random_char(alph):\n ... | [
"0.8447302",
"0.8407622",
"0.8271333",
"0.82520944",
"0.82395846",
"0.8036778",
"0.79629654",
"0.7950662",
"0.79457724",
"0.7892218",
"0.7874733",
"0.78254205",
"0.7721272",
"0.76063466",
"0.7600034",
"0.75525564",
"0.7517482",
"0.74856037",
"0.7474241",
"0.7430441",
"0.73456... | 0.8633792 | 0 |
Make random image name. | def random_name_maker():
new_out = ''
for i in range(10):
random_letter_or_number = random.randint(1, 2)
if random_letter_or_number is 1:
new_out += random_letter(letters)
if random_letter_or_number is 2:
new_out += str(random.randint(0, 9))
if new_out not in ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create_random_file_name():\n\n def random_file_name_factory():\n length = random.randint(10, 15)\n chars = string.ascii_letters + string.digits + \"-_\"\n return f\"{''.join(random.choice(chars) for _ in range(length))}.jpg\"\n\n return random_file_name_factory",
"def generate_imag... | [
"0.8019541",
"0.77211183",
"0.75423545",
"0.74852884",
"0.73764557",
"0.71925426",
"0.7163062",
"0.7141114",
"0.70809734",
"0.7049782",
"0.7025988",
"0.70132583",
"0.69309336",
"0.69157976",
"0.6895713",
"0.689558",
"0.6862306",
"0.6836197",
"0.68258405",
"0.6817451",
"0.6813... | 0.6564727 | 35 |
Blur to gray image | def smooth_gray_image(raw_img):
return cv2.blur(raw_img, (5, 5)) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def grayBlur(image):\n\n gray = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY)\n return cv2.GaussianBlur(gray,(7,7),0)",
"def Blur(image):\n\n return cv2.GaussianBlur(image,(7,7),0)",
"def blur(image, kernel_size=(7, 7)):\n image = cv2.blur(image, kernel_size)\n return image",
"def blur(image, kernel... | [
"0.81618327",
"0.77798975",
"0.76883066",
"0.76883066",
"0.76545846",
"0.76199484",
"0.7503624",
"0.74835473",
"0.74039507",
"0.7392931",
"0.7369776",
"0.7288036",
"0.724869",
"0.72249043",
"0.71705604",
"0.7141001",
"0.7136869",
"0.70943594",
"0.7012889",
"0.70057046",
"0.69... | 0.79251695 | 1 |
Plot the RGB histogram of an image. | def plot_histogram(img):
rgb_hist = rgb_histogram(img)
plt.figure()
for color, hist in rgb_hist.items():
plt.plot(hist, color=color)
plt.xlim([0, 256]) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def plot_img_hist(img, num_plot, title):\n # Imagen\n plt.subplot(num_plot)\n plt.imshow(img, cmap='gray')\n plt.title(title)\n # Histograma\n plt.subplot(num_plot + 4)\n plt.hist(img_as_float(img).ravel(), bins=256)\n plt.xlim(0, 1)",
"def show_histogram(im):\n\n if im.ndim == 2:\... | [
"0.74204946",
"0.71305",
"0.70681804",
"0.70681804",
"0.70681804",
"0.70507854",
"0.6971325",
"0.6876233",
"0.68432623",
"0.67817456",
"0.6778346",
"0.65889895",
"0.65261537",
"0.6512229",
"0.6512229",
"0.6466249",
"0.638479",
"0.63804466",
"0.635739",
"0.63462305",
"0.634240... | 0.8582159 | 0 |
Calculates the porcentile variation of doge in 24hs | def porcentaje_doge_24():
viejo = 1
nuevo = 1
viejo = persistence.traer_masviejo_precio_doge()
nuevo = persistence.traer_ultimo_precio_doge()
viejo = float(viejo)
nuevo = float(nuevo)
porcentaje = 100 * (nuevo - viejo) / viejo
porcentaje = round(porcentaje, 2)
return porcentaje | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def How_long_the_projectile_was_in_the_air(i_vy , g , i_h):\n return float((i_vy + math.sqrt((math.pow(-i_vy,2) -4*(.5*g)*(-i_h))))/g)",
"def detectar_pico_doge():\n\n ultimos_precios = persistence.traer_ultimos_precios_doge()\n prev = float(ultimos_precios[0])\n now = float(ultimos_precios[1])\n ... | [
"0.6093303",
"0.591835",
"0.58395076",
"0.58203995",
"0.5816518",
"0.5800969",
"0.5757864",
"0.57465905",
"0.57260793",
"0.564868",
"0.5648256",
"0.56480724",
"0.56353694",
"0.55467236",
"0.55357987",
"0.55087644",
"0.5508609",
"0.55024034",
"0.5499268",
"0.54805577",
"0.5463... | 0.62463707 | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.