text stringlengths 2 999k |
|---|
import logging
from django.conf import settings
from django_elasticsearch_dsl import DocType, Index, fields
from elasticsearch import Elasticsearch
from readthedocs.projects.models import HTMLFile, Project
project_conf = settings.ES_INDEXES['project']
project_index = Index(project_conf['name'])
project_index.setting... |
import argparse
from packaging.version import Version
from pdm import termui
from pdm.cli.commands.base import BaseCommand
from pdm.exceptions import PdmUsageError
from pdm.models.candidates import Candidate
from pdm.models.project_info import ProjectInfo
from pdm.models.requirements import parse_requirement
from pdm... |
"""
Deprecated. Use types.bundle instead.
"""
from .types import CreateCollectionArg, CollectionMetadata, MintCollectionArg
|
from robot import Robot
from robot.collector.shortcut import *
collector = pipe(
const('http://www.dataversity.net/category/education/daily-data/'),
get(),
css('#primary article'),
foreach(dict(
pipe(
css('a[href]'), attr('href'), any(), url(),
get(),
dict(
... |
cadena = input("\33[0mIngrese la cadena a separar: \33[34m")
separador = input("\33[0mIngrese el carácter espaciador: \33[34m")[0]
print("\33[0m")
print("Resultado:\33[33m", cadena.replace(' ', separador), "\33[0m")
|
from .LagrangePolynomial import LagrangeExpand
from pytorch_lightning import LightningModule, Trainer
from high_order_layers_torch.PolynomialLayers import *
from torch.nn import Conv2d
import torch.nn as nn
import torch
from .utils import *
def conv2d_wrapper(
in_channels: int,
out_channels: int,
kernel_... |
import _plotly_utils.basevalidators
class ColorValidator(_plotly_utils.basevalidators.ColorValidator):
def __init__(
self,
plotly_name="color",
parent_name="parcats.line.colorbar.title.font",
**kwargs,
):
super(ColorValidator, self).__init__(
plotly_name=plo... |
import numbers # noqa: E402
try:
basestring # basestring was removed in Python 3
except NameError:
basestring = str
def test_trade(exchange, trade, symbol, now):
assert trade
sampleTrade = {
'info': {'a': 1, 'b': 2, 'c': 3}, # the original decoded JSON as is
'id': '12345-67890:098... |
from pathlib import Path
from pprint import pprint
from hesiod import get_cfg_copy, hmain
template_file = Path("tests/configs/templates/complex.yaml")
base_cfg_dir = Path("tests/configs/bases")
@hmain(base_cfg_dir, template_cfg_file=template_file)
def test() -> None:
cfg = get_cfg_copy()
pprint(cfg)
test(... |
import os
import yaml
import asyncio
import platform
from functools import lru_cache
from typing import List, Dict, Coroutine, Union
from . import info
from . import common
def get_path_fname() -> str:
"""
Return the file name that stores the repo locations.
"""
root = common.get_config_dir()
ret... |
#!/usr/bin/env python3
# Requires PyAudio and PySpeech and more.
import speech_recognition as sr
from time import ctime
import time
import os
from gtts import gTTS
import random
from pygame import mixer
from pyicloud import PyiCloudService
from datetime import date
import re
from re import findall, finditer
from urlli... |
""" Bring-Your-Own-Blocks Network
A flexible network w/ dataclass based config for stacking those NN blocks.
This model is currently used to implement the following networks:
GPU Efficient (ResNets) - gernet_l/m/s (original versions called genet, but this was already used (by SENet author)).
Paper: `Neural Ar... |
"""
14682. Shifty Sum
작성자: xCrypt0r
언어: Python 3
사용 메모리: 29,380 KB
소요 시간: 60 ms
해결 날짜: 2020년 9월 20일
"""
def main():
N, k = [int(input()) for _ in range(2)]
res = N
for _ in range(k):
N *= 10
res += N
print(res)
if __name__ == '__main__':
main() |
# -*- coding: utf-8 -*-
"""
The graphics header element definition.
"""
from .base import NITFElement, UserHeaderType, _IntegerDescriptor,\
_StringDescriptor, _StringEnumDescriptor, _NITFElementDescriptor
from .security import NITFSecurityTags
__classification__ = "UNCLASSIFIED"
__author__ = "Thomas McCullough"
... |
# -*- coding: utf-8 -*-
"""
pyrseas.column
~~~~~~~~~~~~~~
This module defines two classes: Column derived from
DbSchemaObject and ColumnDict derived from DbObjectDict.
"""
from pyrseas.dbobject import DbObjectDict, DbSchemaObject, quote_id
class Column(DbSchemaObject):
"A table column definition"... |
# 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... |
"""In this module we provide services for working with fit files.
Resources
- fitparse package: [GitHub](https://github.com/dtcooper/python-fitparse) and \
[Docs](http://dtcooper.github.io/python-fitparse/)
- fitdecode pacakge: [GitHub](https://github.com/polyvertex/fitdecode) and \
[Read the Docs](htt... |
import io
import unittest
from contextlib import redirect_stdout
from unittest.mock import patch
class TestQ(unittest.TestCase):
@patch('builtins.input', side_effect=[
'3',
'1 0',
'2 $',
'3 1',
])
def test_case_0(self, input_mock=None):
text_trap = io.StringIO()
... |
import FWCore.ParameterSet.Config as cms
regressionModifier106XUL = cms.PSet(
modifierName = cms.string('EGRegressionModifierV3'),
rhoTag = cms.InputTag('fixedGridRhoFastjetAllTmp'),
useClosestToCentreSeedCrysDef = cms.bool(False),
maxRawEnergyForLowPtEBSigma = cms.double(-1),
maxRawEnergyF... |
# Copyright 2015 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 os
import time
import unittest
from mock import patch
from chirp.library import audio_file_test
from chirp.library import do_delete_audio_file_from_db
from chirp.library import database
TEST_DB_NAME_PATTERN = "/tmp/chirp-library-db_test.%d.sqlite"
class DeleteFingerprintTest(unittest.TestCase):
def set... |
from setuptools import setup
setup(
name='pytest-testmon',
description='take TDD to a new level with py.test and testmon',
long_description=''.join(open('README.rst').readlines()),
version='0.9.15',
license='MIT',
platforms=['linux', 'osx', 'win32'],
packages=['testmon'],
url='https://g... |
import unittest
import pyrulo.class_imports
class TestImports(unittest.TestCase):
def setUp(self) -> None:
pass
def tearDown(self) -> None:
pass
def test_whenImportClassesByDir_resultIsTheExpected(self):
# arrange
path = "test_classes"
# act
classes = p... |
import collections
import pytest # noqa: F401
from pudb.py3compat import builtins
from pudb.settings import load_breakpoints, save_breakpoints
def test_load_breakpoints(mocker):
fake_data = ["b /home/user/test.py:41"], ["b /home/user/test.py:50"]
mock_open = mocker.mock_open()
mock_open.return_value.re... |
# -*- coding: utf-8 -*-
import hashlib
from unittest.mock import MagicMock
from asyncy.AppConfig import Expose
from asyncy.Containers import Containers
from asyncy.Exceptions import ActionNotFound, ContainerSpecNotRegisteredError,\
EnvironmentVariableNotFound, K8sError
from asyncy.Kubernetes import Kubernetes
from... |
# -*- coding:utf-8 -*-
from __future__ import unicode_literals
from django.utils.translation import ugettext_lazy as _
from yepes import forms
from yepes.fields.char import CharField
from yepes.validators import PostalCodeValidator
from yepes.utils.deconstruct import clean_keywords
class PostalCodeField(CharField)... |
"""
Interface to a test suite module (one or more runs) used by ProductModelProgram
"""
from operator import concat
from .model import Model
from functools import reduce
class TestSuite(Model):
def __init__(self, module, exclude, include):
Model.__init__(self, module, exclude, include)
def post_init(self):
... |
from typing import ( # noqa: F401
Type,
)
from cytoolz import (
curry,
)
from eth_utils import (
encode_hex,
ValidationError,
)
from eth.constants import (
MAX_UNCLE_DEPTH,
)
from eth.rlp.blocks import BaseBlock # noqa: F401
from eth.rlp.receipts import Receipt
from eth.validation import (
... |
from setuptools import find_packages, setup
__version__ = '1.0.1'
tests_require = [
"flake8==3.9.2",
"nose==1.3.7"
]
with open('README.md', 'r') as fh:
long_description = fh.read()
setup(
name='next-theme-kit',
author="29next",
author_email="dev@29next.com",
url='https://github.com/29ne... |
from __future__ import annotations
import string
from dataclasses import dataclass
from typing import Any, Tuple
from expression import Error, Nothing, Ok, Option, Some, TaggedUnion, match, pipe, tag
from expression.collections import Block
from expression.extra.parser import (
Parser,
and_then,
any_of,
... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('petshop', '0002_dono'),
]
operations = [
migrations.AddField(
model_name='animal',
name='dono',
... |
# -*- coding:utf-8 -*-
# Author:hankcs
# Date: 2018-06-21 19:46
# 《自然语言处理入门》5.3 基于感知机的人名性别分类
# 配套书籍:http://nlp.hankcs.com/book.php
# 讨论答疑:https://bbs.hankcs.com/
import sys,os# environment, adjust the priority
sys.path.insert(0,os.path.dirname(os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))... |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.10 on 2018-04-03 09:55
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('core', '0142_auto_20180301_2143'),
]
operations =... |
import os
import json
from datetime import datetime
from .challenge import Challenge
from hrcm.services.db import DBConnector
from hrcm.errors.bad_request import BadRequest
from hrcm.helpers import format_username, format_message
class Candidate:
"""
@desc We prepare all the instance parameters along side th... |
import base64
import json
import re
import requests
import psutil
from pysys.basetest import BaseTest
from pysys.constants import FAILED
from cumulocity import Cumulocity
from environment_tedge import TedgeEnvironment
"""
Environment to manage automated connects and disconnects to c8y
"""
class EnvironmentC8y(Ted... |
from p4app import P4Program
import json
# Compile a P4_16 program:
prog16 = P4Program('wire.p4')
prog16.compile()
# Inspect the compiled JSON file
with open(prog16.json(), 'r') as f:
bmv2_json = json.load(f)
#print bmv2_json['actions']
# Compile a P4_14 program:
prog14 = P4Program('wire14.p4', version=14)
p... |
from __future__ import print_function
import sys
class MappingReader():
def __init__(self, mapping_file):
self.mapping_file = mapping_file
def pump(self, mapping_processor):
reader = open(self.mapping_file, 'r')
try:
class_name = None
# Read the subsequent ... |
import os
EXECUTABLE_PATH_WINDOWS = '/game/bin/win64/dota2.exe'
EXECUTABLE_PATH_LINUX = '/game/dota.sh'
EXECUTABLE_PATH_LINUX = '/game/bin/linuxsteamrt64/dota2'
BOT_PATH = '/game/dota/scripts/vscripts/bots/'
CONSOLE_LOG = '/game/dota/scripts/vscripts/bots/console.log'
SEND_MSG = '/game/dota/scripts/vscripts/bots/IPC_... |
import sys
import pandas as pd
import requests
import nltk
nltk.download('stopwords')
from nltk.tokenize import RegexpTokenizer
from nltk.corpus import stopwords
from bs4 import BeautifulSoup
# --- open dataset --- #
data = pd.read_csv('./dataset/translated_twitter_posts.csv')
documents = data['translated_posts']
#... |
"""
This model supports user labeling of resources in various ways.
For a User u, this instantiates a subobject u.ulabels (like u.uaccess)
that contains all the labeling functions.
Functions include:
* u.ulabels.label_resource(r, label)
instantiates a label for a resource. Resources can have multiple labels.
... |
# Copyright 2019 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... |
#!/usr/bin/python
from mininet.net import Mininet
from mininet.node import Controller, RemoteController, OVSController
from mininet.node import CPULimitedHost, Host, Node
from mininet.node import OVSKernelSwitch, UserSwitch
from mininet.node import IVSSwitch
from mininet.cli import CLI
from mininet.log import setLogL... |
import pickle
import plaidrl.torch.pytorch_util as ptu
from plaidrl.core import logger
from plaidrl.core.meta_rl_algorithm import MetaRLAlgorithm
from plaidrl.core.simple_offline_rl_algorithm import OfflineMetaRLAlgorithm
from plaidrl.data_management.env_replay_buffer import EnvReplayBuffer
from plaidrl.demos.source.m... |
# -*- coding: utf-8 -*-
# Generated by Django 1.10.4 on 2017-03-05 13:47
from __future__ import unicode_literals
from django.db import migrations, models
import jsonfield.fields
import uuid
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.C... |
# Generated by Django 1.9.13 on 2017-08-31 05:44
from django.conf import settings
import django.contrib.postgres.fields.jsonb
from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone
import markupfield.fields
class Migration(migrations.Migration):
replaces = [('comm... |
# Copyright 2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"). You
# may not use this file except in compliance with the License. A copy of
# the License is located at
#
# http://aws.amazon.com/apache2.0/
#
# or in the "license" file accompa... |
from pm4py.models.transition_system import transition_system, utils |
# -*- coding: utf-8 -*-
#
# Copyright © Spyder Project Contributors
# Licensed under the terms of the MIT License
# (see spyder/__init__.py for details)
"""
Contains the text debugger manager.
"""
import os.path as osp
from qtpy.QtWidgets import QInputDialog, QLineEdit
from spyder.config.main import CONF
from spyder... |
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under t... |
#! /usr/bin/python3
#
# Copyright (c) 2017 Intel Corporation
#
# SPDX-License-Identifier: Apache-2.0
#
# pylint: disable = missing-docstring
"""Testcase using two targets
--------------------------
Note n this case the target group names are listing two targets and
each target obejct has different values.
.. literali... |
# coding=utf-8
# *** WARNING: this file was generated by pulumi-gen-eks. ***
# *** 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
from ._inputs i... |
__doc__="""An experimental SVG renderer for the ReportLab graphics framework.
This will create SVG code from the ReportLab Graphics API (RLG).
To read existing SVG code and convert it into ReportLab graphics
objects download the svglib module here:
http://python.net/~gherman/#svglib
"""
import math, types, sys, os... |
# -*- coding: utf-8 -*-
"""
configfile.py - Human-readable text configuration file library
Copyright 2010 Luke Campagnola
Distributed under MIT/X11 license. See license.txt for more infomation.
Used for reading and writing dictionary objects to a python-like configuration
file format. Data structures may be nested a... |
# Copyright 2012 OpenStack Foundation
# 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 requ... |
import os
from importlib import import_module
def get_providers():
for provider_file in os.listdir(os.path.dirname(os.path.abspath(__file__))):
if provider_file[0] != '$':
continue
provider = provider_file.replace('.py', '')
yield import_module(f'{__package__}.{provider}')
d... |
# Copyright (C) 2019 The Raphielscape Company LLC.
#
# Licensed under the Raphielscape Public License, Version 1.c (the "License");
# you may not use this file except in compliance with the License.
#
"""
This module updates the userbot based on Upstream revision
"""
from os import remove, execle, path, makedirs, gete... |
#!/usr/bin/env python
#############################################################################
##
## Copyright (C) 2010 Riverbank Computing Limited.
## Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
## All rights reserved.
##
## This file is part of the examples of PyQt.
##
## $QT_BEGIN_LICENS... |
import json
from re import split
import shutil
import os
import sys
import numpy as np
from PIL import Image, ImageDraw, ImageFont
from skimage import io
from shapely.geometry import Polygon
Image.MAX_IMAGE_PIXELS = None
def make_dir(path):
if not os.path.exists(path):
os.makedirs(path)
else:
... |
# ---------------------------------------------------------------
# imp_head.py
# Set-up time: 2020/5/21 下午11:22
# Copyright (c) 2020 ICT
# Licensed under The MIT License [see LICENSE for details]
# Written by Kenneth-Wong (Wenbin-Wang) @ VIPL.ICT
# Contact: wenbin.wang@vipl.ict.ac.cn [OR] nkwangwenbin@gmail.com
... |
"""
ASGI config for PlantEmissionController project.
It exposes the ASGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/3.1/howto/deployment/asgi/
"""
import os
from django.core.asgi import get_asgi_application
os.environ.setdefau... |
#!/usr/bin/env python
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# Author: Piyush Agram
# Copyright 2013, by the California Institute of Technology. ALL RIGHTS RESERVED.
# United States Government Sponsorship acknowledged.
# Any commercial use must be negotiated with th... |
# -*- coding: utf-8 -*-
# @Time : 6/10/21 5:04 PM
# @Author : Yuan Gong
# @Affiliation : Massachusetts Institute of Technology
# @Email : yuangong@mit.edu
# @File : ast_models.py
import os
os.environ["CUDA_DEVICE_ORDER"] = "PCI_BUS_ID"
os.environ["CUDA_VISIBLE_DEVICES"] = "0,1,2,3"
import torch
import torch... |
"""
Read in the output from the trace-inputlocator script and create a GraphViz file.
Pass as input the path to the yaml output of the trace-inputlocator script via config file.
The output is written to the trace-inputlocator location.
WHY? because the trace-inputlocator only has the GraphViz output of the last call ... |
# Copyright 2017 Intel 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 law or agreed to in wri... |
import time
import pytest
import jwt
from cryptography.hazmat.primitives.asymmetric import rsa
from cryptography.hazmat.primitives import serialization
from authlib.jose import jwk
from util.security.jwtutil import (
decode,
exp_max_s_option,
jwk_dict_to_public_key,
InvalidTokenError,
InvalidAlgo... |
from typing import Any, Dict, Optional
from django.contrib.postgres.fields import JSONField
from django.core.validators import RegexValidator
from django.db import models
from django.utils.timezone import datetime
from django.utils.translation import gettext_lazy as _
from core.fields import IntegerChoicesField
# V... |
# -*- coding: utf-8 -*-
# Generated by Django 1.10.4 on 2016-12-27 15:15
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('switches', '0001_initial'),
]
operations = [
migrations.AlterField(
... |
# -*- coding: utf-8 -*-
# Define here the models for your spider middleware
#
# See documentation in:
# https://docs.scrapy.org/en/latest/topics/spider-middleware.html
from typing import Iterable
from scrapy import signals
from .items import TransportInfo, SeatInfo
from .settings import MOCKED_DATA_PATH
class Tic... |
from marshmallow import INCLUDE, Schema, fields, post_load, pre_load
class Dates:
def __init__(self, on_sale=None, foc=None, unlimited=None, **kwargs):
self.on_sale = on_sale
self.foc = foc
self.unlimited = unlimited
self.unknown = kwargs
class DatesSchema(Schema):
onsaleDate... |
# Placeholder
|
#external tools: textgain
import requests
import json
def sentiment_result(text):
URL = 'http://text-processing.com/api/sentiment/'
raw_text = text
r = requests.post(URL, data = {'text':raw_text})
sentiment = json.loads(r.text).get('label')
return sentiment
|
# Copyright 2017 Insurance Australia Group Limited
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... |
"""Stuff to parse AIFF-C and AIFF files.
Unless explicitly stated otherwise, the description below is true
both for AIFF-C files and AIFF files.
An AIFF-C file has the following structure.
+-----------------+
| FORM |
+-----------------+
| <size> |
+----+------------+
| | AIFC ... |
# Generated by Django 2.1.5 on 2019-02-01 08:51
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('categories', '0001_initial'),
]
operations = [
migrations.AddField(
model_name='category',
name='category_image',
... |
"""singosgu URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/3.0/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, name='home')
Class-base... |
# Save the geometry (triangles, verticies) of a FESOM grid to a gdal dataset
# Author: R. Rietbroek
# Date 17 May 2019
# Currently this save the surface nodes only
# Improvements are possible
# * Optionally store the 3D surfaces
# * add info on e.g. bathymetry the nodes
# *
import osgeo,ogr as ogr
import osgeo.osr as... |
# This file is part of the Edison Project.
# Please refer to the LICENSE document that was supplied with this software for information on how it can be used.
# Django settings for Edison project.
DEBUG = True
TEMPLATE_DEBUG = DEBUG
ADMINS = (
# ('Your Name', 'your_email@domain.com'),
)
# Django Debug Toolbar set... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# flake8: noqa
"""
Unit tests for Morse Code: Bits
Students should not modify this file.
"""
__author__ = 'madarp'
import sys
import unittest
import importlib
import subprocess
# suppress __pycache__ and .pyc files
sys.dont_write_bytecode = True
# Kenzie devs: change t... |
# Copyright 2019 Objectif Libre
#
# 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 agr... |
# -*- coding: utf-8 -*-
from plone.app.registry.browser import controlpanel
from plone.protect.interfaces import IDisableCSRFProtection
from collective.solr.interfaces import ISolrSchema, _
from plone.restapi.controlpanels import RegistryConfigletPanel
from Products.CMFPlone.utils import safe_unicode
from Products.Five... |
class Linux32: pass |
"""
binaries hook for pygame seems to be required for pygame 2.0 Windows.
Otherwise some essential DLLs will not be transfered to the exe.
And also put hooks for datas, resources that pygame uses, to work
correctly with pyinstaller
"""
import os
import platform
from pygame import __file__ as pygame_main_file
# Get... |
import scrapy
import json
import datetime
POSTED_DATE_FORMAT = "%Y-%m-%d"
# BOOKMARK is cursor that tracks just how far back we should scrape each time
BOOKMARK = datetime.datetime(
year=2020, month=1, day=1
) # TODO factor bookmark into its own logic
class ChemRXIVSpider(scrapy.Spider):
name = "chemrxiv"
... |
"""
ASGI config for managair_server project.
It exposes the ASGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/3.1/howto/deployment/asgi/
"""
import os
from django.core.asgi import get_asgi_application
os.environ.setdefault("DJAN... |
#!/usr/bin/env python3
import datetime
import os
import time
from pathlib import Path
from typing import Dict, Optional, Tuple
from collections import namedtuple, OrderedDict
import psutil
from smbus2 import SMBus
import cereal.messaging as messaging
from cereal import log
from common.filter_simple import FirstOrderF... |
from tqdm import tqdm
import numpy as np
import torch
import torch.nn as nn
def build_mlp(input_dim, output_dim, hidden_units=[64, 64],
hidden_activation=nn.Tanh(), output_activation=None):
layers = []
units = input_dim
for next_units in hidden_units:
layers.append(nn.Linear(units, ne... |
from .scf_base import SiriusBaseCalculation, make_sirius_json
from aiida.plugins import DataFactory
from aiida.common import datastructures
import tempfile
import json
import yaml
import six
SiriusMDParameters = DataFactory('sirius.md')
SinglefileData = DataFactory('singlefile')
ArrayData = DataFactory('array')
List =... |
"""
Support for the NetAtmo Weather Service.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/sensor.netatmo/
"""
import logging
from time import time
import threading
import voluptuous as vol
from homeassistant.components.sensor import PLATFORM_SCHEMA
f... |
#!/usr/bin/env python3
from __future__ import division
import sys
import math
import random
import time
from collections import deque
from pyglet import image
from pyglet.gl import *
from pyglet.graphics import TextureGroup
from pyglet.window import key, mouse
TICKS_PER_SEC = 60
# Size of sectors used to ease block... |
#!/usr/bin/env python3
import sys
def get_next_one(wint):
"""
returns next generation as list of rows where each row contain string of 0|1 characters
:param wint array of integers 0|1 older generation
:retval next_one list of rows next generation
"""
ne... |
from django.core.management import setup_environ
from geonition import settings
setup_environ(settings)
jsonfile = open("../data/geojson_rest.json")
print jsonfile
import json
json_list = json.loads(jsonfile.read())
jsonfile.close()
data_dict = {}
for obj in json_list:
if obj['model'] == 'geojson_rest.featur... |
import sys
from cx_Freeze import setup, Executable
# Dependencies are automatically detected, but it might need fine tuning.
build_exe_options = {"optimize": 2,
"packages": ["dbm"],
"include_files": ["image(s)", "font(s)", "db", "README.txt"]
}
setup( na... |
# Copyright (C) 2014-2017 New York University
# This file is part of ReproZip which is released under the Revised BSD License
# See file LICENSE for full license details.
"""Utility functions dealing with package managers.
"""
from __future__ import division, print_function, unicode_literals
import logging
import pl... |
#!/usr/bin/env python
#
# Electrum - lightweight Bitcoin client
# Copyright (C) 2011 Thomas Voegtlin
#
# 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... |
# coding: utf-8
"""
Kubernetes
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501
OpenAPI spec version: v1.14.7
Generated by: https://openapi-generator.tech
"""
import pprint
import re # noqa: F401
import six
class Extensions... |
# Copyright (c) 2020-2021, NVIDIA 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 law or agre... |
from multiprocessing import Value
from random import choice
from chillow.service.ai.pathfinding_ai import PathfindingAI
from chillow.service.ai.search_tree_ai import SearchTreeAI
from chillow.model.action import Action
from chillow.model.game import Game
from chillow.model.player import Player
from chillow.service.gam... |
'''
This is a extended unittest module for Kivy, to make unittests based on
graphics with an OpenGL context.
The idea is to render a Widget tree, and after 1, 2 or more frames, a
screenshot will be made and be compared to the original one.
If no screenshot exists for the current test, the very first one will be used.
... |
"""A Minecraft remapper for already deobfuscated forge mod source code."""
__version__ = "1.1.0"
from minecraft_remapper.remapper import Remapper as Remapper
|
# -*- coding: utf-8 -*-
# Generated by Django 1.9.6 on 2016-10-13 15:51
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
('payments', '0002_auto_20160718_2345'),
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.