input stringlengths 2.65k 237k | output stringclasses 1
value |
|---|---|
# Copyright 2015 Yelp 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 applicable law or agreed to in writing, softwa... | |
<reponame>BlueBrain/covid-19-find<gh_stars>0
import matplotlib.pyplot as plt
import covidlib as cl
import pandas as pd
import math
import numpy as np
import sys
import os
import json
import cdata as cd
import datetime as dt
a=10
minphaselength = 14
maxphaselength = 28
lag = 26
sample =30
#shiftlag=56
shiftlag = lag+s... | |
consumers of
this API, but is indirectly used via the different public interfaces.
see :func:`attribute_exists` (key) for details.
Registered keys which have never been explicitly set to a value do not
exist for the purpose of this call.
"""
# make sure interface is ready to use
d = self._attributes_t_init ()... | |
self.tree = None
# $ANTLR start "process_expr"
# /home/tux/PycharmProjects/ProtoGen_public/Parser/ProtoCC.g:235:5: process_expr : ( expressions | network_send | network_mcast | transaction );
def process_expr(self, ):
retval = self.process_expr_return()
retval.start = self.input.LT(1)
root_0 = None
expre... | |
<reponame>mtaghiza/tinyos-main-1
#!/usr/bin/env python
# Serial Bootstrap Loader software for the MSP430 embedded proccessor.
#
# (C) 2001-2004 <NAME> <<EMAIL>>
# this is distributed under a free software license, see license.txt
#
# http://mspgcc.sf.net
#
# $Id: msp430-bsl.py,v 1.12 2006/04/23 21:28:24 cliechti Exp $
... | |
"""
We implement a power represenation for the value function,
together with methods to initialize and update it
"""
import numpy as np
from scipy.optimize import minimize,nnls
import matplotlib.pyplot as plt
def curve_fit_search_and_grad(gamma, Xi, Yi, Xmax):
Xi_arg = (Xmax + np.exp(gamma[3]) - Xi)/ 100.0
Xi_pow... | |
for non-local libjars (e.g. on EMR).
"""
return self._opts['libjars']
def _interpolate_jar_step_args(self, args, step_num):
"""Like :py:meth:`_interpolate_step_args` except it
also replaces `~mrjob.step.GENERIC_ARGS` with
:py:meth:`_hadoop_generic_args_for_step`. This only
makes sense for jar steps; Spark shoul... | |
# Import any DAObject classes that you will need
from docassemble.base.util import Individual, Person, DAObject
# Import the SQLObject and some associated utility functions
from docassemble.base.sql import alchemy_url, upgrade_db, SQLObject, SQLObjectRelationship
# Import SQLAlchemy names
from sqlalchemy import Column,... | |
from app import db
from models import User, Message, WeekSchedule, UserSchedule, Food, DaysOfSchedule
import random
db.drop_all()
db.create_all()
# These are users
admin = User(name='Admin', email='<EMAIL>', password='<PASSWORD>')
adonay = User(name='Adonay', email='<EMAIL>', password='<PASSWORD>')
mark = User(name='... | |
<filename>tensorbay/client/dataset.py
#!/usr/bin/env python3
#
# Copyright 2021 Graviti. Licensed under MIT License.
#
"""The remote dataset on TensorBay."""
import functools
import logging
import os
import shutil
import tempfile
from typing import TYPE_CHECKING, Any, Dict, Generator, Iterable, Iterator, Optional, Tu... | |
0, np.pi) * (2 * l + 1) / (2 * l * (l + 1)) * a**2 / psi(l, kI * a) * kI**2 / (l * (l + 1))
mBL[ii] = np.sqrt(2) * quadl(lambda th: eHriL(a, th, np.pi / 4) * legendrePl(l, np.cos(
th)) * np.sin(th), 0, np.pi) * (2 * l + 1) / (2 * l * (l + 1)) * a**2 / psi(l, kI * a) * kI**2 / (l * (l + 1))
eBR[ii] = np.sqrt(2) * qua... | |
import tensorflow as tf
import math
import numpy as np
import os
import json
from utils import create_cell_starts, normalize_image, colors_to_int, COLOR_DIMS
DIR = os.path.join('.', 'dataset', 'processed')
class Dataset:
def __init__(self, image_size, grid_size, validation_split=0.15, max_crop=0.1,
saturation=0.5,... | |
/ client["num_ingress" + word + "_packets"], 2),
round(cfg["dut2_num_egress" + word + "_bytes"] / 1000000000, 2), cfg["dut2_num_egress" + word + "_packets"],
round(cfg["dut2_num_egress" + word + "_bytes"] / cfg["dut2_num_egress" + word + "_packets"], 2),
cfg["dut2_real"]])
for server in cfg["loadgen_servers"]... | |
# 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 json
import warnings
import pulumi
import pulumi.runtime
from typing import Union
from .. import utilities, tables
class Assign... | |
URL to which the above requests will be
rewritten by.
:type destination: str
:param preserve_unmatched_path: Whether to preserve unmatched path. Default value is true.
:type preserve_unmatched_path: bool
"""
_validation = {
'odata_type': {'required': True, 'constant': True},
'source_pattern': {'required': True... | |
<filename>dpu_utils/utils/richpath.py
import binascii
import gzip
import json
import os
import glob
import fnmatch
import shutil
import time
import zlib
import io
import pickle
import logging
import tempfile
import re
from abc import ABC, abstractmethod
from collections import OrderedDict
from functoo... | |
# -*- coding: utf-8 -*-
from __future__ import print_function
from __future__ import division
from datetime import datetime
import warnings
import time
import numpy as np
import pandas as pd
from scipy import stats
from numpy import dot, exp
from numpy.linalg import solve, norm, inv
from scipy.linalg import solve as... | |
<filename>dataloader/dataset.py<gh_stars>100-1000
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
SemKITTI dataloader
"""
import os
import numpy as np
import torch
import random
import time
import numba as nb
import yaml
import pickle
from torch.utils import data
from tqdm import tqdm
from scipy import stats as s
#... | |
<reponame>ragerdl/dtrace-stap-book
import os
import sys
import datetime
from tsdoc.blocks import *
import zipfile
from zipfile import ZipFile
from tempfile import NamedTemporaryFile
from xml.etree import ElementTree as etree
class _ZipStream(object):
def __init__(self, zipf, fname):
self.zipf = zipf
self.fname =... | |
user pool.
- **UserPoolClientId** *(string) --* **[REQUIRED]**
The ID of the Amazon Cognito user pool client.
- **UserPoolDomain** *(string) --* **[REQUIRED]**
The domain prefix or fully-qualified domain name of the Amazon Cognito user pool.
- **SessionCookieName** *(string) --*
The name of the cookie used to mai... | |
contentChanged = pyqtSignal(QDateTime)
@property
def content(self):
return self._content
@content.setter
def content(self, date_time:QDateTime):
self._content = date_time
self.contentChanged.emit(self._content)
class DateTimePickerSeries(QWidget):
def __init__(self, model, display:str):
super(D... | |
<filename>src/analyses/plot/plot_utils.py
import pandas as pd
import numpy as np
import seaborn as sns
import seaborn as sn
from training.config import Config
import matplotlib.pyplot as plt
from sklearn.metrics import confusion_matrix
from scipy.optimize import curve_fit
def get_heatmaps(data, no_pred=Fals... | |
the rotation.
"""
return self._coords
def do_rot(self, i):
"""Returns True if rotation is not (close to) identity.
"""
return not np.allclose(self.rots[i], np.zeros(3), rtol=0.0, atol=1.0e-15)
def angle_ref(self, *args, **kwds):
"""Compute the angle between transverse reference direction of initial and final ... | |
import cv2
import random
import numpy as np
import torch
# helper --
# def make_grid_image(width, height, grid_size = 16):
# image = np.zeros((height, width), np.float32)
# for y in range(0, height, 2 * grid_size):
# for x in range(0, width, 2 * grid_size):
# image[y: y + grid_size, x:x + grid_size] = 1
#
# # for y i... | |
<filename>pyCHX/Create_Report.py
'''
Yugang Created at Aug 08, 2016, CHX-NSLS-II
Create a PDF file from XPCS data analysis results, which are generated by CHX data analysis pipeline
How to use:
python Create_Report.py full_file_path uid output_dir (option)
An exmplae to use:
python Create_Report.py /XF11ID/analysis... | |
queryset = FuelSupplier.objects.all()
serializer_class = serializers.FuelSupplierSerializer
def post(self, request, *args, **kwargs):
"""
Creates a number of new FuelSupplier objects
"""
return self.create(request, *args, **kwargs)
class fuelsuppliersGet(AuditableMixin,mixins.ListModelMixin, mixins.CreateMo... | |
import numpy as np
import cv2
import time
from operator import itemgetter
import os
import Queue
from sklearn import svm, ensemble
from skimage.feature import hog, local_binary_pattern, greycomatrix, greycoprops
from sklearn.svm import SVC, SVR
from sklearn.ensemble import RandomForestClassifier, RandomForestRegressor... | |
<filename>qoc/core/lindbladdiscrete.py
"""
linbladdiscrete.py - This module defines methods to
evolve a set of density matrices under the
lindblad master equation using time-discrete
control parameters.
"""
from autograd.extend import Box
import numpy as np
from qoc.core.common import (clip_control_norms,
initialize... | |
<reponame>klayveR/python-poe-timeless-jewel
import org.sikuli.script.SikulixForJython
import math
import sys
import time
import os
import json
from sikuli.Sikuli import *
sys.path.append("scripts/")
from helpers import Helpers
# Sikuli settings
Settings.MoveMouseDelay = 0
Settings.ActionLogs = False
Settings.InfoLog... | |
<reponame>cthomasUpraizall/dateutil<filename>dateutil/parser/isoparser.py
# -*- coding: utf-8 -*-
"""
This module offers a parser for ISO-8601 strings
It is intended to support all valid date, time and datetime formats per the
ISO-8601 specification.
..versionadded:: 2.7.0
"""
from datetime import datetime, timedelta... | |
the attribute value string.
Args:
element: XML element object.
attr: String containing the attribute name.
Returns:
String representing the attribute value.
"""
return element.get(attr)
def get_attribute_value(self, element, attr):
"""
Returns the numeric attribute value.
Args:
element: XML element obje... | |
<filename>boto3_type_annotations_with_docs/boto3_type_annotations/backup/client.py<gh_stars>100-1000
from typing import Optional
from botocore.client import BaseClient
from typing import Dict
from botocore.paginate import Paginator
from datetime import datetime
from botocore.waiter import Waiter
from typing import Unio... | |
<filename>mars/dataframe/indexing/getitem.py
# Copyright 1999-2018 Alibaba Group Holding Ltd.
#
# 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
#
... | |
created by putting \\test commands in the
# documentation.
# The default value is: YES.
GENERATE_TESTLIST = YES
# The GENERATE_BUGLIST tag can be used to enable ( YES) or disable ( NO) the bug
# list. This list is created by putting \\bug commands in the documentation.
# The default value is: YES.
GENERATE_BUGLIST =... | |
#
# Copyright (c) 2006-2013, Prometheus Research, LLC
#
"""
:mod:`htsql.core.tr.fn.bind`
============================
"""
from ...util import aresubclasses
from ...adapter import Adapter, Component, adapt, adapt_many, call
from ...domain import (Domain, UntypedDomain, BooleanDomain, TextDomain,
IntegerDomain, Deci... | |
is not None:
query_parameters['$expand'] = self._serialize.query("expand", expand, '[str]', div=',')
request = self._client.get(url, query_parameters, header_parameters)
else:
url = next_link
query_parameters = {} # type: Dict[str, Any]
request = self._client.get(url, query_parameters, header_parameters)
return... | |
_infoblox_type = 'awsuser'
_fields = ['access_key_id', 'account_id', 'last_used', 'name',
'nios_user_name', 'secret_access_key', 'status']
_search_for_update_fields = ['access_key_id', 'account_id', 'name']
_updateable_search_fields = ['access_key_id', 'account_id', 'name',
'nios_user_name']
_all_searchable_field... | |
Stator iron fill factor per Grauers
k_fillr : float
Rotor slot fill factor
k_fills : float
Stator Slot fill factor
k_s : float
magnetic saturation factor for iron
m : int
Number of phases
mu_0 : float, [m*kg/s**2/A**2]
permeability of free space
mu_r : float, [m*kg/s**2/A**2]
relative permeability (neodymiu... | |
return Table([row.map(func) for row in self], default=self.default)
def as_list(self):
"""Convert the table to a list of dictionaries.
Examples
--------
>>> table = Table([{"a": 1, "b": 2}, {"a": 3, "b": 4}])
>>> table.as_list()
[{'a': 1, 'b': 2}, {'a': 3, 'b': 4}]
Returns
-------
list: list of dictionarie... | |
<reponame>claytonbrown/security_monkey<filename>security_monkey/common/utils/PolicyDiff.py<gh_stars>0
#!/usr/bin/env python2.7
# -*- coding: utf-8 -*-
# ^^ required by pep-0263 for "¿?"
# Copyright 2014 Netflix, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except ... | |
of the features to consider when looking for the best split at each node.
Attributes
----------
classes_ : ndarray of shape (n_classes,)
The class labels.
max_features_ : int
The inferred value of max_features.
n_samples_ : int
The number of samples when `fit` is performed.
n_features_ : int
The number of fe... | |
import csv
import obspy
import numpy as np
import warnings
from copy import deepcopy
from obspy import taup
from obspy.geodetics import gps2dist_azimuth
from os.path import basename, exists
from mtuq.util import AttribDict, warn
from mtuq.util.cap import WeightParser, taper
from mtuq.util.signal import cut, get_arriv... | |
none or a string of all 0's, so we check for both
return not (cg_id is None or utils.NULL_REF == cg_id)
def _create_snapshot_volume(self, image):
"""Creates snapshot volume for given group with snapshot_id."""
group = self._get_snapshot_group(image['pitGroupRef'])
LOG.debug("Creating snap vol for group %s", grou... | |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright 2021 <NAME>. 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.org/licenses/LICENSE-2.0
#... | |
from rlcard.utils import *
from rlcard.games.whist.utils import cards2list
import os
class Env(object):
'''
The base Env class. For all the environments in RLCard,
we should base on this class and implement as many functions
as we can.
'''
def __init__(self, config):
''' Initialize the environment
Args:
co... | |
<reponame>dbis-ilm/grizzly<gh_stars>10-100
from grizzly.expression import ExpressionException
import unittest
import sqlite3
import re
import grizzly
from grizzly.aggregates import AggregateType
from grizzly.sqlgenerator import SQLGenerator
from grizzly.relationaldbexecutor import RelationalExecutor
class CodeMatche... | |
<filename>tools/idl_parser/idl_parser.py
#!/usr/bin/env python
# Copyright (c) 2013 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.
"""Parser for Web IDL."""
#
# IDL Parser
#
# The parser uses the PLY yacc library to buil... | |
'Right Arm': 46,
'Left Leg': 46,
'Right Leg': 46,
'Chest': 46,
'Abdomen': 46
}
participant_settingsWarm = {
'Left Face': 40,
'Right Face': 40,
'Left Arm': 40,
'Right Arm': 40,
'Left Leg': 40,
'Right Leg': 40,
'Chest': 40,
'Abdomen': 40
}
else:
dlg1 = gui.fileOpenDlg(tryFilePath="", tryFileName="", promp... | |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
@version: 1.4.0
@file: GSP_main.py
@time: 2021/1/26 10:50
@functions: graph signal processing main script
@update: support Yeo-ICN definition
@update: support ICN-level brain activity and connecitivty strength saving
"""
import numpy as np
import glob
import os
impor... | |
#!/usr/bin/env python
# encoding: utf-8
#
# Copyright SAS 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 applica... | |
#!../../../../virtualenv/bin/python3
# -*- coding: utf-8 -*-
# NB: The shebang line above assumes you've installed a python virtual environment alongside your working copy of the
# <4most-4gp-scripts> git repository. It also only works if you invoke this python script from the directory where it
# is located. If these... | |
# coding=utf-8
# Copyright 2020 The Google Research Authors.
#
# 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 l... | |
<filename>rtCommon/fileWatcher.py
"""
FileWatcher implements a class that watches for files to be created in a directory and then
returns the notification that the files is now available.
The FileWatcher class is a virtual class of sorts with two underlying implementations, one
for Mac and Windows (WatchdogFileWatcher... | |
# coding: utf-8
"""
UltraCart Rest API V2
UltraCart REST API Version 2 # noqa: E501
OpenAPI spec version: 2.0.0
Contact: <EMAIL>
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from __future__ import absolute_import
import re # noqa: F401
# python 2 and python 3 compatibility library
im... | |
from .typing import Any, Dict, Iterable, List, Mapping, Optional, TypedDict, Union
from .url import filename_to_uri
import os
import sublime
TextDocumentSyncKindNone = 0
TextDocumentSyncKindFull = 1
TextDocumentSyncKindIncremental = 2
class DiagnosticSeverity:
Error = 1
Warning = 2
Information = 3
Hint = 4
cl... | |
self._remove_empty_and_cast(tuple_data)
raise NotImplementedError('Serialization of {} has not yet been implemented'.format(content_type))
class QueryParameter(ParameterBase, StyleFormSerializer):
def __init__(
self,
name: str,
required: bool = False,
style: typing.Optional[ParameterStyle] = None,
explode: bo... | |
<reponame>r3k4t/AutoTorIP
import os
import sys
import requests
import socks
import time
from colorama import init
init(strip=not sys.stdout.isatty())
from termcolor import cprint
from pyfiglet import figlet_format
os.system("clear")
cprint(figlet_format('AutoTorIP'),'green',attrs=['bold'])
print (chr(27)+"[34m"+" Ver... | |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#############################################################################
##
## This file is part of Tango Control System
##
## http://www.tango-controls.org/
##
## Author: <NAME>
##
## This is free software; you can redistribute it and/or modify
## it under the terms ... | |
#!/usr/bin/python
''' Copyright (c) 2014, <NAME>
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this
list of conditions and ... | |
is breached.
id: :class:`~async_v20.TransactionID`
The Transaction's Identifier.
time: :class:`~async_v20.DateTime`
The date/time when the Transaction was created.
user_id: :class:`int`
The ID of the user that initiated the creation of the Transaction.
account_id: :class:`~async_v20.AccountID`
The ID of the Acc... | |
export(self, outfile, level, namespaceprefix_='', namespacedef_='xmlns:pc="http://schema.primaresearch.org/PAGE/gts/pagecontent/2010-03-19"', name_='MathsRegionType', pretty_print=True):
imported_ns_def_ = GenerateDSNamespaceDefs_.get('MathsRegionType')
if imported_ns_def_ is not None:
namespacedef_ = imported_ns_de... | |
"""Tests for the policies in the hbaselines/goal_conditioned subdirectory."""
import unittest
import numpy as np
import tensorflow as tf
import os
from gym.spaces import Box
from hbaselines.utils.tf_util import get_trainable_vars
from hbaselines.goal_conditioned.td3 import GoalConditionedPolicy as \
TD3GoalConditione... | |
],
[ "c", "a", "t#^", [ AE, AE, ] ],
[ "^^^", "a", Anything, [ EY, ] ],
[ "^.", "a", "^e", [ EY, ] ],
[ "^.", "a", "^i", [ EY, ] ],
[ "^^", "a", Anything, [ AE, ] ],
[ "^", "a", "^##", [ EY, ] ],
[ "^", "a", "^#", [ EY, ] ],
[ "^", "a", "^#", [ EH, EY, ] ],
[ Anything, "... | |
<reponame>brettin/liquidhandling
import json
from liquidhandling import Properties
STEP_DELIMITER = "!@#$"
class SoloSoft:
def __init__(self, filename=None, plateList=None, pipeline=None):
self.filename = None
self.plateList = []
self.pipeline = []
# *Open protocol file for editing
try:
if filename != None:
... | |
<reponame>pixlra/HARP-fork
#!/usr/bin/env python
# coding: utf8
# (c) 2014 <NAME>, <NAME>
# File licensed under GNU GPL (see HARP_License.txt)
import sys, os
__builtins__.ProjectDir = os.path.abspath("../")
assert( "HARP" in os.path.basename(ProjectDir) )
__builtins__.LibDir = ProjectDir + "/PythonLib"
__builtins__.T... | |
# 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, Union, overload
from .. import... | |
group =
"""
1 * Cs u0 {2,S} {3,S} {4,S} {5,S}
2 Cd u0 {1,S} {6,D}
3 Cd u0 {1,S} {7,D}
4 Cb u0 {1,S}
5 Cs u0 {1,S}
6 C u0 {2,D}
7 C u0 {3,D}
""",
thermo = u'Cs-(Cds-Cds)(Cds-Cds)CbCs',
shortDesc = u"""""",
longDesc =
u"""
""",
)
entry(
index = 617,
label = "Cs-(Cds-Cds)(Cds-Cds)CbCs",
group =
"""
1 * Cs u0 {2... | |
#!/usr/bin/env python3
# Script to control LimitlessLED DualWhite, RGB+W and RGBWW/CW bulbs through v6 WiFi Bridge.
#
# <NAME>'s work for Domoticz has been a huge influence while making this script,
# which is tailored to be a CLI tool for integration with HA-bridge and Amazon Echo (Alexa).
#
# Requires Python 3.
#
# ... | |
<filename>tests/test_render_meshes_clipped.py
# Copyright (c) Facebook, Inc. and its affiliates.
# All rights reserved.
#
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree.
"""
Checks for mesh rasterization in the case where the ca... | |
= new_name
else:
module.fail_json(changed=False, msg=str(err))
new_keys = []
if key_state == 'create':
try:
while key_count > key_qty:
new_keys.append(iam.create_access_key(
user_name=name).create_access_key_response.create_access_key_result.access_key)
key_qty += 1
changed = True
except boto.exception.Bot... | |
<filename>Amii2.py
# -*- coding: utf-8 -*-
import LINETCR
import urllib
import subprocess
import profile
import requests
from LINETCR.lib.curve.ttypes import *
from datetime import datetime
import time,random,sys,json,codecs,threading,glob,re
from bs4 import BeautifulSoup
from threading import Thread
import urllib3
c... | |
<gh_stars>1-10
# -*- coding: utf-8 -*-
"""
This source code file is licensed under the GNU General Public License Version 3.
For full details, please refer to the file "LICENSE.txt" which is provided as part of this source code package.
Copyright (C) 2020 THL A29 Limited, a Tencent company. All rights reserved.
"""
im... | |
#analyze jsonl file form cause_effect sentence entity labeling (semantic role labeling)
import srsly
import csv
import sys
import datetime
file_name = "checkin_four_all_labels"
file_path = "C://Users//buchh//OneDrive/Desktop//cm//cm_jsonl//"+file_name+".jsonl"
file_name_answers = "answers2_answers"
file_path_answers ... | |
self.canvas.bind('<Shift-Down>', lambda event: self.pan_down(fraction = 1. / self.axes_height))
self.canvas.bind('<Shift-Left>', lambda event: self.pan_left(fraction = 1. / self.axes_width))
self.canvas.bind('<Shift-Right>', lambda event: self.pan_right(fraction = 1. / self.axes_width))
self.canvas.bind('=', lambda ... | |
self.columns = columns
self.frame = self.frame[self.columns]
else:
self.columns = frame.columns
self._chk_truncate()
self.adj = _get_adjustment()
def _chk_truncate(self):
'''
Checks whether the frame should be truncated. If so, slices
the frame up.
'''
# Column of which first element is used to determine ... | |
import pprint
import copy
import random
import numpy as np
from sureal.tools.misc import empty_object, get_unique_sorted_list
from sureal.tools.decorator import memoized as persist
from sureal.tools.misc import get_unique_sorted_list
__copyright__ = "Copyright 2016-2018, Netflix, Inc."
__license__ = "Apache, Version... | |
+
cmp_meta[f"DS_{ds_pure_id}_Description"],
"RepairAction": cmp_meta[
f"DS_{ds_pure_id}_Repair_Description"]
}})
else:
ds_combo = [f'DS{_.start() + 1}'
for _ in re.finditer(
'1', ds_map[::-1])]
ls_meta.update({f"DS{ds_id}": {
"Description": 'Combination of ' +
' & '.join(ds_combo),
"RepairAction": 'Combi... | |
- m.x831 - m.x832 - m.x833 - m.x834 == 0)
m.c483 = Constraint(expr= m.x351 - m.x835 - m.x836 - m.x837 - m.x838 - m.x839 - m.x840 - m.x841 == 0)
m.c484 = Constraint(expr= m.x842 <= 50)
m.c485 = Constraint(expr= m.x843 <= 50)
m.c486 = Constraint(expr= m.x844 <= 50)
m.c487 = Constraint(expr= m.x845 <= 100)
m.c488 = ... | |
QuantumCircuit
from qiskit.tools.visualization import circuit_drawer
q = QuantumRegister(1)
c = ClassicalRegister(1)
qc = QuantumCircuit(q, c)
qc.h(q)
qc.measure(q, c)
circuit_drawer(qc)
"""
image = None
config = user_config.get_config()
# Get default from config file else use text
default_output = 'text'
... | |
<reponame>OdedH/CLIP-ViL
# coding=utf-8
# Copyleft 2019 project LXRT.
import collections
import os
import random
from tqdm import tqdm
import numpy as np
import torch
import torch.nn as nn
from torch.utils.data import DataLoader
from param import args
from pretrain.lxmert_data import InputExample, LXMERTDataset, LXM... | |
import pandas as pd
from Bio.PDB import Selection, PDBParser, Superimposer
# from Bio.PDB.vectors import rotmat, Vector
import numpy as np
import h5py
from tqdm import tqdm
import os
import multiprocessing as mp
"""
PDB file --> beads center DataFrame --> local structure --> rotated local structure
Functions in this... | |
h[1].data
h[1].data = None
h[1].writeto(self.temp('test.fits'))
with fits.open(self.temp('test.fits')) as h:
assert h[1].data is None
assert h[1].header['NAXIS'] == 0
assert 'NAXIS1' not in h[1].header
assert 'NAXIS2' not in h[1].header
def test_invalid_blank(self):
"""
Regression test for https://github.co... | |
from django.test import TestCase
from django.urls import reverse
from django.contrib.auth import get_user_model
from petition.models import Organization, Petition, PytitionUser
from petition.helpers import get_update_form
from petition.forms import DeleteAccountForm
users = ['julia', 'john', 'max', 'sarah']
orgs = [... | |
elif data_type.endswith("FLOAT"):
precision, = unpack(">h", payload[4:6])
unit = payload[8:16].rstrip(b"\0")
limits = unpack(">6f", payload[16 : 16 + 6 * 4])
info += "precision=%r,unit=%r,limits=%r" % (precision, unit, limits)
elif data_type.endswith("ENUM"):
nstrings, = unpack(">h", payload[4:6])
strings = payl... | |
creation.
:param Mapping[str, str] tags: A map of tags to assign to ecs resources.
:param int task_count: The number of tasks to create based on the TaskDefinition. The default is 1.
"""
pulumi.set(__self__, "task_definition_arn", task_definition_arn)
if enable_ecs_managed_tags is not None:
pulumi.set(__self__, "... | |
<gh_stars>1-10
"""Módulo 'normalizer' de georef-ar-api
Contiene funciones que manejan la lógica de procesamiento
de los recursos que expone la API.
"""
import logging
from flask import current_app
from service import data, params, formatter, address, location, utils
from service import names as N
from service.query_r... | |
# coding=utf-8
##########################################################
# Authors: <NAME>, <NAME>, <NAME>
# Affiliation: University of Geneva
# Version: 1.4.5
# Date: 13.01.2022
# Downscaling of Swiss LCLU data
##########################################################
# import libraries
import numpy, math
import pa... | |
<gh_stars>0
# -*- coding: utf-8 -*-
#
# Copyright 2020 Google LLC
#
# 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applic... | |
from django.db import models
from django.contrib.auth.models import User
from datetime import date
class Profile(models.Model):
user = models.OneToOneField(User, on_delete=models.CASCADE)
user_data = models.FileField(upload_to='user_data',blank = True, null=True)
indicateurs_data = models.FileField(upload_to='indi... | |
"""<NAME>'s Really library
_______ _______ _______ _______ _______ _______
|\ /|\ /|\ /|\ /|\ /|\ /|
| +---+ | +---+ | +---+ | +---+ | +---+ | +---+ |
| | | | | | | | | | | | | | | | | | |
| |R | | |E | | |A | | |L | | |L | | |Y | |
| +---+ | +---+ | +---+ | +---+ | +---+ | +---+ |
|/_____\|/_____\|/_____\|/__... | |
one format. Multiwords like in “we have set that out below” are recognized (depending on your NLP processor)."
assert actual == expected, (
"expected: " + str(expected) + ", actual: " + str(actual)
)
# def test_command_line_interface(self):
# """Test the CLI."""
# runner = CliRunner()
# result = runner.invoke(c... | |
"""
"""
import gzip
import pickle
import astropy.units as u
import numpy as np
from template_builder.utilities import *
from template_builder.extend_templates import *
from ctapipe.coordinates import CameraFrame, NominalFrame, GroundFrame, \
TiltedGroundFrame
from astropy.coordinates import SkyCoord, AltAz
from as... | |
import warnings
from collections import defaultdict
from typing import Union
import numpy as np
import tensorflow as tf
import tensorflow.keras.backend as K
from .. import ModelVisualization
from ..utils import get_num_of_steps_allowed, is_mixed_precision, listify
from ..utils.regularizers import LegacyRegularizer
fr... | |
array."""
with pytest.raises(ValueError):
second_derivative(deriv_1d_data.values[None, :].T, x=deriv_1d_data.x, axis=1)
def test_second_derivative_scalar_delta():
"""Test second_derivative with a scalar passed for a delta."""
df_dx = second_derivative(np.arange(3), delta=1)
assert_array_almost_equal(df_dx, np.ar... | |
<filename>kasaya/core/protocol/transport/py3bson.py
#!/usr/bin/env python3
#coding: utf-8
###############################################################################
#
# This module implements BSON parsing and serialization in accordance
# to version 1.0 of the specification, http://bsonspec.org/#/specification
#
#... | |
from kiwoom import config
from kiwoom.config import valid_event
from functools import wraps
from textwrap import dedent
from types import LambdaType
from inspect import (
getattr_static,
ismethod,
isfunction,
isclass,
ismodule
)
class Connector:
"""
Decorator class for mapping empty events to user implementin... | |
# Version 2018.06.05
import GenericHazards
import string, time, os, re, types, copy, LogStream, collections
import ModuleAccessor, SampleAnalysis, EditAreaUtils, VTECTable
import math
import Tkinter
import LocalizationSupport
from AbsTime import *
from com.raytheon.uf.common.dataplugin.gfe.reference import ReferenceD... | |
For example, the key ``PRODUCT`` is valid for all supported operating system types. The key ``MSRC_SEVERITY`` , however, is valid only for Windows operating systems, and the key ``SECTION`` is valid only for Ubuntu operating systems.
Refer to the following sections for information about which keys may be used with eac... | |
<filename>pipeline/test_dataformat_csv.py
# Copyright 2021 StreamSets 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 b... | |
<filename>tests/test_graphqlws_subscription.py
import asyncio
import json
import sys
import warnings
from typing import List
import pytest
from parse import search
from gql import Client, gql
from gql.transport.exceptions import TransportServerError
from .conftest import MS, WebSocketServerHelper
# Marking all test... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.