query
stringlengths
9
9.05k
document
stringlengths
10
222k
metadata
dict
negatives
listlengths
30
30
negative_scores
listlengths
30
30
document_score
stringlengths
4
10
document_rank
stringclasses
2 values
set the sales rep for this Account
def set_sales_rep(self, sales_rep): self._sales_rep = sales_rep
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def sales(self, sales):\n\n self._sales = sales", "def get_sales_rep(self):\r\n return self._sales_rep", "def sales_rep_code(self, sales_rep_code):\n if sales_rep_code is not None and len(sales_rep_code) > 10:\n raise ValueError(\"Invalid value for `sales_rep_code`, length must ...
[ "0.71684736", "0.60573095", "0.5699982", "0.55540127", "0.5448541", "0.5195966", "0.5159155", "0.51239115", "0.5077749", "0.5022728", "0.49740148", "0.49725026", "0.49634492", "0.4955389", "0.4955389", "0.49489853", "0.49296564", "0.49223012", "0.49128014", "0.49119002", "0.4...
0.81403697
0
replaces the list of market segments for this Account
def set_market_segments(self, segments): """ Q1-2. Implement this method, which takes an iterable of MarketSegments to which this Account will be attached. This method REPLACES all MarketSegment associations, so be sure to update each MarketSegment's intern...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def remove_from_market_segment(self, market_segment):\r\n if market_segment in self._market_segments:\r\n self._market_segments.remove(market_segment)\r\n market_segment.remove_account(self)\r\n else:\r\n # nothing to do, the market segment was already\r\n ...
[ "0.5418846", "0.5301822", "0.4919815", "0.48922998", "0.48700333", "0.4845712", "0.48402044", "0.479326", "0.47908777", "0.4755174", "0.47279075", "0.47138822", "0.46888635", "0.46419635", "0.46125323", "0.45995706", "0.45915312", "0.4556438", "0.45542613", "0.45532054", "0.4...
0.7383106
0
add a market segment to this account
def add_to_market_segment(self, market_segment, add_account_to_ms=True): if market_segment in self._market_segments: raise ValueError("{name} already part of {ms_name}" .format(name=self.name, ms_name=market_segment.name)) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_market_segments(self, segments):\r\n \"\"\"\r\n Q1-2. Implement this method, which takes an iterable of MarketSegments\r\n to which this Account will be attached. This method REPLACES all\r\n MarketSegment associations, so be sure to update each\r\n Mark...
[ "0.65802324", "0.6395969", "0.61662567", "0.6164237", "0.5980403", "0.5974769", "0.5835148", "0.5825939", "0.5788526", "0.5769048", "0.5765961", "0.5738792", "0.572644", "0.57032543", "0.5656395", "0.5605565", "0.54737425", "0.5466607", "0.543837", "0.5411004", "0.5402753", ...
0.73550326
0
remove the market segment from this account
def remove_from_market_segment(self, market_segment): if market_segment in self._market_segments: self._market_segments.remove(market_segment) market_segment.remove_account(self) else: # nothing to do, the market segment was already # not in the acco...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def remove_account(self, account, remove_ms_from_account=True):\r\n # check for accounts by name per Q2 bonus below\r\n if account.name in [account.name for account in self._accounts]:\r\n self._accounts.remove(account)\r\n if remove_ms_from_account:\r\n account.r...
[ "0.6916367", "0.6139307", "0.6004958", "0.5911972", "0.58914524", "0.5845003", "0.58389115", "0.57946837", "0.5777495", "0.57668144", "0.57654405", "0.5762761", "0.5756127", "0.57521224", "0.57489353", "0.5699705", "0.56938523", "0.56938523", "0.5637024", "0.5632075", "0.5620...
0.8205841
0
helper function that returns market segments in a list
def get_market_segments(self): return self._market_segments
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def segments(self):\n return (self._subset((i,i+1)) for i in range(len(self)-1))", "def getSegments(self) -> List[int]:\n ...", "def segment(raw_sents:List[str], segment=\"jieba\") -> List[List[str]]:\n\t# segment_list = [\"pkuseg\", \"jieba\"]\n\t# if segment.strip() not in segment_list:\n\t# \t...
[ "0.61199504", "0.6006646", "0.58567095", "0.58383083", "0.5830448", "0.5721447", "0.5628691", "0.5575491", "0.55676895", "0.5562992", "0.55484986", "0.5547066", "0.55222625", "0.5482955", "0.54704505", "0.54665774", "0.54454684", "0.54365534", "0.5432282", "0.5424745", "0.541...
0.6885291
0
associates an instance of ChildAccount to this Account
def add_child(self, child_account): self._children.append(child_account)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def save_account(self):\n Credential.account_list.append(self)", "def add(self, account):\n if isinstance(account, Account) and account not in self.account:\n self.account.append(account)", "def put_account(self, account):\n \n pass", "def account(self, account):\n\n ...
[ "0.6679163", "0.6542428", "0.6518352", "0.64333874", "0.64333874", "0.64333874", "0.64333874", "0.6373562", "0.63151264", "0.62300396", "0.6036437", "0.6035886", "0.599156", "0.59576416", "0.59400326", "0.59400326", "0.5933551", "0.5873395", "0.5868553", "0.58684623", "0.5868...
0.6822193
0
print a hierarchical structure representing an account and all child accounts associated to it to the console
def print_tree(account, level=0): """ In the example output below, "GE" is the root account, "Jet Engines" and "Appliances" are first-degree ChildAccounts, and "DoD Contracts" and "Washing Machines" are second-degree ChildAccounts. > print_tree(general_electric) GE (Manufacturing, R&D...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def print_tree(self):\n\t\tprint(self.__print_tree('', True, ''))", "def print_recursive(self, indents):\n\n\t\tind = \"\\t\"\n\t\toutput = indents * ind + self.name\n\t\tprint(output)\n\t\tfor i in self.children:\n\t\t\ti.print_recursive(indents+1)", "def print_account(account):\r\n markets_output = \"\"\r...
[ "0.65483695", "0.6483711", "0.64607173", "0.63137734", "0.62994003", "0.6192441", "0.6160616", "0.6061901", "0.60491484", "0.60221314", "0.6008796", "0.6002482", "0.6001772", "0.5992742", "0.598194", "0.59669787", "0.59571195", "0.59471905", "0.59323215", "0.589066", "0.58874...
0.77148306
0
utility function that checks the global scope for an object that matches the one passed in, if it doesn't exist create the reference in the global scope, this allows for "anonymous" object creation and to still get the object back later Note, the new object name will be the name property with special characters removed...
def check_for_existing_market_segment(segment): for var in list(globals().keys()): if isinstance(eval("{var}".format(var=var)), MarketSegment): if eval("{var}.name".format(var=var)) == segment.name: return # no matching segment found in globals, create it! var_nam...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def default_object_scoper(object_name):\n return \"tag=\\\"{}\\\"\".format(object_name)", "def create_object(object_name):\n if object_name == 'deathstar':\n return Deathstar()\n elif object_name == 'mercury':\n return Mercury()\n elif object_name == 'venus':\n ...
[ "0.58888537", "0.58255064", "0.57960576", "0.5781576", "0.5686544", "0.5686237", "0.5602739", "0.55378485", "0.5523215", "0.54923826", "0.544969", "0.5409906", "0.5392193", "0.5361912", "0.5337955", "0.5288816", "0.52435946", "0.5224719", "0.52194655", "0.5201718", "0.5197779...
0.6119238
0
Basically any speaker id is valid.
def clean(self, value): speakers = speaker_models.Speaker.objects.filter(pk__in=value) if len(speakers) != len(value): raise ValidationError(self.error_messages['invalid_choice'] % value) return speakers
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_api_invalid_stream_id(self) -> None:\n user = self.example_user(\"hamlet\")\n self.login_user(user)\n result = self.api_patch(\n user,\n \"/api/v1/users/me/subscriptions/121\",\n {\"property\": \"is_muted\", \"value\": \"somevalue\"},\n )\n ...
[ "0.5956092", "0.59091747", "0.5825499", "0.56224096", "0.5605519", "0.5577106", "0.5576042", "0.5531081", "0.5529223", "0.5528064", "0.55078095", "0.55064124", "0.5498113", "0.5472017", "0.54554164", "0.54426545", "0.54162496", "0.54084516", "0.53983134", "0.5389476", "0.5380...
0.59182245
1
Extract names of categorical column This function accepts a dataframe and returns categorical list, containing the names of categorical columns(categorical_var).
def categorical(df): categorical_var=df.select_dtypes(include ='object').columns.tolist() return categorical_var
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_categorical(X):\n return list(X.columns[X.dtypes == \"object\"])", "def find_cats(column):\r\n return pd.Categorical(column).categories", "def find_categorical(self, df):\n# print(type(df),df.ndim)\n categorical = [key for key in df.keys() if df.dtypes[key] == np.dtype('O')]\n ...
[ "0.76022893", "0.73164177", "0.721496", "0.721496", "0.71881354", "0.7059722", "0.7012867", "0.68130624", "0.6789028", "0.6767523", "0.6670025", "0.66088444", "0.65843177", "0.65426064", "0.647856", "0.6408604", "0.63178056", "0.62948096", "0.6281347", "0.6274706", "0.6269459...
0.8474346
0
Extract names of numerical column This function accepts a dataframe and returns numerical list, containing the names of numerical columns(numerical_var).
def numerical(df): numerical_var=df.select_dtypes(include =['float64','int64']).columns.tolist() return numerical_var
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_values(df):\n return df.columns.values.tolist()", "def get_non_num_cols(df):\n numerics = ['number']\n newdf = df.select_dtypes(exclude=numerics).columns\n return newdf", "def get_numerical_columns(\n data_frame: pd.DataFrame,\n ignore_columns: list = [],\n uniqueness_thresshold: O...
[ "0.69793", "0.6972095", "0.6884711", "0.68393546", "0.68223983", "0.6716611", "0.6578074", "0.65518904", "0.6534117", "0.65030515", "0.6406427", "0.6395277", "0.6376944", "0.6354434", "0.63127095", "0.62207276", "0.6156436", "0.61465174", "0.6141555", "0.6123878", "0.6118097"...
0.81623864
0
Instances based on the condition This function accepts a dataframe, 2 columns(feature) and 2 values which returns the dataframe based on the condition.
def instances_based_condition(df,col1,val1,col2,val2): instance=df[(df[col1]>val1) & (df[col2]==val2)] return instance
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_features(\r\n df:pd.DataFrame,\r\n path_data_dir:str\r\n ) -> pd.DataFrame:\r\n # Check input.\r\n # Copy dataframe to avoid in place modification.\r\n df = df.copy()\r\n # Check file path.\r\n if not os.path.exists(path_data_dir):\r\n raise IOError(textwrap.dedent(\"\"\"\...
[ "0.6037674", "0.6036051", "0.60075384", "0.5784221", "0.5742433", "0.572674", "0.56658465", "0.5660512", "0.5627629", "0.55905753", "0.5539647", "0.55276555", "0.55015665", "0.5474494", "0.5460671", "0.54350704", "0.54293996", "0.54264325", "0.5407314", "0.53973925", "0.53973...
0.6541016
0
Aggregate values according to month This function accepts a dataframe, 2 columns(feature) and aggregated funcion(agg) which returns the Pivot table with different aggregated value of the feature with an index of the month.
def agg_values_ina_month(df,date_col,agg_col, agg): df[date_col] = pd.to_datetime(df[date_col]) aggregate = {'mean':np.mean,'max':np.max,'min':np.min,'sum':np.sum,'len':len} aggregated_value = df.pivot_table(values=[agg_col], index=df[date_col].dt.month,aggfunc={agg_col:aggregate[agg]}) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def month_summary(phenology_df, out_csv=None):\n month_list = ['Jul','Aug','Sep','Oct','Nov','Dec','Jan','Feb','Mar','Apr',\n 'May','Jun']\n species_list = phenology_df['species'].unique().tolist()\n\n count_list = []\n for species in species_list:\n count_dict = {'species':speci...
[ "0.5653905", "0.56239855", "0.5513427", "0.5429735", "0.5405292", "0.540336", "0.5373406", "0.53479385", "0.5302161", "0.5241061", "0.5224448", "0.51862144", "0.51552224", "0.51262534", "0.5092144", "0.50751626", "0.50463194", "0.5034887", "0.5023972", "0.5020303", "0.5016048...
0.75534564
0
Agrregate values by grouping This function accepts a dataframe, 1 column(feature) and aggregated function(agg1) which groupby the datframe based on the column.
def group_values(df,col1,agg1): grouping=df.groupby(col1).agg(agg1) return grouping
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def agg(self, arg):\n # DataFrame{'a': [1, 1, 2], 'b': [1, 2, 3], 'c': [2, 2, 1]})\n # a.groupby('a').agg('sum') -- applied on rest\n # a.groupby('a').agg(['sum', 'min']) -- both applied on rest\n # a.groupby('a').agg({'b': ['min', 'mean']}) -- applied on\n # TODO\n # a.gr...
[ "0.62384295", "0.62365556", "0.6115062", "0.57873046", "0.5756204", "0.5695222", "0.56700325", "0.56446403", "0.5633193", "0.56284815", "0.5598864", "0.55967784", "0.55186844", "0.5475055", "0.54412466", "0.53967935", "0.5389561", "0.5328148", "0.53219986", "0.5310613", "0.53...
0.74227715
0
Convert temperatures from celsius to fahrenhheit This function accepts a dataframe, 1 column(feature) which returns the dataframe with converted values from celsius to fahrenhheit.
def convert(df,celsius): converted_temp=(df[celsius]*(9/5))+32 return converted_temp
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def convert_f_to_c(temp_in_farenheit): ## ##\n celsiustemp = round((temp_in_farenheit - 32) * 5/9, 1) ##\n return celsiustemp ##", "def convert_celsius_to_fahre...
[ "0.6405321", "0.63570726", "0.63089514", "0.6282194", "0.624191", "0.6216791", "0.6167246", "0.6161009", "0.6136985", "0.6065306", "0.60189754", "0.59730244", "0.59621197", "0.5952359", "0.5952359", "0.5928877", "0.5866788", "0.5863079", "0.5858934", "0.58513784", "0.584079",...
0.6762713
0
returns true if strA divides strB
def divs(strA,strB): for i in range(0,1001): if strB == strA*i: return(True) return(False)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def check_divisibility(a, b):\n \n float_version = float(a)/b\n int_version = a/b\n if float_version == int_version:\n answer = \"divisible\"\n else:\n answer = \"not divisible\"\n return answer", "def call(str_a, str_b):\n if not sys.getsizeof(str_a) == sys.getsizeof(str_b...
[ "0.65836626", "0.6551966", "0.6452647", "0.6091636", "0.6034888", "0.6031436", "0.5918683", "0.5906723", "0.5901623", "0.589791", "0.5895614", "0.58787555", "0.5836668", "0.5830642", "0.58115834", "0.5795731", "0.5777818", "0.5768081", "0.5738433", "0.5724008", "0.57214195", ...
0.80954874
0
Followup, group isomorphic strings
def group_isomorphic(strs): def encode(s): r, d = [], {} for c in s: if c not in d: d[c] = len(d) r.append(d[c]) return str(r) m = defaultdict(list) for s in strs: m[encode(s)].append(s) return list(m.values())
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def group_anagrams(strs):\n anagram_grouping = {}\n \n for anagram in strs:\n curr_ana = str(sorted(anagram))\n anagram_grouping.setdefault(curr_ana, [])\n \n anagram_grouping[curr_ana].append(anagram)\n \n return [ anagram_grouping[gro...
[ "0.60339314", "0.58468187", "0.5554626", "0.5472503", "0.54396987", "0.5400801", "0.53897846", "0.537732", "0.5353079", "0.53035206", "0.53021216", "0.52842623", "0.5275526", "0.5262117", "0.5258697", "0.52123475", "0.5208093", "0.5203539", "0.5198474", "0.51681864", "0.51431...
0.7192948
0
Return processed audio data. Returns mel curve, x/y data. This method is called every time there is a microphone update.
def update(self, audio_samples): min_frequency = self._config["general_settings"]["min_frequency"] max_frequency = self._config["general_settings"]["max_frequency"] audio_data = {} # Normalize samples between 0 and 1. y = audio_samples / 2.0**15 # Construct a rolling win...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def readWaveform(self):\n # prepare data holder\n y = [ 0 for j in range(4) ]\n # in case of previous errors\n self.flushInput()\n for ch in self.chs:\n # mostly for TDS\n self.setCh(ch)\n # calibration factor we will need soon\n (vmult...
[ "0.6034653", "0.59338874", "0.5892915", "0.5839982", "0.5827902", "0.57516843", "0.574115", "0.5740674", "0.5702725", "0.5690479", "0.568213", "0.56605065", "0.5635295", "0.56270736", "0.5599267", "0.5588864", "0.5587347", "0.5577383", "0.5565157", "0.55617267", "0.55504036",...
0.62964714
0
Returns centerfrequencies and band edges for a mel filter bank
def melfrequencies_mel_filterbank(self, num_bands, freq_min, freq_max, num_fft_bands): mel_max = self.hertz_to_mel(freq_max) mel_min = self.hertz_to_mel(freq_min) delta_mel = abs(mel_max - mel_min) / (num_bands + 1.0) frequencies_mel = mel_min + delta_mel * arange(0, num_bands + 2) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_filterbanks(nfilt=26,nfft=512,samplerate=16000,lowfreq=0,highfreq=None):\n highfreq= highfreq or samplerate/2\n assert highfreq <= samplerate/2, \"highfreq is greater than samplerate/2\"\n\n # compute points evenly spaced in mels\n lowmel = hz2mel(lowfreq)\n highmel = hz2mel(highfreq)\n\n ...
[ "0.62791246", "0.62104696", "0.6200014", "0.61953336", "0.6114515", "0.6007833", "0.5868187", "0.58487403", "0.5750124", "0.57495075", "0.5738013", "0.5718509", "0.56999505", "0.5677948", "0.56582195", "0.5656211", "0.55078876", "0.54467714", "0.5432982", "0.53907806", "0.539...
0.698832
0
This function renames columns of a pandas dataframe It converts column names to snake case if rename_dict is not passed.
def cleanup_column_names(df, rename_dict={}, do_inplace=True): if not rename_dict: return df.rename(columns={col: col.lower().replace(' ', '_') for col in df.columns.values.tolist()}, inplace=do_inplace) else: return df.rename(columns=re...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def col_rename(col_dict, df_con_rename):\n\n for ex, nex in col_dict.items():\n df_con_rename = df_con_rename.withColumnRenamed(ex, nex)\n return df_con_rename", "def lowercase_all_column_names(df:DataFrame)->DataFrame:\n for col in df.columns:\n df = df.withColumnRenamed(col, col.lower())...
[ "0.73472214", "0.71769214", "0.712079", "0.7030749", "0.6953978", "0.6815323", "0.6753903", "0.6625544", "0.6609549", "0.6517022", "0.6508362", "0.64940655", "0.6339", "0.62789905", "0.6255128", "0.6241007", "0.6222985", "0.6205978", "0.6147987", "0.61346877", "0.6118897", ...
0.82928956
0
This function should be overriden in the derived classes and return moreorless successfull guess about calling convention
def guess_calling_convention(self): return calldef_types.CALLING_CONVENTION_TYPES.UNKNOWN
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def guess_caller(vr):\n if \"source\" in vr.metadata and len(vr.metadata[\"source\"]) == 1:\n # Callers that follow the VCF spec: FreeBayes, pindel\n caller = vr.metadata[\"source\"][0].split(None, 1)[0]\n elif \"GATKCommandLine.MuTect\" in vr.metadata:\n # GATK/SATK 3.4+\n caller...
[ "0.6016491", "0.5614761", "0.5589595", "0.53914446", "0.5228716", "0.52274674", "0.5044258", "0.50382453", "0.5025339", "0.50055414", "0.50054145", "0.49566883", "0.49546763", "0.49457833", "0.49422875", "0.49309742", "0.49309742", "0.49309742", "0.49309742", "0.49309742", "0...
0.7013889
0
list of class/class declaration types, extracted from the operator arguments
def class_types(self): if None is self.__class_types: self.__class_types = [] for type_ in self.argument_types: decl = None type_ = type_traits.remove_reference(type_) if type_traits_classes.is_class(type_): decl = type...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_types(*args, **kwargs) -> list:\n arg_types = []\n for arg in args:\n arg_types.append(type(arg))\n for values in kwargs.values():\n arg_types.append(type(values))\n return arg_types", "def signature(cls) -> List[Term]:\n el = []\n for term ...
[ "0.6474247", "0.6150577", "0.61504894", "0.61134005", "0.60474235", "0.604117", "0.6033915", "0.59675", "0.5876862", "0.5862628", "0.581305", "0.5805958", "0.58015627", "0.57808363", "0.5776354", "0.5773225", "0.5770651", "0.577052", "0.57593215", "0.5735517", "0.5732222", ...
0.69868934
0
Iterate through the condensed FAQ entries to expand all of the keywords and answers
def parse_faq_entries(entries): parsed_entries = {} for entry in entries: for keyword in entry["keywords"]: if keyword not in parsed_entries: parsed_entries[keyword] = entry["answer"] else: print("Error: Found duplicate keyword '{}' in pre-configur...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def process(data_item, article_id):\n questions = []\n answers = []\n paragraph = [article_id, data_item['context']]\n\n for item in data_item['qas']:\n question = [item[\"id\"], item[\"question\"], item['is_impossible']]\n questions.append(question)\n if item['is_impossible']:\n ...
[ "0.6092856", "0.604264", "0.5708487", "0.57038796", "0.5662298", "0.5381249", "0.5374494", "0.53232485", "0.5256146", "0.52354884", "0.52330977", "0.52246875", "0.5207684", "0.5201199", "0.51908934", "0.5187937", "0.5181439", "0.5181076", "0.51760966", "0.5160842", "0.5153228...
0.67152536
0
Loads the FAQ from disk into memory
def read_faq_from_disk(): return json.load(open("./faq.json"))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def load_knowledge(self):\n MemoryManager.load_memory(self.knowledge_file)", "def load_corpus_questions():\r\n\tglobal search_criteria_dict, solution_dict, linked_abstracts_dict\r\n\tif os.path.exists(paths.path_data_questions_pickle):\r\n\t\tprint('\\nloading questions and answers')\r\n\t\tsearch_criteri...
[ "0.6981235", "0.62057495", "0.61173797", "0.59236383", "0.5770463", "0.57657015", "0.5753063", "0.5708415", "0.56874204", "0.5681949", "0.56623375", "0.5654585", "0.5630125", "0.56003106", "0.55774397", "0.55369693", "0.5526067", "0.5508884", "0.5482488", "0.5453618", "0.5451...
0.72727674
0
Checks whether or not a message that was sent belongs to an active conversation that the bot is in
def is_active_conv(timestamp): debug_print("Checking to see if {} is an active conversation.".format(timestamp)) debug_print(ACTIVE_CONVS) return timestamp in ACTIVE_CONVS
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def filter(self, message):\n conversations = Conversations()\n return conversations.get_conversation(message.from_user.id) is not None", "def filter(self, message):\n conversations = Conversations()\n conversation = conversations.get_conversation(message.from_user.id)\n if conv...
[ "0.68307483", "0.6709261", "0.62747544", "0.609343", "0.59765625", "0.59107685", "0.58387476", "0.57660055", "0.5739228", "0.57104665", "0.56541896", "0.5643942", "0.56159776", "0.5584048", "0.55786204", "0.55633813", "0.55561924", "0.5555065", "0.55538917", "0.55532825", "0....
0.7009033
0
PrettyPrint to stdout if in debug mode
def debug_print(debug_data): if DEBUG_MODE == "true": pp.pprint(debug_data)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def debug_print(text):\r\n if settings.debug:\r\n print (text)", "def debug():", "def debugPrint(text: str):\r\n if DEBUG:\r\n print(text)", "def debugprint(debugobject, debugstring):\n if CMDLINEARGS.debug:\n print \"===== \" + debugstring + \" =====\"\n pprint.pprint(de...
[ "0.72024435", "0.7062981", "0.6972337", "0.6967862", "0.6967862", "0.6959475", "0.6913338", "0.6794894", "0.6765527", "0.67562", "0.67441654", "0.6719388", "0.6710147", "0.6696881", "0.6689538", "0.66720015", "0.6669009", "0.6667993", "0.6667386", "0.6667287", "0.66486543", ...
0.7648205
0
Remove polygons from this cell. The function or callable `test` is called for each polygon in the cell. If its return value evaluates to True, the corresponding polygon is removed from the cell.
def remove_polygons(self, test): filtered_polys = [] for element in self.polygons: pld = [(poly, l, dt) for poly, l, dt in zip(element.polygons, element.layers, element.datatypes) if not test(poly, l, dt)] if len(pld) == 0: pass # we don't need...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def remove_polygons(self, test):\n empty = []\n for element in self.elements:\n if isinstance(element, PolygonSet):\n ii = 0\n while ii < len(element.polygons):\n if test(element.polygons[ii], element.layers[ii],\n ...
[ "0.80205756", "0.6350466", "0.6192517", "0.61731756", "0.60202783", "0.600424", "0.587869", "0.5788355", "0.5787628", "0.560524", "0.549923", "0.5498585", "0.54652745", "0.54613364", "0.5453875", "0.5414428", "0.5398999", "0.5386263", "0.535309", "0.5336463", "0.53328997", ...
0.7925255
1
Remove paths from this cell. The function or callable `test` is called for each `FlexPath` or `RobustPath` in the cell. If its return value evaluates to True, the corresponding label is removed from the cell.
def remove_paths(self, test): ii = 0 while ii < len(self.paths): if test(self.paths[ii]): self.paths.pop(ii) else: ii += 1 return self
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def remove_labels(self, test):\n ii = 0\n while ii < len(self.labels):\n if test(self.labels[ii]):\n self.labels.pop(ii)\n else:\n ii += 1\n return self", "def remove_labels(self, test):\n ii = 0\n while ii < len(self.labels):...
[ "0.6118493", "0.6118493", "0.5951783", "0.591622", "0.57983315", "0.5620718", "0.5586181", "0.55428076", "0.5444423", "0.5415851", "0.53787106", "0.534371", "0.5319035", "0.53083396", "0.52550906", "0.5251843", "0.5233213", "0.5228396", "0.51878136", "0.5161153", "0.5153678",...
0.7509545
0
Remove labels from this cell. The function or callable `test` is called for each label in the cell. If its return value evaluates to True, the corresponding label is removed from the cell.
def remove_labels(self, test): ii = 0 while ii < len(self.labels): if test(self.labels[ii]): self.labels.pop(ii) else: ii += 1 return self
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def RemoveLabel(self, label):\n if self.labels is None:\n self.labels = set()\n else:\n try:\n self.labels.remove(label)\n except KeyError:\n pass", "def remove_label(self, ):\n if self.AttributeNames.LABEL in self.attrs:\n ...
[ "0.65408283", "0.6485277", "0.63599694", "0.6339318", "0.6332027", "0.6300747", "0.6225751", "0.6205483", "0.6164012", "0.6159746", "0.6075823", "0.6052966", "0.59618044", "0.58318126", "0.58288985", "0.58265567", "0.5751653", "0.5742358", "0.56979746", "0.5692929", "0.565627...
0.8710152
1
Return the set of datatypes in this cell. Returns
def get_datatypes(self): datatypes = set() for element in itertools.chain(self.polygons, self.paths): datatypes.update(element.datatypes) for reference in self.references: datatypes.update(reference.ref_cell.get_datatypes()) return datatypes
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_datatypes(self):\n datatypes = set()\n for element in self.elements:\n if isinstance(element, PolygonSet):\n datatypes.update(element.datatypes)\n elif isinstance(element, CellReference) or isinstance(\n element, CellArray):\n ...
[ "0.79858327", "0.7341515", "0.7284648", "0.7140661", "0.70937794", "0.70203876", "0.6859303", "0.6851648", "0.6838585", "0.67846173", "0.6766891", "0.67228407", "0.6693372", "0.6677914", "0.66178626", "0.6582833", "0.6564898", "0.65541935", "0.6541892", "0.6519175", "0.648535...
0.7746643
1
Return the set of texttypes in this cell. Returns
def get_texttypes(self): texttypes = set() for reference in self.references: texttypes.update(reference.ref_cell.get_textypes()) for label in self.labels: texttypes.add(label.texttype) return texttypes
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def GetCellTypes(self):\n if not self.VTKObject.GetCellTypesArray():\n return None\n return vtkDataArrayToVTKArray(\n self.VTKObject.GetCellTypesArray(), self)", "def types(self) -> List[str]:\n return self._types", "def get_text_data_list(self):\n return [self...
[ "0.6864288", "0.67568284", "0.67244345", "0.6621044", "0.66001546", "0.6592116", "0.65660393", "0.6514978", "0.6501299", "0.6420463", "0.63704634", "0.62760276", "0.62488717", "0.62406945", "0.62165576", "0.6175571", "0.6156153", "0.61535233", "0.6119918", "0.6073806", "0.606...
0.852494
0
Return the set of classes for the SVG representation of this cell. Returns
def get_svg_classes(self): ld = set() lt = set() for element in itertools.chain(self.polygons, self.paths): ld.update(zip(element.layers, element.datatypes)) for label in self.labels: lt.add((label.layer, label.texttype)) for reference in self.references: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def classes(self):\n return self.browser.classes(self)", "def classes(self):\n return self._.d", "def getClasses(self):\n self._process()\n return self._sets", "def classes(self):\r\n return self._classes", "def get_classes(self):\n return self._classes", "def cl...
[ "0.6673467", "0.64993554", "0.6337325", "0.632925", "0.6292911", "0.6184021", "0.6183241", "0.6177004", "0.6168098", "0.6159375", "0.6154537", "0.6150669", "0.6049886", "0.60440177", "0.6030368", "0.59519166", "0.5938959", "0.5927353", "0.5877505", "0.58711433", "0.586793", ...
0.7874248
0
Write an SVG fragment representation of this object.
def to_svg(self, outfile, scaling, precision, attributes): outfile.write('<g id="') outfile.write(self.name.replace("#", "_")) outfile.write('" ') outfile.write(attributes) outfile.write(">\n") for polygon in self.polygons: polygon.to_svg(outfile, scaling, pre...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def write_svg(\n self,\n outfile,\n scaling=10,\n style=None,\n fontstyle=None,\n background=\"#222\",\n pad=\"5%\",\n precision=None,\n ):\n bb = self.get_bounding_box()\n if bb is None:\n return\n close = True\n if ...
[ "0.64034855", "0.62927806", "0.6089161", "0.6064701", "0.60599434", "0.60150325", "0.58418894", "0.58044386", "0.5791056", "0.570158", "0.5671584", "0.5624105", "0.5615185", "0.5587682", "0.5575867", "0.55718195", "0.55718195", "0.5566151", "0.55476576", "0.55405116", "0.5510...
0.678781
0
Transform a set of polygons. This reference transformation is used to transform the given polygons in place.
def _transform_polygons(self, polygons): if self.rotation is not None: ct = numpy.cos(self.rotation * numpy.pi / 180.0) st = numpy.sin(self.rotation * numpy.pi / 180.0) * _mpone if self.x_reflection: xrefl = numpy.array((1, -1)) if self.magnification is not No...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _transform_polygons(self, polygons):\n if self.rotation is not None:\n ct = numpy.cos(self.rotation * numpy.pi / 180.0)\n st = numpy.sin(self.rotation * numpy.pi / 180.0) * _mpone\n if self.magnification is not None:\n mag = numpy.array((self.magnification, self.m...
[ "0.7867194", "0.5765913", "0.55117023", "0.55035955", "0.5446485", "0.5436907", "0.5436537", "0.5431551", "0.5428468", "0.5427553", "0.5419052", "0.5384409", "0.53389496", "0.53316414", "0.53243774", "0.5288421", "0.52567446", "0.5184014", "0.5177287", "0.5158781", "0.5148572...
0.7864645
1
Transform a set of polygons. This reference transformation is used to transform the given polygons.
def _transform_polygons(self, polygons): if self.rotation is not None: ct = numpy.cos(self.rotation * numpy.pi / 180.0) st = numpy.sin(self.rotation * numpy.pi / 180.0) * _mpone if self.magnification is not None: mag = numpy.array((self.magnification, self.magnificati...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _transform_polygons(self, polygons):\n if self.rotation is not None:\n ct = numpy.cos(self.rotation * numpy.pi / 180.0)\n st = numpy.sin(self.rotation * numpy.pi / 180.0) * _mpone\n if self.x_reflection:\n xrefl = numpy.array((1, -1))\n if self.magnificatio...
[ "0.785101", "0.5796514", "0.559841", "0.55872154", "0.55240583", "0.5515661", "0.55025566", "0.5487049", "0.5435642", "0.54168725", "0.54126465", "0.53939325", "0.53696126", "0.5351234", "0.5342615", "0.5257946", "0.5232036", "0.521499", "0.52135664", "0.51902133", "0.5137937...
0.78590536
0
Rename an existing cell in the library.
def rename_cell(self, cell, name, update_references=True): if isinstance(cell, Cell): old_name = cell.name if old_name not in self.cells: raise ValueError( "[GDSPY] Cell named {0} not present in library.".format(old_name) ) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def name(self, new_name):\n self.rename(new_name)", "def cellModified(self):\n\n x = self.tableWidget_journals.currentRow()\n y = self.tableWidget_journals.currentColumn()\n if y == self.NAME_COLUMN:\n newName = str(self.tableWidget_journals.item(x, y).text()).strip().encod...
[ "0.58167297", "0.57922983", "0.5770913", "0.5732452", "0.5716103", "0.5663834", "0.56498533", "0.56498533", "0.56417304", "0.5641613", "0.56392765", "0.558007", "0.5527694", "0.55087227", "0.54747593", "0.5461296", "0.53917825", "0.53753626", "0.5354214", "0.5341221", "0.5337...
0.8026026
0
Replace cells in all references in the library. All `CellReference` and `CellArray` using the `old_cell` are updated to reference `new_cell`. Matching with `old_cell` is by name only.
def replace_references(self, old_cell, new_cell): if isinstance(old_cell, Cell): old_name = old_cell.name else: old_name = old_cell if not isinstance(new_cell, Cell) and new_cell in self.cells: new_cell = self.cells[new_cell] replacements = 0 f...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def rename_cell(self, cell, name, update_references=True):\n if isinstance(cell, Cell):\n old_name = cell.name\n if old_name not in self.cells:\n raise ValueError(\n \"[GDSPY] Cell named {0} not present in library.\".format(old_name)\n )...
[ "0.60519004", "0.5878847", "0.5818164", "0.57240033", "0.5468772", "0.5437272", "0.5320144", "0.5285266", "0.52246344", "0.5099337", "0.505342", "0.5046812", "0.50462395", "0.5032131", "0.4985268", "0.49477512", "0.49297217", "0.48797628", "0.4874498", "0.48279476", "0.482275...
0.7644548
0
Extract a cell from the this GDSII file and include it in the current global library, including referenced dependencies.
def extract(self, cell, overwrite_duplicate=False): warnings.warn( "[GDSPY] extract and the use of the global library is deprecated.", category=DeprecationWarning, stacklevel=2, ) import gdspy cell = self.cells.get(cell, cell) gdspy.current_li...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def extract(self, cell):\n cell = self.cell_dict.get(cell, cell)\n current_library.add(cell)\n current_library.add(cell.get_dependencies(True))\n return cell", "def import_gds(filename, cellname = None, flatten = False):\n gdsii_lib = gdspy.GdsLibrary()\n gdsii_lib.read_gds(file...
[ "0.7146233", "0.5359825", "0.53328305", "0.52091736", "0.5137022", "0.51339316", "0.5118252", "0.5001852", "0.49921566", "0.4971133", "0.49391878", "0.4921173", "0.49046072", "0.48940232", "0.48588583", "0.48488533", "0.48184195", "0.4751385", "0.47495297", "0.4736816", "0.47...
0.6714337
1
Write the specified cell to the file.
def write_cell(self, cell, timestamp=None): cell.to_gds(self._outfile, self._res, timestamp) return self
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def write_cell(self, cell):\n self._outfile.write(cell.to_gds(self._res))\n return self", "def writeCell(hoja, fila, columna, dato, formato=''):\r\n if formato:\r\n hoja.write(fila, columna, dato, formato)\r\n else:\r\n hoja.write(fila, columna, dato)", "def write_cell(self, s...
[ "0.7893535", "0.7167007", "0.64020705", "0.6233088", "0.6106569", "0.60965765", "0.60965765", "0.605748", "0.59968483", "0.59903365", "0.5989713", "0.5946001", "0.59330434", "0.58675724", "0.5825177", "0.58209854", "0.58193207", "0.57958156", "0.5771627", "0.5768062", "0.5734...
0.74768186
1
Write the specified binary cells to the file.
def write_binary_cells(self, binary_cells): for bc in binary_cells: self._outfile.write(bc) return self
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def write_binary(self, path):\n return", "def write_df_to_binary(file_name_mask, df):\n write_matrix_to_binary(file_name_mask + '-value.bin', df.values)\n with open(file_name_mask + '-name.txt', 'w') as f:\n f.write(\"\\t\".join(df.index))\n f.write(\"\\n\")\n f.write(\"\\t\".jo...
[ "0.65858525", "0.6368011", "0.6283617", "0.622919", "0.6155533", "0.6013805", "0.5996172", "0.5971584", "0.59386206", "0.5921192", "0.591766", "0.5843438", "0.58248633", "0.5801343", "0.578895", "0.5729028", "0.57093227", "0.5703158", "0.56399626", "0.56187046", "0.56164056",...
0.8135084
0
Return the unit and precision used in the GDS stream file.
def get_gds_units(infile): close = True if hasattr(infile, "__fspath__"): infile = open(infile.__fspath__(), "rb") elif isinstance(infile, (basestring, Path)): infile = open(infile, "rb") else: close = False unit = precision = None for rec_type, data in _raw_record_reader...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_precision(self):\n ...", "def unit_of_measurement(self) -> str:\n return FPS", "def unit_of_measurement(self) -> str:\n return FPS", "def unit_of_measurement(self):\n return self._metadata[1]", "def GetDataPrecision():\n return _gmat_py.GmatBase_GetDataPrecision()...
[ "0.66406333", "0.62469673", "0.62469673", "0.62245446", "0.6159991", "0.6155099", "0.6046847", "0.60281473", "0.60199654", "0.597692", "0.597692", "0.5961308", "0.5957242", "0.59303707", "0.59269", "0.5922502", "0.5920388", "0.58822894", "0.5881604", "0.5881604", "0.5881604",...
0.6897266
0
Load all cells from a GDSII stream file in binary format.
def get_binary_cells(infile): close = True if hasattr(infile, "__fspath__"): infile = open(infile.__fspath__(), "rb") elif isinstance(infile, (basestring, Path)): infile = open(infile, "rb") else: close = False cells = {} name = None cell_data = None for rec_type,...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def load(datastream):", "def load_rbc( fname, skiprows, nx, ny ):\n C = numpy.loadtxt( fname, skiprows=skiprows ) \n cell_frames = [ C[i].reshape(( nx,ny )) for i in range( 5000-skiprows ) ]\n return cell_frames", "def load_binary_data(self, encoding='utf8'):\n\n # TODO use smart_open again ...
[ "0.59665906", "0.5666531", "0.5652383", "0.56487894", "0.5564757", "0.5411691", "0.53955466", "0.5385155", "0.538372", "0.53774667", "0.52971804", "0.5276019", "0.52390313", "0.52172196", "0.5202131", "0.51881504", "0.5182322", "0.5163801", "0.5156424", "0.5144767", "0.513413...
0.61892736
0
Sets the product of this SubscriptionProductRetirement.
def product(self, product): self._product = product
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def product(self, product):\n self._product = product", "def product(self, product):\n if product is None:\n raise ValueError(\"Invalid value for `product`, must not be `None`\") # noqa: E501\n\n self._product = product", "def set_product(self, product):\n self.single_se...
[ "0.77392894", "0.7601882", "0.7119301", "0.7109555", "0.69029176", "0.6886196", "0.6886196", "0.6858822", "0.6649319", "0.64404374", "0.6351997", "0.6307819", "0.62698454", "0.601716", "0.6005919", "0.59450114", "0.59232247", "0.5884955", "0.58693993", "0.5860039", "0.5857742...
0.78371936
0
Gets the respect_terminiation_periods_enabled of this SubscriptionProductRetirement.
def respect_terminiation_periods_enabled(self): return self._respect_terminiation_periods_enabled
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def respect_terminiation_periods_enabled(self, respect_terminiation_periods_enabled):\n\n self._respect_terminiation_periods_enabled = respect_terminiation_periods_enabled", "def evaluation_periods(self) -> Optional[pulumi.Input[int]]:\n return pulumi.get(self, \"evaluation_periods\")", "def eval...
[ "0.74990064", "0.59558636", "0.59558636", "0.59558636", "0.59558636", "0.59558636", "0.59558636", "0.59558636", "0.59558636", "0.59558636", "0.59558636", "0.59558636", "0.59558636", "0.52868", "0.52440816", "0.51808107", "0.51157266", "0.51113236", "0.50006104", "0.49916717", ...
0.7897476
0
Sets the respect_terminiation_periods_enabled of this SubscriptionProductRetirement.
def respect_terminiation_periods_enabled(self, respect_terminiation_periods_enabled): self._respect_terminiation_periods_enabled = respect_terminiation_periods_enabled
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def respect_terminiation_periods_enabled(self):\n return self._respect_terminiation_periods_enabled", "def set_atr_periods(self, periods: int = 100):\n h, l, c_prev = self.data.High, self.data.Low, pd.Series(self.data.Close).shift(1)\n tr = np.max([h - l, (c_prev - h).abs(), (c_prev - l).abs...
[ "0.73718745", "0.45488954", "0.44557628", "0.44557628", "0.44557628", "0.44557628", "0.44557628", "0.44557628", "0.44557628", "0.44557628", "0.44557628", "0.44557628", "0.44557628", "0.44557628", "0.42839718", "0.4270166", "0.40364996", "0.4027975", "0.39874214", "0.39431196", ...
0.8498492
0
Gets the target_product of this SubscriptionProductRetirement.
def target_product(self): return self._target_product
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def target_for_product(self, product):\n for target, products in self._products_by_target.items():\n if product in products:\n return target\n return None", "def getTarget(self):\n return self._target", "def getTarget(self):\n\n return self._target", "def target_resource(self)...
[ "0.679874", "0.65475947", "0.65354234", "0.6525121", "0.6492427", "0.6492427", "0.6492427", "0.638465", "0.6314479", "0.616897", "0.61486644", "0.61486644", "0.61486644", "0.61486644", "0.6129035", "0.60792124", "0.6019437", "0.6019437", "0.6019437", "0.6019437", "0.60076684"...
0.8075166
0
Sets the target_product of this SubscriptionProductRetirement.
def target_product(self, target_product): self._target_product = target_product
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def target_resource(self, target_resource):\n self._target_resource = target_resource", "def product(self, product):\n\n self._product = product", "def product(self, product):\n\n self._product = product", "def target_product(self):\n return self._target_product", "def product(s...
[ "0.6490736", "0.6366156", "0.6366156", "0.633028", "0.62527555", "0.6134227", "0.6102009", "0.59970754", "0.59970754", "0.59861636", "0.5946594", "0.5928907", "0.58098286", "0.57920307", "0.5782366", "0.57533026", "0.57472503", "0.56921405", "0.56693083", "0.56693083", "0.566...
0.84785706
0
Creates a module for converting to two theta
def pixels_two_theta_module(id=None, datatype=None, action=None, version='0.0', fields=[], xtype=None, **kwargs): icon = { 'URI': config.IMAGES + config.ANDR_FOLDER + "twotheta.png", 'image': config.IMAGES + config.ANDR_FOLDER + "twotheta_image.png", 'terminals': { ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def theta():\n pass", "def theta(a, b):\n \n \n def norm_vec(x):\n norm_out = sqrt(dot(x, x))\n return norm_out\n \n theta = acos(dot(a, b) / (norm_vec(a) * norm_vec(b))) * 180 / pi\n \n print theta", "def world_to_tanp(self, ra, dec):\n x, y = ra, dec\n retu...
[ "0.7062045", "0.62151426", "0.61780596", "0.6039193", "0.5918481", "0.58948064", "0.57671696", "0.5749727", "0.5746482", "0.5715399", "0.5696348", "0.56941783", "0.56172824", "0.5604744", "0.5569989", "0.5564663", "0.55641603", "0.5526037", "0.5512258", "0.5491512", "0.549099...
0.6354712
1
Builds and compiles an LSTM model with the provided hyperparameters
def build_lstm_model(num_features, embedding_size=None, kernel_size=None, filters=None, pool_size=None, lstm_output_size=None): # Embedding if embedding_size is None: embedding_size = 64 # Convo...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def build_model():\n model = Sequential()\n\n # declare the sizes of the layers (1d input and output)\n layers = [1, 50, 100, 1]\n\n # first hidden layer, using linear activation (not specified)\n model.add(LSTM(layers[1], input_shape=(None, layers[0]), return_sequences=True))\n model.add(Dropout...
[ "0.7327266", "0.7019922", "0.69401413", "0.6916434", "0.6855566", "0.6760684", "0.6749975", "0.66563517", "0.6652487", "0.6617321", "0.6601682", "0.6585494", "0.6581302", "0.65048313", "0.6483536", "0.64814115", "0.6456501", "0.6426442", "0.63948613", "0.6370045", "0.63666123...
0.70667225
1
Builds and compiles an GRU model with the provided hyperparameters
def build_gru_model(num_features, embedding_size=None, kernel_size=None, filters=None, pool_size=None, gru_output_size=None): # Embedding if embedding_size is None: embedding_size = 64 # Convolu...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def compile_gru_model(input_dim=101, output_dim=4563, recur_layers=3, nodes=1000,\n conv_context=11, conv_border_mode='valid', conv_stride=2,\n initialization='glorot_uniform', batch_norm=True, num_gpu=1):\n logger.info(\"Building gru model\")\n # Main acoustic input...
[ "0.73912466", "0.66649204", "0.6635141", "0.6230592", "0.6221744", "0.61874807", "0.61704993", "0.61428016", "0.6135985", "0.61158645", "0.6077031", "0.6056821", "0.60392755", "0.60282505", "0.5926871", "0.5913023", "0.5907081", "0.5886617", "0.58645344", "0.58603835", "0.584...
0.7483657
0
Create bitmap from given unicode character, return image file object.
def create_unicode_image(unicode_character): # Check the cache if unicode_character in unicode_cache.keys(): return unicode_cache[unicode_character] # Initialize canvas and font parameters # Credit: JackNova (until URL) width = 10 height = 20 background_color=(0,0,0) font_size=2...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def fromascii(self, *args, **kwargs):\n return _image.image_fromascii(self, *args, **kwargs)", "def get_tile_bitmap(self, char):\n if char == '#':\n return self.tiles[0:32, 0:32, :]\n elif char == 'b':\n return self.tiles[0:32, 128:160, :]\n elif char == 'd':\n ...
[ "0.5853663", "0.58179283", "0.56746536", "0.5479672", "0.5382288", "0.53489006", "0.53442067", "0.53410566", "0.53409886", "0.52899945", "0.52466315", "0.52246463", "0.5191945", "0.5159506", "0.5151667", "0.5137356", "0.51334125", "0.5129038", "0.5070787", "0.50635946", "0.50...
0.777532
0
Ingest a file and slice it into 10x20 bitmaps which are compared with bitmaps of unicode charcters. The most similar character is printed with x256 color which is most like the average color for the 10x20 bitmap slice.
def print_image_as_unicode(image_file, **kwargs): char_set = kwargs['char_set'] x256_mode = kwargs['x256'] height = 20 # height of unicode character width = 10 # width of the unicode characters we are using # Credit ElTero and ABM (https://stackoverflow.com/a/7051075) if image_file == '-': ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self, file_path=\"data/\", batch_size=1, img_size=[128, 2048], max_text_len=256):\r\n\r\n # filePath needs to be a folder\r\n assert file_path[-1]=='/'\r\n\r\n self.current_index = 0\r\n self.batch_size = batch_size\r\n self.img_size = img_size\r\n self.sample...
[ "0.5643496", "0.5535181", "0.5525569", "0.54742545", "0.5472219", "0.5442176", "0.53953683", "0.5384109", "0.5324327", "0.53202426", "0.528826", "0.5234474", "0.5232815", "0.5206607", "0.52048206", "0.5201688", "0.5193406", "0.51914054", "0.51873463", "0.5156003", "0.51466596...
0.57994384
0
Filter a `items` list according to a list of `queries`. Values from `items` are kept if they match at least one query. The original `items` list is untouched but the result list uses the same data (not a deep copy). If `attribute` is None, it is assumed that `items` is a list of strings to be filtered directly. If `att...
def stringfilter(items, queries, attribute=None): result = [] if attribute is not None: key_path = attribute.split('.') else: key_path = None for item in items: if key_path is not None: string = _get_nested_value(item, key_path) if not isinstance(string, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def itemFilterAttr(*args, byName: Union[AnyStr, bool]=\"\", byNameString: Union[AnyStr,\n List[AnyStr], bool]=\"\", byScript: Union[AnyStr, bool]=\"\", classification:\n Union[AnyStr, bool]=\"\", dynamic: bool=True, exists: bool=True, hasCurve:\n bool=True, has...
[ "0.57204485", "0.5617756", "0.548573", "0.54075944", "0.5388926", "0.52190524", "0.5199355", "0.5139567", "0.50037485", "0.48549065", "0.4841358", "0.47993222", "0.47757334", "0.47549915", "0.47255918", "0.47191286", "0.47072586", "0.4689648", "0.46839404", "0.46671137", "0.4...
0.68550235
0
Get value under `key_path` key in `dct` dictionary. `key_path` is a list of keys to be traversed into a potentially nested `dct` dictionary.
def _get_nested_value(dct, key_path): key = key_path[0] if not isinstance(dct, dict): raise errors.AnsibleFilterError( f"stringfilter: looking for key '{key}' " f"but list item is not dict: {pformat(dct)}" ) if key not in dct: raise errors.AnsibleFilterError( ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_by_path(data: Dict[str, T], path: Sequence[str]) -> T:\n return reduce(operator.getitem, path, data)", "def _get_by_path(dic, keys):\n assert len(keys) > 0, \"Path key can not be an empty list.\"\n\n d = dic\n for key in keys[:-1]:\n if isinstance(key, int) or key in d:\n d ...
[ "0.6952644", "0.68554395", "0.6719718", "0.64265496", "0.64265496", "0.6403472", "0.63947314", "0.63453716", "0.6322947", "0.6304281", "0.6285504", "0.62721723", "0.6161064", "0.61594445", "0.6127265", "0.61137265", "0.60990524", "0.60921264", "0.6087193", "0.6030112", "0.602...
0.7896383
0
Tests whether the trace for step methods is exactly the same as on master. Code changes that effect how random numbers are drawn may change this, and require `master_samples` to be updated, but such changes should be noted and justified in the commit. This method may also be used to benchmark step methods across commit...
def check_trace(self, step_method): n_steps = 100 with Model(): x = Normal('x', mu=0, sd=1) if step_method.__name__ == 'SMC': Deterministic('like', - 0.5 * tt.log(2 * np.pi) - 0.5 * x.T.dot(x)) trace = smc.ATMIP_sample(n_steps=n_steps, step=step_me...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def TestOneStep(self):\n pass", "def test_changes(monkeypatch, local):\n monkeypatch.setenv('LANG', 'en_US.UTF-8')\n monkeypatch.setenv('TRAVIS_BUILD_ID', '12345')\n monkeypatch.setenv('TRAVIS_BRANCH', 'master')\n old_sha = pytest.run(local, ['git', 'rev-parse', 'HEAD']).strip()\n local.ens...
[ "0.5406668", "0.5375", "0.53389776", "0.5314626", "0.52967477", "0.5258354", "0.52216065", "0.52073497", "0.51792115", "0.51779264", "0.51701105", "0.5160602", "0.5152976", "0.51241815", "0.50939167", "0.50733656", "0.50511485", "0.5043404", "0.50413126", "0.50389934", "0.503...
0.549506
0
Test that samplers correctly create nonblocked compound steps.
def test_non_blocked(self): _, model = simple_2model() with model: for sampler in self.samplers: assert isinstance(sampler(blocked=False), CompoundStep)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_block_extra_batch(self):\n pass", "def test_block_bad_batch(self):\n pass", "def test_validation_correct_samplers():\n samplers = [\n {'type': 'MultiStateSampler', 'locality': 3},\n {'type': 'ReplicaExchangeSampler'},\n # MCMCMove 'single' is defined in get_templa...
[ "0.66656935", "0.6592942", "0.64613193", "0.64177775", "0.6116642", "0.6095393", "0.6079921", "0.6000796", "0.5993817", "0.59393144", "0.5934992", "0.57287186", "0.5716562", "0.57142526", "0.57003576", "0.56979024", "0.5697373", "0.5691124", "0.567336", "0.5657544", "0.565397...
0.79553413
0
Test bernoulli distribution is assigned binary gibbs metropolis method
def test_bernoulli(self): with Model() as model: Bernoulli('x', 0.5) steps = assign_step_methods(model, []) assert isinstance(steps, BinaryGibbsMetropolis)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def bernoulli(p):\n bern = rn.binomial(1,p)\n return bern", "def bernoulli(p):\r\n if np.random.random() < p:\r\n return 0\r\n else:\r\n return 1", "def bernoulli_num(n):\n return mp.bernoulli(n)", "def bernoulli(n):\n\n x, res, s, c = Rat(0), Rat(0), Rat(0), Rat(-1)\n for ...
[ "0.7547345", "0.7430234", "0.737914", "0.7260277", "0.7170436", "0.70253694", "0.6839243", "0.67702055", "0.653989", "0.6529904", "0.6523155", "0.64852256", "0.648092", "0.6472643", "0.6457794", "0.64568967", "0.64539707", "0.6446213", "0.63996285", "0.63980657", "0.6349709",...
0.77244
0
Test binomial distribution is assigned metropolis method.
def test_binomial(self): with Model() as model: Binomial('x', 10, 0.5) steps = assign_step_methods(model, []) assert isinstance(steps, Metropolis)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_bernoulli(self):\n with Model() as model:\n Bernoulli('x', 0.5)\n steps = assign_step_methods(model, [])\n assert isinstance(steps, BinaryGibbsMetropolis)", "def test_multinomial(self):\r\n # Check over two calls to see if the random state is correctly updated....
[ "0.69088066", "0.6723618", "0.66573316", "0.6643335", "0.6618572", "0.6482851", "0.6428169", "0.6424013", "0.6345978", "0.62615824", "0.6225464", "0.61995316", "0.61335987", "0.6075258", "0.60746217", "0.6054197", "0.6051179", "0.60234743", "0.60210484", "0.60168356", "0.5997...
0.76352745
0
Ensure that, for the given service, the video_id is valid.
def clean_video_id(self): failed = False d = self.cleaned_data service = d.get('service') # Get the video id and clear whitespace on either side. video_id = d.get('video_id', '').strip() # Validate using YouTube's API: if service == 'youtube': url = (...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def allow_video(self, video_id):\n print(\"allow_video needs implementation\")", "def allow_video(self, video_id):\n print(\"allow_video needs implementation\")", "def allow_video(self, video_id):\n print(\"allow_video needs implementation\")", "def allow_video(self, video_id):\n ...
[ "0.60907304", "0.60907304", "0.60907304", "0.60907304", "0.6068158", "0.5851678", "0.57884514", "0.56182677", "0.5566757", "0.55377215", "0.5534833", "0.5517205", "0.5513362", "0.5502711", "0.5484015", "0.54670113", "0.54354274", "0.54342276", "0.53538764", "0.53443223", "0.5...
0.7674897
0
Computes coverage rate for `y_pred`.
def coverage(y_true, y_pred): m = tf.shape(y_pred)[1] - tf.constant(1, dtype=tf.int32) n_samples = tf.cast(tf.shape(y_pred)[0], tf.float32) n_abstain = tf.reduce_sum( tf.where(tf.argmax(y_pred, axis=1, output_type=tf.int32) == m, 1.0, 0.0) ) return tf.constant(1.0) - n_abstain / n_samples
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def hit_rate(y_true, y_pred, spu=None):\n mask = y_pred.astype(bool)\n y_true_in_pred = y_true[mask]\n return y_true_in_pred.sum()/y_true.sum()", "def recall_score(y_true, y_pred):\n return ((y_true == 1) * (y_pred == 1)).sum() / (y_true == 1).sum()", "def ari(y_pred, y_true):\n return metrics.a...
[ "0.71039015", "0.70715314", "0.6947408", "0.6926472", "0.68919915", "0.6836527", "0.6757787", "0.6753589", "0.67308986", "0.67180943", "0.66951615", "0.66951615", "0.66951615", "0.66951615", "0.66951615", "0.66951615", "0.66951615", "0.66951615", "0.66951615", "0.66951615", "...
0.75946474
0
View products in Cart.
def index(self, user): cart_products = CartProduct.index(user) CartProductsView.index(cart_products)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def products(request):\n\n if not request.user.is_superuser:\n messages.error(request, 'Sorry, only store owners can do that.')\n return redirect(reverse('home'))\n\n products = Product.objects.all()\n template = \"auctionsmng/products.html\"\n\n context = {\n 'products': products\...
[ "0.7544936", "0.74219257", "0.72852266", "0.7261602", "0.72421676", "0.7014876", "0.70145303", "0.70145303", "0.7007686", "0.6988518", "0.6979214", "0.6970391", "0.69648755", "0.69648755", "0.69648755", "0.69543886", "0.69423074", "0.6799814", "0.6670603", "0.6653604", "0.658...
0.77032435
0
Delete Product from Cart.
def delete(self, user, product): cart_product = CartProduct.delete(user, product) CartProductsView.delete(cart_product)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def delete(self, product):\n product_id = str(product)\n if product_id in self.cart:\n del self.cart[product_id]\n self.save()", "def cart_remove(request, product_id):\n cart = Cart(request)\n product = get_object_or_404(Product, id=product_id)\n cart.remove(product)\n ...
[ "0.8534601", "0.8041614", "0.79457", "0.770682", "0.7690166", "0.7668008", "0.76628315", "0.7649517", "0.7617706", "0.7565354", "0.75316346", "0.7501226", "0.7420002", "0.73552704", "0.7347085", "0.7338678", "0.73137146", "0.7273116", "0.7239314", "0.7206781", "0.7196743", ...
0.81086886
1
Yield the classes in module ``mod`` that inherit from ``cls``
def get_subclasses(mod, cls): for name, obj in inspect.getmembers(mod): if hasattr(obj, "__bases__") and cls in obj.__bases__: yield obj
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _classes_(cls):\n for base_cls in cls.__bases__:\n # Avoid infinite loop\n if base_cls == Sandbox:\n continue\n\n yield base_cls", "def _classesToCheck(self, cls):\r\n yield cls\r\n yield from inspect.getmro(cls)", "def get_all_classes_de...
[ "0.7661169", "0.75540936", "0.74157786", "0.74068946", "0.71664065", "0.7122239", "0.70386964", "0.68738073", "0.6851402", "0.6728931", "0.66658", "0.66300493", "0.6608214", "0.65761477", "0.65552634", "0.65492725", "0.65423816", "0.65163565", "0.647793", "0.64746547", "0.644...
0.80770713
0
A main function to run the simulation
def Main(): numberOfPopulation = 350 numberOfDays = 60 simulation = Simulation(Covid19(), numberOfPopulation, numberOfDays, "Covid 19 Simulation") simulation.run() simulation = Simulation(Ebola(), numberOfPopulation, numberOfDays, "Ebola Simulation") simulation.run()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def Main():\n EnigmaSim = simulation() #Creates the simulation object\n EnigmaSim.Run() #Runs the simulation", "def main():\n run_simulation(spectral=False, ml=False, num_procs=1)\n run_simulation(spectral=True, ml=False, num_procs=1)\n run_simulation(spectral=False, ml=True, num_procs=1)\n run...
[ "0.82430094", "0.80094373", "0.770448", "0.7694861", "0.7663943", "0.7658844", "0.7653654", "0.76189035", "0.76126456", "0.74813896", "0.74432015", "0.73796666", "0.73725206", "0.7330815", "0.7320483", "0.73116446", "0.72484505", "0.7242806", "0.7231775", "0.7191046", "0.7118...
0.8399111
0
Uses the readings from all nodes to report the mean and standard deviation of all nodes
def get_network_reading(self): # update the readings for all nodes self.update_all_readings() # get the current readings from all nodes node_readings = [] for node_name in self.nodes: node_readings.append(self.nodes[node_name].stable_reading) node_readings...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def compute_training_stats():\n means, stds = [], []\n data = SUNRGBDTrainDataset(True)\n for i in range(len(data)):\n print(i)\n img, _ = data[i]\n std, mean = t.std_mean(input=img, dim=(1, 2))\n means.append(mean)\n stds.append(std)\n means = t.sum(t.vstack(means), ...
[ "0.6639394", "0.6492293", "0.6476488", "0.6289496", "0.6249173", "0.61678153", "0.61512434", "0.6148738", "0.61152846", "0.6097314", "0.60312355", "0.60029006", "0.5964977", "0.5934712", "0.5916757", "0.59007215", "0.5894467", "0.58875763", "0.5869987", "0.58500725", "0.58438...
0.6637554
1
Generator that returns the names of all nodes in the network
def node_names(self): for node_name in self.nodes.keys(): yield node_name
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def all_nodes_as_iterable(self, include_metadata: bool = False) -> Generator:\n if include_metadata:\n return [\n (self._names.get_name(i), self._meta.get_node(self._names.get_name(i)))\n for i in self._nk_graph.iterNodes()\n ]\n return [self._names...
[ "0.72962666", "0.71726984", "0.7021836", "0.6995421", "0.6957169", "0.68337035", "0.67822737", "0.6635629", "0.66200304", "0.6613424", "0.66128385", "0.6590175", "0.6584443", "0.6574914", "0.6530787", "0.6516793", "0.6490995", "0.64839625", "0.6473152", "0.6454208", "0.642815...
0.80899006
0
gets average position of all nodes in the network
def get_network_average_position(self): # the total number of nodes in the network num_nodes = self.total_nodes() # get the location of all nodes all_nodes = np.empty((num_nodes, R_space)) for index, item in enumerate(self.nodes.values()): all_nodes[index] = item.ge...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def mean_average_position():\n pass", "def streets_per_node_avg(G):\n spn_vals = streets_per_node(G).values()\n return sum(spn_vals) / len(G.nodes)", "def average_distance(self):\r\n total = 0\r\n edges = 0\r\n for code, _list in self.edges.items():\r\n for edge in _lis...
[ "0.71411693", "0.6822021", "0.6471728", "0.6465491", "0.63243866", "0.6256085", "0.62065727", "0.592237", "0.58896816", "0.5823813", "0.5820218", "0.57679445", "0.5765885", "0.57562655", "0.57562655", "0.57562655", "0.57562655", "0.57562655", "0.57481986", "0.5742098", "0.573...
0.84714663
0
get the nodes with the lowest and highest number of neighbors
def get_interest_nodes(self): # go through each node in the network to find the min and max degrees max_value = 0 min_value = len(self.nodes) for name in self.nodes: # check for new max if self.nodes[name].get_degree() >= max_value: max_value = s...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_neighbours(self):\n return []", "def neighbours(self):\n return [x.node for x in self.edges]", "def neighbors((min_i, min_j), (max_i, max_j), (i, j)):\n if j + 1 <= max_j:\n yield (i, j + 1)\n if j - 1 >= min_j:\n yield (i, j - 1)\n if i + 1 <= max_i:\n y...
[ "0.7004768", "0.6752797", "0.67516655", "0.6725832", "0.6695274", "0.66674364", "0.66209084", "0.65983164", "0.6586327", "0.6554205", "0.6553236", "0.6543602", "0.6524486", "0.64795715", "0.64779377", "0.6466439", "0.6460438", "0.6440627", "0.6440627", "0.6440627", "0.6440627...
0.6979103
1
Recibe el numero de segmentos y el valor de W Esta es la funcion de sumatoria para los numeros Impares Regresa el total de la sumatoria
def sumaImpar(self,numSeg,w): total=0 for i in range(1,numSeg,2): total+=4*self.F(i*w) return total
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def sumaPar(self,numSeg,w):\n total=0\n for i in range(2,numSeg-1,2):\n total+=2*self.F(i*w)\n return total", "def som(getallenlijst):\r\n total = sum(getallenlijst)\r\n return total", "def patrimony_total(self):\n pass", "def P(self,numSeg):\n w=self.x/num...
[ "0.6964878", "0.6134664", "0.594122", "0.5869036", "0.5832696", "0.58005255", "0.5768656", "0.57542235", "0.57383496", "0.5733486", "0.5723789", "0.5633767", "0.5631011", "0.5616186", "0.5609557", "0.5607594", "0.56038254", "0.5596513", "0.5594047", "0.5584726", "0.55708295",...
0.6899784
1
Recibe el numero de segmentos y el valor de W Esta es la funcion de sumatoria para los numeros Pares Regresa el total de la sumatoria
def sumaPar(self,numSeg,w): total=0 for i in range(2,numSeg-1,2): total+=2*self.F(i*w) return total
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def som(getallenlijst):\r\n total = sum(getallenlijst)\r\n return total", "def patrimony_total(self):\n pass", "def sumaImpar(self,numSeg,w):\n total=0\n for i in range(1,numSeg,2):\n total+=4*self.F(i*w)\n return total", "def n_suma(a1,nr_wyrazu,r):\n return (...
[ "0.63764817", "0.6370845", "0.6358655", "0.6194959", "0.6053004", "0.5966047", "0.59162605", "0.5848194", "0.5827601", "0.57799345", "0.5768629", "0.5754656", "0.5723134", "0.57056737", "0.5684519", "0.56820756", "0.56553745", "0.56527156", "0.5647538", "0.56249356", "0.56219...
0.72560215
0
Return a decorator which will parse a gerber file before running the test.
def use_file(filename): def decorator(test_method): """ Add params to decorator function. """ @wraps(test_method) def wrapper(self): """ Parse file then run test. """ parser = Gerber(ignore_unknown=False) self.design = parser.parse(path.join(DIR, filenam...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def decorator(test_method):\n\n @wraps(test_method)\n def wrapper(self):\n \"\"\" Parse file then run test. \"\"\"\n parser = Gerber(ignore_unknown=False)\n self.design = parser.parse(path.join(DIR, filename))\n test_method(self)\n\n return wrapper",...
[ "0.7448634", "0.71167976", "0.59627867", "0.59301746", "0.5918239", "0.59080213", "0.58810973", "0.57334006", "0.56384057", "0.5625038", "0.55969214", "0.55764806", "0.5508951", "0.550502", "0.5491165", "0.5372833", "0.53668374", "0.53651786", "0.53651786", "0.52833706", "0.5...
0.7256232
1
Create an empty gerber parser.
def test_create_new_gerber_parser(self): parser = Gerber() assert parser != None
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_parser():\n pass", "def _make_parser(self):\n return DefusedExpatParser()", "def __init__(self, parser=None):", "def __init__(self):\n print \"You asked for a Parser!\"", "def __parser__(self):\n return self", "def __init__(self, parser: Any = None):", "def test_gen_p...
[ "0.70855314", "0.686953", "0.63831055", "0.6263777", "0.61320263", "0.6107546", "0.60626626", "0.6037953", "0.59399813", "0.5923526", "0.5910576", "0.5903135", "0.5893762", "0.58550376", "0.57761353", "0.5761796", "0.5757238", "0.5713794", "0.5700876", "0.56808746", "0.567541...
0.7622803
0
The Modifier can evaluate expressions correctly.
def test_modifier(self): modif = Modifier('1.2') self.assertEqual(modif.evaluate({}), 1.2) modif = Modifier('$1') self.assertEqual(modif.evaluate({1:3.2}), 3.2) modif = Modifier('1+1') self.assertEqual(modif.evaluate({}), 2) modif = Modifier('3-1.5') self....
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _should_eval(self):\n return False", "def evaluate(compiled_expression):", "def evaluate(self):\n pass", "def evaluate(self):\n pass", "def eval(self):\n pass", "def eval(self):\n pass", "def eval(self):\n pass", "def evaluate(self) :\n pass", "d...
[ "0.6572281", "0.6568479", "0.65574527", "0.65574527", "0.64303815", "0.64303815", "0.64303815", "0.6407245", "0.6345367", "0.62577146", "0.6183484", "0.61799407", "0.61565596", "0.6149802", "0.61396885", "0.6117585", "0.6077628", "0.60701233", "0.6039489", "0.60292995", "0.60...
0.71497124
0
Trap coord preceding gerber format spec.
def test_coord_preceding_fs(self):
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def trace(self, coord01: np.ndarray) -> np.ndarray:\n rect = self.clip_rect()\n return (rect.position + coord01 * rect.size).astype(np.int)", "def frac11(self,lx,ly,lz):\n return str(self.coord[0]/lx*2)+'\\t'+str(self.coord[1]/ly*2)+'\\t'+str(self.coord[2]/lz*2)", "def _format_point(self, ...
[ "0.52641153", "0.5259147", "0.5174216", "0.5166887", "0.5154606", "0.514098", "0.51310825", "0.51202244", "0.51102793", "0.5103446", "0.50844723", "0.5079553", "0.507823", "0.50599504", "0.5053271", "0.5025921", "0.5018617", "0.4984303", "0.49542806", "0.4949716", "0.49197924...
0.61945975
0
Unsubscribe events for a callback.
def unsubscribe(callback): if callback in _subscribers: del _subscribers[callback]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def unsubscribe(self, callback: Callable) -> None:\n self.callbacks.discard(callback)", "def unsubscribe(self, event_type: typing.Type[typing.Any], callback: CallbackT[typing.Any]) -> None:", "def unsubscribe_callback(self, callback, sensor):\n if sensor in self._callbacks:\n self._cal...
[ "0.84749424", "0.8190403", "0.79367375", "0.7856983", "0.7775709", "0.7710769", "0.7495644", "0.7495644", "0.7495644", "0.7495644", "0.7495644", "0.74490726", "0.74136734", "0.73761433", "0.72853684", "0.72737384", "0.72261065", "0.72020453", "0.7193984", "0.71859956", "0.718...
0.85581386
0
Calculate mean of role/token embeddings for a node.
def _mean_vec(self, node) -> Tuple[np.array, int]: tokens = [t for t in chain(node.token, ("RoleId_%d" % role for role in node.roles)) if t in self.emb] if not tokens: return None, 0 return np.mean([self.emb[t] for t in tokens], axis=0), len(tokens)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def compute_mean(self):\n # load_in_all_parameters(self.save_directory, self.auto_encoder)\n for i, data_row in enumerate(self.X_train_naive):\n input_nn = data_row\n if torch.cuda.is_available():\n input_nn = Variable(torch.Tensor(np.asarray(input_nn).reshape(1, ...
[ "0.6682953", "0.6198933", "0.6104026", "0.61020845", "0.606138", "0.59226686", "0.59124076", "0.5786445", "0.5759134", "0.57552254", "0.57463694", "0.5732782", "0.572047", "0.57162076", "0.5711725", "0.5707686", "0.5694124", "0.56877744", "0.5685827", "0.567916", "0.567916", ...
0.7650001
0
Convert UAST into feature and label arrays. Had to be defined outside of RolesMLP so that we don't suppply `self` twice.
def _process_uast(self, filename: str) -> Tuple[np.array, np.array]: X, y = [], [] uast_model = UASTModel().load(filename) for uast in uast_model.uasts: child_vecs, parent_vecs = self._mean_vecs(uast) for node, node_idx in node_iterator(uast): child_vec = child_vecs[node_idx] ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _convert_to_features(self, img: np.ndarray) -> np.ndarray:", "def convert_examples_to_features(tokens_set, labels_set, max_seq_length, tokenizer):\r\n\r\n #label_map = {label: i for i, label in enumerate(label_list, 1)}\r\n\r\n input_ids, input_masks, segment_ids, labels = [], [], [], []\r\n for ind...
[ "0.5990265", "0.568541", "0.55585814", "0.5532058", "0.54721767", "0.54471904", "0.54443514", "0.5410015", "0.5367583", "0.5366209", "0.53495264", "0.5344927", "0.5325683", "0.53237617", "0.53112566", "0.5272182", "0.52613175", "0.5252806", "0.52363384", "0.5218285", "0.52105...
0.6829204
0
on_load is called when a objects is instantiated from database
def on_load(self): self.__init__()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def on_load(self):\n pass", "def on_load(self):\n pass", "def postLoad(self):\n pass", "def on_load(self):", "def __init_on_load__(self):", "def _post_load(self):\n pass", "def on_loaded(self, func):\n self._on_loaded_funcs.append(func)", "def onInit(self):\n p...
[ "0.77701694", "0.77701694", "0.74983925", "0.7490084", "0.7307622", "0.71171945", "0.6513983", "0.6450546", "0.64347255", "0.6360762", "0.63267064", "0.6259976", "0.6241833", "0.6180361", "0.61745167", "0.6063532", "0.6045345", "0.6027878", "0.6021052", "0.60068715", "0.59551...
0.7820616
0
Return column number of first zombie in row.
def first_zombie_col(self, row_num): row = self.board[row_num] for col_num, square in enumerate(row): if any(self.is_zombie([row_num, col_num])): return col_num
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_colnumber(self, header):\n for i in range(0, len(self.data)):\n if self.data[i][0] == header:\n return i\n return None", "def row(self):\n\t\tif self._parent != None:\n\t\t\treturn self._parent._children.index(self)\n\t\telse:\n\t\t\treturn 0", "def get_rownumber...
[ "0.6535265", "0.6504764", "0.6361898", "0.6265344", "0.6231301", "0.62140507", "0.61831784", "0.61463916", "0.61094284", "0.6089981", "0.60148174", "0.60148174", "0.60148174", "0.60148174", "0.5994073", "0.5961097", "0.59416634", "0.59152573", "0.5907639", "0.5887093", "0.588...
0.7976616
0
Removes an item from it's 2D location on the board.
def del_item(self, item): index = self.board[item.pos[0]][item.pos[1]].index(item) del self.board[item.pos[0]][item.pos[1]][index]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def delItem(self,row,column):\n data = self.data\n if row in data and column in data[row]:\n del data[row][column]\n self.hasChanged = True", "def remove_item(self, idx_of_item):\n del self.items[idx_of_item]", "def remove(self, item) -> None:\n entry = self.en...
[ "0.7109872", "0.7100431", "0.6982199", "0.6915672", "0.6915672", "0.689267", "0.68600845", "0.6831838", "0.67709464", "0.67571646", "0.67114854", "0.66505504", "0.6625568", "0.6608895", "0.6597562", "0.65652883", "0.6518909", "0.6506016", "0.6490994", "0.6490032", "0.64801955...
0.834085
0
Randomly add new Zombie to board
def spawn(self): new_zombie_lvl = random.randint(0, min(self.level, 3)) _ = Zombie(new_zombie_lvl, [random.randint(0, 4), 99], self.board) self.zombie_spawn_delay = random.randint(*self.zombie_spawn_delay_range)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def new_tile(self):\r\n rand_x = random.randrange(self.width)\r\n rand_y = random.randrange(self.height)\r\n while self.get_tile(rand_y, rand_x) != 0:\r\n rand_x = random.randrange(self.width)\r\n rand_y = random.randrange(self.height)\r\n value = random.choice([2,...
[ "0.6850253", "0.6792333", "0.67741394", "0.6765152", "0.67399603", "0.6598132", "0.6563493", "0.6486989", "0.6478938", "0.6375682", "0.6322192", "0.62981117", "0.62190646", "0.6154359", "0.6128631", "0.61138046", "0.6106024", "0.60815513", "0.60446703", "0.6044434", "0.600304...
0.73000026
0
If there is a Sun at a position, convert it to player gold.
def try_collecting(self, event): sun_list = [i for i in self.board[event.pos] if isinstance(i, Sun)] if sun_list: sun_list[0].collected = True self.player.gold += Sun.gold self.ev_manager.post(events.SunCollected(self.player.gold))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def checkSun(ontology_sun):\n elevation = ontology_sun.has_elevation[0] #gets the elevation value of the Sun in the ontology. \n azimuth = ontology_sun.has_azimuth[0] #gets the azimuth value of the Sun in the ontology. \n intensity = ontology_sun.has_intensity[0] #gets the intensity value of the Sun in th...
[ "0.5345387", "0.5232973", "0.51683986", "0.5097628", "0.5020059", "0.48194417", "0.47753277", "0.47593406", "0.46944553", "0.46863693", "0.4672161", "0.46698081", "0.4665255", "0.46307704", "0.46187636", "0.45967177", "0.45949432", "0.45921183", "0.45918754", "0.45915216", "0...
0.5606547
0
Initialize the Salesforce location strategies 'text' and 'title' plus any strategies registered by other keyword libraries
def initialize_location_strategies(self): locator_manager.register_locators("sf", lex_locators) locator_manager.register_locators("text", "Salesforce.Locate Element by Text") locator_manager.register_locators("title", "Salesforce.Locate Element by Title") # This does the work of actuall...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def InitStrategy(self, sname, strategy):\n\n self._string = sname\n\n self.strategy = strategy\n self.postracker = position.PositionTracker(self.strategy)", "def __init__(self):\r\n\t\tself.label = \"Linked Data Spatial Query\"\r\n\t\tself.description = \"Get geographic features from wikidat...
[ "0.6045109", "0.57539535", "0.5687557", "0.5604759", "0.5474559", "0.54511374", "0.5398299", "0.5344921", "0.5298376", "0.5295734", "0.5262278", "0.52585125", "0.52350414", "0.5218184", "0.5204428", "0.5204428", "0.5204428", "0.5204428", "0.5204428", "0.5204428", "0.5204428",...
0.77248496
0
Set the locale for fake data This sets the locale for all calls to the ``Faker`` keyword and ``${faker}`` variable. The default is en_US For a list of supported locales see
def set_faker_locale(self, locale): try: self._faker = faker.Faker(locale) except AttributeError: raise Exception(f"Unknown locale for fake data: '{locale}'")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def setLocale(self, value):\n return self._set(locale=value)", "def set_locale_de():\n try:\n if platform.system() == \"Windows\":\n locale.setlocale(locale.LC_ALL, \"German\")\n else:\n locale.setlocale(locale.LC_ALL, \"de_DE.utf8\")\n except locale.Error:\n ...
[ "0.6244255", "0.623005", "0.62105423", "0.62015533", "0.6130801", "0.60855186", "0.6064039", "0.587886", "0.5830364", "0.5727264", "0.5697302", "0.5605824", "0.5514231", "0.543558", "0.5397802", "0.5365363", "0.5353766", "0.5340136", "0.52725", "0.52648044", "0.52474874", "...
0.7908526
0
Call the Create Webdriver keyword. Retry on connection resets which can happen if custom domain propagation is slow.
def create_webdriver_with_retry(self, *args, **kwargs): # Get selenium without referencing selenium.driver which doesn't exist yet selenium = self.builtin.get_library_instance("SeleniumLibrary") for _ in range(12): try: return selenium.create_webdriver(*args, **kwargs...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _create_driver(self, config):\n raise NotImplementedError(\"Must override WebAccess::_create_driver.\")", "def _instantiate_driver(self) -> webdriver:\n\n if self.driver is None: return Browser.run_chromedriver()\n\n return self.driver", "def create_driver(self, random_proxy, login):\n...
[ "0.6135514", "0.5874731", "0.5788318", "0.57601655", "0.55990976", "0.55637485", "0.55528617", "0.55183816", "0.5475551", "0.54655373", "0.5433355", "0.53960615", "0.53960615", "0.53876483", "0.535044", "0.53414094", "0.53316253", "0.53288877", "0.529636", "0.52818716", "0.52...
0.73880607
0
Scrolls down until the specified related list loads.
def load_related_list(self, heading): locator = lex_locators["record"]["related"]["card"].format(heading) el = None i = 0 while el is None: i += 1 if i > 50: raise AssertionError( "Timed out waiting for {} related list to load."...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def scroll_to_end_by_class_name(driver, class_name, number_requested):\r\n eles = driver.find_elements_by_class_name(class_name)\r\n count = 0\r\n new_count = len(eles)\r\n\r\n while new_count != count:\r\n try:\r\n utils.update_progress(new_count / number_requested, f' - Scrolling...
[ "0.5779658", "0.55728656", "0.5540163", "0.55229944", "0.5462364", "0.5460338", "0.5396183", "0.5335078", "0.53216785", "0.527404", "0.524986", "0.5238928", "0.5187637", "0.51747584", "0.51492304", "0.51451564", "0.51219696", "0.5107789", "0.5088162", "0.5058758", "0.5033915"...
0.71188396
0
Clicks a button in the heading of a related list. Waits for a modal to open after clicking the button.
def click_related_list_button(self, heading, button_title): self.load_related_list(heading) locator = lex_locators["record"]["related"]["button"].format( heading, button_title ) self._jsclick(locator) self.wait_until_modal_is_open()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def click_modal_button(self, title):\n locator = lex_locators[\"modal\"][\"button\"].format(title)\n self.selenium.wait_until_page_contains_element(locator)\n self.selenium.wait_until_element_is_enabled(locator)\n self._jsclick(locator)", "def click_button(self):\n self.q(css='...
[ "0.7189076", "0.6988168", "0.6578444", "0.656465", "0.65359074", "0.6386164", "0.6233494", "0.61503845", "0.61457515", "0.6088066", "0.60567385", "0.5973108", "0.5930721", "0.5856589", "0.5836955", "0.57845676", "0.57726026", "0.575332", "0.57077295", "0.56876504", "0.5687377...
0.7815718
0
Clicks a link in the related list with the specified heading. This keyword will automatically call Wait until loading is complete.
def click_related_item_link(self, heading, title): self.load_related_list(heading) locator = lex_locators["record"]["related"]["link"].format(heading, title) try: self._jsclick(locator) except Exception as e: self.builtin.log(f"Exception: {e}", "DEBUG") ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def click_related_item_popup_link(self, heading, title, link):\n self.load_related_list(heading)\n locator = lex_locators[\"record\"][\"related\"][\"popup_trigger\"].format(\n heading, title\n )\n\n self.selenium.wait_until_page_contains_element(locator)\n self._jsclic...
[ "0.7736881", "0.7507538", "0.71692616", "0.60561264", "0.57515484", "0.56041235", "0.5319994", "0.53053665", "0.52839065", "0.527617", "0.5163625", "0.51312894", "0.51164484", "0.5106151", "0.5098942", "0.504578", "0.5043064", "0.49847758", "0.4957203", "0.4951363", "0.493011...
0.82479006
0
Clicks a link in the popup menu for a related list item. heading specifies the name of the list, title specifies the name of the item, and link specifies the name of the link
def click_related_item_popup_link(self, heading, title, link): self.load_related_list(heading) locator = lex_locators["record"]["related"]["popup_trigger"].format( heading, title ) self.selenium.wait_until_page_contains_element(locator) self._jsclick(locator) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def click_related_item_link(self, heading, title):\n self.load_related_list(heading)\n locator = lex_locators[\"record\"][\"related\"][\"link\"].format(heading, title)\n try:\n self._jsclick(locator)\n except Exception as e:\n self.builtin.log(f\"Exception: {e}\", ...
[ "0.74758106", "0.6553461", "0.6115421", "0.6080586", "0.5914096", "0.5731324", "0.57025373", "0.5691324", "0.5634803", "0.55465114", "0.5527079", "0.5513927", "0.55018294", "0.5477213", "0.5428236", "0.5418471", "0.54158795", "0.5388323", "0.53676933", "0.53380686", "0.533078...
0.82255656
0
Closes the open modal
def close_modal(self): locator = lex_locators["modal"]["close"] self._jsclick(locator)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _close(self, event):\n self.EndModal(wx.ID_OK)", "def onBtnCloseClicked(self):\n self.close()", "def click_close_modal_content_button(self):\n self._basket.click_close_modal_content_button()", "def close(self):\n\n\t\tself._window.close()", "def close(self, **kwargs):\n if s...
[ "0.7485135", "0.71692693", "0.7112385", "0.7063925", "0.67974085", "0.677635", "0.670848", "0.67019016", "0.66175354", "0.6605917", "0.65781903", "0.6553257", "0.65518093", "0.6550994", "0.65053326", "0.6490589", "0.64872533", "0.6476808", "0.6416838", "0.6399266", "0.6394791...
0.838349
0
Deletes records that were created while running this test case. (Only records specifically recorded using the Store Session Record keyword are deleted.)
def delete_session_records(self): self._session_records.reverse() self.builtin.log("Deleting {} records".format(len(self._session_records))) for record in self._session_records[:]: self.builtin.log(" Deleting {type} {id}".format(**record)) try: self.sales...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_delete_records(self):\n pass", "def delete_record(records):\n delete_record()", "def delete_test_data(session_maker):\n\n orm_session = session_maker()\n orm_session.query(USERS).filter(USERS.username.like('%test%')).delete(synchronize_session=False)\n orm_session.query(USER_POSTS)....
[ "0.7481224", "0.7373201", "0.7205428", "0.69691026", "0.6664302", "0.65132904", "0.64798975", "0.64461666", "0.64307034", "0.639961", "0.63823223", "0.6344583", "0.6338384", "0.633812", "0.6276203", "0.62057465", "0.6177603", "0.6175238", "0.6172349", "0.61712223", "0.6158834...
0.80059433
0
Return the id of all open browser ids
def get_active_browser_ids(self): # This relies on some private data structures, but presently # there is no other way. There's been a discussion in the # robot slack channels about adding a new keyword that does # what this keyword does. When that happens, we can remove # this ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_ids(self):\n page = r.get(self.url)\n tree = html.fromstring(page.content)\n ids_elements = tree.xpath(\"//div[@id='selectedcontent']/div/ul/li/a\")\n return [self._e_to_id(e) for e in ids_elements]", "def getIDs():", "def getAllWindowHandles(self):\n cmdId = self.executeCommand(Comm...
[ "0.6569217", "0.628429", "0.62061906", "0.6202266", "0.58726", "0.5845237", "0.58393615", "0.5779246", "0.5755626", "0.57022905", "0.56826526", "0.56637734", "0.5652637", "0.56374764", "0.5617484", "0.5593592", "0.5584265", "0.5559799", "0.5544296", "0.55259955", "0.5506343",...
0.71545905
0
Parses the current url to get the object id of the current record.
def get_current_record_id(self): url = self.selenium.get_location() for part in url.split("/"): oid_match = re.match(OID_REGEX, part) if oid_match is not None: return oid_match.group(2) raise AssertionError("Could not parse record id from url: {}".format(u...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_id(self, url):\n return url.split('/')[-1]", "def obj_id(self) -> int:\n return int(self.index.split(\"/\")[-1]) if self.index else None", "def getOID(self, selfURL):\n\n selfURL_path = urlsplit(selfURL).path\n oID = Path(selfURL_path).name\n try:\n r = int...
[ "0.7274164", "0.7020472", "0.6777252", "0.6688561", "0.6602918", "0.6407275", "0.635892", "0.63425964", "0.6307531", "0.6288161", "0.6233897", "0.6204031", "0.619106", "0.61868566", "0.6139848", "0.6139848", "0.6139848", "0.6139848", "0.6139848", "0.6139848", "0.6139848", "...
0.7598501
0
Return the current value of a form field based on the field label
def get_field_value(self, label): input_element_id = self.selenium.get_element_attribute( "xpath://label[contains(., '{}')]".format(label), "for" ) value = self.selenium.get_value(input_element_id) return value
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getValue(self):\n return self.field.currentText()", "def getValue(self):\n return self.field.text()", "def field(self):\r\n return self.value", "def get_field_value(self, field_name):\n if field_name in self.fields.keys():\n return self.fields[field_name]\n e...
[ "0.6556248", "0.65483963", "0.6508708", "0.64794666", "0.63468665", "0.6334696", "0.63046134", "0.62998545", "0.629518", "0.6286994", "0.62621415", "0.6250413", "0.6250221", "0.6250221", "0.6250221", "0.6250221", "0.6246163", "0.6246163", "0.61561424", "0.6147392", "0.6099475...
0.80294776
0
Returns a rendered locator string from the Salesforce lex_locators dictionary. This can be useful if you want to use an element in a different way than the built in keywords allow.
def get_locator(self, path, *args, **kwargs): locator = lex_locators for key in path.split("."): locator = locator[key] return locator.format(*args, **kwargs)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_locator(locator_text: str, locator_type: str = \"id\") -> tuple:\n locator = locator_type.upper()\n return getattr(By, locator), locator_text", "def __str__(self):\n return 'Token({type}, {lexema})'.format(\n type= tokenNames[self.type],\n lexema=self.lexema\n )"...
[ "0.4768227", "0.46713182", "0.45936868", "0.44802696", "0.4458644", "0.44231966", "0.43998763", "0.43943584", "0.43852997", "0.43272206", "0.43175244", "0.42806837", "0.42482546", "0.42070994", "0.42069843", "0.4188468", "0.41546643", "0.4154236", "0.4147403", "0.41430965", "...
0.5943993
0
Returns the Record Type Id for a record type name
def get_record_type_id(self, obj_type, developer_name): soql = "SELECT Id FROM RecordType WHERE SObjectType='{}' and DeveloperName='{}'".format( obj_type, developer_name ) res = self.cumulusci.sf.query_all(soql) return res["records"][0]["Id"]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __get_type_id(record: TNSRecord) -> int:\n return ObjectType.get_or_create(record.type or 'Unknown').id", "def get_id(type_: Dict[str, str]) -> int:\n return int(type_[f'{type_name}_id'])", "def _type_str(self):\n try:\n record_name = RECORD_TYPES[self.type]\n ...
[ "0.7928146", "0.7352052", "0.7027344", "0.700802", "0.6797513", "0.6752316", "0.67234236", "0.66540086", "0.6632991", "0.6545357", "0.64484364", "0.64434844", "0.64428693", "0.6408364", "0.64009094", "0.63250935", "0.63191825", "0.6295935", "0.62649363", "0.6245594", "0.62261...
0.77214324
1
Returns the number of items indicated for a related list.
def get_related_list_count(self, heading): locator = lex_locators["record"]["related"]["count"].format(heading) count = self.selenium.get_webelement(locator).text count = count.replace("(", "").replace(")", "") return int(count)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def count_items(self):\n count = 0\n for o in self.order_lst:\n count += o.count()\n \n return count", "def get_num_items(self):\r\n return self.num_items", "def items_num(self):\n\t\treturn len(self.items)", "def items_num(self):\n\t\treturn len(self.items)"...
[ "0.74805504", "0.7285734", "0.69391817", "0.69391817", "0.6899637", "0.6876357", "0.68688875", "0.68223625", "0.68114096", "0.67848015", "0.67558473", "0.6744843", "0.67436016", "0.6710305", "0.66789955", "0.6653826", "0.6590316", "0.6518359", "0.6511388", "0.6493154", "0.648...
0.75440687
0
Navigates to the Home view of a Salesforce Object
def go_to_object_home(self, obj_name): url = self.cumulusci.org.lightning_base_url url = "{}/lightning/o/{}/home".format(url, obj_name) self.selenium.go_to(url) self.wait_until_loading_is_complete(lex_locators["actions"])
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _go_to_page(self):\n self.salesforce.go_to_setup_home()\n self.eda.wait_for_new_window(\"Home | Salesforce\")\n self.selenium.switch_window(\"Home | Salesforce\")\n self.salesforce.wait_until_loading_is_complete()", "def go_to_record_home(self, obj_id):\n url = self.cumulus...
[ "0.72055185", "0.6643557", "0.65994006", "0.65149677", "0.6487298", "0.6410646", "0.6332935", "0.63148344", "0.6233376", "0.6232684", "0.6230519", "0.61904204", "0.61904204", "0.61904204", "0.6159019", "0.6148358", "0.6115426", "0.6086321", "0.6041018", "0.60313743", "0.60254...
0.7644369
0
Navigates to the Home tab of Salesforce Setup
def go_to_setup_home(self): url = self.cumulusci.org.lightning_base_url self.selenium.go_to(url + "/lightning/setup/SetupOneHome/home") self.wait_until_loading_is_complete()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _go_to_page(self):\n self.salesforce.go_to_setup_home()\n self.eda.wait_for_new_window(\"Home | Salesforce\")\n self.selenium.switch_window(\"Home | Salesforce\")\n self.salesforce.wait_until_loading_is_complete()", "def home(self):\n self.goto(0, 0)", "def go_home(self):...
[ "0.8230737", "0.71648955", "0.70775753", "0.70246947", "0.7019923", "0.7007859", "0.67817223", "0.67309695", "0.6720572", "0.6715987", "0.6700127", "0.6590666", "0.65675294", "0.6565556", "0.65384", "0.65323144", "0.630954", "0.6259082", "0.62556046", "0.6235437", "0.6228942"...
0.7788175
1
Navigates to the Object Manager tab of Salesforce Setup
def go_to_setup_object_manager(self): url = self.cumulusci.org.lightning_base_url self.selenium.go_to(url + "/lightning/setup/ObjectManager/home") self.wait_until_loading_is_complete()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _go_to_page(self):\n self.salesforce.go_to_setup_home()\n self.eda.wait_for_new_window(\"Home | Salesforce\")\n self.selenium.switch_window(\"Home | Salesforce\")\n self.salesforce.wait_until_loading_is_complete()", "def go_to_object_home(self, obj_name):\n url = self.cumul...
[ "0.70036185", "0.6478363", "0.5637787", "0.55917794", "0.5564666", "0.5546104", "0.5476443", "0.54016584", "0.5381777", "0.5281001", "0.5279266", "0.52702373", "0.52061206", "0.5108897", "0.50760114", "0.50358033", "0.5031218", "0.5030932", "0.5012035", "0.4993091", "0.498590...
0.79498047
0