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
decorator to register a babel cli handler.
def babel_cli_handler(**options): def decorator(cls): """ decorates the given class and registers an instance of it into available babel cli handlers. :param BabelCLIHandlerBase cls: babel cli handler class. :returns: babel cli handler class. :rtype: BabelCLIHandle...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def decorator(cls):\n\n instance = cls()\n babel_services.register_cli_handler(instance, **options)\n\n return cls", "def __init__(self):\n\n super().__init__(BabelCLIHandlersEnum.INIT)", "def add_cmd_handler(self, cmd, func):\n len_args = len(inspect.getargspec(func)[0])\n ...
[ "0.83057785", "0.6101431", "0.6031415", "0.6014547", "0.5841859", "0.5641326", "0.5641326", "0.5525839", "0.55132365", "0.5494176", "0.5488199", "0.54627776", "0.5449929", "0.5416219", "0.53628474", "0.5356179", "0.5328154", "0.5316033", "0.5316033", "0.5316033", "0.5316033",...
0.8217108
1
decorates the given class and registers an instance of it into available babel cli handlers.
def decorator(cls): instance = cls() babel_services.register_cli_handler(instance, **options) return cls
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def babel_cli_handler(**options):\n\n def decorator(cls):\n \"\"\"\n decorates the given class and registers an instance\n of it into available babel cli handlers.\n\n :param BabelCLIHandlerBase cls: babel cli handler class.\n\n :returns: babel cli handler class.\n :rty...
[ "0.7828587", "0.65119535", "0.64277583", "0.6273776", "0.62530273", "0.61781615", "0.61653596", "0.60024714", "0.60024714", "0.5967244", "0.57739705", "0.5762401", "0.5757489", "0.5746612", "0.56892204", "0.5668369", "0.56358856", "0.56313264", "0.5613844", "0.5579808", "0.55...
0.7280425
1
Return a new (unsaved) shareditem object. Does not set any of the fields that would come from the Request object (i.e. ``user``).
def get_shared_object(self): if not self.is_valid(): raise ValueError("get_shared_object may only be called on valid forms") new = SharedItem( object_id = force_unicode(self.target_object._get_pk_val()), content_type = ContentType.objects.get_for_model(self.target...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_shared_object(self):\n if not self.is_valid():\n raise ValueError(\"get_shared_object may only be called on valid forms\")\n\n new = SharedItem(\n content_type = ContentType.objects.get_for_model(self.target_object),\n object_id = force_unicode(self.target_...
[ "0.7739369", "0.64699394", "0.6046109", "0.5965286", "0.587094", "0.5790064", "0.5787484", "0.5744283", "0.5732211", "0.56390357", "0.5534467", "0.5512519", "0.5505798", "0.5461782", "0.53700083", "0.53373706", "0.53137255", "0.5306573", "0.5269624", "0.5267749", "0.52600294"...
0.772191
1
Return a new (unsaved) shareditem object. Does not set any of the fields that would come from the Request object (i.e. ``user``).
def get_shared_object(self): if not self.is_valid(): raise ValueError("get_shared_object may only be called on valid forms") new = SharedItem( content_type = ContentType.objects.get_for_model(self.target_object), object_id = force_unicode(self.target_object._get_p...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_shared_object(self):\n if not self.is_valid():\n raise ValueError(\"get_shared_object may only be called on valid forms\")\n\n new = SharedItem(\n object_id = force_unicode(self.target_object._get_pk_val()),\n content_type = ContentType.objects.get_for_mode...
[ "0.7722135", "0.64705783", "0.6047539", "0.59654415", "0.5869505", "0.57898974", "0.5785594", "0.57411844", "0.57283014", "0.5641411", "0.5534432", "0.5511725", "0.55054003", "0.5462437", "0.5369579", "0.5337859", "0.53142005", "0.5303614", "0.52669346", "0.52664846", "0.5259...
0.7739693
0
Test FeathrClient() get_online_features and batch_get can get data correctly.
def test_feathr_online_store_agg_features(): online_test_table = get_online_test_table_name("nycTaxiCITableMaven") test_workspace_dir = Path( __file__).parent.resolve() / "test_user_workspace" # os.chdir(test_workspace_dir) # The `feathr_runtime_location` was commented out in this config file,...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_get(self):\n simple_fields = {\n \"verbose\": False,\n \"min_core_neighbors\": self.min_core_neighbors,\n \"num_features\": 1,\n \"num_unpacked_features\": 2,\n \"num_distance_components\": 1,\n \"radius\": self.radius,\n ...
[ "0.6168632", "0.60641015", "0.60555446", "0.6000268", "0.59343565", "0.59123015", "0.58149856", "0.5790768", "0.5763791", "0.5751622", "0.5747959", "0.5700878", "0.56979954", "0.5681993", "0.566791", "0.5665153", "0.56642336", "0.56637", "0.56631935", "0.5621099", "0.5589105"...
0.66819775
0
Initializes the object to have a pronunciation dictionary available
def __init__(self): self._pronunciations = nltk.corpus.cmudict.dict()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self):\n self._pronunciations = nltk.corpus.cmudict.dict()\n \"\"\"\n API Documentation for CMU dictionary corpus\n http://www.nltk.org/api/nltk.corpus.reader.html#module-nltk.corpus.reader.cmudict\n \"\"\"", "def __init__(self):\n super().__init__()\n self.m...
[ "0.7030081", "0.62855494", "0.62579364", "0.6253256", "0.6249114", "0.61850667", "0.6163011", "0.6113119", "0.6111343", "0.6096763", "0.6093766", "0.60932755", "0.60580236", "0.60405856", "0.60405856", "0.60081416", "0.60046226", "0.59790784", "0.59790784", "0.59735584", "0.5...
0.75347185
1
Returns the number of syllables in a word. If there's more than one pronunciation, take the shorter one. If there is no entry in the dictionary, return 1.
def num_syllables(self, word): # TODO: provide an implementation! word = word.lower() D = self._pronunciations #D = nltk.corpus.cmudict.dict() if(word not in D.keys()): #print word not in CMUDictionary return 1 #count stores no of syllables for ea...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def num_of_syllables(self, word):\n\n if word.lower() in self.cmu_dict:\n return len([phoneme for phoneme in self.cmu_dict[word.lower()][0]\n if phoneme[-1].isdigit()])\n # If word is unknown, assume 1 syllable/3 letters (average for English)\n else:\n ...
[ "0.8187434", "0.7941615", "0.7839003", "0.77053165", "0.76928765", "0.76834965", "0.7579669", "0.7408953", "0.724696", "0.722788", "0.7227621", "0.71323586", "0.70042217", "0.69125587", "0.68785167", "0.68268627", "0.6769647", "0.67252815", "0.67212397", "0.6622493", "0.65549...
0.8625879
0
Takes text where lines are separated by newline characters. Returns True if the text is a limerick, False otherwise. A limerick is defined as a poem with the form AABBA, where the A lines rhyme with each other, the B lines rhyme with each other, and the A lines do not rhyme with the B lines.
def is_limerick(self, text): # TODO: provide an implementation! text = text.lower() p = [] p = text.split('\n') p = [i.strip(' ') for i in p] p = list(filter(None, p)) # all limericks must have 5 lines AABBA if len(p) != 5: return False ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_limerick(self, text):\n\n return False", "def is_limerick(self, text):\n \n sentences = text.splitlines()\n \n #remove blank setences\n sentences = [sentence for sentence in sentences if sentence.strip()] \n \n if len(sentences) != 5 : return False ...
[ "0.7332721", "0.7118218", "0.6140549", "0.58115304", "0.5777548", "0.5629705", "0.5620639", "0.5535499", "0.5423312", "0.5394802", "0.5378505", "0.53308886", "0.5302663", "0.5278468", "0.52720255", "0.5223611", "0.5223611", "0.51562977", "0.51394373", "0.5101829", "0.50781065...
0.7593807
0
Calculates sky background temperature for a given Galactic longitude (gl), Galactic latitude (gb), and frequency (freq in MHz). Coordinates are in degrees. Assuming spectral index of "index", default is 2.55 Return value is in K If frequency array 'freqs' is given, then Tsky is calculated for each frequency in the arra...
def tsky(gl, gb, freq, index, freqs=None): # reading the table nsky=np.zeros((90, 180), dtype=float) for ii in xrange(90): for jj in xrange(180): pos=(ii*180+jj)*5 nsky[ii,jj]=float(haslam_table[pos:pos+5]) # Convert to standard l,b b = int(gb + 90.5) if b >= 180: b = 179 l = int(gl + 0.5) if gl >= 36...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def tsky_range(gl, gb, f1, f2, index, freqs=None):\n\n\t# reading the table\n\tnsky=np.zeros((90, 180), dtype=float)\n\tfor ii in xrange(90):\n\t\tfor jj in xrange(180):\n\t\t\tpos=(ii*180+jj)*5\n\t\t\tnsky[ii,jj]=float(haslam_table[pos:pos+5])\n\n\t# Convert to standard l,b\n\tb = int(gb + 90.5)\n\tif b >= 180: b...
[ "0.7263583", "0.55189", "0.5414309", "0.52412045", "0.5169021", "0.51627105", "0.51417047", "0.51059294", "0.5028249", "0.49997443", "0.49332586", "0.4930508", "0.49028358", "0.48790222", "0.48755518", "0.4864208", "0.4823804", "0.4810659", "0.4780731", "0.4776312", "0.475257...
0.82942164
0
Calculates average sky background temperature for a given Galactic longitude (gl), Galactic latitude (gb), and between frequencies f1 and f2 (in MHz). Coordinates are in degrees. Assuming spectral index of "index", default is 2.55 Return value is in K If frequency array 'freqs' is given, then avergae Tsky is calculated...
def tsky_range(gl, gb, f1, f2, index, freqs=None): # reading the table nsky=np.zeros((90, 180), dtype=float) for ii in xrange(90): for jj in xrange(180): pos=(ii*180+jj)*5 nsky[ii,jj]=float(haslam_table[pos:pos+5]) # Convert to standard l,b b = int(gb + 90.5) if b >= 180: b = 179 l = int(gl + 0.5) if ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def tsky(gl, gb, freq, index, freqs=None):\n\n\t# reading the table\n\tnsky=np.zeros((90, 180), dtype=float)\n\tfor ii in xrange(90):\n\t\tfor jj in xrange(180):\n\t\t\tpos=(ii*180+jj)*5\n\t\t\tnsky[ii,jj]=float(haslam_table[pos:pos+5])\n\n\t# Convert to standard l,b\n\tb = int(gb + 90.5)\n\tif b >= 180: b = 179\n...
[ "0.7237736", "0.5336351", "0.53191733", "0.5311113", "0.52894306", "0.5208346", "0.5117886", "0.5105985", "0.50825256", "0.5041957", "0.4994894", "0.49861515", "0.49033117", "0.48573145", "0.48243278", "0.48106575", "0.4807822", "0.47676003", "0.4739023", "0.47271356", "0.471...
0.71738416
1
Verification process of signature for file name document
def verification(file_name: str) -> None: print("Verification process...") file_name = os.path.join('data', file_name) file1 = open("data/key.txt", "r") file2 = open("data/signature.txt", "r") p = int(file1.readline().rstrip()) q = int(file1.readline().rstrip()) g = int(file1.readline().rst...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def verify_signature_dialog():\n signature_name = input(\"Enter signature identity: \")\n file_path = input(\"Enter file path: \")\n user = input(\"Enter username: \")\n\n if not(os.path.exists(user)):\n raise Exception(ERRORS.NOT_FOUND_USER)\n if not(os.path.exists(f\"{signature_name}.sig\")...
[ "0.66871303", "0.6619433", "0.6604733", "0.65458876", "0.6505863", "0.6505863", "0.63899714", "0.63860995", "0.63552636", "0.6281927", "0.61876994", "0.61288184", "0.6126398", "0.6071543", "0.60413754", "0.6026036", "0.60181516", "0.5999449", "0.59889215", "0.5982611", "0.596...
0.67912775
0
return path for lights file
def lightPath(self): return mfl.mayaFile( self._path + '/lights.ma' )
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def lightLinkPath(self):\n\t\treturn fl.File( self._path + '/lights.data' )", "def darkpath(cam):\n return os.path.join(BASEPATH, cam + \"_dark\")", "def path_for(filename):\n if settings.value(Key.Theme) == Themes.Light.value:\n return (IMAGES_PATH / Themes.Light.value / filename).as_posix()\n ...
[ "0.82484734", "0.6809375", "0.66981214", "0.6469427", "0.6256557", "0.6256362", "0.62507707", "0.6244421", "0.62019056", "0.61183137", "0.61059153", "0.6080485", "0.6063016", "0.60597664", "0.60492027", "0.603537", "0.6034855", "0.602494", "0.5999086", "0.59892964", "0.597265...
0.820123
1
return the path for the shader file
def shaderPath(self): return mfl.mayaFile( self._path + '/shaders.ma' )
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getFragmentShader(self):\n return self.fshader", "def getCompiled(self):\n if self.isCompiled():\n return self.shader\n else:\n raise Exception(\"el shader no ha sido compilado aun\")", "def dataShader(self):\n\t\treturn self._shader", "def location( self, shade...
[ "0.6595272", "0.6361699", "0.634404", "0.63148177", "0.6163704", "0.614001", "0.610097", "0.6075785", "0.6053845", "0.5924668", "0.58730847", "0.5861786", "0.58363956", "0.58298504", "0.58051777", "0.579176", "0.578321", "0.5744046", "0.5737306", "0.5688931", "0.56700575", ...
0.86577046
0
return the path for the aovs file
def aovsPath(self): return fl.File( self._path + '/aovs.data' )
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def file_path(self):\n return self._obs_file()", "def get_oc_path(cfg):\n return os.path.join(\n BASE_DATA_DIR,\n \"castp\",\n \"pH\" + str(cfg.pH),\n str(cfg.mut),\n \"oc\" + str(cfg.probe) + \".csv\")", "def file_path(self) -> global___Expression:", "def file_pa...
[ "0.7047884", "0.6801188", "0.67156875", "0.6595521", "0.6526361", "0.6481086", "0.64795697", "0.6452638", "0.6423643", "0.6420651", "0.64015955", "0.6397468", "0.63639444", "0.63354146", "0.63254094", "0.630958", "0.6307452", "0.62829566", "0.6233461", "0.6226466", "0.622618"...
0.87796766
0
return the path for the masterLayer data
def masterPath(self): return fl.File( self._path + '/master.data' )
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def dataPath(self):\n return ''", "def data_path(self):\n raise NotImplementedError", "def dataPath(self):\n\t\treturn fl.File( self._path + '/renderLayerData.data' )", "def path(self):\n return self._data_file", "def getDataPath():\n\treturn \"..\" + os.sep + \"data\" + os.sep", "de...
[ "0.6769875", "0.6692991", "0.66356105", "0.642204", "0.63508654", "0.6319566", "0.63127893", "0.6197516", "0.6166026", "0.61191916", "0.6109279", "0.6093193", "0.60923404", "0.60806435", "0.60315734", "0.6025355", "0.60208064", "0.60151654", "0.6008396", "0.6005537", "0.59993...
0.8091495
0
export master layer settings so we can re apply it
def exportMasterLayerSettings(self): master = rlayer.RenderLayer( 'defaultRenderLayer' ) master.makeCurrent() masterData = {} nodes = ['defaultArnoldRenderOptions','defaultResolution','defaultRenderGlobals'] mnNodes =[ mn.Node( n ) for n in nodes ] for n in mnNodes: for a in n.listAttr( se = True, v = Tr...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def importMasterSettings(self):\n\t\tpickleData = pickle.load( open( self.masterPath.path, \"rb\" ) )\n\t\tmaster = rlayer.RenderLayer( 'defaultRenderLayer' )\n\t\tmaster.makeCurrent()\n\t\tfor a in pickleData.keys():\n\t\t\ttry:\n\t\t\t\ta.v = pickleData[a]\n\t\t\texcept:\n\t\t\t\tcontinue", "def restore_export...
[ "0.72975564", "0.5729428", "0.56773335", "0.5671888", "0.5636887", "0.5510333", "0.5465108", "0.54372466", "0.54338557", "0.5410532", "0.53921604", "0.53159", "0.52870184", "0.52698493", "0.5225601", "0.5222329", "0.5184534", "0.5180232", "0.5179325", "0.517133", "0.516891", ...
0.8537631
0
export data from scene, objects overrides in renderlayers.. etc
def exportData(self): lays = rlayer.renderlayers() data = {} for l in lays: if l.name == 'defaultRenderLayer': continue data[l.name] = {'objects':l.objects, # OBJECTS IN LAYER 'values' :l.overridesWithValues, # OVERRIDED ATTRIBUTES ONLY CHANGED VALUES 'conns' :l.over...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def process_scene_data(self, scene, data, tmp_dir):\n pass", "def writeObject(self,view,renderer):\n\n if not view.Source:\n return \"\"\n\n # point light hook\n proxy = getattr(view.Source,\"Proxy\",None)\n if getattr(proxy,\"type\",None) == \"PointLight\":\n ...
[ "0.63344496", "0.62675095", "0.6227879", "0.6224553", "0.6189659", "0.6154672", "0.6018009", "0.59942466", "0.5959543", "0.5952904", "0.591055", "0.5901034", "0.588326", "0.5835366", "0.58250904", "0.5816034", "0.57584465", "0.57536954", "0.5716126", "0.57042253", "0.5703749"...
0.73334426
0
export lights from scene
def exportLights(self): #TODO! REMOVE CONSTRAINS lights = mc.ls( typ=['light','aiAreaLight','aiSkyDomeLight','aiVolumeScattering','aiSky'], l=1 ) mc.editRenderLayerGlobals( currentRenderLayer = 'defaultRenderLayer' ) litsToExport = [] for li in lights: finalLi = li.split( '|' ) if len(finalLi) == 1: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def export_lights(lamps, file, scene, global_matrix, tab_write):\n\n from .render import write_matrix, tab_write\n\n # Incremented after each lamp export to declare its target\n # currently used for Fresnel diffuse shader as their slope vector:\n global exported_lights_count\n # Get all lamps and ke...
[ "0.70548475", "0.6534689", "0.6220881", "0.6124191", "0.6103418", "0.5953071", "0.59508586", "0.592486", "0.5756125", "0.5698417", "0.5659417", "0.56495863", "0.55890954", "0.55873734", "0.5572616", "0.55421257", "0.54985136", "0.54800266", "0.54774386", "0.54722345", "0.5455...
0.7741908
0
export all the lightlinking in the scene
def exportLightLinking(self): lights = [a for a in mc.ls( typ = ['light','aiAreaLight'] ) if not 'eye' in a] allShapes = [s for s in mc.ls( type = 'geometryShape', ni = 1) if not (mc.objectType( s ) in ( 'aiAreaLight','aiSkyDomeLight' ))] litLinks = {} for l in lights: lightLinkShapes = mc.lightlink( que...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def exportLights(self):\n\t\t#TODO! REMOVE CONSTRAINS\n\t\tlights = mc.ls( typ=['light','aiAreaLight','aiSkyDomeLight','aiVolumeScattering','aiSky'], l=1 )\n\t\tmc.editRenderLayerGlobals( currentRenderLayer = 'defaultRenderLayer' )\n\t\tlitsToExport = []\n\t\tfor li in lights:\n\t\t\tfinalLi = li.split( '|' )\n\t\...
[ "0.780936", "0.6795471", "0.5878799", "0.5863147", "0.5783751", "0.57724273", "0.5699046", "0.5667319", "0.5579326", "0.5527161", "0.5456355", "0.54548293", "0.5452703", "0.5451087", "0.54337513", "0.5404285", "0.5384086", "0.5363154", "0.53607535", "0.53221077", "0.53212357"...
0.8114935
0
export aovs from scene
def exportAovs(self): aovs = mc.ls( typ = 'aiAOV' ) aovData = {} for a in aovs: aovData[a] = {} aovData[a]['enabled'] = mc.getAttr( a + '.enabled' ) aovData[a]['name'] = mc.getAttr( a + '.name' ) aovData[a]['type'] = mc.getAttr( a + '.type' ) pickle.dump( aovData, open( sel...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def menu_func(self, context):\n op = self.layout.operator(OP_ogre_export.bl_idname, text=\"Ogre3D (.scene and .mesh)\")\n return op", "def create_scene(self):\n \n self.scene=soya.World()", "def import_scene(file_path):\n\n pass", "def exports():", "def menu_save_scene(self):\n fi...
[ "0.6807009", "0.61583364", "0.60997474", "0.6089782", "0.5898155", "0.5882427", "0.5869277", "0.58672017", "0.5798506", "0.56990576", "0.5693678", "0.56637156", "0.5612492", "0.5589226", "0.553898", "0.5532267", "0.55292517", "0.55200547", "0.5514314", "0.5509473", "0.5498411...
0.6433381
1
import lights in scene
def importLights(self, asset = '', searchAndReplace = ['',''] ): if self.lightPath.exists: self.lightPath.imp() if self.lightLinkPath.exists: self.importLightLinking( asset, searchAndReplace )
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def setupLights(self) :\n\t\tself.ambientLight = render.attachNewNode(AmbientLight( \\\n\t\t\t\t\t\"ambientLight\"))\n\t\tself.ambientLight.node().setColor(Vec4(.8,.8,.8,1))\n\t\trender.setLight(self.ambientLight)\n\n\t\tdLight1 = DirectionalLight(\"dLight1\")\n\t\tdLight1.setColor(Vec4(6,5,7,1))\n\t\tdLight1.setD...
[ "0.7125975", "0.6562322", "0.65274394", "0.6518946", "0.6397606", "0.63027537", "0.62996095", "0.6106556", "0.6032271", "0.6012362", "0.59544396", "0.5917386", "0.59018606", "0.58937645", "0.58840954", "0.58633345", "0.5855364", "0.577707", "0.57750875", "0.5726249", "0.56992...
0.65937054
1
import light linking to lights
def importLightLinking(self, asset = '', searchAndReplace = ['',''] ): LayersInfo = pickle.load( open( self.lightLinkPath.path, "rb") ) mc.refresh( su = 1 ) if not asset == '': LayersInfo = self.filterLightLinksData( LayersInfo , asset, searchAndReplace ) for l in LayersInfo.keys(): objsToBreakLink = [] ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def importLights(self, asset = '', searchAndReplace = ['',''] ):\n\t\tif self.lightPath.exists:\n\t\t\tself.lightPath.imp()\n\t\t\tif self.lightLinkPath.exists:\n\t\t\t\tself.importLightLinking( asset, searchAndReplace )", "def setupLights(self) :\n\t\tself.ambientLight = render.attachNewNode(AmbientLight( \\\n\...
[ "0.7286741", "0.6968058", "0.667978", "0.6516438", "0.6463352", "0.6461872", "0.6437315", "0.6400645", "0.63854384", "0.63444823", "0.6283221", "0.62622285", "0.6234883", "0.61583436", "0.61548394", "0.614277", "0.6137061", "0.61298877", "0.61078626", "0.61018175", "0.6089106...
0.70111126
1
filter light linking data for the specific asset
def filterLightLinksData(self, LayersInfo , asset, sAr = ['',''] ): lightData = [(a.replace( sAr[0], sAr[1] ),LayersInfo[a].replace( sAr[0], sAr[1] )) for a in LayersInfo.keys() if asset in a] return dict( lightData )
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def importLightLinking(self, asset = '', searchAndReplace = ['',''] ):\n\t\tLayersInfo = pickle.load( open( self.lightLinkPath.path, \"rb\") )\n\t\tmc.refresh( su = 1 )\n\t\tif not asset == '':\n\t\t\tLayersInfo = self.filterLightLinksData( LayersInfo , asset, searchAndReplace )\n\t\tfor l in LayersInfo.keys():\n\...
[ "0.5837777", "0.5805665", "0.56016874", "0.53269315", "0.53257084", "0.52495986", "0.52477026", "0.5235335", "0.51835656", "0.51263887", "0.5116933", "0.51134336", "0.50554407", "0.505449", "0.5049599", "0.5036466", "0.5035692", "0.50177574", "0.50123763", "0.49872875", "0.49...
0.7130668
0
import aovs into scene
def importAovs(self): LayersInfo = pickle.load( open( self.aovsPath.path, "rb") ) mc.refresh( su = 1 ) for ao in LayersInfo.keys(): aov.create( ao, LayersInfo[ao]['name'], LayersInfo[ao]['type'], LayersInfo[ao]['enabled'] ) mc.refresh( su = 0 )
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def import_scene(file_path):\n\n pass", "def importBaseScene(self):\n logger.debug(\"Func: importBaseScene\")\n relSceneFile = self._currentSceneInfo[\"Versions\"][self._currentVersionIndex-1][\"RelativePath\"]\n absSceneFile = os.path.join(self.projectDir, relSceneFile)\n if os.pa...
[ "0.7213218", "0.63318026", "0.59511834", "0.5773653", "0.5763489", "0.5640468", "0.5608729", "0.5585865", "0.55745476", "0.5565132", "0.5552705", "0.5474964", "0.5472537", "0.5469946", "0.5382948", "0.5356013", "0.5355673", "0.5343927", "0.5336113", "0.53249675", "0.5310616",...
0.7212844
1
import shaders into scene
def importShaders(self): if self.shaderPath.exists: self.shaderPath.imp()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _on_load_scene_shaders(self):\n\n artellapipe.ShadersMgr().load_scene_shaders()", "def init_shaders():\n global shaders\n\n vertex_shader = glCreateShader(GL_VERTEX_SHADER)\n glShaderSource(vertex_shader,open('shaders/vs-phong-interp.c','r').read())\n glCompileShader(vertex_shader)\n re...
[ "0.7801303", "0.74852675", "0.7035145", "0.69157875", "0.68511426", "0.68024266", "0.67894316", "0.65204686", "0.64844674", "0.64807636", "0.6422864", "0.6374863", "0.6357216", "0.6319503", "0.61505246", "0.61424196", "0.6106217", "0.60896313", "0.60892934", "0.60849136", "0....
0.7719651
1
import data from file asset = Only import for the asset that you want searchAndReplace = Change any part of the objects name to another word
def importData( self, asset = '', searchAndReplace = ['',''] ): pickleData = pickle.load( open( self.dataPath.path, "rb" ) ) layers = [RenderLayerData(l,d) for l,d in pickleData.items() if not ':' in l] for l in layers: if not searchAndReplace [0]== '' or not searchAndReplace[1] == '': l.filterMe( asset, s...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def replace(name, newobject):", "def renameAssetObjects(self):\n\t\tfor i,o in enumerate( self.objects ):\n\t\t\tmn.Node( o ).name = self.name + '%i'%i", "def loadAssetTypeSpecialCaseFromFile(file):\n\tstringToTuple = compose(\n\t\ttuple\n\t , partial(map, lambda s: s.strip())\n\t , lambda s: s.split(',')\n\...
[ "0.61271197", "0.5805997", "0.5651167", "0.5605872", "0.5587787", "0.5498569", "0.54969203", "0.53437096", "0.53432715", "0.5332981", "0.532139", "0.53159696", "0.5253007", "0.52161473", "0.52138823", "0.51546794", "0.5153983", "0.5098517", "0.5057885", "0.5048195", "0.504511...
0.67480993
0
import master settings from data file
def importMasterSettings(self): pickleData = pickle.load( open( self.masterPath.path, "rb" ) ) master = rlayer.RenderLayer( 'defaultRenderLayer' ) master.makeCurrent() for a in pickleData.keys(): try: a.v = pickleData[a] except: continue
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def load_settings(self, config):\n user = config.get(self.bot.client.host, 'master')\n # Replace old master\n if ':master' in self.users and user != self.users[':master']:\n self.users[self.users[':master']]['rank'] = 'none'\n if not user in self.users:\n self.user...
[ "0.62687576", "0.6112625", "0.60982084", "0.599278", "0.59767", "0.5931371", "0.5877606", "0.58080935", "0.5805709", "0.58034456", "0.57821137", "0.57619953", "0.57555234", "0.5754049", "0.5751691", "0.57266325", "0.5715067", "0.5707333", "0.5681978", "0.56536126", "0.5650209...
0.7781248
0
return the overrides in the layer
def dataOverrides(self): return self._overrides
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def overrides(self) -> ConfigNodePropertyArray:\n return self._overrides", "def default_binding_overrides(self):\n return self.__default_binding_overrides", "def ComponentOverrides(self):\n return tuple(self._json_obj.get('component_overrides', {}).items())", "def makeOverrides(self):\n\t\tself....
[ "0.6976614", "0.6493725", "0.6390087", "0.6375561", "0.6312835", "0.6241755", "0.60139596", "0.59983903", "0.5893521", "0.5878425", "0.5835658", "0.5816514", "0.5811458", "0.58073103", "0.5771545", "0.5764795", "0.57407266", "0.5684022", "0.5561158", "0.5544201", "0.55372936"...
0.72761494
0
When the user posts the find_org_to_create_account form, redirect to that page
def find_org_to_create_account(request): if request.method != 'POST' or not request.POST.get('organization_slug'): return HttpResponseRedirect(reverse('home')) else: org_slug = request.POST.get('organization_slug') return HttpResponseRedirect(reverse('create_org_account', args=[org_slug]...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def oauth_start_flow():\n # Have to do authentication!\n rest.default_user_authentication()\n\n account_type = flask.request.args.get('type')\n if account_type is None:\n flask.abort(400)\n\n cls = ACCOUNT_TYPES.get(account_type, None)\n if cls is None:\n flask.about(400)\n\n key = str(uuid.uuid4())\n...
[ "0.603463", "0.6004999", "0.5971245", "0.5959396", "0.5919654", "0.58651173", "0.58611304", "0.58471966", "0.582282", "0.57899594", "0.578932", "0.57571214", "0.57511485", "0.574679", "0.57035786", "0.56987613", "0.56865185", "0.5668221", "0.5650241", "0.5633905", "0.5633754"...
0.81982374
0
df is a function of x_i, y_i, beta
def sgd_step(df, alpha, prev_beta, xy_i): x_i, y_i = xy_i gradient = df(x_i, y_i, prev_beta) return [beta_j + alpha * df_j for beta_j, df_j in zip(prev_beta, gradient)]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_beta(self,df,tick,ind):\n cov = get_cov(df,tick,ind)\n var = df[ind].var()\n beta = cov / var\n return beta", "def create_beta_posteriors(df):\n goods = df.num_matured - df.fpd\n df['alpha_p'] = df.alpha + df.fpd\n df['beta_p'] = df.beta + goods\n return df", "de...
[ "0.68780404", "0.6571103", "0.65438884", "0.6472203", "0.62649596", "0.622851", "0.6134441", "0.6110367", "0.6021685", "0.5859265", "0.5851953", "0.5832189", "0.57926506", "0.5776251", "0.5776251", "0.5743775", "0.56781954", "0.56520283", "0.5651162", "0.5608268", "0.5604049"...
0.66248494
1
Get the color of the mask at position. Using 2 bits as a color.
def get_color(mask: int, position: int): return (mask >> (position << 1)) & 3
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def mask_color(self):\n return self._mask_color", "def set_color(mask: int, position: int, color: int):\n return mask | (color << (position << 1))", "def get_color(self, point):\n \n d = point - self._origin\n dist = int(d.dot(d) ** 0.5) % 2\n if dist == 0:\n ...
[ "0.6762996", "0.6617752", "0.6400042", "0.6352335", "0.6179756", "0.607116", "0.60303086", "0.5943762", "0.59284455", "0.58960706", "0.58665735", "0.58665735", "0.58594924", "0.5858215", "0.58338976", "0.57897294", "0.5776139", "0.5772793", "0.5763152", "0.5751781", "0.574337...
0.8632774
0
Set the color of the mask at position. Using 2 bits as a color.
def set_color(mask: int, position: int, color: int): return mask | (color << (position << 1))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_color(mask: int, position: int):\n return (mask >> (position << 1)) & 3", "def SetMaskColour(*args, **kwargs):\n return _gdi_.Bitmap_SetMaskColour(*args, **kwargs)", "def setColorIndex(idx):\n dislin.setclr(idx)", "def set_pixel(framebuf, x, y, color):\n index = (y >> 3) *...
[ "0.67938983", "0.67375386", "0.6516931", "0.6429108", "0.64179796", "0.6417907", "0.63744414", "0.6285334", "0.61303943", "0.6114359", "0.61034447", "0.6082238", "0.6080526", "0.6059235", "0.60527635", "0.6043658", "0.60351825", "0.59847206", "0.5964086", "0.5936446", "0.5918...
0.8528009
0
Create a new ir.Set instance with given attributes. Absolutely all ir.Set instances must be created using this constructor.
def new_set(*, ctx: context.ContextLevel, **kwargs) -> irast.Set: ir_set = irast.Set(**kwargs) ctx.all_sets.append(ir_set) return ir_set
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self, **attributes):\n self.set(**attributes)", "def __init__(self,\n *,\n attributes: List['Attribute'] = None) -> None:\n self.attributes = attributes", "def newChemAtomSet(self, **attrlinks):\n return ChemAtomSet(self, **attrlinks)", "def __ini...
[ "0.7283344", "0.6427488", "0.64081055", "0.621952", "0.620814", "0.6190213", "0.6113432", "0.6045844", "0.600017", "0.600017", "0.59091234", "0.59091234", "0.59091234", "0.58970034", "0.584854", "0.5807153", "0.5795997", "0.5795997", "0.579595", "0.57853985", "0.57681274", ...
0.7015722
1
Create a new ir.Set from another ir.Set. The new Set inherits source Set's scope, schema item, expression, and, if preserve_scope_ns is set, path_id. If preserve_scope_ns is False, the new Set's path_id will be namespaced with the currently active scope namespace.
def new_set_from_set( ir_set: irast.Set, *, preserve_scope_ns: bool=False, path_id: typing.Optional[irast.PathId]=None, stype: typing.Optional[s_types.Type]=None, ctx: context.ContextLevel) -> irast.Set: if path_id is None: path_id = ir_set.path_id if not preserve...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def new_set(*, ctx: context.ContextLevel, **kwargs) -> irast.Set:\n ir_set = irast.Set(**kwargs)\n ctx.all_sets.append(ir_set)\n return ir_set", "def create_set(self, setname='new_set', based_on='data file', included=None,\n excluded=None, strings='keep', arrays='masks', replace=None,\...
[ "0.6440217", "0.58299524", "0.56834817", "0.53686655", "0.5344023", "0.5315017", "0.52834666", "0.5264932", "0.5153018", "0.50790906", "0.5055263", "0.5012567", "0.49638426", "0.49290437", "0.49098164", "0.4880802", "0.48652387", "0.4844571", "0.48155996", "0.48035938", "0.47...
0.85868055
0
Return ir.Set for a pointer defined as a computable.
def computable_ptr_set( rptr: irast.Pointer, *, unnest_fence: bool=False, same_computable_scope: bool=False, ctx: context.ContextLevel) -> irast.Set: ptrcls = rptr.ptrcls source_set = rptr.source source_scls = source_set.stype # process_view() may generate computable poin...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getSet(unique_name):", "def getSet(unique_name):", "def set():", "def visit_Set(self, node):\n self.generic_visit(node)\n return to_call(to_attribute(self.operator, '__set__'), node.elts)", "def set_of(element: Type) -> SetType:\n return SetType(element)", "def __rxor__(self, other: ...
[ "0.63821733", "0.63821733", "0.6101638", "0.60650355", "0.5940626", "0.5939873", "0.5794654", "0.5785868", "0.5782201", "0.5721857", "0.5620131", "0.55960476", "0.559237", "0.55909944", "0.55824697", "0.5576209", "0.55492747", "0.5549152", "0.55308235", "0.551", "0.5487735", ...
0.69799614
0
return founder and offspring subset of basename.ped containing only the markers in lcd lcd contains a sorted list of (chrom,offset,rs) for the common snps in all maps we need to keep genotypes all in the same column order
def subsetPed(basename="",lcdmap = [],faff='1', ofaff='2'): mf = file('%s.map' % basename,'r').readlines() lmap = [x.strip().split() for x in mf] rscols = {} # lookup marker table colrs = [] # lookup rs from column for i,m in enumerate(lmap): # get columns to keep in the order we want them ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getLCD(lbase=[]):\r\n listmf = []\r\n rsdict = {}\r\n for i,basename in enumerate(lbase): # for each basename to be included\r\n mf = file('%s.map' % basename,'r').readlines()\r\n lmap = [x.strip().split() for x in mf] \r\n rslist = [x[1] for x in lmap] # chrom rs gendist physdist...
[ "0.6327156", "0.61232364", "0.56347793", "0.56296253", "0.5618694", "0.5515025", "0.54627013", "0.5458853", "0.538327", "0.53801644", "0.53717375", "0.52709544", "0.5267916", "0.52162147", "0.5175573", "0.5166157", "0.51569754", "0.5155961", "0.51448816", "0.5137253", "0.5111...
0.675231
0
take a list of basenames, get lcd and merge set founder affection according to faff flag and offspring according to ofaff flag
def mergePed(bnlist=[],faff=[],ofaff=[],newbasename='newped',fo=0): lcdmap = getLCD(bnlist) # list of chr,offset,rs for all snp common to all files print 'got %d lcd snps-%s' % (len(lcdmap),lcdmap[:5]) cfped = [] coped = [] cfgeno = [] cogeno = [] allrsa = {} ignorers = {} f...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def autocontext_forests(dirname):\n rf_files = []\n for filename in os.listdir(dirname):\n fullname = os.path.join(dirname, filename)\n if os.path.isfile(fullname) and len(filename) >= 8:\n base, middle, end = filename[:3], filename[3:-4], filename[-4:]\n if base == \"rf_\...
[ "0.58278376", "0.569089", "0.5623684", "0.56120443", "0.5441088", "0.53539836", "0.5308381", "0.5256427", "0.52116", "0.51895374", "0.5147063", "0.5108449", "0.51060414", "0.5100264", "0.5047533", "0.5038564", "0.5021236", "0.5014878", "0.50056285", "0.49947405", "0.49672922"...
0.64975625
0
Test list secrets when not connected to any cluster.
def test_secrets_list_server_not_reachable(): message = "REANA client is not connected to any REANA cluster." reana_token = "000000" runner = CliRunner() result = runner.invoke(cli, ["secrets-list", "-t", reana_token]) assert result.exit_code == 1 assert message in result.output
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async def list_secrets(self):\n pass", "def test_read_namespaced_secret_list_secrets(self):\n pass", "def test_secrets_list_server_no_token():\n message = \"Please provide your access token\"\n env = {\"REANA_SERVER_URL\": \"localhost\"}\n runner = CliRunner(env=env)\n result = runner...
[ "0.7848596", "0.77356535", "0.73634505", "0.71850795", "0.7145914", "0.6926122", "0.674381", "0.655007", "0.64121014", "0.639309", "0.6267915", "0.6263949", "0.6144681", "0.61244977", "0.6104293", "0.6090162", "0.6053545", "0.60486376", "0.601324", "0.59840655", "0.59817785",...
0.77385426
1
Test list secrets when access token is not set.
def test_secrets_list_server_no_token(): message = "Please provide your access token" env = {"REANA_SERVER_URL": "localhost"} runner = CliRunner(env=env) result = runner.invoke(cli, ["secrets-list"]) assert result.exit_code == 1 assert message in result.output
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_read_namespaced_secret_list_secrets(self):\n pass", "def test_check_secrets(self):\n secrets.check_secrets([], argparse.Namespace())", "def test_secrets_list_server_not_reachable():\n message = \"REANA client is not connected to any REANA cluster.\"\n reana_token = \"000000\"\n ...
[ "0.71583724", "0.697432", "0.6764023", "0.6734302", "0.657616", "0.6429628", "0.63544613", "0.6260767", "0.6180775", "0.61721295", "0.61655974", "0.6159696", "0.6127158", "0.6099549", "0.60978544", "0.60681677", "0.60320014", "0.60044026", "0.59975713", "0.59924906", "0.59404...
0.77104926
0
Test adding secrets with wrong format.
def test_secrets_add_wrong_format(secret): reana_token = "000000" env = {"REANA_SERVER_URL": "localhost"} runner = CliRunner(env=env) message = 'For literal strings use "SECRET_NAME=VALUE" format' result = runner.invoke(cli, ["secrets-add", "-t", reana_token, "--env", secret]) assert result.exi...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_check_secrets(self):\n secrets.check_secrets([], argparse.Namespace())", "def test_generate_secret(self):\n random_secret = ef_password.generate_secret(24)\n self.assertEqual(len(random_secret), 24)\n assert not set('[~!@#$%^&*()_+{}\":;\\']+$').intersection(random_secret)", "def test_...
[ "0.75044936", "0.707541", "0.70254934", "0.6977966", "0.67734826", "0.67173374", "0.6702236", "0.66481084", "0.6610407", "0.6495734", "0.642665", "0.6363775", "0.63510156", "0.6331783", "0.6269925", "0.6216668", "0.6207249", "0.61964357", "0.61894506", "0.6124794", "0.6116386...
0.8482589
0
Test adding secrets when they already exist.
def test_secrets_add_already_exist(): status_code = 409 reana_token = "000000" env = {"REANA_SERVER_URL": "localhost"} message = "One of the secrets already exists. No secrets were added." mock_http_response = Mock( status_code=status_code, reason="Conflict", json=Mock(return...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_check_secrets(self):\n secrets.check_secrets([], argparse.Namespace())", "def test_secret(self, env: yaenv.Env):\n assert env.secret() == 'notsosecret'\n assert 'NEW_SECRET_KEY' not in env\n _secret = env.secret('NEW_SECRET_KEY')\n assert _secret is not None\n a...
[ "0.7291631", "0.7147517", "0.6715984", "0.6684597", "0.66473454", "0.66376173", "0.6494984", "0.6443271", "0.6437272", "0.6393369", "0.629985", "0.6255083", "0.62139803", "0.61440545", "0.602208", "0.5996874", "0.5979041", "0.5953571", "0.59042215", "0.58320487", "0.58229697"...
0.7203451
1
Optimized version of the generic paginate_query_across_partitioned_databases for case schedules queue_schedule_instances uses a lock to ensure that the same case_id cannot be queued within one hour of another instance The celery tasks handle_case_alert_schedule_instance and handle_case_timed_schedule_instance both use ...
def _paginate_query_across_partitioned_databases(model_class, q_expression, load_source): from corehq.messaging.scheduling.scheduling_partitioned.models import ( CaseAlertScheduleInstance, CaseTimedScheduleInstance, ) if model_class not in (CaseAlertScheduleInstance, CaseTimedScheduleInstan...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def scheduling_method(self, cur_time, es, es_dict):\n dispatching_plan = []\n\n resource_types = self.resource_manager.resource_types\n avl_resources = self.resource_manager.current_availability\n system_capacity = self.resource_manager.system_capacity('nodes')\n\n # ============...
[ "0.5548428", "0.5151464", "0.48518416", "0.47420847", "0.46796945", "0.46776414", "0.4667777", "0.4659418", "0.46430779", "0.46141425", "0.45946392", "0.45765543", "0.4571356", "0.45686328", "0.45587033", "0.45582697", "0.4556789", "0.45445147", "0.454312", "0.4534792", "0.45...
0.62616307
0
This method is used to terminate a job with the specified or a group of jobs job_id or job_name in a given cluster
def delete(cls, cluster, job, group=None): try: if group is not None: # get the job ids from the db arguments = {'cluster': cluster, 'group': group} db_jobs = cls.cm.find('batchjob', *...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def terminate(ctx):\n ctl = ctx.ctl\n jobs = ctl('list-avail', '--partition', 'main', flatten=False)\n\n for job in jobs:\n jobid = job['id']\n click.echo('Terminating {}'.format(jobid))\n ctl('terminate', '--jobid', jobid)", "def kill_job(self, job):\n\n if job.status == Job...
[ "0.69394773", "0.6439822", "0.6429004", "0.63975894", "0.6377325", "0.6343466", "0.6278735", "0.62779915", "0.62628543", "0.61729574", "0.6161055", "0.61369205", "0.6120452", "0.61027503", "0.60934454", "0.60848886", "0.60653436", "0.6043757", "0.5999601", "0.5956319", "0.595...
0.7375492
0
Function to set the tolerance.
def set_tolerance(self, tol): self.tolerance = tol
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def tolerance(self, tolerance: float) -> None:\n self._tolerance = tolerance", "def set_tolerance(self, value):\n\n self._tolerance = value", "def set_tolerance(self, tol):\n self.precision = tol\n return", "def tol(self, value):\n self._tol = value", "def set_tol(self, t...
[ "0.8269015", "0.81052655", "0.79584485", "0.7956575", "0.78157336", "0.7737034", "0.7723517", "0.76122135", "0.7429519", "0.7174162", "0.71566623", "0.7126722", "0.7088782", "0.68695533", "0.6833426", "0.676617", "0.66971606", "0.668103", "0.66773707", "0.665312", "0.6650963"...
0.8542296
0
Function to revert the direction of the current line. Returns
def revert(self): reverted = Line(l=self) reverted.direction *= -1.0 return reverted
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def fliped(self):\n return Line(self.end, self.start, self)", "def reversed(self):\n return LINE(*self.elems,**{'reverse':(not self.reverse)})", "def _inverse_lines(self):\n pass", "def revert(self, *args, **kwargs):", "def _backup_line(self):\n if self._orig_line is None:\n ...
[ "0.68525314", "0.6473832", "0.64653385", "0.64345104", "0.64087176", "0.6327431", "0.6293631", "0.6287279", "0.62672716", "0.6193143", "0.6137352", "0.61128193", "0.6102303", "0.60842335", "0.60765207", "0.6057564", "0.60540533", "0.60380507", "0.6030797", "0.60029155", "0.59...
0.85526377
0
Function to get the abscissa of a point with respect to a line. The abscissa is 0 if the projection of the point and the projection of the frame origin on the line are the same point.
def get_abscissa(self, p): return np.dot(p - self.zero, self.direction)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_line_to(self, point):\n\n b = ((self.x - point.x)*point.y - (self.y - point.y)*point.x)/(self.x - point.x)\n\n a = (self.y - point.y)/(self.x - point.x)\n\n return a, b", "def _dist_point2line(self, point: ndarray,\n line: Tuple[ndarray, ndarray]) -> ndarray:\...
[ "0.659462", "0.6087625", "0.6012542", "0.59856695", "0.58890575", "0.58882195", "0.5846869", "0.5727574", "0.57215995", "0.57181567", "0.57152516", "0.56363255", "0.5614506", "0.5601204", "0.55724233", "0.55630857", "0.55362034", "0.5515001", "0.5511656", "0.55000144", "0.548...
0.6117362
1
Get the status code as per ttype and it's status_val
def get_status_code(self, ttype, status_val) -> str: # get the status code from __status_code or __default_code pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def status_code(self):\n return int(self.status.split()[1])", "def get_status_code(status):\n return dict(const.STATUS_CODES).get(status)", "def status_code(self):\r\n return int(self._status[:3])", "def status_code(self):\n return int(self._status[:3])", "def _parse_status(self...
[ "0.7202656", "0.71696675", "0.7097821", "0.6938727", "0.68742913", "0.68445003", "0.68133837", "0.6747887", "0.67144114", "0.6705535", "0.662726", "0.6622442", "0.6621217", "0.66081154", "0.6606708", "0.6606708", "0.6598715", "0.65756345", "0.65702355", "0.65538526", "0.65501...
0.86103326
0
To check if payload to be processed with this lambda
def apply_filter(self, payload: dict, ainfos) -> (dict, dict): # check if needs to process by this lambda pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def verify_payload():\n return True", "def process(self, payload, status_code=0):", "def has_payload(self):\n\n if self._payload:\n return True\n return False", "def __should_payload_execute(self, queue_item):\n\n soup = queue_item.get_soup_response()\n\n ng_app_...
[ "0.6974256", "0.6329951", "0.6317524", "0.5889682", "0.58806306", "0.5717963", "0.57109547", "0.56970483", "0.56970483", "0.56906414", "0.566029", "0.55937403", "0.5567957", "0.5565435", "0.5472518", "0.5453765", "0.5410358", "0.54089427", "0.53794", "0.5371008", "0.53691435"...
0.66218215
1
Use ansi code on 'string' if the output is the terminal of a not Windows platform
def isSpecial(ansiCode,string): if IS_TERMINAL and not IS_WIN32: return ansiCode+string+ANSI_END else: return string
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def b(string):\n return \"\\033[94m{0}\\033[0m\".format(string)", "def ansi(color, text):\r\n code = COLOR_CODES[color]\r\n return '\\033[1;{0}m{1}{2}'.format(code, text, RESET_TERM)", "def ansi_escape(text: object) -> str:\n return str(text).replace(\"\\x1b\", \"?\").replace(\"\\b\", \"?\")", ...
[ "0.698737", "0.6955122", "0.68967116", "0.6775408", "0.67163545", "0.6666538", "0.6612062", "0.6594532", "0.6576787", "0.6540611", "0.6525283", "0.6465225", "0.6419213", "0.6390745", "0.6369478", "0.63463056", "0.6337062", "0.6330112", "0.6313778", "0.6313092", "0.6297528", ...
0.771174
0
Sort list of TKey by their names ignoring the case
def keyListSort(keyList): keyList.sort(key=lambda y: y.GetName().lower())
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def sortCaseInsensitive(*args, **kwargs)->List[AnyStr]:\n pass", "def sort_by_name(list_to_sort):\n return sorted(\n list_to_sort,\n key=lambda k: k['Name'].lower()\n )", "def natsort_icase(lst: List[str]) -> None:\n lst.sort(key=natsort_key_icase)", "def human_sort(l):\n l.sort(...
[ "0.7360461", "0.7314273", "0.6833507", "0.67649287", "0.66534966", "0.6629779", "0.6619612", "0.6566453", "0.65517783", "0.6549519", "0.6549519", "0.65458226", "0.65365845", "0.65276384", "0.6501143", "0.64999694", "0.64592296", "0.6409549", "0.6385534", "0.6382833", "0.63771...
0.818581
0
Sort list of tuple by their first elements ignoring the case
def tupleListSort(tupleList): tupleList.sort(key=lambda y: y[0].lower())
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _mySort(self, alist):\n return sorted(alist, key=lambda x: (x[0].isdigit(), x.lower()))", "def sort_list_of_tuples(list):\n list.sort(key=lambda x: x[0])\n return list", "def sortCaseInsensitive(*args, **kwargs)->List[AnyStr]:\n pass", "def natsort_case_insensitive(seq):\r\n return nat...
[ "0.70666724", "0.6958094", "0.6883425", "0.68414825", "0.6625755", "0.65509486", "0.64947134", "0.64417565", "0.6294914", "0.62795585", "0.6264345", "0.6251216", "0.6234281", "0.62279594", "0.62186223", "0.62157", "0.6190618", "0.6180634", "0.6172756", "0.61627626", "0.615647...
0.8253932
0
Use sys.stdout.write to write the string with an indentation equal to indent and specifying the end character
def write(string,indent=0,end=""): sys.stdout.write(" "*indent+string+end)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def indentOut_ (stream, indent) :\r\n if indent == 0 :\r\n return\r\n else :\r\n stream.write(\" \"*indent)", "def out_indent(indent, *args):\n s = \"\"\n s += indent * \" \"\n s += \" \".join(args)\n return s", "def try_print_indent(self):\n if self.lasttoken[0] != lex.T...
[ "0.7758625", "0.6414926", "0.6342674", "0.6169035", "0.6082922", "0.59543496", "0.5942104", "0.5933664", "0.58904225", "0.5866938", "0.5845034", "0.5830857", "0.5830536", "0.5825642", "0.5822062", "0.58123285", "0.58008015", "0.5715586", "0.5666716", "0.5651807", "0.56485546"...
0.8376877
0
Print informations given by keyList with a rools style choosen with optDict
def roolsPrint(keyList,optDict,indent=0): if optDict['long'] or optDict['tree']: \ roolsPrintLongLs(keyList,optDict,indent) else: roolsPrintSimpleLs(keyList,indent)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def printDict(myDict):\n for key in myDict:\n print(f\"Version: --> {myDict[key]['version']} \")\n print(f\"Accuracy: --> {myDict[key]['accuracy']}\")\n print(f\"Time --> {myDict[key]['time_per_target']}\")\n print(f\"Penalty --> {myDict[key]['target_w_penalt...
[ "0.6518504", "0.6352941", "0.63204557", "0.6319985", "0.62665594", "0.61978984", "0.6115929", "0.6110398", "0.60612506", "0.59930515", "0.5966976", "0.59666437", "0.59666437", "0.59537727", "0.5947354", "0.59427744", "0.5914536", "0.5914091", "0.582117", "0.5819495", "0.58194...
0.7562387
0
Get a Producer queue instance
def getProducer(): # get the config and a producer config = ecommerce.config.getConfig() return ecommerce.queue.queue(config, queuePrefix)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_queue():\n\n return multiprocessing.Queue()", "def get(queue_name: str, **kwargs) -> Queue:\n return Queue(queue_name, **kwargs)", "def _get_queue(self):\n return self.__queue", "def _get_queue(self):\n return self.__queue", "def _get_queue(self):\n return self.__queue", "def _...
[ "0.7450264", "0.7052122", "0.69740534", "0.69740534", "0.69740534", "0.69740534", "0.69740534", "0.69740534", "0.69740534", "0.69740534", "0.69740534", "0.69740534", "0.69740534", "0.69740534", "0.69740534", "0.69740534", "0.69740534", "0.69648343", "0.69545984", "0.6784196", ...
0.8324251
0
Get the list of all entities of a given type from DB
def getEntityIds(type, subtype = None): # get a cursor conn = ecommerce.db.getConnection() cursor = conn.cursor() # decide the query to execute if type not in entityQueries: return [ ] # execute the query qparams = (type, ) if subtype is not None: qparams ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def query_all(cls)->List:\n database.cursor.execute(\"SELECT * FROM {}\".format(cls.table_name))\n items = database.cursor.fetchall()\n return [cls.to_object(item) for item in items]", "def get_all(cls):\n return db_session.query(cls).order_by(cls.name).all()", "def get_entities(sel...
[ "0.7030536", "0.6770714", "0.66363615", "0.6616682", "0.6602713", "0.6575097", "0.64512324", "0.6423671", "0.64117724", "0.6411315", "0.63493234", "0.634775", "0.63454515", "0.6322174", "0.62615913", "0.6218871", "0.6200281", "0.61640894", "0.6134082", "0.613314", "0.6114528"...
0.6784044
1
Mark the entities modified before a specific date as processed
def mark_processed_entities(entity_type, max_date): try: # get a connection and cursor conn = ecommerce.db.getConnection() cursor = conn.cursor() # execute the query cursor.execute(""" UPDATE Stage0_Delta SET F...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def visitBefore(self, date):\n raise NotImplementedError()", "def is_before(self,other_date):", "def modified(self):\r\n\t\treturn self.last_modified > self.last_processed", "def modified(self):\n\t\treturn self.last_modified > self.last_processed", "def _update_modified_since(self, timestamp):\n ...
[ "0.6026466", "0.60223776", "0.6005824", "0.58785576", "0.5820918", "0.5775946", "0.5775946", "0.57705164", "0.56849986", "0.5605239", "0.5544186", "0.55204594", "0.54331017", "0.54331017", "0.54331017", "0.54331017", "0.54331017", "0.54331017", "0.54331017", "0.5399244", "0.5...
0.6365167
0
A generator that can be used to iterate over all of the message handlers that belong to this instance.
def iter_message_handlers(self): for name in dir(self): attr = getattr(self, name) if isinstance(attr, MessageHandler): yield attr
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_message_handlers(self):\n\t\treturn self.message_handlers", "def get_handlers(self):\n\n # Get handlers \n logger.debug(\"%s: Returned %d handlers.\" % \\\n (self.__class__.__name__, len(self._handlers)))\n return self._handlers[:]", "def __iter__(self):\n ...
[ "0.75313586", "0.7092574", "0.689368", "0.6885732", "0.6611093", "0.64954853", "0.6490498", "0.6438109", "0.6379151", "0.6324771", "0.6322066", "0.62982225", "0.62764996", "0.6234379", "0.6224543", "0.62200075", "0.61538786", "0.60254633", "0.6023188", "0.60213643", "0.594284...
0.86009705
0
Adds the given service's message handlers to our managed message handlers.
def register_service(self, service): for message_handler in service.iter_message_handlers(): self.message_handlers[message_handler.name] = message_handler
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def connect(self, service, handler):\n self.partyline.setdefault(service, []).append(handler)", "def register_websock_handlers(self, service, new_client, new_message, close_client):\n if service in self.websock_handlers:\n L.error(\"Error: service:\" + service + \" is already registered\...
[ "0.6415957", "0.63830936", "0.60461724", "0.6046069", "0.6006367", "0.58971536", "0.5866512", "0.5834788", "0.5806009", "0.5753481", "0.5696065", "0.5631438", "0.56120425", "0.5598932", "0.55874574", "0.55768156", "0.55757207", "0.55562836", "0.5551294", "0.5539715", "0.55364...
0.8374331
0
Invokes the correct message handler for the given message.
def handle_message(self, sender, message): self.logger.debug('handle_message(%r, %r)', sender, message.handler) message_handler = self.message_handlers.get(message.handler) if message_handler is None: self.logger.warning("sender=%r, No handler found: '%s'", ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def handle_message(self, message):\n\n\t\tself.log.debug(\"%s handle_message %s\", self.name, message)\n\n\t\tif message[\"Type\"] == \"command\":\n\t\t\ttry:\n\t\t\t\tcommand_callable = \"command_%s\" % message[\"Message\"][\"command\"]\n\t\t\t\tif hasattr(self, command_callable) and callable(getattr(self, comman...
[ "0.7761963", "0.72658277", "0.7105738", "0.7102408", "0.7060995", "0.7036604", "0.70310044", "0.7029397", "0.699162", "0.69913566", "0.698211", "0.6949379", "0.69273627", "0.6888938", "0.68215775", "0.6818507", "0.67997396", "0.6774335", "0.67683744", "0.6749502", "0.6715756"...
0.73108006
1
Convert a time.struct_time as returned by feedparser into a
def _convert_struct_time_to_dt(stime): return date.fromtimestamp(mktime(stime))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def time_struct_to_datetime(struct_time_object):\n return datetime.datetime(*struct_time_object[:6])", "def _convert_struct_time_to_dt(stime):\n\n dt = datetime.datetime.fromtimestamp(mktime(stime))\n\n return dt.date()", "def unmarshall_time(tyme):\r\n return datetime.datetime(day=tyme['day'],\r\n...
[ "0.7229315", "0.67260563", "0.6565747", "0.6513471", "0.63544554", "0.6352278", "0.63428724", "0.62921166", "0.6273469", "0.6266583", "0.62201977", "0.62145513", "0.6209023", "0.61696506", "0.6159586", "0.61529684", "0.61013764", "0.608812", "0.59947324", "0.5987127", "0.5983...
0.7049241
1
Use feedparser to parse PyBites RSS feed. Return a list of Entry namedtuples (date = date, drop time part)
def get_feed_entries(feed=FEED) -> list: f = feedparser.parse(feed) entry_list = [] for entry in f.entries: date = _convert_struct_time_to_dt(entry["published_parsed"]) title = entry["title"] link = entry["link"] tags = [tag["term"].lower() for tag in entry["tags"]] ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_feed_entries(feed=FEED):\n d = feedparser.parse(feed)\n entries = d.entries\n \n all_entries =[]\n for entry in entries:\n title = entry.title\n link = entry.link\n date = entry.published_parsed\n tags = entry.tags\n tags = [t.get('term').lower() for t in t...
[ "0.7831155", "0.729255", "0.7232448", "0.67960274", "0.674423", "0.6664003", "0.66603625", "0.6557846", "0.6554401", "0.65351653", "0.65075", "0.64848477", "0.647246", "0.6385361", "0.63827616", "0.63343084", "0.6323492", "0.6318049", "0.6304754", "0.6304091", "0.62566954", ...
0.7714306
1
Check if search matches any tags as stored in the Entry namedtuple (case insensitive, only whole, not partial string matches).
def filter_entries_by_tag(search, entry) -> bool: tags = entry.tags search_words = search.strip().translate(str.maketrans("&|", " ")).split() if "&" in search: search_type = "AND" else: search_type = "OR" for word in search_words: if word.lower() in tags: if se...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def filter_entries_by_tag(search, entry):\n \n entry_tags = entry.tags\n if '&' in search:\n splits = search.split('&')\n\n return all(split.lower() in entry_tags for split in splits)\n elif '|' in search:\n splits = search.split('|')\n return any(split.lower() in entry_...
[ "0.7962715", "0.72779536", "0.6499833", "0.62624013", "0.62382317", "0.6214999", "0.6140391", "0.6119588", "0.6078616", "0.60098", "0.59635174", "0.5918138", "0.5911922", "0.58637714", "0.5848267", "0.5831237", "0.5806548", "0.5795138", "0.57761455", "0.57537323", "0.57031983...
0.75187373
1
Gather the top 10 words by highest (descending) likelihoods for each class
def top10_likelihoods(likelihoods, vocab, classes): resultDict = {} for cls in classes: results = [] for word in vocab: results.append((word, likelihoods[cls][word])) resultDict[cls] = results # Sort and return top 10 for each class for key in resultDict: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def top10_odds_ratio(likelihoods, vocab, classes):\r\n results = []\r\n for word in vocab:\r\n highestOddsRatio = None\r\n for c1 in classes:\r\n for c2 in classes:\r\n # Skip self TODO: Is this right?\r\n # if c1 == c2:\r\n # continue...
[ "0.7205802", "0.70088744", "0.6974292", "0.6939049", "0.68271315", "0.67730814", "0.6618862", "0.66091466", "0.64232916", "0.6413391", "0.639833", "0.63636", "0.6353295", "0.63519716", "0.6349507", "0.63440084", "0.6335887", "0.63027114", "0.6243625", "0.623767", "0.6233897",...
0.7892108
0
Gather the top 10 words by highest (descending) odds ratios
def top10_odds_ratio(likelihoods, vocab, classes): results = [] for word in vocab: highestOddsRatio = None for c1 in classes: for c2 in classes: # Skip self TODO: Is this right? # if c1 == c2: # continue odd...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def display_top_n_words(total_count__of_words, n): # Considering n=10 here as specified in the requirements\n return sorted(total_count__of_words.items(), key=lambda i: i[1], reverse=True)[:n]", "def get_top_words(self, label, n):\n score_list = []\n if('sod' in label):\n for term i...
[ "0.7232739", "0.6893036", "0.67285866", "0.6680685", "0.66617835", "0.66482335", "0.6614465", "0.6595784", "0.6562109", "0.645501", "0.64387554", "0.6425363", "0.63707566", "0.6370042", "0.6349563", "0.6348198", "0.6341136", "0.6331591", "0.63161516", "0.6312066", "0.6284538"...
0.7499493
0
Estimate the priors for a class
def calculate_priors(trainingLabels): sum = 0 priors = {} totalSamples = len(trainingLabels) classes = set(trainingLabels) for cls in classes: numCls = len(filter(lambda x: x == cls, trainingLabels)) sum += numCls priors[cls] = float(numCls) / float(totalSamples) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def classProbs(observation, tree, classes):\n res = classify(observation, tree) #res = results\n total = sum(res.values())\n probs = []\n for c in classes:\n if c in res.keys():\n probs.append(float(res[c])/total)\n else:\n probs.append(0)\n return probs", "def ...
[ "0.66456854", "0.6316928", "0.6273953", "0.60905004", "0.6055876", "0.60154176", "0.5993265", "0.59645927", "0.59377426", "0.5896327", "0.58948433", "0.58720356", "0.58248436", "0.5820803", "0.58123535", "0.5798083", "0.57771003", "0.5732761", "0.5723448", "0.57202864", "0.57...
0.699718
0
Calculate the likelihoods for multinomial
def calculate_likelihoods_multinomial(data, labels, vocab): likelihoods = {} counts = {} words = {} classes = set(labels) vocabLen = len(vocab) for cls in classes: # Initialize counts[cls] = {} words[cls] = 0 # Perform counts line = 0 for doc in da...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def multinomial_likelihood(m_true, alpha, alpha0, m_probs):\n\n ll = tf.reduce_sum(input_tensor=m_true * (tf.math.log(alpha0) - tf.math.log(alpha)), axis=1, keepdims=True)\n ll = tf.reduce_mean(input_tensor=ll)\n return ll", "def multinomial_nll(true_counts, logits):\n counts_per_example = tf.reduce_...
[ "0.7405791", "0.71270245", "0.6805791", "0.67948574", "0.6551636", "0.6476551", "0.64614797", "0.6425553", "0.6342785", "0.63420993", "0.6332708", "0.633066", "0.6330074", "0.6298897", "0.62908417", "0.62799925", "0.62471", "0.62063324", "0.61783415", "0.6177655", "0.61492676...
0.7152682
1
Extract the known vocabulary from our training data
def get_vocab(trainingData): return set(reduce(lambda x,y: x+y, map(lambda x: map(lambda y: y[0], x), trainingData), []))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_vocab(self):\n\n\t\tself.parse_transcript() \n\t\tself.purge_words()\n\t\tself.analyze_words()\n\t\tself.sort_word_analysis()", "def get_vocabulary(documents):\n cv_model = CountVectorizer(binary=True)\n cv_model.fit(documents)\n\n vocabulary = cv_model.get_feature_names()\n vocabulary = list...
[ "0.7562361", "0.7207228", "0.7081693", "0.70540327", "0.7029069", "0.70169085", "0.7005524", "0.7005293", "0.7000013", "0.69506437", "0.69444656", "0.6888032", "0.6835956", "0.68238574", "0.6815228", "0.6788677", "0.6784426", "0.6746104", "0.6692373", "0.6628482", "0.660853",...
0.7412368
1
Return elements from the iterable until it is exhausted. Then repeat the sequence indefinitely. cycle(seq) ==> seq[0], seq[1], ..., seq[n 1], seq[0], seq[1], ...
def cycle(seq, n=None): if n is not None: return Iter(_ncycle(n, seq)) return Iter(itertools.cycle(seq))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def cycle(iterator: Iterable[Any]) -> Iterable[Any]:\n while True:\n yield from iterator", "def iter_sequence_infinite(seq):\n while True:\n for item in seq:\n yield item", "def repeat(seq, n):\n for e in seq:\n for _ in range(n):\n yield e", "def repeat(iterable, coun...
[ "0.77041095", "0.73121995", "0.68373466", "0.68154997", "0.64987105", "0.64865166", "0.64855176", "0.61515063", "0.61507326", "0.6116417", "0.585476", "0.5825893", "0.5797128", "0.5789132", "0.57815135", "0.5774213", "0.577342", "0.5757885", "0.5697775", "0.56689405", "0.5658...
0.78215605
0
Returns the object for the specified number of times. If not specified, returns the object endlessly.
def repeat(obj, times=None): if times is None: return Iter(itertools.repeat(obj)) return Iter(itertools.repeat(obj, times))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def repeat(self, count):\n return self.Sequence((self,) * count)", "def repeat(self, fn, *args, **kwargs):\n return repeat_n_times(self.n, fn, *args, **kwargs)", "def twist(r, num_repeats=1):\n for i in range(num_repeats):\n r.go(0, 50)\n time.sleep(.75)\n r.stop()\n ...
[ "0.6203525", "0.59771645", "0.5969791", "0.5901691", "0.5872414", "0.5850168", "0.58327895", "0.58200485", "0.57241195", "0.5649693", "0.56443447", "0.5643324", "0.56162107", "0.5555079", "0.5550507", "0.5531917", "0.54840827", "0.54764825", "0.5443261", "0.54094815", "0.5397...
0.64713174
0
Make infinite calls to a function with the given arguments. End sequence if func() raises StopIteration.
def repeatedly(func, /, *args, **kwargs): func = to_callable(func) try: while True: yield func(*args, **kwargs) except StopIteration as e: yield from stop_seq(e)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def iterate(func, x):\n while True:\n x = func(x)\n yield x", "def iterate(f, x):\n while True:\n yield x\n x = f(x)", "def iterate(func: Callable[..., T], x: T, *args, index: Index = None):\n func = to_callable(func)\n index = to_index_seq(index)\n\n if index is None...
[ "0.7004105", "0.6646999", "0.63588154", "0.633149", "0.6150608", "0.6094851", "0.6073668", "0.59957045", "0.5961045", "0.5894083", "0.5876988", "0.58702266", "0.5862073", "0.58489794", "0.5841767", "0.5814898", "0.57949513", "0.5713033", "0.5708868", "0.57078665", "0.5697791"...
0.7911098
0
Invert a fold. Similar to iterate, but expects a function of seed > (seed', x). The second value of the tuple is included in the resulting sequence while the first is used to seed func in the next iteration. Stops iteration if func returns None or raise StopIteration.
def unfold(func, seed): try: elem = func(seed) while elem is not None: seed, x = elem yield x elem = func(seed) except StopIteration as e: yield from stop_seq(e)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def inverse(f):\n return lambda y: search(lambda x: f(x) == y)", "def fold(iterable, func, base):\n acc = base\n for element in iterable:\n acc = func(acc, element)\n return acc", "def foldl(func, start, itr):\n return _foldl(func, start, iter(itr))", "def flip(func):\n if not callab...
[ "0.551734", "0.54347765", "0.5407587", "0.53981245", "0.5355724", "0.5321342", "0.5257516", "0.52478385", "0.50181824", "0.5012077", "0.49952018", "0.49402606", "0.493333", "0.493333", "0.4932859", "0.492038", "0.49162006", "0.4866282", "0.4826197", "0.480424", "0.48014733", ...
0.76988935
0
Create iterator from sequence of numbers.
def from_sequence(self, seq): return Iter(self._from_sequence(seq))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def numeric_sequence_iteration(self) -> global___Statement.Iteration.NumericSequenceIteration:", "def simple_seq(seq):\n for i in seq:\n yield i", "def numbers():\n for number in range(1, 76):\n yield number", "def __iter__(self):\r\n \r\n return iter(self._by_number)", "d...
[ "0.6523413", "0.6352263", "0.6295878", "0.6285677", "0.6251581", "0.6161719", "0.6161719", "0.6123521", "0.59559906", "0.59429246", "0.5929433", "0.59055716", "0.5842463", "0.58171993", "0.57896346", "0.57666224", "0.57651085", "0.5762295", "0.5750994", "0.5719213", "0.571020...
0.70666045
0
Create iterator from slice object.
def from_slice(self, slice): start = 0 if slice.start is None else slice.start step = 1 if slice.step is None else slice.step return self.count(start, step, stop=slice.step)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def slice(iterable, *args):\n return iter(it.islice(iterable, *args))", "def __getitem__(self, arg):\n if isinstance(arg, slice):\n # get value from slice\n start, stop, step = arg.start, arg.stop, arg.step\n # sanitize step\n if step is None:\n ...
[ "0.6592863", "0.6384958", "0.6363769", "0.62649775", "0.61393666", "0.60202515", "0.59986544", "0.5966865", "0.5952172", "0.5857153", "0.5757738", "0.574337", "0.5653791", "0.5642721", "0.56035215", "0.5587913", "0.5578734", "0.5572186", "0.5529783", "0.5510107", "0.5508437",...
0.6573793
1
Return a sequence of n evenly spaced numbers from a to b.
def evenly_spaced(self, a: Real, b: Real, n: int) -> Iter: return Iter(_evenly_spaced(a, b, n))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def split_by_n( seq, n ):\n while seq:\n yield seq[:n]\n seq = seq[n:]", "def split_by_n(seq, n):\n while seq:\n yield seq[:n]\n seq = seq[n:]", "def genslices(n):\n return product(range(-n, n+1), range(-n, n+1), range(-n, n+1))", "def genslices(n):\n retur...
[ "0.67545396", "0.67385876", "0.6609418", "0.6586301", "0.6527549", "0.6490447", "0.64674157", "0.6464234", "0.64498013", "0.6438853", "0.6431555", "0.64294153", "0.6413279", "0.63846004", "0.63330746", "0.63312566", "0.6319206", "0.6290663", "0.6289663", "0.62633723", "0.6244...
0.7720257
0
Convert int to string without using builtin str()
def int_to_string(num): if num < 0: num, is_neg = -num, True else: is_neg = False s = [] while num > 0: s.append(chr(ord('0') + num%10)) num //= 10 return ('-' if is_neg else '') + ''.join(reversed(s))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _int2str(num):\n if num<10:\n return '00%s'%str(num)\n elif 10<=num<100:\n return '0%s'%str(num)\n else:\n return '%s'%str(num)", "def _int_to_string(v):\n \n if not isinstance(v,int):\n raise InstrumentParameterException('Value %...
[ "0.8262509", "0.7803891", "0.7300844", "0.7271281", "0.72517717", "0.718009", "0.7099532", "0.70860934", "0.7008732", "0.69923896", "0.68970364", "0.68703055", "0.6847767", "0.67874974", "0.6779158", "0.676237", "0.67338043", "0.6702256", "0.6671091", "0.6608676", "0.65521425...
0.78195685
1
Plot a template over a detected stream, with picks corrected by lagcalc.
def plot_repicked(template, picks, det_stream, size=(10.5, 7.5), save=False, savefile=None, title=False): # _check_save_args(save, savefile) fig, axes = plt.subplots(len(det_stream), 1, sharex=True, figsize=size) if len(template) > 1: axes = axes.ravel() mintime = det_stream.so...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def xx_plot(epoch, model, features, filters, figname, fgal=0.5):\n # fetch Stripe 82 data\n X, Xcov = fetch_prepped_s82data(epoch, fgal, features, filters)\n Xcoadd, Xcoaddcov = fetch_prepped_s82data(epoch, fgal, features,\n filters, use_single=False)\n N = ...
[ "0.59035116", "0.58859456", "0.578238", "0.5767331", "0.5742631", "0.57282263", "0.55894816", "0.5575051", "0.5565919", "0.55595213", "0.554277", "0.5542592", "0.55424595", "0.5524052", "0.5506664", "0.55034083", "0.5472254", "0.54397625", "0.54324085", "0.5425673", "0.541573...
0.6715108
0
Carga tola la pila con strings
def cargaAutoStr(pila): while not pila_llena(pila): largo = random.randint(1, 15) apilar(pila, randString(largo))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def comenzar_nuevo_juego():\n escena_uno.cargarEscena1(screen, display_width, display_height)#Se pone a correr la escena\n #escena_uno.cargarEscena2(screen, display_width, display_height)", "def stringToPila(palabra):\n pila = Pila()\n for elemento in palabra:\n apilar(pila, elemento)\n ret...
[ "0.58442247", "0.5648824", "0.56434804", "0.56288433", "0.5588605", "0.5584497", "0.5554773", "0.5449711", "0.54150164", "0.53789884", "0.5370985", "0.532739", "0.53188556", "0.5307319", "0.52647316", "0.51832354", "0.51682794", "0.51462793", "0.51443756", "0.51443756", "0.51...
0.59360135
0
Desapila el elemento en cima
def desapilar(pila): dato = pila.datos[pila.tope] pila.tope -= 1 return dato
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def delete(self, *args, **kwargs):\n campo = Campostagimg.objects.filter(tag=self.tag, imagen=self.imagen)\n for c in campo:\n c.medidas = \"\"\n c.save()\n c.precision = 0\n c.save()\n c.v_esperado = \"\"\n c.save() \n\n ...
[ "0.61714435", "0.61389273", "0.6033699", "0.5995851", "0.5916466", "0.5895718", "0.58551925", "0.5754909", "0.5726794", "0.5719078", "0.5699067", "0.56908727", "0.5681546", "0.56783044", "0.5675249", "0.5675179", "0.56316787", "0.55975395", "0.55830395", "0.55497795", "0.5538...
0.6247548
0
Devuelve elemento de la cima
def cima(pila): return pila.datos[pila.tope]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def first(self):\n if self.is_empty():\n raise Empty('La cola está vacía')\n return self._head._element # frente alineado con la cabeza de la lista", "def getFactura(self): \n return self.caja", "def getFactura(self): \n return self.caja", "def Cima(self):\n i...
[ "0.62369305", "0.5968242", "0.5968242", "0.5929463", "0.5875082", "0.5795964", "0.574635", "0.57377017", "0.56929976", "0.566961", "0.5612241", "0.5606185", "0.5604151", "0.55805415", "0.55805415", "0.5572482", "0.555679", "0.5539605", "0.5539363", "0.5522629", "0.55216", "...
0.6678378
0
Devuelve la pila invertida
def invertir(pila1): pila2 = Pila() while not pila_vacia(pila1): apilar(pila2, desapilar(pila1)) return pila2
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __invert__(self):\n return self.inverse()", "def inverse(self, x, y):", "def __invert(self, args):", "def invert(self,el):\n return el^(self.q-2)", "def invert(self):\n tmp = self.pvt\n self.pvt = self.nvt\n self.nvt = tmp\n tmp = self.pFace\n self.pFace...
[ "0.7260351", "0.7015506", "0.69790083", "0.6911814", "0.6806856", "0.6755985", "0.6703932", "0.67010486", "0.66792345", "0.6677001", "0.6664742", "0.66548175", "0.6640481", "0.65897536", "0.65876037", "0.6559641", "0.6545105", "0.65431285", "0.6482718", "0.64756066", "0.64310...
0.7615787
0
Devuelve pila del string ingresado
def stringToPila(palabra): pila = Pila() for elemento in palabra: apilar(pila, elemento) return pila
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_string2(self):\n pass", "def getApellidos(apellido):\n texto = f'El apellido es: {apellido}'\n return texto\n pass", "def psea(pname): # -> str:\n ...", "def print_as_text(pi):\n\n pi_string = str(\"%1.18f\" % pi)\n\n print(\"Definitive: \" + PI_STRING)\n\n print(\"Estimat...
[ "0.5971977", "0.59691834", "0.5927014", "0.59089327", "0.58850706", "0.5883489", "0.5877891", "0.5867647", "0.58412963", "0.5805934", "0.57704586", "0.5736824", "0.57056093", "0.5686816", "0.5681042", "0.5671489", "0.5662893", "0.56376225", "0.5629446", "0.56220335", "0.56079...
0.599477
0
Finalize the grades and print. Only for assessors.
def finalize(request, pk, version=0): ts = get_timeslot() if not hasattr(ts, 'resultoptions'): raise PermissionDenied("Results menu is not yet visible.") else: if not get_timeslot().resultoptions.Visible: raise PermissionDenied("Results menu is not yet visible.") dstr = get_...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def main():\n\n students = [\"Chris\", \"Jesse\", \"Sally\"]\n grades = [90, 80, 70]\n print_gradebook(students, grades)", "def finalize():\n\n print(\"\"\"\n The script analysis/sedov_compare.py can be used to analyze these\n results. That will perform an average at constant radiu...
[ "0.59876657", "0.57981944", "0.564417", "0.55673975", "0.55103207", "0.55028576", "0.5473704", "0.5460755", "0.5440873", "0.5409173", "0.53980476", "0.53825235", "0.5363283", "0.5363283", "0.5361439", "0.5361439", "0.5361439", "0.5361439", "0.5361439", "0.5361439", "0.5349366...
0.5862954
1
List all aspects of a given grade category in the current timeslot
def list_aspects(request, pk): category = get_object_or_404(GradeCategory, pk=pk) aspects = GradeCategoryAspect.objects.filter(Category=category) ts = get_timeslot() return render(request, "results/list_aspects.html", { "aspects": aspects, 'ts': ts, 'cat': category, })
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def time_budget_analysis(cursor, plot_parameters, by_category=False):\n\n categories, out = {}, []\n for subject in plot_parameters[\"selected subjects\"]:\n out_cat, categories[subject] = [], {}\n\n for behavior in plot_parameters[\"selected behaviors\"]:\n\n ...
[ "0.5233529", "0.5082282", "0.5039836", "0.49076796", "0.49012667", "0.4887644", "0.4880797", "0.48579165", "0.48460177", "0.4806707", "0.48065493", "0.47938785", "0.478363", "0.47725368", "0.47473636", "0.47454002", "0.47437078", "0.47360337", "0.47296265", "0.47234464", "0.4...
0.71396613
0
Add a child config
def add(self, key, child_config): self.__dict__[key] = child_config child_config.root = self
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_config(self, parent_node, child_value):\n edge_cost = self.cost(parent_node.value, child_value)\n child_node = Node(\n child_value,\n parent=parent_node,\n cost=parent_node.cost + edge_cost,\n depth=parent_node.depth + 1\n )\n parent_n...
[ "0.7265803", "0.6487871", "0.64664084", "0.62878114", "0.6264923", "0.6200054", "0.6032241", "0.59954774", "0.5990614", "0.59605205", "0.59455884", "0.59455884", "0.591581", "0.5893812", "0.5794489", "0.5790334", "0.57764447", "0.5702759", "0.56942874", "0.5688074", "0.568399...
0.7865205
0
Format strings using CONFIG object. This method uses python's builtin `str.format()` method. All root properties in CONFIG are passed in as kwargs. The properties lazy evaluate and recursively expand.
def format(self, value, key=None, **kwargs): if not isinstance(value, str): return value # always format strings using the root so the full path is available if self.root: return self.root.format(value, key, **kwargs) variables = CONFIG_VARIABLE_PATTERN.findall(...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def recursively_update_config(config, string_formatting_dict):\n\n for k in _iterate_list_or_dict(config):\n v = config[k]\n if isinstance(v, dict) or isinstance(v, list):\n recursively_update_config(v, string_formatting_dict)\n else:\n if _key_in_string(v, string_form...
[ "0.61522377", "0.61236", "0.60001415", "0.57900184", "0.57206047", "0.57040524", "0.5618517", "0.5617663", "0.56145966", "0.56098795", "0.5547251", "0.55374193", "0.5514143", "0.54919505", "0.5468669", "0.54580975", "0.54474247", "0.54033774", "0.5401085", "0.53975976", "0.53...
0.75447696
0
Directory where ixian is installed
def IXIAN(cls): import ixian return os.path.dirname(os.path.realpath(ixian.__file__))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_teamocil_dir() -> pathlib.Path:\n return pathlib.Path(\"~/.teamocil/\").expanduser()", "def get_install_dir(self):\n return EventGenerator.get_install_dir(self) + \"/madgraph5/src\"", "def get_installdir(self):\n import mewlo\n path = os.path.dirname(os.path.realpath(mewlo.__fil...
[ "0.59720445", "0.5938821", "0.5927095", "0.59131306", "0.58979726", "0.586261", "0.5823516", "0.58234173", "0.5788261", "0.57610697", "0.5754324", "0.57422614", "0.5687996", "0.565429", "0.5623156", "0.56043833", "0.5588141", "0.5566707", "0.55413353", "0.55124944", "0.550046...
0.7647922
0
Trova uno zero della funzione f tra i punti a e b, dove la f assume segno discorde. Il parametro opzionale toll indica la precisione con cui si vuole calcolare il valore dello zero
def bisezione(f,a,b,toll=10**-5): m = (a+b)/2 f_m = f(m) while abs(f_m) > toll: if f(a)*f_m < 0: b = m elif f(b)*f_m < 0: a = m elif f_m == 0: print("Trovata solzione esatta") return m else: print("Metodo fallito") ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def Calcular(a: float) ->float:\n \n return (a*2)", "def p() -> float:\n return 0.9", "def f(x0: float, x1: float) -> float:\n return 8 - (x0 - 2) ** 2 - (x1 - 2) ** 2", "def p2f (p):\n #return 11000**((p+1)/2)\n #return (p+1)*11000\n return (p+1)*5500", "def p2f(self):\n\n stale = self.m_...
[ "0.65174574", "0.6448639", "0.63864565", "0.6370828", "0.6296283", "0.6275515", "0.6270769", "0.6238707", "0.6191305", "0.61809313", "0.618049", "0.6167555", "0.6149057", "0.61406493", "0.61188513", "0.6118763", "0.61178863", "0.60342443", "0.6006515", "0.6004016", "0.6002765...
0.6965852
0
Restituisce il radicale di n
def radicale(n): r = 1 for p in primi(n+1): if p>n: break if n%p==0: r *= p n = n//p return r
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def n_wyraz(a1,nr_wyrazu,r):\n return a1+(nr_wyrazu-1)*r", "def Arn(r, n):\n ret = 1\n for t in range(n, n-r+1-1, -1):\n ret *= t\n return ret", "def _rnm(self, n, m, r):\n r_sum = 0\n m = int(abs(m))\n u = int((n-m)/2)\n v = int((n+m)/2)\n for s in range(0...
[ "0.6703785", "0.65736157", "0.6541312", "0.6525386", "0.6515335", "0.63054556", "0.6147716", "0.61371934", "0.61207694", "0.6074879", "0.60558325", "0.605559", "0.6001547", "0.59967726", "0.5936649", "0.5906539", "0.58998317", "0.5871071", "0.58641", "0.5848409", "0.58474976"...
0.68493146
0
Algoritmo di kruskal per la ricerca dell'MST di un grafo, fornito in tramite la sua matrice di adiacenza, usa la funzione ring_finder per cercare anelli nel grafo e di min_nonzero_idx per trovare gli inidici dei rami con costo minimo
def kruskal(m): n = m.shape[0] m_ret = np.zeros([n,n], dtype=int) while np.count_nonzero(m_ret) != 2*(n-1): i_min, j_min = min_nonzero_idx(m) n_min = m[i_min, j_min] m[i_min, j_min], m[j_min, i_min] = 0, 0 m_ret[i_min, j_min], m_ret[j_min, i_min] = n_min, n_min if rin...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def kruskal(self):\n AGM = []\n i = j = 0\n \n self.grafo = sorted(self.grafo,key=lambda item:item[2])\n\n pai = []\n nivel = []\n\n for vertice in range(self.nVer):\n pai.append(vertice)\n nivel.append(0)\n\n while j < self.nVer-1:\n ...
[ "0.615799", "0.5902298", "0.58482414", "0.57372916", "0.57352954", "0.57080084", "0.56059325", "0.55901784", "0.5569681", "0.55468035", "0.5539385", "0.5525096", "0.5479864", "0.546164", "0.54158294", "0.5414072", "0.53997874", "0.53977036", "0.5389939", "0.5384784", "0.53628...
0.68557984
0
Get current NFL season After March, returns year of upcoming season.
def current_season() -> int: now = datetime.now() month, year = now.month, now.year if month < 4: year -= 1 return year
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def current_season():\n td = datetime.datetime.today()\n if td.month > 8:\n return td.year\n return td.year - 1", "def latest_season_before(date):\n\tif date.month < 9:\n\t\treturn date.year - 1\n\treturn date.year", "def return_football_season(date=datetime.datetime.today()):\n date_aux = s...
[ "0.81641465", "0.7565352", "0.74286443", "0.6773904", "0.66487664", "0.6576127", "0.65571433", "0.6517643", "0.6495419", "0.64488924", "0.64429444", "0.64425147", "0.64404756", "0.6364527", "0.62375706", "0.61532784", "0.61332804", "0.6104992", "0.5971628", "0.5910558", "0.58...
0.8059089
1
Get NFL week (ESPN scoring period) from date The year of the given date determines the relevant NFL season. Assumes week 1 begins the week of Labor Day and ends the following Wednesday. Does not cap value, so may be below 1 or above 17.
def get_week_from_date(date) -> int: month, year = date.month, date.year if month < 4: year -= 1 ld = _labor_day(year) wk1_wed = ld + timedelta(days=2) days_since = (date - wk1_wed).days weeks_since = days_since / 7. week = math.floor(weeks_since) + 1 return int(week)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_week(date):\n\n # TODO: the API seems broken. It returns week, year not year, week as documentef\n # why not use date.isocalendar() from the stdlib?\n\n date = date_trunc('week', date)\n\n first_monday = date_trunc('week', date_trunc('year', date))\n if first_monday.year < date.year:\n ...
[ "0.7253059", "0.6891157", "0.68909645", "0.6705168", "0.66147095", "0.6535417", "0.63276374", "0.6250827", "0.62457407", "0.61644757", "0.6102457", "0.60741466", "0.59655815", "0.59634364", "0.59619147", "0.5926681", "0.5889611", "0.5864661", "0.5860158", "0.5819684", "0.5810...
0.7307077
0
Find list of edl directories in all dependencies for the passed module
def get_edl_dirs(mod, gen_cfg): log.info("Fetching dependencies for %s", coordinates.as_path(mod.coords)) dependencies = mod.get_dependencies() edl_dirs = [mod.get_edl_path()] for dep, dep_coords in dependencies.items(): dep_cfg = gen_cfg.get_mod_cfg(dep) log.info("Dependency: %s", coor...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _compute_module_search_path(self, pkg_name):\n pkg_location = self.get_package_location(pkg_name)\n module_search_path = [pkg_location, os.path.join(pkg_location,'lib')]\n st, cycle = graph.dfs(self.package_dependency, pkg_name)\n # computed packages on which this task depends\n ...
[ "0.65620816", "0.63926107", "0.6388437", "0.63874215", "0.6298563", "0.6170511", "0.6139222", "0.6134263", "0.6119241", "0.61146545", "0.608592", "0.6056361", "0.603119", "0.6020695", "0.5978215", "0.5966075", "0.5961092", "0.5923319", "0.5875171", "0.5873686", "0.58671385", ...
0.76784027
0
Update the symbol XML node
def edit_symbol_node(node, filename): size = int(re.findall('\d+', filename)[-1]) log.info('New filename %s; size %s', filename, size) node.set('typeId', SYMBOL_ID) node.find('name').text = 'DLS symbol' # Use PV name from rule in control PV for tooltip etc. # Reference that PV in rule to avoid...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_symbol(self, symbol):\r\n self.symbol = symbol", "def symbol(self, symbol):\n self._symbol = symbol", "def symbol(self, symbol):\n\n self._symbol = symbol", "def set_symbol(self, row, col, symbol):\n self.field[row, col] = symbol", "def setSymbolProps(self, name, symbol)...
[ "0.617891", "0.61759514", "0.61127055", "0.5838499", "0.56468177", "0.56205124", "0.5558976", "0.5554636", "0.5539334", "0.5484995", "0.54771584", "0.5455788", "0.54166734", "0.53877443", "0.5364725", "0.53485316", "0.5334409", "0.5323229", "0.53168017", "0.5301254", "0.51267...
0.65849906
0
Grep on the basepath to find all files that contain an EDM symbol widget. control
def build_filelist(basepath): log.info("Building list of files containing EDM symbols in %s", basepath) symbol_files = [] for dir_path, _, filenames in os.walk(basepath): for filename in filenames: filepath = os.path.join(dir_path, filename) if filename.endswith(".opi") and u...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def searchfiles(pattern='C:\\\\RoboDK\\\\Library\\\\*.rdk'):\n import glob\n return glob.glob(pattern)", "def find_files(config, slot='*'):\n f_pattern = os.path.join(os.path.join(config['path'],config['led_name']), slot+'*' + config['led_name'] + '*'\n + config['current'] + ...
[ "0.6017925", "0.56027436", "0.5597905", "0.555413", "0.5544122", "0.54559", "0.5441576", "0.5366995", "0.53383917", "0.5280805", "0.5255213", "0.5246665", "0.5238796", "0.52089924", "0.5191325", "0.5161962", "0.51558715", "0.5154216", "0.51451254", "0.513593", "0.5125903", ...
0.60150164
1
Process one symbol file and convert to PNG.
def process_symbol(filename, mod, mod_cfg, mirror_root, prod_root): working_path = os.path.join(mirror_root, prod_root[1:]) log.debug("Finding version from %s", working_path) mod_version = utils.get_module_version(working_path, mod_cfg.area, mod, mod_cfg.version) log.info("Found version %s", mod_version...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def decode():\r\n # Open the file with binary instructions\r\n with open(file_name) as file:\r\n lines = file.readlines()\r\n with open(PATH + file_name, \"w\") as file_write:\r\n for line in lines:\r\n file_write.write(line + \"\\n\")\r\n\r\n # Read the instruction...
[ "0.5763709", "0.55842566", "0.5484444", "0.54430854", "0.5442242", "0.5435863", "0.53775424", "0.53518033", "0.53421825", "0.53008115", "0.52987564", "0.5291246", "0.5290452", "0.5279297", "0.52617425", "0.5226984", "0.5217233", "0.52096176", "0.51862746", "0.51822567", "0.51...
0.61083233
0
calculate_angles(chunk) calculates elevation and azimuth given a jsonformatted chunk from ODAS
def calculate_angles(self,chunk): import math import collections Angles = collections.namedtuple("Angles", "ev az") x = float(chunk['x']) y = float(chunk['y']) z = float(chunk['z']) ev = round(90 - math.acos(z/math.sqrt(x*x+y*y+z*z))*180/math.pi) az = rou...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def parse(all_blobs, all_angles):", "def extract_angles(self):\n atom_ids = self.contents['ID']\n angle_list = []\n for key, value in self.angles.items():\n a = value[0]\n b = value[1]\n c = value[2]\n\n lst = [a, b, c]\n\n A_ = np.asarr...
[ "0.56423277", "0.55796504", "0.5485317", "0.532156", "0.5300278", "0.50899595", "0.50719124", "0.50677234", "0.5040855", "0.5008711", "0.5001167", "0.50002366", "0.4993435", "0.49813247", "0.4962279", "0.49208593", "0.49165124", "0.49086887", "0.48858005", "0.48731053", "0.48...
0.7734531
0
Returns an "absolute" value for a timedelta, always representing a time distance.
def abs_timedelta(delta): if delta.days < 0: now = datetime.datetime.now() return now - (now + delta) return delta
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def abs_timedelta(delta):\r\n if delta.days < 0:\r\n now = _now()\r\n return now - (now + delta)\r\n return delta", "def delta(self, abs_value=False):\n return self.current - self.last if not abs_value else np.abs(self.current - self.last)", "def timedelta(self) -> datetime.timedelta...
[ "0.75997627", "0.6525403", "0.64160365", "0.6255736", "0.58985287", "0.58082616", "0.57936674", "0.573392", "0.569296", "0.56611925", "0.56431794", "0.56412184", "0.56401443", "0.5639377", "0.5544877", "0.5541361", "0.5524112", "0.5501755", "0.547358", "0.54723006", "0.545224...
0.7604547
0
Turn a value into a date and a timedelta which represents how long ago it was. If that's not possible, return (None, value).
def date_and_delta(value): now = datetime.datetime.now() if isinstance(value, datetime.datetime): date = value delta = now - value elif isinstance(value, datetime.timedelta): date = now - value delta = value else: try: value = int(value) de...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def date_and_delta(value):\r\n now = _now()\r\n if isinstance(value, datetime):\r\n date = value\r\n delta = now - value\r\n elif isinstance(value, timedelta):\r\n date = now - value\r\n delta = value\r\n else:\r\n try:\r\n value = int(value)\r\n ...
[ "0.77345294", "0.6244832", "0.6088585", "0.577737", "0.5701926", "0.56636906", "0.56362903", "0.559285", "0.5573411", "0.5541884", "0.5530724", "0.55193424", "0.55110997", "0.54977155", "0.54975235", "0.54929054", "0.5488044", "0.54846984", "0.545197", "0.5361616", "0.5360478...
0.7786376
0
Return the Hamming distance between equallength sequences
def __hamming_distance(s1, s2): if len(s1) != len(s2): raise ValueError("Undefined for sequences of unequal length") return sum(el1 != el2 for el1, el2 in zip(s1, s2))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def hamming_distance(s1, s2):\n if len(s1) != len(s2):\n raise ValueError(\"Undefined for sequences of unequal lenght.\")\n return sum(ch1 != ch2 for ch1, ch2 in zip(s1, s2))", "def hammingDistance(s1 = \"\", s2 = \"\"):\n # if len(s1) != len(s2):\n # raise ValueError(\"Undefined for sequen...
[ "0.7564989", "0.7524423", "0.7510748", "0.7498424", "0.73834527", "0.72914463", "0.7283258", "0.72027653", "0.719384", "0.7186409", "0.7184023", "0.7142286", "0.7130274", "0.71298635", "0.70760477", "0.70056623", "0.6964983", "0.69032145", "0.6894841", "0.68800247", "0.686782...
0.7553281
1
return checkpoints for recomputing
def get_checkpoints(self): # recompute checkpoints return self._checkpoints
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def checkpoint():", "def checkpoint_set():\n checkpoints.append(list())", "def get_all_overall_checkpoint(cls):\n return cls.create_all_overall_checkpoint()", "def get_checkpoint_list(cls):\n return cls.create_checkpoint_list()", "def checkpoint(self):\r\n return self._checkpoint", "d...
[ "0.744063", "0.70907867", "0.7052293", "0.69212705", "0.68812984", "0.664399", "0.66409785", "0.6579985", "0.6512506", "0.65115094", "0.65036887", "0.63288766", "0.624046", "0.6220209", "0.62004256", "0.61839545", "0.61744016", "0.6170368", "0.6168887", "0.61377853", "0.61085...
0.7678584
0