code stringlengths 51 2.34k | docstring stringlengths 11 171 |
|---|---|
def _parse_hostvar_file(self, hostname, path):
first_line = open(path, 'r').readline()
if first_line.startswith('$ANSIBLE_VAULT'):
self.log.warning("Skipping encrypted vault file {0}".format(path))
return
try:
self.log.debug("Reading host vars from {}".format(... | Parse a host var file and apply it to host `hostname`. |
def enumerate_layer_fields(self, layer):
descriptor = self.get_descriptor_for_layer(layer)
return [field['name'] for field in descriptor['fields']] | Pulls out all of the field names for a layer. |
def push_build_status(id):
response = utils.checked_api_call(pnc_api.build_push, 'status', build_record_id=id)
if response:
return utils.format_json(response) | Get status of Brew push. |
def current_changed(self, index):
editor = self.get_current_editor()
if editor.lsp_ready and not editor.document_opened:
editor.document_did_open()
if index != -1:
editor.setFocus()
logger.debug("Set focus to: %s" % editor.filename)
else:
... | Stack index has changed |
def _write(self, session, openFile, replaceParamFile):
openFile.write('Num_Sites: %s\n' % self.numSites)
openFile.write('Elev_Base %s\n' % self.elevBase)
openFile.write('Elev_2 %s\n' % self.elev2)
openFile.write('Year Month Day Hour Temp_2\n')
measuremen... | Orographic Gage File Write to File Method |
def _print(self, msg, color=None, arrow=False, indent=None):
if color:
msg = colored(msg, color)
if arrow:
msg = colored('===> ', 'blue') + msg
if indent:
msg = (' ' * indent) + msg
print(msg)
return msg | Print the msg with the color provided. |
def on_switch_page(self, notebook, page_pointer, page_num, user_param1=None):
page = notebook.get_nth_page(page_num)
for tab_info in list(self.tabs.values()):
if tab_info['page'] is page:
state_m = tab_info['state_m']
sm_id = state_m.state.get_state_machine().... | Update state selection when the active tab was changed |
def _finalize_axis(self, key):
if 'title' in self.handles:
self.handles['title'].set_visible(self.show_title)
self.drawn = True
if self.subplot:
return self.handles['axis']
else:
fig = self.handles['fig']
if not getattr(self, 'overlaid', Fa... | General method to finalize the axis and plot. |
def format_variable_map(variable_map, join_lines=True):
rows = []
rows.append(("Key", "Variable", "Shape", "Type", "Collections", "Device"))
var_to_collections = _get_vars_to_collections(variable_map)
sort_key = lambda item: (item[0], item[1].name)
for key, var in sorted(variable_map_items(variable_map), key=... | Takes a key-to-variable map and formats it as a table. |
def recon_all(subj_id,anatomies):
if not environ_setup:
setup_freesurfer()
if isinstance(anatomies,basestring):
anatomies = [anatomies]
nl.run([os.path.join(freesurfer_home,'bin','recon-all'),'-all','-subjid',subj_id] + [['-i',anat] for anat in anatomies]) | Run the ``recon_all`` script |
def str_or_unicode(text):
encoding = sys.stdout.encoding
if sys.version_info > (3, 0):
return text.encode(encoding).decode(encoding)
return text.encode(encoding) | handle python 3 unicode and python 2.7 byte strings |
def log(x, context=None):
return _apply_function_in_current_context(
BigFloat,
mpfr.mpfr_log,
(BigFloat._implicit_convert(x),),
context,
) | Return the natural logarithm of x. |
def requirement(self) -> FetchRequirement:
key_name = self.key
if key_name == b'ALL':
return FetchRequirement.NONE
elif key_name == b'KEYSET':
keyset_reqs = {key.requirement for key in self.filter_key_set}
return FetchRequirement.reduce(keyset_reqs)
el... | Indicates the data required to fulfill this search key. |
def _get_current_deployment_id(self):
deploymentId = ''
stage = __salt__['boto_apigateway.describe_api_stage'](restApiId=self.restApiId,
stageName=self._stage_name,
**self._commo... | Helper method to find the deployment id that the stage name is currently assocaited with. |
def now_micros(absolute=False) -> int:
micros = int(time.time() * 1e6)
if absolute:
return micros
return micros - EPOCH_MICROS | Return current micros since epoch as integer. |
def frange(start, end, step):
if start <= end:
step = abs(step)
else:
step = -abs(step)
while start < end:
yield start
start += step | A range implementation which can handle floats |
def _file_model_from_path(self, path, content=False, format=None):
model = base_model(path)
model["type"] = "file"
if self.fs.isfile(path):
model["last_modified"] = model["created"] = self.fs.lstat(path)["ST_MTIME"]
else:
model["last_modified"] = model["created"] ... | Build a file model from database record. |
def parse_values(self, query):
values = {}
for name, filt in self.filters.items():
val = filt.parse_value(query)
if val is None:
continue
values[name] = val
return values | extract values from query |
def clean_text(text):
new_text = re.sub(ur'\p{P}+', ' ', text)
new_text = [stem(i) for i in new_text.lower().split() if not
re.findall(r'[0-9]', i)]
new_text = ' '.join(new_text)
return new_text | Clean text for TFIDF. |
def ClassName(self, name, separator='_'):
if name is None:
return name
if name.startswith(('protorpc.', 'message_types.',
'apitools.base.protorpclite.',
'apitools.base.protorpclite.message_types.')):
return name
name... | Generate a valid class name from name. |
def unregisterAPI(self, name):
if name.startswith('public/'):
target = 'public'
name = name[len('public/'):]
else:
target = self.servicename
name = name
removes = [m for m in self.handler.handlers.keys() if m.target == target and m.name == name]
... | Remove an API from this handler |
def local_project(v, V, u=None):
dv = TrialFunction(V)
v_ = TestFunction(V)
a_proj = inner(dv, v_)*dx
b_proj = inner(v, v_)*dx
solver = LocalSolver(a_proj, b_proj)
solver.factorize()
if u is None:
u = Function(V)
solver.solve_local_rhs(u)
return u
else:
so... | Element-wise projection using LocalSolver |
def multi_split(txt, delims):
res = [txt]
for delimChar in delims:
txt, res = res, []
for word in txt:
if len(word) > 1:
res += word.split(delimChar)
return res | split by multiple delimiters |
def replace_header(self, header_text):
with open(self.outfile, 'rt') as fp:
_, body = self.split_header(fp)
with open(self.outfile, 'wt') as fp:
fp.write(header_text)
fp.writelines(body) | Replace pip-compile header with custom text |
def load_yaml(file):
if hasattr(yaml, "full_load"):
return yaml.full_load(file)
else:
return yaml.load(file) | If pyyaml > 5.1 use full_load to avoid warning |
def endSections(self, level=u'0'):
iSectionsClosed = self.storeSectionState(level)
self.document.append("</section>\n" * iSectionsClosed) | Closes all sections of level >= sectnum. Defaults to closing all open sections |
def run(self):
self._log.info('Starting Pulsar Search Interface')
authorizer = DummyAuthorizer()
authorizer.add_user(self._config['login']['user'],
self._config['login']['psswd'], '.',
perm=self._config['login']['perm'])
authorizer.... | Start the FTP Server for pulsar search. |
def dfromdm(dm):
if np.size(dm)>1:
dm = np.atleast_1d(dm)
return 10**(1+dm/5) | Returns distance given distance modulus. |
def list_users(self, instance, limit=None, marker=None):
return instance.list_users(limit=limit, marker=marker) | Returns all users for the specified instance. |
def load_eidos_curation_table():
url = 'https://raw.githubusercontent.com/clulab/eidos/master/' + \
'src/main/resources/org/clulab/wm/eidos/english/confidence/' + \
'rule_summary.tsv'
res = StringIO(requests.get(url).text)
table = pandas.read_table(res, sep='\t')
table = table.drop(table... | Return a pandas table of Eidos curation data. |
def DictKeyColumns(d):
'Return a list of Column objects from dictionary keys.'
return [ColumnItem(k, k, type=deduceType(d[k])) for k in d.keys()] | Return a list of Column objects from dictionary keys. |
def validate(schema):
try:
tableschema.validate(schema)
click.echo("Schema is valid")
sys.exit(0)
except tableschema.exceptions.ValidationError as exception:
click.echo("Schema is not valid")
click.echo(exception.errors)
sys.exit(1) | Validate that a supposed schema is in fact a Table Schema. |
def send_preview(self):
response = self.session.request("method:queuePreview", [ self.data ])
self.data = response
return self | Send a preview of this draft. |
def getLiftOps(self, valu, cmpr='='):
if valu is None:
iops = (('pref', b''),)
return (
('indx', ('byprop', self.pref, iops)),
)
if cmpr == '~=':
return (
('form:re', (self.name, valu, {})),
)
lops = self... | Get a set of lift operations for use with an Xact. |
def print_param_defaults(self_):
cls = self_.cls
for key,val in cls.__dict__.items():
if isinstance(val,Parameter):
print(cls.__name__+'.'+key+ '='+ repr(val.default)) | Print the default values of all cls's Parameters. |
def _is_impossible_by_count(self, state):
counts = {tile_type: 0 for tile_type in base.Tile._all_types}
standard_wildcard_type = '2'
for p, tile in state.board.positions_with_tile():
tile_type = tile._type
try:
int(tile_type)
counts[standar... | Disallow any board that has insufficient tile count to solve. |
def fromDict(cls, _dict):
obj = cls()
obj.__dict__.update(_dict)
return obj | Builds instance from dictionary of properties. |
def _sample_slices_in_dim(self, view, num_slices, non_empty_slices):
if self._sampling_method == 'linear':
return self._linear_selection(non_empty_slices=non_empty_slices, num_slices=num_slices)
elif self._sampling_method == 'percentage':
return self._percent_selection(non_empty_... | Samples the slices in the given dimension according the chosen strategy. |
def _get_entity_prop(self, entity, prop):
variant = self.params.get('variant')
lang = self.params.get('lang')
if entity.get(prop):
ent = entity[prop]
try:
return ent[variant or lang].get('value')
except AttributeError:
return en... | returns Wikidata entity property value |
def pop(self):
if len(self.stack):
os.chdir(self.stack.pop()) | Pop dir off stack and change to it. |
def drop_prior_information(self):
if self.jco is None:
self.logger.statement("can't drop prior info, LinearAnalysis.jco is None")
return
nprior_str = str(self.pst.nprior)
self.log("removing " + nprior_str + " prior info from jco, pst, and " +
... | drop the prior information from the jco and pst attributes |
def request_args(self):
args = flask.request.args
data_raw = {}
for field_name, field in self.args_schema.fields.items():
alternate_field_name = field.load_from if MA2 else field.data_key
if alternate_field_name and alternate_field_name in args:
field_name... | Use args_schema to parse request query arguments. |
def set(self, safe_len=False, **kwds):
if kwds:
d = self.kwds()
d.update(kwds)
self.reset(**d)
if safe_len and self.item:
self.leng = _len | Set one or more attributes. |
def requested_perm(self, perm, obj, check_groups=True):
return self.has_perm(perm, obj, check_groups, False) | Check if user requested a permission for the given object |
def _imm_new(cls):
imm = object.__new__(cls)
params = cls._pimms_immutable_data_['params']
for (p,dat) in six.iteritems(params):
dat = dat[0]
if dat: object.__setattr__(imm, p, dat[0])
_imm_clear(imm)
dd = object.__getattribute__(imm, '__dict__')
dd['_pimms_immutable_is_init'] = ... | All immutable new classes use a hack to make sure the post-init cleanup occurs. |
def dist(self, other):
dx = self.x - other.x
dy = self.y - other.y
return math.sqrt(dx**2 + dy**2) | Distance to some other point. |
def render_widgets(kb_app: kb,
sphinx_app: Sphinx,
doctree: doctree,
fromdocname: str,
):
builder: StandaloneHTMLBuilder = sphinx_app.builder
for node in doctree.traverse(widget):
w = sphinx_app.env.widgets.get(node.name)
... | Go through docs and replace widget directive with rendering |
def filter_queryset(self, attrs, queryset):
if self.instance is not None:
for field_name in self.fields:
if field_name not in attrs:
attrs[field_name] = getattr(self.instance, field_name)
filter_kwargs = {
field_name: attrs[field_name]
... | Filter the queryset to all instances matching the given attributes. |
def _check_shape(shape):
if isinstance(shape, tuple):
for dim in shape:
if (isinstance(dim, tuple) and len(dim) == 2 and
isinstance(dim[0], int) and isinstance(dim[1], int)):
if dim[0] < 0:
raise ValueError("expected low dimension to be >= ... | Verify that a shape has the right format. |
def question_mark(self, request, obj):
obj.question = obj.question + '?'
obj.save() | Add a question mark. |
def check():
dist_path = Path(DIST_PATH)
if not dist_path.exists() or not list(dist_path.glob('*')):
print("No distribution files found. Please run 'build' command first")
return
subprocess.check_call(['twine', 'check', 'dist/*']) | Checks the long description. |
def memorized_ttinfo(*args):
try:
return _ttinfo_cache[args]
except KeyError:
ttinfo = (
memorized_timedelta(args[0]),
memorized_timedelta(args[1]),
args[2]
)
_ttinfo_cache[args] = ttinfo
return ttinfo | Create only one instance of each distinct tuple |
def _create_attachment(self, filename, content, mimetype=None):
if mimetype is None:
mimetype, _ = mimetypes.guess_type(filename)
if mimetype is None:
mimetype = DEFAULT_ATTACHMENT_MIME_TYPE
basetype, subtype = mimetype.split("/", 1)
if basetype == "... | Convert the filename, content, mimetype triple to attachment. |
def _has(self, key, exact=0):
if not exact:
try:
key = self.getfullkey(key)
return 1
except KeyError:
return 0
else:
return key in self.data | Returns false if key is not found or is ambiguous |
def formatSI(n) -> str:
s = ''
if n < 0:
n = -n
s += '-'
if type(n) is int and n < 1000:
s = str(n) + ' '
elif n < 1e-22:
s = '0.00 '
else:
assert n < 9.99e26
log = int(math.floor(math.log10(n)))
i, j = divmod(log, 3)
for _try in range(... | Format the integer or float n to 3 significant digits + SI prefix. |
def replace_rep_after(text: str) -> str:
"Replace repetitions at the character level in `text` after the repetition"
def _replace_rep(m):
c, cc = m.groups()
return f"{c}{TK_REP}{len(cc)+1}"
re_rep = re.compile(r"(\S)(\1{2,})")
return re_rep.sub(_replace_rep, text) | Replace repetitions at the character level in `text` after the repetition |
def install_brew(target_path):
if not os.path.exists(target_path):
try:
os.makedirs(target_path)
except OSError:
logger.warn("Unable to create directory %s for brew." % target_path)
logger.warn("Skipping...")
return
extract_targz(HOMEBREW_URL, targ... | Install brew to the target path |
def flatten(nested_list):
return_list = []
for i in nested_list:
if isinstance(i,list):
return_list += flatten(i)
else:
return_list.append(i)
return return_list | converts a list-of-lists to a single flat list |
def fromkeys(cls, iterable, value, **kwargs):
return cls(((k, value) for k in iterable), **kwargs) | Return a new pqict mapping keys from an iterable to the same value. |
def delete_metadata(address=None, tx_hash=None, block_hash=None, api_key=None, coin_symbol='btc'):
assert is_valid_coin_symbol(coin_symbol), coin_symbol
assert api_key, 'api_key required'
kwarg = get_valid_metadata_identifier(
coin_symbol=coin_symbol,
address=address,
tx_hash=tx_hash... | Only available for metadata that was embedded privately. |
def body(self):
res = self._body[self.bcount]()
self.bcount += 1
return res | Returns the axis instance where the light curves will be shown |
def dist_is_editable(dist):
for path_item in sys.path:
egg_link = os.path.join(path_item, dist.project_name + '.egg-link')
if os.path.isfile(egg_link):
return True
return False | Return True if given Distribution is an editable install. |
def movetree(src, dst):
try:
shutil.move(src, dst)
except:
copytree(src, dst, symlinks=True, hardlinks=True)
shutil.rmtree(src) | Attempts a move, and falls back to a copy+delete if this fails |
def workaround_lowering_pass(ir_blocks, query_metadata_table):
new_ir_blocks = []
for block in ir_blocks:
if isinstance(block, Filter):
new_block = _process_filter_block(query_metadata_table, block)
else:
new_block = block
new_ir_blocks.append(new_block)
retur... | Extract locations from TernaryConditionals and rewrite their Filter blocks as necessary. |
def attrs(self, dynamizer):
ret = {
self.key: {
'Action': self.action,
}
}
if not is_null(self.value):
ret[self.key]['Value'] = dynamizer.encode(self.value)
return ret | Get the attributes for the update |
def should_copy(column):
if not isinstance(column.type, Serial):
return True
if column.nullable:
return True
if not column.server_default:
return True
return False | Determine if a column should be copied. |
def preview(directory=None, host=None, port=None, watch=True):
directory = directory or '.'
host = host or '127.0.0.1'
port = port or 5000
out_directory = build(directory)
os.chdir(out_directory)
Handler = SimpleHTTPServer.SimpleHTTPRequestHandler
httpd = SocketServer.TCPServer((host, port),... | Runs a local server to preview the working directory of a repository. |
def write_main_socket(c):
the_stdin_thread.socket_write.send(c)
while True:
try:
the_stdin_thread.socket_write.recv(1)
except socket.error as e:
if e.errno != errno.EINTR:
raise
else:
break | Synchronous write to the main socket, wait for ACK |
def _process_cidr_file(self, file):
data = {'cidr': list(), 'countries': set(), 'city_country_mapping': dict()}
allowed_countries = settings.IPGEOBASE_ALLOWED_COUNTRIES
for cidr_info in self._line_to_dict(file, field_names=settings.IPGEOBASE_CIDR_FIELDS):
city_id = cidr_info['city_id... | Iterate over ip info and extract useful data |
def update_backward_window(turn_from, tick_from, turn_to, tick_to, updfun, branchd):
if turn_from in branchd:
for future_state in reversed(branchd[turn_from][:tick_from]):
updfun(*future_state)
for midturn in range(turn_from-1, turn_to, -1):
if midturn in branchd:
for fut... | Iterate backward over a window of time in ``branchd`` and call ``updfun`` on the values |
def report(self, request: 'Request'=None, state: Text=None):
self._make_context(request, state)
self.client.captureException()
self._clear_context() | Report current exception to Sentry. |
async def get_sleep_timer_settings(self) -> List[Setting]:
return [
Setting.make(**x)
for x in await self.services["system"]["getSleepTimerSettings"]({})
] | Get sleep timer settings. |
def convert2geojson(jsonfile, src_srs, dst_srs, src_file):
if os.path.exists(jsonfile):
os.remove(jsonfile)
if sysstr == 'Windows':
exepath = '"%s/Lib/site-packages/osgeo/ogr2ogr"' % sys.exec_prefix
else:
exepath = FileClass.get_executable_fullpath('ogr2ogr')
... | convert shapefile to geojson file |
def sendStatusPing(self):
data = parse.urlencode({"key": self.key, "version": self.version}).encode()
req = request.Request("https://redunda.sobotics.org/status.json", data)
response = request.urlopen(req)
jsonReturned = json.loads(response.read().decode("utf-8"))
self.location =... | Sends a status ping to Redunda with the instance key specified while constructing the object. |
def _text_file(self, url):
try:
with open(url, 'r', encoding='utf-8') as file:
return file.read()
except FileNotFoundError:
print('File `{}` not found'.format(url))
sys.exit(0) | return the content of a file |
def reset(self):
self.command_stack = []
self.scripts = set()
self.watches = []
self.watching = False
self.explicit_transaction = False | Reset back to empty pipeline. |
def crawl_fig(self, fig):
with self.renderer.draw_figure(fig=fig,
props=utils.get_figure_properties(fig)):
for ax in fig.axes:
self.crawl_ax(ax) | Crawl the figure and process all axes |
def select_by_field(self, base, field, value):
Ac = self.ACCES
return groups.Collection(Ac(base, i) for i, row in self.items() if row[field] == value) | Return collection of acces whose field equal value |
def _get_data_segments(channels, start, end, connection):
allsegs = io_nds2.get_availability(channels, start, end,
connection=connection)
return allsegs.intersection(allsegs.keys()) | Get available data segments for the given channels |
def children(self):
from warnings import warn
warn("Deprecated. Use Scraper.descendants.", DeprecationWarning)
for descendant in self.descendants:
yield descendant | Former, misleading name for descendants. |
def getReqId(self) -> int:
if not self.isReady():
raise ConnectionError('Not connected')
newId = self._reqIdSeq
self._reqIdSeq += 1
return newId | Get new request ID. |
def parse_to_tree(text):
xml_text = cabocha.as_xml(text)
tree = Tree(xml_text)
return tree | Parse text using CaboCha, then return Tree instance. |
def check_that_operator_can_be_applied_to_produces_items(op, g1, g2):
g1_tmp_copy = g1.spawn()
g2_tmp_copy = g2.spawn()
sample_item_1 = next(g1_tmp_copy)
sample_item_2 = next(g2_tmp_copy)
try:
op(sample_item_1, sample_item_2)
except TypeError:
raise TypeError(f"Operator '{op.__na... | Helper function to check that the operator `op` can be applied to items produced by g1 and g2. |
def filter(self, qs, value):
_id = None
if value is not None:
_, _id = from_global_id(value)
return super(GlobalIDFilter, self).filter(qs, _id) | Convert the filter value to a primary key before filtering |
def clean_name(self):
"Avoid name clashes between static and dynamic attributes."
name = self.cleaned_data['name']
reserved_names = self._meta.model._meta.get_all_field_names()
if name not in reserved_names:
return name
raise ValidationError(_('Attribute name must not... | Avoid name clashes between static and dynamic attributes. |
def speak(self, text):
if not self.is_valid_string(text):
raise Exception("%s is not ISO-8859-1 compatible." % (text))
if len(text) > 1023:
lines = self.word_wrap(text, width=1023)
for line in lines:
self.queue.put("S%s" % (line))
else:
... | The main function to convert text into speech. |
def update_metric(self, metric, labels, pre_sliced=False):
for current_exec, (texec, islice) in enumerate(zip(self.train_execs, self.slices)):
if not pre_sliced:
labels_slice = [label[islice] for label in labels]
else:
labels_slice = labels[current_exec]
... | Update evaluation metric with label and current outputs. |
def _init_usrgos(self, goids):
usrgos = set()
goids_missing = set()
_go2obj = self.gosubdag.go2obj
for goid in goids:
if goid in _go2obj:
usrgos.add(goid)
else:
goids_missing.add(goid)
if goids_missing:
print("MI... | Return user GO IDs which have GO Terms. |
def real_pathspec(self):
pathspec = self.Get(self.Schema.PATHSPEC)
stripped_components = []
parent = self
while not pathspec and len(parent.urn.Split()) > 1:
stripped_components.append(parent.urn.Basename())
pathspec = parent.Get(parent.Schema.PATHSPEC)
parent = FACTORY.Open(parent.urn... | Returns a pathspec for an aff4 object even if there is none stored. |
def on_comment_entered(self):
text_edit = self.findChild(QtWidgets.QWidget, "CommentBox")
comment = text_edit.text()
context = self.controller.context
context.data["comment"] = comment
placeholder = self.findChild(QtWidgets.QLabel, "CommentPlaceholder")
placeholder.setVis... | The user has typed a comment |
def _get_private_room(self, invitees: List[User]):
return self._client.create_room(
None,
invitees=[user.user_id for user in invitees],
is_public=False,
) | Create an anonymous, private room and invite peers |
def hash_text(text):
md5 = hashlib.md5()
md5.update(text)
return md5.hexdigest() | Return MD5 hash of a string. |
def _gwf_channel_segments(path, channel, warn=True):
stream = open_gwf(path)
toc = stream.GetTOC()
secs = toc.GetGTimeS()
nano = toc.GetGTimeN()
dur = toc.GetDt()
readers = [getattr(stream, 'ReadFr{0}Data'.format(type_.title())) for
type_ in ("proc", "sim", "adc")]
for i, (s, ... | Yields the segments containing data for ``channel`` in this GWF path |
def Times(self, val):
return Point(self.x * val, self.y * val, self.z * val) | Returns a new point which is pointwise multiplied by val. |
def usage():
global options
l = len(options['long'])
options['shortlist'] = [s for s in options['short'] if s is not ":"]
print("python -m behave2cucumber [-h] [-d level|--debug=level]")
for i in range(l):
print(" -{0}|--{1:20} {2}".format(options['shortlist'][i], options['long'][i], opti... | Print out a usage message |
def live_streaming(self):
url = STREAM_ENDPOINT
params = STREAMING_BODY
params['from'] = "{0}_web".format(self.user_id)
params['to'] = self.device_id
params['resource'] = "cameras/{0}".format(self.device_id)
params['transId'] = "web!{0}".format(self.xcloud_id)
hea... | Return live streaming generator. |
def read_config():
config = _load_config()
if config.get(CFG_IGNORE_DEFAULT_RULES[1], False):
del IGNORE[:]
if CFG_IGNORE[1] in config:
IGNORE.extend(p for p in config[CFG_IGNORE[1]] if p)
if CFG_IGNORE_BAD_IDEAS[1] in config:
IGNORE_BAD_IDEAS.extend(p for p in config[CFG_IGNORE_... | Read configuration from file if possible. |
def populateImagesFromSurveys(self, surveys=dss2 + twomass):
coordinatetosearch = '{0.ra.deg} {0.dec.deg}'.format(self.center)
paths = astroquery.skyview.SkyView.get_images(
position=coordinatetosearch,
radius=self.radius,
... | Load images from archives. |
def cli(env, identifier):
manager = SoftLayer.SSLManager(env.client)
certificate = manager.get_certificate(identifier)
write_cert(certificate['commonName'] + '.crt', certificate['certificate'])
write_cert(certificate['commonName'] + '.key', certificate['privateKey'])
if 'intermediateCertificate' in ... | Download SSL certificate and key file. |
def generate_query_report(self, db_uri, parsed_query, db_name, collection_name):
index_analysis = None
recommendation = None
namespace = parsed_query['ns']
indexStatus = "unknown"
index_cache_entry = self._ensure_index_cache(db_uri,
... | Generates a comprehensive report on the raw query |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.