query
stringlengths
9
3.4k
document
stringlengths
9
87.4k
metadata
dict
negatives
listlengths
4
101
negative_scores
listlengths
4
101
document_score
stringlengths
3
10
document_rank
stringclasses
102 values
Flooring an Integral returns itself.
def __floor__(self, ???):
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def ifloor(x):\n return np.floor(x).astype(np.int)", "def ifloor(f: SupportsFloat) -> int:\n\t\t# noinspection PyTypeChecker\n\t\treturn int(np.floor(f))", "def floor(x):\r\n # see decorator for function body\r", "def __floordiv__(self, other: 'SInt') -> 'SInt':\r\n return self.__divmod__(other)...
[ "0.67361206", "0.6702712", "0.6661377", "0.66526467", "0.662397", "0.6542605", "0.650853", "0.64453816", "0.6428101", "0.6389583", "0.63358885", "0.6309847", "0.6232222", "0.6163292", "0.6129331", "0.6065757", "0.60387206", "0.60387206", "0.60387206", "0.60387206", "0.6038720...
0.6034896
32
Return self converted to an integer, if self is suitable for use as an index into a list.
def __index__(self, ???):
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __index__(self):\n return int(self)", "def get_from_list(self,list_,index):\r\n\r\n\r\n try:\r\n return list_[self._index_to_int(index)]\r\n except IndexError:\r\n self._index_error(list_,index)", "def get_list_index(self):\r\n return self.n", "def _conve...
[ "0.7188164", "0.63467824", "0.6298761", "0.60838765", "0.6057918", "0.6057918", "0.59225106", "0.5918834", "0.58440137", "0.58421063", "0.5836758", "0.57787126", "0.57725865", "0.5767357", "0.57622445", "0.5737863", "0.5737863", "0.57028806", "0.56473804", "0.56352437", "0.56...
0.0
-1
Initialize self. See help(type(self)) for accurate signature.
def __init__(self, ???):
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self) -> None:\n # TODO: Provide the complete constructor for this object", "def __init__ (self):\n pass", "def initialize(self) -> None:\n pass", "def init(self):\n raise NotImplementedError", "def init(self):\n raise NotImplementedError", "def _init(self)...
[ "0.87474036", "0.8525425", "0.8491308", "0.84711033", "0.84711033", "0.8465522", "0.8406835", "0.8406835", "0.84063613", "0.8390078", "0.8390078", "0.8390078", "0.8390078", "0.8390078", "0.8390078", "0.8390078", "0.8390078", "0.8380026", "0.8366272", "0.8366272", "0.8366272",...
0.0
-1
Create and return a new object. See help(type) for accurate signature.
def __new__(self, ???):
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def make_object():\n return object()", "def create(cls, _):\n return cls", "def __newobj__(cls, *args):\n return cls.__new__(cls, *args)", "def create(cls):\n pass\n return cls()", "def __new__(cls):\n return object.__new__(cls)", "def __new__(cls):\n return objec...
[ "0.7521635", "0.74247146", "0.7226771", "0.72235626", "0.7097113", "0.7097113", "0.70590734", "0.70068395", "0.6914946", "0.6869231", "0.6814115", "0.6813175", "0.6803347", "0.6693966", "0.6628847", "0.65862906", "0.65708584", "0.6558201", "0.65469146", "0.654557", "0.6538341...
0.6541631
20
Return pow(self, value, mod).
def __pow__(self, ???):
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __pow__(self, exponent, modulus=None):\n raise NotImplementedError", "def __pow__(self, exponent):\n return self.runtime.pow(self, exponent)", "def pow_mod_p(self, base, power, mod):\n if power == 0:\n assert(base == 0)\n return 1\n res = 1\n base = ...
[ "0.7544742", "0.7352075", "0.72856295", "0.7263611", "0.70423114", "0.7027908", "0.69635016", "0.69392157", "0.6919337", "0.6908155", "0.68969655", "0.688093", "0.67358375", "0.6707679", "0.6690961", "0.6656856", "0.6554308", "0.6531694", "0.65276283", "0.6506775", "0.6460955...
0.6598791
16
Rounding an Integral returns itself. Rounding with an ndigits argument also returns an integer.
def __round__(self, ???):
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def rint(a: Number) -> int:\n return np.round(a).astype(int)", "def round_to_n(x, n=8):\n n = 1 + n - int(np.floor(np.log10(abs(x) + .1)))\n\n return round(x, n)", "def floor(n: float) -> int:\n return int(n // 1)", "def _round_bits(n: int, radix_bits: int) -> int:\n return (n + radix_bits - 1...
[ "0.64221036", "0.6339263", "0.6302684", "0.62893486", "0.62807405", "0.62599695", "0.6245108", "0.6131638", "0.60956126", "0.60472924", "0.60424244", "0.603188", "0.6004666", "0.5991947", "0.5971304", "0.5969825", "0.5939575", "0.5907737", "0.5896189", "0.58947676", "0.586716...
0.50610477
100
Return pow(value, self, mod).
def __rpow__(self, ???):
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __pow__(self, exponent, modulus=None):\n raise NotImplementedError", "def pow_mod_p(self, base, power, mod):\n if power == 0:\n assert(base == 0)\n return 1\n res = 1\n base = base % mod\n while power != 0:\n if power % 2 == 1:\n ...
[ "0.7711946", "0.75317925", "0.75246835", "0.7518037", "0.72767156", "0.7258819", "0.7242227", "0.7182284", "0.7105916", "0.709262", "0.7044712", "0.6997266", "0.69915473", "0.69267416", "0.6879822", "0.6866718", "0.6838548", "0.6826695", "0.68089324", "0.6760389", "0.67296237...
0.6536612
29
Implement setattr(self, name, value).
def __setattr__(self, ???):
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __setattr__(self, name, value):\n self.set(**{name: value})", "def set_attr(self, name, value):\n setattr(self, name, value)", "def __setattr__(self, name, value):\n if not hasattr(self, name):\n raise AttributeError(\"'%s' object has no attribute '%s'\" % (type(self).__name...
[ "0.8687707", "0.8360292", "0.82896507", "0.8283832", "0.8222997", "0.82034224", "0.80986154", "0.80986154", "0.80706227", "0.8039246", "0.80230665", "0.79968554", "0.7988409", "0.79871696", "0.79480726", "0.79357886", "0.7930451", "0.7890624", "0.78896755", "0.7800386", "0.77...
0.0
-1
Returns size in memory, in bytes
def __sizeof__(self, ???):
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getSize(self) -> int:\n return len(self.mem)", "def getSize(self):\n return self.bf.memory()", "def size(self):\r\n return self.size.data", "def get_size(self):", "def memsize(self):\n return self.xlist(\"get-memsize\")[1][0] * 1024", "def size(self):\n size = 0\n ...
[ "0.82633346", "0.8234427", "0.8079916", "0.80716985", "0.80647814", "0.80248195", "0.801231", "0.8001166", "0.7944825", "0.794089", "0.7870036", "0.78496706", "0.784337", "0.7811099", "0.7811099", "0.7811099", "0.7807004", "0.78021395", "0.77864736", "0.77864736", "0.77858377...
0.0
-1
Abstract classes can override this to customize issubclass(). This is invoked early on by abc.ABCMeta.__subclasscheck__(). It should return True, False or NotImplemented. If it returns NotImplemented, the normal algorithm is used. Otherwise, it overrides the normal algorithm (and the outcome is cached).
def __subclasshook__(self, ???):
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __subclasshook__(cls, C):\n #print \"subclass check\",cls,C\n try:\n if implements(cls, C): return True\n except NotImplementedError:\n return False", "def __subclasshook__(cls, C):\n try:\n if cls is pyABC and implements(pyABC, C): return ...
[ "0.74107206", "0.70936215", "0.6980079", "0.67197293", "0.656461", "0.62811273", "0.6164475", "0.6131017", "0.60990435", "0.60990435", "0.60990435", "0.6090361", "0.60818005", "0.60562027", "0.60474396", "0.5947798", "0.5944017", "0.5925346", "0.5894447", "0.5850772", "0.5825...
0.0
-1
Truncating an Integral returns itself.
def __trunc__(self, ???):
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def trunc(x):\n return 0", "def integral_normed (self):\n return self / self.integral", "def trunc_inplace(a):", "def trunc(self, typ):", "def __trunc__(self, *args, **kwargs): # real signature unknown\n pass", "def __trunc__(self, *args, **kwargs): # real signature unknown\n ...
[ "0.60533917", "0.56643367", "0.5633817", "0.55444497", "0.5532241", "0.5532241", "0.5532241", "0.5532241", "0.5532241", "0.5532241", "0.5532241", "0.5532241", "0.5532241", "0.5532241", "0.5532241", "0.5532241", "0.5532241", "0.5532241", "0.5532241", "0.5532241", "0.5470706", ...
0.589768
1
int.bit_length() > int Number of bits necessary to represent self in binary. >>> bin(37) '0b100101' >>> (37).bit_length() 6
def bit_length(self, ???):
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def bit_length(self): # real signature unknown; restored from __doc__\n pass", "def bit_length(self): # real signature unknown; restored from __doc__\n pass", "def bit_length(self): # real signature unknown; restored from __doc__\n pass", "def bit_length(self): # real signature unknown; ...
[ "0.80463344", "0.80463344", "0.80463344", "0.80463344", "0.80463344", "0.80463344", "0.80463344", "0.80463344", "0.80463344", "0.80463344", "0.80463344", "0.80463344", "0.80463344", "0.80463344", "0.80463344", "0.80463344", "0.7434369", "0.7217988", "0.7121551", "0.7097779", ...
0.81482387
0
Returns self, the complex conjugate of any int.
def conjugate(self, ???):
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def conjugate(self):\n return Complex(self._reNum, -self._imNum)", "def conjugate(self):\r\n return self.__class__(self._real, -self._imag)", "def conjugate(self):\n return self.__class__(scalar=self.scalar, vector= -self.vector)", "def conjugate(self):\n v = zeros_como(self)\n ...
[ "0.79672635", "0.78156567", "0.7342562", "0.72166145", "0.7105363", "0.686047", "0.686047", "0.686047", "0.686047", "0.686047", "0.686047", "0.686047", "0.686047", "0.686047", "0.686047", "0.686047", "0.686047", "0.686047", "0.686047", "0.686047", "0.686047", "0.66762215", ...
0.7069329
5
int(x=0) > integer int(x, base=10) > integer Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.__int__(). For floating point numbers, this truncates towards zero. If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance rep...
def denominator(self, ???):
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def base_to_int(string, base):\n if string==\"0\" or base <= 0 : return 0 \n result = 0 \n return result", "def Integer(value, default=None):\n\n if value is None:\n return default\n\n value = value.lower()\n\n # Hexadecimal '0x'\n if value.startswith('0x'):\n return int(value[2:], 1...
[ "0.78026617", "0.6956229", "0.69384646", "0.67912215", "0.6643266", "0.66244024", "0.6619555", "0.6605963", "0.6597289", "0.65931", "0.65448356", "0.65406096", "0.65356237", "0.6504917", "0.6502554", "0.6432362", "0.6423736", "0.63847995", "0.638136", "0.6357803", "0.63481843...
0.0
-1
int.from_bytes(bytes, byteorder, , signed=False) > int Return the integer represented by the given array of bytes. The bytes argument must either support the buffer protocol or be an iterable object producing bytes. Bytes and bytearray are examples of builtin objects that support the buffer protocol. The byteorder argu...
def from_bytes(self, ???):
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def bytesToInt(bytes, byteorder='little', signed=False):\n return int.from_bytes(bytes, byteorder=byteorder, signed=signed)", "def from_bytes(cls, bytes, byteorder=\"little\"):\n return cls(int.from_bytes(bytes, byteorder=byteorder))", "def bytes_to_int(byte_array, big_endian=True, signed=False):\n ...
[ "0.84166753", "0.8237546", "0.7908837", "0.76870507", "0.7428757", "0.74193954", "0.71967757", "0.7091209", "0.68323374", "0.67699564", "0.66651136", "0.6651749", "0.66058", "0.65290093", "0.6521053", "0.64745915", "0.64081466", "0.6402217", "0.6344543", "0.6179793", "0.61430...
0.54824054
36
int(x=0) > integer int(x, base=10) > integer Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.__int__(). For floating point numbers, this truncates towards zero. If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance rep...
def imag(self, ???):
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def base_to_int(string, base):\n if string==\"0\" or base <= 0 : return 0 \n result = 0 \n return result", "def Integer(value, default=None):\n\n if value is None:\n return default\n\n value = value.lower()\n\n # Hexadecimal '0x'\n if value.startswith('0x'):\n return int(value[2:], 1...
[ "0.7802164", "0.6956023", "0.69382155", "0.6790228", "0.66421914", "0.6624112", "0.6618715", "0.6605566", "0.6597371", "0.6592895", "0.65434563", "0.6540573", "0.65349185", "0.6504422", "0.6500752", "0.6431937", "0.6422417", "0.63845843", "0.63821375", "0.6357345", "0.6347677...
0.0
-1
int(x=0) > integer int(x, base=10) > integer Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.__int__(). For floating point numbers, this truncates towards zero. If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance rep...
def numerator(self, ???):
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def base_to_int(string, base):\n if string==\"0\" or base <= 0 : return 0 \n result = 0 \n return result", "def Integer(value, default=None):\n\n if value is None:\n return default\n\n value = value.lower()\n\n # Hexadecimal '0x'\n if value.startswith('0x'):\n return int(value[2:], 1...
[ "0.78033733", "0.69566", "0.6939449", "0.6791938", "0.66438115", "0.6625425", "0.6620227", "0.66064185", "0.6598155", "0.65930635", "0.65448076", "0.65403754", "0.6535541", "0.65060955", "0.6501933", "0.64321417", "0.6424113", "0.63852865", "0.638193", "0.63574433", "0.634816...
0.0
-1
int(x=0) > integer int(x, base=10) > integer Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.__int__(). For floating point numbers, this truncates towards zero. If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance rep...
def real(self, ???):
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def base_to_int(string, base):\n if string==\"0\" or base <= 0 : return 0 \n result = 0 \n return result", "def Integer(value, default=None):\n\n if value is None:\n return default\n\n value = value.lower()\n\n # Hexadecimal '0x'\n if value.startswith('0x'):\n return int(value[2:], 1...
[ "0.78026617", "0.6956229", "0.69384646", "0.67912215", "0.6643266", "0.66244024", "0.6619555", "0.6605963", "0.6597289", "0.65931", "0.65448356", "0.65406096", "0.65356237", "0.6504917", "0.6502554", "0.6432362", "0.6423736", "0.63847995", "0.638136", "0.6357803", "0.63481843...
0.0
-1
int.to_bytes(length, byteorder, , signed=False) > bytes Return an array of bytes representing an integer. The integer is represented using length bytes. An OverflowError is raised if the integer is not representable with the given number of bytes. The byteorder argument determines the byte order used to represent the i...
def to_bytes(self, ???):
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _int_to_bytes(integer, endian = 'little'):\n size = 1\n while 1<<(8*size) <= integer:\n size += 1\n\n return integer.to_bytes(size, endian)", "def int_to_bytes(val, bit=32, signed=False, big_endian=True):\n val = int(val) #ensure it is an int\n\n if six.PY3:\n order = 'little'\n ...
[ "0.7669719", "0.7012032", "0.69892526", "0.6657893", "0.66389126", "0.6616937", "0.6610321", "0.6595048", "0.64739436", "0.63891596", "0.6340297", "0.6317191", "0.62365144", "0.62235373", "0.618983", "0.61338544", "0.6038323", "0.6002888", "0.59969467", "0.59432", "0.59253424...
0.5555519
28
Calculate the Surface Area of a Cube. >>> surface_area_cube(1) 6 >>> surface_area_cube(1.6) 15.360000000000003 >>> surface_area_cube(0) 0 >>> surface_area_cube(3) 54 >>> surface_area_cube(1)
def surface_area_cube(side_length: float) -> float: if side_length < 0: raise ValueError("surface_area_cube() only accepts non-negative values") return 6 * side_length**2
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def surface_area_of_cube(side):\n return side", "def compute_surface_area(self):\n return np.sum(self._find_triangle_areas())", "def calc_surface_area(faces, verts):\n # Calculate the surface area of a mesh from it's triangle faces.\n # faces: List of all the faces on the surface. Each face ind...
[ "0.72815645", "0.7010892", "0.7009734", "0.68451345", "0.6664104", "0.6644253", "0.65627605", "0.6529839", "0.64588445", "0.64086616", "0.63413715", "0.62906426", "0.6159937", "0.6155156", "0.60905915", "0.6041885", "0.6029499", "0.5991128", "0.5963586", "0.59513634", "0.5945...
0.7367549
0
Calculate the Surface Area of a Cuboid. >>> surface_area_cuboid(1, 2, 3) 22 >>> surface_area_cuboid(0, 0, 0) 0 >>> surface_area_cuboid(1.6, 2.6, 3.6) 38.56 >>> surface_area_cuboid(1, 2, 3)
def surface_area_cuboid(length: float, breadth: float, height: float) -> float: if length < 0 or breadth < 0 or height < 0: raise ValueError("surface_area_cuboid() only accepts non-negative values") return 2 * ((length * breadth) + (breadth * height) + (length * height))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def surface_area_cube(side_length: float) -> float:\r\n if side_length < 0:\r\n raise ValueError(\"surface_area_cube() only accepts non-negative values\")\r\n return 6 * side_length**2", "def surface_area_of_cube(side):\n return side", "def compute_surface_area(self):\n return np.sum(sel...
[ "0.6666402", "0.64514595", "0.64180577", "0.6362404", "0.6269711", "0.6249463", "0.62020266", "0.6193033", "0.617231", "0.6169103", "0.61569345", "0.60257256", "0.60193086", "0.5955302", "0.590112", "0.5897125", "0.5896731", "0.589559", "0.58863145", "0.58802015", "0.5876737"...
0.75224274
0
Calculate the Surface Area of a Sphere.
def surface_area_sphere(radius: float) -> float: if radius < 0: raise ValueError("surface_area_sphere() only accepts non-negative values") return 4 * pi * radius**2
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def surface_area_hemisphere(radius: float) -> float:\r\n if radius < 0:\r\n raise ValueError(\"surface_area_hemisphere() only accepts non-negative values\")\r\n return 3 * pi * radius**2", "def sphere_area(radius : number) -> number:\n area = 4*pi*radius*radius\n return area", "def sphereAre...
[ "0.75944006", "0.7547221", "0.74640936", "0.7159024", "0.71472585", "0.66771775", "0.6609041", "0.6607308", "0.6575029", "0.6481573", "0.64479804", "0.6444091", "0.64219826", "0.6398195", "0.6333034", "0.6320497", "0.6280175", "0.6243655", "0.6232985", "0.6222155", "0.6218048...
0.77417064
0
Calculate the Surface Area of a Hemisphere.
def surface_area_hemisphere(radius: float) -> float: if radius < 0: raise ValueError("surface_area_hemisphere() only accepts non-negative values") return 3 * pi * radius**2
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def compute_surface_area(self):\n return np.sum(self._find_triangle_areas())", "def surface_area(DEM, resolution):\n\n resolution_squared = resolution ** 2.\n cross_distance_squared = 2.0 * (resolution ** 2.)\n\n m1 = ((DEM[0:-1, 0:-1] - DEM[0:-1, 1:]) ** 2.0 + resolution_squared) ** 0.5\n m2 ...
[ "0.72399956", "0.7046556", "0.69472444", "0.68784386", "0.67994255", "0.67446357", "0.67176634", "0.6669289", "0.6648197", "0.6646721", "0.6634711", "0.6555099", "0.6460852", "0.63712317", "0.6334383", "0.63145924", "0.63024366", "0.629782", "0.6238995", "0.62154955", "0.6206...
0.73289835
0
Calculate the Surface Area of a Cone.
def surface_area_cone(radius: float, height: float) -> float: if radius < 0 or height < 0: raise ValueError("surface_area_cone() only accepts non-negative values") return pi * radius * (radius + (height**2 + radius**2) ** 0.5)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def compute_surface_area(self):\n return np.sum(self._find_triangle_areas())", "def surface_area(self) -> float:\n return 4 * np.pi * self.radius**2", "def surfaceArea(self):\n surfaceArea = self.sideLength**2 * 6\n return surfaceArea", "def getSurfaceArea(self) -> float:\n ...
[ "0.7281637", "0.70571977", "0.6995431", "0.69417614", "0.68043363", "0.6756402", "0.66293764", "0.66006935", "0.6541381", "0.6532924", "0.65126425", "0.6484024", "0.64582616", "0.6379687", "0.63465464", "0.63313115", "0.6306597", "0.63061565", "0.63036686", "0.6277776", "0.62...
0.6303602
19
Calculate the Surface Area of a Conical Frustum. >>> surface_area_conical_frustum(1, 2, 3) 45.511728065337266 >>> surface_area_conical_frustum(4, 5, 6) 300.7913575056268 >>> surface_area_conical_frustum(0, 0, 0) 0.0 >>> surface_area_conical_frustum(1.6, 2.6, 3.6) 78.57907060751548 >>> surface_area_conical_frustum(1, 2,...
def surface_area_conical_frustum( radius_1: float, radius_2: float, height: float ) -> float: if radius_1 < 0 or radius_2 < 0 or height < 0: raise ValueError( "surface_area_conical_frustum() only accepts non-negative values" ) slant_height = (height**2 + (radius_1 - radius...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def compute_surface_area(self):\n return np.sum(self._find_triangle_areas())", "def __CalculateArea(self, contour):\r\n return cv2.contourArea(contour)", "def surface_area(self) -> float:\n return 4 * np.pi * self.radius**2", "def getSurfaceArea(self) -> float:\n return self.area(...
[ "0.6291956", "0.58364004", "0.5753722", "0.57246095", "0.5682314", "0.5677191", "0.5626083", "0.5558596", "0.5558541", "0.55439174", "0.55187523", "0.5473769", "0.54420286", "0.537165", "0.5346501", "0.53398824", "0.53286076", "0.5327467", "0.5319384", "0.5314725", "0.5282321...
0.61237943
1
Calculate the Surface Area of a Cylinder.
def surface_area_cylinder(radius: float, height: float) -> float: if radius < 0 or height < 0: raise ValueError("surface_area_cylinder() only accepts non-negative values") return 2 * pi * radius * (height + radius)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def surface_area(self) -> float:\n return 4 * np.pi * self.radius**2", "def compute_surface_area(self):\n return np.sum(self._find_triangle_areas())", "def surfaceArea(self):\n surfaceArea = self.sideLength**2 * 6\n return surfaceArea", "def cylinder_area(radius: number, height: n...
[ "0.7548897", "0.749687", "0.74844456", "0.74813986", "0.7271498", "0.72686654", "0.71798384", "0.7160601", "0.7061284", "0.7021645", "0.7017651", "0.69561744", "0.6951494", "0.6949457", "0.6934319", "0.6928398", "0.6916603", "0.6916603", "0.69163173", "0.6913666", "0.6912519"...
0.72211707
6
Calculate the Area of a Torus.
def surface_area_torus(torus_radius: float, tube_radius: float) -> float: if torus_radius < 0 or tube_radius < 0: raise ValueError("surface_area_torus() only accepts non-negative values") if torus_radius < tube_radius: raise ValueError( "surface_area_torus() does not support spi...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def area(self) -> torch.Tensor:\n box = self.tensor\n area = (box[:, 2] - box[:, 0]) * (box[:, 3] - box[:, 1])\n return area", "def area(self) -> float:\n raise NotImplementedError", "def area(self):\n area = 0\n last = self._coordinates[-1]\n for c in self._coo...
[ "0.7800431", "0.7706884", "0.75886077", "0.7577049", "0.75663716", "0.7547722", "0.75137764", "0.75137764", "0.75086504", "0.7508373", "0.7478298", "0.7464217", "0.7462269", "0.7459668", "0.74048436", "0.7402549", "0.7401049", "0.7399664", "0.7391779", "0.73916525", "0.737006...
0.0
-1
Calculate the area of a rectangle. >>> area_rectangle(10, 20) 200 >>> area_rectangle(1.6, 2.6) 4.16 >>> area_rectangle(0, 0) 0 >>> area_rectangle(1, 2)
def area_rectangle(length: float, width: float) -> float: if length < 0 or width < 0: raise ValueError("area_rectangle() only accepts non-negative values") return length * width
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def rectangle_area(width : number, height : number) ->number:\n area = width*height\n #print(\"The area of rectangle is =\", area, \"sq. units\")\n return area", "def rectangle_area(base, height):\n return (base * height)", "def rectangle_area(coordinates):\n return (coordinates[2] - coordinates...
[ "0.7999198", "0.78071344", "0.7696935", "0.7585217", "0.7534478", "0.7475466", "0.7437463", "0.7410219", "0.74051803", "0.73629963", "0.7253645", "0.7221623", "0.7206669", "0.7179803", "0.7151558", "0.71345943", "0.70913184", "0.70744777", "0.7072634", "0.70539236", "0.703855...
0.78188956
1
Calculate the area of a square. >>> area_square(10) 100 >>> area_square(0) 0 >>> area_square(1.6) 2.5600000000000005 >>> area_square(1)
def area_square(side_length: float) -> float: if side_length < 0: raise ValueError("area_square() only accepts non-negative values") return side_length**2
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def area_square(l):\n x = l * l\n return x", "def rectangle_area(width : number, height : number) ->number:\n area = width*height\n #print(\"The area of rectangle is =\", area, \"sq. units\")\n return area", "def square_area(side):\n return side**2", "def area(x, y):\n return x*y/2", "...
[ "0.7286142", "0.72473055", "0.7205924", "0.7182893", "0.7121043", "0.7083093", "0.70261645", "0.70175433", "0.6921208", "0.6849839", "0.6845397", "0.68417615", "0.6837337", "0.67906415", "0.6776792", "0.6761042", "0.6683266", "0.6667608", "0.6652926", "0.6637591", "0.6605035"...
0.7561725
0
Calculate the area of a triangle given the base and height. >>> area_triangle(10, 10) 50.0 >>> area_triangle(1.6, 2.6) 2.08 >>> area_triangle(0, 0) 0.0 >>> area_triangle(1, 2)
def area_triangle(base: float, height: float) -> float: if base < 0 or height < 0: raise ValueError("area_triangle() only accepts non-negative values") return (base * height) / 2
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def triangle_area(base, height): # Compute the area of a triangle\n area = (1.0 / 2) * base * height\n return area", "def triangleArea(base, height):\n base = float(base)\n height = float(height)\n area = 0.5*base*height\n return area", "def triangle_area(base, height):\n return...
[ "0.8957526", "0.87159944", "0.86000496", "0.79980665", "0.7791066", "0.7697558", "0.75109094", "0.7322677", "0.72746557", "0.72196394", "0.72144634", "0.7144356", "0.713802", "0.71086264", "0.7080001", "0.7001037", "0.69351196", "0.69297236", "0.69238174", "0.67804193", "0.67...
0.89786404
0
Calculate area of triangle when the length of 3 sides are known.
def area_triangle_three_sides(side1: float, side2: float, side3: float) -> float: if side1 < 0 or side2 < 0 or side3 < 0: raise ValueError("area_triangle_three_sides() only accepts non-negative values") elif side1 + side2 < side3 or side1 + side3 < side2 or side2 + side3 < side1: raise Value...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def triangle_area(side1: number, side2: number, side3: number) -> number:\n s = (side1+side2+side3)/2\n area = sqrt(s*(s-side1)*(s-side2)*(s-side3))\n return sqrt(s*(s-side1)*(s-side2)*(s-side3))", "def area_of_a_triangle(length_1, length_2, length_3):\r\n half_perimeter = (length_1 + length_2 + leng...
[ "0.8733833", "0.86254233", "0.82618403", "0.80721945", "0.7990782", "0.79050994", "0.78296477", "0.77779496", "0.773841", "0.7719263", "0.7699428", "0.7680037", "0.761518", "0.75288564", "0.7486223", "0.74066657", "0.7402571", "0.7341327", "0.72961754", "0.72634614", "0.72093...
0.8315102
2
Calculate the area of a parallelogram. >>> area_parallelogram(10, 20) 200 >>> area_parallelogram(1.6, 2.6) 4.16 >>> area_parallelogram(0, 0) 0 >>> area_parallelogram(1, 2)
def area_parallelogram(base: float, height: float) -> float: if base < 0 or height < 0: raise ValueError("area_parallelogram() only accepts non-negative values") return base * height
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def parallelogram_area(base, height):\n area = base*height\n\n return area", "def area(self):\n if isinstance(self.crs, GeographicalCRS):\n major_axis = self.crs.ellipsoid.a\n minor_axis = self.crs.ellipsoid.b\n\n area = 0.0\n if major_axis == minor_axis: ...
[ "0.7611743", "0.6797339", "0.66222835", "0.66028", "0.6557646", "0.6508004", "0.64778906", "0.6472124", "0.6465857", "0.643528", "0.636906", "0.6340976", "0.63334084", "0.6315533", "0.6281842", "0.6274356", "0.6265391", "0.6235155", "0.62327737", "0.62298787", "0.622897", "...
0.78010267
0
Calculate the area of a trapezium. >>> area_trapezium(10, 20, 30) 450.0 >>> area_trapezium(1.6, 2.6, 3.6) 7.5600000000000005 >>> area_trapezium(0, 0, 0) 0.0 >>> area_trapezium(1, 2, 3)
def area_trapezium(base1: float, base2: float, height: float) -> float: if base1 < 0 or base2 < 0 or height < 0: raise ValueError("area_trapezium() only accepts non-negative values") return 1 / 2 * (base1 + base2) * height
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def area(\n self):\n pi = numpy.pi\n area0 = 4.0 * pi / 8.0\n areadiv = 4.0 ** self.depth\n area = area0 / areadiv * (180.0 / pi) ** 2\n return area", "def area(self):\n area = 0\n last = self._coordinates[-1]\n for c in self._coordinates:\n ...
[ "0.7075589", "0.69927144", "0.68723094", "0.68423927", "0.665788", "0.66296256", "0.66071355", "0.66068983", "0.6604369", "0.6569748", "0.65451974", "0.6520553", "0.6515177", "0.6458525", "0.64484155", "0.64440304", "0.6438789", "0.64283115", "0.6411994", "0.6391777", "0.6385...
0.69154805
2
Calculate the area of a circle. >>> area_circle(20) 1256.6370614359173 >>> area_circle(1.6) 8.042477193189871 >>> area_circle(0) 0.0 >>> area_circle(1)
def area_circle(radius: float) -> float: if radius < 0: raise ValueError("area_circle() only accepts non-negative values") return pi * radius**2
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def circle_area(circle):\n return pi * circle.radius * circle.radius", "def area_circle(radius):\n \n pi = 3.1459\n area = pi * radius * radius\n return area", "def area_of_circle(radius):\n return radius", "def circle_area(radius):\n area = radius ** 2 * math.pi\n return area", "de...
[ "0.83158463", "0.8264669", "0.81383127", "0.8121065", "0.80928624", "0.78186816", "0.7796512", "0.77759117", "0.7757206", "0.77440155", "0.77440155", "0.7711292", "0.77092093", "0.7647722", "0.76285994", "0.74856555", "0.74818265", "0.7461355", "0.745007", "0.74174315", "0.74...
0.8081751
5
Calculate the area of a ellipse. >>> area_ellipse(10, 10) 314.1592653589793 >>> area_ellipse(10, 20) 628.3185307179587 >>> area_ellipse(0, 0) 0.0 >>> area_ellipse(1.6, 2.6) 13.06902543893354 >>> area_ellipse(10, 20)
def area_ellipse(radius_x: float, radius_y: float) -> float: if radius_x < 0 or radius_y < 0: raise ValueError("area_ellipse() only accepts non-negative values") return pi * radius_x * radius_y
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def ellipse_area(semi_major_axis: number, semi_minor_axis : number) -> number:\n area = pi*semi_major_axis*semi_minor_axis\n return area", "def ellipse_area(preds, target):\n # unpack target = (target, mask)\n target, mask = target\n if preds.size(2) != 4:\n raise ValueError('Prediction mus...
[ "0.7569128", "0.7252887", "0.70606506", "0.67599463", "0.66614044", "0.6620491", "0.65754545", "0.65114665", "0.6509608", "0.64492077", "0.63622475", "0.6348709", "0.6340304", "0.63310313", "0.63249993", "0.63071716", "0.62976605", "0.6270165", "0.6263262", "0.6239973", "0.62...
0.811346
0
Calculate the area of a rhombus. >>> area_rhombus(10, 20) 100.0 >>> area_rhombus(1.6, 2.6) 2.08 >>> area_rhombus(0, 0) 0.0 >>> area_rhombus(1, 2)
def area_rhombus(diagonal_1: float, diagonal_2: float) -> float: if diagonal_1 < 0 or diagonal_2 < 0: raise ValueError("area_rhombus() only accepts non-negative values") return 1 / 2 * diagonal_1 * diagonal_2
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def rhombus_area(diagonal_1, diagonal_2):\n return (diagonal_1 * diagonal_2) / 2", "def test_rhombus_area(self):\n self.assertEqual(17.5, rhombus_area(\n self.values['diagonal_1'], self.values['diagonal_2']))", "def cylinder_area(radius: number, height: number) -> number:\n area...
[ "0.75263935", "0.7184548", "0.6937286", "0.6691163", "0.66702396", "0.6650702", "0.6582693", "0.6513818", "0.64598763", "0.64313805", "0.63858813", "0.635034", "0.630958", "0.63000727", "0.6297246", "0.62846583", "0.6269995", "0.6269995", "0.62570214", "0.62527114", "0.625173...
0.7288092
1
Calculate the area of a regular polygon.
def area_reg_polygon(sides: int, length: float) -> float: if not isinstance(sides, int) or sides < 3: raise ValueError( "area_reg_polygon() only accepts integers greater than or \ equal to three as number of sides" ) elif length < 0: raise ValueError( "are...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def area_polygon(polygon):\n o = centroid_points(polygon)\n u = subtract_vectors(polygon[-1], o)\n v = subtract_vectors(polygon[0], o)\n a = 0.5 * length_vector(cross_vectors(u, v))\n for i in range(0, len(polygon) - 1):\n u = v\n v = subtract_vectors(polygon[i + 1], o)\n a += 0...
[ "0.8058221", "0.8032072", "0.80290425", "0.775125", "0.7730882", "0.7655108", "0.7603578", "0.75836736", "0.7458248", "0.7318181", "0.7303265", "0.7278403", "0.7259592", "0.7246163", "0.72038543", "0.7143232", "0.70988834", "0.7087016", "0.70269674", "0.69372404", "0.69024974...
0.7105422
16
Compute the data set mean and standard deviation Var[x] = E[X ^ 2] E ^ 2[X]
def get_data_set_mean_and_std(self): cnt = 0 fst_moment = torch.empty(3) snd_moment = torch.empty(3) for idx in range(self.__len__()): outputs = self.__getitem__(idx) # Outputs = img, label (BIPED Dataset) # Outputs = img_with_end_dots, classificatio...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def MeanAndStandardDeviation(data):\n n = len(data)\n if n == 0:\n return 0.0, 0.0\n mean = float(sum(data)) / n\n variance = sum([(element - mean)**2 for element in data]) / n\n return mean, math.sqrt(variance)", "def mean_var_sd(x):\n n = x.size\n assert 2 <= n\n mean = x.sum() / n\n diff =...
[ "0.72564113", "0.72244066", "0.7108367", "0.6900743", "0.6900743", "0.68933755", "0.68714166", "0.68642", "0.6841356", "0.6830851", "0.681355", "0.6797982", "0.6796319", "0.6790799", "0.6781518", "0.6737841", "0.67248905", "0.66744524", "0.6669555", "0.66572547", "0.6647937",...
0.6337241
52
Test local handler with a mix of functions and coroutines (async)
def test_local_handler(): event_to_be_dispatched = ("cat_ate_a_fish", "cat_requested_something", "dog_asked_for_petting", "dog_finished_the_food", "dad_made_beet_juice", ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async def test_async_handler(dm):\n assert not dm.called_async_handler\n request = create_request(\"domain\", \"async\")\n response = create_responder(request)\n result = await dm.apply_handler(request, response)\n assert dm.called_async_handler\n assert result.dialogue_state == \"async_handler\"...
[ "0.742528", "0.70102835", "0.6852801", "0.6700135", "0.6606067", "0.658667", "0.6572542", "0.6571325", "0.6418353", "0.6345083", "0.63149226", "0.62510437", "0.62453645", "0.6216347", "0.6203942", "0.6136636", "0.6107038", "0.6085152", "0.60807407", "0.6075543", "0.6044128", ...
0.6290873
11
Get step fixture name.
def get_step_fixture_name(name, type_, encoding=None): return "pytestbdd_{type}_{name}".format( type=type_, name=force_encode(name, **(dict(encoding=encoding) if encoding else {})) )
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def step_name(self):\n return self._step_name", "def step_name(self) -> Optional[pulumi.Input[str]]:\n return pulumi.get(self, \"step_name\")", "def getName(self):\n return self.stepDictionary[self.getLocation()]", "def step_name(self, index):\n step_label = self.get_step_label_at...
[ "0.7763003", "0.748142", "0.73309714", "0.72060895", "0.6888064", "0.68299204", "0.6611632", "0.65668637", "0.6497758", "0.6459365", "0.64183545", "0.63749194", "0.63527083", "0.6326266", "0.6295378", "0.62894195", "0.62200695", "0.6190335", "0.60310096", "0.6026371", "0.6012...
0.76748794
1
Function that prevents the decoration.
def _not_a_fixture_decorator(func): raise StepError("Cannot be used as a decorator when the fixture is specified")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def no_underline(): # noqa: D416", "def suppress(self):\n pass", "def __disable__(self) -> None:\n pass", "def suppress(self):\n return self", "def stop_underline(self):\n pass", "def disable(self) -> None:", "def suppress(self):\n return Suppress(self)", "def auto...
[ "0.6497889", "0.649199", "0.645313", "0.63632846", "0.63000464", "0.62832475", "0.6240107", "0.61211514", "0.6116726", "0.611516", "0.6087752", "0.6026986", "0.6005766", "0.59637463", "0.5945873", "0.5916251", "0.5910321", "0.58727354", "0.58434063", "0.5830356", "0.5815437",...
0.0
-1
Step decorator for the type and the name.
def _step_decorator(step_type, step_name, converters=None, scope="function", target_fixture=None): def decorator(func): step_func = func parser_instance = get_parser(step_name) parsed_step_name = parser_instance.name if step_type == GIVEN: if not hasattr(func, "_pytestf...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def step(step_name, extra_types=None):\n\n def decorator(func):\n # Register the step, other way return the function unchanged\n step_function = StepFunction(func, step_name, extra_types)\n # Check for similar steps, in both directions\n step_function.search_and_report_similar()\n ...
[ "0.78558373", "0.6774913", "0.6774913", "0.6761041", "0.6756011", "0.6623449", "0.6594203", "0.6491945", "0.6300954", "0.6300954", "0.6245583", "0.6217207", "0.6098405", "0.60954994", "0.6029569", "0.601242", "0.6006383", "0.5976284", "0.59603477", "0.59603477", "0.5949149", ...
0.7030183
1
Return the module of the caller.
def get_caller_module(depth=2): frame = sys._getframe(depth) module = inspect.getmodule(frame) if module is None: return get_caller_module(depth=depth) return module
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_module(self):\n return self.module", "def module(self):\n return self.lib.module", "def module(self):\n return self._module", "def module(self):\n return self._module", "def module(self):\n return self._module", "def module(self):\n return self._module", ...
[ "0.8061645", "0.7585297", "0.75477153", "0.75477153", "0.75477153", "0.75477153", "0.75477153", "0.75134873", "0.72565323", "0.7210985", "0.712284", "0.7058211", "0.69959307", "0.6984209", "0.695014", "0.6890235", "0.6839327", "0.67928845", "0.6765729", "0.6759371", "0.673699...
0.78693414
1
Inject fixture into pytest fixture request.
def inject_fixture(request, arg, value): fd_kwargs = { "fixturemanager": request._fixturemanager, "baseid": None, "argname": arg, "func": lambda: value, "scope": "function", "params": None, } if "yieldctx" in get_args(pytest_fixtures.FixtureDef.__init__): ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def fixture_example_data():\n import_example_data()", "def setup_fixtures(func):\n func = pytest.mark.usefixtures('smtp', 'mock_access_request', 'dummy_access_request')(func)\n func = pytest.mark.parametrize('mock_access_request',\n [{\n ...
[ "0.6621165", "0.6542824", "0.6542824", "0.6503567", "0.6448711", "0.6152027", "0.61376375", "0.6117961", "0.59044176", "0.5899505", "0.56671584", "0.56661564", "0.5649839", "0.5639458", "0.55946094", "0.55808634", "0.5549694", "0.5549694", "0.5549694", "0.55391383", "0.551508...
0.71561885
0
Generate a random string of letters and digits
def randomStringDigits(stringLength=1000): lettersAndDigits = string.ascii_letters + string.digits return ''.join(random.choice(lettersAndDigits)+'\r\n' for i in range(stringLength))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def rand_string():\n out = ''\n for _ in range(24):\n out += choice(ascii_letters)\n return out", "def get_random_alphanumeric_string():\n return get_random_string(char_choice=string.ascii_letters + string.digits)", "def gen_rand_str(n):\n return \"\".join(random.choice(string.ascii_l...
[ "0.86016387", "0.84852463", "0.8366202", "0.83620757", "0.83602", "0.8158604", "0.8123532", "0.81143093", "0.8089975", "0.80873764", "0.8011259", "0.7957295", "0.79525083", "0.794848", "0.7927194", "0.79182523", "0.7897885", "0.788374", "0.787901", "0.7854035", "0.78254104", ...
0.7398179
82
Test that having axes in any order or quantity does not confuse glyphsLib, even when the weight or width are not in the default positions.
def test_weight_width_custom(axes, ufo_module): doc = _make_designspace_with_axes(axes, ufo_module) font = to_glyphs(doc) if _is_subset_of_default_axes([GSAxis(name=n, tag=t) for t, n in axes]): assert font.customParameters["Axes"] is None else: assert font.customParameters["Axes"] == ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_axis_with_no_mapping_does_not_error_in_roundtrip_with_2_axes(ufo_module):\n doc = _make_designspace_with_axes(\n [(\"wght\", \"Weight with mapping\"), (\"wdth\", \"Width without mapping\")], ufo_module\n )\n # Add mapping to weight axis\n doc.axes[0].map = [(0, 0), (50, 350), (100, 1000...
[ "0.6985757", "0.6233533", "0.6203525", "0.6161034", "0.5991015", "0.5960742", "0.5880376", "0.5853626", "0.582937", "0.5827674", "0.5728147", "0.5699523", "0.5676249", "0.5665066", "0.5654618", "0.56122905", "0.5566728", "0.55429345", "0.55375475", "0.5530844", "0.5522221", ...
0.707271
0
Test the new axis definition with custom parameters.
def test_masters_have_user_locations(ufo_module): # Get a font with two masters font = to_glyphs([ufo_module.Font(), ufo_module.Font()]) font.customParameters["Axes"] = [{"Tag": "opsz", "Name": "Optical"}] # There is only one axis, so the design location is stored in the weight font.masters[0].weigh...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def testExtraParamsCanUseNewNames(self):\n self.chart.display.extra_params['fancy_new_feature'] = 'shiny'\n self.assertEqual(self.Param('fancy_new_feature'), 'shiny')", "def ExpectAxes(self, labels, positions):\n self.assertEqual(self.Param('chxl'), labels)\n self.assertEqual(self.Param('chxp'), pos...
[ "0.68126446", "0.64608765", "0.6147215", "0.5947942", "0.5851026", "0.5823717", "0.57906926", "0.57794136", "0.5750839", "0.57386744", "0.5737426", "0.5676807", "0.5671662", "0.5628554", "0.5563953", "0.5559157", "0.5543377", "0.54436386", "0.5425784", "0.5413956", "0.5384477...
0.0
-1
Test that stringified Axis Locations are converted. Some versions of Glyph store a string instead of an int.
def test_masters_have_user_locations_string(ufo_module): font = to_glyphs([ufo_module.Font(), ufo_module.Font()]) font.customParameters["Axes"] = [{"Tag": "opsz", "Name": "Optical"}] font.masters[0].weightValue = 0 font.masters[0].customParameters["Axis Location"] = [ {"Axis": "Optical", "Locati...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_location_to_coord():\n result_a = wwiki.location_to_coord(location)\n result_b = wwiki.location_to_coord(location)\n\n assert isinstance(result_a, str)\n assert result_b == \"48.76569917989272|2.392394129892722\"", "def test_cast_string_int(self) -> None:\n self.assertEqual(self.flag....
[ "0.5937174", "0.58209306", "0.5727913", "0.55906606", "0.55679995", "0.55611575", "0.5556359", "0.5554085", "0.5524862", "0.55069405", "0.5495572", "0.5495032", "0.54911065", "0.5488713", "0.54834104", "0.54779273", "0.543769", "0.5424045", "0.54194134", "0.54149395", "0.5393...
0.5778424
2
Tests get_regular_master when 'Variable Font Origin' custom parameter name is used with master set to 'Regular Text'. This is the current default custom parameter name in the Glyphs editor / glyphs source file specification.
def test_custom_parameter_vfo_current(): source_path = os.path.join("tests", "data", "CustomParameterVFO.glyphs") font = GSFont(source_path) assert font.customParameters["Variation Font Origin"] is None test_id = font.customParameters["Variable Font Origin"] assert test_id == "ACC63F3E-1323-486A-94A...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def find_regular_master(masters, regularName=None):\n assert len(masters) > 0\n if regularName is not None:\n for font in masters:\n if font.info.styleName == regularName:\n return font\n base_style = find_base_style(masters)\n if not base_style:\n base_style = '...
[ "0.69350207", "0.6909895", "0.6648281", "0.5223326", "0.5092955", "0.4946685", "0.46939337", "0.468453", "0.46685544", "0.46685544", "0.4646657", "0.4641774", "0.46350524", "0.4610456", "0.45767817", "0.45586544", "0.45528513", "0.45253748", "0.45107546", "0.45049223", "0.447...
0.75802004
0
Tests get_regular_master when 'Variation Font Origin' custom parameter name is used with master set to 'Regular Text'. This custom parameter name is not used in current releases of the Glyphs editor / glyphs source file specification.
def test_custom_parameter_vfo_old_name(): source_path = os.path.join("tests", "data", "CustomParameterVFO.glyphs") font = GSFont(source_path) # mock up source for this test with a source file from another test del font.customParameters["Variable Font Origin"] font.customParameters["Variation Font O...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_custom_parameter_vfo_current():\n source_path = os.path.join(\"tests\", \"data\", \"CustomParameterVFO.glyphs\")\n font = GSFont(source_path)\n assert font.customParameters[\"Variation Font Origin\"] is None\n test_id = font.customParameters[\"Variable Font Origin\"]\n assert test_id == \"A...
[ "0.7359684", "0.67687136", "0.6363678", "0.51723284", "0.50032544", "0.48569408", "0.48275173", "0.47787303", "0.4668857", "0.4668857", "0.4658506", "0.4607545", "0.46026233", "0.45687926", "0.45522752", "0.45285955", "0.4505046", "0.44999492", "0.4479202", "0.44763657", "0.4...
0.69167006
1
Tests default behavior of get_regular_master when Variable Font Origin custom parameter is not set
def test_custom_parameter_vfo_not_set(): source_path = os.path.join("tests", "data", "CustomParameterVFO.glyphs") font = GSFont(source_path) # mock up source for this test with a source file from another test del font.customParameters["Variable Font Origin"] del font.customParameters["Variation Fon...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_custom_parameter_vfo_current():\n source_path = os.path.join(\"tests\", \"data\", \"CustomParameterVFO.glyphs\")\n font = GSFont(source_path)\n assert font.customParameters[\"Variation Font Origin\"] is None\n test_id = font.customParameters[\"Variable Font Origin\"]\n assert test_id == \"A...
[ "0.7166236", "0.6598435", "0.5755964", "0.5750696", "0.5671779", "0.5567997", "0.5551804", "0.55225056", "0.5480328", "0.5470055", "0.54538196", "0.5451957", "0.54279965", "0.5403499", "0.5384876", "0.53552175", "0.53363043", "0.53114074", "0.5287261", "0.5260522", "0.5260522...
0.6503109
2
Tests that a custom axis without a mapping and without sources on its extremes does not generate an error during roundtrip. Also tests that during a to_glyphs, to_designspace roundtrip the min and max axis information is not lost.
def test_axis_with_no_mapping_does_not_error_in_roundtrip(ufo_module): doc = designspaceLib.DesignSpaceDocument() # Add a "Regular" source regular = doc.newSourceDescriptor() regular.font = ufo_module.Font() regular.location = {"Style": 0} doc.addSource(regular) axis = doc.newAxisDescripto...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_axis_with_no_mapping_does_not_error_in_roundtrip_with_2_axes(ufo_module):\n doc = _make_designspace_with_axes(\n [(\"wght\", \"Weight with mapping\"), (\"wdth\", \"Width without mapping\")], ufo_module\n )\n # Add mapping to weight axis\n doc.axes[0].map = [(0, 0), (50, 350), (100, 1000...
[ "0.6741086", "0.63700724", "0.60149807", "0.59821606", "0.5976643", "0.59512246", "0.59347403", "0.58607495", "0.58135533", "0.5804691", "0.57687473", "0.5730494", "0.56702256", "0.56487083", "0.5643897", "0.5605512", "0.56046045", "0.55329436", "0.55052537", "0.54996556", "0...
0.7079482
0
Tests that a designspace with 2 axis, one with a mapping and one without a mapping, roundtrips correctly without error. The axis without a mapping should generate an identity mapping on the fly so that the Glyphs.app customParameter field does not lose min/max infromation about the axis.
def test_axis_with_no_mapping_does_not_error_in_roundtrip_with_2_axes(ufo_module): doc = _make_designspace_with_axes( [("wght", "Weight with mapping"), ("wdth", "Width without mapping")], ufo_module ) # Add mapping to weight axis doc.axes[0].map = [(0, 0), (50, 350), (100, 1000)] doc2 = dee...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_axis_with_no_mapping_does_not_error_in_roundtrip(ufo_module):\n doc = designspaceLib.DesignSpaceDocument()\n\n # Add a \"Regular\" source\n regular = doc.newSourceDescriptor()\n regular.font = ufo_module.Font()\n regular.location = {\"Style\": 0}\n doc.addSource(regular)\n\n axis = do...
[ "0.6810397", "0.5886508", "0.5643056", "0.5603255", "0.54835993", "0.54721045", "0.5446302", "0.5376088", "0.5350451", "0.5329995", "0.5325369", "0.5283556", "0.52822846", "0.52486473", "0.5247364", "0.5243737", "0.52394617", "0.52358276", "0.52293557", "0.5220297", "0.521388...
0.7278305
0
Glyphs 3 introduced a socalled "variable" instance which is a pseudoinstance that holds various VF settings. This messed with the instance_mapping creation as it would overwrite the designLoc of a default instance of an axis back to 0.
def test_variable_instance(ufo_module): source_path = os.path.join("tests", "data", "VariableInstance.glyphs") font = GSFont(source_path) assert len(font.instances) == 28 # Including the VF setting doc = to_designspace(font) assert doc.axes[0].map[2] == (400, 80) assert doc.axes[0].default == ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _add_fvar(font, axes, instances: List[InstanceDescriptor]):\n\n assert axes\n assert isinstance(axes, OrderedDict)\n\n log.info(\"Generating fvar\")\n\n fvar = newTable(\"fvar\")\n nameTable = font[\"name\"]\n\n for a in axes.values():\n axis = Axis()\n axis.axisTag = Tag(a.tag)...
[ "0.6553433", "0.5917079", "0.5742166", "0.56198436", "0.54889625", "0.5462958", "0.54621774", "0.5449796", "0.5375079", "0.5375077", "0.530325", "0.5295575", "0.52705187", "0.5258103", "0.5204888", "0.51782185", "0.5152422", "0.5150765", "0.51438206", "0.51391065", "0.5139057...
0.80153453
0
Show portfolio of stocks
def index(): rows = db.execute("SELECT cash FROM users WHERE id = :id", id=session["user_id"]) print("rows= " , rows) cash = rows[0] ["cash"] stocks = db.execute("SELECT * FROM transactions WHERE user_id = :user_id", user_id=session["user_id"]) print("Stocks= ", stocks) holdings = 0 for ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def index():\n stocks = []\n username = session.get(\"username\")\n symbol_list = db.execute(\"SELECT stock_symbol FROM history WHERE username=:username GROUP BY stock_symbol\", username=username)\n cash_balance = db.execute(\"SELECT cash FROM users WHERE username=:username\", username=username)[0][\"c...
[ "0.7349525", "0.7257509", "0.7092902", "0.70840114", "0.70700926", "0.70322937", "0.70166755", "0.6955458", "0.69515324", "0.6818638", "0.67683095", "0.67541313", "0.6739686", "0.66745", "0.66665316", "0.6584005", "0.65794265", "0.6577333", "0.6556571", "0.65012944", "0.64815...
0.55395675
89
Buy shares of stock
def buy(): # User reached route via POST (as by submitting a form via POST) if request.method == "POST": # Ensure the user inputs a symbol symbol = request.form.get("symbol").upper() if not symbol: return apology("must provide a symbol", 403) # ensure number of share...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async def buy(self, ctx, name, shares: int):\n\t\tplural = 's' if shares != 1 else ''\n\t\tcurrency = await bank.get_currency_name(ctx.guild)\n\t\tif shares < 1:\n\t\t\tawait ctx.send('You cannot buy less than one share.')\n\t\t\treturn\n\t\tname = name.upper()\n\t\ttry:\n\t\t\tstock_data = await self._get_stock_d...
[ "0.75090504", "0.73669976", "0.719782", "0.7076133", "0.702035", "0.70142156", "0.69631433", "0.6943623", "0.6915625", "0.691014", "0.6897359", "0.68731195", "0.6865242", "0.68647367", "0.6850216", "0.6848369", "0.6818854", "0.67891747", "0.6722476", "0.6719868", "0.67188966"...
0.62716454
88
Show history of transactions
def history(): return apology("TODO")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def history():\n transactions = db.execute(\"SELECT Symbol, Shares, Transacted FROM cash WHERE id=:id\", id=session[\"user_id\"])\n return render_template(\"history.html\", transactions=transactions)", "def history():\n\n #Query transactions by user id\n trans = Transactions.query.filter_by(owner=ses...
[ "0.82002884", "0.8140903", "0.8114919", "0.8042388", "0.8033679", "0.80168986", "0.79338187", "0.7822898", "0.77456313", "0.77341163", "0.7718728", "0.7716838", "0.7708978", "0.7628142", "0.7624304", "0.7530955", "0.74965966", "0.7481556", "0.74478734", "0.7423578", "0.738227...
0.6371526
80
Sell shares of stock
def sell(): return apology("TODO") if request.method == "POST": # Ensure symbol was submitted symbol = request.form.get("symbol") if not symbol: return apology("must provide symbol", 403) symbol = symbol.upper() # Ensure number of shares was submitted ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def sell_stock(self, symbol):\n amount_to_sell = self.get_equity(symbol)\n chirp.order_sell_fractional_by_price(symbol, amount_to_sell)\n self.L.add_line('', symbol, 'SOLD', amount_to_sell)", "async def sell(self, ctx, name, shares: int):\n\t\tplural = 's' if shares != 1 else ''\n\t\tif shar...
[ "0.76451164", "0.748746", "0.7260813", "0.71164954", "0.7057435", "0.70490545", "0.70268077", "0.69872165", "0.6972749", "0.6966809", "0.6915586", "0.68977857", "0.68829334", "0.6849716", "0.68191767", "0.68124473", "0.68022114", "0.6801836", "0.67799073", "0.67698354", "0.67...
0.67146623
26
An NLTK function Gets frequency distribution of all words in a tokenized list We also sort these frequencies in descending order
def get_frequency(processed_text_list): word_frequency = FreqDist(word for word in processed_text_list) sorted_counts = sorted(word_frequency.items() , key = lambda x: x[1] , reverse = True) return sorted_counts
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def computeWordsFrequencies(self):\n token_stream = self._tokenize(self.readable)\n token_map = self._countTokens(token_stream)\n # print token_map.items()\n return sorted(token_map.items(), key = lambda x : x[1], reverse = True)", "def word_frequencies(corpus):\n return frequencie...
[ "0.76779157", "0.73156095", "0.7145833", "0.70837116", "0.7030191", "0.7008413", "0.6866585", "0.6865012", "0.68593633", "0.68579507", "0.6846506", "0.6841639", "0.68362874", "0.6827901", "0.6799203", "0.6798519", "0.6783668", "0.67678326", "0.6741677", "0.67347926", "0.67283...
0.7932055
0
Constructor. Any message fields that are implicitly/explicitly set to None will be assigned a default value. The recommend use is keyword arguments as this is more robust to future message changes. You cannot mix inorder arguments and keyword arguments.
def __init__(self, *args, **kwds): if args or kwds: super(SemMap, self).__init__(*args, **kwds) #message fields cannot be None, assign default values for those that are if self.header is None: self.header = std_msgs.msg.Header() if self.namespace is None: self.namespace = '' ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self, *args, **kwds):\n if args or kwds:\n super(KomodoSpeechRecCommand, self).__init__(*args, **kwds)\n #message fields cannot be None, assign default values for those that are\n if self.header is None:\n self.header = std_msgs.msg.Header()\n if self.cmd is None:\n ...
[ "0.7794351", "0.7719884", "0.7719884", "0.7686347", "0.76253426", "0.7562994", "0.74395365", "0.7416649", "0.73515975", "0.730761", "0.7279932", "0.72373426", "0.72264934", "0.7223775", "0.7223775", "0.72189564", "0.72111243", "0.72111243", "0.72111243", "0.72111243", "0.7211...
0.0
-1
serialize message into buffer
def serialize(self, buff): try: _x = self buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs)) _x = self.header.frame_id length = len(_x) if python3 or type(_x) == unicode: _x = _x.encode('utf-8') length = len(_x) if python3: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def serialize(self, buff):\n try:\n _x = self\n buff.write(_struct_2d2q14dq.pack(_x.tcp, _x.ori, _x.zone, _x.vacuum, _x.workx, _x.worky, _x.workz, _x.workq0, _x.workqx, _x.workqy, _x.workqz, _x.toolx, _x.tooly, _x.toolz, _x.toolq0, _x.toolqx, _x.toolqy, _x.toolqz, _x.ret))\n _x = self.msg\n ...
[ "0.6972838", "0.6802016", "0.6796291", "0.67317253", "0.66948694", "0.66847515", "0.6658851", "0.6626311", "0.66227144", "0.6618303", "0.6607444", "0.65361035", "0.6529462", "0.65220654", "0.64863104", "0.6467052", "0.64530367", "0.6438432", "0.6427743", "0.6426063", "0.63947...
0.59585917
98
unpack serialized message in str into this message instance
def deserialize(self, str): try: if self.header is None: self.header = std_msgs.msg.Header() if self.prefixes is None: self.prefixes = None if self.address is None: self.address = knowrob_semantic_map_msgs.msg.SemMapAddress() if self.objects is None: self.obje...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def deserialize(self, str):\n try:\n end = 0\n _x = self\n start = end\n end += 152\n (_x.tcp, _x.ori, _x.zone, _x.vacuum, _x.workx, _x.worky, _x.workz, _x.workq0, _x.workqx, _x.workqy, _x.workqz, _x.toolx, _x.tooly, _x.toolz, _x.toolq0, _x.toolqx, _x.toolqy, _x.toolqz, _x.ret,) = _stru...
[ "0.7633603", "0.74642533", "0.732128", "0.73038477", "0.72709143", "0.7223599", "0.72191226", "0.7175671", "0.709591", "0.7095633", "0.70419884", "0.70281994", "0.6962232", "0.6956503", "0.6955446", "0.69451785", "0.6942254", "0.6942078", "0.6912403", "0.6894626", "0.68897164...
0.71700495
8
serialize message with numpy array types into buffer
def serialize_numpy(self, buff, numpy): try: _x = self buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs)) _x = self.header.frame_id length = len(_x) if python3 or type(_x) == unicode: _x = _x.encode('utf-8') length = len(_x) if...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def serialize_numpy(self, buff, numpy):\n try:\n pass\n except struct.error as se: self._check_types(se)\n except TypeError as te: self._check_types(te)", "def serialize_numpy(self, buff, numpy):\n try:\n _x = self\n buff.write(_struct_2d2q14dq.pack(_x.tcp, _x.ori, _x.zone, _x.vacuum, ...
[ "0.7994329", "0.7972612", "0.7893365", "0.785495", "0.7740611", "0.7677824", "0.7657543", "0.7626826", "0.75874037", "0.7565361", "0.75626636", "0.75620574", "0.7558187", "0.75431186", "0.7534563", "0.7527763", "0.75262064", "0.75172293", "0.75110817", "0.749996", "0.7497972"...
0.6950105
87
unpack serialized message in str into this message instance using numpy for array types
def deserialize_numpy(self, str, numpy): try: if self.header is None: self.header = std_msgs.msg.Header() if self.prefixes is None: self.prefixes = None if self.address is None: self.address = knowrob_semantic_map_msgs.msg.SemMapAddress() if self.objects is None: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def deserialize_numpy(self, str, numpy):\n try:\n end = 0\n _x = self\n start = end\n end += 152\n (_x.tcp, _x.ori, _x.zone, _x.vacuum, _x.workx, _x.worky, _x.workz, _x.workq0, _x.workqx, _x.workqy, _x.workqz, _x.toolx, _x.tooly, _x.toolz, _x.toolq0, _x.toolqx, _x.toolqy, _x.toolqz, _x....
[ "0.80890095", "0.797653", "0.79170173", "0.7906179", "0.78933936", "0.7831413", "0.78118503", "0.7809794", "0.7784528", "0.77587944", "0.77402115", "0.77145755", "0.7714233", "0.7696594", "0.7692612", "0.7685888", "0.7672912", "0.76391083", "0.76368344", "0.7628863", "0.76240...
0.7602004
22
Return the actions available to the agent at the state. The action representation is upto the task specification. Returns a list
def actions(self, agent_state): raise NotImplementedError("Don't know what actions are available")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_list_of_actions(self):\n return self.actions", "def get_actions(self):\n return self.agent.get_actions()", "def actions(self) -> list:\n if self.debug: print(f\"AState.actions()\")\n if not self._examined:\n if self.debug: print(f\"\\tExamining...\")\n ...
[ "0.80822146", "0.8062952", "0.7993937", "0.799084", "0.7978289", "0.78011256", "0.7752233", "0.77196807", "0.76255643", "0.7568808", "0.75244987", "0.7518797", "0.75011617", "0.7431885", "0.7431885", "0.74023604", "0.7308176", "0.727038", "0.72663873", "0.72566926", "0.719015...
0.80894357
0
Given the desired state and action, create an action message
def create_action_msg(self, action): raise NotImplementedError("Don't know how to translate the action to a msg")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def convert_to_low_level_action(self, i_state, action):\n pass", "def _createAction(self, item, actionString):\n action = {\n \"action\": actionString,\n \"item_id\": item.item_id\n }\n\n pocketLogger.debug(\"Action\" + str(action))\n\n self.actions.append...
[ "0.65029216", "0.642163", "0.64017195", "0.63986725", "0.6392934", "0.63834316", "0.63461274", "0.63110197", "0.62237453", "0.6194514", "0.61881584", "0.6137856", "0.6132849", "0.6127335", "0.6109601", "0.6091603", "0.6078355", "0.6060754", "0.6048459", "0.6038914", "0.603512...
0.7599728
0
Explicit call to increment the number of timesteps that occurred
def increment_steps(self): self.num_steps += 1
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def increment(self):\n self._deltas += 1", "def increment_counter(self) -> None:", "def increment_time_step(self):\n for grid in self.get_grid_list():\n try:\n self[grid].increment_time_step()\n except AttributeError:\n pass", "def tick(self):...
[ "0.75099885", "0.7304666", "0.7255583", "0.71396923", "0.7119622", "0.7098083", "0.7093106", "0.70083195", "0.6971343", "0.68312025", "0.6744346", "0.6730654", "0.6708262", "0.67001796", "0.67001796", "0.6629736", "0.6612223", "0.6596166", "0.65689284", "0.6552915", "0.655291...
0.8445815
0
Reset the task state for another iteration
def reset(self): self.num_steps = 0 self.world_state = self.action = None
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def reset_task_state(self) -> None:\n self.set_task_state(task_state=self.sample_task_state())", "def reset_task(self, task, generator):\n self.task = task\n self.task_dep = task.task_dep[:]\n self.calc_dep = task.calc_dep.copy()\n self.generator = generator", "def reset(self...
[ "0.777646", "0.7153536", "0.7088361", "0.6962433", "0.6861928", "0.67380184", "0.66768163", "0.66567224", "0.6635762", "0.6623806", "0.6593086", "0.65811676", "0.6575518", "0.6556174", "0.6554048", "0.6462685", "0.6462685", "0.6462685", "0.64503086", "0.64472055", "0.64408875...
0.6248976
64
Set the world state
def set_world_state(self, world_state, action): self.world_state = world_state self.action = action
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def run_world(self):\n self.world_alive = True\n self.world_setable = False", "def world(self, value):\n self.worlds[self.world_index] = value", "def update_world(self):\n pass", "def set_state( self ):", "def set_state(self, state: Any) -> None:\n raise NotImplementedError(\...
[ "0.7429299", "0.7246788", "0.70243907", "0.6625803", "0.647866", "0.6457073", "0.64543515", "0.64229536", "0.6357686", "0.63364655", "0.63113374", "0.6282837", "0.6245218", "0.62417537", "0.6235918", "0.6228587", "0.62264144", "0.6222763", "0.6221341", "0.62172246", "0.619063...
0.79954255
0
Given a world state, returns the agent's observation model. By default the agent has access to the complete world state
def get_agent_state(self): return self.world_state
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _get_obs(self):\n # return np.concatenate((self.world.state[:6], self.world.state[7:13]))\n return np.concatenate((self.world.state, np.zeros(7)))\n # return self.world.state", "def get_observation(world_state,weather,time_now):\n obs = np.zeros((2, OBS_SIZE, OBS_SIZE))\n object_li...
[ "0.6433146", "0.62845165", "0.6092617", "0.5913347", "0.58923274", "0.58671933", "0.5793312", "0.5788415", "0.57711667", "0.57316136", "0.57107484", "0.56854695", "0.56197894", "0.5549037", "0.55431503", "0.55347174", "0.5503566", "0.54819864", "0.5470213", "0.5451508", "0.54...
0.6532894
0
Reward at state. Optional action makes this into the reward for performing the action at state. MUST `set_world_state` before this
def reward(self): if self.num_steps >= self.timeout: return self.fail_penalty return self.default_reward
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update(self, state, action, nextState, reward):\n util.raiseNotDefined()", "def agent_step(self, reward, state):\n self.sum_rewards += reward\n self.episode_steps += 1\n\n # Make state an array of shape (1, state_dim) to add a batch dimension and\n # to later match the get_...
[ "0.70163804", "0.69934577", "0.6972369", "0.69639444", "0.693336", "0.6870321", "0.6836065", "0.68152875", "0.681367", "0.68106467", "0.6810196", "0.68010736", "0.6797167", "0.67968327", "0.67484176", "0.66801345", "0.66743845", "0.6645795", "0.66411126", "0.66180277", "0.660...
0.0
-1
Returns a Status code of whether the task is complete or not
def status(self): if self.num_steps >= self.timeout: return Status.TIMEOUT return Status.IN_PROGRESS
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_task_complete(self):\n if self._task is None:\n raise UserWarning(\"No task registered\")\n\n return self._task.is_complete()", "def is_complete(self) -> bool:\n return self.status in [\"SUCCESS\", \"ERROR\", \"CANCELLED\"]", "def done(self):\n return self._info['statu...
[ "0.74955946", "0.7105255", "0.70931715", "0.709173", "0.70385146", "0.7028743", "0.6999421", "0.69394165", "0.68977404", "0.6876825", "0.6825816", "0.6759908", "0.6753576", "0.6705141", "0.6695516", "0.6695432", "0.6677091", "0.6676913", "0.6650031", "0.6642103", "0.6638421",...
0.0
-1
Create the data structure to save the task
def _save(self): raise NotImplementedError("Don't know how to save the task")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_task():", "def generate_tasks(self, task):", "def make_save(self):\n\t\tsave = {}\n\t\tsave['p'] = self.p\n\t\tsave['injail'] = self.injail.copy()\n\t\tsave['tile'] = self.tile.copy()\n\t\tsave['bal'] = self.bal.copy()\n\t\tsave['goojf'] = self.goojf.copy()\n\t\tsave['isalive'] = self.isalive.copy()...
[ "0.67924315", "0.65425", "0.652313", "0.6397578", "0.6379625", "0.6369474", "0.6355105", "0.6344151", "0.6308834", "0.6289811", "0.6195527", "0.61949176", "0.61514395", "0.6129603", "0.6129044", "0.61009836", "0.6026523", "0.6016444", "0.60064936", "0.5986836", "0.59778374", ...
0.66189206
1
Save the task. If filename is None, then simply return the parameters of the task to save. Internally calls _save
def save(self, filename=None): data = self._save() if filename is not None: with open(filename, 'wb') as fd: pickle.dump(data, fd) return data
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _save(self):\n raise NotImplementedError(\"Don't know how to save the task\")", "def save(self, filename):\n pass", "def serialize(self, to_file=None):\n if to_file is not None:\n raise ValueError(\n \"TaskInfo does not support serialization to a custom filename\"...
[ "0.7183091", "0.6515112", "0.650446", "0.6468557", "0.64476895", "0.64466757", "0.64406633", "0.6429666", "0.6295828", "0.62874186", "0.62684107", "0.6251983", "0.6074047", "0.6060759", "0.60295886", "0.6014035", "0.5971834", "0.5960305", "0.59441227", "0.5832788", "0.5824323...
0.63741523
8
Load the task from the data dictionary
def _load(self, data): raise NotImplementedError("Don't know how to load the task")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _load_dict(self, kwargs):\n # TaskInfo always needs a description and task_type, but all other\n # supported (optional) parameters are loaded from kwargs to\n keyword_args = dict(kwargs)\n task_id = TaskInfo._dpop(keyword_args, \"id\")\n if task_id is not None:\n s...
[ "0.6894152", "0.68634784", "0.67587066", "0.67548025", "0.6582195", "0.6552855", "0.65317833", "0.6389541", "0.6385041", "0.6374283", "0.632729", "0.63198704", "0.6310949", "0.6292082", "0.6270582", "0.6261923", "0.62304664", "0.62278163", "0.6208512", "0.620306", "0.6188854"...
0.839734
0
Load the task from a filename or from a data dictionary. One of the two MUST be specified. Internally calls _load. Returns the loaded object
def load(self, filename=None, data=None): if filename is not None and data is None: with open(filename, 'rb') as fd: data = pickle.load(fd) elif filename is None and data is not None: pass else: raise ValueError("Exactly one of filename and dat...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _load(self, data):\n raise NotImplementedError(\"Don't know how to load the task\")", "def load(cls, from_file):\n json_str = gitrepo.read_task(from_file)\n task_dict = json.loads(json_str)\n return cls(**task_dict)", "def load(load_path: str):\n if not (load_path and os.path...
[ "0.7640262", "0.67125285", "0.6363747", "0.6359384", "0.6338668", "0.62688774", "0.62488794", "0.6236673", "0.62261987", "0.6187643", "0.61764544", "0.61720985", "0.60996926", "0.60921824", "0.6085707", "0.6085394", "0.60703933", "0.60616714", "0.6050866", "0.60465777", "0.60...
0.61859155
10
Failure condition if any of the objects is lost
def _is_fail(self): failed = False for obj in self.world_state.objects: failed = failed or obj.lost return failed
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def lost(self):\r\n return None", "def test_data_object_del_all(self):\n pass", "def reject(self):\n self.new_rom = None\n self.new_reductor = None", "def __exit__(self, exc_type, exc_val, exc_tb):\n self.delete()\n if exc_type:\n return False\...
[ "0.6590283", "0.6133852", "0.5932318", "0.59298193", "0.5891115", "0.58692384", "0.5850308", "0.58211994", "0.5807659", "0.57847774", "0.5715833", "0.5684817", "0.56463337", "0.56376064", "0.5617179", "0.5617179", "0.5617179", "0.56154984", "0.5613748", "0.5602049", "0.560128...
0.6886242
0
Signs into Email and returns imap object
def email_startup(): imap = imaplib.IMAP4_SSL('imap.gmail.com') # authenticate imap.login(email_credentials.email_user, email_credentials.email_pass) return imap
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_mail() -> imaplib.IMAP4_SSL:\n mail = imaplib.IMAP4_SSL(config['mail']['imap'])\n mail.login(USER_MAIL, PASS_MAIL)\n mail.list()\n mail.select('inbox')\n return mail", "def login(self):\n self.IMAP = imaplib.IMAP4_SSL(self.mailconfig.IMAPHost, 993, ssl_context=ssl.create_default_con...
[ "0.6071403", "0.5906617", "0.56876385", "0.56174904", "0.55747813", "0.54144245", "0.5320152", "0.53145826", "0.51558757", "0.5139861", "0.5137904", "0.5127193", "0.5107942", "0.5104838", "0.51033807", "0.50951505", "0.5094071", "0.50889444", "0.50601846", "0.5053714", "0.503...
0.68906516
0
Returns current unread count
def get_unread_count(imap): status, messages = imap.select('Inbox') status, response = imap.uid('search', None, 'UNSEEN') unread_msg_nums = response[0].split() return len(unread_msg_nums)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def unread_count(self) -> dict[str, int]:\n return self.subreddit._reddit.get(API_PATH[\"modmail_unread_count\"])", "def inbox_count_for(user):\n return Message.inbox.for_user(user).unread().count()", "def get_unread_count(username, password):\n obj = imaplib.IMAP4_SSL('imap.gmail.com', '993')\n ...
[ "0.7879572", "0.77617085", "0.7675302", "0.7408627", "0.72338617", "0.7100542", "0.707241", "0.6982085", "0.6980177", "0.6980177", "0.6965017", "0.6919026", "0.69053316", "0.6899091", "0.68954474", "0.68706244", "0.68266624", "0.68144584", "0.68018526", "0.67775595", "0.67583...
0.78147435
1
Using DAYS input, returns date
def get_days_old(days): days = int(days) current_time = datetime.datetime.today() days_after = datetime.timedelta(days) new_date = current_time - days_after new_date = new_date.strftime("%d-%b-%Y") return new_date
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_day():\n return handle_invalid_inputs(question_4, days)", "def DAY(date):\n return _make_datetime(date).day", "def get_date_day(date):\n cut_date = date.split('-')\n return cut_date[2]", "def get_day(x):\n return x[\"SALE DATE\"].day", "def days(input=None):\n return get(inp...
[ "0.75948316", "0.712062", "0.6941263", "0.6898457", "0.6890336", "0.68240386", "0.67894244", "0.6753019", "0.6648563", "0.66329473", "0.6552229", "0.6544976", "0.646453", "0.6462848", "0.6416074", "0.6358065", "0.6342067", "0.63109267", "0.6293483", "0.6280146", "0.6270841", ...
0.0
-1
Read messages, prints Subject, From, and Date of each email.
def process_messages(imap, messages): for i in messages: # fetch the email message by ID res, msg = imap.fetch(str(i), "(RFC822)") for response in msg: if isinstance(response, tuple): # parse bytes email into a message object msg = email.message_fr...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _print_basic_email_information(emails, conn):\n for mid in emails:\n (res, data) = conn.fetch(mid, '(ENVELOPE)')\n headers = pattern.match(data[0])\n print 'Date: %s' % headers.group(1)\n print 'Subject: %s' % headers.group(2)\n print 'From: %s <%s@%s>' % (headers.group(3), headers.group(4), he...
[ "0.68606496", "0.6697399", "0.6242391", "0.6167278", "0.60678244", "0.5987654", "0.59242094", "0.58546776", "0.58495265", "0.5796335", "0.5782215", "0.57780635", "0.5763217", "0.5757804", "0.5738771", "0.5679548", "0.56775135", "0.5667818", "0.5658688", "0.5621258", "0.557776...
0.6736609
1
Main sequence, setup for use on AWS Lambda.
def lambda_handler(event, content): imap = email_startup() status, messages = imap.select('Inbox') days_old = input('Enter many days ago do you want to use as the cutoff?: ') new_date = get_days_old(days_old) messages = apply_filter(imap, new_date) initial_unread = get_unread_count(imap) pri...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def setup_aws():\n setup_queues()\n setup_buckets()\n setup_domains()", "def main():\n # Creating resources/clients for all needed infrastructure: EC2, IAM, Redshift\n ec2 = create_client('ec2', boto3.resource)\n iam = create_client('iam', boto3.client)\n redshift = create_client('redshift',...
[ "0.6886727", "0.67928576", "0.65850043", "0.64966947", "0.6479974", "0.6419044", "0.63956016", "0.6392975", "0.63806033", "0.6377031", "0.63644034", "0.63579535", "0.6329325", "0.6329325", "0.63011193", "0.6296817", "0.6288324", "0.62685007", "0.625102", "0.6250017", "0.62447...
0.0
-1
Adds a user defined by user_data to the database.
def create_user(user_dict): if not user_dict.has_key('temp') or not user_dict['temp']: user_dict['id'] = create_user_profile(user_dict) else: user_dict['id'] = create_temp_user(user_dict) return user_dict['id']
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_user(self, user):\n return self.ireporter_db.insert_data_users(\n user.get(\"firstname\"),\n user.get(\"lastname\"),\n user.get(\"othernames\"),\n user.get(\"username\"),\n user.get(\"email\"),\n user.get(\"phonenumber\"),\n ...
[ "0.80839854", "0.7909277", "0.7646269", "0.76275533", "0.7448205", "0.74244636", "0.73783696", "0.73554134", "0.7325657", "0.7294506", "0.7214251", "0.71303326", "0.70534736", "0.70340306", "0.701171", "0.6969743", "0.6940915", "0.6920326", "0.6906458", "0.69042975", "0.68523...
0.0
-1
Modfiy the user to match the user_data. The uid, username, and password are obtained from the current session, not the user_data.
def modify_user(user_data): raise NotImplementedError()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update_user():", "def login(self, user_data):\n\n\t\tuser_data[\"password\"] = makeHash(user_data[\"password\"]);\n\n\t\tif self.db.request(\"getOne\", user_data):\n\t\t\treturn True;\n\t\telse:\n\t\t\treturn False;", "def update_user_login_data():\n if not 'user' in session:\n raise InvalidUsage...
[ "0.708032", "0.6858004", "0.6827936", "0.6668155", "0.6594708", "0.65755826", "0.65447223", "0.65251255", "0.6459843", "0.64295995", "0.63873506", "0.6355804", "0.6313982", "0.6304147", "0.6302355", "0.6301091", "0.628443", "0.6270238", "0.6231948", "0.6217884", "0.62178504",...
0.61858064
27
Deletes the current session user from the database.
def delete_user(): raise NotImplementedError()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def delete_user(self) -> None:\n table_dictionary = {\n 'Apple': {\n 'table': 'AppleReceipts',\n 'user_id': 'User_id'\n },\n 'ESL': {\n 'table': 'ESLReceipts',\n 'user_id': 'User_id'\n },\n 'Tr...
[ "0.7938402", "0.76589966", "0.76589966", "0.76589966", "0.7615142", "0.749526", "0.73947626", "0.7390391", "0.7334158", "0.73282003", "0.7314524", "0.73037", "0.73013514", "0.72556037", "0.7252851", "0.7247286", "0.7216128", "0.72138715", "0.7207485", "0.7201704", "0.71614677...
0.0
-1
Retrieves the User associated with this user.
def get_user(username, given_password): err = 'The username password combination is invalid.' rows = query_db(GET_PROFILED_USER_BY_USERNAME, (username,)) if (not rows) or (len(rows) == 0): raise ValidationException(err) else: encrypted_password = rows[0]['pw'] salt = rows[0]['salt']...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_user(self) -> User:\n return self.__user", "def get_user(self):\n\n user_session = self.get()\n if not user_session:\n return None\n\n us = ServiceLocator.resolve(ServiceLocator.USERS)\n return us.single(user_session.login)", "def user(self):\n u = s...
[ "0.8533054", "0.82623774", "0.81990415", "0.8039894", "0.803661", "0.79924077", "0.7989395", "0.7910089", "0.7910089", "0.790278", "0.79007286", "0.7868419", "0.7863329", "0.7860284", "0.7849331", "0.7844603", "0.78098893", "0.7759409", "0.7730477", "0.7706841", "0.7695282", ...
0.0
-1
Retrieves the user data associated with the given user id, only if the uid matches a temporary user.
def get_temp_user(temp_uid): rows = query_db(GET_TEMP_USER_BY_ID, (temp_uid,)) if (not rows) or (len(rows) == 0): return None else: return rows[0]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_user(self, user_id):\n return None # noqa: WPS324", "def get_user(self, user_id):\n return self.my_get_user(self.get_all_dbusers(), user_id)", "def get_user(self):\n if \"user\" not in self._data:\n self._data[\"user\"] = User.objects.get(pk=self.kwargs[\"user_id\"])\n ...
[ "0.653152", "0.64986724", "0.64938116", "0.6490214", "0.6460154", "0.64446324", "0.6444477", "0.6431604", "0.64265597", "0.64099985", "0.64092183", "0.6406827", "0.6384698", "0.63674635", "0.6348337", "0.63395566", "0.63255215", "0.6324054", "0.63140005", "0.62993497", "0.629...
0.7075412
0
Creates a new queue with the defined settings. All settings except qid must exist.
def create_queue(q_settings): db = get_db() cursor = db.cursor() cursor.execute(INSERT_QUEUE) q_settings['qid'] = cursor.lastrowid cursor.execute(INSERT_QUEUE_SETTINGS, qsettings_dict_to_db_tuple(q_settings)) cursor.close() db.commit() permissions.add_permission_list(get_uids(q_settings[...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _queue_create(self, **kwargs):\n name = self.generate_random_name()\n return self.clients(\"zaqar\").queue(name, **kwargs)", "def create_queue(self):\n queue_name = self.generate_name()\n try:\n queue = self.sqs.create_queue(QueueName=queue_name)\n except Excepti...
[ "0.7581136", "0.70347965", "0.69530344", "0.65396017", "0.6517988", "0.650838", "0.6362824", "0.63077843", "0.62122697", "0.6168579", "0.61568266", "0.6059989", "0.6057603", "0.59346896", "0.5918184", "0.59084517", "0.58973634", "0.5895379", "0.58948785", "0.58845586", "0.581...
0.80698436
0
Modifies the queue with the qid defined in q_settings to match the q_settings given. If the user's session does not have proper permissions, a PermissionException will be raised.
def modify_queue_settings(q_settings): db = get_db() db.execute(UPDATE_QUEUE_SETTINGS, qsettings_dict_to_db_tuple_modify(q_settings)) db.commit() permissions.update_permissions(q_settings['qid'], get_uids(q_settings['admins']), get_ui...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_queue(q_settings):\r\n db = get_db()\r\n cursor = db.cursor()\r\n cursor.execute(INSERT_QUEUE)\r\n q_settings['qid'] = cursor.lastrowid\r\n cursor.execute(INSERT_QUEUE_SETTINGS, qsettings_dict_to_db_tuple(q_settings))\r\n cursor.close()\r\n db.commit()\r\n permissions.add_permission_list...
[ "0.695025", "0.5967407", "0.5682562", "0.5622668", "0.55358464", "0.54205173", "0.52965754", "0.52623177", "0.5238731", "0.5237322", "0.51202923", "0.51119876", "0.5106844", "0.5067134", "0.5061601", "0.5050214", "0.50273246", "0.5011243", "0.49993062", "0.49826905", "0.49506...
0.8353673
0
Deletes the queue with the given qid.
def delete_queue(qid): raise NotImplementedError()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def del_queue(self, queue_id):\n del self.queue_dict[queue_id]", "def delete_queue(self, queue_name):\n amqp_session = self.__broker.getAmqpSession()\n amqp_session.queue_delete(queue_name)", "def delete_queue(client, vhost, queue):\n client.delete_queue(vhost, queue)", "def delete_qu...
[ "0.80621874", "0.7392091", "0.7221345", "0.6939881", "0.6921134", "0.68347037", "0.681158", "0.6723165", "0.6691769", "0.6668935", "0.6582468", "0.6549046", "0.6486121", "0.6386816", "0.638424", "0.63499683", "0.6224456", "0.62072754", "0.61523956", "0.6105223", "0.60679805",...
0.7482865
1
Retrieves the queue_settings associated with qid.
def get_queue_settings(qid): db = get_db() rows = query_db(GET_QUEUE_SETTINGS_BY_ID, (qid,)) if (not rows) or (len(rows) == 0): raise sqlite3.Error('The queue does not exist.') return rows[0]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getQueueDetails(self, queue_name, project_id=\"\"):\n if project_id == \"\":\n project_id = self.project_id\n url = \"%sprojects/%s/queues/%s?oauth=%s\" % (self.url, project_id,\n queue_name, self.token)\n body = self.__get(url)\n queue = json.loads(body)\n...
[ "0.6426058", "0.6181275", "0.60460794", "0.60399467", "0.60134006", "0.6009682", "0.5998501", "0.596838", "0.5869374", "0.5869374", "0.5869374", "0.5869374", "0.5869374", "0.5869374", "0.5869374", "0.5869374", "0.5869374", "0.5864781", "0.57995844", "0.5773101", "0.57453996",...
0.84848475
0
Gets the next unused color in the colormap.
def getnextcolor(self): self.usedcc = [line.get_c() for line in self.axes.lines] for c in self.cc: if c not in self.usedcc: return c # Only gets here if all colors already used... i = len(self.axes.lines) numc = len(self.cc) i = i % numc ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def last_color(self):\n idx = self._color_indexes.get(self._plotid)\n if idx is not None:\n return COLOR_CYCLE[(idx-1) % len(COLOR_CYCLE)]\n return COLOR_CYCLE[0]", "def next_color(self):\n if self._color_cycle is None:\n return self._theme.color\n return ...
[ "0.7047926", "0.70240617", "0.6406171", "0.640337", "0.63254637", "0.624644", "0.6140363", "0.6138365", "0.608178", "0.5859143", "0.5800212", "0.57992345", "0.57513505", "0.57308686", "0.5720083", "0.5693726", "0.56692684", "0.56692684", "0.56692684", "0.56692684", "0.565848"...
0.76217306
0
Checks to see if the figure has been initialized sufficiently. Raises a HKEPlotterNotInitializedError if this check fails.
def _checkfigure(self): if ((type(self.figure) is Figure) and (type(self.axes) in (Subplot, Axes))): return else: raise HKEPlotterNotInitializedError(self.figure, self.axes)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def check_init(self):\n if self.Nlayer > 1:\n raise Exception(\"Nlayer == 1 currently\")", "def _check_if_fitted(self):\n if not self.fitted:\n raise AssertionError('Model is not fitted! Fit the model to a '\n 'dataset before attempting to plot ...
[ "0.58771706", "0.58598655", "0.5789109", "0.56482935", "0.55886585", "0.55830985", "0.55374056", "0.55144477", "0.5482541", "0.54182714", "0.5398965", "0.53605324", "0.5334684", "0.5334493", "0.526229", "0.5258163", "0.52408624", "0.52403283", "0.5214515", "0.51683396", "0.51...
0.85144806
0
Makes an R vs T plot from a specified datafile.
def RvsTPlot(self, datafile, boardindex, chindex, description='', Tcline=True): try: self._checkfigure() except HKEPlotterNotInitializedError(self.figure, self.axes) as e: print e temperature = datafile['tempe...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def plot_from_file(filename='Save_Data.txt'):\r\n txt = open(filename)\r\n data = []\r\n for line in txt:\r\n line = line.strip()\r\n line = shlex.split(line)\r\n if len(line) > 0:\r\n data.append(line)\r\n plot_E, w, length, intensity, reciprocal = [], [], [], [], []\r\...
[ "0.6569941", "0.633606", "0.63073134", "0.6186925", "0.61786187", "0.6167234", "0.6143511", "0.61424106", "0.6137596", "0.6133196", "0.60943836", "0.60853", "0.6059368", "0.6052842", "0.60409", "0.60155857", "0.6005196", "0.59548473", "0.594367", "0.5919602", "0.59038895", ...
0.5942957
19
Finds and returns the line dictionary in self.lines that contains the specified line.
def _get_linedict(self, line): if (isinstance(line, dict) and (line in self.lines)): return line for linedict in self.lines: if line in linedict.itervalues(): ld = linedict try: return ld except NameError: raise ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def find_line_by_line_id(self, line_id):\n for line in self._data_lines:\n if six.text_type(line.get(\"line_id\")) == six.text_type(line_id):\n return line\n return None", "def getMatchingLine(self, line):\n tokens = map(str.lower, line.text.split()) # easy way to ignor...
[ "0.7447421", "0.7269382", "0.7151247", "0.69694895", "0.68616974", "0.685197", "0.6806955", "0.6568612", "0.65364873", "0.651995", "0.649974", "0.649974", "0.64308566", "0.634241", "0.6340575", "0.6336796", "0.6218831", "0.61939305", "0.6133551", "0.608059", "0.60420334", "...
0.71511036
3
Add a vertical line corresponding to line at the specified temperature.
def addTcline(self, line, temperature=None): self._checkfigure() ld = self._get_linedict(line) line = ld['line'] if temperature is None: temperature = ld['Tc'] color = line.get_c() axvl = self.axes.axvline(temperature, color=color, ls='--') # self.axvl...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_vert_lines(self, timestamp: datetime = None) -> None:\n self._logger.debug(\"running\")\n for axes in self.figure.get_axes():\n if timestamp:\n self._vlines.append(timestamp)\n axes.axvline(timestamp)\n self.refresh_self()\n e...
[ "0.6347238", "0.6204931", "0.61713815", "0.6061019", "0.5882949", "0.5863026", "0.57749057", "0.5748844", "0.56307054", "0.5602868", "0.55812764", "0.5558648", "0.55533946", "0.5510339", "0.5501377", "0.542325", "0.5418261", "0.5417373", "0.5402615", "0.53853005", "0.536729",...
0.81121063
0
Remove a vertical line corresponding to line.
def delTcline(self, line): self._checkfigure() ld = self._get_linedict(line) for vline in ld['vlines']: vline.remove() ld['vlines'] = []
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def delete_line(self, line):\n self._checkfigure()\n ld = self._get_linedict(line)\n self.delTcline(ld)\n line = ld['line']\n line.remove()\n self.lines.remove(ld)", "def unhighlight_line(self, line):\n self._checkfigure()\n ld = self._get_linedict(line)\n ...
[ "0.78958136", "0.7021003", "0.6831549", "0.68241143", "0.6732324", "0.6673958", "0.65849", "0.6536107", "0.6413903", "0.6360962", "0.6296874", "0.62025994", "0.6155294", "0.6119225", "0.60587656", "0.5982313", "0.5938441", "0.5886886", "0.588464", "0.5878587", "0.58415264", ...
0.81666446
0
Highlight a line by making its linewidth slightly larger.
def highlight_line(self, line, factor=1.5): self._checkfigure() ld = self._get_linedict(line) ld['highlighted'] = True ld['highlight factor'] = factor self.update_lines()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def hline(self, x, y, width, color):\n self.rect(x, y, width, 1, color, fill=True)", "def highlight_line(self, line: int):\r\n\r\n # iterate through the stored labels\r\n for i in range(len(self.list_labels)):\r\n # select the label\r\n cur_label = self.list_labels[i]\r...
[ "0.6834912", "0.6661483", "0.6593628", "0.65844816", "0.64995754", "0.64967895", "0.6495246", "0.64931285", "0.644155", "0.6311235", "0.6303806", "0.6160309", "0.61249274", "0.6121856", "0.6103676", "0.6070904", "0.60629326", "0.6013031", "0.6001534", "0.5995958", "0.596047",...
0.7394484
0
Remove the highlighting of a line by restoring its linewidth to the original size.
def unhighlight_line(self, line): self._checkfigure() ld = self._get_linedict(line) ld['highlighted'] = False self.update_lines()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def delete_line(self, line):\n self._checkfigure()\n ld = self._get_linedict(line)\n self.delTcline(ld)\n line = ld['line']\n line.remove()\n self.lines.remove(ld)", "def delTcline(self, line):\n self._checkfigure()\n ld = self._get_linedict(line)\n ...
[ "0.6705673", "0.66501707", "0.6345694", "0.6073631", "0.60523313", "0.59840494", "0.5944763", "0.5901352", "0.5873407", "0.5866891", "0.584564", "0.58381665", "0.5835699", "0.5823243", "0.57539326", "0.5734348", "0.5732146", "0.5720828", "0.570929", "0.5683525", "0.5675305", ...
0.7733983
0
Remove a line and all lines related to it from the figure.
def delete_line(self, line): self._checkfigure() ld = self._get_linedict(line) self.delTcline(ld) line = ld['line'] line.remove() self.lines.remove(ld)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def delTcline(self, line):\n self._checkfigure()\n ld = self._get_linedict(line)\n for vline in ld['vlines']:\n vline.remove()\n ld['vlines'] = []", "def erase_plot(self, line_position=0):\n self.axplot.lines.pop(line_position).remove\n self.fig.canvas.draw()\...
[ "0.7875856", "0.7797177", "0.73978674", "0.7305522", "0.6911539", "0.68509316", "0.6705773", "0.66417044", "0.6570736", "0.6451503", "0.64441305", "0.641181", "0.64044476", "0.6347925", "0.62704635", "0.6255358", "0.6212487", "0.6195537", "0.6177298", "0.6173465", "0.6164881"...
0.80190194
0