text stringlengths 1 927k |
|---|
from funcs.other import scope, debugmode, report_bug, my_eval |
import json
import flask
import datetime
from ruddock.resources import Permissions
from ruddock.decorators import login_required
from ruddock.modules.birthdays import blueprint, helpers
@blueprint.route('/')
@login_required(Permissions.BIRTHDAYS)
def show_bdays():
"""Displays a list of birthdays for current studen... |
from hms_workflow_platform.core.queries.base.base_query import *
class PractitionerScheduleQuery(BaseQuery):
def __init__(self, site):
super().__init__()
self.adapter = self.get_adapter(site)
self.query = self.adapter.query
def practitioner_schedule_create(self, date):
return ... |
# Generated by Django 3.0.7 on 2020-10-24 14:16
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('users', '0004_auto_20201017_1631'),
]
operations = [
migrations.AlterField(
model_name='user',
name='date_birth',
... |
import pymongo
import pytest
from helpers.client import QueryRuntimeException
from helpers.cluster import ClickHouseCluster
cluster = ClickHouseCluster(__file__)
node = cluster.add_instance('node', with_mongo=True)
@pytest.fixture(scope="module")
def started_cluster():
try:
cluster.start()
yie... |
import click
import pandas as pd
from civic_jabber_ingest.external_services.newspaper import load_news
from civic_jabber_ingest.external_services.open_states import get_all_people
from civic_jabber_ingest.regs.va import load_va_regulations
from civic_jabber_ingest.utils.config import read_config
@click.group()
def ... |
"""
Globals and utility functions for interacting with the jobs collection in the application database.
"""
import virtool.jobs.manager
import virtool.utils
OR_COMPLETE = [
{"status.state": "complete"}
]
OR_FAILED = [
{"status.state": "error"},
{"status.state": "cancelled"}
]
#: The default MongoDB proj... |
# -*- coding: utf-8 -*-
"""
sentry.testutils.fixtures
~~~~~~~~~~~~~~~~~~~~~~~~~
:copyright: (c) 2010-2014 by the Sentry Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
from __future__ import absolute_import, print_function, unicode_literals
import copy
import json
import os
import... |
from djangobench.utils import run_benchmark
def benchmark():
global Book
Book.objects.all().delete()
def setup():
global Book
from query_delete_related.models import Book, Chapter
b1 = Book.objects.create(title='hi')
b2 = Book.objects.create(title='hi')
b3 = Book.objects.create(title='hi'... |
# --------------------------------------------------------
# Fast R-CNN
# Copyright (c) 2015 Microsoft
# Licensed under The MIT License [see LICENSE for details]
# Written by Ross Girshick
# --------------------------------------------------------
import xml.dom.minidom as minidom
import os
# import PIL
import numpy ... |
#!/usr/bin/env python3
__author__ = 'Alexis Rodriguez'
__version__ = '1.0'
__email__ = 'rodriguez10011999@gmail.com'
"""
Sources used for scoring descriptions:
- CompTIA CySa+ Study Guide by Mike Chapple and David Seidl
- https://www.first.org/cvss/v3.0/specification-document
Example CVSS v2 : CVSS2#AV:N/AC:L/... |
#!/usr/bin/python
from . import app as application |
"""
Minimal character-level Vanilla RNN model. Written by Andrej Karpathy (@karpathy)
BSD License
"""
import numpy as np
import time
import torch
import torch.nn as nn
from torch.autograd import Variable
import torch.nn.functional as F
def run(write_to):
torch.set_num_threads(1)
start = time.time()
data = open... |
# -*- coding: utf-8 -*-
"""
model_440_basicChSa.py: erosion model using depth-dependent cubic diffusion
with a soil layer, basic stream power, and discharge proportional to drainage
area.
Model 440 BasicChSa
Landlab components used: FlowRouter, DepressionFinderAndRouter,
FastscapeStreamPower,... |
##
## Script to Build CORE UEFI firmware
##
##
## Copyright Microsoft Corporation, 2015
##
IgnoreList = [ "nt32pkg.dsc", #NT32 pkg requires windows headers which are not supplied on build system
"Nt32PkgMsCapsule.dsc", #NT32 capsule pkg requires windows headers which a... |
"""Top-level package."""
__version__ = '0.1.3+dev'
__all__ = ['func', 'PROJECT_CONST']
__private__ = []
__known_refs__ = {'PROJECT_CONST': ':obj:`~.subpkg.submod.PROJECT_CONST`'}
from . import mod
from .subpkg.submod import PROJECT_CONST
def func(a):
"""This is a function that just returns `a`."""
return a |
import logging
import multiprocessing
from multiprocessing import Queue
LOG = logging.getLogger('octopus')
class ProcessQueue:
__instance = None
def __new__(cls, *args, **kwargs):
if cls.__instance:
return cls.__instance
else:
obj = super().__new__(cls, *args, **kwarg... |
#!/usr/bin/env python3
# Copyright 2021 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.
"""Tests different flags to see if they are being used correctly"""
import boot_data
import common
import unittest
import unittest.mo... |
#!/usr/bin/env python
"""
Copyright (c) 2014-2018 Alex Forencich
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,... |
#!/usr/bin/env python3
# Copyright 2020 L. David Baron
#
# 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 la... |
"""
Co-occurrence Matrix / Cluster MDS Map
===============================================================================
>>> from techminer2 import *
>>> directory = "data/"
>>> file_name = "sphinx/images/co_occurrence_matrix_cluster_mds_map.png"
>>> co_occurrence_matrix_cluster_mds_map(
... 'author_keywords',
.... |
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... |
# -*- encoding: utf-8 -*-
#
# Copyright 2013 Hewlett-Packard Development Company, L.P.
# 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.a... |
#
# Copyright 2019 EPAM Systems
#
# 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 a... |
# This file was automatically generated by SWIG (http://www.swig.org).
# Version 2.0.10
#
# Do not make changes to this file unless you know what you are doing--modify
# the SWIG interface file instead.
from sys import version_info
if version_info >= (3,0,0):
new_instancemethod = lambda func, inst, cls: _GeomPla... |
from enum import Enum
from typing import Generator, Tuple, Iterable, Dict, List
import cv2
import matplotlib.pyplot as plt
import numpy as np
import seaborn as sns
from scipy.ndimage import label, generate_binary_structure
from scipy.ndimage.morphology import distance_transform_edt as dist_trans
import trainer.lib as... |
from flask import Flask
app = Flask(__name__)
from api import views |
# -*- coding: utf-8 -*-
# PLEASE DO NOT EDIT THIS FILE, IT IS GENERATED AND WILL BE OVERWRITTEN:
# https://github.com/ccxt/ccxt/blob/master/CONTRIBUTING.md#how-to-contribute-code
from ccxt.base.exchange import Exchange
from ccxt.base.errors import ExchangeError
from ccxt.base.errors import AuthenticationError
from cc... |
#!/usr/local/bin/python3
# coding: utf-8
# Webhook - server.py
# 2/11/21 08:49
#
__author__ = "Benny <benny.think@gmail.com>"
import os
import logging
import json
import subprocess
import requests
import platform
from http import HTTPStatus
from concurrent.futures import ThreadPoolExecutor
from tornado import web, ... |
from django.db import models
from websiteFunctions.models import Websites
from datetime import datetime
class IncJob(models.Model):
website = models.ForeignKey(Websites, on_delete=models.CASCADE)
date = models.DateTimeField(default=datetime.now, blank=True)
class JobSnapshots(models.Model):
job = models.F... |
from django.conf.urls import url, include
from systemconfig.views import *
app_name = 'systemconfig'
urlpatterns = [
url(r'^admin/', include([
url(r'^addcity/', citytown.addCityTown.as_view(), name='city.admin.addcity'),
url(r'^savecity/', citytown.saveCityTown.as_view(), name='city.admin.savecit... |
import logging
import time
import traceback
from pathlib import Path
from secrets import token_bytes
from typing import Any, Dict, List, Optional, Tuple
from blspy import AugSchemeMPL
from dogia.types.blockchain_format.coin import Coin
from dogia.types.blockchain_format.program import Program
from dogia.types.blockch... |
import librosa
import numpy as np
from python_speech_features import mfcc
from corpus.audible import Audible
from util.audio_util import ms_to_frames
from util.string_util import normalize
class Segment(Audible):
"""
Base class for audio segments
"""
# cache features
_mag_specgram = None
_po... |
from mpmath import *
def test_pslq():
mp.dps = 15
assert pslq([3*pi+4*e/7, pi, e, log(2)]) == [7, -21, -4, 0]
assert pslq([4.9999999999999991, 1]) == [1, -5]
assert pslq([2,1]) == [1, -2]
def test_identify():
mp.dps = 20
assert identify(zeta(4), ['log(2)', 'pi**4']) == '((1/90)*pi**4)'
mp.... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
import os
sys.path.insert(0, os.path.abspath('..'))
import unittest
import time
from async_gui.compat import thread
import multiprocessing
from async_gui.engine import return_result, Engine
#from async_gui.toolkits.pyqt import PyQtEngine as Engine
engine = En... |
import copy
import time
from collections import OrderedDict
import torch
from data.dataloader import local_client_dataset, test_dataset
from models.utils import *
from utils.train_helper import validate_one_model
from utils.sampling import *
import numpy as np
from multiprocessing import Process
import time
def re... |
#!/usr/bin/env python3
# _*_ coding:utf-8 _*_
import requests
# 脚本信息
######################################################
NAME='CVE_2019_2725'
AUTHOR="RabbitMask"
REMARK='Weblogic RCE'
FOFA_RULE='app="Oracle-BEA-WebLogic-Server"'
######################################################
VUL = ['CVE-2019-2725']
de... |
#!/usr/bin/env python3
# This script, which is not part of the pdfannots package, allows pdfannots
# to by run directly from a source tree clone.
import sys
from pdfannots.cli import main
if __name__ == '__main__':
sys.exit(main()) |
# Copyright The PyTorch Lightning team.
#
# 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 i... |
from setuptools import setup, find_packages
version = "1.2.0"
setup(
name="holland.backup.random",
version=version,
description="Back up data from /dev/random",
long_description="""\
Uses /dev/random. A bit more of an example then holland.backup.example
""",
classifiers=[], # Get stri... |
# This file is Copyright (c) 2015 Sebastien Bourdeauducq <sb@m-labs.hk>
# This file is Copyright (c) 2016-2019 Florent Kermarrec <florent@enjoy-digital.fr>
# This file is Copyright (c) 2018 John Sully <john@csquare.ca>
# License: BSD
"""LiteDRAM Crossbar."""
from functools import reduce
from operator import or_
from... |
description = 'STRESS-SPEC setup with Huber Eulerian cradle'
group = 'basic'
includes = [
'standard',
'sampletable',
]
sysconfig = dict(
datasinks = ['caresssink'],
)
tango_base = 'tango://motorbox06.stressi.frm2.tum.de:10000/box/'
devices = dict(
chis_m = device('nicos.devices.tango.Motor',
... |
import flask
import flask_login
from . import app
class User(flask_login.UserMixin):
def __init__(self):
self.id = 'admin'
login_manager = flask_login.LoginManager()
login_manager.login_view = "login"
login_manager.init_app(app)
@login_manager.user_loader
def load_user(user_id):
return User()
@... |
from time import sleep
from auth import get_drive_instance
from api import list_dir, check_files_exist, up_folder
drive = get_drive_instance()
parent_id = "1Bkoka3pDX60O3oqFKv0P85oiN1SmDpSZ"
# check_files_exist(drive, [1], parent_id)
up_folder(drive, 'folder_a', parent_id, up_mode=1, recursive=True) |
# Copyright (C) 2015 Yahoo! Inc. 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 applicable law... |
import json
import zipfile
#from convlab2.dst.sumbt.multiwoz_zh.sumbt_config import *
import os
def trans_value(value):
trans = {
"": '未提及',
'没有提到': '未提及',
'没有': '未提及',
'未提到': '未提及',
'一个也没有': '未提及',
'无': '未提及',
'是的': '有',
'不是': '没有',
'不关心': '不在... |
import functools
# Python 'map' function takes:
# Mapping from N values to N values
# 1.) a function (callable)
# 2.) variable number of iterables
print("----------Map N -> N----------")
my_list = [1, 2, 3]
def square_value(val):
return val**2
my_list_squared = list(map(square_value, my_list))
print(my_list_sq... |
# picbed gunicorn config
from os.path import abspath, dirname, join, exists, isdir
from os import getenv, mkdir
from multiprocessing import cpu_count
from config import GLOBAL
def delete_hookloadtime():
from libs.storage import get_storage
s = get_storage()
del s['hookloadtime']
IS_RUN = True if getenv... |
"""
爬取百度指数的某一时间段内的特定关键词的所有指数
"""
import time
import looter as lt
import requests
import pandas as pd
import arrow
from loguru import logger
words = [] # 关键词列表
start_date = '2018-01-29'
end_date = '2018-12-31'
kinds = ['all', 'pc', 'wise']
domain = 'http://index.baidu.com'
headers = {
'Host':
'index.baidu.com'... |
# https://www.hackerrank.com/challenges/three-month-preparation-kit-separate-the-numbers/problem
#!/bin/python3
import math
import os
import random
import re
import sys
#
# Complete the 'separateNumbers' function below.
#
# The function accepts STRING s as parameter.
#
def separateNumbers(s):
for z in range(1, ... |
import pytest
from typing import List
from spacy.tokens import Doc
from spacy.vocab import Vocab
from thinc.api import NumpyOps
from thinc.types import Ragged
from ..align import get_alignment, apply_alignment
def get_ragged(ops, nested: List[List[int]]):
nested = [ops.asarray(x) for x in nested]
return Ragge... |
# Copyright (c) 2020 PaddlePaddle 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 applic... |
# -*- coding: utf-8 -*-
"""
Library name handling for ObsPy.
:copyright:
The ObsPy Development Team (devs@obspy.org)
:license:
GNU Lesser General Public License, Version 3
(https://www.gnu.org/copyleft/lesser.html)
"""
# NO IMPORTS FROM OBSPY OR FUTURE IN THIS FILE! (file gets used at
# installation time)
... |
# -*- 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... |
#!/usr/bin/env python
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# Jiao Lin
# California Institute of Technology
# (C) 2007-2010 All Rights Reserved
#
# {LicenseText}
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~... |
import pytest
import linearmodels
def test_runner():
status = linearmodels.test(
location="tests/shared/test_typed_getters.py", exit=False
)
assert status == 0
def test_runner_exception():
with pytest.raises(RuntimeError):
linearmodels.test(location="tests/shared/unknown_test_file.p... |
# pre-processing tips
# adding stop words in spacy
# remember to load your appropriate language model
my_stop_words = [u'say', u'\'s', u'Mr', u'be', u'said', u'says', u'saying']
for stopword in my_stop_words:
lexeme = nlp.vocab[stopword]
lexeme.is_stop = True
# adding logging
import logging
logging.basicCon... |
class BatmanQuotes(object):
def get_quote(quotes, hero):
return f"{('Batman', 'Joker', 'Robin')['BJR'.index(hero[0])]}: {quotes[int(min(hero))]}" |
from collections import defaultdict
from sympy import S
from devito.ir.iet import (Call, Expression, HaloSpot, Iteration, FindNodes,
MapNodes, Transformer, retrieve_iteration_tree)
from devito.ir.support import PARALLEL, Scope
from devito.mpi import HaloExchangeBuilder, HaloScheme
from devi... |
from django.contrib import admin
from cursivedata.models import *
admin.site.register(DataStore)
admin.site.register(GeneratorState)
admin.site.register(Endpoint)
admin.site.register(COSMSource)
class ParameterInline(admin.TabularInline):
model = Parameter
class GeneratorAdmin(admin.ModelAdmin):
inlines = [
... |
from big_ol_pile_of_manim_imports import *
class TransformationText1V1(Scene):
def construct(self):
texto1 = TextMobject("First text")
texto2 = TextMobject("Second text")
self.play(Write(texto1))
self.wait()
self.play(Transform(texto1,texto2))
self.wait()
class TransformationText1V2(Scene):
def construc... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# common
import os
import os.path as op
import sys
# pip
import numpy as np
import xarray as xr
# DEV: override installed teslakit
import sys
sys.path.insert(0, op.join(op.dirname(__file__), '..', '..', '..'))
# teslakit
from teslakit.database import Database
from tesla... |
# coding: utf-8
from livereload import Server, shell
server = Server()
server.watch('docs/*.rst', shell('make html'))
server.serve(root='docs/_build/html') |
"""
Created by adam on 5/19/18
"""
__author__ = 'adam'
import json
import xml.etree.ElementTree as ET
import requests
import environment
def load_credentials_file( filepath=environment.SLACK_CREDENTIAL_FILE ):
"""
Opens the credentials file and loads the attributes
"""
return ET.parse( filepath )
... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2017, Davis Phillips davis.phillips@gmail.com
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
DOCUMENTATION = r'''
---
module:... |
import os
import shutil
import tempfile
import logging
from datetime import timedelta
from typing import Any, Callable, List, Tuple, TypeVar
from typing.io import BinaryIO
import apache_beam as beam
import xarray as xr
from apache_beam.io import filesystems
from vcm.cloud.fsspec import get_fs
from vcm import parse_ti... |
#!/usr/bin/env python
"""Django's command-line utility for administrative tasks."""
import os
import sys
def main():
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'clicksign.settings')
try:
from django.core.management import execute_from_command_line
except ImportError as exc:
raise Impo... |
import os
import subprocess
from inspect import isclass
import configargparse
import numpy as np
import sqlalchemy
import yaml
from IPython import embed
from angular_solver import solve
from database import Config, ConfigHolder, Graph, Task, get_session, DatabaseGraphGenome
from genetic_algorithm import (GeneticAlgo... |
import interpreter
shell = interpreter.Interpreter(shell=True)
shell.loop() |
from tests.constants import (
ETH_RESERVE,
HAY_RESERVE,
DEN_RESERVE,
INITIAL_ETH,
DEADLINE,
)
def test_initial_balances(w3, HAY_token, HAY_exchange, DEN_token, DEN_exchange):
a0, a1, a2 = w3.eth.accounts[:3]
# BUYER
assert HAY_token.balanceOf(a1) == 0
assert DEN_token.balanceOf(a1) ... |
"""
Collection of Jax device functions, wrapped to fit Ivy syntax and signature.
"""
# global
import os
import jax as _jax
# local
from ivy.core.device import Profiler as BaseProfiler
# Helpers #
# --------#
def _to_array(x):
if isinstance(x, _jax.interpreters.ad.JVPTracer):
return _to_array(x.primal)
... |
"""
This script runs the EasyAzureUI1 application using a development server.
"""
import time
time.sleep(5)
from os import environ
import json
import sys
import os.path
try:
configFile = 'EasyAzureUI1/config/config.json'
with open(configFile, 'r') as json_file:
config = json.load(json_file)
... |
from django.contrib import admin
from .models import loc
# Register your models here.
admin.site.register(loc) |
# coding=utf-8
# *** WARNING: this file was generated by the 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
from ... import _utilities, _tables
from... |
import torch
from ignite.engine.engine import Engine, State, Events
from ignite.utils import convert_tensor
def _prepare_batch(batch, device=None, non_blocking=False):
"""Prepare batch for training: pass to a device with options.
"""
x, attention_mask, y = batch
return (
convert_tensor(x, de... |
from django.db import models
class TASAutocompleteMatview(models.Model):
"""
Supports TAS autocomplete. For performance reasons, pre-filters the TAS
codes/numbers/symbols/whatever that can be linked to File D data.
"""
tas_autocomplete_id = models.IntegerField(primary_key=True)
allocation_tr... |
import os
from pathlib import Path
import matplotlib.pyplot as plt
def _handle_dirs(pathname, foldername, subfoldername):
path = Path(pathname)
if foldername is not None:
path = path / foldername
if not os.path.isdir(path):
os.mkdir(path)
if subfoldername is not None:
... |
#
# linux.py
#
# Copyright (c) 2014 Jeremy Garff <jer @ jers.net>
#
# 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 notic... |
# -*- coding: utf-8 -*-
# Define here the models for your scraped items
#
# See documentation in:
# https://doc.scrapy.org/en/latest/topics/items.html
import scrapy
class IndeedjobsItem(scrapy.Item):
# define the fields for your item here like:
# name = scrapy.Field()
pass |
# Configuration file for the Sphinx documentation builder.
#
# This file only contains a selection of the most common options. For a full
# list see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html
# -- Path setup --------------------------------------------------------------
# If ex... |
# 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 ... |
# Concord
#
# Copyright (c) 2020-2021 VMware, Inc. All Rights Reserved.
#
# This product is licensed to you under the Apache 2.0 license (the "License").
# You may not use this product except in compliance with the Apache 2.0 License.
#
# This product may include a number of subcomponents with separate copyright
# noti... |
import os
from pathlib import Path
from torchaudio.datasets import utils as dataset_utils
from torchaudio.datasets.commonvoice import COMMONVOICE
from torchaudio_unittest.common_utils import (
TempDirMixin,
TorchaudioTestCase,
get_asset_path,
)
class TestWalkFiles(TempDirMixin, TorchaudioTestCase):
... |
# -*- coding: utf-8 -*-
import os
import scrapy
import math
import datetime
from scrapy.linkextractors import LinkExtractor
from trulia_scraper.items import TruliaItem, TruliaItemLoader
from trulia_scraper.parsing import get_number_from_string
from scrapy.utils.conf import closest_scrapy_cfg
class TruliaSpider(scrapy... |
import pathlib
import tempfile
from typing import Tuple, Union
from unittest.mock import patch
import ipywidgets as widgets
import numpy as np
from hypothesis import assume, given, infer, settings, strategies
from PIL import Image
from ipyannotations.images.canvases.abstract_canvas import (
AbstractAnnotationCanv... |
# Generated by Django 3.2.5 on 2021-09-02 15:30
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("charity", "0013_auto_20210818_1053"),
]
operations = [
migrations.AddField(
model_name="charity",
name="employees",
... |
"""
EC to 3D structure comparison protocols/workflows.
Authors:
Thomas A. Hopf
Anna G. Green (complex and _make_complex_contact_maps)
"""
from copy import deepcopy
from math import ceil
import pandas as pd
import matplotlib.pyplot as plt
import numpy as np
from evcouplings.align.alignment import (
read_fasta... |
from .Item import *
class IronOre(Item):
def getName(self):
return "minecraft:iron_ore"
def getTexturFile(self):
return "./assets/textures/items/iron_ore.png"
handler.register(IronOre) |
from models import *
class MockEpubArchive(EpubArchive):
'''Mock object to expose some protected methods for testing purposes, and use
overridden mock related classes with different storage directories.'''
def get_author(self, opf):
self.authors = self._get_authors(opf)
return self.autho... |
# coding=utf-8
# *** WARNING: this file was generated by the 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
fro... |
import os
import tempfile
import logging
from azureml.core.model import Model
import pickle
import pandas as pd
from azureml.core import Run
import os
import mlflow
def init():
global model
model_dir =os.getenv('AZUREML_MODEL_DIR')
model_file = os.listdir(model_dir)[0]
model_path = os.path.join(os.gete... |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os
import random
import argparse
import matplotlib.pyplot as plt
import pandas as pd
from datetime import datetime
import ray
from ray.tune import run, sample_from
from ray.tune.schedulers import Popula... |
import _plotly_utils.basevalidators
class SizeValidator(_plotly_utils.basevalidators.NumberValidator):
def __init__(
self,
plotly_name="size",
parent_name="densitymapbox.colorbar.title.font",
**kwargs
):
super(SizeValidator, self).__init__(
plotly_name=plotl... |
# Copyright 2013 by Zheng Ruan (zruan1991@gmail.com).
# All rights reserved.
# This code is part of the Biopython distribution and governed by its
# license. Please see the LICENSE file that should have been included
# as part of this package.
"""Code for dealing with Codon Alignment.
CodonAlignment class is inherite... |
# Copyright 2013-2020 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
import spack.container.writers as writers
def test_manifest(minimal_configuration):
writer = writers.create(minimal_... |
"""Tests for classes and functions from the auth module."""
if __name__ == '__main__':
pass |
"""
*Identity*
"""
from dataclasses import dataclass
import jax.numpy as jnp
from ._operator import CreationalOperator
__all__ = ["Identity"]
@dataclass
class Identity(
CreationalOperator,
):
operator = jnp.eye |
from django.apps import AppConfig
class RadarDoCarroMainConfig(AppConfig):
name = 'radar_do_carro_main' |
from __future__ import unicode_literals
import erpnext.education.utils as utils
import frappe
no_cache = 1
def get_context(context):
try:
course = frappe.form_dict['course']
program = frappe.form_dict['program']
topic = frappe.form_dict['topic']
except KeyError:
frappe.local.flags.redirect_location = '/lms'... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
""" Define the menu structure used by the Pentacle applications """
MenuStructure = [
["&File", [
["&New", "<control>N"],
["&Open...", "<control>O"],
["&Save", "<control>S"],
["Save &As...", "<control><shift>S"],
["Test", ""],
["Exercised",... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.