input stringlengths 2.65k 237k | output stringclasses 1
value |
|---|---|
captured"
if not boot and "cloud_vv" not in obj_attr_list :
obj_attr_list["cloud_vv_uuid"] = "none"
else :
_xml_file = self.generate_libvirt_vv_template(obj_attr_list, boot)
obj_attr_list["last_known_state"] = "about to send volume create request"
if not boot :
obj_attr_list["cloud_vv_uuid"] = self.gene... | |
'''
Created on Mar 4, 2017
@author: Tuan
'''
'''
A work around for gathering (correspond to indexing on numpy array with another numpy array)
- Tensorflow couldn't run gradient for this
Issue: https://github.com/tensorflow/tensorflow/issues/206
Workaround: Turn the original params and indices to one dimension, then... | |
<gh_stars>10-100
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved
import inspect
import logging
from typing import Dict, List, Optional, Tuple, Union
import torch
from torch import nn
from detectron2.config import configurable
from detectron2.layers import ShapeSpec
from detectron2.modeling.roi_h... | |
"""Handle BIDS specific operations"""
import hashlib
import os
import os.path as op
import logging
import numpy as np
import re
from collections import OrderedDict
from datetime import datetime
import csv
from random import sample
from glob import glob
import errno
from .external.pydicom import dcm
from .parser impo... | |
from __future__ import print_function
import sys, time, sqlite3, string, json
from . import param
def db():
conn = sqlite3.connect('rss.db', 60.0)
conn.row_factory = sqlite3.Row
return conn
def rebuild_v_feed_stats(c):
sql = c.execute("select sql from sqlite_master where name='v_feeds_snr'")
if sql:
c.executesc... | |
is also possible to search for instructions in executable sections.
>>> binary = ELF.from_assembly('nop; mov eax, 0; jmp esp; ret')
>>> jmp_addr = next(binary.search(asm('jmp esp'), executable = True))
>>> binary.read(jmp_addr, 2) == asm('jmp esp')
True
"""
load_address_fixup = (self.address - self.load_addr)
... | |
# The is the main loop of loops: Channels, spatial streams (nss), bandwidth (bw), txpowers (tx)
# Note: supports 9800 and 3504 controllers
wlan_created = False
for ch in channels:
pathloss = args.pathloss
antenna_gain = args.antenna_gain
ch_colon = ch.count(":")
if (ch_colon == 1):
cha = ch.split(":")
pathloss... | |
# -*- coding: utf-8 -*-
import functools
import urlparse
import logging
import re
from dirtyfields import DirtyFieldsMixin
from include import IncludeManager
from django.db import models
from django.db.models import Q
from django.utils import timezone
from django.contrib.contenttypes.fields import GenericRelation
from... | |
<gh_stars>1000+
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# king_phisher/client/graphs.py
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# no... | |
table column and
that all other fields are empty as expected.
"""
field_values = self.default_field_values.copy()
dp_value = self.DatapointValue.objects.create(**field_values)
dp_value.save()
dp_value.value = 1
dp_value.save()
row = self.get_raw_values_from_db(dp_value_id=dp_value.id)
actual_value, actual_va... | |
<gh_stars>1-10
import cython
if not cython.compiled:
import z3
from disk import *
import errno
from stat import S_IFDIR
from collections import namedtuple
#from diskspec import Bitmap, DirLookup, Allocator32
from dirspec import *
#Disk = namedtuple('Disk', ['read', 'write'])
class Disk(object):
def __init__(self,... | |
forth.)
# # Selecting an L2 penalty via cross-validation
# Just like the polynomial degree, the L2 penalty is a "magic" parameter we need to select. We could use the validation set approach as we did in the last module, but that approach has a major disadvantage: it leaves fewer observations available for training. *... | |
",font=("Times New Roman",20),fg="#ffffff", bg="#37474f").place(x=50,y=100)
Button(self.ndb, text="Atras", command=self.AccederPestanaFunciones,font=("Times New Roman",15),fg="#102027",bg="red",width=10).place(x=650,y=100)
Button(self.ndb, text="Aceptar", command=self._ShowTB,font=("Times New Roman",15),fg="#102027... | |
<reponame>INCUS-Performance/ubxlib
#!/usr/bin/env python
'''A test agent that communicates with a controller and runs test instances.'''
from time import sleep
import os # For sep and getcwd() and makedirs()
from multiprocessing import Manager, freeze_support # To launch u_run_blah.py instances
import multiprocessing... | |
return json.dumps(value)
def deserialize(self, value):
"""
Decode numbers from JSON
"""
return json.loads(value)
class UTCDateTimeAttribute(Attribute):
"""
An attribute for storing a UTC Datetime
"""
attr_type = STRING
def serialize(self, value):
"""
Takes a datetime object and returns a string
"""
if... | |
optional
List of hidden dimensions of linear layers. Defaults to [16, ], i.e.
one linear layer with hidden dimension of 16.
"""
def init(self,
instance_normalize=False,
rnn='LSTM',
recurrent=[
16,
],
bidirectional=False,
linear=[
16,
],
pooling=None,
num_gabor_filters=64,
kernel_size=(25, 25),
stride=... | |
= None
def memento_cb(path):
resource_mementos_modes.setdefault(
oct(path.stat().st_mode & 0o777),
[]
).append(path.name)
resource_mementos = read_files(mementos_dir, cb=memento_cb)
check_products()
message_fname = res_dir / 'message.txt'
if message_fname.exists():
message = message_fname.read_text()
els... | |
"""
recreation_server_core
"""
import os
import math
from urllib2 import urlopen
import logging
from osgeo import ogr, osr, gdal
from psycopg2.extensions import register_adapter, AsIs
logging.basicConfig(format='%(asctime)s %(name)-20s %(levelname)-8s \
%(message)s', level=logging.DEBUG, datefmt='%m/%d/%Y %H:%M:%S ... | |
the merged data file
if "output" in mergekwargs:
het.write(mergekwargs["output"], overwrite=mergekwargs.get("overwrite", False))
if mergekwargs.get("remove", False):
# remove the inidividual files
for hf in filelist:
os.remove(hf)
return het
def heterodyne_merge_cli(**kwargs): # pragma: no cover
"""
Entry ... | |
from pyviability import libviability as lv
import heapq as hq
import functools as ft
import matplotlib.pyplot as plt
import mpl_toolkits.mplot3d as plt3d
import matplotlib.ticker as ticker
from matplotlib import animation
import numpy as np
import operator as op
import pickle
import signal
import sys
import warning... | |
<filename>venv/lib/python3.6/site-packages/ansible_collections/fortinet/fortios/plugins/modules/fortios_firewall_proxy_policy.py<gh_stars>1-10
#!/usr/bin/python
from __future__ import (absolute_import, division, print_function)
# Copyright 2019-2020 Fortinet, Inc.
#
# This program is free software: you can redistribute... | |
<gh_stars>1-10
from gevent import monkey
monkey.patch_all() # REALLY IMPORTANT: ALLOWS ZERORPC AND TG TO WORK TOGETHER
from telegram.ext import Updater, CommandHandler, MessageHandler, Filters, ConversationHandler, BaseFilter, \
CallbackContext, Filters, CallbackQueryHandler
from telegram import Update, InlineKeyboar... | |
<reponame>IsmaelElsharkawi/new_pororo_repo
from __future__ import print_function
from __future__ import division
import torch.nn as nn
from torchvision import models
import torch
from classifier.dataloader import ImageDataset, StoryImageDataset
from tqdm import tqdm
import numpy as np
from scipy.stats import en... | |
"id": "4ci2Yy43He9X5RPN8BwaMT",
"type": "track",
"uri": "spotify:track:4ci2Yy43He9X5RPN8BwaMT",
},
"name": "One Love - Edit",
"popularity": 39,
"preview_url": "https://p.scdn.co/mp3-preview/f963945638daea14a92acfe9318d58ca04b3e46a?cid=162b7dc01f3a4a2ca32ed3cec83d1e02",
"track": True,
"track_number": 10,
"type"... | |
"DEM_NoDataSinks"
params = [param0,param1,param2]
return params
def execute(self, parameters, messages):
from elevationTools import checkNoData
InGrid = parameters[0].valueAsText
tmpLoc = parameters[1].valueAsText
OutPolys_shp = parameters[2].valueAsText
checkNoData(InGrid, tmpLoc, OutP... | |
= ''
sec_sw = False
if result <= Unsat:
result = RESULT[result]
else:
result = super_prove()
if result[0] == 'SAT':
result = 'UNDECIDED'
print 'Total time = %d'%(time.time() - yy)
return result
def filter(opts):
global A_name,B_name
#temp for yen-sheng's examples
## return
#temp
## print 'Filtering with op... | |
not empty: %s' % (drive, self.drives[dr]['volume']))
Trace.log(e_errors.INFO, 'found %s in slot %s ...mounting' % (volume, self.slots[s]['address']))
if not self.test_unit_ready():
Trace.log(e_errors.ERROR, 'mount: Unit is not ready. Will try anyway')
rc = self.send_command('Load,%s,%s,%s' % (self.slots[s]['address... | |
<filename>train_segmentation.py
import torch
# import torch should be first. Unclear issue, mentioned here: https://github.com/pytorch/pytorch/issues/2083
import argparse
from pathlib import Path
import time
import h5py
import datetime
import warnings
import functools
from tqdm import tqdm
from collections import Order... | |
# values.py
"""Functions for converting values of DICOM data elements to proper python types
"""
# Copyright (c) 2010-2012 <NAME>
# This file is part of pydicom, relased under an MIT license.
# See the file license.txt included with this distribution, also
# available at https://github.com/darcymason/pydicom
from stru... | |
import inspect
import sys
from collections import deque
from collections import defaultdict
import textwrap
from . import version
from .cmdparse import CmdOption, CmdParse
from .exceptions import InvalidCommand, InvalidDodoFile
from .dependency import CHECKERS, DbmDB, JsonDB, SqliteDB, Dependency
from .action import C... | |
<filename>PHASEfilter/lib/utils/util.py<gh_stars>0
'''
Created on 13/11/2018
@author: mmp
'''
from Bio import SeqIO
import getpass, os, random, stat
import sys
class Utils(object):
'''
classdocs
'''
TEMP_DIR = os.getenv("TMP", "/tmp")
def __init__(self, project_name = None, temp_dir = None):
'''
param: pr... | |
<filename>lib/surface/composer/environments/create.py
# -*- coding: utf-8 -*- #
# Copyright 2017 Google LLC. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://ww... | |
<filename>subaligner/subtitle.py
import pysrt
import tempfile
import os
import re
import xml.etree.ElementTree as ElementTree
import inspect
from typing import Optional, List
from pysrt import SubRipFile, SubRipItem
from copy import deepcopy
from .utils import Utils
from .exception import UnsupportedFormatException
c... | |
<reponame>ComputerNetworks-UFRGS/ProgrammableLowEndNetworks
#!/usr/bin/env python2
import argparse, grpc, os, sys
from time import sleep
from scapy.all import *
from binascii import hexlify
import struct
# Import P4Runtime lib from parent utils dir
# Probably there's a better way of doing this.
sys.path.append(
os.pa... | |
<reponame>dcy652701/NumCpp
import numpy as np
from termcolor import colored
from functools import reduce
import os
import getpass
import sys
if sys.platform == 'linux':
sys.path.append(r'../lib')
else:
sys.path.append(r'../build/x64/Release')
import NumCpp
################################################... | |
return self._call_graph_storage
@property
def val_adapter(self) -> BaseValAdapter:
return self._val_adapter
@property
def rel_meta(self) -> RelMeta:
return self.rel_storage.meta
@property
def op_adapter(self) -> BaseOpAdapter:
return self.rel_meta.op_adapter
@property
def type_adapter(self) -> BaseTy... | |
cwlngth, T, PS)
np.testing.assert_allclose(a_ts_sdef, apd_ts_s_ref715, rtol=1e-6, atol=1e-6)
# case: user selected reference wavelength for scatter correction
a_ts_s700 = optfunc.opt_optical_absorption(a_ref, a_sig, traw, awlngth, a_off, Tcal,
tbins, tarr, cpd_ts, cwlngth, T, PS, ref_wave)
np.testing.assert_allcl... | |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# */AIPND/intropylab-classifying-images/check_images.py
#
# TODO: 0. Fill in your information in the programming header below
# PROGRAMMER: <NAME>
# DATE CREATED: 4/10/2018
# REVISED DATE: <=(Date Revised - if any)
# PURPOSE: Check images & report results: read them in, p... | |
[i] * len(dst)
surface_src.extend(src)
surface_dst.extend(dst)
valid_dist = list(surface_distances[i, dst])
surface_edge_distances.extend(valid_dist)
valid_dist_np = surface_distances[i, dst]
sigma = np.array([1., 2., 5., 10., 30.]).reshape((-1, 1))
weights = softmax(- valid_dist_np.reshape((1, -1)) ** 2 / sigm... | |
import time
from unittest import mock
import pytest
from django.contrib.auth.models import AnonymousUser
from django.core.exceptions import ValidationError
from django.db import IntegrityError
from django.http import Http404
from django.test import RequestFactory, TestCase
from django.urls import reverse
from wagtail.... | |
<gh_stars>0
# -*- coding: utf-8 -*-
"""
Created on Dec 27, 2015
@author: <NAME>
@copyright: MIT License
"""
# NOTE: changed in 1.01 - using the print() function
from __future__ import print_function
# NOTE: new in 1.01 - import the sys module
import sys
import pygame
import json
import os
import apps
from types imp... | |
#!/usr/bin/env python
# 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.
"""Makes sure files have the right permissions.
Some developers have broken SCM configurations that flip the executable
permission... | |
124.202, 121.166, 118.198, 115.298, 112.468, 109.71, 107.029, 104.429, 101.917, 99.4996, 97.1863, 94.9867, 92.9114, 90.9717, 89.1792, 87.5452, 86.0808, 84.7974, 83.7085, 82.8349, 82.2181, 81.9493, 82.1946, 83.0626, 84.4297, 86.1158, 88.0175, 90.0838, 92.2873, 94.612, 97.0476, 99.5878, 102.23, 104.972, 107.819, 110.774,... | |
= Var(within=Reals,bounds=(0.0001,500),initialize=1)
m.x598 = Var(within=Reals,bounds=(0.0001,500),initialize=1)
m.x599 = Var(within=Reals,bounds=(0.0001,500),initialize=1)
m.x600 = Var(within=Reals,bounds=(0.008593,0.008593),initialize=0.008593)
m.x601 = Var(within=Reals,bounds=(0.0001,500),initialize=1)
m.x602 = Var(... | |
{
'status': {'key': 'status', 'type': 'str'},
'description': {'key': 'description', 'type': 'str'},
'actions_required': {'key': 'actionsRequired', 'type': 'str'},
}
def __init__(
self,
**kwargs
):
super(PrivateLinkServiceConnectionState, self).__init__(**kwargs)
self.status = kwargs.get('status', None)
self... | |
<filename>ktane/vanilla.py<gh_stars>1-10
"Solver scripts for all vanilla modules."
from typing import Final, List, NamedTuple, Tuple, Dict, Counter
from ktane.directors import ModuleSolver, EdgeFlag, Port
from ktane.ask import talk
from ktane import ask
from ktane.solverutils import morse, maze, grid # MorseCode, Ma... | |
["Rg"]:
return_index = False
if "--match-path" in self._arguments:
filter_method = partial(fuzzyEngine.fuzzyMatch, engine=self._fuzzy_engine, pattern=pattern,
is_name_only=True, sort_results=True)
else:
filter_method = partial(fuzzyEngine.fuzzyMatchPart, engine=self._fuzzy_engine, pattern=pattern, category=fuzzyE... | |
<reponame>vingtfranc/LoLAnalyzer
#!python
# Evaluate the best pick for the given role and team
import os
import sys
from PyQt5.QtCore import Qt
import numpy as np
from PyQt5.QtWidgets import *
from collections import OrderedDict
import Modes
import Networks
sys._excepthook = sys.excepthook
class UnrecognizedMode(... | |
'.join([
_('Expiration date of your request.'),
_('This information is seen by the recipient if you send them a signed payment request.'),
_('Expired requests have to be deleted manually from your list, in order to free the corresponding Ciphscoin addresses.'),
_('The Ciphscoin address never expires and will always... | |
self.find_subscribers_for(old_node_name):
self.node_change_provider(n, new_node_name)
def find_provider(self, node_name):
if self.node_alive(node_name):
info = self.get_node_info(node_name)
return info.provider_node
nodelist = self.queue_info.member_map.keys()
for n in nodelist:
if n == node_name:
continue
i... | |
#!/usr/bin/env pytest
###############################################################################
# $Id$
#
# Project: GDAL/OGR Test Suite
# Purpose: Test OGR Memory driver functionality.
# Author: <NAME> <<EMAIL>>
#
###############################################################################
# Copyright (c) 2003... | |
<filename>tensorflow_estimator/python/estimator/head/binary_class_head.py<gh_stars>1-10
# Copyright 2018 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the Lice... | |
<filename>rodan/test/views/test_workflow.py
from django.conf import settings
from rodan.models import Workflow, InputPort, OutputPort, ResourceType
from rest_framework import status
from rest_framework.reverse import reverse
from rest_framework.test import APITestCase
from model_mommy import mommy
from rodan.test.hel... | |
with open(input, 'r') as bedfile:
for line in bedfile:
line = line.strip()
if line.startswith('\n'):
continue
contig, start, end, name = line.split('\t')
start = int(start) + 1 # bed is 0-based, gff 1-based
outfile.write(
'{:}\tRepeatMasker\tdispersed_repeat\t{:}\t{:}\t.\t+\t.\tID={:}\n'.format(contig, start, e... | |
# -------------------------------------------------------------------------
@staticmethod
def parse_expression(key):
"""
Parse a URL expression
@param key: the key for the URL variable
@return: tuple (selectors, operator, invert)
"""
if key[-1] == "!":
invert = True
else:
invert = False
fs = key.rstrip("!... | |
cur_pred[0] == ta_name[0]:
cur_batch = sub_batch
break
## calculate loss
y_ind = 0
for y_ind, ta_name in enumerate(cur_batch['task_list']):
if cur_pred[0] == ta_name[0]:
break
y_ref = 'y_' + str(y_ind)
y_row_ref = 'y_row_' + str(y_ind)
if self.config.train_by_log_softmax:
pred_softmaxed = F.log_softmax(cur_p... | |
At this point there are no conflicts with the existing log
############################################################
############################################################
# If the output_fname already exists, overwrite must be set to True
# A special message is printed if this exception is raised by the
... | |
\
as JSONSchemaValidatorDe3CecD62E5153881245A8613Fbeea_v3_1_1
from .validators.v3_1_1.jsd_d0006cc03d53c89a3593526bf8dc0f \
import JSONSchemaValidatorD0006CC03D53C89A3593526Bf8Dc0F \
as JSONSchemaValidatorD0006CC03D53C89A3593526Bf8Dc0F_v3_1_1
from .validators.v3_1_1.jsd_a0710ba581da4d3fd00e84d59e3 \
import JSONSchem... | |
import dill
import os
import random
import sys
from auto_ml import utils
from auto_ml import utils_categorical_ensembling
from sklearn.ensemble import RandomForestClassifier, RandomForestRegressor, ExtraTreesRegressor, AdaBoostRegressor, GradientBoostingRegressor, GradientBoostingClassifier, ExtraTreesClassifier, Ada... | |
None:
self.AiRecognitionTask = AiRecognitionTaskInput()
self.AiRecognitionTask._deserialize(params.get("AiRecognitionTask"))
if params.get("MiniProgramPublishTask") is not None:
self.MiniProgramPublishTask = WechatMiniProgramPublishTaskInput()
self.MiniProgramPublishTask._deserialize(params.get("MiniProgramPublish... | |
* cs_data) * 1
index_list = list()
data_list = list()
for image_key in list(data_tuple[0].keys()): # go through all images of the day
# Create time range
begin = dt.datetime.strptime(image_key, '%Y-%m-%d %H:%M:%S')
end = begin + dt.timedelta(seconds=look_ahead_sec)
if diff.index[-1] >= end: # as long as ... | |
t.lexer.lexpos)
nodoE2 = t[4]
nodo.hijos.append(nodoE)
nodo.hijos.append(nodoI)
nodo.hijos.append(nodoE2)
t[0] = nodo
# ALTER DATABASE name RENAME TO new_name
def p_instruccion_alter_database1(t):
'''instruccion : ALTER DATABASE ID RENAME TO ID PUNTO_COMA
'''
nodo = crear_nodo_general("ALTER DATABASE","",t.lex... | |
import coloredlogs
from colorama import Fore
import contextlib
import logging
import verboselogs
from datetime import datetime
import os
import json
import ffmpeg
import praw
from pprint import pprint
import re
import requests
from tqdm import tqdm
import urllib.request
import youtube_dl
from saveddit.configuration imp... | |
<gh_stars>1-10
from types import SimpleNamespace
from more_itertools import side_effect
import bittensor
from substrateinterface.base import Keypair
import unittest
from unittest.mock import MagicMock
from substrateinterface.exceptions import SubstrateRequestException
from bittensor._subtensor.subtensor_mock import m... | |
<filename>release/scripts/freestyle/modules/freestyle/chainingiterators.py<gh_stars>100-1000
# ##### BEGIN GPL LICENSE BLOCK #####
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either versio... | |
<filename>lib/id3c/cli/command/geocode.py
"""
Geocode addresses into longitude/latitude.
Input addresses must be in a tabular data format (CSV, TSV, or Excel) with only
one address per row.
Geocoding is performed by submitting addresses (with no other information) to
an external service called SmartyStreets. A Smarty... | |
<filename>weeklypedia/tbutils.py
# -*- coding: utf-8 -*-
"""Extract, format and print information about Python stack traces."""
from __future__ import print_function
import re
import sys
import linecache
# TODO: cross compatibility (jython, etc.)
# TODO: parser
# TODO: chaining primitives? what are real use cases w... | |
<filename>pysurge/pysurge.py<gh_stars>0
import logging
import multiprocessing
import os
import queue
import signal
import sys
import threading
import time
from concurrent.futures import ThreadPoolExecutor
from pydoc import locate
log = logging.getLogger(__name__)
class TestCase:
"""
Base class for a test case tha... | |
abs has enough time to next cex'
frames_to_next_cex = cex_abs_depth - abs_depth
div = time_abs - time_abs_prev
div = max(.1,div)
frames_per_sec = (abs_depth - abs_depth_prev)/div
if frames_per_sec <= 0:
return False #something wrong
## print 'frames_per_sec = %0.2f, frames_to_next_cex = %d, time remaining = %0.2... | |
column= 6, padx= (padding_2, padding_1))
australia_txt.grid(row= 10, column= 5)
australia_label.grid(row= 10, column= 6, padx= (padding_2, padding_1))
new_zealand_txt.grid(row= 11, column= 5)
new_zealand_label.grid(row= 11, column= 6, padx= (padding_2, padding_1))
def main_loop():
global dates
global t_string
glo... | |
re.searc# OK h(r'\{.*?\}', layoutmessage)
# OK print(numstr)
# OK print('-return value-')
# OK print(layout)
return layout
def get_int_value(message, base):
""" Converts a field from a str message to a number
From a string of the form "varname=val" returns only the value in hex
Parameters
----------
mes... | |
'''
This class uses access the PI web API through Python
It replicates the functions of PI datalink excel Add-on (Windows only) in Python
Some features may be UC Davis specific, but can easily be extended to other PI installations
v.0.6
-fixed timezone bug
v0.5
-reorganized code: help methods first
-added path sea... | |
'.',desc='Try to type it quickly, I\'ve probably got other people to help out...')
Intent('Waiting on a note...')
await msg.edit(
embed=embedVal,
components = []
)
def check(message: discord.Message):
return message.author == name
notemsg = await bot.wait_for('message', check=check)
noteContents = notemsg.cont... | |
+ CONSTANT_TYPE+ABSOLUTE_)
assert_equal(myDisasm.Argument3.ArgSize, 8)
assert_equal(myDisasm.Argument3.AccessMode, READ)
assert_equal(myDisasm.CompleteInstr, 'cmpeqps xmm0, xmmword ptr [rax]')
Buffer = b'\x0F\xC2\x00\x01\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11'
myDisasm = DISASM()
myDisasm.Archi = 64
Target = c... | |
projects"""
for project in projects:
project.delete()
self.projects.pop(self.projects.index(project))
self.save()
def close_unrelated_projects(self, projects):
"""Close unrelated projects"""
unrelated_projects = []
for project in projects:
for proj in self.projects:
if proj is project:
continue... | |
<reponame>rpindale/pytorch
# Copyright (c) Facebook, Inc. and its affiliates. All rights reserved.
#
# This source code is licensed under the BSD license found in the
# LICENSE file in the root directory of this source tree.
import collections
import copy
import io
from itertools import chain
from typing import Any, C... | |
<filename>productores/views.py
# -*- coding: utf-8 -*-
from django.shortcuts import render
from .models import *
from .forms import *
import json as simplejson
from django.http import HttpResponse,HttpResponseRedirect
from django.db.models import Sum, Count, Avg, F
import collections
from django.contrib.auth.decorators... | |
from direct.gui.DirectGui import *
from pandac.PandaModules import *
from pirates.piratesgui import PiratesGuiGlobals
from pirates.makeapirate import JewelryGlobals
from pirates.pirate import HumanDNA
from pirates.uberdog.UberDogGlobals import InventoryType
from pirates.inventory import ItemGlobals
from pirates.pirates... | |
""" Cisco_IOS_XR_sysadmin_fm
This module contains definitions
for the Calvados model objects.
This module contains a collection of YANG
definitions for Cisco IOS\-XR SysAdmin configuration.
Fault management YANG model.
Copyright(c) 2014\-2017 by Cisco Systems, Inc.
All rights reserved.
Copyright (c) 2012\-2017 b... | |
coordinate of the center of mass
dfile.create_dataset("yc", data=ycs) # y coordinate of the center of mass
dfile.create_dataset("rs", data=rs) # central radii of the shells
for m in range(mmax + 1):
group = dfile.create_group("m=%d" % m)
group["int_phi"] = np.array(mmodes[m]) # NOT USED (suppose to be data for eve... | |
<reponame>bss-aero/cubesat-ttc-utils<gh_stars>1-10
import matplotlib as mpl
from matplotlib import pyplot as plt
# Graph Options
OUTPUT_PATH = r'../images/'
USE_PGF = True
PAGE_WIDTH = 6.296
SIZE_FULLPAGE = (PAGE_WIDTH, 9)
SIZE_TALL = (PAGE_WIDTH, 5)
SIZE_DEFAULT = (PAGE_WIDTH, 3)
SIZE_SHORT = (PAGE_WIDTH, 1.25)
X_RES... | |
EdkLogger.Error("Unicode File Parser",
ToolError.FILE_OPEN_FAILURE,
"File read failure: %s" % str(Xstr),
ExtraData=File)
LineNo = GetLineNo(FileIn, Line, False)
EdkLogger.Error("Unicode File Parser",
ToolError.PARSER_ERROR,
"Wrong language definition",
ExtraData="""%s\n\t*Correct format is like '#langdef en-US ... | |
<reponame>iandees/py-mapzen-whosonfirst-utils
import shapely.geometry
import requests
import geojson
import json
import os
import os.path
import logging
import re
import time
import shutil
import types
import datetime
import copy
import inspect
import sys
import signal
import multiprocessing
import hashlib
import m... | |
<reponame>MIPS/external-chromium_org<filename>tools/bisect-builds.py
#!/usr/bin/env python
# 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.
"""Snapshot Build Bisect Tool
This script bisects a snapshot ... | |
@builtins.property # type: ignore[misc]
@jsii.member(jsii_name="attrDefaultUserKubeConfig")
def attr_default_user_kube_config(self) -> ros_cdk_core.IResolvable:
'''Attribute DefaultUserKubeConfig: Default user kubernetes config which is used for configuring cluster credentials.'''
return typing.cast(ros_cdk_core.IR... | |
f_max=f_max, df_max=df_max,
make_plot=make_plot, flux_ramp=flux_ramp,
fraction_full_scale=fraction_full_scale, lms_freq_hz=lms_freq_hz,
reset_rate_khz=reset_rate_khz,
feedback_start_frac=feedback_start_frac,
feedback_end_frac=feedback_end_frac,
setup_flux_ramp=setup_flux_ramp)
@set_action()
def eta_phase_check... | |
foundSyms is not None:
# we have a list of tuples (key, symbol, bitpattern)
OPTIONS.debug(3, " .. found # of tuples:", len(foundSyms))
for (foundKey, foundSymbol, foundBitpattern) in foundSyms:
if foundKey != rawkey:
# UUPS!
OPTIONS.error(104, "Found symbol key mismatch with dictionary!")
continue
l.append((fou... | |
self.force is not None and self.duration >= 0:
# self.duration -= 1
# self.skeletons[2].body('h_spine').add_ext_force(self.force)
#a = self.skeletons[2].get_positions()
self.skeletons[3].set_positions(self.curr_state.angles)
# self.skeletons[3].set_positions(np.zeros(skel.ndofs))
if self.curr_state.dt < self.tim... | |
from __future__ import division
#kivy modules
from kivy.app import App
from kivy.animation import Animation
from kivy.clock import Clock
from kivy.base import EventLoop
from kivy.core.window import Window
from kivy.core.image import Image
from kivy.graphics.instructions import RenderContext
from kivy.graphics import... | |
best_index:
if index == size - 1 or best_index == size:
best_index = index
best_element = link.code_element
# Otherwise, frequency is equivalent and it's not good!
elif package_freq[index][1] >\
package_freq[best_index][1]:
best_index = index
best_element = link.code_element
# Compare depth!
else:
depth_best... | |
iteration, default is 1.5e-3")
gp.add_argument("--geo-opt-rms-force", type=float, default=3.00000000E-004,
help="Convergence criterion for the root mean square (RMS) force of the current configuration.")
# MOTION/MD
# --------------------------------------------------------------------------
gp = subpars... | |
import logging
from typing import Any, List, Union
from urllib.parse import urlparse
import discord
import feedparser
from discord.ext import commands
from schema import SchemaError
from naotimes.bot import naoTimesBot
from naotimes.context import naoTimesContext
from naotimes.showtimes import FansubRSS, FansubRSSEmb... | |
import numpy as np
import scipy as sp
from pyabc.distance import (
PercentileDistance,
MinMaxDistance,
PNormDistance,
AdaptivePNormDistance,
AggregatedDistance,
AdaptiveAggregatedDistance,
NormalKernel,
IndependentNormalKernel,
IndependentLaplaceKernel,
BinomialKernel,
PoissonKernel,
NegativeBinomialKernel,... | |
<filename>dependencies/CeguiDependencies/src/src/devil-1.7.8/projects/python/DevIL-Windows.py<gh_stars>10-100
from ctypes import *
_stdcall_libraries = {}
_stdcall_libraries['DevIL'] = WinDLL('DevIL')
STRING = c_char_p
IL_LOAD_EXT = 7937 # Variable c_int
IL_TGA_CREATE_STAMP = 1808 # Variable c_int
IL_PAL_RGB24 = 102... | |
from __future__ import print_function
import torch
import torch.nn as nn
from new_layers import *
from utils import get_flat_fts
from copy import deepcopy
import torch.nn.functional as F
import torch.nn.init as init
class L0LeNet5(nn.Module):
def __init__(self, num_classes, input_size=(1, 28, 28), conv_dims=(20, 50),... | |
#---------------------------------------------------
if len(this_line)<5 and line_number!=0:
new_line=[]
for i in range(len(this_line)):
if i>1 and "-" in this_line[i]:
tmp=this_line[i].replace("-"," -")
tmp1=tmp.split()
for i in range(len(tmp1)):
new_line.append(tmp1[i])
else:
new_line.append(this_line[i])
... | |
not None and self.selected_tile is not None:
self.sv_current_grid = self.selected_grid
self.sv_current_tile = self.selected_tile
self.comboBox_gridSelectorSV.blockSignals(True)
self.comboBox_gridSelectorSV.setCurrentIndex(self.selected_grid)
self.comboBox_gridSelectorSV.blockSignals(False)
self.sv_update_tile_sel... | |
* case the 'fields' and 'basis' parameters should be populated. The 'fields'
* parameter (one of NX_HASH_FIELDS_*) designates which parts of the flow to
* hash. Refer to the definition of "enum nx_hash_fields" for details. The
* 'basis' parameter is used as a universal hash parameter. Different values
* of 'basis' ... | |
from pywinauto import Application, keyboard, findwindows
from pywinauto.base_wrapper import ElementNotEnabled
import pywintypes
import pywinauto
import warnings
import pyautogui
from pywinauto import mouse
import time
import os
import shutil
import numpy as np
computer = "desktop"
# Note that if running this script ... | |
from swsscommon import swsscommon
import time
import json
import random
import pytest
from pprint import pprint
def create_entry(tbl, key, pairs):
fvs = swsscommon.FieldValuePairs(pairs)
tbl.set(key, fvs)
time.sleep(1)
def create_entry_tbl(db, table, separator, key, pairs):
tbl = swsscommon.Table(db, table)
cre... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.