nwo
stringlengths
5
106
sha
stringlengths
40
40
path
stringlengths
4
174
language
stringclasses
1 value
identifier
stringlengths
1
140
parameters
stringlengths
0
87.7k
argument_list
stringclasses
1 value
return_statement
stringlengths
0
426k
docstring
stringlengths
0
64.3k
docstring_summary
stringlengths
0
26.3k
docstring_tokens
list
function
stringlengths
18
4.83M
function_tokens
list
url
stringlengths
83
304
deldotdr/txRedis
ec2aa9aca01fe55eaa843e937f9d0f977bfcb881
txredis/protocol.py
python
RedisBase.errorReceived
(self, data)
Error response received.
Error response received.
[ "Error", "response", "received", "." ]
def errorReceived(self, data): """Error response received.""" if data[:4] == 'ERR ': reply = exceptions.ResponseError(data[4:]) elif data[:9] == 'NOSCRIPT ': reply = exceptions.NoScript(data[9:]) elif data[:8] == 'NOTBUSY ': reply = exceptions.NotBusy(...
[ "def", "errorReceived", "(", "self", ",", "data", ")", ":", "if", "data", "[", ":", "4", "]", "==", "'ERR '", ":", "reply", "=", "exceptions", ".", "ResponseError", "(", "data", "[", "4", ":", "]", ")", "elif", "data", "[", ":", "9", "]", "==", ...
https://github.com/deldotdr/txRedis/blob/ec2aa9aca01fe55eaa843e937f9d0f977bfcb881/txredis/protocol.py#L187-L203
nasa-gibs/onearth
accb40171af208934971ae027854cc2535e64968
src/vectorgen/oe_vectorgen.py
python
shp2geojson
(in_filename, out_filename, source_epsg, target_epsg, sigevent_url)
Converts Esri Shapefile into GeoJSON. Arguments: in_filename -- the input Shapefile out_filename -- the output GeoJSON file source_epsg -- the EPSG code of source file target_epsg -- the EPSG code of target file sigevent_url -- the URL for SigEvent
Converts Esri Shapefile into GeoJSON. Arguments: in_filename -- the input Shapefile out_filename -- the output GeoJSON file source_epsg -- the EPSG code of source file target_epsg -- the EPSG code of target file sigevent_url -- the URL for SigEvent
[ "Converts", "Esri", "Shapefile", "into", "GeoJSON", ".", "Arguments", ":", "in_filename", "--", "the", "input", "Shapefile", "out_filename", "--", "the", "output", "GeoJSON", "file", "source_epsg", "--", "the", "EPSG", "code", "of", "source", "file", "target_eps...
def shp2geojson(in_filename, out_filename, source_epsg, target_epsg, sigevent_url): """ Converts Esri Shapefile into GeoJSON. Arguments: in_filename -- the input Shapefile out_filename -- the output GeoJSON file source_epsg -- the EPSG code of source file target_epsg -- the E...
[ "def", "shp2geojson", "(", "in_filename", ",", "out_filename", ",", "source_epsg", ",", "target_epsg", ",", "sigevent_url", ")", ":", "if", "source_epsg", "==", "target_epsg", ":", "ogr2ogr_command_list", "=", "[", "'ogr2ogr'", ",", "'-f'", ",", "'GeoJSON'", ","...
https://github.com/nasa-gibs/onearth/blob/accb40171af208934971ae027854cc2535e64968/src/vectorgen/oe_vectorgen.py#L78-L92
jesse-ai/jesse
28759547138fbc76dff12741204833e39c93b083
jesse/utils.py
python
anchor_timeframe
(timeframe: str)
return dic[timeframe]
Returns the anchor timeframe. Useful for writing dynamic strategies using multiple timeframes. :param timeframe: str :return: str
Returns the anchor timeframe. Useful for writing dynamic strategies using multiple timeframes.
[ "Returns", "the", "anchor", "timeframe", ".", "Useful", "for", "writing", "dynamic", "strategies", "using", "multiple", "timeframes", "." ]
def anchor_timeframe(timeframe: str) -> str: """ Returns the anchor timeframe. Useful for writing dynamic strategies using multiple timeframes. :param timeframe: str :return: str """ dic = { timeframes.MINUTE_1: timeframes.MINUTE_5, timeframes.MINUTE_3: timeframes.MINUTE_15...
[ "def", "anchor_timeframe", "(", "timeframe", ":", "str", ")", "->", "str", ":", "dic", "=", "{", "timeframes", ".", "MINUTE_1", ":", "timeframes", ".", "MINUTE_5", ",", "timeframes", ".", "MINUTE_3", ":", "timeframes", ".", "MINUTE_15", ",", "timeframes", ...
https://github.com/jesse-ai/jesse/blob/28759547138fbc76dff12741204833e39c93b083/jesse/utils.py#L12-L37
oseledets/ttpy
aeffa18654d2ad4ab10248e99a3e30995890aef8
tt/core/vector.py
python
vector.__getitem__
(self, index)
return self.from_list(answ_cores)
Get element of the TT-vector. :param index: array_like (it supports slicing). :returns: number -- an element of the tensor or a new tensor. Examples: Suppose that a is a 3-dimensional tt.vector of size 4 x 5 x 6 a[1, 2, 3] returns the element with index (1, 2, 3) a[1, :...
Get element of the TT-vector.
[ "Get", "element", "of", "the", "TT", "-", "vector", "." ]
def __getitem__(self, index): """Get element of the TT-vector. :param index: array_like (it supports slicing). :returns: number -- an element of the tensor or a new tensor. Examples: Suppose that a is a 3-dimensional tt.vector of size 4 x 5 x 6 a[1, 2, 3] returns the el...
[ "def", "__getitem__", "(", "self", ",", "index", ")", ":", "if", "len", "(", "index", ")", "!=", "self", ".", "d", ":", "print", "(", "\"Incorrect index length.\"", ")", "return", "# TODO: add tests.", "# TODO: in case of requesting one element this implementation is ...
https://github.com/oseledets/ttpy/blob/aeffa18654d2ad4ab10248e99a3e30995890aef8/tt/core/vector.py#L147-L190
seanliang/ConvertToUTF8
dc9f12c16b4b1214514e3bf5de0f4750750c3b14
chardet/chardistribution.py
python
CharDistributionAnalysis.reset
(self)
reset analyser, clear any state
reset analyser, clear any state
[ "reset", "analyser", "clear", "any", "state" ]
def reset(self): """reset analyser, clear any state""" # If this flag is set to True, detection is done and conclusion has # been made self._mDone = False self._mTotalChars = 0 # Total characters encountered # The number of characters whose frequency order is less than 5...
[ "def", "reset", "(", "self", ")", ":", "# If this flag is set to True, detection is done and conclusion has", "# been made", "self", ".", "_mDone", "=", "False", "self", ".", "_mTotalChars", "=", "0", "# Total characters encountered", "# The number of characters whose frequency...
https://github.com/seanliang/ConvertToUTF8/blob/dc9f12c16b4b1214514e3bf5de0f4750750c3b14/chardet/chardistribution.py#L57-L64
quantumlib/Cirq
89f88b01d69222d3f1ec14d649b7b3a85ed9211f
cirq-core/cirq/sim/simulator_base.py
python
SimulationTrialResultBase.get_state_containing_qubit
(self, qubit: 'cirq.Qid')
return self._final_step_result_typed._sim_state[qubit]
Returns the independent state space containing the qubit. Args: qubit: The qubit whose state space is required. Returns: The state space containing the qubit.
Returns the independent state space containing the qubit.
[ "Returns", "the", "independent", "state", "space", "containing", "the", "qubit", "." ]
def get_state_containing_qubit(self, qubit: 'cirq.Qid') -> TActOnArgs: """Returns the independent state space containing the qubit. Args: qubit: The qubit whose state space is required. Returns: The state space containing the qubit.""" return self._final_step_re...
[ "def", "get_state_containing_qubit", "(", "self", ",", "qubit", ":", "'cirq.Qid'", ")", "->", "TActOnArgs", ":", "return", "self", ".", "_final_step_result_typed", ".", "_sim_state", "[", "qubit", "]" ]
https://github.com/quantumlib/Cirq/blob/89f88b01d69222d3f1ec14d649b7b3a85ed9211f/cirq-core/cirq/sim/simulator_base.py#L430-L438
JasonSanford/geojsonlint.com
a986fce113157d2d7ff94bf9a63057fba153b023
geojsonlint/views.py
python
validate
(request)
return HttpResponse(json.dumps(resp), mimetype='application/json')
POST /validate Validate GeoJSON data in POST body
POST /validate
[ "POST", "/", "validate" ]
def validate(request): """ POST /validate Validate GeoJSON data in POST body """ testing = request.GET.get('testing') if request.method == 'POST': stringy_json = request.raw_post_data else: # GET try: remote_url = request.GET['url'] stringy_json = ...
[ "def", "validate", "(", "request", ")", ":", "testing", "=", "request", ".", "GET", ".", "get", "(", "'testing'", ")", "if", "request", ".", "method", "==", "'POST'", ":", "stringy_json", "=", "request", ".", "raw_post_data", "else", ":", "# GET", "try",...
https://github.com/JasonSanford/geojsonlint.com/blob/a986fce113157d2d7ff94bf9a63057fba153b023/geojsonlint/views.py#L21-L60
openstack/designate
bff3d5f6e31fe595a77143ec4ac779c187bf72a8
designate/common/keystone.py
python
verify_project_id
(context, project_id)
verify that a project_id exists. This attempts to verify that a project id exists. If it does not, an HTTPBadRequest is emitted.
verify that a project_id exists.
[ "verify", "that", "a", "project_id", "exists", "." ]
def verify_project_id(context, project_id): """verify that a project_id exists. This attempts to verify that a project id exists. If it does not, an HTTPBadRequest is emitted. """ session = ksa_loading.load_session_from_conf_options( CONF, 'keystone', auth=context.get_auth_plugin()) ad...
[ "def", "verify_project_id", "(", "context", ",", "project_id", ")", ":", "session", "=", "ksa_loading", ".", "load_session_from_conf_options", "(", "CONF", ",", "'keystone'", ",", "auth", "=", "context", ".", "get_auth_plugin", "(", ")", ")", "adap", "=", "ksa...
https://github.com/openstack/designate/blob/bff3d5f6e31fe595a77143ec4ac779c187bf72a8/designate/common/keystone.py#L27-L79
zacharyvoase/markdoc
694914ccb198d74e37321fc601061fe7f725b1ce
src/markdoc/cli/commands.py
python
vcs_ignore
(config, args)
Create a VCS ignore file for a wiki.
Create a VCS ignore file for a wiki.
[ "Create", "a", "VCS", "ignore", "file", "for", "a", "wiki", "." ]
def vcs_ignore(config, args): """Create a VCS ignore file for a wiki.""" log = logging.getLogger('markdoc.vcs-ignore') log.debug('Creating ignore file for %s' % args.vcs) wiki_root = config['meta.root'] # shorter local alias. ignore_file_lines = [] ignore_file_lines.append(p.relpath(co...
[ "def", "vcs_ignore", "(", "config", ",", "args", ")", ":", "log", "=", "logging", ".", "getLogger", "(", "'markdoc.vcs-ignore'", ")", "log", ".", "debug", "(", "'Creating ignore file for %s'", "%", "args", ".", "vcs", ")", "wiki_root", "=", "config", "[", ...
https://github.com/zacharyvoase/markdoc/blob/694914ccb198d74e37321fc601061fe7f725b1ce/src/markdoc/cli/commands.py#L94-L125
stanfordnlp/stanza
e44d1c88340e33bf9813e6f5a6bd24387eefc4b2
stanza/models/common/doc.py
python
Span.sent
(self)
return self._sent
Access the pointer to the sentence that this span belongs to.
Access the pointer to the sentence that this span belongs to.
[ "Access", "the", "pointer", "to", "the", "sentence", "that", "this", "span", "belongs", "to", "." ]
def sent(self): """ Access the pointer to the sentence that this span belongs to. """ return self._sent
[ "def", "sent", "(", "self", ")", ":", "return", "self", ".", "_sent" ]
https://github.com/stanfordnlp/stanza/blob/e44d1c88340e33bf9813e6f5a6bd24387eefc4b2/stanza/models/common/doc.py#L1061-L1063
deanishe/alfred-reddit
2f7545e682fc1579489947baa679e19b4eb1900e
src/workflow/workflow.py
python
Settings.save
(self)
Save settings to JSON file specified in ``self._filepath``. If you're using this class via :attr:`Workflow.settings`, which you probably are, ``self._filepath`` will be ``settings.json`` in your workflow's data directory (see :attr:`~Workflow.datadir`).
Save settings to JSON file specified in ``self._filepath``.
[ "Save", "settings", "to", "JSON", "file", "specified", "in", "self", ".", "_filepath", "." ]
def save(self): """Save settings to JSON file specified in ``self._filepath``. If you're using this class via :attr:`Workflow.settings`, which you probably are, ``self._filepath`` will be ``settings.json`` in your workflow's data directory (see :attr:`~Workflow.datadir`). """ ...
[ "def", "save", "(", "self", ")", ":", "if", "self", ".", "_nosave", ":", "return", "data", "=", "{", "}", "data", ".", "update", "(", "self", ")", "with", "LockFile", "(", "self", ".", "_filepath", ",", "0.5", ")", ":", "with", "atomic_writer", "("...
https://github.com/deanishe/alfred-reddit/blob/2f7545e682fc1579489947baa679e19b4eb1900e/src/workflow/workflow.py#L846-L862
zhl2008/awd-platform
0416b31abea29743387b10b3914581fbe8e7da5e
web_flaskbb/lib/python2.7/site-packages/kombu/transport/SLMQ.py
python
Channel.delete_message
(self, queue, message_id)
return q.message(message_id).delete()
[]
def delete_message(self, queue, message_id): q = self.slmq.queue(self.entity_name(queue)) return q.message(message_id).delete()
[ "def", "delete_message", "(", "self", ",", "queue", ",", "message_id", ")", ":", "q", "=", "self", ".", "slmq", ".", "queue", "(", "self", ".", "entity_name", "(", "queue", ")", ")", "return", "q", ".", "message", "(", "message_id", ")", ".", "delete...
https://github.com/zhl2008/awd-platform/blob/0416b31abea29743387b10b3914581fbe8e7da5e/web_flaskbb/lib/python2.7/site-packages/kombu/transport/SLMQ.py#L130-L132
mu-editor/mu
5a5d7723405db588f67718a63a0ec0ecabebae33
mu/interface/main.py
python
Window.set_theme
(self, theme)
Sets the theme for the REPL and editor tabs.
Sets the theme for the REPL and editor tabs.
[ "Sets", "the", "theme", "for", "the", "REPL", "and", "editor", "tabs", "." ]
def set_theme(self, theme): """ Sets the theme for the REPL and editor tabs. """ self.theme = theme self.load_theme.emit(theme) if theme == "contrast": new_theme = ContrastTheme new_icon = "theme_day" elif theme == "night": new_...
[ "def", "set_theme", "(", "self", ",", "theme", ")", ":", "self", ".", "theme", "=", "theme", "self", ".", "load_theme", ".", "emit", "(", "theme", ")", "if", "theme", "==", "\"contrast\"", ":", "new_theme", "=", "ContrastTheme", "new_icon", "=", "\"theme...
https://github.com/mu-editor/mu/blob/5a5d7723405db588f67718a63a0ec0ecabebae33/mu/interface/main.py#L950-L973
lohriialo/photoshop-scripting-python
6b97da967a5d0a45e54f7c99631b29773b923f09
api_reference/photoshop_2020.py
python
Document.Duplicate
(self, Name=defaultNamedOptArg, MergeLayersOnly=defaultNamedOptArg)
return ret
duplicate this document with parameters
duplicate this document with parameters
[ "duplicate", "this", "document", "with", "parameters" ]
def Duplicate(self, Name=defaultNamedOptArg, MergeLayersOnly=defaultNamedOptArg): 'duplicate this document with parameters' ret = self._oleobj_.InvokeTypes(1684235381, LCID, 1, (9, 0), ((12, 17), (12, 17)),Name , MergeLayersOnly) if ret is not None: ret = Dispatch(ret, u'Duplicate', '{B1ADEFB6-C536-42D6-8A8...
[ "def", "Duplicate", "(", "self", ",", "Name", "=", "defaultNamedOptArg", ",", "MergeLayersOnly", "=", "defaultNamedOptArg", ")", ":", "ret", "=", "self", ".", "_oleobj_", ".", "InvokeTypes", "(", "1684235381", ",", "LCID", ",", "1", ",", "(", "9", ",", "...
https://github.com/lohriialo/photoshop-scripting-python/blob/6b97da967a5d0a45e54f7c99631b29773b923f09/api_reference/photoshop_2020.py#L1602-L1608
7sDream/zhihu-py3
bcb4aa8325f8b54d3b44bd0bdc959edd9761fcfc
zhihu/author.py
python
Author.upvote_num
(self)
获取收到的的赞同数量. :return: 收到的的赞同数量 :rtype: int
获取收到的的赞同数量.
[ "获取收到的的赞同数量", "." ]
def upvote_num(self): """获取收到的的赞同数量. :return: 收到的的赞同数量 :rtype: int """ if self.url is None: return 0 else: number = int(self.soup.find( 'span', class_='zm-profile-header-user-agree').strong.text) return number
[ "def", "upvote_num", "(", "self", ")", ":", "if", "self", ".", "url", "is", "None", ":", "return", "0", "else", ":", "number", "=", "int", "(", "self", ".", "soup", ".", "find", "(", "'span'", ",", "class_", "=", "'zm-profile-header-user-agree'", ")", ...
https://github.com/7sDream/zhihu-py3/blob/bcb4aa8325f8b54d3b44bd0bdc959edd9761fcfc/zhihu/author.py#L190-L201
jesseweisberg/moveo_ros
b9282bdadbf2505a26d3b94b91e60a98d86efa34
object_detector_app/object_detection/core/matcher.py
python
Match.unmatched_column_indices
(self)
return self._reshape_and_cast(tf.where(tf.equal(self._match_results, -1)))
Returns column indices that do not match any row. The indices returned by this op are always sorted in increasing order. Returns: column_indices: int32 tensor of shape [K] with column indices.
Returns column indices that do not match any row.
[ "Returns", "column", "indices", "that", "do", "not", "match", "any", "row", "." ]
def unmatched_column_indices(self): """Returns column indices that do not match any row. The indices returned by this op are always sorted in increasing order. Returns: column_indices: int32 tensor of shape [K] with column indices. """ return self._reshape_and_cast(tf.where(tf.equal(self._ma...
[ "def", "unmatched_column_indices", "(", "self", ")", ":", "return", "self", ".", "_reshape_and_cast", "(", "tf", ".", "where", "(", "tf", ".", "equal", "(", "self", ".", "_match_results", ",", "-", "1", ")", ")", ")" ]
https://github.com/jesseweisberg/moveo_ros/blob/b9282bdadbf2505a26d3b94b91e60a98d86efa34/object_detector_app/object_detection/core/matcher.py#L98-L106
Gandi/gandi.cli
5de0605126247e986f8288b467a52710a78e1794
gandi/cli/commands/config.py
python
set
(gandi, g, key, value)
Update or create config key/value.
Update or create config key/value.
[ "Update", "or", "create", "config", "key", "/", "value", "." ]
def set(gandi, g, key, value): """Update or create config key/value.""" gandi.configure(global_=g, key=key, val=value)
[ "def", "set", "(", "gandi", ",", "g", ",", "key", ",", "value", ")", ":", "gandi", ".", "configure", "(", "global_", "=", "g", ",", "key", "=", "key", ",", "val", "=", "value", ")" ]
https://github.com/Gandi/gandi.cli/blob/5de0605126247e986f8288b467a52710a78e1794/gandi/cli/commands/config.py#L41-L43
spencer404/PyLoom
3417550d39cb759345afee136161335a5ce774ce
spiders/LaGou/tasks.py
python
JobDetails.on_save
(self)
保存数据
保存数据
[ "保存数据" ]
def on_save(self): """保存数据""" self.logger.info(f"抓到职位信息 {self.result}")
[ "def", "on_save", "(", "self", ")", ":", "self", ".", "logger", ".", "info", "(", "f\"抓到职位信息 {self.result}\")", "" ]
https://github.com/spencer404/PyLoom/blob/3417550d39cb759345afee136161335a5ce774ce/spiders/LaGou/tasks.py#L130-L132
CozySynthesizer/cozy
d7b2c0ee575057dea4ebec201d579f0ecd785b1b
cozy/synthesis/misc.py
python
queries_equivalent
(q1 : Query, q2 : Query, state_vars : [EVar], extern_funcs : { str : TFunc }, assumptions : Exp = ETRUE)
Determine whether two queries always return the same result. This function also checks that the two queries have semantically equivalent preconditions. Checking the preconditions is necessary to ensure semantic equivalence of the queries: a query object should be interpreted to mean "if my preconditio...
Determine whether two queries always return the same result.
[ "Determine", "whether", "two", "queries", "always", "return", "the", "same", "result", "." ]
def queries_equivalent(q1 : Query, q2 : Query, state_vars : [EVar], extern_funcs : { str : TFunc }, assumptions : Exp = ETRUE): """Determine whether two queries always return the same result. This function also checks that the two queries have semantically equivalent preconditions. Checking the preconditi...
[ "def", "queries_equivalent", "(", "q1", ":", "Query", ",", "q2", ":", "Query", ",", "state_vars", ":", "[", "EVar", "]", ",", "extern_funcs", ":", "{", "str", ":", "TFunc", "}", ",", "assumptions", ":", "Exp", "=", "ETRUE", ")", ":", "with", "task", ...
https://github.com/CozySynthesizer/cozy/blob/d7b2c0ee575057dea4ebec201d579f0ecd785b1b/cozy/synthesis/misc.py#L11-L40
tomplus/kubernetes_asyncio
f028cc793e3a2c519be6a52a49fb77ff0b014c9b
kubernetes_asyncio/client/models/v1_resource_quota_spec.py
python
V1ResourceQuotaSpec.scopes
(self)
return self._scopes
Gets the scopes of this V1ResourceQuotaSpec. # noqa: E501 A collection of filters that must match each object tracked by a quota. If not specified, the quota matches all objects. # noqa: E501 :return: The scopes of this V1ResourceQuotaSpec. # noqa: E501 :rtype: list[str]
Gets the scopes of this V1ResourceQuotaSpec. # noqa: E501
[ "Gets", "the", "scopes", "of", "this", "V1ResourceQuotaSpec", ".", "#", "noqa", ":", "E501" ]
def scopes(self): """Gets the scopes of this V1ResourceQuotaSpec. # noqa: E501 A collection of filters that must match each object tracked by a quota. If not specified, the quota matches all objects. # noqa: E501 :return: The scopes of this V1ResourceQuotaSpec. # noqa: E501 :rtype: ...
[ "def", "scopes", "(", "self", ")", ":", "return", "self", ".", "_scopes" ]
https://github.com/tomplus/kubernetes_asyncio/blob/f028cc793e3a2c519be6a52a49fb77ff0b014c9b/kubernetes_asyncio/client/models/v1_resource_quota_spec.py#L110-L118
Yonv1943/Python
ecce2153892093d7a13686e4cbfd6b323cb59de8
Plan/TUTO_mnist_1layers.py
python
train_session
(sess_para, data_para)
train loop init
train loop init
[ "train", "loop", "init" ]
def train_session(sess_para, data_para): (train_image, train_label, test_image, test_label) = data_para (image, label, pred, loss, optimizer) = sess_para shutil.rmtree(G.model_save_dir, ignore_errors=True) logs = open(G.txt_path, 'a') sess = tf.Session() sess.run(tf.global_variables_initializer...
[ "def", "train_session", "(", "sess_para", ",", "data_para", ")", ":", "(", "train_image", ",", "train_label", ",", "test_image", ",", "test_label", ")", "=", "data_para", "(", "image", ",", "label", ",", "pred", ",", "loss", ",", "optimizer", ")", "=", "...
https://github.com/Yonv1943/Python/blob/ecce2153892093d7a13686e4cbfd6b323cb59de8/Plan/TUTO_mnist_1layers.py#L77-L121
bruderstein/PythonScript
df9f7071ddf3a079e3a301b9b53a6dc78cf1208f
PythonLib/tcl/tkinter/ttk.py
python
Labelframe.__init__
(self, master=None, **kw)
Construct a Ttk Labelframe with parent master. STANDARD OPTIONS class, cursor, style, takefocus WIDGET-SPECIFIC OPTIONS labelanchor, text, underline, padding, labelwidget, width, height
Construct a Ttk Labelframe with parent master.
[ "Construct", "a", "Ttk", "Labelframe", "with", "parent", "master", "." ]
def __init__(self, master=None, **kw): """Construct a Ttk Labelframe with parent master. STANDARD OPTIONS class, cursor, style, takefocus WIDGET-SPECIFIC OPTIONS labelanchor, text, underline, padding, labelwidget, width, height """ Widget.__...
[ "def", "__init__", "(", "self", ",", "master", "=", "None", ",", "*", "*", "kw", ")", ":", "Widget", ".", "__init__", "(", "self", ",", "master", ",", "\"ttk::labelframe\"", ",", "kw", ")" ]
https://github.com/bruderstein/PythonScript/blob/df9f7071ddf3a079e3a301b9b53a6dc78cf1208f/PythonLib/tcl/tkinter/ttk.py#L762-L773
zhl2008/awd-platform
0416b31abea29743387b10b3914581fbe8e7da5e
web_flaskbb/lib/python2.7/site-packages/billiard/popen_forkserver.py
python
_DupFd.__init__
(self, ind)
[]
def __init__(self, ind): self.ind = ind
[ "def", "__init__", "(", "self", ",", "ind", ")", ":", "self", ".", "ind", "=", "ind" ]
https://github.com/zhl2008/awd-platform/blob/0416b31abea29743387b10b3914581fbe8e7da5e/web_flaskbb/lib/python2.7/site-packages/billiard/popen_forkserver.py#L21-L22
natethegreate/hent-AI
b427dd4c3dcd274694a3b843db9790666387c63f
mrcnn/utils.py
python
non_max_suppression
(boxes, scores, threshold)
return np.array(pick, dtype=np.int32)
Performs non-maximum suppression and returns indices of kept boxes. boxes: [N, (y1, x1, y2, x2)]. Notice that (y2, x2) lays outside the box. scores: 1-D array of box scores. threshold: Float. IoU threshold to use for filtering.
Performs non-maximum suppression and returns indices of kept boxes. boxes: [N, (y1, x1, y2, x2)]. Notice that (y2, x2) lays outside the box. scores: 1-D array of box scores. threshold: Float. IoU threshold to use for filtering.
[ "Performs", "non", "-", "maximum", "suppression", "and", "returns", "indices", "of", "kept", "boxes", ".", "boxes", ":", "[", "N", "(", "y1", "x1", "y2", "x2", ")", "]", ".", "Notice", "that", "(", "y2", "x2", ")", "lays", "outside", "the", "box", ...
def non_max_suppression(boxes, scores, threshold): """Performs non-maximum suppression and returns indices of kept boxes. boxes: [N, (y1, x1, y2, x2)]. Notice that (y2, x2) lays outside the box. scores: 1-D array of box scores. threshold: Float. IoU threshold to use for filtering. """ assert box...
[ "def", "non_max_suppression", "(", "boxes", ",", "scores", ",", "threshold", ")", ":", "assert", "boxes", ".", "shape", "[", "0", "]", ">", "0", "if", "boxes", ".", "dtype", ".", "kind", "!=", "\"f\"", ":", "boxes", "=", "boxes", ".", "astype", "(", ...
https://github.com/natethegreate/hent-AI/blob/b427dd4c3dcd274694a3b843db9790666387c63f/mrcnn/utils.py#L122-L156
JE2Se/AssetScan
3d800432b4927ae3f32081a38d0ec8e4041a6568
vuln/CVE_2018_2628.py
python
t3handshake
(sock,server_addr)
[]
def t3handshake(sock,server_addr): sock.connect(server_addr) sock.send(bytes.fromhex('74332031322e322e310a41533a3235350a484c3a31390a4d533a31303030303030300a0a')) time.sleep(1) sock.recv(1024)
[ "def", "t3handshake", "(", "sock", ",", "server_addr", ")", ":", "sock", ".", "connect", "(", "server_addr", ")", "sock", ".", "send", "(", "bytes", ".", "fromhex", "(", "'74332031322e322e310a41533a3235350a484c3a31390a4d533a31303030303030300a0a'", ")", ")", "time", ...
https://github.com/JE2Se/AssetScan/blob/3d800432b4927ae3f32081a38d0ec8e4041a6568/vuln/CVE_2018_2628.py#L24-L28
llSourcell/AI_Artist
3038c06c2e389b9c919c881c9a169efe2fd7810e
lib/python2.7/site-packages/pip/_vendor/pkg_resources/__init__.py
python
Requirement.__repr__
(self)
return "Requirement.parse(%r)" % str(self)
[]
def __repr__(self): return "Requirement.parse(%r)" % str(self)
[ "def", "__repr__", "(", "self", ")", ":", "return", "\"Requirement.parse(%r)\"", "%", "str", "(", "self", ")" ]
https://github.com/llSourcell/AI_Artist/blob/3038c06c2e389b9c919c881c9a169efe2fd7810e/lib/python2.7/site-packages/pip/_vendor/pkg_resources/__init__.py#L2829-L2829
nvaccess/nvda
20d5a25dced4da34338197f0ef6546270ebca5d0
source/NVDAObjects/__init__.py
python
NVDAObject._get_previous
(self)
return None
Retrieves the object directly before this object with the same parent. @return: the previous object if it exists else None. @rtype: L{NVDAObject} or None
Retrieves the object directly before this object with the same parent.
[ "Retrieves", "the", "object", "directly", "before", "this", "object", "with", "the", "same", "parent", "." ]
def _get_previous(self): """Retrieves the object directly before this object with the same parent. @return: the previous object if it exists else None. @rtype: L{NVDAObject} or None """ return None
[ "def", "_get_previous", "(", "self", ")", ":", "return", "None" ]
https://github.com/nvaccess/nvda/blob/20d5a25dced4da34338197f0ef6546270ebca5d0/source/NVDAObjects/__init__.py#L591-L596
zulip/zulip
19f891968de50d43920af63526c823bdd233cdee
zerver/lib/cache.py
python
ignore_unhashable_lru_cache
( maxsize: int = 128, typed: bool = False )
return decorator
This is a wrapper over lru_cache function. It adds following features on top of lru_cache: * It will not cache result of functions with unhashable arguments. * It will clear cache whenever zerver.lib.cache.KEY_PREFIX changes.
This is a wrapper over lru_cache function. It adds following features on top of lru_cache:
[ "This", "is", "a", "wrapper", "over", "lru_cache", "function", ".", "It", "adds", "following", "features", "on", "top", "of", "lru_cache", ":" ]
def ignore_unhashable_lru_cache( maxsize: int = 128, typed: bool = False ) -> Callable[[FuncT], FuncT]: """ This is a wrapper over lru_cache function. It adds following features on top of lru_cache: * It will not cache result of functions with unhashable arguments. * It will clear cache...
[ "def", "ignore_unhashable_lru_cache", "(", "maxsize", ":", "int", "=", "128", ",", "typed", ":", "bool", "=", "False", ")", "->", "Callable", "[", "[", "FuncT", "]", ",", "FuncT", "]", ":", "internal_decorator", "=", "lru_cache", "(", "maxsize", "=", "ma...
https://github.com/zulip/zulip/blob/19f891968de50d43920af63526c823bdd233cdee/zerver/lib/cache.py#L770-L818
cirla/tulipy
5f3049a47574f97e28fb78e9cf3787ed610941f9
tulipy/__init__.py
python
min
(real, period)
return lib.min([real], [period])
Minimum In Period
Minimum In Period
[ "Minimum", "In", "Period" ]
def min(real, period): """ Minimum In Period """ return lib.min([real], [period])
[ "def", "min", "(", "real", ",", "period", ")", ":", "return", "lib", ".", "min", "(", "[", "real", "]", ",", "[", "period", "]", ")" ]
https://github.com/cirla/tulipy/blob/5f3049a47574f97e28fb78e9cf3787ed610941f9/tulipy/__init__.py#L802-L807
xiaobai1217/MBMD
246f3434bccb9c8357e0f698995b659578bf1afb
lib/object_detection/core/matcher.py
python
Match.unmatched_column_indicator
(self)
return tf.equal(self._match_results, -1)
Returns column indices that are unmatched. Returns: column_indices: int32 tensor of shape [K] with column indices.
Returns column indices that are unmatched.
[ "Returns", "column", "indices", "that", "are", "unmatched", "." ]
def unmatched_column_indicator(self): """Returns column indices that are unmatched. Returns: column_indices: int32 tensor of shape [K] with column indices. """ return tf.equal(self._match_results, -1)
[ "def", "unmatched_column_indicator", "(", "self", ")", ":", "return", "tf", ".", "equal", "(", "self", ".", "_match_results", ",", "-", "1", ")" ]
https://github.com/xiaobai1217/MBMD/blob/246f3434bccb9c8357e0f698995b659578bf1afb/lib/object_detection/core/matcher.py#L108-L114
IronLanguages/main
a949455434b1fda8c783289e897e78a9a0caabb5
External.LCA_RESTRICTED/Languages/CPython/27/Lib/sets.py
python
BaseSet.__or__
(self, other)
return self.union(other)
Return the union of two sets as a new set. (I.e. all elements that are in either set.)
Return the union of two sets as a new set.
[ "Return", "the", "union", "of", "two", "sets", "as", "a", "new", "set", "." ]
def __or__(self, other): """Return the union of two sets as a new set. (I.e. all elements that are in either set.) """ if not isinstance(other, BaseSet): return NotImplemented return self.union(other)
[ "def", "__or__", "(", "self", ",", "other", ")", ":", "if", "not", "isinstance", "(", "other", ",", "BaseSet", ")", ":", "return", "NotImplemented", "return", "self", ".", "union", "(", "other", ")" ]
https://github.com/IronLanguages/main/blob/a949455434b1fda8c783289e897e78a9a0caabb5/External.LCA_RESTRICTED/Languages/CPython/27/Lib/sets.py#L178-L185
pygae/clifford
0b6cffb9a6d44ecb7a666f6b08b1788fc94a0ab6
clifford/tools/g3c/__init__.py
python
rotor_between_lines
(L1, L2)
return normalisation * output
Implements a very optimised rotor line to line extraction
Implements a very optimised rotor line to line extraction
[ "Implements", "a", "very", "optimised", "rotor", "line", "to", "line", "extraction" ]
def rotor_between_lines(L1, L2): """ Implements a very optimised rotor line to line extraction """ L21 = layout.MultiVector(sparse_line_gmt(L2.value, L1.value)) L12 = layout.MultiVector(sparse_line_gmt(L1.value, L2.value)) K = L21 + L12 + 2.0 beta = K(4) alpha = 2 * K.value[0] denominator =...
[ "def", "rotor_between_lines", "(", "L1", ",", "L2", ")", ":", "L21", "=", "layout", ".", "MultiVector", "(", "sparse_line_gmt", "(", "L2", ".", "value", ",", "L1", ".", "value", ")", ")", "L12", "=", "layout", ".", "MultiVector", "(", "sparse_line_gmt", ...
https://github.com/pygae/clifford/blob/0b6cffb9a6d44ecb7a666f6b08b1788fc94a0ab6/clifford/tools/g3c/__init__.py#L1561-L1574
biolab/orange3
41685e1c7b1d1babe680113685a2d44bcc9fec0b
Orange/widgets/visualize/utils/heatmap.py
python
SelectionManager.selection_update
(self, heatmap_widget, event)
Selection updated by `heatmap_widget due to `event` (mouse drag).
Selection updated by `heatmap_widget due to `event` (mouse drag).
[ "Selection", "updated", "by", "heatmap_widget", "due", "to", "event", "(", "mouse", "drag", ")", "." ]
def selection_update(self, heatmap_widget, event): """ Selection updated by `heatmap_widget due to `event` (mouse drag). """ pos = heatmap_widget.mapFromScene(event.scenePos()) row, _ = heatmap_widget.heatmapCellAt(pos) if row < 0: return start, _ = self._hea...
[ "def", "selection_update", "(", "self", ",", "heatmap_widget", ",", "event", ")", ":", "pos", "=", "heatmap_widget", ".", "mapFromScene", "(", "event", ".", "scenePos", "(", ")", ")", "row", ",", "_", "=", "heatmap_widget", ".", "heatmapCellAt", "(", "pos"...
https://github.com/biolab/orange3/blob/41685e1c7b1d1babe680113685a2d44bcc9fec0b/Orange/widgets/visualize/utils/heatmap.py#L1568-L1590
golismero/golismero
7d605b937e241f51c1ca4f47b20f755eeefb9d76
thirdparty_libs/nltk/inference/mace.py
python
MaceCommand._transform_output
(self, valuation_str, format)
Transform the output file into any Mace4 ``interpformat`` format. :param format: Output format for displaying models. :type format: str
Transform the output file into any Mace4 ``interpformat`` format.
[ "Transform", "the", "output", "file", "into", "any", "Mace4", "interpformat", "format", "." ]
def _transform_output(self, valuation_str, format): """ Transform the output file into any Mace4 ``interpformat`` format. :param format: Output format for displaying models. :type format: str """ if format in ['standard', 'standard2', 'portable', 'tabular', ...
[ "def", "_transform_output", "(", "self", ",", "valuation_str", ",", "format", ")", ":", "if", "format", "in", "[", "'standard'", ",", "'standard2'", ",", "'portable'", ",", "'tabular'", ",", "'raw'", ",", "'cooked'", ",", "'xml'", ",", "'tex'", "]", ":", ...
https://github.com/golismero/golismero/blob/7d605b937e241f51c1ca4f47b20f755eeefb9d76/thirdparty_libs/nltk/inference/mace.py#L155-L166
megvii-model/CrowdDetection
446f8e688fde679e04c35bd1aa1d4d491646f2eb
lib/module/rpn.py
python
RPN.__init__
(self, rpn_channel=256)
[]
def __init__(self, rpn_channel=256): super().__init__() self.anchors_generator = AnchorGenerator( config.anchor_base_size, config.anchor_aspect_ratios, config.anchor_base_scale) self.rpn_conv = M.Conv2d(256, rpn_channel, kernel_size=3, stride=1, padding=1) ...
[ "def", "__init__", "(", "self", ",", "rpn_channel", "=", "256", ")", ":", "super", "(", ")", ".", "__init__", "(", ")", "self", ".", "anchors_generator", "=", "AnchorGenerator", "(", "config", ".", "anchor_base_size", ",", "config", ".", "anchor_aspect_ratio...
https://github.com/megvii-model/CrowdDetection/blob/446f8e688fde679e04c35bd1aa1d4d491646f2eb/lib/module/rpn.py#L13-L25
OUCMachineLearning/OUCML
5b54337d7c0316084cb1a74befda2bba96137d4a
One_Day_One_GAN/day7/esrgan/models.py
python
FeatureExtractor.forward
(self, img)
return self.vgg19_54(img)
[]
def forward(self, img): return self.vgg19_54(img)
[ "def", "forward", "(", "self", ",", "img", ")", ":", "return", "self", ".", "vgg19_54", "(", "img", ")" ]
https://github.com/OUCMachineLearning/OUCML/blob/5b54337d7c0316084cb1a74befda2bba96137d4a/One_Day_One_GAN/day7/esrgan/models.py#L14-L15
sympy/sympy
d822fcba181155b85ff2b29fe525adbafb22b448
sympy/combinatorics/permutations.py
python
Permutation.get_positional_distance
(self, other)
return sum([abs(a[i] - b[i]) for i in range(len(a))])
Computes the positional distance between two permutations. Examples ======== >>> from sympy.combinatorics.permutations import Permutation >>> p = Permutation([0, 3, 1, 2, 4]) >>> q = Permutation.josephus(4, 5, 2) >>> r = Permutation([3, 1, 4, 0, 2]) >>> p.get_po...
Computes the positional distance between two permutations.
[ "Computes", "the", "positional", "distance", "between", "two", "permutations", "." ]
def get_positional_distance(self, other): """ Computes the positional distance between two permutations. Examples ======== >>> from sympy.combinatorics.permutations import Permutation >>> p = Permutation([0, 3, 1, 2, 4]) >>> q = Permutation.josephus(4, 5, 2) ...
[ "def", "get_positional_distance", "(", "self", ",", "other", ")", ":", "a", "=", "self", ".", "array_form", "b", "=", "other", ".", "array_form", "if", "len", "(", "a", ")", "!=", "len", "(", "b", ")", ":", "raise", "ValueError", "(", "\"The permutatio...
https://github.com/sympy/sympy/blob/d822fcba181155b85ff2b29fe525adbafb22b448/sympy/combinatorics/permutations.py#L2793-L2818
clips/pattern
d25511f9ca7ed9356b801d8663b8b5168464e68f
pattern/web/__init__.py
python
Crawler.crawl
(self, method=DEPTH, **kwargs)
return False
Visits the next link in Crawler._queue. If the link is on a domain recently visited (< Crawler.delay) it is skipped. Parses the content at the link for new links and adds them to the queue, according to their Crawler.priority(). Visited links (and content) are passed to C...
Visits the next link in Crawler._queue. If the link is on a domain recently visited (< Crawler.delay) it is skipped. Parses the content at the link for new links and adds them to the queue, according to their Crawler.priority(). Visited links (and content) are passed to C...
[ "Visits", "the", "next", "link", "in", "Crawler", ".", "_queue", ".", "If", "the", "link", "is", "on", "a", "domain", "recently", "visited", "(", "<", "Crawler", ".", "delay", ")", "it", "is", "skipped", ".", "Parses", "the", "content", "at", "the", ...
def crawl(self, method=DEPTH, **kwargs): """ Visits the next link in Crawler._queue. If the link is on a domain recently visited (< Crawler.delay) it is skipped. Parses the content at the link for new links and adds them to the queue, according to their Crawler.priority(). ...
[ "def", "crawl", "(", "self", ",", "method", "=", "DEPTH", ",", "*", "*", "kwargs", ")", ":", "link", "=", "self", ".", "pop", "(", ")", "if", "link", "is", "None", ":", "return", "False", "if", "link", ".", "url", "not", "in", "self", ".", "vis...
https://github.com/clips/pattern/blob/d25511f9ca7ed9356b801d8663b8b5168464e68f/pattern/web/__init__.py#L4167-L4224
hxdengBerkeley/PointCNN.Pytorch
6ec6c291cf97923a84fb6ed8c82e98bf01e7e96d
utils/pc_util.py
python
pyplot_draw_point_cloud
(points, output_filename)
points is a Nx3 numpy array
points is a Nx3 numpy array
[ "points", "is", "a", "Nx3", "numpy", "array" ]
def pyplot_draw_point_cloud(points, output_filename): """ points is a Nx3 numpy array """ fig = plt.figure() ax = fig.add_subplot(111, projection='3d') ax.scatter(points[:,0], points[:,1], points[:,2]) ax.set_xlabel('x') ax.set_ylabel('y') ax.set_zlabel('z')
[ "def", "pyplot_draw_point_cloud", "(", "points", ",", "output_filename", ")", ":", "fig", "=", "plt", ".", "figure", "(", ")", "ax", "=", "fig", ".", "add_subplot", "(", "111", ",", "projection", "=", "'3d'", ")", "ax", ".", "scatter", "(", "points", "...
https://github.com/hxdengBerkeley/PointCNN.Pytorch/blob/6ec6c291cf97923a84fb6ed8c82e98bf01e7e96d/utils/pc_util.py#L183-L190
ales-tsurko/cells
4cf7e395cd433762bea70cdc863a346f3a6fe1d0
packaging/macos/python/lib/python3.7/idlelib/configdialog.py
python
KeysPage.delete_custom_keys
(self)
Handle event to delete a custom key set. Applying the delete deactivates the current configuration and reverts to the default. The custom key set is permanently deleted from the config file.
Handle event to delete a custom key set.
[ "Handle", "event", "to", "delete", "a", "custom", "key", "set", "." ]
def delete_custom_keys(self): """Handle event to delete a custom key set. Applying the delete deactivates the current configuration and reverts to the default. The custom key set is permanently deleted from the config file. """ keyset_name = self.custom_name.get() ...
[ "def", "delete_custom_keys", "(", "self", ")", ":", "keyset_name", "=", "self", ".", "custom_name", ".", "get", "(", ")", "delmsg", "=", "'Are you sure you wish to delete the key set %r ?'", "if", "not", "self", ".", "askyesno", "(", "'Delete Key Set'", ",", "delm...
https://github.com/ales-tsurko/cells/blob/4cf7e395cd433762bea70cdc863a346f3a6fe1d0/packaging/macos/python/lib/python3.7/idlelib/configdialog.py#L1741-L1773
sqall01/alertR
e1d1a83e54f876cc4cd7bd87387e05cb75d4dc13
alertClientKodi/lib/client/watchdog.py
python
ConnectionWatchdog.exit
(self)
Sets the exit flag to shut down the thread.
Sets the exit flag to shut down the thread.
[ "Sets", "the", "exit", "flag", "to", "shut", "down", "the", "thread", "." ]
def exit(self): """ Sets the exit flag to shut down the thread. """ self._exit_flag = True
[ "def", "exit", "(", "self", ")", ":", "self", ".", "_exit_flag", "=", "True" ]
https://github.com/sqall01/alertR/blob/e1d1a83e54f876cc4cd7bd87387e05cb75d4dc13/alertClientKodi/lib/client/watchdog.py#L129-L133
CGCookie/retopoflow
3d8b3a47d1d661f99ab0aeb21d31370bf15de35e
retopoflow/rfmesh/rfmesh_wrapper.py
python
BMElemWrapper.__init__
(self, bmelem)
[]
def __init__(self, bmelem): self.bmelem = bmelem
[ "def", "__init__", "(", "self", ",", "bmelem", ")", ":", "self", ".", "bmelem", "=", "bmelem" ]
https://github.com/CGCookie/retopoflow/blob/3d8b3a47d1d661f99ab0aeb21d31370bf15de35e/retopoflow/rfmesh/rfmesh_wrapper.py#L83-L84
Allen7D/mini-shop-server
5f3ddd5a4e5e99a1e005f11abc620cefff2493fc
app/core/swagger_filed.py
python
SwaggerSpecs.arg_fields
(self)
return whole_arg_fields + simple_arg_fields
解析出args
解析出args
[ "解析出args" ]
def arg_fields(self): '''解析出args''' whole_arg_fields = self.parse_whole_args(self.whole_args) simple_arg_fields = self.parse_simple_args(self.simple_args) return whole_arg_fields + simple_arg_fields
[ "def", "arg_fields", "(", "self", ")", ":", "whole_arg_fields", "=", "self", ".", "parse_whole_args", "(", "self", ".", "whole_args", ")", "simple_arg_fields", "=", "self", ".", "parse_simple_args", "(", "self", ".", "simple_args", ")", "return", "whole_arg_fiel...
https://github.com/Allen7D/mini-shop-server/blob/5f3ddd5a4e5e99a1e005f11abc620cefff2493fc/app/core/swagger_filed.py#L204-L208
vanhuyz/CycleGAN-TensorFlow
befe2f57032ee6c25d0dbd1f497f5b5432375da5
ops.py
python
_biases
(name, shape, constant=0.0)
return tf.get_variable(name, shape, initializer=tf.constant_initializer(constant))
Helper to create an initialized Bias with constant
Helper to create an initialized Bias with constant
[ "Helper", "to", "create", "an", "initialized", "Bias", "with", "constant" ]
def _biases(name, shape, constant=0.0): """ Helper to create an initialized Bias with constant """ return tf.get_variable(name, shape, initializer=tf.constant_initializer(constant))
[ "def", "_biases", "(", "name", ",", "shape", ",", "constant", "=", "0.0", ")", ":", "return", "tf", ".", "get_variable", "(", "name", ",", "shape", ",", "initializer", "=", "tf", ".", "constant_initializer", "(", "constant", ")", ")" ]
https://github.com/vanhuyz/CycleGAN-TensorFlow/blob/befe2f57032ee6c25d0dbd1f497f5b5432375da5/ops.py#L191-L195
has2k1/plotnine
6c82cdc20d6f81c96772da73fc07a672a0a0a6ef
plotnine/themes/seaborn_rcmod.py
python
set_context
(context=None, font_scale=1, rc=None)
Set the plotting context parameters. This affects things like the size of the labels, lines, and other elements of the plot, but not the overall style. The base context is "notebook", and the other contexts are "paper", "talk", and "poster", which are version of the notebook parameters scaled by .8, 1....
Set the plotting context parameters.
[ "Set", "the", "plotting", "context", "parameters", "." ]
def set_context(context=None, font_scale=1, rc=None): """Set the plotting context parameters. This affects things like the size of the labels, lines, and other elements of the plot, but not the overall style. The base context is "notebook", and the other contexts are "paper", "talk", and "poster", ...
[ "def", "set_context", "(", "context", "=", "None", ",", "font_scale", "=", "1", ",", "rc", "=", "None", ")", ":", "context_object", "=", "plotting_context", "(", "context", ",", "font_scale", ",", "rc", ")", "mpl", ".", "rcParams", ".", "update", "(", ...
https://github.com/has2k1/plotnine/blob/6c82cdc20d6f81c96772da73fc07a672a0a0a6ef/plotnine/themes/seaborn_rcmod.py#L442-L480
ecdavis/pants
88129d24020e95b71e8d0260a111dc0b457b0676
pants/http/client.py
python
HTTPClient.on_error
(self, response, exception)
Placeholder. Called when an error occurs. ========== ============ Argument Description ========== ============ exception An Exception instance with information about the error that occurred. ========== ============
Placeholder. Called when an error occurs.
[ "Placeholder", ".", "Called", "when", "an", "error", "occurs", "." ]
def on_error(self, response, exception): """ Placeholder. Called when an error occurs. ========== ============ Argument Description ========== ============ exception An Exception instance with information about the error that occurred. ========== ========...
[ "def", "on_error", "(", "self", ",", "response", ",", "exception", ")", ":", "pass" ]
https://github.com/ecdavis/pants/blob/88129d24020e95b71e8d0260a111dc0b457b0676/pants/http/client.py#L566-L576
fortharris/Pcode
147962d160a834c219e12cb456abc130826468e4
rope/base/history.py
python
History.clear
(self)
Forget all undo and redo information
Forget all undo and redo information
[ "Forget", "all", "undo", "and", "redo", "information" ]
def clear(self): """Forget all undo and redo information""" del self.undo_list[:] del self.redo_list[:]
[ "def", "clear", "(", "self", ")", ":", "del", "self", ".", "undo_list", "[", ":", "]", "del", "self", ".", "redo_list", "[", ":", "]" ]
https://github.com/fortharris/Pcode/blob/147962d160a834c219e12cb456abc130826468e4/rope/base/history.py#L203-L206
requests/toolbelt
11122809e7dd08a529a982fd9121a87162da47eb
requests_toolbelt/multipart/encoder.py
python
MultipartEncoder._write_headers
(self, headers)
return self._write(encode_with(headers, self.encoding))
Write the current part's headers to the buffer.
Write the current part's headers to the buffer.
[ "Write", "the", "current", "part", "s", "headers", "to", "the", "buffer", "." ]
def _write_headers(self, headers): """Write the current part's headers to the buffer.""" return self._write(encode_with(headers, self.encoding))
[ "def", "_write_headers", "(", "self", ",", "headers", ")", ":", "return", "self", ".", "_write", "(", "encode_with", "(", "headers", ",", "self", ".", "encoding", ")", ")" ]
https://github.com/requests/toolbelt/blob/11122809e7dd08a529a982fd9121a87162da47eb/requests_toolbelt/multipart/encoder.py#L269-L271
trainindata/deploying-machine-learning-models
aaeb3e65d0a58ad583289aaa39b089f11d06a4eb
packages/ml_api/api/controller.py
python
health
()
[]
def health(): if request.method == 'GET': _logger.info('health status OK') return 'ok'
[ "def", "health", "(", ")", ":", "if", "request", ".", "method", "==", "'GET'", ":", "_logger", ".", "info", "(", "'health status OK'", ")", "return", "'ok'" ]
https://github.com/trainindata/deploying-machine-learning-models/blob/aaeb3e65d0a58ad583289aaa39b089f11d06a4eb/packages/ml_api/api/controller.py#L19-L22
OpenMDAO/OpenMDAO1
791a6fbbb7d266f3dcbc1f7bde3ae03a70dc1317
openmdao/devtools/trace.py
python
TraceCalls.__init__
(self, stream=sys.stdout, indent_step=2, show_return=True, env_vars=())
[]
def __init__(self, stream=sys.stdout, indent_step=2, show_return=True, env_vars=()): self.stream = stream self.indent_step = indent_step self.show_ret = show_return self.env_vars = env_vars # This is a class attribute since we want to share the indentation ...
[ "def", "__init__", "(", "self", ",", "stream", "=", "sys", ".", "stdout", ",", "indent_step", "=", "2", ",", "show_return", "=", "True", ",", "env_vars", "=", "(", ")", ")", ":", "self", ".", "stream", "=", "stream", "self", ".", "indent_step", "=", ...
https://github.com/OpenMDAO/OpenMDAO1/blob/791a6fbbb7d266f3dcbc1f7bde3ae03a70dc1317/openmdao/devtools/trace.py#L23-L33
opencobra/cobrapy
0b9ea70cb0ffe78568d445ce3361ad10ec6b02a2
src/cobra/sampling/optgp.py
python
_sample_chain
(args: Tuple[int, int])
return (sampler.retries, samples)
Sample a single chain for OptGPSampler. `center` and `n_samples` are updated locally and forgotten afterwards.
Sample a single chain for OptGPSampler.
[ "Sample", "a", "single", "chain", "for", "OptGPSampler", "." ]
def _sample_chain(args: Tuple[int, int]) -> Tuple[int, OptGPSampler]: """Sample a single chain for OptGPSampler. `center` and `n_samples` are updated locally and forgotten afterwards. """ n, idx = args # has to be this way to work in Python 2.7 center = sampler.center np.random.seed((sampler....
[ "def", "_sample_chain", "(", "args", ":", "Tuple", "[", "int", ",", "int", "]", ")", "->", "Tuple", "[", "int", ",", "OptGPSampler", "]", ":", "n", ",", "idx", "=", "args", "# has to be this way to work in Python 2.7", "center", "=", "sampler", ".", "cente...
https://github.com/opencobra/cobrapy/blob/0b9ea70cb0ffe78568d445ce3361ad10ec6b02a2/src/cobra/sampling/optgp.py#L217-L252
brosner/everyblock_code
25397148223dad81e7fbb9c7cf2f169162df4681
ebpub/ebpub/accounts/utils.py
python
check_password_hash
(raw_password, password_hash)
return hsh == correct_hash
Returns True if the raw_password matches password_hash.
Returns True if the raw_password matches password_hash.
[ "Returns", "True", "if", "the", "raw_password", "matches", "password_hash", "." ]
def check_password_hash(raw_password, password_hash): "Returns True if the raw_password matches password_hash." algo, salt, hsh = password_hash.split('$') correct_hash = sha_constructor(salt + raw_password).hexdigest() return hsh == correct_hash
[ "def", "check_password_hash", "(", "raw_password", ",", "password_hash", ")", ":", "algo", ",", "salt", ",", "hsh", "=", "password_hash", ".", "split", "(", "'$'", ")", "correct_hash", "=", "sha_constructor", "(", "salt", "+", "raw_password", ")", ".", "hexd...
https://github.com/brosner/everyblock_code/blob/25397148223dad81e7fbb9c7cf2f169162df4681/ebpub/ebpub/accounts/utils.py#L65-L69
shmilylty/OneForAll
48591142a641e80f8a64ab215d11d06b696702d7
brute.py
python
gen_fuzz_subdomains
(expression, rule, fuzzlist)
return subdomains
Generate subdomains based on fuzz mode :param str expression: generate subdomains expression :param str rule: regexp rule :param str fuzzlist: fuzz dictionary :return set subdomains: list of subdomains
Generate subdomains based on fuzz mode
[ "Generate", "subdomains", "based", "on", "fuzz", "mode" ]
def gen_fuzz_subdomains(expression, rule, fuzzlist): """ Generate subdomains based on fuzz mode :param str expression: generate subdomains expression :param str rule: regexp rule :param str fuzzlist: fuzz dictionary :return set subdomains: list of subdomains """ subdomains = set(...
[ "def", "gen_fuzz_subdomains", "(", "expression", ",", "rule", ",", "fuzzlist", ")", ":", "subdomains", "=", "set", "(", ")", "if", "fuzzlist", ":", "fuzz_domain", "=", "gen_subdomains", "(", "expression", ",", "fuzzlist", ")", "subdomains", ".", "update", "(...
https://github.com/shmilylty/OneForAll/blob/48591142a641e80f8a64ab215d11d06b696702d7/brute.py#L60-L86
simetenn/uncertainpy
ffb2400289743066265b9a8561cdf3b72e478a28
src/uncertainpy/data.py
python
Data.__setitem__
(self, feature, data)
Set `data` for `feature`. `Data` must be a DataFeature object. Parameters ---------- feature: str Name of feature/model. data : DataFeature DataFeature with the data for `feature`. Raises ------ ValueError If `data` is not a D...
Set `data` for `feature`. `Data` must be a DataFeature object.
[ "Set", "data", "for", "feature", ".", "Data", "must", "be", "a", "DataFeature", "object", "." ]
def __setitem__(self, feature, data): """ Set `data` for `feature`. `Data` must be a DataFeature object. Parameters ---------- feature: str Name of feature/model. data : DataFeature DataFeature with the data for `feature`. Raises ...
[ "def", "__setitem__", "(", "self", ",", "feature", ",", "data", ")", ":", "if", "not", "isinstance", "(", "data", ",", "DataFeature", ")", ":", "raise", "ValueError", "(", "\"data must be of type DataFeature\"", ")", "self", ".", "data", "[", "feature", "]",...
https://github.com/simetenn/uncertainpy/blob/ffb2400289743066265b9a8561cdf3b72e478a28/src/uncertainpy/data.py#L542-L560
keiffster/program-y
8c99b56f8c32f01a7b9887b5daae9465619d0385
src/programy/brain.py
python
Brain.reload_set
(self, setname)
[]
def reload_set(self, setname): if self._sets_collection.contains(setname): self._sets_collection.reload(self.bot.client.storage_factory, setname) else: YLogger.error(self, "Unknown set name [%s], unable to reload ", setname)
[ "def", "reload_set", "(", "self", ",", "setname", ")", ":", "if", "self", ".", "_sets_collection", ".", "contains", "(", "setname", ")", ":", "self", ".", "_sets_collection", ".", "reload", "(", "self", ".", "bot", ".", "client", ".", "storage_factory", ...
https://github.com/keiffster/program-y/blob/8c99b56f8c32f01a7b9887b5daae9465619d0385/src/programy/brain.py#L306-L310
kuri65536/python-for-android
26402a08fc46b09ef94e8d7a6bbc3a54ff9d0891
python-modules/twisted/twisted/protocols/amp.py
python
IBoxReceiver.ampBoxReceived
(box)
A box was received from the transport; dispatch it appropriately.
A box was received from the transport; dispatch it appropriately.
[ "A", "box", "was", "received", "from", "the", "transport", ";", "dispatch", "it", "appropriately", "." ]
def ampBoxReceived(box): """ A box was received from the transport; dispatch it appropriately. """
[ "def", "ampBoxReceived", "(", "box", ")", ":" ]
https://github.com/kuri65536/python-for-android/blob/26402a08fc46b09ef94e8d7a6bbc3a54ff9d0891/python-modules/twisted/twisted/protocols/amp.py#L326-L329
robotlearn/pyrobolearn
9cd7c060723fda7d2779fa255ac998c2c82b8436
pyrobolearn/template_models/slip2d.py
python
SLIP2D.free_rise
(self, X_TO, dt=1e-3)
return T_rise, X_apex, T, X_traj
Free rise flight phase. Args: X_TO (np.array): take off state Returns: float: rising time float[4]: apex state (pos and vel) float[T]: time trajectory float[4,T]: state trajectory
Free rise flight phase.
[ "Free", "rise", "flight", "phase", "." ]
def free_rise(self, X_TO, dt=1e-3): """ Free rise flight phase. Args: X_TO (np.array): take off state Returns: float: rising time float[4]: apex state (pos and vel) float[T]: time trajectory float[4,T]: state trajectory ...
[ "def", "free_rise", "(", "self", ",", "X_TO", ",", "dt", "=", "1e-3", ")", ":", "x", ",", "y", ",", "dx", ",", "dy", "=", "X_TO", "# get total time and distance to rise", "T_rise", "=", "dy", "/", "self", ".", "g", "y_rise", "=", "0.5", "*", "self", ...
https://github.com/robotlearn/pyrobolearn/blob/9cd7c060723fda7d2779fa255ac998c2c82b8436/pyrobolearn/template_models/slip2d.py#L405-L435
sharpdeep/WxRobot
7598124f914e21647c45f0749dda71fa05a6e331
WxRobot/webwxapi.py
python
WebWxAPI._str2QRMat
(self, str)
return mat
[]
def _str2QRMat(self, str): qr = qrcode.QRCode() qr.border = 1 qr.add_data(str) mat = qr.get_matrix() return mat
[ "def", "_str2QRMat", "(", "self", ",", "str", ")", ":", "qr", "=", "qrcode", ".", "QRCode", "(", ")", "qr", ".", "border", "=", "1", "qr", ".", "add_data", "(", "str", ")", "mat", "=", "qr", ".", "get_matrix", "(", ")", "return", "mat" ]
https://github.com/sharpdeep/WxRobot/blob/7598124f914e21647c45f0749dda71fa05a6e331/WxRobot/webwxapi.py#L504-L509
openshift/openshift-tools
1188778e728a6e4781acf728123e5b356380fe6f
openshift/installer/vendored/openshift-ansible-3.10.0-0.29.0/roles/lib_openshift/src/class/oc_serviceaccount.py
python
OCServiceAccount.get
(self)
return result
return volume information
return volume information
[ "return", "volume", "information" ]
def get(self): '''return volume information ''' result = self._get(self.kind, self.config.name) if result['returncode'] == 0: self.service_account = ServiceAccount(content=result['results'][0]) elif '\"%s\" not found' % self.config.name in result['stderr']: result...
[ "def", "get", "(", "self", ")", ":", "result", "=", "self", ".", "_get", "(", "self", ".", "kind", ",", "self", ".", "config", ".", "name", ")", "if", "result", "[", "'returncode'", "]", "==", "0", ":", "self", ".", "service_account", "=", "Service...
https://github.com/openshift/openshift-tools/blob/1188778e728a6e4781acf728123e5b356380fe6f/openshift/installer/vendored/openshift-ansible-3.10.0-0.29.0/roles/lib_openshift/src/class/oc_serviceaccount.py#L26-L35
python-telegram-bot/python-telegram-bot
ade1529986f5b6d394a65372d6a27045a70725b2
examples/paymentbot.py
python
start_without_shipping_callback
(update: Update, context: CallbackContext)
Sends an invoice without shipping-payment.
Sends an invoice without shipping-payment.
[ "Sends", "an", "invoice", "without", "shipping", "-", "payment", "." ]
def start_without_shipping_callback(update: Update, context: CallbackContext) -> None: """Sends an invoice without shipping-payment.""" chat_id = update.message.chat_id title = "Payment Example" description = "Payment Example using python-telegram-bot" # select a payload just for you to recognize it...
[ "def", "start_without_shipping_callback", "(", "update", ":", "Update", ",", "context", ":", "CallbackContext", ")", "->", "None", ":", "chat_id", "=", "update", ".", "message", ".", "chat_id", "title", "=", "\"Payment Example\"", "description", "=", "\"Payment Ex...
https://github.com/python-telegram-bot/python-telegram-bot/blob/ade1529986f5b6d394a65372d6a27045a70725b2/examples/paymentbot.py#L72-L91
tomplus/kubernetes_asyncio
f028cc793e3a2c519be6a52a49fb77ff0b014c9b
kubernetes_asyncio/client/models/v1_replica_set_status.py
python
V1ReplicaSetStatus.conditions
(self, conditions)
Sets the conditions of this V1ReplicaSetStatus. Represents the latest available observations of a replica set's current state. # noqa: E501 :param conditions: The conditions of this V1ReplicaSetStatus. # noqa: E501 :type: list[V1ReplicaSetCondition]
Sets the conditions of this V1ReplicaSetStatus.
[ "Sets", "the", "conditions", "of", "this", "V1ReplicaSetStatus", "." ]
def conditions(self, conditions): """Sets the conditions of this V1ReplicaSetStatus. Represents the latest available observations of a replica set's current state. # noqa: E501 :param conditions: The conditions of this V1ReplicaSetStatus. # noqa: E501 :type: list[V1ReplicaSetConditio...
[ "def", "conditions", "(", "self", ",", "conditions", ")", ":", "self", ".", "_conditions", "=", "conditions" ]
https://github.com/tomplus/kubernetes_asyncio/blob/f028cc793e3a2c519be6a52a49fb77ff0b014c9b/kubernetes_asyncio/client/models/v1_replica_set_status.py#L114-L123
Map-A-Droid/MAD
81375b5c9ccc5ca3161eb487aa81469d40ded221
mapadroid/madmin/routes/event.py
python
MADminEvent.events
(self)
return render_template('events.html', title="MAD Events", time=self._args.madmin_time, responsive=str(self._args.madmin_noresponsive).lower())
[]
def events(self): return render_template('events.html', title="MAD Events", time=self._args.madmin_time, responsive=str(self._args.madmin_noresponsive).lower())
[ "def", "events", "(", "self", ")", ":", "return", "render_template", "(", "'events.html'", ",", "title", "=", "\"MAD Events\"", ",", "time", "=", "self", ".", "_args", ".", "madmin_time", ",", "responsive", "=", "str", "(", "self", ".", "_args", ".", "ma...
https://github.com/Map-A-Droid/MAD/blob/81375b5c9ccc5ca3161eb487aa81469d40ded221/mapadroid/madmin/routes/event.py#L58-L61
uber-research/ape-x
93c6841a06ee2e6cf55371251ebd6176e0d5e52e
tf_util.py
python
lengths_to_mask
(lengths_b, max_length)
return mask_bt
Turns a vector of lengths into a boolean mask Args: lengths_b: an integer vector of lengths max_length: maximum length to fill the mask Returns: a boolean array of shape (batch_size, max_length) row[i] consists of True repeated lengths_b[i] times, followed by False
Turns a vector of lengths into a boolean mask
[ "Turns", "a", "vector", "of", "lengths", "into", "a", "boolean", "mask" ]
def lengths_to_mask(lengths_b, max_length): """ Turns a vector of lengths into a boolean mask Args: lengths_b: an integer vector of lengths max_length: maximum length to fill the mask Returns: a boolean array of shape (batch_size, max_length) row[i] consists of True rep...
[ "def", "lengths_to_mask", "(", "lengths_b", ",", "max_length", ")", ":", "lengths_b", "=", "tf", ".", "convert_to_tensor", "(", "lengths_b", ")", "assert", "lengths_b", ".", "get_shape", "(", ")", ".", "ndims", "==", "1", "mask_bt", "=", "tf", ".", "expand...
https://github.com/uber-research/ape-x/blob/93c6841a06ee2e6cf55371251ebd6176e0d5e52e/tf_util.py#L645-L660
TheSouthFrog/stylealign
910632d2fccc9db61b00c265ae18a88913113c1d
pytorch_code/networks.py
python
ResBlocks.forward
(self, x)
return self.model(x)
[]
def forward(self, x): return self.model(x)
[ "def", "forward", "(", "self", ",", "x", ")", ":", "return", "self", ".", "model", "(", "x", ")" ]
https://github.com/TheSouthFrog/stylealign/blob/910632d2fccc9db61b00c265ae18a88913113c1d/pytorch_code/networks.py#L256-L257
veusz/veusz
5a1e2af5f24df0eb2a2842be51f2997c4999c7fb
veusz/setting/setting.py
python
DatasetExtended.isDataset
(self, doc)
return (isinstance(self.val, str) and doc.data.get(self.val))
Is this setting a dataset?
Is this setting a dataset?
[ "Is", "this", "setting", "a", "dataset?" ]
def isDataset(self, doc): """Is this setting a dataset?""" return (isinstance(self.val, str) and doc.data.get(self.val))
[ "def", "isDataset", "(", "self", ",", "doc", ")", ":", "return", "(", "isinstance", "(", "self", ".", "val", ",", "str", ")", "and", "doc", ".", "data", ".", "get", "(", "self", ".", "val", ")", ")" ]
https://github.com/veusz/veusz/blob/5a1e2af5f24df0eb2a2842be51f2997c4999c7fb/veusz/setting/setting.py#L1285-L1288
arizvisa/ida-minsc
8627a60f047b5e55d3efeecde332039cd1a16eea
base/function.py
python
block.color
(cls, bb, none)
return res
Removes the color of the basic block `bb`.
Removes the color of the basic block `bb`.
[ "Removes", "the", "color", "of", "the", "basic", "block", "bb", "." ]
def color(cls, bb, none): '''Removes the color of the basic block `bb`.''' clr_node_info = idaapi.clr_node_info2 if idaapi.__version__ < 7.0 else idaapi.clr_node_info res, fn = cls.color(bb), by_address(interface.range.start(bb)) try: clr_node_info(interface.range.start(fn), bb.id, idaa...
[ "def", "color", "(", "cls", ",", "bb", ",", "none", ")", ":", "clr_node_info", "=", "idaapi", ".", "clr_node_info2", "if", "idaapi", ".", "__version__", "<", "7.0", "else", "idaapi", ".", "clr_node_info", "res", ",", "fn", "=", "cls", ".", "color", "("...
https://github.com/arizvisa/ida-minsc/blob/8627a60f047b5e55d3efeecde332039cd1a16eea/base/function.py#L1411-L1423
IntelPython/sdc
1ebf55c00ef38dfbd401a70b3945e352a5a38b87
docs/source/buildscripts/module_info.py
python
_class_logging
(s)
return
[]
def _class_logging(s): if ENABLE_LOGGING: logging.debug('[CLASS]' + s) return
[ "def", "_class_logging", "(", "s", ")", ":", "if", "ENABLE_LOGGING", ":", "logging", ".", "debug", "(", "'[CLASS]'", "+", "s", ")", "return" ]
https://github.com/IntelPython/sdc/blob/1ebf55c00ef38dfbd401a70b3945e352a5a38b87/docs/source/buildscripts/module_info.py#L60-L63
bayespy/bayespy
0e6e6130c888a4295cc9421d61d4ad27b2960ebb
bayespy/inference/vmp/nodes/point_estimate.py
python
DeltaMoments.compute_dims_from_values
(self, x)
return ((),)
r""" Return the shape of the moments for a fixed value.
r""" Return the shape of the moments for a fixed value.
[ "r", "Return", "the", "shape", "of", "the", "moments", "for", "a", "fixed", "value", "." ]
def compute_dims_from_values(self, x): r""" Return the shape of the moments for a fixed value. """ return ((),)
[ "def", "compute_dims_from_values", "(", "self", ",", "x", ")", ":", "return", "(", "(", ")", ",", ")" ]
https://github.com/bayespy/bayespy/blob/0e6e6130c888a4295cc9421d61d4ad27b2960ebb/bayespy/inference/vmp/nodes/point_estimate.py#L28-L32
pyexcel/pyexcel
c1c99d4724e5c2adc6b714116a050287e07e1835
pyexcel/internal/sheets/row.py
python
Row.__iadd__
(self, other)
return self
Overload += sign :return: self
Overload += sign
[ "Overload", "+", "=", "sign" ]
def __iadd__(self, other): """Overload += sign :return: self """ if isinstance(other, compact.OrderedDict): self._ref.extend_rows(copy.deepcopy(other)) elif isinstance(other, list): self._ref.extend_rows(copy.deepcopy(other)) elif hasattr(other, "...
[ "def", "__iadd__", "(", "self", ",", "other", ")", ":", "if", "isinstance", "(", "other", ",", "compact", ".", "OrderedDict", ")", ":", "self", ".", "_ref", ".", "extend_rows", "(", "copy", ".", "deepcopy", "(", "other", ")", ")", "elif", "isinstance",...
https://github.com/pyexcel/pyexcel/blob/c1c99d4724e5c2adc6b714116a050287e07e1835/pyexcel/internal/sheets/row.py#L208-L221
TencentCloud/tencentcloud-sdk-python
3677fd1cdc8c5fd626ce001c13fd3b59d1f279d2
tencentcloud/ckafka/v20190819/ckafka_client.py
python
CkafkaClient.DescribeInstances
(self, request)
本接口(DescribeInstance)用于在用户账户下获取消息队列 CKafka 实例列表 :param request: Request instance for DescribeInstances. :type request: :class:`tencentcloud.ckafka.v20190819.models.DescribeInstancesRequest` :rtype: :class:`tencentcloud.ckafka.v20190819.models.DescribeInstancesResponse`
本接口(DescribeInstance)用于在用户账户下获取消息队列 CKafka 实例列表
[ "本接口(DescribeInstance)用于在用户账户下获取消息队列", "CKafka", "实例列表" ]
def DescribeInstances(self, request): """本接口(DescribeInstance)用于在用户账户下获取消息队列 CKafka 实例列表 :param request: Request instance for DescribeInstances. :type request: :class:`tencentcloud.ckafka.v20190819.models.DescribeInstancesRequest` :rtype: :class:`tencentcloud.ckafka.v20190819.models.Des...
[ "def", "DescribeInstances", "(", "self", ",", "request", ")", ":", "try", ":", "params", "=", "request", ".", "_serialize", "(", ")", "body", "=", "self", ".", "call", "(", "\"DescribeInstances\"", ",", "params", ")", "response", "=", "json", ".", "loads...
https://github.com/TencentCloud/tencentcloud-sdk-python/blob/3677fd1cdc8c5fd626ce001c13fd3b59d1f279d2/tencentcloud/ckafka/v20190819/ckafka_client.py#L701-L726
securesystemslab/zippy
ff0e84ac99442c2c55fe1d285332cfd4e185e089
zippy/lib-python/3/tkinter/__init__.py
python
image_types
()
return _default_root.tk.call('image', 'types')
[]
def image_types(): return _default_root.tk.call('image', 'types')
[ "def", "image_types", "(", ")", ":", "return", "_default_root", ".", "tk", ".", "call", "(", "'image'", ",", "'types'", ")" ]
https://github.com/securesystemslab/zippy/blob/ff0e84ac99442c2c55fe1d285332cfd4e185e089/zippy/lib-python/3/tkinter/__init__.py#L3290-L3290
brython-dev/brython
9cba5fb7f43a9b52fff13e89b403e02a1dfaa5f3
www/src/Lib/quopri.py
python
decode
(input, output, header=False)
Read 'input', apply quoted-printable decoding, and write to 'output'. 'input' and 'output' are binary file objects. If 'header' is true, decode underscore as space (per RFC 1522).
Read 'input', apply quoted-printable decoding, and write to 'output'. 'input' and 'output' are binary file objects. If 'header' is true, decode underscore as space (per RFC 1522).
[ "Read", "input", "apply", "quoted", "-", "printable", "decoding", "and", "write", "to", "output", ".", "input", "and", "output", "are", "binary", "file", "objects", ".", "If", "header", "is", "true", "decode", "underscore", "as", "space", "(", "per", "RFC"...
def decode(input, output, header=False): """Read 'input', apply quoted-printable decoding, and write to 'output'. 'input' and 'output' are binary file objects. If 'header' is true, decode underscore as space (per RFC 1522).""" if a2b_qp is not None: data = input.read() odata = a2b_qp(da...
[ "def", "decode", "(", "input", ",", "output", ",", "header", "=", "False", ")", ":", "if", "a2b_qp", "is", "not", "None", ":", "data", "=", "input", ".", "read", "(", ")", "odata", "=", "a2b_qp", "(", "data", ",", "header", "=", "header", ")", "o...
https://github.com/brython-dev/brython/blob/9cba5fb7f43a9b52fff13e89b403e02a1dfaa5f3/www/src/Lib/quopri.py#L117-L158
mfarragher/appelpy
6ba8b123abb8b4e9d5968841b8ce9eb5088d763b
appelpy/utils.py
python
InteractionEncoder.transform
(self)
return processed_df
Encode interactions between variables. Returns: pd.DataFrame: dataframe with interaction effects added.
Encode interactions between variables.
[ "Encode", "interactions", "between", "variables", "." ]
def transform(self): """Encode interactions between variables. Returns: pd.DataFrame: dataframe with interaction effects added. """ # Initialize dataframe processed_df = self._df.copy() # Iterate the generation of interaction cols through each pair of cols:...
[ "def", "transform", "(", "self", ")", ":", "# Initialize dataframe", "processed_df", "=", "self", ".", "_df", ".", "copy", "(", ")", "# Iterate the generation of interaction cols through each pair of cols:", "for", "col_name", ",", "cols_to_interact_list", "in", "self", ...
https://github.com/mfarragher/appelpy/blob/6ba8b123abb8b4e9d5968841b8ce9eb5088d763b/appelpy/utils.py#L279-L468
biopython/biopython
2dd97e71762af7b046d7f7f8a4f1e38db6b06c86
Bio/PDB/Atom.py
python
Atom.__sub__
(self, other)
return np.sqrt(np.dot(diff, diff))
Calculate distance between two atoms. :param other: the other atom :type other: L{Atom} Examples -------- This is an incomplete but illustrative example:: distance = atom1 - atom2
Calculate distance between two atoms.
[ "Calculate", "distance", "between", "two", "atoms", "." ]
def __sub__(self, other): """Calculate distance between two atoms. :param other: the other atom :type other: L{Atom} Examples -------- This is an incomplete but illustrative example:: distance = atom1 - atom2 """ diff = self.coord - other.c...
[ "def", "__sub__", "(", "self", ",", "other", ")", ":", "diff", "=", "self", ".", "coord", "-", "other", ".", "coord", "return", "np", ".", "sqrt", "(", "np", ".", "dot", "(", "diff", ",", "diff", ")", ")" ]
https://github.com/biopython/biopython/blob/2dd97e71762af7b046d7f7f8a4f1e38db6b06c86/Bio/PDB/Atom.py#L249-L263
xillwillx/skiptracer
fbc1f8c88907db3014c6c64d08b7ded814a9c172
src/skiptracer/plugins/advance_background_checks/__init__.py
python
AdvanceBackgroundGrabber.grab_phone
(self, information)
Create phone number format
Create phone number format
[ "Create", "phone", "number", "format" ]
def grab_phone(self, information): """ Create phone number format """ try: self.num = self.makephone(information) if self.num is None: return self.url = "https://www.advancedbackgroundchecks.com/{}".format( self.num) ...
[ "def", "grab_phone", "(", "self", ",", "information", ")", ":", "try", ":", "self", ".", "num", "=", "self", ".", "makephone", "(", "information", ")", "if", "self", ".", "num", "is", "None", ":", "return", "self", ".", "url", "=", "\"https://www.advan...
https://github.com/xillwillx/skiptracer/blob/fbc1f8c88907db3014c6c64d08b7ded814a9c172/src/skiptracer/plugins/advance_background_checks/__init__.py#L117-L137
CGATOxford/cgat
326aad4694bdfae8ddc194171bb5d73911243947
obsolete/pipeline_rmaa.py
python
reportBestParams
(infiles, outfile)
report the best parameters.
report the best parameters.
[ "report", "the", "best", "parameters", "." ]
def reportBestParams(infiles, outfile): '''report the best parameters.''' bestfile = '' bestnumb = 0 outf = open(outfile, 'w') numbs = {} fdr = PARAMS["fdr"] for infile in infiles: pref = infile.rsplit('.',1)[0] numbs[pref] = numbs.get( pref, 0 ) numb = 0 wit...
[ "def", "reportBestParams", "(", "infiles", ",", "outfile", ")", ":", "bestfile", "=", "''", "bestnumb", "=", "0", "outf", "=", "open", "(", "outfile", ",", "'w'", ")", "numbs", "=", "{", "}", "fdr", "=", "PARAMS", "[", "\"fdr\"", "]", "for", "infile"...
https://github.com/CGATOxford/cgat/blob/326aad4694bdfae8ddc194171bb5d73911243947/obsolete/pipeline_rmaa.py#L892-L928
vita-epfl/monoloco
f5e82c48e8ee5af352f2c9b1690050f4e02fc1b6
monoloco/eval/eval_kitti.py
python
EvalKitti.update_errors
(self, dd, dd_gt, cat, errors)
Compute and save errors between a single box and the gt box which match
Compute and save errors between a single box and the gt box which match
[ "Compute", "and", "save", "errors", "between", "a", "single", "box", "and", "the", "gt", "box", "which", "match" ]
def update_errors(self, dd, dd_gt, cat, errors): """Compute and save errors between a single box and the gt box which match""" diff = abs(dd - dd_gt) clst = find_cluster(dd_gt, self.CLUSTERS[4:]) errors['all'].append(diff) errors[cat].append(diff) errors[clst].append(diff...
[ "def", "update_errors", "(", "self", ",", "dd", ",", "dd_gt", ",", "cat", ",", "errors", ")", ":", "diff", "=", "abs", "(", "dd", "-", "dd_gt", ")", "clst", "=", "find_cluster", "(", "dd_gt", ",", "self", ".", "CLUSTERS", "[", "4", ":", "]", ")",...
https://github.com/vita-epfl/monoloco/blob/f5e82c48e8ee5af352f2c9b1690050f4e02fc1b6/monoloco/eval/eval_kitti.py#L243-L265
larryhastings/gilectomy
4315ec3f1d6d4f813cc82ce27a24e7f784dbfc1a
Lib/json/encoder.py
python
py_encode_basestring
(s)
return '"' + ESCAPE.sub(replace, s) + '"'
Return a JSON representation of a Python string
Return a JSON representation of a Python string
[ "Return", "a", "JSON", "representation", "of", "a", "Python", "string" ]
def py_encode_basestring(s): """Return a JSON representation of a Python string """ def replace(match): return ESCAPE_DCT[match.group(0)] return '"' + ESCAPE.sub(replace, s) + '"'
[ "def", "py_encode_basestring", "(", "s", ")", ":", "def", "replace", "(", "match", ")", ":", "return", "ESCAPE_DCT", "[", "match", ".", "group", "(", "0", ")", "]", "return", "'\"'", "+", "ESCAPE", ".", "sub", "(", "replace", ",", "s", ")", "+", "'...
https://github.com/larryhastings/gilectomy/blob/4315ec3f1d6d4f813cc82ce27a24e7f784dbfc1a/Lib/json/encoder.py#L36-L42
smart-on-fhir/client-py
6047277daa31f10931e44ed19e92128298cdb64b
fhirclient/models/plandefinition.py
python
PlanDefinition.__init__
(self, jsondict=None, strict=True)
Initialize all valid properties. :raises: FHIRValidationError on validation errors, unless strict is False :param dict jsondict: A JSON dictionary to use for initialization :param bool strict: If True (the default), invalid variables will raise a TypeError
Initialize all valid properties. :raises: FHIRValidationError on validation errors, unless strict is False :param dict jsondict: A JSON dictionary to use for initialization :param bool strict: If True (the default), invalid variables will raise a TypeError
[ "Initialize", "all", "valid", "properties", ".", ":", "raises", ":", "FHIRValidationError", "on", "validation", "errors", "unless", "strict", "is", "False", ":", "param", "dict", "jsondict", ":", "A", "JSON", "dictionary", "to", "use", "for", "initialization", ...
def __init__(self, jsondict=None, strict=True): """ Initialize all valid properties. :raises: FHIRValidationError on validation errors, unless strict is False :param dict jsondict: A JSON dictionary to use for initialization :param bool strict: If True (the default), invalid var...
[ "def", "__init__", "(", "self", ",", "jsondict", "=", "None", ",", "strict", "=", "True", ")", ":", "self", ".", "action", "=", "None", "\"\"\" Action defined by the plan.\n List of `PlanDefinitionAction` items (represented as `dict` in JSON). \"\"\"", "self", ".", ...
https://github.com/smart-on-fhir/client-py/blob/6047277daa31f10931e44ed19e92128298cdb64b/fhirclient/models/plandefinition.py#L22-L159
Pylons/pylons
8625d5af790560219c5114358611bc7e0edcf12f
scripts/go-pylons.py
python
resolve_interpreter
(exe)
return exe
If the executable given isn't an absolute path, search $PATH for the interpreter
If the executable given isn't an absolute path, search $PATH for the interpreter
[ "If", "the", "executable", "given", "isn", "t", "an", "absolute", "path", "search", "$PATH", "for", "the", "interpreter" ]
def resolve_interpreter(exe): """ If the executable given isn't an absolute path, search $PATH for the interpreter """ # If the "executable" is a version number, get the installed executable for # that version python_versions = get_installed_pythons() if exe in python_versions: exe =...
[ "def", "resolve_interpreter", "(", "exe", ")", ":", "# If the \"executable\" is a version number, get the installed executable for", "# that version", "python_versions", "=", "get_installed_pythons", "(", ")", "if", "exe", "in", "python_versions", ":", "exe", "=", "python_ver...
https://github.com/Pylons/pylons/blob/8625d5af790560219c5114358611bc7e0edcf12f/scripts/go-pylons.py#L1585-L1607
mcw0/PoC
ef712a507a7330f78331997f190717fac9029a9c
Realtek-RTL83xx-PoC.py
python
RTK_RTL83xx.add_user
(self,target)
return False
[]
def add_user(self,target): self.target = target add = log.progress("Adding credentials") if not self.target['exploit']['priv15_account']['vulnerable']: add.failure("Not listed as vulnerable") if self.target['exploit']['stack_cgi_add_account']['vulnerable']: return self.stack_add_account(self.target) ...
[ "def", "add_user", "(", "self", ",", "target", ")", ":", "self", ".", "target", "=", "target", "add", "=", "log", ".", "progress", "(", "\"Adding credentials\"", ")", "if", "not", "self", ".", "target", "[", "'exploit'", "]", "[", "'priv15_account'", "]"...
https://github.com/mcw0/PoC/blob/ef712a507a7330f78331997f190717fac9029a9c/Realtek-RTL83xx-PoC.py#L7434-L7488
lad1337/XDM
0c1b7009fe00f06f102a6f67c793478f515e7efe
site-packages/logilab/common/ureports/__init__.py
python
BaseWriter.begin_format
(self, layout)
begin to format a layout
begin to format a layout
[ "begin", "to", "format", "a", "layout" ]
def begin_format(self, layout): """begin to format a layout""" self.section = 0
[ "def", "begin_format", "(", "self", ",", "layout", ")", ":", "self", ".", "section", "=", "0" ]
https://github.com/lad1337/XDM/blob/0c1b7009fe00f06f102a6f67c793478f515e7efe/site-packages/logilab/common/ureports/__init__.py#L115-L117
fossasia/x-mario-center
fe67afe28d995dcf4e2498e305825a4859566172
softwarecenter/db/database.py
python
StoreDatabase.get_iconname
(self, doc)
return iconname
Return the iconname from the xapian document
Return the iconname from the xapian document
[ "Return", "the", "iconname", "from", "the", "xapian", "document" ]
def get_iconname(self, doc): """ Return the iconname from the xapian document """ iconname = doc.get_value(XapianValues.ICON) return iconname
[ "def", "get_iconname", "(", "self", ",", "doc", ")", ":", "iconname", "=", "doc", ".", "get_value", "(", "XapianValues", ".", "ICON", ")", "return", "iconname" ]
https://github.com/fossasia/x-mario-center/blob/fe67afe28d995dcf4e2498e305825a4859566172/softwarecenter/db/database.py#L454-L457
edisonlz/fastor
342078a18363ac41d3c6b1ab29dbdd44fdb0b7b3
base/site-packages/django/contrib/admin/validation.py
python
ModelAdminValidator.validate_list_max_show_all
(self, cls, model)
Validate that list_max_show_all is an integer.
Validate that list_max_show_all is an integer.
[ "Validate", "that", "list_max_show_all", "is", "an", "integer", "." ]
def validate_list_max_show_all(self, cls, model): " Validate that list_max_show_all is an integer. " check_type(cls, 'list_max_show_all', int)
[ "def", "validate_list_max_show_all", "(", "self", ",", "cls", ",", "model", ")", ":", "check_type", "(", "cls", ",", "'list_max_show_all'", ",", "int", ")" ]
https://github.com/edisonlz/fastor/blob/342078a18363ac41d3c6b1ab29dbdd44fdb0b7b3/base/site-packages/django/contrib/admin/validation.py#L325-L327
JaniceWuo/MovieRecommend
4c86db64ca45598917d304f535413df3bc9fea65
movierecommend/venv1/Lib/site-packages/django/contrib/auth/hashers.py
python
BasePasswordHasher.verify
(self, password, encoded)
Checks if the given password is correct
Checks if the given password is correct
[ "Checks", "if", "the", "given", "password", "is", "correct" ]
def verify(self, password, encoded): """ Checks if the given password is correct """ raise NotImplementedError('subclasses of BasePasswordHasher must provide a verify() method')
[ "def", "verify", "(", "self", ",", "password", ",", "encoded", ")", ":", "raise", "NotImplementedError", "(", "'subclasses of BasePasswordHasher must provide a verify() method'", ")" ]
https://github.com/JaniceWuo/MovieRecommend/blob/4c86db64ca45598917d304f535413df3bc9fea65/movierecommend/venv1/Lib/site-packages/django/contrib/auth/hashers.py#L200-L204
Jiramew/spoon
a301f8e9fe6956b44b02861a3931143b987693b0
spoon_server/proxy/listende_provider.py
python
ListendeProvider.getter
(self)
[]
def getter(self): for url in self.url_list: response = get_html(url) key_pattern = re.compile('''name="fefefsfesf4tzrhtzuh" value="([^"]+)"''') keysearch = re.findall(key_pattern, response) fefefsfesf4tzrhtzuh = keysearch[0] post_data = { ...
[ "def", "getter", "(", "self", ")", ":", "for", "url", "in", "self", ".", "url_list", ":", "response", "=", "get_html", "(", "url", ")", "key_pattern", "=", "re", ".", "compile", "(", "'''name=\"fefefsfesf4tzrhtzuh\" value=\"([^\"]+)\"'''", ")", "keysearch", "=...
https://github.com/Jiramew/spoon/blob/a301f8e9fe6956b44b02861a3931143b987693b0/spoon_server/proxy/listende_provider.py#L18-L44
Fuyukai/OWAPI
c5d7a34e6ac9ab98856ee518404af26a1781811e
owapi/blizz_interface.py
python
_parse_page_lxml
(content: str)
Internal function to parse a page and return the data. This uses raw LXML.
Internal function to parse a page and return the data.
[ "Internal", "function", "to", "parse", "a", "page", "and", "return", "the", "data", "." ]
def _parse_page_lxml(content: str) -> etree._Element: """ Internal function to parse a page and return the data. This uses raw LXML. """ if content and content.lower() != "none": data = etree.HTML(content) return data
[ "def", "_parse_page_lxml", "(", "content", ":", "str", ")", "->", "etree", ".", "_Element", ":", "if", "content", "and", "content", ".", "lower", "(", ")", "!=", "\"none\"", ":", "data", "=", "etree", ".", "HTML", "(", "content", ")", "return", "data" ...
https://github.com/Fuyukai/OWAPI/blob/c5d7a34e6ac9ab98856ee518404af26a1781811e/owapi/blizz_interface.py#L66-L74
huggingface/transformers
623b4f7c63f60cce917677ee704d6c93ee960b4b
src/transformers/utils/dummy_detectron2_objects.py
python
LayoutLMv2Model.from_pretrained
(cls, *args, **kwargs)
[]
def from_pretrained(cls, *args, **kwargs): requires_backends(cls, ["detectron2"])
[ "def", "from_pretrained", "(", "cls", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "requires_backends", "(", "cls", ",", "[", "\"detectron2\"", "]", ")" ]
https://github.com/huggingface/transformers/blob/623b4f7c63f60cce917677ee704d6c93ee960b4b/src/transformers/utils/dummy_detectron2_objects.py#L13-L14
googleanalytics/google-analytics-super-proxy
f5bad82eb1375d222638423e6ae302173a9a7948
src/libs/gviz_api/gviz_api.py
python
DataTable.ToResponse
(self, columns_order=None, order_by=(), tqx="")
Writes the right response according to the request string passed in tqx. This method parses the tqx request string (format of which is defined in the documentation for implementing a data source of Google Visualization), and returns the right response according to the request. It parses out the "out" p...
Writes the right response according to the request string passed in tqx.
[ "Writes", "the", "right", "response", "according", "to", "the", "request", "string", "passed", "in", "tqx", "." ]
def ToResponse(self, columns_order=None, order_by=(), tqx=""): """Writes the right response according to the request string passed in tqx. This method parses the tqx request string (format of which is defined in the documentation for implementing a data source of Google Visualization), and returns the ...
[ "def", "ToResponse", "(", "self", ",", "columns_order", "=", "None", ",", "order_by", "=", "(", ")", ",", "tqx", "=", "\"\"", ")", ":", "tqx_dict", "=", "{", "}", "if", "tqx", ":", "tqx_dict", "=", "dict", "(", "opt", ".", "split", "(", "\":\"", ...
https://github.com/googleanalytics/google-analytics-super-proxy/blob/f5bad82eb1375d222638423e6ae302173a9a7948/src/libs/gviz_api/gviz_api.py#L1044-L1091
rockingdingo/deepnlp
dac9793217e513ec19f1bbcc1c119b0b7bbdb883
deepnlp/parse/parse_model.py
python
NNParser.__init__
(self, config)
Define ANN model for Dependency Parsing Task
Define ANN model for Dependency Parsing Task
[ "Define", "ANN", "model", "for", "Dependency", "Parsing", "Task" ]
def __init__(self, config): '''Define ANN model for Dependency Parsing Task ''' feature_num = config.feature_num feature_word_num = config.feature_word_num feature_pos_num = config.feature_pos_num feature_label_num = config.feature_label_num self._target_...
[ "def", "__init__", "(", "self", ",", "config", ")", ":", "feature_num", "=", "config", ".", "feature_num", "feature_word_num", "=", "config", ".", "feature_word_num", "feature_pos_num", "=", "config", ".", "feature_pos_num", "feature_label_num", "=", "config", "."...
https://github.com/rockingdingo/deepnlp/blob/dac9793217e513ec19f1bbcc1c119b0b7bbdb883/deepnlp/parse/parse_model.py#L79-L140
werwolfby/monitorrent
871dbacf1f668c52bd3f395127d2ba4d5cf5c399
monitorrent/rest/__init__.py
python
JSONTranslator.process_resource
(self, req, resp, resource, params)
set json property on request :type req: MonitorrentRequest :type resp: MonitorrentResponse
set json property on request
[ "set", "json", "property", "on", "request" ]
def process_resource(self, req, resp, resource, params): """ set json property on request :type req: MonitorrentRequest :type resp: MonitorrentResponse """ if req.content_length in (None, 0): return body = req.stream.read() try: r...
[ "def", "process_resource", "(", "self", ",", "req", ",", "resp", ",", "resource", ",", "params", ")", ":", "if", "req", ".", "content_length", "in", "(", "None", ",", "0", ")", ":", "return", "body", "=", "req", ".", "stream", ".", "read", "(", ")"...
https://github.com/werwolfby/monitorrent/blob/871dbacf1f668c52bd3f395127d2ba4d5cf5c399/monitorrent/rest/__init__.py#L48-L66
sagemath/sage
f9b2db94f675ff16963ccdefba4f1a3393b3fe0d
src/sage/rings/function_field/function_field.py
python
FunctionField.order_infinite
(self, x, check=True)
return self.order_infinite_with_basis(tuple(basis), check=check)
Return the order generated by ``x`` over the maximal infinite order. INPUT: - ``x`` -- element or a list of elements of the function field - ``check`` -- boolean; if ``True``, check that ``x`` really generates an order EXAMPLES:: sage: K.<x> = FunctionField(QQ); R.<y> = ...
Return the order generated by ``x`` over the maximal infinite order.
[ "Return", "the", "order", "generated", "by", "x", "over", "the", "maximal", "infinite", "order", "." ]
def order_infinite(self, x, check=True): """ Return the order generated by ``x`` over the maximal infinite order. INPUT: - ``x`` -- element or a list of elements of the function field - ``check`` -- boolean; if ``True``, check that ``x`` really generates an order EXAM...
[ "def", "order_infinite", "(", "self", ",", "x", ",", "check", "=", "True", ")", ":", "if", "not", "isinstance", "(", "x", ",", "(", "list", ",", "tuple", ")", ")", ":", "x", "=", "[", "x", "]", "if", "len", "(", "x", ")", "==", "1", ":", "g...
https://github.com/sagemath/sage/blob/f9b2db94f675ff16963ccdefba4f1a3393b3fe0d/src/sage/rings/function_field/function_field.py#L595-L632
vispy/vispy
26256fdc2574259dd227022fbce0767cae4e244b
vispy/io/datasets.py
python
pack_unit
(value)
return pack
Packs float values between [0,1] into 4 unsigned int8 Returns ------- pack: array packed interpolation kernel
Packs float values between [0,1] into 4 unsigned int8
[ "Packs", "float", "values", "between", "[", "0", "1", "]", "into", "4", "unsigned", "int8" ]
def pack_unit(value): """Packs float values between [0,1] into 4 unsigned int8 Returns ------- pack: array packed interpolation kernel """ pack = np.zeros(value.shape + (4,), dtype=np.ubyte) for i in range(4): value, pack[..., i] = np.modf(value * 256.) return pack
[ "def", "pack_unit", "(", "value", ")", ":", "pack", "=", "np", ".", "zeros", "(", "value", ".", "shape", "+", "(", "4", ",", ")", ",", "dtype", "=", "np", ".", "ubyte", ")", "for", "i", "in", "range", "(", "4", ")", ":", "value", ",", "pack",...
https://github.com/vispy/vispy/blob/26256fdc2574259dd227022fbce0767cae4e244b/vispy/io/datasets.py#L38-L49
Pymol-Scripts/Pymol-script-repo
bcd7bb7812dc6db1595953dfa4471fa15fb68c77
modules/ADT/MolKit/PROSS.py
python
molChain.residues_with_name
(self, *names)
return l
returns named residues as a python list
returns named residues as a python list
[ "returns", "named", "residues", "as", "a", "python", "list" ]
def residues_with_name(self, *names): """returns named residues as a python list""" if len(names) == 0: return l = [] for res in self.elements: if res.name in names: l.append(res) return l
[ "def", "residues_with_name", "(", "self", ",", "*", "names", ")", ":", "if", "len", "(", "names", ")", "==", "0", ":", "return", "l", "=", "[", "]", "for", "res", "in", "self", ".", "elements", ":", "if", "res", ".", "name", "in", "names", ":", ...
https://github.com/Pymol-Scripts/Pymol-script-repo/blob/bcd7bb7812dc6db1595953dfa4471fa15fb68c77/modules/ADT/MolKit/PROSS.py#L753-L761
PowerScript/KatanaFramework
0f6ad90a88de865d58ec26941cb4460501e75496
lib/ftplib/ftplib.py
python
FTP.nlst
(self, *args)
return files
Return a list of files in a given directory (default the current).
Return a list of files in a given directory (default the current).
[ "Return", "a", "list", "of", "files", "in", "a", "given", "directory", "(", "default", "the", "current", ")", "." ]
def nlst(self, *args): '''Return a list of files in a given directory (default the current).''' cmd = 'NLST' for arg in args: cmd = cmd + (' ' + arg) files = [] self.retrlines(cmd, files.append) return files
[ "def", "nlst", "(", "self", ",", "*", "args", ")", ":", "cmd", "=", "'NLST'", "for", "arg", "in", "args", ":", "cmd", "=", "cmd", "+", "(", "' '", "+", "arg", ")", "files", "=", "[", "]", "self", ".", "retrlines", "(", "cmd", ",", "files", "....
https://github.com/PowerScript/KatanaFramework/blob/0f6ad90a88de865d58ec26941cb4460501e75496/lib/ftplib/ftplib.py#L512-L519
wwqgtxx/wwqLyParse
33136508e52821babd9294fdecffbdf02d73a6fc
wwqLyParse/lib/python-3.7.2-embed-amd64/Crypto/Math/Numbers.py
python
_random_range
(**kwargs)
return norm_candidate + min_inclusive
Generate a random integer within a given internal. :Keywords: min_inclusive : integer The lower end of the interval (inclusive). max_inclusive : integer The higher end of the interval (inclusive). max_exclusive : integer The higher end of the interval (exclusive). ra...
Generate a random integer within a given internal.
[ "Generate", "a", "random", "integer", "within", "a", "given", "internal", "." ]
def _random_range(**kwargs): """Generate a random integer within a given internal. :Keywords: min_inclusive : integer The lower end of the interval (inclusive). max_inclusive : integer The higher end of the interval (inclusive). max_exclusive : integer The higher end o...
[ "def", "_random_range", "(", "*", "*", "kwargs", ")", ":", "min_inclusive", "=", "kwargs", ".", "pop", "(", "\"min_inclusive\"", ",", "None", ")", "max_inclusive", "=", "kwargs", ".", "pop", "(", "\"max_inclusive\"", ",", "None", ")", "max_exclusive", "=", ...
https://github.com/wwqgtxx/wwqLyParse/blob/33136508e52821babd9294fdecffbdf02d73a6fc/wwqLyParse/lib/python-3.7.2-embed-amd64/Crypto/Math/Numbers.py#L101-L146
ponty/PyVirtualDisplay
ec8ec5f7ae5503ebfa4af77a7b8048644270129b
pyvirtualdisplay/abstractdisplay.py
python
_search_for_display
()
return display
[]
def _search_for_display(): # search for free display ls = list(map(lambda x: int(x.split("X")[1].split("-")[0]), _lock_files())) if len(ls): display = max(_MIN_DISPLAY_NR, max(ls) + 3) else: display = _MIN_DISPLAY_NR return display
[ "def", "_search_for_display", "(", ")", ":", "# search for free display", "ls", "=", "list", "(", "map", "(", "lambda", "x", ":", "int", "(", "x", ".", "split", "(", "\"X\"", ")", "[", "1", "]", ".", "split", "(", "\"-\"", ")", "[", "0", "]", ")", ...
https://github.com/ponty/PyVirtualDisplay/blob/ec8ec5f7ae5503ebfa4af77a7b8048644270129b/pyvirtualdisplay/abstractdisplay.py#L57-L65
DataBiosphere/toil
2e148eee2114ece8dcc3ec8a83f36333266ece0d
src/toil/provisioners/aws/awsProvisioner.py
python
AWSProvisioner._namespace_name
(self, name: str)
return (self._toNameSpace() + name)[1:].replace('_', '__').replace('/', '_')
Given a name for a thing, add our cluster name to it in a way that results in an acceptable name for something on AWS.
Given a name for a thing, add our cluster name to it in a way that results in an acceptable name for something on AWS.
[ "Given", "a", "name", "for", "a", "thing", "add", "our", "cluster", "name", "to", "it", "in", "a", "way", "that", "results", "in", "an", "acceptable", "name", "for", "something", "on", "AWS", "." ]
def _namespace_name(self, name: str) -> str: """ Given a name for a thing, add our cluster name to it in a way that results in an acceptable name for something on AWS. """ # This logic is a bit weird, but it's what Boto2Context used to use. # Drop the leading / from the ...
[ "def", "_namespace_name", "(", "self", ",", "name", ":", "str", ")", "->", "str", ":", "# This logic is a bit weird, but it's what Boto2Context used to use.", "# Drop the leading / from the absolute-path-style \"namespace\" name and", "# then encode underscores and slashes.", "return",...
https://github.com/DataBiosphere/toil/blob/2e148eee2114ece8dcc3ec8a83f36333266ece0d/src/toil/provisioners/aws/awsProvisioner.py#L955-L964
securesystemslab/zippy
ff0e84ac99442c2c55fe1d285332cfd4e185e089
zippy/lib-python/3/optparse.py
python
OptionError.__init__
(self, msg, option)
[]
def __init__(self, msg, option): self.msg = msg self.option_id = str(option)
[ "def", "__init__", "(", "self", ",", "msg", ",", "option", ")", ":", "self", ".", "msg", "=", "msg", "self", ".", "option_id", "=", "str", "(", "option", ")" ]
https://github.com/securesystemslab/zippy/blob/ff0e84ac99442c2c55fe1d285332cfd4e185e089/zippy/lib-python/3/optparse.py#L110-L112
rwth-i6/returnn
f2d718a197a280b0d5f0fd91a7fcb8658560dddb
returnn/util/basic.py
python
get_ubuntu_major_version
()
return int(float(d["DISTRIB_RELEASE"]))
:rtype: int|None
:rtype: int|None
[ ":", "rtype", ":", "int|None" ]
def get_ubuntu_major_version(): """ :rtype: int|None """ d = get_lsb_release() if d["DISTRIB_ID"] != "Ubuntu": return None return int(float(d["DISTRIB_RELEASE"]))
[ "def", "get_ubuntu_major_version", "(", ")", ":", "d", "=", "get_lsb_release", "(", ")", "if", "d", "[", "\"DISTRIB_ID\"", "]", "!=", "\"Ubuntu\"", ":", "return", "None", "return", "int", "(", "float", "(", "d", "[", "\"DISTRIB_RELEASE\"", "]", ")", ")" ]
https://github.com/rwth-i6/returnn/blob/f2d718a197a280b0d5f0fd91a7fcb8658560dddb/returnn/util/basic.py#L2660-L2667