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
EnterpriseDB/barman
487bad92edec72712531ead4746fad72bb310270
barman/cloud.py
python
CloudInterface.list_bucket
(self, prefix="", delimiter="/")
List bucket content in a directory manner :param str prefix: :param str delimiter: :return: List of objects and dirs right under the prefix :rtype: List[str]
List bucket content in a directory manner
[ "List", "bucket", "content", "in", "a", "directory", "manner" ]
def list_bucket(self, prefix="", delimiter="/"): """ List bucket content in a directory manner :param str prefix: :param str delimiter: :return: List of objects and dirs right under the prefix :rtype: List[str] """
[ "def", "list_bucket", "(", "self", ",", "prefix", "=", "\"\"", ",", "delimiter", "=", "\"/\"", ")", ":" ]
https://github.com/EnterpriseDB/barman/blob/487bad92edec72712531ead4746fad72bb310270/barman/cloud.py#L916-L924
ARISE-Initiative/robosuite
a5dfaf03cd769170881a1931d8f19c8eb72f531a
robosuite/controllers/joint_vel.py
python
JointVelocityController.set_goal
(self, velocities)
Sets goal based on input @velocities. Args: velocities (Iterable): Desired joint velocities Raises: AssertionError: [Invalid action dimension size]
Sets goal based on input @velocities.
[ "Sets", "goal", "based", "on", "input", "@velocities", "." ]
def set_goal(self, velocities): """ Sets goal based on input @velocities. Args: velocities (Iterable): Desired joint velocities Raises: AssertionError: [Invalid action dimension size] """ # Update state self.update() # Otherwise,...
[ "def", "set_goal", "(", "self", ",", "velocities", ")", ":", "# Update state", "self", ".", "update", "(", ")", "# Otherwise, check to make sure velocities is size self.joint_dim", "assert", "(", "len", "(", "velocities", ")", "==", "self", ".", "joint_dim", ")", ...
https://github.com/ARISE-Initiative/robosuite/blob/a5dfaf03cd769170881a1931d8f19c8eb72f531a/robosuite/controllers/joint_vel.py#L122-L147
wummel/linkchecker
c2ce810c3fb00b895a841a7be6b2e78c64e7b042
third_party/dnspython/dns/zone.py
python
Zone.__contains__
(self, other)
return other in self.nodes
[]
def __contains__(self, other): return other in self.nodes
[ "def", "__contains__", "(", "self", ",", "other", ")", ":", "return", "other", "in", "self", ".", "nodes" ]
https://github.com/wummel/linkchecker/blob/c2ce810c3fb00b895a841a7be6b2e78c64e7b042/third_party/dnspython/dns/zone.py#L158-L159
sailfish-team/sailfish
b7140c580e1f4cb406dde947c8d8d5a8a6b2d79e
sailfish/util.py
python
in_anyd
(arr1, arr2)
return np.in1d(arr1, arr2).reshape(arr1.shape)
Wrapper around np.in1d which returns an array with the same shape as arr1
Wrapper around np.in1d which returns an array with the same shape as arr1
[ "Wrapper", "around", "np", ".", "in1d", "which", "returns", "an", "array", "with", "the", "same", "shape", "as", "arr1" ]
def in_anyd(arr1, arr2): """Wrapper around np.in1d which returns an array with the same shape as arr1""" return np.in1d(arr1, arr2).reshape(arr1.shape)
[ "def", "in_anyd", "(", "arr1", ",", "arr2", ")", ":", "return", "np", ".", "in1d", "(", "arr1", ",", "arr2", ")", ".", "reshape", "(", "arr1", ".", "shape", ")" ]
https://github.com/sailfish-team/sailfish/blob/b7140c580e1f4cb406dde947c8d8d5a8a6b2d79e/sailfish/util.py#L130-L132
nightmaredimple/libmot
23b8e2ac00f8b45d5a0ecabd57af90585966f3ff
libmot/tracker/DAN/tracker.py
python
Tracks.core_merge
(self, t1, t2)
Merge t2 to t1, after that t2 is set invalid
Merge t2 to t1, after that t2 is set invalid
[ "Merge", "t2", "to", "t1", "after", "that", "t2", "is", "set", "invalid" ]
def core_merge(self, t1, t2): """Merge t2 to t1, after that t2 is set invalid """ all_f1 = [n.frame_index for n in t1.nodes] all_f2 = [n.frame_index for n in t2.nodes] for i, f2 in enumerate(all_f2): if f2 not in all_f1: insert_pos = 0 ...
[ "def", "core_merge", "(", "self", ",", "t1", ",", "t2", ")", ":", "all_f1", "=", "[", "n", ".", "frame_index", "for", "n", "in", "t1", ".", "nodes", "]", "all_f2", "=", "[", "n", ".", "frame_index", "for", "n", "in", "t2", ".", "nodes", "]", "f...
https://github.com/nightmaredimple/libmot/blob/23b8e2ac00f8b45d5a0ecabd57af90585966f3ff/libmot/tracker/DAN/tracker.py#L393-L412
Tautulli/Tautulli
2410eb33805aaac4bd1c5dad0f71e4f15afaf742
lib/future/backports/urllib/parse.py
python
to_bytes
(url)
return url
to_bytes(u"URL") --> 'URL'.
to_bytes(u"URL") --> 'URL'.
[ "to_bytes", "(", "u", "URL", ")", "--", ">", "URL", "." ]
def to_bytes(url): """to_bytes(u"URL") --> 'URL'.""" # Most URL schemes require ASCII. If that changes, the conversion # can be relaxed. # XXX get rid of to_bytes() if isinstance(url, str): try: url = url.encode("ASCII").decode() except UnicodeError: raise Uni...
[ "def", "to_bytes", "(", "url", ")", ":", "# Most URL schemes require ASCII. If that changes, the conversion", "# can be relaxed.", "# XXX get rid of to_bytes()", "if", "isinstance", "(", "url", ",", "str", ")", ":", "try", ":", "url", "=", "url", ".", "encode", "(", ...
https://github.com/Tautulli/Tautulli/blob/2410eb33805aaac4bd1c5dad0f71e4f15afaf742/lib/future/backports/urllib/parse.py#L840-L851
koniu/recoll-webui
c3151abc2b4416fb4a63b7833b8c99d17e3ace6e
bottle.py
python
Bottle.wsgi
(self, environ, start_response)
The bottle WSGI-interface.
The bottle WSGI-interface.
[ "The", "bottle", "WSGI", "-", "interface", "." ]
def wsgi(self, environ, start_response): """ The bottle WSGI-interface. """ try: environ['bottle.app'] = self request.bind(environ) response.bind() out = self._cast(self._handle(environ), request, response) # rfc2616 section 4.3 if ...
[ "def", "wsgi", "(", "self", ",", "environ", ",", "start_response", ")", ":", "try", ":", "environ", "[", "'bottle.app'", "]", "=", "self", "request", ".", "bind", "(", "environ", ")", "response", ".", "bind", "(", ")", "out", "=", "self", ".", "_cast...
https://github.com/koniu/recoll-webui/blob/c3151abc2b4416fb4a63b7833b8c99d17e3ace6e/bottle.py#L825-L852
tomplus/kubernetes_asyncio
f028cc793e3a2c519be6a52a49fb77ff0b014c9b
kubernetes_asyncio/client/models/v1beta1_endpoint_port.py
python
V1beta1EndpointPort.app_protocol
(self, app_protocol)
Sets the app_protocol of this V1beta1EndpointPort. The application protocol for this port. This field follows standard Kubernetes label syntax. Un-prefixed names are reserved for IANA standard service names (as per RFC-6335 and http://www.iana.org/assignments/service-names). Non-standard protocols should use p...
Sets the app_protocol of this V1beta1EndpointPort.
[ "Sets", "the", "app_protocol", "of", "this", "V1beta1EndpointPort", "." ]
def app_protocol(self, app_protocol): """Sets the app_protocol of this V1beta1EndpointPort. The application protocol for this port. This field follows standard Kubernetes label syntax. Un-prefixed names are reserved for IANA standard service names (as per RFC-6335 and http://www.iana.org/assignments/se...
[ "def", "app_protocol", "(", "self", ",", "app_protocol", ")", ":", "self", ".", "_app_protocol", "=", "app_protocol" ]
https://github.com/tomplus/kubernetes_asyncio/blob/f028cc793e3a2c519be6a52a49fb77ff0b014c9b/kubernetes_asyncio/client/models/v1beta1_endpoint_port.py#L82-L91
Esri/ArcREST
ab240fde2b0200f61d4a5f6df033516e53f2f416
src/arcrest/agol/services.py
python
FeatureLayer.applyEdits
(self, addFeatures=None, updateFeatures=None, deleteFeatures=None, gdbVersion=None, useGlobalIds=False, rollbackOnFailure=True, attachments=None)
return res
This operation adds, updates, and deletes features to the associated feature layer or table in a single call. Inputs: addFeatures - The array of features to be added. These features should be common.Feature objects, or they sho...
This operation adds, updates, and deletes features to the associated feature layer or table in a single call. Inputs: addFeatures - The array of features to be added. These features should be common.Feature objects, or they sho...
[ "This", "operation", "adds", "updates", "and", "deletes", "features", "to", "the", "associated", "feature", "layer", "or", "table", "in", "a", "single", "call", ".", "Inputs", ":", "addFeatures", "-", "The", "array", "of", "features", "to", "be", "added", ...
def applyEdits(self, addFeatures=None, updateFeatures=None, deleteFeatures=None, gdbVersion=None, useGlobalIds=False, rollbackOnFailure=True, attachments=None): """ Thi...
[ "def", "applyEdits", "(", "self", ",", "addFeatures", "=", "None", ",", "updateFeatures", "=", "None", ",", "deleteFeatures", "=", "None", ",", "gdbVersion", "=", "None", ",", "useGlobalIds", "=", "False", ",", "rollbackOnFailure", "=", "True", ",", "attachm...
https://github.com/Esri/ArcREST/blob/ab240fde2b0200f61d4a5f6df033516e53f2f416/src/arcrest/agol/services.py#L2136-L2241
giampaolo/psutil
55161bd4850986359a029f1c9a81bcf66f37afa8
psutil/_psbsd.py
python
disk_partitions
(all=False)
return retlist
Return mounted disk partitions as a list of namedtuples. 'all' argument is ignored, see: https://github.com/giampaolo/psutil/issues/906
Return mounted disk partitions as a list of namedtuples. 'all' argument is ignored, see: https://github.com/giampaolo/psutil/issues/906
[ "Return", "mounted", "disk", "partitions", "as", "a", "list", "of", "namedtuples", ".", "all", "argument", "is", "ignored", "see", ":", "https", ":", "//", "github", ".", "com", "/", "giampaolo", "/", "psutil", "/", "issues", "/", "906" ]
def disk_partitions(all=False): """Return mounted disk partitions as a list of namedtuples. 'all' argument is ignored, see: https://github.com/giampaolo/psutil/issues/906 """ retlist = [] partitions = cext.disk_partitions() for partition in partitions: device, mountpoint, fstype, opt...
[ "def", "disk_partitions", "(", "all", "=", "False", ")", ":", "retlist", "=", "[", "]", "partitions", "=", "cext", ".", "disk_partitions", "(", ")", "for", "partition", "in", "partitions", ":", "device", ",", "mountpoint", ",", "fstype", ",", "opts", "="...
https://github.com/giampaolo/psutil/blob/55161bd4850986359a029f1c9a81bcf66f37afa8/psutil/_psbsd.py#L318-L331
dbt-labs/dbt-core
e943b9fc842535e958ef4fd0b8703adc91556bc6
core/dbt/parser/sources.py
python
merge_freshness
( base: Optional[FreshnessThreshold], update: Optional[FreshnessThreshold] )
[]
def merge_freshness( base: Optional[FreshnessThreshold], update: Optional[FreshnessThreshold] ) -> Optional[FreshnessThreshold]: if base is not None and update is not None: merged_freshness = base.merged(update) # merge one level deeper the error_after and warn_after thresholds merged_er...
[ "def", "merge_freshness", "(", "base", ":", "Optional", "[", "FreshnessThreshold", "]", ",", "update", ":", "Optional", "[", "FreshnessThreshold", "]", ")", "->", "Optional", "[", "FreshnessThreshold", "]", ":", "if", "base", "is", "not", "None", "and", "upd...
https://github.com/dbt-labs/dbt-core/blob/e943b9fc842535e958ef4fd0b8703adc91556bc6/core/dbt/parser/sources.py#L355-L370
WeblateOrg/weblate
8126f3dda9d24f2846b755955132a8b8410866c8
weblate/formats/base.py
python
TranslationUnit.id_hash
(self)
return calculate_hash(self.context)
Return hash of source string, used for quick lookup. We use siphash as it is fast and works well for our purpose.
Return hash of source string, used for quick lookup.
[ "Return", "hash", "of", "source", "string", "used", "for", "quick", "lookup", "." ]
def id_hash(self): """Return hash of source string, used for quick lookup. We use siphash as it is fast and works well for our purpose. """ if self.template is None: return calculate_hash(self.source, self.context) return calculate_hash(self.context)
[ "def", "id_hash", "(", "self", ")", ":", "if", "self", ".", "template", "is", "None", ":", "return", "calculate_hash", "(", "self", ".", "source", ",", "self", ".", "context", ")", "return", "calculate_hash", "(", "self", ".", "context", ")" ]
https://github.com/WeblateOrg/weblate/blob/8126f3dda9d24f2846b755955132a8b8410866c8/weblate/formats/base.py#L121-L128
DSE-MSU/DeepRobust
2bcde200a5969dae32cddece66206a52c87c43e8
deeprobust/image/utils.py
python
load_checkpoint
(file_name, net = None, optimizer = None, lr_scheduler = None)
[]
def load_checkpoint(file_name, net = None, optimizer = None, lr_scheduler = None): if os.path.isfile(file_name): print("=> loading checkpoint '{}'".format(file_name)) check_point = torch.load(file_name) if net is not None: print('Loading network state dict') net.load_...
[ "def", "load_checkpoint", "(", "file_name", ",", "net", "=", "None", ",", "optimizer", "=", "None", ",", "lr_scheduler", "=", "None", ")", ":", "if", "os", ".", "path", ".", "isfile", "(", "file_name", ")", ":", "print", "(", "\"=> loading checkpoint '{}'\...
https://github.com/DSE-MSU/DeepRobust/blob/2bcde200a5969dae32cddece66206a52c87c43e8/deeprobust/image/utils.py#L49-L65
CedricGuillemet/Imogen
ee417b42747ed5b46cb11b02ef0c3630000085b3
bin/Lib/_pydecimal.py
python
Context.logical_xor
(self, a, b)
return a.logical_xor(b, context=self)
Applies the logical operation 'xor' between each operand's digits. The operands must be both logical numbers. >>> ExtendedContext.logical_xor(Decimal('0'), Decimal('0')) Decimal('0') >>> ExtendedContext.logical_xor(Decimal('0'), Decimal('1')) Decimal('1') >>> ExtendedCo...
Applies the logical operation 'xor' between each operand's digits.
[ "Applies", "the", "logical", "operation", "xor", "between", "each", "operand", "s", "digits", "." ]
def logical_xor(self, a, b): """Applies the logical operation 'xor' between each operand's digits. The operands must be both logical numbers. >>> ExtendedContext.logical_xor(Decimal('0'), Decimal('0')) Decimal('0') >>> ExtendedContext.logical_xor(Decimal('0'), Decimal('1')) ...
[ "def", "logical_xor", "(", "self", ",", "a", ",", "b", ")", ":", "a", "=", "_convert_other", "(", "a", ",", "raiseit", "=", "True", ")", "return", "a", ".", "logical_xor", "(", "b", ",", "context", "=", "self", ")" ]
https://github.com/CedricGuillemet/Imogen/blob/ee417b42747ed5b46cb11b02ef0c3630000085b3/bin/Lib/_pydecimal.py#L4807-L4832
saltstack/salt
fae5bc757ad0f1716483ce7ae180b451545c2058
salt/modules/git.py
python
_format_opts
(opts)
return opts
Common code to inspect opts and split them if necessary
Common code to inspect opts and split them if necessary
[ "Common", "code", "to", "inspect", "opts", "and", "split", "them", "if", "necessary" ]
def _format_opts(opts): """ Common code to inspect opts and split them if necessary """ if opts is None: return [] elif isinstance(opts, list): new_opts = [] for item in opts: if isinstance(item, str): new_opts.append(item) else: ...
[ "def", "_format_opts", "(", "opts", ")", ":", "if", "opts", "is", "None", ":", "return", "[", "]", "elif", "isinstance", "(", "opts", ",", "list", ")", ":", "new_opts", "=", "[", "]", "for", "item", "in", "opts", ":", "if", "isinstance", "(", "item...
https://github.com/saltstack/salt/blob/fae5bc757ad0f1716483ce7ae180b451545c2058/salt/modules/git.py#L139-L168
oracle/oci-python-sdk
3c1604e4e212008fb6718e2f68cdb5ef71fd5793
src/oci/load_balancer/load_balancer_client.py
python
LoadBalancerClient.create_routing_policy
(self, create_routing_policy_details, load_balancer_id, **kwargs)
Adds a routing policy to a load balancer. For more information, see `Managing Request Routing`__. __ https://docs.cloud.oracle.com/Content/Balance/Tasks/managingrequest.htm :param oci.load_balancer.models.CreateRoutingPolicyDetails create_routing_policy_details: (required) The det...
Adds a routing policy to a load balancer. For more information, see `Managing Request Routing`__.
[ "Adds", "a", "routing", "policy", "to", "a", "load", "balancer", ".", "For", "more", "information", "see", "Managing", "Request", "Routing", "__", "." ]
def create_routing_policy(self, create_routing_policy_details, load_balancer_id, **kwargs): """ Adds a routing policy to a load balancer. For more information, see `Managing Request Routing`__. __ https://docs.cloud.oracle.com/Content/Balance/Tasks/managingrequest.htm :param o...
[ "def", "create_routing_policy", "(", "self", ",", "create_routing_policy_details", ",", "load_balancer_id", ",", "*", "*", "kwargs", ")", ":", "resource_path", "=", "\"/loadBalancers/{loadBalancerId}/routingPolicies\"", "method", "=", "\"POST\"", "# Don't accept unknown kwarg...
https://github.com/oracle/oci-python-sdk/blob/3c1604e4e212008fb6718e2f68cdb5ef71fd5793/src/oci/load_balancer/load_balancer_client.py#L900-L996
angr/angr
4b04d56ace135018083d36d9083805be8146688b
angr/blade.py
python
Blade.dbg_repr
(self, arch=None)
return s
[]
def dbg_repr(self, arch=None): if arch is None and self.project is not None: arch = self.project.arch s = "" block_addrs = { a for a, _ in self.slice.nodes() } for block_addr in block_addrs: block_str = " IRSB %#x\n" % block_addr block = sel...
[ "def", "dbg_repr", "(", "self", ",", "arch", "=", "None", ")", ":", "if", "arch", "is", "None", "and", "self", ".", "project", "is", "not", "None", ":", "arch", "=", "self", ".", "project", ".", "arch", "s", "=", "\"\"", "block_addrs", "=", "{", ...
https://github.com/angr/angr/blob/4b04d56ace135018083d36d9083805be8146688b/angr/blade.py#L88-L135
jieter/django-tables2
ce392ee2ee341d7180345a6113919cf9a3925f16
django_tables2/data.py
python
TableQuerysetData.__len__
(self)
return self._length
Cached data length
Cached data length
[ "Cached", "data", "length" ]
def __len__(self): """Cached data length""" if not hasattr(self, "_length") or self._length is None: if hasattr(self.table, "paginator"): # for paginated tables, use QuerySet.count() as we are interested in total number of records. self._length = self.data.cou...
[ "def", "__len__", "(", "self", ")", ":", "if", "not", "hasattr", "(", "self", ",", "\"_length\"", ")", "or", "self", ".", "_length", "is", "None", ":", "if", "hasattr", "(", "self", ".", "table", ",", "\"paginator\"", ")", ":", "# for paginated tables, u...
https://github.com/jieter/django-tables2/blob/ce392ee2ee341d7180345a6113919cf9a3925f16/django_tables2/data.py#L148-L158
MarioVilas/winappdbg
975a088ac54253d0bdef39fe831e82f24b4c11f6
winappdbg/module.py
python
Module.get_base
(self)
return self.lpBaseOfDll
@rtype: int or None @return: Base address of the module. Returns C{None} if unknown.
[]
def get_base(self): """ @rtype: int or None @return: Base address of the module. Returns C{None} if unknown. """ return self.lpBaseOfDll
[ "def", "get_base", "(", "self", ")", ":", "return", "self", ".", "lpBaseOfDll" ]
https://github.com/MarioVilas/winappdbg/blob/975a088ac54253d0bdef39fe831e82f24b4c11f6/winappdbg/module.py#L252-L258
cantools/cantools
8d86d61bc010f328cf414150331fecfd4b6f4dc3
cantools/database/can/c_source.py
python
generate
(database, database_name, header_name, source_name, fuzzer_source_name, floating_point_numbers=True, bit_fields=False)
return header, source, fuzzer_source, fuzzer_makefile
Generate C source code from given CAN database `database`. `database_name` is used as a prefix for all defines, data structures and functions. `header_name` is the file name of the C header file, which is included by the C source file. `source_name` is the file name of the C source file, which is...
Generate C source code from given CAN database `database`.
[ "Generate", "C", "source", "code", "from", "given", "CAN", "database", "database", "." ]
def generate(database, database_name, header_name, source_name, fuzzer_source_name, floating_point_numbers=True, bit_fields=False): """Generate C source code from given CAN database `database`. `database_name` is used as a prefix for...
[ "def", "generate", "(", "database", ",", "database_name", ",", "header_name", ",", "source_name", ",", "fuzzer_source_name", ",", "floating_point_numbers", "=", "True", ",", "bit_fields", "=", "False", ")", ":", "date", "=", "time", ".", "ctime", "(", ")", "...
https://github.com/cantools/cantools/blob/8d86d61bc010f328cf414150331fecfd4b6f4dc3/cantools/database/can/c_source.py#L1517-L1595
CJWorkbench/cjworkbench
e0b878d8ff819817fa049a4126efcbfcec0b50e6
cjwkernel/pandas/main.py
python
run_in_sandbox
( compiled_module: CompiledModule, function: str, args: List[Any] )
Run `function` with `args`, and write the (Thrift) result to `sys.stdout`.
Run `function` with `args`, and write the (Thrift) result to `sys.stdout`.
[ "Run", "function", "with", "args", "and", "write", "the", "(", "Thrift", ")", "result", "to", "sys", ".", "stdout", "." ]
def run_in_sandbox( compiled_module: CompiledModule, function: str, args: List[Any] ) -> None: """Run `function` with `args`, and write the (Thrift) result to `sys.stdout`.""" # TODO sandbox -- will need an OS `clone()` with namespace, cgroups, .... # Run the user's code in a new (programmatic) module....
[ "def", "run_in_sandbox", "(", "compiled_module", ":", "CompiledModule", ",", "function", ":", "str", ",", "args", ":", "List", "[", "Any", "]", ")", "->", "None", ":", "# TODO sandbox -- will need an OS `clone()` with namespace, cgroups, ....", "# Run the user's code in a...
https://github.com/CJWorkbench/cjworkbench/blob/e0b878d8ff819817fa049a4126efcbfcec0b50e6/cjwkernel/pandas/main.py#L30-L88
zhl2008/awd-platform
0416b31abea29743387b10b3914581fbe8e7da5e
web_flaskbb/lib/python2.7/site-packages/PIL/PdfParser.py
python
PdfStream.decode
(self)
[]
def decode(self): try: filter = self.dictionary.Filter except AttributeError: return self.buf if filter == b"FlateDecode": try: expected_length = self.dictionary.DL except AttributeError: expected_length = self.dicti...
[ "def", "decode", "(", "self", ")", ":", "try", ":", "filter", "=", "self", ".", "dictionary", ".", "Filter", "except", "AttributeError", ":", "return", "self", ".", "buf", "if", "filter", "==", "b\"FlateDecode\"", ":", "try", ":", "expected_length", "=", ...
https://github.com/zhl2008/awd-platform/blob/0416b31abea29743387b10b3914581fbe8e7da5e/web_flaskbb/lib/python2.7/site-packages/PIL/PdfParser.py#L306-L318
jython/jython3
def4f8ec47cb7a9c799ea4c745f12badf92c5769
lib-python/3.5.1/asyncio/locks.py
python
Condition.notify_all
(self)
Wake up all threads waiting on this condition. This method acts like notify(), but wakes up all waiting threads instead of one. If the calling thread has not acquired the lock when this method is called, a RuntimeError is raised.
Wake up all threads waiting on this condition. This method acts like notify(), but wakes up all waiting threads instead of one. If the calling thread has not acquired the lock when this method is called, a RuntimeError is raised.
[ "Wake", "up", "all", "threads", "waiting", "on", "this", "condition", ".", "This", "method", "acts", "like", "notify", "()", "but", "wakes", "up", "all", "waiting", "threads", "instead", "of", "one", ".", "If", "the", "calling", "thread", "has", "not", "...
def notify_all(self): """Wake up all threads waiting on this condition. This method acts like notify(), but wakes up all waiting threads instead of one. If the calling thread has not acquired the lock when this method is called, a RuntimeError is raised. """ self.notify(l...
[ "def", "notify_all", "(", "self", ")", ":", "self", ".", "notify", "(", "len", "(", "self", ".", "_waiters", ")", ")" ]
https://github.com/jython/jython3/blob/def4f8ec47cb7a9c799ea4c745f12badf92c5769/lib-python/3.5.1/asyncio/locks.py#L372-L378
saltstack/salt
fae5bc757ad0f1716483ce7ae180b451545c2058
salt/runners/lxc.py
python
find_guests
(names, path=None)
return ret
Return a dict of hosts and named guests path path to the container parent default: /var/lib/lxc (system default) .. versionadded:: 2015.8.0
Return a dict of hosts and named guests
[ "Return", "a", "dict", "of", "hosts", "and", "named", "guests" ]
def find_guests(names, path=None): """ Return a dict of hosts and named guests path path to the container parent default: /var/lib/lxc (system default) .. versionadded:: 2015.8.0 """ ret = {} names = names.split(",") for data in _list_iter(path=path): host,...
[ "def", "find_guests", "(", "names", ",", "path", "=", "None", ")", ":", "ret", "=", "{", "}", "names", "=", "names", ".", "split", "(", "\",\"", ")", "for", "data", "in", "_list_iter", "(", "path", "=", "path", ")", ":", "host", ",", "stat", "=",...
https://github.com/saltstack/salt/blob/fae5bc757ad0f1716483ce7ae180b451545c2058/salt/runners/lxc.py#L118-L140
securesystemslab/zippy
ff0e84ac99442c2c55fe1d285332cfd4e185e089
zippy/lib-python/3/pydoc.py
python
tempfilepager
(text, cmd)
Page through text by invoking a program on a temporary file.
Page through text by invoking a program on a temporary file.
[ "Page", "through", "text", "by", "invoking", "a", "program", "on", "a", "temporary", "file", "." ]
def tempfilepager(text, cmd): """Page through text by invoking a program on a temporary file.""" import tempfile filename = tempfile.mktemp() file = open(filename, 'w') file.write(text) file.close() try: os.system(cmd + ' "' + filename + '"') finally: os.unlink(filename)
[ "def", "tempfilepager", "(", "text", ",", "cmd", ")", ":", "import", "tempfile", "filename", "=", "tempfile", ".", "mktemp", "(", ")", "file", "=", "open", "(", "filename", ",", "'w'", ")", "file", ".", "write", "(", "text", ")", "file", ".", "close"...
https://github.com/securesystemslab/zippy/blob/ff0e84ac99442c2c55fe1d285332cfd4e185e089/zippy/lib-python/3/pydoc.py#L1414-L1424
aws/sagemaker-python-sdk
9d259b316f7f43838c16f35c10e98a110b56735b
src/sagemaker/model_metrics.py
python
FileSource._to_request_dict
(self)
return file_source_request
Generates a request dictionary using the parameters provided to the class.
Generates a request dictionary using the parameters provided to the class.
[ "Generates", "a", "request", "dictionary", "using", "the", "parameters", "provided", "to", "the", "class", "." ]
def _to_request_dict(self): """Generates a request dictionary using the parameters provided to the class.""" file_source_request = {"S3Uri": self.s3_uri} if self.content_digest is not None: file_source_request["ContentDigest"] = self.content_digest if self.content_type is not...
[ "def", "_to_request_dict", "(", "self", ")", ":", "file_source_request", "=", "{", "\"S3Uri\"", ":", "self", ".", "s3_uri", "}", "if", "self", ".", "content_digest", "is", "not", "None", ":", "file_source_request", "[", "\"ContentDigest\"", "]", "=", "self", ...
https://github.com/aws/sagemaker-python-sdk/blob/9d259b316f7f43838c16f35c10e98a110b56735b/src/sagemaker/model_metrics.py#L145-L152
MechanicalSoup/MechanicalSoup
72783b827b176bec8a3f9672a5222ce835b72a82
mechanicalsoup/form.py
python
Form.__setitem__
(self, name, value)
return self.set(name, value)
Forwards arguments to :func:`~Form.set`. For example, :code:`form["name"] = "value"` calls :code:`form.set("name", "value")`.
Forwards arguments to :func:`~Form.set`. For example, :code:`form["name"] = "value"` calls :code:`form.set("name", "value")`.
[ "Forwards", "arguments", "to", ":", "func", ":", "~Form", ".", "set", ".", "For", "example", ":", "code", ":", "form", "[", "name", "]", "=", "value", "calls", ":", "code", ":", "form", ".", "set", "(", "name", "value", ")", "." ]
def __setitem__(self, name, value): """Forwards arguments to :func:`~Form.set`. For example, :code:`form["name"] = "value"` calls :code:`form.set("name", "value")`. """ return self.set(name, value)
[ "def", "__setitem__", "(", "self", ",", "name", ",", "value", ")", ":", "return", "self", ".", "set", "(", "name", ",", "value", ")" ]
https://github.com/MechanicalSoup/MechanicalSoup/blob/72783b827b176bec8a3f9672a5222ce835b72a82/mechanicalsoup/form.py#L236-L240
DeepLabCut/DeepLabCut
1dd14c54729ae0d8e66ca495aa5baeb83502e1c7
deeplabcut/pose_estimation_tensorflow/backbones/efficientnet_model.py
python
round_repeats
(repeats, global_params)
return int(math.ceil(multiplier * repeats))
Round number of filters based on depth multiplier.
Round number of filters based on depth multiplier.
[ "Round", "number", "of", "filters", "based", "on", "depth", "multiplier", "." ]
def round_repeats(repeats, global_params): """Round number of filters based on depth multiplier.""" multiplier = global_params.depth_coefficient if not multiplier: return repeats return int(math.ceil(multiplier * repeats))
[ "def", "round_repeats", "(", "repeats", ",", "global_params", ")", ":", "multiplier", "=", "global_params", ".", "depth_coefficient", "if", "not", "multiplier", ":", "return", "repeats", "return", "int", "(", "math", ".", "ceil", "(", "multiplier", "*", "repea...
https://github.com/DeepLabCut/DeepLabCut/blob/1dd14c54729ae0d8e66ca495aa5baeb83502e1c7/deeplabcut/pose_estimation_tensorflow/backbones/efficientnet_model.py#L125-L130
pculture/miro
d8e4594441939514dd2ac29812bf37087bb3aea5
tv/lib/data/itemtrack.py
python
ItemTracker._refetch_id_list
(self, send_signals=True)
Refetch a new id list after we already have one.
Refetch a new id list after we already have one.
[ "Refetch", "a", "new", "id", "list", "after", "we", "already", "have", "one", "." ]
def _refetch_id_list(self, send_signals=True): """Refetch a new id list after we already have one.""" if send_signals: self.emit('will-change') self._fetch_id_list() if send_signals: self.emit("list-changed")
[ "def", "_refetch_id_list", "(", "self", ",", "send_signals", "=", "True", ")", ":", "if", "send_signals", ":", "self", ".", "emit", "(", "'will-change'", ")", "self", ".", "_fetch_id_list", "(", ")", "if", "send_signals", ":", "self", ".", "emit", "(", "...
https://github.com/pculture/miro/blob/d8e4594441939514dd2ac29812bf37087bb3aea5/tv/lib/data/itemtrack.py#L537-L544
hudora/huBarcode
e89cc42a4325aaab20297fecd33a785061633bed
hubarcode/code128/textencoder.py
python
TextEncoder.switch_charset
(self, new_charset)
return [switch_code, ]
Switch to a new character set Return a single item list containing the switch code
Switch to a new character set Return a single item list containing the switch code
[ "Switch", "to", "a", "new", "character", "set", "Return", "a", "single", "item", "list", "containing", "the", "switch", "code" ]
def switch_charset(self, new_charset): """Switch to a new character set Return a single item list containing the switch code""" log.debug("Switching charsets from %c to %c", self.current_charset, new_charset) if new_charset == 'A': switch_code = self.conve...
[ "def", "switch_charset", "(", "self", ",", "new_charset", ")", ":", "log", ".", "debug", "(", "\"Switching charsets from %c to %c\"", ",", "self", ".", "current_charset", ",", "new_charset", ")", "if", "new_charset", "==", "'A'", ":", "switch_code", "=", "self",...
https://github.com/hudora/huBarcode/blob/e89cc42a4325aaab20297fecd33a785061633bed/hubarcode/code128/textencoder.py#L35-L51
megvii-model/MABN
db1ef7bc396c8aa6f4eec9e3c5875d73f74da3de
det/maskrcnn_benchmark/modeling/rpn/retinanet/inference.py
python
RetinaNetPostProcessor.__init__
( self, pre_nms_thresh, pre_nms_top_n, nms_thresh, fpn_post_nms_top_n, min_size, num_classes, box_coder=None, )
Arguments: pre_nms_thresh (float) pre_nms_top_n (int) nms_thresh (float) fpn_post_nms_top_n (int) min_size (int) num_classes (int) box_coder (BoxCoder)
Arguments: pre_nms_thresh (float) pre_nms_top_n (int) nms_thresh (float) fpn_post_nms_top_n (int) min_size (int) num_classes (int) box_coder (BoxCoder)
[ "Arguments", ":", "pre_nms_thresh", "(", "float", ")", "pre_nms_top_n", "(", "int", ")", "nms_thresh", "(", "float", ")", "fpn_post_nms_top_n", "(", "int", ")", "min_size", "(", "int", ")", "num_classes", "(", "int", ")", "box_coder", "(", "BoxCoder", ")" ]
def __init__( self, pre_nms_thresh, pre_nms_top_n, nms_thresh, fpn_post_nms_top_n, min_size, num_classes, box_coder=None, ): """ Arguments: pre_nms_thresh (float) pre_nms_top_n (int) nms_thresh (float...
[ "def", "__init__", "(", "self", ",", "pre_nms_thresh", ",", "pre_nms_top_n", ",", "nms_thresh", ",", "fpn_post_nms_top_n", ",", "min_size", ",", "num_classes", ",", "box_coder", "=", "None", ",", ")", ":", "super", "(", "RetinaNetPostProcessor", ",", "self", "...
https://github.com/megvii-model/MABN/blob/db1ef7bc396c8aa6f4eec9e3c5875d73f74da3de/det/maskrcnn_benchmark/modeling/rpn/retinanet/inference.py#L19-L51
HuberTRoy/MusicBox
82fdf21809b7f018c616c4d1c78cfbf04cd5d9e3
MusicPlayer/features/configDownloadFrameFeatures.py
python
ConfigDownloadFrame.__init__
(self, downloadFrame)
[]
def __init__(self, downloadFrame): super(ConfigDownloadFrame, self).__init__() self.downloadFrame = downloadFrame self.showTable = self.downloadFrame.singsTable self.musicList = [] self.folder = [] self.myDownloadFolder = os.path.join(os.getcwd(), 'downloads') s...
[ "def", "__init__", "(", "self", ",", "downloadFrame", ")", ":", "super", "(", "ConfigDownloadFrame", ",", "self", ")", ".", "__init__", "(", ")", "self", ".", "downloadFrame", "=", "downloadFrame", "self", ".", "showTable", "=", "self", ".", "downloadFrame",...
https://github.com/HuberTRoy/MusicBox/blob/82fdf21809b7f018c616c4d1c78cfbf04cd5d9e3/MusicPlayer/features/configDownloadFrameFeatures.py#L52-L65
shellphish/ictf-framework
c0384f12060cf47442a52f516c6e78bd722f208a
database/support/mysql-connector-python-2.1.3/lib/mysql/connector/pooling.py
python
PooledMySQLConnection.config
(self, **kwargs)
Configuration is done through the pool
Configuration is done through the pool
[ "Configuration", "is", "done", "through", "the", "pool" ]
def config(self, **kwargs): """Configuration is done through the pool""" raise errors.PoolError( "Configuration for pooled connections should " "be done through the pool itself." )
[ "def", "config", "(", "self", ",", "*", "*", "kwargs", ")", ":", "raise", "errors", ".", "PoolError", "(", "\"Configuration for pooled connections should \"", "\"be done through the pool itself.\"", ")" ]
https://github.com/shellphish/ictf-framework/blob/c0384f12060cf47442a52f516c6e78bd722f208a/database/support/mysql-connector-python-2.1.3/lib/mysql/connector/pooling.py#L122-L127
ZZUTK/SRNTT
c9a2cf95534e2d3c2c2210718c9903c9f389d67d
SRNTT/tensorlayer/activation.py
python
parametric_relu
(x)
return pos + neg
[]
def parametric_relu(x): alphas = tf.get_variable( 'alpha', x.get_shape()[-1], initializer=tf.constant_initializer(0.0), dtype=tf.float32) pos = tf.nn.relu(x) neg = alphas * (x - abs(x)) * 0.5 return pos + neg
[ "def", "parametric_relu", "(", "x", ")", ":", "alphas", "=", "tf", ".", "get_variable", "(", "'alpha'", ",", "x", ".", "get_shape", "(", ")", "[", "-", "1", "]", ",", "initializer", "=", "tf", ".", "constant_initializer", "(", "0.0", ")", ",", "dtype...
https://github.com/ZZUTK/SRNTT/blob/c9a2cf95534e2d3c2c2210718c9903c9f389d67d/SRNTT/tensorlayer/activation.py#L112-L119
zopefoundation/Zope
ea04dd670d1a48d4d5c879d3db38fc2e9b4330bb
src/Shared/DC/Scripts/Bindings.py
python
NameAssignments._createCodeBlockForMapping
(self)
return self._generateCodeBlock(text, assigned_names)
[]
def _createCodeBlockForMapping(self): # Generates a code block which generates the "bound_data" # variable and removes excessive arguments from the "kw" # variable. bound_data will be a mapping, for use as a # global namespace. exprtext = [] assigned_names = [] a...
[ "def", "_createCodeBlockForMapping", "(", "self", ")", ":", "# Generates a code block which generates the \"bound_data\"", "# variable and removes excessive arguments from the \"kw\"", "# variable. bound_data will be a mapping, for use as a", "# global namespace.", "exprtext", "=", "[", "...
https://github.com/zopefoundation/Zope/blob/ea04dd670d1a48d4d5c879d3db38fc2e9b4330bb/src/Shared/DC/Scripts/Bindings.py#L118-L132
gmr/rabbitpy
d97fd2b1e983df0d95c2b0e2c6b29f61c79d82b9
rabbitpy/amqp.py
python
AMQP.queue_declare
(self, queue='', passive=False, durable=False, exclusive=False, auto_delete=False, nowait=False, arguments=None)
Declare queue, create if needed This method creates or checks a queue. When creating a new queue the client can specify various properties that control the durability of the queue and its contents, and the level of sharing for the queue. :param str queue: The queue name :param ...
Declare queue, create if needed
[ "Declare", "queue", "create", "if", "needed" ]
def queue_declare(self, queue='', passive=False, durable=False, exclusive=False, auto_delete=False, nowait=False, arguments=None): """Declare queue, create if needed This method creates or checks a queue. When creating a new queue the client can speci...
[ "def", "queue_declare", "(", "self", ",", "queue", "=", "''", ",", "passive", "=", "False", ",", "durable", "=", "False", ",", "exclusive", "=", "False", ",", "auto_delete", "=", "False", ",", "nowait", "=", "False", ",", "arguments", "=", "None", ")",...
https://github.com/gmr/rabbitpy/blob/d97fd2b1e983df0d95c2b0e2c6b29f61c79d82b9/rabbitpy/amqp.py#L304-L323
NeuralEnsemble/python-neo
34d4db8fb0dc950dbbc6defd7fb75e99ea877286
neo/io/nixio.py
python
NixIO.close
(self)
Closes the open nix file and resets maps.
Closes the open nix file and resets maps.
[ "Closes", "the", "open", "nix", "file", "and", "resets", "maps", "." ]
def close(self): """ Closes the open nix file and resets maps. """ if (hasattr(self, "nix_file") and self.nix_file and self.nix_file.is_open()): self.nix_file.close() self.nix_file = None self._neo_map = None self._ref_map = None ...
[ "def", "close", "(", "self", ")", ":", "if", "(", "hasattr", "(", "self", ",", "\"nix_file\"", ")", "and", "self", ".", "nix_file", "and", "self", ".", "nix_file", ".", "is_open", "(", ")", ")", ":", "self", ".", "nix_file", ".", "close", "(", ")",...
https://github.com/NeuralEnsemble/python-neo/blob/34d4db8fb0dc950dbbc6defd7fb75e99ea877286/neo/io/nixio.py#L1430-L1441
intel/virtual-storage-manager
00706ab9701acbd0d5e04b19cc80c6b66a2973b8
source/vsm/vsm/utils.py
python
check_isinstance
(obj, cls)
return cls()
Checks that obj is of type cls, and lets PyLint infer types.
Checks that obj is of type cls, and lets PyLint infer types.
[ "Checks", "that", "obj", "is", "of", "type", "cls", "and", "lets", "PyLint", "infer", "types", "." ]
def check_isinstance(obj, cls): """Checks that obj is of type cls, and lets PyLint infer types.""" if isinstance(obj, cls): return obj raise Exception(_('Expected object of type: %s') % (str(cls))) # TODO(justinsb): Can we make this better?? return cls()
[ "def", "check_isinstance", "(", "obj", ",", "cls", ")", ":", "if", "isinstance", "(", "obj", ",", "cls", ")", ":", "return", "obj", "raise", "Exception", "(", "_", "(", "'Expected object of type: %s'", ")", "%", "(", "str", "(", "cls", ")", ")", ")", ...
https://github.com/intel/virtual-storage-manager/blob/00706ab9701acbd0d5e04b19cc80c6b66a2973b8/source/vsm/vsm/utils.py#L852-L858
karlch/vimiv
acbb83e003805e5304131be1f73d7f66528606d6
vimiv/thumbnail.py
python
Thumbnail._show
(self, toggled=False)
Show thumbnails when called from toggle. Args: toggled: If True thumbnail mode is already toggled.
Show thumbnails when called from toggle.
[ "Show", "thumbnails", "when", "called", "from", "toggle", "." ]
def _show(self, toggled=False): """Show thumbnails when called from toggle. Args: toggled: If True thumbnail mode is already toggled. """ # Clean liststore self._liststore.clear() # Draw the icon view instead of the image if not toggled: ...
[ "def", "_show", "(", "self", ",", "toggled", "=", "False", ")", ":", "# Clean liststore", "self", ".", "_liststore", ".", "clear", "(", ")", "# Draw the icon view instead of the image", "if", "not", "toggled", ":", "self", ".", "_app", "[", "\"main_window\"", ...
https://github.com/karlch/vimiv/blob/acbb83e003805e5304131be1f73d7f66528606d6/vimiv/thumbnail.py#L130-L161
pyinstaller/pyinstaller
872312500a8a324d25fb405f85117f7966a0ebd5
PyInstaller/building/datastruct.py
python
Tree.__init__
(self, root=None, prefix=None, excludes=None, typecode='DATA')
root The root of the tree (on the build system). prefix Optional prefix to the names of the target system. excludes A list of names to exclude. Two forms are allowed: name Files with this basename will be exclud...
root The root of the tree (on the build system). prefix Optional prefix to the names of the target system. excludes A list of names to exclude. Two forms are allowed:
[ "root", "The", "root", "of", "the", "tree", "(", "on", "the", "build", "system", ")", ".", "prefix", "Optional", "prefix", "to", "the", "names", "of", "the", "target", "system", ".", "excludes", "A", "list", "of", "names", "to", "exclude", ".", "Two", ...
def __init__(self, root=None, prefix=None, excludes=None, typecode='DATA'): """ root The root of the tree (on the build system). prefix Optional prefix to the names of the target system. excludes A list of names to exclude. Two forms are al...
[ "def", "__init__", "(", "self", ",", "root", "=", "None", ",", "prefix", "=", "None", ",", "excludes", "=", "None", ",", "typecode", "=", "'DATA'", ")", ":", "Target", ".", "__init__", "(", "self", ")", "TOC", ".", "__init__", "(", "self", ")", "se...
https://github.com/pyinstaller/pyinstaller/blob/872312500a8a324d25fb405f85117f7966a0ebd5/PyInstaller/building/datastruct.py#L188-L213
CouchPotato/CouchPotatoServer
7260c12f72447ddb6f062367c6dfbda03ecd4e9c
libs/subliminal/subtitles.py
python
ExternalSubtitle.from_path
(cls, path)
return cls(path, language)
Create an :class:`ExternalSubtitle` from path
Create an :class:`ExternalSubtitle` from path
[ "Create", "an", ":", "class", ":", "ExternalSubtitle", "from", "path" ]
def from_path(cls, path): """Create an :class:`ExternalSubtitle` from path""" extension = None for e in EXTENSIONS: if path.endswith(e): extension = e break if extension is None: raise ValueError('Not a supported subtitle extension'...
[ "def", "from_path", "(", "cls", ",", "path", ")", ":", "extension", "=", "None", "for", "e", "in", "EXTENSIONS", ":", "if", "path", ".", "endswith", "(", "e", ")", ":", "extension", "=", "e", "break", "if", "extension", "is", "None", ":", "raise", ...
https://github.com/CouchPotato/CouchPotatoServer/blob/7260c12f72447ddb6f062367c6dfbda03ecd4e9c/libs/subliminal/subtitles.py#L82-L92
GoogleCloudPlatform/python-docs-samples
937297c6a31bf4e598c660169d4fb6265eef565a
dataflow/gpu-examples/tensorflow-landsat-prime/main.py
python
get_band_paths
(scene: str, band_names: List[str])
return scene, band_paths
Gets the Cloud Storage paths for each band in a Landsat scene. Args: scene: Landsat 8 scene ID. band_names: List of the band names corresponding to [Red, Green, Blue] channels. Returns: A (scene, band_paths) pair. Raises: ValueError: If the scene or a band does not exist.
Gets the Cloud Storage paths for each band in a Landsat scene.
[ "Gets", "the", "Cloud", "Storage", "paths", "for", "each", "band", "in", "a", "Landsat", "scene", "." ]
def get_band_paths(scene: str, band_names: List[str]) -> Tuple[str, List[str]]: """Gets the Cloud Storage paths for each band in a Landsat scene. Args: scene: Landsat 8 scene ID. band_names: List of the band names corresponding to [Red, Green, Blue] channels. Returns: A (scene, ban...
[ "def", "get_band_paths", "(", "scene", ":", "str", ",", "band_names", ":", "List", "[", "str", "]", ")", "->", "Tuple", "[", "str", ",", "List", "[", "str", "]", "]", ":", "# Extract the metadata from the scene ID using a regular expression.", "m", "=", "SCENE...
https://github.com/GoogleCloudPlatform/python-docs-samples/blob/937297c6a31bf4e598c660169d4fb6265eef565a/dataflow/gpu-examples/tensorflow-landsat-prime/main.py#L130-L158
securesystemslab/zippy
ff0e84ac99442c2c55fe1d285332cfd4e185e089
zippy/benchmarks/src/benchmarks/sympy/sympy/combinatorics/subsets.py
python
Subset.__new__
(cls, subset, superset)
return obj
Default constructor. It takes the subset and its superset as its parameters. Examples ======== >>> from sympy.combinatorics.subsets import Subset >>> a = Subset(['c','d'], ['a','b','c','d']) >>> a.subset ['c', 'd'] >>> a.superset ['a', 'b', 'c',...
Default constructor.
[ "Default", "constructor", "." ]
def __new__(cls, subset, superset): """ Default constructor. It takes the subset and its superset as its parameters. Examples ======== >>> from sympy.combinatorics.subsets import Subset >>> a = Subset(['c','d'], ['a','b','c','d']) >>> a.subset [...
[ "def", "__new__", "(", "cls", ",", "subset", ",", "superset", ")", ":", "if", "len", "(", "subset", ")", ">", "len", "(", "superset", ")", ":", "raise", "ValueError", "(", "'Invalid arguments have been provided. The superset must be larger than the subset.'", ")", ...
https://github.com/securesystemslab/zippy/blob/ff0e84ac99442c2c55fe1d285332cfd4e185e089/zippy/benchmarks/src/benchmarks/sympy/sympy/combinatorics/subsets.py#L37-L63
dimagi/commcare-hq
d67ff1d3b4c51fa050c19e60c3253a79d3452a39
corehq/form_processor/reprocess.py
python
_log_changes
(cases, stock_updates, stock_deletes)
[]
def _log_changes(cases, stock_updates, stock_deletes): if logger.isEnabledFor(logging.INFO): case_ids = [case.case_id for case in cases] logger.info( "changes:\n\tcases: %s\n\tstock changes%s\n\tstock deletes%s", case_ids, stock_updates, stock_deletes )
[ "def", "_log_changes", "(", "cases", ",", "stock_updates", ",", "stock_deletes", ")", ":", "if", "logger", ".", "isEnabledFor", "(", "logging", ".", "INFO", ")", ":", "case_ids", "=", "[", "case", ".", "case_id", "for", "case", "in", "cases", "]", "logge...
https://github.com/dimagi/commcare-hq/blob/d67ff1d3b4c51fa050c19e60c3253a79d3452a39/corehq/form_processor/reprocess.py#L180-L186
out0fmemory/GoAgent-Always-Available
c4254984fea633ce3d1893fe5901debd9f22c2a9
server/lib/google/appengine/_internal/antlr3/streams.py
python
TokenRewriteStream.deleteProgram
(self, programName=DEFAULT_PROGRAM_NAME)
Reset the program so that no instructions exist
Reset the program so that no instructions exist
[ "Reset", "the", "program", "so", "that", "no", "instructions", "exist" ]
def deleteProgram(self, programName=DEFAULT_PROGRAM_NAME): """Reset the program so that no instructions exist""" self.rollback(programName, self.MIN_TOKEN_INDEX)
[ "def", "deleteProgram", "(", "self", ",", "programName", "=", "DEFAULT_PROGRAM_NAME", ")", ":", "self", ".", "rollback", "(", "programName", ",", "self", ".", "MIN_TOKEN_INDEX", ")" ]
https://github.com/out0fmemory/GoAgent-Always-Available/blob/c4254984fea633ce3d1893fe5901debd9f22c2a9/server/lib/google/appengine/_internal/antlr3/streams.py#L1088-L1091
Azure/WALinuxAgent
c964d70282de17ab439be21d7ab32373c3965f59
azurelinuxagent/common/osutil/bigip.py
python
BigIpOSUtil.get_first_if
(self)
return iface.decode('latin-1'), socket.inet_ntoa(sock[i+20:i+24])
Return the interface name, and ip addr of the management interface. We need to add a struct_size check here because, curiously, our 64bit platform is identified by python in Azure(Stack) as 32 bit and without adjusting the struct_size, we can't get the information we need. I believe th...
Return the interface name, and ip addr of the management interface.
[ "Return", "the", "interface", "name", "and", "ip", "addr", "of", "the", "management", "interface", "." ]
def get_first_if(self): """Return the interface name, and ip addr of the management interface. We need to add a struct_size check here because, curiously, our 64bit platform is identified by python in Azure(Stack) as 32 bit and without adjusting the struct_size, we can't get the informa...
[ "def", "get_first_if", "(", "self", ")", ":", "iface", "=", "''", "expected", "=", "16", "# how many devices should I expect...", "python_arc", "=", "platform", ".", "architecture", "(", ")", "[", "0", "]", "if", "python_arc", "==", "'64bit'", ":", "struct_siz...
https://github.com/Azure/WALinuxAgent/blob/c964d70282de17ab439be21d7ab32373c3965f59/azurelinuxagent/common/osutil/bigip.py#L262-L302
awslabs/autogluon
7309118f2ab1c9519f25acf61a283a95af95842b
tabular/src/autogluon/tabular/models/tabular_nn/tabular_nn_torch.py
python
NeuralMultiQuantileRegressor.forward
(self, data_batch)
[]
def forward(self, data_batch): input_data = [] if self.has_vector_features: input_data.append(data_batch['vector'].to(self.device)) if self.has_embed_features: embed_data = data_batch['embed'] for i in range(len(self.embed_blocks)): input_data....
[ "def", "forward", "(", "self", ",", "data_batch", ")", ":", "input_data", "=", "[", "]", "if", "self", ".", "has_vector_features", ":", "input_data", ".", "append", "(", "data_batch", "[", "'vector'", "]", ".", "to", "(", "self", ".", "device", ")", ")...
https://github.com/awslabs/autogluon/blob/7309118f2ab1c9519f25acf61a283a95af95842b/tabular/src/autogluon/tabular/models/tabular_nn/tabular_nn_torch.py#L124-L151
google-research/exoplanet-ml
3dfe65f7ae44443b124ae87b000c317237c7dc00
exoplanet-ml/astrowavenet/trainer.py
python
_get_file_pattern
(mode)
return file_pattern
Gets the value of the file pattern flag for the specified mode.
Gets the value of the file pattern flag for the specified mode.
[ "Gets", "the", "value", "of", "the", "file", "pattern", "flag", "for", "the", "specified", "mode", "." ]
def _get_file_pattern(mode): """Gets the value of the file pattern flag for the specified mode.""" flag_name = ("train_files" if mode == tf.estimator.ModeKeys.TRAIN else "eval_files") file_pattern = FLAGS[flag_name].value if file_pattern is None: raise ValueError("--{} is required for mode '{...
[ "def", "_get_file_pattern", "(", "mode", ")", ":", "flag_name", "=", "(", "\"train_files\"", "if", "mode", "==", "tf", ".", "estimator", ".", "ModeKeys", ".", "TRAIN", "else", "\"eval_files\"", ")", "file_pattern", "=", "FLAGS", "[", "flag_name", "]", ".", ...
https://github.com/google-research/exoplanet-ml/blob/3dfe65f7ae44443b124ae87b000c317237c7dc00/exoplanet-ml/astrowavenet/trainer.py#L133-L140
openshift/openshift-tools
1188778e728a6e4781acf728123e5b356380fe6f
openshift/installer/vendored/openshift-ansible-3.10.0-0.29.0/roles/openshift_logging/library/openshift_logging_facts.py
python
OpenshiftLoggingFacts.facts_for_secrets
(self, namespace)
Gathers facts for secrets in the logging namespace
Gathers facts for secrets in the logging namespace
[ "Gathers", "facts", "for", "secrets", "in", "the", "logging", "namespace" ]
def facts_for_secrets(self, namespace): ''' Gathers facts for secrets in the logging namespace ''' self.default_keys_for("secrets") a_list = self.oc_command("get", "secrets", namespace=namespace) if len(a_list["items"]) == 0: return for item in a_list["items"]: ...
[ "def", "facts_for_secrets", "(", "self", ",", "namespace", ")", ":", "self", ".", "default_keys_for", "(", "\"secrets\"", ")", "a_list", "=", "self", ".", "oc_command", "(", "\"get\"", ",", "\"secrets\"", ",", "namespace", "=", "namespace", ")", "if", "len",...
https://github.com/openshift/openshift-tools/blob/1188778e728a6e4781acf728123e5b356380fe6f/openshift/installer/vendored/openshift-ansible-3.10.0-0.29.0/roles/openshift_logging/library/openshift_logging_facts.py#L247-L260
Map-A-Droid/MAD
81375b5c9ccc5ca3161eb487aa81469d40ded221
mapadroid/madmin/routes/config.py
python
MADminConfig.settings_devices
(self)
return self.process_element(**required_data)
[]
def settings_devices(self): try: identifier = request.args.get('id') int(identifier) except (TypeError, ValueError): pass ggl_accounts = PogoAuth.get_avail_accounts(self._data_manager, 'google', ...
[ "def", "settings_devices", "(", "self", ")", ":", "try", ":", "identifier", "=", "request", ".", "args", ".", "get", "(", "'id'", ")", "int", "(", "identifier", ")", "except", "(", "TypeError", ",", "ValueError", ")", ":", "pass", "ggl_accounts", "=", ...
https://github.com/Map-A-Droid/MAD/blob/81375b5c9ccc5ca3161eb487aa81469d40ded221/mapadroid/madmin/routes/config.py#L238-L274
sympy/sympy
d822fcba181155b85ff2b29fe525adbafb22b448
sympy/physics/control/lti.py
python
MIMOFeedback.sensitivity
(self)
return (eye(self.sys1.num_inputs) - \ self.sign*_sys1_mat*_sys2_mat).inv()
r""" Returns the sensitivity function matrix of the feedback loop. Sensitivity of a closed-loop system is the ratio of change in the open loop gain to the change in the closed loop gain. .. note:: This method would not return the complementary sensitivity functi...
r""" Returns the sensitivity function matrix of the feedback loop.
[ "r", "Returns", "the", "sensitivity", "function", "matrix", "of", "the", "feedback", "loop", "." ]
def sensitivity(self): r""" Returns the sensitivity function matrix of the feedback loop. Sensitivity of a closed-loop system is the ratio of change in the open loop gain to the change in the closed loop gain. .. note:: This method would not return the complementary...
[ "def", "sensitivity", "(", "self", ")", ":", "_sys1_mat", "=", "self", ".", "sys1", ".", "doit", "(", ")", ".", "_expr_mat", "_sys2_mat", "=", "self", ".", "sys2", ".", "doit", "(", ")", ".", "_expr_mat", "return", "(", "eye", "(", "self", ".", "sy...
https://github.com/sympy/sympy/blob/d822fcba181155b85ff2b29fe525adbafb22b448/sympy/physics/control/lti.py#L2167-L2221
lensacom/sparkit-learn
0498502107c1f7dcf33cda0cdb6f5ba4b42524b7
splearn/rdd.py
python
BlockRDD.__repr__
(self)
return "{0} from {1}".format(self.__class__, repr(self._rdd))
Returns a string representation of the ArrayRDD.
Returns a string representation of the ArrayRDD.
[ "Returns", "a", "string", "representation", "of", "the", "ArrayRDD", "." ]
def __repr__(self): """Returns a string representation of the ArrayRDD. """ return "{0} from {1}".format(self.__class__, repr(self._rdd))
[ "def", "__repr__", "(", "self", ")", ":", "return", "\"{0} from {1}\"", ".", "format", "(", "self", ".", "__class__", ",", "repr", "(", "self", ".", "_rdd", ")", ")" ]
https://github.com/lensacom/sparkit-learn/blob/0498502107c1f7dcf33cda0cdb6f5ba4b42524b7/splearn/rdd.py#L154-L157
sagemath/sage
f9b2db94f675ff16963ccdefba4f1a3393b3fe0d
src/sage/arith/misc.py
python
is_prime_power
(n, get_data=False)
return ZZ(n).is_prime_power(get_data=get_data)
r""" Test whether ``n`` is a positive power of a prime number This function simply calls the method :meth:`Integer.is_prime_power() <sage.rings.integer.Integer.is_prime_power>` of Integers. INPUT: - ``n`` -- an integer - ``get_data`` -- if set to ``True``, return a pair ``(p,k)`` such that ...
r""" Test whether ``n`` is a positive power of a prime number
[ "r", "Test", "whether", "n", "is", "a", "positive", "power", "of", "a", "prime", "number" ]
def is_prime_power(n, get_data=False): r""" Test whether ``n`` is a positive power of a prime number This function simply calls the method :meth:`Integer.is_prime_power() <sage.rings.integer.Integer.is_prime_power>` of Integers. INPUT: - ``n`` -- an integer - ``get_data`` -- if set to ``...
[ "def", "is_prime_power", "(", "n", ",", "get_data", "=", "False", ")", ":", "return", "ZZ", "(", "n", ")", ".", "is_prime_power", "(", "get_data", "=", "get_data", ")" ]
https://github.com/sagemath/sage/blob/f9b2db94f675ff16963ccdefba4f1a3393b3fe0d/src/sage/arith/misc.py#L555-L619
pyvista/pyvista
012dbb95a9aae406c3cd4cd94fc8c477f871e426
pyvista/plotting/renderer.py
python
CameraPosition.__getitem__
(self, index)
return self.to_list()[index]
Fetch a component by index location like a list.
Fetch a component by index location like a list.
[ "Fetch", "a", "component", "by", "index", "location", "like", "a", "list", "." ]
def __getitem__(self, index): """Fetch a component by index location like a list.""" return self.to_list()[index]
[ "def", "__getitem__", "(", "self", ",", "index", ")", ":", "return", "self", ".", "to_list", "(", ")", "[", "index", "]" ]
https://github.com/pyvista/pyvista/blob/012dbb95a9aae406c3cd4cd94fc8c477f871e426/pyvista/plotting/renderer.py#L146-L148
JimmXinu/FanFicFare
bc149a2deb2636320fe50a3e374af6eef8f61889
included_dependencies/requests_toolbelt/multipart/decoder.py
python
BodyPart.__init__
(self, content, encoding)
[]
def __init__(self, content, encoding): self.encoding = encoding headers = {} # Split into header section (if any) and the content if b'\r\n\r\n' in content: first, self.content = _split_on_find(content, b'\r\n\r\n') if first != b'': headers = _head...
[ "def", "__init__", "(", "self", ",", "content", ",", "encoding", ")", ":", "self", ".", "encoding", "=", "encoding", "headers", "=", "{", "}", "# Split into header section (if any) and the content", "if", "b'\\r\\n\\r\\n'", "in", "content", ":", "first", ",", "s...
https://github.com/JimmXinu/FanFicFare/blob/bc149a2deb2636320fe50a3e374af6eef8f61889/included_dependencies/requests_toolbelt/multipart/decoder.py#L54-L66
MichaelGrupp/evo
c65af3b69188aaadbbd7b5f99ac7973d74343d65
evo/core/lie_algebra.py
python
so3_log
(r: np.ndarray, return_skew: bool = False)
:param r: SO(3) rotation matrix :param return_skew: return skew symmetric Lie algebra element :return: rotation vector (axis * angle) or if return_skew is True: 3x3 skew symmetric logarithmic map in so(3) (Ma, Soatto eq. 2.8)
:param r: SO(3) rotation matrix :param return_skew: return skew symmetric Lie algebra element :return: rotation vector (axis * angle) or if return_skew is True: 3x3 skew symmetric logarithmic map in so(3) (Ma, Soatto eq. 2.8)
[ ":", "param", "r", ":", "SO", "(", "3", ")", "rotation", "matrix", ":", "param", "return_skew", ":", "return", "skew", "symmetric", "Lie", "algebra", "element", ":", "return", ":", "rotation", "vector", "(", "axis", "*", "angle", ")", "or", "if", "retu...
def so3_log(r: np.ndarray, return_skew: bool = False) -> np.ndarray: """ :param r: SO(3) rotation matrix :param return_skew: return skew symmetric Lie algebra element :return: rotation vector (axis * angle) or if return_skew is True: 3x3 skew symmetric logarithmic map in...
[ "def", "so3_log", "(", "r", ":", "np", ".", "ndarray", ",", "return_skew", ":", "bool", "=", "False", ")", "->", "np", ".", "ndarray", ":", "if", "not", "is_so3", "(", "r", ")", ":", "raise", "LieAlgebraException", "(", "\"matrix is not a valid SO(3) group...
https://github.com/MichaelGrupp/evo/blob/c65af3b69188aaadbbd7b5f99ac7973d74343d65/evo/core/lie_algebra.py#L87-L102
pymedusa/Medusa
1405fbb6eb8ef4d20fcca24c32ddca52b11f0f38
ext/boto/swf/layer1.py
python
Layer1.respond_activity_task_completed
(self, task_token, result=None)
return self.json_request('RespondActivityTaskCompleted', { 'taskToken': task_token, 'result': result, })
Used by workers to tell the service that the ActivityTask identified by the taskToken completed successfully with a result (if provided). :type task_token: string :param task_token: The taskToken of the ActivityTask. :type result: string :param result: The result of the...
Used by workers to tell the service that the ActivityTask identified by the taskToken completed successfully with a result (if provided).
[ "Used", "by", "workers", "to", "tell", "the", "service", "that", "the", "ActivityTask", "identified", "by", "the", "taskToken", "completed", "successfully", "with", "a", "result", "(", "if", "provided", ")", "." ]
def respond_activity_task_completed(self, task_token, result=None): """ Used by workers to tell the service that the ActivityTask identified by the taskToken completed successfully with a result (if provided). :type task_token: string :param task_token: The taskToken of ...
[ "def", "respond_activity_task_completed", "(", "self", ",", "task_token", ",", "result", "=", "None", ")", ":", "return", "self", ".", "json_request", "(", "'RespondActivityTaskCompleted'", ",", "{", "'taskToken'", ":", "task_token", ",", "'result'", ":", "result"...
https://github.com/pymedusa/Medusa/blob/1405fbb6eb8ef4d20fcca24c32ddca52b11f0f38/ext/boto/swf/layer1.py#L183-L201
anatolikalysch/VMAttack
67dcce6087163d85bbe7780e3f6e6e9e72e2212a
static/static_deobfuscate.py
python
first_deobfuscate
(ea, base, endaddr)
return vminst_lst
@brief Converts virtual code between ea and endaddr to VmInstructions @param ea Startaddress of virtual code @param base Address of the jumptable of the virtual machine. @param endaddr Endaddress of virtual code @return List of all VmInstructions between ea and endaddr
[]
def first_deobfuscate(ea, base, endaddr): """ @brief Converts virtual code between ea and endaddr to VmInstructions @param ea Startaddress of virtual code @param base Address of the jumptable of the virtual machine. @param endaddr Endaddress of virtual code @return List of all VmInstructions bet...
[ "def", "first_deobfuscate", "(", "ea", ",", "base", ",", "endaddr", ")", ":", "curraddr", "=", "ea", "instr_lst", "=", "[", "]", "vminst_lst", "=", "[", "]", "catch_value", "=", "None", "while", "curraddr", "<=", "endaddr", ":", "inst_addr", "=", "currad...
https://github.com/anatolikalysch/VMAttack/blob/67dcce6087163d85bbe7780e3f6e6e9e72e2212a/static/static_deobfuscate.py#L120-L188
dephell/dephell
de96f01fcfd8dd620b049369a8ec30dde566c5de
dephell/converters/egginfo.py
python
_Writer.dump
(self, reqs, path: Path, project: RootDependency)
[]
def dump(self, reqs, path: Path, project: RootDependency) -> None: if isinstance(path, str): path = Path(path) if path.is_file(): path.write_text(self.make_info(reqs=reqs, project=project, with_requires=False)) return if path.suffix != '.egg-info': ...
[ "def", "dump", "(", "self", ",", "reqs", ",", "path", ":", "Path", ",", "project", ":", "RootDependency", ")", "->", "None", ":", "if", "isinstance", "(", "path", ",", "str", ")", ":", "path", "=", "Path", "(", "path", ")", "if", "path", ".", "is...
https://github.com/dephell/dephell/blob/de96f01fcfd8dd620b049369a8ec30dde566c5de/dephell/converters/egginfo.py#L250-L268
emesene/emesene
4548a4098310e21b16437bb36223a7f632a4f7bc
emesene/e3/base/Worker.py
python
Worker._handle_action_add_group
(self, name)
handle Action.ACTION_ADD_GROUP
handle Action.ACTION_ADD_GROUP
[ "handle", "Action", ".", "ACTION_ADD_GROUP" ]
def _handle_action_add_group(self, name): '''handle Action.ACTION_ADD_GROUP ''' pass
[ "def", "_handle_action_add_group", "(", "self", ",", "name", ")", ":", "pass" ]
https://github.com/emesene/emesene/blob/4548a4098310e21b16437bb36223a7f632a4f7bc/emesene/e3/base/Worker.py#L217-L220
wistbean/learn_python3_spider
73c873f4845f4385f097e5057407d03dd37a117b
stackoverflow/venv/lib/python3.6/site-packages/pip-19.0.3-py3.6.egg/pip/_vendor/urllib3/packages/six.py
python
add_move
(move)
Add an item to six.moves.
Add an item to six.moves.
[ "Add", "an", "item", "to", "six", ".", "moves", "." ]
def add_move(move): """Add an item to six.moves.""" setattr(_MovedItems, move.name, move)
[ "def", "add_move", "(", "move", ")", ":", "setattr", "(", "_MovedItems", ",", "move", ".", "name", ",", "move", ")" ]
https://github.com/wistbean/learn_python3_spider/blob/73c873f4845f4385f097e5057407d03dd37a117b/stackoverflow/venv/lib/python3.6/site-packages/pip-19.0.3-py3.6.egg/pip/_vendor/urllib3/packages/six.py#L486-L488
materialsproject/pymatgen
8128f3062a334a2edd240e4062b5b9bdd1ae6f58
pymatgen/symmetry/analyzer.py
python
PointGroupAnalyzer.get_equivalent_atoms
(self)
return self._combine_eq_sets(eq["eq_sets"], eq["sym_ops"])
Returns sets of equivalent atoms with symmetry operations Args: None Returns: dict: The returned dictionary has two possible keys: ``eq_sets``: A dictionary of indices mapping to sets of indices, each key maps to indices of all equivalent at...
Returns sets of equivalent atoms with symmetry operations
[ "Returns", "sets", "of", "equivalent", "atoms", "with", "symmetry", "operations" ]
def get_equivalent_atoms(self): """Returns sets of equivalent atoms with symmetry operations Args: None Returns: dict: The returned dictionary has two possible keys: ``eq_sets``: A dictionary of indices mapping to sets of indices, ea...
[ "def", "get_equivalent_atoms", "(", "self", ")", ":", "eq", "=", "self", ".", "_get_eq_sets", "(", ")", "return", "self", ".", "_combine_eq_sets", "(", "eq", "[", "\"eq_sets\"", "]", ",", "eq", "[", "\"sym_ops\"", "]", ")" ]
https://github.com/materialsproject/pymatgen/blob/8128f3062a334a2edd240e4062b5b9bdd1ae6f58/pymatgen/symmetry/analyzer.py#L1395-L1415
home-assistant/core
265ebd17a3f17ed8dc1e9bdede03ac8e323f1ab1
homeassistant/components/solaredge/sensor.py
python
SolarEdgeDetailsSensor.extra_state_attributes
(self)
return self.data_service.attributes
Return the state attributes.
Return the state attributes.
[ "Return", "the", "state", "attributes", "." ]
def extra_state_attributes(self) -> dict[str, Any]: """Return the state attributes.""" return self.data_service.attributes
[ "def", "extra_state_attributes", "(", "self", ")", "->", "dict", "[", "str", ",", "Any", "]", ":", "return", "self", ".", "data_service", ".", "attributes" ]
https://github.com/home-assistant/core/blob/265ebd17a3f17ed8dc1e9bdede03ac8e323f1ab1/homeassistant/components/solaredge/sensor.py#L151-L153
enthought/mayavi
2103a273568b8f0bd62328801aafbd6252543ae8
mayavi/core/base.py
python
Base._load_view_cached
(self, name, view_element)
return view
Use a cached view for the object, for faster refresh.
Use a cached view for the object, for faster refresh.
[ "Use", "a", "cached", "view", "for", "the", "object", "for", "faster", "refresh", "." ]
def _load_view_cached(self, name, view_element): """ Use a cached view for the object, for faster refresh. """ if self._module_view is not None: view = self._module_view else: logger.debug("No view found for [%s] in [%s]. " "Using the base...
[ "def", "_load_view_cached", "(", "self", ",", "name", ",", "view_element", ")", ":", "if", "self", ".", "_module_view", "is", "not", "None", ":", "view", "=", "self", ".", "_module_view", "else", ":", "logger", ".", "debug", "(", "\"No view found for [%s] in...
https://github.com/enthought/mayavi/blob/2103a273568b8f0bd62328801aafbd6252543ae8/mayavi/core/base.py#L396-L406
CouchPotato/CouchPotatoV1
135b3331d1b88ef645e29b76f2d4cc4a732c9232
library/hachoir_parser/game/blp.py
python
color_name
(data, bits)
return ''.join(ret)
Color names in #RRGGBB format, given the number of bits for each component.
Color names in #RRGGBB format, given the number of bits for each component.
[ "Color", "names", "in", "#RRGGBB", "format", "given", "the", "number", "of", "bits", "for", "each", "component", "." ]
def color_name(data, bits): """Color names in #RRGGBB format, given the number of bits for each component.""" ret = ["#"] for i in range(3): ret.append("%02X" % (data[i] << (8-bits[i]))) return ''.join(ret)
[ "def", "color_name", "(", "data", ",", "bits", ")", ":", "ret", "=", "[", "\"#\"", "]", "for", "i", "in", "range", "(", "3", ")", ":", "ret", ".", "append", "(", "\"%02X\"", "%", "(", "data", "[", "i", "]", "<<", "(", "8", "-", "bits", "[", ...
https://github.com/CouchPotato/CouchPotatoV1/blob/135b3331d1b88ef645e29b76f2d4cc4a732c9232/library/hachoir_parser/game/blp.py#L117-L122
ales-tsurko/cells
4cf7e395cd433762bea70cdc863a346f3a6fe1d0
packaging/macos/python/lib/python3.7/site-packages/pip/_internal/cli/parser.py
python
CustomOptionParser.option_list_all
(self)
return res
Get a list of all options, including those in option groups.
Get a list of all options, including those in option groups.
[ "Get", "a", "list", "of", "all", "options", "including", "those", "in", "option", "groups", "." ]
def option_list_all(self): """Get a list of all options, including those in option groups.""" res = self.option_list[:] for i in self.option_groups: res.extend(i.option_list) return res
[ "def", "option_list_all", "(", "self", ")", ":", "res", "=", "self", ".", "option_list", "[", ":", "]", "for", "i", "in", "self", ".", "option_groups", ":", "res", ".", "extend", "(", "i", ".", "option_list", ")", "return", "res" ]
https://github.com/ales-tsurko/cells/blob/4cf7e395cd433762bea70cdc863a346f3a6fe1d0/packaging/macos/python/lib/python3.7/site-packages/pip/_internal/cli/parser.py#L123-L129
linhaow/TextClassify
aa479ae0941c008602631c50124d8c07d159bfb1
pytorch_transformers/modeling_openai.py
python
MLP.__init__
(self, n_state, config)
[]
def __init__(self, n_state, config): # in MLP: n_state=3072 (4 * n_embd) super(MLP, self).__init__() nx = config.n_embd self.c_fc = Conv1D(n_state, nx) self.c_proj = Conv1D(nx, n_state) self.act = ACT_FNS[config.afn] self.dropout = nn.Dropout(config.resid_pdrop)
[ "def", "__init__", "(", "self", ",", "n_state", ",", "config", ")", ":", "# in MLP: n_state=3072 (4 * n_embd)", "super", "(", "MLP", ",", "self", ")", ".", "__init__", "(", ")", "nx", "=", "config", ".", "n_embd", "self", ".", "c_fc", "=", "Conv1D", "(",...
https://github.com/linhaow/TextClassify/blob/aa479ae0941c008602631c50124d8c07d159bfb1/pytorch_transformers/modeling_openai.py#L322-L328
fronzbot/blinkpy
21f29ad302072d16efdc8205aaba826013e69176
blinkpy/sync_module.py
python
BlinkOwl.sync_initialize
(self)
return self.summary
Initialize a sync-less module.
Initialize a sync-less module.
[ "Initialize", "a", "sync", "-", "less", "module", "." ]
def sync_initialize(self): """Initialize a sync-less module.""" self.summary = { "id": self.sync_id, "name": self.name, "serial": self.serial, "status": self.status, "onboarded": True, "account_id": self.blink.account_id, ...
[ "def", "sync_initialize", "(", "self", ")", ":", "self", ".", "summary", "=", "{", "\"id\"", ":", "self", ".", "sync_id", ",", "\"name\"", ":", "self", ".", "name", ",", "\"serial\"", ":", "self", ".", "serial", ",", "\"status\"", ":", "self", ".", "...
https://github.com/fronzbot/blinkpy/blob/21f29ad302072d16efdc8205aaba826013e69176/blinkpy/sync_module.py#L267-L278
Project-MONAI/MONAI
83f8b06372a3803ebe9281300cb794a1f3395018
versioneer.py
python
get_root
()
return root
Get the project root directory. We require that all commands are run from the project root, i.e. the directory that contains setup.py, setup.cfg, and versioneer.py .
Get the project root directory.
[ "Get", "the", "project", "root", "directory", "." ]
def get_root(): """Get the project root directory. We require that all commands are run from the project root, i.e. the directory that contains setup.py, setup.cfg, and versioneer.py . """ root = os.path.realpath(os.path.abspath(os.getcwd())) setup_py = os.path.join(root, "setup.py") versio...
[ "def", "get_root", "(", ")", ":", "root", "=", "os", ".", "path", ".", "realpath", "(", "os", ".", "path", ".", "abspath", "(", "os", ".", "getcwd", "(", ")", ")", ")", "setup_py", "=", "os", ".", "path", ".", "join", "(", "root", ",", "\"setup...
https://github.com/Project-MONAI/MONAI/blob/83f8b06372a3803ebe9281300cb794a1f3395018/versioneer.py#L288-L325
hakril/PythonForWindows
61e027a678d5b87aa64fcf8a37a6661a86236589
windows/debug/debugger.py
python
Debugger._remove_breakpoint_MEMBP
(self, bp, target)
return True
[]
def _remove_breakpoint_MEMBP(self, bp, target): affected_pages = range((bp._addr >> 12) << 12, bp._addr + bp.size, PAGE_SIZE) vprot_begin = affected_pages[0] vprot_size = PAGE_SIZE * len(affected_pages) cp_watch_page = self._watched_pages[self.current_process.pid] for page_addr i...
[ "def", "_remove_breakpoint_MEMBP", "(", "self", ",", "bp", ",", "target", ")", ":", "affected_pages", "=", "range", "(", "(", "bp", ".", "_addr", ">>", "12", ")", "<<", "12", ",", "bp", ".", "_addr", "+", "bp", ".", "size", ",", "PAGE_SIZE", ")", "...
https://github.com/hakril/PythonForWindows/blob/61e027a678d5b87aa64fcf8a37a6661a86236589/windows/debug/debugger.py#L421-L451
apple/ccs-calendarserver
13c706b985fb728b9aab42dc0fef85aae21921c3
txdav/caldav/datastore/scheduling/ischedule/scheduler.py
python
ErrorResponse.__init__
(self, code, error, description=None)
@param code: a response code. @param error: an L{WebDAVElement} identifying the error, or a tuple C{(namespace, name)} with which to create an empty element denoting the error. (The latter is useful in the case of preconditions and postconditions, not all of which have defin...
[]
def __init__(self, code, error, description=None): """ @param code: a response code. @param error: an L{WebDAVElement} identifying the error, or a tuple C{(namespace, name)} with which to create an empty element denoting the error. (The latter is useful in the case of ...
[ "def", "__init__", "(", "self", ",", "code", ",", "error", ",", "description", "=", "None", ")", ":", "if", "type", "(", "error", ")", "is", "tuple", ":", "xml_namespace", ",", "xml_name", "=", "error", "error", "=", "WebDAVUnknownElement", "(", ")", "...
https://github.com/apple/ccs-calendarserver/blob/13c706b985fb728b9aab42dc0fef85aae21921c3/txdav/caldav/datastore/scheduling/ischedule/scheduler.py#L70-L97
PythonCharmers/python-future
80523f383fbba1c6de0551e19d0277e73e69573c
src/future/utils/__init__.py
python
old_div
(a, b)
DEPRECATED: import ``old_div`` from ``past.utils`` instead. Equivalent to ``a / b`` on Python 2 without ``from __future__ import division``. TODO: generalize this to other objects (like arrays etc.)
DEPRECATED: import ``old_div`` from ``past.utils`` instead.
[ "DEPRECATED", ":", "import", "old_div", "from", "past", ".", "utils", "instead", "." ]
def old_div(a, b): """ DEPRECATED: import ``old_div`` from ``past.utils`` instead. Equivalent to ``a / b`` on Python 2 without ``from __future__ import division``. TODO: generalize this to other objects (like arrays etc.) """ if isinstance(a, numbers.Integral) and isinstance(b, numbers.Int...
[ "def", "old_div", "(", "a", ",", "b", ")", ":", "if", "isinstance", "(", "a", ",", "numbers", ".", "Integral", ")", "and", "isinstance", "(", "b", ",", "numbers", ".", "Integral", ")", ":", "return", "a", "//", "b", "else", ":", "return", "a", "/...
https://github.com/PythonCharmers/python-future/blob/80523f383fbba1c6de0551e19d0277e73e69573c/src/future/utils/__init__.py#L668-L680
rubys/venus
9de21094a8cf565bdfcf75688e121a5ad1f5397b
planet/vendor/compat_logging/__init__.py
python
setLoggerClass
(klass)
Set the class to be used when instantiating a logger. The class should define __init__() such that only a name argument is required, and the __init__() should call Logger.__init__()
Set the class to be used when instantiating a logger. The class should define __init__() such that only a name argument is required, and the __init__() should call Logger.__init__()
[ "Set", "the", "class", "to", "be", "used", "when", "instantiating", "a", "logger", ".", "The", "class", "should", "define", "__init__", "()", "such", "that", "only", "a", "name", "argument", "is", "required", "and", "the", "__init__", "()", "should", "call...
def setLoggerClass(klass): """ Set the class to be used when instantiating a logger. The class should define __init__() such that only a name argument is required, and the __init__() should call Logger.__init__() """ if klass != Logger: if not issubclass(klass, Logger): raise...
[ "def", "setLoggerClass", "(", "klass", ")", ":", "if", "klass", "!=", "Logger", ":", "if", "not", "issubclass", "(", "klass", ",", "Logger", ")", ":", "raise", "TypeError", ",", "\"logger not derived from logging.Logger: \"", "+", "klass", ".", "__name__", "gl...
https://github.com/rubys/venus/blob/9de21094a8cf565bdfcf75688e121a5ad1f5397b/planet/vendor/compat_logging/__init__.py#L732-L743
openstack/cinder
23494a6d6c51451688191e1847a458f1d3cdcaa5
cinder/volume/drivers/nec/volume_helper.py
python
MStorageDriver.remove_export_snapshot
(self, context, snapshot)
Removes an export for a snapshot.
Removes an export for a snapshot.
[ "Removes", "an", "export", "for", "a", "snapshot", "." ]
def remove_export_snapshot(self, context, snapshot): """Removes an export for a snapshot.""" msgparm = 'Snapshot ID = %s' % snapshot.id try: self._remove_export_snapshot(context, snapshot) LOG.info('Removed Export Snapshot(%s)', msgparm) except exception.CinderExc...
[ "def", "remove_export_snapshot", "(", "self", ",", "context", ",", "snapshot", ")", ":", "msgparm", "=", "'Snapshot ID = %s'", "%", "snapshot", ".", "id", "try", ":", "self", ".", "_remove_export_snapshot", "(", "context", ",", "snapshot", ")", "LOG", ".", "...
https://github.com/openstack/cinder/blob/23494a6d6c51451688191e1847a458f1d3cdcaa5/cinder/volume/drivers/nec/volume_helper.py#L938-L948
mbusb/multibootusb
fa89b28f27891a9ce8d6e2a5737baa2e6ee83dfd
scripts/grub.py
python
locate_kernel_file
(subpath, isolinux_dir)
return subpath_original
[]
def locate_kernel_file(subpath, isolinux_dir): subpath_original = subpath # Looks like relative paths don't work in grub. #if subpath[0] != '/': # gen.log("Accepting a relative kernel/initrd path '%s' as is." # % subpath) # return subpath if subpath[:1] != '/': subpa...
[ "def", "locate_kernel_file", "(", "subpath", ",", "isolinux_dir", ")", ":", "subpath_original", "=", "subpath", "# Looks like relative paths don't work in grub.", "#if subpath[0] != '/':", "# gen.log(\"Accepting a relative kernel/initrd path '%s' as is.\"", "# % subpath)", ...
https://github.com/mbusb/multibootusb/blob/fa89b28f27891a9ce8d6e2a5737baa2e6ee83dfd/scripts/grub.py#L200-L232
gevent/gevent
ae2cb5aeb2aea8987efcb90a4c50ca4e1ee12c31
src/gevent/contextvars.py
python
copy_context
()
return _context_state.context.copy()
Return a shallow copy of the current context.
Return a shallow copy of the current context.
[ "Return", "a", "shallow", "copy", "of", "the", "current", "context", "." ]
def copy_context(): """ Return a shallow copy of the current context. """ return _context_state.context.copy()
[ "def", "copy_context", "(", ")", ":", "return", "_context_state", ".", "context", ".", "copy", "(", ")" ]
https://github.com/gevent/gevent/blob/ae2cb5aeb2aea8987efcb90a4c50ca4e1ee12c31/src/gevent/contextvars.py#L341-L345
seanbell/opensurfaces
7f3e987560faa62cd37f821760683ccd1e053c7c
server/mturk/models.py
python
MtAssignment.grant_feedback_bonus
(self, save=True)
Give a bonus for submitting feedback
Give a bonus for submitting feedback
[ "Give", "a", "bonus", "for", "submitting", "feedback" ]
def grant_feedback_bonus(self, save=True): """ Give a bonus for submitting feedback """ price = self.hit.hit_type.feedback_bonus print 'Granting feedback bonus: %s, price: $%s' % (self.id, price) connection = get_mturk_connection() connection.grant_bonus( worker_id=se...
[ "def", "grant_feedback_bonus", "(", "self", ",", "save", "=", "True", ")", ":", "price", "=", "self", ".", "hit", ".", "hit_type", ".", "feedback_bonus", "print", "'Granting feedback bonus: %s, price: $%s'", "%", "(", "self", ".", "id", ",", "price", ")", "c...
https://github.com/seanbell/opensurfaces/blob/7f3e987560faa62cd37f821760683ccd1e053c7c/server/mturk/models.py#L1329-L1342
sourmash-bio/sourmash
73aeb155befd7c94042ddb8ca277a69986f25a55
src/sourmash/picklist.py
python
SignaturePicklist.matches_manifest_row
(self, row)
return False
does the given manifest row match this picklist?
does the given manifest row match this picklist?
[ "does", "the", "given", "manifest", "row", "match", "this", "picklist?" ]
def matches_manifest_row(self, row): "does the given manifest row match this picklist?" if self.coltype == 'md5': colkey = 'md5' elif self.coltype in ('md5prefix8', 'md5short'): colkey = 'md5short' elif self.coltype in ('name', 'ident', 'identprefix'): ...
[ "def", "matches_manifest_row", "(", "self", ",", "row", ")", ":", "if", "self", ".", "coltype", "==", "'md5'", ":", "colkey", "=", "'md5'", "elif", "self", ".", "coltype", "in", "(", "'md5prefix8'", ",", "'md5short'", ")", ":", "colkey", "=", "'md5short'...
https://github.com/sourmash-bio/sourmash/blob/73aeb155befd7c94042ddb8ca277a69986f25a55/src/sourmash/picklist.py#L203-L226
ilastik/ilastik
6acd2c554bc517e9c8ddad3623a7aaa2e6970c28
ilastik/workflow.py
python
getWorkflowFromName
(Name)
return workflow by naming its workflowName variable
return workflow by naming its workflowName variable
[ "return", "workflow", "by", "naming", "its", "workflowName", "variable" ]
def getWorkflowFromName(Name): """return workflow by naming its workflowName variable""" for w, _name, _displayName in getAvailableWorkflows(): if _name == Name or w.__name__ == Name or _displayName == Name: return w
[ "def", "getWorkflowFromName", "(", "Name", ")", ":", "for", "w", ",", "_name", ",", "_displayName", "in", "getAvailableWorkflows", "(", ")", ":", "if", "_name", "==", "Name", "or", "w", ".", "__name__", "==", "Name", "or", "_displayName", "==", "Name", "...
https://github.com/ilastik/ilastik/blob/6acd2c554bc517e9c8ddad3623a7aaa2e6970c28/ilastik/workflow.py#L321-L325
securesystemslab/zippy
ff0e84ac99442c2c55fe1d285332cfd4e185e089
zippy/benchmarks/src/benchmarks/sympy/sympy/printing/pretty/pretty.py
python
PrettyPrinter._print_Interval
(self, i)
[]
def _print_Interval(self, i): if i.start == i.end: return self._print_seq(i.args[:1], '{', '}') else: if i.left_open: left = '(' else: left = '[' if i.right_open: right = ')' else: ...
[ "def", "_print_Interval", "(", "self", ",", "i", ")", ":", "if", "i", ".", "start", "==", "i", ".", "end", ":", "return", "self", ".", "_print_seq", "(", "i", ".", "args", "[", ":", "1", "]", ",", "'{'", ",", "'}'", ")", "else", ":", "if", "i...
https://github.com/securesystemslab/zippy/blob/ff0e84ac99442c2c55fe1d285332cfd4e185e089/zippy/benchmarks/src/benchmarks/sympy/sympy/printing/pretty/pretty.py#L1345-L1360
gwastro/pycbc
1e1c85534b9dba8488ce42df693230317ca63dea
pycbc/conversions.py
python
mchirp_from_mass1_mass2
(mass1, mass2)
return eta_from_mass1_mass2(mass1, mass2)**(3./5) * (mass1+mass2)
Returns the chirp mass from mass1 and mass2.
Returns the chirp mass from mass1 and mass2.
[ "Returns", "the", "chirp", "mass", "from", "mass1", "and", "mass2", "." ]
def mchirp_from_mass1_mass2(mass1, mass2): """Returns the chirp mass from mass1 and mass2.""" return eta_from_mass1_mass2(mass1, mass2)**(3./5) * (mass1+mass2)
[ "def", "mchirp_from_mass1_mass2", "(", "mass1", ",", "mass2", ")", ":", "return", "eta_from_mass1_mass2", "(", "mass1", ",", "mass2", ")", "**", "(", "3.", "/", "5", ")", "*", "(", "mass1", "+", "mass2", ")" ]
https://github.com/gwastro/pycbc/blob/1e1c85534b9dba8488ce42df693230317ca63dea/pycbc/conversions.py#L146-L148
glutanimate/review-heatmap
c758478125b60a81c66c87c35b12b7968ec0a348
src/review_heatmap/libaddon/gui/dialog_options.py
python
OptionsDialog.__init__
(self, mapped_widgets, config, form_module=None, parent=None, **kwargs)
Creates an options dialog with the provided Qt form and populates its widgets from a ConfigManager config object. Arguments: mapped_widgets {sequence} -- A list or tuple of mappings between widget names, config value names, and ...
Creates an options dialog with the provided Qt form and populates its widgets from a ConfigManager config object.
[ "Creates", "an", "options", "dialog", "with", "the", "provided", "Qt", "form", "and", "populates", "its", "widgets", "from", "a", "ConfigManager", "config", "object", "." ]
def __init__(self, mapped_widgets, config, form_module=None, parent=None, **kwargs): """ Creates an options dialog with the provided Qt form and populates its widgets from a ConfigManager config object. Arguments: mapped_widgets {sequence} -- A list or tuple...
[ "def", "__init__", "(", "self", ",", "mapped_widgets", ",", "config", ",", "form_module", "=", "None", ",", "parent", "=", "None", ",", "*", "*", "kwargs", ")", ":", "# Mediator methods defined in mapped_widgets might need access to", "# certain instance attributes. As ...
https://github.com/glutanimate/review-heatmap/blob/c758478125b60a81c66c87c35b12b7968ec0a348/src/review_heatmap/libaddon/gui/dialog_options.py#L55-L83
tomplus/kubernetes_asyncio
f028cc793e3a2c519be6a52a49fb77ff0b014c9b
kubernetes_asyncio/client/models/networking_v1beta1_ingress_tls.py
python
NetworkingV1beta1IngressTLS.to_dict
(self)
return result
Returns the model properties as a dict
Returns the model properties as a dict
[ "Returns", "the", "model", "properties", "as", "a", "dict" ]
def to_dict(self): """Returns the model properties as a dict""" result = {} for attr, _ in six.iteritems(self.openapi_types): value = getattr(self, attr) if isinstance(value, list): result[attr] = list(map( lambda x: x.to_dict() if has...
[ "def", "to_dict", "(", "self", ")", ":", "result", "=", "{", "}", "for", "attr", ",", "_", "in", "six", ".", "iteritems", "(", "self", ".", "openapi_types", ")", ":", "value", "=", "getattr", "(", "self", ",", "attr", ")", "if", "isinstance", "(", ...
https://github.com/tomplus/kubernetes_asyncio/blob/f028cc793e3a2c519be6a52a49fb77ff0b014c9b/kubernetes_asyncio/client/models/networking_v1beta1_ingress_tls.py#L106-L128
k-han/DTC
dc036e5082eeeb0d11b45c5ef768c1d0a5b0b560
utils/ramps.py
python
cosine_rampdown
(current, rampdown_length)
return float(.5 * (np.cos(np.pi * current / rampdown_length) + 1))
Cosine rampdown from https://arxiv.org/abs/1608.03983
Cosine rampdown from https://arxiv.org/abs/1608.03983
[ "Cosine", "rampdown", "from", "https", ":", "//", "arxiv", ".", "org", "/", "abs", "/", "1608", ".", "03983" ]
def cosine_rampdown(current, rampdown_length): """Cosine rampdown from https://arxiv.org/abs/1608.03983""" assert 0 <= current <= rampdown_length return float(.5 * (np.cos(np.pi * current / rampdown_length) + 1))
[ "def", "cosine_rampdown", "(", "current", ",", "rampdown_length", ")", ":", "assert", "0", "<=", "current", "<=", "rampdown_length", "return", "float", "(", ".5", "*", "(", "np", ".", "cos", "(", "np", ".", "pi", "*", "current", "/", "rampdown_length", "...
https://github.com/k-han/DTC/blob/dc036e5082eeeb0d11b45c5ef768c1d0a5b0b560/utils/ramps.py#L38-L41
thenetcircle/dino
1047c3458e91a1b4189e9f48f1393b3a68a935b3
dino/cache/__init__.py
python
ICache.set_last_online
(self, last_online_times: list)
:param last_online_times: :return:
[]
def set_last_online(self, last_online_times: list): """ :param last_online_times: :return: """
[ "def", "set_last_online", "(", "self", ",", "last_online_times", ":", "list", ")", ":" ]
https://github.com/thenetcircle/dino/blob/1047c3458e91a1b4189e9f48f1393b3a68a935b3/dino/cache/__init__.py#L115-L120
sagemath/sage
f9b2db94f675ff16963ccdefba4f1a3393b3fe0d
src/sage/combinat/sloane_functions.py
python
A111774._eval
(self, n)
EXAMPLES:: sage: [sloane.A111774._eval(n) for n in range(1,11)] [6, 9, 10, 12, 14, 15, 18, 20, 21, 22]
EXAMPLES::
[ "EXAMPLES", "::" ]
def _eval(self, n): """ EXAMPLES:: sage: [sloane.A111774._eval(n) for n in range(1,11)] [6, 9, 10, 12, 14, 15, 18, 20, 21, 22] """ try: return self._b[n-1] except (AttributeError, IndexError): self._precompute() # try a...
[ "def", "_eval", "(", "self", ",", "n", ")", ":", "try", ":", "return", "self", ".", "_b", "[", "n", "-", "1", "]", "except", "(", "AttributeError", ",", "IndexError", ")", ":", "self", ".", "_precompute", "(", ")", "# try again", "return", "self", ...
https://github.com/sagemath/sage/blob/f9b2db94f675ff16963ccdefba4f1a3393b3fe0d/src/sage/combinat/sloane_functions.py#L8670-L8682
albumentations-team/albumentations
880c1aaed10ab74cfe851496a476c1c34cadcd0f
albumentations/augmentations/functional.py
python
bbox_transpose
(bbox, axis, rows, cols)
return bbox
Transposes a bounding box along given axis. Args: bbox (tuple): A bounding box `(x_min, y_min, x_max, y_max)`. axis (int): 0 - main axis, 1 - secondary axis. rows (int): Image rows. cols (int): Image cols. Returns: tuple: A bounding box tuple `(x_min, y_min, x_max, y_ma...
Transposes a bounding box along given axis.
[ "Transposes", "a", "bounding", "box", "along", "given", "axis", "." ]
def bbox_transpose(bbox, axis, rows, cols): # skipcq: PYL-W0613 """Transposes a bounding box along given axis. Args: bbox (tuple): A bounding box `(x_min, y_min, x_max, y_max)`. axis (int): 0 - main axis, 1 - secondary axis. rows (int): Image rows. cols (int): Image cols. ...
[ "def", "bbox_transpose", "(", "bbox", ",", "axis", ",", "rows", ",", "cols", ")", ":", "# skipcq: PYL-W0613", "x_min", ",", "y_min", ",", "x_max", ",", "y_max", "=", "bbox", "[", ":", "4", "]", "if", "axis", "not", "in", "{", "0", ",", "1", "}", ...
https://github.com/albumentations-team/albumentations/blob/880c1aaed10ab74cfe851496a476c1c34cadcd0f/albumentations/augmentations/functional.py#L1425-L1448
mwaskom/seaborn
77e3b6b03763d24cc99a8134ee9a6f43b32b8e7b
seaborn/external/version.py
python
Version.__str__
(self)
return "".join(parts)
[]
def __str__(self) -> str: parts = [] # Epoch if self.epoch != 0: parts.append(f"{self.epoch}!") # Release segment parts.append(".".join(str(x) for x in self.release)) # Pre-release if self.pre is not None: parts.append("".join(str(x) for...
[ "def", "__str__", "(", "self", ")", "->", "str", ":", "parts", "=", "[", "]", "# Epoch", "if", "self", ".", "epoch", "!=", "0", ":", "parts", ".", "append", "(", "f\"{self.epoch}!\"", ")", "# Release segment", "parts", ".", "append", "(", "\".\"", ".",...
https://github.com/mwaskom/seaborn/blob/77e3b6b03763d24cc99a8134ee9a6f43b32b8e7b/seaborn/external/version.py#L250-L276
citronneur/rdpy
cef16a9f64d836a3221a344ca7d571644280d829
rdpy/protocol/rdp/t125/gcc.py
python
Settings.getBlock
(self, messageType)
return None
@param messageType: type of block @return: specific block of type messageType
[]
def getBlock(self, messageType): """ @param messageType: type of block @return: specific block of type messageType """ for i in self.settings._array: if i.type.value == messageType: return i.dataBlock return None
[ "def", "getBlock", "(", "self", ",", "messageType", ")", ":", "for", "i", "in", "self", ".", "settings", ".", "_array", ":", "if", "i", ".", "type", ".", "value", "==", "messageType", ":", "return", "i", ".", "dataBlock", "return", "None" ]
https://github.com/citronneur/rdpy/blob/cef16a9f64d836a3221a344ca7d571644280d829/rdpy/protocol/rdp/t125/gcc.py#L501-L509
cloudera/hue
23f02102d4547c17c32bd5ea0eb24e9eadd657a4
desktop/core/ext-py/pyOpenSSL-17.5.0/src/OpenSSL/SSL.py
python
Context._check_env_vars_set
(self, dir_env_var, file_env_var)
return ( os.environ.get(file_env_var) is not None or os.environ.get(dir_env_var) is not None )
Check to see if the default cert dir/file environment vars are present. :return: bool
Check to see if the default cert dir/file environment vars are present.
[ "Check", "to", "see", "if", "the", "default", "cert", "dir", "/", "file", "environment", "vars", "are", "present", "." ]
def _check_env_vars_set(self, dir_env_var, file_env_var): """ Check to see if the default cert dir/file environment vars are present. :return: bool """ return ( os.environ.get(file_env_var) is not None or os.environ.get(dir_env_var) is not None )
[ "def", "_check_env_vars_set", "(", "self", ",", "dir_env_var", ",", "file_env_var", ")", ":", "return", "(", "os", ".", "environ", ".", "get", "(", "file_env_var", ")", "is", "not", "None", "or", "os", ".", "environ", ".", "get", "(", "dir_env_var", ")",...
https://github.com/cloudera/hue/blob/23f02102d4547c17c32bd5ea0eb24e9eadd657a4/desktop/core/ext-py/pyOpenSSL-17.5.0/src/OpenSSL/SSL.py#L841-L850
tp4a/teleport
1fafd34f1f775d2cf80ea4af6e44468d8e0b24ad
server/www/packages/packages-windows/x86/asn1crypto/util.py
python
extended_datetime.tzinfo
(self)
return self._y2k.tzinfo
:return: If object is timezone aware, a datetime.tzinfo object, else None.
:return: If object is timezone aware, a datetime.tzinfo object, else None.
[ ":", "return", ":", "If", "object", "is", "timezone", "aware", "a", "datetime", ".", "tzinfo", "object", "else", "None", "." ]
def tzinfo(self): """ :return: If object is timezone aware, a datetime.tzinfo object, else None. """ return self._y2k.tzinfo
[ "def", "tzinfo", "(", "self", ")", ":", "return", "self", ".", "_y2k", ".", "tzinfo" ]
https://github.com/tp4a/teleport/blob/1fafd34f1f775d2cf80ea4af6e44468d8e0b24ad/server/www/packages/packages-windows/x86/asn1crypto/util.py#L601-L607
bastibe/SoundCard
8f07897a518300545048e396450aff171e888c2c
soundcard/mediafoundation.py
python
_str2wstr
(string)
return _ffi.new('int16_t[]', [ord(s) for s in string]+[0])
Converts a Python str to a Windows WSTR_T.
Converts a Python str to a Windows WSTR_T.
[ "Converts", "a", "Python", "str", "to", "a", "Windows", "WSTR_T", "." ]
def _str2wstr(string): """Converts a Python str to a Windows WSTR_T.""" return _ffi.new('int16_t[]', [ord(s) for s in string]+[0])
[ "def", "_str2wstr", "(", "string", ")", ":", "return", "_ffi", ".", "new", "(", "'int16_t[]'", ",", "[", "ord", "(", "s", ")", "for", "s", "in", "string", "]", "+", "[", "0", "]", ")" ]
https://github.com/bastibe/SoundCard/blob/8f07897a518300545048e396450aff171e888c2c/soundcard/mediafoundation.py#L178-L180
atlassian-api/atlassian-python-api
6d8545a790c3aae10b75bdc225fb5c3a0aee44db
atlassian/jira.py
python
Jira.user_set_property
(self, username, key_property, value_property)
return self.put(url, data=data)
Set property for user :param username: :param key_property: :param value_property: :return:
Set property for user :param username: :param key_property: :param value_property: :return:
[ "Set", "property", "for", "user", ":", "param", "username", ":", ":", "param", "key_property", ":", ":", "param", "value_property", ":", ":", "return", ":" ]
def user_set_property(self, username, key_property, value_property): """ Set property for user :param username: :param key_property: :param value_property: :return: """ base_url = self.resource_url("user/properties") url = "{base_url}/{key_property...
[ "def", "user_set_property", "(", "self", ",", "username", ",", "key_property", ",", "value_property", ")", ":", "base_url", "=", "self", ".", "resource_url", "(", "\"user/properties\"", ")", "url", "=", "\"{base_url}/{key_property}?username={user_name}\"", ".", "forma...
https://github.com/atlassian-api/atlassian-python-api/blob/6d8545a790c3aae10b75bdc225fb5c3a0aee44db/atlassian/jira.py#L1555-L1568
pymedusa/Medusa
1405fbb6eb8ef4d20fcca24c32ddca52b11f0f38
ext/urllib3/util/url.py
python
Url.request_uri
(self)
return uri
Absolute path including the query string.
Absolute path including the query string.
[ "Absolute", "path", "including", "the", "query", "string", "." ]
def request_uri(self): """Absolute path including the query string.""" uri = self.path or '/' if self.query is not None: uri += '?' + self.query return uri
[ "def", "request_uri", "(", "self", ")", ":", "uri", "=", "self", ".", "path", "or", "'/'", "if", "self", ".", "query", "is", "not", "None", ":", "uri", "+=", "'?'", "+", "self", ".", "query", "return", "uri" ]
https://github.com/pymedusa/Medusa/blob/1405fbb6eb8ef4d20fcca24c32ddca52b11f0f38/ext/urllib3/util/url.py#L39-L46
probcomp/bayeslite
211e5eb3821a464a2fffeb9d35e3097e1b7a99ba
external/lemonade/dist/lemonade/table.py
python
Configtable_clear
()
return
Remove all data from the table.
Remove all data from the table.
[ "Remove", "all", "data", "from", "the", "table", "." ]
def Configtable_clear(): ''' Remove all data from the table.''' if x4a is None or x4a.count == 0: return for i in range(x4a.size): x4a.ht[i] = None x4a.count = 0 return
[ "def", "Configtable_clear", "(", ")", ":", "if", "x4a", "is", "None", "or", "x4a", ".", "count", "==", "0", ":", "return", "for", "i", "in", "range", "(", "x4a", ".", "size", ")", ":", "x4a", ".", "ht", "[", "i", "]", "=", "None", "x4a", ".", ...
https://github.com/probcomp/bayeslite/blob/211e5eb3821a464a2fffeb9d35e3097e1b7a99ba/external/lemonade/dist/lemonade/table.py#L378-L389
rcorcs/NatI
fdf014f4292afdc95250add7b6658468043228e1
en/parser/nltk_lite/parse/chart.py
python
Chart.insert
(self, edge, child_pointer_list)
Add a new edge to the chart. @type edge: L{Edge} @param edge: The new edge @type child_pointer_list: C{tuple} of L{Edge} @param child_pointer_list: A list of the edges that were used to form this edge. This list is used to reconstruct the trees (or partial trees...
Add a new edge to the chart.
[ "Add", "a", "new", "edge", "to", "the", "chart", "." ]
def insert(self, edge, child_pointer_list): """ Add a new edge to the chart. @type edge: L{Edge} @param edge: The new edge @type child_pointer_list: C{tuple} of L{Edge} @param child_pointer_list: A list of the edges that were used to form this edge. This lis...
[ "def", "insert", "(", "self", ",", "edge", ",", "child_pointer_list", ")", ":", "# Is it a new edge?", "if", "not", "self", ".", "_edge_to_cpls", ".", "has_key", "(", "edge", ")", ":", "# Add it to the list of edges.", "self", ".", "_edges", ".", "append", "("...
https://github.com/rcorcs/NatI/blob/fdf014f4292afdc95250add7b6658468043228e1/en/parser/nltk_lite/parse/chart.py#L524-L561
alephdata/aleph
6d4e944e87f66e9c412e4b6fc807ebd4e57370e0
aleph/util.py
python
_get_logging_context
()
return structlog.contextvars.merge_contextvars(None, None, {})
Get the current logging context
Get the current logging context
[ "Get", "the", "current", "logging", "context" ]
def _get_logging_context(): """Get the current logging context""" return structlog.contextvars.merge_contextvars(None, None, {})
[ "def", "_get_logging_context", "(", ")", ":", "return", "structlog", ".", "contextvars", ".", "merge_contextvars", "(", "None", ",", "None", ",", "{", "}", ")" ]
https://github.com/alephdata/aleph/blob/6d4e944e87f66e9c412e4b6fc807ebd4e57370e0/aleph/util.py#L51-L53
1012598167/flask_mongodb_game
60c7e0351586656ec38f851592886338e50b4110
python_flask/venv/Lib/site-packages/pip-19.0.3-py3.6.egg/pip/_vendor/ipaddress.py
python
_BaseNetwork.is_global
(self)
return not self.is_private
Test if this address is allocated for public networks. Returns: A boolean, True if the address is not reserved per iana-ipv4-special-registry or iana-ipv6-special-registry.
Test if this address is allocated for public networks.
[ "Test", "if", "this", "address", "is", "allocated", "for", "public", "networks", "." ]
def is_global(self): """Test if this address is allocated for public networks. Returns: A boolean, True if the address is not reserved per iana-ipv4-special-registry or iana-ipv6-special-registry. """ return not self.is_private
[ "def", "is_global", "(", "self", ")", ":", "return", "not", "self", ".", "is_private" ]
https://github.com/1012598167/flask_mongodb_game/blob/60c7e0351586656ec38f851592886338e50b4110/python_flask/venv/Lib/site-packages/pip-19.0.3-py3.6.egg/pip/_vendor/ipaddress.py#L1157-L1165
mne-tools/mne-python
f90b303ce66a8415e64edd4605b09ac0179c1ebf
mne/rank.py
python
_estimate_rank_from_s
(s, tol='auto', tol_kind='absolute')
return rank
Estimate the rank of a matrix from its singular values. Parameters ---------- s : ndarray, shape (..., ndim) The singular values of the matrix. tol : float | 'auto' Tolerance for singular values to consider non-zero in calculating the rank. Can be 'auto' to use the same threshol...
Estimate the rank of a matrix from its singular values.
[ "Estimate", "the", "rank", "of", "a", "matrix", "from", "its", "singular", "values", "." ]
def _estimate_rank_from_s(s, tol='auto', tol_kind='absolute'): """Estimate the rank of a matrix from its singular values. Parameters ---------- s : ndarray, shape (..., ndim) The singular values of the matrix. tol : float | 'auto' Tolerance for singular values to consider non-zero i...
[ "def", "_estimate_rank_from_s", "(", "s", ",", "tol", "=", "'auto'", ",", "tol_kind", "=", "'absolute'", ")", ":", "s", "=", "np", ".", "array", "(", "s", ",", "float", ")", "max_s", "=", "np", ".", "amax", "(", "s", ",", "axis", "=", "-", "1", ...
https://github.com/mne-tools/mne-python/blob/f90b303ce66a8415e64edd4605b09ac0179c1ebf/mne/rank.py#L63-L107
OpenMDAO/OpenMDAO1
791a6fbbb7d266f3dcbc1f7bde3ae03a70dc1317
openmdao/core/vec_wrapper_complex_step.py
python
ComplexStepSrcVecWrapper.__getitem__
(self, name)
return self.vals[name]
Retrieve unflattened value of named var. Args ---- name : str Name of variable to get the value for. Returns ------- The unflattened value of the named variable.
Retrieve unflattened value of named var.
[ "Retrieve", "unflattened", "value", "of", "named", "var", "." ]
def __getitem__(self, name): """ Retrieve unflattened value of named var. Args ---- name : str Name of variable to get the value for. Returns ------- The unflattened value of the named variable. """ if name == self.step_va...
[ "def", "__getitem__", "(", "self", ",", "name", ")", ":", "if", "name", "==", "self", ".", "step_var", ":", "return", "self", ".", "step_val", ".", "reshape", "(", "self", ".", "vecwrap", "[", "name", "]", ".", "shape", ")", "return", "self", ".", ...
https://github.com/OpenMDAO/OpenMDAO1/blob/791a6fbbb7d266f3dcbc1f7bde3ae03a70dc1317/openmdao/core/vec_wrapper_complex_step.py#L156-L172