repository_name
stringlengths
5
67
func_path_in_repository
stringlengths
4
234
func_name
stringlengths
0
314
whole_func_string
stringlengths
52
3.87M
language
stringclasses
6 values
func_code_string
stringlengths
52
3.87M
func_code_tokens
listlengths
15
672k
func_documentation_string
stringlengths
1
47.2k
func_documentation_tokens
listlengths
1
3.92k
split_name
stringclasses
1 value
func_code_url
stringlengths
85
339
taskcluster/taskcluster-client.py
taskcluster/queueevents.py
QueueEvents.taskDefined
def taskDefined(self, *args, **kwargs): """ Task Defined Messages When a task is created or just defined a message is posted to this exchange. This message exchange is mainly useful when tasks are scheduled by a scheduler that uses `defineTask` as this does not make the...
python
def taskDefined(self, *args, **kwargs): """ Task Defined Messages When a task is created or just defined a message is posted to this exchange. This message exchange is mainly useful when tasks are scheduled by a scheduler that uses `defineTask` as this does not make the...
[ "def", "taskDefined", "(", "self", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "ref", "=", "{", "'exchange'", ":", "'task-defined'", ",", "'name'", ":", "'taskDefined'", ",", "'routingKey'", ":", "[", "{", "'constant'", ":", "'primary'", ",", ...
Task Defined Messages When a task is created or just defined a message is posted to this exchange. This message exchange is mainly useful when tasks are scheduled by a scheduler that uses `defineTask` as this does not make the task `pending`. Thus, no `taskPending` message is p...
[ "Task", "Defined", "Messages" ]
train
https://github.com/taskcluster/taskcluster-client.py/blob/bcc95217f8bf80bed2ae5885a19fa0035da7ebc9/taskcluster/queueevents.py#L71-L155
taskcluster/taskcluster-client.py
taskcluster/queueevents.py
QueueEvents.taskPending
def taskPending(self, *args, **kwargs): """ Task Pending Messages When a task becomes `pending` a message is posted to this exchange. This is useful for workers who doesn't want to constantly poll the queue for new tasks. The queue will also be authority for task states and ...
python
def taskPending(self, *args, **kwargs): """ Task Pending Messages When a task becomes `pending` a message is posted to this exchange. This is useful for workers who doesn't want to constantly poll the queue for new tasks. The queue will also be authority for task states and ...
[ "def", "taskPending", "(", "self", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "ref", "=", "{", "'exchange'", ":", "'task-pending'", ",", "'name'", ":", "'taskPending'", ",", "'routingKey'", ":", "[", "{", "'constant'", ":", "'primary'", ",", ...
Task Pending Messages When a task becomes `pending` a message is posted to this exchange. This is useful for workers who doesn't want to constantly poll the queue for new tasks. The queue will also be authority for task states and claims. But using this exchange workers should be able ...
[ "Task", "Pending", "Messages" ]
train
https://github.com/taskcluster/taskcluster-client.py/blob/bcc95217f8bf80bed2ae5885a19fa0035da7ebc9/taskcluster/queueevents.py#L157-L240
taskcluster/taskcluster-client.py
taskcluster/queueevents.py
QueueEvents.taskRunning
def taskRunning(self, *args, **kwargs): """ Task Running Messages Whenever a task is claimed by a worker, a run is started on the worker, and a message is posted on this exchange. This exchange outputs: ``v1/task-running-message.json#``This exchange takes the following keys: ...
python
def taskRunning(self, *args, **kwargs): """ Task Running Messages Whenever a task is claimed by a worker, a run is started on the worker, and a message is posted on this exchange. This exchange outputs: ``v1/task-running-message.json#``This exchange takes the following keys: ...
[ "def", "taskRunning", "(", "self", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "ref", "=", "{", "'exchange'", ":", "'task-running'", ",", "'name'", ":", "'taskRunning'", ",", "'routingKey'", ":", "[", "{", "'constant'", ":", "'primary'", ",", ...
Task Running Messages Whenever a task is claimed by a worker, a run is started on the worker, and a message is posted on this exchange. This exchange outputs: ``v1/task-running-message.json#``This exchange takes the following keys: * routingKeyKind: Identifier for the routing-key kin...
[ "Task", "Running", "Messages" ]
train
https://github.com/taskcluster/taskcluster-client.py/blob/bcc95217f8bf80bed2ae5885a19fa0035da7ebc9/taskcluster/queueevents.py#L242-L320
taskcluster/taskcluster-client.py
taskcluster/queueevents.py
QueueEvents.artifactCreated
def artifactCreated(self, *args, **kwargs): """ Artifact Creation Messages Whenever the `createArtifact` end-point is called, the queue will create a record of the artifact and post a message on this exchange. All of this happens before the queue returns a signed URL for the cal...
python
def artifactCreated(self, *args, **kwargs): """ Artifact Creation Messages Whenever the `createArtifact` end-point is called, the queue will create a record of the artifact and post a message on this exchange. All of this happens before the queue returns a signed URL for the cal...
[ "def", "artifactCreated", "(", "self", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "ref", "=", "{", "'exchange'", ":", "'artifact-created'", ",", "'name'", ":", "'artifactCreated'", ",", "'routingKey'", ":", "[", "{", "'constant'", ":", "'primary'...
Artifact Creation Messages Whenever the `createArtifact` end-point is called, the queue will create a record of the artifact and post a message on this exchange. All of this happens before the queue returns a signed URL for the caller to upload the actual artifact with (pending on `stor...
[ "Artifact", "Creation", "Messages" ]
train
https://github.com/taskcluster/taskcluster-client.py/blob/bcc95217f8bf80bed2ae5885a19fa0035da7ebc9/taskcluster/queueevents.py#L322-L416
taskcluster/taskcluster-client.py
taskcluster/queueevents.py
QueueEvents.taskCompleted
def taskCompleted(self, *args, **kwargs): """ Task Completed Messages When a task is successfully completed by a worker a message is posted this exchange. This message is routed using the `runId`, `workerGroup` and `workerId` that completed the task. But information abou...
python
def taskCompleted(self, *args, **kwargs): """ Task Completed Messages When a task is successfully completed by a worker a message is posted this exchange. This message is routed using the `runId`, `workerGroup` and `workerId` that completed the task. But information abou...
[ "def", "taskCompleted", "(", "self", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "ref", "=", "{", "'exchange'", ":", "'task-completed'", ",", "'name'", ":", "'taskCompleted'", ",", "'routingKey'", ":", "[", "{", "'constant'", ":", "'primary'", "...
Task Completed Messages When a task is successfully completed by a worker a message is posted this exchange. This message is routed using the `runId`, `workerGroup` and `workerId` that completed the task. But information about additional runs is also available from the task stat...
[ "Task", "Completed", "Messages" ]
train
https://github.com/taskcluster/taskcluster-client.py/blob/bcc95217f8bf80bed2ae5885a19fa0035da7ebc9/taskcluster/queueevents.py#L418-L499
taskcluster/taskcluster-client.py
taskcluster/queueevents.py
QueueEvents.taskFailed
def taskFailed(self, *args, **kwargs): """ Task Failed Messages When a task ran, but failed to complete successfully a message is posted to this exchange. This is same as worker ran task-specific code, but the task specific code exited non-zero. This exchange outputs: `...
python
def taskFailed(self, *args, **kwargs): """ Task Failed Messages When a task ran, but failed to complete successfully a message is posted to this exchange. This is same as worker ran task-specific code, but the task specific code exited non-zero. This exchange outputs: `...
[ "def", "taskFailed", "(", "self", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "ref", "=", "{", "'exchange'", ":", "'task-failed'", ",", "'name'", ":", "'taskFailed'", ",", "'routingKey'", ":", "[", "{", "'constant'", ":", "'primary'", ",", "'m...
Task Failed Messages When a task ran, but failed to complete successfully a message is posted to this exchange. This is same as worker ran task-specific code, but the task specific code exited non-zero. This exchange outputs: ``v1/task-failed-message.json#``This exchange takes the foll...
[ "Task", "Failed", "Messages" ]
train
https://github.com/taskcluster/taskcluster-client.py/blob/bcc95217f8bf80bed2ae5885a19fa0035da7ebc9/taskcluster/queueevents.py#L501-L580
taskcluster/taskcluster-client.py
taskcluster/queueevents.py
QueueEvents.taskException
def taskException(self, *args, **kwargs): """ Task Exception Messages Whenever Taskcluster fails to run a message is posted to this exchange. This happens if the task isn't completed before its `deadlìne`, all retries failed (i.e. workers stopped responding), the task was ...
python
def taskException(self, *args, **kwargs): """ Task Exception Messages Whenever Taskcluster fails to run a message is posted to this exchange. This happens if the task isn't completed before its `deadlìne`, all retries failed (i.e. workers stopped responding), the task was ...
[ "def", "taskException", "(", "self", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "ref", "=", "{", "'exchange'", ":", "'task-exception'", ",", "'name'", ":", "'taskException'", ",", "'routingKey'", ":", "[", "{", "'constant'", ":", "'primary'", "...
Task Exception Messages Whenever Taskcluster fails to run a message is posted to this exchange. This happens if the task isn't completed before its `deadlìne`, all retries failed (i.e. workers stopped responding), the task was canceled by another entity, or the task carried a malformed ...
[ "Task", "Exception", "Messages" ]
train
https://github.com/taskcluster/taskcluster-client.py/blob/bcc95217f8bf80bed2ae5885a19fa0035da7ebc9/taskcluster/queueevents.py#L582-L665
taskcluster/taskcluster-client.py
taskcluster/queueevents.py
QueueEvents.taskGroupResolved
def taskGroupResolved(self, *args, **kwargs): """ Task Group Resolved Messages A message is published on task-group-resolved whenever all submitted tasks (whether scheduled or unscheduled) for a given task group have been resolved, regardless of whether they resolved as successf...
python
def taskGroupResolved(self, *args, **kwargs): """ Task Group Resolved Messages A message is published on task-group-resolved whenever all submitted tasks (whether scheduled or unscheduled) for a given task group have been resolved, regardless of whether they resolved as successf...
[ "def", "taskGroupResolved", "(", "self", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "ref", "=", "{", "'exchange'", ":", "'task-group-resolved'", ",", "'name'", ":", "'taskGroupResolved'", ",", "'routingKey'", ":", "[", "{", "'constant'", ":", "'p...
Task Group Resolved Messages A message is published on task-group-resolved whenever all submitted tasks (whether scheduled or unscheduled) for a given task group have been resolved, regardless of whether they resolved as successful or not. A task group may be resolved multiple times, si...
[ "Task", "Group", "Resolved", "Messages" ]
train
https://github.com/taskcluster/taskcluster-client.py/blob/bcc95217f8bf80bed2ae5885a19fa0035da7ebc9/taskcluster/queueevents.py#L667-L712
jart/fabulous
fabulous/rlcomplete.py
Completer.complete
def complete(self, text, state): """The actual completion method This method is not meant to be overridden. Override the completelist method instead. It will make your life much easier. For more detail see documentation for readline.set_completer """ if ...
python
def complete(self, text, state): """The actual completion method This method is not meant to be overridden. Override the completelist method instead. It will make your life much easier. For more detail see documentation for readline.set_completer """ if ...
[ "def", "complete", "(", "self", ",", "text", ",", "state", ")", ":", "if", "text", "!=", "self", ".", "text", ":", "self", ".", "matches", "=", "self", ".", "completelist", "(", "text", ")", "self", ".", "text", "=", "text", "try", ":", "return", ...
The actual completion method This method is not meant to be overridden. Override the completelist method instead. It will make your life much easier. For more detail see documentation for readline.set_completer
[ "The", "actual", "completion", "method", "This", "method", "is", "not", "meant", "to", "be", "overridden", ".", "Override", "the", "completelist", "method", "instead", ".", "It", "will", "make", "your", "life", "much", "easier", ".", "For", "more", "detail",...
train
https://github.com/jart/fabulous/blob/19903cf0a980b82f5928c3bec1f28b6bdd3785bd/fabulous/rlcomplete.py#L36-L50
jart/fabulous
fabulous/rlcomplete.py
PathCompleter.matchuserhome
def matchuserhome(prefix): """To find matches that start with prefix. For example, if prefix = '~user' this returns list of possible matches in form of ['~userspam','~usereggs'] etc. matchuserdir('~') returns all users """ if not prefix.startswith('~'): ...
python
def matchuserhome(prefix): """To find matches that start with prefix. For example, if prefix = '~user' this returns list of possible matches in form of ['~userspam','~usereggs'] etc. matchuserdir('~') returns all users """ if not prefix.startswith('~'): ...
[ "def", "matchuserhome", "(", "prefix", ")", ":", "if", "not", "prefix", ".", "startswith", "(", "'~'", ")", ":", "raise", "ValueError", "(", "\"prefix must start with ~\"", ")", "try", ":", "import", "pwd", "except", "ImportError", ":", "try", ":", "import",...
To find matches that start with prefix. For example, if prefix = '~user' this returns list of possible matches in form of ['~userspam','~usereggs'] etc. matchuserdir('~') returns all users
[ "To", "find", "matches", "that", "start", "with", "prefix", ".", "For", "example", "if", "prefix", "=", "~user", "this", "returns", "list", "of", "possible", "matches", "in", "form", "of", "[", "~userspam", "~usereggs", "]", "etc", ".", "matchuserdir", "("...
train
https://github.com/jart/fabulous/blob/19903cf0a980b82f5928c3bec1f28b6bdd3785bd/fabulous/rlcomplete.py#L86-L100
jart/fabulous
fabulous/rlcomplete.py
PathCompleter.completelist
def completelist(self, text): """Return a list of potential matches for completion n.b. you want to complete to a file in the current working directory that starts with a ~, use ./~ when typing in. Paths that start with ~ are magical and specify users' home paths """ ...
python
def completelist(self, text): """Return a list of potential matches for completion n.b. you want to complete to a file in the current working directory that starts with a ~, use ./~ when typing in. Paths that start with ~ are magical and specify users' home paths """ ...
[ "def", "completelist", "(", "self", ",", "text", ")", ":", "path", "=", "os", ".", "path", ".", "expanduser", "(", "text", ")", "if", "len", "(", "path", ")", "==", "0", "or", "path", "[", "0", "]", "!=", "os", ".", "path", ".", "sep", ":", "...
Return a list of potential matches for completion n.b. you want to complete to a file in the current working directory that starts with a ~, use ./~ when typing in. Paths that start with ~ are magical and specify users' home paths
[ "Return", "a", "list", "of", "potential", "matches", "for", "completion", "n", ".", "b", ".", "you", "want", "to", "complete", "to", "a", "file", "in", "the", "current", "working", "directory", "that", "starts", "with", "a", "~", "use", ".", "/", "~", ...
train
https://github.com/jart/fabulous/blob/19903cf0a980b82f5928c3bec1f28b6bdd3785bd/fabulous/rlcomplete.py#L103-L131
taskcluster/taskcluster-client.py
taskcluster/aio/queue.py
Queue.status
async def status(self, *args, **kwargs): """ Get task status Get task status structure from `taskId` This method gives output: ``v1/task-status-response.json#`` This method is ``stable`` """ return await self._makeApiCall(self.funcinfo["status"], *args, **kwar...
python
async def status(self, *args, **kwargs): """ Get task status Get task status structure from `taskId` This method gives output: ``v1/task-status-response.json#`` This method is ``stable`` """ return await self._makeApiCall(self.funcinfo["status"], *args, **kwar...
[ "async", "def", "status", "(", "self", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "await", "self", ".", "_makeApiCall", "(", "self", ".", "funcinfo", "[", "\"status\"", "]", ",", "*", "args", ",", "*", "*", "kwargs", ")" ]
Get task status Get task status structure from `taskId` This method gives output: ``v1/task-status-response.json#`` This method is ``stable``
[ "Get", "task", "status" ]
train
https://github.com/taskcluster/taskcluster-client.py/blob/bcc95217f8bf80bed2ae5885a19fa0035da7ebc9/taskcluster/aio/queue.py#L59-L70
taskcluster/taskcluster-client.py
taskcluster/aio/queue.py
Queue.listTaskGroup
async def listTaskGroup(self, *args, **kwargs): """ List Task Group List tasks sharing the same `taskGroupId`. As a task-group may contain an unbounded number of tasks, this end-point may return a `continuationToken`. To continue listing tasks you must call the `listTas...
python
async def listTaskGroup(self, *args, **kwargs): """ List Task Group List tasks sharing the same `taskGroupId`. As a task-group may contain an unbounded number of tasks, this end-point may return a `continuationToken`. To continue listing tasks you must call the `listTas...
[ "async", "def", "listTaskGroup", "(", "self", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "await", "self", ".", "_makeApiCall", "(", "self", ".", "funcinfo", "[", "\"listTaskGroup\"", "]", ",", "*", "args", ",", "*", "*", "kwargs", ...
List Task Group List tasks sharing the same `taskGroupId`. As a task-group may contain an unbounded number of tasks, this end-point may return a `continuationToken`. To continue listing tasks you must call the `listTaskGroup` again with the `continuationToken` as the query-stri...
[ "List", "Task", "Group" ]
train
https://github.com/taskcluster/taskcluster-client.py/blob/bcc95217f8bf80bed2ae5885a19fa0035da7ebc9/taskcluster/aio/queue.py#L72-L98
taskcluster/taskcluster-client.py
taskcluster/aio/queue.py
Queue.listDependentTasks
async def listDependentTasks(self, *args, **kwargs): """ List Dependent Tasks List tasks that depend on the given `taskId`. As many tasks from different task-groups may dependent on a single tasks, this end-point may return a `continuationToken`. To continue listing tas...
python
async def listDependentTasks(self, *args, **kwargs): """ List Dependent Tasks List tasks that depend on the given `taskId`. As many tasks from different task-groups may dependent on a single tasks, this end-point may return a `continuationToken`. To continue listing tas...
[ "async", "def", "listDependentTasks", "(", "self", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "await", "self", ".", "_makeApiCall", "(", "self", ".", "funcinfo", "[", "\"listDependentTasks\"", "]", ",", "*", "args", ",", "*", "*", "...
List Dependent Tasks List tasks that depend on the given `taskId`. As many tasks from different task-groups may dependent on a single tasks, this end-point may return a `continuationToken`. To continue listing tasks you must call `listDependentTasks` again with the `continuatio...
[ "List", "Dependent", "Tasks" ]
train
https://github.com/taskcluster/taskcluster-client.py/blob/bcc95217f8bf80bed2ae5885a19fa0035da7ebc9/taskcluster/aio/queue.py#L100-L126
taskcluster/taskcluster-client.py
taskcluster/aio/queue.py
Queue.createTask
async def createTask(self, *args, **kwargs): """ Create New Task Create a new task, this is an **idempotent** operation, so repeat it if you get an internal server error or network connection is dropped. **Task `deadline`**: the deadline property can be no more than 5 days ...
python
async def createTask(self, *args, **kwargs): """ Create New Task Create a new task, this is an **idempotent** operation, so repeat it if you get an internal server error or network connection is dropped. **Task `deadline`**: the deadline property can be no more than 5 days ...
[ "async", "def", "createTask", "(", "self", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "await", "self", ".", "_makeApiCall", "(", "self", ".", "funcinfo", "[", "\"createTask\"", "]", ",", "*", "args", ",", "*", "*", "kwargs", ")" ]
Create New Task Create a new task, this is an **idempotent** operation, so repeat it if you get an internal server error or network connection is dropped. **Task `deadline`**: the deadline property can be no more than 5 days into the future. This is to limit the amount of pending tasks...
[ "Create", "New", "Task" ]
train
https://github.com/taskcluster/taskcluster-client.py/blob/bcc95217f8bf80bed2ae5885a19fa0035da7ebc9/taskcluster/aio/queue.py#L128-L170
taskcluster/taskcluster-client.py
taskcluster/aio/queue.py
Queue.claimWork
async def claimWork(self, *args, **kwargs): """ Claim Work Claim pending task(s) for the given `provisionerId`/`workerType` queue. If any work is available (even if fewer than the requested number of tasks, this will return immediately. Otherwise, it will block for tens of ...
python
async def claimWork(self, *args, **kwargs): """ Claim Work Claim pending task(s) for the given `provisionerId`/`workerType` queue. If any work is available (even if fewer than the requested number of tasks, this will return immediately. Otherwise, it will block for tens of ...
[ "async", "def", "claimWork", "(", "self", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "await", "self", ".", "_makeApiCall", "(", "self", ".", "funcinfo", "[", "\"claimWork\"", "]", ",", "*", "args", ",", "*", "*", "kwargs", ")" ]
Claim Work Claim pending task(s) for the given `provisionerId`/`workerType` queue. If any work is available (even if fewer than the requested number of tasks, this will return immediately. Otherwise, it will block for tens of seconds waiting for work. If no work appears, it will retur...
[ "Claim", "Work" ]
train
https://github.com/taskcluster/taskcluster-client.py/blob/bcc95217f8bf80bed2ae5885a19fa0035da7ebc9/taskcluster/aio/queue.py#L265-L285
taskcluster/taskcluster-client.py
taskcluster/aio/queue.py
Queue.claimTask
async def claimTask(self, *args, **kwargs): """ Claim Task claim a task - never documented This method takes input: ``v1/task-claim-request.json#`` This method gives output: ``v1/task-claim-response.json#`` This method is ``deprecated`` """ return awa...
python
async def claimTask(self, *args, **kwargs): """ Claim Task claim a task - never documented This method takes input: ``v1/task-claim-request.json#`` This method gives output: ``v1/task-claim-response.json#`` This method is ``deprecated`` """ return awa...
[ "async", "def", "claimTask", "(", "self", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "await", "self", ".", "_makeApiCall", "(", "self", ".", "funcinfo", "[", "\"claimTask\"", "]", ",", "*", "args", ",", "*", "*", "kwargs", ")" ]
Claim Task claim a task - never documented This method takes input: ``v1/task-claim-request.json#`` This method gives output: ``v1/task-claim-response.json#`` This method is ``deprecated``
[ "Claim", "Task" ]
train
https://github.com/taskcluster/taskcluster-client.py/blob/bcc95217f8bf80bed2ae5885a19fa0035da7ebc9/taskcluster/aio/queue.py#L287-L300
taskcluster/taskcluster-client.py
taskcluster/aio/queue.py
Queue.reclaimTask
async def reclaimTask(self, *args, **kwargs): """ Reclaim task Refresh the claim for a specific `runId` for given `taskId`. This updates the `takenUntil` property and returns a new set of temporary credentials for performing requests on behalf of the task. These credentials shou...
python
async def reclaimTask(self, *args, **kwargs): """ Reclaim task Refresh the claim for a specific `runId` for given `taskId`. This updates the `takenUntil` property and returns a new set of temporary credentials for performing requests on behalf of the task. These credentials shou...
[ "async", "def", "reclaimTask", "(", "self", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "await", "self", ".", "_makeApiCall", "(", "self", ".", "funcinfo", "[", "\"reclaimTask\"", "]", ",", "*", "args", ",", "*", "*", "kwargs", ")"...
Reclaim task Refresh the claim for a specific `runId` for given `taskId`. This updates the `takenUntil` property and returns a new set of temporary credentials for performing requests on behalf of the task. These credentials should be used in-place of the credentials returned by `claimW...
[ "Reclaim", "task" ]
train
https://github.com/taskcluster/taskcluster-client.py/blob/bcc95217f8bf80bed2ae5885a19fa0035da7ebc9/taskcluster/aio/queue.py#L302-L333
taskcluster/taskcluster-client.py
taskcluster/aio/queue.py
Queue.reportCompleted
async def reportCompleted(self, *args, **kwargs): """ Report Run Completed Report a task completed, resolving the run as `completed`. This method gives output: ``v1/task-status-response.json#`` This method is ``stable`` """ return await self._makeApiCall(self....
python
async def reportCompleted(self, *args, **kwargs): """ Report Run Completed Report a task completed, resolving the run as `completed`. This method gives output: ``v1/task-status-response.json#`` This method is ``stable`` """ return await self._makeApiCall(self....
[ "async", "def", "reportCompleted", "(", "self", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "await", "self", ".", "_makeApiCall", "(", "self", ".", "funcinfo", "[", "\"reportCompleted\"", "]", ",", "*", "args", ",", "*", "*", "kwargs...
Report Run Completed Report a task completed, resolving the run as `completed`. This method gives output: ``v1/task-status-response.json#`` This method is ``stable``
[ "Report", "Run", "Completed" ]
train
https://github.com/taskcluster/taskcluster-client.py/blob/bcc95217f8bf80bed2ae5885a19fa0035da7ebc9/taskcluster/aio/queue.py#L335-L346
taskcluster/taskcluster-client.py
taskcluster/aio/queue.py
Queue.getArtifact
async def getArtifact(self, *args, **kwargs): """ Get Artifact from Run Get artifact by `<name>` from a specific run. **Public Artifacts**, in-order to get an artifact you need the scope `queue:get-artifact:<name>`, where `<name>` is the name of the artifact. But if the...
python
async def getArtifact(self, *args, **kwargs): """ Get Artifact from Run Get artifact by `<name>` from a specific run. **Public Artifacts**, in-order to get an artifact you need the scope `queue:get-artifact:<name>`, where `<name>` is the name of the artifact. But if the...
[ "async", "def", "getArtifact", "(", "self", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "await", "self", ".", "_makeApiCall", "(", "self", ".", "funcinfo", "[", "\"getArtifact\"", "]", ",", "*", "args", ",", "*", "*", "kwargs", ")"...
Get Artifact from Run Get artifact by `<name>` from a specific run. **Public Artifacts**, in-order to get an artifact you need the scope `queue:get-artifact:<name>`, where `<name>` is the name of the artifact. But if the artifact `name` starts with `public/`, authentication and ...
[ "Get", "Artifact", "from", "Run" ]
train
https://github.com/taskcluster/taskcluster-client.py/blob/bcc95217f8bf80bed2ae5885a19fa0035da7ebc9/taskcluster/aio/queue.py#L498-L584
taskcluster/taskcluster-client.py
taskcluster/aio/queue.py
Queue.listArtifacts
async def listArtifacts(self, *args, **kwargs): """ Get Artifacts from Run Returns a list of artifacts and associated meta-data for a given run. As a task may have many artifacts paging may be necessary. If this end-point returns a `continuationToken`, you should call the end-p...
python
async def listArtifacts(self, *args, **kwargs): """ Get Artifacts from Run Returns a list of artifacts and associated meta-data for a given run. As a task may have many artifacts paging may be necessary. If this end-point returns a `continuationToken`, you should call the end-p...
[ "async", "def", "listArtifacts", "(", "self", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "await", "self", ".", "_makeApiCall", "(", "self", ".", "funcinfo", "[", "\"listArtifacts\"", "]", ",", "*", "args", ",", "*", "*", "kwargs", ...
Get Artifacts from Run Returns a list of artifacts and associated meta-data for a given run. As a task may have many artifacts paging may be necessary. If this end-point returns a `continuationToken`, you should call the end-point again with the `continuationToken` as the query-string ...
[ "Get", "Artifacts", "from", "Run" ]
train
https://github.com/taskcluster/taskcluster-client.py/blob/bcc95217f8bf80bed2ae5885a19fa0035da7ebc9/taskcluster/aio/queue.py#L611-L630
taskcluster/taskcluster-client.py
taskcluster/aio/queue.py
Queue.getWorkerType
async def getWorkerType(self, *args, **kwargs): """ Get a worker-type Get a worker-type from a provisioner. This method gives output: ``v1/workertype-response.json#`` This method is ``experimental`` """ return await self._makeApiCall(self.funcinfo["getWorkerTy...
python
async def getWorkerType(self, *args, **kwargs): """ Get a worker-type Get a worker-type from a provisioner. This method gives output: ``v1/workertype-response.json#`` This method is ``experimental`` """ return await self._makeApiCall(self.funcinfo["getWorkerTy...
[ "async", "def", "getWorkerType", "(", "self", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "await", "self", ".", "_makeApiCall", "(", "self", ".", "funcinfo", "[", "\"getWorkerType\"", "]", ",", "*", "args", ",", "*", "*", "kwargs", ...
Get a worker-type Get a worker-type from a provisioner. This method gives output: ``v1/workertype-response.json#`` This method is ``experimental``
[ "Get", "a", "worker", "-", "type" ]
train
https://github.com/taskcluster/taskcluster-client.py/blob/bcc95217f8bf80bed2ae5885a19fa0035da7ebc9/taskcluster/aio/queue.py#L754-L765
taskcluster/taskcluster-client.py
taskcluster/aio/queue.py
Queue.declareWorkerType
async def declareWorkerType(self, *args, **kwargs): """ Update a worker-type Declare a workerType, supplying some details about it. `declareWorkerType` allows updating one or more properties of a worker-type as long as the required scopes are possessed. For example, a request t...
python
async def declareWorkerType(self, *args, **kwargs): """ Update a worker-type Declare a workerType, supplying some details about it. `declareWorkerType` allows updating one or more properties of a worker-type as long as the required scopes are possessed. For example, a request t...
[ "async", "def", "declareWorkerType", "(", "self", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "await", "self", ".", "_makeApiCall", "(", "self", ".", "funcinfo", "[", "\"declareWorkerType\"", "]", ",", "*", "args", ",", "*", "*", "kw...
Update a worker-type Declare a workerType, supplying some details about it. `declareWorkerType` allows updating one or more properties of a worker-type as long as the required scopes are possessed. For example, a request to update the `gecko-b-1-w2008` worker-type within the `aws-provisioner-v...
[ "Update", "a", "worker", "-", "type" ]
train
https://github.com/taskcluster/taskcluster-client.py/blob/bcc95217f8bf80bed2ae5885a19fa0035da7ebc9/taskcluster/aio/queue.py#L767-L785
taskcluster/taskcluster-client.py
taskcluster/aio/queue.py
Queue.listWorkers
async def listWorkers(self, *args, **kwargs): """ Get a list of all active workers of a workerType Get a list of all active workers of a workerType. `listWorkers` allows a response to be filtered by quarantined and non quarantined workers. To filter the query, you should call t...
python
async def listWorkers(self, *args, **kwargs): """ Get a list of all active workers of a workerType Get a list of all active workers of a workerType. `listWorkers` allows a response to be filtered by quarantined and non quarantined workers. To filter the query, you should call t...
[ "async", "def", "listWorkers", "(", "self", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "await", "self", ".", "_makeApiCall", "(", "self", ".", "funcinfo", "[", "\"listWorkers\"", "]", ",", "*", "args", ",", "*", "*", "kwargs", ")"...
Get a list of all active workers of a workerType Get a list of all active workers of a workerType. `listWorkers` allows a response to be filtered by quarantined and non quarantined workers. To filter the query, you should call the end-point with `quarantined` as a query-string option with a ...
[ "Get", "a", "list", "of", "all", "active", "workers", "of", "a", "workerType" ]
train
https://github.com/taskcluster/taskcluster-client.py/blob/bcc95217f8bf80bed2ae5885a19fa0035da7ebc9/taskcluster/aio/queue.py#L787-L807
taskcluster/taskcluster-client.py
taskcluster/aio/queue.py
Queue.getWorker
async def getWorker(self, *args, **kwargs): """ Get a worker-type Get a worker from a worker-type. This method gives output: ``v1/worker-response.json#`` This method is ``experimental`` """ return await self._makeApiCall(self.funcinfo["getWorker"], *args, **kw...
python
async def getWorker(self, *args, **kwargs): """ Get a worker-type Get a worker from a worker-type. This method gives output: ``v1/worker-response.json#`` This method is ``experimental`` """ return await self._makeApiCall(self.funcinfo["getWorker"], *args, **kw...
[ "async", "def", "getWorker", "(", "self", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "await", "self", ".", "_makeApiCall", "(", "self", ".", "funcinfo", "[", "\"getWorker\"", "]", ",", "*", "args", ",", "*", "*", "kwargs", ")" ]
Get a worker-type Get a worker from a worker-type. This method gives output: ``v1/worker-response.json#`` This method is ``experimental``
[ "Get", "a", "worker", "-", "type" ]
train
https://github.com/taskcluster/taskcluster-client.py/blob/bcc95217f8bf80bed2ae5885a19fa0035da7ebc9/taskcluster/aio/queue.py#L809-L820
jart/fabulous
fabulous/casts.py
file
def file(value, **kwarg): """value should be a path to file in the filesystem. returns a file object """ #a bit weird, but I don't want to hard code default values try: f = open(value, **kwarg) except IOError as e: raise ValueError("unable to open %s : %s" % (path.abspath(va...
python
def file(value, **kwarg): """value should be a path to file in the filesystem. returns a file object """ #a bit weird, but I don't want to hard code default values try: f = open(value, **kwarg) except IOError as e: raise ValueError("unable to open %s : %s" % (path.abspath(va...
[ "def", "file", "(", "value", ",", "*", "*", "kwarg", ")", ":", "#a bit weird, but I don't want to hard code default values", "try", ":", "f", "=", "open", "(", "value", ",", "*", "*", "kwarg", ")", "except", "IOError", "as", "e", ":", "raise", "ValueError", ...
value should be a path to file in the filesystem. returns a file object
[ "value", "should", "be", "a", "path", "to", "file", "in", "the", "filesystem", ".", "returns", "a", "file", "object" ]
train
https://github.com/jart/fabulous/blob/19903cf0a980b82f5928c3bec1f28b6bdd3785bd/fabulous/casts.py#L32-L42
taskcluster/taskcluster-client.py
taskcluster/utils.py
calculateSleepTime
def calculateSleepTime(attempt): """ From the go client https://github.com/taskcluster/go-got/blob/031f55c/backoff.go#L24-L29 """ if attempt <= 0: return 0 # We subtract one to get exponents: 1, 2, 3, 4, 5, .. delay = float(2 ** (attempt - 1)) * float(DELAY_FACTOR) # Apply randomiza...
python
def calculateSleepTime(attempt): """ From the go client https://github.com/taskcluster/go-got/blob/031f55c/backoff.go#L24-L29 """ if attempt <= 0: return 0 # We subtract one to get exponents: 1, 2, 3, 4, 5, .. delay = float(2 ** (attempt - 1)) * float(DELAY_FACTOR) # Apply randomiza...
[ "def", "calculateSleepTime", "(", "attempt", ")", ":", "if", "attempt", "<=", "0", ":", "return", "0", "# We subtract one to get exponents: 1, 2, 3, 4, 5, ..", "delay", "=", "float", "(", "2", "**", "(", "attempt", "-", "1", ")", ")", "*", "float", "(", "DEL...
From the go client https://github.com/taskcluster/go-got/blob/031f55c/backoff.go#L24-L29
[ "From", "the", "go", "client", "https", ":", "//", "github", ".", "com", "/", "taskcluster", "/", "go", "-", "got", "/", "blob", "/", "031f55c", "/", "backoff", ".", "go#L24", "-", "L29" ]
train
https://github.com/taskcluster/taskcluster-client.py/blob/bcc95217f8bf80bed2ae5885a19fa0035da7ebc9/taskcluster/utils.py#L40-L52
taskcluster/taskcluster-client.py
taskcluster/utils.py
fromNow
def fromNow(offset, dateObj=None): """ Generate a `datetime.datetime` instance which is offset using a string. See the README.md for a full example, but offset could be '1 day' for a datetime object one day in the future """ # We want to handle past dates as well as future future = True ...
python
def fromNow(offset, dateObj=None): """ Generate a `datetime.datetime` instance which is offset using a string. See the README.md for a full example, but offset could be '1 day' for a datetime object one day in the future """ # We want to handle past dates as well as future future = True ...
[ "def", "fromNow", "(", "offset", ",", "dateObj", "=", "None", ")", ":", "# We want to handle past dates as well as future", "future", "=", "True", "offset", "=", "offset", ".", "lstrip", "(", ")", "if", "offset", ".", "startswith", "(", "'-'", ")", ":", "fut...
Generate a `datetime.datetime` instance which is offset using a string. See the README.md for a full example, but offset could be '1 day' for a datetime object one day in the future
[ "Generate", "a", "datetime", ".", "datetime", "instance", "which", "is", "offset", "using", "a", "string", ".", "See", "the", "README", ".", "md", "for", "a", "full", "example", "but", "offset", "could", "be", "1", "day", "for", "a", "datetime", "object"...
train
https://github.com/taskcluster/taskcluster-client.py/blob/bcc95217f8bf80bed2ae5885a19fa0035da7ebc9/taskcluster/utils.py#L63-L113
taskcluster/taskcluster-client.py
taskcluster/utils.py
dumpJson
def dumpJson(obj, **kwargs): """ Match JS's JSON.stringify. When using the default seperators, base64 encoding JSON results in \n sequences in the output. Hawk barfs in your face if you have that in the text""" def handleDateAndBinaryForJs(x): if six.PY3 and isinstance(x, six.binary_type): ...
python
def dumpJson(obj, **kwargs): """ Match JS's JSON.stringify. When using the default seperators, base64 encoding JSON results in \n sequences in the output. Hawk barfs in your face if you have that in the text""" def handleDateAndBinaryForJs(x): if six.PY3 and isinstance(x, six.binary_type): ...
[ "def", "dumpJson", "(", "obj", ",", "*", "*", "kwargs", ")", ":", "def", "handleDateAndBinaryForJs", "(", "x", ")", ":", "if", "six", ".", "PY3", "and", "isinstance", "(", "x", ",", "six", ".", "binary_type", ")", ":", "x", "=", "x", ".", "decode",...
Match JS's JSON.stringify. When using the default seperators, base64 encoding JSON results in \n sequences in the output. Hawk barfs in your face if you have that in the text
[ "Match", "JS", "s", "JSON", ".", "stringify", ".", "When", "using", "the", "default", "seperators", "base64", "encoding", "JSON", "results", "in", "\\", "n", "sequences", "in", "the", "output", ".", "Hawk", "barfs", "in", "your", "face", "if", "you", "ha...
train
https://github.com/taskcluster/taskcluster-client.py/blob/bcc95217f8bf80bed2ae5885a19fa0035da7ebc9/taskcluster/utils.py#L123-L136
taskcluster/taskcluster-client.py
taskcluster/utils.py
makeB64UrlSafe
def makeB64UrlSafe(b64str): """ Make a base64 string URL Safe """ if isinstance(b64str, six.text_type): b64str = b64str.encode() # see RFC 4648, sec. 5 return b64str.replace(b'+', b'-').replace(b'/', b'_')
python
def makeB64UrlSafe(b64str): """ Make a base64 string URL Safe """ if isinstance(b64str, six.text_type): b64str = b64str.encode() # see RFC 4648, sec. 5 return b64str.replace(b'+', b'-').replace(b'/', b'_')
[ "def", "makeB64UrlSafe", "(", "b64str", ")", ":", "if", "isinstance", "(", "b64str", ",", "six", ".", "text_type", ")", ":", "b64str", "=", "b64str", ".", "encode", "(", ")", "# see RFC 4648, sec. 5", "return", "b64str", ".", "replace", "(", "b'+'", ",", ...
Make a base64 string URL Safe
[ "Make", "a", "base64", "string", "URL", "Safe" ]
train
https://github.com/taskcluster/taskcluster-client.py/blob/bcc95217f8bf80bed2ae5885a19fa0035da7ebc9/taskcluster/utils.py#L153-L158
taskcluster/taskcluster-client.py
taskcluster/utils.py
encodeStringForB64Header
def encodeStringForB64Header(s): """ HTTP Headers can't have new lines in them, let's """ if isinstance(s, six.text_type): s = s.encode() return base64.encodestring(s).strip().replace(b'\n', b'')
python
def encodeStringForB64Header(s): """ HTTP Headers can't have new lines in them, let's """ if isinstance(s, six.text_type): s = s.encode() return base64.encodestring(s).strip().replace(b'\n', b'')
[ "def", "encodeStringForB64Header", "(", "s", ")", ":", "if", "isinstance", "(", "s", ",", "six", ".", "text_type", ")", ":", "s", "=", "s", ".", "encode", "(", ")", "return", "base64", ".", "encodestring", "(", "s", ")", ".", "strip", "(", ")", "."...
HTTP Headers can't have new lines in them, let's
[ "HTTP", "Headers", "can", "t", "have", "new", "lines", "in", "them", "let", "s" ]
train
https://github.com/taskcluster/taskcluster-client.py/blob/bcc95217f8bf80bed2ae5885a19fa0035da7ebc9/taskcluster/utils.py#L169-L173
taskcluster/taskcluster-client.py
taskcluster/utils.py
stableSlugId
def stableSlugId(): """Returns a closure which can be used to generate stable slugIds. Stable slugIds can be used in a graph to specify task IDs in multiple places without regenerating them, e.g. taskId, requires, etc. """ _cache = {} def closure(name): if name not in _cache: ...
python
def stableSlugId(): """Returns a closure which can be used to generate stable slugIds. Stable slugIds can be used in a graph to specify task IDs in multiple places without regenerating them, e.g. taskId, requires, etc. """ _cache = {} def closure(name): if name not in _cache: ...
[ "def", "stableSlugId", "(", ")", ":", "_cache", "=", "{", "}", "def", "closure", "(", "name", ")", ":", "if", "name", "not", "in", "_cache", ":", "_cache", "[", "name", "]", "=", "slugId", "(", ")", "return", "_cache", "[", "name", "]", "return", ...
Returns a closure which can be used to generate stable slugIds. Stable slugIds can be used in a graph to specify task IDs in multiple places without regenerating them, e.g. taskId, requires, etc.
[ "Returns", "a", "closure", "which", "can", "be", "used", "to", "generate", "stable", "slugIds", ".", "Stable", "slugIds", "can", "be", "used", "in", "a", "graph", "to", "specify", "task", "IDs", "in", "multiple", "places", "without", "regenerating", "them", ...
train
https://github.com/taskcluster/taskcluster-client.py/blob/bcc95217f8bf80bed2ae5885a19fa0035da7ebc9/taskcluster/utils.py#L182-L194
taskcluster/taskcluster-client.py
taskcluster/utils.py
scopeMatch
def scopeMatch(assumedScopes, requiredScopeSets): """ Take a list of a assumed scopes, and a list of required scope sets on disjunctive normal form, and check if any of the required scope sets are satisfied. Example: requiredScopeSets = [ ["scopeA", "sco...
python
def scopeMatch(assumedScopes, requiredScopeSets): """ Take a list of a assumed scopes, and a list of required scope sets on disjunctive normal form, and check if any of the required scope sets are satisfied. Example: requiredScopeSets = [ ["scopeA", "sco...
[ "def", "scopeMatch", "(", "assumedScopes", ",", "requiredScopeSets", ")", ":", "for", "scopeSet", "in", "requiredScopeSets", ":", "for", "requiredScope", "in", "scopeSet", ":", "for", "scope", "in", "assumedScopes", ":", "if", "scope", "==", "requiredScope", ":"...
Take a list of a assumed scopes, and a list of required scope sets on disjunctive normal form, and check if any of the required scope sets are satisfied. Example: requiredScopeSets = [ ["scopeA", "scopeB"], ["scopeC"] ] In this c...
[ "Take", "a", "list", "of", "a", "assumed", "scopes", "and", "a", "list", "of", "required", "scope", "sets", "on", "disjunctive", "normal", "form", "and", "check", "if", "any", "of", "the", "required", "scope", "sets", "are", "satisfied", "." ]
train
https://github.com/taskcluster/taskcluster-client.py/blob/bcc95217f8bf80bed2ae5885a19fa0035da7ebc9/taskcluster/utils.py#L197-L229
taskcluster/taskcluster-client.py
taskcluster/utils.py
makeHttpRequest
def makeHttpRequest(method, url, payload, headers, retries=MAX_RETRIES, session=None): """ Make an HTTP request and retry it until success, return request """ retry = -1 response = None while retry < retries: retry += 1 # if this isn't the first retry then we sleep if retry > 0: ...
python
def makeHttpRequest(method, url, payload, headers, retries=MAX_RETRIES, session=None): """ Make an HTTP request and retry it until success, return request """ retry = -1 response = None while retry < retries: retry += 1 # if this isn't the first retry then we sleep if retry > 0: ...
[ "def", "makeHttpRequest", "(", "method", ",", "url", ",", "payload", ",", "headers", ",", "retries", "=", "MAX_RETRIES", ",", "session", "=", "None", ")", ":", "retry", "=", "-", "1", "response", "=", "None", "while", "retry", "<", "retries", ":", "ret...
Make an HTTP request and retry it until success, return request
[ "Make", "an", "HTTP", "request", "and", "retry", "it", "until", "success", "return", "request" ]
train
https://github.com/taskcluster/taskcluster-client.py/blob/bcc95217f8bf80bed2ae5885a19fa0035da7ebc9/taskcluster/utils.py#L241-L281
taskcluster/taskcluster-client.py
taskcluster/utils.py
isExpired
def isExpired(certificate): """ Check if certificate is expired """ if isinstance(certificate, six.string_types): certificate = json.loads(certificate) expiry = certificate.get('expiry', 0) return expiry < int(time.time() * 1000) + 20 * 60
python
def isExpired(certificate): """ Check if certificate is expired """ if isinstance(certificate, six.string_types): certificate = json.loads(certificate) expiry = certificate.get('expiry', 0) return expiry < int(time.time() * 1000) + 20 * 60
[ "def", "isExpired", "(", "certificate", ")", ":", "if", "isinstance", "(", "certificate", ",", "six", ".", "string_types", ")", ":", "certificate", "=", "json", ".", "loads", "(", "certificate", ")", "expiry", "=", "certificate", ".", "get", "(", "'expiry'...
Check if certificate is expired
[ "Check", "if", "certificate", "is", "expired" ]
train
https://github.com/taskcluster/taskcluster-client.py/blob/bcc95217f8bf80bed2ae5885a19fa0035da7ebc9/taskcluster/utils.py#L314-L319
taskcluster/taskcluster-client.py
taskcluster/utils.py
optionsFromEnvironment
def optionsFromEnvironment(defaults=None): """Fetch root URL and credentials from the standard TASKCLUSTER_… environment variables and return them in a format suitable for passing to a client constructor.""" options = defaults or {} credentials = options.get('credentials', {}) rootUrl = os.envi...
python
def optionsFromEnvironment(defaults=None): """Fetch root URL and credentials from the standard TASKCLUSTER_… environment variables and return them in a format suitable for passing to a client constructor.""" options = defaults or {} credentials = options.get('credentials', {}) rootUrl = os.envi...
[ "def", "optionsFromEnvironment", "(", "defaults", "=", "None", ")", ":", "options", "=", "defaults", "or", "{", "}", "credentials", "=", "options", ".", "get", "(", "'credentials'", ",", "{", "}", ")", "rootUrl", "=", "os", ".", "environ", ".", "get", ...
Fetch root URL and credentials from the standard TASKCLUSTER_… environment variables and return them in a format suitable for passing to a client constructor.
[ "Fetch", "root", "URL", "and", "credentials", "from", "the", "standard", "TASKCLUSTER_…", "environment", "variables", "and", "return", "them", "in", "a", "format", "suitable", "for", "passing", "to", "a", "client", "constructor", "." ]
train
https://github.com/taskcluster/taskcluster-client.py/blob/bcc95217f8bf80bed2ae5885a19fa0035da7ebc9/taskcluster/utils.py#L322-L348
jart/fabulous
fabulous/xterm256.py
xterm_to_rgb
def xterm_to_rgb(xcolor): """Convert xterm Color ID to an RGB value All 256 values are precalculated and stored in :data:`COLOR_TABLE` """ assert 0 <= xcolor <= 255 if xcolor < 16: # basic colors return BASIC16[xcolor] elif 16 <= xcolor <= 231: # color cube xcolo...
python
def xterm_to_rgb(xcolor): """Convert xterm Color ID to an RGB value All 256 values are precalculated and stored in :data:`COLOR_TABLE` """ assert 0 <= xcolor <= 255 if xcolor < 16: # basic colors return BASIC16[xcolor] elif 16 <= xcolor <= 231: # color cube xcolo...
[ "def", "xterm_to_rgb", "(", "xcolor", ")", ":", "assert", "0", "<=", "xcolor", "<=", "255", "if", "xcolor", "<", "16", ":", "# basic colors", "return", "BASIC16", "[", "xcolor", "]", "elif", "16", "<=", "xcolor", "<=", "231", ":", "# color cube", "xcolor...
Convert xterm Color ID to an RGB value All 256 values are precalculated and stored in :data:`COLOR_TABLE`
[ "Convert", "xterm", "Color", "ID", "to", "an", "RGB", "value" ]
train
https://github.com/jart/fabulous/blob/19903cf0a980b82f5928c3bec1f28b6bdd3785bd/fabulous/xterm256.py#L42-L60
jart/fabulous
fabulous/xterm256.py
rgb_to_xterm
def rgb_to_xterm(r, g, b): """Quantize RGB values to an xterm 256-color ID This works by envisioning the RGB values for all 256 xterm colors as 3D euclidean space and brute-force searching for the nearest neighbor. This is very slow. If you're very lucky, :func:`compile_speedup` will replace ...
python
def rgb_to_xterm(r, g, b): """Quantize RGB values to an xterm 256-color ID This works by envisioning the RGB values for all 256 xterm colors as 3D euclidean space and brute-force searching for the nearest neighbor. This is very slow. If you're very lucky, :func:`compile_speedup` will replace ...
[ "def", "rgb_to_xterm", "(", "r", ",", "g", ",", "b", ")", ":", "if", "r", "<", "5", "and", "g", "<", "5", "and", "b", "<", "5", ":", "return", "16", "best_match", "=", "0", "smallest_distance", "=", "10000000000", "for", "c", "in", "range", "(", ...
Quantize RGB values to an xterm 256-color ID This works by envisioning the RGB values for all 256 xterm colors as 3D euclidean space and brute-force searching for the nearest neighbor. This is very slow. If you're very lucky, :func:`compile_speedup` will replace this function automatically with r...
[ "Quantize", "RGB", "values", "to", "an", "xterm", "256", "-", "color", "ID" ]
train
https://github.com/jart/fabulous/blob/19903cf0a980b82f5928c3bec1f28b6bdd3785bd/fabulous/xterm256.py#L66-L88
jart/fabulous
fabulous/xterm256.py
compile_speedup
def compile_speedup(): """Tries to compile/link the C version of this module Like it really makes a huge difference. With a little bit of luck this should *just work* for you. You need: - Python >= 2.5 for ctypes library - gcc (``sudo apt-get install gcc``) """ import os import ...
python
def compile_speedup(): """Tries to compile/link the C version of this module Like it really makes a huge difference. With a little bit of luck this should *just work* for you. You need: - Python >= 2.5 for ctypes library - gcc (``sudo apt-get install gcc``) """ import os import ...
[ "def", "compile_speedup", "(", ")", ":", "import", "os", "import", "ctypes", "from", "os", ".", "path", "import", "join", ",", "dirname", ",", "getmtime", ",", "exists", ",", "expanduser", "# library = join(dirname(__file__), '_xterm256.so')", "library", "=", "exp...
Tries to compile/link the C version of this module Like it really makes a huge difference. With a little bit of luck this should *just work* for you. You need: - Python >= 2.5 for ctypes library - gcc (``sudo apt-get install gcc``)
[ "Tries", "to", "compile", "/", "link", "the", "C", "version", "of", "this", "module" ]
train
https://github.com/jart/fabulous/blob/19903cf0a980b82f5928c3bec1f28b6bdd3785bd/fabulous/xterm256.py#L91-L118
jart/fabulous
fabulous/image.py
main
def main(): """Main function for :command:`fabulous-image`.""" import optparse parser = optparse.OptionParser() parser.add_option( "-w", "--width", dest="width", type="int", default=None, help=("Width of printed image in characters. Default: %default")) (options, args) = parser.pars...
python
def main(): """Main function for :command:`fabulous-image`.""" import optparse parser = optparse.OptionParser() parser.add_option( "-w", "--width", dest="width", type="int", default=None, help=("Width of printed image in characters. Default: %default")) (options, args) = parser.pars...
[ "def", "main", "(", ")", ":", "import", "optparse", "parser", "=", "optparse", ".", "OptionParser", "(", ")", "parser", ".", "add_option", "(", "\"-w\"", ",", "\"--width\"", ",", "dest", "=", "\"width\"", ",", "type", "=", "\"int\"", ",", "default", "=",...
Main function for :command:`fabulous-image`.
[ "Main", "function", "for", ":", "command", ":", "fabulous", "-", "image", "." ]
train
https://github.com/jart/fabulous/blob/19903cf0a980b82f5928c3bec1f28b6bdd3785bd/fabulous/image.py#L180-L190
jart/fabulous
fabulous/image.py
Image.resize
def resize(self, width=None): """Resizes image to fit inside terminal Called by the constructor automatically. """ (iw, ih) = self.size if width is None: width = min(iw, utils.term.width) elif isinstance(width, basestring): percents = dict([(pct, ...
python
def resize(self, width=None): """Resizes image to fit inside terminal Called by the constructor automatically. """ (iw, ih) = self.size if width is None: width = min(iw, utils.term.width) elif isinstance(width, basestring): percents = dict([(pct, ...
[ "def", "resize", "(", "self", ",", "width", "=", "None", ")", ":", "(", "iw", ",", "ih", ")", "=", "self", ".", "size", "if", "width", "is", "None", ":", "width", "=", "min", "(", "iw", ",", "utils", ".", "term", ".", "width", ")", "elif", "i...
Resizes image to fit inside terminal Called by the constructor automatically.
[ "Resizes", "image", "to", "fit", "inside", "terminal" ]
train
https://github.com/jart/fabulous/blob/19903cf0a980b82f5928c3bec1f28b6bdd3785bd/fabulous/image.py#L107-L120
jart/fabulous
fabulous/image.py
Image.reduce
def reduce(self, colors): """Converts color codes into optimized text This optimizer works by merging adjacent colors so we don't have to repeat the same escape codes for each pixel. There is no loss of information. :param colors: Iterable yielding an xterm color code for each...
python
def reduce(self, colors): """Converts color codes into optimized text This optimizer works by merging adjacent colors so we don't have to repeat the same escape codes for each pixel. There is no loss of information. :param colors: Iterable yielding an xterm color code for each...
[ "def", "reduce", "(", "self", ",", "colors", ")", ":", "need_reset", "=", "False", "line", "=", "[", "]", "for", "color", ",", "items", "in", "itertools", ".", "groupby", "(", "colors", ")", ":", "if", "color", "is", "None", ":", "if", "need_reset", ...
Converts color codes into optimized text This optimizer works by merging adjacent colors so we don't have to repeat the same escape codes for each pixel. There is no loss of information. :param colors: Iterable yielding an xterm color code for each pixel, None t...
[ "Converts", "color", "codes", "into", "optimized", "text" ]
train
https://github.com/jart/fabulous/blob/19903cf0a980b82f5928c3bec1f28b6bdd3785bd/fabulous/image.py#L122-L156
jart/fabulous
fabulous/image.py
Image.convert
def convert(self): """Yields xterm color codes for each pixel in image """ (width, height) = self.img.size bgcolor = utils.term.bgcolor self.img.load() for y in range(height): for x in range(width): rgba = self.img.getpixel((x, y)) ...
python
def convert(self): """Yields xterm color codes for each pixel in image """ (width, height) = self.img.size bgcolor = utils.term.bgcolor self.img.load() for y in range(height): for x in range(width): rgba = self.img.getpixel((x, y)) ...
[ "def", "convert", "(", "self", ")", ":", "(", "width", ",", "height", ")", "=", "self", ".", "img", ".", "size", "bgcolor", "=", "utils", ".", "term", ".", "bgcolor", "self", ".", "img", ".", "load", "(", ")", "for", "y", "in", "range", "(", "h...
Yields xterm color codes for each pixel in image
[ "Yields", "xterm", "color", "codes", "for", "each", "pixel", "in", "image" ]
train
https://github.com/jart/fabulous/blob/19903cf0a980b82f5928c3bec1f28b6bdd3785bd/fabulous/image.py#L158-L177
taskcluster/taskcluster-client.py
taskcluster/login.py
Login.oidcCredentials
def oidcCredentials(self, *args, **kwargs): """ Get Taskcluster credentials given a suitable `access_token` Given an OIDC `access_token` from a trusted OpenID provider, return a set of Taskcluster credentials for use on behalf of the identified user. This method is typi...
python
def oidcCredentials(self, *args, **kwargs): """ Get Taskcluster credentials given a suitable `access_token` Given an OIDC `access_token` from a trusted OpenID provider, return a set of Taskcluster credentials for use on behalf of the identified user. This method is typi...
[ "def", "oidcCredentials", "(", "self", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "self", ".", "_makeApiCall", "(", "self", ".", "funcinfo", "[", "\"oidcCredentials\"", "]", ",", "*", "args", ",", "*", "*", "kwargs", ")" ]
Get Taskcluster credentials given a suitable `access_token` Given an OIDC `access_token` from a trusted OpenID provider, return a set of Taskcluster credentials for use on behalf of the identified user. This method is typically not called with a Taskcluster client library and d...
[ "Get", "Taskcluster", "credentials", "given", "a", "suitable", "access_token" ]
train
https://github.com/taskcluster/taskcluster-client.py/blob/bcc95217f8bf80bed2ae5885a19fa0035da7ebc9/taskcluster/login.py#L37-L68
taskcluster/taskcluster-client.py
taskcluster/aio/github.py
Github.builds
async def builds(self, *args, **kwargs): """ List of Builds A paginated list of builds that have been run in Taskcluster. Can be filtered on various git-specific fields. This method gives output: ``v1/build-list.json#`` This method is ``experimental`` "...
python
async def builds(self, *args, **kwargs): """ List of Builds A paginated list of builds that have been run in Taskcluster. Can be filtered on various git-specific fields. This method gives output: ``v1/build-list.json#`` This method is ``experimental`` "...
[ "async", "def", "builds", "(", "self", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "await", "self", ".", "_makeApiCall", "(", "self", ".", "funcinfo", "[", "\"builds\"", "]", ",", "*", "args", ",", "*", "*", "kwargs", ")" ]
List of Builds A paginated list of builds that have been run in Taskcluster. Can be filtered on various git-specific fields. This method gives output: ``v1/build-list.json#`` This method is ``experimental``
[ "List", "of", "Builds" ]
train
https://github.com/taskcluster/taskcluster-client.py/blob/bcc95217f8bf80bed2ae5885a19fa0035da7ebc9/taskcluster/aio/github.py#L55-L68
taskcluster/taskcluster-client.py
taskcluster/aio/github.py
Github.repository
async def repository(self, *args, **kwargs): """ Get Repository Info Returns any repository metadata that is useful within Taskcluster related services. This method gives output: ``v1/repository.json#`` This method is ``experimental`` """ return await ...
python
async def repository(self, *args, **kwargs): """ Get Repository Info Returns any repository metadata that is useful within Taskcluster related services. This method gives output: ``v1/repository.json#`` This method is ``experimental`` """ return await ...
[ "async", "def", "repository", "(", "self", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "await", "self", ".", "_makeApiCall", "(", "self", ".", "funcinfo", "[", "\"repository\"", "]", ",", "*", "args", ",", "*", "*", "kwargs", ")" ]
Get Repository Info Returns any repository metadata that is useful within Taskcluster related services. This method gives output: ``v1/repository.json#`` This method is ``experimental``
[ "Get", "Repository", "Info" ]
train
https://github.com/taskcluster/taskcluster-client.py/blob/bcc95217f8bf80bed2ae5885a19fa0035da7ebc9/taskcluster/aio/github.py#L82-L94
taskcluster/taskcluster-client.py
taskcluster/aio/github.py
Github.createStatus
async def createStatus(self, *args, **kwargs): """ Post a status against a given changeset For a given changeset (SHA) of a repository, this will attach a "commit status" on github. These statuses are links displayed next to each revision. The status is either OK (green check) o...
python
async def createStatus(self, *args, **kwargs): """ Post a status against a given changeset For a given changeset (SHA) of a repository, this will attach a "commit status" on github. These statuses are links displayed next to each revision. The status is either OK (green check) o...
[ "async", "def", "createStatus", "(", "self", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "await", "self", ".", "_makeApiCall", "(", "self", ".", "funcinfo", "[", "\"createStatus\"", "]", ",", "*", "args", ",", "*", "*", "kwargs", "...
Post a status against a given changeset For a given changeset (SHA) of a repository, this will attach a "commit status" on github. These statuses are links displayed next to each revision. The status is either OK (green check) or FAILURE (red cross), made of a custom title and link. ...
[ "Post", "a", "status", "against", "a", "given", "changeset" ]
train
https://github.com/taskcluster/taskcluster-client.py/blob/bcc95217f8bf80bed2ae5885a19fa0035da7ebc9/taskcluster/aio/github.py#L111-L125
taskcluster/taskcluster-client.py
taskcluster/aio/notify.py
Notify.email
async def email(self, *args, **kwargs): """ Send an Email Send an email to `address`. The content is markdown and will be rendered to HTML, but both the HTML and raw markdown text will be sent in the email. If a link is included, it will be rendered to a nice button in the ...
python
async def email(self, *args, **kwargs): """ Send an Email Send an email to `address`. The content is markdown and will be rendered to HTML, but both the HTML and raw markdown text will be sent in the email. If a link is included, it will be rendered to a nice button in the ...
[ "async", "def", "email", "(", "self", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "await", "self", ".", "_makeApiCall", "(", "self", ".", "funcinfo", "[", "\"email\"", "]", ",", "*", "args", ",", "*", "*", "kwargs", ")" ]
Send an Email Send an email to `address`. The content is markdown and will be rendered to HTML, but both the HTML and raw markdown text will be sent in the email. If a link is included, it will be rendered to a nice button in the HTML version of the email This method takes inpu...
[ "Send", "an", "Email" ]
train
https://github.com/taskcluster/taskcluster-client.py/blob/bcc95217f8bf80bed2ae5885a19fa0035da7ebc9/taskcluster/aio/notify.py#L37-L51
taskcluster/taskcluster-client.py
taskcluster/aio/notify.py
Notify.pulse
async def pulse(self, *args, **kwargs): """ Publish a Pulse Message Publish a message on pulse with the given `routingKey`. This method takes input: ``v1/pulse-request.json#`` This method is ``experimental`` """ return await self._makeApiCall(self.funcinfo["pu...
python
async def pulse(self, *args, **kwargs): """ Publish a Pulse Message Publish a message on pulse with the given `routingKey`. This method takes input: ``v1/pulse-request.json#`` This method is ``experimental`` """ return await self._makeApiCall(self.funcinfo["pu...
[ "async", "def", "pulse", "(", "self", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "await", "self", ".", "_makeApiCall", "(", "self", ".", "funcinfo", "[", "\"pulse\"", "]", ",", "*", "args", ",", "*", "*", "kwargs", ")" ]
Publish a Pulse Message Publish a message on pulse with the given `routingKey`. This method takes input: ``v1/pulse-request.json#`` This method is ``experimental``
[ "Publish", "a", "Pulse", "Message" ]
train
https://github.com/taskcluster/taskcluster-client.py/blob/bcc95217f8bf80bed2ae5885a19fa0035da7ebc9/taskcluster/aio/notify.py#L53-L64
jart/fabulous
fabulous/logs.py
basicConfig
def basicConfig(level=logging.WARNING, transient_level=logging.NOTSET): """Shortcut for setting up transient logging I am a replica of ``logging.basicConfig`` which installs a transient logging handler to stderr. """ fmt = "%(asctime)s [%(levelname)s] [%(name)s:%(lineno)d] %(message)s" logging....
python
def basicConfig(level=logging.WARNING, transient_level=logging.NOTSET): """Shortcut for setting up transient logging I am a replica of ``logging.basicConfig`` which installs a transient logging handler to stderr. """ fmt = "%(asctime)s [%(levelname)s] [%(name)s:%(lineno)d] %(message)s" logging....
[ "def", "basicConfig", "(", "level", "=", "logging", ".", "WARNING", ",", "transient_level", "=", "logging", ".", "NOTSET", ")", ":", "fmt", "=", "\"%(asctime)s [%(levelname)s] [%(name)s:%(lineno)d] %(message)s\"", "logging", ".", "root", ".", "setLevel", "(", "trans...
Shortcut for setting up transient logging I am a replica of ``logging.basicConfig`` which installs a transient logging handler to stderr.
[ "Shortcut", "for", "setting", "up", "transient", "logging" ]
train
https://github.com/jart/fabulous/blob/19903cf0a980b82f5928c3bec1f28b6bdd3785bd/fabulous/logs.py#L122-L132
taskcluster/taskcluster-client.py
taskcluster/aio/auth.py
Auth.resetAccessToken
async def resetAccessToken(self, *args, **kwargs): """ Reset `accessToken` Reset a clients `accessToken`, this will revoke the existing `accessToken`, generate a new `accessToken` and return it from this call. There is no way to retrieve an existing `accessToken`, so if...
python
async def resetAccessToken(self, *args, **kwargs): """ Reset `accessToken` Reset a clients `accessToken`, this will revoke the existing `accessToken`, generate a new `accessToken` and return it from this call. There is no way to retrieve an existing `accessToken`, so if...
[ "async", "def", "resetAccessToken", "(", "self", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "await", "self", ".", "_makeApiCall", "(", "self", ".", "funcinfo", "[", "\"resetAccessToken\"", "]", ",", "*", "args", ",", "*", "*", "kwar...
Reset `accessToken` Reset a clients `accessToken`, this will revoke the existing `accessToken`, generate a new `accessToken` and return it from this call. There is no way to retrieve an existing `accessToken`, so if you loose it you must reset the accessToken to acquire it agai...
[ "Reset", "accessToken" ]
train
https://github.com/taskcluster/taskcluster-client.py/blob/bcc95217f8bf80bed2ae5885a19fa0035da7ebc9/taskcluster/aio/auth.py#L134-L150
taskcluster/taskcluster-client.py
taskcluster/aio/auth.py
Auth.role
async def role(self, *args, **kwargs): """ Get Role Get information about a single role, including the set of scopes that the role expands to. This method gives output: ``v1/get-role-response.json#`` This method is ``stable`` """ return await self._mak...
python
async def role(self, *args, **kwargs): """ Get Role Get information about a single role, including the set of scopes that the role expands to. This method gives output: ``v1/get-role-response.json#`` This method is ``stable`` """ return await self._mak...
[ "async", "def", "role", "(", "self", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "await", "self", ".", "_makeApiCall", "(", "self", ".", "funcinfo", "[", "\"role\"", "]", ",", "*", "args", ",", "*", "*", "kwargs", ")" ]
Get Role Get information about a single role, including the set of scopes that the role expands to. This method gives output: ``v1/get-role-response.json#`` This method is ``stable``
[ "Get", "Role" ]
train
https://github.com/taskcluster/taskcluster-client.py/blob/bcc95217f8bf80bed2ae5885a19fa0035da7ebc9/taskcluster/aio/auth.py#L260-L272
taskcluster/taskcluster-client.py
taskcluster/aio/auth.py
Auth.azureAccounts
async def azureAccounts(self, *args, **kwargs): """ List Accounts Managed by Auth Retrieve a list of all Azure accounts managed by Taskcluster Auth. This method gives output: ``v1/azure-account-list-response.json#`` This method is ``stable`` """ return await s...
python
async def azureAccounts(self, *args, **kwargs): """ List Accounts Managed by Auth Retrieve a list of all Azure accounts managed by Taskcluster Auth. This method gives output: ``v1/azure-account-list-response.json#`` This method is ``stable`` """ return await s...
[ "async", "def", "azureAccounts", "(", "self", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "await", "self", ".", "_makeApiCall", "(", "self", ".", "funcinfo", "[", "\"azureAccounts\"", "]", ",", "*", "args", ",", "*", "*", "kwargs", ...
List Accounts Managed by Auth Retrieve a list of all Azure accounts managed by Taskcluster Auth. This method gives output: ``v1/azure-account-list-response.json#`` This method is ``stable``
[ "List", "Accounts", "Managed", "by", "Auth" ]
train
https://github.com/taskcluster/taskcluster-client.py/blob/bcc95217f8bf80bed2ae5885a19fa0035da7ebc9/taskcluster/aio/auth.py#L457-L468
taskcluster/taskcluster-client.py
taskcluster/aio/auth.py
Auth.authenticateHawk
async def authenticateHawk(self, *args, **kwargs): """ Authenticate Hawk Request Validate the request signature given on input and return list of scopes that the authenticating client has. This method is used by other services that wish rely on Taskcluster credentials f...
python
async def authenticateHawk(self, *args, **kwargs): """ Authenticate Hawk Request Validate the request signature given on input and return list of scopes that the authenticating client has. This method is used by other services that wish rely on Taskcluster credentials f...
[ "async", "def", "authenticateHawk", "(", "self", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "await", "self", ".", "_makeApiCall", "(", "self", ".", "funcinfo", "[", "\"authenticateHawk\"", "]", ",", "*", "args", ",", "*", "*", "kwar...
Authenticate Hawk Request Validate the request signature given on input and return list of scopes that the authenticating client has. This method is used by other services that wish rely on Taskcluster credentials for authentication. This way we can use Hawk without having the ...
[ "Authenticate", "Hawk", "Request" ]
train
https://github.com/taskcluster/taskcluster-client.py/blob/bcc95217f8bf80bed2ae5885a19fa0035da7ebc9/taskcluster/aio/auth.py#L588-L606
taskcluster/taskcluster-client.py
taskcluster/aio/hooks.py
Hooks.listHookGroups
async def listHookGroups(self, *args, **kwargs): """ List hook groups This endpoint will return a list of all hook groups with at least one hook. This method gives output: ``v1/list-hook-groups-response.json#`` This method is ``stable`` """ return await self._...
python
async def listHookGroups(self, *args, **kwargs): """ List hook groups This endpoint will return a list of all hook groups with at least one hook. This method gives output: ``v1/list-hook-groups-response.json#`` This method is ``stable`` """ return await self._...
[ "async", "def", "listHookGroups", "(", "self", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "await", "self", ".", "_makeApiCall", "(", "self", ".", "funcinfo", "[", "\"listHookGroups\"", "]", ",", "*", "args", ",", "*", "*", "kwargs",...
List hook groups This endpoint will return a list of all hook groups with at least one hook. This method gives output: ``v1/list-hook-groups-response.json#`` This method is ``stable``
[ "List", "hook", "groups" ]
train
https://github.com/taskcluster/taskcluster-client.py/blob/bcc95217f8bf80bed2ae5885a19fa0035da7ebc9/taskcluster/aio/hooks.py#L54-L65
taskcluster/taskcluster-client.py
taskcluster/aio/hooks.py
Hooks.listHooks
async def listHooks(self, *args, **kwargs): """ List hooks in a given group This endpoint will return a list of all the hook definitions within a given hook group. This method gives output: ``v1/list-hooks-response.json#`` This method is ``stable`` """ ...
python
async def listHooks(self, *args, **kwargs): """ List hooks in a given group This endpoint will return a list of all the hook definitions within a given hook group. This method gives output: ``v1/list-hooks-response.json#`` This method is ``stable`` """ ...
[ "async", "def", "listHooks", "(", "self", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "await", "self", ".", "_makeApiCall", "(", "self", ".", "funcinfo", "[", "\"listHooks\"", "]", ",", "*", "args", ",", "*", "*", "kwargs", ")" ]
List hooks in a given group This endpoint will return a list of all the hook definitions within a given hook group. This method gives output: ``v1/list-hooks-response.json#`` This method is ``stable``
[ "List", "hooks", "in", "a", "given", "group" ]
train
https://github.com/taskcluster/taskcluster-client.py/blob/bcc95217f8bf80bed2ae5885a19fa0035da7ebc9/taskcluster/aio/hooks.py#L67-L79
taskcluster/taskcluster-client.py
taskcluster/aio/hooks.py
Hooks.hook
async def hook(self, *args, **kwargs): """ Get hook definition This endpoint will return the hook definition for the given `hookGroupId` and hookId. This method gives output: ``v1/hook-definition.json#`` This method is ``stable`` """ return await self....
python
async def hook(self, *args, **kwargs): """ Get hook definition This endpoint will return the hook definition for the given `hookGroupId` and hookId. This method gives output: ``v1/hook-definition.json#`` This method is ``stable`` """ return await self....
[ "async", "def", "hook", "(", "self", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "await", "self", ".", "_makeApiCall", "(", "self", ".", "funcinfo", "[", "\"hook\"", "]", ",", "*", "args", ",", "*", "*", "kwargs", ")" ]
Get hook definition This endpoint will return the hook definition for the given `hookGroupId` and hookId. This method gives output: ``v1/hook-definition.json#`` This method is ``stable``
[ "Get", "hook", "definition" ]
train
https://github.com/taskcluster/taskcluster-client.py/blob/bcc95217f8bf80bed2ae5885a19fa0035da7ebc9/taskcluster/aio/hooks.py#L81-L93
taskcluster/taskcluster-client.py
taskcluster/aio/hooks.py
Hooks.updateHook
async def updateHook(self, *args, **kwargs): """ Update a hook This endpoint will update an existing hook. All fields except `hookGroupId` and `hookId` can be modified. This method takes input: ``v1/create-hook-request.json#`` This method gives output: ``v1/hook-defin...
python
async def updateHook(self, *args, **kwargs): """ Update a hook This endpoint will update an existing hook. All fields except `hookGroupId` and `hookId` can be modified. This method takes input: ``v1/create-hook-request.json#`` This method gives output: ``v1/hook-defin...
[ "async", "def", "updateHook", "(", "self", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "await", "self", ".", "_makeApiCall", "(", "self", ".", "funcinfo", "[", "\"updateHook\"", "]", ",", "*", "args", ",", "*", "*", "kwargs", ")" ]
Update a hook This endpoint will update an existing hook. All fields except `hookGroupId` and `hookId` can be modified. This method takes input: ``v1/create-hook-request.json#`` This method gives output: ``v1/hook-definition.json#`` This method is ``stable``
[ "Update", "a", "hook" ]
train
https://github.com/taskcluster/taskcluster-client.py/blob/bcc95217f8bf80bed2ae5885a19fa0035da7ebc9/taskcluster/aio/hooks.py#L130-L144
taskcluster/taskcluster-client.py
taskcluster/aio/hooks.py
Hooks.removeHook
async def removeHook(self, *args, **kwargs): """ Delete a hook This endpoint will remove a hook definition. This method is ``stable`` """ return await self._makeApiCall(self.funcinfo["removeHook"], *args, **kwargs)
python
async def removeHook(self, *args, **kwargs): """ Delete a hook This endpoint will remove a hook definition. This method is ``stable`` """ return await self._makeApiCall(self.funcinfo["removeHook"], *args, **kwargs)
[ "async", "def", "removeHook", "(", "self", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "await", "self", ".", "_makeApiCall", "(", "self", ".", "funcinfo", "[", "\"removeHook\"", "]", ",", "*", "args", ",", "*", "*", "kwargs", ")" ]
Delete a hook This endpoint will remove a hook definition. This method is ``stable``
[ "Delete", "a", "hook" ]
train
https://github.com/taskcluster/taskcluster-client.py/blob/bcc95217f8bf80bed2ae5885a19fa0035da7ebc9/taskcluster/aio/hooks.py#L146-L155
taskcluster/taskcluster-client.py
taskcluster/aio/hooks.py
Hooks.triggerHook
async def triggerHook(self, *args, **kwargs): """ Trigger a hook This endpoint will trigger the creation of a task from a hook definition. The HTTP payload must match the hooks `triggerSchema`. If it does, it is provided as the `payload` property of the JSON-e context used to ...
python
async def triggerHook(self, *args, **kwargs): """ Trigger a hook This endpoint will trigger the creation of a task from a hook definition. The HTTP payload must match the hooks `triggerSchema`. If it does, it is provided as the `payload` property of the JSON-e context used to ...
[ "async", "def", "triggerHook", "(", "self", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "await", "self", ".", "_makeApiCall", "(", "self", ".", "funcinfo", "[", "\"triggerHook\"", "]", ",", "*", "args", ",", "*", "*", "kwargs", ")"...
Trigger a hook This endpoint will trigger the creation of a task from a hook definition. The HTTP payload must match the hooks `triggerSchema`. If it does, it is provided as the `payload` property of the JSON-e context used to render the task template. This method takes input...
[ "Trigger", "a", "hook" ]
train
https://github.com/taskcluster/taskcluster-client.py/blob/bcc95217f8bf80bed2ae5885a19fa0035da7ebc9/taskcluster/aio/hooks.py#L157-L174
taskcluster/taskcluster-client.py
taskcluster/aio/hooks.py
Hooks.getTriggerToken
async def getTriggerToken(self, *args, **kwargs): """ Get a trigger token Retrieve a unique secret token for triggering the specified hook. This token can be deactivated with `resetTriggerToken`. This method gives output: ``v1/trigger-token-response.json#`` This method...
python
async def getTriggerToken(self, *args, **kwargs): """ Get a trigger token Retrieve a unique secret token for triggering the specified hook. This token can be deactivated with `resetTriggerToken`. This method gives output: ``v1/trigger-token-response.json#`` This method...
[ "async", "def", "getTriggerToken", "(", "self", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "await", "self", ".", "_makeApiCall", "(", "self", ".", "funcinfo", "[", "\"getTriggerToken\"", "]", ",", "*", "args", ",", "*", "*", "kwargs...
Get a trigger token Retrieve a unique secret token for triggering the specified hook. This token can be deactivated with `resetTriggerToken`. This method gives output: ``v1/trigger-token-response.json#`` This method is ``stable``
[ "Get", "a", "trigger", "token" ]
train
https://github.com/taskcluster/taskcluster-client.py/blob/bcc95217f8bf80bed2ae5885a19fa0035da7ebc9/taskcluster/aio/hooks.py#L176-L188
taskcluster/taskcluster-client.py
taskcluster/aio/hooks.py
Hooks.resetTriggerToken
async def resetTriggerToken(self, *args, **kwargs): """ Reset a trigger token Reset the token for triggering a given hook. This invalidates token that may have been issued via getTriggerToken with a new token. This method gives output: ``v1/trigger-token-response.json#`` ...
python
async def resetTriggerToken(self, *args, **kwargs): """ Reset a trigger token Reset the token for triggering a given hook. This invalidates token that may have been issued via getTriggerToken with a new token. This method gives output: ``v1/trigger-token-response.json#`` ...
[ "async", "def", "resetTriggerToken", "(", "self", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "await", "self", ".", "_makeApiCall", "(", "self", ".", "funcinfo", "[", "\"resetTriggerToken\"", "]", ",", "*", "args", ",", "*", "*", "kw...
Reset a trigger token Reset the token for triggering a given hook. This invalidates token that may have been issued via getTriggerToken with a new token. This method gives output: ``v1/trigger-token-response.json#`` This method is ``stable``
[ "Reset", "a", "trigger", "token" ]
train
https://github.com/taskcluster/taskcluster-client.py/blob/bcc95217f8bf80bed2ae5885a19fa0035da7ebc9/taskcluster/aio/hooks.py#L190-L202
taskcluster/taskcluster-client.py
taskcluster/aio/hooks.py
Hooks.triggerHookWithToken
async def triggerHookWithToken(self, *args, **kwargs): """ Trigger a hook with a token This endpoint triggers a defined hook with a valid token. The HTTP payload must match the hooks `triggerSchema`. If it does, it is provided as the `payload` property of the JSON-e context us...
python
async def triggerHookWithToken(self, *args, **kwargs): """ Trigger a hook with a token This endpoint triggers a defined hook with a valid token. The HTTP payload must match the hooks `triggerSchema`. If it does, it is provided as the `payload` property of the JSON-e context us...
[ "async", "def", "triggerHookWithToken", "(", "self", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "await", "self", ".", "_makeApiCall", "(", "self", ".", "funcinfo", "[", "\"triggerHookWithToken\"", "]", ",", "*", "args", ",", "*", "*",...
Trigger a hook with a token This endpoint triggers a defined hook with a valid token. The HTTP payload must match the hooks `triggerSchema`. If it does, it is provided as the `payload` property of the JSON-e context used to render the task template. This method takes input: `...
[ "Trigger", "a", "hook", "with", "a", "token" ]
train
https://github.com/taskcluster/taskcluster-client.py/blob/bcc95217f8bf80bed2ae5885a19fa0035da7ebc9/taskcluster/aio/hooks.py#L204-L221
taskcluster/taskcluster-client.py
taskcluster/aio/awsprovisioner.py
AwsProvisioner.createWorkerType
async def createWorkerType(self, *args, **kwargs): """ Create new Worker Type Create a worker type. A worker type contains all the configuration needed for the provisioner to manage the instances. Each worker type knows which regions and which instance types are allowed for th...
python
async def createWorkerType(self, *args, **kwargs): """ Create new Worker Type Create a worker type. A worker type contains all the configuration needed for the provisioner to manage the instances. Each worker type knows which regions and which instance types are allowed for th...
[ "async", "def", "createWorkerType", "(", "self", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "await", "self", ".", "_makeApiCall", "(", "self", ".", "funcinfo", "[", "\"createWorkerType\"", "]", ",", "*", "args", ",", "*", "*", "kwar...
Create new Worker Type Create a worker type. A worker type contains all the configuration needed for the provisioner to manage the instances. Each worker type knows which regions and which instance types are allowed for that worker type. Remember that Capacity is the number of concur...
[ "Create", "new", "Worker", "Type" ]
train
https://github.com/taskcluster/taskcluster-client.py/blob/bcc95217f8bf80bed2ae5885a19fa0035da7ebc9/taskcluster/aio/awsprovisioner.py#L67-L102
taskcluster/taskcluster-client.py
taskcluster/aio/awsprovisioner.py
AwsProvisioner.updateWorkerType
async def updateWorkerType(self, *args, **kwargs): """ Update Worker Type Provide a new copy of a worker type to replace the existing one. This will overwrite the existing worker type definition if there is already a worker type of that name. This method will return a 2...
python
async def updateWorkerType(self, *args, **kwargs): """ Update Worker Type Provide a new copy of a worker type to replace the existing one. This will overwrite the existing worker type definition if there is already a worker type of that name. This method will return a 2...
[ "async", "def", "updateWorkerType", "(", "self", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "await", "self", ".", "_makeApiCall", "(", "self", ".", "funcinfo", "[", "\"updateWorkerType\"", "]", ",", "*", "args", ",", "*", "*", "kwar...
Update Worker Type Provide a new copy of a worker type to replace the existing one. This will overwrite the existing worker type definition if there is already a worker type of that name. This method will return a 200 response along with a copy of the worker type definition created ...
[ "Update", "Worker", "Type" ]
train
https://github.com/taskcluster/taskcluster-client.py/blob/bcc95217f8bf80bed2ae5885a19fa0035da7ebc9/taskcluster/aio/awsprovisioner.py#L104-L127
taskcluster/taskcluster-client.py
taskcluster/aio/awsprovisioner.py
AwsProvisioner.workerType
async def workerType(self, *args, **kwargs): """ Get Worker Type Retrieve a copy of the requested worker type definition. This copy contains a lastModified field as well as the worker type name. As such, it will require manipulation to be able to use the results of this...
python
async def workerType(self, *args, **kwargs): """ Get Worker Type Retrieve a copy of the requested worker type definition. This copy contains a lastModified field as well as the worker type name. As such, it will require manipulation to be able to use the results of this...
[ "async", "def", "workerType", "(", "self", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "await", "self", ".", "_makeApiCall", "(", "self", ".", "funcinfo", "[", "\"workerType\"", "]", ",", "*", "args", ",", "*", "*", "kwargs", ")" ]
Get Worker Type Retrieve a copy of the requested worker type definition. This copy contains a lastModified field as well as the worker type name. As such, it will require manipulation to be able to use the results of this method to submit date to the update method. Thi...
[ "Get", "Worker", "Type" ]
train
https://github.com/taskcluster/taskcluster-client.py/blob/bcc95217f8bf80bed2ae5885a19fa0035da7ebc9/taskcluster/aio/awsprovisioner.py#L146-L161
taskcluster/taskcluster-client.py
taskcluster/aio/awsprovisioner.py
AwsProvisioner.createSecret
async def createSecret(self, *args, **kwargs): """ Create new Secret Insert a secret into the secret storage. The supplied secrets will be provided verbatime via `getSecret`, while the supplied scopes will be converted into credentials by `getSecret`. This method is no...
python
async def createSecret(self, *args, **kwargs): """ Create new Secret Insert a secret into the secret storage. The supplied secrets will be provided verbatime via `getSecret`, while the supplied scopes will be converted into credentials by `getSecret`. This method is no...
[ "async", "def", "createSecret", "(", "self", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "await", "self", ".", "_makeApiCall", "(", "self", ".", "funcinfo", "[", "\"createSecret\"", "]", ",", "*", "args", ",", "*", "*", "kwargs", "...
Create new Secret Insert a secret into the secret storage. The supplied secrets will be provided verbatime via `getSecret`, while the supplied scopes will be converted into credentials by `getSecret`. This method is not ordinarily used in production; instead, the provisioner c...
[ "Create", "new", "Secret" ]
train
https://github.com/taskcluster/taskcluster-client.py/blob/bcc95217f8bf80bed2ae5885a19fa0035da7ebc9/taskcluster/aio/awsprovisioner.py#L199-L215
taskcluster/taskcluster-client.py
taskcluster/aio/awsprovisioner.py
AwsProvisioner.removeSecret
async def removeSecret(self, *args, **kwargs): """ Remove a Secret Remove a secret. After this call, a call to `getSecret` with the given token will return no information. It is very important that the consumer of a secret delete the secret from storage before handing ...
python
async def removeSecret(self, *args, **kwargs): """ Remove a Secret Remove a secret. After this call, a call to `getSecret` with the given token will return no information. It is very important that the consumer of a secret delete the secret from storage before handing ...
[ "async", "def", "removeSecret", "(", "self", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "await", "self", ".", "_makeApiCall", "(", "self", ".", "funcinfo", "[", "\"removeSecret\"", "]", ",", "*", "args", ",", "*", "*", "kwargs", "...
Remove a Secret Remove a secret. After this call, a call to `getSecret` with the given token will return no information. It is very important that the consumer of a secret delete the secret from storage before handing over control to untrusted processes to prevent credential a...
[ "Remove", "a", "Secret" ]
train
https://github.com/taskcluster/taskcluster-client.py/blob/bcc95217f8bf80bed2ae5885a19fa0035da7ebc9/taskcluster/aio/awsprovisioner.py#L251-L265
taskcluster/taskcluster-client.py
taskcluster/aio/awsprovisioner.py
AwsProvisioner.getLaunchSpecs
async def getLaunchSpecs(self, *args, **kwargs): """ Get All Launch Specifications for WorkerType This method returns a preview of all possible launch specifications that this worker type definition could submit to EC2. It is used to test worker types, nothing more **T...
python
async def getLaunchSpecs(self, *args, **kwargs): """ Get All Launch Specifications for WorkerType This method returns a preview of all possible launch specifications that this worker type definition could submit to EC2. It is used to test worker types, nothing more **T...
[ "async", "def", "getLaunchSpecs", "(", "self", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "await", "self", ".", "_makeApiCall", "(", "self", ".", "funcinfo", "[", "\"getLaunchSpecs\"", "]", ",", "*", "args", ",", "*", "*", "kwargs",...
Get All Launch Specifications for WorkerType This method returns a preview of all possible launch specifications that this worker type definition could submit to EC2. It is used to test worker types, nothing more **This API end-point is experimental and may be subject to change withou...
[ "Get", "All", "Launch", "Specifications", "for", "WorkerType" ]
train
https://github.com/taskcluster/taskcluster-client.py/blob/bcc95217f8bf80bed2ae5885a19fa0035da7ebc9/taskcluster/aio/awsprovisioner.py#L267-L282
taskcluster/taskcluster-client.py
taskcluster/aio/asyncutils.py
makeHttpRequest
async def makeHttpRequest(method, url, payload, headers, retries=utils.MAX_RETRIES, session=None): """ Make an HTTP request and retry it until success, return request """ retry = -1 response = None implicit = False if session is None: implicit = True session = aiohttp.ClientSession()...
python
async def makeHttpRequest(method, url, payload, headers, retries=utils.MAX_RETRIES, session=None): """ Make an HTTP request and retry it until success, return request """ retry = -1 response = None implicit = False if session is None: implicit = True session = aiohttp.ClientSession()...
[ "async", "def", "makeHttpRequest", "(", "method", ",", "url", ",", "payload", ",", "headers", ",", "retries", "=", "utils", ".", "MAX_RETRIES", ",", "session", "=", "None", ")", ":", "retry", "=", "-", "1", "response", "=", "None", "implicit", "=", "Fa...
Make an HTTP request and retry it until success, return request
[ "Make", "an", "HTTP", "request", "and", "retry", "it", "until", "success", "return", "request" ]
train
https://github.com/taskcluster/taskcluster-client.py/blob/bcc95217f8bf80bed2ae5885a19fa0035da7ebc9/taskcluster/aio/asyncutils.py#L21-L76
jart/fabulous
fabulous/text.py
resolve_font
def resolve_font(name): """Turns font names into absolute filenames This is case sensitive. The extension should be omitted. For example:: >>> path = resolve_font('NotoSans-Bold') >>> fontdir = os.path.join(os.path.dirname(__file__), 'fonts') >>> noto_path = os.path.join(fontdir,...
python
def resolve_font(name): """Turns font names into absolute filenames This is case sensitive. The extension should be omitted. For example:: >>> path = resolve_font('NotoSans-Bold') >>> fontdir = os.path.join(os.path.dirname(__file__), 'fonts') >>> noto_path = os.path.join(fontdir,...
[ "def", "resolve_font", "(", "name", ")", ":", "if", "os", ".", "path", ".", "exists", "(", "name", ")", ":", "return", "os", ".", "path", ".", "abspath", "(", "name", ")", "fonts", "=", "get_font_files", "(", ")", "if", "name", "in", "fonts", ":", ...
Turns font names into absolute filenames This is case sensitive. The extension should be omitted. For example:: >>> path = resolve_font('NotoSans-Bold') >>> fontdir = os.path.join(os.path.dirname(__file__), 'fonts') >>> noto_path = os.path.join(fontdir, 'NotoSans-Bold.ttf') >...
[ "Turns", "font", "names", "into", "absolute", "filenames" ]
train
https://github.com/jart/fabulous/blob/19903cf0a980b82f5928c3bec1f28b6bdd3785bd/fabulous/text.py#L143-L176
jart/fabulous
fabulous/text.py
get_font_files
def get_font_files(): """Returns a list of all font files we could find Returned as a list of dir/files tuples:: get_font_files() -> {'FontName': '/abs/FontName.ttf', ...] For example:: >>> fonts = get_font_files() >>> 'NotoSans-Bold' in fonts True >>> fonts['Noto...
python
def get_font_files(): """Returns a list of all font files we could find Returned as a list of dir/files tuples:: get_font_files() -> {'FontName': '/abs/FontName.ttf', ...] For example:: >>> fonts = get_font_files() >>> 'NotoSans-Bold' in fonts True >>> fonts['Noto...
[ "def", "get_font_files", "(", ")", ":", "roots", "=", "[", "'/usr/share/fonts/truetype'", ",", "# where ubuntu puts fonts", "'/usr/share/fonts'", ",", "# where fedora puts fonts", "os", ".", "path", ".", "expanduser", "(", "'~/.fonts'", ")", ",", "# custom user fonts", ...
Returns a list of all font files we could find Returned as a list of dir/files tuples:: get_font_files() -> {'FontName': '/abs/FontName.ttf', ...] For example:: >>> fonts = get_font_files() >>> 'NotoSans-Bold' in fonts True >>> fonts['NotoSans-Bold'].endswith('/NotoSa...
[ "Returns", "a", "list", "of", "all", "font", "files", "we", "could", "find" ]
train
https://github.com/jart/fabulous/blob/19903cf0a980b82f5928c3bec1f28b6bdd3785bd/fabulous/text.py#L180-L208
jart/fabulous
fabulous/text.py
main
def main(): """Main function for :command:`fabulous-text`.""" import optparse parser = optparse.OptionParser() parser.add_option( "-l", "--list", dest="list", action="store_true", default=False, help=("List available fonts")) parser.add_option( "-S", "--skew", dest="skew", ty...
python
def main(): """Main function for :command:`fabulous-text`.""" import optparse parser = optparse.OptionParser() parser.add_option( "-l", "--list", dest="list", action="store_true", default=False, help=("List available fonts")) parser.add_option( "-S", "--skew", dest="skew", ty...
[ "def", "main", "(", ")", ":", "import", "optparse", "parser", "=", "optparse", ".", "OptionParser", "(", ")", "parser", ".", "add_option", "(", "\"-l\"", ",", "\"--list\"", ",", "dest", "=", "\"list\"", ",", "action", "=", "\"store_true\"", ",", "default",...
Main function for :command:`fabulous-text`.
[ "Main", "function", "for", ":", "command", ":", "fabulous", "-", "text", "." ]
train
https://github.com/jart/fabulous/blob/19903cf0a980b82f5928c3bec1f28b6bdd3785bd/fabulous/text.py#L211-L258
taskcluster/taskcluster-client.py
taskcluster/purgecache.py
PurgeCache.purgeCache
def purgeCache(self, *args, **kwargs): """ Purge Worker Cache Publish a purge-cache message to purge caches named `cacheName` with `provisionerId` and `workerType` in the routing-key. Workers should be listening for this message and purge caches when they see it. This m...
python
def purgeCache(self, *args, **kwargs): """ Purge Worker Cache Publish a purge-cache message to purge caches named `cacheName` with `provisionerId` and `workerType` in the routing-key. Workers should be listening for this message and purge caches when they see it. This m...
[ "def", "purgeCache", "(", "self", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "self", ".", "_makeApiCall", "(", "self", ".", "funcinfo", "[", "\"purgeCache\"", "]", ",", "*", "args", ",", "*", "*", "kwargs", ")" ]
Purge Worker Cache Publish a purge-cache message to purge caches named `cacheName` with `provisionerId` and `workerType` in the routing-key. Workers should be listening for this message and purge caches when they see it. This method takes input: ``v1/purge-cache-request.json#`` ...
[ "Purge", "Worker", "Cache" ]
train
https://github.com/taskcluster/taskcluster-client.py/blob/bcc95217f8bf80bed2ae5885a19fa0035da7ebc9/taskcluster/purgecache.py#L40-L53
lepture/safe
safe/__init__.py
is_asdf
def is_asdf(raw): """If the password is in the order on keyboard.""" reverse = raw[::-1] asdf = ''.join(ASDF) return raw in asdf or reverse in asdf
python
def is_asdf(raw): """If the password is in the order on keyboard.""" reverse = raw[::-1] asdf = ''.join(ASDF) return raw in asdf or reverse in asdf
[ "def", "is_asdf", "(", "raw", ")", ":", "reverse", "=", "raw", "[", ":", ":", "-", "1", "]", "asdf", "=", "''", ".", "join", "(", "ASDF", ")", "return", "raw", "in", "asdf", "or", "reverse", "in", "asdf" ]
If the password is in the order on keyboard.
[ "If", "the", "password", "is", "in", "the", "order", "on", "keyboard", "." ]
train
https://github.com/lepture/safe/blob/038a72e59557caf97c1b93f66124a8f014eb032b/safe/__init__.py#L72-L78
lepture/safe
safe/__init__.py
is_by_step
def is_by_step(raw): """If the password is alphabet step by step.""" # make sure it is unicode delta = ord(raw[1]) - ord(raw[0]) for i in range(2, len(raw)): if ord(raw[i]) - ord(raw[i-1]) != delta: return False return True
python
def is_by_step(raw): """If the password is alphabet step by step.""" # make sure it is unicode delta = ord(raw[1]) - ord(raw[0]) for i in range(2, len(raw)): if ord(raw[i]) - ord(raw[i-1]) != delta: return False return True
[ "def", "is_by_step", "(", "raw", ")", ":", "# make sure it is unicode", "delta", "=", "ord", "(", "raw", "[", "1", "]", ")", "-", "ord", "(", "raw", "[", "0", "]", ")", "for", "i", "in", "range", "(", "2", ",", "len", "(", "raw", ")", ")", ":",...
If the password is alphabet step by step.
[ "If", "the", "password", "is", "alphabet", "step", "by", "step", "." ]
train
https://github.com/lepture/safe/blob/038a72e59557caf97c1b93f66124a8f014eb032b/safe/__init__.py#L81-L90
lepture/safe
safe/__init__.py
is_common_password
def is_common_password(raw, freq=0): """If the password is common used. 10k top passwords: https://xato.net/passwords/more-top-worst-passwords/ """ frequent = WORDS.get(raw, 0) if freq: return frequent > freq return bool(frequent)
python
def is_common_password(raw, freq=0): """If the password is common used. 10k top passwords: https://xato.net/passwords/more-top-worst-passwords/ """ frequent = WORDS.get(raw, 0) if freq: return frequent > freq return bool(frequent)
[ "def", "is_common_password", "(", "raw", ",", "freq", "=", "0", ")", ":", "frequent", "=", "WORDS", ".", "get", "(", "raw", ",", "0", ")", "if", "freq", ":", "return", "frequent", ">", "freq", "return", "bool", "(", "frequent", ")" ]
If the password is common used. 10k top passwords: https://xato.net/passwords/more-top-worst-passwords/
[ "If", "the", "password", "is", "common", "used", "." ]
train
https://github.com/lepture/safe/blob/038a72e59557caf97c1b93f66124a8f014eb032b/safe/__init__.py#L93-L101
lepture/safe
safe/__init__.py
check
def check(raw, length=8, freq=0, min_types=3, level=STRONG): """Check the safety level of the password. :param raw: raw text password. :param length: minimal length of the password. :param freq: minimum frequency. :param min_types: minimum character family. :param level: minimum level to valida...
python
def check(raw, length=8, freq=0, min_types=3, level=STRONG): """Check the safety level of the password. :param raw: raw text password. :param length: minimal length of the password. :param freq: minimum frequency. :param min_types: minimum character family. :param level: minimum level to valida...
[ "def", "check", "(", "raw", ",", "length", "=", "8", ",", "freq", "=", "0", ",", "min_types", "=", "3", ",", "level", "=", "STRONG", ")", ":", "raw", "=", "to_unicode", "(", "raw", ")", "if", "level", ">", "STRONG", ":", "level", "=", "STRONG", ...
Check the safety level of the password. :param raw: raw text password. :param length: minimal length of the password. :param freq: minimum frequency. :param min_types: minimum character family. :param level: minimum level to validate a password.
[ "Check", "the", "safety", "level", "of", "the", "password", "." ]
train
https://github.com/lepture/safe/blob/038a72e59557caf97c1b93f66124a8f014eb032b/safe/__init__.py#L142-L185
infobloxopen/infoblox-netmri
infoblox_netmri/client.py
InfobloxNetMRI._make_request
def _make_request(self, url, method="get", data=None, extra_headers=None): """Prepares the request, checks for authentication and retries in case of issues Args: url (str): URL of the request method (str): Any of "get", "post", "delete" data (any): Possible extra dat...
python
def _make_request(self, url, method="get", data=None, extra_headers=None): """Prepares the request, checks for authentication and retries in case of issues Args: url (str): URL of the request method (str): Any of "get", "post", "delete" data (any): Possible extra dat...
[ "def", "_make_request", "(", "self", ",", "url", ",", "method", "=", "\"get\"", ",", "data", "=", "None", ",", "extra_headers", "=", "None", ")", ":", "attempts", "=", "0", "while", "attempts", "<", "1", ":", "# Authenticate first if not authenticated already"...
Prepares the request, checks for authentication and retries in case of issues Args: url (str): URL of the request method (str): Any of "get", "post", "delete" data (any): Possible extra data to send with the request extra_headers (dict): Possible extra headers to...
[ "Prepares", "the", "request", "checks", "for", "authentication", "and", "retries", "in", "case", "of", "issues" ]
train
https://github.com/infobloxopen/infoblox-netmri/blob/e633bef1584101228b6d403df1de0d3d8e88d5c0/infoblox_netmri/client.py#L82-L110
infobloxopen/infoblox-netmri
infoblox_netmri/client.py
InfobloxNetMRI._send_request
def _send_request(self, url, method="get", data=None, extra_headers=None): """Performs a given request and returns a json object Args: url (str): URL of the request method (str): Any of "get", "post", "delete" data (any): Possible extra data to send with the request ...
python
def _send_request(self, url, method="get", data=None, extra_headers=None): """Performs a given request and returns a json object Args: url (str): URL of the request method (str): Any of "get", "post", "delete" data (any): Possible extra data to send with the request ...
[ "def", "_send_request", "(", "self", ",", "url", ",", "method", "=", "\"get\"", ",", "data", "=", "None", ",", "extra_headers", "=", "None", ")", ":", "headers", "=", "{", "'Content-type'", ":", "'application/json'", "}", "if", "isinstance", "(", "extra_he...
Performs a given request and returns a json object Args: url (str): URL of the request method (str): Any of "get", "post", "delete" data (any): Possible extra data to send with the request extra_headers (dict): Possible extra headers to send along in the request ...
[ "Performs", "a", "given", "request", "and", "returns", "a", "json", "object" ]
train
https://github.com/infobloxopen/infoblox-netmri/blob/e633bef1584101228b6d403df1de0d3d8e88d5c0/infoblox_netmri/client.py#L112-L133
infobloxopen/infoblox-netmri
infoblox_netmri/client.py
InfobloxNetMRI._get_api_version
def _get_api_version(self): """Fetches the most recent API version Returns: str """ url = "{base_url}/api/server_info".format(base_url=self._base_url()) server_info = self._make_request(url=url, method="get") return server_info["latest_api_version"]
python
def _get_api_version(self): """Fetches the most recent API version Returns: str """ url = "{base_url}/api/server_info".format(base_url=self._base_url()) server_info = self._make_request(url=url, method="get") return server_info["latest_api_version"]
[ "def", "_get_api_version", "(", "self", ")", ":", "url", "=", "\"{base_url}/api/server_info\"", ".", "format", "(", "base_url", "=", "self", ".", "_base_url", "(", ")", ")", "server_info", "=", "self", ".", "_make_request", "(", "url", "=", "url", ",", "me...
Fetches the most recent API version Returns: str
[ "Fetches", "the", "most", "recent", "API", "version" ]
train
https://github.com/infobloxopen/infoblox-netmri/blob/e633bef1584101228b6d403df1de0d3d8e88d5c0/infoblox_netmri/client.py#L135-L143
infobloxopen/infoblox-netmri
infoblox_netmri/client.py
InfobloxNetMRI._authenticate
def _authenticate(self): """ Perform an authentication against NetMRI""" url = "{base_url}/api/authenticate".format(base_url=self._base_url()) data = json.dumps({'username': self.username, "password": self.password}) # Bypass authentication check in make_request by using _send_request ...
python
def _authenticate(self): """ Perform an authentication against NetMRI""" url = "{base_url}/api/authenticate".format(base_url=self._base_url()) data = json.dumps({'username': self.username, "password": self.password}) # Bypass authentication check in make_request by using _send_request ...
[ "def", "_authenticate", "(", "self", ")", ":", "url", "=", "\"{base_url}/api/authenticate\"", ".", "format", "(", "base_url", "=", "self", ".", "_base_url", "(", ")", ")", "data", "=", "json", ".", "dumps", "(", "{", "'username'", ":", "self", ".", "user...
Perform an authentication against NetMRI
[ "Perform", "an", "authentication", "against", "NetMRI" ]
train
https://github.com/infobloxopen/infoblox-netmri/blob/e633bef1584101228b6d403df1de0d3d8e88d5c0/infoblox_netmri/client.py#L145-L152
infobloxopen/infoblox-netmri
infoblox_netmri/client.py
InfobloxNetMRI._controller_name
def _controller_name(self, objtype): """Determines the controller name for the object's type Args: objtype (str): The object type Returns: A string with the controller name """ # would be better to use inflect.pluralize here, but would add a dependency ...
python
def _controller_name(self, objtype): """Determines the controller name for the object's type Args: objtype (str): The object type Returns: A string with the controller name """ # would be better to use inflect.pluralize here, but would add a dependency ...
[ "def", "_controller_name", "(", "self", ",", "objtype", ")", ":", "# would be better to use inflect.pluralize here, but would add a dependency", "if", "objtype", ".", "endswith", "(", "'y'", ")", ":", "return", "objtype", "[", ":", "-", "1", "]", "+", "'ies'", "if...
Determines the controller name for the object's type Args: objtype (str): The object type Returns: A string with the controller name
[ "Determines", "the", "controller", "name", "for", "the", "object", "s", "type" ]
train
https://github.com/infobloxopen/infoblox-netmri/blob/e633bef1584101228b6d403df1de0d3d8e88d5c0/infoblox_netmri/client.py#L154-L173
infobloxopen/infoblox-netmri
infoblox_netmri/client.py
InfobloxNetMRI._object_url
def _object_url(self, objtype, objid): """Generate the URL for the specified object Args: objtype (str): The object's type objid (int): The objects ID Returns: A string containing the URL of the object """ return "{base_url}/api/{api_version}...
python
def _object_url(self, objtype, objid): """Generate the URL for the specified object Args: objtype (str): The object's type objid (int): The objects ID Returns: A string containing the URL of the object """ return "{base_url}/api/{api_version}...
[ "def", "_object_url", "(", "self", ",", "objtype", ",", "objid", ")", ":", "return", "\"{base_url}/api/{api_version}/{controller}/{obj_id}\"", ".", "format", "(", "base_url", "=", "self", ".", "_base_url", "(", ")", ",", "api_version", "=", "self", ".", "api_ver...
Generate the URL for the specified object Args: objtype (str): The object's type objid (int): The objects ID Returns: A string containing the URL of the object
[ "Generate", "the", "URL", "for", "the", "specified", "object" ]
train
https://github.com/infobloxopen/infoblox-netmri/blob/e633bef1584101228b6d403df1de0d3d8e88d5c0/infoblox_netmri/client.py#L186-L201
infobloxopen/infoblox-netmri
infoblox_netmri/client.py
InfobloxNetMRI._method_url
def _method_url(self, method_name): """Generate the URL for the requested method Args: method_name (str): Name of the method Returns: A string containing the URL of the method """ return "{base_url}/api/{api}/{method}".format( base_url=self._...
python
def _method_url(self, method_name): """Generate the URL for the requested method Args: method_name (str): Name of the method Returns: A string containing the URL of the method """ return "{base_url}/api/{api}/{method}".format( base_url=self._...
[ "def", "_method_url", "(", "self", ",", "method_name", ")", ":", "return", "\"{base_url}/api/{api}/{method}\"", ".", "format", "(", "base_url", "=", "self", ".", "_base_url", "(", ")", ",", "api", "=", "self", ".", "api_version", ",", "method", "=", "method_...
Generate the URL for the requested method Args: method_name (str): Name of the method Returns: A string containing the URL of the method
[ "Generate", "the", "URL", "for", "the", "requested", "method" ]
train
https://github.com/infobloxopen/infoblox-netmri/blob/e633bef1584101228b6d403df1de0d3d8e88d5c0/infoblox_netmri/client.py#L203-L216
infobloxopen/infoblox-netmri
infoblox_netmri/client.py
InfobloxNetMRI.api_request
def api_request(self, method_name, params): """Execute an arbitrary method. Args: method_name (str): include the controller name: 'devices/search' params (dict): the method parameters Returns: A dict with the response Raises: requests.exce...
python
def api_request(self, method_name, params): """Execute an arbitrary method. Args: method_name (str): include the controller name: 'devices/search' params (dict): the method parameters Returns: A dict with the response Raises: requests.exce...
[ "def", "api_request", "(", "self", ",", "method_name", ",", "params", ")", ":", "url", "=", "self", ".", "_method_url", "(", "method_name", ")", "data", "=", "json", ".", "dumps", "(", "params", ")", "return", "self", ".", "_make_request", "(", "url", ...
Execute an arbitrary method. Args: method_name (str): include the controller name: 'devices/search' params (dict): the method parameters Returns: A dict with the response Raises: requests.exceptions.HTTPError
[ "Execute", "an", "arbitrary", "method", "." ]
train
https://github.com/infobloxopen/infoblox-netmri/blob/e633bef1584101228b6d403df1de0d3d8e88d5c0/infoblox_netmri/client.py#L218-L231
infobloxopen/infoblox-netmri
infoblox_netmri/client.py
InfobloxNetMRI.show
def show(self, objtype, objid): """Query for a specific resource by ID Args: objtype (str): object type, e.g. 'device', 'interface' objid (int): object ID (DeviceID, etc.) Returns: A dict with that object Raises: requests.exceptions.HTTPEr...
python
def show(self, objtype, objid): """Query for a specific resource by ID Args: objtype (str): object type, e.g. 'device', 'interface' objid (int): object ID (DeviceID, etc.) Returns: A dict with that object Raises: requests.exceptions.HTTPEr...
[ "def", "show", "(", "self", ",", "objtype", ",", "objid", ")", ":", "url", "=", "self", ".", "_object_url", "(", "objtype", ",", "int", "(", "objid", ")", ")", "return", "self", ".", "_make_request", "(", "url", ",", "method", "=", "\"get\"", ")" ]
Query for a specific resource by ID Args: objtype (str): object type, e.g. 'device', 'interface' objid (int): object ID (DeviceID, etc.) Returns: A dict with that object Raises: requests.exceptions.HTTPError
[ "Query", "for", "a", "specific", "resource", "by", "ID" ]
train
https://github.com/infobloxopen/infoblox-netmri/blob/e633bef1584101228b6d403df1de0d3d8e88d5c0/infoblox_netmri/client.py#L233-L245
taskcluster/taskcluster-client.py
taskcluster/notify.py
Notify.irc
def irc(self, *args, **kwargs): """ Post IRC Message Post a message on IRC to a specific channel or user, or a specific user on a specific channel. Success of this API method does not imply the message was successfully posted. This API method merely inserts the IRC mess...
python
def irc(self, *args, **kwargs): """ Post IRC Message Post a message on IRC to a specific channel or user, or a specific user on a specific channel. Success of this API method does not imply the message was successfully posted. This API method merely inserts the IRC mess...
[ "def", "irc", "(", "self", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "self", ".", "_makeApiCall", "(", "self", ".", "funcinfo", "[", "\"irc\"", "]", ",", "*", "args", ",", "*", "*", "kwargs", ")" ]
Post IRC Message Post a message on IRC to a specific channel or user, or a specific user on a specific channel. Success of this API method does not imply the message was successfully posted. This API method merely inserts the IRC message into a queue that will be processed by a...
[ "Post", "IRC", "Message" ]
train
https://github.com/taskcluster/taskcluster-client.py/blob/bcc95217f8bf80bed2ae5885a19fa0035da7ebc9/taskcluster/notify.py#L66-L87
taskcluster/taskcluster-client.py
taskcluster/notify.py
Notify.addDenylistAddress
def addDenylistAddress(self, *args, **kwargs): """ Denylist Given Address Add the given address to the notification denylist. The address can be of either of the three supported address type namely pulse, email or IRC(user or channel). Addresses in the denylist will be ignored ...
python
def addDenylistAddress(self, *args, **kwargs): """ Denylist Given Address Add the given address to the notification denylist. The address can be of either of the three supported address type namely pulse, email or IRC(user or channel). Addresses in the denylist will be ignored ...
[ "def", "addDenylistAddress", "(", "self", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "self", ".", "_makeApiCall", "(", "self", ".", "funcinfo", "[", "\"addDenylistAddress\"", "]", ",", "*", "args", ",", "*", "*", "kwargs", ")" ]
Denylist Given Address Add the given address to the notification denylist. The address can be of either of the three supported address type namely pulse, email or IRC(user or channel). Addresses in the denylist will be ignored by the notification service. This method takes inpu...
[ "Denylist", "Given", "Address" ]
train
https://github.com/taskcluster/taskcluster-client.py/blob/bcc95217f8bf80bed2ae5885a19fa0035da7ebc9/taskcluster/notify.py#L89-L103
taskcluster/taskcluster-client.py
taskcluster/notify.py
Notify.deleteDenylistAddress
def deleteDenylistAddress(self, *args, **kwargs): """ Delete Denylisted Address Delete the specified address from the notification denylist. This method takes input: ``v1/notification-address.json#`` This method is ``experimental`` """ return self._makeApiCall...
python
def deleteDenylistAddress(self, *args, **kwargs): """ Delete Denylisted Address Delete the specified address from the notification denylist. This method takes input: ``v1/notification-address.json#`` This method is ``experimental`` """ return self._makeApiCall...
[ "def", "deleteDenylistAddress", "(", "self", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "self", ".", "_makeApiCall", "(", "self", ".", "funcinfo", "[", "\"deleteDenylistAddress\"", "]", ",", "*", "args", ",", "*", "*", "kwargs", ")" ]
Delete Denylisted Address Delete the specified address from the notification denylist. This method takes input: ``v1/notification-address.json#`` This method is ``experimental``
[ "Delete", "Denylisted", "Address" ]
train
https://github.com/taskcluster/taskcluster-client.py/blob/bcc95217f8bf80bed2ae5885a19fa0035da7ebc9/taskcluster/notify.py#L105-L116
taskcluster/taskcluster-client.py
taskcluster/notify.py
Notify.list
def list(self, *args, **kwargs): """ List Denylisted Notifications Lists all the denylisted addresses. By default this end-point will try to return up to 1000 addresses in one request. But it **may return less**, even if more tasks are available. It may also return a `c...
python
def list(self, *args, **kwargs): """ List Denylisted Notifications Lists all the denylisted addresses. By default this end-point will try to return up to 1000 addresses in one request. But it **may return less**, even if more tasks are available. It may also return a `c...
[ "def", "list", "(", "self", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "self", ".", "_makeApiCall", "(", "self", ".", "funcinfo", "[", "\"list\"", "]", ",", "*", "args", ",", "*", "*", "kwargs", ")" ]
List Denylisted Notifications Lists all the denylisted addresses. By default this end-point will try to return up to 1000 addresses in one request. But it **may return less**, even if more tasks are available. It may also return a `continuationToken` even though there are no more ...
[ "List", "Denylisted", "Notifications" ]
train
https://github.com/taskcluster/taskcluster-client.py/blob/bcc95217f8bf80bed2ae5885a19fa0035da7ebc9/taskcluster/notify.py#L118-L139
jart/fabulous
fabulous/compatibility.py
printy
def printy(s): """Python 2/3 compatible print-like function""" if hasattr(s, 'as_utf8'): if hasattr(sys.stdout, 'buffer'): sys.stdout.buffer.write(s.as_utf8) sys.stdout.buffer.write(b"\n") else: sys.stdout.write(s.as_utf8) sys.stdout.write(b"\n") ...
python
def printy(s): """Python 2/3 compatible print-like function""" if hasattr(s, 'as_utf8'): if hasattr(sys.stdout, 'buffer'): sys.stdout.buffer.write(s.as_utf8) sys.stdout.buffer.write(b"\n") else: sys.stdout.write(s.as_utf8) sys.stdout.write(b"\n") ...
[ "def", "printy", "(", "s", ")", ":", "if", "hasattr", "(", "s", ",", "'as_utf8'", ")", ":", "if", "hasattr", "(", "sys", ".", "stdout", ",", "'buffer'", ")", ":", "sys", ".", "stdout", ".", "buffer", ".", "write", "(", "s", ".", "as_utf8", ")", ...
Python 2/3 compatible print-like function
[ "Python", "2", "/", "3", "compatible", "print", "-", "like", "function" ]
train
https://github.com/jart/fabulous/blob/19903cf0a980b82f5928c3bec1f28b6bdd3785bd/fabulous/compatibility.py#L20-L30
taskcluster/taskcluster-client.py
taskcluster/authevents.py
AuthEvents.clientCreated
def clientCreated(self, *args, **kwargs): """ Client Created Messages Message that a new client has been created. This exchange outputs: ``v1/client-message.json#``This exchange takes the following keys: * reserved: Space reserved for future routing-key entries, you should al...
python
def clientCreated(self, *args, **kwargs): """ Client Created Messages Message that a new client has been created. This exchange outputs: ``v1/client-message.json#``This exchange takes the following keys: * reserved: Space reserved for future routing-key entries, you should al...
[ "def", "clientCreated", "(", "self", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "ref", "=", "{", "'exchange'", ":", "'client-created'", ",", "'name'", ":", "'clientCreated'", ",", "'routingKey'", ":", "[", "{", "'multipleWords'", ":", "True", "...
Client Created Messages Message that a new client has been created. This exchange outputs: ``v1/client-message.json#``This exchange takes the following keys: * reserved: Space reserved for future routing-key entries, you should always match this entry with `#`. As automatically done by our t...
[ "Client", "Created", "Messages" ]
train
https://github.com/taskcluster/taskcluster-client.py/blob/bcc95217f8bf80bed2ae5885a19fa0035da7ebc9/taskcluster/authevents.py#L32-L54
taskcluster/taskcluster-client.py
taskcluster/authevents.py
AuthEvents.clientUpdated
def clientUpdated(self, *args, **kwargs): """ Client Updated Messages Message that a new client has been updated. This exchange outputs: ``v1/client-message.json#``This exchange takes the following keys: * reserved: Space reserved for future routing-key entries, you should al...
python
def clientUpdated(self, *args, **kwargs): """ Client Updated Messages Message that a new client has been updated. This exchange outputs: ``v1/client-message.json#``This exchange takes the following keys: * reserved: Space reserved for future routing-key entries, you should al...
[ "def", "clientUpdated", "(", "self", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "ref", "=", "{", "'exchange'", ":", "'client-updated'", ",", "'name'", ":", "'clientUpdated'", ",", "'routingKey'", ":", "[", "{", "'multipleWords'", ":", "True", "...
Client Updated Messages Message that a new client has been updated. This exchange outputs: ``v1/client-message.json#``This exchange takes the following keys: * reserved: Space reserved for future routing-key entries, you should always match this entry with `#`. As automatically done by our t...
[ "Client", "Updated", "Messages" ]
train
https://github.com/taskcluster/taskcluster-client.py/blob/bcc95217f8bf80bed2ae5885a19fa0035da7ebc9/taskcluster/authevents.py#L56-L78
taskcluster/taskcluster-client.py
taskcluster/authevents.py
AuthEvents.clientDeleted
def clientDeleted(self, *args, **kwargs): """ Client Deleted Messages Message that a new client has been deleted. This exchange outputs: ``v1/client-message.json#``This exchange takes the following keys: * reserved: Space reserved for future routing-key entries, you should al...
python
def clientDeleted(self, *args, **kwargs): """ Client Deleted Messages Message that a new client has been deleted. This exchange outputs: ``v1/client-message.json#``This exchange takes the following keys: * reserved: Space reserved for future routing-key entries, you should al...
[ "def", "clientDeleted", "(", "self", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "ref", "=", "{", "'exchange'", ":", "'client-deleted'", ",", "'name'", ":", "'clientDeleted'", ",", "'routingKey'", ":", "[", "{", "'multipleWords'", ":", "True", "...
Client Deleted Messages Message that a new client has been deleted. This exchange outputs: ``v1/client-message.json#``This exchange takes the following keys: * reserved: Space reserved for future routing-key entries, you should always match this entry with `#`. As automatically done by our t...
[ "Client", "Deleted", "Messages" ]
train
https://github.com/taskcluster/taskcluster-client.py/blob/bcc95217f8bf80bed2ae5885a19fa0035da7ebc9/taskcluster/authevents.py#L80-L102
taskcluster/taskcluster-client.py
taskcluster/authevents.py
AuthEvents.roleCreated
def roleCreated(self, *args, **kwargs): """ Role Created Messages Message that a new role has been created. This exchange outputs: ``v1/role-message.json#``This exchange takes the following keys: * reserved: Space reserved for future routing-key entries, you should always mat...
python
def roleCreated(self, *args, **kwargs): """ Role Created Messages Message that a new role has been created. This exchange outputs: ``v1/role-message.json#``This exchange takes the following keys: * reserved: Space reserved for future routing-key entries, you should always mat...
[ "def", "roleCreated", "(", "self", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "ref", "=", "{", "'exchange'", ":", "'role-created'", ",", "'name'", ":", "'roleCreated'", ",", "'routingKey'", ":", "[", "{", "'multipleWords'", ":", "True", ",", ...
Role Created Messages Message that a new role has been created. This exchange outputs: ``v1/role-message.json#``This exchange takes the following keys: * reserved: Space reserved for future routing-key entries, you should always match this entry with `#`. As automatically done by our tooling...
[ "Role", "Created", "Messages" ]
train
https://github.com/taskcluster/taskcluster-client.py/blob/bcc95217f8bf80bed2ae5885a19fa0035da7ebc9/taskcluster/authevents.py#L104-L126
taskcluster/taskcluster-client.py
taskcluster/authevents.py
AuthEvents.roleUpdated
def roleUpdated(self, *args, **kwargs): """ Role Updated Messages Message that a new role has been updated. This exchange outputs: ``v1/role-message.json#``This exchange takes the following keys: * reserved: Space reserved for future routing-key entries, you should always mat...
python
def roleUpdated(self, *args, **kwargs): """ Role Updated Messages Message that a new role has been updated. This exchange outputs: ``v1/role-message.json#``This exchange takes the following keys: * reserved: Space reserved for future routing-key entries, you should always mat...
[ "def", "roleUpdated", "(", "self", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "ref", "=", "{", "'exchange'", ":", "'role-updated'", ",", "'name'", ":", "'roleUpdated'", ",", "'routingKey'", ":", "[", "{", "'multipleWords'", ":", "True", ",", ...
Role Updated Messages Message that a new role has been updated. This exchange outputs: ``v1/role-message.json#``This exchange takes the following keys: * reserved: Space reserved for future routing-key entries, you should always match this entry with `#`. As automatically done by our tooling...
[ "Role", "Updated", "Messages" ]
train
https://github.com/taskcluster/taskcluster-client.py/blob/bcc95217f8bf80bed2ae5885a19fa0035da7ebc9/taskcluster/authevents.py#L128-L150
taskcluster/taskcluster-client.py
taskcluster/authevents.py
AuthEvents.roleDeleted
def roleDeleted(self, *args, **kwargs): """ Role Deleted Messages Message that a new role has been deleted. This exchange outputs: ``v1/role-message.json#``This exchange takes the following keys: * reserved: Space reserved for future routing-key entries, you should always mat...
python
def roleDeleted(self, *args, **kwargs): """ Role Deleted Messages Message that a new role has been deleted. This exchange outputs: ``v1/role-message.json#``This exchange takes the following keys: * reserved: Space reserved for future routing-key entries, you should always mat...
[ "def", "roleDeleted", "(", "self", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "ref", "=", "{", "'exchange'", ":", "'role-deleted'", ",", "'name'", ":", "'roleDeleted'", ",", "'routingKey'", ":", "[", "{", "'multipleWords'", ":", "True", ",", ...
Role Deleted Messages Message that a new role has been deleted. This exchange outputs: ``v1/role-message.json#``This exchange takes the following keys: * reserved: Space reserved for future routing-key entries, you should always match this entry with `#`. As automatically done by our tooling...
[ "Role", "Deleted", "Messages" ]
train
https://github.com/taskcluster/taskcluster-client.py/blob/bcc95217f8bf80bed2ae5885a19fa0035da7ebc9/taskcluster/authevents.py#L152-L174
jart/fabulous
fabulous/utils.py
memoize
def memoize(function): """A very simple memoize decorator to optimize pure-ish functions Don't use this unless you've examined the code and see the potential risks. """ cache = {} @functools.wraps(function) def _memoize(*args): if args in cache: return cache[args] ...
python
def memoize(function): """A very simple memoize decorator to optimize pure-ish functions Don't use this unless you've examined the code and see the potential risks. """ cache = {} @functools.wraps(function) def _memoize(*args): if args in cache: return cache[args] ...
[ "def", "memoize", "(", "function", ")", ":", "cache", "=", "{", "}", "@", "functools", ".", "wraps", "(", "function", ")", "def", "_memoize", "(", "*", "args", ")", ":", "if", "args", "in", "cache", ":", "return", "cache", "[", "args", "]", "result...
A very simple memoize decorator to optimize pure-ish functions Don't use this unless you've examined the code and see the potential risks.
[ "A", "very", "simple", "memoize", "decorator", "to", "optimize", "pure", "-", "ish", "functions" ]
train
https://github.com/jart/fabulous/blob/19903cf0a980b82f5928c3bec1f28b6bdd3785bd/fabulous/utils.py#L34-L48
jart/fabulous
fabulous/utils.py
TerminalInfo.dimensions
def dimensions(self): """Returns terminal dimensions Don't save this information for long periods of time because the user might resize their terminal. :return: Returns ``(width, height)``. If there's no terminal to be found, we'll just return ``(79, 40)``. ""...
python
def dimensions(self): """Returns terminal dimensions Don't save this information for long periods of time because the user might resize their terminal. :return: Returns ``(width, height)``. If there's no terminal to be found, we'll just return ``(79, 40)``. ""...
[ "def", "dimensions", "(", "self", ")", ":", "try", ":", "call", "=", "fcntl", ".", "ioctl", "(", "self", ".", "termfd", ",", "termios", ".", "TIOCGWINSZ", ",", "\"\\000\"", "*", "8", ")", "except", "IOError", ":", "return", "(", "79", ",", "40", ")...
Returns terminal dimensions Don't save this information for long periods of time because the user might resize their terminal. :return: Returns ``(width, height)``. If there's no terminal to be found, we'll just return ``(79, 40)``.
[ "Returns", "terminal", "dimensions" ]
train
https://github.com/jart/fabulous/blob/19903cf0a980b82f5928c3bec1f28b6bdd3785bd/fabulous/utils.py#L100-L115