function stringlengths 11 56k | repo_name stringlengths 5 60 | features list |
|---|---|---|
def __init__(self):
r"""
:param TaskId: 返回重新检测任务的ID。
:type TaskId: int
:param RequestId: 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。
:type RequestId: str
"""
self.TaskId = None
self.RequestId = None | tzpBingo/github-trending | [
42,
20,
42,
1,
1504755582
] |
def __init__(self):
r"""
:param CustomerPolicyItemIdSet: 要重新扫描的客户检测项的列表。
:type CustomerPolicyItemIdSet: list of int non-negative
"""
self.CustomerPolicyItemIdSet = None | tzpBingo/github-trending | [
42,
20,
42,
1,
1504755582
] |
def __init__(self):
r"""
:param TaskId: 返回重新检测任务的ID。
:type TaskId: int
:param RequestId: 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。
:type RequestId: str
"""
self.TaskId = None
self.RequestId = None | tzpBingo/github-trending | [
42,
20,
42,
1,
1504755582
] |
def __init__(self):
r"""
:param CustomerAssetIdSet: 要重新扫描的客户资产项ID的列表。
:type CustomerAssetIdSet: list of int non-negative
"""
self.CustomerAssetIdSet = None | tzpBingo/github-trending | [
42,
20,
42,
1,
1504755582
] |
def __init__(self):
r"""
:param TaskId: 返回重新检测任务的ID。
:type TaskId: int
:param RequestId: 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。
:type RequestId: str
"""
self.TaskId = None
self.RequestId = None | tzpBingo/github-trending | [
42,
20,
42,
1,
1504755582
] |
def __init__(self):
r"""
:param EventSet: 趋势列表
:type EventSet: list of RunTimeTendencyInfo
:param EventType: 事件类型: | tzpBingo/github-trending | [
42,
20,
42,
1,
1504755582
] |
def _deserialize(self, params):
if params.get("EventSet") is not None:
self.EventSet = []
for item in params.get("EventSet"):
obj = RunTimeTendencyInfo()
obj._deserialize(item)
self.EventSet.append(obj)
self.EventType = params.get("EventType")
memeber_set = set(params.keys())
for name, value in vars(self).items():
if name in memeber_set:
memeber_set.remove(name)
if len(memeber_set) > 0:
warnings.warn("%s fileds are useless." % ",".join(memeber_set)) | tzpBingo/github-trending | [
42,
20,
42,
1,
1504755582
] |
def __init__(self):
r"""
:param ServiceID: 服务id
:type ServiceID: str
:param HostID: 主机id
:type HostID: str
:param HostIP: 主机ip
:type HostIP: str
:param ContainerName: 容器名
:type ContainerName: str
:param Type: 服务名 例如nginx/redis
:type Type: str
:param Version: 版本
:type Version: str
:param RunAs: 账号
:type RunAs: str
:param Listen: 监听端口
:type Listen: list of str
:param Config: 配置
:type Config: str
:param ProcessCnt: 关联进程数
:type ProcessCnt: int
:param AccessLog: 访问日志
:type AccessLog: str
:param ErrorLog: 错误日志
:type ErrorLog: str
:param DataPath: 数据目录
:type DataPath: str
:param WebRoot: web目录
:type WebRoot: str
:param Pids: 关联的进程id
:type Pids: list of int non-negative
:param MainType: 服务类型 app,web,db
:type MainType: str
:param Exe: 执行文件
:type Exe: str
:param Parameter: 服务命令行参数
:type Parameter: str
:param ContainerId: 容器id
:type ContainerId: str
:param HostName: 主机名称
:type HostName: str
:param PublicIp: 外网ip
:type PublicIp: str
"""
self.ServiceID = None
self.HostID = None
self.HostIP = None
self.ContainerName = None
self.Type = None
self.Version = None
self.RunAs = None
self.Listen = None
self.Config = None
self.ProcessCnt = None
self.AccessLog = None
self.ErrorLog = None
self.DataPath = None
self.WebRoot = None
self.Pids = None
self.MainType = None
self.Exe = None
self.Parameter = None
self.ContainerId = None
self.HostName = None
self.PublicIp = None | tzpBingo/github-trending | [
42,
20,
42,
1,
1504755582
] |
def __init__(self):
r"""
:param ClusterIds: 要设置的集群ID列表
:type ClusterIds: list of str
:param ClusterCheckMode: 集群检查模式(正常模式"Cluster_Normal"、主动模式"Cluster_Actived"、不设置"Cluster_Unset")
:type ClusterCheckMode: str
:param ClusterAutoCheck: 0不设置 1打开 2关闭
:type ClusterAutoCheck: int
"""
self.ClusterIds = None
self.ClusterCheckMode = None
self.ClusterAutoCheck = None | tzpBingo/github-trending | [
42,
20,
42,
1,
1504755582
] |
def __init__(self):
r"""
:param SetCheckResult: "Succ"表示设置成功,"Failed"表示设置失败
:type SetCheckResult: str
:param RequestId: 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。
:type RequestId: str
"""
self.SetCheckResult = None
self.RequestId = None | tzpBingo/github-trending | [
42,
20,
42,
1,
1504755582
] |
def __init__(self):
r"""
:param PayTime: 扣费时间
:type PayTime: str
:param CoresCnt: 计费核数
:type CoresCnt: int
"""
self.PayTime = None
self.CoresCnt = None | tzpBingo/github-trending | [
42,
20,
42,
1,
1504755582
] |
def __init__(self):
r"""
:param TaskId: 任务ID
:type TaskId: str
:param ContainerIds: 需要停止的容器id 为空默认停止整个任务
:type ContainerIds: list of str
"""
self.TaskId = None
self.ContainerIds = None | tzpBingo/github-trending | [
42,
20,
42,
1,
1504755582
] |
def __init__(self):
r"""
:param RequestId: 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。
:type RequestId: str
"""
self.RequestId = None | tzpBingo/github-trending | [
42,
20,
42,
1,
1504755582
] |
def __init__(self):
r"""
:param RequestId: 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。
:type RequestId: str
"""
self.RequestId = None | tzpBingo/github-trending | [
42,
20,
42,
1,
1504755582
] |
def __init__(self):
r"""
:param Name: 仓库名
:type Name: str
:param Username: 用户名
:type Username: str
:param Password: 密码
:type Password: str
:param Url: 仓库url
:type Url: str
:param RegistryType: 仓库类型,列表:harbor
:type RegistryType: str
:param NetType: 网络类型,列表:public(公网)
:type NetType: str
:param RegistryVersion: 仓库版本
:type RegistryVersion: str
:param RegistryRegion: 区域,列表:default(默认)
:type RegistryRegion: str
:param SpeedLimit: 限速
:type SpeedLimit: int
:param Insecure: 安全模式(证书校验):0(默认) 非安全模式(跳过证书校验):1
:type Insecure: int
"""
self.Name = None
self.Username = None
self.Password = None
self.Url = None
self.RegistryType = None
self.NetType = None
self.RegistryVersion = None
self.RegistryRegion = None
self.SpeedLimit = None
self.Insecure = None | tzpBingo/github-trending | [
42,
20,
42,
1,
1504755582
] |
def __init__(self):
r"""
:param HealthCheckErr: 连接错误信息 | tzpBingo/github-trending | [
42,
20,
42,
1,
1504755582
] |
def _deserialize(self, params):
self.HealthCheckErr = params.get("HealthCheckErr")
self.NameRepeatErr = params.get("NameRepeatErr")
self.RegistryId = params.get("RegistryId")
self.RequestId = params.get("RequestId") | tzpBingo/github-trending | [
42,
20,
42,
1,
1504755582
] |
def __init__(self):
r"""
:param ScanPeriod: 定时扫描周期
:type ScanPeriod: int
:param Enable: 定时扫描开关
:type Enable: bool
:param ScanTime: 定时扫描的时间
:type ScanTime: str
:param ScanType: 扫描木马类型数组
:type ScanType: list of str
:param Images: 扫描镜像
:type Images: list of ImageInfo
:param All: 是否扫描所有
:type All: bool
:param Id: 扫描镜像Id
:type Id: list of int non-negative
"""
self.ScanPeriod = None
self.Enable = None
self.ScanTime = None
self.ScanType = None
self.Images = None
self.All = None
self.Id = None | tzpBingo/github-trending | [
42,
20,
42,
1,
1504755582
] |
def __init__(self):
r"""
:param RequestId: 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。
:type RequestId: str
"""
self.RequestId = None | tzpBingo/github-trending | [
42,
20,
42,
1,
1504755582
] |
def __init__(self):
r"""
:param FileName: 文件名称
:type FileName: str
:param FilePath: 文件路径
:type FilePath: str
:param VirusName: 病毒名称
:type VirusName: str
:param CreateTime: 创建时间
:type CreateTime: str
:param ModifyTime: 更新时间
:type ModifyTime: str
:param ContainerName: 容器名称
:type ContainerName: str
:param ContainerId: 容器id
:type ContainerId: str
:param ContainerStatus: 容器状态,CS_RUNING:运行, CS_PAUSE:暂停,CS_STOP:停止,
CS_CREATE:已经创建, CS_DESTORY:销毁
:type ContainerStatus: str
:param ImageName: 镜像名称
:type ImageName: str
:param ImageId: 镜像id
:type ImageId: str
:param Status: DEAL_NONE:文件待处理 | tzpBingo/github-trending | [
42,
20,
42,
1,
1504755582
] |
def _deserialize(self, params):
self.FileName = params.get("FileName")
self.FilePath = params.get("FilePath")
self.VirusName = params.get("VirusName")
self.CreateTime = params.get("CreateTime")
self.ModifyTime = params.get("ModifyTime")
self.ContainerName = params.get("ContainerName")
self.ContainerId = params.get("ContainerId")
self.ContainerStatus = params.get("ContainerStatus")
self.ImageName = params.get("ImageName")
self.ImageId = params.get("ImageId")
self.Status = params.get("Status")
self.Id = params.get("Id")
self.HarmDescribe = params.get("HarmDescribe")
self.SuggestScheme = params.get("SuggestScheme")
self.SubStatus = params.get("SubStatus")
memeber_set = set(params.keys())
for name, value in vars(self).items():
if name in memeber_set:
memeber_set.remove(name)
if len(memeber_set) > 0:
warnings.warn("%s fileds are useless." % ",".join(memeber_set)) | tzpBingo/github-trending | [
42,
20,
42,
1,
1504755582
] |
def __init__(self):
r"""
:param ContainerName: 容器名称
:type ContainerName: str
:param ContainerId: 容器id
:type ContainerId: str
:param ImageName: 镜像名称
:type ImageName: str
:param ImageId: 镜像Id
:type ImageId: str
:param HostName: 主机名称
:type HostName: str
:param HostIp: 主机ip
:type HostIp: str
:param Status: 扫描状态: | tzpBingo/github-trending | [
42,
20,
42,
1,
1504755582
] |
def _deserialize(self, params):
self.ContainerName = params.get("ContainerName")
self.ContainerId = params.get("ContainerId")
self.ImageName = params.get("ImageName")
self.ImageId = params.get("ImageId")
self.HostName = params.get("HostName")
self.HostIp = params.get("HostIp")
self.Status = params.get("Status")
self.StartTime = params.get("StartTime")
self.EndTime = params.get("EndTime")
self.RiskCnt = params.get("RiskCnt")
self.Id = params.get("Id")
self.ErrorMsg = params.get("ErrorMsg")
memeber_set = set(params.keys())
for name, value in vars(self).items():
if name in memeber_set:
memeber_set.remove(name)
if len(memeber_set) > 0:
warnings.warn("%s fileds are useless." % ",".join(memeber_set)) | tzpBingo/github-trending | [
42,
20,
42,
1,
1504755582
] |
def __init__(self):
r"""
:param Type: 告警事件类型: | tzpBingo/github-trending | [
42,
20,
42,
1,
1504755582
] |
def _deserialize(self, params):
self.Type = params.get("Type")
self.Switch = params.get("Switch")
self.BeginTime = params.get("BeginTime")
self.EndTime = params.get("EndTime")
self.ControlBits = params.get("ControlBits")
memeber_set = set(params.keys())
for name, value in vars(self).items():
if name in memeber_set:
memeber_set.remove(name)
if len(memeber_set) > 0:
warnings.warn("%s fileds are useless." % ",".join(memeber_set)) | tzpBingo/github-trending | [
42,
20,
42,
1,
1504755582
] |
def query_name(name, verbose=False, print_header=False):
"""
Query NED by source name.
"""
try:
q = Ned.query_object(name)
objname = q["Object Name"][0]
objtype = q["Type"][0].decode("utf-8")
ra = q["RA(deg)"][0]
dec = q["DEC(deg)"][0]
velocity = q["Velocity"][0]
z = q["Redshift"][0]
z_flag = q["Redshift Flag"][0].decode("utf-8")
refs = q["References"][0]
notes = q["Notes"][0]
except RemoteServiceError:
objname = None
objtype = None
ra = None
dec = None
velocity = None
z = None
z_flag = None
refs = None
notes = None
if verbose:
print("*** %s: not found ***" % name, file=sys.stderr)
#
results = OrderedDict([
("Name", name),
("NED_Name", objname),
("Type", objtype),
("RA", ra),
("DEC", dec),
("Velocity", velocity),
("z", z),
("z_Flag", z_flag),
("References", refs),
("Notes", notes),
])
if verbose:
if print_header:
print(",".join(results.keys()))
print(",".join([str(v) for v in results.values()]))
return results | liweitianux/atoolbox | [
6,
4,
6,
1,
1464356672
] |
def __init__(self, client, config, serializer, deserializer) -> None:
self._client = client
self._serialize = serializer
self._deserialize = deserializer
self._config = config | Azure/azure-sdk-for-python | [
3526,
2256,
3526,
986,
1335285972
] |
def list_by_service(
self,
resource_group_name: str,
service_name: str,
api_id: str,
filter: Optional[str] = None,
top: Optional[int] = None,
skip: Optional[int] = None,
**kwargs: Any | Azure/azure-sdk-for-python | [
3526,
2256,
3526,
986,
1335285972
] |
def prepare_request(next_link=None):
if not next_link: | Azure/azure-sdk-for-python | [
3526,
2256,
3526,
986,
1335285972
] |
def __init__(self, client, config, serializer, deserializer):
self._client = client
self._serialize = serializer
self._deserialize = deserializer
self._config = config | Azure/azure-sdk-for-python | [
3526,
2256,
3526,
986,
1335285972
] |
def _create_or_update_initial(
self,
resource_group_name, # type: str
virtual_hub_name, # type: str
route_table_name, # type: str
virtual_hub_route_table_v2_parameters, # type: "_models.VirtualHubRouteTableV2"
**kwargs # type: Any | Azure/azure-sdk-for-python | [
3526,
2256,
3526,
986,
1335285972
] |
def begin_create_or_update(
self,
resource_group_name, # type: str
virtual_hub_name, # type: str
route_table_name, # type: str
virtual_hub_route_table_v2_parameters, # type: "_models.VirtualHubRouteTableV2"
**kwargs # type: Any | Azure/azure-sdk-for-python | [
3526,
2256,
3526,
986,
1335285972
] |
def get_long_running_output(pipeline_response):
deserialized = self._deserialize('VirtualHubRouteTableV2', pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {})
return deserialized | Azure/azure-sdk-for-python | [
3526,
2256,
3526,
986,
1335285972
] |
def _delete_initial(
self,
resource_group_name, # type: str
virtual_hub_name, # type: str
route_table_name, # type: str
**kwargs # type: Any | Azure/azure-sdk-for-python | [
3526,
2256,
3526,
986,
1335285972
] |
def begin_delete(
self,
resource_group_name, # type: str
virtual_hub_name, # type: str
route_table_name, # type: str
**kwargs # type: Any | Azure/azure-sdk-for-python | [
3526,
2256,
3526,
986,
1335285972
] |
def get_long_running_output(pipeline_response):
if cls:
return cls(pipeline_response, None, {}) | Azure/azure-sdk-for-python | [
3526,
2256,
3526,
986,
1335285972
] |
def list(
self,
resource_group_name, # type: str
virtual_hub_name, # type: str
**kwargs # type: Any | Azure/azure-sdk-for-python | [
3526,
2256,
3526,
986,
1335285972
] |
def prepare_request(next_link=None):
# Construct headers
header_parameters = {} # type: Dict[str, Any]
header_parameters['Accept'] = self._serialize.header("accept", accept, 'str')
if not next_link:
# Construct URL
url = self.list.metadata['url'] # type: ignore
path_format_arguments = {
'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'),
'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'),
'virtualHubName': self._serialize.url("virtual_hub_name", virtual_hub_name, 'str'),
}
url = self._client.format_url(url, **path_format_arguments)
# Construct parameters
query_parameters = {} # type: Dict[str, Any]
query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
request = self._client.get(url, query_parameters, header_parameters)
else:
url = next_link
query_parameters = {} # type: Dict[str, Any]
request = self._client.get(url, query_parameters, header_parameters)
return request | Azure/azure-sdk-for-python | [
3526,
2256,
3526,
986,
1335285972
] |
def get_next(next_link=None):
request = prepare_request(next_link)
pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
response = pipeline_response.http_response
if response.status_code not in [200]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
return pipeline_response | Azure/azure-sdk-for-python | [
3526,
2256,
3526,
986,
1335285972
] |
def process_item(self, item_xml):
result_item = None
if "<heading>" in item_xml:
item = JenItem(item_xml)
result_item = {
'label': item["title"],
'icon': item.get("thumbnail", addon_icon),
'fanart': item.get("fanart", addon_fanart),
'mode': "HEADING",
'url': item.get("heading", ""),
'folder': False,
'imdb': "0",
'content': "files",
'season': "0",
'episode': "0",
'info': {},
'year': "0",
'context': get_context_items(item),
"summary": item.get("summary", None)
}
return result_item
elif "<mysettings>" in item_xml:
item = JenItem(item_xml)
result_item = {
'label': item["title"],
'icon': item.get("thumbnail", addon_icon),
'fanart': item.get("fanart", addon_fanart),
'mode': "MYSETTINGS",
'url': item.get("mysettings", ""),
'folder': False,
'imdb': "0",
'content': "files",
'season': "0",
'episode': "0",
'info': {},
'year': "0",
'context': get_context_items(item),
"summary": item.get("summary", None)
}
return result_item
elif "<adult>" in item_xml:
item = JenItem(item_xml)
result_item = {
'label': item["title"],
'icon': item.get("thumbnail", addon_icon),
'fanart': item.get("fanart", addon_fanart),
'mode': "PASSREQ",
'url': item.get("adult", ""),
'folder': True,
'imdb': "0",
'content': "files",
'season': "0",
'episode': "0",
'info': {},
'year': "0",
'context': get_context_items(item),
"summary": item.get("summary", None)
}
return result_item
elif "<mode>" in item_xml:
item = JenItem(item_xml)
result_item = {
'label': item["title"],
'icon': item.get("thumbnail", addon_icon),
'fanart': item.get("fanart", addon_fanart),
'mode': item.get("mode", ""),
'url': item.get("modeurl", ""),
'folder': True,
'imdb': "0",
'content': "files",
'season': "0",
'episode': "0",
'info': {},
'year': "0",
'context': get_context_items(item),
"summary": item.get("summary", None)
}
return result_item
elif "<pairwith>" in item_xml:
item = JenItem(item_xml)
result_item = {
'label': item["title"],
'icon': item.get("thumbnail", addon_icon),
'fanart': item.get("fanart", addon_fanart),
'mode': "PAIRWITH",
'url': item.get("pairwith", ""),
'folder': False,
'imdb': "0",
'content': "files",
'season': "0",
'episode': "0",
'info': {},
'year': "0",
'context': get_context_items(item),
"summary": item.get("summary", None)
}
return result_item
elif "<trailer>" in item_xml:
item = JenItem(item_xml)
result_item = {
'label': item["title"],
'icon': item.get("thumbnail", addon_icon),
'fanart': item.get("fanart", addon_fanart),
'mode': "PAIRWITH",
'url': item.get("pairwith", ""),
'folder': False,
'imdb': "0",
'content': "files",
'season': "0",
'episode': "0",
'info': {},
'year': "0",
'context': get_context_items(item),
"summary": item.get("summary", None)
}
result_item["info"]["trailer"] = item.get("trailer", None)
return result_item | repotvsupertuga/tvsupertuga.repository | [
1,
8,
1,
4,
1493763534
] |
def heading_handler():
try:
quit()
except:
pass | repotvsupertuga/tvsupertuga.repository | [
1,
8,
1,
4,
1493763534
] |
def mysettings_handler(query):
try:
xbmc.executebuiltin('Dialog.Close(busydialog)')
xbmc.executebuiltin('Addon.OpenSettings(%s)' % addon_id)
c, f = query.split('/')
xbmc.executebuiltin('SetFocus(%i)' % (int(c) + 100))
xbmc.executebuiltin('SetFocus(%i)' % (int(f) + 200))
except:
return | repotvsupertuga/tvsupertuga.repository | [
1,
8,
1,
4,
1493763534
] |
def password_handler(url):
adult_xml = ''
try:
the_setting = this_addon.getSetting('adult_stuff')
if the_setting == None or the_setting == '':
the_setting = 'false'
xbmcaddon.Addon().setSetting('adult_stuff', str(the_setting))
if the_setting == 'false':
adult_xml += "<item>"\
" <title>[COLOR yellow]This menu is not enabled[/COLOR]</title>"\
" <heading></heading>"\
" <thumbnail>https://nsx.np.dl.playstation.net/nsx/material/c/ce432e00ce97a461b9a8c01ce78538f4fa6610fe-1107562.png</thumbnail>"\
"</item>"
jenlist = JenList(adult_xml)
display_list(jenlist.get_list(), jenlist.get_content_type())
return
except:
return
sep_list = url.decode('base64').split('|')
dec_pass = sep_list[0]
xml_loc = sep_list[1]
input = ''
keyboard = xbmc.Keyboard(input, '[COLOR red]Are you worthy?[/COLOR]')
keyboard.doModal()
if keyboard.isConfirmed():
input = keyboard.getText()
if input == dec_pass:
if 'http' in xml_loc:
adult_xml = requests.get(xml_loc).content
else:
import xbmcvfs
xml_loc = xml_loc.replace('file://', '')
xml_file = xbmcvfs.File(os.path.join(addon_path, "xml", xml_loc))
adult_xml = xml_file.read()
xml_file.close()
else:
adult_xml += "<dir>"\
" <title>[COLOR yellow]Wrong Answer! You are not worthy[/COLOR]</title>"\
" <thumbnail>https://nsx.np.dl.playstation.net/nsx/material/c/ce432e00ce97a461b9a8c01ce78538f4fa6610fe-1107562.png</thumbnail>"\
"</dir>"
jenlist = JenList(adult_xml)
display_list(jenlist.get_list(), jenlist.get_content_type()) | repotvsupertuga/tvsupertuga.repository | [
1,
8,
1,
4,
1493763534
] |
def pairing_handler(url):
try:
site = ''
if 'pairlist' in url:
names = []
for item in PAIR_LIST:
the_title = 'PAIR %s' % (item[0].replace('_', ' ').capitalize())
names.append(the_title)
selected = xbmcgui.Dialog().select('Select Site',names)
if selected == -1:
return
# If you add [COLOR] etc to the title stuff in names loop above, this will strip all of that out and make it usable here
pair_item = re.sub('\[.*?]','',names[selected]).replace('Pair for ', '').replace(' ', '_').lower()
for item in PAIR_LIST:
if str(item[0]) == pair_item:
site = item[1]
break
else:
for item in PAIR_LIST:
if str(item[0]) == url:
site = item[1]
break
check_os = platform()
if check_os == 'android':
spam_time = xbmc.executebuiltin('StartAndroidActivity(,android.intent.action.VIEW,,%s)' % (site))
elif check_os == 'osx':
os.system("open -a /Applications/Safari.app %s") % (site)
else:
spam_time = webbrowser.open(site)
except:
failure = traceback.format_exc()
xbmcgui.Dialog().textviewer('Exception',str(failure))
pass | repotvsupertuga/tvsupertuga.repository | [
1,
8,
1,
4,
1493763534
] |
def is_displayed(self):
return (
self.in_intel_reports and
self.title.text == 'Editing EVM Group "{}"'.format(self.context["object"].group) and
self.edit_report_menus.is_opened and
self.edit_report_menus.tree.currently_selected == [
"All EVM Groups",
self.context["object"].group
]
) | RedHatQE/cfme_tests | [
69,
165,
69,
133,
1360187957
] |
def go_to_group(self, group_name):
self.group = group_name
view = navigate_to(self, "EditReportMenus")
assert view.is_displayed
return view | RedHatQE/cfme_tests | [
69,
165,
69,
133,
1360187957
] |
def get_subfolders(self, group, folder):
"""Returns list of sub-folders for given user group and folder.
Args:
group: User group to check.
folder: Folder to read.
"""
view = self.go_to_group(group)
view.reports_tree.click_path("Top Level", folder)
fields = view.manager.fields
view.discard_button.click()
return fields | RedHatQE/cfme_tests | [
69,
165,
69,
133,
1360187957
] |
def add_subfolder(self, group, folder, subfolder):
"""Adds a subfolder under specified folder.
Args:
group: User group.
folder: Name of the folder.
subfolder: Name of the new subdfolder.
"""
with self.manage_folder(folder) as fldr:
fldr.add(subfolder) | RedHatQE/cfme_tests | [
69,
165,
69,
133,
1360187957
] |
def manage_subfolder(self, group, folder, subfolder):
"""Context manager to use when modifying the subfolder contents.
You can use manager's :py:meth:`FolderManager.bail_out` classmethod to end and discard the
changes done inside the with block.
Args:
group: User group.
folder: Parent folder name.
subfolder: Subfolder name to manage.
Returns: Context-managed :py:class: `widgetastic_manageiq.MultiBoxSelect` instance
"""
view = self.go_to_group(group)
view.reports_tree.click_path("Top Level", folder, subfolder)
try:
yield view.report_select
except FolderManager._BailOut:
view.discard_button.click()
except Exception:
# In case of any exception, nothing will be saved
view.discard_button.click()
raise # And reraise the exception
else:
# If no exception happens, save!
view.commit_button.click()
view.save_button.click() | RedHatQE/cfme_tests | [
69,
165,
69,
133,
1360187957
] |
def manage_folder(self, group, folder=None):
"""Context manager to use when modifying the folder contents.
You can use manager's :py:meth:`FolderManager.bail_out` classmethod to end and discard the
changes done inside the with block. This context manager does not give the manager as a
value to the with block so you have to import and use the :py:class:`FolderManager` class
manually.
Args:
group: User group.
folder: Which folder to manage. If None, top-level will be managed.
Returns: Context-managed :py:class:`widgetastic_manageiq.FolderManager` instance
"""
view = self.go_to_group(group)
if folder is None:
view.reports_tree.click_path("Top Level")
else:
view.reports_tree.click_path("Top Level", folder)
try:
yield view.manager
except FolderManager._BailOut:
view.manager.discard()
except Exception:
# In case of any exception, nothing will be saved
view.manager.discard()
raise # And reraise the exception
else:
# If no exception happens, save!
view.manager.commit()
view.save_button.click() | RedHatQE/cfme_tests | [
69,
165,
69,
133,
1360187957
] |
def __init__(self, cell_model):
self._cell_model = cell_model | Juanlu001/CBC.Solve | [
1,
7,
1,
1,
1427993651
] |
def mesh(self):
error("Need to prescribe domain") | Juanlu001/CBC.Solve | [
1,
7,
1,
1,
1427993651
] |
def applied_current(self):
return None | Juanlu001/CBC.Solve | [
1,
7,
1,
1,
1427993651
] |
def essential_boundaries(self):
return None | Juanlu001/CBC.Solve | [
1,
7,
1,
1,
1427993651
] |
def initial_conditions(self):
return None | Juanlu001/CBC.Solve | [
1,
7,
1,
1,
1427993651
] |
def boundary_current(self):
return None | Juanlu001/CBC.Solve | [
1,
7,
1,
1,
1427993651
] |
def is_dynamic(self):
return True | Juanlu001/CBC.Solve | [
1,
7,
1,
1,
1427993651
] |
def __init__(self):
self._idx = OOBTree() | belokop/indico_bare | [
1,
1,
1,
5,
1465204236
] |
def unindex(self, participation):
"""Remove an existing participation from the index
"""
#if the Participation is not linked to an Avatar there's no point to
# unindex it
a = participation.getAvatar()
if not a:
return
#if the Avatar associated to the participation isn't in the index do
# nothing
if not self._idx.has_key(a.getId()):
return
#if the given participation is indexed remove it, otherwise do nothing
if participation in self._idx[a.getId()]:
self._idx[a.getId()].remove(participation) | belokop/indico_bare | [
1,
1,
1,
5,
1465204236
] |
def __init__(self, abstract, **data):
self._abstract = abstract
self._firstName = ""
self._surName = ""
self._email = ""
self._affilliation = ""
self._address = ""
self._telephone = ""
self._fax = ""
self._title = ""
self.setData(**data) | belokop/indico_bare | [
1,
1,
1,
5,
1465204236
] |
def setFromAbstractParticipation(self, part):
data = {"title": part.getTitle(),
"firstName": part.getFirstName(),
"surName": part.getSurName(),
"email": part.getEmail(),
"affiliation": part.getAffiliation(),
"address": part.getAddress(),
"telephone": part.getTelephone(),
"fax": part.getFax()}
self.setData(**data) | belokop/indico_bare | [
1,
1,
1,
5,
1465204236
] |
def getData(self):
data = {}
data["firstName"] = self.getFirstName()
data["surName"] = self.getSurName()
data["email"] = self.getEmail()
data["affiliation"] = self.getAffiliation()
data["address"] = self.getAddress()
data["telephone"] = self.getTelephone()
data["fax"] = self.getFax()
data["title"] = self.getTitle()
return data | belokop/indico_bare | [
1,
1,
1,
5,
1465204236
] |
def clone(self, abstract):
ap = AbstractParticipation(abstract, self.getData())
return ap | belokop/indico_bare | [
1,
1,
1,
5,
1465204236
] |
def _unindex(self):
abs = self.getAbstract()
if abs is not None:
mgr = abs.getOwner()
if mgr is not None:
mgr.unindexAuthor(self) | belokop/indico_bare | [
1,
1,
1,
5,
1465204236
] |
def setFirstName(self, name):
tmp = name.strip()
if tmp == self.getFirstName():
return
self._unindex()
self._firstName = tmp
self._index()
self._notifyModification() | belokop/indico_bare | [
1,
1,
1,
5,
1465204236
] |
def getName(self):
return self._firstName | belokop/indico_bare | [
1,
1,
1,
5,
1465204236
] |
def getSurName(self):
return self._surName | belokop/indico_bare | [
1,
1,
1,
5,
1465204236
] |
def setEmail(self, email):
email = email.strip().lower()
if email != self.getEmail():
self._unindex()
self._email = email
self._index()
self._notifyModification() | belokop/indico_bare | [
1,
1,
1,
5,
1465204236
] |
def setAffiliation(self, af):
self._affilliation = af.strip()
self._notifyModification() | belokop/indico_bare | [
1,
1,
1,
5,
1465204236
] |
def getAffiliation(self):
return self._affilliation | belokop/indico_bare | [
1,
1,
1,
5,
1465204236
] |
def affiliation(self):
return self._affilliation | belokop/indico_bare | [
1,
1,
1,
5,
1465204236
] |
def getAddress(self):
return self._address | belokop/indico_bare | [
1,
1,
1,
5,
1465204236
] |
def getTelephone(self):
return self._telephone | belokop/indico_bare | [
1,
1,
1,
5,
1465204236
] |
def getFax(self):
return self._fax | belokop/indico_bare | [
1,
1,
1,
5,
1465204236
] |
def getTitle(self):
return self._title | belokop/indico_bare | [
1,
1,
1,
5,
1465204236
] |
def full_name(self):
return self.getFullName() | belokop/indico_bare | [
1,
1,
1,
5,
1465204236
] |
def getAbrName(self):
res = self.getSurName()
if self.getFirstName():
if res:
res = "%s, " % res
res = "%s%s." % (res, safe_upper(safe_slice(self.getFirstName(), 0, 1)))
return res | belokop/indico_bare | [
1,
1,
1,
5,
1465204236
] |
def setAbstract(self, abs):
self._abstract = abs | belokop/indico_bare | [
1,
1,
1,
5,
1465204236
] |
def recover(self):
TrashCanManager().remove(self) | belokop/indico_bare | [
1,
1,
1,
5,
1465204236
] |
def __init__(self, abstract, **data):
AbstractParticipation.__init__(self, abstract, **data)
self._abstractId = "" | belokop/indico_bare | [
1,
1,
1,
5,
1465204236
] |
def setId(self, newId):
self._id = str(newId) | belokop/indico_bare | [
1,
1,
1,
5,
1465204236
] |
def isSpeaker(self):
return self._abstract.isSpeaker(self) | belokop/indico_bare | [
1,
1,
1,
5,
1465204236
] |
def __init__(self, abstract, av):
if av is None:
raise MaKaCError(_("abstract submitter cannot be None"))
AbstractParticipation.__init__(self, abstract)
self._user = None
self._setUser(av)
self.setFromAvatar(av) | belokop/indico_bare | [
1,
1,
1,
5,
1465204236
] |
def clone(self, abstract):
sub = Submitter(abstract, self.getAvatar())
sub.setData(self.getData())
return sub | belokop/indico_bare | [
1,
1,
1,
5,
1465204236
] |
def getAvatar(self):
return self._user | belokop/indico_bare | [
1,
1,
1,
5,
1465204236
] |
def __init__(self, mgr):
self._mgr = mgr
self._idx = OOBTree() | belokop/indico_bare | [
1,
1,
1,
5,
1465204236
] |
def index(self, auth):
if auth.getAbstract() is None:
raise MaKaCError(_("cannot index an author of an abstract which is not included in a conference"))
if auth.getAbstract().getOwner() != self._mgr:
raise MaKaCError(_("cannot index an author of an abstract which does not belong to this conference"))
key = self._getKey(auth)
abstractId = str(auth.getAbstract().getId())
if not self._idx.has_key(key):
self._idx[key] = OIBTree.OIBTree()
if not self._idx[key].has_key(abstractId):
self._idx[key][abstractId] = 0
self._idx[key][abstractId] += 1 | belokop/indico_bare | [
1,
1,
1,
5,
1465204236
] |
def match(self, query):
query = query.lower().strip()
res = OIBTree.OISet()
for k in self._idx.keys():
if k.find(query) != -1:
res = OIBTree.union(res, self._idx[k])
return res | belokop/indico_bare | [
1,
1,
1,
5,
1465204236
] |
def __init__(self, mgr):
_AuthIdx.__init__(self, mgr)
for abs in self._mgr.getAbstractList():
for auth in abs.getPrimaryAuthorList():
self.index(auth) | belokop/indico_bare | [
1,
1,
1,
5,
1465204236
] |
def __init__(self, mgr):
_AuthIdx.__init__(self, mgr)
for abs in self._mgr.getAbstractList():
for auth in abs.getPrimaryAuthorList():
self.index(auth)
for auth in abs.getCoAuthorList():
self.index(auth) | belokop/indico_bare | [
1,
1,
1,
5,
1465204236
] |
def __init__(self, owner):
self._owner = owner
self._abstracts = OOBTree()
self._participationIdx = _AbstractParticipationIndex()
self.__abstractGenerator = Counter()
self._activated = False
self.setStartSubmissionDate(datetime.now())
self.setEndSubmissionDate(datetime.now()) | belokop/indico_bare | [
1,
1,
1,
5,
1465204236
] |
def getMultipleTracks(self):
try:
return self._multipleTracks
except:
self.setMultipleTracks(True)
return self._multipleTracks | belokop/indico_bare | [
1,
1,
1,
5,
1465204236
] |
def areTracksMandatory(self):
try:
return self._tracksMandatory
except:
self.setTracksMandatory(False)
return self._tracksMandatory | belokop/indico_bare | [
1,
1,
1,
5,
1465204236
] |
def setAllowAttachFiles(self, attachedFiles):
self._attachFiles = attachedFiles | belokop/indico_bare | [
1,
1,
1,
5,
1465204236
] |
def showSelectAsSpeaker(self):
try:
return self._showSelectAsSpeaker
except:
self._showSelectAsSpeaker = True
return self._showSelectAsSpeaker | belokop/indico_bare | [
1,
1,
1,
5,
1465204236
] |
def isSelectSpeakerMandatory(self):
try:
return self._selectSpeakerMandatory
except:
self._selectSpeakerMandatory = True
return self._selectSpeakerMandatory | belokop/indico_bare | [
1,
1,
1,
5,
1465204236
] |
def showAttachedFilesContribList(self):
try:
return self._showAttachedFilesContribList
except:
self._showAttachedFilesContribList = False
return self._showAttachedFilesContribList | belokop/indico_bare | [
1,
1,
1,
5,
1465204236
] |
def getAbstractFieldsMgr(self):
return AbstractFieldManagerAdapter(self._owner.as_event) | belokop/indico_bare | [
1,
1,
1,
5,
1465204236
] |
def getOwner(self):
return self._owner | belokop/indico_bare | [
1,
1,
1,
5,
1465204236
] |
def getTimezone(self):
return self.getConference().getTimezone() | belokop/indico_bare | [
1,
1,
1,
5,
1465204236
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.