codeparrot/code-generation-models
257
1code,repo_name,path,language,license,size2"/* { dg-do compile } */3/* { dg-options ""-mavx512f -O2 -masm=att"" } */4/* { dg-final { scan-assembler-times ""vmovss\[ \\t\]+\\(%\[a-z0-9,]*\\), %xmm\[0-9\]+\{%k\[1-7\]\}(?:\n|\[ \\t\]+#)"" 1 } } */5/* { dg-final { scan-assembler-times ""vmovss\[ \\t\]+\\(%\[a-z0-9,]*\\), %xmm\[0-9\]+\{%k\[1-7\]\}\{z\}(?:\n|\[ \\t\]+#)"" 1 } } */6/* { dg-final { scan-assembler-times ""vmovss\[ \\t\]+%xmm\[0-9\]+, %xmm\[0-9\]+, %xmm\[0-9\]+\{%k\[1-7\]\}(?:\n|\[ \\t\]+#)"" 1 } } */7/* { dg-final { scan-assembler-times ""vmovss\[ \\t\]+%xmm\[0-9\]+, %xmm\[0-9\]+, %xmm\[0-9\]+\{%k\[1-7\]\}\{z\}(?:\n|\[ \\t\]+#)"" 1 } } */8/* { dg-final { scan-assembler-times ""vmovss\[ \\t\]+%xmm\[0-9\]+, \\(%\[a-z0-9,]*\\)\{%k\[1-7\]\}(?:\n|\[ \\t\]+#)"" 1 } } */9 10#include <immintrin.h>11 12volatile __m128 x1, x2, x3;13volatile __mmask8 m;14float *volatile p;15 16void extern17avx512f_test (void)18{19 x1 = _mm_mask_load_ss (x1, m, p);20 x1 = _mm_maskz_load_ss (m, p);21 x1 = _mm_mask_move_ss (x1, m, x2, x3);22 x1 = _mm_maskz_move_ss (m, x2, x3);23 _mm_mask_store_ss (p, m, x1);24}25",Gurgel100/gcc,gcc/testsuite/gcc.target/i386/avx512f-vmovss-1.c,C,gpl-2.0,103726"from virtTrinity import picker27from virtTrinity.providers.virsh_cmd import data28from virtTrinity.providers.virsh_cmd.utils import virsh29from virtTrinity.providers.virsh_cmd.picker.command import CmdPicker30 31 32class OptSetPicker(picker.PickerBase):33 depends_on = CmdPicker34 data_type = data.VirshOptSet()35 36 types = {37 ""positive"": {38 ""patterns"": None,39 ""data_type"": data.OptSet(),40 },41 ""miss_dep"": {42 ""patterns"": r""command '.*' requires .* option"",43 ""data_type"": data.MissingDepOptSet(),44 },45 ""other"": {46 ""patterns"": [47 r""command '.*' doesn't support option --.*"",48 # r""command or command group '.*' doesn't exist"",49 ]50 },51 }52 53 def prerequisite(self):54 return self.test.cmd in virsh.commands55 56 def apply(self, result):57 self.test.options = result58",Hao-Liu/virt-trinity,virtTrinity/providers/virsh_cmd/picker/optset.py,Python,gpl-2.0,91359"package com.suscipio_solutions.consecro_mud.Abilities.Spells;60import java.util.LinkedList;61import java.util.Vector;62 63import com.suscipio_solutions.consecro_mud.Abilities.interfaces.Ability;64import com.suscipio_solutions.consecro_mud.Common.interfaces.CMMsg;65import com.suscipio_solutions.consecro_mud.Items.interfaces.Item;66import com.suscipio_solutions.consecro_mud.Items.interfaces.Wearable;67import com.suscipio_solutions.consecro_mud.Locales.interfaces.Room;68import com.suscipio_solutions.consecro_mud.MOBS.interfaces.MOB;69import com.suscipio_solutions.consecro_mud.core.CMClass;70import com.suscipio_solutions.consecro_mud.core.CMLib;71import com.suscipio_solutions.consecro_mud.core.CMStrings;72import com.suscipio_solutions.consecro_mud.core.interfaces.Environmental;73import com.suscipio_solutions.consecro_mud.core.interfaces.Physical;74 75 76@SuppressWarnings(""rawtypes"")77public class Spell_SpyingStone extends Spell78{79 @Override public String ID() { return ""Spell_SpyingStone""; }80 private final static String localizedName = CMLib.lang().L(""Spying Stone"");81 @Override public String name() { return localizedName; }82 private final static String localizedStaticDisplay = CMLib.lang().L(""(Spying Stone)"");83 @Override public String displayText() { return localizedStaticDisplay; }84 @Override protected int canAffectCode(){return CAN_ITEMS;}85 @Override protected int canTargetCode(){return Ability.CAN_ITEMS;}86 @Override public int classificationCode(){return Ability.ACODE_SPELL|Ability.DOMAIN_DIVINATION;}87 @Override public int abstractQuality(){ return Ability.QUALITY_INDIFFERENT;}88 89 protected LinkedList<String> msgs=new LinkedList<String>();90 91 @Override92 public void executeMsg(final Environmental myHost, final CMMsg msg)93 {94 super.executeMsg(myHost, msg);95 if((msg.targetMinor()==CMMsg.TYP_SPEAK)96 &&((msg.source()==invoker())97 ||((invoker()!=null) && msg.source().Name().equalsIgnoreCase(invoker().Name())))98 &&(msg.target()==affected)99 &&(msg.sourceMessage().toUpperCase().indexOf(""SPEAK"")>=0))100 {101 final Room room=CMLib.map().roomLocation(affected);102 if(room!=null)103 {104 final StringBuilder str=new StringBuilder("""");105 for(final String m : msgs)106 str.append(m).append(""\n\r"");107 if(str.length()==0) str.append(L(""Nothing!""));108 room.showHappens(CMMsg.MSG_SPEAK, affected,L(""^S<S-NAME> grow(s) a mouth and say(s) '^N@x1^S'^N"",str.toString()));109 msgs.clear();110 }111 }112 else113 if((msg.othersCode()!=CMMsg.NO_EFFECT)114 &&(msg.othersMessage()!=null)115 &&(msg.othersMessage().length()>0))116 msgs.add(CMLib.coffeeFilter().fullOutFilter(null, null, msg.source(), msg.target(), msg.tool(), CMStrings.removeColors(msg.othersMessage()), false));117 }118 119 @Override120 public boolean invoke(MOB mob, Vector commands, Physical givenTarget, boolean auto, int asLevel)121 {122 final Physical target=getTarget(mob,mob.location(),givenTarget,commands,Wearable.FILTER_ANY);123 if(target==null) return false;124 125 if(!(target instanceof Item))126 {127 mob.tell(L(""You can't cast this spell on that.""));128 return false;129 }130 131 if(target.fetchEffect(this.ID())!=null)132 {133 mob.tell(L(""@x1 is already a spying stone!"",target.name(mob)));134 return false;135 }136 137 if(!super.invoke(mob,commands,givenTarget,auto,asLevel))138 return false;139 140 final boolean success=proficiencyCheck(mob,0,auto);141 142 if(success)143 {144 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.^?""));145 if(mob.location().okMessage(mob,msg))146 {147 mob.location().send(mob,msg);148 beneficialAffect(mob,target,asLevel,0);149 mob.location().show(mob,target,CMMsg.MSG_OK_VISUAL,L(""<T-NAME> open(s) a pair of strange eyes, which become transluscent.""));150 }151 }152 else153 beneficialWordsFizzle(mob,target,L(""<S-NAME> point(s) at <T-NAMESELF>, incanting, but nothing happens.""));154 155 156 // return whether it worked157 return success;158 }159}160",ConsecroMUD/ConsecroMUD,com/suscipio_solutions/consecro_mud/Abilities/Spells/Spell_SpyingStone.java,Java,apache-2.0,3919161"# -*- encoding: utf-8 -*-162'''163HubbleStack Nebula-to-Splunk returner164 165Deliver HubbleStack Nebula query data into Splunk using the HTTP166event collector. Required config/pillar settings:167 168.. code-block:: yaml169 170 hubblestack:171 returner:172 splunk:173 - token: XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX174 indexer: splunk-indexer.domain.tld175 index: hubble176 sourcetype_nebula: hubble_osquery177 178You can also add a `custom_fields` argument which is a list of keys to add to179events with using the results of config.get(<custom_field>). These new keys180will be prefixed with 'custom_' to prevent conflicts. The values of these keys181should be strings or lists (will be sent as CSV string), do not choose grains182or pillar values with complex values or they will be skipped.183 184Additionally, you can define a fallback_indexer which will be used if a default185gateway is not defined.186 187.. code-block:: yaml188 189 hubblestack:190 returner:191 splunk:192 - token: XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX193 indexer: splunk-indexer.domain.tld194 index: hubble195 sourcetype_nebula: hubble_osquery196 fallback_indexer: splunk-indexer.loc.domain.tld197 custom_fields:198 - site199 - product_group200'''201import socket202 203# Imports for http event forwarder204import requests205import json206import time207from datetime import datetime208from hubblestack.hec import http_event_collector, get_splunk_options, make_hec_args209 210import logging211 212_max_content_bytes = 100000213http_event_collector_debug = False214RETRY = False215 216log = logging.getLogger(__name__)217 218 219def returner(ret):220 try:221 opts_list = get_splunk_options( sourcetype_nebula='hubble_osquery',222 add_query_to_sourcetype=True, _nick={'sourcetype_nebula': 'sourcetype'})223 224 for opts in opts_list:225 logging.debug('Options: %s' % json.dumps(opts))226 custom_fields = opts['custom_fields']227 228 # Set up the fields to be extracted at index time. The field values must be strings.229 # Note that these fields will also still be available in the event data230 index_extracted_fields = []231 try:232 index_extracted_fields.extend(__opts__.get('splunk_index_extracted_fields', []))233 except TypeError:234 pass235 236 # Set up the collector237 args, kwargs = make_hec_args(opts)238 hec = http_event_collector(*args, **kwargs)239 240 # st = 'salt:hubble:nova'241 data = ret['return']242 minion_id = ret['id']243 jid = ret['jid']244 global RETRY245 RETRY = ret['retry']246 master = __grains__['master']247 fqdn = __grains__['fqdn']248 # Sometimes fqdn is blank. If it is, replace it with minion_id249 fqdn = fqdn if fqdn else minion_id250 try:251 fqdn_ip4 = __grains__.get('local_ip4')252 if not fqdn_ip4:253 fqdn_ip4 = __grains__['fqdn_ip4'][0]254 except IndexError:255 try:256 fqdn_ip4 = __grains__['ipv4'][0]257 except IndexError:258 raise Exception('No ipv4 grains found. Is net-tools installed?')259 if fqdn_ip4.startswith('127.'):260 for ip4_addr in __grains__['ipv4']:261 if ip4_addr and not ip4_addr.startswith('127.'):262 fqdn_ip4 = ip4_addr263 break264 local_fqdn = __grains__.get('local_fqdn', __grains__['fqdn'])265 266 # Sometimes fqdn reports a value of localhost. If that happens, try another method.267 bad_fqdns = ['localhost', 'localhost.localdomain', 'localhost6.localdomain6']268 if fqdn in bad_fqdns:269 new_fqdn = socket.gethostname()270 if '.' not in new_fqdn or new_fqdn in bad_fqdns:271 new_fqdn = fqdn_ip4272 fqdn = new_fqdn273 274 # Get cloud details275 cloud_details = __grains__.get('cloud_details', {})276 277 if not data:278 return279 else:280 for query in data:281 for query_name, query_results in query.iteritems():282 if 'data' not in query_results:283 query_results['data'] = [{'error': 'result missing'}]284 for query_result in query_results['data']:285 event = {}286 payload = {}287 event.update(query_result)288 event.update({'query': query_name})289 event.update({'job_id': jid})290 event.update({'master': master})291 event.update({'minion_id': minion_id})292 event.update({'dest_host': fqdn})293 event.update({'dest_ip': fqdn_ip4})294 event.update({'dest_fqdn': local_fqdn})295 event.update({'system_uuid': __grains__.get('system_uuid')})296 297 event.update(cloud_details)298 299 for custom_field in custom_fields:300 custom_field_name = 'custom_' + custom_field301 custom_field_value = __salt__['config.get'](custom_field, '')302 if isinstance(custom_field_value, (str, unicode)):303 event.update({custom_field_name: custom_field_value})304 elif isinstance(custom_field_value, list):305 custom_field_value = ','.join(custom_field_value)306 event.update({custom_field_name: custom_field_value})307 308 payload.update({'host': fqdn})309 payload.update({'index': opts['index']})310 if opts['add_query_to_sourcetype']:311 payload.update({'sourcetype': ""%s_%s"" % (opts['sourcetype'], query_name)})312 else:313 payload.update({'sourcetype': opts['sourcetype']})314 315 # Remove any empty fields from the event payload316 remove_keys = [k for k in event if event[k] == """"]317 for k in remove_keys:318 del event[k]319 320 payload.update({'event': event})321 322 # Potentially add metadata fields:323 fields = {}324 for item in index_extracted_fields:325 if item in payload['event'] and not isinstance(payload['event'][item], (list, dict, tuple)):326 fields[""meta_%s"" % item] = str(payload['event'][item])327 if fields:328 payload.update({'fields': fields})329 330 # If the osquery query includes a field called 'time' it will be checked.331 # If it's within the last year, it will be used as the eventtime.332 event_time = query_result.get('time', '')333 try:334 if (datetime.fromtimestamp(time.time()) - datetime.fromtimestamp(float(event_time))).days > 365:335 event_time = ''336 except Exception:337 event_time = ''338 finally:339 hec.batchEvent(payload, eventtime=event_time)340 341 hec.flushBatch()342 except Exception:343 log.exception('Error ocurred in splunk_nebula_return')344 return345",basepi/hubble,hubblestack/extmods/returners/splunk_nebula_return.py,Python,apache-2.0,7889346"// Copyright (c) 2012 The Chromium Authors. All rights reserved.347// Use of this source code is governed by a BSD-style license that can be348// found in the LICENSE file.349 350#ifndef CHROME_BROWSER_UI_VIEWS_TAB_ICON_VIEW_MODEL_H_351#define CHROME_BROWSER_UI_VIEWS_TAB_ICON_VIEW_MODEL_H_352 353namespace ui {354class ImageModel;355} // namespace ui356 357// Classes implement this interface to provide state for the TabIconView.358class TabIconViewModel {359 public:360 // Returns true if the TabIconView should show a loading animation.361 virtual bool ShouldTabIconViewAnimate() const = 0;362 363 // Returns the favicon to display in the icon view364 virtual ui::ImageModel GetFaviconForTabIconView() = 0;365 366 protected:367 virtual ~TabIconViewModel() {}368};369 370#endif // CHROME_BROWSER_UI_VIEWS_TAB_ICON_VIEW_MODEL_H_371",ric2b/Vivaldi-browser,chromium/chrome/browser/ui/views/tab_icon_view_model.h,C,bsd-3-clause,784372"//373// HealthKit.h374// HealthKit375//376// Copyright (c) 2013-2014 Apple Inc. All rights reserved.377//378 379#import <HealthKit/HKActivitySummary.h>380#import <HealthKit/HKActivitySummaryQuery.h>381#import <HealthKit/HKAnchoredObjectQuery.h>382#import <HealthKit/HKCategorySample.h>383#import <HealthKit/HKCorrelation.h>384#import <HealthKit/HKCorrelationQuery.h>385#import <HealthKit/HKDefines.h>386#import <HealthKit/HKDeletedObject.h>387#import <HealthKit/HKDevice.h>388#import <HealthKit/HKHealthStore.h>389#import <HealthKit/HKMetadata.h>390#import <HealthKit/HKObject.h>391#import <HealthKit/HKObjectType.h>392#import <HealthKit/HKObserverQuery.h>393#import <HealthKit/HKQuantity.h>394#import <HealthKit/HKQuantitySample.h>395#import <HealthKit/HKQuery.h>396#import <HealthKit/HKSample.h>397#import <HealthKit/HKSampleQuery.h>398#import <HealthKit/HKSource.h>399#import <HealthKit/HKSourceQuery.h>400#import <HealthKit/HKSourceRevision.h>401#import <HealthKit/HKStatistics.h>402#import <HealthKit/HKStatisticsCollectionQuery.h>403#import <HealthKit/HKStatisticsQuery.h>404#import <HealthKit/HKTypeIdentifiers.h>405#import <HealthKit/HKUnit.h>406#import <HealthKit/HKWorkout.h>407#import <HealthKit/HKWorkoutSession.h>408",rweichler/cylinder,deps/iPhoneOS9.3.sdk/System/Library/Frameworks/HealthKit.framework/Headers/HealthKit.h,C,mit,1159409 