query
stringlengths
9
9.05k
document
stringlengths
10
222k
metadata
dict
negatives
listlengths
30
30
negative_scores
listlengths
30
30
document_score
stringlengths
4
10
document_rank
stringclasses
2 values
Checks if the cell has valid geometry. There are at least two reasons why a cell might have invalid
def validCellGeometry(self, ijk = None , global_index = None , active_index = None): gi = self.__global_index( global_index = global_index , ijk = ijk , active_index = active_index) return self._valid_cell( gi )
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def checkGeom(geodataframe):\n for geometry in geodataframe.geometry:\n if explain_validity(geometry) != 'Valid Geometry':\n print(explain_validity(geometry))", "def is_valid(self):\n if self.get_row() != -1 and self.get_column() != -1:\n return True\n else:\n ...
[ "0.7485371", "0.68256056", "0.6738727", "0.6689731", "0.6644501", "0.65865844", "0.6509728", "0.6504427", "0.64611405", "0.643762", "0.6320081", "0.6297482", "0.62604874", "0.62329763", "0.61944276", "0.61709315", "0.6167919", "0.6162139", "0.6156477", "0.61471033", "0.613918...
0.6928083
1
Lookup global index based on ijk or active index.
def get_global_index( self , ijk = None , active_index = None): gi = self.__global_index( active_index = active_index , ijk = ijk) return gi
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def global_index( self , active_index = None, ijk = None):\n return self.__global_index( active_index = active_index , ijk = ijk )", "def get_active_index( self , ijk = None , global_index = None):\n gi = self.__global_index( global_index = global_index , ijk = ijk)\n return self._get_active...
[ "0.81544656", "0.78202045", "0.73211944", "0.705059", "0.64130604", "0.6121929", "0.59489614", "0.5895438", "0.58456194", "0.5773087", "0.56557363", "0.5576186", "0.5565344", "0.55652833", "0.552736", "0.5520127", "0.5494459", "0.5486436", "0.54677886", "0.54393417", "0.54294...
0.8171045
0
Will return the (x,y,z) for the node given by (i,j,k). Observe that this method does not consider cells, but the nodes in the grid. This means that the valid input range for i,j and k are are upper end inclusive. To get the four
def getNodePos(self , i , j , k): if not 0 <= i <= self.getNX(): raise IndexError("Invalid I value:%d - valid range: [0,%d]" % (i , self.getNX())) if not 0 <= j <= self.getNY(): raise IndexError("Invalid J value:%d - valid range: [0,%d]" % (j , self.getNY())) if not 0 <...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getNodeXYZ(self , i,j,k):\n nx = self.getNX()\n ny = self.getNY()\n nz = self.getNZ()\n\n corner = 0\n \n if i == nx:\n i -= 1\n corner += 1\n\n if j == ny:\n j -= 1\n corner += 2\n\n if k == nz:\n k ...
[ "0.73686534", "0.65047204", "0.63919705", "0.6296044", "0.6275556", "0.6220592", "0.6207953", "0.61805415", "0.6143953", "0.61251754", "0.60409844", "0.6003493", "0.5980634", "0.5960125", "0.59550786", "0.5921654", "0.5883512", "0.58813345", "0.58503973", "0.5846972", "0.5827...
0.73610574
1
This function returns the position of Vertex (i,j,k). The coordinates are in the inclusive interval [0,nx] x [0,ny] x [0,nz].
def getNodeXYZ(self , i,j,k): nx = self.getNX() ny = self.getNY() nz = self.getNZ() corner = 0 if i == nx: i -= 1 corner += 1 if j == ny: j -= 1 corner += 2 if k == nz: k -= 1 corn...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getNodePos(self , i , j , k):\n if not 0 <= i <= self.getNX():\n raise IndexError(\"Invalid I value:%d - valid range: [0,%d]\" % (i , self.getNX()))\n\n if not 0 <= j <= self.getNY():\n raise IndexError(\"Invalid J value:%d - valid range: [0,%d]\" % (j , self.getNY()))\n\n ...
[ "0.75148904", "0.6588608", "0.6550321", "0.6368179", "0.63060415", "0.623356", "0.6167894", "0.6144407", "0.61222583", "0.61099994", "0.61073494", "0.60824805", "0.6025701", "0.6015853", "0.59869", "0.59733015", "0.5970571", "0.59663826", "0.595034", "0.5938405", "0.59281737"...
0.7257748
1
Bottom of the reservoir; in the column ( , ).
def bottom( self , i , j ): return self._get_bottom( i , j )
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_replica_bottom(self):\n return self.dummy_row_insts[0].uy()", "def bottom(self):\n return self.__b", "def bottom(self):\n # type: () -> float\n return self._bottom", "def bottom(self):\n return self._bottom", "def move_bottom ( self ):\n list, index = self....
[ "0.68143", "0.65203387", "0.63712764", "0.6278976", "0.6226127", "0.6201487", "0.6165377", "0.61245996", "0.61081696", "0.610627", "0.5982431", "0.5977994", "0.5907894", "0.5894845", "0.58603686", "0.58603686", "0.5837352", "0.58325255", "0.57657677", "0.5724831", "0.5713004"...
0.66192627
1
Will locate the k value of cell containing specified depth. Will scan through the grid column specified by the input arguments and and search for a cell containing the depth given by input argument . The return value is the k value of cell containing . If is above the top of the reservoir the function will return 1, an...
def locate_depth( self , depth , i , j ): return self._locate_depth( depth , i , j)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def df_search(grid, level):\n states_we_have_seen_before = Set(grid)\n\n def recur(inner_grid, itter, level):\n counter = 0\n next_states = Set()\n\n for gg in legal_moves(inner_grid):\n if gg not in states_we_have_seen_before:\n states_we_have_seen_before.add(g...
[ "0.66241956", "0.6500184", "0.6004492", "0.58622545", "0.58384705", "0.5737128", "0.5730612", "0.56912434", "0.5666911", "0.5647384", "0.56222653", "0.5618303", "0.5603912", "0.5595387", "0.5587486", "0.55810344", "0.55666375", "0.55655825", "0.55468816", "0.5525049", "0.5520...
0.653387
1
Lookup cell containg true position (x,y,z). Will locate the cell in the grid which contains the true position (,,), the return value is as a triplet (i,j,k). The underlying C implementation is not veeery efficient, and can potentially take quite long time. If you provide a good intial guess with the parameter (a tuple ...
def find_cell( self , x , y , z , start_ijk = None): if start_ijk: start_index = self.__global_index( ijk = start_ijk ) else: start_index = 0 global_index = self._get_ijk_xyz( x , y , z , start_index) if global_index >= 0: i = ctypes.c_int() ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def findCellXY(self , x, y , k):\n if 0 <= k <= self.getNZ():\n i = ctypes.c_int()\n j = ctypes.c_int()\n ok = self._get_ij_xy( x,y,k , ctypes.byref(i) , ctypes.byref(j))\n if ok:\n return (i.value , j.value)\n else:\n rais...
[ "0.69080573", "0.6779657", "0.66930765", "0.66930765", "0.66930765", "0.6678192", "0.6678192", "0.6678192", "0.6678192", "0.66224736", "0.6613548", "0.639877", "0.6369274", "0.6351354", "0.6351354", "0.6344353", "0.6325002", "0.63212687", "0.63165545", "0.6294562", "0.6286179...
0.7881949
0
Will check if the cell contains point given by world coordinates (x,y,z). See method get_xyz() for documentation of , and .
def cell_contains( self , x , y , z , active_index = None , global_index = None , ijk = None): gi = self.__global_index( ijk = ijk , active_index = active_index , global_index = global_index) return self._cell_contains( gi , x,y,z)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def contains(self, point):\n if in_range(point[0], self.xrange) and in_range(point[0], self.yrange) and in_range(point[0], self.zrange):\n return True\n return False", "def contains(self, point):\n return 0 <= point.x <= 1 \\\n and 0 <= point.y <= 1 \\\n and 0 ...
[ "0.7148915", "0.6899895", "0.6835324", "0.67269105", "0.66799223", "0.6678204", "0.66715646", "0.6637392", "0.66056424", "0.660049", "0.6567728", "0.6531672", "0.6508277", "0.6455558", "0.64402044", "0.6436551", "0.64294076", "0.64017344", "0.6400132", "0.63888776", "0.632709...
0.7042436
1
Will find the i,j of cell with utm coordinates x,y. The input is the layer you are interested in, the allowed values for k are [0,nz]. If the coordinates (x,y) are found to be outside the grid a ValueError exception is raised.
def findCellXY(self , x, y , k): if 0 <= k <= self.getNZ(): i = ctypes.c_int() j = ctypes.c_int() ok = self._get_ij_xy( x,y,k , ctypes.byref(i) , ctypes.byref(j)) if ok: return (i.value , j.value) else: raise ValueError(...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def find_cell( self , x , y , z , start_ijk = None):\n\n if start_ijk:\n start_index = self.__global_index( ijk = start_ijk )\n else:\n start_index = 0\n global_index = self._get_ijk_xyz( x , y , z , start_index)\n if global_index >= 0:\n i = ctypes.c_in...
[ "0.63163114", "0.6309335", "0.61713743", "0.6017499", "0.5768573", "0.57222867", "0.5700856", "0.56826043", "0.5657158", "0.5632853", "0.5626586", "0.56039524", "0.5587968", "0.5584937", "0.5584937", "0.5584937", "0.5544519", "0.55267566", "0.55147874", "0.5498938", "0.548606...
0.7422864
0
Will find the corner nr of corner closest to utm coordinates x,y. The input is the layer you are interested in, the allowed values for k are [0,nz]. If the coordinates (x,y) are found to be outside the grid a ValueError exception is raised.
def findCellCornerXY(self , x, y , k): i,j = self.findCellXY(x,y,k) if k == self.getNZ(): k -= 1 corner_shift = 4 else: corner_shift = 0 nx = self.getNX() x0,y0,z0 = self.getCellCorner( corner_shift , ijk = (i,j,k)) d0 = math.s...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def findCellXY(self , x, y , k):\n if 0 <= k <= self.getNZ():\n i = ctypes.c_int()\n j = ctypes.c_int()\n ok = self._get_ij_xy( x,y,k , ctypes.byref(i) , ctypes.byref(j))\n if ok:\n return (i.value , j.value)\n else:\n rais...
[ "0.6126895", "0.60942805", "0.59902865", "0.5941996", "0.57641095", "0.559557", "0.55891967", "0.55502415", "0.5548755", "0.55165607", "0.5490814", "0.5472218", "0.5468806", "0.5456647", "0.5424942", "0.5324604", "0.5322794", "0.52776706", "0.5259948", "0.52301705", "0.522965...
0.699358
0
Will return a tuple (dx,dy,dz) for cell dimension. The dx and dy values are best effor estimates of the cell size along the i and j directions respectively. The three values
def getCellDims(self , active_index = None , global_index = None , ijk = None): gi = self.__global_index( ijk = ijk , active_index = active_index , global_index = global_index ) dx = self._get_cell_dx( gi ) dy = self._get_cell_dy( gi ) dz = self._get_cell_thickness( gi ) return ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def cellsize_2d(self):\t\r\n return self.dx * self.dy", "def cell_dz( self , active_index = None , global_index = None , ijk = None):\n gi = self.__global_index( ijk = ijk , active_index = active_index , global_index = global_index )\n return self._get_cell_thickness( gi )", "def dz(self)...
[ "0.69722414", "0.6508007", "0.64366984", "0.60504264", "0.6036826", "0.600399", "0.5995232", "0.59840685", "0.5981503", "0.5959597", "0.5954673", "0.5930613", "0.5919213", "0.58766544", "0.5867574", "0.58416903", "0.5830659", "0.58156824", "0.58141303", "0.5770785", "0.573800...
0.7103264
0
Query if the grid has an LGR with name .
def has_lgr( self , lgr_name ): if self._has_lgr( lgr_name ): return True else: return False
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _is_occupied(\n grid: List[List[str]], row: int, col: int, dx: int, dy: int) -> bool:\n while 0 <= (row + dy) < len(grid) and 0 <= (col + dx) < len(grid[0]):\n row += dy\n col += dx\n if grid[row][col] == 'L':\n return False\n if grid[row][col] == '#':\n return True\n return False", ...
[ "0.61112547", "0.57133603", "0.56065786", "0.5493625", "0.54852134", "0.5471643", "0.5407397", "0.5407397", "0.53794944", "0.53548443", "0.5354632", "0.53347063", "0.52872145", "0.52827424", "0.5275375", "0.5262673", "0.52566737", "0.5246809", "0.5244999", "0.52418375", "0.52...
0.7519792
0
Get EclGrid instance with LGR content. Return an EclGrid instance based on the LGR named . The LGR grid instance is in most questions like an ordinary grid instance; the only difference is that it can not be used for further queries about LGRs. If the grid does not contain an LGR with this name the method will return N...
def get_lgr( self , lgr_name ): if self._has_lgr( lgr_name ): lgr = self._get_lgr( name ) lgr.setParent( self ) return lgr else: raise KeyError("No such LGR:%s" % lgr_name)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getGrid(self):\n\n\t\t\treturn self._logic.getGrid()", "def get_cell_lgr( self, active_index = None , global_index = None , ijk = None):\n gi = self.__global_index( ijk = ijk , active_index = active_index , global_index = global_index)\n lgr = self._get_cell_lgr( gi )\n if lgr:\n ...
[ "0.6133424", "0.5980499", "0.5965584", "0.59655136", "0.5924115", "0.5908138", "0.5881674", "0.5713956", "0.5583135", "0.54097676", "0.52644074", "0.52644074", "0.5248038", "0.52336603", "0.52278453", "0.52225953", "0.515064", "0.5137618", "0.51305234", "0.5071367", "0.506054...
0.6739804
0
Get EclGrid instance located in cell. Will query the current grid instance if the cell given by , or has been refined with an LGR. Will return None if the cell in question has not been refined, the return value can be used for further queries. See get_xyz() for documentation of the input parameters.
def get_cell_lgr( self, active_index = None , global_index = None , ijk = None): gi = self.__global_index( ijk = ijk , active_index = active_index , global_index = global_index) lgr = self._get_cell_lgr( gi ) if lgr: lgr.setParent( self ) return lgr else: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_cell(self, cell, dbg=False):\n a = b = 0\n try:\n a, b = self.__ret_cell(cell)\n if dbg:\n return self._grid[a][b], a, b\n else:\n return self._grid[a][b]\n except IndexError as e:\n self.perror(\"Error: '%s'.\" ...
[ "0.6090308", "0.60243547", "0.59928375", "0.59226567", "0.5912492", "0.58661693", "0.58586776", "0.5803431", "0.5781136", "0.57725286", "0.5739436", "0.5710825", "0.56304365", "0.5583593", "0.5551934", "0.5551149", "0.55327576", "0.5495326", "0.54909706", "0.54815984", "0.548...
0.6312405
0
Will evalute in location (,,). The ECLIPSE properties and solution vectors are stored in restart and init files as 1D vectors of length nxnxnz or nactive. The grid_value() method is a minor convenience function to convert the (,,) input values to an appropriate 1D index. Depending on the length of kw the input argument...
def grid_value( self , kw , i , j , k): return self._grid_value( kw , i , j , k)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def solve(grid):\n #setting the units\n values = grid_values(grid)\n #display(values)\n sol = search(values)\n return sol", "def solve(grid):\n values = grid_values(grid)\n \n values = search(values)\n\n return values", "def grid_values(*args):\n return GridValues(args)", "def e...
[ "0.58016324", "0.5538702", "0.5527784", "0.55101055", "0.54955435", "0.5486036", "0.5471686", "0.544268", "0.53674495", "0.53422844", "0.5341827", "0.5341827", "0.53167075", "0.5303801", "0.52493125", "0.5226353", "0.5225476", "0.5225476", "0.5201638", "0.5201638", "0.5194621...
0.67332304
0
Creates an EclKW instance based on existing 3D numpy object. The method create3D() does the inverse operation; creating a 3D numpy object from an EclKW instance. If the argument is true the resulting keyword will have length 'nactive', otherwise the element will have length nxnynz.
def createKW( self , array , kw_name , pack): if array.ndim == 3: dims = array.shape if dims[0] == self.getNX() and dims[1] == self.getNY() and dims[2] == self.getNZ(): dtype = array.dtype if dtype == numpy.int32: type = EclTypeEnum.ECL...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create3D( self , ecl_kw , default = 0):\n if len(ecl_kw) == self.getNumActive() or len(ecl_kw) == self.getGlobalSize():\n array = numpy.ones( [ self.getGlobalSize() ] , dtype = ecl_kw.dtype) * default\n kwa = ecl_kw.array\n if len(ecl_kw) == self.size:\n f...
[ "0.7482991", "0.59509605", "0.5510952", "0.5499722", "0.54056096", "0.52415323", "0.51461595", "0.51215535", "0.5113031", "0.51026446", "0.50913775", "0.5080292", "0.506541", "0.50582623", "0.50578034", "0.503252", "0.50322217", "0.50146544", "0.49972647", "0.49777192", "0.49...
0.6924006
1
Will return the number of coarse groups in this grid.
def coarse_groups(self): return self._num_coarse_groups( )
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def ngroups(self):\n return self._ngroups", "def getNumEnergyGroups(self):\n return self.lib.numGroups", "def getNumGrids(self):\n c = list(self.gridVars.keys())\n return len(list(self.gridVars[c[0]].values()))", "def getNumGroups(self):\n return len(np.unique(self._group_i...
[ "0.6764765", "0.65031046", "0.6454099", "0.64497554", "0.62625027", "0.6090639", "0.608471", "0.6063721", "0.60628855", "0.6060807", "0.6049989", "0.603716", "0.59877247", "0.59371305", "0.5924305", "0.5924305", "0.5873342", "0.5842059", "0.5803679", "0.58003265", "0.57772416...
0.8727954
0
Will return True or False if the cell is part of coarse group.
def in_coarse_group(self , global_index = None , ijk = None , active_index = None): global_index = self.__global_index( active_index = active_index , ijk = ijk , global_index = global_index) return self._in_coarse_group1( global_index )
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_clayey(self):\n group_index = self._data[SoilProperty.GI]\n return group_index[0] not in ['S','G']", "def coarse_groups(self):\n return self._num_coarse_groups( )", "def is_crossed(self):\n left_boundary_clusters = np.extract(self.cluster[0] > 0,\n ...
[ "0.63103396", "0.629997", "0.60771424", "0.6011075", "0.58738124", "0.58659416", "0.5851295", "0.5821069", "0.57979316", "0.57953095", "0.5793142", "0.57072425", "0.5687644", "0.56837296", "0.5677589", "0.5670765", "0.56575155", "0.56542456", "0.56453484", "0.56305254", "0.56...
0.63103807
0
Creates a 3D numpy array object with the data from . Observe that 3D numpy object is a copy of the data in the EclKW instance, i.e. modification to the numpy object will not be reflected in the ECLIPSE keyword. The methods createKW() does the inverse operation; creating an EclKW instance from a 3D numpy object.
def create3D( self , ecl_kw , default = 0): if len(ecl_kw) == self.getNumActive() or len(ecl_kw) == self.getGlobalSize(): array = numpy.ones( [ self.getGlobalSize() ] , dtype = ecl_kw.dtype) * default kwa = ecl_kw.array if len(ecl_kw) == self.size: for i in ra...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def createKW( self , array , kw_name , pack):\n if array.ndim == 3:\n dims = array.shape\n if dims[0] == self.getNX() and dims[1] == self.getNY() and dims[2] == self.getNZ():\n dtype = array.dtype\n if dtype == numpy.int32:\n type = EclT...
[ "0.72853476", "0.5536447", "0.548136", "0.5479699", "0.54082584", "0.53730893", "0.5352577", "0.5350692", "0.53032625", "0.5276474", "0.52748704", "0.5271365", "0.52682966", "0.5257674", "0.5239569", "0.520957", "0.52051854", "0.5195257", "0.51888484", "0.5175834", "0.5165416...
0.7509103
0
Will save the current grid as a EGRID file.
def save_EGRID( self , filename , output_unit = EclUnitTypeEnum.ERT_ECL_METRIC_UNITS): self._fwrite_EGRID2( filename, output_unit )
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def save_GRID( self , filename ):\n self._fwrite_GRID( filename )", "def save_grid(fname, grid):\n\twith open((\"%sGridFix\" % fname), 'w') as file_handler:\n\t for item in grid:\n\t file_handler.write(\"{}\\n\".format(item))\n\t pass\n # Return the name of the file\n\treturn (\"%sGri...
[ "0.8100519", "0.7128202", "0.6636067", "0.65955096", "0.6486249", "0.6424892", "0.6414643", "0.635306", "0.6349147", "0.6248159", "0.6176786", "0.6169242", "0.61596185", "0.6142453", "0.6125207", "0.6119916", "0.6115344", "0.611224", "0.6074905", "0.6066688", "0.60082483", ...
0.7662099
1
Will save the current grid as a EGRID file.
def save_GRID( self , filename ): self._fwrite_GRID( filename )
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def save_EGRID( self , filename , output_unit = EclUnitTypeEnum.ERT_ECL_METRIC_UNITS):\n self._fwrite_EGRID2( filename, output_unit )", "def save_grid(fname, grid):\n\twith open((\"%sGridFix\" % fname), 'w') as file_handler:\n\t for item in grid:\n\t file_handler.write(\"{}\\n\".format(item))\n\...
[ "0.7662099", "0.7128202", "0.6636067", "0.65955096", "0.6486249", "0.6424892", "0.6414643", "0.635306", "0.6349147", "0.6248159", "0.6176786", "0.6169242", "0.61596185", "0.6142453", "0.6125207", "0.6119916", "0.6115344", "0.611224", "0.6074905", "0.6066688", "0.60082483", ...
0.8100519
0
Writes an EclKW instance as an ECLIPSE grdecl formatted file. The input argument must be an EclKW instance of size nactive or nxnynz. If the size is nactive the inactive cells will be filled with ; hence the function will always write nxnynz elements. The data in the argument can be of type integer, float, double or bo...
def write_grdecl( self , ecl_kw , pyfile , special_header = None , default_value = 0): if len(ecl_kw) == self.getNumActive() or len(ecl_kw) == self.getGlobalSize(): cfile = CFILE( pyfile ) self._fwrite_grdecl( ecl_kw , special_header , cfile , default_value ) else: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def save_grdecl(self , pyfile):\n cfile = CFILE( pyfile )\n self._fprintf_grdecl( cfile )", "def exportECL(self, fname):\r\n\r\n # TODO add consistency of dimensions across the inputs\r\n self.ne, self.nn, self.nz = np.array(self.Grid.GetDimensions()) - 1 # ECLIPSE\r\n filenam...
[ "0.6520951", "0.6063423", "0.57705635", "0.53065544", "0.5199533", "0.51919234", "0.51606506", "0.5131439", "0.5114998", "0.5106586", "0.5006485", "0.49765608", "0.49460092", "0.4878289", "0.48778144", "0.48677453", "0.48314908", "0.48107162", "0.4794123", "0.4792132", "0.479...
0.82842046
0
Invalid module names raise Exceptions.
def test_invalid_module_names(self): self.assertRaises(ValueError, Module, '') self.assertRaises(ValueError, Module, 'names-with-dashes') self.assertRaises(ValueError, Module, 'names with spaces') self.assertRaises(ValueError, Module, 'names.with,punctuations!') self.assertRaises...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_normal_module_name(assert_errors, filename, default_options):\n visitor = WrongModuleNameVisitor(default_options, filename=filename)\n visitor.run()\n\n assert_errors(visitor, [])", "def test_broken_error_module(self):\r\n with self.assertRaises(TestException):\r\n module = se...
[ "0.70322967", "0.68136823", "0.657802", "0.6511772", "0.64713454", "0.64292055", "0.6387931", "0.6375257", "0.6323564", "0.6284643", "0.62667674", "0.6255107", "0.61453974", "0.6095324", "0.6056169", "0.6034116", "0.60115004", "0.60109293", "0.598281", "0.59621185", "0.594186...
0.8091457
0
Modules can be initialized with strings.
def test_module_initialization(self): m = Module('foo') assert str(m) == 'foo' m = Module('foo.bar') assert str(m) == 'foo.bar' m = Module('foo.bar.qux') assert str(m) == 'foo.bar.qux'
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def modules():", "def __init__(self):\n self.modules = {}", "def __init__(self, name):\r\n super(Module, self).__init__()\r\n self.name = name", "def __init__(self, name):\n super(Module, self).__init__()\n self.name = name", "def setModule(name, module):", "def __init_...
[ "0.67689395", "0.6621376", "0.656986", "0.6532882", "0.6476829", "0.6445392", "0.6406558", "0.636682", "0.6138554", "0.61111265", "0.61097723", "0.6005294", "0.5972358", "0.5972358", "0.5923163", "0.58846354", "0.58816534", "0.5881171", "0.58698267", "0.5860582", "0.58604735"...
0.73997223
0
Deploy the contents of `BUILD_DIR` to Netlify, using `NETLIFY_SITE_ID` and `NETLIFY_API_TOKEN` if available.
def deploy(self): netlify_cli = getattr(settings, "NETLIFY_PATH", None) if not netlify_cli: raise CommandError("NETLIFY_PATH is not defined in settings") deployment = Deployment() deployment.save() command = [netlify_cli, "deploy"] command.append("--dir={}"...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def deploy():\n build()\n collect()\n commit()\n push()", "def deploy():\n\n project_dir = '/home/gastosabertos/gastos_abertos_website'\n with cd(project_dir):\n local('tar -cvzf build.tar.gz build')\n run('cp -r build build-old')\n put('build.tar.gz', '.')\n run('ta...
[ "0.6667937", "0.6642163", "0.66397226", "0.63277745", "0.6307375", "0.6095078", "0.6087253", "0.6028257", "0.6025697", "0.6015445", "0.59656906", "0.5894895", "0.587419", "0.5867786", "0.57129294", "0.5681408", "0.56705046", "0.56375337", "0.56278193", "0.5605738", "0.5603289...
0.7264105
0
Add Jacchia 1977 empirical corrections to [O] and [O2].
def _O_and_O2_correction(self, alt): _O_and_O2_correction_fast(alt, self.Texo)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def water_correction_energies(fname, se_h2o_hof, se_h_hof, ref_h2o_ener,\n se_au=False, ref_au=True):\n check_for_keys(fname, REFEK, NATMK, SEEK)\n with h5.File(fname, 'r') as ifi:\n # This calculates the reference heat of formation\n # Note the reference is assumed...
[ "0.5400359", "0.537652", "0.537189", "0.5369304", "0.5282336", "0.52555615", "0.5243372", "0.5148587", "0.51211125", "0.5108739", "0.5108302", "0.5104019", "0.5102798", "0.5083969", "0.5044422", "0.50319", "0.498012", "0.49792227", "0.49786368", "0.49592388", "0.4957492", "...
0.60554034
0
Show the power of battery
def describe_battery(self): print(f"The power of battery is - {self.battery_size}-kWh")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def describe_battery(self):\r\n\t\tprint(\"This car has a \" + str(self.battery_size) + \"-kWh battery.\")", "def describe_battery(self):\r\n print(\"This car has a \" + str(self.battery_size) + \"-kWh battery.\")", "def describe_battery(self):\n print(\"Ten samochod ma akumulator o pojemnosci \"...
[ "0.764002", "0.7595747", "0.7550925", "0.7534905", "0.7534905", "0.7534905", "0.7534905", "0.7534905", "0.7534905", "0.7509543", "0.7422574", "0.7422574", "0.7422574", "0.7403888", "0.7403453", "0.7190697", "0.71666986", "0.7127265", "0.6908638", "0.6851342", "0.6814892", "...
0.8015619
0
Chek and set the battery size
def upgrade_battery(self): if self.battery_size <= 75: self.battery_size = 100
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def upgrade_battery(self):\n if self.battery_size != 100:\n self.battery_size = 100", "def upgrade_battery(self):\n if self.battery_size < 85:\n print(\"Upgrading battery size in progress.\")\n self.battery_size = 85\n else:\n print(\"Battery size ...
[ "0.7852364", "0.7556952", "0.72916096", "0.7285516", "0.7285516", "0.7273139", "0.7273139", "0.7273139", "0.7238471", "0.7235647", "0.7093763", "0.70713466", "0.6882216", "0.67099327", "0.6617052", "0.65214", "0.64824754", "0.6475698", "0.6475698", "0.6475698", "0.6475698", ...
0.79119164
0
This is the class constructor. It requests the username and password. If a connection to the cloud database can be established for the username and password, then it checks whether the user has the priviledge to create the database or insert new data. This priviledge will open additional options in the main menu. The u...
def __init__(self): # Standard tools that allow a user to enter a password without any text # displayed on the screen. import getpass # The user will have three opportunities to enter their username and password. # If successful, a boolean variable is set to true and the...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self, username, password, db_file=None):\n self.logger = logging.getLogger('pyragarga.Pyragarga')\n self._database = None\n if db_file:\n self.enable_db(db_file)\n self._session = requests.session()\n self._session.post(KG_URL + LOGIN_SCRIPT,\n ...
[ "0.6977395", "0.6778311", "0.6732263", "0.672914", "0.6667451", "0.66476744", "0.6609962", "0.6582779", "0.6526893", "0.6486139", "0.6459199", "0.6423249", "0.64199483", "0.6390175", "0.63895506", "0.634812", "0.63453716", "0.63385814", "0.63188916", "0.63105637", "0.6264708"...
0.6830924
1
This attribute tests the connection to the database. It is mostly used in debugging. For now, there is an option in the main menu to test the connection. If the attribute can connect to the database and query the list of tables, it will return the list of tables in the database. If a mariadb exception occurs, it will r...
def test(self): # Establish connection and execute a query that returns # a table with the names of each table in the database. # Close the connection. Convert the table to a list and # return it. try: Connection = mariadb.connect( ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def testDatabase(self):\n con = self.getMetadataDatabaseConnection()\n if con:\n return True", "def test_database_connection(self):\n\t\t\n\t\tself.assertTrue(database.connect())", "def test_004_connect(self):\n HEADING()\n self.db.connect()\n\n result = True\n ...
[ "0.6990052", "0.6902803", "0.6520851", "0.6482434", "0.6388653", "0.63614976", "0.6319599", "0.62959796", "0.6262326", "0.6209179", "0.61443245", "0.61433625", "0.60929066", "0.60791105", "0.60245323", "0.6016008", "0.59738386", "0.5869316", "0.5864464", "0.5805988", "0.57900...
0.74820626
0
Return the wait time multiplied by the quickest bus ID.
def get_quickest_bus(departure_time: int, buses: List[int]) -> int: quickest_bus = sorted(buses, key=lambda x: get_wait_time(departure_time, x), reverse=False)[0] return get_wait_time(departure_time, quickest_bus) * quickest_bus
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def wait(bus, timestamp):\n\treturn (bus - (timestamp % bus)) % bus", "def part1() -> int:\n longest_sleeper = max(sleep_times, key=lambda g: len(sleep_times[g]))\n sleepiest_minute = max(\n sleep_times[longest_sleeper], key=sleep_times[longest_sleeper].count)\n\n return longest_sleeper * sleepie...
[ "0.6823249", "0.6669374", "0.660172", "0.6395295", "0.6350145", "0.62678856", "0.6054506", "0.6011937", "0.5985268", "0.59784275", "0.59142697", "0.58659416", "0.58637136", "0.58592594", "0.5832436", "0.582941", "0.582941", "0.582941", "0.582941", "0.582941", "0.582941", "0...
0.67769605
1
Install datasets for retriever.
def _install(args, use_cache, debug): engine = choose_engine(args) engine.use_cache = use_cache if args['dataset'].endswith('.zip') or args.get('hash_value'): path_to_archive = args['dataset'] if args.get('hash_value'): path_to_archive = os.path.join( PROVENANCE_...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def install():\n ArticleDataProvider.register()\n ProductDataProvider.register()", "def task_installTestData(self):\n if env.get('environment') == 'production':\n abort(\"Don't use installTestData in production.\")\n\n if postgres.tableExists('trac', 'system'):\n abort(\"E...
[ "0.64824706", "0.62990665", "0.62516385", "0.62516385", "0.62441695", "0.6194383", "0.6147018", "0.6111253", "0.60733217", "0.6066709", "0.6036118", "0.60200125", "0.5941362", "0.5941362", "0.5929711", "0.5899112", "0.5832342", "0.58091074", "0.58081496", "0.58072793", "0.578...
0.6306677
1
Install datasets into mysql.
def install_mysql(dataset, user='root', password='', host='localhost', port=3306, database_name='{db}', table_name='{db}.{table}', debug=False, use_cache=True, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def setup_mysql():\n with lcd(env.projectroot):\n put(\"manage/sysconf/%(target)s/mysql/setup-mysql.sql\" % env, \"/tmp\")\n #sudo(\"mysql -u root -p < /tmp/setup-mysql.sql\")\n sudo(\"mysql -u root < /tmp/setup-mysql.sql\")", "def setup_database():\n from django.core.management import...
[ "0.643989", "0.62512773", "0.6188407", "0.5927646", "0.5920215", "0.5827072", "0.57705396", "0.5708299", "0.56744295", "0.56740564", "0.5666191", "0.56248426", "0.56166804", "0.56147426", "0.5608201", "0.5588403", "0.55595106", "0.55533975", "0.5551925", "0.55481184", "0.5547...
0.6979793
0
Install datasets into postgres.
def install_postgres(dataset, user='postgres', password='', host='localhost', port=5432, database='postgres', database_name='{db}', table_name='{db}.{table}', ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def task_installTestData(self):\n if env.get('environment') == 'production':\n abort(\"Don't use installTestData in production.\")\n\n if postgres.tableExists('trac', 'system'):\n abort(\"Existing Trac tables found.\")\n\n with settings(user=self.serviceUser):\n ...
[ "0.67101014", "0.65121603", "0.6294656", "0.62906325", "0.6240764", "0.6184617", "0.6175147", "0.60847354", "0.6074436", "0.60625094", "0.6056598", "0.6044377", "0.6042259", "0.6034427", "0.6003979", "0.59687144", "0.59366", "0.5833422", "0.5800394", "0.5787577", "0.575593", ...
0.7324537
0
Install datasets into msaccess.
def install_msaccess(dataset, file='access.mdb', table_name='[{db} {table}]', data_dir=DATA_DIR, debug=False, use_cache=True, force=False, hash_value=None): args = { ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _install(args, use_cache, debug):\n engine = choose_engine(args)\n engine.use_cache = use_cache\n\n if args['dataset'].endswith('.zip') or args.get('hash_value'):\n path_to_archive = args['dataset']\n if args.get('hash_value'):\n path_to_archive = os.path.join(\n ...
[ "0.5937385", "0.58411247", "0.5744515", "0.5672274", "0.56464726", "0.56296736", "0.5511215", "0.54886913", "0.54392475", "0.54213166", "0.5409287", "0.5405523", "0.53193307", "0.5306803", "0.5306803", "0.5288545", "0.5281527", "0.5243119", "0.52429676", "0.5222793", "0.52196...
0.6459073
0
Install datasets into json.
def install_json(dataset, table_name='{db}_{table}.json', data_dir=DATA_DIR, debug=False, use_cache=True, pretty=False, force=False, hash_value=None): args = { 'command': 'install', ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def main():\n os.makedirs(PATH)\n fetch_data()\n convert_to_json(model_list, 'models.json', is_model=True)\n convert_to_json(backend_list, 'backends.json')\n convert_to_json(type_list, 'types.json')\n convert_to_json(featurizer_list, 'featurizers.json')", "def setup(self):\n in_dataset, ...
[ "0.6195561", "0.6150888", "0.61424214", "0.60152555", "0.5971217", "0.59472746", "0.5840958", "0.58245456", "0.58092654", "0.58033806", "0.57662797", "0.5756459", "0.5742945", "0.57381874", "0.5732792", "0.5702144", "0.5700371", "0.5700371", "0.5693736", "0.56893134", "0.5635...
0.6503668
0
Install datasets into hdf5.
def install_hdf5(dataset, file='hdf5.h5', table_name='{db}_{table}', data_dir=DATA_DIR, debug=False, use_cache=True, hash_value=None): args = { 'command': 'install', 'dataset': dataset, 'eng...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def generate_data(self):\n self.remove_hdf5_file()\n hdf5_handler = self.create_hdf5_file()\n self.populate_hdf5_file(hdf5_handler, self.dataset)", "def setup(self):\n in_dataset, out_dataset = self.get_datasets()\n \n out_dataset[0].create_dataset(in_dataset[0])\n\n in...
[ "0.65313053", "0.6297535", "0.6233249", "0.62266046", "0.6179072", "0.6178218", "0.6154918", "0.6144979", "0.6131246", "0.61283696", "0.61283696", "0.60190755", "0.5967659", "0.59319526", "0.58979344", "0.5892333", "0.5878183", "0.58725953", "0.5870886", "0.5807656", "0.56866...
0.65487957
0
Convert python permissions to AWS API permissions The permissions model for the API makes more sense for a web service but is overly verbose for working with in Python. This and the setter allow transforming to/from the API syntax. The python code should consume the allowed_groups and allowed_users lists directly.
def aws_permissions(self): perms = [] for g in self.allowed_groups: perms.append({"Group": g}) for i in self.allowed_users: perms.append({"UserId": i}) return perms
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def aws_permissions(self, perms):\n for perm in perms:\n group = perm.get(\"Group\")\n if group:\n self.allowed_groups.append(group)\n\n user = perm.get(\"UserId\")\n if user:\n self.allowed_users.append(user)", "def set_permissions...
[ "0.63265866", "0.57607347", "0.5758299", "0.57271314", "0.57171214", "0.57127684", "0.5686844", "0.5601842", "0.5593251", "0.55737066", "0.5557996", "0.5557996", "0.55541414", "0.5542022", "0.5542022", "0.5533457", "0.5517421", "0.55076104", "0.5475774", "0.5434879", "0.54319...
0.64832705
0
Find the root of the repo, which contains a .git folder
def find_repo_root(): path = os.getcwd() while ".git" not in set(os.listdir(path)) and path != "/": path = os.path.dirname(path) if path == "/": raise Exception("No repo found, stopping at /") return path
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def repo_root() -> str:\n path = os.path.realpath(os.curdir)\n\n while True:\n if os.path.exists(os.path.join(path, \"setup.py\")):\n return path\n path = os.path.realpath(os.path.join(path, \"..\"))", "def get_git_root():\n path = os.getcwd()\n git_repo = git.Repo(path, sear...
[ "0.8146076", "0.81069934", "0.79744226", "0.7808931", "0.773586", "0.76759857", "0.7481751", "0.74334836", "0.73678917", "0.7341794", "0.73145497", "0.72178036", "0.71953976", "0.7154531", "0.7116067", "0.70113045", "0.6963013", "0.6949734", "0.69328886", "0.67888033", "0.677...
0.89188886
0
Do all the relevant response 1D and 2D hists, for one eta bin. Can optionally impose maximum pt cut on L1 jets (to avoid problems with saturation), and on number of PU vertices.
def plot_checks(inputfile, outputfile, absetamin, absetamax, max_pt, pu_min, pu_max): print "Doing eta bin: %g - %g, max L1 jet pt: %g" % (absetamin, absetamax, max_pt) # Input tree tree_raw = inputfile.Get("valid") # Output folders output_f = outputfile.mkdir('eta_%g_%g' % (absetamin, absetamax)...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def plot_rsp_eta(inputfile, outputfile, eta_bins, pt_min, pt_max, pt_var, pu_min, pu_max):\n\n gr_rsp_eta = ROOT.TGraphErrors()\n\n # Input tree\n tree_raw = inputfile.Get(\"valid\")\n\n # Output folders\n output_f = outputfile.GetDirectory('eta_%g_%g' % (eta_bins[0], eta_bins[-1]))\n output_f_hi...
[ "0.57946926", "0.54707724", "0.5410318", "0.5387399", "0.53183043", "0.5195197", "0.51609874", "0.5160073", "0.511659", "0.5098509", "0.5075455", "0.5061853", "0.5058991", "0.5058988", "0.5052867", "0.5048729", "0.5021096", "0.4992996", "0.496611", "0.49569523", "0.49510986",...
0.61818737
0
Plot graph of response in bins of eta If the response hist for each bin exists already, then we use that. If not, we make the hist. pt_min and pt_max are so that the graph can be made for a given pt interval pt_var is the variable to bin on (pt or ptRef)
def plot_rsp_eta(inputfile, outputfile, eta_bins, pt_min, pt_max, pt_var, pu_min, pu_max): gr_rsp_eta = ROOT.TGraphErrors() # Input tree tree_raw = inputfile.Get("valid") # Output folders output_f = outputfile.GetDirectory('eta_%g_%g' % (eta_bins[0], eta_bins[-1])) output_f_hists = None i...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_pt_hist(hist, binning, binning_uflow, pt_bin_edges, pt_bin_edges_uflow, variable_bin_edges):\n # THIS IS A HORRIBLE HACK BECAUSE I DIDNT FILL MY HISTS\n all_pt_bins = list(np.append(pt_bin_edges_uflow[:-1], pt_bin_edges))\n all_pt_bins.append(8000)\n # print(all_pt_bins)\n nbins_pt = len(...
[ "0.6409904", "0.6375965", "0.6235954", "0.5931041", "0.58610284", "0.5844425", "0.58327806", "0.58259004", "0.5734927", "0.57153136", "0.57044625", "0.56913066", "0.5640836", "0.5631618", "0.56309974", "0.56043017", "0.55923885", "0.5573512", "0.5562074", "0.5520641", "0.5503...
0.7293212
0
Find peak of hist, check against fitted gaus
def check_gaus_fit(hist): s = ROOT.TSpectrum(1) s.Search(hist, 1, "new") peaks_buff = s.GetPositionX() x_peak = peaks_buff[0] return (abs(hist.GetFunction('gaus').GetParameter(1) - x_peak) / abs(x_peak)) < 0.1
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def hist_peak_search(hist, bins):\n\n ix = peakutils.indexes(-hist, thres = 0.15/max(-hist), min_dist = 2)\n peaks = list(bins[list(ix)])\n\n return peaks", "def getFirstVallay(hist):\n hist = smooth(hist)\n safe_range = (len(hist)//100, len(hist)//4)\n start = max(int(round(np.argmax(hist[:int...
[ "0.6847167", "0.65728945", "0.65421", "0.6399944", "0.6385045", "0.6322003", "0.6320446", "0.61476105", "0.6143559", "0.6129745", "0.6124224", "0.6073451", "0.60435104", "0.59944385", "0.5978126", "0.59742147", "0.59578466", "0.59361404", "0.59117126", "0.5847243", "0.58335",...
0.7401598
0
Make a graph of response Vs pt for given eta bin pt_var allows the user to specify which pT to bin in & plot against. Should be the name of a variable in the tree pt_max is a cut on maxmimum value of pt (applied to l1 pt to avoid including saturation effects)
def plot_rsp_pt(inputfile, outputfile, absetamin, absetamax, pt_bins, pt_var, pt_max, pu_min, pu_max): # Input tree tree_raw = inputfile.Get("valid") # Output folders output_f = outputfile.GetDirectory('eta_%g_%g' % (absetamin, absetamax)) output_f_hists = None if not output_f: output_...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def plot_rsp_eta(inputfile, outputfile, eta_bins, pt_min, pt_max, pt_var, pu_min, pu_max):\n\n gr_rsp_eta = ROOT.TGraphErrors()\n\n # Input tree\n tree_raw = inputfile.Get(\"valid\")\n\n # Output folders\n output_f = outputfile.GetDirectory('eta_%g_%g' % (eta_bins[0], eta_bins[-1]))\n output_f_hi...
[ "0.73201025", "0.62735224", "0.60859984", "0.5668642", "0.5492072", "0.513802", "0.49961162", "0.49354777", "0.48562816", "0.4804888", "0.4779778", "0.47651786", "0.4745427", "0.47441676", "0.47035292", "0.46883026", "0.4685897", "0.46459523", "0.46423784", "0.46298364", "0.4...
0.7351307
0
A loading pattern that just prints '.' to the terminal
def default_loading_pattern(stream_writer: Optional[StreamWriter] = None, loading_pattern_rate: float = 0.5) -> None: stream_writer = stream_writer or StreamWriter(sys.stderr) stream_writer.write_str(".") stream_writer.flush() sleep(loading_pattern_rate)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def loading(delay):\r\n\r\n for i in range(3):\r\n\r\n print \".\",\r\n sys.stdout.flush()\r\n time.sleep(delay)\r\n\r\n print(\"\")", "def dot():\n print_message(\".\")", "def dot():\n\n sys.stdout.write('.')\n sys.stdout.flush()", "def animate():\...
[ "0.63691044", "0.6325998", "0.63179594", "0.5760462", "0.57490486", "0.57462436", "0.55643755", "0.5487015", "0.5447725", "0.53625304", "0.5229726", "0.52093977", "0.51824206", "0.5179551", "0.5173894", "0.5169528", "0.5149935", "0.5124151", "0.5117392", "0.5044035", "0.49932...
0.639237
0
Wrapper for Popen to asynchronously invoke a subprocess while printing a given pattern until the subprocess is complete. If the log level is lower than INFO, stream the process stdout instead.
def invoke_subprocess_with_loading_pattern( command_args: Dict[str, Any], loading_pattern: Callable[[StreamWriter], None] = default_loading_pattern, stream_writer: Optional[StreamWriter] = None, ) -> Optional[Union[str, bytes]]: stream_writer = stream_writer or StreamWriter(sys.stderr) process_outpu...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def non_blocking_streamlit(process: psutil.Popen) -> None:\n while process.is_running():\n process.communicate()", "def _dumpStdout(self, p, outputCallback):\n while p.poll() is None:\n try:\n # May raise IOError if in non-blocking mode\n l = p.stdout.rea...
[ "0.5985993", "0.58647025", "0.57697845", "0.5740654", "0.5580448", "0.5571762", "0.5541012", "0.551508", "0.54873276", "0.54817224", "0.5456601", "0.5406513", "0.53827673", "0.53788185", "0.53719383", "0.5362436", "0.53304255", "0.5301103", "0.52810025", "0.52699345", "0.5263...
0.6803606
0
convert the naslib representation to Genotype
def convert_naslib_to_genotype(naslib_object): ops_to_genotype = { "Identity": "skip_connect", "FactorizedReduce": "skip_connect", "SepConv3x3": "sep_conv_3x3", "DilConv3x3": "dil_conv_3x3", "SepConv5x5": "sep_conv_5x5", "DilConv5x5": "dil_conv_5x5", "AvgPool"...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def fromgenotype(self):\n\t\tpass", "def convert_genotype_to_naslib(genotype, naslib_object):\n genotype_to_ops = {\n \"skip_connect\": (\"Identity\", \"FactorizedReduce\"),\n \"sep_conv_3x3\": \"SepConv3x3\",\n \"dil_conv_3x3\": \"DilConv3x3\",\n \"sep_conv_5x5\": \"SepConv5x5\",\...
[ "0.70927507", "0.6866326", "0.6093907", "0.60476726", "0.59363604", "0.5803049", "0.56443554", "0.56211126", "0.5610469", "0.560769", "0.556792", "0.55300146", "0.5503267", "0.5429665", "0.53932387", "0.5378378", "0.5329879", "0.53253955", "0.5294454", "0.5262527", "0.5240897...
0.7562564
0
Converts the genotype representation to a naslib object
def convert_genotype_to_naslib(genotype, naslib_object): genotype_to_ops = { "skip_connect": ("Identity", "FactorizedReduce"), "sep_conv_3x3": "SepConv3x3", "dil_conv_3x3": "DilConv3x3", "sep_conv_5x5": "SepConv5x5", "dil_conv_5x5": "DilConv5x5", "avg_pool_3x3": "AvgP...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def convert_naslib_to_genotype(naslib_object):\n ops_to_genotype = {\n \"Identity\": \"skip_connect\",\n \"FactorizedReduce\": \"skip_connect\",\n \"SepConv3x3\": \"sep_conv_3x3\",\n \"DilConv3x3\": \"dil_conv_3x3\",\n \"SepConv5x5\": \"sep_conv_5x5\",\n \"DilConv5x5\":...
[ "0.76223373", "0.6980172", "0.54658943", "0.5373541", "0.5373159", "0.52955455", "0.5285364", "0.5245461", "0.5245001", "0.5129519", "0.50936586", "0.50587034", "0.5043617", "0.5033558", "0.49881056", "0.49753153", "0.49664342", "0.4957352", "0.4957352", "0.4950104", "0.49459...
0.74750704
1
Converts a DARTS genotype to a configspace instance dictionary
def convert_genotype_to_config(genotype): base_string = "NetworkSelectorDatasetInfo:darts:" config = {} for cell_type in ["normal", "reduce"]: cell = eval("genotype." + cell_type) start = 0 n = 2 for node_idx in range(4): end = start + n ops = cell[2...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def convert_genotype_to_config(arch):\n base_string = 'NetworkSelectorDatasetInfo:darts:'\n config = {}\n\n for cell_type in ['normal', 'reduce']:\n cell = eval('arch.' + cell_type)\n\n start = 0\n n = 2\n for node_idx in range(4):\n end = start + n\n ops ...
[ "0.6081296", "0.594875", "0.5933283", "0.59265006", "0.5880599", "0.5727958", "0.56083965", "0.5581696", "0.5487566", "0.54197836", "0.54093397", "0.5381316", "0.5303956", "0.5295256", "0.5283128", "0.52108383", "0.5208851", "0.51883763", "0.5169774", "0.5140319", "0.51316565...
0.6325953
0
Converts a configspace instance dictionary to a DARTS genotype
def convert_config_to_genotype(config): base_string = "NetworkSelectorDatasetInfo:darts:" genotype = [] for i, cell_type in enumerate(["normal", "reduce"]): genotype.append([]) start = 0 n = 2 for node_idx in range(4): end = start + n # print(start, e...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_configuration(self):\n space = Space()\n space.register(Integer(\"yolo1\", \"uniform\", -3, 6, shape=(2,)))\n space.register(Integer(\"yolo2\", \"uniform\", -3, 6, shape=(2,)))\n space.register(Real(\"yolo3\", \"norm\", 0.9))\n space.register(Categorical(\"yolo4\", (\"as...
[ "0.5696881", "0.5341971", "0.5267143", "0.52451855", "0.52086383", "0.5163825", "0.510316", "0.5082286", "0.5014554", "0.49936697", "0.49704665", "0.49327058", "0.4817968", "0.47674105", "0.47186384", "0.47139776", "0.4705163", "0.4680166", "0.4668757", "0.46615347", "0.46294...
0.60542524
0
Converts Genotype to the compact representation
def convert_genotype_to_compact(genotype): OPS = [ "max_pool_3x3", "avg_pool_3x3", "skip_connect", "sep_conv_3x3", "sep_conv_5x5", "dil_conv_3x3", "dil_conv_5x5", ] compact = [] for i, cell_type in enumerate(["normal", "reduce"]): cell = e...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def convert_compact_to_genotype(compact):\n OPS = [\n \"max_pool_3x3\",\n \"avg_pool_3x3\",\n \"skip_connect\",\n \"sep_conv_3x3\",\n \"sep_conv_5x5\",\n \"dil_conv_3x3\",\n \"dil_conv_5x5\",\n ]\n genotype = []\n\n for i in range(2):\n cell = com...
[ "0.6532562", "0.5913489", "0.57653874", "0.561887", "0.54874766", "0.54294086", "0.5336293", "0.52914166", "0.5279694", "0.5225547", "0.5195389", "0.5188905", "0.5179097", "0.51273793", "0.5098214", "0.50762075", "0.5054869", "0.5048605", "0.5029797", "0.5024353", "0.50183964...
0.7310524
0
Converts the compact representation to a Genotype
def convert_compact_to_genotype(compact): OPS = [ "max_pool_3x3", "avg_pool_3x3", "skip_connect", "sep_conv_3x3", "sep_conv_5x5", "dil_conv_3x3", "dil_conv_5x5", ] genotype = [] for i in range(2): cell = compact[i] genotype.append(...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def convert_genotype_to_compact(genotype):\n OPS = [\n \"max_pool_3x3\",\n \"avg_pool_3x3\",\n \"skip_connect\",\n \"sep_conv_3x3\",\n \"sep_conv_5x5\",\n \"dil_conv_3x3\",\n \"dil_conv_5x5\",\n ]\n compact = []\n\n for i, cell_type in enumerate([\"norma...
[ "0.6472279", "0.6390739", "0.5686235", "0.5626062", "0.56175274", "0.5533054", "0.5452725", "0.53005815", "0.5274307", "0.5267956", "0.5214343", "0.51300037", "0.5117317", "0.5101243", "0.5099853", "0.5059417", "0.50422156", "0.50226486", "0.50093687", "0.49619627", "0.495871...
0.69796747
0
Dump coordinates of a geometry in the same order as data packing
def dump_coords(geom): # -> Any | list[Unknown]: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def coords_to_structure(self) -> None:\n ...", "def __dump_point(obj, big_endian):\n wkb_string = b''\n\n if big_endian:\n wkb_string += BIG_ENDIAN\n else:\n wkb_string += LITTLE_ENDIAN\n\n coords = obj['coordinates']\n num_dims = len(coords)\n if num_dims == 2:\n ty...
[ "0.66817063", "0.65917444", "0.644076", "0.64272916", "0.6338845", "0.620574", "0.61719364", "0.60670024", "0.6045421", "0.5986626", "0.5952752", "0.59344923", "0.59212697", "0.58783215", "0.58656347", "0.58263856", "0.58222085", "0.5821016", "0.5802443", "0.5800428", "0.5793...
0.786923
0
Helper function for geos__from_py functions in each geom type. If a create_func is specified the coodinate sequence is cloned and a new geometry is created with it, otherwise the geometry is cloned directly. This behaviour is useful for converting between LineString and LinearRing objects.
def geos_geom_from_py(ob, create_func=...): # -> tuple[Any | Unknown, Unknown]: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def convertor(geometry, method=\"wgs2gcj\"):\n if geometry['type'] == 'Point':\n coords = geometry['coordinates']\n coords[0], coords[1] = methods[method](coords[0], coords[1])\n elif geometry['type'] == 'LineString' or geometry['type'] == 'MutliPoint':\n coordinates = geometry['coordina...
[ "0.6204362", "0.5892721", "0.5733347", "0.5654594", "0.5577481", "0.52522194", "0.5130786", "0.5058003", "0.50202096", "0.5018276", "0.49738002", "0.4966857", "0.49666315", "0.4957779", "0.48849624", "0.48557302", "0.48483503", "0.48371914", "0.48297095", "0.48190808", "0.481...
0.7071003
0
Decorator which helps avoid GEOS operations on null pointers.
def exceptNull(func): # -> (*args: Unknown, **kwargs: Unknown) -> Unknown: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def enable_null_tracking(*args, **kwargs): # real signature unknown\n pass", "def null(cls):\n return cls(*[Point.origin() for i in range(2)])", "def nulltest():", "def pass_null(func):\n\n def wrapper(obj, *args, **kwargs):\n if not obj:\n return obj\n return func(obj, ...
[ "0.573325", "0.56983113", "0.5669062", "0.5669048", "0.55313367", "0.5461798", "0.5193316", "0.51848453", "0.5162868", "0.5157472", "0.5082548", "0.5073737", "0.5057937", "0.5054257", "0.5050019", "0.5043085", "0.50347704", "0.501953", "0.50131", "0.4963259", "0.49362338", ...
0.57892126
0
Provide the Numpy array protocol.
def __array_interface__(self): ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __array__(self, *args, **kwargs):\n\n return self.data", "def __array__(self):\n return np.asarray(self.data)", "def array(self):", "def __array__(self):\n return np.zeros(self.shape, self.dtype)", "def __array__(self):\n return self.array", "def tonumpy(self):\n import...
[ "0.6984412", "0.68687886", "0.6676552", "0.6667087", "0.66398215", "0.6637101", "0.6610455", "0.65973616", "0.6503999", "0.6497078", "0.64307505", "0.6386554", "0.63856333", "0.63472104", "0.6298814", "0.62879676", "0.6276794", "0.62321687", "0.6229774", "0.62225384", "0.6192...
0.7552204
0
WKB representation of the geometry
def wkb(self): # -> bytes: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def wkb_hex(self): # -> str:\n ...", "def as_ewkb(self) -> ir.BinaryValue:\n return ops.GeoAsEWKB(self).to_expr()", "def to_wkb(self):\n return _property_op(lambda x: x, self)", "def geometry(self):\n return self._geometry", "def geometry(self):\n return self._geometry",...
[ "0.6447294", "0.6303592", "0.62818676", "0.62680125", "0.62680125", "0.6183954", "0.615516", "0.615516", "0.6141851", "0.61130995", "0.6106607", "0.6060641", "0.60426927", "0.59896225", "0.5929752", "0.58390784", "0.57963085", "0.57863003", "0.5744317", "0.57364625", "0.56908...
0.67043364
0
WKB hex representation of the geometry
def wkb_hex(self): # -> str: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def hex_str (self):\n return \"#%02X%02X%02X\"%(self.r, self.g, self.b)", "def getquoted(self):\n if self.is_geometry:\n # Psycopg will figure out whether to use E'\\\\000' or '\\000'.\n return b\"%s(%s)\" % (\n b\"ST_GeogFromWKB\" if self.geography else b\"ST_G...
[ "0.65884876", "0.6582219", "0.636124", "0.61333066", "0.6064004", "0.5988412", "0.59239453", "0.5870547", "0.58452266", "0.58219653", "0.58061785", "0.5790033", "0.57587856", "0.5756235", "0.5752591", "0.57401365", "0.5630617", "0.557337", "0.5546199", "0.55373263", "0.553564...
0.7904502
0
Name of the geometry's type, such as 'Point'
def geom_type(self): # -> str: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def geometry_type(self) -> ir.StringValue:\n return ops.GeoGeometryType(self).to_expr()", "def geom_type(self):\n return _property_op(arctern.ST_GeometryType, self)", "def get_geometry_type(self):\n return self.geometry_type", "def get_geometry_type(self):\n return self._geometry_...
[ "0.77384764", "0.76871836", "0.75093687", "0.73306936", "0.7246454", "0.7081469", "0.69444716", "0.6698534", "0.66607857", "0.6624185", "0.66158676", "0.6610985", "0.6605221", "0.65819466", "0.65738606", "0.65729874", "0.6572675", "0.6514944", "0.6506146", "0.64641595", "0.64...
0.80697644
0
Unitless hausdorff distance to other geometry (float)
def hausdorff_distance(self, other): ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def hausdorff_distance(self, other):\n return _binary_op(arctern.ST_HausdorffDistance, self, other)", "def hausdorffDistance(self, id1, id2):\r\n # productive #math\r\n if frequent: profprint()\r\n node1 = slicer.mrmlScene.GetNodeByID(id1)\r\n polydata1 = node1.GetPolyData()\r\n node2 = sli...
[ "0.74562", "0.72187144", "0.7027511", "0.6888543", "0.6825782", "0.66274846", "0.65860593", "0.65808034", "0.6572659", "0.6412051", "0.6410486", "0.64041233", "0.63872296", "0.6371733", "0.63689435", "0.63612485", "0.6321926", "0.6309879", "0.6283407", "0.6269362", "0.6230554...
0.77946174
0
Returns a lower dimension geometry that bounds the object The boundary of a polygon is a line, the boundary of a line is a collection of points. The boundary of a point is an empty (null) collection.
def boundary(self): # -> BaseGeometry: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def boundary_polygon(self):\n try:\n return self.boundary_polygon_by_edges()\n except Exception as exc:\n self.log.warning('Warning, boundary_polygon() failed using edges! Trying polygon union method')\n self.log.warning(exc,exc_info=True)\n return self.bo...
[ "0.70245296", "0.6996683", "0.67483956", "0.6624984", "0.6564128", "0.633718", "0.63227165", "0.6250293", "0.61947584", "0.6138098", "0.6067745", "0.6062616", "0.60375464", "0.6032164", "0.5988255", "0.59842104", "0.59677136", "0.5945666", "0.594247", "0.5940417", "0.59305745...
0.70275587
0
A figure that envelopes the geometry
def envelope(self): # -> BaseGeometry: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def envelope(self):\n return _property_geo(arctern.ST_Envelope, self)", "def _gen_axes_patch(self):\n\n return Polygon([[0,0], [0.5,np.sqrt(3)/2], [1,0]], closed=True)", "def figure():\n fig = plt.figure()\n ax = fig.add_subplot()\n ax.set_aspect('equal')\n return fig, ax", "def sho...
[ "0.6156262", "0.6136208", "0.6098685", "0.6080936", "0.57456595", "0.56995076", "0.5694695", "0.5625121", "0.56112766", "0.55992675", "0.5583434", "0.5560338", "0.5522078", "0.54982924", "0.5496067", "0.54602045", "0.5441012", "0.5427183", "0.5390842", "0.5371041", "0.5364203...
0.7686538
0
Returns a simplified geometry produced by the DouglasPeucker algorithm Coordinates of the simplified geometry will be no more than the tolerance distance from the original. Unless the topology preserving option is used, the algorithm may produce selfintersecting or otherwise invalid geometries.
def simplify(self, tolerance, preserve_topology=...): # -> BaseGeometry: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def simplify(self, tolerance):\n return _unary_geo(arctern.ST_SimplifyPreserveTopology, self, tolerance)", "def simplify(\n self,\n tolerance: ir.FloatingValue,\n preserve_collapsed: ir.BooleanValue,\n ) -> GeoSpatialValue:\n return ops.GeoSimplify(self, tolerance, preserve_...
[ "0.69383496", "0.63768506", "0.59485835", "0.588781", "0.58418727", "0.54773796", "0.5404978", "0.539588", "0.53490907", "0.5239898", "0.5094586", "0.504801", "0.50427777", "0.49809536", "0.49339372", "0.48368916", "0.48302823", "0.48212743", "0.4820858", "0.4820858", "0.4806...
0.7587484
0
Returns the difference of the geometries
def difference(self, other): # -> BaseGeometry: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def difference(self, other):\n return self._geomgen(capi.geom_diff, other)", "def get_geometry(self):\n geometry = self._geometry\n for geo in self._holes:\n geometry = geometry.difference(geo) \n return geometry", "def difference(self, right: GeoSpatialValue) -> GeoSpati...
[ "0.7835668", "0.67538625", "0.66875976", "0.668591", "0.6672432", "0.6330556", "0.6302645", "0.6291098", "0.6205153", "0.6158713", "0.5979545", "0.5974062", "0.5971922", "0.59454995", "0.5910263", "0.5900204", "0.5885507", "0.58507663", "0.5831299", "0.58161", "0.5814541", ...
0.7628914
1
Returns the intersection of the geometries
def intersection(self, other): # -> BaseGeometry: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def intersection(self, other):\n return self._geomgen(capi.geom_intersection, other)", "def intersection(self, other):\n return _binary_geo(arctern.ST_Intersection, self, other)", "def get_intersections(self):\n return self.intersection_list", "def intersection(self):\n return Int...
[ "0.81696415", "0.73289883", "0.70724213", "0.70247513", "0.7009846", "0.6927248", "0.6887975", "0.6862611", "0.6845613", "0.6817662", "0.67587274", "0.6738185", "0.66817015", "0.6627198", "0.6520325", "0.6497146", "0.6444743", "0.643527", "0.64025766", "0.638235", "0.63786036...
0.78489655
1
Returns the symmetric difference of the geometries (Shapely geometry)
def symmetric_difference(self, other): # -> BaseGeometry: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def sym_difference(self, other):\n return self._geomgen(capi.geom_sym_diff, other)", "def get_geometry(self):\n geometry = self._geometry\n for geo in self._holes:\n geometry = geometry.difference(geo) \n return geometry", "def difference(self, other): # -> BaseGeometry:...
[ "0.68364435", "0.66142195", "0.65243906", "0.62599766", "0.578314", "0.5745995", "0.5697593", "0.5660089", "0.56346405", "0.5620938", "0.5573971", "0.5544287", "0.55151415", "0.5363903", "0.53637695", "0.53566664", "0.5340382", "0.5328883", "0.53185844", "0.53170276", "0.5302...
0.78318787
0
Returns the union of the geometries (Shapely geometry)
def union(self, other): # -> BaseGeometry: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def mergeGeometries(self):\n self.geometry = reduce(lambda p1,p2 : p1.union(p2) ,map(lambda tax : tax.biomeGeometry,self.taxonomies))\n return self.geometry", "def union(self, other):\n return self._geomgen(capi.geom_union, other)", "def union(feature):\n\n mp = MultiPolygon([Polygo...
[ "0.7533483", "0.7369448", "0.71881694", "0.709492", "0.6810885", "0.6660458", "0.6628999", "0.6492786", "0.6377294", "0.63297266", "0.63130426", "0.62937534", "0.6286035", "0.6256824", "0.6231118", "0.6177483", "0.61481446", "0.60948616", "0.6084603", "0.6042804", "0.5930949"...
0.752098
1
Returns True if geometries are disjoint, else False
def disjoint(self, other): # -> bool: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def disjoint(self, right: GeoSpatialValue) -> ir.BooleanValue:\n return ops.GeoDisjoint(self, right).to_expr()", "def is_disjoint(self, other):\n return self.intersect(other) == S.EmptySet", "def isdisjoint(self, other):\n self._check_title(other)\n\n # sort by top-left vertex\n ...
[ "0.72080624", "0.6969701", "0.65656924", "0.64380586", "0.64328504", "0.6396868", "0.6366332", "0.6359289", "0.6352083", "0.6330388", "0.6246516", "0.61746126", "0.6119184", "0.61187744", "0.61034775", "0.60886997", "0.60143226", "0.60018754", "0.59931576", "0.5951325", "0.59...
0.72793204
0
Returns True if geometries intersect, else False
def intersects(self, other): # -> bool: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def intersects(self, *__args): # real signature unknown; restored from __doc__ with multiple overloads\r\n return False", "def intersects(self, other):\n if isinstance(self.crs, CartesianCRS):\n if not self._bbox_overlap(other):\n return False\n interx = _cinter...
[ "0.7437675", "0.69443166", "0.6796653", "0.6768023", "0.67520535", "0.66880053", "0.6674216", "0.66541874", "0.6616146", "0.660466", "0.660402", "0.6571344", "0.6570313", "0.6554788", "0.6529189", "0.6515813", "0.6445119", "0.642645", "0.63719386", "0.6354527", "0.63500655", ...
0.7402378
1
Returns True if geometries are equal to within a specified tolerance Refers to coordinate equality, which requires coordinates to be equal and in the same order for all components of a geometry
def equals_exact(self, other, tolerance): # -> bool: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def approx_eq(x, y, tolerance = 0.000001):\n\treturn abs(x - y) < tolerance", "def compare_geometrycollection(config, geometry_x, geometry_y):\n if config in BLIST:\n # print('arc distance: %s' % str(arc_distance(x, y)))\n return arc_distance(geometry_x, geometry_y) < EPOCH_CURVE_RELATIVE\n ...
[ "0.65638185", "0.649459", "0.64573056", "0.6321705", "0.622471", "0.61462414", "0.613085", "0.613085", "0.613085", "0.6104649", "0.6088571", "0.6067109", "0.60385925", "0.6033399", "0.5987341", "0.5935575", "0.5908245", "0.5903495", "0.5901533", "0.5879786", "0.5853027", "0...
0.71459395
0
Returns True if the DE9IM string code for the relationship between the geometries satisfies the pattern, else False
def relate_pattern(self, other, pattern): # -> bool: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def match(self):\r\n if len(self.string1) != len(self.string2):\r\n return False\r\n self._build_prefix()\r\n pattern = self.string2\r\n text = self.string11\r\n m = len(self.string2)\r\n n = len(self.string11)\r\n p = self._prefix\r\n k = 0\r\n ...
[ "0.5887881", "0.57415825", "0.5705854", "0.56977844", "0.56829077", "0.5674485", "0.56383944", "0.5585288", "0.5558476", "0.55112875", "0.5505687", "0.5493004", "0.5493004", "0.54758126", "0.542464", "0.54054475", "0.5403299", "0.5375537", "0.53690135", "0.5365296", "0.535534...
0.5991061
0
Return a point at the specified distance along a linear geometry Negative length values are taken as measured in the reverse direction from the end of the geometry. Outofrange index values are handled by clamping them to the valid range of values. If the normalized arg is True, the distance will be interpreted as a fra...
def interpolate(self, distance, normalized=...): # -> BaseGeometry: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_norm_distance(length: int, distance: float) -> float:\n return distance/(length*2)", "def _nearest_point_on_line(begin, end, point):\n b2e = _vec_sub(end, begin)\n b2p = _vec_sub(point, begin)\n nom = _vec_dot(b2p, b2e)\n denom = _vec_dot(b2e, b2e)\n if denom == 0.0:\n return beg...
[ "0.56439435", "0.56294566", "0.55049217", "0.5495214", "0.54535615", "0.53204644", "0.52492005", "0.5180053", "0.5160316", "0.51442784", "0.51392424", "0.5118768", "0.51137716", "0.51114225", "0.5111166", "0.50826037", "0.5079231", "0.50748944", "0.50442165", "0.5022545", "0....
0.59387493
0
Provide the Numpy array protocol.
def __array_interface__(self): ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __array__(self, *args, **kwargs):\n\n return self.data", "def __array__(self):\n return np.asarray(self.data)", "def array(self):", "def __array__(self):\n return np.zeros(self.shape, self.dtype)", "def __array__(self):\n return self.array", "def tonumpy(self):\n import...
[ "0.6984412", "0.68687886", "0.6676552", "0.6667087", "0.66398215", "0.6637101", "0.6610455", "0.65973616", "0.6503999", "0.6497078", "0.64307505", "0.6386554", "0.63856333", "0.63472104", "0.6298814", "0.62879676", "0.6276794", "0.62321687", "0.6229774", "0.62225384", "0.6192...
0.7552204
1
Executes the experiment with the given config. The experiment t creates mean and sub neuron activities for each label for each given dataset. If xFoldCrossValidation is set this will be repeated x times.
def execute(self): for csnn_config in self.__config["csnnConfigs"]: csnn_name = csnn_config["modelName"] try: for dataset_config in self.__config["datasetConfigs"]: provider = getDatasetProvider(dataset_config) if not dataset_confi...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def run(self, config, **kwargs):\n config_parameters = utils.parse_config_or_kwargs(config, **kwargs)\n experiment_path = self.train(config, **kwargs)\n evaluation_logger = utils.getfile_outlogger(\n Path(experiment_path, 'evaluation.log'))\n for testdata, testlabel in zip(co...
[ "0.7001025", "0.6034314", "0.6033947", "0.5972015", "0.5899449", "0.58167803", "0.5807292", "0.57877874", "0.576847", "0.57546633", "0.5752527", "0.57516176", "0.5747905", "0.57385457", "0.57250816", "0.57234114", "0.5702539", "0.5689327", "0.5673698", "0.5648171", "0.5636548...
0.6170723
1
Get Sign Documents This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please define a `callback` function to be invoked when receiving the response.
def app_get_sign_documents_post(self, request, **kwargs): kwargs['_return_http_data_only'] = True if kwargs.get('callback'): return self.app_get_sign_documents_post_with_http_info(request, **kwargs) else: (data) = self.app_get_sign_documents_post_with_http_info(request, *...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def app_get_sign_documents_post_with_http_info(self, request, **kwargs):\n\n all_params = ['request']\n all_params.append('callback')\n all_params.append('_return_http_data_only')\n all_params.append('_preload_content')\n all_params.append('_request_timeout')\n\n params = ...
[ "0.681581", "0.6148953", "0.5785778", "0.54764587", "0.5414924", "0.534441", "0.5274601", "0.5208355", "0.5207844", "0.5171612", "0.51489496", "0.50897735", "0.5016967", "0.49052817", "0.489447", "0.488639", "0.48830014", "0.48812646", "0.48810694", "0.48215222", "0.48051473"...
0.73364204
0
Get Sign Documents This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please define a `callback` function to be invoked when receiving the response.
def app_get_sign_documents_post_with_http_info(self, request, **kwargs): all_params = ['request'] all_params.append('callback') all_params.append('_return_http_data_only') all_params.append('_preload_content') all_params.append('_request_timeout') params = locals() ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def app_get_sign_documents_post(self, request, **kwargs):\n kwargs['_return_http_data_only'] = True\n if kwargs.get('callback'):\n return self.app_get_sign_documents_post_with_http_info(request, **kwargs)\n else:\n (data) = self.app_get_sign_documents_post_with_http_info(...
[ "0.7337725", "0.615188", "0.5788486", "0.5480119", "0.54177696", "0.5345478", "0.52754647", "0.52073777", "0.5207363", "0.51747423", "0.5151259", "0.5091837", "0.5017626", "0.49071118", "0.4895874", "0.48886582", "0.48839498", "0.4883136", "0.48830694", "0.48236075", "0.48074...
0.6817782
1
Sign Documents This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please define a `callback` function to be invoked when receiving the response.
def app_sign_documents_post(self, request, **kwargs): kwargs['_return_http_data_only'] = True if kwargs.get('callback'): return self.app_sign_documents_post_with_http_info(request, **kwargs) else: (data) = self.app_sign_documents_post_with_http_info(request, **kwargs) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def app_get_sign_documents_post(self, request, **kwargs):\n kwargs['_return_http_data_only'] = True\n if kwargs.get('callback'):\n return self.app_get_sign_documents_post_with_http_info(request, **kwargs)\n else:\n (data) = self.app_get_sign_documents_post_with_http_info(...
[ "0.72554654", "0.6946287", "0.674169", "0.58869725", "0.54398656", "0.5326935", "0.52467406", "0.5143745", "0.50698924", "0.4994678", "0.49314767", "0.49239925", "0.48445404", "0.4831794", "0.48213002", "0.48093095", "0.48047242", "0.47751486", "0.47599822", "0.47585905", "0....
0.7130099
1
Prettyprint a matrix() 18x18 covariance.
def print_covariance(P): def b(string): """ Turns a given string blue. """ return "\033[94m{0}\033[0m".format(string) out = " " # Print out header with state variables for var in STATE_VARS: out += "{0:9s} ".format(var) # Print out correlation / covari...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def covariance(data_matrix):\n return np.asmatrix(np.cov(data_matrix, rowvar=0))", "def information_matrix(self):\n return self._cov.inv()", "def pretty_print(self):\r\n out = \"\"\r\n\r\n rows,cols = self.matrix.shape\r\n\r\n for row in xrange(0,rows):\r\n out += \"[\...
[ "0.6498037", "0.64375573", "0.64108604", "0.64056873", "0.6357736", "0.6317185", "0.6234524", "0.6215412", "0.62113374", "0.6162891", "0.61263704", "0.6123183", "0.60731006", "0.6032474", "0.59799695", "0.5935359", "0.59276396", "0.5920301", "0.5918287", "0.5914103", "0.59120...
0.6838222
0
Compute the Fisher information.
def _compute_fisher_information(result: 'MaximumLikelihoodAmplitudeEstimationResult', num_sum_terms: Optional[int] = None, observed: bool = False) -> float: a = result.estimation # Corresponding angle to the value a (only use real part of 'a') ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _getFisher(self):\n Ctot = self.vd.getGP().getCovar()\n Ki = sp.linalg.inv(Ctot.K())\n n_scales = self.vd.getNumberScales()\n out = sp.zeros((n_scales, n_scales))\n for m in range(n_scales):\n out[m, m] = 0.5 * sp.trace(\n sp.dot(Ki,\n ...
[ "0.6735223", "0.66042775", "0.62934285", "0.6065687", "0.59460366", "0.58402395", "0.5761419", "0.5759288", "0.57380706", "0.56777894", "0.5614086", "0.5607752", "0.5601926", "0.56015635", "0.55751127", "0.5574964", "0.5544454", "0.5512649", "0.5482136", "0.5473166", "0.54644...
0.7226743
0
Parses the 1d data set into three separate data sets for each axis. Each trial's data is split into [0th slice, ..., (dim1)th slice] for each x, y, and z. To get only the Nth slices of an axis across all trials, traverse through data_dim_axis by index [N, N + dim1, N + 2dim1, ...]
def convert_1d_to_3d(data_X, data_Y): data_X = data_X.tocsr() data_dim_x = [] # slices along x-axis (has shape of (total_trials * dim_x, dim_z, dim_y)) data_dim_x_label = [] # contains (total_trials * dim_x) labels data_dim_y = [] # slices along y-axis (has shape of (total_trials * dim_y, dim_z...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_slice_other_dimension(setup_teardown_file):\n f = setup_teardown_file[3]\n\n for i, shape in enumerate([(3, 0), (1, 2, 0), (2, 0, 1)]):\n dset = f.create_dataset('x%d'%i, shape, dtype=np.int32)\n assert dset.shape == shape\n out = dset[:1]\n assert isinstance(out, np.ndar...
[ "0.6175714", "0.6072633", "0.58613235", "0.5805677", "0.5799606", "0.5719681", "0.5651642", "0.56276065", "0.54468656", "0.53935266", "0.5339818", "0.5322116", "0.53019875", "0.52620435", "0.5252861", "0.5247714", "0.51936585", "0.5185298", "0.5181618", "0.5177174", "0.516000...
0.6850255
0
This function loads 20newsgroups data from sklearn, subsamples the data set, assigns a label to each category, and splits data into train, val, and test sets.
def load_data(): # Load data from categories comp = fetch_20newsgroups(subset='all', categories=['comp.graphics', 'comp.sys.mac.hardware', 'comp.windows.x'], \ shuffle=True, random_state=1, remove=('headers', 'footers', 'quotes')) science = fetch_20newsgroups(subset='all', categories=['sci....
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def splitData(groupList, trainSize):\r\n from sklearn.model_selection import StratifiedShuffleSplit\r\n\r\n groupList[0]['text'] = cleanRealTexts(list(groupList[0]['text']))\r\n\r\n classLabels = np.array([])\r\n for i, group in enumerate(groupList):\r\n classLabels = np.append(classLabels, np.r...
[ "0.69632035", "0.69308716", "0.6922211", "0.67450684", "0.6697376", "0.66871846", "0.66731495", "0.6519348", "0.6479878", "0.6477659", "0.64760816", "0.64579505", "0.64511955", "0.64421725", "0.64055145", "0.640277", "0.6390375", "0.6376216", "0.6356931", "0.6300504", "0.6279...
0.7111278
0
Apply TFIDF transformation to test data.
def tfidf_transform(vectorizer_train, newsgroups_test): vectors_test = vectorizer_train.transform(newsgroups_test) dense_test = vectors_test.todense() denselist_test = np.array(dense_test).transpose() X_test = denselist_test.copy() return X_test
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __tf_idf_feature_extraction(self):\n print('=' * 80)\n print(\"TF-IDF Feature Extraction\")\n t0 = time()\n vectorizer = TfidfVectorizer()\n vec_train = vectorizer.fit_transform(self.train.text)\n vec_test = vectorizer.transform(self.test.text)\n duration = time...
[ "0.63195014", "0.61641866", "0.6114476", "0.60683584", "0.60582715", "0.6029245", "0.5998361", "0.59757125", "0.59153837", "0.5848679", "0.5802245", "0.5792374", "0.57360756", "0.57278067", "0.5684948", "0.5674857", "0.56532204", "0.56437564", "0.564253", "0.5634832", "0.5613...
0.6933384
0
Shuffle data X, labels y, subcategories z.
def shuffle_data(X,y,z): data = np.row_stack((X, y, z)) np.random.shuffle(data.T) X = data[:-2,:] y = data[-2,:] z = data[-1,:] return X, y, z
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def shuffle_data(self):\n images = list(self.train_images)\n labels = list(self.train_labels)\n self.train_images = []\n self.train_labels = []\n\n # create list of permutated index and shuffle data accoding to list\n idx = np.random.permutation(len(labels))\n for i...
[ "0.67308176", "0.6415329", "0.63351786", "0.6297167", "0.6285768", "0.6260271", "0.6247948", "0.6247948", "0.6247948", "0.62380946", "0.6138317", "0.60020167", "0.5964029", "0.59294426", "0.5869422", "0.58593374", "0.58375067", "0.5821528", "0.5807298", "0.5691683", "0.567971...
0.69409347
0
Returns the data grouped by Movie
def movies(self): return self.data.groupby('Parameters')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_movies(self):\n\n movies = {}\n\n for index, movie in self.movies.iterrows():\n\n id_movie = int(movie[0])\n title = movie[1]\n movie_tags = []\n movie_ratings = []\n\n # Get tags for each movie\n tags = self.movies_tags.loc[se...
[ "0.7033445", "0.6535361", "0.64394385", "0.6439323", "0.63908094", "0.6382928", "0.630076", "0.6293877", "0.6247835", "0.6170389", "0.6121725", "0.61166793", "0.6083215", "0.6007548", "0.59889406", "0.59845316", "0.59766597", "0.5923087", "0.5894062", "0.58830535", "0.5880029...
0.78259444
0
Backup a ES index from its Doc class, including all index settings, mapping, aliases, and all docs, save to outfile if provided, otherwise, return the backup data as a dictionary.
def backup_es(esdoc_class, outfile=None): data = esdoc_class._index.get() idx_name = list(data)[0] data[idx_name]["docs"] = list( dict(_id=hit.meta.id, **hit.to_dict()) for hit in esdoc_class.search().scan() ) if outfile: with open(outfile, "w") as out_f: json.dump(data, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def backup_schema(outfile=None):\n return backup_es(Schema, outfile=outfile)", "def _write_index(self):\n # Make sure to only write non-default objects to the index.\n self.store.write_object(\n object=[obj.to_dict() for ns in self.index.values() for obj in ns.values() if not obj.is_d...
[ "0.5878769", "0.57617337", "0.5701214", "0.56426847", "0.56349516", "0.5593593", "0.5569869", "0.5430634", "0.5421856", "0.5361963", "0.5343214", "0.5291585", "0.5266545", "0.52519333", "0.5180529", "0.51573664", "0.5149495", "0.50542545", "0.5037411", "0.502542", "0.4937648"...
0.79996437
0
Backup Dataset index "discover_dataset", including settings, mapping, aliases and all docs Save to outfile if provided, otherwise, return the backup data as a dictionary.
def backup_dataset(outfile=None): return backup_es(Dataset, outfile=outfile)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def backup_es(esdoc_class, outfile=None):\n data = esdoc_class._index.get()\n idx_name = list(data)[0]\n data[idx_name][\"docs\"] = list(\n dict(_id=hit.meta.id, **hit.to_dict()) for hit in esdoc_class.search().scan()\n )\n if outfile:\n with open(outfile, \"w\") as out_f:\n ...
[ "0.5655255", "0.5525369", "0.5212151", "0.5152905", "0.51345235", "0.5077431", "0.5040934", "0.50195885", "0.49345028", "0.49191532", "0.48888722", "0.48806277", "0.48804173", "0.48743966", "0.48640543", "0.48606038", "0.4850102", "0.47867522", "0.47753274", "0.47753274", "0....
0.686908
0
Backup Schema index "discover_schema", including settings, mapping, aliases and all docs Save to outfile if provided, otherwise, return the backup data as a dictionary.
def backup_schema(outfile=None): return backup_es(Schema, outfile=outfile)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def backup_es(esdoc_class, outfile=None):\n data = esdoc_class._index.get()\n idx_name = list(data)[0]\n data[idx_name][\"docs\"] = list(\n dict(_id=hit.meta.id, **hit.to_dict()) for hit in esdoc_class.search().scan()\n )\n if outfile:\n with open(outfile, \"w\") as out_f:\n ...
[ "0.57294905", "0.5624704", "0.5621064", "0.5573264", "0.54107946", "0.50398797", "0.49729794", "0.49718326", "0.49672258", "0.49517736", "0.48920152", "0.48407328", "0.48218256", "0.48188037", "0.48028147", "0.47949687", "0.47470766", "0.4696858", "0.46950325", "0.467566", "0...
0.6826845
0
Backup SchemaClass index "discover_schema_class", including settings, mapping, aliases and all docs Save to outfile if provided, otherwise, return the backup data as a dictionary.
def backup_schema_class(outfile=None): return backup_es(SchemaClass, outfile=outfile)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def backup_es(esdoc_class, outfile=None):\n data = esdoc_class._index.get()\n idx_name = list(data)[0]\n data[idx_name][\"docs\"] = list(\n dict(_id=hit.meta.id, **hit.to_dict()) for hit in esdoc_class.search().scan()\n )\n if outfile:\n with open(outfile, \"w\") as out_f:\n ...
[ "0.62869155", "0.5954692", "0.5110072", "0.49648246", "0.47868812", "0.4665774", "0.4657948", "0.46555963", "0.4620666", "0.45999575", "0.45988777", "0.45965794", "0.45868897", "0.45225358", "0.45041782", "0.45039794", "0.4491598", "0.44227284", "0.44207746", "0.44183654", "0...
0.7076887
0
Calculate integral of a polynomial from list of coefficients
def poly_integral(poly, C=0): try: if len(poly) < 1: return None except TypeError: return None if not (isinstance(C, int) or isinstance(C, float)): return None lastidx = 0 for idx, coef in enumerate(poly): if not (type(coef) is int or type(coef) is float):...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def poly_integral(poly, C=0):\n if not isinstance(poly, list) or poly == []:\n return None\n if not isinstance(C, (int, float)):\n return None\n result = [C]\n for degree, coef in enumerate(poly):\n val = coef * (1 / (degree + 1))\n if val.is_integer():\n result.a...
[ "0.74296737", "0.7381701", "0.7244842", "0.7224842", "0.7110448", "0.70556635", "0.69254386", "0.6911941", "0.6725386", "0.6708102", "0.6701443", "0.6629917", "0.65790784", "0.65371686", "0.6455424", "0.64405704", "0.641371", "0.6384638", "0.6370596", "0.6348242", "0.63109946...
0.73913735
1
Returns integer if number is whole, else returns number
def int_if_whole(num): if num.is_integer(): return int(num) else: return num
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_integer(number: float):\n\tif number.is_integer():\n\t\treturn int(number)\n\treturn number", "def whole_number_to_int(value: AnyBasicType) -> AnyBasicType:\n if isinstance(value, float) and value.is_integer():\n return int(value)\n return value", "def get_number(self, operand):...
[ "0.7314011", "0.7166847", "0.6652101", "0.6609565", "0.65567404", "0.65475607", "0.6547118", "0.6521454", "0.65158075", "0.64692986", "0.6402044", "0.6399932", "0.6330981", "0.63286954", "0.63224167", "0.62902737", "0.62311643", "0.62228835", "0.6186363", "0.61849284", "0.617...
0.85024625
0
Call which_action for each action in s1 that has an analogue in s2 to determine which of two actions that operate against the same oid+index should be preferred. If neither is preferred, a ConflictError will be raised.
def action_intersection(s1, s2): isect = s1 & s2 L1 = [ ( (a.oid, a.index_oid), a) for a in s1 ] L2 = [ ( (a.oid, a.index_oid), a) for a in s2 ] ds1 = dict(L1) ds2 = dict(L2) for k1, action1 in ds1.items(): action2 = ds2.get(k1) if action2 is not None: # replace actio...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def which_action(a1, a2):\n def doconflict(a1, a2):\n raise ConflictError\n def dosecond(a1, a2):\n return a2\n def dofirst(a1, a2):\n return a1\n statefuncs = {\n (IndexAction, UnindexAction):doconflict,\n (UnindexAction, IndexAction):doconflict,\n (ReindexAct...
[ "0.73710716", "0.5827848", "0.5650774", "0.56128246", "0.55781186", "0.5469253", "0.5348622", "0.53037953", "0.52899754", "0.5289762", "0.5206281", "0.5147254", "0.5144174", "0.51324034", "0.5051541", "0.50176245", "0.49743837", "0.4961874", "0.49386695", "0.4918847", "0.4902...
0.65523064
1
Compare two actions and return 'the right' one, or raise a ConflictError. It's presumed that both actions share the same (oid,index). We use this
def which_action(a1, a2): def doconflict(a1, a2): raise ConflictError def dosecond(a1, a2): return a2 def dofirst(a1, a2): return a1 statefuncs = { (IndexAction, UnindexAction):doconflict, (UnindexAction, IndexAction):doconflict, (ReindexAction, UnindexAct...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def action_intersection(s1, s2):\n isect = s1 & s2\n L1 = [ ( (a.oid, a.index_oid), a) for a in s1 ]\n L2 = [ ( (a.oid, a.index_oid), a) for a in s2 ]\n ds1 = dict(L1)\n ds2 = dict(L2)\n for k1, action1 in ds1.items():\n action2 = ds2.get(k1)\n if action2 is not None:\n #...
[ "0.5894497", "0.58674324", "0.57587546", "0.57040775", "0.567426", "0.5658385", "0.5616273", "0.5513813", "0.547424", "0.54145575", "0.5409295", "0.5403284", "0.54000676", "0.5348082", "0.53056765", "0.52547824", "0.5209515", "0.51633745", "0.5149985", "0.51365876", "0.511524...
0.7227713
0
State chart for optimization. If the new action is X and the existing action is Y, generate the resulting action named in the chart cells. New INDEX UNINDEX REINDEX Existing INDEX index nothing index UNINDEX reindex unindex reindex REINDEX index unindex reindex Starred entries in the chart above indicate special cases....
def optimize_actions(actions): result = {} def donothing(oid, index_oid, action1, action2): del result[(oid, index_oid)] def doadd(oid, index_oid, action1, action2): result[(oid, index_oid)] = action1 def dochange(oid, index_oid, action1, action2): result[(oid, index_oid)] = R...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def result(self, state, action):\n state_after_act = [[0 for i in range(self.col)] for j in range(self.row)]\n for k in action:\n x = k[1][0]\n y = k[1][1]\n if k[0] == \"vaccinate\":\n state_after_act[x][y] = ('I', 1)\n else:\n ...
[ "0.65228754", "0.5933773", "0.5887716", "0.58360565", "0.58174783", "0.5791254", "0.57908595", "0.5762855", "0.5740069", "0.5715256", "0.56917787", "0.56880116", "0.5683548", "0.56832623", "0.5663208", "0.56388277", "0.5631226", "0.5610196", "0.56086373", "0.5602409", "0.5600...
0.6131822
1
Optimize actions in states during conflict resolution
def optimize_states(old_state, committed_state, new_state): old = old_state['actions'] committed = committed_state['actions'] new = new_state['actions'] old, new, committed = map(optimize_actions, [old, new, committed]) old_state['actions'] = old committed_state['actions'] = committed new_...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def optimize_actions(actions):\n result = {}\n\n def donothing(oid, index_oid, action1, action2):\n del result[(oid, index_oid)]\n\n def doadd(oid, index_oid, action1, action2):\n result[(oid, index_oid)] = action1\n\n def dochange(oid, index_oid, action1, action2):\n result[(oid, ...
[ "0.6161125", "0.59908533", "0.590098", "0.5820195", "0.5756483", "0.5716084", "0.5650024", "0.55370075", "0.54980445", "0.5488844", "0.5428865", "0.5424252", "0.5393492", "0.5381599", "0.5360048", "0.5320444", "0.5301779", "0.5292332", "0.5284766", "0.5248218", "0.52251375", ...
0.6796256
0
Announce frames to the API that may be queued for frame capturing later. Should be called after the frame is created. Call startCapture after this method.
def announce(self, payload_size: Optional[int] = None) -> None: if payload_size is None: payload_size = self._camera.PayloadSize else: if payload_size < self._camera.PayloadSize: raise ValueError("Specified frame buffer is not large enough!") # allocate m...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def display_frame(frame: Frame, delay: Optional[int] = 1) -> None:\n # print('frame {}'.format(frame.data.frameID))\n \n # get a copy of the frame data\n _frames.append(frame)", "def capture_frame(self):\n if self.capture_limit is None:\n capture_limit_reached = False\n else:...
[ "0.59467626", "0.5877279", "0.5710122", "0.5584479", "0.5575277", "0.55211717", "0.5515492", "0.54915524", "0.54915524", "0.54915524", "0.54915524", "0.5471768", "0.5418382", "0.54165924", "0.5404626", "0.53927463", "0.5368608", "0.5352899", "0.53498757", "0.5316282", "0.5300...
0.63604873
0
Revoke a frame from the API.
def revoke(self) -> None: error = vimba_c.vmb_frame_revoke(self._camera.handle, byref(self.data)) if error: raise VimbaException(error)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def revoke_token():\n return server.create_endpoint_response(RevocationEndpoint.ENDPOINT_NAME)", "def del_frame(*args):\n return _ida_frame.del_frame(*args)", "def fusion_api_revoke_certificate(self, name=None, api=None, headers=None):\n return self.ca.revoke(name=name, api=api, headers=headers)...
[ "0.6457462", "0.63507867", "0.6242425", "0.6187559", "0.6143227", "0.6090711", "0.5983966", "0.5945101", "0.5867708", "0.5800802", "0.5716971", "0.55593175", "0.55128205", "0.5473526", "0.54718405", "0.5422895", "0.54017884", "0.5385355", "0.5370714", "0.53591573", "0.5344741...
0.7699508
0
Queue frames that may be filled during frame capturing. Call after announceFrame and startCapture. Callback must accept argument of type frame. Remember to requeue the frame by calling frame.queue_capture() at the end of your callback function.
def queue_for_capture(self, frame_callback: Optional[Callable] = None) -> None: self._frame_callback = frame_callback # define a callback wrapper here so it doesn't bind self def frame_callback_wrapper(camera_handle, frame_ptr): # call the user's callback with the self bound outside...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def capture_frame(self):\n if self.capture_limit is None:\n capture_limit_reached = False\n else:\n capture_limit_reached = self.captured_frames >= \\\n self.capture_limit\n\n if not capture_limit_reached:\n for camera in self.get_cameras():\n ...
[ "0.6528172", "0.6219949", "0.6177433", "0.60546577", "0.59445876", "0.5801518", "0.5797259", "0.57847846", "0.57812697", "0.5759052", "0.5702521", "0.5698096", "0.56379294", "0.5625848", "0.5597318", "0.5510694", "0.5507248", "0.5477359", "0.54491526", "0.54260653", "0.542541...
0.809999
0
Get a copy of the frame's buffer data as a ctypes c_ubyte array.
def buffer_data(self): # create a ctypes pointer to the buffer buffer_ptr = cast(self.data.buffer, POINTER(c_ubyte * self.data.bufferSize)) # contents always returns a copy return buffer_ptr.contents
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def toubytes(data, buf_len):\n buf = bytearray(data)\n buffer = (ctypes.c_ubyte * buf_len).from_buffer(buf)\n return buffer", "def toubyte(data):\n buf = bytearray(data)\n buffer = (ctypes.c_ubyte).from_buffer(buf)\n return buffer", "def get_data(self):\n oshape = (ctypes.c_uint * 4)()...
[ "0.7058171", "0.67911583", "0.65706354", "0.65090454", "0.64190936", "0.63389236", "0.6210867", "0.6066091", "0.605125", "0.6025154", "0.59680426", "0.5928322", "0.5925776", "0.58375514", "0.5806147", "0.57676566", "0.5759585", "0.5745099", "0.5737871", "0.571216", "0.5684284...
0.7441798
0
Join the gene tables to a single gene table
def join_gene_tables(gene_tables,output,verbose=None): gene_table_data={} start_column_id="" samples=[] file_basenames=[] index=0 for gene_table in gene_tables: if verbose: print("Reading file: " + gene_table) lines=util.process_gene_table_with_...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _join_gene(query, gene_name, gene_symbol, gene_id):\n if gene_name or gene_symbol:\n query = query.join(models.Gene)\n\n if gene_symbol:\n query = query.filter(models.Gene.gene_symbol.like(gene_symbol))\n\n if gene_name:\n query = query.filt...
[ "0.6119691", "0.58555377", "0.5789409", "0.572956", "0.556574", "0.5557195", "0.54311585", "0.5387678", "0.53696585", "0.5367406", "0.5350316", "0.5341653", "0.53085417", "0.5301041", "0.5301041", "0.52331257", "0.5225479", "0.5223402", "0.520401", "0.5197744", "0.51367563", ...
0.69409186
0
Build a test model for children testing
def __build_test_model_children_tree_1(self) -> Model: self.model_builder.clear() r_a = SystemFile("a", 1024, True) r_aa = SystemFile("aa", 512, False) r_a.add_child(r_aa) r_ab = SystemFile("ab", 512, False) r_a.add_child(r_ab) r_b = SystemFile("b", 3090, True) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_build_model(arguments):\n ...", "def create_model(self):\n self.skipTest(\"Base module should not be tested.\")", "def _child_build_new_model(self):\n self._build_new_gp()", "def test_constructor(self):\n # Record the model types of all the models to be created\n all_model_typ...
[ "0.6332726", "0.61563665", "0.61315244", "0.6126765", "0.61122686", "0.59221065", "0.5898088", "0.5898088", "0.5894476", "0.58900094", "0.5854989", "0.58097064", "0.58097064", "0.5794394", "0.5790386", "0.5776492", "0.5752513", "0.5751743", "0.5749239", "0.5743566", "0.571053...
0.7178186
0
Mismatching is_dir in a child raises error
def test_build_children_mismatch_is_dir(self): r_a = SystemFile("a", 0, True) r_aa = SystemFile("aa", 0, True) r_a.add_child(r_aa) l_a = SystemFile("a", 0, True) l_aa = SystemFile("aa", 0, False) l_a.add_child(l_aa) self.model_builder.set_remote_files([r_a]) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_dir(self, path):", "def is_dir(self, path: PathLike):", "def isdir (self, path):\r\n pass", "def is_valid_directory(parser, arg):", "def test_isdir(self, remote_mock_dir):\n\n with HdfsHook() as hook:\n assert hook.isdir(posixpath.join(remote_mock_dir, \"subdir\"))\n ...
[ "0.73621666", "0.70751095", "0.70362127", "0.68978703", "0.66969264", "0.66785115", "0.66231143", "0.6613813", "0.65570325", "0.65134746", "0.6488475", "0.6424379", "0.635782", "0.6347883", "0.634357", "0.6342583", "0.63372755", "0.63299614", "0.63158935", "0.6306682", "0.629...
0.77840406
0