language stringclasses 2
values | func_code_string stringlengths 63 466k |
|---|---|
python | def normalize(x:TensorImage, mean:FloatTensor,std:FloatTensor)->TensorImage:
"Normalize `x` with `mean` and `std`."
return (x-mean[...,None,None]) / std[...,None,None] |
python | def merge(args):
"""
%prog merge ref.fasta query.fasta *.delta
Merge delta files into a single delta.
"""
p = OptionParser(merge.__doc__)
p.set_outfile(outfile="merged_results.delta")
opts, args = p.parse_args(args)
if len(args) < 3:
sys.exit(not p.print_help())
ref, query... |
python | def context(self):
""" Provides request context """
type = "client_associate" if self.key is None else "client_update"
data = {
"type": type,
"application_type": self.type,
}
# is this an update?
if self.key:
data["client_id"] = self.k... |
java | static String md5(String origin) {
try {
MessageDigest md = MessageDigest.getInstance("MD5");
md.update(origin.getBytes("UTF-8"));
BigInteger bi = new BigInteger(1, md.digest());
StringBuilder hash = new StringBuilder(bi.toString(16));
while (hash.length() < 32) {
hash.insert(... |
python | def geocode(
self,
query,
exactly_one=True,
timeout=DEFAULT_SENTINEL,
boundary_rect=None,
country_bias=None,
):
"""
Return a location point by address.
:param str query: The address, query or structured query to geocode... |
java | @Override
public final void onEndPage(PdfWriter writer, Document document) {
super.onEndPage(writer, document);
sanitize(writer);
try {
if (failuresHereAfter || debugHereAfter) {
PdfContentByte bg = writer.getDirectContentUnder();
Rectangle rect = writer.getPageSize... |
java | public static long fieldToValue(byte[] buffer, int offset, int length) {
long total = 0;
long val = 0;
for (int i = 0; i < length; i++) {
val = buffer[offset + i];
if (val < 0) {
val = val + 256;
}
total += (long) Math.pow(256.0, (double) (length - 1 - i)) * val;
}
re... |
python | def create_lock(self, resource, **kwargs):
"""
Create a new RedLock object and reuse stored Redis clients.
All the kwargs it received would be passed to the RedLock's __init__
function.
"""
lock = RedLock(resource=resource, created_by_factory=True, **kwargs)
lock.... |
java | public static int[] markWalkableTriangles(Context ctx, float walkableSlopeAngle, float[] verts, int[] tris, int nt,
AreaModification areaMod) {
int[] areas = new int[nt];
float walkableThr = (float) Math.cos(walkableSlopeAngle / 180.0f * Math.PI);
float norm[] = new float[3];
... |
python | def apply(cls, value, prop, visitor):
"""'apply' is a general place to put a function which is called on
every extant record slot. This is usually the most important function
to implement when sub-classing.
The default implementation passes through the slot value as-is, but
exp... |
java | public SearchQuery highlight(HighlightStyle style, String... fields) {
this.highlightStyle = style;
if (fields != null && fields.length > 0) {
highlightFields = fields;
}
return this;
} |
python | def put(self, ndef_message, timeout=1.0):
"""Send an NDEF message to the server. Temporarily connects to
the default SNEP server if the client is not yet connected.
.. deprecated:: 0.13
Use :meth:`put_records` or :meth:`put_octets`.
"""
if not self.socket:
... |
python | def get_vnetwork_dvpgs_input_name(self, **kwargs):
"""Auto Generated Code
"""
config = ET.Element("config")
get_vnetwork_dvpgs = ET.Element("get_vnetwork_dvpgs")
config = get_vnetwork_dvpgs
input = ET.SubElement(get_vnetwork_dvpgs, "input")
name = ET.SubElement(in... |
java | public Matrix4x3f reflect(Quaternionfc orientation, Vector3fc point, Matrix4x3f dest) {
double num1 = orientation.x() + orientation.x();
double num2 = orientation.y() + orientation.y();
double num3 = orientation.z() + orientation.z();
float normalX = (float) (orientation.x() * num3 + ori... |
python | def content_ids(params):
"""does the same this as `pageviews`, except it includes content ids and then optionally filters
the response by a list of content ids passed as query params - note, this load can be a little
heavy and could take a minute
"""
# set up default values
default_from, default... |
python | def color_process(queue, lock):
"Receive filenames and get the colors from their images."
while True:
block = queue.get()
if block == config.SENTINEL:
break
for filename in block:
try:
palette = extract_colors(filename)
except: # TODO... |
java | @Override
public void setOwner(Path p, String username, String groupname
) throws IOException {
if (username == null && groupname == null) {
throw new IOException("username == null && groupname == null");
}
if (username == null) {
execCommand(pathToFile(p), Shell.SET_GROUP_COMMAND, grou... |
java | public void setDialect(String dialect) {
String[] scripts = createScripts.get(dialect);
createSql = scripts[0];
createSqlInd = scripts[1];
} |
python | def read_prologue(self):
"""Read the prologue metadata."""
with open(self.filename, "rb") as fp_:
fp_.seek(self.mda['total_header_length'])
data = np.fromfile(fp_, dtype=hrit_prologue, count=1)
self.prologue.update(recarray2dict(data))
try:
... |
java | public int doStartTag()
throws JspException
{
// evaluate the datasource and disabled state.
Object val = evaluateDataSource();
if (val != null)
_match = val.toString();
// Store this tag itself as a page attribute
pageContext.setAttribute(RADIOBUTTON... |
java | public static String hash(final File aFile, final String aAlgorithm) throws NoSuchAlgorithmException,
IOException {
final MessageDigest md = MessageDigest.getInstance(aAlgorithm);
final FileInputStream inStream = new FileInputStream(aFile);
final DigestInputStream mdStream = new Dige... |
java | @BetaApi
public final DiskType getRegionDiskType(String diskType) {
GetRegionDiskTypeHttpRequest request =
GetRegionDiskTypeHttpRequest.newBuilder().setDiskType(diskType).build();
return getRegionDiskType(request);
} |
java | public static String getCategoryPath(String rootPath, String baseFolder) throws CmsException {
String base;
if (rootPath.startsWith(CmsCategoryService.CENTRALIZED_REPOSITORY)) {
base = CmsCategoryService.CENTRALIZED_REPOSITORY;
} else {
base = baseFolder;
if ... |
python | def copy_table(src_con, dst_con, src_table_name, dst_table_name, is_overwrite=True):
"""
Copy a table from source to destination.
:param SimpleSQLite src_con: Connection to the source database.
:param SimpleSQLite dst_con: Connection to the destination database.
:param str src_table_name: Source ta... |
python | def get_service_key(self, service_name, key_name):
"""
Returns the service key details.
Similar to `cf service-key`.
"""
for key in self._get_service_keys(service_name)['resources']:
if key_name == key['entity']['name']:
guid = key['metadata']['guid']... |
python | def seed(self):
"""
Seed new initial values for the stochastics.
"""
for generation in self.generations:
for s in generation:
try:
if s.rseed is not None:
value = s.random(**s.parents.value)
except:
... |
java | public boolean compareAndSetChannel(@Nullable Channel oldChannel, @Nullable Channel newChannel) {
return channel.compareAndSet(oldChannel, newChannel);
} |
java | @SafeVarargs
public static BooleanBinding and(ObservableValue<Boolean>...values) {
return Bindings.createBooleanBinding(
()-> !Arrays.stream(values)
.filter(observable -> !observable.getValue())
.findAny()
.isPresent(), values);
} |
python | def _convert_to_ndarray(self, data):
"""Converts data from dataframe to ndarray format. Assumption: df-columns are ndarray-layers (3rd dim.)"""
if data.__class__.__name__ != "DataFrame":
raise Exception(f"data is not a DataFrame but {data.__class__.__name__}.")
shape_ndarray = (self.... |
java | private static String multiPointCoordinatesFromWkt(String wkt) {
wkt = removeBrackets(wkt,1);
boolean isSecondVersionMultiPoint = wkt.contains("(");
String coordinates = "";
if(isSecondVersionMultiPoint){
//(10 40), (40 30), (20 20)-> 10 40, 40 30, 20 20
wkt = wkt... |
java | private void warnAboutNamespaceRedefinition(Name nameObj, Ref ref) {
compiler.report(
JSError.make(ref.getNode(), NAMESPACE_REDEFINED_WARNING, nameObj.getFullName()));
} |
python | def _get_input_readers(self, state):
"""Get input readers.
Args:
state: a MapreduceState model.
Returns:
A tuple: (a list of input readers, a model._HugeTaskPayload entity).
The payload entity contains the json serialized input readers.
(None, None) when input reader inplitting returne... |
python | def _handle_resize(self, signum=None, frame=None):
'Tries to catch resize signals sent from the terminal.'
w, h = utils.get_terminal_size()
self.term_width = w |
java | @Override
boolean getMatches(Proposition proposition, Collection<String> propIds) throws KnowledgeSourceReadException {
if (!super.getMatches(proposition, propIds)) {
return false;
}
if (!(proposition instanceof TemporalParameter)) {
return false;
}
T... |
python | def _extract_calibration(xroot):
"""Extract AHRS calibration information from XML root.
Parameters
----------
xroot: XML root
Returns
-------
Aoff: numpy.array with shape(3,)
Arot: numpy.array with shape(3,3)
Hoff: numpy.array with shape(3,)
Hrot: numpy.array with shape(3,3)
... |
python | def repository(namespace, name, branch='master'):
'''Returns a repository'''
with TemporaryDirectory() as download_path:
old_directory = str(pwd()).strip()
try:
git.clone('https://github.com/{0}/{1}.git'.format(namespace, name), download_path)
cd(download_path)
... |
python | def determine_emitter(self, request, *args, **kwargs):
"""
Function for determening which emitter to use
for output. It lives here so you can easily subclass
`Resource` in order to change how emission is detected.
You could also check for the `Accept` HTTP header here,
s... |
java | public static String percentDecode(String source) throws AuthException {
try {
return URLDecoder.decode(source, "UTF-8");
} catch (java.io.UnsupportedEncodingException ex) {
throw new AuthException("cannot decode value '" + source + "'", ex);
}
} |
java | public String getJsDoc() {
Comment comment = getJsDocNode();
if (comment != null) {
return comment.getValue();
}
return null;
} |
java | private void validateRequest( DownloadRequest dreq )
throws ErrorResponseException
{
String path = dreq.getPath();
if ( path.endsWith( ResourceCatalog.VERSION_XML_FILENAME ) || path.indexOf( "__" ) != -1 )
{
throw new ErrorResponseException( DownloadResponse.getNoCont... |
python | def _jog(self, axis, direction, step):
"""
Move the pipette on `axis` in `direction` by `step` and update the
position tracker
"""
jog(axis, direction, step, self.hardware, self._current_mount)
self.current_position = self._position()
return 'Jog: {}'.format([axi... |
java | private static String toHtmlString(final OptionWithMetaInfo optionWithMetaInfo) {
ConfigOption<?> option = optionWithMetaInfo.option;
String defaultValue = stringifyDefault(optionWithMetaInfo);
return "" +
" <tr>\n" +
" <td><h5>" + escapeCharacters(option.key()) + "</h5></td>\n" +
" ... |
python | def get_closed_cycles(self):
"""Return the closed cycles corresponding to this permutation
The cycle will be normalized to facilitate the elimination of
duplicates. The following is guaranteed:
1) If this permutation is represented by disconnected cycles, the
cyc... |
python | def map_azure_exceptions(key=None, exc_pass=()):
"""Map Azure-specific exceptions to the simplekv-API."""
from azure.common import AzureMissingResourceHttpError, AzureHttpError,\
AzureException
try:
yield
except AzureMissingResourceHttpError as ex:
if ex.__class__.__name__ not in... |
python | def Overlay_setShowPaintRects(self, result):
"""
Function path: Overlay.setShowPaintRects
Domain: Overlay
Method name: setShowPaintRects
Parameters:
Required arguments:
'result' (type: boolean) -> True for showing paint rectangles
No return value.
Description: Requests that backend sho... |
java | protected final String contents (String source, int lineno)
throws CDDBException
{
int eidx = source.indexOf("=");
if (eidx == -1) {
throw new CDDBException(500, "Malformed line '" + source + "' number " + lineno);
}
return source.substring(eidx+1);
} |
python | def _find_navigation_coefs(self):
"""Find navigation coefficients for the current time
The navigation Chebyshev coefficients are only valid for a certain time interval. The header entry
SatelliteStatus/Orbit/OrbitPolynomial contains multiple coefficients for multiple time intervals. Find the
... |
python | def with_env_recursive(cmd, **envvars):
"""
Recursively updates the environment of cmd and all its subcommands.
Args:
cmd - A plumbum command-like object
**envvars - The environment variables to update
Returns:
The updated command.
"""
from plumbum.commands.base import ... |
python | def com_google_fonts_check_italic_angle(ttFont, style):
"""Checking post.italicAngle value."""
failed = False
value = ttFont["post"].italicAngle
# Checking that italicAngle <= 0
if value > 0:
failed = True
yield FAIL, Message("positive",
("The value of post.italicAngle is posi... |
java | public static double distanceBetween(double latitude1, double longitude1, double latitude2, double longitude2) {
double dLat = toRadians(latitude2 - latitude1);
double dLon = toRadians(longitude2 - longitude1);
latitude1 = toRadians(latitude1);
latitude2 = toRadians(latitude2);
... |
java | @Override
public List<String> listTables() {
ListTablesRequest requestProto = ListTablesRequest.newBuilder()
.setParent(instanceName.toString())
.build();
ListTablesResponse response = delegate.listTables(requestProto);
ImmutableList.Builder<String> tableIdsBuilder = ImmutableList.builde... |
java | public void setNetworkInterfacePermissionIds(java.util.Collection<String> networkInterfacePermissionIds) {
if (networkInterfacePermissionIds == null) {
this.networkInterfacePermissionIds = null;
return;
}
this.networkInterfacePermissionIds = new com.amazonaws.internal.Sd... |
python | def effect_associated_with_protein_coding_transcript(effect):
"""
Parameters
----------
effect : subclass of MutationEffect
Returns True if effect is associated with a transcript and that transcript
has a protein_coding biotype.
"""
return apply_to_transcript_if_exists(
effect=e... |
java | public Datatype.Builder addNestedClasses(Excerpt element) {
if (nestedClasses instanceof ImmutableList) {
nestedClasses = new ArrayList<>(nestedClasses);
}
nestedClasses.add(Objects.requireNonNull(element));
return (Datatype.Builder) this;
} |
java | public static String unescapeJson(final String text) {
if (text == null) {
return null;
}
if (text.indexOf('\\') < 0) {
// Fail fast, avoid more complex (and less JIT-table) method to execute if not needed
return text;
}
return JsonEscapeUtil.u... |
python | def create_predict_function(
route, predict_service, decorator_list_name, config):
"""Creates a predict function and registers it to
the Flask app using the route decorator.
:param str route:
Path of the entry point.
:param palladium.interfaces.PredictService predict_service:
The p... |
java | public static MozuUrl updateLocationInventoryUrl(String productCode)
{
UrlFormatter formatter = new UrlFormatter("/api/commerce/catalog/admin/products/{ProductCode}/LocationInventory");
formatter.formatUrl("productCode", productCode);
return new MozuUrl(formatter.getResourceUrl(), MozuUrl.UrlLocation.TENANT_... |
java | public void forEach(@NotNull final Consumer<? super T> action) {
while (iterator.hasNext()) {
action.accept(iterator.next());
}
} |
python | def put_bot(name=None, description=None, intents=None, clarificationPrompt=None, abortStatement=None, idleSessionTTLInSeconds=None, voiceId=None, checksum=None, processBehavior=None, locale=None, childDirected=None):
"""
Creates an Amazon Lex conversational bot or replaces an existing bot. When you create or up... |
java | protected void createExtendedMetaDataAnnotations() {
String source = "http:///org/eclipse/emf/ecore/util/ExtendedMetaData";
addAnnotation
(documentRootEClass,
source,
new String[] {
"name", "",
"kind", "mixed"
});
addAnnotation
(getDocumentRoot_Mixed(),
source,
new... |
java | public void revertToRevision(final String resourceName, final long backToRevision) throws JaxRxException,
TTException {
ISession session = null;
INodeWriteTrx wtx = null;
boolean abort = false;
try {
session = mDatabase.getSession(new SessionConfiguration(resourceName... |
python | def make_request(self, session, url, **kwargs):
"""Make a HTTP POST request.
:param url: The URL to post to.
:param data: The data to post.
:returns: The response to the request.
:rtype: requests.Response
"""
log.debug('Making request: POST %s %s' % (url, kwargs)... |
java | public static Function<? super ReactiveSeq<Double>, ? extends ReactiveSeq<Double>> concatDoubles( ReactiveSeq<Double> b){
return a->ReactiveSeq.fromSpliterator(DoubleStream.concat(a.mapToDouble(i->i),b.mapToDouble(i->i)).spliterator());
} |
python | def _find_workflows(mcs, attrs):
"""Finds all occurrences of a workflow in the attributes definitions.
Returns:
dict(str => StateField): maps an attribute name to a StateField
describing the related Workflow.
"""
workflows = {}
for attribute, value in... |
java | public final EObject entryRuleXRelationalExpression() throws RecognitionException {
EObject current = null;
EObject iv_ruleXRelationalExpression = null;
try {
// InternalPureXbase.g:1355:62: (iv_ruleXRelationalExpression= ruleXRelationalExpression EOF )
// InternalPure... |
python | def create(self, using=None, **kwargs):
"""
Creates the index in elasticsearch.
Any additional keyword arguments will be passed to
``Elasticsearch.indices.create`` unchanged.
"""
self._get_connection(using).indices.create(index=self._name, body=self.to_dict(), **kwargs) |
java | @NotNull
public <T> Mode with(@NotNull Key<T> key, @Nullable T value) {
return new Mode(Map(this.defs, key, value));
} |
python | def healpix_to_skycoord(self, healpix_index, dx=None, dy=None):
"""
Convert HEALPix indices (optionally with offsets) to celestial coordinates.
Note that this method requires that a celestial frame was specified when
initializing HEALPix. If you don't know or need the celestial frame, y... |
java | public void init() throws SSLException {
if (sslEngine != null) {
// We already have a SSL engine created, no need to create a new one
return;
}
InetSocketAddress peer = (InetSocketAddress) session
.getAttribute(SslFilter.PEER_ADDRESS);
/... |
java | public static final String remainingToHex(ByteBuffer bb)
{
byte[] buf = new byte[bb.remaining()];
int safe = bb.position();
bb.get(buf);
bb.position(safe);
return toHex(buf);
} |
python | def fit_transform(self, X, u=None):
"""Fit X into an embedded space and return that transformed
output.
Inputs
----------
X : array, shape (n_samples, n_features). X contains a sample per row.
Returns
-------
embedding : array, shape (n_samples, n_compone... |
python | def is_subsequence(short_seq, long_seq):
"""Is short_seq a subsequence of long_seq."""
if not short_seq:
return True
pos = 0
for x in long_seq:
if pos == len(short_seq):
return True
if short_seq[pos] == x:
pos += 1
if pos == len(short_seq):
return True
return False |
python | def _on_first_interaction(self):
"""
Bookkeeping for first timestep of episode.
This function is necessary to make sure that logging only happens after the first
step call to the simulation, instead of on the reset (people tend to call
reset more than is necessary in code).
... |
java | public static DescriptorExtensionList<SecurityRealm,Descriptor<SecurityRealm>> all() {
return Jenkins.getInstance().<SecurityRealm,Descriptor<SecurityRealm>>getDescriptorList(SecurityRealm.class);
} |
java | public boolean write(DataOutputStream daOut, boolean bFixedLength)
{
try {
Double doData = (Double)this.getData();
double dData;
if (doData == null)
dData = Double.NaN;
else
dData = doData.doubleValue();
daOut.writ... |
java | public WeightedGraph subgraph(Set<Integer> vertices) {
// Get a subgraph from the parent graph (which is just a Graph) and then
// wrap it with an adaptor to fulfill the WeightedGraph API
Graph<WeightedEdge> g = super.subgraph(vertices);
return new SubgraphAdaptor(g);
} |
java | @Override
public Set<Annotation> getQualifiers() {
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {
Tr.entry(tc, "getQualifiers");
}
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {
Tr.exit(tc, "getQualifiers", qualifiers);
... |
java | public Observable<ConnectionSharedKeyInner> beginSetSharedKeyAsync(String resourceGroupName, String virtualNetworkGatewayConnectionName, String value) {
return beginSetSharedKeyWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayConnectionName, value).map(new Func1<ServiceResponse<ConnectionSharedK... |
python | def has_repos(self):
"""
boolean to reflect having (or not) any repository sections
"""
for section in self.sections():
if section not in self.reserved_sections:
return True
return False |
java | @FFDCIgnore(value = { InterruptedException.class })
public Client checkoutClient() {
Client client = null;
try {
// need to poll here as the dequeue can be permanently emptied by close method at any time
while (client == null && numClientsClosed.get() == 0) {
... |
python | def login(self, client_id, client_secret, username, password, scope, realm,
audience, grant_type='http://auth0.com/oauth/grant-type/password-realm'):
"""Calls oauth/token endpoint with password-realm grant type
This is the OAuth 2.0 grant that highly trusted apps utilize in order
... |
java | public ClusterData createClusterData(boolean localOnly) {
if (localOnly) return new VertxClusterData(vertx);
HazelcastInstance hazelcast = ClusterListenerFactory.getHazelcastInstance(vertx);
if (hazelcast != null) {
return new HazelcastClusterData(hazelcast);
} else {
return new VertxCluster... |
java | private void saveFeatureIndexes(FeatureIndex[] index, String outputDir) throws IOException
{
logger.info("save feature index");
// save the indexes
for (int i=0;i<index.length;i++)
{
logger.debug("dic" + i + " size " + index[i].size());
File tmp = new File(outputDir + "dic" + i);
//File tmp = File.c... |
python | def register_on_machine_data_changed(self, callback):
"""Set the callback function to consume on machine data changed events.
Callback receives a IMachineDataChangedEvent object.
Returns the callback_id
"""
event_type = library.VBoxEventType.on_machine_data_changed
retu... |
java | private static boolean collectOverriddenMethods(MethodDeclaration md,
/* Nullable */ List<Method> overriddenMethods) {
final MethodSymbolData sdata = md.getSymbolData();
if (sdata == null || isStatic(sdata.getMethod()) || isPrivate(sdata.getMethod())) {
return false;
} e... |
java | private Set<ClassDescriptor> computeKnownSubtypes(ClassDescriptor classDescriptor) throws ClassNotFoundException {
LinkedList<ClassVertex> workList = new LinkedList<>();
ClassVertex startVertex = resolveClassVertex(classDescriptor);
workList.addLast(startVertex);
Set<ClassDescriptor> r... |
python | def __find_args_separator(self, decl_string, start_pos):
"""implementation details"""
bracket_depth = 0
for index, ch in enumerate(decl_string[start_pos:]):
if ch not in (self.__begin, self.__end, self.__separator):
continue # I am interested only in < and >
... |
python | def run_container():
"""Runs an interactive container"""
os.chdir(my_directory)
cmd = [
'docker', 'run',
'-it', '--rm',
'-v', '{}:/cauldron'.format(my_directory),
'-p', '5010:5010',
'cauldron_app',
'/bin/bash'
]
return os.system(' '.join(cmd)) |
python | def wait(self):
'''
Wait until the ui object gone or exist.
Usage:
d(text="Clock").wait.gone() # wait until it's gone.
d(text="Settings").wait.exists() # wait until it appears.
'''
@param_to_property(action=["exists", "gone"])
def _wait(action, timeout=30... |
java | public void setMap(Map<String, Object> map) {
eventMap.clear();
eventMap.putAll(map);
} |
python | def find_in_history(self, tocursor, start_idx, backward):
"""Find text 'tocursor' in history, from index 'start_idx'"""
if start_idx is None:
start_idx = len(self.history)
# Finding text in history
step = -1 if backward else 1
idx = start_idx
if len(toc... |
python | def reftrack_element_data(rt, role):
"""Return the data for the element (e.g. the Asset or Shot)
:param rt: the :class:`jukeboxcore.reftrack.Reftrack` holds the data
:type rt: :class:`jukeboxcore.reftrack.Reftrack`
:param role: item data role
:type role: QtCore.Qt.ItemDataRole
:returns: data fo... |
java | private <T> T execute(String url, Class<T> returnType, Object requestObject) throws Exception {
URLConnection connection = new URL(url).openConnection();
if (!(connection instanceof HttpURLConnection)) {
throw new IllegalStateException("Not an http connection! " + connection);
}
... |
java | public Observable<CognitiveServicesAccountInner> updateAsync(String resourceGroupName, String accountName, Sku sku, Map<String, String> tags) {
return updateWithServiceResponseAsync(resourceGroupName, accountName, sku, tags).map(new Func1<ServiceResponse<CognitiveServicesAccountInner>, CognitiveServicesAccountI... |
java | public void marshall(CreateGroupRequest createGroupRequest, ProtocolMarshaller protocolMarshaller) {
if (createGroupRequest == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshaller.marshall(createGroupRequest.getGro... |
java | @Override
protected int readBytesWireFormat ( byte[] buffer, int bufferIndex ) throws SMBProtocolDecodingException {
int start = bufferIndex;
for ( int i = 0; i < this.unlocks.length; i++ ) {
this.unlocks[ i ] = createLockRange();
bufferIndex += this.unlocks[ i ].decode(buffe... |
python | def stream(identifier, priority=LOG_DEBUG, level_prefix=False):
r"""Return a file object wrapping a stream to journal.
Log messages written to this file as simple newline sepearted
text strings are written to the journal.
The file will be line buffered, so messages are actually sent
after a newlin... |
python | def build_paragraph(content, hard_breaks=False):
"""
Returns *content* wrapped in `<p>` tags.
If *hard_breaks* is `True`, all line breaks are converted to `<br />` tags.
"""
lines = list(filter(None, [line.strip() for line in content.split('\n')]))
if hard_breaks:
for line_number in range(len(lines) -... |
python | def _set_fcoe(self, v, load=False):
"""
Setter method for fcoe, mapped from YANG variable /hardware/custom_profile/kap_custom_profile/fcoe (container)
If this variable is read-only (config: false) in the
source YANG file, then _set_fcoe is considered as a private
method. Backends looking to populate... |
java | protected String getPropertyName(String methodName, String prefix, String suffix) {
if (methodName.startsWith(prefix) && methodName.endsWith(suffix)) {
return getPropertyName(methodName, prefix.length(), suffix.length());
}
return null;
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.