language stringclasses 2
values | func_code_string stringlengths 63 466k |
|---|---|
java | public static BinaryResponse createGetConfig(BinaryCommand command, MemcachedServer server) {
return create(command, server, ErrorCode.SUCCESS, ErrorCode.NOT_SUPPORTED);
} |
java | private static DSAKeyValidationParameters.Usage getUsage(int usage)
{
if (usage == DSAParameterGenerationParameters.DIGITAL_SIGNATURE_USAGE) {
return DSAKeyValidationParameters.Usage.DIGITAL_SIGNATURE;
} else if (usage == DSAParameterGenerationParameters.KEY_ESTABLISHMENT_USAGE) {
... |
java | public void setUserLedBlinking(final boolean USER_LED_BLINKING) {
this.userLedBlinking = USER_LED_BLINKING;
if (USER_LED_BLINKING) {
USER_LED_BLINKING_TIMER.start();
} else {
setCurrentUserLedImage(getUserLedImageOff());
USER_LED_BLINKING_TIMER.stop();
... |
java | @NotNull
public static String[] toArrayWithEscaped(@Nullable final String stringArray, @NotNull final String delimiter) {
if (StringUtils.isEmpty(stringArray)) {
return new String[0];
}
return StringUtils.splitByWholeSeparatorPreserveAllTokens(stringArray, delimiter);
} |
java | public T withRetryPolicy(RetryPolicy retryPolicy) {
getOptions().setRetryPolicy(Optional.of(retryPolicy));
return getThis();
} |
java | @SuppressWarnings("unchecked")
public T setSheet(String sheetName) {
this.sheet = this.workbook.getSheet(sheetName);
if (null == this.sheet) {
this.sheet = this.workbook.createSheet(sheetName);
}
return (T) this;
} |
java | @Override
protected void doHandle(CommandContext ctx) throws CommandLineException {
final ParsedCommandLine args = ctx.getParsedCommandLine();
final String action = this.action.getValue(args);
if(action == null) {
throw new CommandFormatException("Command is missing.");
... |
python | def get_color_name(value):
"""Return color name depending on value type"""
if not is_known_type(value):
return CUSTOM_TYPE_COLOR
for typ, name in list(COLORS.items()):
if isinstance(value, typ):
return name
else:
np_dtype = get_numpy_dtype(value)
if np_dtype i... |
java | private BaseDescr lhsParen(CEDescrBuilder<?, ?> ce,
boolean allowOr) throws RecognitionException {
match(input,
DRL6Lexer.LEFT_PAREN,
null,
null,
DroolsEditorType.SYMBOL);
if (state.failed)
return null;
if (... |
java | public static void runExample(
AdManagerServices adManagerServices, AdManagerSession session, long lineItemId)
throws RemoteException {
// Get the LineItemCreativeAssociationService.
LineItemCreativeAssociationServiceInterface licaService =
adManagerServices.get(session, LineItemCreativeAsso... |
python | def vcf_to_df(canvasvcfs, exonbed, cpus):
""" Compile a number of vcf files into tsv file for easy manipulation
"""
df = pd.DataFrame()
p = Pool(processes=cpus)
results = []
args = [(x, exonbed, i) for (i, x) in enumerate(canvasvcfs)]
r = p.map_async(vcf_to_df_worker, args,
... |
java | public void visitEnd() {
String classname = workbench.getType().getClassName();
component.addAttribute(new Attribute("classname", classname));
// Generates the provides attribute.
component.addElement(ElementHelper.getProvidesElement(null));
// Detect that Controller is imple... |
java | public void addProperty(String propertyName, Object propertyValue)
throws SFException
{
SFSessionProperty connectionProperty =
SFSessionProperty.lookupByKey(propertyName);
if (connectionProperty != null)
{
// check if the value type is as expected
propertyValue = SFSessionProperty
... |
python | def request(cls, method, url, **kwargs):
"""
:type method: str
"""
methodupper = method.upper()
hasdata = 'data' in kwargs
if methodupper == 'GET':
if hasdata:
print("ERROR: Can't do HTTP GET when the 'data' parameter presents")
assert False
resp = ulr.urlopen(url, **kwargs)
elif methodupper... |
python | def mark_complex(self, name, serializer, deserializer):
"""Mark a property as complex with serializer and deserializer functions.
Args:
name (str): The name of the complex property.
serializer (callable): The function to call to serialize the property's
value to ... |
java | public Team updateTeam(final Team transientTeam) {
final Team team = getObjectByUuid(Team.class, transientTeam.getUuid());
pm.currentTransaction().begin();
team.setName(transientTeam.getName());
//todo assign permissions
pm.currentTransaction().commit();
return pm.getObje... |
java | public CompletableFuture<RuleDescription> updateRuleAsync(String topicName, String subscriptionName, RuleDescription ruleDescription) {
return putRuleAsync(topicName, subscriptionName, ruleDescription, true);
} |
python | def update_user(self):
"""
Save the state of the current user
"""
# First create a copy of the current user
user_dict = self.serialize()
# Then delete the entities in the description field
del user_dict['description']['entities']
# Then upload user_dict
... |
python | def onlylegalchar(name):
"""return only legal chars"""
legalchar = ascii_letters + digits + ' '
return ''.join([s for s in name[:] if s in legalchar]) |
java | @SuppressWarnings("all")
public static boolean register(ClassFileTransformer classFileTransformer, Object classFileFactory) {
try {
TypeDescription typeDescription = TypeDescription.ForLoadedType.of(LambdaFactory.class);
Class<?> lambdaFactory = ClassInjector.UsingReflection.ofSystem... |
python | def generator_name(cls):
""" :meth:`.WHashGeneratorProto.generator_name` implementation
"""
if cls.__generator_name__ is None:
raise ValueError('"__generator_name__" should be override in a derived class')
if isinstance(cls.__generator_name__, str) is False:
raise TypeError('"__generator_name__" should be... |
java | public static float distanceSq( float[] a , float[]b ) {
float ret = 0;
for( int i = 0; i < a.length; i++ ) {
float d = a[i] - b[i];
ret += d*d;
}
return ret;
} |
java | public static <T> Object sum(Iterable<T> self, @ClosureParams(FirstParam.FirstGenericType.class) Closure closure) {
return sum(self.iterator(), null, closure, true);
} |
java | public TableResult listTableDataSchema(
String datasetName, String tableName, Schema schema, String field) {
// [START ]
TableResult tableData = bigquery.listTableData(datasetName, tableName, schema);
for (FieldValueList row : tableData.iterateAll()) {
row.get(field);
}
// [END ]
ret... |
python | def _cli_main(args=None):
""" Pass input arguments to open_tunnel
Mandatory: ssh_address, -R (remote bind address list)
Optional:
-U (username) we may gather it from SSH_CONFIG_FILE or current username
-p (server_port), defaults to 22
-P (password)
-L (local_bind_ad... |
java | public void assignDrivers(XTrace trace, Map<String, String> drivers) {
XCostDriver.instance().assignValues(trace, drivers);
} |
python | def new_program(self, _id, series, title, subtitle, description, mpaaRating,
starRating, runTime, year, showType, colorCode,
originalAirDate, syndicatedEpisodeNumber, advisories):
"""Callback run for each new program entry"""
if self.__v_program:
# [Pro... |
python | def _nodemap_changed(self, data, stat):
"""Called when the nodemap changes."""
if not stat:
raise EnvironmentNotFoundException(self.nodemap_path)
try:
conf_path = self._deserialize_nodemap(data)[self.hostname]
except KeyError:
conf_path = '/services/... |
java | public void setActive(HostPort hp)
throws UnknownHostException,
ClientException,
IOException {
if (logger.isDebugEnabled()) {
logger.debug("hostport: " + hp.getHost() + " " + hp.getPort());
}
session.serverMode = Session.SERVER_ACTIVE;
th... |
java | public String getLogFileName()
{
if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled())
trace.entry(this, cclass
, "getLogFileSize"
);
String logFileName = objectManagerState.logFileName;
if (Tracing.isAnyTracingEnabled(... |
java | protected void createTypeSpecificEditors(Composite parent)
throws CoreException
{
setTitle("Line Breakpoint");
IVdmLineBreakpoint breakpoint = (IVdmLineBreakpoint) getBreakpoint();
// if (breakpoint..supportsCondition()) {
createConditionEditor(parent);
// }
// if (breakpoint instanceof IJavaWatchpoint)... |
java | @Override
public StackableChainingListener createChainingListenerInstance()
{
XWikiSyntaxChainingRenderer renderer = new XWikiSyntaxChainingRenderer(getListenerChain(),
this.linkReferenceSerializer, this.imageReferenceSerializer);
renderer.setPrinter(getPrinter());
return ren... |
python | def vec2pix(nside, x, y, z, nest=False):
"""Drop-in replacement for healpy `~healpy.pixelfunc.vec2pix`."""
theta, phi = vec2ang(np.transpose([x, y, z]))
# hp.vec2ang() returns raveled arrays, which are 1D.
if np.isscalar(x):
theta = theta.item()
phi = phi.item()
else:
shape =... |
python | def SkyCoord(self,*args,**kwargs):
"""
NAME:
SkyCoord
PURPOSE:
return the position as an astropy SkyCoord
INPUT:
t - (optional) time at which to get the position
obs=[X,Y,Z] - (optional) position of observer (in kpc)
(... |
python | def analyze(self, handle, filename):
"""Submit a file for analysis.
:type handle: File handle
:param handle: Handle to file to upload for analysis.
:type filename: str
:param filename: File name.
:rtype: str
:return: File ID as a string
"""
... |
java | @Override
protected void fireStateChanged() {
super.fireStateChanged();
Component comp = getSelectedComponent();
if (comp instanceof AbstractPanel) {
((AbstractPanel) comp).tabSelected();
}
} |
python | def datasets_org_count(self):
"""Return the number of datasets of user's organizations."""
from udata.models import Dataset # Circular imports.
return sum(Dataset.objects(organization=org).visible().count()
for org in self.organizations) |
java | protected Variable getVariableImpl( String name, boolean recurse )
throws UtilEvalError
{
// check the external map for the variable name
Object value = externalMap.get( name );
if ( value == null && externalMap.containsKey( name ) )
value = Primitive.NULL;
Vari... |
python | def pose_msg(self):
""":obj:`geometry_msgs.msg.Pose` The rigid transform as a geometry_msg pose.
"""
pose = msg.Pose()
pose.orientation.w = float(self.quaternion[0])
pose.orientation.x = float(self.quaternion[1])
pose.orientation.y = float(self.quaternion[2])
pose... |
python | def attribute_invoked(self, sender, name, args, kwargs):
"Handles the creation of ExpectationBuilder when an attribute is invoked."
return ExpectationBuilder(self.sender, self.delegate, self.add_invocation, self.add_expectations, '__call__')(*args, **kwargs) |
java | public void createAssignmentFieldMap(Props props)
{
//System.out.println("ASSIGN");
byte[] fieldMapData = null;
for (Integer key : ASSIGNMENT_KEYS)
{
fieldMapData = props.getByteArray(key);
if (fieldMapData != null)
{
break;
}
}
if ... |
python | def _plot(self, xticks=[], yticks=[], minor_xticks=[], minor_yticks=[],
xlabel='Longitude', ylabel='Latitude', ax=None, ax2=None,
colorbar=None, cb_label=None, cb_orientation=None, grid=False,
axes_labelsize=None, tick_labelsize=None, **kwargs):
"""Plot the raw data usi... |
python | def get_public_attributes(cls, as_list=True):
"""
Return class attributes that are neither private nor magic.
:param cls: class
:param as_list: [True] set to False to return generator
:return: only public attributes of class
"""
attrs = (a for a in dir(cls) if not a.startswith('_'))
if ... |
python | def assert_dimensionless(value):
"""
Tests for dimensionlessness of input.
If input is dimensionless but expressed as a Quantity, it returns the
bare value. If it not, it raised an error.
"""
if isinstance(value, Quantity):
value = value.simplified
if value.dimensionality == Di... |
python | def call(name, function, *args, **kwargs):
'''
Executes a Salt function inside a chroot environment.
The chroot does not need to have Salt installed, but Python is
required.
name
Path to the chroot environment
function
Salt execution module function
CLI Example:
.. c... |
python | def draw(self):
"""
Renders the class balance chart on the specified axes from support.
"""
# Number of colors is either number of classes or 2
colors = resolve_colors(len(self.support_))
if self._mode == BALANCE:
self.ax.bar(
np.arange(len(se... |
java | private IntegrationFlowBuilder getIdleImapFlow(URLName urlName) {
return IntegrationFlows.from(Mail.imapIdleAdapter(urlName.toString())
.shouldDeleteMessages(this.properties.isDelete())
.javaMailProperties(getJavaMailProperties(urlName))
.selectorExpression(this.properties.getExpression())
.shouldMark... |
python | async def fetchone(self):
"""Fetch one row, just like DB-API cursor.fetchone().
If a row is present, the cursor remains open after this is called.
Else the cursor is automatically closed and None is returned.
"""
try:
row = await self._cursor.fetchone()
excep... |
python | def format_progress(self, width):
"""Create the formatted string that displays the progress."""
chunk_widths = self._get_chunk_sizes(width)
progress_chunks = [chunk.format_chunk(chunk_width)
for (chunk, chunk_width)
in zip(self._progress_chun... |
python | def oauthgetm(method, param_dict, socket_timeout=None):
try:
import oauth2 # lazy import this so oauth2 is not a hard dep
except ImportError:
raise Exception("You must install the python-oauth2 library to use this method.")
"""
Call the api! With Oauth!
Param_dict is a *regular* *p... |
python | def p_class_name(p):
'''class_name : namespace_name
| NS_SEPARATOR namespace_name
| NAMESPACE NS_SEPARATOR namespace_name'''
if len(p) == 2:
p[0] = p[1]
elif len(p) == 3:
p[0] = p[1] + p[2]
else:
p[0] = p[1] + p[2] + p[3] |
python | def ReadApprovalRequests(self,
requestor_username,
approval_type,
subject_id=None,
include_expired=False):
"""Reads approval requests of a given type for a given user."""
now = rdfvalue.RDFDatetime.Now()
... |
java | @Override
protected int deleteReference(String propertyCid) throws SQLException
{
if (deleteReference == null)
{
deleteReference = dbConnection.prepareStatement(DELETE_REF);
}
else
{
deleteReference.clearParameters();
}
deleteReference.setString(1, prop... |
python | def from_bin(cls, value):
"""Initialize a new network from binary notation."""
value = value.lstrip('b')
if len(value) == 32:
return cls(int(value, 2))
elif len(value) == 128:
return cls(int(value, 2))
else:
return ValueError('%r: invalid binar... |
python | def _setup_cgroups(self, my_cpus, memlimit, memory_nodes, cgroup_values):
"""
This method creates the CGroups for the following execution.
@param my_cpus: None or a list of the CPU cores to use
@param memlimit: None or memory limit in bytes
@param memory_nodes: None or a list of ... |
java | private static AlgorithmException wrapException(Throwable throwable) {
if(throwable == null) {
return null;
} else if(throwable instanceof AlgorithmException) {
return (AlgorithmException) throwable;
} else {
return new AlgorithmException(throwable.getMessage(... |
python | def _container_blacklist(self):
"""Container blacklist."""
if self.__container_blacklist is None:
self.__container_blacklist = \
set(self.CLOUD_BROWSER_CONTAINER_BLACKLIST or [])
return self.__container_blacklist |
python | def get_recipe_instances_for_badges(self, badges):
"""
Takes a list of badge slugs and returns a tuple: ``(valid, invalid)``.
"""
from .exceptions import BadgeNotFound
valid, invalid = [], []
if not isinstance(badges, (list, tuple)):
badges = [badges]
... |
java | public java.util.List<DeliveryChannelStatus> getDeliveryChannelsStatus() {
if (deliveryChannelsStatus == null) {
deliveryChannelsStatus = new com.amazonaws.internal.SdkInternalList<DeliveryChannelStatus>();
}
return deliveryChannelsStatus;
} |
java | public JSONStringer toJSONStringerV2(JSONStringer js) throws JSONException{
// array of row data
VoltTableRow row = cloneRow();
row.resetRowPosition();
js.array();
while (row.advanceRow()) {
js.object();
for (int i = 0; i < getColum... |
java | @Override
public int compareTo(Calendar that) {
long v = getTimeInMillis() - that.getTimeInMillis();
return v < 0 ? -1 : (v > 0 ? 1 : 0);
} |
python | def generateComponent(m):
"""Creates oscillating components to be mixed"""
freq = 25*np.random.random()
phase = 2*np.pi*np.random.random()
x = np.arange(m)
return np.cos(x/freq-phase)**2 |
python | def nth(self, index):
"""
Return a query that selects the element at `index` (starts from 0).
If no elements are available, returns a query with no results.
Example usage:
.. code:: python
>> q = Query(lambda: list(range(5)))
>> q.nth(2).results
... |
java | public boolean isSet(_Fields field) {
if (field == null) {
throw new IllegalArgumentException();
}
switch (field) {
case STATUS:
return isSetStatus();
case TIME_ZONE:
return isSetTimeZone();
}
throw new IllegalStateException();
} |
python | def convert_id_to_model(value, parameter):
'''
Converts to a Model object.
'', '-', '0', None convert to parameter default
Anything else is assumed an object id and sent to `.get(id=value)`.
'''
value = _check_default(value, parameter, ( '', '-', '0', None ))
if isinstance(value, (in... |
python | def add_edge(self, isDirected=None,name=None,network=None,sourceName=None,targetName=None, verbose=False):
"""
Add a new edge between two existing nodes in a network. The names of the
nodes must be specified and much match the value in the 'name' column for
each node.
:param isD... |
python | def _write_config_file(self, config_data, indent=2):
"""write config data to file.
Parameters
==========
config_data: the Configuration object to save a username and
password, if defined
indent: number of tab indentations to use when writing j... |
python | def get_or_create_direct_channel(cls, initiator_key, receiver_key):
"""
Creates a direct messaging channel between two user
Args:
initiator: User, who want's to make first contact
receiver: User, other party
Returns:
(Channel, receiver_name)
... |
java | public Object getByIdOrFail(final UUID id) throws ObjectToIdMappingException {
Optional<Object> object = getById(id);
if (!object.isPresent()) {
throw new ObjectToIdMappingException(format(
"An object with the id [%s] was expected to be known but it was not. %s", id.toSt... |
java | private void getImportResource() throws CmsVfsException {
// get the import resource
m_importResource = new File(m_importFolderName);
// check if this is a folder or a ZIP file
if (m_importResource.isFile()) {
try {
m_zipStreamIn = new ZipInputStream(new File... |
java | public static CertificateFactory getCertificateFactory(String type) {
final Provider provider = GlobalBouncyCastleProvider.INSTANCE.getProvider();
CertificateFactory factory;
try {
factory = (null == provider) ? CertificateFactory.getInstance(type) : CertificateFactory.getInstance(type, provider);
} c... |
python | async def explain(self, *args, analyze=False):
"""Return the execution plan of the statement.
:param args: Query arguments.
:param analyze: If ``True``, the statement will be executed and
the run time statitics added to the return value.
:return: An object repre... |
python | def map_gate(gate: Gate, args: Sequence[Qubits]) -> Circuit:
"""Applies the same gate all input qubits in the argument list.
>>> circ = qf.map_gate(qf.H(), [[0], [1], [2]])
>>> print(circ)
H(0)
H(1)
H(2)
"""
circ = Circuit()
for qubits in args:
circ += gate.relabel(qubits)... |
java | public static int indexOfIgnoreCaseAscii(final CharSequence str, final CharSequence searchStr, int startPos) {
if (str == null || searchStr == null) {
return INDEX_NOT_FOUND;
}
if (startPos < 0) {
startPos = 0;
}
int searchStrLen = searchStr.length();
... |
java | public ContainerDefinition withDockerLabels(java.util.Map<String, String> dockerLabels) {
setDockerLabels(dockerLabels);
return this;
} |
java | public Class getType(FacesContext context) throws EvaluationException,
PropertyNotFoundException {
if (context == null) {
throw new NullPointerException("FacesContext -> null");
}
Class result = null;
try {
result = valueExpression.getType(co... |
python | def get_mappings_in_network(network_id, network_2_id=None, **kwargs):
"""
Get all the resource attribute mappings in a network. If another network
is specified, only return the mappings between the two networks.
"""
qry = db.DBSession.query(ResourceAttrMap).filter(or_(ResourceAttrMap.network... |
python | def quantile_curve(quantile, curves, weights=None):
"""
Compute the weighted quantile aggregate of a set of curves.
:param quantile:
Quantile value to calculate. Should be in the range [0.0, 1.0].
:param curves:
Array of R PoEs (possibly arrays)
:param weights:
Array-like of... |
python | def primary_from_name(self, tax_name):
"""
Return tax_id and primary tax_name corresponding to tax_name.
"""
names = self.names
s1 = select([names.c.tax_id, names.c.is_primary],
names.c.tax_name == tax_name)
log.debug(str(s1))
res = s1.execu... |
python | def get_object_detail(self, request, obj):
"""
Handles get requests for the details of the given object.
"""
if self.display_detail_fields:
display_fields = self.display_detail_fields
else:
display_fields = self.display_fields
data = self.serializ... |
python | def _convert_timedelta_to_seconds(timedelta):
"""Returns the total seconds calculated from the supplied timedelta.
(Function provided to enable running on Python 2.6 which lacks timedelta.total_seconds()).
"""
days_in_seconds = timedelta.days * 24 * 3600
return int((timedelta.microseconds + (ti... |
python | def transform(self, X, y=None, sample_weight=None):
'''
Transforms the time series data into segments (temporal tensor)
Note this transformation changes the number of samples in the data
If y and sample_weight are provided, they are transformed to align to the new samples
Param... |
java | protected void setDigitsAndSign(final String picture,
final char currencySymbol, final boolean decimalPointIsComma) {
char decimalPoint = (decimalPointIsComma) ? ',' : '.';
/*
* Look for the integer part (digits before the decimal point) Decimal
* point is virtual or not.... |
python | def on_before_transform_template(self, template_dict):
"""
Hook method that gets called before the SAM template is processed.
The template has pass the validation and is guaranteed to contain a non-empty "Resources" section.
:param dict template_dict: Dictionary of the SAM template
... |
java | public static <T, U extends Comparable<? super U>> Collector<T, ?, Seq<U>> maxAll(Function<? super T, ? extends U> function) {
return maxAll(function, naturalOrder());
} |
java | public Observable<VpnClientIPsecParametersInner> beginGetVpnclientIpsecParametersAsync(String resourceGroupName, String virtualNetworkGatewayName) {
return beginGetVpnclientIpsecParametersWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName).map(new Func1<ServiceResponse<VpnClientIPsecParameter... |
java | public static TimeZone getUserTimeZone()
{
TimeZone ret = null;
// First try the configured timezone
String tz = DEFAULT_TIMEZONE;
ret = AppTimeZone.getTimeZoneById(tz);
if(ret == null)
{
// Next try the locale timezone
tz = System.getProperty... |
java | public ServiceFuture<CallbackUrlInner> getCallbackUrlAsync(String resourceGroupName, String integrationAccountName, GetCallbackUrlParameters parameters, final ServiceCallback<CallbackUrlInner> serviceCallback) {
return ServiceFuture.fromResponse(getCallbackUrlWithServiceResponseAsync(resourceGroupName, integrat... |
python | def _load_json_result(self, conf, compile_classpath, coursier_cache_path, invalidation_check,
pants_jar_path_base, result, override_classifiers=None):
"""
Given a coursier run result, load it into compile_classpath by target.
:param compile_classpath: `ClasspathProducts` that will b... |
python | def to_shape_list(region_list, coordinate_system='fk5'):
"""
Converts a list of regions into a `regions.ShapeList` object.
Parameters
----------
region_list: python list
Lists of `regions.Region` objects
format_type: str ('DS9' or 'CRTF')
The format type of the Shape object. Def... |
java | public void handleEventsCollection(final S symbol, final Collection<T> elements) {
final List<BiConsumer<S, T>> callbackList = callbacks.get(symbol);
if(callbackList == null) {
return;
}
if(callbackList.isEmpty()) {
return;
}
// Notify callbacks synchronously, to preserve the order of ev... |
python | def nonNegativeDerivative(requestContext, seriesList, maxValue=None):
"""
Same as the derivative function above, but ignores datapoints that trend
down. Useful for counters that increase for a long time, then wrap or
reset. (Such as if a network interface is destroyed and recreated by
unloading and ... |
python | def missing_db_response(func):
"""Decorator to check connection exceptions"""
@wraps(func)
def with_exception_handling(*args, **kwargs):
"""Wrapper to check for connection failures"""
try:
return func(*args, **kwargs)
except ConnectionError as error:
return (d... |
python | def custom(self, method, path_append=None, headers=None, **kwargs):
"""Creates a custom request
:param method: HTTP method
:param path_append: (optional) append path to resource.api_path
:param headers: (optional) Dictionary of headers to add or override
:param kwargs: kwargs to... |
python | def get_generation_code(self, **gencode):
"""
Generates python code that can create the gate.
"""
channels, verts = self.coordinates
channels = ', '.join(["'{}'".format(ch) for ch in channels])
verts = list(verts)
## Formatting the vertexes
# List level ... |
java | @Process(actionType = CreateHandler.class)
public void createHandler(final CreateHandler action, final Dispatcher.Channel channel) {
operationDelegate.onCreateResource(action.getAddressTemplate(), action.getInstanceName(), action.getNewModel(),
new CrudOperationDelegate.Callback() {
... |
java | public void click(String locator) {
getDispatcher().beforeClick(this, locator);
click();
validatePresenceOfAlert();
WebDriverWaitUtils.waitUntilElementIsPresent(locator);
getDispatcher().afterClick(this, locator);
} |
java | public static boolean isJSInlineNode (@Nullable final IHCNode aNode)
{
final IHCNode aUnwrappedNode = HCHelper.getUnwrappedNode (aNode);
return isDirectJSInlineNode (aUnwrappedNode);
} |
python | def _proxy(self):
"""
Generate an instance context for the instance, the context is capable of
performing various actions. All instance actions are proxied to the context
:returns: DialogueContext for this DialogueInstance
:rtype: twilio.rest.autopilot.v1.assistant.dialogue.Dia... |
python | def is_merged(self):
"""
:calls: `GET /repos/:owner/:repo/pulls/:number/merge <http://developer.github.com/v3/pulls>`_
:rtype: bool
"""
status, headers, data = self._requester.requestJson(
"GET",
self.url + "/merge"
)
return status == 204 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.