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
Requests the unobservable property Camera Picture A current picture from the inside of the OT2 made with the builtin camera.
def Get_CameraPicture(self, request, context: grpc.ServicerContext) \ -> Ot2Controller_pb2.Get_CameraPicture_Responses: out_image_file: str = "/tmp/tmp_image.jpeg" cmd: str = f"ffmpeg -y -f video4linux2 -s 640x480 -i /dev/video0 -ss 0:0:1 -frames 1 {out_image_file}" logging.debug(f"r...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def camera(self):\n return self.__camera", "def camera(self):\n return self._camera", "def camera(self):\n return self._camera", "def get_image(self):\n return self.camera.getImage()", "def camera_image(self):\n return asyncio.run_coroutine_threadsafe(\n self.a...
[ "0.7252964", "0.7171043", "0.7171043", "0.6635073", "0.66326165", "0.6544904", "0.6502447", "0.6500317", "0.64916444", "0.64400244", "0.62307566", "0.6216591", "0.6159268", "0.61510336", "0.61234283", "0.611418", "0.6107051", "0.6092952", "0.60495925", "0.60309017", "0.601475...
0.5428583
75
Set weights in raw_model to the same as the values in base_model
def assign_weight(base_model, raw_model): if not isinstance(raw_model, ProxyModel): raw_model = create_model(raw_model) if not isinstance(base_model, ProxyModel): base_model = create_model(base_model) return assign_weight_(base_model, raw_model)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update_target_model(self):\n self.target_model.set_weights(self.model.get_weights())", "def update_target_model(self):\n self.target_model.set_weights(self.model.get_weights())", "def update_target_model(self):\n self.target_model.set_weights(self.model.get_weights())", "def _update_...
[ "0.736363", "0.736363", "0.736363", "0.73370326", "0.72685826", "0.7233067", "0.7228666", "0.6909494", "0.68227786", "0.68113", "0.68035674", "0.6773121", "0.6754516", "0.67481136", "0.6744691", "0.67285603", "0.6704484", "0.67024946", "0.6697666", "0.66232055", "0.6616637", ...
0.7975935
0
Find the offset (endtime) of last event
def max_event_offset(event_list): if isinstance(event_list, dcase_util.containers.MetaDataContainer): return event_list.max_offset else: max_offset = 0 for event in event_list: if 'event_offset' in event: if event['event_offset'] > max_offset: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _distance_to_last_event(self, step):\n if self.last_off is None:\n raise ValueError('No events in the stream')\n return step - self.offset - self.last_off", "def _get_end_time(self):\n return self.__end_time", "def getEnd(self) -> long:\n ...", "def get_end_loc(self) -> Tuple[int, in...
[ "0.71245843", "0.65647125", "0.64983296", "0.64672744", "0.64644086", "0.64284337", "0.6400768", "0.6317687", "0.6307628", "0.6261085", "0.6214452", "0.6212543", "0.6208934", "0.61859614", "0.617745", "0.6169912", "0.61355895", "0.6119131", "0.61146414", "0.6108772", "0.60593...
0.5665886
80
Constructor. Any message fields that are implicitly/explicitly set to None will be assigned a default value. The recommend use is keyword arguments as this is more robust to future message changes. You cannot mix inorder arguments and keyword arguments.
def __init__(self, *args, **kwds): if args or kwds: super(StateInstantiation, self).__init__(*args, **kwds) # message fields cannot be None, assign default values for those that are if self.state_path is None: self.state_path = '' if self.state_class is None: self.state_class...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self, *args, **kwds):\n if args or kwds:\n super(KomodoSpeechRecCommand, self).__init__(*args, **kwds)\n #message fields cannot be None, assign default values for those that are\n if self.header is None:\n self.header = std_msgs.msg.Header()\n if self.cmd is None:\n ...
[ "0.77940345", "0.77196896", "0.77196896", "0.7685901", "0.76253456", "0.75629234", "0.7438996", "0.74165684", "0.73517054", "0.73081905", "0.7280219", "0.7237793", "0.7226802", "0.7223405", "0.7223405", "0.7218974", "0.72109884", "0.72109884", "0.72109884", "0.72109884", "0.7...
0.0
-1
Convert date object to string in UTC time zone
def date_to_utc_string(filedate): return filedate.isoformat()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_mdal_datetime_to_string(date_object):\n return date_object.strftime('%Y-%m-%d %H:%M:%S') + ' UTC'", "def serialize_datetime_utc(date: datetime):\n if not date.tzinfo:\n date = date.astimezone(timezone(timedelta(0, 0)))\n\n if date.tzinfo.utcoffset(date).seconds == 0:\n return date....
[ "0.7659016", "0.75089747", "0.7369522", "0.7205237", "0.69105315", "0.68725103", "0.68626904", "0.68509555", "0.6690029", "0.6661467", "0.66307986", "0.6629458", "0.66169274", "0.6568638", "0.6560222", "0.65137964", "0.6488319", "0.6463694", "0.6463694", "0.6463694", "0.64411...
0.6963337
4
Returns True if the file type is in the supported languages or no language is specified for the linting rule and False otherwise. The file type is determined based upon the file extension.
def is_valid_language(self, file): if not self.languages or get_file_type(file["path"]) in self.languages: return True return False
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def check_file_type(fname):\n ext = path.splitext(fname)[1]\n return ext in allowed_extensions", "def is_valid_language(args, skip=False):\n if (is_valid_file_and_directory(args) and is_valid_comments(args)) or skip:\n if args.language is not None:\n return True\n return False", "...
[ "0.6796169", "0.6676195", "0.66761035", "0.6655733", "0.66222465", "0.65604573", "0.65242964", "0.65071243", "0.6394529", "0.6391489", "0.63549924", "0.63549924", "0.63442034", "0.63222754", "0.6315795", "0.62922436", "0.62922436", "0.62902623", "0.6244043", "0.6215115", "0.6...
0.8023326
1
Check whether two strings differ while avoiding timing attacks. This function returns True if the given strings differ and False if they are equal. It's careful not to leak information about where they differ as a result of its running time, which can be very important
def strings_differ(string1, string2): if len(string1) != len(string2): return True invalid_bits = 0 for a, b in zip(string1, string2): invalid_bits += a != b return invalid_bits != 0
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def string_difference(str1, str2):\n\n assert len(str1) == len(str2)\n return sum(a != b for a, b in zip(str1,str2))", "def Stringchecker(s1, s2):\r\n\r\n if len(s1) != len(s2) or len(set(s1)) < len(set(s2)):\r\n return False\r\n d = dict()\r\n for idx,c in enumerate(s1):\r\n if not...
[ "0.75381404", "0.7163597", "0.7095555", "0.69778156", "0.686597", "0.68140906", "0.6720929", "0.67119646", "0.6707888", "0.6686663", "0.667695", "0.6566231", "0.6539483", "0.6521889", "0.6489151", "0.6474953", "0.64587504", "0.6451998", "0.64454603", "0.6440221", "0.64271426"...
0.7962115
0
n '(' n1 '(' it is required to follow by n1 ')' and do the remaining things by call generateparenthesis recursively n2 '(' then,
def generateParenthesis(self, n): if n == 0: return [''] if n == 1: return ['()'] s = '' result = [] for i in range (n): l1 = self.generateParenthesis(i) l2 = self.generateParenthesis(n-i-1) for x in l1: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def generateParenthesis(self, n):\n # Write your code here\n result = []\n\n def helper(cur, left, right):\n if left == right == 0:\n result.append(cur)\n if left > 0:\n helper(cur + '(', left - 1, right)\n if left < right:\n ...
[ "0.78018075", "0.7714556", "0.7591787", "0.7328933", "0.66620284", "0.6052428", "0.60205156", "0.59093404", "0.5795332", "0.57377285", "0.56790286", "0.5644315", "0.5615959", "0.5578597", "0.55784184", "0.55780345", "0.55561304", "0.55517584", "0.55451864", "0.552039", "0.544...
0.7702732
2
test when base_image has been updated differently from parent_images.
def test_parent_images_mismatch_base_image(tmpdir, docker_tasker): dfp = df_parser(str(tmpdir)) dfp.content = "FROM base:image" workflow = mock_workflow() workflow.builder.set_df_path(dfp.dockerfile_path) workflow.builder.base_image = ImageName.parse("base:image") workflow.builder.parent_images ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_replace_image(self):\n pass", "def test_update_parent_images(organization, df_content, expected_df_content, base_from_scratch,\n tmpdir, reactor_config_map, docker_tasker):\n dfp = df_parser(str(tmpdir))\n dfp.content = df_content\n\n # maps from dockerfile i...
[ "0.682924", "0.677745", "0.6717157", "0.6540957", "0.63792443", "0.6267313", "0.6240192", "0.6066335", "0.6064322", "0.5974212", "0.59554476", "0.5913422", "0.5913422", "0.5912731", "0.5897517", "0.5872579", "0.58719134", "0.58695173", "0.5835859", "0.58278996", "0.58173937",...
0.7082796
0
Get a data set for the classification task.
def _get_classification_data(self, real, synthetic, real_label, synthetic_label): split_index = int(self.train_test_split * len(real)) X_train = synthetic[:split_index] y_train = synthetic_label[:split_index] X_test = real[split_index:] y_test = real_label[split_index:] r...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_dataset(self):\n\n trainset = datasets.CIFAR100('datasets/CIFAR100/train/', train=True, transform=self.train_transforms,\n target_transform=None, download=True)\n valset = datasets.CIFAR100('datasets/CIFAR100/test/', train=False, transform=self.val_transfor...
[ "0.6814949", "0.67930484", "0.67661095", "0.6753521", "0.6743594", "0.66997486", "0.6655245", "0.6639313", "0.6499928", "0.6465137", "0.64516157", "0.6446658", "0.6395921", "0.63687694", "0.6308663", "0.62589157", "0.624609", "0.62138027", "0.6188966", "0.61725646", "0.615189...
0.0
-1
returns a list of the tags that are attached to a certain server along with the API call status code GET /v1/{project_id}/servers/{server_id}/tags
def get_tags(requests_session: object, project_id: str, server_id: str) -> tuple: tags_response = requests_session.get( ECS_ENDPOINT_URL + ECS_API_URIS.get('tags_get').format(project_id=project_id, server_id=server_id)) status_code = tags_response.status_code tags = [] if status_code == 200: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_tags(self):\n resp = self.get(_u.build_uri(\"tags\", domain=self.domain))\n return utils.handle_response(resp)", "def tags(self):\r\n url = '{0}/{1}'.format(self.get_url(), 'tags')\r\n\r\n return http.Request('GET', url), parsers.parse_json", "def tags(self):\r\n url ...
[ "0.6803281", "0.6761624", "0.6672819", "0.6627935", "0.6446992", "0.62081885", "0.6193585", "0.6173667", "0.61642486", "0.61604476", "0.6122359", "0.61066496", "0.61017704", "0.6073707", "0.605851", "0.6045336", "0.6021335", "0.60021544", "0.59784544", "0.59739804", "0.596530...
0.79282516
0
used to send a post in the requests session to to create or delete tags POST /v1/{project_id}/servers/{server_id}/tags/action returns the status code and a message
def post_tags(requests_session: requests.Session, project_id: str, server_id: str, otc_format_tags: list, action: str) -> tuple: post_tags_payload = { 'action': action, 'tags': otc_format_tags } tags_post_response = requests_session.post( ECS_ENDPOINT_URL + ECS_API_URI...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _create_tag_response(response):\n if 'errortext' in response:\n if 'Unable to find resource by id' in response['errortext']:\n errors.invalid_resource_id()\n\n return {\n 'template_name_or_list': 'status.xml',\n 'response_type': 'CreateTagsResponse',\n 'return': 'tr...
[ "0.59254974", "0.5835358", "0.5820357", "0.57051224", "0.56579053", "0.55590117", "0.5557525", "0.55483687", "0.55253124", "0.5496704", "0.54918075", "0.54867166", "0.546899", "0.5460983", "0.544927", "0.5425436", "0.5330775", "0.52687895", "0.5232911", "0.5229187", "0.522645...
0.717686
0
Initialize the floor with the width and position provided. Randomly choose color and initialize rect.
def __init__(self, pos, width): self.width = width self.image = pygame.Surface((self.width,500)) self.image.fill((random.choice([(0,0,0), (50,50,50), (32,32,32)]))) self.x = pos[0] self.y = pos[1] self.rect = self.image.get_rect() self.rect.topleft = pos
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def reset(self, floornum, y):\n if floornum == 0:\n self.x = 50\n elif floornum == 1:\n self.x = 300\n elif floornum == 2:\n self.x = 550\n elif floornum == 3:\n self.x = 800\n self.width = 200\n self.y = y\n self.image = ...
[ "0.6837476", "0.65293753", "0.6434047", "0.6361208", "0.6182437", "0.61499476", "0.6145124", "0.6126481", "0.6119766", "0.6099944", "0.6076078", "0.60750824", "0.60697466", "0.60668755", "0.60286313", "0.6026321", "0.59683937", "0.59591097", "0.5955706", "0.59411186", "0.5913...
0.70519996
0
function to read meme file to pd.DataFrame
def parse_meme(file,label=""): lines = open(file).readlines() i = 0 myDict = {} while i < len(lines): myList = lines[i].strip().split() if len(myList) < 1: i = i + 1 continue if myList[0] == "MOTIF": if lines[i+1].strip() == "": desc = lines[i+2].strip().split() flag = True el...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def txt_to_dataframe(folder,name_parcellation):\n column_weight = ['patients','degree', 'density', 'global_efficiency', 'transitivity', 'assortavity', 'clustering_coef',\n 'fiedler_value', 'small_worldness','Null']\n\n file_name=folder+name_parcellation+'.txt'\n data=pd.read_csv(file_n...
[ "0.6949708", "0.6775848", "0.6745963", "0.6713025", "0.6713025", "0.6713025", "0.66866106", "0.6624753", "0.6616744", "0.66158015", "0.6542346", "0.65289736", "0.6497076", "0.64600605", "0.6457639", "0.64254814", "0.6420134", "0.63934046", "0.63926685", "0.63639724", "0.63536...
0.6484653
13
Returns the pickle storage filename corresponding to the job id
def filename_for_key(self, key, extension=None): if extension is None: extension = self.file_extension f = self.key2basename(key) + extension return os.path.join(self.basepath, f)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _get_job_id(self) -> str:\n return self.split_name[2][3:]", "def filename(self):\n return TaskInfo._filename(self.id)", "def _get_job_id(self):\n return uuid.uuid4().hex", "def get_job_working_directory(self, job_id):\n try:\n db_entry = self.get_item_by_id(job_id)\n ...
[ "0.66389495", "0.6564054", "0.6554419", "0.65362865", "0.64646196", "0.6450319", "0.6431399", "0.6388606", "0.63872045", "0.63812864", "0.6324681", "0.6289013", "0.6273656", "0.6255813", "0.62536293", "0.6161419", "0.6149283", "0.61223906", "0.6102822", "0.6102822", "0.609508...
0.0
-1
Given a log entry, return a Python object (datetime.datetime) from the timestamp.
def extract_timestamp(log_entry): pattern = r"\[(.+)\]\s" match = re.search(pattern, log_entry) if not match: msg = "The date was not found in the following log entry: {}".format(log_entry) raise DateNotFound(msg) timestamp_str = match.group().replace('[', '').replace(']', '').strip() ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def GetLogTime(self, line):\r\n if not re.match(r\"\\d+-\\d+-\\d\", line):\r\n return None\r\n\r\n # Split the timestamp at the beginning of the line\r\n time_split = re.split(r\"-\\d{4}\\s\", line)\r\n\r\n # Create a datetime object\r\n time_object = datetime.datetime.strptime(time_split[0],\r...
[ "0.71265703", "0.6845628", "0.6648224", "0.65437895", "0.6526164", "0.6332151", "0.6313333", "0.62613505", "0.6231508", "0.62067366", "0.61884874", "0.6119077", "0.608807", "0.6026353", "0.60065395", "0.5991876", "0.5972575", "0.5967045", "0.5942995", "0.5896723", "0.5874895"...
0.65123844
5
Validates types of userprovided "named aggregation" kwargs. `TypeError` is raised if aggfunc is not `str` or callable.
def validate_func_kwargs( kwargs: dict, ) -> Tuple[List[str], List[Union[str, Callable[..., Any]]]]: no_arg_message = "Must provide 'func' or named aggregation **kwargs." tuple_given_message = "func is expected but recieved {} in **kwargs." columns = list(kwargs) func = [] for col_func in kwargs...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def normalize_keyword_aggregation(kwargs: dict) -> Tuple[dict, List[str], List[int]]:\n # Normalize the aggregation functions as Mapping[column, List[func]],\n # process normally, then fixup the names.\n # TODO: aggspec type: typing.Dict[str, List[AggScalar]]\n # May be hitting https://github.com/pytho...
[ "0.6200034", "0.5784383", "0.5589745", "0.5586226", "0.5425667", "0.534624", "0.52875006", "0.52279323", "0.5191096", "0.5171148", "0.50874466", "0.5062109", "0.5047644", "0.49977913", "0.49977913", "0.49778032", "0.4971053", "0.49202305", "0.49129963", "0.48675326", "0.48669...
0.6396216
0
Map month names (full or 3letter) to month numbers.
def MonthNum(name): return _MONTH_DICT.get(name.capitalize(), 0)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _get_month(num) -> str:\n return dict(\n [\n (1, \"JAN\"), (2, \"FEB\"), (3, \"MAR\"), (4, \"APR\"), (5, \"MAY\"), (6, \"JUN\"),\n (7, \"JUL\"), (8, \"AUG\"), (9, \"SEP\"), (10, \"OCT\"), (11, \"NOV\"), (12, \"DEC\")\n ]\n )[num]", "def monthName(self, num):\n ...
[ "0.728223", "0.7133165", "0.7065515", "0.68561846", "0.6810506", "0.67851484", "0.67402744", "0.6670571", "0.66432685", "0.660999", "0.6601598", "0.6530064", "0.6502279", "0.6480368", "0.64713675", "0.64540535", "0.6436135", "0.63482296", "0.6289224", "0.627135", "0.62621725"...
0.73453856
0
Get month name for given month number, with length limit.
def MonthName(num, length=99): if num < 1 or num > NUM_MONTHS: raise ValueError('Bad month number') return _MONTH_NAMES[num - 1][:length]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def month_name(month_number):\n return calendar.month_name[month_number]", "def get_month_name(month_of_year):\n return VALID_MONTHS[month_of_year - 1].title()", "def get_month_name(month):\n datetime_object = datetime.datetime.strptime(str(month), \"%m\")\n month_name = str(datetime_object.strftim...
[ "0.82731414", "0.81010824", "0.7901626", "0.7718706", "0.7711107", "0.7665267", "0.7615849", "0.7407456", "0.7163134", "0.71445835", "0.71325", "0.7115543", "0.7096572", "0.68068117", "0.6783464", "0.67786247", "0.6711886", "0.66972315", "0.6600362", "0.6579706", "0.6411737",...
0.8571035
0
Compute day number from date, where 0 = 01Jan0000.
def DayNum(year, month, day): if month < 1 or month > NUM_MONTHS: raise ValueError('Bad month number') month_days, year_offset, day_offset = _YEAR_DAY_OFFSETS[month - 1] if (month == _LEAP_MONTH and year % 4 == 0 and (not year % 100 == 0 or (year % 400 == 0 and not year % 4000 == 0))): month_d...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def DAY(date):\n return _make_datetime(date).day", "def date_day(date):\n return date_day_of_month(date)", "def date_day_of_month(date):\n return date.day", "def DayNumMJD(year, month, day):\n return DayNum(year, month, day) - _MJD_BASE", "def day(self):\n return 0", "def day(self):\n ...
[ "0.7422049", "0.7234828", "0.70446944", "0.6829239", "0.67161834", "0.67161834", "0.65360415", "0.64275134", "0.6405349", "0.63924104", "0.6385377", "0.6359623", "0.6344435", "0.63420933", "0.6336718", "0.6326539", "0.62585515", "0.62465453", "0.6240699", "0.6240042", "0.6230...
0.660927
6
Return total leap seconds at start of day, and total seconds in day.
def LeapInfo(daynum): nextday = daynum + 1 index = 0 # _LEAP_TABLE is guaranteed nonempty, so 'start' is guaranteed initialized. for start in _LEAP_TABLE[0]: if nextday >= start: break index += 1 else: return 0, SECONDS_PER_DAY num_leaps = _LEAP_TABLE[1][index] leap_change = 0 if nextd...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def tai_day_secs(self):\n days = self._days - _TAI_BASE\n if days < 0:\n raise ValueError('Date precedes TAI origin')\n seconds = self.seconds + self.leapseconds\n day_offset, seconds = divmod(seconds, SECONDS_PER_DAY)\n return days + day_offset, seconds", "def total_seconds(self):\n r...
[ "0.74085516", "0.72059625", "0.70318496", "0.70163184", "0.676236", "0.67125714", "0.6610363", "0.6553865", "0.65529805", "0.64922184", "0.6436304", "0.64253974", "0.6418316", "0.64081186", "0.63846976", "0.6344498", "0.6343629", "0.62924975", "0.6190906", "0.61697704", "0.61...
0.5604956
46
Get day number relative to Unix base.
def DayNumUnix(year, month, day): return DayNum(year, month, day) - _UNIX_BASE
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_day(self):\n\n # First we get the first 8 bits stored in the day register\n # and translate it to an integer\n day_bcd = self.__read_register(_REGISTER_DAY)\n\n # Then we extract the digits and the tens\n tens = (day_bcd & 0x30) >> 4 # 0x30 = 0b00110000\n digit = ...
[ "0.69981414", "0.67459893", "0.667263", "0.6652598", "0.66157484", "0.64589834", "0.6446372", "0.6446372", "0.64363444", "0.64047736", "0.6389929", "0.6248733", "0.6233892", "0.6211245", "0.61533177", "0.61206955", "0.61104614", "0.61060697", "0.60837424", "0.60729265", "0.60...
0.8227812
0
Convert day number to year/month/day.
def DayNumToYMD(daynum): if daynum < _GREGORIAN_SKIP_END: raise ValueError('Date too early') qmill, qmilld = divmod(daynum - _CYCLE_BASE, _QUADRIMILLENIUM_DAYS) qcent, qcentd = divmod(qmilld, _QUADRICENTURY_DAYS) cent, centd = divmod(qcentd, _CENTURY_DAYS) if cent == 4: cent -= 1 centd += _CENTURY...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _calculate_date(day_of_year):\n date = datetime.datetime.strptime(str(day_of_year), '%j')\n return date.strftime('%d-%b')", "def yearMonthDay() :\n timeDateValue = time.asctime(time.gmtime()).lower().split()\n if int(timeDateValue[2]) < 10 : timeDateValue[2] = str('0'+str(timeDateValue[2]...
[ "0.73874503", "0.67953354", "0.6747652", "0.67382646", "0.67120045", "0.66266245", "0.64842546", "0.64624715", "0.640516", "0.63736933", "0.6352765", "0.63456297", "0.62903935", "0.6270822", "0.6261693", "0.62419504", "0.6232232", "0.62027496", "0.6188127", "0.6187453", "0.61...
0.5840401
55
Convert second of day to hour/minute/second.
def SecondsToHMS(seconds, leapok=True): leaps = (leapok and seconds >= SECONDS_PER_DAY and seconds - SECONDS_PER_DAY + 1) or 0 minutes, second = divmod(seconds - leaps, 60) hour, minute = divmod(minutes, 60) return hour, minute, second + leaps
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def convert_to_day_hour_min_sec(seconds):\n minutes, seconds = divmod(seconds, 60)\n hours, minutes = divmod(minutes, 60)\n days, hours = divmod(hours, 24)\n\n return (int(days), int(hours), int(minutes), seconds)", "def convertTime(self, sec):\n\n if self.timeFormat == S:\n return ...
[ "0.68914175", "0.686292", "0.68585783", "0.6750397", "0.66635454", "0.665755", "0.6600554", "0.65880716", "0.6576768", "0.6549753", "0.65190476", "0.6514102", "0.6486025", "0.64108604", "0.63604933", "0.63550085", "0.6342888", "0.632754", "0.6325049", "0.6318845", "0.62936586...
0.59388477
50
Create new date object from absolute day number.
def from_daynum(cls, daynum): # pylint: disable=invalid-name year, month, day = DayNumToYMD(daynum) return cls(year, month, day)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def day_fromordinal(cls, ordinal):\n return (ordinal - cls.EPOCH) % 210", "def from_fixed(cls, date):\n sun = cls.hindu_day_count(date) + Clock.days_from_hours(6)\n year = quotient(sun, cls.ARYA_SOLAR_YEAR)\n month = mod(quotient(sun, cls.ARYA_SOLAR_MONTH), 12) + 1\n day =...
[ "0.6505076", "0.64952254", "0.63765705", "0.62579966", "0.62496793", "0.62405455", "0.61132634", "0.6102647", "0.6074751", "0.60330707", "0.6019642", "0.6004474", "0.58871496", "0.5870352", "0.58422464", "0.57934386", "0.578089", "0.57568103", "0.57423425", "0.5626639", "0.56...
0.65317965
0
Get datetime string in specified format from date object.
def strftime(self, fmt, roundofs=0): # pylint: disable=invalid-name _ = roundofs if not self._struct: yday = self._days - DayNum(self.year, 1, 1) + 1 wday = _DayNumToWeekdayNum(self._days) self._struct = (self.year, self.month, self.day, 0, 0, 0, wday, yday, 0) return LocalStrftime(fmt, s...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def datetime_to_str(date, date_format=FORMAT_DATE):\n return date.strftime(date_format)", "def date2str(datetime_object):\n if datetime_object is None:\n return 'None'\n return datetime_object.strftime('%Y-%m-%dT%H:%M:%S.%f')[0:-3]", "def get_strftime(date_obj: dt.datetime) -> str:\...
[ "0.75197893", "0.7493894", "0.7338251", "0.7279545", "0.7253549", "0.70637554", "0.7060312", "0.7028501", "0.70117086", "0.70117086", "0.69747365", "0.6928238", "0.6915366", "0.6915216", "0.68904924", "0.6862322", "0.6826728", "0.68227476", "0.6810814", "0.6797736", "0.673103...
0.0
-1
Compare this time object to another.
def __cmp__(self, other): return (self._cmp(self.seconds, other.seconds) or self._cmp(self.nanosecond, other.nanosecond))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __cmp__(self, other):\n if not isinstance(other, Time):\n raise TypeError\n if self.GetPrecision() != other.GetPrecision():\n raise ValueError(\n \"Incompatible precision for comparison: \" + str(other))\n zDir = self.GetZoneOffset()\n otherZDir ...
[ "0.79911125", "0.7810843", "0.7631469", "0.7583585", "0.7553022", "0.72140515", "0.7185604", "0.7179149", "0.7179149", "0.71016043", "0.69942296", "0.6925857", "0.6908332", "0.6901355", "0.6806607", "0.6796081", "0.67729187", "0.6770616", "0.6762111", "0.6737748", "0.6736659"...
0.69564146
11
Get datetime string in specified format from time object.
def strftime(self, # pylint: disable=invalid-name fmt, roundofs=500, fixed_leap=None): struct_key = (roundofs, fixed_leap) struct = self._struct_dict.get(struct_key) if not struct: secofs, micros = divmod((self.nanosecond + roundofs) // 1000, 1000000) if fixed_leap is not None: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_time_str():\n return time.strftime(time_fmt)", "def _time_str(self):\n try:\n if not self._time:\n raise ValueError\n format_ = '%a, %d %b %Y %H:%M:%S'\n return datetime.fromtimestamp(float(self._time)).strftime(format_)\n except ValueError...
[ "0.7488192", "0.7424176", "0.7380509", "0.72339034", "0.7092918", "0.70134336", "0.69876873", "0.69563305", "0.6947015", "0.6906967", "0.68881327", "0.6874156", "0.68186307", "0.68136996", "0.6796894", "0.67917734", "0.678388", "0.675337", "0.67175007", "0.6670746", "0.665426...
0.0
-1
Get datetime string in specified format from datetime object.
def strftime(self, fmt=FMT_ISO8601, roundofs=500, fixed_leap=None): struct_key = (roundofs, fixed_leap) struct = self._struct_dict.get(struct_key) if not struct: strloc = self secofs, nanos = divmod(self.nanosecond + roundofs, 1000000000) if fixed_leap is not None: secofs += self.l...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def date2str(datetime_object):\n if datetime_object is None:\n return 'None'\n return datetime_object.strftime('%Y-%m-%dT%H:%M:%S.%f')[0:-3]", "def timestamp2str(datetime_obj, datetime_format):\n\n return datetime_obj.strftime(datetime_format)", "def datetime_to_str(obj):\n retur...
[ "0.7685902", "0.76704687", "0.7505066", "0.7484531", "0.7262375", "0.7231993", "0.7227", "0.72246855", "0.71934026", "0.7171468", "0.7171468", "0.7170994", "0.70938104", "0.7088773", "0.70707494", "0.70668507", "0.70172054", "0.7015474", "0.7009179", "0.6972379", "0.6924497",...
0.0
-1
Get difference in seconds between two datetime objects.
def diff_secs(self, other): if not isinstance(other, datetime): types = (type(other), datetime) raise TypeError('Type mismatch: %s not instance of %s' % types) # pylint: disable=protected-access diff = (self.nanosecond - other.nanosecond) / 1.0E9 diff += self.seconds - other.seconds + self.l...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def time_diff(dt1, dt2):\n return abs(int((dt2 - dt1).total_seconds()))", "def seconds_elapsed(date1, date2):\n return (date1 - date2).total_seconds()", "def datetime_difference(d1, d2):\n res = d1 - d2\n return 86400 * res.days + res.seconds", "def time_difference(time1: Time, time2: Time) -> fl...
[ "0.77428484", "0.7556761", "0.7514473", "0.71771675", "0.70494187", "0.6902525", "0.67267394", "0.67248523", "0.66752386", "0.66657203", "0.6626142", "0.66135657", "0.6599877", "0.6570887", "0.64879304", "0.64466244", "0.64339626", "0.6423577", "0.63698137", "0.63291264", "0....
0.810824
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 id = dictionary.get('id') provider_id = dictionary.get('providerId') server_time = dictionary.get('serverTime') username =...
{ "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.8318104", "0.8168106", "0.8168106", "0.8119619", "0.8089429", "0.7978183", "0.79495466", "0.79227656", "0.7898806", "0.7894103", "0.7887986", "0.78827816", "0.78821284", "0.7876549", "0.7858773", "0.78385323", "0.78039247", "0.78039247", "0.78039247", "0.78039247", "0.7803...
0.7464869
90
Set the return column name.
def SetReturnColName(self, returnColName): self.returnColName = returnColName
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_column_name(self, name):\r\n self.column_name = name", "def set_column_name(self, name):\r\n self.column_name = name", "def column_name(self, label):\n self.output_label = label\n return self", "def column_name(self) -> Optional[str]:\n return pulumi.get(self, \"col...
[ "0.72269416", "0.72269416", "0.6873123", "0.685672", "0.6793455", "0.65688014", "0.65688014", "0.65153146", "0.62415624", "0.6209975", "0.6057877", "0.60008556", "0.5887645", "0.57691956", "0.5743669", "0.5743669", "0.5717892", "0.57166964", "0.57166004", "0.5691286", "0.5663...
0.8320695
0
Create a grid of points in local coordinates. If the fault is a plane, zcoordinate is always zero. Otherwise, points are interpolated from the enclosing triangle vertices.
def create_local_grid(points: np.ndarray, edge_sides: dict, triangles: np.ndarray, fault_is_plane: bool, resolution: float=5000.0, num_search_tris: int=10): # Edge coordinates. left_edge = edge_sides['left_edge'] right_edge = edge_sides['right_edge'] bottom_edge = edge_sides['bott...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _build_point_grid(n_per_side: int) -> np.ndarray:\n offset = 1 / (2 * n_per_side)\n points_one_side = np.linspace(offset, 1 - offset, n_per_side)\n points_x = np.tile(points_one_side[None, :], (n_per_side, 1))\n points_y = np.tile(points_one_side[:, None], (1, n_per_side))\n points = np.stack([p...
[ "0.6073817", "0.6022481", "0.59388125", "0.5872261", "0.5866663", "0.5773723", "0.57582706", "0.5663194", "0.56622124", "0.56446195", "0.564426", "0.56365603", "0.56322825", "0.5604565", "0.5515934", "0.5484022", "0.54805565", "0.54339933", "0.5398342", "0.5397461", "0.538869...
0.7446521
0
Return a copy of the current QuerySet. A lightweight alternative to deepcopy().
def _clone(self): #可见,这样可以将本类初始化参数全部赋给c对象,作为c的属性 c = self.__class__(model=self.model, query=self.query.chain(), using=self._db, hints=self._hints) c._sticky_filter = self._sticky_filter c._for_write = self._for_write c._prefetch_related_lookups = self._prefetch_related_lookups[:]...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def copy(self):\n return type(self)(*self.__queries, op=self.__op)", "def copy(self):\n options = {\n 'op': self.__op,\n 'caseSensitive': self.__caseSensitive,\n 'value': copy.copy(self.__value),\n 'inverted': self.__inverted,\n 'functions': co...
[ "0.74110913", "0.72840685", "0.7283737", "0.72821987", "0.7264214", "0.7071942", "0.7017681", "0.70115393", "0.69670343", "0.69670343", "0.69670343", "0.69670343", "0.69670343", "0.69670343", "0.69670343", "0.69670343", "0.69670343", "0.69670343", "0.69670343", "0.69670343", ...
0.6932347
26
Return a copy of the current QuerySet that's ready for another operation.
def _chain(self, **kwargs): obj = self._clone() if obj._sticky_filter: obj.query.filter_is_sticky = True obj._sticky_filter = False obj.__dict__.update(kwargs) return obj
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_queryset(self):\n if self.queryset is not None:\n queryset = self.queryset\n if hasattr(queryset, '_clone'):\n queryset = queryset._clone()\n elif self.model is not None:\n queryset = self.model._default_manager.all()\n else:\n ...
[ "0.7088302", "0.70496553", "0.69245994", "0.69096506", "0.6896556", "0.68843067", "0.67961603", "0.6774138", "0.67074513", "0.66834545", "0.6675896", "0.66611445", "0.66161203", "0.6600741", "0.65844303", "0.6579645", "0.652667", "0.6506999", "0.6506707", "0.6477616", "0.6446...
0.0
-1
convert feature form (vector) to index form (single integer)
def feature_to_index(feature, dims): p = 0 for j, k in enumerate(feature): print("j:", "k:", k, "dims", dims[:j]) p += int(np.prod(dims[:j])) * k return p
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _features_to_state_space_index(self, features):\n if (np.any(features > np.expand_dims(self.factor_sizes, 0)) or\n np.any(features < 0)):\n raise ValueError(\"Feature indices have to be within [0, factor_size-1]!\")\n return np.array(np.dot(features, self.factor_bases), dtype=...
[ "0.7111758", "0.68510664", "0.6739631", "0.6739631", "0.6613043", "0.6554009", "0.6502301", "0.64755017", "0.63614255", "0.63556206", "0.63423496", "0.6337037", "0.63327134", "0.62339884", "0.6150648", "0.6143573", "0.6138442", "0.6134612", "0.60756934", "0.6073615", "0.60580...
0.7543005
0
Creates a copy of this array with the data in the specified unit system, and returns it in that system's base units. Assumes that no electromagnetic units are being used.
def _unyt_array_in_base_no_em(self, unit_system=None): to_units = self.units.get_base_equivalent(unit_system) conv, offset = self.units.get_conversion_factor(to_units, self.dtype) new_dtype = np.dtype("f" + str(self.dtype.itemsize)) conv = new_dtype.type(conv) ret = self.v*conv if offset: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def unit_array(self):\n return self._data_array.values * units(self._units)", "def _Unit_get_base_equivalent_no_em(self, unit_system=None):\n\n unit_system = _sanitize_unit_system(unit_system, self)\n\n try:\n new_units = unit_system[self.dimensions]\n except MissingMKSCurrent:\n ra...
[ "0.6479113", "0.63794106", "0.6208505", "0.601463", "0.5955984", "0.5748323", "0.57426244", "0.5694706", "0.5693386", "0.5606096", "0.5473894", "0.5439267", "0.5428262", "0.5411939", "0.5402224", "0.5390756", "0.53902197", "0.53157127", "0.5301613", "0.5288008", "0.5271662", ...
0.67793745
0
Deletes all records for a given model
def delete_all(self, Model): ndb.delete_multi( Model.query().fetch(keys_only=True) )
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def delete_all(cls):\n cls.dbm().modelclass_deleteall(cls)", "def del_all_records():\n delete_alles = Customer.delete().where(Customer.name >= '')\n delete_alles.execute()", "def delete(self, model):\n self._isinstance(model)\n db.session.delete(model)\n db.session.commit()", ...
[ "0.7396889", "0.72598666", "0.7179133", "0.71778786", "0.71778786", "0.71778786", "0.7032867", "0.70309573", "0.7022916", "0.6908953", "0.6877598", "0.6839011", "0.68190974", "0.67980665", "0.67542833", "0.6751664", "0.6744567", "0.6662852", "0.6656441", "0.66319317", "0.6624...
0.7927618
0
Return merged dictionaries with sum value for matching keys.
def merge_dicts(dict1, dict2): return dict(Counter(dict1) + Counter(dict2))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def MergeDictionary(self, dict1, dict2):\r\n for key_2, val_2 in dict2.items():\r\n for key_2_2, val_2_2 in val_2.items():\r\n if key_2 in dict1 and key_2_2 in dict1[key_2]:\r\n dict1[key_2][key_2_2] += val_2_2\r\n else:\r\n self...
[ "0.67873925", "0.6653598", "0.6639214", "0.6626142", "0.65843093", "0.6545938", "0.6512028", "0.6509168", "0.6484663", "0.6469891", "0.6454852", "0.640172", "0.6362867", "0.6312674", "0.6279146", "0.6152157", "0.61468965", "0.6056878", "0.60122395", "0.59752023", "0.59464943"...
0.6518167
6
Get the max velocity of the player.
def get_max_velocity(self): return self._max_velocity
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def velocity_limit(self):\n return self._read(MX_VELOCITY_LIMIT)", "def speed(self):\n return self._getAttribute(Attribute.maxVelocity)", "def getVelocity(self):\n\n return self.vel", "def speed_max(self):\n return self._speed_max", "def get_velocity(self):\n return self.mome...
[ "0.7160509", "0.7080939", "0.70452416", "0.69771224", "0.6944163", "0.6862952", "0.6847949", "0.68428206", "0.6817616", "0.67662406", "0.67343795", "0.6727803", "0.67203313", "0.6705049", "0.6705049", "0.66772395", "0.6675921", "0.66665876", "0.66529727", "0.66466075", "0.664...
0.87718356
0
Get separator with one node described by given arguments. But its first positional argument is the single graph's input!
def get_single_node_separator(plugin, /, *args, **kwargs): ag = ActivationGraph(1) ag.add_activation(plugin, ag.inputs[0], *args, **kwargs) separator = Separator(ag) return separator
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_separator(self):\r\n \r\n return self._separator", "def _get_separator(num, sep_title, sep_character, sep_length):\n left_divider_length = right_divider_length = sep_length\n if isinstance(sep_length, tuple):\n left_divider_length, right_divider_length = sep_length\n left_di...
[ "0.55871254", "0.554832", "0.5506791", "0.5441939", "0.5373432", "0.53350765", "0.5321165", "0.53145134", "0.5304963", "0.528283", "0.5251846", "0.51730627", "0.5166978", "0.51543283", "0.51134616", "0.50809175", "0.5079779", "0.5067943", "0.5041512", "0.50237983", "0.5014466...
0.7749424
0
Retrieves all nouns from the NLTK corpus of texts.
def get_noun_pairs_from_all_texts(self): singulars = [] for text in self.available_texts(): singulars += self.get_nouns_from_text(text) singulars = list(set(singulars)) return [(singular, plural(singular)) for singular in singulars]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_nouns(self):\n word_punct_token = WordPunctTokenizer().tokenize(self.sentence_string)\n\n clean_tokens = []\n for token in word_punct_token:\n token = token.lower()\n\n # remove any value that are not alphabetical\n new_token = re.sub(r\"[^a-zA-Z]+\", \...
[ "0.69928575", "0.68113935", "0.6692909", "0.6378218", "0.6326218", "0.6189003", "0.6062378", "0.60183513", "0.59566253", "0.59475416", "0.59331584", "0.5876968", "0.5758168", "0.5734197", "0.5714935", "0.5575459", "0.55366033", "0.5378696", "0.5368146", "0.5354995", "0.530516...
0.6171372
6
Delete a field given the request.
def delete_field(request): try: bpo_topic = BPOTopic.objects.get(id=ObjectId(request.POST.get('topic_id'))) bpo_field = BPOField.objects.get(id=ObjectId(request.POST.get('field_id'))) bpo_topic.fields.remove(ObjectId(bpo_field.id)) bpo_topic.save() bpo_field.delete() exce...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def delete_field(self):\n self.exec_command(b\"DeleteField\")", "def delete_field(model, *arg):\n return model._pw_index_.delete_field(*arg)", "def delete_field(browser, field_name):\n manager = browser.login('mgr')\n manager.open(\n browser.ENTITY_PERSON_LIST_FIELDS_URL +\n '/{}/@@...
[ "0.7458516", "0.72065747", "0.718218", "0.71290725", "0.6618744", "0.6587737", "0.6538688", "0.64342654", "0.63400453", "0.6295021", "0.6233151", "0.61999375", "0.61806387", "0.6119702", "0.6117942", "0.60413265", "0.60201937", "0.6011943", "0.5988781", "0.5977266", "0.594393...
0.6978309
4
called by the UserPassesTestMixin to verify the user has permissions to use this view
def test_func(self): self.rol_nu, self.functie_nu = rol_get_huidige_functie(self.request) return self.rol_nu in (Rollen.ROL_BB, Rollen.ROL_BKO, Rollen.ROL_RKO, Rollen.ROL_RCL, Rollen.ROL_HWL)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def can_view(self, user):\r\n return True", "def test_should_render_with_permission(self) -> None:\n self.assertTrue(self.action.should_render(\n context=self._create_request_context(\n user=self.create_user())))", "def test_func(self):\n return self.request.user....
[ "0.79644096", "0.76653093", "0.7630147", "0.7598218", "0.75751585", "0.75073326", "0.74040127", "0.7306457", "0.7243017", "0.723138", "0.7214192", "0.7175887", "0.71758544", "0.71679866", "0.713544", "0.71210676", "0.71124005", "0.70704067", "0.70560104", "0.7005368", "0.6997...
0.0
-1
called by the UserPassesTestMixin to verify the user has permissions to use this view
def test_func(self): self.rol_nu = rol_get_huidige(self.request) return self.rol_nu in (Rollen.ROL_BB, Rollen.ROL_BKO, Rollen.ROL_RKO, Rollen.ROL_RCL, Rollen.ROL_HWL)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def can_view(self, user):\r\n return True", "def test_should_render_with_permission(self) -> None:\n self.assertTrue(self.action.should_render(\n context=self._create_request_context(\n user=self.create_user())))", "def test_func(self):\n return self.request.user....
[ "0.79639465", "0.76660234", "0.7629464", "0.759793", "0.7574752", "0.75061977", "0.7404198", "0.7306178", "0.72424793", "0.72309196", "0.7214537", "0.7176562", "0.7175171", "0.7167812", "0.7134997", "0.7121732", "0.71126574", "0.70693946", "0.70555335", "0.7004602", "0.699659...
0.0
-1
called by the UserPassesTestMixin to verify the user has permissions to use this view
def test_func(self): self.rol_nu = rol_get_huidige(self.request) return self.rol_nu in (Rollen.ROL_BB, Rollen.ROL_BKO, Rollen.ROL_RKO, Rollen.ROL_RCL, Rollen.ROL_HWL)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def can_view(self, user):\r\n return True", "def test_should_render_with_permission(self) -> None:\n self.assertTrue(self.action.should_render(\n context=self._create_request_context(\n user=self.create_user())))", "def test_func(self):\n return self.request.user....
[ "0.7964767", "0.76651275", "0.76293224", "0.7598162", "0.7575197", "0.7506991", "0.7403544", "0.7306148", "0.7242202", "0.7230594", "0.7213818", "0.71755105", "0.71747154", "0.71674365", "0.7134701", "0.71220094", "0.71107244", "0.70702934", "0.7055631", "0.70042187", "0.6997...
0.0
-1
called by the UserPassesTestMixin to verify the user has permissions to use this view
def test_func(self): self.rol_nu = rol_get_huidige(self.request) return self.rol_nu in (Rollen.ROL_BB, Rollen.ROL_BKO, Rollen.ROL_RKO, Rollen.ROL_RCL, Rollen.ROL_HWL)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def can_view(self, user):\r\n return True", "def test_should_render_with_permission(self) -> None:\n self.assertTrue(self.action.should_render(\n context=self._create_request_context(\n user=self.create_user())))", "def test_func(self):\n return self.request.user....
[ "0.7965206", "0.76659435", "0.76298976", "0.7598314", "0.75752974", "0.75072837", "0.74036145", "0.7306036", "0.7242765", "0.7231282", "0.7213383", "0.71765584", "0.71753776", "0.7168052", "0.71354675", "0.71217483", "0.7111363", "0.70701325", "0.7055857", "0.7005347", "0.699...
0.0
-1
called by the UserPassesTestMixin to verify the user has permissions to use this view
def test_func(self): rol_nu = rol_get_huidige(self.request) return rol_nu == Rollen.ROL_RCL
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def can_view(self, user):\r\n return True", "def test_should_render_with_permission(self) -> None:\n self.assertTrue(self.action.should_render(\n context=self._create_request_context(\n user=self.create_user())))", "def test_func(self):\n return self.request.user....
[ "0.79644096", "0.76653093", "0.7630147", "0.7598218", "0.75751585", "0.75073326", "0.74040127", "0.7306457", "0.7243017", "0.723138", "0.7214192", "0.7175887", "0.71758544", "0.71679866", "0.713544", "0.71210676", "0.71124005", "0.70704067", "0.70560104", "0.7005368", "0.6997...
0.0
-1
called by the UserPassesTestMixin to verify the user has permissions to use this view
def test_func(self): self.rol_nu, self.functie_nu = rol_get_huidige_functie(self.request) return self.rol_nu == Rollen.ROL_RCL
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def can_view(self, user):\r\n return True", "def test_should_render_with_permission(self) -> None:\n self.assertTrue(self.action.should_render(\n context=self._create_request_context(\n user=self.create_user())))", "def test_func(self):\n return self.request.user....
[ "0.79639465", "0.76660234", "0.7629464", "0.759793", "0.7574752", "0.75061977", "0.7404198", "0.7306178", "0.72424793", "0.72309196", "0.7214537", "0.7176562", "0.7175171", "0.7167812", "0.7134997", "0.7121732", "0.71126574", "0.70693946", "0.70555335", "0.7004602", "0.699659...
0.0
-1
called by the UserPassesTestMixin to verify the user has permissions to use this view
def test_func(self): self.rol_nu, self.functie_nu = rol_get_huidige_functie(self.request) return self.rol_nu == Rollen.ROL_RCL
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def can_view(self, user):\r\n return True", "def test_should_render_with_permission(self) -> None:\n self.assertTrue(self.action.should_render(\n context=self._create_request_context(\n user=self.create_user())))", "def test_func(self):\n return self.request.user....
[ "0.7965206", "0.76659435", "0.76298976", "0.7598314", "0.75752974", "0.75072837", "0.74036145", "0.7306036", "0.7242765", "0.7231282", "0.7213383", "0.71765584", "0.71753776", "0.7168052", "0.71354675", "0.71217483", "0.7111363", "0.70701325", "0.7055857", "0.7005347", "0.699...
0.0
-1
Gets the pending message count
def pending(self, partitions=None): if not partitions: partitions = self.offsets.keys() total = 0 reqs = [] for partition in partitions: reqs.append(OffsetRequest(self.topic, partition, -1, 1)) resps = self.client.send_offset_request(reqs) for r...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def num_pending_messages(self):\n if self.connected:\n return len(self.messenger.num_pending_messages())\n return 0", "def get_message_count(self):\n return self.buffer.count()", "def message_count(self):\n return self._message_count", "def message_count(self):\n ...
[ "0.7753499", "0.76494116", "0.7587302", "0.7484095", "0.72717226", "0.7171334", "0.70272076", "0.6937997", "0.69179946", "0.68245584", "0.6769363", "0.67421126", "0.67251945", "0.67171186", "0.6705362", "0.66558313", "0.665104", "0.665104", "0.659885", "0.6541925", "0.6534295...
0.0
-1
Return a dictionary suitable for passing to matplotlib.colors.LinearSegmentedColormap
def htmlColorMap(html,step=False,name='customColorMap'): stops = html[::2] cols = html[1::2] stop_min = float(min(stops)) stop_max = float(max(stops)) cdict = {'red':[], 'green':[], 'blue':[]} stops = [(float(s)-stop_min)/(stop_max-stop_min) for s in stops] # Normalize cols = [matplotlib.co...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_colors(self):\n colors = [\"#244486\", \"#A6A6A6\", \"#B12122\"]\n cmap = LinearSegmentedColormap.from_list(\"mycmap\", colors)\n\n color_palette=[cmap(i) for i in np.linspace(0, 1, len(set(self.nodes_list)))]\n return dict(zip(list(set(self.nodes_list)), color_palette))", "de...
[ "0.7400199", "0.7148512", "0.6938483", "0.6716747", "0.6707655", "0.6607257", "0.6553616", "0.6553362", "0.64822197", "0.64534044", "0.6426348", "0.63699734", "0.63617706", "0.63617706", "0.63617706", "0.6335546", "0.6288023", "0.6288023", "0.62610155", "0.62519455", "0.62421...
0.5696899
70
Sample an image patch.
def get_crop_numpy(im: np.ndarray, pos: np.ndarray, sample_sz: np.ndarray, output_sz: np.ndarray = None, mode: str = 'constant', avg_chans=(0, 0, 0), max_scale_change=None): # if mode not in ['replicate', 'inside']: # raise ValueError('Unknown border mode \'{}\'.'.format(mode)) # co...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_patch_image(self):\n pass", "def sample_patches(images, npatches, patch_sz):\n\tnimages, nrows, ncols = images.shape\n\timg_index = np.random.randint(0, nimages, npatches)\n\trow_index = np.random.randint(0, nrows-patch_sz, npatches)\n\tcol_index = np.random.randint(0, ncols-patch_sz, npatches)\n...
[ "0.6554358", "0.6527014", "0.61804867", "0.6170769", "0.613139", "0.6114528", "0.60593945", "0.60451907", "0.60140693", "0.5980161", "0.59779996", "0.5932115", "0.58788383", "0.5865573", "0.58631957", "0.5792506", "0.5761254", "0.5749112", "0.57488966", "0.5743674", "0.569228...
0.0
-1
Sample an image patch.
def get_crop_torch(im: torch.Tensor, pos: torch.Tensor, sample_sz: torch.Tensor, output_sz: torch.Tensor = None, mode: str = 'replicate', max_scale_change=None, is_mask=False): # if mode not in ['replicate', 'inside']: # raise ValueError('Unknown border mode \'{}\'.'.format(mode)) # c...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_patch_image(self):\n pass", "def sample_patches(images, npatches, patch_sz):\n\tnimages, nrows, ncols = images.shape\n\timg_index = np.random.randint(0, nimages, npatches)\n\trow_index = np.random.randint(0, nrows-patch_sz, npatches)\n\tcol_index = np.random.randint(0, ncols-patch_sz, npatches)\n...
[ "0.6554358", "0.6527014", "0.61804867", "0.6170769", "0.613139", "0.6114528", "0.60593945", "0.60451907", "0.60140693", "0.5980161", "0.59779996", "0.5932115", "0.58788383", "0.5865573", "0.58631957", "0.5792506", "0.5761254", "0.5749112", "0.57488966", "0.5743674", "0.569228...
0.0
-1
Return a string containing HPCGrelated environment variables.
def _GetEnvironmentVars(benchmark_spec): return ' '.join([ 'NUM_GPUS=%s' % benchmark_spec.total_gpus, 'OMP_NUM_THREADS=%s' % benchmark_spec.cpus_per_rank ])
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_formatted_env_vars() -> str:\n res = \"\"\n for k, v in os.environ.items():\n res += '{0}={1}\\n'.format(k, v)\n return res", "def show_env():\n envs = [\"PATH\", \"ORACLE_HOME\", \"TNS_ADMIN\", \"NLS_LANG\"]\n result = {}\n for env in envs:\n if env in os.environ:\n ...
[ "0.7742425", "0.6694668", "0.6517364", "0.6429676", "0.6283668", "0.61459494", "0.6085526", "0.60678643", "0.6034354", "0.6029613", "0.6022354", "0.60187364", "0.59841335", "0.59723985", "0.597136", "0.59610605", "0.5864319", "0.5861262", "0.5846688", "0.5841831", "0.5829062"...
0.68088734
1
Two timestamps in an incoming signal are compared.
def test_default_config(self, Signal): blk = ElapsedTime() config = { 'timestamp_a': '{{ $timestamp_a }}', 'timestamp_b': '{{ $timestamp_b }}', } self.configure_block(blk, config) # process a list of signals blk.start() blk.process_signals...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __le__(self, other):\n return self.timestamp <= other.timestamp", "def __le__(self, other: Event) -> bool:\n return self.timestamp <= other.timestamp", "def compareTimestamp(self,timestamp1,timestamp2):\n\t\tt1 = datetime.strptime(timestamp1[0:20]+timestamp1[26:], '%a %b %d %H:%M:%S %Y')\n\t\...
[ "0.69612837", "0.66823643", "0.6617733", "0.66008747", "0.65875983", "0.6535617", "0.65040076", "0.6503075", "0.6501473", "0.64101017", "0.6382919", "0.6382919", "0.6367056", "0.6349325", "0.6330451", "0.61632293", "0.6161588", "0.6137551", "0.6121758", "0.6094915", "0.608712...
0.0
-1
Defined behavior for negative intervals.
def test_negative_interval(self, Signal): blk = ElapsedTime() config = { 'enrich': { 'exclude_existing': True, }, 'units': { 'days': '{{ $days }}', 'hours': '{{ $hours }}', 'minutes': '{{ $minutes }}', ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __neg__(self):\n return Intervalo(-self.hi, -self.lo)", "def __neg__(self):\n return 0 - self", "def __neg__(self):\n return (-1)*self", "def __abs__( self ):\r\n\t\tif ( self < 0 ): return -self\r\n\t\telse: return self", "def __neg__(self):\n return self.neg()", "def __n...
[ "0.7836747", "0.7113507", "0.68641067", "0.66221863", "0.66113967", "0.655584", "0.65488356", "0.6540014", "0.65320796", "0.6498318", "0.64857817", "0.6444734", "0.64084077", "0.640815", "0.6397739", "0.635652", "0.6315684", "0.6297905", "0.62955654", "0.6240805", "0.6239082"...
0.6764384
3
ISO formatting for datetime to be used in JSON.
def dthandler(obj): if hasattr(obj, "isoformat"): return obj.isoformat() else: raise TypeError("Object can not be isoformatted.")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def format_datetime(self, datetime):\n return datetime.isoformat()", "def for_json(self) -> str:\n return self.isoformat()", "def format_iso8601(obj):\n return obj.strftime('%Y-%m-%dT%H:%M:%SZ')", "def datetime_to_isoformat(obj: datetime.datetime) -> str:\n return obj.replace(tzinfo=datet...
[ "0.8152909", "0.7608662", "0.7483675", "0.74747735", "0.7471251", "0.735487", "0.73449254", "0.7328345", "0.73011297", "0.7274717", "0.7212101", "0.71753186", "0.7130002", "0.70924556", "0.7079277", "0.706931", "0.7063206", "0.70448077", "0.7003251", "0.6976261", "0.6959805",...
0.0
-1
transform from mxnet im_tensor to ordinary RGB image im_tensor is limited to one image
def transform_inverse(im_tensor, pixel_means): assert im_tensor.shape[0] == 1 im_tensor = im_tensor.copy() # put channel back channel_swap = (0, 2, 3, 1) im_tensor = im_tensor.transpose(channel_swap) im = im_tensor[0] assert im.shape[2] == 3 im += pixel_means[[2, 1, 0]] im =...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def im_convert(tensor):\n \n image = tensor.to(\"cpu\").clone().detach()\n image = image.numpy().squeeze()\n image = image.transpose(1,2,0)\n image = image * np.array((0.229, 0.224, 0.225)) + np.array((0.485, 0.456, 0.406))\n image = image.clip(0, 1)\n\n return image", "def tensor2im_raw_sss...
[ "0.72433734", "0.7192492", "0.7082336", "0.7029209", "0.6817841", "0.6813988", "0.6787738", "0.677897", "0.6757867", "0.67087114", "0.6671362", "0.66543686", "0.66537553", "0.6527805", "0.6516178", "0.6497812", "0.648993", "0.64652926", "0.6423829", "0.6423829", "0.6423829", ...
0.0
-1
Returns if the word is in the trie.
def search(self, word: str) -> bool: node = self for c in word: node = node.d.get(c) if not node: return False return node.end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def in_trie(self, trie, word):\n current_dict = trie\n for letter in word:\n if letter in current_dict:\n current_dict = current_dict[letter]\n else:\n return False\n else:\n if '_end_' in current_dict:\n return curr...
[ "0.838632", "0.8150416", "0.8123471", "0.7856802", "0.7830664", "0.77935004", "0.7792806", "0.77642965", "0.7753436", "0.7747724", "0.7711298", "0.76816714", "0.7677101", "0.7664614", "0.76506114", "0.76338875", "0.7628353", "0.76114196", "0.7577657", "0.75695884", "0.756079"...
0.7392502
40
Constructor for a sqlloader object A loader class for a table an index
def __init__(self, db_engine, es_conn, max_rows=2000, seq_field='INSERT_SEQ', sql='', doctype='', chunk_size=100, es_config=None): self.engine = db_engine self.es = es_conn self.max_rows = max_rows self.seq_field = seq_field self.sql = sql...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self, **kwargs):\n TableLoader.__init__(self, **kwargs)", "def __init__(self, **kwargs):\n TableLoader.__init__(self, **kwargs)", "def __init__(self, **kwargs):\n TableLoader.__init__(self, **kwargs)", "def __init__(self, **kwargs):\n TableLoader.__init__(self, **kwar...
[ "0.7622719", "0.7622719", "0.7622719", "0.7622719", "0.7622719", "0.7622719", "0.7622719", "0.7622719", "0.7622719", "0.7622719", "0.7622719", "0.65444785", "0.6318525", "0.62829226", "0.6191603", "0.611081", "0.60855925", "0.6063408", "0.60162073", "0.6007791", "0.6003837", ...
0.0
-1
Get datetimestamp. Returns str Datetimestamp in string format separated by '_'.
def get_dt_stamp(): return re.split( '\.', str(datetime.now()))[0].replace( ' ', '_').replace( ':', '_').replace( '-', '_')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def timestamp():\n\treturn datetime.now().strftime(\"%Y%m%d_%H%M%S\")", "def timestamp():\n return datetime.now().strftime('%Y-%m-%d_%H-%M-%S')", "def get_timestamp():\n timestamp = '{:%Y-%m-%d_%H-%M-%S}'.format(datetime.datetime.now())\n return timestamp", "def _generate_timestamp():\n\t\treturn st...
[ "0.7462913", "0.7412866", "0.73200834", "0.7234659", "0.7212876", "0.7208783", "0.72046053", "0.7160599", "0.71347004", "0.7075187", "0.70567906", "0.70462185", "0.6941914", "0.693531", "0.6923148", "0.68838733", "0.686404", "0.6848033", "0.6838035", "0.67917955", "0.6784234"...
0.79993564
0
Computes the local directory for storage related to an asset, ensures its available, and returns it.
def local_asset_dir(asset_id, prefix=None): temp_dir = DataDir if prefix: temp_dir = os.path.join(temp_dir, prefix) temp_dir = os.path.join(temp_dir, asset_id) if not os.path.exists(temp_dir): os.makedirs(temp_dir) return temp_dir
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def external_storage():\r\n\r\n folder_path = os.path.join('/media/pi/', args.storage_name, args.directory_name)\r\n if not os.path.exists(folder_path):\r\n os.makedirs(folder_path)\r\n return folder_path", "def _get_asset_dir(self, database):\n if not database:\n ...
[ "0.71835005", "0.6396792", "0.630588", "0.6232326", "0.61992854", "0.61261535", "0.612395", "0.6100093", "0.5987854", "0.5923705", "0.59014106", "0.5895088", "0.5891064", "0.58777946", "0.58717114", "0.58542037", "0.5843003", "0.58398235", "0.5838184", "0.5790076", "0.5778982...
0.71002173
1
Get a listing of recent OurBricks uploads. Returns a list Assets.
def get_listing(): result_items = [] rss_data = urllib.request.urlopen(ActivityURL) rss_xml = xml.dom.minidom.parse(rss_data) channel = rss_xml.getElementsByTagName('channel')[0] items = channel.getElementsByTagName('item') for item in items: # Most of these are hackish, but a result ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def api_asset_list():\n return jsonify(app.bank.to_list()), 200", "def uploads(self):\r\n return u.Uploads(self)", "def asset_list(self, **kwargs):\n headers, items = self._get('/asset', kwargs)\n return AssetList(\n headers,\n [Asset.fromdict(item_dict, api=self) ...
[ "0.5980407", "0.58247304", "0.56689084", "0.5627454", "0.55107296", "0.54979944", "0.548718", "0.54773057", "0.5415903", "0.54061586", "0.5376268", "0.535252", "0.5309802", "0.53093827", "0.529902", "0.5276898", "0.52715397", "0.5259379", "0.5251198", "0.52509797", "0.5240429...
0.5211729
25
Given a list of paths, return the list of specfiles
def resolve_specs(paths): specs = [] for path in paths: if os.path.isdir(path): _, _, files = os.walk(path).next() specs.extend(os.path.join(path, fname) for fname in files) else: specs.append(path) return specs
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def files(pathspec):\n\treturn [f for f in glob.glob(pathspec)]", "def make_fileslist(path_list):\n ret = []\n for p in path_list:\n ret += glob.glob(p)\n\n return ret", "def getFilesMulti(paths, pat):\n filelist = []\n for d in paths:\n filelist += glob.glob( os.path.join(d,pat) )...
[ "0.8112759", "0.6977472", "0.6961051", "0.6870625", "0.6812184", "0.6730582", "0.6576526", "0.6545805", "0.65051377", "0.64924943", "0.64832324", "0.64718336", "0.6446977", "0.64359635", "0.6410471", "0.63981533", "0.6348877", "0.6347928", "0.63075155", "0.62783676", "0.62680...
0.8089475
1
Accept a subject, return a human readable timedelta string.
def human( subject, precision=2, past_tense="{} ago", future_tense="in {}", abbreviate=False ): delta = get_delta_from_subject(subject) the_tense = future_tense if delta < timedelta(0) else past_tense d = delta2dict(delta) hlist = [] count = 0 # start building up the output in ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def readable_timedelta(timedeltaobj):\n # stolen from https://stackoverflow.com/a/46928226/8207\n if not timedeltaobj:\n return '---'\n secs = timedeltaobj.total_seconds()\n timetot = \"\"\n if secs > 86400: # 60sec * 60min * 24hrs\n days = secs // 86400\n timetot += \"{} days\...
[ "0.64443964", "0.6374012", "0.6165733", "0.6158649", "0.6037516", "0.60154045", "0.6009873", "0.60057116", "0.5989954", "0.5978122", "0.59190166", "0.59155077", "0.59066373", "0.590168", "0.5892718", "0.58752394", "0.5801449", "0.57869595", "0.57833946", "0.574131", "0.573570...
0.5443702
44
Computes N Gaussian expectation integrals of a single function 'f' using GaussHermite quadrature.
def mvnquad(f, means, covs, H, Din, Dout=()): xn, wn = mvhermgauss(H, Din) N = means.size(0) # transform points based on Gaussian parameters Xt = [] for c in covs: chol_cov = torch.potrf(c, upper=False) # DxD each Xt.append(torch.matmul(chol_cov, xn.t())) Xt = torch.stack(Xt, di...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def gauss_kernel(n_fwhm,sigma):\n\n x_length = int(n_fwhm * sigma + 0.5) #Add 0.5 to approximate to nearest integer\n y_length = x_length\n \n \n x, y = mgrid[-x_length:x_length+1, -y_length:y_length+1]\n g = numpy.exp(-(x**2/(2*(float(sigma)**2))+y**2/(2*(float(sigma)**2))))\n return g...
[ "0.65779984", "0.6497507", "0.64379233", "0.6369506", "0.6346149", "0.6302363", "0.625371", "0.62316614", "0.61227363", "0.60893935", "0.60817003", "0.60434026", "0.5994408", "0.5991604", "0.59514105", "0.59442973", "0.5939629", "0.5932309", "0.59250396", "0.59234935", "0.587...
0.57441247
29
Create a VoxCeleb dataset object.
def __init__(self, secs, path, concat=True): audio = np.empty((1,)) secs_loaded = 0 files_loaded = 0 files = glob.glob(path + "*.wav") for file in files: (sr, samples) = wavfile.read(file) audio = np.concatenate((audio, samples)) # Keep track ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def datasetcreate(self, dataset_path='datasets', class_name='Demo',\n haarcascade_path='haarcascade/haarcascade_frontalface_default.xml',\n eyecascade_path='haarcascade/haarcascade_eye.xml', eye_detect=False,\n save_face_only=True, no_of_samples=100,\n...
[ "0.6774347", "0.670843", "0.66561717", "0.6652315", "0.65102345", "0.649268", "0.6466075", "0.64383215", "0.6288594", "0.62880075", "0.62531006", "0.608475", "0.60765034", "0.6066606", "0.6046967", "0.6037941", "0.6025286", "0.6017445", "0.60060847", "0.5986373", "0.59316504"...
0.0
-1
Dictionary containing a key for each character. Each key has data pairs of value label and value
def __init__(self): self.trackerInfo = {} self.characterNames = {} self.csvToArrays() """ Declare the character tracker file """ self.file = '//corp-nas01/DC/dc_art/character/GEPPETTO/CharacterTracker.csv' """ The UI """ self.UIElements = {} ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def build_char_dict(dataset, default_dict=default_dict):\n # SMILES strings\n X = dataset.ids\n # Maximum length is expanded to allow length variation during train and inference\n seq_length = int(max([len(smile) for smile in X]) * 1.2)\n # '_' served as delimiter and padding\n all_smiles = '_'.j...
[ "0.64853394", "0.64579487", "0.64521456", "0.6317564", "0.6249756", "0.6074769", "0.6028697", "0.60154104", "0.59474725", "0.5905822", "0.58770245", "0.58365166", "0.58345264", "0.5830811", "0.5764051", "0.57578003", "0.56819075", "0.5680127", "0.5659926", "0.56399274", "0.56...
0.0
-1
Transform an array with one flattened image per row, into an array in which images are reshaped and layed out like tiles on a floor. This function is useful for visualizing datasets whose rows are images, and also columns of matrices for transforming those rows (such as the first layer of a neural net).
def tile_raster_images(X, img_shape, tile_shape, tile_spacing=(0, 0), scale_rows_to_unit_interval=True, output_pixel_vals=True): assert len(img_shape) == 2 assert len(tile_shape) == 2 assert len(tile_spacing) == 2 out_shape = [ (ishp + tsp) * tshp ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def flattenImage(input_array):\r\n shp = np.size(input_array)\r\n return np.reshape(input_array, (shp,))", "def flatten_image(x):\n *batch_shape, h, w, c = x.shape\n return x.reshape((*batch_shape, h * w * c))", "def reshape_pixel_array(self, pixel_arr):\n reshaped_pixel_arr = []\n n ...
[ "0.7618992", "0.6953048", "0.68670815", "0.6773556", "0.65848166", "0.6563308", "0.6445122", "0.6443149", "0.6443149", "0.6443149", "0.6351254", "0.63140506", "0.62767047", "0.62736577", "0.6262508", "0.6244135", "0.62017506", "0.61746866", "0.614546", "0.6126553", "0.6102778...
0.6018346
28
Returns a sample from a Ddimensional Multivariate Normal distribution
def _sample_mvn(mean, cov, cov_structure=None, num_samples=None): mean_shape = tf.shape(mean) S = num_samples if num_samples is not None else 1 D = mean_shape[-1] leading_dims = mean_shape[:-2] num_leading_dims = tf.size(leading_dims) if cov_structure == "diag": # mean: [..., N, D] and ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def normal_sample(mu, sigma):\n return mu + sigma * torch.randn_like(sigma)", "def _sampling_normal(self, args):\n z_mean, z_log_var = args\n return sampling_normal(z_mean, z_log_var, (None, self.latent_dim))", "def _sampling_normal(self, args):\n z_mean, z_log_var = args\n retur...
[ "0.7634885", "0.71986175", "0.71986175", "0.71986175", "0.71986175", "0.71986175", "0.70836955", "0.70170504", "0.7003913", "0.6937014", "0.6886267", "0.6862063", "0.68425864", "0.6836861", "0.6807504", "0.67899615", "0.6723959", "0.67226267", "0.66897905", "0.6689329", "0.66...
0.0
-1
Overrides base ArtellaPlayblastPlugin get_outputs function Returns the outputs variables of the Playblast widget as dict
def get_outputs(self): return { 'enable_stamp': self.enable_cbx.isChecked() }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_outputs():\n outputs = {}\n for obj in vars(acsploit.output).values():\n if hasattr(obj, 'OUTPUT_NAME'):\n outputs[obj.OUTPUT_NAME] = obj\n\n return outputs", "def get_outputs(self):\n return self.attributes[\"outputs\"]", "def outputs(self):\r\n return self._output...
[ "0.65981376", "0.655904", "0.6482134", "0.6426274", "0.6378967", "0.63005984", "0.6253874", "0.6253874", "0.6253874", "0.6253874", "0.62206715", "0.6205484", "0.6198396", "0.6134373", "0.6080934", "0.6055089", "0.6055089", "0.60320437", "0.60320437", "0.60320437", "0.60320437...
0.6545847
2
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 applications = None if dictionary.get('applications') != None: applications = list() for structure in dictionary.g...
{ "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.7876749", "0.78585315", "0.7836853", "0.7801407", "0.7801407", "0.7801407", "0.7801407", "0.7801407",...
0.0
-1
Create new AbstractDatastoreInputReader object. This is internal constructor. Use split_input to create readers instead.
def __init__(self, iterator): self._iter = iterator
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__ (self, input) :\r\n ReaderA.__init__(self) # call parent\r\n # print '************************* input = ', input, type(input)\r\n self.buffer_ = input # this is any thing that can be indexed\r\n self.current_ = 0", "def _initialize(self) -> None:\n p = self.params\n ...
[ "0.58008105", "0.5692907", "0.56203896", "0.5538423", "0.5530943", "0.54656005", "0.5450914", "0.5416231", "0.54112566", "0.5367306", "0.5344737", "0.5339986", "0.53284067", "0.5324274", "0.53142214", "0.5297243", "0.5264723", "0.523521", "0.52218467", "0.52218366", "0.519764...
0.0
-1
Returns the string representation of this InputReader.
def __str__(self): return repr(self._iter)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def toString(self):\n return _libsbml.XMLInputStream_toString(self)", "def __str__(self):\n buf = StringIO()\n self.write_to(buf)\n return buf.getvalue()", "def read_string(self):\n self._skip_white_space()\n return self._get_string()", "def as_string(self):\n ...
[ "0.7022369", "0.6636433", "0.6464862", "0.6438279", "0.6430865", "0.64264697", "0.6411172", "0.639822", "0.6369316", "0.6364402", "0.6348391", "0.6299102", "0.6299102", "0.6299102", "0.6286603", "0.6281446", "0.6269357", "0.62651885", "0.6255047", "0.6242224", "0.6223711", ...
0.0
-1
Given a dataframe with stars in a cluster (from Kharchenko+13), match Kharchenko stars to GaiaDR2 through the 2MASSbestneighbor table. Return a dataframe that includes the Gaia DR2 id, the angular distance, and the astrometric parameters.
def kharchenko13_to_gaiadr2_xmatch(df, cluster_name): # we dropped the u for a reason! tmbn = Gaia.load_table('gaiadr2.tmass_best_neighbour') tmassid = nparr(df['2MASS']).astype(int) jobstr = ( 'select source_id,original_ext_source_id,angular_distance,' 'gaia_astrometric_params,tmass_...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def xmatch_kharchenko13_gaiadr2_2mass(homedir='/home/luke/'):\n\n Gaia.login(credentials_file=os.path.join(homedir, '.gaia_credentials'))\n\n tables = Gaia.load_tables(only_names=True, include_shared_tables=True)\n\n for t in tables:\n print(t.get_qualified_name())\n\n jobstr = (\n\t'select tmas...
[ "0.594956", "0.5807495", "0.56909776", "0.56302446", "0.555307", "0.5535231", "0.5467418", "0.5451573", "0.538091", "0.53768194", "0.5362953", "0.53252125", "0.5316109", "0.5293507", "0.52599794", "0.5254281", "0.52511024", "0.52247554", "0.5219552", "0.52191496", "0.52061415...
0.66539735
0
Get list of unique items in a list or Numpy data array.
def UniqueItems(Items, IgnoreZero=False): import numpy as np from copy import deepcopy OrigItems = deepcopy(Items) # If Items is a list convert to a Numpy array: if isinstance(Items, list): #Items = np.ndarray.flatten(Items) Items = np.array(Items) if IgnoreZe...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_uniques(array):\n uniques = []\n for element in array:\n if element not in uniques:\n uniques.append(element)\n return uniques", "def unique(x):\n try:\n tmp = x.flatten()\n if tmp.size == 0:\n return tmp\n tmp.sort()\n idx = concatenat...
[ "0.7149935", "0.70662475", "0.69179404", "0.6894492", "0.68284696", "0.68050706", "0.6742455", "0.6689022", "0.6631445", "0.6604177", "0.6559178", "0.6534876", "0.65279126", "0.6435502", "0.64322007", "0.6393547", "0.6380254", "0.6377858", "0.63735795", "0.63715255", "0.63595...
0.61874586
29
Compare cropped masks of nonzero elements only.
def Compare2dMasksFrom3dMasks(OrigSegRoi, NewSegRoi, OrigDicomDir, NewDicomDir): from DicomTools import GetDicomSOPuids from SegTools import GetPFFGStoSliceInds import matplotlib.pyplot as plt # Get the DICOM SOP UIDs: OrigSOPuids = GetDicomSOPuids(DicomDir=OrigDicomDir) NewSOPuids = ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_zero_clumper():\n mask0 = np.array([0, 1, 1, 0, 0, 0, 1, 1, 0, 0, 1, 0, 0, 0, 1, 1, 0], dtype=bool)\n expected_clump0 = [\n np.array([0], dtype=bool),\n np.array([0, 0, 0], dtype=bool),\n np.array([0, 0], dtype=bool),\n np.array([0, 0, 0], dtype=bool),\n np.array([...
[ "0.6652108", "0.6284462", "0.59743977", "0.593899", "0.5935438", "0.59076864", "0.5905515", "0.58742577", "0.5835944", "0.5817225", "0.5795169", "0.5784908", "0.5773261", "0.57604885", "0.575556", "0.575195", "0.5734035", "0.5733258", "0.570783", "0.5696384", "0.56934136", ...
0.0
-1
Plot a pseudocolor plot of temperature in the xzplane.
def xz_slice(data, index): X = np.array(data['x']) Y = np.array(data['y']) Z = np.array(data['z']) Tslice = np.array(data['T'][:, index, :]) print(Tslice.shape) Xgrid, Zgrid = np.meshgrid(X, Z) ylevel = Y[index] fig, ax = plt.subplots() # Tslice = np.ma.masked_less_equal(Tslice, 11...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def xz_plot(Feaff, Fe, Fi, muVn, t, x, z):\n\n fig, axs = plt.subplots(2, 2, figsize=(8, 8))\n\n axs[0, 0].plot(Feaff[:t, x, z])\n axs[0, 0].set_title(\n '$\\\\nu_e^{aff}$ for pixel (' + str(x) + ', ' + str(z) + ')')\n axs[0, 0].set(xlabel='t (ms)', ylabel='$\\\\nu_e^{aff}(x, t)$')\n\n axs[0,...
[ "0.7112326", "0.670165", "0.6202184", "0.6194669", "0.6029962", "0.5983284", "0.59264654", "0.59245217", "0.5916423", "0.58858913", "0.5842475", "0.5840868", "0.58266044", "0.5790531", "0.57727724", "0.5750561", "0.57366", "0.5710336", "0.56918764", "0.5688822", "0.56708187",...
0.548833
40
Plot a pseudocolor plot of temperature in the xzplane.
def yz_slice(data, index): X = np.array(data['x']) Y = np.array(data['y']) Z = np.array(data['z']) print(Z) Tslice = np.array(data['T'][:, :, index]) print(Tslice.shape) Ygrid, Zgrid = np.meshgrid(Y, Z) xlevel = X[index] fig, ax = plt.subplots() # Tslice = np.ma.masked_less_equ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def xz_plot(Feaff, Fe, Fi, muVn, t, x, z):\n\n fig, axs = plt.subplots(2, 2, figsize=(8, 8))\n\n axs[0, 0].plot(Feaff[:t, x, z])\n axs[0, 0].set_title(\n '$\\\\nu_e^{aff}$ for pixel (' + str(x) + ', ' + str(z) + ')')\n axs[0, 0].set(xlabel='t (ms)', ylabel='$\\\\nu_e^{aff}(x, t)$')\n\n axs[0,...
[ "0.7114512", "0.67031085", "0.62051535", "0.61981946", "0.6031574", "0.59841317", "0.5927559", "0.59257364", "0.5916594", "0.5886491", "0.58454794", "0.58397305", "0.5828819", "0.5791422", "0.57745767", "0.57526195", "0.5738133", "0.5710319", "0.5695024", "0.5690892", "0.5671...
0.0
-1
The name of the SKU. Required.
def name(self) -> str: return pulumi.get(self, "name")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def sku_name(self) -> str:\n return pulumi.get(self, \"sku_name\")", "def sku_name(self) -> str:\n return pulumi.get(self, \"sku_name\")", "def sku_name(self) -> str:\n return pulumi.get(self, \"sku_name\")", "def sku_name(self) -> Optional[pulumi.Input[str]]:\n return pulumi.get(...
[ "0.87972", "0.87972", "0.87972", "0.8637621", "0.8637621", "0.8419391", "0.80847543", "0.7977789", "0.7977789", "0.7765083", "0.7705504", "0.7700272", "0.7700272", "0.76348513", "0.7368839", "0.7368839", "0.7366266", "0.7366266", "0.73024434", "0.7261766", "0.7242116", "0.7...
0.0
-1
Computes a 3x3 rotation matrix transforming a vector from the device coordinate system to the world's coordinate system. gravity should be the last know gravity vector. Geomagnetic is the last know reading from the geomagnetic sensor.
def getRotationMatrix(gravity, geomagnetic): Ax = gravity[0] Ay = gravity[1] Az = gravity[2] normsqA = (Ax * Ax + Ay * Ay + Az * Az) g = 9.81 freeFallGravitySquared = 0.01 * g * g if normsqA < freeFallGravitySquared: # gravity less than 10% of normal value return None Ex...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def matrix_rotate_3d_x(deg: float) -> np.matrix:\n from numpy import cos, sin, pi\n rad_x = -deg * pi/180\n c_x = cos(rad_x)\n s_x = sin(rad_x)\n return np.matrix([[1, 0, 0], [0, c_x, -s_x], [0, s_x, c_x]])", "def project_gravity_core(xyz):\n ver = []\n hor = []\n \n # mean for each ax...
[ "0.61751884", "0.6034566", "0.5974449", "0.5929142", "0.5916833", "0.59088975", "0.5877288", "0.58701557", "0.58494383", "0.58015776", "0.57583", "0.5712762", "0.57018536", "0.5683561", "0.5664185", "0.566157", "0.56573015", "0.5653803", "0.56420135", "0.56332153", "0.5631091...
0.74401164
0
Checks if a given user is the owner of a given board.
def has_permission(self, request, view): board_id = view.kwargs.get("pk") owner_id = Board.objects.get(pk=board_id).owner.pk return request.user.id == owner_id
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_owned_by(self, user):\n return user and user.id == self.user_id", "def ownercheck(self, userhost):\n if self.cfg and self.cfg.owner:\n if userhost in self.cfg.owner: return True\n return False", "def isOwner(id, userId):\n db = core.connect()\n return db[id][\"creat...
[ "0.72862697", "0.7110905", "0.6926852", "0.6810896", "0.67608917", "0.6734312", "0.67143947", "0.65826494", "0.6524378", "0.65128547", "0.648466", "0.64724976", "0.6383216", "0.637666", "0.6367681", "0.6352132", "0.63027203", "0.62886196", "0.6286064", "0.6281508", "0.6280097...
0.6720676
6
This returns all products
def all_products(request): products = Product.objects.all() departments = None if request.GET: if 'department' in request.GET: departments = request.GET['department'].split(',') products = products.filter(department__name__in=departments) departments = Department...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_all_products(self):\n\t\tpass", "def get_all_products():\n data = order_obj.get_all_products()\n return data", "def get_all_products():\n products = app.session.query(models.Product).all()\n return products", "def get(self):\n return Products().get_all_products()", "def fetch_all...
[ "0.90997875", "0.84769845", "0.8376284", "0.81730545", "0.8091348", "0.8091192", "0.8072255", "0.80077195", "0.8000136", "0.7973509", "0.79203224", "0.7846035", "0.7840058", "0.78283393", "0.7811497", "0.7726471", "0.7682446", "0.7661792", "0.7642735", "0.75864255", "0.752125...
0.64485717
93
Return the top of the queue.
def Peek(self): if not self.first: raise ValueError("Empty Queue") return self.first.data
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def top(self):\n return self.queue[0]", "def top(self):\n with self.mutating:\n top = self.queue[0]\n return top", "def top(self):\n try: return self._queue[0]\n except IndexError: return 0", "def top(self):\n if len(self) == 0:\n raise IndexErr...
[ "0.9077885", "0.9053316", "0.89305943", "0.87931895", "0.87774056", "0.87770915", "0.86771435", "0.8613051", "0.8581989", "0.8248136", "0.80739987", "0.80739987", "0.80246675", "0.8007626", "0.80042434", "0.8001139", "0.7941007", "0.7913317", "0.7913317", "0.7913317", "0.7896...
0.0
-1
Is the queue empty?
def IsEmpty(self): return self.first == None
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_empty(self):\n return self.queue == []", "def is_empty(self):\n return len(self.the_queue) == 0", "def is_empty(self):\n return len(self.queue) == 0", "def is_empty(self):\n return len(self.queue) == 0", "def is_empty(self):\n return len(self.__queue) > 0", "def ...
[ "0.92403233", "0.9186681", "0.91693956", "0.91693956", "0.914682", "0.9137048", "0.9083102", "0.90663934", "0.9037946", "0.8976355", "0.89380217", "0.8915447", "0.89138514", "0.8908865", "0.8884015", "0.88772047", "0.88772047", "0.88771504", "0.881595", "0.87687516", "0.87408...
0.0
-1
Forward pass of the ReLU nonlinearity.
def forward(self, inputs): return np.maximum(0, inputs)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def relu_forward(x):\n ############################################################################\n # TODO: Implement the ReLU forward pass. #\n ############################################################################\n ######################################################...
[ "0.75088865", "0.74931055", "0.73315495", "0.73064566", "0.72246695", "0.72215784", "0.72000605", "0.7191496", "0.71528363", "0.7139857", "0.7108757", "0.7100426", "0.7056954", "0.70551366", "0.7052518", "0.70329195", "0.7027254", "0.70038426", "0.69838065", "0.69807076", "0....
0.0
-1
Backward pass of the ReLU nonlinearity. Computes gradient of loss w.r.t. ReLU input.
def backward(self, inputs, gradients, **kwargs): grad_relu = inputs > 0 return gradients * grad_relu
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def grad_ReLU(self):\n y = self.x\n y[y<=0] = 0\n y[y>0] = 1\n return y\n raise NotImplementedError(\"ReLU gradient not implemented\")", "def backward(self, inGradient, lr=0.001): # batchSize = 1\n wGradient = np.dot(inGradient.T, self.data)\n bGradient = np.sum(i...
[ "0.8151566", "0.7450456", "0.7314815", "0.72964627", "0.7210074", "0.7154491", "0.7087609", "0.7079973", "0.7066407", "0.7046119", "0.6971868", "0.6951169", "0.6938469", "0.693709", "0.690617", "0.6889645", "0.6889645", "0.6885053", "0.6877105", "0.68730944", "0.6868184", "...
0.72734565
4
Implementation of the gelu activation function.
def gelu(x): return x * 0.5 * (1.0 + torch.erf(x / math.sqrt(2.0)))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def gelu_activation(inp):\n out = 1 + tf.tanh(np.sqrt(np.pi) * (inp + 0.044715 * tf.pow(inp, 3)))\n out *= 0.5 * inp\n return out", "def gelu_activation(inp):\n out = 1 + tf.tanh(np.sqrt(np.pi) * (inp + 0.044715 * tf.pow(inp, 3)))\n out *= 0.5 * inp\n return out", "def gelu(x):\n return f_...
[ "0.818784", "0.818784", "0.7809106", "0.7556598", "0.75260615", "0.7478427", "0.73711115", "0.7235027", "0.7213133", "0.72078973", "0.7197947", "0.7193065", "0.71735656", "0.7157619", "0.69697195", "0.69697195", "0.69697195", "0.69697195", "0.69697195", "0.69697195", "0.69697...
0.6956555
23
Determines if a string is a number or not. Returns bool True if input can be converted to float; False otherwise
def _is_number(s) -> bool: try: float(s) except ValueError: return False else: return True
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_number(s):\n try:\n float(s)\n return True\n except ValueError:\n return False", "def is_number(string):\n try:\n float(string)\n return True\n except ValueError:\n return False", "def is_number(s):\r\n try:\r\n float(s)\r\n return True\r\n excep...
[ "0.89176995", "0.8893571", "0.8879034", "0.88788444", "0.88788444", "0.88788444", "0.88773", "0.8793984", "0.8702579", "0.866115", "0.8606478", "0.8585365", "0.85413754", "0.8529672", "0.85116524", "0.850417", "0.8501269", "0.84889305", "0.84889305", "0.8487658", "0.8487463",...
0.89844275
0
Constructs a ResNet50 model.
def resnet50(pretrained=False, **kwargs): model = ResNet(Bottleneck, [3, 4, 6, 3], **kwargs) if pretrained: model.load_state_dict(model_zoo.load_url(model_urls['resnet50'])) return model
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def resnet50(pretrained=False, **kwargs):\n model = ResNet(Bottleneck, [3, 4, 6, 3], **kwargs)\n if pretrained:\n model.load_state_dict(model_zoo.load_url(model_urls['resnet50']))\n fc = transfer_fc(model.fc)\n model.fc = fc\n return model", "def resnet50(**kwargs):\n model = ResNet(...
[ "0.7557751", "0.75548905", "0.74557495", "0.7386862", "0.7386862", "0.73601955", "0.7355623", "0.724254", "0.724254", "0.7191571", "0.7158499", "0.7101107", "0.70165247", "0.69687796", "0.68687624", "0.6822836", "0.6801022", "0.67330164", "0.6718147", "0.67159295", "0.657444"...
0.74759895
2
Wavenumber is defined as 1/wavelength
def wavelength_to_wavenumber(wavelength): return 1. / wavelength
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def wavelength(self):\n return self.getparam(\"WAVELENGTH\")", "def wavelength(self):\n return self.getparam(\"WAVELENGTH\")", "def perfectrefl(wavelength):\n return 1.0", "def wavelength_ex(hdulist):\n wave = hdulist[1].data['loglam']\n wave = 10**wave\n\n return wave", "def TF_wa...
[ "0.7440523", "0.7440523", "0.7317888", "0.7107251", "0.7100542", "0.7077713", "0.7060538", "0.7001003", "0.68845105", "0.68498194", "0.6798893", "0.6774087", "0.6756225", "0.67533845", "0.6693683", "0.6684541", "0.66774225", "0.66770494", "0.66687405", "0.6639127", "0.660245"...
0.77097374
0
Conver photon energy in ev to wave length in m.
def photon_energy_to_wavelength(photon_energy): return 1.23984197386209e-06 / photon_energy
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def wavelength_to_photon_energy(wavelength):\n return 1.23984197386209e-06 / wavelength", "def get_wavelength(self):\n E = -self.E0*(1.0/self.n_low**2 - 1.0/self.n_high**2)\n return SI['hc']*1e12/(E*SI['keV'])", "def wavelength(energy):\r\n return 2 * np.pi * PLANCK_CONSTANT * SPEED_OF_LIGH...
[ "0.7076961", "0.66193104", "0.6473645", "0.63710886", "0.6284961", "0.62174004", "0.6185038", "0.61821127", "0.61579573", "0.60581064", "0.59628254", "0.5943781", "0.5925434", "0.5828782", "0.5805353", "0.5756662", "0.57422787", "0.5722213", "0.5668019", "0.56357807", "0.5628...
0.7417378
0
Convert wave length to photon energy in ev
def wavelength_to_photon_energy(wavelength): return 1.23984197386209e-06 / wavelength
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def photon_energy_to_wavelength(photon_energy):\n return 1.23984197386209e-06 / photon_energy", "def energy_to_lambda(energy_ev=[]):\n energy_mev = energy_ev * 1000\n lambda_array = np.sqrt(81.787 / energy_mev)\n return lambda_array", "def wavenumber(energy):\r\n return 2 * np.pi / wavelength(en...
[ "0.6863446", "0.63673365", "0.627904", "0.62780476", "0.624361", "0.6139651", "0.6120574", "0.61082643", "0.6099294", "0.6016417", "0.5992611", "0.5973966", "0.5934226", "0.5922582", "0.5916743", "0.59160024", "0.58894134", "0.58340126", "0.5825785", "0.58084667", "0.57747024...
0.74880636
0
Returns instance of a redis cache store accessor.
def get_store(partition_type: StorePartition) -> redis.Redis: # Set cache db index. db = EnvVars.DB db += PARTITION_OFFSETS[partition_type] # TODO: 1. cluster connections return redis.Redis( db=db, host=EnvVars.HOST, port=EnvVars.PORT )
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_redis():\n return redis.StrictRedis(host='redis', port=6379)", "def get_instance():\n if not Cache.__instance__:\n Cache.__instance__ = Cache(config('REDIS_HOST'), config('REDIS_PORT'))\n return Cache.__instance__", "def redis_client(self) -> Redis:\n return self.app....
[ "0.7254076", "0.725008", "0.70847887", "0.7078478", "0.6891339", "0.68854725", "0.658977", "0.65752107", "0.6571666", "0.6498747", "0.6490176", "0.64715683", "0.6451554", "0.63491595", "0.63340604", "0.63051975", "0.6276862", "0.6225722", "0.62164766", "0.6173365", "0.6121021...
0.70018244
4
The lefthand side of the relation.
def lhs(self): return self._args[0]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def direction(self):\n return None if not bool(self.relation) else (self.s_end <= self.o_start)", "def side(self):\n return self._side.copy()", "def left(self):\n return self.l", "def L(self):\n return self._L", "def Relation(self, paren=False):\n left = self.Addition(par...
[ "0.66135466", "0.63332397", "0.62693274", "0.61121666", "0.6093614", "0.6048712", "0.6040608", "0.6040608", "0.6040608", "0.6040608", "0.59780467", "0.5971864", "0.5955044", "0.5941097", "0.59376335", "0.5927739", "0.588854", "0.587183", "0.587183", "0.58661485", "0.5852148",...
0.5470195
72
The righthand side of the relation.
def rhs(self): return self._args[1]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def right(self):\n return self.__r", "def right(self):\n return self.r", "def side(self):\n return self._side.copy()", "def right(self):\n\t\treturn self._right", "def right(self):\n return self._right", "def right(self):\n return self._right", "def get_right(self):\n...
[ "0.71132076", "0.71100014", "0.6986393", "0.69351625", "0.68017393", "0.68017393", "0.67173886", "0.66620433", "0.66533667", "0.64888775", "0.6416841", "0.6387919", "0.6324245", "0.6295601", "0.62841296", "0.62127703", "0.6209476", "0.6190473", "0.6172026", "0.61589044", "0.6...
0.5749345
48
Fuzzy bool for lhs does not equal rhs.
def is_neq(lhs, rhs, assumptions=None): return fuzzy_not(is_eq(lhs, rhs, assumptions))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def nexact(cls, lhs, rhs):\n return lhs != rhs", "def __ne__(self, rhs):\n return not self.__eq__(rhs)", "def exact(cls, lhs, rhs):\n return lhs == rhs", "def __ne__(left, right):\n return (not (left == right))", "def fuzzy_equals(self, lhs, rhs):\n t = type(rhs)\n ...
[ "0.79216397", "0.7437053", "0.7179628", "0.7123939", "0.70983565", "0.7078301", "0.7040319", "0.691493", "0.69121134", "0.68910027", "0.6890099", "0.687792", "0.687792", "0.687792", "0.687792", "0.6870575", "0.6869367", "0.6869367", "0.6869367", "0.6869367", "0.6869367", "0...
0.73452306
2
Gets optimizer params. The default implementation is very simple. Most losses have no learned parameters, so this is rarely needed.
def get_optimizer_params(self, bn_weight_decay=False): params = [ param for param in self.parameters(recurse=True) if param.requires_grad ] return {"regularized_params": params, "unregularized_params": []}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_optimization_parameters(self):\n pass", "def optimizer_config(self):\r\n return {\r\n \"lr\": self.args.lr[0],\r\n \"momentum\": self.args.momentum,\r\n \"weight_decay\": self.args.weight_decay,\r\n }", "def _get_params_for_run(self):\n if se...
[ "0.75181425", "0.73078406", "0.72710013", "0.7165823", "0.70407075", "0.6983328", "0.6774463", "0.6726684", "0.6692109", "0.6636174", "0.663235", "0.6617701", "0.65656614", "0.6554439", "0.65530443", "0.65456825", "0.648471", "0.6468299", "0.6441613", "0.6412431", "0.63635355...
0.746894
1
Specifies the identifier of the subnet.
def subnet(self) -> Optional['outputs.ApiEntityReferenceResponse']: return pulumi.get(self, "subnet")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def subnet_id(self, subnet_id):\n self._subnet_id = subnet_id", "def subnet_id(self) -> str:\n return pulumi.get(self, \"subnet_id\")", "def subnet_id(self) -> Optional[str]:\n return pulumi.get(self, \"subnet_id\")", "def subnet_id(self):\n return self._subnet_id", "def subnet_...
[ "0.79499483", "0.77143365", "0.740738", "0.7380473", "0.7332208", "0.7332208", "0.70874", "0.7014447", "0.6801387", "0.6714341", "0.6714341", "0.65333295", "0.6402325", "0.63087726", "0.61377496", "0.61331713", "0.60982", "0.60764515", "0.6065785", "0.60278165", "0.5993408", ...
0.59413934
23