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
Render website's home page.
def home(): if not session.get('logged_in'): return redirect(url_for('welcome')) return render_template('home.html', filename="yarg.jpg")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def render_home():\r\n\treturn render_template(\"index.html\")", "def home():\n return render_template('homepage.html')", "def home():\n\n return render_template('home_page.html')", "def homepage():\n return render_template('home/index.html', \n title=\"Bem vindo!\")", "...
[ "0.87248576", "0.85797024", "0.85035866", "0.8486288", "0.84611857", "0.84365207", "0.84302676", "0.841985", "0.8396901", "0.8396901", "0.8375347", "0.8356703", "0.83518267", "0.8341115", "0.8341115", "0.8337803", "0.8337803", "0.8337803", "0.8337803", "0.8337803", "0.8337803...
0.0
-1
Render the website's about page.
def about(): return render_template('about.html', name="COMP3161")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def about():\n return render_template('about.html', title='About')", "def about():\n\n return render_template('about_page.html', title='About')", "def about():\n\n\treturn render_template(\"about.html\")", "def about():\n return render_template(\n 'about.html',\n title='About',\n ...
[ "0.8790411", "0.86976695", "0.86399585", "0.8612098", "0.84899473", "0.84783703", "0.8467333", "0.8434878", "0.8428624", "0.84239376", "0.84239376", "0.84239376", "0.84239376", "0.84239376", "0.84239376", "0.84239376", "0.84239376", "0.84239376", "0.84239376", "0.84239376", "...
0.81502104
44
Add headers to both force latest IE rendering engine or Chrome Frame, and also to cache the rendered page for 10 minutes.
def add_header(response): response.headers['X-UA-Compatible'] = 'IE=Edge,chrome=1' response.headers['Cache-Control'] = 'public, max-age=0' return response
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_header(response):\n response.headers['X-UA-Compatible'] = 'IE=Edge,chrome=1'\n response.headers['Cache-Control'] = 'public, max-age=60'\n return response", "def add_header(response):\n response.headers['X-UA-Compatible'] = 'IE=Edge,chrome=1'\n response.headers['Cache-Control'] = 'public, m...
[ "0.8221727", "0.8220911", "0.8220911", "0.8220911", "0.8220911", "0.81940746", "0.81111443", "0.80852413", "0.79712725", "0.78637785", "0.7659569", "0.72363365", "0.71586627", "0.71513546", "0.71513546", "0.71502376", "0.71502376", "0.7140211", "0.7135492", "0.7126684", "0.71...
0.8161616
32
Calculate the sum of two sparse vectors and return the result in a dictionary format.
def sparse_add(first_vector, second_vector): # Initialize a dictionary sum_vector = {} # Calculate the sum of two vectors for key_1, value_1 in first_vector.items(): for key_2, value_2 in second_vector.items(): if key_1 == key_2 and key_1 not in sum_vector: sum_vector...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def sparse_dot_product(first_vector, second_vector):\n # Initialize a dictionary\n product_vector = {}\n # Calculate the dot product of the two vectors\n for key_1, value_1 in first_vector.items():\n for key_2, value_2 in second_vector.items():\n if key_1 == key_2 and key_1 not in pro...
[ "0.7124283", "0.6889215", "0.6877189", "0.6733175", "0.66905344", "0.65926844", "0.656623", "0.6475533", "0.63227344", "0.62896985", "0.6284968", "0.627809", "0.6272497", "0.62196934", "0.6115688", "0.61068386", "0.60052073", "0.5992203", "0.58445925", "0.5822916", "0.5806268...
0.82106096
0
Calculate the dot product of two sparse vectors
def sparse_dot_product(first_vector, second_vector): # Initialize a dictionary product_vector = {} # Calculate the dot product of the two vectors for key_1, value_1 in first_vector.items(): for key_2, value_2 in second_vector.items(): if key_1 == key_2 and key_1 not in product_vector...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def sparseVectorDotProduct(v1, v2):\n ans = 0\n for index, val in v1.items():\n ans += val * v2[index]\n return ans", "def sparseVectorDotProduct(v1, v2):\n # BEGIN_YOUR_CODE (our solution is 4 lines of code, but don't worry if you deviate from this)\n return sum(v1[k]*v2[k] for k in v1 and...
[ "0.8588016", "0.85827816", "0.8509792", "0.83972394", "0.77708644", "0.7765059", "0.77622986", "0.77348965", "0.7693708", "0.76644546", "0.76425916", "0.7636949", "0.76328236", "0.762522", "0.75976425", "0.7580816", "0.75598097", "0.7550884", "0.7547763", "0.7539679", "0.7525...
0.7924383
4
Adds a name to the Trie
def add(self, name): # no need to add first_name while adding full_name name_list = name.strip().split()[1:] name_list.append(name) for item in set(name_list): node = self.root # check for every char in word, i.e. check whether is it in trie # if yes,...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_contact(trie, name):\n if len(name) > 50:\n print(\"Name cannot be more than 50 characters.\")\n return False\n elif not (\"\".join(name.split())).isalpha():\n print(\"Name can have letters only.\")\n return False\n else:\n trie.add(name)\n return True", ...
[ "0.70509976", "0.69548774", "0.6879298", "0.6813376", "0.68061", "0.66610354", "0.66389817", "0.66239053", "0.660154", "0.6596208", "0.6566774", "0.65286154", "0.6515234", "0.649796", "0.6478823", "0.6469316", "0.63668275", "0.63606405", "0.6360007", "0.6355421", "0.634227", ...
0.83315134
0
Calculate distance between two strings
def distance_words(result, query): distance_dict = {} # for each word in result find distance between that word and query word # i.e. number of insert/update/delete operations required to change query word to result word # smallest distance means closest word to query, therefore it will be # shown a...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def string_distance(s1, s2):\n if len(s1) != len(s2):\n return 1\n diff_count = 0\n for c1, c2, in zip(s1, s2):\n if c1 != c2:\n diff_count += 1\n return diff_count", "def distance(str1, str2):\n return levenshtein.normalized_distance(str1, str2)", "def cer(self, s1, s2)...
[ "0.8436867", "0.8337954", "0.82760596", "0.8250981", "0.8150399", "0.80185306", "0.7873248", "0.7826535", "0.7815353", "0.7779506", "0.77037585", "0.76817346", "0.765695", "0.7629143", "0.7577644", "0.7559477", "0.7524152", "0.7472874", "0.74681246", "0.7446764", "0.74416566"...
0.0
-1
Get list with nodes in calculated path.
def path(self): path = self.bidirectional_cpp.getPath() # format as list on return as SWIG returns "tuple" if len(path) <= 0: return None _path = [] # Convert path to its original types and return for p in path: if p in ["Source", "Sink"]: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_path_list(path):\n # Build the path from end back to beginning.\n nodes = []\n prevevt = None\n while path is not None:\n nodes.append((path.node, path.cost, prevevt))\n prevevt = path.evt\n path = path.prev\n\n nodes.reverse()\n return nodes", "def get_path_nodes(s...
[ "0.7453544", "0.7348309", "0.70827794", "0.7017045", "0.6989142", "0.68755865", "0.67927146", "0.6762526", "0.6754081", "0.66521084", "0.6635114", "0.6635114", "0.661701", "0.6602719", "0.6599474", "0.65788794", "0.65637726", "0.6549999", "0.6537768", "0.65142936", "0.6508103...
0.0
-1
Returns the list of branch restrictions in this repository.
def each(self, kind=None, pattern=None, q=None, sort=None): params = {} if kind is not None: params["kind"] = kind if pattern is not None: params["pattern"] = pattern if sort is not None: params["sort"] = sort if q is not None: para...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def branches(self) -> list[str]:\n _args: list[Arg] = []\n _ctx = self._select(\"branches\", _args)\n return _ctx.execute_sync(list[str])", "def list_branches(self) -> List[str]:\n self.__verify_repo_initialized()\n branches = heads.get_branch_names(self._env.branchenv)\n ...
[ "0.65424573", "0.64971113", "0.63735795", "0.6300394", "0.6193839", "0.6185651", "0.61611485", "0.60822934", "0.6047024", "0.6026878", "0.6004292", "0.5965082", "0.59315646", "0.59294176", "0.59291744", "0.58299065", "0.5740456", "0.5727023", "0.57083917", "0.56360984", "0.55...
0.0
-1
Converts a 4D Tensor array into a numpy array. For cal scores
def multi_tensor2im(input_image, imtype=np.float64): if not isinstance(input_image, np.ndarray): if isinstance(input_image, torch.Tensor): # get the data from a variable image_tensor = input_image.data else: return input_image image_numpy = image_tensor[0].cpu().floa...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def to_numpy(tensor):\n raise NotImplementedError", "def tensor2np(x):\n return x.cpu().numpy()", "def _parse_array(self, tensor_proto):\n try:\n from onnx.numpy_helper import to_array\n except ImportError as e:\n raise ImportError(\"Unable to import onnx which is ...
[ "0.6903659", "0.6776793", "0.67104787", "0.6690187", "0.65658027", "0.65466124", "0.6445613", "0.6351079", "0.63429934", "0.6290302", "0.62625456", "0.62572265", "0.6221979", "0.61997074", "0.6182805", "0.6178731", "0.6160156", "0.605828", "0.60338384", "0.6033349", "0.599936...
0.0
-1
Converts a Tensor array into a numpy image array.
def tensor2im_raw(input_image, imtype=np.float64): if not isinstance(input_image, np.ndarray): if isinstance(input_image, torch.Tensor): # get the data from a variable image_tensor = input_image.data else: return input_image image_numpy = image_tensor[0].cpu().float(...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def convert_tensor_to_numpy_img(tensor_img):\n\n img = tensor_img.to('cpu').clone().detach()\n img = img.numpy().squeeze(0)\n img = img.transpose(1, 2, 0)\n img = img * np.array((0.229, 0.224, 0.225)) + np.array((0.485, 0.456, 0.406))\n img = img.clip(0, 1)\n return img", "def images_to_numpy(t...
[ "0.76706123", "0.73970133", "0.72891134", "0.70688695", "0.7039809", "0.7034062", "0.6989774", "0.68511224", "0.68485266", "0.6814767", "0.6798817", "0.6775384", "0.6773248", "0.6742704", "0.6710867", "0.6661674", "0.6646863", "0.65954083", "0.65807855", "0.65459764", "0.6499...
0.6419002
30
Converts a Tensor array into a numpy image array.
def tensor2im_raw_sss(input_image, imtype=np.float64): if not isinstance(input_image, np.ndarray): if isinstance(input_image, torch.Tensor): # get the data from a variable image_tensor = input_image.data else: return input_image image_numpy = image_tensor[0].cpu().fl...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def convert_tensor_to_numpy_img(tensor_img):\n\n img = tensor_img.to('cpu').clone().detach()\n img = img.numpy().squeeze(0)\n img = img.transpose(1, 2, 0)\n img = img * np.array((0.229, 0.224, 0.225)) + np.array((0.485, 0.456, 0.406))\n img = img.clip(0, 1)\n return img", "def images_to_numpy(t...
[ "0.76706123", "0.73970133", "0.72891134", "0.70688695", "0.7039809", "0.7034062", "0.6989774", "0.68511224", "0.68485266", "0.6814767", "0.6798817", "0.6775384", "0.6773248", "0.6742704", "0.6710867", "0.6661674", "0.6646863", "0.65954083", "0.65807855", "0.65459764", "0.6499...
0.6034303
61
Converts a Tensor array into a numpy image array.
def tensor2im(input_image, imtype=np.uint8, keep_grayscale=False, color_map=False): if not isinstance(input_image, np.ndarray): if isinstance(input_image, torch.Tensor): # get the data from a variable image_tensor = input_image.data else: return input_image image_num...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def convert_tensor_to_numpy_img(tensor_img):\n\n img = tensor_img.to('cpu').clone().detach()\n img = img.numpy().squeeze(0)\n img = img.transpose(1, 2, 0)\n img = img * np.array((0.229, 0.224, 0.225)) + np.array((0.485, 0.456, 0.406))\n img = img.clip(0, 1)\n return img", "def images_to_numpy(t...
[ "0.7669704", "0.73966134", "0.7288977", "0.7069187", "0.70396876", "0.70338136", "0.69900244", "0.68517536", "0.6848797", "0.68132806", "0.67969334", "0.67759657", "0.67733705", "0.6742648", "0.6710874", "0.6660042", "0.66466665", "0.6596863", "0.65810174", "0.6545738", "0.65...
0.0
-1
Save a numpy image to the disk
def save_image(image_numpy, image_path, aspect_ratio=1.0, color_map=False): if color_map: import matplotlib.pyplot as plt cm = plt.get_cmap('jet') colored_image = cm(image_numpy[:,:,0])[:,:,:3] # print_numpy(colored_image, val=True, shp=True) # max 1.0 min 0.0 shape (256,256,3) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def save_img(img: np.ndarray, path: str) -> None:\n\n img_obj = Image.fromarray(img)\n img_obj.save(path)", "def save_npimg(array: np.ndarray, path: str) -> None:\r\n img = Image.fromarray(array.squeeze())\r\n img.save(path)", "def save_numpy_array(image_numpy, image_path):\n\n np.save(image_pat...
[ "0.8147427", "0.805823", "0.80290645", "0.76396614", "0.7499407", "0.73602504", "0.7349538", "0.72928375", "0.71834093", "0.71678203", "0.7089875", "0.7088977", "0.7059785", "0.7059785", "0.70420074", "0.7023353", "0.70053226", "0.6992493", "0.6944776", "0.69285244", "0.68913...
0.0
-1
Returns an actual application instance.
def get_app(): return ApplicationContainer()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_app(self):\n return Application()", "def app(self):\n if self._application is None:\n self._application = Application(client=self)\n return self._application", "def get_app(self):\n\n app = APP\n return app", "def get_app():\n\n global _app\n if _ap...
[ "0.8861515", "0.84903675", "0.81249183", "0.8050293", "0.7917582", "0.78564817", "0.7806368", "0.77972925", "0.77863544", "0.776881", "0.776881", "0.774018", "0.769712", "0.76267976", "0.7622749", "0.76225656", "0.7604495", "0.758867", "0.7583053", "0.75246114", "0.75198257",...
0.8093994
3
Check for a holiday that is not returned by US unless the subdivision is specified.
def test_as_only(self): self.assertIn("Christmas Eve (Observed)", self.holidays.get_list(date(2017, DEC, 22)))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_non_holidays(self):\n # January 2nd was not public holiday between 2012 and 2017\n self.assertNotIn(date(2013, 1, 2), self.holidays)\n self.assertNotIn(date(2014, 1, 2), self.holidays)\n self.assertNotIn(date(2015, 1, 2), self.holidays)\n self.assertNotIn(date(2016, 1, 2...
[ "0.68410784", "0.6834418", "0.6440819", "0.63345224", "0.6281515", "0.6187739", "0.617032", "0.6059113", "0.59919596", "0.58549637", "0.58478737", "0.5784091", "0.56815726", "0.56685585", "0.5644258", "0.55936843", "0.55802804", "0.55397594", "0.5501634", "0.547768", "0.54398...
0.57139987
12
Returns true if both objects are equal
def __eq__(self, other): if not isinstance(other, TripRequestResponseJourneyFareTicketProperties): return False return self.__dict__ == other.__dict__
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __eq__(self, other):\n return are_equal(self, other)", "def __eq__(self, other):\n return are_equal(self, other)", "def __eq__(self,other):\n try: return self.object==other.object and isinstance(self,type(other))\n except: return False", "def __eq__(self, other):\n if i...
[ "0.8088132", "0.8088132", "0.8054589", "0.7982687", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", ...
0.0
-1
Returns true if both objects are not equal
def __ne__(self, other): return not self == other
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __ne__(self, other: object) -> bool:\n if self.__eq__(other):\n return False\n return True", "def __ne__(self, other: object) -> bool:\n return not self.__eq__(other)", "def __ne__(self, other) -> bool:\n return not self.__eq__(other)", "def __eq__(self, other):\n ...
[ "0.845611", "0.8391477", "0.8144138", "0.81410587", "0.8132492", "0.8093973", "0.80920255", "0.80920255", "0.80920255", "0.8085325", "0.8085325", "0.8076365", "0.8076365", "0.8065748" ]
0.0
-1
Gets the scan endpoint.
def scan(self) -> str: return pulumi.get(self, "scan")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_endpoint(self):\r\n return self._endpoint", "def __get_endpoint(self):\n return self._endpoint", "def endpoint(self):\r\n return self._endpoint", "def endpoint(self) -> pulumi.Output[str]:\n return pulumi.get(self, \"endpoint\")", "def endpoint(self) -> pulumi.Output[str...
[ "0.74098814", "0.73314446", "0.71746385", "0.6955927", "0.6955927", "0.69398713", "0.69398713", "0.69194084", "0.69194084", "0.691009", "0.6636628", "0.66211784", "0.6492588", "0.64567643", "0.64567643", "0.64509237", "0.6408429", "0.6408429", "0.64018905", "0.6366148", "0.62...
0.5787715
48
Gets the managed event hub namespace resource identifier.
def event_hub_namespace(self) -> str: return pulumi.get(self, "event_hub_namespace")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def namespace_id(self) -> str:\n return pulumi.get(self, \"namespace_id\")", "def namespace_id(self) -> Optional[str]:\n return pulumi.get(self, \"namespace_id\")", "def ns_id(self) -> str:\n return self._ns_id", "def app_id_namespace(self):\n return self.__key.app_id_namespace()", ...
[ "0.77077997", "0.725461", "0.72091734", "0.65560454", "0.65530854", "0.6524816", "0.642799", "0.6416584", "0.62844783", "0.628195", "0.626433", "0.626433", "0.626433", "0.6247113", "0.61026645", "0.6098736", "0.6098478", "0.6032208", "0.602092", "0.602092", "0.60173607", "0...
0.7143016
3
Gets the managed storage account resource identifier.
def storage_account(self) -> str: return pulumi.get(self, "storage_account")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def storage_account_resource_id(self) -> Optional[str]:\n return pulumi.get(self, \"storage_account_resource_id\")", "def storage_account_id(self) -> str:\n return pulumi.get(self, \"storage_account_id\")", "def storage_account_id(self) -> pulumi.Output[str]:\n return pulumi.get(self, \"st...
[ "0.8271188", "0.8205417", "0.7909327", "0.7451679", "0.7451679", "0.74060863", "0.7223711", "0.71937156", "0.70335424", "0.6934236", "0.68721527", "0.68721527", "0.68721527", "0.68721527", "0.68721527", "0.68721527", "0.68721527", "0.68721527", "0.6849822", "0.68462056", "0.6...
0.7243386
6
Gets or sets the Sku.
def __init__(__self__, *, capacity: Optional[int] = None, name: Optional[str] = None): if capacity is not None: pulumi.set(__self__, "capacity", capacity) if name is not None: pulumi.set(__self__, "name", name)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def sku(self):\n return self._sku", "def sku(self) -> Optional[pulumi.Input[str]]:\n return pulumi.get(self, \"sku\")", "def sku(self) -> Optional[pulumi.Input[str]]:\n return pulumi.get(self, \"sku\")", "def sku(self) -> 'outputs.SkuResponse':\n return pulumi.get(self, \"sku\")",...
[ "0.77713096", "0.7666501", "0.7666501", "0.7537249", "0.7537249", "0.75047255", "0.75047255", "0.7504427", "0.74638593", "0.74638593", "0.7452655", "0.73060554", "0.72653705", "0.7230723", "0.71879315", "0.717859", "0.71188986", "0.7007966", "0.6961044", "0.69386", "0.6922272...
0.0
-1
Gets or sets the sku name.
def name(self) -> Optional[str]: return pulumi.get(self, "name")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def sku_name(self) -> str:\n return pulumi.get(self, \"sku_name\")", "def sku_name(self) -> str:\n return pulumi.get(self, \"sku_name\")", "def sku_name(self) -> str:\n return pulumi.get(self, \"sku_name\")", "def sku_name(self) -> Optional[pulumi.Input[str]]:\n return pulumi.get(...
[ "0.8917456", "0.8917456", "0.8917456", "0.8585025", "0.8585025", "0.8564865", "0.78616726", "0.77543414", "0.77543414", "0.7712029", "0.7567312", "0.73022026", "0.73022026", "0.7257302", "0.72429395", "0.72429395", "0.71772075", "0.71772075", "0.7118359", "0.704907", "0.70357...
0.0
-1
Gets or sets the name.
def name(self) -> str: return pulumi.get(self, "name")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_name(self) -> str:\n return self.name", "def get_name(self) -> str:\n return self.name", "def get_name(self) -> str:\n return self.name", "def get_name(self) -> str:\r\n return self.name", "def get_name(self) -> str:\n return self._name", "def get_name(self) -> ...
[ "0.8469129", "0.8469129", "0.8469129", "0.8447416", "0.84370947", "0.84370947", "0.84112716", "0.84112716", "0.83829135", "0.8358553", "0.8355118", "0.8355118", "0.8355118", "0.83410186", "0.83410186", "0.8334028", "0.8334028", "0.8334028", "0.8334028", "0.8334028", "0.833402...
0.0
-1
Gets or sets the type.
def type(self) -> str: return pulumi.get(self, "type")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_type(self):\n return self.type", "def get_type(self):\n return self.type", "def get_type(self):\n return self._type", "def get_type(self):\n return self._type", "def type(self):\n return self._getValue('type')", "def get_type(self):\n return self._TYPE", ...
[ "0.8533302", "0.8533302", "0.844054", "0.844054", "0.8312111", "0.827963", "0.8276462", "0.82763165", "0.81963736", "0.8196329", "0.8196329", "0.8196329", "0.8196329", "0.8196329", "0.8196329", "0.8196329", "0.8196329", "0.8196329", "0.8196329", "0.8196329", "0.8196329", "0...
0.0
-1
The private link service connection state.
def private_link_service_connection_state(self) -> Optional['outputs.PrivateLinkServiceConnectionStateResponse']: return pulumi.get(self, "private_link_service_connection_state")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def private_link_service_connection_state(self) -> 'outputs.PrivateLinkServiceConnectionStateResponse':\n return pulumi.get(self, \"private_link_service_connection_state\")", "def private_link_service_connection_state(self) -> Optional[pulumi.Input['PrivateLinkServiceConnectionStateArgs']]:\n retur...
[ "0.8497788", "0.8199126", "0.7152462", "0.6898651", "0.6626659", "0.6335179", "0.62941045", "0.6250819", "0.6137564", "0.6137564", "0.6137564", "0.6137564", "0.6117924", "0.60801065", "0.59983486", "0.59824675", "0.5946474", "0.59394", "0.5903566", "0.5898455", "0.58547205", ...
0.81759524
2
The private link service connection state.
def __init__(__self__, *, actions_required: Optional[str] = None, description: Optional[str] = None, status: Optional[str] = None): if actions_required is not None: pulumi.set(__self__, "actions_required", actions_required) if description is...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def private_link_service_connection_state(self) -> 'outputs.PrivateLinkServiceConnectionStateResponse':\n return pulumi.get(self, \"private_link_service_connection_state\")", "def private_link_service_connection_state(self) -> Optional[pulumi.Input['PrivateLinkServiceConnectionStateArgs']]:\n retur...
[ "0.8497306", "0.81983757", "0.8175547", "0.7151184", "0.68992555", "0.6625003", "0.6333238", "0.62923944", "0.624901", "0.61362314", "0.61362314", "0.61362314", "0.61362314", "0.6116426", "0.6080834", "0.5996887", "0.5984157", "0.5945685", "0.5938164", "0.5902293", "0.5897633...
0.0
-1
The type of identity that created the resource.
def created_by_type(self) -> str: return pulumi.get(self, "created_by_type")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def type(self) -> pulumi.Input['ResourceIdentityType']:\n return pulumi.get(self, \"type\")", "def type(self) -> Optional[pulumi.Input['ResourceIdentityType']]:\n return pulumi.get(self, \"type\")", "def created_by_type(self) -> Optional[pulumi.Input[Union[str, 'IdentityType']]]:\n return ...
[ "0.8256836", "0.80165184", "0.7372737", "0.7200042", "0.71693283", "0.7145351", "0.7029676", "0.6985071", "0.68899626", "0.6862851", "0.6845546", "0.67708486", "0.67639816", "0.6753082", "0.6753082", "0.6753082", "0.6753082", "0.6753082", "0.6753082", "0.6725761", "0.670513",...
0.7070558
6
Encodes the JSON object dict as human readable ascii bytes.
def encode_pretty_printed_json(json_object): return _pretty_encoder.encode(json_object).encode("ascii")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def json_dumps(o: Any) -> bytes:\n return json.dumps(\n o, indent=4, sort_keys=True, ensure_ascii=True, separators=(\",\", \": \"), cls=NumberEncoder\n ).encode(\"ascii\")", "def _encode_dict(source: dict) -> bytes:\n result_data = b\"d\"\n\n for key, value in source.items():\n result_d...
[ "0.7128708", "0.707805", "0.6974458", "0.6947218", "0.6935862", "0.69216466", "0.68452454", "0.6806256", "0.6702172", "0.66949594", "0.6672828", "0.66574126", "0.66230845", "0.66184306", "0.6606135", "0.65194607", "0.65177107", "0.6503493", "0.64982766", "0.64840716", "0.6480...
0.70129156
2
Load an image from file into a numpy array. Puts image into numpy array to feed into tensorflow graph. Note that by convention we put it into a numpy array with shape (height, width, channels), where channels=3 for RGB.
def load_image_into_numpy_array(path): MAX_SIZE = (1440, 1080) # img_data = tf.io.gfile.GFile(path, 'rb').read() image = Image.open(path) # print("Image size before: {}".format(image.size)) image.thumbnail(MAX_SIZE) # print("Image size after resized: {}".format(image.size)) (im_width, im_hei...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def load_image_into_numpy_array(path):\n img_data = tf.io.gfile.GFile(path, 'rb').read()\n image = Image.open(BytesIO(img_data))\n (im_width, im_height) = image.size\n return np.array(image.getdata()).reshape(\n (im_height, im_width, 3)).astype(np.uint8)", "def load_image_into_numpy_array(path...
[ "0.78648573", "0.7772842", "0.7772842", "0.7716727", "0.7702963", "0.7698959", "0.7622497", "0.7609445", "0.7499605", "0.745", "0.7430725", "0.7402681", "0.7349688", "0.7314382", "0.72943574", "0.7274043", "0.7240022", "0.72181654", "0.7202281", "0.71850955", "0.7181907", "...
0.77166885
4
Computes the edit distance between two PQGram Profiles. This value should always be between 0.0 and 1.0. This calculation is reliant on the intersection method.
def edit_distance(self, other): union = len(self) + len(other) return 1.0 - 2.0*(self.intersection(other)/union)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def gram_edit_distance(self, gram1, gram2):\r\n distance = 0.0\r\n if gram1 == gram2:\r\n distance = 1.0\r\n return distance", "def gram_edit_distance(self, gram1, gram2):\n distance = 0.0\n if gram1 == gram2:\n distance = 1.0\n return distance", ...
[ "0.6955894", "0.6955548", "0.6307842", "0.62765044", "0.61209434", "0.61004573", "0.59898394", "0.596805", "0.5944567", "0.5942342", "0.5940036", "0.5933232", "0.5907506", "0.59023404", "0.5897927", "0.58955973", "0.5885934", "0.5880738", "0.58694685", "0.58680934", "0.586750...
0.63346106
2
Generate Rect for image
def gen_rect(image_path): cuda = torch.device('cuda:0' if torch.cuda.is_available() else 'cpu') net = PoseEstimationWithMobileNet() checkpoint = torch.load(f'{dir_path}/checkpoints/rect.pth', map_location=cuda) load_state(net, checkpoint) if torch.cuda.is_available(): eval_rect(net.cuda()...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def draw_rectangle(image, rect, color=(0,255,255)):\n x,y,w,h = rect\n cv2.rectangle(image, (x,y), (x+w,y+h), color, 3)\n return image", "def draw_rects(img, rects, color):\n for x1, y1, x2, y2 in rects:\n cv2.rectangle(img, (x1, y1), (x2, y2), color, 2)", "def drawRectangle(img, rect, color...
[ "0.6854727", "0.6737952", "0.66694933", "0.66479546", "0.6647152", "0.65892404", "0.6573682", "0.6540611", "0.6507018", "0.65064895", "0.64765185", "0.6425608", "0.6397068", "0.6395336", "0.6366382", "0.63527024", "0.6352438", "0.6305168", "0.6302696", "0.62983", "0.62841356"...
0.7099363
0
Build the "Cumulative Distribution Function" (CDF) for the given data
def _get_cdf(self, data, threshold): index = data.sort_values() index.name = None series = pd.Series(np.linspace(0, 1, len(index)), index=index) series.name = data.name # Compute percentage of samples above/below the specified threshold below = float(max(series[:threshol...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def cdf(self,x):\n if hasattr(x,'__len__'):\n returnCdf = np.array([self.cdf(i) for i in x])\n else:\n returnCdf = self._distribution.cdf(x)\n return returnCdf", "def ecdf(data):\n x = np.sort(data)\n cdf = np.linspace(0, 1, len(x))\n return cdf, x", "def cdf(self, data, survival=Fa...
[ "0.74474496", "0.72216785", "0.7134686", "0.7022993", "0.70228744", "0.69702226", "0.69702226", "0.690883", "0.68974537", "0.6719232", "0.66698056", "0.66341335", "0.6614587", "0.6611037", "0.6560948", "0.6549866", "0.6535113", "0.6513487", "0.64687836", "0.6442049", "0.63943...
0.55140185
90
Group separate words into phrases where appropriate by examining the list of valid phrase embeddings.
def convert_to_valid_phrases(x): updated_x = [] for doc in x: tokens = doc.split() phrase_tokens = [] # Maintain the start of the phrase we are processing index = 0 # Initially consider a phrase of word length 3 phrase_length = 3 ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def processwords(list_of_matches, lemmatag = False):\n list_of_matches = [w.lower() for w in list_of_matches]\n # remove nonwords, strip . to normalise \"dr.\"\n if translated_option != 'o' and translated_option != 'u':\n list_of_matches = [w.lstrip('.').rstrip('.') for w in list_of...
[ "0.6690478", "0.6518407", "0.6467396", "0.64556956", "0.6439871", "0.6412679", "0.6372459", "0.63525736", "0.62521577", "0.61389816", "0.61259305", "0.60667527", "0.60512096", "0.6015702", "0.5927946", "0.5927476", "0.59270275", "0.5896144", "0.5880175", "0.5870922", "0.58671...
0.67971826
0
Update frequency axis of imshow plot
def updateFreqAxis(self, ax, n_ticks=5, delay=False): rf = self.uv.h_common['REF_FREQ'] /1e6 chw = self.uv.d_frequency['CH_WIDTH'] / 1e6 bw = self.uv.d_frequency['TOTAL_BANDWIDTH'] / 1e6 rp = self.uv.h_common['REF_PIXL'] nchan = self.uv.h_common['NO_CHAN'] #print rf,...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def fdplot(self, imx):\n fig = plt.figure()\n maxval = np.max(imx)\n ims = list(map(lambda im: [plt.imshow(np.fabs(im),norm=colors.Normalize(0.0,maxval))], imx))\n animation = anim.ArtistAnimation(fig,ims,interval=50)\n plt.show()", "def plot_fft(self):\r\n\r\n self.ipx ...
[ "0.622137", "0.61602694", "0.60901415", "0.6034941", "0.5973292", "0.5970605", "0.59339", "0.5931212", "0.5928027", "0.5888736", "0.58812565", "0.58622396", "0.58247423", "0.5773689", "0.57645696", "0.5758646", "0.5752239", "0.57267344", "0.57218915", "0.57039946", "0.5691942...
0.68190473
0
returns the z for which P(Z >= z) = probability
def normal_lower_bound(probability, mu=0, sigma=1): return inverse_normal_cdf(1 - probability, mu, sigma)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def zprob(z):\r\n Z_MAX = 6.0 # maximum meaningful z-value\r\n if z == 0.0:\r\n x = 0.0\r\n else:\r\n y = 0.5 * math.fabs(z)\r\n if y >= (Z_MAX*0.5):\r\n x = 1.0\r\n elif (y < 1.0):\r\n w = y*y\r\n x = ((((((((0.000124818987 * w\r\n ...
[ "0.7923753", "0.7625524", "0.75491405", "0.7405041", "0.6838012", "0.6697751", "0.64589626", "0.64409125", "0.63929063", "0.6382707", "0.63141704", "0.6314136", "0.62904847", "0.62522966", "0.62209", "0.61795706", "0.6152627", "0.6144414", "0.6080992", "0.6080628", "0.6077197...
0.0
-1
A python list that returns a unique list
def unique_list2(mylist): newlist = [] for num in mylist: if num not in newlist: newlist.append(num) print(newlist)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _unique(li):\n return list(set(li))", "def _naive_unique(li):\n tmp = []\n for el in li:\n if el not in tmp:\n tmp.append(el)\n return tmp", "def unique(li):\r\n seen = set()\r\n seen_add = seen.add\r\n return [x for x in li if not (x in seen or seen_add(x))]", "def...
[ "0.8489617", "0.8041273", "0.8032733", "0.7943477", "0.79390806", "0.7912173", "0.7838201", "0.77897817", "0.77308494", "0.77089024", "0.7676454", "0.7612959", "0.7608198", "0.7546661", "0.75240076", "0.7506663", "0.7501831", "0.7469628", "0.7467535", "0.74581516", "0.7404941...
0.70339376
45
Checks if the date is a holiday.
def is_holiday(date): return date.day in __get_holidays(date.year)[date.month]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_holiday(self) -> bool:\n return set(self._get_date_text_ascii()) == set([int(x) for x in self.params['holiday']['holiday_text']])", "def holiday(self):\n \n holidays = [] # array of holidays for the organization. \n if self.time_stamp in holidays:\n return True\n return False", ...
[ "0.88423693", "0.8017763", "0.78057307", "0.76375", "0.75853604", "0.7517601", "0.7297001", "0.7155849", "0.7155614", "0.71472645", "0.6977304", "0.67696166", "0.654254", "0.6499769", "0.64996624", "0.6439739", "0.6435947", "0.6374924", "0.6331744", "0.6274895", "0.6188199", ...
0.8611505
1
Checks if the date is a work free day.
def is_workfree(date): return date.weekday() == 6 or is_holiday(date)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def check_weekday_of_date(self, date):\n return date.isoweekday() % 7", "def is_working_day_appointment(self):\n # function helps hide appointments on weekend\n return 0 <= self.date.weekday() <= 4", "def isoweekday(self):\n return 0", "def isoweekday(self):\n return 0", ...
[ "0.7208509", "0.6844824", "0.6558097", "0.6558097", "0.64974153", "0.64455414", "0.6416937", "0.6321627", "0.6297786", "0.62444645", "0.623296", "0.62111145", "0.61961436", "0.6193795", "0.6190089", "0.61702996", "0.6155866", "0.6134797", "0.6133069", "0.6127707", "0.6111384"...
0.8509704
0
Delete user group specified by parameter userGroup. The holder the session key specified by argument token must be an owner of the group to successfully delete the user group.
def delete_user_group(self, token, userGroup): requestUser = self.get_username_from_token(token) if self.check_user_has_owner_clearance(requestUser, userGroup): dataBase = self.read_database() if userGroup in dataBase['userGroups']: del dataBase['userGroups'][user...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def remove_user_from_group(self, token, userGroup, userName):\n requestUser = self.get_username_from_token(token)\n if self.check_user_has_owner_clearance(requestUser, userGroup):\n dataBase = self.read_database()\n if userGroup not in dataBase['userGroups']:\n ra...
[ "0.74179554", "0.72125274", "0.72000664", "0.71969306", "0.71693516", "0.7109945", "0.70894116", "0.70823497", "0.70753855", "0.7072845", "0.7058252", "0.7046447", "0.7025903", "0.69864124", "0.69833934", "0.6976777", "0.6954955", "0.693821", "0.69039476", "0.6808784", "0.680...
0.8551636
0
accuracy metric tracks how many predictions are in the top K
def top_k_metric(self, y_true, y_pred): return top_k_categorical_accuracy(y_true, y_pred, k=self.ACCURACY_K)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def accuracy(output, target, topk=(1,)):\n maxk = max(topk)\n batch_size = target.size(0)\n\n _, pred = output.topk(maxk, 1, largest=True, sorted=True) \n pred = pred.t()\n correct = pred.eq(target.view(1, -1).expand_as(pred))\n\n res = []\n for k in topk:\n correct_k = correct[:k].con...
[ "0.7987561", "0.79590225", "0.7940957", "0.7934815", "0.7929878", "0.79262775", "0.7898645", "0.7896291", "0.78896827", "0.78896827", "0.7889467", "0.7889467", "0.7889467", "0.7889467", "0.7889467", "0.7889467", "0.7889467", "0.7889467", "0.7889467", "0.7889467", "0.7889467",...
0.0
-1
Create a ring lattice with n nodes and k degrees.
def create_ring_lattice(self, n: int, k: int) -> nx.Graph: graph = nx.Graph() nodes = tuple(range(n)) graph.add_nodes_from(nodes) graph.add_edges_from(self.adjacent_pairs(nodes, k)) return graph
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_regular_ring_lattice(n, k):\n g = graph.Graph({})\n\n for i in range(n):\n for j in range(1, k//2 + 1):\n u, v = i, (i + j) % n\n g.add_edge((u, v))\n\n return g", "def get_ring_lattice(Nv, Kv):\n if type(Nv) is not int:\n logging.error(\"Error: Nv shoul...
[ "0.8479313", "0.68399495", "0.64959353", "0.6429035", "0.6108292", "0.60072684", "0.6006197", "0.5933561", "0.58590966", "0.58046883", "0.5766085", "0.5751667", "0.5744521", "0.57397836", "0.5720675", "0.5710185", "0.57094985", "0.57093203", "0.569307", "0.56884813", "0.56515...
0.8441185
1
Opens a new database connection if there is none yet for the current application context.
def get_db(): if not hasattr(g, 'sqlite_db'): g.sqlite_db = connect_db() return g.sqlite_db
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def db_open():\n if not hasattr(g, 'sqlite_db'):\n g.sqlite_db = db_connect()\n return g.sqlite_db", "def open_database(self):\n if self._conn is None:\n self._conn = sqlite3.connect(self._db_path)", "def open_db(db_name: str = DB_NAME) -> DBConnection:\n return sqlite3.connec...
[ "0.7737639", "0.7582971", "0.73180443", "0.71693045", "0.70220166", "0.6966687", "0.6954785", "0.69486743", "0.6897534", "0.6842663", "0.68292314", "0.68191963", "0.680592", "0.67950195", "0.67697805", "0.6762173", "0.6751266", "0.6746273", "0.67316663", "0.670031", "0.668866...
0.640242
86
Function to return data loaders
def get_dataloaders(logging, batch_size): # Load Data logging.info("Reading Train and Test data...") train_df = pd.read_csv("C:/tmp/avila_classification/data/avila-tr.txt", header=None) test_df = pd.read_csv("C:/tmp/avila_classification/data/avila-ts.txt", header=None) # Fix column names col_na...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_data_loaders(opt):\n return find_dataloader_using_name(opt.dataloader)(opt).load_data()", "def get_loaders(train_dataset, val_dataset, test_dataset, batch_size=128):\n train_loader = DataLoader(train_dataset, batch_size=batch_size, num_workers=8,\n shuffle=True)\n\n ...
[ "0.7474642", "0.719452", "0.71429884", "0.7109437", "0.70987356", "0.7012204", "0.6996436", "0.69849545", "0.68915355", "0.68808377", "0.6855506", "0.67691875", "0.6754219", "0.6753365", "0.6748003", "0.6673174", "0.66308194", "0.6559466", "0.6536258", "0.6525207", "0.6472954...
0.0
-1
Returns a list of random bits, with default length 24.
def random_iv(length=24): n_bytes = -(-length // 8) # round up by upside down floor division return Bits(urandom(n_bytes))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_random_bits(self):\n return random.getrandbits(8)", "def generate_bits(self):\n\n def _generate():\n for i in range(0, 16):\n hi = self._bytes[i] & 0xF0\n lo = self._bytes[i] & 0x0F\n\n yield hi >> 4\n yield lo\n\n ...
[ "0.7440567", "0.67365175", "0.66937983", "0.6540674", "0.6533146", "0.64347506", "0.63093436", "0.62881535", "0.6256137", "0.6251825", "0.6246", "0.6238862", "0.622283", "0.6219252", "0.6198189", "0.6194114", "0.61907727", "0.6173091", "0.61486804", "0.61101645", "0.61030346"...
0.6056679
22
Convert two points into a rectangle boolean mask.
def points_to_rectangle_mask(shape, top_left, bottom_right, width=1): if len(shape) != 2: raise ValueError('Only works for 2 dimensional arrays') rectangle_mask = np.zeros(shape, dtype=np.bool) rr, cc = rectangle_perimeter(top_left, bottom_right) rectangle_mask[rr, cc] = True rectangle_mask...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _boolean_region(all_polygons_A, all_polygons_B,\n bboxes_A, bboxes_B,\n left, bottom, right, top,\n operation = 'and',\n precision = 1e-4):\n\n polygons_to_boolean_A = _crop_edge_polygons(all_polygons_A, bboxes_A,\n ...
[ "0.6433074", "0.6189757", "0.59400976", "0.59250057", "0.5858805", "0.5858185", "0.58444923", "0.5838613", "0.5737651", "0.5723421", "0.57002676", "0.56836426", "0.5645757", "0.5645614", "0.56238186", "0.5609873", "0.5605367", "0.56040806", "0.55966026", "0.55877304", "0.5585...
0.7025666
0
Write json_dict to string and encode it.
def write_json(self, json_dict): content = json.dumps(json_dict) if isinstance(content, unicode): content = content.encode('utf-8') self.wfile.write(content)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __encode_json_dictionary(json_dict:dict):\n\n json_string = json.dumps(json_dict)\n\n return base64.b64encode(json_string.encode()).decode()", "def dict_json_encoding_utf_8(json_dict=dict):\n # type: (dict)->str\n return json.dumps(json_dict, encoding='utf-8', ensure_ascii=False)", "def...
[ "0.75034356", "0.74383956", "0.7333169", "0.7222859", "0.70339006", "0.6925609", "0.68733126", "0.6837803", "0.68162316", "0.67681766", "0.67597246", "0.67356294", "0.67297566", "0.6729615", "0.6695731", "0.6683966", "0.6681227", "0.6641551", "0.6640507", "0.66382366", "0.662...
0.7949218
0
Reads from word3.txt word by word and inserts them in a svenska.bintree() If a word already exists as a value of a node, does nothing.
def read_write_doubles_swe(): print("\n") #because looks matter with open("word3.txt", "r", encoding="utf-8") as svenskfil: for rad in svenskfil: ordet = rad.strip() if ordet in svenska: pass ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add(self, word):\n current_node = self.root\n\n for char in word:\n if char not in current_node.children: # checks if that char does not already exists in the children Trie\n current_node.children[char] = TrieNode() # if it doesnt add it to the children dict\n\n ...
[ "0.66979235", "0.66695124", "0.66464746", "0.65615714", "0.654404", "0.6534255", "0.6518626", "0.6500137", "0.64637285", "0.6459348", "0.64391166", "0.6435572", "0.64319384", "0.641447", "0.64039755", "0.6390413", "0.6383901", "0.63797295", "0.6374294", "0.63614357", "0.63515...
0.6078257
46
Returns a simple photodetector Solid. The photodetector is a sphere of size `size` constructed out of a glass envelope with a photosensitive face on the inside of the glass envelope.
def build_dom(): glass_thickness = 10 #mm size = 100 #mm # outside of the glass envelope outside_mesh = make.sphere(size) # inside of the glass envelope inside_mesh = make.sphere(size-glass_thickness) # outside solid with ice on the outside, and glass on the inside outside_solid = Solid...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def onsphere(size=None):\n xy = oncircle(size)\n z = 2.*random(xy.shape[:-1] + (1,)) - 1.\n xy *= sqrt(1. - z*z)\n return concatenate((xy, z), axis=-1)", "def insphere(size=None):\n if size is None:\n size = ()\n else:\n try:\n size = tuple(size)\n except TypeErr...
[ "0.6575113", "0.61373353", "0.59475297", "0.5855395", "0.57705367", "0.5767528", "0.55725276", "0.55000556", "0.5417638", "0.53831685", "0.535598", "0.5278344", "0.5260494", "0.52457744", "0.5242157", "0.52408755", "0.516431", "0.51643056", "0.5153069", "0.5138721", "0.513001...
0.5042345
23
Opens wiki page on GitHub.
def gotoWeb(self,page:str)->None: if page=='repo': webbrowser.open('http://github.com/ivan866/readTobiiGlasses') elif page=='wiki': webbrowser.open('http://github.com/ivan866/readTobiiGlasses/wiki') elif page=='glasses2API': webbrowser.open('http://tobiipro.co...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def cli(repo, milestone):\n webbrowser.open_new(repo.milestone(milestone).data[\"html_url\"])", "def openNewIssueUrl(self):\r\n url = QUrl(\"https://github.com/Freeseer/freeseer/issues/new\")\r\n QDesktopServices.openUrl(url)", "async def github(self, ctx):\n await ctx.send('https://git...
[ "0.70456856", "0.68781185", "0.65577674", "0.64694786", "0.64647865", "0.6387878", "0.6353555", "0.6289941", "0.61820054", "0.6131478", "0.6108096", "0.61043715", "0.6071371", "0.6058626", "0.6058626", "0.60260355", "0.6015926", "0.59951514", "0.5971696", "0.5943474", "0.5940...
0.5967606
19
Sets the number of selected neurons based on the integrity and hyperparameters.
def set_num_selections(self, integrity): #p = 1-self.integrity p = integrity numerator = 1 denominator = 1+(0.29/p) num_selections = numerator/denominator self.num_selections = int(num_selections*self.limit)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def number_of_nodes(self, number_of_nodes):\n\n self._number_of_nodes = number_of_nodes", "def set_numpins(self, n):\n self.numpins = n", "def set_number_of_neurons_per_core(neuronType, maxPermitted):\n if not inspect.isclass(neuronType):\n neuronType = globals()[neuronType]\n if...
[ "0.66156626", "0.6500769", "0.62024164", "0.61616355", "0.61574364", "0.59831583", "0.59526205", "0.59421104", "0.591064", "0.590501", "0.58638644", "0.58441436", "0.5842906", "0.5839701", "0.58300227", "0.5828594", "0.58035946", "0.5766354", "0.5700623", "0.5685242", "0.5653...
0.66118747
1
Get clients by namespace and client id. Multi tenant mode allows admin portal client to be accessible regardless of namespace path. (AdminGetClientsbyNamespacebyIDV3)
def admin_get_clientsby_namespaceby_idv3( client_id: str, namespace: Optional[str] = None, x_additional_headers: Optional[Dict[str, str]] = None, **kwargs ): if namespace is None: namespace, error = get_services_namespace() if error: return None, error request = Admin...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def admin_get_clients_by_namespace_v3(\n client_id: Optional[str] = None,\n client_name: Optional[str] = None,\n client_type: Optional[str] = None,\n limit: Optional[int] = None,\n offset: Optional[int] = None,\n namespace: Optional[str] = None,\n x_additional_headers: Optional[Dict[str, str]]...
[ "0.7473576", "0.73446333", "0.7271253", "0.6888655", "0.67617583", "0.6077965", "0.6002996", "0.59783685", "0.5941304", "0.57468194", "0.573251", "0.56803554", "0.5607244", "0.55487925", "0.5526058", "0.5511713", "0.54295737", "0.5425272", "0.5413576", "0.53611666", "0.534327...
0.7691607
0
Get clients by namespace and client id. Multi tenant mode allows admin portal client to be accessible regardless of namespace path. (AdminGetClientsbyNamespacebyIDV3)
async def admin_get_clientsby_namespaceby_idv3_async( client_id: str, namespace: Optional[str] = None, x_additional_headers: Optional[Dict[str, str]] = None, **kwargs ): if namespace is None: namespace, error = get_services_namespace() if error: return None, error req...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def admin_get_clientsby_namespaceby_idv3(\n client_id: str,\n namespace: Optional[str] = None,\n x_additional_headers: Optional[Dict[str, str]] = None,\n **kwargs\n):\n if namespace is None:\n namespace, error = get_services_namespace()\n if error:\n return None, error\n ...
[ "0.7692037", "0.7474285", "0.734325", "0.68893945", "0.6760803", "0.6078768", "0.6004191", "0.59781766", "0.5941113", "0.5747027", "0.5733406", "0.56798875", "0.5607682", "0.55490017", "0.5525852", "0.5511785", "0.542986", "0.5424362", "0.54141086", "0.53610665", "0.5343788",...
0.7271748
3
Get All Clients (GetClients) The endpoint is going to be deprecated Required permission 'CLIENT [READ]'. Endpoint migration guide
def get_clients(x_additional_headers: Optional[Dict[str, str]] = None, **kwargs): request = GetClients.create() return run_request(request, additional_headers=x_additional_headers, **kwargs)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get(self):\n return get_clientes()", "def get_clients():\n data = DataTable(document=ClientDocument, schema=ClientSchema).get_data\n return Response(data=data).send()", "def list_clients(self):\n\n return self.clients_info", "def get_client_list(self):\r\n cursor = self.conn.cu...
[ "0.7743857", "0.7675536", "0.7620939", "0.7381807", "0.7248829", "0.7050329", "0.69224197", "0.68675053", "0.67854166", "0.677802", "0.677802", "0.676434", "0.6747304", "0.6743586", "0.6686045", "0.66835487", "0.66594017", "0.662358", "0.6587034", "0.6515549", "0.6468866", ...
0.7144638
5
Get All Clients (GetClients) The endpoint is going to be deprecated Required permission 'CLIENT [READ]'. Endpoint migration guide
async def get_clients_async( x_additional_headers: Optional[Dict[str, str]] = None, **kwargs ): request = GetClients.create() return await run_request_async( request, additional_headers=x_additional_headers, **kwargs )
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get(self):\n return get_clientes()", "def get_clients():\n data = DataTable(document=ClientDocument, schema=ClientSchema).get_data\n return Response(data=data).send()", "def list_clients(self):\n\n return self.clients_info", "def get_client_list(self):\r\n cursor = self.conn.cu...
[ "0.7744311", "0.76752114", "0.7622309", "0.73818487", "0.7249017", "0.7144536", "0.7051049", "0.6922698", "0.68672585", "0.67850983", "0.6779448", "0.6779448", "0.6766077", "0.67479944", "0.6743753", "0.6686847", "0.6684556", "0.6659256", "0.6624567", "0.6588284", "0.64695853...
0.65152305
20
Removes the stopwords from the given list of words.
def removeStopWords(self, words): line = [] for w in words: if w not in self.stop_words: line.append(w) return line
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def stopword_removal(words):\n stops = set(stopwords.words('english'))\n words = [w for w in words if w not in stops]\n return words", "def rm_stop_words(self, words):\n return [word for word in words if word.lower() not in self.stopwords]", "def removeStopwords(self, words):\n\t\twordList = [w...
[ "0.84145194", "0.837082", "0.81671", "0.8138055", "0.81354606", "0.811937", "0.80495983", "0.8028908", "0.79807043", "0.7941815", "0.79317135", "0.79025966", "0.7899163", "0.7899163", "0.7899163", "0.7899163", "0.7865658", "0.7823456", "0.78208053", "0.7798624", "0.778563", ...
0.75173396
26
Removes all the biwords from the given sentence.
def getBiwords(self, words): bigrams_val = nltk.bigrams(words) biwords = [] for word in bigrams_val: biwords.append(word) return biwords
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def remove_stopwords_set(sentence: str, stop_words: Collection[str]) -> str:\n return \" \".join([w for w in word_tokenize(sentence) if w not in stop_words])", "def _remove_phrase_words(self, phrase: Phrase) -> None:\n for wi, word in enumerate(re.finditer(r\"\\w+\", phrase.phrase_string)):\n ...
[ "0.6506337", "0.6193584", "0.6186155", "0.6083024", "0.6065686", "0.6027448", "0.5926159", "0.5913872", "0.5883863", "0.5877422", "0.5866364", "0.58653945", "0.5839055", "0.5811004", "0.580226", "0.57862914", "0.5778397", "0.577648", "0.5771382", "0.5765315", "0.57551163", ...
0.5660813
28
Lemmatize the list of words.
def lemmatizeWord(self, lst): lemmatized_list = [] for item in lst: lemmatized_list.append(self.lmtzr.lemmatize(item)) return lemmatized_list
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def lemmatizeWords(self, words):\n\t\tlemmas = [self.lemmatizer.lemmatize(word) for word in words]\n\t\treturn lemmas", "def lemmatize_fun(self):\n tokens = str(self.doc).split()\n cleaned_tokens = None\n if self.lemmatize_method == 'wordnet':\n cleaned_tokens = [self.lemmatizer.l...
[ "0.8137336", "0.8069328", "0.7979295", "0.7974446", "0.7840236", "0.7770753", "0.775428", "0.7681515", "0.76708555", "0.7619978", "0.7594848", "0.75855464", "0.7582567", "0.7569726", "0.75632757", "0.75515574", "0.754554", "0.7496974", "0.7478025", "0.74616975", "0.74616975",...
0.8532224
0
Close SQLite3 database file.
def _close_database(self): assert self._conn is not None logging.info("Closing file {!r}.".format(self._filename)) self._cursor.close() self._cursor = None self._conn.close() self._conn = None self._filename = None self._sessionUID = None
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def close_db(connection: sqlite3.Connection):\n connection.commit()\n connection.close()", "def close_db(error):\n conn = g.get('sqlite_db', None)\n if conn is not None:\n conn.close()", "def close_db(error):\n if hasattr(g, 'sqlite_db'):\n g.sqlite_db.close()", "def close_da...
[ "0.790474", "0.75769603", "0.75418276", "0.7488408", "0.74870956", "0.7467076", "0.7467076", "0.74658245", "0.74658245", "0.74658245", "0.74658245", "0.74658245", "0.74658245", "0.74658245", "0.74658245", "0.74658245", "0.74658245", "0.74658245", "0.74658245", "0.74658245", "...
0.709535
41
``utils`` 'printerr' flushes stderr upon write
def test_printerr_flush(self, fake_stderr): utils.printerr('hello world!') self.assertTrue(fake_stderr.flush.called)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def printerr(message):\n sys.stderr.write('{}\\n'.format(message))\n sys.stderr.flush()", "def printerr(msg):\n print(msg, file=sys.stderr)", "def write_err(self, text): # pragma: no cover\n # type: (str) -> None\n stderr = self.stderr\n if self.stderr.closed:\n stderr...
[ "0.77528214", "0.7423508", "0.73425657", "0.7234647", "0.72223234", "0.7218984", "0.7192337", "0.71704376", "0.71371365", "0.7097004", "0.7094079", "0.7071313", "0.70421535", "0.7000542", "0.69921017", "0.6941965", "0.6940115", "0.6925807", "0.6884898", "0.68462116", "0.68336...
0.713
9
This returns a formula whose columns are the pairwise product of the columns of self and other.
def __mul__(self, other, nested=False): other = formula(other, namespace=self.namespace) selftermnames = self.termnames() othertermnames = other.termnames() I = len(selftermnames) J = len(othertermnames) terms = [] termnames = [] for i in range(I): ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __mul__(self, othertr):\n res = self.dot(othertr)\n return res", "def __mul__(self, other, nested=False):\n\n other = Formula(other)\n\n selftermnames = self.termnames()\n othertermnames = other.termnames()\n\n I = len(selftermnames)\n J = len(othertermnames)\...
[ "0.6415094", "0.63870233", "0.6279635", "0.6277308", "0.6246037", "0.6238537", "0.6096271", "0.6049816", "0.6033818", "0.6011278", "0.59259176", "0.5915911", "0.58421564", "0.5841482", "0.58370215", "0.5814275", "0.5805726", "0.577676", "0.57609296", "0.5735279", "0.5722849",...
0.6326241
2
Fetch all products using the ProductsClient and return a list of Product.
def fetch_all_products(): products = [] client = ProductsClient() for product in client.get_products(): products.append(Product( base_currency=product[0], quote_currency=product[1], )) return products
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def list_products(self):\n return self._make_get_request(self._urls['products'])", "def get_products(self, query_args={}):\n endpoint = '/v3/educator/products'\n result = self.request(endpoint, query_args)\n\n products = []\n for data in result.response:\n # Dynamica...
[ "0.80614233", "0.77957183", "0.77317494", "0.7727818", "0.76978964", "0.7659971", "0.76278734", "0.76218337", "0.75101274", "0.7506675", "0.7473793", "0.74562234", "0.7446137", "0.74291027", "0.730517", "0.72776335", "0.7214711", "0.7210885", "0.7206178", "0.7161277", "0.6978...
0.8576422
0
For each edge formed by `points', yield the intersection with the line road_segment `(x1,y1) (x2,y2)`, if it exists. Also return the distance of `(x2,y2)' to the middle of the edge along with its index, so that the one closest can be chosen.
def intersectingEdges(self, x1y1, x2y2, points): x1, y1 = x1y1 x2, y2 = x2y2 for i in range(4): x3, y3 = points[i] x4, y4 = points[(i + 1) % 4] denom = (y4 - y3) * (x2 - x1) - (x4 - x3) * (y2 - y1) nua = (x4 - x3) * (y1 - y3) - (y4 - y3) * (x1 - x3...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _distance2_line_segments(line1, line2, h_line1=None, h_line2=None):\n h_line1 = _homogenous_line(*line1) if h_line1 is None else h_line1\n h_line2 = _homogenous_line(*line2) if h_line2 is None else h_line2\n\n r_11 = _distance2_point_to_h_line(line1[0], h_line2), line2\n r_12 = _distance2_point_to_...
[ "0.66842866", "0.6544951", "0.6534804", "0.6397761", "0.63648325", "0.6221629", "0.6156096", "0.6112809", "0.60636187", "0.60401773", "0.5998089", "0.59856075", "0.59801304", "0.5979306", "0.59527075", "0.5948109", "0.59355986", "0.5917374", "0.5909981", "0.59034204", "0.5891...
0.6642663
1
Initializes model with pretrained weights. Layers that don't match with pretrained layers in name or size are kept unchanged.
def init_pretrained_weights(model, model_url): pretrain_dict = model_zoo.load_url(model_url) model_dict = model.state_dict() pretrain_dict = { k: v for k, v in pretrain_dict.items() if k in model_dict and model_dict[k].size() == v.size() } model_dict.update(pretrain_dict) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def init_weights(self, pretrained=None):\n self.online_backbone.init_weights() # backbone\n for online_neck in self.online_necks:\n online_neck.init_weights(init_linear='kaiming') # projection\n\n for param_ol, param_tgt in zip(self.online_backbone.parameters(),\n ...
[ "0.7687384", "0.76498604", "0.76121235", "0.7610052", "0.7531513", "0.7531075", "0.7506234", "0.74517953", "0.74322647", "0.7430785", "0.7413954", "0.7405895", "0.74027634", "0.71927947", "0.7145862", "0.70933527", "0.7058519", "0.7037526", "0.702971", "0.6928198", "0.6928198...
0.7053429
17
Return whether two signatures are equal.
def __eq__(self, other): raise NotImplementedError
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __eq__(self, other):\n if not isinstance(other, HandwrittenSignature):\n return False\n\n return self.__dict__ == other.__dict__", "def compare_signatures(self):\n my_decoded_sig = self._generate_signature().decode('utf-8')\n github_decoded_sig = self.github_signature.d...
[ "0.7376817", "0.7366683", "0.6833633", "0.6822376", "0.6760297", "0.6717255", "0.66255033", "0.6621525", "0.66104496", "0.65823257", "0.6542633", "0.6539048", "0.6535858", "0.6517003", "0.65066475", "0.64650303", "0.6443265", "0.64417446", "0.64297014", "0.64221925", "0.64064...
0.0
-1
Return whether two signatures are not equal.
def __ne__(self, other): return not (self == other)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __ne__(self, other):\n if not isinstance(other, AwsS3PresignedUrlForUpload):\n return True\n\n return self.to_dict() != other.to_dict()", "def compare_signatures(self):\n my_decoded_sig = self._generate_signature().decode('utf-8')\n github_decoded_sig = self.github_sign...
[ "0.6810536", "0.66832244", "0.6669398", "0.6649389", "0.65423083", "0.6531548", "0.6408324", "0.6405201", "0.63616735", "0.6360111", "0.6349488", "0.6294186", "0.6274727", "0.62588614", "0.6258481", "0.6256906", "0.62511283", "0.62347645", "0.62277216", "0.6209967", "0.620117...
0.0
-1
Return a string representation of the signature.
def __repr__(self): raise NotImplementedError
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def signature(self) -> str:\n return self[\"Sns\"][\"Signature\"]", "def get_signature(self):\n return \" \".join(self.segments[-1].unixtext.replace(\n u\"\\n\", \" \").strip().split())", "def signature(self):\n return self._signature", "def signature(self):\n return se...
[ "0.7539858", "0.7287568", "0.7190034", "0.7190034", "0.7190034", "0.7181395", "0.71353865", "0.70787", "0.7026662", "0.7015127", "0.69941896", "0.6944213", "0.69347954", "0.6842682", "0.68313044", "0.68313044", "0.67583066", "0.6699529", "0.66891664", "0.6681649", "0.6673457"...
0.0
-1
Return a string representation of the signature.
def __repr__(self): return ('<ProjectSignature(apps=%r)>' % list(six.iterkeys(self._app_sigs)))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def signature(self) -> str:\n return self[\"Sns\"][\"Signature\"]", "def get_signature(self):\n return \" \".join(self.segments[-1].unixtext.replace(\n u\"\\n\", \" \").strip().split())", "def signature(self):\n return self._signature", "def signature(self):\n return se...
[ "0.7541231", "0.728667", "0.7190602", "0.7190602", "0.7190602", "0.7182051", "0.71359193", "0.70791394", "0.7027011", "0.70154303", "0.6995797", "0.6944751", "0.6935849", "0.68435204", "0.6832239", "0.6832239", "0.6758563", "0.66998273", "0.6689304", "0.66820216", "0.6674166"...
0.6146218
57
Return whether two application signatures are equal.
def __eq__(self, other): return (self.app_id == other.app_id and dict.__eq__(self._model_sigs, other._model_sigs))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __eq__(self, other):\n return dict.__eq__(self._app_sigs, other._app_sigs)", "def compare_signatures(self):\n my_decoded_sig = self._generate_signature().decode('utf-8')\n github_decoded_sig = self.github_signature.decode('utf-8')\n self.logger.info(f'*** INFO: My Signature: {my_d...
[ "0.7336663", "0.72561383", "0.7213521", "0.66038907", "0.6564686", "0.6436949", "0.63801855", "0.63764834", "0.6350779", "0.63317466", "0.62575054", "0.6240622", "0.6201929", "0.61982626", "0.61881167", "0.61878103", "0.6177919", "0.6177863", "0.6169445", "0.61631924", "0.613...
0.668619
3
Return a string representation of the signature.
def __repr__(self): return ('<AppSignature(app_id=%r, models=%r)>' % (self.app_id, list(six.iterkeys(self._model_sigs))))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def signature(self) -> str:\n return self[\"Sns\"][\"Signature\"]", "def get_signature(self):\n return \" \".join(self.segments[-1].unixtext.replace(\n u\"\\n\", \" \").strip().split())", "def signature(self):\n return self._signature", "def signature(self):\n return se...
[ "0.7541231", "0.728667", "0.7190602", "0.7190602", "0.7190602", "0.7182051", "0.71359193", "0.70791394", "0.7027011", "0.70154303", "0.6995797", "0.6944751", "0.6935849", "0.68435204", "0.6832239", "0.6832239", "0.6758563", "0.66998273", "0.6689304", "0.66820216", "0.6674166"...
0.60270834
75
Return a string representation of the signature.
def __repr__(self): return '<ModelSignature(model_name=%r)>' % self.model_name
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def signature(self) -> str:\n return self[\"Sns\"][\"Signature\"]", "def get_signature(self):\n return \" \".join(self.segments[-1].unixtext.replace(\n u\"\\n\", \" \").strip().split())", "def signature(self):\n return self._signature", "def signature(self):\n return se...
[ "0.7539858", "0.7287568", "0.7190034", "0.7190034", "0.7190034", "0.7181395", "0.71353865", "0.70787", "0.7026662", "0.7015127", "0.69941896", "0.6944213", "0.69347954", "0.6842682", "0.68313044", "0.68313044", "0.67583066", "0.6699529", "0.66891664", "0.6681649", "0.6673457"...
0.58517706
99
Return a string representation of the signature.
def __repr__(self): return '<IndexSignature(name=%r, fields=%r)>' % (self.name, self.fields)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def signature(self) -> str:\n return self[\"Sns\"][\"Signature\"]", "def get_signature(self):\n return \" \".join(self.segments[-1].unixtext.replace(\n u\"\\n\", \" \").strip().split())", "def signature(self):\n return self._signature", "def signature(self):\n return se...
[ "0.7541231", "0.728667", "0.7190602", "0.7190602", "0.7190602", "0.7182051", "0.71359193", "0.70791394", "0.7027011", "0.70154303", "0.6995797", "0.6944751", "0.6935849", "0.68435204", "0.6832239", "0.6832239", "0.6758563", "0.66998273", "0.6689304", "0.66820216", "0.6674166"...
0.0
-1
Return attribute names and defaults for a field type. The attributes returned are those that impact the schema for a field's column.
def _get_defaults_for_field_type(cls, field_type): defaults = cls._ATTRIBUTE_DEFAULTS['*'].copy() defaults.update(cls._ATTRIBUTE_DEFAULTS.get(field_type, {})) return defaults
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _iter_attrs_for_field_type(cls, field_type):\n return six.iterkeys(cls._get_defaults_for_field_type(field_type))", "def _iter_attrs_for_field_type(cls, field_type):\n return six.iterkeys(cls._get_defaults_for_field_type(field_type))", "def attributes(self):\n attrs_ = [\"name\", \"type...
[ "0.70019615", "0.70019615", "0.6484985", "0.64458627", "0.6303182", "0.61047846", "0.61045617", "0.60442626", "0.59695965", "0.5966777", "0.59300464", "0.5882036", "0.5876599", "0.5849112", "0.58455306", "0.5760866", "0.57458884", "0.57376707", "0.56901485", "0.56745094", "0....
0.6733707
3
Return whether an attribute is set to its default value.
def is_attr_value_default(self, attr_name): try: attr_value = self.field_attrs[attr_name] except KeyError: return True return attr_value == self.get_attr_default(attr_name)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def has_default_value(self, name):\n return self.get_attribute_schema(name).has_default_value", "def has_default_value(self):\n return self.default is not None", "def isDefault (self):\n val = self.__getattribute__('StoredValue')\n dft = self.__class__.StoredValue\n return va...
[ "0.8286388", "0.80434895", "0.7622466", "0.75843847", "0.75212675", "0.74690676", "0.74160683", "0.7394499", "0.7368233", "0.7368233", "0.7368233", "0.73641014", "0.7321007", "0.72814614", "0.7269877", "0.7269877", "0.7269877", "0.7269877", "0.7269877", "0.72656024", "0.72349...
0.8460985
1
Return a string representation of the signature.
def __repr__(self): return ('<FieldSignature(field_name=%r, field_type=%r,' ' field_attrs=%r, related_model=%r)>' % (self.field_name, self.field_type, self.field_attrs, self.related_model))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def signature(self) -> str:\n return self[\"Sns\"][\"Signature\"]", "def get_signature(self):\n return \" \".join(self.segments[-1].unixtext.replace(\n u\"\\n\", \" \").strip().split())", "def signature(self):\n return self._signature", "def signature(self):\n return se...
[ "0.7541231", "0.728667", "0.7190602", "0.7190602", "0.7190602", "0.7182051", "0.71359193", "0.70791394", "0.7027011", "0.70154303", "0.6995797", "0.6944751", "0.6935849", "0.68435204", "0.6832239", "0.6832239", "0.6758563", "0.66998273", "0.6689304", "0.66820216", "0.6674166"...
0.6410023
36
Get full path filename to lock boot status data file.
def get_boot_status_lock(uuid): return DIR + uuid + "-nova-scheduler.lock"
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_boot_status_file(uuid):\n return DIR + uuid + \"-boot-status.json\"", "def _getLockFile(self):\n if self.baseFilename.endswith(\".log\"):\n lock_file = self.baseFilename[:-4]\n else:\n lock_file = self.baseFilename\n lock_file += \".lock\"\n return loc...
[ "0.7648661", "0.70835257", "0.68273216", "0.6513664", "0.6467815", "0.6465374", "0.6433706", "0.6427361", "0.6392815", "0.62526065", "0.6195001", "0.6167423", "0.61116856", "0.6098318", "0.6070388", "0.60579395", "0.6057894", "0.6037535", "0.60041535", "0.5980722", "0.5976273...
0.6955456
2
Get full path filename to write standard deviation of resource usage in hypervisors.
def get_hypervisor_std_file(uuid): return DIR + uuid + "-hypervisor-usage-std.csv"
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _get_filename():\n dirname = os.path.dirname(__file__)\n return os.path.join(dirname, 'occulttraining.txt')", "def sas_file(self):\n\n return os.path.normpath(self.path +'\\\\'+ cfg_dict['format_pgm'])", "def sysfs_dm_name_file(self):\n if not self.sysfs_dm_dir:\n return Non...
[ "0.64289916", "0.61588514", "0.61478084", "0.6085086", "0.60680705", "0.6056673", "0.6036024", "0.60271454", "0.60128665", "0.59565854", "0.59358454", "0.5932154", "0.59306324", "0.59113187", "0.59069836", "0.5849911", "0.5829437", "0.5825709", "0.58143747", "0.58032775", "0....
0.7002843
0
input_fn for TF Estimators for training set.
def train_input_fn(self) -> types.FeatureAndLabelTensors: return self._input_fn_from_file(self._train_path)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def input_fn(self, params, mode=tf.estimator.ModeKeys.TRAIN):\n raise NotImplementedError()", "def train_input_fn():\n # Initialize `iterator` with training data.\n train_filenames = [os.path.join(FLAGS.out_dir, FLAGS.train_records)]\n return _input_fn(train_filenames, FLAGS.epochs, FLAGS.batch_size, s...
[ "0.7662276", "0.7582011", "0.73283166", "0.72993016", "0.72711873", "0.7205876", "0.71283376", "0.71101683", "0.7084827", "0.7067734", "0.7020641", "0.70053136", "0.6989908", "0.6973908", "0.69226325", "0.6898626", "0.6896162", "0.6863851", "0.6860843", "0.68573034", "0.68568...
0.80321354
0
input_fn for TF Estimators for validation set.
def validate_input_fn(self) -> types.FeatureAndLabelTensors: return self._input_fn_from_file(self._validate_path)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def train_input_fn(self) -> types.FeatureAndLabelTensors:\n return self._input_fn_from_file(self._train_path)", "def input_fn(self, params, mode=tf.estimator.ModeKeys.TRAIN):\n raise NotImplementedError()", "def input_fn(params, is_training):\n features = tf.constant(0)\n labels = tf.constant(0...
[ "0.71534866", "0.7125449", "0.6958268", "0.68636453", "0.670674", "0.6683845", "0.6618339", "0.6605551", "0.65710956", "0.6560143", "0.6536054", "0.65173554", "0.6481254", "0.6454904", "0.6426866", "0.64244705", "0.6410971", "0.6398034", "0.6393422", "0.63832724", "0.6374454"...
0.7390639
0
Parses TF Example protobuf into a text feature and labels. The input TF Example has a text feature as a singleton list with the full comment as the single element.
def _read_tf_example(self, record: tf.Tensor, feature_preprocessor: Callable[[str], List[str]] ) -> types.FeatureAndLabelTensors: keys_to_features = {} keys_to_features[self._text_feature] = tf.FixedLenFeature([], tf.string) for label, dty...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def tf_example_parser(example):\n def _get_feature_map():\n \"\"\"Returns data format of the serialized tf record file.\"\"\"\n return {\n # 3 sparse feature with variable length. Use this if you have a\n # variable number or more than 1 feature value per example.\n \"featur...
[ "0.7473426", "0.7192375", "0.71876985", "0.7041436", "0.7027422", "0.69428957", "0.69346565", "0.6860971", "0.68087083", "0.67434734", "0.67412287", "0.6696193", "0.6671689", "0.6616741", "0.65874034", "0.658653", "0.6575175", "0.6520753", "0.650131", "0.64955604", "0.6491083...
0.7669579
0
Returns the indices of the minimum values along an axis.
def argmin(in_array1, axis=None, out=None): is_dparray1 = isinstance(in_array1, dparray) if (not use_origin_backend(in_array1) and is_dparray1): if axis is not None: checker_throw_value_error("argmin", "axis", type(axis), None) if out is not None: checker_throw_value_er...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def argmin(self, axis: str = 'rows') -> 'DataFrame':\n return self._stat_funcs('argmin', axis)", "def argmin(self, array):\n minvalue = inf\n minindex = None\n for i in range(len(array)):\n if array[i] < minvalue:\n minvalue = array[i]\n minind...
[ "0.6583821", "0.65255034", "0.64551914", "0.6451419", "0.6448586", "0.6416022", "0.63520133", "0.6330571", "0.6326746", "0.62599504", "0.6238197", "0.62235206", "0.6206076", "0.61969215", "0.6191196", "0.6187173", "0.6128968", "0.6060099", "0.60575366", "0.6042093", "0.602092...
0.54341465
88
Returns the instance id for logging.
def get_instance_id(self): return "{0}-{1}".format(self._vc_name, self._host)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def logging_id(self) -> str:\n return getattr(self, '_logging_id_', self.__class__.__qualname__)", "def instance_id(self) -> str:\n return pulumi.get(self, \"instance_id\")", "def get_instance_id(self):\n return self.instance_id", "def _get_instance_id(self):\n return self.__instance_...
[ "0.8218475", "0.8025451", "0.79560983", "0.79560393", "0.78480554", "0.78480554", "0.78480554", "0.78480554", "0.78480554", "0.78480554", "0.78000116", "0.776137", "0.776137", "0.776137", "0.7671196", "0.7671196", "0.7671196", "0.7582486", "0.7582486", "0.7582486", "0.7582486...
0.7386459
33
Gets the required metric preferences from Configuration.
def _get_metric_config(self, config): metric_config = dict() metric_config['include_metrics'] = config.get('include_metrics', {}) metric_config['exclude_metrics'] = config.get('exclude_metrics', {}) return metric_config
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def fusion_api_get_metrics_configuration(self, api=None, headers=None):\n return self.metrics.get(api=api, headers=headers, param='/configuration')", "def get_config_metrics():\n\n metrics = {'disk_usage': 'YES',\n 'cpu_percent': 'YES',\n 'memory_info': 'YES',\n ...
[ "0.6539192", "0.64132667", "0.6036444", "0.60328984", "0.5920239", "0.5903764", "0.5800494", "0.5787759", "0.5745069", "0.5727194", "0.57212275", "0.57003456", "0.5622699", "0.56104517", "0.5595933", "0.5585854", "0.55526394", "0.55515677", "0.5529959", "0.5519594", "0.551959...
0.64999586
1
Print the number of seconds in human readable format.
def pretty_eta(seconds_left): minutes_left = seconds_left // 60 seconds_left %= 60 hours_left = minutes_left // 60 minutes_left %= 60 days_left = hours_left // 24 hours_left %= 24 def helper(cnt, name): return "{} {}{}".format(str(cnt), name, ('s' if cnt > 1 else '')) if days_l...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def pretty_print_seconds(self, num_seconds):\r\n # Here _ is the N variant ungettext that does pluralization with a 3-arg call\r\n _ = self.runtime.service(self, \"i18n\").ungettext\r\n hours = num_seconds // 3600\r\n sub_hour = num_seconds % 3600\r\n minutes = sub_hour // 60\r\n...
[ "0.79881215", "0.7431252", "0.72922677", "0.7189182", "0.71485907", "0.7080386", "0.7067963", "0.70077443", "0.6957045", "0.694859", "0.6845278", "0.6801126", "0.6782586", "0.6744025", "0.6731153", "0.6730933", "0.66062856", "0.65881306", "0.6585352", "0.658501", "0.6575719",...
0.0
-1
Applies modifications to the model layers to create a new Graph. For example, simply changing `model.layers[idx].activation = new activation` does not change the graph. The entire graph needs to be updated with modified inbound and outbound tensors because of change in layer building function.
def apply_modifications_custom(model, custom_objects=None): # The strategy is to save the modified model and load it back. This is done because setting the activation # in a Keras layer doesnt actually change the graph. We have to iterate the entire graph and change the # layer inbound and outbound nodes wi...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def apply_modifications(model):\n # The strategy is to save the modified model and load it back. This is done because setting the activation\n # in a Keras layer doesnt actually change the graph. We have to iterate the entire graph and change the\n # layer inbound and outbound nodes with modified tensors....
[ "0.6834574", "0.646033", "0.64262533", "0.6143314", "0.6054267", "0.6037568", "0.57922846", "0.57590234", "0.5751098", "0.57248014", "0.56715995", "0.56670046", "0.56472725", "0.56293595", "0.56099206", "0.5577295", "0.5546652", "0.5546345", "0.55161875", "0.54980326", "0.549...
0.59563535
6
returns whether the given filename is a valid one to watch
def validfilename(self, filename): return not (filename == "CVS" or filename.startswith("."))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def valid_filename(filename):\n if filename in IGNORED_FILES:\n return False\n if not os.path.exists(filename):\n return False\n _, ext = os.path.splitext(filename)\n return ext == '.py'", "def _is_file_valid(name: str) -> bool:\n return not name.startswith(\".\")", "def _isvalid_f...
[ "0.77909786", "0.7757278", "0.7443244", "0.7346418", "0.7317058", "0.7305342", "0.7300752", "0.7249595", "0.7221809", "0.7203395", "0.71959907", "0.7195525", "0.7187895", "0.71270996", "0.7105209", "0.709466", "0.7086966", "0.7061821", "0.7058221", "0.7031191", "0.7031191", ...
0.7965851
0
Get the stores which keep a specific article in stock Returns a list of store ID's.
def get_product_stores(article_number): store_list = _find_store_with_article(article_number, db_interface.get_stock(), db_interface.get_suffices()) meta = {'count': len(store_list)} resp = Response(json.dumps({'stock': store_list, 'meta': meta}, indent=4), content_type='application/json; charset=utf8') ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_products_stores():\n if not request.args:\n abort(400) # Need at least one article ID/number!\n args = MultiDict(request.args)\n article_nums = args.getlist('article_number')\n if not len(article_nums):\n abort(400) # Same as above\n stores = []\n stock = db_interface.get_...
[ "0.69011724", "0.66640097", "0.6219218", "0.60416234", "0.59874713", "0.58311075", "0.58261603", "0.5822265", "0.58212626", "0.581741", "0.5780668", "0.5744769", "0.57045937", "0.55882335", "0.5581736", "0.5535259", "0.5457178", "0.54237443", "0.53617615", "0.53542143", "0.53...
0.5978075
5
Get the stores which keep all articles in the GET string in stock Returns a list of store ID's.
def get_products_stores(): if not request.args: abort(400) # Need at least one article ID/number! args = MultiDict(request.args) article_nums = args.getlist('article_number') if not len(article_nums): abort(400) # Same as above stores = [] stock = db_interface.get_stock() s...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_stores(self, product_id: str) -> List:\n product_stores_request = \"\"\"SELECT s.store_name\n FROM store s\n INNER JOIN store_has_product shp ON s.id = shp.store_id\n WHERE shp.product_id = %s\"\"\"\n stores_list = []\n for store in self.query(product_s...
[ "0.65085787", "0.63204056", "0.62326276", "0.614906", "0.61243194", "0.6048765", "0.6004646", "0.5868923", "0.5855157", "0.5679664", "0.56665885", "0.55399525", "0.5526798", "0.5520373", "0.54900014", "0.54592115", "0.54465157", "0.5404198", "0.53789556", "0.5340604", "0.5328...
0.7157599
0
Get quaternion from roll, pitch, yaw.
def quaternion_from_rpy(roll, pitch, yaw): quaternion = tf.transformations.quaternion_from_euler(roll, pitch, yaw) return pyquaternion.Quaternion(numpy.roll(quaternion, 1))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def euler_to_quaternion(yaw, pitch, roll):\r\n cy = math.cos(yaw * 0.5)\r\n sy = math.sin(yaw * 0.5)\r\n cp = math.cos(pitch * 0.5)\r\n sp = math.sin(pitch * 0.5)\r\n cr = math.cos(roll * 0.5)\r\n sr = math.sin(roll * 0.5)\r\n w = cy * cp * cr + sy * sp * sr\r\n x = cy * cp * sr - sy * sp *...
[ "0.7953754", "0.7841357", "0.7620825", "0.75220716", "0.75220716", "0.7521056", "0.7493996", "0.74924016", "0.7404782", "0.7395739", "0.7300541", "0.72954714", "0.7242815", "0.72005993", "0.7150538", "0.70922583", "0.70909405", "0.70467824", "0.6984429", "0.6930416", "0.69220...
0.78286123
2
Get the rollpitchyaw representation of a twist given by quaternions.
def rpy_from_quaternion(quaternion): (yaw, pitch, roll) = quaternion.yaw_pitch_roll return (roll, pitch, yaw)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def yaw_pitch_roll(self):\n\n self._normalise()\n yaw = np.arctan2(2*(self.q[0]*self.q[3] - self.q[1]*self.q[2]),\n 1 - 2*(self.q[2]**2 + self.q[3]**2))\n pitch = np.arcsin(2*(self.q[0]*self.q[2] + self.q[3]*self.q[1]))\n roll = np.arctan2(2*(self.q[0]*self.q[1] - self.q[2]*s...
[ "0.7382278", "0.6887287", "0.6857325", "0.6780679", "0.67664605", "0.6685998", "0.65583295", "0.6447354", "0.6410642", "0.64059097", "0.63824207", "0.63195425", "0.62963843", "0.6271071", "0.6234782", "0.62149435", "0.6214868", "0.62147355", "0.6191126", "0.6187017", "0.61870...
0.69259286
1
Returns a byte string representing the json serialized object
def deserialize(self, obj): try: return json.loads(obj.decode('utf-8')) except (JSONDecodeError, TypeError, UnicodeDecodeError): raise DeserializationError
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def serialize(self) -> bytes:\n return json_dumps(self._to_dict()).encode()", "def serialize(self) -> bytes:\n return json_dumps(self._to_dict()).encode()", "def serialize(self) -> bytes:\n return json_dumps(self._to_dict()).encode()", "def _json_serialize(obj: Any) -> str:\n if i...
[ "0.79402775", "0.79402775", "0.79402775", "0.785872", "0.7685481", "0.7632208", "0.7622028", "0.7579388", "0.7579388", "0.7579388", "0.7521778", "0.740988", "0.73589146", "0.7167495", "0.7160008", "0.7121365", "0.7121293", "0.71028", "0.7095615", "0.70918137", "0.7079242", ...
0.0
-1
calculate labeled sum along first axis
def _broadcast_labeled_sum(x, labels, nlabels): # only works for 2d arrays with labels along axis==0 if x.ndim == 2: xr = x else: xr = x.reshape(x.shape[0], -1) assert (xr.shape[:1] == labels.shape) # get labeled sums output = _labeled_sum(xr, labels, nlabels) #return resha...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def broadcast_labeled_sum(x, labels, nlabels, axis=0, roll=None):\n if axis != 0:\n x = np.rollaxis(x, axis, 0)\n\n output = _broadcast_labeled_sum(x, labels, nlabels)\n\n if roll is not None:\n output = np.rollaxis(output, 0, roll)\n return output", "def sum_cluster(self, labelled_clus...
[ "0.7018688", "0.6490903", "0.62788963", "0.6156169", "0.61549294", "0.60924685", "0.60470384", "0.6029437", "0.59316695", "0.592157", "0.5917872", "0.5897082", "0.5896874", "0.5883764", "0.5876332", "0.58674896", "0.5858859", "0.5844308", "0.5815661", "0.5812945", "0.58123314...
0.68938917
1
calculate labeled sum along axis
def broadcast_labeled_sum(x, labels, nlabels, axis=0, roll=None): if axis != 0: x = np.rollaxis(x, axis, 0) output = _broadcast_labeled_sum(x, labels, nlabels) if roll is not None: output = np.rollaxis(output, 0, roll) return output
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _broadcast_labeled_sum(x, labels, nlabels):\n # only works for 2d arrays with labels along axis==0\n if x.ndim == 2:\n xr = x\n else:\n xr = x.reshape(x.shape[0], -1)\n\n assert (xr.shape[:1] == labels.shape)\n # get labeled sums\n output = _labeled_sum(xr, labels, nlabels)\n\n ...
[ "0.6716737", "0.6456776", "0.628028", "0.6112538", "0.60546815", "0.602293", "0.5987725", "0.5946752", "0.59284586", "0.5876188", "0.5863137", "0.5862285", "0.58510786", "0.5842105", "0.58180684", "0.58069956", "0.58052224", "0.57861125", "0.57779616", "0.5769365", "0.5699871...
0.7166863
0
r""" Return the axes argument for `fftn`. >>> X = np.zeros((5, 2, 2, 2)) >>> print MKSRegressionModel()._axes(X) [1 2 3]
def _axes(self, X): return np.arange(len(X.shape) - 1) + 1
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def axes(self) -> np.ndarray: # array[Axes]\n return self._axes", "def axes(self):\n return self._axes", "def axes(self):\n return self._axes", "def feature_axes(self):\n raise NotImplementedError()", "def axesnames(self):\n return self._axesnames", "def axes_of_symmetry(s...
[ "0.69732517", "0.670188", "0.670188", "0.6559298", "0.6485413", "0.61661816", "0.6141011", "0.6075821", "0.58936983", "0.589313", "0.5880164", "0.5864553", "0.58011097", "0.58011097", "0.57908237", "0.5780383", "0.5671003", "0.5613607", "0.55903715", "0.55772007", "0.55478936...
0.7044639
0
View function for adding a new set. Via a form the user enters a set code to retrieve. Optionally, the user can indicate that this set is held, i.e. all parts are added to my parts.
def addset(request): # If this is a POST request we need to process the form data if request.method == 'POST': # create a form instance and populate it with data from the request: form = AddSetForm(request.POST) # check whether it's valid: if form.is_valid(): # proce...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_set(self): # TODO test\n self.set_tree.remove_node(self.adding_node)\n i = len(self.exercise.sets)\n self.exercise.sets.append(Set())\n item = TreeViewLabel(text=\"Set \" + str(i))\n set_node = TreeViewSet(exercise=self.exercise, set_id=i, session=self.session)\n ...
[ "0.6643125", "0.65877193", "0.54774004", "0.53665334", "0.5284385", "0.52604187", "0.5210809", "0.517877", "0.51618266", "0.51553386", "0.51492554", "0.51400846", "0.51080763", "0.5107906", "0.5102681", "0.5102102", "0.5095473", "0.50814414", "0.5069169", "0.5057189", "0.5054...
0.76564026
0
conv2d returns a 2d convolution layer with full stride.
def conv2d(x, W): return tf.nn.conv2d(x, W, strides=[1, 1, 1, 1], padding='SAME')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_conv2d():\n img = np.array([\n [0.3, 0.5, 0.7, 0.9],\n [0.1, 0.3, 0.5, 0.7],\n [0.9, 0.7, 0.5, 0.3],\n ])\n template = np.array([\n [1, 0],\n [1, 0],\n ])\n template = np.flipud(np.fliplr(template))\n return fftconvolve(img, template, mode='valid')", ...
[ "0.7629538", "0.7627165", "0.7579147", "0.7463493", "0.74578935", "0.74578935", "0.7386576", "0.7337714", "0.7330282", "0.73295087", "0.7313963", "0.73015827", "0.7296284", "0.72696656", "0.72463566", "0.72321266", "0.72088444", "0.7196564", "0.71902525", "0.7187835", "0.7152...
0.7426121
9
weight_variable generates a weight variable of a given shape.
def weight_variable(shape): initial = tf.truncated_normal(shape, stddev=0.1) return tf.Variable(initial)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def weight_variable(shape):\n initial = tf.truncated_normal(shape, stddev=0.1)\n return tf.get_variable(\n 'weight', initializer=initial, regularizer=tf.nn.l2_loss)", "def weight_variable(shape):\n initial = tf.truncated_normal(shape)\n return tf.Variable(initial)", "def create_weight_variable(shape):...
[ "0.82682097", "0.8235508", "0.8158841", "0.8156995", "0.81399417", "0.81399417", "0.81399417", "0.8137802", "0.812119", "0.80655366", "0.7983301", "0.79793143", "0.79584336", "0.79206425", "0.777795", "0.7553387", "0.7533732", "0.75042933", "0.73055935", "0.7289978", "0.72055...
0.81348443
17
Determines which NUMA node given network device belongs to
def dev_node(self, dev, fake=False): if fake: return self.__FAKE_DEV.get(dev, -1) filename = '/sys/class/net/{0}/device/numa_node'.format(dev) if not os.path.isfile(filename): return -1 with open(filename) as fd: return int(fd.read().strip())
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_cpu_number():\n try:\n output = subprocess.check_output('lscpu').decode(\"utf-8\")\n for line in output.splitlines():\n m = re.match(r'NUMA node0.*:\\s*\\d+-(\\d+)', line)\n if m:\n return m.group(1)\n except OSError:\n pass\n sys.stderr.wr...
[ "0.66792756", "0.6584289", "0.64956766", "0.6328487", "0.62732524", "0.6237194", "0.61577135", "0.61455196", "0.6131031", "0.6067646", "0.6067103", "0.6067103", "0.6022279", "0.6009558", "0.599932", "0.5925769", "0.59163326", "0.5881263", "0.58721143", "0.5816217", "0.5791548...
0.71188384
0
constructor Takes email address, project and in_cloud to access the credentials needed. If it's running in the cloud (in_cloud=True), is assumes it can simply use the project default service account creds to access Firestore. This is different to the DV360/CM/SA360/ADH fetchers as they have to use a person's real crede...
def __init__(self, email: str = None, project: str = None, in_cloud: bool = True): self._in_cloud = in_cloud self._project = project self._email = email
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self, **kwargs):\n\n super().__init__(transaction=None, config=None)\n secret_data = kwargs.get('secret_data')\n self.project_id = secret_data.get('project_id')\n\n try:\n credentials = google.oauth2.service_account.Credentials.from_service_account_info(secret_da...
[ "0.6617427", "0.65312475", "0.6135275", "0.61236876", "0.6046232", "0.6019621", "0.60087276", "0.5989147", "0.5979372", "0.5936632", "0.59193534", "0.5905617", "0.5863655", "0.58593005", "0.5853143", "0.58487743", "0.5847294", "0.58395565", "0.5825567", "0.5784465", "0.578251...
0.74824977
0
Take the dot product between two arrays. Can handle numpy arrays and scipy.sparse matrices.
def dot(left, right): if sp.sparse.issparse(right) or sp.sparse.issparse(left): result = left*right else: result = left.dot(right) return result
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def dot(a, b):\n return np.vdot(a.arr,b.arr)", "def _dot(a, b):\n return np.einsum('ijk,ikl->ijl', a, b)", "def vdot(a, b):\n return np.vdot(a.ravel(), b.ravel())", "def dot(array1, array2):\n return Nd4jArray(array1.array.mmul(array2.array))", "def dot_product(a, b):\n if len(a) != len(b):\...
[ "0.8498483", "0.8128013", "0.7964246", "0.79496515", "0.7903003", "0.7821902", "0.78125453", "0.779745", "0.77845275", "0.7722153", "0.7721996", "0.7699224", "0.76626015", "0.76305616", "0.7606442", "0.76023924", "0.75788695", "0.7566752", "0.75599015", "0.75465393", "0.74946...
0.70115656
59