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
remove dollars from start/end of file
def remove_dollars(input, **kwargs): while input.startswith('$'): input = input[1:] while input.endswith('$'): input = input[0:-1] return input
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _strip_currency(amount):\n if amount[0] == '$':\n amount = amount[1:]\n if amount.find(\".\") != -1:\n return amount.replace(\".\", \"\")\n return amount", "def toggle_dollars_speech ():\r\n s.remove_dollars=not s.remove_dollars\r\n return s.remove_dollars", "def process_dollar...
[ "0.6290453", "0.58445984", "0.582472", "0.5783614", "0.56566304", "0.5654096", "0.553288", "0.5505734", "0.5500175", "0.5483701", "0.53567684", "0.5336335", "0.531226", "0.5283359", "0.52649313", "0.52240217", "0.5213195", "0.5188492", "0.5159082", "0.5106256", "0.5096832", ...
0.7652658
0
Get one IAM instance profile.
def details(profile, instance_profile): client = boto3client.get("iam", profile) params = {} params["InstanceProfileName"] = instance_profile return client.get_instance_profile(**params)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get(profile):\n client = boto3client.get(\"iam\", profile)\n return client.list_instance_profiles()", "def _get_instance_profile(role_name, iam_client=None, region_name=None):\n if not iam_client:\n iam_client = boto3.client('iam', region_name=region_name)\n try:\n resp = iam_client...
[ "0.80385697", "0.7207435", "0.6807145", "0.6799025", "0.67766887", "0.67766887", "0.66811186", "0.6654773", "0.66326517", "0.65985113", "0.65985113", "0.6585011", "0.65340596", "0.6513719", "0.6513719", "0.6510376", "0.64853007", "0.6462121", "0.642264", "0.6311344", "0.62913...
0.7536767
1
Return a list of nodes we traversed (or None).
def depth_limited_search(problem, limit): # in this case, we simply use a list to keep track of nodes we # traversed, instead of the data structure, Stack. path = list() visited = set() # as before, to prevent duplicated nodes root = problem.get_initial_state() def rec...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_node_list(self):\n return self.node_list", "def nodes(self): \n return [n for n in self.iternodes()]", "def get_nodes(self):\n\n nodes = []\n\n if not self.node:\n return nodes\n \n nodes.extend(self.node.left.get_nodes())\n nodes.append(self....
[ "0.7348603", "0.7337371", "0.73185945", "0.7287159", "0.72181237", "0.71767676", "0.70803875", "0.70783234", "0.70424414", "0.70278794", "0.70278794", "0.6979659", "0.6969609", "0.69685376", "0.6946214", "0.6927154", "0.69232255", "0.69152933", "0.69152933", "0.69152933", "0....
0.0
-1
Sets the ``tzinfo`` parameter on naive datetimes only This is useful for example when you are provided a datetime that may have either an implicit or explicit time zone, such as when parsing a time zone string.
def default_tzinfo(dt, tzinfo): if dt.tzinfo is not None: return dt else: return dt.replace(tzinfo=tzinfo)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_timezone(dt: datetime, tz_info: tzinfo = UTC) -> datetime:\n if dt.tzinfo is not None:\n raise ValueError(f\"{dt} is already tz-aware\")\n return dt.replace(tzinfo=tz_info)", "def convert_timezone(dt: datetime, tz_info: tzinfo = UTC) -> datetime:\n if dt.tzinfo is None:\n raise Val...
[ "0.6920381", "0.6442042", "0.63653016", "0.63475734", "0.63404036", "0.6325166", "0.6297551", "0.62681216", "0.62376535", "0.62062377", "0.62053204", "0.61559886", "0.61381036", "0.6133203", "0.6131038", "0.60413545", "0.5990501", "0.59733224", "0.594745", "0.5927826", "0.586...
0.68111414
1
returns a single row of a board
def createRow(self): row = [] for col in range(self.width): row += [''] return row
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_row(puzzle, row_num):\n\n rows = puzzle.strip().split('\\n')\n return rows[row_num]", "def get_row(self, row):\n \n return self.sudoku_matrix[row]", "def get_row(board, position):\n row = (position-1) // 3 * 3\n return board[row:row+3]", "def return_row(self, num_row):\n ...
[ "0.74272305", "0.7314738", "0.72952235", "0.7271918", "0.697515", "0.69706726", "0.69444865", "0.6755838", "0.6748832", "0.67473245", "0.669003", "0.66480035", "0.6614738", "0.6573641", "0.65495884", "0.64921135", "0.64865583", "0.64844066", "0.64844066", "0.64844066", "0.648...
0.0
-1
Get the height of the board.
def get_grid_height(self): return self._grid_height
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def height(self):\n return self.board.shape[0]", "def getHeight(self):\n return self.height", "def getHeight(self):\n return self.height", "def getHeight(self):\n return self._height", "def get_grid_height(self):\n return self._height", "def get_grid_height(self):\n ...
[ "0.8506178", "0.7828281", "0.7828281", "0.7792005", "0.7788401", "0.7788401", "0.77683884", "0.77683884", "0.77683884", "0.77683884", "0.77662206", "0.7763028", "0.776071", "0.77545404", "0.7742475", "0.77377915", "0.7721646", "0.769687", "0.76945823", "0.76945823", "0.769458...
0.75637794
31
Return created time of session.
def get_created_time(self): connection = self._open_db() cursor = connection.cursor() cursor.execute('SELECT created_time FROM sessions WHERE id = ?;', (self.sid,)) created_time = cursor.fetchone() cursor.close() connection.close() return cr...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_time(self):\n return self._create_time", "def create_time(self):\n return self._create_time", "def create_time(self):\n return self._create_time", "def time_created(self) -> str:\n return pulumi.get(self, \"time_created\")", "def time_created(self) -> str:\n re...
[ "0.7945631", "0.7945631", "0.7945631", "0.791212", "0.791212", "0.791212", "0.7845241", "0.7845241", "0.78038573", "0.78038573", "0.78038573", "0.7765528", "0.7765528", "0.7765528", "0.7765528", "0.7765528", "0.7765528", "0.7765528", "0.7765528", "0.7765528", "0.7765528", "...
0.82676196
0
Return last accessed time of session.
def get_accessed_time(self): connection = self._open_db() cursor = connection.cursor() cursor.execute('SELECT accessed_time FROM sessions WHERE id = ?;', (self.sid,)) accessed_time = cursor.fetchone() cursor.close() connection.close() return...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _get_access_time(self):\n return self.__access_time", "def session_time(self):\n\n time_in_seconds = time.time() - self.__start_time\n return time.strftime('%H:%M:%S', time.gmtime(time_in_seconds))", "def get_time_since_last_seen(self):\n return time.time() - self.time_last_seen", ...
[ "0.7686391", "0.75974387", "0.74336743", "0.742712", "0.713437", "0.7111201", "0.7098648", "0.7072092", "0.7059674", "0.7049623", "0.70479304", "0.7031919", "0.6950678", "0.6911771", "0.6910704", "0.69053406", "0.69053406", "0.6897353", "0.6862708", "0.6862708", "0.68413705",...
0.8479416
0
A route to show the serialized JSON for the items for a particular Category.
def categoryItemJSON(category_id): category = db.getByCategory(category_id) items = db.getItemsByCategory(category_id) return jsonify(Items=[i.serialize for i in items])
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def show_category_json(category):\n category = (session.query(Categories)\n .filter_by(name=category.replace('-', ' '))\n .one())\n category_items = (session.query(Items)\n .filter_by(category_id=category.id)\n .order_by(Items.name)\n ...
[ "0.74886245", "0.7448139", "0.72172487", "0.7097931", "0.709421", "0.7027602", "0.6976374", "0.69541514", "0.69511145", "0.67348826", "0.6725213", "0.6712691", "0.66376805", "0.6628751", "0.66059774", "0.6597485", "0.6535176", "0.6483773", "0.64712256", "0.64099634", "0.64006...
0.68941766
9
scatter enhanced with points, markers, and labels.
def scatter_points(points, s=10, c='b', marker='o', label=None, label_kw={} , **kw): points = asarray(points, float) xs, ys = points.T num_points = len(xs) #vectorize size, color, and marker if isscalar(s): s = [s] * num_points if isinstance(c, (str, tuple)): c = [c] * nu...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def scatter_it(x, y, x_label, y_label):\n\n fig, ax1 = plt.subplots()\n plt.scatter(x, y)\n ax1.set_xlabel(x_label)\n ax1.set_ylabel(y_label)\n plt.show()", "def plot_scatter(x, y):\n\tplt.scatter(x, y)", "def inter_scatter(xdata,ydata, xlabel, ylabel, colours, title, datalabels):\n fig = plt...
[ "0.77609444", "0.72667634", "0.72196394", "0.7198928", "0.71724284", "0.714185", "0.7041532", "0.7001439", "0.69906557", "0.6978802", "0.69348437", "0.69204414", "0.6902039", "0.688404", "0.68652165", "0.6863134", "0.6851349", "0.67767596", "0.67413175", "0.6739886", "0.67371...
0.7069204
6
Find index of the first item that satisfies a predicate
def find_index(arr, pred): for index, elem in enumerate(arr): if pred(elem): return index return -1
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def index_where(iterable, pred):\n # type: (Iterable[T], Callable[[T], bool]) -> Optional[int]\n for i, el in enumerate(iterable):\n if pred(el):\n return i\n return None", "def index(predicate,iterable):\n for i,value in enumerate(iterable):\n if value.startswith(predicate):...
[ "0.7719984", "0.7683711", "0.76806563", "0.75873935", "0.75741535", "0.7370932", "0.73650527", "0.71896225", "0.7032848", "0.7025378", "0.70033485", "0.6985966", "0.6958941", "0.69231427", "0.6786927", "0.67583466", "0.67432165", "0.67411715", "0.673735", "0.66908026", "0.663...
0.76398647
3
Determine whether the package is a DIP
def is_dip(self): if ( self.dip and not self.deleted and not self.replica and not self.aip and not self.sip ): return True return False
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_DIP(target):\n # logging.info(\"Calling is_DIP on %s\" % target)\n try:\n with open(target, 'rb') as f:\n file_header = f.read(7)\n return file_header == DIP_HEADER\n except IOError:\n return False\n except FileNotFoundError:\n return False", "def sho...
[ "0.6636222", "0.630861", "0.62315845", "0.60829574", "0.6008185", "0.6006101", "0.59489286", "0.58986413", "0.58837986", "0.58825004", "0.5827712", "0.5824868", "0.58244324", "0.5788664", "0.5788664", "0.5788664", "0.5783827", "0.57770085", "0.57310957", "0.5726117", "0.57261...
0.6389644
1
Return relative path from current_path.
def get_relative_path(self): if self.dip or self.sip or self.replica: raise PackageError( "Get relative path for sip or replica packages not yet implemented" ) if self.deleted: raise PackageError("There are no relative paths for deleted packages") ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_relative_path(self):\n return urlparse(self.browser.current_url).path", "def get_relative_path(self, file_path):\n file_path = os.path.abspath(file_path)\n if self.base_dir is not None:\n file_path = file_path.replace(os.path.abspath(self.base_dir), \"\")\n assert f...
[ "0.7670988", "0.721612", "0.7182362", "0.71400774", "0.7064083", "0.69985026", "0.69898295", "0.6973275", "0.6961337", "0.6942738", "0.6927401", "0.6927401", "0.6927401", "0.6927401", "0.6927401", "0.689873", "0.6897214", "0.68797857", "0.6854911", "0.68168205", "0.68086815",...
0.63947564
50
Simple helper function to return current date/time
def now(): return datetime.datetime.now()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getdate():\r\n import datetime\r\n return datetime.datetime.now()", "def get_current_datetime ( ) :\n return datetime.datetime.now( )", "def get_current_time():\n return datetime.datetime.now()", "def get_date():\n return datetime.datetime.now()", "def current_time():\n now = datetime....
[ "0.85288954", "0.8507604", "0.84591186", "0.8362982", "0.8323831", "0.8269142", "0.82190454", "0.82127786", "0.8188653", "0.8180311", "0.81357396", "0.8098326", "0.8085791", "0.807252", "0.80701756", "0.80701756", "0.8028495", "0.7985882", "0.79757756", "0.7929821", "0.790463...
0.80017495
17
Returns the User object from the model.
def get_user(login): if isinstance(login,str) or isinstance(login,unicode): user = Session.query(User).filter(or_(User.email==login, User.username==login.lower())).first() return user else: raise Exception(login)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_user(self):\n if not self.is_valid():\n return None\n # error checking done in: clean_email\n # NOTE: all emails are stored in lower-case\n e = self.clean_email().lower()\n return User.objects.get(email=e)", "def get_user_model():\n try:\n from djan...
[ "0.7520817", "0.7485933", "0.734698", "0.72549033", "0.7235052", "0.72199064", "0.71925193", "0.7181927", "0.7174395", "0.7098329", "0.70831054", "0.707162", "0.7018215", "0.70127934", "0.7010959", "0.6961933", "0.69385767", "0.69266486", "0.69175076", "0.6916965", "0.691301"...
0.0
-1
Matplot image view simple example
def simple(request): fig = Figure() ax = fig.add_subplot(111) x = [] y = [] now = datetime.datetime.now() delta = datetime.timedelta(days=1) for i in range(10): x.append(now) now += delta y.append(random.randint(0, 1000)) ax.plot_date(x, y, '-') ax.xaxis.set_...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def imshow(img):\n imadd(img)\n plt.ion()\n plt.show()", "def plot_img():\n plt.subplot(121)\n plt.imshow(data.data.numpy()[0,].squeeze())\n plt.subplot(122)\n plt.imshow(dec_mean.view(-1,28,28).data.numpy()[0,].squeeze())\n\n plt.show()\n plt.pause(1e-6)\n plt.gcf().clear()\n sa...
[ "0.7379363", "0.73361456", "0.7100434", "0.6989596", "0.6977132", "0.6957028", "0.6956179", "0.6910968", "0.68590003", "0.68590003", "0.68590003", "0.6857219", "0.68064815", "0.6744047", "0.6742619", "0.67369634", "0.67211586", "0.668166", "0.6678727", "0.66594946", "0.664628...
0.0
-1
Pass input through the block, including an activation and maxpooling at the end.
def forward(self, x): # pylint: disable=invalid-name residual = x out = self.conv1(x) out = self.bn1(out) out = self.relu(out) out = self.conv2(out) out = self.bn2(out) out = self.relu(out) out = self.conv3(out) out = self.bn3(out) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __call__(self, **kwargs):\n segname = 'block_{}_expand_relu'\n blocks = [13, 6, 3, 1]\n skips = [self._backbone.get_layer(segname.format(i)) for i in blocks]\n backbone_out = self._backbone.get_layer('block_16_project')\n\n p5 = self._fpn_block(backbone_out.output, skips[0].o...
[ "0.6260051", "0.61380935", "0.6107723", "0.6105432", "0.60830456", "0.60354114", "0.6030297", "0.5997033", "0.59780055", "0.596835", "0.5956564", "0.59484506", "0.5943263", "0.5914727", "0.5898659", "0.5889829", "0.5867975", "0.5842521", "0.58183306", "0.58166385", "0.5803742...
0.0
-1
Connect to sqlalchemy and return the engine
def connect_sqlalchemy(): username = os.getenv('db_user') password = os.getenv('db_password') database = os.getenv('db_name') host = os.getenv('db_host') if username is None or password is None or database is None or host is None: raise Exception("""Cannot connect to SQLAlchemy Engine. Data...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_db_engine():\n # get database connection url\n connection_url = get_db_connection_url()\n\n # Create engine from connection url\n engine = create_engine(connection_url)\n\n return engine", "def get_database_engine() -> Engine:\n return engine", "def db_connect():\n return create_en...
[ "0.833375", "0.80698127", "0.80574834", "0.80574834", "0.80574834", "0.80574834", "0.79862934", "0.7900305", "0.78138494", "0.77511036", "0.7665469", "0.7621935", "0.76177716", "0.76166034", "0.7541156", "0.7502059", "0.7479146", "0.7413767", "0.7411811", "0.7411811", "0.7411...
0.7707631
10
Remove and return an item from the queue. If optional args block is true and timeout is None (the default), block if necessary until an item is available. If timeout is a positive number, it blocks at most timeout seconds and raises the Empty exception if no item was available within that time. Otherwise (block is fals...
def get(self, block=True, timeout=None): return self.queue.get(block, timeout)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def pop(self, timeout=None):\n item = super(ExclusiveQueue, self).pop(timeout)\n try:\n self.remove(item)\n except ValueError:\n pass\n return item", "def pop(self, blocking = False, timeout = TIMEOUT_CURRENT):\n if len(self) == 0 and blocking:\n ...
[ "0.7418547", "0.6808846", "0.669555", "0.6673662", "0.6673438", "0.66488856", "0.65623647", "0.6427917", "0.63225096", "0.6316774", "0.6210301", "0.620434", "0.6172623", "0.61339116", "0.6123704", "0.60587186", "0.60518706", "0.6042761", "0.5909673", "0.5891037", "0.5852287",...
0.64927053
7
generates random direction for room
def ran_direction(self,room): ran_dirt = self.random() if 1 == ran_dirt: room.front_attch(True) elif 2 == ran_dirt: room.back_attch(True) elif 3 == ran_dirt: room.left_attch(True) elif 4 == ran_dirt: room.right_attch(Tr...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def random_direction():\n\n if randrange(2):\n return Direction.RIGHT\n else:\n return Direction.DOWN", "def setRandDirection(self):\n phi = 2*math.pi*random.random()\n u = 2*random.random() - 1\n v = math.sqrt(1-u*u)*math.cos(phi)\n w = math.sqrt(1...
[ "0.8266472", "0.7955466", "0.75774497", "0.75774497", "0.73934245", "0.7352424", "0.7342962", "0.7203333", "0.7184722", "0.70763", "0.7007168", "0.6969135", "0.68332136", "0.68201953", "0.6796317", "0.67883486", "0.6696089", "0.66906124", "0.6573816", "0.6524683", "0.6293222"...
0.82315135
1
Attaches room to current_room then updates current_room to the new room
def attach_rooms(self,room, direction): if direction == 'forward': # attach new room to current self.current_room.front_attch(room) # attach current to new room.back_attch(self.current_room) elif direction == 'left': self.current_room.le...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_room_to_current(self, login, room):\n pass", "def add_room(self, room):\n self.rooms.append(room)", "def add_room(self, room):\n self.rooms[room.name] = room", "def set_room(self, room):\n self.room = room\n _LOGGER.info(\"Monitoring room: %s\", room)", "def AddRo...
[ "0.7863505", "0.71022004", "0.7000674", "0.69474024", "0.665302", "0.66233087", "0.65644133", "0.6558621", "0.64513874", "0.6297106", "0.62839776", "0.6228134", "0.62113583", "0.61786664", "0.6045378", "0.6020271", "0.5968087", "0.5967701", "0.5926986", "0.5915555", "0.591034...
0.72189295
1
Calculate the great circle distance between two points on the earth (specified in decimal degrees)
def distance(lon1, lat1, lon2, lat2): # convert decimal degrees to radians lon1, lat1, lon2, lat2 = map(radians, [lon1, lat1, lon2, lat2]) # haversine formula dlon = lon2 - lon1 dlat = lat2 - lat1 a = sin(dlat/2)**2 + cos(lat1) * cos(lat2) * sin(dlon/2)**2 c = 2 * asin(sqrt(a)) km =...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def great_circle(lat_1, long_1, lat_2, long_2):\n long_1 = m.radians(long_1)\n lat_1 = m.radians(lat_1)\n long_2 = m.radians(long_2)\n lat_2 = m.radians(lat_2)\n\n d = 2 * 6367.45 * m.asin(\n m.sqrt(haversine(lat_2 - lat_1)\n + m.cos(lat_1)*m.cos(lat_2) *\n haversine(long...
[ "0.81450045", "0.7863265", "0.76322985", "0.76064754", "0.75978696", "0.75965863", "0.75944835", "0.75720793", "0.75630087", "0.7555095", "0.7528691", "0.7517629", "0.7492963", "0.7467739", "0.7452678", "0.7434477", "0.73914117", "0.7357736", "0.73484355", "0.73318124", "0.73...
0.71164787
34
Calculates the Intersection over Union (IoU) between a box and k clusters.
def iou(box, clusters): x = np.minimum(clusters[:, 0], box[0]) y = np.minimum(clusters[:, 1], box[1]) if np.count_nonzero(x == 0) > 0 or np.count_nonzero(y == 0) > 0: raise ValueError("Box has no area") intersection = x * y box_area = box[0] * box[1] cluster_area = clusters[:, 0] * clus...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def compute_iou(box, boxes):\n\n x_min_A, y_min_A, x_max_A, y_max_A = box[:4]\n x_min_B, y_min_B = boxes[:, 0], boxes[:, 1]\n x_max_B, y_max_B = boxes[:, 2], boxes[:, 3]\n # calculating the intersection\n inner_x_min = np.maximum(x_min_B, x_min_A)\n inner_y_min = np.maximum(y_min_B, y_min_A)\n ...
[ "0.7081008", "0.6859454", "0.68165743", "0.68143636", "0.6742188", "0.6742188", "0.6719767", "0.66870284", "0.6673203", "0.6673203", "0.6673203", "0.66027653", "0.6594524", "0.6589562", "0.6530285", "0.6524049", "0.646133", "0.6453602", "0.64365935", "0.6401836", "0.63736475"...
0.6799924
4
Generates the timestamp specified in the object.
def ts(self): # parse timestamp format format_groups = match('^(([Hh]{1,2}):)?([Mm]{1,2}):([Ss]{1,2})(\.([Nn]{1,9}))?$', self.form).groups() timestamp_format = [False if format_groups[i] is None else True for i in (1, 2, 3, 5)] # create timestamp string timestamp_string = '' ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _generate_timestamp():\n\t\treturn strftime(\"%Y%m%dT%H%M%S\")", "def _make_timestamp(self):\r\n\t\tlogger.debug(\"Get a timestamp\")\r\n\t\treturn time.mktime(datetime.today().timetuple())", "def _create_timestamp():\n return (datetime.utcnow() - datetime(1970,1,1)).total_seconds()", "def get_tim...
[ "0.7662258", "0.7455735", "0.715299", "0.70778406", "0.6995214", "0.694893", "0.69023746", "0.6797251", "0.67516613", "0.67286736", "0.6712841", "0.67128086", "0.66995955", "0.6697756", "0.6694553", "0.6675055", "0.66635966", "0.6593721", "0.6590356", "0.65822667", "0.6560263...
0.0
-1
Calculates confidence interval for the difference between two proportions using Z test (unpooled) method `xT` succeeded trials in the experimental (trial) group `nT` total trials in the experimental (trial) group `xC` succeeded trials in the control group `nC` total trials in the control group `conflevel` confidence le...
def Z_test_unpooled(xT: int, nT: int, xC: int, nC: int, conflevel: float = 0.95) -> Tuple[float, float]: # LATEX: $$ (\delta^-, \delta^+) = \hat{p}_T - \hat{p}_C \pm z_{\alpha}\sqrt{\frac{\hat{p}_T (1 - \hat{p}_T)}{n_T} + \frac{\hat{p}_C (1 - \hat{p}_C)}{n_C}} $$ pT = float(xT)/nT pC = float(xC)/nC z =...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def Z_test_pooled(xT: int, nT: int, xC: int, nC: int, conflevel: float = 0.95) -> Tuple[float, float]:\n # LATEX: $$ (\\delta^-, \\delta^+) = \\hat{p}_T - \\hat{p}_C \\pm z_{\\alpha}\\sqrt{\\bar{p}(1-\\bar{p})(\\frac{1}{n_T}+\\frac{1}{n_C})} $$\n # $$ \\bar{p} = \\frac{n_T\\hat{p}_T + n_C\\hat{p}_C}{n_T + n_...
[ "0.72528607", "0.69938874", "0.5948273", "0.5920988", "0.5664501", "0.5658492", "0.5572525", "0.5511472", "0.54523927", "0.53763294", "0.52997285", "0.5179444", "0.51544523", "0.51180375", "0.5087545", "0.50650793", "0.5034702", "0.49954477", "0.49581844", "0.49029925", "0.48...
0.7234199
1
Calculates confidence interval for the difference between two proportions using Z test (pooled) method `xT` succeeded trials in the experimental (trial) group `nT` total trials in the experimental (trial) group `xC` succeeded trials in the control group `nC` total trials in the control group `conflevel` confidence leve...
def Z_test_pooled(xT: int, nT: int, xC: int, nC: int, conflevel: float = 0.95) -> Tuple[float, float]: # LATEX: $$ (\delta^-, \delta^+) = \hat{p}_T - \hat{p}_C \pm z_{\alpha}\sqrt{\bar{p}(1-\bar{p})(\frac{1}{n_T}+\frac{1}{n_C})} $$ # $$ \bar{p} = \frac{n_T\hat{p}_T + n_C\hat{p}_C}{n_T + n_C} $$ pT = float(x...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def Z_test_unpooled(xT: int, nT: int, xC: int, nC: int, conflevel: float = 0.95) -> Tuple[float, float]:\n # LATEX: $$ (\\delta^-, \\delta^+) = \\hat{p}_T - \\hat{p}_C \\pm z_{\\alpha}\\sqrt{\\frac{\\hat{p}_T (1 - \\hat{p}_T)}{n_T} + \\frac{\\hat{p}_C (1 - \\hat{p}_C)}{n_C}} $$\n pT = float(xT)/nT\n pC = ...
[ "0.71683866", "0.7082797", "0.602758", "0.58954185", "0.570652", "0.56579906", "0.55372643", "0.5514408", "0.54771054", "0.5350317", "0.5348759", "0.5222445", "0.5214517", "0.5134642", "0.5127014", "0.49688515", "0.49663982", "0.4946779", "0.49374983", "0.49166638", "0.488019...
0.7405679
0
Calculates confidence interval for the difference between two proportions using Z test (combined) method `xT` succeeded trials in the experimental (trial) group `nT` total trials in the experimental (trial) group `xC` succeeded trials in the control group `nC` total trials in the control group `conflevel` confidence le...
def Z_test_combined(xT: int, nT: int, xC: int, nC: int, conflevel: float = 0.95) -> Tuple[float, float]: one = Z_test_unpooled(xT, nT, xC, nC, conflevel) two = Z_test_pooled(xT, nT, xC, nC, conflevel) ci = ( (one[0] + two[0])/2, (one[1] + two[1])/2 ) return ci
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def Z_test_pooled(xT: int, nT: int, xC: int, nC: int, conflevel: float = 0.95) -> Tuple[float, float]:\n # LATEX: $$ (\\delta^-, \\delta^+) = \\hat{p}_T - \\hat{p}_C \\pm z_{\\alpha}\\sqrt{\\bar{p}(1-\\bar{p})(\\frac{1}{n_T}+\\frac{1}{n_C})} $$\n # $$ \\bar{p} = \\frac{n_T\\hat{p}_T + n_C\\hat{p}_C}{n_T + n_...
[ "0.69029886", "0.6708982", "0.5970494", "0.58556664", "0.5763196", "0.5687881", "0.56099284", "0.54590195", "0.5356038", "0.53351045", "0.52826524", "0.5282265", "0.5264868", "0.5223844", "0.5135916", "0.51141185", "0.5107688", "0.5082404", "0.49814802", "0.4971314", "0.49163...
0.69668996
0
Returns the angle (in degrees) of the straight line between firstPoint and secondPoint, 0 degrees being the second point to the right of first point.
def angle(firstPoint, secondPoint): xDiff = secondPoint.x - firstPoint.x yDiff = secondPoint.y - firstPoint.y return math.degrees(math.atan2(yDiff, xDiff))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def angle(point1, point2):\n return atan2(point2.y() - point1.y(), point2.x() - point1.x())", "def _angle_between(self, point_1, point_2):\n angle_1 = math.atan2(point_1.y, point_1.x)\n angle_2 = math.atan2(point_2.y, point_2.x)\n return angles.shortest_angular_distance(angle_1, angle...
[ "0.7433796", "0.7334646", "0.72229105", "0.7189502", "0.7186689", "0.71485376", "0.71385837", "0.7063685", "0.701159", "0.69824415", "0.696405", "0.6939963", "0.69043034", "0.6879184", "0.6839318", "0.6838832", "0.6818356", "0.68081707", "0.67950165", "0.6788599", "0.6786509"...
0.8334821
0
The id of the run where this hook is being triggered.
def run_id(self) -> str: return self._step_execution_context.run_id
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getRunId(self):\n return self.runid", "def run_id(self):\n if self._run_id is not None:\n return self._run_id\n run = mlflow.active_run()\n if run:\n return run.info.run_id\n raise DataSetError(\"Cannot find run id.\")", "def hook_id(self) -> int:\n ...
[ "0.8135241", "0.7873006", "0.7754267", "0.77113116", "0.76796997", "0.7126844", "0.68026686", "0.67781466", "0.67598104", "0.6748875", "0.6639901", "0.65701073", "0.6552555", "0.65481186", "0.65396845", "0.65390486", "0.651944", "0.65115327", "0.6494045", "0.6493638", "0.6485...
0.8224566
0
The lowest lower bound among all unexplored nodes.
def best_unexplored_lower_bound(self): if self._unexplored_nodes: return min(node.lower_bound for node in self._unexplored_nodes) else: return 0.0
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def find_min(self):\n return min(self.nodes, key=int)", "def getMinNode(self):\n currentNode = self.openList[0]\n for node in self.openList:\n if node.g + node.h < currentNode.g + currentNode.h:\n currentNode = node\n return currentNode", "def min(self):\n ...
[ "0.755697", "0.7262312", "0.7132538", "0.7124037", "0.7086465", "0.70536166", "0.70243084", "0.70243084", "0.69281936", "0.6884171", "0.6874795", "0.68229485", "0.6810051", "0.68045074", "0.6791121", "0.6785512", "0.67763853", "0.67518944", "0.6746725", "0.67457813", "0.67286...
0.8822841
0
Closes this database connection.
def close(self): if getattr(self, "_db", None) is not None: self._db.close() self._db = None
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def close_database(self):\n if self._conn is not None:\n self._conn.close()\n self._conn = None", "def close_db_connection(cls):\n db.close()", "def close(self):\n Log.debug('DB -> close')\n # 关闭数据库连接\n self.conn.close()", "def close(self):\n if...
[ "0.8292057", "0.8254112", "0.82229376", "0.8203255", "0.818026", "0.8166083", "0.81160486", "0.7871417", "0.78436184", "0.784009", "0.77772814", "0.7746946", "0.7742204", "0.7729554", "0.77030843", "0.76807404", "0.76142853", "0.7602529", "0.7572504", "0.75648904", "0.7560619...
0.7857391
10
A helper method for merging two dictionaries of lists, as the lists would otherwise be overwritten.
def merge_results(res1, res2): empty = [] keys = set(res1).union(res2) return dict((k, res1.get(k, empty) + res2.get(k, empty)) for k in keys)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def merge_dicts(a, b):\n new_dict = defaultdict(list)\n add_to_dict(a, new_dict)\n add_to_dict(b, new_dict)\n return new_dict", "def mergeDictionary(dict_1, dict_2):\n for key, value in dict_2.items():\n if key in dict_1:\n if isinstance(dict_1[key], list):\n dict_...
[ "0.8279688", "0.82310104", "0.80384827", "0.7976044", "0.7976044", "0.7976044", "0.79460126", "0.79123217", "0.7875046", "0.7875046", "0.7875046", "0.7875046", "0.7875046", "0.7875046", "0.7875046", "0.7875046", "0.7848693", "0.7848693", "0.7817174", "0.77360755", "0.7729843"...
0.66520715
96
Initilize the 'FFT2' class.
def __init__(self, samples, shape): self.samples = samples self.shape = shape self._mask = convert_locations_to_mask(self.samples, self.shape)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self, nx, dx, ffts=None, ny=None, dy=None):\n super(tebfft, self).__init__(nx, dx, ny=ny, dy=dy)\n\n if ffts == None:\n self.tfft = np.zeros((self.ny, self.nx / 2 + 1), dtype=np.complex)\n self.efft = np.zeros((self.ny, self.nx / 2 + 1), dtype=np.complex)\n ...
[ "0.65057665", "0.64226234", "0.6414886", "0.6410646", "0.6310922", "0.62105167", "0.618279", "0.61771935", "0.61759037", "0.61716056", "0.616229", "0.61019146", "0.60990703", "0.60696805", "0.6065569", "0.60512", "0.60486865", "0.60393333", "0.6038719", "0.6018997", "0.600456...
0.0
-1
Initilize the 'NFFT' class.
def __init__(self, samples, shape): if samples.shape[-1] != len(shape): raise ValueError("Samples and Shape dimension doesn't correspond") self.samples = samples if samples.min() < -0.5 or samples.max() >= 0.5: warnings.warn("Samples will be normalized between [-0.5; 0.5[...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __initializeSNRFftPlan(self):\n self.fftPlan = cufft.cufftPlan1d(self.Nfft,cufft.CUFFT_C2C,1)\n self.GPU_fftPlans.append(self.fftPlan)", "def __init__(self, input_dim):\n super(ps_FNNDenoiser, self).__init__()\n\n self._input_dim = input_dim\n\n self.fnn_enc = Linear(self._...
[ "0.6683611", "0.6639458", "0.65770316", "0.6403955", "0.6393188", "0.6214884", "0.62142956", "0.6208016", "0.6170476", "0.6158572", "0.6153961", "0.6111623", "0.6088386", "0.60880154", "0.6074703", "0.60698646", "0.6040959", "0.60265917", "0.5995234", "0.59843445", "0.5979706...
0.69439113
0
Implementation of MFB coattention model.
def __init__(self, cfg): super(MHBCoAtt, self).__init__() self.cfg = cfg # word embedding: q_vocab_size, 1024 self.word_embedding = nn.Embedding(cfg.q_vocab_size, cfg.emb_dim) # LSTM if cfg.glove: self.lstm = nn.LSTM(input_size=cfg.emb_dim*2, hidden_size=cfg.hidden_dim, n...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def self_attention_model(self):\n inputs = self.prepare_inputs()\n \n features = self.prepare_features(inputs)\n support_history_context_concat_emb = features['support_history_context_concat_emb']\n support_link_info_concat_emb = features['support_link_info_concat_emb']\n ...
[ "0.6323689", "0.6135497", "0.6056782", "0.60137224", "0.6002229", "0.5943362", "0.5837156", "0.5779304", "0.5572183", "0.55301934", "0.55048573", "0.5478175", "0.5474218", "0.5470017", "0.5437921", "0.54309344", "0.54205865", "0.5418698", "0.5404733", "0.53458416", "0.5332056...
0.65754753
0
Sets the signing_mdm_profile_enabled of this EnrollmentSettingsV2.
def signing_mdm_profile_enabled(self, signing_mdm_profile_enabled): self._signing_mdm_profile_enabled = signing_mdm_profile_enabled
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_shared_profile_enabled(self, bEnabled):\n\t\tcall_sdk_function('PrlVmCfg_SetSharedProfileEnabled', self.handle, bEnabled)", "def ios_personal_enrollment_enabled(self, ios_personal_enrollment_enabled):\n\n self._ios_personal_enrollment_enabled = ios_personal_enrollment_enabled", "def set_enabled(...
[ "0.6140765", "0.5414412", "0.5027232", "0.49458537", "0.49133033", "0.4894095", "0.48742867", "0.4835866", "0.46848038", "0.45975405", "0.4589049", "0.45759273", "0.45736405", "0.45671973", "0.456146", "0.4560634", "0.454624", "0.45292318", "0.45274758", "0.45204535", "0.4476...
0.8499285
0
Sets the mdm_signing_certificate of this EnrollmentSettingsV2.
def mdm_signing_certificate(self, mdm_signing_certificate): self._mdm_signing_certificate = mdm_signing_certificate
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def mdm_signing_certificate_details(self, mdm_signing_certificate_details):\n\n self._mdm_signing_certificate_details = mdm_signing_certificate_details", "def token_cert(self, token_cert):\n\n self._token_cert = token_cert", "def signing_mdm_profile_enabled(self, signing_mdm_profile_enabled):\n\n...
[ "0.7262386", "0.5100717", "0.5047785", "0.50388527", "0.48104104", "0.4675412", "0.46452135", "0.45878744", "0.4575401", "0.45245424", "0.44599274", "0.4451055", "0.44114465", "0.4377931", "0.42127037", "0.4135382", "0.41159907", "0.41022032", "0.41002604", "0.4075358", "0.40...
0.79792804
0
Sets the flush_extension_attributes of this EnrollmentSettingsV2.
def flush_extension_attributes(self, flush_extension_attributes): self._flush_extension_attributes = flush_extension_attributes
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def extension_attributes(self, extension_attributes):\n\n self._extension_attributes = extension_attributes", "def extension_attributes(self, extension_attributes):\n\n self._extension_attributes = extension_attributes", "def extend_spec(self, extend_spec):\n self._extend_spec = extend_spe...
[ "0.5931547", "0.5931547", "0.51011884", "0.48983985", "0.4776908", "0.47744548", "0.47561446", "0.47456104", "0.47411788", "0.47045845", "0.46999043", "0.45776883", "0.45612663", "0.4550931", "0.45384246", "0.45219937", "0.45042035", "0.4493312", "0.4477513", "0.44740343", "0...
0.74712026
0
Sets the flush_mdm_commands_on_reenroll of this EnrollmentSettingsV2.
def flush_mdm_commands_on_reenroll(self, flush_mdm_commands_on_reenroll): allowed_values = ["DELETE_NOTHING", "DELETE_ERRORS", "DELETE_EVERYTHING_EXCEPT_ACKNOWLEDGED", "DELETE_EVERYTHING"] # noqa: E501 if self.local_vars_configuration.client_side_validation and flush_mdm_commands_on_reenroll not in all...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def send_config_set(self, config_commands=None, exit_config_mode=False,\n **kwargs):\n return super(ExaROSSSH, self).send_config_set(\n config_commands=config_commands, exit_config_mode=exit_config_mode,\n **kwargs)", "def AutoUnlockScreen(self):\n try:\...
[ "0.49669012", "0.47503883", "0.47011176", "0.46220785", "0.46149158", "0.4592511", "0.45923728", "0.4586499", "0.45655817", "0.455045", "0.4494897", "0.44510362", "0.442859", "0.4421926", "0.44194898", "0.4397169", "0.43733165", "0.43722522", "0.43699118", "0.4366717", "0.436...
0.77656883
0
Sets the mac_os_enterprise_enrollment_enabled of this EnrollmentSettingsV2.
def mac_os_enterprise_enrollment_enabled(self, mac_os_enterprise_enrollment_enabled): self._mac_os_enterprise_enrollment_enabled = mac_os_enterprise_enrollment_enabled
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def ios_enterprise_enrollment_enabled(self, ios_enterprise_enrollment_enabled):\n\n self._ios_enterprise_enrollment_enabled = ios_enterprise_enrollment_enabled", "def testEnterpriseEnroll(self):\n if self._is_guest:\n return\n\n try:\n username, password = next(self._GetCredentialsIter())\...
[ "0.8176265", "0.5760794", "0.55939645", "0.54929554", "0.51429516", "0.47899956", "0.46193135", "0.45256323", "0.4517798", "0.44850624", "0.44115677", "0.43873063", "0.43856877", "0.43689224", "0.43026423", "0.42815533", "0.42446157", "0.42054555", "0.41905054", "0.41889966", ...
0.8735354
0
Sets the management_username of this EnrollmentSettingsV2.
def management_username(self, management_username): self._management_username = management_username
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def management_password(self, management_password):\n\n self._management_password = management_password", "def management_endpoint(self, management_endpoint):\n\n self._management_endpoint = management_endpoint", "def management_password_set(self, management_password_set):\n\n self._manage...
[ "0.6624822", "0.61127687", "0.5705612", "0.5455306", "0.51013005", "0.4960528", "0.46984777", "0.46903503", "0.4654214", "0.4654214", "0.4570513", "0.45680195", "0.45619315", "0.4531226", "0.44715044", "0.4420594", "0.43996784", "0.439356", "0.4383823", "0.4365526", "0.434398...
0.8199054
0
Sets the password_type of this EnrollmentSettingsV2.
def password_type(self, password_type): allowed_values = ["STATIC", "RANDOM"] # noqa: E501 if self.local_vars_configuration.client_side_validation and password_type not in allowed_values: # noqa: E501 raise ValueError( "Invalid value for `password_type` ({0}), must be one o...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def setpass(self, type, key):\n self.data.passwords[type] = key\n self.save()", "def set_password(self, password):\n self.PASS = password", "def set_password(self, password):\n self.PASSWORD = password", "def set_password(self, password):\n self.password = password", "def...
[ "0.6472935", "0.58030015", "0.57472646", "0.57067263", "0.5645203", "0.5619427", "0.558758", "0.5568439", "0.5554965", "0.5554965", "0.5554965", "0.5554965", "0.55468625", "0.5490697", "0.544571", "0.54237205", "0.54184425", "0.541088", "0.5404222", "0.5402367", "0.5392685", ...
0.7574902
0
Sets the random_password_length of this EnrollmentSettingsV2.
def random_password_length(self, random_password_length): self._random_password_length = random_password_length
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def password_salt_size(self, password_salt_size):\n\n self._password_salt_size = password_salt_size", "def setNewLen(self):\n self.wordLen = randint(3, 31)", "def get_random_password(self, PasswordLength: int = None, ExcludeCharacters: str = None, ExcludeNumbers: bool = None, ExcludePunctuation: ...
[ "0.574499", "0.57070255", "0.56787354", "0.5637435", "0.5573279", "0.5551636", "0.54771084", "0.5469842", "0.5435785", "0.53634155", "0.5357002", "0.53407836", "0.53335416", "0.5229727", "0.5219418", "0.52039057", "0.5184964", "0.5184964", "0.51646644", "0.5143754", "0.512164...
0.8133544
0
Sets the hide_management_account of this EnrollmentSettingsV2.
def hide_management_account(self, hide_management_account): self._hide_management_account = hide_management_account
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def allow_ssh_only_management_account(self, allow_ssh_only_management_account):\n\n self._allow_ssh_only_management_account = allow_ssh_only_management_account", "def set_offline_management_enabled(self, bEnabled):\n\t\tcall_sdk_function('PrlVmCfg_SetOfflineManagementEnabled', self.handle, bEnabled)", "...
[ "0.5653668", "0.5427177", "0.54171234", "0.5267996", "0.5172017", "0.5046185", "0.50394225", "0.5022447", "0.5005045", "0.5004971", "0.4971382", "0.48916286", "0.48652652", "0.48105034", "0.47867632", "0.4719397", "0.47163", "0.47042122", "0.46593168", "0.46292776", "0.462743...
0.87352806
0
Sets the ios_enterprise_enrollment_enabled of this EnrollmentSettingsV2.
def ios_enterprise_enrollment_enabled(self, ios_enterprise_enrollment_enabled): self._ios_enterprise_enrollment_enabled = ios_enterprise_enrollment_enabled
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def mac_os_enterprise_enrollment_enabled(self, mac_os_enterprise_enrollment_enabled):\n\n self._mac_os_enterprise_enrollment_enabled = mac_os_enterprise_enrollment_enabled", "def ios_personal_enrollment_enabled(self, ios_personal_enrollment_enabled):\n\n self._ios_personal_enrollment_enabled = ios_...
[ "0.78545225", "0.59162515", "0.5631244", "0.56141555", "0.5307585", "0.49847576", "0.47309783", "0.4669007", "0.46185577", "0.46159682", "0.45936286", "0.45403257", "0.45308298", "0.45149535", "0.45010093", "0.44910228", "0.44800785", "0.4452591", "0.44416544", "0.44215527", ...
0.8622409
0
Sets the ios_personal_enrollment_enabled of this EnrollmentSettingsV2.
def ios_personal_enrollment_enabled(self, ios_personal_enrollment_enabled): self._ios_personal_enrollment_enabled = ios_personal_enrollment_enabled
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def ios_enterprise_enrollment_enabled(self, ios_enterprise_enrollment_enabled):\n\n self._ios_enterprise_enrollment_enabled = ios_enterprise_enrollment_enabled", "def personal_device_enrollment_type(self, personal_device_enrollment_type):\n allowed_values = [\"USERENROLLMENT\", \"PERSONALDEVICEPROF...
[ "0.68670666", "0.60792196", "0.6048981", "0.5190012", "0.50828344", "0.49570563", "0.48493162", "0.46217927", "0.45732948", "0.42305943", "0.42287233", "0.41402093", "0.41103005", "0.40680346", "0.40272453", "0.40221027", "0.40199172", "0.40132388", "0.39900297", "0.39808494", ...
0.86491156
0
Sets the personal_device_enrollment_type of this EnrollmentSettingsV2.
def personal_device_enrollment_type(self, personal_device_enrollment_type): allowed_values = ["USERENROLLMENT", "PERSONALDEVICEPROFILES"] # noqa: E501 if self.local_vars_configuration.client_side_validation and personal_device_enrollment_type not in allowed_values: # noqa: E501 raise Value...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def ios_personal_enrollment_enabled(self, ios_personal_enrollment_enabled):\n\n self._ios_personal_enrollment_enabled = ios_personal_enrollment_enabled", "def set_emulated_type(self, nEmulatedType):\n\t\tcall_sdk_function('PrlVmDev_SetEmulatedType', self.handle, nEmulatedType)", "def education(self, edu...
[ "0.5716075", "0.5256963", "0.50969833", "0.5034875", "0.48908293", "0.48194796", "0.47892982", "0.47766072", "0.47244895", "0.46655145", "0.4614402", "0.45871913", "0.45675445", "0.45566553", "0.45545512", "0.45245153", "0.4492765", "0.44916058", "0.4489441", "0.44788802", "0...
0.84356046
0
Returns true if both objects are equal
def __eq__(self, other): if not isinstance(other, EnrollmentSettingsV2): return False return self.to_dict() == other.to_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.80885184", "0.80885184", "0.805514", "0.7983044", "0.7966715", "0.7966715", "0.7966715", "0.7966715", "0.7966715", "0.7966715", "0.7966715", "0.7966715", "0.7966715", "0.7966715", "0.7966715", "0.7966715", "0.7966715", "0.7966715", "0.7966715", "0.7966715", "0.7966715", ...
0.0
-1
Returns true if both objects are not equal
def __ne__(self, other): if not isinstance(other, EnrollmentSettingsV2): return True return self.to_dict() != other.to_dict()
{ "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.8042487", "0.8042487", "0.8042487", "0.8042487", "0.8042487", "0.8042487", "0.8042487", ...
0.0
-1
Return a chart of data about household contributions.
def user_contributions_chart(): #get current user according to Flask session user = dbwrangler.get_current_user() #get all users from the user table sharing their address (so, their housemates) all_housemates = User.query.filter_by(address=user.address).all() #calculate total minutes of labor wac...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def visualize_contributions():\n contributors = read_json_contributors()\n anonymous = 0\n bots = 0\n others = 0\n labels = []\n values = []\n for contributor in contributors:\n if contributor[\"type\"] == \"Anonymous\":\n anonymous += 1\n contributors.remove(contr...
[ "0.6419577", "0.5738004", "0.5709119", "0.56081533", "0.5482355", "0.54694724", "0.5463992", "0.5438143", "0.54357415", "0.54315615", "0.53467166", "0.5344255", "0.5336993", "0.5329467", "0.52870977", "0.52779186", "0.52718735", "0.5240056", "0.5236517", "0.5233168", "0.52298...
0.6774996
0
Returns a boolean of whether this field has a default value.
def has_default(self): return self._default is not NOT_PROVIDED
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def has_default_value(self):\n return self.default is not None", "def has_default_value(self, name):\n return self.get_attribute_schema(name).has_default_value", "def has_default(self):\r\n return self.default is not None", "def has_default(model_field: DataclassCreationFields) -> bool:\...
[ "0.8684444", "0.81052995", "0.809904", "0.80590206", "0.79797095", "0.7586191", "0.7584004", "0.7535933", "0.7493977", "0.7467299", "0.74276316", "0.7410168", "0.7410168", "0.7397722", "0.7301543", "0.7268983", "0.725828", "0.7219234", "0.7219234", "0.7219234", "0.7219234", ...
0.78692746
5
Returns list of nested attributes for looking through the relation.
def split_model_attr_lookups(self): return self.model_attr.split("__")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_attributes(self):\n return self.attributes", "def get_attrs(self):\n attrs = []\n for attribute in self.__dict__.keys():\n attrs.append(attribute)", "def all_attributes(self):\n\n attributes = []\n for level in self.levels:\n attributes.extend(le...
[ "0.68132997", "0.67005056", "0.6670422", "0.66456425", "0.66347307", "0.66347307", "0.66085875", "0.66068983", "0.6459108", "0.6415426", "0.63971746", "0.6291028", "0.62114805", "0.62082386", "0.62052953", "0.61974925", "0.61974925", "0.61974925", "0.61928713", "0.61751735", ...
0.0
-1
Put the left eye first in the list and the right eye second
def sort_eyes(self): x1 = self.eyes[0][0] x2 = self.eyes[1][0] if x1 > x2: self.eyes.reverse()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def rotate_left_list(liste):\n \n rotate_cube_right_list(liste)\n rotate_front_list(liste)\n rotate_cube_left_list(liste)\n \n return liste", "def rotate_right_list(liste):\n \n rotate_cube_left_list(liste)\n rotate_front_list(liste)\n rotate_cube_right_list(liste)\n \n return...
[ "0.5968797", "0.5930422", "0.59199286", "0.5796053", "0.5664756", "0.5641817", "0.5613519", "0.56109345", "0.55599636", "0.5522155", "0.5447635", "0.5427857", "0.5381286", "0.5364527", "0.5356491", "0.53385764", "0.5258886", "0.5185072", "0.51794094", "0.51737267", "0.5172229...
0.0
-1
Tests whether adding a rows to a m2m works after using insert_and_get. The model returned by `insert_and_get` must be configured in a special way. Just creating a instance of the model is not enough to be able to add m2m rows.
def test_insert_many_to_many(): model1 = get_fake_model({"name": models.TextField(primary_key=True)}) model2 = get_fake_model( { "name": models.TextField(primary_key=True), "model1s": models.ManyToManyField(model1), } ) row2 = model2.objects.on_conflict( ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_many_to_many_mapping_cache_with_add(self):\n new_cars = CarFactory.create_batch(size=3)\n initial_count = len(Driver.objects.get(id=self.driver.id).cars.all())\n self.driver.cars.add(*new_cars)\n reset_queries()\n\n # Cache for both models should be invalidated as add is...
[ "0.6484786", "0.6373011", "0.61846095", "0.60309815", "0.59791934", "0.5824564", "0.57861", "0.57485545", "0.56785154", "0.5673667", "0.5658802", "0.56122535", "0.5607095", "0.56053764", "0.5604592", "0.55937535", "0.5554092", "0.55059814", "0.5502559", "0.549914", "0.5491283...
0.6106632
3
Splits the given data (pandas) in a train set, test set and the labels for users
def split_data(data): testing_set = data.applymap(lambda x: 0) taken_courses_flat = data.stack().to_frame() taken_courses_flat = taken_courses_flat[taken_courses_flat[0] == 1] for student in taken_courses_flat.index.get_level_values('PersonID').unique(): courses = taken_courses_flat.loc[studen...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def split_data(data, labels):\r\n # Split the data into train and test\r\n X_train, X_test, y_train, y_test = train_test_split(data, labels, test_size=0.30, random_state = 42)\r\n return(X_train, y_train, X_test, y_test)", "def data_split(data, labels, train_ratio=0.5, rand_seed=42):\n\n assert 0 <= ...
[ "0.7546605", "0.730061", "0.71677786", "0.7138462", "0.7122212", "0.7065752", "0.70346665", "0.69986576", "0.6910985", "0.69034684", "0.68636316", "0.68617636", "0.6859903", "0.68434525", "0.684288", "0.6810611", "0.6784377", "0.6769299", "0.67671406", "0.67362344", "0.673013...
0.7225189
2
Initializes a new tournament system with no games
def __init__(self): self.games = {} # Dict from gameIDs to game objects. Initially empty. self.players = {} # Dict from playerID to player name self._version = __version__ # Used in version check during un-pickling # Log initialization TournamentSystem._logger.debug("Initiali...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def initialize(self):\r\n if self.method == \"naive\":\r\n self.teams = TeamsNaive(\r\n self.data_path, self.season_to_play, self.season_data\r\n )\r\n self.gsim = GameNaive(False)\r\n if not self.playoffs_only:\r\n self.season = Seas...
[ "0.70406693", "0.6519286", "0.65165764", "0.64707243", "0.6460791", "0.6359081", "0.6346921", "0.6329431", "0.6317854", "0.6272922", "0.6250988", "0.6209023", "0.6197631", "0.6134234", "0.61261714", "0.611753", "0.61151147", "0.60966295", "0.6090871", "0.60818255", "0.6080552...
0.7114235
0
Returns the status of the game with the given gameID, if it exists.
def getStatus(self, gameID): if gameID in self.games: status = self.games[gameID].status TournamentSystem._logger.debug("Found status of game %d to be %s", gameID, status) return (True, {"status": status}) else: r...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_game(game_id):\n\n game = filter(lambda t: t[\"id\"] == game_id, games)\n if len(game) == 0:\n abort(404)\n return jsonify({\"game\": game[0]})", "def get_game(self, game_id: UUID) -> Game:\n logger.info('Getting game with game_id = %s', game_id)\n try:\n return s...
[ "0.6483317", "0.64659184", "0.64517766", "0.6421381", "0.63024604", "0.61856014", "0.6172897", "0.6114581", "0.6110451", "0.6047269", "0.59651184", "0.59584033", "0.59443384", "0.59296584", "0.5881778", "0.58797115", "0.58734673", "0.581773", "0.578052", "0.5768353", "0.57303...
0.8526883
0
A copy of the AXL data object's attribute data as an dictionary.
def axl_data(self): return self._axl_data.copy()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def dict(self):\n return self.__data_dict", "def data_to_dict(self):\n return self.data.copy()", "def attribute_dict(self):\n return self.__attribute_dict", "def to_dict(self):\n return dict(self.__data)", "def get_dict(self):\n return self._data", "def to_dict(self):\n...
[ "0.75191647", "0.7444233", "0.7216598", "0.7184087", "0.7166013", "0.7159631", "0.7151407", "0.7151407", "0.7103191", "0.7066379", "0.7047593", "0.7044919", "0.70243376", "0.69925636", "0.6983378", "0.6968503", "0.6948909", "0.69035405", "0.6899862", "0.6891036", "0.6859081",...
0.0
-1
A humanreadable string representation of this object.
def __str__(self): return f"{self.__class__.__name__}:\n{self._axl_data}"
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __str__(self):\n return \"<%s: %s>\" % (self.__class__, self.describe())", "def __repr__(self):\n return str(self.__dict__)", "def __repr__(self):\n return str(self.__dict__)", "def __repr__(self):\n return str(self.__dict__)", "def __repr__(self):\n return str(self._...
[ "0.8322558", "0.82899606", "0.82899606", "0.82899606", "0.82899606", "0.82899606", "0.82601744", "0.8254292", "0.8221871", "0.8221871", "0.8221871", "0.8221871", "0.8221871", "0.8221871", "0.8221871", "0.8221871", "0.8221871", "0.8221871", "0.8221871", "0.8221871", "0.8221871...
0.0
-1
AXL objects equality using on uuid
def __eq__(self, other): return isinstance(other, self.__class__) and self._axl_data.__eq__(other)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_equal_on_equal(self):\n a = objects.OpaqueObject(self.bytes_a, enums.OpaqueDataType.NONE)\n b = objects.OpaqueObject(self.bytes_a, enums.OpaqueDataType.NONE)\n self.assertTrue(a == b)\n self.assertTrue(b == a)", "def __eq__(self, other):\n comparable_fields = ['uuid', ...
[ "0.6834249", "0.6745956", "0.67367053", "0.6732252", "0.6691472", "0.66564167", "0.6623262", "0.66102576", "0.6599983", "0.65779966", "0.656808", "0.6544261", "0.65363574", "0.6528914", "0.65072745", "0.64892256", "0.6470316", "0.64421934", "0.6420071", "0.6414394", "0.640009...
0.0
-1
Get attribute from AXL attribute dict
def __getattr__(self, key): return self.__getitem__(key)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __getitem__(self, key):\n try:\n return self._axl_data[key]\n except KeyError:\n raise AXLAttributeError(f\"Unknown AXL attribute for API endpoint: {key}\")", "def __getitem__(self, attribute_name: str) -> Attribute:\n return self._attributes_by_name[attribute_name]...
[ "0.75266874", "0.7456139", "0.73423046", "0.7201373", "0.71546775", "0.7119435", "0.7119435", "0.7104629", "0.7084353", "0.7040902", "0.7037107", "0.70232856", "0.70134467", "0.6998017", "0.69754654", "0.69726837", "0.6961538", "0.69305265", "0.69043016", "0.68981415", "0.689...
0.62289625
88
test viewing a specific author's profile
def test_get_specific_authors_profile(self): self.register_user() token = self.login_user() response = self.client.get(reverse("profiles:profile", kwargs={ 'username':self.register_data['user']['username'], }), format='json', HTTP_AUTHORIZATION='Token ' +token) self.a...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_view_a_user_profile(self):\n self.authorize_user(self.user_login_details)\n url = self.profiles_url + \\\n '{}'.format(self.user['user']['username']) + \"/\"\n response = self.client.get(url)\n self.assertEqual(response.status_code, status.HTTP_200_OK)", "def test_...
[ "0.693995", "0.6850001", "0.684886", "0.6784907", "0.67751336", "0.67432666", "0.6735794", "0.66460496", "0.65734375", "0.65670604", "0.65534997", "0.65187025", "0.65039533", "0.6495383", "0.6490835", "0.64535457", "0.6451048", "0.64497006", "0.64458555", "0.64236414", "0.640...
0.8459247
0
Creates an instance of this model from a dictionary
def from_dictionary(cls, dictionary): if dictionary is None: return None # Extract variables from the dictionary alias = dictionary.get("alias") cnam_lookups_enabled = dictionary.get("cnam_lookups_enabled") number_type = dictionary.get...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def from_dictionary(cls,\n dictionary):\n if dictionary is None:\n return None\n\n # Extract variables from the dictionary\n id = dictionary.get('id')\n name = dictionary.get('name')\n mtype = dictionary.get('type')\n usage_bytes = diction...
[ "0.83181584", "0.8168118", "0.8168118", "0.8118749", "0.8089047", "0.79787344", "0.7949278", "0.79231393", "0.7898951", "0.78923255", "0.788838", "0.7882321", "0.7882212", "0.78585315", "0.7836853", "0.7801407", "0.7801407", "0.7801407", "0.7801407", "0.7801407", "0.7801407",...
0.7876749
13
Duplicate each feature vector for each class, while adjusting sample_weights to reflect the given probabilities.
def class_sampling( X: np.ndarray, proba: np.ndarray, sample_weights: np.ndarray=None, max_duplication: int=2) -> Tuple[np.ndarray, np.ndarray, np.ndarray]: if sample_weights is None: sample_weights = np.ones(X.shape[0]) dup = min(proba.shape[1], max_duplication + 1) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def transform(self, X, y, sample_weight, copy=None):\n \n for classlabel in self.scale_:\n sample_weight[y==classlabel]*=self.scale_[classlabel]\n return X", "def transform(self, X, y, sample_weight, copy=None):\n \n for classlabel in self.scale_:\n sample...
[ "0.592293", "0.592293", "0.5872218", "0.5690852", "0.56761503", "0.56414413", "0.56354034", "0.56114405", "0.5598718", "0.55494326", "0.5464713", "0.5462328", "0.5462328", "0.5456619", "0.54543966", "0.5446153", "0.54424244", "0.5433785", "0.54165685", "0.541338", "0.539993",...
0.5791304
3
This is exactly like `to_list()`, above; except that the container of tuplized Macro instances return is a tuple instead.
def to_tuple(self): return tuple(self.to_list())
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def construct_sequence_list(self):\n return list(self.iter_sequence())", "def tuple_to_list(tup):\n return [element for element in tup]", "def to_list():\n\n @sinks\n def _dagpype_internal_fn_act(target):\n l = []\n try:\n while True:\n l.append((...
[ "0.60472685", "0.6011659", "0.59890676", "0.5941178", "0.5895161", "0.5893521", "0.5880231", "0.58686054", "0.585618", "0.5780725", "0.57798016", "0.57688326", "0.5727164", "0.5684553", "0.5617611", "0.5584944", "0.55774015", "0.55600965", "0.55534476", "0.5544281", "0.552251...
0.5259232
40
Take in a text, tokenize and encode it using the sBERT tokenizer and model respectively. Pool the outputs into a single vector using the attention mask from the tokenizer.
def gen_embedding(text, model, tokenizer): ### Tokenize the texts encoded_input = tokenizer(text, padding=True, truncation=True, max_length=512, return_tensors='pt') ### Encode the tokenized data with model with torch.no_grad(): model_output = model(**encoded_input) ### Pool the ou...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def bert_text_encoding(self, text, take_bert_pooler=True):\n # Encode text\n print('starting BERT encoding', datetime.datetime.now())\n tokenized = self.tokenizer.tokenize(text)\n tokenized.insert(0, 'CLS')\n input_ids = self.tokenizer.convert_tokens_to_ids(tokenized)\n wi...
[ "0.7072013", "0.6820554", "0.6742456", "0.66640234", "0.65324056", "0.6513259", "0.645582", "0.64284", "0.6366333", "0.62680835", "0.6184368", "0.61622065", "0.6116528", "0.60675836", "0.6056593", "0.604656", "0.6029513", "0.6027248", "0.6024886", "0.60136247", "0.59963757", ...
0.70625937
1
gets the lowest preferred age of date
def gets_mate_low_age(): mate_low_age= raw_input("What is the lowest age (youngest) you prefer to date? ") while True: if mate_low_age.isdigit(): return int(mate_low_age) elif not mate_low_age.isdigit(): mate_low_age = raw_input("Please list the lowest age as a number, no...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_age(self):\n today = datetime.now()\n return today.year \\\n - self.date_of_birth.year \\\n - ((today.month, self.date_of_birth.day) \\\n < (self.date_of_birth.month, self.date_of_birth.day))", "def oldest_person_dc(all_profile_dict: dict) -> float:\n \"\...
[ "0.70668405", "0.7052247", "0.7030351", "0.69379234", "0.6881645", "0.6830379", "0.68170613", "0.6792336", "0.67462003", "0.6704213", "0.6626992", "0.66188204", "0.6584224", "0.65729946", "0.6567875", "0.6565779", "0.6559693", "0.65368474", "0.65368474", "0.6533345", "0.65333...
0.6193887
44
Return the box vectors
def boxVectors(self): return self.box_vectors
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def boxVectors(self, stuff):\n try:\n # We may be changing the box, so delete the cached box lengths to\n # make sure they are recomputed if desired\n del self._boxLengths\n except AttributeError:\n pass\n self.box_vectors = stuff", "def _get_boxes...
[ "0.7650852", "0.74740064", "0.73525727", "0.71853584", "0.7121941", "0.69718647", "0.6885406", "0.6837554", "0.67720866", "0.6735438", "0.6696076", "0.6638886", "0.663131", "0.66119", "0.6522172", "0.6517446", "0.65000266", "0.6475387", "0.6443932", "0.64026105", "0.6401323",...
0.8892138
0
Returns deserialized attribute data for the project.
def get_attribute_data(self): ret = {} for attribute in Attribute.objects.all().prefetch_related("value_choices"): deserialized_value = None if attribute.value_type == Attribute.TYPE_GEOMETRY: geometry = ProjectAttributeMultipolygonGeometry.objects.filter( ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def load_attrs(self):\n return loads(self.get_attr().GetObject()) or {}", "def get_attributes(self):\n\n endpoint = self._get_api_endpoint() + '/attributes'\n results = self.tq.get(endpoint, withp='attribute')\n if 'data' not in results:\n return {}\n\n return result...
[ "0.63925266", "0.6359099", "0.6295856", "0.6098699", "0.59653306", "0.5926529", "0.5909923", "0.5909923", "0.5909923", "0.5900251", "0.58564055", "0.58309096", "0.5776692", "0.5742143", "0.5735933", "0.5733363", "0.57169765", "0.5712774", "0.5712774", "0.5712774", "0.5687336"...
0.6808882
0
Convenience function for creating a line plot in a single call.
def plot( a, b=None, along="x", color=None, stroke_width=2.0, opacity=1.0, title=None, marker=None, area=None, size=None, mfill=None, mopacity=1.0, mtitle=None, style=None, mstyle=None, mlstyl...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def line_graph():\n fig = plt.figure()\n ax = plt.axes()\n x = [1, 2, 3]\n y = [5, 6, 7]\n plt.plot(x, y)\n plt.show()", "def line_plot(self, x, y, labels, ax=None):\n if ax is None:\n fig, ax = plt.subplots()\n else:\n fig = None\n ax.plot(x, y, '--o'...
[ "0.7638217", "0.7564794", "0.74040824", "0.7398512", "0.7356535", "0.7273521", "0.7150059", "0.70537883", "0.7051534", "0.7040126", "0.69653213", "0.6938739", "0.69338137", "0.6905039", "0.6792397", "0.67642266", "0.67573595", "0.67487806", "0.6712566", "0.668449", "0.6637180...
0.0
-1
Returns a list of words from a string, removes numbers
def GetWords(phrase): # Remove special characters regex # It works faster than the standard \w+ pattern regex = re.compile(r'([^\d\`\~\!\@\#\$\%\^\&\*\(\)\+\=\[\{\]\}\|\\\'\<\,\.\>\?\/\""\;\:\s]+)+', re.UNICODE) return re.findall(regex,phrase.lower())
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def extract_words(input_string):\n for c in punctuation + digits:\n input_string = input_string.replace(c, ' ' + c + ' ')\n\n return input_string.lower().split()", "def extract_words(s):\n\n if has_dashdash(s):\n s = myreplace(\"--\",\" \", s)\n\n s = s.lower().split()\n word_list = ...
[ "0.801969", "0.75897694", "0.7585149", "0.7585149", "0.7369715", "0.7313402", "0.7296905", "0.7271536", "0.71784425", "0.7110001", "0.7095424", "0.7073254", "0.7073025", "0.7067484", "0.7049015", "0.6894166", "0.68796426", "0.68644816", "0.6856039", "0.68446445", "0.68225455"...
0.6499095
54
Set a sensor id
def test_id_set(mocker): mocker.patch('serial.Serial.open') mocker.patch('serial.Serial.flushInput') css = mocker.patch('pysds011.driver.SDS011.cmd_set_sleep') css.return_value = True csi = mocker.patch('pysds011.driver.SDS011.cmd_set_id') runner = CliRunner() result = runner.invoke(main, ['...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _set_id(self, value):\n pass", "def sensor_uuid(self, sensor_uuid):\n\n self._sensor_uuid = sensor_uuid", "def set_id(self, id):\n self.data['id'] = id", "def setID(self, id):\r\n raise NotImplementedError(\"must be implemented in subclass\")", "def id(self, value):\n ...
[ "0.70913804", "0.6934492", "0.6786202", "0.67648554", "0.6728039", "0.66606945", "0.66185105", "0.66170466", "0.66139424", "0.65928715", "0.65655434", "0.6528374", "0.6526816", "0.6450028", "0.6449179", "0.6449179", "0.6449179", "0.6449179", "0.6449179", "0.6449179", "0.64491...
0.0
-1
Only .jpg files allowed
def allowed_file(filename): return '.' in filename and \ filename.rsplit('.', 1)[1].lower() in ALLOWED_EXTENSIONS
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def allowed_image(filename):\n \n if not '.' in filename:\n return False\n \n ext = filename.rsplit('.', 1)[1]\n \n if ext.lower() in ALLOWED_IMAGE_EXTENSIONS:\n return True\n else:\n return False", "def allowed_file(filename):\n return '.' in filename and \\\n\t fil...
[ "0.80818385", "0.7994412", "0.7327942", "0.70684725", "0.702561", "0.6967558", "0.69395953", "0.69395953", "0.69310004", "0.691382", "0.6892459", "0.6892459", "0.6892459", "0.6892459", "0.6892459", "0.6892459", "0.6874973", "0.6872072", "0.6872072", "0.6863143", "0.68619114",...
0.6886799
24
Unpack a list of json'd atoms objects into a form for insertion into the atom table
def get_vib_modes(id : int ,stordir : str ) -> typ.List[typ.Tuple[int,float,int]]: raise NotImplementedError return [] # type: ignore
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def from_json(self, js):\n for json_entry in js['entries']:\n bom_entry = BOMEntry.from_json(json_entry)\n self._order.append(bom_entry.key)\n self._entries[bom_entry.key] = bom_entry", "def get_atoms_list(mmtf_dict):\n\n return [{\n \"x\": x, \"y\": y, \"z\": z, \"...
[ "0.5792423", "0.57403356", "0.5693318", "0.52842087", "0.52669823", "0.5197244", "0.5110782", "0.5047716", "0.49891496", "0.4971961", "0.49601942", "0.4958475", "0.4927138", "0.48584", "0.48508418", "0.48300168", "0.48166937", "0.4809932", "0.47912526", "0.47909254", "0.47907...
0.0
-1
Generate Gaussian random field according to the provided geometry and power spectrum
def GenerateGRF(self, L_x, L_y, L_z, n_samples=1): self.fn = 'grf_samples_x%dy%dz%d_N%d' % (self.n_ch_x, self.n_ch_y, self.n_ch_z, n_samples) if not callable(self.PowerSpectrum): raise TypeError('Input power spectrum must be a callable function of k!') self.survey_maps = np.zeros((self.n_ch_x...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def generate_gaussian():\n amp = 10 * numpy.random.chisquare(3)\n width = numpy.random.chisquare(3)\n mean = numpy.random.uniform(-10 + width, 10 - width)\n x = numpy.linspace(-10, 10, 500)\n y = amp * numpy.exp(- (x - mean) ** 2 / width ** 2)\n add_noise(y, 0.1)\n return x, y", "def _gaussi...
[ "0.6785417", "0.6111275", "0.5993927", "0.5979585", "0.5965176", "0.59299135", "0.5850661", "0.5801385", "0.57980114", "0.5787479", "0.5780526", "0.57736325", "0.5754728", "0.5739113", "0.57301915", "0.57173365", "0.5703953", "0.5663614", "0.564989", "0.5641589", "0.5635134",...
0.0
-1
Load a new weighting and replace ``.weighting_mm`` and ``.weighting_matrix``. Does not do any new calculations or change ``.weighted_inventory``.
def switch_weighting( self, weighting=Union[tuple, Iterable[Union[FS, bwp.DatapackageBase]]] ) -> None: self._switch( obj=weighting, label="weighting", matrix="weighting_matrix", func=self.load_weighting_data, )
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def weighting_calculation(self) -> None:\n if hasattr(self, \"normalized_inventory\"):\n obj = self.normalized_inventory\n else:\n obj = self.characterized_inventory\n self.weighted_inventory = self.weighting_matrix * obj", "def load_weights(self, weight_file):\r\n ...
[ "0.6765117", "0.63650566", "0.6331666", "0.6224696", "0.6216265", "0.61687773", "0.61502016", "0.6058768", "0.6053611", "0.60507405", "0.6040028", "0.6034268", "0.5904128", "0.58906925", "0.58903956", "0.58890736", "0.5875759", "0.58687264", "0.5859711", "0.5854686", "0.58304...
0.653344
1
Sets the Sphero's internal name. This formerly reprogrammed the Bluetooth module to advertise with a different name, but this is no longer the case. This assigned name is held internally and returned in get_bluetooth_info. Names are clipped at 48 characters in length to support UTF8 sequences. You can send something lo...
async def set_device_name(self, device_name, wait_for_response=True, reset_inactivity_timeout=True, response_timeout_in_seconds=None): command = _create_set_device_name_command(device_name=dev...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_husb_name(self, h, line_number=0):\n self.husb_name = h\n self._husb_name = line_number", "def set_name(self, newname=\"\"):\n self.name = newname", "def __set_name(self, name):\r\n\t\tself.__name = name\r\n\t\tself._window.chat_panel.place_name = name\r\n\t\tself.encode_message(ac...
[ "0.6660619", "0.6596367", "0.64662766", "0.642172", "0.642172", "0.6409538", "0.6390443", "0.6388461", "0.6340332", "0.6324079", "0.6284661", "0.62800336", "0.6261087", "0.625792", "0.625792", "0.62464154", "0.62454265", "0.62002695", "0.6190485", "0.6190485", "0.6190485", ...
0.0
-1
Packs a list of bytes to be a single unsigned int. The MSB is the leftmost byte (index 0). The LSB is the rightmost byte (index 1 or len(byte_list) 1). Big Endian order. Each value in byte_list is assumed to be a byte (range [0, 255]). This assumption is not validated in this function.
def _pack_bytes(byte_list): return int.from_bytes(byte_list, 'big', signed=False)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _pack_bytes_signed(byte_list):\n return int.from_bytes(byte_list, 'big', signed=True)", "def pack_varint_list(data: List[int]) -> bytes:\n result = b\"\"\n for value in data:\n result += pack_varint(value)\n return result", "def byteslist_to_int(byteslist):\n holder = bytes()\n for...
[ "0.7906516", "0.73065376", "0.7276943", "0.66713953", "0.64764565", "0.64404136", "0.6293555", "0.6267396", "0.6247806", "0.6212724", "0.6103591", "0.6092024", "0.60381895", "0.6028261", "0.5928178", "0.592575", "0.5908956", "0.5873216", "0.5873216", "0.58592254", "0.5855712"...
0.8513587
0
Packs a list of bytes to be a single signed int. The MSB is the leftmost byte (index 0). The LSB is the rightmost byte (index 1 or len(byte_list) 1). Big Endian order. Each value in byte_list is assumed to be a byte (range [0, 255]). This assumption is not validated in this function.
def _pack_bytes_signed(byte_list): return int.from_bytes(byte_list, 'big', signed=True)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _pack_bytes(byte_list):\n return int.from_bytes(byte_list, 'big', signed=False)", "def byteslist_to_int(byteslist):\n holder = bytes()\n for v in byteslist:\n holder += v\n return int.from_bytes(holder, byteorder='big')", "def pack_varint_list(data: List[int]) -> bytes:\n result = b\"...
[ "0.86426723", "0.75397384", "0.70949656", "0.6677766", "0.66367936", "0.64379734", "0.6430393", "0.63140994", "0.626736", "0.6064796", "0.6043392", "0.5996604", "0.5967517", "0.5964226", "0.5944767", "0.59360564", "0.588604", "0.58796006", "0.58104753", "0.580295", "0.5762274...
0.86685324
0
Try to turn a string into utf8 if possible. Code is directly from the utf8 function in
def utf8(value): if isinstance(value, six.text_type): return value.encode('utf-8') assert isinstance(value, str) return value
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def unicode2utf8(s):\n return s.encode(encoding='utf-8', errors='ignore')", "def try_unicode(string):\n if isinstance(string, str):\n return string.decode(\"utf-8\")\n else:\n return string", "def to_unicode(string):\n if not isinstance(string, unicode):\n for codec in CODECS:\...
[ "0.7664665", "0.76467127", "0.7605182", "0.75580186", "0.74892044", "0.7443858", "0.73976827", "0.7282496", "0.7280304", "0.7267308", "0.7237042", "0.72323114", "0.7202739", "0.71792346", "0.7169363", "0.7120787", "0.70987344", "0.7074586", "0.7073999", "0.7063506", "0.704068...
0.7022836
21
Return the current date as a string.
def get_date(): now = datetime.now() date = now.strftime("%Y%m%d") return date
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_current_date():\n return datetime.datetime.today().strftime(constants.DATE_FORMAT)", "def date() -> str:\n\n return datetime.strftime(datetime.today(), _fmt)", "def get_date_today() -> str:\n return datetime.now().strftime(\"%Y-%m-%d\")", "def get_current_date(fmt=\"%Y-%m-%d\"):\n ...
[ "0.8782137", "0.8359934", "0.8308955", "0.82919014", "0.8269002", "0.8176083", "0.80596536", "0.8057937", "0.80457973", "0.7972064", "0.77887595", "0.7773112", "0.76803124", "0.76436806", "0.75142956", "0.7496378", "0.7476032", "0.747587", "0.7464423", "0.7457142", "0.7453084...
0.7801596
10
Plots a confusion matrix.
def plot_confusion_matrix(cm, classes=None, title='Confusion matrix'): if classes is not None: sns.heatmap(cm, cmap="YlGnBu", xticklabels=classes, yticklabels=classes, annot=True, fmt='.1f', annot_kws={'size':12}) else: sns.heatmap(cm) plt.title(title) plt.ylabel('True labels') plt.x...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def plot_confusion_matrix(self):\r\n interp = ClassificationInterpretation.from_learner(self.learn)\r\n interp.plot_confusion_matrix()", "def plot_confusion_matrix(cm, classes=None, title='Confusion matrix'):\n if classes is not None:\n sns.heatmap(cm, xticklabels=classes, yticklabels=cla...
[ "0.82883036", "0.8057375", "0.79712653", "0.7959058", "0.7953848", "0.7933933", "0.79080147", "0.7894345", "0.7859723", "0.7843164", "0.7830489", "0.78277344", "0.78086394", "0.7807704", "0.7802325", "0.7792034", "0.7786378", "0.77674615", "0.7762487", "0.77535874", "0.775021...
0.8022995
2
Returns the given HTML with all tags stripped.
def strip_tags(value): if value: return re.sub(r'<[^>]*?>', '', value) return ""
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def stripHTMLTags (html):\r\n import re\r\n text = html\r\n \r\n # apply rules in given order!\r\n rules = [\r\n { r'>\\s+' : u'>'}, # remove spaces after a tag opens or closes\r\n { r'\\s+' : u' '}, # replace consecutive spaces\r\n { r'\\s*<br\\s*/?>\\s*' : u'\\n'},...
[ "0.8138946", "0.8109891", "0.810231", "0.8100899", "0.80280966", "0.7989464", "0.79603654", "0.78888774", "0.788333", "0.78830826", "0.78644603", "0.7843869", "0.7843869", "0.7841764", "0.78237224", "0.7817937", "0.77888054", "0.7782822", "0.7782822", "0.77559096", "0.7739701...
0.65713644
78
Returns the given HTML with all tags stripped.
def strip_tags(value): if value: return re.sub(r'<[^>]*?>', '', value) return ""
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def stripHTMLTags (html):\r\n import re\r\n text = html\r\n \r\n # apply rules in given order!\r\n rules = [\r\n { r'>\\s+' : u'>'}, # remove spaces after a tag opens or closes\r\n { r'\\s+' : u' '}, # replace consecutive spaces\r\n { r'\\s*<br\\s*/?>\\s*' : u'\\n'},...
[ "0.8138946", "0.8109891", "0.810231", "0.8100899", "0.80280966", "0.7989464", "0.79603654", "0.78888774", "0.788333", "0.78830826", "0.78644603", "0.7843869", "0.7843869", "0.7841764", "0.78237224", "0.7817937", "0.77888054", "0.7782822", "0.7782822", "0.77559096", "0.7739701...
0.65713644
77
check minimum username length
def test_min_user_name_length(self): self.business_item_class.businesses_list = [{"owner": "chairman", "business_name":"Maendeleo", "category":"Backaend", "location":"myhomecity"}, {"owner": "chairmanwe", "business_name":"NshMaendeleo", "category":"Backaend", "lo...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_username_valid(username, min_length=2, max_length=25):\n username_re = re.compile(r\"^[\\w_ ]+$\")\n\n if username_re.match(username):\n return min_length <= len(username) <= max_length\n else:\n return False", "def username_is_valid(username):\n\n if len(username) < MINIMUM_PASS...
[ "0.8042611", "0.7957197", "0.78466403", "0.7841104", "0.76962155", "0.7675551", "0.7642297", "0.76058745", "0.75949436", "0.757147", "0.7564593", "0.7563163", "0.75497204", "0.7412111", "0.73890644", "0.72775495", "0.72771424", "0.72373044", "0.7202173", "0.71665996", "0.7149...
0.0
-1
Returns an SNS client object. This function always returns the global client object, initializing it if necessary. Use it inside your code whenever you need an SNS client, rather than creating a new one or using the global client object directly. If the environment variable "LOCALSTACK_SNS_URL" is present, uses that as...
def client() -> botocore.client.BaseClient: global _client if _client is None: endpoint_url = os.environ.get('LOCALSTACK_SNS_URL') # If endpoint_url is None, botocore constructs the default AWS URL _client = boto3.client('sns', endpoint_url=endpoint_url) return _client
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def client() -> botocore.client.BaseClient:\n global _client\n if _client is None:\n endpoint_url = os.environ.get('LOCALSTACK_S3_URL')\n # If endpoint_url is None, botocore constructs the default AWS URL\n _client = boto3.client('s3', endpoint_url=endpoint_url)\n return _client", "...
[ "0.72224563", "0.6623388", "0.6523985", "0.645102", "0.63732845", "0.6239797", "0.61649185", "0.61449564", "0.6144215", "0.6129396", "0.60894936", "0.6087926", "0.60472536", "0.60274404", "0.6003598", "0.5951034", "0.5948232", "0.5944997", "0.5918546", "0.58850396", "0.581564...
0.8877061
0
Reset training data and index into the training data.
def reset(self): self.epochs = 0 # Shuffle the training data perm = np.arange(self.num_train) np.random.shuffle(perm) assert self.num_train == self.train_images.shape[ 0], 'Error incorrect shuffling mask' self.train_images = self.train_images[perm] self.train_labels = self.train_labe...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def reset_training_data(self):\n logger.info(\"resetting training data\")\n if self.shuffle:\n random.shuffle(self.tweets)\n self.batch_generator = self.get_batch()", "def reset_train(self):\n\n self.model.apply(self._reset_weights)\n self.epoch_loss.reset()\n ...
[ "0.8029141", "0.78388387", "0.75038975", "0.73534787", "0.7033641", "0.7008768", "0.6966414", "0.6956943", "0.69548357", "0.69548357", "0.69548357", "0.6931854", "0.6927621", "0.69093573", "0.6893577", "0.68645054", "0.6855415", "0.68546826", "0.6844529", "0.68209225", "0.680...
0.78061765
2
Get the height of the board.
def get_grid_height(self): return self._height
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def height(self):\n return self.board.shape[0]", "def getHeight(self):\n return self.height", "def getHeight(self):\n return self.height", "def getHeight(self):\n return self._height", "def get_height(self):\n return self._height", "def get_height(self):\n return...
[ "0.8506178", "0.7828281", "0.7828281", "0.7792005", "0.77683884", "0.77683884", "0.77683884", "0.77683884", "0.77662206", "0.7763028", "0.776071", "0.77545404", "0.7742475", "0.77377915", "0.7721646", "0.769687", "0.76945823", "0.76945823", "0.76945823", "0.7678935", "0.76789...
0.7788401
5
Performs crossover with random pairs of parent chromosomes.
def crossover(self, parents: ChromList) -> ChromList: raise NotImplementedError
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def doCrossover(parentPop, parSize, rosterSize):\n\n firstPar = random.randint(0, parSize - 1)\n secondPar = random.randint(0, parSize - 1)\n while secondPar == firstPar:\n secondPar = random.randint(0, parSize - 1)\n\n crossOverPt = random.randint(1, rosterSize - 2) # random num between second...
[ "0.81810457", "0.7924618", "0.79096174", "0.7779728", "0.76192427", "0.74633986", "0.740763", "0.7372848", "0.7355658", "0.7303166", "0.7117834", "0.705921", "0.7012675", "0.7005534", "0.69947433", "0.67842203", "0.67840743", "0.6761611", "0.6720387", "0.67136836", "0.6706602...
0.69183517
15
Sets the document_name of this NotaryJournal.
def document_name(self, document_name): self._document_name = document_name
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_document_name_for_search(self, document_name):\n self.set_value_into_input_field(self.document_name_locator, document_name)", "def journal_name(self, journal_name):\n\n self._journal_name = journal_name", "def set_document_name(self, document_name_prefix):\n document_name = documen...
[ "0.74345607", "0.7245551", "0.7177776", "0.7113452", "0.63904274", "0.61373276", "0.60234064", "0.60234064", "0.59368086", "0.5926138", "0.58770764", "0.5866895", "0.5847449", "0.58348185", "0.58132046", "0.5762171", "0.575283", "0.575283", "0.5752074", "0.57235503", "0.57169...
0.85598785
0
Sets the notary_journal_id of this NotaryJournal.
def notary_journal_id(self, notary_journal_id): self._notary_journal_id = notary_journal_id
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def journal_name(self, journal_name):\n\n self._journal_name = journal_name", "def notary_journal_meta_data(self, notary_journal_meta_data):\n\n self._notary_journal_meta_data = notary_journal_meta_data", "def notary_journal_meta_data(self, notary_journal_meta_data):\n\n self._notary_journ...
[ "0.6449242", "0.60573745", "0.60573745", "0.5595721", "0.54060394", "0.5330788", "0.5300963", "0.5300963", "0.52472293", "0.5245279", "0.52139497", "0.5151341", "0.5123434", "0.5120889", "0.50911516", "0.5086347", "0.50861835", "0.50735587", "0.5070688", "0.5064107", "0.50399...
0.8895772
1
Sets the notary_journal_meta_data of this NotaryJournal.
def notary_journal_meta_data(self, notary_journal_meta_data): self._notary_journal_meta_data = notary_journal_meta_data
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def meta_data(self, meta_data):\n\n self._meta_data = meta_data", "def set_metadata(self, data):\r\n pass", "def set_meta(self, meta):\n self._meta['user_meta'] = meta", "def dataset_meta(self, dataset_meta: dict) -> None:\n self._dataset_meta = dataset_meta", "def notary_journa...
[ "0.6732024", "0.6254736", "0.5811493", "0.5791844", "0.5758129", "0.5758129", "0.5598925", "0.55614704", "0.55614704", "0.5463859", "0.5451853", "0.5396242", "0.5385939", "0.5358754", "0.5341978", "0.53194445", "0.5307141", "0.5307141", "0.5307141", "0.53007", "0.529995", "...
0.8900196
1
Sets the signer_name of this NotaryJournal.
def signer_name(self, signer_name): self._signer_name = signer_name
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def journal_name(self, journal_name):\n\n self._journal_name = journal_name", "def signing_group_name(self, signing_group_name):\n\n self._signing_group_name = signing_group_name", "def signer_id_type(self, signer_id_type):\n\n self._signer_id_type = signer_id_type", "def author_name(sel...
[ "0.6479226", "0.6416055", "0.5950925", "0.5806568", "0.5731801", "0.57137614", "0.5642888", "0.56417114", "0.56417114", "0.56417114", "0.55944216", "0.5546833", "0.5546833", "0.55098975", "0.5462267", "0.53910595", "0.5339872", "0.52895135", "0.52492446", "0.52316356", "0.520...
0.86383694
1
Returns true if both objects are equal
def __eq__(self, other): if not isinstance(other, NotaryJournal): 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
Returns a list of all tags used in projects "tags" field.
def get_all_tags(): try: tags = g.projects.distinct('tags') return jsonify(sorted(tags, key=str.lower)) except Exception as err: raise ApiException(str(err), 500)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def tags(self) -> List[str]:\n return self._db_data.tags", "def tags(self) -> Sequence[str]:\n return pulumi.get(self, \"tags\")", "def get_tags(self):\n return self.tags", "def get_tags(self):\n\n return self.tags", "def tags(self):\n return self._tags", "def tags(self...
[ "0.7697266", "0.7684183", "0.76637125", "0.760923", "0.75755155", "0.75755155", "0.75755155", "0.75755155", "0.75755155", "0.75755155", "0.75755155", "0.75755155", "0.75644326", "0.7552846", "0.75140464", "0.74873286", "0.7466476", "0.74554414", "0.7446326", "0.74091434", "0....
0.7983304
0
Save dict to a json file
def save_json_to_file(i): import json import ck.strings fn = i['json_file'] if i.get('safe', '') == 'yes': d = i['dict'] sd = {} # Check main unprintable keys for k in d: try: json.dumps(d[k]) except Exception as e: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def save_to_json(dict, file):\n with open(file, 'w') as f:\n json.dump(dict, f, indent=2)\n return file", "def save(self) -> None:\n with open(dict_path, 'w', encoding='utf-8') as dictionary_file:\n json.dump(self.data, dictionary_file, indent=2, separators=(',', ':'), ensure_ascii=False)", ...
[ "0.85935384", "0.8496975", "0.83929986", "0.83246815", "0.81857246", "0.8033262", "0.8024757", "0.79908717", "0.79556906", "0.7931191", "0.7926714", "0.79157794", "0.7898762", "0.78790456", "0.7860606", "0.7860606", "0.7860606", "0.7850196", "0.78019816", "0.77843595", "0.778...
0.73484087
79
Load YAML file to dict
def load_yaml_file(i): import yaml fn = i['yaml_file'] try: if sys.version_info[0] > 2: f = open(fn, 'r', encoding='utf8') else: f = open(fn, 'r') except Exception as e: return {'return': 16, 'error': 'problem opening YAML file='+fn+' ('+format(e)+')'} ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def load_yaml(path: str) -> Dict[str, Any]:\n with open(path, \"r\", encoding=\"utf8\") as fp:\n data = yaml.safe_load(fp)\n return data", "def load_yaml(path: str) -> dict:\n with open(path, 'r') as f:\n yaml_file = yaml.load(f, Loader=yaml.FullLoader)\n return yaml_file", "def l...
[ "0.7854452", "0.7795522", "0.7783344", "0.7766785", "0.7732107", "0.76515764", "0.76318055", "0.75729954", "0.7565318", "0.7543987", "0.75122184", "0.74096435", "0.73874646", "0.7381702", "0.7286865", "0.72802955", "0.72508013", "0.7247514", "0.72417116", "0.7225021", "0.7222...
0.76703876
5
Save dict to a YAML file
def save_yaml_to_file(i): import yaml fn = i['yaml_file'] d = i['dict'] try: # If using just dump and keys are in unicode, # pyyaml adds warning and makes produced yaml unparsable s = yaml.safe_dump(d) except Exception as e: return {'return': 1, 'error': 'problem c...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def save_yaml(dict_file, yaml_path):\n with open(yaml_path, \"w\") as file:\n documents = yaml.dump(dict_file, file)", "def save(dikt):\n with open(SAVE_FILE_NAME, 'w') as save_file:\n yaml.safe_dump(dikt, save_file)", "def save_file(filename,d):\n f = open(filename, 'w')\n yaml.dump(...
[ "0.81309444", "0.812642", "0.7879034", "0.7653643", "0.74776375", "0.72806627", "0.7279809", "0.72598714", "0.71851903", "0.7179228", "0.7148785", "0.7125464", "0.7125464", "0.7084718", "0.708284", "0.70665824", "0.70595264", "0.7016686", "0.6986854", "0.6920556", "0.68724155...
0.79558164
2
Swap focused window to Master position. If focus is on Master, swap it with the next window, placing focus on the new Master.
def swap_master(qtile): grp = qtile.current_group if grp.layout.clients.current_index > 0: grp.layout.cmd_swap_main() elif grp.layout.clients.current_index == 0 and len(grp.layout.clients.clients) > 0: grp.layout.cmd_shuffle_down() c = grp.layout.clients.focus_first() grp.foc...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def focus_master(qtile):\n grp = qtile.current_group\n if grp.layout.clients.current_index > 0:\n c = grp.layout.clients.focus_first()\n grp.focus(c, True)\n elif grp.layout.clients.current_index == 0 and len(grp.layout.clients.clients) > 0:\n grp.layout.cmd_down()", "def __switchFo...
[ "0.6535663", "0.63228023", "0.61377835", "0.5883937", "0.5848599", "0.58377093", "0.5821406", "0.5817451", "0.57522154", "0.5704952", "0.5697206", "0.56717813", "0.5664663", "0.5661121", "0.5506472", "0.5500348", "0.5479837", "0.54726", "0.5468203", "0.54434854", "0.5434063",...
0.72187644
0