partition stringclasses 3
values | func_name stringlengths 1 134 | docstring stringlengths 1 46.9k | path stringlengths 4 223 | original_string stringlengths 75 104k | code stringlengths 75 104k | docstring_tokens listlengths 1 1.97k | repo stringlengths 7 55 | language stringclasses 1
value | url stringlengths 87 315 | code_tokens listlengths 19 28.4k | sha stringlengths 40 40 |
|---|---|---|---|---|---|---|---|---|---|---|---|
train | ClienteSATLocal.cancelar_ultima_venda | Sobrepõe :meth:`~satcfe.base.FuncoesSAT.cancelar_ultima_venda`.
:return: Uma resposta SAT especializada em ``CancelarUltimaVenda``.
:rtype: satcfe.resposta.cancelarultimavenda.RespostaCancelarUltimaVenda | satcfe/clientelocal.py | def cancelar_ultima_venda(self, chave_cfe, dados_cancelamento):
"""Sobrepõe :meth:`~satcfe.base.FuncoesSAT.cancelar_ultima_venda`.
:return: Uma resposta SAT especializada em ``CancelarUltimaVenda``.
:rtype: satcfe.resposta.cancelarultimavenda.RespostaCancelarUltimaVenda
"""
reto... | def cancelar_ultima_venda(self, chave_cfe, dados_cancelamento):
"""Sobrepõe :meth:`~satcfe.base.FuncoesSAT.cancelar_ultima_venda`.
:return: Uma resposta SAT especializada em ``CancelarUltimaVenda``.
:rtype: satcfe.resposta.cancelarultimavenda.RespostaCancelarUltimaVenda
"""
reto... | [
"Sobrepõe",
":",
"meth",
":",
"~satcfe",
".",
"base",
".",
"FuncoesSAT",
".",
"cancelar_ultima_venda",
"."
] | base4sistemas/satcfe | python | https://github.com/base4sistemas/satcfe/blob/cb8e8815f4133d3e3d94cf526fa86767b4521ed9/satcfe/clientelocal.py#L78-L86 | [
"def",
"cancelar_ultima_venda",
"(",
"self",
",",
"chave_cfe",
",",
"dados_cancelamento",
")",
":",
"retorno",
"=",
"super",
"(",
"ClienteSATLocal",
",",
"self",
")",
".",
"cancelar_ultima_venda",
"(",
"chave_cfe",
",",
"dados_cancelamento",
")",
"return",
"Respos... | cb8e8815f4133d3e3d94cf526fa86767b4521ed9 |
train | ClienteSATLocal.consultar_sat | Sobrepõe :meth:`~satcfe.base.FuncoesSAT.consultar_sat`.
:return: Uma resposta SAT padrão.
:rtype: satcfe.resposta.padrao.RespostaSAT | satcfe/clientelocal.py | def consultar_sat(self):
"""Sobrepõe :meth:`~satcfe.base.FuncoesSAT.consultar_sat`.
:return: Uma resposta SAT padrão.
:rtype: satcfe.resposta.padrao.RespostaSAT
"""
retorno = super(ClienteSATLocal, self).consultar_sat()
return RespostaSAT.consultar_sat(retorno) | def consultar_sat(self):
"""Sobrepõe :meth:`~satcfe.base.FuncoesSAT.consultar_sat`.
:return: Uma resposta SAT padrão.
:rtype: satcfe.resposta.padrao.RespostaSAT
"""
retorno = super(ClienteSATLocal, self).consultar_sat()
return RespostaSAT.consultar_sat(retorno) | [
"Sobrepõe",
":",
"meth",
":",
"~satcfe",
".",
"base",
".",
"FuncoesSAT",
".",
"consultar_sat",
"."
] | base4sistemas/satcfe | python | https://github.com/base4sistemas/satcfe/blob/cb8e8815f4133d3e3d94cf526fa86767b4521ed9/satcfe/clientelocal.py#L89-L96 | [
"def",
"consultar_sat",
"(",
"self",
")",
":",
"retorno",
"=",
"super",
"(",
"ClienteSATLocal",
",",
"self",
")",
".",
"consultar_sat",
"(",
")",
"return",
"RespostaSAT",
".",
"consultar_sat",
"(",
"retorno",
")"
] | cb8e8815f4133d3e3d94cf526fa86767b4521ed9 |
train | ClienteSATLocal.consultar_status_operacional | Sobrepõe :meth:`~satcfe.base.FuncoesSAT.consultar_status_operacional`.
:return: Uma resposta SAT especializada em ``ConsultarStatusOperacional``.
:rtype: satcfe.resposta.consultarstatusoperacional.RespostaConsultarStatusOperacional | satcfe/clientelocal.py | def consultar_status_operacional(self):
"""Sobrepõe :meth:`~satcfe.base.FuncoesSAT.consultar_status_operacional`.
:return: Uma resposta SAT especializada em ``ConsultarStatusOperacional``.
:rtype: satcfe.resposta.consultarstatusoperacional.RespostaConsultarStatusOperacional
"""
... | def consultar_status_operacional(self):
"""Sobrepõe :meth:`~satcfe.base.FuncoesSAT.consultar_status_operacional`.
:return: Uma resposta SAT especializada em ``ConsultarStatusOperacional``.
:rtype: satcfe.resposta.consultarstatusoperacional.RespostaConsultarStatusOperacional
"""
... | [
"Sobrepõe",
":",
"meth",
":",
"~satcfe",
".",
"base",
".",
"FuncoesSAT",
".",
"consultar_status_operacional",
"."
] | base4sistemas/satcfe | python | https://github.com/base4sistemas/satcfe/blob/cb8e8815f4133d3e3d94cf526fa86767b4521ed9/satcfe/clientelocal.py#L109-L116 | [
"def",
"consultar_status_operacional",
"(",
"self",
")",
":",
"retorno",
"=",
"super",
"(",
"ClienteSATLocal",
",",
"self",
")",
".",
"consultar_status_operacional",
"(",
")",
"return",
"RespostaConsultarStatusOperacional",
".",
"analisar",
"(",
"retorno",
")"
] | cb8e8815f4133d3e3d94cf526fa86767b4521ed9 |
train | ClienteSATLocal.consultar_numero_sessao | Sobrepõe :meth:`~satcfe.base.FuncoesSAT.consultar_numero_sessao`.
:return: Uma resposta SAT que irá depender da sessão consultada.
:rtype: satcfe.resposta.padrao.RespostaSAT | satcfe/clientelocal.py | def consultar_numero_sessao(self, numero_sessao):
"""Sobrepõe :meth:`~satcfe.base.FuncoesSAT.consultar_numero_sessao`.
:return: Uma resposta SAT que irá depender da sessão consultada.
:rtype: satcfe.resposta.padrao.RespostaSAT
"""
retorno = super(ClienteSATLocal, self).\
... | def consultar_numero_sessao(self, numero_sessao):
"""Sobrepõe :meth:`~satcfe.base.FuncoesSAT.consultar_numero_sessao`.
:return: Uma resposta SAT que irá depender da sessão consultada.
:rtype: satcfe.resposta.padrao.RespostaSAT
"""
retorno = super(ClienteSATLocal, self).\
... | [
"Sobrepõe",
":",
"meth",
":",
"~satcfe",
".",
"base",
".",
"FuncoesSAT",
".",
"consultar_numero_sessao",
"."
] | base4sistemas/satcfe | python | https://github.com/base4sistemas/satcfe/blob/cb8e8815f4133d3e3d94cf526fa86767b4521ed9/satcfe/clientelocal.py#L119-L127 | [
"def",
"consultar_numero_sessao",
"(",
"self",
",",
"numero_sessao",
")",
":",
"retorno",
"=",
"super",
"(",
"ClienteSATLocal",
",",
"self",
")",
".",
"consultar_numero_sessao",
"(",
"numero_sessao",
")",
"return",
"RespostaConsultarNumeroSessao",
".",
"analisar",
"... | cb8e8815f4133d3e3d94cf526fa86767b4521ed9 |
train | ClienteSATLocal.configurar_interface_de_rede | Sobrepõe :meth:`~satcfe.base.FuncoesSAT.configurar_interface_de_rede`.
:return: Uma resposta SAT padrão.
:rtype: satcfe.resposta.padrao.RespostaSAT | satcfe/clientelocal.py | def configurar_interface_de_rede(self, configuracao):
"""Sobrepõe :meth:`~satcfe.base.FuncoesSAT.configurar_interface_de_rede`.
:return: Uma resposta SAT padrão.
:rtype: satcfe.resposta.padrao.RespostaSAT
"""
retorno = super(ClienteSATLocal, self).\
configurar_in... | def configurar_interface_de_rede(self, configuracao):
"""Sobrepõe :meth:`~satcfe.base.FuncoesSAT.configurar_interface_de_rede`.
:return: Uma resposta SAT padrão.
:rtype: satcfe.resposta.padrao.RespostaSAT
"""
retorno = super(ClienteSATLocal, self).\
configurar_in... | [
"Sobrepõe",
":",
"meth",
":",
"~satcfe",
".",
"base",
".",
"FuncoesSAT",
".",
"configurar_interface_de_rede",
"."
] | base4sistemas/satcfe | python | https://github.com/base4sistemas/satcfe/blob/cb8e8815f4133d3e3d94cf526fa86767b4521ed9/satcfe/clientelocal.py#L130-L138 | [
"def",
"configurar_interface_de_rede",
"(",
"self",
",",
"configuracao",
")",
":",
"retorno",
"=",
"super",
"(",
"ClienteSATLocal",
",",
"self",
")",
".",
"configurar_interface_de_rede",
"(",
"configuracao",
")",
"return",
"RespostaSAT",
".",
"configurar_interface_de_... | cb8e8815f4133d3e3d94cf526fa86767b4521ed9 |
train | ClienteSATLocal.associar_assinatura | Sobrepõe :meth:`~satcfe.base.FuncoesSAT.associar_assinatura`.
:return: Uma resposta SAT padrão.
:rtype: satcfe.resposta.padrao.RespostaSAT | satcfe/clientelocal.py | def associar_assinatura(self, sequencia_cnpj, assinatura_ac):
"""Sobrepõe :meth:`~satcfe.base.FuncoesSAT.associar_assinatura`.
:return: Uma resposta SAT padrão.
:rtype: satcfe.resposta.padrao.RespostaSAT
"""
retorno = super(ClienteSATLocal, self).\
associar_assin... | def associar_assinatura(self, sequencia_cnpj, assinatura_ac):
"""Sobrepõe :meth:`~satcfe.base.FuncoesSAT.associar_assinatura`.
:return: Uma resposta SAT padrão.
:rtype: satcfe.resposta.padrao.RespostaSAT
"""
retorno = super(ClienteSATLocal, self).\
associar_assin... | [
"Sobrepõe",
":",
"meth",
":",
"~satcfe",
".",
"base",
".",
"FuncoesSAT",
".",
"associar_assinatura",
"."
] | base4sistemas/satcfe | python | https://github.com/base4sistemas/satcfe/blob/cb8e8815f4133d3e3d94cf526fa86767b4521ed9/satcfe/clientelocal.py#L141-L150 | [
"def",
"associar_assinatura",
"(",
"self",
",",
"sequencia_cnpj",
",",
"assinatura_ac",
")",
":",
"retorno",
"=",
"super",
"(",
"ClienteSATLocal",
",",
"self",
")",
".",
"associar_assinatura",
"(",
"sequencia_cnpj",
",",
"assinatura_ac",
")",
"# (!) resposta baseada... | cb8e8815f4133d3e3d94cf526fa86767b4521ed9 |
train | ClienteSATLocal.atualizar_software_sat | Sobrepõe :meth:`~satcfe.base.FuncoesSAT.atualizar_software_sat`.
:return: Uma resposta SAT padrão.
:rtype: satcfe.resposta.padrao.RespostaSAT | satcfe/clientelocal.py | def atualizar_software_sat(self):
"""Sobrepõe :meth:`~satcfe.base.FuncoesSAT.atualizar_software_sat`.
:return: Uma resposta SAT padrão.
:rtype: satcfe.resposta.padrao.RespostaSAT
"""
retorno = super(ClienteSATLocal, self).atualizar_software_sat()
return RespostaSAT.atual... | def atualizar_software_sat(self):
"""Sobrepõe :meth:`~satcfe.base.FuncoesSAT.atualizar_software_sat`.
:return: Uma resposta SAT padrão.
:rtype: satcfe.resposta.padrao.RespostaSAT
"""
retorno = super(ClienteSATLocal, self).atualizar_software_sat()
return RespostaSAT.atual... | [
"Sobrepõe",
":",
"meth",
":",
"~satcfe",
".",
"base",
".",
"FuncoesSAT",
".",
"atualizar_software_sat",
"."
] | base4sistemas/satcfe | python | https://github.com/base4sistemas/satcfe/blob/cb8e8815f4133d3e3d94cf526fa86767b4521ed9/satcfe/clientelocal.py#L153-L160 | [
"def",
"atualizar_software_sat",
"(",
"self",
")",
":",
"retorno",
"=",
"super",
"(",
"ClienteSATLocal",
",",
"self",
")",
".",
"atualizar_software_sat",
"(",
")",
"return",
"RespostaSAT",
".",
"atualizar_software_sat",
"(",
"retorno",
")"
] | cb8e8815f4133d3e3d94cf526fa86767b4521ed9 |
train | ClienteSATLocal.extrair_logs | Sobrepõe :meth:`~satcfe.base.FuncoesSAT.extrair_logs`.
:return: Uma resposta SAT especializada em ``ExtrairLogs``.
:rtype: satcfe.resposta.extrairlogs.RespostaExtrairLogs | satcfe/clientelocal.py | def extrair_logs(self):
"""Sobrepõe :meth:`~satcfe.base.FuncoesSAT.extrair_logs`.
:return: Uma resposta SAT especializada em ``ExtrairLogs``.
:rtype: satcfe.resposta.extrairlogs.RespostaExtrairLogs
"""
retorno = super(ClienteSATLocal, self).extrair_logs()
return Resposta... | def extrair_logs(self):
"""Sobrepõe :meth:`~satcfe.base.FuncoesSAT.extrair_logs`.
:return: Uma resposta SAT especializada em ``ExtrairLogs``.
:rtype: satcfe.resposta.extrairlogs.RespostaExtrairLogs
"""
retorno = super(ClienteSATLocal, self).extrair_logs()
return Resposta... | [
"Sobrepõe",
":",
"meth",
":",
"~satcfe",
".",
"base",
".",
"FuncoesSAT",
".",
"extrair_logs",
"."
] | base4sistemas/satcfe | python | https://github.com/base4sistemas/satcfe/blob/cb8e8815f4133d3e3d94cf526fa86767b4521ed9/satcfe/clientelocal.py#L163-L170 | [
"def",
"extrair_logs",
"(",
"self",
")",
":",
"retorno",
"=",
"super",
"(",
"ClienteSATLocal",
",",
"self",
")",
".",
"extrair_logs",
"(",
")",
"return",
"RespostaExtrairLogs",
".",
"analisar",
"(",
"retorno",
")"
] | cb8e8815f4133d3e3d94cf526fa86767b4521ed9 |
train | ClienteSATLocal.bloquear_sat | Sobrepõe :meth:`~satcfe.base.FuncoesSAT.bloquear_sat`.
:return: Uma resposta SAT padrão.
:rtype: satcfe.resposta.padrao.RespostaSAT | satcfe/clientelocal.py | def bloquear_sat(self):
"""Sobrepõe :meth:`~satcfe.base.FuncoesSAT.bloquear_sat`.
:return: Uma resposta SAT padrão.
:rtype: satcfe.resposta.padrao.RespostaSAT
"""
retorno = super(ClienteSATLocal, self).bloquear_sat()
return RespostaSAT.bloquear_sat(retorno) | def bloquear_sat(self):
"""Sobrepõe :meth:`~satcfe.base.FuncoesSAT.bloquear_sat`.
:return: Uma resposta SAT padrão.
:rtype: satcfe.resposta.padrao.RespostaSAT
"""
retorno = super(ClienteSATLocal, self).bloquear_sat()
return RespostaSAT.bloquear_sat(retorno) | [
"Sobrepõe",
":",
"meth",
":",
"~satcfe",
".",
"base",
".",
"FuncoesSAT",
".",
"bloquear_sat",
"."
] | base4sistemas/satcfe | python | https://github.com/base4sistemas/satcfe/blob/cb8e8815f4133d3e3d94cf526fa86767b4521ed9/satcfe/clientelocal.py#L173-L180 | [
"def",
"bloquear_sat",
"(",
"self",
")",
":",
"retorno",
"=",
"super",
"(",
"ClienteSATLocal",
",",
"self",
")",
".",
"bloquear_sat",
"(",
")",
"return",
"RespostaSAT",
".",
"bloquear_sat",
"(",
"retorno",
")"
] | cb8e8815f4133d3e3d94cf526fa86767b4521ed9 |
train | ClienteSATLocal.desbloquear_sat | Sobrepõe :meth:`~satcfe.base.FuncoesSAT.desbloquear_sat`.
:return: Uma resposta SAT padrão.
:rtype: satcfe.resposta.padrao.RespostaSAT | satcfe/clientelocal.py | def desbloquear_sat(self):
"""Sobrepõe :meth:`~satcfe.base.FuncoesSAT.desbloquear_sat`.
:return: Uma resposta SAT padrão.
:rtype: satcfe.resposta.padrao.RespostaSAT
"""
retorno = super(ClienteSATLocal, self).desbloquear_sat()
return RespostaSAT.desbloquear_sat(retorno) | def desbloquear_sat(self):
"""Sobrepõe :meth:`~satcfe.base.FuncoesSAT.desbloquear_sat`.
:return: Uma resposta SAT padrão.
:rtype: satcfe.resposta.padrao.RespostaSAT
"""
retorno = super(ClienteSATLocal, self).desbloquear_sat()
return RespostaSAT.desbloquear_sat(retorno) | [
"Sobrepõe",
":",
"meth",
":",
"~satcfe",
".",
"base",
".",
"FuncoesSAT",
".",
"desbloquear_sat",
"."
] | base4sistemas/satcfe | python | https://github.com/base4sistemas/satcfe/blob/cb8e8815f4133d3e3d94cf526fa86767b4521ed9/satcfe/clientelocal.py#L183-L190 | [
"def",
"desbloquear_sat",
"(",
"self",
")",
":",
"retorno",
"=",
"super",
"(",
"ClienteSATLocal",
",",
"self",
")",
".",
"desbloquear_sat",
"(",
")",
"return",
"RespostaSAT",
".",
"desbloquear_sat",
"(",
"retorno",
")"
] | cb8e8815f4133d3e3d94cf526fa86767b4521ed9 |
train | ClienteSATLocal.trocar_codigo_de_ativacao | Sobrepõe :meth:`~satcfe.base.FuncoesSAT.trocar_codigo_de_ativacao`.
:return: Uma resposta SAT padrão.
:rtype: satcfe.resposta.padrao.RespostaSAT | satcfe/clientelocal.py | def trocar_codigo_de_ativacao(self, novo_codigo_ativacao,
opcao=constantes.CODIGO_ATIVACAO_REGULAR,
codigo_emergencia=None):
"""Sobrepõe :meth:`~satcfe.base.FuncoesSAT.trocar_codigo_de_ativacao`.
:return: Uma resposta SAT padrão.
:rtype: satcfe.resposta.padrao.RespostaSA... | def trocar_codigo_de_ativacao(self, novo_codigo_ativacao,
opcao=constantes.CODIGO_ATIVACAO_REGULAR,
codigo_emergencia=None):
"""Sobrepõe :meth:`~satcfe.base.FuncoesSAT.trocar_codigo_de_ativacao`.
:return: Uma resposta SAT padrão.
:rtype: satcfe.resposta.padrao.RespostaSA... | [
"Sobrepõe",
":",
"meth",
":",
"~satcfe",
".",
"base",
".",
"FuncoesSAT",
".",
"trocar_codigo_de_ativacao",
"."
] | base4sistemas/satcfe | python | https://github.com/base4sistemas/satcfe/blob/cb8e8815f4133d3e3d94cf526fa86767b4521ed9/satcfe/clientelocal.py#L193-L204 | [
"def",
"trocar_codigo_de_ativacao",
"(",
"self",
",",
"novo_codigo_ativacao",
",",
"opcao",
"=",
"constantes",
".",
"CODIGO_ATIVACAO_REGULAR",
",",
"codigo_emergencia",
"=",
"None",
")",
":",
"retorno",
"=",
"super",
"(",
"ClienteSATLocal",
",",
"self",
")",
".",
... | cb8e8815f4133d3e3d94cf526fa86767b4521ed9 |
train | Entidade.documento | Resulta no documento XML como string, que pode ou não incluir a
declaração XML no início do documento. | satcfe/entidades.py | def documento(self, *args, **kwargs):
"""Resulta no documento XML como string, que pode ou não incluir a
declaração XML no início do documento.
"""
forcar_unicode = kwargs.pop('forcar_unicode', False)
incluir_xml_decl = kwargs.pop('incluir_xml_decl', True)
doc = ET.tostri... | def documento(self, *args, **kwargs):
"""Resulta no documento XML como string, que pode ou não incluir a
declaração XML no início do documento.
"""
forcar_unicode = kwargs.pop('forcar_unicode', False)
incluir_xml_decl = kwargs.pop('incluir_xml_decl', True)
doc = ET.tostri... | [
"Resulta",
"no",
"documento",
"XML",
"como",
"string",
"que",
"pode",
"ou",
"não",
"incluir",
"a",
"declaração",
"XML",
"no",
"início",
"do",
"documento",
"."
] | base4sistemas/satcfe | python | https://github.com/base4sistemas/satcfe/blob/cb8e8815f4133d3e3d94cf526fa86767b4521ed9/satcfe/entidades.py#L308-L324 | [
"def",
"documento",
"(",
"self",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"forcar_unicode",
"=",
"kwargs",
".",
"pop",
"(",
"'forcar_unicode'",
",",
"False",
")",
"incluir_xml_decl",
"=",
"kwargs",
".",
"pop",
"(",
"'incluir_xml_decl'",
",",
... | cb8e8815f4133d3e3d94cf526fa86767b4521ed9 |
train | Application.start | Start the application.
Looks for workspace_location persistent string. If it doesn't find it, uses a default
workspace location.
Then checks to see if that workspace exists. If not and if skip_choose has not been
set to True, asks the user for a workspace location. User... | nion/swift/Application.py | def start(self, skip_choose=False, fixed_workspace_dir=None):
"""
Start the application.
Looks for workspace_location persistent string. If it doesn't find it, uses a default
workspace location.
Then checks to see if that workspace exists. If not and if skip_cho... | def start(self, skip_choose=False, fixed_workspace_dir=None):
"""
Start the application.
Looks for workspace_location persistent string. If it doesn't find it, uses a default
workspace location.
Then checks to see if that workspace exists. If not and if skip_cho... | [
"Start",
"the",
"application",
"."
] | nion-software/nionswift | python | https://github.com/nion-software/nionswift/blob/d43693eaf057b8683b9638e575000f055fede452/nion/swift/Application.py#L176-L229 | [
"def",
"start",
"(",
"self",
",",
"skip_choose",
"=",
"False",
",",
"fixed_workspace_dir",
"=",
"None",
")",
":",
"logging",
".",
"getLogger",
"(",
"\"migration\"",
")",
".",
"setLevel",
"(",
"logging",
".",
"INFO",
")",
"if",
"fixed_workspace_dir",
":",
"... | d43693eaf057b8683b9638e575000f055fede452 |
train | sort_by_date_key | A sort key to for the created field of a data item. The sort by uuid makes it determinate. | nion/swift/model/DataItem.py | def sort_by_date_key(data_item):
""" A sort key to for the created field of a data item. The sort by uuid makes it determinate. """
return data_item.title + str(data_item.uuid) if data_item.is_live else str(), data_item.date_for_sorting, str(data_item.uuid) | def sort_by_date_key(data_item):
""" A sort key to for the created field of a data item. The sort by uuid makes it determinate. """
return data_item.title + str(data_item.uuid) if data_item.is_live else str(), data_item.date_for_sorting, str(data_item.uuid) | [
"A",
"sort",
"key",
"to",
"for",
"the",
"created",
"field",
"of",
"a",
"data",
"item",
".",
"The",
"sort",
"by",
"uuid",
"makes",
"it",
"determinate",
"."
] | nion-software/nionswift | python | https://github.com/nion-software/nionswift/blob/d43693eaf057b8683b9638e575000f055fede452/nion/swift/model/DataItem.py#L1148-L1150 | [
"def",
"sort_by_date_key",
"(",
"data_item",
")",
":",
"return",
"data_item",
".",
"title",
"+",
"str",
"(",
"data_item",
".",
"uuid",
")",
"if",
"data_item",
".",
"is_live",
"else",
"str",
"(",
")",
",",
"data_item",
".",
"date_for_sorting",
",",
"str",
... | d43693eaf057b8683b9638e575000f055fede452 |
train | DataItem.snapshot | Return a new library item which is a copy of this one with any dynamic behavior made static. | nion/swift/model/DataItem.py | def snapshot(self):
"""Return a new library item which is a copy of this one with any dynamic behavior made static."""
data_item = self.__class__()
# data format (temporary until moved to buffered data source)
data_item.large_format = self.large_format
data_item.set_data_and_meta... | def snapshot(self):
"""Return a new library item which is a copy of this one with any dynamic behavior made static."""
data_item = self.__class__()
# data format (temporary until moved to buffered data source)
data_item.large_format = self.large_format
data_item.set_data_and_meta... | [
"Return",
"a",
"new",
"library",
"item",
"which",
"is",
"a",
"copy",
"of",
"this",
"one",
"with",
"any",
"dynamic",
"behavior",
"made",
"static",
"."
] | nion-software/nionswift | python | https://github.com/nion-software/nionswift/blob/d43693eaf057b8683b9638e575000f055fede452/nion/swift/model/DataItem.py#L331-L347 | [
"def",
"snapshot",
"(",
"self",
")",
":",
"data_item",
"=",
"self",
".",
"__class__",
"(",
")",
"# data format (temporary until moved to buffered data source)",
"data_item",
".",
"large_format",
"=",
"self",
".",
"large_format",
"data_item",
".",
"set_data_and_metadata"... | d43693eaf057b8683b9638e575000f055fede452 |
train | DataItem.set_r_value | Used to signal changes to the ref var, which are kept in document controller. ugh. | nion/swift/model/DataItem.py | def set_r_value(self, r_var: str, *, notify_changed=True) -> None:
"""Used to signal changes to the ref var, which are kept in document controller. ugh."""
self.r_var = r_var
self._description_changed()
if notify_changed: # set to False to set the r-value at startup; avoid marking it as... | def set_r_value(self, r_var: str, *, notify_changed=True) -> None:
"""Used to signal changes to the ref var, which are kept in document controller. ugh."""
self.r_var = r_var
self._description_changed()
if notify_changed: # set to False to set the r-value at startup; avoid marking it as... | [
"Used",
"to",
"signal",
"changes",
"to",
"the",
"ref",
"var",
"which",
"are",
"kept",
"in",
"document",
"controller",
".",
"ugh",
"."
] | nion-software/nionswift | python | https://github.com/nion-software/nionswift/blob/d43693eaf057b8683b9638e575000f055fede452/nion/swift/model/DataItem.py#L611-L616 | [
"def",
"set_r_value",
"(",
"self",
",",
"r_var",
":",
"str",
",",
"*",
",",
"notify_changed",
"=",
"True",
")",
"->",
"None",
":",
"self",
".",
"r_var",
"=",
"r_var",
"self",
".",
"_description_changed",
"(",
")",
"if",
"notify_changed",
":",
"# set to F... | d43693eaf057b8683b9638e575000f055fede452 |
train | DataItem.set_data_and_metadata | Sets the underlying data and data-metadata to the data_and_metadata.
Note: this does not make a copy of the data. | nion/swift/model/DataItem.py | def set_data_and_metadata(self, data_and_metadata, data_modified=None):
"""Sets the underlying data and data-metadata to the data_and_metadata.
Note: this does not make a copy of the data.
"""
self.increment_data_ref_count()
try:
if data_and_metadata:
... | def set_data_and_metadata(self, data_and_metadata, data_modified=None):
"""Sets the underlying data and data-metadata to the data_and_metadata.
Note: this does not make a copy of the data.
"""
self.increment_data_ref_count()
try:
if data_and_metadata:
... | [
"Sets",
"the",
"underlying",
"data",
"and",
"data",
"-",
"metadata",
"to",
"the",
"data_and_metadata",
"."
] | nion-software/nionswift | python | https://github.com/nion-software/nionswift/blob/d43693eaf057b8683b9638e575000f055fede452/nion/swift/model/DataItem.py#L1005-L1031 | [
"def",
"set_data_and_metadata",
"(",
"self",
",",
"data_and_metadata",
",",
"data_modified",
"=",
"None",
")",
":",
"self",
".",
"increment_data_ref_count",
"(",
")",
"try",
":",
"if",
"data_and_metadata",
":",
"data",
"=",
"data_and_metadata",
".",
"data",
"dat... | d43693eaf057b8683b9638e575000f055fede452 |
train | DisplayDataChannel.color_map_data | Return the color map data as a uint8 ndarray with shape (256, 3). | nion/swift/model/DisplayItem.py | def color_map_data(self) -> typing.Optional[numpy.ndarray]:
"""Return the color map data as a uint8 ndarray with shape (256, 3)."""
if self.display_data_shape is None: # is there display data?
return None
else:
return self.__color_map_data if self.__color_map_data is not... | def color_map_data(self) -> typing.Optional[numpy.ndarray]:
"""Return the color map data as a uint8 ndarray with shape (256, 3)."""
if self.display_data_shape is None: # is there display data?
return None
else:
return self.__color_map_data if self.__color_map_data is not... | [
"Return",
"the",
"color",
"map",
"data",
"as",
"a",
"uint8",
"ndarray",
"with",
"shape",
"(",
"256",
"3",
")",
"."
] | nion-software/nionswift | python | https://github.com/nion-software/nionswift/blob/d43693eaf057b8683b9638e575000f055fede452/nion/swift/model/DisplayItem.py#L670-L675 | [
"def",
"color_map_data",
"(",
"self",
")",
"->",
"typing",
".",
"Optional",
"[",
"numpy",
".",
"ndarray",
"]",
":",
"if",
"self",
".",
"display_data_shape",
"is",
"None",
":",
"# is there display data?",
"return",
"None",
"else",
":",
"return",
"self",
".",
... | d43693eaf057b8683b9638e575000f055fede452 |
train | DisplayDataChannel.get_calculated_display_values | Return the display values.
Return the current (possibly uncalculated) display values unless 'immediate' is specified.
If 'immediate', return the existing (calculated) values if they exist. Using the 'immediate' values
avoids calculation except in cases where the display values haven't already ... | nion/swift/model/DisplayItem.py | def get_calculated_display_values(self, immediate: bool=False) -> DisplayValues:
"""Return the display values.
Return the current (possibly uncalculated) display values unless 'immediate' is specified.
If 'immediate', return the existing (calculated) values if they exist. Using the 'immediate'... | def get_calculated_display_values(self, immediate: bool=False) -> DisplayValues:
"""Return the display values.
Return the current (possibly uncalculated) display values unless 'immediate' is specified.
If 'immediate', return the existing (calculated) values if they exist. Using the 'immediate'... | [
"Return",
"the",
"display",
"values",
"."
] | nion-software/nionswift | python | https://github.com/nion-software/nionswift/blob/d43693eaf057b8683b9638e575000f055fede452/nion/swift/model/DisplayItem.py#L718-L736 | [
"def",
"get_calculated_display_values",
"(",
"self",
",",
"immediate",
":",
"bool",
"=",
"False",
")",
"->",
"DisplayValues",
":",
"if",
"not",
"immediate",
"or",
"not",
"self",
".",
"__is_master",
"or",
"not",
"self",
".",
"__last_display_values",
":",
"if",
... | d43693eaf057b8683b9638e575000f055fede452 |
train | DisplayDataChannel.increment_display_ref_count | Increment display reference count to indicate this library item is currently displayed. | nion/swift/model/DisplayItem.py | def increment_display_ref_count(self, amount: int=1):
"""Increment display reference count to indicate this library item is currently displayed."""
display_ref_count = self.__display_ref_count
self.__display_ref_count += amount
if display_ref_count == 0:
self.__is_master = Tr... | def increment_display_ref_count(self, amount: int=1):
"""Increment display reference count to indicate this library item is currently displayed."""
display_ref_count = self.__display_ref_count
self.__display_ref_count += amount
if display_ref_count == 0:
self.__is_master = Tr... | [
"Increment",
"display",
"reference",
"count",
"to",
"indicate",
"this",
"library",
"item",
"is",
"currently",
"displayed",
"."
] | nion-software/nionswift | python | https://github.com/nion-software/nionswift/blob/d43693eaf057b8683b9638e575000f055fede452/nion/swift/model/DisplayItem.py#L738-L746 | [
"def",
"increment_display_ref_count",
"(",
"self",
",",
"amount",
":",
"int",
"=",
"1",
")",
":",
"display_ref_count",
"=",
"self",
".",
"__display_ref_count",
"self",
".",
"__display_ref_count",
"+=",
"amount",
"if",
"display_ref_count",
"==",
"0",
":",
"self",... | d43693eaf057b8683b9638e575000f055fede452 |
train | DisplayDataChannel.decrement_display_ref_count | Decrement display reference count to indicate this library item is no longer displayed. | nion/swift/model/DisplayItem.py | def decrement_display_ref_count(self, amount: int=1):
"""Decrement display reference count to indicate this library item is no longer displayed."""
assert not self._closed
self.__display_ref_count -= amount
if self.__display_ref_count == 0:
self.__is_master = False
if... | def decrement_display_ref_count(self, amount: int=1):
"""Decrement display reference count to indicate this library item is no longer displayed."""
assert not self._closed
self.__display_ref_count -= amount
if self.__display_ref_count == 0:
self.__is_master = False
if... | [
"Decrement",
"display",
"reference",
"count",
"to",
"indicate",
"this",
"library",
"item",
"is",
"no",
"longer",
"displayed",
"."
] | nion-software/nionswift | python | https://github.com/nion-software/nionswift/blob/d43693eaf057b8683b9638e575000f055fede452/nion/swift/model/DisplayItem.py#L748-L756 | [
"def",
"decrement_display_ref_count",
"(",
"self",
",",
"amount",
":",
"int",
"=",
"1",
")",
":",
"assert",
"not",
"self",
".",
"_closed",
"self",
".",
"__display_ref_count",
"-=",
"amount",
"if",
"self",
".",
"__display_ref_count",
"==",
"0",
":",
"self",
... | d43693eaf057b8683b9638e575000f055fede452 |
train | DisplayDataChannel.auto_display_limits | Calculate best display limits and set them. | nion/swift/model/DisplayItem.py | def auto_display_limits(self):
"""Calculate best display limits and set them."""
display_data_and_metadata = self.get_calculated_display_values(True).display_data_and_metadata
data = display_data_and_metadata.data if display_data_and_metadata else None
if data is not None:
# ... | def auto_display_limits(self):
"""Calculate best display limits and set them."""
display_data_and_metadata = self.get_calculated_display_values(True).display_data_and_metadata
data = display_data_and_metadata.data if display_data_and_metadata else None
if data is not None:
# ... | [
"Calculate",
"best",
"display",
"limits",
"and",
"set",
"them",
"."
] | nion-software/nionswift | python | https://github.com/nion-software/nionswift/blob/d43693eaf057b8683b9638e575000f055fede452/nion/swift/model/DisplayItem.py#L766-L776 | [
"def",
"auto_display_limits",
"(",
"self",
")",
":",
"display_data_and_metadata",
"=",
"self",
".",
"get_calculated_display_values",
"(",
"True",
")",
".",
"display_data_and_metadata",
"data",
"=",
"display_data_and_metadata",
".",
"data",
"if",
"display_data_and_metadata... | d43693eaf057b8683b9638e575000f055fede452 |
train | DisplayItem.snapshot | Return a new library item which is a copy of this one with any dynamic behavior made static. | nion/swift/model/DisplayItem.py | def snapshot(self):
"""Return a new library item which is a copy of this one with any dynamic behavior made static."""
display_item = self.__class__()
display_item.display_type = self.display_type
# metadata
display_item._set_persistent_property_value("title", self._get_persisten... | def snapshot(self):
"""Return a new library item which is a copy of this one with any dynamic behavior made static."""
display_item = self.__class__()
display_item.display_type = self.display_type
# metadata
display_item._set_persistent_property_value("title", self._get_persisten... | [
"Return",
"a",
"new",
"library",
"item",
"which",
"is",
"a",
"copy",
"of",
"this",
"one",
"with",
"any",
"dynamic",
"behavior",
"made",
"static",
"."
] | nion-software/nionswift | python | https://github.com/nion-software/nionswift/blob/d43693eaf057b8683b9638e575000f055fede452/nion/swift/model/DisplayItem.py#L980-L998 | [
"def",
"snapshot",
"(",
"self",
")",
":",
"display_item",
"=",
"self",
".",
"__class__",
"(",
")",
"display_item",
".",
"display_type",
"=",
"self",
".",
"display_type",
"# metadata",
"display_item",
".",
"_set_persistent_property_value",
"(",
"\"title\"",
",",
... | d43693eaf057b8683b9638e575000f055fede452 |
train | DisplayItem.increment_display_ref_count | Increment display reference count to indicate this library item is currently displayed. | nion/swift/model/DisplayItem.py | def increment_display_ref_count(self, amount: int=1):
"""Increment display reference count to indicate this library item is currently displayed."""
display_ref_count = self.__display_ref_count
self.__display_ref_count += amount
for display_data_channel in self.display_data_channels:
... | def increment_display_ref_count(self, amount: int=1):
"""Increment display reference count to indicate this library item is currently displayed."""
display_ref_count = self.__display_ref_count
self.__display_ref_count += amount
for display_data_channel in self.display_data_channels:
... | [
"Increment",
"display",
"reference",
"count",
"to",
"indicate",
"this",
"library",
"item",
"is",
"currently",
"displayed",
"."
] | nion-software/nionswift | python | https://github.com/nion-software/nionswift/blob/d43693eaf057b8683b9638e575000f055fede452/nion/swift/model/DisplayItem.py#L1167-L1172 | [
"def",
"increment_display_ref_count",
"(",
"self",
",",
"amount",
":",
"int",
"=",
"1",
")",
":",
"display_ref_count",
"=",
"self",
".",
"__display_ref_count",
"self",
".",
"__display_ref_count",
"+=",
"amount",
"for",
"display_data_channel",
"in",
"self",
".",
... | d43693eaf057b8683b9638e575000f055fede452 |
train | DisplayItem.decrement_display_ref_count | Decrement display reference count to indicate this library item is no longer displayed. | nion/swift/model/DisplayItem.py | def decrement_display_ref_count(self, amount: int=1):
"""Decrement display reference count to indicate this library item is no longer displayed."""
assert not self._closed
self.__display_ref_count -= amount
for display_data_channel in self.display_data_channels:
display_data_... | def decrement_display_ref_count(self, amount: int=1):
"""Decrement display reference count to indicate this library item is no longer displayed."""
assert not self._closed
self.__display_ref_count -= amount
for display_data_channel in self.display_data_channels:
display_data_... | [
"Decrement",
"display",
"reference",
"count",
"to",
"indicate",
"this",
"library",
"item",
"is",
"no",
"longer",
"displayed",
"."
] | nion-software/nionswift | python | https://github.com/nion-software/nionswift/blob/d43693eaf057b8683b9638e575000f055fede452/nion/swift/model/DisplayItem.py#L1174-L1179 | [
"def",
"decrement_display_ref_count",
"(",
"self",
",",
"amount",
":",
"int",
"=",
"1",
")",
":",
"assert",
"not",
"self",
".",
"_closed",
"self",
".",
"__display_ref_count",
"-=",
"amount",
"for",
"display_data_channel",
"in",
"self",
".",
"display_data_channel... | d43693eaf057b8683b9638e575000f055fede452 |
train | DisplayItem.remove_graphic | Remove a graphic, but do it through the container, so dependencies can be tracked. | nion/swift/model/DisplayItem.py | def remove_graphic(self, graphic: Graphics.Graphic, *, safe: bool=False) -> typing.Optional[typing.Sequence]:
"""Remove a graphic, but do it through the container, so dependencies can be tracked."""
return self.remove_model_item(self, "graphics", graphic, safe=safe) | def remove_graphic(self, graphic: Graphics.Graphic, *, safe: bool=False) -> typing.Optional[typing.Sequence]:
"""Remove a graphic, but do it through the container, so dependencies can be tracked."""
return self.remove_model_item(self, "graphics", graphic, safe=safe) | [
"Remove",
"a",
"graphic",
"but",
"do",
"it",
"through",
"the",
"container",
"so",
"dependencies",
"can",
"be",
"tracked",
"."
] | nion-software/nionswift | python | https://github.com/nion-software/nionswift/blob/d43693eaf057b8683b9638e575000f055fede452/nion/swift/model/DisplayItem.py#L1446-L1448 | [
"def",
"remove_graphic",
"(",
"self",
",",
"graphic",
":",
"Graphics",
".",
"Graphic",
",",
"*",
",",
"safe",
":",
"bool",
"=",
"False",
")",
"->",
"typing",
".",
"Optional",
"[",
"typing",
".",
"Sequence",
"]",
":",
"return",
"self",
".",
"remove_mode... | d43693eaf057b8683b9638e575000f055fede452 |
train | DisplayItem.dimensional_shape | Shape of the underlying data, if only one. | nion/swift/model/DisplayItem.py | def dimensional_shape(self) -> typing.Optional[typing.Tuple[int, ...]]:
"""Shape of the underlying data, if only one."""
if not self.__data_and_metadata:
return None
return self.__data_and_metadata.dimensional_shape | def dimensional_shape(self) -> typing.Optional[typing.Tuple[int, ...]]:
"""Shape of the underlying data, if only one."""
if not self.__data_and_metadata:
return None
return self.__data_and_metadata.dimensional_shape | [
"Shape",
"of",
"the",
"underlying",
"data",
"if",
"only",
"one",
"."
] | nion-software/nionswift | python | https://github.com/nion-software/nionswift/blob/d43693eaf057b8683b9638e575000f055fede452/nion/swift/model/DisplayItem.py#L1482-L1486 | [
"def",
"dimensional_shape",
"(",
"self",
")",
"->",
"typing",
".",
"Optional",
"[",
"typing",
".",
"Tuple",
"[",
"int",
",",
"...",
"]",
"]",
":",
"if",
"not",
"self",
".",
"__data_and_metadata",
":",
"return",
"None",
"return",
"self",
".",
"__data_and_... | d43693eaf057b8683b9638e575000f055fede452 |
train | DisplayItem.view_to_intervals | Change the view to encompass the channels and data represented by the given intervals. | nion/swift/model/DisplayItem.py | def view_to_intervals(self, data_and_metadata: DataAndMetadata.DataAndMetadata, intervals: typing.List[typing.Tuple[float, float]]) -> None:
"""Change the view to encompass the channels and data represented by the given intervals."""
left = None
right = None
for interval in intervals:
... | def view_to_intervals(self, data_and_metadata: DataAndMetadata.DataAndMetadata, intervals: typing.List[typing.Tuple[float, float]]) -> None:
"""Change the view to encompass the channels and data represented by the given intervals."""
left = None
right = None
for interval in intervals:
... | [
"Change",
"the",
"view",
"to",
"encompass",
"the",
"channels",
"and",
"data",
"represented",
"by",
"the",
"given",
"intervals",
"."
] | nion-software/nionswift | python | https://github.com/nion-software/nionswift/blob/d43693eaf057b8683b9638e575000f055fede452/nion/swift/model/DisplayItem.py#L1587-L1611 | [
"def",
"view_to_intervals",
"(",
"self",
",",
"data_and_metadata",
":",
"DataAndMetadata",
".",
"DataAndMetadata",
",",
"intervals",
":",
"typing",
".",
"List",
"[",
"typing",
".",
"Tuple",
"[",
"float",
",",
"float",
"]",
"]",
")",
"->",
"None",
":",
"lef... | d43693eaf057b8683b9638e575000f055fede452 |
train | write_local_file | Writes a zip file local file header structure at the current file position.
Returns data_len, crc32 for the data.
:param fp: the file point to which to write the header
:param name: the name of the file
:param writer: a function taking an fp parameter to do the writing, returns crc32
... | nion/swift/model/NDataHandler.py | def write_local_file(fp, name_bytes, writer, dt):
"""
Writes a zip file local file header structure at the current file position.
Returns data_len, crc32 for the data.
:param fp: the file point to which to write the header
:param name: the name of the file
:param writer: a ... | def write_local_file(fp, name_bytes, writer, dt):
"""
Writes a zip file local file header structure at the current file position.
Returns data_len, crc32 for the data.
:param fp: the file point to which to write the header
:param name: the name of the file
:param writer: a ... | [
"Writes",
"a",
"zip",
"file",
"local",
"file",
"header",
"structure",
"at",
"the",
"current",
"file",
"position",
"."
] | nion-software/nionswift | python | https://github.com/nion-software/nionswift/blob/d43693eaf057b8683b9638e575000f055fede452/nion/swift/model/NDataHandler.py#L40-L77 | [
"def",
"write_local_file",
"(",
"fp",
",",
"name_bytes",
",",
"writer",
",",
"dt",
")",
":",
"fp",
".",
"write",
"(",
"struct",
".",
"pack",
"(",
"'I'",
",",
"0x04034b50",
")",
")",
"# local file header",
"fp",
".",
"write",
"(",
"struct",
".",
"pack",... | d43693eaf057b8683b9638e575000f055fede452 |
train | write_directory_data | Write a zip fie directory entry at the current file position
:param fp: the file point to which to write the header
:param offset: the offset of the associated local file header
:param name: the name of the file
:param data_len: the length of data that will be written to the archive
... | nion/swift/model/NDataHandler.py | def write_directory_data(fp, offset, name_bytes, data_len, crc32, dt):
"""
Write a zip fie directory entry at the current file position
:param fp: the file point to which to write the header
:param offset: the offset of the associated local file header
:param name: the name of the f... | def write_directory_data(fp, offset, name_bytes, data_len, crc32, dt):
"""
Write a zip fie directory entry at the current file position
:param fp: the file point to which to write the header
:param offset: the offset of the associated local file header
:param name: the name of the f... | [
"Write",
"a",
"zip",
"fie",
"directory",
"entry",
"at",
"the",
"current",
"file",
"position"
] | nion-software/nionswift | python | https://github.com/nion-software/nionswift/blob/d43693eaf057b8683b9638e575000f055fede452/nion/swift/model/NDataHandler.py#L80-L110 | [
"def",
"write_directory_data",
"(",
"fp",
",",
"offset",
",",
"name_bytes",
",",
"data_len",
",",
"crc32",
",",
"dt",
")",
":",
"fp",
".",
"write",
"(",
"struct",
".",
"pack",
"(",
"'I'",
",",
"0x02014b50",
")",
")",
"# central directory header",
"fp",
"... | d43693eaf057b8683b9638e575000f055fede452 |
train | write_end_of_directory | Write zip file end of directory header at the current file position
:param fp: the file point to which to write the header
:param dir_size: the total size of the directory
:param dir_offset: the start of the first directory header
:param count: the count of files | nion/swift/model/NDataHandler.py | def write_end_of_directory(fp, dir_size, dir_offset, count):
"""
Write zip file end of directory header at the current file position
:param fp: the file point to which to write the header
:param dir_size: the total size of the directory
:param dir_offset: the start of the first dire... | def write_end_of_directory(fp, dir_size, dir_offset, count):
"""
Write zip file end of directory header at the current file position
:param fp: the file point to which to write the header
:param dir_size: the total size of the directory
:param dir_offset: the start of the first dire... | [
"Write",
"zip",
"file",
"end",
"of",
"directory",
"header",
"at",
"the",
"current",
"file",
"position"
] | nion-software/nionswift | python | https://github.com/nion-software/nionswift/blob/d43693eaf057b8683b9638e575000f055fede452/nion/swift/model/NDataHandler.py#L113-L129 | [
"def",
"write_end_of_directory",
"(",
"fp",
",",
"dir_size",
",",
"dir_offset",
",",
"count",
")",
":",
"fp",
".",
"write",
"(",
"struct",
".",
"pack",
"(",
"'I'",
",",
"0x06054b50",
")",
")",
"# central directory header",
"fp",
".",
"write",
"(",
"struct"... | d43693eaf057b8683b9638e575000f055fede452 |
train | write_zip_fp | Write custom zip file of data and properties to fp
:param fp: the file point to which to write the header
:param data: the data to write to the file; may be None
:param properties: the properties to write to the file; may be None
:param dir_data_list: optional list of directory header i... | nion/swift/model/NDataHandler.py | def write_zip_fp(fp, data, properties, dir_data_list=None):
"""
Write custom zip file of data and properties to fp
:param fp: the file point to which to write the header
:param data: the data to write to the file; may be None
:param properties: the properties to write to the file; m... | def write_zip_fp(fp, data, properties, dir_data_list=None):
"""
Write custom zip file of data and properties to fp
:param fp: the file point to which to write the header
:param data: the data to write to the file; may be None
:param properties: the properties to write to the file; m... | [
"Write",
"custom",
"zip",
"file",
"of",
"data",
"and",
"properties",
"to",
"fp"
] | nion-software/nionswift | python | https://github.com/nion-software/nionswift/blob/d43693eaf057b8683b9638e575000f055fede452/nion/swift/model/NDataHandler.py#L132-L199 | [
"def",
"write_zip_fp",
"(",
"fp",
",",
"data",
",",
"properties",
",",
"dir_data_list",
"=",
"None",
")",
":",
"assert",
"data",
"is",
"not",
"None",
"or",
"properties",
"is",
"not",
"None",
"# dir_data_list has the format: local file record offset, name, data length,... | d43693eaf057b8683b9638e575000f055fede452 |
train | write_zip | Write custom zip file to the file path
:param file_path: the file to which to write the zip file
:param data: the data to write to the file; may be None
:param properties: the properties to write to the file; may be None
The properties param must not change during this method. Callers ... | nion/swift/model/NDataHandler.py | def write_zip(file_path, data, properties):
"""
Write custom zip file to the file path
:param file_path: the file to which to write the zip file
:param data: the data to write to the file; may be None
:param properties: the properties to write to the file; may be None
The p... | def write_zip(file_path, data, properties):
"""
Write custom zip file to the file path
:param file_path: the file to which to write the zip file
:param data: the data to write to the file; may be None
:param properties: the properties to write to the file; may be None
The p... | [
"Write",
"custom",
"zip",
"file",
"to",
"the",
"file",
"path"
] | nion-software/nionswift | python | https://github.com/nion-software/nionswift/blob/d43693eaf057b8683b9638e575000f055fede452/nion/swift/model/NDataHandler.py#L202-L216 | [
"def",
"write_zip",
"(",
"file_path",
",",
"data",
",",
"properties",
")",
":",
"with",
"open",
"(",
"file_path",
",",
"\"w+b\"",
")",
"as",
"fp",
":",
"write_zip_fp",
"(",
"fp",
",",
"data",
",",
"properties",
")"
] | d43693eaf057b8683b9638e575000f055fede452 |
train | parse_zip | Parse the zip file headers at fp
:param fp: the file pointer from which to parse the zip file
:return: A tuple of local files, directory headers, and end of central directory
The local files are dictionary where the keys are the local file offset and the
values are each a tuple consist... | nion/swift/model/NDataHandler.py | def parse_zip(fp):
"""
Parse the zip file headers at fp
:param fp: the file pointer from which to parse the zip file
:return: A tuple of local files, directory headers, and end of central directory
The local files are dictionary where the keys are the local file offset and the
... | def parse_zip(fp):
"""
Parse the zip file headers at fp
:param fp: the file pointer from which to parse the zip file
:return: A tuple of local files, directory headers, and end of central directory
The local files are dictionary where the keys are the local file offset and the
... | [
"Parse",
"the",
"zip",
"file",
"headers",
"at",
"fp"
] | nion-software/nionswift | python | https://github.com/nion-software/nionswift/blob/d43693eaf057b8683b9638e575000f055fede452/nion/swift/model/NDataHandler.py#L219-L275 | [
"def",
"parse_zip",
"(",
"fp",
")",
":",
"local_files",
"=",
"{",
"}",
"dir_files",
"=",
"{",
"}",
"eocd",
"=",
"None",
"fp",
".",
"seek",
"(",
"0",
")",
"while",
"True",
":",
"pos",
"=",
"fp",
".",
"tell",
"(",
")",
"signature",
"=",
"struct",
... | d43693eaf057b8683b9638e575000f055fede452 |
train | read_data | Read a numpy data array from the zip file
:param fp: a file pointer
:param local_files: the local files structure
:param dir_files: the directory headers
:param name: the name of the data file to read
:return: the numpy data array, if found
The file pointer will be at a... | nion/swift/model/NDataHandler.py | def read_data(fp, local_files, dir_files, name_bytes):
"""
Read a numpy data array from the zip file
:param fp: a file pointer
:param local_files: the local files structure
:param dir_files: the directory headers
:param name: the name of the data file to read
:return... | def read_data(fp, local_files, dir_files, name_bytes):
"""
Read a numpy data array from the zip file
:param fp: a file pointer
:param local_files: the local files structure
:param dir_files: the directory headers
:param name: the name of the data file to read
:return... | [
"Read",
"a",
"numpy",
"data",
"array",
"from",
"the",
"zip",
"file"
] | nion-software/nionswift | python | https://github.com/nion-software/nionswift/blob/d43693eaf057b8683b9638e575000f055fede452/nion/swift/model/NDataHandler.py#L278-L297 | [
"def",
"read_data",
"(",
"fp",
",",
"local_files",
",",
"dir_files",
",",
"name_bytes",
")",
":",
"if",
"name_bytes",
"in",
"dir_files",
":",
"fp",
".",
"seek",
"(",
"local_files",
"[",
"dir_files",
"[",
"name_bytes",
"]",
"[",
"1",
"]",
"]",
"[",
"1",... | d43693eaf057b8683b9638e575000f055fede452 |
train | read_json | Read json properties from the zip file
:param fp: a file pointer
:param local_files: the local files structure
:param dir_files: the directory headers
:param name: the name of the json file to read
:return: the json properites as a dictionary, if found
The file pointer ... | nion/swift/model/NDataHandler.py | def read_json(fp, local_files, dir_files, name_bytes):
"""
Read json properties from the zip file
:param fp: a file pointer
:param local_files: the local files structure
:param dir_files: the directory headers
:param name: the name of the json file to read
:return: t... | def read_json(fp, local_files, dir_files, name_bytes):
"""
Read json properties from the zip file
:param fp: a file pointer
:param local_files: the local files structure
:param dir_files: the directory headers
:param name: the name of the json file to read
:return: t... | [
"Read",
"json",
"properties",
"from",
"the",
"zip",
"file"
] | nion-software/nionswift | python | https://github.com/nion-software/nionswift/blob/d43693eaf057b8683b9638e575000f055fede452/nion/swift/model/NDataHandler.py#L300-L322 | [
"def",
"read_json",
"(",
"fp",
",",
"local_files",
",",
"dir_files",
",",
"name_bytes",
")",
":",
"if",
"name_bytes",
"in",
"dir_files",
":",
"json_pos",
"=",
"local_files",
"[",
"dir_files",
"[",
"name_bytes",
"]",
"[",
"1",
"]",
"]",
"[",
"1",
"]",
"... | d43693eaf057b8683b9638e575000f055fede452 |
train | rewrite_zip | Rewrite the json properties in the zip file
:param file_path: the file path to the zip file
:param properties: the updated properties to write to the zip file
This method will attempt to keep the data file within the zip
file intact without rewriting it. However, if the data file is no... | nion/swift/model/NDataHandler.py | def rewrite_zip(file_path, properties):
"""
Rewrite the json properties in the zip file
:param file_path: the file path to the zip file
:param properties: the updated properties to write to the zip file
This method will attempt to keep the data file within the zip
file inta... | def rewrite_zip(file_path, properties):
"""
Rewrite the json properties in the zip file
:param file_path: the file path to the zip file
:param properties: the updated properties to write to the zip file
This method will attempt to keep the data file within the zip
file inta... | [
"Rewrite",
"the",
"json",
"properties",
"in",
"the",
"zip",
"file"
] | nion-software/nionswift | python | https://github.com/nion-software/nionswift/blob/d43693eaf057b8683b9638e575000f055fede452/nion/swift/model/NDataHandler.py#L325-L356 | [
"def",
"rewrite_zip",
"(",
"file_path",
",",
"properties",
")",
":",
"with",
"open",
"(",
"file_path",
",",
"\"r+b\"",
")",
"as",
"fp",
":",
"local_files",
",",
"dir_files",
",",
"eocd",
"=",
"parse_zip",
"(",
"fp",
")",
"# check to make sure directory has two... | d43693eaf057b8683b9638e575000f055fede452 |
train | NDataHandler.is_matching | Return whether the given absolute file path is an ndata file. | nion/swift/model/NDataHandler.py | def is_matching(cls, file_path):
"""
Return whether the given absolute file path is an ndata file.
"""
if file_path.endswith(".ndata") and os.path.exists(file_path):
try:
with open(file_path, "r+b") as fp:
local_files, dir_files, eocd =... | def is_matching(cls, file_path):
"""
Return whether the given absolute file path is an ndata file.
"""
if file_path.endswith(".ndata") and os.path.exists(file_path):
try:
with open(file_path, "r+b") as fp:
local_files, dir_files, eocd =... | [
"Return",
"whether",
"the",
"given",
"absolute",
"file",
"path",
"is",
"an",
"ndata",
"file",
"."
] | nion-software/nionswift | python | https://github.com/nion-software/nionswift/blob/d43693eaf057b8683b9638e575000f055fede452/nion/swift/model/NDataHandler.py#L393-L411 | [
"def",
"is_matching",
"(",
"cls",
",",
"file_path",
")",
":",
"if",
"file_path",
".",
"endswith",
"(",
"\".ndata\"",
")",
"and",
"os",
".",
"path",
".",
"exists",
"(",
"file_path",
")",
":",
"try",
":",
"with",
"open",
"(",
"file_path",
",",
"\"r+b\"",... | d43693eaf057b8683b9638e575000f055fede452 |
train | NDataHandler.write_data | Write data to the ndata file specified by reference.
:param data: the numpy array data to write
:param file_datetime: the datetime for the file | nion/swift/model/NDataHandler.py | def write_data(self, data, file_datetime):
"""
Write data to the ndata file specified by reference.
:param data: the numpy array data to write
:param file_datetime: the datetime for the file
"""
with self.__lock:
assert data is not None
... | def write_data(self, data, file_datetime):
"""
Write data to the ndata file specified by reference.
:param data: the numpy array data to write
:param file_datetime: the datetime for the file
"""
with self.__lock:
assert data is not None
... | [
"Write",
"data",
"to",
"the",
"ndata",
"file",
"specified",
"by",
"reference",
"."
] | nion-software/nionswift | python | https://github.com/nion-software/nionswift/blob/d43693eaf057b8683b9638e575000f055fede452/nion/swift/model/NDataHandler.py#L425-L442 | [
"def",
"write_data",
"(",
"self",
",",
"data",
",",
"file_datetime",
")",
":",
"with",
"self",
".",
"__lock",
":",
"assert",
"data",
"is",
"not",
"None",
"absolute_file_path",
"=",
"self",
".",
"__file_path",
"#logging.debug(\"WRITE data file %s for %s\", absolute_f... | d43693eaf057b8683b9638e575000f055fede452 |
train | NDataHandler.write_properties | Write properties to the ndata file specified by reference.
:param reference: the reference to which to write
:param properties: the dict to write to the file
:param file_datetime: the datetime for the file
The properties param must not change during this method. Callers... | nion/swift/model/NDataHandler.py | def write_properties(self, properties, file_datetime):
"""
Write properties to the ndata file specified by reference.
:param reference: the reference to which to write
:param properties: the dict to write to the file
:param file_datetime: the datetime for the fil... | def write_properties(self, properties, file_datetime):
"""
Write properties to the ndata file specified by reference.
:param reference: the reference to which to write
:param properties: the dict to write to the file
:param file_datetime: the datetime for the fil... | [
"Write",
"properties",
"to",
"the",
"ndata",
"file",
"specified",
"by",
"reference",
"."
] | nion-software/nionswift | python | https://github.com/nion-software/nionswift/blob/d43693eaf057b8683b9638e575000f055fede452/nion/swift/model/NDataHandler.py#L444-L467 | [
"def",
"write_properties",
"(",
"self",
",",
"properties",
",",
"file_datetime",
")",
":",
"with",
"self",
".",
"__lock",
":",
"absolute_file_path",
"=",
"self",
".",
"__file_path",
"#logging.debug(\"WRITE properties %s for %s\", absolute_file_path, key)",
"make_directory_i... | d43693eaf057b8683b9638e575000f055fede452 |
train | NDataHandler.read_properties | Read properties from the ndata file reference
:param reference: the reference from which to read
:return: a tuple of the item_uuid and a dict of the properties | nion/swift/model/NDataHandler.py | def read_properties(self):
"""
Read properties from the ndata file reference
:param reference: the reference from which to read
:return: a tuple of the item_uuid and a dict of the properties
"""
with self.__lock:
absolute_file_path = self.__file_p... | def read_properties(self):
"""
Read properties from the ndata file reference
:param reference: the reference from which to read
:return: a tuple of the item_uuid and a dict of the properties
"""
with self.__lock:
absolute_file_path = self.__file_p... | [
"Read",
"properties",
"from",
"the",
"ndata",
"file",
"reference"
] | nion-software/nionswift | python | https://github.com/nion-software/nionswift/blob/d43693eaf057b8683b9638e575000f055fede452/nion/swift/model/NDataHandler.py#L469-L481 | [
"def",
"read_properties",
"(",
"self",
")",
":",
"with",
"self",
".",
"__lock",
":",
"absolute_file_path",
"=",
"self",
".",
"__file_path",
"with",
"open",
"(",
"absolute_file_path",
",",
"\"rb\"",
")",
"as",
"fp",
":",
"local_files",
",",
"dir_files",
",",
... | d43693eaf057b8683b9638e575000f055fede452 |
train | NDataHandler.read_data | Read data from the ndata file reference
:param reference: the reference from which to read
:return: a numpy array of the data; maybe None | nion/swift/model/NDataHandler.py | def read_data(self):
"""
Read data from the ndata file reference
:param reference: the reference from which to read
:return: a numpy array of the data; maybe None
"""
with self.__lock:
absolute_file_path = self.__file_path
#logging.deb... | def read_data(self):
"""
Read data from the ndata file reference
:param reference: the reference from which to read
:return: a numpy array of the data; maybe None
"""
with self.__lock:
absolute_file_path = self.__file_path
#logging.deb... | [
"Read",
"data",
"from",
"the",
"ndata",
"file",
"reference"
] | nion-software/nionswift | python | https://github.com/nion-software/nionswift/blob/d43693eaf057b8683b9638e575000f055fede452/nion/swift/model/NDataHandler.py#L483-L496 | [
"def",
"read_data",
"(",
"self",
")",
":",
"with",
"self",
".",
"__lock",
":",
"absolute_file_path",
"=",
"self",
".",
"__file_path",
"#logging.debug(\"READ data file %s\", absolute_file_path)",
"with",
"open",
"(",
"absolute_file_path",
",",
"\"rb\"",
")",
"as",
"f... | d43693eaf057b8683b9638e575000f055fede452 |
train | NDataHandler.remove | Remove the ndata file reference
:param reference: the reference to remove | nion/swift/model/NDataHandler.py | def remove(self):
"""
Remove the ndata file reference
:param reference: the reference to remove
"""
with self.__lock:
absolute_file_path = self.__file_path
#logging.debug("DELETE data file %s", absolute_file_path)
if os.path.isfile(abs... | def remove(self):
"""
Remove the ndata file reference
:param reference: the reference to remove
"""
with self.__lock:
absolute_file_path = self.__file_path
#logging.debug("DELETE data file %s", absolute_file_path)
if os.path.isfile(abs... | [
"Remove",
"the",
"ndata",
"file",
"reference"
] | nion-software/nionswift | python | https://github.com/nion-software/nionswift/blob/d43693eaf057b8683b9638e575000f055fede452/nion/swift/model/NDataHandler.py#L498-L508 | [
"def",
"remove",
"(",
"self",
")",
":",
"with",
"self",
".",
"__lock",
":",
"absolute_file_path",
"=",
"self",
".",
"__file_path",
"#logging.debug(\"DELETE data file %s\", absolute_file_path)",
"if",
"os",
".",
"path",
".",
"isfile",
"(",
"absolute_file_path",
")",
... | d43693eaf057b8683b9638e575000f055fede452 |
train | DisplayPanelManager.build_menu | Build the dynamic menu for the selected display panel.
The user accesses this menu by right-clicking on the display panel.
The basic menu items are to an empty display panel or a browser display panel.
After that, each display controller factory is given a chance to add to the menu. The displ... | nion/swift/DisplayPanel.py | def build_menu(self, display_type_menu, document_controller, display_panel):
"""Build the dynamic menu for the selected display panel.
The user accesses this menu by right-clicking on the display panel.
The basic menu items are to an empty display panel or a browser display panel.
Aft... | def build_menu(self, display_type_menu, document_controller, display_panel):
"""Build the dynamic menu for the selected display panel.
The user accesses this menu by right-clicking on the display panel.
The basic menu items are to an empty display panel or a browser display panel.
Aft... | [
"Build",
"the",
"dynamic",
"menu",
"for",
"the",
"selected",
"display",
"panel",
"."
] | nion-software/nionswift | python | https://github.com/nion-software/nionswift/blob/d43693eaf057b8683b9638e575000f055fede452/nion/swift/DisplayPanel.py#L1898-L1936 | [
"def",
"build_menu",
"(",
"self",
",",
"display_type_menu",
",",
"document_controller",
",",
"display_panel",
")",
":",
"dynamic_live_actions",
"=",
"list",
"(",
")",
"def",
"switch_to_display_content",
"(",
"display_panel_type",
")",
":",
"self",
".",
"switch_to_di... | d43693eaf057b8683b9638e575000f055fede452 |
train | DataStructure.persistent_object_context_changed | Override from PersistentObject. | nion/swift/model/DataStructure.py | def persistent_object_context_changed(self):
""" Override from PersistentObject. """
super().persistent_object_context_changed()
def source_registered(source):
self.__source = source
def source_unregistered(source=None):
pass
def reference_registered(pr... | def persistent_object_context_changed(self):
""" Override from PersistentObject. """
super().persistent_object_context_changed()
def source_registered(source):
self.__source = source
def source_unregistered(source=None):
pass
def reference_registered(pr... | [
"Override",
"from",
"PersistentObject",
"."
] | nion-software/nionswift | python | https://github.com/nion-software/nionswift/blob/d43693eaf057b8683b9638e575000f055fede452/nion/swift/model/DataStructure.py#L114-L141 | [
"def",
"persistent_object_context_changed",
"(",
"self",
")",
":",
"super",
"(",
")",
".",
"persistent_object_context_changed",
"(",
")",
"def",
"source_registered",
"(",
"source",
")",
":",
"self",
".",
"__source",
"=",
"source",
"def",
"source_unregistered",
"("... | d43693eaf057b8683b9638e575000f055fede452 |
train | ClienteSATHub.ativar_sat | Sobrepõe :meth:`~satcfe.base.FuncoesSAT.ativar_sat`.
:return: Uma resposta SAT especializada em ``AtivarSAT``.
:rtype: satcfe.resposta.ativarsat.RespostaAtivarSAT | satcfe/clientesathub.py | def ativar_sat(self, tipo_certificado, cnpj, codigo_uf):
"""Sobrepõe :meth:`~satcfe.base.FuncoesSAT.ativar_sat`.
:return: Uma resposta SAT especializada em ``AtivarSAT``.
:rtype: satcfe.resposta.ativarsat.RespostaAtivarSAT
"""
resp = self._http_post('ativarsat',
... | def ativar_sat(self, tipo_certificado, cnpj, codigo_uf):
"""Sobrepõe :meth:`~satcfe.base.FuncoesSAT.ativar_sat`.
:return: Uma resposta SAT especializada em ``AtivarSAT``.
:rtype: satcfe.resposta.ativarsat.RespostaAtivarSAT
"""
resp = self._http_post('ativarsat',
... | [
"Sobrepõe",
":",
"meth",
":",
"~satcfe",
".",
"base",
".",
"FuncoesSAT",
".",
"ativar_sat",
"."
] | base4sistemas/satcfe | python | https://github.com/base4sistemas/satcfe/blob/cb8e8815f4133d3e3d94cf526fa86767b4521ed9/satcfe/clientesathub.py#L103-L114 | [
"def",
"ativar_sat",
"(",
"self",
",",
"tipo_certificado",
",",
"cnpj",
",",
"codigo_uf",
")",
":",
"resp",
"=",
"self",
".",
"_http_post",
"(",
"'ativarsat'",
",",
"tipo_certificado",
"=",
"tipo_certificado",
",",
"cnpj",
"=",
"cnpj",
",",
"codigo_uf",
"=",... | cb8e8815f4133d3e3d94cf526fa86767b4521ed9 |
train | ClienteSATHub.comunicar_certificado_icpbrasil | Sobrepõe :meth:`~satcfe.base.FuncoesSAT.comunicar_certificado_icpbrasil`.
:return: Uma resposta SAT padrão.
:rtype: satcfe.resposta.padrao.RespostaSAT | satcfe/clientesathub.py | def comunicar_certificado_icpbrasil(self, certificado):
"""Sobrepõe :meth:`~satcfe.base.FuncoesSAT.comunicar_certificado_icpbrasil`.
:return: Uma resposta SAT padrão.
:rtype: satcfe.resposta.padrao.RespostaSAT
"""
resp = self._http_post('comunicarcertificadoicpbrasil',
... | def comunicar_certificado_icpbrasil(self, certificado):
"""Sobrepõe :meth:`~satcfe.base.FuncoesSAT.comunicar_certificado_icpbrasil`.
:return: Uma resposta SAT padrão.
:rtype: satcfe.resposta.padrao.RespostaSAT
"""
resp = self._http_post('comunicarcertificadoicpbrasil',
... | [
"Sobrepõe",
":",
"meth",
":",
"~satcfe",
".",
"base",
".",
"FuncoesSAT",
".",
"comunicar_certificado_icpbrasil",
"."
] | base4sistemas/satcfe | python | https://github.com/base4sistemas/satcfe/blob/cb8e8815f4133d3e3d94cf526fa86767b4521ed9/satcfe/clientesathub.py#L117-L127 | [
"def",
"comunicar_certificado_icpbrasil",
"(",
"self",
",",
"certificado",
")",
":",
"resp",
"=",
"self",
".",
"_http_post",
"(",
"'comunicarcertificadoicpbrasil'",
",",
"certificado",
"=",
"certificado",
")",
"conteudo",
"=",
"resp",
".",
"json",
"(",
")",
"ret... | cb8e8815f4133d3e3d94cf526fa86767b4521ed9 |
train | ClienteSATHub.enviar_dados_venda | Sobrepõe :meth:`~satcfe.base.FuncoesSAT.enviar_dados_venda`.
:return: Uma resposta SAT especializada em ``EnviarDadosVenda``.
:rtype: satcfe.resposta.enviardadosvenda.RespostaEnviarDadosVenda | satcfe/clientesathub.py | def enviar_dados_venda(self, dados_venda):
"""Sobrepõe :meth:`~satcfe.base.FuncoesSAT.enviar_dados_venda`.
:return: Uma resposta SAT especializada em ``EnviarDadosVenda``.
:rtype: satcfe.resposta.enviardadosvenda.RespostaEnviarDadosVenda
"""
resp = self._http_post('enviardadosve... | def enviar_dados_venda(self, dados_venda):
"""Sobrepõe :meth:`~satcfe.base.FuncoesSAT.enviar_dados_venda`.
:return: Uma resposta SAT especializada em ``EnviarDadosVenda``.
:rtype: satcfe.resposta.enviardadosvenda.RespostaEnviarDadosVenda
"""
resp = self._http_post('enviardadosve... | [
"Sobrepõe",
":",
"meth",
":",
"~satcfe",
".",
"base",
".",
"FuncoesSAT",
".",
"enviar_dados_venda",
"."
] | base4sistemas/satcfe | python | https://github.com/base4sistemas/satcfe/blob/cb8e8815f4133d3e3d94cf526fa86767b4521ed9/satcfe/clientesathub.py#L130-L139 | [
"def",
"enviar_dados_venda",
"(",
"self",
",",
"dados_venda",
")",
":",
"resp",
"=",
"self",
".",
"_http_post",
"(",
"'enviardadosvenda'",
",",
"dados_venda",
"=",
"dados_venda",
".",
"documento",
"(",
")",
")",
"conteudo",
"=",
"resp",
".",
"json",
"(",
"... | cb8e8815f4133d3e3d94cf526fa86767b4521ed9 |
train | ClienteSATHub.cancelar_ultima_venda | Sobrepõe :meth:`~satcfe.base.FuncoesSAT.cancelar_ultima_venda`.
:return: Uma resposta SAT especializada em ``CancelarUltimaVenda``.
:rtype: satcfe.resposta.cancelarultimavenda.RespostaCancelarUltimaVenda | satcfe/clientesathub.py | def cancelar_ultima_venda(self, chave_cfe, dados_cancelamento):
"""Sobrepõe :meth:`~satcfe.base.FuncoesSAT.cancelar_ultima_venda`.
:return: Uma resposta SAT especializada em ``CancelarUltimaVenda``.
:rtype: satcfe.resposta.cancelarultimavenda.RespostaCancelarUltimaVenda
"""
resp... | def cancelar_ultima_venda(self, chave_cfe, dados_cancelamento):
"""Sobrepõe :meth:`~satcfe.base.FuncoesSAT.cancelar_ultima_venda`.
:return: Uma resposta SAT especializada em ``CancelarUltimaVenda``.
:rtype: satcfe.resposta.cancelarultimavenda.RespostaCancelarUltimaVenda
"""
resp... | [
"Sobrepõe",
":",
"meth",
":",
"~satcfe",
".",
"base",
".",
"FuncoesSAT",
".",
"cancelar_ultima_venda",
"."
] | base4sistemas/satcfe | python | https://github.com/base4sistemas/satcfe/blob/cb8e8815f4133d3e3d94cf526fa86767b4521ed9/satcfe/clientesathub.py#L142-L152 | [
"def",
"cancelar_ultima_venda",
"(",
"self",
",",
"chave_cfe",
",",
"dados_cancelamento",
")",
":",
"resp",
"=",
"self",
".",
"_http_post",
"(",
"'cancelarultimavenda'",
",",
"chave_cfe",
"=",
"chave_cfe",
",",
"dados_cancelamento",
"=",
"dados_cancelamento",
".",
... | cb8e8815f4133d3e3d94cf526fa86767b4521ed9 |
train | ClienteSATHub.consultar_sat | Sobrepõe :meth:`~satcfe.base.FuncoesSAT.consultar_sat`.
:return: Uma resposta SAT padrão.
:rtype: satcfe.resposta.padrao.RespostaSAT | satcfe/clientesathub.py | def consultar_sat(self):
"""Sobrepõe :meth:`~satcfe.base.FuncoesSAT.consultar_sat`.
:return: Uma resposta SAT padrão.
:rtype: satcfe.resposta.padrao.RespostaSAT
"""
resp = self._http_post('consultarsat')
conteudo = resp.json()
return RespostaSAT.consultar_sat(con... | def consultar_sat(self):
"""Sobrepõe :meth:`~satcfe.base.FuncoesSAT.consultar_sat`.
:return: Uma resposta SAT padrão.
:rtype: satcfe.resposta.padrao.RespostaSAT
"""
resp = self._http_post('consultarsat')
conteudo = resp.json()
return RespostaSAT.consultar_sat(con... | [
"Sobrepõe",
":",
"meth",
":",
"~satcfe",
".",
"base",
".",
"FuncoesSAT",
".",
"consultar_sat",
"."
] | base4sistemas/satcfe | python | https://github.com/base4sistemas/satcfe/blob/cb8e8815f4133d3e3d94cf526fa86767b4521ed9/satcfe/clientesathub.py#L155-L163 | [
"def",
"consultar_sat",
"(",
"self",
")",
":",
"resp",
"=",
"self",
".",
"_http_post",
"(",
"'consultarsat'",
")",
"conteudo",
"=",
"resp",
".",
"json",
"(",
")",
"return",
"RespostaSAT",
".",
"consultar_sat",
"(",
"conteudo",
".",
"get",
"(",
"'retorno'",... | cb8e8815f4133d3e3d94cf526fa86767b4521ed9 |
train | ClienteSATHub.consultar_status_operacional | Sobrepõe :meth:`~satcfe.base.FuncoesSAT.consultar_status_operacional`.
:return: Uma resposta SAT especializada em ``ConsultarStatusOperacional``.
:rtype: satcfe.resposta.consultarstatusoperacional.RespostaConsultarStatusOperacional | satcfe/clientesathub.py | def consultar_status_operacional(self):
"""Sobrepõe :meth:`~satcfe.base.FuncoesSAT.consultar_status_operacional`.
:return: Uma resposta SAT especializada em ``ConsultarStatusOperacional``.
:rtype: satcfe.resposta.consultarstatusoperacional.RespostaConsultarStatusOperacional
"""
... | def consultar_status_operacional(self):
"""Sobrepõe :meth:`~satcfe.base.FuncoesSAT.consultar_status_operacional`.
:return: Uma resposta SAT especializada em ``ConsultarStatusOperacional``.
:rtype: satcfe.resposta.consultarstatusoperacional.RespostaConsultarStatusOperacional
"""
... | [
"Sobrepõe",
":",
"meth",
":",
"~satcfe",
".",
"base",
".",
"FuncoesSAT",
".",
"consultar_status_operacional",
"."
] | base4sistemas/satcfe | python | https://github.com/base4sistemas/satcfe/blob/cb8e8815f4133d3e3d94cf526fa86767b4521ed9/satcfe/clientesathub.py#L178-L187 | [
"def",
"consultar_status_operacional",
"(",
"self",
")",
":",
"resp",
"=",
"self",
".",
"_http_post",
"(",
"'consultarstatusoperacional'",
")",
"conteudo",
"=",
"resp",
".",
"json",
"(",
")",
"return",
"RespostaConsultarStatusOperacional",
".",
"analisar",
"(",
"c... | cb8e8815f4133d3e3d94cf526fa86767b4521ed9 |
train | ClienteSATHub.consultar_numero_sessao | Sobrepõe :meth:`~satcfe.base.FuncoesSAT.consultar_numero_sessao`.
:return: Uma resposta SAT que irá depender da sessão consultada.
:rtype: satcfe.resposta.padrao.RespostaSAT | satcfe/clientesathub.py | def consultar_numero_sessao(self, numero_sessao):
"""Sobrepõe :meth:`~satcfe.base.FuncoesSAT.consultar_numero_sessao`.
:return: Uma resposta SAT que irá depender da sessão consultada.
:rtype: satcfe.resposta.padrao.RespostaSAT
"""
resp = self._http_post('consultarnumerosessao',
... | def consultar_numero_sessao(self, numero_sessao):
"""Sobrepõe :meth:`~satcfe.base.FuncoesSAT.consultar_numero_sessao`.
:return: Uma resposta SAT que irá depender da sessão consultada.
:rtype: satcfe.resposta.padrao.RespostaSAT
"""
resp = self._http_post('consultarnumerosessao',
... | [
"Sobrepõe",
":",
"meth",
":",
"~satcfe",
".",
"base",
".",
"FuncoesSAT",
".",
"consultar_numero_sessao",
"."
] | base4sistemas/satcfe | python | https://github.com/base4sistemas/satcfe/blob/cb8e8815f4133d3e3d94cf526fa86767b4521ed9/satcfe/clientesathub.py#L190-L199 | [
"def",
"consultar_numero_sessao",
"(",
"self",
",",
"numero_sessao",
")",
":",
"resp",
"=",
"self",
".",
"_http_post",
"(",
"'consultarnumerosessao'",
",",
"numero_sessao",
"=",
"numero_sessao",
")",
"conteudo",
"=",
"resp",
".",
"json",
"(",
")",
"return",
"R... | cb8e8815f4133d3e3d94cf526fa86767b4521ed9 |
train | ClienteSATHub.configurar_interface_de_rede | Sobrepõe :meth:`~satcfe.base.FuncoesSAT.configurar_interface_de_rede`.
:return: Uma resposta SAT padrão.
:rtype: satcfe.resposta.padrao.RespostaSAT | satcfe/clientesathub.py | def configurar_interface_de_rede(self, configuracao):
"""Sobrepõe :meth:`~satcfe.base.FuncoesSAT.configurar_interface_de_rede`.
:return: Uma resposta SAT padrão.
:rtype: satcfe.resposta.padrao.RespostaSAT
"""
resp = self._http_post('configurarinterfacederede',
co... | def configurar_interface_de_rede(self, configuracao):
"""Sobrepõe :meth:`~satcfe.base.FuncoesSAT.configurar_interface_de_rede`.
:return: Uma resposta SAT padrão.
:rtype: satcfe.resposta.padrao.RespostaSAT
"""
resp = self._http_post('configurarinterfacederede',
co... | [
"Sobrepõe",
":",
"meth",
":",
"~satcfe",
".",
"base",
".",
"FuncoesSAT",
".",
"configurar_interface_de_rede",
"."
] | base4sistemas/satcfe | python | https://github.com/base4sistemas/satcfe/blob/cb8e8815f4133d3e3d94cf526fa86767b4521ed9/satcfe/clientesathub.py#L202-L211 | [
"def",
"configurar_interface_de_rede",
"(",
"self",
",",
"configuracao",
")",
":",
"resp",
"=",
"self",
".",
"_http_post",
"(",
"'configurarinterfacederede'",
",",
"configuracao",
"=",
"configuracao",
".",
"documento",
"(",
")",
")",
"conteudo",
"=",
"resp",
"."... | cb8e8815f4133d3e3d94cf526fa86767b4521ed9 |
train | ClienteSATHub.associar_assinatura | Sobrepõe :meth:`~satcfe.base.FuncoesSAT.associar_assinatura`.
:return: Uma resposta SAT padrão.
:rtype: satcfe.resposta.padrao.RespostaSAT | satcfe/clientesathub.py | def associar_assinatura(self, sequencia_cnpj, assinatura_ac):
"""Sobrepõe :meth:`~satcfe.base.FuncoesSAT.associar_assinatura`.
:return: Uma resposta SAT padrão.
:rtype: satcfe.resposta.padrao.RespostaSAT
"""
resp = self._http_post('associarassinatura',
sequencia_... | def associar_assinatura(self, sequencia_cnpj, assinatura_ac):
"""Sobrepõe :meth:`~satcfe.base.FuncoesSAT.associar_assinatura`.
:return: Uma resposta SAT padrão.
:rtype: satcfe.resposta.padrao.RespostaSAT
"""
resp = self._http_post('associarassinatura',
sequencia_... | [
"Sobrepõe",
":",
"meth",
":",
"~satcfe",
".",
"base",
".",
"FuncoesSAT",
".",
"associar_assinatura",
"."
] | base4sistemas/satcfe | python | https://github.com/base4sistemas/satcfe/blob/cb8e8815f4133d3e3d94cf526fa86767b4521ed9/satcfe/clientesathub.py#L214-L224 | [
"def",
"associar_assinatura",
"(",
"self",
",",
"sequencia_cnpj",
",",
"assinatura_ac",
")",
":",
"resp",
"=",
"self",
".",
"_http_post",
"(",
"'associarassinatura'",
",",
"sequencia_cnpj",
"=",
"sequencia_cnpj",
",",
"assinatura_ac",
"=",
"assinatura_ac",
")",
"#... | cb8e8815f4133d3e3d94cf526fa86767b4521ed9 |
train | ClienteSATHub.atualizar_software_sat | Sobrepõe :meth:`~satcfe.base.FuncoesSAT.atualizar_software_sat`.
:return: Uma resposta SAT padrão.
:rtype: satcfe.resposta.padrao.RespostaSAT | satcfe/clientesathub.py | def atualizar_software_sat(self):
"""Sobrepõe :meth:`~satcfe.base.FuncoesSAT.atualizar_software_sat`.
:return: Uma resposta SAT padrão.
:rtype: satcfe.resposta.padrao.RespostaSAT
"""
resp = self._http_post('atualizarsoftwaresat')
conteudo = resp.json()
return Res... | def atualizar_software_sat(self):
"""Sobrepõe :meth:`~satcfe.base.FuncoesSAT.atualizar_software_sat`.
:return: Uma resposta SAT padrão.
:rtype: satcfe.resposta.padrao.RespostaSAT
"""
resp = self._http_post('atualizarsoftwaresat')
conteudo = resp.json()
return Res... | [
"Sobrepõe",
":",
"meth",
":",
"~satcfe",
".",
"base",
".",
"FuncoesSAT",
".",
"atualizar_software_sat",
"."
] | base4sistemas/satcfe | python | https://github.com/base4sistemas/satcfe/blob/cb8e8815f4133d3e3d94cf526fa86767b4521ed9/satcfe/clientesathub.py#L227-L235 | [
"def",
"atualizar_software_sat",
"(",
"self",
")",
":",
"resp",
"=",
"self",
".",
"_http_post",
"(",
"'atualizarsoftwaresat'",
")",
"conteudo",
"=",
"resp",
".",
"json",
"(",
")",
"return",
"RespostaSAT",
".",
"atualizar_software_sat",
"(",
"conteudo",
".",
"g... | cb8e8815f4133d3e3d94cf526fa86767b4521ed9 |
train | ClienteSATHub.extrair_logs | Sobrepõe :meth:`~satcfe.base.FuncoesSAT.extrair_logs`.
:return: Uma resposta SAT especializada em ``ExtrairLogs``.
:rtype: satcfe.resposta.extrairlogs.RespostaExtrairLogs | satcfe/clientesathub.py | def extrair_logs(self):
"""Sobrepõe :meth:`~satcfe.base.FuncoesSAT.extrair_logs`.
:return: Uma resposta SAT especializada em ``ExtrairLogs``.
:rtype: satcfe.resposta.extrairlogs.RespostaExtrairLogs
"""
resp = self._http_post('extrairlogs')
conteudo = resp.json()
... | def extrair_logs(self):
"""Sobrepõe :meth:`~satcfe.base.FuncoesSAT.extrair_logs`.
:return: Uma resposta SAT especializada em ``ExtrairLogs``.
:rtype: satcfe.resposta.extrairlogs.RespostaExtrairLogs
"""
resp = self._http_post('extrairlogs')
conteudo = resp.json()
... | [
"Sobrepõe",
":",
"meth",
":",
"~satcfe",
".",
"base",
".",
"FuncoesSAT",
".",
"extrair_logs",
"."
] | base4sistemas/satcfe | python | https://github.com/base4sistemas/satcfe/blob/cb8e8815f4133d3e3d94cf526fa86767b4521ed9/satcfe/clientesathub.py#L238-L246 | [
"def",
"extrair_logs",
"(",
"self",
")",
":",
"resp",
"=",
"self",
".",
"_http_post",
"(",
"'extrairlogs'",
")",
"conteudo",
"=",
"resp",
".",
"json",
"(",
")",
"return",
"RespostaExtrairLogs",
".",
"analisar",
"(",
"conteudo",
".",
"get",
"(",
"'retorno'"... | cb8e8815f4133d3e3d94cf526fa86767b4521ed9 |
train | ClienteSATHub.bloquear_sat | Sobrepõe :meth:`~satcfe.base.FuncoesSAT.bloquear_sat`.
:return: Uma resposta SAT padrão.
:rtype: satcfe.resposta.padrao.RespostaSAT | satcfe/clientesathub.py | def bloquear_sat(self):
"""Sobrepõe :meth:`~satcfe.base.FuncoesSAT.bloquear_sat`.
:return: Uma resposta SAT padrão.
:rtype: satcfe.resposta.padrao.RespostaSAT
"""
resp = self._http_post('bloquearsat')
conteudo = resp.json()
return RespostaSAT.bloquear_sat(conteud... | def bloquear_sat(self):
"""Sobrepõe :meth:`~satcfe.base.FuncoesSAT.bloquear_sat`.
:return: Uma resposta SAT padrão.
:rtype: satcfe.resposta.padrao.RespostaSAT
"""
resp = self._http_post('bloquearsat')
conteudo = resp.json()
return RespostaSAT.bloquear_sat(conteud... | [
"Sobrepõe",
":",
"meth",
":",
"~satcfe",
".",
"base",
".",
"FuncoesSAT",
".",
"bloquear_sat",
"."
] | base4sistemas/satcfe | python | https://github.com/base4sistemas/satcfe/blob/cb8e8815f4133d3e3d94cf526fa86767b4521ed9/satcfe/clientesathub.py#L249-L257 | [
"def",
"bloquear_sat",
"(",
"self",
")",
":",
"resp",
"=",
"self",
".",
"_http_post",
"(",
"'bloquearsat'",
")",
"conteudo",
"=",
"resp",
".",
"json",
"(",
")",
"return",
"RespostaSAT",
".",
"bloquear_sat",
"(",
"conteudo",
".",
"get",
"(",
"'retorno'",
... | cb8e8815f4133d3e3d94cf526fa86767b4521ed9 |
train | ClienteSATHub.desbloquear_sat | Sobrepõe :meth:`~satcfe.base.FuncoesSAT.desbloquear_sat`.
:return: Uma resposta SAT padrão.
:rtype: satcfe.resposta.padrao.RespostaSAT | satcfe/clientesathub.py | def desbloquear_sat(self):
"""Sobrepõe :meth:`~satcfe.base.FuncoesSAT.desbloquear_sat`.
:return: Uma resposta SAT padrão.
:rtype: satcfe.resposta.padrao.RespostaSAT
"""
resp = self._http_post('desbloquearsat')
conteudo = resp.json()
return RespostaSAT.desbloquear... | def desbloquear_sat(self):
"""Sobrepõe :meth:`~satcfe.base.FuncoesSAT.desbloquear_sat`.
:return: Uma resposta SAT padrão.
:rtype: satcfe.resposta.padrao.RespostaSAT
"""
resp = self._http_post('desbloquearsat')
conteudo = resp.json()
return RespostaSAT.desbloquear... | [
"Sobrepõe",
":",
"meth",
":",
"~satcfe",
".",
"base",
".",
"FuncoesSAT",
".",
"desbloquear_sat",
"."
] | base4sistemas/satcfe | python | https://github.com/base4sistemas/satcfe/blob/cb8e8815f4133d3e3d94cf526fa86767b4521ed9/satcfe/clientesathub.py#L260-L268 | [
"def",
"desbloquear_sat",
"(",
"self",
")",
":",
"resp",
"=",
"self",
".",
"_http_post",
"(",
"'desbloquearsat'",
")",
"conteudo",
"=",
"resp",
".",
"json",
"(",
")",
"return",
"RespostaSAT",
".",
"desbloquear_sat",
"(",
"conteudo",
".",
"get",
"(",
"'reto... | cb8e8815f4133d3e3d94cf526fa86767b4521ed9 |
train | ClienteSATHub.trocar_codigo_de_ativacao | Sobrepõe :meth:`~satcfe.base.FuncoesSAT.trocar_codigo_de_ativacao`.
:return: Uma resposta SAT padrão.
:rtype: satcfe.resposta.padrao.RespostaSAT | satcfe/clientesathub.py | def trocar_codigo_de_ativacao(self, novo_codigo_ativacao,
opcao=constantes.CODIGO_ATIVACAO_REGULAR,
codigo_emergencia=None):
"""Sobrepõe :meth:`~satcfe.base.FuncoesSAT.trocar_codigo_de_ativacao`.
:return: Uma resposta SAT padrão.
:rtype: satcfe.resposta.padrao.RespostaSA... | def trocar_codigo_de_ativacao(self, novo_codigo_ativacao,
opcao=constantes.CODIGO_ATIVACAO_REGULAR,
codigo_emergencia=None):
"""Sobrepõe :meth:`~satcfe.base.FuncoesSAT.trocar_codigo_de_ativacao`.
:return: Uma resposta SAT padrão.
:rtype: satcfe.resposta.padrao.RespostaSA... | [
"Sobrepõe",
":",
"meth",
":",
"~satcfe",
".",
"base",
".",
"FuncoesSAT",
".",
"trocar_codigo_de_ativacao",
"."
] | base4sistemas/satcfe | python | https://github.com/base4sistemas/satcfe/blob/cb8e8815f4133d3e3d94cf526fa86767b4521ed9/satcfe/clientesathub.py#L271-L284 | [
"def",
"trocar_codigo_de_ativacao",
"(",
"self",
",",
"novo_codigo_ativacao",
",",
"opcao",
"=",
"constantes",
".",
"CODIGO_ATIVACAO_REGULAR",
",",
"codigo_emergencia",
"=",
"None",
")",
":",
"resp",
"=",
"self",
".",
"_http_post",
"(",
"'trocarcodigodeativacao'",
"... | cb8e8815f4133d3e3d94cf526fa86767b4521ed9 |
train | Graphic.bounds | Return the bounds property in relative coordinates.
Bounds is a tuple ((top, left), (height, width)) | nion/typeshed/API_1_0.py | def bounds(self) -> typing.Tuple[typing.Tuple[float, float], typing.Tuple[float, float]]:
"""Return the bounds property in relative coordinates.
Bounds is a tuple ((top, left), (height, width))"""
... | def bounds(self) -> typing.Tuple[typing.Tuple[float, float], typing.Tuple[float, float]]:
"""Return the bounds property in relative coordinates.
Bounds is a tuple ((top, left), (height, width))"""
... | [
"Return",
"the",
"bounds",
"property",
"in",
"relative",
"coordinates",
"."
] | nion-software/nionswift | python | https://github.com/nion-software/nionswift/blob/d43693eaf057b8683b9638e575000f055fede452/nion/typeshed/API_1_0.py#L38-L42 | [
"def",
"bounds",
"(",
"self",
")",
"->",
"typing",
".",
"Tuple",
"[",
"typing",
".",
"Tuple",
"[",
"float",
",",
"float",
"]",
",",
"typing",
".",
"Tuple",
"[",
"float",
",",
"float",
"]",
"]",
":",
"..."
] | d43693eaf057b8683b9638e575000f055fede452 |
train | Graphic.end | Set the end property in relative coordinates.
End may be a float when graphic is an Interval or a tuple (y, x) when graphic is a Line. | nion/typeshed/API_1_0.py | def end(self, value: typing.Union[float, typing.Tuple[float, float]]) -> None:
"""Set the end property in relative coordinates.
End may be a float when graphic is an Interval or a tuple (y, x) when graphic is a Line."""
... | def end(self, value: typing.Union[float, typing.Tuple[float, float]]) -> None:
"""Set the end property in relative coordinates.
End may be a float when graphic is an Interval or a tuple (y, x) when graphic is a Line."""
... | [
"Set",
"the",
"end",
"property",
"in",
"relative",
"coordinates",
"."
] | nion-software/nionswift | python | https://github.com/nion-software/nionswift/blob/d43693eaf057b8683b9638e575000f055fede452/nion/typeshed/API_1_0.py#L73-L77 | [
"def",
"end",
"(",
"self",
",",
"value",
":",
"typing",
".",
"Union",
"[",
"float",
",",
"typing",
".",
"Tuple",
"[",
"float",
",",
"float",
"]",
"]",
")",
"->",
"None",
":",
"..."
] | d43693eaf057b8683b9638e575000f055fede452 |
train | Graphic.start | Set the end property in relative coordinates.
End may be a float when graphic is an Interval or a tuple (y, x) when graphic is a Line. | nion/typeshed/API_1_0.py | def start(self, value: typing.Union[float, typing.Tuple[float, float]]) -> None:
"""Set the end property in relative coordinates.
End may be a float when graphic is an Interval or a tuple (y, x) when graphic is a Line."""
... | def start(self, value: typing.Union[float, typing.Tuple[float, float]]) -> None:
"""Set the end property in relative coordinates.
End may be a float when graphic is an Interval or a tuple (y, x) when graphic is a Line."""
... | [
"Set",
"the",
"end",
"property",
"in",
"relative",
"coordinates",
"."
] | nion-software/nionswift | python | https://github.com/nion-software/nionswift/blob/d43693eaf057b8683b9638e575000f055fede452/nion/typeshed/API_1_0.py#L183-L187 | [
"def",
"start",
"(",
"self",
",",
"value",
":",
"typing",
".",
"Union",
"[",
"float",
",",
"typing",
".",
"Tuple",
"[",
"float",
",",
"float",
"]",
"]",
")",
"->",
"None",
":",
"..."
] | d43693eaf057b8683b9638e575000f055fede452 |
train | Graphic.vector | Return the vector property in relative coordinates.
Vector will be a tuple of tuples ((y_start, x_start), (y_end, x_end)). | nion/typeshed/API_1_0.py | def vector(self) -> typing.Tuple[typing.Tuple[float, float], typing.Tuple[float, float]]:
"""Return the vector property in relative coordinates.
Vector will be a tuple of tuples ((y_start, x_start), (y_end, x_end))."""
... | def vector(self) -> typing.Tuple[typing.Tuple[float, float], typing.Tuple[float, float]]:
"""Return the vector property in relative coordinates.
Vector will be a tuple of tuples ((y_start, x_start), (y_end, x_end))."""
... | [
"Return",
"the",
"vector",
"property",
"in",
"relative",
"coordinates",
"."
] | nion-software/nionswift | python | https://github.com/nion-software/nionswift/blob/d43693eaf057b8683b9638e575000f055fede452/nion/typeshed/API_1_0.py#L212-L216 | [
"def",
"vector",
"(",
"self",
")",
"->",
"typing",
".",
"Tuple",
"[",
"typing",
".",
"Tuple",
"[",
"float",
",",
"float",
"]",
",",
"typing",
".",
"Tuple",
"[",
"float",
",",
"float",
"]",
"]",
":",
"..."
] | d43693eaf057b8683b9638e575000f055fede452 |
train | Library.get_data_item_for_hardware_source | Get the data item associated with hardware source and (optional) channel id and processor_id. Optionally create if missing.
:param hardware_source: The hardware_source.
:param channel_id: The (optional) channel id.
:param processor_id: The (optional) processor id for the channel.
:param... | nion/typeshed/API_1_0.py | def get_data_item_for_hardware_source(self, hardware_source, channel_id: str=None, processor_id: str=None, create_if_needed: bool=False, large_format: bool=False) -> DataItem:
"""Get the data item associated with hardware source and (optional) channel id and processor_id. Optionally create if missing.
... | def get_data_item_for_hardware_source(self, hardware_source, channel_id: str=None, processor_id: str=None, create_if_needed: bool=False, large_format: bool=False) -> DataItem:
"""Get the data item associated with hardware source and (optional) channel id and processor_id. Optionally create if missing.
... | [
"Get",
"the",
"data",
"item",
"associated",
"with",
"hardware",
"source",
"and",
"(",
"optional",
")",
"channel",
"id",
"and",
"processor_id",
".",
"Optionally",
"create",
"if",
"missing",
"."
] | nion-software/nionswift | python | https://github.com/nion-software/nionswift/blob/d43693eaf057b8683b9638e575000f055fede452/nion/typeshed/API_1_0.py#L751-L765 | [
"def",
"get_data_item_for_hardware_source",
"(",
"self",
",",
"hardware_source",
",",
"channel_id",
":",
"str",
"=",
"None",
",",
"processor_id",
":",
"str",
"=",
"None",
",",
"create_if_needed",
":",
"bool",
"=",
"False",
",",
"large_format",
":",
"bool",
"="... | d43693eaf057b8683b9638e575000f055fede452 |
train | Library.get_data_item_for_reference_key | Get the data item associated with data item reference key. Optionally create if missing.
:param data_item_reference_key: The data item reference key.
:param create_if_needed: Whether to create a new data item if none is found.
:return: The associated data item. May be None.
.. versiona... | nion/typeshed/API_1_0.py | def get_data_item_for_reference_key(self, data_item_reference_key: str=None, create_if_needed: bool=False, large_format: bool=False) -> DataItem:
"""Get the data item associated with data item reference key. Optionally create if missing.
:param data_item_reference_key: The data item reference key.
... | def get_data_item_for_reference_key(self, data_item_reference_key: str=None, create_if_needed: bool=False, large_format: bool=False) -> DataItem:
"""Get the data item associated with data item reference key. Optionally create if missing.
:param data_item_reference_key: The data item reference key.
... | [
"Get",
"the",
"data",
"item",
"associated",
"with",
"data",
"item",
"reference",
"key",
".",
"Optionally",
"create",
"if",
"missing",
"."
] | nion-software/nionswift | python | https://github.com/nion-software/nionswift/blob/d43693eaf057b8683b9638e575000f055fede452/nion/typeshed/API_1_0.py#L767-L779 | [
"def",
"get_data_item_for_reference_key",
"(",
"self",
",",
"data_item_reference_key",
":",
"str",
"=",
"None",
",",
"create_if_needed",
":",
"bool",
"=",
"False",
",",
"large_format",
":",
"bool",
"=",
"False",
")",
"->",
"DataItem",
":",
"..."
] | d43693eaf057b8683b9638e575000f055fede452 |
train | DocumentWindow.show_get_string_message_box | Show a dialog box and ask for a string.
Caption describes the user prompt. Text is the initial/default string.
Accepted function must be a function taking one argument which is the resulting text if the user accepts the
message dialog. It will only be called if the user clicks OK.
Rej... | nion/typeshed/API_1_0.py | def show_get_string_message_box(self, caption: str, text: str, accepted_fn, rejected_fn=None, accepted_text: str=None, rejected_text: str=None) -> None:
"""Show a dialog box and ask for a string.
Caption describes the user prompt. Text is the initial/default string.
Accepted function must be a... | def show_get_string_message_box(self, caption: str, text: str, accepted_fn, rejected_fn=None, accepted_text: str=None, rejected_text: str=None) -> None:
"""Show a dialog box and ask for a string.
Caption describes the user prompt. Text is the initial/default string.
Accepted function must be a... | [
"Show",
"a",
"dialog",
"box",
"and",
"ask",
"for",
"a",
"string",
"."
] | nion-software/nionswift | python | https://github.com/nion-software/nionswift/blob/d43693eaf057b8683b9638e575000f055fede452/nion/typeshed/API_1_0.py#L987-L1001 | [
"def",
"show_get_string_message_box",
"(",
"self",
",",
"caption",
":",
"str",
",",
"text",
":",
"str",
",",
"accepted_fn",
",",
"rejected_fn",
"=",
"None",
",",
"accepted_text",
":",
"str",
"=",
"None",
",",
"rejected_text",
":",
"str",
"=",
"None",
")",
... | d43693eaf057b8683b9638e575000f055fede452 |
train | API.create_calibration | Create a calibration object with offset, scale, and units.
:param offset: The offset of the calibration.
:param scale: The scale of the calibration.
:param units: The units of the calibration as a string.
:return: The calibration object.
.. versionadded:: 1.0
Scriptabl... | nion/typeshed/API_1_0.py | def create_calibration(self, offset: float=None, scale: float=None, units: str=None) -> Calibration.Calibration:
"""Create a calibration object with offset, scale, and units.
:param offset: The offset of the calibration.
:param scale: The scale of the calibration.
:param units: The unit... | def create_calibration(self, offset: float=None, scale: float=None, units: str=None) -> Calibration.Calibration:
"""Create a calibration object with offset, scale, and units.
:param offset: The offset of the calibration.
:param scale: The scale of the calibration.
:param units: The unit... | [
"Create",
"a",
"calibration",
"object",
"with",
"offset",
"scale",
"and",
"units",
"."
] | nion-software/nionswift | python | https://github.com/nion-software/nionswift/blob/d43693eaf057b8683b9638e575000f055fede452/nion/typeshed/API_1_0.py#L1077-L1092 | [
"def",
"create_calibration",
"(",
"self",
",",
"offset",
":",
"float",
"=",
"None",
",",
"scale",
":",
"float",
"=",
"None",
",",
"units",
":",
"str",
"=",
"None",
")",
"->",
"Calibration",
".",
"Calibration",
":",
"..."
] | d43693eaf057b8683b9638e575000f055fede452 |
train | API.create_data_and_metadata | Create a data_and_metadata object from data.
:param data: an ndarray of data.
:param intensity_calibration: An optional calibration object.
:param dimensional_calibrations: An optional list of calibration objects.
:param metadata: A dict of metadata.
:param timestamp: A datetime... | nion/typeshed/API_1_0.py | def create_data_and_metadata(self, data: numpy.ndarray, intensity_calibration: Calibration.Calibration=None, dimensional_calibrations: typing.List[Calibration.Calibration]=None, metadata: dict=None, timestamp: str=None, data_descriptor: DataAndMetadata.DataDescriptor=None) -> DataAndMetadata.DataAndMetadata:
""... | def create_data_and_metadata(self, data: numpy.ndarray, intensity_calibration: Calibration.Calibration=None, dimensional_calibrations: typing.List[Calibration.Calibration]=None, metadata: dict=None, timestamp: str=None, data_descriptor: DataAndMetadata.DataDescriptor=None) -> DataAndMetadata.DataAndMetadata:
""... | [
"Create",
"a",
"data_and_metadata",
"object",
"from",
"data",
"."
] | nion-software/nionswift | python | https://github.com/nion-software/nionswift/blob/d43693eaf057b8683b9638e575000f055fede452/nion/typeshed/API_1_0.py#L1094-L1108 | [
"def",
"create_data_and_metadata",
"(",
"self",
",",
"data",
":",
"numpy",
".",
"ndarray",
",",
"intensity_calibration",
":",
"Calibration",
".",
"Calibration",
"=",
"None",
",",
"dimensional_calibrations",
":",
"typing",
".",
"List",
"[",
"Calibration",
".",
"C... | d43693eaf057b8683b9638e575000f055fede452 |
train | API.create_data_and_metadata_from_data | Create a data_and_metadata object from data.
.. versionadded:: 1.0
.. deprecated:: 1.1
Use :py:meth:`~nion.swift.Facade.DataItem.create_data_and_metadata` instead.
Scriptable: No | nion/typeshed/API_1_0.py | def create_data_and_metadata_from_data(self, data: numpy.ndarray, intensity_calibration: Calibration.Calibration=None, dimensional_calibrations: typing.List[Calibration.Calibration]=None, metadata: dict=None, timestamp: str=None) -> DataAndMetadata.DataAndMetadata:
"""Create a data_and_metadata object from data... | def create_data_and_metadata_from_data(self, data: numpy.ndarray, intensity_calibration: Calibration.Calibration=None, dimensional_calibrations: typing.List[Calibration.Calibration]=None, metadata: dict=None, timestamp: str=None) -> DataAndMetadata.DataAndMetadata:
"""Create a data_and_metadata object from data... | [
"Create",
"a",
"data_and_metadata",
"object",
"from",
"data",
"."
] | nion-software/nionswift | python | https://github.com/nion-software/nionswift/blob/d43693eaf057b8683b9638e575000f055fede452/nion/typeshed/API_1_0.py#L1110-L1119 | [
"def",
"create_data_and_metadata_from_data",
"(",
"self",
",",
"data",
":",
"numpy",
".",
"ndarray",
",",
"intensity_calibration",
":",
"Calibration",
".",
"Calibration",
"=",
"None",
",",
"dimensional_calibrations",
":",
"typing",
".",
"List",
"[",
"Calibration",
... | d43693eaf057b8683b9638e575000f055fede452 |
train | API.create_data_descriptor | Create a data descriptor.
:param is_sequence: whether the descriptor describes a sequence of data.
:param collection_dimension_count: the number of collection dimensions represented by the descriptor.
:param datum_dimension_count: the number of datum dimensions represented by the descriptor.
... | nion/typeshed/API_1_0.py | def create_data_descriptor(self, is_sequence: bool, collection_dimension_count: int, datum_dimension_count: int) -> DataAndMetadata.DataDescriptor:
"""Create a data descriptor.
:param is_sequence: whether the descriptor describes a sequence of data.
:param collection_dimension_count: the number... | def create_data_descriptor(self, is_sequence: bool, collection_dimension_count: int, datum_dimension_count: int) -> DataAndMetadata.DataDescriptor:
"""Create a data descriptor.
:param is_sequence: whether the descriptor describes a sequence of data.
:param collection_dimension_count: the number... | [
"Create",
"a",
"data",
"descriptor",
"."
] | nion-software/nionswift | python | https://github.com/nion-software/nionswift/blob/d43693eaf057b8683b9638e575000f055fede452/nion/typeshed/API_1_0.py#L1132-L1143 | [
"def",
"create_data_descriptor",
"(",
"self",
",",
"is_sequence",
":",
"bool",
",",
"collection_dimension_count",
":",
"int",
",",
"datum_dimension_count",
":",
"int",
")",
"->",
"DataAndMetadata",
".",
"DataDescriptor",
":",
"..."
] | d43693eaf057b8683b9638e575000f055fede452 |
train | make_calibration_row_widget | Called when an item (calibration_observable) is inserted into the list widget. Returns a widget. | nion/swift/Inspector.py | def make_calibration_row_widget(ui, calibration_observable, label: str=None):
"""Called when an item (calibration_observable) is inserted into the list widget. Returns a widget."""
calibration_row = ui.create_row_widget()
row_label = ui.create_label_widget(label, properties={"width": 60})
row_label.widg... | def make_calibration_row_widget(ui, calibration_observable, label: str=None):
"""Called when an item (calibration_observable) is inserted into the list widget. Returns a widget."""
calibration_row = ui.create_row_widget()
row_label = ui.create_label_widget(label, properties={"width": 60})
row_label.widg... | [
"Called",
"when",
"an",
"item",
"(",
"calibration_observable",
")",
"is",
"inserted",
"into",
"the",
"list",
"widget",
".",
"Returns",
"a",
"widget",
"."
] | nion-software/nionswift | python | https://github.com/nion-software/nionswift/blob/d43693eaf057b8683b9638e575000f055fede452/nion/swift/Inspector.py#L1067-L1091 | [
"def",
"make_calibration_row_widget",
"(",
"ui",
",",
"calibration_observable",
",",
"label",
":",
"str",
"=",
"None",
")",
":",
"calibration_row",
"=",
"ui",
".",
"create_row_widget",
"(",
")",
"row_label",
"=",
"ui",
".",
"create_label_widget",
"(",
"label",
... | d43693eaf057b8683b9638e575000f055fede452 |
train | InspectorSection.add_widget_to_content | Subclasses should call this to add content in the section's top level column. | nion/swift/Inspector.py | def add_widget_to_content(self, widget):
"""Subclasses should call this to add content in the section's top level column."""
self.__section_content_column.add_spacing(4)
self.__section_content_column.add(widget) | def add_widget_to_content(self, widget):
"""Subclasses should call this to add content in the section's top level column."""
self.__section_content_column.add_spacing(4)
self.__section_content_column.add(widget) | [
"Subclasses",
"should",
"call",
"this",
"to",
"add",
"content",
"in",
"the",
"section",
"s",
"top",
"level",
"column",
"."
] | nion-software/nionswift | python | https://github.com/nion-software/nionswift/blob/d43693eaf057b8683b9638e575000f055fede452/nion/swift/Inspector.py#L218-L221 | [
"def",
"add_widget_to_content",
"(",
"self",
",",
"widget",
")",
":",
"self",
".",
"__section_content_column",
".",
"add_spacing",
"(",
"4",
")",
"self",
".",
"__section_content_column",
".",
"add",
"(",
"widget",
")"
] | d43693eaf057b8683b9638e575000f055fede452 |
train | CalibrationsInspectorSection.__create_list_item_widget | Called when an item (calibration_observable) is inserted into the list widget. Returns a widget. | nion/swift/Inspector.py | def __create_list_item_widget(self, ui, calibration_observable):
"""Called when an item (calibration_observable) is inserted into the list widget. Returns a widget."""
calibration_row = make_calibration_row_widget(ui, calibration_observable)
column = ui.create_column_widget()
column.add_... | def __create_list_item_widget(self, ui, calibration_observable):
"""Called when an item (calibration_observable) is inserted into the list widget. Returns a widget."""
calibration_row = make_calibration_row_widget(ui, calibration_observable)
column = ui.create_column_widget()
column.add_... | [
"Called",
"when",
"an",
"item",
"(",
"calibration_observable",
")",
"is",
"inserted",
"into",
"the",
"list",
"widget",
".",
"Returns",
"a",
"widget",
"."
] | nion-software/nionswift | python | https://github.com/nion-software/nionswift/blob/d43693eaf057b8683b9638e575000f055fede452/nion/swift/Inspector.py#L1211-L1217 | [
"def",
"__create_list_item_widget",
"(",
"self",
",",
"ui",
",",
"calibration_observable",
")",
":",
"calibration_row",
"=",
"make_calibration_row_widget",
"(",
"ui",
",",
"calibration_observable",
")",
"column",
"=",
"ui",
".",
"create_column_widget",
"(",
")",
"co... | d43693eaf057b8683b9638e575000f055fede452 |
train | AdornmentsCanvasItem._repaint | Repaint the canvas item. This will occur on a thread. | nion/swift/HistogramPanel.py | def _repaint(self, drawing_context):
"""Repaint the canvas item. This will occur on a thread."""
# canvas size
canvas_width = self.canvas_size[1]
canvas_height = self.canvas_size[0]
left = self.display_limits[0]
right = self.display_limits[1]
# draw left displa... | def _repaint(self, drawing_context):
"""Repaint the canvas item. This will occur on a thread."""
# canvas size
canvas_width = self.canvas_size[1]
canvas_height = self.canvas_size[0]
left = self.display_limits[0]
right = self.display_limits[1]
# draw left displa... | [
"Repaint",
"the",
"canvas",
"item",
".",
"This",
"will",
"occur",
"on",
"a",
"thread",
"."
] | nion-software/nionswift | python | https://github.com/nion-software/nionswift/blob/d43693eaf057b8683b9638e575000f055fede452/nion/swift/HistogramPanel.py#L42-L79 | [
"def",
"_repaint",
"(",
"self",
",",
"drawing_context",
")",
":",
"# canvas size",
"canvas_width",
"=",
"self",
".",
"canvas_size",
"[",
"1",
"]",
"canvas_height",
"=",
"self",
".",
"canvas_size",
"[",
"0",
"]",
"left",
"=",
"self",
".",
"display_limits",
... | d43693eaf057b8683b9638e575000f055fede452 |
train | SimpleLineGraphCanvasItem._repaint | Repaint the canvas item. This will occur on a thread. | nion/swift/HistogramPanel.py | def _repaint(self, drawing_context):
"""Repaint the canvas item. This will occur on a thread."""
# canvas size
canvas_width = self.canvas_size[1]
canvas_height = self.canvas_size[0]
# draw background
if self.background_color:
with drawing_context.saver():
... | def _repaint(self, drawing_context):
"""Repaint the canvas item. This will occur on a thread."""
# canvas size
canvas_width = self.canvas_size[1]
canvas_height = self.canvas_size[0]
# draw background
if self.background_color:
with drawing_context.saver():
... | [
"Repaint",
"the",
"canvas",
"item",
".",
"This",
"will",
"occur",
"on",
"a",
"thread",
"."
] | nion-software/nionswift | python | https://github.com/nion-software/nionswift/blob/d43693eaf057b8683b9638e575000f055fede452/nion/swift/HistogramPanel.py#L124-L155 | [
"def",
"_repaint",
"(",
"self",
",",
"drawing_context",
")",
":",
"# canvas size",
"canvas_width",
"=",
"self",
".",
"canvas_size",
"[",
"1",
"]",
"canvas_height",
"=",
"self",
".",
"canvas_size",
"[",
"0",
"]",
"# draw background",
"if",
"self",
".",
"backg... | d43693eaf057b8683b9638e575000f055fede452 |
train | ColorMapCanvasItem.color_map_data | Set the data and mark the canvas item for updating.
Data should be an ndarray of shape (256, 3) with type uint8 | nion/swift/HistogramPanel.py | def color_map_data(self, data: numpy.ndarray) -> None:
"""Set the data and mark the canvas item for updating.
Data should be an ndarray of shape (256, 3) with type uint8
"""
self.__color_map_data = data
self.update() | def color_map_data(self, data: numpy.ndarray) -> None:
"""Set the data and mark the canvas item for updating.
Data should be an ndarray of shape (256, 3) with type uint8
"""
self.__color_map_data = data
self.update() | [
"Set",
"the",
"data",
"and",
"mark",
"the",
"canvas",
"item",
"for",
"updating",
"."
] | nion-software/nionswift | python | https://github.com/nion-software/nionswift/blob/d43693eaf057b8683b9638e575000f055fede452/nion/swift/HistogramPanel.py#L171-L177 | [
"def",
"color_map_data",
"(",
"self",
",",
"data",
":",
"numpy",
".",
"ndarray",
")",
"->",
"None",
":",
"self",
".",
"__color_map_data",
"=",
"data",
"self",
".",
"update",
"(",
")"
] | d43693eaf057b8683b9638e575000f055fede452 |
train | ColorMapCanvasItem._repaint | Repaint the canvas item. This will occur on a thread. | nion/swift/HistogramPanel.py | def _repaint(self, drawing_context: DrawingContext.DrawingContext):
"""Repaint the canvas item. This will occur on a thread."""
# canvas size
canvas_width = self.canvas_size.width
canvas_height = self.canvas_size.height
with drawing_context.saver():
if self.__color_... | def _repaint(self, drawing_context: DrawingContext.DrawingContext):
"""Repaint the canvas item. This will occur on a thread."""
# canvas size
canvas_width = self.canvas_size.width
canvas_height = self.canvas_size.height
with drawing_context.saver():
if self.__color_... | [
"Repaint",
"the",
"canvas",
"item",
".",
"This",
"will",
"occur",
"on",
"a",
"thread",
"."
] | nion-software/nionswift | python | https://github.com/nion-software/nionswift/blob/d43693eaf057b8683b9638e575000f055fede452/nion/swift/HistogramPanel.py#L179-L191 | [
"def",
"_repaint",
"(",
"self",
",",
"drawing_context",
":",
"DrawingContext",
".",
"DrawingContext",
")",
":",
"# canvas size",
"canvas_width",
"=",
"self",
".",
"canvas_size",
".",
"width",
"canvas_height",
"=",
"self",
".",
"canvas_size",
".",
"height",
"with... | d43693eaf057b8683b9638e575000f055fede452 |
train | EvoDAG.get_params | Parameters used to initialize the class | EvoDAG/base.py | def get_params(self):
"Parameters used to initialize the class"
import inspect
a = inspect.getargspec(self.__init__)[0]
out = dict()
for key in a[1:]:
value = getattr(self, "_%s" % key, None)
out[key] = value
return out | def get_params(self):
"Parameters used to initialize the class"
import inspect
a = inspect.getargspec(self.__init__)[0]
out = dict()
for key in a[1:]:
value = getattr(self, "_%s" % key, None)
out[key] = value
return out | [
"Parameters",
"used",
"to",
"initialize",
"the",
"class"
] | mgraffg/EvoDAG | python | https://github.com/mgraffg/EvoDAG/blob/e11fa1fd1ca9e69cca92696c86661a3dc7b3a1d5/EvoDAG/base.py#L137-L145 | [
"def",
"get_params",
"(",
"self",
")",
":",
"import",
"inspect",
"a",
"=",
"inspect",
".",
"getargspec",
"(",
"self",
".",
"__init__",
")",
"[",
"0",
"]",
"out",
"=",
"dict",
"(",
")",
"for",
"key",
"in",
"a",
"[",
"1",
":",
"]",
":",
"value",
... | e11fa1fd1ca9e69cca92696c86661a3dc7b3a1d5 |
train | EvoDAG.signature | Instance file name | EvoDAG/base.py | def signature(self):
"Instance file name"
kw = self.get_params()
keys = sorted(kw.keys())
l = []
for k in keys:
n = k[0] + k[-1]
v = kw[k]
if k == 'function_set':
v = "_".join([x.__name__[0] +
x.__n... | def signature(self):
"Instance file name"
kw = self.get_params()
keys = sorted(kw.keys())
l = []
for k in keys:
n = k[0] + k[-1]
v = kw[k]
if k == 'function_set':
v = "_".join([x.__name__[0] +
x.__n... | [
"Instance",
"file",
"name"
] | mgraffg/EvoDAG | python | https://github.com/mgraffg/EvoDAG/blob/e11fa1fd1ca9e69cca92696c86661a3dc7b3a1d5/EvoDAG/base.py#L157-L174 | [
"def",
"signature",
"(",
"self",
")",
":",
"kw",
"=",
"self",
".",
"get_params",
"(",
")",
"keys",
"=",
"sorted",
"(",
"kw",
".",
"keys",
"(",
")",
")",
"l",
"=",
"[",
"]",
"for",
"k",
"in",
"keys",
":",
"n",
"=",
"k",
"[",
"0",
"]",
"+",
... | e11fa1fd1ca9e69cca92696c86661a3dc7b3a1d5 |
train | EvoDAG.population | Class containing the population and all the individuals generated | EvoDAG/base.py | def population(self):
"Class containing the population and all the individuals generated"
try:
return self._p
except AttributeError:
self._p = self._population_class(base=self,
tournament_size=self._tournament_size,
... | def population(self):
"Class containing the population and all the individuals generated"
try:
return self._p
except AttributeError:
self._p = self._population_class(base=self,
tournament_size=self._tournament_size,
... | [
"Class",
"containing",
"the",
"population",
"and",
"all",
"the",
"individuals",
"generated"
] | mgraffg/EvoDAG | python | https://github.com/mgraffg/EvoDAG/blob/e11fa1fd1ca9e69cca92696c86661a3dc7b3a1d5/EvoDAG/base.py#L262-L275 | [
"def",
"population",
"(",
"self",
")",
":",
"try",
":",
"return",
"self",
".",
"_p",
"except",
"AttributeError",
":",
"self",
".",
"_p",
"=",
"self",
".",
"_population_class",
"(",
"base",
"=",
"self",
",",
"tournament_size",
"=",
"self",
".",
"_tourname... | e11fa1fd1ca9e69cca92696c86661a3dc7b3a1d5 |
train | EvoDAG.random_leaf | Returns a random variable with the associated weight | EvoDAG/base.py | def random_leaf(self):
"Returns a random variable with the associated weight"
for i in range(self._number_tries_feasible_ind):
var = np.random.randint(self.nvar)
v = self._random_leaf(var)
if v is None:
continue
return v
raise Runti... | def random_leaf(self):
"Returns a random variable with the associated weight"
for i in range(self._number_tries_feasible_ind):
var = np.random.randint(self.nvar)
v = self._random_leaf(var)
if v is None:
continue
return v
raise Runti... | [
"Returns",
"a",
"random",
"variable",
"with",
"the",
"associated",
"weight"
] | mgraffg/EvoDAG | python | https://github.com/mgraffg/EvoDAG/blob/e11fa1fd1ca9e69cca92696c86661a3dc7b3a1d5/EvoDAG/base.py#L300-L308 | [
"def",
"random_leaf",
"(",
"self",
")",
":",
"for",
"i",
"in",
"range",
"(",
"self",
".",
"_number_tries_feasible_ind",
")",
":",
"var",
"=",
"np",
".",
"random",
".",
"randint",
"(",
"self",
".",
"nvar",
")",
"v",
"=",
"self",
".",
"_random_leaf",
"... | e11fa1fd1ca9e69cca92696c86661a3dc7b3a1d5 |
train | EvoDAG.random_offspring | Returns an offspring with the associated weight(s) | EvoDAG/base.py | def random_offspring(self):
"Returns an offspring with the associated weight(s)"
function_set = self.function_set
function_selection = self._function_selection_ins
function_selection.density = self.population.density
function_selection.unfeasible_functions.clear()
for i i... | def random_offspring(self):
"Returns an offspring with the associated weight(s)"
function_set = self.function_set
function_selection = self._function_selection_ins
function_selection.density = self.population.density
function_selection.unfeasible_functions.clear()
for i i... | [
"Returns",
"an",
"offspring",
"with",
"the",
"associated",
"weight",
"(",
"s",
")"
] | mgraffg/EvoDAG | python | https://github.com/mgraffg/EvoDAG/blob/e11fa1fd1ca9e69cca92696c86661a3dc7b3a1d5/EvoDAG/base.py#L454-L476 | [
"def",
"random_offspring",
"(",
"self",
")",
":",
"function_set",
"=",
"self",
".",
"function_set",
"function_selection",
"=",
"self",
".",
"_function_selection_ins",
"function_selection",
".",
"density",
"=",
"self",
".",
"population",
".",
"density",
"function_sel... | e11fa1fd1ca9e69cca92696c86661a3dc7b3a1d5 |
train | EvoDAG.stopping_criteria | Test whether the stopping criteria has been achieved. | EvoDAG/base.py | def stopping_criteria(self):
"Test whether the stopping criteria has been achieved."
if self.stopping_criteria_tl():
return True
if self.generations < np.inf:
inds = self.popsize * self.generations
flag = inds <= len(self.population.hist)
else:
... | def stopping_criteria(self):
"Test whether the stopping criteria has been achieved."
if self.stopping_criteria_tl():
return True
if self.generations < np.inf:
inds = self.popsize * self.generations
flag = inds <= len(self.population.hist)
else:
... | [
"Test",
"whether",
"the",
"stopping",
"criteria",
"has",
"been",
"achieved",
"."
] | mgraffg/EvoDAG | python | https://github.com/mgraffg/EvoDAG/blob/e11fa1fd1ca9e69cca92696c86661a3dc7b3a1d5/EvoDAG/base.py#L488-L511 | [
"def",
"stopping_criteria",
"(",
"self",
")",
":",
"if",
"self",
".",
"stopping_criteria_tl",
"(",
")",
":",
"return",
"True",
"if",
"self",
".",
"generations",
"<",
"np",
".",
"inf",
":",
"inds",
"=",
"self",
".",
"popsize",
"*",
"self",
".",
"generat... | e11fa1fd1ca9e69cca92696c86661a3dc7b3a1d5 |
train | EvoDAG.nclasses | Number of classes of v, also sets the labes | EvoDAG/base.py | def nclasses(self, v):
"Number of classes of v, also sets the labes"
if not self.classifier:
return 0
if isinstance(v, list):
self._labels = np.arange(len(v))
return
if not isinstance(v, np.ndarray):
v = tonparray(v)
self._labels = ... | def nclasses(self, v):
"Number of classes of v, also sets the labes"
if not self.classifier:
return 0
if isinstance(v, list):
self._labels = np.arange(len(v))
return
if not isinstance(v, np.ndarray):
v = tonparray(v)
self._labels = ... | [
"Number",
"of",
"classes",
"of",
"v",
"also",
"sets",
"the",
"labes"
] | mgraffg/EvoDAG | python | https://github.com/mgraffg/EvoDAG/blob/e11fa1fd1ca9e69cca92696c86661a3dc7b3a1d5/EvoDAG/base.py#L513-L523 | [
"def",
"nclasses",
"(",
"self",
",",
"v",
")",
":",
"if",
"not",
"self",
".",
"classifier",
":",
"return",
"0",
"if",
"isinstance",
"(",
"v",
",",
"list",
")",
":",
"self",
".",
"_labels",
"=",
"np",
".",
"arange",
"(",
"len",
"(",
"v",
")",
")... | e11fa1fd1ca9e69cca92696c86661a3dc7b3a1d5 |
train | EvoDAG.fit | Evolutive process | EvoDAG/base.py | def fit(self, X, y, test_set=None):
"""Evolutive process"""
self._init_time = time.time()
self.X = X
if self._popsize == "nvar":
self._popsize = self.nvar + len(self._input_functions)
if isinstance(test_set, str) and test_set == 'shuffle':
test_set = self.... | def fit(self, X, y, test_set=None):
"""Evolutive process"""
self._init_time = time.time()
self.X = X
if self._popsize == "nvar":
self._popsize = self.nvar + len(self._input_functions)
if isinstance(test_set, str) and test_set == 'shuffle':
test_set = self.... | [
"Evolutive",
"process"
] | mgraffg/EvoDAG | python | https://github.com/mgraffg/EvoDAG/blob/e11fa1fd1ca9e69cca92696c86661a3dc7b3a1d5/EvoDAG/base.py#L537-L583 | [
"def",
"fit",
"(",
"self",
",",
"X",
",",
"y",
",",
"test_set",
"=",
"None",
")",
":",
"self",
".",
"_init_time",
"=",
"time",
".",
"time",
"(",
")",
"self",
".",
"X",
"=",
"X",
"if",
"self",
".",
"_popsize",
"==",
"\"nvar\"",
":",
"self",
".",... | e11fa1fd1ca9e69cca92696c86661a3dc7b3a1d5 |
train | EvoDAG.decision_function | Decision function i.e. the raw data of the prediction | EvoDAG/base.py | def decision_function(self, v=None, X=None):
"Decision function i.e. the raw data of the prediction"
m = self.model(v=v)
return m.decision_function(X) | def decision_function(self, v=None, X=None):
"Decision function i.e. the raw data of the prediction"
m = self.model(v=v)
return m.decision_function(X) | [
"Decision",
"function",
"i",
".",
"e",
".",
"the",
"raw",
"data",
"of",
"the",
"prediction"
] | mgraffg/EvoDAG | python | https://github.com/mgraffg/EvoDAG/blob/e11fa1fd1ca9e69cca92696c86661a3dc7b3a1d5/EvoDAG/base.py#L593-L596 | [
"def",
"decision_function",
"(",
"self",
",",
"v",
"=",
"None",
",",
"X",
"=",
"None",
")",
":",
"m",
"=",
"self",
".",
"model",
"(",
"v",
"=",
"v",
")",
"return",
"m",
".",
"decision_function",
"(",
"X",
")"
] | e11fa1fd1ca9e69cca92696c86661a3dc7b3a1d5 |
train | EvoDAG.predict | In classification this returns the classes, in
regression it is equivalent to the decision function | EvoDAG/base.py | def predict(self, v=None, X=None):
"""In classification this returns the classes, in
regression it is equivalent to the decision function"""
if X is None:
X = v
v = None
m = self.model(v=v)
return m.predict(X) | def predict(self, v=None, X=None):
"""In classification this returns the classes, in
regression it is equivalent to the decision function"""
if X is None:
X = v
v = None
m = self.model(v=v)
return m.predict(X) | [
"In",
"classification",
"this",
"returns",
"the",
"classes",
"in",
"regression",
"it",
"is",
"equivalent",
"to",
"the",
"decision",
"function"
] | mgraffg/EvoDAG | python | https://github.com/mgraffg/EvoDAG/blob/e11fa1fd1ca9e69cca92696c86661a3dc7b3a1d5/EvoDAG/base.py#L598-L605 | [
"def",
"predict",
"(",
"self",
",",
"v",
"=",
"None",
",",
"X",
"=",
"None",
")",
":",
"if",
"X",
"is",
"None",
":",
"X",
"=",
"v",
"v",
"=",
"None",
"m",
"=",
"self",
".",
"model",
"(",
"v",
"=",
"v",
")",
"return",
"m",
".",
"predict",
... | e11fa1fd1ca9e69cca92696c86661a3dc7b3a1d5 |
train | serve | Gevent-based WSGI-HTTP server. | web/server/gevent_.py | def serve(application, host='127.0.0.1', port=8080):
"""Gevent-based WSGI-HTTP server."""
# Instantiate the server with a host/port configuration and our application.
WSGIServer((host, int(port)), application).serve_forever() | def serve(application, host='127.0.0.1', port=8080):
"""Gevent-based WSGI-HTTP server."""
# Instantiate the server with a host/port configuration and our application.
WSGIServer((host, int(port)), application).serve_forever() | [
"Gevent",
"-",
"based",
"WSGI",
"-",
"HTTP",
"server",
"."
] | marrow/WebCore | python | https://github.com/marrow/WebCore/blob/38d50f8022ca62976a1e5ff23f7714bd647b6532/web/server/gevent_.py#L14-L18 | [
"def",
"serve",
"(",
"application",
",",
"host",
"=",
"'127.0.0.1'",
",",
"port",
"=",
"8080",
")",
":",
"# Instantiate the server with a host/port configuration and our application.",
"WSGIServer",
"(",
"(",
"host",
",",
"int",
"(",
"port",
")",
")",
",",
"applic... | 38d50f8022ca62976a1e5ff23f7714bd647b6532 |
train | get_subscribers | Returns the subscribers for a given object.
:param obj: Any object. | subscribe/templatetags/subscribe_tags.py | def get_subscribers(obj):
"""
Returns the subscribers for a given object.
:param obj: Any object.
"""
ctype = ContentType.objects.get_for_model(obj)
return Subscription.objects.filter(content_type=ctype, object_id=obj.pk) | def get_subscribers(obj):
"""
Returns the subscribers for a given object.
:param obj: Any object.
"""
ctype = ContentType.objects.get_for_model(obj)
return Subscription.objects.filter(content_type=ctype, object_id=obj.pk) | [
"Returns",
"the",
"subscribers",
"for",
"a",
"given",
"object",
"."
] | bitlabstudio/django-subscribe | python | https://github.com/bitlabstudio/django-subscribe/blob/313de63fb4acda172e88b65c3327c793f98e8aa9/subscribe/templatetags/subscribe_tags.py#L23-L31 | [
"def",
"get_subscribers",
"(",
"obj",
")",
":",
"ctype",
"=",
"ContentType",
".",
"objects",
".",
"get_for_model",
"(",
"obj",
")",
"return",
"Subscription",
".",
"objects",
".",
"filter",
"(",
"content_type",
"=",
"ctype",
",",
"object_id",
"=",
"obj",
".... | 313de63fb4acda172e88b65c3327c793f98e8aa9 |
train | is_subscribed | Returns ``True`` if the user is subscribed to the given object.
:param user: A ``User`` instance.
:param obj: Any object. | subscribe/templatetags/subscribe_tags.py | def is_subscribed(user, obj):
"""
Returns ``True`` if the user is subscribed to the given object.
:param user: A ``User`` instance.
:param obj: Any object.
"""
if not user.is_authenticated():
return False
ctype = ContentType.objects.get_for_model(obj)
try:
Subscriptio... | def is_subscribed(user, obj):
"""
Returns ``True`` if the user is subscribed to the given object.
:param user: A ``User`` instance.
:param obj: Any object.
"""
if not user.is_authenticated():
return False
ctype = ContentType.objects.get_for_model(obj)
try:
Subscriptio... | [
"Returns",
"True",
"if",
"the",
"user",
"is",
"subscribed",
"to",
"the",
"given",
"object",
"."
] | bitlabstudio/django-subscribe | python | https://github.com/bitlabstudio/django-subscribe/blob/313de63fb4acda172e88b65c3327c793f98e8aa9/subscribe/templatetags/subscribe_tags.py#L35-L54 | [
"def",
"is_subscribed",
"(",
"user",
",",
"obj",
")",
":",
"if",
"not",
"user",
".",
"is_authenticated",
"(",
")",
":",
"return",
"False",
"ctype",
"=",
"ContentType",
".",
"objects",
".",
"get_for_model",
"(",
"obj",
")",
"try",
":",
"Subscription",
"."... | 313de63fb4acda172e88b65c3327c793f98e8aa9 |
train | Context._promote | Create a new subclass of Context which incorporates instance attributes and new descriptors.
This promotes an instance and its instance attributes up to being a class with class attributes, then
returns an instance of that class. | web/core/context.py | def _promote(self, name, instantiate=True):
"""Create a new subclass of Context which incorporates instance attributes and new descriptors.
This promotes an instance and its instance attributes up to being a class with class attributes, then
returns an instance of that class.
"""
metaclass = type(self._... | def _promote(self, name, instantiate=True):
"""Create a new subclass of Context which incorporates instance attributes and new descriptors.
This promotes an instance and its instance attributes up to being a class with class attributes, then
returns an instance of that class.
"""
metaclass = type(self._... | [
"Create",
"a",
"new",
"subclass",
"of",
"Context",
"which",
"incorporates",
"instance",
"attributes",
"and",
"new",
"descriptors",
".",
"This",
"promotes",
"an",
"instance",
"and",
"its",
"instance",
"attributes",
"up",
"to",
"being",
"a",
"class",
"with",
"cl... | marrow/WebCore | python | https://github.com/marrow/WebCore/blob/38d50f8022ca62976a1e5ff23f7714bd647b6532/web/core/context.py#L23-L37 | [
"def",
"_promote",
"(",
"self",
",",
"name",
",",
"instantiate",
"=",
"True",
")",
":",
"metaclass",
"=",
"type",
"(",
"self",
".",
"__class__",
")",
"contents",
"=",
"self",
".",
"__dict__",
".",
"copy",
"(",
")",
"cls",
"=",
"metaclass",
"(",
"str"... | 38d50f8022ca62976a1e5ff23f7714bd647b6532 |
train | run_individual | Run an individual simulation.
The candidate data has been flattened into the sim_var dict. The
sim_var dict contains parameter:value key value pairs, which are
applied to the model before it is simulated. | pyneuroml/tune/NeuroMLController.py | def run_individual(sim_var,
reference,
neuroml_file,
nml_doc,
still_included,
generate_dir,
target,
sim_time,
dt,
simulator,
cl... | def run_individual(sim_var,
reference,
neuroml_file,
nml_doc,
still_included,
generate_dir,
target,
sim_time,
dt,
simulator,
cl... | [
"Run",
"an",
"individual",
"simulation",
"."
] | NeuroML/pyNeuroML | python | https://github.com/NeuroML/pyNeuroML/blob/aeba2e3040b360bb26556f643cccbfb3dac3b8fb/pyneuroml/tune/NeuroMLController.py#L154-L323 | [
"def",
"run_individual",
"(",
"sim_var",
",",
"reference",
",",
"neuroml_file",
",",
"nml_doc",
",",
"still_included",
",",
"generate_dir",
",",
"target",
",",
"sim_time",
",",
"dt",
",",
"simulator",
",",
"cleanup",
"=",
"True",
",",
"show",
"=",
"False",
... | aeba2e3040b360bb26556f643cccbfb3dac3b8fb |
train | NeuroMLController.run | Run simulation for each candidate
This run method will loop through each candidate and run the simulation
corresponding to its parameter values. It will populate an array called
traces with the resulting voltage traces for the simulation and return it. | pyneuroml/tune/NeuroMLController.py | def run(self,candidates,parameters):
"""
Run simulation for each candidate
This run method will loop through each candidate and run the simulation
corresponding to its parameter values. It will populate an array called
traces with the resulting voltage traces for the sim... | def run(self,candidates,parameters):
"""
Run simulation for each candidate
This run method will loop through each candidate and run the simulation
corresponding to its parameter values. It will populate an array called
traces with the resulting voltage traces for the sim... | [
"Run",
"simulation",
"for",
"each",
"candidate",
"This",
"run",
"method",
"will",
"loop",
"through",
"each",
"candidate",
"and",
"run",
"the",
"simulation",
"corresponding",
"to",
"its",
"parameter",
"values",
".",
"It",
"will",
"populate",
"an",
"array",
"cal... | NeuroML/pyNeuroML | python | https://github.com/NeuroML/pyNeuroML/blob/aeba2e3040b360bb26556f643cccbfb3dac3b8fb/pyneuroml/tune/NeuroMLController.py#L64-L135 | [
"def",
"run",
"(",
"self",
",",
"candidates",
",",
"parameters",
")",
":",
"traces",
"=",
"[",
"]",
"start_time",
"=",
"time",
".",
"time",
"(",
")",
"if",
"self",
".",
"num_parallel_evaluations",
"==",
"1",
":",
"for",
"candidate_i",
"in",
"range",
"(... | aeba2e3040b360bb26556f643cccbfb3dac3b8fb |
train | ThreadLocalExtension.prepare | Executed prior to processing a request. | web/ext/local.py | def prepare(self, context):
"""Executed prior to processing a request."""
if __debug__:
log.debug("Assigning thread local request context.")
self.local.context = context | def prepare(self, context):
"""Executed prior to processing a request."""
if __debug__:
log.debug("Assigning thread local request context.")
self.local.context = context | [
"Executed",
"prior",
"to",
"processing",
"a",
"request",
"."
] | marrow/WebCore | python | https://github.com/marrow/WebCore/blob/38d50f8022ca62976a1e5ff23f7714bd647b6532/web/ext/local.py#L79-L84 | [
"def",
"prepare",
"(",
"self",
",",
"context",
")",
":",
"if",
"__debug__",
":",
"log",
".",
"debug",
"(",
"\"Assigning thread local request context.\"",
")",
"self",
".",
"local",
".",
"context",
"=",
"context"
] | 38d50f8022ca62976a1e5ff23f7714bd647b6532 |
train | WebViews.register | Register a handler for a given type, class, interface, or abstract base class.
View registration should happen within the `start` callback of an extension. For example, to register the
previous `json` view example:
class JSONExtension:
def start(self, context):
context.view.register(tuple, json)
... | web/core/view.py | def register(self, kind, handler):
"""Register a handler for a given type, class, interface, or abstract base class.
View registration should happen within the `start` callback of an extension. For example, to register the
previous `json` view example:
class JSONExtension:
def start(self, context):
... | def register(self, kind, handler):
"""Register a handler for a given type, class, interface, or abstract base class.
View registration should happen within the `start` callback of an extension. For example, to register the
previous `json` view example:
class JSONExtension:
def start(self, context):
... | [
"Register",
"a",
"handler",
"for",
"a",
"given",
"type",
"class",
"interface",
"or",
"abstract",
"base",
"class",
".",
"View",
"registration",
"should",
"happen",
"within",
"the",
"start",
"callback",
"of",
"an",
"extension",
".",
"For",
"example",
"to",
"re... | marrow/WebCore | python | https://github.com/marrow/WebCore/blob/38d50f8022ca62976a1e5ff23f7714bd647b6532/web/core/view.py#L112-L144 | [
"def",
"register",
"(",
"self",
",",
"kind",
",",
"handler",
")",
":",
"if",
"__debug__",
":",
"# In production this logging is completely skipped, regardless of logging level.",
"if",
"py3",
"and",
"not",
"pypy",
":",
"# Where possible, we shorten things to just the cannonic... | 38d50f8022ca62976a1e5ff23f7714bd647b6532 |
train | static | Serve files from disk.
This utility endpoint factory is meant primarily for use in development environments; in production environments
it is better (more efficient, secure, etc.) to serve your static content using a front end load balancer such as
Nginx.
The first argument, `base`, represents the base path to ... | web/app/static.py | def static(base, mapping=None, far=('js', 'css', 'gif', 'jpg', 'jpeg', 'png', 'ttf', 'woff')):
"""Serve files from disk.
This utility endpoint factory is meant primarily for use in development environments; in production environments
it is better (more efficient, secure, etc.) to serve your static content using a ... | def static(base, mapping=None, far=('js', 'css', 'gif', 'jpg', 'jpeg', 'png', 'ttf', 'woff')):
"""Serve files from disk.
This utility endpoint factory is meant primarily for use in development environments; in production environments
it is better (more efficient, secure, etc.) to serve your static content using a ... | [
"Serve",
"files",
"from",
"disk",
".",
"This",
"utility",
"endpoint",
"factory",
"is",
"meant",
"primarily",
"for",
"use",
"in",
"development",
"environments",
";",
"in",
"production",
"environments",
"it",
"is",
"better",
"(",
"more",
"efficient",
"secure",
"... | marrow/WebCore | python | https://github.com/marrow/WebCore/blob/38d50f8022ca62976a1e5ff23f7714bd647b6532/web/app/static.py#L21-L76 | [
"def",
"static",
"(",
"base",
",",
"mapping",
"=",
"None",
",",
"far",
"=",
"(",
"'js'",
",",
"'css'",
",",
"'gif'",
",",
"'jpg'",
",",
"'jpeg'",
",",
"'png'",
",",
"'ttf'",
",",
"'woff'",
")",
")",
":",
"base",
"=",
"abspath",
"(",
"base",
")",
... | 38d50f8022ca62976a1e5ff23f7714bd647b6532 |
train | serve | Diesel-based (greenlet) WSGI-HTTP server.
As a minor note, this is crazy. Diesel includes Flask, too. | web/server/diesel_.py | def serve(application, host='127.0.0.1', port=8080):
"""Diesel-based (greenlet) WSGI-HTTP server.
As a minor note, this is crazy. Diesel includes Flask, too.
"""
# Instantiate the server with a host/port configuration and our application.
WSGIApplication(application, port=int(port), iface=host).run() | def serve(application, host='127.0.0.1', port=8080):
"""Diesel-based (greenlet) WSGI-HTTP server.
As a minor note, this is crazy. Diesel includes Flask, too.
"""
# Instantiate the server with a host/port configuration and our application.
WSGIApplication(application, port=int(port), iface=host).run() | [
"Diesel",
"-",
"based",
"(",
"greenlet",
")",
"WSGI",
"-",
"HTTP",
"server",
".",
"As",
"a",
"minor",
"note",
"this",
"is",
"crazy",
".",
"Diesel",
"includes",
"Flask",
"too",
"."
] | marrow/WebCore | python | https://github.com/marrow/WebCore/blob/38d50f8022ca62976a1e5ff23f7714bd647b6532/web/server/diesel_.py#L14-L21 | [
"def",
"serve",
"(",
"application",
",",
"host",
"=",
"'127.0.0.1'",
",",
"port",
"=",
"8080",
")",
":",
"# Instantiate the server with a host/port configuration and our application.",
"WSGIApplication",
"(",
"application",
",",
"port",
"=",
"int",
"(",
"port",
")",
... | 38d50f8022ca62976a1e5ff23f7714bd647b6532 |
train | process_args | Parse command-line arguments. | pyneuroml/plot/PlotSpikes.py | def process_args():
"""
Parse command-line arguments.
"""
parser = argparse.ArgumentParser(description="A script for plotting files containing spike time data")
parser.add_argument('spiketimeFiles',
type=str,
metavar='<spiketime file>',
... | def process_args():
"""
Parse command-line arguments.
"""
parser = argparse.ArgumentParser(description="A script for plotting files containing spike time data")
parser.add_argument('spiketimeFiles',
type=str,
metavar='<spiketime file>',
... | [
"Parse",
"command",
"-",
"line",
"arguments",
"."
] | NeuroML/pyNeuroML | python | https://github.com/NeuroML/pyNeuroML/blob/aeba2e3040b360bb26556f643cccbfb3dac3b8fb/pyneuroml/plot/PlotSpikes.py#L56-L105 | [
"def",
"process_args",
"(",
")",
":",
"parser",
"=",
"argparse",
".",
"ArgumentParser",
"(",
"description",
"=",
"\"A script for plotting files containing spike time data\"",
")",
"parser",
".",
"add_argument",
"(",
"'spiketimeFiles'",
",",
"type",
"=",
"str",
",",
... | aeba2e3040b360bb26556f643cccbfb3dac3b8fb |
train | simple | Python-standard WSGI-HTTP server for testing purposes.
The additional work performed here is to match the default startup output of "waitress".
This is not a production quality interface and will be have badly under load. | web/server/stdlib.py | def simple(application, host='127.0.0.1', port=8080):
"""Python-standard WSGI-HTTP server for testing purposes.
The additional work performed here is to match the default startup output of "waitress".
This is not a production quality interface and will be have badly under load.
"""
# Try to be handy as many ... | def simple(application, host='127.0.0.1', port=8080):
"""Python-standard WSGI-HTTP server for testing purposes.
The additional work performed here is to match the default startup output of "waitress".
This is not a production quality interface and will be have badly under load.
"""
# Try to be handy as many ... | [
"Python",
"-",
"standard",
"WSGI",
"-",
"HTTP",
"server",
"for",
"testing",
"purposes",
".",
"The",
"additional",
"work",
"performed",
"here",
"is",
"to",
"match",
"the",
"default",
"startup",
"output",
"of",
"waitress",
".",
"This",
"is",
"not",
"a",
"pro... | marrow/WebCore | python | https://github.com/marrow/WebCore/blob/38d50f8022ca62976a1e5ff23f7714bd647b6532/web/server/stdlib.py#L23-L35 | [
"def",
"simple",
"(",
"application",
",",
"host",
"=",
"'127.0.0.1'",
",",
"port",
"=",
"8080",
")",
":",
"# Try to be handy as many terminals allow clicking links.",
"print",
"(",
"\"serving on http://{0}:{1}\"",
".",
"format",
"(",
"host",
",",
"port",
")",
")",
... | 38d50f8022ca62976a1e5ff23f7714bd647b6532 |
train | iiscgi | A specialized version of the reference WSGI-CGI server to adapt to Microsoft IIS quirks.
This is not a production quality interface and will behave badly under load. | web/server/stdlib.py | def iiscgi(application):
"""A specialized version of the reference WSGI-CGI server to adapt to Microsoft IIS quirks.
This is not a production quality interface and will behave badly under load.
"""
try:
from wsgiref.handlers import IISCGIHandler
except ImportError:
print("Python 3.2 or newer is required.")
... | def iiscgi(application):
"""A specialized version of the reference WSGI-CGI server to adapt to Microsoft IIS quirks.
This is not a production quality interface and will behave badly under load.
"""
try:
from wsgiref.handlers import IISCGIHandler
except ImportError:
print("Python 3.2 or newer is required.")
... | [
"A",
"specialized",
"version",
"of",
"the",
"reference",
"WSGI",
"-",
"CGI",
"server",
"to",
"adapt",
"to",
"Microsoft",
"IIS",
"quirks",
".",
"This",
"is",
"not",
"a",
"production",
"quality",
"interface",
"and",
"will",
"behave",
"badly",
"under",
"load",
... | marrow/WebCore | python | https://github.com/marrow/WebCore/blob/38d50f8022ca62976a1e5ff23f7714bd647b6532/web/server/stdlib.py#L53-L66 | [
"def",
"iiscgi",
"(",
"application",
")",
":",
"try",
":",
"from",
"wsgiref",
".",
"handlers",
"import",
"IISCGIHandler",
"except",
"ImportError",
":",
"print",
"(",
"\"Python 3.2 or newer is required.\"",
")",
"if",
"not",
"__debug__",
":",
"warnings",
".",
"wa... | 38d50f8022ca62976a1e5ff23f7714bd647b6532 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.