input stringlengths 2.65k 237k | output stringclasses 1
value |
|---|---|
## Author: <NAME> <EMAIL>
## 2021-june-12 update:
## use ReplaceDataSource for layer (NOT findAndReplaceWorkspacePath) to support change of dataset name, with manual string match and replace to support parttial change of workpath
## work for stretched, classified and unique value raster & feature class, but might take ... | |
1j * t_values[25]))
+ (R27 / (1 + w * 1j * t_values[26]))
+ (R28 / (1 + w * 1j * t_values[27]))
+ (R29 / (1 + w * 1j * t_values[28]))
+ (R30 / (1 + w * 1j * t_values[29]))
+ (R31 / (1 + w * 1j * t_values[30]))
+ (R32 / (1 + w * 1j * t_values[31]))
+ (R33 / (1 + w * 1j * t_values[32]))
+ (R34 / (1 + w * 1j * t_v... | |
#!/usr/bin/env python
"""
Parse a MAVLink protocol XML file and generate Swift implementation
Copyright <NAME> 2015
Released under GNU GPL version 3 or later
"""
from __future__ import print_function
import os
from . import mavtemplate
abbreviations = ["MAV", "PX4", "UDB", "PPZ", "PIXHAWK", "SLUGS", "FP", "ASLUAV", ... | |
HSM client certificate. If no certificate ID is specified, returns information about all the HSM certificates owned by your AWS customer account.
If you specify both tag keys and tag values in the same request, Amazon Redshift returns all HSM client certificates that match any combination of the specified keys and val... | |
<gh_stars>0
# Initialize tables
from database_helpers.psql_start import *
def create_table_test():
""" create test table """
commands = [
"""
CREATE TABLE test_tb (
analysis_ts TIMESTAMP NOT NULL,
n_drive_user VARCHAR NOT NULL,
animal_id VARCHAR NOT NULL,
session_ts TIMESTAMP NOT NULL,
PRIMARY KEY (n_drive... | |
#------------------------------------------------------------------------------
# Copyright (c) 2013-2018, Nucleic Development Team.
#
# Distributed under the terms of the Modified BSD License.
#
# The full license is in the file COPYING.txt, distributed with this software.
#--------------------------------------------... | |
ExpectedException(BadRequest):
self.api.firewall_rule_create(fr)
def test_update_firewall_rule_with_or_without_defined_services(self):
project = Project('project-%s' % self.id())
self.api.project_create(project)
fr1 = FirewallRule(name='fr1-%s' % self.id(), parent_obj=project)
fr1.set_service(FirewallServiceType... | |
<reponame>josephpcox/udivs-backend
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sat Oct 27 23:11:33 2018
@author: tom
@author: joe
"""
import pandas as pd
import random
import numpy as np
from operator import itemgetter
from datetime import datetime, timedelta
import math
import csv
import os.path
#im... | |
<gh_stars>1-10
# GENERATED FILE - DO NOT EDIT THIS FILE UNLESS YOU ARE A WIZZARD
#pylint: skip-file
from heat.engine import properties
from heat.engine import constraints
from heat.engine import attributes
from heat.common.i18n import _
from avi.heat.avi_resource import AviResource
from avi.heat.avi_resource import Avi... | |
# Referee for COMP30024: Artificial Intelligence, 2018
# Authors: <NAME> and <NAME>
# version: v1.0
import time
import argparse
import importlib
VERSION_INFO = """Referee version 1.1 (released Apr 08 2018)
Plays a basic game of Watch Your Back! between two Player classes
Run `python referee.py -h` for help and additi... | |
instanceTenantId(string): SNMPv2ReadCommunityDTO's instanceTenantId.
instanceUuid(string): SNMPv2ReadCommunityDTO's instanceUuid.
readCommunity(string): SNMPv2ReadCommunityDTO's readCommunity.
headers(dict): Dictionary of HTTP Headers to send with the Request
.
payload(dict): A JSON serializable Python object to s... | |
<reponame>ContinuumIO/chaco
""" Defines the LineSegmentTool class.
"""
from __future__ import with_statement
# Major library imports
from numpy import array
# Enthought library imports
from enable.api import Component, Pointer, Line
from traits.api import Any, Bool, Enum, Instance, Int, List, Trait, Tuple
# Chaco im... | |
import time, os, gc, sys, copy
import cPickle as pickle
import numpy as np
from numpy import pi
import pylab as plt
import VyPy
from VyPy.regression import gpr
from VyPy.tools import atleast_2d
from mpl_toolkits.mplot3d import Axes3D
from matplotlib import cm
import matplotlib.pyplot as plt
from ... | |
<reponame>lucasb-eyer/playground
from collections import defaultdict
from enum import Enum
import itertools
import random
import numpy as np
from ..characters import Flame
RENDER_FPS = 15
BOARD_SIZE = 13
NUM_RIGID = 50
NUM_WOOD = 50
NUM_ITEMS = int(NUM_WOOD/2)
AGENT_VIEW_SIZE = 4
TIME_LIMIT = 3000
HUMAN_FACTOR = 32
... | |
import glob
import inspect as ins
from pprint import pprint
import sys, os, re
import logging
import jieba
import functools
# 配置logging
logging.basicConfig(
level=logging.INFO,
format='%(filename)s:%(lineno)d - %(message)s',
handlers=[
#logging.FileHandler("ke.log", mode="a"), # for logs write in file(mode:a为追加log... | |
"""
Swaggy Jenkins
Jenkins API clients generated from Swagger / Open API specification # noqa: E501
The version of the OpenAPI document: 1.1.2-pre.0
Contact: <EMAIL>
Generated by: https://openapi-generator.tech
"""
import re # noqa: F401
import sys # noqa: F401
from swaggyjenkins.api_client import ApiClient, ... | |
out_onion[O_ICMP].set_icmp_seq(0) # this is not currently supported by nmap, but I've done it already
else:
try: out_onion[O_ICMP].set_icmp_seq(int(si, 16)) # this is not supported either by nmap
except: raise Exception('Unsupported IE(SI=%s)' % si)
# assume CD = S
try: cd = f['CD']
except: cd = 'S'
if cd == ... | |
from test.lib.testing import eq_, ne_
import operator
from sqlalchemy.orm import dynamic_loader, backref
from test.lib import testing
from sqlalchemy import Integer, String, ForeignKey, desc, select, func
from test.lib.schema import Table, Column
from sqlalchemy.orm import mapper, relationship, create_session, Query, a... | |
speed up messy
# compares by a factor of 3.
# note that ratio() jest only expensive to compute the first
# time it's called on a sequence pair; the expensive part
# of the computation jest cached by cruncher
jeżeli cruncher.real_quick_ratio() > best_ratio oraz \
cruncher.quick_ratio() > best_ratio oraz \
crunche... | |
you are invoking. You can then process the client information in your Lambda function as you choose through the context variable.
- **Qualifier** *(string) --*
(Optional) Specify a Lambda function version or alias name. If you specify a function version, the action uses the qualified function ARN to invoke a specifi... | |
<reponame>ClericPy/ichrome
import asyncio
import random
import time
import typing
from base64 import b64decode
from copy import deepcopy
from . import AsyncChromeDaemon, AsyncTab
from .base import ensure_awaitable
from .exceptions import ChromeException
from .logs import logger
class ChromeTask(asyncio.Future):
"""... | |
# Generated by h2py from COMMCTRL.H
WM_USER = 1024
ICC_LISTVIEW_CLASSES = 1 # listview, header
ICC_TREEVIEW_CLASSES = 2 # treeview, tooltips
ICC_BAR_CLASSES = 4 # toolbar, statusbar, trackbar, tooltips
ICC_TAB_CLASSES = 8 # tab, tooltips
ICC_UPDOWN_CLASS = 16 # updown
ICC_PROGRESS_CLASS = 32 # progress
ICC_HOT... | |
<reponame>lanPN85/espresso
# Copyright (c) <NAME>
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import math
import torch
import torch.nn as nn
import torch.nn.functional as F
from fairseq import options, utils
from fairseq.data import Tok... | |
#!/usr/bin/env python
import types, sys, os, math, json
import transform2, utilities
import community as com
import time
#
# global variables: search counter and community object
#
search_counter = 0
community_obj = []
#
# run bitcode file with the current
# search configuration
# return 1 bitcode file is valid
# 0 ... | |
+
0.5*m.b354*m.b472 + 0.5*m.b354*m.b474 + 0.5*m.b354*m.b480 + 0.5*m.b354*m.b492 + 0.5*m.b354*m.b493
+ 0.5*m.b354*m.b500 + m.b354*m.b515 + 0.5*m.b354*m.b537 + 0.5*m.b354*m.b555 + 0.5*m.b354*m.b566
+ 0.5*m.b354*m.b582 + 0.5*m.b354*m.b614 + 0.5*m.b354*m.b619 + 0.5*m.b354*m.b632 + m.b354*m.b633
+ 0.5*m.b354*m.b645 + 0... | |
# objects tt are part of this node
def _getComponents(self):
c = []
c = c + self.componentList
return c
class Technical(MusicXMLElementList):
'''
Class for the <technical> musicxml mark which contains
things like <up-bow> etc. objects
'''
def __init__(self, type=None): # @ReservedAssignment
MusicXMLEleme... | |
<reponame>marcusbooyah/couchbase-cli<gh_stars>0
"""A Couchbase CLI subcommand"""
import getpass
import inspect
import json
import os
import random
import re
import string
import subprocess
import sys
import urlparse
import time
from argparse import ArgumentError, ArgumentParser, HelpFormatter, Action, SUPPRESS
from c... | |
import time
import threading
import requests
L = 'http://localhost:8001'
TIMEOUT = 5
def make_request(method):
method = getattr(requests, method)
def req(path, *a, type=None, headers=None, **kw):
if 'timeout' not in kw:
kw['timeout'] = TIMEOUT
if type:
if not headers:
headers = {}
headers['Type'] = type
... | |
the curve at the input parametric coordinate.
This method splits the curve into two pieces at the given parametric coordinate, generates two different
curve objects and returns them. It does not modify the input curve.
Keyword Arguments:
* ``find_span_func``: FindSpan implementation. *Default:* :func:`.helpers.fi... | |
= np.float32)
std = np.zeros((len(mean_ngammafesc_array[model_number][snapshot_idx])), dtype=np.float32)
for i in range(0, len(mean)):
if(mean_ngammafesc_array[model_number][snapshot_idx][i] < 1e-10):
mean[i] = np.nan
std[i] = np.nan
else:
mean[i] = np.log10(mean_ngammafesc_array[model_number][snapshot_idx][i]... | |
CO., LTD",
"000866": "DSX Access Systems, Inc.",
"000867": "Uptime Devices",
"000868": "PurOptix",
"000869": "Command-e Technology Co.,Ltd.",
"00086A": "Securiton Gmbh",
"00086B": "MIPSYS",
"00086C": "Plasmon LMS",
"00086D": "Missouri FreeNet",
"00086E": "Hyglo AB",
"00086F": "Resources Computer Net... | |
${ElseIf} $3 == HKCU
WriteRegExpandStr ${hkcu_current_user} $1 $0 ; Write it to current user section
${EndIf}
IfErrors 0 +4
MessageBox MB_OK|MB_ICONEXCLAMATION "Could not write updated $1 to $3" /SD IDOK
DetailPrint "Could not write updated $1 to $3"
Goto EnvVarUpdate_Restore_Vars
; "Export" our chang... | |
<reponame>ljlok/mongo-python-driver
# Copyright 2009-2014 MongoDB, Inc.
#
# 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://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by a... | |
deregister is implemented
# self.pg0.get_capture(nr_packets)
def test_punt_socket_traffic_multi_ports_multi_sockets(self):
""" Punt socket traffic multi ports and multi sockets"""
punt_l4 = mk_vpp_cfg6()
# configuration for each UDP port
cfgs = dict()
#
# create stream of packets for each port
#
for port ... | |
of sequence number
"""
if sn is None:
if snh is None:
sn = 0
else:
sn = int(snh, 16)
if raw is None and qb64b is None and qb64 is None and qb2 is None:
raw = sn.to_bytes(Matter._rawSize(MtrDex.Salt_128), 'big')
super(Seqner, self).__init__(raw=raw, qb64b=qb64b, qb64=qb64, qb2=qb2,
code=code, **kwa)
if se... | |
if any element is such a value. The computations follow
IEEE Standard 754.
Parameters
----------
x : int or float
The minuend.
y : int or float
The subtrahend.
Returns
-------
float or int :
The computed result.
"""
return x - y if x is not None and y is not None else None
@staticmethod
def exec_np(... | |
plot_trigger:
plt.figure()
plt.plot(ts, trans_data)
plt.plot(ts0, trans_data1, "o")
trans_data = trans_data1
if not sn in self.d0s.keys():
self.d0s[s] = {}
self.d0s[s]["trans"] = trans_data
# these are the datasets that needs updated trans values
# also need to rescale merged data, in case it's been scale, ... | |
<reponame>mderoy/nzpy<filename>nzpy/handshake.py
from nzpy import core
from os import getpid, path
from hashlib import md5
from hashlib import sha256
import base64
from platform import system
from getpass import getuser
from socket import gethostname
from sys import argv
import logging
#CP Version
CP_VERSION_1 = 1
CP_... | |
# -*- coding: utf-8 -*-
# PyMeeus: Python module implementing astronomical algorithms.
# Copyright (C) 2018 <NAME>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation, either version 3 of ... | |
<filename>huffman.py
#
# Compression software using a Canonical Huffman code
# https://en.wikipedia.org/wiki/Canonical_Huffman_code
#
# Usage:
# Compress: python huffman.py -i input_file -o output_file
# Decompress: python huffman.py -d -i input_file -o output_file
#
# The softare uses an alphabet of 257 symbols - 2... | |
import scipy.stats as st
from sklearn import metrics
from sklearn.metrics import auc
import matplotlib.pyplot as plt
#import tensorflow as tf
import tensorflow.compat.v1 as tf
tf.disable_v2_behavior()
import tensorflow_addons as tfa
import math
import sys
import os.path as osp
import numpy as np
import PIL.Image
import... | |
= property(__get_name, __set_name)
def __get_description(self):
try: # @return: const std::string&
return py2unicode(self.obj.description())
except ValueError:
return None
def __set_description(self, arg):
try:
value = py2str(arg)
except Exception as e:
logs.error(str(e))
return
if self.__get_description()... | |
<reponame>SemanticPriming/word2manylanguages
import bz2
import html
import numpy as np
import os
import pandas as pd
import re
import requests
import simhash
import sklearn.linear_model
import sklearn.model_selection
import sklearn.preprocessing
import sklearn.utils
import zipfile
from lxml import etree
from gensim.mod... | |
17: ((22, HIGH), ),
18: ((21, HIGH), (29, HIGH)),
19: ((20, HIGH), (29, HIGH)),
}
GPIO_MUX_INPUT = GPIO_MUX_OUTPUT
GPIO_MUX_INPUT_PULLUP = GPIO_MUX_OUTPUT
GPIO_MUX_INPUT_PULLDOWN = GPIO_MUX_OUTPUT
GPIO_MUX_ANALOG_INPUT = {
14: ((37, LOW), ),
15: ((36, LOW), ),
16: ((23, LOW), ),
17: ((22, LOW), ),
18: ((2... | |
from collections import deque
import sys
"""
--- Day 15: Beverage Bandits ---
Having perfected their hot chocolate, the Elves have a new problem: the Goblins that live in these caves will do
anything to steal it. Looks like they're here for a fight.
You scan the area, generating a map of the walls (#), open cavern (... | |
from django.http import HttpResponse, Http404
from django.shortcuts import get_object_or_404
from django.template.defaultfilters import slugify
from django.views.decorators.cache import cache_page
from madrona.features.models import Feature
from madrona.features import get_feature_by_uid
from general.utils import meter... | |
# -*- coding: utf-8 -*-
"""
Copyright [2009-2017] EMBL-European Bioinformatics Institute
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://www.apache.org/licenses/LICENSE-2.0
Unless required by... | |
import logging
import math
import os
from typing import List, Union
import astropy.io.fits as pyfits
import numpy as np
import pandas as pd
import scipy
import scipy.optimize
import scipy.stats
from astropy.convolution import convolve
from spexxy.data.losvd import LOSVD
from spexxy.data.spectrum import Spectrum
clas... | |
if isinstance(self.padding, str) else self.padding),
stride=self.strides,
dilation=self.dilations
)
if self.data_format == 'NHWC':
out = nchw_to_nhwc(out)
return out
def conv2d_transpore_same(self,input, filters):
rows_odd, cols_odd, padding_rows, padding_cols = same_padding_deconvolution(input, filters, self.... | |
20, 21,
20, 21, 22, 23, 24, 25,
24, 25, 26, 27, 28, 29,
28, 29, 30, 31, 32, 1
])
return _perm(bits, e)
def _P(L):
"""Implements the P function from the DES paper
Accepts a block of 32 bits and outputs a block of 32 bits, permuted using table P
Args:
L (ndarray): The block of 32 bits to permute
Returns:
... | |
def _next_block(self, consume=True):
if not (self.currentblock < self.blockcount):
raise Exception("No next block")
self.currentblock += 1
if self.currentblock == self.blockcount:
self._active = False
return
if self.currentblock == 0:
pos = self.baseoffset
else:
pos = self.block.nextoffset
self.block = se... | |
<filename>punish/punish.py<gh_stars>1-10
import asyncio
from datetime import datetime
import discord
from collections import namedtuple
from redbot.core import Config, checks, commands
from redbot.core.bot import Red
from redbot.core.utils.chat_formatting import pagify, box, warning, error, info, bold
from redbot.core.... | |
Area 0.0.0.8
Type ID Adv Rtr Seq Age Cksum Len
Link *0.0.0.1 10.189.5.252 0x8000178b 2510 0xa440 44
fe80::250:560f:fc8d:7c08
Options 0x33, Priority 128
Prefix-count 0
Gen timer 00:08:09
Aging timer 00:18:09
Installed 00:41:50 ago, expires in 00:18:10
Last changed 29w5d 21:46:59 ago, Change count: 1, Ours
"""... | |
#!/home/twixtrom/miniconda3/envs/analogue/bin/python
##############################################################################################
# run_wrf.py - Code for calculating the best member over a date range
#
#
# by <NAME>
# Texas Tech University
# 22 January 2019
#
##########################################... | |
"""Icy air Gibbs energy and related properties.
This module provides the Gibbs function for ice-saturated (icy) air and
related thermodynamic properties. The primary variables are the total
dry air fraction, temperature, and pressure. The 'total' fraction here
is the mass fraction of dry air in the total parcel (inclu... | |
indexes for the road segment associated with that coordinate. Therefore, the coordinate identified for
# exclusion at distance=0 can be associated with, and expanded to include, all other coordinates along that road
# segment.
# Process: get the road segment coordinate counts and cumulative counts to generate an ind... | |
<reponame>EladGabay/pulumi-oci
# coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence,... | |
#coding=utf-8
from constants import *
from animation.creation import Write, FadeIn, FadeOut, DrawBorderThenFill
from animation.composition import AnimationGroup
from animation.indication import Indicate, ShowCreationThenDestruction
from animation.transform import Transform, ReplacementTransform, MoveToTarget
from mobj... | |
setName(self, name):
'''
sets the name
:param arg1: name
:type arg1: string
:return: returns the overall object
:rtype: self
'''
self.identifier = name
return self
def setLabel(self, label):
''''''
return self.setProperty('label', label)
def hide(self):
''''''
self.properties.addProperty('hidden', 'y... | |
y_max = max(VD.YC) + 2
axes.set_ylim(x_max, -2)
axes.set_xlim(-y_max, y_max)
# plot wing CP distribution
for i in range(n_w):
n_pts = (n_sw[i] + 1) * (n_cw[i]+ 1)
xc_pts = VD.X[i*(n_pts):(i+1)*(n_pts)]
x_pts = np.reshape(np.atleast_2d(VD.XC[b_pts[i]:b_pts[i+1]]).T, (n_sw[i],-1))
y_pts = np.reshape(np.atlea... | |
options to do that: One is to use the fraction of each
curve's proper length as curve parameter and the other is to choose
the parameter such that the \f$\tau\f$ coordinate produces a vector
field \f$\partial_\tau\f$ that is orthogonal to the MOTSs. The latter
is used if ``use_tev=True``. Note that
\f[
\partial_\... | |
<gh_stars>10-100
import numpy as np
import tensorflow as tf
import numpy as np
import threading
from itertools import compress
class ARAE():
def __init__(self,
vocab_size,
batch_size=20,
latent_size=100,
sample_size=100,
classification_task=1,
regression_task=1):
print ('batch size : ', batch_size)
print ('la... | |
<reponame>madiyarsh/local-search-engine
# %% [markdown]
# # Inverse indexing, index search, and signal page rank¶
# %% [markdown]
# ## PART I: Preparing the documents/webpages
# %% [code]
# oad libraries
from sklearn import linear_model, feature_selection, preprocessing
from sklearn import model_selection
from sklea... | |
0:
channelstatus = ChannelStatus.query.filter_by(id =self.id, channelnumber = self.Param2).first()
db.session.delete(channelstatus)
securitystrategys =DSecurityStrategy.query.filter_by(id=self.id,channelnumber=self.Param2).all()
for securitystrategy in securitystrategys:
db.session.delete(securitystrategy)
... | |
<filename>Homework_3/hyp_visc_BL.py<gh_stars>0
from math import *
import numpy as np
import matplotlib.pyplot as plt
from matplotlib import rc
from matplotlib import rcParams
from scipy.integrate import ode
# --- Font Parameters ---
font = {'size': 22}
rc('font', **font)
rcParams['font.sans-serif'] = 'Arial'
rcParams[... | |
vipiu_net(), # noqa; 30000
live-socks_net(), # noqa; 30000
webcr_narod_ru(), # noqa; 30000
clientn_easy-hideip_com(), # noqa; 30000
westdollar_narod_ru(), # noqa; 30000
asifameerbakhsh_blogspot_com(), # noqa; 30000
teri_2ch_net(), # noqa; 30000
proxyapi_cf(), # noqa; 30000
pypi_python_org(), # noqa; 30000
tool... | |
<reponame>aventon1/text-summarizer
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""Content Selector for multi-document text summarization that ranks and chooses the sentences to use in the summary."""
__author__ = "<NAME>, <NAME>, <NAME>"
__email__ = "<EMAIL>, <EMAIL>, <EMAIL>"
from data_input import Topic, Docume... | |
'transparent': (255, 255, 254),
'turquoise': (64, 224, 208),
'turquoise1': (0, 245, 255),
'turquoise2': (0, 229, 238),
'turquoise3': (0, 197, 205),
'turquoise4': (0, 134, 139),
'violet': (238, 130, 238),
'violetred': (208, 32, 144),
'violetred1': (255, 62, 150),
'violetred2': (238, 58, 140),
'violetred3': (20... | |
return d.errback(result.sde)
return d.errback(TApplicationException(TApplicationException.MISSING_RESULT, "system_add_column_family failed: unknown result"))
def system_drop_column_family(self, column_family):
"""
drops a column family. returns the new schema id.
Parameters:
- column_family
"""
self._seqid +=... | |
in name:
if rot1_copy == tilt[0]:
miny = -100000.0
if rot1_copy == tilt[1]:
miny = 100000.0
names = []
normal = []
for obj in bpy.data.objects:
if name in obj.name:
names.append(obj.name)
maxz = -10000.0
maxx = -10000.0
minx = 10000.0
maxy = -10000.0
miny = 10000.0
for obj in bpy.data.objects:
if nam... | |
self.skill3 = skill_graph.add(Skill.build('c', ''))
self.course.save()
def run_generator_job(self):
job = CountSkillCompletion(self.app_context)
job.submit()
self.execute_all_deferred_tasks()
def test_job_aggregate_entities(self):
"""Tests the SkillCompletionAggregate entities created by the job."""
# This is... | |
**kwargs):
return self.get_queryset().with_attributes(*args, **kwargs)
def top_news(self, *args, **kwargs):
return self.get_queryset().top_news(*args, **kwargs)
def top_nearby_newsitem_ids(self, user, limit=3, min_days_old=3, short_name=None):
"""
Returns the top N neighbor messages posted to neighborhoods that... | |
#!/usr/bin/python
# -*- coding: utf-8 -*-
from __future__ import absolute_import, division, print_function
__metaclass__ = type
# Copyright: (c) 2017, Ansible by Red Hat, inc
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
DOCUMENTATION = """
module: nxos_logging
author:... | |
<filename>appcenter/versions.py
"""App Center versions API wrappers."""
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT license.
import logging
import os
from typing import Iterator, List, Optional
import urllib.parse
import deserialize
from appcenter.derived_client import AppCenterDerivedClient
fro... | |
# -*- coding: utf-8 -*-
"""
Test JSON saving and loading.
@author: <EMAIL>
"""
import agilkia
import jsonpickle # type: ignore
import json
import decimal
import datetime
import xml.etree.ElementTree as ET
from pathlib import Path
import pandas as pd # type: ignore
import numpy.testing as nptest
import unittest
import... | |
import os
from conda_forge_tick.migrators import (
UpdateConfigSubGuessMigrator,
Version,
GuardTestingMigrator,
UpdateCMakeArgsMigrator,
CrossRBaseMigrator,
CrossPythonMigrator,
Build2HostMigrator,
NoCondaInspectMigrator,
)
from test_migrators import run_test_migration
config_migrator = UpdateConfigSubGuessM... | |
last_called data to fire events
await update_last_called(login_obj)
new_alexa_clients = [] # list of newly discovered device names
exclude_filter = []
include_filter = []
for device in devices:
serial = device["serialNumber"]
dev_name = device["accountName"]
if include and dev_name not in include:
include_fi... | |
from send_sms import send_sms_message
from trade_client import *
from store_order import *
from logger import logger
from load_config import *
from new_listings_scraper import *
import globals
from collections import defaultdict
from datetime import datetime, time
import time
import threading
import copy
import json
fr... | |
(optional, default: ``1``), the size of each
``1 \times 1 \times 1`` cube. This does a homothety with respect
to the center of the polyomino.
EXAMPLES::
sage: from sage.combinat.tiling import Polyomino
sage: p = Polyomino([(0,0,0), (0,1,0), (1,1,0), (1,1,1)], color='blue')
sage: p.show3d() # long time (2s)
Gra... | |
<reponame>a1270/iqdb_tagger
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""model module."""
import datetime
import logging
import os
from difflib import Differ
from urllib.parse import urljoin, urlparse
from typing import Any, Dict, List, Optional, Tuple, TypeVar
import cfscrape
import mechanicalsoup
import request... | |
#!/usr/bin/env python
# -*- coding: cp1252 -*-
# XSSA is a Cross Site Scripting Scanner & Vulnerability Confirmation
# By <NAME> - twitter.com/@Yehia1mamdouh / Facebook/yehia.mamdouh.98
import urllib2
from urllib2 import Request, build_opener, HTTPCookieProcessor, HTTPHandler
import urllib
from urllib import FancyURLo... | |
import numpy as np
from nilearn import image
from nibabel.nifti1 import Nifti1Image, Nifti1Pair
from nibabel.affines import apply_affine
from PyQt5 import QtCore
from PyQt5.QtGui import QCloseEvent
from PyQt5.QtCore import QObject, pyqtSignal, QThread
from PyQt5.QtWidgets import QDialog, QPushButton
# Internal import... | |
<reponame>peb-adr/boteweber-backend
from datetime import datetime, timedelta
import jwt
from flask import Flask, jsonify, request, make_response
from flask_cors import CORS
from werkzeug.security import check_password_hash
from src import schema
from src import sql, error
from src import config
app = Flask(__name__)... | |
"""Data structures for autodiff
"""
from autodiff import operations
import numpy as np
class Number():
'''
Number class is the core data structure for 'autodiff'. It instantiates a Number
object by specifying a value and a derivative. Derivative with respect to itself
is automatically instantiated to 1.
Args:... | |
s.rank if r in dims) for s in symbols]
occurrences = [i for i in occurrences if i]
if not occurrences:
return self
# Finally, establish the expansion dimension
dimension = Counter(occurrences).most_common(1)[0][0]
should_expand = lambda n: set(dimension).issubset(set(n.rank))
elif mode == 'dimensions':
dimensio... | |
for tkn in extra_tokens]
def _tokenize(text, tokenizer):
return text
def _weights_init(mean=0., std=0.02):
def _wi(m):
classname = m.__class__.__name__
if classname.find('Conv') != -1:
m.weight.data.normal_(mean, std)
elif classname.find('Linear') != -1 or classname.find('BatchNorm') != -1:
nn.init.normal_(m... | |
vba_code = """
# # Public Function add_body_to_heal(hybrid_shape_healing)
# # Dim iBody (2)
# # hybrid_shape_healing.AddBodyToHeal iBody
# # add_body_to_heal = iBody
# # End Function
# # """
# # system_service = self.application.system_service
# # return system_service.evaluate(vba_code, 0, vba_function_name, ... | |
<gh_stars>0
# coding: utf-8
# Copyright (c) Max-Planck-Institut für Eisenforschung GmbH - Computational Materials Design (CM) Department
# Distributed under the terms of "New BSD License", see the LICENSE file.
import copy
import warnings
import numpy as np
import os
from ase.io import write as ase_write
import posixp... | |
import os
# os.environ['CUDA_VISIBLE_DEVICES'] = "0"
import os.path
import shutil
import sys
import numpy as np
import tensorflow as tf
import experiments
from models import nets
from utils import summary
################################################################################################
# Read experiment... | |
<reponame>solarcaratuva/bitproto<filename>compiler/bitproto/renderer/impls/go/renderer.py<gh_stars>10-100
"""
Renderer for Go.
"""
from abc import abstractmethod
from typing import Any, List, Optional
from bitproto._ast import (
Alias,
Array,
Bool,
BoundDefinition,
Byte,
Constant,
Enum,
Int,
Integer,
Messag... | |
1, 2, 3, 5, 7, 8, 9})
self._ev("( not f6 is v )", {0, 1, 2, 3, 4, 5, 6, 7, 8, 9})
def test_04_is_07_not_parentheses(self):
self._ev("( f4 is not xb )", {0, 1, 2, 3, 4, 5, 7, 8, 9})
self._ev("( f5 is not df )", {0, 2, 8})
self._ev("( f6 is not v )", set())
def test_04_is_08_not_parentheses_not(self):
self._ev("... | |
+= self.upsample_3.flops(self.reso//2,self.reso//2)+self.decoderlayer_3.flops()
# Output Projection
flops += self.output_proj.flops(self.reso,self.reso)
return flops
class Uformer_Cross(nn.Module):
def __init__(self, img_size=128, in_chans=3,
embed_dim=32, depths=[2, 2, 2, 2, 2, 2, 2, 2, 2], num_heads=[1, 2, 4... | |
HTTPUnprocessableEntity(body='Could not parse '
'system map')
if sysimage:
cluster_config[0]['file_list'].append({'device': sysimage})
string_path = Path(REGTYPE,
'script',
int(req.headers['content-length']),
cached_body)
stream = TarStream(path_list=[string_path])
stream_length = stream.get_total_stream_lengt... | |
# Copyright (c) 2007 RADLogic
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribut... | |
<gh_stars>1-10
#!/usr/bin python3
""" The command frame for Faceswap GUI """
import logging
import tkinter as tk
from tkinter import ttk
from .tooltip import Tooltip
from .utils import ContextMenu, FileHandler, get_images, get_config, set_slider_rounding
logger = logging.getLogger(__name__) # pylint:disable=invalid-... | |
import json
import random
import os
import numpy as np
import torch
from torch.utils.data import Dataset
from torch.utils.data import DataLoader
import copy
import math
import h5py
import models.Constants as Constants
from bisect import bisect_left
import torch.nn.functional as F
import pickle
from pandas.io.json impo... | |
import os
import sys
from PyQt5.QtWidgets import QLabel, QGridLayout, QWidget, QDialog, QHBoxLayout, QApplication, QToolBar, QPushButton, \
QVBoxLayout, \
QSizePolicy, QStackedWidget, QScrollBar, QScrollArea, QTreeView, QSplitter, QStylePainter, QStyle, \
QStyleOptionButton, QTableView
from PyQt5.QtCore import Qt, Q... | |
<reponame>joelvisroman/dataviva-site
# -*- coding: utf-8 -*-
import requests
from datetime import datetime
from sqlalchemy import func
from flask import Blueprint, request, render_template, g, Response, make_response, jsonify
from flask.ext.babel import gettext
from dataviva import db, datavivadir, __year_range__, vie... | |
== pytest.approx(
g0_convergence.in_list[0], 1.0e-8
)
def test__plane_has_no_galaxies__convergence_is_zeros_size_of_reshaped_sub_array(
self, sub_grid_2d_7x7
):
plane = ag.Plane(galaxies=[], redshift=0.5)
convergence = plane.convergence_2d_from_grid(grid=sub_grid_2d_7x7)
assert convergence.sub_sha... | |
0, 0, 0)]
else:
user = [(message.author.id, one_result[1], one_result[2], one_result[3], one_result[4], one_result[5], unix_time_millis(message.created_at), one_result[7], one_result[8], one_result[9])]
if guild_result is None:
guild = [(message.guild.id, str(message.guild.region), 0, unix_time_millis(message.c... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.