code
stringlengths
0
30.8k
source
stringclasses
6 values
language
stringclasses
9 values
__index_level_0__
int64
0
100k
void Hacl_GenericField64_to_field( Hacl_Bignum_MontArithmetic_bn_mont_ctx_u64 *k, uint64_t *a, uint64_t *aM ) { uint32_t len1 = Hacl_GenericField64_field_get_len(k); Hacl_Bignum_MontArithmetic_bn_mont_ctx_u64 k1 = *k; Hacl_Bignum_Montgomery_bn_to_mont_u64(len1, k1.n, k1.mu, k1.r2, a, aM); }
function
c
99,700
private void printNewAndOldName(List<FilterResult> files, Environment env, NameBuilder builder) { for(FilterResult file : files) { StringBuilder sb = new StringBuilder(); builder.execute(file, sb); env.write(file.toString() + " => " + sb.toString()); env.writeln(""); } }
function
java
99,701
int AsyncSocket_SetWebSocketCookie(AsyncSocket *asock, void *clientData, const char *path, const char *sessionId) { int ret = ASOCKERR_INVAL; if (VALID(asock, setWebSocketCookie)) { AsyncSoc...
function
c
99,702
func GetFederationHostsFromConfig(path string) ([]string, error) { federations := []string{} conf, err := config.LoadFile(path) if err != nil { return federations, err } for _, sc := range conf.ScrapeConfigs { if sc.MetricsPath == "/federate" { for _, tg := range sc.ServiceDiscoveryConfig.StaticConfigs { ...
function
go
99,703
def send_and_get_reply(self, message, *, timeout=None, unwrap=None): check_replyable(message) deadline = timeout_to_deadline(timeout) if unwrap is None: unwrap = self._unwrap_reply serial = next(self.outgoing_serial) self.send_message(message, serial=serial) w...
function
python
99,704
def runTest(self, save=False, indices=(2, 3)): self.load_rundata() self.write_rundata_objects() self.run_code() import clawpack.pyclaw.gauges as gauges gauge = gauges.GaugeSolution(1, path=self.temp_path) print('+++ Gauge 1:\n', gauge.q) gauge = gauges.GaugeSoluti...
function
python
99,705
class ShiftControl { public: ShiftControl(const Descriptor &s, Terminator &t, int dim) : shift_{s}, terminator_{t}, shiftRank_{s.rank()}, dim_{dim} {} void Init(const Descriptor &source) { int rank{source.rank()}; RUNTIME_CHECK(terminator_, shiftRank_ == 0 || shiftRank_ == rank - 1); auto catAndKi...
class
c++
99,706
public void SetAlgorithm(IAlgorithm algorithm) { _algorithm = algorithm; var types = new List<SecurityType>(); foreach (var security in _algorithm.Securities.Values) { if (!types.Contains(security.Type)) types.Add(security.Type); } ...
function
c#
99,707
public Result lookupByTypes ( final LookupTree<Element, Result, Memento> root, final List<? extends A_Type> argumentTypesList, final Memento memento) { LookupTree<Element, Result, Memento> tree = root; Result solution = tree.solutionOrNull(); while (solution == null) { tree = tree.lookupStepByTypes(ar...
function
java
99,708
func (r *ReconcileDataset) Reconcile(request reconcile.Request) (reconcile.Result, error) { reqLogger := log.WithValues("Request.Namespace", request.Namespace, "Request.Name", request.Name) reqLogger.Info("Reconciling Dataset") datasetInstance := &comv1alpha1.Dataset{} err := r.client.Get(context.TODO(), request.Na...
function
go
99,709
public final class BranchHandle extends InstructionHandle { /** * */ private static final long serialVersionUID = -2520878285698255956L; private BranchInstruction bi; // An alias in fact, but saves lots of casts private BranchHandle(BranchInstruction i) { super(i); bi = i; } /** Fact...
class
java
99,710
function stringExcludes(...excludeVals) { return ({value, displayName}) => { if (isNil(value)) return null; const fail = excludeVals.find(s => value.includes(s)); if (fail) return `${displayName} must not include "${fail}"`; }; }
function
javascript
99,711
public void purge(long timestamp) { oldestTimestamp = timestamp; for (int clusterId : map.keySet()) { while (true) { List<RevisionRange> list = map.get(clusterId); List<RevisionRange> newList = purge(list); if (newList =...
function
java
99,712
void ConfigDemosaic(u32 width , u32 height) { Xil_Out32((DEMOSAIC_BASE + 0x10), width ); Xil_Out32((DEMOSAIC_BASE + 0x18), height ); Xil_Out32((DEMOSAIC_BASE + 0x20), 0x0 ); Xil_Out32((DEMOSAIC_BASE + 0x28), 0x0 ); Xil_Out32((DEMOSAIC_BASE + 0x00), 0x81 ); }
function
c
99,713
func New(laddr string) *Worker { return &Worker{registeredWorkerFunctions: make(map[string]gototo.WorkerFunction), net: "tcp", laddr: laddr, marshal: json.Marshal, unmarshal: gototo.UnmarshalJSON, marshalMap: map[string]gototo.MarshalFunction{}, unmar...
function
go
99,714
def process_vmr(in_vmr): evaluation_list = [] recommendation_list = [] vmr_dict = xmltodict.parse(in_vmr, process_namespaces=True, force_list=('substanceAdministrationEvent', 'relatedClinicalStatement', 'substanceAdministrationProposal', 'interpretation')) if 'substanceAdministrationEvents' in vmr_dict[...
function
python
99,715
public InteractionResultHolder<ItemStack> use(Level pLevel, Player pPlayer, InteractionHand pHand) { ItemStack itemstack = pPlayer.getItemInHand(pHand); if (pLevel.isClientSide) { return InteractionResultHolder.success(itemstack); } else { if (!pPlayer.getAbilities().instabuild) { ...
function
java
99,716
void ClSimplexSolver::Reset() { #ifdef CL_TRACE Tracer TRACER(__FUNCTION__); cerr << "()" << endl; #endif assert(false); }
function
c++
99,717
def importance_gpomdp(states, rewards, gradients, p_tar, p_gen, use_baseline=True, use_natural_grad=True, fisher_diag=False, ret_diagnostics=False, sum_args=None, sampling_args=None): res = _create_episode_info() for rs, gs, ps, qs in izip(reward...
function
python
99,718
void clif_party_show_picker( struct map_session_data* sd, struct item* item_data ){ #if PACKETVER >= 20071002 nullpo_retv( sd ); nullpo_retv( item_data ); struct item_data* id = itemdb_search( item_data->nameid ); struct PACKET_ZC_ITEM_PICKUP_PARTY p; p.packetType = HEADER_ZC_ITEM_PICKUP_PARTY; p.AID = sd->status...
function
c++
99,719
def build_solution(best_path, current_node): action_list = [] while current_node.get_parent() is not None: current_state = current_node.get_state() action_list.append(current_node.get_action()) current_node = best_path[current_state] Python's list.reverse() reverses in-place. ac...
function
python
99,720
public void resetPopulation() { int i, j; _is_inactive = true; for(i=0; i<_population.length; i++) { for(j=0; j<_len_individual; j++) { _population [i][j] = 0; _end_individual[i][j] = 0; } for(j=0; j<_num_out; j++) { _sub_output[i][j] = 0; } _sub_output_history[i].resetHisto...
function
java
99,721
public class AgedFileInfo : IComparable<AgedFileInfo> { #region Public Members public AgedFileInfo ( ) { } public AgedFileInfo ( FileInfo pfileInfo ) { _fileInfo = pfileInfo; } public FileInfo Details { get { return _fileInfo; } } #endregion #region Private Members FileInf...
class
c#
99,722
public Map<String, Double> copyObservables(boolean assignedOnly) { Map<String, Double> copy = new HashMap<String, Double>(); synchronized (parameterValues) { for (IObservable observable : parameterValues.keySet()) { if (!observable.isInternal()) { if (!ass...
function
java
99,723
private void colourClient(final String network, final GroupChatUser client) { final StringConverter sc = client.getUser().getConnection().getParser().get() .getStringConverter(); final User myself = client.getUser().getConnection().getLocalUser().orElse(null); final String nickOp...
function
java
99,724
public class Provider : IHttpHandler, IRequiresSessionState { public bool IsReusable { get { return true; } } public void ProcessRequest(HttpContext context) { IRequest request = ProviderEndpoint.Provider.GetRequest(); if (request != null) { if (!request.IsResponseReady) { ProviderEndpoint.Pendi...
class
c#
99,725
def _train_step(self, obs, actions, rewards, dones, mus, states, masks, steps, writer=None): cur_lr = self.learning_rate_schedule.value_steps(steps) td_map = {self.train_model.obs_ph: obs, self.polyak_model.obs_ph: obs, self.action_ph: actions, self.reward_ph: rewards, self.done_ph: do...
function
python
99,726
def drifter_loop(p): if p < 13: return None from pulp import LpProblem, LpVariable, PULP_CBC_CMD q = p if p%2 else p//2 if p%4 else p//4 lp = LpProblem() a = LpVariable("a", cat="Integer") b = LpVariable("b", cat="Integer") lp += (6*q*b - 23*a >= 1, "x") lp += (50*a - 13*q*b >= 1...
function
python
99,727
public static ContentEncoding resolveEncoding(final HttpServletRequest request) { String acceptEncodingHeader = request.getHeader("Accept-Encoding"); if (acceptEncodingHeader == null) { return RAW; } String[] encodings = acceptEncodingHeader.split(","); List<String> encodingList = Arrays.asLis...
function
java
99,728
def convert_imperial_str(value, to_unit): if "''" in value: split_on_inches = value.strip().split("''") split_on_inches = list(filter(lambda x: x != '', split_on_inches)) if len(split_on_inches[0].split("'")) == 2: feet = float(split_on_inches[0].split("'")[0]) elif len(s...
function
python
99,729
@NonNull public static File workspacePathToFile(@NonNull IPath path) { IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot(); IResource res = root.findMember(path); if (res != null) { IPath location = res.getLocation(); if (location != null) { ...
function
java
99,730
static FIBITMAP* LogLuminance(FreeImageMem* mem, FIBITMAP *Y) { FIBITMAP *H = NULL; try { FIBITMAP *H = FreeImage_Clone(mem, Y); if(!H) throw(1); const unsigned width = FreeImage_GetWidth(H); const unsigned height = FreeImage_GetHeight(H); const unsigned pitch = FreeImage_GetPitch(H); float maxLum = -1e...
function
c++
99,731
public class UdpServer implements Runnable { public static final int DEFAULT_PORT = 9876; private DatagramSocket serverSocket; private boolean runServer = true; // TODO configuration private ExecutorService executorService = Executors.newFixedThreadPool(10); private MessageProcessor processor; private final ...
class
java
99,732
tree maybe_push_decl (tree decl) { tree type = TREE_TYPE (decl); if (decl == error_mark_node || (TREE_CODE (decl) != PARM_DECL && DECL_CONTEXT (decl) != NULL_TREE && TREE_CODE (DECL_CONTEXT (decl)) != NAMESPACE_DECL) || (TREE_CODE (decl) == TEMPLATE_DECL && !namespace_bindings_p ()) || TREE_...
function
c
99,733
def read_met_data(hdf5_file, met_data_node, indices_dict, year, month, day, days_in_month): import numpy.ma as ma, h5py h5file = h5py.File(hdf5_file, mode = "r") xmin, xmax = indices_dict['xstart_5km'], indices_dict['xend_5km'] ymin, ymax = indices_dict['ystart_5km'], indices_dict['yen...
function
python
99,734
public static IList<TOut> MapObjectsList<TIn, TOut>(IEnumerable<TIn> source) where TIn : class where TOut : class { if (source == null) return null; var destination = new List<TOut>(); var sourcetype = typeof(TIn); var destinationtype = typeof(TOut...
function
c#
99,735
public static Money GetPresentValue(Swap swap, string baseParty) { var list = new List<Money>(); foreach (InterestRateStream stream in swap.swapStream) { Money presentValueOfStream = CashflowsHelper.GetPresentValue(stream.cashflows); list.AddRa...
function
c#
99,736
func Anagrams(word string) []string { if len(word) <= 1 { return []string{word} } output := []string{} var letter byte var pre []byte var post []byte var joined []byte for x := 0; x < len(word); x++ { workingWord := make([]byte, len(word)) copy(workingWord, []byte(word)) letter = workingWord[x] pre = ...
function
go
99,737
void * find_saved_temp_mem(void *hob_list_ptr) { EFI_GUID temp_hob_guid = FSP_BOOTLOADER_TEMPORARY_MEMORY_HOB_GUID; EFI_HOB_GUID_TYPE *saved_mem_hob = (EFI_HOB_GUID_TYPE *) find_hob_by_guid( hob_list_ptr, &temp_hob_guid); if (saved_mem_hob == NULL) return NULL; return (void *) ((char *) saved_mem_hob + size...
function
c
99,738
class SimpleLoginAlgorithm: """Class holding the algorithm to carry out a simple login. Attributes: base_url (str): API base URL, normally ending '/OrbitAPI' data_view (str): DataView being logged into api_client (aa.ApiClient): API client used to log in session_id (str): Apteco...
class
python
99,739
def custom_evaluation( self, teacher_action: Message, labels: Optional[Tuple[str]], model_response: Message, ) -> None: pass
function
python
99,740
def _tag_psflets(shape, x, y, good, dx=10, dy=10): psflet_indx = np.zeros(shape, np.int) oldshape = x.shape x_int = (np.reshape(x + 0.5, -1)).astype(int) y_int = (np.reshape(y + 0.5, -1)).astype(int) good = np.reshape(good, -1) x = np.reshape(x, -1) y = np.reshape(y, -1) x_i = np.arange(...
function
python
99,741
public abstract class Problem { public abstract string getLabel(); public virtual string getFixDescription() { return "No fix or suggestion description available."; } public virtual bool canAutoFix() { return GetType().GetMethod("autoFix").DeclaringType != typeof(Problem); } ...
class
c#
99,742
def change_dtype(input_filename,output_filename,input_fieldname, output_fieldname,new_dtype,grid_type,**grid_kwargs): field = iodriver.load_field(input_filename, file_type=\ iodriver.get_file_extension(input_filename), ...
function
python
99,743
@Test public void listLicensesCheckIndividualLicense() throws IOException { PagedIterable<GHLicense> licenses = gitHub.listLicenses(); for (GHLicense lic : licenses) { if (lic.getKey().equals("mit")) { assertThat(lic.getUrl(), equalTo(new URL(mockGitHub.apiServer().baseUr...
function
java
99,744
@XmlRootElement @Entity public class OAuthPermission extends Permission { private static final long serialVersionUID = -6486616235830491290L; private List<String> httpVerbs = new LinkedList<>(); private List<String> uris = new LinkedList<>(); public OAuthPermission() { } public OAuthPermis...
class
java
99,745
private void OnCastleDestroyed(Unit destroyedCastle) { if (destroyedCastle == _allyCastle) { Debug.Log("Enemy win"); string winner = MatchCommunicationManager.Instance.OpponentId; string loser = NakamaSessionManager.Instance.Session.UserId;...
function
c#
99,746
function Level(levelNumber, tileDelta, parent) { this.levelNumber = levelNumber; this.tileDelta = tileDelta; this.parent = parent; this.texelSize = tileDelta.latitude * Angle.DEGREES_TO_RADIANS / parent.tileHeight; this.tileWidth = parent.tileWidth; this.tileHeight = parent.tileHeight; this....
function
javascript
99,747
class Solution { public: vector<int> arrayRankTransform(vector<int>& arr) { vector<int> rank(arr.size()); vector<pair<int, int>> arr_idx; for(int i = 0; i < arr.size(); i++) arr_idx.emplace_back(make_pair(arr[i], i)); sort(arr_idx.begin(), arr_idx.end(), [](...
class
c++
99,748
public static void exclusive(final JCheckBox first, final boolean firstState, final JCheckBox second, final boolean secondState) { ActionListener l = new ActionListener() { /** * One way check for the condition * @param checked the first to check * @param checkedState the state to match ...
function
java
99,749
@MustBeInvokedByOverriders protected void initAdapter() { if (initializedAdapter) { throw new IllegalStateException("adapter already initialized"); } adapter.initAdapter(); this.initializedAdapter = true; this.adapterInitialized(); observer.onNext(new Adap...
function
java
99,750
def xml2dict(domnode, go_deep=False, drop=tuple()): if not go_deep and hasattr(domnode,'getAttribute') \ and domnode.getAttribute('id'): return [ domnode.getAttribute('id') ] elif domnode.childNodes.length == 1 and domnode.firstChild.nodeType==3: return domnode.firstChild.data e...
function
python
99,751
func TestUndeployRouter(t *testing.T) { routerName := "e2e-experiment-" + globalTestContext.TestID t.Log(fmt.Sprintf("Retrieving router with name '%s' created from previous test step", routerName)) existingRouter, err := getRouterByName( globalTestContext.httpClient, globalTestContext.APIBasePath, globalTestContex...
function
go
99,752
private void forwardMsg(String msg, User excludedUser) throws IOException { Set<User> keySet = connectedUsers.keySet(); int count = 0; for (User user : keySet) { if (user.equals(excludedUser)) { continue; } SocketChannel socketChannel = connect...
function
java
99,753
QString GenericChatForm::resolveToxPk(const ToxPk& pk) { Friend* f = FriendList::findFriend(pk); if (f) { return f->getDisplayedName(); } for (Group* it : GroupList::getAllGroups()) { QString res = it->resolveToxId(pk); if (!res.isEmpty()) { return res; } ...
function
c++
99,754
def duplicate_nodes(self, nodes): if not nodes: return self._undo_stack.beginMacro('duplicate nodes') self.clear_selection() serial = self._serialize(nodes) new_nodes = self._deserialize(serial) offset = 50 for n in new_nodes: x, y = n.pos(...
function
python
99,755
def _create_dependency_rule(self, package, dependencies, reason, reason_details=""): literals = [-package.id] for dependency in dependencies: if dependency == package: return else: literals.append(dependency.id) return PackageRule(self.pool...
function
python
99,756
static int exprMightBeIndexed( SrcList *pFrom, Bitmask mPrereq, Expr *pExpr, int *piCur, int *piColumn ){ Index *pIdx; int i; int iCur; if( pExpr->op==TK_COLUMN ){ *piCur = pExpr->iTable; *piColumn = pExpr->iColumn; return 1; } if( mPrere...
function
c
99,757
func (ys *YamlSection) Yaml() (string, error) { s, err := yaml.Marshal(ys.Viper.Sub("data").AllSettings()) if err != nil { return "", fmt.Errorf("Failed to export yaml: %v", err) } return string(s), nil }
function
go
99,758
def build_loss(config: DictConfig): assert "name" in config, f"name not provided for loss: {config}" config = OmegaConf.to_container(config, resolve=True) name = config["name"] args = config["init_args"] if args is not None: if "weight" in args and args["weight"] is not None: arg...
function
python
99,759
public static List<LdapEntry> GetUsers(string domainName, string adminName, string adminPassword) { int ldapPort = 389; string domainNetbios = domainName.Split('.')[0]; string admin = string.Format("{0}\\{1}", domainNetbios.ToUpper(), adminName); string domainFqn ...
function
c#
99,760
applyClip_(height, width) { if (this.root_.classList.contains(MaterialMenu.cssClasses_.UNALIGNED)) { this.list_.style.removeProperty('clip'); } else if ( this.root_.classList.contains(MaterialMenu.cssClasses_.BOTTOM_RIGHT)) { this.list_.style.setProperty('clip', `rect(0 ${width}px 0 ${width}...
function
javascript
99,761
void Statement::Bind(int64_t inputPosition, const std::string& inputValue) { if(sqlite3_bind_text64(compiledStatement,inputPosition, inputValue.c_str(), inputValue.size(), SQLITE_TRANSIENT, SQLITE_UTF8) != SQLITE_OK) { throw SOMException("Error binding string to statement at position " + std::to_string(inputPosition) +...
function
c++
99,762
func (batchResponse *BatchResponse) GetResponseOf(request *RPCRequest) (*RPCResponse, error) { if request == nil { return nil, errors.New("parameter cannot be nil") } for _, elem := range batchResponse.rpcResponses { if elem.ID == request.ID { return &elem, nil } } return nil, fmt.Errorf("element with id ...
function
go
99,763
private static String formatBase(TerritoryLog log, @Nullable String serverName) { String heldForFormatted = FormatUtils.formatReadableTime(log.getTimeDiff() / 1000, false, "s"); return String.format( "%s: *%s* (%s) → **%s** (%s) [%s]\n" + " Territory held for %...
function
java
99,764
@Override public Set<Map.Entry<K, V>> entrySet() { if (entrySet == null) { entrySet = new AbstractSet<Map.Entry<K, V>>() { @Override public int size() { return size; } @Override public void clear() { TreeMap.this.clear(); } @SuppressWarnings("unchecked") @Override pub...
function
java
99,765
pub fn from_posix_tz(tz_string: &str) -> Result<Self> { if tz_string.is_empty() { return Err(TzError::TzStringError(TzStringError::InvalidTzString("empty TZ string"))); } if tz_string == "localtime" { return parse_tz_file(&fs::read("/etc/localtime")?); } l...
function
rust
99,766
public static string EnsureEndsWith(this string input, string append) { if (!input.EndsWith(append)) { return input + append; } return input; }
function
c#
99,767
def openapi_types(): lazy_import() return { 'count': (int,), 'next': (str, none_type,), 'previous': (str, none_type,), 'results': ([Fetch],), }
function
python
99,768
@Category({MiscTests.class, SmallTests.class}) public class TestIPv6NIOServerSocketChannel { private static final Log LOG = LogFactory.getLog(TestIPv6NIOServerSocketChannel.class); /** * Creates and binds a regular ServerSocket. */ private void bindServerSocket(InetAddress inetAddr) throws IOException { ...
class
java
99,769
def _bundle_scans(self): bases = [] bundles = [] for i in range(len(self.subdirs)): bs = self.subdirs[i] flag = True while flag: bs1 = os.path.split(bs)[0] if bs1 == self.base_path.rstrip('/').rstrip('\\'): f...
function
python
99,770
@Test public void testInstantiateWithArray() { assertEquals(this.child, PA.instantiate(Child.class, new String[]{"Charlie", "Browne"})); assertEquals(this.child, PA.instantiate(Child.class, new Class[]{String[].class}, new String[]{"Charlie", "Browne"})); int[] ints = new int[]{1, 2}; ...
function
java
99,771
class BeanXmlLoaderTest { private LoadFromResources loader = new LoadFromResources(); @Test void testLoadBean() throws BeanXMLException { testSimpleAndBean("nestedBean"); } @Test void testLoadBeanInclude() throws BeanXMLException { testSimpleAndBean("nestedBeanInclude"); }...
class
java
99,772
@Headers({ "Content-Type:application/json" }) @POST(API_SUFFIX + "profiles/{profileid}/session/recording") Call<Void> postRecording( @Path("profileid") String profileid, @Body SessionRecordingOptions body );
function
java
99,773
protected void lbDeleteFolder_Click( object sender, EventArgs e ) { try { string selectedPhysicalFolder = GetSelectedPhysicalFolder(); Directory.Delete( selectedPhysicalFolder, true ); string rootFolder = GetRootFolderPath(); ...
function
c#
99,774
float FinderPatternFinder::crossCheckVertical(size_t startI, size_t centerJ, int maxCount, int originalStateCountTotal, float& estimatedVerticalModuleSize) { int maxI = image_->getHeight(); int stateCount[5]; for (in...
function
c++
99,775
struct ipmi_request * ipmi_dequeue_request(struct ipmi_softc *sc) { struct ipmi_request *req; IPMI_LOCK_ASSERT(sc); while (!sc->ipmi_detaching && TAILQ_EMPTY(&sc->ipmi_pending_requests)) cv_wait(&sc->ipmi_request_added, &sc->ipmi_requests_lock); if (sc->ipmi_detaching) return (NULL); req = TAILQ_FIRST(&sc->ipm...
function
c
99,776
class EEMD: """ **Ensemble Empirical Mode Decomposition** Ensemble empirical mode decomposition (EEMD) [Wu2009]_ is noise-assisted technique, which is meant to be more robust than simple Empirical Mode Decomposition (EMD). The robustness is checked by performing many decompositions on signals s...
class
python
99,777
void Service::removeClient(size_t i) { assert(i < activeClientCount); #ifndef GAMEDEVWEBTOOLS_NO_WEBSOCKETS wsclients[i].~Server(); #endif clients[i].~Listener(); for(auto j = i+1;j<activeClientCount;++j){ #ifndef GAMEDEVWEBTOOLS_NO_WEBSOCKETS memcpy(&wsclients[j-1],&wsclients[j], sizeof(network::websocket::Se...
function
c++
99,778
func (c context) bestMatch(mrs header.MediaRanges, languages header.PrecedenceValues, available offer.Offers, vary []string) (best *offer.Match) { remaining := c.removeExcludedOffers(mrs, available) foundCtMatch := false for i := 1; i <= 2; i++ { for _, offer := range remaining { best, foundCtMatch = c.findBest...
function
go
99,779
public class LeagueUserValidator<TUser> : IUserValidator<TUser> where TUser : ApplicationUser { public LeagueUserValidator(IOptions<LeagueUserValidatorOptions> serviceConfig, IdentityErrorDescriber describer) { Describer = describer as MultiLanguageIdentityErrorDescriber; Req...
class
c#
99,780
[IsVisibleInDynamoLibrary(true)] public static List<string> TransferViewTemplateAndFilter(Document LinkDocument, bool IsIncludeFilters = true) { var TemplateNames = new List<string>(); var doc = DocumentManager.Instance.CurrentDBDocument; var views = new FilteredEleme...
function
c#
99,781
func secretDataToRelease(clusterName string, secretData []byte) (*Release, error) { releaseData, err := base64.StdEncoding.DecodeString(string(secretData)) if err != nil { return nil, err } releaseDataUnzipped, err := decompress(releaseData) if err != nil { return nil, err } var release Release err = json.U...
function
go
99,782
public function process($item, $arguments = null, $inheritedScope = null) { $rewrite = $this->getRewriteHashLinks(); $origRewriteDefault = static::getRewriteHashLinksDefault(); static::setRewriteHashLinksDefault($rewrite); SSViewer::$topLevel[] = $item; $template = $this->cho...
function
php
99,783
def push(self, act, force=False): if act is not None and isinstance(act, DialogueAct): if act in self.agenda and not force: self.remove(act) self.agenda.append(act) else: print("Error! Cannot add item %s in the agenda." % act)
function
python
99,784
def plaquette(self, index): r, c = index if not self.code.is_plaquette(index): raise IndexError('{} is not a plaquette index.'.format(index)) operator = 'Z' if self.code.is_primal(index) else 'X' self.site(operator, (r - 1, c)) self.site(operator, (r + 1, c)) ...
function
python
99,785
func (s *healthCheckCounter) internalWakeWithoutLock() { if s.waitlist.Len() == 0 { return } s.waitlist.deleteThrough(s.next-1, func(goner *waituntil, through int64) { goner.ready.Close() for _, g := range goner.readylist { g.Close() } }) }
function
go
99,786
def _update_by_document(self, callback: Callable, collection: Collection, filter_path: List[str], update_path: List[str]) -> None: field_filter_path = copy(filter_path) if self.field_name: ...
function
python
99,787
async def leaderboards( self, offset: int = 0, length: int = 100 ) -> list[CampaignLeaderboard]: leaderboards = [] leaderboard_data = get_from_cache( f"campaign:{self.campaign_id}:{offset}:{length}" ) if leaderboard_data is not None: for lb_place in le...
function
python
99,788
@XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "FilterType") public class FilterType extends OriginalFilterType { @XmlAttribute(name = "active") protected Boolean active; @XmlAttribute(name = "title") @XmlJavaTypeAdapter(CollapsedStringAdapter.class) @XmlSchemaType(name = "toke...
class
java
99,789
int dr_screenshot(const char *filename, int x, int y, int w, int h) { #ifdef WIN32 if( dr_screenshot_png(filename, max(w,width-1), h, width, ((short unsigned int *)texture_map)+x+y*width, 16) ) { return 1; } #endif PALETTE pal; get_palette(pal); return save_bitmap(filename, texture_map, pal) == 0 ? 1 : -1; }
function
c++
99,790
def sls_2nd_order(model, geometry, p, r=None, **kwargs): forward = kwargs.get('forward', True) space_order = p.space_order save = kwargs.get('save', False) save_t = geometry.nt if save else None s = model.grid.stepping_dim.spacing b = model.b vp = model.vp damp = model.damp qp = mode...
function
python
99,791
private int readTestResult(final Launcher launcher) throws IOException, InterruptedException { int result = 0; try { if (tttBuilder.getCreateResult()) { VirtualChannel vChannel = launcher.getChannel(); FilePath testFolder = new FilePath(vChannel, tttBuilder.getFolderPath()); boolean usesNewExte...
function
java
99,792
public static void ToBindControl(IGUIField control, params object[] args) { UIDescriptor desc = null; MemberInfo member = null; foreach (object obj in args) { if (obj is UIDescriptor) desc = (UIDescriptor)obj; if (obj is MemberInfo)...
function
c#
99,793
function normalizeWikitext(wt, opts) { if (opts.preDiff) { wt = wt.replace(/^([*#:;]|\|[-+|]?|!!?)[ \t]*(.*?)[ \t]*$/mg, "$1$1"); wt = wt.replace(/^(=+)[ \t]*([^\n]*?)[ \t]*(=+)[ \t]*$/mg, "$1$2$3"); } if (opts.newlines) { wt = wt.replace(/\n*(\n=[^\n]*=$\n)\n*/mg, "$1"); wt = wt.replace(/(^[^*][^\n]*$\n)\n+...
function
javascript
99,794
QExifValue::QExifValue( const QString &value, TextEncoding encoding ) : d( qExifValuePrivateSharedNull() ) { switch( encoding ) { case AsciiEncoding: d = new QExifUndefinedValuePrivate( QByteArray::fromRawData( "ASCII\0\0\0", 8 ) + value.toLatin1() ); break; case JisEncoding: { ...
function
c++
99,795
public static string Delete(AdoDataConnection database, int outputStreamID) { bool createdConnection = false; try { createdConnection = CreateConnection(ref database); DataTable outputStreamAcronym = database.Connection.RetrieveData(database.Ad...
function
c#
99,796
ErrorStatus md_fc_program(md_fc_ControlTypeDef *pProgramPara) { ErrorStatus status = ERROR; uint16_t BCnt; md_fc_set_pa_pcnt(pProgramPara->BCnt); md_fc_set_pa_prog_addr(pProgramPara->SAddr); BCnt = pProgramPara->BCnt; BCnt >>= 3; while (BCnt--) { if (pProgramPara->SAddr & pProgramPara->SAddrC) ...
function
c
99,797
def _neumannBCLoss(self, X, Y, N = None): sigma_xx, sigma_xy, sigma_yy = self.calculate_cauchy_stresses(X) numEvals = X.shape[0] MSE_sig_xy = torch.sum((sigma_xy - Y[:,0])**2) / numEvals MSE_sig_yy = torch.sum((sigma_yy - Y[:,1])**2) / numEvals loss_BC_Neu = MSE_sig_yy + MSE_sig_...
function
python
99,798
def apply(self, fun=None, axis=0): from .astfun import _bytecode_decompile_lambda if axis not in [0,1]: raise ValueError("margin must be either 0 (cols) or 1 (rows).") if fun is None: raise ValueError("No function to apply.") if isinstance(fun, type(lambda:0)) and fun.__name__ == (lambda:0)....
function
python
99,799