function
stringlengths
11
56k
repo_name
stringlengths
5
60
features
list
def test_view_failed_delitem(attr): adata = gen_adata((10, 10)) view = adata[5:7, :][:, :5] adata_hash = joblib.hash(adata) view_hash = joblib.hash(view) with pytest.raises(KeyError): getattr(view, attr).__delitem__("not a key") assert view.is_view assert adata_hash == joblib.hash(...
theislab/anndata
[ 355, 126, 355, 257, 1502460606 ]
def test_view_delitem(attr): adata = gen_adata((10, 10)) getattr(adata, attr)["to_delete"] = np.ones((10, 10)) # Shouldn’t be a subclass, should be an ndarray assert type(getattr(adata, attr)["to_delete"]) is np.ndarray view = adata[5:7, :][:, :5] adata_hash = joblib.hash(adata) view_hash = ...
theislab/anndata
[ 355, 126, 355, 257, 1502460606 ]
def test_view_delattr(attr, subset_func): base = gen_adata((10, 10)) orig_hash = joblib.hash(base) subset = base[subset_func(base.obs_names), subset_func(base.var_names)] empty = ad.AnnData(obs=subset.obs[[]], var=subset.var[[]]) delattr(subset, attr) assert not subset.is_view # Should now...
theislab/anndata
[ 355, 126, 355, 257, 1502460606 ]
def test_view_setattr_machinery(attr, subset_func, subset_func2): # Tests that setting attributes on a view doesn't mess anything up too bad adata = gen_adata((10, 10)) view = adata[subset_func(adata.obs_names), subset_func2(adata.var_names)] actual = view.copy() setattr(view, attr, getattr(actual,...
theislab/anndata
[ 355, 126, 355, 257, 1502460606 ]
def test_view_of_view(matrix_type, subset_func, subset_func2): adata = gen_adata((30, 15), X_type=matrix_type) adata.raw = adata if subset_func is single_subset: pytest.xfail("Other subset generating functions have trouble with this") var_s1 = subset_func(adata.var_names, min_size=4) var_vie...
theislab/anndata
[ 355, 126, 355, 257, 1502460606 ]
def test_double_index(subset_func, subset_func2): adata = gen_adata((10, 10)) obs_subset = subset_func(adata.obs_names) var_subset = subset_func2(adata.var_names) v1 = adata[obs_subset, var_subset] v2 = adata[obs_subset, :][:, var_subset] assert np.all(asarray(v1.X) == asarray(v2.X)) assert...
theislab/anndata
[ 355, 126, 355, 257, 1502460606 ]
def test_modify_uns_in_copy(): # https://github.com/theislab/anndata/issues/571 adata = ad.AnnData(np.ones((5, 5)), uns={"parent": {"key": "value"}}) adata_copy = adata[:3].copy() adata_copy.uns["parent"]["key"] = "new_value" assert adata.uns["parent"]["key"] != adata_copy.uns["parent"]["key"]
theislab/anndata
[ 355, 126, 355, 257, 1502460606 ]
def test_invalid_scalar_index(adata, index): # https://github.com/theislab/anndata/issues/619 with pytest.raises(IndexError, match=r".*index.* out of range\."): _ = adata[index]
theislab/anndata
[ 355, 126, 355, 257, 1502460606 ]
def test_negative_scalar_index(adata, index: int, obs: bool): pos_index = index + (adata.n_obs if obs else adata.n_vars) if obs: adata_pos_subset = adata[pos_index] adata_neg_subset = adata[index] else: adata_pos_subset = adata[:, pos_index] adata_neg_subset = adata[:, index...
theislab/anndata
[ 355, 126, 355, 257, 1502460606 ]
def test_deepcopy_subset(adata, spmat: type): adata.obsp["arr"] = np.zeros((adata.n_obs, adata.n_obs)) adata.obsp["spmat"] = spmat((adata.n_obs, adata.n_obs)) adata = deepcopy(adata[:10].copy()) assert isinstance(adata.obsp["arr"], np.ndarray) assert not isinstance(adata.obsp["arr"], ArrayView) ...
theislab/anndata
[ 355, 126, 355, 257, 1502460606 ]
def test_view_mixin_copies_data(adata, array_type: type, attr): N = 100 adata = ad.AnnData( obs=pd.DataFrame(index=np.arange(N)), var=pd.DataFrame(index=np.arange(N)) ) X = array_type(sparse.eye(N, N).multiply(np.arange(1, N + 1))) if attr == "X": adata.X = X else: getat...
theislab/anndata
[ 355, 126, 355, 257, 1502460606 ]
def upgrade(): ### commands auto generated by Alembic - please adjust! ### op.add_column('citizen_complaints', sa.Column('service_type', sa.String(length=255), nullable=True)) op.add_column('citizen_complaints', sa.Column('source', sa.String(length=255), nullable=True)) ### end Alembic commands ###
codeforamerica/comport
[ 22, 14, 22, 54, 1441228033 ]
def image(self, instance): return '<img src="%s" />' % (instance.photo_130,)
ramusus/django-vkontakte-video
[ 4, 2, 4, 3, 1417606246 ]
def image_preview(self, obj): return u'<a href="%s"><img src="%s" height="30" /></a>' % (obj.photo_160, obj.photo_160)
ramusus/django-vkontakte-video
[ 4, 2, 4, 3, 1417606246 ]
def image_preview(self, obj): return u'<a href="%s"><img src="%s" height="30" /></a>' % (obj.photo_130, obj.photo_130)
ramusus/django-vkontakte-video
[ 4, 2, 4, 3, 1417606246 ]
def read_user_data( fn ): """ Given a filename, returns the file's contents in a string. """ r = '' with open( fn ) as fh: r = fh.read() fh.close() return r
smithfarm/ceph-auto-aws
[ 24, 9, 24, 18, 1442047504 ]
def get_tag( ec, obj, tag ): """ Get the value of a tag associated with the given resource object. Returns None if the tag is not set. Warning: EC2 tags are case-sensitive. """ tags = get_tags( ec, obj.id ) found = 0 for t in tags: if t.name == tag: found = 1 ...
smithfarm/ceph-auto-aws
[ 24, 9, 24, 18, 1442047504 ]
def init_region( r ): """ Takes a region string. Connects to that region. Returns EC2Connection and VPCConnection objects in a tuple. """ # connect to region c = vpc.connect_to_region( r ) ec = ec2.connect_to_region( r ) return ( c, ec )
smithfarm/ceph-auto-aws
[ 24, 9, 24, 18, 1442047504 ]
def init_subnet( c, vpc_id, cidr ): """ Takes VPCConnection object, which is actually a connection to a region, and a CIDR block string. Looks for our subnet in that region. If subnet does not exist, creates it. Returns the subnet resource object on success, raises exception on fail...
smithfarm/ceph-auto-aws
[ 24, 9, 24, 18, 1442047504 ]
def derive_ip_address( cidr_block, delegate, final8 ): """ Given a CIDR block string, a delegate number, and an integer representing the final 8 bits of the IP address, construct and return the IP address derived from this values. For example, if cidr_block is 10.0.0.0/16, the deleg...
smithfarm/ceph-auto-aws
[ 24, 9, 24, 18, 1442047504 ]
def get_master_instance( ec2_conn, subnet_id ): """ Given EC2Connection object and Master Subnet id, check that there is just one instance running in that subnet - this is the Master. Raise exception if the number of instances is != 0. Return the Master instance object. """ ...
smithfarm/ceph-auto-aws
[ 24, 9, 24, 18, 1442047504 ]
def process_user_data( fn, vars = [] ): """ Given filename of user-data file and a list of environment variable names, replaces @@...@@ tokens with the values of the environment variables. Returns the user-data string on success raises exception on failure. """ # Get user_da...
smithfarm/ceph-auto-aws
[ 24, 9, 24, 18, 1442047504 ]
def make_reservation( ec, ami_id, **kwargs ): """ Given EC2Connection object, delegate number, AMI ID, as well as all the kwargs referred to below, make a reservation for an instance and return the registration object. """ # extract arguments to be passed to ec.run_instances() o...
smithfarm/ceph-auto-aws
[ 24, 9, 24, 18, 1442047504 ]
def wait_for_available( ec2_conn, volume_id ): """ Given a volume id, wait for its state to change to "available". """ print "Waiting for {} available state".format( volume_id ) while True: volumes = ec2_conn.get_all_volumes( volume_ids=[ volume_id ] ) print "Current status is {}...
smithfarm/ceph-auto-aws
[ 24, 9, 24, 18, 1442047504 ]
def __init__(self, jid): self.jid = JID(jid)
IgnitedAndExploded/pyfire
[ 5, 1, 5, 2, 1311503726 ]
def __init__(self, jid, **kwds): super(Contact, self).__init__() # required if isinstance(jid, basestring): self.jid = JID(jid) elif isinstance(jid, JID): self.jid = jid self.jid.validate(raise_error=True) else: raise AttributeErro...
IgnitedAndExploded/pyfire
[ 5, 1, 5, 2, 1311503726 ]
def local_action_activate(x = None): '''{ "title": "Turn on", "desc": "Turn on." }''' queue.put({'function': 'remote_action_PowerOn', 'delay': 120}) queue.put({'function': 'remote_action_SetInput', 'arg':{"source":"DIGITAL", "number":1}, 'delay': 5}) print 'Activated'
museumsvictoria/nodel-recipes
[ 10, 11, 10, 17, 1438606188 ]
def local_action_deactivate(x = None): '''{ "title": "Turn off", "desc": "Turn off." }''' queue.put({'function': 'remote_action_PowerOff', 'delay': 120}) print 'Deactivated'
museumsvictoria/nodel-recipes
[ 10, 11, 10, 17, 1438606188 ]
def __init__(self): threading.Thread.__init__(self) self.event = threading.Event()
museumsvictoria/nodel-recipes
[ 10, 11, 10, 17, 1438606188 ]
def stop(self): self.event.set()
museumsvictoria/nodel-recipes
[ 10, 11, 10, 17, 1438606188 ]
def cleanup(): print 'shutdown' th.stop()
museumsvictoria/nodel-recipes
[ 10, 11, 10, 17, 1438606188 ]
def _make_node(Name, Fields, Attributes, Bases): def create_node(self, *args, **kwargs): nbparam = len(args) + len(kwargs) assert nbparam in (0, len(Fields)), \ "Bad argument number for {}: {}, expecting {}".\ format(Name, nbparam, len(Fields)) self._fields = Fields ...
ryfeus/lambda-packs
[ 1086, 234, 1086, 13, 1476901359 ]
def parse(*args, **kwargs): return ast_to_gast(_ast.parse(*args, **kwargs))
ryfeus/lambda-packs
[ 1086, 234, 1086, 13, 1476901359 ]
def setUp(self): self.docs = [ 'This cat dog is running happy.', 'This cat dog runs sad.' ]
frnsys/broca
[ 73, 9, 73, 6, 1411051143 ]
def test_rake(self): expected_t_docs = [ ['cat dog', 'running happy'], ['cat dog runs sad'] ] t_docs = keyword.RAKETokenizer().tokenize(self.docs) # Order not necessarily preserved for i, output in enumerate(t_docs): self.assertEqual(set(outpu...
frnsys/broca
[ 73, 9, 73, 6, 1411051143 ]
def test_pos(self): expected_t_docs = [ ['cat dog'], ['cat dog'] ] t_docs = keyword.POSTokenizer().tokenize(self.docs) self.assertEqual(t_docs, expected_t_docs)
frnsys/broca
[ 73, 9, 73, 6, 1411051143 ]
def test_rake_parallel(self): expected_t_docs = [ ['cat dog', 'running happy'], ['cat dog runs sad'] ] t_docs = keyword.RAKETokenizer(n_jobs=-1).tokenize(self.docs) # Order not necessarily preserved for i, output in enumerate(t_docs): self.ass...
frnsys/broca
[ 73, 9, 73, 6, 1411051143 ]
def setUp(self): self.docs = [ 'This cat dog is running happy.', 'This cat dog runs sad.' ]
frnsys/broca
[ 73, 9, 73, 6, 1411051143 ]
def test_selected_attribute(): node = xpath.XPathNode(element='element', selected_attribute='value') assert node.xpath == '//element/@value' tree = etree.XML("<top><container><element value='1'>" "</element><element value='2'></element>" "</container></top>") b...
IvanMalison/okcupyd
[ 105, 18, 105, 24, 1411441891 ]
def test_attribute_contains(): tree = etree.XML("<top><elem a='complete'></elem></top>") assert xpath.xpb.elem.attribute_contains('a', 'complet').apply_(tree) != []
IvanMalison/okcupyd
[ 105, 18, 105, 24, 1411441891 ]
def _not(_rcvr): return falseObject
SOM-st/PySOM
[ 24, 4, 24, 5, 1382259745 ]
def _and_and_if_true(_rcvr, arg): if isinstance(arg, _Block): block_method = arg.get_method() return block_method.invoke_1(arg) return arg
SOM-st/PySOM
[ 24, 4, 24, 5, 1382259745 ]
def _if_true_if_false(_rcvr, true_block, _false_block): if isinstance(true_block, _Block): block_method = true_block.get_method() return block_method.invoke_1(true_block) return true_block
SOM-st/PySOM
[ 24, 4, 24, 5, 1382259745 ]
def create(kernel): result = Intangible() result.template = "object/draft_schematic/droid/component/shared_advanced_droid_frame.iff" result.attribute_template_id = -1 result.stfName("string_id_table","")
anhstudios/swganh
[ 62, 37, 62, 37, 1297996365 ]
def callback_function(data): #FILL IN HERE global publisher_name, msg msg.linear.x = -data.linear.x msg.angular.z = -data.angular.z publisher_name.publish(msg)
BARCproject/barc
[ 201, 290, 201, 11, 1443204258 ]
def __init__(self, config): self._config = config self._device = \ self._new_capture_device(config['camera']['device_index']) self.set_dimensions( config['camera']['width'], config['camera']['height'], )
GNOME-MouseTrap/mousetrap
[ 4, 12, 4, 10, 1400179132 ]
def _new_capture_device(cls, device_index): capture = cv2.VideoCapture(device_index) if not capture.isOpened(): capture.release() raise IOError(cls.S_CAPTURE_OPEN_ERROR % device_index) return capture
GNOME-MouseTrap/mousetrap
[ 4, 12, 4, 10, 1400179132 ]
def read_image(self): ret, image = self._device.read() if not ret: raise IOError(self.S_CAPTURE_READ_ERROR) return Image(self._config, image)
GNOME-MouseTrap/mousetrap
[ 4, 12, 4, 10, 1400179132 ]
def __init__(self, config): self._config = config self._haar_files = config['haar_files'] self._haar_cache = {}
GNOME-MouseTrap/mousetrap
[ 4, 12, 4, 10, 1400179132 ]
def from_file(self, file_, cache_name=None): import os if cache_name in self._haar_cache: return self._haar_cache[cache_name] current_dir = os.path.dirname(os.path.realpath(__file__)) haar_file = os.path.join(current_dir, file_) haar = cv2.CascadeClassifier(haar_f...
GNOME-MouseTrap/mousetrap
[ 4, 12, 4, 10, 1400179132 ]
def get_detector(cls, config, name, scale_factor=1.1, min_neighbors=3): key = (name, scale_factor, min_neighbors) if key in cls._INSTANCES: LOGGER.info("Reusing %s detector.", key) return cls._INSTANCES[key] cls._INSTANCES[key] = FeatureDetector( config, n...
GNOME-MouseTrap/mousetrap
[ 4, 12, 4, 10, 1400179132 ]
def clear_all_detection_caches(cls): for instance in cls._INSTANCES.values(): instance.clear_cache()
GNOME-MouseTrap/mousetrap
[ 4, 12, 4, 10, 1400179132 ]
def detect(self, image): if image in self._detect_cache: message = "Detection cache hit: %(image)d -> %(result)s" % \ {'image':id(image), 'result':self._detect_cache[image]} LOGGER.debug(message) if isinstance(self._detect_cache[image], FeatureNotFoundExce...
GNOME-MouseTrap/mousetrap
[ 4, 12, 4, 10, 1400179132 ]
def _exit_if_none_detected(self): if len(self._plural) == 0: message = _('Feature not detected: %s') % (self._name) if self._last_attempt_successful: self._last_attempt_successful = False LOGGER.info(message) raise FeatureNotFoundException(mess...
GNOME-MouseTrap/mousetrap
[ 4, 12, 4, 10, 1400179132 ]
def _calculate_center(self): self._single["center"] = { "x": (self._single["x"] + self._single["width"]) // 2, "y": (self._single["y"] + self._single["height"]) // 2, }
GNOME-MouseTrap/mousetrap
[ 4, 12, 4, 10, 1400179132 ]
def clear_cache(self): self._detect_cache.clear()
GNOME-MouseTrap/mousetrap
[ 4, 12, 4, 10, 1400179132 ]
def __init__(self, config): super(FeatureDetectorClearCachePlugin, self).__init__(config) self._config = config
GNOME-MouseTrap/mousetrap
[ 4, 12, 4, 10, 1400179132 ]
def __init__(self, msg): super(TransactionError, self).__init__(msg)
rpm-software-management/dnf
[ 1066, 367, 1066, 40, 1331307069 ]
def __init__(self, filename, errors): """ :param filename: The name of the transaction file being replayed :param errors: a list of error classes or a string with an error description """ # store args in case someone wants to read them from a caught exception self.filena...
rpm-software-management/dnf
[ 1066, 367, 1066, 40, 1331307069 ]
def __init__(self, filename, msg): super(IncompatibleTransactionVersionError, self).__init__(filename, msg)
rpm-software-management/dnf
[ 1066, 367, 1066, 40, 1331307069 ]
def serialize_transaction(transaction): """ Serializes a transaction to a data structure that is equivalent to the stored JSON format. :param transaction: the transaction to serialize (an instance of dnf.db.history.TransactionWrapper) """ data = { "version": VERSION, } rpms = [] ...
rpm-software-management/dnf
[ 1066, 367, 1066, 40, 1331307069 ]
def __init__( self, base, filename="", data=None, ignore_extras=False, ignore_installed=False, skip_unavailable=False
rpm-software-management/dnf
[ 1066, 367, 1066, 40, 1331307069 ]
def _load_from_file(self, fn): self._filename = fn with open(fn, "r") as f: try: replay_data = json.load(f) except json.decoder.JSONDecodeError as e: raise TransactionReplayError(fn, str(e) + ".") try: self._load_from_data(repl...
rpm-software-management/dnf
[ 1066, 367, 1066, 40, 1331307069 ]
def _raise_or_warn(self, warn_only, msg): if warn_only: self._warnings.append(msg) else: raise TransactionError(msg)
rpm-software-management/dnf
[ 1066, 367, 1066, 40, 1331307069 ]
def _verify_toplevel_json(self, replay_data): fn = self._filename if "version" not in replay_data: raise TransactionReplayError(fn, _('Missing key "{key}".'.format(key="version"))) self._assert_type(replay_data["version"], str, "version", "string") _check_version(replay_da...
rpm-software-management/dnf
[ 1066, 367, 1066, 40, 1331307069 ]
def _create_swdb_group(self, group_id, pkg_types, pkgs): comps_group = self._base.comps._group_by_id(group_id) if not comps_group: self._raise_or_warn(self._skip_unavailable, _("Group id '%s' is not available.") % group_id) return None swdb_group = self._base.history.gro...
rpm-software-management/dnf
[ 1066, 367, 1066, 40, 1331307069 ]
def _swdb_group_upgrade(self, group_id, pkg_types, pkgs): if not self._base.history.group.get(group_id): self._raise_or_warn( self._ignore_installed, _("Group id '%s' is not installed.") % group_id) return swdb_group = self._create_swdb_group(group_id, pkg_types, pkgs) ...
rpm-software-management/dnf
[ 1066, 367, 1066, 40, 1331307069 ]
def _create_swdb_environment(self, env_id, pkg_types, groups): comps_env = self._base.comps._environment_by_id(env_id) if not comps_env: self._raise_or_warn(self._skip_unavailable, _("Environment id '%s' is not available.") % env_id) return None swdb_env = self._base.his...
rpm-software-management/dnf
[ 1066, 367, 1066, 40, 1331307069 ]
def _swdb_environment_upgrade(self, env_id, pkg_types, groups): if not self._base.history.env.get(env_id): self._raise_or_warn(self._ignore_installed,_("Environment id '%s' is not installed.") % env_id) return swdb_env = self._create_swdb_environment(env_id, pkg_types, groups) ...
rpm-software-management/dnf
[ 1066, 367, 1066, 40, 1331307069 ]
def get_data(self): """ :returns: the loaded data of the transaction """ return self._replay_data
rpm-software-management/dnf
[ 1066, 367, 1066, 40, 1331307069 ]
def run(self): """ Replays the transaction. """ fn = self._filename errors = [] for pkg_data in self._rpms: try: self._replay_pkg_action(pkg_data) except TransactionError as e: errors.append(e) for group_d...
rpm-software-management/dnf
[ 1066, 367, 1066, 40, 1331307069 ]
def __init__(self, branch, package): Base.__init__(self) self.branch = branch self.package = package self.sp_obj = None
ingvagabund/gofed
[ 67, 28, 67, 88, 1413793073 ]
def getProvides(self): """Fetch a spec file from pkgdb and get provides from all its [sub]packages""" if self.sp_obj == None: return {} return self.sp_obj.getProvides()
ingvagabund/gofed
[ 67, 28, 67, 88, 1413793073 ]
def add_cases(request, run_ids, case_ids): """Add one or more cases to the selected test runs. :param run_ids: give one or more run IDs. It could be an integer, a string containing comma separated IDs, or a list of int each of them is a run ID. :type run_ids: int, str or list :param cas...
Nitrate/Nitrate
[ 222, 99, 222, 60, 1413958586 ]
def remove_cases(request, run_ids, case_ids): """Remove one or more cases from the selected test runs. :param run_ids: give one or more run IDs. It could be an integer, a string containing comma separated IDs, or a list of int each of them is a run ID. :type run_ids: int, str or list :p...
Nitrate/Nitrate
[ 222, 99, 222, 60, 1413958586 ]
def add_tag(request, run_ids, tags): """Add one or more tags to the selected test runs. :param run_ids: give one or more run IDs. It could be an integer, a string containing comma separated IDs, or a list of int each of them is a run ID. :type run_ids: int, str or list :param tags: tag ...
Nitrate/Nitrate
[ 222, 99, 222, 60, 1413958586 ]
def create(request, values): """Creates a new Test Run object and stores it in the database. :param dict values: a mapping containing these data to create a test run. * plan: (int) **Required** ID of test plan * build: (int)/(str) **Required** ID of Build * manager: (int) **Required** ...
Nitrate/Nitrate
[ 222, 99, 222, 60, 1413958586 ]
def env_value(request, action, run_ids, env_value_ids): """ Add or remove env values to the given runs, function is same as link_env_value or unlink_env_value :param str action: what action to do, ``add`` or ``remove``. :param run_ids: give one or more run IDs. It could be an integer, a str...
Nitrate/Nitrate
[ 222, 99, 222, 60, 1413958586 ]
def filter(request, values={}): """Performs a search and returns the resulting list of test runs. :param dict values: a mapping containing these criteria. * build: ForeignKey: TestBuild * cc: ForeignKey: Auth.User * env_value: ForeignKey: Environment Value * default_tester: For...
Nitrate/Nitrate
[ 222, 99, 222, 60, 1413958586 ]
def filter_count(request, values={}): """Performs a search and returns the resulting count of runs. :param dict values: a mapping containing criteria. See also :meth:`TestRun.filter <tcms.xmlrpc.api.testrun.filter>`. :return: total matching runs. :rtype: int .. seealso:: See example...
Nitrate/Nitrate
[ 222, 99, 222, 60, 1413958586 ]
def get(request, run_id): """Used to load an existing test run from the database. :param int run_id: test run ID. :return: a mapping representing found :class:`TestRun`. :rtype: dict Example:: TestRun.get(1) """ try: tr = TestRun.objects.get(run_id=run_id) except TestR...
Nitrate/Nitrate
[ 222, 99, 222, 60, 1413958586 ]
def get_issues(request, run_ids): """Get the list of issues attached to this run. :param run_ids: give one or more run IDs. It could be an integer, a string containing comma separated IDs, or a list of int each of them is a run ID. :type run_ids: int, str or list :return: a list of mapp...
Nitrate/Nitrate
[ 222, 99, 222, 60, 1413958586 ]
def get_change_history(request, run_id): """Get the list of changes to the fields of this run. :param int run_id: run ID. :return: list of mapping with changed fields and their details. :rtype: list .. warning:: NOT IMPLEMENTED - History is different than before. """ raise NotImplem...
Nitrate/Nitrate
[ 222, 99, 222, 60, 1413958586 ]
def get_completion_report(request, run_ids): """Get a report of the current status of the selected runs combined. :param run_ids: give one or more run IDs. It could be an integer, a string containing comma separated IDs, or a list of int each of them is a run ID. :type run_ids: int, str or ...
Nitrate/Nitrate
[ 222, 99, 222, 60, 1413958586 ]
def get_env_values(request, run_id): """Get the list of env values to this run. :param int run_id: run ID. :return: a list of mappings representing found :class:`TCMSEnvValue`. :rtype: List[dict] Example:: TestRun.get_env_values(8) """ from tcms.management.models import TCMSEnvVal...
Nitrate/Nitrate
[ 222, 99, 222, 60, 1413958586 ]
def get_tags(request, run_id): """Get the list of tags attached to this run. :param int run_id: run ID. :return: a mapping representing found :class:`TestTag`. :rtype: dict Example:: TestRun.get_tags(1) """ tr = TestRun.objects.get(run_id=run_id) tag_ids = tr.tag.values_list(...
Nitrate/Nitrate
[ 222, 99, 222, 60, 1413958586 ]
def get_test_case_runs(request, run_id): """Get the list of cases that this run is linked to. :param int run_id: run ID. :return: a list of mappings of found :class:`TestCaseRun`. :rtype: list[dict] Example:: # Get all of case runs TestRun.get_test_case_runs(1) """ return ...
Nitrate/Nitrate
[ 222, 99, 222, 60, 1413958586 ]
def get_test_cases(request, run_id): """Get the list of cases that this run is linked to. :param int run_id: run ID. :return: a list of mappings of found :class:`TestCase`. :rtype: list[dict] Example:: TestRun.get_test_cases(1) """ tcs_serializer = TestCase.to_xmlrpc(query={"case_...
Nitrate/Nitrate
[ 222, 99, 222, 60, 1413958586 ]
def get_test_plan(request, run_id): """Get the plan that this run is associated with. :param int run_id: run ID. :return: a mapping of found :class:`TestPlan`. :rtype: dict Example:: TestRun.get_test_plan(1) """ return TestRun.objects.select_related("plan").get(run_id=run_id).plan...
Nitrate/Nitrate
[ 222, 99, 222, 60, 1413958586 ]
def remove_tag(request, run_ids, tags): """Remove a tag from a run. :param run_ids: give one or more run IDs. It could be an integer, a string containing comma separated IDs, or a list of int each of them is a run ID. :type run_ids: int, str or list :param tags: tag name or a list of ta...
Nitrate/Nitrate
[ 222, 99, 222, 60, 1413958586 ]
def update(request, run_ids, values): """Updates the fields of the selected test run. :param run_ids: give one or more run IDs. It could be an integer, a string containing comma separated IDs, or a list of int each of them is a run ID. :type run_ids: int, str or list :param dict values:...
Nitrate/Nitrate
[ 222, 99, 222, 60, 1413958586 ]
def link_env_value(request, run_ids, env_value_ids): """Link env values to the given runs. :param run_ids: give one or more run IDs. It could be an integer, a string containing comma separated IDs, or a list of int each of them is a run ID. :type run_ids: int, str or list :param env_val...
Nitrate/Nitrate
[ 222, 99, 222, 60, 1413958586 ]
def find_clang(conf): """ Find the program clang, and if present, try to detect its version number """ cc = conf.find_program(['clang', 'cc'], var='CC') cc = conf.cmd_to_list(cc) conf.get_cc_version(cc, gcc=True) conf.env.CC_NAME = 'clang' conf.env.CC = cc
Gnomescroll/Gnomescroll
[ 29, 13, 29, 2, 1385070845 ]
def clang_common_flags(conf): """ Common flags for clang on nearly all platforms """ v = conf.env v['CC_SRC_F'] = [] v['CC_TGT_F'] = ['-c', '-o'] # linker if not v['LINK_CC']: v['LINK_CC'] = v['CC'] v['CCLNK_SRC_F'] = [] v['CCLNK_TGT_F'] = ...
Gnomescroll/Gnomescroll
[ 29, 13, 29, 2, 1385070845 ]
def clang_modifier_win32(conf): """Configuration flags for executing clang on Windows""" v = conf.env v['cprogram_PATTERN'] = '%s.exe' v['cshlib_PATTERN'] = '%s.dll' v['implib_PATTERN'] = 'lib%s.dll.a' v['IMPLIB_ST'] = '-Wl,--out-implib,%s' v['CFLAGS_cshlib'] =...
Gnomescroll/Gnomescroll
[ 29, 13, 29, 2, 1385070845 ]
def clang_modifier_cygwin(conf): """Configuration flags for executing clang on Cygwin""" clang_modifier_win32(conf) v = conf.env v['cshlib_PATTERN'] = 'cyg%s.dll' v.append_value('LINKFLAGS_cshlib', ['-Wl,--enable-auto-image-base']) v['CFLAGS_cshlib'] = []
Gnomescroll/Gnomescroll
[ 29, 13, 29, 2, 1385070845 ]
def clang_modifier_darwin(conf): """Configuration flags for executing clang on MacOS""" v = conf.env v['CFLAGS_cshlib'] = ['-fPIC', '-compatibility_version', '1', '-current_version', '1'] v['LINKFLAGS_cshlib'] = ['-dynamiclib'] v['cshlib_PATTERN'] = 'lib%s.dylib' v['FRAMEWORKPATH_S...
Gnomescroll/Gnomescroll
[ 29, 13, 29, 2, 1385070845 ]
def clang_modifier_aix(conf): """Configuration flags for executing clang on AIX""" v = conf.env v['LINKFLAGS_cprogram'] = ['-Wl,-brtl'] v['LINKFLAGS_cshlib'] = ['-shared','-Wl,-brtl,-bexpfull'] v['SHLIB_MARKER'] = []
Gnomescroll/Gnomescroll
[ 29, 13, 29, 2, 1385070845 ]
def clang_modifier_hpux(conf): v = conf.env v['SHLIB_MARKER'] = [] v['CFLAGS_cshlib'] = ['-fPIC','-DPIC'] v['cshlib_PATTERN'] = 'lib%s.sl'
Gnomescroll/Gnomescroll
[ 29, 13, 29, 2, 1385070845 ]
def clang_modifier_platform(conf): """Execute platform-specific functions based on *clang_modifier_+NAME*""" # * set configurations specific for a platform. # * the destination platform is detected automatically by looking at the macros the compiler predefines, # and if it's not recognised, it fallbac...
Gnomescroll/Gnomescroll
[ 29, 13, 29, 2, 1385070845 ]