id int32 0 252k | repo stringlengths 7 55 | path stringlengths 4 127 | func_name stringlengths 1 88 | original_string stringlengths 75 19.8k | language stringclasses 1
value | code stringlengths 75 19.8k | code_tokens list | docstring stringlengths 3 17.3k | docstring_tokens list | sha stringlengths 40 40 | url stringlengths 87 242 |
|---|---|---|---|---|---|---|---|---|---|---|---|
13,100 | Esri/ArcREST | src/arcrest/webmap/symbols.py | SimpleMarkerSymbol.color | def color(self, value):
""" sets the color """
if isinstance(value, (list, Color)):
if value is list:
self._color = value
else:
self._color = value.asList | python | def color(self, value):
""" sets the color """
if isinstance(value, (list, Color)):
if value is list:
self._color = value
else:
self._color = value.asList | [
"def",
"color",
"(",
"self",
",",
"value",
")",
":",
"if",
"isinstance",
"(",
"value",
",",
"(",
"list",
",",
"Color",
")",
")",
":",
"if",
"value",
"is",
"list",
":",
"self",
".",
"_color",
"=",
"value",
"else",
":",
"self",
".",
"_color",
"=",
... | sets the color | [
"sets",
"the",
"color"
] | ab240fde2b0200f61d4a5f6df033516e53f2f416 | https://github.com/Esri/ArcREST/blob/ab240fde2b0200f61d4a5f6df033516e53f2f416/src/arcrest/webmap/symbols.py#L157-L163 |
13,101 | Esri/ArcREST | src/arcrest/webmap/symbols.py | SimpleMarkerSymbol.outlineColor | def outlineColor(self, value):
""" sets the outline color """
if isinstance(value, (list, Color)):
if value is list:
self._outlineColor = value
else:
self._outlineColor = value.asList | python | def outlineColor(self, value):
""" sets the outline color """
if isinstance(value, (list, Color)):
if value is list:
self._outlineColor = value
else:
self._outlineColor = value.asList | [
"def",
"outlineColor",
"(",
"self",
",",
"value",
")",
":",
"if",
"isinstance",
"(",
"value",
",",
"(",
"list",
",",
"Color",
")",
")",
":",
"if",
"value",
"is",
"list",
":",
"self",
".",
"_outlineColor",
"=",
"value",
"else",
":",
"self",
".",
"_o... | sets the outline color | [
"sets",
"the",
"outline",
"color"
] | ab240fde2b0200f61d4a5f6df033516e53f2f416 | https://github.com/Esri/ArcREST/blob/ab240fde2b0200f61d4a5f6df033516e53f2f416/src/arcrest/webmap/symbols.py#L229-L235 |
13,102 | Esri/ArcREST | src/arcrest/webmap/symbols.py | SimpleFillSymbol.outline | def outline(self, value):
""" sets the outline """
if isinstance(value, SimpleLineSymbol):
self._outline = value.asDictionary | python | def outline(self, value):
""" sets the outline """
if isinstance(value, SimpleLineSymbol):
self._outline = value.asDictionary | [
"def",
"outline",
"(",
"self",
",",
"value",
")",
":",
"if",
"isinstance",
"(",
"value",
",",
"SimpleLineSymbol",
")",
":",
"self",
".",
"_outline",
"=",
"value",
".",
"asDictionary"
] | sets the outline | [
"sets",
"the",
"outline"
] | ab240fde2b0200f61d4a5f6df033516e53f2f416 | https://github.com/Esri/ArcREST/blob/ab240fde2b0200f61d4a5f6df033516e53f2f416/src/arcrest/webmap/symbols.py#L389-L392 |
13,103 | Esri/ArcREST | src/arcrest/webmap/symbols.py | PictureMarkerSymbol.base64ToImage | def base64ToImage(imgData, out_path, out_file):
""" converts a base64 string to a file """
fh = open(os.path.join(out_path, out_file), "wb")
fh.write(imgData.decode('base64'))
fh.close()
del fh
return os.path.join(out_path, out_file) | python | def base64ToImage(imgData, out_path, out_file):
""" converts a base64 string to a file """
fh = open(os.path.join(out_path, out_file), "wb")
fh.write(imgData.decode('base64'))
fh.close()
del fh
return os.path.join(out_path, out_file) | [
"def",
"base64ToImage",
"(",
"imgData",
",",
"out_path",
",",
"out_file",
")",
":",
"fh",
"=",
"open",
"(",
"os",
".",
"path",
".",
"join",
"(",
"out_path",
",",
"out_file",
")",
",",
"\"wb\"",
")",
"fh",
".",
"write",
"(",
"imgData",
".",
"decode",
... | converts a base64 string to a file | [
"converts",
"a",
"base64",
"string",
"to",
"a",
"file"
] | ab240fde2b0200f61d4a5f6df033516e53f2f416 | https://github.com/Esri/ArcREST/blob/ab240fde2b0200f61d4a5f6df033516e53f2f416/src/arcrest/webmap/symbols.py#L448-L454 |
13,104 | Esri/ArcREST | src/arcrest/ags/_geocodeservice.py | GeocodeService.find | def find(self,
text,
magicKey=None,
sourceCountry=None,
bbox=None,
location=None,
distance=3218.69,
outSR=102100,
category=None,
outFields="*",
maxLocations=20,
forStorage=False... | python | def find(self,
text,
magicKey=None,
sourceCountry=None,
bbox=None,
location=None,
distance=3218.69,
outSR=102100,
category=None,
outFields="*",
maxLocations=20,
forStorage=False... | [
"def",
"find",
"(",
"self",
",",
"text",
",",
"magicKey",
"=",
"None",
",",
"sourceCountry",
"=",
"None",
",",
"bbox",
"=",
"None",
",",
"location",
"=",
"None",
",",
"distance",
"=",
"3218.69",
",",
"outSR",
"=",
"102100",
",",
"category",
"=",
"Non... | The find operation geocodes one location per request; the input
address is specified in a single parameter.
Inputs:
text - Specifies the location to be geocoded. This can be a
street address, place name, postal code, or POI.
magicKey - The find operation retrieves resu... | [
"The",
"find",
"operation",
"geocodes",
"one",
"location",
"per",
"request",
";",
"the",
"input",
"address",
"is",
"specified",
"in",
"a",
"single",
"parameter",
"."
] | ab240fde2b0200f61d4a5f6df033516e53f2f416 | https://github.com/Esri/ArcREST/blob/ab240fde2b0200f61d4a5f6df033516e53f2f416/src/arcrest/ags/_geocodeservice.py#L160-L261 |
13,105 | Esri/ArcREST | src/arcrest/ags/_geocodeservice.py | GeocodeService.geocodeAddresses | def geocodeAddresses(self,
addresses,
outSR=4326,
sourceCountry=None,
category=None):
"""
The geocodeAddresses operation is performed on a Geocode Service
resource. The result of this operation is... | python | def geocodeAddresses(self,
addresses,
outSR=4326,
sourceCountry=None,
category=None):
"""
The geocodeAddresses operation is performed on a Geocode Service
resource. The result of this operation is... | [
"def",
"geocodeAddresses",
"(",
"self",
",",
"addresses",
",",
"outSR",
"=",
"4326",
",",
"sourceCountry",
"=",
"None",
",",
"category",
"=",
"None",
")",
":",
"params",
"=",
"{",
"\"f\"",
":",
"\"json\"",
"}",
"url",
"=",
"self",
".",
"_url",
"+",
"... | The geocodeAddresses operation is performed on a Geocode Service
resource. The result of this operation is a resource representing
the list of geocoded addresses. This resource provides information
about the addresses including the address, location, score, and
other geocode service-spec... | [
"The",
"geocodeAddresses",
"operation",
"is",
"performed",
"on",
"a",
"Geocode",
"Service",
"resource",
".",
"The",
"result",
"of",
"this",
"operation",
"is",
"a",
"resource",
"representing",
"the",
"list",
"of",
"geocoded",
"addresses",
".",
"This",
"resource",... | ab240fde2b0200f61d4a5f6df033516e53f2f416 | https://github.com/Esri/ArcREST/blob/ab240fde2b0200f61d4a5f6df033516e53f2f416/src/arcrest/ags/_geocodeservice.py#L422-L491 |
13,106 | Esri/ArcREST | src/arcrest/ags/_networkservice.py | NetworkService.__init | def __init(self):
""" initializes the properties """
params = {
"f" : "json",
}
json_dict = self._get(self._url, params,
securityHandler=self._securityHandler,
proxy_url=self._proxy_url,
... | python | def __init(self):
""" initializes the properties """
params = {
"f" : "json",
}
json_dict = self._get(self._url, params,
securityHandler=self._securityHandler,
proxy_url=self._proxy_url,
... | [
"def",
"__init",
"(",
"self",
")",
":",
"params",
"=",
"{",
"\"f\"",
":",
"\"json\"",
",",
"}",
"json_dict",
"=",
"self",
".",
"_get",
"(",
"self",
".",
"_url",
",",
"params",
",",
"securityHandler",
"=",
"self",
".",
"_securityHandler",
",",
"proxy_ur... | initializes the properties | [
"initializes",
"the",
"properties"
] | ab240fde2b0200f61d4a5f6df033516e53f2f416 | https://github.com/Esri/ArcREST/blob/ab240fde2b0200f61d4a5f6df033516e53f2f416/src/arcrest/ags/_networkservice.py#L47-L96 |
13,107 | Esri/ArcREST | src/arcrest/ags/_networkservice.py | RouteNetworkLayer.__init | def __init(self):
""" initializes all the properties """
params = {
"f" : "json"
}
json_dict = self._get(url=self._url, param_dict=params,
securityHandler=self._securityHandler,
proxy_url=self._proxy_url,
... | python | def __init(self):
""" initializes all the properties """
params = {
"f" : "json"
}
json_dict = self._get(url=self._url, param_dict=params,
securityHandler=self._securityHandler,
proxy_url=self._proxy_url,
... | [
"def",
"__init",
"(",
"self",
")",
":",
"params",
"=",
"{",
"\"f\"",
":",
"\"json\"",
"}",
"json_dict",
"=",
"self",
".",
"_get",
"(",
"url",
"=",
"self",
".",
"_url",
",",
"param_dict",
"=",
"params",
",",
"securityHandler",
"=",
"self",
".",
"_secu... | initializes all the properties | [
"initializes",
"all",
"the",
"properties"
] | ab240fde2b0200f61d4a5f6df033516e53f2f416 | https://github.com/Esri/ArcREST/blob/ab240fde2b0200f61d4a5f6df033516e53f2f416/src/arcrest/ags/_networkservice.py#L440-L457 |
13,108 | Esri/ArcREST | src/arcrest/ags/_uploads.py | Uploads.download | def download(self, itemID, savePath):
"""
downloads an item to local disk
Inputs:
itemID - unique id of item to download
savePath - folder to save the file in
"""
if os.path.isdir(savePath) == False:
os.makedirs(savePath)
url = self._url... | python | def download(self, itemID, savePath):
"""
downloads an item to local disk
Inputs:
itemID - unique id of item to download
savePath - folder to save the file in
"""
if os.path.isdir(savePath) == False:
os.makedirs(savePath)
url = self._url... | [
"def",
"download",
"(",
"self",
",",
"itemID",
",",
"savePath",
")",
":",
"if",
"os",
".",
"path",
".",
"isdir",
"(",
"savePath",
")",
"==",
"False",
":",
"os",
".",
"makedirs",
"(",
"savePath",
")",
"url",
"=",
"self",
".",
"_url",
"+",
"\"/%s/dow... | downloads an item to local disk
Inputs:
itemID - unique id of item to download
savePath - folder to save the file in | [
"downloads",
"an",
"item",
"to",
"local",
"disk"
] | ab240fde2b0200f61d4a5f6df033516e53f2f416 | https://github.com/Esri/ArcREST/blob/ab240fde2b0200f61d4a5f6df033516e53f2f416/src/arcrest/ags/_uploads.py#L109-L129 |
13,109 | Esri/ArcREST | src/arcrest/manageags/_usagereports.py | UsageReports.reports | def reports(self):
"""returns a list of reports on the server"""
if self._metrics is None:
self.__init()
self._reports = []
for r in self._metrics:
url = self._url + "/%s" % six.moves.urllib.parse.quote_plus(r['reportname'])
self._reports.append(UsageR... | python | def reports(self):
"""returns a list of reports on the server"""
if self._metrics is None:
self.__init()
self._reports = []
for r in self._metrics:
url = self._url + "/%s" % six.moves.urllib.parse.quote_plus(r['reportname'])
self._reports.append(UsageR... | [
"def",
"reports",
"(",
"self",
")",
":",
"if",
"self",
".",
"_metrics",
"is",
"None",
":",
"self",
".",
"__init",
"(",
")",
"self",
".",
"_reports",
"=",
"[",
"]",
"for",
"r",
"in",
"self",
".",
"_metrics",
":",
"url",
"=",
"self",
".",
"_url",
... | returns a list of reports on the server | [
"returns",
"a",
"list",
"of",
"reports",
"on",
"the",
"server"
] | ab240fde2b0200f61d4a5f6df033516e53f2f416 | https://github.com/Esri/ArcREST/blob/ab240fde2b0200f61d4a5f6df033516e53f2f416/src/arcrest/manageags/_usagereports.py#L70-L83 |
13,110 | Esri/ArcREST | src/arcrest/manageags/_usagereports.py | UsageReports.editUsageReportSettings | def editUsageReportSettings(self, samplingInterval,
enabled=True, maxHistory=0):
"""
The usage reports settings are applied to the entire site. A POST
request updates the usage reports settings.
Inputs:
samplingInterval - Defines the duration (... | python | def editUsageReportSettings(self, samplingInterval,
enabled=True, maxHistory=0):
"""
The usage reports settings are applied to the entire site. A POST
request updates the usage reports settings.
Inputs:
samplingInterval - Defines the duration (... | [
"def",
"editUsageReportSettings",
"(",
"self",
",",
"samplingInterval",
",",
"enabled",
"=",
"True",
",",
"maxHistory",
"=",
"0",
")",
":",
"params",
"=",
"{",
"\"f\"",
":",
"\"json\"",
",",
"\"maxHistory\"",
":",
"maxHistory",
",",
"\"enabled\"",
":",
"enab... | The usage reports settings are applied to the entire site. A POST
request updates the usage reports settings.
Inputs:
samplingInterval - Defines the duration (in minutes) for which
the usage statistics are aggregated or sampled, in-memory,
before being written out t... | [
"The",
"usage",
"reports",
"settings",
"are",
"applied",
"to",
"the",
"entire",
"site",
".",
"A",
"POST",
"request",
"updates",
"the",
"usage",
"reports",
"settings",
"."
] | ab240fde2b0200f61d4a5f6df033516e53f2f416 | https://github.com/Esri/ArcREST/blob/ab240fde2b0200f61d4a5f6df033516e53f2f416/src/arcrest/manageags/_usagereports.py#L110-L140 |
13,111 | Esri/ArcREST | src/arcrest/manageags/_usagereports.py | UsageReports.createUsageReport | def createUsageReport(self,
reportname,
queries,
metadata,
since="LAST_DAY",
fromValue=None,
toValue=None,
aggregationInterval=None
... | python | def createUsageReport(self,
reportname,
queries,
metadata,
since="LAST_DAY",
fromValue=None,
toValue=None,
aggregationInterval=None
... | [
"def",
"createUsageReport",
"(",
"self",
",",
"reportname",
",",
"queries",
",",
"metadata",
",",
"since",
"=",
"\"LAST_DAY\"",
",",
"fromValue",
"=",
"None",
",",
"toValue",
"=",
"None",
",",
"aggregationInterval",
"=",
"None",
")",
":",
"url",
"=",
"self... | Creates a new usage report. A usage report is created by submitting
a JSON representation of the usage report to this operation.
Inputs:
reportname - the unique name of the report
since - the time duration of the report. The supported values
are: LAST_DAY, LAST_WEEK,... | [
"Creates",
"a",
"new",
"usage",
"report",
".",
"A",
"usage",
"report",
"is",
"created",
"by",
"submitting",
"a",
"JSON",
"representation",
"of",
"the",
"usage",
"report",
"to",
"this",
"operation",
"."
] | ab240fde2b0200f61d4a5f6df033516e53f2f416 | https://github.com/Esri/ArcREST/blob/ab240fde2b0200f61d4a5f6df033516e53f2f416/src/arcrest/manageags/_usagereports.py#L142-L273 |
13,112 | Esri/ArcREST | src/arcrest/manageags/_usagereports.py | UsageReport.edit | def edit(self):
"""
Edits the usage report. To edit a usage report, you need to submit
the complete JSON representation of the usage report which
includes updates to the usage report properties. The name of the
report cannot be changed when editing the usage report.
Valu... | python | def edit(self):
"""
Edits the usage report. To edit a usage report, you need to submit
the complete JSON representation of the usage report which
includes updates to the usage report properties. The name of the
report cannot be changed when editing the usage report.
Valu... | [
"def",
"edit",
"(",
"self",
")",
":",
"usagereport_dict",
"=",
"{",
"\"reportname\"",
":",
"self",
".",
"reportname",
",",
"\"queries\"",
":",
"self",
".",
"_queries",
",",
"\"since\"",
":",
"self",
".",
"since",
",",
"\"metadata\"",
":",
"self",
".",
"_... | Edits the usage report. To edit a usage report, you need to submit
the complete JSON representation of the usage report which
includes updates to the usage report properties. The name of the
report cannot be changed when editing the usage report.
Values are changed in the class, to edit... | [
"Edits",
"the",
"usage",
"report",
".",
"To",
"edit",
"a",
"usage",
"report",
"you",
"need",
"to",
"submit",
"the",
"complete",
"JSON",
"representation",
"of",
"the",
"usage",
"report",
"which",
"includes",
"updates",
"to",
"the",
"usage",
"report",
"propert... | ab240fde2b0200f61d4a5f6df033516e53f2f416 | https://github.com/Esri/ArcREST/blob/ab240fde2b0200f61d4a5f6df033516e53f2f416/src/arcrest/manageags/_usagereports.py#L419-L452 |
13,113 | Esri/ArcREST | src/arcrest/ags/_geodataservice.py | GeoDataService.__init | def __init(self):
""" inializes the properties """
params = {
"f" : "json",
}
json_dict = self._get(self._url, params,
securityHandler=self._securityHandler,
proxy_url=self._proxy_url,
... | python | def __init(self):
""" inializes the properties """
params = {
"f" : "json",
}
json_dict = self._get(self._url, params,
securityHandler=self._securityHandler,
proxy_url=self._proxy_url,
... | [
"def",
"__init",
"(",
"self",
")",
":",
"params",
"=",
"{",
"\"f\"",
":",
"\"json\"",
",",
"}",
"json_dict",
"=",
"self",
".",
"_get",
"(",
"self",
".",
"_url",
",",
"params",
",",
"securityHandler",
"=",
"self",
".",
"_securityHandler",
",",
"proxy_ur... | inializes the properties | [
"inializes",
"the",
"properties"
] | ab240fde2b0200f61d4a5f6df033516e53f2f416 | https://github.com/Esri/ArcREST/blob/ab240fde2b0200f61d4a5f6df033516e53f2f416/src/arcrest/ags/_geodataservice.py#L36-L73 |
13,114 | Esri/ArcREST | src/arcrest/ags/_geodataservice.py | GeoDataService.replicasResource | def replicasResource(self):
"""returns a list of replices"""
if self._replicasResource is None:
self._replicasResource = {}
for replica in self.replicas:
self._replicasResource["replicaName"] = replica.name
self._replicasResource["replicaID"] = rep... | python | def replicasResource(self):
"""returns a list of replices"""
if self._replicasResource is None:
self._replicasResource = {}
for replica in self.replicas:
self._replicasResource["replicaName"] = replica.name
self._replicasResource["replicaID"] = rep... | [
"def",
"replicasResource",
"(",
"self",
")",
":",
"if",
"self",
".",
"_replicasResource",
"is",
"None",
":",
"self",
".",
"_replicasResource",
"=",
"{",
"}",
"for",
"replica",
"in",
"self",
".",
"replicas",
":",
"self",
".",
"_replicasResource",
"[",
"\"re... | returns a list of replices | [
"returns",
"a",
"list",
"of",
"replices"
] | ab240fde2b0200f61d4a5f6df033516e53f2f416 | https://github.com/Esri/ArcREST/blob/ab240fde2b0200f61d4a5f6df033516e53f2f416/src/arcrest/ags/_geodataservice.py#L111-L118 |
13,115 | Esri/ArcREST | src/arcrest/hostedservice/service.py | Services.services | def services(self):
""" returns all the service objects in the admin service's page """
self._services = []
params = {"f": "json"}
if not self._url.endswith('/services'):
uURL = self._url + "/services"
else:
uURL = self._url
res = self._get(url=uUR... | python | def services(self):
""" returns all the service objects in the admin service's page """
self._services = []
params = {"f": "json"}
if not self._url.endswith('/services'):
uURL = self._url + "/services"
else:
uURL = self._url
res = self._get(url=uUR... | [
"def",
"services",
"(",
"self",
")",
":",
"self",
".",
"_services",
"=",
"[",
"]",
"params",
"=",
"{",
"\"f\"",
":",
"\"json\"",
"}",
"if",
"not",
"self",
".",
"_url",
".",
"endswith",
"(",
"'/services'",
")",
":",
"uURL",
"=",
"self",
".",
"_url",... | returns all the service objects in the admin service's page | [
"returns",
"all",
"the",
"service",
"objects",
"in",
"the",
"admin",
"service",
"s",
"page"
] | ab240fde2b0200f61d4a5f6df033516e53f2f416 | https://github.com/Esri/ArcREST/blob/ab240fde2b0200f61d4a5f6df033516e53f2f416/src/arcrest/hostedservice/service.py#L144-L170 |
13,116 | Esri/ArcREST | src/arcrest/hostedservice/service.py | AdminMapService.refresh | def refresh(self, serviceDefinition=True):
"""
The refresh operation refreshes a service, which clears the web
server cache for the service.
"""
url = self._url + "/MapServer/refresh"
params = {
"f" : "json",
"serviceDefinition" : serviceDefinition... | python | def refresh(self, serviceDefinition=True):
"""
The refresh operation refreshes a service, which clears the web
server cache for the service.
"""
url = self._url + "/MapServer/refresh"
params = {
"f" : "json",
"serviceDefinition" : serviceDefinition... | [
"def",
"refresh",
"(",
"self",
",",
"serviceDefinition",
"=",
"True",
")",
":",
"url",
"=",
"self",
".",
"_url",
"+",
"\"/MapServer/refresh\"",
"params",
"=",
"{",
"\"f\"",
":",
"\"json\"",
",",
"\"serviceDefinition\"",
":",
"serviceDefinition",
"}",
"res",
... | The refresh operation refreshes a service, which clears the web
server cache for the service. | [
"The",
"refresh",
"operation",
"refreshes",
"a",
"service",
"which",
"clears",
"the",
"web",
"server",
"cache",
"for",
"the",
"service",
"."
] | ab240fde2b0200f61d4a5f6df033516e53f2f416 | https://github.com/Esri/ArcREST/blob/ab240fde2b0200f61d4a5f6df033516e53f2f416/src/arcrest/hostedservice/service.py#L535-L552 |
13,117 | Esri/ArcREST | src/arcrest/hostedservice/service.py | AdminMapService.editTileService | def editTileService(self,
serviceDefinition=None,
minScale=None,
maxScale=None,
sourceItemId=None,
exportTilesAllowed=False,
maxExportTileCount=100000):
"""
Thi... | python | def editTileService(self,
serviceDefinition=None,
minScale=None,
maxScale=None,
sourceItemId=None,
exportTilesAllowed=False,
maxExportTileCount=100000):
"""
Thi... | [
"def",
"editTileService",
"(",
"self",
",",
"serviceDefinition",
"=",
"None",
",",
"minScale",
"=",
"None",
",",
"maxScale",
"=",
"None",
",",
"sourceItemId",
"=",
"None",
",",
"exportTilesAllowed",
"=",
"False",
",",
"maxExportTileCount",
"=",
"100000",
")",
... | This post operation updates a Tile Service's properties
Inputs:
serviceDefinition - updates a service definition
minScale - sets the services minimum scale for caching
maxScale - sets the service's maximum scale for caching
sourceItemId - The Source Item ID is the Ge... | [
"This",
"post",
"operation",
"updates",
"a",
"Tile",
"Service",
"s",
"properties"
] | ab240fde2b0200f61d4a5f6df033516e53f2f416 | https://github.com/Esri/ArcREST/blob/ab240fde2b0200f61d4a5f6df033516e53f2f416/src/arcrest/hostedservice/service.py#L591-L630 |
13,118 | Esri/ArcREST | src/arcrest/hostedservice/service.py | AdminFeatureService.refresh | def refresh(self):
""" refreshes a service """
params = {"f": "json"}
uURL = self._url + "/refresh"
res = self._get(url=uURL, param_dict=params,
securityHandler=self._securityHandler,
proxy_port=self._proxy_port,
... | python | def refresh(self):
""" refreshes a service """
params = {"f": "json"}
uURL = self._url + "/refresh"
res = self._get(url=uURL, param_dict=params,
securityHandler=self._securityHandler,
proxy_port=self._proxy_port,
... | [
"def",
"refresh",
"(",
"self",
")",
":",
"params",
"=",
"{",
"\"f\"",
":",
"\"json\"",
"}",
"uURL",
"=",
"self",
".",
"_url",
"+",
"\"/refresh\"",
"res",
"=",
"self",
".",
"_get",
"(",
"url",
"=",
"uURL",
",",
"param_dict",
"=",
"params",
",",
"sec... | refreshes a service | [
"refreshes",
"a",
"service"
] | ab240fde2b0200f61d4a5f6df033516e53f2f416 | https://github.com/Esri/ArcREST/blob/ab240fde2b0200f61d4a5f6df033516e53f2f416/src/arcrest/hostedservice/service.py#L822-L831 |
13,119 | Esri/ArcREST | src/arcrest/hostedservice/service.py | AdminFeatureService.addToDefinition | def addToDefinition(self, json_dict):
"""
The addToDefinition operation supports adding a definition
property to a hosted feature service. The result of this
operation is a response indicating success or failure with error
code and description.
This functi... | python | def addToDefinition(self, json_dict):
"""
The addToDefinition operation supports adding a definition
property to a hosted feature service. The result of this
operation is a response indicating success or failure with error
code and description.
This functi... | [
"def",
"addToDefinition",
"(",
"self",
",",
"json_dict",
")",
":",
"params",
"=",
"{",
"\"f\"",
":",
"\"json\"",
",",
"\"addToDefinition\"",
":",
"json",
".",
"dumps",
"(",
"json_dict",
")",
",",
"\"async\"",
":",
"False",
"}",
"uURL",
"=",
"self",
".",
... | The addToDefinition operation supports adding a definition
property to a hosted feature service. The result of this
operation is a response indicating success or failure with error
code and description.
This function will allow users to change add additional values
... | [
"The",
"addToDefinition",
"operation",
"supports",
"adding",
"a",
"definition",
"property",
"to",
"a",
"hosted",
"feature",
"service",
".",
"The",
"result",
"of",
"this",
"operation",
"is",
"a",
"response",
"indicating",
"success",
"or",
"failure",
"with",
"erro... | ab240fde2b0200f61d4a5f6df033516e53f2f416 | https://github.com/Esri/ArcREST/blob/ab240fde2b0200f61d4a5f6df033516e53f2f416/src/arcrest/hostedservice/service.py#L1025-L1054 |
13,120 | Esri/ArcREST | src/arcrest/hostedservice/service.py | AdminFeatureService.updateDefinition | def updateDefinition(self, json_dict):
"""
The updateDefinition operation supports updating a definition
property in a hosted feature service. The result of this
operation is a response indicating success or failure with error
code and description.
Input:
... | python | def updateDefinition(self, json_dict):
"""
The updateDefinition operation supports updating a definition
property in a hosted feature service. The result of this
operation is a response indicating success or failure with error
code and description.
Input:
... | [
"def",
"updateDefinition",
"(",
"self",
",",
"json_dict",
")",
":",
"definition",
"=",
"None",
"if",
"json_dict",
"is",
"not",
"None",
":",
"if",
"isinstance",
"(",
"json_dict",
",",
"collections",
".",
"OrderedDict",
")",
"==",
"True",
":",
"definition",
... | The updateDefinition operation supports updating a definition
property in a hosted feature service. The result of this
operation is a response indicating success or failure with error
code and description.
Input:
json_dict - part to add to host service. The pa... | [
"The",
"updateDefinition",
"operation",
"supports",
"updating",
"a",
"definition",
"property",
"in",
"a",
"hosted",
"feature",
"service",
".",
"The",
"result",
"of",
"this",
"operation",
"is",
"a",
"response",
"indicating",
"success",
"or",
"failure",
"with",
"e... | ab240fde2b0200f61d4a5f6df033516e53f2f416 | https://github.com/Esri/ArcREST/blob/ab240fde2b0200f61d4a5f6df033516e53f2f416/src/arcrest/hostedservice/service.py#L1056-L1120 |
13,121 | Esri/ArcREST | src/arcrest/packages/ntlm3/ntlm.py | calc_resp | def calc_resp(password_hash, server_challenge):
"""calc_resp generates the LM response given a 16-byte password hash and the
challenge from the Type-2 message.
@param password_hash
16-byte password hash
@param server_challenge
8-byte challenge from Type-2 message
... | python | def calc_resp(password_hash, server_challenge):
"""calc_resp generates the LM response given a 16-byte password hash and the
challenge from the Type-2 message.
@param password_hash
16-byte password hash
@param server_challenge
8-byte challenge from Type-2 message
... | [
"def",
"calc_resp",
"(",
"password_hash",
",",
"server_challenge",
")",
":",
"# padding with zeros to make the hash 21 bytes long",
"password_hash",
"+=",
"b'\\0'",
"*",
"(",
"21",
"-",
"len",
"(",
"password_hash",
")",
")",
"res",
"=",
"b''",
"dobj",
"=",
"des",
... | calc_resp generates the LM response given a 16-byte password hash and the
challenge from the Type-2 message.
@param password_hash
16-byte password hash
@param server_challenge
8-byte challenge from Type-2 message
returns
24-byte buffer to contain the L... | [
"calc_resp",
"generates",
"the",
"LM",
"response",
"given",
"a",
"16",
"-",
"byte",
"password",
"hash",
"and",
"the",
"challenge",
"from",
"the",
"Type",
"-",
"2",
"message",
"."
] | ab240fde2b0200f61d4a5f6df033516e53f2f416 | https://github.com/Esri/ArcREST/blob/ab240fde2b0200f61d4a5f6df033516e53f2f416/src/arcrest/packages/ntlm3/ntlm.py#L323-L345 |
13,122 | Esri/ArcREST | src/arcrest/packages/ntlm3/ntlm.py | create_LM_hashed_password_v1 | def create_LM_hashed_password_v1(passwd):
"""create LanManager hashed password"""
# if the passwd provided is already a hash, we just return the first half
if re.match(r'^[\w]{32}:[\w]{32}$', passwd):
return binascii.unhexlify(passwd.split(':')[0])
# fix the password length to 14 bytes
pas... | python | def create_LM_hashed_password_v1(passwd):
"""create LanManager hashed password"""
# if the passwd provided is already a hash, we just return the first half
if re.match(r'^[\w]{32}:[\w]{32}$', passwd):
return binascii.unhexlify(passwd.split(':')[0])
# fix the password length to 14 bytes
pas... | [
"def",
"create_LM_hashed_password_v1",
"(",
"passwd",
")",
":",
"# if the passwd provided is already a hash, we just return the first half",
"if",
"re",
".",
"match",
"(",
"r'^[\\w]{32}:[\\w]{32}$'",
",",
"passwd",
")",
":",
"return",
"binascii",
".",
"unhexlify",
"(",
"p... | create LanManager hashed password | [
"create",
"LanManager",
"hashed",
"password"
] | ab240fde2b0200f61d4a5f6df033516e53f2f416 | https://github.com/Esri/ArcREST/blob/ab240fde2b0200f61d4a5f6df033516e53f2f416/src/arcrest/packages/ntlm3/ntlm.py#L372-L394 |
13,123 | Esri/ArcREST | src/arcrest/enrichment/_geoenrichment.py | GeoEnrichment._readcsv | def _readcsv(self, path_to_csv):
"""reads a csv column"""
return np.genfromtxt(path_to_csv,
dtype=None,
delimiter=',',
names=True) | python | def _readcsv(self, path_to_csv):
"""reads a csv column"""
return np.genfromtxt(path_to_csv,
dtype=None,
delimiter=',',
names=True) | [
"def",
"_readcsv",
"(",
"self",
",",
"path_to_csv",
")",
":",
"return",
"np",
".",
"genfromtxt",
"(",
"path_to_csv",
",",
"dtype",
"=",
"None",
",",
"delimiter",
"=",
"','",
",",
"names",
"=",
"True",
")"
] | reads a csv column | [
"reads",
"a",
"csv",
"column"
] | ab240fde2b0200f61d4a5f6df033516e53f2f416 | https://github.com/Esri/ArcREST/blob/ab240fde2b0200f61d4a5f6df033516e53f2f416/src/arcrest/enrichment/_geoenrichment.py#L56-L61 |
13,124 | Esri/ArcREST | src/arcrest/enrichment/_geoenrichment.py | GeoEnrichment.queryDataCollectionByName | def queryDataCollectionByName(self, countryName):
"""
returns a list of available data collections for a given country
name.
Inputs:
countryName - name of the country to file the data collection.
Output:
list or None. None implies could not find the country... | python | def queryDataCollectionByName(self, countryName):
"""
returns a list of available data collections for a given country
name.
Inputs:
countryName - name of the country to file the data collection.
Output:
list or None. None implies could not find the country... | [
"def",
"queryDataCollectionByName",
"(",
"self",
",",
"countryName",
")",
":",
"var",
"=",
"self",
".",
"_dataCollectionCodes",
"try",
":",
"return",
"[",
"x",
"[",
"0",
"]",
"for",
"x",
"in",
"var",
"[",
"var",
"[",
"'Countries'",
"]",
"==",
"countryNam... | returns a list of available data collections for a given country
name.
Inputs:
countryName - name of the country to file the data collection.
Output:
list or None. None implies could not find the countryName | [
"returns",
"a",
"list",
"of",
"available",
"data",
"collections",
"for",
"a",
"given",
"country",
"name",
"."
] | ab240fde2b0200f61d4a5f6df033516e53f2f416 | https://github.com/Esri/ArcREST/blob/ab240fde2b0200f61d4a5f6df033516e53f2f416/src/arcrest/enrichment/_geoenrichment.py#L83-L97 |
13,125 | Esri/ArcREST | src/arcrest/enrichment/_geoenrichment.py | GeoEnrichment.__geometryToDict | def __geometryToDict(self, geom):
"""converts a geometry object to a dictionary"""
if isinstance(geom, dict):
return geom
elif isinstance(geom, Point):
pt = geom.asDictionary
return {"geometry": {"x" : pt['x'], "y" : pt['y']}}
elif isinstance(geom, Pol... | python | def __geometryToDict(self, geom):
"""converts a geometry object to a dictionary"""
if isinstance(geom, dict):
return geom
elif isinstance(geom, Point):
pt = geom.asDictionary
return {"geometry": {"x" : pt['x'], "y" : pt['y']}}
elif isinstance(geom, Pol... | [
"def",
"__geometryToDict",
"(",
"self",
",",
"geom",
")",
":",
"if",
"isinstance",
"(",
"geom",
",",
"dict",
")",
":",
"return",
"geom",
"elif",
"isinstance",
"(",
"geom",
",",
"Point",
")",
":",
"pt",
"=",
"geom",
".",
"asDictionary",
"return",
"{",
... | converts a geometry object to a dictionary | [
"converts",
"a",
"geometry",
"object",
"to",
"a",
"dictionary"
] | ab240fde2b0200f61d4a5f6df033516e53f2f416 | https://github.com/Esri/ArcREST/blob/ab240fde2b0200f61d4a5f6df033516e53f2f416/src/arcrest/enrichment/_geoenrichment.py#L129-L145 |
13,126 | Esri/ArcREST | src/arcrest/enrichment/_geoenrichment.py | GeoEnrichment.lookUpReportsByCountry | def lookUpReportsByCountry(self, countryName):
"""
looks up a country by it's name
Inputs
countryName - name of the country to get reports list.
"""
code = self.findCountryTwoDigitCode(countryName)
if code is None:
raise Exception("Invalid country... | python | def lookUpReportsByCountry(self, countryName):
"""
looks up a country by it's name
Inputs
countryName - name of the country to get reports list.
"""
code = self.findCountryTwoDigitCode(countryName)
if code is None:
raise Exception("Invalid country... | [
"def",
"lookUpReportsByCountry",
"(",
"self",
",",
"countryName",
")",
":",
"code",
"=",
"self",
".",
"findCountryTwoDigitCode",
"(",
"countryName",
")",
"if",
"code",
"is",
"None",
":",
"raise",
"Exception",
"(",
"\"Invalid country name.\"",
")",
"url",
"=",
... | looks up a country by it's name
Inputs
countryName - name of the country to get reports list. | [
"looks",
"up",
"a",
"country",
"by",
"it",
"s",
"name",
"Inputs",
"countryName",
"-",
"name",
"of",
"the",
"country",
"to",
"get",
"reports",
"list",
"."
] | ab240fde2b0200f61d4a5f6df033516e53f2f416 | https://github.com/Esri/ArcREST/blob/ab240fde2b0200f61d4a5f6df033516e53f2f416/src/arcrest/enrichment/_geoenrichment.py#L147-L166 |
13,127 | Esri/ArcREST | src/arcrest/enrichment/_geoenrichment.py | GeoEnrichment.createReport | def createReport(self,
out_file_path,
studyAreas,
report=None,
format="PDF",
reportFields=None,
studyAreasOptions=None,
useData=None,
inSR=4326,
... | python | def createReport(self,
out_file_path,
studyAreas,
report=None,
format="PDF",
reportFields=None,
studyAreasOptions=None,
useData=None,
inSR=4326,
... | [
"def",
"createReport",
"(",
"self",
",",
"out_file_path",
",",
"studyAreas",
",",
"report",
"=",
"None",
",",
"format",
"=",
"\"PDF\"",
",",
"reportFields",
"=",
"None",
",",
"studyAreasOptions",
"=",
"None",
",",
"useData",
"=",
"None",
",",
"inSR",
"=",
... | The GeoEnrichment Create Report method uses the concept of a study
area to define the location of the point or area that you want to
enrich with generated reports. This method allows you to create
many types of high-quality reports for a variety of use cases
describing the input area. If... | [
"The",
"GeoEnrichment",
"Create",
"Report",
"method",
"uses",
"the",
"concept",
"of",
"a",
"study",
"area",
"to",
"define",
"the",
"location",
"of",
"the",
"point",
"or",
"area",
"that",
"you",
"want",
"to",
"enrich",
"with",
"generated",
"reports",
".",
"... | ab240fde2b0200f61d4a5f6df033516e53f2f416 | https://github.com/Esri/ArcREST/blob/ab240fde2b0200f61d4a5f6df033516e53f2f416/src/arcrest/enrichment/_geoenrichment.py#L293-L380 |
13,128 | Esri/ArcREST | src/arcrest/enrichment/_geoenrichment.py | GeoEnrichment.getVariables | def getVariables(self,
sourceCountry,
optionalCountryDataset=None,
searchText=None):
r"""
The GeoEnrichment GetVariables helper method allows you to search
the data collections for variables that contain specific keywords.
T... | python | def getVariables(self,
sourceCountry,
optionalCountryDataset=None,
searchText=None):
r"""
The GeoEnrichment GetVariables helper method allows you to search
the data collections for variables that contain specific keywords.
T... | [
"def",
"getVariables",
"(",
"self",
",",
"sourceCountry",
",",
"optionalCountryDataset",
"=",
"None",
",",
"searchText",
"=",
"None",
")",
":",
"url",
"=",
"self",
".",
"_base_url",
"+",
"self",
".",
"_url_getVariables",
"params",
"=",
"{",
"\"f\"",
":",
"... | r"""
The GeoEnrichment GetVariables helper method allows you to search
the data collections for variables that contain specific keywords.
To see the comprehensive set of global Esri Demographics data that
are available, use the interactive data browser:
http://resources.arcgis.c... | [
"r",
"The",
"GeoEnrichment",
"GetVariables",
"helper",
"method",
"allows",
"you",
"to",
"search",
"the",
"data",
"collections",
"for",
"variables",
"that",
"contain",
"specific",
"keywords",
"."
] | ab240fde2b0200f61d4a5f6df033516e53f2f416 | https://github.com/Esri/ArcREST/blob/ab240fde2b0200f61d4a5f6df033516e53f2f416/src/arcrest/enrichment/_geoenrichment.py#L445-L546 |
13,129 | Esri/ArcREST | src/arcrest/manageags/_services.py | Services.folders | def folders(self):
""" returns a list of all folders """
if self._folders is None:
self.__init()
if "/" not in self._folders:
self._folders.append("/")
return self._folders | python | def folders(self):
""" returns a list of all folders """
if self._folders is None:
self.__init()
if "/" not in self._folders:
self._folders.append("/")
return self._folders | [
"def",
"folders",
"(",
"self",
")",
":",
"if",
"self",
".",
"_folders",
"is",
"None",
":",
"self",
".",
"__init",
"(",
")",
"if",
"\"/\"",
"not",
"in",
"self",
".",
"_folders",
":",
"self",
".",
"_folders",
".",
"append",
"(",
"\"/\"",
")",
"return... | returns a list of all folders | [
"returns",
"a",
"list",
"of",
"all",
"folders"
] | ab240fde2b0200f61d4a5f6df033516e53f2f416 | https://github.com/Esri/ArcREST/blob/ab240fde2b0200f61d4a5f6df033516e53f2f416/src/arcrest/manageags/_services.py#L109-L115 |
13,130 | Esri/ArcREST | src/arcrest/manageags/_services.py | Services.services | def services(self):
""" returns the services in the current folder """
self._services = []
params = {
"f" : "json"
}
json_dict = self._get(url=self._currentURL,
param_dict=params,
securi... | python | def services(self):
""" returns the services in the current folder """
self._services = []
params = {
"f" : "json"
}
json_dict = self._get(url=self._currentURL,
param_dict=params,
securi... | [
"def",
"services",
"(",
"self",
")",
":",
"self",
".",
"_services",
"=",
"[",
"]",
"params",
"=",
"{",
"\"f\"",
":",
"\"json\"",
"}",
"json_dict",
"=",
"self",
".",
"_get",
"(",
"url",
"=",
"self",
".",
"_currentURL",
",",
"param_dict",
"=",
"params"... | returns the services in the current folder | [
"returns",
"the",
"services",
"in",
"the",
"current",
"folder"
] | ab240fde2b0200f61d4a5f6df033516e53f2f416 | https://github.com/Esri/ArcREST/blob/ab240fde2b0200f61d4a5f6df033516e53f2f416/src/arcrest/manageags/_services.py#L139-L159 |
13,131 | Esri/ArcREST | src/arcrest/manageags/_services.py | Services.createService | def createService(self, service):
"""
Creates a new GIS service in the folder. A service is created by
submitting a JSON representation of the service to this operation.
"""
url = self._url + "/createService"
params = {
"f" : "json"
}
if isinst... | python | def createService(self, service):
"""
Creates a new GIS service in the folder. A service is created by
submitting a JSON representation of the service to this operation.
"""
url = self._url + "/createService"
params = {
"f" : "json"
}
if isinst... | [
"def",
"createService",
"(",
"self",
",",
"service",
")",
":",
"url",
"=",
"self",
".",
"_url",
"+",
"\"/createService\"",
"params",
"=",
"{",
"\"f\"",
":",
"\"json\"",
"}",
"if",
"isinstance",
"(",
"service",
",",
"str",
")",
":",
"params",
"[",
"'ser... | Creates a new GIS service in the folder. A service is created by
submitting a JSON representation of the service to this operation. | [
"Creates",
"a",
"new",
"GIS",
"service",
"in",
"the",
"folder",
".",
"A",
"service",
"is",
"created",
"by",
"submitting",
"a",
"JSON",
"representation",
"of",
"the",
"service",
"to",
"this",
"operation",
"."
] | ab240fde2b0200f61d4a5f6df033516e53f2f416 | https://github.com/Esri/ArcREST/blob/ab240fde2b0200f61d4a5f6df033516e53f2f416/src/arcrest/manageags/_services.py#L401-L418 |
13,132 | Esri/ArcREST | src/arcrest/manageags/_services.py | Services.exists | def exists(self, folderName, serviceName=None, serviceType=None):
"""
This operation allows you to check whether a folder or a service
exists. To test if a folder exists, supply only a folderName. To
test if a service exists in a root folder, supply both serviceName
and serviceTy... | python | def exists(self, folderName, serviceName=None, serviceType=None):
"""
This operation allows you to check whether a folder or a service
exists. To test if a folder exists, supply only a folderName. To
test if a service exists in a root folder, supply both serviceName
and serviceTy... | [
"def",
"exists",
"(",
"self",
",",
"folderName",
",",
"serviceName",
"=",
"None",
",",
"serviceType",
"=",
"None",
")",
":",
"url",
"=",
"self",
".",
"_url",
"+",
"\"/exists\"",
"params",
"=",
"{",
"\"f\"",
":",
"\"json\"",
",",
"\"folderName\"",
":",
... | This operation allows you to check whether a folder or a service
exists. To test if a folder exists, supply only a folderName. To
test if a service exists in a root folder, supply both serviceName
and serviceType with folderName=None. To test if a service exists
in a folder, supply all t... | [
"This",
"operation",
"allows",
"you",
"to",
"check",
"whether",
"a",
"folder",
"or",
"a",
"service",
"exists",
".",
"To",
"test",
"if",
"a",
"folder",
"exists",
"supply",
"only",
"a",
"folderName",
".",
"To",
"test",
"if",
"a",
"service",
"exists",
"in",... | ab240fde2b0200f61d4a5f6df033516e53f2f416 | https://github.com/Esri/ArcREST/blob/ab240fde2b0200f61d4a5f6df033516e53f2f416/src/arcrest/manageags/_services.py#L524-L552 |
13,133 | Esri/ArcREST | src/arcrest/manageags/_services.py | AGSService.__init | def __init(self):
""" populates server admin information """
params = {
"f" : "json"
}
json_dict = self._get(url=self._currentURL,
param_dict=params,
securityHandler=self._securityHandler,
... | python | def __init(self):
""" populates server admin information """
params = {
"f" : "json"
}
json_dict = self._get(url=self._currentURL,
param_dict=params,
securityHandler=self._securityHandler,
... | [
"def",
"__init",
"(",
"self",
")",
":",
"params",
"=",
"{",
"\"f\"",
":",
"\"json\"",
"}",
"json_dict",
"=",
"self",
".",
"_get",
"(",
"url",
"=",
"self",
".",
"_currentURL",
",",
"param_dict",
"=",
"params",
",",
"securityHandler",
"=",
"self",
".",
... | populates server admin information | [
"populates",
"server",
"admin",
"information"
] | ab240fde2b0200f61d4a5f6df033516e53f2f416 | https://github.com/Esri/ArcREST/blob/ab240fde2b0200f61d4a5f6df033516e53f2f416/src/arcrest/manageags/_services.py#L615-L641 |
13,134 | Esri/ArcREST | src/arcrest/manageags/_services.py | AGSService.serviceManifest | def serviceManifest(self, fileType="json"):
"""
The service manifest resource documents the data and other
resources that define the service origins and power the service.
This resource will tell you underlying databases and their location
along with other supplementary files tha... | python | def serviceManifest(self, fileType="json"):
"""
The service manifest resource documents the data and other
resources that define the service origins and power the service.
This resource will tell you underlying databases and their location
along with other supplementary files tha... | [
"def",
"serviceManifest",
"(",
"self",
",",
"fileType",
"=",
"\"json\"",
")",
":",
"url",
"=",
"self",
".",
"_url",
"+",
"\"/iteminfo/manifest/manifest.%s\"",
"%",
"fileType",
"params",
"=",
"{",
"}",
"f",
"=",
"self",
".",
"_get",
"(",
"url",
"=",
"url"... | The service manifest resource documents the data and other
resources that define the service origins and power the service.
This resource will tell you underlying databases and their location
along with other supplementary files that make up the service.
Inputs:
fileType - th... | [
"The",
"service",
"manifest",
"resource",
"documents",
"the",
"data",
"and",
"other",
"resources",
"that",
"define",
"the",
"service",
"origins",
"and",
"power",
"the",
"service",
".",
"This",
"resource",
"will",
"tell",
"you",
"underlying",
"databases",
"and",
... | ab240fde2b0200f61d4a5f6df033516e53f2f416 | https://github.com/Esri/ArcREST/blob/ab240fde2b0200f61d4a5f6df033516e53f2f416/src/arcrest/manageags/_services.py#L1023-L1053 |
13,135 | Esri/ArcREST | src/arcrest/manageags/_data.py | Data.startDataStoreMachine | def startDataStoreMachine(self, dataStoreItemName, machineName):
"""
Starts the database instance running on the Data Store machine.
Inputs:
dataStoreItemName - name of the item to start
machineName - name of the machine to start on
"""
url = self._url + "/... | python | def startDataStoreMachine(self, dataStoreItemName, machineName):
"""
Starts the database instance running on the Data Store machine.
Inputs:
dataStoreItemName - name of the item to start
machineName - name of the machine to start on
"""
url = self._url + "/... | [
"def",
"startDataStoreMachine",
"(",
"self",
",",
"dataStoreItemName",
",",
"machineName",
")",
":",
"url",
"=",
"self",
".",
"_url",
"+",
"\"/items/enterpriseDatabases/%s/machines/%s/start\"",
"%",
"(",
"dataStoreItemName",
",",
"machineName",
")",
"params",
"=",
"... | Starts the database instance running on the Data Store machine.
Inputs:
dataStoreItemName - name of the item to start
machineName - name of the machine to start on | [
"Starts",
"the",
"database",
"instance",
"running",
"on",
"the",
"Data",
"Store",
"machine",
"."
] | ab240fde2b0200f61d4a5f6df033516e53f2f416 | https://github.com/Esri/ArcREST/blob/ab240fde2b0200f61d4a5f6df033516e53f2f416/src/arcrest/manageags/_data.py#L236-L251 |
13,136 | Esri/ArcREST | src/arcrest/manageags/_data.py | Data.unregisterDataItem | def unregisterDataItem(self, path):
"""
Unregisters a data item that has been previously registered with
the server's data store.
Inputs:
path - path to share folder
Example:
path = r"/fileShares/folder_share"
print data.unregisterDataItem(path)... | python | def unregisterDataItem(self, path):
"""
Unregisters a data item that has been previously registered with
the server's data store.
Inputs:
path - path to share folder
Example:
path = r"/fileShares/folder_share"
print data.unregisterDataItem(path)... | [
"def",
"unregisterDataItem",
"(",
"self",
",",
"path",
")",
":",
"url",
"=",
"self",
".",
"_url",
"+",
"\"/unregisterItem\"",
"params",
"=",
"{",
"\"f\"",
":",
"\"json\"",
",",
"\"itempath\"",
":",
"path",
",",
"\"force\"",
":",
"\"true\"",
"}",
"return",
... | Unregisters a data item that has been previously registered with
the server's data store.
Inputs:
path - path to share folder
Example:
path = r"/fileShares/folder_share"
print data.unregisterDataItem(path) | [
"Unregisters",
"a",
"data",
"item",
"that",
"has",
"been",
"previously",
"registered",
"with",
"the",
"server",
"s",
"data",
"store",
"."
] | ab240fde2b0200f61d4a5f6df033516e53f2f416 | https://github.com/Esri/ArcREST/blob/ab240fde2b0200f61d4a5f6df033516e53f2f416/src/arcrest/manageags/_data.py#L270-L291 |
13,137 | Esri/ArcREST | src/arcrest/manageags/_data.py | Data.validateDataStore | def validateDataStore(self, dataStoreName, machineName):
"""
Checks the status of ArcGIS Data Store and provides a health check
response.
Inputs:
dataStoreName - name of the datastore
machineName - name of the machine
"""
url = self._url + "/items/e... | python | def validateDataStore(self, dataStoreName, machineName):
"""
Checks the status of ArcGIS Data Store and provides a health check
response.
Inputs:
dataStoreName - name of the datastore
machineName - name of the machine
"""
url = self._url + "/items/e... | [
"def",
"validateDataStore",
"(",
"self",
",",
"dataStoreName",
",",
"machineName",
")",
":",
"url",
"=",
"self",
".",
"_url",
"+",
"\"/items/enterpriseDatabases/%s/machines/%s/validate\"",
"%",
"(",
"dataStoreName",
",",
"machineName",
")",
"params",
"=",
"{",
"\"... | Checks the status of ArcGIS Data Store and provides a health check
response.
Inputs:
dataStoreName - name of the datastore
machineName - name of the machine | [
"Checks",
"the",
"status",
"of",
"ArcGIS",
"Data",
"Store",
"and",
"provides",
"a",
"health",
"check",
"response",
"."
] | ab240fde2b0200f61d4a5f6df033516e53f2f416 | https://github.com/Esri/ArcREST/blob/ab240fde2b0200f61d4a5f6df033516e53f2f416/src/arcrest/manageags/_data.py#L293-L310 |
13,138 | Esri/ArcREST | src/arcrest/ags/_globeservice.py | GlobeService.layers | def layers(self):
"""gets the globe service layers"""
if self._layers is None:
self.__init()
lyrs = []
for lyr in self._layers:
lyr['object'] = GlobeServiceLayer(url=self._url + "/%s" % lyr['id'],
securityHandler=self.... | python | def layers(self):
"""gets the globe service layers"""
if self._layers is None:
self.__init()
lyrs = []
for lyr in self._layers:
lyr['object'] = GlobeServiceLayer(url=self._url + "/%s" % lyr['id'],
securityHandler=self.... | [
"def",
"layers",
"(",
"self",
")",
":",
"if",
"self",
".",
"_layers",
"is",
"None",
":",
"self",
".",
"__init",
"(",
")",
"lyrs",
"=",
"[",
"]",
"for",
"lyr",
"in",
"self",
".",
"_layers",
":",
"lyr",
"[",
"'object'",
"]",
"=",
"GlobeServiceLayer",... | gets the globe service layers | [
"gets",
"the",
"globe",
"service",
"layers"
] | ab240fde2b0200f61d4a5f6df033516e53f2f416 | https://github.com/Esri/ArcREST/blob/ab240fde2b0200f61d4a5f6df033516e53f2f416/src/arcrest/ags/_globeservice.py#L288-L300 |
13,139 | Esri/ArcREST | src/arcrest/ags/_gpobjects.py | GPFeatureRecordSetLayer.loadFeatures | def loadFeatures(self, path_to_fc):
"""
loads a feature class features to the object
"""
from ..common.spatial import featureclass_to_json
v = json.loads(featureclass_to_json(path_to_fc))
self.value = v | python | def loadFeatures(self, path_to_fc):
"""
loads a feature class features to the object
"""
from ..common.spatial import featureclass_to_json
v = json.loads(featureclass_to_json(path_to_fc))
self.value = v | [
"def",
"loadFeatures",
"(",
"self",
",",
"path_to_fc",
")",
":",
"from",
".",
".",
"common",
".",
"spatial",
"import",
"featureclass_to_json",
"v",
"=",
"json",
".",
"loads",
"(",
"featureclass_to_json",
"(",
"path_to_fc",
")",
")",
"self",
".",
"value",
"... | loads a feature class features to the object | [
"loads",
"a",
"feature",
"class",
"features",
"to",
"the",
"object"
] | ab240fde2b0200f61d4a5f6df033516e53f2f416 | https://github.com/Esri/ArcREST/blob/ab240fde2b0200f61d4a5f6df033516e53f2f416/src/arcrest/ags/_gpobjects.py#L184-L190 |
13,140 | Esri/ArcREST | src/arcrest/ags/_gpobjects.py | GPFeatureRecordSetLayer.fromFeatureClass | def fromFeatureClass(fc, paramName):
"""
returns a GPFeatureRecordSetLayer object from a feature class
Input:
fc - path to a feature class
paramName - name of the parameter
"""
from ..common.spatial import featureclass_to_json
val = json.loads(featu... | python | def fromFeatureClass(fc, paramName):
"""
returns a GPFeatureRecordSetLayer object from a feature class
Input:
fc - path to a feature class
paramName - name of the parameter
"""
from ..common.spatial import featureclass_to_json
val = json.loads(featu... | [
"def",
"fromFeatureClass",
"(",
"fc",
",",
"paramName",
")",
":",
"from",
".",
".",
"common",
".",
"spatial",
"import",
"featureclass_to_json",
"val",
"=",
"json",
".",
"loads",
"(",
"featureclass_to_json",
"(",
"fc",
")",
")",
"v",
"=",
"GPFeatureRecordSetL... | returns a GPFeatureRecordSetLayer object from a feature class
Input:
fc - path to a feature class
paramName - name of the parameter | [
"returns",
"a",
"GPFeatureRecordSetLayer",
"object",
"from",
"a",
"feature",
"class"
] | ab240fde2b0200f61d4a5f6df033516e53f2f416 | https://github.com/Esri/ArcREST/blob/ab240fde2b0200f61d4a5f6df033516e53f2f416/src/arcrest/ags/_gpobjects.py#L207-L220 |
13,141 | Esri/ArcREST | src/arcrest/webmap/renderer.py | SimpleRenderer.asDictionary | def asDictionary(self):
""" provides a dictionary representation of the object """
template = {
"type" : "simple",
"symbol" : self._symbol.asDictionary,
"label" : self._label,
"description" : self._description,
"rotationType": self._rotationTy... | python | def asDictionary(self):
""" provides a dictionary representation of the object """
template = {
"type" : "simple",
"symbol" : self._symbol.asDictionary,
"label" : self._label,
"description" : self._description,
"rotationType": self._rotationTy... | [
"def",
"asDictionary",
"(",
"self",
")",
":",
"template",
"=",
"{",
"\"type\"",
":",
"\"simple\"",
",",
"\"symbol\"",
":",
"self",
".",
"_symbol",
".",
"asDictionary",
",",
"\"label\"",
":",
"self",
".",
"_label",
",",
"\"description\"",
":",
"self",
".",
... | provides a dictionary representation of the object | [
"provides",
"a",
"dictionary",
"representation",
"of",
"the",
"object"
] | ab240fde2b0200f61d4a5f6df033516e53f2f416 | https://github.com/Esri/ArcREST/blob/ab240fde2b0200f61d4a5f6df033516e53f2f416/src/arcrest/webmap/renderer.py#L32-L42 |
13,142 | Esri/ArcREST | src/arcrest/ags/_schematicsservice.py | SchematicsService.searchDiagrams | def searchDiagrams(self,whereClause=None,relatedObjects=None,
relatedSchematicObjects=None):
"""
The Schematic Search Diagrams operation is performed on the schematic
service resource. The result of this operation is an array of Schematic
Diagram Information Object... | python | def searchDiagrams(self,whereClause=None,relatedObjects=None,
relatedSchematicObjects=None):
"""
The Schematic Search Diagrams operation is performed on the schematic
service resource. The result of this operation is an array of Schematic
Diagram Information Object... | [
"def",
"searchDiagrams",
"(",
"self",
",",
"whereClause",
"=",
"None",
",",
"relatedObjects",
"=",
"None",
",",
"relatedSchematicObjects",
"=",
"None",
")",
":",
"params",
"=",
"{",
"\"f\"",
":",
"\"json\"",
"}",
"if",
"whereClause",
":",
"params",
"[",
"\... | The Schematic Search Diagrams operation is performed on the schematic
service resource. The result of this operation is an array of Schematic
Diagram Information Object.
It is used to search diagrams in the schematic service by criteria;
that is, diagrams filtered out via a where clause... | [
"The",
"Schematic",
"Search",
"Diagrams",
"operation",
"is",
"performed",
"on",
"the",
"schematic",
"service",
"resource",
".",
"The",
"result",
"of",
"this",
"operation",
"is",
"an",
"array",
"of",
"Schematic",
"Diagram",
"Information",
"Object",
"."
] | ab240fde2b0200f61d4a5f6df033516e53f2f416 | https://github.com/Esri/ArcREST/blob/ab240fde2b0200f61d4a5f6df033516e53f2f416/src/arcrest/ags/_schematicsservice.py#L166-L216 |
13,143 | Esri/ArcREST | src/arcrest/ags/server.py | Server._validateurl | def _validateurl(self, url):
"""assembles the server url"""
parsed = urlparse(url)
path = parsed.path.strip("/")
if path:
parts = path.split("/")
url_types = ("admin", "manager", "rest")
if any(i in parts for i in url_types):
while part... | python | def _validateurl(self, url):
"""assembles the server url"""
parsed = urlparse(url)
path = parsed.path.strip("/")
if path:
parts = path.split("/")
url_types = ("admin", "manager", "rest")
if any(i in parts for i in url_types):
while part... | [
"def",
"_validateurl",
"(",
"self",
",",
"url",
")",
":",
"parsed",
"=",
"urlparse",
"(",
"url",
")",
"path",
"=",
"parsed",
".",
"path",
".",
"strip",
"(",
"\"/\"",
")",
"if",
"path",
":",
"parts",
"=",
"path",
".",
"split",
"(",
"\"/\"",
")",
"... | assembles the server url | [
"assembles",
"the",
"server",
"url"
] | ab240fde2b0200f61d4a5f6df033516e53f2f416 | https://github.com/Esri/ArcREST/blob/ab240fde2b0200f61d4a5f6df033516e53f2f416/src/arcrest/ags/server.py#L57-L74 |
13,144 | Esri/ArcREST | src/arcrest/ags/server.py | Server.admin | def admin(self):
"""points to the adminstrative side of ArcGIS Server"""
if self._securityHandler is None:
raise Exception("Cannot connect to adminstrative server without authentication")
from ..manageags import AGSAdministration
return AGSAdministration(url=self._adminUrl,
... | python | def admin(self):
"""points to the adminstrative side of ArcGIS Server"""
if self._securityHandler is None:
raise Exception("Cannot connect to adminstrative server without authentication")
from ..manageags import AGSAdministration
return AGSAdministration(url=self._adminUrl,
... | [
"def",
"admin",
"(",
"self",
")",
":",
"if",
"self",
".",
"_securityHandler",
"is",
"None",
":",
"raise",
"Exception",
"(",
"\"Cannot connect to adminstrative server without authentication\"",
")",
"from",
".",
".",
"manageags",
"import",
"AGSAdministration",
"return"... | points to the adminstrative side of ArcGIS Server | [
"points",
"to",
"the",
"adminstrative",
"side",
"of",
"ArcGIS",
"Server"
] | ab240fde2b0200f61d4a5f6df033516e53f2f416 | https://github.com/Esri/ArcREST/blob/ab240fde2b0200f61d4a5f6df033516e53f2f416/src/arcrest/ags/server.py#L118-L127 |
13,145 | Esri/ArcREST | src/arcrest/manageorg/_parameters.py | InvitationList.addUser | def addUser(self, username, password,
firstname, lastname,
email, role):
"""adds a user to the invitation list"""
self._invites.append({
"username":username,
"password":password,
"firstname":firstname,
"lastname":lastname,
... | python | def addUser(self, username, password,
firstname, lastname,
email, role):
"""adds a user to the invitation list"""
self._invites.append({
"username":username,
"password":password,
"firstname":firstname,
"lastname":lastname,
... | [
"def",
"addUser",
"(",
"self",
",",
"username",
",",
"password",
",",
"firstname",
",",
"lastname",
",",
"email",
",",
"role",
")",
":",
"self",
".",
"_invites",
".",
"append",
"(",
"{",
"\"username\"",
":",
"username",
",",
"\"password\"",
":",
"passwor... | adds a user to the invitation list | [
"adds",
"a",
"user",
"to",
"the",
"invitation",
"list"
] | ab240fde2b0200f61d4a5f6df033516e53f2f416 | https://github.com/Esri/ArcREST/blob/ab240fde2b0200f61d4a5f6df033516e53f2f416/src/arcrest/manageorg/_parameters.py#L17-L29 |
13,146 | Esri/ArcREST | src/arcrest/manageorg/_parameters.py | InvitationList.removeByIndex | def removeByIndex(self, index):
"""removes a user from the invitation list by position"""
if index < len(self._invites) -1 and \
index >=0:
self._invites.remove(index) | python | def removeByIndex(self, index):
"""removes a user from the invitation list by position"""
if index < len(self._invites) -1 and \
index >=0:
self._invites.remove(index) | [
"def",
"removeByIndex",
"(",
"self",
",",
"index",
")",
":",
"if",
"index",
"<",
"len",
"(",
"self",
".",
"_invites",
")",
"-",
"1",
"and",
"index",
">=",
"0",
":",
"self",
".",
"_invites",
".",
"remove",
"(",
"index",
")"
] | removes a user from the invitation list by position | [
"removes",
"a",
"user",
"from",
"the",
"invitation",
"list",
"by",
"position"
] | ab240fde2b0200f61d4a5f6df033516e53f2f416 | https://github.com/Esri/ArcREST/blob/ab240fde2b0200f61d4a5f6df033516e53f2f416/src/arcrest/manageorg/_parameters.py#L31-L35 |
13,147 | Esri/ArcREST | src/arcrest/manageorg/_parameters.py | PortalParameters.fromDictionary | def fromDictionary(value):
"""creates the portal properties object from a dictionary"""
if isinstance(value, dict):
pp = PortalParameters()
for k,v in value.items():
setattr(pp, "_%s" % k, v)
return pp
else:
raise AttributeError("In... | python | def fromDictionary(value):
"""creates the portal properties object from a dictionary"""
if isinstance(value, dict):
pp = PortalParameters()
for k,v in value.items():
setattr(pp, "_%s" % k, v)
return pp
else:
raise AttributeError("In... | [
"def",
"fromDictionary",
"(",
"value",
")",
":",
"if",
"isinstance",
"(",
"value",
",",
"dict",
")",
":",
"pp",
"=",
"PortalParameters",
"(",
")",
"for",
"k",
",",
"v",
"in",
"value",
".",
"items",
"(",
")",
":",
"setattr",
"(",
"pp",
",",
"\"_%s\"... | creates the portal properties object from a dictionary | [
"creates",
"the",
"portal",
"properties",
"object",
"from",
"a",
"dictionary"
] | ab240fde2b0200f61d4a5f6df033516e53f2f416 | https://github.com/Esri/ArcREST/blob/ab240fde2b0200f61d4a5f6df033516e53f2f416/src/arcrest/manageorg/_parameters.py#L434-L442 |
13,148 | Esri/ArcREST | src/arcrest/manageorg/_parameters.py | PublishCSVParameters.value | def value(self):
"""returns the values as a dictionary"""
val = {}
for k in self.__allowed_keys:
value = getattr(self, "_" + k)
if value is not None:
val[k] = value
return val | python | def value(self):
"""returns the values as a dictionary"""
val = {}
for k in self.__allowed_keys:
value = getattr(self, "_" + k)
if value is not None:
val[k] = value
return val | [
"def",
"value",
"(",
"self",
")",
":",
"val",
"=",
"{",
"}",
"for",
"k",
"in",
"self",
".",
"__allowed_keys",
":",
"value",
"=",
"getattr",
"(",
"self",
",",
"\"_\"",
"+",
"k",
")",
"if",
"value",
"is",
"not",
"None",
":",
"val",
"[",
"k",
"]",... | returns the values as a dictionary | [
"returns",
"the",
"values",
"as",
"a",
"dictionary"
] | ab240fde2b0200f61d4a5f6df033516e53f2f416 | https://github.com/Esri/ArcREST/blob/ab240fde2b0200f61d4a5f6df033516e53f2f416/src/arcrest/manageorg/_parameters.py#L1775-L1782 |
13,149 | Esri/ArcREST | src/arcrest/ags/_vectortile.py | VectorTileService.tile_fonts | def tile_fonts(self, fontstack, stack_range, out_folder=None):
"""This resource returns glyphs in PBF format. The template url for
this fonts resource is represented in Vector Tile Style resource."""
url = "{url}/resources/fonts/{fontstack}/{stack_range}.pbf".format(
url=self._url,
... | python | def tile_fonts(self, fontstack, stack_range, out_folder=None):
"""This resource returns glyphs in PBF format. The template url for
this fonts resource is represented in Vector Tile Style resource."""
url = "{url}/resources/fonts/{fontstack}/{stack_range}.pbf".format(
url=self._url,
... | [
"def",
"tile_fonts",
"(",
"self",
",",
"fontstack",
",",
"stack_range",
",",
"out_folder",
"=",
"None",
")",
":",
"url",
"=",
"\"{url}/resources/fonts/{fontstack}/{stack_range}.pbf\"",
".",
"format",
"(",
"url",
"=",
"self",
".",
"_url",
",",
"fontstack",
"=",
... | This resource returns glyphs in PBF format. The template url for
this fonts resource is represented in Vector Tile Style resource. | [
"This",
"resource",
"returns",
"glyphs",
"in",
"PBF",
"format",
".",
"The",
"template",
"url",
"for",
"this",
"fonts",
"resource",
"is",
"represented",
"in",
"Vector",
"Tile",
"Style",
"resource",
"."
] | ab240fde2b0200f61d4a5f6df033516e53f2f416 | https://github.com/Esri/ArcREST/blob/ab240fde2b0200f61d4a5f6df033516e53f2f416/src/arcrest/ags/_vectortile.py#L190-L205 |
13,150 | Esri/ArcREST | src/arcrest/ags/_vectortile.py | VectorTileService.tile_sprite | def tile_sprite(self, out_format="sprite.json", out_folder=None):
"""
This resource returns sprite image and metadata
"""
url = "{url}/resources/sprites/{f}".format(url=self._url,
f=out_format)
if out_folder is None:
... | python | def tile_sprite(self, out_format="sprite.json", out_folder=None):
"""
This resource returns sprite image and metadata
"""
url = "{url}/resources/sprites/{f}".format(url=self._url,
f=out_format)
if out_folder is None:
... | [
"def",
"tile_sprite",
"(",
"self",
",",
"out_format",
"=",
"\"sprite.json\"",
",",
"out_folder",
"=",
"None",
")",
":",
"url",
"=",
"\"{url}/resources/sprites/{f}\"",
".",
"format",
"(",
"url",
"=",
"self",
".",
"_url",
",",
"f",
"=",
"out_format",
")",
"i... | This resource returns sprite image and metadata | [
"This",
"resource",
"returns",
"sprite",
"image",
"and",
"metadata"
] | ab240fde2b0200f61d4a5f6df033516e53f2f416 | https://github.com/Esri/ArcREST/blob/ab240fde2b0200f61d4a5f6df033516e53f2f416/src/arcrest/ags/_vectortile.py#L226-L239 |
13,151 | Esri/ArcREST | src/arcrest/ags/services.py | FeatureService.layers | def layers(self):
""" gets the layers for the feature service """
if self._layers is None:
self.__init()
self._getLayers()
return self._layers | python | def layers(self):
""" gets the layers for the feature service """
if self._layers is None:
self.__init()
self._getLayers()
return self._layers | [
"def",
"layers",
"(",
"self",
")",
":",
"if",
"self",
".",
"_layers",
"is",
"None",
":",
"self",
".",
"__init",
"(",
")",
"self",
".",
"_getLayers",
"(",
")",
"return",
"self",
".",
"_layers"
] | gets the layers for the feature service | [
"gets",
"the",
"layers",
"for",
"the",
"feature",
"service"
] | ab240fde2b0200f61d4a5f6df033516e53f2f416 | https://github.com/Esri/ArcREST/blob/ab240fde2b0200f61d4a5f6df033516e53f2f416/src/arcrest/ags/services.py#L264-L269 |
13,152 | Esri/ArcREST | src/arcrest/ags/services.py | FeatureService._getLayers | def _getLayers(self):
""" gets layers for the featuer service """
params = {"f": "json"}
json_dict = self._get(self._url, params,
securityHandler=self._securityHandler,
proxy_url=self._proxy_url,
... | python | def _getLayers(self):
""" gets layers for the featuer service """
params = {"f": "json"}
json_dict = self._get(self._url, params,
securityHandler=self._securityHandler,
proxy_url=self._proxy_url,
... | [
"def",
"_getLayers",
"(",
"self",
")",
":",
"params",
"=",
"{",
"\"f\"",
":",
"\"json\"",
"}",
"json_dict",
"=",
"self",
".",
"_get",
"(",
"self",
".",
"_url",
",",
"params",
",",
"securityHandler",
"=",
"self",
".",
"_securityHandler",
",",
"proxy_url",... | gets layers for the featuer service | [
"gets",
"layers",
"for",
"the",
"featuer",
"service"
] | ab240fde2b0200f61d4a5f6df033516e53f2f416 | https://github.com/Esri/ArcREST/blob/ab240fde2b0200f61d4a5f6df033516e53f2f416/src/arcrest/ags/services.py#L271-L287 |
13,153 | Esri/ArcREST | src/arcrest/ags/services.py | FeatureService.query | def query(self,
layerDefsFilter=None,
geometryFilter=None,
timeFilter=None,
returnGeometry=True,
returnIdsOnly=False,
returnCountOnly=False,
returnZ=False,
returnM=False,
outSR=None
... | python | def query(self,
layerDefsFilter=None,
geometryFilter=None,
timeFilter=None,
returnGeometry=True,
returnIdsOnly=False,
returnCountOnly=False,
returnZ=False,
returnM=False,
outSR=None
... | [
"def",
"query",
"(",
"self",
",",
"layerDefsFilter",
"=",
"None",
",",
"geometryFilter",
"=",
"None",
",",
"timeFilter",
"=",
"None",
",",
"returnGeometry",
"=",
"True",
",",
"returnIdsOnly",
"=",
"False",
",",
"returnCountOnly",
"=",
"False",
",",
"returnZ"... | The Query operation is performed on a feature service resource | [
"The",
"Query",
"operation",
"is",
"performed",
"on",
"a",
"feature",
"service",
"resource"
] | ab240fde2b0200f61d4a5f6df033516e53f2f416 | https://github.com/Esri/ArcREST/blob/ab240fde2b0200f61d4a5f6df033516e53f2f416/src/arcrest/ags/services.py#L346-L397 |
13,154 | Esri/ArcREST | src/arcrest/common/spatial.py | create_feature_layer | def create_feature_layer(ds, sql, name="layer"):
""" creates a feature layer object """
if arcpyFound == False:
raise Exception("ArcPy is required to use this function")
result = arcpy.MakeFeatureLayer_management(in_features=ds,
out_layer=name,
... | python | def create_feature_layer(ds, sql, name="layer"):
""" creates a feature layer object """
if arcpyFound == False:
raise Exception("ArcPy is required to use this function")
result = arcpy.MakeFeatureLayer_management(in_features=ds,
out_layer=name,
... | [
"def",
"create_feature_layer",
"(",
"ds",
",",
"sql",
",",
"name",
"=",
"\"layer\"",
")",
":",
"if",
"arcpyFound",
"==",
"False",
":",
"raise",
"Exception",
"(",
"\"ArcPy is required to use this function\"",
")",
"result",
"=",
"arcpy",
".",
"MakeFeatureLayer_mana... | creates a feature layer object | [
"creates",
"a",
"feature",
"layer",
"object"
] | ab240fde2b0200f61d4a5f6df033516e53f2f416 | https://github.com/Esri/ArcREST/blob/ab240fde2b0200f61d4a5f6df033516e53f2f416/src/arcrest/common/spatial.py#L16-L23 |
13,155 | Esri/ArcREST | src/arcrest/common/spatial.py | featureclass_to_json | def featureclass_to_json(fc):
"""converts a feature class to JSON"""
if arcpyFound == False:
raise Exception("ArcPy is required to use this function")
desc = arcpy.Describe(fc)
if desc.dataType == "Table" or desc.dataType == "TableView":
return recordset_to_json(table=fc)
else:
... | python | def featureclass_to_json(fc):
"""converts a feature class to JSON"""
if arcpyFound == False:
raise Exception("ArcPy is required to use this function")
desc = arcpy.Describe(fc)
if desc.dataType == "Table" or desc.dataType == "TableView":
return recordset_to_json(table=fc)
else:
... | [
"def",
"featureclass_to_json",
"(",
"fc",
")",
":",
"if",
"arcpyFound",
"==",
"False",
":",
"raise",
"Exception",
"(",
"\"ArcPy is required to use this function\"",
")",
"desc",
"=",
"arcpy",
".",
"Describe",
"(",
"fc",
")",
"if",
"desc",
".",
"dataType",
"=="... | converts a feature class to JSON | [
"converts",
"a",
"feature",
"class",
"to",
"JSON"
] | ab240fde2b0200f61d4a5f6df033516e53f2f416 | https://github.com/Esri/ArcREST/blob/ab240fde2b0200f61d4a5f6df033516e53f2f416/src/arcrest/common/spatial.py#L25-L33 |
13,156 | Esri/ArcREST | src/arcrest/common/spatial.py | get_attachment_data | def get_attachment_data(attachmentTable, sql,
nameField="ATT_NAME", blobField="DATA",
contentTypeField="CONTENT_TYPE",
rel_object_field="REL_OBJECTID"):
""" gets all the data to pass to a feature service """
if arcpyFound == False:
... | python | def get_attachment_data(attachmentTable, sql,
nameField="ATT_NAME", blobField="DATA",
contentTypeField="CONTENT_TYPE",
rel_object_field="REL_OBJECTID"):
""" gets all the data to pass to a feature service """
if arcpyFound == False:
... | [
"def",
"get_attachment_data",
"(",
"attachmentTable",
",",
"sql",
",",
"nameField",
"=",
"\"ATT_NAME\"",
",",
"blobField",
"=",
"\"DATA\"",
",",
"contentTypeField",
"=",
"\"CONTENT_TYPE\"",
",",
"rel_object_field",
"=",
"\"REL_OBJECTID\"",
")",
":",
"if",
"arcpyFoun... | gets all the data to pass to a feature service | [
"gets",
"all",
"the",
"data",
"to",
"pass",
"to",
"a",
"feature",
"service"
] | ab240fde2b0200f61d4a5f6df033516e53f2f416 | https://github.com/Esri/ArcREST/blob/ab240fde2b0200f61d4a5f6df033516e53f2f416/src/arcrest/common/spatial.py#L54-L82 |
13,157 | Esri/ArcREST | src/arcrest/common/spatial.py | get_records_with_attachments | def get_records_with_attachments(attachment_table, rel_object_field="REL_OBJECTID"):
"""returns a list of ObjectIDs for rows in the attachment table"""
if arcpyFound == False:
raise Exception("ArcPy is required to use this function")
OIDs = []
with arcpy.da.SearchCursor(attachment_table,
... | python | def get_records_with_attachments(attachment_table, rel_object_field="REL_OBJECTID"):
"""returns a list of ObjectIDs for rows in the attachment table"""
if arcpyFound == False:
raise Exception("ArcPy is required to use this function")
OIDs = []
with arcpy.da.SearchCursor(attachment_table,
... | [
"def",
"get_records_with_attachments",
"(",
"attachment_table",
",",
"rel_object_field",
"=",
"\"REL_OBJECTID\"",
")",
":",
"if",
"arcpyFound",
"==",
"False",
":",
"raise",
"Exception",
"(",
"\"ArcPy is required to use this function\"",
")",
"OIDs",
"=",
"[",
"]",
"wi... | returns a list of ObjectIDs for rows in the attachment table | [
"returns",
"a",
"list",
"of",
"ObjectIDs",
"for",
"rows",
"in",
"the",
"attachment",
"table"
] | ab240fde2b0200f61d4a5f6df033516e53f2f416 | https://github.com/Esri/ArcREST/blob/ab240fde2b0200f61d4a5f6df033516e53f2f416/src/arcrest/common/spatial.py#L84-L96 |
13,158 | Esri/ArcREST | src/arcrest/common/spatial.py | get_OID_field | def get_OID_field(fs):
"""returns a featureset's object id field"""
if arcpyFound == False:
raise Exception("ArcPy is required to use this function")
desc = arcpy.Describe(fs)
if desc.hasOID:
return desc.OIDFieldName
return None | python | def get_OID_field(fs):
"""returns a featureset's object id field"""
if arcpyFound == False:
raise Exception("ArcPy is required to use this function")
desc = arcpy.Describe(fs)
if desc.hasOID:
return desc.OIDFieldName
return None | [
"def",
"get_OID_field",
"(",
"fs",
")",
":",
"if",
"arcpyFound",
"==",
"False",
":",
"raise",
"Exception",
"(",
"\"ArcPy is required to use this function\"",
")",
"desc",
"=",
"arcpy",
".",
"Describe",
"(",
"fs",
")",
"if",
"desc",
".",
"hasOID",
":",
"retur... | returns a featureset's object id field | [
"returns",
"a",
"featureset",
"s",
"object",
"id",
"field"
] | ab240fde2b0200f61d4a5f6df033516e53f2f416 | https://github.com/Esri/ArcREST/blob/ab240fde2b0200f61d4a5f6df033516e53f2f416/src/arcrest/common/spatial.py#L98-L105 |
13,159 | Esri/ArcREST | src/arcrest/common/spatial.py | merge_feature_class | def merge_feature_class(merges, out_fc, cleanUp=True):
""" merges featureclass into a single feature class """
if arcpyFound == False:
raise Exception("ArcPy is required to use this function")
if cleanUp == False:
if len(merges) == 0:
return None
elif len(merges) == 1:
... | python | def merge_feature_class(merges, out_fc, cleanUp=True):
""" merges featureclass into a single feature class """
if arcpyFound == False:
raise Exception("ArcPy is required to use this function")
if cleanUp == False:
if len(merges) == 0:
return None
elif len(merges) == 1:
... | [
"def",
"merge_feature_class",
"(",
"merges",
",",
"out_fc",
",",
"cleanUp",
"=",
"True",
")",
":",
"if",
"arcpyFound",
"==",
"False",
":",
"raise",
"Exception",
"(",
"\"ArcPy is required to use this function\"",
")",
"if",
"cleanUp",
"==",
"False",
":",
"if",
... | merges featureclass into a single feature class | [
"merges",
"featureclass",
"into",
"a",
"single",
"feature",
"class"
] | ab240fde2b0200f61d4a5f6df033516e53f2f416 | https://github.com/Esri/ArcREST/blob/ab240fde2b0200f61d4a5f6df033516e53f2f416/src/arcrest/common/spatial.py#L107-L138 |
13,160 | Esri/ArcREST | src/arcrest/common/spatial.py | insert_rows | def insert_rows(fc,
features,
fields,
includeOIDField=False,
oidField=None):
""" inserts rows based on a list features object """
if arcpyFound == False:
raise Exception("ArcPy is required to use this function")
icur = None
if inclu... | python | def insert_rows(fc,
features,
fields,
includeOIDField=False,
oidField=None):
""" inserts rows based on a list features object """
if arcpyFound == False:
raise Exception("ArcPy is required to use this function")
icur = None
if inclu... | [
"def",
"insert_rows",
"(",
"fc",
",",
"features",
",",
"fields",
",",
"includeOIDField",
"=",
"False",
",",
"oidField",
"=",
"None",
")",
":",
"if",
"arcpyFound",
"==",
"False",
":",
"raise",
"Exception",
"(",
"\"ArcPy is required to use this function\"",
")",
... | inserts rows based on a list features object | [
"inserts",
"rows",
"based",
"on",
"a",
"list",
"features",
"object"
] | ab240fde2b0200f61d4a5f6df033516e53f2f416 | https://github.com/Esri/ArcREST/blob/ab240fde2b0200f61d4a5f6df033516e53f2f416/src/arcrest/common/spatial.py#L164-L208 |
13,161 | Esri/ArcREST | src/arcrest/common/spatial.py | create_feature_class | def create_feature_class(out_path,
out_name,
geom_type,
wkid,
fields,
objectIdField):
""" creates a feature class in a given gdb or folder """
if arcpyFound == False:
raise Except... | python | def create_feature_class(out_path,
out_name,
geom_type,
wkid,
fields,
objectIdField):
""" creates a feature class in a given gdb or folder """
if arcpyFound == False:
raise Except... | [
"def",
"create_feature_class",
"(",
"out_path",
",",
"out_name",
",",
"geom_type",
",",
"wkid",
",",
"fields",
",",
"objectIdField",
")",
":",
"if",
"arcpyFound",
"==",
"False",
":",
"raise",
"Exception",
"(",
"\"ArcPy is required to use this function\"",
")",
"ar... | creates a feature class in a given gdb or folder | [
"creates",
"a",
"feature",
"class",
"in",
"a",
"given",
"gdb",
"or",
"folder"
] | ab240fde2b0200f61d4a5f6df033516e53f2f416 | https://github.com/Esri/ArcREST/blob/ab240fde2b0200f61d4a5f6df033516e53f2f416/src/arcrest/common/spatial.py#L210-L231 |
13,162 | Esri/ArcREST | ArcGIS Desktop Installer/Install_ArcRest/Tools/Scripts/install_arcrest.py | download_arcrest | def download_arcrest():
"""downloads arcrest to disk"""
arcrest_name = "arcrest.zip"
arcresthelper_name = "arcresthelper.zip"
url = "https://github.com/Esri/ArcREST/archive/master.zip"
file_name = os.path.join(arcpy.env.scratchFolder, os.path.basename(url))
scratch_folder = os.path.join(arcpy.e... | python | def download_arcrest():
"""downloads arcrest to disk"""
arcrest_name = "arcrest.zip"
arcresthelper_name = "arcresthelper.zip"
url = "https://github.com/Esri/ArcREST/archive/master.zip"
file_name = os.path.join(arcpy.env.scratchFolder, os.path.basename(url))
scratch_folder = os.path.join(arcpy.e... | [
"def",
"download_arcrest",
"(",
")",
":",
"arcrest_name",
"=",
"\"arcrest.zip\"",
"arcresthelper_name",
"=",
"\"arcresthelper.zip\"",
"url",
"=",
"\"https://github.com/Esri/ArcREST/archive/master.zip\"",
"file_name",
"=",
"os",
".",
"path",
".",
"join",
"(",
"arcpy",
".... | downloads arcrest to disk | [
"downloads",
"arcrest",
"to",
"disk"
] | ab240fde2b0200f61d4a5f6df033516e53f2f416 | https://github.com/Esri/ArcREST/blob/ab240fde2b0200f61d4a5f6df033516e53f2f416/ArcGIS Desktop Installer/Install_ArcRest/Tools/Scripts/install_arcrest.py#L36-L68 |
13,163 | Esri/ArcREST | src/arcrest/security/security.py | NTLMSecurityHandler.handler | def handler(self):
"""gets the security handler for the class"""
if hasNTLM:
if self._handler is None:
passman = request.HTTPPasswordMgrWithDefaultRealm()
passman.add_password(None, self._parsed_org_url, self._login_username, self._password)
se... | python | def handler(self):
"""gets the security handler for the class"""
if hasNTLM:
if self._handler is None:
passman = request.HTTPPasswordMgrWithDefaultRealm()
passman.add_password(None, self._parsed_org_url, self._login_username, self._password)
se... | [
"def",
"handler",
"(",
"self",
")",
":",
"if",
"hasNTLM",
":",
"if",
"self",
".",
"_handler",
"is",
"None",
":",
"passman",
"=",
"request",
".",
"HTTPPasswordMgrWithDefaultRealm",
"(",
")",
"passman",
".",
"add_password",
"(",
"None",
",",
"self",
".",
"... | gets the security handler for the class | [
"gets",
"the",
"security",
"handler",
"for",
"the",
"class"
] | ab240fde2b0200f61d4a5f6df033516e53f2f416 | https://github.com/Esri/ArcREST/blob/ab240fde2b0200f61d4a5f6df033516e53f2f416/src/arcrest/security/security.py#L343-L352 |
13,164 | Esri/ArcREST | src/arcrest/security/security.py | PortalServerSecurityHandler.token | def token(self):
"""gets the AGS server token"""
return self._portalTokenHandler.servertoken(serverURL=self._serverUrl,
referer=self._referer) | python | def token(self):
"""gets the AGS server token"""
return self._portalTokenHandler.servertoken(serverURL=self._serverUrl,
referer=self._referer) | [
"def",
"token",
"(",
"self",
")",
":",
"return",
"self",
".",
"_portalTokenHandler",
".",
"servertoken",
"(",
"serverURL",
"=",
"self",
".",
"_serverUrl",
",",
"referer",
"=",
"self",
".",
"_referer",
")"
] | gets the AGS server token | [
"gets",
"the",
"AGS",
"server",
"token"
] | ab240fde2b0200f61d4a5f6df033516e53f2f416 | https://github.com/Esri/ArcREST/blob/ab240fde2b0200f61d4a5f6df033516e53f2f416/src/arcrest/security/security.py#L598-L601 |
13,165 | Esri/ArcREST | src/arcrest/security/security.py | OAuthSecurityHandler.token | def token(self):
""" obtains a token from the site """
if self._token is None or \
datetime.datetime.now() >= self._token_expires_on:
self._generateForOAuthSecurity(self._client_id,
self._secret_id,
... | python | def token(self):
""" obtains a token from the site """
if self._token is None or \
datetime.datetime.now() >= self._token_expires_on:
self._generateForOAuthSecurity(self._client_id,
self._secret_id,
... | [
"def",
"token",
"(",
"self",
")",
":",
"if",
"self",
".",
"_token",
"is",
"None",
"or",
"datetime",
".",
"datetime",
".",
"now",
"(",
")",
">=",
"self",
".",
"_token_expires_on",
":",
"self",
".",
"_generateForOAuthSecurity",
"(",
"self",
".",
"_client_i... | obtains a token from the site | [
"obtains",
"a",
"token",
"from",
"the",
"site"
] | ab240fde2b0200f61d4a5f6df033516e53f2f416 | https://github.com/Esri/ArcREST/blob/ab240fde2b0200f61d4a5f6df033516e53f2f416/src/arcrest/security/security.py#L790-L797 |
13,166 | Esri/ArcREST | src/arcrest/security/security.py | OAuthSecurityHandler._generateForOAuthSecurity | def _generateForOAuthSecurity(self, client_id,
secret_id, token_url=None):
""" generates a token based on the OAuth security model """
grant_type="client_credentials"
if token_url is None:
token_url = "https://www.arcgis.com/sharing/rest/oauth2/token... | python | def _generateForOAuthSecurity(self, client_id,
secret_id, token_url=None):
""" generates a token based on the OAuth security model """
grant_type="client_credentials"
if token_url is None:
token_url = "https://www.arcgis.com/sharing/rest/oauth2/token... | [
"def",
"_generateForOAuthSecurity",
"(",
"self",
",",
"client_id",
",",
"secret_id",
",",
"token_url",
"=",
"None",
")",
":",
"grant_type",
"=",
"\"client_credentials\"",
"if",
"token_url",
"is",
"None",
":",
"token_url",
"=",
"\"https://www.arcgis.com/sharing/rest/oa... | generates a token based on the OAuth security model | [
"generates",
"a",
"token",
"based",
"on",
"the",
"OAuth",
"security",
"model"
] | ab240fde2b0200f61d4a5f6df033516e53f2f416 | https://github.com/Esri/ArcREST/blob/ab240fde2b0200f61d4a5f6df033516e53f2f416/src/arcrest/security/security.py#L847-L877 |
13,167 | Esri/ArcREST | src/arcrest/security/security.py | ArcGISTokenSecurityHandler.referer_url | def referer_url(self, value):
"""sets the referer url"""
if self._referer_url != value:
self._token = None
self._referer_url = value | python | def referer_url(self, value):
"""sets the referer url"""
if self._referer_url != value:
self._token = None
self._referer_url = value | [
"def",
"referer_url",
"(",
"self",
",",
"value",
")",
":",
"if",
"self",
".",
"_referer_url",
"!=",
"value",
":",
"self",
".",
"_token",
"=",
"None",
"self",
".",
"_referer_url",
"=",
"value"
] | sets the referer url | [
"sets",
"the",
"referer",
"url"
] | ab240fde2b0200f61d4a5f6df033516e53f2f416 | https://github.com/Esri/ArcREST/blob/ab240fde2b0200f61d4a5f6df033516e53f2f416/src/arcrest/security/security.py#L1026-L1030 |
13,168 | Esri/ArcREST | src/arcrest/security/security.py | AGOLTokenSecurityHandler.__getRefererUrl | def __getRefererUrl(self, url=None):
"""
gets the referer url for the token handler
"""
if url is None:
url = "http://www.arcgis.com/sharing/rest/portals/self"
params = {
"f" : "json",
"token" : self.token
}
val = self._get(url=... | python | def __getRefererUrl(self, url=None):
"""
gets the referer url for the token handler
"""
if url is None:
url = "http://www.arcgis.com/sharing/rest/portals/self"
params = {
"f" : "json",
"token" : self.token
}
val = self._get(url=... | [
"def",
"__getRefererUrl",
"(",
"self",
",",
"url",
"=",
"None",
")",
":",
"if",
"url",
"is",
"None",
":",
"url",
"=",
"\"http://www.arcgis.com/sharing/rest/portals/self\"",
"params",
"=",
"{",
"\"f\"",
":",
"\"json\"",
",",
"\"token\"",
":",
"self",
".",
"to... | gets the referer url for the token handler | [
"gets",
"the",
"referer",
"url",
"for",
"the",
"token",
"handler"
] | ab240fde2b0200f61d4a5f6df033516e53f2f416 | https://github.com/Esri/ArcREST/blob/ab240fde2b0200f61d4a5f6df033516e53f2f416/src/arcrest/security/security.py#L1236-L1251 |
13,169 | Esri/ArcREST | src/arcrest/security/security.py | PortalTokenSecurityHandler.servertoken | def servertoken(self,serverURL,referer):
""" returns the server token for the server """
if self._server_token is None or self._server_token_expires_on is None or \
datetime.datetime.now() >= self._server_token_expires_on or \
self._server_url != serverURL:
self._server... | python | def servertoken(self,serverURL,referer):
""" returns the server token for the server """
if self._server_token is None or self._server_token_expires_on is None or \
datetime.datetime.now() >= self._server_token_expires_on or \
self._server_url != serverURL:
self._server... | [
"def",
"servertoken",
"(",
"self",
",",
"serverURL",
",",
"referer",
")",
":",
"if",
"self",
".",
"_server_token",
"is",
"None",
"or",
"self",
".",
"_server_token_expires_on",
"is",
"None",
"or",
"datetime",
".",
"datetime",
".",
"now",
"(",
")",
">=",
"... | returns the server token for the server | [
"returns",
"the",
"server",
"token",
"for",
"the",
"server"
] | ab240fde2b0200f61d4a5f6df033516e53f2f416 | https://github.com/Esri/ArcREST/blob/ab240fde2b0200f61d4a5f6df033516e53f2f416/src/arcrest/security/security.py#L1856-L1872 |
13,170 | Esri/ArcREST | src/arcrest/manageags/_machines.py | Machine.exportCertificate | def exportCertificate(self, certificate, folder):
"""gets the SSL Certificates for a given machine"""
url = self._url + "/sslcertificates/%s/export" % certificate
params = {
"f" : "json",
}
return self._get(url=url,
param_dict=params,
... | python | def exportCertificate(self, certificate, folder):
"""gets the SSL Certificates for a given machine"""
url = self._url + "/sslcertificates/%s/export" % certificate
params = {
"f" : "json",
}
return self._get(url=url,
param_dict=params,
... | [
"def",
"exportCertificate",
"(",
"self",
",",
"certificate",
",",
"folder",
")",
":",
"url",
"=",
"self",
".",
"_url",
"+",
"\"/sslcertificates/%s/export\"",
"%",
"certificate",
"params",
"=",
"{",
"\"f\"",
":",
"\"json\"",
",",
"}",
"return",
"self",
".",
... | gets the SSL Certificates for a given machine | [
"gets",
"the",
"SSL",
"Certificates",
"for",
"a",
"given",
"machine"
] | ab240fde2b0200f61d4a5f6df033516e53f2f416 | https://github.com/Esri/ArcREST/blob/ab240fde2b0200f61d4a5f6df033516e53f2f416/src/arcrest/manageags/_machines.py#L277-L285 |
13,171 | Esri/ArcREST | src/arcrest/manageorg/administration.py | Administration.currentVersion | def currentVersion(self):
""" returns the current version of the site """
if self._currentVersion is None:
self.__init(self._url)
return self._currentVersion | python | def currentVersion(self):
""" returns the current version of the site """
if self._currentVersion is None:
self.__init(self._url)
return self._currentVersion | [
"def",
"currentVersion",
"(",
"self",
")",
":",
"if",
"self",
".",
"_currentVersion",
"is",
"None",
":",
"self",
".",
"__init",
"(",
"self",
".",
"_url",
")",
"return",
"self",
".",
"_currentVersion"
] | returns the current version of the site | [
"returns",
"the",
"current",
"version",
"of",
"the",
"site"
] | ab240fde2b0200f61d4a5f6df033516e53f2f416 | https://github.com/Esri/ArcREST/blob/ab240fde2b0200f61d4a5f6df033516e53f2f416/src/arcrest/manageorg/administration.py#L118-L122 |
13,172 | Esri/ArcREST | src/arcrest/manageorg/administration.py | Administration.portals | def portals(self):
"""returns the Portals class that provides administration access
into a given organization"""
url = "%s/portals" % self.root
return _portals.Portals(url=url,
securityHandler=self._securityHandler,
proxy_ur... | python | def portals(self):
"""returns the Portals class that provides administration access
into a given organization"""
url = "%s/portals" % self.root
return _portals.Portals(url=url,
securityHandler=self._securityHandler,
proxy_ur... | [
"def",
"portals",
"(",
"self",
")",
":",
"url",
"=",
"\"%s/portals\"",
"%",
"self",
".",
"root",
"return",
"_portals",
".",
"Portals",
"(",
"url",
"=",
"url",
",",
"securityHandler",
"=",
"self",
".",
"_securityHandler",
",",
"proxy_url",
"=",
"self",
".... | returns the Portals class that provides administration access
into a given organization | [
"returns",
"the",
"Portals",
"class",
"that",
"provides",
"administration",
"access",
"into",
"a",
"given",
"organization"
] | ab240fde2b0200f61d4a5f6df033516e53f2f416 | https://github.com/Esri/ArcREST/blob/ab240fde2b0200f61d4a5f6df033516e53f2f416/src/arcrest/manageorg/administration.py#L125-L132 |
13,173 | Esri/ArcREST | src/arcrest/manageorg/administration.py | Administration.oauth2 | def oauth2(self):
"""
returns the oauth2 class
"""
if self._url.endswith("/oauth2"):
url = self._url
else:
url = self._url + "/oauth2"
return _oauth2.oauth2(oauth_url=url,
securityHandler=self._securityHandler,
... | python | def oauth2(self):
"""
returns the oauth2 class
"""
if self._url.endswith("/oauth2"):
url = self._url
else:
url = self._url + "/oauth2"
return _oauth2.oauth2(oauth_url=url,
securityHandler=self._securityHandler,
... | [
"def",
"oauth2",
"(",
"self",
")",
":",
"if",
"self",
".",
"_url",
".",
"endswith",
"(",
"\"/oauth2\"",
")",
":",
"url",
"=",
"self",
".",
"_url",
"else",
":",
"url",
"=",
"self",
".",
"_url",
"+",
"\"/oauth2\"",
"return",
"_oauth2",
".",
"oauth2",
... | returns the oauth2 class | [
"returns",
"the",
"oauth2",
"class"
] | ab240fde2b0200f61d4a5f6df033516e53f2f416 | https://github.com/Esri/ArcREST/blob/ab240fde2b0200f61d4a5f6df033516e53f2f416/src/arcrest/manageorg/administration.py#L135-L146 |
13,174 | Esri/ArcREST | src/arcrest/manageorg/administration.py | Administration.community | def community(self):
"""The portal community root covers user and group resources and
operations.
"""
return _community.Community(url=self._url + "/community",
securityHandler=self._securityHandler,
proxy_url=self._p... | python | def community(self):
"""The portal community root covers user and group resources and
operations.
"""
return _community.Community(url=self._url + "/community",
securityHandler=self._securityHandler,
proxy_url=self._p... | [
"def",
"community",
"(",
"self",
")",
":",
"return",
"_community",
".",
"Community",
"(",
"url",
"=",
"self",
".",
"_url",
"+",
"\"/community\"",
",",
"securityHandler",
"=",
"self",
".",
"_securityHandler",
",",
"proxy_url",
"=",
"self",
".",
"_proxy_url",
... | The portal community root covers user and group resources and
operations. | [
"The",
"portal",
"community",
"root",
"covers",
"user",
"and",
"group",
"resources",
"and",
"operations",
"."
] | ab240fde2b0200f61d4a5f6df033516e53f2f416 | https://github.com/Esri/ArcREST/blob/ab240fde2b0200f61d4a5f6df033516e53f2f416/src/arcrest/manageorg/administration.py#L149-L156 |
13,175 | Esri/ArcREST | src/arcrest/manageorg/administration.py | Administration.content | def content(self):
"""returns access into the site's content"""
return _content.Content(url=self._url + "/content",
securityHandler=self._securityHandler,
proxy_url=self._proxy_url,
proxy_port=self._proxy_por... | python | def content(self):
"""returns access into the site's content"""
return _content.Content(url=self._url + "/content",
securityHandler=self._securityHandler,
proxy_url=self._proxy_url,
proxy_port=self._proxy_por... | [
"def",
"content",
"(",
"self",
")",
":",
"return",
"_content",
".",
"Content",
"(",
"url",
"=",
"self",
".",
"_url",
"+",
"\"/content\"",
",",
"securityHandler",
"=",
"self",
".",
"_securityHandler",
",",
"proxy_url",
"=",
"self",
".",
"_proxy_url",
",",
... | returns access into the site's content | [
"returns",
"access",
"into",
"the",
"site",
"s",
"content"
] | ab240fde2b0200f61d4a5f6df033516e53f2f416 | https://github.com/Esri/ArcREST/blob/ab240fde2b0200f61d4a5f6df033516e53f2f416/src/arcrest/manageorg/administration.py#L159-L164 |
13,176 | Esri/ArcREST | src/arcrest/manageorg/administration.py | Administration.search | def search(self,
q,
t=None,
focus=None,
bbox=None,
start=1,
num=10,
sortField=None,
sortOrder="asc",
useSecurity=True):
"""
This operation searches for content items in the porta... | python | def search(self,
q,
t=None,
focus=None,
bbox=None,
start=1,
num=10,
sortField=None,
sortOrder="asc",
useSecurity=True):
"""
This operation searches for content items in the porta... | [
"def",
"search",
"(",
"self",
",",
"q",
",",
"t",
"=",
"None",
",",
"focus",
"=",
"None",
",",
"bbox",
"=",
"None",
",",
"start",
"=",
"1",
",",
"num",
"=",
"10",
",",
"sortField",
"=",
"None",
",",
"sortOrder",
"=",
"\"asc\"",
",",
"useSecurity"... | This operation searches for content items in the portal. The
searches are performed against a high performance index that
indexes the most popular fields of an item. See the Search
reference page for information on the fields and the syntax of the
query.
The search index is updat... | [
"This",
"operation",
"searches",
"for",
"content",
"items",
"in",
"the",
"portal",
".",
"The",
"searches",
"are",
"performed",
"against",
"a",
"high",
"performance",
"index",
"that",
"indexes",
"the",
"most",
"popular",
"fields",
"of",
"an",
"item",
".",
"Se... | ab240fde2b0200f61d4a5f6df033516e53f2f416 | https://github.com/Esri/ArcREST/blob/ab240fde2b0200f61d4a5f6df033516e53f2f416/src/arcrest/manageorg/administration.py#L167-L263 |
13,177 | Esri/ArcREST | src/arcrest/manageorg/administration.py | Administration.hostingServers | def hostingServers(self):
"""
Returns the objects to manage site's hosted services. It returns
AGSAdministration object if the site is Portal and it returns a
hostedservice.Services object if it is AGOL.
"""
portals = self.portals
portal = portals.portalSel... | python | def hostingServers(self):
"""
Returns the objects to manage site's hosted services. It returns
AGSAdministration object if the site is Portal and it returns a
hostedservice.Services object if it is AGOL.
"""
portals = self.portals
portal = portals.portalSel... | [
"def",
"hostingServers",
"(",
"self",
")",
":",
"portals",
"=",
"self",
".",
"portals",
"portal",
"=",
"portals",
".",
"portalSelf",
"urls",
"=",
"portal",
".",
"urls",
"if",
"'error'",
"in",
"urls",
":",
"print",
"(",
"urls",
")",
"return",
"services",
... | Returns the objects to manage site's hosted services. It returns
AGSAdministration object if the site is Portal and it returns a
hostedservice.Services object if it is AGOL. | [
"Returns",
"the",
"objects",
"to",
"manage",
"site",
"s",
"hosted",
"services",
".",
"It",
"returns",
"AGSAdministration",
"object",
"if",
"the",
"site",
"is",
"Portal",
"and",
"it",
"returns",
"a",
"hostedservice",
".",
"Services",
"object",
"if",
"it",
"is... | ab240fde2b0200f61d4a5f6df033516e53f2f416 | https://github.com/Esri/ArcREST/blob/ab240fde2b0200f61d4a5f6df033516e53f2f416/src/arcrest/manageorg/administration.py#L267-L341 |
13,178 | Esri/ArcREST | src/arcrest/webmap/domain.py | CodedValueDomain.add_codedValue | def add_codedValue(self, name, code):
""" adds a value to the coded value list """
if self._codedValues is None:
self._codedValues = []
self._codedValues.append(
{"name": name, "code": code}
) | python | def add_codedValue(self, name, code):
""" adds a value to the coded value list """
if self._codedValues is None:
self._codedValues = []
self._codedValues.append(
{"name": name, "code": code}
) | [
"def",
"add_codedValue",
"(",
"self",
",",
"name",
",",
"code",
")",
":",
"if",
"self",
".",
"_codedValues",
"is",
"None",
":",
"self",
".",
"_codedValues",
"=",
"[",
"]",
"self",
".",
"_codedValues",
".",
"append",
"(",
"{",
"\"name\"",
":",
"name",
... | adds a value to the coded value list | [
"adds",
"a",
"value",
"to",
"the",
"coded",
"value",
"list"
] | ab240fde2b0200f61d4a5f6df033516e53f2f416 | https://github.com/Esri/ArcREST/blob/ab240fde2b0200f61d4a5f6df033516e53f2f416/src/arcrest/webmap/domain.py#L96-L102 |
13,179 | Esri/ArcREST | src/arcrest/geometryservice/geometryservice.py | GeometryService.__init | def __init(self):
"""loads the json values"""
res = self._get(url=self._url,
param_dict={"f": "json"},
securityHandler=self._securityHandler,
proxy_url=self._proxy_url,
proxy_port=self._proxy_port... | python | def __init(self):
"""loads the json values"""
res = self._get(url=self._url,
param_dict={"f": "json"},
securityHandler=self._securityHandler,
proxy_url=self._proxy_url,
proxy_port=self._proxy_port... | [
"def",
"__init",
"(",
"self",
")",
":",
"res",
"=",
"self",
".",
"_get",
"(",
"url",
"=",
"self",
".",
"_url",
",",
"param_dict",
"=",
"{",
"\"f\"",
":",
"\"json\"",
"}",
",",
"securityHandler",
"=",
"self",
".",
"_securityHandler",
",",
"proxy_url",
... | loads the json values | [
"loads",
"the",
"json",
"values"
] | ab240fde2b0200f61d4a5f6df033516e53f2f416 | https://github.com/Esri/ArcREST/blob/ab240fde2b0200f61d4a5f6df033516e53f2f416/src/arcrest/geometryservice/geometryservice.py#L33-L43 |
13,180 | Esri/ArcREST | src/arcrest/geometryservice/geometryservice.py | GeometryService.areasAndLengths | def areasAndLengths(self,
polygons,
lengthUnit,
areaUnit,
calculationType,
):
"""
The areasAndLengths operation is performed on a geometry service
resource. This operatio... | python | def areasAndLengths(self,
polygons,
lengthUnit,
areaUnit,
calculationType,
):
"""
The areasAndLengths operation is performed on a geometry service
resource. This operatio... | [
"def",
"areasAndLengths",
"(",
"self",
",",
"polygons",
",",
"lengthUnit",
",",
"areaUnit",
",",
"calculationType",
",",
")",
":",
"url",
"=",
"self",
".",
"_url",
"+",
"\"/areasAndLengths\"",
"params",
"=",
"{",
"\"f\"",
":",
"\"json\"",
",",
"\"lengthUnit\... | The areasAndLengths operation is performed on a geometry service
resource. This operation calculates areas and perimeter lengths
for each polygon specified in the input array.
Inputs:
polygons - The array of polygons whose areas and lengths are
to... | [
"The",
"areasAndLengths",
"operation",
"is",
"performed",
"on",
"a",
"geometry",
"service",
"resource",
".",
"This",
"operation",
"calculates",
"areas",
"and",
"perimeter",
"lengths",
"for",
"each",
"polygon",
"specified",
"in",
"the",
"input",
"array",
"."
] | ab240fde2b0200f61d4a5f6df033516e53f2f416 | https://github.com/Esri/ArcREST/blob/ab240fde2b0200f61d4a5f6df033516e53f2f416/src/arcrest/geometryservice/geometryservice.py#L58-L146 |
13,181 | Esri/ArcREST | src/arcrest/geometryservice/geometryservice.py | GeometryService.__geometryToGeomTemplate | def __geometryToGeomTemplate(self, geometry):
"""
Converts a single geometry object to a geometry service geometry
template value.
Input:
geometry - ArcREST geometry object
Output:
python dictionary of geometry template
"""
... | python | def __geometryToGeomTemplate(self, geometry):
"""
Converts a single geometry object to a geometry service geometry
template value.
Input:
geometry - ArcREST geometry object
Output:
python dictionary of geometry template
"""
... | [
"def",
"__geometryToGeomTemplate",
"(",
"self",
",",
"geometry",
")",
":",
"template",
"=",
"{",
"\"geometryType\"",
":",
"None",
",",
"\"geometry\"",
":",
"None",
"}",
"if",
"isinstance",
"(",
"geometry",
",",
"Polyline",
")",
":",
"template",
"[",
"'geomet... | Converts a single geometry object to a geometry service geometry
template value.
Input:
geometry - ArcREST geometry object
Output:
python dictionary of geometry template | [
"Converts",
"a",
"single",
"geometry",
"object",
"to",
"a",
"geometry",
"service",
"geometry",
"template",
"value",
"."
] | ab240fde2b0200f61d4a5f6df033516e53f2f416 | https://github.com/Esri/ArcREST/blob/ab240fde2b0200f61d4a5f6df033516e53f2f416/src/arcrest/geometryservice/geometryservice.py#L178-L203 |
13,182 | Esri/ArcREST | src/arcrest/geometryservice/geometryservice.py | GeometryService.__geomToStringArray | def __geomToStringArray(self, geometries, returnType="str"):
""" function to convert the geomtries to strings """
listGeoms = []
for g in geometries:
if isinstance(g, Point):
listGeoms.append(g.asDictionary)
elif isinstance(g, Polygon):
lis... | python | def __geomToStringArray(self, geometries, returnType="str"):
""" function to convert the geomtries to strings """
listGeoms = []
for g in geometries:
if isinstance(g, Point):
listGeoms.append(g.asDictionary)
elif isinstance(g, Polygon):
lis... | [
"def",
"__geomToStringArray",
"(",
"self",
",",
"geometries",
",",
"returnType",
"=",
"\"str\"",
")",
":",
"listGeoms",
"=",
"[",
"]",
"for",
"g",
"in",
"geometries",
":",
"if",
"isinstance",
"(",
"g",
",",
"Point",
")",
":",
"listGeoms",
".",
"append",
... | function to convert the geomtries to strings | [
"function",
"to",
"convert",
"the",
"geomtries",
"to",
"strings"
] | ab240fde2b0200f61d4a5f6df033516e53f2f416 | https://github.com/Esri/ArcREST/blob/ab240fde2b0200f61d4a5f6df033516e53f2f416/src/arcrest/geometryservice/geometryservice.py#L205-L220 |
13,183 | Esri/ArcREST | src/arcrest/geometryservice/geometryservice.py | GeometryService.autoComplete | def autoComplete(self,
polygons=[],
polylines=[],
sr=None
):
"""
The autoComplete operation simplifies the process of
constructing new polygons that are adjacent to other polygons.
It constructs ... | python | def autoComplete(self,
polygons=[],
polylines=[],
sr=None
):
"""
The autoComplete operation simplifies the process of
constructing new polygons that are adjacent to other polygons.
It constructs ... | [
"def",
"autoComplete",
"(",
"self",
",",
"polygons",
"=",
"[",
"]",
",",
"polylines",
"=",
"[",
"]",
",",
"sr",
"=",
"None",
")",
":",
"url",
"=",
"self",
".",
"_url",
"+",
"\"/autoComplete\"",
"params",
"=",
"{",
"\"f\"",
":",
"\"json\"",
"}",
"if... | The autoComplete operation simplifies the process of
constructing new polygons that are adjacent to other polygons.
It constructs polygons that fill in the gaps between existing
polygons and a set of polylines.
Inputs:
polygons - array of Polygon objects.
... | [
"The",
"autoComplete",
"operation",
"simplifies",
"the",
"process",
"of",
"constructing",
"new",
"polygons",
"that",
"are",
"adjacent",
"to",
"other",
"polygons",
".",
"It",
"constructs",
"polygons",
"that",
"fill",
"in",
"the",
"gaps",
"between",
"existing",
"p... | ab240fde2b0200f61d4a5f6df033516e53f2f416 | https://github.com/Esri/ArcREST/blob/ab240fde2b0200f61d4a5f6df033516e53f2f416/src/arcrest/geometryservice/geometryservice.py#L222-L247 |
13,184 | Esri/ArcREST | src/arcrest/geometryservice/geometryservice.py | GeometryService.buffer | def buffer(self,
geometries,
inSR,
distances,
units,
outSR=None,
bufferSR=None,
unionResults=True,
geodesic=True
):
"""
The buffer operation is performed on a geometr... | python | def buffer(self,
geometries,
inSR,
distances,
units,
outSR=None,
bufferSR=None,
unionResults=True,
geodesic=True
):
"""
The buffer operation is performed on a geometr... | [
"def",
"buffer",
"(",
"self",
",",
"geometries",
",",
"inSR",
",",
"distances",
",",
"units",
",",
"outSR",
"=",
"None",
",",
"bufferSR",
"=",
"None",
",",
"unionResults",
"=",
"True",
",",
"geodesic",
"=",
"True",
")",
":",
"url",
"=",
"self",
".",
... | The buffer operation is performed on a geometry service resource
The result of this operation is buffered polygons at the
specified distances for the input geometry array. Options are
available to union buffers and to use geodesic distance.
Inputs:
geometries - ... | [
"The",
"buffer",
"operation",
"is",
"performed",
"on",
"a",
"geometry",
"service",
"resource",
"The",
"result",
"of",
"this",
"operation",
"is",
"buffered",
"polygons",
"at",
"the",
"specified",
"distances",
"for",
"the",
"input",
"geometry",
"array",
".",
"Op... | ab240fde2b0200f61d4a5f6df033516e53f2f416 | https://github.com/Esri/ArcREST/blob/ab240fde2b0200f61d4a5f6df033516e53f2f416/src/arcrest/geometryservice/geometryservice.py#L249-L313 |
13,185 | Esri/ArcREST | src/arcrest/geometryservice/geometryservice.py | GeometryService.findTransformation | def findTransformation(self, inSR, outSR, extentOfInterest=None, numOfResults=1):
"""
The findTransformations operation is performed on a geometry
service resource. This operation returns a list of applicable
geographic transformations you should use when projecting
geometries fr... | python | def findTransformation(self, inSR, outSR, extentOfInterest=None, numOfResults=1):
"""
The findTransformations operation is performed on a geometry
service resource. This operation returns a list of applicable
geographic transformations you should use when projecting
geometries fr... | [
"def",
"findTransformation",
"(",
"self",
",",
"inSR",
",",
"outSR",
",",
"extentOfInterest",
"=",
"None",
",",
"numOfResults",
"=",
"1",
")",
":",
"params",
"=",
"{",
"\"f\"",
":",
"\"json\"",
",",
"\"inSR\"",
":",
"inSR",
",",
"\"outSR\"",
":",
"outSR"... | The findTransformations operation is performed on a geometry
service resource. This operation returns a list of applicable
geographic transformations you should use when projecting
geometries from the input spatial reference to the output spatial
reference. The transformations are in JSO... | [
"The",
"findTransformations",
"operation",
"is",
"performed",
"on",
"a",
"geometry",
"service",
"resource",
".",
"This",
"operation",
"returns",
"a",
"list",
"of",
"applicable",
"geographic",
"transformations",
"you",
"should",
"use",
"when",
"projecting",
"geometri... | ab240fde2b0200f61d4a5f6df033516e53f2f416 | https://github.com/Esri/ArcREST/blob/ab240fde2b0200f61d4a5f6df033516e53f2f416/src/arcrest/geometryservice/geometryservice.py#L551-L598 |
13,186 | Esri/ArcREST | src/arcrest/geometryservice/geometryservice.py | GeometryService.fromGeoCoordinateString | def fromGeoCoordinateString(self, sr, strings,
conversionType, conversionMode=None):
"""
The fromGeoCoordinateString operation is performed on a geometry
service resource. The operation converts an array of well-known
strings into xy-coordinates based on t... | python | def fromGeoCoordinateString(self, sr, strings,
conversionType, conversionMode=None):
"""
The fromGeoCoordinateString operation is performed on a geometry
service resource. The operation converts an array of well-known
strings into xy-coordinates based on t... | [
"def",
"fromGeoCoordinateString",
"(",
"self",
",",
"sr",
",",
"strings",
",",
"conversionType",
",",
"conversionMode",
"=",
"None",
")",
":",
"url",
"=",
"self",
".",
"_url",
"+",
"\"/fromGeoCoordinateString\"",
"params",
"=",
"{",
"\"f\"",
":",
"\"json\"",
... | The fromGeoCoordinateString operation is performed on a geometry
service resource. The operation converts an array of well-known
strings into xy-coordinates based on the conversion type and
spatial reference supplied by the user. An optional conversion mode
parameter is available for som... | [
"The",
"fromGeoCoordinateString",
"operation",
"is",
"performed",
"on",
"a",
"geometry",
"service",
"resource",
".",
"The",
"operation",
"converts",
"an",
"array",
"of",
"well",
"-",
"known",
"strings",
"into",
"xy",
"-",
"coordinates",
"based",
"on",
"the",
"... | ab240fde2b0200f61d4a5f6df033516e53f2f416 | https://github.com/Esri/ArcREST/blob/ab240fde2b0200f61d4a5f6df033516e53f2f416/src/arcrest/geometryservice/geometryservice.py#L600-L658 |
13,187 | Esri/ArcREST | src/arcrest/geometryservice/geometryservice.py | GeometryService.toGeoCoordinateString | def toGeoCoordinateString(self,
sr,
coordinates,
conversionType,
conversionMode="mgrsDefault",
numOfDigits=None,
rounding=True,
... | python | def toGeoCoordinateString(self,
sr,
coordinates,
conversionType,
conversionMode="mgrsDefault",
numOfDigits=None,
rounding=True,
... | [
"def",
"toGeoCoordinateString",
"(",
"self",
",",
"sr",
",",
"coordinates",
",",
"conversionType",
",",
"conversionMode",
"=",
"\"mgrsDefault\"",
",",
"numOfDigits",
"=",
"None",
",",
"rounding",
"=",
"True",
",",
"addSpaces",
"=",
"True",
")",
":",
"params",
... | The toGeoCoordinateString operation is performed on a geometry
service resource. The operation converts an array of
xy-coordinates into well-known strings based on the conversion type
and spatial reference supplied by the user. Optional parameters are
available for some conversion types.... | [
"The",
"toGeoCoordinateString",
"operation",
"is",
"performed",
"on",
"a",
"geometry",
"service",
"resource",
".",
"The",
"operation",
"converts",
"an",
"array",
"of",
"xy",
"-",
"coordinates",
"into",
"well",
"-",
"known",
"strings",
"based",
"on",
"the",
"co... | ab240fde2b0200f61d4a5f6df033516e53f2f416 | https://github.com/Esri/ArcREST/blob/ab240fde2b0200f61d4a5f6df033516e53f2f416/src/arcrest/geometryservice/geometryservice.py#L985-L1067 |
13,188 | Esri/ArcREST | src/arcrest/agol/helperservices/hydrology.py | hydrology.__init_url | def __init_url(self):
"""loads the information into the class"""
portals_self_url = "{}/portals/self".format(self._url)
params = {
"f" :"json"
}
if not self._securityHandler is None:
params['token'] = self._securityHandler.token
res = self._get(url... | python | def __init_url(self):
"""loads the information into the class"""
portals_self_url = "{}/portals/self".format(self._url)
params = {
"f" :"json"
}
if not self._securityHandler is None:
params['token'] = self._securityHandler.token
res = self._get(url... | [
"def",
"__init_url",
"(",
"self",
")",
":",
"portals_self_url",
"=",
"\"{}/portals/self\"",
".",
"format",
"(",
"self",
".",
"_url",
")",
"params",
"=",
"{",
"\"f\"",
":",
"\"json\"",
"}",
"if",
"not",
"self",
".",
"_securityHandler",
"is",
"None",
":",
... | loads the information into the class | [
"loads",
"the",
"information",
"into",
"the",
"class"
] | ab240fde2b0200f61d4a5f6df033516e53f2f416 | https://github.com/Esri/ArcREST/blob/ab240fde2b0200f61d4a5f6df033516e53f2f416/src/arcrest/agol/helperservices/hydrology.py#L51-L74 |
13,189 | bw2/ConfigArgParse | configargparse.py | get_argument_parser | def get_argument_parser(name=None, **kwargs):
"""Returns the global ArgumentParser instance with the given name. The 1st
time this function is called, a new ArgumentParser instance will be created
for the given name, and any args other than "name" will be passed on to the
ArgumentParser constructor.
... | python | def get_argument_parser(name=None, **kwargs):
"""Returns the global ArgumentParser instance with the given name. The 1st
time this function is called, a new ArgumentParser instance will be created
for the given name, and any args other than "name" will be passed on to the
ArgumentParser constructor.
... | [
"def",
"get_argument_parser",
"(",
"name",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"if",
"name",
"is",
"None",
":",
"name",
"=",
"\"default\"",
"if",
"len",
"(",
"kwargs",
")",
">",
"0",
"or",
"name",
"not",
"in",
"_parsers",
":",
"init_argum... | Returns the global ArgumentParser instance with the given name. The 1st
time this function is called, a new ArgumentParser instance will be created
for the given name, and any args other than "name" will be passed on to the
ArgumentParser constructor. | [
"Returns",
"the",
"global",
"ArgumentParser",
"instance",
"with",
"the",
"given",
"name",
".",
"The",
"1st",
"time",
"this",
"function",
"is",
"called",
"a",
"new",
"ArgumentParser",
"instance",
"will",
"be",
"created",
"for",
"the",
"given",
"name",
"and",
... | 8bbc7de67f884184068d62af7f78e723d01c0081 | https://github.com/bw2/ConfigArgParse/blob/8bbc7de67f884184068d62af7f78e723d01c0081/configargparse.py#L46-L58 |
13,190 | bw2/ConfigArgParse | configargparse.py | DefaultConfigFileParser.parse | def parse(self, stream):
"""Parses the keys + values from a config file."""
items = OrderedDict()
for i, line in enumerate(stream):
line = line.strip()
if not line or line[0] in ["#", ";", "["] or line.startswith("---"):
continue
white_space =... | python | def parse(self, stream):
"""Parses the keys + values from a config file."""
items = OrderedDict()
for i, line in enumerate(stream):
line = line.strip()
if not line or line[0] in ["#", ";", "["] or line.startswith("---"):
continue
white_space =... | [
"def",
"parse",
"(",
"self",
",",
"stream",
")",
":",
"items",
"=",
"OrderedDict",
"(",
")",
"for",
"i",
",",
"line",
"in",
"enumerate",
"(",
"stream",
")",
":",
"line",
"=",
"line",
".",
"strip",
"(",
")",
"if",
"not",
"line",
"or",
"line",
"[",... | Parses the keys + values from a config file. | [
"Parses",
"the",
"keys",
"+",
"values",
"from",
"a",
"config",
"file",
"."
] | 8bbc7de67f884184068d62af7f78e723d01c0081 | https://github.com/bw2/ConfigArgParse/blob/8bbc7de67f884184068d62af7f78e723d01c0081/configargparse.py#L146-L179 |
13,191 | bw2/ConfigArgParse | configargparse.py | YAMLConfigFileParser.parse | def parse(self, stream):
"""Parses the keys and values from a config file."""
yaml = self._load_yaml()
try:
parsed_obj = yaml.safe_load(stream)
except Exception as e:
raise ConfigFileParserException("Couldn't parse config file: %s" % e)
if not isinstance... | python | def parse(self, stream):
"""Parses the keys and values from a config file."""
yaml = self._load_yaml()
try:
parsed_obj = yaml.safe_load(stream)
except Exception as e:
raise ConfigFileParserException("Couldn't parse config file: %s" % e)
if not isinstance... | [
"def",
"parse",
"(",
"self",
",",
"stream",
")",
":",
"yaml",
"=",
"self",
".",
"_load_yaml",
"(",
")",
"try",
":",
"parsed_obj",
"=",
"yaml",
".",
"safe_load",
"(",
"stream",
")",
"except",
"Exception",
"as",
"e",
":",
"raise",
"ConfigFileParserExceptio... | Parses the keys and values from a config file. | [
"Parses",
"the",
"keys",
"and",
"values",
"from",
"a",
"config",
"file",
"."
] | 8bbc7de67f884184068d62af7f78e723d01c0081 | https://github.com/bw2/ConfigArgParse/blob/8bbc7de67f884184068d62af7f78e723d01c0081/configargparse.py#L215-L237 |
13,192 | bw2/ConfigArgParse | configargparse.py | ArgumentParser.write_config_file | def write_config_file(self, parsed_namespace, output_file_paths, exit_after=False):
"""Write the given settings to output files.
Args:
parsed_namespace: namespace object created within parse_known_args()
output_file_paths: any number of file paths to write the config to
... | python | def write_config_file(self, parsed_namespace, output_file_paths, exit_after=False):
"""Write the given settings to output files.
Args:
parsed_namespace: namespace object created within parse_known_args()
output_file_paths: any number of file paths to write the config to
... | [
"def",
"write_config_file",
"(",
"self",
",",
"parsed_namespace",
",",
"output_file_paths",
",",
"exit_after",
"=",
"False",
")",
":",
"for",
"output_file_path",
"in",
"output_file_paths",
":",
"# validate the output file path",
"try",
":",
"with",
"open",
"(",
"out... | Write the given settings to output files.
Args:
parsed_namespace: namespace object created within parse_known_args()
output_file_paths: any number of file paths to write the config to
exit_after: whether to exit the program after writing the config files | [
"Write",
"the",
"given",
"settings",
"to",
"output",
"files",
"."
] | 8bbc7de67f884184068d62af7f78e723d01c0081 | https://github.com/bw2/ConfigArgParse/blob/8bbc7de67f884184068d62af7f78e723d01c0081/configargparse.py#L542-L570 |
13,193 | bw2/ConfigArgParse | configargparse.py | ArgumentParser.convert_item_to_command_line_arg | def convert_item_to_command_line_arg(self, action, key, value):
"""Converts a config file or env var key + value to a list of
commandline args to append to the commandline.
Args:
action: The argparse Action object for this setting, or None if this
config file setting... | python | def convert_item_to_command_line_arg(self, action, key, value):
"""Converts a config file or env var key + value to a list of
commandline args to append to the commandline.
Args:
action: The argparse Action object for this setting, or None if this
config file setting... | [
"def",
"convert_item_to_command_line_arg",
"(",
"self",
",",
"action",
",",
"key",
",",
"value",
")",
":",
"args",
"=",
"[",
"]",
"if",
"action",
"is",
"None",
":",
"command_line_key",
"=",
"self",
".",
"get_command_line_key_for_unknown_config_file_setting",
"(",
... | Converts a config file or env var key + value to a list of
commandline args to append to the commandline.
Args:
action: The argparse Action object for this setting, or None if this
config file setting doesn't correspond to any defined
configargparse arg.
... | [
"Converts",
"a",
"config",
"file",
"or",
"env",
"var",
"key",
"+",
"value",
"to",
"a",
"list",
"of",
"commandline",
"args",
"to",
"append",
"to",
"the",
"commandline",
"."
] | 8bbc7de67f884184068d62af7f78e723d01c0081 | https://github.com/bw2/ConfigArgParse/blob/8bbc7de67f884184068d62af7f78e723d01c0081/configargparse.py#L632-L681 |
13,194 | bw2/ConfigArgParse | configargparse.py | ArgumentParser.get_possible_config_keys | def get_possible_config_keys(self, action):
"""This method decides which actions can be set in a config file and
what their keys will be. It returns a list of 0 or more config keys that
can be used to set the given action's value in a config file.
"""
keys = []
# Do not ... | python | def get_possible_config_keys(self, action):
"""This method decides which actions can be set in a config file and
what their keys will be. It returns a list of 0 or more config keys that
can be used to set the given action's value in a config file.
"""
keys = []
# Do not ... | [
"def",
"get_possible_config_keys",
"(",
"self",
",",
"action",
")",
":",
"keys",
"=",
"[",
"]",
"# Do not write out the config options for writing out a config file",
"if",
"getattr",
"(",
"action",
",",
"'is_write_out_config_file_arg'",
",",
"None",
")",
":",
"return",... | This method decides which actions can be set in a config file and
what their keys will be. It returns a list of 0 or more config keys that
can be used to set the given action's value in a config file. | [
"This",
"method",
"decides",
"which",
"actions",
"can",
"be",
"set",
"in",
"a",
"config",
"file",
"and",
"what",
"their",
"keys",
"will",
"be",
".",
"It",
"returns",
"a",
"list",
"of",
"0",
"or",
"more",
"config",
"keys",
"that",
"can",
"be",
"used",
... | 8bbc7de67f884184068d62af7f78e723d01c0081 | https://github.com/bw2/ConfigArgParse/blob/8bbc7de67f884184068d62af7f78e723d01c0081/configargparse.py#L683-L698 |
13,195 | ihucos/plash | opt/plash/lib/py/plash/eval.py | eval | def eval(lisp):
'''
plash lisp is one dimensional lisp.
'''
macro_values = []
if not isinstance(lisp, list):
raise EvalError('eval root element must be a list')
for item in lisp:
if not isinstance(item, list):
raise EvalError('must evaluate list of list')
if n... | python | def eval(lisp):
'''
plash lisp is one dimensional lisp.
'''
macro_values = []
if not isinstance(lisp, list):
raise EvalError('eval root element must be a list')
for item in lisp:
if not isinstance(item, list):
raise EvalError('must evaluate list of list')
if n... | [
"def",
"eval",
"(",
"lisp",
")",
":",
"macro_values",
"=",
"[",
"]",
"if",
"not",
"isinstance",
"(",
"lisp",
",",
"list",
")",
":",
"raise",
"EvalError",
"(",
"'eval root element must be a list'",
")",
"for",
"item",
"in",
"lisp",
":",
"if",
"not",
"isin... | plash lisp is one dimensional lisp. | [
"plash",
"lisp",
"is",
"one",
"dimensional",
"lisp",
"."
] | 2ab2bc956e309d5aa6414c80983bfbf29b0ce572 | https://github.com/ihucos/plash/blob/2ab2bc956e309d5aa6414c80983bfbf29b0ce572/opt/plash/lib/py/plash/eval.py#L62-L97 |
13,196 | ihucos/plash | opt/plash/lib/py/plash/utils.py | plash_map | def plash_map(*args):
from subprocess import check_output
'thin wrapper around plash map'
out = check_output(['plash', 'map'] + list(args))
if out == '':
return None
return out.decode().strip('\n') | python | def plash_map(*args):
from subprocess import check_output
'thin wrapper around plash map'
out = check_output(['plash', 'map'] + list(args))
if out == '':
return None
return out.decode().strip('\n') | [
"def",
"plash_map",
"(",
"*",
"args",
")",
":",
"from",
"subprocess",
"import",
"check_output",
"out",
"=",
"check_output",
"(",
"[",
"'plash'",
",",
"'map'",
"]",
"+",
"list",
"(",
"args",
")",
")",
"if",
"out",
"==",
"''",
":",
"return",
"None",
"r... | thin wrapper around plash map | [
"thin",
"wrapper",
"around",
"plash",
"map"
] | 2ab2bc956e309d5aa6414c80983bfbf29b0ce572 | https://github.com/ihucos/plash/blob/2ab2bc956e309d5aa6414c80983bfbf29b0ce572/opt/plash/lib/py/plash/utils.py#L96-L102 |
13,197 | ihucos/plash | opt/plash/lib/py/plash/macros/packagemanagers.py | defpm | def defpm(name, *lines):
'define a new package manager'
@register_macro(name, group='package managers')
@shell_escape_args
def package_manager(*packages):
if not packages:
return
sh_packages = ' '.join(pkg for pkg in packages)
expanded_lines = [line.format(sh_package... | python | def defpm(name, *lines):
'define a new package manager'
@register_macro(name, group='package managers')
@shell_escape_args
def package_manager(*packages):
if not packages:
return
sh_packages = ' '.join(pkg for pkg in packages)
expanded_lines = [line.format(sh_package... | [
"def",
"defpm",
"(",
"name",
",",
"*",
"lines",
")",
":",
"@",
"register_macro",
"(",
"name",
",",
"group",
"=",
"'package managers'",
")",
"@",
"shell_escape_args",
"def",
"package_manager",
"(",
"*",
"packages",
")",
":",
"if",
"not",
"packages",
":",
... | define a new package manager | [
"define",
"a",
"new",
"package",
"manager"
] | 2ab2bc956e309d5aa6414c80983bfbf29b0ce572 | https://github.com/ihucos/plash/blob/2ab2bc956e309d5aa6414c80983bfbf29b0ce572/opt/plash/lib/py/plash/macros/packagemanagers.py#L5-L17 |
13,198 | ihucos/plash | opt/plash/lib/py/plash/macros/common.py | layer | def layer(command=None, *args):
'hints the start of a new layer'
if not command:
return eval([['hint', 'layer']]) # fall back to buildin layer macro
else:
lst = [['layer']]
for arg in args:
lst.append([command, arg])
lst.append(['layer'])
return eval(... | python | def layer(command=None, *args):
'hints the start of a new layer'
if not command:
return eval([['hint', 'layer']]) # fall back to buildin layer macro
else:
lst = [['layer']]
for arg in args:
lst.append([command, arg])
lst.append(['layer'])
return eval(... | [
"def",
"layer",
"(",
"command",
"=",
"None",
",",
"*",
"args",
")",
":",
"if",
"not",
"command",
":",
"return",
"eval",
"(",
"[",
"[",
"'hint'",
",",
"'layer'",
"]",
"]",
")",
"# fall back to buildin layer macro",
"else",
":",
"lst",
"=",
"[",
"[",
"... | hints the start of a new layer | [
"hints",
"the",
"start",
"of",
"a",
"new",
"layer"
] | 2ab2bc956e309d5aa6414c80983bfbf29b0ce572 | https://github.com/ihucos/plash/blob/2ab2bc956e309d5aa6414c80983bfbf29b0ce572/opt/plash/lib/py/plash/macros/common.py#L15-L24 |
13,199 | ihucos/plash | opt/plash/lib/py/plash/macros/common.py | import_env | def import_env(*envs):
'import environment variables from host'
for env in envs:
parts = env.split(':', 1)
if len(parts) == 1:
export_as = env
else:
env, export_as = parts
env_val = os.environ.get(env)
if env_val is not None:
yield '{}=... | python | def import_env(*envs):
'import environment variables from host'
for env in envs:
parts = env.split(':', 1)
if len(parts) == 1:
export_as = env
else:
env, export_as = parts
env_val = os.environ.get(env)
if env_val is not None:
yield '{}=... | [
"def",
"import_env",
"(",
"*",
"envs",
")",
":",
"for",
"env",
"in",
"envs",
":",
"parts",
"=",
"env",
".",
"split",
"(",
"':'",
",",
"1",
")",
"if",
"len",
"(",
"parts",
")",
"==",
"1",
":",
"export_as",
"=",
"env",
"else",
":",
"env",
",",
... | import environment variables from host | [
"import",
"environment",
"variables",
"from",
"host"
] | 2ab2bc956e309d5aa6414c80983bfbf29b0ce572 | https://github.com/ihucos/plash/blob/2ab2bc956e309d5aa6414c80983bfbf29b0ce572/opt/plash/lib/py/plash/macros/common.py#L40-L50 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.