| code,repo_name,path,language,license,size | |
| "/* { dg-do compile } */ | |
| /* { dg-options ""-mavx512f -O2 -masm=att"" } */ | |
| /* { dg-final { scan-assembler-times ""vmovss\[ \\t\]+\\(%\[a-z0-9,]*\\), %xmm\[0-9\]+\{%k\[1-7\]\}(?:\n|\[ \\t\]+#)"" 1 } } */ | |
| /* { dg-final { scan-assembler-times ""vmovss\[ \\t\]+\\(%\[a-z0-9,]*\\), %xmm\[0-9\]+\{%k\[1-7\]\}\{z\}(?:\n|\[ \\t\]+#)"" 1 } } */ | |
| /* { dg-final { scan-assembler-times ""vmovss\[ \\t\]+%xmm\[0-9\]+, %xmm\[0-9\]+, %xmm\[0-9\]+\{%k\[1-7\]\}(?:\n|\[ \\t\]+#)"" 1 } } */ | |
| /* { dg-final { scan-assembler-times ""vmovss\[ \\t\]+%xmm\[0-9\]+, %xmm\[0-9\]+, %xmm\[0-9\]+\{%k\[1-7\]\}\{z\}(?:\n|\[ \\t\]+#)"" 1 } } */ | |
| /* { dg-final { scan-assembler-times ""vmovss\[ \\t\]+%xmm\[0-9\]+, \\(%\[a-z0-9,]*\\)\{%k\[1-7\]\}(?:\n|\[ \\t\]+#)"" 1 } } */ | |
| #include <immintrin.h> | |
| volatile __m128 x1, x2, x3; | |
| volatile __mmask8 m; | |
| float *volatile p; | |
| void extern | |
| avx512f_test (void) | |
| { | |
| x1 = _mm_mask_load_ss (x1, m, p); | |
| x1 = _mm_maskz_load_ss (m, p); | |
| x1 = _mm_mask_move_ss (x1, m, x2, x3); | |
| x1 = _mm_maskz_move_ss (m, x2, x3); | |
| _mm_mask_store_ss (p, m, x1); | |
| } | |
| ",Gurgel100/gcc,gcc/testsuite/gcc.target/i386/avx512f-vmovss-1.c,C,gpl-2.0,1037 | |
| "from virtTrinity import picker | |
| from virtTrinity.providers.virsh_cmd import data | |
| from virtTrinity.providers.virsh_cmd.utils import virsh | |
| from virtTrinity.providers.virsh_cmd.picker.command import CmdPicker | |
| class OptSetPicker(picker.PickerBase): | |
| depends_on = CmdPicker | |
| data_type = data.VirshOptSet() | |
| types = { | |
| ""positive"": { | |
| ""patterns"": None, | |
| ""data_type"": data.OptSet(), | |
| }, | |
| ""miss_dep"": { | |
| ""patterns"": r""command '.*' requires .* option"", | |
| ""data_type"": data.MissingDepOptSet(), | |
| }, | |
| ""other"": { | |
| ""patterns"": [ | |
| r""command '.*' doesn't support option --.*"", | |
| # r""command or command group '.*' doesn't exist"", | |
| ] | |
| }, | |
| } | |
| def prerequisite(self): | |
| return self.test.cmd in virsh.commands | |
| def apply(self, result): | |
| self.test.options = result | |
| ",Hao-Liu/virt-trinity,virtTrinity/providers/virsh_cmd/picker/optset.py,Python,gpl-2.0,913 | |
| "package com.suscipio_solutions.consecro_mud.Abilities.Spells; | |
| import java.util.LinkedList; | |
| import java.util.Vector; | |
| import com.suscipio_solutions.consecro_mud.Abilities.interfaces.Ability; | |
| import com.suscipio_solutions.consecro_mud.Common.interfaces.CMMsg; | |
| import com.suscipio_solutions.consecro_mud.Items.interfaces.Item; | |
| import com.suscipio_solutions.consecro_mud.Items.interfaces.Wearable; | |
| import com.suscipio_solutions.consecro_mud.Locales.interfaces.Room; | |
| import com.suscipio_solutions.consecro_mud.MOBS.interfaces.MOB; | |
| import com.suscipio_solutions.consecro_mud.core.CMClass; | |
| import com.suscipio_solutions.consecro_mud.core.CMLib; | |
| import com.suscipio_solutions.consecro_mud.core.CMStrings; | |
| import com.suscipio_solutions.consecro_mud.core.interfaces.Environmental; | |
| import com.suscipio_solutions.consecro_mud.core.interfaces.Physical; | |
| @SuppressWarnings(""rawtypes"") | |
| public class Spell_SpyingStone extends Spell | |
| { | |
| @Override public String ID() { return ""Spell_SpyingStone""; } | |
| private final static String localizedName = CMLib.lang().L(""Spying Stone""); | |
| @Override public String name() { return localizedName; } | |
| private final static String localizedStaticDisplay = CMLib.lang().L(""(Spying Stone)""); | |
| @Override public String displayText() { return localizedStaticDisplay; } | |
| @Override protected int canAffectCode(){return CAN_ITEMS;} | |
| @Override protected int canTargetCode(){return Ability.CAN_ITEMS;} | |
| @Override public int classificationCode(){return Ability.ACODE_SPELL|Ability.DOMAIN_DIVINATION;} | |
| @Override public int abstractQuality(){ return Ability.QUALITY_INDIFFERENT;} | |
| protected LinkedList<String> msgs=new LinkedList<String>(); | |
| @Override | |
| public void executeMsg(final Environmental myHost, final CMMsg msg) | |
| { | |
| super.executeMsg(myHost, msg); | |
| if((msg.targetMinor()==CMMsg.TYP_SPEAK) | |
| &&((msg.source()==invoker()) | |
| ||((invoker()!=null) && msg.source().Name().equalsIgnoreCase(invoker().Name()))) | |
| &&(msg.target()==affected) | |
| &&(msg.sourceMessage().toUpperCase().indexOf(""SPEAK"")>=0)) | |
| { | |
| final Room room=CMLib.map().roomLocation(affected); | |
| if(room!=null) | |
| { | |
| final StringBuilder str=new StringBuilder(""""); | |
| for(final String m : msgs) | |
| str.append(m).append(""\n\r""); | |
| if(str.length()==0) str.append(L(""Nothing!"")); | |
| room.showHappens(CMMsg.MSG_SPEAK, affected,L(""^S<S-NAME> grow(s) a mouth and say(s) '^N@x1^S'^N"",str.toString())); | |
| msgs.clear(); | |
| } | |
| } | |
| else | |
| if((msg.othersCode()!=CMMsg.NO_EFFECT) | |
| &&(msg.othersMessage()!=null) | |
| &&(msg.othersMessage().length()>0)) | |
| msgs.add(CMLib.coffeeFilter().fullOutFilter(null, null, msg.source(), msg.target(), msg.tool(), CMStrings.removeColors(msg.othersMessage()), false)); | |
| } | |
| @Override | |
| public boolean invoke(MOB mob, Vector commands, Physical givenTarget, boolean auto, int asLevel) | |
| { | |
| final Physical target=getTarget(mob,mob.location(),givenTarget,commands,Wearable.FILTER_ANY); | |
| if(target==null) return false; | |
| if(!(target instanceof Item)) | |
| { | |
| mob.tell(L(""You can't cast this spell on that."")); | |
| return false; | |
| } | |
| if(target.fetchEffect(this.ID())!=null) | |
| { | |
| mob.tell(L(""@x1 is already a spying stone!"",target.name(mob))); | |
| return false; | |
| } | |
| if(!super.invoke(mob,commands,givenTarget,auto,asLevel)) | |
| return false; | |
| final boolean success=proficiencyCheck(mob,0,auto); | |
| if(success) | |
| { | |
| final CMMsg msg=CMClass.getMsg(mob,target,this,verbalCastCode(mob,target,auto),auto?"""":L(""^S<S-NAME> point(s) <S-HIS-HER> finger at <T-NAMESELF>, incanting.^?"")); | |
| if(mob.location().okMessage(mob,msg)) | |
| { | |
| mob.location().send(mob,msg); | |
| beneficialAffect(mob,target,asLevel,0); | |
| mob.location().show(mob,target,CMMsg.MSG_OK_VISUAL,L(""<T-NAME> open(s) a pair of strange eyes, which become transluscent."")); | |
| } | |
| } | |
| else | |
| beneficialWordsFizzle(mob,target,L(""<S-NAME> point(s) at <T-NAMESELF>, incanting, but nothing happens."")); | |
| // return whether it worked | |
| return success; | |
| } | |
| } | |
| ",ConsecroMUD/ConsecroMUD,com/suscipio_solutions/consecro_mud/Abilities/Spells/Spell_SpyingStone.java,Java,apache-2.0,3919 | |
| "# -*- encoding: utf-8 -*- | |
| ''' | |
| HubbleStack Nebula-to-Splunk returner | |
| Deliver HubbleStack Nebula query data into Splunk using the HTTP | |
| event collector. Required config/pillar settings: | |
| .. code-block:: yaml | |
| hubblestack: | |
| returner: | |
| splunk: | |
| - token: XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX | |
| indexer: splunk-indexer.domain.tld | |
| index: hubble | |
| sourcetype_nebula: hubble_osquery | |
| You can also add a `custom_fields` argument which is a list of keys to add to | |
| events with using the results of config.get(<custom_field>). These new keys | |
| will be prefixed with 'custom_' to prevent conflicts. The values of these keys | |
| should be strings or lists (will be sent as CSV string), do not choose grains | |
| or pillar values with complex values or they will be skipped. | |
| Additionally, you can define a fallback_indexer which will be used if a default | |
| gateway is not defined. | |
| .. code-block:: yaml | |
| hubblestack: | |
| returner: | |
| splunk: | |
| - token: XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX | |
| indexer: splunk-indexer.domain.tld | |
| index: hubble | |
| sourcetype_nebula: hubble_osquery | |
| fallback_indexer: splunk-indexer.loc.domain.tld | |
| custom_fields: | |
| - site | |
| - product_group | |
| ''' | |
| import socket | |
| # Imports for http event forwarder | |
| import requests | |
| import json | |
| import time | |
| from datetime import datetime | |
| from hubblestack.hec import http_event_collector, get_splunk_options, make_hec_args | |
| import logging | |
| _max_content_bytes = 100000 | |
| http_event_collector_debug = False | |
| RETRY = False | |
| log = logging.getLogger(__name__) | |
| def returner(ret): | |
| try: | |
| opts_list = get_splunk_options( sourcetype_nebula='hubble_osquery', | |
| add_query_to_sourcetype=True, _nick={'sourcetype_nebula': 'sourcetype'}) | |
| for opts in opts_list: | |
| logging.debug('Options: %s' % json.dumps(opts)) | |
| custom_fields = opts['custom_fields'] | |
| # Set up the fields to be extracted at index time. The field values must be strings. | |
| # Note that these fields will also still be available in the event data | |
| index_extracted_fields = [] | |
| try: | |
| index_extracted_fields.extend(__opts__.get('splunk_index_extracted_fields', [])) | |
| except TypeError: | |
| pass | |
| # Set up the collector | |
| args, kwargs = make_hec_args(opts) | |
| hec = http_event_collector(*args, **kwargs) | |
| # st = 'salt:hubble:nova' | |
| data = ret['return'] | |
| minion_id = ret['id'] | |
| jid = ret['jid'] | |
| global RETRY | |
| RETRY = ret['retry'] | |
| master = __grains__['master'] | |
| fqdn = __grains__['fqdn'] | |
| # Sometimes fqdn is blank. If it is, replace it with minion_id | |
| fqdn = fqdn if fqdn else minion_id | |
| try: | |
| fqdn_ip4 = __grains__.get('local_ip4') | |
| if not fqdn_ip4: | |
| fqdn_ip4 = __grains__['fqdn_ip4'][0] | |
| except IndexError: | |
| try: | |
| fqdn_ip4 = __grains__['ipv4'][0] | |
| except IndexError: | |
| raise Exception('No ipv4 grains found. Is net-tools installed?') | |
| if fqdn_ip4.startswith('127.'): | |
| for ip4_addr in __grains__['ipv4']: | |
| if ip4_addr and not ip4_addr.startswith('127.'): | |
| fqdn_ip4 = ip4_addr | |
| break | |
| local_fqdn = __grains__.get('local_fqdn', __grains__['fqdn']) | |
| # Sometimes fqdn reports a value of localhost. If that happens, try another method. | |
| bad_fqdns = ['localhost', 'localhost.localdomain', 'localhost6.localdomain6'] | |
| if fqdn in bad_fqdns: | |
| new_fqdn = socket.gethostname() | |
| if '.' not in new_fqdn or new_fqdn in bad_fqdns: | |
| new_fqdn = fqdn_ip4 | |
| fqdn = new_fqdn | |
| # Get cloud details | |
| cloud_details = __grains__.get('cloud_details', {}) | |
| if not data: | |
| return | |
| else: | |
| for query in data: | |
| for query_name, query_results in query.iteritems(): | |
| if 'data' not in query_results: | |
| query_results['data'] = [{'error': 'result missing'}] | |
| for query_result in query_results['data']: | |
| event = {} | |
| payload = {} | |
| event.update(query_result) | |
| event.update({'query': query_name}) | |
| event.update({'job_id': jid}) | |
| event.update({'master': master}) | |
| event.update({'minion_id': minion_id}) | |
| event.update({'dest_host': fqdn}) | |
| event.update({'dest_ip': fqdn_ip4}) | |
| event.update({'dest_fqdn': local_fqdn}) | |
| event.update({'system_uuid': __grains__.get('system_uuid')}) | |
| event.update(cloud_details) | |
| for custom_field in custom_fields: | |
| custom_field_name = 'custom_' + custom_field | |
| custom_field_value = __salt__['config.get'](custom_field, '') | |
| if isinstance(custom_field_value, (str, unicode)): | |
| event.update({custom_field_name: custom_field_value}) | |
| elif isinstance(custom_field_value, list): | |
| custom_field_value = ','.join(custom_field_value) | |
| event.update({custom_field_name: custom_field_value}) | |
| payload.update({'host': fqdn}) | |
| payload.update({'index': opts['index']}) | |
| if opts['add_query_to_sourcetype']: | |
| payload.update({'sourcetype': ""%s_%s"" % (opts['sourcetype'], query_name)}) | |
| else: | |
| payload.update({'sourcetype': opts['sourcetype']}) | |
| # Remove any empty fields from the event payload | |
| remove_keys = [k for k in event if event[k] == """"] | |
| for k in remove_keys: | |
| del event[k] | |
| payload.update({'event': event}) | |
| # Potentially add metadata fields: | |
| fields = {} | |
| for item in index_extracted_fields: | |
| if item in payload['event'] and not isinstance(payload['event'][item], (list, dict, tuple)): | |
| fields[""meta_%s"" % item] = str(payload['event'][item]) | |
| if fields: | |
| payload.update({'fields': fields}) | |
| # If the osquery query includes a field called 'time' it will be checked. | |
| # If it's within the last year, it will be used as the eventtime. | |
| event_time = query_result.get('time', '') | |
| try: | |
| if (datetime.fromtimestamp(time.time()) - datetime.fromtimestamp(float(event_time))).days > 365: | |
| event_time = '' | |
| except Exception: | |
| event_time = '' | |
| finally: | |
| hec.batchEvent(payload, eventtime=event_time) | |
| hec.flushBatch() | |
| except Exception: | |
| log.exception('Error ocurred in splunk_nebula_return') | |
| return | |
| ",basepi/hubble,hubblestack/extmods/returners/splunk_nebula_return.py,Python,apache-2.0,7889 | |
| "// Copyright (c) 2012 The Chromium Authors. All rights reserved. | |
| // Use of this source code is governed by a BSD-style license that can be | |
| // found in the LICENSE file. | |
| #ifndef CHROME_BROWSER_UI_VIEWS_TAB_ICON_VIEW_MODEL_H_ | |
| #define CHROME_BROWSER_UI_VIEWS_TAB_ICON_VIEW_MODEL_H_ | |
| namespace ui { | |
| class ImageModel; | |
| } // namespace ui | |
| // Classes implement this interface to provide state for the TabIconView. | |
| class TabIconViewModel { | |
| public: | |
| // Returns true if the TabIconView should show a loading animation. | |
| virtual bool ShouldTabIconViewAnimate() const = 0; | |
| // Returns the favicon to display in the icon view | |
| virtual ui::ImageModel GetFaviconForTabIconView() = 0; | |
| protected: | |
| virtual ~TabIconViewModel() {} | |
| }; | |
| #endif // CHROME_BROWSER_UI_VIEWS_TAB_ICON_VIEW_MODEL_H_ | |
| ",ric2b/Vivaldi-browser,chromium/chrome/browser/ui/views/tab_icon_view_model.h,C,bsd-3-clause,784 | |
| "// | |
| // HealthKit.h | |
| // HealthKit | |
| // | |
| // Copyright (c) 2013-2014 Apple Inc. All rights reserved. | |
| // | |
| #import <HealthKit/HKActivitySummary.h> | |
| #import <HealthKit/HKActivitySummaryQuery.h> | |
| #import <HealthKit/HKAnchoredObjectQuery.h> | |
| #import <HealthKit/HKCategorySample.h> | |
| #import <HealthKit/HKCorrelation.h> | |
| #import <HealthKit/HKCorrelationQuery.h> | |
| #import <HealthKit/HKDefines.h> | |
| #import <HealthKit/HKDeletedObject.h> | |
| #import <HealthKit/HKDevice.h> | |
| #import <HealthKit/HKHealthStore.h> | |
| #import <HealthKit/HKMetadata.h> | |
| #import <HealthKit/HKObject.h> | |
| #import <HealthKit/HKObjectType.h> | |
| #import <HealthKit/HKObserverQuery.h> | |
| #import <HealthKit/HKQuantity.h> | |
| #import <HealthKit/HKQuantitySample.h> | |
| #import <HealthKit/HKQuery.h> | |
| #import <HealthKit/HKSample.h> | |
| #import <HealthKit/HKSampleQuery.h> | |
| #import <HealthKit/HKSource.h> | |
| #import <HealthKit/HKSourceQuery.h> | |
| #import <HealthKit/HKSourceRevision.h> | |
| #import <HealthKit/HKStatistics.h> | |
| #import <HealthKit/HKStatisticsCollectionQuery.h> | |
| #import <HealthKit/HKStatisticsQuery.h> | |
| #import <HealthKit/HKTypeIdentifiers.h> | |
| #import <HealthKit/HKUnit.h> | |
| #import <HealthKit/HKWorkout.h> | |
| #import <HealthKit/HKWorkoutSession.h> | |
| ",rweichler/cylinder,deps/iPhoneOS9.3.sdk/System/Library/Frameworks/HealthKit.framework/Headers/HealthKit.h,C,mit,1159 | |