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 |
|---|---|---|---|---|---|---|
Extracts the DN from the server. If SSL is disabled, returns a dummy DN | def get_dn(self):
if self.security == True:
# extract DN from server certificate.
# Unfortunately, there seems to be no way to do this using urllib3,
# thus ssl library is being used
s = socket()
c = ssl.wrap_socket(s,cert_reqs=ssl.CERT_RE... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _get_dn(self, subject):\n rdn = list()\n for n in subject.rdns:\n rdn.append(n.rfc4514_string())\n dn = '/'.join(rdn)\n \n return '/' + dn\n # return subject.rfc4514_string()",
"def getTLD(self):\n if len(self._hostname) > 0:\n return sel... | [
"0.6313624",
"0.5835136",
"0.5834778",
"0.5834593",
"0.5831251",
"0.58224565",
"0.5791993",
"0.5743675",
"0.56885487",
"0.56864434",
"0.56832474",
"0.5674353",
"0.55785847",
"0.55507654",
"0.55087805",
"0.5498826",
"0.5484594",
"0.54302615",
"0.5420597",
"0.5387057",
"0.53819... | 0.8202225 | 0 |
Remove artifacts that have been created during testing. | def teardown_module():
if os.path.exists("before"):
os.remove("before") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def RemoveTemporaryArtifacts(context):\r\n\r\n # Nothing to remove by default\r\n pass",
"def _cleanup_environment(artifact_path: str):\n # Clean the local directory:\n for test_output in [\n *os.listdir(artifact_path),\n \"schedules\",\n \"runs\",\n \"artifacts\",... | [
"0.73520136",
"0.69376713",
"0.6897497",
"0.67760116",
"0.6747531",
"0.66942006",
"0.66397274",
"0.6624587",
"0.6616543",
"0.6605434",
"0.65867335",
"0.65793663",
"0.65706533",
"0.6541113",
"0.6480441",
"0.6453183",
"0.64484805",
"0.64394516",
"0.6414405",
"0.64069694",
"0.64... | 0.0 | -1 |
adds date/timestamp to the entry | def annotate(self, msg):
lt = localtime()
ymd = strftime("%Y-%m-%d", lt)
hms = strftime("%H:%M:%S", lt)
line = '''"%s %s"\t%s''' % ( ymd, hms, msg)
self.write(line) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def add_date(subject_entry, date):\n if date is None:\n raise ValueError(\"date cannot be None\")\n if not is_subject(subject_entry):\n raise ValueError(\"must be called with subject entry\")\n date_entry = subject_entry.create[date]\n copy_attributes(subject_entry, date_entry)\n date_... | [
"0.7091355",
"0.67933273",
"0.6541039",
"0.6503779",
"0.6383695",
"0.63503265",
"0.6208595",
"0.61998993",
"0.61941177",
"0.61805934",
"0.61590314",
"0.6075032",
"0.60686374",
"0.60505533",
"0.5995557",
"0.59859025",
"0.59535986",
"0.5941766",
"0.5939498",
"0.5938086",
"0.593... | 0.0 | -1 |
Return the weighted average and standard deviation. values, weights Numpy ndarrays with the same shape. | def weighted_avg_and_std(values, weights):
average = np.average(values, weights=weights)
variance = np.average((values-average)**2, weights=weights) # Fast and numerically precise
return average, np.sqrt(variance) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def weighted_avg_and_std(values, weights):\n average = np.ma.average(values, weights=weights)\n variance = np.ma.average((values-average)**2, weights=weights) # Fast and numerically precise\n return [average, np.sqrt(variance)]",
"def weighted_avg_and_std(values, weights):\n average = np.average(val... | [
"0.8028109",
"0.7915901",
"0.79066455",
"0.78990895",
"0.7888931",
"0.7868648",
"0.78628266",
"0.78518164",
"0.78501767",
"0.77975345",
"0.7693261",
"0.73671466",
"0.7287214",
"0.7284237",
"0.72102034",
"0.7031037",
"0.6930298",
"0.67171633",
"0.66838914",
"0.6576666",
"0.642... | 0.79528373 | 1 |
Adds a PLOAD4 card from ``BDF.add_card(...)`` | def add_card(self, card, comment=''):
sid = integer(card, 1, 'sid')
eid = integer(card, 2, 'eid')
p1 = double_or_blank(card, 3, 'p1', 0.0)
pressures = [
p1,
double_or_blank(card, 4, 'p2', p1),
double_or_blank(card, 5, 'p3', p1),
double_or_b... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def add_card(self, card, comment=''):\n sid = integer(card, 1, 'sid')\n pressure = double(card, 2, 'pressure')\n nodes = [\n integer(card, 3, 'n1'),\n integer(card, 4, 'n2'),\n integer(card, 5, 'n3'),\n integer_or_blank(card, 6, 'n4', 0),\n ]\... | [
"0.70786077",
"0.7062568",
"0.6999924",
"0.6870047",
"0.67696697",
"0.6713227",
"0.6713227",
"0.67096853",
"0.6649252",
"0.6647662",
"0.6601373",
"0.65821975",
"0.6558652",
"0.65386766",
"0.6497127",
"0.6471258",
"0.6428454",
"0.6426456",
"0.6399775",
"0.63017625",
"0.6298261... | 0.6802604 | 4 |
divide a single list, l, into sublists of size n | def divide_chunks(l, n):
# looping till length l
for i in range(0, len(l), n):
yield l[i:i + n] | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def divide_into_chunks(l: List, n: int):\n for i in range(0, len(l), n):\n yield l[i : i + n]",
"def chunks(l: list, n: int) -> list:\n return [l[i:i + n] for i in range(0, len(l), n)]",
"def chunks(l: list, n: int) -> list:\n return [l[i:i + n] for i in range(0, len(l), n)]",
"def split_in_n... | [
"0.7928509",
"0.78473496",
"0.78473496",
"0.7840969",
"0.7682358",
"0.76004755",
"0.7586565",
"0.7548958",
"0.75163615",
"0.75158125",
"0.749556",
"0.749556",
"0.7487836",
"0.7480268",
"0.74408704",
"0.7426387",
"0.7419378",
"0.73957247",
"0.7385352",
"0.7379546",
"0.7338765"... | 0.747752 | 14 |
Yield successive nsized chunks from lst. | def chunks(lst, n):
for i in range(0, len(lst), n):
yield list(lst[i:i + n]) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def chunks(self, lst, n):\n for i in range(0, len(lst), n):\n yield lst[i:i + n]",
"def _chunks(self, lst: List, n: int) -> List:\n for i in range(0, len(lst), n):\n yield lst[i:i + n]",
"def _chunks(self, lst: List, n: int) -> List:\n for i in range(0, len(lst), n):\... | [
"0.8307071",
"0.82908845",
"0.82908845",
"0.8236816",
"0.81460786",
"0.81415075",
"0.81415075",
"0.81263477",
"0.81263477",
"0.8106897",
"0.80819964",
"0.80529666",
"0.80529666",
"0.80529666",
"0.80529666",
"0.80529666",
"0.80529666",
"0.80529666",
"0.80529666",
"0.80529666",
... | 0.8146347 | 4 |
Create a new profile of the appropriate class. | def __new__(cls, name, spec, **kwargs):
type_name, version = schema.get_spec_version(spec)
type_str = "-".join([type_name, version])
if cls != Profile:
ProfileClass = cls
else:
ProfileClass = environment.global_env().get_profile(type_str)
return super(Pr... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def createProfile(self):\n if self.profile:\n return\n from soc.modules.gci.models.profile import GCIProfile\n user = self.createUser()\n properties = {\n 'link_id': user.link_id, 'student_info': None, 'user': user,\n 'parent': user, 'scope': self.program, 'status': 'active',\n ... | [
"0.73276615",
"0.7263913",
"0.71574044",
"0.71565163",
"0.69154793",
"0.67988783",
"0.67880833",
"0.67533225",
"0.6743118",
"0.6628515",
"0.66228193",
"0.66099066",
"0.65446824",
"0.6542868",
"0.6504293",
"0.6471351",
"0.64575785",
"0.64184314",
"0.6406264",
"0.6404763",
"0.6... | 0.7555184 | 0 |
Initialize a profile instance. | def __init__(self, name, spec, **kwargs):
type_name, version = schema.get_spec_version(spec)
self.type_name = type_name
self.version = version
type_str = "-".join([type_name, version])
self.name = name
self.spec = spec
self.id = kwargs.get('id', None)
s... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def initializeProfile(self, path, settings):\n pass",
"def test_profile_initialization(self):\n profileObj = profile.Profile()\n self.assertIsInstance(profileObj, profile.Profile)",
"def load_profile(self, profile):\r\n self.profile = profile\r\n self.proxy.initialize(self.pr... | [
"0.75609696",
"0.7383843",
"0.7101163",
"0.7073847",
"0.7073847",
"0.7066206",
"0.70353377",
"0.66375434",
"0.63857704",
"0.6374231",
"0.62331045",
"0.62331045",
"0.62331045",
"0.6231114",
"0.62120265",
"0.6165063",
"0.61451125",
"0.603875",
"0.60275495",
"0.59947664",
"0.596... | 0.0 | -1 |
Construct a profile from profile object. | def _from_object(cls, profile):
kwargs = {
'id': profile.id,
'type': profile.type,
'context': profile.context,
'user': profile.user,
'project': profile.project,
'domain': profile.domain,
'metadata': profile.metadata,
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _profile_from_dict(obj):\n return ProfileModelFactory.from_dict(obj)",
"def createProfile(self):\n if self.profile:\n return self.profile\n from soc.modules.gsoc.models.profile import GSoCProfile\n user = self.createUser()\n properties = {\n 'link_id': user.link_id, 'student_in... | [
"0.7540908",
"0.64804804",
"0.6357391",
"0.63443553",
"0.63272643",
"0.6269681",
"0.6260929",
"0.6243375",
"0.6236286",
"0.61921173",
"0.6168052",
"0.6168052",
"0.6168052",
"0.6145544",
"0.6066149",
"0.5993156",
"0.59722394",
"0.59722394",
"0.59722394",
"0.59722394",
"0.59722... | 0.783485 | 0 |
Retrieve a profile object from database. | def load(cls, ctx, profile=None, profile_id=None, project_safe=True):
if profile is None:
profile = po.Profile.get(ctx, profile_id,
project_safe=project_safe)
if profile is None:
raise exc.ResourceNotFound(type='profile', id=profile_id... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_object(self):\n\t\tserializer = self.serializer_class\n\t\tqueryset = self.filter_queryset(self.get_queryset())\n\n\t\ttry:\n\t\t\tmy_profile = queryset.get(username_id=self.request.user.id)\n\t\texcept (Exception, UserProfile.DoesNotExist):\n\t\t\tAPIException.status_code = status.HTTP_404_NOT_FOUND\n\t\t... | [
"0.7229836",
"0.7229836",
"0.72067016",
"0.7204811",
"0.7174013",
"0.7148975",
"0.71447504",
"0.7138959",
"0.7097513",
"0.69475377",
"0.6938399",
"0.676676",
"0.67529935",
"0.66846615",
"0.66394067",
"0.6623852",
"0.64951545",
"0.64777213",
"0.6456773",
"0.6418322",
"0.639093... | 0.61743283 | 31 |
Load a grayscale image of dtype uint8. | def face_img_gs_uint():
img = cv2.imread(str(TEST_FACE_IMAGE_PATH), 0)
assert img.ndim == 2
assert img.dtype == np.uint8
return img | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def load_img_uint8(img_filename):\n img = libtiff.TiffFile(img_filename)\n img_mat = img.get_tiff_array()[0].astype(np.uint8)[np.newaxis, :]\n return img_mat",
"def load_img_as_gray(img_path):\n img = io.imread(img_path)\n return (color.rgb2gray(img) * 255).astype(np.uint8)",
"def img_to_uint8(i... | [
"0.73126256",
"0.71058923",
"0.6704921",
"0.66175914",
"0.6478742",
"0.6478742",
"0.64784443",
"0.6435465",
"0.638413",
"0.6370639",
"0.6307605",
"0.62523955",
"0.6178179",
"0.61728925",
"0.61166084",
"0.6111918",
"0.61094695",
"0.6094346",
"0.6094346",
"0.60890293",
"0.60471... | 0.605234 | 20 |
Load a RGB image of dtype uint8. | def face_img_rgb_uint():
img = cv2.imread(str(TEST_FACE_IMAGE_PATH), 1)
img = cv2.cvtColor(img, cv2.COLOR_BGR2RGB)
assert img.ndim == 3
assert img.dtype == np.uint8
return img | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def load_img_uint8(img_filename):\n img = libtiff.TiffFile(img_filename)\n img_mat = img.get_tiff_array()[0].astype(np.uint8)[np.newaxis, :]\n return img_mat",
"def load_image(image_path):\n image = Image.open(image_path)\n (im_width, im_height) = image.size\n return np.array(image.... | [
"0.7149669",
"0.66845846",
"0.66678166",
"0.6318624",
"0.6200485",
"0.61613756",
"0.6113346",
"0.60617113",
"0.60476416",
"0.60404724",
"0.5994617",
"0.5939776",
"0.5918295",
"0.58875084",
"0.58769083",
"0.58677626",
"0.58601",
"0.58559424",
"0.58380467",
"0.5817415",
"0.5790... | 0.6472432 | 3 |
Load a grayscale image of dtype float32. | def face_img_gs_float():
img = cv2.imread(str(TEST_FACE_IMAGE_PATH), 0)
img = img.astype(np.float32) / 255
assert img.ndim == 2
assert img.dtype == np.float32
return img | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def load_img(path):\n img = cv2.imread(path)\n return (img / 255).astype(np.float32)",
"def load_img(path):\n img = Image.open(path)\n img = np.array(img, dtype=\"float32\")\n return img",
"def read_rgb(path):\n img = io.imread(path)\n return img.astype('float32')",
"def load_image(in_fi... | [
"0.7192113",
"0.7091805",
"0.6980039",
"0.68922347",
"0.6833232",
"0.6798671",
"0.67731076",
"0.6734893",
"0.65847963",
"0.65847963",
"0.6581688",
"0.6558949",
"0.6521544",
"0.6488378",
"0.6465722",
"0.64298546",
"0.63980937",
"0.63641506",
"0.63632226",
"0.6352535",
"0.63475... | 0.62128574 | 33 |
Load a rgb image of dtype float32. | def face_img_rgb_float():
img = cv2.imread(str(TEST_FACE_IMAGE_PATH), 1)
img = cv2.cvtColor(img, cv2.COLOR_BGR2RGB).astype(np.float32) / 255
assert img.ndim == 3
assert img.dtype == np.float32
return img | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def read_rgb(path):\n img = io.imread(path)\n return img.astype('float32')",
"def load_img(path):\n img = cv2.imread(path)\n return (img / 255).astype(np.float32)",
"def load_img(path):\n img = Image.open(path)\n img = np.array(img, dtype=\"float32\")\n return img",
"def test_write_read_... | [
"0.7953157",
"0.7166572",
"0.71239495",
"0.7079904",
"0.672514",
"0.6636679",
"0.66278416",
"0.6607506",
"0.6606725",
"0.6535321",
"0.64374846",
"0.63883454",
"0.6347536",
"0.6319091",
"0.627226",
"0.62113506",
"0.61512506",
"0.6080062",
"0.6046481",
"0.59963715",
"0.5967808"... | 0.6766257 | 4 |
returns AP info by sweep arranged as a list (by sweep). | def get_bySweep(self,feature="freqs"):
self.ensureDetection()
bySweepTimes=[[]]*self.abf.sweeps
# determine AP spike times by sweep
for sweep in range(self.abf.sweeps):
sweepTimes=[]
for ap in self.APs:
if ap["sweep"]==sweep:
s... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def detectSweep(self,sweep=0):\n\n if self.APs is False: # indicates detection never happened\n self.APs=[] # now indicates detection occured\n\n # delete every AP from this sweep from the existing array\n for i,ap in enumerate(self.APs):\n if ap[\"sweep\"]==sweep:\n ... | [
"0.6366127",
"0.6132984",
"0.59274834",
"0.55164087",
"0.537289",
"0.5311142",
"0.52297693",
"0.51906323",
"0.5117057",
"0.5084155",
"0.5054566",
"0.5006989",
"0.49650568",
"0.4918877",
"0.49188706",
"0.49033585",
"0.489611",
"0.48615846",
"0.4848996",
"0.48369232",
"0.483287... | 0.6505966 | 0 |
Get active window as a string | def getActiveWindow():
time.sleep(2)
hwnd = ctypes.windll.user32.GetForegroundWindow()
length = ctypes.windll.user32.GetWindowTextLengthW(hwnd)
buff = ctypes.create_unicode_buffer(length + 1)
ctypes.windll.user32.GetWindowTextW(hwnd, buff, length + 1)
return buff.value.encode('utf-8') | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def current_window(self):\n windowname = win32gui.GetWindowText(win32gui.GetForegroundWindow())\n pid = win32process.GetWindowThreadProcessId(\n win32gui.GetForegroundWindow())\n return psutil.Process(pid[-1]).name(), windowname",
"def getActiveWindow(self):\n return globalref.main... | [
"0.8247487",
"0.7388542",
"0.72537047",
"0.72534245",
"0.71415937",
"0.7055199",
"0.68427056",
"0.68303037",
"0.67244655",
"0.6714886",
"0.66043377",
"0.6578856",
"0.6523301",
"0.6511337",
"0.6439425",
"0.641093",
"0.64004076",
"0.63488686",
"0.6345341",
"0.6341525",
"0.63157... | 0.80576754 | 1 |
Gets the public_id of this CloudinaryImage. | def public_id(self):
return self._public_id | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def data_management_public_ip_id(self) -> str:\n return pulumi.get(self, \"data_management_public_ip_id\")",
"def image_id(self) -> str:\n return pulumi.get(self, \"image_id\")",
"def public_key(self):\n return self.__public_key",
"def engine_public_ip_id(self) -> str:\n return pu... | [
"0.6868985",
"0.6795762",
"0.670208",
"0.6673974",
"0.6652993",
"0.6652993",
"0.6652993",
"0.6652993",
"0.6652993",
"0.6652993",
"0.6652993",
"0.6652993",
"0.6652993",
"0.6652993",
"0.6652993",
"0.6652993",
"0.6652993",
"0.6652993",
"0.6647461",
"0.6553823",
"0.6553823",
"0... | 0.8287998 | 0 |
Sets the public_id of this CloudinaryImage. | def public_id(self, public_id):
self._public_id = public_id | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def public_url(self, public_url):\n self._public_url = public_url",
"def public_id(self):\n return self._public_id",
"def bus_ob_public_id(self, bus_ob_public_id):\n\n self._bus_ob_public_id = bus_ob_public_id",
"def public_key(self, public_key):\n\n self._public_key = public_key"... | [
"0.68292326",
"0.6660748",
"0.6659289",
"0.647419",
"0.6290125",
"0.6290125",
"0.6290125",
"0.6290125",
"0.62773",
"0.6125691",
"0.61102426",
"0.5999231",
"0.59673196",
"0.59430027",
"0.5892802",
"0.58913606",
"0.58913606",
"0.5831026",
"0.57207966",
"0.57207966",
"0.57207966... | 0.8225011 | 0 |
Gets the width of this CloudinaryImage. | def width(self):
return self._width | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def width(self):\n return self.img.width",
"def img_width(self) -> float:\n return self._img_width",
"def width(self):\n return _yarp.Image_width(self)",
"def width(self):\n\t\treturn self.__image.shape[0]",
"def get_width(self):\n return self._width",
"def get_width(self):\n ... | [
"0.86601466",
"0.84442466",
"0.83365023",
"0.8261103",
"0.8128116",
"0.8128116",
"0.8128116",
"0.8128116",
"0.8128116",
"0.811522",
"0.80682075",
"0.8056912",
"0.8056912",
"0.7990012",
"0.79025257",
"0.79001504",
"0.7898261",
"0.78870255",
"0.78787917",
"0.78787917",
"0.78787... | 0.79047245 | 19 |
Gets the height of this CloudinaryImage. | def height(self):
return self._height | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def height(self):\n return self.img.height",
"def height(self):\n return _yarp.Image_height(self)",
"def height(self):\n\t\treturn self.__image.shape[1]",
"def GetHeight(self):\n return _itkHConcaveImageFilterPython.itkHConcaveImageFilterIUL2IUL2_GetHeight(self)",
"def height(self):\n ... | [
"0.85450333",
"0.8221475",
"0.8054994",
"0.7915899",
"0.79007053",
"0.7895304",
"0.7895304",
"0.7895304",
"0.7895304",
"0.7889164",
"0.7876149",
"0.7876149",
"0.78690875",
"0.7859792",
"0.7843492",
"0.7834122",
"0.7784479",
"0.7770995",
"0.77661026",
"0.7763228",
"0.7747353",... | 0.7760264 | 27 |
Sets the format of this CloudinaryImage. | def format(self, format):
self._format = format | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def file_format(self, file_format):\n self._file_format = file_format",
"def file_format(self, file_format):\n\n self._file_format = file_format",
"def setFormat(self, formatName):\n pass",
"def format(self, format):\n allowed_values = [\"image/heif\", \"image/heic\", \"image/heif... | [
"0.6814052",
"0.67466617",
"0.65703845",
"0.6549482",
"0.6220336",
"0.61215174",
"0.57740307",
"0.56952494",
"0.56776273",
"0.5675353",
"0.56721926",
"0.56035197",
"0.5567207",
"0.5540137",
"0.54853463",
"0.5441356",
"0.54409915",
"0.5424604",
"0.5404156",
"0.53929055",
"0.52... | 0.646455 | 5 |
Gets the resource_type of this CloudinaryImage. | def resource_type(self):
return self._resource_type | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def resource_type(self) -> pulumi.Output[Optional[str]]:\n return pulumi.get(self, \"resource_type\")",
"def resource_type(self) -> pulumi.Output[str]:\n return pulumi.get(self, \"resource_type\")",
"def resource_type_code(self):\n return self._resource_type_code",
"def resource_type(sel... | [
"0.80234635",
"0.7995855",
"0.7980745",
"0.79756004",
"0.78400755",
"0.78400755",
"0.78400755",
"0.78400755",
"0.7837645",
"0.76516134",
"0.7601377",
"0.7242204",
"0.7204824",
"0.69194907",
"0.68552357",
"0.68552357",
"0.6807601",
"0.6789483",
"0.67542636",
"0.67542636",
"0.6... | 0.84587836 | 0 |
Sets the resource_type of this CloudinaryImage. | def resource_type(self, resource_type):
allowed_values = ["image"]
if resource_type not in allowed_values:
raise ValueError(
"Invalid value for `resource_type` ({0}), must be one of {1}"
.format(resource_type, allowed_values)
)
self._resou... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def resource_template_type(self, resource_template_type):\n\n self._resource_template_type = resource_template_type",
"def set_resources(self, resource_type, res_property):\n if resource_type in self.resource_types:\n if resource_type not in self.resources:\n self.resource... | [
"0.76920533",
"0.645941",
"0.6430549",
"0.63760257",
"0.61920315",
"0.61796427",
"0.61479336",
"0.61361915",
"0.6129189",
"0.6118511",
"0.6118511",
"0.6118511",
"0.6118511",
"0.6118511",
"0.6118511",
"0.6118511",
"0.6118511",
"0.6118511",
"0.6118511",
"0.6118511",
"0.6118511"... | 0.8268299 | 0 |
Gets the created_at of this CloudinaryImage. | def created_at(self):
return self._created_at | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def created_at(self):\n\n created_at = self.data[\"createdAt\"]\n return utils.iso_to_datetime(created_at)",
"def created_at(self):\n return self.created_at",
"def created_at(self):\n\n return self._created_at.value",
"def created_at(self):\n\n return self._created_at.value... | [
"0.8331314",
"0.8305234",
"0.82942855",
"0.82942855",
"0.8290633",
"0.8169472",
"0.8169472",
"0.81451327",
"0.81127447",
"0.81070954",
"0.8098954",
"0.80946153",
"0.7995038",
"0.7995038",
"0.7995038",
"0.7995038",
"0.7908551",
"0.7908551",
"0.7908551",
"0.7908551",
"0.7908551... | 0.8282635 | 7 |
Sets the created_at of this CloudinaryImage. | def created_at(self, created_at):
self._created_at = created_at | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def created_at(self, created_at):\n self._created_at = created_at",
"def created_at(self, value):\n self.created = value",
"def created_at(self, created_at):\n # type: (datetime) -> None\n\n if created_at is not None:\n if not isinstance(created_at, datetime):\n ... | [
"0.78541654",
"0.74833554",
"0.732991",
"0.7122801",
"0.69876605",
"0.69618636",
"0.65167266",
"0.65110916",
"0.6476172",
"0.6476172",
"0.6476172",
"0.6476172",
"0.6471004",
"0.6428844",
"0.64127237",
"0.63780767",
"0.63780767",
"0.6256239",
"0.62560594",
"0.62371236",
"0.623... | 0.78087676 | 10 |
Gets the tags of this CloudinaryImage. | def tags(self):
return self._tags | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def tags(self):\n return self._nfvi_image.tags",
"def get_tags(self):\n return self.tags",
"def getTags(self):\n return self.tags",
"def exif_tags(self):\r\n return self._exif_tags",
"def tags(self) -> Sequence[str]:\n return pulumi.get(self, \"tags\")",
"def tags(self)... | [
"0.8264241",
"0.7957592",
"0.78854054",
"0.7734305",
"0.76714855",
"0.76714855",
"0.7596045",
"0.7596045",
"0.7577649",
"0.7559331",
"0.75504875",
"0.75504875",
"0.7539701",
"0.75375944",
"0.75375944",
"0.7515631",
"0.7505916",
"0.7494846",
"0.7479986",
"0.74630636",
"0.74630... | 0.7856858 | 9 |
Gets the bytes of this CloudinaryImage. | def bytes(self):
return self._bytes | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_image_bytes(self):\n file = open(self.image_dir, 'rb')\n data = file.read()\n file.close()\n return data",
"def get_image_data(self):\n return self._image.get_data()",
"def get_image_data(self):\n return self._image_data",
"def image_data(self):\n retu... | [
"0.82293725",
"0.7411987",
"0.7209884",
"0.7185834",
"0.712409",
"0.7110306",
"0.7039993",
"0.70129263",
"0.69969296",
"0.6757145",
"0.6707749",
"0.6646982",
"0.6587584",
"0.6521058",
"0.65128845",
"0.64669013",
"0.64669013",
"0.6440666",
"0.6428541",
"0.64104545",
"0.6406761... | 0.7440457 | 1 |
Sets the bytes of this CloudinaryImage. | def bytes(self, bytes):
self._bytes = bytes | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_image(cls, value, cloud):\n cls.set(\"image\", value, cloud)",
"def update(self, bytes_):\n self._update(bytes_)",
"def set_bytes(self, value):\n\n if value != -1:\n self.window.run_command('hex_viewer', {\"byte_array\": self.valid_bytes[value]})",
"def blob(self, blob... | [
"0.60211617",
"0.59887785",
"0.595942",
"0.5920472",
"0.5879055",
"0.57632387",
"0.5761639",
"0.57317",
"0.5654427",
"0.5654427",
"0.5654427",
"0.5654427",
"0.5653748",
"0.56137925",
"0.56058216",
"0.5604354",
"0.5578501",
"0.55653495",
"0.55275893",
"0.5415828",
"0.54066354"... | 0.69830894 | 0 |
Gets the type of this CloudinaryImage. | def type(self):
return self._type | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_type(self):\n return self.type",
"def get_type(self):\n return self.type",
"def type(self):\n return self.container['type']",
"def GetType(*args, **kwargs):\n return _core_.Image_GetType(*args, **kwargs)",
"def get_type(self):\n return self._type",
"def type(sel... | [
"0.73920786",
"0.73920786",
"0.73750085",
"0.7344825",
"0.73269695",
"0.7296304",
"0.7296304",
"0.72810024",
"0.7268772",
"0.7268772",
"0.72667426",
"0.72616106",
"0.72616106",
"0.7254393",
"0.7247227",
"0.7238955",
"0.7238955",
"0.722902",
"0.71999955",
"0.7181532",
"0.71584... | 0.72677237 | 38 |
Gets the etag of this CloudinaryImage. | def etag(self):
return self._etag | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def etag(self) -> str:\n return pulumi.get(self, \"etag\")",
"def etag(self) -> str:\n return pulumi.get(self, \"etag\")",
"def etag(self) -> str:\n return pulumi.get(self, \"etag\")",
"def etag(self) -> str:\n return pulumi.get(self, \"etag\")",
"def etag(self) -> str:\n ... | [
"0.8143443",
"0.8143443",
"0.8143443",
"0.8143443",
"0.8143443",
"0.8143443",
"0.8143443",
"0.81248534",
"0.79964286",
"0.79964286",
"0.79964286",
"0.79964286",
"0.79964286",
"0.79964286",
"0.79964286",
"0.79551023",
"0.79551023",
"0.79551023",
"0.78952354",
"0.78952354",
"0.... | 0.8302219 | 0 |
Sets the etag of this CloudinaryImage. | def etag(self, etag):
self._etag = etag | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_etag_header(self):\r\n etag = self.compute_etag()\r\n if etag is not None:\r\n self.set_header(\"Etag\", etag)",
"def set_etag_header(self):\r\n etag = self.compute_etag()\r\n if etag is not None:\r\n self.set_header(\"Etag\", etag)",
"def set_etag(self... | [
"0.68717957",
"0.68717957",
"0.6144346",
"0.6066984",
"0.5709553",
"0.56961954",
"0.56961954",
"0.56961954",
"0.56961954",
"0.56961954",
"0.56961954",
"0.56961954",
"0.5681732",
"0.5681732",
"0.5681732",
"0.5681732",
"0.5665128",
"0.5591536",
"0.5591536",
"0.5591536",
"0.5458... | 0.7913746 | 0 |
Gets the secure_url of this CloudinaryImage. | def secure_url(self):
return self._secure_url | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def thumbnail_secure_url(self):\n return self._thumbnail_secure_url",
"def get_image_url(self):\n return self._url",
"def image_url(self):\n return self._user_dict['image_url']",
"def thumbnail_secure_url(self, thumbnail_secure_url):\n\n self._thumbnail_secure_url = thumbnail_secu... | [
"0.799937",
"0.67536545",
"0.6554761",
"0.64059085",
"0.6336611",
"0.6336611",
"0.6308812",
"0.6304777",
"0.62590635",
"0.61677897",
"0.6137267",
"0.61034125",
"0.60762906",
"0.6040031",
"0.6028608",
"0.60104066",
"0.59878117",
"0.59806836",
"0.5979555",
"0.59729844",
"0.5969... | 0.79987633 | 1 |
Sets the secure_url of this CloudinaryImage. | def secure_url(self, secure_url):
self._secure_url = secure_url | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def thumbnail_secure_url(self, thumbnail_secure_url):\n\n self._thumbnail_secure_url = thumbnail_secure_url",
"def secure_mode(self, secure_mode):\n\n self._secure_mode = secure_mode",
"def thumbnail_secure_url(self):\n return self._thumbnail_secure_url",
"def secure_url(self):\n ... | [
"0.7884066",
"0.6413478",
"0.6394565",
"0.6383283",
"0.6207503",
"0.6206648",
"0.6193792",
"0.60597044",
"0.59298813",
"0.5809116",
"0.56965756",
"0.5579925",
"0.5556021",
"0.55391616",
"0.55386996",
"0.55386996",
"0.5519573",
"0.5350181",
"0.5342928",
"0.5338991",
"0.5331300... | 0.8187664 | 0 |
Gets the is_base64 of this CloudinaryImage. | def is_base64(self):
return self._is_base64 | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def is_base64(self, is_base64):\n\n self._is_base64 = is_base64",
"def certificate_blob_base64(self) -> Optional[pulumi.Input[str]]:\n return pulumi.get(self, \"certificate_blob_base64\")",
"def user_data_base64(self) -> Optional[pulumi.Input[str]]:\n return pulumi.get(self, \"user_data_ba... | [
"0.72929597",
"0.6763676",
"0.6577005",
"0.6577005",
"0.648725",
"0.64594096",
"0.6334361",
"0.6258819",
"0.6229961",
"0.5980619",
"0.58747804",
"0.58546734",
"0.5820826",
"0.5793923",
"0.57732415",
"0.5646594",
"0.5585381",
"0.55481553",
"0.5508362",
"0.5463657",
"0.5437928"... | 0.8363204 | 0 |
Gets the id of this CloudinaryImage. | def id(self):
return self._id | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def image_id(self) -> str:\n return pulumi.get(self, \"image_id\")",
"def image_id(self):\n return self._image_id",
"def image_id(self) -> int:\n return self._image_id",
"def image_id(self) -> pulumi.Output[str]:\n return pulumi.get(self, \"image_id\")",
"def image_id(self) -> p... | [
"0.8146634",
"0.80496407",
"0.8013295",
"0.7724565",
"0.7724565",
"0.7442219",
"0.73711234",
"0.73711234",
"0.73711234",
"0.7244305",
"0.7213603",
"0.7213603",
"0.7213603",
"0.7213053",
"0.72024536",
"0.7200379",
"0.7181952",
"0.716134",
"0.7148307",
"0.7148307",
"0.7148307",... | 0.0 | -1 |
Sets the id of this CloudinaryImage. | def id(self, id):
self._id = id | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def setId(self, id):\n self.id = id",
"def image_id(self, image_id):\n\n self._image_id = image_id",
"def image_id(self, image_id):\n\n self._image_id = image_id",
"def image_id(self, image_id):\n\n self._image_id = image_id",
"def id(self, id):\n \n self._id = id"... | [
"0.70745295",
"0.7071735",
"0.7071735",
"0.7071735",
"0.6980041",
"0.6980041",
"0.6980041",
"0.6980041",
"0.6980041"
] | 0.6907583 | 76 |
Returns the string representation of the model | def to_str(self):
return pformat(self.to_dict()) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _repr_model_(self):\n return str(self)",
"def __str__(self):\n\n return str(self.model)",
"def get_model_string(self):\n raise NotImplementedError()",
"def __str__(self):\n return self.model",
"def serialize_model(self):\n return dill.dumps(self.model)",
"def __str_... | [
"0.8602374",
"0.85093755",
"0.8237104",
"0.8050309",
"0.80128866",
"0.79348034",
"0.78766525",
"0.77898884",
"0.7786461",
"0.7745792",
"0.7627315",
"0.76055235",
"0.757999",
"0.7514394",
"0.75038797",
"0.75035286",
"0.74850684",
"0.7440529",
"0.74325883",
"0.74239755",
"0.740... | 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 return not self == other",
"def __ne__(self, other: object) -> bool:\n return not self.__eq__(other)",
"def __ne__(self, other):\n return self.__dict__ != other.__dict__",
"def __eq__(self, other):\n return not self.__ne__(other)",
... | [
"0.8410411",
"0.8391477",
"0.8172175",
"0.81410587",
"0.80920255",
"0.8088807",
"0.80676955"
] | 0.0 | -1 |
Given a list, return True if the list elements are monotonically increasing, and False otherwise. | def is_increasing(l):
for a, b in zip(l, l[1:]):
if a >= b:
return False
return True | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def strictly_increasing(l):\n return all(x < y for x, y in zip(l, l[1:]))",
"def is_strictly_increasing(L):\r\n for x, y in zip(L, L[1:]):\r\n if x > y: return False\r\n return True",
"def strictly_decreasing(l):\n return all(x > y for x, y in zip(l, l[1:]))",
"def increasing(L):\n retu... | [
"0.7918331",
"0.7698757",
"0.7524047",
"0.7287714",
"0.7004927",
"0.694317",
"0.6730322",
"0.6692579",
"0.66767114",
"0.6609285",
"0.6588625",
"0.6585702",
"0.65724343",
"0.6559871",
"0.6546636",
"0.65210545",
"0.6517487",
"0.6509962",
"0.64946204",
"0.64422107",
"0.6403173",... | 0.7691577 | 2 |
Return the ProfileModifier object to apply. | def ModifierFactory(service, prof, run=None, on_client_side=False):
pm_name = {
'meshtool' : ProfileModifierMeshtool,
'stanley' : ProfileModifierStanley,
'convbase' : ProfileModifierConvbase,
'distribution' : ProfileModifierDistribution,
'exectool' : ProfileModifierExecTool,
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def modifier(self) -> num.Modifier:\n return num.Modifier((self.score - 10) // 2, self.modifier_type)",
"def profile(self) -> Profile:\n return self._profile",
"def modifier(self) -> core.Reference:\n return self._skill.key_ability + num.Modifier(self.ranks)",
"def modifier(self):\n ... | [
"0.5965132",
"0.572716",
"0.5550964",
"0.5512007",
"0.5473525",
"0.5352039",
"0.535062",
"0.53365505",
"0.52686185",
"0.5223551",
"0.5155985",
"0.51309276",
"0.51248807",
"0.50386703",
"0.50337976",
"0.49971184",
"0.49741155",
"0.49606755",
"0.4935728",
"0.49263355",
"0.49152... | 0.60298616 | 0 |
Return the profile modified for the "special" service. | def apply_special_service(prof, run, on_client_side=False):
# allow customization of the modifier
if run.get('schema_profile_modifier'):
schem = get_plugin(run['schema_profile_modifier'])
run.DBG("calling plugin : %s" % run['schema_profile_modifier'])
serv, prof = schem(prof, on_client_s... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def GetServiceProfile(self):\n result = self.SerialSendReceive(self.CMD_GET_SERVICE_PROFILE,\n msg='getting service profile')\n return self.SERVICE_PROFILE.get(result)",
"def get_profile():\n return Profile.get_profile()",
"def getProfile(self):\n return self.... | [
"0.69014287",
"0.67777747",
"0.6752882",
"0.65648836",
"0.6276499",
"0.6186721",
"0.6078076",
"0.60666454",
"0.60557914",
"0.60192156",
"0.5828468",
"0.5774679",
"0.5744099",
"0.5742679",
"0.57283944",
"0.5689936",
"0.5686231",
"0.56509155",
"0.56482947",
"0.56275505",
"0.560... | 0.6336104 | 4 |
Return True if the state is a goal. The default method compares the state to self.goal, as specified in the constructor. Implement this method if checking against a single self.goal is not enough. | def goal_test(self, state):
return state == self.goal | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def is_goal(self, state):\r\n return state == self.goal",
"def is_goal(self, state):\r\n return self.goal in state",
"def is_goal(self, state):\r\n return state.get_location() == tuple(self.goal)",
"def in_goal_state(self):\n return self.state == self.goal_state",
"def is_goal_s... | [
"0.88153714",
"0.86220795",
"0.8593574",
"0.8565841",
"0.85211986",
"0.8501043",
"0.8412305",
"0.83747756",
"0.83601207",
"0.83601207",
"0.83601207",
"0.83601207",
"0.8338069",
"0.8255779",
"0.8169012",
"0.81196207",
"0.8089045",
"0.79889244",
"0.79889244",
"0.79889244",
"0.7... | 0.83085924 | 13 |
Return a list of nodes in the graph. | def nodes(self):
return list(self.dict.keys()) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def nodes(self):\n return list(self.graph.nodes)",
"def nodes(self):\n return [*self._graph]",
"def list_nodes(self):\n return self.graph.keys()",
"def get_list_nodes(self):\n\n nodes = []\n for i in self._graph:\n if i not in nodes:\n nodes.append... | [
"0.86116457",
"0.853579",
"0.84758675",
"0.84654766",
"0.83759946",
"0.82644945",
"0.82075334",
"0.81929123",
"0.8177322",
"0.81741464",
"0.8058334",
"0.80550957",
"0.79857326",
"0.79047704",
"0.78200364",
"0.7813378",
"0.7813378",
"0.77819616",
"0.77609175",
"0.7735894",
"0.... | 0.729066 | 39 |
Construct a random graph, with the specified nodes, and random links. The nodes are laid out randomly on a (width x height) rectangle. Then each node is connected to the min_links nearest neighbors. Because inverse links are added, some nodes will have more connections. The distance between nodes is the hypotenuse time... | def RandomGraph(nodes=list(range(10)), min_links=2, width=400, height=300,
curvature=lambda: random.uniform(1.1, 1.5)):
g = UndirectedGraph()
g.locations = {}
# Build the cities
for node in nodes:
g.locations[node] = (random.randrange(width), random.randrange(height))
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def RandomGraph(nodes=list(range(10)), min_links=4, width=400, height=300,\n curvature=lambda: random.uniform(1.1, 1.5)):\n g = UndirectedGraph()\n test2 = open('random_graph.txt','w') \n g.locations = {}\n # Build the cities\n for node in nodes:\n g.locations[node] = (random.r... | [
"0.79313195",
"0.63685364",
"0.6187906",
"0.6133492",
"0.6042386",
"0.5972823",
"0.5739357",
"0.5732478",
"0.5728315",
"0.57168645",
"0.5702951",
"0.5676115",
"0.56456095",
"0.55994314",
"0.5563308",
"0.55040914",
"0.54996634",
"0.54880255",
"0.5466887",
"0.54502887",
"0.5433... | 0.8478433 | 0 |
r""" Determine whether coercion to self exists from other parent | def _coerce_map_from_(self, other):
if isinstance(other, (VectorFieldModule, VectorFieldFreeModule)):
return self._domain.is_subdomain(other._domain) and \
self._ambient_domain.is_subdomain(other._ambient_domain)
else:
return False | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def isinstance(self, other) -> bool:\n return isinstance(self.result, other)",
"def same_parent(self, parent):\n is_instance_of_step_parent = (\n inspect.isclass(parent)\n and isinstance(self._parent, parent)\n )\n return is_instance_of_step_parent or parent == s... | [
"0.6546808",
"0.6516049",
"0.64731455",
"0.6396084",
"0.6396084",
"0.6396084",
"0.6396084",
"0.6396084",
"0.6393578",
"0.6288312",
"0.62752956",
"0.6272829",
"0.624874",
"0.624401",
"0.6207164",
"0.620518",
"0.6199925",
"0.617332",
"0.61426014",
"0.61204433",
"0.6118357",
"... | 0.57397825 | 57 |
r""" String representation of the object. | def _repr_(self):
description = "module "
if self._name is not None:
description += self._name + " "
description += "of vector fields "
if self._dest_map is self._domain._identity_map:
description += "on the " + str(self._domain)
else:
descript... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def toString(self):\n return \"[object %s]\" % self.__class__.__name__",
"def to_str (self):\n return str(self.__class__) + \" \" + pprint.pformat(self.to_dict())",
"def __str__(self) -> str:\n return self._repr(verbose=False)",
"def toString(self):\n return self.__str__()",
"de... | [
"0.85320514",
"0.8257055",
"0.8168421",
"0.81487477",
"0.8147426",
"0.8124195",
"0.8124195",
"0.8124195",
"0.8124195",
"0.8111107",
"0.8098341",
"0.80856913",
"0.8066752",
"0.8065788",
"0.80279815",
"0.80115205",
"0.8010703",
"0.80025935",
"0.7986465",
"0.7986465",
"0.7970694... | 0.0 | -1 |
r""" Construct a linear form on the module ``self``. A linear form on the vector field module ``self`` is actually a field of linear forms (i.e. a 1form) along the open subset `U` on which ``self`` is defined. | def linear_form(self, name=None, latex_name=None):
from diffform import OneForm
return OneForm(self, name=name, latex_name=latex_name) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def linear_form(self, name=None, latex_name=None):\n from diffform import OneFormParal\n return OneFormParal(self, name=name, latex_name=latex_name)",
"def to_linear(self):\n new = self.__class__(self)\n new.linear = True\n return new",
"def linearise(self,p):\n # Calc... | [
"0.66021997",
"0.64766216",
"0.60255635",
"0.6013134",
"0.5944852",
"0.5829666",
"0.58222216",
"0.5797967",
"0.5728963",
"0.57128525",
"0.5684409",
"0.5655844",
"0.5622005",
"0.56115675",
"0.5584084",
"0.55117637",
"0.54863966",
"0.5480285",
"0.5476361",
"0.5467551",
"0.53883... | 0.6439956 | 2 |
r""" Construct an endomorphism of the module ``self``. An endomorphism of the module ``self`` is actually a field of tangentspace endomorphisms along the open subset `U` on which ``self`` is defined. | def endomorphism(self, name=None, latex_name=None):
from rank2field import EndomorphismField
return EndomorphismField(self, name=name, latex_name=latex_name) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def endomorphism(self, name=None, latex_name=None):\n from rank2field import EndomorphismFieldParal\n return EndomorphismFieldParal(self, name=name, latex_name=latex_name)",
"def FlowNotionalEnd(builder):\n return End(builder)",
"def __init__(self, baseset, unity, op, inv, op2, properties):\n ... | [
"0.6177477",
"0.5256157",
"0.52473146",
"0.5201582",
"0.51843977",
"0.5181052",
"0.51139724",
"0.5070736",
"0.4976139",
"0.4888265",
"0.48858893",
"0.4837102",
"0.48309073",
"0.48264283",
"0.48179162",
"0.4775286",
"0.4752312",
"0.47298494",
"0.4727775",
"0.4727735",
"0.47036... | 0.62318265 | 0 |
r""" Construct the identity map on the module ``self``. The identity map on the module ``self`` is actually a field of tangentspace identity maps along the open subset `U` on which ``self`` is defined. | def identity_map(self, name='Id', latex_name=None):
from rank2field import TangentIdentityField
return TangentIdentityField(self, name=name, latex_name=latex_name) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def identity_map(self, name='Id', latex_name=None):\n from rank2field import TangentIdentityFieldParal\n return TangentIdentityFieldParal(self, name=name, latex_name=latex_name)",
"def get_identity_matrix(self):\n for y in xrange(self.sm_y):\n self.identity_matrix.append([0 for _ ... | [
"0.6362004",
"0.61735433",
"0.58793825",
"0.5844829",
"0.5716078",
"0.56426364",
"0.56113964",
"0.55905014",
"0.55421555",
"0.5540445",
"0.5505554",
"0.54721874",
"0.54279536",
"0.54053813",
"0.5345188",
"0.52547884",
"0.52341336",
"0.5183451",
"0.5158171",
"0.51236767",
"0.5... | 0.62508124 | 1 |
r""" Construct a pseudoRiemannian metric (nondegenerate symmetric bilinear form) on the free module ``self``. A metric of the vector free module ``self`` is actually a field of tangentspace metrics along the open subset `U` on which ``self`` is defined. | def metric(self, name, signature=None, latex_name=None):
from metric import Metric
return Metric(self, name, signature=signature, latex_name=latex_name) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def riemann_metric(self):\n DuR = sym.diff(self.parameterization, self.u)\n DvR = sym.diff(self.parameterization, self.v)\n guu = DuR.dot(DuR)\n gvv = DvR.dot(DvR)\n guv = DuR.dot(DvR)\n g = sym.Matrix([\n [guu, guv],\n [guv, gvv]]\n )\n ... | [
"0.59448457",
"0.5505048",
"0.5339323",
"0.53136337",
"0.5268105",
"0.5256732",
"0.5247485",
"0.5242723",
"0.5208503",
"0.51987815",
"0.51987815",
"0.5192408",
"0.5178703",
"0.5147323",
"0.51411915",
"0.5134776",
"0.5134237",
"0.5126085",
"0.51072735",
"0.50724435",
"0.506371... | 0.0 | -1 |
r""" Construct a Riemannian metric (positive definite symmetric bilinear form) on the free module ``self``. A Riemannian metric of the vector free module ``self`` is actually a field of tangentspace Riemannian metrics along the open subset `U` on which ``self`` is defined. | def riemann_metric(self, name, latex_name=None):
from metric import RiemannMetric
return RiemannMetric(self, name, latex_name=latex_name) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def riemann_metric(self):\n DuR = sym.diff(self.parameterization, self.u)\n DvR = sym.diff(self.parameterization, self.v)\n guu = DuR.dot(DuR)\n gvv = DvR.dot(DvR)\n guv = DuR.dot(DvR)\n g = sym.Matrix([\n [guu, guv],\n [guv, gvv]]\n )\n ... | [
"0.661193",
"0.59994423",
"0.55386615",
"0.5409693",
"0.5373281",
"0.5287807",
"0.5231626",
"0.52016103",
"0.5160118",
"0.51503515",
"0.51465595",
"0.51384765",
"0.5127094",
"0.5103472",
"0.5072443",
"0.5026723",
"0.5013023",
"0.4994565",
"0.49708998",
"0.4965452",
"0.4964141... | 0.5496446 | 3 |
r""" Construct a Lorentzian metric (symmetric bilinear form of signature (,+,...,+) or (+,,...,)) on the free module ``self``. A Lorentzian metric of the vector free module ``self`` is actually a field of tangentspace Lorentzian metrics along the open subset `U` on which ``self`` is defined. | def lorentz_metric(self, name, signature='positive', latex_name=None):
from metric import LorentzMetric
return LorentzMetric(self, name, signature=signature,
latex_name=latex_name) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def lvec(self):\n lv = ROOT.TLorentzVector()\n lv.SetPtEtaPhiM(self.pt, self.eta, self.phi, self.mass)\n return lv",
"def compute_L_matrix(self):\n self.L = np.diag(self.z) - self.K\n logg.info('compute graph Laplacian')",
"def lorentz_metric(self, name, signature='positive', latex_name=... | [
"0.60356754",
"0.57791686",
"0.5645441",
"0.55601794",
"0.5498341",
"0.5481095",
"0.54534507",
"0.5426166",
"0.5417829",
"0.54025376",
"0.5386637",
"0.5361586",
"0.5360794",
"0.5354428",
"0.5354428",
"0.52934086",
"0.52444315",
"0.52340376",
"0.5225331",
"0.52225614",
"0.5221... | 0.5760955 | 2 |
r""" Determine whether coercion to self exists from other parent | def _coerce_map_from_(self, other):
if isinstance(other, (VectorFieldModule, VectorFieldFreeModule)):
return self._domain.is_subdomain(other._domain) and \
self._ambient_domain.is_subdomain(other._ambient_domain)
else:
return False | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def isinstance(self, other) -> bool:\n return isinstance(self.result, other)",
"def same_parent(self, parent):\n is_instance_of_step_parent = (\n inspect.isclass(parent)\n and isinstance(self._parent, parent)\n )\n return is_instance_of_step_parent or parent == s... | [
"0.6545017",
"0.65177196",
"0.64712936",
"0.6395007",
"0.6395007",
"0.6395007",
"0.6395007",
"0.6395007",
"0.6391598",
"0.62896293",
"0.6272877",
"0.6272723",
"0.62484705",
"0.6243663",
"0.6210259",
"0.62039",
"0.6201098",
"0.61730134",
"0.61412156",
"0.6120135",
"0.6119339",... | 0.5738711 | 58 |
r""" String representation of the object. | def _repr_(self):
description = "free module "
if self._name is not None:
description += self._name + " "
description += "of vector fields "
if self._dest_map is self._domain._identity_map:
description += "on the " + str(self._domain)
else:
des... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def toString(self):\n return \"[object %s]\" % self.__class__.__name__",
"def to_str (self):\n return str(self.__class__) + \" \" + pprint.pformat(self.to_dict())",
"def __str__(self) -> str:\n return self._repr(verbose=False)",
"def toString(self):\n return self.__str__()",
"de... | [
"0.85323876",
"0.825737",
"0.81680644",
"0.81483227",
"0.81471014",
"0.8124186",
"0.8124186",
"0.8124186",
"0.8124186",
"0.81115615",
"0.80985063",
"0.80849934",
"0.8066778",
"0.80655044",
"0.80278856",
"0.8010574",
"0.8010484",
"0.8001917",
"0.79861253",
"0.79861253",
"0.797... | 0.0 | -1 |
r""" Construct a tensor on the free module from a set of components. The tensor is actually a tensor field on the domain of ``self``. The tensor symmetries are deduced from those of the components. | def tensor_from_comp(self, tensor_type, comp, name=None, latex_name=None):
from rank2field import EndomorphismFieldParal
from diffform import DiffFormParal, OneFormParal
from sage.tensor.modules.comp import CompWithSym, CompFullySym, \
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def tensor(cls, component) -> 'Type_':\n if component.isTensor():\n return component\n else:\n return cls(Tensor(component))",
"def from_tensor(cls,\n tensor: Tensor,\n subsystem_axes: Optional[Sequence[int]] = None,\n backend... | [
"0.5891171",
"0.5808168",
"0.5793794",
"0.57595223",
"0.57549286",
"0.560268",
"0.5540258",
"0.5527649",
"0.5412145",
"0.535596",
"0.52431655",
"0.52317834",
"0.5137232",
"0.5133484",
"0.5119704",
"0.5116453",
"0.50992036",
"0.5098475",
"0.50890404",
"0.5071879",
"0.505958",
... | 0.6121475 | 0 |
r""" Construct a linear form on the free module. A linear form on the vector free module ``self`` is actually a field of linear forms (i.e. a 1form) along the open subset `U` on which ``self`` is defined. | def linear_form(self, name=None, latex_name=None):
from diffform import OneFormParal
return OneFormParal(self, name=name, latex_name=latex_name) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def to_linear(self):\n new = self.__class__(self)\n new.linear = True\n return new",
"def linear_form(self, name=None, latex_name=None):\n from diffform import OneForm\n return OneForm(self, name=name, latex_name=latex_name)",
"def linearise(self,p):\n # Calculate Matr... | [
"0.621743",
"0.6210649",
"0.601698",
"0.57477456",
"0.57356995",
"0.5720848",
"0.5716319",
"0.5709432",
"0.5636196",
"0.56194556",
"0.5481609",
"0.54479027",
"0.5434621",
"0.54296815",
"0.5416183",
"0.537262",
"0.5351232",
"0.5292864",
"0.52893",
"0.5283333",
"0.5276354",
"... | 0.6359238 | 0 |
r""" Construct the identity map on the free module ``self``. The identity map on the vector free module ``self`` is actually a field of tangentspace identity maps along the open subset `U` on which ``self`` is defined. | def identity_map(self, name='Id', latex_name=None):
from rank2field import TangentIdentityFieldParal
return TangentIdentityFieldParal(self, name=name, latex_name=latex_name) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_identity_matrix(self):\n for y in xrange(self.sm_y):\n self.identity_matrix.append([0 for _ in xrange(self.sm_x)])\n self.identity_matrix[y][y] = 1",
"def identity_map(self, name='Id', latex_name=None):\n from rank2field import TangentIdentityField\n return Tang... | [
"0.5756588",
"0.55855674",
"0.5584882",
"0.5462656",
"0.54191387",
"0.5384117",
"0.52751887",
"0.5259416",
"0.5258455",
"0.52342135",
"0.52169997",
"0.52105737",
"0.51669586",
"0.5150773",
"0.5150299",
"0.51140964",
"0.51059514",
"0.50991493",
"0.5088267",
"0.5046367",
"0.500... | 0.5690621 | 1 |
r""" Construct a pseudoRiemannian metric (nondegenerate symmetric bilinear form) on the free module ``self``. A metric of the vector free module ``self`` is actually a field of tangentspace metrics along the open subset `U` on which ``self`` is defined. | def metric(self, name, signature=None, latex_name=None):
from metric import MetricParal
return MetricParal(self, name, signature=signature,
latex_name=latex_name) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def riemann_metric(self):\n DuR = sym.diff(self.parameterization, self.u)\n DvR = sym.diff(self.parameterization, self.v)\n guu = DuR.dot(DuR)\n gvv = DvR.dot(DvR)\n guv = DuR.dot(DvR)\n g = sym.Matrix([\n [guu, guv],\n [guv, gvv]]\n )\n ... | [
"0.59448457",
"0.5505048",
"0.5339323",
"0.53136337",
"0.5268105",
"0.5256732",
"0.5247485",
"0.5242723",
"0.5208503",
"0.51987815",
"0.51987815",
"0.5192408",
"0.5178703",
"0.5147323",
"0.51411915",
"0.5134776",
"0.5134237",
"0.5126085",
"0.51072735",
"0.50724435",
"0.506371... | 0.0 | -1 |
r""" Construct a Riemannian metric (positive definite symmetric bilinear form) on the free module ``self``. A Riemannian metric of the vector free module ``self`` is actually a field of tangentspace Riemannian metrics along the open subset `U` on which ``self`` is defined. | def riemann_metric(self, name, latex_name=None):
from metric import RiemannMetricParal
return RiemannMetricParal(self, name, latex_name=latex_name) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def riemann_metric(self):\n DuR = sym.diff(self.parameterization, self.u)\n DvR = sym.diff(self.parameterization, self.v)\n guu = DuR.dot(DuR)\n gvv = DvR.dot(DvR)\n guv = DuR.dot(DvR)\n g = sym.Matrix([\n [guu, guv],\n [guv, gvv]]\n )\n ... | [
"0.661193",
"0.59994423",
"0.55386615",
"0.5496446",
"0.5409693",
"0.5287807",
"0.5231626",
"0.52016103",
"0.5160118",
"0.51503515",
"0.51465595",
"0.51384765",
"0.5127094",
"0.5103472",
"0.5072443",
"0.5026723",
"0.5013023",
"0.4994565",
"0.49708998",
"0.4965452",
"0.4964141... | 0.5373281 | 5 |
r""" Construct a Lorentzian metric (symmetric bilinear form of signature (,+,...,+) or (+,,...,)) on the free module ``self``. A Lorentzian metric of the vector free module ``self`` is actually a field of tangentspace Lorentzian metrics along the open subset `U` on which ``self`` is defined. | def lorentz_metric(self, name, signature='positive', latex_name=None):
from metric import LorentzMetricParal
return LorentzMetricParal(self, name, signature=signature,
latex_name=latex_name) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def lvec(self):\n lv = ROOT.TLorentzVector()\n lv.SetPtEtaPhiM(self.pt, self.eta, self.phi, self.mass)\n return lv",
"def compute_L_matrix(self):\n self.L = np.diag(self.z) - self.K\n logg.info('compute graph Laplacian')",
"def lorentz_metric(self, name, signature='positive', latex_name=... | [
"0.60356754",
"0.57791686",
"0.5760955",
"0.55601794",
"0.5498341",
"0.5481095",
"0.54534507",
"0.5426166",
"0.5417829",
"0.54025376",
"0.5386637",
"0.5361586",
"0.5360794",
"0.5354428",
"0.5354428",
"0.52934086",
"0.52444315",
"0.52340376",
"0.5225331",
"0.52225614",
"0.5221... | 0.5645441 | 3 |
Instantiate the CoAdd2d subclass appropriate for the provided spectrograph. The class must be subclassed this class CoAdd2d. | def get_instance(cls, spec2dfiles, spectrograph, par, det=1, offsets=None, weights='auto', sn_smooth_npix=None,
ir_redux=False, master_dir=None, show=False, show_peaks=False, debug_offsets=False, debug=False, **kwargs_wave):
return next(c for c in cls.__subclasses__() if c.__name__ == spec... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __init__(self, objectX, objectY):\n gripper_shape.__init__(self)\n self.initGrasp2DParameters()\n self.initGrasp2DTolerances()\n self.initGrasp2DVariables()\n self.initObject2D(objectX, objectY)",
"def __init__(self, *args, **kwargs):\n _core_.Rect2D_swiginit(self,_c... | [
"0.54008436",
"0.53310144",
"0.52642393",
"0.5238398",
"0.5230801",
"0.5183634",
"0.5182832",
"0.51548034",
"0.51200324",
"0.50998026",
"0.5055282",
"0.5054122",
"0.50287443",
"0.49514928",
"0.4944553",
"0.4944191",
"0.49381775",
"0.4931235",
"0.49217868",
"0.4899995",
"0.489... | 0.5502619 | 0 |
API to call the SetMaxSpeedSrv service to set the throttle scale in the followtheleader mode. | def max_ftl_speed():
webserver_node = webserver_publisher_node.get_webserver_node()
ftl_speed = request.json.get("throttle")
if ftl_speed is None:
return jsonify({"success": False, "reason": "value must be set."})
webserver_node.get_logger().info(f"Setting max ftl speed to {ftl_speed}%")
try... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_maximum_allowed_speed(self, maximum_allowed_speed):\n\n self.maximum_allowed_speed = maximum_allowed_speed",
"def set_max_speed(self, max_speed):\r\n\r\n speed = self.get_speed()\r\n\r\n if max_speed < speed:\r\n raise TrafficObjectsError(f\"Cannot change maximum speed of ... | [
"0.6639381",
"0.6638691",
"0.6580493",
"0.6469392",
"0.6462205",
"0.6343949",
"0.627594",
"0.61450416",
"0.6100401",
"0.5881872",
"0.5833824",
"0.56957525",
"0.5659593",
"0.5659593",
"0.5651612",
"0.5587567",
"0.5571862",
"0.55681485",
"0.5552358",
"0.55521184",
"0.55444014",... | 0.7622748 | 0 |
API to call the GetCtrlModesCountSrv service to get the list of available modes in ctrl_pkg (autonomous/manual/calibration/followtheleader). | def control_modes_available():
webserver_node = webserver_publisher_node.get_webserver_node()
webserver_node.get_logger().info("Providing the number of available modes")
try:
get_ctrl_modes_req = GetCtrlModesSrv.Request()
get_ctrl_modes_res = call_service_sync(webserver_node.get_ctrl_modes_c... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def num_modes(self) -> int:\n return self._num_modes",
"def getControlModes(self, *args):\n return _yarp.IControlMode_getControlModes(self, *args)",
"def availablemodes(self):\n # According to https://nmap.org/npcap/guide/npcap-devguide.html#npcap-feature-dot11\n self._check_npcap_r... | [
"0.6286799",
"0.6014024",
"0.59591544",
"0.5670153",
"0.5650298",
"0.5646989",
"0.5640056",
"0.5589605",
"0.5441252",
"0.5384203",
"0.5293211",
"0.52382773",
"0.5202983",
"0.51492274",
"0.51429677",
"0.51422626",
"0.51123214",
"0.5090486",
"0.5054606",
"0.5025581",
"0.5018257... | 0.7647325 | 0 |
Returns distance from origin to destination. | def get_distance(origin, destination):
return hypot(destination[0] - origin[0],
destination[1] - origin[1]) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def distance(origin, destination):\n lat1, lon1 = origin\n lat2, lon2 = destination\n radius = 3959 # change radius value to 6371 for distance in kilometer.\n # Note: some algorithms use radious = 3956 or 6367 for mile or kilometer, respectively.\n dlat = math.radians(lat2 - lat... | [
"0.7780107",
"0.77256304",
"0.77256304",
"0.77179945",
"0.76999414",
"0.76580215",
"0.7636939",
"0.75576115",
"0.7540429",
"0.75347507",
"0.7508055",
"0.7497578",
"0.74585503",
"0.7321116",
"0.7308905",
"0.7266133",
"0.7210723",
"0.7189661",
"0.7183543",
"0.71551156",
"0.7125... | 0.8232102 | 0 |
Calculate the great circle distance between two points on the earth (specified in decimal degrees) | def haversine_m(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))
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def great_circle_distance(latitudes1: float, longitudes1: float, latitudes2: float, longitudes2: float) -> float:\n dlat = math.radians(latitudes1 - latitudes2)\n dlon = math.radians(longitudes1 - longitudes2)\n alat = math.radians((latitudes1 + latitudes2) / 2)\n R = 3958.8\n x = dlon * math.cos(al... | [
"0.8263672",
"0.79028153",
"0.76523226",
"0.7635832",
"0.7599059",
"0.75452703",
"0.75348586",
"0.7534801",
"0.7523721",
"0.7497239",
"0.74971086",
"0.7460991",
"0.7404893",
"0.73632264",
"0.7353057",
"0.7325208",
"0.73241794",
"0.72988456",
"0.72679293",
"0.7267184",
"0.7219... | 0.0 | -1 |
Test if TEST_SETTING exists. | def test_ensure_correct_settings():
assert settings.TEST_SETTING == 1 | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_get_settings(self):\n assert get_settings() == TEST_SETTINGS[\"settings\"]",
"def test_get_required_settings_fail(self):\n with self.assertRaises(UManageRequiredSettingImproperlyConfigured):\n val = get_required_setting(settings_key='NON_EXISTENT_SETTING')\n self.asse... | [
"0.71002764",
"0.7018419",
"0.67761",
"0.6498034",
"0.64888984",
"0.6450482",
"0.6445502",
"0.6343929",
"0.6302792",
"0.6282954",
"0.6282954",
"0.62466663",
"0.6212359",
"0.61492467",
"0.61389285",
"0.6119689",
"0.610557",
"0.6072328",
"0.6064302",
"0.6059112",
"0.6050122",
... | 0.74936754 | 0 |
Application factory, used to create application | def create_app(testing=False):
app = Flask("words")
app.config.from_object("words.config")
if testing is True:
app.config["TESTING"] = True
configure_logger(app)
register_blueprints(app)
return app | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create():\n\n return Application()",
"def app():\n return create_app()",
"def create_app(self):\n LOGGER.debug(\"Creating app!\")\n settings = self.intitilaize_app_settings()\n self.app_ctx.settings.update(settings)\n return anthem.Application(self.app_ctx.routes, self.ini... | [
"0.81004506",
"0.7932944",
"0.7850502",
"0.7824781",
"0.7697589",
"0.7663159",
"0.7622159",
"0.7591339",
"0.758002",
"0.756651",
"0.7563479",
"0.7563209",
"0.7557125",
"0.7538036",
"0.75213856",
"0.7484795",
"0.7459619",
"0.7426593",
"0.7416367",
"0.7399107",
"0.73926836",
... | 0.69491535 | 66 |
r"""Determine the suffix that should be used for the comm name. | def determine_suffix(no_suffix=False, reverse_names=False,
direction='send', **kwargs):
if direction not in ['send', 'recv']:
raise ValueError("Unrecognized message direction: %s" % direction)
if no_suffix:
suffix = ''
else:
if ((((direction == 'send') and (not r... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def suffix(self):\n\t\tk = max(0, self.name.rfind('.'))\n\t\treturn self.name[k:]",
"def suffix(self):\n # grab my name\n name = self.name\n # look for the last '.'\n pos = name.rfind(\".\")\n # if not there\n if pos == -1:\n # we have nothing\n ret... | [
"0.77082646",
"0.7519874",
"0.7305485",
"0.7055785",
"0.70486736",
"0.6896587",
"0.6868892",
"0.67658275",
"0.6753439",
"0.67312825",
"0.66372997",
"0.65902615",
"0.65458447",
"0.64981204",
"0.6491432",
"0.6491008",
"0.6480235",
"0.6479846",
"0.6434269",
"0.6352778",
"0.63283... | 0.6554383 | 12 |
Tests whether the answer (first index content) of the method "anomaly_identifier" returns True or False correctly. | def test_boolean(self):
self.assertTrue(anomaly_identifier(1899, 1901)[0])
self.assertTrue(anomaly_identifier(1800, 1899)[0])
self.assertTrue(anomaly_identifier(1900, 1999)[0])
self.assertTrue(anomaly_identifier(1900, 2000)[0])
self.assertTrue(anomaly_identifier(1901, 2100)[... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __is_anomaly(self):\n return True if self.timeseries[\"anomaly\"][self.cursor] == 1 else False",
"def has_anomaly(args):\n return any(has_value(args, [\"anomaly\", \"anomalies\", \"anomaly_tag\",\n \"anomaly_file\"]))",
"def anomaly(self):\n return self._test(res... | [
"0.75680864",
"0.70000994",
"0.64279044",
"0.6420827",
"0.60195124",
"0.6018352",
"0.60005957",
"0.59248346",
"0.5779692",
"0.56884265",
"0.5617684",
"0.55958647",
"0.5569665",
"0.55095917",
"0.5503093",
"0.5482419",
"0.54608464",
"0.54463094",
"0.54058886",
"0.5399519",
"0.5... | 0.79149777 | 0 |
Tests whether the array "anomalies" (second index content) of the method "anomaly_identifier" returns its content correctly. | def test_values(self):
self.assertListEqual(anomaly_identifier(1899, 1920)[1], [1900])
self.assertListEqual(anomaly_identifier(1800, 1899)[1], [1800])
self.assertListEqual(anomaly_identifier(1900, 2000)[1], [1900])
self.assertListEqual(anomaly_identifier(2000, 2099)[1], [])
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __is_anomaly(self):\n return True if self.timeseries[\"anomaly\"][self.cursor] == 1 else False",
"def has_anomaly(args):\n return any(has_value(args, [\"anomaly\", \"anomalies\", \"anomaly_tag\",\n \"anomaly_file\"]))",
"def test_boolean(self):\r\n self.asser... | [
"0.7004783",
"0.69692564",
"0.6732708",
"0.6582879",
"0.6182017",
"0.6179266",
"0.60742086",
"0.58863527",
"0.58583784",
"0.58215094",
"0.56397176",
"0.55602795",
"0.548375",
"0.5464583",
"0.5373588",
"0.5331398",
"0.53033453",
"0.5290048",
"0.52590084",
"0.52556765",
"0.5240... | 0.7070981 | 0 |
Transform this into something readable | def format_join_paths(self, join_paths):
formatted_jps = []
for jp in join_paths:
formatted_jp = ""
for hop in jp:
hop_str = hop.db_name + "." + hop.source_name + "." + hop.field_name
if formatted_jp == "":
formatted_jp += hop_s... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __str__(self):\n return self.prettyprint(0)",
"def serialize(self):\n return str(self)",
"def to_str(self):\n return pprint.pformat(self.to_dict())",
"def to_str(self):\n return pprint.pformat(self.to_dict())",
"def to_str(self):\n return pprint.pformat(self.to_dict()... | [
"0.69783604",
"0.68881893",
"0.677817",
"0.677817",
"0.677817",
"0.677817",
"0.677817",
"0.677817",
"0.677817",
"0.677817",
"0.677817",
"0.677817",
"0.677817",
"0.677817",
"0.677817",
"0.677817",
"0.677817",
"0.677817",
"0.677817",
"0.677817",
"0.677817",
"0.677817",
"0.6... | 0.0 | -1 |
GET /api/strex/merchants/{merchantId} Gets a merchant. | def get_strex_merchant(self, merchant_id):
if merchant_id is None:
raise ValueError("merchantId")
response = self.client.get(self.STREX_MERCHANTS + "/" + merchant_id)
if response.status_code == self.NOT_FOUND:
return None
response.raise_for_status()
re... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_strex_merchants(self):\n response = self.client.get(self.STREX_MERCHANTS)\n response.raise_for_status()\n return StrexMerchant.from_list(response.json())",
"def test_merchant_get_1(self):\n admin.set_wallet_amount(balance=bl(0.000012), currency='BTC', merch_lid=user1.merchant1... | [
"0.6909604",
"0.65834546",
"0.63195914",
"0.63107747",
"0.61423796",
"0.6045613",
"0.59831244",
"0.5705242",
"0.55625165",
"0.5562358",
"0.5562358",
"0.5562358",
"0.5562358",
"0.546226",
"0.5388339",
"0.5316002",
"0.52436864",
"0.52210927",
"0.5184425",
"0.51661164",
"0.51609... | 0.77545846 | 0 |
DELETE /api/strex/merchants/{merchantId} Deletes a merchant | def delete_strex_merchant(self, merchant_id):
if merchant_id is None:
raise ValueError("merchantId")
response = self.client.delete(self.STREX_MERCHANTS + "/" + merchant_id)
response.raise_for_status() | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_merchant_create_7(self, _delete_merchant):\n user1.merchant(method='create', params={'title': 'Title', 'payway': 'visamc'})\n admin.params['lid'] = user1.resp_merchant['lid']\n user1.merchant(method='create', params={'title': 'Title1', 'payway': 'visamc'})\n assert user1.resp_m... | [
"0.67673045",
"0.642436",
"0.6404168",
"0.63779366",
"0.6238552",
"0.6226238",
"0.61877364",
"0.58733606",
"0.5848194",
"0.5817667",
"0.5786447",
"0.5745693",
"0.57201326",
"0.57155585",
"0.5705184",
"0.5695621",
"0.5687317",
"0.56408626",
"0.5626956",
"0.5599225",
"0.5565769... | 0.819716 | 0 |
Returns the average accuracy of predictions for classification. | def compute_multiclass_accuracy(pred_y: torch.Tensor, true_y: torch.Tensor) -> float:
label_predictions = pred_y.argmax(dim=1)
prediction_matches = (label_predictions == true_y)
proportion_correct = prediction_matches.sum().float() / float(true_y.size(0))
return proportion_correct | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def accuracy(self,y_true,y_pred):\n \n acc = y_true[:,0].todense() == y_pred[:,0].todense()\n \n return np.average(acc)",
"def predictions_accuracy(class_keys, label, predictions):\n\n # number of correct predictions\n correct_predictions = 0\n\n # number of predictions made\n n_predictio... | [
"0.7992041",
"0.79880387",
"0.7873662",
"0.7809693",
"0.7798213",
"0.7782176",
"0.7682911",
"0.76794356",
"0.7649361",
"0.7638357",
"0.75877327",
"0.75779873",
"0.7577771",
"0.75761414",
"0.75673234",
"0.7560502",
"0.75558466",
"0.7532059",
"0.75282484",
"0.7495706",
"0.74934... | 0.0 | -1 |
Takes the time in a datetime format and transforms into an interval of elapsed seconds | def process_time(self):
start_time = self.t_traj[0]
new_time = []
for x in self.t_traj:
new_time.append((x - start_time).seconds)
self.t_traj = new_time | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def interval_seconds():\n return int(interval_to_milliseconds(interval())/1000)",
"def convert_time_to_secs(input_time):\n hours = input_time[:2]\n minutes = input_time[2:4]\n second = input_time[4:]\n\n hours = int(hours) * 60 * 60\n minutes = int(minutes) * 60\n second = float(second)\n\n ... | [
"0.66853917",
"0.65921134",
"0.64933956",
"0.6460057",
"0.64351386",
"0.64199656",
"0.63874483",
"0.63684344",
"0.6324232",
"0.6229621",
"0.6175686",
"0.6145945",
"0.6135317",
"0.61258525",
"0.61258525",
"0.61177033",
"0.61040395",
"0.60849196",
"0.6063272",
"0.6013926",
"0.6... | 0.59530145 | 26 |
Get all blocklocal scopes from an IR. | def _get_all_scopes(blocks):
all_scopes = []
for label, block in blocks.items():
if not (block.scope in all_scopes):
all_scopes.append(block.scope)
return all_scopes | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __find_localized_variables(self, scope = None)-> list:\n if(scope == None):\n scope = self.__scopeObject\n variables = self.__get_local_scope()\n\n ptr = scope.get_parent()\n while not ptr.is_root():\n ptr = ptr.get_parent()\n for child in ptr.get_childr... | [
"0.61622685",
"0.6024569",
"0.5972585",
"0.5948479",
"0.5889317",
"0.5883051",
"0.58759844",
"0.5806191",
"0.5768491",
"0.55590576",
"0.5503255",
"0.5495565",
"0.5489782",
"0.5487581",
"0.5448251",
"0.54286975",
"0.53691936",
"0.53644586",
"0.5356073",
"0.52742505",
"0.526637... | 0.6952449 | 0 |
Read dependencies from file and strip off version numbers. | def parse_requirements(requirements):
ignored = ('#', 'setuptools', '-r', '--')
with open(requirements) as f:
packages = []
for line in f:
line = line.strip()
if any(line.startswith(prefix) for prefix in ignored):
continue
if '#egg=' in line:
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def read_requirements(filename):\n with open(os.path.abspath(filename)) as fp:\n deps = [line.strip() for line in fp.readlines()]\n return deps",
"def parse_requirements(filename):\n with open(filename, 'r') as f:\n lineiter = list(line.strip() for line in f)\n return [line for line in ... | [
"0.67042965",
"0.6530732",
"0.6518116",
"0.64858866",
"0.64858866",
"0.64858866",
"0.64858866",
"0.64858556",
"0.6348607",
"0.6076013",
"0.6032778",
"0.5952321",
"0.5945858",
"0.59421575",
"0.5917163",
"0.58586854",
"0.5812678",
"0.579448",
"0.57849354",
"0.5764596",
"0.57113... | 0.5522157 | 31 |
Remove the record from the database. | def delete(self, commit=True):
db.session.delete(self)
return commit and db.session.commit() | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def remove_from_db(self):\n db.session.delete(self)\n db.session.commit()",
"def remove(self):\n Log.debug('Removing %s object from database.' % self.__name__)\n cursor = Database.db_connection.cursor()\n table = self.__name__\n sql = \"DELETE FROM \" + table + \"\"\"\n ... | [
"0.7985755",
"0.7903082",
"0.77996916",
"0.7682039",
"0.7621306",
"0.75356936",
"0.7475578",
"0.7472646",
"0.7440853",
"0.7440853",
"0.7409911",
"0.7352505",
"0.7334971",
"0.73248637",
"0.73248637",
"0.73248637",
"0.73248637",
"0.73248637",
"0.73248637",
"0.73248637",
"0.7324... | 0.65629745 | 75 |
Return a random float in [0,1). | def random():
return random.random() | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _random_float(self):\n return random.uniform(1, 2)",
"def generate_float(self):\n\n value = random()\n return value",
"def getRandomFloat(minFloat, maxFloat):\n random.uniform(minFloat, maxFloat)",
"def _rand_float(self, low, high):\n\n return self.np_random.uniform... | [
"0.8799668",
"0.8547226",
"0.78165835",
"0.7710812",
"0.7681101",
"0.75358117",
"0.7511317",
"0.7252717",
"0.7244983",
"0.7176249",
"0.70872253",
"0.69040006",
"0.687193",
"0.68525296",
"0.68343365",
"0.6813189",
"0.67180496",
"0.6702492",
"0.6702428",
"0.66855794",
"0.667351... | 0.6344951 | 32 |
Return a (sorted) list of keys for the given dictionary. | def keys(arg):
return sorted(list(arg.keys())) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_dictionary_keys(self, dictionary, sort_keys=True):\n self._validate_dictionary(dictionary)\n keys = dictionary.keys()\n if sort_keys:\n try:\n return sorted(keys)\n except TypeError:\n pass\n return list(keys)",
"def key_list... | [
"0.8214822",
"0.80759174",
"0.7589989",
"0.7445301",
"0.73666894",
"0.7205907",
"0.7182462",
"0.71818024",
"0.7166585",
"0.71316177",
"0.7026012",
"0.69830513",
"0.69458985",
"0.6824333",
"0.6796844",
"0.6743734",
"0.6684981",
"0.66323286",
"0.66264045",
"0.66069454",
"0.6537... | 0.7176842 | 8 |
convert administrative time to solar time | def get_solar_time(self, datetime: Datetime):
thetimezone = timezone(self.time_zone)
local_datetime = thetimezone.localize(datetime, is_dst=True)
utc_datetime = local_datetime.astimezone(utc)
utc_timetuple = utc_datetime.timetuple()
day_in_year = utc_timetuple.tm_yday
hou... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __convert_time(self, time):\n game_time_eastern = datetime.strptime(time, '%I:%M%p')\n now = datetime.now()\n game_time_eastern = game_time_eastern.replace(year=now.year, month=now.month, day=now.day)\n eastern_tz = pytz.timezone('America/New_York')\n game_time_eastern = eastern_tz.localize(game... | [
"0.7563802",
"0.63635945",
"0.62204236",
"0.6138212",
"0.6137449",
"0.60738355",
"0.60489357",
"0.5990815",
"0.5962197",
"0.5950101",
"0.5898017",
"0.5886734",
"0.5879567",
"0.58649325",
"0.5851432",
"0.5809954",
"0.5792565",
"0.5762289",
"0.57368714",
"0.5704536",
"0.5676301... | 0.5380879 | 51 |
Follower follows a followee. If the operation is invalid, it should be a noop. | def follow(self, followerId, followeeId):
if followerId != followeeId:
self.__followings[followerId].add(followeeId) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def follow(self, followerId, followeeId):\n if followerId not in self.users:\n self.register(followerId)\n if followeeId not in self.users:\n self.register(followeeId)\n self.users[followerId].follow(followeeId)",
"def follow(self, followerId, followeeId):\n\n if... | [
"0.7269683",
"0.7151967",
"0.71303874",
"0.70974857",
"0.7070574",
"0.7043851",
"0.70253617",
"0.7019772",
"0.69339794",
"0.6898703",
"0.6875606",
"0.68697447",
"0.6822195",
"0.68115675",
"0.6808106",
"0.674612",
"0.67102647",
"0.66951114",
"0.6657208",
"0.6653234",
"0.664905... | 0.7055084 | 5 |
Follower unfollows a followee. If the operation is invalid, it should be a noop. | def unfollow(self, followerId, followeeId):
self.__followings[followerId].discard(followeeId) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def unfollow(self, followerId, followeeId):\n if followerId in self.users:\n self.users[followerId].unfollow(followeeId)",
"def unfollow(self, followerId, followeeId):\n\n self.follows[followerId].discard(followeeId)",
"def unfollow(self, followerId: int, followeeId: int) -> None:\n ... | [
"0.78562003",
"0.75531954",
"0.755092",
"0.75331557",
"0.75160086",
"0.75132805",
"0.7386462",
"0.7352773",
"0.73278356",
"0.72904253",
"0.72654843",
"0.7222541",
"0.71775186",
"0.7134154",
"0.70684725",
"0.70120126",
"0.7002578",
"0.69955117",
"0.6948026",
"0.6919664",
"0.68... | 0.7487008 | 6 |
Returns the string representation of the model | def to_str(self):
return pprint.pformat(self.to_dict()) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _repr_model_(self):\n return str(self)",
"def __str__(self):\n\n return str(self.model)",
"def get_model_string(self):\n raise NotImplementedError()",
"def __str__(self):\n return self.model",
"def serialize_model(self):\n return dill.dumps(self.model)",
"def __str_... | [
"0.8602374",
"0.85093755",
"0.8237104",
"0.8050309",
"0.80128866",
"0.79348034",
"0.78766525",
"0.77898884",
"0.7786461",
"0.7745792",
"0.7627315",
"0.76055235",
"0.757999",
"0.7514394",
"0.75038797",
"0.75035286",
"0.74850684",
"0.7440529",
"0.74325883",
"0.74239755",
"0.740... | 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 return not self == other",
"def __ne__(self, other: object) -> bool:\n return not self.__eq__(other)",
"def __ne__(self, other):\n return self.__dict__ != other.__dict__",
"def __eq__(self, other):\n return not self.__ne__(other)",
... | [
"0.8411268",
"0.83923674",
"0.81723326",
"0.81407183",
"0.8092415",
"0.8089446",
"0.8067915"
] | 0.0 | -1 |
Return the cosine of ``x``. | def cos(x: Any) -> Any:
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def cos(x:int)->float:\n return math.cos(x)",
"def cos(x):\n return CosOp(x)",
"def cos(x, name=None):\n result = _op_def_lib.apply_op(\"Cos\", x=x, name=name)\n return result",
"def cosd(x):\r\n return cos(x * pi / 180)",
"def cos(x):\n try:\n return ad.AD(np.cos(x.val), -x.der*np.sin... | [
"0.7835061",
"0.7748053",
"0.7657093",
"0.76320595",
"0.76139253",
"0.754826",
"0.7243877",
"0.71780235",
"0.7175515",
"0.71400183",
"0.7052349",
"0.69860977",
"0.69511425",
"0.69092757",
"0.69063354",
"0.68390924",
"0.67879975",
"0.6771874",
"0.66812354",
"0.6664244",
"0.658... | 0.6483755 | 22 |
Return the exponential of ``x``. | def exp(x: Any) -> Any:
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def exp(x):\n return np.e**x",
"def exponential(x):\n return K.exp(x)",
"def exp(x):\r\n\r\n return math.exp(x)",
"def convert_to_exp(x):\n return np.exp(x)",
"def exp(x):\n return _func(\"exp\", TFloat64(), x)",
"def exp(x):\n try:\n return ad.AD(np.exp(x.val), np.exp(x.val)*x... | [
"0.8639053",
"0.85429996",
"0.8537212",
"0.7993477",
"0.7819242",
"0.78060424",
"0.77802795",
"0.7775478",
"0.75139314",
"0.7412973",
"0.7397649",
"0.73822117",
"0.73312664",
"0.7303653",
"0.7297296",
"0.72939223",
"0.72896475",
"0.7236309",
"0.7205402",
"0.7185118",
"0.71818... | 0.6571352 | 41 |
Decomposes a floatingpoint number into its mantissa and exponent. The returned value is the tuple ``(m, e)`` such that ``x == m 2e`` exactly. If ``x == 0`` then the function returns ``(0.0, 0)``, otherwise the relation ``0.5 <= abs(m) < 1`` holds. | def frexp(x: Any) -> Any:
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def frexp(x):\n try:\n return _np.frexp(x)\n except (TypeError, NameError):\n pass\n b = 0\n a = 0.0\n correct = False\n if x == 0:\n correct = True # if x is 0, we're done\n while not correct:\n p = pow(2, b) # 2**b for b=hopeful number\n a = x / p # get ... | [
"0.6103471",
"0.5867568",
"0.57595545",
"0.56418014",
"0.5477191",
"0.54751617",
"0.54660296",
"0.5408408",
"0.54039717",
"0.538719",
"0.5374955",
"0.53720313",
"0.5360674",
"0.53468937",
"0.5338613",
"0.5324361",
"0.5294122",
"0.5229385",
"0.52214533",
"0.5209055",
"0.519934... | 0.0 | -1 |
Return ``True`` if ``x`` is finite. | def isfinite(x: Any) -> Any:
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def is_finite(x, name=None):\n result = _op_def_lib.apply_op(\"IsFinite\", x=x, name=name)\n return result",
"def isfinite(x: _cpp.Variable) -> _cpp.Variable:\n return _call_cpp_func(_cpp.isfinite, x)",
"def isfinite(self):\n return True",
"def is_finite(self):\n return True",
"def IsFin... | [
"0.79749674",
"0.7606107",
"0.74733037",
"0.7447026",
"0.7433597",
"0.73599803",
"0.7346417",
"0.7325023",
"0.73031014",
"0.7288712",
"0.724081",
"0.72072417",
"0.71905696",
"0.7172163",
"0.7148966",
"0.7041427",
"0.703512",
"0.6994729",
"0.6976629",
"0.69644946",
"0.6942773"... | 0.7243765 | 10 |
Return ``True`` if ``x`` is infinite. | def isinf(x: Any) -> Any:
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def isinf(x):\n from amath.DataTypes.Infinity import Infinity\n if isinstance(x, Infinity):\n return True\n elif x == float(\"inf\"):\n return True\n elif x == float(\"-inf\"):\n return True\n else:\n return False",
"def isfinite(x: _cpp.Variable) -> _cpp.Variable:\n ... | [
"0.74145806",
"0.73662955",
"0.7299472",
"0.72597265",
"0.71419716",
"0.70885134",
"0.70519257",
"0.7032862",
"0.7022658",
"0.7018184",
"0.6910389",
"0.6806098",
"0.67708206",
"0.67643607",
"0.67175776",
"0.6683246",
"0.6662981",
"0.6655297",
"0.6624504",
"0.65779513",
"0.655... | 0.65080434 | 21 |
Computes the D, H, W min and max values defining the content bounding box. | def extract_content_bounding_box_from(nd_array):
depth_slices = np.any(nd_array, axis=(2, 3))
height_slices = np.any(nd_array, axis=(1, 3))
width_slices = np.any(nd_array, axis=(1, 2))
d_min, d_max = np.where(depth_slices)[1][[0, -1]]
h_min, h_max = np.where(height_slice... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def calculate_bounding_box(data):\n mins = data.min(0)\n maxes = data.max(0)\n return mins, maxes",
"def _get_bounding_box_values(self, bbox, img_width, img_height):\n xmin, ymin, wbox, hbox = np.array(bbox, dtype='float32')\n \n #make sure not bigger than the image\n xmin = ... | [
"0.727007",
"0.69020915",
"0.68140024",
"0.6813356",
"0.6707633",
"0.66443694",
"0.660932",
"0.6557524",
"0.65471506",
"0.65283215",
"0.65250325",
"0.65024585",
"0.6485001",
"0.6466116",
"0.6465205",
"0.6463616",
"0.64388615",
"0.6429016",
"0.64162576",
"0.6415206",
"0.640157... | 0.6256592 | 31 |
Attention mechanism layer which reduces RNN/BiRNN outputs with Attention vector. | def attention(inputs, attention_size):
inputs = tf.transpose(inputs, [1, 0, 2])
hidden_size = params.HIDDEN_LAYERS
# Trainable parameters
W_omega = tf.Variable(tf.random_normal([hidden_size, attention_size], stddev=0.1))
b_omega = tf.Variable(tf.random_normal([attention_size], stddev=0.1)... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _attention(self, inputs):\n attn_weights = K.batch_dot(x=inputs[0],\n y=K.permute_dimensions(inputs[1],\n pattern=(0, 2, 1)))\n return K.permute_dimensions(attn_weights, (0, 2, 1))",
"def channelAttention... | [
"0.6633888",
"0.6452287",
"0.6423571",
"0.6411931",
"0.633581",
"0.63067734",
"0.6302142",
"0.62922156",
"0.6261395",
"0.62503654",
"0.6217345",
"0.6194495",
"0.61914045",
"0.6187951",
"0.6180062",
"0.61345506",
"0.60938966",
"0.6085517",
"0.6076007",
"0.6035994",
"0.6022079"... | 0.62507874 | 9 |
Calculate the maximum amount of bytes that can be in a body frame. | def _get_body_frame_max_length(self):
return (self.cp.frame_max -
spec.FRAME_HEADER_SIZE -
spec.FRAME_END_SIZE) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _get_body_frame_max_length(self):\r\n return (self.params.frame_max -\r\n spec.FRAME_HEADER_SIZE -\r\n spec.FRAME_END_SIZE)",
"def get_body_length(self):\n return self.__body_length",
"def _buffer_size(self):\r\n return self.params.frame_max or spec.FRAME_... | [
"0.8549918",
"0.7208294",
"0.71261233",
"0.71097046",
"0.703946",
"0.6876431",
"0.67387366",
"0.67387366",
"0.67387366",
"0.67387366",
"0.67387366",
"0.67387366",
"0.67304933",
"0.6725264",
"0.67155546",
"0.67110854",
"0.6710725",
"0.6700894",
"0.6638729",
"0.6593582",
"0.656... | 0.8610563 | 0 |
POSTend point. Accepts image as "image" parameter in form data. | def post(self):
parser = reqparse.RequestParser()
parser.add_argument('image', type=werkzeug.datastructures.FileStorage,
location='files',
required=True,
help="Image is required")
args = parser.parse_args()
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def post_image():\r\n\r\n f = flask.request.files.get('file')\r\n filename, ext = os.path.splitext(f.filename)\r\n if not f or f.filename == '' or ext != '.jpg':\r\n flask.abort(400)\r\n\r\n filehash = Hashids(app.config['SECRET_KEY']).encode(int(time()))\r\n f.save(os.path.join(app.config['U... | [
"0.7718662",
"0.7498726",
"0.7298089",
"0.71785146",
"0.6974314",
"0.6925092",
"0.6835644",
"0.6759358",
"0.6741063",
"0.67312604",
"0.67181164",
"0.6662796",
"0.6660105",
"0.661508",
"0.65436006",
"0.6520931",
"0.6507559",
"0.6478503",
"0.6407553",
"0.63658464",
"0.6275765",... | 0.0 | -1 |
This function returns a Pyramid WSGI application. | def main(global_config, **settings):
engine = engine_from_config(settings, 'sqlalchemy.')
initialize_sql(engine)
config = Configurator(settings=settings)
config.include('pyramid_jinja2')
config.add_static_view('static', 'dmozsearch:static', cache_max_age=3600)
config.add_route('home', '/')
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def wsgi_app():\n return bottle.default_app()",
"def app():\n return create_app()",
"def app():\n app = server.app\n return app",
"def make_app():\n config = Configurator()\n config.add_renderer('.jinja2', pyramid_jinja2.Jinja2Renderer)\n config.add_route('root_view', '/')\n\n config.... | [
"0.7845448",
"0.77049613",
"0.7673193",
"0.7536037",
"0.7503258",
"0.73890936",
"0.7384288",
"0.73103803",
"0.72841936",
"0.7276823",
"0.7249291",
"0.7245736",
"0.7243444",
"0.7225791",
"0.7212354",
"0.7212105",
"0.7182324",
"0.71565676",
"0.71322274",
"0.7112378",
"0.7096177... | 0.0 | -1 |
Constructor for the LAMB optimizer. | def __init__(self, learning_rate=None, beta1=0.9, beta2=0.999, weight_decay=0,
eps=1e-6):
hyper_params = _LAMBHyperParams(
learning_rate, beta1, beta2, weight_decay, eps)
super().__init__(hyper_params) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __init__(self, X, Y, LAMBDA, BURNIN, NITER, NITER_cd, sigma2=1, T_0=1, T_n=0.01, thresh_low=0.2, gig_seed=1423):\n assert(len(Y.shape) == 1)\n assert(X.shape[0] == Y.shape[0])\n assert(LAMBDA >= 0)\n assert(NITER > 0 and NITER_cd > 0 and T_n > 0 and T_0 >\n 0 and thres... | [
"0.6685766",
"0.6394979",
"0.62218183",
"0.62218183",
"0.61511576",
"0.61511576",
"0.61511576",
"0.6089581",
"0.6036867",
"0.6025387",
"0.59975195",
"0.59866685",
"0.5976164",
"0.5947352",
"0.5882031",
"0.58757764",
"0.58133334",
"0.58092546",
"0.5809063",
"0.5807184",
"0.579... | 0.6010859 | 10 |
Setting slug field to autogenerate and make unique each time even if title is same title as another book it will add int at end if needed | def set_slug(self):
if self.slug:
return
base_slug = slugify(self.name)
# Local variable slug below
slug = base_slug
n = 0
# While the field slug is already in DB and equal to new local slug, run this loop, else return the slug name without an int at end
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_slug(self):\n if self.slug:\n return\n base_slug = slugify(self.title)\n # Local variable slug below\n slug = base_slug\n n = 0\n # While the field slug is already in DB and equal to new local slug, run this loop, else return the slug name without an int... | [
"0.8043846",
"0.7552098",
"0.75427306",
"0.72828186",
"0.72278243",
"0.72257847",
"0.7167802",
"0.71624553",
"0.71078885",
"0.7099822",
"0.7076438",
"0.7050972",
"0.7046658",
"0.70269215",
"0.70042473",
"0.69689566",
"0.693808",
"0.69271433",
"0.6897315",
"0.6891283",
"0.6884... | 0.72911525 | 3 |
Setting slug field to autogenerate and make unique each time even if title is same title as another book it will add int at end if needed | def set_slug(self):
if self.slug:
return
base_slug = slugify(self.title)
# Local variable slug below
slug = base_slug
n = 0
# While the field slug is already in DB and equal to new local slug, run this loop, else return the slug name without an int at end
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _create_slug(self):\n # Don't overwrite any existing slugs by default.\n if not self.slug:\n self.slug = slugify(self.title)",
"def create_book_slug(sender, instance, created, **kwargs):\n if created:\n slug = generate_unique_slug(Book, instance.name)\n instance.slug... | [
"0.75503904",
"0.7543788",
"0.7289859",
"0.7281282",
"0.72265583",
"0.7224819",
"0.71662384",
"0.71611017",
"0.710652",
"0.70999086",
"0.70753527",
"0.7050067",
"0.7045154",
"0.70260125",
"0.70032316",
"0.6967508",
"0.69366205",
"0.69262767",
"0.68961656",
"0.68897206",
"0.68... | 0.8043045 | 0 |
Creates an evaluation plot consisting of predicted class boundaries, loss and accuracy. | def eval_plot(x: np.array, y: np.array, enc: nn.Module, clf: nn.Module, loss: dict = {},
metric: dict = {}, prec: float = 0.005, n_epochs: int = None, model_name: str = "",
clf_plot_args: dict = {}, loss_plot_args: dict = {}, metric_plot_args: dict = {}):
#### Figure Set Up ####
wid... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def plot(self):\n \n # Plot training & validation accuracy values\n fig, ax = plt.subplots(1, 2)\n ax[0].plot(self.history.history[\"accuracy\"], label=\"Train\")\n ax[0].plot(self.history.history[\"val_accuracy\"], label=\"Test\")\n ax[0].set_title(\"Model accuracy\")\n ... | [
"0.71465707",
"0.70580107",
"0.70570916",
"0.6983756",
"0.6951553",
"0.69496214",
"0.69333595",
"0.6888311",
"0.6880865",
"0.6874584",
"0.6850588",
"0.6832408",
"0.6805402",
"0.67678577",
"0.6763646",
"0.67177784",
"0.66875464",
"0.6635135",
"0.6618546",
"0.6615864",
"0.66158... | 0.62192065 | 64 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.