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
SFTtech/openage
d6a08c53c48dc1e157807471df92197f6ca9e04d
openage/convert/processor/conversion/swgbcc/nyan_subprocessor.py
python
SWGBCCNyanSubprocessor.convert
(cls, gamedata)
Create nyan objects from the given dataset.
Create nyan objects from the given dataset.
[ "Create", "nyan", "objects", "from", "the", "given", "dataset", "." ]
def convert(cls, gamedata): """ Create nyan objects from the given dataset. """ cls._process_game_entities(gamedata) cls._create_nyan_objects(gamedata) cls._create_nyan_members(gamedata) cls._check_objects(gamedata)
[ "def", "convert", "(", "cls", ",", "gamedata", ")", ":", "cls", ".", "_process_game_entities", "(", "gamedata", ")", "cls", ".", "_create_nyan_objects", "(", "gamedata", ")", "cls", ".", "_create_nyan_members", "(", "gamedata", ")", "cls", ".", "_check_objects...
https://github.com/SFTtech/openage/blob/d6a08c53c48dc1e157807471df92197f6ca9e04d/openage/convert/processor/conversion/swgbcc/nyan_subprocessor.py#L32-L40
windystrife/UnrealEngine_NVIDIAGameWorks
b50e6338a7c5b26374d66306ebc7807541ff815e
Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/site-packages/pythonwin/pywin/framework/app.py
python
SaveWindowSize
(section,rect,state="")
Writes a rectangle to an INI file Args: section = section name in the applications INI file rect = a rectangle in a (cy, cx, y, x) tuple (same format as CREATESTRUCT position tuples).
Writes a rectangle to an INI file Args: section = section name in the applications INI file rect = a rectangle in a (cy, cx, y, x) tuple (same format as CREATESTRUCT position tuples).
[ "Writes", "a", "rectangle", "to", "an", "INI", "file", "Args", ":", "section", "=", "section", "name", "in", "the", "applications", "INI", "file", "rect", "=", "a", "rectangle", "in", "a", "(", "cy", "cx", "y", "x", ")", "tuple", "(", "same", "format...
def SaveWindowSize(section,rect,state=""): """ Writes a rectangle to an INI file Args: section = section name in the applications INI file rect = a rectangle in a (cy, cx, y, x) tuple (same format as CREATESTRUCT position tuples).""" left, top, right, bottom = rect if state: state = state + "...
[ "def", "SaveWindowSize", "(", "section", ",", "rect", ",", "state", "=", "\"\"", ")", ":", "left", ",", "top", ",", "right", ",", "bottom", "=", "rect", "if", "state", ":", "state", "=", "state", "+", "\" \"", "win32ui", ".", "WriteProfileVal", "(", ...
https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/site-packages/pythonwin/pywin/framework/app.py#L37-L47
hpi-xnor/BMXNet
ed0b201da6667887222b8e4b5f997c4f6b61943d
example/ssd/train.py
python
parse_class_names
(args)
return class_names
parse # classes and class_names if applicable
parse # classes and class_names if applicable
[ "parse", "#", "classes", "and", "class_names", "if", "applicable" ]
def parse_class_names(args): """ parse # classes and class_names if applicable """ num_class = args.num_class if len(args.class_names) > 0: if os.path.isfile(args.class_names): # try to open it to read class names with open(args.class_names, 'r') as f: class_n...
[ "def", "parse_class_names", "(", "args", ")", ":", "num_class", "=", "args", ".", "num_class", "if", "len", "(", "args", ".", "class_names", ")", ">", "0", ":", "if", "os", ".", "path", ".", "isfile", "(", "args", ".", "class_names", ")", ":", "# try...
https://github.com/hpi-xnor/BMXNet/blob/ed0b201da6667887222b8e4b5f997c4f6b61943d/example/ssd/train.py#L107-L122
llvm/llvm-project
ffa6262cb4e2a335d26416fad39a581b4f98c5f4
lldb/third_party/Python/module/pexpect-4.6/pexpect/pxssh.py
python
pxssh.set_unique_prompt
(self)
return True
This sets the remote prompt to something more unique than ``#`` or ``$``. This makes it easier for the :meth:`prompt` method to match the shell prompt unambiguously. This method is called automatically by the :meth:`login` method, but you may want to call it manually if you somehow reset the ...
This sets the remote prompt to something more unique than ``#`` or ``$``. This makes it easier for the :meth:`prompt` method to match the shell prompt unambiguously. This method is called automatically by the :meth:`login` method, but you may want to call it manually if you somehow reset the ...
[ "This", "sets", "the", "remote", "prompt", "to", "something", "more", "unique", "than", "#", "or", "$", ".", "This", "makes", "it", "easier", "for", "the", ":", "meth", ":", "prompt", "method", "to", "match", "the", "shell", "prompt", "unambiguously", "....
def set_unique_prompt(self): '''This sets the remote prompt to something more unique than ``#`` or ``$``. This makes it easier for the :meth:`prompt` method to match the shell prompt unambiguously. This method is called automatically by the :meth:`login` method, but you may want to call ...
[ "def", "set_unique_prompt", "(", "self", ")", ":", "self", ".", "sendline", "(", "\"unset PROMPT_COMMAND\"", ")", "self", ".", "sendline", "(", "self", ".", "PROMPT_SET_SH", ")", "# sh-style", "i", "=", "self", ".", "expect", "(", "[", "TIMEOUT", ",", "sel...
https://github.com/llvm/llvm-project/blob/ffa6262cb4e2a335d26416fad39a581b4f98c5f4/lldb/third_party/Python/module/pexpect-4.6/pexpect/pxssh.py#L473-L497
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/xml/sax/handler.py
python
ErrorHandler.fatalError
(self, exception)
Handle a non-recoverable error.
Handle a non-recoverable error.
[ "Handle", "a", "non", "-", "recoverable", "error", "." ]
def fatalError(self, exception): "Handle a non-recoverable error." raise exception
[ "def", "fatalError", "(", "self", ",", "exception", ")", ":", "raise", "exception" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/xml/sax/handler.py#L36-L38
mantidproject/mantid
03deeb89254ec4289edb8771e0188c2090a02f32
scripts/reduction_gui/reduction/reflectometer/refl_data_series.py
python
DataSeries.from_xml
(self, xml_str)
Read in data from XML @param xml_str: text to read the data from
Read in data from XML
[ "Read", "in", "data", "from", "XML" ]
def from_xml(self, xml_str): """ Read in data from XML @param xml_str: text to read the data from """ self.reset() self.data_sets = [] dom = xml.dom.minidom.parseString(xml_str) # # Get Mantid version # mtd_version = BaseScriptElement.getMan...
[ "def", "from_xml", "(", "self", ",", "xml_str", ")", ":", "self", ".", "reset", "(", ")", "self", ".", "data_sets", "=", "[", "]", "dom", "=", "xml", ".", "dom", ".", "minidom", ".", "parseString", "(", "xml_str", ")", "# # Get Mantid version", ...
https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/scripts/reduction_gui/reduction/reflectometer/refl_data_series.py#L50-L75
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_cocoa/_misc.py
python
DateSpan.Day
(*args, **kwargs)
return _misc_.DateSpan_Day(*args, **kwargs)
Day() -> DateSpan
Day() -> DateSpan
[ "Day", "()", "-", ">", "DateSpan" ]
def Day(*args, **kwargs): """Day() -> DateSpan""" return _misc_.DateSpan_Day(*args, **kwargs)
[ "def", "Day", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_misc_", ".", "DateSpan_Day", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/_misc.py#L4618-L4620
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/scipy/py2/scipy/special/_generate_pyx.py
python
npy_cdouble_from_double_complex
(var)
return res
Cast a cython double complex to a numpy cdouble.
Cast a cython double complex to a numpy cdouble.
[ "Cast", "a", "cython", "double", "complex", "to", "a", "numpy", "cdouble", "." ]
def npy_cdouble_from_double_complex(var): """Cast a cython double complex to a numpy cdouble.""" res = "_complexstuff.npy_cdouble_from_double_complex({})".format(var) return res
[ "def", "npy_cdouble_from_double_complex", "(", "var", ")", ":", "res", "=", "\"_complexstuff.npy_cdouble_from_double_complex({})\"", ".", "format", "(", "var", ")", "return", "res" ]
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/py2/scipy/special/_generate_pyx.py#L449-L452
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_cocoa/_misc.py
python
DateSpan.Month
(*args, **kwargs)
return _misc_.DateSpan_Month(*args, **kwargs)
Month() -> DateSpan
Month() -> DateSpan
[ "Month", "()", "-", ">", "DateSpan" ]
def Month(*args, **kwargs): """Month() -> DateSpan""" return _misc_.DateSpan_Month(*args, **kwargs)
[ "def", "Month", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_misc_", ".", "DateSpan_Month", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/_misc.py#L4638-L4640
google/earthenterprise
0fe84e29be470cd857e3a0e52e5d0afd5bb8cee9
earth_enterprise/src/google/protobuf-py/google/protobuf/descriptor.py
python
MethodDescriptor.__init__
(self, name, full_name, index, containing_service, input_type, output_type, options=None)
The arguments are as described in the description of MethodDescriptor attributes above. Note that containing_service may be None, and may be set later if necessary.
The arguments are as described in the description of MethodDescriptor attributes above.
[ "The", "arguments", "are", "as", "described", "in", "the", "description", "of", "MethodDescriptor", "attributes", "above", "." ]
def __init__(self, name, full_name, index, containing_service, input_type, output_type, options=None): """The arguments are as described in the description of MethodDescriptor attributes above. Note that containing_service may be None, and may be set later if necessary. """ super(Met...
[ "def", "__init__", "(", "self", ",", "name", ",", "full_name", ",", "index", ",", "containing_service", ",", "input_type", ",", "output_type", ",", "options", "=", "None", ")", ":", "super", "(", "MethodDescriptor", ",", "self", ")", ".", "__init__", "(", ...
https://github.com/google/earthenterprise/blob/0fe84e29be470cd857e3a0e52e5d0afd5bb8cee9/earth_enterprise/src/google/protobuf-py/google/protobuf/descriptor.py#L544-L557
NREL/EnergyPlus
fadc5973b85c70e8cc923efb69c144e808a26078
src/EnergyPlus/api/datatransfer.py
python
DataExchange.list_available_api_data_csv
(self, state: c_void_p)
return self.api.listAllAPIDataCSV(state)
Lists out all API data stuff in an easily parseable CSV form :param state: An active EnergyPlus "state" that is returned from a call to `api.state_manager.new_state()`. :return: Returns a raw bytes CSV representation of the available API data
Lists out all API data stuff in an easily parseable CSV form
[ "Lists", "out", "all", "API", "data", "stuff", "in", "an", "easily", "parseable", "CSV", "form" ]
def list_available_api_data_csv(self, state: c_void_p) -> bytes: """ Lists out all API data stuff in an easily parseable CSV form :param state: An active EnergyPlus "state" that is returned from a call to `api.state_manager.new_state()`. :return: Returns a raw bytes CSV representation o...
[ "def", "list_available_api_data_csv", "(", "self", ",", "state", ":", "c_void_p", ")", "->", "bytes", ":", "return", "self", ".", "api", ".", "listAllAPIDataCSV", "(", "state", ")" ]
https://github.com/NREL/EnergyPlus/blob/fadc5973b85c70e8cc923efb69c144e808a26078/src/EnergyPlus/api/datatransfer.py#L251-L258
PaddlePaddle/Paddle
1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c
python/paddle/dataset/movielens.py
python
UserInfo.value
(self)
return [self.index, 0 if self.is_male else 1, self.age, self.job_id]
Get information from a user.
Get information from a user.
[ "Get", "information", "from", "a", "user", "." ]
def value(self): """ Get information from a user. """ return [self.index, 0 if self.is_male else 1, self.age, self.job_id]
[ "def", "value", "(", "self", ")", ":", "return", "[", "self", ".", "index", ",", "0", "if", "self", ".", "is_male", "else", "1", ",", "self", ".", "age", ",", "self", ".", "job_id", "]" ]
https://github.com/PaddlePaddle/Paddle/blob/1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c/python/paddle/dataset/movielens.py#L84-L88
benoitsteiner/tensorflow-opencl
cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5
tensorflow/python/debug/cli/debugger_cli_common.py
python
CommandHandlerRegistry._get_help_for_command_prefix
(self, cmd_prefix)
return lines
Compile the help information for a given command prefix. Args: cmd_prefix: Command prefix, as the prefix itself or one of its aliases. Returns: A list of str as the help information fo cmd_prefix. If the cmd_prefix does not exist, the returned list of str will indicate that.
Compile the help information for a given command prefix.
[ "Compile", "the", "help", "information", "for", "a", "given", "command", "prefix", "." ]
def _get_help_for_command_prefix(self, cmd_prefix): """Compile the help information for a given command prefix. Args: cmd_prefix: Command prefix, as the prefix itself or one of its aliases. Returns: A list of str as the help information fo cmd_prefix. If the cmd_prefix does not...
[ "def", "_get_help_for_command_prefix", "(", "self", ",", "cmd_prefix", ")", ":", "lines", "=", "[", "]", "resolved_prefix", "=", "self", ".", "_resolve_prefix", "(", "cmd_prefix", ")", "if", "not", "resolved_prefix", ":", "lines", ".", "append", "(", "\"Invali...
https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/python/debug/cli/debugger_cli_common.py#L783-L812
windystrife/UnrealEngine_NVIDIAGameWorks
b50e6338a7c5b26374d66306ebc7807541ff815e
Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/urllib.py
python
urlencode
(query, doseq=0)
return '&'.join(l)
Encode a sequence of two-element tuples or dictionary into a URL query string. If any values in the query arg are sequences and doseq is true, each sequence element is converted to a separate parameter. If the query arg is a sequence of two-element tuples, the order of the parameters in the output wil...
Encode a sequence of two-element tuples or dictionary into a URL query string.
[ "Encode", "a", "sequence", "of", "two", "-", "element", "tuples", "or", "dictionary", "into", "a", "URL", "query", "string", "." ]
def urlencode(query, doseq=0): """Encode a sequence of two-element tuples or dictionary into a URL query string. If any values in the query arg are sequences and doseq is true, each sequence element is converted to a separate parameter. If the query arg is a sequence of two-element tuples, the order o...
[ "def", "urlencode", "(", "query", ",", "doseq", "=", "0", ")", ":", "if", "hasattr", "(", "query", ",", "\"items\"", ")", ":", "# mapping objects", "query", "=", "query", ".", "items", "(", ")", "else", ":", "# it's a bother at times that strings and string-li...
https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/urllib.py#L1291-L1352
PX4/PX4-Autopilot
0b9f60a0370be53d683352c63fd92db3d6586e18
Tools/cryptotools.py
python
make_public_key_h_file
(signing_key,key_name)
This file generate the public key header file to be included into the bootloader build.
This file generate the public key header file to be included into the bootloader build.
[ "This", "file", "generate", "the", "public", "key", "header", "file", "to", "be", "included", "into", "the", "bootloader", "build", "." ]
def make_public_key_h_file(signing_key,key_name): """ This file generate the public key header file to be included into the bootloader build. """ public_key_c='\n' for i,c in enumerate(signing_key.verify_key.encode(encoder=nacl.encoding.RawEncoder)): public_key_c+= hex(c) public_...
[ "def", "make_public_key_h_file", "(", "signing_key", ",", "key_name", ")", ":", "public_key_c", "=", "'\\n'", "for", "i", ",", "c", "in", "enumerate", "(", "signing_key", ".", "verify_key", ".", "encode", "(", "encoder", "=", "nacl", ".", "encoding", ".", ...
https://github.com/PX4/PX4-Autopilot/blob/0b9f60a0370be53d683352c63fd92db3d6586e18/Tools/cryptotools.py#L14-L27
bristolcrypto/SPDZ-2
721abfae849625a02ea49aabc534f9cf41ca643f
Compiler/program.py
python
Tape.reset_registers
(self)
Reset register values to zero.
Reset register values to zero.
[ "Reset", "register", "values", "to", "zero", "." ]
def reset_registers(self): """ Reset register values to zero. """ self.reg_values = RegType.create_dict(lambda: [0] * INIT_REG_MAX)
[ "def", "reset_registers", "(", "self", ")", ":", "self", ".", "reg_values", "=", "RegType", ".", "create_dict", "(", "lambda", ":", "[", "0", "]", "*", "INIT_REG_MAX", ")" ]
https://github.com/bristolcrypto/SPDZ-2/blob/721abfae849625a02ea49aabc534f9cf41ca643f/Compiler/program.py#L698-L700
Harick1/caffe-yolo
eea92bf3ddfe4d0ff6b0b3ba9b15c029a83ed9a3
tools/extra/extract_seconds.py
python
get_log_created_year
(input_file)
return log_created_year
Get year from log file system timestamp
Get year from log file system timestamp
[ "Get", "year", "from", "log", "file", "system", "timestamp" ]
def get_log_created_year(input_file): """Get year from log file system timestamp """ log_created_time = os.path.getctime(input_file) log_created_year = datetime.datetime.fromtimestamp(log_created_time).year return log_created_year
[ "def", "get_log_created_year", "(", "input_file", ")", ":", "log_created_time", "=", "os", ".", "path", ".", "getctime", "(", "input_file", ")", "log_created_year", "=", "datetime", ".", "datetime", ".", "fromtimestamp", "(", "log_created_time", ")", ".", "year"...
https://github.com/Harick1/caffe-yolo/blob/eea92bf3ddfe4d0ff6b0b3ba9b15c029a83ed9a3/tools/extra/extract_seconds.py#L22-L28
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemFramework/v1/ResourceManager/resource_manager/hook.py
python
HookModule.resource_group
(self)
return self.__resource_group
The resource group that implements the hook, if any.
The resource group that implements the hook, if any.
[ "The", "resource", "group", "that", "implements", "the", "hook", "if", "any", "." ]
def resource_group(self): """The resource group that implements the hook, if any.""" return self.__resource_group
[ "def", "resource_group", "(", "self", ")", ":", "return", "self", ".", "__resource_group" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemFramework/v1/ResourceManager/resource_manager/hook.py#L215-L217
cms-sw/cmssw
fd9de012d503d3405420bcbeec0ec879baa57cf2
FWCore/ParameterSet/python/Mixins.py
python
_Parameterizable.parameters_
(self)
return result
Returns a dictionary of copies of the user-set parameters
Returns a dictionary of copies of the user-set parameters
[ "Returns", "a", "dictionary", "of", "copies", "of", "the", "user", "-", "set", "parameters" ]
def parameters_(self): """Returns a dictionary of copies of the user-set parameters""" import copy result = dict() for name in self.parameterNames_(): result[name]=copy.deepcopy(self.__dict__[name]) return result
[ "def", "parameters_", "(", "self", ")", ":", "import", "copy", "result", "=", "dict", "(", ")", "for", "name", "in", "self", ".", "parameterNames_", "(", ")", ":", "result", "[", "name", "]", "=", "copy", ".", "deepcopy", "(", "self", ".", "__dict__"...
https://github.com/cms-sw/cmssw/blob/fd9de012d503d3405420bcbeec0ec879baa57cf2/FWCore/ParameterSet/python/Mixins.py#L227-L233
NVIDIA/DALI
bf16cc86ba8f091b145f91962f21fe1b6aff243d
dali/python/nvidia/dali/plugin/mxnet.py
python
_DALIMXNetIteratorBase.next
(self)
return self.__next__()
Returns the next batch of data.
Returns the next batch of data.
[ "Returns", "the", "next", "batch", "of", "data", "." ]
def next(self): """ Returns the next batch of data. """ return self.__next__()
[ "def", "next", "(", "self", ")", ":", "return", "self", ".", "__next__", "(", ")" ]
https://github.com/NVIDIA/DALI/blob/bf16cc86ba8f091b145f91962f21fe1b6aff243d/dali/python/nvidia/dali/plugin/mxnet.py#L99-L103
toggl-open-source/toggldesktop
91865205885531cc8fd9e8d613dad49d625d56e7
third_party/cpplint/cpplint.py
python
_SetOutputFormat
(output_format)
Sets the module's output format.
Sets the module's output format.
[ "Sets", "the", "module", "s", "output", "format", "." ]
def _SetOutputFormat(output_format): """Sets the module's output format.""" _cpplint_state.SetOutputFormat(output_format)
[ "def", "_SetOutputFormat", "(", "output_format", ")", ":", "_cpplint_state", ".", "SetOutputFormat", "(", "output_format", ")" ]
https://github.com/toggl-open-source/toggldesktop/blob/91865205885531cc8fd9e8d613dad49d625d56e7/third_party/cpplint/cpplint.py#L856-L858
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/thrift/server/TNonblockingServer.py
python
Connection.read
(self)
Reads data from stream and switch state.
Reads data from stream and switch state.
[ "Reads", "data", "from", "stream", "and", "switch", "state", "." ]
def read(self): """Reads data from stream and switch state.""" assert self.status in (WAIT_LEN, WAIT_MESSAGE) assert not self.received buf_size = 8192 first = True done = False while not done: read = self.socket.recv(buf_size) rlen = len(re...
[ "def", "read", "(", "self", ")", ":", "assert", "self", ".", "status", "in", "(", "WAIT_LEN", ",", "WAIT_MESSAGE", ")", "assert", "not", "self", ".", "received", "buf_size", "=", "8192", "first", "=", "True", "done", "=", "False", "while", "not", "done...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/thrift/server/TNonblockingServer.py#L133-L165
mongodb/mongo-cxx-driver
eb86512b05be20d2f51d53ba9b860c709e0799b3
etc/clang_format.py
python
callo
(args)
return check_output(args)
Call a program, and capture its output
Call a program, and capture its output
[ "Call", "a", "program", "and", "capture", "its", "output" ]
def callo(args): """Call a program, and capture its output """ return check_output(args)
[ "def", "callo", "(", "args", ")", ":", "return", "check_output", "(", "args", ")" ]
https://github.com/mongodb/mongo-cxx-driver/blob/eb86512b05be20d2f51d53ba9b860c709e0799b3/etc/clang_format.py#L110-L113
wesnoth/wesnoth
6ccac5a5e8ff75303c9190c0da60580925cb32c0
data/tools/wesnoth/wmlparser.py
python
Parser.parse_stream
(self, stream, binary = False)
Set the parser to parse from a file object.
Set the parser to parse from a file object.
[ "Set", "the", "parser", "to", "parse", "from", "a", "file", "object", "." ]
def parse_stream(self, stream, binary = False): """ Set the parser to parse from a file object. """ text = stream.read() if not binary: text = text.replace("\r\n", "\n").replace("\t", " ").replace("\r", "\n") self.push_text("inline", text)
[ "def", "parse_stream", "(", "self", ",", "stream", ",", "binary", "=", "False", ")", ":", "text", "=", "stream", ".", "read", "(", ")", "if", "not", "binary", ":", "text", "=", "text", ".", "replace", "(", "\"\\r\\n\"", ",", "\"\\n\"", ")", ".", "r...
https://github.com/wesnoth/wesnoth/blob/6ccac5a5e8ff75303c9190c0da60580925cb32c0/data/tools/wesnoth/wmlparser.py#L134-L141
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/botocore/hooks.py
python
BaseEventHooks.register_first
(self, event_name, handler, unique_id=None, unique_id_uses_count=False)
Register an event handler to be called first for an event. All event handlers registered with ``register_first()`` will be called before handlers registered with ``register()`` and ``register_last()``.
Register an event handler to be called first for an event.
[ "Register", "an", "event", "handler", "to", "be", "called", "first", "for", "an", "event", "." ]
def register_first(self, event_name, handler, unique_id=None, unique_id_uses_count=False): """Register an event handler to be called first for an event. All event handlers registered with ``register_first()`` will be called before handlers registered with ``register()`` a...
[ "def", "register_first", "(", "self", ",", "event_name", ",", "handler", ",", "unique_id", "=", "None", ",", "unique_id_uses_count", "=", "False", ")", ":", "self", ".", "_verify_and_register", "(", "event_name", ",", "handler", ",", "unique_id", ",", "registe...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/botocore/hooks.py#L103-L114
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
wx/lib/agw/piectrl.py
python
PieCtrl.DrawParts
(self, dc, cx, cy, w, h)
Draws the :class:`PieCtrl` external edges. :param `dc`: an instance of :class:`DC`; :param `cx`: the part `x` coordinate; :param `cy`: the part `y` coordinate; :param `w`: the control's width; :param `h`: the control's height.
Draws the :class:`PieCtrl` external edges.
[ "Draws", "the", ":", "class", ":", "PieCtrl", "external", "edges", "." ]
def DrawParts(self, dc, cx, cy, w, h): """ Draws the :class:`PieCtrl` external edges. :param `dc`: an instance of :class:`DC`; :param `cx`: the part `x` coordinate; :param `cy`: the part `y` coordinate; :param `w`: the control's width; :param `h`: the control's h...
[ "def", "DrawParts", "(", "self", ",", "dc", ",", "cx", ",", "cy", ",", "w", ",", "h", ")", ":", "angles", "=", "self", ".", "GetPartAngles", "(", ")", "oldpen", "=", "dc", ".", "GetPen", "(", ")", "if", "self", ".", "_showedges", ":", "dc", "."...
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/agw/piectrl.py#L650-L689
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemFramework/v1/AWS/resource-manager-code/lib/setuptools/package_index.py
python
ContentChecker.is_valid
(self)
return True
Check the hash. Return False if validation fails.
Check the hash. Return False if validation fails.
[ "Check", "the", "hash", ".", "Return", "False", "if", "validation", "fails", "." ]
def is_valid(self): """ Check the hash. Return False if validation fails. """ return True
[ "def", "is_valid", "(", "self", ")", ":", "return", "True" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemFramework/v1/AWS/resource-manager-code/lib/setuptools/package_index.py#L252-L256
bigartm/bigartm
47e37f982de87aa67bfd475ff1f39da696b181b3
3rdparty/protobuf-3.0.0/python/google/protobuf/internal/python_message.py
python
_DefaultValueConstructorForField
(field)
return MakeScalarDefault
Returns a function which returns a default value for a field. Args: field: FieldDescriptor object for this field. The returned function has one argument: message: Message instance containing this field, or a weakref proxy of same. That function in turn returns a default value for this field. The...
Returns a function which returns a default value for a field.
[ "Returns", "a", "function", "which", "returns", "a", "default", "value", "for", "a", "field", "." ]
def _DefaultValueConstructorForField(field): """Returns a function which returns a default value for a field. Args: field: FieldDescriptor object for this field. The returned function has one argument: message: Message instance containing this field, or a weakref proxy of same. That function in...
[ "def", "_DefaultValueConstructorForField", "(", "field", ")", ":", "if", "_IsMapField", "(", "field", ")", ":", "return", "_GetInitializeDefaultForMap", "(", "field", ")", "if", "field", ".", "label", "==", "_FieldDescriptor", ".", "LABEL_REPEATED", ":", "if", "...
https://github.com/bigartm/bigartm/blob/47e37f982de87aa67bfd475ff1f39da696b181b3/3rdparty/protobuf-3.0.0/python/google/protobuf/internal/python_message.py#L392-L444
sdhash/sdhash
b9eff63e4e5867e910f41fd69032bbb1c94a2a5e
sdhash-ui/cherrypy/lib/sessions.py
python
save
()
Save any changed session data.
Save any changed session data.
[ "Save", "any", "changed", "session", "data", "." ]
def save(): """Save any changed session data.""" if not hasattr(cherrypy.serving, "session"): return request = cherrypy.serving.request response = cherrypy.serving.response # Guard against running twice if hasattr(request, "_sessionsaved"): return request._sessionsa...
[ "def", "save", "(", ")", ":", "if", "not", "hasattr", "(", "cherrypy", ".", "serving", ",", "\"session\"", ")", ":", "return", "request", "=", "cherrypy", ".", "serving", ".", "request", "response", "=", "cherrypy", ".", "serving", ".", "response", "# Gu...
https://github.com/sdhash/sdhash/blob/b9eff63e4e5867e910f41fd69032bbb1c94a2a5e/sdhash-ui/cherrypy/lib/sessions.py#L676-L698
priyankchheda/algorithms
c361aa9071573fa9966d5b02d05e524815abcf2b
segment_tree/segment_tree.py
python
SegmentTree.range_query
(self, query_left, query_right)
return _range_sum(query_left, query_right, 0, self.size - 1, 0)
returns result for range queries
returns result for range queries
[ "returns", "result", "for", "range", "queries" ]
def range_query(self, query_left, query_right): """ returns result for range queries """ def _range_sum(query_left, query_right, node_left, node_right, node_index): """ internal recursive function """ if node_left > node_right: return 0 if node_right ...
[ "def", "range_query", "(", "self", ",", "query_left", ",", "query_right", ")", ":", "def", "_range_sum", "(", "query_left", ",", "query_right", ",", "node_left", ",", "node_right", ",", "node_index", ")", ":", "\"\"\" internal recursive function \"\"\"", "if", "no...
https://github.com/priyankchheda/algorithms/blob/c361aa9071573fa9966d5b02d05e524815abcf2b/segment_tree/segment_tree.py#L36-L57
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_cocoa/richtext.py
python
RichTextObject.Dump
(*args, **kwargs)
return _richtext.RichTextObject_Dump(*args, **kwargs)
Dump(self) -> String
Dump(self) -> String
[ "Dump", "(", "self", ")", "-", ">", "String" ]
def Dump(*args, **kwargs): """Dump(self) -> String""" return _richtext.RichTextObject_Dump(*args, **kwargs)
[ "def", "Dump", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_richtext", ".", "RichTextObject_Dump", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/richtext.py#L1250-L1252
google/syzygy
8164b24ebde9c5649c9a09e88a7fc0b0fcbd1bc5
third_party/numpy/files/numpy/polynomial/chebyshev.py
python
chebint
(cs, m=1, k=[], lbnd=0, scl=1)
return cs
Integrate a Chebyshev series. Returns, as a C-series, the input C-series `cs`, integrated `m` times from `lbnd` to `x`. At each iteration the resulting series is **multiplied** by `scl` and an integration constant, `k`, is added. The scaling factor is for use in a linear change of variable. ("Buyer ...
Integrate a Chebyshev series.
[ "Integrate", "a", "Chebyshev", "series", "." ]
def chebint(cs, m=1, k=[], lbnd=0, scl=1): """ Integrate a Chebyshev series. Returns, as a C-series, the input C-series `cs`, integrated `m` times from `lbnd` to `x`. At each iteration the resulting series is **multiplied** by `scl` and an integration constant, `k`, is added. The scaling facto...
[ "def", "chebint", "(", "cs", ",", "m", "=", "1", ",", "k", "=", "[", "]", ",", "lbnd", "=", "0", ",", "scl", "=", "1", ")", ":", "cnt", "=", "int", "(", "m", ")", "if", "not", "np", ".", "iterable", "(", "k", ")", ":", "k", "=", "[", ...
https://github.com/google/syzygy/blob/8164b24ebde9c5649c9a09e88a7fc0b0fcbd1bc5/third_party/numpy/files/numpy/polynomial/chebyshev.py#L912-L1016
OpenGenus/cosmos
1a94e8880068e51d571543be179c323936bd0936
code/data_structures/src/hashs/bloom_filter/bloom_filter.py
python
bloomFilter.__init__
(self, size=1000, hashFunctions=None)
Construct a bloom filter with size bits(default: 1000) and the associated hashFunctions. Default hash function is i.e. hash(e)%size.
Construct a bloom filter with size bits(default: 1000) and the associated hashFunctions. Default hash function is i.e. hash(e)%size.
[ "Construct", "a", "bloom", "filter", "with", "size", "bits", "(", "default", ":", "1000", ")", "and", "the", "associated", "hashFunctions", ".", "Default", "hash", "function", "is", "i", ".", "e", ".", "hash", "(", "e", ")", "%size", "." ]
def __init__(self, size=1000, hashFunctions=None): """ Construct a bloom filter with size bits(default: 1000) and the associated hashFunctions. Default hash function is i.e. hash(e)%size. """ self.bits = 0 self.M = size if hashFunctions is None: self.k = 1...
[ "def", "__init__", "(", "self", ",", "size", "=", "1000", ",", "hashFunctions", "=", "None", ")", ":", "self", ".", "bits", "=", "0", "self", ".", "M", "=", "size", "if", "hashFunctions", "is", "None", ":", "self", ".", "k", "=", "1", "self", "."...
https://github.com/OpenGenus/cosmos/blob/1a94e8880068e51d571543be179c323936bd0936/code/data_structures/src/hashs/bloom_filter/bloom_filter.py#L7-L18
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/setuptools/py2/setuptools/_vendor/pyparsing.py
python
ParseResults.asXML
( self, doctag=None, namedItemsOnly=False, indent="", formatted=True )
return "".join(out)
(Deprecated) Returns the parse results as XML. Tags are created for tokens and lists that have defined results names.
(Deprecated) Returns the parse results as XML. Tags are created for tokens and lists that have defined results names.
[ "(", "Deprecated", ")", "Returns", "the", "parse", "results", "as", "XML", ".", "Tags", "are", "created", "for", "tokens", "and", "lists", "that", "have", "defined", "results", "names", "." ]
def asXML( self, doctag=None, namedItemsOnly=False, indent="", formatted=True ): """ (Deprecated) Returns the parse results as XML. Tags are created for tokens and lists that have defined results names. """ nl = "\n" out = [] namedItems = dict((v[1],k) for (k,vlist) in se...
[ "def", "asXML", "(", "self", ",", "doctag", "=", "None", ",", "namedItemsOnly", "=", "False", ",", "indent", "=", "\"\"", ",", "formatted", "=", "True", ")", ":", "nl", "=", "\"\\n\"", "out", "=", "[", "]", "namedItems", "=", "dict", "(", "(", "v",...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/setuptools/py2/setuptools/_vendor/pyparsing.py#L766-L825
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/gtk/_core.py
python
TextEntryBase.AutoCompleteFileNames
(*args, **kwargs)
return _core_.TextEntryBase_AutoCompleteFileNames(*args, **kwargs)
AutoCompleteFileNames(self) -> bool
AutoCompleteFileNames(self) -> bool
[ "AutoCompleteFileNames", "(", "self", ")", "-", ">", "bool" ]
def AutoCompleteFileNames(*args, **kwargs): """AutoCompleteFileNames(self) -> bool""" return _core_.TextEntryBase_AutoCompleteFileNames(*args, **kwargs)
[ "def", "AutoCompleteFileNames", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_core_", ".", "TextEntryBase_AutoCompleteFileNames", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/_core.py#L13320-L13322
ChromiumWebApps/chromium
c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7
tools/telemetry/third_party/pyserial/serial/serialwin32.py
python
Win32Serial.setXON
(self, level=True)
\ Manually control flow - when software flow control is enabled. This will send XON (true) and XOFF (false) to the other device. WARNING: this function is not portable to different platforms!
\ Manually control flow - when software flow control is enabled. This will send XON (true) and XOFF (false) to the other device. WARNING: this function is not portable to different platforms!
[ "\\", "Manually", "control", "flow", "-", "when", "software", "flow", "control", "is", "enabled", ".", "This", "will", "send", "XON", "(", "true", ")", "and", "XOFF", "(", "false", ")", "to", "the", "other", "device", ".", "WARNING", ":", "this", "func...
def setXON(self, level=True): """\ Manually control flow - when software flow control is enabled. This will send XON (true) and XOFF (false) to the other device. WARNING: this function is not portable to different platforms! """ if not self.hComPort: raise portNotOpenErro...
[ "def", "setXON", "(", "self", ",", "level", "=", "True", ")", ":", "if", "not", "self", ".", "hComPort", ":", "raise", "portNotOpenError", "if", "level", ":", "win32", ".", "EscapeCommFunction", "(", "self", ".", "hComPort", ",", "win32", ".", "SETXON", ...
https://github.com/ChromiumWebApps/chromium/blob/c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7/tools/telemetry/third_party/pyserial/serial/serialwin32.py#L399-L409
baidu/tera
dbcd28af792d879d961bf9fc7eb60de81b437646
src/sdk/python/TeraSdk.py
python
RowReader.ValueInt64
(self)
return long(lib.tera_row_reader_value_int64(self.reader))
Returns: (long) 当前cell对应的value
Returns: (long) 当前cell对应的value
[ "Returns", ":", "(", "long", ")", "当前cell对应的value" ]
def ValueInt64(self): """ Returns: (long) 当前cell对应的value """ return long(lib.tera_row_reader_value_int64(self.reader))
[ "def", "ValueInt64", "(", "self", ")", ":", "return", "long", "(", "lib", ".", "tera_row_reader_value_int64", "(", "self", ".", "reader", ")", ")" ]
https://github.com/baidu/tera/blob/dbcd28af792d879d961bf9fc7eb60de81b437646/src/sdk/python/TeraSdk.py#L773-L778
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/x86/toolchain/lib/python2.7/decimal.py
python
Context.logical_and
(self, a, b)
return a.logical_and(b, context=self)
Applies the logical operation 'and' between each operand's digits. The operands must be both logical numbers. >>> ExtendedContext.logical_and(Decimal('0'), Decimal('0')) Decimal('0') >>> ExtendedContext.logical_and(Decimal('0'), Decimal('1')) Decimal('0') >>> ExtendedCo...
Applies the logical operation 'and' between each operand's digits.
[ "Applies", "the", "logical", "operation", "and", "between", "each", "operand", "s", "digits", "." ]
def logical_and(self, a, b): """Applies the logical operation 'and' between each operand's digits. The operands must be both logical numbers. >>> ExtendedContext.logical_and(Decimal('0'), Decimal('0')) Decimal('0') >>> ExtendedContext.logical_and(Decimal('0'), Decimal('1')) ...
[ "def", "logical_and", "(", "self", ",", "a", ",", "b", ")", ":", "a", "=", "_convert_other", "(", "a", ",", "raiseit", "=", "True", ")", "return", "a", ".", "logical_and", "(", "b", ",", "context", "=", "self", ")" ]
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/x86/toolchain/lib/python2.7/decimal.py#L4562-L4587
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/scipy/scipy/stats/_multivariate.py
python
invwishart_gen.mode
(self, df, scale)
return _squeeze_output(out)
Mode of the inverse Wishart distribution Parameters ---------- %(_doc_default_callparams)s Returns ------- mode : float The Mode of the distribution
Mode of the inverse Wishart distribution
[ "Mode", "of", "the", "inverse", "Wishart", "distribution" ]
def mode(self, df, scale): """ Mode of the inverse Wishart distribution Parameters ---------- %(_doc_default_callparams)s Returns ------- mode : float The Mode of the distribution """ dim, df, scale = self._process_parameters...
[ "def", "mode", "(", "self", ",", "df", ",", "scale", ")", ":", "dim", ",", "df", ",", "scale", "=", "self", ".", "_process_parameters", "(", "df", ",", "scale", ")", "out", "=", "self", ".", "_mode", "(", "dim", ",", "df", ",", "scale", ")", "r...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/scipy/stats/_multivariate.py#L2422-L2438
hanpfei/chromium-net
392cc1fa3a8f92f42e4071ab6e674d8e0482f83f
third_party/catapult/telemetry/telemetry/core/cros_interface.py
python
CrOSInterface.GetDeviceTypeName
(self)
return self.LsbReleaseValue(key='DEVICETYPE', default='CHROMEBOOK')
DEVICETYPE in /etc/lsb-release is CHROMEBOOK, CHROMEBIT, etc.
DEVICETYPE in /etc/lsb-release is CHROMEBOOK, CHROMEBIT, etc.
[ "DEVICETYPE", "in", "/", "etc", "/", "lsb", "-", "release", "is", "CHROMEBOOK", "CHROMEBIT", "etc", "." ]
def GetDeviceTypeName(self): """DEVICETYPE in /etc/lsb-release is CHROMEBOOK, CHROMEBIT, etc.""" return self.LsbReleaseValue(key='DEVICETYPE', default='CHROMEBOOK')
[ "def", "GetDeviceTypeName", "(", "self", ")", ":", "return", "self", ".", "LsbReleaseValue", "(", "key", "=", "'DEVICETYPE'", ",", "default", "=", "'CHROMEBOOK'", ")" ]
https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/telemetry/telemetry/core/cros_interface.py#L520-L522
scanner-research/scanner
04a0c4b4196341995985acd729c0788aab823e1c
python/scannerpy/storage.py
python
StoredStream.committed
(self)
Check if a stream is completely materialized in storage. A stream may exist, but not be committed if a Scanner job was run that was supposed to output the stream, but the job failed for any reason.
Check if a stream is completely materialized in storage.
[ "Check", "if", "a", "stream", "is", "completely", "materialized", "in", "storage", "." ]
def committed(self) -> bool: """Check if a stream is completely materialized in storage. A stream may exist, but not be committed if a Scanner job was run that was supposed to output the stream, but the job failed for any reason. """ raise NotImplementedError
[ "def", "committed", "(", "self", ")", "->", "bool", ":", "raise", "NotImplementedError" ]
https://github.com/scanner-research/scanner/blob/04a0c4b4196341995985acd729c0788aab823e1c/python/scannerpy/storage.py#L102-L108
tensorflow/tensorflow
419e3a6b650ea4bd1b0cba23c4348f8a69f3272e
tensorflow/python/lib/io/file_io.py
python
FileIO.readline
(self)
return self._prepare_value(self._read_buf.readline())
r"""Reads the next line, keeping \n. At EOF, returns ''.
r"""Reads the next line, keeping \n. At EOF, returns ''.
[ "r", "Reads", "the", "next", "line", "keeping", "\\", "n", ".", "At", "EOF", "returns", "." ]
def readline(self): r"""Reads the next line, keeping \n. At EOF, returns ''.""" self._preread_check() return self._prepare_value(self._read_buf.readline())
[ "def", "readline", "(", "self", ")", ":", "self", ".", "_preread_check", "(", ")", "return", "self", ".", "_prepare_value", "(", "self", ".", "_read_buf", ".", "readline", "(", ")", ")" ]
https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/lib/io/file_io.py#L165-L168
Xilinx/Vitis-AI
fc74d404563d9951b57245443c73bef389f3657f
tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/contrib/learn/python/learn/estimators/dnn_linear_combined.py
python
DNNLinearCombinedClassifier.__init__
(self, # _joint_linear_weights pylint: disable=invalid-name model_dir=None, n_classes=2, weight_column_name=None, linear_feature_columns=None, linear_optimizer=None, _joint_linear_weights=False, dnn_feature_columns...
Constructs a DNNLinearCombinedClassifier instance. Note: New users must set `fix_global_step_increment_bug=True` when creating an estimator. Args: model_dir: Directory to save model parameters, graph and etc. This can also be used to load checkpoints from the directory into a estimator ...
Constructs a DNNLinearCombinedClassifier instance.
[ "Constructs", "a", "DNNLinearCombinedClassifier", "instance", "." ]
def __init__(self, # _joint_linear_weights pylint: disable=invalid-name model_dir=None, n_classes=2, weight_column_name=None, linear_feature_columns=None, linear_optimizer=None, _joint_linear_weights=False, dnn_fea...
[ "def", "__init__", "(", "self", ",", "# _joint_linear_weights pylint: disable=invalid-name", "model_dir", "=", "None", ",", "n_classes", "=", "2", ",", "weight_column_name", "=", "None", ",", "linear_feature_columns", "=", "None", ",", "linear_optimizer", "=", "None",...
https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/contrib/learn/python/learn/estimators/dnn_linear_combined.py#L590-L711
krishauser/Klampt
972cc83ea5befac3f653c1ba20f80155768ad519
Python/klampt/plan/robotcspace.py
python
RobotCSpace.sendPathToController
(self,path,controller)
Given a planned CSpace path 'path' and a SimRobotController 'controller', sends the path so that it is executed correctly by the controller (this assumes a fully actuated robot).
Given a planned CSpace path 'path' and a SimRobotController 'controller', sends the path so that it is executed correctly by the controller (this assumes a fully actuated robot).
[ "Given", "a", "planned", "CSpace", "path", "path", "and", "a", "SimRobotController", "controller", "sends", "the", "path", "so", "that", "it", "is", "executed", "correctly", "by", "the", "controller", "(", "this", "assumes", "a", "fully", "actuated", "robot", ...
def sendPathToController(self,path,controller): """Given a planned CSpace path 'path' and a SimRobotController 'controller', sends the path so that it is executed correctly by the controller (this assumes a fully actuated robot).""" controller.setMilestone(path[0]) for q in path[...
[ "def", "sendPathToController", "(", "self", ",", "path", ",", "controller", ")", ":", "controller", ".", "setMilestone", "(", "path", "[", "0", "]", ")", "for", "q", "in", "path", "[", "1", ":", "]", ":", "controller", ".", "appendMilestoneLinear", "(", ...
https://github.com/krishauser/Klampt/blob/972cc83ea5befac3f653c1ba20f80155768ad519/Python/klampt/plan/robotcspace.py#L123-L129
okex/V3-Open-API-SDK
c5abb0db7e2287718e0055e17e57672ce0ec7fd9
okex-python-sdk-api/venv/Lib/site-packages/pip-19.0.3-py3.8.egg/pip/_vendor/distlib/_backport/shutil.py
python
copy
(src, dst)
Copy data and mode bits ("cp src dst"). The destination may be a directory.
Copy data and mode bits ("cp src dst").
[ "Copy", "data", "and", "mode", "bits", "(", "cp", "src", "dst", ")", "." ]
def copy(src, dst): """Copy data and mode bits ("cp src dst"). The destination may be a directory. """ if os.path.isdir(dst): dst = os.path.join(dst, os.path.basename(src)) copyfile(src, dst) copymode(src, dst)
[ "def", "copy", "(", "src", ",", "dst", ")", ":", "if", "os", ".", "path", ".", "isdir", "(", "dst", ")", ":", "dst", "=", "os", ".", "path", ".", "join", "(", "dst", ",", "os", ".", "path", ".", "basename", "(", "src", ")", ")", "copyfile", ...
https://github.com/okex/V3-Open-API-SDK/blob/c5abb0db7e2287718e0055e17e57672ce0ec7fd9/okex-python-sdk-api/venv/Lib/site-packages/pip-19.0.3-py3.8.egg/pip/_vendor/distlib/_backport/shutil.py#L130-L139
microsoft/ivy
9f3c7ecc0b2383129fdd0953e10890d98d09a82d
ivy/ui_extensions_api.py
python
ExtensionPoint.__call__
(self, context, *args, **kwargs)
return results
Run all callbacks, return a list with results. Exceptions in callbacks are printed using IPython's showtraceback, and their result is ignored. If not running under IPython, exceptions are raised.
Run all callbacks, return a list with results.
[ "Run", "all", "callbacks", "return", "a", "list", "with", "results", "." ]
def __call__(self, context, *args, **kwargs): """ Run all callbacks, return a list with results. Exceptions in callbacks are printed using IPython's showtraceback, and their result is ignored. If not running under IPython, exceptions are raised. """ set_context(...
[ "def", "__call__", "(", "self", ",", "context", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "set_context", "(", "context", ")", "results", "=", "[", "]", "for", "function", "in", "self", ".", "callbacks", ":", "try", ":", "result", "=", "f...
https://github.com/microsoft/ivy/blob/9f3c7ecc0b2383129fdd0953e10890d98d09a82d/ivy/ui_extensions_api.py#L80-L102
google/syzygy
8164b24ebde9c5649c9a09e88a7fc0b0fcbd1bc5
third_party/virtualenv/files/virtualenv_support/site.py
python
force_global_eggs_after_local_site_packages
()
Force easy_installed eggs in the global environment to get placed in sys.path after all packages inside the virtualenv. This maintains the "least surprise" result that packages in the virtualenv always mask global packages, never the other way around.
Force easy_installed eggs in the global environment to get placed in sys.path after all packages inside the virtualenv. This maintains the "least surprise" result that packages in the virtualenv always mask global packages, never the other way around.
[ "Force", "easy_installed", "eggs", "in", "the", "global", "environment", "to", "get", "placed", "in", "sys", ".", "path", "after", "all", "packages", "inside", "the", "virtualenv", ".", "This", "maintains", "the", "least", "surprise", "result", "that", "packag...
def force_global_eggs_after_local_site_packages(): """ Force easy_installed eggs in the global environment to get placed in sys.path after all packages inside the virtualenv. This maintains the "least surprise" result that packages in the virtualenv always mask global packages, never the other way ...
[ "def", "force_global_eggs_after_local_site_packages", "(", ")", ":", "egginsert", "=", "getattr", "(", "sys", ",", "'__egginsert'", ",", "0", ")", "for", "i", ",", "path", "in", "enumerate", "(", "sys", ".", "path", ")", ":", "if", "i", ">", "egginsert", ...
https://github.com/google/syzygy/blob/8164b24ebde9c5649c9a09e88a7fc0b0fcbd1bc5/third_party/virtualenv/files/virtualenv_support/site.py#L601-L614
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/pandas/py3/pandas/core/missing.py
python
check_value_size
(value, mask: np.ndarray, length: int)
return value
Validate the size of the values passed to ExtensionArray.fillna.
Validate the size of the values passed to ExtensionArray.fillna.
[ "Validate", "the", "size", "of", "the", "values", "passed", "to", "ExtensionArray", ".", "fillna", "." ]
def check_value_size(value, mask: np.ndarray, length: int): """ Validate the size of the values passed to ExtensionArray.fillna. """ if is_array_like(value): if len(value) != length: raise ValueError( f"Length of 'value' does not match. Got ({len(value)}) " ...
[ "def", "check_value_size", "(", "value", ",", "mask", ":", "np", ".", "ndarray", ",", "length", ":", "int", ")", ":", "if", "is_array_like", "(", "value", ")", ":", "if", "len", "(", "value", ")", "!=", "length", ":", "raise", "ValueError", "(", "f\"...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/pandas/py3/pandas/core/missing.py#L45-L57
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/gtk/propgrid.py
python
PropertyGridIteratorBase.Next
(*args, **kwargs)
return _propgrid.PropertyGridIteratorBase_Next(*args, **kwargs)
Next(self, bool iterateChildren=True)
Next(self, bool iterateChildren=True)
[ "Next", "(", "self", "bool", "iterateChildren", "=", "True", ")" ]
def Next(*args, **kwargs): """Next(self, bool iterateChildren=True)""" return _propgrid.PropertyGridIteratorBase_Next(*args, **kwargs)
[ "def", "Next", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_propgrid", ".", "PropertyGridIteratorBase_Next", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/propgrid.py#L950-L952
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/distutils/versionpredicate.py
python
VersionPredicate.__init__
(self, versionPredicateStr)
Parse a version predicate string.
Parse a version predicate string.
[ "Parse", "a", "version", "predicate", "string", "." ]
def __init__(self, versionPredicateStr): """Parse a version predicate string. """ # Fields: # name: package name # pred: list of (comparison string, StrictVersion) versionPredicateStr = versionPredicateStr.strip() if not versionPredicateStr: r...
[ "def", "__init__", "(", "self", ",", "versionPredicateStr", ")", ":", "# Fields:", "# name: package name", "# pred: list of (comparison string, StrictVersion)", "versionPredicateStr", "=", "versionPredicateStr", ".", "strip", "(", ")", "if", "not", "versionPredicateSt...
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/distutils/versionpredicate.py#L95-L120
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/plat-mac/macresource.py
python
open_pathname
(pathname, verbose=0)
Open a resource file given by pathname, possibly decoding an AppleSingle file
Open a resource file given by pathname, possibly decoding an AppleSingle file
[ "Open", "a", "resource", "file", "given", "by", "pathname", "possibly", "decoding", "an", "AppleSingle", "file" ]
def open_pathname(pathname, verbose=0): """Open a resource file given by pathname, possibly decoding an AppleSingle file""" # No resource fork. We may be on OSX, and this may be either # a data-fork based resource file or a AppleSingle file # from the CVS repository. try: refno = Res.FSO...
[ "def", "open_pathname", "(", "pathname", ",", "verbose", "=", "0", ")", ":", "# No resource fork. We may be on OSX, and this may be either", "# a data-fork based resource file or a AppleSingle file", "# from the CVS repository.", "try", ":", "refno", "=", "Res", ".", "FSOpenRes...
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/plat-mac/macresource.py#L77-L93
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/pandas/core/generic.py
python
NDFrame._check_inplace_setting
(self, value)
return True
check whether we allow in-place setting with this type of value
check whether we allow in-place setting with this type of value
[ "check", "whether", "we", "allow", "in", "-", "place", "setting", "with", "this", "type", "of", "value" ]
def _check_inplace_setting(self, value) -> bool_t: """ check whether we allow in-place setting with this type of value """ if self._is_mixed_type: if not self._is_numeric_mixed_type: # allow an actual np.nan thru if is_float(value) and np.isnan(value): ...
[ "def", "_check_inplace_setting", "(", "self", ",", "value", ")", "->", "bool_t", ":", "if", "self", ".", "_is_mixed_type", ":", "if", "not", "self", ".", "_is_numeric_mixed_type", ":", "# allow an actual np.nan thru", "if", "is_float", "(", "value", ")", "and", ...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/pandas/core/generic.py#L5386-L5401
Xilinx/Vitis-AI
fc74d404563d9951b57245443c73bef389f3657f
tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/contrib/learn/python/learn/monitors.py
python
EveryN.step_begin
(self, step)
return []
Overrides `BaseMonitor.step_begin`. When overriding this method, you must call the super implementation. Args: step: `int`, the current value of the global step. Returns: A `list`, the result of every_n_step_begin, if that was called this step, or an empty list otherwise. Raises: ...
Overrides `BaseMonitor.step_begin`.
[ "Overrides", "BaseMonitor", ".", "step_begin", "." ]
def step_begin(self, step): """Overrides `BaseMonitor.step_begin`. When overriding this method, you must call the super implementation. Args: step: `int`, the current value of the global step. Returns: A `list`, the result of every_n_step_begin, if that was called this step, or an em...
[ "def", "step_begin", "(", "self", ",", "step", ")", ":", "super", "(", "EveryN", ",", "self", ")", ".", "step_begin", "(", "step", ")", "if", "(", "step", "<=", "self", ".", "_first_n_steps", "or", "step", ">=", "(", "self", ".", "_every_n_steps", "+...
https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/contrib/learn/python/learn/monitors.py#L329-L350
google-ar/WebARonTango
e86965d2cbc652156b480e0fcf77c716745578cd
chromium/src/gpu/command_buffer/build_gles2_cmd_buffer.py
python
GENnHandler.WriteGLES2ImplementationUnitTest
(self, func, f)
Overrriden from TypeHandler.
Overrriden from TypeHandler.
[ "Overrriden", "from", "TypeHandler", "." ]
def WriteGLES2ImplementationUnitTest(self, func, f): """Overrriden from TypeHandler.""" code = """ TEST_F(GLES2ImplementationTest, %(name)s) { GLuint ids[2] = { 0, }; struct Cmds { cmds::%(name)sImmediate gen; GLuint data[2]; }; Cmds expected; expected.gen.Init(arraysize(ids), &ids[0]); expe...
[ "def", "WriteGLES2ImplementationUnitTest", "(", "self", ",", "func", ",", "f", ")", ":", "code", "=", "\"\"\"\nTEST_F(GLES2ImplementationTest, %(name)s) {\n GLuint ids[2] = { 0, };\n struct Cmds {\n cmds::%(name)sImmediate gen;\n GLuint data[2];\n };\n Cmds expected;\n expected.ge...
https://github.com/google-ar/WebARonTango/blob/e86965d2cbc652156b480e0fcf77c716745578cd/chromium/src/gpu/command_buffer/build_gles2_cmd_buffer.py#L6046-L6068
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/pandas/py3/pandas/core/base.py
python
IndexOpsMixin._map_values
(self, mapper, na_action=None)
return new_values
An internal function that maps values using the input correspondence (which can be a dict, Series, or function). Parameters ---------- mapper : function, dict, or Series The input correspondence object na_action : {None, 'ignore'} If 'ignore', propagate N...
An internal function that maps values using the input correspondence (which can be a dict, Series, or function).
[ "An", "internal", "function", "that", "maps", "values", "using", "the", "input", "correspondence", "(", "which", "can", "be", "a", "dict", "Series", "or", "function", ")", "." ]
def _map_values(self, mapper, na_action=None): """ An internal function that maps values using the input correspondence (which can be a dict, Series, or function). Parameters ---------- mapper : function, dict, or Series The input correspondence object ...
[ "def", "_map_values", "(", "self", ",", "mapper", ",", "na_action", "=", "None", ")", ":", "# we can fastpath dict/Series to an efficient map", "# as we know that we are not going to have to yield", "# python types", "if", "is_dict_like", "(", "mapper", ")", ":", "if", "i...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/pandas/py3/pandas/core/base.py#L787-L872
openthread/openthread
9fcdbed9c526c70f1556d1ed84099c1535c7cd32
tools/harness-automation/autothreadharness/harness_case.py
python
HarnessCase._wait_dialog
(self)
Wait for dialogs and handle them until done.
Wait for dialogs and handle them until done.
[ "Wait", "for", "dialogs", "and", "handle", "them", "until", "done", "." ]
def _wait_dialog(self): """Wait for dialogs and handle them until done. """ logger.debug('waiting for dialog') done = False error = False logger.info('self timeout %d', self.timeout) while not done and self.timeout: try: dialog = self....
[ "def", "_wait_dialog", "(", "self", ")", ":", "logger", ".", "debug", "(", "'waiting for dialog'", ")", "done", "=", "False", "error", "=", "False", "logger", ".", "info", "(", "'self timeout %d'", ",", "self", ".", "timeout", ")", "while", "not", "done", ...
https://github.com/openthread/openthread/blob/9fcdbed9c526c70f1556d1ed84099c1535c7cd32/tools/harness-automation/autothreadharness/harness_case.py#L869-L929
weolar/miniblink49
1c4678db0594a4abde23d3ebbcc7cd13c3170777
third_party/jinja2/environment.py
python
Environment.list_templates
(self, extensions=None, filter_func=None)
return x
Returns a list of templates for this environment. This requires that the loader supports the loader's :meth:`~BaseLoader.list_templates` method. If there are other files in the template folder besides the actual templates, the returned list can be filtered. There are two ways:...
Returns a list of templates for this environment. This requires that the loader supports the loader's :meth:`~BaseLoader.list_templates` method.
[ "Returns", "a", "list", "of", "templates", "for", "this", "environment", ".", "This", "requires", "that", "the", "loader", "supports", "the", "loader", "s", ":", "meth", ":", "~BaseLoader", ".", "list_templates", "method", "." ]
def list_templates(self, extensions=None, filter_func=None): """Returns a list of templates for this environment. This requires that the loader supports the loader's :meth:`~BaseLoader.list_templates` method. If there are other files in the template folder besides the actual te...
[ "def", "list_templates", "(", "self", ",", "extensions", "=", "None", ",", "filter_func", "=", "None", ")", ":", "x", "=", "self", ".", "loader", ".", "list_templates", "(", ")", "if", "extensions", "is", "not", "None", ":", "if", "filter_func", "is", ...
https://github.com/weolar/miniblink49/blob/1c4678db0594a4abde23d3ebbcc7cd13c3170777/third_party/jinja2/environment.py#L695-L720
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_carbon/_gdi.py
python
DC.GetCharHeight
(*args, **kwargs)
return _gdi_.DC_GetCharHeight(*args, **kwargs)
GetCharHeight(self) -> int Gets the character height of the currently set font.
GetCharHeight(self) -> int
[ "GetCharHeight", "(", "self", ")", "-", ">", "int" ]
def GetCharHeight(*args, **kwargs): """ GetCharHeight(self) -> int Gets the character height of the currently set font. """ return _gdi_.DC_GetCharHeight(*args, **kwargs)
[ "def", "GetCharHeight", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_gdi_", ".", "DC_GetCharHeight", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/_gdi.py#L4092-L4098
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/tools/python3/src/Lib/urllib/request.py
python
urlcleanup
()
Clean up temporary files from urlretrieve calls.
Clean up temporary files from urlretrieve calls.
[ "Clean", "up", "temporary", "files", "from", "urlretrieve", "calls", "." ]
def urlcleanup(): """Clean up temporary files from urlretrieve calls.""" for temp_file in _url_tempfiles: try: os.unlink(temp_file) except OSError: pass del _url_tempfiles[:] global _opener if _opener: _opener = None
[ "def", "urlcleanup", "(", ")", ":", "for", "temp_file", "in", "_url_tempfiles", ":", "try", ":", "os", ".", "unlink", "(", "temp_file", ")", "except", "OSError", ":", "pass", "del", "_url_tempfiles", "[", ":", "]", "global", "_opener", "if", "_opener", "...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python3/src/Lib/urllib/request.py#L284-L295
ricardoquesada/Spidermonkey
4a75ea2543408bd1b2c515aa95901523eeef7858
dom/bindings/parser/WebIDL.py
python
Parser.p_NonAnyTypeDate
(self, p)
NonAnyType : DATE TypeSuffix
NonAnyType : DATE TypeSuffix
[ "NonAnyType", ":", "DATE", "TypeSuffix" ]
def p_NonAnyTypeDate(self, p): """ NonAnyType : DATE TypeSuffix """ p[0] = self.handleModifiers(BuiltinTypes[IDLBuiltinType.Types.date], p[2])
[ "def", "p_NonAnyTypeDate", "(", "self", ",", "p", ")", ":", "p", "[", "0", "]", "=", "self", ".", "handleModifiers", "(", "BuiltinTypes", "[", "IDLBuiltinType", ".", "Types", ".", "date", "]", ",", "p", "[", "2", "]", ")" ]
https://github.com/ricardoquesada/Spidermonkey/blob/4a75ea2543408bd1b2c515aa95901523eeef7858/dom/bindings/parser/WebIDL.py#L5288-L5293
mindspore-ai/mindspore
fb8fd3338605bb34fa5cea054e535a8b1d753fab
mindspore/python/mindspore/profiler/parser/aicpu_data_parser.py
python
DataPreProcessParser._get_source_file
(self)
return file_name
Get log file name, which was created by ada service.
Get log file name, which was created by ada service.
[ "Get", "log", "file", "name", "which", "was", "created", "by", "ada", "service", "." ]
def _get_source_file(self): """Get log file name, which was created by ada service.""" file_name = get_file_join_name(self._input_path, self._source_file_target) if not file_name: file_name = get_file_join_name(self._input_path, self._source_file_target_old) if not file_n...
[ "def", "_get_source_file", "(", "self", ")", ":", "file_name", "=", "get_file_join_name", "(", "self", ".", "_input_path", ",", "self", ".", "_source_file_target", ")", "if", "not", "file_name", ":", "file_name", "=", "get_file_join_name", "(", "self", ".", "_...
https://github.com/mindspore-ai/mindspore/blob/fb8fd3338605bb34fa5cea054e535a8b1d753fab/mindspore/python/mindspore/profiler/parser/aicpu_data_parser.py#L98-L108
Xilinx/Vitis-AI
fc74d404563d9951b57245443c73bef389f3657f
tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/feature_column/feature_column_v2.py
python
VocabularyListCategoricalColumn.name
(self)
return self.key
See `FeatureColumn` base class.
See `FeatureColumn` base class.
[ "See", "FeatureColumn", "base", "class", "." ]
def name(self): """See `FeatureColumn` base class.""" return self.key
[ "def", "name", "(", "self", ")", ":", "return", "self", ".", "key" ]
https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/feature_column/feature_column_v2.py#L3691-L3693
ARM-software/armnn
5e9965cae1cc6162649910f423ebd86001fc1931
python/pyarmnn/examples/image_classification/example_utils.py
python
download_file
(url: str, force: bool = False, filename: str = None)
return filename
Downloads a file. Args: url (str): File url. force (bool): Forces to download the file even if it exists. filename (str): Renames the file when set. Raises: RuntimeError: If for some reason download fails. Returns: str: Path to the downloaded file.
Downloads a file.
[ "Downloads", "a", "file", "." ]
def download_file(url: str, force: bool = False, filename: str = None): """Downloads a file. Args: url (str): File url. force (bool): Forces to download the file even if it exists. filename (str): Renames the file when set. Raises: RuntimeError: If for some reason download ...
[ "def", "download_file", "(", "url", ":", "str", ",", "force", ":", "bool", "=", "False", ",", "filename", ":", "str", "=", "None", ")", ":", "try", ":", "if", "filename", "is", "None", ":", "# extract filename from url when None", "filename", "=", "urlpars...
https://github.com/ARM-software/armnn/blob/5e9965cae1cc6162649910f423ebd86001fc1931/python/pyarmnn/examples/image_classification/example_utils.py#L241-L271
adobe/chromium
cfe5bf0b51b1f6b9fe239c2a3c2f2364da9967d7
third_party/closure_linter/closure_linter/ecmalintrules.py
python
EcmaScriptLintRules.Initialize
(self, checker, limited_doc_checks, is_html)
Initialize this lint rule object before parsing a new file.
Initialize this lint rule object before parsing a new file.
[ "Initialize", "this", "lint", "rule", "object", "before", "parsing", "a", "new", "file", "." ]
def Initialize(self, checker, limited_doc_checks, is_html): """Initialize this lint rule object before parsing a new file.""" checkerbase.LintRulesBase.Initialize(self, checker, limited_doc_checks, is_html) self._indentation = indentation.IndentationRules()
[ "def", "Initialize", "(", "self", ",", "checker", ",", "limited_doc_checks", ",", "is_html", ")", ":", "checkerbase", ".", "LintRulesBase", ".", "Initialize", "(", "self", ",", "checker", ",", "limited_doc_checks", ",", "is_html", ")", "self", ".", "_indentati...
https://github.com/adobe/chromium/blob/cfe5bf0b51b1f6b9fe239c2a3c2f2364da9967d7/third_party/closure_linter/closure_linter/ecmalintrules.py#L95-L99
miyosuda/TensorFlowAndroidDemo
35903e0221aa5f109ea2dbef27f20b52e317f42d
jni-build/jni/include/tensorflow/contrib/learn/python/learn/datasets/base.py
python
load_csv
(filename, target_dtype, target_column=-1, has_header=True)
Load dataset from CSV file.
Load dataset from CSV file.
[ "Load", "dataset", "from", "CSV", "file", "." ]
def load_csv(filename, target_dtype, target_column=-1, has_header=True): """Load dataset from CSV file.""" if has_header: return load_csv_with_header(filename=filename, target_dtype=target_dtype, features_dtype=np.float64, ...
[ "def", "load_csv", "(", "filename", ",", "target_dtype", ",", "target_column", "=", "-", "1", ",", "has_header", "=", "True", ")", ":", "if", "has_header", ":", "return", "load_csv_with_header", "(", "filename", "=", "filename", ",", "target_dtype", "=", "ta...
https://github.com/miyosuda/TensorFlowAndroidDemo/blob/35903e0221aa5f109ea2dbef27f20b52e317f42d/jni-build/jni/include/tensorflow/contrib/learn/python/learn/datasets/base.py#L39-L50
assimp/assimp
97c7e084c2f7f8c9355ea42f73605890481bddc5
port/PyAssimp/scripts/fixed_pipeline_3d_viewer.py
python
GLRenderer.recursive_render
(self, node)
Main recursive rendering method.
Main recursive rendering method.
[ "Main", "recursive", "rendering", "method", "." ]
def recursive_render(self, node): """ Main recursive rendering method. """ # save model matrix and apply node transformation glPushMatrix() m = node.transformation.transpose() # OpenGL row major glMultMatrixf(m) for mesh in node.meshes: self.apply_ma...
[ "def", "recursive_render", "(", "self", ",", "node", ")", ":", "# save model matrix and apply node transformation", "glPushMatrix", "(", ")", "m", "=", "node", ".", "transformation", ".", "transpose", "(", ")", "# OpenGL row major", "glMultMatrixf", "(", "m", ")", ...
https://github.com/assimp/assimp/blob/97c7e084c2f7f8c9355ea42f73605890481bddc5/port/PyAssimp/scripts/fixed_pipeline_3d_viewer.py#L251-L283
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/llvmlite/binding/passmanagers.py
python
PassManager.add_global_optimizer_pass
(self)
See http://llvm.org/docs/Passes.html#globalopt-global-variable-optimizer.
See http://llvm.org/docs/Passes.html#globalopt-global-variable-optimizer.
[ "See", "http", ":", "//", "llvm", ".", "org", "/", "docs", "/", "Passes", ".", "html#globalopt", "-", "global", "-", "variable", "-", "optimizer", "." ]
def add_global_optimizer_pass(self): """See http://llvm.org/docs/Passes.html#globalopt-global-variable-optimizer.""" ffi.lib.LLVMPY_AddGlobalOptimizerPass(self)
[ "def", "add_global_optimizer_pass", "(", "self", ")", ":", "ffi", ".", "lib", ".", "LLVMPY_AddGlobalOptimizerPass", "(", "self", ")" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/llvmlite/binding/passmanagers.py#L41-L43
briantrice/slate-language
a0daf5c8a40ba3e5d5368e34ab651284d803e570
src/profiler/gprof2dot.py
python
Profile.validate
(self)
Validate the edges.
Validate the edges.
[ "Validate", "the", "edges", "." ]
def validate(self): """Validate the edges.""" for function in self.functions.itervalues(): for callee_id in function.calls.keys(): assert function.calls[callee_id].callee_id == callee_id if callee_id not in self.functions: sys.stderr.write...
[ "def", "validate", "(", "self", ")", ":", "for", "function", "in", "self", ".", "functions", ".", "itervalues", "(", ")", ":", "for", "callee_id", "in", "function", ".", "calls", ".", "keys", "(", ")", ":", "assert", "function", ".", "calls", "[", "c...
https://github.com/briantrice/slate-language/blob/a0daf5c8a40ba3e5d5368e34ab651284d803e570/src/profiler/gprof2dot.py#L234-L242
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
wx/tools/Editra/src/ebmlib/cmenumgr.py
python
ContextMenuManager.GetUserData
(self, key)
return self._userdata.get(key, None)
Get user data @param key: data id key
Get user data @param key: data id key
[ "Get", "user", "data", "@param", "key", ":", "data", "id", "key" ]
def GetUserData(self, key): """Get user data @param key: data id key """ return self._userdata.get(key, None)
[ "def", "GetUserData", "(", "self", ",", "key", ")", ":", "return", "self", ".", "_userdata", ".", "get", "(", "key", ",", "None", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/tools/Editra/src/ebmlib/cmenumgr.py#L86-L91
panda3d/panda3d
833ad89ebad58395d0af0b7ec08538e5e4308265
direct/src/showbase/PythonUtil.py
python
reduceAngle
(deg)
return ((deg + 180.) % 360.) - 180.
Reduces an angle (in degrees) to a value in [-180..180)
Reduces an angle (in degrees) to a value in [-180..180)
[ "Reduces", "an", "angle", "(", "in", "degrees", ")", "to", "a", "value", "in", "[", "-", "180", "..", "180", ")" ]
def reduceAngle(deg): """ Reduces an angle (in degrees) to a value in [-180..180) """ return ((deg + 180.) % 360.) - 180.
[ "def", "reduceAngle", "(", "deg", ")", ":", "return", "(", "(", "deg", "+", "180.", ")", "%", "360.", ")", "-", "180." ]
https://github.com/panda3d/panda3d/blob/833ad89ebad58395d0af0b7ec08538e5e4308265/direct/src/showbase/PythonUtil.py#L481-L485
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/setuptools/command/easy_install.py
python
easy_install._set_fetcher_options
(self, base)
When easy_install is about to run bdist_egg on a source dist, that source dist might have 'setup_requires' directives, requiring additional fetching. Ensure the fetcher options given to easy_install are available to that command as well.
When easy_install is about to run bdist_egg on a source dist, that source dist might have 'setup_requires' directives, requiring additional fetching. Ensure the fetcher options given to easy_install are available to that command as well.
[ "When", "easy_install", "is", "about", "to", "run", "bdist_egg", "on", "a", "source", "dist", "that", "source", "dist", "might", "have", "setup_requires", "directives", "requiring", "additional", "fetching", ".", "Ensure", "the", "fetcher", "options", "given", "...
def _set_fetcher_options(self, base): """ When easy_install is about to run bdist_egg on a source dist, that source dist might have 'setup_requires' directives, requiring additional fetching. Ensure the fetcher options given to easy_install are available to that command as well. ...
[ "def", "_set_fetcher_options", "(", "self", ",", "base", ")", ":", "# find the fetch options from easy_install and write them out", "# to the setup.cfg file.", "ei_opts", "=", "self", ".", "distribution", ".", "get_option_dict", "(", "'easy_install'", ")", ".", "copy", "(...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/setuptools/command/easy_install.py#L1185-L1206
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_carbon/richtext.py
python
RichTextCtrl.BeginBatchUndo
(*args, **kwargs)
return _richtext.RichTextCtrl_BeginBatchUndo(*args, **kwargs)
BeginBatchUndo(self, String cmdName) -> bool Start batching undo history for commands
BeginBatchUndo(self, String cmdName) -> bool
[ "BeginBatchUndo", "(", "self", "String", "cmdName", ")", "-", ">", "bool" ]
def BeginBatchUndo(*args, **kwargs): """ BeginBatchUndo(self, String cmdName) -> bool Start batching undo history for commands """ return _richtext.RichTextCtrl_BeginBatchUndo(*args, **kwargs)
[ "def", "BeginBatchUndo", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_richtext", ".", "RichTextCtrl_BeginBatchUndo", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/richtext.py#L3841-L3847
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/email/message.py
python
Message.set_default_type
(self, ctype)
Set the `default' content type. ctype should be either "text/plain" or "message/rfc822", although this is not enforced. The default content type is not stored in the Content-Type header.
Set the `default' content type.
[ "Set", "the", "default", "content", "type", "." ]
def set_default_type(self, ctype): """Set the `default' content type. ctype should be either "text/plain" or "message/rfc822", although this is not enforced. The default content type is not stored in the Content-Type header. """ self._default_type = ctype
[ "def", "set_default_type", "(", "self", ",", "ctype", ")", ":", "self", ".", "_default_type", "=", "ctype" ]
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/email/message.py#L483-L490
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemDefectReporter/v1/AWS/common-code/Lib/jira/resources.py
python
Issue.update
(self, fields=None, update=None, async=None, jira=None, notify=True, **fieldargs)
Update this issue on the server. Each keyword argument (other than the predefined ones) is treated as a field name and the argument's value is treated as the intended value for that field -- if the fields argument is used, all other keyword arguments will be ignored. JIRA projects may ...
Update this issue on the server.
[ "Update", "this", "issue", "on", "the", "server", "." ]
def update(self, fields=None, update=None, async=None, jira=None, notify=True, **fieldargs): """Update this issue on the server. Each keyword argument (other than the predefined ones) is treated as a field name and the argument's value is treated as the intended value for that field -- if the f...
[ "def", "update", "(", "self", ",", "fields", "=", "None", ",", "update", "=", "None", ",", "async", "=", "None", ",", "jira", "=", "None", ",", "notify", "=", "True", ",", "*", "*", "fieldargs", ")", ":", "data", "=", "{", "}", "if", "fields", ...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemDefectReporter/v1/AWS/common-code/Lib/jira/resources.py#L435-L483
benoitsteiner/tensorflow-opencl
cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5
tensorflow/python/framework/ops.py
python
_EagerTensorBase._shape_tuple
(self)
The shape of this Tensor, as a tuple. This is more performant than tuple(shape().as_list()) as it avoids two list and one object creation. Marked private for now as from an API perspective, it would be better to have a single performant way of getting a shape rather than exposing shape() and shape_tupl...
The shape of this Tensor, as a tuple.
[ "The", "shape", "of", "this", "Tensor", "as", "a", "tuple", "." ]
def _shape_tuple(self): """The shape of this Tensor, as a tuple. This is more performant than tuple(shape().as_list()) as it avoids two list and one object creation. Marked private for now as from an API perspective, it would be better to have a single performant way of getting a shape rather than ...
[ "def", "_shape_tuple", "(", "self", ")", ":", "raise", "NotImplementedError", "(", ")" ]
https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/python/framework/ops.py#L644-L657
p4lang/behavioral-model
81ce0163f0770c6b9d6056a28ce2e0cc035bb6e9
mininet/p4_mininet.py
python
P4Switch.stop
(self)
Terminate P4 switch.
Terminate P4 switch.
[ "Terminate", "P4", "switch", "." ]
def stop(self): "Terminate P4 switch." self.output.flush() self.cmd('kill %' + self.sw_path) self.cmd('wait') self.deleteIntfs()
[ "def", "stop", "(", "self", ")", ":", "self", ".", "output", ".", "flush", "(", ")", "self", ".", "cmd", "(", "'kill %'", "+", "self", ".", "sw_path", ")", "self", ".", "cmd", "(", "'wait'", ")", "self", ".", "deleteIntfs", "(", ")" ]
https://github.com/p4lang/behavioral-model/blob/81ce0163f0770c6b9d6056a28ce2e0cc035bb6e9/mininet/p4_mininet.py#L146-L151
zhuli19901106/leetcode-zhuli
0f8fc29ccb8c33ea91149ecb2d4e961024c11db7
explore/fun-with-arrays/3157_move-zeros_1_AC.py
python
Solution.moveZeroes
(self, nums: List[int])
Do not return anything, modify nums in-place instead.
Do not return anything, modify nums in-place instead.
[ "Do", "not", "return", "anything", "modify", "nums", "in", "-", "place", "instead", "." ]
def moveZeroes(self, nums: List[int]) -> None: """ Do not return anything, modify nums in-place instead. """ a = nums n = len(a) j = 0 for i in range(n): if a[i] != 0: a[j] = a[i] j += 1 while j < n: ...
[ "def", "moveZeroes", "(", "self", ",", "nums", ":", "List", "[", "int", "]", ")", "->", "None", ":", "a", "=", "nums", "n", "=", "len", "(", "a", ")", "j", "=", "0", "for", "i", "in", "range", "(", "n", ")", ":", "if", "a", "[", "i", "]",...
https://github.com/zhuli19901106/leetcode-zhuli/blob/0f8fc29ccb8c33ea91149ecb2d4e961024c11db7/explore/fun-with-arrays/3157_move-zeros_1_AC.py#L4-L17
eclipse/sumo
7132a9b8b6eea734bdec38479026b4d8c4336d03
tools/contributed/sumopy/plugins/prt/wxgui.py
python
WxGui.on_update_decompressors
(self, event=None)
Update all decompressors (determine detector edge)
Update all decompressors (determine detector edge)
[ "Update", "all", "decompressors", "(", "determine", "detector", "edge", ")" ]
def on_update_decompressors(self, event=None): """Update all decompressors (determine detector edge)""" self._prtservice.decompressors.update_all() self._mainframe.browse_obj(self._prtservice.decompressors)
[ "def", "on_update_decompressors", "(", "self", ",", "event", "=", "None", ")", ":", "self", ".", "_prtservice", ".", "decompressors", ".", "update_all", "(", ")", "self", ".", "_mainframe", ".", "browse_obj", "(", "self", ".", "_prtservice", ".", "decompress...
https://github.com/eclipse/sumo/blob/7132a9b8b6eea734bdec38479026b4d8c4336d03/tools/contributed/sumopy/plugins/prt/wxgui.py#L450-L453
MVIG-SJTU/RMPE
5188c230ec800c12be7369c3619615bc9b020aa4
python/caffe/detector.py
python
Detector.detect_windows
(self, images_windows)
return detections
Do windowed detection over given images and windows. Windows are extracted then warped to the input dimensions of the net. Parameters ---------- images_windows: (image filename, window list) iterable. context_crop: size of context border to crop in pixels. Returns ...
Do windowed detection over given images and windows. Windows are extracted then warped to the input dimensions of the net.
[ "Do", "windowed", "detection", "over", "given", "images", "and", "windows", ".", "Windows", "are", "extracted", "then", "warped", "to", "the", "input", "dimensions", "of", "the", "net", "." ]
def detect_windows(self, images_windows): """ Do windowed detection over given images and windows. Windows are extracted then warped to the input dimensions of the net. Parameters ---------- images_windows: (image filename, window list) iterable. context_crop: si...
[ "def", "detect_windows", "(", "self", ",", "images_windows", ")", ":", "# Extract windows.", "window_inputs", "=", "[", "]", "for", "image_fname", ",", "windows", "in", "images_windows", ":", "image", "=", "caffe", ".", "io", ".", "load_image", "(", "image_fna...
https://github.com/MVIG-SJTU/RMPE/blob/5188c230ec800c12be7369c3619615bc9b020aa4/python/caffe/detector.py#L56-L99
MVIG-SJTU/RMPE
5188c230ec800c12be7369c3619615bc9b020aa4
scripts/cpp_lint.py
python
GetLineWidth
(line)
Determines the width of the line in column positions. Args: line: A string, which may be a Unicode string. Returns: The width of the line in column positions, accounting for Unicode combining characters and wide characters.
Determines the width of the line in column positions.
[ "Determines", "the", "width", "of", "the", "line", "in", "column", "positions", "." ]
def GetLineWidth(line): """Determines the width of the line in column positions. Args: line: A string, which may be a Unicode string. Returns: The width of the line in column positions, accounting for Unicode combining characters and wide characters. """ if isinstance(line, unicode): width =...
[ "def", "GetLineWidth", "(", "line", ")", ":", "if", "isinstance", "(", "line", ",", "unicode", ")", ":", "width", "=", "0", "for", "uc", "in", "unicodedata", ".", "normalize", "(", "'NFC'", ",", "line", ")", ":", "if", "unicodedata", ".", "east_asian_w...
https://github.com/MVIG-SJTU/RMPE/blob/5188c230ec800c12be7369c3619615bc9b020aa4/scripts/cpp_lint.py#L3441-L3460
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_cocoa/_core.py
python
GBSpan.__ne__
(*args, **kwargs)
return _core_.GBSpan___ne__(*args, **kwargs)
__ne__(self, PyObject other) -> bool Compare GBSpan for inequality.
__ne__(self, PyObject other) -> bool
[ "__ne__", "(", "self", "PyObject", "other", ")", "-", ">", "bool" ]
def __ne__(*args, **kwargs): """ __ne__(self, PyObject other) -> bool Compare GBSpan for inequality. """ return _core_.GBSpan___ne__(*args, **kwargs)
[ "def", "__ne__", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_core_", ".", "GBSpan___ne__", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/_core.py#L15680-L15686
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/tools/python3/src/Lib/_pydecimal.py
python
_convert_other
(other, raiseit=False, allow_float=False)
return NotImplemented
Convert other to Decimal. Verifies that it's ok to use in an implicit construction. If allow_float is true, allow conversion from float; this is used in the comparison methods (__eq__ and friends).
Convert other to Decimal.
[ "Convert", "other", "to", "Decimal", "." ]
def _convert_other(other, raiseit=False, allow_float=False): """Convert other to Decimal. Verifies that it's ok to use in an implicit construction. If allow_float is true, allow conversion from float; this is used in the comparison methods (__eq__ and friends). """ if isinstance(other, Decima...
[ "def", "_convert_other", "(", "other", ",", "raiseit", "=", "False", ",", "allow_float", "=", "False", ")", ":", "if", "isinstance", "(", "other", ",", "Decimal", ")", ":", "return", "other", "if", "isinstance", "(", "other", ",", "int", ")", ":", "ret...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python3/src/Lib/_pydecimal.py#L6013-L6030
Kitware/ParaView
f760af9124ff4634b23ebbeab95a4f56e0261955
ThirdParty/cinema/paraview/tpl/cinema_python/database/raster_wrangler.py
python
RasterWrangler.enableVTK
(self)
Try to turn on VTK file IO support
Try to turn on VTK file IO support
[ "Try", "to", "turn", "on", "VTK", "file", "IO", "support" ]
def enableVTK(self): """Try to turn on VTK file IO support""" if vtkEnabled: self.backends.add("VTK") else: warnings.warn("VTK module not found", ImportWarning)
[ "def", "enableVTK", "(", "self", ")", ":", "if", "vtkEnabled", ":", "self", ".", "backends", ".", "add", "(", "\"VTK\"", ")", "else", ":", "warnings", ".", "warn", "(", "\"VTK module not found\"", ",", "ImportWarning", ")" ]
https://github.com/Kitware/ParaView/blob/f760af9124ff4634b23ebbeab95a4f56e0261955/ThirdParty/cinema/paraview/tpl/cinema_python/database/raster_wrangler.py#L102-L107
hanpfei/chromium-net
392cc1fa3a8f92f42e4071ab6e674d8e0482f83f
tools/android/loading/chrome_cache.py
python
_EnsureCleanCacheDirectory
(directory_dest_path)
Ensure that a cache directory is created and clean. Args: directory_dest_path: Path of the cache directory to ensure cleanliness.
Ensure that a cache directory is created and clean.
[ "Ensure", "that", "a", "cache", "directory", "is", "created", "and", "clean", "." ]
def _EnsureCleanCacheDirectory(directory_dest_path): """Ensure that a cache directory is created and clean. Args: directory_dest_path: Path of the cache directory to ensure cleanliness. """ if os.path.isdir(directory_dest_path): shutil.rmtree(directory_dest_path) elif not os.path.isdir(os.path.dirnam...
[ "def", "_EnsureCleanCacheDirectory", "(", "directory_dest_path", ")", ":", "if", "os", ".", "path", ".", "isdir", "(", "directory_dest_path", ")", ":", "shutil", ".", "rmtree", "(", "directory_dest_path", ")", "elif", "not", "os", ".", "path", ".", "isdir", ...
https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/tools/android/loading/chrome_cache.py#L38-L48
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/windows/Lib/ftplib.py
python
FTP.retrlines
(self, cmd, callback = None)
return self.voidresp()
Retrieve data in line mode. A new port is created for you. Args: cmd: A RETR, LIST, or NLST command. callback: An optional single parameter callable that is called for each line with the trailing CRLF stripped. [default: print_line()] Return...
Retrieve data in line mode. A new port is created for you.
[ "Retrieve", "data", "in", "line", "mode", ".", "A", "new", "port", "is", "created", "for", "you", "." ]
def retrlines(self, cmd, callback = None): """Retrieve data in line mode. A new port is created for you. Args: cmd: A RETR, LIST, or NLST command. callback: An optional single parameter callable that is called for each line with the trailing CRLF stripped. ...
[ "def", "retrlines", "(", "self", ",", "cmd", ",", "callback", "=", "None", ")", ":", "if", "callback", "is", "None", ":", "callback", "=", "print_line", "resp", "=", "self", ".", "sendcmd", "(", "'TYPE A'", ")", "with", "self", ".", "transfercmd", "(",...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/ftplib.py#L453-L486
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/build/waf-1.7.13/waflib/Tools/ruby.py
python
init_rubyext
(self)
Add required variables for ruby extensions
Add required variables for ruby extensions
[ "Add", "required", "variables", "for", "ruby", "extensions" ]
def init_rubyext(self): """ Add required variables for ruby extensions """ self.install_path = '${ARCHDIR_RUBY}' self.uselib = self.to_list(getattr(self, 'uselib', '')) if not 'RUBY' in self.uselib: self.uselib.append('RUBY') if not 'RUBYEXT' in self.uselib: self.uselib.append('RUBYEXT')
[ "def", "init_rubyext", "(", "self", ")", ":", "self", ".", "install_path", "=", "'${ARCHDIR_RUBY}'", "self", ".", "uselib", "=", "self", ".", "to_list", "(", "getattr", "(", "self", ",", "'uselib'", ",", "''", ")", ")", "if", "not", "'RUBY'", "in", "se...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/build/waf-1.7.13/waflib/Tools/ruby.py#L32-L41
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/pip/_vendor/pkg_resources/__init__.py
python
WorkingSet.subscribe
(self, callback, existing=True)
Invoke `callback` for all distributions If `existing=True` (default), call on all existing ones, as well.
Invoke `callback` for all distributions
[ "Invoke", "callback", "for", "all", "distributions" ]
def subscribe(self, callback, existing=True): """Invoke `callback` for all distributions If `existing=True` (default), call on all existing ones, as well. """ if callback in self.callbacks: return self.callbacks.append(callback) if not existing: ...
[ "def", "subscribe", "(", "self", ",", "callback", ",", "existing", "=", "True", ")", ":", "if", "callback", "in", "self", ".", "callbacks", ":", "return", "self", ".", "callbacks", ".", "append", "(", "callback", ")", "if", "not", "existing", ":", "ret...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/pip/_vendor/pkg_resources/__init__.py#L907-L919
apple/swift-lldb
d74be846ef3e62de946df343e8c234bde93a8912
scripts/Python/static-binding/lldb.py
python
SBAttachInfo.SetEffectiveUserID
(self, uid)
return _lldb.SBAttachInfo_SetEffectiveUserID(self, uid)
SetEffectiveUserID(SBAttachInfo self, uint32_t uid)
SetEffectiveUserID(SBAttachInfo self, uint32_t uid)
[ "SetEffectiveUserID", "(", "SBAttachInfo", "self", "uint32_t", "uid", ")" ]
def SetEffectiveUserID(self, uid): """SetEffectiveUserID(SBAttachInfo self, uint32_t uid)""" return _lldb.SBAttachInfo_SetEffectiveUserID(self, uid)
[ "def", "SetEffectiveUserID", "(", "self", ",", "uid", ")", ":", "return", "_lldb", ".", "SBAttachInfo_SetEffectiveUserID", "(", "self", ",", "uid", ")" ]
https://github.com/apple/swift-lldb/blob/d74be846ef3e62de946df343e8c234bde93a8912/scripts/Python/static-binding/lldb.py#L1172-L1174
tensorflow/tensorflow
419e3a6b650ea4bd1b0cba23c4348f8a69f3272e
tensorflow/python/debug/wrappers/local_cli_wrapper.py
python
LocalCLIDebugWrapperSession._run_handler
(self, args, screen_info=None)
Command handler for "run" command during on-run-start.
Command handler for "run" command during on-run-start.
[ "Command", "handler", "for", "run", "command", "during", "on", "-", "run", "-", "start", "." ]
def _run_handler(self, args, screen_info=None): """Command handler for "run" command during on-run-start.""" del screen_info # Currently unused. parsed = self._argparsers["run"].parse_args(args) parsed.node_name_filter = parsed.node_name_filter or None parsed.op_type_filter = parsed.op_type_filte...
[ "def", "_run_handler", "(", "self", ",", "args", ",", "screen_info", "=", "None", ")", ":", "del", "screen_info", "# Currently unused.", "parsed", "=", "self", ".", "_argparsers", "[", "\"run\"", "]", ".", "parse_args", "(", "args", ")", "parsed", ".", "no...
https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/debug/wrappers/local_cli_wrapper.py#L518-L572
protocolbuffers/protobuf
b5ab0b7a18b7336c60130f4ddb2d97c51792f896
python/mox.py
python
ContainsKeyValue.equals
(self, rhs)
Check whether the given key/value pair is in the rhs dict. Returns: bool
Check whether the given key/value pair is in the rhs dict.
[ "Check", "whether", "the", "given", "key", "/", "value", "pair", "is", "in", "the", "rhs", "dict", "." ]
def equals(self, rhs): """Check whether the given key/value pair is in the rhs dict. Returns: bool """ try: return rhs[self._key] == self._value except Exception: return False
[ "def", "equals", "(", "self", ",", "rhs", ")", ":", "try", ":", "return", "rhs", "[", "self", ".", "_key", "]", "==", "self", ".", "_value", "except", "Exception", ":", "return", "False" ]
https://github.com/protocolbuffers/protobuf/blob/b5ab0b7a18b7336c60130f4ddb2d97c51792f896/python/mox.py#L989-L999
Evolving-AI-Lab/fooling
66f097dd6bd2eb6794ade3e187a7adfdf1887688
caffe/scripts/cpp_lint.py
python
FileInfo.Split
(self)
return (project,) + os.path.splitext(rest)
Splits the file into the directory, basename, and extension. For 'chrome/browser/browser.cc', Split() would return ('chrome/browser', 'browser', '.cc') Returns: A tuple of (directory, basename, extension).
Splits the file into the directory, basename, and extension.
[ "Splits", "the", "file", "into", "the", "directory", "basename", "and", "extension", "." ]
def Split(self): """Splits the file into the directory, basename, and extension. For 'chrome/browser/browser.cc', Split() would return ('chrome/browser', 'browser', '.cc') Returns: A tuple of (directory, basename, extension). """ googlename = self.RepositoryName() project, rest = os...
[ "def", "Split", "(", "self", ")", ":", "googlename", "=", "self", ".", "RepositoryName", "(", ")", "project", ",", "rest", "=", "os", ".", "path", ".", "split", "(", "googlename", ")", "return", "(", "project", ",", ")", "+", "os", ".", "path", "."...
https://github.com/Evolving-AI-Lab/fooling/blob/66f097dd6bd2eb6794ade3e187a7adfdf1887688/caffe/scripts/cpp_lint.py#L929-L941
klzgrad/naiveproxy
ed2c513637c77b18721fe428d7ed395b4d284c83
src/third_party/abseil-cpp/absl/abseil.podspec.gen.py
python
write_indented_list
(f, leading, values)
Writes leading values in an indented style.
Writes leading values in an indented style.
[ "Writes", "leading", "values", "in", "an", "indented", "style", "." ]
def write_indented_list(f, leading, values): """Writes leading values in an indented style.""" f.write(leading) f.write((",\n" + " " * len(leading)).join("'{}'".format(v) for v in values)) f.write("\n")
[ "def", "write_indented_list", "(", "f", ",", "leading", ",", "values", ")", ":", "f", ".", "write", "(", "leading", ")", "f", ".", "write", "(", "(", "\",\\n\"", "+", "\" \"", "*", "len", "(", "leading", ")", ")", ".", "join", "(", "\"'{}'\"", ".",...
https://github.com/klzgrad/naiveproxy/blob/ed2c513637c77b18721fe428d7ed395b4d284c83/src/third_party/abseil-cpp/absl/abseil.podspec.gen.py#L193-L197
benoitsteiner/tensorflow-opencl
cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5
tensorflow/python/ops/math_grad.py
python
_PolygammaGrad
(op, grad)
Returns gradient of psi(n, x) with respect to n and x.
Returns gradient of psi(n, x) with respect to n and x.
[ "Returns", "gradient", "of", "psi", "(", "n", "x", ")", "with", "respect", "to", "n", "and", "x", "." ]
def _PolygammaGrad(op, grad): """Returns gradient of psi(n, x) with respect to n and x.""" # TODO(tillahoffmann): Add derivative with respect to n n = op.inputs[0] x = op.inputs[1] # Broadcast gradients sn = array_ops.shape(n) sx = array_ops.shape(x) # pylint: disable=protected-access unused_rn, rx = ...
[ "def", "_PolygammaGrad", "(", "op", ",", "grad", ")", ":", "# TODO(tillahoffmann): Add derivative with respect to n", "n", "=", "op", ".", "inputs", "[", "0", "]", "x", "=", "op", ".", "inputs", "[", "1", "]", "# Broadcast gradients", "sn", "=", "array_ops", ...
https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/python/ops/math_grad.py#L571-L589
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/tkinter/__init__.py
python
PanedWindow.sash
(self, *args)
return self._getints( self.tk.call((self._w, 'sash') + args)) or ()
Internal function.
Internal function.
[ "Internal", "function", "." ]
def sash(self, *args): """Internal function.""" return self._getints( self.tk.call((self._w, 'sash') + args)) or ()
[ "def", "sash", "(", "self", ",", "*", "args", ")", ":", "return", "self", ".", "_getints", "(", "self", ".", "tk", ".", "call", "(", "(", "self", ".", "_w", ",", "'sash'", ")", "+", "args", ")", ")", "or", "(", ")" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/tkinter/__init__.py#L3865-L3868
apiaryio/drafter
4634ebd07f6c6f257cc656598ccd535492fdfb55
tools/gyp/pylib/gyp/generator/ninja.py
python
NinjaWriter.WriteMacBundleResources
(self, resources, bundle_depends)
return xcassets
Writes ninja edges for 'mac_bundle_resources'.
Writes ninja edges for 'mac_bundle_resources'.
[ "Writes", "ninja", "edges", "for", "mac_bundle_resources", "." ]
def WriteMacBundleResources(self, resources, bundle_depends): """Writes ninja edges for 'mac_bundle_resources'.""" xcassets = [] extra_env = self.xcode_settings.GetPerTargetSettings() env = self.GetSortedXcodeEnv(additional_settings=extra_env) env = self.ComputeExportEnvString(env) isBinary = s...
[ "def", "WriteMacBundleResources", "(", "self", ",", "resources", ",", "bundle_depends", ")", ":", "xcassets", "=", "[", "]", "extra_env", "=", "self", ".", "xcode_settings", ".", "GetPerTargetSettings", "(", ")", "env", "=", "self", ".", "GetSortedXcodeEnv", "...
https://github.com/apiaryio/drafter/blob/4634ebd07f6c6f257cc656598ccd535492fdfb55/tools/gyp/pylib/gyp/generator/ninja.py#L767-L787
windystrife/UnrealEngine_NVIDIAGameWorks
b50e6338a7c5b26374d66306ebc7807541ff815e
Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/mutex.py
python
mutex.lock
(self, function, argument)
Lock a mutex, call the function with supplied argument when it is acquired. If the mutex is already locked, place function and argument in the queue.
Lock a mutex, call the function with supplied argument when it is acquired. If the mutex is already locked, place function and argument in the queue.
[ "Lock", "a", "mutex", "call", "the", "function", "with", "supplied", "argument", "when", "it", "is", "acquired", ".", "If", "the", "mutex", "is", "already", "locked", "place", "function", "and", "argument", "in", "the", "queue", "." ]
def lock(self, function, argument): """Lock a mutex, call the function with supplied argument when it is acquired. If the mutex is already locked, place function and argument in the queue.""" if self.testandset(): function(argument) else: self.queue.appen...
[ "def", "lock", "(", "self", ",", "function", ",", "argument", ")", ":", "if", "self", ".", "testandset", "(", ")", ":", "function", "(", "argument", ")", "else", ":", "self", ".", "queue", ".", "append", "(", "(", "function", ",", "argument", ")", ...
https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/mutex.py#L39-L46
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/pandas/py2/pandas/core/series.py
python
Series.drop_duplicates
(self, keep='first', inplace=False)
return super(Series, self).drop_duplicates(keep=keep, inplace=inplace)
Return Series with duplicate values removed. Parameters ---------- keep : {'first', 'last', ``False``}, default 'first' - 'first' : Drop duplicates except for the first occurrence. - 'last' : Drop duplicates except for the last occurrence. - ``False`` : Drop ...
Return Series with duplicate values removed.
[ "Return", "Series", "with", "duplicate", "values", "removed", "." ]
def drop_duplicates(self, keep='first', inplace=False): """ Return Series with duplicate values removed. Parameters ---------- keep : {'first', 'last', ``False``}, default 'first' - 'first' : Drop duplicates except for the first occurrence. - 'last' : Dro...
[ "def", "drop_duplicates", "(", "self", ",", "keep", "=", "'first'", ",", "inplace", "=", "False", ")", ":", "return", "super", "(", "Series", ",", "self", ")", ".", "drop_duplicates", "(", "keep", "=", "keep", ",", "inplace", "=", "inplace", ")" ]
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/pandas/py2/pandas/core/series.py#L1670-L1741
krishauser/Klampt
972cc83ea5befac3f653c1ba20f80155768ad519
Python/klampt/vis/glprogram.py
python
GLProgram.reshape
(self,w,h)
Asks to resize the GL window
Asks to resize the GL window
[ "Asks", "to", "resize", "the", "GL", "window" ]
def reshape(self,w,h): """Asks to resize the GL window""" if self.window: return self.window.reshape(w,h) else: self.view.w,self.view.h = w,h
[ "def", "reshape", "(", "self", ",", "w", ",", "h", ")", ":", "if", "self", ".", "window", ":", "return", "self", ".", "window", ".", "reshape", "(", "w", ",", "h", ")", "else", ":", "self", ".", "view", ".", "w", ",", "self", ".", "view", "."...
https://github.com/krishauser/Klampt/blob/972cc83ea5befac3f653c1ba20f80155768ad519/Python/klampt/vis/glprogram.py#L83-L88
Xilinx/Vitis-AI
fc74d404563d9951b57245443c73bef389f3657f
tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/framework/common_shapes.py
python
get2d_conv_output_size
(input_height, input_width, filter_height, filter_width, row_stride, col_stride, padding_type)
return get_conv_output_size((input_height, input_width), (filter_height, filter_width), (row_stride, col_stride), padding_type)
Returns the number of rows and columns in a convolution/pooling output.
Returns the number of rows and columns in a convolution/pooling output.
[ "Returns", "the", "number", "of", "rows", "and", "columns", "in", "a", "convolution", "/", "pooling", "output", "." ]
def get2d_conv_output_size(input_height, input_width, filter_height, filter_width, row_stride, col_stride, padding_type): """Returns the number of rows and columns in a convolution/pooling output.""" return get_conv_output_size((input_height, input_width), (f...
[ "def", "get2d_conv_output_size", "(", "input_height", ",", "input_width", ",", "filter_height", ",", "filter_width", ",", "row_stride", ",", "col_stride", ",", "padding_type", ")", ":", "return", "get_conv_output_size", "(", "(", "input_height", ",", "input_width", ...
https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/framework/common_shapes.py#L160-L165
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/pandas/core/common.py
python
pipe
(obj, func, *args, **kwargs)
Apply a function ``func`` to object ``obj`` either by passing obj as the first argument to the function or, in the case that the func is a tuple, interpret the first element of the tuple as a function and pass the obj to that function as a keyword argument whose key is the value of the second element of...
Apply a function ``func`` to object ``obj`` either by passing obj as the first argument to the function or, in the case that the func is a tuple, interpret the first element of the tuple as a function and pass the obj to that function as a keyword argument whose key is the value of the second element of...
[ "Apply", "a", "function", "func", "to", "object", "obj", "either", "by", "passing", "obj", "as", "the", "first", "argument", "to", "the", "function", "or", "in", "the", "case", "that", "the", "func", "is", "a", "tuple", "interpret", "the", "first", "elem...
def pipe(obj, func, *args, **kwargs): """ Apply a function ``func`` to object ``obj`` either by passing obj as the first argument to the function or, in the case that the func is a tuple, interpret the first element of the tuple as a function and pass the obj to that function as a keyword argument w...
[ "def", "pipe", "(", "obj", ",", "func", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "if", "isinstance", "(", "func", ",", "tuple", ")", ":", "func", ",", "target", "=", "func", "if", "target", "in", "kwargs", ":", "msg", "=", "f\"{target...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/pandas/core/common.py#L429-L461