query
stringlengths
10
2k
document
stringlengths
20
51.2k
metadata
dict
negatives
listlengths
0
101
negative_scores
listlengths
0
101
document_score
stringlengths
3
10
document_rank
stringclasses
102 values
Computes the product of the dimensions of a given shape tensor
def _product(shape): result = 1 for size in shape: result *= size return result
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def prod(tensor, axis=None):\n raise NotImplementedError", "def tensor_outer_product(tensor1, tensor2):\n shape_1 = tensor1.shape\n shape_2 = tensor2.shape\n s1 = len(shape_1)\n s2 = len(shape_2)\n \n shape_1 = shape_1 + (1, )*s2\n shape_2 = (1, )*s1 + shape_2\n return np.reshape(t...
[ "0.65110505", "0.6196526", "0.6171097", "0.61670285", "0.61670285", "0.6159431", "0.6142523", "0.6121647", "0.60397756", "0.60302424", "0.6011385", "0.5927092", "0.590197", "0.5897427", "0.5882737", "0.5847271", "0.5830619", "0.5792986", "0.5783287", "0.5706623", "0.57045895"...
0.7404119
0
Returns a tf.Distribution for given states.
def get_dist_and_mode(self, states): out = self.trunk(states) mu, log_std = tf.split(out, num_or_size_splits=2, axis=1) mode = tf.nn.tanh(mu) log_std = tf.nn.tanh(log_std) assert LOG_STD_MAX > LOG_STD_MIN log_std = LOG_STD_MIN + 0.5 * (LOG_STD_MAX - LOG_STD_MIN) * (log_std + 1) std = tf.ex...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def call(self, states):\n dist, mode = self.get_dist_and_mode(states)\n samples = dist.sample()\n log_probs = dist.log_prob(samples)\n log_probs = tf.expand_dims(log_probs, -1) # To avoid broadcasting\n return mode, samples, log_probs", "def action_distribution(self, state):\n means, stds ...
[ "0.67799294", "0.6370355", "0.62246716", "0.62237406", "0.62024516", "0.61189896", "0.5854602", "0.58404344", "0.57567334", "0.56690085", "0.5594553", "0.55793387", "0.5574866", "0.55643517", "0.55559874", "0.5539959", "0.5532283", "0.55226153", "0.5520528", "0.5513174", "0.5...
0.6830452
0
To reach one stair, we need to consider what the previous stair is. Since the child can hop either 1 step, 2 steps, or 3 steps. The previous stair could be either n1, n2, or n3. Since they are exclusive, the number of ways to reach stair n is decided by the sum of the number of ways to reach n1, n2 and n3. However, to ...
def triple_step_memoized(n, memo=None): if memo is None: return triple_step_memoized(n, {}) # base case if n < 0: return 0 elif n == 0: return 1 # memoized elif n in memo: return memo[n] # new else: memo[n] = triple_step_memoized(n-1, memo) + triple_step_memoized(n-2, memo) + triple_step_memoized(n-3...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def count_stair_ways(n):\n if n == 1:\n return 1\n if n == 2:\n return 2\n return count_stair_ways(n - 1) + count_stair_ways(n - 2)", "def num_of_ways(n):\n if n == 0 or n == 1:\n return 1\n \n n_minus_2_step = 1\n n_minus_1_step = 1\n n_step = None\n\n #num_of_way...
[ "0.60690415", "0.58901775", "0.5774715", "0.57442623", "0.5654154", "0.5492384", "0.54590374", "0.54282993", "0.54113114", "0.5352732", "0.5318543", "0.53013307", "0.52892417", "0.5288588", "0.52664965", "0.5253388", "0.5221138", "0.5196329", "0.5170921", "0.5167605", "0.5148...
0.75071913
0
virtual method to get global config.
def get_global_config(self, **kwargs): return {}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_config(cls) -> GlobalConfig:\n if cls.config is None:\n raise ValueError(\"Config is not loaded\")\n return cls.config", "def _get_config(self):\n return self.__config", "def _get_config(self):\n return self.__config", "def _get_config(self):\n return self.__config",...
[ "0.8245742", "0.81814957", "0.81814957", "0.81814957", "0.81814957", "0.81814957", "0.81814957", "0.81814957", "0.81814957", "0.81814957", "0.81814957", "0.81814957", "0.81814957", "0.81814957", "0.81814957", "0.81814957", "0.81814957", "0.81814957", "0.81814957", "0.81814957",...
0.8182843
1
Create a mapping in Tamr between input attributes and unified attributes of the given project.
def create( session: Session, project: Project, input_attribute: Attribute, unified_attribute: Attribute, ) -> AttributeMapping: data = { "relativeInputAttributeId": input_attribute.url.path, "relativeUnifiedAttributeId": unified_attribute.url.path, } r = session.post(url=str...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _to_user_model_attrs(self, data, attrs_map):\n user_attrs = {}\n for k, v in attrs_map.iteritems():\n attr = (v, data.get(k)) if isinstance(v, str) else v(data.get(k))\n user_attrs.setdefault(*attr)\n\n user_attrs.setdefault('server', 'All')\n user_attrs.setdefault('faction', 0)\n user...
[ "0.5955697", "0.5691835", "0.5608729", "0.5524597", "0.54921615", "0.5466037", "0.5413145", "0.532112", "0.5305886", "0.5305886", "0.52250093", "0.52186805", "0.5218585", "0.5213027", "0.5161755", "0.510363", "0.50631344", "0.5057089", "0.502919", "0.50256276", "0.50218606", ...
0.656195
0
Generate an UPPERCASEDIGIT random string
def id_generator(size=6, chars=string.ascii_uppercase + string.digits): return ''.join(random.choice(chars) for _ in range(size))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __generate_random_string():\n return uuid4().hex[:6].upper()", "def rand_string():\n out = ''\n for _ in range(24):\n out += choice(ascii_letters)\n return out", "def generate_random_string():\n return \"\".join(random.choice(string.ascii_lowercase + string.digits) for _ in range(...
[ "0.81131804", "0.77075326", "0.76152474", "0.7565456", "0.75302476", "0.7456737", "0.7427139", "0.74263746", "0.73823714", "0.73403955", "0.7337667", "0.7320186", "0.7306573", "0.7301715", "0.729549", "0.7216208", "0.72156084", "0.72054493", "0.7198095", "0.7196962", "0.71720...
0.0
-1
Remove items from dict that are in ignore_list
def clean_up_dict(clean_dict, ignore_list): for i in ignore_list: clean_dict.pop(i, None) return clean_dict
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def remove_ignore_list(book_list):\n my_ignore_list = ['a','able','about','across','after','all','almost','also',\n 'am','an','and','any','are','as','at','be','because',\n 'been','but','by','can','cannot','could','did','do','does',\n 'for','from','get','g...
[ "0.6528271", "0.63885605", "0.6334374", "0.6289866", "0.6288064", "0.62670565", "0.6228266", "0.6206135", "0.61762244", "0.61592996", "0.6145173", "0.61322767", "0.60949206", "0.6039302", "0.60224736", "0.59767854", "0.59724987", "0.5937053", "0.5921911", "0.59167516", "0.587...
0.8259495
0
Returns all ship entries in the matrix.
def get_all(self): return self.__fetcher.get_fetched()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getShips(self):\n\n return self.ships", "def entries(self):\n out = []\n for y,x in self.coords(False):\n out.append((y,x,self.retrieve(y,x)))\n return out", "def fetch_ships(self, planet=None):\n return self.fetch_levels(\"shipyard\", planet, codes.ships)", ...
[ "0.6271892", "0.61255616", "0.6031456", "0.5949597", "0.5863225", "0.5790161", "0.5757522", "0.56775945", "0.56765836", "0.5676237", "0.56377244", "0.56341594", "0.55904835", "0.5576646", "0.55512756", "0.55228555", "0.54944456", "0.5492098", "0.5490848", "0.5471194", "0.5466...
0.0
-1
Returns an instance of a chrome webdriver in headless mode. If the driver it's not installed it takes care of it.
def __get_browser(self): print("Setting WebDriver Chrome as headless mode") options = chromeOptions() options.set_headless(headless=True) chrome = webdriver.Chrome(ChromeDriverManager().install(), chrome_options=options) return chrome
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def load_chrome_driver_headless():\n options = Options()\n options.add_argument(\"--headless\")\n options.add_argument(\"--incognito\")\n return webdriver.Chrome(options=options)", "def connect_chrome_driver(headless):\n #initialise chrome options\n options = ChromeOptions()\n #set headless ...
[ "0.8538151", "0.8353205", "0.79812765", "0.7970249", "0.7681029", "0.767566", "0.7647282", "0.7625157", "0.7469295", "0.72292787", "0.7222201", "0.72053164", "0.71966046", "0.7131194", "0.7124592", "0.7069998", "0.70694405", "0.7030812", "0.70088404", "0.69481516", "0.6933692...
0.8593319
0
A dense block for functional models. It applies the following layers. Dense, (optional) GaussianDropout(0.005), LayerNormalization, hidden_activation, concat(input, result of block)
def dense_block(X, neurons_per_layer, add_noise, hidden_activation): Y = Dense(neurons_per_layer)(X) if add_noise: Y = GaussianDropout(0.005)(Y) Y = LayerNormalization()(Y) Y = hidden_activation(Y) return Concatenate()([X, Y])
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def dense_block(x):\n h1 = _conv_block(x, 32)\n h1 = tf.keras.layers.Concatenate()([x, h1])\n\n h2 = _conv_block(h1, 32)\n h2 = tf.keras.layers.Concatenate()([x, h1, h2])\n\n h3 = _conv_block(h2, 32)\n h3 = tf.keras.layers.Concatenate()([x, h1, h2, h3])\n\n h4 = _conv_block(h3, 32)\n h4 = tf.keras.layers.C...
[ "0.7486714", "0.69358814", "0.6901176", "0.67306393", "0.6716861", "0.66776246", "0.66286284", "0.6613473", "0.6593067", "0.6584164", "0.65632755", "0.65427786", "0.65149313", "0.6503657", "0.6483596", "0.64675564", "0.645557", "0.64497614", "0.64488506", "0.64478105", "0.644...
0.8049289
0
calc_all_coord_atom_angles Get all of the LML angles for a core geometry.
def calc_all_coord_atom_angles(core_geo): origin = np.array((0,0,0)) angles = [] for a,b in itertools.combinations(core_geo,2): angles.append(get_angle(a,origin,b)) return np.array(sorted(angles))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def extract_angles(self):\n atom_ids = self.contents['ID']\n angle_list = []\n for key, value in self.angles.items():\n a = value[0]\n b = value[1]\n c = value[2]\n\n lst = [a, b, c]\n\n A_ = np.asarray(atom_ids).reshape(-1, 3)\n\n ...
[ "0.65392137", "0.6302292", "0.62368506", "0.61322176", "0.58323574", "0.5788421", "0.5611396", "0.5610753", "0.5571035", "0.55631083", "0.55622685", "0.5509473", "0.54306", "0.5407556", "0.5406055", "0.539513", "0.5364315", "0.5348166", "0.5346797", "0.534259", "0.5311121", ...
0.8522789
0
Initializes an instance of SwitchPowerUsbWithCharge capability.
def __init__(self, shell_fn: Callable[..., Any], regex_shell_fn: Callable[..., Any], command_dict: Dict[str, str], regex_dict: Dict[str, str], device_name: str, serial_number: str, total_ports: int): super().__i...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def switch_power(self):\n return self.lazy_init(\n switch_power_usb_with_charge.SwitchPowerUsbWithCharge,\n shell_fn=self.shell,\n regex_shell_fn=self.shell_with_regex,\n command_dict=self.commands,\n regex_dict=self.regexes,\n device_name=self.name,\n serial_num...
[ "0.752715", "0.6055861", "0.59407836", "0.5831177", "0.5831177", "0.5742639", "0.5618685", "0.5579447", "0.55440784", "0.5507029", "0.5491407", "0.5437649", "0.54339284", "0.5401888", "0.5385723", "0.53453046", "0.53194886", "0.5317971", "0.52737224", "0.5254537", "0.52387756...
0.0
-1
cast(itkLightObject obj) > itkCosImageFilterID2ID2_Superclass
def cast(*args): return _itkCosImageFilterPython.itkCosImageFilterID2ID2_Superclass_cast(*args)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def cast(obj: 'itkLightObject') -> \"itkNotImageFilterIF2IF2_Superclass *\":\n return _itkNotImageFilterPython.itkNotImageFilterIF2IF2_Superclass_cast(obj)", "def itkNotImageFilterIF2IF2_Superclass_cast(obj: 'itkLightObject') -> \"itkNotImageFilterIF2IF2_Superclass *\":\n return _itkNotImageFilterPytho...
[ "0.86071545", "0.8592034", "0.8501731", "0.84885526", "0.84127486", "0.84080666", "0.84070694", "0.83171976", "0.8206105", "0.815629", "0.81321585", "0.810096", "0.7951454", "0.7948604", "0.79338855", "0.7872551", "0.7857506", "0.7849343", "0.78296536", "0.78086007", "0.77868...
0.7404678
51
New() > itkCosImageFilterID2ID2_Superclass Create a new object of the class itkCosImageFilterID2ID2_Superclass and set the input and the parameters if some named or nonnamed arguments are passed to that method. New() tries to assign all the non named parameters to the input of the new objects the first non named parame...
def New(*args, **kargs): obj = itkCosImageFilterID2ID2_Superclass.__New_orig__() import itkTemplate itkTemplate.New(obj, *args, **kargs) return obj
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def New(*args, **kargs):\n obj = itkCosImageFilterIF2IF2_Superclass.__New_orig__()\n import itkTemplate\n itkTemplate.New(obj, *args, **kargs)\n return obj", "def New(*args, **kargs):\n obj = itkTernaryAddImageFilterID2ID2ID2ID2_Superclass.__New_orig__()\n import itkTemp...
[ "0.75935036", "0.72907996", "0.72730875", "0.7267071", "0.72560984", "0.72085", "0.71096456", "0.70967555", "0.6984955", "0.6928041", "0.691787", "0.6905347", "0.68779635", "0.68319803", "0.6753575", "0.6749978", "0.67250055", "0.6720533", "0.6719612", "0.6716728", "0.6684836...
0.7954083
0
itkCosImageFilterID2ID2_Superclass_cast(itkLightObject obj) > itkCosImageFilterID2ID2_Superclass
def itkCosImageFilterID2ID2_Superclass_cast(*args): return _itkCosImageFilterPython.itkCosImageFilterID2ID2_Superclass_cast(*args)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def itkNotImageFilterIF2IF2_Superclass_cast(obj: 'itkLightObject') -> \"itkNotImageFilterIF2IF2_Superclass *\":\n return _itkNotImageFilterPython.itkNotImageFilterIF2IF2_Superclass_cast(obj)", "def itkNotImageFilterISS2ISS2_Superclass_cast(obj: 'itkLightObject') -> \"itkNotImageFilterISS2ISS2_Superclass *\":\...
[ "0.8862843", "0.8780776", "0.87688273", "0.8704371", "0.8690875", "0.8674073", "0.8627801", "0.85745597", "0.8373846", "0.83243", "0.83239865", "0.83011955", "0.8299772", "0.8204743", "0.82044613", "0.81466603", "0.8118168", "0.8117434", "0.8105822", "0.80800813", "0.8070348"...
0.85882765
7
cast(itkLightObject obj) > itkCosImageFilterID3ID3_Superclass
def cast(*args): return _itkCosImageFilterPython.itkCosImageFilterID3ID3_Superclass_cast(*args)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def cast(obj: 'itkLightObject') -> \"itkNotImageFilterIF3IF3_Superclass *\":\n return _itkNotImageFilterPython.itkNotImageFilterIF3IF3_Superclass_cast(obj)", "def cast(obj: 'itkLightObject') -> \"itkNotImageFilterISS3ISS3_Superclass *\":\n return _itkNotImageFilterPython.itkNotImageFilterISS3ISS3_S...
[ "0.86683923", "0.862723", "0.85871387", "0.85624206", "0.8513555", "0.8497864", "0.84229565", "0.83370554", "0.83119947", "0.8305348", "0.82925725", "0.82540387", "0.8107487", "0.80937564", "0.80567527", "0.8013949", "0.8010336", "0.79589516", "0.789349", "0.78914523", "0.785...
0.7362233
62
New() > itkCosImageFilterID3ID3_Superclass Create a new object of the class itkCosImageFilterID3ID3_Superclass and set the input and the parameters if some named or nonnamed arguments are passed to that method. New() tries to assign all the non named parameters to the input of the new objects the first non named parame...
def New(*args, **kargs): obj = itkCosImageFilterID3ID3_Superclass.__New_orig__() import itkTemplate itkTemplate.New(obj, *args, **kargs) return obj
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def New(*args, **kargs):\n obj = itkCosImageFilterIF3IF3_Superclass.__New_orig__()\n import itkTemplate\n itkTemplate.New(obj, *args, **kargs)\n return obj", "def New(*args, **kargs):\n obj = itkTernaryAddImageFilterID3ID3ID3ID3_Superclass.__New_orig__()\n import itkTemp...
[ "0.77141714", "0.7319198", "0.7316127", "0.7249109", "0.7231958", "0.7184253", "0.7155918", "0.70616406", "0.7056862", "0.7024334", "0.70080906", "0.7006804", "0.6993189", "0.68446493", "0.68294114", "0.6796026", "0.67948693", "0.6783106", "0.67579937", "0.67564404", "0.67458...
0.794355
0
itkCosImageFilterID3ID3_Superclass_cast(itkLightObject obj) > itkCosImageFilterID3ID3_Superclass
def itkCosImageFilterID3ID3_Superclass_cast(*args): return _itkCosImageFilterPython.itkCosImageFilterID3ID3_Superclass_cast(*args)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def itkNotImageFilterIF3IF3_Superclass_cast(obj: 'itkLightObject') -> \"itkNotImageFilterIF3IF3_Superclass *\":\n return _itkNotImageFilterPython.itkNotImageFilterIF3IF3_Superclass_cast(obj)", "def itkNotImageFilterISS3ISS3_Superclass_cast(obj: 'itkLightObject') -> \"itkNotImageFilterISS3ISS3_Superclass *\":\...
[ "0.8910451", "0.88948935", "0.8798548", "0.87567765", "0.87483764", "0.87183654", "0.86551684", "0.8621241", "0.84162587", "0.8356719", "0.83541745", "0.8353013", "0.83053374", "0.82730705", "0.8268659", "0.82569253", "0.8256206", "0.824875", "0.82469475", "0.8223389", "0.822...
0.8615558
8
cast(itkLightObject obj) > itkCosImageFilterIF2IF2_Superclass
def cast(*args): return _itkCosImageFilterPython.itkCosImageFilterIF2IF2_Superclass_cast(*args)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def itkNotImageFilterIF2IF2_Superclass_cast(obj: 'itkLightObject') -> \"itkNotImageFilterIF2IF2_Superclass *\":\n return _itkNotImageFilterPython.itkNotImageFilterIF2IF2_Superclass_cast(obj)", "def cast(obj: 'itkLightObject') -> \"itkNotImageFilterIF2IF2_Superclass *\":\n return _itkNotImageFilterPytho...
[ "0.88424003", "0.88202626", "0.86047465", "0.8564495", "0.8520451", "0.8502382", "0.84428334", "0.83847976", "0.8366901", "0.8346575", "0.834041", "0.82767797", "0.81551874", "0.80778867", "0.80013514", "0.7986159", "0.7963581", "0.7963303", "0.79207957", "0.79207695", "0.791...
0.7415676
52
New() > itkCosImageFilterIF2IF2_Superclass Create a new object of the class itkCosImageFilterIF2IF2_Superclass and set the input and the parameters if some named or nonnamed arguments are passed to that method. New() tries to assign all the non named parameters to the input of the new objects the first non named parame...
def New(*args, **kargs): obj = itkCosImageFilterIF2IF2_Superclass.__New_orig__() import itkTemplate itkTemplate.New(obj, *args, **kargs) return obj
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def New(*args, **kargs):\n obj = itkCosImageFilterID2ID2_Superclass.__New_orig__()\n import itkTemplate\n itkTemplate.New(obj, *args, **kargs)\n return obj", "def New(*args, **kargs):\n obj = itkNotImageFilterIF2IF2_Superclass.__New_orig__()\n import itkTemplate\n ...
[ "0.76779586", "0.7445717", "0.73286176", "0.7327192", "0.72321427", "0.72252136", "0.7177418", "0.7131903", "0.71000457", "0.7089659", "0.69965583", "0.6923089", "0.69229", "0.6893996", "0.6892577", "0.68918", "0.6863588", "0.6839431", "0.6838872", "0.6836973", "0.6830362", ...
0.79127604
0
itkCosImageFilterIF2IF2_Superclass_cast(itkLightObject obj) > itkCosImageFilterIF2IF2_Superclass
def itkCosImageFilterIF2IF2_Superclass_cast(*args): return _itkCosImageFilterPython.itkCosImageFilterIF2IF2_Superclass_cast(*args)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def itkNotImageFilterIF2IF2_Superclass_cast(obj: 'itkLightObject') -> \"itkNotImageFilterIF2IF2_Superclass *\":\n return _itkNotImageFilterPython.itkNotImageFilterIF2IF2_Superclass_cast(obj)", "def cast(obj: 'itkLightObject') -> \"itkNotImageFilterIF2IF2_Superclass *\":\n return _itkNotImageFilterPytho...
[ "0.90976673", "0.88867223", "0.8852662", "0.87791884", "0.8725247", "0.87106836", "0.8706143", "0.86283565", "0.8479521", "0.84427524", "0.8440181", "0.84103096", "0.83975786", "0.83288395", "0.82368404", "0.82346433", "0.82295835", "0.8202833", "0.81921935", "0.8162419", "0....
0.8606678
8
cast(itkLightObject obj) > itkCosImageFilterIF3IF3_Superclass
def cast(*args): return _itkCosImageFilterPython.itkCosImageFilterIF3IF3_Superclass_cast(*args)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def cast(obj: 'itkLightObject') -> \"itkNotImageFilterIF3IF3_Superclass *\":\n return _itkNotImageFilterPython.itkNotImageFilterIF3IF3_Superclass_cast(obj)", "def itkNotImageFilterIF3IF3_Superclass_cast(obj: 'itkLightObject') -> \"itkNotImageFilterIF3IF3_Superclass *\":\n return _itkNotImageFilterPytho...
[ "0.87793714", "0.87467635", "0.86473876", "0.86293596", "0.8545217", "0.85411304", "0.85197467", "0.84955597", "0.8391409", "0.8382299", "0.8375191", "0.8348412", "0.8340069", "0.81814164", "0.8108702", "0.8084266", "0.80465716", "0.8043597", "0.8011094", "0.79677314", "0.796...
0.73313683
72
New() > itkCosImageFilterIF3IF3_Superclass Create a new object of the class itkCosImageFilterIF3IF3_Superclass and set the input and the parameters if some named or nonnamed arguments are passed to that method. New() tries to assign all the non named parameters to the input of the new objects the first non named parame...
def New(*args, **kargs): obj = itkCosImageFilterIF3IF3_Superclass.__New_orig__() import itkTemplate itkTemplate.New(obj, *args, **kargs) return obj
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def New(*args, **kargs):\n obj = itkCosImageFilterID3ID3_Superclass.__New_orig__()\n import itkTemplate\n itkTemplate.New(obj, *args, **kargs)\n return obj", "def New(*args, **kargs):\n obj = itkNotImageFilterIF3IF3_Superclass.__New_orig__()\n import itkTemplate\n ...
[ "0.76920885", "0.7429909", "0.73614943", "0.7273933", "0.72659546", "0.7250906", "0.7198968", "0.71609765", "0.7144643", "0.71385515", "0.70806587", "0.69542575", "0.69164085", "0.6906592", "0.68563056", "0.6849681", "0.68313617", "0.68094784", "0.68039674", "0.68005866", "0....
0.7906033
0
itkCosImageFilterIF3IF3_Superclass_cast(itkLightObject obj) > itkCosImageFilterIF3IF3_Superclass
def itkCosImageFilterIF3IF3_Superclass_cast(*args): return _itkCosImageFilterPython.itkCosImageFilterIF3IF3_Superclass_cast(*args)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def itkNotImageFilterIF3IF3_Superclass_cast(obj: 'itkLightObject') -> \"itkNotImageFilterIF3IF3_Superclass *\":\n return _itkNotImageFilterPython.itkNotImageFilterIF3IF3_Superclass_cast(obj)", "def itkNotImageFilterISS3ISS3_Superclass_cast(obj: 'itkLightObject') -> \"itkNotImageFilterISS3ISS3_Superclass *\":\...
[ "0.9063235", "0.8897348", "0.88608825", "0.8829326", "0.87348765", "0.8729776", "0.86788815", "0.86103934", "0.8465078", "0.84501004", "0.8430744", "0.83540887", "0.83440745", "0.8329623", "0.83173525", "0.8304971", "0.8302481", "0.8291938", "0.822121", "0.8214621", "0.819932...
0.8646056
7
cast(itkLightObject obj) > itkCosImageFilterID2ID2
def cast(*args): return _itkCosImageFilterPython.itkCosImageFilterID2ID2_cast(*args)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def cast(obj: 'itkLightObject') -> \"itkHuangThresholdImageFilterIF2ISS2 *\":\n return _itkHuangThresholdImageFilterPython.itkHuangThresholdImageFilterIF2ISS2_cast(obj)", "def cast(obj: 'itkLightObject') -> \"itkNotImageFilterIF2IF2 *\":\n return _itkNotImageFilterPython.itkNotImageFilterIF2IF2_cas...
[ "0.8049103", "0.8042356", "0.7995952", "0.79182184", "0.79108095", "0.7895762", "0.788617", "0.7883473", "0.7873461", "0.78732026", "0.7851832", "0.78154504", "0.7809218", "0.77913105", "0.7789331", "0.77822155", "0.7779062", "0.77589697", "0.77527326", "0.77487075", "0.77374...
0.0
-1
New() > itkCosImageFilterID2ID2 Create a new object of the class itkCosImageFilterID2ID2 and set the input and the parameters if some named or nonnamed arguments are passed to that method. New() tries to assign all the non named parameters to the input of the new objects the first non named parameter in the first input...
def New(*args, **kargs): obj = itkCosImageFilterID2ID2.__New_orig__() import itkTemplate itkTemplate.New(obj, *args, **kargs) return obj
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def New(*args, **kargs):\n obj = itkCosImageFilterID2ID2_Superclass.__New_orig__()\n import itkTemplate\n itkTemplate.New(obj, *args, **kargs)\n return obj", "def New(*args, **kargs):\n obj = itkCosImageFilterIF2IF2.__New_orig__()\n import itkTemplate\n itkTemplat...
[ "0.7750207", "0.76177865", "0.7379745", "0.73473966", "0.73118484", "0.73117906", "0.7276629", "0.7219164", "0.7200379", "0.7169808", "0.7154578", "0.71521854", "0.7147615", "0.71060306", "0.7059725", "0.7018333", "0.6970653", "0.69704574", "0.6966879", "0.69489646", "0.69449...
0.8047623
0
itkCosImageFilterID2ID2_cast(itkLightObject obj) > itkCosImageFilterID2ID2
def itkCosImageFilterID2ID2_cast(*args): return _itkCosImageFilterPython.itkCosImageFilterID2ID2_cast(*args)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def cast(obj: 'itkLightObject') -> \"itkScalarImageKmeansImageFilterIF2ISS2 *\":\n return _itkScalarImageKmeansImageFilterPython.itkScalarImageKmeansImageFilterIF2ISS2_cast(obj)", "def cast(obj: 'itkLightObject') -> \"itkSquaredDifferenceImageFilterIF2IF2IF2 *\":\n return _itkSquaredDifferenceImage...
[ "0.8207999", "0.81942785", "0.8170716", "0.8142356", "0.8131818", "0.8062837", "0.8059987", "0.80579644", "0.80546725", "0.80522823", "0.8040865", "0.8038703", "0.80274063", "0.80220157", "0.8008262", "0.8005035", "0.80033684", "0.79935193", "0.799307", "0.7982839", "0.796441...
0.8119412
5
cast(itkLightObject obj) > itkCosImageFilterID3ID3
def cast(*args): return _itkCosImageFilterPython.itkCosImageFilterID3ID3_cast(*args)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def cast(obj: 'itkLightObject') -> \"itkHuangThresholdImageFilterIF3ISS3 *\":\n return _itkHuangThresholdImageFilterPython.itkHuangThresholdImageFilterIF3ISS3_cast(obj)", "def cast(obj: 'itkLightObject') -> \"itkHuangThresholdImageFilterIF3IUS3 *\":\n return _itkHuangThresholdImageFilterPython.itkH...
[ "0.80720794", "0.8027706", "0.8024218", "0.80207175", "0.801341", "0.7991757", "0.7991364", "0.79911995", "0.7967328", "0.7952361", "0.79307956", "0.79225814", "0.79155236", "0.79153305", "0.7902338", "0.78925174", "0.7891577", "0.789042", "0.78630966", "0.7862304", "0.785674...
0.0
-1
New() > itkCosImageFilterID3ID3 Create a new object of the class itkCosImageFilterID3ID3 and set the input and the parameters if some named or nonnamed arguments are passed to that method. New() tries to assign all the non named parameters to the input of the new objects the first non named parameter in the first input...
def New(*args, **kargs): obj = itkCosImageFilterID3ID3.__New_orig__() import itkTemplate itkTemplate.New(obj, *args, **kargs) return obj
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def New(*args, **kargs):\n obj = itkCosImageFilterIF3IF3.__New_orig__()\n import itkTemplate\n itkTemplate.New(obj, *args, **kargs)\n return obj", "def New(*args, **kargs):\n obj = itkCosImageFilterID3ID3_Superclass.__New_orig__()\n import itkTemplate\n itkTemplat...
[ "0.782842", "0.77592134", "0.75477874", "0.7375264", "0.73590976", "0.7349582", "0.73476624", "0.7342269", "0.7240958", "0.72307867", "0.7216902", "0.71938753", "0.7187123", "0.71735513", "0.71492153", "0.713743", "0.71203697", "0.7106789", "0.7089128", "0.70698464", "0.70586...
0.8106408
0
itkCosImageFilterID3ID3_cast(itkLightObject obj) > itkCosImageFilterID3ID3
def itkCosImageFilterID3ID3_cast(*args): return _itkCosImageFilterPython.itkCosImageFilterID3ID3_cast(*args)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def cast(obj: 'itkLightObject') -> \"itkScalarImageKmeansImageFilterIF3ISS3 *\":\n return _itkScalarImageKmeansImageFilterPython.itkScalarImageKmeansImageFilterIF3ISS3_cast(obj)", "def cast(obj: 'itkLightObject') -> \"itkScalarImageKmeansImageFilterIF3IUS3 *\":\n return _itkScalarImageKmeansImageFi...
[ "0.83388513", "0.82554215", "0.8232427", "0.82247144", "0.81992793", "0.8191354", "0.8172995", "0.81658417", "0.81422055", "0.81363183", "0.81340337", "0.81317544", "0.8105376", "0.8102495", "0.80917156", "0.80901814", "0.8088206", "0.80874085", "0.80802035", "0.80801713", "0...
0.8156475
8
cast(itkLightObject obj) > itkCosImageFilterIF2IF2
def cast(*args): return _itkCosImageFilterPython.itkCosImageFilterIF2IF2_cast(*args)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def itkNotImageFilterIF2IF2_cast(obj: 'itkLightObject') -> \"itkNotImageFilterIF2IF2 *\":\n return _itkNotImageFilterPython.itkNotImageFilterIF2IF2_cast(obj)", "def cast(obj: 'itkLightObject') -> \"itkNotImageFilterIF2IF2 *\":\n return _itkNotImageFilterPython.itkNotImageFilterIF2IF2_cast(obj)", "def...
[ "0.82713336", "0.82455754", "0.8170484", "0.81050014", "0.8061573", "0.7998373", "0.7987641", "0.79583055", "0.7901362", "0.78924215", "0.788156", "0.7876705", "0.7870345", "0.78703195", "0.78631145", "0.78609395", "0.7828205", "0.78073233", "0.7801901", "0.77982247", "0.7782...
0.0
-1
New() > itkCosImageFilterIF2IF2 Create a new object of the class itkCosImageFilterIF2IF2 and set the input and the parameters if some named or nonnamed arguments are passed to that method. New() tries to assign all the non named parameters to the input of the new objects the first non named parameter in the first input...
def New(*args, **kargs): obj = itkCosImageFilterIF2IF2.__New_orig__() import itkTemplate itkTemplate.New(obj, *args, **kargs) return obj
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def New(*args, **kargs):\n obj = itkCosImageFilterID2ID2.__New_orig__()\n import itkTemplate\n itkTemplate.New(obj, *args, **kargs)\n return obj", "def New(*args, **kargs):\n obj = itkCosImageFilterIF2IF2_Superclass.__New_orig__()\n import itkTemplate\n itkTemplat...
[ "0.7735841", "0.7731298", "0.7500468", "0.7462953", "0.7397587", "0.7371998", "0.7313287", "0.72614413", "0.72313875", "0.72276866", "0.7182058", "0.7160356", "0.7155663", "0.7142183", "0.71229553", "0.7116697", "0.7103676", "0.70629007", "0.7057744", "0.7043274", "0.7029638"...
0.8036792
0
itkCosImageFilterIF2IF2_cast(itkLightObject obj) > itkCosImageFilterIF2IF2
def itkCosImageFilterIF2IF2_cast(*args): return _itkCosImageFilterPython.itkCosImageFilterIF2IF2_cast(*args)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def cast(obj: 'itkLightObject') -> \"itkBinaryContourImageFilterIF2IF2 *\":\n return _itkBinaryContourImageFilterPython.itkBinaryContourImageFilterIF2IF2_cast(obj)", "def cast(obj: 'itkLightObject') -> \"itkSquaredDifferenceImageFilterIF2IF2IF2 *\":\n return _itkSquaredDifferenceImageFilterPython.i...
[ "0.83449745", "0.8332226", "0.8308706", "0.82954156", "0.82942474", "0.82866645", "0.826143", "0.82612705", "0.8251573", "0.82267773", "0.8190453", "0.8153499", "0.8124564", "0.81161153", "0.8101967", "0.8086738", "0.8078108", "0.8067691", "0.80504113", "0.80426794", "0.80209...
0.82803416
6
cast(itkLightObject obj) > itkCosImageFilterIF3IF3
def cast(*args): return _itkCosImageFilterPython.itkCosImageFilterIF3IF3_cast(*args)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def cast(obj: 'itkLightObject') -> \"itkHuangThresholdImageFilterIF3ISS3 *\":\n return _itkHuangThresholdImageFilterPython.itkHuangThresholdImageFilterIF3ISS3_cast(obj)", "def cast(obj: 'itkLightObject') -> \"itkHuangThresholdImageFilterIF3IUS3 *\":\n return _itkHuangThresholdImageFilterPython.itkH...
[ "0.81318736", "0.8104459", "0.80851805", "0.8080048", "0.80619746", "0.8000979", "0.79761136", "0.79736143", "0.79716617", "0.796715", "0.79615295", "0.79486346", "0.79089546", "0.7908397", "0.7899607", "0.78955615", "0.78845763", "0.78564525", "0.7835742", "0.78300464", "0.7...
0.0
-1
New() > itkCosImageFilterIF3IF3 Create a new object of the class itkCosImageFilterIF3IF3 and set the input and the parameters if some named or nonnamed arguments are passed to that method. New() tries to assign all the non named parameters to the input of the new objects the first non named parameter in the first input...
def New(*args, **kargs): obj = itkCosImageFilterIF3IF3.__New_orig__() import itkTemplate itkTemplate.New(obj, *args, **kargs) return obj
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def New(*args, **kargs):\n obj = itkCosImageFilterID3ID3.__New_orig__()\n import itkTemplate\n itkTemplate.New(obj, *args, **kargs)\n return obj", "def New(*args, **kargs):\n obj = itkCosImageFilterIF3IF3_Superclass.__New_orig__()\n import itkTemplate\n itkTemplat...
[ "0.77990925", "0.7772224", "0.7472595", "0.74669296", "0.7442337", "0.74420905", "0.74217135", "0.7361661", "0.73055714", "0.7288295", "0.72598577", "0.7242296", "0.72183293", "0.72182155", "0.72176534", "0.7207231", "0.71909094", "0.7190173", "0.71870035", "0.7180038", "0.71...
0.8125627
0
itkCosImageFilterIF3IF3_cast(itkLightObject obj) > itkCosImageFilterIF3IF3
def itkCosImageFilterIF3IF3_cast(*args): return _itkCosImageFilterPython.itkCosImageFilterIF3IF3_cast(*args)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def cast(obj: 'itkLightObject') -> \"itkScalarImageKmeansImageFilterIF3ISS3 *\":\n return _itkScalarImageKmeansImageFilterPython.itkScalarImageKmeansImageFilterIF3ISS3_cast(obj)", "def cast(obj: 'itkLightObject') -> \"itkBinaryContourImageFilterIF3IF3 *\":\n return _itkBinaryContourImageFilterPytho...
[ "0.83219475", "0.82975626", "0.82611847", "0.8251227", "0.8243064", "0.8242012", "0.8218637", "0.8215971", "0.8207221", "0.82034683", "0.81770164", "0.81310654", "0.8127668", "0.81218696", "0.81203556", "0.8102578", "0.80988747", "0.8095543", "0.8091649", "0.805958", "0.80577...
0.8202368
10
Returns domain_states grown by depth along transitions. Resulting states are filtered by the validity_test. By default, only states without a negative coordinate are valid.
def grow_domain(domain_states, transitions, depth, validity_test = None): if numpy.size(domain_states) == 0: raise ValueError('there must be at least one state to expand') if validity_test is None: validity_test = non_neg_states expanded_states = domain_states for _ in xrange(depth): ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def filter_bound_transitions(self, transitions):\n transitions = transitions.reset_index()\n transitions = transitions.loc[transitions[\"upper_level_index\"]\n <= self.last_bound_level]\n transitions = transitions.set_index(\n [\"lower_level_inde...
[ "0.57105845", "0.5199087", "0.5093414", "0.5083831", "0.5079438", "0.504274", "0.5033404", "0.5003836", "0.49751276", "0.49420226", "0.48918647", "0.48856464", "0.4874076", "0.48652098", "0.48447296", "0.48319766", "0.48190337", "0.47919258", "0.47874916", "0.47771767", "0.47...
0.67941123
0
r""" encode the data using struct.pack >>> encode_data('HHB', (27, 1, 0)) b'\x00\x05\x00\x1b\x00\x01\x00' = ================== > big endian H unsigned integer B unsigned char = ==================
def encode_data(fmt: str, data: Iterable) -> bytes: ret = struct.pack('>' + fmt, *data) if len(ret) < 2 or len(ret) > 0xffff: raise ValueError('Encoded data length needs to be between 2 and 65536') # prepend data length return struct.pack('>H', len(ret)) + ret
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def encode(self):\n datarate_txpower = 0 | (self.datarate << 4) | self.txpower\n redundancy = 0 | (self.chmaskcntl << 4) | self.nbrep\n data = struct.pack('<BBHB', self.cid, datarate_txpower, self.chmask, redundancy)\n return data", "def encode(self):\n b = 0 | self.mtype << 5 ...
[ "0.77296096", "0.73010516", "0.7000237", "0.69679916", "0.6757876", "0.6724614", "0.6658339", "0.6582501", "0.6488325", "0.6487439", "0.64820886", "0.6426871", "0.6388616", "0.6371058", "0.62913173", "0.62831986", "0.6257105", "0.62480927", "0.6217435", "0.61823195", "0.61788...
0.6671313
6
The maximum grade possible for the problem.
def max_grade(self) -> float: return sum(self.test_weights.values())
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def max_score(self):\n return self.raw_possible", "def grade(self):\n if round(self.numAvg,0) >= 70:\n return round(self.numAvg,0)\n elif self.PassSummer:\n return 70\n elif round(self.numAvg,0) >= 55 and not self.PassSummer:\n return round(self.numAvg...
[ "0.7506938", "0.725243", "0.7108183", "0.7025382", "0.6890848", "0.6819577", "0.67641056", "0.67433095", "0.669709", "0.6663538", "0.66567457", "0.6652442", "0.66458493", "0.6636141", "0.66278195", "0.66266954", "0.66254145", "0.66254145", "0.6622135", "0.66023034", "0.659305...
0.79307663
0
Verifies the expected output entries are emitted by the console task under test.
def assert_console_output(self, *output, **kwargs): self.assertEqual(sorted(output), sorted(self.execute_console_task(**kwargs)))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def assert_console_output(self, *output, **kwargs):\r\n self.assertEqual(sorted(output), sorted(self.execute_console_task(**kwargs)))", "def test_debug_output(self):\n assert output(self.msg) is not None", "def assert_console_output_ordered(self, *output, **kwargs):\n self.assertEqual(list(output)...
[ "0.77022696", "0.7244481", "0.71960497", "0.7169571", "0.70544595", "0.6928858", "0.6707271", "0.66554683", "0.6597618", "0.6567383", "0.654989", "0.6500504", "0.6470142", "0.6470045", "0.6437217", "0.6420013", "0.6402865", "0.6385644", "0.63641894", "0.6348764", "0.633137", ...
0.7668784
1
Verifies the expected output entries are emitted by the console task under test.
def assert_console_output_ordered(self, *output, **kwargs): self.assertEqual(list(output), self.execute_console_task(**kwargs))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def assert_console_output(self, *output, **kwargs):\r\n self.assertEqual(sorted(output), sorted(self.execute_console_task(**kwargs)))", "def assert_console_output(self, *output, **kwargs):\n self.assertEqual(sorted(output), sorted(self.execute_console_task(**kwargs)))", "def test_debug_output(self):\n ...
[ "0.7701624", "0.7668178", "0.72435975", "0.71700186", "0.7053819", "0.69301796", "0.6707033", "0.6655254", "0.6597397", "0.6567671", "0.65496725", "0.6499929", "0.6470104", "0.6469056", "0.6438308", "0.6419728", "0.64025164", "0.63858426", "0.6364249", "0.6347973", "0.6331704...
0.7195702
3
Returns the first_name plus the last_name, with a space in between. The user is identified by their first_name plus last_name
def get_full_name(self): full_name = '%s %s' % (self.first_name, self.last_name) return full_name.strip()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_full_name(self):\n # The user is identified by their email address\n return self.first_name+' '+self.last_name", "def full_name(first_name, last_name):\n return first_name + \" \" + last_name", "def full_name(first_name, last_name):\n\t\n\treturn first_name + \" \" + last_name", "def...
[ "0.7946729", "0.77733004", "0.7769883", "0.77620447", "0.7742543", "0.7702737", "0.76157534", "0.7611005", "0.76030314", "0.7601849", "0.75643396", "0.7552074", "0.7540965", "0.75186944", "0.7472367", "0.74687785", "0.74581945", "0.74581945", "0.7438394", "0.7434189", "0.7427...
0.76856387
6
Indicates if the finite field is a prime field, having prime order.
def is_prime_field(cls) -> bool: return cls._degree == 1
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_prime(self):\n pass", "def isprimeF(n,b):\r\n\treturn (pow(b,n-1,n) == 1)", "def isprimeF(n,b):\n\treturn (pow(b,n-1,n) == 1)", "def is_prime(self, it):\n return it > 0 \\\n and (it == 2 or it % 2 != 0) \\\n and (it == 1 or not (any(it % number == 0 for number...
[ "0.72880095", "0.6664437", "0.665253", "0.64691514", "0.6449833", "0.63539046", "0.6345016", "0.6336075", "0.63180494", "0.62863123", "0.62733823", "0.6267938", "0.6232005", "0.6186778", "0.61769104", "0.6165506", "0.6153848", "0.6104596", "0.6081204", "0.6081204", "0.6071728...
0.8289135
0
Checks if user is the commenter.
def get_is_commenter(self, obj): user = None request = self.context.get('request') if request and hasattr(request, 'user'): user = request.user if user == obj.commenter: return True return False
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_comment_editor(self,user):\n return user.is_staff or user.is_superuser or user.id == self.creator_id", "def commented_by(self, user):\n return Comments.objects.filter(recipe=self, chef=user).exists()", "def is_comment_owner(praw_comment, username):\n return praw_comment.author and praw_...
[ "0.752661", "0.7405133", "0.7353144", "0.72349393", "0.7023573", "0.68942636", "0.67756337", "0.67564404", "0.6722907", "0.6518927", "0.63547254", "0.6284016", "0.6283225", "0.6234268", "0.6230834", "0.6175208", "0.61635125", "0.6149782", "0.6053558", "0.60356534", "0.6019889...
0.86046135
0
Returns human readable time.
def get_created_naturaltime(self, obj): return naturaltime(obj.created)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_time_human_readable():\n return time.strftime(\"%A, %H:%M\")", "def get_time() -> str:\n return strftime(\"%H:%M:%S\")", "def get_time(self):\n x = time.localtime()\n return ''.join([\n str(x[0]).rjust(4, '0'), '/', str(x[1]).rjust(2, '0'), '/',\n str(x[2]).rju...
[ "0.846048", "0.80515003", "0.79151344", "0.77329826", "0.77089983", "0.76621354", "0.76217175", "0.7581784", "0.7549736", "0.7520039", "0.751363", "0.7500368", "0.7492993", "0.7488472", "0.74801904", "0.7460909", "0.74443126", "0.7433596", "0.74139553", "0.73886305", "0.73735...
0.0
-1
Close out the file connection.
def close(self): self.filep.close()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def close_file(self):\r\n self.file.close()", "def close_file(self):\n self.file.close()", "def close_file(self):\n self.file.close()", "def close(self):\n self.file_out.close()", "def _close(self):\n self.fh.close()", "def close(self):\n self.out_file.close()", ...
[ "0.8061058", "0.8018861", "0.8018861", "0.7986604", "0.79225266", "0.7871552", "0.7866032", "0.78181046", "0.78181046", "0.7809975", "0.7770069", "0.7770069", "0.7730833", "0.77198523", "0.77110773", "0.7706973", "0.7644901", "0.7637969", "0.7609332", "0.76081556", "0.7598803...
0.7543592
24
Python <= 3 demand that kwargs keys be bytes instead of unicode/string.
def test_kwargs(self): def f(**kwargs): self.assertEqual(kwargs, {'spam': 'eggs'}) kwargs = self.decode('\n\x0b\x01\tspam\x06\teggs\x01') f(**kwargs)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_kwargs(self):\n kwargs = forge.kwargs\n assert isinstance(kwargs, forge._signature.VarKeyword)\n assert kwargs.name == 'kwargs'\n assert kwargs.converter is None\n assert kwargs.validator is None", "def bytes(*args, **kwargs): # real signature unknown\n pass", "de...
[ "0.6542057", "0.64504665", "0.640747", "0.6147738", "0.5971218", "0.5936928", "0.5910666", "0.57681924", "0.57137144", "0.56899613", "0.56320244", "0.5605776", "0.55874944", "0.5580652", "0.55779433", "0.5562142", "0.55469763", "0.55368596", "0.5514528", "0.5480519", "0.54805...
0.7238601
0
|coro| Returns the user's playlists.
async def get_user_playlists( self, user: discord.User, partial: bool = False ) -> List[UserPlaylist]: user_playlist_ids = await self.database.select( self.tables["playlists"], ["id"], {"user": user.id}, True ) return list( await asyncio.gather( ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_playlists(self):\n if self.youtube is None:\n self.youtube = __get_client()\n return self.youtube.playlists().list(part=\"snippet\", mine=True)\\\n .execute()", "def current_user_playlists(self, limit: int = 20, offset: int = 0):\n return self._get('me/playlists...
[ "0.799533", "0.79427636", "0.79104716", "0.7890582", "0.78184146", "0.7740326", "0.76802987", "0.74232125", "0.7404158", "0.7337528", "0.73239934", "0.7278643", "0.72557425", "0.720226", "0.70500785", "0.69288164", "0.68446565", "0.68256134", "0.6722397", "0.6677872", "0.6606...
0.6750874
18
|coro| Waits the inactivity timeout and ensures the voice client in ctx is playing a song. If no song is playing, it disconnects and calls the on_inactivity_timeout event.
async def ensure_activity(self, ctx: commands.Context) -> None: if self.inactivity_timeout is None: return await asyncio.sleep(self.inactivity_timeout) if ( ctx.voice_client and ctx.voice_client.is_connected() and not ctx.voice_client.is_playing...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async def voice_check(self, msg):\n if msg.voice_client is not None:\n await asyncio.sleep(120)\n if msg.voice_client is not None and msg.voice_client.is_playing() is False and msg.voice_client.is_paused() is False:\n await msg.voice_client.disconnect()", "async def pl...
[ "0.67768085", "0.62030226", "0.6134315", "0.61318606", "0.61134523", "0.60705984", "0.6032164", "0.58575594", "0.57710123", "0.57150525", "0.5701865", "0.56967247", "0.56604326", "0.5659886", "0.5658274", "0.565326", "0.5599243", "0.5589014", "0.55763376", "0.5547784", "0.553...
0.7265072
0
|coro| Plays the next song in the queue, handles looping, queue looping, autoplay, etc.
async def _check_queue(self, ctx: commands.Context) -> None: try: if not ctx.voice_client or not ctx.voice_client.is_connected(): return queue = self.queue[ctx.guild.id] player = await queue.get_next_player(self.youtube) if player is None: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async def play(self):\n if self.repeat and self.current is not None:\n self.queue.append(self.current)\n\n self.current = None\n self.position = 0\n self.paused = False\n\n if not self.queue:\n await self.stop()\n await self._bot.lavalink.client._...
[ "0.7607362", "0.7413545", "0.72747624", "0.7234257", "0.7065234", "0.70392334", "0.7010689", "0.6961038", "0.6949446", "0.6896756", "0.68965113", "0.68822825", "0.6867415", "0.683365", "0.6637377", "0.6635679", "0.66269606", "0.66197157", "0.66149426", "0.6607695", "0.6605745...
0.64140975
41
|coro| Adds a list of players to the ctx queue. If a queue does not exist in ctx, it creates one.
async def queue_add( self, ctx: commands.Context, players: List[Player], ) -> Optional[bool]: if ctx.guild.id in self.queue: self.queue[ctx.guild.id].queue += players else: self.queue[ctx.guild.id] = QueueManager(self.default_volume, players) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __enqueue(self, args=None):\n self.player.append(next(self.cur_pl))", "async def playlist(self, data, msg):\n for i in data['queue']:\n print(i)\n self.player[msg.guild.id]['queue'].append(\n {'title': i, 'author': msg})", "async def queue(self, ctx: comma...
[ "0.6649097", "0.61467946", "0.60230863", "0.5959363", "0.5947061", "0.58933604", "0.5884806", "0.58194065", "0.57636076", "0.57555825", "0.5747997", "0.57158893", "0.56636035", "0.5651666", "0.5596279", "0.5567043", "0.55403996", "0.5527119", "0.5520095", "0.5482724", "0.5482...
0.74539477
0
|coro| Plays the player or the next song in the queue.
async def play( self, ctx: commands.Context, ) -> Optional[bool]: if not ctx.voice_client.is_playing(): await self._check_queue(ctx) return True
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async def play(self):\n if self.repeat and self.current is not None:\n self.queue.append(self.current)\n\n self.current = None\n self.position = 0\n self.paused = False\n\n if not self.queue:\n await self.stop()\n await self._bot.lavalink.client._...
[ "0.7754902", "0.7663747", "0.7567789", "0.7528323", "0.7374529", "0.73590726", "0.725104", "0.71742755", "0.7021318", "0.70206803", "0.70044196", "0.69880825", "0.6956192", "0.6950428", "0.69385517", "0.69347847", "0.6865466", "0.68316597", "0.6789953", "0.67856115", "0.67800...
0.649578
34
|coro| Skips to the index in ctx. Calls on_music_error with InvalidSkipIndex or SkipError.
async def skip(self, ctx: commands.Context, index: int = None) -> Optional[Player]: queue = self.queue[ctx.guild.id] # Created duplicate to make sure InvalidSkipIndex isn't raised when the user does pass an index and the queue # is empty. skip_index = 0 if index is None else index - 1 ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async def skip(self, ctx):\r\n if ctx.message.channel.id != 701868237771505695:\r\n return await ctx.send(\"**Error:** Music Bot commands are only available in <#701868237771505695>\")\r\n if self.music_off:\r\n return await ctx.send(\"**Error:** Music Bot features are currently...
[ "0.65922076", "0.63522", "0.61802304", "0.61173105", "0.6102237", "0.60958916", "0.6074054", "0.60157377", "0.5965597", "0.58740216", "0.58564997", "0.57778865", "0.5768989", "0.56513226", "0.56513226", "0.564023", "0.56162554", "0.5608903", "0.5556879", "0.544198", "0.534235...
0.6455025
1
|coro| Joins the ctx voice channel. Calls on_music_error with AlreadyConnected or UserNotConnected.
async def join(self, ctx: commands.Context) -> Optional[discord.VoiceChannel]: if ctx.voice_client and ctx.voice_client.is_connected(): await self.call_event( "on_music_error", ctx, AlreadyConnected("Client is already connected to a voice channel"), ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async def join(self, ctx):\n voice = ctx.author.voice\n\n if voice and voice.channel:\n channel = voice.channel\n \n try:\n await channel.connect()\n except discord.errors.ClientException:\n await ctx.guild.get_member(self.bot....
[ "0.7335438", "0.73056656", "0.72704077", "0.7116836", "0.7083306", "0.7064541", "0.70203084", "0.68096536", "0.6794914", "0.6720208", "0.6705966", "0.6673719", "0.6630125", "0.6621831", "0.6576283", "0.65449136", "0.6535891", "0.6470006", "0.6363149", "0.63062465", "0.6301805...
0.73671913
0
|coro| Returns the currently playing player.
async def now_playing(self, ctx: commands.Context) -> Optional[Player]: now_playing = self.queue[ctx.guild.id].now_playing if not ctx.voice_client.is_playing() and not ctx.voice_client.is_paused(): await self.call_event( "on_music_error", ctx, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_player(self):\n\n return self._player", "def get_player(self):\r\n return self.player_control.get_player()", "def get_current_player(self):\n\n # Return the current player\n return self._current_player", "def getCurrentPlayer(self):\r\n return self.currentPlayer", ...
[ "0.77996653", "0.77758723", "0.77518016", "0.7727183", "0.7676152", "0.76502293", "0.7648308", "0.75869185", "0.75709295", "0.75709295", "0.75676566", "0.7557421", "0.75524944", "0.75246096", "0.75162125", "0.74907434", "0.743253", "0.7414162", "0.73967606", "0.7334954", "0.7...
0.7216058
22
|coro| Returns parsed duration.
def parse_duration(duration: Union[str, float], hour_format: bool = True) -> str: if duration == "LIVE": return duration time_format = "%H:%M:%S" if hour_format else "%M:%S" return time.strftime(time_format, time.gmtime(round(duration)))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def duration(self):\n return self._get(\"duration\")", "def duration(self):\n return self._get('duration')", "def _duration(self):\n if getattr(self, '_duration_cache', None):\n return self._duration_cache\n duration = extractMetadata(guessParser(\\\n InputIOSt...
[ "0.7275495", "0.7252117", "0.7243393", "0.72383153", "0.7203399", "0.7156711", "0.7100431", "0.70897835", "0.70765555", "0.70765555", "0.70765555", "0.7005356", "0.7005356", "0.69921684", "0.69905543", "0.696688", "0.6965177", "0.6955039", "0.6955039", "0.69539356", "0.692468...
0.6420195
84
Decorate an init to create new instances of mutable defaults. This should only be used in combination with `default` and will be applied as part of `__init_subclass`. Direct usage of this decorator should not be required.
def _replace_defaults_wrapper(cls: Type[_BaseTpcpObject], old_init: Callable) -> Callable: # We get the params of the old inits here and not at runtime to avoid issues when the class is subclassed and # super().__init__ is called before all parameters of the child object are set. # This way, the param check...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def with_init(attrs, defaults=None):\n if defaults is None:\n defaults = {}\n\n def init(self, *args, **kw):\n for a in attrs:\n try:\n v = kw.pop(a)\n except KeyError:\n try:\n v = defaults[a]\n except KeyErr...
[ "0.6899492", "0.63387537", "0.6274772", "0.60143405", "0.5986952", "0.5986882", "0.597908", "0.5974641", "0.5867499", "0.58120024", "0.57996875", "0.57015926", "0.5697875", "0.5669695", "0.5663108", "0.5656362", "0.5617214", "0.5595076", "0.54991686", "0.54677224", "0.5437217...
0.645165
1
Compute the sigmoid function. We don't bother with clipping the input value because IEEE floating point behaves reasonably with this function even for infinities.
def sigmoid(x): return 1.0/(1.0+exp(-x))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def sigmoid(x):\n return amath.exp(amath.minimum(0, x)) / (1 + amath.exp(-abs(x)))", "def hard_sigmoid(x):\n x = (0.2 * x) + 0.5\n x = F.threshold(-x, -1, -1)\n x = F.threshold(-x, 0, 0)\n return x", "def sigmoid(x):\n return 1 / (1 + math.exp(-x))", "def sigmoid(x):\n return 1 / (1 + math...
[ "0.8370069", "0.8355075", "0.829688", "0.8282958", "0.82597953", "0.82597953", "0.82561266", "0.82561266", "0.8239978", "0.82292914", "0.82246786", "0.82193404", "0.8207283", "0.8198303", "0.8198303", "0.8198303", "0.8198303", "0.8198303", "0.8198303", "0.81929946", "0.818654...
0.8143195
27
Normalize a 2D matrix on an axis.
def normalize_matrix_on_axis(m, axis=0): if m.ndim != 2: raise ValueError('This function only accepts 2D arrays. ' 'An array of shape %r was passed.' % (m.shape,)) if axis == 0: column_squared_norms = np.sum(m ** 2, axis=0) # check for null columns n_zer...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def normalize_matrix_on_axis(m, axis=0, copy=True):\n if axis == 0:\n ret = m / np.sqrt(np.sum(m ** 2, axis=axis))\n elif axis == 1:\n ret = normalize_matrix_on_axis(m.T).T\n else:\n raise Exception('Only for 2D array.')\n if copy:\n ret = ret.copy()\n return ret", "def...
[ "0.76275796", "0.7502926", "0.7461525", "0.7425477", "0.73569936", "0.7334126", "0.7313735", "0.7280307", "0.72589785", "0.7193776", "0.7133624", "0.7021105", "0.6998982", "0.6986054", "0.6973652", "0.6973652", "0.6973652", "0.69469905", "0.6935014", "0.6906828", "0.68913996"...
0.69304264
19
Map a stride scalar to the stride array for tf.nn.conv2d.
def _stride_arr(self, stride): return [1, stride, stride, 1]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def conv(batch_input, out_channels, stride):\n with tf.variable_scope(\"conv\"):\n in_channels = batch_input.get_shape()[3]\n filter = tf.get_variable(\"filter\", [4, 4, in_channels, out_channels], dtype=tf.float32, initializer=tf.random_normal_initializer(0, 0.02))\n # [batch, in_height, i...
[ "0.6669932", "0.66349345", "0.6607411", "0.6571154", "0.6553278", "0.654467", "0.6510186", "0.64881164", "0.6472755", "0.6472755", "0.64726895", "0.64297444", "0.64297444", "0.64297444", "0.64297444", "0.6417996", "0.64001656", "0.63844544", "0.6372369", "0.63409317", "0.6329...
0.6225642
28
removing stopwords, filter partofspeech tokenization ...
def preprocess(data, bigrams=None): data = [utils.remove_non_word(doc) for doc in data] logger.info(f"number of doc: {len(data)}") bigrams, bi_data = utils.extract_bigrams(data) data = [utils.extract_pos(doc) for doc in data] data = [doc for doc in data if 40 < len(doc) < 60000] data = [utils.re...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def processes_and_tokenize(raw_document):\n\ttokenizer = RegexpTokenizer(r'\\w+')\n\ttokens = tokenizer.tokenize(raw_document.lower())\t\t# tokens = nltk.word_tokenize(corpus.lower()) # without removing punctiation\n\n\t#remove stop words\n\tstop_words = set(nltk.corpus.stopwords.words('english'))\n\t#stop_words =...
[ "0.785345", "0.7656602", "0.74820346", "0.73533416", "0.73523617", "0.7281334", "0.7241045", "0.72319806", "0.71927816", "0.7153666", "0.71455336", "0.71394646", "0.71357536", "0.7107299", "0.7102582", "0.7075237", "0.7063181", "0.7056864", "0.70515096", "0.70271724", "0.6992...
0.0
-1
Custom softmax activation function for a 4D input tensor softmax along axis = 1
def softmax4(x): ndim = K.ndim(x) if ndim == 2: return K.softmax(x) elif ndim == 3: e = K.exp(x - K.max(x, axis=-1, keepdims=True)) s = K.sum(e, axis=-1, keepdims=True) return e / s elif ndim == 4: e = K.exp(x - K.max(x, axis=1, keepdims=True)) s = K.sum(e...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def softmax(x):\n return np.exp(x) / np.sum(np.exp(x), axis=1, keepdims=True)", "def softmax(x):\n return np.exp(x) / np.sum(np.exp(x), axis=1, keepdims=True)", "def softmax(x):\r\n sum_c = np.sum(np.exp(x), axis=1)\r\n sum_c = np.expand_dims(sum_c, axis=1)\r\n pred_x = np.divide(np.exp(x), sum_c)...
[ "0.76402146", "0.76000196", "0.7510035", "0.7496785", "0.74426943", "0.7440827", "0.743802", "0.7426251", "0.7417935", "0.73776555", "0.73776555", "0.73776555", "0.73776555", "0.73776555", "0.73776555", "0.73776555", "0.73776555", "0.73602927", "0.7345461", "0.7345461", "0.73...
0.8013518
0
get patch bboxes from a given image array
def get_patch_bboxes( data_shape, patch_shape, subsample = 32 ) : assert len( data_shape ) == 4, "ERROR: expect data_tensor of shape ( n_samples, n_chs, height, width )" n_samples, n_chs, height, width = data_shape box_height, box_width = patch_shape assert ( box_height <= height ) and ( box_width <= wi...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_bboxes(self, image_path: str, img_pipeline=None):\n pass", "def extract_bboxes(mask):\r\n boxes = np.zeros([mask.shape[-1], 4], dtype=np.int32)\r\n for i in range(mask.shape[-1]):\r\n m = mask[:, :, i]\r\n # Bounding box.\r\n horizontal_indicies = np.where(np.any(m, axis...
[ "0.7204959", "0.69834524", "0.69745976", "0.69524914", "0.69439936", "0.69140863", "0.689814", "0.6834131", "0.6736121", "0.6664592", "0.66399735", "0.6636704", "0.6624367", "0.6614081", "0.66058177", "0.65899616", "0.65716994", "0.65647924", "0.6523324", "0.65062416", "0.648...
0.7017752
1
Searches for the specified value. If found, splays the tree around it; removes it from the tree; finds its immediate predecessor; splays the left subtree around that node; and attaches it to the right subtree. If not found, splays the tree around its nearest parent. Returns the new root. O(n), amortized O(log n).
def delete(self, value): n = self._find(value) # find and splay relevant node n._splay() if n.value == value: # only if value actually found left, right = n._uproot() # there is a left child: splay around its maximum, connect to right if left i...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def insert(self, value):\n insertion_point = self._find(value)\n n = SplayNode(value)\n\n # value already in the tree; add at leftmost position in right subtreepa\n if value == insertion_point.value:\n if insertion_point.right is None:\n insertion_point.right =...
[ "0.6817659", "0.6769545", "0.66346824", "0.6361414", "0.628917", "0.62290007", "0.6198229", "0.6198173", "0.6175362", "0.6160517", "0.61358464", "0.61346346", "0.612251", "0.611574", "0.61141276", "0.61083907", "0.61044216", "0.61000216", "0.60911447", "0.60911447", "0.608670...
0.723982
0
Finds the given value in the tree rooted at this tree, or its wouldbe parent if not found. Runs in time linear in the height of the tree. Does not splay the tree. Will raise an error if value is not comparable with the values already in the tree. O(n), amortized O(log n)
def _find(self, value): # case 1: look deeper, left if self.value > value and self.left is not None: return self.left._find(value) # case 2: look deeper, right if self.value < value and self.right is not None: return self.right._find(value) # case 3: fo...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def find(self, value):\n # initialize node as root\n node = self.root\n\n # find value\n while node != None:\n\n # value found: return node\n if node.value == value:\n return node\n\n # value is smaller than node: search in left sub tree\n...
[ "0.82243544", "0.7652269", "0.7579753", "0.74488044", "0.7448785", "0.73705924", "0.73668927", "0.72841203", "0.726053", "0.7164976", "0.6989404", "0.6967735", "0.6964326", "0.68822426", "0.68568945", "0.68404543", "0.682421", "0.68180585", "0.67871547", "0.6757572", "0.67536...
0.80027765
1
Get current distribution type Returns distribution_type String representing the distribution type
def get_distribution_type(self): return "IMMEDIATE"
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getDistributionType(self):\n return self._distribution_type", "def __str__(self):\r\n return self.get_distribution_type()", "def __repr__(self):\r\n return self.get_distribution_type()", "def type(self) -> str:\n return pulumi.get(self, \"type\")", "def type(self) -> str:\n ...
[ "0.84874785", "0.80631673", "0.7444268", "0.7297925", "0.7297925", "0.7297925", "0.7297925", "0.7297925", "0.7297925", "0.7297925", "0.7297925", "0.7297925", "0.7297925", "0.7297925", "0.7297925", "0.7297925", "0.7297925", "0.7297925", "0.7297925", "0.7297925", "0.7297925", ...
0.0
-1
Get a string representing distribution parameters Returns distribution_parameters String representing distribution parameters
def get_distribution_parameters(self): return "UNDEFINED"
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __parameters_string(self):\n if self._parameters == list():\n return ''\n\n docstring = \"\"\"\n\nParameters:\n\"\"\"\n \n # Compute maximum length of any parameter name\n maxlen = 0\n for param in self._parameters:\n maxlen = max(maxlen, len(param[0]...
[ "0.67125064", "0.66456765", "0.6424675", "0.62587875", "0.6246702", "0.62417793", "0.62359667", "0.611773", "0.6092618", "0.6056895", "0.5976674", "0.59536266", "0.5914604", "0.5889528", "0.58837306", "0.5868926", "0.5853692", "0.58063745", "0.57805395", "0.5779473", "0.57502...
0.70338506
0
Returns a representation of the current object Returns repr Representation of the current object
def __str__(self): return self.get_distribution_type()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __repr__(self) -> str:\n\n return self.current_obj.__repr__()", "def __repr__(self):\n return repr(self.__dict__['_obj'])", "def __repr__(self):\n return self.pretty_print(self.__dict__)", "def __repr__(self):\n return str(self.__dict__)", "def __repr__(self):\n ...
[ "0.89315206", "0.8539687", "0.82368946", "0.81998396", "0.81998396", "0.81998396", "0.81998396", "0.81998396", "0.8184986", "0.8122341", "0.81160915", "0.81160915", "0.81160915", "0.81160915", "0.81160915", "0.81160915", "0.81160915", "0.81160915", "0.81160915", "0.81160915", ...
0.0
-1
Returns a representation of the current object Returns repr Representation of the current object
def __repr__(self): return self.get_distribution_type()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __repr__(self) -> str:\n\n return self.current_obj.__repr__()", "def __repr__(self):\n return repr(self.__dict__['_obj'])", "def __repr__(self):\n return self.pretty_print(self.__dict__)", "def __repr__(self):\n return str(self.__dict__)", "def __repr__(self):\n ...
[ "0.89315206", "0.8539687", "0.82368946", "0.81998396", "0.81998396", "0.81998396", "0.81998396", "0.81998396", "0.8184986", "0.8122341", "0.81160915", "0.81160915", "0.81160915", "0.81160915", "0.81160915", "0.81160915", "0.81160915", "0.81160915", "0.81160915", "0.81160915", ...
0.0
-1
Calculate icy air disequilibrium at WEP. Calculate both sides of the equations given pressure = pressure of humid air chemical potential of ice = potential of water vapour given entropy = entropy of icy air and their Jacobians with respect to humid air dry fraction, temperature, and humid air density. Solving these equ...
def _diff_wep(a,t,dh,wair,entr,pres): ph = _eq_pressure(0,0,0,a,t,dh) gi = _ice_g(0,0,t,pres) gv = _eq_vappot(0,0,0,a,t,dh) sh = -_air_f(0,1,0,a,t,dh) si = -_ice_g(1,0,t,pres) stot = wair/a*sh + (1-wair/a)*si lhs = numpy.array([pres, gi, entr]) rhs = numpy.array([ph, gv, stot]) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _calc_qair_ilwr(rpn_hr):\n # saturation water vapour at the dew point in the pure phase\n # which within 0.5% is that of moist air\n ew = 6.112 * numpy.exp(17.62 * rpn_hr.TD / (243.12 + rpn_hr.TD))\n xvw = ew / (0.01 * rpn_hr.PN) # converting P to hectopascals\n r = 0.62198 * xvw / (1 - xvw) #...
[ "0.6756445", "0.6382236", "0.61960775", "0.6015578", "0.60144866", "0.58799005", "0.57266587", "0.5725647", "0.5714066", "0.5695833", "0.5682356", "0.5672836", "0.5660929", "0.5655873", "0.562139", "0.553381", "0.5517505", "0.5509389", "0.5490151", "0.54787296", "0.54762435",...
0.55504197
15
Calculate icy air isobaric heat capacity. Calculate the isobaric (constant pressure) heat capacity of icy air.
def cp(wair,pres,entr=None,temp=None,airf=None,dhum=None,chkvals=False, chktol=_CHKTOL,airf0=None,temp0=None,dhum0=None,chkbnd=False, mathargs=None): airf, temp, dhum = eq_wpte(wair,pres,entr=entr,temp=temp,airf=airf, dhum=dhum,chkvals=chkvals,chktol=chktol,airf0=airf0,temp0=temp0, dhum0=dhu...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def heat_capacity_of_air(self) -> float:\n\n return 1002.5 + 275 * (10 ** (-6)) * (self.ambient_temperature - 200) ** 2", "def internal_external_canopy_heat_capacity(lumped_cover_heat_capacity: float) -> float:\n return 0.1 * lumped_cover_heat_capacity", "def compute_capacity(self, totalflow, i):\r\n...
[ "0.74354917", "0.6093917", "0.60163254", "0.5968011", "0.5858678", "0.5805248", "0.57257545", "0.57138664", "0.5652657", "0.561162", "0.560186", "0.5582618", "0.5573704", "0.5565911", "0.55537146", "0.5543075", "0.54535306", "0.5443404", "0.5435353", "0.54346067", "0.5370866"...
0.0
-1
Calculate icy air adiabatic lapse rate. Calculate the adiabatic lapse rate of icy air. This is the proper 'moist' lapse rate when the air is icesaturated.
def lapserate(wair,pres,entr=None,temp=None,airf=None,dhum=None, chkvals=False,chktol=_CHKTOL,airf0=None,temp0=None,dhum0=None, chkbnd=False,mathargs=None): h_sp = iceair_h(0,1,1,wair,pres,entr=entr,airf=airf,temp=temp,dhum=dhum, chkvals=chkvals,chktol=chktol,airf0=airf0,temp0=temp0,dhum0=dhum0, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def glycolysis_rate_cal (self) :\n x = self.mitochondria.get_atp()\n y = self.mitochondria.get_adp()\n a = self.atp\n b = self.adp\n self.adp_to_atp(self.mitochondria.atp_translocase(math.ceil((x*b - a*y)/(a+b+x+y))))\n if a<1 :\n return\n else :\n ...
[ "0.6763252", "0.62059927", "0.599079", "0.59579235", "0.58234966", "0.5819531", "0.5758348", "0.5744183", "0.57330054", "0.5633001", "0.5581914", "0.5580046", "0.5565659", "0.5541309", "0.55374515", "0.5518707", "0.5518669", "0.5511755", "0.54996", "0.5481445", "0.5481055", ...
0.5213209
43
Calculate icy air potential density. Calculate the potential density of icy air.
def potdensity(wair,temp,pres,ppot,airf=None,dhum=None,apot=None, tpot=None,dhpot=None,chkvals=False,chktol=_CHKTOL,airf0=None, dhum0=None,apot0=None,tpot0=None,dhpot0=None,chkbnd=False, mathargs=None): airf, dhum, apot, tpot, dhpot = eq_pot(wair,temp,pres,ppot,airf=airf, dhum=dhum,apot=apot,tpo...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def air_density(self):\n return self.flow_field.air_density", "def density_of_air(self) -> float:\n\n return self.pressure / (SPECIFIC_GAS_CONSTANT_OF_AIR * self.ambient_temperature)", "def air_density(altitude):\n p = pressure(altitude) # psf\n t = temperature(altitude) # R\n rho = p/...
[ "0.7267969", "0.70504266", "0.6820884", "0.6551421", "0.6116385", "0.6099453", "0.5934575", "0.56780654", "0.56720906", "0.56647027", "0.5627741", "0.55535847", "0.5552964", "0.5546231", "0.55280733", "0.54853123", "0.54844415", "0.5462842", "0.54517245", "0.54357964", "0.543...
0.5719371
7
Takes in a single NMAP XML host as a string. Outputs a string containing the node's mac address.
def get_node_id(host): for h in host: mac_address = h.find("address").nextSibling address = repr(mac_address) if 'addrtype="mac"' in address: host_id = address.split('\n')[0].split('"')[1] return host_id
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_mac(self, node_id):\n nc = '%02x' % self.node_class\n nr_iface = '%02x' % self.nr_host_interface\n node_id = '%08x' % node_id\n\n return '%s:%s:%s:%s:%s:%s' % (nc, nr_iface, node_id[0:2], node_id[2:4], node_id[4:6], node_id[6:8])", "def get_mac_address(self, result, host):\n ...
[ "0.719298", "0.692805", "0.6891194", "0.6869869", "0.6679848", "0.66184926", "0.65393233", "0.64772004", "0.64573574", "0.6422913", "0.6405595", "0.64011943", "0.63762456", "0.63762456", "0.6303248", "0.62090266", "0.62090266", "0.62090266", "0.62090266", "0.6183343", "0.6182...
0.67476445
4
Takes in one Beautiful Soup object. Returns a string for an OSMatch value.
def get_os_class(host): for h in host: os_class = h.osclass if os_class is not None: os_class = str(os_class) string_os_class = os_class.split('"')[1].split('"')[0] return string_os_class else: return "No OS class available."
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_os_match(host):\n for h in host:\n os_match = h.osmatch\n if os_match is not None:\n os_match = str(os_match)\n return os_match.split('\"')[1].split('\"')[0]\n else:\n return \"No OS version available.\"", "def _output_match(match, namespaces):\n ...
[ "0.665678", "0.5779828", "0.54926515", "0.53518134", "0.51314497", "0.51309866", "0.512766", "0.51216316", "0.5099324", "0.5061958", "0.5041121", "0.49278864", "0.4874123", "0.4835154", "0.48303917", "0.48235947", "0.48179394", "0.4809607", "0.48092568", "0.48092568", "0.4786...
0.48689753
13
Takes in one Beautiful Soup object. Returns a string for an OSMatch value.
def get_os_match(host): for h in host: os_match = h.osmatch if os_match is not None: os_match = str(os_match) return os_match.split('"')[1].split('"')[0] else: return "No OS version available."
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _output_match(match, namespaces):\n out = \"?\"\n\n if isinstance(match, etree._Element):\n prefixed_name = _prefixed_name_from_absolute_name(match.tag, namespaces)\n out = \"<{0}>\".format(prefixed_name)\n\n elif isinstance(match, etree._ElementStringResult):\n if match.is_attrib...
[ "0.5779828", "0.54926515", "0.53518134", "0.51314497", "0.51309866", "0.512766", "0.51216316", "0.5099324", "0.5061958", "0.5041121", "0.49278864", "0.4874123", "0.48689753", "0.4835154", "0.48303917", "0.48235947", "0.48179394", "0.4809607", "0.48092568", "0.48092568", "0.47...
0.665678
0
Generate and return the publish path for the filename.
def getPublishPath(self, filename): #recognize first if not self.isRecognized(filename): return None else: filename = Template(xpath(self.currentDataset, './/_:fileTemplate/text()', self.currentDatasetNs)).substitute(\ self.groupDict, hostname...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def compute_published_path_to_file(self, file_to_publish: str) -> str:\n\n return os.path.join(\n self.publish_dir,\n os.path.basename(file_to_publish),\n )", "def content_file_name(instance, filename):\r\n return '/'.join([str(instance.app.publisher.id), str(instance.app.i...
[ "0.78686666", "0.6806541", "0.678487", "0.6558062", "0.65087223", "0.6498821", "0.64854246", "0.6419274", "0.6388602", "0.6381254", "0.63399154", "0.63327724", "0.62323785", "0.62271446", "0.62265354", "0.6225824", "0.6220859", "0.62181777", "0.6217056", "0.6212632", "0.62084...
0.80469763
0
Add edited `figure` tag in LaTeX file.
def add_figure(self, figure_name: str, figure_caption: str) -> None: tag = r''' \begin{figure}[H] \centering \caption{''' + figure_caption + '''} \label{fig:''' + figure_name + '''} \includegraphics[width=400px]{../plots/''' + figure_name + '''} \...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_figure(self, ref, Fig):\n\n self.pytex.add_created(Fig.file_name)\n\n self._figure_registry[ref] = {'number': self.fig_count, 'Figure': Fig}\n self.fig_count += 1", "def visit_figure(self, node):\n atts = {\"class\": \"figure\"}\n if node.get(\"width\"):\n at...
[ "0.71015304", "0.6809182", "0.6522407", "0.65177983", "0.6421814", "0.6398077", "0.61088103", "0.61007166", "0.60397273", "0.5953343", "0.58881736", "0.58272", "0.5762457", "0.57205206", "0.5690719", "0.5685603", "0.5677344", "0.5615165", "0.5596252", "0.558126", "0.55643487"...
0.7570416
0
Sets the token_type of this TokenEKey.
def token_type(self, token_type: str): if token_type is None: raise ValueError("Invalid value for `token_type`, must not be `None`") # noqa: E501 self._token_type = token_type
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def token_type(self, token_type):\n if self.local_vars_configuration.client_side_validation and token_type is None: # noqa: E501\n raise ValueError(\"Invalid value for `token_type`, must not be `None`\") # noqa: E501\n\n self._token_type = token_type", "def auth_token_validator_type(se...
[ "0.7669944", "0.6953014", "0.6566452", "0.6566452", "0.63088703", "0.62989676", "0.62989676", "0.6281246", "0.6185639", "0.61686635", "0.6056397", "0.60024965", "0.59098184", "0.59027773", "0.59027773", "0.5885816", "0.5885816", "0.587023", "0.5866116", "0.58334637", "0.58327...
0.80253315
0
Gets the ekey of this TokenEKey.
def ekey(self) -> TokenEKeyEkey: return self._ekey
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_key(self):\n return self.key", "def get_key(self):\n return self.key", "def key(self) -> Key:\n return self._key", "def get_key(self):\n\n return self._key", "def getKey(self):\n return self.key", "def getKey(self):\n return self.key", "def getKey(s...
[ "0.73664737", "0.73664737", "0.7362837", "0.72950524", "0.72490734", "0.72300774", "0.71911544", "0.71878904", "0.71878904", "0.71878904", "0.71878904", "0.7166014", "0.7147974", "0.7099349", "0.69946456", "0.69746834", "0.69493663", "0.6928506", "0.69208694", "0.68937224", "...
0.92793757
0
Returns default config for a single agent.
def init_default_config( agent_type: DefaultSupportedAgent, config_overrides: Dict[str, Any]) -> ma_types.AgentConfig: if agent_type == DefaultSupportedAgent.TD3: return td3.TD3Config(**config_overrides) elif agent_type == DefaultSupportedAgent.SAC: return sac.SACConfig(**config_overrides) elif ag...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_default_config():\n # pylint: disable=cyclic-import\n from raylab.agents.sac import DEFAULT_CONFIG\n\n return DEFAULT_CONFIG", "def antenny_config_load_default(self):\n return self.antenny_config.load_default_config()", "def load_agent_config(self) -> AgentConfig:\n a...
[ "0.74353015", "0.7216816", "0.7167045", "0.70767266", "0.7052453", "0.70471483", "0.6862385", "0.66981345", "0.6638491", "0.6519376", "0.644763", "0.6426028", "0.6421328", "0.6383621", "0.63776994", "0.634264", "0.634264", "0.6320514", "0.6320371", "0.63129973", "0.6310201", ...
0.73207176
1
EventualResult.stash() stores the object in the global ResultStore.
def test_stash(self): dr = EventualResult(Deferred(), None) uid = dr.stash() self.assertIdentical(dr, _store.retrieve(uid))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def store(self, job, result):\n pass", "def _store_result(self, task_id, result, status,\n traceback=None, request=None):\n content_type, content_encoding, result = self.encode_content(result)\n _, _, meta = self.encode_content({\n 'children': self.current_tas...
[ "0.58440447", "0.550813", "0.54409665", "0.5401808", "0.53143907", "0.52938", "0.5246258", "0.52180356", "0.520061", "0.52001745", "0.5166497", "0.5155301", "0.5155301", "0.51422745", "0.51207215", "0.5084851", "0.5084851", "0.5039193", "0.50363743", "0.50363743", "0.5024216"...
0.68448466
0
Boolean determining if a string str_input is a number, either a float or integer.
def isvalid(str_input): if str_input == "": return True if str_input[0] not in ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "-", "."]: return False dot_count = 0 for ch in str_input[1:]: if ch == ".": dot_count += 1 if dot_count == 2: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_number(str):\n\n # Local constants\n\n # Local variabes\n\n #****** start is_number() ******#\n\n try:\n float(str)\n return True\n except ValueError:\n return False", "def is_number(string):\r\n try:\r\n float(string)\r\n return True\r\n except Valu...
[ "0.86268866", "0.8501345", "0.8496705", "0.84817076", "0.8404099", "0.8361767", "0.835624", "0.8337683", "0.8337683", "0.8337683", "0.8332271", "0.828113", "0.82664853", "0.8262334", "0.8261644", "0.81122655", "0.81122655", "0.80780333", "0.8005314", "0.79822546", "0.7967955"...
0.0
-1
Convert a COBOL or IDMS entity name to TitleCase.
def name_to_title_case(name: str, escape_first_numeric: bool = True) -> str: text_stripped = name.strip() # Skip empty strings and '-' if text_stripped == '' or text_stripped == '-': return text_stripped res = '' text_split = re.split(COBOL_NAME_SPLIT_REGEX, text_s...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def camelcase_to_sentencecase(name: str) -> str:\n return stringcase.sentencecase(stringcase.snakecase(name)).lower()", "def snakecase_to_sentencecase(name: str) -> str:\n return stringcase.sentencecase(name).lower()", "def proper_title_case(s):\n nocaps = [\"the\"] # This needs to be extended.", "d...
[ "0.70286536", "0.6862787", "0.6612666", "0.6580866", "0.65680367", "0.6444318", "0.6374823", "0.6329182", "0.6328612", "0.63208026", "0.6319576", "0.6286995", "0.62687755", "0.6258247", "0.62512946", "0.62457883", "0.6208132", "0.6198684", "0.6160146", "0.6153628", "0.6150577...
0.6677642
2
Convert a camelCase COBOL or IDMS entity name to the MySQL equivalent.
def camel_case_to_mysql(name: str) -> str: view_name = name # Convert to MySQL view name idx_prefix = 'Ix' if view_name.startswith(idx_prefix): view_name = view_name.replace(idx_prefix, '', 1) return CobolDefinition.name_to_snake_case(view_name) + '_view' ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _to_db_identifier(name):\n return name.replace('-', '_')", "def namingConvention(columnName):\n words = columnName.lower().split(\"_\")\n\n def cap(word):\n if word.lower() == \"id\":\n return word.upper()\n else:\n return word.capitalize()...
[ "0.61794657", "0.5870314", "0.5593582", "0.5586042", "0.5541682", "0.54808486", "0.54230803", "0.54230803", "0.54192376", "0.5406589", "0.5387062", "0.53805107", "0.53789353", "0.5357428", "0.53140527", "0.5306763", "0.5282525", "0.52736235", "0.52710086", "0.5259988", "0.524...
0.6715727
0
Remove "." line delineators.
def __rm_dots(file_contents: str) -> str: result_lines = list() for l in file_contents.splitlines(): # Remove right whitespace and "." chars line = l.rstrip().rstrip('.') result_lines.append(line) return '\n'.join(result_lines)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def fix_missing_period(line):\n if \"@highlight\" in line: return line\n if line==\"\": return line\n if line[-1] in END_TOKENS: return line\n # print line[-1]\n return line + \" .\"", "def fix_missing_period(line):\n if \"@highlight\" in line:\n return line\n if line == \"\":\n return l...
[ "0.70102614", "0.69690907", "0.6858294", "0.63586795", "0.6284325", "0.62747204", "0.6173184", "0.61547244", "0.60653025", "0.6042226", "0.599786", "0.59475976", "0.59253037", "0.5905653", "0.5905653", "0.58861345", "0.58588314", "0.5854004", "0.58518565", "0.5831624", "0.582...
0.7284178
0
Returns a matplotlib figure containing the plotted confusion matrix.
def plot_confusion_matrix(cm, class_names): figure = plt.figure(figsize=(10, 10)) plt.imshow(cm, interpolation='nearest', cmap=plt.cm.Blues) plt.title("Confusion matrix") plt.colorbar() tick_marks = np.arange(len(class_names)) plt.xticks(tick_marks, class_names, rotation=45) plt.yticks(tick_marks, class_n...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def plot_confusion_matrix(cm, class_names):\n figure = plt.figure(figsize=(8, 8))\n plt.imshow(cm, interpolation='nearest', cmap=plt.cm.Blues)\n plt.title(\"Confusion matrix\")\n plt.colorbar()\n tick_marks = np.arange(len(class_names))\n plt.xticks(tick_marks, class_names, rotation=45)\n plt....
[ "0.77491516", "0.7717752", "0.7664576", "0.76329076", "0.75771934", "0.75757915", "0.7523076", "0.75182974", "0.75016636", "0.74832636", "0.746719", "0.7453887", "0.7453294", "0.74216324", "0.74176985", "0.7395515", "0.7386801", "0.73838943", "0.7383021", "0.73677856", "0.736...
0.78412247
0
Basic 2frame conv model with stochastic tower.
def next_frame_basic_stochastic(): hparams = basic_deterministic_params.next_frame_basic_deterministic() hparams.stochastic_model = True hparams.add_hparam("latent_channels", 1) hparams.add_hparam("latent_std_min", -5.0) hparams.add_hparam("num_iterations_1st_stage", 15000) hparams.add_hparam("num_iteration...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def mtf_transformer2_base():\n hparams = common_hparams.basic_params1()\n\n hparams.add_hparam(\"d_model\", 1024)\n hparams.batch_size = 4\n hparams.max_length = 1024\n hparams.label_smoothing = 0.0\n # a small positive value - this seems important for stability when training\n # with bfloat16 activations.\...
[ "0.60819006", "0.5985282", "0.5972753", "0.59066945", "0.5890531", "0.58844554", "0.58621913", "0.57617784", "0.57308376", "0.57284033", "0.57281274", "0.5688421", "0.5675963", "0.564743", "0.5627439", "0.5621415", "0.55984205", "0.5592108", "0.5587884", "0.55827945", "0.5570...
0.59088784
3
Basic 2frame conv model with stochastic tower.
def next_frame_sampling_stochastic(): hparams = basic_deterministic_params.next_frame_sampling() hparams.stochastic_model = True hparams.add_hparam("latent_channels", 1) hparams.add_hparam("latent_std_min", -5.0) hparams.add_hparam("num_iterations_1st_stage", 15000) hparams.add_hparam("num_iterations_2nd_st...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def mtf_transformer2_base():\n hparams = common_hparams.basic_params1()\n\n hparams.add_hparam(\"d_model\", 1024)\n hparams.batch_size = 4\n hparams.max_length = 1024\n hparams.label_smoothing = 0.0\n # a small positive value - this seems important for stability when training\n # with bfloat16 activations.\...
[ "0.60819006", "0.5985282", "0.5972753", "0.59088784", "0.59066945", "0.5890531", "0.58844554", "0.58621913", "0.57617784", "0.57308376", "0.57284033", "0.57281274", "0.5688421", "0.5675963", "0.564743", "0.5627439", "0.5621415", "0.55984205", "0.5592108", "0.5587884", "0.5582...
0.0
-1
Basic 2frame conv model with stochastic discrete latent.
def next_frame_basic_stochastic_discrete(): hparams = basic_deterministic_params.next_frame_sampling() hparams.batch_size = 4 hparams.video_num_target_frames = 6 hparams.scheduled_sampling_mode = "prob_inverse_lin" hparams.scheduled_sampling_decay_steps = 40000 hparams.scheduled_sampling_max_prob = 1.0 hp...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def next_frame_basic_stochastic_discrete_long():\n hparams = next_frame_basic_stochastic_discrete()\n hparams.batch_size = 2\n hparams.video_num_target_frames = 16\n return hparams", "def next_frame_basic_stochastic():\n hparams = basic_deterministic_params.next_frame_basic_deterministic()\n hparams.stocha...
[ "0.65258604", "0.6234996", "0.60417783", "0.60259753", "0.60017264", "0.5918711", "0.5895798", "0.58825254", "0.5828666", "0.5819997", "0.58071244", "0.5805638", "0.57283384", "0.5706641", "0.570511", "0.5691769", "0.5680646", "0.56733453", "0.56467324", "0.5626544", "0.56150...
0.6748455
0
Releases the connection gracefully, reading all the content to the void.
async def release(self) -> None: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def close(self):\n self.connection = None", "def close(self): \n\t\tself.connection = None", "def release(self):\n self.stream.release()", "async def close_connection(self):\n\t\t...", "def close_connection(self):\n self.connection.close()", "def close_connection(self):\n self...
[ "0.73584926", "0.7323938", "0.7175219", "0.69321966", "0.69293207", "0.69293207", "0.69292086", "0.6904511", "0.69028425", "0.6892687", "0.68782365", "0.68696314", "0.6853989", "0.6835939", "0.6817997", "0.68085575", "0.67864615", "0.67794216", "0.677574", "0.67607325", "0.67...
0.66642946
34
Returns name specified in ContentDisposition header or None if missed or header is malformed.
def name(self) -> Optional[str]: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _get_filename_from_headers(headers: Dict[str, str]) -> Optional[str]:\n content_disposition = headers.get(\"content-disposition\", None)\n if content_disposition:\n for chunk in content_disposition.split(\";\"):\n file_name = re.findall(\"filename=(.+)\", chunk)\n ...
[ "0.79825735", "0.7609921", "0.70833033", "0.70711124", "0.69753903", "0.68907946", "0.68156177", "0.67940754", "0.6565282", "0.6483395", "0.6356778", "0.6271695", "0.6093324", "0.6020027", "0.5954486", "0.5778702", "0.5773342", "0.57534546", "0.5728942", "0.5728942", "0.57289...
0.0
-1
Wrap boundary parameter value in quotes, if necessary. Reads self.boundary and returns a unicode sting.
def _boundary_value(self) -> str: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def to_right_boundary(self) -> str:\n return '{}{}'.format(self.value, ']' if self.is_closed else ')')", "def boundary(self):\n return self._boundary", "def regional_data_boundary(self) -> Optional[str]:\n return pulumi.get(self, \"regional_data_boundary\")", "def regional_data_boundary(...
[ "0.58573264", "0.5826272", "0.5813801", "0.5649454", "0.5453138", "0.53623796", "0.53404427", "0.5215131", "0.5104184", "0.5012146", "0.4991715", "0.4989953", "0.49837098", "0.49760097", "0.49714896", "0.4965049", "0.49544954", "0.49246007", "0.49156168", "0.48849088", "0.483...
0.7296312
0
Size of the payload.
def size(self) -> Optional[int]: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_size(self):\n return len(self.get_payload()) + 4", "def payload_length(self):\n return self._payload_length", "def payload_length(self):\n return self.total_length - self.headers_length - _PRELUDE_LENGTH - 4", "def payload_size(self):\n return _spacegrant_swig.ax25_udp_pdu...
[ "0.89249444", "0.8686395", "0.8238032", "0.82065785", "0.8151969", "0.81307334", "0.8091609", "0.8048538", "0.80406797", "0.7983456", "0.79015565", "0.79015565", "0.79015565", "0.79015565", "0.79015565", "0.7896302", "0.7873572", "0.7828828", "0.7817869", "0.78171325", "0.781...
0.0
-1
>>> list(take(5, xrange(3))) [0, 1, 2] >>> list(take(5, xrange(10))) [0, 1, 2, 3, 4]
def take(num, iterable): for i, e in enumerate(iterable): if i >= num: break yield e
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def take(num, iterable):\n return list(islice(iterable, num))", "def take(n, iterable):\n return list(islice(iterable, n))", "def take(n, iterable):\n return list(islice(iterable, n))", "def take(iterable, n):\n return list(itertools.islice(iterable, n))", "def take(n, iterable):\n retur...
[ "0.80156595", "0.7818729", "0.7818729", "0.7749526", "0.7742026", "0.7742026", "0.72649163", "0.72211236", "0.7151945", "0.7109316", "0.69306463", "0.67910904", "0.66181654", "0.6386813", "0.62289554", "0.6173985", "0.61213857", "0.6097041", "0.60713893", "0.60713893", "0.603...
0.63826436
14
Positions image so that the middlepart of the image will be shown. Image will be cropped if neccessary
def positionZoomed(self): rect_size = self._image.get_rect() if rect_size.width > 720: self.x = (int((720 - rect_size.width ) / 2)) if rect_size.height > 720: self.y = (int((720 - rect_size.height) / 2))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def center_image(image):\r\n image.anchor_x = image.width / 2\r\n image.anchor_y = image.height / 2", "def center_image(image):\r\n image.anchor_x = image.width / 2\r\n image.anchor_y = image.height / 2", "def center_image(image):\n image.anchor_x = image.width/2\n image.anchor_y = image.heig...
[ "0.7276136", "0.7276136", "0.7189136", "0.67870843", "0.6773721", "0.6538899", "0.64968526", "0.64279526", "0.62736356", "0.6266219", "0.62435776", "0.62110037", "0.62105465", "0.6207385", "0.6139054", "0.61174464", "0.6078023", "0.60639554", "0.60586065", "0.6050629", "0.598...
0.6999423
3
determines this (self's) thread id
def _get_my_tid(self): if not self.is_alive(): raise threading.ThreadError("the thread is not active") # do we have it cached? if hasattr(self, "_thread_id"): return self._thread_id # no, look for it in the _active dict for tid, tobj in threading._active...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def thread_id(self):\n return self._thread_id", "def get_id(self):\n if hasattr(self, \"_thread_id\"):\n return self._thread_id\n for id, thread in threading._active.items():\n if thread is self:\n return id", "def get_id(self):\n if hasattr(self...
[ "0.87604755", "0.855684", "0.855684", "0.84960526", "0.8430593", "0.806207", "0.79912037", "0.76469076", "0.7611317", "0.7069843", "0.70444417", "0.6986155", "0.6953767", "0.68797904", "0.68797904", "0.68797904", "0.68797904", "0.6876224", "0.6822325", "0.6800639", "0.6782105...
0.7944841
7
Create an initial unbalanced list of chunks.
def _create_initial_chunks(self, by_dir): class Chunk(object): def __init__(self, paths, index): """List of PathData objects that together form a single chunk of tests""" self.paths = deque(paths) self.time = sum(item.time for item in ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def make_chunks(l, n):\n return [l[i:i+n] for i in range(0, len(l), n)]", "def test_create_chunks():\n items = list(range(0, 100))\n size = 3\n\n chunks = create_chunks(items, size)\n\n current = next(chunks)\n assert len(current) == size\n assert current == [0, 1, 2]\n\n current = next(c...
[ "0.7447718", "0.7261814", "0.7082748", "0.7065405", "0.6992263", "0.6966495", "0.6953952", "0.6928679", "0.6919171", "0.69144195", "0.69018567", "0.68451905", "0.6831411", "0.68096125", "0.68022394", "0.6767131", "0.6765942", "0.67554605", "0.6748839", "0.6746829", "0.6744284...
0.0
-1
Construct a layernorm module in the TF style (epsilon inside the square root).
def __init__(self, hidden_size, eps=1e-12): super(BertLayerNorm, self).__init__() self.weight = nn.Parameter(torch.ones(hidden_size)) self.bias = nn.Parameter(torch.zeros(hidden_size)) self.variance_epsilon = eps
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def verhulst(nb_init, t0, tf, eps, methode, gamma, K) :\n f=lambda y,t : gamma*y*(1-y/K)\n Y=meth_epsilon(nb_init, t0, tf, eps, f, methode)\n return Y", "def malthusiens(nb_init, t0, tf, eps, methode, gamma ) :\n\n f=lambda y, t : gamma*y\n Y=meth_epsilon(nb_init, t0, tf, eps, f, methode)\n ...
[ "0.62775403", "0.6016289", "0.57939583", "0.57408345", "0.55384517", "0.5519017", "0.5423246", "0.5412519", "0.53890854", "0.53680634", "0.5351635", "0.5287217", "0.5256671", "0.5233436", "0.5229289", "0.5225385", "0.5220274", "0.52193713", "0.51940197", "0.51940197", "0.5193...
0.0
-1
Initializes a new instance of UIViewer.
def __init__(self, **kwargs): # init base super().__init__(**kwargs) self.name = "Pero" # init view self._view = None
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self):\n self.view = GuiView(self)\n return", "def init_ui(self):\n raise NotImplementedError", "def init_ui(self):\n raise NotImplementedError", "def __init__(self, viewer: geoviewer.GeoGraphViewer) -> None:\n super().__init__()\n self.viewer = viewer\n...
[ "0.709434", "0.6864556", "0.6864556", "0.68442494", "0.6805175", "0.67867404", "0.6786543", "0.6780052", "0.67337924", "0.6676671", "0.6642723", "0.6642723", "0.6637846", "0.6613744", "0.65641016", "0.65060073", "0.6503612", "0.64948964", "0.64841104", "0.6475031", "0.6448487...
0.0
-1