id
stringlengths
20
20
title
stringclasses
1 value
text
stringlengths
8
768k
ff66bf098e6632842b75
def set_hostname(self, host): self.host = host
ff66c1611c2114140efc
def test_valid_secret_key(self): self.assertNotEqual(current_app.config["SECRET_KEY"], "hard to guess string")
ff66c5866919d570f2ec
def full_name(self) -> str: return f"{self.org}/{self.name}"
ff66dbf3054d2d8842f2
def GetSynonyms(self, word): return self._synonyms.get(word, [])
ff66e5d29478cfa33f39
def run_PostQueuedCompletionStatus(regs): pass
ff66fc49725daefe8fe7
def z_to_mass(atomic_number): if atomic_number == 1: atomic_mass = 1.0080 elif atomic_number == 2: atomic_mass = 4.0026 elif atomic_number == 3: atomic_mass = 6.9675 elif atomic_number == 4: atomic_mass = 9.0122 elif atomic_number == 5: atomic_mass = 10.8135 ...
ff670709498f912023b0
def deinit(self): self.db.commit() self.db.close()
ff6716545f1e7e6b60e1
def decode(self): self.payload = json.loads(self.payload)
ff671e2e99da2af41067
def get_params(): ws, ds, ss, bs, gs = generate_regnet_full() return { "stem_type": cfg.REGNET.STEM_TYPE, "stem_w": cfg.REGNET.STEM_W, "block_type": cfg.REGNET.BLOCK_TYPE, "depths": ds, "widths": ws, "strides": ss, "bot_...
ff67369f7921ff75bf50
def setDepth(self, depth): self.depth = depth # The number of search plies to explore before evaluating
ff675678fc54eafcdc02
def section_map(self, section): dict1 = {} if self.config.has_section(section): options = self.config.options(section) for option in options: try: dict1[option] = self.config.get(section, option) if dict1[option] == -1: ...
ff675740ec4be0de157a
def fill_vectors(self): # use random numbers for generating plot data: random.seed(9) # fix the seed for testing for index in range(self.npoints): self.vector_x[index] = index # x coordinates for y in range(self.ncurves): self.vector_y...
ff6768c9481fa22eba78
def test_method_in_format_to_style_conversion(format_str, expected): colorful = core.Colorful(colormode=terminal.ANSI_8_COLORS) assert format_str.format(c=colorful) == expected
ff676de832e2a39b9683
def distance_matrix_from_parameters(self): raise NotImplementedError
ff678fa825063e150b12
def get_pid(self): try: pf = open(self.pidfile,'r') pid = int(pf.read().strip()) pf.close() except (IOError, TypeError): pid = None return pid
ff67a176e948c6e9636d
def unsubscribe_topic(listener, topic_name): listener = async_listeners.get(listener, listener) topic_mgr = pub.getDefaultTopicMgr() topic = topic_mgr.getOrCreateTopic(topic_name) if pub.isSubscribed(listener, topicName=topic.name): pub.unsubscribe(listener, topic_name)
ff67a3bee574fb8992e3
def _remove_self_loops(G): if nx.is_directed(G): H = nx.DiGraph(G) else: H = nx.Graph(G) for (n1,n2) in G.edges(): if n1 == n2: H.remove_edge(n1,n2) return H
ff67a4b2a12ddef9eceb
def __init__(self, width, height): self.integer_validator("width", width) self.integer_validator("height", height) self.__width = width self.__height = height if type(self.__width) is not int: raise TypeError("{} must be an integer".format(self.__width)) if t...
ff67a50a0532bbce7be2
def expandContainer(self, val='True', **kwargs): pass
ff67ccd5164a53d627e4
def _nxt_dir(self): # pass on the previously new one to the old one self.cur_dir = self.nxt_dir # increment self.n += 1 # compute the path for the new one self.nxt_dir = os.path.join(self.hmm_dir, str(self.n).zfill(3)) # make the new directory os.mkdir(sel...
ff67d214cd5b100cf360
def get_queryset(self): return UserProfile.objects.filter(user=self.request.user).values( 'user__username', 'user__email', 'user__first_name', 'user__last_name', 'user_type', 'birth_date', 'contact_number', 'address', 'userprofile_picture', )
ff67e0741352ee817c52
def _module_checks(self): if not isinstance(self, Module): raise errors.InvalidInstanceModuleError() overridden_post_init = self.__post_init__ != Module.__post_init__ if overridden_post_init and not hasattr(self, '_id'): raise errors.IncorrectPostInitOverrideError()
ff67e7f47b70edc8e63c
def find_room(self, direction): # Turn a Direction into a Room Object return getattr(self.current_location, direction) # getattr(R19A, "north")
ff67f0bb15243874455c
def blacklist_mock(): class BlacklistMock(): """ Mock version of WikiBlacklist """ def is_blacklisted(self, page): """ Just blacklist one simple item """ if page == "commons.m Category:1962_Flood_in_Skopje": re...
ff67f10e053d9e2c191d
def __checkTypeHDF5(self, value, neg): if neg: check = type(value) == np.ndarray and value.dtype not in np.sctypes['float']+np.sctypes['int'] and type(value) not in [float,int] else: check = type(value) == np.ndarray and value.dtype in np.sctypes['float']+np.sctypes['int'] or type(value) in [float,i...
ff68415677ffe156b25e
def __init__(self): pygame.sprite.Sprite.__init__(self) self.movex = 0 self.movey = 0 self.frame = 0 self.images = [pygame.image.load("assets/rocket1.png"), pygame.image.load("assets/rocket2.png")] # list is for animation self.framenum = 1 self.image = self.imag...
ff685a234634cd48b291
def __repr__(self): return str(self.value)
ff687bed1a1fc2186b9c
def add_loss_op(self, predicted): loss = tf.nn.softmax_cross_entropy_with_logits_v2( logits=predicted, labels=self.label_placeholder) loss = tf.reduce_mean(loss) return loss
ff689fae63b2ee160d10
def reset(): return Style.RESET_ALL
ff68ab928c819818f3db
def test_lat_long_to_xyz(self): for i in range(12): lat_long = LAT_LONG_ICOSAHEDRON[i] coords = lat_long_to_xyz(lat_long[0], lat_long[1]) expected_result = ECEF_ICOSAHEDRON[i] assert_array_almost_equal(coords, expected_result) # Test Latitude above North...
ff68b76ca463de3965c2
def print_list(self): for nodes in range(0, self.number_of_nodes): self.print_adjancey(self.nodes[nodes], nodes)
ff68cb0b86e3de78878f
def getSlopes(thetas, sWin = 10): N = len(thetas) slopes = np.zeros(N) deriv = np.zeros(sWin*2) deriv[0:sWin] = np.ones(sWin) deriv[sWin:] = -np.ones(sWin) slopes[sWin-1:-sWin] = np.convolve(thetas, deriv, 'valid')/float(sWin**2) slopes[0:sWin-1] = slopes[sWin-1] slopes[-(sWin+1):] = slo...
ff68d17e56e7af1d6466
def show_summary(): user_w_per = float((result_tracking['user_wins'] / result_tracking['num_games'])) comp_w_per = float((result_tracking['comp_wins'] / result_tracking['num_games'])) tie_per = float((result_tracking['ties'] / result_tracking['num_games'])) print("\n======= Summary =======\n" ...
ff68d6b16f52dac9c8ea
def add_directed_edge(self, edge_vertex): self.directed_edges.add(edge_vertex)
ff68f62b472d627a5b0d
def loadCards(): with open('cards.json') as f: c = json.load(f) return c
ff68fccfe8dd4bbf0d1e
def cancel_command(update: Update, context: CallbackContext) -> int: return cancel(update, context)
ff690edcd047329366f0
def init_cls(cls): cls.icon_theme = gtk.icon_theme_get_default()
ff69135bbc4897fb7743
def push(self, item): pass
ff69150f36a661c08bee
def conviertExtendida(fecha): d,m,a=fecha fechaext=("Enero","Febrero","Marzo","Abril","Mayo","Junio","Julio","Agosto","Septiembre","Octubre","Noviembre","Diciembre") m=fechaext[m] a=a+2000 #fechaextendida=d,m,a return d,m,a
ff6922307f2083126798
def load_from_verts(self, hand_verts, obj_faces, obj_verts): self.obj_verts = obj_verts self.obj_faces = obj_faces self.hand_verts = hand_verts self.calc_dist_contact(hand=True, obj=True)
ff69317472747e6127da
def get_config (self): return super ().get_config ()
ff694d285ec9366e9f8c
def make_A(phi, r, cut_r=5, phiknots=12, rknots=4): phi_spline = sparse.csr_matrix(wrapped_spline(phi, order=3, nknots=phiknots).T) if r.max() > 4.0: up_knot = 4.0 elif r.max() > 3.0: up_knot = 3.0 else: up_knot = np.percentile(r, 98) r_knots = np.linspace(0.125 ** 0.5, up_kn...
ff6952796698b7327158
def logout(self): self.client.user = False self.display_login_page()
ff696b76ae33549c1989
def get_credentials(): credential_dir = os.path.dirname(os.path.realpath(__file__)) if not os.path.exists(credential_dir): os.makedirs(credential_dir) credential_path = os.path.join(credential_dir, 'creds.json') store = oauth2client.file.Storage(credential_path) credentials = store.get() ...
ff698d30188a3acbf245
def intersect_substitutions(map_one, map_two, alphabet): intersected_subst = make_blank_substitution(alphabet) for letter in intersected_subst.keys(): suit_one = map_one[letter] suit_two = map_two[letter] if not suit_one or not suit_two: intersected_subst[letter] = suit_one |...
ff6994369c2ef797d912
def get_queryset(self): product = self.kwargs['pk'] return Review.objects.filter(product__id=product)
ff69b22d1e7c365f9c75
def addEvent(summary: str, location: str, description: str, start_time: datetime, end_time: datetime): event = { 'summary': summary, 'location': location, 'description': description, 'start': { 'dateTime': start_time.strftime("%Y-%m-%dT%H:%M:%S-05:00"), 'timeZ...
ff69b6c2c59d10a68f37
def to_bytes(self): if self.has_memo: self.flag |= 0x02 else: self.flag &= ~0x02 return struct.pack( "< 4B I 2H 16s 2B 2s", self.signature, self.last_update.year - 1900, self.last_update.month, self.last_update....
ff69c94e83b02fb12767
def _get_ip_address_and_hostname(): resource_pool = ctx.target.instance.runtime_properties['resource_pool'] resource = resource_pool.pop(0) ctx.target.instance.runtime_properties['resource_pool'] = resource_pool ctx.target.instance.update() return resource['ip_address'], resource['hostname']
ff69ed269b5410f8e06c
def merge(self, intervals: List[List[int]]) -> List[List[int]]: if len(intervals) < 2: return intervals # sort first # this is not python's default sort (because it only comparing first element) # so it is actually faster intervals.sort(key=lambda e: e[0]) #...
ff69fd07b406cc153590
def url(self): return self._url
ff6a0a76fb96caaed09b
def __init__(self, user, *args, **kwargs): self.user = user super(ChangePasswordForm, self).__init__(*args, **kwargs)
ff6a0b16b163f5bc5db3
def get_international(self): pass
ff6a5f3376d34aa2e0bd
def _franka_state_callback(self, msg): # get the joint positions self._arm.set_joint_positions(np.asarray(msg.q)) self._arm.set_joint_velocities(np.asarray(msg.dq)) self._arm.set_joint_torques(np.asarray(msg.tau_J)) # get the end-effector position in base frame ee_pose_...
ff6a6260c895a65babf6
def max_freq(self): return self.framerate / 2
ff6a9be3c5079fb3a74f
def plot_3d_sensor_vector(dataset, embedding): figure = mlab.figure('Sensor Embedding (3D)') figure.scene.disable_render = True points = mlab.points3d(embedding[:, 0], embedding[:, 1], embedding[:, 2], scale_factor=0.03) for i, x in enumerate(embedding): mlab.text3d(x[...
ff6aa727a7436986e7b7
def uniq(self): emitted = set() def emit_filter(x): if x in emitted: return False else: emitted.add(x) return True return self.filter(emit_filter)
ff6ab03183bb9073276e
def populate_ue_dict(self): self.logger.debug( "Fetching latest UE list from the network!" ) ue_list = self.execute_client_call('get_ue_list') self.build_ue_dict(ue_list)
ff6abf291015c34861c8
def get_timeseries_image_paths(tile_x, tile_y, band, date): path = f"./data/sentinel-2a-tile-{tile_x}x-{tile_y}y/timeseries/{tile_x}-{tile_y}-{band}-{date}.png" images = glob.glob(path) return images
ff6ad28967a428260a59
def peakValley(s): Mean=np.mean(s) pv=[] pv.append([]) pv.append([]) b=0 if s[0]<s[1]: b=1 for item in s: pv[b].append(item) b=not b pv[0].sort()#all peak pv[0].reverse()#from maximum to minimum pv[1].sort()#all valley i=0 for item in pv[0]: ...
ff6af2c3e34c61912beb
def __len__(self): return self.batch_size()
ff6b0a27bef2649ecc84
def bounds(self): loc = self.domain_kwargs['loc'] if 'loc' in self.domain_kwargs \ else 0 scl = self.domain_kwargs['scale'] if 'scale' in self.domain_kwargs \ else 1 return self.domain.interval(0.999, *self.domain_args, loc=loc,...
ff6b1dee99e0a2f80194
def check_in_awards_year(date): if date < ELIGIBILITY_END and date >= ELIGIBILITY_START: return True else: return False
ff6b3b43e2b353627168
def checkListFields( listfields ): validfields = ['filename', 'size', 'owner', 'project', 'mtime', 'atime'] for ent in listfields: if ent not in validfields: print("The field ",ent," not valid, the list of valid field is: ", validfields) exit(-1) return True
ff6b4775a1aaa68d0cc3
def export_tasks(emp_id): user_info = get("https://jsonplaceholder.typicode.com/users", params={'id': emp_id}).json() todo_data = get("https://jsonplaceholder.typicode.com/todos", params={'userId': emp_id}).json() emp_name = user_info[0].get('username') with ope...
ff6b497db37d3df8ae23
def distance(): return point() + point() ^ star(Distance)
ff6b67446d5b9c460879
def special_hex_encode(v): # ------------------------------------------------------------------------- # DELAYED IMPORTS # ------------------------------------------------------------------------- # as we never really use this! import binascii return "X'{}'".format(binascii.hexlify(v))
ff6b6b902d832f167fb9
def parse_vertex(text): v = 0 t = 0 n = 0 chunks = text.split("/") v = int(chunks[0]) if len(chunks) > 1: if chunks[1]: t = int(chunks[1]) if len(chunks) > 2: if chunks[2]: n = int(chunks[2]) return { 'v':v, 't':t, 'n':n }
ff6b775e7ecc9735e5bb
def get_chunktable_dims(dset): rank = len(dset.shape) if not dset.chunks: return None chunk_dims = dset.chunks table_dims = [] for dim in range(rank): dset_extent = dset.shape[dim] chunk_extent = chunk_dims[dim] if chunk_extent > 0: table_extent = -(dset_...
ff6b8bbe34b56c5edb69
def send(self, data, mask=None, timeout=RESPONSE_TIMEOUT, priority=5): if hasattr(mask, 'xml'): mask = mask.xml data = str(data) if mask is not None: from sleekxmpp.xmlstream.matcher import MatchXMLMask log.warning("Use of send mask waiters is deprecated.") ...
ff6b965130865e15b335
def _load_data(batch, targets): _load_general(batch.data, targets)
ff6ba2bf3ac05696ce82
def login_route(self): with app.app_context(): data = {'username': self.auth_u1, 'password': self.u1.password} res = self.app.post('/login', data = data) self.assertEqual(res.status_code, 302)
ff6bbf2b545255cb9def
def get_player2(self) -> Player: return self._player2
ff6bc9545ab6e4e7cb54
def exec_method(self, obj, method, inparam, flags=0): if flags & gdef.WBEM_FLAG_RETURN_IMMEDIATELY: # semisynchronous call -> WmiCallResult result = WmiCallResult(result_type="object") outparam = None else: # Synchronous call -> WmiObject (outparam) ...
ff6bce675dfec4952d80
def stack_conv2d_layers(self, embedding): conv2dz = zipsame(self.hps.nums_filters, self.hps.filter_shapes, self.hps.stride_shapes) for conv2d_layer_index, zipped_conv2d in enumerate(conv2dz, start=1): conv2d_layer_id = "conv2d{}".format(conv2d_layer_index) num_filters, filter_sha...
ff6c0b7dde70fcf7692d
def sortProectByMinHoursAscending(conn): curs = conn.cursor(MySQLdb.cursors.DictCursor) curs.execute('''select name,minHours,pay,location from project order by minHours asc''') return curs.fetchall()
ff6c1da5d0bd89e8c6bc
def reduce(matrix): #print(matrix) n = len(matrix[0][0]) newMetric = [[[0 for a in range(n/2)] for b in range(n/2)] for c in range(n/2)] for x in range(n/2): for y in range(n/2): for z in range(n/2): newMetric[x][y][z] = matrix[2*x][2*y][2*z] +matrix[2*x][2*y][2*z+1] ...
ff6c7ddd1eacf359afd0
def _info(self, msg): if self.__logger is not None: self.__logger.info(msg)
ff6c8547e5868fe3f92b
def save_Q(self): if os.path.isfile(self.Qpath): os.remove(self.Qpath) f = open(self.Qpath, "wb") pickle.dump(self.Q, f) f.close()
ff6c8db7bca620f71fff
def addSet(self, setName): st = sets.Set( setName, self.project ) if not st.exists(): st.create()
ff6c9f3c1d277e2499c0
def run(self): # Task assigner self.task_assigner() # Task solver self.task_solver()
ff6ca7e0fd66d721b0d0
def cache_size(self): return len(self.cache._cache), sys.getsizeof(self.cache._cache)
ff6cf2e06ac31f83e68b
def open(self): pass
ff6d27211d6ae183dd01
def choices(): available_decisions = ["too small", "too big", "you win"] while True: user_choice = input().lower() if user_choice in available_decisions: break else: print("Incorrect decision, insert too small, too big or you win") return user_choice
ff6d44141107525bca11
def rssParse(url): req = urllib.request.Request(url) contex = ignoreCertificate() req.add_header("User-Agent", "Luchiana 3.0") darticles = {} site = "" if re.search("feedburner", url): site = url.split("/")[-1] elif re.search("www", url): site = url.split(".")[1] else: ...
ff6d4def0f3c79be6679
def test_format_and_validate_response_none(self): raw_xml_response = None result = format_and_validate_response(raw_xml_response) assert not result
ff6d7a5c5d33e22031f9
def challenge(self, data): # decrypt the data if self.CIPHER != "null": data = self.decrypt(data) # parse the data from the server data = data.decode("utf-8").strip() data = data.split(": ") self.CHALLENGE = data[1] # generate message to send to se...
ff6d90f7bb6c6e777bd4
def is_set_max_noutput_items(self): return _howto_swig.user_device_debug_sptr_is_set_max_noutput_items(self)
ff6da2728b38cf184ef3
def get_value(value, mapping): if pd.isna(value): return None if value not in mapping.keys(): return value return mapping[value]
ff6ddf872c07060a292c
def remove_section(self, section: str) -> bool: self.has_changed.set() return super().remove_section(section)
ff6df3fa6a6ee2ff4fbf
def my_controller(n_agent): out_action = {} for _idx in range(n_agent): out_action[_idx] = np.random.randint(0, 5) return out_action
ff6e05b00855fc9dfeab
def test_loading(self): file = 'test\\violation_small.csv' # skip headers data = sc.textFile(file) header = data.first() # load violation records res = sc.textFile(file) \ .filter(lambda x: x != header) \ .mapPartitions(lambda x: csv.reader...
ff6e108ba69389a94f99
def _device_to_sysfs_path(device): return '%s-%s' % (device.getBusNumber(), '.'.join( [str(item) for item in device.GetPortNumberList()]))
ff6e2d1bedf3e09e3ad2
def init_db() -> None: from werkzeug.security import generate_password_hash from frost.server.database import models # NOQA: F401 Base.metadata.create_all(bind=engine) # Creates the master user and the main room with managed_session() as session: session.add_all([ models.User( ...
ff6e419ba153d4810016
def setSED(self, wavelen, flambda=None, fnu=None): # Check wavelen array for type matches. if isinstance(wavelen, numpy.ndarray)==False: raise ValueError("Wavelength must be a numpy array") # Wavelen type ok - make new copy of data for self. self.wavelen = numpy.copy(wavelen)...
ff6e62ba188d14c93587
def undress(self): self.equip_or_remove("remove")
ff6e633463d698f3a7ec
def _build_initiator_target_map(self, initiator_wwns): init_targ_map = dict.fromkeys(initiator_wwns, self.gateway_fc_wwns) return init_targ_map
ff6e799be46dc1a68890
def __init__(self, data: Union[torch.Tensor, np.ndarray]=None): super().__init__(data) if data is not None: self.data = data
ff6ef96b57bf2f794325
def open_file(f_name: str): f = open(f_name, 'r') try: yield f finally: f.close()
ff6effafd79c0c5500ae
def get_classname(test_script): classname = os.path.basename(test_script).split('.')[0] return classname