nwo
stringlengths
5
106
sha
stringlengths
40
40
path
stringlengths
4
174
language
stringclasses
1 value
identifier
stringlengths
1
140
parameters
stringlengths
0
87.7k
argument_list
stringclasses
1 value
return_statement
stringlengths
0
426k
docstring
stringlengths
0
64.3k
docstring_summary
stringlengths
0
26.3k
docstring_tokens
list
function
stringlengths
18
4.83M
function_tokens
list
url
stringlengths
83
304
ghostop14/sparrow-wifi
4b8289773ea4304872062f65a6ffc9352612b08e
sparrowdialogs.py
python
BluetoothDialog.showNTContextMenu
(self, pos)
[]
def showNTContextMenu(self, pos): curRow = self.bluetoothTable.currentRow() if curRow == -1: return self.ntRightClickMenu.exec_(self.bluetoothTable.mapToGlobal(pos))
[ "def", "showNTContextMenu", "(", "self", ",", "pos", ")", ":", "curRow", "=", "self", ".", "bluetoothTable", ".", "currentRow", "(", ")", "if", "curRow", "==", "-", "1", ":", "return", "self", ".", "ntRightClickMenu", ".", "exec_", "(", "self", ".", "b...
https://github.com/ghostop14/sparrow-wifi/blob/4b8289773ea4304872062f65a6ffc9352612b08e/sparrowdialogs.py#L1415-L1421
hanskrupakar/COCO-Style-Dataset-Generator-GUI
35c095a815a6ef97d2e820d175bf46e32e59f40b
coco_dataset_generator/gui/poly_editor.py
python
PolygonInteractor.get_ind_under_point
(self, event)
return ind
get the index of the vertex under point if within epsilon tolerance
get the index of the vertex under point if within epsilon tolerance
[ "get", "the", "index", "of", "the", "vertex", "under", "point", "if", "within", "epsilon", "tolerance" ]
def get_ind_under_point(self, event): 'get the index of the vertex under point if within epsilon tolerance' # display coords xy = np.asarray(self.poly.xy) xyt = self.poly.get_transform().transform(xy) xt, yt = xyt[:, 0], xyt[:, 1] d = np.hypot(xt - event.x, yt - event.y)...
[ "def", "get_ind_under_point", "(", "self", ",", "event", ")", ":", "# display coords", "xy", "=", "np", ".", "asarray", "(", "self", ".", "poly", ".", "xy", ")", "xyt", "=", "self", ".", "poly", ".", "get_transform", "(", ")", ".", "transform", "(", ...
https://github.com/hanskrupakar/COCO-Style-Dataset-Generator-GUI/blob/35c095a815a6ef97d2e820d175bf46e32e59f40b/coco_dataset_generator/gui/poly_editor.py#L91-L105
rwth-i6/returnn
f2d718a197a280b0d5f0fd91a7fcb8658560dddb
returnn/tf/util/data.py
python
Data.copy_template_set_ctx
(self, ctx)
return Data(**kwargs)
:param ControlFlowContext ctx: :return: new Data instance :rtype: Data
:param ControlFlowContext ctx: :return: new Data instance :rtype: Data
[ ":", "param", "ControlFlowContext", "ctx", ":", ":", "return", ":", "new", "Data", "instance", ":", "rtype", ":", "Data" ]
def copy_template_set_ctx(self, ctx): """ :param ControlFlowContext ctx: :return: new Data instance :rtype: Data """ kwargs = self.get_kwargs() kwargs["control_flow_ctx"] = ctx return Data(**kwargs)
[ "def", "copy_template_set_ctx", "(", "self", ",", "ctx", ")", ":", "kwargs", "=", "self", ".", "get_kwargs", "(", ")", "kwargs", "[", "\"control_flow_ctx\"", "]", "=", "ctx", "return", "Data", "(", "*", "*", "kwargs", ")" ]
https://github.com/rwth-i6/returnn/blob/f2d718a197a280b0d5f0fd91a7fcb8658560dddb/returnn/tf/util/data.py#L3820-L3828
travisgoodspeed/goodfet
1750cc1e8588af5470385e52fa098ca7364c2863
contrib/hoder/GoodFETMCPCAN_ted.py
python
GoodFETMCPCAN.poke8
(self,adr,val)
return val
Poke a value into RAM. Untested
Poke a value into RAM. Untested
[ "Poke", "a", "value", "into", "RAM", ".", "Untested" ]
def poke8(self,adr,val): """Poke a value into RAM. Untested""" self.SPItrans([0x02,adr&0xFF,val&0xFF]); newval=self.peek8(adr); if newval!=val: print "Failed to poke %02x to %02x. Got %02x." % (adr,val,newval); print "Are you not in idle mode?"; return v...
[ "def", "poke8", "(", "self", ",", "adr", ",", "val", ")", ":", "self", ".", "SPItrans", "(", "[", "0x02", ",", "adr", "&", "0xFF", ",", "val", "&", "0xFF", "]", ")", "newval", "=", "self", ".", "peek8", "(", "adr", ")", "if", "newval", "!=", ...
https://github.com/travisgoodspeed/goodfet/blob/1750cc1e8588af5470385e52fa098ca7364c2863/contrib/hoder/GoodFETMCPCAN_ted.py#L282-L289
AutodeskRoboticsLab/Mimic
85447f0d346be66988303a6a054473d92f1ed6f4
mimic/scripts/extern/pyqtgraph_0_11_0/pyqtgraph/flowchart/Flowchart.py
python
Flowchart.saveState
(self)
return state
Return a serializable data structure representing the current state of this flowchart.
Return a serializable data structure representing the current state of this flowchart.
[ "Return", "a", "serializable", "data", "structure", "representing", "the", "current", "state", "of", "this", "flowchart", "." ]
def saveState(self): """Return a serializable data structure representing the current state of this flowchart. """ state = Node.saveState(self) state['nodes'] = [] state['connects'] = [] for name, node in self._nodes.items(): cls = type(node) ...
[ "def", "saveState", "(", "self", ")", ":", "state", "=", "Node", ".", "saveState", "(", "self", ")", "state", "[", "'nodes'", "]", "=", "[", "]", "state", "[", "'connects'", "]", "=", "[", "]", "for", "name", ",", "node", "in", "self", ".", "_nod...
https://github.com/AutodeskRoboticsLab/Mimic/blob/85447f0d346be66988303a6a054473d92f1ed6f4/mimic/scripts/extern/pyqtgraph_0_11_0/pyqtgraph/flowchart/Flowchart.py#L447-L469
aliyun/aliyun-oss-python-sdk
5f2afa0928a58c7c1cc6317ac147f3637481f6fd
oss2/models.py
python
InventoryConfiguration.__init__
(self, inventory_id=None, is_enabled=None, included_object_versions=None, inventory_filter=None, inventory_destination=None, inventory_schedule=None, optional_fields=None)
[]
def __init__(self, inventory_id=None, is_enabled=None, included_object_versions=None, inventory_filter=None, inventory_destination=None, inventory_schedule=None, optional_fields=None): self.inventory_id = inventory_id ...
[ "def", "__init__", "(", "self", ",", "inventory_id", "=", "None", ",", "is_enabled", "=", "None", ",", "included_object_versions", "=", "None", ",", "inventory_filter", "=", "None", ",", "inventory_destination", "=", "None", ",", "inventory_schedule", "=", "None...
https://github.com/aliyun/aliyun-oss-python-sdk/blob/5f2afa0928a58c7c1cc6317ac147f3637481f6fd/oss2/models.py#L1835-L1850
dropbox/dropbox-sdk-python
015437429be224732990041164a21a0501235db1
dropbox/team_log.py
python
AdminAlertGeneralStateEnum.is_dismissed
(self)
return self._tag == 'dismissed'
Check if the union tag is ``dismissed``. :rtype: bool
Check if the union tag is ``dismissed``.
[ "Check", "if", "the", "union", "tag", "is", "dismissed", "." ]
def is_dismissed(self): """ Check if the union tag is ``dismissed``. :rtype: bool """ return self._tag == 'dismissed'
[ "def", "is_dismissed", "(", "self", ")", ":", "return", "self", ".", "_tag", "==", "'dismissed'" ]
https://github.com/dropbox/dropbox-sdk-python/blob/015437429be224732990041164a21a0501235db1/dropbox/team_log.py#L1200-L1206
regel/loudml
0008baef02259a8ae81dd210d3f91a51ffc9ed9f
loudml/mongo.py
python
MongoBucket.insert_times_data
( self, ts, data, tags=None, *args, **kwargs )
Insert data
Insert data
[ "Insert", "data" ]
def insert_times_data( self, ts, data, tags=None, *args, **kwargs ): """ Insert data """ ts = make_ts(ts) data = data.copy() data[self.timestamp_field] = ts self.insert_data(data, tags=tags)
[ "def", "insert_times_data", "(", "self", ",", "ts", ",", "data", ",", "tags", "=", "None", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "ts", "=", "make_ts", "(", "ts", ")", "data", "=", "data", ".", "copy", "(", ")", "data", "[", "self...
https://github.com/regel/loudml/blob/0008baef02259a8ae81dd210d3f91a51ffc9ed9f/loudml/mongo.py#L180-L196
QCoDeS/Qcodes
3cda2cef44812e2aa4672781f2423bf5f816f9f9
qcodes/dataset/linked_datasets/links.py
python
links_to_str
(links: List[Link])
return output
Convert a list of links to string. Note that this is the output that gets stored in the DB file
Convert a list of links to string. Note that this is the output that gets stored in the DB file
[ "Convert", "a", "list", "of", "links", "to", "string", ".", "Note", "that", "this", "is", "the", "output", "that", "gets", "stored", "in", "the", "DB", "file" ]
def links_to_str(links: List[Link]) -> str: """ Convert a list of links to string. Note that this is the output that gets stored in the DB file """ output = json.dumps([link_to_str(link) for link in links]) return output
[ "def", "links_to_str", "(", "links", ":", "List", "[", "Link", "]", ")", "->", "str", ":", "output", "=", "json", ".", "dumps", "(", "[", "link_to_str", "(", "link", ")", "for", "link", "in", "links", "]", ")", "return", "output" ]
https://github.com/QCoDeS/Qcodes/blob/3cda2cef44812e2aa4672781f2423bf5f816f9f9/qcodes/dataset/linked_datasets/links.py#L65-L71
F8LEFT/DecLLVM
d38e45e3d0dd35634adae1d0cf7f96f3bd96e74c
python/idaapi.py
python
func_t.is_far
(self, *args)
return _idaapi.func_t_is_far(self, *args)
is_far(self) -> bool
is_far(self) -> bool
[ "is_far", "(", "self", ")", "-", ">", "bool" ]
def is_far(self, *args): """ is_far(self) -> bool """ return _idaapi.func_t_is_far(self, *args)
[ "def", "is_far", "(", "self", ",", "*", "args", ")", ":", "return", "_idaapi", ".", "func_t_is_far", "(", "self", ",", "*", "args", ")" ]
https://github.com/F8LEFT/DecLLVM/blob/d38e45e3d0dd35634adae1d0cf7f96f3bd96e74c/python/idaapi.py#L27421-L27425
chaoss/grimoirelab-perceval
ba19bfd5e40bffdd422ca8e68526326b47f97491
perceval/backends/core/gitter.py
python
Gitter.fetch_items
(self, category, **kwargs)
Fetch the messages. :param category: the category of items to fetch :param kwargs: backend arguments :returns: a generator of items
Fetch the messages.
[ "Fetch", "the", "messages", "." ]
def fetch_items(self, category, **kwargs): """Fetch the messages. :param category: the category of items to fetch :param kwargs: backend arguments :returns: a generator of items """ from_date = kwargs['from_date'] logger.debug("Get Gitter message paginated item...
[ "def", "fetch_items", "(", "self", ",", "category", ",", "*", "*", "kwargs", ")", ":", "from_date", "=", "kwargs", "[", "'from_date'", "]", "logger", ".", "debug", "(", "\"Get Gitter message paginated items of room: %s from date: %s\"", ",", "self", ".", "room", ...
https://github.com/chaoss/grimoirelab-perceval/blob/ba19bfd5e40bffdd422ca8e68526326b47f97491/perceval/backends/core/gitter.py#L127-L177
tensorflow/models
6b8bb0cbeb3e10415c7a87448f08adc3c484c1d3
official/vision/beta/serving/detection.py
python
DetectionModule.serve
(self, images: tf.Tensor)
return final_outputs
Cast image to float and run inference. Args: images: uint8 Tensor of shape [batch_size, None, None, 3] Returns: Tensor holding detection output logits.
Cast image to float and run inference.
[ "Cast", "image", "to", "float", "and", "run", "inference", "." ]
def serve(self, images: tf.Tensor): """Cast image to float and run inference. Args: images: uint8 Tensor of shape [batch_size, None, None, 3] Returns: Tensor holding detection output logits. """ # Skip image preprocessing when input_type is tflite so it is compatible # with TFLite ...
[ "def", "serve", "(", "self", ",", "images", ":", "tf", ".", "Tensor", ")", ":", "# Skip image preprocessing when input_type is tflite so it is compatible", "# with TFLite quantization.", "if", "self", ".", "_input_type", "!=", "'tflite'", ":", "images", ",", "anchor_box...
https://github.com/tensorflow/models/blob/6b8bb0cbeb3e10415c7a87448f08adc3c484c1d3/official/vision/beta/serving/detection.py#L131-L206
prompt-toolkit/pyvim
210816b4b1d2dc00606ec924dda29e49ac4cd87c
pyvim/editor.py
python
Editor.show_message
(self, message)
Set a warning message. The layout will render it as a "pop-up" at the bottom.
Set a warning message. The layout will render it as a "pop-up" at the bottom.
[ "Set", "a", "warning", "message", ".", "The", "layout", "will", "render", "it", "as", "a", "pop", "-", "up", "at", "the", "bottom", "." ]
def show_message(self, message): """ Set a warning message. The layout will render it as a "pop-up" at the bottom. """ self.message = message
[ "def", "show_message", "(", "self", ",", "message", ")", ":", "self", ".", "message", "=", "message" ]
https://github.com/prompt-toolkit/pyvim/blob/210816b4b1d2dc00606ec924dda29e49ac4cd87c/pyvim/editor.py#L212-L217
veegee/guv
d7bac2ca6a73cc2059969af08223b82f3e187922
guv/greenthread.py
python
sleep
(seconds=0)
Yield control to the hub until at least `seconds` have elapsed :param float seconds: time to sleep for
Yield control to the hub until at least `seconds` have elapsed
[ "Yield", "control", "to", "the", "hub", "until", "at", "least", "seconds", "have", "elapsed" ]
def sleep(seconds=0): """Yield control to the hub until at least `seconds` have elapsed :param float seconds: time to sleep for """ hub = hubs.get_hub() current = greenlet.getcurrent() assert hub is not current, 'do not call blocking functions from the hub' timer = hub.schedule_call_global(...
[ "def", "sleep", "(", "seconds", "=", "0", ")", ":", "hub", "=", "hubs", ".", "get_hub", "(", ")", "current", "=", "greenlet", ".", "getcurrent", "(", ")", "assert", "hub", "is", "not", "current", ",", "'do not call blocking functions from the hub'", "timer",...
https://github.com/veegee/guv/blob/d7bac2ca6a73cc2059969af08223b82f3e187922/guv/greenthread.py#L11-L23
awslabs/aws-ec2rescue-linux
8ecf40e7ea0d2563dac057235803fca2221029d2
lib/requests/packages/urllib3/packages/ordered_dict.py
python
OrderedDict.__eq__
(self, other)
return dict.__eq__(self, other)
od.__eq__(y) <==> od==y. Comparison to another OD is order-sensitive while comparison to a regular mapping is order-insensitive.
od.__eq__(y) <==> od==y. Comparison to another OD is order-sensitive while comparison to a regular mapping is order-insensitive.
[ "od", ".", "__eq__", "(", "y", ")", "<", "==", ">", "od", "==", "y", ".", "Comparison", "to", "another", "OD", "is", "order", "-", "sensitive", "while", "comparison", "to", "a", "regular", "mapping", "is", "order", "-", "insensitive", "." ]
def __eq__(self, other): '''od.__eq__(y) <==> od==y. Comparison to another OD is order-sensitive while comparison to a regular mapping is order-insensitive. ''' if isinstance(other, OrderedDict): return len(self)==len(other) and self.items() == other.items() return ...
[ "def", "__eq__", "(", "self", ",", "other", ")", ":", "if", "isinstance", "(", "other", ",", "OrderedDict", ")", ":", "return", "len", "(", "self", ")", "==", "len", "(", "other", ")", "and", "self", ".", "items", "(", ")", "==", "other", ".", "i...
https://github.com/awslabs/aws-ec2rescue-linux/blob/8ecf40e7ea0d2563dac057235803fca2221029d2/lib/requests/packages/urllib3/packages/ordered_dict.py#L235-L242
cloudera/hue
23f02102d4547c17c32bd5ea0eb24e9eadd657a4
apps/beeswax/gen-py/hive_metastore/ThriftHiveMetastore.py
python
Iface.get_role_grants_for_principal
(self, request)
Parameters: - request
Parameters: - request
[ "Parameters", ":", "-", "request" ]
def get_role_grants_for_principal(self, request): """ Parameters: - request """ pass
[ "def", "get_role_grants_for_principal", "(", "self", ",", "request", ")", ":", "pass" ]
https://github.com/cloudera/hue/blob/23f02102d4547c17c32bd5ea0eb24e9eadd657a4/apps/beeswax/gen-py/hive_metastore/ThriftHiveMetastore.py#L1030-L1036
ifwe/digsby
f5fe00244744aa131e07f09348d10563f3d8fa99
digsby/src/util/BeautifulSoup.py
python
PageElement.findPreviousSiblings
(self, name=None, attrs={}, text=None, limit=None, **kwargs)
return self._findAll(name, attrs, text, limit, self.previousSiblingGenerator, **kwargs)
Returns the siblings of this Tag that match the given criteria and appear before this Tag in the document.
Returns the siblings of this Tag that match the given criteria and appear before this Tag in the document.
[ "Returns", "the", "siblings", "of", "this", "Tag", "that", "match", "the", "given", "criteria", "and", "appear", "before", "this", "Tag", "in", "the", "document", "." ]
def findPreviousSiblings(self, name=None, attrs={}, text=None, limit=None, **kwargs): """Returns the siblings of this Tag that match the given criteria and appear before this Tag in the document.""" return self._findAll(name, attrs, text, limit, ...
[ "def", "findPreviousSiblings", "(", "self", ",", "name", "=", "None", ",", "attrs", "=", "{", "}", ",", "text", "=", "None", ",", "limit", "=", "None", ",", "*", "*", "kwargs", ")", ":", "return", "self", ".", "_findAll", "(", "name", ",", "attrs",...
https://github.com/ifwe/digsby/blob/f5fe00244744aa131e07f09348d10563f3d8fa99/digsby/src/util/BeautifulSoup.py#L259-L264
openedx/edx-platform
68dd185a0ab45862a2a61e0f803d7e03d2be71b5
lms/djangoapps/program_enrollments/api/writing.py
python
change_program_enrollment_status
(program_enrollment, new_status)
return program_enrollment.status
Update a program enrollment with a new status. Arguments: program_enrollment (ProgramEnrollment) status (str): from ProgramCourseEnrollmentStatuses Returns: str String from ProgramOperationStatuses.
Update a program enrollment with a new status.
[ "Update", "a", "program", "enrollment", "with", "a", "new", "status", "." ]
def change_program_enrollment_status(program_enrollment, new_status): """ Update a program enrollment with a new status. Arguments: program_enrollment (ProgramEnrollment) status (str): from ProgramCourseEnrollmentStatuses Returns: str String from ProgramOperationStatuses. "...
[ "def", "change_program_enrollment_status", "(", "program_enrollment", ",", "new_status", ")", ":", "if", "new_status", "not", "in", "ProgramEnrollmentStatuses", ".", "__ALL__", ":", "return", "ProgramOpStatuses", ".", "INVALID_STATUS", "program_enrollment", ".", "status",...
https://github.com/openedx/edx-platform/blob/68dd185a0ab45862a2a61e0f803d7e03d2be71b5/lms/djangoapps/program_enrollments/api/writing.py#L153-L168
OpenMDAO/OpenMDAO
f47eb5485a0bb5ea5d2ae5bd6da4b94dc6b296bd
openmdao/devtools/iprofile.py
python
_iter_raw_prof_file
(rawname)
Returns an iterator of (funcpath, count, elapsed_time) from a raw profile data file.
Returns an iterator of (funcpath, count, elapsed_time) from a raw profile data file.
[ "Returns", "an", "iterator", "of", "(", "funcpath", "count", "elapsed_time", ")", "from", "a", "raw", "profile", "data", "file", "." ]
def _iter_raw_prof_file(rawname): """ Returns an iterator of (funcpath, count, elapsed_time) from a raw profile data file. """ with open(rawname, 'r') as f: for line in f: path, count, elapsed = line.split() yield path, int(count), float(elapsed)
[ "def", "_iter_raw_prof_file", "(", "rawname", ")", ":", "with", "open", "(", "rawname", ",", "'r'", ")", "as", "f", ":", "for", "line", "in", "f", ":", "path", ",", "count", ",", "elapsed", "=", "line", ".", "split", "(", ")", "yield", "path", ",",...
https://github.com/OpenMDAO/OpenMDAO/blob/f47eb5485a0bb5ea5d2ae5bd6da4b94dc6b296bd/openmdao/devtools/iprofile.py#L210-L218
hezhangsprinter/DCPDN
4f27d1940512dd7637a88aaba40d5d5f5fb3ff74
models/dehaze22.py
python
D1.__init__
(self, nc, ndf, hidden_size)
self.deconv1 = nn.Sequential(nn.Conv2d(ndf,nc,kernel_size=3,stride=1,padding=1), nn.Tanh())
self.deconv1 = nn.Sequential(nn.Conv2d(ndf,nc,kernel_size=3,stride=1,padding=1), nn.Tanh())
[ "self", ".", "deconv1", "=", "nn", ".", "Sequential", "(", "nn", ".", "Conv2d", "(", "ndf", "nc", "kernel_size", "=", "3", "stride", "=", "1", "padding", "=", "1", ")", "nn", ".", "Tanh", "()", ")" ]
def __init__(self, nc, ndf, hidden_size): super(D1, self).__init__() # 256 self.conv1 = nn.Sequential(nn.Conv2d(nc,ndf,kernel_size=3,stride=1,padding=1), nn.ELU(True)) # 256 self.conv2 = conv_block(ndf,ndf) # 128 self.conv3 = conv_block(ndf, ndf*2) # 64 ...
[ "def", "__init__", "(", "self", ",", "nc", ",", "ndf", ",", "hidden_size", ")", ":", "super", "(", "D1", ",", "self", ")", ".", "__init__", "(", ")", "# 256", "self", ".", "conv1", "=", "nn", ".", "Sequential", "(", "nn", ".", "Conv2d", "(", "nc"...
https://github.com/hezhangsprinter/DCPDN/blob/4f27d1940512dd7637a88aaba40d5d5f5fb3ff74/models/dehaze22.py#L69-L100
demisto/content
5c664a65b992ac8ca90ac3f11b1b2cdf11ee9b07
Packs/PassiveTotal/Integrations/PassiveTotal_v2/PassiveTotal_v2.py
python
get_host_attribute_context_data
(records: List[Dict[str, Any]])
return standard_results, custom_ec
Prepares context data for get components and get trackers command :param records: API response :return: standard entry command results list and custom entry context
Prepares context data for get components and get trackers command
[ "Prepares", "context", "data", "for", "get", "components", "and", "get", "trackers", "command" ]
def get_host_attribute_context_data(records: List[Dict[str, Any]]) -> Tuple[list, list]: """ Prepares context data for get components and get trackers command :param records: API response :return: standard entry command results list and custom entry context """ custom_ec = createContext(data=re...
[ "def", "get_host_attribute_context_data", "(", "records", ":", "List", "[", "Dict", "[", "str", ",", "Any", "]", "]", ")", "->", "Tuple", "[", "list", ",", "list", "]", ":", "custom_ec", "=", "createContext", "(", "data", "=", "records", ",", "removeNull...
https://github.com/demisto/content/blob/5c664a65b992ac8ca90ac3f11b1b2cdf11ee9b07/Packs/PassiveTotal/Integrations/PassiveTotal_v2/PassiveTotal_v2.py#L261-L294
xmunoz/sodapy
8a815a7ac3f4d955f0ac7f9b525c8755584179b4
sodapy/socrata.py
python
Socrata._perform_update
(self, method, resource, payload)
return response
Execute the update task.
Execute the update task.
[ "Execute", "the", "update", "task", "." ]
def _perform_update(self, method, resource, payload): """ Execute the update task. """ if isinstance(payload, (dict, list)): response = self._perform_request(method, resource, data=json.dumps(payload)) elif isinstance(payload, IOBase): headers = { ...
[ "def", "_perform_update", "(", "self", ",", "method", ",", "resource", ",", "payload", ")", ":", "if", "isinstance", "(", "payload", ",", "(", "dict", ",", "list", ")", ")", ":", "response", "=", "self", ".", "_perform_request", "(", "method", ",", "re...
https://github.com/xmunoz/sodapy/blob/8a815a7ac3f4d955f0ac7f9b525c8755584179b4/sodapy/socrata.py#L495-L515
kuri65536/python-for-android
26402a08fc46b09ef94e8d7a6bbc3a54ff9d0891
python3-alpha/python-libs/gdata/docs/service.py
python
DocumentQuery.ToUri
(self)
return new_feed
Generates a URI from the query parameters set in the object. Returns: A string containing the URI used to retrieve entries from the Document List feed.
Generates a URI from the query parameters set in the object.
[ "Generates", "a", "URI", "from", "the", "query", "parameters", "set", "in", "the", "object", "." ]
def ToUri(self): """Generates a URI from the query parameters set in the object. Returns: A string containing the URI used to retrieve entries from the Document List feed. """ old_feed = self.feed self.feed = '/'.join([old_feed, self.visibility, self.projection]) new_feed = gdata.se...
[ "def", "ToUri", "(", "self", ")", ":", "old_feed", "=", "self", ".", "feed", "self", ".", "feed", "=", "'/'", ".", "join", "(", "[", "old_feed", ",", "self", ".", "visibility", ",", "self", ".", "projection", "]", ")", "new_feed", "=", "gdata", "."...
https://github.com/kuri65536/python-for-android/blob/26402a08fc46b09ef94e8d7a6bbc3a54ff9d0891/python3-alpha/python-libs/gdata/docs/service.py#L545-L556
dimagi/commcare-hq
d67ff1d3b4c51fa050c19e60c3253a79d3452a39
corehq/form_processor/migrations/0036_cleanup_models.py
python
_alter_to_uuid_sql_forawd
(model, field)
return 'ALTER TABLE "form_processor_{model}" ALTER COLUMN "{field}" TYPE uuid USING {field}::uuid'.format( model=model, field=field )
[]
def _alter_to_uuid_sql_forawd(model, field): return 'ALTER TABLE "form_processor_{model}" ALTER COLUMN "{field}" TYPE uuid USING {field}::uuid'.format( model=model, field=field )
[ "def", "_alter_to_uuid_sql_forawd", "(", "model", ",", "field", ")", ":", "return", "'ALTER TABLE \"form_processor_{model}\" ALTER COLUMN \"{field}\" TYPE uuid USING {field}::uuid'", ".", "format", "(", "model", "=", "model", ",", "field", "=", "field", ")" ]
https://github.com/dimagi/commcare-hq/blob/d67ff1d3b4c51fa050c19e60c3253a79d3452a39/corehq/form_processor/migrations/0036_cleanup_models.py#L8-L11
plkmo/BERT-Relation-Extraction
06075620fccb044785f5fd319e8d06df9af15b50
src/model/ALBERT/tokenization_albert.py
python
AlbertTokenizer.save_vocabulary
(self, save_directory)
return (out_vocab_file,)
Save the sentencepiece vocabulary (copy original file) and special tokens file to a directory.
Save the sentencepiece vocabulary (copy original file) and special tokens file to a directory.
[ "Save", "the", "sentencepiece", "vocabulary", "(", "copy", "original", "file", ")", "and", "special", "tokens", "file", "to", "a", "directory", "." ]
def save_vocabulary(self, save_directory): """ Save the sentencepiece vocabulary (copy original file) and special tokens file to a directory. """ if not os.path.isdir(save_directory): logger.error("Vocabulary path ({}) should be a directory".format(save_directory)) ...
[ "def", "save_vocabulary", "(", "self", ",", "save_directory", ")", ":", "if", "not", "os", ".", "path", ".", "isdir", "(", "save_directory", ")", ":", "logger", ".", "error", "(", "\"Vocabulary path ({}) should be a directory\"", ".", "format", "(", "save_direct...
https://github.com/plkmo/BERT-Relation-Extraction/blob/06075620fccb044785f5fd319e8d06df9af15b50/src/model/ALBERT/tokenization_albert.py#L245-L257
NaturalHistoryMuseum/inselect
196a3ae2a0ed4e2c7cb667aaba9a6be1bcd90ca6
inselect/gui/views/metadata.py
python
FormContainer._create_field_control
(self, field, template)
Returns a QWidget for editing field, validated using template
Returns a QWidget for editing field, validated using template
[ "Returns", "a", "QWidget", "for", "editing", "field", "validated", "using", "template" ]
def _create_field_control(self, field, template): """Returns a QWidget for editing field, validated using template """ if 'countryCode' == field.name: return CountryComboBox(template) elif 'language' == field.name: return LanguageComboBox(template) elif fi...
[ "def", "_create_field_control", "(", "self", ",", "field", ",", "template", ")", ":", "if", "'countryCode'", "==", "field", ".", "name", ":", "return", "CountryComboBox", "(", "template", ")", "elif", "'language'", "==", "field", ".", "name", ":", "return", ...
https://github.com/NaturalHistoryMuseum/inselect/blob/196a3ae2a0ed4e2c7cb667aaba9a6be1bcd90ca6/inselect/gui/views/metadata.py#L223-L245
cloudera/hue
23f02102d4547c17c32bd5ea0eb24e9eadd657a4
desktop/core/ext-py/pysaml2-4.9.0/src/saml2/sigver.py
python
_make_vals
(val, klass, seccont, klass_inst=None, prop=None, part=False, base64encode=False, elements_to_sign=None)
Creates a class instance with a specified value, the specified class instance may be a value on a property in a defined class instance. :param val: The value :param klass: The value class :param klass_inst: The class instance which has a property on which what this function returns is a value. ...
Creates a class instance with a specified value, the specified class instance may be a value on a property in a defined class instance.
[ "Creates", "a", "class", "instance", "with", "a", "specified", "value", "the", "specified", "class", "instance", "may", "be", "a", "value", "on", "a", "property", "in", "a", "defined", "class", "instance", "." ]
def _make_vals(val, klass, seccont, klass_inst=None, prop=None, part=False, base64encode=False, elements_to_sign=None): """ Creates a class instance with a specified value, the specified class instance may be a value on a property in a defined class instance. :param val: The value :p...
[ "def", "_make_vals", "(", "val", ",", "klass", ",", "seccont", ",", "klass_inst", "=", "None", ",", "prop", "=", "None", ",", "part", "=", "False", ",", "base64encode", "=", "False", ",", "elements_to_sign", "=", "None", ")", ":", "cinst", "=", "None",...
https://github.com/cloudera/hue/blob/23f02102d4547c17c32bd5ea0eb24e9eadd657a4/desktop/core/ext-py/pysaml2-4.9.0/src/saml2/sigver.py#L214-L260
ajinabraham/OWASP-Xenotix-XSS-Exploit-Framework
cb692f527e4e819b6c228187c5702d990a180043
external/Scripting Engine/Xenotix Python Scripting Engine/packages/IronPython.StdLib.2.7.4/content/Lib/poplib.py
python
POP3.list
(self, which=None)
return self._longcmd('LIST')
Request listing, return result. Result without a message number argument is in form ['response', ['mesg_num octets', ...], octets]. Result when a message number argument is given is a single response: the "scan listing" for that message.
Request listing, return result.
[ "Request", "listing", "return", "result", "." ]
def list(self, which=None): """Request listing, return result. Result without a message number argument is in form ['response', ['mesg_num octets', ...], octets]. Result when a message number argument is given is a single response: the "scan listing" for that message. "...
[ "def", "list", "(", "self", ",", "which", "=", "None", ")", ":", "if", "which", "is", "not", "None", ":", "return", "self", ".", "_shortcmd", "(", "'LIST %s'", "%", "which", ")", "return", "self", ".", "_longcmd", "(", "'LIST'", ")" ]
https://github.com/ajinabraham/OWASP-Xenotix-XSS-Exploit-Framework/blob/cb692f527e4e819b6c228187c5702d990a180043/external/Scripting Engine/Xenotix Python Scripting Engine/packages/IronPython.StdLib.2.7.4/content/Lib/poplib.py#L205-L216
deeptools/deepTools
ac42d29c298c026aa0c53c9db2553087ebc86b97
deeptools/multiBamSummary.py
python
main
(args=None)
1. get read counts at different positions either all of same length or from genomic regions from the BED file 2. save data for further plotting
1. get read counts at different positions either all of same length or from genomic regions from the BED file
[ "1", ".", "get", "read", "counts", "at", "different", "positions", "either", "all", "of", "same", "length", "or", "from", "genomic", "regions", "from", "the", "BED", "file" ]
def main(args=None): """ 1. get read counts at different positions either all of same length or from genomic regions from the BED file 2. save data for further plotting """ args = process_args(args) if 'BED' in args: bed_regions = args.BED else: bed_regions = None ...
[ "def", "main", "(", "args", "=", "None", ")", ":", "args", "=", "process_args", "(", "args", ")", "if", "'BED'", "in", "args", ":", "bed_regions", "=", "args", ".", "BED", "else", ":", "bed_regions", "=", "None", "if", "len", "(", "args", ".", "bam...
https://github.com/deeptools/deepTools/blob/ac42d29c298c026aa0c53c9db2553087ebc86b97/deeptools/multiBamSummary.py#L207-L285
home-assistant/core
265ebd17a3f17ed8dc1e9bdede03ac8e323f1ab1
homeassistant/components/nad/media_player.py
python
NAD.update
(self)
Retrieve latest state.
Retrieve latest state.
[ "Retrieve", "latest", "state", "." ]
def update(self) -> None: """Retrieve latest state.""" power_state = self._nad_receiver.main_power("?") if not power_state: self._state = None return self._state = ( STATE_ON if self._nad_receiver.main_power("?") == "On" else STATE_OFF ) ...
[ "def", "update", "(", "self", ")", "->", "None", ":", "power_state", "=", "self", ".", "_nad_receiver", ".", "main_power", "(", "\"?\"", ")", "if", "not", "power_state", ":", "self", ".", "_state", "=", "None", "return", "self", ".", "_state", "=", "("...
https://github.com/home-assistant/core/blob/265ebd17a3f17ed8dc1e9bdede03ac8e323f1ab1/homeassistant/components/nad/media_player.py#L188-L204
ceph/ceph-ansible
583e60af84180f0414d67ee52c3ec7cd64ddb4dd
library/radosgw_realm.py
python
pre_generate_radosgw_cmd
(container_image=None)
return cmd
Generate radosgw-admin prefix comaand
Generate radosgw-admin prefix comaand
[ "Generate", "radosgw", "-", "admin", "prefix", "comaand" ]
def pre_generate_radosgw_cmd(container_image=None): ''' Generate radosgw-admin prefix comaand ''' if container_image: cmd = container_exec('radosgw-admin', container_image) else: cmd = ['radosgw-admin'] return cmd
[ "def", "pre_generate_radosgw_cmd", "(", "container_image", "=", "None", ")", ":", "if", "container_image", ":", "cmd", "=", "container_exec", "(", "'radosgw-admin'", ",", "container_image", ")", "else", ":", "cmd", "=", "[", "'radosgw-admin'", "]", "return", "cm...
https://github.com/ceph/ceph-ansible/blob/583e60af84180f0414d67ee52c3ec7cd64ddb4dd/library/radosgw_realm.py#L131-L140
openai/imitation
8a2ed905e2ac54bda0f71e5ee364e90568e6d031
policyopt/thutil.py
python
categorical_kl
(logprobs1_B_A, logprobs2_B_A, name=None)
return kl_B
KL divergence between categorical distributions, specified as log probabilities
KL divergence between categorical distributions, specified as log probabilities
[ "KL", "divergence", "between", "categorical", "distributions", "specified", "as", "log", "probabilities" ]
def categorical_kl(logprobs1_B_A, logprobs2_B_A, name=None): '''KL divergence between categorical distributions, specified as log probabilities''' kl_B = (tensor.exp(logprobs1_B_A) * (logprobs1_B_A - logprobs2_B_A)).sum(axis=1) return kl_B
[ "def", "categorical_kl", "(", "logprobs1_B_A", ",", "logprobs2_B_A", ",", "name", "=", "None", ")", ":", "kl_B", "=", "(", "tensor", ".", "exp", "(", "logprobs1_B_A", ")", "*", "(", "logprobs1_B_A", "-", "logprobs2_B_A", ")", ")", ".", "sum", "(", "axis"...
https://github.com/openai/imitation/blob/8a2ed905e2ac54bda0f71e5ee364e90568e6d031/policyopt/thutil.py#L60-L63
hzy46/Deep-Learning-21-Examples
15c2d9edccad090cd67b033f24a43c544e5cba3e
chapter_5/research/object_detection/utils/np_box_list.py
python
BoxList._is_valid_boxes
(self, data)
return True
Check whether data fullfills the format of N*[ymin, xmin, ymax, xmin]. Args: data: a numpy array of shape [N, 4] representing box coordinates Returns: a boolean indicating whether all ymax of boxes are equal or greater than ymin, and all xmax of boxes are equal or greater than xmin.
Check whether data fullfills the format of N*[ymin, xmin, ymax, xmin].
[ "Check", "whether", "data", "fullfills", "the", "format", "of", "N", "*", "[", "ymin", "xmin", "ymax", "xmin", "]", "." ]
def _is_valid_boxes(self, data): """Check whether data fullfills the format of N*[ymin, xmin, ymax, xmin]. Args: data: a numpy array of shape [N, 4] representing box coordinates Returns: a boolean indicating whether all ymax of boxes are equal or greater than ymin, and all xmax of bo...
[ "def", "_is_valid_boxes", "(", "self", ",", "data", ")", ":", "if", "data", ".", "shape", "[", "0", "]", ">", "0", ":", "for", "i", "in", "moves", ".", "range", "(", "data", ".", "shape", "[", "0", "]", ")", ":", "if", "data", "[", "i", ",", ...
https://github.com/hzy46/Deep-Learning-21-Examples/blob/15c2d9edccad090cd67b033f24a43c544e5cba3e/chapter_5/research/object_detection/utils/np_box_list.py#L120-L134
lxdock/lxdock
f71006d130bc8b53603eea36a546003495437493
lxdock/logging.py
python
_AtleastErrorFilter.filter
(self, record)
return record.levelno >= logging.ERROR
[]
def filter(self, record): return record.levelno >= logging.ERROR
[ "def", "filter", "(", "self", ",", "record", ")", ":", "return", "record", ".", "levelno", ">=", "logging", ".", "ERROR" ]
https://github.com/lxdock/lxdock/blob/f71006d130bc8b53603eea36a546003495437493/lxdock/logging.py#L22-L23
ajinabraham/OWASP-Xenotix-XSS-Exploit-Framework
cb692f527e4e819b6c228187c5702d990a180043
external/Scripting Engine/packages/IronPython.StdLib.2.7.4/content/Lib/distutils/file_util.py
python
_copy_file_contents
(src, dst, buffer_size=16*1024)
Copy the file 'src' to 'dst'. Both must be filenames. Any error opening either file, reading from 'src', or writing to 'dst', raises DistutilsFileError. Data is read/written in chunks of 'buffer_size' bytes (default 16k). No attempt is made to handle anything apart from regular files.
Copy the file 'src' to 'dst'.
[ "Copy", "the", "file", "src", "to", "dst", "." ]
def _copy_file_contents(src, dst, buffer_size=16*1024): """Copy the file 'src' to 'dst'. Both must be filenames. Any error opening either file, reading from 'src', or writing to 'dst', raises DistutilsFileError. Data is read/written in chunks of 'buffer_size' bytes (default 16k). No attempt is ma...
[ "def", "_copy_file_contents", "(", "src", ",", "dst", ",", "buffer_size", "=", "16", "*", "1024", ")", ":", "# Stolen from shutil module in the standard library, but with", "# custom error-handling added.", "fsrc", "=", "None", "fdst", "=", "None", "try", ":", "try", ...
https://github.com/ajinabraham/OWASP-Xenotix-XSS-Exploit-Framework/blob/cb692f527e4e819b6c228187c5702d990a180043/external/Scripting Engine/packages/IronPython.StdLib.2.7.4/content/Lib/distutils/file_util.py#L18-L69
snapcore/snapcraft
b81550376df7f2d0dfe65f7bfb006a3107252450
snapcraft/cli/snapcraftctl/_runner.py
python
build
()
Run the 'build' step of the calling part's lifecycle
Run the 'build' step of the calling part's lifecycle
[ "Run", "the", "build", "step", "of", "the", "calling", "part", "s", "lifecycle" ]
def build(): """Run the 'build' step of the calling part's lifecycle""" _call_function("build")
[ "def", "build", "(", ")", ":", "_call_function", "(", "\"build\"", ")" ]
https://github.com/snapcore/snapcraft/blob/b81550376df7f2d0dfe65f7bfb006a3107252450/snapcraft/cli/snapcraftctl/_runner.py#L53-L55
VLSIDA/OpenRAM
f66aac3264598eeae31225c62b6a4af52412d407
compiler/base/hierarchy_spice.py
python
spice.analytical_delay
(self, corner, slew, load=0.0)
return delay_data(corner_delay, corner_slew)
Inform users undefined delay module while building new modules
Inform users undefined delay module while building new modules
[ "Inform", "users", "undefined", "delay", "module", "while", "building", "new", "modules" ]
def analytical_delay(self, corner, slew, load=0.0): """Inform users undefined delay module while building new modules""" # FIXME: Slew is not used in the model right now. # Can be added heuristically as linear factor relative_cap = logical_effort.convert_farad_to_relative_c(load) ...
[ "def", "analytical_delay", "(", "self", ",", "corner", ",", "slew", ",", "load", "=", "0.0", ")", ":", "# FIXME: Slew is not used in the model right now.", "# Can be added heuristically as linear factor", "relative_cap", "=", "logical_effort", ".", "convert_farad_to_relative_...
https://github.com/VLSIDA/OpenRAM/blob/f66aac3264598eeae31225c62b6a4af52412d407/compiler/base/hierarchy_spice.py#L440-L456
emcconville/wand
03682680c351645f16c3b8ea23bde79fbb270305
wand/image.py
python
BaseImage.histogram
(self)
return HistogramDict(self)
(:class:`HistogramDict`) The mapping that represents the histogram. Keys are :class:`~wand.color.Color` objects, and values are the number of pixels. .. tip:: True-color photos can have millions of color values. If performance is more valuable than accuracy, remember to...
(:class:`HistogramDict`) The mapping that represents the histogram. Keys are :class:`~wand.color.Color` objects, and values are the number of pixels.
[ "(", ":", "class", ":", "HistogramDict", ")", "The", "mapping", "that", "represents", "the", "histogram", ".", "Keys", "are", ":", "class", ":", "~wand", ".", "color", ".", "Color", "objects", "and", "values", "are", "the", "number", "of", "pixels", "." ...
def histogram(self): """(:class:`HistogramDict`) The mapping that represents the histogram. Keys are :class:`~wand.color.Color` objects, and values are the number of pixels. .. tip:: True-color photos can have millions of color values. If performance is more val...
[ "def", "histogram", "(", "self", ")", ":", "return", "HistogramDict", "(", "self", ")" ]
https://github.com/emcconville/wand/blob/03682680c351645f16c3b8ea23bde79fbb270305/wand/image.py#L1959-L1977
AppScale/gts
46f909cf5dc5ba81faf9d81dc9af598dcf8a82a9
AppServer/lib/django-1.2/django/db/models/sql/compiler.py
python
SQLCompiler.quote_name_unless_alias
(self, name)
return r
A wrapper around connection.ops.quote_name that doesn't quote aliases for table names. This avoids problems with some SQL dialects that treat quoted strings specially (e.g. PostgreSQL).
A wrapper around connection.ops.quote_name that doesn't quote aliases for table names. This avoids problems with some SQL dialects that treat quoted strings specially (e.g. PostgreSQL).
[ "A", "wrapper", "around", "connection", ".", "ops", ".", "quote_name", "that", "doesn", "t", "quote", "aliases", "for", "table", "names", ".", "This", "avoids", "problems", "with", "some", "SQL", "dialects", "that", "treat", "quoted", "strings", "specially", ...
def quote_name_unless_alias(self, name): """ A wrapper around connection.ops.quote_name that doesn't quote aliases for table names. This avoids problems with some SQL dialects that treat quoted strings specially (e.g. PostgreSQL). """ if name in self.quote_cache: ...
[ "def", "quote_name_unless_alias", "(", "self", ",", "name", ")", ":", "if", "name", "in", "self", ".", "quote_cache", ":", "return", "self", ".", "quote_cache", "[", "name", "]", "if", "(", "(", "name", "in", "self", ".", "query", ".", "alias_map", "an...
https://github.com/AppScale/gts/blob/46f909cf5dc5ba81faf9d81dc9af598dcf8a82a9/AppServer/lib/django-1.2/django/db/models/sql/compiler.py#L31-L45
espnet/espnet
ea411f3f627b8f101c211e107d0ff7053344ac80
espnet/nets/e2e_asr_common.py
python
ErrorCalculator.__call__
(self, ys_hat, ys_pad, is_ctc=False)
return cer, wer
Calculate sentence-level WER/CER score. :param torch.Tensor ys_hat: prediction (batch, seqlen) :param torch.Tensor ys_pad: reference (batch, seqlen) :param bool is_ctc: calculate CER score for CTC :return: sentence-level WER score :rtype float :return: sentence-level CER...
Calculate sentence-level WER/CER score.
[ "Calculate", "sentence", "-", "level", "WER", "/", "CER", "score", "." ]
def __call__(self, ys_hat, ys_pad, is_ctc=False): """Calculate sentence-level WER/CER score. :param torch.Tensor ys_hat: prediction (batch, seqlen) :param torch.Tensor ys_pad: reference (batch, seqlen) :param bool is_ctc: calculate CER score for CTC :return: sentence-level WER s...
[ "def", "__call__", "(", "self", ",", "ys_hat", ",", "ys_pad", ",", "is_ctc", "=", "False", ")", ":", "cer", ",", "wer", "=", "None", ",", "None", "if", "is_ctc", ":", "return", "self", ".", "calculate_cer_ctc", "(", "ys_hat", ",", "ys_pad", ")", "eli...
https://github.com/espnet/espnet/blob/ea411f3f627b8f101c211e107d0ff7053344ac80/espnet/nets/e2e_asr_common.py#L129-L152
twilio/twilio-python
6e1e811ea57a1edfadd5161ace87397c563f6915
twilio/rest/proxy/v1/service/__init__.py
python
ServiceInstance.date_updated
(self)
return self._properties['date_updated']
:returns: The ISO 8601 date and time in GMT when the resource was last updated :rtype: datetime
:returns: The ISO 8601 date and time in GMT when the resource was last updated :rtype: datetime
[ ":", "returns", ":", "The", "ISO", "8601", "date", "and", "time", "in", "GMT", "when", "the", "resource", "was", "last", "updated", ":", "rtype", ":", "datetime" ]
def date_updated(self): """ :returns: The ISO 8601 date and time in GMT when the resource was last updated :rtype: datetime """ return self._properties['date_updated']
[ "def", "date_updated", "(", "self", ")", ":", "return", "self", ".", "_properties", "[", "'date_updated'", "]" ]
https://github.com/twilio/twilio-python/blob/6e1e811ea57a1edfadd5161ace87397c563f6915/twilio/rest/proxy/v1/service/__init__.py#L499-L504
plotly/plotly.py
cfad7862594b35965c0e000813bd7805e8494a5b
packages/python/plotly/plotly/graph_objs/layout/geo/_lataxis.py
python
Lataxis.gridwidth
(self)
return self["gridwidth"]
Sets the graticule's stroke width (in px). The 'gridwidth' property is a number and may be specified as: - An int or float in the interval [0, inf] Returns ------- int|float
Sets the graticule's stroke width (in px). The 'gridwidth' property is a number and may be specified as: - An int or float in the interval [0, inf]
[ "Sets", "the", "graticule", "s", "stroke", "width", "(", "in", "px", ")", ".", "The", "gridwidth", "property", "is", "a", "number", "and", "may", "be", "specified", "as", ":", "-", "An", "int", "or", "float", "in", "the", "interval", "[", "0", "inf",...
def gridwidth(self): """ Sets the graticule's stroke width (in px). The 'gridwidth' property is a number and may be specified as: - An int or float in the interval [0, inf] Returns ------- int|float """ return self["gridwidth"]
[ "def", "gridwidth", "(", "self", ")", ":", "return", "self", "[", "\"gridwidth\"", "]" ]
https://github.com/plotly/plotly.py/blob/cfad7862594b35965c0e000813bd7805e8494a5b/packages/python/plotly/plotly/graph_objs/layout/geo/_lataxis.py#L95-L106
zhl2008/awd-platform
0416b31abea29743387b10b3914581fbe8e7da5e
web_flaskbb/lib/python2.7/site-packages/flask/cli.py
python
find_app_by_string
(script_info, module, app_name)
Checks if the given string is a variable name or a function. If it is a function, it checks for specified arguments and whether it takes a ``script_info`` argument and calls the function with the appropriate arguments.
Checks if the given string is a variable name or a function. If it is a function, it checks for specified arguments and whether it takes a ``script_info`` argument and calls the function with the appropriate arguments.
[ "Checks", "if", "the", "given", "string", "is", "a", "variable", "name", "or", "a", "function", ".", "If", "it", "is", "a", "function", "it", "checks", "for", "specified", "arguments", "and", "whether", "it", "takes", "a", "script_info", "argument", "and",...
def find_app_by_string(script_info, module, app_name): """Checks if the given string is a variable name or a function. If it is a function, it checks for specified arguments and whether it takes a ``script_info`` argument and calls the function with the appropriate arguments. """ from flask impo...
[ "def", "find_app_by_string", "(", "script_info", ",", "module", ",", "app_name", ")", ":", "from", "flask", "import", "Flask", "match", "=", "re", ".", "match", "(", "r'^ *([^ ()]+) *(?:\\((.*?) *,? *\\))? *$'", ",", "app_name", ")", "if", "not", "match", ":", ...
https://github.com/zhl2008/awd-platform/blob/0416b31abea29743387b10b3914581fbe8e7da5e/web_flaskbb/lib/python2.7/site-packages/flask/cli.py#L143-L200
sagemath/sage
f9b2db94f675ff16963ccdefba4f1a3393b3fe0d
src/sage/schemes/hyperelliptic_curves/hyperelliptic_finite_field.py
python
HyperellipticCurve_finite_field.Cartier_matrix
(self)
return M
r""" INPUT: - ``E`` : Hyperelliptic Curve of the form `y^2 = f(x)` over a finite field, `\GF{q}` OUTPUT: - ``M``: The matrix `M = (c_{pi-j})`, where `c_i` are the coefficients of `f(x)^{(p-1)/2} = \sum c_i x^i` REFERENCES: N. Yui. On the Jacobian varieties of hypere...
r""" INPUT:
[ "r", "INPUT", ":" ]
def Cartier_matrix(self): r""" INPUT: - ``E`` : Hyperelliptic Curve of the form `y^2 = f(x)` over a finite field, `\GF{q}` OUTPUT: - ``M``: The matrix `M = (c_{pi-j})`, where `c_i` are the coefficients of `f(x)^{(p-1)/2} = \sum c_i x^i` REFERENCES: N. Yui. O...
[ "def", "Cartier_matrix", "(", "self", ")", ":", "#checking first that Cartier matrix is not already cached. Since", "#it can be called by either Hasse_Witt or a_number.", "#This way it does not matter which function is called first", "#in the code.", "# Trac Ticket #11115: Why shall we waste tim...
https://github.com/sagemath/sage/blob/f9b2db94f675ff16963ccdefba4f1a3393b3fe0d/src/sage/schemes/hyperelliptic_curves/hyperelliptic_finite_field.py#L1555-L1643
mtianyan/VueDjangoAntdProBookShop
fd8fa2151c81edde2f8b8e6df8e1ddd799f940c2
third_party/social_core/storage.py
python
UserMixin.user_exists
(cls, *args, **kwargs)
Return True/False if a User instance exists with the given arguments. Arguments are directly passed to filter() manager method.
Return True/False if a User instance exists with the given arguments. Arguments are directly passed to filter() manager method.
[ "Return", "True", "/", "False", "if", "a", "User", "instance", "exists", "with", "the", "given", "arguments", ".", "Arguments", "are", "directly", "passed", "to", "filter", "()", "manager", "method", "." ]
def user_exists(cls, *args, **kwargs): """ Return True/False if a User instance exists with the given arguments. Arguments are directly passed to filter() manager method. """ raise NotImplementedError('Implement in subclass')
[ "def", "user_exists", "(", "cls", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "raise", "NotImplementedError", "(", "'Implement in subclass'", ")" ]
https://github.com/mtianyan/VueDjangoAntdProBookShop/blob/fd8fa2151c81edde2f8b8e6df8e1ddd799f940c2/third_party/social_core/storage.py#L155-L160
benedekrozemberczki/littleballoffur
dbfec92c0ead8c5da134c9aead7987c7a36234b4
littleballoffur/edge_sampling/randomedgesamplerwithpartialinduction.py
python
RandomEdgeSamplerWithPartialInduction.sample
(self, graph: Union[NXGraph, NKGraph])
return new_graph
Sampling edges randomly with partial induction. Arg types: * **graph** *(NetworkX or NetworKit graph)* - The graph to be sampled from. Return types: * **new_graph** *(NetworkX or NetworKit graph)* - The graph of sampled edges.
Sampling edges randomly with partial induction.
[ "Sampling", "edges", "randomly", "with", "partial", "induction", "." ]
def sample(self, graph: Union[NXGraph, NKGraph]) -> Union[NXGraph, NKGraph]: """ Sampling edges randomly with partial induction. Arg types: * **graph** *(NetworkX or NetworKit graph)* - The graph to be sampled from. Return types: * **new_graph** *(NetworkX or Ne...
[ "def", "sample", "(", "self", ",", "graph", ":", "Union", "[", "NXGraph", ",", "NKGraph", "]", ")", "->", "Union", "[", "NXGraph", ",", "NKGraph", "]", ":", "self", ".", "_deploy_backend", "(", "graph", ")", "self", ".", "_create_initial_set", "(", "gr...
https://github.com/benedekrozemberczki/littleballoffur/blob/dbfec92c0ead8c5da134c9aead7987c7a36234b4/littleballoffur/edge_sampling/randomedgesamplerwithpartialinduction.py#L64-L78
m-rtijn/mpu6050
0626053a5e1182f4951b78b8326691a9223a5f7d
mpu6050/mpu6050.py
python
mpu6050.set_filter_range
(self, filter_range=FILTER_BW_256)
return self.bus.write_byte_data(self.address, self.MPU_CONFIG, EXT_SYNC_SET | filter_range)
Sets the low-pass bandpass filter frequency
Sets the low-pass bandpass filter frequency
[ "Sets", "the", "low", "-", "pass", "bandpass", "filter", "frequency" ]
def set_filter_range(self, filter_range=FILTER_BW_256): """Sets the low-pass bandpass filter frequency""" # Keep the current EXT_SYNC_SET configuration in bits 3, 4, 5 in the MPU_CONFIG register EXT_SYNC_SET = self.bus.read_byte_data(self.address, self.MPU_CONFIG) & 0b00111000 return sel...
[ "def", "set_filter_range", "(", "self", ",", "filter_range", "=", "FILTER_BW_256", ")", ":", "# Keep the current EXT_SYNC_SET configuration in bits 3, 4, 5 in the MPU_CONFIG register", "EXT_SYNC_SET", "=", "self", ".", "bus", ".", "read_byte_data", "(", "self", ".", "addres...
https://github.com/m-rtijn/mpu6050/blob/0626053a5e1182f4951b78b8326691a9223a5f7d/mpu6050/mpu6050.py#L194-L198
moloch--/RootTheBox
097272332b9f9b7e2df31ca0823ed10c7b66ac81
models/WallOfSheep.py
python
WallOfSheep.by_victim_id
(cls, _id)
return dbsession.query(cls).filter_by(victim_id=_id).all()
Returns all entries for a _id
Returns all entries for a _id
[ "Returns", "all", "entries", "for", "a", "_id" ]
def by_victim_id(cls, _id): """ Returns all entries for a _id """ return dbsession.query(cls).filter_by(victim_id=_id).all()
[ "def", "by_victim_id", "(", "cls", ",", "_id", ")", ":", "return", "dbsession", ".", "query", "(", "cls", ")", ".", "filter_by", "(", "victim_id", "=", "_id", ")", ".", "all", "(", ")" ]
https://github.com/moloch--/RootTheBox/blob/097272332b9f9b7e2df31ca0823ed10c7b66ac81/models/WallOfSheep.py#L63-L65
marcua/tweeql
eb8c61fb001e0b9755929f3b19be9fa16358187e
old/redis/client.py
python
Redis.sunion
(self, keys, *args)
return self.format_inline('SUNION', *keys)
Return the union of sets specifiued by ``keys``
Return the union of sets specifiued by ``keys``
[ "Return", "the", "union", "of", "sets", "specifiued", "by", "keys" ]
def sunion(self, keys, *args): "Return the union of sets specifiued by ``keys``" keys = list_or_args('sunion', keys, args) return self.format_inline('SUNION', *keys)
[ "def", "sunion", "(", "self", ",", "keys", ",", "*", "args", ")", ":", "keys", "=", "list_or_args", "(", "'sunion'", ",", "keys", ",", "args", ")", "return", "self", ".", "format_inline", "(", "'SUNION'", ",", "*", "keys", ")" ]
https://github.com/marcua/tweeql/blob/eb8c61fb001e0b9755929f3b19be9fa16358187e/old/redis/client.py#L795-L798
axnsan12/drf-yasg
d9700dbf8cc80d725a7db485c2d4446c19c29840
src/drf_yasg/codecs.py
python
_OpenAPICodec.generate_swagger_object
(self, swagger)
return swagger.as_odict()
Generates the root Swagger object. :param openapi.Swagger swagger: Swagger spec object as generated by :class:`.OpenAPISchemaGenerator` :return: swagger spec as dict :rtype: OrderedDict
Generates the root Swagger object.
[ "Generates", "the", "root", "Swagger", "object", "." ]
def generate_swagger_object(self, swagger): """Generates the root Swagger object. :param openapi.Swagger swagger: Swagger spec object as generated by :class:`.OpenAPISchemaGenerator` :return: swagger spec as dict :rtype: OrderedDict """ return swagger.as_odict()
[ "def", "generate_swagger_object", "(", "self", ",", "swagger", ")", ":", "return", "swagger", ".", "as_odict", "(", ")" ]
https://github.com/axnsan12/drf-yasg/blob/d9700dbf8cc80d725a7db485c2d4446c19c29840/src/drf_yasg/codecs.py#L97-L104
google/coursebuilder-core
08f809db3226d9269e30d5edd0edd33bd22041f4
coursebuilder/models/models.py
python
StudentPreferencesDTO.show_hooks
(self)
return self.dict.get('show_hooks', True)
Show controls to permit editing of HTML inclusions (hook points). On course pages, there are various locations (hook points) at which HTML content is inserted. Turn this setting on to see those locations with controls that permit an admin to edit that HTML, and off to see the content a...
Show controls to permit editing of HTML inclusions (hook points).
[ "Show", "controls", "to", "permit", "editing", "of", "HTML", "inclusions", "(", "hook", "points", ")", "." ]
def show_hooks(self): """Show controls to permit editing of HTML inclusions (hook points). On course pages, there are various locations (hook points) at which HTML content is inserted. Turn this setting on to see those locations with controls that permit an admin to edit that HTML, and...
[ "def", "show_hooks", "(", "self", ")", ":", "return", "self", ".", "dict", ".", "get", "(", "'show_hooks'", ",", "True", ")" ]
https://github.com/google/coursebuilder-core/blob/08f809db3226d9269e30d5edd0edd33bd22041f4/coursebuilder/models/models.py#L2659-L2670
openhatch/oh-mainline
ce29352a034e1223141dcc2f317030bbc3359a51
vendor/packages/Django/django/utils/dateformat.py
python
DateFormat.Y
(self)
return self.data.year
Year, 4 digits; e.g. '1999
Year, 4 digits; e.g. '1999
[ "Year", "4", "digits", ";", "e", ".", "g", ".", "1999" ]
def Y(self): "Year, 4 digits; e.g. '1999'" return self.data.year
[ "def", "Y", "(", "self", ")", ":", "return", "self", ".", "data", ".", "year" ]
https://github.com/openhatch/oh-mainline/blob/ce29352a034e1223141dcc2f317030bbc3359a51/vendor/packages/Django/django/utils/dateformat.py#L283-L285
BerkeleyAutomation/meshrender
25b6fb711ef7a7871a5908459e6be5c76a04b631
meshrender/viewer.py
python
SceneViewer._load_shaders
(self, vertex_shader, fragment_shader)
return shader
Load and compile shaders from strings.
Load and compile shaders from strings.
[ "Load", "and", "compile", "shaders", "from", "strings", "." ]
def _load_shaders(self, vertex_shader, fragment_shader): """Load and compile shaders from strings. """ shader = shaders.compileProgram( shaders.compileShader(vertex_shader, GL_VERTEX_SHADER), shaders.compileShader(fragment_shader, GL_FRAGMENT_SHADER) ) re...
[ "def", "_load_shaders", "(", "self", ",", "vertex_shader", ",", "fragment_shader", ")", ":", "shader", "=", "shaders", ".", "compileProgram", "(", "shaders", ".", "compileShader", "(", "vertex_shader", ",", "GL_VERTEX_SHADER", ")", ",", "shaders", ".", "compileS...
https://github.com/BerkeleyAutomation/meshrender/blob/25b6fb711ef7a7871a5908459e6be5c76a04b631/meshrender/viewer.py#L536-L544
deepinsight/insightface
c0b25f998a649f662c7136eb389abcacd7900e9d
python-package/insightface/thirdparty/face3d/morphable_model/morphabel_model.py
python
MorphabelModel.fit
(self, x, X_ind, max_iter = 4, isShow = False)
return fitted_sp, fitted_ep, s, angles, t
fit 3dmm & pose parameters Args: x: (n, 2) image points X_ind: (n,) corresponding Model vertex indices max_iter: iteration isShow: whether to reserve middle results for show Returns: fitted_sp: (n_sp, 1). shape parameters fitted_ep:...
fit 3dmm & pose parameters Args: x: (n, 2) image points X_ind: (n,) corresponding Model vertex indices max_iter: iteration isShow: whether to reserve middle results for show Returns: fitted_sp: (n_sp, 1). shape parameters fitted_ep:...
[ "fit", "3dmm", "&", "pose", "parameters", "Args", ":", "x", ":", "(", "n", "2", ")", "image", "points", "X_ind", ":", "(", "n", ")", "corresponding", "Model", "vertex", "indices", "max_iter", ":", "iteration", "isShow", ":", "whether", "to", "reserve", ...
def fit(self, x, X_ind, max_iter = 4, isShow = False): ''' fit 3dmm & pose parameters Args: x: (n, 2) image points X_ind: (n,) corresponding Model vertex indices max_iter: iteration isShow: whether to reserve middle results for show Returns: ...
[ "def", "fit", "(", "self", ",", "x", ",", "X_ind", ",", "max_iter", "=", "4", ",", "isShow", "=", "False", ")", ":", "if", "isShow", ":", "fitted_sp", ",", "fitted_ep", ",", "s", ",", "R", ",", "t", "=", "fit", ".", "fit_points_for_show", "(", "x...
https://github.com/deepinsight/insightface/blob/c0b25f998a649f662c7136eb389abcacd7900e9d/python-package/insightface/thirdparty/face3d/morphable_model/morphabel_model.py#L121-L141
graphql-python/graphql-core
9ea9c3705d6826322027d9bb539d37c5b25f7af9
src/graphql/language/parser.py
python
Parser.parse_argument_defs
(self)
return self.optional_many( TokenKind.PAREN_L, self.parse_input_value_def, TokenKind.PAREN_R )
ArgumentsDefinition: (InputValueDefinition+)
ArgumentsDefinition: (InputValueDefinition+)
[ "ArgumentsDefinition", ":", "(", "InputValueDefinition", "+", ")" ]
def parse_argument_defs(self) -> List[InputValueDefinitionNode]: """ArgumentsDefinition: (InputValueDefinition+)""" return self.optional_many( TokenKind.PAREN_L, self.parse_input_value_def, TokenKind.PAREN_R )
[ "def", "parse_argument_defs", "(", "self", ")", "->", "List", "[", "InputValueDefinitionNode", "]", ":", "return", "self", ".", "optional_many", "(", "TokenKind", ".", "PAREN_L", ",", "self", ".", "parse_input_value_def", ",", "TokenKind", ".", "PAREN_R", ")" ]
https://github.com/graphql-python/graphql-core/blob/9ea9c3705d6826322027d9bb539d37c5b25f7af9/src/graphql/language/parser.py#L720-L724
KDD-OpenSource/DeepADoTS
88c38320141a1062301cc9255f3e0fc111f55e80
src/evaluation/evaluator.py
python
Evaluator.threshold
(self, score)
return np.nanmean(score) + 2 * np.nanstd(score)
[]
def threshold(self, score): return np.nanmean(score) + 2 * np.nanstd(score)
[ "def", "threshold", "(", "self", ",", "score", ")", ":", "return", "np", ".", "nanmean", "(", "score", ")", "+", "2", "*", "np", ".", "nanstd", "(", "score", ")" ]
https://github.com/KDD-OpenSource/DeepADoTS/blob/88c38320141a1062301cc9255f3e0fc111f55e80/src/evaluation/evaluator.py#L595-L596
Tautulli/Tautulli
2410eb33805aaac4bd1c5dad0f71e4f15afaf742
lib/dns/rdtypes/dsbase.py
python
DSBase.to_text
(self, origin=None, relativize=True, **kw)
return '%d %d %d %s' % (self.key_tag, self.algorithm, self.digest_type, dns.rdata._hexify(self.digest, chunksize=128))
[]
def to_text(self, origin=None, relativize=True, **kw): return '%d %d %d %s' % (self.key_tag, self.algorithm, self.digest_type, dns.rdata._hexify(self.digest, chunksize=128))
[ "def", "to_text", "(", "self", ",", "origin", "=", "None", ",", "relativize", "=", "True", ",", "*", "*", "kw", ")", ":", "return", "'%d %d %d %s'", "%", "(", "self", ".", "key_tag", ",", "self", ".", "algorithm", ",", "self", ".", "digest_type", ","...
https://github.com/Tautulli/Tautulli/blob/2410eb33805aaac4bd1c5dad0f71e4f15afaf742/lib/dns/rdtypes/dsbase.py#L40-L44
iclavera/learning_to_adapt
bd7d99ba402521c96631e7d09714128f549db0f1
learning_to_adapt/envs/mujoco_env.py
python
MujocoEnv.get_current_obs
(self)
return self._get_full_obs()
[]
def get_current_obs(self): return self._get_full_obs()
[ "def", "get_current_obs", "(", "self", ")", ":", "return", "self", ".", "_get_full_obs", "(", ")" ]
https://github.com/iclavera/learning_to_adapt/blob/bd7d99ba402521c96631e7d09714128f549db0f1/learning_to_adapt/envs/mujoco_env.py#L110-L111
CedricGuillemet/Imogen
ee417b42747ed5b46cb11b02ef0c3630000085b3
bin/Lib/lib2to3/btm_utils.py
python
get_characteristic_subpattern
(subpatterns)
return max(subpatterns, key=len)
Picks the most characteristic from a list of linear patterns Current order used is: names > common_names > common_chars
Picks the most characteristic from a list of linear patterns Current order used is: names > common_names > common_chars
[ "Picks", "the", "most", "characteristic", "from", "a", "list", "of", "linear", "patterns", "Current", "order", "used", "is", ":", "names", ">", "common_names", ">", "common_chars" ]
def get_characteristic_subpattern(subpatterns): """Picks the most characteristic from a list of linear patterns Current order used is: names > common_names > common_chars """ if not isinstance(subpatterns, list): return subpatterns if len(subpatterns)==1: return subpatterns[0] ...
[ "def", "get_characteristic_subpattern", "(", "subpatterns", ")", ":", "if", "not", "isinstance", "(", "subpatterns", ",", "list", ")", ":", "return", "subpatterns", "if", "len", "(", "subpatterns", ")", "==", "1", ":", "return", "subpatterns", "[", "0", "]",...
https://github.com/CedricGuillemet/Imogen/blob/ee417b42747ed5b46cb11b02ef0c3630000085b3/bin/Lib/lib2to3/btm_utils.py#L237-L272
javayhu/Gank-Alfred-Workflow
aca39bd0c7bc0c494eee204e10bca61dab760ab7
source/workflow/workflow.py
python
Workflow._call_security
(self, action, service, account, *args)
return output
Call the ``security`` CLI app that provides access to keychains. May raise `PasswordNotFound`, `PasswordExists` or `KeychainError` exceptions (the first two are subclasses of `KeychainError`). :param action: The ``security`` action to call, e.g. ``add-generic-passwo...
Call the ``security`` CLI app that provides access to keychains.
[ "Call", "the", "security", "CLI", "app", "that", "provides", "access", "to", "keychains", "." ]
def _call_security(self, action, service, account, *args): """Call the ``security`` CLI app that provides access to keychains. May raise `PasswordNotFound`, `PasswordExists` or `KeychainError` exceptions (the first two are subclasses of `KeychainError`). :param action: The ``security`...
[ "def", "_call_security", "(", "self", ",", "action", ",", "service", ",", "account", ",", "*", "args", ")", ":", "cmd", "=", "[", "'security'", ",", "action", ",", "'-s'", ",", "service", ",", "'-a'", ",", "account", "]", "+", "list", "(", "args", ...
https://github.com/javayhu/Gank-Alfred-Workflow/blob/aca39bd0c7bc0c494eee204e10bca61dab760ab7/source/workflow/workflow.py#L2896-L2934
keon/algorithms
23d4e85a506eaeaff315e855be12f8dbe47a7ec3
algorithms/map/hashtable.py
python
ResizableHashTable.__init__
(self)
[]
def __init__(self): super().__init__(self.MIN_SIZE)
[ "def", "__init__", "(", "self", ")", ":", "super", "(", ")", ".", "__init__", "(", "self", ".", "MIN_SIZE", ")" ]
https://github.com/keon/algorithms/blob/23d4e85a506eaeaff315e855be12f8dbe47a7ec3/algorithms/map/hashtable.py#L102-L103
kubernetes-client/python
47b9da9de2d02b2b7a34fbe05afb44afd130d73a
kubernetes/client/api/core_api.py
python
CoreApi.get_api_versions_with_http_info
(self, **kwargs)
return self.api_client.call_api( '/api/', 'GET', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, response_type='V1APIVersions', # noqa: E501 auth_setti...
get_api_versions # noqa: E501 get available API versions # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.get_api_versions_with_http_info(async_req=True) >>> result = thread....
get_api_versions # noqa: E501
[ "get_api_versions", "#", "noqa", ":", "E501" ]
def get_api_versions_with_http_info(self, **kwargs): # noqa: E501 """get_api_versions # noqa: E501 get available API versions # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = ap...
[ "def", "get_api_versions_with_http_info", "(", "self", ",", "*", "*", "kwargs", ")", ":", "# noqa: E501", "local_var_params", "=", "locals", "(", ")", "all_params", "=", "[", "]", "all_params", ".", "extend", "(", "[", "'async_req'", ",", "'_return_http_data_onl...
https://github.com/kubernetes-client/python/blob/47b9da9de2d02b2b7a34fbe05afb44afd130d73a/kubernetes/client/api/core_api.py#L63-L142
Source-Python-Dev-Team/Source.Python
d0ffd8ccbd1e9923c9bc44936f20613c1c76b7fb
addons/source-python/Python3/_pydecimal.py
python
Decimal.__rfloordiv__
(self, other, context=None)
return other.__floordiv__(self, context=context)
Swaps self/other and returns __floordiv__.
Swaps self/other and returns __floordiv__.
[ "Swaps", "self", "/", "other", "and", "returns", "__floordiv__", "." ]
def __rfloordiv__(self, other, context=None): """Swaps self/other and returns __floordiv__.""" other = _convert_other(other) if other is NotImplemented: return other return other.__floordiv__(self, context=context)
[ "def", "__rfloordiv__", "(", "self", ",", "other", ",", "context", "=", "None", ")", ":", "other", "=", "_convert_other", "(", "other", ")", "if", "other", "is", "NotImplemented", ":", "return", "other", "return", "other", ".", "__floordiv__", "(", "self",...
https://github.com/Source-Python-Dev-Team/Source.Python/blob/d0ffd8ccbd1e9923c9bc44936f20613c1c76b7fb/addons/source-python/Python3/_pydecimal.py#L1640-L1645
microsoft/debugpy
be8dd607f6837244e0b565345e497aff7a0c08bf
src/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_api.py
python
PyDevdAPI.reapply_breakpoints
(self, py_db)
Reapplies all the received breakpoints as they were received by the API (so, new translations are applied).
Reapplies all the received breakpoints as they were received by the API (so, new translations are applied).
[ "Reapplies", "all", "the", "received", "breakpoints", "as", "they", "were", "received", "by", "the", "API", "(", "so", "new", "translations", "are", "applied", ")", "." ]
def reapply_breakpoints(self, py_db): ''' Reapplies all the received breakpoints as they were received by the API (so, new translations are applied). ''' pydev_log.debug('Reapplying breakpoints.') items = dict_items(py_db.api_received_breakpoints) # Create a copy with it...
[ "def", "reapply_breakpoints", "(", "self", ",", "py_db", ")", ":", "pydev_log", ".", "debug", "(", "'Reapplying breakpoints.'", ")", "items", "=", "dict_items", "(", "py_db", ".", "api_received_breakpoints", ")", "# Create a copy with items to reapply.", "self", ".", ...
https://github.com/microsoft/debugpy/blob/be8dd607f6837244e0b565345e497aff7a0c08bf/src/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_api.py#L575-L585
angeladai/ScanComplete
7ab7b48e5688b3b71c99bdb64b3424e06b064312
src/reader.py
python
ReadSceneBlocksLevel
(data_filepattern, train_samples, dim_block, height_block, stored_dim_block, stored_height_block, is_base_level, hierarchy_level, ...
return (input_blocks, target_blocks, target_sem_blocks, target_lo_blocks, target_sem_lo_blocks)
Reads a batch of block examples from the SSTable files. Args: data_filepattern: String matching input files. train_samples: Train on previous model predictions. dim_block: x/z dimension of train block. height_block: y dimension of train block. stored_dim_block: Stored data x/z dimension (high-res...
Reads a batch of block examples from the SSTable files.
[ "Reads", "a", "batch", "of", "block", "examples", "from", "the", "SSTable", "files", "." ]
def ReadSceneBlocksLevel(data_filepattern, train_samples, dim_block, height_block, stored_dim_block, stored_height_block, is_base_level, hierarch...
[ "def", "ReadSceneBlocksLevel", "(", "data_filepattern", ",", "train_samples", ",", "dim_block", ",", "height_block", ",", "stored_dim_block", ",", "stored_height_block", ",", "is_base_level", ",", "hierarchy_level", ",", "num_quant_levels", ",", "params", ",", "quantize...
https://github.com/angeladai/ScanComplete/blob/7ab7b48e5688b3b71c99bdb64b3424e06b064312/src/reader.py#L16-L164
wistbean/learn_python3_spider
73c873f4845f4385f097e5057407d03dd37a117b
stackoverflow/venv/lib/python3.6/site-packages/lxml/html/html5parser.py
python
fromstring
(html, guess_charset=None, parser=None)
return body
Parse the html, returning a single element/document. This tries to minimally parse the chunk of text, without knowing if it is a fragment or a document. 'base_url' will set the document's base_url attribute (and the tree's docinfo.URL) If `guess_charset` is true, or if the input is not Unicode bu...
Parse the html, returning a single element/document.
[ "Parse", "the", "html", "returning", "a", "single", "element", "/", "document", "." ]
def fromstring(html, guess_charset=None, parser=None): """Parse the html, returning a single element/document. This tries to minimally parse the chunk of text, without knowing if it is a fragment or a document. 'base_url' will set the document's base_url attribute (and the tree's docinfo.URL) ...
[ "def", "fromstring", "(", "html", ",", "guess_charset", "=", "None", ",", "parser", "=", "None", ")", ":", "if", "not", "isinstance", "(", "html", ",", "_strings", ")", ":", "raise", "TypeError", "(", "'string required'", ")", "doc", "=", "document_fromstr...
https://github.com/wistbean/learn_python3_spider/blob/73c873f4845f4385f097e5057407d03dd37a117b/stackoverflow/venv/lib/python3.6/site-packages/lxml/html/html5parser.py#L157-L208
ijkguo/mx-rcnn
e556bb4e0209c2ce55386be8f701115538c3f010
symimdb/coco.py
python
coco._write_coco_results
(self, _coco, detections)
example results [{"image_id": 42, "category_id": 18, "bbox": [258.15,41.29,348.26,243.78], "score": 0.236}, ...]
example results [{"image_id": 42, "category_id": 18, "bbox": [258.15,41.29,348.26,243.78], "score": 0.236}, ...]
[ "example", "results", "[", "{", "image_id", ":", "42", "category_id", ":", "18", "bbox", ":", "[", "258", ".", "15", "41", ".", "29", "348", ".", "26", "243", ".", "78", "]", "score", ":", "0", ".", "236", "}", "...", "]" ]
def _write_coco_results(self, _coco, detections): """ example results [{"image_id": 42, "category_id": 18, "bbox": [258.15,41.29,348.26,243.78], "score": 0.236}, ...] """ cats = [cat['name'] for cat in _coco.loadCats(_coco.getCatIds())] class_to_coco...
[ "def", "_write_coco_results", "(", "self", ",", "_coco", ",", "detections", ")", ":", "cats", "=", "[", "cat", "[", "'name'", "]", "for", "cat", "in", "_coco", ".", "loadCats", "(", "_coco", ".", "getCatIds", "(", ")", ")", "]", "class_to_coco_ind", "=...
https://github.com/ijkguo/mx-rcnn/blob/e556bb4e0209c2ce55386be8f701115538c3f010/symimdb/coco.py#L115-L133
garethdmm/gryphon
73e19fa2d0b64c3fc7dac9e0036fc92e25e5b694
gryphon/lib/assets.py
python
transaction_position_query
(db, amount_field, currency_field, transaction_type=None, start_time=None, end_time=None, include_pending=False, exchange_ids=[])
return query_result_to_position(result)
This sums up a transaction Money field which can have multiple currencies. Takes an optional transaction_type to filter on deposits or withdrawals Returns a multi-currency Position object
This sums up a transaction Money field which can have multiple currencies.
[ "This", "sums", "up", "a", "transaction", "Money", "field", "which", "can", "have", "multiple", "currencies", "." ]
def transaction_position_query(db, amount_field, currency_field, transaction_type=None, start_time=None, end_time=None, include_pending=False, exchange_ids=[]): """ This sums up a transaction Money field which can have multiple currencies. Takes an optional transaction_type to filter on deposits or withdra...
[ "def", "transaction_position_query", "(", "db", ",", "amount_field", ",", "currency_field", ",", "transaction_type", "=", "None", ",", "start_time", "=", "None", ",", "end_time", "=", "None", ",", "include_pending", "=", "False", ",", "exchange_ids", "=", "[", ...
https://github.com/garethdmm/gryphon/blob/73e19fa2d0b64c3fc7dac9e0036fc92e25e5b694/gryphon/lib/assets.py#L325-L390
tenpy/tenpy
bbdd3dbbdb511948eb0e6ba7ff619ac6ca657fff
tenpy/networks/site.py
python
Site.multiply_operators
(self, operators)
return op
Multiply local operators (possibly given by their names) together. Parameters ---------- operators : list of {str | :class:`~tenpy.linalg.np_conserved.Array`} List of valid operator names (to be translated with :meth:`get_op`) or directly on-site operators in the form of...
Multiply local operators (possibly given by their names) together.
[ "Multiply", "local", "operators", "(", "possibly", "given", "by", "their", "names", ")", "together", "." ]
def multiply_operators(self, operators): """Multiply local operators (possibly given by their names) together. Parameters ---------- operators : list of {str | :class:`~tenpy.linalg.np_conserved.Array`} List of valid operator names (to be translated with :meth:`get_op`) or ...
[ "def", "multiply_operators", "(", "self", ",", "operators", ")", ":", "if", "len", "(", "operators", ")", "==", "0", ":", "return", "self", ".", "Id", "op", "=", "operators", "[", "0", "]", "if", "isinstance", "(", "op", ",", "str", ")", ":", "op",...
https://github.com/tenpy/tenpy/blob/bbdd3dbbdb511948eb0e6ba7ff619ac6ca657fff/tenpy/networks/site.py#L440-L467
jython/jython3
def4f8ec47cb7a9c799ea4c745f12badf92c5769
lib-python/3.5.1/http/client.py
python
HTTPMessage.getallmatchingheaders
(self, name)
return lst
Find all header lines matching a given header name. Look through the list of headers and find all lines matching a given header name (and their continuation lines). A list of the lines is returned, without interpretation. If the header does not occur, an empty list is returned. If th...
Find all header lines matching a given header name.
[ "Find", "all", "header", "lines", "matching", "a", "given", "header", "name", "." ]
def getallmatchingheaders(self, name): """Find all header lines matching a given header name. Look through the list of headers and find all lines matching a given header name (and their continuation lines). A list of the lines is returned, without interpretation. If the header does no...
[ "def", "getallmatchingheaders", "(", "self", ",", "name", ")", ":", "name", "=", "name", ".", "lower", "(", ")", "+", "':'", "n", "=", "len", "(", "name", ")", "lst", "=", "[", "]", "hit", "=", "0", "for", "line", "in", "self", ".", "keys", "("...
https://github.com/jython/jython3/blob/def4f8ec47cb7a9c799ea4c745f12badf92c5769/lib-python/3.5.1/http/client.py#L156-L177
aws/sagemaker-python-sdk
9d259b316f7f43838c16f35c10e98a110b56735b
src/sagemaker/tensorflow/model.py
python
TensorFlowPredictor.regress
(self, data)
return self._classify_or_regress(data, "regress")
Placeholder docstring.
Placeholder docstring.
[ "Placeholder", "docstring", "." ]
def regress(self, data): """Placeholder docstring.""" return self._classify_or_regress(data, "regress")
[ "def", "regress", "(", "self", ",", "data", ")", ":", "return", "self", ".", "_classify_or_regress", "(", "data", ",", "\"regress\"", ")" ]
https://github.com/aws/sagemaker-python-sdk/blob/9d259b316f7f43838c16f35c10e98a110b56735b/src/sagemaker/tensorflow/model.py#L81-L83
scikit-video/scikit-video
87c7113a84b50679d9853ba81ba34b557f516b05
skvideo/utils/xmltodict.py
python
parse
(xml_input, encoding=None, expat=expat, process_namespaces=False, namespace_separator=':', **kwargs)
return handler.item
Parse the given XML input and convert it into a dictionary. `xml_input` can either be a `string` or a file-like object. If `xml_attribs` is `True`, element attributes are put in the dictionary among regular child elements, using `@` as a prefix to avoid collisions. If set to `False`, they are just ign...
Parse the given XML input and convert it into a dictionary.
[ "Parse", "the", "given", "XML", "input", "and", "convert", "it", "into", "a", "dictionary", "." ]
def parse(xml_input, encoding=None, expat=expat, process_namespaces=False, namespace_separator=':', **kwargs): """Parse the given XML input and convert it into a dictionary. `xml_input` can either be a `string` or a file-like object. If `xml_attribs` is `True`, element attributes are put in the ...
[ "def", "parse", "(", "xml_input", ",", "encoding", "=", "None", ",", "expat", "=", "expat", ",", "process_namespaces", "=", "False", ",", "namespace_separator", "=", "':'", ",", "*", "*", "kwargs", ")", ":", "handler", "=", "_DictSAXHandler", "(", "namespa...
https://github.com/scikit-video/scikit-video/blob/87c7113a84b50679d9853ba81ba34b557f516b05/skvideo/utils/xmltodict.py#L176-L301
rucio/rucio
6d0d358e04f5431f0b9a98ae40f31af0ddff4833
lib/rucio/client/dq2client.py
python
DQ2Client.getDatasetSize
(self, dsn, scope)
return size
Used to get the dataset size @param dsn: is the dataset name. @param scope: is the dataset scope. B{Exceptions:} - DataIdentifierNotFound is raised in case the dataset name doesn't exist. @return: Size as integer
Used to get the dataset size
[ "Used", "to", "get", "the", "dataset", "size" ]
def getDatasetSize(self, dsn, scope): """ Used to get the dataset size @param dsn: is the dataset name. @param scope: is the dataset scope. B{Exceptions:} - DataIdentifierNotFound is raised in case the dataset name doesn't exist. @return: Size as integer ...
[ "def", "getDatasetSize", "(", "self", ",", "dsn", ",", "scope", ")", ":", "size", "=", "0", "for", "f", "in", "self", ".", "client", ".", "list_files", "(", "scope", "=", "scope", ",", "name", "=", "dsn", ")", ":", "size", "+=", "f", "[", "'bytes...
https://github.com/rucio/rucio/blob/6d0d358e04f5431f0b9a98ae40f31af0ddff4833/lib/rucio/client/dq2client.py#L336-L351
oracle/oci-python-sdk
3c1604e4e212008fb6718e2f68cdb5ef71fd5793
src/oci/mysql/db_system_client_composite_operations.py
python
DbSystemClientCompositeOperations.delete_analytics_cluster_and_wait_for_state
(self, db_system_id, wait_for_states=[], operation_kwargs={}, waiter_kwargs={})
Calls :py:func:`~oci.mysql.DbSystemClient.delete_analytics_cluster` and waits for the :py:class:`~oci.mysql.models.WorkRequest` to enter the given state(s). :param str db_system_id: (required) The DB System `OCID`__. __ https://docs.cloud.oracle.com/Content/General/Concepts/ide...
Calls :py:func:`~oci.mysql.DbSystemClient.delete_analytics_cluster` and waits for the :py:class:`~oci.mysql.models.WorkRequest` to enter the given state(s).
[ "Calls", ":", "py", ":", "func", ":", "~oci", ".", "mysql", ".", "DbSystemClient", ".", "delete_analytics_cluster", "and", "waits", "for", "the", ":", "py", ":", "class", ":", "~oci", ".", "mysql", ".", "models", ".", "WorkRequest", "to", "enter", "the",...
def delete_analytics_cluster_and_wait_for_state(self, db_system_id, wait_for_states=[], operation_kwargs={}, waiter_kwargs={}): """ Calls :py:func:`~oci.mysql.DbSystemClient.delete_analytics_cluster` and waits for the :py:class:`~oci.mysql.models.WorkRequest` to enter the given state(s). ...
[ "def", "delete_analytics_cluster_and_wait_for_state", "(", "self", ",", "db_system_id", ",", "wait_for_states", "=", "[", "]", ",", "operation_kwargs", "=", "{", "}", ",", "waiter_kwargs", "=", "{", "}", ")", ":", "operation_result", "=", "None", "try", ":", "...
https://github.com/oracle/oci-python-sdk/blob/3c1604e4e212008fb6718e2f68cdb5ef71fd5793/src/oci/mysql/db_system_client_composite_operations.py#L150-L196
facebookresearch/ParlAI
e4d59c30eef44f1f67105961b82a83fd28d7d78b
parlai/agents/rag/modules.py
python
RagModel.seq2seq_forward_pass
( self, xs: torch.LongTensor, ys: torch.LongTensor )
return logits, preds, encoder_states
Simulate a standard seq2seq encoder/decoder forward pass. Used in thorough decoding. :param xs: input tokens :param ys: teacher forced decoder outputs :return (logits, preds, encoder_states): logits: token output distribution preds: max ...
Simulate a standard seq2seq encoder/decoder forward pass.
[ "Simulate", "a", "standard", "seq2seq", "encoder", "/", "decoder", "forward", "pass", "." ]
def seq2seq_forward_pass( self, xs: torch.LongTensor, ys: torch.LongTensor ) -> Tuple[torch.Tensor, torch.Tensor, Tuple[Any, ...]]: """ Simulate a standard seq2seq encoder/decoder forward pass. Used in thorough decoding. :param xs: input tokens :param ys...
[ "def", "seq2seq_forward_pass", "(", "self", ",", "xs", ":", "torch", ".", "LongTensor", ",", "ys", ":", "torch", ".", "LongTensor", ")", "->", "Tuple", "[", "torch", ".", "Tensor", ",", "torch", ".", "Tensor", ",", "Tuple", "[", "Any", ",", "...", "]...
https://github.com/facebookresearch/ParlAI/blob/e4d59c30eef44f1f67105961b82a83fd28d7d78b/parlai/agents/rag/modules.py#L238-L273
xmengli/H-DenseUNet
06cc436a43196310fe933d114a353839907cc176
Keras-2.0.8/keras/backend/theano_backend.py
python
batch_flatten
(x)
return y
Turn a n-D tensor into a 2D tensor where the first dimension is conserved.
Turn a n-D tensor into a 2D tensor where the first dimension is conserved.
[ "Turn", "a", "n", "-", "D", "tensor", "into", "a", "2D", "tensor", "where", "the", "first", "dimension", "is", "conserved", "." ]
def batch_flatten(x): """Turn a n-D tensor into a 2D tensor where the first dimension is conserved. """ y = T.reshape(x, (x.shape[0], T.prod(x.shape[1:]))) if hasattr(x, '_keras_shape'): if None in x._keras_shape[1:]: y._keras_shape = (x._keras_shape[0], None) else: ...
[ "def", "batch_flatten", "(", "x", ")", ":", "y", "=", "T", ".", "reshape", "(", "x", ",", "(", "x", ".", "shape", "[", "0", "]", ",", "T", ".", "prod", "(", "x", ".", "shape", "[", "1", ":", "]", ")", ")", ")", "if", "hasattr", "(", "x", ...
https://github.com/xmengli/H-DenseUNet/blob/06cc436a43196310fe933d114a353839907cc176/Keras-2.0.8/keras/backend/theano_backend.py#L993-L1003
googleads/google-ads-python
2a1d6062221f6aad1992a6bcca0e7e4a93d2db86
google/ads/googleads/v7/services/services/campaign_experiment_service/transports/grpc.py
python
CampaignExperimentServiceGrpcTransport.__init__
( self, *, host: str = "googleads.googleapis.com", credentials: credentials.Credentials = None, credentials_file: str = None, scopes: Sequence[str] = None, channel: grpc.Channel = None, api_mtls_endpoint: str = None, client_cert_source: Callable[[]...
Instantiate the transport. Args: host (Optional[str]): The hostname to connect to. credentials (Optional[google.auth.credentials.Credentials]): The authorization credentials to attach to requests. These credentials identify the applicatio...
Instantiate the transport.
[ "Instantiate", "the", "transport", "." ]
def __init__( self, *, host: str = "googleads.googleapis.com", credentials: credentials.Credentials = None, credentials_file: str = None, scopes: Sequence[str] = None, channel: grpc.Channel = None, api_mtls_endpoint: str = None, client_cert_source:...
[ "def", "__init__", "(", "self", ",", "*", ",", "host", ":", "str", "=", "\"googleads.googleapis.com\"", ",", "credentials", ":", "credentials", ".", "Credentials", "=", "None", ",", "credentials_file", ":", "str", "=", "None", ",", "scopes", ":", "Sequence",...
https://github.com/googleads/google-ads-python/blob/2a1d6062221f6aad1992a6bcca0e7e4a93d2db86/google/ads/googleads/v7/services/services/campaign_experiment_service/transports/grpc.py#L60-L188
biolab/orange2
db40a9449cb45b507d63dcd5739b223f9cffb8e6
Orange/OrangeCanvas/scheme/scheme.py
python
Scheme.annotations
(self)
return list(self.__annotations)
A list of all annotations (:class:`.BaseSchemeAnnotation`) in the scheme.
A list of all annotations (:class:`.BaseSchemeAnnotation`) in the scheme.
[ "A", "list", "of", "all", "annotations", "(", ":", "class", ":", ".", "BaseSchemeAnnotation", ")", "in", "the", "scheme", "." ]
def annotations(self): """ A list of all annotations (:class:`.BaseSchemeAnnotation`) in the scheme. """ return list(self.__annotations)
[ "def", "annotations", "(", "self", ")", ":", "return", "list", "(", "self", ".", "__annotations", ")" ]
https://github.com/biolab/orange2/blob/db40a9449cb45b507d63dcd5739b223f9cffb8e6/Orange/OrangeCanvas/scheme/scheme.py#L121-L127
JiYou/openstack
8607dd488bde0905044b303eb6e52bdea6806923
packages/source/nova/nova/compute/manager.py
python
ComputeManager.host_maintenance_mode
(self, context, host, mode)
return self.driver.host_maintenance_mode(host, mode)
Start/Stop host maintenance window. On start, it triggers guest VMs evacuation.
Start/Stop host maintenance window. On start, it triggers guest VMs evacuation.
[ "Start", "/", "Stop", "host", "maintenance", "window", ".", "On", "start", "it", "triggers", "guest", "VMs", "evacuation", "." ]
def host_maintenance_mode(self, context, host, mode): """Start/Stop host maintenance window. On start, it triggers guest VMs evacuation.""" return self.driver.host_maintenance_mode(host, mode)
[ "def", "host_maintenance_mode", "(", "self", ",", "context", ",", "host", ",", "mode", ")", ":", "return", "self", ".", "driver", ".", "host_maintenance_mode", "(", "host", ",", "mode", ")" ]
https://github.com/JiYou/openstack/blob/8607dd488bde0905044b303eb6e52bdea6806923/packages/source/nova/nova/compute/manager.py#L2595-L2598
haiwen/seahub
e92fcd44e3e46260597d8faa9347cb8222b8b10d
scripts/build/build-pro.py
python
check_targz_src_no_version
(proj, srcdir)
[]
def check_targz_src_no_version(proj, srcdir): src_tarball = os.path.join(srcdir, '%s.tar.gz' % proj) if not os.path.exists(src_tarball): error('%s not exists' % src_tarball)
[ "def", "check_targz_src_no_version", "(", "proj", ",", "srcdir", ")", ":", "src_tarball", "=", "os", ".", "path", ".", "join", "(", "srcdir", ",", "'%s.tar.gz'", "%", "proj", ")", "if", "not", "os", ".", "path", ".", "exists", "(", "src_tarball", ")", ...
https://github.com/haiwen/seahub/blob/e92fcd44e3e46260597d8faa9347cb8222b8b10d/scripts/build/build-pro.py#L358-L361
pwnieexpress/pwn_plug_sources
1a23324f5dc2c3de20f9c810269b6a29b2758cad
src/set/src/core/scapy.py
python
Dot1Q.default_payload_class
(self, pay)
return Raw
[]
def default_payload_class(self, pay): if self.type <= 1500: return LLC return Raw
[ "def", "default_payload_class", "(", "self", ",", "pay", ")", ":", "if", "self", ".", "type", "<=", "1500", ":", "return", "LLC", "return", "Raw" ]
https://github.com/pwnieexpress/pwn_plug_sources/blob/1a23324f5dc2c3de20f9c810269b6a29b2758cad/src/set/src/core/scapy.py#L6129-L6132
cloudera/impyla
0c736af4cad2bade9b8e313badc08ec50e81c948
impala/_thrift_gen/hive_metastore/ThriftHiveMetastore.py
python
rename_partition_result.__repr__
(self)
return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
[]
def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
[ "def", "__repr__", "(", "self", ")", ":", "L", "=", "[", "'%s=%r'", "%", "(", "key", ",", "value", ")", "for", "key", ",", "value", "in", "self", ".", "__dict__", ".", "items", "(", ")", "]", "return", "'%s(%s)'", "%", "(", "self", ".", "__class_...
https://github.com/cloudera/impyla/blob/0c736af4cad2bade9b8e313badc08ec50e81c948/impala/_thrift_gen/hive_metastore/ThriftHiveMetastore.py#L23158-L23161
psychopy/psychopy
01b674094f38d0e0bd51c45a6f66f671d7041696
psychopy/hardware/crs/bits.py
python
DisplayPlusPlusTouch.getTouchEvent
(self, N=0, distance=None, t=None, type=None)
return value
Scans the touch log to return the Nth touch event. You need to run getTouchLog before you run this function. Returns as list of Dict like structures with members time, x, y, and dir time is the time stamp of the event. x and y are the x an...
Scans the touch log to return the Nth touch event. You need to run getTouchLog before you run this function. Returns as list of Dict like structures with members time, x, y, and dir time is the time stamp of the event. x and y are the x an...
[ "Scans", "the", "touch", "log", "to", "return", "the", "Nth", "touch", "event", ".", "You", "need", "to", "run", "getTouchLog", "before", "you", "run", "this", "function", ".", "Returns", "as", "list", "of", "Dict", "like", "structures", "with", "members",...
def getTouchEvent(self, N=0, distance=None, t=None, type=None): """ Scans the touch log to return the Nth touch event. You need to run getTouchLog before you run this function. Returns as list of Dict like structures with members time, x, y, and dir ...
[ "def", "getTouchEvent", "(", "self", ",", "N", "=", "0", ",", "distance", "=", "None", ",", "t", "=", "None", ",", "type", "=", "None", ")", ":", "values", "=", "self", ".", "getTouchEvents", "(", "distance", ",", "t", ",", "type", ")", "value", ...
https://github.com/psychopy/psychopy/blob/01b674094f38d0e0bd51c45a6f66f671d7041696/psychopy/hardware/crs/bits.py#L5187-L5219
JaniceWuo/MovieRecommend
4c86db64ca45598917d304f535413df3bc9fea65
movierecommend/venv1/Lib/site-packages/django/core/management/base.py
python
AppCommand.add_arguments
(self, parser)
[]
def add_arguments(self, parser): parser.add_argument('args', metavar='app_label', nargs='+', help='One or more application label.')
[ "def", "add_arguments", "(", "self", ",", "parser", ")", ":", "parser", ".", "add_argument", "(", "'args'", ",", "metavar", "=", "'app_label'", ",", "nargs", "=", "'+'", ",", "help", "=", "'One or more application label.'", ")" ]
https://github.com/JaniceWuo/MovieRecommend/blob/4c86db64ca45598917d304f535413df3bc9fea65/movierecommend/venv1/Lib/site-packages/django/core/management/base.py#L465-L466
aws/aws-sam-cli
2aa7bf01b2e0b0864ef63b1898a8b30577443acc
samcli/lib/bootstrap/companion_stack/data_types.py
python
CompanionStack.escaped_parent_stack_name
(self)
return self._escaped_parent_stack_name
Parent stack name with only alphanumeric characters
Parent stack name with only alphanumeric characters
[ "Parent", "stack", "name", "with", "only", "alphanumeric", "characters" ]
def escaped_parent_stack_name(self) -> str: """ Parent stack name with only alphanumeric characters """ return self._escaped_parent_stack_name
[ "def", "escaped_parent_stack_name", "(", "self", ")", "->", "str", ":", "return", "self", ".", "_escaped_parent_stack_name" ]
https://github.com/aws/aws-sam-cli/blob/2aa7bf01b2e0b0864ef63b1898a8b30577443acc/samcli/lib/bootstrap/companion_stack/data_types.py#L38-L42
mongodb/mongo-python-driver
c760f900f2e4109a247c2ffc8ad3549362007772
pymongo/pool.py
python
SocketInfo.add_server_api
(self, command)
Add server_api parameters.
Add server_api parameters.
[ "Add", "server_api", "parameters", "." ]
def add_server_api(self, command): """Add server_api parameters.""" if self.opts.server_api: _add_to_command(command, self.opts.server_api)
[ "def", "add_server_api", "(", "self", ",", "command", ")", ":", "if", "self", ".", "opts", ".", "server_api", ":", "_add_to_command", "(", "command", ",", "self", ".", "opts", ".", "server_api", ")" ]
https://github.com/mongodb/mongo-python-driver/blob/c760f900f2e4109a247c2ffc8ad3549362007772/pymongo/pool.py#L850-L853
zaxlct/imooc-django
daf1ced745d3d21989e8191b658c293a511b37fd
extra_apps/xadmin/views/dashboard.py
python
ModelChoiceField.__deepcopy__
(self, memo)
return result
[]
def __deepcopy__(self, memo): result = forms.Field.__deepcopy__(self, memo) return result
[ "def", "__deepcopy__", "(", "self", ",", "memo", ")", ":", "result", "=", "forms", ".", "Field", ".", "__deepcopy__", "(", "self", ",", "memo", ")", "return", "result" ]
https://github.com/zaxlct/imooc-django/blob/daf1ced745d3d21989e8191b658c293a511b37fd/extra_apps/xadmin/views/dashboard.py#L285-L287
Azure/azure-linux-extensions
a42ef718c746abab2b3c6a21da87b29e76364558
VMEncryption/main/ResourceDiskUtil.py
python
ResourceDiskUtil._configure_fstab
(self)
return True
remove resource disk from /etc/fstab if present
remove resource disk from /etc/fstab if present
[ "remove", "resource", "disk", "from", "/", "etc", "/", "fstab", "if", "present" ]
def _configure_fstab(self): """ remove resource disk from /etc/fstab if present """ cmd = "sed -i.bak '/azure_resource-part1/d' /etc/fstab" if self.executor.ExecuteInBash(cmd) != CommonVariables.process_success: self.logger.log(msg="Failed to configure resource disk entry of /etc/fst...
[ "def", "_configure_fstab", "(", "self", ")", ":", "cmd", "=", "\"sed -i.bak '/azure_resource-part1/d' /etc/fstab\"", "if", "self", ".", "executor", ".", "ExecuteInBash", "(", "cmd", ")", "!=", "CommonVariables", ".", "process_success", ":", "self", ".", "logger", ...
https://github.com/Azure/azure-linux-extensions/blob/a42ef718c746abab2b3c6a21da87b29e76364558/VMEncryption/main/ResourceDiskUtil.py#L114-L120
chipmuenk/pyfda
665310b8548a940a575c0e5ff4bba94608d9ac26
pyfda/libs/tree_builder.py
python
Tree_Builder.build_fil_tree
(self, fc, rt_dict, fil_tree=None)
return fil_tree
Read attributes (ft, rt, rt:fo) from filter class fc) Attributes are stored in the design method classes in the format (example from ``common.py``) .. code-block:: python self.ft = 'IIR' self.rt_dict = { 'LP': {'man':{'fo': ('a','N'), ...
Read attributes (ft, rt, rt:fo) from filter class fc) Attributes are stored in the design method classes in the format (example from ``common.py``)
[ "Read", "attributes", "(", "ft", "rt", "rt", ":", "fo", ")", "from", "filter", "class", "fc", ")", "Attributes", "are", "stored", "in", "the", "design", "method", "classes", "in", "the", "format", "(", "example", "from", "common", ".", "py", ")" ]
def build_fil_tree(self, fc, rt_dict, fil_tree=None): """ Read attributes (ft, rt, rt:fo) from filter class fc) Attributes are stored in the design method classes in the format (example from ``common.py``) .. code-block:: python self.ft = 'IIR' self.rt_d...
[ "def", "build_fil_tree", "(", "self", ",", "fc", ",", "rt_dict", ",", "fil_tree", "=", "None", ")", ":", "if", "not", "fil_tree", ":", "fil_tree", "=", "{", "}", "ft", "=", "ff", ".", "fil_inst", ".", "ft", "# get filter type (e.g. 'FIR')", "for", "rt", ...
https://github.com/chipmuenk/pyfda/blob/665310b8548a940a575c0e5ff4bba94608d9ac26/pyfda/libs/tree_builder.py#L600-L709
openstack/nova
b49b7663e1c3073917d5844b81d38db8e86d05c4
nova/virt/libvirt/volume/fibrechannel.py
python
LibvirtFibreChannelVolumeDriver.disconnect_volume
(self, connection_info, instance)
Detach the volume from instance_name.
Detach the volume from instance_name.
[ "Detach", "the", "volume", "from", "instance_name", "." ]
def disconnect_volume(self, connection_info, instance): """Detach the volume from instance_name.""" LOG.debug("calling os-brick to detach FC Volume", instance=instance) # TODO(walter-boring) eliminated the need for preserving # multipath_id. Use scsi_id instead of multipath -ll ...
[ "def", "disconnect_volume", "(", "self", ",", "connection_info", ",", "instance", ")", ":", "LOG", ".", "debug", "(", "\"calling os-brick to detach FC Volume\"", ",", "instance", "=", "instance", ")", "# TODO(walter-boring) eliminated the need for preserving", "# multipath_...
https://github.com/openstack/nova/blob/b49b7663e1c3073917d5844b81d38db8e86d05c4/nova/virt/libvirt/volume/fibrechannel.py#L62-L76
littlecodersh/ItChat
d5ce5db32ca15cef8eefa548a438a9fcc4502a6d
itchat/components/login.py
python
web_init
(self)
return dic
[]
def web_init(self): url = '%s/webwxinit' % self.loginInfo['url'] params = { 'r': int(-time.time() / 1579), 'pass_ticket': self.loginInfo['pass_ticket'], } data = { 'BaseRequest': self.loginInfo['BaseRequest'], } headers = { 'ContentType': 'application/json; charset=UTF-8', ...
[ "def", "web_init", "(", "self", ")", ":", "url", "=", "'%s/webwxinit'", "%", "self", ".", "loginInfo", "[", "'url'", "]", "params", "=", "{", "'r'", ":", "int", "(", "-", "time", ".", "time", "(", ")", "/", "1579", ")", ",", "'pass_ticket'", ":", ...
https://github.com/littlecodersh/ItChat/blob/d5ce5db32ca15cef8eefa548a438a9fcc4502a6d/itchat/components/login.py#L188-L225
kuri65536/python-for-android
26402a08fc46b09ef94e8d7a6bbc3a54ff9d0891
python-build/python-libs/gdata/src/gdata/tlslite/Session.py
python
Session.valid
(self)
return self.resumable or self.sharedKey
If this session can be used for session resumption. @rtype: bool @return: If this session can be used for session resumption.
If this session can be used for session resumption.
[ "If", "this", "session", "can", "be", "used", "for", "session", "resumption", "." ]
def valid(self): """If this session can be used for session resumption. @rtype: bool @return: If this session can be used for session resumption. """ return self.resumable or self.sharedKey
[ "def", "valid", "(", "self", ")", ":", "return", "self", ".", "resumable", "or", "self", ".", "sharedKey" ]
https://github.com/kuri65536/python-for-android/blob/26402a08fc46b09ef94e8d7a6bbc3a54ff9d0891/python-build/python-libs/gdata/src/gdata/tlslite/Session.py#L76-L82
sagemath/sage
f9b2db94f675ff16963ccdefba4f1a3393b3fe0d
src/sage/quadratic_forms/quadratic_form__automorphisms.py
python
_compute_automorphisms
(self)
Call PARI to compute the automorphism group of the quadratic form. This uses :pari:`qfauto`. OUTPUT: None, this just caches the result. TESTS:: sage: DiagonalQuadraticForm(ZZ, [-1,1,1])._compute_automorphisms() Traceback (most recent call last): ... ValueError: not a defi...
Call PARI to compute the automorphism group of the quadratic form.
[ "Call", "PARI", "to", "compute", "the", "automorphism", "group", "of", "the", "quadratic", "form", "." ]
def _compute_automorphisms(self): """ Call PARI to compute the automorphism group of the quadratic form. This uses :pari:`qfauto`. OUTPUT: None, this just caches the result. TESTS:: sage: DiagonalQuadraticForm(ZZ, [-1,1,1])._compute_automorphisms() Traceback (most recent call las...
[ "def", "_compute_automorphisms", "(", "self", ")", ":", "if", "self", ".", "base_ring", "(", ")", "is", "not", "ZZ", ":", "raise", "NotImplementedError", "(", "\"computing the automorphism group of a quadratic form is only supported over ZZ\"", ")", "if", "not", "self",...
https://github.com/sagemath/sage/blob/f9b2db94f675ff16963ccdefba4f1a3393b3fe0d/src/sage/quadratic_forms/quadratic_form__automorphisms.py#L260-L289
inducer/pudb
82a0017982f20917c17989a0cb2b71c54ee90ba7
pudb/debugger.py
python
Debugger.user_return
(self, frame, return_value)
This function is called when a return trap is set here.
This function is called when a return trap is set here.
[ "This", "function", "is", "called", "when", "a", "return", "trap", "is", "set", "here", "." ]
def user_return(self, frame, return_value): """This function is called when a return trap is set here.""" if frame.f_code.co_name != "<module>": frame.f_locals["__return__"] = return_value if self._wait_for_mainpyfile: if (self.mainpyfile != self.canonic(frame.f_code.co_...
[ "def", "user_return", "(", "self", ",", "frame", ",", "return_value", ")", ":", "if", "frame", ".", "f_code", ".", "co_name", "!=", "\"<module>\"", ":", "frame", ".", "f_locals", "[", "\"__return__\"", "]", "=", "return_value", "if", "self", ".", "_wait_fo...
https://github.com/inducer/pudb/blob/82a0017982f20917c17989a0cb2b71c54ee90ba7/pudb/debugger.py#L459-L472
CvvT/dumpDex
92ab3b7e996194a06bf1dd5538a4954e8a5ee9c1
python/idaapi.py
python
varloc_t._consume_scattered
(self, *args)
return _idaapi.varloc_t__consume_scattered(self, *args)
_consume_scattered(self, p) -> bool
_consume_scattered(self, p) -> bool
[ "_consume_scattered", "(", "self", "p", ")", "-", ">", "bool" ]
def _consume_scattered(self, *args): """ _consume_scattered(self, p) -> bool """ return _idaapi.varloc_t__consume_scattered(self, *args)
[ "def", "_consume_scattered", "(", "self", ",", "*", "args", ")", ":", "return", "_idaapi", ".", "varloc_t__consume_scattered", "(", "self", ",", "*", "args", ")" ]
https://github.com/CvvT/dumpDex/blob/92ab3b7e996194a06bf1dd5538a4954e8a5ee9c1/python/idaapi.py#L32249-L32253
noxrepo/pox
5f82461e01f8822bd7336603b361bff4ffbd2380
pox/datapaths/switch.py
python
SoftwareSwitchBase._rx_packet_out
(self, packet_out, connection)
Handles packet_outs
Handles packet_outs
[ "Handles", "packet_outs" ]
def _rx_packet_out (self, packet_out, connection): """ Handles packet_outs """ self.log.debug("Packet out details: %s", packet_out.show()) if packet_out.data: self._process_actions_for_packet(packet_out.actions, packet_out.data, packet_out.in_port, packe...
[ "def", "_rx_packet_out", "(", "self", ",", "packet_out", ",", "connection", ")", ":", "self", ".", "log", ".", "debug", "(", "\"Packet out details: %s\"", ",", "packet_out", ".", "show", "(", ")", ")", "if", "packet_out", ".", "data", ":", "self", ".", "...
https://github.com/noxrepo/pox/blob/5f82461e01f8822bd7336603b361bff4ffbd2380/pox/datapaths/switch.py#L312-L327
sagemath/sage
f9b2db94f675ff16963ccdefba4f1a3393b3fe0d
src/sage/rings/valuation/trivial_valuation.py
python
TrivialValuationFactory.create_key
(self, domain)
return domain,
r""" Create a key that identifies this valuation. EXAMPLES:: sage: valuations.TrivialValuation(QQ) is valuations.TrivialValuation(QQ) # indirect doctest True
r""" Create a key that identifies this valuation.
[ "r", "Create", "a", "key", "that", "identifies", "this", "valuation", "." ]
def create_key(self, domain): r""" Create a key that identifies this valuation. EXAMPLES:: sage: valuations.TrivialValuation(QQ) is valuations.TrivialValuation(QQ) # indirect doctest True """ return domain,
[ "def", "create_key", "(", "self", ",", "domain", ")", ":", "return", "domain", "," ]
https://github.com/sagemath/sage/blob/f9b2db94f675ff16963ccdefba4f1a3393b3fe0d/src/sage/rings/valuation/trivial_valuation.py#L56-L66
DataDog/integrations-core
934674b29d94b70ccc008f76ea172d0cdae05e1e
citrix_hypervisor/datadog_checks/citrix_hypervisor/config_models/shared.py
python
SharedConfig._initial_validation
(cls, values)
return validation.core.initialize_config(getattr(validators, 'initialize_shared', identity)(values))
[]
def _initial_validation(cls, values): return validation.core.initialize_config(getattr(validators, 'initialize_shared', identity)(values))
[ "def", "_initial_validation", "(", "cls", ",", "values", ")", ":", "return", "validation", ".", "core", ".", "initialize_config", "(", "getattr", "(", "validators", ",", "'initialize_shared'", ",", "identity", ")", "(", "values", ")", ")" ]
https://github.com/DataDog/integrations-core/blob/934674b29d94b70ccc008f76ea172d0cdae05e1e/citrix_hypervisor/datadog_checks/citrix_hypervisor/config_models/shared.py#L41-L42
1012598167/flask_mongodb_game
60c7e0351586656ec38f851592886338e50b4110
python_flask/venv/Lib/site-packages/werkzeug/debug/tbtools.py
python
Frame.get_annotated_lines
(self)
return lines
Helper function that returns lines with extra information.
Helper function that returns lines with extra information.
[ "Helper", "function", "that", "returns", "lines", "with", "extra", "information", "." ]
def get_annotated_lines(self): """Helper function that returns lines with extra information.""" lines = [Line(idx + 1, x) for idx, x in enumerate(self.sourcelines)] # find function definition and mark lines if hasattr(self.code, "co_firstlineno"): lineno = self.code.co_first...
[ "def", "get_annotated_lines", "(", "self", ")", ":", "lines", "=", "[", "Line", "(", "idx", "+", "1", ",", "x", ")", "for", "idx", ",", "x", "in", "enumerate", "(", "self", ".", "sourcelines", ")", "]", "# find function definition and mark lines", "if", ...
https://github.com/1012598167/flask_mongodb_game/blob/60c7e0351586656ec38f851592886338e50b4110/python_flask/venv/Lib/site-packages/werkzeug/debug/tbtools.py#L524-L548
zhl2008/awd-platform
0416b31abea29743387b10b3914581fbe8e7da5e
web_flaskbb/lib/python2.7/site-packages/sqlalchemy/sql/naming.py
python
ConventionDict._key_referred_table_name
(self)
return reftable
[]
def _key_referred_table_name(self): fk = self.const.elements[0] refs = fk.target_fullname.split(".") if len(refs) == 3: refschema, reftable, refcol = refs else: reftable, refcol = refs return reftable
[ "def", "_key_referred_table_name", "(", "self", ")", ":", "fk", "=", "self", ".", "const", ".", "elements", "[", "0", "]", "refs", "=", "fk", ".", "target_fullname", ".", "split", "(", "\".\"", ")", "if", "len", "(", "refs", ")", "==", "3", ":", "r...
https://github.com/zhl2008/awd-platform/blob/0416b31abea29743387b10b3914581fbe8e7da5e/web_flaskbb/lib/python2.7/site-packages/sqlalchemy/sql/naming.py#L57-L64