input stringlengths 2.65k 237k | output stringclasses 1
value |
|---|---|
None
self.width = 20
self.height = 10
ID_Timer = wx.NewId()
self.timer = wx.Timer(self.frame, ID_Timer)
wx.EVT_TIMER(self.frame, ID_Timer, self.OnTimer)
self.timer.Start(2000)
if have_ROS:
rospy.init_node('fview', # common name across all plugins so multiple calls to init_node() don't fail
anonymous=True, # ... | |
"""This module contains several handy functions primarily meant for internal use."""
from __future__ import division
from datetime import date, datetime, time, timedelta, tzinfo
from calendar import timegm
import re
from pytz import timezone, utc
import six
try:
from inspect import signature
except ImportError: # p... | |
= db.Column(db.DateTime, index=False, unique=False, nullable=True)
countersigned_at = db.Column(db.DateTime, index=False, unique=False, nullable=True)
agreement_details = db.Column(JSON)
supplier = db.relationship(Supplier, lazy='joined', innerjoin=True)
framework = db.relationship(Framework, lazy='joined', innerj... | |
:param str owner: Owner of the namespace (required)
:param V1Project body: Project body (required)
:param _return_http_data_only: response data without head status code
and headers
:param _preload_content: if False, the urllib3.HTTPResponse object will
be returned without reading/decoding response
data. Default i... | |
"1920")),
((Standards.TSIC2552, "15209"), (Standards.ISIC3, "1920")),
((Standards.TSIC2552, "16101"), (Standards.ISIC3, "2010")),
((Standards.TSIC2552, "16102"), (Standards.ISIC3, "2010")),
((Standards.TSIC2552, "16210"), (Standards.ISIC3, "2021")),
((Standards.TSIC2552, "16220"), (Standards.ISIC3, "2022")),
((St... | |
True),
_request_timeout=local_var_params.get('_request_timeout'),
collection_formats=collection_formats,
_request_auth=local_var_params.get('_request_auth'))
def translate_post_translate_post(self, translation_request, **kwargs): # noqa: E501
"""Translate Post # noqa: E501
This method makes a synchronous HTTP r... | |
###
### Preprocesses child 'SNP_CNV_v1.txt' file that has been copied into the hapmap folder as
### "SNPdata_child.{entryNum}.txt". Final format only has data lines for loci which are found
### in "SNPdata_hapmap.txt" file, and only data lines for fragments of the genome defined in the
### corresponding "haplotypeFragm... | |
<reponame>warrench/qiskit-metal
# -*- coding: utf-8 -*-
# This code is part of Qiskit.
#
# (C) Copyright IBM 2017, 2021.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.o... | |
utils.ncDataset(gdir.get_filepath('gridded_data')) as nc:
mask = nc.variables['glacier_mask'][:]
mymask_a = mask * 0
mymask_b = mask * 0
for i, ci in enumerate(cis):
mymask_a[tuple(ci.T)] += 1
mymask_b[tuple(ci.T)] = i+1
self.assertTrue(np.max(mymask_a) == 1)
np.testing.assert_allclose(mask, mymask_a)
def te... | |
#!/usr/bin/env python
"""Provides encoding into graphs for proteins."""
from Bio.PDB import Selection, NeighborSearch
from collections import defaultdict
from collections import deque
import networkx as nx
from networkx import union
from toolz import curry, compose
# ac properties
aa_properties_dict = {
"fullname": ... | |
<reponame>bob-white/advent_2018
"""--- Day 11: Chronal Charge ---
You watch the Elves and their sleigh fade into the distance as they head toward the North Pole.
Actually, you're the one fading. The falling sensation returns.
The low fuel warning light is illuminated on your wrist-mounted device. Tapping it once cau... | |
barrel_dir[
0, 1] == next_dir[1]:
next_barrel = barrel_dir.copy()
break
barrel_dir = np.roll(barrel_dir, 1, axis=0)
barrel_pair = np.stack(
(n2f_barrel, next_barrel),
axis=0
)
n2f_dir = (barrel_pair[0, 0, 0], barrel_pair[0, 0, 1])
elif step > 1:
next_dir = (npath[step][0] - npath[step - 1][0],
npath[step][1... | |
partition_object['bins'][-1])[0])
below_partition = self.get_column_count_in_range(column, max_val=partition_object['bins'][0])
above_partition = self.get_column_count_in_range(
column, min_val=partition_object['bins'][-1], strict_min=True
)
# Observed Weights is just the histogram values divided by the total num... | |
# Library to do grading of Python programs.
# <NAME>
#
# Usage:
# # create a grader
# grader = Grader("Name of assignment")
# # add a basic test (which is visible to students)
# grader.addBasicPart(name, gradeFunc, maxPoints, maxSeconds, description="a basic test")
# # add a hidden test (MUST be in BEGIN_HIDDEN block)
... | |
# -*- coding: UTF-8 -*-
from django import forms
from django.conf import settings as dsettings
from django.contrib.admin import widgets as admin_widgets
from django.core import mail
from django.db import transaction
from django.forms import widgets
from django.forms.util import flatatt
from django.utils.encoding import... | |
return pulumi.get(self, "disk_type_id")
@disk_type_id.setter
def disk_type_id(self, value: pulumi.Input[str]):
pulumi.set(self, "disk_type_id", value)
@property
@pulumi.getter(name="resourcePresetId")
def resource_preset_id(self) -> pulumi.Input[str]:
return pulumi.get(self, "resource_preset_id")
@resource_p... | |
#
# Autogenerated by Thrift Compiler (0.10.0)
#
# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
#
# options string: py
#
from thrift.Thrift import TType, TMessageType, TFrozenDict, TException, TApplicationException
from thrift.protocol.TProtocol import TProtocolException
import sys
import logging
fr... | |
def enterAttribute_name(self, ctx:PlSqlParser.Attribute_nameContext):
pass
# Exit a parse tree produced by PlSqlParser#attribute_name.
def exitAttribute_name(self, ctx:PlSqlParser.Attribute_nameContext):
pass
# Enter a parse tree produced by PlSqlParser#savepoint_name.
def enterSavepoint_name(self, ctx:PlSqlPa... | |
<reponame>UsamaKashif/studentutor<gh_stars>1-10
from django.shortcuts import render,redirect
from django.contrib.auth.models import Group
from .forms import AcademySignUpForm, AcademyProfile, ProfilePicture, PostAnAdForm, AboutAcademyForm
from django.contrib.auth.models import User
from django.views.generic import R... | |
"""show_vrrp.py
IOSXE parsers for the following show commands:
* 'show vrrp'
* 'show vrrp all'
* 'show vrrp interface {interface}'
* 'show vrrp interface {interface} all'
* 'show vrrp interface {interface} group {group}'
* 'show vrrp interface {interface} group {group} all'
* 'show vrrp brief'
* 'show vrrp bri... | |
tables/views to be dumped.
tables: List of tables/views to be dumped.
outputUrl: Target directory to store the dump files.
options: Dictionary with the dump options.
DESCRIPTION
The tables parameter cannot be an empty list.
The outputUrl specifies where the dump is going to be stored.
By default, a local direc... | |
"""Abstract model of a representation the monster group
Let R_p be the 196884-dimensional representation 196884x of the monster
group modulo a small odd number p as described in [Seys19]. Class
AbstractMmRepSpace is an abstract class for modelling representation
R_p. A small odd modulus p < 256 is passed to the const... | |
# -*- coding: utf-8 -*-
#
# general_models.py
#
# Copyright 2020 Amazon.com, Inc. or its affiliates. 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://www.apache... | |
:param str put_code: (required)
:return: None
If the method is called asynchronously,
returns the request thread.
"""
all_params = ['orcid', 'put_code'] # noqa: E501
all_params.append('async_req')
all_params.append('_return_http_data_only')
all_params.append('_preload_content')
all_params.append('_request_tim... | |
around a query gene.
This method returns a tuple containing a numpy recarray with
gene entries located around the query gene, and an index
pointing to the query gene. The genes are sorted according to
their position on the chromosome.
The *windows* parameter specifies the number of genes up- and
downstream of t... | |
# losses['l1_loss_fore_128'] = 0.
# losses['l1_loss_back_128'] = 0.
self.losses_128 = [losses['l1_loss_fore_128'],
losses['l1_loss_back_128'],
losses['grad_l1_loss_128'],
losses['edge_l1_loss_128'],
losses['grad_matching_128']
]
# Summary
viz_img_128 = [x_pos_128, x_incomplete_128, x_complete_128]
... | |
0, 0, 0, 0],
[986, 11.2, 0, 9999, -9999, 1.0, 100, 1, 11.2, 0.0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
[987, 164.5, 0, 9999, -9999, 1.0, 100, 1, 164.5, 0.0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
[988, 5.1, 0, 9999, -9999, 1.0, 100, 1, 5.1, 0.0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
[990, 93.2... | |
Leakage': 0.00611897,
'Renaming Unit/Int Front End RAT/Subthreshold Leakage with power gating': 0.00348781,
'Renaming Unit/Peak Dynamic': 4.56169,
'Renaming Unit/Runtime Dynamic': 0.0992841,
'Renaming Unit/Subthreshold Leakage': 0.070483,
'Renaming Unit/Subthreshold Leakage with power gating': 0.0362779,
'Runtime... | |
Leakage': 0.00611897,
'Renaming Unit/Int Front End RAT/Subthreshold Leakage with power gating': 0.00348781,
'Renaming Unit/Peak Dynamic': 4.56169,
'Renaming Unit/Runtime Dynamic': 0.209689,
'Renaming Unit/Subthreshold Leakage': 0.070483,
'Renaming Unit/Subthreshold Leakage with power gating': 0.0362779,
'Runtime ... | |
),
'P m n 21' : (
(('P', 'italic'),
('m', 'italic'),
('n', 'italic'),
('2', 'regular'),
('1', 'sub'),
), {'itnumber': 31, 'crystal_system': 'orthorhombic', 'short-hm': 'Pmn21', 'is_reference': True},
),
'P n m 21' : (
(('P', 'italic'),
('n', 'italic'),
('m', 'italic'),
('2', 'regular'),
('1', 'sub'),
), ... | |
True
When set to False, metrics are evaluated on holdout set. ``fold`` param
is ignored when cross_validation is set to False.
sort: str, default = 'SMAPE'
The sort order of the score grid. It also accepts custom metrics that are
added through the ``add_metric`` function.
n_select: int, default = 1
Number of... | |
"""Functions for finding and manipulating cliques.
Finding the largest clique in a graph is NP-complete problem, so most of
these algorithms have an exponential running time; for more information,
see the Wikipedia article on the clique problem [1]_.
.. [1] clique problem:: https://en.wikipedia.org/wiki/Clique_proble... | |
<filename>orphics/symcoupling.py<gh_stars>1-10
from __future__ import print_function
import numpy as np
from sympy import Symbol,Function
import sympy
from pixell import fft as efft, enmap
from orphics import maps,io,stats,cosmology,lensing
import os,sys
"""
Routines to reduce and evaluate symbolic mode coupling integ... | |
import json
from collections import OrderedDict
import pytest
from sqlalchemy.sql.elements import or_
from sqlalchemy.sql.functions import Function
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy import Column, Integer, String, ForeignKey, Table
from sqlalchemy.orm import relationship
from fal... | |
# Copyright 2014 Google Inc. All Rights Reserved.
"""Read and write properties for the CloudSDK."""
import collections
import ConfigParser
import os
import threading
from googlecloudsdk.core import config
from googlecloudsdk.core import exceptions
from googlecloudsdk.core.credentials import devshell as c_devshell
fr... | |
title='Exemplar electric load profiles (labels/ground truth data)',
subplots=True,
layout=(math.ceil(n_subplots / 2), 2),
figsize=(16, n_subplots),
)
return raw_data
def import_building_images(HYPER, raw_data, silent=False, plot=True):
""" Imports building-scale aerial imagery and appends the following to the... | |
words tend to occur together.
# In[19]:
len(tokens), len(set(tokens))
# So we can see right away that Arthur is using the same words a whole bunch - on average, each unique word is used four times. This is typical of natural language.
#
# > Not necessarily the value, but that the number of unique words in any cor... | |
'''
Created on Jun 10, 2010
@author: ilg
'''
import tempfile
import os
import exceptions
import flickrapi.exceptions
import requests
class Aggregate(object):
'''
classdocs
'''
def __init__(self, flickr, sUrl, oWriter, bVerbose):
'''
Constructor
'''
self.flickr = flickr
self.sUrl = sUrl
self.fout = None
sel... | |
<filename>poppy_create.py
#!/usr/bin/env python3
# Import modules
import networkx as nx
import re
import sys
import os
import argparse
import pickle
import time
import queue
import threading
import multiprocessing as mp
from requests import get as rget
from rdkit import Chem
from copy import deepcopy
from itertools im... | |
in distinct subnets.
"""
logging.debug("Got %d possible bridges to filter" % len(fingerprints))
bridges = []
subnets = []
for fingerprint in fingerprints:
bridge = self.bridges[fingerprint]
jump = False
# HOTFIX for https://bugs.torproject.org/26150
if not bridge.address:
logging.error("Got strange bridge ... | |
(self.scale + self.scale.T) * 0.5
return next_state
def correct(self, timestep, meas, cur_state, meas_fun_args=()):
"""Implements the correction step of the students T filter.
This also performs the moment matching.
Parameters
----------
timestep : float
Current timestep.
meas : Nm x 1 numpy array
Current... | |
# Python code for reading in the output of the IRAF ellipse task
# (stsdas.analysis.isophote package), as translated into text-file
# output by the tprint or tdump tasks, or into FITS table form by
# the tcopy task.
#
# Also include functions for plotting, using matplotlib functions.
# In addition, we include some f... | |
def anchorAt(*args, **kwargs):
pass
def append(*args, **kwargs):
pass
def autoFormatting(*args, **kwargs):
pass
def canInsertFromMimeData(*args, **kwargs):
pass
def canPaste(*args, **kwargs):
pass
def changeEvent(*args, **kwargs):
pass
def clear(*args, **kwargs):
pass
def c... | |
freedom
:rtype: float
Note ``un.df`` is equivalent to :func:`dof(un)<core.dof>`
**Example**::
>>> ur = ureal(2.5,0.5,3)
>>> ur.df
3.0
"""
if self.is_elementary:
return self._node.df
elif self.is_intermediate:
# The `None` case is to handle a change in the
# archiving process. It will be phased ou... | |
> 1 else [supportPatches] # Force to be a list.
encodingsLeft = [encoder(s) for s in supportPatches]
# encodingLeftSum = keras.layers.Add()(encodingsLeft)
# encodingLeftAvg = MulConstLayer(1 / config.shotNumber)(encodingLeftSum)
encodingRight = encoder(SplitLayer(axis=1, length=1)(inputRight)) # We only have one sl... | |
# Copyright 2021 <NAME>
# 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 applicable law or agreed to in writing, software
# ... | |
= ""
if line.find(metadata1) != -1:
newline = line.replace(metadata1, new_metadata1)
lines += newline
elif line.find(metadata2) != -1:
newline = line.replace(metadata2, new_metadata2)
lines += newline
elif line.find(metadata3) != -1:
newline = line.replace(metadata3, new_metadata2)
lines += newline
elif line.... | |
import tensorflow as tf
from .homographies import warp_points
from .backbones.vgg import vgg_block
def detector_head(inputs, **config):
params_conv = {'padding': 'SAME', 'data_format': config['data_format'],
'batch_normalization': True,
'training': config['training'],
'kernel_reg': config.get('kernel_reg', 0.)}
... | |
time relative to event
trigger time (in ss.msec)
''',
'end_time',
'Cisco-IOS-XR-infra-rcmd-oper', False),
_MetaInfoClassMember('start-time', ATTRIBUTE, 'str' , None, None,
[], [],
''' First route process time relative to event
trigger time (in ss.msec)
''',
'start_time',
'Cisco-IOS-XR-infra-rcmd-oper', Fal... | |
"""
Test suite for the wizard creating a new Course page
"""
import random
from unittest import mock
from django.core.exceptions import PermissionDenied
from django.urls import reverse
from cms.api import create_page
from cms.models import Page, PagePermission
from cms.test_utils.testcases import CMSTestCase
from fil... | |
##############################################################################
#
# Copyright (c) 2004 Zope Corporation and Contributors.
# All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
# THIS SOF... | |
chunks_amount = len(data)
# TODO: have to create oracle but subscribe this time chunks amount times to send whole file in same block
# TODO: 2 - on some point file will not fit block - have to find this point
# TODO: 3 way how I want to implement it first will keep whole file in RAM - have to implement some way to s... | |
#===============================================================================
# Copyright (c) 2012-2015, GPy authors (see AUTHORS.txt).
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Red... | |
<gh_stars>100-1000
# -*- coding: utf-8 -*-
import nose
from numpy import nan
import numpy as np
from pandas import Index, isnull, Timestamp
from pandas.util.testing import assert_almost_equal
import pandas.util.testing as tm
from pandas.compat import range, lrange, zip
import pandas.lib as lib
import pandas._period as ... | |
################################################################################
# #
# LEGAL NOTICE: #
# ============== #
# The following code and documentation (hereinafter "the script") is an #
# example script for demonstration purposes only. #
# The script is not a standard commercial product offered by Ixi... | |
# -*- coding: utf-8 -*-
import os
import json
import tccli.options_define as OptionsDefine
import tccli.format_output as FormatOutput
from tccli.nice_command import NiceCommand
import tccli.error_msg as ErrorMsg
import tccli.help_template as HelpTemplate
from tccli import __version__
from tccli.utils import Utils
from ... | |
for i in range(result):
yield None
else:
while result() == False:
yield None
while True:
yield None
def AppendEnemy(cls, args):
Shooting.scene.enemies.Append(args[0](*args[1]))
return 0
AppendEnemy = classmethod(AppendEnemy)
def Idle(cls, frame_num):
return frame_num
Idle = classmethod(Idle)
def WaitEn... | |
'--diff_lambda_power=2'.")
logger.warning("If it does not, then consider adding a massless "+
"gauge vector to the external states.")
logger.warning("------------------------------------------------------")
if options['recompute_width']=='auto':
if multiprocess_nwa.get('perturbation_couplings')!=[]:
# NLO, so it... | |
DZA': 94008,
'MIAO LETTER DZHA': 93999,
'MIAO LETTER DZZA': 93995,
'MIAO LETTER FA': 93959,
'MIAO LETTER GA': 93983,
'MIAO LETTER GHA': 93992,
'MIAO LETTER GHHA': 93993,
'MIAO LETTER HA': 93990,
'MIAO LETTER HHA': 94020,
'MIAO LETTER KA': 93982,
'MIAO LETTER LA': 93974,
'MIAO LETTER LHA': 93976,
'MIAO LETTER LHYA': 939... | |
<reponame>fdeugenio/photutils<gh_stars>0
# Licensed under a 3-clause BSD style license - see LICENSE.rst
import math
import numpy as np
from .attributes import (PixelPositions, SkyCoordPositions, PositiveScalar,
AngleOrPixelScalarQuantity)
from .core import PixelAperture, SkyAperture
from .bounding_box import Bound... | |
= _format_set_values_for_display(type_names)
name = f"type of the column values is in {type_names}"
return SummaryConstraint("column_values_type", op=Op.IN, reference_set=type_set, name=name, verbose=verbose)
def approximateEntropyBetweenConstraint(lower_value: Union[int, float], upper_value: float, name=None, ver... | |
<filename>py_to_win_app/py_to_win_app.py
import os
import re
import shutil
import subprocess
import sys
import zipfile
from contextlib import contextmanager
from pathlib import Path
from typing import Iterable, Union
import requests
from genexe.generate_exe import generate_exe
__all__ = ["Project"]
_PYTHON_VERSION_R... | |
<reponame>gwenzek/ColorHelper
"""
ColorHelper.
Copyright (c) 2015 - 2017 <NAME> <<EMAIL>>
License: MIT
"""
import mdpopups
from mdpopups import colorbox
import sublime
import sublime_plugin
from ColorHelper.lib import csscolors
import ColorHelper.color_helper_util as util
import copy
from ColorHelper.multiconf import ... | |
<filename>modules/audio_processing/test/py_quality_assessment/quality_assessment/simulation.py
# Copyright (c) 2017 The WebRTC project authors. All Rights Reserved.
#
# Use of this source code is governed by a BSD-style license
# that can be found in the LICENSE file in the root of the source
# tree. An additional inte... | |
"noy_gas", "long_name": "NOy gases"})
return d
def add_lazy_noy_a(d, dict_sum):
"""Calculates NOy aerosol
Parameters
----------
d : xarray.Dataset
RRFS-CMAQ model data
Returns
-------
xarray.Dataset
RRFS-CMAQ model data including new NOy aerosol calculation
"""
keys = _get_keys(d)
allvars = Series(dic... | |
<reponame>umerhasan17/timefhuman
from .constants import MONTHS
from .constants import DAYS_OF_WEEK
from .data import DayToken
from .data import TimeToken
from .data import DayRange
from .data import TimeRange
from .data import AmbiguousToken
from .data import Token
import datetime
def categorize(tokens, now):
"""
... | |
<= 12)
m.c4420 = Constraint(expr= 12*m.b96 + 12*m.b97 - m.x208 - m.x209 + m.x418 + m.x419 <= 12)
m.c4421 = Constraint(expr= 12*m.b98 + 12*m.b99 - m.x210 - m.x211 + m.x420 + m.x421 <= 12)
m.c4422 = Constraint(expr= 12*m.b86 + 12*m.b87 + 12*m.b88 - m.x198 - m.x199 - m.x200 + m.x408 + m.x409 + m.x410 <= 12)
m.c4423 = ... | |
0, 0, 0, 0],
[1369, 3.129779, 0, 9999, -9999, 1.0, 100, 1, 7.968859, 0.0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
[1370, 0.038875, 0, 9999, -9999, 1.0, 100, 1, 0.343308, 0.0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
[1371, 63.847325, 0, 9999, -9999, 1.0, 100, 1, 81.767208, 0.0, 0, 0, 0, 0, 0, 0, ... | |
self.get_none_if_empty(
Vote(
decision=self.get_vote_decision(vote),
external_source_id=str(vote[LEGISTAR_VOTE_EXT_ID]),
person=self.get_person(vote[LEGISTAR_VOTE_PERSONS]),
)
)
for vote in legistar_votes
]
)
def get_event_supporting_files(
self,
legistar_ev_attachments: List[Dict],
) -> Optional[List[Sup... | |
<reponame>andela/ah-magnificent6<gh_stars>0
"""
This module defines views used in CRUD operations on articles.
"""
from rest_framework import generics, status
from rest_framework.response import Response
from rest_framework.permissions import (
AllowAny, IsAuthenticatedOrReadOnly, IsAuthenticated
)
from rest_framework... | |
<gh_stars>0
# This file is auto-generated, don't edit it. Thanks.
from alibabacloud_tea_rpc.client import Client as RPCClient
from alibabacloud_ros20190910 import models as _ros20190910_models
from alibabacloud_tea_util import models as util_models
from alibabacloud_tea_util.client import Client as UtilClient
from alib... | |
concatenates their outputs."""
@classmethod
def Params(cls):
p = super(ParallelStep, cls).Params()
p.Define(
'sub', [], 'A list of step params. Each step is '
'expected to accept its input as NestedMap(inputs=[]), and '
'produce output as NestedMap(output=tensor). '
'The external_inputs parameter is passed dir... | |
<reponame>largecats/hiveql-formatter
# -*- coding: utf-8 -*-
# MIT License
# Copyright (c) 2016-present ZeroTurnaround LLC
# Copyright (c) 2016-present kufii
# Copyright (c) 2020-present largecats
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated document... | |
<reponame>dragazo/PyBlox<filename>netsblox/snap.py
import random
import math
from typing import Any, Union, Callable, Sequence
def _is_matrix(v: Any) -> bool:
return isinstance(v, list) and len(v) > 0 and isinstance(list.__getitem__(v, 0), list)
def _is_list(v: Any) -> bool:
return isinstance(v, list)
def _list_bi... | |
from django.db import models
from django.utils import timezone
from django.db.models import Q
import asyncio
from ib_insync import IB, Stock, MarketOrder, util
from core.common import empty_append
from core.indicators import rel_dif
import vectorbtpro as vbt
import sys
import math
import pandas as pd
import numpy as... | |
= self.landCoverObj[coverType].previousFracVegCover
# - initial land cover states (unit: m)
land_cover_states = vars(self.landCoverObj[coverType])[var]
vars(self)[var] += land_cover_states * land_cover_fraction
def waterDemandOptions(self, iniItems):
# domestic water demand (unit: m/day)
#
self.domesticWaterDe... | |
<gh_stars>1-10
import json
import os
class Parser(object):
shouldPrint = False
f = open(os.sep + "wordbank" + os.sep + "adverbs" + os.sep + "adverbs.txt")
lines = f.read().splitlines()
f.close()
indexes = open(os.sep + "wordbank" + os.sep + "adverbs"+ os.sep + "index.json")
letter_index = json.loads(indexes.read... | |
<gh_stars>0
##################################################################
# Steps for updating WhiteboxTools-ArcGIS
# Step 1 - Delete the existing develop branch: git branch -D develop
# Step 2 - Create a new develop branch: git checkout -b develop
# Step 3 - Delete the old WhiteboxTools_win_amd64.zip in the roo... | |
("SELECT analysis_score FROM dataword WHERE word = %s AND date BETWEEN %s AND %s")
val = (word, since_date, until_date)
mycursor.execute(sql, val)
rv = mycursor.fetchall()
final = []
content = {}
min = 1
max = -1
int0=0
int1=0
int2=0
int3=0
int4=0
int5=0
int6=0
int7=0
int8=0
int9 = 0
for result in rv:... | |
<gh_stars>1-10
# //=======================================================================
# // Copyright JobPort, IIIT Delhi 2015.
# // Distributed under the MIT License.
# // (See accompanying file LICENSE or copy at
# // http://opensource.org/licenses/MIT)
# //========================================================... | |
import os.path
import zipfile
from copy import deepcopy
from datetime import datetime, timedelta
from random import choice, randint
from threading import Thread
from Cb_constants import CbServer
from SecurityLib.rbac import RbacUtil
from SystemEventLogLib.Events import Event, EventHelper
from SystemEventLogLib.SystemE... | |
field(
default=None,
metadata={
"name": "NumberSuffixSeparator",
"type": "Attribute",
}
)
type: Optional[str] = field(
default=None,
metadata={
"name": "Type",
"type": "Attribute",
}
)
code: Optional[str] = field(
default=None,
metadata={
"name": "Code",
"type": "Attribute",
}
)
other_attributes: D... | |
<reponame>dargueta/binobj<gh_stars>1-10
"""Classes defining structures and unions."""
import abc
import collections
import collections.abc
import copy
import io
import typing
import warnings
from typing import Any
from typing import BinaryIO
from typing import Dict
from typing import Iterator
from typing import List
f... | |
# Copyright (c) 2020, Salesforce.com, Inc.
# Copyright 2018 The Google AI Language Team Authors and The HuggingFace Inc. team.
# Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the Lice... | |
{'name': '来安县', 'pid': 195, 'zipcode': 239000},
2288: {'name': '琅玡区', 'pid': 195, 'zipcode': 239000},
2289: {'name': '临泉县', 'pid': 196, 'zipcode': 236000},
2290: {'name': '太和县', 'pid': 196, 'zipcode': 236000},
2291: {'name': '界首市', 'pid': 196, 'zipcode': 236000},
2292: {'name': '阜南县', 'pid': 196, 'zipcode': 236000... | |
<filename>fusion_tcv/shape.py
# Copyright 2021 DeepMind Technologies Limited.
#
# 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 require... | |
registered username." % r.infos[u'username'], 'log')
c = Client.Sessions[r.infos[u'username']]
c.shutdown()
del Client.Sessions[r.infos[u'username']]
self.send(r.error, 'log')
if not self.anyReady():
self.pause()
yield 1
class Client(component):
Inboxes = {"inbox" : "",
"jid" : "",
"streamfeat" : "",
"co... | |
import tensorflow as tf
import math as mathlib
#-----------------------------some important methods for quantization------------------------------
def clip_max(x, c, alpha):
"""
The clipping function in the maximum saturation region
Args:
c: tf.tensor in R, the range to clip to
alpha: tf.tensor in R, the smo... | |
<reponame>xswz8015/infra<gh_stars>0
# Copyright 2019 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.
import logging
import os
import re
from google.appengine.ext import ndb
from gae_libs import appengine_util
from libs i... | |
806/1000
15/15 [==============================] - 0s 3ms/step - loss: 0.0835 - accuracy: 0.9692
Epoch 807/1000
15/15 [==============================] - 0s 3ms/step - loss: 0.0946 - accuracy: 0.9626
Epoch 808/1000
15/15 [==============================] - 0s 5ms/step - loss: 0.0974 - accuracy: 0.9495
Epoch 809/1000
15/15... | |
= u"""""",
longDesc =
u"""
""",
)
entry(
index = -1,
label = "Cs-C=S(Cds-Cdd)(Cds-Cds)H",
group =
"""
1 * Cs u0 {2,S} {3,S} {4,S} {5,S}
2 CS u0 {1,S} {8,D}
3 Cd u0 {1,S} {6,D}
4 Cd u0 {1,S} {7,D}
5 H u0 {1,S}
6 Cdd u0 {3,D}
7 Cd u0 {4,D}
8 S2d u0 {2,D}
""",
thermo = None,
shortDesc = u"""""",
longDesc =
u""... | |
from numpy import complex128,int64,float64,float32
__ComplexType__ = complex128
__IntegerType__ = int64
__FloatType__ = float64
TIPS_2017_ISOT = {}
TIPS_2017_ISOT = {}
TIPS_2017_ISOT[0] = float64([
1.0, 20.0, 40.0, 60.0, 80.0, 100.0, 120.0, 140.0, 160.0, 180.0,
200.0, 220.0, 240.0, 260.0, 280.0, 300.0, 320.0, 340... | |
<reponame>IamTheLime/xmlschema_hotfixes<filename>xmlschema/testing/builders.py
#!/usr/bin/env python
#
# Copyright (c), 2016-2020, SISSA (International School for Advanced Studies).
# All rights reserved.
# This file is distributed under the terms of the MIT License.
# See the file 'LICENSE' in the root directory of th... | |
= self.BuyingPuzzleVisualization(self,
self.geometry().x(),
self.geometry().y(),
self.geometry().width(),
self.geometry().height(),
self.tts,
self.tasks[self.iter][0],
self.tasks[self.iter][1],
self.tasks[self.iter][2],
self.resourcesPath,
self.tasks[self.iter][4])
elif self.tasks[self.iter][3] == "cloc... | |
import typing
from numbers import Number as ParentNumber
from dataclasses import dataclass
from expyct.base import MapBefore, Satisfies, Equals, Instance, Optional, BaseMatcher
@dataclass(repr=False, eq=False)
class MinMax(BaseMatcher):
"""Mixin for matching a number that is equal to, larger or smaller than given ... | |
= '5d9d'
kaihimore(moves)
if oute.oute == 0:
depth1.append(moves)
if re.match(r'\+b|b', Wboard.w5d)and Wboard.w2a==''\
and board.s3b+board.s4c=='':
moves ='5d2a'
kaihimore(moves)
if oute.oute == 0:
depth1.append(moves)
if re.match(r'\+b|b',Wboard.w5d)and Wboard.w3b==''\
and board.s4c=='':
moves ='5d3b'
kai... | |
'emblem', 'token', 'double_faced_token']
return self.filtered(lambda card: card.layout not in non_playable_layouts)
else:
non_playable_layouts = ['token', 'plane', 'scheme', 'phenomenon', 'vanguard', 'conspiracy']
face_layouts = ['split', 'flip', 'double-faced', 'aftermath']
return self.filtered(lambda card: card... | |
from pathlib import Path
import json
from numpy.lib.utils import deprecate
from tqdm import tqdm
from collections import defaultdict
from typing import DefaultDict, Dict, List, Tuple, Union, Set
import logging
from PIL import Image
import numpy as np
from datetime import datetime
from ..utils import maskutils, visualiz... | |
<filename>src/cogs/edit.py
import asyncio
import json
import discord
from discord.ext import commands
from discord.ext.commands import MissingRequiredArgument
from prettytable import PrettyTable
from sqlalchemy import func
from sqlalchemy.orm import aliased
from datetime import datetime, timedelta
from src.model.chap... | |
return result
return new_func
def _na_for_min_count(
values: np.ndarray, axis: Optional[int]
) -> Union[Scalar, np.ndarray]:
"""
Return the missing value for `values`.
Parameters
----------
values : ndarray
axis : int or None
axis for the reduction, required if values.ndim > 1.
Returns
-------
result :... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.