text stringlengths 78 104k | score float64 0 0.18 |
|---|---|
def multicomp(pvals, alpha=0.05, method='holm'):
"""P-values correction for multiple comparisons.
Parameters
----------
pvals : array_like
uncorrected p-values.
alpha : float
Significance level.
method : string
Method used for testing and adjustment of pvalues. Can be ei... | 0.000257 |
def get_score(self):
"""
获得成绩列表
:return: json array
"""
html = self.__get_score_html()
soup = BeautifulSoup(html)
div = soup.find_all('div', class_='Section1')[0]
tag_ps = div.find_all('p')
del tag_ps[0]
result = []
'''
#one... | 0.001595 |
def add_disk(self, path, force_disk_indexes=True, **args):
"""Adds a disk specified by the path to the ImageParser.
:param path: The path to the disk volume
:param force_disk_indexes: If true, always uses disk indexes. If False, only uses disk indexes if this is the
... | 0.005118 |
def present(name,
config=None,
**kwargs):
'''
Ensure the job is present in the Jenkins configured jobs
name
The unique name for the Jenkins job
config
The Salt URL for the file to use for configuring the job
'''
ret = {'name': name,
'result':... | 0.001427 |
def get_storage(self, name='main', file_format='pickle', TTL=None):
'''Returns a storage for the given name. The returned storage is a
fully functioning python dictionary and is designed to be used that
way. It is usually not necessary for the caller to load or save the
storage manually.... | 0.001893 |
def decode_to_str(self):
"""
Return the array of string identifiers corresponding to self
>>> enum_array = household('housing_occupancy_status', period)
>>> enum_array[0]
>>> 2 # Encoded value
>>> enum_array.decode_to_str()[0]
>>> 'free_l... | 0.006198 |
def _list_queues(self, prefix=None, marker=None, max_results=None,
include=None, timeout=None):
'''
Returns a list of queues under the specified account. Makes a single list
request to the service. Used internally by the list_queues method.
:param str prefix:
... | 0.003638 |
def _apply_summaries(self):
"""Add all summary rows and columns."""
def as_frame(r):
if isinstance(r, pd.Series):
return r.to_frame()
else:
return r
df = self.data
if df.index.nlevels > 1:
raise ValueError(
... | 0.00224 |
def epanechnikov(xx, idx=None):
"""
The Epanechnikov kernel estimated for xx values at indices idx (zero
elsewhere)
Parameters
----------
xx: float array
Values of the function on which the kernel is computed. Typically,
these are Euclidean distances from some point x0 (see do_... | 0.009036 |
def onStart(self, *args, **kwarg):
"""
Verify user input and kick off the client's program if valid
"""
with transactUI(self):
config = self.navbar.getActiveConfig()
config.resetErrors()
if config.isValid():
self.clientRunner.ru... | 0.004255 |
def users_register(self, email, name, password, username, **kwargs):
"""Register a new user."""
return self.__call_api_post('users.register', email=email, name=name, password=password, username=username,
kwargs=kwargs) | 0.011111 |
def __dict_to_BetterDict(self, attr):
"""Convert the passed attr to a BetterDict if the value is a dict
Returns: The new value of the passed attribute."""
if type(self[attr]) == dict:
self[attr] = BetterDict(self[attr])
return self[attr] | 0.007067 |
def nx_graph_from_dotfile(filename: str) -> nx.DiGraph:
""" Get a networkx graph from a DOT file, and reverse the edges. """
return nx.DiGraph(read_dot(filename).reverse()) | 0.005556 |
def column_preview(table_name, col_name):
"""
Return the first ten elements of a column as JSON in Pandas'
"split" format.
"""
col = orca.get_table(table_name).get_column(col_name).head(10)
return (
col.to_json(orient='split', date_format='iso'),
200,
{'Content-Type': '... | 0.00295 |
def read_structs(fstream):
"""
Read all structs from likwid's file stream.
Args:
fstream: Likwid's output file stream.
Returns:
A generator that can be used to iterate over all structs in the
fstream.
"""
struct = read_struct(fstream)
while struct is not None:
... | 0.002681 |
def _ps_extract_pid(self, line):
"""
Extract PID and parent PID from an output line from the PS command
"""
this_pid = self.regex['pid'].sub(r'\g<1>', line)
this_parent = self.regex['parent'].sub(r'\g<1>', line)
# Return the main / parent PIDs
return this... | 0.008902 |
def terminate(self):
"""
Called when an existing task is removed from the configuration.
This sets a Do Not Resuscitate flag and then initiates a stop
sequence. Once all processes have stopped, the task will delete
itself.
"""
log = self._params.get('log', self._disc... | 0.004598 |
def get_last(self, n=1):
"""
Retrieve the last n rows from the table
:param n: number of rows to return
:return: list of rows
"""
rows = []
# Get values from the partial db first
if self.tracker.dbcon_part and check_table_exists(self.tracker.dbcon_part, se... | 0.006163 |
def check_args(args):
"""Checks the arguments and options.
:param args: an object containing the options and arguments of the program.
:type args: :py:class:`argparse.Namespace`
:returns: ``True`` if everything was OK.
If there is a problem with an option, an exception is raised using the
:p... | 0.001597 |
def set_palette_colors(self, palette):
"""Updates the color buttons with the given palette
"""
palette = palette.split(':')
for i, pal in enumerate(palette):
x, color = Gdk.Color.parse(pal)
self.get_widget('palette_%d' % i).set_color(color) | 0.006757 |
def __RenderOurModuleFlags(self, module, output_lines, prefix=''):
"""Generates a help string for a given module."""
flags = self._GetFlagsDefinedByModule(module)
if flags:
self.__RenderModuleFlags(module, flags, output_lines, prefix) | 0.007937 |
def restore_schema(task, **kwargs):
""" Switches the schema back to the one from before running the task. """
from .compat import get_public_schema_name
schema_name = get_public_schema_name()
include_public = True
if hasattr(task, '_old_schema'):
schema_name, include_public = task._old_sch... | 0.001969 |
def rescale_array_to_z1z2(array, z1z2=(-1.0, 1.0)):
"""Rescale the values in a numpy array to the [z1,z2] interval.
The transformation is carried out following the relation
array_rs = b_flux * array - c_flux
as explained in Appendix B1 of Cardiel (2009, MNRAS, 396, 680)
Parameters
----------
... | 0.000943 |
def file_format(self):
"""Formats device filesystem"""
log.info('Formating, can take minutes depending on flash size...')
res = self.__exchange('file.format()', timeout=300)
if 'format done' not in res:
log.error(res)
else:
log.info(res)
return res | 0.00625 |
def create_gaps_and_overlaps_tier(self, tier1, tier2, tier_name=None,
maxlen=-1, fast=False):
"""Create a tier with the gaps and overlaps of the annotations.
For types see :func:`get_gaps_and_overlaps`
:param str tier1: Name of the first tier.
:para... | 0.002137 |
def _try_get_solutions(self, address, size, access, max_solutions=0x1000, force=False):
"""
Try to solve for a symbolic address, checking permissions when reading/writing size bytes.
:param Expression address: The address to solve for
:param int size: How many bytes to check permissions... | 0.006548 |
def monochrome(clr):
"""
Returns colors in the same hue with varying brightness/saturation.
"""
def _wrap(x, min, threshold, plus):
if x - min < threshold:
return x + plus
else:
return x - min
colors = colorlist(clr)
c = clr.copy()
c.brightness = _wr... | 0.00123 |
def proximal(self):
"""Return the proximal factory of the functional.
See Also
--------
odl.solvers.nonsmooth.proximal_operators.proximal_l1 :
proximal factory for the L1-norm.
odl.solvers.nonsmooth.proximal_operators.proximal_l2 :
proximal factory for th... | 0.002681 |
def delete_board(self, id):
"""Delete an agile board."""
board = Board(self._options, self._session, raw={'id': id})
board.delete() | 0.012903 |
def _assertCALL(self, url, *, allow_empty=False, check_headers=True, check_status=True,
expect_errors=False, name=None, method='get', data=None):
"""
check url for response changes
:param url: url to check
:param allow_empty: if True ignore empty response and 404 err... | 0.005117 |
def validate_units(self):
"""Ensure that wavelenth and flux units belong to the
correct classes.
Raises
------
TypeError
Wavelength unit is not `~pysynphot.units.WaveUnits` or
flux unit is not `~pysynphot.units.FluxUnits`.
"""
if (not isi... | 0.003484 |
def url_assembler(query_string, no_redirect=0, no_html=0, skip_disambig=0):
"""Assembler of parameters for building request query.
Args:
query_string: Query to be passed to DuckDuckGo API.
no_redirect: Skip HTTP redirects (for !bang commands). Default - False.
no_html: Remove HTML from ... | 0.001218 |
def Matches(self, file_entry):
"""Compares the file entry against the filter.
Args:
file_entry (dfvfs.FileEntry): file entry to compare.
Returns:
bool: True if the file entry matches the filter, False if not or
None if the filter does not apply.
"""
if not self._file_scanner ... | 0.010256 |
def find_out_attribs(self):
"""
Get all out attributes in the shader source.
:return: List of attribute names
"""
names = []
for line in self.lines:
if line.strip().startswith("out "):
names.append(line.split()[2].replace(';', ''))
... | 0.0059 |
def takes_instance_or_queryset(func):
"""Decorator that makes standard Django admin actions compatible."""
@wraps(func)
def decorated_function(self, request, queryset):
# func follows the prototype documented at:
# https://docs.djangoproject.com/en/dev/ref/contrib/admin/actions/#writing-acti... | 0.001065 |
def status(ctx, date, f, pushed):
"""
Shows the summary of what's going to be committed to the server.
"""
try:
timesheet_collection = get_timesheet_collection_for_context(ctx, f)
except ParseError as e:
ctx.obj['view'].err(e)
else:
ctx.obj['view'].show_status(
... | 0.00198 |
def getResiduals(self):
""" regress out fixed effects and results residuals """
X = np.zeros((self.N*self.P,self.n_fixed_effs))
ip = 0
for i in range(self.n_terms):
Ki = self.A[i].shape[0]*self.F[i].shape[1]
X[:,ip:ip+Ki] = np.kron(self.A[i].T,self.F[i])
... | 0.022634 |
def get_range_start_line_number(self,rng):
"""
.. warning:: not implemented
"""
sys.stderr.write("error unimplemented get_range_start_line\n")
sys.exit()
for i in range(0,len(self._lines)):
if rng.cmp(self._lines[i]['rng'])==0: return i+1
return None | 0.021127 |
def toJulian(dt=None):
"""Converts a Python datetime to a Julian date, using the formula from
Meesus (1991). This formula is reproduced in D.A. Vallado (2004).
See:
D.A. Vallado, Fundamentals of Astrodynamics and Applications, p. 187
http://books.google.com/books?id=PJLlWzMBKjkC&lpg=PA956... | 0.01519 |
def combine_heads(self, x):
"""Combine tensor that has been split.
Args:
x: A tensor [batch_size, num_heads, length, hidden_size/num_heads]
Returns:
A tensor with shape [batch_size, length, hidden_size]
"""
with tf.name_scope("combine_heads"):
batch_size = tf.shape(x)[0]
le... | 0.01227 |
def cleanup_images(remove_old=False, **kwargs):
"""
Removes all images that have no name, and that are not references as dependency by any other named image. Similar
to the ``prune`` functionality in newer Docker versions, but supports more filters.
:param remove_old: Also remove images that do have a ... | 0.006766 |
def dump(data, stream=None, **kwds):
"""
Serialize a Python object into a YAML stream.
If stream is None, return the produced string instead.
Dict keys are produced in the order in which they appear in OrderedDicts.
Safe version.
If objects are not "conventional" objects, t... | 0.003086 |
def create_bagit_stream(dir_name, payload_info_list):
"""Create a stream containing a BagIt zip archive.
Args:
dir_name : str
The name of the root directory in the zip file, under which all the files
are placed (avoids "zip bombs").
payload_info_list: list
L... | 0.002874 |
def verify_key(self, url):
"""For verifying your API key.
Provide the URL of your site or blog you will be checking spam from.
"""
response = self._request('verify-key', {
'blog': url,
'key': self._key
})
if response.stat... | 0.012766 |
def get_distributions(self):
"""
Returns a dictionary of name and its distribution. Distribution is a ndarray.
The ndarray is stored in the standard way such that the rightmost variable changes most often.
Consider a CPD of variable 'd' which has parents 'b' and 'c' (distribution['CONDS... | 0.004068 |
def storage(self):
""" get the counter storage
"""
annotation = get_portal_annotation()
if annotation.get(NUMBER_STORAGE) is None:
annotation[NUMBER_STORAGE] = OIBTree()
return annotation[NUMBER_STORAGE] | 0.011719 |
def _order_linkage_group(group):
""" For a given group (ie: a list containing [marker, position])
order the list according to their position.
"""
tmp = {}
for row in group:
if float(row[1]) in tmp: # pragma: no cover
tmp[float(row[1])].append(row[0])
else:
tm... | 0.001742 |
async def unplonk(self, ctx, *, member: discord.Member):
"""Unbans a user from using the bot.
To use this command you must have the Manage Server permission
or have a Bot Admin role.
"""
plonks = self.config.get('plonks', {})
guild_id = ctx.message.server.id
db ... | 0.005277 |
def find_element(self, value, by=By.ID, update=False) -> Elements:
'''Find a element or the first element.'''
if update or not self._nodes:
self.uidump()
for node in self._nodes:
if node.attrib[by] == value:
bounds = node.attrib['bounds']
c... | 0.004695 |
def run_command(self, config_file, sources):
"""
:param str config_file: The name of config file.
:param list sources: The list with source files.
"""
config = configparser.ConfigParser()
config.read(config_file)
rdbms = config.get('database', 'rdbms').lower()
... | 0.004515 |
def accept(self):
"""Method invoked when OK button is clicked."""
try:
self.save_metadata()
except InvalidValidationException as e:
display_warning_message_box(
self, tr('Invalid Field Mapping'), str(e))
return
super(FieldMappingDialog,... | 0.00597 |
def create_default_element(self, name):
"""
Creates a <@name/> tag under root if there is none.
"""
found = self.root.find(name)
if found is not None:
return found
ele = ET.Element(name)
self.root.append(ele)
return ele | 0.006757 |
def createProgBuilder(env):
"""This is a utility function that creates the Program
Builder in an Environment if it is not there already.
If it is already there, we return the existing one.
"""
try:
program = env['BUILDERS']['Program']
except KeyError:
import SCons.Defaults
... | 0.017564 |
def _validate_fold_has_outputs_or_count_filter(fold_scope_location, fold_has_count_filter, outputs):
"""Ensure the @fold scope has at least one output, or filters on the size of the fold."""
# This function makes sure that the @fold scope has an effect.
# Folds either output data, or filter the data enclosi... | 0.008741 |
def _assign_method(self, resource_class, method_type):
"""
Using reflection, assigns a new method to this class.
Args:
resource_class: A resource class
method_type: The HTTP method type
"""
"""
If we assigned the same method to each method, it's ... | 0.00068 |
def subscribe_user_to_discussion(recID, uid):
"""
Subscribe a user to a discussion, so the she receives by emails
all new new comments for this record.
:param recID: record ID corresponding to the discussion we want to
subscribe the user
:param uid: user id
"""
query = """... | 0.005119 |
def in6_getLinkScopedMcastAddr(addr, grpid=None, scope=2):
"""
Generate a Link-Scoped Multicast Address as described in RFC 4489.
Returned value is in printable notation.
'addr' parameter specifies the link-local address to use for generating
Link-scoped multicast address IID.
By default, the ... | 0.000446 |
def thickness_hydrostatic(pressure, temperature, **kwargs):
r"""Calculate the thickness of a layer via the hypsometric equation.
This thickness calculation uses the pressure and temperature profiles (and optionally
mixing ratio) via the hypsometric equation with virtual temperature adjustment
.. math:... | 0.005176 |
def bool_input(message):
'''
Ask a user for a boolean input
args:
message (str): Prompt for user
returns:
bool_in (boolean): Input boolean
'''
while True:
suffix = ' (true or false): '
inp = input(message + suffix)
if inp.lower() == 'true':
... | 0.002062 |
def to_element(self, include_namespaces=False):
"""Return an ElementTree Element representing this instance.
Args:
include_namespaces (bool, optional): If True, include xml
namespace attributes on the root element
Return:
~xml.etree.ElementTree.Element: ... | 0.002491 |
def get_command(self, ctx, name):
"""Fetch command from folder."""
plugin = os.path.basename(self.folder)
try:
command = importlib.import_module("honeycomb.commands.{}.{}".format(plugin, name))
except ImportError:
raise click.UsageError("No such command {} {}\n\n{... | 0.00995 |
def compile_file(self, path, incl_search_paths=None):
"""
Parse & compile a single file and append it to RDLCompiler's root
namespace.
If any exceptions (:class:`~systemrdl.RDLCompileError` or other)
occur during compilation, then the RDLCompiler object should be discarded.
... | 0.002342 |
def TK_ask(title,msg):
"""use the GUI to ask YES or NO."""
root = tkinter.Tk()
root.attributes("-topmost", True) #always on top
root.withdraw() #hide tk window
result=tkinter.messagebox.askyesno(title,msg)
root.destroy()
return result | 0.030534 |
def _create_list_of_array_controllers(self):
"""Creates the list of Array Controller URIs.
:raises: IloCommandNotSupportedError if the ArrayControllers
doesnt have member "Member".
:returns list of ArrayControllers.
"""
headers, array_uri, array_settings = (
... | 0.002635 |
def sinc_window(num_zeros=64, precision=9, window=None, rolloff=0.945):
'''Construct a windowed sinc interpolation filter
Parameters
----------
num_zeros : int > 0
The number of zero-crossings to retain in the sinc filter
precision : int > 0
The number of filter coefficients to ret... | 0.0015 |
def _GenerateNotices(self):
"""Generate a summary of any notices.
Returns:
The generated HTML as a string.
"""
items = []
for e in self._notices:
d = e.GetDictToFormat()
if 'url' in d.keys():
d['url'] = '<a href="%(url)s">%(url)s</a>' % d
items.append('<li class="not... | 0.011928 |
def _set_igp_sync(self, v, load=False):
"""
Setter method for igp_sync, mapped from YANG variable /mpls_state/rsvp/igp_sync (container)
If this variable is read-only (config: false) in the
source YANG file, then _set_igp_sync is considered as a private
method. Backends looking to populate this varia... | 0.005682 |
def _set_main_widget(self, widget, redraw):
"""
add provided widget to widget list and display it
:param widget:
:return:
"""
self.set_body(widget)
self.reload_footer()
if redraw:
logger.debug("redraw main widget")
self.refresh() | 0.006289 |
def ensure_path_exists(self):
# type: (LocalDestinationPath) -> None
"""Ensure path exists
:param LocalDestinationPath self: this
"""
if self._is_dir is None:
raise RuntimeError('is_dir not set')
if self._is_dir:
self._path.mkdir(mode=0o750, parent... | 0.003984 |
def merge_all_config_sections_into_a_single_dict(desired_type: Type[T], config: ConfigParser, logger: Logger,
conversion_finder: ConversionFinder, **kwargs) -> Dict[str, Any]:
"""
Helper method to convert a 'configparser' into a dictionary [property > value].
... | 0.007794 |
def dumps(o, preserve=False):
"""Stringifies input dict as toml
Args:
o: Object to dump into toml
preserve: Boolean parameter. If true, preserve inline tables.
Returns:
String containing the toml corresponding to dict
"""
retval = ""
addtoretval, sections = _dump_sect... | 0.000978 |
def default_backends(cls):
"""Retrieve the default configuration.
This will look in the repository configuration (if for_path is
specified), the users' home directory and the system
configuration.
"""
paths = []
paths.append(os.path.expanduser("~/.gitconfig"))
... | 0.002903 |
def _lm_solve(r, pmut, ddiag, bqt, delta, par0, enorm, finfo):
"""Compute the Levenberg-Marquardt parameter and solution vector.
Parameters:
r - IN/OUT n-by-m matrix, m >= n. On input, the full lower triangle is
the full lower triangle of R and the strict upper triangle is
ignored. On output,... | 0.003619 |
def cached_method(func):
""" Memoize for class methods """
@functools.wraps(func)
def wrapper(self, *args):
if not hasattr(self, "_cache"):
self._cache = {}
key = _argstring((func.__name__,) + args)
if key not in self._cache:
self._cache[key] = func(self, *arg... | 0.002681 |
def write_fix(self, time=None, latitude=None, longitude=None, valid=False,
pressure_alt=None, gps_alt=None, extensions=None):
"""
Write a fix record::
writer.write_fix(
datetime.time(12, 34, 56),
latitude=51.40375,
longitude=... | 0.001328 |
def __find_hidden_analyses(self, docs):
""" Jätab meelde, millised analüüsid on nn peidetud ehk siis mida ei
tule arvestada lemmade järelühestamisel:
*) kesksõnade nud, dud, tud mitmesused;
*) muutumatute sõnade sõnaliigi mitmesus;
*) oleviku 'olema' mitmesus... | 0.011508 |
def add_constraints(self):
"""
Set the base constraints on the relation query.
:rtype: None
"""
if self._constraints:
foreign_key = getattr(self._parent, self._foreign_key, None)
if foreign_key is None:
self._query = None
else:... | 0.003992 |
def generate_password(length=32):
"""Generate a cryptographically secure random string to use for passwords
Args:
length (int): Length of password, defaults to 32 characters
Returns:
Randomly generated string
"""
return ''.join(random.SystemRandom().choice(string.ascii_letters + '!... | 0.005682 |
def get_version(version=None):
"""Derives a PEP386-compliant version number from VERSION."""
if version is None:
version = VERSION
assert len(version) == 5
assert version[3] in ('alpha', 'beta', 'rc', 'final')
# Now build the two parts of the version number:
# main = X.Y[.Z]
# sub =... | 0.001028 |
def schema_factory(schema_name, **schema_nodes):
"""Schema Validation class factory.
Args:
schema_name(str): The namespace of the schema.
schema_nodes(dict): The attr_names / SchemaNodes mapping of schema.
Returns:
A Schema class.
Raises:
SchemaError, for bad attribute... | 0.002314 |
def ls_dir(path, include_hidden=False):
"""Finds content of folder
:param path: directory to get list of files and folders
:param include_hidden: True iff include hidden files in list
:return: List of paths in given directory
"""
lst = []
for file in os.listdir(path):
hidden_file = ... | 0.002045 |
def copy(self, newdata=None):
'''Return a copy of the cube with optionally new data.'''
if newdata is None:
newdata = self.data.copy()
return self.__class__(
self.molecule, self.origin.copy(), self.axes.copy(),
self.nrep.copy(), newdata, self.subtitle, self.nu... | 0.005831 |
def gather_data(options):
"""Get Data specific for command selected.
Create ec2 specific query and output title based on
options specified, retrieves the raw response data
from aws, then processes it into the i_info dict,
which is used throughout this module.
Args:
options (object): co... | 0.001256 |
def timestamp(value, fmt=None):
"""Parse a datetime to a unix timestamp.
Uses fast custom parsing for common datetime formats or the slow dateutil
parser for other formats. This is a trade off between ease of use and speed
and is very useful for fast parsing of timestamp strings whose format may
st... | 0.003578 |
def visit_Name(self, node, store_as_param=False, **kwargs):
"""All assignments to names go through this function."""
if store_as_param or node.ctx == 'param':
self.symbols.declare_parameter(node.name)
elif node.ctx == 'store':
self.symbols.store(node.name)
elif no... | 0.005291 |
def libvlc_media_set_user_data(p_md, p_new_user_data):
'''Sets media descriptor's user_data. user_data is specialized data
accessed by the host application, VLC.framework uses it as a pointer to
an native object that references a L{Media} pointer.
@param p_md: media descriptor object.
@param p_new_u... | 0.003448 |
def _extract_vararray_max(tform):
"""
Extract number from PX(number)
"""
first = tform.find('(')
last = tform.rfind(')')
if first == -1 or last == -1:
# no max length specified
return -1
maxnum = int(tform[first+1:last])
return maxnum | 0.003521 |
def handle(self, *args, **options):
"""
:param args:
:param options:
:return:
"""
counter = 0
for key in options:
if options[key]:
counter += 1
# If no options are set, do a normal patch
if counter == 1:
opt... | 0.003145 |
def robust_topological_sort(graph: Graph) -> list:
"""Identify strongly connected components then perform a topological sort of those components."""
assert check_argument_types()
components = strongly_connected_components(graph)
node_component = {}
for component in components:
for node in component:
nod... | 0.046512 |
def reset_syslog_config(host,
username,
password,
protocol=None,
port=None,
syslog_config=None,
esxi_hosts=None,
credstore=None):
'''
Reset the ... | 0.00345 |
def add_standard_firewall(self, server_id, is_virt=True):
"""Creates a firewall for the specified virtual/hardware server.
:param int server_id: The ID of the server to create the firewall for
:param bool is_virt: If true, will create the firewall for a virtual
serv... | 0.001483 |
def get_field(self, path, name):
"""
Retrieves the value of the field at the specified path.
:param path: str or Path instance
:param name:
:type name: str
:return:
:raises ValueError: A component of path is a field name.
:raises KeyError: A component of ... | 0.00318 |
def send_message(self, stream, msg):
"""Send an arbitrary message to a particular client.
Parameters
----------
stream : :class:`tornado.iostream.IOStream` object
The stream to send the message to.
msg : Message object
The message to send.
Notes
... | 0.001591 |
def _list_files_in_path(path, pattern="*.stan"):
"""
indexes a directory of stan files
returns as dictionary containing contents of files
"""
results = []
for dirname, subdirs, files in os.walk(path):
for name in files:
if fnmatch(name, pattern):
results.appe... | 0.002695 |
def GetRootFileEntry(self):
"""Retrieves the root file entry.
Returns:
OSFileEntry: a file entry or None if not available.
"""
if platform.system() == 'Windows':
# Return the root with the drive letter of the volume the current
# working directory is on.
location = os.getcwd()
... | 0.01318 |
async def get_upstream_dns(cls) -> list:
"""Upstream DNS server addresses.
Upstream DNS servers used to resolve domains not managed by this MAAS
(space-separated IP addresses). Only used when MAAS is running its own
DNS server. This value is used as the value of 'forwarders' in the DNS
... | 0.004246 |
def get_password(self, service, username):
"""Read the password from the file.
"""
service = escape_for_ini(service)
username = escape_for_ini(username)
# fetch the password
try:
password_base64 = self.config.get(service, username).encode()
# deco... | 0.00313 |
def createExpenseItemsForEvents(request=None, datetimeTuple=None, rule=None, event=None):
'''
For each StaffMember-related Repeated Expense Rule, look for EventStaffMember
instances in the designated time window that do not already have expenses associated
with them. For hourly rental expenses, the... | 0.003529 |
def _choose_random_edge(self, edges: Set[EDGE]) -> Optional[EDGE]:
"""Picks random edge from the set of edges.
Args:
edges: Set of edges to pick from.
Returns:
Random edge from the supplied set, or None for empty set.
"""
if edges:
index = self._... | 0.004184 |
def read_bytes(self, where, size, force=False):
"""
Read from memory.
:param int where: address to read data from
:param int size: number of bytes
:param force: whether to ignore memory permissions
:return: data
:rtype: list[int or Expression]
"""
... | 0.004338 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.