language stringclasses 2
values | func_code_string stringlengths 63 466k |
|---|---|
java | public java.util.List<String> getScalingProcesses() {
if (scalingProcesses == null) {
scalingProcesses = new com.amazonaws.internal.SdkInternalList<String>();
}
return scalingProcesses;
} |
java | protected LogFileHeader logFileHeader()
{
if (tc.isEntryEnabled())
Tr.entry(tc, "logFileHeader", this);
if (tc.isEntryEnabled())
Tr.exit(tc, "logFileHeader", _logFileHeader);
return _logFileHeader;
} |
python | def read_file(filepath: str) -> str:
"""Read a file and return it as a string"""
# ? Check this is ok if absolute paths passed in
filepath = os.path.expanduser(filepath)
with open(filepath) as opened_file: # type: IO
file_read = opened_file.read() # type: str
return file_read |
java | protected void loadPaths(ArrayList<PathImpl> paths, PathImpl dir)
{
try {
for (String fileName : dir.list()) {
PathImpl path = dir.lookup(fileName);
if (fileName.endsWith(".jar") || fileName.endsWith(".zip")) {
paths.add(path);
}
else if (path.isDirectory()) {
... |
java | public static boolean inverseSetContains (@Nonnull final int [] aCodepointSet, final int value)
{
int nStart = 0;
int nEnd = aCodepointSet.length;
while (nEnd - nStart > 8)
{
final int i = (nEnd + nStart) >>> 1;
nStart = aCodepointSet[i] <= value ? i : nStart;
nEnd = aCodepointSet[i]... |
python | def dok15_s(k15):
"""
calculates least-squares matrix for 15 measurements from Jelinek [1976]
"""
#
A, B = design(15) # get design matrix for 15 measurements
sbar = np.dot(B, k15) # get mean s
t = (sbar[0] + sbar[1] + sbar[2]) # trace
bulk = old_div(t, 3.) # bulk susceptibility
Kbar ... |
java | @CheckReturnValue
public <K> FluentGenerator<K> ofType(@Nonnull Class<K> type) {
return from(Generators.ofType(checkNotNull(type), delegate));
} |
python | def to_df(self):
"""
Returns DataFrame with photometry from observations organized.
This DataFrame should be able to be read back in to
reconstruct the observation.
"""
df = pd.DataFrame()
name = []
band = []
resolution = []
mag = []
... |
python | def ram_dp_rf(clka, clkb, wea, web, addra, addrb, dia, dib, doa, dob):
''' RAM: Dual-Port, Read-First '''
memL = [Signal(intbv(0)[len(dia):]) for _ in range(2**len(addra))]
@always(clka.posedge)
def writea():
if wea:
memL[int(addra)].next = dia
doa.next = memL[int(addra)]
... |
python | def glymur_config():
"""
Try to ascertain locations of openjp2, openjpeg libraries.
Returns
-------
tuple
tuple of library handles
"""
handles = (load_openjpeg_library(x) for x in ['openjp2', 'openjpeg'])
handles = tuple(handles)
if all(handle is None for handle in handles)... |
java | private void interiorAreaBoundaryLine_(int half_edge, int id_a, int id_b,
int cluster_index_b) {
if (m_matrix[MatrixPredicate.InteriorBoundary] == 0)
return;
if (m_topo_graph.getHalfEdgeUserIndex(m_topo_graph
.getHalfEdgePrev(m_topo_graph.getHalfEdgeTwin(half_edge)),
m_visited_index) != 1) {
int c... |
java | public static HostsFileEntries parse(File file, Charset... charsets) throws IOException {
checkNotNull(file, "file");
checkNotNull(charsets, "charsets");
if (file.exists() && file.isFile()) {
for (Charset charset: charsets) {
HostsFileEntries entries = parse(new Buffe... |
java | private void parseFaultDetail(BeanDefinitionBuilder builder, Element faultElement) {
List<Element> faultDetailElements = DomUtils.getChildElementsByTagName(faultElement, "fault-detail");
List<String> faultDetails = new ArrayList<String>();
List<String> faultDetailResourcePaths = new ArrayList<St... |
python | def median(self, *args, **kwargs):
'''
geo.median(axis=None, out=None, overwrite_input=False)
axis : int, optional
Axis along which the medians are computed. The default (axis=None)
is to compute the median along a flattened version of the array.
out : ndarray, o... |
java | public NotificationChain basicSetParam(XExpression newParam, NotificationChain msgs)
{
XExpression oldParam = param;
param = newParam;
if (eNotificationRequired())
{
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, XbasePackage.XSYNCHRONIZED_EXPRESSION__PARAM, oldParam, newPara... |
java | public static void mergeFrom(byte[] data, Object message, Schema schema)
{
mergeFrom(data, 0, data.length, message, schema);
} |
python | def to_numpy_matrix(self, variable_order=None):
"""Convert a binary quadratic model to NumPy 2D array.
Args:
variable_order (list, optional):
If provided, indexes the rows/columns of the NumPy array. If `variable_order` includes
any variables not in the binar... |
python | def _transform_coordinates(
self,
func: Callable[[Union[int, float], Union[int, float]],
Tuple[Union[int, float], Union[int, float]]]
) -> None:
"""Helper method to transformer either row or column coordinates."""
def func_x(x: Union[int, float]) -... |
python | def _create_dictionary_of_ned(
self):
"""*Create a list of dictionaries containing all the object ids (NED names) in the ned stream*
**Return:**
- ``dictList`` - a list of dictionaries containing all the object ids (NED names) in the ned stream
**Usage:**
.... |
java | public boolean checkMinDistIsZero(char[] a, char[] b) {
for (int i = 0; i < a.length; i++) {
if (charDistance(a[i], b[i]) > 1) {
return false;
}
}
return true;
} |
python | def getPythonVarName(name):
"""Get the python variable name
"""
return SUB_REGEX.sub('', name.replace('+', '_').replace('-', '_').replace('.', '_').replace(' ', '').replace('/', '_')).upper() |
python | def load_module_opts_from_file(path, module_options):
"""Update module_options with any options defined in module path."""
module_options_file = os.path.join(path,
'runway.module.yml')
if os.path.isfile(module_options_file):
with open(module_options_file, 'r') ... |
java | @Override
protected boolean isSequenceExists(Connection conn, String sequenceName) throws SQLException
{
String seqName = sequenceName.toUpperCase().toLowerCase();
ResultSet srs = null;
Statement st = null;
try
{
st = conn.createStatement();
srs = st.executeQuery("S... |
java | @Override
public void commit() throws IndoubtException {
List<Log> logs = transaction.logs();
int group = 0;
int last = 0;
for (int i = 0; i < logs.size(); i++) {
if (logs.get(i).operation() != Log.Operation.GET) {
group++;
last = i;
}
}
if (group == 0) {
return;
}
// Optimiza... |
java | public String getAccessorName()
{
StringBuffer sb = new StringBuffer();
sb.append(_propertySet.getPrefix());
String name = getName();
sb.append(Character.toUpperCase(name.charAt(0)));
if (name.length() > 0)
sb.append(name.substring(1));
return sb.toSt... |
java | @SuppressWarnings("unchecked")
public <T> T eval(V script, ScriptOutputType type, K... keys) {
return (T) await(c.eval(script, type, keys, (V[]) new Object[0]));
} |
python | def select_tqdm():
"""If running in a jupyter notebook, then returns tqdm_notebook.
Otherwise returns a regular tqdm progress bar.
Returns
-------
progress: function
"""
try:
progress = tqdm.tqdm_notebook
assert get_ipython().has_trait('kernel')
except (NameError, Assert... |
java | public void marshall(DetachInstancesFromLoadBalancerRequest detachInstancesFromLoadBalancerRequest, ProtocolMarshaller protocolMarshaller) {
if (detachInstancesFromLoadBalancerRequest == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
... |
java | public <T extends MvpPresenter> void add(String tag, T instance) {
mPresenters.put(tag, instance);
} |
java | @Override
public void addIntHeader(String hdr, int value) {
this.response.addHeader(hdr, Integer.toString(value));
} |
java | public static ParameterTool paramsFromGenericOptionsParser(String[] args) throws IOException {
Option[] options = new GenericOptionsParser(args).getCommandLine().getOptions();
Map<String, String> map = new HashMap<String, String>();
for (Option option : options) {
String[] split = option.getValue().split("=");... |
python | def queue_rpc(self, rpc, callback=None, *args, **kwds):
"""Schedule an RPC with an optional callback.
The caller must have previously sent the call to the service.
The optional callback is called with the remaining arguments.
NOTE: If the rpc is a MultiRpc, the callback will be called once
for eac... |
python | def local_latlng(self, country_code='US', coords_only=False):
"""Returns a location known to exist on land in a country specified by `country_code`.
Defaults to 'en_US'. See the `land_coords` list for available locations/countries.
"""
results = [loc for loc in self.land_coords if loc[3]... |
python | def get_fields(model_class, field_name='', path=''):
""" Get fields and meta data from a model
:param model_class: A django model class
:param field_name: The field name to get sub fields from
:param path: path of our field in format
field_name__second_field_name__ect__
:returns: Returns fi... |
java | private void sanityCheck(
String seriesName,
double[] openData,
double[] highData,
double[] lowData,
double[] closeData) {
checkData(seriesName, "Open", openData);
checkData(seriesName, "High", highData);
checkData(seriesName, "Low", lowData);
checkData(seriesName, "Close"... |
java | public synchronized void build_connection(final Connection connection) throws DevFailed {
if (!connection.deviceCreated()) {
if (connection.devname != null) {
final long t = System.currentTimeMillis();
final long delay = t - connection.getPrev_failed_t0();
boolean try_reconnection = true;
... |
java | protected Authentication getAuthenticationSatisfiedByPolicy(final Authentication authentication, final ServiceContext context) throws AbstractTicketException {
val policy = this.serviceContextAuthenticationPolicyFactory.createPolicy(context);
try {
if (policy.isSatisfiedBy(authentication)) {... |
java | @Nullable
public Source createSourceSynchronous(
@NonNull SourceParams params,
@Nullable String publishableKey)
throws AuthenticationException,
InvalidRequestException,
APIConnectionException,
APIException {
String apiKey = publishableK... |
java | protected base_resource[] get_nitro_bulk_response(nitro_service service, String response) throws Exception
{
syslog_params_responses result = (syslog_params_responses) service.get_payload_formatter().string_to_resource(syslog_params_responses.class, response);
if(result.errorcode != 0)
{
if (result.error... |
python | def isObjectClassified(self, objectName, minOverlap=None, maxL2Size=None):
"""
Return True if objectName is currently unambiguously classified by every L2
column. Classification is correct and unambiguous if the current L2 overlap
with the true object is greater than minOverlap and if the size of the L2... |
java | private Object getRawValue(String columnName, Map<String, Object> content)
throws ColumnNotFoundException {
String field = columnName;
Object value = content;
while (field != null) {
// If at any point in the path a null is encountered stop
if (value == null)... |
java | public void writeHeader(WritableByteChannel out) throws IOException {
// take care of the annoying case where no records have been added...
if (headerLength == -1) {
headerLength = MINIMUM_HEADER;
}
ByteBuffer buffer = ByteBuffer.allocateDirect(headerLength);
buffer.order(ByteOrder.LITTLE_ENDIAN);
// wr... |
python | def peers_by_group(self, name):
"""
Return zlist of current peers of this group.
"""
return czmq.Zlist(lib.zyre_peers_by_group(self._as_parameter_, name), True) |
python | def run(self):
"""Run the test batch
"""
self.info_log("The test batch is ready.")
self.executed_tests = []
for test in self.tests:
localhost_instance = LocalhostInstance(
runner=self,
browser_config=self.browser_config,
... |
java | protected void defineManagedResource()
{
super.defineManagedResource();
defineAttribute("name");
defineAttribute("displayName");
defineAttribute("className");
defineAttribute("initParameters",READ_ONLY,ON_MBEAN);
_holder=(Holder)getManagedResource();... |
python | def ISO8601Format(dt):
"""
Python datetime isoformat() has the following problems:
- leave trailing 0 at the end of microseconds (violates XMLSchema rule)
- tz print +00:00 instead of Z
- Missing timezone offset for datetime without tzinfo
"""
isoStr = dt.strftime('%Y-%m-%dT%H:%M:%S')
if dt.micr... |
python | def use_plenary_agent_view(self):
"""Pass through to provider ResourceAgentSession.use_plenary_agent_view"""
self._object_views['agent'] = PLENARY
# self._get_provider_session('resource_agent_session') # To make sure the session is tracked
for session in self._get_provider_sessions():
... |
java | public static String getDownLoadSign(String bucketName, String cosPath, Credentials cred, long expired)
throws AbstractCosException {
return appSignatureBase(cred, bucketName, cosPath, expired, false);
} |
java | public void releaseEvent(EventId eventId) throws Exception {
Lockable<V> eventWrapper = sharedBuffer.getEvent(eventId);
if (eventWrapper != null) {
if (eventWrapper.release()) {
sharedBuffer.removeEvent(eventId);
} else {
sharedBuffer.upsertEvent(eventId, eventWrapper);
}
}
} |
java | @Nonnull
@Override
public <V> ScheduledFuture<V> schedule(@Nonnull Callable<V> callable, long delay, @Nonnull TimeUnit unit) {
scheduledOnce.mark();
return delegate.schedule(new InstrumentedCallable<>(callable), delay, unit);
} |
java | public static <DATATYPE> int compare (@Nullable final DATATYPE aObj1,
@Nullable final DATATYPE aObj2,
@Nonnull final Comparator <? super DATATYPE> aComp,
final boolean bNullValuesComeFirst)
{
if... |
python | def write_asc_file(filename, data, xsize, ysize, geotransform, nodata_value):
"""Output Raster to ASCII file.
Args:
filename: output ASCII filename.
data: 2D array data.
xsize: Col count.
ysize: Row count.
geotransform: geographic transformati... |
python | async def CredentialContents(self, credentials, include_secrets):
'''
credentials : typing.Sequence[~CloudCredentialArg]
include_secrets : bool
Returns -> typing.Sequence[~CredentialContentResult]
'''
# map input types to rpc msg
_params = dict()
msg = dic... |
python | def ifelse(self, node):
'ifelse = "if" expr "then" expr "else" expr'
_, cond, _, cons, _, alt = node
return self.eval(cons) if self.eval(cond) else self.eval(alt) |
java | public static Iso8601UtilImpl getInstance() {
if (instance == null) {
synchronized (Iso8601UtilImpl.class) {
if (instance == null) {
instance = new Iso8601UtilImpl();
}
}
}
return instance;
} |
java | public static boolean isNumber(String str) {
if (StrUtil.isBlank(str)) {
return false;
}
char[] chars = str.toCharArray();
int sz = chars.length;
boolean hasExp = false;
boolean hasDecPoint = false;
boolean allowSigns = false;
boolean foundDigit = false;
// deal with any possible sign up ... |
python | def app(session_id, app, bind, port):
"""
Run a local proxy to a service provided by Backend.AI compute sessions.
The type of proxy depends on the app definition: plain TCP or HTTP.
\b
SESSID: The compute session ID.
APP: The name of service provided by the given session.
"""
api_sessi... |
java | private double trueAnomaly(double meanAnomaly, double eccentricity)
{
// First, solve Kepler's equation iteratively
// Duffett-Smith, p.90
double delta;
double E = meanAnomaly;
do {
delta = E - eccentricity * Math.sin(E) - meanAnomaly;
E = E - delta / ... |
java | @Override
public <Y extends Comparable<? super Y>> Predicate greaterThan(Expression<? extends Y> lhs,
Expression<? extends Y> rhs)
{
return new ComparisonPredicate(lhs, rhs, ConditionalOperator.GT);
} |
java | public void buildSerializedFormSummaries(XMLNode node, Content serializedTree) {
Content serializedSummariesTree = writer.getSerializedSummariesHeader();
PackageDoc[] packages = configuration.packages;
for (int i = 0; i < packages.length; i++) {
currentPackage = packages[i];
... |
java | public void assignTerms(Term<?>... terms) throws IllegalArgumentException {
if (terms.length != times)
throw new IllegalArgumentException(
"Invalid length of terms in Repeater.");
this.terms = Arrays.asList(terms);
} |
python | def hybrid_forward(self, F, data, gamma, beta):
"""forward computation."""
# TODO(haibin): LayerNorm does not support fp16 safe reduction. Issue is tracked at:
# https://github.com/apache/incubator-mxnet/issues/14073
if self._dtype:
data = data.astype('float32')
g... |
python | def from_filename(cls, filename, sync_from_start=True):
"""
Create a `Lexer` from a filename.
"""
# Inline imports: the Pygments dependency is optional!
from pygments.util import ClassNotFound
from pygments.lexers import get_lexer_for_filename
try:
py... |
python | def parse_file_entities(filename, entities=None, config=None,
include_unmatched=False):
""" Parse the passed filename for entity/value pairs.
Args:
filename (str): The filename to parse for entity values
entities (list): An optional list of Entity instances to use in
... |
python | def get_music_library_information(self, search_type, start=0,
max_items=100, full_album_art_uri=False,
search_term=None, subcategories=None,
complete_result=False):
"""Retrieve music information obj... |
python | def print_metadata(self, metadata, develop, active, installed_by):
"""
Print out formatted metadata
@param metadata: package's metadata
@type metadata: pkg_resources Distribution obj
@param develop: path to pkg if its deployed in development mode
@type develop: string
... |
java | @Override
public void put(double val, double weight) {
if(weight <= 0) {
return;
}
if(this.n == 0) {
n = weight;
min = max = val;
sum = val * weight;
m2 = m3 = m4 = 0;
return;
}
final double nn = weight + this.n;
final double deltan = val * this.n - this.sum... |
java | private Properties makeProperties(String myTransport,String myHost, String myPort, String outboundProxy, Boolean myAutoDialog,
String threadPoolSize, String reentrantListener, Map<String, String> additionalProperties) throws Exception {
Properties properties = new Properties();
if (myHost == null) myHost = ... |
java | public static int cuMemsetD2D32(CUdeviceptr dstDevice, long dstPitch, int ui, long Width, long Height)
{
return checkResult(cuMemsetD2D32Native(dstDevice, dstPitch, ui, Width, Height));
} |
java | protected Boolean elementAsBoolean(XMLStreamReader reader, String key, Map<String, String> expressions)
throws XMLStreamException, ParserException
{
String elementtext = rawElementText(reader);
if (key != null && expressions != null && elementtext != null && elementtext.indexOf("${") != -1)
... |
java | public List<Entity> find(Entity where) throws SQLException {
return db.find(null, fixEntity(where), new EntityListHandler());
} |
python | def push(self, instance, action, success, idxs=_marker):
"""Adds an instance into the pool, to be reindexed on resume
"""
uid = api.get_uid(instance)
info = self.objects.get(uid, {})
idx = [] if idxs is _marker else idxs
info[action] = {'success': success, 'idxs': idx}
... |
java | protected ExternalStylesheetDescriptor convert(IStylesheetDescriptor stylesheetDescriptor) {
final ExternalStylesheetDescriptor externalStylesheetDescriptor =
new ExternalStylesheetDescriptor();
externalStylesheetDescriptor.setName(stylesheetDescriptor.getName());
externalStyles... |
python | def export_parallel_gateway_info(node_params, output_element):
"""
Adds parallel gateway node attributes to exported XML element
:param node_params: dictionary with given parallel gateway parameters,
:param output_element: object representing BPMN XML 'parallelGateway' element.
... |
python | def is_module_or_package(path):
"""Return True if path is a Python module/package"""
is_module = osp.isfile(path) and osp.splitext(path)[1] in ('.py', '.pyw')
is_package = osp.isdir(path) and osp.isfile(osp.join(path, '__init__.py'))
return is_module or is_package |
python | def monthly_cooling_design_days_100(self):
"""A list of 12 objects representing monthly 10.0% cooling design days."""
if self.monthly_found is False or self._monthly_db_100 == [] \
or self._monthly_wb_100 == []:
return []
else:
db_conds = [DryBulbC... |
python | def _ensure_target_uri_format(self, rec_headers):
"""Checks the value for the WARC-Target-URI header field to see if it starts
with '<' and ends with '>' (Wget 1.19 bug) and if '<' and '>' are present,
corrects and updates the field returning the corrected value for the field
otherwise j... |
python | def _get_token(url, email, secret_key):
'''
retrieve the auth_token from nsot
:param url: str
:param email: str
:param secret_key: str
:return: str
'''
url = urlparse.urljoin(url, 'authenticate')
data_dict = {"email": email, "secret_key": secret_key}
query = salt.utils.http.quer... |
python | def image(node):
"""
An image element
The first child is the alt text. reStructuredText can't handle titles
"""
o = nodes.image(uri=node.destination)
if node.first_child is not None:
o['alt'] = node.first_child.literal
return o |
python | def get_activities(self):
"""Gets all Activities.
In plenary mode, the returned list contains all known activites
or an error results. Otherwise, the returned list may contain
only those activities that are accessible through this session.
return: (osid.learning.ActivityList) - a... |
java | @Override
public RequestBuilder newRequestBuilder() {
RequestBuilder b = new DefaultRequestBuilder();
return b.resolver(FunctionResolver.DEFAULT);
} |
java | protected boolean clear() {
log.debug("clear");
super.removeAttributes();
// send confirmation to client
ownerMessage.addEvent(Type.CLIENT_CLEAR_DATA, name, null);
notifyModified();
changeStats.incrementAndGet();
return true;
} |
java | private void refreshLeftTopHeaderViewHolder(ViewHolder holder) {
int left = calculateRowHeadersLeft();
if (isRTL())
left += mSettings.getCellMargin();
int top = mSettings.isHeaderFixed() ? 0 : -mState.getScrollY();
View view = holder.getItemView();
int leftMargin = ... |
java | public void setRoutingProfileSummaryList(java.util.Collection<RoutingProfileSummary> routingProfileSummaryList) {
if (routingProfileSummaryList == null) {
this.routingProfileSummaryList = null;
return;
}
this.routingProfileSummaryList = new java.util.ArrayList<RoutingPro... |
java | @SuppressWarnings("unchecked")
public Set<EnvironmentType> getAllEnvironmentTypes(String identifier) throws GreenPepperServerException
{
log.debug("Retreiving all Environment Types");
Vector<Object> envTypesParams = (Vector<Object>)execute(XmlRpcMethodName.getAllEnvironmentTypes, new Vector(), i... |
python | def jstemplate(parser, token):
"""Templatetag to handle any of the Mustache-based templates.
Replaces ``[[[`` and ``]]]`` with ``{{{`` and ``}}}``,
``[[`` and ``]]`` with ``{{`` and ``}}`` and
``[%`` and ``%]`` with ``{%`` and ``%}`` to avoid conflicts
with Django's template engine when using any ... |
python | def check_config(config):
"""Check that all sections of the config contain the keys that they should.
Args:
config (defaultdict): A defaultdict.
Raises:
ConfigurationError
"""
for section, expected_section_keys in SECTION_KEYS.items():
section_content = config.get(section)
... |
java | @Override
public Slf4jMetricReporter init(ConfigurationProperties configurationProperties, MetricRegistry metricRegistry) {
metricLogReporterMillis = configurationProperties.getMetricLogReporterMillis();
if (metricLogReporterMillis > 0) {
this.slf4jReporter = Slf4jReporter
... |
python | def _CreateInterfaceMapNetifaces(self):
"""Generate a dictionary mapping MAC address to Ethernet interfaces.
Returns:
dict, string MAC addresses mapped to the string network interface name.
"""
interfaces = {}
for interface in netifaces.interfaces():
af_link = netifaces.ifaddresses(int... |
python | def cwl_output_files(cwl_data, inputs_to_reference, output_dir=None):
"""
Returns a dictionary containing information about the output files given in cwl_data.
:param cwl_data: The cwl data from where to extract the output file information.
:param inputs_to_reference: Inputs which are used to resolve i... |
python | def load(filename, default=None):
'''
Try to load @filename. If there is no loader for @filename's filetype,
return @default.
'''
ext = get_ext(filename)
if ext in ldict:
return ldict[ext](filename)
else:
return default |
java | protected CmsResource readJspResource(CmsFlexController controller, String jspName) throws CmsException {
// create an OpenCms user context that operates in the root site
CmsObject cms = OpenCms.initCmsObject(controller.getCmsObject());
// we only need to change the site, but not the project,
... |
python | def runGetFeature(self, id_):
"""
Returns JSON string of the feature object corresponding to
the feature compoundID passed in.
"""
compoundId = datamodel.FeatureCompoundId.parse(id_)
dataset = self.getDataRepository().getDataset(compoundId.dataset_id)
featureSet =... |
java | private void addAttributeInternal(EntityType entityType, Attribute attr) {
if (!isPersisted(attr)) {
return;
}
if (isMultipleReferenceType(attr)) {
createJunctionTable(entityType, attr);
if (attr.getDefaultValue() != null && !attr.isNillable()) {
@SuppressWarnings("unchecked")
... |
python | def read_bit(self, registeraddress, functioncode=2):
"""Read one bit from the slave.
Args:
* registeraddress (int): The slave register address (use decimal numbers, not hex).
* functioncode (int): Modbus function code. Can be 1 or 2.
Returns:
The bit value 0... |
python | def xpointerNewRangeNodes(self, end):
"""Create a new xmlXPathObjectPtr of type range using 2 nodes """
if end is None: end__o = None
else: end__o = end._o
ret = libxml2mod.xmlXPtrNewRangeNodes(self._o, end__o)
if ret is None:raise treeError('xmlXPtrNewRangeNodes() failed')
... |
python | def disconnect_socket(self):
"""
Disconnect the underlying socket connection
"""
self.running = False
if self.socket is not None:
if self.__need_ssl():
#
# Even though we don't want to use the socket, unwrap is the only API method which... |
python | def mute(model: Model):
"""Block a model's views from being notified.
All changes within a "mute" context will be blocked. No content is yielded to the
user as in :func:`hold`, and the views of the model are never notified that changes
took place.
Parameters:
mode: The model whose change e... |
python | def simple_newton(f, x0, lb=None, ub=None, infos=False, verbose=False, maxit=50, tol=1e-8, eps=1e-8, numdiff=True):
'''Solves many independent systems f(x)=0 simultaneously using a simple gradient descent.
:param f: objective function to be solved with values p x N . The second output argument represents the de... |
java | private ObjectName registerMXBean(MBeanServer pServer, Object pObject, Class pManagementInterface, String pName) throws MalformedObjectNameException, NotCompliantMBeanException, InstanceAlreadyExistsException, MBeanRegistrationException {
ObjectName objectName = new ObjectName(pName);
final StandardMBea... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.