query
stringlengths
9
3.4k
document
stringlengths
9
87.4k
metadata
dict
negatives
listlengths
4
101
negative_scores
listlengths
4
101
document_score
stringlengths
3
10
document_rank
stringclasses
102 values
initialize the MarketSegment instance
def __init__(self, name, accounts=None): self.name = name if accounts: self._accounts = accounts for account in accounts: # add_account_to_ms is False because we've already added the # account to this segment, don't want to do it again ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def construct_segment(self):\n segment = Segment(\n model_id = self.model_id,\n chain_id = self.chain_id)\n\n segment.chain = self.chain\n segment.model = self.model\n\n return segment", "def construct_segment(self):\n segment = Segment(\n model...
[ "0.6190421", "0.6095966", "0.60732186", "0.5757404", "0.5754233", "0.5752619", "0.57325923", "0.5704366", "0.5683267", "0.5670845", "0.56523126", "0.56402427", "0.56402427", "0.5637231", "0.563603", "0.5632467", "0.56236625", "0.56236625", "0.56236625", "0.56236625", "0.56236...
0.5701224
8
provide functionality to associate an account with the market segment Raises ValueError if the market segment already knows about the account
def add_account(self, account, add_ms_to_account=True): # check if name already exists and throw ValueError if it does # it doesn't make sense to add an account twice -- this could be # refactored to use a set instead # check for accounts by name per Q2 bonus below if accoun...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def put_account(self, account):\n \n pass", "def associate_member_account(memberAccountId=None):\n pass", "def add_account(insert_dict):\n return ar.add_account(insert_dict)", "def add_account(self, account):\n self.accounts[account.account_number] = account.json()\n # We sh...
[ "0.6881962", "0.6379945", "0.6314283", "0.6247812", "0.614936", "0.614936", "0.6070196", "0.6060519", "0.60320276", "0.59797066", "0.5976318", "0.58752096", "0.586902", "0.5846821", "0.5827182", "0.5821246", "0.57961375", "0.5756492", "0.5755137", "0.5746932", "0.57255113", ...
0.6542094
1
disassociate the account from this MarketSegment
def remove_account(self, account, remove_ms_from_account=True): # check for accounts by name per Q2 bonus below if account.name in [account.name for account in self._accounts]: self._accounts.remove(account) if remove_ms_from_account: account.remove_from_mark...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def disassociate_member_account(memberAccountId=None):\n pass", "def delete_account(self, account):\n \n pass", "def delete_account(self):\n Credential.account_list.remove(self)", "def remove_from_market_segment(self, market_segment):\r\n if market_segment in self._market_segme...
[ "0.72093874", "0.6797859", "0.6363812", "0.6213715", "0.6171504", "0.6040757", "0.5929909", "0.58401936", "0.5739876", "0.56988853", "0.5573408", "0.5563919", "0.5554293", "0.5497242", "0.54905313", "0.5477191", "0.54696035", "0.5433291", "0.54182625", "0.5360094", "0.5357016...
0.63674426
2
get the accounts associated with this MarketSegment
def get_accounts(self): return self._accounts
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_accounts(self):\n return self.accounts", "def accounts(self):\n return self._accounts.values()", "def get_accounts(self):\n return self.accounts.all()", "def get_accounts(self):\n\n\t\treturn self.__accounts", "def accounts(self):\r\n return acc.Accounts(self)", "def G...
[ "0.7349792", "0.7301584", "0.7274265", "0.72648835", "0.69971514", "0.69915533", "0.6787148", "0.67281044", "0.6724366", "0.6685089", "0.6642747", "0.6617825", "0.6611883", "0.6562705", "0.65290934", "0.6513251", "0.650435", "0.64825416", "0.6427938", "0.6316828", "0.62958187...
0.7285145
2
setup this instance of Account
def __init__(self, name, sales_rep=None, market_segments=None): self.name = name self._sales_rep = sales_rep self._children = [] if market_segments: self._market_segments = market_segments for market_segment in market_segments: # add_ms_to_a...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self, account, user_username, user_password):\n self. account = account\n self. user_username = user_username\n self.user_password = user_password", "def __init__(self,Account,username,password):\n self.Account = Account\n self.username = username\n self.pas...
[ "0.7074514", "0.6964193", "0.69499296", "0.69038534", "0.6841956", "0.6841956", "0.6841956", "0.6841956", "0.68143064", "0.6808298", "0.6769417", "0.6767063", "0.67506003", "0.6694272", "0.66941416", "0.66868305", "0.6663654", "0.66210026", "0.6554672", "0.6512321", "0.650264...
0.0
-1
get the sales rep assocated to this Account
def get_sales_rep(self): return self._sales_rep
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def sales_rep_code(self):\n return self._sales_rep_code", "def get_sales_data():\n print(\"Retrieving all the sales information...\")\n data = SHEET.worksheet('sales')\n print(\"Compilation complete!\\n\")\n return data", "def get_sales(res=None, user_email=None, user_role=None, user_id=None...
[ "0.60808676", "0.59343404", "0.5843296", "0.58057", "0.5775382", "0.57279", "0.5499945", "0.5478197", "0.5337665", "0.53167444", "0.53152895", "0.5267397", "0.5243935", "0.52410465", "0.52232355", "0.52158624", "0.52153754", "0.52091914", "0.5116701", "0.5112952", "0.511263",...
0.7881946
0
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
get the list of children (if any) for this account
def get_children(self): return self._children
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_children(self):\n return self.children", "def get_children(self):\n return self.children", "def get_children(self):\n return self.children", "def get_children(self):\r\n return self.children", "def get_children(self):\n return []", "def get_children(self):\n\n ...
[ "0.7708436", "0.7708436", "0.7708436", "0.7692462", "0.75784594", "0.75485694", "0.7512054", "0.7490745", "0.74791145", "0.7350118", "0.7291376", "0.7291189", "0.7266678", "0.7260878", "0.7260878", "0.72332436", "0.7230133", "0.7148525", "0.709136", "0.7063422", "0.7047157", ...
0.7514173
6
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
not functionaly needed, but was used for debugging purposes, prints a simple one line representation of an account, but no children
def print_account(account): markets_output = "" for market in account.get_market_segments(): markets_output += market.name.strip("\'") + ", " markets_output = markets_output.strip("\'") print(f'{account.name} ({markets_output[:-2]}): {account.get_sales_rep()}')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def print_tree(account, level=0):\r\n \"\"\" In the example output below, \"GE\" is the root account, \"Jet Engines\"\r\n and \"Appliances\" are first-degree ChildAccounts, and \"DoD Contracts\"\r\n and \"Washing Machines\" are second-degree ChildAccounts.\r\n\r\n > print_tree(general_electric)...
[ "0.6965512", "0.68350005", "0.6194999", "0.61706173", "0.61338204", "0.60519546", "0.59987116", "0.5957116", "0.5939303", "0.5916133", "0.5865019", "0.5812702", "0.58114535", "0.57372445", "0.5722173", "0.5700545", "0.56958437", "0.5687173", "0.5681779", "0.5672956", "0.56630...
0.6467906
2
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
validation is in eval mode so we do not have to use placeholder input tensors
def validation_step(self, batch, batch_idx): src_batch, trg_batch = batch src_seq = src_batch["src_ids"] # change from [batch, seq_len] -> to [seq_len, batch] src_seq = src_seq.transpose(0, 1) src_lengths = src_batch["src_lengths"] trg_seq = trg_batch["trg_ids"] ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def linear_eval(train_ds, model, task, epochs=10, eval_ds=None):\n\n print('==========LINEAR EVAL==========')\n\n # Filter out undesired examples with excluded_label\n ds = train_ds.filter(lambda x: x['label'] != task['excluded_label'])\n ds = ds.map(data_utils.finetune_preprocess)\n ds = ds.shuffle...
[ "0.71973443", "0.7176972", "0.71241623", "0.7115858", "0.697105", "0.6960811", "0.67767024", "0.67586493", "0.6738238", "0.66192645", "0.6600604", "0.65923727", "0.65843695", "0.65088737", "0.65082693", "0.6502381", "0.6492778", "0.649229", "0.6491189", "0.64898956", "0.64866...
0.0
-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
Check distribution of variable This function accepts a dataframe,column(feature) and value which returns count of the value, containing the value counts of a variable(value_counts)
def clear(df,col,val): value_counts=df[col][df[col]==val].count() return value_counts
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def value_frequencies(df, column):\n\n df_val = pd.DataFrame(df[column].value_counts())\n df_val = df_val.rename(columns={column: \"Count\"})\n df_val[\"Frequency\"] = df_val[\"Count\"] / len(df) * 100\n return df_val", "def obj_value_counts(df):\n df_obj = obj_df(df)\n for col in df_obj.column...
[ "0.6731079", "0.6531181", "0.6249982", "0.6218801", "0.61668086", "0.61371034", "0.6032908", "0.59703606", "0.59183574", "0.5821373", "0.5811538", "0.5804806", "0.58035743", "0.5792839", "0.5758376", "0.57148397", "0.5679529", "0.5673475", "0.5659964", "0.5651597", "0.5651446...
0.5627474
21
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
Parsing arguments for mix
def arg_parse(): parser = argparse.ArgumentParser() parser.add_argument("-m", "--mix", required=False, help="cube shuffle") parser.add_argument("-e", "--explain", action="store_true", help="Get more explanation about steps") options = parser.parse_args() return options
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def parse_arguments(args):", "def _parse_args(self, prepared_args):\n pass", "def Args(parser):", "def __parse_args(self):\n for argument in self.args:\n source_arg = re.match(\"^(--source=(([A-Z]|[a-z]|/|_|[0-9]|.)+))$\", argument)\n input_arg = re.match(\"^(--input=(([A-...
[ "0.78351986", "0.68100625", "0.6781909", "0.67647475", "0.6632456", "0.6620455", "0.6572196", "0.64941555", "0.64838773", "0.64729136", "0.6428082", "0.63948846", "0.6353774", "0.6346599", "0.6345576", "0.63345915", "0.62920505", "0.62681496", "0.6227157", "0.6197175", "0.615...
0.6168493
20
Append a list after a first one
def append_list(lst_moves, to_add): for elem in to_add: lst_moves.append(elem) return lst_moves
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_first(self, value):\n self.__list = [value] + self.__list\n return self.__list", "def mutate_list_2(lst):\r\n elem = lst[0]\r\n lst.remove(elem)\r\n lst.append(elem)\r\n return lst", "def following(lst, content):\n if content not in lst:\n return lst\...
[ "0.6928934", "0.6246745", "0.61780196", "0.6156932", "0.60925907", "0.6074251", "0.60594547", "0.6018385", "0.6012113", "0.5947313", "0.5900258", "0.5896534", "0.5895668", "0.58403456", "0.5837394", "0.5836771", "0.5824726", "0.5822811", "0.581092", "0.5789515", "0.5787964", ...
0.0
-1
Dump the population spike histogram values.
def dump_psth_peaks(ffname, outprefix, celltype, window=100e-3, binwidth=5e-3): with open('{}_psth_{}_{}ms_window_{}ms_bins.csv'.format(outprefix, celltype, window*1e3, binwidth*1e3), 'wb') as fd: writer = csv.writer(fd, delimiter=',', quotechar='"', quoting=csv.QUOTE_MINIMAL) dbcnt_flist = get_dbcn...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _printHist(self):\n bins = [0] * self.displayBins\n binSize = self.maxValue / self.displayBins\n displaySamps = self.samples[:]\n displaySamps.sort()\n currLimit = binSize\n binIndex = 0\n partIndex = 0\n while partIndex < self.numParticles:\n ...
[ "0.6207578", "0.61337715", "0.61337715", "0.58234936", "0.5786558", "0.5634706", "0.559509", "0.5576539", "0.55664545", "0.5549734", "0.5505678", "0.54868907", "0.54738015", "0.54414207", "0.54130095", "0.5407913", "0.5359929", "0.53546023", "0.5333307", "0.53166544", "0.5276...
0.57270867
5
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
Encode each string and check the encoding match
def isIsomorphic(s: str, t: str) -> bool: def encode(s): m = {} r = [] for char in s: if char not in m: m[char] = len(m) # increasing index r.append(m[char]) return str(r) return encode(s) == encode(t)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def encode(self, strs):", "def encode(self, strs):", "def test_encode(self):\n for (input, output) in self.tests:\n self.assertEqual(input.encode('imap4-utf-7'), output)", "def test_encode(self):\n pass # TODO(tlarsen)", "def test_encode(self):\n assert url_encoder.encode(1...
[ "0.74811256", "0.74811256", "0.7096132", "0.68377566", "0.6790453", "0.66363806", "0.66236377", "0.64748406", "0.6461136", "0.64332485", "0.6391071", "0.6373295", "0.6354942", "0.6241875", "0.6189024", "0.60329634", "0.60249454", "0.60169256", "0.60166717", "0.5977058", "0.59...
0.0
-1
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
Small rise/decay factors = more smoothing.
def __init__(self, val=0.0, alpha_decay=0.5, alpha_rise=0.5): assert 0.0 < alpha_decay < 1.0, 'Invalid decay smoothing factor.' assert 0.0 < alpha_rise < 1.0, 'Invalid rise smoothing factor.' self.alpha_decay = alpha_decay self.alpha_rise = alpha_rise self.value = val
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def lr_decay(step):\n return(alpha / (1 + decay_rate * step))", "def step_decay(epoch):\n initial_lrate = 0.1\n drop = 0.5\n epochs_drop = 10.0\n lrate = initial_lrate * math.pow(drop, math.floor((1 + epoch) / epochs_drop))\n # print(f\"For epoch {epoch}, Learning rate is {lrate}\")...
[ "0.6954242", "0.65860534", "0.65200704", "0.64522135", "0.64373386", "0.63609886", "0.62818044", "0.62043864", "0.62007785", "0.61982685", "0.6193027", "0.6169785", "0.6165778", "0.60895914", "0.6014151", "0.60004514", "0.59806603", "0.5980432", "0.5980153", "0.5978049", "0.5...
0.6290513
6
Returns melfrequency from linear frequency input. Parameter
def hertz_to_mel(self, freq): return 3340.0 * log(1 + (freq / 250.0), 9)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def mel_to_linear(frequency):\n return 700.0 * (np.exp(frequency / 1127.01048) - 1.0)", "def linear_to_mel(frequency):\n return 1127.01048 * np.log(1.0 + frequency / 700.0)", "def hz2mel(freq):\n return 2595. * np.log10(1+freq/700.0)", "def hertz_to_mel(freq):\n return 2595.0 * np.log10(1 + (freq...
[ "0.76702917", "0.7321775", "0.68783236", "0.6760246", "0.67551947", "0.6675257", "0.656555", "0.6558269", "0.6518677", "0.64406323", "0.64313215", "0.6396839", "0.6381468", "0.63540506", "0.6313718", "0.62764466", "0.6267781", "0.62511164", "0.6245195", "0.6216545", "0.620624...
0.6451159
9
Returns frequency from melfrequency input. Parameter
def mel_to_hertz(self, mel): # return 700.0 * (10**(mel / 2595.0)) - 700.0 return 250.0 * (9**(mel / 3340.0)) - 250.0
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def mils_to_freq(m):\n f = root_pitch['freq']*(2**(float(m)/12000))\n return f;", "def get_frequency(self):\r\n x = self.query('FREQ?')\r\n if x == None: return None\r\n return float(x)", "def get_frequency(self):\r\n return self.f", "def get_frequency(self,):\n\n # T...
[ "0.75639445", "0.7534624", "0.7385637", "0.73301536", "0.73017204", "0.7286359", "0.72039306", "0.7162466", "0.70660377", "0.7038995", "0.699193", "0.6963527", "0.6956162", "0.69514066", "0.6950115", "0.69422483", "0.69422483", "0.693355", "0.6926402", "0.69149095", "0.689017...
0.0
-1
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
Returns tranformation matrix for mel spectrum.
def compute_melmat(self, num_mel_bands=12, freq_min=64, freq_max=8000, num_fft_bands=513, sample_rate=16000): center_frequencies_mel, lower_edges_mel, upper_edges_mel = self.melfrequencies_mel_filterbank( num_mel_bands, freq_min, freq_max, n...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def galactic_to_MS():\n return MS_MATRIX", "def get_mmt():\r\n # M^T\r\n MT = np.array([[-1, 0, 0, 0, 0, 0, 0, 0, 0],\r\n [1, -1, 0, 0, 0, 0, 0, 0, 0],\r\n [0, 1, -1, 0, 0, 0, 0, 0, 0],\r\n [0, 0, 1, -1, 0, 0, 0, 0, 0],\r\n [0, 0, 0...
[ "0.6515063", "0.6490616", "0.62550807", "0.6227506", "0.61941767", "0.6173798", "0.6162595", "0.60898507", "0.6087107", "0.6067081", "0.6044572", "0.60382694", "0.60369337", "0.5993462", "0.5985377", "0.59686816", "0.59636563", "0.59495574", "0.59419054", "0.59140086", "0.590...
0.5764735
35
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
Parses a list of events coming from the Slack RTM API to find bot commands. If a bot command is found, this function returns a tuple of command and metadata. If its not found, then this function returns None, None.
def parse_slack_events(slack_events): for event in slack_events: # Filter out certain event types from processing if not event["type"] in FILTERED_OUT_TYPES: debug_print(event) else: return None, None if "thread_ts" in event: ts = event["thread_ts...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def parse_bot_commands(self, slack_events):\n for event in slack_events:\n if event[\"type\"] == \"message\" and not \"subtype\" in event:\n user_mention_id = event[\"user\"]\n user_id, message = self.parse_direct_mention(event[\"text\"])\n if user_id ...
[ "0.8044932", "0.7913969", "0.7892265", "0.78835857", "0.78828436", "0.78828436", "0.78828436", "0.7862449", "0.78439045", "0.78184825", "0.78069913", "0.77614725", "0.7707438", "0.76585907", "0.7584151", "0.73585355", "0.6172453", "0.5843227", "0.5842778", "0.56936514", "0.55...
0.6041835
17
Finds a direct mention (a mention that is at the beginning) in message text and returns the user ID which was mentioned. If there is no direct mention, returns None
def parse_direct_mention(message_text): matches = re.search(MENTION_REGEX, message_text) # the first group contains the username, the second group contains the remaining message return (matches.group(1), matches.group(2).strip()) if matches else (None, message_text.strip())
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def parse_direct_mention(message_text):\n # print(message_text)\n matches = re.search(MENTION_REGEX, message_text)\n # the first group contains the username, the second group contains the remaining message\n return (matches.group(1), matches.group(2).strip()) if matches else (None, None)", "def parse...
[ "0.7675584", "0.75857246", "0.75798297", "0.7578862", "0.7578862", "0.7578862", "0.7578862", "0.7578862", "0.75755507", "0.7573656", "0.7557076", "0.75313705", "0.7441656", "0.7441656", "0.74106026", "0.7318277", "0.6749996", "0.6414793", "0.6312242", "0.6284745", "0.61999404...
0.7393453
15
Executes bot command if the command is known
def handle_command(command, metadata): # Default response is help text for the user default_response = "Not sure what you mean, <@{}>. Try *{}*.".format(metadata["user"], HELP_COMMAND) # Finds and executes the given command, filling in response response = None # Check command for FAQ keywords ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async def command(self,ctx):\n await ctx.send(\"Yes this is a command.\")", "def execute_command(command):\r\n if 0 == len(command):\r\n return\r\n\r\n if command[0] in verbs[\"move\"]:\r\n if len(command) <= 1:\r\n wrap_print(\"go where?\")\r\n else:\r\n e...
[ "0.6752725", "0.6617937", "0.6585033", "0.6455056", "0.6425135", "0.63927513", "0.6379973", "0.63771737", "0.6358033", "0.6303008", "0.6302788", "0.62746096", "0.6264084", "0.6260362", "0.62486637", "0.6201165", "0.61963415", "0.61851525", "0.610484", "0.6103936", "0.60957456...
0.5844225
69
Tries to determine whether or not a user's message was a question
def is_question(text): debug_print("Checking whether or not a question may have been asked.") matches = re.search(QUESTION_REGEX, text) debug_print(matches) return True if matches else False
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_question(self, message):\n text = message.split(' ')\n\n # get first word of message\n first_word = text[0]\n # get punctuation\n last_word = text[-1][-1]\n\n if first_word in self.question_words or last_word == '?':\n return True\n\n return False"...
[ "0.73923194", "0.71005785", "0.6917321", "0.6764823", "0.67535037", "0.66870314", "0.65741295", "0.64395905", "0.63611084", "0.6324428", "0.63240397", "0.63166153", "0.6299855", "0.6289322", "0.6237072", "0.62319136", "0.62239546", "0.6112465", "0.60908455", "0.607894", "0.60...
0.6410361
8
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
Track all active conversations to pay attention to, and the users involved
def add_conversation(timestamp, user): if timestamp not in ACTIVE_CONVS: debug_print("Adding a new conversation.") ACTIVE_CONVS[timestamp] = [user] elif user not in ACTIVE_CONVS[timestamp]: debug_print("Adding a new user to an active conversation.") ACTIVE_CONVS[timestamp].append...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_conversations(self):\n\t\treturn self.conversations", "def _track_changes(self):\n if self.untrack is False:\n self._event._track_changes.add('attendees')", "def _track_changes(self):\n if self._untrack is False:\n self._event._track_changes.add('attendees')", "def...
[ "0.6539912", "0.615764", "0.6152658", "0.6038521", "0.56193143", "0.5527705", "0.5492615", "0.54740167", "0.5429275", "0.53827566", "0.5335242", "0.53251374", "0.52755463", "0.523182", "0.51911193", "0.5188668", "0.5188668", "0.51720464", "0.5113954", "0.5103253", "0.5097042"...
0.5973918
4
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
Convert this cell to a GDSII structure.
def to_gds(self, outfile, multiplier, timestamp=None): now = datetime.datetime.today() if timestamp is None else timestamp name = self.name if len(name) % 2 != 0: name = name + "\0" outfile.write( struct.pack( ">2H12h2H", 28, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def to_gds(self, multiplier):\n name = self.ref_cell.name\n if len(name) % 2 != 0:\n name = name + '\\0'\n data = struct.pack('>4h', 4, 0x0B00, 4 + len(name),\n 0x1206) + name.encode('ascii')\n x2 = self.origin[0] + self.columns * self.spacing[0]\n ...
[ "0.5743448", "0.55482465", "0.5329714", "0.53122056", "0.5224355", "0.51896095", "0.51736516", "0.5092857", "0.5088674", "0.5064377", "0.50071204", "0.500253", "0.50019735", "0.49925599", "0.49596334", "0.49314463", "0.4929408", "0.49142188", "0.49131197", "0.4898506", "0.484...
0.0
-1
Create a copy of this cell.
def copy( self, name, deep_copy=False, translation=None, rotation=None, scale=None, x_reflection=False, ): new_cell = Cell(name) transform = False if ( x_reflection or scale is not None or rotation i...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def copy(self) -> 'Cell':\n new = Cell(self.letter)\n new.player = self.player\n return new", "def copy( self ):\n New = grid(self.data, self.xllcorner, self.yllcorner, self.cellsize, 'copy-'+self.name, self.nodata)\n return New", "def clone(self):\n return self.__clas...
[ "0.80293596", "0.7913326", "0.723684", "0.71645653", "0.7103887", "0.7075638", "0.70546645", "0.7012738", "0.69686186", "0.6943324", "0.6937548", "0.69350106", "0.691416", "0.69072473", "0.6888141", "0.68730575", "0.68714637", "0.6865083", "0.68622196", "0.67918915", "0.67897...
0.0
-1
Add a new element or list of elements to this cell.
def add(self, element): if isinstance(element, PolygonSet): self.polygons.append(element) elif isinstance(element, RobustPath) or isinstance(element, FlexPath): self.paths.append(element) elif isinstance(element, Label): self.labels.append(element) eli...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add(self, element):\n pass", "def __add__(self, element):\r\n self.elements += element", "def add(self, element):\n self.elements.append(element)", "def add(self, elem):", "def add(self, elem):", "def add(self, value):\n if self._element_type is None:\n self._el...
[ "0.74574184", "0.72338164", "0.7212446", "0.7192821", "0.7192821", "0.7062606", "0.70556116", "0.7030372", "0.7027625", "0.69985175", "0.6966767", "0.69208795", "0.69156504", "0.68597394", "0.68459696", "0.68118167", "0.6810868", "0.6800404", "0.6760612", "0.6732799", "0.6712...
0.72297215
2
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
Calculate the total area of the elements on this cell, including cell references and arrays.
def area(self, by_spec=False): if by_spec: cell_area = {} for element in itertools.chain(self.polygons, self.paths, self.references): element_area = element.area(True) for ll in element_area.keys(): if ll in cell_area: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getArea(self):\r\n return np.sum(self.array[:])", "def total_area(self):\n return numpy.prod([r[1] - r[0] for r in self.range_])", "def area(self, by_spec=False):\n if by_spec:\n cell_area = {}\n for element in self.elements:\n element_area = elemen...
[ "0.77725315", "0.7599504", "0.75269383", "0.7497039", "0.74537677", "0.74429333", "0.7378315", "0.72832215", "0.72520405", "0.72520405", "0.72520405", "0.72520405", "0.7251096", "0.72318023", "0.72269714", "0.72177047", "0.72038364", "0.7172168", "0.7172168", "0.7172168", "0....
0.71954083
17
Return the set of layers in this cell. Returns
def get_layers(self): layers = set() for element in itertools.chain(self.polygons, self.paths): layers.update(element.layers) for reference in self.references: layers.update(reference.ref_cell.get_layers()) for label in self.labels: layers.add(label.la...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def layers(self):\n return self['layers']", "def layers(self):\r\n return self._flc.layers", "def getLayers(self):\n return self.__layers", "def get_layers(self):\n layers = set()\n for element in self.elements:\n if isinstance(element, PolygonSet):\n ...
[ "0.84161794", "0.82297456", "0.81984156", "0.8153201", "0.7760602", "0.76984745", "0.7670736", "0.72703713", "0.72165895", "0.70526385", "0.7021822", "0.6928826", "0.6922886", "0.6842713", "0.6831845", "0.6688635", "0.66676366", "0.6658537", "0.653411", "0.64305663", "0.63962...
0.80953765
4
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
Calculate the bounding box for this cell. Returns
def get_bounding_box(self): deps_still_valid = all(ref._bb_valid for ref in self.get_dependencies(True)) cached_bbox_still_valid = self._bb_valid and deps_still_valid if not cached_bbox_still_valid: bb = numpy.array(((1e300, 1e300), (-1e300, -1e300))) all_polygons = [] ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def boundingBox(self):\n minx, miny, maxx, maxy = self.substrates.bounds\n return pcbnew.BOX2I(\n pcbnew.VECTOR2I(int(minx), int(miny)),\n pcbnew.VECTOR2I(int(maxx - minx), int(maxy - miny)))", "def bounding_box(self):\n if self.bbox is None:\n self.bbox = bo...
[ "0.8207344", "0.81806314", "0.81806314", "0.81616205", "0.81508523", "0.79829717", "0.7957958", "0.7862182", "0.78247416", "0.7819618", "0.7802205", "0.779639", "0.77903897", "0.77657527", "0.77332604", "0.77099425", "0.7704747", "0.7704747", "0.769051", "0.7675328", "0.76556...
0.7544387
28
Return a list of polygons in this cell.
def get_polygons(self, by_spec=False, depth=None): if depth is not None and depth < 0: if not (by_spec is False or by_spec is True): return [] bb = self.get_bounding_box() if bb is None: return {} if by_spec else [] pts = [ ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def polygons(self):\n if self.type == 'Polygon':\n polygons = [self._geojson['geometry']['coordinates']]\n elif self.type == 'MultiPolygon':\n polygons = self._geojson['geometry']['coordinates']\n return [ [ [_lat_lons_from_geojson(s) for\n s in...
[ "0.7842987", "0.76190424", "0.73368305", "0.7279502", "0.6892845", "0.6884992", "0.6835661", "0.68140286", "0.68037516", "0.67662233", "0.67419845", "0.6739774", "0.6721229", "0.6649941", "0.66383916", "0.6628559", "0.6622653", "0.65800583", "0.6566426", "0.65041685", "0.6502...
0.64592654
22
Return a list with a copy of the polygons in this cell.
def get_polygonsets(self, depth=None): polys = libcopy.deepcopy(self.polygons) if depth is None or depth > 0: for reference in self.references: if depth is None: next_depth = None else: next_depth = depth - 1 ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def polygons(self):\n if self.type == 'Polygon':\n polygons = [self._geojson['geometry']['coordinates']]\n elif self.type == 'MultiPolygon':\n polygons = self._geojson['geometry']['coordinates']\n return [ [ [_lat_lons_from_geojson(s) for\n s in...
[ "0.7547947", "0.7316596", "0.73041594", "0.72470206", "0.71213", "0.69343984", "0.69169277", "0.6749382", "0.6697183", "0.6661932", "0.6661799", "0.6660124", "0.66348714", "0.6583003", "0.6507498", "0.6500448", "0.6467257", "0.63483876", "0.6324975", "0.63218826", "0.6321436"...
0.6666862
9
Return a list with a copy of the paths in this cell.
def get_paths(self, depth=None): paths = libcopy.deepcopy(self.paths) if depth is None or depth > 0: for reference in self.references: if depth is None: next_depth = None else: next_depth = depth - 1 path...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def paths(self):\n rc = []\n for pg in self.path_groups:\n rc.extend(pg.paths)\n return rc", "def get_paths(self, depth=None):\n if not isinstance(self.ref_cell, Cell):\n return []\n if self.origin is not None:\n trans = numpy.array(self.origin)...
[ "0.75346977", "0.7523623", "0.7383267", "0.7332678", "0.7327889", "0.7327294", "0.7296684", "0.7296684", "0.72939926", "0.7270774", "0.72187763", "0.70349467", "0.7021971", "0.70194846", "0.69415885", "0.69395256", "0.6937619", "0.6858513", "0.6819688", "0.67919797", "0.67910...
0.64189625
35
Return a list with a copy of the labels in this cell.
def get_labels(self, depth=None, set_transform=False): labels = libcopy.deepcopy(self.labels) if depth is None or depth > 0: for reference in self.references: if depth is None: next_depth = None else: next_depth = depth ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def labels(self) -> list:\n return self._labels", "def get_labels(self):\n return []", "def labels(self):\n return self._labels", "def get_labels(self) -> List[str]:\n return self.labels", "def list_of_labels(self):\n L = np.unique(self.box_label)\n return np.union1d(L...
[ "0.7925544", "0.789087", "0.77288866", "0.77160776", "0.7671561", "0.762041", "0.7586169", "0.7586169", "0.7586169", "0.7586169", "0.7586169", "0.7586169", "0.7457129", "0.7432928", "0.7426808", "0.73899865", "0.7378445", "0.73713386", "0.7368412", "0.72897375", "0.7285032", ...
0.0
-1
Return a set of the cells included in this cell as references.
def get_dependencies(self, recursive=False): dependencies = set() for reference in self.references: if isinstance(reference.ref_cell, Cell): if recursive: dependencies.update(reference.ref_cell.get_dependencies(True)) dependencies.add(refer...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def references(self) -> \"IterableList[Reference]\":\n return Reference.list_items(self)", "def get_references(self):\n\n return self._refs", "def get_references(self):\n return self._references", "def referencing_nodes(self):\n\n return self._referencing_nodes", "def refere...
[ "0.6819724", "0.6730786", "0.6708101", "0.66307276", "0.65374833", "0.64513767", "0.64364344", "0.6364836", "0.6364836", "0.6356147", "0.6325696", "0.6325696", "0.62790745", "0.62559783", "0.62235403", "0.62235177", "0.6222344", "0.6185836", "0.6093392", "0.602159", "0.601182...
0.6488647
5
Convert all references into polygons, paths and labels.
def flatten(self, single_layer=None, single_datatype=None, single_texttype=None): self.labels = self.get_labels() if single_layer is not None and single_datatype is not None: for lbl in self.labels: lbl.layer = single_layer lbl.texttype = single_texttype ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _process_references0(self, references):\n if \"zarr_consolidated_format\" in references:\n # special case for Ike prototype\n references = _unmodel_hdf5(references)\n self.references = references", "def generatePolygons():", "def _export_reference_representations(self):\...
[ "0.5647293", "0.5646024", "0.5635338", "0.5630123", "0.55962205", "0.5404384", "0.54007363", "0.53235346", "0.526006", "0.5224974", "0.5224784", "0.5187493", "0.5183223", "0.51739013", "0.51446986", "0.5121586", "0.5110074", "0.5085551", "0.5060123", "0.50405365", "0.5003779"...
0.52513164
9
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
Export this cell to an SVG file. The dimensions actually written on the GDSII file will be the dimensions of the objects created times the ratio unit/precision. For example, if a circle with radius 1.5 is created and we set `GdsLibrary.unit` to 1.0e6 (1 um) and `GdsLibrary.precision` to 1.0e9` (1 nm), the radius of the...
def write_svg( self, outfile, scaling=10, style=None, fontstyle=None, background="#222", pad="5%", precision=None, ): bb = self.get_bounding_box() if bb is None: return close = True if hasattr(outfile, "__fsp...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def to_svg(self, outfile, scaling, precision, attributes):\n outfile.write('<g id=\"')\n outfile.write(self.name.replace(\"#\", \"_\"))\n outfile.write('\" ')\n outfile.write(attributes)\n outfile.write(\">\\n\")\n for polygon in self.polygons:\n polygon.to_svg(...
[ "0.7521533", "0.7285852", "0.71931106", "0.6398051", "0.6342033", "0.631223", "0.62910724", "0.6230578", "0.6223311", "0.6193851", "0.6173615", "0.6173615", "0.61700886", "0.6163268", "0.60564893", "0.60334575", "0.602575", "0.60175425", "0.6004667", "0.59768134", "0.59603375...
0.68822676
3
Convert this object to a GDSII element.
def to_gds(self, outfile, multiplier): if isinstance(self.ref_cell, Cell): name = self.ref_cell.name else: name = self.ref_cell if len(name) % 2 != 0: name = name + "\0" outfile.write(struct.pack(">4H", 4, 0x0A00, 4 + len(name), 0x1206)) outfil...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def toXML(self):\n return _libsbml.GraphicalObject_toXML(self)", "def toGML(self):\n raise NotImplementedError", "def __str__(self):\n return str(self.element)", "def __repr__(self):\n return (\n f\"<Element: {self.name}, symbol: {self.symbol}, \"\n f\"atomic...
[ "0.5857224", "0.5810739", "0.543184", "0.5416807", "0.5341295", "0.5325705", "0.5284019", "0.5283045", "0.52636915", "0.522651", "0.522556", "0.52075106", "0.51756334", "0.51669174", "0.5161292", "0.51580524", "0.5128812", "0.51284176", "0.5080394", "0.50741917", "0.50666416"...
0.0
-1
Write an SVG fragment representation of this object.
def to_svg(self, outfile, scaling, precision): if isinstance(self.ref_cell, Cell): name = self.ref_cell.name else: name = self.ref_cell transform = "translate({} {})".format( numpy.format_float_positional( scaling * self.origin[0], trim="0", pr...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def to_svg(self, outfile, scaling, precision, attributes):\n outfile.write('<g id=\"')\n outfile.write(self.name.replace(\"#\", \"_\"))\n outfile.write('\" ')\n outfile.write(attributes)\n outfile.write(\">\\n\")\n for polygon in self.polygons:\n polygon.to_svg(...
[ "0.678781", "0.64034855", "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.551035...
0.62927806
2
Calculate the total area of the referenced cell with the magnification factor included.
def area(self, by_spec=False): if not isinstance(self.ref_cell, Cell): return dict() if by_spec else 0 if self.magnification is None: return self.ref_cell.area(by_spec) else: if by_spec: factor = self.magnification ** 2 cell_are...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def area(self, by_spec=False):\n if not isinstance(self.ref_cell, Cell):\n return dict() if by_spec else 0\n if self.magnification is None:\n factor = self.columns * self.rows\n else:\n factor = self.columns * self.rows * self.magnification**2\n if by_sp...
[ "0.7243287", "0.7239991", "0.7231403", "0.70159674", "0.6785667", "0.6785667", "0.6785667", "0.6785667", "0.6748671", "0.67300946", "0.6710924", "0.6710924", "0.6710924", "0.66895485", "0.66840756", "0.6652378", "0.66498977", "0.6617837", "0.66032726", "0.6585019", "0.6581661...
0.72300845
3
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
Return the list of polygons created by this reference.
def get_polygons(self, by_spec=False, depth=None): if not isinstance(self.ref_cell, Cell): return dict() if by_spec else [] polygons = self.ref_cell.get_polygons(by_spec, depth) return self._transform_polygons(polygons)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def polygons(self):\n if self.type == 'Polygon':\n polygons = [self._geojson['geometry']['coordinates']]\n elif self.type == 'MultiPolygon':\n polygons = self._geojson['geometry']['coordinates']\n return [ [ [_lat_lons_from_geojson(s) for\n s in...
[ "0.7791119", "0.762329", "0.74445224", "0.71422297", "0.7099408", "0.70776516", "0.7035478", "0.68038243", "0.67995584", "0.67361677", "0.66761684", "0.66194516", "0.6583179", "0.6582501", "0.6552869", "0.6534296", "0.6519639", "0.6498464", "0.6493398", "0.64807975", "0.64200...
0.6444032
20
Return the list of polygons created by this reference.
def get_polygonsets(self, depth=None): if not isinstance(self.ref_cell, Cell): return [] 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: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def polygons(self):\n if self.type == 'Polygon':\n polygons = [self._geojson['geometry']['coordinates']]\n elif self.type == 'MultiPolygon':\n polygons = self._geojson['geometry']['coordinates']\n return [ [ [_lat_lons_from_geojson(s) for\n s in...
[ "0.7792467", "0.7624696", "0.74459255", "0.71419406", "0.70993507", "0.70769495", "0.70361227", "0.68006146", "0.6737182", "0.6677578", "0.66189504", "0.65839696", "0.6583549", "0.65531653", "0.6534705", "0.652067", "0.6500624", "0.6494521", "0.6480914", "0.64441115", "0.6418...
0.68033767
7
Return the list of paths created by this reference.
def get_paths(self, depth=None): if not isinstance(self.ref_cell, Cell): return [] if self.origin is not None: trans = numpy.array(self.origin) else: trans = None if self.rotation is not None: rot = self.rotation * numpy.pi / 180.0 ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_paths(self):\n return self.paths", "def paths(self):\r\n return self._paths", "def GetPaths(self):\n return self.paths", "def paths(self):\n return self._paths", "def paths(self):\n return self._paths", "def path(self) -> List[Path]:\n return self._path",...
[ "0.8311262", "0.8302748", "0.8254829", "0.8254413", "0.8254413", "0.81395245", "0.7954077", "0.79534584", "0.7673039", "0.7611283", "0.7585028", "0.75215286", "0.7484188", "0.7440461", "0.7438975", "0.7435275", "0.73708534", "0.73636985", "0.73252803", "0.7296981", "0.7265272...
0.67454743
39
Return the list of labels created by this reference.
def get_labels(self, depth=None, set_transform=False): if not isinstance(self.ref_cell, Cell): return [] 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_reflecti...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def labels(self) -> list:\n return self._labels", "def get_labels(self) -> List[str]:\n return self.labels", "def get_labels(self):\n return []", "def get_labels(self) -> List[str]:\n raise NotImplementedError()", "def labels(self):\n return self._labels", "def labels(self)...
[ "0.8515524", "0.8482789", "0.84210205", "0.84087145", "0.8233267", "0.82061845", "0.82061845", "0.82061845", "0.82061845", "0.82061845", "0.82061845", "0.81545305", "0.7964697", "0.7921453", "0.7915286", "0.7915286", "0.7915286", "0.7915286", "0.7915286", "0.7915286", "0.7915...
0.0
-1
Calculate the bounding box for this reference. Returns
def get_bounding_box(self): if not isinstance(self.ref_cell, Cell): return None if self.rotation is None or self.rotation % 90 == 0: cell_bbox = self.ref_cell.get_bounding_box() if cell_bbox is None: return None polygons = self._transform_...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_bounding_box(self):\n deps_still_valid = all(ref._bb_valid for ref in self.get_dependencies(True))\n cached_bbox_still_valid = self._bb_valid and deps_still_valid\n if not cached_bbox_still_valid:\n bb = numpy.array(((1e300, 1e300), (-1e300, -1e300)))\n all_polygo...
[ "0.8494973", "0.8335019", "0.8335019", "0.8331231", "0.8283461", "0.8235353", "0.8215106", "0.8186653", "0.81768817", "0.8176806", "0.81503516", "0.8050574", "0.7977073", "0.7914641", "0.7886893", "0.78447485", "0.7824194", "0.7816102", "0.78095555", "0.775125", "0.7634715", ...
0.8022996
12
Convert this object to a GDSII element.
def to_gds(self, outfile, multiplier): if isinstance(self.ref_cell, Cell): name = self.ref_cell.name else: name = self.ref_cell if len(name) % 2 != 0: name = name + "\0" outfile.write(struct.pack(">4H", 4, 0x0B00, 4 + len(name), 0x1206)) outfil...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def toXML(self):\n return _libsbml.GraphicalObject_toXML(self)", "def toGML(self):\n raise NotImplementedError", "def __str__(self):\n return str(self.element)", "def __repr__(self):\n return (\n f\"<Element: {self.name}, symbol: {self.symbol}, \"\n f\"atomic...
[ "0.58556783", "0.58110946", "0.5431924", "0.5416439", "0.5339593", "0.5323014", "0.52841514", "0.5283188", "0.5260789", "0.5224168", "0.5223884", "0.5206834", "0.51746875", "0.5171212", "0.51643103", "0.5156278", "0.5127905", "0.5125808", "0.5079717", "0.507325", "0.50696474"...
0.0
-1
Write an SVG fragment representation of this object.
def to_svg(self, outfile, scaling, precision): if isinstance(self.ref_cell, Cell): name = self.ref_cell.name else: name = self.ref_cell transform = "translate({} {})".format( numpy.format_float_positional( scaling * self.origin[0], trim="0", pr...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def to_svg(self, outfile, scaling, precision, attributes):\n outfile.write('<g id=\"')\n outfile.write(self.name.replace(\"#\", \"_\"))\n outfile.write('\" ')\n outfile.write(attributes)\n outfile.write(\">\\n\")\n for polygon in self.polygons:\n polygon.to_svg(...
[ "0.678781", "0.64034855", "0.62927806", "0.6089161", "0.6064701", "0.60599434", "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.551035...
0.60150325
6
Calculate the total area of the cell array with the magnification factor included.
def area(self, by_spec=False): if not isinstance(self.ref_cell, Cell): return dict() if by_spec else 0 if self.magnification is None: factor = self.columns * self.rows else: factor = self.columns * self.rows * self.magnification ** 2 if by_spec: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def calculatearea(self):\r\n return self.width * self.height", "def area(self, by_spec=False):\n if not isinstance(self.ref_cell, Cell):\n return dict() if by_spec else 0\n if self.magnification is None:\n factor = self.columns * self.rows\n else:\n fa...
[ "0.7014719", "0.6929633", "0.68529356", "0.68506974", "0.67594755", "0.667792", "0.663422", "0.663422", "0.663422", "0.663422", "0.65729547", "0.6572029", "0.6572029", "0.6572029", "0.65689194", "0.656555", "0.65610254", "0.65354156", "0.6515844", "0.65145904", "0.6505233", ...
0.6924989
2
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
Return the list of polygons created by this reference.
def get_polygons(self, by_spec=False, depth=None): if not isinstance(self.ref_cell, Cell): return dict() if by_spec else [] cell_polygons = self.ref_cell.get_polygons(by_spec, depth) return self._transform_polygons(cell_polygons)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def polygons(self):\n if self.type == 'Polygon':\n polygons = [self._geojson['geometry']['coordinates']]\n elif self.type == 'MultiPolygon':\n polygons = self._geojson['geometry']['coordinates']\n return [ [ [_lat_lons_from_geojson(s) for\n s in...
[ "0.7792467", "0.7624696", "0.74459255", "0.71419406", "0.70993507", "0.70769495", "0.70361227", "0.68033767", "0.68006146", "0.6737182", "0.6677578", "0.66189504", "0.65839696", "0.6583549", "0.65531653", "0.6534705", "0.652067", "0.6500624", "0.6494521", "0.6480914", "0.6444...
0.6368692
23
Return the list of polygons created by this reference.
def get_polygonsets(self, depth=None): if not isinstance(self.ref_cell, Cell): return [] 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: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def polygons(self):\n if self.type == 'Polygon':\n polygons = [self._geojson['geometry']['coordinates']]\n elif self.type == 'MultiPolygon':\n polygons = self._geojson['geometry']['coordinates']\n return [ [ [_lat_lons_from_geojson(s) for\n s in...
[ "0.7791119", "0.762329", "0.74445224", "0.71422297", "0.7099408", "0.70776516", "0.7035478", "0.68038243", "0.67995584", "0.67361677", "0.66761684", "0.6583179", "0.6582501", "0.6552869", "0.6534296", "0.6519639", "0.6498464", "0.6493398", "0.64807975", "0.6444032", "0.642005...
0.66194516
11
Return the list of paths created by this reference.
def get_paths(self, depth=None): if not isinstance(self.ref_cell, Cell): return [] if self.origin is not None: trans = numpy.array(self.origin) else: trans = None if self.rotation is not None: rot = self.rotation * numpy.pi / 180.0 ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_paths(self):\n return self.paths", "def paths(self):\r\n return self._paths", "def GetPaths(self):\n return self.paths", "def paths(self):\n return self._paths", "def paths(self):\n return self._paths", "def path(self) -> List[Path]:\n return self._path",...
[ "0.8309927", "0.8301452", "0.8253446", "0.8253089", "0.8253089", "0.81387806", "0.79529196", "0.7952184", "0.76709217", "0.7609567", "0.7583138", "0.7520623", "0.74843603", "0.7439155", "0.74380785", "0.7434079", "0.73696697", "0.7361946", "0.73235893", "0.72955364", "0.72640...
0.65511405
48
Return the list of labels created by this reference.
def get_labels(self, depth=None, set_transform=False): if not isinstance(self.ref_cell, Cell): return [] 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.magnificat...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def labels(self) -> list:\n return self._labels", "def get_labels(self) -> List[str]:\n return self.labels", "def get_labels(self):\n return []", "def get_labels(self) -> List[str]:\n raise NotImplementedError()", "def labels(self):\n return self._labels", "def labels(self)...
[ "0.8516112", "0.84839594", "0.8422236", "0.84098774", "0.8234229", "0.8206628", "0.8206628", "0.8206628", "0.8206628", "0.8206628", "0.8206628", "0.8155338", "0.7965425", "0.7922409", "0.79160345", "0.79160345", "0.79160345", "0.79160345", "0.79160345", "0.79160345", "0.79160...
0.0
-1
Calculate the bounding box for this reference. Returns
def get_bounding_box(self): if not isinstance(self.ref_cell, Cell): return None if self.rotation is None or self.rotation % 90 == 0: cell_bbox = self.ref_cell.get_bounding_box() if cell_bbox is None: return None polygons = self._transform_p...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_bounding_box(self):\n deps_still_valid = all(ref._bb_valid for ref in self.get_dependencies(True))\n cached_bbox_still_valid = self._bb_valid and deps_still_valid\n if not cached_bbox_still_valid:\n bb = numpy.array(((1e300, 1e300), (-1e300, -1e300)))\n all_polygo...
[ "0.8496508", "0.83368224", "0.83368224", "0.8332704", "0.8283734", "0.8235681", "0.8217295", "0.8187952", "0.81789", "0.81771076", "0.8152201", "0.8023084", "0.7978836", "0.7915937", "0.7889683", "0.7846862", "0.7826866", "0.7819128", "0.78119254", "0.77532214", "0.7636975", ...
0.8050689
11
Create a new cell and add it to this library.
def new_cell(self, name, overwrite_duplicate=False, update_references=True): cell = Cell(name) self.add(cell, False, overwrite_duplicate, update_references) return cell
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_cell(self, cid):\n self.cells[cid] = Cell()", "def createCell(self, xPos, yPos):\n self.cells.append(Cell(self.screen, xPos, yPos))", "def _create_cell(self,row_number,cell_number):\n cell = Cell(self)\n cell.x = cell_number * self.cell_width\n cell.y = row_number ...
[ "0.7582513", "0.740403", "0.7224304", "0.71756005", "0.70146143", "0.6870246", "0.6796258", "0.6674156", "0.6638308", "0.6601923", "0.65517443", "0.651863", "0.649863", "0.6458009", "0.6449549", "0.6430993", "0.6413602", "0.6393372", "0.6347527", "0.62470824", "0.6243126", ...
0.7377023
2
Add one or more cells to the library.
def add( self, cell, include_dependencies=True, overwrite_duplicate=False, update_references=True, ): if isinstance(cell, Cell): cell_set = set([cell]) if include_dependencies: cell_set.update(cell.get_dependencies(True)) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_cell(self, cell: Cell):\n\n self.cells.append(cell)", "def add_cells(self):\n # To delete all common cells\n self.delete_cells()\n if self.removed_last_bracket:\n new_lib = self.base_doc + self.cell_doc + '\\n}\\n'\n else:\n end_part = self.base_do...
[ "0.7153042", "0.70961", "0.69793475", "0.6639552", "0.65566367", "0.64485896", "0.64260375", "0.6350621", "0.63257134", "0.61614436", "0.59996146", "0.59594357", "0.5953101", "0.5933116", "0.5920777", "0.59127015", "0.58612245", "0.58154446", "0.5807713", "0.578784", "0.57434...
0.6412283
7
Remove a cell from the library.
def remove(self, cell, remove_references=True): if isinstance(cell, Cell): name = cell.name else: name = cell if name in self.cells: del self.cells[name] removed = 0 if remove_references: for c in self.cells.values(): ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _remove(self, cell_coord, o):\n cell = self.d[cell_coord]\n cell.remove(o)\n\n # Delete the cell from the hash if it is empty.\n if not cell:\n del(self.d[cell_coord])", "def remove_cell(self, cell: Cell):\r\n assert isinstance(cell, Cell)\r\n self.size -=...
[ "0.78183174", "0.78140616", "0.77669454", "0.7218418", "0.7174134", "0.69584143", "0.69113976", "0.6767365", "0.6658349", "0.66415673", "0.6636562", "0.6631602", "0.65876555", "0.6454404", "0.6416677", "0.6401591", "0.63443387", "0.6342481", "0.6337022", "0.6308937", "0.62808...
0.6749035
8
Write the GDSII library to a file. The dimensions actually written on the GDSII file will be the dimensions of the objects created times the ratio unit/precision. For example, if a circle with radius 1.5 is created and we set `GdsLibrary.unit` to 1.0e6 (1 um) and `GdsLibrary.precision` to 1.0e9` (1 nm), the radius of t...
def write_gds(self, outfile, cells=None, timestamp=None, binary_cells=None): close = True if hasattr(outfile, "__fspath__"): outfile = open(outfile.__fspath__(), "wb") elif isinstance(outfile, (basestring, Path)): outfile = open(outfile, "wb") else: cl...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def write_gds(outfile,\n cells=None,\n name='library',\n unit=1.0e-6,\n precision=1.0e-9):\n current_library.name = name\n current_library.unit = unit\n current_library.precision = precision\n current_library.write_gds(outfile, cells)", "def write(s...
[ "0.75257516", "0.7131023", "0.63836277", "0.59522474", "0.5937476", "0.58502436", "0.5809515", "0.5798301", "0.5789873", "0.57749695", "0.5767537", "0.57370085", "0.5711578", "0.5699197", "0.5641816", "0.5641022", "0.56182075", "0.5606908", "0.55280125", "0.5525817", "0.54929...
0.6201605
3
Read a GDSII file into this library.
def read_gds( self, infile, units="skip", rename={}, rename_template="{name}", layers={}, datatypes={}, texttypes={}, ): self._references = [] close = True if hasattr(infile, "__fspath__"): infile = open(infile.__fsp...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def read_file(file):\n if opts.input_type == 'fits':\n data = fileio.read_fits(file)\n else:\n data = fileio.read_ascii(file)\n c_id = data[0,:]\n g_num = np.array(range(len(c_id)), dtype = 'int')\n g_id = data[3,:]\n g_ra = np.array(data[4,:], dtype = 'float')\n g_dec = np.array...
[ "0.6245018", "0.616701", "0.6092572", "0.60005844", "0.5868339", "0.58612186", "0.5825995", "0.57988286", "0.57988286", "0.5784195", "0.57717836", "0.5764157", "0.57621366", "0.57600033", "0.5706241", "0.57049376", "0.570334", "0.56551987", "0.565489", "0.5630139", "0.5619926...
0.5549735
25
Output the top level cells from the GDSII data. Top level cells are those that are not referenced by any other cells. Returns
def top_level(self): top = set(self) for cell in self: top.difference_update(cell.get_dependencies()) return list(top)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def top_level(self):\n top = list(self.cell_dict.values())\n for cell in self.cell_dict.values():\n for dependency in cell.get_dependencies():\n if dependency in top:\n top.remove(dependency)\n return top", "def draw_open_cells(self):\n emp...
[ "0.6141585", "0.5927244", "0.56945705", "0.56243724", "0.5589779", "0.5477621", "0.5411163", "0.54090655", "0.5380761", "0.5363793", "0.53398967", "0.53345144", "0.5295822", "0.52840114", "0.5265799", "0.5230088", "0.5228775", "0.5225207", "0.52107006", "0.52086085", "0.52085...
0.5610892
4
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
Finalize the GDSII stream library.
def close(self): self._outfile.write(struct.pack(">2H", 4, 0x0400)) if self._close: self._outfile.close()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def finalize(self):\r\n self.stream.finalize()", "def finalize():", "def finalize():", "def finalize():", "def finalize(self):\n # 027 Not needed in the simple FilesAdaptor. \n pass", "def finalize(self):\r\n self.outfile_param.close()\r\n self.outfile_sim.close()", "...
[ "0.7394158", "0.6610522", "0.6610522", "0.6610522", "0.660409", "0.6511681", "0.641157", "0.63843083", "0.63843083", "0.63843083", "0.63843083", "0.63843083", "0.63843083", "0.6372242", "0.6350792", "0.6350792", "0.63461405", "0.63144404", "0.63144404", "0.6277247", "0.622790...
0.0
-1
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