text stringlengths 1 927k |
|---|
#!/usr/bin/env python
import rospy
from std_msgs.msg import Bool
from dbw_mkz_msgs.msg import ThrottleCmd, SteeringCmd, BrakeCmd, SteeringReport
from geometry_msgs.msg import TwistStamped
import math
from twist_controller import Controller
'''
You can build this node only after you have built (or partially built) th... |
"""Top-level gunicorn application for `routemaster serve`."""
from typing import Callable
import gunicorn.app.base
from routemaster.utils import WSGICallable
class GunicornWSGIApplication(gunicorn.app.base.BaseApplication):
"""gunicorn application for routemaster."""
def __init__(
self,
ap... |
# -*- coding: utf-8 -*-
'''
Management of Block Devices
===================================
A state module to manage blockdevices
.. code-block:: yaml
/dev/sda:
blockdev.tuned:
- read-only: True
master-data:
blockdev:
- tuned:
- name : /dev/vg/master-data
- read-... |
__depends__ = ['0001.create']
step(
"""CREATE INDEX idx_created_at ON tweets(created_at DESC);""",
"DROP INDEX idx_created_at",
) |
# python3
from collections import namedtuple
Bracket = namedtuple("Bracket", ["char", "position"])
def are_matching(left, right):
return (left + right) in ["()", "[]", "{}"]
def find_mismatch(text):
opening_brackets_stack = []
mismatch = []
for i, next in enumerate(text):
# Process ... |
# -*- coding: utf-8 -*-
from sqlalchemy import Column, Integer, String, Text, DateTime
from flaski.database import Base
from datetime import datetime
class WikiContent(Base):
__tablename__ = 'wikicontents'
id = Column(Integer, primary_key = True)
title = Column(String(128), unique = True)
body = Column(Text)
de... |
# Prints all menu nodes that reference a given symbol any of their properties
# or property conditions, along with their parent menu nodes.
#
# Usage:
#
# $ make [ARCH=<arch>] scriptconfig SCRIPT=Kconfiglib/examples/find_symbol.py SCRIPT_ARG=<name>
#
# Example output for SCRIPT_ARG=X86:
#
# Found 470 locations that... |
from django.contrib.auth.mixins import LoginRequiredMixin
from django.http import HttpResponseRedirect
from django.shortcuts import get_object_or_404
from django.urls import reverse_lazy
from django.views.generic import CreateView
from django.views.generic import DeleteView
from django.views.generic import UpdateView
f... |
from typing import TYPE_CHECKING
from kivy.app import App
from kivy.clock import Clock
from kivy.factory import Factory
from kivy.properties import ObjectProperty
from kivy.lang import Builder
from decimal import Decimal
from kivy.uix.popup import Popup
from electrum_ltc.gui.kivy.i18n import _
from ...util import add... |
# 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... |
# Copyright 2017 Yelp
# Copyright 2018 Yelp
#
# 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 pymedphys._dev import docs, propagate, tests
def dev_cli(subparsers):
dev_parser = subparsers.add_parser("dev")
dev_subparsers = dev_parser.add_subparsers(dest="dev")
add_docs_parser(dev_subparsers)
add_test_parser(dev_subparsers)
add_lint_parser(dev_subparsers)
add_propagate_parser(dev_s... |
import os
import shutil
import subprocess
import sys
import glob
APK_NAME = "vulkanDynamicuniformbuffer"
SHADER_DIR = "dynamicuniformbuffer"
if subprocess.call("ndk-build", shell=True) == 0:
print("Build successful")
os.makedirs("./assets/shaders/base", exist_ok=True)
os.makedirs("./assets/shaders/%s"... |
#
# Copyright (C) Analytics Engines 2021
# Lauren Stephens (l.stephens@analyticsengines.com)
#
from re import X
import sys
import pytest
import os
sys.path.append('python/orp')
from orp.content_enrichment.deontic_language import *
@pytest.fixture
def xml_doc():
with open('python/orp/orp/content_enrichment/test/d... |
import os
from celery import Celery
from django.apps import apps, AppConfig
from django.conf import settings
if not settings.configured:
# set the default Django settings module for the 'celery' program.
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'config.settings.local') # pragma: no cover
app = Celer... |
class Color(object):
"""Class used for colouring terminal output."""
def __init__(self):
pass
PURPLE = '\033[95m'
CYAN = '\033[96m'
DARK_CYAN = '\033[36m'
BLUE = '\033[94m'
GREEN = '\033[92m'
YELLOW = '\033[93m'
RED = '\033[91m'
BOLD = '\033[1m'
UNDERLINE = '\033[4m... |
import os
import json
import unittest
from collections import defaultdict
from geopy.compat import string_compare, py3k
from geopy import exc
try:
env = defaultdict(lambda: None)
with open(".test_keys") as fp:
env.update(json.loads(fp.read()))
except IOError:
keys = (
'ARCGIS_USERNAME',
... |
import numpy as np
import datajoint as dj
from PIL import ImageColor
from collections import Counter
import matplotlib as mpl
import matplotlib.pyplot as plt
import seaborn as sns
import itertools
import pandas as pd
from pipeline import experiment, ephys, psth, lab, histology, ccf, psth_foraging
from pipeline.plot.... |
from contextlib import closing
from PIL import Image
import subprocess
from audiotsm import phasevocoder
from audiotsm.io.wav import WavReader, WavWriter
from scipy.io import wavfile
import numpy as np
import re
import math
from shutil import copyfile, rmtree
import os
import argparse
from pytube import YouTube
def do... |
"""
Node is defined as
self.left (the left child of the node)
self.right (the right child of the node)
self.data (the value of the node)
"""
def postOrder(root):
#Write your code here
if(root == None):
return
postOrder(root.left)
postOrder(root.right)
print root.data, |
# Copyright 2017 reinforce.io. 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 or... |
import csv
import json
df = open("bridgeData3.csv",'r').readlines()
fin = open('final.csv','r').readlines()
# Skips the header of the csv
finCsv = fin[1:]
finalCsv = df[1:]
obj = {}
# loop through the csv with images
for i in finalCsv:
x = i.split(',')
obj[x[1]] = {'bridge_name':x[0],'proj_code':x[1],'before_i... |
#!/usr/bin/env python3
import zmq
import time
from hexdump import hexdump
import cereal.messaging as messaging
from cereal.services import service_list
from cereal import log
def mock_x():
liveMpc = messaging.pub_sock('liveMpc')
while 1:
m = messaging.new_message('liveMpc')
mx = []
for x in range(0, 10... |
#!/usr/bin/env python
"""Tooth.py: Public Tooth class representing tooth entities in the educational game Trusty Brusher."""
class Tooth:
"""
A Tooth in the Mouth of a Person.
self.location: int value indicating location of Tooth in the Mouth
self.has_cavity: bool value indicating whether or ... |
# PROJECT : django-easy-captcha
# TIME : 2018/11/18 11:00
# AUTHOR : Younger Shen
# EMAIL : younger.x.shen@gmail.com
# CELL : 13811754531
# WECHAT : 13811754531
# WEB : https://youngershen.com |
# Copyright 2018 The TensorFlow Probability 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 law o... |
# STUMPY
# Copyright 2019 TD Ameritrade. Released under the terms of the 3-Clause BSD license.
# STUMPY is a trademark of TD Ameritrade IP Company, Inc. All rights reserved.
import logging
import math
import multiprocessing as mp
import os
import numpy as np
from numba import cuda
from . import core, config
logger =... |
from boa3.builtin import interop, public
@public
def main() -> int:
return interop.policy.get_exec_fee_factor() |
metadata = {
'protocolName': 'BP Genomics Station C: 20200324 LOD Study 1',
'author': 'Chaz <chaz@opentrons.com; Anton <acjs@stanford.edu>',
'source': 'COVID-19 Project',
'apiLevel': '2.2'
}
# Protocol constants
# Master mix locations on the eppendorf tube holder
REAGENT_LOCATIONS = {
'Endogenous'... |
# -*- coding: utf-8 -*-
# Generated by Django 1.11 on 2019-05-22 07:13
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('instagram', '0001_initial'),
]
operations = [
migrations.AddField(
... |
# exported from PySB model 'model'
from pysb import Model, Monomer, Parameter, Expression, Compartment, Rule, Observable, Initial, MatchOnce, Annotation, ANY, WILD
Model()
Monomer('Ligand', ['Receptor'])
Monomer('ParpU', ['C3A'])
Monomer('C8A', ['BidU', 'C3pro'])
Monomer('SmacM', ['BaxA'])
Monomer('BaxM', ['BidM', '... |
"""
exceptions
Created by: Martin Sicho
On: 7/23/20, 10:08 AM
"""
import json
import traceback
class GenUIException(Exception):
def __init__(self, original, *args, **kwargs):
super().__init__(*args)
self.original = original
def getData(self):
return ''
def __repr__(self):
... |
import cPickle
import numpy as np
def unpickle(file):
fo = open(file, 'rb')
dict = cPickle.load(fo)
fo.close()
return dict
def clean(data):
imgs = data.reshape(data.shape[0], 3, 32, 32)
grayscale_imgs = imgs.mean(1)
cropped_imgs = grayscale_imgs[:, 4:28, 4:28]
img_data = cropped_imgs... |
#!/usr/bin/env python
"""
A simple python program of solving a 2D wave equation in parallel.
Domain partitioning and inter-processor communication
are done by an object of class MPIRectPartitioner2D
(which is a subclass of RectPartitioner2D and uses MPI via mpi4py)
An example of running the program is (8 processors, 4... |
# -*- coding: utf-8 -*-
'''
:codeauthor: :email:`Jayesh Kariya <jayeshk@saltstack.com>`
'''
# Import Python Libs
from __future__ import absolute_import
# Import Salt Testing Libs
from salttesting import TestCase, skipIf
from salttesting.mock import (
MagicMock,
patch,
NO_MOCK,
NO_MOCK_REASON
)
fr... |
import random
import numpy as np
from typing import List, Optional, Dict
import pandas as pd
import time
from mdrsl.rule_generation.association_rule_mining.apyori_impl.mine_mt_rules_from_transactions_with_apyori import (
mine_MCARs_from_transactions_using_apyori)
from mdrsl.rule_generation.association_rule_mining... |
# Please run bert-serving-start before running this notebook
# Setup: https://github.com/hanxiao/bert-as-service
# Examples (change folders to your locals)
# english cased: bert-serving-start -model_dir /bert-as-service/cased_L-24_H-1024_A-16/ -num_worker=4
# multi cased: bert-serving-start -model_dir /bert-as-service/... |
import pandas as pd
df = pd.read_csv('/mnt/data3/scott/1950-2018_actual_tornadoes.csv')
df['date'] = pd.to_datetime(df['date'])
mask = (df['date'] >= '1979-1-1') & (df['date'] <= '2013-12-31')
df = df.loc[mask]
df.groupby('date').size()
df.groupby('date').size().to_csv('/mnt/data3/scott/tornadoCounts.csv') |
#!/usr/bin/env python3
# Copyright (c) 2015-2016 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
from test_framework.test_framework import BitcoinTestFramework
from test_framework.util import *
from tes... |
# 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 applica... |
from flask import render_template,redirect,url_for, flash,request
from flask_login import login_user,logout_user,login_required
from . import auth
from ..models import User
from .forms import LoginForm,RegistrationForm
from .. import db
from ..email import mail_message
@auth.route('/login',methods=['GET','POST'])
def ... |
import sqlalchemy as sa
from enum import Enum
from sqlalchemy.orm import relationship, backref
from typing import List
from datetime import date
from dataclasses import dataclass, field
from marshmallow import validate
from datahub.db import ModelBase, Session
from datahub.measurements import MeasurementQuery
from dat... |
# coding=utf-8
# Copyright 2020 The TensorFlow Datasets 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 appl... |
print("""
Did that stop the old Grinch?
No! The Grinch simply said,
"If I can't find a reindeer,
I'll make one instead!"
""") |
# Copyright 2013: Mirantis 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 b... |
import collections
import base64
import copy
import enum
import logging
import os
import pathlib
import xml.sax
import pyparsing # type: ignore
# Improve performance by caching
pyparsing.ParserElement.enablePackrat()
import untangle # type: ignore
import bgraph.exc
import bgraph.utils
from bgraph.types import (
... |
# -*- coding: utf-8 -*-
#
# Copyright (C) 2021 CESNET.
#
# CESNET-OpenID-Remote is free software; you can redistribute it and/or
# modify it under the terms of the MIT License; see LICENSE file for more
# details.
"""CESNET OIDC Auth backend for OARepo"""
from datetime import timedelta
from flask import current_app, ... |
from configparser import SafeConfigParser
import os
def get_config():
config = SafeConfigParser()
config_filename = "config_resource.conf"
config_filepath = os.path.join(os.path.dirname(os.path.realpath(__file__)), config_filename)
if os.path.exists(config_filepath) == False:
config_filepath = os.path.join(os.g... |
import os
import time
import datetime as dt
import schedule
from threading import Timer
from weather import Weather, Unit
weather = Weather(unit=Unit.CELSIUS)
lookup = weather.lookup(2487365)
condition = lookup.condition
needToWaterEarly = True
needToWaterMore = True
triggerConditions = ["tropical storm", "showers",... |
# coding: utf-8
# Copyright (c) 2016, 2021, Oracle and/or its affiliates. All rights reserved.
# This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may c... |
#pylint: disable=invalid-name
import numpy as np
import torch
from torch import nn
from aw_nas import ops
from aw_nas.utils.exception import expect, ConfigException
from aw_nas.weights_manager.rnn_shared import RNNSharedNet, INIT_RANGE
class RNNGenotypeModel(RNNSharedNet):
REGISTRY = "final_model"
NAME = "rn... |
from abc import ABC
from gym import Env
from gym_stag_hunt.src.utils import print_matrix
class AbstractMarkovStagHuntEnv(Env, ABC):
metadata = {
'render.modes': ['human', 'array'],
'obs.types': ['image', 'coords']
}
def __init__(self,
grid_size=(5, 5),
... |
from flask import Blueprint, request, render_template, \
flash, g, session, redirect, url_for, \
jsonify, make_response
from btsapi.modules.users.models import User, UserSchema
from btsapi.extensions import db
import datetime
import base64
# @TODO: Change this endpoint to /api/authe... |
# Copyright 2014 Facebook, Inc.
# You are hereby granted a non-exclusive, worldwide, royalty-free license to
# use, copy, modify, and distribute this software in source code or binary
# form for use in connection with the web services and APIs provided by
# Facebook.
# As with any software that integrates with the Fa... |
"""Generate mypy config."""
from __future__ import annotations
import configparser
import io
import os
from pathlib import Path
from typing import Final
from .model import Config, Integration
# Modules which have type hints which known to be broken.
# If you are an author of component listed here, please fix these e... |
#!/usr/bin/env python3
import codecs
import hashlib
import random_tweets
import requests
import sys
def make_fingerprint(url):
host = requests.urllib3.util.url.parse_url(url).host
if host is None:
host = '-INVALID-'
fingerprint = hashlib.md5(host.encode('utf-8')).hexdigest()
comment = codecs.... |
from flask import Flask
from flask_bootstrap import Bootstrap
from flask_sqlalchemy import SQLAlchemy
from flask_login import LoginManager
from flask_mail import Mail
from flask_simplemde import SimpleMDE
from config import config_options
bootstrap = Bootstrap()
db = SQLAlchemy()
mail = Mail()
simple = SimpleMDE()
log... |
# Copyright (c) 2017-present, Facebook, 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... |
from abc import ABCMeta
from abc import abstractmethod
from typing import Any
import enum
import networkx as nx
from networkx import Graph
from qhana.backend.taxonomie import Taxonomie
from qhana.backend.logger import Logger
import numpy as np
from qhana.backend.logger import Logger
import os
import json
import math
fr... |
import cv2
import numpy as np
o = cv2.imread("contours.bmp")
gray = cv2.cvtColor(o, cv2.COLOR_BGR2GRAY)
ret, binary = cv2.threshold(gray, 127, 255, cv2.THRESH_BINARY)
contours, hierarchy = cv2.findContours(binary, cv2.RETR_LIST, cv2.CHAIN_APPROX_SIMPLE)
cv2.imshow("original", o)
n = len(contours)
contoursImg = []
for ... |
from gym import Env
from gym.utils import seeding
from gym import spaces
import numpy as np
import keras.backend as K
class BaseEnv(Env):
metadata = {'render.modes': ['human', 'ansi']}
def __init__(self, action_mapping):
self._seed()
self.verbose = 0
self.viewer = None
self.ba... |
"""
Modbus Payload Builders
------------------------
A collection of utilities for building and decoding
modbus messages payloads.
"""
from struct import pack, unpack
from pymodbus.interfaces import IPayloadBuilder
from pymodbus.constants import Endian
from pymodbus.utilities import pack_bitstring
from pymodbus.util... |
class Student(object):
def __init__(self, name, age):
self.name = name
self.age = age
# self别忘记写了
def __str__(self):
return "姓名:%s,年龄:%s" % (self.name, self.age)
lisi = Student("李四", 22)
print(lisi) |
import os, csv, json, shutil, requests, gzip
import pandas as pd
from bs4 import BeautifulSoup
from scipy import spatial
from geopy.distance import great_circle
from resources.utils import cartesian
from resources.scrape_mccs import scrape_mccs, MCCS_JSON
HEADERS = {"User-Agent": 'Mozilla/5.0 (Windows NT 10.0; Win64;... |
import sys
import numpy
import random
class LSAPlugin:
def input(self, filename):
self.myfile = filename
def run(self):
filestuff = open(self.myfile, 'r')
self.firstline = filestuff.readline()
lines = []
for line in filestuff:
lines.append(line)
self.m = len(lines)... |
from fastapi import FastAPI
from fastapi.middleware.cors import CORSMiddleware
import uvicorn
from app import db, ml, viz
description = """
Edit your app's title and description. See [https://fastapi.tiangolo.com/tutorial/metadata/](https://fastapi.tiangolo.com/tutorial/metadata/)
To use these interactive docs:
- Cl... |
from __future__ import division
import torch
import torch.nn as nn
import torch.nn.functional as F
from .segbase import SegBaseModel
from .model_zoo import MODEL_REGISTRY
from ..modules import _FCNHead, PAM_Module, CAM_Module
__all__ = ['DANet']
@MODEL_REGISTRY.register()
class DANet(SegBaseModel):
r"""DANet m... |
#!/usr/bin/env python
#Note to self: I am assuming that extensions without a class type are generics and labelling them that way in the facts.
#we will need to modify this if I'm wrong about how to handle this type of extension.
#when there is more time, we should look into these by figuring out who issues them and an... |
MAIOR_IDADE = 18
class Pessoa:
def __init__(self, nome, idade):
self.nome = nome
self.idade = idade
def __str__(self):
if not self.idade:
return self.nome
return f'{self.nome} - {self.idade}'
def is_adult(self):
return (self.idade or 0) >= MAIOR_IDAD... |
# coding: utf-8
#
# Copyright 2018 The Oppia 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 requi... |
import argparse
import sys
from marionette import Marionette
import gaiatest
class GCli(object):
def __init__(self):
self.commands = {
'connectwifi': {
'function': self.connect_to_wifi,
'args': [
{'name': 'ssid',
'help... |
#!/usr/bin/python
import sys
Total = 0
for line in sys.stdin:
data = line.strip()
if data == "" or data is None:
continue
if data == "10.99.99.186":
Total=Total+1
print Total |
#!/usr/bin/env python
"""
Copyright 2014-2021 by Taxamo
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... |
#!/usr/bin/env python3
# Copyright (c) 2016 The Bitcoin Core developers
# Copyright (c) 2017-2018 The AmlBitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test segwit transactions and blocks on P2P network.... |
'''
BLACKJACK HIGHEST
Basic Blackjack rules:
1. Cards with the numbers 2 through 10 have their face value.
2. Jacks, queens, and kings are valued at 10 points.
3. Aces can be 1 or 11 points.
Have the function BlackjackHighest(strArr) take the strArr parameter being passed
which will be an array of numbers and letter... |
# -*- coding: utf-8 -*-
"""
Test symbolic unit handling.
"""
# -----------------------------------------------------------------------------
# Copyright (c) 2018, yt Development Team.
#
# Distributed under the terms of the Modified BSD License.
#
# The full license is in the LICENSE file, distributed with this sof... |
import time
def long_running_task(time_to_sleep: int) -> None:
print(f"Begin sleep for {time_to_sleep}")
time.sleep(time_to_sleep)
print(f"Awake from {time_to_sleep}")
def main() -> None:
long_running_task(2)
long_running_task(10)
long_running_task(5)
if __name__ == "__main__":
s = tim... |
import unittest
from tests.test_PolyGrid import generic_grid
from polymaze.polygrid import PolyGrid, PolyViz
# silly workaround to allow tests to work in py2 or py3
try:
_assertCountEqual = unittest.TestCase.assertCountEqual # py3
from unittest import mock
except (AttributeError, ImportError):
_assertCou... |
'''
Find the largest rectangular area possible in a given histogram where the largest rectangle can be made of a number of contiguous bars.
For simplicity, assume that all bars have same width and the width is 1 unit.
For example, consider the following histogram with 7 bars of heights {6, 2, 5, 4, 5, 2, 6}.
The large... |
# 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
__a... |
# Generated by Django 3.1.2 on 2020-10-25 20:22
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('awwards', '0004_auto_20201025_2307'),
]
operations = [
migrations.RenameField(
model_name='project',
old_name='comment',
... |
# Generated by Django 3.0.3 on 2020-03-20 11:05
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('project_core', '0111_remove_project_duration_months'),
('evaluation', '0019_historicalcallevaluation'),
]
o... |
from parcels import FieldSet, ParticleSet, ScipyParticle, JITParticle, Kernel, Variable, ErrorCode
from parcels.kernels.seawaterdensity import polyTEOS10_bsq, UNESCO_Density
from parcels import random as parcels_random
import numpy as np
import pytest
import random as py_random
from os import path
import sys
ptype = ... |
import numpy as np
class algorithm(object):
def __init__(self, problem):
self.problem = problem
self.debug = False
self.inv_step = None
@property
def output(self):
"""
Return the 'interesting' part of the problem arguments.
In the regression case, this is t... |
# EASY MULTIPLE
for _ in range(int(input())):
n = int(input())-1
if n<3:
print('0')
continue
elif n<5:
print('3')
continue
t3 = n//3
t5 = n//5
t15 = n//15
t3l = t3*3
t5l = t5*5
t15l = t15*15
res3 = (t3*(3+t3l))//2
res5 = (t5*(5+t5l))//2
re... |
from gmplot.color import _get_hex_color
from gmplot.utility import _get_value, _format_LatLng
class _Circle(object):
def __init__(self, lat, lng, radius, **kwargs):
'''
Args:
lat (float): Latitude of the center of the circle.
lng (float): Longitude of the center of the circl... |
# Write a function to find the longest common prefix string amongst an array of strings.
# If there is no common prefix, return an empty string "".
#
# Example 1:
# Input: strs = ["flower","flow","flight"]
# Output: "fl"
#
# Example 2:
# Input: strs = ["dog","racecar","car"]
# Output: ""
# Explanation: There is no comm... |
# Copyright (c) Facebook, Inc. and its affiliates.
# All rights reserved.
#
# This source code is licensed under the license found in the
# LICENSE file in the root directory of this source tree.
# Optional list of dependencies required by the package
'''
Code From : https://github.com/facebookresearch/WSL-Images... |
"""Implementation of Rule L018."""
from sqlfluff.core.parser import NewlineSegment, WhitespaceSegment
from sqlfluff.core.rules.base import BaseRule, LintFix, LintResult
from sqlfluff.core.rules.doc_decorators import document_fix_compatible
@document_fix_compatible
class Rule_L018(BaseRule):
"""WITH clause closi... |
'''MIT License. Copyright (c) 2020 Ivan Sosnovik, Michał Szmaja'''
import torch
import torch.nn as nn
import torch.nn.functional as F
from .impl.ses_conv import SESMaxProjection
from .impl.ses_conv import SESConv_Z2_H, SESConv_H_H
class MNIST_SES_Scalar(nn.Module):
def __init__(self, pool_size=4, kernel_size=11... |
# Generated by Django 2.1.15 on 2020-09-01 19:09
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('home', '0004_friend'),
... |
#!/usr/bin/env python3
# Copyright (c) 2019 Bitcoin Association
# Distributed under the Open BSV software license, see the accompanying file LICENSE.
"""
Test that the new default generated (mined) block size works correctly without the use
of the blockmaxsize parameter.
In short; if the user doesn't override things v... |
########################################################################
#
# File Name: HTMLScriptElement
#
# Documentation: http://docs.4suite.com/4DOM/HTMLScriptElement.html
#
### This file is automatically generated by GenerateHtml.py.
### DO NOT EDIT!
"""
WWW: http://4suite.com/4DOM e-ma... |
###############################################################################
#
# Tests for XlsxWriter.
#
# Copyright (c), 2013-2018, John McNamara, jmcnamara@cpan.org
#
from ..excel_comparsion_test import ExcelComparisonTest
from ...workbook import Workbook
class TestCompareXLSXFiles(ExcelComparisonTest):
"""... |
# -*- coding: utf-8 -*-
import sys
import numpy as np
sys.path.append("../")
import mocsy
# Define input data (typical values at depth from 0 to 5000 meters)
temp = np.repeat(2.0, 6).astype('float32')
depth = np.arange (0, 6000, 1000).astype('float32')
sal = np.repeat(35.0, 6).astype('float32')
alk = np.repeat(2295.*1... |
import binascii
import pprint
import time
from neocore.BigInteger import BigInteger
from neocore.Cryptography.Crypto import Crypto
from TX.MyTransaction import InvocationTransaction
from TX.TransactionAttribute import TransactionAttribute, TransactionAttributeUsage
from TX.config import *
# from TX.interface import cre... |
import numpy as np
from collections import defaultdict
import sys
from typing import Any
class TimeSeries(object):
def __init__(self):
self.class_timeseries = ''
self.dimension_name = ''
self.discmP = {}
self.threshP = {}
self.timeseries = None
self.matched = False
... |
"""
This file offers the methods to automatically retrieve the graph Bacillus litoralis.
The graph is automatically retrieved from the STRING repository.
References
---------------------
Please cite the following if you use the data:
```bib
@article{szklarczyk2019string,
title={STRING v11: protein--protein ass... |
import psycopg2
import argparse
import getpass
# define arguments
parser = argparse.ArgumentParser(description='Creates bounding boxes for OSM relations')
parser.add_argument('hostname', help='PostgreSQL hostname')
parser.add_argument('db', help='PostgreSQL database name')
parser.add_argument('username', help='Postgre... |
# Copyright (c) 2014-2015, Heliosphere Research LLC
# 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 c... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.