text stringlengths 2 999k |
|---|
import FWCore.ParameterSet.Config as cms
from Validation.RecoVertex.PrimaryVertexAnalyzer4PUSlimmed_cfi import *
hltMultiPVanalysis = vertexAnalysis.clone()
hltMultiPVanalysis.do_generic_sim_plots = False
hltMultiPVanalysis.verbose = cms.untracked.bool(False)
hltMultiPVanalysis.root_folder = ... |
from .base import * # noqa
from .base import env
# GENERAL
# ------------------------------------------------------------------------------
# https://docs.djangoproject.com/en/dev/ref/settings/#debug
DEBUG = True
# https://docs.djangoproject.com/en/dev/ref/settings/#secret-key
SECRET_KEY = env('DJANGO_SECRET_KEY', de... |
# The MIT license:
#
# Copyright 2017 Andre Netzeband
#
# 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, merg... |
import torch
from typing import Optional
import torch.nn.functional as F
def sample_gumbel(shape: torch.Size, eps: float = 1e-10):
"""
Sample from Gumbel(0, 1)
based on
https://github.com/ericjang/gumbel-softmax/blob/3c8584924603869e90ca74ac20a6a03d99a91ef9/Categorical%20VAE.ipynb ,
(MIT license)
... |
from datetime import date, timedelta
from django.test import TestCase
from corehq.apps.accounting.models import SoftwarePlanEdition, Subscription, DefaultProductPlan, BillingAccount, \
SubscriptionAdjustment
from corehq.apps.export.utils import get_default_export_settings_if_available
from corehq.apps.accounting.... |
import copy
from core.expression import Equal, Predicate, NList, Symbol
from core.functional import replace, RewriteRule, Replacement
import PredicateMetadata as pm
# Needed:
# Metadata/DB for each operation:
# - overwrite (posin, posout)
# - if overwrite to be fixed: register temp as linv temp + sizes/pr... |
# coding=utf-8
# *** WARNING: this file was generated by Pulumi SDK Generator. ***
# *** 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 _utilities
__all__ ... |
import json
import logging
import os
import time
from datetime import datetime
from discord.ext import commands
from pretty_help import PrettyHelp
with open('token.secret')as fp:
TOKEN = fp.read().strip()
fp.close()
with open('config.json') as file:
config = json.load(file)
DESCRIPTION = config["DESC... |
import argparse
from random import choice
import featureflow as ff
import numpy as np
from torch import nn
from torch.nn import functional as F
from torch.optim import Adam
import zounds
from zounds.learn import Conv1d, ConvTranspose1d, to_var, from_var
from zounds.timeseries import categorical, inverse_categorical
... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# ogcservice documentation build configuration file, created by
# sphinx-quickstart on Tue Jul 9 22:26:36 2013.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# ... |
import urllib
tickers = ['YHOO', 'AVP', 'BIIB', 'BP', 'CL', 'CVX',
'DNA', 'EXPE', 'GOOG', 'PG', 'XOM', 'AMGN']
shortest = 300
prices = {}
dates = None
for t in tickers:
url = 'http://ichart.finance.yahoo.com/table.csv?' + \
's=%s&d=11&e=26&f=2006&g=d&a=3&b=12&c=1996' % t + \
'&ign... |
import time
import updater
import logs
import sys
import os
import traceback
if __name__ == "__main__":
if len(sys.argv) > 1 and sys.argv[1] == 'debug':
logs._debug = True
module = updater.Updater()
module.update()
module.download()
os._exit(1)
time.sleep(0.1)
... |
import glob
import importlib
import inspect
import os
import warnings
from contextlib import contextmanager
from contextlib import suppress
from dynaconf import default_settings
from dynaconf.loaders import default_loader
from dynaconf.loaders import enable_external_loaders
from dynaconf.loaders import env_loader
from... |
"""Module for dealing with the toolbar.
"""
import os
import ee
import ipyevents
import ipyleaflet
import ipywidgets as widgets
from ipyfilechooser import FileChooser
from IPython.core.display import display
from .common import *
from .timelapse import *
def tool_template(m=None):
widget_width = "250px"
pa... |
"""
RDA Enhancement
---------------
This module provides RDA enhancements of MARC21 record for catalogs built using
the Catalog Pull Platform.
"""
from setuptools import find_packages, setup
__author__ = "Jeremy Nelson"
__version_info__ = ('0', '0', '3')
__version__ = '.'.join(__version_info__)
setup(
name='rda_... |
import setuptools
with open("README.md", "r") as fh:
long_description = fh.read()
setuptools.setup(
name='pyajax',
version='0.0.6',
url='https://github.com/washim/pyajax',
license='BSD',
author='Washim Ahmed',
author_email='washim.ahmed@gmail.com',
description='Develop ajax based analy... |
import glob
import pandas as pd
import numpy as np
import torch
import torch.nn as nn
from sklearn.metrics import accuracy_score, precision_score, recall_score, f1_score, roc_auc_score
import torch.nn.functional as F
import torch.optim as optim
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
torc... |
"""
Django settings for test_project project.
Generated by 'django-admin startproject' using Django 3.2.5.
For more information on this file, see
https://docs.djangoproject.com/en/3.2/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/3.2/ref/settings/
"""
from pa... |
# 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
from .. import _utilitie... |
import Pyro4
import file_manager
import json
import base64
class Server:
def __init__(self, host, port, identifier="main-"):
self.host = host
self.port = port
self.identifier = identifier
def Start(self, objects):
daemon = Pyro4.Daemon(self.host)
ns = Pyro4.locateNS(sel... |
#! /usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (c) 2013, Clément MATHIEU
# 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 c... |
import argparse
import os
import mmcv
import torch
from mmcv.parallel import MMDataParallel, MMDistributedDataParallel
from mmcv.runner import (get_dist_info, init_dist, load_checkpoint,
wrap_fp16_model)
from mmcv.utils import DictAction
from mmseg.apis import multi_gpu_test, single_gpu_test
... |
# Copyright 2020 The FedLearner Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... |
# --------------------------------------------------------
# Tensorflow Faster R-CNN
# Licensed under The MIT License [see LICENSE for details]
# Written by Jiasen Lu, Jianwei Yang, based on code from Ross Girshick
# --------------------------------------------------------
from __future__ import absolute_import
from __... |
import numpy as np
def subband_filtering(x, h):
"""
implementing the efficient version of the subband filter
as specified by the MP3 standard
Arguments:
x: a new 512-point data buffer, in time-reversed order [x[n],x[n-1],...,x[n-511]].
h: The prototype filter of the fil... |
import httpx
import pytest
from fastapi import status
from tests.data import TestData
@pytest.mark.asyncio
@pytest.mark.workspace_host
class TestListTenants:
async def test_unauthorized(self, test_client_admin: httpx.AsyncClient):
response = await test_client_admin.get("/tenants/")
assert respon... |
# Copyright Pincer 2021-Present
# Full MIT License can be found in `LICENSE` at the project root.
"""
Sent when a user is removed from a guild (leave/kick/ban).
"""
from ..core.dispatch import GatewayDispatch
from ..objects.events.guild import GuildMemberRemoveEvent
from ..utils import Coro
from ..utils.conversion im... |
from plotly.basedatatypes import BaseTraceType as _BaseTraceType
import copy as _copy
class Funnel(_BaseTraceType):
# class properties
# --------------------
_parent_path_str = ""
_path_str = "funnel"
_valid_props = {
"alignmentgroup",
"cliponaxis",
"connector",
"c... |
import os
import pypandoc
from pyramid.response import Response
from pyramid.response import FileResponse
from pyramid.view import view_config
from tempfile import NamedTemporaryFile
from climasng.parsing.docparser import DocParser
from climasng.docassembly.docassembler import DocAssembler
from climasng.docassembly.s... |
# -*- coding: utf-8 -*-
## Copyright 2009-2021 NTESS. Under the terms
## of Contract DE-NA0003525 with NTESS, the U.S.
## Government retains certain rights in this software.
##
## Copyright (c) 2009-2021, NTESS
## All rights reserved.
##
## This file is part of the SST software package. For license
## information, see... |
# Copyright 2018 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... |
import enum
from sqlalchemy import Column, Integer, String, Enum
from vwsfriend.model.base import Base
class UnitOfLength(enum.Enum):
KM = 'km'
MI = 'mi'
class UnitOfTemperature(enum.Enum):
C = 'C'
F = 'F'
class Settings(Base):
__tablename__ = 'settings'
id = Column(Integer, primary_key=... |
#! /usr/bin/env python
import abc
import math
from PyQt5.QtGui import QMatrix4x4, QVector3D
EPSILON = 0.0000001
class Surface(abc.ABC):
def __init__(self, material=None, shader=None):
self.material = material
self.shader = shader
self._epsilon = EPSILON
@abc.abstractmethod
def in... |
"""The implementation of chrF (Popović 2015) and chrF++ (Popović 2017) metrics."""
from typing import List, Sequence, Optional, Dict
from collections import Counter
from ..utils import sum_of_lists
from .base import Score, Signature, Metric
from .helpers import extract_all_char_ngrams, extract_word_ngrams
class CHR... |
import itertools
def analyseLine(l):
x = l.split()
amount = (int(x[3]) * -1) if (x[2] == 'lose') else int(x[3])
return(x[0], amount, x[-1].replace('.', ''))
def getPairs(names):
names = list(names)
names.append(names[0])
r = []
for i in range(len(names) - 1):
r.append((names[i], names[i+1]))
r.append((nam... |
from PySide2.QtCore import Qt
from PySide2.QtWidgets import QCheckBox, QLabel, QWidget, QHBoxLayout
from traitlets import HasTraits, Bool, link, Unicode
from regexport.model import AppState
from regexport.views.utils import HasWidget
class CheckboxModel(HasTraits):
label = Unicode(default_value='')
checked ... |
# -------------------------------------------------------------
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you unde... |
class Solution:
def checkInclusion(self, s1, s2):
"""
:type s1: str
:type s2: str
:rtype: bool
"""
if len(s1) > len(s2): return False
missing = collections.Counter(s1)
chrs = set(s1)
n = len(s1)
for i, ch in enumerate(s2):
i... |
# -*- 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... |
"""User Documentation
A graph holds a collection of nodes and edges. Each node
must be derived from Graph.GraphNode and each edge must
be derived from Graph.GraphEdge.
You can see example classes in Node.py and Edge.py tailored
for network topology.
I Implementation details that you don't really need to know a... |
print("Indrodusca los primeros 6 numeros del bin:")
bin = input ()
print ("")
print("Indrodusca el año actual ej: 2023 solo el 23:")
año = input ()
from random import randrange
print ("==============")
print ("Bins psibles:=")
print ("==============")
print (f"{bin}=")
print ("=======")
print(randrange(10000000000, 600... |
# Collections: List and Dictionary
# List -> A linear collection of values that stay in order
# Dictionary -> A bag of values, each with its own label
# DICTIONARIES
# Dictionaries are Python's most powerful data collection
# Dictionaries allow us to do fast database-like operations in Python
# Dictionaries in Python ... |
from ctypes import BigEndianStructure, Union, c_uint8, c_uint16, c_uint32
from io import BytesIO
from .compat import *
from .error import *
from .packet import *
from .types import *
from .util import *
class Box(Packet):
exception = F4VError
def __init__(self, type, payload, extended_size=False):
s... |
#!/home/ubuntu/backend/venv/bin/python
import sys
import os
import pymongo
from datetime import datetime
from helper import TokenDetails, get_next_timestamp, adjust_timestamp
import logging
from dotenv import load_dotenv
load_dotenv()
db = pymongo.MongoClient(os.getenv("PROD_REMOTE_CONNECTION_STRING"))["parse"]
def... |
# -*- coding: utf-8 -*-
# Copyright (c) 2019, VHRS and Contributors
# See license.txt
from __future__ import unicode_literals
# import frappe
import unittest
class TestFuelCard(unittest.TestCase):
pass
|
#!/usr/bin/env python3
# Copyright (c) 2017-2018 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test various command line arguments and configuration file parameters."""
import os
from test_framewo... |
try:
from django.contrib.postgres.fields import JSONField
except ImportError:
import copy
from django.db import models
from django.utils.translation import ugettext_lazy as _
try:
from django.utils import six
except ImportError:
import six
try:
import json... |
#!/usr/bin/env python
from math import floor
from math import log
from python.decorators import euler_timer
from python.functions import extended_euclid
from python.functions import inverse_mod_n
from python.functions import robust_divide
def unit_a_zero_b(a, b):
_, multiplier = extended_euclid(a, b)
return... |
# This code is part of Qiskit.
#
# (C) Copyright IBM 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.org/licenses/LICENSE-2.0.
#
# Any modifications or derivative wo... |
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy import Column, Integer, String, Float, Sequence, ForeignKey, UniqueConstraint
Base = declarative_base()
def create_all_tables(engine):
Base.metadata.create_all(engine)
class BoardGame(Base):
__tablename__ = "boardgames"
id = Colum... |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.14 on 2018-11-07 08:44
from __future__ import unicode_literals
from django.db import migrations
def populate_entity_type(apps, schema_editor):
"""Populate entity type from attached descriptor schema."""
Entity = apps.get_model('flow', 'Entity')
for enti... |
from cms.models import Menu, CompanyLogo
from django import template
from django.utils import translation
register = template.Library()
@register.simple_tag()
def get_menu(slug, page, logged_in):
# returns a list of dicts with title, url, slug, page and icon of all items in the menu of the given slug or page
... |
import rest
import json
import orm
class Gene(object):
def __init__(self, gene_id, db=None):
self.gene_id=gene_id
Gene.db=db
self.data=Gene.db.genes.find_one({'gene_id':gene_id},{'_id':False})
self.__dict__.update(self.data)
@property
def variants(self):
#if 'varian... |
# coding=utf-8
# Copyright 2018 The Google AI Language Team 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 ... |
"""
Cisco Intersight
Cisco Intersight is a management platform delivered as a service with embedded analytics for your Cisco and 3rd party IT infrastructure. This platform offers an intelligent level of management that enables IT organizations to analyze, simplify, and automate their environments in more advan... |
#
# This source file is part of the EdgeDB open source project.
#
# Copyright 2008-present MagicStack Inc. and the EdgeDB 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... |
import argparse
from train import main
parser = argparse.ArgumentParser(description="Train prototypical networks")
# data args
default_dataset = "geometry"
default_split = "sable-meyer"
parser.add_argument(
"--data.dataset",
type=str,
default=default_dataset,
metavar="DS",
help="data set name (de... |
# -*- coding: utf-8 -*-
class Solution:
def exist(self, board, word):
visited = set()
for i in range(len(board)):
for j in range(len(board[0])):
if self.startsHere(board, word, visited, 0, i, j):
return True
return False
def startsHere(s... |
from typing import List, Tuple
from damage_parameters import DamageParameters
from spell import Spell
from stats import Stats
def _dp_knapsack(weights: List[int], values: List[int], W):
N = len(weights)
weights.insert(0, -1)
values.insert(0, -1)
T = [[0 for _ in range(W + 1)] for _ in range(N + 1)]
... |
'''
Decode "candump" CAN frames or the output of "cantools decode"
read from standard input and plot them using matplotlib.
You can select which signals to plot by specifying them on the command line.
Each signal is one argument and has the pattern "[bo.]sg[:fmt]"
where bo is the name of the message, sg is the name of... |
"""Main QtPyVCP Application Module
Contains the VCPApplication class with core function and VCP loading logic.
"""
import os
import sys
import imp
import inspect
from pkg_resources import iter_entry_points
from qtpy import API
from qtpy.QtCore import QTimer, Slot, Qt
from qtpy.QtWidgets import QApplication, QStyleFac... |
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... |
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... |
import json
class TestUserResourceEndpoints:
def test_user_signup_successfull(self, client):
""" Test for a successful user signup """
response = client.post(
"/api/v1/user/register",
data=json.dumps(
{
"email": "john.doe@feather-insuranc... |
# Copyright 2015-2016 F5 Networks 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 ... |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.29 on 2020-11-22 08:21
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('socialapp', '0001_initial'),
]
operations = [
migrations.RenameField(
... |
from pandas.core.base import StringMixin
from pandas.compat import StringIO, range
import numpy as np
from pandas.core.api import Series, DataFrame
import pandas.stats.common as common
from pandas.util.decorators import cache_readonly
# flake8: noqa
def fama_macbeth(**kwargs):
"""Runs Fama-MacBeth regression.
... |
from handler import Context, Arguments, CommandResult
from utils.confirmations import request_phrase_confirmation
from utils.command_helpers import get_author_player
CONFIRMATION_PHRASE = "Подтверждаю"
async def run(ctx: Context, args: Arguments) -> CommandResult:
player = await get_author_player(ctx)
confi... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sun Feb 25 11:42:23 2018
@author: jcanete
"""
import os
import sys
import random
import warnings
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from tqdm import tqdm
from itertools import chain
from skimage.io import imread, imsh... |
# Copyright 2010 OpenStack Foundation
#
# 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... |
from rest_framework.pagination import LimitOffsetPagination, PageNumberPagination
class JobPageNumberPagination(PageNumberPagination):
page_size = 11
|
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... |
#!/usr/bin/env python
try:
from reverse_mode import *
except:
import sys
sys.path = ['..'] + sys.path
from reverse_mode import *
#############################################################
# TESTING CLASS TC
#############################################################
# TESTING ALL FUNCTIONS FOR BASIC FUNCTI... |
# -*- coding: utf-8 -*-
# spróbój czegos takiego jak
def index(): return dict(message="hello from moje.py")
def aaa(a):
if not request.vars.a:
request.vars.a=123
session.id=request.vars.a
return session.id
|
import json
from bs4 import BeautifulSoup
import pandas as pd
import sys
# Argparsing
argument_index = 1
template = sys.argv[argument_index]
argument_index +=1
recall_json = sys.argv[argument_index]
argument_index +=1
recall_plot = sys.argv[argument_index]
argument_index +=1
precision_jsons_list = [sys.argv[i] for ... |
"""Support for RAOP (AirPlay v1)."""
from abc import ABC, abstractmethod
import asyncio
import logging
from random import randrange
from time import perf_counter
from typing import Any, Dict, List, Mapping, NamedTuple, Optional, Tuple, cast
import weakref
from bitarray import bitarray
from pyatv import exceptions
fro... |
import numpy as np
import tensorflow as tf
from numba import njit
from tensorflow.keras.losses import sparse_categorical_crossentropy
from graphadv.attack.targeted.targeted_attacker import TargetedAttacker
from graphadv.utils.surrogate_utils import train_a_surrogate
from graphgallery.nn.layers import SGConvolution
fr... |
import distutils.spawn
import distutils.version
import os
import os.path as osp
import subprocess
import numpy as np
from gym import error
class SegmentVideoRecorder(object):
def __init__(self, predictor, env, save_dir, checkpoint_interval=500):
self.predictor = predictor
self.env = env
s... |
"""
2021.01.31
Type-hinting would make some of these structures clearer.
Returns a dataset of one-hot-encoded sequences of DNA and whether the motif of
interest is present or absent in the data.
This is done after "datagen" or "make_data.sh" is run.
"""
import pandas as pd
import numpy as np
# ML Preprocessing (OH... |
"""
Copyright 2020 Jackpine Technologies Corporation
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 ... |
from flash_pytorch import FLASHTransformer
from flash_pytorch.autoregressive_wrapper import AutoregressiveWrapper
import random
import tqdm
import gzip
import numpy as np
import torch
import torch.optim as optim
from torch.nn import functional as F
from torch.utils.data import DataLoader, Dataset
# constants
NUM_BAT... |
import numpy as np
from cuttsum.summarizer.filters import APFilteredSummary, \
APSalienceFilteredSummary, HACFilteredSummary, \
APSalTRankSalThreshFilteredSummary, RankedSalienceFilteredSummary
import os
from cuttsum.pipeline import jobs
import cuttsum.judgements as cj
import pandas as pd
import random
import s... |
# Licensed to the .NET Foundation under one or more agreements.
# The .NET Foundation licenses this file to you under the MIT license.
# See the LICENSE file in the project root for more information.
import lldb
import re
import testutils as test
# bpmd -md <MethodDesc pointer>
def runScenario(assembly, debugger, t... |
#!D:\pythonPycharm\analysis_fb\venv\Scripts\python.exe
# EASY-INSTALL-ENTRY-SCRIPT: 'pip==10.0.1','console_scripts','pip3.6'
__requires__ = 'pip==10.0.1'
import re
import sys
from pkg_resources import load_entry_point
if __name__ == '__main__':
sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0])
... |
"""
- Test ETL logic against:
- Spec errors
- Weird transitions
- Database errors (injected / other)
- Unusual data
- Materialization end state
... Hmmm...
- End to end SQL tests (SQL, materialization calls / outcome, SQL, SQL output)
Ephemeral database? ... Yeah, test config.
"""
from contextlib ... |
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'auth.settings')
application = get_wsgi_application()
|
"""Base Module for Simple Username Data Diggers."""
import abc
import logging
import hashlib
import os
from configparser import ConfigParser
from typing import Dict, Optional, Tuple
from OSIx.core.base_module import BaseModule
from OSIx.core.http_manager import HttpNavigationManager
from OSIx.core.temp_file import Te... |
"""
Django settings for backendProject project.
Generated by 'django-admin startproject' using Django 3.2.9.
For more information on this file, see
https://docs.djangoproject.com/en/3.2/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/3.2/ref/settings/
"""
impor... |
import logging
import numpy as np
import pandas as pd
from .normalize import normalize
def pad_data(data, sequence_length, pad_at_begin= False):
"""
Performs data padding for both target and aggregate consumption
:param data: The aggregate power
:type data: np.array
:param context_size: The inpu... |
import json
from typing import Dict, List, Optional, Union
import boto3
from aws_cdk import aws_lambda
from aws_cdk import aws_s3 as s3
from aws_cdk import aws_sns as sns
from aws_cdk import aws_ssm as ssm
from aws_cdk import aws_stepfunctions as sfn
from aws_cdk import core
from botocore.exceptions import ClientError... |
"""
Experiment 4
Description: CCN with one dense layer.
-- Punishing the agent by losing lives with -1 reward
-- With normalized rewards
"""
from src.model import PolicyNetwork
class ModelExperiment4(PolicyNetwork):
NAME = '4'
def __init__(self, execution_number):
super(ModelExperiment4, self).__init... |
import os
import sys
sys.path.append(os.path.dirname(sys.path[0]))
import torch
import torch.nn as nn
import torch.nn.functional as F
from torchnlp.nn import Attention
from torch.nn import Linear, LSTM
from torch_geometric.nn import RGCNConv, TopKPooling, FastRGCNConv
from torch_geometric.nn import global_add_pool, gl... |
import nne
import torchvision
import torch
import numpy as np
input_shape = (1, 3, 224, 224)
model = torchvision.models.resnet34(pretrained=True).cuda()
input_data = np.array(np.random.random_sample(input_shape), dtype=np.float32)
output_data = nne.infer_torch(model, input_data)
|
"""
Given a set of validation predictions, this script computes the optimal linear weights on the validation set.
It computes the weighted blend of test predictions, where some models are replaced by their bagged versions.
"""
import os
import numpy as np
import sys
import theano
import theano.tensor as T
... |
# Generated by Django 3.1 on 2020-09-21 20:58
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('app', '0008_auto_20200920_0550'),
('accounting', '0006_auto_20200921_0301'),
]
operations = [
migrations.AlterField(
model... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import argparse
import subprocess
import tempfile
import gdb
import pwndbg.commands
import pwndbg.vmmap
parser = argparse... |
#!/usr/bin/env python
# ----------------------------------------------------------------------------
# Name: test_interval_chain
# Purpose: Test driver for module interval_chain
#
# Author: Michael Amrhein (michael@adrhinum.de)
#
# Copyright: (c) Michael Amrhein
# -------------------------------------... |
#!/usr/bin/env python3.6
# -*- coding: utf-8 -*-
"""
Created on Thu Sept 1 2018
@author: Jinny Park
"""
import csv
from collections import Counter
#change path
path = "~/n-grams_chord_frequency_by_genre/TopSixCountryDataset.csv"
eachSongs = []
with open(path) as data_file:
reader = csv.reader(data_fil... |
'''
Created on 6 Dec 2018
Updated 10 Feb 2021
@author: thomasgumbricht
'''
# Standard library imports
from os import path
# Third party imports
# Package application imports
#from geoimagine.gdalutilities import GDALstuff
class ProcessUpdateDB:
'''class for layer updating'''
def __init__(self, pp... |
from django.contrib import auth
from django.contrib.auth.base_user import AbstractBaseUser, BaseUserManager
from django.contrib.contenttypes.models import ContentType
from django.core.exceptions import PermissionDenied
from django.core.mail import send_mail
from django.db import models
from django.db.models.manag... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.