Search is not available for this dataset
identifier
stringlengths
1
155
parameters
stringlengths
2
6.09k
docstring
stringlengths
11
63.4k
docstring_summary
stringlengths
0
63.4k
function
stringlengths
29
99.8k
function_tokens
list
start_point
list
end_point
list
language
stringclasses
1 value
docstring_language
stringlengths
2
7
docstring_language_predictions
stringlengths
18
23
is_langid_reliable
stringclasses
2 values
Greatest.as_sqlite
(self, compiler, connection)
Use the MAX function on SQLite.
Use the MAX function on SQLite.
def as_sqlite(self, compiler, connection): """Use the MAX function on SQLite.""" return super(Greatest, self).as_sqlite(compiler, connection, function='MAX')
[ "def", "as_sqlite", "(", "self", ",", "compiler", ",", "connection", ")", ":", "return", "super", "(", "Greatest", ",", "self", ")", ".", "as_sqlite", "(", "compiler", ",", "connection", ",", "function", "=", "'MAX'", ")" ]
[ 137, 4 ]
[ 139, 84 ]
python
en
['en', 'en', 'en']
True
Least.as_sqlite
(self, compiler, connection)
Use the MIN function on SQLite.
Use the MIN function on SQLite.
def as_sqlite(self, compiler, connection): """Use the MIN function on SQLite.""" return super(Least, self).as_sqlite(compiler, connection, function='MIN')
[ "def", "as_sqlite", "(", "self", ",", "compiler", ",", "connection", ")", ":", "return", "super", "(", "Least", ",", "self", ")", ".", "as_sqlite", "(", "compiler", ",", "connection", ",", "function", "=", "'MIN'", ")" ]
[ 157, 4 ]
[ 159, 81 ]
python
en
['en', 'en', 'en']
True
Substr.__init__
(self, expression, pos, length=None, **extra)
expression: the name of a field, or an expression returning a string pos: an integer > 0, or an expression returning an integer length: an optional number of characters to return
expression: the name of a field, or an expression returning a string pos: an integer > 0, or an expression returning an integer length: an optional number of characters to return
def __init__(self, expression, pos, length=None, **extra): """ expression: the name of a field, or an expression returning a string pos: an integer > 0, or an expression returning an integer length: an optional number of characters to return """ if not hasattr(pos, 'resol...
[ "def", "__init__", "(", "self", ",", "expression", ",", "pos", ",", "length", "=", "None", ",", "*", "*", "extra", ")", ":", "if", "not", "hasattr", "(", "pos", ",", "'resolve_expression'", ")", ":", "if", "pos", "<", "1", ":", "raise", "ValueError",...
[ 198, 4 ]
[ 213, 59 ]
python
en
['en', 'error', 'th']
False
FarmerAPI.new_proof_of_space
( self, new_proof_of_space: harvester_protocol.NewProofOfSpace, peer: ws.WSKaleConnection )
This is a response from the harvester, for a NewChallenge. Here we check if the proof of space is sufficiently good, and if so, we ask for the whole proof.
This is a response from the harvester, for a NewChallenge. Here we check if the proof of space is sufficiently good, and if so, we ask for the whole proof.
async def new_proof_of_space( self, new_proof_of_space: harvester_protocol.NewProofOfSpace, peer: ws.WSKaleConnection ): """ This is a response from the harvester, for a NewChallenge. Here we check if the proof of space is sufficiently good, and if so, we ask for the whole proof. ...
[ "async", "def", "new_proof_of_space", "(", "self", ",", "new_proof_of_space", ":", "harvester_protocol", ".", "NewProofOfSpace", ",", "peer", ":", "ws", ".", "WSKaleConnection", ")", ":", "if", "new_proof_of_space", ".", "sp_hash", "not", "in", "self", ".", "far...
[ 28, 4 ]
[ 109, 77 ]
python
en
['en', 'error', 'th']
False
FarmerAPI.respond_signatures
(self, response: harvester_protocol.RespondSignatures)
There are two cases: receiving signatures for sps, or receiving signatures for the block.
There are two cases: receiving signatures for sps, or receiving signatures for the block.
async def respond_signatures(self, response: harvester_protocol.RespondSignatures): """ There are two cases: receiving signatures for sps, or receiving signatures for the block. """ if response.sp_hash not in self.farmer.sps: self.farmer.log.warning(f"Do not have challenge ha...
[ "async", "def", "respond_signatures", "(", "self", ",", "response", ":", "harvester_protocol", ".", "RespondSignatures", ")", ":", "if", "response", ".", "sp_hash", "not", "in", "self", ".", "farmer", ".", "sps", ":", "self", ".", "farmer", ".", "log", "."...
[ 112, 4 ]
[ 231, 83 ]
python
en
['en', 'error', 'th']
False
XcodeArchsVariableMapping
(archs, archs_including_64_bit=None)
Constructs a dictionary with expansion for $(ARCHS_STANDARD) variable, and optionally for $(ARCHS_STANDARD_INCLUDING_64_BIT).
Constructs a dictionary with expansion for $(ARCHS_STANDARD) variable, and optionally for $(ARCHS_STANDARD_INCLUDING_64_BIT).
def XcodeArchsVariableMapping(archs, archs_including_64_bit=None): """Constructs a dictionary with expansion for $(ARCHS_STANDARD) variable, and optionally for $(ARCHS_STANDARD_INCLUDING_64_BIT).""" mapping = {"$(ARCHS_STANDARD)": archs} if archs_including_64_bit: mapping["$(ARCHS_STANDARD_INCLUDI...
[ "def", "XcodeArchsVariableMapping", "(", "archs", ",", "archs_including_64_bit", "=", "None", ")", ":", "mapping", "=", "{", "\"$(ARCHS_STANDARD)\"", ":", "archs", "}", "if", "archs_including_64_bit", ":", "mapping", "[", "\"$(ARCHS_STANDARD_INCLUDING_64_BIT)\"", "]", ...
[ 33, 0 ]
[ 39, 18 ]
python
en
['en', 'en', 'en']
True
GetXcodeArchsDefault
()
Returns the |XcodeArchsDefault| object to use to expand ARCHS for the installed version of Xcode. The default values used by Xcode for ARCHS and the expansion of the variables depends on the version of Xcode used. For all version anterior to Xcode 5.0 or posterior to Xcode 5.1 included uses $(ARCHS_STANDARD) i...
Returns the |XcodeArchsDefault| object to use to expand ARCHS for the installed version of Xcode. The default values used by Xcode for ARCHS and the expansion of the variables depends on the version of Xcode used.
def GetXcodeArchsDefault(): """Returns the |XcodeArchsDefault| object to use to expand ARCHS for the installed version of Xcode. The default values used by Xcode for ARCHS and the expansion of the variables depends on the version of Xcode used. For all version anterior to Xcode 5.0 or posterior to Xcode 5.1 ...
[ "def", "GetXcodeArchsDefault", "(", ")", ":", "global", "XCODE_ARCHS_DEFAULT_CACHE", "if", "XCODE_ARCHS_DEFAULT_CACHE", ":", "return", "XCODE_ARCHS_DEFAULT_CACHE", "xcode_version", ",", "_", "=", "XcodeVersion", "(", ")", "if", "xcode_version", "<", "\"0500\"", ":", "...
[ 98, 0 ]
[ 147, 36 ]
python
en
['en', 'en', 'en']
True
XcodeVersion
()
Returns a tuple of version and build version of installed Xcode.
Returns a tuple of version and build version of installed Xcode.
def XcodeVersion(): """Returns a tuple of version and build version of installed Xcode.""" # `xcodebuild -version` output looks like # Xcode 4.6.3 # Build version 4H1503 # or like # Xcode 3.2.6 # Component versions: DevToolsCore-1809.0; DevToolsSupport-1806.0 # BuildVersio...
[ "def", "XcodeVersion", "(", ")", ":", "# `xcodebuild -version` output looks like", "# Xcode 4.6.3", "# Build version 4H1503", "# or like", "# Xcode 3.2.6", "# Component versions: DevToolsCore-1809.0; DevToolsSupport-1806.0", "# BuildVersion: 10M2518", "# Convert that to ('0463...
[ 1483, 0 ]
[ 1518, 30 ]
python
en
['en', 'en', 'en']
True
CLTVersion
()
Returns the version of command-line tools from pkgutil.
Returns the version of command-line tools from pkgutil.
def CLTVersion(): """Returns the version of command-line tools from pkgutil.""" # pkgutil output looks like # package-id: com.apple.pkg.CLTools_Executables # version: 5.0.1.0.1.1382131676 # volume: / # location: / # install-time: 1382544035 # groups: com.apple.FindSystemFiles...
[ "def", "CLTVersion", "(", ")", ":", "# pkgutil output looks like", "# package-id: com.apple.pkg.CLTools_Executables", "# version: 5.0.1.0.1.1382131676", "# volume: /", "# location: /", "# install-time: 1382544035", "# groups: com.apple.FindSystemFiles.pkg-group", "# com...
[ 1522, 0 ]
[ 1550, 19 ]
python
en
['en', 'en', 'en']
True
GetStdoutQuiet
(cmdlist)
Returns the content of standard output returned by invoking |cmdlist|. Ignores the stderr. Raises |GypError| if the command return with a non-zero return code.
Returns the content of standard output returned by invoking |cmdlist|. Ignores the stderr. Raises |GypError| if the command return with a non-zero return code.
def GetStdoutQuiet(cmdlist): """Returns the content of standard output returned by invoking |cmdlist|. Ignores the stderr. Raises |GypError| if the command return with a non-zero return code.""" job = subprocess.Popen(cmdlist, stdout=subprocess.PIPE, stderr=subprocess.PIPE) out = job.communicate()[0] ...
[ "def", "GetStdoutQuiet", "(", "cmdlist", ")", ":", "job", "=", "subprocess", ".", "Popen", "(", "cmdlist", ",", "stdout", "=", "subprocess", ".", "PIPE", ",", "stderr", "=", "subprocess", ".", "PIPE", ")", "out", "=", "job", ".", "communicate", "(", ")...
[ 1553, 0 ]
[ 1563, 27 ]
python
en
['en', 'en', 'en']
True
GetStdout
(cmdlist)
Returns the content of standard output returned by invoking |cmdlist|. Raises |GypError| if the command return with a non-zero return code.
Returns the content of standard output returned by invoking |cmdlist|. Raises |GypError| if the command return with a non-zero return code.
def GetStdout(cmdlist): """Returns the content of standard output returned by invoking |cmdlist|. Raises |GypError| if the command return with a non-zero return code.""" job = subprocess.Popen(cmdlist, stdout=subprocess.PIPE) out = job.communicate()[0] if PY3: out = out.decode("utf-8") if ...
[ "def", "GetStdout", "(", "cmdlist", ")", ":", "job", "=", "subprocess", ".", "Popen", "(", "cmdlist", ",", "stdout", "=", "subprocess", ".", "PIPE", ")", "out", "=", "job", ".", "communicate", "(", ")", "[", "0", "]", "if", "PY3", ":", "out", "=", ...
[ 1566, 0 ]
[ 1576, 27 ]
python
en
['en', 'en', 'en']
True
MergeGlobalXcodeSettingsToSpec
(global_dict, spec)
Merges the global xcode_settings dictionary into each configuration of the target represented by spec. For keys that are both in the global and the local xcode_settings dict, the local key gets precedence.
Merges the global xcode_settings dictionary into each configuration of the target represented by spec. For keys that are both in the global and the local xcode_settings dict, the local key gets precedence.
def MergeGlobalXcodeSettingsToSpec(global_dict, spec): """Merges the global xcode_settings dictionary into each configuration of the target represented by spec. For keys that are both in the global and the local xcode_settings dict, the local key gets precedence. """ # The xcode generator special-cases gl...
[ "def", "MergeGlobalXcodeSettingsToSpec", "(", "global_dict", ",", "spec", ")", ":", "# The xcode generator special-cases global xcode_settings and does something", "# that amounts to merging in the global xcode_settings into each local", "# xcode_settings dict.", "global_xcode_settings", "="...
[ 1579, 0 ]
[ 1592, 51 ]
python
en
['en', 'en', 'en']
True
IsMacBundle
(flavor, spec)
Returns if |spec| should be treated as a bundle. Bundles are directories with a certain subdirectory structure, instead of just a single file. Bundle rules do not produce a binary but also package resources into that directory.
Returns if |spec| should be treated as a bundle.
def IsMacBundle(flavor, spec): """Returns if |spec| should be treated as a bundle. Bundles are directories with a certain subdirectory structure, instead of just a single file. Bundle rules do not produce a binary but also package resources into that directory.""" is_mac_bundle = ( int(spec.get("...
[ "def", "IsMacBundle", "(", "flavor", ",", "spec", ")", ":", "is_mac_bundle", "=", "(", "int", "(", "spec", ".", "get", "(", "\"mac_xctest_bundle\"", ",", "0", ")", ")", "!=", "0", "or", "int", "(", "spec", ".", "get", "(", "\"mac_xcuitest_bundle\"", ",...
[ 1595, 0 ]
[ 1612, 24 ]
python
en
['en', 'en', 'en']
True
GetMacBundleResources
(product_dir, xcode_settings, resources)
Yields (output, resource) pairs for every resource in |resources|. Only call this for mac bundle targets. Args: product_dir: Path to the directory containing the output bundle, relative to the build directory. xcode_settings: The XcodeSettings of the current target. resources: A list of...
Yields (output, resource) pairs for every resource in |resources|. Only call this for mac bundle targets.
def GetMacBundleResources(product_dir, xcode_settings, resources): """Yields (output, resource) pairs for every resource in |resources|. Only call this for mac bundle targets. Args: product_dir: Path to the directory containing the output bundle, relative to the build directory. xcode_set...
[ "def", "GetMacBundleResources", "(", "product_dir", ",", "xcode_settings", ",", "resources", ")", ":", "dest", "=", "os", ".", "path", ".", "join", "(", "product_dir", ",", "xcode_settings", ".", "GetBundleResourceFolder", "(", ")", ")", "for", "res", "in", ...
[ 1615, 0 ]
[ 1650, 25 ]
python
en
['en', 'en', 'en']
True
GetMacInfoPlist
(product_dir, xcode_settings, gyp_path_to_build_path)
Returns (info_plist, dest_plist, defines, extra_env), where: * |info_plist| is the source plist path, relative to the build directory, * |dest_plist| is the destination plist path, relative to the build directory, * |defines| is a list of preprocessor defines (empty if the plist shouldn't be preproces...
Returns (info_plist, dest_plist, defines, extra_env), where: * |info_plist| is the source plist path, relative to the build directory, * |dest_plist| is the destination plist path, relative to the build directory, * |defines| is a list of preprocessor defines (empty if the plist shouldn't be preproces...
def GetMacInfoPlist(product_dir, xcode_settings, gyp_path_to_build_path): """Returns (info_plist, dest_plist, defines, extra_env), where: * |info_plist| is the source plist path, relative to the build directory, * |dest_plist| is the destination plist path, relative to the build directory, * |defines|...
[ "def", "GetMacInfoPlist", "(", "product_dir", ",", "xcode_settings", ",", "gyp_path_to_build_path", ")", ":", "info_plist", "=", "xcode_settings", ".", "GetPerTargetSetting", "(", "\"INFOPLIST_FILE\"", ")", "if", "not", "info_plist", ":", "return", "None", ",", "Non...
[ 1653, 0 ]
[ 1703, 53 ]
python
en
['en', 'fr', 'en']
True
_GetXcodeEnv
( xcode_settings, built_products_dir, srcroot, configuration, additional_settings=None )
Return the environment variables that Xcode would set. See http://developer.apple.com/library/mac/#documentation/DeveloperTools/Reference/XcodeBuildSettingRef/1-Build_Setting_Reference/build_setting_ref.html#//apple_ref/doc/uid/TP40003931-CH3-SW153 for a full list. Args: xcode_settings: An XcodeSettings ob...
Return the environment variables that Xcode would set. See http://developer.apple.com/library/mac/#documentation/DeveloperTools/Reference/XcodeBuildSettingRef/1-Build_Setting_Reference/build_setting_ref.html#//apple_ref/doc/uid/TP40003931-CH3-SW153 for a full list.
def _GetXcodeEnv( xcode_settings, built_products_dir, srcroot, configuration, additional_settings=None ): """Return the environment variables that Xcode would set. See http://developer.apple.com/library/mac/#documentation/DeveloperTools/Reference/XcodeBuildSettingRef/1-Build_Setting_Reference/build_setting_re...
[ "def", "_GetXcodeEnv", "(", "xcode_settings", ",", "built_products_dir", ",", "srcroot", ",", "configuration", ",", "additional_settings", "=", "None", ")", ":", "if", "not", "xcode_settings", ":", "return", "{", "}", "# This function is considered a friend of XcodeSett...
[ 1706, 0 ]
[ 1818, 30 ]
python
en
['en', 'en', 'en']
True
_NormalizeEnvVarReferences
(str)
Takes a string containing variable references in the form ${FOO}, $(FOO), or $FOO, and returns a string with all variable references in the form ${FOO}.
Takes a string containing variable references in the form ${FOO}, $(FOO), or $FOO, and returns a string with all variable references in the form ${FOO}.
def _NormalizeEnvVarReferences(str): """Takes a string containing variable references in the form ${FOO}, $(FOO), or $FOO, and returns a string with all variable references in the form ${FOO}. """ # $FOO -> ${FOO} str = re.sub(r"\$([a-zA-Z_][a-zA-Z0-9_]*)", r"${\1}", str) # $(FOO) -> ${FOO} mat...
[ "def", "_NormalizeEnvVarReferences", "(", "str", ")", ":", "# $FOO -> ${FOO}", "str", "=", "re", ".", "sub", "(", "r\"\\$([a-zA-Z_][a-zA-Z0-9_]*)\"", ",", "r\"${\\1}\"", ",", "str", ")", "# $(FOO) -> ${FOO}", "matches", "=", "re", ".", "findall", "(", "r\"(\\$\\((...
[ 1821, 0 ]
[ 1835, 14 ]
python
en
['en', 'en', 'en']
True
ExpandEnvVars
(string, expansions)
Expands ${VARIABLES}, $(VARIABLES), and $VARIABLES in string per the expansions list. If the variable expands to something that references another variable, this variable is expanded as well if it's in env -- until no variables present in env are left.
Expands ${VARIABLES}, $(VARIABLES), and $VARIABLES in string per the expansions list. If the variable expands to something that references another variable, this variable is expanded as well if it's in env -- until no variables present in env are left.
def ExpandEnvVars(string, expansions): """Expands ${VARIABLES}, $(VARIABLES), and $VARIABLES in string per the expansions list. If the variable expands to something that references another variable, this variable is expanded as well if it's in env -- until no variables present in env are left.""" for k, v...
[ "def", "ExpandEnvVars", "(", "string", ",", "expansions", ")", ":", "for", "k", ",", "v", "in", "reversed", "(", "expansions", ")", ":", "string", "=", "string", ".", "replace", "(", "\"${\"", "+", "k", "+", "\"}\"", ",", "v", ")", "string", "=", "...
[ 1838, 0 ]
[ 1847, 17 ]
python
en
['en', 'en', 'en']
True
_TopologicallySortedEnvVarKeys
(env)
Takes a dict |env| whose values are strings that can refer to other keys, for example env['foo'] = '$(bar) and $(baz)'. Returns a list L of all keys of env such that key2 is after key1 in L if env[key2] refers to env[key1]. Throws an Exception in case of dependency cycles.
Takes a dict |env| whose values are strings that can refer to other keys, for example env['foo'] = '$(bar) and $(baz)'. Returns a list L of all keys of env such that key2 is after key1 in L if env[key2] refers to env[key1].
def _TopologicallySortedEnvVarKeys(env): """Takes a dict |env| whose values are strings that can refer to other keys, for example env['foo'] = '$(bar) and $(baz)'. Returns a list L of all keys of env such that key2 is after key1 in L if env[key2] refers to env[key1]. Throws an Exception in case of dependency...
[ "def", "_TopologicallySortedEnvVarKeys", "(", "env", ")", ":", "# Since environment variables can refer to other variables, the evaluation", "# order is important. Below is the logic to compute the dependency graph", "# and sort it.", "regex", "=", "re", ".", "compile", "(", "r\"\\$\\{...
[ 1850, 0 ]
[ 1883, 9 ]
python
en
['en', 'en', 'en']
True
GetSpecPostbuildCommands
(spec, quiet=False)
Returns the list of postbuilds explicitly defined on |spec|, in a form executable by a shell.
Returns the list of postbuilds explicitly defined on |spec|, in a form executable by a shell.
def GetSpecPostbuildCommands(spec, quiet=False): """Returns the list of postbuilds explicitly defined on |spec|, in a form executable by a shell.""" postbuilds = [] for postbuild in spec.get("postbuilds", []): if not quiet: postbuilds.append( "echo POSTBUILD\\(%s\\) %s"...
[ "def", "GetSpecPostbuildCommands", "(", "spec", ",", "quiet", "=", "False", ")", ":", "postbuilds", "=", "[", "]", "for", "postbuild", "in", "spec", ".", "get", "(", "\"postbuilds\"", ",", "[", "]", ")", ":", "if", "not", "quiet", ":", "postbuilds", "....
[ 1895, 0 ]
[ 1906, 21 ]
python
en
['en', 'en', 'en']
True
_HasIOSTarget
(targets)
Returns true if any target contains the iOS specific key IPHONEOS_DEPLOYMENT_TARGET.
Returns true if any target contains the iOS specific key IPHONEOS_DEPLOYMENT_TARGET.
def _HasIOSTarget(targets): """Returns true if any target contains the iOS specific key IPHONEOS_DEPLOYMENT_TARGET.""" for target_dict in targets.values(): for config in target_dict["configurations"].values(): if config.get("xcode_settings", {}).get("IPHONEOS_DEPLOYMENT_TARGET"): ...
[ "def", "_HasIOSTarget", "(", "targets", ")", ":", "for", "target_dict", "in", "targets", ".", "values", "(", ")", ":", "for", "config", "in", "target_dict", "[", "\"configurations\"", "]", ".", "values", "(", ")", ":", "if", "config", ".", "get", "(", ...
[ 1909, 0 ]
[ 1916, 16 ]
python
en
['en', 'en', 'en']
True
_AddIOSDeviceConfigurations
(targets)
Clone all targets and append -iphoneos to the name. Configure these targets to build for iOS devices and use correct architectures for those builds.
Clone all targets and append -iphoneos to the name. Configure these targets to build for iOS devices and use correct architectures for those builds.
def _AddIOSDeviceConfigurations(targets): """Clone all targets and append -iphoneos to the name. Configure these targets to build for iOS devices and use correct architectures for those builds.""" for target_dict in targets.values(): toolset = target_dict["toolset"] configs = target_dict["conf...
[ "def", "_AddIOSDeviceConfigurations", "(", "targets", ")", ":", "for", "target_dict", "in", "targets", ".", "values", "(", ")", ":", "toolset", "=", "target_dict", "[", "\"toolset\"", "]", "configs", "=", "target_dict", "[", "\"configurations\"", "]", "for", "...
[ 1919, 0 ]
[ 1932, 18 ]
python
en
['en', 'en', 'en']
True
CloneConfigurationForDeviceAndEmulator
(target_dicts)
If |target_dicts| contains any iOS targets, automatically create -iphoneos targets for iOS device builds.
If |target_dicts| contains any iOS targets, automatically create -iphoneos targets for iOS device builds.
def CloneConfigurationForDeviceAndEmulator(target_dicts): """If |target_dicts| contains any iOS targets, automatically create -iphoneos targets for iOS device builds.""" if _HasIOSTarget(target_dicts): return _AddIOSDeviceConfigurations(target_dicts) return target_dicts
[ "def", "CloneConfigurationForDeviceAndEmulator", "(", "target_dicts", ")", ":", "if", "_HasIOSTarget", "(", "target_dicts", ")", ":", "return", "_AddIOSDeviceConfigurations", "(", "target_dicts", ")", "return", "target_dicts" ]
[ 1935, 0 ]
[ 1940, 23 ]
python
en
['en', 'en', 'en']
True
XcodeArchsDefault._VariableMapping
(self, sdkroot)
Returns the dictionary of variable mapping depending on the SDKROOT.
Returns the dictionary of variable mapping depending on the SDKROOT.
def _VariableMapping(self, sdkroot): """Returns the dictionary of variable mapping depending on the SDKROOT.""" sdkroot = sdkroot.lower() if "iphoneos" in sdkroot: return self._archs["ios"] elif "iphonesimulator" in sdkroot: return self._archs["iossim"] el...
[ "def", "_VariableMapping", "(", "self", ",", "sdkroot", ")", ":", "sdkroot", "=", "sdkroot", ".", "lower", "(", ")", "if", "\"iphoneos\"", "in", "sdkroot", ":", "return", "self", ".", "_archs", "[", "\"ios\"", "]", "elif", "\"iphonesimulator\"", "in", "sdk...
[ 56, 4 ]
[ 64, 37 ]
python
en
['en', 'en', 'en']
True
XcodeArchsDefault._ExpandArchs
(self, archs, sdkroot)
Expands variables references in ARCHS, and remove duplicates.
Expands variables references in ARCHS, and remove duplicates.
def _ExpandArchs(self, archs, sdkroot): """Expands variables references in ARCHS, and remove duplicates.""" variable_mapping = self._VariableMapping(sdkroot) expanded_archs = [] for arch in archs: if self.variable_pattern.match(arch): variable = arch ...
[ "def", "_ExpandArchs", "(", "self", ",", "archs", ",", "sdkroot", ")", ":", "variable_mapping", "=", "self", ".", "_VariableMapping", "(", "sdkroot", ")", "expanded_archs", "=", "[", "]", "for", "arch", "in", "archs", ":", "if", "self", ".", "variable_patt...
[ 66, 4 ]
[ 82, 29 ]
python
en
['en', 'en', 'en']
True
XcodeArchsDefault.ActiveArchs
(self, archs, valid_archs, sdkroot)
Expands variables references in ARCHS, and filter by VALID_ARCHS if it is defined (if not set, Xcode accept any value in ARCHS, otherwise, only values present in VALID_ARCHS are kept).
Expands variables references in ARCHS, and filter by VALID_ARCHS if it is defined (if not set, Xcode accept any value in ARCHS, otherwise, only values present in VALID_ARCHS are kept).
def ActiveArchs(self, archs, valid_archs, sdkroot): """Expands variables references in ARCHS, and filter by VALID_ARCHS if it is defined (if not set, Xcode accept any value in ARCHS, otherwise, only values present in VALID_ARCHS are kept).""" expanded_archs = self._ExpandArchs(archs or self._def...
[ "def", "ActiveArchs", "(", "self", ",", "archs", ",", "valid_archs", ",", "sdkroot", ")", ":", "expanded_archs", "=", "self", ".", "_ExpandArchs", "(", "archs", "or", "self", ".", "_default", ",", "sdkroot", "or", "\"\"", ")", "if", "valid_archs", ":", "...
[ 84, 4 ]
[ 95, 29 ]
python
en
['en', 'en', 'en']
True
XcodeSettings._ConvertConditionalKeys
(self, configname)
Converts or warns on conditional keys. Xcode supports conditional keys, such as CODE_SIGN_IDENTITY[sdk=iphoneos*]. This is a partial implementation with some keys converted while the rest force a warning.
Converts or warns on conditional keys. Xcode supports conditional keys, such as CODE_SIGN_IDENTITY[sdk=iphoneos*]. This is a partial implementation with some keys converted while the rest force a warning.
def _ConvertConditionalKeys(self, configname): """Converts or warns on conditional keys. Xcode supports conditional keys, such as CODE_SIGN_IDENTITY[sdk=iphoneos*]. This is a partial implementation with some keys converted while the rest force a warning.""" settings = self.xcode_settings[confi...
[ "def", "_ConvertConditionalKeys", "(", "self", ",", "configname", ")", ":", "settings", "=", "self", ".", "xcode_settings", "[", "configname", "]", "conditional_keys", "=", "[", "key", "for", "key", "in", "settings", "if", "key", ".", "endswith", "(", "\"]\"...
[ 192, 4 ]
[ 209, 29 ]
python
en
['en', 'en', 'en']
True
XcodeSettings.GetFrameworkVersion
(self)
Returns the framework version of the current target. Only valid for bundles.
Returns the framework version of the current target. Only valid for bundles.
def GetFrameworkVersion(self): """Returns the framework version of the current target. Only valid for bundles.""" assert self._IsBundle() return self.GetPerTargetSetting("FRAMEWORK_VERSION", default="A")
[ "def", "GetFrameworkVersion", "(", "self", ")", ":", "assert", "self", ".", "_IsBundle", "(", ")", "return", "self", ".", "GetPerTargetSetting", "(", "\"FRAMEWORK_VERSION\"", ",", "default", "=", "\"A\"", ")" ]
[ 258, 4 ]
[ 262, 73 ]
python
en
['en', 'en', 'en']
True
XcodeSettings.GetWrapperExtension
(self)
Returns the bundle extension (.app, .framework, .plugin, etc). Only valid for bundles.
Returns the bundle extension (.app, .framework, .plugin, etc). Only valid for bundles.
def GetWrapperExtension(self): """Returns the bundle extension (.app, .framework, .plugin, etc). Only valid for bundles.""" assert self._IsBundle() if self.spec["type"] in ("loadable_module", "shared_library"): default_wrapper_extension = { "loadable_module": "bu...
[ "def", "GetWrapperExtension", "(", "self", ")", ":", "assert", "self", ".", "_IsBundle", "(", ")", "if", "self", ".", "spec", "[", "\"type\"", "]", "in", "(", "\"loadable_module\"", ",", "\"shared_library\"", ")", ":", "default_wrapper_extension", "=", "{", ...
[ 264, 4 ]
[ 286, 13 ]
python
en
['en', 'da', 'en']
True
XcodeSettings.GetProductName
(self)
Returns PRODUCT_NAME.
Returns PRODUCT_NAME.
def GetProductName(self): """Returns PRODUCT_NAME.""" return self.spec.get("product_name", self.spec["target_name"])
[ "def", "GetProductName", "(", "self", ")", ":", "return", "self", ".", "spec", ".", "get", "(", "\"product_name\"", ",", "self", ".", "spec", "[", "\"target_name\"", "]", ")" ]
[ 288, 4 ]
[ 290, 70 ]
python
en
['en', 'en', 'en']
False
XcodeSettings.GetFullProductName
(self)
Returns FULL_PRODUCT_NAME.
Returns FULL_PRODUCT_NAME.
def GetFullProductName(self): """Returns FULL_PRODUCT_NAME.""" if self._IsBundle(): return self.GetWrapperName() else: return self._GetStandaloneBinaryPath()
[ "def", "GetFullProductName", "(", "self", ")", ":", "if", "self", ".", "_IsBundle", "(", ")", ":", "return", "self", ".", "GetWrapperName", "(", ")", "else", ":", "return", "self", ".", "_GetStandaloneBinaryPath", "(", ")" ]
[ 292, 4 ]
[ 297, 50 ]
python
en
['en', 'no', 'en']
False
XcodeSettings.GetWrapperName
(self)
Returns the directory name of the bundle represented by this target. Only valid for bundles.
Returns the directory name of the bundle represented by this target. Only valid for bundles.
def GetWrapperName(self): """Returns the directory name of the bundle represented by this target. Only valid for bundles.""" assert self._IsBundle() return self.GetProductName() + self.GetWrapperExtension()
[ "def", "GetWrapperName", "(", "self", ")", ":", "assert", "self", ".", "_IsBundle", "(", ")", "return", "self", ".", "GetProductName", "(", ")", "+", "self", ".", "GetWrapperExtension", "(", ")" ]
[ 299, 4 ]
[ 303, 65 ]
python
en
['en', 'en', 'en']
True
XcodeSettings.GetBundleContentsFolderPath
(self)
Returns the qualified path to the bundle's contents folder. E.g. Chromium.app/Contents or Foo.bundle/Versions/A. Only valid for bundles.
Returns the qualified path to the bundle's contents folder. E.g. Chromium.app/Contents or Foo.bundle/Versions/A. Only valid for bundles.
def GetBundleContentsFolderPath(self): """Returns the qualified path to the bundle's contents folder. E.g. Chromium.app/Contents or Foo.bundle/Versions/A. Only valid for bundles.""" if self.isIOS: return self.GetWrapperName() assert self._IsBundle() if self.spec["type"] =...
[ "def", "GetBundleContentsFolderPath", "(", "self", ")", ":", "if", "self", ".", "isIOS", ":", "return", "self", ".", "GetWrapperName", "(", ")", "assert", "self", ".", "_IsBundle", "(", ")", "if", "self", ".", "spec", "[", "\"type\"", "]", "==", "\"share...
[ 305, 4 ]
[ 317, 66 ]
python
en
['en', 'en', 'en']
True
XcodeSettings.GetBundleResourceFolder
(self)
Returns the qualified path to the bundle's resource folder. E.g. Chromium.app/Contents/Resources. Only valid for bundles.
Returns the qualified path to the bundle's resource folder. E.g. Chromium.app/Contents/Resources. Only valid for bundles.
def GetBundleResourceFolder(self): """Returns the qualified path to the bundle's resource folder. E.g. Chromium.app/Contents/Resources. Only valid for bundles.""" assert self._IsBundle() if self.isIOS: return self.GetBundleContentsFolderPath() return os.path.join(self.Get...
[ "def", "GetBundleResourceFolder", "(", "self", ")", ":", "assert", "self", ".", "_IsBundle", "(", ")", "if", "self", ".", "isIOS", ":", "return", "self", ".", "GetBundleContentsFolderPath", "(", ")", "return", "os", ".", "path", ".", "join", "(", "self", ...
[ 319, 4 ]
[ 325, 76 ]
python
en
['en', 'en', 'en']
True
XcodeSettings.GetBundleExecutableFolderPath
(self)
Returns the qualified path to the bundle's executables folder. E.g. Chromium.app/Contents/MacOS. Only valid for bundles.
Returns the qualified path to the bundle's executables folder. E.g. Chromium.app/Contents/MacOS. Only valid for bundles.
def GetBundleExecutableFolderPath(self): """Returns the qualified path to the bundle's executables folder. E.g. Chromium.app/Contents/MacOS. Only valid for bundles.""" assert self._IsBundle() if self.spec["type"] in ("shared_library") or self.isIOS: return self.GetBundleContentsF...
[ "def", "GetBundleExecutableFolderPath", "(", "self", ")", ":", "assert", "self", ".", "_IsBundle", "(", ")", "if", "self", ".", "spec", "[", "\"type\"", "]", "in", "(", "\"shared_library\"", ")", "or", "self", ".", "isIOS", ":", "return", "self", ".", "G...
[ 327, 4 ]
[ 334, 76 ]
python
en
['en', 'en', 'en']
True
XcodeSettings.GetBundleJavaFolderPath
(self)
Returns the qualified path to the bundle's Java resource folder. E.g. Chromium.app/Contents/Resources/Java. Only valid for bundles.
Returns the qualified path to the bundle's Java resource folder. E.g. Chromium.app/Contents/Resources/Java. Only valid for bundles.
def GetBundleJavaFolderPath(self): """Returns the qualified path to the bundle's Java resource folder. E.g. Chromium.app/Contents/Resources/Java. Only valid for bundles.""" assert self._IsBundle() return os.path.join(self.GetBundleResourceFolder(), "Java")
[ "def", "GetBundleJavaFolderPath", "(", "self", ")", ":", "assert", "self", ".", "_IsBundle", "(", ")", "return", "os", ".", "path", ".", "join", "(", "self", ".", "GetBundleResourceFolder", "(", ")", ",", "\"Java\"", ")" ]
[ 336, 4 ]
[ 340, 67 ]
python
en
['en', 'en', 'en']
True
XcodeSettings.GetBundleFrameworksFolderPath
(self)
Returns the qualified path to the bundle's frameworks folder. E.g, Chromium.app/Contents/Frameworks. Only valid for bundles.
Returns the qualified path to the bundle's frameworks folder. E.g, Chromium.app/Contents/Frameworks. Only valid for bundles.
def GetBundleFrameworksFolderPath(self): """Returns the qualified path to the bundle's frameworks folder. E.g, Chromium.app/Contents/Frameworks. Only valid for bundles.""" assert self._IsBundle() return os.path.join(self.GetBundleContentsFolderPath(), "Frameworks")
[ "def", "GetBundleFrameworksFolderPath", "(", "self", ")", ":", "assert", "self", ".", "_IsBundle", "(", ")", "return", "os", ".", "path", ".", "join", "(", "self", ".", "GetBundleContentsFolderPath", "(", ")", ",", "\"Frameworks\"", ")" ]
[ 342, 4 ]
[ 346, 77 ]
python
en
['en', 'en', 'en']
True
XcodeSettings.GetBundleSharedFrameworksFolderPath
(self)
Returns the qualified path to the bundle's frameworks folder. E.g, Chromium.app/Contents/SharedFrameworks. Only valid for bundles.
Returns the qualified path to the bundle's frameworks folder. E.g, Chromium.app/Contents/SharedFrameworks. Only valid for bundles.
def GetBundleSharedFrameworksFolderPath(self): """Returns the qualified path to the bundle's frameworks folder. E.g, Chromium.app/Contents/SharedFrameworks. Only valid for bundles.""" assert self._IsBundle() return os.path.join(self.GetBundleContentsFolderPath(), "SharedFrameworks")
[ "def", "GetBundleSharedFrameworksFolderPath", "(", "self", ")", ":", "assert", "self", ".", "_IsBundle", "(", ")", "return", "os", ".", "path", ".", "join", "(", "self", ".", "GetBundleContentsFolderPath", "(", ")", ",", "\"SharedFrameworks\"", ")" ]
[ 348, 4 ]
[ 352, 83 ]
python
en
['en', 'en', 'en']
True
XcodeSettings.GetBundleSharedSupportFolderPath
(self)
Returns the qualified path to the bundle's shared support folder. E.g, Chromium.app/Contents/SharedSupport. Only valid for bundles.
Returns the qualified path to the bundle's shared support folder. E.g, Chromium.app/Contents/SharedSupport. Only valid for bundles.
def GetBundleSharedSupportFolderPath(self): """Returns the qualified path to the bundle's shared support folder. E.g, Chromium.app/Contents/SharedSupport. Only valid for bundles.""" assert self._IsBundle() if self.spec["type"] == "shared_library": return self.GetBundleResourceFol...
[ "def", "GetBundleSharedSupportFolderPath", "(", "self", ")", ":", "assert", "self", ".", "_IsBundle", "(", ")", "if", "self", ".", "spec", "[", "\"type\"", "]", "==", "\"shared_library\"", ":", "return", "self", ".", "GetBundleResourceFolder", "(", ")", "else"...
[ 354, 4 ]
[ 361, 84 ]
python
en
['en', 'en', 'en']
True
XcodeSettings.GetBundlePlugInsFolderPath
(self)
Returns the qualified path to the bundle's plugins folder. E.g, Chromium.app/Contents/PlugIns. Only valid for bundles.
Returns the qualified path to the bundle's plugins folder. E.g, Chromium.app/Contents/PlugIns. Only valid for bundles.
def GetBundlePlugInsFolderPath(self): """Returns the qualified path to the bundle's plugins folder. E.g, Chromium.app/Contents/PlugIns. Only valid for bundles.""" assert self._IsBundle() return os.path.join(self.GetBundleContentsFolderPath(), "PlugIns")
[ "def", "GetBundlePlugInsFolderPath", "(", "self", ")", ":", "assert", "self", ".", "_IsBundle", "(", ")", "return", "os", ".", "path", ".", "join", "(", "self", ".", "GetBundleContentsFolderPath", "(", ")", ",", "\"PlugIns\"", ")" ]
[ 363, 4 ]
[ 367, 74 ]
python
en
['en', 'en', 'en']
True
XcodeSettings.GetBundleXPCServicesFolderPath
(self)
Returns the qualified path to the bundle's XPC services folder. E.g, Chromium.app/Contents/XPCServices. Only valid for bundles.
Returns the qualified path to the bundle's XPC services folder. E.g, Chromium.app/Contents/XPCServices. Only valid for bundles.
def GetBundleXPCServicesFolderPath(self): """Returns the qualified path to the bundle's XPC services folder. E.g, Chromium.app/Contents/XPCServices. Only valid for bundles.""" assert self._IsBundle() return os.path.join(self.GetBundleContentsFolderPath(), "XPCServices")
[ "def", "GetBundleXPCServicesFolderPath", "(", "self", ")", ":", "assert", "self", ".", "_IsBundle", "(", ")", "return", "os", ".", "path", ".", "join", "(", "self", ".", "GetBundleContentsFolderPath", "(", ")", ",", "\"XPCServices\"", ")" ]
[ 369, 4 ]
[ 373, 78 ]
python
en
['en', 'en', 'en']
True
XcodeSettings.GetBundlePlistPath
(self)
Returns the qualified path to the bundle's plist file. E.g. Chromium.app/Contents/Info.plist. Only valid for bundles.
Returns the qualified path to the bundle's plist file. E.g. Chromium.app/Contents/Info.plist. Only valid for bundles.
def GetBundlePlistPath(self): """Returns the qualified path to the bundle's plist file. E.g. Chromium.app/Contents/Info.plist. Only valid for bundles.""" assert self._IsBundle() if ( self.spec["type"] in ("executable", "loadable_module") or self.IsIosFramework() ...
[ "def", "GetBundlePlistPath", "(", "self", ")", ":", "assert", "self", ".", "_IsBundle", "(", ")", "if", "(", "self", ".", "spec", "[", "\"type\"", "]", "in", "(", "\"executable\"", ",", "\"loadable_module\"", ")", "or", "self", ".", "IsIosFramework", "(", ...
[ 375, 4 ]
[ 387, 13 ]
python
en
['en', 'en', 'en']
True
XcodeSettings.GetProductType
(self)
Returns the PRODUCT_TYPE of this target.
Returns the PRODUCT_TYPE of this target.
def GetProductType(self): """Returns the PRODUCT_TYPE of this target.""" if self._IsIosAppExtension(): assert self._IsBundle(), ( "ios_app_extension flag requires mac_bundle " "(target %s)" % self.spec["target_name"] ) return "com.apple...
[ "def", "GetProductType", "(", "self", ")", ":", "if", "self", ".", "_IsIosAppExtension", "(", ")", ":", "assert", "self", ".", "_IsBundle", "(", ")", ",", "(", "\"ios_app_extension flag requires mac_bundle \"", "\"(target %s)\"", "%", "self", ".", "spec", "[", ...
[ 389, 4 ]
[ 427, 32 ]
python
en
['en', 'en', 'en']
True
XcodeSettings.GetMachOType
(self)
Returns the MACH_O_TYPE of this target.
Returns the MACH_O_TYPE of this target.
def GetMachOType(self): """Returns the MACH_O_TYPE of this target.""" # Weird, but matches Xcode. if not self._IsBundle() and self.spec["type"] == "executable": return "" return { "executable": "mh_execute", "static_library": "staticlib", "...
[ "def", "GetMachOType", "(", "self", ")", ":", "# Weird, but matches Xcode.", "if", "not", "self", ".", "_IsBundle", "(", ")", "and", "self", ".", "spec", "[", "\"type\"", "]", "==", "\"executable\"", ":", "return", "\"\"", "return", "{", "\"executable\"", ":...
[ 429, 4 ]
[ 439, 28 ]
python
en
['en', 'en', 'en']
True
XcodeSettings._GetBundleBinaryPath
(self)
Returns the name of the bundle binary of by this target. E.g. Chromium.app/Contents/MacOS/Chromium. Only valid for bundles.
Returns the name of the bundle binary of by this target. E.g. Chromium.app/Contents/MacOS/Chromium. Only valid for bundles.
def _GetBundleBinaryPath(self): """Returns the name of the bundle binary of by this target. E.g. Chromium.app/Contents/MacOS/Chromium. Only valid for bundles.""" assert self._IsBundle() return os.path.join( self.GetBundleExecutableFolderPath(), self.GetExecutableName() )
[ "def", "_GetBundleBinaryPath", "(", "self", ")", ":", "assert", "self", ".", "_IsBundle", "(", ")", "return", "os", ".", "path", ".", "join", "(", "self", ".", "GetBundleExecutableFolderPath", "(", ")", ",", "self", ".", "GetExecutableName", "(", ")", ")" ...
[ 441, 4 ]
[ 447, 9 ]
python
en
['en', 'en', 'en']
True
XcodeSettings._GetStandaloneBinaryPath
(self)
Returns the name of the non-bundle binary represented by this target. E.g. hello_world. Only valid for non-bundles.
Returns the name of the non-bundle binary represented by this target. E.g. hello_world. Only valid for non-bundles.
def _GetStandaloneBinaryPath(self): """Returns the name of the non-bundle binary represented by this target. E.g. hello_world. Only valid for non-bundles.""" assert not self._IsBundle() assert self.spec["type"] in ( "executable", "shared_library", "static_...
[ "def", "_GetStandaloneBinaryPath", "(", "self", ")", ":", "assert", "not", "self", ".", "_IsBundle", "(", ")", "assert", "self", ".", "spec", "[", "\"type\"", "]", "in", "(", "\"executable\"", ",", "\"shared_library\"", ",", "\"static_library\"", ",", "\"loada...
[ 472, 4 ]
[ 493, 50 ]
python
en
['en', 'en', 'en']
True
XcodeSettings.GetExecutableName
(self)
Returns the executable name of the bundle represented by this target. E.g. Chromium.
Returns the executable name of the bundle represented by this target. E.g. Chromium.
def GetExecutableName(self): """Returns the executable name of the bundle represented by this target. E.g. Chromium.""" if self._IsBundle(): return self.spec.get("product_name", self.spec["target_name"]) else: return self._GetStandaloneBinaryPath()
[ "def", "GetExecutableName", "(", "self", ")", ":", "if", "self", ".", "_IsBundle", "(", ")", ":", "return", "self", ".", "spec", ".", "get", "(", "\"product_name\"", ",", "self", ".", "spec", "[", "\"target_name\"", "]", ")", "else", ":", "return", "se...
[ 495, 4 ]
[ 501, 50 ]
python
en
['en', 'en', 'en']
True
XcodeSettings.GetExecutablePath
(self)
Returns the qualified path to the primary executable of the bundle represented by this target. E.g. Chromium.app/Contents/MacOS/Chromium.
Returns the qualified path to the primary executable of the bundle represented by this target. E.g. Chromium.app/Contents/MacOS/Chromium.
def GetExecutablePath(self): """Returns the qualified path to the primary executable of the bundle represented by this target. E.g. Chromium.app/Contents/MacOS/Chromium.""" if self._IsBundle(): return self._GetBundleBinaryPath() else: return self._GetStandaloneBinaryP...
[ "def", "GetExecutablePath", "(", "self", ")", ":", "if", "self", ".", "_IsBundle", "(", ")", ":", "return", "self", ".", "_GetBundleBinaryPath", "(", ")", "else", ":", "return", "self", ".", "_GetStandaloneBinaryPath", "(", ")" ]
[ 503, 4 ]
[ 509, 50 ]
python
en
['en', 'en', 'en']
True
XcodeSettings.GetActiveArchs
(self, configname)
Returns the architectures this target should be built for.
Returns the architectures this target should be built for.
def GetActiveArchs(self, configname): """Returns the architectures this target should be built for.""" config_settings = self.xcode_settings[configname] xcode_archs_default = GetXcodeArchsDefault() return xcode_archs_default.ActiveArchs( config_settings.get("ARCHS"), ...
[ "def", "GetActiveArchs", "(", "self", ",", "configname", ")", ":", "config_settings", "=", "self", ".", "xcode_settings", "[", "configname", "]", "xcode_archs_default", "=", "GetXcodeArchsDefault", "(", ")", "return", "xcode_archs_default", ".", "ActiveArchs", "(", ...
[ 511, 4 ]
[ 519, 9 ]
python
en
['en', 'en', 'en']
True
XcodeSettings.GetCflags
(self, configname, arch=None)
Returns flags that need to be added to .c, .cc, .m, and .mm compilations.
Returns flags that need to be added to .c, .cc, .m, and .mm compilations.
def GetCflags(self, configname, arch=None): """Returns flags that need to be added to .c, .cc, .m, and .mm compilations.""" # This functions (and the similar ones below) do not offer complete # emulation of all xcode_settings keys. They're implemented on demand. self.configname = co...
[ "def", "GetCflags", "(", "self", ",", "configname", ",", "arch", "=", "None", ")", ":", "# This functions (and the similar ones below) do not offer complete", "# emulation of all xcode_settings keys. They're implemented on demand.", "self", ".", "configname", "=", "configname", ...
[ 573, 4 ]
[ 696, 21 ]
python
en
['en', 'en', 'en']
True
XcodeSettings.GetCflagsC
(self, configname)
Returns flags that need to be added to .c, and .m compilations.
Returns flags that need to be added to .c, and .m compilations.
def GetCflagsC(self, configname): """Returns flags that need to be added to .c, and .m compilations.""" self.configname = configname cflags_c = [] if self._Settings().get("GCC_C_LANGUAGE_STANDARD", "") == "ansi": cflags_c.append("-ansi") else: self._Append...
[ "def", "GetCflagsC", "(", "self", ",", "configname", ")", ":", "self", ".", "configname", "=", "configname", "cflags_c", "=", "[", "]", "if", "self", ".", "_Settings", "(", ")", ".", "get", "(", "\"GCC_C_LANGUAGE_STANDARD\"", ",", "\"\"", ")", "==", "\"a...
[ 698, 4 ]
[ 708, 23 ]
python
en
['en', 'en', 'en']
True
XcodeSettings.GetCflagsCC
(self, configname)
Returns flags that need to be added to .cc, and .mm compilations.
Returns flags that need to be added to .cc, and .mm compilations.
def GetCflagsCC(self, configname): """Returns flags that need to be added to .cc, and .mm compilations.""" self.configname = configname cflags_cc = [] clang_cxx_language_standard = self._Settings().get( "CLANG_CXX_LANGUAGE_STANDARD" ) # Note: Don't make c++0x...
[ "def", "GetCflagsCC", "(", "self", ",", "configname", ")", ":", "self", ".", "configname", "=", "configname", "cflags_cc", "=", "[", "]", "clang_cxx_language_standard", "=", "self", ".", "_Settings", "(", ")", ".", "get", "(", "\"CLANG_CXX_LANGUAGE_STANDARD\"", ...
[ 710, 4 ]
[ 750, 24 ]
python
en
['en', 'en', 'en']
True
XcodeSettings.GetCflagsObjC
(self, configname)
Returns flags that need to be added to .m compilations.
Returns flags that need to be added to .m compilations.
def GetCflagsObjC(self, configname): """Returns flags that need to be added to .m compilations.""" self.configname = configname cflags_objc = [] self._AddObjectiveCGarbageCollectionFlags(cflags_objc) self._AddObjectiveCARCFlags(cflags_objc) self._AddObjectiveCMissingPrope...
[ "def", "GetCflagsObjC", "(", "self", ",", "configname", ")", ":", "self", ".", "configname", "=", "configname", "cflags_objc", "=", "[", "]", "self", ".", "_AddObjectiveCGarbageCollectionFlags", "(", "cflags_objc", ")", "self", ".", "_AddObjectiveCARCFlags", "(", ...
[ 769, 4 ]
[ 777, 26 ]
python
en
['en', 'en', 'en']
True
XcodeSettings.GetCflagsObjCC
(self, configname)
Returns flags that need to be added to .mm compilations.
Returns flags that need to be added to .mm compilations.
def GetCflagsObjCC(self, configname): """Returns flags that need to be added to .mm compilations.""" self.configname = configname cflags_objcc = [] self._AddObjectiveCGarbageCollectionFlags(cflags_objcc) self._AddObjectiveCARCFlags(cflags_objcc) self._AddObjectiveCMissing...
[ "def", "GetCflagsObjCC", "(", "self", ",", "configname", ")", ":", "self", ".", "configname", "=", "configname", "cflags_objcc", "=", "[", "]", "self", ".", "_AddObjectiveCGarbageCollectionFlags", "(", "cflags_objcc", ")", "self", ".", "_AddObjectiveCARCFlags", "(...
[ 779, 4 ]
[ 789, 27 ]
python
en
['en', 'en', 'en']
True
XcodeSettings.GetInstallNameBase
(self)
Return DYLIB_INSTALL_NAME_BASE for this target.
Return DYLIB_INSTALL_NAME_BASE for this target.
def GetInstallNameBase(self): """Return DYLIB_INSTALL_NAME_BASE for this target.""" # Xcode sets this for shared_libraries, and for nonbundled loadable_modules. if self.spec["type"] != "shared_library" and ( self.spec["type"] != "loadable_module" or self._IsBundle() ): ...
[ "def", "GetInstallNameBase", "(", "self", ")", ":", "# Xcode sets this for shared_libraries, and for nonbundled loadable_modules.", "if", "self", ".", "spec", "[", "\"type\"", "]", "!=", "\"shared_library\"", "and", "(", "self", ".", "spec", "[", "\"type\"", "]", "!="...
[ 791, 4 ]
[ 802, 27 ]
python
en
['en', 'en', 'en']
True
XcodeSettings._StandardizePath
(self, path)
Do :standardizepath processing for path.
Do :standardizepath processing for path.
def _StandardizePath(self, path): """Do :standardizepath processing for path.""" # I'm not quite sure what :standardizepath does. Just call normpath(), # but don't let @executable_path/../foo collapse to foo. if "/" in path: prefix, rest = "", path if path.startsw...
[ "def", "_StandardizePath", "(", "self", ",", "path", ")", ":", "# I'm not quite sure what :standardizepath does. Just call normpath(),", "# but don't let @executable_path/../foo collapse to foo.", "if", "\"/\"", "in", "path", ":", "prefix", ",", "rest", "=", "\"\"", ",", "p...
[ 804, 4 ]
[ 814, 19 ]
python
en
['en', 'en', 'en']
True
XcodeSettings.GetInstallName
(self)
Return LD_DYLIB_INSTALL_NAME for this target.
Return LD_DYLIB_INSTALL_NAME for this target.
def GetInstallName(self): """Return LD_DYLIB_INSTALL_NAME for this target.""" # Xcode sets this for shared_libraries, and for nonbundled loadable_modules. if self.spec["type"] != "shared_library" and ( self.spec["type"] != "loadable_module" or self._IsBundle() ): ...
[ "def", "GetInstallName", "(", "self", ")", ":", "# Xcode sets this for shared_libraries, and for nonbundled loadable_modules.", "if", "self", ".", "spec", "[", "\"type\"", "]", "!=", "\"shared_library\"", "and", "(", "self", ".", "spec", "[", "\"type\"", "]", "!=", ...
[ 816, 4 ]
[ 863, 27 ]
python
en
['en', 'en', 'en']
True
XcodeSettings._MapLinkerFlagFilename
(self, ldflag, gyp_to_build_path)
Checks if ldflag contains a filename and if so remaps it from gyp-directory-relative to build-directory-relative.
Checks if ldflag contains a filename and if so remaps it from gyp-directory-relative to build-directory-relative.
def _MapLinkerFlagFilename(self, ldflag, gyp_to_build_path): """Checks if ldflag contains a filename and if so remaps it from gyp-directory-relative to build-directory-relative.""" # This list is expanded on demand. # They get matched as: # -exported_symbols_list file # -...
[ "def", "_MapLinkerFlagFilename", "(", "self", ",", "ldflag", ",", "gyp_to_build_path", ")", ":", "# This list is expanded on demand.", "# They get matched as:", "# -exported_symbols_list file", "# -Wl,exported_symbols_list file", "# -Wl,exported_symbols_list,file", "LINKER_FILE",...
[ 865, 4 ]
[ 894, 21 ]
python
en
['en', 'en', 'en']
True
XcodeSettings.GetLdflags
(self, configname, product_dir, gyp_to_build_path, arch=None)
Returns flags that need to be passed to the linker. Args: configname: The name of the configuration to get ld flags for. product_dir: The directory where products such static and dynamic libraries are placed. This is added to the library search path. gyp_to_build_path: A functio...
Returns flags that need to be passed to the linker.
def GetLdflags(self, configname, product_dir, gyp_to_build_path, arch=None): """Returns flags that need to be passed to the linker. Args: configname: The name of the configuration to get ld flags for. product_dir: The directory where products such static and dynamic libraries ar...
[ "def", "GetLdflags", "(", "self", ",", "configname", ",", "product_dir", ",", "gyp_to_build_path", ",", "arch", "=", "None", ")", ":", "self", ".", "configname", "=", "configname", "ldflags", "=", "[", "]", "# The xcode build is relative to a gyp file's directory, a...
[ 896, 4 ]
[ 996, 22 ]
python
en
['en', 'en', 'en']
True
XcodeSettings.GetLibtoolflags
(self, configname)
Returns flags that need to be passed to the static linker. Args: configname: The name of the configuration to get ld flags for.
Returns flags that need to be passed to the static linker.
def GetLibtoolflags(self, configname): """Returns flags that need to be passed to the static linker. Args: configname: The name of the configuration to get ld flags for. """ self.configname = configname libtoolflags = [] for libtoolflag in self._Settings().get("OTHER_LD...
[ "def", "GetLibtoolflags", "(", "self", ",", "configname", ")", ":", "self", ".", "configname", "=", "configname", "libtoolflags", "=", "[", "]", "for", "libtoolflag", "in", "self", ".", "_Settings", "(", ")", ".", "get", "(", "\"OTHER_LDFLAGS\"", ",", "[",...
[ 998, 4 ]
[ 1012, 27 ]
python
en
['en', 'en', 'en']
True
XcodeSettings.GetPerTargetSettings
(self)
Gets a list of all the per-target settings. This will only fetch keys whose values are the same across all configurations.
Gets a list of all the per-target settings. This will only fetch keys whose values are the same across all configurations.
def GetPerTargetSettings(self): """Gets a list of all the per-target settings. This will only fetch keys whose values are the same across all configurations.""" first_pass = True result = {} for configname in sorted(self.xcode_settings.keys()): if first_pass: ...
[ "def", "GetPerTargetSettings", "(", "self", ")", ":", "first_pass", "=", "True", "result", "=", "{", "}", "for", "configname", "in", "sorted", "(", "self", ".", "xcode_settings", ".", "keys", "(", ")", ")", ":", "if", "first_pass", ":", "result", "=", ...
[ 1014, 4 ]
[ 1029, 21 ]
python
en
['en', 'en', 'en']
True
XcodeSettings.GetPerTargetSetting
(self, setting, default=None)
Tries to get xcode_settings.setting from spec. Assumes that the setting has the same value in all configurations and throws otherwise.
Tries to get xcode_settings.setting from spec. Assumes that the setting has the same value in all configurations and throws otherwise.
def GetPerTargetSetting(self, setting, default=None): """Tries to get xcode_settings.setting from spec. Assumes that the setting has the same value in all configurations and throws otherwise.""" is_first_pass = True result = None for configname in sorted(self.xcode_settings.keys()...
[ "def", "GetPerTargetSetting", "(", "self", ",", "setting", ",", "default", "=", "None", ")", ":", "is_first_pass", "=", "True", "result", "=", "None", "for", "configname", "in", "sorted", "(", "self", ".", "xcode_settings", ".", "keys", "(", ")", ")", ":...
[ 1037, 4 ]
[ 1053, 21 ]
python
en
['en', 'en', 'en']
True
XcodeSettings._GetStripPostbuilds
(self, configname, output_binary, quiet)
Returns a list of shell commands that contain the shell commands necessary to strip this target's binary. These should be run as postbuilds before the actual postbuilds run.
Returns a list of shell commands that contain the shell commands necessary to strip this target's binary. These should be run as postbuilds before the actual postbuilds run.
def _GetStripPostbuilds(self, configname, output_binary, quiet): """Returns a list of shell commands that contain the shell commands necessary to strip this target's binary. These should be run as postbuilds before the actual postbuilds run.""" self.configname = configname result = [] ...
[ "def", "_GetStripPostbuilds", "(", "self", ",", "configname", ",", "output_binary", ",", "quiet", ")", ":", "self", ".", "configname", "=", "configname", "result", "=", "[", "]", "if", "self", ".", "_Test", "(", "\"DEPLOYMENT_POSTPROCESSING\"", ",", "\"YES\"",...
[ 1055, 4 ]
[ 1088, 21 ]
python
en
['en', 'en', 'en']
True
XcodeSettings._GetDebugInfoPostbuilds
(self, configname, output, output_binary, quiet)
Returns a list of shell commands that contain the shell commands necessary to massage this target's debug information. These should be run as postbuilds before the actual postbuilds run.
Returns a list of shell commands that contain the shell commands necessary to massage this target's debug information. These should be run as postbuilds before the actual postbuilds run.
def _GetDebugInfoPostbuilds(self, configname, output, output_binary, quiet): """Returns a list of shell commands that contain the shell commands necessary to massage this target's debug information. These should be run as postbuilds before the actual postbuilds run.""" self.configname = configna...
[ "def", "_GetDebugInfoPostbuilds", "(", "self", ",", "configname", ",", "output", ",", "output_binary", ",", "quiet", ")", ":", "self", ".", "configname", "=", "configname", "# For static libraries, no dSYMs are created.", "result", "=", "[", "]", "if", "(", "self"...
[ 1090, 4 ]
[ 1110, 21 ]
python
en
['en', 'en', 'en']
True
XcodeSettings._GetTargetPostbuilds
(self, configname, output, output_binary, quiet=False)
Returns a list of shell commands that contain the shell commands to run as postbuilds for this target, before the actual postbuilds.
Returns a list of shell commands that contain the shell commands to run as postbuilds for this target, before the actual postbuilds.
def _GetTargetPostbuilds(self, configname, output, output_binary, quiet=False): """Returns a list of shell commands that contain the shell commands to run as postbuilds for this target, before the actual postbuilds.""" # dSYMs need to build before stripping happens. return self._GetDebugInfo...
[ "def", "_GetTargetPostbuilds", "(", "self", ",", "configname", ",", "output", ",", "output_binary", ",", "quiet", "=", "False", ")", ":", "# dSYMs need to build before stripping happens.", "return", "self", ".", "_GetDebugInfoPostbuilds", "(", "configname", ",", "outp...
[ 1112, 4 ]
[ 1118, 70 ]
python
en
['en', 'en', 'en']
True
XcodeSettings._GetIOSPostbuilds
(self, configname, output_binary)
Return a shell command to codesign the iOS output binary so it can be deployed to a device. This should be run as the very last step of the build.
Return a shell command to codesign the iOS output binary so it can be deployed to a device. This should be run as the very last step of the build.
def _GetIOSPostbuilds(self, configname, output_binary): """Return a shell command to codesign the iOS output binary so it can be deployed to a device. This should be run as the very last step of the build.""" if not ( self.isIOS and (self.spec["type"] == "executable" or ...
[ "def", "_GetIOSPostbuilds", "(", "self", ",", "configname", ",", "output_binary", ")", ":", "if", "not", "(", "self", ".", "isIOS", "and", "(", "self", ".", "spec", "[", "\"type\"", "]", "==", "\"executable\"", "or", "self", ".", "_IsXCTest", "(", ")", ...
[ 1120, 4 ]
[ 1213, 25 ]
python
en
['en', 'en', 'en']
True
XcodeSettings.AddImplicitPostbuilds
( self, configname, output, output_binary, postbuilds=[], quiet=False )
Returns a list of shell commands that should run before and after |postbuilds|.
Returns a list of shell commands that should run before and after |postbuilds|.
def AddImplicitPostbuilds( self, configname, output, output_binary, postbuilds=[], quiet=False ): """Returns a list of shell commands that should run before and after |postbuilds|.""" assert output_binary is not None pre = self._GetTargetPostbuilds(configname, output, output_bina...
[ "def", "AddImplicitPostbuilds", "(", "self", ",", "configname", ",", "output", ",", "output_binary", ",", "postbuilds", "=", "[", "]", ",", "quiet", "=", "False", ")", ":", "assert", "output_binary", "is", "not", "None", "pre", "=", "self", ".", "_GetTarge...
[ 1233, 4 ]
[ 1241, 38 ]
python
en
['en', 'en', 'en']
True
XcodeSettings.AdjustLibraries
(self, libraries, config_name=None)
Transforms entries like 'Cocoa.framework' in libraries into entries like '-framework Cocoa', 'libcrypto.dylib' into '-lcrypto', etc.
Transforms entries like 'Cocoa.framework' in libraries into entries like '-framework Cocoa', 'libcrypto.dylib' into '-lcrypto', etc.
def AdjustLibraries(self, libraries, config_name=None): """Transforms entries like 'Cocoa.framework' in libraries into entries like '-framework Cocoa', 'libcrypto.dylib' into '-lcrypto', etc. """ libraries = [self._AdjustLibrary(library, config_name) for library in libraries] return libr...
[ "def", "AdjustLibraries", "(", "self", ",", "libraries", ",", "config_name", "=", "None", ")", ":", "libraries", "=", "[", "self", ".", "_AdjustLibrary", "(", "library", ",", "config_name", ")", "for", "library", "in", "libraries", "]", "return", "libraries"...
[ 1274, 4 ]
[ 1279, 24 ]
python
en
['es', 'en', 'en']
True
XcodeSettings.GetExtraPlistItems
(self, configname=None)
Returns a dictionary with extra items to insert into Info.plist.
Returns a dictionary with extra items to insert into Info.plist.
def GetExtraPlistItems(self, configname=None): """Returns a dictionary with extra items to insert into Info.plist.""" if configname not in XcodeSettings._plist_cache: cache = {} cache["BuildMachineOSBuild"] = self._BuildMachineOSBuild() xcode_version, xcode_build = X...
[ "def", "GetExtraPlistItems", "(", "self", ",", "configname", "=", "None", ")", ":", "if", "configname", "not", "in", "XcodeSettings", ".", "_plist_cache", ":", "cache", "=", "{", "}", "cache", "[", "\"BuildMachineOSBuild\"", "]", "=", "self", ".", "_BuildMac...
[ 1288, 4 ]
[ 1337, 20 ]
python
en
['en', 'en', 'en']
True
XcodeSettings._DefaultSdkRoot
(self)
Returns the default SDKROOT to use. Prior to version 5.0.0, if SDKROOT was not explicitly set in the Xcode project, then the environment variable was empty. Starting with this version, Xcode uses the name of the newest SDK installed.
Returns the default SDKROOT to use.
def _DefaultSdkRoot(self): """Returns the default SDKROOT to use. Prior to version 5.0.0, if SDKROOT was not explicitly set in the Xcode project, then the environment variable was empty. Starting with this version, Xcode uses the name of the newest SDK installed. """ xcode_version, _ = ...
[ "def", "_DefaultSdkRoot", "(", "self", ")", ":", "xcode_version", ",", "_", "=", "XcodeVersion", "(", ")", "if", "xcode_version", "<", "\"0500\"", ":", "return", "\"\"", "default_sdk_path", "=", "self", ".", "_XcodeSdkPath", "(", "\"\"", ")", "default_sdk_root...
[ 1339, 4 ]
[ 1365, 17 ]
python
en
['en', 'en', 'en']
True
MacPrefixHeader.__init__
( self, xcode_settings, gyp_path_to_build_path, gyp_path_to_build_output )
If xcode_settings is None, all methods on this class are no-ops. Args: gyp_path_to_build_path: A function that takes a gyp-relative path, and returns a path relative to the build directory. gyp_path_to_build_output: A function that takes a gyp-relative path and a language co...
If xcode_settings is None, all methods on this class are no-ops.
def __init__( self, xcode_settings, gyp_path_to_build_path, gyp_path_to_build_output ): """If xcode_settings is None, all methods on this class are no-ops. Args: gyp_path_to_build_path: A function that takes a gyp-relative path, and returns a path relative to the build direc...
[ "def", "__init__", "(", "self", ",", "xcode_settings", ",", "gyp_path_to_build_path", ",", "gyp_path_to_build_output", ")", ":", "# This doesn't support per-configuration prefix headers. Good enough", "# for now.", "self", ".", "header", "=", "None", "self", ".", "compile_h...
[ 1391, 4 ]
[ 1423, 61 ]
python
en
['en', 'en', 'en']
True
MacPrefixHeader.GetInclude
(self, lang, arch=None)
Gets the cflags to include the prefix header for language |lang|.
Gets the cflags to include the prefix header for language |lang|.
def GetInclude(self, lang, arch=None): """Gets the cflags to include the prefix header for language |lang|.""" if self.compile_headers and lang in self.compiled_headers: return "-include %s" % self._CompiledHeader(lang, arch) elif self.header: return "-include %s" % self....
[ "def", "GetInclude", "(", "self", ",", "lang", ",", "arch", "=", "None", ")", ":", "if", "self", ".", "compile_headers", "and", "lang", "in", "self", ".", "compiled_headers", ":", "return", "\"-include %s\"", "%", "self", ".", "_CompiledHeader", "(", "lang...
[ 1432, 4 ]
[ 1439, 21 ]
python
en
['en', 'en', 'en']
True
MacPrefixHeader._Gch
(self, lang, arch)
Returns the actual file name of the prefix header for language |lang|.
Returns the actual file name of the prefix header for language |lang|.
def _Gch(self, lang, arch): """Returns the actual file name of the prefix header for language |lang|.""" assert self.compile_headers return self._CompiledHeader(lang, arch) + ".gch"
[ "def", "_Gch", "(", "self", ",", "lang", ",", "arch", ")", ":", "assert", "self", ".", "compile_headers", "return", "self", ".", "_CompiledHeader", "(", "lang", ",", "arch", ")", "+", "\".gch\"" ]
[ 1441, 4 ]
[ 1444, 56 ]
python
en
['en', 'en', 'en']
True
MacPrefixHeader.GetObjDependencies
(self, sources, objs, arch=None)
Given a list of source files and the corresponding object files, returns a list of (source, object, gch) tuples, where |gch| is the build-directory relative path to the gch file each object file depends on. |compilable[i]| has to be the source file belonging to |objs[i]|.
Given a list of source files and the corresponding object files, returns a list of (source, object, gch) tuples, where |gch| is the build-directory relative path to the gch file each object file depends on. |compilable[i]| has to be the source file belonging to |objs[i]|.
def GetObjDependencies(self, sources, objs, arch=None): """Given a list of source files and the corresponding object files, returns a list of (source, object, gch) tuples, where |gch| is the build-directory relative path to the gch file each object file depends on. |compilable[i]| has to be the sou...
[ "def", "GetObjDependencies", "(", "self", ",", "sources", ",", "objs", ",", "arch", "=", "None", ")", ":", "if", "not", "self", ".", "header", "or", "not", "self", ".", "compile_headers", ":", "return", "[", "]", "result", "=", "[", "]", "for", "sour...
[ 1446, 4 ]
[ 1467, 21 ]
python
en
['en', 'en', 'en']
True
MacPrefixHeader.GetPchBuildCommands
(self, arch=None)
Returns [(path_to_gch, language_flag, language, header)]. |path_to_gch| and |header| are relative to the build directory.
Returns [(path_to_gch, language_flag, language, header)]. |path_to_gch| and |header| are relative to the build directory.
def GetPchBuildCommands(self, arch=None): """Returns [(path_to_gch, language_flag, language, header)]. |path_to_gch| and |header| are relative to the build directory. """ if not self.header or not self.compile_headers: return [] return [ (self._Gch("c", arch), "-x...
[ "def", "GetPchBuildCommands", "(", "self", ",", "arch", "=", "None", ")", ":", "if", "not", "self", ".", "header", "or", "not", "self", ".", "compile_headers", ":", "return", "[", "]", "return", "[", "(", "self", ".", "_Gch", "(", "\"c\"", ",", "arch...
[ 1469, 4 ]
[ 1480, 9 ]
python
en
['en', 'jv', 'en']
True
register
(*models, **kwargs)
Registers the given model(s) classes and wrapped ModelAdmin class with admin site: @register(Author) class AuthorAdmin(admin.ModelAdmin): pass A kwarg of `site` can be passed as the admin site, otherwise the default admin site will be used.
Registers the given model(s) classes and wrapped ModelAdmin class with admin site:
def register(*models, **kwargs): """ Registers the given model(s) classes and wrapped ModelAdmin class with admin site: @register(Author) class AuthorAdmin(admin.ModelAdmin): pass A kwarg of `site` can be passed as the admin site, otherwise the default admin site will be used. ...
[ "def", "register", "(", "*", "models", ",", "*", "*", "kwargs", ")", ":", "from", "django", ".", "contrib", ".", "admin", "import", "ModelAdmin", "from", "django", ".", "contrib", ".", "admin", ".", "sites", "import", "site", ",", "AdminSite", "def", "...
[ 0, 0 ]
[ 30, 31 ]
python
en
['en', 'error', 'th']
False
rehash
(path, blocksize=1 << 20)
Return (encoded_digest, length) for path using hashlib.sha256()
Return (encoded_digest, length) for path using hashlib.sha256()
def rehash(path, blocksize=1 << 20): # type: (text_type, int) -> Tuple[str, str] """Return (encoded_digest, length) for path using hashlib.sha256()""" h, length = hash_file(path, blocksize) digest = 'sha256=' + urlsafe_b64encode( h.digest() ).decode('latin1').rstrip('=') # unicode/str py...
[ "def", "rehash", "(", "path", ",", "blocksize", "=", "1", "<<", "20", ")", ":", "# type: (text_type, int) -> Tuple[str, str]", "h", ",", "length", "=", "hash_file", "(", "path", ",", "blocksize", ")", "digest", "=", "'sha256='", "+", "urlsafe_b64encode", "(", ...
[ 88, 0 ]
[ 96, 32 ]
python
cy
['da', 'cy', 'en']
False
csv_io_kwargs
(mode)
Return keyword arguments to properly open a CSV file in the given mode.
Return keyword arguments to properly open a CSV file in the given mode.
def csv_io_kwargs(mode): # type: (str) -> Dict[str, Any] """Return keyword arguments to properly open a CSV file in the given mode. """ if PY2: return {'mode': '{}b'.format(mode)} else: return {'mode': mode, 'newline': '', 'encoding': 'utf-8'}
[ "def", "csv_io_kwargs", "(", "mode", ")", ":", "# type: (str) -> Dict[str, Any]", "if", "PY2", ":", "return", "{", "'mode'", ":", "'{}b'", ".", "format", "(", "mode", ")", "}", "else", ":", "return", "{", "'mode'", ":", "mode", ",", "'newline'", ":", "''...
[ 99, 0 ]
[ 107, 65 ]
python
en
['en', 'en', 'en']
True
fix_script
(path)
Replace #!python with #!/path/to/python Return True if file was changed.
Replace #!python with #!/path/to/python Return True if file was changed.
def fix_script(path): # type: (text_type) -> bool """Replace #!python with #!/path/to/python Return True if file was changed. """ # XXX RECORD hashes will need to be updated assert os.path.isfile(path) with open(path, 'rb') as script: firstline = script.readline() if not fir...
[ "def", "fix_script", "(", "path", ")", ":", "# type: (text_type) -> bool", "# XXX RECORD hashes will need to be updated", "assert", "os", ".", "path", ".", "isfile", "(", "path", ")", "with", "open", "(", "path", ",", "'rb'", ")", "as", "script", ":", "firstline...
[ 110, 0 ]
[ 128, 15 ]
python
en
['en', 'lt', 'en']
True
message_about_scripts_not_on_PATH
(scripts)
Determine if any scripts are not on PATH and format a warning. Returns a warning message if one or more scripts are not on PATH, otherwise None.
Determine if any scripts are not on PATH and format a warning. Returns a warning message if one or more scripts are not on PATH, otherwise None.
def message_about_scripts_not_on_PATH(scripts): # type: (Sequence[str]) -> Optional[str] """Determine if any scripts are not on PATH and format a warning. Returns a warning message if one or more scripts are not on PATH, otherwise None. """ if not scripts: return None # Group script...
[ "def", "message_about_scripts_not_on_PATH", "(", "scripts", ")", ":", "# type: (Sequence[str]) -> Optional[str]", "if", "not", "scripts", ":", "return", "None", "# Group scripts by the path they were installed in", "grouped_by_dir", "=", "collections", ".", "defaultdict", "(", ...
[ 161, 0 ]
[ 229, 31 ]
python
en
['en', 'en', 'en']
True
_normalized_outrows
(outrows)
Normalize the given rows of a RECORD file. Items in each row are converted into str. Rows are then sorted to make the value more predictable for tests. Each row is a 3-tuple (path, hash, size) and corresponds to a record of a RECORD file (see PEP 376 and PEP 427 for details). For the rows passed ...
Normalize the given rows of a RECORD file.
def _normalized_outrows(outrows): # type: (Iterable[InstalledCSVRow]) -> List[Tuple[str, str, str]] """Normalize the given rows of a RECORD file. Items in each row are converted into str. Rows are then sorted to make the value more predictable for tests. Each row is a 3-tuple (path, hash, size) an...
[ "def", "_normalized_outrows", "(", "outrows", ")", ":", "# type: (Iterable[InstalledCSVRow]) -> List[Tuple[str, str, str]]", "# Normally, there should only be one row per path, in which case the", "# second and third elements don't come into play when sorting.", "# However, in cases in the wild wh...
[ 232, 0 ]
[ 255, 5 ]
python
en
['en', 'en', 'en']
True
get_csv_rows_for_installed
( old_csv_rows, # type: List[List[str]] installed, # type: Dict[RecordPath, RecordPath] changed, # type: Set[RecordPath] generated, # type: List[str] lib_dir, # type: str )
:param installed: A map from archive RECORD path to installation RECORD path.
:param installed: A map from archive RECORD path to installation RECORD path.
def get_csv_rows_for_installed( old_csv_rows, # type: List[List[str]] installed, # type: Dict[RecordPath, RecordPath] changed, # type: Set[RecordPath] generated, # type: List[str] lib_dir, # type: str ): # type: (...) -> List[InstalledCSVRow] """ :param installed: A map from archive...
[ "def", "get_csv_rows_for_installed", "(", "old_csv_rows", ",", "# type: List[List[str]]", "installed", ",", "# type: Dict[RecordPath, RecordPath]", "changed", ",", "# type: Set[RecordPath]", "generated", ",", "# type: List[str]", "lib_dir", ",", "# type: str", ")", ":", "# ty...
[ 281, 0 ]
[ 311, 25 ]
python
en
['en', 'error', 'th']
False
get_console_script_specs
(console)
Given the mapping from entrypoint name to callable, return the relevant console script specs.
Given the mapping from entrypoint name to callable, return the relevant console script specs.
def get_console_script_specs(console): # type: (Dict[str, str]) -> List[str] """ Given the mapping from entrypoint name to callable, return the relevant console script specs. """ # Don't mutate caller's version console = console.copy() scripts_to_generate = [] # Special case pip an...
[ "def", "get_console_script_specs", "(", "console", ")", ":", "# type: (Dict[str, str]) -> List[str]", "# Don't mutate caller's version", "console", "=", "console", ".", "copy", "(", ")", "scripts_to_generate", "=", "[", "]", "# Special case pip and setuptools to generate versio...
[ 314, 0 ]
[ 397, 30 ]
python
en
['en', 'error', 'th']
False
_install_wheel
( name, # type: str wheel_zip, # type: ZipFile wheel_path, # type: str scheme, # type: Scheme pycompile=True, # type: bool warn_script_location=True, # type: bool direct_url=None, # type: Optional[DirectUrl] requested=False, # type: bool )
Install a wheel. :param name: Name of the project to install :param wheel_zip: open ZipFile for wheel being installed :param scheme: Distutils scheme dictating the install directories :param req_description: String used in place of the requirement, for logging :param pycompile: Whether to b...
Install a wheel.
def _install_wheel( name, # type: str wheel_zip, # type: ZipFile wheel_path, # type: str scheme, # type: Scheme pycompile=True, # type: bool warn_script_location=True, # type: bool direct_url=None, # type: Optional[DirectUrl] requested=False, # type: bool ): # type: (...) -> ...
[ "def", "_install_wheel", "(", "name", ",", "# type: str", "wheel_zip", ",", "# type: ZipFile", "wheel_path", ",", "# type: str", "scheme", ",", "# type: Scheme", "pycompile", "=", "True", ",", "# type: bool", "warn_script_location", "=", "True", ",", "# type: bool", ...
[ 485, 0 ]
[ 808, 51 ]
python
en
['en', 'cy', 'en']
True
compare_with_encrypted
(model_config, param_config)
Given a model_config from the database, assure that this is consistent with the config given in the notification_configuration parameter this requires handling of password fields
Given a model_config from the database, assure that this is consistent with the config given in the notification_configuration parameter this requires handling of password fields
def compare_with_encrypted(model_config, param_config): """Given a model_config from the database, assure that this is consistent with the config given in the notification_configuration parameter this requires handling of password fields """ for key, model_val in model_config.items(): param_...
[ "def", "compare_with_encrypted", "(", "model_config", ",", "param_config", ")", ":", "for", "key", ",", "model_val", "in", "model_config", ".", "items", "(", ")", ":", "param_val", "=", "param_config", ".", "get", "(", "key", ",", "'missing'", ")", "if", "...
[ 9, 0 ]
[ 20, 133 ]
python
en
['en', 'en', 'en']
True
test_build_notification_message_undefined
(run_module, admin_user, organization)
Job notification templates may encounter undefined values in the context when they are rendered. Make sure that accessing attributes or items of an undefined value returns another instance of Undefined, rather than raising an UndefinedError. This enables the use of expressions like "{{ job.created_by.first_...
Job notification templates may encounter undefined values in the context when they are rendered. Make sure that accessing attributes or items of an undefined value returns another instance of Undefined, rather than raising an UndefinedError. This enables the use of expressions like "{{ job.created_by.first_...
def test_build_notification_message_undefined(run_module, admin_user, organization): """Job notification templates may encounter undefined values in the context when they are rendered. Make sure that accessing attributes or items of an undefined value returns another instance of Undefined, rather than raisi...
[ "def", "test_build_notification_message_undefined", "(", "run_module", ",", "admin_user", ",", "organization", ")", ":", "job", "=", "Job", ".", "objects", ".", "create", "(", "name", "=", "'foobar'", ")", "nt_config", "=", "{", "'url'", ":", "'http://www.exampl...
[ 133, 0 ]
[ 157, 56 ]
python
en
['en', 'en', 'en']
True
get_module_constant
(module, symbol, default=-1, paths=None)
Find 'module' by searching 'paths', and extract 'symbol' Return 'None' if 'module' does not exist on 'paths', or it does not define 'symbol'. If the module defines 'symbol' as a constant, return the constant. Otherwise, return 'default'.
Find 'module' by searching 'paths', and extract 'symbol'
def get_module_constant(module, symbol, default=-1, paths=None): """Find 'module' by searching 'paths', and extract 'symbol' Return 'None' if 'module' does not exist on 'paths', or it does not define 'symbol'. If the module defines 'symbol' as a constant, return the constant. Otherwise, return 'defau...
[ "def", "get_module_constant", "(", "module", ",", "symbol", ",", "default", "=", "-", "1", ",", "paths", "=", "None", ")", ":", "try", ":", "f", ",", "path", ",", "(", "suffix", ",", "mode", ",", "kind", ")", "=", "info", "=", "find_module", "(", ...
[ 94, 0 ]
[ 120, 50 ]
python
en
['en', 'en', 'en']
True
extract_constant
(code, symbol, default=-1)
Extract the constant value of 'symbol' from 'code' If the name 'symbol' is bound to a constant value by the Python code object 'code', return that value. If 'symbol' is bound to an expression, return 'default'. Otherwise, return 'None'. Return value is based on the first assignment to 'symbol'. 'sy...
Extract the constant value of 'symbol' from 'code'
def extract_constant(code, symbol, default=-1): """Extract the constant value of 'symbol' from 'code' If the name 'symbol' is bound to a constant value by the Python code object 'code', return that value. If 'symbol' is bound to an expression, return 'default'. Otherwise, return 'None'. Return v...
[ "def", "extract_constant", "(", "code", ",", "symbol", ",", "default", "=", "-", "1", ")", ":", "if", "symbol", "not", "in", "code", ".", "co_names", ":", "# name's not there, can't possibly be an assignment", "return", "None", "name_idx", "=", "list", "(", "c...
[ 123, 0 ]
[ 156, 27 ]
python
en
['en', 'en', 'en']
True
_update_globals
()
Patch the globals to remove the objects not available on some platforms. XXX it'd be better to test assertions about bytecode instead.
Patch the globals to remove the objects not available on some platforms.
def _update_globals(): """ Patch the globals to remove the objects not available on some platforms. XXX it'd be better to test assertions about bytecode instead. """ if not sys.platform.startswith('java') and sys.platform != 'cli': return incompatible = 'extract_constant', 'get_module_...
[ "def", "_update_globals", "(", ")", ":", "if", "not", "sys", ".", "platform", ".", "startswith", "(", "'java'", ")", "and", "sys", ".", "platform", "!=", "'cli'", ":", "return", "incompatible", "=", "'extract_constant'", ",", "'get_module_constant'", "for", ...
[ 159, 0 ]
[ 171, 28 ]
python
en
['en', 'error', 'th']
False
Require.full_name
(self)
Return full package/distribution name, w/version
Return full package/distribution name, w/version
def full_name(self): """Return full package/distribution name, w/version""" if self.requested_version is not None: return '%s-%s' % (self.name, self.requested_version) return self.name
[ "def", "full_name", "(", "self", ")", ":", "if", "self", ".", "requested_version", "is", "not", "None", ":", "return", "'%s-%s'", "%", "(", "self", ".", "name", ",", "self", ".", "requested_version", ")", "return", "self", ".", "name" ]
[ 33, 4 ]
[ 37, 24 ]
python
en
['en', 'en', 'en']
True
Require.version_ok
(self, version)
Is 'version' sufficiently up-to-date?
Is 'version' sufficiently up-to-date?
def version_ok(self, version): """Is 'version' sufficiently up-to-date?""" return self.attribute is None or self.format is None or \ str(version) != "unknown" and version >= self.requested_version
[ "def", "version_ok", "(", "self", ",", "version", ")", ":", "return", "self", ".", "attribute", "is", "None", "or", "self", ".", "format", "is", "None", "or", "str", "(", "version", ")", "!=", "\"unknown\"", "and", "version", ">=", "self", ".", "reques...
[ 39, 4 ]
[ 42, 75 ]
python
en
['en', 'en', 'en']
True
Require.get_version
(self, paths=None, default="unknown")
Get version number of installed module, 'None', or 'default' Search 'paths' for module. If not found, return 'None'. If found, return the extracted version attribute, or 'default' if no version attribute was specified, or the value cannot be determined without importing the module. T...
Get version number of installed module, 'None', or 'default'
def get_version(self, paths=None, default="unknown"): """Get version number of installed module, 'None', or 'default' Search 'paths' for module. If not found, return 'None'. If found, return the extracted version attribute, or 'default' if no version attribute was specified, or the va...
[ "def", "get_version", "(", "self", ",", "paths", "=", "None", ",", "default", "=", "\"unknown\"", ")", ":", "if", "self", ".", "attribute", "is", "None", ":", "try", ":", "f", ",", "p", ",", "i", "=", "find_module", "(", "self", ".", "module", ",",...
[ 44, 4 ]
[ 69, 16 ]
python
en
['en', 'en', 'en']
True
Require.is_present
(self, paths=None)
Return true if dependency is present on 'paths
Return true if dependency is present on 'paths
def is_present(self, paths=None): """Return true if dependency is present on 'paths'""" return self.get_version(paths) is not None
[ "def", "is_present", "(", "self", ",", "paths", "=", "None", ")", ":", "return", "self", ".", "get_version", "(", "paths", ")", "is", "not", "None" ]
[ 71, 4 ]
[ 73, 50 ]
python
en
['en', 'af', 'en']
True
Require.is_current
(self, paths=None)
Return true if dependency is present and up-to-date on 'paths
Return true if dependency is present and up-to-date on 'paths
def is_current(self, paths=None): """Return true if dependency is present and up-to-date on 'paths'""" version = self.get_version(paths) if version is None: return False return self.version_ok(version)
[ "def", "is_current", "(", "self", ",", "paths", "=", "None", ")", ":", "version", "=", "self", ".", "get_version", "(", "paths", ")", "if", "version", "is", "None", ":", "return", "False", "return", "self", ".", "version_ok", "(", "version", ")" ]
[ 75, 4 ]
[ 80, 39 ]
python
en
['en', 'en', 'en']
True
test_implicit_role_field_parents
()
This assures that every ImplicitRoleField only references parents which are relationships that actually exist
This assures that every ImplicitRoleField only references parents which are relationships that actually exist
def test_implicit_role_field_parents(): """This assures that every ImplicitRoleField only references parents which are relationships that actually exist """ app_models = apps.get_app_config('main').get_models() for cls in app_models: for field in cls._meta.get_fields(): if not is...
[ "def", "test_implicit_role_field_parents", "(", ")", ":", "app_models", "=", "apps", ".", "get_app_config", "(", "'main'", ")", ".", "get_models", "(", ")", "for", "cls", "in", "app_models", ":", "for", "field", "in", "cls", ".", "_meta", ".", "get_fields", ...
[ 205, 0 ]
[ 254, 66 ]
python
en
['en', 'en', 'en']
True
get_display_profile
(handle=None)
(experimental) Fetches the profile for the current display device. :returns: ``None`` if the profile is not known.
(experimental) Fetches the profile for the current display device.
def get_display_profile(handle=None): """ (experimental) Fetches the profile for the current display device. :returns: ``None`` if the profile is not known. """ if sys.platform != "win32": return None from PIL import ImageWin if isinstance(handle, ImageWin.HDC): profile =...
[ "def", "get_display_profile", "(", "handle", "=", "None", ")", ":", "if", "sys", ".", "platform", "!=", "\"win32\"", ":", "return", "None", "from", "PIL", "import", "ImageWin", "if", "isinstance", "(", "handle", ",", "ImageWin", ".", "HDC", ")", ":", "pr...
[ 259, 0 ]
[ 277, 35 ]
python
en
['en', 'error', 'th']
False
profileToProfile
( im, inputProfile, outputProfile, renderingIntent=INTENT_PERCEPTUAL, outputMode=None, inPlace=False, flags=0, )
(pyCMS) Applies an ICC transformation to a given image, mapping from ``inputProfile`` to ``outputProfile``. If the input or output profiles specified are not valid filenames, a :exc:`PyCMSError` will be raised. If ``inPlace`` is ``True`` and ``outputMode != im.mode``, a :exc:`PyCMSError` will be ...
(pyCMS) Applies an ICC transformation to a given image, mapping from ``inputProfile`` to ``outputProfile``.
def profileToProfile( im, inputProfile, outputProfile, renderingIntent=INTENT_PERCEPTUAL, outputMode=None, inPlace=False, flags=0, ): """ (pyCMS) Applies an ICC transformation to a given image, mapping from ``inputProfile`` to ``outputProfile``. If the input or output profil...
[ "def", "profileToProfile", "(", "im", ",", "inputProfile", ",", "outputProfile", ",", "renderingIntent", "=", "INTENT_PERCEPTUAL", ",", "outputMode", "=", "None", ",", "inPlace", "=", "False", ",", "flags", "=", "0", ",", ")", ":", "if", "outputMode", "is", ...
[ 293, 0 ]
[ 384, 16 ]
python
en
['en', 'error', 'th']
False
getOpenProfile
(profileFilename)
(pyCMS) Opens an ICC profile file. The PyCMSProfile object can be passed back into pyCMS for use in creating transforms and such (as in ImageCms.buildTransformFromOpenProfiles()). If ``profileFilename`` is not a valid filename for an ICC profile, a :exc:`PyCMSError` will be raised. :param pr...
(pyCMS) Opens an ICC profile file.
def getOpenProfile(profileFilename): """ (pyCMS) Opens an ICC profile file. The PyCMSProfile object can be passed back into pyCMS for use in creating transforms and such (as in ImageCms.buildTransformFromOpenProfiles()). If ``profileFilename`` is not a valid filename for an ICC profile, a :exc...
[ "def", "getOpenProfile", "(", "profileFilename", ")", ":", "try", ":", "return", "ImageCmsProfile", "(", "profileFilename", ")", "except", "(", "OSError", ",", "TypeError", ",", "ValueError", ")", "as", "v", ":", "raise", "PyCMSError", "(", "v", ")", "from",...
[ 387, 0 ]
[ 406, 34 ]
python
en
['en', 'error', 'th']
False
buildTransform
( inputProfile, outputProfile, inMode, outMode, renderingIntent=INTENT_PERCEPTUAL, flags=0, )
(pyCMS) Builds an ICC transform mapping from the ``inputProfile`` to the ``outputProfile``. Use applyTransform to apply the transform to a given image. If the input or output profiles specified are not valid filenames, a :exc:`PyCMSError` will be raised. If an error occurs during creation of t...
(pyCMS) Builds an ICC transform mapping from the ``inputProfile`` to the ``outputProfile``. Use applyTransform to apply the transform to a given image.
def buildTransform( inputProfile, outputProfile, inMode, outMode, renderingIntent=INTENT_PERCEPTUAL, flags=0, ): """ (pyCMS) Builds an ICC transform mapping from the ``inputProfile`` to the ``outputProfile``. Use applyTransform to apply the transform to a given image. If the...
[ "def", "buildTransform", "(", "inputProfile", ",", "outputProfile", ",", "inMode", ",", "outMode", ",", "renderingIntent", "=", "INTENT_PERCEPTUAL", ",", "flags", "=", "0", ",", ")", ":", "if", "not", "isinstance", "(", "renderingIntent", ",", "int", ")", "o...
[ 409, 0 ]
[ 487, 34 ]
python
en
['en', 'error', 'th']
False
buildProofTransform
( inputProfile, outputProfile, proofProfile, inMode, outMode, renderingIntent=INTENT_PERCEPTUAL, proofRenderingIntent=INTENT_ABSOLUTE_COLORIMETRIC, flags=FLAGS["SOFTPROOFING"], )
(pyCMS) Builds an ICC transform mapping from the ``inputProfile`` to the ``outputProfile``, but tries to simulate the result that would be obtained on the ``proofProfile`` device. If the input, output, or proof profiles specified are not valid filenames, a :exc:`PyCMSError` will be raised. If...
(pyCMS) Builds an ICC transform mapping from the ``inputProfile`` to the ``outputProfile``, but tries to simulate the result that would be obtained on the ``proofProfile`` device.
def buildProofTransform( inputProfile, outputProfile, proofProfile, inMode, outMode, renderingIntent=INTENT_PERCEPTUAL, proofRenderingIntent=INTENT_ABSOLUTE_COLORIMETRIC, flags=FLAGS["SOFTPROOFING"], ): """ (pyCMS) Builds an ICC transform mapping from the ``inputProfile`` to the ...
[ "def", "buildProofTransform", "(", "inputProfile", ",", "outputProfile", ",", "proofProfile", ",", "inMode", ",", "outMode", ",", "renderingIntent", "=", "INTENT_PERCEPTUAL", ",", "proofRenderingIntent", "=", "INTENT_ABSOLUTE_COLORIMETRIC", ",", "flags", "=", "FLAGS", ...
[ 490, 0 ]
[ 598, 34 ]
python
en
['en', 'error', 'th']
False