uid stringlengths 24 24 | split stringclasses 1
value | category stringclasses 2
values | content stringlengths 5 482k | signature stringlengths 1 14k | suffix stringlengths 1 482k | prefix stringlengths 9 14k | prefix_token_count int64 3 5.01k | prefix_token_budget int64 64 256 | element_token_count int64 1 292k | signature_token_count int64 1 5.01k | prefix_context_token_count int64 0 255 | repo stringlengths 7 112 | path stringlengths 4 208 | language stringclasses 1
value | name stringlengths 1 218 | qualname stringlengths 1 218 | start_line int64 1 26.7k | end_line int64 1 26.7k | signature_start_line int64 1 26.7k | signature_end_line int64 1 26.7k | source_hash stringlengths 40 40 | source_dataset stringclasses 1
value | source_split stringclasses 1
value |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
873b9bb3aa416681561e1c06 | train | class | class AutoElectiveException(Exception):
""" Abstract Exception for AutoElective """
| class AutoElectiveException(Exception):
| """ Abstract Exception for AutoElective """
| "OperationTimeoutError",
"ElectionPermissionError",
"ElectionFailedError",
"CreditsLimitedError",
"MutexCourseError",
"MultiEnglishCourseError",
"ExamTimeConflictError",
"QuotaLimitedError",
... | 64 | 64 | 16 | 7 | 57 | xiaotianxt/PKUElective2021Spring | autoelective/exceptions.py | Python | AutoElectiveException | AutoElectiveException | 55 | 56 | 55 | 55 | 4116e9bb9167ef206acf27f9fc3e608d555b3200 | bigcode/the-stack | train |
c2863639e67af977b3d24d10 | train | class | class UserInputException(AutoElectiveException, ValueError):
""" 由于用户的输入数据不当而引发的错误 """
| class UserInputException(AutoElectiveException, ValueError):
| """ 由于用户的输入数据不当而引发的错误 """
| ",
"MutexCourseError",
"MultiEnglishCourseError",
"ExamTimeConflictError",
"QuotaLimitedError",
"MultiPECourseError",
]
class AutoElectiveException(Exception):
""" Abstract Exception for AutoElective """
class UserInputException(Auto... | 64 | 64 | 29 | 13 | 51 | xiaotianxt/PKUElective2021Spring | autoelective/exceptions.py | Python | UserInputException | UserInputException | 58 | 59 | 58 | 58 | 6b8cc93be005b193eb968e688cecd2e672f49f90 | bigcode/the-stack | train |
2697bba2941a994020a1daba | train | class | class SharedSessionError(SystemException):
code = 318
desc = "你与他人共享了回话,请退出浏览器重新登录。"
| class SharedSessionError(SystemException):
| code = 318
desc = "你与他人共享了回话,请退出浏览器重新登录。"
| code = 316
desc = "验证码不正确。"
class RecognizerError(SystemException):
pass
class NoAuthInfoError(SystemException):
code = 317
desc = "无验证信息。" # 仅辅双登录时会出现
class SharedSessionError(SystemException):
| 64 | 64 | 33 | 7 | 56 | xiaotianxt/PKUElective2021Spring | autoelective/exceptions.py | Python | SharedSessionError | SharedSessionError | 170 | 172 | 170 | 170 | 55f6bcf8beff643a85528167b16501a14aff1995 | bigcode/the-stack | train |
e111d6238daa96359c8e3073 | train | class | class RecognizerError(SystemException):
pass
| class RecognizerError(SystemException):
| pass
| 314
desc = "不在操作时段"
class CourseIndexError(SystemException):
code = 315
desc = "索引错误。"
class CaptchaError(SystemException):
code = 316
desc = "验证码不正确。"
class RecognizerError(SystemException):
| 64 | 64 | 10 | 7 | 56 | xiaotianxt/PKUElective2021Spring | autoelective/exceptions.py | Python | RecognizerError | RecognizerError | 163 | 164 | 163 | 163 | 11e0d7a9fcd64f4186ee6607a57eaaa722194c2c | bigcode/the-stack | train |
4ce1e8d9f4b7eacbb8f259f6 | train | class | class MutexCourseError(TipsException):
code = 328
desc = "只能选其一门。"
| class MutexCourseError(TipsException):
| code = 328
desc = "只能选其一门。"
| 336
desc = "选课操作失败,请稍后再试。"
class CreditsLimitedError(TipsException):
code = 327
desc = "您本学期所选课程的总学分已经超过规定学分上限。"
class MutexCourseError(TipsException):
| 64 | 64 | 25 | 8 | 55 | xiaotianxt/PKUElective2021Spring | autoelective/exceptions.py | Python | MutexCourseError | MutexCourseError | 211 | 213 | 211 | 211 | b487f357f44c52fd2777f3a98af6c765e291d752 | bigcode/the-stack | train |
0a1c6eaefae8e5cad21456ce | train | class | class OperationFailedError(AutoElectiveClientException):
code = 103
desc = r"some operations failed for unknown reasons"
| class OperationFailedError(AutoElectiveClientException):
| code = 103
desc = r"some operations failed for unknown reasons"
| ")
if r is not None and "msg" not in kwargs:
kwargs["msg"] = "%s. response status_code: %s" % (self.__class__.code, r.status_code)
super().__init__(*args, **kwargs)
class OperationFailedError(AutoElectiveClientException):
| 64 | 64 | 29 | 11 | 53 | xiaotianxt/PKUElective2021Spring | autoelective/exceptions.py | Python | OperationFailedError | OperationFailedError | 97 | 99 | 97 | 97 | df761255c0454c8a7194f10fe0cce914b45090ad | bigcode/the-stack | train |
8fd68906b921131a6eec9de0 | train | class | class InvalidTokenError(SystemException):
code = 312
desc = "Token无效" # sso_login 时出现,在上次登录前发生异地登录,缓存 token 失效
| class InvalidTokenError(SystemException):
| code = 312
desc = "Token无效" # sso_login 时出现,在上次登录前发生异地登录,缓存 token 失效
|
desc = "<title>系统异常</title>"
class CaughtCheatingError(SystemException):
code = 311
desc = "请不要用刷课机刷课,否则会受到学校严厉处分!" # 没有设 referer
class InvalidTokenError(SystemException):
| 64 | 64 | 43 | 7 | 56 | xiaotianxt/PKUElective2021Spring | autoelective/exceptions.py | Python | InvalidTokenError | InvalidTokenError | 143 | 145 | 143 | 143 | 3879f819927724b51f65728c953f8c5e7b862d66 | bigcode/the-stack | train |
79cb3c3c271a3cde1f428f67 | train | class | class IAAANotSuccessError(IAAAException):
code = 210
desc = "response.json()['success'] == False"
def __init__(self, *args, **kwargs):
r = kwargs.get("response")
if r is not None and "msg" not in kwargs:
kwargs["msg"] = "%s. response JSON: %s" % (self.__class__.code, r.json())
... | class IAAANotSuccessError(IAAAException):
| code = 210
desc = "response.json()['success'] == False"
def __init__(self, *args, **kwargs):
r = kwargs.get("response")
if r is not None and "msg" not in kwargs:
kwargs["msg"] = "%s. response JSON: %s" % (self.__class__.code, r.json())
super().__init__(*args, **kwargs)
| edHTMLFormat(AutoElectiveClientException):
code = 104
desc = r"unable to parse HTML content"
class IAAAException(AutoElectiveClientException):
code = 200
desc = "IAAAException"
class IAAANotSuccessError(IAAAException):
| 64 | 64 | 101 | 12 | 52 | xiaotianxt/PKUElective2021Spring | autoelective/exceptions.py | Python | IAAANotSuccessError | IAAANotSuccessError | 111 | 119 | 111 | 111 | 7e790449fe78d35c8a19e80a7cfe4ac768dfa6ca | bigcode/the-stack | train |
c28f00048db1936fa38c1947 | train | class | class ElectionSuccess(TipsException):
code = 331
desc = "补选课程成功,请查看已选上列表确认,并查看选课结果。"
| class ElectionSuccess(TipsException):
| code = 331
desc = "补选课程成功,请查看已选上列表确认,并查看选课结果。"
| 。"
class NotAgreedToSelectionAgreement(SystemException):
code = 319
desc = "只有同意选课协议才可以继续选课! "
class TipsException(ElectiveException):
code = 330
desc = "TipsException"
class ElectionSuccess(TipsException):
| 64 | 64 | 35 | 7 | 57 | xiaotianxt/PKUElective2021Spring | autoelective/exceptions.py | Python | ElectionSuccess | ElectionSuccess | 183 | 185 | 183 | 183 | 47a9bfed27ac20f550dbbccd0d393366648afe5f | bigcode/the-stack | train |
00ffd75c1cb16473aeed7c82 | train | class | class IAAAIncorrectPasswordError(IAAANotSuccessError):
code = 211
desc = "User ID or Password is incorrect"
| class IAAAIncorrectPasswordError(IAAANotSuccessError):
| code = 211
desc = "User ID or Password is incorrect"
| ")
if r is not None and "msg" not in kwargs:
kwargs["msg"] = "%s. response JSON: %s" % (self.__class__.code, r.json())
super().__init__(*args, **kwargs)
class IAAAIncorrectPasswordError(IAAANotSuccessError):
| 64 | 64 | 30 | 13 | 51 | xiaotianxt/PKUElective2021Spring | autoelective/exceptions.py | Python | IAAAIncorrectPasswordError | IAAAIncorrectPasswordError | 121 | 123 | 121 | 121 | 4ed60b9633eb7da0c6fa10203e111aeaa1e0164a | bigcode/the-stack | train |
72491b22f0897caa09940182 | train | class | class SessionExpiredError(SystemException):
code = 313
desc = "您尚未登录或者会话超时,请重新登录." # 相当于 token 失效
| class SessionExpiredError(SystemException):
| code = 313
desc = "您尚未登录或者会话超时,请重新登录." # 相当于 token 失效
| 学校严厉处分!" # 没有设 referer
class InvalidTokenError(SystemException):
code = 312
desc = "Token无效" # sso_login 时出现,在上次登录前发生异地登录,缓存 token 失效
class SessionExpiredError(SystemException):
| 64 | 64 | 40 | 7 | 56 | xiaotianxt/PKUElective2021Spring | autoelective/exceptions.py | Python | SessionExpiredError | SessionExpiredError | 147 | 149 | 147 | 147 | 6c23aaa90149ab3c5bc851a119e2e717c978476c | bigcode/the-stack | train |
301cde318d34570026539b16 | train | class | class CreditsLimitedError(TipsException):
code = 327
desc = "您本学期所选课程的总学分已经超过规定学分上限。"
| class CreditsLimitedError(TipsException):
| code = 327
desc = "您本学期所选课程的总学分已经超过规定学分上限。"
| ):
code = 335
desc = "该课程在补退选阶段开始后的约一周开放选课"
class ElectionFailedError(TipsException):
code = 336
desc = "选课操作失败,请稍后再试。"
class CreditsLimitedError(TipsException):
| 64 | 64 | 38 | 8 | 55 | xiaotianxt/PKUElective2021Spring | autoelective/exceptions.py | Python | CreditsLimitedError | CreditsLimitedError | 207 | 209 | 207 | 207 | 241c25cb6fcf4158d537a9749ea2eb085416919f | bigcode/the-stack | train |
77dabc451581c30c9472f7aa | train | class | class CaughtCheatingError(SystemException):
code = 311
desc = "请不要用刷课机刷课,否则会受到学校严厉处分!" # 没有设 referer
| class CaughtCheatingError(SystemException):
| code = 311
desc = "请不要用刷课机刷课,否则会受到学校严厉处分!" # 没有设 referer
| a half hour"
class ElectiveException(AutoElectiveClientException):
code = 300
desc = "ElectiveException"
class SystemException(ElectiveException):
code = 310
desc = "<title>系统异常</title>"
class CaughtCheatingError(SystemException):
| 63 | 64 | 44 | 9 | 54 | xiaotianxt/PKUElective2021Spring | autoelective/exceptions.py | Python | CaughtCheatingError | CaughtCheatingError | 139 | 141 | 139 | 139 | d00218851bd17ce814895576031fc2bbea9d5634 | bigcode/the-stack | train |
f85db3cd8d874f1e83c1a178 | train | class | class CaptchaError(SystemException):
code = 316
desc = "验证码不正确。"
| class CaptchaError(SystemException):
| code = 316
desc = "验证码不正确。"
| ." # 相当于 token 失效
class NotInOperationTimeError(SystemException):
code = 314
desc = "不在操作时段"
class CourseIndexError(SystemException):
code = 315
desc = "索引错误。"
class CaptchaError(SystemException):
| 64 | 64 | 22 | 7 | 56 | xiaotianxt/PKUElective2021Spring | autoelective/exceptions.py | Python | CaptchaError | CaptchaError | 159 | 161 | 159 | 159 | 0e65b17033aab248d3cb6c8b984f04439ee09a88 | bigcode/the-stack | train |
0c3c16eda9d480e7e6b5bcda | train | class | class SystemException(ElectiveException):
code = 310
desc = "<title>系统异常</title>"
| class SystemException(ElectiveException):
| code = 310
desc = "<title>系统异常</title>"
| (IAAANotSuccessError):
code = 212
desc = "You are FORBIDDEN. Please sign in after a half hour"
class ElectiveException(AutoElectiveClientException):
code = 300
desc = "ElectiveException"
class SystemException(ElectiveException):
| 64 | 64 | 25 | 8 | 56 | xiaotianxt/PKUElective2021Spring | autoelective/exceptions.py | Python | SystemException | SystemException | 135 | 137 | 135 | 135 | a8668018f0931026495216a998bc7e7f17b7eac7 | bigcode/the-stack | train |
9cf89ec0760e0e3cae6fd673 | train | class | class QuotaLimitedError(TipsException):
code = 331
desc = "该课程选课人数已满。"
| class QuotaLimitedError(TipsException):
| code = 331
desc = "该课程选课人数已满。"
| Exception):
code = 329
desc = "学校规定每学期只能修一门英语课,因此您不能选择该课。"
class ExamTimeConflictError(TipsException):
code = 330
desc = "考试时间冲突"
class QuotaLimitedError(TipsException):
| 64 | 64 | 28 | 9 | 55 | xiaotianxt/PKUElective2021Spring | autoelective/exceptions.py | Python | QuotaLimitedError | QuotaLimitedError | 223 | 225 | 223 | 223 | f817617569a3cdfdeb50846b339239d1104212d9 | bigcode/the-stack | train |
715f6f13f5131e8cd6b5eb42 | train | class | class TipsException(ElectiveException):
code = 330
desc = "TipsException"
| class TipsException(ElectiveException):
| code = 330
desc = "TipsException"
| 318
desc = "你与他人共享了回话,请退出浏览器重新登录。"
class NotAgreedToSelectionAgreement(SystemException):
code = 319
desc = "只有同意选课协议才可以继续选课! "
class TipsException(ElectiveException):
| 63 | 64 | 21 | 8 | 55 | xiaotianxt/PKUElective2021Spring | autoelective/exceptions.py | Python | TipsException | TipsException | 179 | 181 | 179 | 179 | aa7d090d864f544ca0bee2527b9dade922c4ed02 | bigcode/the-stack | train |
470d9c91b3883c103c01f99d | train | class | class IAAAForbiddenError(IAAANotSuccessError):
code = 212
desc = "You are FORBIDDEN. Please sign in after a half hour"
| class IAAAForbiddenError(IAAANotSuccessError):
| code = 212
desc = "You are FORBIDDEN. Please sign in after a half hour"
| " % (self.__class__.code, r.json())
super().__init__(*args, **kwargs)
class IAAAIncorrectPasswordError(IAAANotSuccessError):
code = 211
desc = "User ID or Password is incorrect"
class IAAAForbiddenError(IAAANotSuccessError):
| 64 | 64 | 36 | 12 | 52 | xiaotianxt/PKUElective2021Spring | autoelective/exceptions.py | Python | IAAAForbiddenError | IAAAForbiddenError | 125 | 127 | 125 | 125 | af4b4f1be175bbe429a82a309d0f234afe77311a | bigcode/the-stack | train |
c513e5e9ff0dd445e74a34a8 | train | class | class ServerError(AutoElectiveClientException):
code = 102
desc = r"response.status_code in (500, 501, 502, 503)"
def __init__(self, *args, **kwargs):
r = kwargs.get("response")
if r is not None and "msg" not in kwargs:
kwargs["msg"] = "%s. response status_code: %s" % (self.__cl... | class ServerError(AutoElectiveClientException):
| code = 102
desc = r"response.status_code in (500, 501, 502, 503)"
def __init__(self, *args, **kwargs):
r = kwargs.get("response")
if r is not None and "msg" not in kwargs:
kwargs["msg"] = "%s. response status_code: %s" % (self.__class__.code, r.status_code)
super().__ini... | response")
if r is not None and "msg" not in kwargs:
kwargs["msg"] = "%s. response status code: %s" % (self.__class__.code, r.status_code)
super().__init__(*args, **kwargs)
class ServerError(AutoElectiveClientException):
| 64 | 64 | 110 | 10 | 54 | xiaotianxt/PKUElective2021Spring | autoelective/exceptions.py | Python | ServerError | ServerError | 87 | 95 | 87 | 87 | cae0754291663371fe9adbed016fe5de2ab2f245 | bigcode/the-stack | train |
b40bb5e50dce3bca3f5b205f | train | class | class NotInOperationTimeError(SystemException):
code = 314
desc = "不在操作时段"
| class NotInOperationTimeError(SystemException):
| code = 314
desc = "不在操作时段"
| 上次登录前发生异地登录,缓存 token 失效
class SessionExpiredError(SystemException):
code = 313
desc = "您尚未登录或者会话超时,请重新登录." # 相当于 token 失效
class NotInOperationTimeError(SystemException):
| 64 | 64 | 25 | 9 | 54 | xiaotianxt/PKUElective2021Spring | autoelective/exceptions.py | Python | NotInOperationTimeError | NotInOperationTimeError | 151 | 153 | 151 | 151 | 2386fe35b352e51efe1060321ce79e0f7f99fb2c | bigcode/the-stack | train |
dadd41b9322027322caa54b5 | train | class | class OperationTimeoutError(TipsException):
code = 334
desc = "对不起,超时操作,请重新登录。"
| class OperationTimeoutError(TipsException):
| code = 334
desc = "对不起,超时操作,请重新登录。"
| 选课结果。"
class ElectionRepeatedError(TipsException):
code = 332
desc = "您已经选过该课程了。"
class TimeConflictError(TipsException):
code = 333
desc = "上课时间冲突"
class OperationTimeoutError(TipsException):
| 64 | 64 | 29 | 8 | 56 | xiaotianxt/PKUElective2021Spring | autoelective/exceptions.py | Python | OperationTimeoutError | OperationTimeoutError | 195 | 197 | 195 | 195 | e82b3ef96cfb2a6833ecf11a882228a886b5ee15 | bigcode/the-stack | train |
b3ccd9a1121e4e60ac9d1c55 | train | class | class ElectionPermissionError(TipsException):
code = 335
desc = "该课程在补退选阶段开始后的约一周开放选课"
| class ElectionPermissionError(TipsException):
| code = 335
desc = "该课程在补退选阶段开始后的约一周开放选课"
| 了。"
class TimeConflictError(TipsException):
code = 333
desc = "上课时间冲突"
class OperationTimeoutError(TipsException):
code = 334
desc = "对不起,超时操作,请重新登录。"
class ElectionPermissionError(TipsException):
| 64 | 64 | 34 | 8 | 55 | xiaotianxt/PKUElective2021Spring | autoelective/exceptions.py | Python | ElectionPermissionError | ElectionPermissionError | 199 | 201 | 199 | 199 | 6e58aa4f60cb5d8834167624528e809205ea9625 | bigcode/the-stack | train |
977c3c3b984b256094c3a46f | train | class | class TimeConflictError(TipsException):
code = 333
desc = "上课时间冲突"
| class TimeConflictError(TipsException):
| code = 333
desc = "上课时间冲突"
| ):
code = 331
desc = "补选课程成功,请查看已选上列表确认,并查看选课结果。"
class ElectionRepeatedError(TipsException):
code = 332
desc = "您已经选过该课程了。"
class TimeConflictError(TipsException):
| 64 | 64 | 24 | 8 | 55 | xiaotianxt/PKUElective2021Spring | autoelective/exceptions.py | Python | TimeConflictError | TimeConflictError | 191 | 193 | 191 | 191 | 651ba8ad3ed50e0ef6842d0abbfe0f9cbae06122 | bigcode/the-stack | train |
3287486dff03c160ec516585 | train | class | class UnexceptedHTMLFormat(AutoElectiveClientException):
code = 104
desc = r"unable to parse HTML content"
| class UnexceptedHTMLFormat(AutoElectiveClientException):
| code = 104
desc = r"unable to parse HTML content"
| % (self.__class__.code, r.status_code)
super().__init__(*args, **kwargs)
class OperationFailedError(AutoElectiveClientException):
code = 103
desc = r"some operations failed for unknown reasons"
class UnexceptedHTMLFormat(AutoElectiveClientException):
| 64 | 64 | 30 | 13 | 51 | xiaotianxt/PKUElective2021Spring | autoelective/exceptions.py | Python | UnexceptedHTMLFormat | UnexceptedHTMLFormat | 101 | 103 | 101 | 101 | c5f91cbd3f21d8620bbf4587914c395fdc5cf145 | bigcode/the-stack | train |
f32dbddbacc9f547b28ac26c | train | class | class ElectionRepeatedError(TipsException):
code = 332
desc = "您已经选过该课程了。"
| class ElectionRepeatedError(TipsException):
| code = 332
desc = "您已经选过该课程了。"
| class TipsException(ElectiveException):
code = 330
desc = "TipsException"
class ElectionSuccess(TipsException):
code = 331
desc = "补选课程成功,请查看已选上列表确认,并查看选课结果。"
class ElectionRepeatedError(TipsException):
| 64 | 64 | 27 | 8 | 55 | xiaotianxt/PKUElective2021Spring | autoelective/exceptions.py | Python | ElectionRepeatedError | ElectionRepeatedError | 187 | 189 | 187 | 187 | a620cef408ee101aaee1b846625c361377339403 | bigcode/the-stack | train |
651ef089185618c1b9984329 | train | class | class ElectionFailedError(TipsException):
code = 336
desc = "选课操作失败,请稍后再试。"
| class ElectionFailedError(TipsException):
| code = 336
desc = "选课操作失败,请稍后再试。"
| ):
code = 334
desc = "对不起,超时操作,请重新登录。"
class ElectionPermissionError(TipsException):
code = 335
desc = "该课程在补退选阶段开始后的约一周开放选课"
class ElectionFailedError(TipsException):
| 64 | 64 | 29 | 8 | 56 | xiaotianxt/PKUElective2021Spring | autoelective/exceptions.py | Python | ElectionFailedError | ElectionFailedError | 203 | 205 | 203 | 203 | 0d0163db21fab82f2cedf479d537494b8b37856d | bigcode/the-stack | train |
c2b052428400436b05ebeddb | train | function | def register_default_actions():
import lux
from lux.action.custom import custom
from lux.action.correlation import correlation
from lux.action.univariate import univariate
from lux.action.enhance import enhance
from lux.action.filter import add_filter
from lux.action.generalize import genera... | def register_default_actions():
| import lux
from lux.action.custom import custom
from lux.action.correlation import correlation
from lux.action.univariate import univariate
from lux.action.enhance import enhance
from lux.action.filter import add_filter
from lux.action.generalize import generalize
# display conditions f... | def register_default_actions():
| 5 | 90 | 303 | 5 | 0 | Priyansdesai/lux | lux/action/default.py | Python | register_default_actions | register_default_actions | 1 | 27 | 1 | 1 | fd66212e4b9c56d50a56d37b47e73672bdd44290 | bigcode/the-stack | train |
c4fd3b0db08eec86e04a3d68 | train | function | async def asyncio_detailed(
document_id: int,
*,
client: Client,
) -> Response[Union[Any, CreditNoteGetPdfResponse200]]:
"""Retrieve pdf document of a document
Args:
document_id (int):
Returns:
Response[Union[Any, CreditNoteGetPdfResponse200]]
"""
kwargs = _get_kwargs(... | async def asyncio_detailed(
document_id: int,
*,
client: Client,
) -> Response[Union[Any, CreditNoteGetPdfResponse200]]:
| """Retrieve pdf document of a document
Args:
document_id (int):
Returns:
Response[Union[Any, CreditNoteGetPdfResponse200]]
"""
kwargs = _get_kwargs(
document_id=document_id,
client=client,
)
async with httpx.AsyncClient(verify=client.verify_ssl) as _client... | , CreditNoteGetPdfResponse200]]
"""
return sync_detailed(
document_id=document_id,
client=client,
).parsed
async def asyncio_detailed(
document_id: int,
*,
client: Client,
) -> Response[Union[Any, CreditNoteGetPdfResponse200]]:
| 64 | 64 | 125 | 33 | 30 | HpLightcorner/SevDesk-Python-Client | sevdesk/client/api/credit_note/credit_note_get_pdf.py | Python | asyncio_detailed | asyncio_detailed | 108 | 130 | 108 | 112 | 2b4c4fecf45c8cf4f2a35e57426582a66520703e | bigcode/the-stack | train |
5f1c705ca460a352db515a8c | train | function | def sync_detailed(
document_id: int,
*,
client: Client,
) -> Response[Union[Any, CreditNoteGetPdfResponse200]]:
"""Retrieve pdf document of a document
Args:
document_id (int):
Returns:
Response[Union[Any, CreditNoteGetPdfResponse200]]
"""
kwargs = _get_kwargs(
... | def sync_detailed(
document_id: int,
*,
client: Client,
) -> Response[Union[Any, CreditNoteGetPdfResponse200]]:
| """Retrieve pdf document of a document
Args:
document_id (int):
Returns:
Response[Union[Any, CreditNoteGetPdfResponse200]]
"""
kwargs = _get_kwargs(
document_id=document_id,
client=client,
)
response = httpx.request(
verify=client.verify_ssl,
... | ]]:
return Response(
status_code=response.status_code,
content=response.content,
headers=response.headers,
parsed=_parse_response(response=response),
)
def sync_detailed(
document_id: int,
*,
client: Client,
) -> Response[Union[Any, CreditNoteGetPdfResponse200]]:
| 64 | 64 | 116 | 32 | 32 | HpLightcorner/SevDesk-Python-Client | sevdesk/client/api/credit_note/credit_note_get_pdf.py | Python | sync_detailed | sync_detailed | 61 | 85 | 61 | 65 | 4b3cfbf78b18e371f1614bf7dbb5abd318770301 | bigcode/the-stack | train |
e902c80c7c68de6c7377e8de | train | function | async def asyncio(
document_id: int,
*,
client: Client,
) -> Optional[Union[Any, CreditNoteGetPdfResponse200]]:
"""Retrieve pdf document of a document
Args:
document_id (int):
Returns:
Response[Union[Any, CreditNoteGetPdfResponse200]]
"""
return (
await asyncio... | async def asyncio(
document_id: int,
*,
client: Client,
) -> Optional[Union[Any, CreditNoteGetPdfResponse200]]:
| """Retrieve pdf document of a document
Args:
document_id (int):
Returns:
Response[Union[Any, CreditNoteGetPdfResponse200]]
"""
return (
await asyncio_detailed(
document_id=document_id,
client=client,
)
).parsed
| httpx.AsyncClient(verify=client.verify_ssl) as _client:
response = await _client.request(**kwargs)
return _build_response(response=response)
async def asyncio(
document_id: int,
*,
client: Client,
) -> Optional[Union[Any, CreditNoteGetPdfResponse200]]:
| 64 | 64 | 93 | 31 | 33 | HpLightcorner/SevDesk-Python-Client | sevdesk/client/api/credit_note/credit_note_get_pdf.py | Python | asyncio | asyncio | 133 | 152 | 133 | 137 | 205f0daced02c842b2e9eea823d19682f4ecc5bc | bigcode/the-stack | train |
2fc557c2426aa9e6bc7c28cb | train | function | def _parse_response(
*, response: httpx.Response
) -> Optional[Union[Any, CreditNoteGetPdfResponse200]]:
if response.status_code == 200:
response_200 = CreditNoteGetPdfResponse200.from_dict(response.json())
return response_200
if response.status_code == 400:
response_400 = cast(Any,... | def _parse_response(
*, response: httpx.Response
) -> Optional[Union[Any, CreditNoteGetPdfResponse200]]:
| if response.status_code == 200:
response_200 = CreditNoteGetPdfResponse200.from_dict(response.json())
return response_200
if response.status_code == 400:
response_400 = cast(Any, None)
return response_400
if response.status_code == 401:
response_401 = cast(Any, None)... | return {
"method": "get",
"url": url,
"headers": headers,
"cookies": cookies,
"timeout": client.get_timeout(),
}
def _parse_response(
*, response: httpx.Response
) -> Optional[Union[Any, CreditNoteGetPdfResponse200]]:
| 64 | 64 | 140 | 27 | 37 | HpLightcorner/SevDesk-Python-Client | sevdesk/client/api/credit_note/credit_note_get_pdf.py | Python | _parse_response | _parse_response | 31 | 47 | 31 | 33 | 6214a7d6a1366835c5cd73a3f3d97da46dbfb941 | bigcode/the-stack | train |
93a6ec2ca0dfb5918bb5e006 | train | function | def _get_kwargs(
document_id: int,
*,
client: Client,
) -> Dict[str, Any]:
url = "{}/CreditNote/{DocumentId}/getPdf".format(
client.base_url, DocumentId=document_id
)
headers: Dict[str, str] = client.get_headers()
cookies: Dict[str, Any] = client.get_cookies()
return {
... | def _get_kwargs(
document_id: int,
*,
client: Client,
) -> Dict[str, Any]:
| url = "{}/CreditNote/{DocumentId}/getPdf".format(
client.base_url, DocumentId=document_id
)
headers: Dict[str, str] = client.get_headers()
cookies: Dict[str, Any] = client.get_cookies()
return {
"method": "get",
"url": url,
"headers": headers,
"cookies": coo... | , Union, cast
import httpx
from ...client import Client
from ...models.credit_note_get_pdf_response_200 import CreditNoteGetPdfResponse200
from ...types import Response
def _get_kwargs(
document_id: int,
*,
client: Client,
) -> Dict[str, Any]:
| 64 | 64 | 118 | 25 | 38 | HpLightcorner/SevDesk-Python-Client | sevdesk/client/api/credit_note/credit_note_get_pdf.py | Python | _get_kwargs | _get_kwargs | 10 | 28 | 10 | 14 | c6e8014abf1b0b1a05db4e4d80fc358faa1d8f81 | bigcode/the-stack | train |
24ffa3943d12ba8d188450b6 | train | function | def sync(
document_id: int,
*,
client: Client,
) -> Optional[Union[Any, CreditNoteGetPdfResponse200]]:
"""Retrieve pdf document of a document
Args:
document_id (int):
Returns:
Response[Union[Any, CreditNoteGetPdfResponse200]]
"""
return sync_detailed(
document_... | def sync(
document_id: int,
*,
client: Client,
) -> Optional[Union[Any, CreditNoteGetPdfResponse200]]:
| """Retrieve pdf document of a document
Args:
document_id (int):
Returns:
Response[Union[Any, CreditNoteGetPdfResponse200]]
"""
return sync_detailed(
document_id=document_id,
client=client,
).parsed
| client=client,
)
response = httpx.request(
verify=client.verify_ssl,
**kwargs,
)
return _build_response(response=response)
def sync(
document_id: int,
*,
client: Client,
) -> Optional[Union[Any, CreditNoteGetPdfResponse200]]:
| 64 | 64 | 87 | 30 | 34 | HpLightcorner/SevDesk-Python-Client | sevdesk/client/api/credit_note/credit_note_get_pdf.py | Python | sync | sync | 88 | 105 | 88 | 92 | eae8f64096ed73fcd9764d4618526e783c1d0a72 | bigcode/the-stack | train |
46ef209054deaaa6d582659a | train | function | def _build_response(
*, response: httpx.Response
) -> Response[Union[Any, CreditNoteGetPdfResponse200]]:
return Response(
status_code=response.status_code,
content=response.content,
headers=response.headers,
parsed=_parse_response(response=response),
)
| def _build_response(
*, response: httpx.Response
) -> Response[Union[Any, CreditNoteGetPdfResponse200]]:
| return Response(
status_code=response.status_code,
content=response.content,
headers=response.headers,
parsed=_parse_response(response=response),
)
| )
return response_401
if response.status_code == 500:
response_500 = cast(Any, None)
return response_500
return None
def _build_response(
*, response: httpx.Response
) -> Response[Union[Any, CreditNoteGetPdfResponse200]]:
| 64 | 64 | 58 | 27 | 36 | HpLightcorner/SevDesk-Python-Client | sevdesk/client/api/credit_note/credit_note_get_pdf.py | Python | _build_response | _build_response | 50 | 58 | 50 | 52 | e708700cde9e8e5f90c3189182d229cf3970a167 | bigcode/the-stack | train |
a40c795efdd8a618a44df4db | train | class | class MigrateDBApplication(TemboardApplication):
PROGRAM = 'temboard-migratedb'
def main(self, argv, environ):
parser = ArgumentParser(
prog=self.PROGRAM,
description="temBoard schema migrator.",
argument_default=UNDEFINED_ARGUMENT,
)
define_arguments... | class MigrateDBApplication(TemboardApplication):
| PROGRAM = 'temboard-migratedb'
def main(self, argv, environ):
parser = ArgumentParser(
prog=self.PROGRAM,
description="temBoard schema migrator.",
argument_default=UNDEFINED_ARGUMENT,
)
define_arguments(parser)
args = parser.parse_args(argv)
... |
import alembic.config
import sqlalchemy.exc
from .__main__ import VersionAction, map_pgvars, TemboardApplication
from .model import build_alembic_config, check_schema
from .toolkit import validators as v
from .toolkit.app import (
define_core_arguments,
)
from .toolkit.configuration import OptionSpec
from .toolki... | 99 | 99 | 333 | 10 | 89 | tilkow/temboard | temboardui/migratedb.py | Python | MigrateDBApplication | MigrateDBApplication | 25 | 68 | 25 | 25 | 33fc86fe12c36b012a7fa1c2657f8a512ab0015f | bigcode/the-stack | train |
d6115ba111341f2da6307193 | train | function | def define_arguments(parser):
define_core_arguments(parser)
parser.add_argument(
'-V', '--version',
action=VersionAction,
help='show version and exit',
)
sub = parser.add_subparsers(
metavar="COMMAND",
dest="command",
help="Operation to execute on temBoard... | def define_arguments(parser):
| define_core_arguments(parser)
parser.add_argument(
'-V', '--version',
action=VersionAction,
help='show version and exit',
)
sub = parser.add_subparsers(
metavar="COMMAND",
dest="command",
help="Operation to execute on temBoard database.")
sub.add_parse... | ')
logger.info("Database marked as up to date.")
def command_upgrade(self, args):
alembic_cfg = build_alembic_config(self.config)
alembic.command.upgrade(alembic_cfg, 'head')
logger.info("Database up to date.")
def define_arguments(parser):
| 63 | 64 | 135 | 5 | 58 | tilkow/temboard | temboardui/migratedb.py | Python | define_arguments | define_arguments | 71 | 93 | 71 | 71 | 0a096b8dc1e4760bc6cf48e837d215292d6c4308 | bigcode/the-stack | train |
305b7242655b259833861159 | train | function | def list_options_specs():
s = 'repository'
yield OptionSpec(s, 'host', default='/var/run/postgresql')
yield OptionSpec(s, 'instance', default='main')
yield OptionSpec(s, 'port', default=5432, validator=v.port)
yield OptionSpec(s, 'user', default='temboard')
yield OptionSpec(s, 'password', defaul... | def list_options_specs():
| s = 'repository'
yield OptionSpec(s, 'host', default='/var/run/postgresql')
yield OptionSpec(s, 'instance', default='main')
yield OptionSpec(s, 'port', default=5432, validator=v.port)
yield OptionSpec(s, 'user', default='temboard')
yield OptionSpec(s, 'password', default='temboard')
yield Op... | check",
help='Check schema synchronisation status only.'
)
sub.add_parser(
"stamp",
help="Mark database as uptodate without migrating.",
)
sub.add_parser(
"upgrade",
help="Upgrade temBoard database to latest revision.",
)
def list_options_specs():
| 64 | 64 | 100 | 5 | 59 | tilkow/temboard | temboardui/migratedb.py | Python | list_options_specs | list_options_specs | 96 | 103 | 96 | 96 | 7b57028a6f68a07d077a22173648e8e4272bf514 | bigcode/the-stack | train |
c2db085168d9d6e6d5f376d7 | train | function | @borg.on(events.NewMessage(pattern=r"\.(.*)", outgoing=True))
async def _(event):
if event.fwd_from:
return
animation_interval = 0.3
animation_ttl = range(0, 12)
input_str = event.pattern_match.group(1)
if input_str == "police":
await event.edit(input_str)
animation_... | @borg.on(events.NewMessage(pattern=r"\.(.*)", outgoing=True))
async def _(event):
| if event.fwd_from:
return
animation_interval = 0.3
animation_ttl = range(0, 12)
input_str = event.pattern_match.group(1)
if input_str == "police":
await event.edit(input_str)
animation_chars = [
"🔴🔴🔴⬜⬜⬜🔵🔵🔵\n🔴🔴🔴⬜⬜⬜🔵🔵🔵\n🔴🔴🔴⬜⬜⬜🔵🔵🔵",
... | """Emoji
Available Commands:
.police
if u edit it then u r gay"""
from telethon import events
import asyncio
@borg.on(events.NewMessage(pattern=r"\.(.*)", outgoing=True))
async def _(event):
| 47 | 240 | 801 | 20 | 26 | sidhu8086/PornHub | stdplugins/police.py | Python | _ | _ | 17 | 56 | 17 | 20 | 2590f0676afe26af8e2852a3b6bc0362909220ee | bigcode/the-stack | train |
9c658c47e3525dc693b3fa7b | train | class | class RestClientException(TempestException,
testtools.TestCase.failureException):
pass
| class RestClientException(TempestException,
testtools.TestCase.failureException):
| pass
| arg for arg in args]
self._error_string = (self._error_string +
"\nDetails: %s" % '\n'.join(args))
def __str__(self):
return self._error_string
class RestClientException(TempestException,
testtools.TestCase.failureException):
| 64 | 64 | 20 | 17 | 46 | Missxiaoguo/stx-ceilometer | ceilometer/tests/tempest/exceptions.py | Python | RestClientException | RestClientException | 48 | 50 | 48 | 49 | 0255c6de38767f4847c4f7529f66fc71bd0cfa20 | bigcode/the-stack | train |
ff274609850a0aa8f8b448e4 | train | class | class InvalidTestResource(TempestException):
message = "%(name)s is not a valid %(type)s, or the name is ambiguous"
| class InvalidTestResource(TempestException):
| message = "%(name)s is not a valid %(type)s, or the name is ambiguous"
| message = "The server is not reachable via the configured network"
# NOTE(andreaf) This exception is added here to facilitate the migration
# of get_network_from_name and preprov_creds to tempest.lib, and it should
# be migrated along with them
class InvalidTestResource(TempestException):
| 64 | 64 | 30 | 9 | 54 | Missxiaoguo/stx-ceilometer | ceilometer/tests/tempest/exceptions.py | Python | InvalidTestResource | InvalidTestResource | 121 | 122 | 121 | 121 | bff36d16ad6238e7da86051a9721e42c0ea1cabc | bigcode/the-stack | train |
f063bbd3b685466db9a63ed6 | train | class | class StackBuildErrorException(TempestException):
message = ("Stack %(stack_identifier)s is in %(stack_status)s status "
"due to '%(stack_status_reason)s'")
| class StackBuildErrorException(TempestException):
| message = ("Stack %(stack_identifier)s is in %(stack_status)s status "
"due to '%(stack_status_reason)s'")
| class SnapshotBuildErrorException(TempestException):
message = "Snapshot %(snapshot_id)s failed to build and is in ERROR status"
class VolumeBackupException(TempestException):
message = "Volume backup %(backup_id)s failed and is in ERROR status"
class StackBuildErrorException(TempestException):
| 64 | 64 | 38 | 10 | 54 | Missxiaoguo/stx-ceilometer | ceilometer/tests/tempest/exceptions.py | Python | StackBuildErrorException | StackBuildErrorException | 101 | 103 | 101 | 101 | d02371cb0874474dccaf39c9a0199e4b3012fe7d | bigcode/the-stack | train |
3e247ec42adf9a4d7597e37f | train | class | class CommandFailed(Exception):
def __init__(self, returncode, cmd, output, stderr):
super(CommandFailed, self).__init__()
self.returncode = returncode
self.cmd = cmd
self.stdout = output
self.stderr = stderr
def __str__(self):
return ("Command '%s' returned non-... | class CommandFailed(Exception):
| def __init__(self, returncode, cmd, output, stderr):
super(CommandFailed, self).__init__()
self.returncode = returncode
self.cmd = cmd
self.stdout = output
self.stderr = stderr
def __str__(self):
return ("Command '%s' returned non-zero exit status %d.\n"
... | RFC Violation! Response with 205 HTTP Status Code "
"MUST NOT have an entity")
class InvalidHTTPResponseHeader(RestClientException):
message = "HTTP response header is invalid"
class InvalidStructure(TempestException):
message = "Invalid structure of table with details"
class CommandFailed(Ex... | 64 | 64 | 113 | 5 | 59 | Missxiaoguo/stx-ceilometer | ceilometer/tests/tempest/exceptions.py | Python | CommandFailed | CommandFailed | 155 | 169 | 155 | 155 | 255d24cf3b3eb3845cecf78fc99c263428c85488 | bigcode/the-stack | train |
1d770c77bd934f13e0b4528c | train | class | class BuildErrorException(TempestException):
message = "Server %(server_id)s failed to build and is in ERROR status"
| class BuildErrorException(TempestException):
| message = "Server %(server_id)s failed to build and is in ERROR status"
| ServiceTag(TempestException):
message = "Invalid service tag"
class InvalidIdentityVersion(TempestException):
message = "Invalid version %(identity_version)s of the identity service"
class TimeoutException(TempestException):
message = "Request timed out"
class BuildErrorException(TempestException):
| 64 | 64 | 27 | 9 | 55 | Missxiaoguo/stx-ceilometer | ceilometer/tests/tempest/exceptions.py | Python | BuildErrorException | BuildErrorException | 73 | 74 | 73 | 73 | 272c34a3b1b3c6cc4815116baf11b2211b021d7f | bigcode/the-stack | train |
97773c4a8dd8181ecb2daddc | train | class | class TimeoutException(TempestException):
message = "Request timed out"
| class TimeoutException(TempestException):
| message = "Request timed out"
| class InvalidCredentials(TempestException):
message = "Invalid Credentials"
class InvalidServiceTag(TempestException):
message = "Invalid service tag"
class InvalidIdentityVersion(TempestException):
message = "Invalid version %(identity_version)s of the identity service"
class TimeoutException(TempestEx... | 64 | 64 | 16 | 8 | 56 | Missxiaoguo/stx-ceilometer | ceilometer/tests/tempest/exceptions.py | Python | TimeoutException | TimeoutException | 69 | 70 | 69 | 69 | 3304fb49cd224d5eef30fe60cedd0c81deffae44 | bigcode/the-stack | train |
485f6555aec3afddf3bf361e | train | class | class VolumeRestoreErrorException(TempestException):
message = "Volume %(volume_id)s failed to restore and is in ERROR status"
| class VolumeRestoreErrorException(TempestException):
| message = "Volume %(volume_id)s failed to restore and is in ERROR status"
| AddImageException(TempestException):
message = "Image %(image_id)s failed to become ACTIVE in the allotted time"
class VolumeBuildErrorException(TempestException):
message = "Volume %(volume_id)s failed to build and is in ERROR status"
class VolumeRestoreErrorException(TempestException):
| 64 | 64 | 28 | 10 | 54 | Missxiaoguo/stx-ceilometer | ceilometer/tests/tempest/exceptions.py | Python | VolumeRestoreErrorException | VolumeRestoreErrorException | 89 | 90 | 89 | 89 | 436b8d74d8a03163cd29fcfc8e8456d237fb81b5 | bigcode/the-stack | train |
24cd06bd42579d0060632dd3 | train | class | class InvalidHttpSuccessCode(RestClientException):
message = "The success code is different than the expected one"
| class InvalidHttpSuccessCode(RestClientException):
| message = "The success code is different than the expected one"
| it should
# be migrated along with them
class InvalidTestResource(TempestException):
message = "%(name)s is not a valid %(type)s, or the name is ambiguous"
class RFCViolation(RestClientException):
message = "RFC Violation"
class InvalidHttpSuccessCode(RestClientException):
| 64 | 64 | 23 | 9 | 55 | Missxiaoguo/stx-ceilometer | ceilometer/tests/tempest/exceptions.py | Python | InvalidHttpSuccessCode | InvalidHttpSuccessCode | 129 | 130 | 129 | 129 | 9a98d8d4768091d153e2e0487b1e090594d5b02a | bigcode/the-stack | train |
3bc23c949eab02dbe90ef22d | train | class | class ResponseWithNonEmptyBody(RFCViolation):
message = ("RFC Violation! Response with %(status)d HTTP Status Code "
"MUST NOT have a body")
| class ResponseWithNonEmptyBody(RFCViolation):
| message = ("RFC Violation! Response with %(status)d HTTP Status Code "
"MUST NOT have a body")
| ambiguous"
class RFCViolation(RestClientException):
message = "RFC Violation"
class InvalidHttpSuccessCode(RestClientException):
message = "The success code is different than the expected one"
class BadRequest(RestClientException):
message = "Bad request"
class ResponseWithNonEmptyBody(RFCViolation):... | 64 | 64 | 36 | 10 | 54 | Missxiaoguo/stx-ceilometer | ceilometer/tests/tempest/exceptions.py | Python | ResponseWithNonEmptyBody | ResponseWithNonEmptyBody | 137 | 139 | 137 | 137 | 17032724187dd4952d2a7425ac1a07166242e6bc | bigcode/the-stack | train |
51b2f5e25f792727ff666515 | train | class | class VolumeBuildErrorException(TempestException):
message = "Volume %(volume_id)s failed to build and is in ERROR status"
| class VolumeBuildErrorException(TempestException):
| message = "Volume %(volume_id)s failed to build and is in ERROR status"
| (TempestException):
message = "Image %(image_id)s 'killed' while waiting for '%(status)s'"
class AddImageException(TempestException):
message = "Image %(image_id)s failed to become ACTIVE in the allotted time"
class VolumeBuildErrorException(TempestException):
| 64 | 64 | 28 | 10 | 54 | Missxiaoguo/stx-ceilometer | ceilometer/tests/tempest/exceptions.py | Python | VolumeBuildErrorException | VolumeBuildErrorException | 85 | 86 | 85 | 85 | efa3ad597cf541ef50f10bcb760cb52b9d2865af | bigcode/the-stack | train |
887b1144c4fffd2d663891f2 | train | class | class InvalidStructure(TempestException):
message = "Invalid structure of table with details"
| class InvalidStructure(TempestException):
| message = "Invalid structure of table with details"
| have a body")
class ResponseWithEntity(RFCViolation):
message = ("RFC Violation! Response with 205 HTTP Status Code "
"MUST NOT have an entity")
class InvalidHTTPResponseHeader(RestClientException):
message = "HTTP response header is invalid"
class InvalidStructure(TempestException):
| 64 | 64 | 19 | 8 | 56 | Missxiaoguo/stx-ceilometer | ceilometer/tests/tempest/exceptions.py | Python | InvalidStructure | InvalidStructure | 151 | 152 | 151 | 151 | 7f93e718ff4f7c21757183faf3e577030019e0d5 | bigcode/the-stack | train |
f9a3321b23d3413b6b13ce46 | train | class | class BadRequest(RestClientException):
message = "Bad request"
| class BadRequest(RestClientException):
| message = "Bad request"
| = "%(name)s is not a valid %(type)s, or the name is ambiguous"
class RFCViolation(RestClientException):
message = "RFC Violation"
class InvalidHttpSuccessCode(RestClientException):
message = "The success code is different than the expected one"
class BadRequest(RestClientException):
| 64 | 64 | 14 | 7 | 57 | Missxiaoguo/stx-ceilometer | ceilometer/tests/tempest/exceptions.py | Python | BadRequest | BadRequest | 133 | 134 | 133 | 133 | 818a3086e910a360aa83d55480ac79a8b389ad62 | bigcode/the-stack | train |
b2109de32fa7a420def4e987 | train | class | class ResponseWithEntity(RFCViolation):
message = ("RFC Violation! Response with 205 HTTP Status Code "
"MUST NOT have an entity")
| class ResponseWithEntity(RFCViolation):
| message = ("RFC Violation! Response with 205 HTTP Status Code "
"MUST NOT have an entity")
| different than the expected one"
class BadRequest(RestClientException):
message = "Bad request"
class ResponseWithNonEmptyBody(RFCViolation):
message = ("RFC Violation! Response with %(status)d HTTP Status Code "
"MUST NOT have a body")
class ResponseWithEntity(RFCViolation):
| 64 | 64 | 33 | 8 | 56 | Missxiaoguo/stx-ceilometer | ceilometer/tests/tempest/exceptions.py | Python | ResponseWithEntity | ResponseWithEntity | 142 | 144 | 142 | 142 | 256120ce2ca37a2bffb69e7444ac701c0831db85 | bigcode/the-stack | train |
60bc14f41fcc00b2aed1fdf9 | train | class | class SnapshotBuildErrorException(TempestException):
message = "Snapshot %(snapshot_id)s failed to build and is in ERROR status"
| class SnapshotBuildErrorException(TempestException):
| message = "Snapshot %(snapshot_id)s failed to build and is in ERROR status"
| BuildErrorException(TempestException):
message = "Volume %(volume_id)s failed to build and is in ERROR status"
class VolumeRestoreErrorException(TempestException):
message = "Volume %(volume_id)s failed to restore and is in ERROR status"
class SnapshotBuildErrorException(TempestException):
| 64 | 64 | 28 | 10 | 54 | Missxiaoguo/stx-ceilometer | ceilometer/tests/tempest/exceptions.py | Python | SnapshotBuildErrorException | SnapshotBuildErrorException | 93 | 94 | 93 | 93 | 4aa4b69f0a228b42f433785234eb6b37eb92f8fe | bigcode/the-stack | train |
379fd21fd79075234436a7c1 | train | class | class AddImageException(TempestException):
message = "Image %(image_id)s failed to become ACTIVE in the allotted time"
| class AddImageException(TempestException):
| message = "Image %(image_id)s failed to become ACTIVE in the allotted time"
| Exception(TempestException):
message = "Server %(server_id)s failed to build and is in ERROR status"
class ImageKilledException(TempestException):
message = "Image %(image_id)s 'killed' while waiting for '%(status)s'"
class AddImageException(TempestException):
| 63 | 64 | 27 | 9 | 54 | Missxiaoguo/stx-ceilometer | ceilometer/tests/tempest/exceptions.py | Python | AddImageException | AddImageException | 81 | 82 | 81 | 81 | 103c4b1aad9fa821dce4d7b5b9adec289eda74a1 | bigcode/the-stack | train |
808d8082dcf8075d9cc41026 | train | class | class ServerUnreachable(TempestException):
message = "The server is not reachable via the configured network"
| class ServerUnreachable(TempestException):
| message = "The server is not reachable via the configured network"
| _identifier)s is in %(stack_status)s status "
"due to '%(stack_status_reason)s'")
class EndpointNotFound(TempestException):
message = "Endpoint not found"
class IdentityError(TempestException):
message = "Got identity error"
class ServerUnreachable(TempestException):
| 64 | 64 | 23 | 9 | 55 | Missxiaoguo/stx-ceilometer | ceilometer/tests/tempest/exceptions.py | Python | ServerUnreachable | ServerUnreachable | 114 | 115 | 114 | 114 | 68af3ed0ab23d1aa204568a91bb2d5f01c3ab148 | bigcode/the-stack | train |
19faf98e15d30687dda9efdc | train | class | class InvalidIdentityVersion(TempestException):
message = "Invalid version %(identity_version)s of the identity service"
| class InvalidIdentityVersion(TempestException):
| message = "Invalid version %(identity_version)s of the identity service"
| .TestCase.failureException):
pass
class InvalidConfiguration(TempestException):
message = "Invalid Configuration"
class InvalidCredentials(TempestException):
message = "Invalid Credentials"
class InvalidServiceTag(TempestException):
message = "Invalid service tag"
class InvalidIdentityVersion(Temp... | 64 | 64 | 24 | 9 | 55 | Missxiaoguo/stx-ceilometer | ceilometer/tests/tempest/exceptions.py | Python | InvalidIdentityVersion | InvalidIdentityVersion | 65 | 66 | 65 | 65 | 2334ca96fe310da1bc7470c4b2e2ca61e55083ac | bigcode/the-stack | train |
7398eec5a8afbc0cec9823a3 | train | class | class InvalidServiceTag(TempestException):
message = "Invalid service tag"
| class InvalidServiceTag(TempestException):
| message = "Invalid service tag"
| self._error_string
class RestClientException(TempestException,
testtools.TestCase.failureException):
pass
class InvalidConfiguration(TempestException):
message = "Invalid Configuration"
class InvalidCredentials(TempestException):
message = "Invalid Credentials"
class Invalid... | 64 | 64 | 17 | 9 | 55 | Missxiaoguo/stx-ceilometer | ceilometer/tests/tempest/exceptions.py | Python | InvalidServiceTag | InvalidServiceTag | 61 | 62 | 61 | 61 | 2bf1b769a9b03a1f99406afdfbb3290657bbbd21 | bigcode/the-stack | train |
3c4eb7f3cee97ce9ff74724a | train | class | class InvalidCredentials(TempestException):
message = "Invalid Credentials"
| class InvalidCredentials(TempestException):
| message = "Invalid Credentials"
| % '\n'.join(args))
def __str__(self):
return self._error_string
class RestClientException(TempestException,
testtools.TestCase.failureException):
pass
class InvalidConfiguration(TempestException):
message = "Invalid Configuration"
class InvalidCredentials(TempestExcep... | 64 | 64 | 15 | 8 | 56 | Missxiaoguo/stx-ceilometer | ceilometer/tests/tempest/exceptions.py | Python | InvalidCredentials | InvalidCredentials | 57 | 58 | 57 | 57 | 3355ea385ece64b89fdb66a5a6f49df3ea309658 | bigcode/the-stack | train |
0b11d6f67497c72d1d81eb09 | train | class | class InvalidConfiguration(TempestException):
message = "Invalid Configuration"
| class InvalidConfiguration(TempestException):
| message = "Invalid Configuration"
| = (self._error_string +
"\nDetails: %s" % '\n'.join(args))
def __str__(self):
return self._error_string
class RestClientException(TempestException,
testtools.TestCase.failureException):
pass
class InvalidConfiguration(TempestException):
| 64 | 64 | 15 | 8 | 55 | Missxiaoguo/stx-ceilometer | ceilometer/tests/tempest/exceptions.py | Python | InvalidConfiguration | InvalidConfiguration | 53 | 54 | 53 | 53 | 342fc54ae794de4620f663d37db3f9bdc820e728 | bigcode/the-stack | train |
2a8bfa8bde42d0f020245973 | train | class | class VolumeBackupException(TempestException):
message = "Volume backup %(backup_id)s failed and is in ERROR status"
| class VolumeBackupException(TempestException):
| message = "Volume backup %(backup_id)s failed and is in ERROR status"
| VolumeRestoreErrorException(TempestException):
message = "Volume %(volume_id)s failed to restore and is in ERROR status"
class SnapshotBuildErrorException(TempestException):
message = "Snapshot %(snapshot_id)s failed to build and is in ERROR status"
class VolumeBackupException(TempestException):
| 64 | 64 | 26 | 9 | 55 | Missxiaoguo/stx-ceilometer | ceilometer/tests/tempest/exceptions.py | Python | VolumeBackupException | VolumeBackupException | 97 | 98 | 97 | 97 | 356628209fa8da18a6b38721f9b1d46d74f3d2e1 | bigcode/the-stack | train |
064d3806701f693b72d57f4a | train | class | class ImageKilledException(TempestException):
message = "Image %(image_id)s 'killed' while waiting for '%(status)s'"
| class ImageKilledException(TempestException):
| message = "Image %(image_id)s 'killed' while waiting for '%(status)s'"
| "Invalid version %(identity_version)s of the identity service"
class TimeoutException(TempestException):
message = "Request timed out"
class BuildErrorException(TempestException):
message = "Server %(server_id)s failed to build and is in ERROR status"
class ImageKilledException(TempestException):
| 64 | 64 | 30 | 9 | 55 | Missxiaoguo/stx-ceilometer | ceilometer/tests/tempest/exceptions.py | Python | ImageKilledException | ImageKilledException | 77 | 78 | 77 | 77 | b5c876f1a7d831233c264b878d79290a22851e1a | bigcode/the-stack | train |
abfb78e7c2b2f78e35f79bf1 | train | class | class EndpointNotFound(TempestException):
message = "Endpoint not found"
| class EndpointNotFound(TempestException):
| message = "Endpoint not found"
| message = "Volume backup %(backup_id)s failed and is in ERROR status"
class StackBuildErrorException(TempestException):
message = ("Stack %(stack_identifier)s is in %(stack_status)s status "
"due to '%(stack_status_reason)s'")
class EndpointNotFound(TempestException):
| 63 | 64 | 17 | 9 | 55 | Missxiaoguo/stx-ceilometer | ceilometer/tests/tempest/exceptions.py | Python | EndpointNotFound | EndpointNotFound | 106 | 107 | 106 | 106 | 1299f8f497dda5f7369d20806abf41079a5d10ed | bigcode/the-stack | train |
4fd6b34f9d1ac5c5405a4454 | train | class | class InvalidHTTPResponseHeader(RestClientException):
message = "HTTP response header is invalid"
| class InvalidHTTPResponseHeader(RestClientException):
| message = "HTTP response header is invalid"
| RFC Violation! Response with %(status)d HTTP Status Code "
"MUST NOT have a body")
class ResponseWithEntity(RFCViolation):
message = ("RFC Violation! Response with 205 HTTP Status Code "
"MUST NOT have an entity")
class InvalidHTTPResponseHeader(RestClientException):
| 64 | 64 | 19 | 9 | 55 | Missxiaoguo/stx-ceilometer | ceilometer/tests/tempest/exceptions.py | Python | InvalidHTTPResponseHeader | InvalidHTTPResponseHeader | 147 | 148 | 147 | 147 | 25e07e299722eb8ca8b4f37d771efc7391d3078d | bigcode/the-stack | train |
27e899d40b49e8f9088b3901 | train | class | class RFCViolation(RestClientException):
message = "RFC Violation"
| class RFCViolation(RestClientException):
| message = "RFC Violation"
|
# of get_network_from_name and preprov_creds to tempest.lib, and it should
# be migrated along with them
class InvalidTestResource(TempestException):
message = "%(name)s is not a valid %(type)s, or the name is ambiguous"
class RFCViolation(RestClientException):
| 64 | 64 | 15 | 7 | 57 | Missxiaoguo/stx-ceilometer | ceilometer/tests/tempest/exceptions.py | Python | RFCViolation | RFCViolation | 125 | 126 | 125 | 125 | b94b46f0ef6d7789d3d1156dad3a1aa9d7d931cf | bigcode/the-stack | train |
d1d8bfca0e6f2c2090cc8063 | train | class | class TempestException(Exception):
"""Base Tempest Exception
To correctly use this class, inherit from it and define
a 'message' property. That message will get printf'd
with the keyword arguments provided to the constructor.
"""
message = "An unknown exception occurred"
def __init__(self,... | class TempestException(Exception):
| """Base Tempest Exception
To correctly use this class, inherit from it and define
a 'message' property. That message will get printf'd
with the keyword arguments provided to the constructor.
"""
message = "An unknown exception occurred"
def __init__(self, *args, **kwargs):
super(Te... | or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
import testtools
class Tem... | 71 | 71 | 237 | 6 | 64 | Missxiaoguo/stx-ceilometer | ceilometer/tests/tempest/exceptions.py | Python | TempestException | TempestException | 19 | 45 | 19 | 19 | ae156db6dc6ff48e43749851e8a5789f03ad073d | bigcode/the-stack | train |
0974009e03c33ae42eb90fd0 | train | class | class IdentityError(TempestException):
message = "Got identity error"
| class IdentityError(TempestException):
| message = "Got identity error"
| class StackBuildErrorException(TempestException):
message = ("Stack %(stack_identifier)s is in %(stack_status)s status "
"due to '%(stack_status_reason)s'")
class EndpointNotFound(TempestException):
message = "Endpoint not found"
class IdentityError(TempestException):
| 64 | 64 | 16 | 8 | 56 | Missxiaoguo/stx-ceilometer | ceilometer/tests/tempest/exceptions.py | Python | IdentityError | IdentityError | 110 | 111 | 110 | 110 | e2c370a627d6f781cb2546f8de86e732a6b4a181 | bigcode/the-stack | train |
cc35da862e42c5689be00740 | train | function | def get_dump(url):
"""
Retrieves a json file from the given URL and loads it into memory
"""
for i in range(1, 4): # 3 retries
try:
response = urlopen(url)
json_str = response.read()
dump = json.loads(json_str)
return dump
except ValueError... | def get_dump(url):
| """
Retrieves a json file from the given URL and loads it into memory
"""
for i in range(1, 4): # 3 retries
try:
response = urlopen(url)
json_str = response.read()
dump = json.loads(json_str)
return dump
except ValueError:
time.... | packetloss'
DONE = 'done'
QUEUED = 'queued'
TOTAL = 'total'
LATEST = 'latest'
H1 = '1h'
H6 = '6h'
D1 = '1d'
W1 = '1w'
TIMESTAMP = 'timestamp'
def get_dump(url):
| 64 | 64 | 83 | 5 | 59 | eschanet/QMonit | pandaserver/configurator/aux.py | Python | get_dump | get_dump | 27 | 40 | 27 | 27 | 00971ac902b850ce854e19759384171bec59a671 | bigcode/the-stack | train |
e8a1f52c4513765b024b3347 | train | class | class NkjpNer(datasets.GeneratorBasedBuilder):
"""NKJP-NER"""
VERSION = datasets.Version("1.1.0")
def _info(self):
return datasets.DatasetInfo(
description=_DESCRIPTION,
features=datasets.Features(
{
"sentence": datasets.Value("string"),
... | class NkjpNer(datasets.GeneratorBasedBuilder):
| """NKJP-NER"""
VERSION = datasets.Version("1.1.0")
def _info(self):
return datasets.DatasetInfo(
description=_DESCRIPTION,
features=datasets.Features(
{
"sentence": datasets.Value("string"),
"target": datasets.ClassLab... | 2},
publisher={Naukowe PWN}
}
"""
_DESCRIPTION = """\
The NKJP-NER is based on a human-annotated part of National Corpus of Polish (NKJP). We extracted sentences with named entities of exactly one type. The task is to predict the type of the named entity.
"""
_HOMEPAGE = "https://klejbenchmark.com/tasks/"
_LICENSE =... | 122 | 122 | 407 | 13 | 109 | zidingz/datasets | datasets/nkjp-ner/nkjp-ner.py | Python | NkjpNer | NkjpNer | 45 | 107 | 45 | 45 | db89a247ce2ba48c7eeff705bccab6dda2fab7c7 | bigcode/the-stack | train |
e791a8887fe359c3e6647172 | train | function | @app.route('/hogy vagy')
def hello():
return 'Köszönöm jól, s Te hogy vagy?'
| @app.route('/hogy vagy')
def hello():
| return 'Köszönöm jól, s Te hogy vagy?'
| import os
from flask import Flask
app = Flask(__name__)
@app.route("/")
def main():
return "Isten hozott! Ez egy módosítás!! Version 9"
@app.route('/hogy vagy')
def hello():
| 48 | 64 | 24 | 10 | 38 | lordraven-001/simple-webapp-flask | app.py | Python | hello | hello | 9 | 11 | 9 | 10 | 2529b6a55ca552d14b23f739bee9c1c196bffef2 | bigcode/the-stack | train |
c098e7ac228f718d60e58012 | train | function | @app.route("/")
def main():
return "Isten hozott! Ez egy módosítás!! Version 9"
| @app.route("/")
def main():
| return "Isten hozott! Ez egy módosítás!! Version 9"
| import os
from flask import Flask
app = Flask(__name__)
@app.route("/")
def main():
| 20 | 64 | 24 | 6 | 14 | lordraven-001/simple-webapp-flask | app.py | Python | main | main | 5 | 7 | 5 | 6 | 86fd06f45dffce1bf4431417335b90ab116232ce | bigcode/the-stack | train |
6a64a6220c5392c7e24cd4fa | train | function | def kernel(localizer, mo_coeff=None, callback=None, verbose=None):
from pyscf.tools import mo_mapping
if mo_coeff is not None:
localizer.mo_coeff = numpy.asarray(mo_coeff, order='C')
if localizer.mo_coeff.shape[1] <= 1:
return localizer.mo_coeff
if localizer.verbose >= logger.WARN:
... | def kernel(localizer, mo_coeff=None, callback=None, verbose=None):
| from pyscf.tools import mo_mapping
if mo_coeff is not None:
localizer.mo_coeff = numpy.asarray(mo_coeff, order='C')
if localizer.mo_coeff.shape[1] <= 1:
return localizer.mo_coeff
if localizer.verbose >= logger.WARN:
localizer.check_sanity()
localizer.dump_flags()
cput0 ... | Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the... | 211 | 212 | 708 | 15 | 196 | pedersor/pyscf | pyscf/lo/boys.py | Python | kernel | kernel | 34 | 102 | 34 | 34 | db27ea3d3fd7a7ce18fbdadfc3026a05a2968b3c | bigcode/the-stack | train |
3f70df7c8e74181572d40103 | train | function | def dipole_integral(mol, mo_coeff):
# The gauge origin has no effects for maximization |<r>|^2
# Set to charge center for physical significance of <r>
charge_center = numpy.einsum('z,zx->x', mol.atom_charges(), mol.atom_coords())
with mol.with_common_origin(charge_center):
dip = numpy.asarray([r... | def dipole_integral(mol, mo_coeff):
# The gauge origin has no effects for maximization |<r>|^2
# Set to charge center for physical significance of <r>
| charge_center = numpy.einsum('z,zx->x', mol.atom_charges(), mol.atom_coords())
with mol.with_common_origin(charge_center):
dip = numpy.asarray([reduce(lib.dot, (mo_coeff.conj().T, x, mo_coeff))
for x in mol.intor_symmetric('int1e_r', comp=3)])
return dip
| _coeff = lib.dot(localizer.mo_coeff, u0[:,sorted_idx])
return localizer.mo_coeff
def dipole_integral(mol, mo_coeff):
# The gauge origin has no effects for maximization |<r>|^2
# Set to charge center for physical significance of <r>
| 64 | 64 | 122 | 42 | 21 | pedersor/pyscf | pyscf/lo/boys.py | Python | dipole_integral | dipole_integral | 105 | 112 | 105 | 107 | a921aad9293006b420f89f3bdb7f42ee6be702b2 | bigcode/the-stack | train |
53f35557a036c2f0be12d2b3 | train | function | def atomic_init_guess(mol, mo_coeff):
s = mol.intor_symmetric('int1e_ovlp')
c = orth.orth_ao(mol, s=s)
mo = reduce(numpy.dot, (c.conj().T, s, mo_coeff))
# Find the AOs which have largest overlap to MOs
idx = numpy.argsort(numpy.einsum('pi,pi->p', mo.conj(), mo))
nmo = mo.shape[1]
idx = sorted(id... | def atomic_init_guess(mol, mo_coeff):
| s = mol.intor_symmetric('int1e_ovlp')
c = orth.orth_ao(mol, s=s)
mo = reduce(numpy.dot, (c.conj().T, s, mo_coeff))
# Find the AOs which have largest overlap to MOs
idx = numpy.argsort(numpy.einsum('pi,pi->p', mo.conj(), mo))
nmo = mo.shape[1]
idx = sorted(idx[-nmo:])
# Rotate mo_coeff, make... | mol.with_common_origin(charge_center):
dip = numpy.asarray([reduce(lib.dot, (mo_coeff.conj().T, x, mo_coeff))
for x in mol.intor_symmetric('int1e_r', comp=3)])
return dip
def atomic_init_guess(mol, mo_coeff):
| 64 | 64 | 160 | 10 | 53 | pedersor/pyscf | pyscf/lo/boys.py | Python | atomic_init_guess | atomic_init_guess | 114 | 125 | 114 | 114 | 722e1f13307f574f65c2a5dbccc691eb259f4e3e | bigcode/the-stack | train |
8cc20d2479644d1b71cc6470 | train | class | class Boys(ciah.CIAHOptimizer):
r'''
The Foster-Boys localization optimizer that maximizes the orbital dipole
\sum_i | <i| r |i> |^2
Args:
mol : Mole object
Kwargs:
mo_coeff : size (N,N) np.array
The orbital space to localize for Boys localization.
When ini... | class Boys(ciah.CIAHOptimizer):
| r'''
The Foster-Boys localization optimizer that maximizes the orbital dipole
\sum_i | <i| r |i> |^2
Args:
mol : Mole object
Kwargs:
mo_coeff : size (N,N) np.array
The orbital space to localize for Boys localization.
When initializing the localization optim... | for physical significance of <r>
charge_center = numpy.einsum('z,zx->x', mol.atom_charges(), mol.atom_coords())
with mol.with_common_origin(charge_center):
dip = numpy.asarray([reduce(lib.dot, (mo_coeff.conj().T, x, mo_coeff))
for x in mol.intor_symmetric('int1e_r', comp=3)... | 256 | 256 | 2,743 | 9 | 246 | pedersor/pyscf | pyscf/lo/boys.py | Python | Boys | Boys | 127 | 323 | 127 | 127 | 7a0ca378d2df243e91e4ba76b2a75adfbca9f50b | bigcode/the-stack | train |
7fc20889ea51fbd91726200e | train | class | class AwaitableGetNetworkInterfaceTapConfigurationResult(GetNetworkInterfaceTapConfigurationResult):
# pylint: disable=using-constant-test
def __await__(self):
if False:
yield self
return GetNetworkInterfaceTapConfigurationResult(
etag=self.etag,
id=self.id,
... | class AwaitableGetNetworkInterfaceTapConfigurationResult(GetNetworkInterfaceTapConfigurationResult):
# pylint: disable=using-constant-test
| def __await__(self):
if False:
yield self
return GetNetworkInterfaceTapConfigurationResult(
etag=self.etag,
id=self.id,
name=self.name,
provisioning_state=self.provisioning_state,
type=self.type,
virtual_network_tap=... | ) -> Optional['outputs.VirtualNetworkTapResponse']:
"""
The reference to the Virtual Network Tap resource.
"""
return pulumi.get(self, "virtual_network_tap")
class AwaitableGetNetworkInterfaceTapConfigurationResult(GetNetworkInterfaceTapConfigurationResult):
# pylint: disable=using-c... | 64 | 64 | 93 | 27 | 37 | pulumi-bot/pulumi-azure-native | sdk/python/pulumi_azure_native/network/v20200401/get_network_interface_tap_configuration.py | Python | AwaitableGetNetworkInterfaceTapConfigurationResult | AwaitableGetNetworkInterfaceTapConfigurationResult | 92 | 103 | 92 | 93 | ec3f30e954a0a5f4e8aeb9e61a4414ba820430c5 | bigcode/the-stack | train |
b9528b21eb8eb27e5f834e5a | train | class | @pulumi.output_type
class GetNetworkInterfaceTapConfigurationResult:
"""
Tap configuration in a Network Interface.
"""
def __init__(__self__, etag=None, id=None, name=None, provisioning_state=None, type=None, virtual_network_tap=None):
if etag and not isinstance(etag, str):
raise Typ... | @pulumi.output_type
class GetNetworkInterfaceTapConfigurationResult:
| """
Tap configuration in a Network Interface.
"""
def __init__(__self__, etag=None, id=None, name=None, provisioning_state=None, type=None, virtual_network_tap=None):
if etag and not isinstance(etag, str):
raise TypeError("Expected argument 'etag' to be a str")
pulumi.set(__s... | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union
from ... import _utilities, _tables
from... | 129 | 181 | 606 | 14 | 115 | pulumi-bot/pulumi-azure-native | sdk/python/pulumi_azure_native/network/v20200401/get_network_interface_tap_configuration.py | Python | GetNetworkInterfaceTapConfigurationResult | GetNetworkInterfaceTapConfigurationResult | 18 | 89 | 18 | 19 | 494184f5ee4288506f3b2b343ab3518c76d1fa8a | bigcode/the-stack | train |
9b033dc05e1896c154d6aa89 | train | function | def get_network_interface_tap_configuration(network_interface_name: Optional[str] = None,
resource_group_name: Optional[str] = None,
tap_configuration_name: Optional[str] = None,
opts: Opt... | def get_network_interface_tap_configuration(network_interface_name: Optional[str] = None,
resource_group_name: Optional[str] = None,
tap_configuration_name: Optional[str] = None,
opts: Opt... | """
Tap configuration in a Network Interface.
:param str network_interface_name: The name of the network interface.
:param str resource_group_name: The name of the resource group.
:param str tap_configuration_name: The name of the tap configuration.
"""
__args__ = dict()
__args__['netw... | ,
name=self.name,
provisioning_state=self.provisioning_state,
type=self.type,
virtual_network_tap=self.virtual_network_tap)
def get_network_interface_tap_configuration(network_interface_name: Optional[str] = None,
resource_group... | 93 | 93 | 310 | 62 | 31 | pulumi-bot/pulumi-azure-native | sdk/python/pulumi_azure_native/network/v20200401/get_network_interface_tap_configuration.py | Python | get_network_interface_tap_configuration | get_network_interface_tap_configuration | 106 | 134 | 106 | 109 | bd28d3743951a8e4bb8d857050417e92c55ed9c9 | bigcode/the-stack | train |
2d0d4e3faf2ee744d8bc5856 | train | class | class HTTPBasicsTest (BitcoinTestFramework):
def set_test_params(self):
self.num_nodes = 3
def setup_network(self):
self.setup_nodes()
def run_test(self):
#################################################
# lowlevel check for http persistent connection #
##########... | class HTTPBasicsTest (BitcoinTestFramework):
| def set_test_params(self):
self.num_nodes = 3
def setup_network(self):
self.setup_nodes()
def run_test(self):
#################################################
# lowlevel check for http persistent connection #
#################################################
... | #!/usr/bin/env python3
# Copyright (c) 2014-2018 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test the RPC HTTP basics."""
from test_framework.test_framework import BitcoinTestFramework
from test_... | 90 | 256 | 1,007 | 9 | 80 | piilanismith7/bitcoin-1 | test/functional/interface_http.py | Python | HTTPBasicsTest | HTTPBasicsTest | 13 | 104 | 13 | 13 | e8cd1b8e390678c18f874678ff3236fe93029740 | bigcode/the-stack | train |
dd1716d97cdddf301bd1e772 | train | function | def plot_states(states: List[State], **kwargs):
"""Plot trajectory."""
x = np.array([s.info['steps'] for s in states])
ys = {}
ys.update({
f'rewards/{k}': np.array([s.info['rewards'][k] for s in states
]) for k in states[-1].info.get('rewards', {})
})
ys.update({
f... | def plot_states(states: List[State], **kwargs):
| """Plot trajectory."""
x = np.array([s.info['steps'] for s in states])
ys = {}
ys.update({
f'rewards/{k}': np.array([s.info['rewards'][k] for s in states
]) for k in states[-1].info.get('rewards', {})
})
ys.update({
f'scores/{k}': np.array([s.info['scores'][k] for ... | paths
def color_spec(n):
t = np.linspace(-510, 510, n)
return np.clip(np.stack([-t, 510 - np.abs(t), t], axis=1), 0, 255) / 255.
def plot_states(states: List[State], **kwargs):
| 64 | 64 | 216 | 12 | 52 | bharadwaj1098/brax | brax/experimental/braxlines/experiments/__init__.py | Python | plot_states | plot_states | 185 | 201 | 185 | 185 | 606ce15d1f74666bb257922b6162605407ca4aa5 | bigcode/the-stack | train |
71dd014c514caa8f7d854e15 | train | function | def color_spec(n):
t = np.linspace(-510, 510, n)
return np.clip(np.stack([-t, 510 - np.abs(t), t], axis=1), 0, 255) / 255.
| def color_spec(n):
| t = np.linspace(-510, 510, n)
return np.clip(np.stack([-t, 510 - np.abs(t), t], axis=1), 0, 255) / 255.
| v in v.values()]
mean = np.mean(d, axis=0)
std = np.std(d, axis=0)
new_v[stat_key] = dict(mean=mean, std=std)
statistics[k] = new_v
return statistics, filepaths
def color_spec(n):
| 64 | 64 | 50 | 5 | 58 | bharadwaj1098/brax | brax/experimental/braxlines/experiments/__init__.py | Python | color_spec | color_spec | 180 | 182 | 180 | 180 | 967987d210f66e4c5f3c5729653a0be02241801c | bigcode/the-stack | train |
1081aef0db44c09ad38a01e3 | train | function | def compute_statistics(data,
merge_tags: Tuple[str] = ('s',),
max_print: int = 5,
tag_splitter_kwargs: Dict[str, Any] = None):
"""Merge data to derive mean/std's."""
statistics = {}
filepaths = {}
n = len(data)
for i, (k, v) in enumerate(dat... | def compute_statistics(data,
merge_tags: Tuple[str] = ('s',),
max_print: int = 5,
tag_splitter_kwargs: Dict[str, Any] = None):
| """Merge data to derive mean/std's."""
statistics = {}
filepaths = {}
n = len(data)
for i, (k, v) in enumerate(data.items()):
merge_key, data_key = split_tag(k, merge_tags, **(tag_splitter_kwargs or
{}))
statistics[data_key] = statistics.get(data_k... | _tags
])
rest_str = tag_splitter.join([
ctv.get(tag_value_splitter.join(vv), tag_value_splitter.join(vv))
for vv in tag_values
if vv[0] not in match_tags
])
return match_str, rest_str
def compute_statistics(data,
merge_tags: Tuple[str] = ('s',),
ma... | 101 | 101 | 338 | 40 | 60 | bharadwaj1098/brax | brax/experimental/braxlines/experiments/__init__.py | Python | compute_statistics | compute_statistics | 148 | 177 | 148 | 151 | 9a28c5236a4bbabd4f0b07de334bc6d783b21b06 | bigcode/the-stack | train |
79f3a9260a67527b3d338a03 | train | function | def load_experiment(experiment_name: str):
load_path = f'{DEFAULT_LIB_PATH_TEMPLATE}.{experiment_name}'
experiment_lib = importlib.import_module(load_path)
return experiment_lib.AGENT_MODULE, experiment_lib.CONFIG
| def load_experiment(experiment_name: str):
| load_path = f'{DEFAULT_LIB_PATH_TEMPLATE}.{experiment_name}'
experiment_lib = importlib.import_module(load_path)
return experiment_lib.AGENT_MODULE, experiment_lib.CONFIG
|
from brax.experimental.braxlines.common import logger_utils
from brax.experimental.braxlines.experiments import defaults
from brax.io import file
import numpy as np
DEFAULT_LIB_PATH_TEMPLATE = 'brax.experimental.braxlines.experiments'
def load_experiment(experiment_name: str):
| 64 | 64 | 47 | 10 | 54 | bharadwaj1098/brax | brax/experimental/braxlines/experiments/__init__.py | Python | load_experiment | load_experiment | 36 | 39 | 36 | 36 | fe3859aec30d0c7a551dfbaa9a4f587dd293654c | bigcode/the-stack | train |
c70ab45357a1b34dc7cfcd6d | train | function | def run_experiment(experiment_name: str = None,
output_path: str = '/tmp/sweep',
start_count: int = 0,
end_count: int = int(1e6),
ignore_errors: bool = False,
agent_module: str = None,
config: Dict[str, Any... | def run_experiment(experiment_name: str = None,
output_path: str = '/tmp/sweep',
start_count: int = 0,
end_count: int = int(1e6),
ignore_errors: bool = False,
agent_module: str = None,
config: Dict[str, Any... | """Run experiments defined by `config` serially."""
if not agent_module and not config:
agent_module, config = load_experiment(experiment_name)
if isinstance(agent_module, str):
agent_module = importlib.import_module(agent_module)
prefix_keys = config_utils.list_keys_to_expand(config)
for c, p in zip... | from brax.experimental.braxlines.experiments import defaults
from brax.io import file
import numpy as np
DEFAULT_LIB_PATH_TEMPLATE = 'brax.experimental.braxlines.experiments'
def load_experiment(experiment_name: str):
load_path = f'{DEFAULT_LIB_PATH_TEMPLATE}.{experiment_name}'
experiment_lib = importlib.import_... | 159 | 159 | 530 | 71 | 87 | bharadwaj1098/brax | brax/experimental/braxlines/experiments/__init__.py | Python | run_experiment | run_experiment | 42 | 89 | 42 | 48 | 6892de32f78513b6ee686aec33d883222b001d6b | bigcode/the-stack | train |
3afbb1ccc87d4f69b4870ae7 | train | function | def load_data(csv_files: List[str], max_print: int = 5):
"""Load data from a list of csv_file paths."""
data = {}
for i, csv_file in enumerate(csv_files):
key = os.path.basename(os.path.dirname(csv_file))
verbose = i < max_print or i == len(csv_files) - 1
if verbose:
print(f'[{i+1}/{len(csv_file... | def load_data(csv_files: List[str], max_print: int = 5):
| """Load data from a list of csv_file paths."""
data = {}
for i, csv_file in enumerate(csv_files):
key = os.path.basename(os.path.dirname(csv_file))
verbose = i < max_print or i == len(csv_files) - 1
if verbose:
print(f'[{i+1}/{len(csv_files)}] key={key}')
data[key] = {
k: np.array(v)... | _dict=return_dict)
print(f'\t time_to_jit={return_dict.get("time_to_train", None)}')
print(f'\t time_to_train={return_dict.get("time_to_jit", None)}')
def load_data(csv_files: List[str], max_print: int = 5):
| 64 | 64 | 146 | 17 | 47 | bharadwaj1098/brax | brax/experimental/braxlines/experiments/__init__.py | Python | load_data | load_data | 92 | 105 | 92 | 92 | 8b6e1268cc24f63c8d77f04f5c5f77b0a62e76e1 | bigcode/the-stack | train |
e04822f2e95bafd0a1c7e6cc | train | function | def print_summmary_to_latex_table(summaries,
summary_keys,
multipliers,
prefix: str = ''):
"""Print summary to LaTeX-friendly format."""
tags = sorted(list(list(summaries.values())[0].keys()))
s = ''
for tag in... | def print_summmary_to_latex_table(summaries,
summary_keys,
multipliers,
prefix: str = ''):
| """Print summary to LaTeX-friendly format."""
tags = sorted(list(list(summaries.values())[0].keys()))
s = ''
for tag in tags:
# pylint:disable=anomalous-backslash-in-string
tag2 = tag.replace('_', '\_')
# pylint:enable=anomalous-backslash-in-string
s += f'{prefix}{tag2}'
for skey, mult in zi... | ] = summary
fig.tight_layout()
if output_path:
file.MakeDirs(output_path)
with file.File(f'{output_path}/{output_name}.png', 'wb') as f:
plt.savefig(f)
return summaries
def print_summmary_to_latex_table(summaries,
summary_keys,
mult... | 78 | 78 | 263 | 28 | 49 | bharadwaj1098/brax | brax/experimental/braxlines/experiments/__init__.py | Python | print_summmary_to_latex_table | print_summmary_to_latex_table | 371 | 398 | 371 | 374 | 17120ce7fc2d31ad25a155a86eb7416db9ca7c72 | bigcode/the-stack | train |
c4cc1eb50eaf62aadc790379 | train | function | def get_progress_fn(plotpatterns: List[str],
times: List[float],
return_dict: Dict[str, float] = None,
progress_dict: Dict[str, float] = None,
xlabel: str = '# environment steps',
xlim: List[float] = None,
... | def get_progress_fn(plotpatterns: List[str],
times: List[float],
return_dict: Dict[str, float] = None,
progress_dict: Dict[str, float] = None,
xlabel: str = '# environment steps',
xlim: List[float] = None,
... | """Get progress function for training."""
plotdata = {}
return_dict = return_dict or {}
progress_dict = progress_dict or {}
plot = functools.partial(
plot_curves,
plotdata=plotdata,
plotpatterns=plotpatterns,
xlabel=xlabel,
xlim=xlim,
max_ncols=max_ncols)
def progress(n... | def get_progress_fn(plotpatterns: List[str],
times: List[float],
return_dict: Dict[str, float] = None,
progress_dict: Dict[str, float] = None,
xlabel: str = '# environment steps',
xlim: List[float] = None,
... | 117 | 113 | 377 | 117 | 0 | bharadwaj1098/brax | brax/experimental/braxlines/experiments/__init__.py | Python | get_progress_fn | get_progress_fn | 241 | 285 | 241 | 251 | c2c8244bdefd67558e3a8a3b3d89b0fb5ef0c7fb | bigcode/the-stack | train |
e9d0923c6bd9d6112884a5ec | train | function | def plot_statistics(statistics: Dict[str, Any],
key_include_re: str = '',
key_exclude_re: str = '',
xmax: int = 1e10,
xlabel: str = '',
ylabel_re: str = '',
ylabels: Tuple[str] = (),
... | def plot_statistics(statistics: Dict[str, Any],
key_include_re: str = '',
key_exclude_re: str = '',
xmax: int = 1e10,
xlabel: str = '',
ylabel_re: str = '',
ylabels: Tuple[str] = (),
... | """Plot statistics."""
# pylint:disable=g-import-not-at-top
import matplotlib.pyplot as plt
# pylint:enable=g-import-not-at-top
include_re = f'.*{key_include_re}.*'
exclude_re = f'.*{key_exclude_re}.*' if key_exclude_re else None
ylabel_re = f'.*{ylabel_re}.*'
plot_data = {
k: v for k, v in stati... | dict(x=[], y=[]))
plotdata[key]['x'] += [num_steps]
plotdata[key]['y'] += [v]
if num_steps > 0:
tab.add(num_steps=num_steps, **metrics)
tab.dump()
return_dict.update(dict(num_steps=num_steps, **metrics))
progress_dict.update(dict(num_steps=num_steps, **metrics))
if pre_plot_... | 234 | 234 | 783 | 119 | 114 | bharadwaj1098/brax | brax/experimental/braxlines/experiments/__init__.py | Python | plot_statistics | plot_statistics | 288 | 368 | 288 | 300 | a9703bfed84695b214441617eebf0421333f3368 | bigcode/the-stack | train |
a15819bef659f90f1aa07974 | train | function | def plot_curves(plotdata: Dict[str, Any],
plotpatterns: List[str] = None,
xlabel: str = '# environment steps',
xlim: List[float] = None,
max_ncols: int = 5,
output_name: str = 'training_curves',
output_path: str = None):
"... | def plot_curves(plotdata: Dict[str, Any],
plotpatterns: List[str] = None,
xlabel: str = '# environment steps',
xlim: List[float] = None,
max_ncols: int = 5,
output_name: str = 'training_curves',
output_path: str = None):
| """Plot data."""
# pylint:disable=g-import-not-at-top
import matplotlib.pyplot as plt
# pylint:enable=g-import-not-at-top
if plotpatterns:
plotkeys = [key for key in plotdata if any(x in key for x in plotpatterns)]
else:
plotkeys = list(plotdata)
num_figs = len(plotkeys)
ncols = min(num_figs, ma... | (x=x, y=y) for k, y in ys.items()}
plot_curves(plotdata=plotdata, xlabel='time steps', **kwargs)
def plot_curves(plotdata: Dict[str, Any],
plotpatterns: List[str] = None,
xlabel: str = '# environment steps',
xlim: List[float] = None,
max_ncols: int = 5,
... | 103 | 103 | 345 | 71 | 32 | bharadwaj1098/brax | brax/experimental/braxlines/experiments/__init__.py | Python | plot_curves | plot_curves | 204 | 238 | 204 | 210 | 84641faafecf1148604c79be88d4a30a1323e924 | bigcode/the-stack | train |
d2a694ef057319f742fc74fb | train | function | def split_tag(tag_str: str,
match_tags: Tuple[str] = (),
replace_common_tag_values: bool = False,
tag_splitter: str = '__',
tag_value_splitter: str = '_'):
"""Split the tag_str into two strs based on matching tags."""
if replace_common_tag_values:
ctv = CO... | def split_tag(tag_str: str,
match_tags: Tuple[str] = (),
replace_common_tag_values: bool = False,
tag_splitter: str = '__',
tag_value_splitter: str = '_'):
| """Split the tag_str into two strs based on matching tags."""
if replace_common_tag_values:
ctv = COMMON_TAG_VALUES
else:
ctv = {} # replace none
tag_values = tag_str.split(tag_splitter)
tag_values = [vv.split(tag_value_splitter, 1) for vv in tag_values]
match_str = tag_splitter.join([
ctv.ge... | cale={i}' for i in (0.2, 0.5, 1)})
def split_tag(tag_str: str,
match_tags: Tuple[str] = (),
replace_common_tag_values: bool = False,
tag_splitter: str = '__',
tag_value_splitter: str = '_'):
| 66 | 67 | 225 | 46 | 21 | bharadwaj1098/brax | brax/experimental/braxlines/experiments/__init__.py | Python | split_tag | split_tag | 123 | 145 | 123 | 127 | 90af92a1b33c8815dbfda557bc7184c9516501f2 | bigcode/the-stack | train |
2ddac3f62dc5bce7b48df859 | train | function | def appendInOpen(element, openNodes):
flag = 0
for item in closedNodes: #checks if element to be added is already closed, no need
if (item == element): #to add it to open and BREAK out of the loop
flag = 1
break
for item in openNodes: #Checks if element is alr... | def appendInOpen(element, openNodes):
| flag = 0
for item in closedNodes: #checks if element to be added is already closed, no need
if (item == element): #to add it to open and BREAK out of the loop
flag = 1
break
for item in openNodes: #Checks if element is already in Open list, if yes then break
... | = (120,15)
#HighG = (120,85)
#G = (100, 35)
visited = []
openNodes = []
closedNodes = []
finalTable = []
finalTableDict = {}
nodesInfo = []
minDist = 100000
def appendInOpen(element, openNodes):
| 64 | 64 | 159 | 9 | 54 | Akshaybj0221/Obstacle_Avoidance_AStar | Bajaj_project3/Python Scripts/Custom Made Map/AStar_Grid3.py | Python | appendInOpen | appendInOpen | 85 | 98 | 85 | 85 | 3fc5a77cd0aff85960bc3c614a265b4c2fa04558 | bigcode/the-stack | train |
adb546a34d0cc4ee46894691 | train | function | def aStar(obstaclePoints):
openNodes.append(x1)
previousNode = x1
startDist = getDistance(x1, x1)
goalDist = getDistance(x1, G)
totalDist = startDist + goalDist
tableRow = [x1, startDist, goalDist, totalDist, previousNode]
finalTableDict.update({x1:tableRow})
x = finalTableDi... | def aStar(obstaclePoints):
| openNodes.append(x1)
previousNode = x1
startDist = getDistance(x1, x1)
goalDist = getDistance(x1, G)
totalDist = startDist + goalDist
tableRow = [x1, startDist, goalDist, totalDist, previousNode]
finalTableDict.update({x1:tableRow})
x = finalTableDict[x1][0]
iterations ... | 0])**2 + (node2[1] - node1[1])**2)
return dist
x1 = (15, 15)
G = (120,15)
#HighG = (120,85)
#G = (100, 35)
visited = []
openNodes = []
closedNodes = []
finalTable = []
finalTableDict = {}
nodesInfo = []
minDist = 100000
def appendInOpen(element, openNodes):
flag = 0
for item in closedNo... | 255 | 256 | 2,028 | 7 | 248 | Akshaybj0221/Obstacle_Avoidance_AStar | Bajaj_project3/Python Scripts/Custom Made Map/AStar_Grid3.py | Python | aStar | aStar | 101 | 277 | 101 | 101 | c06c0258bb7c9a21c9bfdf7c60871df2a55705c0 | bigcode/the-stack | train |
551b8725a7560528e4bc67bc | train | function | def left(node):
copyL = list(node[:])
copyL[0] = abs(copyL[0] - 1)
copyL = tuple(copyL)
return copyL
| def left(node):
| copyL = list(node[:])
copyL[0] = abs(copyL[0] - 1)
copyL = tuple(copyL)
return copyL
| ):
copyR = list(node[:])
copyR[0] = abs(copyR[0] + 1)
copyR = tuple(copyR)
return copyR
#------------------This function Moving the block (0 element) to the Left, if possible--------------------------
def left(node):
| 63 | 64 | 42 | 4 | 59 | Akshaybj0221/Obstacle_Avoidance_AStar | Bajaj_project3/Python Scripts/Custom Made Map/AStar_Grid3.py | Python | left | left | 19 | 23 | 19 | 19 | 741f7977af9c4d3dd71cebcfe8c71253daa0d645 | bigcode/the-stack | train |
a79a60e5423c8549fde2aecd | train | function | def downR(node):
copyDownR = list(node[:])
copyDownR[0] = abs(copyDownR[0] + 1)
copyDownR[1] = abs(copyDownR[1] - 1)
return tuple(copyDownR)
| def downR(node):
| copyDownR = list(node[:])
copyDownR[0] = abs(copyDownR[0] + 1)
copyDownR[1] = abs(copyDownR[1] - 1)
return tuple(copyDownR)
| 0] = abs(copyDownL[0] - 1)
copyDownL[1] = abs(copyDownL[1] - 1)
return tuple(copyDownL)
#------------------This function Moving the node downward and to the Right, if possible--------------------------
def downR(node):
| 63 | 64 | 60 | 5 | 58 | Akshaybj0221/Obstacle_Avoidance_AStar | Bajaj_project3/Python Scripts/Custom Made Map/AStar_Grid3.py | Python | downR | downR | 59 | 63 | 59 | 59 | 134d07a34f10462eb31a580165bcf5ae1e900754 | bigcode/the-stack | train |
c9e3b3ee7eaaf7a1db05b59c | train | function | def downL(node):
copyDownL = list(node[:])
copyDownL[0] = abs(copyDownL[0] - 1)
copyDownL[1] = abs(copyDownL[1] - 1)
return tuple(copyDownL)
| def downL(node):
| copyDownL = list(node[:])
copyDownL[0] = abs(copyDownL[0] - 1)
copyDownL[1] = abs(copyDownL[1] - 1)
return tuple(copyDownL)
| 0] = abs(copyUpL[0] - 1)
copyUpL[1] = abs(copyUpL[1] + 1)
return tuple(copyUpL)
#------------------This function Moving the node downward and to the Left, if possible--------------------------
def downL(node):
| 63 | 64 | 59 | 5 | 58 | Akshaybj0221/Obstacle_Avoidance_AStar | Bajaj_project3/Python Scripts/Custom Made Map/AStar_Grid3.py | Python | downL | downL | 52 | 56 | 52 | 52 | 9d1423a5e978ffc2d69e33a5f82734266708994a | bigcode/the-stack | train |
2241990557933c5fe0d5f527 | train | function | def upR(node):
copyUpR = list(node[:])
copyUpR[0] = abs(copyUpR[0] + 1)
copyUpR[1] = abs(copyUpR[1] + 1)
return tuple(copyUpR)
| def upR(node):
| copyUpR = list(node[:])
copyUpR[0] = abs(copyUpR[0] + 1)
copyUpR[1] = abs(copyUpR[1] + 1)
return tuple(copyUpR)
| possible--------------------------
def down(node):
copyD = list(node[:])
copyD[1] = abs(copyD[1] - 1)
return tuple(copyD)
#------------------This function Moving the node upward and to the right, if possible--------------------------
def upR(node):
| 63 | 64 | 59 | 5 | 58 | Akshaybj0221/Obstacle_Avoidance_AStar | Bajaj_project3/Python Scripts/Custom Made Map/AStar_Grid3.py | Python | upR | upR | 38 | 42 | 38 | 38 | d2cf17cf9b8b34b5157b802c37e23b7418d234c5 | bigcode/the-stack | train |
c12eb20910b40ea7733bef6d | train | function | def right(node):
copyR = list(node[:])
copyR[0] = abs(copyR[0] + 1)
copyR = tuple(copyR)
return copyR
| def right(node):
| copyR = list(node[:])
copyR[0] = abs(copyR[0] + 1)
copyR = tuple(copyR)
return copyR
| # Import a library of functions called 'pygame'
import pygame
from math import pi
import numpy as np
import math
from operator import itemgetter
import time
#------------------This function Moving the block (0 element) to the Right, if possible--------------------------
def right(node):
| 59 | 64 | 42 | 4 | 55 | Akshaybj0221/Obstacle_Avoidance_AStar | Bajaj_project3/Python Scripts/Custom Made Map/AStar_Grid3.py | Python | right | right | 12 | 16 | 12 | 12 | a4ccc3a2d07765f2f6d7821ee9d9c0515ce881c3 | bigcode/the-stack | train |
add87b7c22a585d6491dd705 | train | function | def down(node):
copyD = list(node[:])
copyD[1] = abs(copyD[1] - 1)
return tuple(copyD)
| def down(node):
| copyD = list(node[:])
copyD[1] = abs(copyD[1] - 1)
return tuple(copyD)
| node Upward, if possible--------------------------
def up(node):
copyU = list(node[:])
copyU[1] = abs(copyU[1] + 1)
return tuple(copyU)
#------------------This function Moving the node Downward, if possible--------------------------
def down(node):
| 63 | 64 | 35 | 4 | 59 | Akshaybj0221/Obstacle_Avoidance_AStar | Bajaj_project3/Python Scripts/Custom Made Map/AStar_Grid3.py | Python | down | down | 32 | 35 | 32 | 32 | f91c6fa9ab72c052091df9e232e7ecf106fcbc52 | bigcode/the-stack | train |
66bfb40bdaf950c4000adb81 | train | function | def upL(node):
copyUpL = list(node[:])
copyUpL[0] = abs(copyUpL[0] - 1)
copyUpL[1] = abs(copyUpL[1] + 1)
return tuple(copyUpL)
| def upL(node):
| copyUpL = list(node[:])
copyUpL[0] = abs(copyUpL[0] - 1)
copyUpL[1] = abs(copyUpL[1] + 1)
return tuple(copyUpL)
| ] = abs(copyUpR[0] + 1)
copyUpR[1] = abs(copyUpR[1] + 1)
return tuple(copyUpR)
#------------------This function Moving the node upward and to the Left, if possible--------------------------
def upL(node):
| 63 | 64 | 59 | 5 | 58 | Akshaybj0221/Obstacle_Avoidance_AStar | Bajaj_project3/Python Scripts/Custom Made Map/AStar_Grid3.py | Python | upL | upL | 45 | 49 | 45 | 45 | 1677188f2b4bd1a2d3f977f259b42c47561ddc7e | bigcode/the-stack | train |
1304f83f7355250d651d08ff | train | function | def up(node):
copyU = list(node[:])
copyU[1] = abs(copyU[1] + 1)
return tuple(copyU)
| def up(node):
| copyU = list(node[:])
copyU[1] = abs(copyU[1] + 1)
return tuple(copyU)
| ----------
def left(node):
copyL = list(node[:])
copyL[0] = abs(copyL[0] - 1)
copyL = tuple(copyL)
return copyL
#------------------This function Moving the node Upward, if possible--------------------------
def up(node):
| 63 | 64 | 35 | 4 | 59 | Akshaybj0221/Obstacle_Avoidance_AStar | Bajaj_project3/Python Scripts/Custom Made Map/AStar_Grid3.py | Python | up | up | 26 | 29 | 26 | 26 | 0c98c22760fc1a40569e161220a6102c6e9f6562 | bigcode/the-stack | train |
1c9a4e6ed82b3bc1e3b64e59 | train | function | def getDistance(node1, node2):
dist = math.sqrt((node2[0] - node1[0])**2 + (node2[1] - node1[1])**2)
return dist
| def getDistance(node1, node2):
| dist = math.sqrt((node2[0] - node1[0])**2 + (node2[1] - node1[1])**2)
return dist
| DownR[0] = abs(copyDownR[0] + 1)
copyDownR[1] = abs(copyDownR[1] - 1)
return tuple(copyDownR)
##----------------------------- A - STAR -----------------------------------------------------##
def getDistance(node1, node2):
| 63 | 64 | 48 | 9 | 54 | Akshaybj0221/Obstacle_Avoidance_AStar | Bajaj_project3/Python Scripts/Custom Made Map/AStar_Grid3.py | Python | getDistance | getDistance | 68 | 70 | 68 | 68 | 0a934d72887ab654b5244945be6dbca483aba311 | bigcode/the-stack | train |
d8ae0009a62e178aaba67fec | train | function | def custom_doc_links(name): return None
| def custom_doc_links(name): | return None
| ["mle_map.py",
"linear_regression.py",
"logistic_regression.py"]
doc_url = "https://sci2lab.github.io/ml_tutorial/"
git_url = "https://github.com/sci2lab/ml_tutorial/tree/master/"
def custom_doc_links(name): | 63 | 64 | 9 | 7 | 56 | mjc3bb/ml_tutorial | ml_tutorial/_nbdev.py | Python | custom_doc_links | custom_doc_links | 29 | 29 | 29 | 29 | 390ddb9d1e2c7814108e0dcac5f5934fcac9c70b | bigcode/the-stack | train |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.