query
stringlengths
9
9.05k
document
stringlengths
10
222k
metadata
dict
negatives
listlengths
30
30
negative_scores
listlengths
30
30
document_score
stringlengths
4
10
document_rank
stringclasses
2 values
Reduce this Dataset's data by applying ``sum`` along some dimension(s).
def sum( self, dim: Dims = None, *, skipna: bool | None = None, min_count: int | None = None, keep_attrs: bool | None = None, **kwargs: Any, ) -> Dataset: return self.reduce( duck_array_ops.sum, dim=dim, skipna=skipn...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def sum(\n self,\n dim: Dims = None,\n *,\n skipna: bool | None = None,\n min_count: int | None = None,\n keep_attrs: bool | None = None,\n **kwargs: Any,\n ) -> DataArray:\n return self.reduce(\n duck_array_ops.sum,\n dim=dim,\n ...
[ "0.69223887", "0.68643904", "0.68584", "0.68099666", "0.6725604", "0.6725604", "0.66675615", "0.6634007", "0.6546494", "0.6546494", "0.6421243", "0.64142853", "0.63628495", "0.63059735", "0.62661374", "0.62658197", "0.6225546", "0.6212655", "0.61623865", "0.6143209", "0.60457...
0.70593727
0
Reduce this DataArray's data by applying ``count`` along some dimension(s).
def count( self, dim: Dims = None, *, keep_attrs: bool | None = None, **kwargs: Any, ) -> DataArray: return self.reduce( duck_array_ops.count, dim=dim, keep_attrs=keep_attrs, **kwargs, )
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def count(\n self,\n dim: Dims = None,\n *,\n keep_attrs: bool | None = None,\n **kwargs: Any,\n ) -> DataArray:\n if (\n flox_available\n and OPTIONS[\"use_flox\"]\n and contains_only_chunked_or_numpy(self._obj)\n ):\n ...
[ "0.6582146", "0.6582146", "0.65379834", "0.6224404", "0.6224404", "0.59004956", "0.5841828", "0.5838448", "0.57762665", "0.573857", "0.56812054", "0.5657385", "0.55505395", "0.55487853", "0.55471367", "0.55208504", "0.5506666", "0.54985136", "0.5492544", "0.54757905", "0.5454...
0.6898398
0
Reduce this DataArray's data by applying ``mean`` along some dimension(s).
def mean( self, dim: Dims = None, *, skipna: bool | None = None, keep_attrs: bool | None = None, **kwargs: Any, ) -> DataArray: return self.reduce( duck_array_ops.mean, dim=dim, skipna=skipna, keep_attrs=keep_att...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def mean(self):\n return self.data.mean(axis=-1, keepdims=True)", "def mean(self, axis=0, **kwargs) -> \"Dataset\":\n return self.aggregate(axis=axis, func=np.mean, **kwargs)", "def mean(\n self,\n dim: Dims = None,\n *,\n skipna: bool | None = None,\n keep_attr...
[ "0.6932092", "0.69198084", "0.68324643", "0.6829645", "0.6829645", "0.68155813", "0.6670382", "0.6551353", "0.6551353", "0.65419024", "0.6500794", "0.6467665", "0.6430388", "0.63965666", "0.634229", "0.6330614", "0.63156646", "0.6315549", "0.62959886", "0.62906164", "0.624815...
0.7121785
0
Reduce this DataArray's data by applying ``prod`` along some dimension(s).
def prod( self, dim: Dims = None, *, skipna: bool | None = None, min_count: int | None = None, keep_attrs: bool | None = None, **kwargs: Any, ) -> DataArray: return self.reduce( duck_array_ops.prod, dim=dim, skipna=s...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def prod(self, axis=None, keepdims=False, dtype=None, out=None):\n return np.multiply.reduce(\n self, out=out, axis=axis, keepdims=keepdims, dtype=dtype\n )", "def prod(\n self,\n dim: Dims = None,\n *,\n skipna: bool | None = None,\n min_count: int | N...
[ "0.75356025", "0.69897264", "0.69897264", "0.69731647", "0.68985814", "0.6810773", "0.6810773", "0.6472493", "0.63539034", "0.6327443", "0.6250724", "0.6143561", "0.60524917", "0.6012047", "0.5895768", "0.58667177", "0.58586097", "0.58586097", "0.58586097", "0.58337677", "0.5...
0.72356445
1
Reduce this Dataset's data by applying ``all`` along some dimension(s).
def all( self, dim: Dims = None, *, keep_attrs: bool | None = None, **kwargs: Any, ) -> Dataset: if ( flox_available and OPTIONS["use_flox"] and contains_only_chunked_or_numpy(self._obj) ): return self._flox_redu...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def all(\n self,\n dim: Dims = None,\n *,\n keep_attrs: bool | None = None,\n **kwargs: Any,\n ) -> Dataset:\n return self.reduce(\n duck_array_ops.array_all,\n dim=dim,\n numeric_only=False,\n keep_attrs=keep_attrs,\n ...
[ "0.69627005", "0.69300705", "0.69300705", "0.68929625", "0.68462247", "0.6555234", "0.6555234", "0.64865315", "0.64326197", "0.6402593", "0.6402593", "0.6244518", "0.62295026", "0.6124534", "0.6039926", "0.59571075", "0.5946202", "0.5869544", "0.56962043", "0.5633015", "0.561...
0.70568603
1
Reduce this Dataset's data by applying ``any`` along some dimension(s).
def any( self, dim: Dims = None, *, keep_attrs: bool | None = None, **kwargs: Any, ) -> Dataset: if ( flox_available and OPTIONS["use_flox"] and contains_only_chunked_or_numpy(self._obj) ): return self._flox_redu...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def any(\n self,\n dim: Dims = None,\n *,\n keep_attrs: bool | None = None,\n **kwargs: Any,\n ) -> Dataset:\n return self.reduce(\n duck_array_ops.array_any,\n dim=dim,\n numeric_only=False,\n keep_attrs=keep_attrs,\n ...
[ "0.7110761", "0.7086105", "0.703172", "0.703172", "0.70229447", "0.6403789", "0.6393615", "0.6261724", "0.61942995", "0.6074665", "0.59774745", "0.5968099", "0.5967931", "0.59597373", "0.58590436", "0.57441306", "0.57049936", "0.5693786", "0.5693786", "0.5675616", "0.56408346...
0.7161406
1
Reduce this Dataset's data by applying ``median`` along some dimension(s).
def median( self, dim: Dims = None, *, skipna: bool | None = None, keep_attrs: bool | None = None, **kwargs: Any, ) -> Dataset: return self.reduce( duck_array_ops.median, dim=dim, skipna=skipna, numeric_only=True...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def median_filter(self):\n print \"Median-Filtering...\"\n D = self.D\n x = np.median(np.median(D,axis=1),axis=1)\n for i in xrange(len(x)):\n D[i,:,:] -= x[i]\n self.D = D\n print \"done.\"", "def median(\n self,\n dim: Dims = None,\n *,...
[ "0.7723946", "0.73474264", "0.73474264", "0.73474264", "0.67132735", "0.6709282", "0.6704458", "0.6682933", "0.6635858", "0.656867", "0.65672284", "0.6512514", "0.64834887", "0.64834887", "0.6444135", "0.63871884", "0.6383317", "0.6333734", "0.62151307", "0.61960506", "0.6195...
0.738869
1
Reduce this Dataset's data by applying ``cumsum`` along some dimension(s).
def cumsum( self, dim: Dims = None, *, skipna: bool | None = None, keep_attrs: bool | None = None, **kwargs: Any, ) -> Dataset: return self.reduce( duck_array_ops.cumsum, dim=dim, skipna=skipna, numeric_only=True...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def cumsum(\n self,\n dim: Dims = None,\n *,\n skipna: bool | None = None,\n keep_attrs: bool | None = None,\n **kwargs: Any,\n ) -> DataArray:\n return self.reduce(\n duck_array_ops.cumsum,\n dim=dim,\n skipna=skipna,\n ...
[ "0.75369805", "0.75369805", "0.75369805", "0.6748461", "0.67054296", "0.66430676", "0.63819027", "0.63511914", "0.63409925", "0.6273229", "0.62687963", "0.62687963", "0.62687963", "0.62631625", "0.62614137", "0.624574", "0.61842084", "0.61842084", "0.61842084", "0.60996747", ...
0.7699135
1
Reduce this Dataset's data by applying ``cumprod`` along some dimension(s).
def cumprod( self, dim: Dims = None, *, skipna: bool | None = None, keep_attrs: bool | None = None, **kwargs: Any, ) -> Dataset: return self.reduce( duck_array_ops.cumprod, dim=dim, skipna=skipna, numeric_only=Tr...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def cumprod(\n self,\n dim: Dims = None,\n *,\n skipna: bool | None = None,\n keep_attrs: bool | None = None,\n **kwargs: Any,\n ) -> DataArray:\n return self.reduce(\n duck_array_ops.cumprod,\n dim=dim,\n skipna=skipna,\n ...
[ "0.78994447", "0.78994447", "0.78994447", "0.70834005", "0.7032063", "0.69815505", "0.6964613", "0.6532074", "0.62200755", "0.6205164", "0.62014854", "0.61457735", "0.6142508", "0.6083153", "0.60304993", "0.59804726", "0.59804726", "0.5861358", "0.5861358", "0.5861358", "0.58...
0.8054797
1
Reduce this Dataset's data by applying ``all`` along some dimension(s).
def all( self, dim: Dims = None, *, keep_attrs: bool | None = None, **kwargs: Any, ) -> Dataset: if ( flox_available and OPTIONS["use_flox"] and contains_only_chunked_or_numpy(self._obj) ): return self._flox_redu...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def all(\n self,\n dim: Dims = None,\n *,\n keep_attrs: bool | None = None,\n **kwargs: Any,\n ) -> Dataset:\n return self.reduce(\n duck_array_ops.array_all,\n dim=dim,\n numeric_only=False,\n keep_attrs=keep_attrs,\n ...
[ "0.69636464", "0.69317317", "0.69317317", "0.68936807", "0.6847603", "0.65551496", "0.65551496", "0.6485944", "0.64324665", "0.64027697", "0.64027697", "0.6244525", "0.62312984", "0.6125453", "0.60393447", "0.59572035", "0.5945839", "0.58689076", "0.5696258", "0.5634013", "0....
0.7058243
0
Reduce this Dataset's data by applying ``any`` along some dimension(s).
def any( self, dim: Dims = None, *, keep_attrs: bool | None = None, **kwargs: Any, ) -> Dataset: if ( flox_available and OPTIONS["use_flox"] and contains_only_chunked_or_numpy(self._obj) ): return self._flox_redu...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def any(\n self,\n dim: Dims = None,\n *,\n keep_attrs: bool | None = None,\n **kwargs: Any,\n ) -> Dataset:\n return self.reduce(\n duck_array_ops.array_any,\n dim=dim,\n numeric_only=False,\n keep_attrs=keep_attrs,\n ...
[ "0.7112423", "0.70864093", "0.7033621", "0.7033621", "0.7024333", "0.6406168", "0.63930935", "0.6261834", "0.61942494", "0.6075047", "0.59765315", "0.5969457", "0.5967703", "0.59609085", "0.5858443", "0.5745467", "0.57042044", "0.56952304", "0.56952304", "0.5676726", "0.56422...
0.7163614
0
Reduce this Dataset's data by applying ``cumsum`` along some dimension(s).
def cumsum( self, dim: Dims = None, *, skipna: bool | None = None, keep_attrs: bool | None = None, **kwargs: Any, ) -> Dataset: return self.reduce( duck_array_ops.cumsum, dim=dim, skipna=skipna, numeric_only=True...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def cumsum(\n self,\n dim: Dims = None,\n *,\n skipna: bool | None = None,\n keep_attrs: bool | None = None,\n **kwargs: Any,\n ) -> DataArray:\n return self.reduce(\n duck_array_ops.cumsum,\n dim=dim,\n skipna=skipna,\n ...
[ "0.7537239", "0.7537239", "0.7537239", "0.67484677", "0.67069674", "0.66436154", "0.63819385", "0.6350921", "0.6343282", "0.62725073", "0.6268484", "0.6268484", "0.6268484", "0.6262665", "0.6262446", "0.62461925", "0.61838704", "0.61838704", "0.61838704", "0.61028945", "0.606...
0.769945
0
Reduce this Dataset's data by applying ``cumprod`` along some dimension(s).
def cumprod( self, dim: Dims = None, *, skipna: bool | None = None, keep_attrs: bool | None = None, **kwargs: Any, ) -> Dataset: return self.reduce( duck_array_ops.cumprod, dim=dim, skipna=skipna, numeric_only=Tr...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def cumprod(\n self,\n dim: Dims = None,\n *,\n skipna: bool | None = None,\n keep_attrs: bool | None = None,\n **kwargs: Any,\n ) -> DataArray:\n return self.reduce(\n duck_array_ops.cumprod,\n dim=dim,\n skipna=skipna,\n ...
[ "0.7896212", "0.7896212", "0.7896212", "0.70786357", "0.7026533", "0.6977891", "0.6960451", "0.6529018", "0.62155104", "0.620573", "0.6204624", "0.61433333", "0.61382365", "0.6083183", "0.6030813", "0.59799564", "0.59799564", "0.5859764", "0.5859764", "0.5859764", "0.5842625"...
0.8052243
0
Reduce this DataArray's data by applying ``all`` along some dimension(s).
def all( self, dim: Dims = None, *, keep_attrs: bool | None = None, **kwargs: Any, ) -> DataArray: if ( flox_available and OPTIONS["use_flox"] and contains_only_chunked_or_numpy(self._obj) ): return self._flox_re...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def all(self, axis=None, keepdims=False, out=None):\n return np.logical_and.reduce(self, out=out, axis=axis, keepdims=keepdims)", "def all(\n self,\n dim: Dims = None,\n *,\n keep_attrs: bool | None = None,\n **kwargs: Any,\n ) -> DataArray:\n return self.reduc...
[ "0.6964989", "0.6916764", "0.68831027", "0.68831027", "0.6737816", "0.6579109", "0.6579109", "0.6542948", "0.63997453", "0.63997453", "0.6337151", "0.63178223", "0.6278503", "0.5919452", "0.5876098", "0.5819424", "0.57391477", "0.5717155", "0.56248033", "0.55787617", "0.55427...
0.7083386
1
Reduce this DataArray's data by applying ``any`` along some dimension(s).
def any( self, dim: Dims = None, *, keep_attrs: bool | None = None, **kwargs: Any, ) -> DataArray: if ( flox_available and OPTIONS["use_flox"] and contains_only_chunked_or_numpy(self._obj) ): return self._flox_re...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def any(self, axis=None, keepdims=False, out=None):\n return np.logical_or.reduce(self, out=out, axis=axis, keepdims=keepdims)", "def any(\n self,\n dim: Dims = None,\n *,\n keep_attrs: bool | None = None,\n **kwargs: Any,\n ) -> DataArray:\n return self.reduce...
[ "0.71060604", "0.7097509", "0.69430715", "0.69430715", "0.686053", "0.6258159", "0.6215559", "0.61174256", "0.6110123", "0.6066965", "0.60409343", "0.5994262", "0.5851336", "0.56650263", "0.5628333", "0.5623232", "0.5615794", "0.55963945", "0.55963945", "0.5479969", "0.547805...
0.7147029
1
Reduce this DataArray's data by applying ``cumsum`` along some dimension(s).
def cumsum( self, dim: Dims = None, *, skipna: bool | None = None, keep_attrs: bool | None = None, **kwargs: Any, ) -> DataArray: return self.reduce( duck_array_ops.cumsum, dim=dim, skipna=skipna, keep_attrs=keep...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def cumsum(\n self,\n dim: Dims = None,\n *,\n skipna: bool | None = None,\n keep_attrs: bool | None = None,\n **kwargs: Any,\n ) -> Dataset:\n return self.reduce(\n duck_array_ops.cumsum,\n dim=dim,\n skipna=skipna,\n ...
[ "0.7601719", "0.7601719", "0.7601719", "0.71929914", "0.70374393", "0.6974349", "0.6739214", "0.6690532", "0.6560123", "0.64532024", "0.6444809", "0.6434722", "0.6355989", "0.6352609", "0.6270605", "0.6270605", "0.6270605", "0.62120354", "0.6194247", "0.6184793", "0.6179344",...
0.7733504
1
Reduce this DataArray's data by applying ``cumprod`` along some dimension(s).
def cumprod( self, dim: Dims = None, *, skipna: bool | None = None, keep_attrs: bool | None = None, **kwargs: Any, ) -> DataArray: return self.reduce( duck_array_ops.cumprod, dim=dim, skipna=skipna, keep_attrs=ke...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def cumprod(\n self,\n dim: Dims = None,\n *,\n skipna: bool | None = None,\n keep_attrs: bool | None = None,\n **kwargs: Any,\n ) -> Dataset:\n return self.reduce(\n duck_array_ops.cumprod,\n dim=dim,\n skipna=skipna,\n ...
[ "0.78693175", "0.78693175", "0.78693175", "0.74438745", "0.73570323", "0.72512066", "0.71616554", "0.6794507", "0.66913575", "0.6365985", "0.6155289", "0.60739994", "0.6059755", "0.60538614", "0.602666", "0.59202105", "0.57904106", "0.57707596", "0.57707596", "0.57707596", "0...
0.8048191
1
Reduce this DataArray's data by applying ``count`` along some dimension(s).
def count( self, dim: Dims = None, *, keep_attrs: bool | None = None, **kwargs: Any, ) -> DataArray: if ( flox_available and OPTIONS["use_flox"] and contains_only_chunked_or_numpy(self._obj) ): return self._flox_...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def count(\n self,\n dim: Dims = None,\n *,\n keep_attrs: bool | None = None,\n **kwargs: Any,\n ) -> DataArray:\n return self.reduce(\n duck_array_ops.count,\n dim=dim,\n keep_attrs=keep_attrs,\n **kwargs,\n )", "def...
[ "0.6898398", "0.65379834", "0.6224404", "0.6224404", "0.59004956", "0.5841828", "0.5838448", "0.57762665", "0.573857", "0.56812054", "0.5657385", "0.55505395", "0.55487853", "0.55471367", "0.55208504", "0.5506666", "0.54985136", "0.5492544", "0.54757905", "0.54540455", "0.543...
0.6582146
1
Reduce this DataArray's data by applying ``all`` along some dimension(s).
def all( self, dim: Dims = None, *, keep_attrs: bool | None = None, **kwargs: Any, ) -> DataArray: if ( flox_available and OPTIONS["use_flox"] and contains_only_chunked_or_numpy(self._obj) ): return self._flox_re...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def all(self, axis=None, keepdims=False, out=None):\n return np.logical_and.reduce(self, out=out, axis=axis, keepdims=keepdims)", "def all(\n self,\n dim: Dims = None,\n *,\n keep_attrs: bool | None = None,\n **kwargs: Any,\n ) -> DataArray:\n return self.reduc...
[ "0.6964989", "0.6916764", "0.68831027", "0.68831027", "0.6737816", "0.6579109", "0.6579109", "0.6542948", "0.63997453", "0.63997453", "0.6337151", "0.63178223", "0.6278503", "0.5919452", "0.5876098", "0.5819424", "0.57391477", "0.5717155", "0.56248033", "0.55787617", "0.55427...
0.7083386
0
Reduce this DataArray's data by applying ``any`` along some dimension(s).
def any( self, dim: Dims = None, *, keep_attrs: bool | None = None, **kwargs: Any, ) -> DataArray: if ( flox_available and OPTIONS["use_flox"] and contains_only_chunked_or_numpy(self._obj) ): return self._flox_re...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def any(self, axis=None, keepdims=False, out=None):\n return np.logical_or.reduce(self, out=out, axis=axis, keepdims=keepdims)", "def any(\n self,\n dim: Dims = None,\n *,\n keep_attrs: bool | None = None,\n **kwargs: Any,\n ) -> DataArray:\n return self.reduce...
[ "0.71060604", "0.7097509", "0.69430715", "0.69430715", "0.686053", "0.6258159", "0.6215559", "0.61174256", "0.6110123", "0.6066965", "0.60409343", "0.5994262", "0.5851336", "0.56650263", "0.5628333", "0.5623232", "0.5615794", "0.55963945", "0.55963945", "0.5479969", "0.547805...
0.7147029
0
Reduce this DataArray's data by applying ``median`` along some dimension(s).
def median( self, dim: Dims = None, *, skipna: bool | None = None, keep_attrs: bool | None = None, **kwargs: Any, ) -> DataArray: return self.reduce( duck_array_ops.median, dim=dim, skipna=skipna, keep_attrs=keep...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def median_filter(self):\n print \"Median-Filtering...\"\n D = self.D\n x = np.median(np.median(D,axis=1),axis=1)\n for i in xrange(len(x)):\n D[i,:,:] -= x[i]\n self.D = D\n print \"done.\"", "def median(\n self,\n dim: Dims = None,\n *,...
[ "0.7840716", "0.71675795", "0.71675795", "0.71675795", "0.69720316", "0.6909001", "0.6809316", "0.67637587", "0.6649234", "0.65772283", "0.649336", "0.6491507", "0.64689547", "0.64432216", "0.6414413", "0.6403336", "0.6348854", "0.6339596", "0.6326826", "0.6324761", "0.632114...
0.7371451
1
Reduce this DataArray's data by applying ``cumsum`` along some dimension(s).
def cumsum( self, dim: Dims = None, *, skipna: bool | None = None, keep_attrs: bool | None = None, **kwargs: Any, ) -> DataArray: return self.reduce( duck_array_ops.cumsum, dim=dim, skipna=skipna, keep_attrs=keep...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def cumsum(\n self,\n dim: Dims = None,\n *,\n skipna: bool | None = None,\n keep_attrs: bool | None = None,\n **kwargs: Any,\n ) -> Dataset:\n return self.reduce(\n duck_array_ops.cumsum,\n dim=dim,\n skipna=skipna,\n ...
[ "0.7601719", "0.7601719", "0.7601719", "0.71929914", "0.70374393", "0.6974349", "0.6739214", "0.6690532", "0.6560123", "0.64532024", "0.6444809", "0.6434722", "0.6355989", "0.6352609", "0.6270605", "0.6270605", "0.6270605", "0.62120354", "0.6194247", "0.6184793", "0.6179344",...
0.7733504
0
Reduce this DataArray's data by applying ``cumprod`` along some dimension(s).
def cumprod( self, dim: Dims = None, *, skipna: bool | None = None, keep_attrs: bool | None = None, **kwargs: Any, ) -> DataArray: return self.reduce( duck_array_ops.cumprod, dim=dim, skipna=skipna, keep_attrs=ke...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def cumprod(\n self,\n dim: Dims = None,\n *,\n skipna: bool | None = None,\n keep_attrs: bool | None = None,\n **kwargs: Any,\n ) -> Dataset:\n return self.reduce(\n duck_array_ops.cumprod,\n dim=dim,\n skipna=skipna,\n ...
[ "0.78693175", "0.78693175", "0.78693175", "0.74438745", "0.73570323", "0.72512066", "0.71616554", "0.6794507", "0.66913575", "0.6365985", "0.6155289", "0.60739994", "0.6059755", "0.60538614", "0.602666", "0.59202105", "0.57904106", "0.57707596", "0.57707596", "0.57707596", "0...
0.8048191
0
Menaikan jabatan role xp member ke role xp selanjutnya(admin only).
async def promote(self, ctx, *, member = None): # Only allow admins to change server stats if not await self._can_run(ctx): return em = discord.Embed(color = 0XFF8C00, description = "Menaikan jabatan role xp member ke role xp selanjutnya\n\n" ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async def promoteto(self, ctx, *, member = None, role = None):\r\n if not await self._can_run(ctx): return\r\n em = discord.Embed(color = 0XFF8C00, description = \"Menaikan role xp member ke role yang ditentukan\\n\"\r\n \"Pastikan role xp s...
[ "0.64883465", "0.6299787", "0.61075544", "0.5897025", "0.5765006", "0.57568175", "0.56386036", "0.56318307", "0.56316966", "0.56002736", "0.55545866", "0.55380803", "0.55184126", "0.54676664", "0.54562855", "0.5447556", "0.5395318", "0.5377828", "0.53774434", "0.53774434", "0...
0.7284638
0
Authenticates a user based on the OIDC code flow.
def authenticate(self, request, **kwargs): self.request = request if not self.request: return None state = self.request.GET.get('state') code = self.request.GET.get('code') nonce = kwargs.pop('nonce', None) if not code or not state: return None ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def authenticate_user(authentication_code):\n\n for suffix in ('', '=', '=='):\n attempt = authentication_code + suffix\n decoded = base64.decodestring(attempt)\n fields = decoded.split('_')\n\n email, user_id, time_stamp, str_hex = fields\n\n if time_stamp < time.time():\n ...
[ "0.6552406", "0.65238935", "0.6430285", "0.6422166", "0.6393544", "0.6226487", "0.62242806", "0.6216219", "0.6209499", "0.6170765", "0.61462003", "0.6108177", "0.6060539", "0.6059608", "0.6046146", "0.6044743", "0.5983562", "0.5963158", "0.5959967", "0.5950732", "0.59470534",...
0.72427773
0
Size the core of the LVL Shifter given K_ratio, the ratio of the NMOS to PMOS
def _design_lvl_shift_core_size(cload: float, k_ratio: float, inv_input_cap: float, fanout: float, is_ctrl: bool) -> Tuple[int, int, int]: out_inv_input_cap = cload / fanout print(f'cload = {cload}') inv_m = int(round(out_inv_input_cap / inv_input_cap)) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _SizeCalculator(partition_size):\n # Max image size grows less than partition size, which means\n # footer size grows faster than partition size.\n return int(math.pow(partition_size, 0.95))", "def pixel_size_ratio(self):\n return 2**(self.levels[-1] - self.levels[0])", "def _SizeCalc...
[ "0.6188077", "0.59274673", "0.58529997", "0.5746031", "0.573419", "0.5615157", "0.5585702", "0.5555616", "0.5553092", "0.55231327", "0.5479882", "0.5438771", "0.5424427", "0.542206", "0.54073846", "0.5404979", "0.53181946", "0.53123444", "0.53076833", "0.52982414", "0.5290943...
0.6555078
0
Given the NMOS segments and the PMOS segements ratio for the core, this function designs the internal inverter. For control level shifter, we don't care about matching rise / fall delay, so we just size for fanout.
async def _design_lvl_shift_internal_inv(self, pseg: int, nseg: int, out_inv_m: int, fanout: float, pinfo: Any, tbm_specs: Dict[str, Any], is_ctrl: bool, has_rst: bool, dual_output: boo...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _design_lvl_shift_core_size(cload: float, k_ratio: float, inv_input_cap: float,\n fanout: float, is_ctrl: bool) -> Tuple[int, int, int]:\n out_inv_input_cap = cload / fanout\n print(f'cload = {cload}')\n inv_m = int(round(out_inv_input_cap / inv_input_cap...
[ "0.573395", "0.5689612", "0.5377648", "0.52175105", "0.51980525", "0.51722646", "0.5154866", "0.5073706", "0.50463784", "0.49642965", "0.49641448", "0.49348933", "0.49050188", "0.49022022", "0.4888358", "0.48803452", "0.48743895", "0.48456818", "0.4839526", "0.48382315", "0.4...
0.5905445
0
Given all other sizes and total output inverter segments, this function will optimize the output inverter to minimize rise/fall mismatch.
async def _design_output_inverter(self, inv_in_pseg: int, inv_in_nseg: int, pseg: int, nseg: int, inv_nseg: int, inv_pseg: int, out_inv_m: int, fanout: float, pinfo: Any, tbm_specs: Dict[str, Any], has_rst,...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async def _design_lvl_shift_internal_inv(self, pseg: int, nseg: int, out_inv_m: int,\n fanout: float,\n pinfo: Any, tbm_specs: Dict[str, Any], is_ctrl: bool,\n has_rst: bool, dual_out...
[ "0.57551074", "0.5633371", "0.55631614", "0.5548981", "0.54104066", "0.53518677", "0.52544314", "0.52046525", "0.5193554", "0.510433", "0.50876915", "0.507961", "0.5076772", "0.5050112", "0.5047182", "0.5028232", "0.50279135", "0.50186217", "0.49814168", "0.49547577", "0.4953...
0.65121347
0
Creates a dictionary of parameters for the layout class LevelShifter
def _get_lvl_shift_params_dict(pinfo: Any, seg_p: int, seg_n: int, seg_inv_p: int, seg_inv_n: int, seg_in_inv_p: int, seg_in_inv_n: int, out_inv_m: int, has_rst: bool, dual_output: bool, is_ctrl: bool = False, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def layout_method_mapper(self):\n return {\n \"kamada_kawai_layout\": kamada_kawai_layout,\n \"fruchterman_reingold_layout\": fruchterman_reingold_layout,\n \"spectral_layout\": spectral_layout,\n }", "def init_pos_parms(self):\n\n ## init_pos_parms()\n ...
[ "0.617329", "0.61104554", "0.60987556", "0.6021736", "0.5993616", "0.596282", "0.59227943", "0.5847736", "0.5747626", "0.5723274", "0.57080036", "0.5674384", "0.565163", "0.56308", "0.5629004", "0.5618874", "0.56178457", "0.56168747", "0.56168747", "0.5608124", "0.5590386", ...
0.6311791
0
Handle mocked API request for repo existence check.
def callback_repo_check(self, request, uri, headers, status_code=404): self.assertEqual( request.headers['Authorization'], 'token {0}'.format(self.OAUTH2_TOKEN) ) # Handle the new "rerun" repo differently if self.TEST_RERUN_REPO in uri: status_code = 4...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_get_github_repos_info_positive(self):\n self.assertIsNotNone(app.get_github_repos_info(\"dhh\")[\"repo_info\"])", "def test_github_api_exists():\n p = github_api.GithubPath.from_repo('tensorflow/datasets', 'v3.1.0')\n with enable_api_call():\n assert p.exists()\n assert not (p / 'unnknown...
[ "0.6614973", "0.6548657", "0.6510613", "0.6494966", "0.6306936", "0.6299396", "0.6290716", "0.6259003", "0.625318", "0.6162342", "0.6154876", "0.609253", "0.6088747", "0.607778", "0.60644174", "0.6063622", "0.6023541", "0.600028", "0.60001606", "0.59103364", "0.58970094", "...
0.6812977
0
Manage both add and delete of team membership. ``action_list`` is a list of tuples with (``username``, ``added (bool)``) to track state of membership since this will get called multiple times in one library call.
def callback_team_membership( request, uri, headers, success=True, action_list=None ): # pylint: disable=too-many-arguments username = uri.rsplit('/', 1)[1] if not success: status_code = 500 if request.method == 'DELETE': if success: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def actions(self, request, action_list, group):\n return action_list", "def add_list(action, user):\n \n userprofile = user.get_profile()\n \n board = userprofile.get_board(action['boardId'])\n \n # Create the list\n l = List()\n l.title = action['what']['title']\n l.color = act...
[ "0.5766691", "0.5531757", "0.5485128", "0.54238945", "0.53260785", "0.5270922", "0.5267349", "0.52224904", "0.51530606", "0.51122624", "0.4995376", "0.4994134", "0.49654278", "0.49381015", "0.49172172", "0.4907861", "0.4896086", "0.48836443", "0.48314428", "0.48299542", "0.48...
0.63153493
0
Register repo check URL and method.
def register_repo_check(self, body): httpretty.register_uri( httpretty.GET, re.compile( '^{url}repos/{org}/({repo}|{repo_rerun})$'.format( url=self.URL, org=self.ORG, repo=re.escape(self.TEST_REPO), ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add(name, url):\n click.echo(\"registered repo {} at url {}\".format(name, url))", "def addRepository(self, uri):\n pass", "def register(self, hook_url):\n raise NotImplementedError()", "def add_repo(repo_name, url):\n\n # First, validate the URL\n if not utils.is_valid_url(url):\n...
[ "0.648579", "0.60714537", "0.58604896", "0.5853189", "0.58087116", "0.5801936", "0.5749618", "0.5737087", "0.5730165", "0.571998", "0.5632852", "0.5463911", "0.54567236", "0.53939337", "0.53857875", "0.5376803", "0.53699636", "0.52942485", "0.5257235", "0.5177173", "0.5175245...
0.7127913
0
Register url for repo create.
def register_repo_create(self, body): httpretty.register_uri( httpretty.POST, '{url}orgs/{org}/repos'.format( url=self.URL, org=self.ORG, ), body=body )
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add(name, url):\n click.echo(\"registered repo {} at url {}\".format(name, url))", "def repository_create_hosted():\n pass", "def repo_add(self, name, url, **kwargs):\n\n self.helm_client.repo_add(name, url, **kwargs)", "def addRepository(self, uri):\n pass", "def addRepository(self...
[ "0.7228415", "0.69657815", "0.66111845", "0.6596335", "0.6379819", "0.6372043", "0.6295349", "0.62912536", "0.62566435", "0.62522775", "0.6242981", "0.61664414", "0.6139451", "0.60608256", "0.6047676", "0.60390604", "0.60049415", "0.59894115", "0.5982883", "0.5956164", "0.593...
0.76181614
0
Simple hook list URL.
def register_hook_list(self, body=None, status=200): if body is None: body = json.dumps( [{ 'url': '{url}repos/{org}/{repo}/hooks/1'.format( url=self.URL, org=self.ORG, repo=self.TEST_REPO ) }] ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def url(self):\n return reverse('snippet-list')", "def getURLs():", "def list(self):\n return self._post(\n request=ApiActions.LIST.value,\n uri=ApiUri.HOOKS.value,\n ).get('hooks')", "def url_list(path):\n match = re.match(r'^.*(/wa/[A-Za-z0-9/-]+)([A-Za-z-]+)/(...
[ "0.61078", "0.60590255", "0.60329723", "0.60213965", "0.6001832", "0.5835626", "0.5812988", "0.5810151", "0.575069", "0.568352", "0.56398803", "0.5614848", "0.5573087", "0.54942304", "0.54856974", "0.54843545", "0.5479251", "0.54742557", "0.5471129", "0.54698616", "0.5446562"...
0.6599427
0
Register team repo addition.
def register_team_repo_add(self, body): httpretty.register_uri( httpretty.PUT, re.compile( r'^{url}teams/\d+/repos/{org}/({repo}|{rerun_repo})$'.format( url=self.URL, org=self.ORG, repo=re.escape(self.TEST_REPO),...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add(name, url):\n click.echo(\"registered repo {} at url {}\".format(name, url))", "def _RegisterAmberRepository(self, tuf_repo, remote_port):\n\n # Extract the public signing key for inclusion in the config file.\n root_keys = []\n root_json_path = os.path.join(tuf_repo, 'repository', 'root.json...
[ "0.6898738", "0.6489705", "0.64307415", "0.6304983", "0.6265113", "0.6264515", "0.6212561", "0.61818516", "0.6177951", "0.61501896", "0.60574985", "0.5968487", "0.58513224", "0.57982254", "0.57399786", "0.5735879", "0.5716812", "0.5707634", "0.5682229", "0.5664063", "0.56495"...
0.75826085
0
Return tables of cells in neuronPop population name connected to mitrals specified in args, via neuronProj projection name if args is not specified get all.
def exportTable(network, neuronProj, neuronPop, colours, \ args={}, spikes=True, allcells=True): exportDict = {'spikes':spikes,'data_tables':[]} if array(colours).shape == (3,): coloursList = False else: coloursList = True ## get cells connected to mitrals specified in args. if not specified...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getCellsByMitralConnection(args, network, projection, population, allcells=False):\n cellList = []\n cellUniques = []\n if args.has_key('mitrals'):\n for mitid in args['mitrals']:\n mitpath = 'mitrals_'+str(mitid)\n cellnum = 0\n if projection in network.project...
[ "0.5612893", "0.5285766", "0.5185361", "0.5045113", "0.5007588", "0.49609387", "0.49419475", "0.48437467", "0.48161486", "0.48034397", "0.47943878", "0.4792616", "0.4761036", "0.4739973", "0.4637608", "0.45978764", "0.45735255", "0.45684016", "0.45425737", "0.45364887", "0.45...
0.5903073
0
We record the position in S of the first occurence of a letter. If we encounter the letter a second time, we check their spacing.
def well_spaced(S, D): seen = [None] * 26 for i, c in enumerate(S): if seen[ord(c) - ord("a")] is None: seen[ord(c) - ord("a")] = i else: if i - seen[ord(c) - ord("a")] != D[ord(c) - ord("a")] + 1: return False return True
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def alphabet_position(letter):\n alphabet = \"abcdefghijklmnopqrstuvwxyz\"\n pos = 0\n for ltr in alphabet:\n if ltr == letter.lower():\n return pos\n pos += 1\n return pos", "def find_letter_in_dics(self,letter):\r\n if str.isupper(letter)==True and letter not in self...
[ "0.63146746", "0.60987276", "0.6056158", "0.60332364", "0.6029894", "0.60163057", "0.59288514", "0.59279585", "0.58409476", "0.5798788", "0.5759058", "0.5749839", "0.5723557", "0.5687024", "0.56397504", "0.5600619", "0.55635214", "0.556004", "0.5554876", "0.5525632", "0.55193...
0.6559219
0
Register publisher on nameserver. This works for PUBSUB only
def register_publisher(self, hostname, expire=-1):
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def registerEvent(eventName, publisher, msgInterface, exclusive=FALSE):", "def register_topic(self, name, command):\n topic_name = command['topic_name']\n try:\n topic_type = self.get_interface_type(command['interface_type'], '.msg')\n self.pubs[topic_name] = self.create_publi...
[ "0.6365265", "0.62822574", "0.6280103", "0.62570566", "0.6152319", "0.60816693", "0.6038326", "0.6014652", "0.5980777", "0.58707476", "0.582609", "0.58243114", "0.5799215", "0.5795977", "0.5795272", "0.57344294", "0.5730708", "0.5672222", "0.56624746", "0.5653363", "0.5633386...
0.7828177
0
Unregister publisher on nameserver. This works for PUBSUB only
def unregister_publisher(self, hostname):
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def unregister(self):\n self._executor.unregister_publisher(self)", "def unregisterEvent(eventName, publisher):", "def unregister(self):\n if self.hub.is_connected:\n self._is_registered = False\n self.hub.unregister(self._private_key)\n self._hub_id = None\n ...
[ "0.7360216", "0.7246476", "0.6685116", "0.66366076", "0.6556128", "0.64936596", "0.64936596", "0.64936596", "0.64936596", "0.64936596", "0.6339355", "0.6295946", "0.6200138", "0.61934596", "0.6149258", "0.61001545", "0.60975444", "0.60746765", "0.60650426", "0.6057191", "0.60...
0.84743935
0
Register router on the nameserver. This works for ROUTER proxy only
def register_router(self, hostname, expire=-1):
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def register_router(self, router):\n for prefix, viewset, basename in router.registry:\n self.register(prefix, viewset, base_name=basename)", "def _registerOnServer(self, daemon, nameserver,vclock):\n uri = daemon.register(self)\n nameserver.register(self._name, uri)\n self...
[ "0.69818735", "0.6787208", "0.62229717", "0.6108167", "0.60634494", "0.6024237", "0.5897947", "0.5891949", "0.57765454", "0.5680079", "0.56769615", "0.5665641", "0.5664951", "0.5652085", "0.5566623", "0.5562512", "0.553475", "0.5525856", "0.5513387", "0.54793245", "0.54617864...
0.74578744
0
Unregister router on the nameserver. This works for ROUTER proxy only
def unregister_router(self, hostname):
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def unregister(self, pollster):\n pollster.unregister(self._router_socket)", "def unregister_server():\n (code, message) = rest_api.unregister_server(request)\n if (code == 200):\n return message\n else:\n abort(code)", "def _unregister_from_server(self):\n self.remote_cont...
[ "0.7407919", "0.6835906", "0.6531206", "0.6473747", "0.6360587", "0.6355955", "0.62724245", "0.6237078", "0.62182945", "0.6144307", "0.61080134", "0.6107907", "0.60263836", "0.60021615", "0.59701866", "0.5969365", "0.5967524", "0.5956805", "0.59442115", "0.59275377", "0.59078...
0.84506893
0
Register target on nameserver. If record already exists and has expiration timeout it will be updated. Existing records without timeout will stay untouched
def register(self, target, hostname, listener_type, expire=-1):
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def register_router(self, hostname, expire=-1):", "def touch_member(self, data, ttl=None, permanent=False):", "def register_publisher(self, hostname, expire=-1):", "def _set_target_info_by_name(self, targets, port, target_name, iqn):\n host_iqn_registered_in_target = (\n self._get_host_iqn_...
[ "0.59071237", "0.57393044", "0.56628335", "0.54713863", "0.5383242", "0.5357558", "0.5356139", "0.5307397", "0.5276759", "0.52725244", "0.52632517", "0.523391", "0.520452", "0.51832664", "0.51574975", "0.51390576", "0.5082721", "0.5064394", "0.50146466", "0.50041485", "0.4989...
0.7020003
0
Unregister target from nameserver.
def unregister(self, target, hostname, listener_type):
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def unregister(target: str) -> bool:\n ...", "def _unregister_from_server(self):\n self.remote_controller.unregister()", "def unregister_server(self, request):\n\n name = request.form['name']\n token = request.form['token']\n\n rest_client = RestClient.instance()\n user_in...
[ "0.7585173", "0.68528515", "0.6826376", "0.68002725", "0.67341775", "0.6664987", "0.6569992", "0.6551973", "0.6536063", "0.65019625", "0.64468646", "0.6361532", "0.63340855", "0.6244407", "0.6225373", "0.6179231", "0.6150409", "0.6149765", "0.6141956", "0.6136862", "0.6132793...
0.7942518
0
Get all hosts from nameserver by target.
def get_hosts(self, target, listener_type):
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getHosts(self):\n raise \"not implemented\"", "def get_hosts(self):\n\n raise NotImplementedError", "def all_hosts(self):\n ...", "def get_list_hosts(self, path, params):\n eth_src = params.get('eth_src')\n host = self._extract_url_base(path)\n reply = self._fauc...
[ "0.6609943", "0.65855324", "0.65804106", "0.64846325", "0.63959503", "0.6352378", "0.63149804", "0.62216705", "0.6152733", "0.60675144", "0.6000524", "0.598171", "0.5977664", "0.5963793", "0.5939155", "0.590416", "0.5887089", "0.58860886", "0.5873426", "0.58689386", "0.585227...
0.72865254
0
Retry if not hosts used on client first time connection.
def get_hosts_retry(self, target, listener_type):
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def reconnect(self):\n self.test_cmd()\n if not self.check_network: \n self.reset()\n attempt=0\n while not self.check_network and attempt<self.retries:\n self.full_reset()\n attempt+=1", "def _retry_occurred(self):", "def retry_connect(redis_cfg, tr...
[ "0.6595895", "0.642362", "0.6300115", "0.62578905", "0.62397426", "0.62371826", "0.61907387", "0.61150855", "0.6100826", "0.60999596", "0.60886294", "0.6058668", "0.6034286", "0.59911746", "0.59811133", "0.59562373", "0.5926307", "0.5876836", "0.5873153", "0.5847975", "0.5835...
0.65693855
1
Get all hosts for fanout from nameserver by target.
def get_hosts_fanout(self, target, listener_type):
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_hosts(self, target, listener_type):", "def all_hosts(self):\n ...", "def getHosts(self):\n raise \"not implemented\"", "def get_list_hosts(self, path, params):\n eth_src = params.get('eth_src')\n host = self._extract_url_base(path)\n reply = self._faucet_collector.g...
[ "0.7184551", "0.6248219", "0.6176217", "0.61702764", "0.6109676", "0.6054905", "0.60191494", "0.6009551", "0.59727305", "0.5941708", "0.591378", "0.59014225", "0.58759665", "0.5767903", "0.5579544", "0.55613315", "0.5546322", "0.55437875", "0.5537281", "0.55069554", "0.546622...
0.7517761
0
Retry if not host for fanout used on client first time connection.
def get_hosts_fanout_retry(self, target, listener_type):
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def reconnect(self):\n self.test_cmd()\n if not self.check_network: \n self.reset()\n attempt=0\n while not self.check_network and attempt<self.retries:\n self.full_reset()\n attempt+=1", "def _retry_occurred(self):", "def decide_to_retry(error):\n ...
[ "0.6410929", "0.6315029", "0.6292759", "0.6159722", "0.61007214", "0.60679835", "0.60382396", "0.598557", "0.5985042", "0.5976616", "0.59539026", "0.59280324", "0.591002", "0.59035325", "0.5888258", "0.5867851", "0.5821885", "0.5793011", "0.5766104", "0.57537436", "0.57288796...
0.7007031
0
Each profile model should define the __init__ method. The __init__ method must take the grid as the first input parameter. All other input parameters can be specified to define the model. The grid input parameter is automatically added as an attribute of the profile model. This method should set all three components of...
def __init__(self, grid, coef_u, coef_w=[0.01, 0.2]): # In this example, we set the u-component to increase linearly with height: # Note: we are making use of the automatically added 'grid' attribute self._u[0] = coef_u * self.grid.z[:, None] # Arbitrarily chose a factor of 0.3 ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self, velocity, vorticity, prof_coords, \n direction, beginMeanComput, **kwds):\n assert 'variables' not in kwds, 'variables parameter is useless.'\n super(Profiles, self).__init__(variables=[velocity, vorticity],\n **kwds)\n #...
[ "0.63615376", "0.6329917", "0.6315436", "0.6304923", "0.6211358", "0.6152573", "0.61234856", "0.6065217", "0.6056414", "0.6029072", "0.5988933", "0.5905428", "0.5902939", "0.58744293", "0.585578", "0.58418816", "0.5836042", "0.5823521", "0.5822146", "0.5813255", "0.580647", ...
0.7273586
0
Take the MD5 digest of a name, convert it to hex and take the first 6 characters as an RGB value.
def dopplr(name): return "#" + hashlib.sha224(name).hexdigest()[:6]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_md5(text):\n return hashlib.md5(text).hexdigest()", "def color_name_to_hex(name, default='#000000'):\n try:\n name = str(name)\n if name.startswith('#'):\n return name\n return webcolors.name_to_hex(name)\n except ValueError:\n return default", "def get_m...
[ "0.61176944", "0.6115744", "0.61068666", "0.60837525", "0.6063438", "0.60526246", "0.6049227", "0.6043318", "0.6015899", "0.595205", "0.59485966", "0.5934476", "0.5924637", "0.59155124", "0.5902312", "0.5875135", "0.5866297", "0.5865237", "0.5853065", "0.58442265", "0.5834953...
0.65998656
0
For a given background colour, return black or white for the text
def foreground_colour(background_colour): # Get RGB values background_colour = background_colour.lstrip("#") background_colour = struct.unpack('BBB', background_colour.decode('hex')) r = background_colour[0] g = background_colour[1] b = background_colour[2] print(r, g, b) # The perceive...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def black_or_white(bgcolor):\n ary_bgcolors = re.findall(r\"[\\w']+\", bgcolor)\n R = int(ary_bgcolors[1])\n G = int(ary_bgcolors[2])\n B = int(ary_bgcolors[3])\n Lumi = (sum([R,G,B])/3)\n\n if Lumi > 125:\n colorfont = 'rgb(0,0,0)'\n else:\n colorfont = 'rgb(255,255,255)'\n\n ...
[ "0.79908603", "0.70390666", "0.70168227", "0.6928707", "0.67906517", "0.6725715", "0.6606326", "0.6565484", "0.6551614", "0.651119", "0.6485232", "0.6482854", "0.6421965", "0.6326192", "0.62925994", "0.6289619", "0.6224909", "0.6212772", "0.6126866", "0.6106249", "0.6093084",...
0.70396507
1
Find the largestsized font that'll fit this text on this cover
def largest_font_that_fits(draw, font_file, text, cover_width): text_w = cover_width + 1 font_size = 110 padding = 20 while(text_w + padding > cover_width): font_size -= 10 font = ImageFont.truetype(font_file, font_size) text_w, text_h = draw.textsize(text, font) return font
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_optimal_font_size(fontfile,text,maxwidth,maxheight):\n fontsize = 1\n font = ImageFont.truetype(fontfile, fontsize)\n while font.getsize(text)[0] < maxwidth and font.getsize(text)[1] < maxheight:\n fontsize += 1\n font = ImageFont.truetype(fontfile, fontsize-1)\n return font", "...
[ "0.7606606", "0.7251992", "0.7203537", "0.6699396", "0.65662354", "0.6466567", "0.643199", "0.63370657", "0.6304743", "0.6279057", "0.62559944", "0.6191247", "0.61713487", "0.6060088", "0.59158844", "0.58457994", "0.58386546", "0.5816909", "0.58112776", "0.58027065", "0.57712...
0.8428862
0
Get some public domain image for text
def get_an_image(text): # Get the second or fourth word index = random.choice([1, 3]) text = text.split()[index] print(text) sort = random.choice(["relevance", "interestingness-desc"]) print(sort) from flickr_search_downloadr import flickr_search_downloadr filename = flickr_search_dow...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_image_url():", "def wiki_image(pagetext):\n images = [i for i in pagetext.images if i not in EXCLUDED_IMAGES]\n if len(images) > 0:\n return images[0]\n else:\n return ''", "def process_images(text):\n # if text != None:\n if text is not None:\n soup = BeautifulSoup(...
[ "0.6494177", "0.626865", "0.62658316", "0.62218577", "0.61541396", "0.6036385", "0.6014176", "0.5989792", "0.5951417", "0.59493285", "0.58120805", "0.5806087", "0.57846344", "0.5778579", "0.577659", "0.5753518", "0.5752582", "0.5750098", "0.5733324", "0.572244", "0.5719195", ...
0.65308005
0
Generate the train and validation errors needed to plot a validation curve that we can use to select lambda.
def validation_curve(x, y, x_val, y_val): lambda_vec = np.array([0, 0.001, 0.003, 0.01, 0.03, 0.1, 0.3, 1, 3, 10]) error_train = np.zeros(len(lambda_vec)) error_val = np.zeros(len(lambda_vec)) m = x.shape[0] m_val = x_val.shape[0] for i in range(len(lambda_vec)): l = lambda_vec[i] ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def plot_train_test_errors(train_errors, test_errors, lambda_str , K , path, rng):\n plt.plot(range(rng), train_errors, marker='o', label='Training Data');\n plt.plot(range(rng), test_errors, marker='v', label='Test Data');\n plt.title('ALS-WR Learning Curve, lambda = %s, K = %d'%(lambda_str, K))\n plt...
[ "0.7372803", "0.7234287", "0.7018966", "0.6955053", "0.68787926", "0.6867536", "0.68586004", "0.6833294", "0.669417", "0.663864", "0.6621206", "0.66208285", "0.6596412", "0.65892947", "0.6574992", "0.65665126", "0.6500066", "0.64827365", "0.6461519", "0.6461419", "0.6399849",...
0.76718855
0
Check that we reject a WRITE that names the iounit argument but still has a positional format argument (containing an '='). TODO 267. This test needs expanding and probably moving to a file dedicated to R913 and its (many) constraints.
def test_named_unit_before_fmt_error(): tcls = Write_Stmt # Cannot have an un-named (positional) argument after a named argument with pytest.raises(NoMatchError): tcls('''WRITE (UNIT=6, '("write some=""'//'text'//'""")')''')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_write_stmt():\n tcls = Write_Stmt\n obj = tcls('write (123)\"hey\"')\n assert isinstance(obj, tcls), repr(obj)\n assert str(obj) == 'WRITE(123) \"hey\"'\n assert repr(obj).replace(\"u'\", \"'\") == (\n \"Write_Stmt(Io_Control_Spec_List(',', (Io_Control_Spec(None, \"\n \"Int_Li...
[ "0.6082462", "0.5905375", "0.56293344", "0.5549656", "0.5493521", "0.54801637", "0.5453339", "0.54085284", "0.53969", "0.53846806", "0.53668135", "0.53544927", "0.52869296", "0.5286741", "0.5283133", "0.52826405", "0.52780616", "0.5258492", "0.521193", "0.5171243", "0.5170175...
0.60555166
1
Returns colour scheme for CSI (critical success index).
def _get_csi_colour_scheme(): this_colour_map_object = pyplot.cm.Blues this_colour_norm_object = matplotlib.colors.BoundaryNorm( LEVELS_FOR_CSI_CONTOURS, this_colour_map_object.N) rgba_matrix = this_colour_map_object(this_colour_norm_object( LEVELS_FOR_CSI_CONTOURS )) colour_list ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def conseguir_color(self):\n return self.pluma.conseguir_color()", "def verify_color(cci):\n\n if cci < -6.0:\n return OrangeColor.GREEN\n elif -6.0 <= cci < -1.0:\n return OrangeColor.YELLOWISH_GREEN\n elif -1.0 <= cci < 2.7:\n return OrangeColor.YELLOW\n elif 2.7 <= cci ...
[ "0.6432659", "0.6361762", "0.62378114", "0.6107295", "0.60489845", "0.6039875", "0.6022437", "0.60140353", "0.59839135", "0.5968801", "0.5968204", "0.5968204", "0.5968204", "0.5938249", "0.5938249", "0.5932919", "0.5913306", "0.5908596", "0.59029335", "0.58735913", "0.5872064...
0.7236149
0
Returns colour scheme for Peirce score.
def _get_peirce_colour_scheme(): this_colour_map_object = pyplot.cm.Blues this_colour_norm_object = matplotlib.colors.BoundaryNorm( LEVELS_FOR_PEIRCE_CONTOURS, this_colour_map_object.N) rgba_matrix = this_colour_map_object(this_colour_norm_object( LEVELS_FOR_PEIRCE_CONTOURS )) col...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def conseguir_color(self):\n return self.pluma.conseguir_color()", "def get_colour(self):\n return self.colour", "def get_colour(self) -> str:\n return self.colour", "def getColor(self):\n return self._l[2]", "def get_palace_board_red(self):\n\n return self._palace_board_...
[ "0.678865", "0.6306019", "0.6232524", "0.622833", "0.6212288", "0.6193526", "0.61802113", "0.6138026", "0.6122331", "0.61007756", "0.60846984", "0.60838187", "0.60765666", "0.60642964", "0.60596305", "0.6055237", "0.604426", "0.597812", "0.5978035", "0.59603816", "0.595773", ...
0.75720006
0
Generates polygon for confidence interval. P = number of points in bottom curve = number of points in top curve
def _confidence_interval_to_polygon( x_coords_bottom, y_coords_bottom, x_coords_top, y_coords_top, for_performance_diagram=False): nan_flags_top = numpy.logical_or( numpy.isnan(x_coords_top), numpy.isnan(y_coords_top)) real_indices_top = numpy.where(numpy.invert(nan_flags_top))[0] ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def rectpolyctl(xmin,xmax,ymin,ymax):\n pc=[]\n pc.append((xmin,ymin))\n pc.append((xmin,ymax))\n pc.append((xmax,ymax))\n pc.append((xmax,ymin))\n pc.append((xmin,ymin))\n return pc", "def generatePolygons():", "def _createpoly(self):\n return self.cv.create_polygon((0, 0, 0, 0, 0,...
[ "0.6202383", "0.6190135", "0.6152543", "0.6056553", "0.6024834", "0.58629483", "0.58027285", "0.5787738", "0.56690466", "0.5664175", "0.56515396", "0.56223565", "0.56223565", "0.5581558", "0.5581497", "0.55799574", "0.55596733", "0.55531454", "0.5548768", "0.5543551", "0.5540...
0.6431237
0
Plots background (references lines and polygons) of attributes diagram. For more on the attributes diagram, see Hsu and Murphy (1986). BSS = Brier skill score. For more on the BSS, see `model_evaluation.get_brier_skill_score`.
def _plot_background_of_attributes_diagram( axes_object, climatology, no_skill_line_colour=DEFAULT_ZERO_BSS_COLOUR, no_skill_line_width=DEFAULT_ZERO_BSS_WIDTH, other_line_colour=DEFAULT_CLIMATOLOGY_COLOUR, other_line_width=DEFAULT_CLIMATOLOGY_WIDTH): error_checking.assert_is...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def plot_bootstrapped_attributes_diagram(\n figure_object, axes_object, ci_bottom_dict, ci_mean_dict, ci_top_dict,\n num_examples_by_bin,\n reliability_line_colour=DEFAULT_RELIABILITY_COLOUR,\n reliability_line_width=DEFAULT_RELIABILITY_WIDTH,\n perfect_relia_line_colour=DEFAULT_...
[ "0.6314721", "0.5160302", "0.5150252", "0.5146807", "0.511476", "0.5082323", "0.5072824", "0.506235", "0.50508076", "0.4978316", "0.49699628", "0.49588132", "0.49191087", "0.49132687", "0.4868202", "0.48487267", "0.48426506", "0.4834363", "0.48201233", "0.48166025", "0.480528...
0.679852
0
Plots forecast histogram inset in attributes diagram. For more on the attributes diagram, see Hsu and Murphy (1986). B = number of forecast bins
def _plot_inset_histogram_for_attributes_diagram( figure_object, num_examples_by_bin, bar_face_colour=DEFAULT_HISTOGRAM_FACE_COLOUR, bar_edge_colour=DEFAULT_HISTOGRAM_EDGE_COLOUR, bar_edge_width=DEFAULT_HISTOGRAM_EDGE_WIDTH): error_checking.assert_is_integer_numpy_array(num_examples...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def plot_attributes_diagram(\n figure_object, axes_object, mean_forecast_by_bin,\n event_frequency_by_bin, num_examples_by_bin,\n reliability_line_colour=DEFAULT_RELIABILITY_COLOUR,\n reliability_line_width=DEFAULT_RELIABILITY_WIDTH,\n perfect_relia_line_colour=DEFAULT_PERFECT_RE...
[ "0.6258223", "0.59847486", "0.5973236", "0.59051794", "0.58949333", "0.58539087", "0.5833261", "0.58074725", "0.57988834", "0.57910645", "0.56742895", "0.566742", "0.5615893", "0.5603276", "0.5587624", "0.5563986", "0.5562396", "0.55190045", "0.55185115", "0.54872495", "0.548...
0.66039234
0
Bootstrapped version of plot_roc_curve. T = number of probability thresholds in curve
def plot_bootstrapped_roc_curve( axes_object, ci_bottom_dict, ci_mean_dict, ci_top_dict, line_colour=DEFAULT_ROC_COLOUR, line_width=DEFAULT_ROC_WIDTH, random_line_colour=DEFAULT_RANDOM_ROC_COLOUR, random_line_width=DEFAULT_RANDOM_ROC_WIDTH): plot_roc_curve( axes_obje...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def plot_roc_curve(y_true, y_pred_proba, threshold=0.5):\n\n y_pred = predict_with_threshold(y_pred_proba, threshold)\n roc_auc = roc_auc_score(y_true, y_pred)\n fpr, tpr, thresholds = roc_curve(y_true, y_pred_proba)\n\n plt.plot( # roc auc line\n fpr, tpr,\n label='AUC={:.3f}'.format(ro...
[ "0.7486583", "0.7387596", "0.73390347", "0.7303862", "0.71846604", "0.7127741", "0.71195436", "0.70976794", "0.7094367", "0.7023224", "0.69831747", "0.6977276", "0.6967064", "0.69567615", "0.69160146", "0.6896866", "0.6894308", "0.6850953", "0.682168", "0.6805597", "0.6803503...
0.7392667
1
Bootstrapped version of plot_performance_diagram.
def plot_bootstrapped_performance_diagram( axes_object, ci_bottom_dict, ci_mean_dict, ci_top_dict, line_colour=DEFAULT_PERFORMANCE_COLOUR, line_width=DEFAULT_PERFORMANCE_WIDTH, bias_line_colour=DEFAULT_FREQ_BIAS_COLOUR, bias_line_width=DEFAULT_FREQ_BIAS_WIDTH): plot_performa...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_dashboard(h, t, k, p):\n plt.style.use('seaborn')\n # Initialize the dashboard\n fig = plt.figure(figsize=(20, 8))\n ax1 = fig.add_subplot(2, 2, 1)\n ax2 = fig.add_subplot(2, 2, 2)\n ax3 = fig.add_subplot(2, 2, 3)\n ax4 = fig.add_subplot(2, 2, 4)\n\n # Create individual graphs\n ...
[ "0.59768915", "0.57902294", "0.57902294", "0.56942993", "0.5668916", "0.56470734", "0.557234", "0.55706507", "0.55304885", "0.55228186", "0.5484611", "0.5461995", "0.5434274", "0.5413838", "0.5411302", "0.54013497", "0.5389023", "0.53875077", "0.5386788", "0.5372324", "0.5351...
0.6330226
0
Bootstrapped version of plot_reliability_curve. B = number of bins (separated by forecast probability)
def plot_bootstrapped_reliability_curve( axes_object, ci_bottom_dict, ci_mean_dict, ci_top_dict, line_colour=DEFAULT_RELIABILITY_COLOUR, line_width=DEFAULT_RELIABILITY_WIDTH, perfect_line_colour=DEFAULT_PERFECT_RELIABILITY_COLOUR, perfect_line_width=DEFAULT_PERFECT_RELIABILITY_WI...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def plot_reliability_curve(\n axes_object, mean_forecast_by_bin, event_frequency_by_bin,\n line_colour=DEFAULT_RELIABILITY_COLOUR,\n line_width=DEFAULT_RELIABILITY_WIDTH,\n perfect_line_colour=DEFAULT_PERFECT_RELIABILITY_COLOUR,\n perfect_line_width=DEFAULT_PERFECT_RELIABILITY_WI...
[ "0.61927634", "0.584321", "0.58100855", "0.57739335", "0.57387716", "0.5699075", "0.5687666", "0.5648579", "0.5588099", "0.5552348", "0.55387723", "0.55168885", "0.54948616", "0.5494651", "0.54943234", "0.5490119", "0.54568595", "0.5451723", "0.5428895", "0.54109", "0.5395559...
0.6703668
0
Bootstrapped version of plot_attributes_diagram.
def plot_bootstrapped_attributes_diagram( figure_object, axes_object, ci_bottom_dict, ci_mean_dict, ci_top_dict, num_examples_by_bin, reliability_line_colour=DEFAULT_RELIABILITY_COLOUR, reliability_line_width=DEFAULT_RELIABILITY_WIDTH, perfect_relia_line_colour=DEFAULT_PERFECT_RE...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self, width, height, data, palette, labels, axis_labels=[], axis_label_height=16):\n\n DiagramElement.__init__(self)\n self.palette = palette\n self.labels = labels\n self.plot = DiscretePlot(width, height, data, self.labels, axis_labels,axis_label_height)\n self.plo...
[ "0.5769211", "0.5578839", "0.5578839", "0.5510679", "0.5479296", "0.5369858", "0.5342495", "0.53263974", "0.5322546", "0.51956356", "0.5170794", "0.5103581", "0.5096639", "0.505632", "0.49624193", "0.49553692", "0.49490607", "0.4941913", "0.49288616", "0.49155903", "0.4908788...
0.6774211
0
Provides the spin from an int. +1 == Spin.up, 1 == Spin.down.
def from_int(i): if i == 1: return Spin.up elif i == -1: return Spin.down else: raise ValueError("Spin integers must be 1 or -1")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_spin(self, i):\n \n return 1 if self.spins[i] else -1", "def spin(mult):\n return mult - 1", "def getSpinControl(*args):", "def on_spin(self, event):\n spin_value = self.spin_run.GetValue()\n text = \"\".join([_(u\"New run spin control value: \"), str(spin_value)])\n ...
[ "0.7496796", "0.7100908", "0.66705376", "0.66398364", "0.65249074", "0.64780074", "0.6415233", "0.630757", "0.6230635", "0.6085406", "0.5867", "0.58657813", "0.5847536", "0.582126", "0.5800157", "0.57851535", "0.57549834", "0.57405555", "0.5706542", "0.5580043", "0.5572952", ...
0.8344842
0
String indicating the type of orbital. Is always uppercase. E.g., S, P, D, F, etc.
def orbital_type(self): return self.name[0].upper()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getType(self):\n if (self.type == 's'):\n #suit type\n type = \"suit\"\n elif (self.type == 'b'):\n #boss type\n type = \"boss\"\n else:\n notify.error(\"Invalid DNA type: \", self.type)\n\n return type", "def unit_type(self) ...
[ "0.64918655", "0.6483131", "0.6290639", "0.5996382", "0.5951763", "0.5928909", "0.5896806", "0.5896335", "0.5885597", "0.58396786", "0.5786302", "0.571342", "0.57116663", "0.5709346", "0.567985", "0.5675378", "0.56724256", "0.56724256", "0.56605196", "0.5654156", "0.56412363"...
0.819442
0
Returns an orbital based on the index of the orbital in VASP runs.
def from_vasp_index(i): return Orbital.all_orbitals[i]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def orbit_index():\n return OrbitController.invoke(OUTPUT_DIRECTORY)", "def get_vsolar(self):\n return self.read_register(4098, 1, 3)", "def get_orbit(self):\n return self.get_attr('orbit')", "def get_solar(self, name_building):\n return self._solar.loc[name_building]", "def solar_t...
[ "0.63372135", "0.5902144", "0.5708969", "0.5705622", "0.5473955", "0.5333812", "0.5275198", "0.5232643", "0.5220132", "0.51939213", "0.5165619", "0.5133298", "0.5122275", "0.5114667", "0.50612587", "0.50426286", "0.50406325", "0.49916345", "0.49804333", "0.49263537", "0.49151...
0.80536574
0
Returns an orbital from a string representation, e.g., "s", "px".
def from_string(orb_str): for orb in Orbital.all_orbitals: if str(orb) == orb_str: return orb raise ValueError("Illegal orbital definition!")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def fromString(cls, string):\n # From SAM specification v1.5, slightly adapted for single-token parsing\n pattern = r\"^[0-9]+[MIDNSHPX=]\" \n string = string.strip()\n if string == '*':\n return CIGAR.fromList(['*'])\n parsed = []\n s = string\n # Parse ...
[ "0.5704035", "0.5645704", "0.56413406", "0.558188", "0.5521622", "0.5513611", "0.5464635", "0.54529065", "0.5443319", "0.5428483", "0.5418516", "0.53966254", "0.53935385", "0.53825116", "0.5334332", "0.5319566", "0.52879316", "0.5284919", "0.5277784", "0.5237857", "0.52367216...
0.67074496
0
We use cli_url to set CLI URL and reflect this in cli_area to take it from JS.
def _get_cli_area(self): for rec in self: rec.cli_area = rec.cli_url
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _set_cli_area(self):\n pass", "def cli():", "def cli():", "def cli():", "def cli():", "def cli():", "def cli():", "def cli():", "def cli():", "def cli():", "def cli():", "def cli():", "def cli():", "def cli():", "def cli():", "def cli():", "def cli():", "def cli():", ...
[ "0.67812735", "0.6515039", "0.6515039", "0.6515039", "0.6515039", "0.6515039", "0.6515039", "0.6515039", "0.6515039", "0.6515039", "0.6515039", "0.6515039", "0.6515039", "0.6515039", "0.6515039", "0.6515039", "0.6515039", "0.6515039", "0.6515039", "0.6515039", "0.6515039", ...
0.68657756
0
Asks for the user to guess numbers and turns the strings to a list
def user_guess(): return list(input("What is your guess?"))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def user_input():\n guess_num = int(input(\"please type four-digit: \"))\n guess_list = list(str(guess_num))\n return guess_list", "def convert_str_input_into_list_of_int(guess_input):\n guess = list(guess_input)\n guess = [int(x) for x in guess]\n return guess", "def get_user_list(question):...
[ "0.7755962", "0.69793016", "0.6891124", "0.6676904", "0.63334835", "0.63176185", "0.62182146", "0.60630065", "0.60263", "0.5925718", "0.58965445", "0.5883831", "0.58714354", "0.58387905", "0.5829174", "0.5744655", "0.5730842", "0.5711055", "0.5682094", "0.5649758", "0.5617869...
0.73835796
1
It takes the code generater by the machine and the user's guess then compares the numbers in a loop and creates a list of clues according to the matching parameters
def clues_generator(code, userGuess): if userGuess == code: return "Code Cracked!" clues = [] # Compare guess to code for ind, num in enumerate(userGuess): if num == code[ind]: clues.append("Match") elif num in code: clues.append("Close") if clues ==...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def eval_guess(self, Guess):\n\n\t\t# pulls comparison from win check and assigns peg responses \n\n\t\t# returns a list to be in hint_response\n\n\t\t# displays as part of big display in view.\n\n\t\t\"\"\"Borrow the logic from win_check to implement eval_guess. Use variables right and wrong to \n\t\tevaluate. Ri...
[ "0.65523076", "0.6467425", "0.6455887", "0.63705254", "0.6136182", "0.5947095", "0.5909345", "0.58723474", "0.5860619", "0.58369917", "0.58310723", "0.5819333", "0.5809662", "0.5804019", "0.5748134", "0.5729847", "0.5718463", "0.57156974", "0.5695532", "0.56886834", "0.567663...
0.75308436
0
Get compute plugin disabled status
def nfvi_compute_plugin_disabled(): return (_compute_plugin is None)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_disabled_plugins(self):\n return self._disabled_plugins", "def getDisabledPlugin(self, *args):\n return _libsbml.SBase_getDisabledPlugin(self, *args)", "def get_disabled(self):\n return self._disabled", "def get_disabled(self):\n return self._disabled", "def getNumDisabl...
[ "0.7047027", "0.66642225", "0.6457143", "0.6457143", "0.6397048", "0.63932973", "0.63549125", "0.6290539", "0.62651056", "0.62651056", "0.61825705", "0.615268", "0.6097714", "0.6097714", "0.6058149", "0.6056175", "0.60538864", "0.6039746", "0.60189015", "0.6017175", "0.600594...
0.7179284
0
Get a list of host aggregates
def nfvi_get_host_aggregates(callback): cmd_id = _compute_plugin.invoke_plugin('get_host_aggregates', callback=callback) return cmd_id
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def compute_host_aggregates(self):\n path = '/os-aggregates'\n res = self.compute.call(path, 'GET', data='', \n token=self.manager.identity.token)\n self.logger.debug('Get openstack host aggregates: %s' % truncate(res))\n return res[0]['aggregates']", "d...
[ "0.82682306", "0.65386385", "0.650028", "0.62470096", "0.6212668", "0.6188747", "0.61886394", "0.6129932", "0.6109547", "0.6059295", "0.58552474", "0.5842673", "0.5836488", "0.5821537", "0.5802988", "0.5714081", "0.57066965", "0.56985897", "0.56599617", "0.5650841", "0.565036...
0.7245975
1
Delete an instance type
def nfvi_delete_instance_type(instance_type_uuid, callback): cmd_id = _compute_plugin.invoke_plugin('delete_instance_type', instance_type_uuid, callback=callback) return cmd_id
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def delete(cls, type_obj):\n DB.session.delete(type_obj)\n DB.session.commit()", "def test_instance_type_create_then_delete(self):\n name = 'Small Flavor'\n flavorid = 'flavor1'\n\n original_list = instance_types.get_all_types()\n\n # create new type and make sure values...
[ "0.75105196", "0.7219865", "0.71700513", "0.68534404", "0.6839456", "0.6828863", "0.6794721", "0.67646134", "0.6655979", "0.66524136", "0.66384214", "0.6603012", "0.65674657", "0.6551319", "0.6535387", "0.6509424", "0.6474037", "0.64697915", "0.6459448", "0.6426711", "0.64048...
0.738218
1
Cold migrate confirm an instance
def nfvi_cold_migrate_confirm_instance(instance_uuid, callback, context=None): if context is None: cmd_id = _compute_plugin.invoke_plugin_expediate( 'cold_migrate_confirm_instance', instance_uuid, context, callback=callback) else: cmd_id = _compute_plugin.invoke_plugin( ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def confirm_migration(self, migration, instance, network_info):\n raise NotImplementedError()", "def migrate(self):\n\tpass", "def migrate():\n if apply_migrations():\n click.echo(OK)\n else:\n sys.exit(1)", "def migrate(cr, version):\n pass", "def post_migrations(self):", "...
[ "0.72407913", "0.6868304", "0.6802639", "0.6643721", "0.64271414", "0.6412695", "0.63651156", "0.6314516", "0.63011813", "0.61909187", "0.6099909", "0.60377604", "0.6023261", "0.59750897", "0.5949194", "0.59245265", "0.5899963", "0.5899963", "0.58728546", "0.58728546", "0.586...
0.7104281
1
Cold migrate revert an instance
def nfvi_cold_migrate_revert_instance(instance_uuid, callback, context=None): cmd_id = _compute_plugin.invoke_plugin('cold_migrate_revert_instance', instance_uuid, context, callback=callback) return cmd_id
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def migrate(cr, version):\n pass", "def migrate(self):\n\tpass", "def post_revert(self):", "def pre_revert(self):", "def migration():", "def test_migration_task_rollback(self):\n server, source_host, target_host = self._create_server()\n self._disable_target_host(target_host)\n se...
[ "0.69084084", "0.6837074", "0.66857207", "0.66517055", "0.66482615", "0.6580794", "0.6542509", "0.65224993", "0.6518319", "0.65061986", "0.6489541", "0.64496523", "0.6444745", "0.6442864", "0.6369054", "0.6349502", "0.6275725", "0.62747025", "0.6249206", "0.62250805", "0.6209...
0.739316
0
Reject an action against an instance
def nfvi_reject_instance_action(instance_uuid, message, context): cmd_id = _compute_plugin.invoke_plugin('reject_instance_action', instance_uuid, message, context) return cmd_id
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def reject(self):\n pass", "def reject(self, responder):\n self._apply_decision(self.Status.REJECTED, responder)", "def on_reject(self):\n self.state = REJECTED\n self._reject()", "def reject(self, message):\n boto_connection = connection.get_connection()\n boto_conn...
[ "0.7002768", "0.64793044", "0.6412309", "0.6220728", "0.6187695", "0.6176384", "0.6163549", "0.6141075", "0.61121845", "0.6057996", "0.603861", "0.598698", "0.5980348", "0.5910807", "0.5905218", "0.5896408", "0.5850485", "0.584049", "0.58146614", "0.5792201", "0.5752381", "...
0.702213
0
Register for instance action change notifications
def nfvi_register_instance_action_change_callback(callback): _compute_plugin.invoke_plugin('register_instance_action_change_callback', callback=callback)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def nfvi_register_instance_action_callback(callback):\n _compute_plugin.invoke_plugin('register_instance_action_callback',\n callback=callback)", "def on_register(cls):", "def notifyObservers(self):", "def _instance_changed_handler ( self, name, old, new ):\n arg_li...
[ "0.6161295", "0.6089405", "0.59604", "0.59021795", "0.58711416", "0.58598304", "0.5859007", "0.58397067", "0.576684", "0.56879747", "0.5651403", "0.5616433", "0.5599115", "0.5545698", "0.55440086", "0.55440086", "0.55310184", "0.552071", "0.5515812", "0.55045426", "0.5493684"...
0.6844933
0
Register for instance action callback
def nfvi_register_instance_action_callback(callback): _compute_plugin.invoke_plugin('register_instance_action_callback', callback=callback)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def nfvi_register_instance_action_change_callback(callback):\n _compute_plugin.invoke_plugin('register_instance_action_change_callback',\n callback=callback)", "def on_register(cls):", "def register(self, callback):\n self.callback = callback", "def add_callback(cal...
[ "0.7074271", "0.69212306", "0.6914295", "0.6678117", "0.65792686", "0.6406543", "0.6396015", "0.6325683", "0.6325683", "0.62563324", "0.6227942", "0.62053627", "0.62053627", "0.61932707", "0.61932707", "0.61932707", "0.61629814", "0.61220556", "0.6121512", "0.6076169", "0.606...
0.7680887
0
Notify compute host is enabled
def nfvi_notify_compute_host_enabled(host_uuid, host_name, host_personality, callback): cmd_id = _compute_plugin.invoke_plugin('notify_host_enabled', host_uuid, host_name, host_personality, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def nfvi_notify_compute_host_disabled(host_uuid, host_name, host_personality,\n callback):\n cmd_id = _compute_plugin.invoke_plugin('notify_host_disabled',\n host_uuid, host_name,\n host_pers...
[ "0.6910246", "0.63405925", "0.6329132", "0.6329132", "0.6197454", "0.6078591", "0.5980807", "0.5833863", "0.5802485", "0.57806736", "0.5662218", "0.5642115", "0.558865", "0.5550963", "0.5544851", "0.55175227", "0.5497251", "0.54892796", "0.5441781", "0.5439356", "0.5438972", ...
0.7718271
0
Notify compute host is disabled
def nfvi_notify_compute_host_disabled(host_uuid, host_name, host_personality, callback): cmd_id = _compute_plugin.invoke_plugin('notify_host_disabled', host_uuid, host_name, host_personality, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def nfvi_notify_compute_host_enabled(host_uuid, host_name, host_personality,\n callback):\n cmd_id = _compute_plugin.invoke_plugin('notify_host_enabled',\n host_uuid, host_name,\n host_persona...
[ "0.6590806", "0.65881276", "0.6332107", "0.6331109", "0.6220316", "0.620537", "0.6117578", "0.6104185", "0.6052198", "0.6050748", "0.59577185", "0.58573514", "0.5832847", "0.5814101", "0.5814101", "0.5747102", "0.5736996", "0.57186717", "0.5702843", "0.57011414", "0.5687968",...
0.7907137
0
Disable compute host services
def nfvi_disable_compute_host_services(host_uuid, host_name, host_personality, callback): cmd_id = _compute_plugin.invoke_plugin('disable_host_services', host_uuid, host_name, host_personalit...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def nfvi_notify_compute_host_disabled(host_uuid, host_name, host_personality,\n callback):\n cmd_id = _compute_plugin.invoke_plugin('notify_host_disabled',\n host_uuid, host_name,\n host_pers...
[ "0.7023965", "0.6589337", "0.65053415", "0.6484101", "0.61595577", "0.6139749", "0.5918607", "0.5901828", "0.58210856", "0.5821036", "0.5794583", "0.57928306", "0.57894987", "0.5775211", "0.5763872", "0.573645", "0.5679011", "0.5662737", "0.56420565", "0.56060183", "0.5554399...
0.79389197
0
Enable compute host services
def nfvi_enable_compute_host_services(host_uuid, host_name, host_personality, callback): cmd_id = _compute_plugin.invoke_plugin('enable_host_services', host_uuid, host_name, host_personality, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def nfvi_notify_compute_host_enabled(host_uuid, host_name, host_personality,\n callback):\n cmd_id = _compute_plugin.invoke_plugin('notify_host_enabled',\n host_uuid, host_name,\n host_persona...
[ "0.63588804", "0.63349974", "0.6177922", "0.6154969", "0.61493015", "0.606561", "0.6054695", "0.6049442", "0.60288525", "0.6004999", "0.59542507", "0.58375365", "0.58375365", "0.5803038", "0.57903194", "0.5772306", "0.56935096", "0.567679", "0.5676517", "0.56693524", "0.56370...
0.78876954
0
Initialize the NFVI compute package
def nfvi_compute_initialize(config, pool): global _compute_plugin if _compute_plugin is None: _compute_plugin = NFVIComputePlugin(config['namespace'], pool) if _compute_plugin.ready_to_initialize(config['config_file']): _compute_plugin.initialize(config['config_file']) return True ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def initialize(self):\n self.initialize_edges()\n self.initialize_prob()\n self.initialize_total_input_dict()\n\n self.initialize_fpmusigv_dict()", "def main():\n run_nutanix_vm_creation_module()", "def __init__(self, nvim):\n self.nvim = nvim", "def __init__(self,comput...
[ "0.6496471", "0.6278192", "0.6062997", "0.59552294", "0.59278333", "0.5924738", "0.5892015", "0.57887715", "0.5772586", "0.5722492", "0.57131547", "0.5701967", "0.56974494", "0.5684051", "0.56797975", "0.5674536", "0.56544673", "0.56248695", "0.56169355", "0.5615452", "0.5615...
0.7209175
0
Finalize the NFVI compute package
def nfvi_compute_finalize(): if _compute_plugin is not None: _compute_plugin.finalize()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def finalize(self):\n self.classifier.finalize()", "def finalize(self):\n pass\n #fftw2py.clean_fftw_solver(self.output_field.dimension)", "def finalize(self):\n self.report('Finalizing optimization procedure.')\n with self.optimizer() as opt:\n optimal_process_out...
[ "0.6502741", "0.650001", "0.62286294", "0.6211019", "0.6211019", "0.6211019", "0.61800075", "0.6171059", "0.6159695", "0.6159695", "0.61318797", "0.6069689", "0.6061937", "0.60552156", "0.6054228", "0.60331243", "0.60229737", "0.60056174", "0.60056174", "0.60056174", "0.60056...
0.8275187
0
If we have multiple projects, will loop through the projects to find the one with the given story. returns None if not found
def find_project_for_story(story_id): for project in Project.all(): story = project.load_story(story_id) if story is not None: return project #Not found print "No project found for story: #{}".format(story_id) return None
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def find_project_for_story(story_id):\r\n\r\n for project in Project.all():\r\n story = project.load_story(story_id)\r\n if story is not None:\r\n return project\r\n\r\n #Not found\r\n print \"No project found for story: #{}\".format(story_id)\r\n return None", "def get_proje...
[ "0.84241813", "0.62560344", "0.61722744", "0.60507", "0.59317017", "0.5916581", "0.59009284", "0.587145", "0.5809766", "0.57527995", "0.56877387", "0.56099844", "0.56028783", "0.56005305", "0.5553567", "0.5518918", "0.5457603", "0.53568715", "0.53509325", "0.53243184", "0.530...
0.84125274
1
returns the first label if any from labels. Used for grouping
def first_label(self): if self.labels: return self.labels[0] else: return None
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def first_label(self):\r\n return self.labels.split(',')[0]", "def label(tree):\n return tree[0]", "def getLabel(labels):\r\n elems = {}\r\n for l in labels:\r\n if l not in elems.keys():\r\n elems[l] = 1\r\n else:\r\n elems[l] += 1\r\n counts = sorted(ele...
[ "0.8280834", "0.68157196", "0.6787128", "0.67655355", "0.67253506", "0.6636867", "0.6554082", "0.65352005", "0.65143234", "0.6482284", "0.64466333", "0.64403844", "0.64376044", "0.64165425", "0.6404469", "0.6386726", "0.6379", "0.6357332", "0.6351127", "0.6299424", "0.6292083...
0.851758
0
Given a filter strong, returns an list of stories matching that filter. If none will return an empty list
def get_stories(self, filter_string): story_filter = quote(filter_string, safe='') stories_url = "https://www.pivotaltracker.com/services/v5/projects/{}/stories?filter={}".format(self.project_id, story_filter) response = _perform_pivotal_get(stories_url) return [Story.from_json(story_n...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def GetStories(self, filt=None):\n stories = self._ApiQueryStories(filt)\n parsed = xml.dom.minidom.parseString(stories)\n els = parsed.getElementsByTagName('story')\n lst = []\n for el in els:\n lst.append(Story.FromXml(el.toxml()))\n return lst", "def get_st...
[ "0.69686466", "0.68707925", "0.6780581", "0.6072194", "0.57923883", "0.55801576", "0.5537283", "0.5517888", "0.55005556", "0.5456136", "0.53563553", "0.53528243", "0.5330737", "0.5328852", "0.5321616", "0.5312549", "0.5293955", "0.5254234", "0.52464867", "0.5211708", "0.52068...
0.68931544
1
parses an int from an ElementTree node, if not found returns None
def _parse_int(node, key): element = node.get(key) if element is not None: return int(element) else: return None
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _parse_int(node, key):\r\n element = node.find(key)\r\n if element is not None:\r\n return int(element.text)\r\n else:\r\n return None", "def parseint(el):\n return parse(el, int)", "def convertStringToInt(xmlNode):\n try:\n val = int(xmlNode.text)\n return val\n except (V...
[ "0.8366567", "0.68826133", "0.6643716", "0.6231448", "0.6134712", "0.60349727", "0.588818", "0.5871328", "0.58434844", "0.58222824", "0.579166", "0.579166", "0.57692295", "0.57690537", "0.576285", "0.5756573", "0.57532364", "0.5742738", "0.57313293", "0.56075567", "0.55872804...
0.8116926
1
parses an boolean from an ElementTree node, if not found returns None
def _parse_boolean(node, key): element = node.get(key) if element is not None: return bool(element) else: return None
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _parse_boolean(node, key):\r\n element = node.find(key)\r\n if element is not None:\r\n if element.text == 'true':\r\n return True\r\n else:\r\n return False\r\n else:\r\n return None", "def _get_bool(element, name, context, default=None):\n\n value = el...
[ "0.83501446", "0.6932032", "0.692632", "0.65882355", "0.65580535", "0.6457279", "0.63471276", "0.6239328", "0.60651743", "0.59987414", "0.59204286", "0.58954495", "0.5884764", "0.5840993", "0.5837576", "0.58079356", "0.5725734", "0.57157356", "0.5690965", "0.56830674", "0.567...
0.83073354
1
Checks if value is a dict
def is_dict(value): return isinstance(value, dict)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _is_dict(val):\n\n return isinstance(val, dict)", "def _is_dict(item):\n return isinstance(item, dict)", "def isDict(data):\n\ttry:\n\t\tfrom types import DictType\n\t\tif type(data) == DictType:\n\t\t\treturn True\n\texcept ImportError:\n\t\tif type(data) == type({}):\n\t\t\treturn True\n\treturn ...
[ "0.8891944", "0.84969", "0.7979519", "0.7861109", "0.7839897", "0.77455854", "0.75733715", "0.74826515", "0.72116905", "0.7184174", "0.7079954", "0.7000585", "0.6909393", "0.6878562", "0.68191737", "0.6789989", "0.66548675", "0.6653721", "0.66456836", "0.65667856", "0.6566524...
0.8975367
0
Checks if value is a list
def is_list(value): return isinstance(value, list)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _is_list(val):\n\n return isinstance(val, list)", "def is_list(value):\n return isinstance(value, list) or None", "def _is_list(item):\n return isinstance(item, list)", "def isList(data):\n\ttry:\n\t\tfrom types import ListType\n\t\tif type(data) == ListType:\n\t\t\treturn True\n\texcept Impor...
[ "0.9028631", "0.8771568", "0.8495955", "0.8216776", "0.81552017", "0.8091219", "0.8072429", "0.79981005", "0.7949894", "0.7946823", "0.7922643", "0.77240074", "0.7716478", "0.76670384", "0.7631471", "0.761264", "0.7607154", "0.7554368", "0.75167143", "0.7500501", "0.7436007",...
0.9064887
0
Get epoch time (seconds) from either passed in UTC datetime or current datetime
def get_epoch_time(utc_datetime=None): if not utc_datetime: utc_datetime = datetime.datetime.utcnow() return math.ceil((utc_datetime - EPOCH_START).total_seconds())
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _current_epoch_secs():\n now = datetime.datetime.utcnow()\n epoch = datetime.datetime(1970, 1, 1)\n return (now - epoch).total_seconds()", "def epoch_time(when):\n if not when: return 0\n epoch = datetime.utcfromtimestamp(0)\n delta = when - epoch\n return int(delta.total_seconds())", "def t...
[ "0.7687502", "0.75600356", "0.7200416", "0.7182325", "0.69882435", "0.6922301", "0.68947226", "0.68947226", "0.68390167", "0.6823786", "0.67153645", "0.6711426", "0.6711426", "0.6687371", "0.6630511", "0.6630511", "0.66261214", "0.6570021", "0.6527329", "0.65121967", "0.65042...
0.77804226
0
Get epoch time (milliseconds) from either passed in UTC datetime or current datetime
def get_epoch_time_milliseconds(utc_datetime=None): epoch_seconds = get_epoch_time(utc_datetime) return epoch_seconds * MILLISECONDS_IN_SECOND
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_epoch_time(utc_datetime=None):\n if not utc_datetime:\n utc_datetime = datetime.datetime.utcnow()\n return math.ceil((utc_datetime - EPOCH_START).total_seconds())", "def epoch_time_now():\n return int(time.time())", "def epoch_time(when):\n if not when: return 0\n epoch = datetime...
[ "0.78353167", "0.75055903", "0.74338925", "0.7330113", "0.72694373", "0.726492", "0.7158576", "0.7086221", "0.69683", "0.68982023", "0.6857221", "0.6855786", "0.6811981", "0.6789083", "0.6776045", "0.6776045", "0.6746983", "0.67409736", "0.6735191", "0.6717645", "0.67158127",...
0.75269914
1
Returns True if val is Falsy, otherwise returns False
def is_empty(val): return not bool(val)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_truthy(val):\n return bool(val)", "def non_empty(val):\n return val is not None and val != \"\"", "def _val_is_null(self, val):\r\n return val is None", "def not_none(value):\n return not value is None", "def is_false(value):\n \n return (value is False)", "def empty(self...
[ "0.7918933", "0.790834", "0.742545", "0.7357178", "0.73020804", "0.70956635", "0.70306563", "0.7005919", "0.7005919", "0.7005919", "0.7005919", "0.7005919", "0.69641405", "0.6962459", "0.69548154", "0.69414115", "0.6874724", "0.6852935", "0.6849699", "0.6779061", "0.6711758",...
0.82153666
0
Return the food "Item" string with most calories
def get_food_most_calories(df=df): return df[df.Calories == df.Calories.max()]["Item"].values[0]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_food_most_calories(df=df):\r\n max_calories_row = df.loc[df['Calories'].idxmax()]\r\n return max_calories_row['Item']", "def get_longest_item(self,items):\n # Assume longest is initially zero\n longest = 0\n for item in items:\n # get length of item name\n ...
[ "0.75917083", "0.6445081", "0.64260274", "0.6388405", "0.62523913", "0.61627793", "0.6064445", "0.6044672", "0.60257804", "0.592605", "0.59001374", "0.58869326", "0.582938", "0.58228385", "0.5761905", "0.5699086", "0.56825083", "0.5679168", "0.56749237", "0.5670001", "0.56378...
0.75638163
1
Calulate the Protein/Calories ratio of foods and return the 5 foods with the best ratio. This function has a excl_drinks switch which, when turned on, should exclude 'Coffee & Tea' and 'Beverages' from this top 5. You will probably need to filter out foods with 0 calories to get the right results. Return a list of the ...
def get_bodybuilder_friendly_foods(df=df, excl_drinks=False): if excl_drinks: fltr_excl_drinks = ~df["Category"].isin(["Coffee & Tea", "Beverages"]) else: fltr_excl_drinks = True df_nzc = df[(df.Calories != 0) & fltr_excl_drinks] # non zero calories fltr = (df_nzc.Protein / df_nzc.Calori...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_bodybuilder_friendly_foods(df=df, excl_drinks=False):\r\n df_calories = df[df['Calories'] > 0]\r\n if excl_drinks:\r\n df_calories = df_calories[~df_calories['Category'].isin(['Beverages', 'Coffee & Tea'])]\r\n df_calories['Protein/Calories Ratio'] = df_calories['Protein']/df_calories['Calo...
[ "0.74542266", "0.59881717", "0.59221107", "0.5832556", "0.579231", "0.57728446", "0.5715874", "0.5698817", "0.5600146", "0.5584469", "0.55476344", "0.54607743", "0.5436297", "0.5423807", "0.5420557", "0.5348513", "0.5281259", "0.5276994", "0.52353954", "0.5232096", "0.5221799...
0.7044193
1
Hydrodynamic added mass matrix of a vertical cylinder
def cylindervert_addedmass(R, z1, z2, rho, Ca=1, AxCa=1, m_f=0, z_f=0, m_mg=0, z_mg=0): if z1<z2: raise Exception('z1 should be above z2') if z1<0: # Fully submerged ztop = z1 A0=0 nAx=2 else: # Partially submerged ztop = 0 A0 = np.pi*...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_mass_matrix(self, model):\n # Create list of mass matrices for each equation to be put into block\n # diagonal mass matrix for the model\n mass_list = []\n mass_inv_list = []\n\n # get a list of model rhs variables that are sorted according to\n # where they are...
[ "0.637787", "0.6240188", "0.6122389", "0.6016837", "0.58427894", "0.5698982", "0.5682351", "0.5587956", "0.55861175", "0.55698025", "0.5528634", "0.5519884", "0.5518754", "0.5508576", "0.5492544", "0.54866624", "0.5483343", "0.5426447", "0.54144776", "0.53910035", "0.53630376...
0.69000477
0
Does a None user return False
def test_user_is_none(self): self.assertFalse(send_rotate_to_can(None, self.BIN_NUM))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test__user_passed_as_none(self):\r\n access.has_access(None, 'staff', 'global', None)", "def is_not_none(e):\n return e is not None", "def is_none(obj):\n return obj is None", "def not_none(value):\n return not value is None", "def NoPrompt(self) -> bool:", "def validUser(self):\n...
[ "0.73663986", "0.68698525", "0.68031555", "0.67773694", "0.6765492", "0.6731775", "0.67047375", "0.6696048", "0.66367894", "0.65957487", "0.65957487", "0.65957487", "0.65957487", "0.65957487", "0.65849674", "0.6499765", "0.64993566", "0.64586663", "0.64354175", "0.64343435", ...
0.7621539
0
A CanInfo where a matching user cannot be found returns False
def test_can_info_does_not_exist(self): fake_user = User(username='Fake', password='') self.assertFalse(send_rotate_to_can(fake_user, self.BIN_NUM))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def check_user(self):\n try:\n if self.get_customer()[0][0] == self.dni:\n return True\n else:\n return False\n except:\n return False", "def has_user(self, user): # pylint: disable=unused-argument\r\n return False", "def can_...
[ "0.6713832", "0.6679743", "0.6537976", "0.6529905", "0.64860743", "0.62871456", "0.627677", "0.62588006", "0.62487483", "0.61500865", "0.6142585", "0.608562", "0.6068029", "0.6054016", "0.60393703", "0.6035473", "0.6035473", "0.60319674", "0.59979326", "0.5986419", "0.5980946...
0.6814037
0
When the channel on the CanInfo is None, return False
def test_request_channel_is_none(self): CanInfo.objects.filter(can_id=self.UUID).update(channel_name=None) self.assertFalse(send_rotate_to_can(self.USER, self.BIN_NUM))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_channel(self):\n return True", "def ccheck(self, msg):\r\n if msg.channel == self.channel or (msg.channel.is_private and self.ispm):\r\n return True\r\n return False", "def single_channel():\n return True", "def is_empty(self):\n return self.channels is No...
[ "0.7227819", "0.7064459", "0.66487986", "0.6543717", "0.6476909", "0.6457839", "0.6433133", "0.63275003", "0.6317527", "0.6239171", "0.62300515", "0.62059534", "0.61681944", "0.612439", "0.607638", "0.6019896", "0.5983071", "0.5969868", "0.59639364", "0.5955076", "0.5921539",...
0.76990074
0