nwo
stringlengths
5
86
sha
stringlengths
40
40
path
stringlengths
4
189
language
stringclasses
1 value
identifier
stringlengths
1
94
parameters
stringlengths
2
4.03k
argument_list
stringclasses
1 value
return_statement
stringlengths
0
11.5k
docstring
stringlengths
1
33.2k
docstring_summary
stringlengths
0
5.15k
docstring_tokens
list
function
stringlengths
34
151k
function_tokens
list
url
stringlengths
90
278
hughperkins/tf-coriander
970d3df6c11400ad68405f22b0c42a52374e94ca
tensorflow/python/framework/ops.py
python
add_to_collections
(names, value)
Wrapper for `Graph.add_to_collections()` using the default graph. See [`Graph.add_to_collections()`](../../api_docs/python/framework.md#Graph.add_to_collections) for more details. Args: names: The key for the collections. The `GraphKeys` class contains many standard names for collections. value: T...
Wrapper for `Graph.add_to_collections()` using the default graph.
[ "Wrapper", "for", "Graph", ".", "add_to_collections", "()", "using", "the", "default", "graph", "." ]
def add_to_collections(names, value): """Wrapper for `Graph.add_to_collections()` using the default graph. See [`Graph.add_to_collections()`](../../api_docs/python/framework.md#Graph.add_to_collections) for more details. Args: names: The key for the collections. The `GraphKeys` class contains many s...
[ "def", "add_to_collections", "(", "names", ",", "value", ")", ":", "get_default_graph", "(", ")", ".", "add_to_collections", "(", "names", ",", "value", ")" ]
https://github.com/hughperkins/tf-coriander/blob/970d3df6c11400ad68405f22b0c42a52374e94ca/tensorflow/python/framework/ops.py#L4055-L4066
eventql/eventql
7ca0dbb2e683b525620ea30dc40540a22d5eb227
deps/3rdparty/spidermonkey/mozjs/config/expandlibs.py
python
ensureParentDir
(file)
Ensures the directory parent to the given file exists
Ensures the directory parent to the given file exists
[ "Ensures", "the", "directory", "parent", "to", "the", "given", "file", "exists" ]
def ensureParentDir(file): '''Ensures the directory parent to the given file exists''' dir = os.path.dirname(file) if dir and not os.path.exists(dir): try: os.makedirs(dir) except OSError, error: if error.errno != errno.EEXIST: raise
[ "def", "ensureParentDir", "(", "file", ")", ":", "dir", "=", "os", ".", "path", ".", "dirname", "(", "file", ")", "if", "dir", "and", "not", "os", ".", "path", ".", "exists", "(", "dir", ")", ":", "try", ":", "os", ".", "makedirs", "(", "dir", ...
https://github.com/eventql/eventql/blob/7ca0dbb2e683b525620ea30dc40540a22d5eb227/deps/3rdparty/spidermonkey/mozjs/config/expandlibs.py#L33-L41
tensorflow/tensorflow
419e3a6b650ea4bd1b0cba23c4348f8a69f3272e
tensorflow/python/ops/lookup_ops.py
python
InitializableLookupTableBase.default_value
(self)
return self._default_value
The default value of the table.
The default value of the table.
[ "The", "default", "value", "of", "the", "table", "." ]
def default_value(self): """The default value of the table.""" return self._default_value
[ "def", "default_value", "(", "self", ")", ":", "return", "self", ".", "_default_value" ]
https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/ops/lookup_ops.py#L209-L211
Xilinx/Vitis-AI
fc74d404563d9951b57245443c73bef389f3657f
tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/debug/cli/profile_analyzer_cli.py
python
_list_profile_sort_key
(profile_datum, sort_by)
Get a profile_datum property to sort by in list_profile command. Args: profile_datum: A `ProfileDatum` object. sort_by: (string) indicates a value to sort by. Must be one of SORT_BY* constants. Returns: profile_datum property to sort by.
Get a profile_datum property to sort by in list_profile command.
[ "Get", "a", "profile_datum", "property", "to", "sort", "by", "in", "list_profile", "command", "." ]
def _list_profile_sort_key(profile_datum, sort_by): """Get a profile_datum property to sort by in list_profile command. Args: profile_datum: A `ProfileDatum` object. sort_by: (string) indicates a value to sort by. Must be one of SORT_BY* constants. Returns: profile_datum property to sort by. ...
[ "def", "_list_profile_sort_key", "(", "profile_datum", ",", "sort_by", ")", ":", "if", "sort_by", "==", "SORT_OPS_BY_OP_NAME", ":", "return", "profile_datum", ".", "node_exec_stats", ".", "node_name", "elif", "sort_by", "==", "SORT_OPS_BY_OP_TYPE", ":", "return", "p...
https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/debug/cli/profile_analyzer_cli.py#L198-L220
krishauser/Klampt
972cc83ea5befac3f653c1ba20f80155768ad519
Python/klampt/model/coordinates.py
python
Frame.name
(self)
return self._name
Returns the name of this frame
Returns the name of this frame
[ "Returns", "the", "name", "of", "this", "frame" ]
def name(self): """Returns the name of this frame""" return self._name
[ "def", "name", "(", "self", ")", ":", "return", "self", ".", "_name" ]
https://github.com/krishauser/Klampt/blob/972cc83ea5befac3f653c1ba20f80155768ad519/Python/klampt/model/coordinates.py#L45-L47
Evolving-AI-Lab/fooling
66f097dd6bd2eb6794ade3e187a7adfdf1887688
caffe/scripts/cpp_lint.py
python
CheckForFunctionLengths
(filename, clean_lines, linenum, function_state, error)
Reports for long function bodies. For an overview why this is done, see: http://google-styleguide.googlecode.com/svn/trunk/cppguide.xml#Write_Short_Functions Uses a simplistic algorithm assuming other style guidelines (especially spacing) are followed. Only checks unindented functions, so class members are ...
Reports for long function bodies.
[ "Reports", "for", "long", "function", "bodies", "." ]
def CheckForFunctionLengths(filename, clean_lines, linenum, function_state, error): """Reports for long function bodies. For an overview why this is done, see: http://google-styleguide.googlecode.com/svn/trunk/cppguide.xml#Write_Short_Functions Uses a simplistic algorithm assuming ...
[ "def", "CheckForFunctionLengths", "(", "filename", ",", "clean_lines", ",", "linenum", ",", "function_state", ",", "error", ")", ":", "lines", "=", "clean_lines", ".", "lines", "line", "=", "lines", "[", "linenum", "]", "raw", "=", "clean_lines", ".", "raw_l...
https://github.com/Evolving-AI-Lab/fooling/blob/66f097dd6bd2eb6794ade3e187a7adfdf1887688/caffe/scripts/cpp_lint.py#L2314-L2381
krishauser/Klampt
972cc83ea5befac3f653c1ba20f80155768ad519
Python/klampt/model/trajectory.py
python
Trajectory.deriv_state
(self, t: float, endBehavior: str = 'halt')
return self.difference_state(self.milestones[i+1],self.milestones[i],u,self.times[i+1]-self.times[i])
Internal deriv, used on the underlying state representation
Internal deriv, used on the underlying state representation
[ "Internal", "deriv", "used", "on", "the", "underlying", "state", "representation" ]
def deriv_state(self, t: float, endBehavior: str = 'halt') -> Vector: """Internal deriv, used on the underlying state representation""" i,u = self.getSegment(t,endBehavior) if i<0: return [0.0]*len(self.milestones[0]) elif i+1>=len(self.milestones): return [0.0]*len(self.milestones[-1]) ...
[ "def", "deriv_state", "(", "self", ",", "t", ":", "float", ",", "endBehavior", ":", "str", "=", "'halt'", ")", "->", "Vector", ":", "i", ",", "u", "=", "self", ".", "getSegment", "(", "t", ",", "endBehavior", ")", "if", "i", "<", "0", ":", "retur...
https://github.com/krishauser/Klampt/blob/972cc83ea5befac3f653c1ba20f80155768ad519/Python/klampt/model/trajectory.py#L203-L208
mantidproject/mantid
03deeb89254ec4289edb8771e0188c2090a02f32
scripts/SANS/sans/common/xml_parsing.py
python
get_named_elements_from_ipf_file
(ipf_file, names_to_search, value_type)
return output
Gets a named element from the IPF This is useful for detector names etc. :param ipf_file: the path to the IPF :param names_to_search: the names we want to search for on the XML file. :param value_type: the type we expect for the names. :return: a ElementName vs Value map
Gets a named element from the IPF
[ "Gets", "a", "named", "element", "from", "the", "IPF" ]
def get_named_elements_from_ipf_file(ipf_file, names_to_search, value_type): """ Gets a named element from the IPF This is useful for detector names etc. :param ipf_file: the path to the IPF :param names_to_search: the names we want to search for on the XML file. :param value_type: the type we ...
[ "def", "get_named_elements_from_ipf_file", "(", "ipf_file", ",", "names_to_search", ",", "value_type", ")", ":", "\"\"\"\n Args:\n ipf_file: The path to the IPF\n names_to_search: A list of search names\n value_type: the type of an item\n Returns: A map of the search n...
https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/scripts/SANS/sans/common/xml_parsing.py#L18-L50
benoitsteiner/tensorflow-opencl
cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5
tensorflow/python/framework/ops.py
python
Graph.as_graph_def
(self, from_version=None, add_shapes=False)
return result
Returns a serialized `GraphDef` representation of this graph. The serialized `GraphDef` can be imported into another `Graph` (using @{tf.import_graph_def}) or used with the [C++ Session API](../../api_docs/cc/index.md). This method is thread-safe. Args: from_version: Optional. If this is s...
Returns a serialized `GraphDef` representation of this graph.
[ "Returns", "a", "serialized", "GraphDef", "representation", "of", "this", "graph", "." ]
def as_graph_def(self, from_version=None, add_shapes=False): # pylint: disable=line-too-long """Returns a serialized `GraphDef` representation of this graph. The serialized `GraphDef` can be imported into another `Graph` (using @{tf.import_graph_def}) or used with the [C++ Session API](../../api_do...
[ "def", "as_graph_def", "(", "self", ",", "from_version", "=", "None", ",", "add_shapes", "=", "False", ")", ":", "# pylint: disable=line-too-long", "# pylint: enable=line-too-long", "result", ",", "_", "=", "self", ".", "_as_graph_def", "(", "from_version", ",", "...
https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/python/framework/ops.py#L2796-L2823
gem5/gem5
141cc37c2d4b93959d4c249b8f7e6a8b2ef75338
ext/ply/example/BASIC/basparse.py
python
p_dimitem_single
(p)
dimitem : ID LPAREN INTEGER RPAREN
dimitem : ID LPAREN INTEGER RPAREN
[ "dimitem", ":", "ID", "LPAREN", "INTEGER", "RPAREN" ]
def p_dimitem_single(p): '''dimitem : ID LPAREN INTEGER RPAREN''' p[0] = (p[1],eval(p[3]),0)
[ "def", "p_dimitem_single", "(", "p", ")", ":", "p", "[", "0", "]", "=", "(", "p", "[", "1", "]", ",", "eval", "(", "p", "[", "3", "]", ")", ",", "0", ")" ]
https://github.com/gem5/gem5/blob/141cc37c2d4b93959d4c249b8f7e6a8b2ef75338/ext/ply/example/BASIC/basparse.py#L272-L274
FreeCAD/FreeCAD
ba42231b9c6889b89e064d6d563448ed81e376ec
src/Mod/Fem/femtools/ccxtools.py
python
FemToolsCcx.set_base_name
(self, base_name=None)
Set base_name Parameters ---------- base_name : str, optional base_name base name of .inp/.frd file (without extension). It is used to construct .inp file path that is passed to CalculiX ccx
Set base_name
[ "Set", "base_name" ]
def set_base_name(self, base_name=None): """ Set base_name Parameters ---------- base_name : str, optional base_name base name of .inp/.frd file (without extension). It is used to construct .inp file path that is passed to CalculiX ccx """ ...
[ "def", "set_base_name", "(", "self", ",", "base_name", "=", "None", ")", ":", "if", "base_name", "is", "None", ":", "self", ".", "base_name", "=", "\"\"", "else", ":", "self", ".", "base_name", "=", "base_name", "# Update inp file name", "self", ".", "set_...
https://github.com/FreeCAD/FreeCAD/blob/ba42231b9c6889b89e064d6d563448ed81e376ec/src/Mod/Fem/femtools/ccxtools.py#L276-L291
cms-sw/cmssw
fd9de012d503d3405420bcbeec0ec879baa57cf2
Validation/Tools/python/GenObject.py
python
GenObject.encodeNonAlphanumerics
(line)
return GenObject._nonAlphaRE.sub( GenObject.char2ascii, line )
Use a web like encoding of characters that are non-alphanumeric
Use a web like encoding of characters that are non-alphanumeric
[ "Use", "a", "web", "like", "encoding", "of", "characters", "that", "are", "non", "-", "alphanumeric" ]
def encodeNonAlphanumerics (line): """Use a web like encoding of characters that are non-alphanumeric""" return GenObject._nonAlphaRE.sub( GenObject.char2ascii, line )
[ "def", "encodeNonAlphanumerics", "(", "line", ")", ":", "return", "GenObject", ".", "_nonAlphaRE", ".", "sub", "(", "GenObject", ".", "char2ascii", ",", "line", ")" ]
https://github.com/cms-sw/cmssw/blob/fd9de012d503d3405420bcbeec0ec879baa57cf2/Validation/Tools/python/GenObject.py#L128-L130
cvxpy/cvxpy
5165b4fb750dfd237de8659383ef24b4b2e33aaf
cvxpy/atoms/affine/diag.py
python
diag_mat.is_atom_log_log_concave
(self)
return True
Is the atom log-log concave?
Is the atom log-log concave?
[ "Is", "the", "atom", "log", "-", "log", "concave?" ]
def is_atom_log_log_concave(self) -> bool: """Is the atom log-log concave? """ return True
[ "def", "is_atom_log_log_concave", "(", "self", ")", "->", "bool", ":", "return", "True" ]
https://github.com/cvxpy/cvxpy/blob/5165b4fb750dfd237de8659383ef24b4b2e33aaf/cvxpy/atoms/affine/diag.py#L131-L134
polyworld/polyworld
eb7e6bbc82fe77ba79e3bc48c3da2ad8c8238c26
scripts/agent/agent.py
python
Agent.alive_at_timestep
(self, step)
return self.birth < step <= self.death
returns whether the Agent is alive at a given timestep
returns whether the Agent is alive at a given timestep
[ "returns", "whether", "the", "Agent", "is", "alive", "at", "a", "given", "timestep" ]
def alive_at_timestep(self, step): ''' returns whether the Agent is alive at a given timestep ''' return self.birth < step <= self.death
[ "def", "alive_at_timestep", "(", "self", ",", "step", ")", ":", "return", "self", ".", "birth", "<", "step", "<=", "self", ".", "death" ]
https://github.com/polyworld/polyworld/blob/eb7e6bbc82fe77ba79e3bc48c3da2ad8c8238c26/scripts/agent/agent.py#L257-L259
Xilinx/Vitis-AI
fc74d404563d9951b57245443c73bef389f3657f
tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/ops/ragged/ragged_batch_gather_with_default_op.py
python
batch_gather_with_default
(params, indices, default_value='', name=None)
Same as `batch_gather` but inserts `default_value` for invalid indices. This operation is similar to `batch_gather` except that it will substitute the value for invalid indices with `default_value` as the contents. See `batch_gather` for more details. Args: params: A potentially ragged tensor with shape ...
Same as `batch_gather` but inserts `default_value` for invalid indices.
[ "Same", "as", "batch_gather", "but", "inserts", "default_value", "for", "invalid", "indices", "." ]
def batch_gather_with_default(params, indices, default_value='', name=None): """Same as `batch_gather` but inserts `default_value` for invalid indices. This operation is similar to `batch_gather` except that it will substitut...
[ "def", "batch_gather_with_default", "(", "params", ",", "indices", ",", "default_value", "=", "''", ",", "name", "=", "None", ")", ":", "with", "ops", ".", "name_scope", "(", "name", ",", "'RaggedBatchGatherWithDefault'", ")", ":", "params", "=", "ragged_tenso...
https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/ops/ragged/ragged_batch_gather_with_default_op.py#L38-L146
pmq20/node-packer
12c46c6e44fbc14d9ee645ebd17d5296b324f7e0
lts/deps/v8/tools/grokdump.py
python
InspectionShell.do_lm
(self, arg)
return self.do_list_modules(arg)
see list_modules
see list_modules
[ "see", "list_modules" ]
def do_lm(self, arg): """ see list_modules """ return self.do_list_modules(arg)
[ "def", "do_lm", "(", "self", ",", "arg", ")", ":", "return", "self", ".", "do_list_modules", "(", "arg", ")" ]
https://github.com/pmq20/node-packer/blob/12c46c6e44fbc14d9ee645ebd17d5296b324f7e0/lts/deps/v8/tools/grokdump.py#L3686-L3688
mongodb/mongo
d8ff665343ad29cf286ee2cf4a1960d29371937b
buildscripts/blackduck_hub.py
python
BuildloggerServer.post_new_file
(self, build_id, test_name, lines)
return self.handler.make_url(endpoint)
Post a new file to the build logger server.
Post a new file to the build logger server.
[ "Post", "a", "new", "file", "to", "the", "build", "logger", "server", "." ]
def post_new_file(self, build_id, test_name, lines): """Post a new file to the build logger server.""" test_id = self.new_test_id(build_id, test_name, "foo") endpoint = BUILD_LOGGER_APPEND_TEST_LOGS_ENDPOINT % { "build_id": build_id, "test_id": test_id, } ...
[ "def", "post_new_file", "(", "self", ",", "build_id", ",", "test_name", ",", "lines", ")", ":", "test_id", "=", "self", ".", "new_test_id", "(", "build_id", ",", "test_name", ",", "\"foo\"", ")", "endpoint", "=", "BUILD_LOGGER_APPEND_TEST_LOGS_ENDPOINT", "%", ...
https://github.com/mongodb/mongo/blob/d8ff665343ad29cf286ee2cf4a1960d29371937b/buildscripts/blackduck_hub.py#L229-L251
hughperkins/tf-coriander
970d3df6c11400ad68405f22b0c42a52374e94ca
tensorflow/contrib/framework/python/ops/arg_scope.py
python
add_arg_scope
(func)
return func_with_args
Decorates a function with args so it can be used within an arg_scope. Args: func: function to decorate. Returns: A tuple with the decorated function func_with_args().
Decorates a function with args so it can be used within an arg_scope.
[ "Decorates", "a", "function", "with", "args", "so", "it", "can", "be", "used", "within", "an", "arg_scope", "." ]
def add_arg_scope(func): """Decorates a function with args so it can be used within an arg_scope. Args: func: function to decorate. Returns: A tuple with the decorated function func_with_args(). """ @functools.wraps(func) def func_with_args(*args, **kwargs): current_scope = _current_arg_scope(...
[ "def", "add_arg_scope", "(", "func", ")", ":", "@", "functools", ".", "wraps", "(", "func", ")", "def", "func_with_args", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "current_scope", "=", "_current_arg_scope", "(", ")", "current_args", "=", "kwa...
https://github.com/hughperkins/tf-coriander/blob/970d3df6c11400ad68405f22b0c42a52374e94ca/tensorflow/contrib/framework/python/ops/arg_scope.py#L160-L181
eventql/eventql
7ca0dbb2e683b525620ea30dc40540a22d5eb227
deps/3rdparty/spidermonkey/mozjs/media/webrtc/trunk/tools/gyp/pylib/gyp/SCons.py
python
TargetBase.full_product_name
(self)
return name
Returns the full name of the product being built: * Uses 'product_name' if it's set, else prefix + 'target_name'. * Prepends 'product_dir' if set. * Appends SCons suffix variables for the target type (or product_extension).
Returns the full name of the product being built:
[ "Returns", "the", "full", "name", "of", "the", "product", "being", "built", ":" ]
def full_product_name(self): """ Returns the full name of the product being built: * Uses 'product_name' if it's set, else prefix + 'target_name'. * Prepends 'product_dir' if set. * Appends SCons suffix variables for the target type (or product_extension). """ suffix = self.ta...
[ "def", "full_product_name", "(", "self", ")", ":", "suffix", "=", "self", ".", "target_suffix", "product_extension", "=", "self", ".", "spec", ".", "get", "(", "'product_extension'", ")", "if", "product_extension", ":", "suffix", "=", "'.'", "+", "product_exte...
https://github.com/eventql/eventql/blob/7ca0dbb2e683b525620ea30dc40540a22d5eb227/deps/3rdparty/spidermonkey/mozjs/media/webrtc/trunk/tools/gyp/pylib/gyp/SCons.py#L33-L54
neoml-lib/neoml
a0d370fba05269a1b2258cef126f77bbd2054a3e
NeoML/Python/neoml/Dnn/Conv.py
python
TimeConv.free_term
(self)
return Blob.Blob(self._internal.get_free_term())
Gets the free term. The blob size is filter_count.
Gets the free term. The blob size is filter_count.
[ "Gets", "the", "free", "term", ".", "The", "blob", "size", "is", "filter_count", "." ]
def free_term(self): """Gets the free term. The blob size is filter_count. """ return Blob.Blob(self._internal.get_free_term())
[ "def", "free_term", "(", "self", ")", ":", "return", "Blob", ".", "Blob", "(", "self", ".", "_internal", ".", "get_free_term", "(", ")", ")" ]
https://github.com/neoml-lib/neoml/blob/a0d370fba05269a1b2258cef126f77bbd2054a3e/NeoML/Python/neoml/Dnn/Conv.py#L1184-L1187
grpc/grpc
27bc6fe7797e43298dc931b96dc57322d0852a9f
src/python/grpcio/grpc/aio/_base_server.py
python
ServicerContext.time_remaining
(self)
Describes the length of allowed time remaining for the RPC. Returns: A nonnegative float indicating the length of allowed time in seconds remaining for the RPC to complete before it is considered to have timed out, or None if no deadline was specified for the RPC.
Describes the length of allowed time remaining for the RPC.
[ "Describes", "the", "length", "of", "allowed", "time", "remaining", "for", "the", "RPC", "." ]
def time_remaining(self) -> float: """Describes the length of allowed time remaining for the RPC. Returns: A nonnegative float indicating the length of allowed time in seconds remaining for the RPC to complete before it is considered to have timed out, or None if no deadli...
[ "def", "time_remaining", "(", "self", ")", "->", "float", ":" ]
https://github.com/grpc/grpc/blob/27bc6fe7797e43298dc931b96dc57322d0852a9f/src/python/grpcio/grpc/aio/_base_server.py#L304-L311
astra-toolbox/astra-toolbox
1e7ec8af702e595b76654f2e500f4c00344b273f
python/astra/data3d.py
python
clear
()
return d.clear()
Clear all 3D data objects.
Clear all 3D data objects.
[ "Clear", "all", "3D", "data", "objects", "." ]
def clear(): """Clear all 3D data objects.""" return d.clear()
[ "def", "clear", "(", ")", ":", "return", "d", ".", "clear", "(", ")" ]
https://github.com/astra-toolbox/astra-toolbox/blob/1e7ec8af702e595b76654f2e500f4c00344b273f/python/astra/data3d.py#L145-L147
ros-perception/image_pipeline
cd4aa7ab38726d88e8e0144aa0d45ad2f236535a
camera_calibration/src/camera_calibration/calibrator.py
python
MonoCalibrator.cal_fromcorners
(self, good)
:param good: Good corner positions and boards :type good: [(corners, ChessboardInfo)]
:param good: Good corner positions and boards :type good: [(corners, ChessboardInfo)]
[ ":", "param", "good", ":", "Good", "corner", "positions", "and", "boards", ":", "type", "good", ":", "[", "(", "corners", "ChessboardInfo", ")", "]" ]
def cal_fromcorners(self, good): """ :param good: Good corner positions and boards :type good: [(corners, ChessboardInfo)] """ (ipts, ids, boards) = zip(*good) opts = self.mk_object_points(boards) # If FIX_ASPECT_RATIO flag set, enforce focal lengths have 1/1 r...
[ "def", "cal_fromcorners", "(", "self", ",", "good", ")", ":", "(", "ipts", ",", "ids", ",", "boards", ")", "=", "zip", "(", "*", "good", ")", "opts", "=", "self", ".", "mk_object_points", "(", "boards", ")", "# If FIX_ASPECT_RATIO flag set, enforce focal len...
https://github.com/ros-perception/image_pipeline/blob/cd4aa7ab38726d88e8e0144aa0d45ad2f236535a/camera_calibration/src/camera_calibration/calibrator.py#L752-L798
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/scikit-learn/py2/sklearn/externals/funcsigs.py
python
Signature.from_function
(cls, func)
return cls(parameters, return_annotation=annotations.get('return', _empty), __validate_parameters__=False)
Constructs Signature for the given python function
Constructs Signature for the given python function
[ "Constructs", "Signature", "for", "the", "given", "python", "function" ]
def from_function(cls, func): '''Constructs Signature for the given python function''' if not isinstance(func, types.FunctionType): raise TypeError('{0!r} is not a Python function'.format(func)) Parameter = cls._parameter_cls # Parameter information. func_code = fu...
[ "def", "from_function", "(", "cls", ",", "func", ")", ":", "if", "not", "isinstance", "(", "func", ",", "types", ".", "FunctionType", ")", ":", "raise", "TypeError", "(", "'{0!r} is not a Python function'", ".", "format", "(", "func", ")", ")", "Parameter", ...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scikit-learn/py2/sklearn/externals/funcsigs.py#L513-L583
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemDefectReporter/v1/AWS/common-code/Lib/pkg_resources/__init__.py
python
Distribution.activate
(self, path=None, replace=False)
Ensure distribution is importable on `path` (default=sys.path)
Ensure distribution is importable on `path` (default=sys.path)
[ "Ensure", "distribution", "is", "importable", "on", "path", "(", "default", "=", "sys", ".", "path", ")" ]
def activate(self, path=None, replace=False): """Ensure distribution is importable on `path` (default=sys.path)""" if path is None: path = sys.path self.insert_on(path, replace=replace) if path is sys.path: fixup_namespace_packages(self.location) for p...
[ "def", "activate", "(", "self", ",", "path", "=", "None", ",", "replace", "=", "False", ")", ":", "if", "path", "is", "None", ":", "path", "=", "sys", ".", "path", "self", ".", "insert_on", "(", "path", ",", "replace", "=", "replace", ")", "if", ...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemDefectReporter/v1/AWS/common-code/Lib/pkg_resources/__init__.py#L2692-L2701
PX4/PX4-Autopilot
0b9f60a0370be53d683352c63fd92db3d6586e18
platforms/nuttx/NuttX/tools/kconfiglib.py
python
Kconfig.disable_warnings
(self)
See Kconfig.__init__().
See Kconfig.__init__().
[ "See", "Kconfig", ".", "__init__", "()", "." ]
def disable_warnings(self): """ See Kconfig.__init__(). """ self._warnings_enabled = False
[ "def", "disable_warnings", "(", "self", ")", ":", "self", ".", "_warnings_enabled", "=", "False" ]
https://github.com/PX4/PX4-Autopilot/blob/0b9f60a0370be53d683352c63fd92db3d6586e18/platforms/nuttx/NuttX/tools/kconfiglib.py#L1717-L1721
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/tools/python/src/Lib/lib-tk/Tkinter.py
python
Image.type
(self)
return self.tk.call('image', 'type', self.name)
Return the type of the image, e.g. "photo" or "bitmap".
Return the type of the image, e.g. "photo" or "bitmap".
[ "Return", "the", "type", "of", "the", "image", "e", ".", "g", ".", "photo", "or", "bitmap", "." ]
def type(self): """Return the type of the image, e.g. "photo" or "bitmap".""" return self.tk.call('image', 'type', self.name)
[ "def", "type", "(", "self", ")", ":", "return", "self", ".", "tk", ".", "call", "(", "'image'", ",", "'type'", ",", "self", ".", "name", ")" ]
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python/src/Lib/lib-tk/Tkinter.py#L3362-L3364
CRYTEK/CRYENGINE
232227c59a220cbbd311576f0fbeba7bb53b2a8c
Code/Tools/waf-1.7.13/waflib/Context.py
python
load_tool
(tool, tooldir=None)
Import a Waf tool (python module), and store it in the dict :py:const:`waflib.Context.Context.tools` :type tool: string :param tool: Name of the tool :type tooldir: list :param tooldir: List of directories to search for the tool module
Import a Waf tool (python module), and store it in the dict :py:const:`waflib.Context.Context.tools`
[ "Import", "a", "Waf", "tool", "(", "python", "module", ")", "and", "store", "it", "in", "the", "dict", ":", "py", ":", "const", ":", "waflib", ".", "Context", ".", "Context", ".", "tools" ]
def load_tool(tool, tooldir=None): """ Import a Waf tool (python module), and store it in the dict :py:const:`waflib.Context.Context.tools` :type tool: string :param tool: Name of the tool :type tooldir: list :param tooldir: List of directories to search for the tool module """ if tool == 'java': tool = 'j...
[ "def", "load_tool", "(", "tool", ",", "tooldir", "=", "None", ")", ":", "if", "tool", "==", "'java'", ":", "tool", "=", "'javaw'", "# jython", "elif", "tool", "==", "'compiler_cc'", ":", "tool", "=", "'compiler_c'", "# TODO remove in waf 1.8", "else", ":", ...
https://github.com/CRYTEK/CRYENGINE/blob/232227c59a220cbbd311576f0fbeba7bb53b2a8c/Code/Tools/waf-1.7.13/waflib/Context.py#L635-L679
funnyzhou/Adaptive_Feeding
9c78182331d8c0ea28de47226e805776c638d46f
lib/pycocotools/coco.py
python
COCO.download
( self, tarDir = None, imgIds = [] )
Download COCO images from mscoco.org server. :param tarDir (str): COCO results directory name imgIds (list): images to be downloaded :return:
Download COCO images from mscoco.org server. :param tarDir (str): COCO results directory name imgIds (list): images to be downloaded :return:
[ "Download", "COCO", "images", "from", "mscoco", ".", "org", "server", ".", ":", "param", "tarDir", "(", "str", ")", ":", "COCO", "results", "directory", "name", "imgIds", "(", "list", ")", ":", "images", "to", "be", "downloaded", ":", "return", ":" ]
def download( self, tarDir = None, imgIds = [] ): ''' Download COCO images from mscoco.org server. :param tarDir (str): COCO results directory name imgIds (list): images to be downloaded :return: ''' if tarDir is None: print 'Please specify targ...
[ "def", "download", "(", "self", ",", "tarDir", "=", "None", ",", "imgIds", "=", "[", "]", ")", ":", "if", "tarDir", "is", "None", ":", "print", "'Please specify target directory'", "return", "-", "1", "if", "len", "(", "imgIds", ")", "==", "0", ":", ...
https://github.com/funnyzhou/Adaptive_Feeding/blob/9c78182331d8c0ea28de47226e805776c638d46f/lib/pycocotools/coco.py#L329-L351
9miao/CrossApp
1f5375e061bf69841eb19728598f5ae3f508d620
tools/bindings-generator/clang/cindex.py
python
Type.is_pod
(self)
return conf.lib.clang_isPODType(self)
Determine whether this Type represents plain old data (POD).
Determine whether this Type represents plain old data (POD).
[ "Determine", "whether", "this", "Type", "represents", "plain", "old", "data", "(", "POD", ")", "." ]
def is_pod(self): """Determine whether this Type represents plain old data (POD).""" return conf.lib.clang_isPODType(self)
[ "def", "is_pod", "(", "self", ")", ":", "return", "conf", ".", "lib", ".", "clang_isPODType", "(", "self", ")" ]
https://github.com/9miao/CrossApp/blob/1f5375e061bf69841eb19728598f5ae3f508d620/tools/bindings-generator/clang/cindex.py#L1770-L1772
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
wx/lib/agw/flatmenu.py
python
FlatMenuBar.ClearBitmaps
(self, start=0)
Restores a :class:`NullBitmap` for all the items in the menu. :param integer `start`: the index at which to start resetting the bitmaps.
Restores a :class:`NullBitmap` for all the items in the menu.
[ "Restores", "a", ":", "class", ":", "NullBitmap", "for", "all", "the", "items", "in", "the", "menu", "." ]
def ClearBitmaps(self, start=0): """ Restores a :class:`NullBitmap` for all the items in the menu. :param integer `start`: the index at which to start resetting the bitmaps. """ if self._isLCD: return for item in self._items[start:]: ite...
[ "def", "ClearBitmaps", "(", "self", ",", "start", "=", "0", ")", ":", "if", "self", ".", "_isLCD", ":", "return", "for", "item", "in", "self", ".", "_items", "[", "start", ":", "]", ":", "item", ".", "SetTextBitmap", "(", "wx", ".", "NullBitmap", "...
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/agw/flatmenu.py#L3472-L3484
apache/arrow
af33dd1157eb8d7d9bfac25ebf61445b793b7943
dev/archery/archery/utils/source.py
python
ArrowSources.cpp
(self)
return self.path / "cpp"
Returns the cpp directory of an Arrow sources.
Returns the cpp directory of an Arrow sources.
[ "Returns", "the", "cpp", "directory", "of", "an", "Arrow", "sources", "." ]
def cpp(self): """ Returns the cpp directory of an Arrow sources. """ return self.path / "cpp"
[ "def", "cpp", "(", "self", ")", ":", "return", "self", ".", "path", "/", "\"cpp\"" ]
https://github.com/apache/arrow/blob/af33dd1157eb8d7d9bfac25ebf61445b793b7943/dev/archery/archery/utils/source.py#L62-L64
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/gtk/_gdi.py
python
GraphicsRenderer.CreateContextFromImage
(*args, **kwargs)
return _gdi_.GraphicsRenderer_CreateContextFromImage(*args, **kwargs)
CreateContextFromImage(self, Image image) -> GraphicsContext
CreateContextFromImage(self, Image image) -> GraphicsContext
[ "CreateContextFromImage", "(", "self", "Image", "image", ")", "-", ">", "GraphicsContext" ]
def CreateContextFromImage(*args, **kwargs): """CreateContextFromImage(self, Image image) -> GraphicsContext""" return _gdi_.GraphicsRenderer_CreateContextFromImage(*args, **kwargs)
[ "def", "CreateContextFromImage", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_gdi_", ".", "GraphicsRenderer_CreateContextFromImage", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/_gdi.py#L6573-L6575
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/numpy/py3/numpy/polynomial/polyutils.py
python
_fit
(vander_f, x, y, deg, rcond=None, full=False, w=None)
Helper function used to implement the ``<type>fit`` functions. Parameters ---------- vander_f : function(array_like, int) -> ndarray The 1d vander function, such as ``polyvander`` c1, c2 See the ``<type>fit`` functions for more detail
Helper function used to implement the ``<type>fit`` functions.
[ "Helper", "function", "used", "to", "implement", "the", "<type", ">", "fit", "functions", "." ]
def _fit(vander_f, x, y, deg, rcond=None, full=False, w=None): """ Helper function used to implement the ``<type>fit`` functions. Parameters ---------- vander_f : function(array_like, int) -> ndarray The 1d vander function, such as ``polyvander`` c1, c2 See the ``<type>fit`` fun...
[ "def", "_fit", "(", "vander_f", ",", "x", ",", "y", ",", "deg", ",", "rcond", "=", "None", ",", "full", "=", "False", ",", "w", "=", "None", ")", ":", "x", "=", "np", ".", "asarray", "(", "x", ")", "+", "0.0", "y", "=", "np", ".", "asarray"...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/numpy/py3/numpy/polynomial/polyutils.py#L595-L680
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numba/parfor.py
python
fill_parallel_impl
(return_type, arr, val)
return fill_1
Parallel implemention of ndarray.fill. The array on which to operate is retrieved from get_call_name and is passed along with the value to fill.
Parallel implemention of ndarray.fill. The array on which to operate is retrieved from get_call_name and is passed along with the value to fill.
[ "Parallel", "implemention", "of", "ndarray", ".", "fill", ".", "The", "array", "on", "which", "to", "operate", "is", "retrieved", "from", "get_call_name", "and", "is", "passed", "along", "with", "the", "value", "to", "fill", "." ]
def fill_parallel_impl(return_type, arr, val): """Parallel implemention of ndarray.fill. The array on which to operate is retrieved from get_call_name and is passed along with the value to fill. """ if arr.ndim == 1: def fill_1(in_arr, val): numba.parfor.init_prange() ...
[ "def", "fill_parallel_impl", "(", "return_type", ",", "arr", ",", "val", ")", ":", "if", "arr", ".", "ndim", "==", "1", ":", "def", "fill_1", "(", "in_arr", ",", "val", ")", ":", "numba", ".", "parfor", ".", "init_prange", "(", ")", "for", "i", "in...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numba/parfor.py#L430-L447
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numba/cuda/cudadrv/driver.py
python
require_device_memory
(obj)
A sentry for methods that accept CUDA memory object.
A sentry for methods that accept CUDA memory object.
[ "A", "sentry", "for", "methods", "that", "accept", "CUDA", "memory", "object", "." ]
def require_device_memory(obj): """A sentry for methods that accept CUDA memory object. """ if not is_device_memory(obj): raise Exception("Not a CUDA memory object.")
[ "def", "require_device_memory", "(", "obj", ")", ":", "if", "not", "is_device_memory", "(", "obj", ")", ":", "raise", "Exception", "(", "\"Not a CUDA memory object.\"", ")" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numba/cuda/cudadrv/driver.py#L1868-L1872
bigartm/bigartm
47e37f982de87aa67bfd475ff1f39da696b181b3
utils/cpplint.py
python
FilesBelongToSameModule
(filename_cc, filename_h)
return files_belong_to_same_module, common_path
Check if these two filenames belong to the same module. The concept of a 'module' here is a as follows: foo.h, foo-inl.h, foo.cc, foo_test.cc and foo_unittest.cc belong to the same 'module' if they are in the same directory. some/path/public/xyzzy and some/path/internal/xyzzy are also considered to belong to...
Check if these two filenames belong to the same module.
[ "Check", "if", "these", "two", "filenames", "belong", "to", "the", "same", "module", "." ]
def FilesBelongToSameModule(filename_cc, filename_h): """Check if these two filenames belong to the same module. The concept of a 'module' here is a as follows: foo.h, foo-inl.h, foo.cc, foo_test.cc and foo_unittest.cc belong to the same 'module' if they are in the same directory. some/path/public/xyzzy and ...
[ "def", "FilesBelongToSameModule", "(", "filename_cc", ",", "filename_h", ")", ":", "if", "not", "filename_cc", ".", "endswith", "(", "'.cc'", ")", ":", "return", "(", "False", ",", "''", ")", "filename_cc", "=", "filename_cc", "[", ":", "-", "len", "(", ...
https://github.com/bigartm/bigartm/blob/47e37f982de87aa67bfd475ff1f39da696b181b3/utils/cpplint.py#L5526-L5578
snap-stanford/snap-python
d53c51b0a26aa7e3e7400b014cdf728948fde80a
setup/snap.py
python
TRnd.__init__
(self, *args)
__init__(TRnd self, int const & _Seed=1, int const & Steps=0) -> TRnd Parameters: _Seed: int const & Steps: int const & __init__(TRnd self, int const & _Seed=1) -> TRnd Parameters: _Seed: int const & __init__(TRnd self) -> TRnd __init__(TRn...
__init__(TRnd self, int const & _Seed=1, int const & Steps=0) -> TRnd
[ "__init__", "(", "TRnd", "self", "int", "const", "&", "_Seed", "=", "1", "int", "const", "&", "Steps", "=", "0", ")", "-", ">", "TRnd" ]
def __init__(self, *args): """ __init__(TRnd self, int const & _Seed=1, int const & Steps=0) -> TRnd Parameters: _Seed: int const & Steps: int const & __init__(TRnd self, int const & _Seed=1) -> TRnd Parameters: _Seed: int const & ...
[ "def", "__init__", "(", "self", ",", "*", "args", ")", ":", "_snap", ".", "TRnd_swiginit", "(", "self", ",", "_snap", ".", "new_TRnd", "(", "*", "args", ")", ")" ]
https://github.com/snap-stanford/snap-python/blob/d53c51b0a26aa7e3e7400b014cdf728948fde80a/setup/snap.py#L7527-L7547
baidu-research/tensorflow-allreduce
66d5b855e90b0949e9fa5cca5599fd729a70e874
tensorflow/python/ops/math_grad.py
python
_RsqrtGrad
(op, grad)
return gen_math_ops._rsqrt_grad(y, grad)
Returns -0.5 * grad * conj(y)^3.
Returns -0.5 * grad * conj(y)^3.
[ "Returns", "-", "0", ".", "5", "*", "grad", "*", "conj", "(", "y", ")", "^3", "." ]
def _RsqrtGrad(op, grad): """Returns -0.5 * grad * conj(y)^3.""" y = op.outputs[0] # y = x^(-1/2) return gen_math_ops._rsqrt_grad(y, grad)
[ "def", "_RsqrtGrad", "(", "op", ",", "grad", ")", ":", "y", "=", "op", ".", "outputs", "[", "0", "]", "# y = x^(-1/2)", "return", "gen_math_ops", ".", "_rsqrt_grad", "(", "y", ",", "grad", ")" ]
https://github.com/baidu-research/tensorflow-allreduce/blob/66d5b855e90b0949e9fa5cca5599fd729a70e874/tensorflow/python/ops/math_grad.py#L317-L320
crankyoldgit/IRremoteESP8266
6bc095af80e5aec47d66f8c6263f3a943ea3b4d5
tools/auto_analyse_raw_data.py
python
get_rawdata
(arg_options)
Return the rawdata string(s) as per the options.
Return the rawdata string(s) as per the options.
[ "Return", "the", "rawdata", "string", "(", "s", ")", "as", "per", "the", "options", "." ]
def get_rawdata(arg_options): """Return the rawdata string(s) as per the options.""" if arg_options.stdin: return sys.stdin.read() if arg_options.file: with open(arg_options.file, encoding="utf8") as input_file: return input_file.read() else: return arg_options.rawdata
[ "def", "get_rawdata", "(", "arg_options", ")", ":", "if", "arg_options", ".", "stdin", ":", "return", "sys", ".", "stdin", ".", "read", "(", ")", "if", "arg_options", ".", "file", ":", "with", "open", "(", "arg_options", ".", "file", ",", "encoding", "...
https://github.com/crankyoldgit/IRremoteESP8266/blob/6bc095af80e5aec47d66f8c6263f3a943ea3b4d5/tools/auto_analyse_raw_data.py#L724-L732
KratosMultiphysics/Kratos
0000833054ed0503424eb28205d6508d9ca6cbbc
kratos/python_scripts/sub_model_part_entities_boolean_operation_process.py
python
SubModelPartEntitiesBooleanOperationProcess.GetDefaultParameters
()
return KM.Parameters("""{ "first_model_part_name" : "MODEL_PART_NAME", "second_model_part_name" : "MODEL_PART_NAME", "result_model_part_name" : "MODEL_PART_NAME", "boolean_operation" : "Difference", "entity_type" : "Nodes" }""")
Return the default parameters.
Return the default parameters.
[ "Return", "the", "default", "parameters", "." ]
def GetDefaultParameters(): """Return the default parameters.""" return KM.Parameters("""{ "first_model_part_name" : "MODEL_PART_NAME", "second_model_part_name" : "MODEL_PART_NAME", "result_model_part_name" : "MODEL_PART_NAME", "boolean_operation" : ...
[ "def", "GetDefaultParameters", "(", ")", ":", "return", "KM", ".", "Parameters", "(", "\"\"\"{\n \"first_model_part_name\" : \"MODEL_PART_NAME\",\n \"second_model_part_name\" : \"MODEL_PART_NAME\",\n \"result_model_part_name\" : \"MODEL_PART_NAME\",\n ...
https://github.com/KratosMultiphysics/Kratos/blob/0000833054ed0503424eb28205d6508d9ca6cbbc/kratos/python_scripts/sub_model_part_entities_boolean_operation_process.py#L43-L51
msitt/blpapi-python
bebcf43668c9e5f5467b1f685f9baebbfc45bc87
src/blpapi/sessionoptions.py
python
TlsOptions.createFromFiles
(clientCredentialsFilename, clientCredentialsPassword, trustedCertificatesFilename)
return TlsOptions(handle)
Args: clientCredentialsFilename (str): Path to the file with the client credentials clientCredentialsPassword (str): Password for the credentials trustedCertificatesFilename (str): Path to the file with the trusted certificates Creates a :clas...
Args: clientCredentialsFilename (str): Path to the file with the client credentials clientCredentialsPassword (str): Password for the credentials trustedCertificatesFilename (str): Path to the file with the trusted certificates
[ "Args", ":", "clientCredentialsFilename", "(", "str", ")", ":", "Path", "to", "the", "file", "with", "the", "client", "credentials", "clientCredentialsPassword", "(", "str", ")", ":", "Password", "for", "the", "credentials", "trustedCertificatesFilename", "(", "st...
def createFromFiles(clientCredentialsFilename, clientCredentialsPassword, trustedCertificatesFilename): """ Args: clientCredentialsFilename (str): Path to the file with the client credentials clientCredentialsPasswor...
[ "def", "createFromFiles", "(", "clientCredentialsFilename", ",", "clientCredentialsPassword", ",", "trustedCertificatesFilename", ")", ":", "handle", "=", "internals", ".", "blpapi_TlsOptions_createFromFiles", "(", "clientCredentialsFilename", ",", "clientCredentialsPassword", ...
https://github.com/msitt/blpapi-python/blob/bebcf43668c9e5f5467b1f685f9baebbfc45bc87/src/blpapi/sessionoptions.py#L827-L846
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/scipy/py2/scipy/optimize/_shgo.py
python
SHGO.simplex_minimizers
(self)
return self.X_min
Returns the indexes of all minimizers
Returns the indexes of all minimizers
[ "Returns", "the", "indexes", "of", "all", "minimizers" ]
def simplex_minimizers(self): """ Returns the indexes of all minimizers """ self.minimizer_pool = [] # Note: Can implement parallelization here for x in self.HC.V.cache: if self.HC.V[x].minimiser(): if self.disp: logging.inf...
[ "def", "simplex_minimizers", "(", "self", ")", ":", "self", ".", "minimizer_pool", "=", "[", "]", "# Note: Can implement parallelization here", "for", "x", "in", "self", ".", "HC", ".", "V", ".", "cache", ":", "if", "self", ".", "HC", ".", "V", "[", "x",...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/py2/scipy/optimize/_shgo.py#L911-L953
SequoiaDB/SequoiaDB
2894ed7e5bd6fe57330afc900cf76d0ff0df9f64
tools/server/php_linux/libxml2/lib/python2.4/site-packages/libxml2.py
python
xmlDoc.isMixedElement
(self, name)
return ret
Search in the DtDs whether an element accept Mixed content (or ANY) basically if it is supposed to accept text childs
Search in the DtDs whether an element accept Mixed content (or ANY) basically if it is supposed to accept text childs
[ "Search", "in", "the", "DtDs", "whether", "an", "element", "accept", "Mixed", "content", "(", "or", "ANY", ")", "basically", "if", "it", "is", "supposed", "to", "accept", "text", "childs" ]
def isMixedElement(self, name): """Search in the DtDs whether an element accept Mixed content (or ANY) basically if it is supposed to accept text childs """ ret = libxml2mod.xmlIsMixedElement(self._o, name) return ret
[ "def", "isMixedElement", "(", "self", ",", "name", ")", ":", "ret", "=", "libxml2mod", ".", "xmlIsMixedElement", "(", "self", ".", "_o", ",", "name", ")", "return", "ret" ]
https://github.com/SequoiaDB/SequoiaDB/blob/2894ed7e5bd6fe57330afc900cf76d0ff0df9f64/tools/server/php_linux/libxml2/lib/python2.4/site-packages/libxml2.py#L4556-L4560
windystrife/UnrealEngine_NVIDIAGameWorks
b50e6338a7c5b26374d66306ebc7807541ff815e
Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/uuid.py
python
_ipconfig_getnode
()
Get the hardware address on Windows by running ipconfig.exe.
Get the hardware address on Windows by running ipconfig.exe.
[ "Get", "the", "hardware", "address", "on", "Windows", "by", "running", "ipconfig", ".", "exe", "." ]
def _ipconfig_getnode(): """Get the hardware address on Windows by running ipconfig.exe.""" import os, re dirs = ['', r'c:\windows\system32', r'c:\winnt\system32'] try: import ctypes buffer = ctypes.create_string_buffer(300) ctypes.windll.kernel32.GetSystemDirectoryA(buffer, 300)...
[ "def", "_ipconfig_getnode", "(", ")", ":", "import", "os", ",", "re", "dirs", "=", "[", "''", ",", "r'c:\\windows\\system32'", ",", "r'c:\\winnt\\system32'", "]", "try", ":", "import", "ctypes", "buffer", "=", "ctypes", ".", "create_string_buffer", "(", "300",...
https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/uuid.py#L340-L362
kungfu-origin/kungfu
90c84b2b590855654cb9a6395ed050e0f7763512
core/deps/SQLiteCpp-2.3.0/cpplint.py
python
_NamespaceInfo.CheckEnd
(self, filename, clean_lines, linenum, error)
Check end of namespace comments.
Check end of namespace comments.
[ "Check", "end", "of", "namespace", "comments", "." ]
def CheckEnd(self, filename, clean_lines, linenum, error): """Check end of namespace comments.""" line = clean_lines.raw_lines[linenum] # Check how many lines is enclosed in this namespace. Don't issue # warning for missing namespace comments if there aren't enough # lines. However, do apply chec...
[ "def", "CheckEnd", "(", "self", ",", "filename", ",", "clean_lines", ",", "linenum", ",", "error", ")", ":", "line", "=", "clean_lines", ".", "raw_lines", "[", "linenum", "]", "# Check how many lines is enclosed in this namespace. Don't issue", "# warning for missing n...
https://github.com/kungfu-origin/kungfu/blob/90c84b2b590855654cb9a6395ed050e0f7763512/core/deps/SQLiteCpp-2.3.0/cpplint.py#L1784-L1827
p4lang/PI
38d87e81253feff9fff0660d662c885be78fb719
tools/cpplint.py
python
FlagCxx14Features
(filename, clean_lines, linenum, error)
Flag those C++14 features that we restrict. Args: filename: The name of the current file. clean_lines: A CleansedLines instance containing the file. linenum: The number of the line to check. error: The function to call with any errors found.
Flag those C++14 features that we restrict.
[ "Flag", "those", "C", "++", "14", "features", "that", "we", "restrict", "." ]
def FlagCxx14Features(filename, clean_lines, linenum, error): """Flag those C++14 features that we restrict. Args: filename: The name of the current file. clean_lines: A CleansedLines instance containing the file. linenum: The number of the line to check. error: The function to call with any errors...
[ "def", "FlagCxx14Features", "(", "filename", ",", "clean_lines", ",", "linenum", ",", "error", ")", ":", "line", "=", "clean_lines", ".", "elided", "[", "linenum", "]", "include", "=", "Match", "(", "r'\\s*#\\s*include\\s+[<\"]([^<\"]+)[\">]'", ",", "line", ")",...
https://github.com/p4lang/PI/blob/38d87e81253feff9fff0660d662c885be78fb719/tools/cpplint.py#L6432-L6448
sailing-pmls/pmls-caffe
49e98bced9c6d5af7cd701d18ab235b5fd0e4b3a
scripts/cpp_lint.py
python
CheckForIncludeWhatYouUse
(filename, clean_lines, include_state, error, io=codecs)
Reports for missing stl includes. This function will output warnings to make sure you are including the headers necessary for the stl containers and functions that you use. We only give one reason to include a header. For example, if you use both equal_to<> and less<> in a .h file, only one (the latter in the ...
Reports for missing stl includes.
[ "Reports", "for", "missing", "stl", "includes", "." ]
def CheckForIncludeWhatYouUse(filename, clean_lines, include_state, error, io=codecs): """Reports for missing stl includes. This function will output warnings to make sure you are including the headers necessary for the stl containers and functions that you use. We only give one r...
[ "def", "CheckForIncludeWhatYouUse", "(", "filename", ",", "clean_lines", ",", "include_state", ",", "error", ",", "io", "=", "codecs", ")", ":", "required", "=", "{", "}", "# A map of header name to linenumber and the template entity.", "# Example of required: { '<functiona...
https://github.com/sailing-pmls/pmls-caffe/blob/49e98bced9c6d5af7cd701d18ab235b5fd0e4b3a/scripts/cpp_lint.py#L4483-L4573
forkineye/ESPixelStick
22926f1c0d1131f1369fc7cad405689a095ae3cb
dist/bin/pyserial/serial/serialposix.py
python
Serial._update_rts_state
(self)
Set terminal status line: Request To Send
Set terminal status line: Request To Send
[ "Set", "terminal", "status", "line", ":", "Request", "To", "Send" ]
def _update_rts_state(self): """Set terminal status line: Request To Send""" if self._rts_state: fcntl.ioctl(self.fd, TIOCMBIS, TIOCM_RTS_str) else: fcntl.ioctl(self.fd, TIOCMBIC, TIOCM_RTS_str)
[ "def", "_update_rts_state", "(", "self", ")", ":", "if", "self", ".", "_rts_state", ":", "fcntl", ".", "ioctl", "(", "self", ".", "fd", ",", "TIOCMBIS", ",", "TIOCM_RTS_str", ")", "else", ":", "fcntl", ".", "ioctl", "(", "self", ".", "fd", ",", "TIOC...
https://github.com/forkineye/ESPixelStick/blob/22926f1c0d1131f1369fc7cad405689a095ae3cb/dist/bin/pyserial/serial/serialposix.py#L624-L629
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_carbon/_core.py
python
Validator.SetWindow
(*args, **kwargs)
return _core_.Validator_SetWindow(*args, **kwargs)
SetWindow(self, Window window)
SetWindow(self, Window window)
[ "SetWindow", "(", "self", "Window", "window", ")" ]
def SetWindow(*args, **kwargs): """SetWindow(self, Window window)""" return _core_.Validator_SetWindow(*args, **kwargs)
[ "def", "SetWindow", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_core_", ".", "Validator_SetWindow", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/_core.py#L11896-L11898
y123456yz/reading-and-annotate-mongodb-3.6
93280293672ca7586dc24af18132aa61e4ed7fcf
mongo/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Node/__init__.py
python
Node.add_source
(self, source)
Adds sources.
Adds sources.
[ "Adds", "sources", "." ]
def add_source(self, source): """Adds sources.""" if self._specific_sources: return try: self._add_child(self.sources, self.sources_set, source) except TypeError, e: e = e.args[0] if SCons.Util.is_List(e): s = list(map(str, ...
[ "def", "add_source", "(", "self", ",", "source", ")", ":", "if", "self", ".", "_specific_sources", ":", "return", "try", ":", "self", ".", "_add_child", "(", "self", ".", "sources", ",", "self", ".", "sources_set", ",", "source", ")", "except", "TypeErro...
https://github.com/y123456yz/reading-and-annotate-mongodb-3.6/blob/93280293672ca7586dc24af18132aa61e4ed7fcf/mongo/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Node/__init__.py#L1269-L1281
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/build/waf-1.7.13/waflib/Context.py
python
Context.cmd_and_log
(self, cmd, **kw)
return out
Execute a command and return stdout if the execution is successful. An exception is thrown when the exit status is non-0. In that case, both stderr and stdout will be bound to the WafError object:: def configure(conf): out = conf.cmd_and_log(['echo', 'hello'], output=waflib.Context.STDOUT, quiet=waflib.Cont...
Execute a command and return stdout if the execution is successful. An exception is thrown when the exit status is non-0. In that case, both stderr and stdout will be bound to the WafError object::
[ "Execute", "a", "command", "and", "return", "stdout", "if", "the", "execution", "is", "successful", ".", "An", "exception", "is", "thrown", "when", "the", "exit", "status", "is", "non", "-", "0", ".", "In", "that", "case", "both", "stderr", "and", "stdou...
def cmd_and_log(self, cmd, **kw): """ Execute a command and return stdout if the execution is successful. An exception is thrown when the exit status is non-0. In that case, both stderr and stdout will be bound to the WafError object:: def configure(conf): out = conf.cmd_and_log(['echo', 'hello'], outpu...
[ "def", "cmd_and_log", "(", "self", ",", "cmd", ",", "*", "*", "kw", ")", ":", "subprocess", "=", "Utils", ".", "subprocess", "kw", "[", "'shell'", "]", "=", "isinstance", "(", "cmd", ",", "str", ")", "Logs", ".", "debug", "(", "'runner: %r'", "%", ...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/build/waf-1.7.13/waflib/Context.py#L395-L458
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
wx/lib/agw/balloontip.py
python
BalloonTip.OnWidgetMotion
(self, event)
Handle the mouse motion inside the target. This prevents the annoying behavior of :class:`BalloonTip` to display when the user does something else inside the window. The :class:`BalloonTip` window is displayed only when the mouse does *not* move for the start delay time. :param `event`...
Handle the mouse motion inside the target.
[ "Handle", "the", "mouse", "motion", "inside", "the", "target", "." ]
def OnWidgetMotion(self, event): """ Handle the mouse motion inside the target. This prevents the annoying behavior of :class:`BalloonTip` to display when the user does something else inside the window. The :class:`BalloonTip` window is displayed only when the mouse does *not* m...
[ "def", "OnWidgetMotion", "(", "self", ",", "event", ")", ":", "if", "hasattr", "(", "self", ",", "\"BalloonFrame\"", ")", ":", "if", "self", ".", "BalloonFrame", ":", "return", "if", "hasattr", "(", "self", ",", "\"showtime\"", ")", ":", "if", "self", ...
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/agw/balloontip.py#L732-L751
SoarGroup/Soar
a1c5e249499137a27da60533c72969eef3b8ab6b
scons/scons-local-4.1.0/SCons/Memoize.py
python
CountDict.count
(self, *args, **kw)
Counts whether the computed key value is already present in the memoization dictionary (a hit) or not (a miss).
Counts whether the computed key value is already present in the memoization dictionary (a hit) or not (a miss).
[ "Counts", "whether", "the", "computed", "key", "value", "is", "already", "present", "in", "the", "memoization", "dictionary", "(", "a", "hit", ")", "or", "not", "(", "a", "miss", ")", "." ]
def count(self, *args, **kw): """ Counts whether the computed key value is already present in the memoization dictionary (a hit) or not (a miss). """ obj = args[0] try: memo_dict = obj._memo[self.method_name] except KeyError: self.miss = self.mi...
[ "def", "count", "(", "self", ",", "*", "args", ",", "*", "*", "kw", ")", ":", "obj", "=", "args", "[", "0", "]", "try", ":", "memo_dict", "=", "obj", ".", "_memo", "[", "self", ".", "method_name", "]", "except", "KeyError", ":", "self", ".", "m...
https://github.com/SoarGroup/Soar/blob/a1c5e249499137a27da60533c72969eef3b8ab6b/scons/scons-local-4.1.0/SCons/Memoize.py#L164-L178
SmingHub/Sming
cde389ed030905694983121a32f9028976b57194
Sming/Components/Storage/Tools/hwconfig/config.py
python
Config.load
(self, name)
Load a configuration recursively.
Load a configuration recursively.
[ "Load", "a", "configuration", "recursively", "." ]
def load(self, name): """Load a configuration recursively.""" filename = find_config(name) self.depends.append(filename) data = json_load(filename) self.parse_dict(data)
[ "def", "load", "(", "self", ",", "name", ")", ":", "filename", "=", "find_config", "(", "name", ")", "self", ".", "depends", ".", "append", "(", "filename", ")", "data", "=", "json_load", "(", "filename", ")", "self", ".", "parse_dict", "(", "data", ...
https://github.com/SmingHub/Sming/blob/cde389ed030905694983121a32f9028976b57194/Sming/Components/Storage/Tools/hwconfig/config.py#L116-L121
ApolloAuto/apollo-platform
86d9dc6743b496ead18d597748ebabd34a513289
ros/ros_comm/rospy/src/rospy/impl/masterslave.py
python
ROSHandler._shutdown
(self, reason='')
@param reason: human-readable debug string @type reason: str
[]
def _shutdown(self, reason=''): """ @param reason: human-readable debug string @type reason: str """ if not self.done: self.done = True if reason: _logger.info(reason) if self.protocol_handlers: for handler in s...
[ "def", "_shutdown", "(", "self", ",", "reason", "=", "''", ")", ":", "if", "not", "self", ".", "done", ":", "self", ".", "done", "=", "True", "if", "reason", ":", "_logger", ".", "info", "(", "reason", ")", "if", "self", ".", "protocol_handlers", "...
https://github.com/ApolloAuto/apollo-platform/blob/86d9dc6743b496ead18d597748ebabd34a513289/ros/ros_comm/rospy/src/rospy/impl/masterslave.py#L333-L347
benoitsteiner/tensorflow-opencl
cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5
tensorflow/contrib/specs/python/summaries.py
python
tf_spec_summary
(spec, inputs=None, input_shape=None, input_type=dtypes.float32)
Output a summary of the specification. This prints a list of left-most tensor operations and summarized the variables found in the right branches. This kind of representation is particularly useful for networks that are generally structured like pipelines. Args: spec: specification inputs: input...
Output a summary of the specification.
[ "Output", "a", "summary", "of", "the", "specification", "." ]
def tf_spec_summary(spec, inputs=None, input_shape=None, input_type=dtypes.float32): """Output a summary of the specification. This prints a list of left-most tensor operations and summarized the variables found in the right branches. This kind of repre...
[ "def", "tf_spec_summary", "(", "spec", ",", "inputs", "=", "None", ",", "input_shape", "=", "None", ",", "input_type", "=", "dtypes", ".", "float32", ")", ":", "if", "inputs", "is", "None", ":", "inputs", "=", "array_ops", ".", "placeholder", "(", "input...
https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/contrib/specs/python/summaries.py#L273-L294
hanpfei/chromium-net
392cc1fa3a8f92f42e4071ab6e674d8e0482f83f
third_party/catapult/third_party/gsutil/third_party/boto/boto/storage_uri.py
python
FileStorageUri.names_object
(self)
return False
Returns True if this URI names an object.
Returns True if this URI names an object.
[ "Returns", "True", "if", "this", "URI", "names", "an", "object", "." ]
def names_object(self): """Returns True if this URI names an object.""" return False
[ "def", "names_object", "(", "self", ")", ":", "return", "False" ]
https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/gsutil/third_party/boto/boto/storage_uri.py#L872-L874
apache/mesos
97d9a4063332aae3825d78de71611657e05cf5e2
support/apply-reviews.py
python
apply_patch
(options)
Applies patch locally.
Applies patch locally.
[ "Applies", "patch", "locally", "." ]
def apply_patch(options): """Applies patch locally.""" cmd = 'git apply --index {review_id}.patch'.format( review_id=patch_id(options)) if options['3way']: cmd += ' --3way' if platform.system() == 'Windows': # NOTE: Depending on the Git settings, there may or may not be ...
[ "def", "apply_patch", "(", "options", ")", ":", "cmd", "=", "'git apply --index {review_id}.patch'", ".", "format", "(", "review_id", "=", "patch_id", "(", "options", ")", ")", "if", "options", "[", "'3way'", "]", ":", "cmd", "+=", "' --3way'", "if", "platfo...
https://github.com/apache/mesos/blob/97d9a4063332aae3825d78de71611657e05cf5e2/support/apply-reviews.py#L232-L246
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numpy/lib/function_base.py
python
disp
(mesg, device=None, linefeed=True)
return
Display a message on a device. Parameters ---------- mesg : str Message to display. device : object Device to write message. If None, defaults to ``sys.stdout`` which is very similar to ``print``. `device` needs to have ``write()`` and ``flush()`` methods. linefeed :...
Display a message on a device.
[ "Display", "a", "message", "on", "a", "device", "." ]
def disp(mesg, device=None, linefeed=True): """ Display a message on a device. Parameters ---------- mesg : str Message to display. device : object Device to write message. If None, defaults to ``sys.stdout`` which is very similar to ``print``. `device` needs to have ``w...
[ "def", "disp", "(", "mesg", ",", "device", "=", "None", ",", "linefeed", "=", "True", ")", ":", "if", "device", "is", "None", ":", "device", "=", "sys", ".", "stdout", "if", "linefeed", ":", "device", ".", "write", "(", "'%s\\n'", "%", "mesg", ")",...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numpy/lib/function_base.py#L1728-L1767
idaholab/moose
9eeebc65e098b4c30f8205fb41591fd5b61eb6ff
python/parameters/InputParameters.py
python
InputParameters.hasParameter
(self, name)
return name in self.__parameters
Test that the parameter exists. Inputs: name[str]: The name of the Parameter to check
Test that the parameter exists.
[ "Test", "that", "the", "parameter", "exists", "." ]
def hasParameter(self, name): """ Test that the parameter exists. Inputs: name[str]: The name of the Parameter to check """ return name in self.__parameters
[ "def", "hasParameter", "(", "self", ",", "name", ")", ":", "return", "name", "in", "self", ".", "__parameters" ]
https://github.com/idaholab/moose/blob/9eeebc65e098b4c30f8205fb41591fd5b61eb6ff/python/parameters/InputParameters.py#L209-L216
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
wx/tools/Editra/src/ed_txt.py
python
EdFile.ReadLines
(self)
Get the contents of the file as a list of lines @return: list of strings
Get the contents of the file as a list of lines @return: list of strings
[ "Get", "the", "contents", "of", "the", "file", "as", "a", "list", "of", "lines", "@return", ":", "list", "of", "strings" ]
def ReadLines(self): """Get the contents of the file as a list of lines @return: list of strings """ raise NotImplementedError
[ "def", "ReadLines", "(", "self", ")", ":", "raise", "NotImplementedError" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/tools/Editra/src/ed_txt.py#L500-L505
hanpfei/chromium-net
392cc1fa3a8f92f42e4071ab6e674d8e0482f83f
third_party/catapult/third_party/py_vulcanize/third_party/rjsmin/_setup/py3/commands.py
python
InstallLib.finalize_options
(self)
Finalize options
Finalize options
[ "Finalize", "options" ]
def finalize_options(self): """ Finalize options """ _install_lib.install_lib.finalize_options(self) if 'install_lib' in _option_inherits: for parent, opt_name in _option_inherits['install_lib']: self.set_undefined_options(parent, (opt_name, opt_name)) if 'ins...
[ "def", "finalize_options", "(", "self", ")", ":", "_install_lib", ".", "install_lib", ".", "finalize_options", "(", "self", ")", "if", "'install_lib'", "in", "_option_inherits", ":", "for", "parent", ",", "opt_name", "in", "_option_inherits", "[", "'install_lib'",...
https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/py_vulcanize/third_party/rjsmin/_setup/py3/commands.py#L160-L168
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/tools/python3/src/Lib/numbers.py
python
Real.__float__
(self)
Any Real can be converted to a native float object. Called for float(self).
Any Real can be converted to a native float object.
[ "Any", "Real", "can", "be", "converted", "to", "a", "native", "float", "object", "." ]
def __float__(self): """Any Real can be converted to a native float object. Called for float(self).""" raise NotImplementedError
[ "def", "__float__", "(", "self", ")", ":", "raise", "NotImplementedError" ]
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python3/src/Lib/numbers.py#L159-L163
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/scipy/py2/scipy/optimize/_spectral.py
python
_wrap_result
(result, is_complex, shape=None)
return z
Convert from real to complex and reshape result arrays.
Convert from real to complex and reshape result arrays.
[ "Convert", "from", "real", "to", "complex", "and", "reshape", "result", "arrays", "." ]
def _wrap_result(result, is_complex, shape=None): """ Convert from real to complex and reshape result arrays. """ if is_complex: z = _real2complex(result) else: z = result if shape is not None: z = z.reshape(shape) return z
[ "def", "_wrap_result", "(", "result", ",", "is_complex", ",", "shape", "=", "None", ")", ":", "if", "is_complex", ":", "z", "=", "_real2complex", "(", "result", ")", "else", ":", "z", "=", "result", "if", "shape", "is", "not", "None", ":", "z", "=", ...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/py2/scipy/optimize/_spectral.py#L241-L251
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/AWSPythonSDK/1.5.8/docutils/utils/math/math2html.py
python
EndingList.checkin
(self, pos)
return False
Search for an ending
Search for an ending
[ "Search", "for", "an", "ending" ]
def checkin(self, pos): "Search for an ending" if self.findending(pos): return True return False
[ "def", "checkin", "(", "self", ",", "pos", ")", ":", "if", "self", ".", "findending", "(", "pos", ")", ":", "return", "True", "return", "False" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/AWSPythonSDK/1.5.8/docutils/utils/math/math2html.py#L1951-L1955
ricardoquesada/Spidermonkey
4a75ea2543408bd1b2c515aa95901523eeef7858
python/mozbuild/mozpack/packager/formats.py
python
JarFormatter._jarize
(self, entry, relpath)
return chromepath, entry
Transform a manifest entry in one pointing to chrome data in a jar. Return the corresponding chrome path and the new entry.
Transform a manifest entry in one pointing to chrome data in a jar. Return the corresponding chrome path and the new entry.
[ "Transform", "a", "manifest", "entry", "in", "one", "pointing", "to", "chrome", "data", "in", "a", "jar", ".", "Return", "the", "corresponding", "chrome", "path", "and", "the", "new", "entry", "." ]
def _jarize(self, entry, relpath): ''' Transform a manifest entry in one pointing to chrome data in a jar. Return the corresponding chrome path and the new entry. ''' base = entry.base basepath = mozpack.path.split(relpath)[0] chromepath = mozpack.path.join(base, ...
[ "def", "_jarize", "(", "self", ",", "entry", ",", "relpath", ")", ":", "base", "=", "entry", ".", "base", "basepath", "=", "mozpack", ".", "path", ".", "split", "(", "relpath", ")", "[", "0", "]", "chromepath", "=", "mozpack", ".", "path", ".", "jo...
https://github.com/ricardoquesada/Spidermonkey/blob/4a75ea2543408bd1b2c515aa95901523eeef7858/python/mozbuild/mozpack/packager/formats.py#L165-L176
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_cocoa/combo.py
python
ComboCtrl.SetText
(*args, **kwargs)
return _combo.ComboCtrl_SetText(*args, **kwargs)
SetText(self, String value) Sets the text for the text field without affecting the popup. Thus, unlike `SetValue`, it works equally well with combo control using wx.CB_READONLY style.
SetText(self, String value)
[ "SetText", "(", "self", "String", "value", ")" ]
def SetText(*args, **kwargs): """ SetText(self, String value) Sets the text for the text field without affecting the popup. Thus, unlike `SetValue`, it works equally well with combo control using wx.CB_READONLY style. """ return _combo.ComboCtrl_SetText(*args, **...
[ "def", "SetText", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_combo", ".", "ComboCtrl_SetText", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/combo.py#L251-L259
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/scikit-learn/py2/sklearn/cross_validation.py
python
_permutation_test_score
(estimator, X, y, cv, scorer)
return np.mean(avg_score)
Auxiliary function for permutation_test_score
Auxiliary function for permutation_test_score
[ "Auxiliary", "function", "for", "permutation_test_score" ]
def _permutation_test_score(estimator, X, y, cv, scorer): """Auxiliary function for permutation_test_score""" avg_score = [] for train, test in cv: estimator.fit(X[train], y[train]) avg_score.append(scorer(estimator, X[test], y[test])) return np.mean(avg_score)
[ "def", "_permutation_test_score", "(", "estimator", ",", "X", ",", "y", ",", "cv", ",", "scorer", ")", ":", "avg_score", "=", "[", "]", "for", "train", ",", "test", "in", "cv", ":", "estimator", ".", "fit", "(", "X", "[", "train", "]", ",", "y", ...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scikit-learn/py2/sklearn/cross_validation.py#L1755-L1761
vslavik/poedit
f7a9daa0a10037e090aa0a86f5ce0f24ececdf6a
deps/boost/tools/build/src/build/project.py
python
ProjectRegistry.target
(self, project_module)
return self.module2target[project_module]
Returns the project target corresponding to the 'project-module'.
Returns the project target corresponding to the 'project-module'.
[ "Returns", "the", "project", "target", "corresponding", "to", "the", "project", "-", "module", "." ]
def target(self, project_module): """Returns the project target corresponding to the 'project-module'.""" assert isinstance(project_module, basestring) if project_module not in self.module2target: self.module2target[project_module] = \ b2.build.targets.ProjectTarget(p...
[ "def", "target", "(", "self", ",", "project_module", ")", ":", "assert", "isinstance", "(", "project_module", ",", "basestring", ")", "if", "project_module", "not", "in", "self", ".", "module2target", ":", "self", ".", "module2target", "[", "project_module", "...
https://github.com/vslavik/poedit/blob/f7a9daa0a10037e090aa0a86f5ce0f24ececdf6a/deps/boost/tools/build/src/build/project.py#L611-L619
hpi-xnor/BMXNet-v2
af2b1859eafc5c721b1397cef02f946aaf2ce20d
python/mxnet/contrib/onnx/onnx2mx/_translation_utils.py
python
_pad_sequence_fix
(attr, kernel_dim=None)
return new_attr
Changing onnx's pads sequence to match with mxnet's pad_width mxnet: (x1_begin, x1_end, ... , xn_begin, xn_end) onnx: (x1_begin, x2_begin, ... , xn_end, xn_end)
Changing onnx's pads sequence to match with mxnet's pad_width mxnet: (x1_begin, x1_end, ... , xn_begin, xn_end) onnx: (x1_begin, x2_begin, ... , xn_end, xn_end)
[ "Changing", "onnx", "s", "pads", "sequence", "to", "match", "with", "mxnet", "s", "pad_width", "mxnet", ":", "(", "x1_begin", "x1_end", "...", "xn_begin", "xn_end", ")", "onnx", ":", "(", "x1_begin", "x2_begin", "...", "xn_end", "xn_end", ")" ]
def _pad_sequence_fix(attr, kernel_dim=None): """Changing onnx's pads sequence to match with mxnet's pad_width mxnet: (x1_begin, x1_end, ... , xn_begin, xn_end) onnx: (x1_begin, x2_begin, ... , xn_end, xn_end)""" new_attr = () if len(attr) % 2 == 0: for index in range(int(len(attr) / 2)): ...
[ "def", "_pad_sequence_fix", "(", "attr", ",", "kernel_dim", "=", "None", ")", ":", "new_attr", "=", "(", ")", "if", "len", "(", "attr", ")", "%", "2", "==", "0", ":", "for", "index", "in", "range", "(", "int", "(", "len", "(", "attr", ")", "/", ...
https://github.com/hpi-xnor/BMXNet-v2/blob/af2b1859eafc5c721b1397cef02f946aaf2ce20d/python/mxnet/contrib/onnx/onnx2mx/_translation_utils.py#L75-L88
harfbuzz/harfbuzz
c4cf5ddb272cb1c05a572db5b76629368f9054f5
src/gen-tag-table.py
python
OpenTypeRegistryParser.inherit_from_macrolanguages
(self)
Copy mappings from macrolanguages to individual languages. If a BCP 47 tag for an individual mapping has no OpenType mapping but its macrolanguage does, the mapping is copied to the individual language. For example, als (Tosk Albanian) has no explicit mapping, so it inherits from sq (Albanian) the mapping to...
Copy mappings from macrolanguages to individual languages.
[ "Copy", "mappings", "from", "macrolanguages", "to", "individual", "languages", "." ]
def inherit_from_macrolanguages (self): """Copy mappings from macrolanguages to individual languages. If a BCP 47 tag for an individual mapping has no OpenType mapping but its macrolanguage does, the mapping is copied to the individual language. For example, als (Tosk Albanian) has no explicit mapping, so it...
[ "def", "inherit_from_macrolanguages", "(", "self", ")", ":", "global", "bcp_47", "first_time", "=", "self", ".", "from_bcp_47_uninherited", "is", "None", "if", "first_time", ":", "self", ".", "from_bcp_47_uninherited", "=", "dict", "(", "self", ".", "from_bcp_47",...
https://github.com/harfbuzz/harfbuzz/blob/c4cf5ddb272cb1c05a572db5b76629368f9054f5/src/gen-tag-table.py#L461-L520
grpc/grpc
27bc6fe7797e43298dc931b96dc57322d0852a9f
src/python/grpcio/commands.py
python
try_cythonize
(extensions, linetracing=False, mandatory=True)
return Cython.Build.cythonize( extensions, include_path=[ include_dir for extension in extensions for include_dir in extension.include_dirs ] + [CYTHON_STEM], compiler_directives=cython_compiler_directives)
Attempt to cythonize the extensions. Args: extensions: A list of `distutils.extension.Extension`. linetracing: A bool indicating whether or not to enable linetracing. mandatory: Whether or not having Cython-generated files is mandatory. If it is, extensions will be poisoned when they can't be fully...
Attempt to cythonize the extensions.
[ "Attempt", "to", "cythonize", "the", "extensions", "." ]
def try_cythonize(extensions, linetracing=False, mandatory=True): """Attempt to cythonize the extensions. Args: extensions: A list of `distutils.extension.Extension`. linetracing: A bool indicating whether or not to enable linetracing. mandatory: Whether or not having Cython-generated files is mandat...
[ "def", "try_cythonize", "(", "extensions", ",", "linetracing", "=", "False", ",", "mandatory", "=", "True", ")", ":", "try", ":", "# Break import style to ensure we have access to Cython post-setup_requires", "import", "Cython", ".", "Build", "except", "ImportError", ":...
https://github.com/grpc/grpc/blob/27bc6fe7797e43298dc931b96dc57322d0852a9f/src/python/grpcio/commands.py#L165-L197
google/sling
f408a148a06bc2d62e853a292a8ba7266c642839
python/myelin/tf.py
python
attr_str
(value)
Convert attribute to string value.
Convert attribute to string value.
[ "Convert", "attribute", "to", "string", "value", "." ]
def attr_str(value): """ Convert attribute to string value.""" if isinstance(value, bool): return "true" if value else "false" elif isinstance(value, int): return str(value) elif isinstance(value, long): return str(value) elif isinstance(value, str): return value elif isinstance(value, list)...
[ "def", "attr_str", "(", "value", ")", ":", "if", "isinstance", "(", "value", ",", "bool", ")", ":", "return", "\"true\"", "if", "value", "else", "\"false\"", "elif", "isinstance", "(", "value", ",", "int", ")", ":", "return", "str", "(", "value", ")", ...
https://github.com/google/sling/blob/f408a148a06bc2d62e853a292a8ba7266c642839/python/myelin/tf.py#L16-L39
krishauser/Klampt
972cc83ea5befac3f653c1ba20f80155768ad519
Python/klampt/src/robotsim.py
python
IKObjective.setFreePosConstraint
(self)
return _robotsim.IKObjective_setFreePosConstraint(self)
r""" setFreePosConstraint(IKObjective self) Manual: Sets a free position constraint.
r""" setFreePosConstraint(IKObjective self)
[ "r", "setFreePosConstraint", "(", "IKObjective", "self", ")" ]
def setFreePosConstraint(self) -> "void": r""" setFreePosConstraint(IKObjective self) Manual: Sets a free position constraint. """ return _robotsim.IKObjective_setFreePosConstraint(self)
[ "def", "setFreePosConstraint", "(", "self", ")", "->", "\"void\"", ":", "return", "_robotsim", ".", "IKObjective_setFreePosConstraint", "(", "self", ")" ]
https://github.com/krishauser/Klampt/blob/972cc83ea5befac3f653c1ba20f80155768ad519/Python/klampt/src/robotsim.py#L6416-L6424
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/Jinja2/py3/jinja2/ext.py
python
InternationalizationExtension._make_node
( self, singular: str, plural: t.Optional[str], variables: t.Dict[str, nodes.Expr], plural_expr: t.Optional[nodes.Expr], vars_referenced: bool, num_called_num: bool, )
return nodes.Output([node])
Generates a useful node from the data provided.
Generates a useful node from the data provided.
[ "Generates", "a", "useful", "node", "from", "the", "data", "provided", "." ]
def _make_node( self, singular: str, plural: t.Optional[str], variables: t.Dict[str, nodes.Expr], plural_expr: t.Optional[nodes.Expr], vars_referenced: bool, num_called_num: bool, ) -> nodes.Output: """Generates a useful node from the data provided."""...
[ "def", "_make_node", "(", "self", ",", "singular", ":", "str", ",", "plural", ":", "t", ".", "Optional", "[", "str", "]", ",", "variables", ":", "t", ".", "Dict", "[", "str", ",", "nodes", ".", "Expr", "]", ",", "plural_expr", ":", "t", ".", "Opt...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/Jinja2/py3/jinja2/ext.py#L510-L572
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
wx/tools/Editra/plugins/filebrowser/filebrowser/browser.py
python
FileBrowser2.OnCompareItems
(self, item1, item2)
Handle SortItems
Handle SortItems
[ "Handle", "SortItems" ]
def OnCompareItems(self, item1, item2): """Handle SortItems""" data = self.GetPyData(item1) if data is not None: path1 = int(not os.path.isdir(data)) else: path1 = 0 tup1 = (path1, data.lower()) data2 = self.GetPyData(item2) if data2 is no...
[ "def", "OnCompareItems", "(", "self", ",", "item1", ",", "item2", ")", ":", "data", "=", "self", ".", "GetPyData", "(", "item1", ")", "if", "data", "is", "not", "None", ":", "path1", "=", "int", "(", "not", "os", ".", "path", ".", "isdir", "(", "...
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/tools/Editra/plugins/filebrowser/filebrowser/browser.py#L736-L757
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
wx/py/sliceshell.py
python
SlicesShell.about
(self)
Display information about Py.
Display information about Py.
[ "Display", "information", "about", "Py", "." ]
def about(self): """Display information about Py.""" text = DISPLAY_TEXT % \ (__author__, VERSION, self.revision, self.interp.revision, sys.version.split()[0], wx.VERSION_STRING, str(wx.PlatformInfo), sys.platform) self.write(text.strip(),type='Output')
[ "def", "about", "(", "self", ")", ":", "text", "=", "DISPLAY_TEXT", "%", "(", "__author__", ",", "VERSION", ",", "self", ".", "revision", ",", "self", ".", "interp", ".", "revision", ",", "sys", ".", "version", ".", "split", "(", ")", "[", "0", "]"...
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/py/sliceshell.py#L1006-L1012
hpi-xnor/BMXNet-v2
af2b1859eafc5c721b1397cef02f946aaf2ce20d
python/mxnet/contrib/onnx/onnx2mx/_op_translations.py
python
maximum
(attrs, inputs, proto_obj)
return mxnet_op, attrs, inputs
Elementwise maximum of arrays. MXNet maximum compares only two symbols at a time. ONNX can send more than two to compare. Breaking into multiple mxnet ops to compare two symbols at a time
Elementwise maximum of arrays. MXNet maximum compares only two symbols at a time. ONNX can send more than two to compare. Breaking into multiple mxnet ops to compare two symbols at a time
[ "Elementwise", "maximum", "of", "arrays", ".", "MXNet", "maximum", "compares", "only", "two", "symbols", "at", "a", "time", ".", "ONNX", "can", "send", "more", "than", "two", "to", "compare", ".", "Breaking", "into", "multiple", "mxnet", "ops", "to", "comp...
def maximum(attrs, inputs, proto_obj): """ Elementwise maximum of arrays. MXNet maximum compares only two symbols at a time. ONNX can send more than two to compare. Breaking into multiple mxnet ops to compare two symbols at a time """ if len(inputs) > 1: mxnet_op = symbol.maximum(inp...
[ "def", "maximum", "(", "attrs", ",", "inputs", ",", "proto_obj", ")", ":", "if", "len", "(", "inputs", ")", ">", "1", ":", "mxnet_op", "=", "symbol", ".", "maximum", "(", "inputs", "[", "0", "]", ",", "inputs", "[", "1", "]", ")", "for", "op_inpu...
https://github.com/hpi-xnor/BMXNet-v2/blob/af2b1859eafc5c721b1397cef02f946aaf2ce20d/python/mxnet/contrib/onnx/onnx2mx/_op_translations.py#L164-L177
weolar/miniblink49
1c4678db0594a4abde23d3ebbcc7cd13c3170777
third_party/WebKit/Tools/Scripts/webkitpy/thirdparty/autopep8.py
python
find_files
(filenames, recursive, exclude)
Yield filenames.
Yield filenames.
[ "Yield", "filenames", "." ]
def find_files(filenames, recursive, exclude): """Yield filenames.""" while filenames: name = filenames.pop(0) if recursive and os.path.isdir(name): for root, directories, children in os.walk(name): filenames += [os.path.join(root, f) for f in children ...
[ "def", "find_files", "(", "filenames", ",", "recursive", ",", "exclude", ")", ":", "while", "filenames", ":", "name", "=", "filenames", ".", "pop", "(", "0", ")", "if", "recursive", "and", "os", ".", "path", ".", "isdir", "(", "name", ")", ":", "for"...
https://github.com/weolar/miniblink49/blob/1c4678db0594a4abde23d3ebbcc7cd13c3170777/third_party/WebKit/Tools/Scripts/webkitpy/thirdparty/autopep8.py#L3527-L3540
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
contrib/gizmos/msw/gizmos.py
python
RemotelyScrolledTreeCtrl.__init__
(self, *args, **kwargs)
__init__(self, Window parent, int id, Point pos=DefaultPosition, Size size=DefaultSize, long style=TR_HAS_BUTTONS) -> RemotelyScrolledTreeCtrl
__init__(self, Window parent, int id, Point pos=DefaultPosition, Size size=DefaultSize, long style=TR_HAS_BUTTONS) -> RemotelyScrolledTreeCtrl
[ "__init__", "(", "self", "Window", "parent", "int", "id", "Point", "pos", "=", "DefaultPosition", "Size", "size", "=", "DefaultSize", "long", "style", "=", "TR_HAS_BUTTONS", ")", "-", ">", "RemotelyScrolledTreeCtrl" ]
def __init__(self, *args, **kwargs): """ __init__(self, Window parent, int id, Point pos=DefaultPosition, Size size=DefaultSize, long style=TR_HAS_BUTTONS) -> RemotelyScrolledTreeCtrl """ _gizmos.RemotelyScrolledTreeCtrl_swiginit(self,_gizmos.new_RemotelyScrolledTreeCtrl(*a...
[ "def", "__init__", "(", "self", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "_gizmos", ".", "RemotelyScrolledTreeCtrl_swiginit", "(", "self", ",", "_gizmos", ".", "new_RemotelyScrolledTreeCtrl", "(", "*", "args", ",", "*", "*", "kwargs", ")", ")",...
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/contrib/gizmos/msw/gizmos.py#L205-L211
turi-code/SFrame
796b9bdfb2fa1b881d82080754643c7e68629cd2
oss_src/unity/python/sframe/data_structures/sarray.py
python
SArray.contains
(self, item)
return SArray(_proxy = self.__proxy__.left_scalar_operator(item, 'in'))
Performs an element-wise search of "item" in the SArray. Conceptually equivalent to: >>> sa.apply(lambda x: item in x) If the current SArray contains strings and item is a string. Produces a 1 for each row if 'item' is a substring of the row and 0 otherwise. If the cu...
Performs an element-wise search of "item" in the SArray.
[ "Performs", "an", "element", "-", "wise", "search", "of", "item", "in", "the", "SArray", "." ]
def contains(self, item): """ Performs an element-wise search of "item" in the SArray. Conceptually equivalent to: >>> sa.apply(lambda x: item in x) If the current SArray contains strings and item is a string. Produces a 1 for each row if 'item' is a substring ...
[ "def", "contains", "(", "self", ",", "item", ")", ":", "return", "SArray", "(", "_proxy", "=", "self", ".", "__proxy__", ".", "left_scalar_operator", "(", "item", ",", "'in'", ")", ")" ]
https://github.com/turi-code/SFrame/blob/796b9bdfb2fa1b881d82080754643c7e68629cd2/oss_src/unity/python/sframe/data_structures/sarray.py#L818-L865
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_carbon/propgrid.py
python
PropertyGridInterface.GetPropertyParent
(*args, **kwargs)
return _propgrid.PropertyGridInterface_GetPropertyParent(*args, **kwargs)
GetPropertyParent(self, PGPropArg id) -> PGProperty
GetPropertyParent(self, PGPropArg id) -> PGProperty
[ "GetPropertyParent", "(", "self", "PGPropArg", "id", ")", "-", ">", "PGProperty" ]
def GetPropertyParent(*args, **kwargs): """GetPropertyParent(self, PGPropArg id) -> PGProperty""" return _propgrid.PropertyGridInterface_GetPropertyParent(*args, **kwargs)
[ "def", "GetPropertyParent", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_propgrid", ".", "PropertyGridInterface_GetPropertyParent", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/propgrid.py#L1237-L1239
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/tornado/tornado-6/tornado/web.py
python
RequestHandler.decode_argument
(self, value: bytes, name: Optional[str] = None)
Decodes an argument from the request. The argument has been percent-decoded and is now a byte string. By default, this method decodes the argument as utf-8 and returns a unicode string, but this may be overridden in subclasses. This method is used as a filter for both `get_argument()` ...
Decodes an argument from the request.
[ "Decodes", "an", "argument", "from", "the", "request", "." ]
def decode_argument(self, value: bytes, name: Optional[str] = None) -> str: """Decodes an argument from the request. The argument has been percent-decoded and is now a byte string. By default, this method decodes the argument as utf-8 and returns a unicode string, but this may be overri...
[ "def", "decode_argument", "(", "self", ",", "value", ":", "bytes", ",", "name", ":", "Optional", "[", "str", "]", "=", "None", ")", "->", "str", ":", "try", ":", "return", "_unicode", "(", "value", ")", "except", "UnicodeDecodeError", ":", "raise", "HT...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/tornado/tornado-6/tornado/web.py#L557-L575
mickem/nscp
79f89fdbb6da63f91bc9dedb7aea202fe938f237
scripts/python/lib/google/protobuf/internal/decoder.py
python
_SkipFixed32
(buffer, pos, end)
return pos
Skip a fixed32 value. Returns the new position.
Skip a fixed32 value. Returns the new position.
[ "Skip", "a", "fixed32", "value", ".", "Returns", "the", "new", "position", "." ]
def _SkipFixed32(buffer, pos, end): """Skip a fixed32 value. Returns the new position.""" pos += 4 if pos > end: raise _DecodeError('Truncated message.') return pos
[ "def", "_SkipFixed32", "(", "buffer", ",", "pos", ",", "end", ")", ":", "pos", "+=", "4", "if", "pos", ">", "end", ":", "raise", "_DecodeError", "(", "'Truncated message.'", ")", "return", "pos" ]
https://github.com/mickem/nscp/blob/79f89fdbb6da63f91bc9dedb7aea202fe938f237/scripts/python/lib/google/protobuf/internal/decoder.py#L668-L674
apache/singa
93fd9da72694e68bfe3fb29d0183a65263d238a1
python/singa/autograd.py
python
BinaryCrossEntropy.forward
(self, x)
return loss
Args: x (CTensor): 1d or 2d tensor, the prediction data(output) of current network. t (CTensor): 1d or 2d tensor, the target data for training. Returns: loss (CTensor): scalar.
Args: x (CTensor): 1d or 2d tensor, the prediction data(output) of current network. t (CTensor): 1d or 2d tensor, the target data for training. Returns: loss (CTensor): scalar.
[ "Args", ":", "x", "(", "CTensor", ")", ":", "1d", "or", "2d", "tensor", "the", "prediction", "data", "(", "output", ")", "of", "current", "network", ".", "t", "(", "CTensor", ")", ":", "1d", "or", "2d", "tensor", "the", "target", "data", "for", "tr...
def forward(self, x): """ Args: x (CTensor): 1d or 2d tensor, the prediction data(output) of current network. t (CTensor): 1d or 2d tensor, the target data for training. Returns: loss (CTensor): scalar. """ posx = singa...
[ "def", "forward", "(", "self", ",", "x", ")", ":", "posx", "=", "singa", ".", "AddFloat", "(", "x", ",", "0.0001", ")", "loss", "=", "singa", ".", "SumAll", "(", "singa", ".", "__mul__", "(", "self", ".", "t", ",", "singa", ".", "Log", "(", "po...
https://github.com/apache/singa/blob/93fd9da72694e68bfe3fb29d0183a65263d238a1/python/singa/autograd.py#L1165-L1182
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_cocoa/aui.py
python
AuiDefaultDockArt.__init__
(self, *args, **kwargs)
__init__(self) -> AuiDefaultDockArt
__init__(self) -> AuiDefaultDockArt
[ "__init__", "(", "self", ")", "-", ">", "AuiDefaultDockArt" ]
def __init__(self, *args, **kwargs): """__init__(self) -> AuiDefaultDockArt""" _aui.AuiDefaultDockArt_swiginit(self,_aui.new_AuiDefaultDockArt(*args, **kwargs))
[ "def", "__init__", "(", "self", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "_aui", ".", "AuiDefaultDockArt_swiginit", "(", "self", ",", "_aui", ".", "new_AuiDefaultDockArt", "(", "*", "args", ",", "*", "*", "kwargs", ")", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/aui.py#L1031-L1033
ValveSoftware/source-sdk-2013
0d8dceea4310fde5706b3ce1c70609d72a38efdf
mp/src/thirdparty/protobuf-2.3.0/python/mox.py
python
MockObject.__setitem__
(self, key, value)
return self._CreateMockMethod('__setitem__')(key, value)
Provide custom logic for mocking classes that support item assignment. Args: key: Key to set the value for. value: Value to set. Returns: Expected return value in replay mode. A MockMethod object for the __setitem__ method that has already been called if not in replay mode. Raise...
Provide custom logic for mocking classes that support item assignment.
[ "Provide", "custom", "logic", "for", "mocking", "classes", "that", "support", "item", "assignment", "." ]
def __setitem__(self, key, value): """Provide custom logic for mocking classes that support item assignment. Args: key: Key to set the value for. value: Value to set. Returns: Expected return value in replay mode. A MockMethod object for the __setitem__ method that has already bee...
[ "def", "__setitem__", "(", "self", ",", "key", ",", "value", ")", ":", "setitem", "=", "self", ".", "_class_to_mock", ".", "__dict__", ".", "get", "(", "'__setitem__'", ",", "None", ")", "# Verify the class supports item assignment.", "if", "setitem", "is", "N...
https://github.com/ValveSoftware/source-sdk-2013/blob/0d8dceea4310fde5706b3ce1c70609d72a38efdf/mp/src/thirdparty/protobuf-2.3.0/python/mox.py#L427-L457
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_cocoa/_gdi.py
python
GraphicsContext.EndDoc
(*args, **kwargs)
return _gdi_.GraphicsContext_EndDoc(*args, **kwargs)
EndDoc(self) Done with that document (relevant only for printing / pdf etc)
EndDoc(self)
[ "EndDoc", "(", "self", ")" ]
def EndDoc(*args, **kwargs): """ EndDoc(self) Done with that document (relevant only for printing / pdf etc) """ return _gdi_.GraphicsContext_EndDoc(*args, **kwargs)
[ "def", "EndDoc", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_gdi_", ".", "GraphicsContext_EndDoc", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/_gdi.py#L6038-L6044
PaddlePaddle/Paddle
1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c
python/paddle/fluid/contrib/layers/metric_op.py
python
ctr_metric_bundle
(input, label)
return local_sqrerr, local_abserr, local_prob, local_q, local_pos_num, local_ins_num
ctr related metric layer This function help compute the ctr related metrics: RMSE, MAE, predicted_ctr, q_value. To compute the final values of these metrics, we should do following computations using total instance number: MAE = local_abserr / instance number RMSE = sqrt(local_sqrerr / instance num...
ctr related metric layer
[ "ctr", "related", "metric", "layer" ]
def ctr_metric_bundle(input, label): """ ctr related metric layer This function help compute the ctr related metrics: RMSE, MAE, predicted_ctr, q_value. To compute the final values of these metrics, we should do following computations using total instance number: MAE = local_abserr / instance n...
[ "def", "ctr_metric_bundle", "(", "input", ",", "label", ")", ":", "assert", "input", ".", "shape", "==", "label", ".", "shape", "helper", "=", "LayerHelper", "(", "\"ctr_metric_bundle\"", ",", "*", "*", "locals", "(", ")", ")", "local_abserr", "=", "helper...
https://github.com/PaddlePaddle/Paddle/blob/1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c/python/paddle/fluid/contrib/layers/metric_op.py#L30-L188
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/scikit-learn/py3/sklearn/datasets/_species_distributions.py
python
_load_csv
(F)
return rec
Load csv file. Parameters ---------- F : file object CSV file open in byte mode. Returns ------- rec : np.ndarray record array representing the data
Load csv file.
[ "Load", "csv", "file", "." ]
def _load_csv(F): """Load csv file. Parameters ---------- F : file object CSV file open in byte mode. Returns ------- rec : np.ndarray record array representing the data """ names = F.readline().decode('ascii').strip().split(',') rec = np.loadtxt(F, skiprows=0,...
[ "def", "_load_csv", "(", "F", ")", ":", "names", "=", "F", ".", "readline", "(", ")", ".", "decode", "(", "'ascii'", ")", ".", "strip", "(", ")", ".", "split", "(", "','", ")", "rec", "=", "np", ".", "loadtxt", "(", "F", ",", "skiprows", "=", ...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scikit-learn/py3/sklearn/datasets/_species_distributions.py#L94-L111
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/pandas/py3/pandas/io/excel/_base.py
python
ExcelFile.parse
( self, sheet_name=0, header=0, names=None, index_col=None, usecols=None, squeeze=False, converters=None, true_values=None, false_values=None, skiprows=None, nrows=None, na_values=None, parse_dates=False, ...
return self._reader.parse( sheet_name=sheet_name, header=header, names=names, index_col=index_col, usecols=usecols, squeeze=squeeze, converters=converters, true_values=true_values, false_values=false_values, ...
Parse specified sheet(s) into a DataFrame. Equivalent to read_excel(ExcelFile, ...) See the read_excel docstring for more info on accepted parameters. Returns ------- DataFrame or dict of DataFrames DataFrame from the passed in Excel file.
Parse specified sheet(s) into a DataFrame.
[ "Parse", "specified", "sheet", "(", "s", ")", "into", "a", "DataFrame", "." ]
def parse( self, sheet_name=0, header=0, names=None, index_col=None, usecols=None, squeeze=False, converters=None, true_values=None, false_values=None, skiprows=None, nrows=None, na_values=None, parse_dates=F...
[ "def", "parse", "(", "self", ",", "sheet_name", "=", "0", ",", "header", "=", "0", ",", "names", "=", "None", ",", "index_col", "=", "None", ",", "usecols", "=", "None", ",", "squeeze", "=", "False", ",", "converters", "=", "None", ",", "true_values"...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/pandas/py3/pandas/io/excel/_base.py#L1238-L1293
yuxng/DA-RNN
77fbb50b4272514588a10a9f90b7d5f8d46974fb
lib/datasets/shapenet_single.py
python
shapenet_single._load_image_set_index
(self)
return image_index
Load the indexes listed in this dataset's image set file.
Load the indexes listed in this dataset's image set file.
[ "Load", "the", "indexes", "listed", "in", "this", "dataset", "s", "image", "set", "file", "." ]
def _load_image_set_index(self): """ Load the indexes listed in this dataset's image set file. """ image_set_file = os.path.join(self._shapenet_single_path, self._image_set + '.txt') assert os.path.exists(image_set_file), \ 'Path does not exist: {}'.format(image_s...
[ "def", "_load_image_set_index", "(", "self", ")", ":", "image_set_file", "=", "os", ".", "path", ".", "join", "(", "self", ".", "_shapenet_single_path", ",", "self", ".", "_image_set", "+", "'.txt'", ")", "assert", "os", ".", "path", ".", "exists", "(", ...
https://github.com/yuxng/DA-RNN/blob/77fbb50b4272514588a10a9f90b7d5f8d46974fb/lib/datasets/shapenet_single.py#L118-L128
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numpy/ma/core.py
python
_DomainGreaterEqual.__init__
(self, critical_value)
DomainGreaterEqual(v)(x) = true where x < v
DomainGreaterEqual(v)(x) = true where x < v
[ "DomainGreaterEqual", "(", "v", ")", "(", "x", ")", "=", "true", "where", "x", "<", "v" ]
def __init__(self, critical_value): "DomainGreaterEqual(v)(x) = true where x < v" self.critical_value = critical_value
[ "def", "__init__", "(", "self", ",", "critical_value", ")", ":", "self", ".", "critical_value", "=", "critical_value" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numpy/ma/core.py#L889-L891
clMathLibraries/clBLAS
cf9113982fdfc994297d372785ce76eb80911af2
src/scripts/perf/plotPerformance.py
python
plotFromDataFile
()
read in table(s) from file(s)
read in table(s) from file(s)
[ "read", "in", "table", "(", "s", ")", "from", "file", "(", "s", ")" ]
def plotFromDataFile(): data = [] """ read in table(s) from file(s) """ for thisFile in args.datafile: if not os.path.isfile(thisFile): print 'No file with the name \'{}\' exists. Please indicate another filename.'.format(thisFile) quit() results = open(thisFile, 'r') results_conten...
[ "def", "plotFromDataFile", "(", ")", ":", "data", "=", "[", "]", "for", "thisFile", "in", "args", ".", "datafile", ":", "if", "not", "os", ".", "path", ".", "isfile", "(", "thisFile", ")", ":", "print", "'No file with the name \\'{}\\' exists. Please indicate ...
https://github.com/clMathLibraries/clBLAS/blob/cf9113982fdfc994297d372785ce76eb80911af2/src/scripts/perf/plotPerformance.py#L68-L244
benoitsteiner/tensorflow-opencl
cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5
tensorflow/contrib/distributions/python/ops/independent.py
python
Independent.__init__
( self, distribution, reduce_batch_ndims=1, validate_args=False, name=None)
Construct a `Independent` distribution. Args: distribution: The base distribution instance to transform. Typically an instance of `Distribution`. reduce_batch_ndims: Scalar, integer number of rightmost batch dims which will be regard as event dims. validate_args: Python `bool`. W...
Construct a `Independent` distribution.
[ "Construct", "a", "Independent", "distribution", "." ]
def __init__( self, distribution, reduce_batch_ndims=1, validate_args=False, name=None): """Construct a `Independent` distribution. Args: distribution: The base distribution instance to transform. Typically an instance of `Distribution`. reduce_batch_ndims: Scalar, integer number of r...
[ "def", "__init__", "(", "self", ",", "distribution", ",", "reduce_batch_ndims", "=", "1", ",", "validate_args", "=", "False", ",", "name", "=", "None", ")", ":", "parameters", "=", "locals", "(", ")", "name", "=", "name", "or", "\"Independent\"", "+", "d...
https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/contrib/distributions/python/ops/independent.py#L96-L136
tensorflow/tensorflow
419e3a6b650ea4bd1b0cba23c4348f8a69f3272e
tensorflow/python/keras/utils/io_utils.py
python
ask_to_proceed_with_overwrite
(filepath)
return True
Produces a prompt asking about overwriting a file. Args: filepath: the path to the file to be overwritten. Returns: True if we can proceed with overwrite, False otherwise.
Produces a prompt asking about overwriting a file.
[ "Produces", "a", "prompt", "asking", "about", "overwriting", "a", "file", "." ]
def ask_to_proceed_with_overwrite(filepath): """Produces a prompt asking about overwriting a file. Args: filepath: the path to the file to be overwritten. Returns: True if we can proceed with overwrite, False otherwise. """ overwrite = input('[WARNING] %s already exists - overwrite? ' ...
[ "def", "ask_to_proceed_with_overwrite", "(", "filepath", ")", ":", "overwrite", "=", "input", "(", "'[WARNING] %s already exists - overwrite? '", "'[y/n]'", "%", "(", "filepath", ")", ")", ".", "strip", "(", ")", ".", "lower", "(", ")", "while", "overwrite", "no...
https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/keras/utils/io_utils.py#L42-L59
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemFramework/v1/AWS/resource-manager-code/lib/pkg_resources/_vendor/pyparsing.py
python
ParserElement.setDefaultWhitespaceChars
( chars )
r""" Overrides the default whitespace chars Example:: # default whitespace chars are space, <TAB> and newline OneOrMore(Word(alphas)).parseString("abc def\nghi jkl") # -> ['abc', 'def', 'ghi', 'jkl'] # change to just treat newline as significant ...
r""" Overrides the default whitespace chars
[ "r", "Overrides", "the", "default", "whitespace", "chars" ]
def setDefaultWhitespaceChars( chars ): r""" Overrides the default whitespace chars Example:: # default whitespace chars are space, <TAB> and newline OneOrMore(Word(alphas)).parseString("abc def\nghi jkl") # -> ['abc', 'def', 'ghi', 'jkl'] # cha...
[ "def", "setDefaultWhitespaceChars", "(", "chars", ")", ":", "ParserElement", ".", "DEFAULT_WHITE_CHARS", "=", "chars" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemFramework/v1/AWS/resource-manager-code/lib/pkg_resources/_vendor/pyparsing.py#L1109-L1121
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/x86/toolchain/lib/python2.7/plat-mac/lib-scriptpackages/Finder/Finder_items.py
python
Finder_items_Events.add_to_favorites
(self, _object, _attributes={}, **_arguments)
add to favorites: (NOT AVAILABLE YET) Add the items to the user\xd5s Favorites Required argument: the items to add to the collection of Favorites Keyword argument _attributes: AppleEvent attribute dictionary
add to favorites: (NOT AVAILABLE YET) Add the items to the user\xd5s Favorites Required argument: the items to add to the collection of Favorites Keyword argument _attributes: AppleEvent attribute dictionary
[ "add", "to", "favorites", ":", "(", "NOT", "AVAILABLE", "YET", ")", "Add", "the", "items", "to", "the", "user", "\\", "xd5s", "Favorites", "Required", "argument", ":", "the", "items", "to", "add", "to", "the", "collection", "of", "Favorites", "Keyword", ...
def add_to_favorites(self, _object, _attributes={}, **_arguments): """add to favorites: (NOT AVAILABLE YET) Add the items to the user\xd5s Favorites Required argument: the items to add to the collection of Favorites Keyword argument _attributes: AppleEvent attribute dictionary """ ...
[ "def", "add_to_favorites", "(", "self", ",", "_object", ",", "_attributes", "=", "{", "}", ",", "*", "*", "_arguments", ")", ":", "_code", "=", "'fndr'", "_subcode", "=", "'ffav'", "if", "_arguments", ":", "raise", "TypeError", ",", "'No optional args expect...
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/x86/toolchain/lib/python2.7/plat-mac/lib-scriptpackages/Finder/Finder_items.py#L15-L33
mantidproject/mantid
03deeb89254ec4289edb8771e0188c2090a02f32
scripts/Calibration/tube_spec.py
python
TubeSpec.setTubeSpecByStringArray
( self, tubeSpecArray )
Define the sets of tube from the workspace with an array of strings. Set tube specification like setTubeSpecByString, but with an array of string to enable multiple components to be calibrated. This function allows you to calibrate a set of tubes that is not defined by a single component. ...
Define the sets of tube from the workspace with an array of strings.
[ "Define", "the", "sets", "of", "tube", "from", "the", "workspace", "with", "an", "array", "of", "strings", "." ]
def setTubeSpecByStringArray( self, tubeSpecArray ): """ Define the sets of tube from the workspace with an array of strings. Set tube specification like setTubeSpecByString, but with an array of string to enable multiple components to be calibrated. This function allows you to...
[ "def", "setTubeSpecByStringArray", "(", "self", ",", "tubeSpecArray", ")", ":", "for", "i", "in", "range", "(", "len", "(", "tubeSpecArray", ")", ")", ":", "self", ".", "setTubeSpecByString", "(", "tubeSpecArray", "[", "i", "]", ")" ]
https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/scripts/Calibration/tube_spec.py#L88-L104