text
stringlengths
2
999k
# Copyright 2019 The Cirq Developers # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in ...
import numpy import chainer from chainer import backend from chainer.backends import cuda from chainer.backends import intel64 from chainer import configuration from chainer import function_node import chainer.functions from chainer.utils import argument from chainer.utils import conv from chainer.utils import type_ch...
# -*- coding: utf-8 -*- # # Copyright (C) 2012-2013 Vinay Sajip. # Licensed to the Python Software Foundation under a contributor agreement. # See LICENSE.txt and CONTRIBUTORS.txt. # """Parser for the environment markers micro-language defined in PEP 345.""" import ast import os import sys import platform ...
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright (c) 2013 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....
from pathlib import Path import moonleap.resource.props as P from moonleap import ( MemFun, Prop, StoreOutputPaths, StoreTemplateDirs, create, extend, feeds, receives, register_add, ) from moonleap.verbs import has, runs from titan.project_pkg.project import Project from titan.proje...
import shopify from test.test_helper import TestCase class RefundTest(TestCase): def setUp(self): super(RefundTest, self).setUp() self.fake("orders/450789469/refunds/509562969", method='GET', body=self.load_fixture('refund')) def test_should_find_a_specific_refund(self): refund = shopi...
# Copyright (c) 2004 Python Software Foundation. # All rights reserved. # Written by Eric Price <eprice at tjhsst.edu> # and Facundo Batista <facundo at taniquetil.com.ar> # and Raymond Hettinger <python at rcn.com> # and Aahz (aahz at pobox.com) # and Tim Peters """ These are the test cases for the Decim...
class Food: def __init__(self, name, rich_in): self.name = name self.rich_in = rich_in def __str__(self): s = f"Name: {self.name}\nRich in {self.rich_in}" return s # Write your codes here. class Vegetable(Food): def __init__(self, name, rich_in,money): super().__ini...
#Arithmetics #Addition def add(a,b,c): d=a+b+c return d res_add=add(10,20,30) print(res_add) #Subtraction def sub(a,b,c): d=a-b-c return d res_sub=sub(10,20,30) print("1.Normal result 2.Absolute result") choice=int(input("Enter your choice:")) if(choice=="1"): print(res_sub) else: print(abs(re...
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models import django_irods.storage import hs_core.models class Migration(migrations.Migration): dependencies = [ ('hs_core', '0024_baseresource_resource_federation_path'), ] operations = [ ...
import pyaf.tests.model_control.test_ozone_custom_models_enabled as testmod testmod.build_model( ['Anscombe'] , ['Lag1Trend'] , ['Seasonal_DayOfWeek'] , ['MLP'] );
# 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 app...
""" Jinja2 renderer and black formatter. """ from pathlib import Path from typing import Iterable, Optional import black import mdformat from black import InvalidInput, NothingChanged from isort.api import Config, sort_code_string from mypy_boto3_builder.constants import LINE_LENGTH, TEMPLATES_PATH from mypy_boto3_bu...
import datetime import urllib from django.conf import settings from django.contrib.auth.models import User from django.urls import reverse from django.utils.translation import ugettext as _ from rest_flex_fields import FlexFieldsModelSerializer from rest_flex_fields.serializers import FlexFieldsSerializerMixin from re...
# Generated by Django 3.2 on 2021-05-13 21:21 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('polls', '0005_auto_20210513_2111'), ] operations = [ migrations.RenameField( model_name='donor_registration', old_name...
#!/usr/bin/env python3 # Copyright 2020 The Fuchsia Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import argparse import os import subprocess import sys def main(): parser = argparse.ArgumentParser( description="Traces ...
# 字符串知识 """ 1、ASCII标准是美国创建的,定义了从0到127的字符代码,允许每个字符存储在一个8位的字节中(实际上是127位) 2、每个字符一个字节不够,各种符号和重音字符并不在ASCII所定义的可能字符的范围中,所以使用0到255来表示字符 并且把128到255分配给特殊字符,这样的标准叫做Latin-I,广泛使用西欧地区。 3、一些字母表定义了如此多的字符,以至于无法把其中的每一个都表示成一个字节。Unicode考虑到更多的灵活性。 Unicode通常用在国际化的程序中,拥有比8位字符所能表示的更多的字符 4、 UTF-8编码,采用了可变的字节数的方案,小于128的字符代码表示为单个字节,128到0x7ff(20...
from __future__ import annotations from spark_auto_mapper_fhir.fhir_types.uri import FhirUri from spark_auto_mapper_fhir.value_sets.generic_type import GenericTypeCode from spark_auto_mapper.type_definitions.defined_types import AutoMapperTextInputType # This file is auto-generated by generate_classes so do not edi...
import re from validate_docbr import CPF def cpf_valido(cpf): cpf = CPF() cpf.validate(cpf) return len(cpf) == 11 def celular_valido(celular): modelo = '[0-9]{2} [0-9]{5}-[0-9]{4}' resposta = re.findall(modelo, celular) return resposta
import os import subprocess from collections import OrderedDict import cothread from annotypes import Anno from malcolm import __version__ from malcolm.core import ( Alarm, AlarmSeverity, BadValueError, ProcessStartHook, ProcessStopHook, StringMeta, Widget, ) from malcolm.modules import bu...
from __future__ import division, absolute_import from .util import * from .numerictypes import * from .functions import * from .ufuncs import * from .compat import * from .session import * from . import util from . import numerictypes from . import functions from . import ufuncs from . import compat from . import ses...
import inflect def predict(word: str, count: int) -> str: """ Apply the `inflect.engine().plural` function to accord the `word` in plural regarding its `count`.\n As specified in `infect` documentation, the function return as follows:\n If count is one of the following words, then return text: ...
# -*- coding: utf-8 -*- import click from auger_cli.cli_client import pass_client from auger_cli.formatter import ( print_list, print_record, print_table, print_line, print_header ) from auger_cli.api import experiments @click.group( 'experiments', invoke_without_command=True, short...
# -*- encoding: utf-8 -*- from coderunner import test, Perl, LangC, Python, Ruby, Cpp, main test(Ruby, "module_inheritance.rb", """ hello hello """, is_file=True) test(Ruby, "mixin.rb", """ bar! """, is_file=True) test(Perl, "reenter.pl", """ 0 """, is_file=True) test(Python, "oldclass.py", """ base D2 base """, i...
""" @authors: Hulking April 2019 """ import numpy as np import keras.backend as K from keras.layers import Input, Lambda from keras.models import Model from keras.optimizers import Adam from keras.callbacks import TensorBoard, ModelCheckpoint, ReduceLROnPlateau, EarlyStopping from yolo3.model import preprocess_true_b...
from .sortingcomparison import *
""" Django settings for personal_website project. Generated by 'django-admin startproject' using Django 3.0.10. For more information on this file, see https://docs.djangoproject.com/en/3.0/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/3.0/ref/settings...
# Generated by Django 3.2.6 on 2021-08-19 11:08 import django_countries.fields from django.db import migrations class Migration(migrations.Migration): dependencies = [ ("channel", "0001_initial"), ] operations = [ migrations.AddField( model_name="channel", name="...
import logging import os import re import time from functools import partial, reduce from utility.rp_utils.reportportalV1 import RpLog log = logging.getLogger(__name__) class XunitXML: """Class for processing the xUnit XML file for ReportPortal""" def __init__(self, rportal, name=None, configs=None, xml_da...
# -*- coding: utf-8 -*- """Linked List Nth to Last Node .ipynb.ipynb Automatically generated by Colaboratory. Original file is located at https://colab.research.google.com/drive/1cr1A4QVH-0fzpToybYwX4udKRlzkGqF- """ # Write a function that takes a head node and an integer value n and then returns the nth to last...
# License: MIT # # Implements multi-view co-training classification for 2-view data. import numpy as np from sklearn.naive_bayes import GaussianNB from .base import BaseCoTrainEstimator from ..utils.utils import check_Xs, check_Xs_y_nan_allowed class CTClassifier(BaseCoTrainEstimator): r""" This class imple...
import os from pathlib import Path import pytest @pytest.fixture def test_files(nb_file): pytest.importorskip("nbconvert") pytest.importorskip("nbformat") import nbconvert import nbformat from nbconvert.preprocessors import ExecutePreprocessor if not Path(nb_file).exists(): return ...
import re #Function to get user input without extra spaces def user_input(request): text = input(request) text.strip() return text #Function checks for suffix mutations to words (i.e., s, ed, est, ly, ect.) def replace_simple_ending(text): with open("./ending.txt") as ending_file: ending_line...
# -*- coding: utf-8 -*- ''' Copyright 2013 Google 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 applic...
import re # Read in file with open('challenge_03_input.txt') as file: data = file.readlines() # Make it all 1 line data_str = ''.join(data).replace('\n', '') # Regex results = re.findall(r'[a-z][A-Z]{3}[a-z][A-Z]{3}[a-z]', data_str) # Get middle character ''.join([x[4] for x in results])
# MIT License # # Copyright (c) [2020 - 2021] The yinyang authors # # 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...
import numpy as np import mxnet as mx import argparse import cv2 import time from core.symbol import P_Net20, R_Net, O_Net from core.fcn_detector import FcnDetector from core.detector import Detector from tools.load_model import load_param from core.MtcnnDetector20 import MtcnnDetector def test_net(imgfile,prefix, ep...
#!/usr/bin/env python # From: https://github.com/ActiveState/code/blob/master/recipes/Python/576696_OrderedSet_with_Weakrefs/ # noqa from weakref import proxy try: import collections.abc as collections_abc except ImportError: import collections as collections_abc class Link(object): __slots__ = 'prev',...
from __future__ import absolute_import from __future__ import division from __future__ import print_function from itertools import combinations __all__ = [ 'network_complement' ] def network_complement(network, cls=None): """Generate the complement network of a network. The complement of a graph G is ...
""" The main QuerySet implementation. This provides the public API for the ORM. """ import copy import sys import warnings from collections import OrderedDict, deque from django.conf import settings from django.core import exceptions from django.db import ( DJANGO_VERSION_PICKLE_KEY, IntegrityError, connections, ...
from django.test import TestCase from django.contrib.auth import get_user_model from django.urls import reverse from rest_framework.test import APIClient from rest_framework import status CREATE_USER_URL = reverse('user:create') TOKEN_URL = reverse('user:token') def create_user(**param): return get_user_model().o...
import pytest import os import re from typing import Tuple #from starkware.starknet.testing.starknet import Starknet from starkware.starknet.compiler.compile import compile_starknet_files from starkware.starknet.testing.contract import StarknetContract from starkware.starknet.testing.state import StarknetState SCALE_...
""" This file offers the methods to automatically retrieve the graph Gelidibacter mesophilus. The graph is automatically retrieved from the STRING repository. Report --------------------- At the time of rendering these methods (please see datetime below), the graph had the following characteristics: Datetime: 202...
import numpy as np import torch from torch.utils.data import DataLoader # local package from libs import tpcpath from libs.dataset import SimpleSceneDataset from libs.three_nn import three_nn # PointRCNN # torch-points-kernels import torch_points_kernels as tpk # torchpcp pacakage from torchpcp.modules.functional.o...
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('display', '0001_initial'), ('authors', '0001_initial'), ('attachments', '0001_initial'), ] operations = [ mi...
from django.urls import path from . import views app_name = 'meals' urlpatterns = [ path('', views.meal_list, name = 'meal_list'), path('<slug:slug>', views.meal_detail, name = 'meal_detail'), ]
from quickpos.product import Product from quickpos.database import Database class Transaction: def __init__(self): self.db = Database() self.prod = Product() ## Record a transaction using a list of products def RecordTransaction(self, *args): ## Get the primary key lastrowid = self.GetOrderID()...
""" Example showing how to wrap the iGibson class using ray for rllib. Multiple environments are only supported on Linux. If issues arise, please ensure torch/numpy are installed *without* MKL support. This example requires ray to be installed with rllib support, and pytorch to be installed: `pip install torch "ra...
# coding=utf-8 """Tests for import_utils.""" # Copyright 2017 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless require...
import logging from datetime import datetime from dateutil.relativedelta import relativedelta from .period import Period, Granularity from .week import Week class Year(Period): granularity = Granularity.YEAR def __init__(self, year): self.start_datetime = datetime(year, 1, 1) self.end_date...
# Generated by Django 2.2.4 on 2019-09-17 05:46 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('teams', '0003_auto_20190909_1621'), ('accounts', '0009_auto_20190809_1659'), ] operations = [ migrations.AddField( model_...
import unittest from fitness_tracker.calculators.body_fat.body_fat_formulas import * from fitness_tracker.calculators.body_fat.body_fat_calculator import BodyFatCalculator class TestFormulas(unittest.TestCase): def test_male_navy_USC(self): self.assertEqual(round(male_navy_USC(37.5, 19.5, 70.5), 1), 15.3) def...
# Generated by Django 2.0.4 on 2018-04-30 18:20 from django.db import migrations, models import django.utils.timezone class Migration(migrations.Migration): dependencies = [ ('tamples', '0003_auto_20180430_1448'), ] operations = [ migrations.AlterField( model_name='tample', ...
import csv import mysql.connector REAPER_THRESHOLD = 65 mydb = mysql.connector.connect( host="localhost", port=8889, user="root", password="secret_password", database="reaper2" ) cursor = mydb.cursor() cursor.execute("SELECT project_id,score FROM reaper_results_big") result = cursor.fetchall() ...
import pickle from unittest import mock import numpy as np import pytest import tensorflow as tf from garage.tf.optimizers import LbfgsOptimizer from garage.tf.regressors import GaussianCNNRegressor from tests.fixtures import TfGraphTestCase def get_train_test_data(): matrices = [ np.linsp...
#!/usr/bin/env python # # Copyright 2016 Google Inc. # # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Create a Clang toolchain for Linux hosts.""" import argparse import os import subprocess import tempfile REPO = "https://llvm.googlesource.com/" BRANCH = "...
''' #!/usr/bin/python #Author: Suraj Patil #Version: 2.0 #Date: 27th March 2014 does the ceaser decryption of the output of ceaser.py, the cipher and shift are taken from the user and the plain text is printed on the console ''' import string cipher=raw_input('enter cipher') key=raw_input('enter key') letters = strin...
from keras.layers import Dense, Dropout, Embedding, LSTM, GlobalMaxPooling1D, SpatialDropout1D, Flatten from keras.models import Sequential from keras.utils import to_categorical from keras import layers from keras.preprocessing.sequence import pad_sequences from keras.preprocessing.text import Tokenizer import pandas ...
# Copyright 2021 Clivern # # 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, soft...
# -*- coding: utf-8 -*- ############################################################################# # # Copyright © Dragon Dollar Limited # contact: contact@dragondollar.com # # This software is a collection of webservices designed to provide a secure # and scalable framework to build e-commerce websites. # # This s...
from django.test import TestCase from django.utils import timezone from rest_framework import status from bluebottle.bluebottle_utils.tests import generate_random_slug from apps.projects.tests import ProjectTestsMixin from .models import Task import json class TaskTestsMixin(ProjectTestsMixin): """ Mixin base cla...
''' 处理火灾检测数据集 VOC2020 ''' import os import numpy as np # xml_root = r'/home/ailab/dataset/Security_check/VOC2020/Annotations/' # xmls = os.listdir(xml_root) # f =open(r'/home/ailab/dataset/Security_check/VOC2020/ImageSets/Main/train.txt', 'w') # for xml in xmls: # f.write(xml.split('.')[0]+'\n') # f.close() ...
import locale import os import re import urllib.parse import urllib.request from datetime import datetime from sys import getsizeof locale.setlocale(locale.LC_ALL, "ru") import requests RE_XLS_FILE = re.compile(r'href="([^"]+\.xls)"') RE_XLS_DATE = re.compile(r'(?P<start_dt>\d+)-(?P<end_dt>\d+)\s(?P<month>[а-я]+)\b'...
from twilio.rest import Client account_sid = "REDACTED" auth_token = "REDACTED" client = Client(account_sid, auth_token) message = client.messages.create( to="REDACTED", from_="REDACTED", body="It worked!") print("This message was sent to the user successfully: \"" + message.body + "\"")
from zope.interface.common.mapping import IMapping class ISessionDataObject(IMapping): """ Supports a mapping interface plus expiration- and container-related methods """ def getId(): """ Returns a meaningful unique id for the object. Note that this id need not the key under whic...
# coding: utf-8 """ Kubernetes No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) OpenAPI spec version: v1.11.1 Generated by: https://github.com/swagger-api/swagger-codegen.git """ from __future__ import absolute_import import os import sys i...
# -*- coding: utf-8 -*- # Generated by Django 1.11.5 on 2017-10-03 14:42 from __future__ import unicode_literals from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('calculator', '0003_remove_scenario_force_third'), ] operations = [ migrations.Remov...
class Solution: def smallestRepunitDivByK(self, K: int) -> int: if K % 2 == 0: return -1 nums = set() r = 0 for i in range(1, K + 1): r = (r * 10 + 1) % K if r == 0: return i if r not in nums: nums.add(r)...
from flask_wtf import FlaskForm from wtforms import StringField, SelectField, validators class SettingsForm1(FlaskForm): setting_1 = StringField('setting_1') setting_2 = SelectField('setting_2', coerce=str, validators=[validators.optional()]) setting...
# -*- coding: utf-8 -*- from tkinter import ttk, messagebox from tkinter.dialog import Dialog from thonny import tktextext, misc_utils from thonny.globals import get_workbench from thonny.misc_utils import running_on_mac_os, running_on_windows, running_on_linux import tkinter as tk import tkinter.messagebox as tkMess...
from django.apps import AppConfig class StorageConfig(AppConfig): name = 'storage'
# Copyright 2016 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 law ...
from .iotNode import IotNode from .iotRGB import RGB class IotRGBLed(IotNode): """ the base class for RGB LED Note: 0 is off otherwise on """ def __init__(self, name, parent): """ construct a IotRGBLed name: the name of the node parent: parent IotNode object. None for root node....
""" Copyright (c) 2016-present, Facebook, Inc. All rights reserved. This source code is licensed under the BSD-style license found in the LICENSE file in the root directory of this source tree. An additional grant of patent rights can be found in the PATENTS file in the same directory. """ from .currency import Curre...
""" Script entry point """ from src.calrissian.particle3_network import Particle3Network from src.calrissian.layers.particle3 import Particle3 from src.calrissian.optimizers.particle3_sgd import Particle3SGD from src.calrissian.regularization.particle3_regularize_l2 import Particle3RegularizeL2 import numpy as np d...
import datetime import os import unittest from importers.e_trac_importer import ETracImporter from pepys_import.core.store.data_store import DataStore from pepys_import.file.file_processor import FileProcessor FILE_PATH = os.path.dirname(__file__) DATA_PATH = os.path.join(FILE_PATH, "sample_data/track_files/other_dat...
#this is the config file for the blog, to edit along the templates base_url = "/blog" #the base url for the blog template_folder = "templates" static_folder = "static" post_per_page = 5 secret_key = "SECRET" username = "admin" password = "c7ad44cbad762a5da0a452f9e854fdc1e0e7a52a38015f23f3eab1d80b931dd472634dfac71...
from .._utils import IntermediateLayerGetter from ..utils import load_state_dict_from_url from .. import mobilenetv3 from .. import resnet from .deeplabv3 import DeepLabHead, DeepLabV3 from .fcn import FCN, FCNHead from .lraspp import LRASPP __all__ = ['fcn_resnet50', 'fcn_resnet101', 'deeplabv3_resnet50', 'deeplabv3...
############################################################################# # Author: Jayden Lee (Jayden.Lee@student.uts.edu.au) # Date: 6/10/19 # Purpose: To use a SVM for our regression problem. # Source: # In Source Documentation ############################################################################# ####...
from piece import Piece chessCardinals = [(1,0),(0,1),(-1,0),(0,-1)] chessDiagonals = [(1,1),(-1,1),(1,-1),(-1,-1)] def knightList(x,y,int1,int2): return [(x+int1,y+int2),(x-int1,y+int2),(x+int1,y-int2),(x-int1,y-int2),(x+int2,y+int1),(x-int2,y+int1),(x+int2,y-int1),(x-int2,y-int1)] def kingList(x,y): retu...
from . import load, player, resources
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import glob import hashlib import json import os import re import shutil import stat import time import binascii import locale from copy import deepcopy from collections import OrderedDict import cslib # https://stackoverflow.com/a/1546107 # str.endswith 를 사용하기 위해 #c_ex...
import os import numpy as np import tensorflow as tf from tensorflow.python.platform import gfile from tensorface.const import PRETREINED_MODEL_DIR MODEL_FILE_NAME = '20180402-114759/20180402-114759.pb' # to get Flask not complain global tf _tf = tf global sess sess = None def load_model(pb_file, input_map=None): ...
import os import sys import argparse import pandas as pd from scipy import stats sys.path.append(os.path.abspath("..")) from survey._app import CODE_DIR, app from core.models.metrics import gain_mean, rejection_ratio, gain from utils import get_con_and_dfs, get_all_con_and_dfs import metrics STATS_FUNCTIONS = {} ...
from suds.client import Client from suds.xsd.doctor import ImportDoctor, Import #WSDL and XML from: https://data.overheid.nl/data/dataset/basis-wetten-bestand wsdlURL = 'http://wetten.overheid.nl/BWBIdService/BWBIdService.wsdl' # For now we don't use this information because it does not supply full text # Some...
# coding=utf-8 # -------------------------------------------------------------------------- # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is # regenerated. # -------------------------------------------------------------------------- VERSI...
# coding=utf-8 # *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** # *** Do not edit by hand unless you're certain you know what you are doing! *** import json import warnings import pulumi import pulumi.runtime from typing import Union from .. import utilities, tables class GetIps...
# Copyright (c) 2016, Joseph deBlaquiere <jadeblaquiere@yahoo.com> # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # * Redistributions of source code must retain the above copyright notice, this # list of conditions...
# -*- coding: utf-8 -*- # Copyright (c) 2018, Verynice SRL and Contributors # See license.txt from __future__ import unicode_literals import frappe import unittest class TestUnits(unittest.TestCase): pass
from selenium.webdriver.support import expected_conditions as ec from selenium.webdriver.common.by import By from selenium.webdriver.support.ui import WebDriverWait class SubjectPage(object): def __init__(self, driver): self.driver = driver def go_algebra_8_grade(self): self.driver.get("https...
# -*- coding: utf-8 -*- # pylint: disable-msg=W0612,E1101 import itertools import warnings from warnings import catch_warnings from datetime import datetime from pandas.types.common import (is_integer_dtype, is_float_dtype, is_scalar) from pandas.compat...
from django import template from django.conf import settings from django.template import Context, loader register = template.Library() @register.simple_tag def analytics(): 'You must define ANALYTICS_ID = "UA-XXXXXXX-X" in your settings.py' analytics_id = getattr(settings, 'ANALYTICS_ID', None) if analy...
from setuptools import setup # read README as the long description with open('README.md', 'r') as f: long_description = f.read() setup( name='choicemodels', version='0.2.2', description='Tools for discrete choice estimation', long_description=long_description, author='UDST', url='https://g...
# 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 ...
################################################################################ # Copyright 2012 Analog Devices, 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:/...
from vpython import * #GlowScript 3.0 VPython # Create a simple scrolling text object scene.width = scene.height = 250 scene.title = 'This is a test' B = box(pos=vec(0.1,0.2,0)) # Create a textarea element on the web page, below the box object. # $ stands for jQuery, an important web page addition to JavaScript...
import pytest @pytest.mark.asyncio async def test_read_write(only_funcs): key = 42 value = 101 tx_info = await only_funcs.get_value_by_key(key).invoke() assert tx_info.result.value == 0 await only_funcs.set_value_to_key(key, value).invoke() tx_info = await only_funcs.get_value_by_key(key).in...
# -*- coding: utf-8 -*- # Copyright (c) 2018, masonarmani38@gmail.com and contributors # For license information, please see license.txt from __future__ import unicode_literals import frappe from frappe.model.document import Document from frappe.model.mapper import get_mapped_doc class WorkOrder(Document): pass...
""" Utility functions for scraping biorxiv and processing preprint PDFs """ import re import importlib import PyPDF2 # neither urllib nor requests play nicely with rq import urllib3 urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning) from urllib.request import urlopen from bs4 import Beautif...
from shutil import copyfile import os, csv, sys, numpy DATA_FOLDER = sys.argv[1] OUT_FOLDER = sys.argv[2] fracs = {} for fileName in os.listdir(DATA_FOLDER): with open(os.path.join(DATA_FOLDER,fileName), 'r') as inFile: csvFile = csv.DictReader(inFile) noChange = 0 didChange = 0 fo...