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
Initialize an auction. Requires a list of bidders that are attending the auction and can bid.
def __init__(self, bidders): self._bidders = bidders self._auctioneer = Auctioneer() for bidder in bidders: self._auctioneer.register_bidder(bidder)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self, bidders, item, starting_price):\n self._bidders = bidders\n self._item = item\n self._starting_price = starting_price\n self._auctioneer = Auctioneer(self._bidders, self._starting_price)", "def __init__(self, bidders, starting_price):\n self._bidders = bidder...
[ "0.74261135", "0.6339849", "0.55897886", "0.55775404", "0.5539653", "0.55226266", "0.5426949", "0.5302378", "0.5291593", "0.528372", "0.5259324", "0.52153945", "0.52027977", "0.51631993", "0.5124005", "0.51217663", "0.5076946", "0.50655806", "0.5064461", "0.5046678", "0.50405...
0.79346365
0
Build learning rate. Builds learning rate from config. Learning rate schedule is built according to the learning rate config. If there is no learning rate config, optimizer learning rate is returned.
def build_learning_rate(self): # TODO(arashwan): Explore if we want to only allow explicit const lr sched. if not self._lr_config: lr = self._optimizer_config.learning_rate else: lr = LR_CLS[self._lr_type](**self._lr_config.as_dict()) if self._warmup_config: lr = WARMUP_CLS[self._war...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _create_learning_rate_scheduler(learning_rate_config, optimizer, last_step=-1):\n lr_scheduler = None\n learning_rate_type = learning_rate_config.name \n if learning_rate_type == 'constant_learning_rate': \n\n lr_scheduler = learning_schedules.Constant(\n optimizer, last_step=last_s...
[ "0.740471", "0.7255426", "0.7142119", "0.6983899", "0.695154", "0.68485224", "0.6821002", "0.6809516", "0.6779392", "0.6775517", "0.6679199", "0.6653828", "0.66508543", "0.6650463", "0.65793234", "0.6559902", "0.65572834", "0.65396976", "0.65324676", "0.65182894", "0.6497175"...
0.81681573
0
load image, returns cuda tensor
def image_loader(image_name): image = Image.open(image_name) image = loader(image).float() image = Variable(image, requires_grad=True) image = image.unsqueeze(0) #this is for VGG, may not be needed for ResNet return image.cuda() #assumes that you're using GPU
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def load_image(filename):\n image = Image.open(filename).convert('RGB')\n image_tensor = loader(image).float()\n image_var = Variable(image_tensor).unsqueeze(0)\n return image_var.cuda()", "def _load_image(self, id_: str) -> Tensor:\n filename = os.path.join(self.root, \"output\", id_ + \".jpg...
[ "0.83418316", "0.74591607", "0.72595316", "0.7179026", "0.713886", "0.6898087", "0.6725782", "0.6711598", "0.67114305", "0.6683614", "0.66531", "0.6559475", "0.6547596", "0.6538703", "0.65268356", "0.6516286", "0.6506275", "0.64808065", "0.6410097", "0.6328036", "0.630357", ...
0.745242
2
Create and return a dictionary of test variables.
def get_variables(interface1, interface2, interface3): variables = { "interface1": interface1, "interface2": interface2, "interface3": interface3, # Interface 2 - ingress "settings_receive": { "state": "receive", "iface-ref": interface2, }, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def dictOfRandomVariables(self):\n return dict()", "def make_vars(tups):\n return dict([(varname, value) for varname, value in tups])", "def _get_test_variables():\n if __name__ == \"__main__\":\n return _MOCKUP_TEST_VARIABLES\n else:\n return BuiltIn().get_variables()", "def test...
[ "0.713402", "0.7014831", "0.6845508", "0.679355", "0.6768671", "0.65956855", "0.655639", "0.6466788", "0.634339", "0.634321", "0.63002807", "0.6287933", "0.62049806", "0.61984396", "0.6158076", "0.61425424", "0.61151665", "0.61117166", "0.60897326", "0.60648376", "0.60618204"...
0.53664434
79
Extract the date of the last update of the feed
def get_date(logs_feed, date_loc=3): line = logs_feed[date_loc] date = re.findall('\d+-\d+-\d+', line) return date
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def last_updated(self):\n try:\n date_ = parse(self._data.get('last_updated'))\n except (ValueError, TypeError):\n date_ = None\n return date_", "def last_update(self):\n date, time = self.data.get(\"update_date\"), self.data.get(\"update_time\")\n if date...
[ "0.75879025", "0.74704224", "0.74629664", "0.74489754", "0.74489754", "0.7434016", "0.7338316", "0.73223543", "0.72534186", "0.71304536", "0.7125095", "0.7099713", "0.70917124", "0.708785", "0.708785", "0.70833826", "0.69223493", "0.6879326", "0.6874087", "0.68003005", "0.679...
0.0
-1
Creates a dataframe for analysis
def create_data_frame(logs_feed, drop_elements=15): # Drop the first n elements from the feed, which are the header # Also remove the last element, which is empty logs_feed = logs_feed[drop_elements:] logs_feed.remove('') df = pd.DataFrame({'col': logs_feed}) df = pd.DataFrame(df.col.str.split...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_dataframe():\r\n\r\n df = pd.read_csv('data/data.csv', header=0)\r\n return df", "def data_frame_creator(self):\n\n return pd.DataFrame()", "def create_dataframe(self):\n\n df = pd.DataFrame({'date': [],\n 'RUN': [],\n 'CLONE': ...
[ "0.777685", "0.75023323", "0.72517425", "0.72086865", "0.71960413", "0.7186794", "0.7121306", "0.70257306", "0.7022812", "0.6957896", "0.69468117", "0.69043684", "0.6890469", "0.68823653", "0.6869039", "0.6837101", "0.6802049", "0.6794379", "0.6782717", "0.67690843", "0.67462...
0.0
-1
Creates a classification model.
def create_model(bert_model_hub, is_predicting, input_ids, input_mask, segment_ids, labels, num_labels): bert_module = hub.Module(bert_model_hub, trainable=True) bert_inputs = dict(input_ids=input_ids, input_mask=input_mask, segment_ids=segment_ids...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_model(self):\n self.classifier = DecisionTreeClassifier(max_depth=1)", "def create_model(self, C : float =1):\n self.classifier = RandomForestClassifier(max_depth=5)", "def create_model():\n\n # Create a sequential model (a simple NN is created) adding a softmax activation at the en...
[ "0.7451048", "0.716728", "0.70753753", "0.69427526", "0.69337225", "0.69306064", "0.6929345", "0.68631464", "0.68004555", "0.6769279", "0.6737084", "0.66838384", "0.66709864", "0.660953", "0.65912193", "0.6564333", "0.6534873", "0.6526978", "0.6525293", "0.6521778", "0.651739...
0.0
-1
Initializes the `ParallelAtariEnv` class. Frameskip should be either a tuple (indicating a random range to choose from, with the top value exclude), or an int.
def __init__( self, game, num_players, mode_num=None, seed=None, obs_type="rgb_image", full_action_space=False, env_name=None, max_cycles=100000, render_mode=None, auto_rom_install_path=None, ): EzPickle.__init__( ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self, env, frame_skip=4, noop_max=30, screen_size=84):\n super().__init__(env)\n if frame_skip <= 0:\n raise ValueError('Frame skip should be strictly positive, got {}'.\n format(frame_skip))\n if screen_size <= 0:\n raise ValueErr...
[ "0.60820407", "0.605091", "0.5917827", "0.5615865", "0.54434", "0.54434", "0.542578", "0.54251206", "0.5412155", "0.53935957", "0.5377698", "0.53718895", "0.52744395", "0.5064099", "0.5039481", "0.5036589", "0.50060934", "0.5005099", "0.49867693", "0.4950876", "0.4918994", ...
0.0
-1
Get the DC/OS aggregated configuration object.
def get_dcos_conf(self): dstor_root_url = ( self.cluster_conf.get('distribution-storage', {}).get( 'rooturl', '' ) ) dstor_linux_pkg_index_path = ( self.cluster_conf.get('distribution-storage', {}).get( 'dcosclusterpkginfopath'...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_full_config(self):\n return self._read_config()", "def config(self, request):\n config = OtterConfig(self.store, self.tenant_id, self.group_id,\n self.dispatcher)\n return config.app.resource()", "def get_config(self):\n return self.config", "de...
[ "0.63046175", "0.62944984", "0.6238388", "0.6237402", "0.618862", "0.6149334", "0.6149334", "0.6149334", "0.61477345", "0.61470026", "0.6144339", "0.6144339", "0.6126788", "0.61242527", "0.61002314", "0.6081558", "0.6052986", "0.603883", "0.603883", "0.603883", "0.603883", ...
0.0
-1
Sets the name of this Attribute.
def name(self, name): self._name = name
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def name(self, name: \"str\"):\n if name is None:\n raise ValueError(\"Invalid value for `name`, must not be `None`\")\n self._attrs[\"name\"] = name", "def name(self, name: \"str\"):\n if name is None:\n raise ValueError(\"Invalid value for `name`, must not be `None`\"...
[ "0.83754855", "0.83754855", "0.83754855", "0.83745116", "0.8327766", "0.8327766", "0.83165723", "0.83028525", "0.83028525", "0.83028525", "0.83028525", "0.83028525", "0.82981396", "0.827665", "0.82648706", "0.8261753", "0.82248336", "0.8199869", "0.81744486", "0.8150544", "0....
0.0
-1
Sets the attr_type of this Attribute.
def attr_type(self, attr_type): self._attr_type = attr_type
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_type(self, value):\n self._set_one_attribute(self.AttributeNames.TYPE, value)\n return self", "def set_type(self, type):\n self.type = type", "def set_type(self, type):\n self.type = type", "def set_type(self, type):\n self._type = type", "def SetType(self, ct_typ...
[ "0.7213982", "0.7204721", "0.7204721", "0.7151654", "0.6861258", "0.68505895", "0.67771536", "0.6763633", "0.6763633", "0.67026186", "0.67026186", "0.67026186", "0.67026186", "0.67026186", "0.67026186", "0.67026186", "0.67026186", "0.67026186", "0.67026186", "0.67026186", "0....
0.9112552
0
Sets the old of this Attribute.
def old(self, old): self._old = old
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_old_value(self, value):\n self._oldvalue = value", "def setOriginal(self,neworiginal):\n\t\tself.original = neworiginal;", "def SetOldItem(self, item):\r\n \r\n self._itemOld = item", "def SetAttributes(self, attr):\r\n \r\n if self._ownsAttr:\r\n del self._...
[ "0.68982327", "0.6665491", "0.6577958", "0.638154", "0.62921625", "0.6229316", "0.6191402", "0.611278", "0.6080312", "0.6004132", "0.5951978", "0.5933243", "0.58889735", "0.5888092", "0.5787422", "0.5766565", "0.57571614", "0.5754026", "0.57534814", "0.5746295", "0.56894207",...
0.8157808
0
Sets the sensitive of this Attribute.
def sensitive(self, sensitive): self._sensitive = sensitive
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_sensitive(self, flag):\n\t\tself._edit.set_sensitive(flag)", "def set_case_sensitive(self, v):\n self._case_sensitive = bool(v)", "def sensitive(self, value: object) -> Union[sensitive, object]:\n return wrap_sensitive_value(value)", "def set_study_system_attr(self, study_id: int, key: ...
[ "0.63211143", "0.6299066", "0.59507227", "0.59470856", "0.59218365", "0.5794001", "0.5791762", "0.56184274", "0.5614679", "0.5613915", "0.5533756", "0.5533756", "0.55251807", "0.55160207", "0.55123484", "0.547593", "0.54336107", "0.54336107", "0.5410096", "0.5379793", "0.5371...
0.77847195
0
Returns true if both objects are equal
def __eq__(self, other): if not isinstance(other, Attribute): 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
Yield all prefixes of s. >>> list(prefixes('both')) ['b', 'bo', 'bot', 'both']
def prefixes(s): if s: yield from prefixes(s[:-1]) # First yield prefixes from s[:-1], then yield the last one s. yield s
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def prefixes(s):\n if s:\n yield from prefixes(s[:-1])\n yield s", "def prefixes(S):\r\n result = set()\r\n for s in S:\r\n for i in range(len(s) + 1):\r\n result.add(s[:i])\r\n return result", "def substrings(s):\n if s:\n yield from prefixes(s) # 获得当前s的所有...
[ "0.7734722", "0.6848494", "0.67797023", "0.64430505", "0.63705957", "0.6309781", "0.62311447", "0.6197266", "0.6069928", "0.5989622", "0.59707475", "0.5957035", "0.5918728", "0.5898806", "0.58668107", "0.58284616", "0.57844543", "0.5753975", "0.5731725", "0.5729402", "0.57277...
0.7561167
1
Returns all viewer controllers with the matching data_type. If none is specified all viewers are returned.
def getViewerControllers(self, data_type: str = None) -> List[ViewerController]: if data_type: return [v for v in self._model.getViewerCtrls().values() if v.data_type == data_type] return self._model.getViewerCtrls().value()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getMatchingViews(self, data, info):\n priority = self.getCachedDataPriority(data, info)\n if priority == DataView.UNSUPPORTED:\n return []\n return [self]", "def getMatchingViews(self, data, info):\n if not self.isSupportedData(data, info):\n return []\n ...
[ "0.5442749", "0.52813345", "0.52406836", "0.5139217", "0.5138126", "0.5070898", "0.50426686", "0.4992711", "0.4975748", "0.49484757", "0.4938218", "0.49378407", "0.48736084", "0.48676506", "0.48650333", "0.48596722", "0.48541626", "0.48378032", "0.4827658", "0.47887492", "0.4...
0.85228384
0
Returns the viewer controller with id=v_id. When no id is provided the active viewer controller is returned.
def getViewerController(self, v_id=-1) -> ViewerController: if v_id == -1: v_id = self.getCurrentId() if v_id == -1: # No tab open return None viewer_ctrl = self._model.getViewerCtrl(v_id) return viewer_ctrl
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getViewer(self, v_id=-1) -> Viewer:\n viewer_ctrl = self.getViewerController(v_id)\n if viewer_ctrl is None:\n return None\n return viewer_ctrl.view", "def _viewer_by_id(self, vid):\n return self._viewer_store.get(vid)", "def get_viewer(self, v_id):\n try:\n ...
[ "0.77898765", "0.7000509", "0.61816996", "0.5584369", "0.55620545", "0.55558157", "0.54195505", "0.5347084", "0.53087354", "0.52126384", "0.51951814", "0.5139931", "0.5132921", "0.51321894", "0.5107216", "0.50781167", "0.5052237", "0.5037417", "0.5021909", "0.5020708", "0.500...
0.8317077
0
Set the data model of viewer with id=v_id. If id is 1 the currently viewed data will be changed.
def setDataModel(self, data_model: DataModel, v_id=-1): if v_id == -1: v_id = self.getCurrentId() assert v_id is not -1, "Invalid set data command encountered." self._model.getViewerCtrl(v_id).updateModel(data_model) self._onDataChanged(v_id)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getDataModel(self, v_id=-1) -> DataModel:\n viewer_ctrl = self.getViewerController(v_id)\n if viewer_ctrl is None:\n return None\n return viewer_ctrl.model", "def set_model_id(self, model_id):\n assert isinstance(model_id, int)\n for atm in self.iter_alt_loc():\n...
[ "0.6131403", "0.60756", "0.59847116", "0.5817927", "0.57927376", "0.5770314", "0.57593644", "0.57317984", "0.56194115", "0.560448", "0.5580007", "0.5569211", "0.5569211", "0.5569211", "0.5569211", "0.55426216", "0.55426216", "0.55269116", "0.55227065", "0.5503186", "0.5477512...
0.8150031
0
Call api with PUT method
def put_call(url, params=None, headers=None): if params is None: params = {} response = requests.put(url, data=params, headers=headers) if response.status_code == 401: raise RedirectException(reverse('b2b_control:logout')) return response
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def do_PUT(self,):\n self.http_method = 'PUT'\n # Nothing to do for now.\n pass", "def put(self, *args, **kwargs):\n self.request(\"put\", *args, **kwargs)", "def _put(self, *args, **kwargs):\n return self._request('put', *args, **kwargs)", "def put(self,request, pk =None):...
[ "0.82589996", "0.807299", "0.79846513", "0.7951082", "0.78796244", "0.7865456", "0.7836686", "0.7836686", "0.7836686", "0.7812054", "0.77787644", "0.7673365", "0.7645013", "0.763679", "0.761422", "0.7606806", "0.7590911", "0.7561538", "0.75547904", "0.75339526", "0.7508328", ...
0.6726155
87
Returns a JSON representation of this model. This may not be the best way to do this, and could potentially have security issues with passwords and stuff, so use with care.
def to_json(self, exclude=None, include=None, manytomany=False): field_names = include or self._meta.get_all_field_names() # filter the list of fields names to only the include set if exclude: field_names = set(field_names).difference(exclude) ret = {} for field_nam...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def to_json(self) -> str:\n return json.dumps(model_to_dict(self))", "def json(self):\n return {\n 'id': self.id,\n 'name': self.name\n }", "def json(self):\n return {'id': self.id, 'name': self.name, 'description': self.description}", "def json(self):\n ...
[ "0.82321376", "0.8188359", "0.81811965", "0.81076187", "0.79839474", "0.79013044", "0.788613", "0.7855928", "0.7830969", "0.78147477", "0.78061277", "0.77896816", "0.77780133", "0.77763", "0.77763", "0.77763", "0.77763", "0.77763", "0.77763", "0.77763", "0.77763", "0.77763"...
0.0
-1
Get user last name from saml userdata.
def get_user_lastname(): if not is_authenticated() or 'samlUserdata' not in session: return None lastname = session.get('samlUserdata', {}).get(SAML_ATTRIBUTES.get('last_name', None), False) return lastname[0] if lastname else not_found('lastname') return None
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def ldap_get_lastname(self, user):\n result = super(Auth42, self)._search_not_empty(user)\n if result is not None:\n lastname = result.get(\"last-name\")[0]\n return lastname\n\n return None", "def last_name(self, instance):\r\n return instance.user.last_name", ...
[ "0.795066", "0.7900529", "0.7359204", "0.7359204", "0.731926", "0.730663", "0.7302523", "0.7291636", "0.7235728", "0.7235728", "0.7235728", "0.7235728", "0.71868217", "0.7185165", "0.7150566", "0.71079594", "0.7105495", "0.7095983", "0.7091444", "0.7088177", "0.70700663", "...
0.851126
0
Get user first name from saml userdata.
def get_user_firstname(): if not is_authenticated() or 'samlUserdata' not in session: return None first_name = session.get('samlUserdata', {}).get(SAML_ATTRIBUTES.get('first_name', None), False) return first_name[0] if first_name else not_found('first_name') return None
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def ldap_get_firstname(self, user):\n result = super(Auth42, self)._search_not_empty(user)\n if result is not None:\n firstname = result.get(\"first-name\")[0]\n return firstname\n\n return None", "def first_name(self, instance):\r\n return instance.user.first_na...
[ "0.8098772", "0.77060914", "0.75251395", "0.7492652", "0.7481979", "0.73709047", "0.73709047", "0.7341582", "0.72513014", "0.72513014", "0.72513014", "0.72427446", "0.7209429", "0.71988547", "0.7197536", "0.7197069", "0.7191573", "0.7191573", "0.71600175", "0.7111262", "0.710...
0.8692029
0
Get the HAKA organization name from the saml userdata
def get_user_home_organization_name(): if not is_authenticated() or 'samlUserdata' not in session: return None home_organization_id = session.get('samlUserdata', {}).get(SAML_ATTRIBUTES.get('haka_org_name', None), False) return home_organization_id[0] if home_organization_id else not_found('home_o...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_user_home_organization_id():\n if not is_authenticated() or 'samlUserdata' not in session:\n return None\n\n home_organization = session.get('samlUserdata', {}).get(SAML_ATTRIBUTES.get('haka_org_id', None), False)\n\n return home_organization[0] if home_organization else not_found('home_org...
[ "0.68965375", "0.63896024", "0.63870764", "0.6334648", "0.6203369", "0.61989516", "0.6117481", "0.6117481", "0.6113731", "0.6010214", "0.5993357", "0.59910196", "0.5927182", "0.59177977", "0.58758307", "0.58699155", "0.58699155", "0.58664364", "0.5865138", "0.5862659", "0.582...
0.77034974
0
initialize first and last name attributes
def __init__(self, first_name, last_name): self.first_name = first_name self.last_name = last_name
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self, first_name, last_name):\r\n self.first_name = first_name\r\n self.last_name = last_name", "def __init__(self, first_name: str, last_name: str):\n self.first_name = first_name\n self.last_name = last_name", "def __init__(self, firstname, lastname):\n self.fi...
[ "0.7934533", "0.78472304", "0.755421", "0.7449546", "0.7408892", "0.71676874", "0.70508283", "0.7031853", "0.7030095", "0.7030095", "0.7030095", "0.6984093", "0.6976189", "0.69449425", "0.69449425", "0.69449425", "0.69449425", "0.69449425", "0.69449425", "0.69449425", "0.6944...
0.7870517
1
Return a generator of the next 7 days from now on in datetime objects.
def _next_week(self) -> datetime.datetime: now = datetime.datetime.now() for i in range(7): yield now + datetime.timedelta(i)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def generate_seven_days(start_date):\n\n seven_days = []\n\n for i in xrange(7):\n days_to_add = datetime.timedelta(days=i)\n seven_days.append([start_date + days_to_add, 0])\n\n return seven_days", "def get_next_due_date() -> ScheduleGenerator:\n while True:\n time_since...
[ "0.7109937", "0.68108976", "0.67577344", "0.6630712", "0.66193426", "0.6526025", "0.6522371", "0.64983505", "0.64251584", "0.63124466", "0.62854475", "0.62854475", "0.60837054", "0.6073607", "0.6057206", "0.6034821", "0.6016849", "0.60111105", "0.59638196", "0.5937342", "0.59...
0.7966248
0
Creates stacked Lasagne layers ConvLayer > BN > (ReLu)
def build_simple_block(self, incoming_layer, names, num_filters, filter_size, stride, pad, use_bias=False, nonlin=rectify): net = [] net.append(( names[0], ConvLayer(incoming_layer, num_filters, filter_size, pad, strid...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _init_layers(self):\n self.relu = nn.ReLU(inplace=True)\n self.rpn_convs = nn.ModuleList()\n for i in range(self.stacked_convs):\n chn = self.in_channels if i == 0 else self.feat_channels\n self.rpn_convs.append(\n ConvModule(\n chn,\...
[ "0.6989949", "0.68998003", "0.6885206", "0.6829654", "0.6765221", "0.67376006", "0.6705406", "0.6701936", "0.6692681", "0.6608649", "0.65809983", "0.65574276", "0.65439224", "0.6541693", "0.6533841", "0.65119636", "0.6456603", "0.64468086", "0.6408967", "0.6391306", "0.638709...
0.0
-1
Center images from [0, 1) to [1, 1).
def from_0_1_to_m1_1(images): # shifting from [0, 1) to [-1, 1) is equivalent to assuming 0.5 mean mean = 0.5 proimages = (images - mean) / mean return proimages
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def center_image(image):\r\n image.anchor_x = image.width / 2\r\n image.anchor_y = image.height / 2", "def center_image(image):\r\n image.anchor_x = image.width / 2\r\n image.anchor_y = image.height / 2", "def center_image(image):\n image.anchor_x = image.width/2\n image.anchor_y = image.heig...
[ "0.78312856", "0.78312856", "0.7783776", "0.71920174", "0.71734345", "0.7153954", "0.7004542", "0.68104917", "0.6634365", "0.6552315", "0.64641035", "0.62587154", "0.6219706", "0.621891", "0.6191288", "0.61653024", "0.6163039", "0.6161792", "0.6131814", "0.61275965", "0.60952...
0.0
-1
Match the subscriptions given the request. This is an API handler, which requires that we have an authenticated user making the request. We'll require that the user be a service account (from the main dashboard service).
def MatchSubscriptions(): # pylint: disable=unused-variable try: match_request = json_format.Parse(request.get_data(), sheriff_config_pb2.MatchRequest()) except json_format.ParseError as error: return jsonify( {'messages': [{ 'severit...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def search_subscriptions(self,\n body):\n\n return super().new_api_call_builder.request(\n RequestBuilder().server('default')\n .path('/v2/subscriptions/search')\n .http_method(HttpMethodEnum.POST)\n .header_param(Parameter()\n ...
[ "0.62784165", "0.6232305", "0.61924195", "0.6183497", "0.61393994", "0.6048086", "0.59341776", "0.587738", "0.5866468", "0.58238655", "0.5800167", "0.5795715", "0.5754786", "0.57461286", "0.5742718", "0.57341784", "0.57127285", "0.56699026", "0.5664698", "0.56499666", "0.5610...
0.6553017
0
List all visible subscriptions based on identity. This is an API handler, which requires that we have an authenticated user making the request. We'll require that the user be a service account (from the main dashboard service).
def ListSubscriptions(): # pylint: disable=unused-variable try: list_request = json_format.Parse(request.get_data(), sheriff_config_pb2.ListRequest()) except json_format.ParseError as error: return jsonify( {'messages': [{ 'severity': ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getAllSubscriptions(self):\n return self.request(\n \"getAllSubscriptions\",\n )", "def GetSubscriptions(self):\n\n return self.__GetJson(\"/subscriptions\", True)", "def get_subscriptions(self):\n url = '{}/v2/subscriptions'.format(self.url)\n r = requests.get...
[ "0.7103038", "0.67235404", "0.6632215", "0.66239876", "0.64972353", "0.64662254", "0.64352137", "0.6392601", "0.6379294", "0.6359858", "0.6345347", "0.63422376", "0.6339138", "0.6315095", "0.6285763", "0.62799305", "0.6248933", "0.6189641", "0.6056249", "0.60199046", "0.60098...
0.58851963
24
Return the sheet as pandas DataFrame Columns will includes row id, row number and all columns from the sheet
def as_dataframe(self) -> "pd.DataFrame": import pandas as pd df = pd.DataFrame([row.as_series() for row in self.rows]) return df
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def sheet_to_df(access_token, sheet_id):\r\n\r\n api_prefix_url = 'https://api.smartsheet.com/2.0/sheets/' # base Smartsheet api url for Requests\r\n url = api_prefix_url + str(sheet_id) # full url for requests\r\n header = { ...
[ "0.7038521", "0.6917211", "0.6855162", "0.6831457", "0.6542627", "0.6356196", "0.62816405", "0.6241588", "0.62404215", "0.62350345", "0.62024033", "0.61700606", "0.6075437", "0.6029672", "0.60162187", "0.59754944", "0.5943895", "0.5928181", "0.5923189", "0.59130466", "0.58707...
0.5955672
16
Find the lowest date in a set.
def find_min_date(self): to_datetime = lambda x: datetime.datetime.strptime(x, "%Y-%m-%dT%H:%M:%S") all_dates = [to_datetime(event['start']['dateTime'][:-2]) for event in self.formatted_events] self.min_date = min(all_dates).isoformat() + 'Z'
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def find_min(list):\n return find_value_at(list, -1)", "def min_date(self, rows: List[Row], column: DateColumn) -> Date:\n cell_values = [row.values[column.name] for row in rows if row.values[column.name] is not None]\n if not cell_values:\n return Date(-1, -1, -1)\n if not all...
[ "0.67946327", "0.6565658", "0.6515534", "0.64016587", "0.6381117", "0.6290279", "0.626181", "0.626181", "0.6243974", "0.62126845", "0.6111987", "0.6085383", "0.60632193", "0.6060245", "0.6060245", "0.60158", "0.6012896", "0.60089004", "0.5930456", "0.59292114", "0.59041256", ...
0.72074187
0
r"""Retrieves the policies of the specified kind that are attached to a resource. The response lists only policy metadata. In particular, policy rules are omitted.
def ListPolicies(self, request, global_params=None): config = self.GetMethodConfig('ListPolicies') return self._RunMethod( config, request, global_params=global_params)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def storage_policies(self, **kwargs):\n self.logger.debug(f\"Get storage policies data\")\n url_path = 'storage/policies'\n body = self._make_body(kwargs)\n return self._common_get(request_path=url_path, parameters=body)", "def GetPolicies(self):\n policy = {}\n if json is None:...
[ "0.6249802", "0.6172588", "0.6171342", "0.6105031", "0.60641307", "0.59876627", "0.59138805", "0.58983475", "0.5791678", "0.57553416", "0.5743621", "0.5697774", "0.5693408", "0.5625572", "0.5622421", "0.5579065", "0.5552905", "0.55381083", "0.55351686", "0.5480103", "0.547283...
0.5423988
24
Convert results class to a data frame.
def convert_to_data_frame(result, exp_name, nets, critic, loss, seed): label = "{}, {}, {}".format(nets, critic, loss) rows = list( zip( itertools.repeat(exp_name), itertools.repeat(nets), itertools.repeat(critic), itertools.repeat(loss), itertools.repeat(seed...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_pandas(self):\n return pd.DataFrame(self.results)", "def class2df(cl):\n\n attrs = vars(cl)\n cl = {item[0]: item[1] for item in attrs.items()}\n\n return pd.Series(cl)", "def _make_results_dataframe(self):\n LOG.debug(\"Creating Results Dataframes.\")\n results_df = tfs.T...
[ "0.75698775", "0.69792444", "0.69636357", "0.69611144", "0.6893116", "0.6893116", "0.6893116", "0.6893116", "0.6893116", "0.6653173", "0.66197115", "0.661443", "0.661443", "0.6591083", "0.6578844", "0.653863", "0.65054274", "0.6498945", "0.639657", "0.63858455", "0.63716954",...
0.5695909
94
Load the items from a json file into a dict
def load_data(filepath=None): if filepath is None: filepath = LATEST_DATA_SET_PATH with open(filepath) as file: return json.load(file)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def import_json(self) -> dict:\n with open(self.path, encoding=\"utf8\") as json_file:\n return json.load(json_file)", "def load_json(file_path):\n\n \n with open(file_path, 'r') as json_file:\n # print(file_path)\n dictionary = json.loads(json_file.read())\n\n return dic...
[ "0.77533406", "0.75500005", "0.75115085", "0.73858887", "0.72544014", "0.7246707", "0.72351706", "0.7215805", "0.719867", "0.71761054", "0.71552604", "0.71486694", "0.71106184", "0.7106499", "0.70875293", "0.70744884", "0.70615727", "0.7050797", "0.70405436", "0.70163465", "0...
0.0
-1
Return a dict with counts for each item in a list.
def countit(objs): out = {} for el in objs: out[el] = 1 + out.get(el, 0) out = {k: v for k, v in out.items()} return out
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def list_count(l):\n return dict((l.count(it), it) for it in l)", "def count_list_freq(l):\n freq = {}\n for items in l:\n freq[items] = l.count(items)\n return freq", "def count(list: list[str]) -> dict[str, int]:\n result: dict[str, int] = {}\n for keys in list: \n if keys not...
[ "0.8698695", "0.8256635", "0.8130277", "0.8052556", "0.7952563", "0.7896086", "0.7860957", "0.77838254", "0.74510837", "0.7175678", "0.7175678", "0.70304096", "0.6926661", "0.6865944", "0.6838096", "0.68280405", "0.68044394", "0.67807376", "0.6714352", "0.6691596", "0.6688641...
0.70295054
12
A function to visualize bbox in an image.
def draw_pic(img_path: str, bbox: List) -> None: img = cv2.imread(img_path) for v in bbox: x, y, w, h = v[2] cv2.rectangle( img, (int(x), int(y)), (int(x) + int(w), int(y) + int(h)), (255, 0, 0), 2 ) figure(num=None, figsize=(20, 15)) plt.imshow(img) plt.show()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def vis_bbox(image: Image, bbox, color=_GREEN, thick=1) -> Image:\n image = image.astype(np.uint8)\n bbox = list(map(int, bbox))\n x0, y0, x1, y1 = bbox\n cv2.rectangle(image, (x0, y0), (x1, y1), color, thickness=thick)\n return image", "def vis_bbox(im, bbox):\n im = im[:, :, (2, 1, 0)]\n f...
[ "0.7996454", "0.7857208", "0.7833008", "0.78213423", "0.7734536", "0.7685177", "0.7674215", "0.7434697", "0.735096", "0.7340203", "0.72214866", "0.720748", "0.71280617", "0.7118544", "0.71168375", "0.71133965", "0.7106013", "0.7088942", "0.70852655", "0.701709", "0.70166224",...
0.67552
41
A function to get the coordinates of the bbox.
def get_bbox(meta_data: List) -> List: x = [v for v in meta_data[0].split(" ") if v][0] y = [v for v in meta_data[1].split(" ") if v][0] w = [v for v in meta_data[2].split(" ") if v][0] h = meta_data[3].replace(")", "").strip(" ") return [x, y, w, h]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def bbox(self):\n return np.array(\n [[self.position[0], self.position[1]], [self.position[0], self.position[1]]]\n )", "def bounding_box(self):\n latlon00 = self.ij_to_latlon(-1,-1)\n latlon01 = self.ij_to_latlon(-1,self.domain_size[1]+1)\n latlon11 = self.ij_to_lat...
[ "0.77426827", "0.7706961", "0.77060497", "0.76767373", "0.7640586", "0.76337373", "0.7581156", "0.75764585", "0.7547281", "0.7503402", "0.7493702", "0.748634", "0.74824613", "0.7430286", "0.7399646", "0.73975027", "0.7390597", "0.72833455", "0.7278463", "0.72362757", "0.71798...
0.0
-1
A function to visualize predicted bbox in the original images.
def show_pred( img_name: str, pred_file_path: str, train_file_path: str, img_folder_path: str, confidence: Optional[float] = None, label: Optional[str] = None, ) -> None: pred_result = find_bbox(pred_file_path, train_file_path) pred_list = pred_result[img_name] result = process_pred_...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def plt_bboxes(img, classes, scores, bboxes, figsize=(17.78,10), linewidth=1.5):\n fig = plt.figure(figsize=figsize, frameon=False)\n ax = fig.add_axes([0, 0, 1, 1])\n ax.axis('off')\n plt.imshow(img)\n height = img.shape[0]\n width = img.shape[1]\n print (\"original height width\", height, wi...
[ "0.65823865", "0.65720314", "0.6529731", "0.6527492", "0.6513658", "0.64943665", "0.6445158", "0.64396197", "0.64396197", "0.6414906", "0.64066917", "0.6338756", "0.63340837", "0.6320738", "0.63176996", "0.6312172", "0.6292579", "0.62914795", "0.62855816", "0.6285467", "0.628...
0.0
-1
Get current locale. If locale is not defined then this method will always return ``en``, because ``en`` is default locale for all providers, excluding builtins.
def get_current_locale(self) -> str: return self.locale
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_locale(self):\n return self.locale", "def locale(self):\n return self.__locale", "def _get_locale() -> str:\n languages = flask.current_app.config['LANGUAGES'].keys()\n locale = flask.request.accept_languages.best_match(languages)\n\n # If no locale could be determined, fall back...
[ "0.7657775", "0.7612234", "0.74376976", "0.7420339", "0.73882586", "0.7316411", "0.72683346", "0.72683346", "0.70390916", "0.7035115", "0.6873762", "0.68353593", "0.6828502", "0.6803815", "0.6785073", "0.6703421", "0.66803664", "0.66306865", "0.65066737", "0.6503319", "0.6500...
0.8186853
0
Go to the HTML template
def home(): return render_template('angle.html', message=OUTPUT)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def view_html_page():\n\n return render_template(\"moby.html\")", "def get(self):\n template = Constants.JINJA_ENVIRONMENT.get_template('homepage.html')\n self.response.headers['Content-Type'] = 'text/html'\n self.response.write(template.render())", "def get(self):\n\n self.respo...
[ "0.7351337", "0.6879176", "0.68318635", "0.680202", "0.67694414", "0.6753975", "0.6734582", "0.6731141", "0.67227304", "0.6683803", "0.6629597", "0.66123724", "0.661091", "0.6599451", "0.6599451", "0.6570846", "0.6570846", "0.6569539", "0.6569539", "0.6569539", "0.6569539", ...
0.0
-1
Create and return a SQLAlchemy engine object
def get_engine(self, connection_string): if connection_string not in sqlengines: sqlengines[connection_string] = create_engine( self.get_connection_string()) return sqlengines[connection_string]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_engine(self):\n connection_string = f'postgresql://{self.user}:{self.password}@{self.host}/{self.database_name}'\n return create_engine(connection_string)", "def get_engine(db_params: Dict[str, str]) -> sa.engine:\r\n db_uri = get_uri(db_params)\r\n return sa.create_engine(db_uri)"...
[ "0.81597525", "0.8153145", "0.8097202", "0.8075674", "0.78947854", "0.7888983", "0.7801927", "0.76942235", "0.7634041", "0.76199454", "0.7558489", "0.75274974", "0.7523355", "0.7514134", "0.7512558", "0.7408449", "0.73286974", "0.7303014", "0.72916454", "0.7290844", "0.729084...
0.0
-1
>>> has_sum(1, 3, 5) False >>> has_sum(5, 3, 5) 0 3 + 1 5 = 5 True can we make 8 or 6 (11 3 or 11 5) with the other ? if possible, then return True >>> has_sum(11, 3, 5) 2 3 + 1 5 = 11 True
def has_sum(total, n, m): if total == 0: return True elif total < 0: return False # keep decrementing. # if decrement goes evenly to 0 then we printed the exact total # otherwise, if it decremented into a negative, then we couldn't # print exactly the total return has_su...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def has_sum(total, n, m):\n if total == 0 or total == m or total == n:\n return True\n elif total < min(m, n):\n return False\n return has_sum(total - n, n, m) or has_sum(total - m, n, m)", "def is_sum(check_list, number):\n for i, num1 in enumerate(check_list):\n for num2 in che...
[ "0.79041874", "0.72908515", "0.7200591", "0.7156713", "0.69549984", "0.6735194", "0.6734536", "0.6603255", "0.6595435", "0.6555979", "0.6525307", "0.6522716", "0.6447796", "0.6399369", "0.6366814", "0.6366303", "0.62765574", "0.6274354", "0.62656707", "0.6246942", "0.62359077...
0.7303938
1
mid_point(image, list[float]) This method takes the coordinates of a box, finds the midpoint of the bottom line and draws a circle on that point. It returns the midpoint coordinate.
def mid_point(img, box): x1, y1, w, h = box[0], box[1], box[2], box[3] x2, y2 = x1+w, y1+h x_mid = int((x1+x2)/2) y_mid = int(y2) mid = (x_mid,y_mid) _ = cv2.circle(img, mid, 5, (255, 0, 0), -1) return mid
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def midpoint(bbox):\n return (0.5*(bbox[0][0] + bbox[1][0]), 0.5*(bbox[0][1] + bbox[1][1]))", "def midpoint(self,i,f):\n\n summation = self.points[f, :] + self.points[i, :]\n midploint = summation/2\n x_mid = midploint[0]\n y_mid = midploint[1]\n\n return x_mid,y_mid", "de...
[ "0.68781984", "0.665993", "0.64032614", "0.62388694", "0.61157143", "0.6078623", "0.6072216", "0.6008875", "0.59856856", "0.5971563", "0.5931516", "0.5899475", "0.5872379", "0.5865374", "0.5861113", "0.58578175", "0.5764207", "0.57360595", "0.5689345", "0.5664506", "0.5649268...
0.7960017
0
draw_boxes(list[list[int]], image, list[list[float]]) This method takes the indices of normalised boxes, the list of boxes themselves and draws a blue rectangle over the normalised ones. Returns the midpoints and a list of (x, y, w, h) values of normalised boxes.
def draw_boxes(indexes, frame, all_boxes): bbox = [] mid_points = [] for i in indexes: x = i[0] box = all_boxes[x] bbox.append(box) mid_points.append(mid_point(frame, box)) x1, y1, w, h = box[0], box[1], box[2], box[3] x2, y2 = x1+w, y1+h cv2.rectang...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def draw_bounding_boxes_on_image(image, boxes, color=[], thickness=5):\n\n boxes_shape = boxes.shape\n if not boxes_shape:\n return\n if len(boxes_shape) != 2 or boxes_shape[1] != 4:\n raise ValueError('Input must be of size [N, 4]')\n for i in range(boxes_shape[0]):\n draw_boundin...
[ "0.742721", "0.7203921", "0.7097265", "0.70578", "0.70345044", "0.6978408", "0.69661856", "0.6932163", "0.6928918", "0.6884686", "0.68351525", "0.68031126", "0.6755338", "0.66872823", "0.6624791", "0.65779805", "0.6577729", "0.6512889", "0.650226", "0.64903617", "0.6468209", ...
0.707223
3
Take back your vote during the day (for whom to lynch).
def retract(wrapper: MessageDispatcher, message: str): from src.trans import TIMERS var = wrapper.game_state if wrapper.source not in get_players(var) or wrapper.source in reaper.DISCONNECTED: return with locks.reaper, locks.join_timer: if var.current_phase == "join": if wra...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def toggle_vote(self):\n\n self.vote = 1 - self.vote", "def up_vote(cls, user, message):\r\n pass", "def up_vote(cls, user, message):\n pass", "def upvote(id,vote_type):\n # Query for user\n votes = Votes.query.filter_by(user_id=current_user.id).all()\n to_str=f'{vote_type}:{cur...
[ "0.6154995", "0.6004094", "0.5860259", "0.57840973", "0.5761084", "0.5733187", "0.57320946", "0.5710535", "0.57060146", "0.5690087", "0.56654173", "0.56452435", "0.56292456", "0.5607076", "0.5597123", "0.5513815", "0.5504758", "0.54999584", "0.5497118", "0.549184", "0.5485402...
0.0
-1
Generates filenames for uploaded images
def image_upload_filename(instance, filename): prefix = 'photos' uhash = abs(hash(u'%s%s' % (datetime.now(), filename))) user = instance.album.user.username return u'%s/%s/%s_%s' % (prefix, user, uhash, filename)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def generate_file_filename(instance, filename):\n return _generate_filename(instance, filename, 'photos')", "def create_file_name(self):\n # create a unique id for the file name\n index = self.helpers.alpha_uuid()\n\n filename = self.form['FieldStorage'][self.image_cid].filename\n ...
[ "0.74034274", "0.719906", "0.71838284", "0.7064158", "0.70195764", "0.7011877", "0.7009172", "0.6860806", "0.6817289", "0.6809097", "0.6795184", "0.67948836", "0.671771", "0.6681375", "0.6680394", "0.66632295", "0.6624939", "0.6613939", "0.6553184", "0.6543377", "0.6498177", ...
0.7112399
3
Check if an email is in the privileged users list.
def _is_privileged_user(email): if local_config.AuthConfig().get('all_users_privileged'): return True privileged_user_emails = (db_config.get_value('privileged_users') or '').splitlines() return any( utils.emails_equal(email, privileged_user_email) for privileged_user_...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def IsPriviledgedDomainUser(email):\n if email and '@' in email:\n _, user_domain = email.split('@', 1)\n return user_domain in settings.priviledged_user_domains\n\n return False", "def IsPrivilegedUser(user_email, is_admin):\n return is_admin or (user_email and user_email.endswith('@google.com'))", "...
[ "0.75019515", "0.7336604", "0.7048157", "0.6845665", "0.67725396", "0.67076814", "0.66188204", "0.6463347", "0.64296603", "0.6386634", "0.6337958", "0.6328084", "0.63250136", "0.63236046", "0.63139117", "0.6303485", "0.6245806", "0.622814", "0.62153494", "0.62059945", "0.6178...
0.8246768
0
Check if an email is in the privileged users list.
def _is_blacklisted_user(email): blacklisted_user_emails = (db_config.get_value('blacklisted_users') or '').splitlines() return any( utils.emails_equal(email, blacklisted_user_email) for blacklisted_user_email in blacklisted_user_emails)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _is_privileged_user(email):\n if local_config.AuthConfig().get('all_users_privileged'):\n return True\n\n privileged_user_emails = (db_config.get_value('privileged_users') or\n '').splitlines()\n return any(\n utils.emails_equal(email, privileged_user_email)\n for pri...
[ "0.8246768", "0.75019515", "0.7336604", "0.6845665", "0.67725396", "0.67076814", "0.66188204", "0.6463347", "0.64296603", "0.6386634", "0.6337958", "0.6328084", "0.63250136", "0.63236046", "0.63139117", "0.6303485", "0.6245806", "0.622814", "0.62153494", "0.62059945", "0.6178...
0.7048157
3
Return the job_type that is assigned to the current user. None means one can access any job type. You might want to invoke get_access(..) with the job type afterward.
def get_user_job_type(): email = helpers.get_user_email() privileged_user_emails = (db_config.get_value('privileged_users') or '').splitlines() for privileged_user_email in privileged_user_emails: if ';' in privileged_user_email: tokens = privileged_user_email.split(';') ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def job_type(self):\n return self._job_type", "def type(self) -> Optional[pulumi.Input['JobType']]:\n return pulumi.get(self, \"type\")", "def job_type(self) -> pulumi.Output[str]:\n return pulumi.get(self, \"job_type\")", "def user_type(self):\n if \"userType\" in self._prop_dict...
[ "0.747165", "0.7279678", "0.7188113", "0.66801995", "0.66801995", "0.65145683", "0.65145683", "0.64932984", "0.62898475", "0.62308174", "0.6032937", "0.5998731", "0.59227234", "0.59227234", "0.59227234", "0.5885296", "0.5773404", "0.5773404", "0.5773404", "0.5773404", "0.5773...
0.7936359
0
Check if the user has access.
def has_access(need_privileged_access=False, job_type=None, fuzzer_name=None): result = get_access( need_privileged_access=need_privileged_access, job_type=job_type, fuzzer_name=fuzzer_name) return result == UserAccess.Allowed
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def current_user_has_access(self):\n return self.user_has_access(users.get_current_user())", "def has_access(self, user):\n if user.is_superuser:\n return True\n return self.user_objects(user).filter(id=self.id).exists()", "def has_access(self):\n self._has_access = False\n\n...
[ "0.8745601", "0.8226227", "0.79228014", "0.7886759", "0.7802046", "0.77893096", "0.77617973", "0.77617973", "0.77617973", "0.772082", "0.7603447", "0.754216", "0.75305015", "0.7488959", "0.7471709", "0.74632084", "0.74603087", "0.74568427", "0.73926055", "0.73724157", "0.7370...
0.70587504
45
Read 8 bytes of data as `unsigned long long`.
def read_unsigned_long_long(data): s_type = "=%s" % get_type("unsigned_long_long") return struct.unpack(s_type, data.read(8))[0]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def read_unsigned_long(data):\n s_type = \"=%s\" % get_type(\"unsigned_long\")\n return struct.unpack(s_type, data.read(4))[0]", "def read_long(data):\n s_type = \"=%s\" % get_type(\"long\")\n return struct.unpack(s_type, data.read(4))[0]", "def readLong(data):\n high, low = struct.unpack(\">ll\...
[ "0.7500502", "0.73812723", "0.7286104", "0.72860366", "0.6631162", "0.64381015", "0.6192025", "0.6147923", "0.612282", "0.6120536", "0.6118173", "0.6112446", "0.59630525", "0.59475785", "0.59413165", "0.587513", "0.5833755", "0.5731274", "0.572847", "0.5717603", "0.57165813",...
0.7606046
0
Creates a pandas dataframe from the dictionary.
def create_dataframe(data: dict) -> pd.DataFrame: df = pd.DataFrame(data) df.index.name = 'coin_name' return df
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def to_dataframe(self, data_dict):\n return pd.DataFrame.from_dict(data_dict, orient='index')", "def dict_to_DataFrame(data):\n return pd.DataFrame.from_dict(data)", "def df_from_dict(dict, cols):\n vals = []\n for k, v in dict.items():\n vals.append([k, v])\n\n df = pd.DataFrame(vals...
[ "0.8048167", "0.78480417", "0.7835527", "0.77670795", "0.7746543", "0.7701219", "0.76140004", "0.7455624", "0.7377935", "0.724615", "0.7154177", "0.7074613", "0.70698833", "0.70054567", "0.6920569", "0.6858341", "0.68326175", "0.67298836", "0.67108476", "0.6701368", "0.668472...
0.69406223
14
Saves the dataframe to a csv file.
def save_dataframe_to_csv(data: pd.DataFrame, filename: str) -> bool: try: data = clean_data(data) data.to_csv(filename) return True except(FileNotFoundError): print('Error: Could not save the dataframe to csv.') return False
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def save_csv(self, filename): # DONE\n self.data.to_csv(filename)", "def save_dataframe(dataframe, filename):\n with open(filename, \"w\", encoding=\"utf8\") as outfile: \n dataframe.to_csv(outfile, sep=\",\")", "def save_df(data_frame, file_path):\r\n data_frame.to_csv(file_path)\r\n re...
[ "0.83997774", "0.839973", "0.8393634", "0.8174655", "0.812801", "0.8026191", "0.79809654", "0.78813314", "0.78521967", "0.77838564", "0.77555627", "0.7743939", "0.7742734", "0.7678461", "0.7612977", "0.75615185", "0.75520724", "0.7552007", "0.7544679", "0.75423867", "0.752555...
0.7647942
14
Returns the price of a coin.
def get_coin_price(df: pd.DataFrame, coin_name: str) -> float: try: return df[(df['coin_name'] == coin_name)]['rates'].values[0] except(IndexError): print('Error: Could not find the coin.') return None
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_coins_price(name):\n return CoinsPurchase.objects.get(name=name).coins_price", "def getPrice(coin,cur):\n price = 'https://api.coinmarketcap.com/v1/ticker/' + coin\n json = requests.get(price).json()\n value = json[0]['price_' + str(cur)]\n return value", "def get_price(self):\n retur...
[ "0.78182226", "0.7569044", "0.7433811", "0.7433811", "0.7433811", "0.7390024", "0.73111016", "0.7303786", "0.7240558", "0.723084", "0.71930104", "0.71545553", "0.71463126", "0.71463126", "0.7143903", "0.7140539", "0.7137462", "0.701525", "0.7004191", "0.6913137", "0.68914", ...
0.6580664
37
Obtains the range of bands where the SNR is the highest.
def get_bands(self, data_array_norm, baseline_array_norm, f): fmax = 50 fidx = f < fmax fnum = f[fidx].size band_tot = np.zeros((fnum, fnum, data_array_norm.shape[0], data_array_norm.shape[2], data_array_norm.shape[3])) band_tot_bl = np.zeros((fnum, fnum, baseline_array_norm.sh...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_bollinger_bands(rm, rstd):\n \n upper_band=rm+2*rstd\n lower_band=rm-2*rstd\n return upper_band, lower_band", "def _get_max_sampled_bandit(self)->Bandit:\n estimates = []\n for bandit in self.bandits:\n Qth = np.random.normal(loc =self.mu[bandit.id], scale = self.var[b...
[ "0.6567467", "0.6378919", "0.63360727", "0.63081694", "0.6289236", "0.6281409", "0.6240292", "0.6219977", "0.6207458", "0.6191986", "0.60896075", "0.60645", "0.60373455", "0.600317", "0.59885687", "0.59823287", "0.598058", "0.5968563", "0.5950438", "0.58986276", "0.58848006",...
0.0
-1
Search for the first defined of possibly many env vars Returns the first environment variable defined in vars, or returns the default defined in kwargs.
def env(*vars, **kwargs): for v in vars: value = os.environ.get(v, None) if value: return value return kwargs.get('default', '')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def env(*vars, **kwargs):\r\n for v in vars:\r\n value = os.environ.get(v)\r\n if value:\r\n return value\r\n return kwargs.get('default', '')", "def env(*vars, **kwargs):\n for v in vars:\n value = os.environ.get(v)\n if value:\n return value\n retur...
[ "0.8269362", "0.8261548", "0.8183286", "0.8170492", "0.7234913", "0.6839318", "0.6580705", "0.63613874", "0.63591564", "0.63290465", "0.62897414", "0.6259116", "0.6212929", "0.6119163", "0.6117221", "0.60778123", "0.60545963", "0.60452294", "0.60017854", "0.5941733", "0.59417...
0.82147664
3
Check for correct default arguments.
def test_default_parse_args(self): self.assertEqual(self.args.router, poll.DEFAULT_ROUTER) self.assertEqual(self.args.port, poll.DEFAULT_PORT) self.assertEqual(self.args.interval, poll.DEFAULT_INTERVAL) self.assertEqual(self.args.community, poll.DEFAULT_COMMUNITY) self.assertEqua...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_defaultValues(self):\n argV = []\n self.usage.parseOptions(argV)\n self.failUnlessEqual(self.usage.opts['fooint'], 392)\n self.assert_(isinstance(self.usage.opts['fooint'], int))\n self.failUnlessEqual(self.usage.opts['foofloat'], 4.23)\n self.assert_(isinstance(s...
[ "0.75354385", "0.72266173", "0.7191842", "0.7154735", "0.71442413", "0.7100915", "0.70671195", "0.70434916", "0.7034564", "0.700715", "0.6988643", "0.6980488", "0.69748586", "0.6923872", "0.68815136", "0.6868824", "0.68511957", "0.6847183", "0.6820474", "0.68154454", "0.68069...
0.7006569
10
Return true if light is on.
def is_on(self): return self._state == STATE_ON
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def light_is_on(self):\r\n return self._light == \"ON\"", "def light_is_on(self):\n return self._light == \"ON\"", "def is_on(self):\n return self._light_on", "def is_light(self) -> bool:\n return ATTRIBUTE.Light.value in self.type_data.attributes", "def is_light(self) -> bool:\...
[ "0.9035416", "0.89275813", "0.86664206", "0.8008696", "0.8008696", "0.78880787", "0.7866302", "0.7610281", "0.7565963", "0.7415077", "0.7345493", "0.7335999", "0.73116577", "0.7303292", "0.72991306", "0.7243393", "0.71792775", "0.71722543", "0.7157757", "0.7157757", "0.715775...
0.690016
46
Instruct the light to turn off. If a transition time has been specified in seconds the controller will fade.
def async_turn_off(self, **kwargs): transition = kwargs.get(ATTR_TRANSITION, self._fade_time) logging.debug("Turning off '%s' with transition %i", self._name, transition) asyncio.ensure_future(self._controller.set_channels_async( self._channels, 0, transition=...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def turn_off(self, **kwargs):\n self._light.set_color(0, 0, 0, 0)", "def lightning_turnoff(self):\n self.turnOff()", "def turn_off(self, **kwargs: Any) -> None:\n self._light.turn_off()", "async def async_turn_off(self, **kwargs: Any) -> None:\n self._device.light_on = False", "...
[ "0.7233542", "0.7132049", "0.70640826", "0.6948976", "0.68982106", "0.68464655", "0.68431205", "0.6805358", "0.67973155", "0.67798615", "0.67780244", "0.6769697", "0.6750045", "0.6719887", "0.66322434", "0.6597229", "0.6547781", "0.65310997", "0.6504773", "0.6491345", "0.6461...
0.6789168
9
Take in languagetagged text, and use wordfreq to tokenize it.
def tokenize_by_language(in_file, out_dir, zipped=False, languages=FT_LANGUAGES): if zipped: out_files = { language: gzip.open( '%s/%s.txt.gz' % (out_dir, language), 'wt', encoding='utf-8' ) for language in languages } else: out_files =...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def preprocess(text, freq=5):\n text = re.sub(r\"[^A-Za-z0-9(),!?\\'\\`]\", \" \", text)\n text = re.sub(r\"\\'s\", \" \\'s\", text)\n text = re.sub(r\"\\'ve\", \" \\'ve\", text)\n text = re.sub(r\"n\\'t\", \" n\\'t\", text)\n text = re.sub(r\"\\'re\", \" \\'re\", text)\n text = re.sub(r\"\\'d\",...
[ "0.72140807", "0.65063596", "0.6282093", "0.62392974", "0.6229821", "0.6228819", "0.6203148", "0.61765754", "0.6146587", "0.61224735", "0.6119894", "0.61172533", "0.61155564", "0.61057484", "0.6084336", "0.60806805", "0.6066736", "0.6065682", "0.60630894", "0.6044124", "0.602...
0.0
-1
Take in monolingual plain text, and break it into SentencePiece tokens with the given model.
def tokenize_with_sentencepiece(in_file, out_file, sp_model_filename): sp = sentencepiece.SentencePieceProcessor() sp.load(sp_model_filename) packer = msgpack.Packer() for line in in_file: ids = sp.encode_as_ids(line.rstrip()) out_file.write(packer.pack(ids))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def process_text(model_name: str, text: str) -> spacy.tokens.Doc:\r\n nlp = load_model(model_name)\r\n return nlp(text)", "def tokenize(text):\n sentence = Sentence(text)\n return sentence.tokens()", "def parse_for_lm(sentence):\n return sentence.text", "def preproc_user_input(txt, model):\r\n...
[ "0.6298731", "0.62832016", "0.6222515", "0.5979018", "0.5936524", "0.59228384", "0.59124017", "0.59072095", "0.58958834", "0.5834245", "0.58309495", "0.5804194", "0.57827735", "0.5782566", "0.577117", "0.5759894", "0.5755359", "0.5750391", "0.57493126", "0.5741894", "0.574189...
0.6448083
0
Get input, initial state, final state, and probabilities tensor from
def get_tensors(self, loaded_graph): return loaded_graph.get_tensor_by_name("input:0"),\ loaded_graph.get_tensor_by_name("initial_state:0"),\ loaded_graph.get_tensor_by_name("final_state:0"),\ loaded_graph.get_tensor_by_name("probs:0"),\ loaded_graph.g...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def build_input(self):\n n_input = tf.placeholder(tf.int32, [None, None], name='n_input')\n t_input = tf.placeholder(tf.int32, [None, None], name='t_input')\n n_target = tf.placeholder(tf.int32, [None, None], name='n_target')\n t_target = tf.placeholder(tf.int32, [None, None], name='t_t...
[ "0.69204074", "0.66214675", "0.65101016", "0.64871496", "0.64565885", "0.6426615", "0.64235866", "0.63306177", "0.62981254", "0.6287973", "0.6262793", "0.62424284", "0.62266934", "0.62263", "0.6205642", "0.6134747", "0.61147267", "0.6086173", "0.60838056", "0.60643065", "0.60...
0.600969
27
That function is used to set the initial permeability field.
def setInitialPermeability(self,permeabilityField): if self.flowComponent != None: self.flowComponent.setpermeabilityfield(permeabilityField) pass else: raise Exception(" the flow component must be launched before trying to setup K ")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self,name,maneuverability,protection):\n\t\tsuper().__init__(name)\n\t\tself.maneuverability = super().limitsValues(maneuverability)\n\t\tself.protection = super().limitsValues(protection)", "def reset(self):\r\n # TODO: have reset flag such that it forces all the bottom changes\r\n se...
[ "0.5997537", "0.5640637", "0.56155497", "0.5582475", "0.55760705", "0.55648077", "0.551852", "0.5517421", "0.54974955", "0.5496612", "0.54699683", "0.54696965", "0.5463928", "0.54377735", "0.54084945", "0.53702766", "0.53562075", "0.5337029", "0.53322875", "0.53104126", "0.52...
0.8097972
0
Pick a random card and add it to a user/dealer hand
def draw_a_card(cards): import random card_drawn = random.choices(card_deck) cards.append(card_drawn[0]) return
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def deal_random_card(player):\n return player.append(random.choice(deck))", "def deal_card():\n cards = [11, 2, 3, 4, 5, 6, 7, 8, 9, 10, 10, 10, 10]\n card = random.choice(cards)\n return card", "def deal_card():\n cards = [11, 2, 3, 4, 5, 6, 7, 8, 9, 10, 10, 10, 10]\n random_card = random.choice(c...
[ "0.75244606", "0.7515193", "0.7477022", "0.7327888", "0.72345185", "0.7068833", "0.6940989", "0.6882412", "0.6858086", "0.6732782", "0.6663108", "0.65511215", "0.6549774", "0.6547239", "0.6502962", "0.6502743", "0.6481193", "0.639242", "0.6389019", "0.63872004", "0.6369756", ...
0.7105568
5
Constructor for data dictionary
def __init__(self, data): data = data['results'] textList = {} ansList = {} diffList = {} for i in range(len(data)): key = str(i) if "&" in data[i]['question']: pass else: textList[key] = data[i]['question'] ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self, data: dict = {}):\n pass", "def __init__(self):\n dict.__init__(self)\n self.datatype = None", "def __init__(self):\n self.key2value = {}\n self.key2time = {}", "def __init__(self):\n\n # initialise the empty mappings dictionary\n self.data ...
[ "0.7945727", "0.77610564", "0.7419744", "0.7417905", "0.736875", "0.736875", "0.72846645", "0.72825307", "0.7274945", "0.72481877", "0.71975297", "0.71975297", "0.71975297", "0.71975297", "0.71766746", "0.71463335", "0.7134301", "0.7128413", "0.7116416", "0.7103457", "0.70712...
0.0
-1
Perform batch normalization and activation
def bn_act(linout, perform_gcn, perform_bn, activation_fn, is_training, data_format): if data_format == "NHWC": axis = -1 else: axis = 1 # Global Context normalization on the input if perform_gcn: # Epsilon to be used in the tf.nn.batch_normalization var_eps =...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def batch_normalization(input_var=None):\n\n # Hyperparameters\n hp = Hyperparameters()\n hp('batch_size', 30)\n hp('n_epochs', 1000)\n hp('learning_rate', 0.01)\n hp('l1_reg', 0.00)\n hp('l2_reg', 0.0001)\n hp('patience', 5000)\n\n # Create connected layers\n # Input layer\n l_in ...
[ "0.7156381", "0.66997266", "0.6699257", "0.6698028", "0.66824365", "0.6640593", "0.66355854", "0.66229975", "0.6573891", "0.6550579", "0.65502006", "0.6549811", "0.65491253", "0.65412486", "0.65061253", "0.6498163", "0.6496593", "0.64928937", "0.6470394", "0.6452172", "0.6431...
0.6186093
46
Raise `ValueError` if combinations of arguments are invalid.
def _check_args(self): if not self.use_binaries + self.use_installer + self.use_neurodebian: raise ValueError("Please specify installation method.") if self.use_binaries + self.use_installer + self.use_neurodebian > 1: raise ValueError("More than one installation method specified...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_argument_specs() -> None:\n\n @argcomb(a=\"b\", c=\"d\")\n def f(a: Any = None, b: Any = None, c: Any = None, d: Any = None) -> None:\n ...\n\n # 9 valid combinations\n f()\n f(d=1)\n f(c=1, d=1)\n f(b=1)\n f(b=1, d=1)\n f(b=1, c=1, d=1)\n f(a=1, b=1)\n f(a=1, b=1, ...
[ "0.6839503", "0.6329576", "0.6296959", "0.6278309", "0.62552774", "0.6248786", "0.6233678", "0.62267464", "0.61843234", "0.61807895", "0.6173593", "0.6169504", "0.61286634", "0.6070247", "0.6000947", "0.59755355", "0.59595627", "0.59411573", "0.5928474", "0.59077793", "0.5907...
0.5329649
76
Return Path indicating where to render the template to.
def target_dir(self) -> Path: if self._target_dir: return self._target_dir if self.output_dir: return self.output_dir / self.slug return self.dependency_dir()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_template_path(self):\n raise NotImplementedError()", "def template_path(self) -> str:\n return self._values.get(\"template_path\")", "def template_path(self):\n return self.get_config(\"templates\")", "def save_path(self):\n return self.template.manager.render_template_txt...
[ "0.7967442", "0.7860827", "0.7721165", "0.74913067", "0.7111246", "0.6905986", "0.68437237", "0.6794972", "0.6756213", "0.6739951", "0.6739951", "0.671448", "0.6709475", "0.66933554", "0.66898596", "0.6688641", "0.66233754", "0.66135764", "0.66028506", "0.6600421", "0.6588209...
0.0
-1
Simple function to calculate distance between two signals of same length
def SignalDistance(s1,s2): dist = 0 # calculate absolute distance between each element for i in range(0, len(s1)): dist += np.abs(s1[i] - s2[i]) return dist
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def distance(a, b):\n return (np.sum((a - b)**2))**0.5", "def distance(a,b): \r\n return math.sqrt((a[0] - b[0])**2 + (a[1] - b[1])**2)", "def _get_distance(a, b):\n return np.sqrt(np.sum((a - b) ** 2))", "def dist(a, b):\n return np.sum((a-b)**2.0)**.5", "def distance(a, b):\n if len...
[ "0.7588253", "0.7343513", "0.73374903", "0.7323455", "0.730341", "0.7252602", "0.7245775", "0.72455794", "0.72296816", "0.7229187", "0.7199509", "0.71646804", "0.7130848", "0.70999897", "0.70977515", "0.7087741", "0.7086866", "0.70770425", "0.70622945", "0.7058044", "0.704815...
0.79909265
0
Gets item at front of queue.
def peek(self): if self.size(): return self.queue[0] else: return None
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getFront(self):\n\t\tfront = self.queue[self.front]\n\t\treturn front\n\t\tpass", "def front(self):\n return self.queue[0] if not self.empty() else None", "def front(queue):\n if empty_queue(queue):\n raise IndexError(\"Queue is empty!\")\n else:\n return queue.front.value", "d...
[ "0.88270885", "0.84139615", "0.825491", "0.8046216", "0.78960836", "0.78960836", "0.7889281", "0.78330195", "0.78139967", "0.78016967", "0.78016967", "0.77992004", "0.77882737", "0.77732265", "0.77089995", "0.7694109", "0.7664623", "0.76643145", "0.7584526", "0.75361496", "0....
0.76554555
18
A method used to initialize the weights of PyTorch models.
def initial_parameter(net, initial_method=None): if initial_method == 'xavier_uniform': init_method = init.xavier_uniform_ elif initial_method == 'xavier_normal': init_method = init.xavier_normal_ elif initial_method == 'kaiming_normal' or initial_method == 'msra': init_method = init...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def init_weights(model):\n ...", "def initialize_weights(self):\n for layer in self._cnn_layers:\n weights_initializer.WeightsInitializer.initialize_layer_or_model(layer)", "def initialize_weights(self):\n weights_initializer.WeightsInitializer.initialize_layer_or_model(\n self._batch)...
[ "0.84285975", "0.8188137", "0.818156", "0.8073837", "0.8039597", "0.7988564", "0.79696333", "0.79619944", "0.7929481", "0.79254824", "0.792279", "0.7895908", "0.7790885", "0.7765611", "0.77599305", "0.77451867", "0.7729079", "0.7729079", "0.7729079", "0.7714726", "0.77132607"...
0.0
-1
Initializes the Violation class with the left and right hand side key generators, and func and having callables. If no values for rhs are provided, it assumes we want to find violations in a singular set of column(s) (lhs).
def __init__(self, lhs, rhs=None, func=None, having=None): self.lhs = get_eval_func(columns=lhs, func=func) self.rhs = self.lhs if rhs is None else get_eval_func(columns=rhs) self.having = having
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def fd_violations(\n df: pd.DataFrame, lhs: KeyGenerator, rhs: KeyGenerator\n) -> DataFrameViolation:\n\n def duplicates(meta):\n return len(meta) > 1\n\n fdv = Violations(lhs=lhs, rhs=rhs, func=None, having=duplicates)\n return fdv.map(df=df)", "def __init__(self):\n self.operators_dic...
[ "0.6168251", "0.55292135", "0.5029456", "0.502875", "0.49425507", "0.48318386", "0.4794377", "0.47929412", "0.47883832", "0.474228", "0.47347608", "0.47261825", "0.47180307", "0.47146568", "0.46941787", "0.46764243", "0.46363854", "0.46333814", "0.46247494", "0.46167645", "0....
0.6106961
1
Sends a checkout expired reminder.
def user_reminder(slack_id, time_difference, device_name): try: slack.chat.post_message( slack_id, "It's been *{}* since you checked out `{}`. Please renew your checkout online or return it " "to the device lab.".format(time_difference, device_name), as_user=F...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def notify_expired(self, **kwargs):\n return self.notify(\"notify_expired\", **kwargs)", "def testExpiredMCTender(self):\n self.setupTransaction()\n checkout.pay_card(card_name='Expired_MC', verify=False)\n eMsg = checkout.read_message_box(timeout=10)\n if (eMsg):\n ...
[ "0.6974926", "0.6032956", "0.5891985", "0.58364046", "0.5814849", "0.57905036", "0.57501584", "0.5640075", "0.55729246", "0.55427885", "0.5476541", "0.5419828", "0.54095495", "0.54004985", "0.5397468", "0.53952575", "0.53698444", "0.53692544", "0.53486246", "0.53387034", "0.5...
0.5161133
35
Remove URLs from a sample string
def remove_URL(sample): return re.sub(r"http\S+", "", sample)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def remove_url(tweet):\n return re.sub(r\"http\\S+\", \"URL\", tweet)", "def remove_url(sample):\n sample[\"full_text\"] = re.sub(r\"http\\S+\", \"\", sample[\"full_text\"])\n return sample", "def remove_urls(text):\n text = re.sub('(?P<url>https?://[^\\s]+)', '', text)\n return text", ...
[ "0.8024629", "0.8012376", "0.7941175", "0.79276586", "0.79134667", "0.79063195", "0.7805464", "0.7790042", "0.7647424", "0.7633826", "0.75397545", "0.75013065", "0.74350727", "0.7431088", "0.7386092", "0.7302479", "0.73011416", "0.7291912", "0.71393806", "0.7134624", "0.71004...
0.8735943
0
Return the name of the entity.
def name(self) -> str: return self._name
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def entity_name(self):\n return self.__entity_name", "def entity_name(self) -> pulumi.Input[str]:\n return pulumi.get(self, \"entity_name\")", "def entity_name(self) -> pulumi.Input[str]:\n return pulumi.get(self, \"entity_name\")", "def name(self):\n return \"{} {}\".format(self....
[ "0.8988398", "0.83023036", "0.83023036", "0.7979217", "0.7969564", "0.75555485", "0.7543831", "0.7536042", "0.7536042", "0.7536042", "0.75337434", "0.75239676", "0.7496596", "0.74891084", "0.74777347", "0.74761146", "0.7462404", "0.74502766", "0.74502766", "0.74502766", "0.74...
0.0
-1
Return the brightness of this light between 0..255.
def brightness(self): return self._brightness
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def brightness(self) -> float:\n # http://alienryderflex.com/hsp.html\n r, g, b = self.r, self.g, self.b\n return sqrt(0.299*r**2 + 0.587*g**2 + 0.114*b**2)/255", "def brightness(self):\n return brightness_from_percentage(self._brightness_pct)", "def brightness(self):\n retur...
[ "0.86106795", "0.85797876", "0.84444", "0.837146", "0.83107203", "0.81361365", "0.81177837", "0.78746456", "0.78518254", "0.78518254", "0.7823478", "0.77862597", "0.7754381", "0.77270913", "0.769415", "0.75714487", "0.75458485", "0.7526449", "0.7523753", "0.7504014", "0.74457...
0.8387642
11
Return a HcrRepository object created based on this output. The type of this Output object should be 'hcr', otherwise and an exception is raised.
def get_hcr_repository(self): if self.type != 'hcr': raise RuntimeError("get_hcr_repository() called on an Output object with type '%s' (should be 'hcr')" % self.type) return HcrRepository(self.get_hcr_records())
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def generate(self, context=None):\r\n outputfile = self.__get_output_filename()\r\n # For output type 'hcr', write the binary repository file\r\n if self.output_obj.type == 'hcr':\r\n self.logger.info(\"Generating binary repository to '%s'\" % outputfile)\r\n writer = Hcr...
[ "0.55260706", "0.5256077", "0.5224154", "0.5220494", "0.5191335", "0.5183206", "0.51668274", "0.5161807", "0.5140524", "0.5120932", "0.51060784", "0.5073528", "0.50717187", "0.5064629", "0.50319046", "0.50278115", "0.5009651", "0.49744537", "0.49683103", "0.49215177", "0.4881...
0.90785617
0
Set the logging level on a logger. Uses ``get_log_level`` from
def setup_logger(logger, argv): log_level = get_log_level(argv) logger.setLevel(log_level) stream_handler = logging.StreamHandler() stream_handler.setLevel(log_level) logger.addHandler(stream_handler)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_level(log_or_name, level):\n if isinstance(log_or_name, str):\n log = get_logger(log_or_name)\n else:\n log = log_or_name\n log.setLevel(level)\n for handler in log.handlers:\n handler.setLevel(level)", "def level(self, log_level):\n self.logger.setLevel(log_level)...
[ "0.7808671", "0.77308905", "0.76957554", "0.7555545", "0.7509322", "0.7506867", "0.7469308", "0.74675155", "0.7457522", "0.74013716", "0.7399696", "0.7366879", "0.7321019", "0.72928303", "0.72891223", "0.7144481", "0.70975775", "0.70849353", "0.7060703", "0.6974753", "0.69713...
0.592393
93
Get the model name.
def get_model_name(self) -> str: raise NotImplementedError
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def model_name(self) -> str:\n return self._model_name", "def get_model_name(self) -> str:\n return self._get_string(openvr.Prop_RenderModelName_String)", "def model_name(self):\n setting = self.get_setting_definition(self.key, **self.get_kwargs())\n\n return setting.get('model', No...
[ "0.88881665", "0.883052", "0.84520155", "0.8416848", "0.8376444", "0.83522457", "0.8329777", "0.82505643", "0.8224384", "0.81623787", "0.80150056", "0.7973438", "0.78287315", "0.77966535", "0.77646977", "0.7711224", "0.76936203", "0.76847035", "0.76512337", "0.7626555", "0.75...
0.87915975
2
Get input tensor from input data.
def get_tensor_from_input(self, input_data: Dict[str, Any], **kwargs) -> torch.Tensor: raise NotImplementedError
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_tensor_from_input(input_data: Dict[str, Any]) -> torch.Tensor:\n return input_data['img']", "def input_tensor(interpreter):\n tensor_index = interpreter.get_input_details()[0]['index']\n return interpreter.tensor(tensor_index)()[0]", "def input_tensor(self):\n if self._direct_feed_dict:...
[ "0.78926533", "0.7573257", "0.7500826", "0.70625985", "0.69879276", "0.67678607", "0.67557603", "0.67429", "0.6610127", "0.6550787", "0.65429455", "0.64512795", "0.64491844", "0.6445135", "0.64403015", "0.6310326", "0.6305846", "0.62908643", "0.6244693", "0.62428", "0.6233682...
0.796942
0
Run test with single gpu.
def single_gpu_test(self, model: nn.Module, data_loader: DataLoader, show: bool = False, out_dir: Optional[str] = None, **kwargs) -> List: model.eval() results = [] dataset = d...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_gpu_cuda_code() -> None:\n if get_from_environ(\"DISABLE_GPU_FOR_TESTING\") is not None:\n print(\"GPU payload disabled for testing\")\n return\n\n # if the command exists it can run on the hardware below\n proc = subprocess.Popen([\"nvidia-smi\"], stdout=subprocess.PIPE)\n stdou...
[ "0.7356023", "0.70591587", "0.69212633", "0.6905954", "0.6789409", "0.6789409", "0.6789409", "0.67124987", "0.66918534", "0.6637442", "0.6571921", "0.6531325", "0.65180355", "0.6485515", "0.64587164", "0.6424904", "0.6424904", "0.6424904", "0.6410466", "0.6386261", "0.6353833...
0.5992467
70
View for the home page.
def index(): return render_template("index.html", title="Home")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def home(request):\n\treturn render(request, \"compta/home.html\")", "def home():\n\n\treturn render_template('index.html', title='Home Page',\n\t\t\t\t\t\t year=datetime.now().year)", "def home(request):\n return render_to_response('home.html', {}, RequestContext(request))", "def home():\n\n return ...
[ "0.84359366", "0.8289512", "0.82851356", "0.8284263", "0.82569414", "0.8204829", "0.8174893", "0.81578195", "0.8126308", "0.8126109", "0.80968696", "0.80968696", "0.80968696", "0.80968696", "0.80968696", "0.80968696", "0.80968696", "0.80968696", "0.80968696", "0.80968696", "0...
0.0
-1
Clear the text if it is a text entry element
def clear(self): self.element.clear()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def clearEntry(*args, **kwargs):\n\targs[0].set_text('')", "def clear_text(self):\n # use the .children attribute to access all widgets that are \"in\" another widget\n self.root.ids.Title.text = \"\"\n self.root.ids.Artist.text = \"\" #Empty the text boxes\n self.root.id...
[ "0.78817517", "0.7533007", "0.73453796", "0.72241646", "0.72184724", "0.7201202", "0.7162356", "0.7143112", "0.7033914", "0.70068014", "0.6913534", "0.6842043", "0.67797184", "0.6742002", "0.67028266", "0.66829175", "0.66444933", "0.66282666", "0.662482", "0.6614879", "0.6614...
0.57811624
80
Load json from a file
def loadJsonFromFile(filename): with open(filename) as f: return json.loads(f.read())
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def load_json(file_name):\n return json.load(open(file_name))", "def json_load(file_path):\n\n with open(file_path) as f:\n return json_loads(f.read())", "def load_json(filepath: str):\n with open(filepath, encoding=\"utf-8\") as f:\n return json.load(f)", "def load_from_json(f...
[ "0.85169244", "0.8404855", "0.8400666", "0.8377358", "0.83047533", "0.83007306", "0.82911485", "0.82683283", "0.82313573", "0.8230451", "0.8211095", "0.82072246", "0.82040256", "0.8182415", "0.8171659", "0.81529534", "0.8142312", "0.81388587", "0.812936", "0.8122519", "0.8116...
0.8383471
3
Return rough estimate of utc offset
def get_utc_offset(): timedelta = datetime.datetime.now() - datetime.datetime.utcnow() # XXX: `return -time.timezone`? return timedelta.total_seconds()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_tz_offset(self) -> float:\n return self.AD.tz.utcoffset(self.datetime()).total_seconds() / 60", "def get_tz_offset_seconds() -> float:\n import time\n import datetime\n tval = time.time()\n utc_offset = (datetime.datetime.fromtimestamp(tval) -\n datetime.datetime.utcfr...
[ "0.7360115", "0.709354", "0.7013006", "0.69246316", "0.68735135", "0.685113", "0.67201394", "0.66911864", "0.6490587", "0.6460585", "0.6375815", "0.6314648", "0.6306994", "0.6291286", "0.62564015", "0.62470025", "0.61877316", "0.61740637", "0.6157372", "0.61535585", "0.615184...
0.77048934
0
Returns gradient of xdivy(x1, x2) with respect to x1 and x2.
def xdivy_grad(x1, x2, grad, target=utils.CCE): shape_x1 = get_shape(x1) dtype_x1 = x1.dtype shape_x2 = get_shape(x2) dtype_x2 = x2.dtype shape_grad = get_shape(grad) dtype_grad = grad.dtype if dtype_x1 != dtype_x2 or dtype_x2 != dtype_grad or dtype_grad != dtype_x1: raise RuntimeErr...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def gradient(x1: int, x2: int) -> int:\n\n if x1 == x2:\n return 0\n\n dx = x1 - x2\n return int(dx / abs(dx))", "def _compute_dx_and_dy(x, y, y_shape):\n # We make up a dy so that we can compute the gradients. We don't really use\n # the value of dy -- we will always feed it. We need to ad...
[ "0.71600926", "0.6560471", "0.6403256", "0.63365024", "0.6247807", "0.6230522", "0.61476296", "0.60991424", "0.6084394", "0.6043715", "0.60322654", "0.6021473", "0.60202867", "0.5992157", "0.5971621", "0.59477895", "0.5945804", "0.5903332", "0.58846736", "0.5863745", "0.58430...
0.71540594
1
Try to stop all threads and timers that RenderThreads started. This method is ment to be used in a closeEvent.
def stop_all_threads_and_timer(self): try: # thread_manager threads self.thread_manager.stop_threads() # stop_services renderthreads_services_setup.stop_services(self) except: # log self.logger.debug('Error stopping threads for q...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def stopThreads():\n global listen, root\n\n listen = False\n root.destroy()", "def shutdownThreads(self):\n for s, thread in self.loggingThreads.items():\n thread.stop()", "def closeEvent(self, _):\n for thread in self.threads:\n thread.stop()\n thread.w...
[ "0.72340935", "0.7065168", "0.6931637", "0.6690543", "0.66121507", "0.6607669", "0.660233", "0.6594405", "0.65802556", "0.65359986", "0.653375", "0.6445834", "0.64163923", "0.6405618", "0.63949573", "0.6392649", "0.63728464", "0.6359364", "0.63548684", "0.6350719", "0.6348623...
0.789256
0
Move the cursor down |n| rows.
def Down(n=1): return ESC + str(n) + 'B'
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def move_down(self) -> None:\n try:\n next_newline_index: int = self.buffer.index('\\n', start=self.index)\n except ValueError:\n return\n\n if next_newline_index == self.buffer.end:\n return\n\n down_index: int\n column: int = self.buffer.get_col...
[ "0.67348504", "0.6426438", "0.6266233", "0.6226493", "0.612615", "0.6054243", "0.6052273", "0.59459186", "0.59071577", "0.5874539", "0.5859489", "0.57929003", "0.5778682", "0.57604027", "0.57373136", "0.5720706", "0.5718242", "0.5698752", "0.56896776", "0.564143", "0.5641097"...
0.5530055
30
Move the cursor left |n| columns.
def Left(n=1): return ESC + str(n) + 'D'
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def move_left(self, num):\n self.left_postion = num", "def move_left(self, step: int = 1) -> None:\n if self.cursor_pos.y == 0:\n self.cursor_pos = Point(self.cursor_pos.x, self.width-step)\n else:\n self.cursor_pos = Point(self.cursor_pos.x, self.cursor_pos.y-step)", ...
[ "0.64895916", "0.6325291", "0.6201206", "0.60038537", "0.5979487", "0.58898914", "0.58275056", "0.57006127", "0.5651769", "0.5593872", "0.55496466", "0.55383843", "0.5533781", "0.5533781", "0.5479196", "0.5467312", "0.5414052", "0.54113203", "0.54056543", "0.53824615", "0.537...
0.53616023
21
Move the cursor right |n| columns.
def Right(n=1): return ESC + str(n) + 'C'
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def move_right(self, num):\n self.right_position = num", "def ScrollRight(self, offset=100):\n if (self.translated == True):\n offset = offset * 3\n self.Show(self.displayedColumn + offset)", "def move_right(self) -> None:\n if not self.buffer:\n return\n\n ...
[ "0.65402484", "0.6466299", "0.6424676", "0.6365193", "0.6322769", "0.6103786", "0.603273", "0.5969524", "0.58977276", "0.5883043", "0.5883043", "0.57872224", "0.57372415", "0.57243663", "0.57163846", "0.5669679", "0.56480867", "0.56445765", "0.56320035", "0.5586252", "0.55785...
0.5444665
26
Assert that new passwords are generated for each invocation
def test_uniqueness(self): passwords = tuple(generate_password(8) for i in range(100)) self.assertEqual(len(passwords), len(set(passwords)))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_password_salts_are_random(self):\n self.user.password = '123456'\n self.user2.password = '123456'\n self.assertTrue(self.user.password_hash != self.user2.password_hash)", "def test_allow_all_password_reuse(self):\r\n student_email, _ = self._setup_user()\r\n user = Use...
[ "0.77554315", "0.7483207", "0.7221106", "0.7171813", "0.71520656", "0.7128599", "0.7065607", "0.7061595", "0.6984492", "0.68821895", "0.68785536", "0.6869336", "0.6795126", "0.6778452", "0.6727845", "0.6725491", "0.67220694", "0.6681491", "0.66740614", "0.66653395", "0.666041...
0.7268743
2
Assert that the password scheme used for new passwords is ldap_sha512_crypt.
def test_hash_type(self): expected_hash_method = ldap_sha512_crypt for pw in (generate_password(8) for i in range(10)): encrypted = hash_password(pw) self.assertTrue(expected_hash_method.identify(encrypted), "Expected hashes for method {}, got: {}" ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_hash_verification(self):\n pw = generate_password(8)\n for hash_method in (ldap_des_crypt, ldap_sha512_crypt, ldap_md5,\n ldap_salted_sha1):\n encrypted = hash_method.hash(pw)\n self.assertTrue(verify_password(pw, encrypted),\n ...
[ "0.68825155", "0.65575683", "0.6479358", "0.6405322", "0.62115985", "0.61670494", "0.61599153", "0.6151452", "0.6125512", "0.6111802", "0.61074144", "0.610129", "0.6090703", "0.6034018", "0.6024548", "0.60186356", "0.5992914", "0.5984441", "0.5978219", "0.5972767", "0.5932382...
0.69917303
0
returns dataframe of scraped webscrapingdemo.zgulde.net/news
def parse_gulde_news(): # set url url = 'https://web-scraping-demo.zgulde.net/news' agent = 'codeup ds germain' # query response = requests.get(url, headers={'User-Agent': agent}) # soup soup = BeautifulSoup(response.text) # raw list of articles articles = soup.select('.grid.gap-y...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_news():\n # empty dataframe\n df = pd.DataFrame() \n # read each url in list\n for url in inshorts_urls(): \n # add each dataframe of cards to df\n df = pd.concat([df, get_article(url)])\n # return all urls' cards\n return df", "def get_article1(url):\n # set agent\n ...
[ "0.77619743", "0.72002083", "0.7045892", "0.7045892", "0.686839", "0.68438214", "0.67202157", "0.65267533", "0.6519357", "0.6495249", "0.6465219", "0.640279", "0.6393346", "0.63774806", "0.63596904", "0.6316744", "0.6294499", "0.6288771", "0.62844235", "0.6269015", "0.6263668...
0.816277
0
Calculate the added mass/damping. Specific for now to vertical cylinders of varying diameter.
def added_mass(w, z1, z2, diameter, Cm=2): config = { 'end1': [0, 0, z1], 'end2': [0, 0, z2], 'diameter': diameter, 'strip width': 1.0, } Morison_model = ViscousDragModel({ 'inertia coefficient': Cm, 'members': [config], }) A1 = Morison_model.Morison_...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def mass(self):\n\t\treturn self.volume*self.density", "def calc_mass(self):\n\n star = self.star\n\n M, K, N = star.mesh_size\n ph = star.phi_coords\n mu = star.mu_coords\n r = star.r_coords\n\n def Q1(j, k):\n sum = 0\n\n for i in range(0, M - 2, ...
[ "0.6371659", "0.6072853", "0.600113", "0.5976136", "0.5965597", "0.5915674", "0.58820415", "0.58735377", "0.5793552", "0.57713723", "0.576746", "0.5747129", "0.5672541", "0.5650268", "0.56478935", "0.5647493", "0.56394535", "0.5625358", "0.56105465", "0.5597423", "0.55941385"...
0.6057516
2
This function saves the pothole data frame downloaded from the Chicago Data Portal in a CSV file.
def save_potholes(df, path="potholes.csv"): df.to_csv(path)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def write_file(self):\n rl_df, lift_df = self.create_df()\n\n number = re.findall('\\d+', self.url)[0]\n\n if self.write is True:\n with open('house_{}.csv'.format(number), 'w',\n encoding='utf-8-sig') as file:\n rl_df.to_csv(file, sep=';')\n ...
[ "0.71915", "0.68754447", "0.6822195", "0.6666302", "0.6651671", "0.66197574", "0.6604787", "0.65228224", "0.65225613", "0.64998955", "0.6494719", "0.6486049", "0.64786494", "0.6475848", "0.64399964", "0.64188117", "0.64171255", "0.64123464", "0.64067143", "0.6372208", "0.6371...
0.70086735
1
This method returns all the registered services.
def _get_services(self, services): services_info = [] for service in services[1]: services_info.append(self._make_dict(service)) return services_info
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_services(self):\r\n return get_service_list()", "def getServices(self):\n pass", "def services(self):\r\n return services.Services(self)", "def get_services(self):\n\t\t#Entrega el dict sin miramientos\n\t\treturn self._services", "def get_services(self):\n\n return list...
[ "0.80672175", "0.7876353", "0.777478", "0.77249336", "0.7710903", "0.7659411", "0.76051134", "0.7423793", "0.73325145", "0.72990406", "0.71984893", "0.7077966", "0.7063234", "0.7055363", "0.69997174", "0.6873056", "0.6858519", "0.68456686", "0.68176454", "0.6811213", "0.67839...
0.64471847
35
| Object that holds the International Bank Account Number (IBAN) data
def bank_account_iban(self): return self.__bank_account_iban
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __get_counterparty_iban(self):\n account = self.get_random_record_with_valid_attribute(\n 'accounts', 'account_type', ['Counterparty']\n )\n\n return account['iban']", "def __get_party_iban(self):\n account = self.get_random_record_with_valid_attribute(\n 'ac...
[ "0.67390215", "0.6565001", "0.65395266", "0.6439043", "0.62303406", "0.61907613", "0.60821223", "0.60767746", "0.5905429", "0.58185244", "0.5794006", "0.57384896", "0.57006854", "0.5610026", "0.5600852", "0.5596548", "0.55088454", "0.54902416", "0.54475224", "0.5439107", "0.5...
0.75289416
0
Return the first_name plus the last_name, with a space in between.
def get_full_name(self): full_name = '%s %s' % (self.first_name, self.last_name) return full_name.strip()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def full_name(first_name, last_name):\n return first_name + \" \" + last_name", "def full_name(first_name, last_name):\n\t\n\treturn first_name + \" \" + last_name", "def get_formated_name(first_name,last_name):\n\tfull_name = first_name + '' + last_name\n\treturn full_name.title()", "def get_full_name(se...
[ "0.83424175", "0.8227792", "0.8099884", "0.80680513", "0.80531704", "0.8045193", "0.7995028", "0.799401", "0.799401", "0.799401", "0.79797614", "0.7964116", "0.79576445", "0.79403675", "0.7937235", "0.7933996", "0.7915679", "0.79016924", "0.78933924", "0.7869724", "0.7856853"...
0.7787285
56
r""" Generate a vector corresponding to the diagonal of the MIS Hamiltonian.
def __init__(self, graph: Graph, energies=(1, 1), code=qubit, IS_subspace=False): if energies == (1, 1) and IS_subspace: energies = (1,) self.code = code self.graph = graph self.n = self.graph.n self.energies = energies self.IS_subspace = IS_subspace s...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def diagonal(self):\n M = self.rep\n m, n = self.shape\n return [M[i, i] for i in range(min(m, n))]", "def diagonal(step='Metropolis', iters=5000):\n X = mc.Uniform('X', lower=-1., upper=1., value=[0., 0.])\n\n @mc.potential\n def near_diag(X=X):\n if abs(X[0] - X[1]) < .1:\n...
[ "0.71084434", "0.69070405", "0.68508714", "0.6805694", "0.66903335", "0.6583982", "0.6524836", "0.65178025", "0.64895284", "0.647098", "0.6459295", "0.6411523", "0.63909525", "0.6351857", "0.6341357", "0.6310974", "0.62809527", "0.62505215", "0.624064", "0.62389773", "0.62293...
0.0
-1