text
stringlengths
2
999k
# 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...
#!/usr/bin/env python3 ############################################################################### # # # RMG - Reaction Mechanism Generator # # ...
"""Sparse polynomial rings. """ from __future__ import print_function, division from operator import add, mul, lt, le, gt, ge from types import GeneratorType from sympy.core.expr import Expr from sympy.core.symbol import Symbol, symbols as _symbols from sympy.core.numbers import igcd, oo from sympy.core.sympify impo...
from .quicktimer import Timer
from django.urls import path from .views import ( BaseSpecView, CreateNewFeature, CreateNewCategory, CreateNewFeatureValidator, FeatureChoiceView, CreateFeatureView, NewProductFeatureView, SearchProductAjaxView, AttachNewFeatureToProduct, ProductFeatureChoicesAjaxView, Creat...
""" The Sims 4 Community Library is licensed under the Creative Commons Attribution 4.0 International public license (CC BY 4.0). https://creativecommons.org/licenses/by/4.0/ https://creativecommons.org/licenses/by/4.0/legalcode Copyright (c) COLONOLNUTTY """ from typing import Dict, Any, Callable, Tuple from sims4co...
from __future__ import absolute_import, unicode_literals import io import os import sys import warnings import functools from collections import defaultdict from functools import partial from functools import wraps from importlib import import_module from distutils.errors import DistutilsOptionError, DistutilsFileErr...
import argparse from act.actiontype import ActionType from arguments import Arguments from sample.languagetype import LanguageType from settings import * from utils import inout class ArgsParser: def __init__(self): self.parser = argparse.ArgumentParser() self.init_arguments() self.argume...
# 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...
# Generated by Django 2.0.9 on 2019-03-31 13:55 from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): initial = True dependencies = [ ('artworks', '0001_initial'), ] operations = [ migrations.CreateModel( name='...
import os import sys import time import numpy as np for home in ["/home/vesikary/", "/home/blankjul/workspace/", "/mnt/home/blankjul/workspace/"]: sys.path.insert(0, home + "pymoo-iscso19") sys.path.insert(0, home + "pymoo") from iscso19.callback import MyCallback from iscso19.problem import ISCSO2019 from ...
from torch.distributions import Normal import numpy as np from torch import nn from typing import Tuple from tqdm.auto import trange import torch from deepqmc import Molecule from deepqmc.pyscfext import eval_ao_normed, pyscf_from_mol from deepqmc.wf import WaveFunction from deepqmc.wf.paulinet.molorb import Molecular...
# Imports import os from os import listdir import pandas as pd import datetime months = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"] def addMissingMonths(df): count = 0 for year in df["Year"].unique(): for province in df["Ju...
#!/usr/bin/python # coding: utf-8 -*- # generate_baremetal_macs method ripped from # openstack/tripleo-incubator/scripts/configure-vm DOCUMENTATION = ''' --- module: generate_macs version_added: "2.0" short_description: Generate a list of Ethernet MAC addresses description: - Generate a list of Ethernet MAC addres...
""" Mask R-CNN The main Mask R-CNN model implementation. Copyright (c) 2017 Matterport, Inc. Licensed under the MIT License (see LICENSE for details) Written by Waleed Abdulla """ import os import random import datetime import re import math import logging from collections import OrderedDict import multiprocessing im...
from itertools import product import numpy as np import scipy.sparse import regreg.api as rr from regreg.identity_quadratic import identity_quadratic as sq import nose.tools as nt def test_centering(): """ This test verifies that the normalized transform of affine correctly implements the linear tran...
from unittest import main, TestCase from nn.neuralnet import NeuralNet import numpy as np delta = 0.00000001 class NeuralNetTest(TestCase): def test_cost(self): training_x = np.mat([[1, 2], [3, 4]], dtype=np.float64) training_y = np.mat([[2], [2]], dtype=np.float64) training_examples = (t...
""" With these settings, tests run faster. """ from .base import * # noqa from .base import env # GENERAL # ------------------------------------------------------------------------------ # https://docs.djangoproject.com/en/dev/ref/settings/#secret-key SECRET_KEY = env( "DJANGO_SECRET_KEY", default="jl1CT1MLf...
from .environment import range_environment, notification_sensor_environment from .iot_device import iot_devices from .jwt_rsa_custom_authorizer import jwt_rsa_custom_authorizer from .notify import notify from .large_data_upload import create_token_for_image_upload from .notification_twitter import notification_twitter
# Copyright 2017 Battelle Energy Alliance, 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 agreed t...
from django.shortcuts import render from .forms import UsernameForm from .scraper import Scrape def query(request): return render(request, 'templates/query.html') def result(request): # if this is a POST request we need to process the form data if request.method == 'POST': # create a form insta...
from __future__ import print_function # for localized messages from . import _ from Screens.Screen import Screen from Components.config import config, ConfigSubsection, ConfigEnableDisable, \ ConfigText, getConfigListEntry from Components.ConfigList import ConfigListScreen from Components.Sources.StaticText import St...
from pype.hosts.maya.api import plugin class CreateModel(plugin.Creator): """Polygonal static geometry""" name = "modelMain" label = "Model" family = "model" icon = "cube" defaults = ["Main", "Proxy", "_MD", "_HD", "_LD"] def __init__(self, *args, **kwargs): super(CreateModel, se...
"""Semantic analysis of types""" import itertools from itertools import chain from contextlib import contextmanager from mypy.backports import OrderedDict from typing import Callable, List, Optional, Set, Tuple, Iterator, TypeVar, Iterable, Sequence from typing_extensions import Final from mypy_extensions import Defa...
def test(): assert cat_hash == nlp.vocab.strings["cat"], "¿Asignaste el hash correcto?" assert 'nlp.vocab.strings["cat"]' in __solution__ assert cat_string == "cat", "¿Obtuviste el string correcto?" assert ( "nlp.vocab.strings[cat_hash]" in __solution__ ), "¿Obtuviste el string usando el has...
# using SendGrid's Python Library # https://github.com/sendgrid/sendgrid-python import os import sys from datetime import datetime, timedelta from sendgrid import SendGridAPIClient from sendgrid.helpers.mail import Mail from datetime import datetime # this is so that below import works. Sets the pwd to home directory...
# -*- coding: utf-8 -*- # Form implementation generated from reading ui file 'code_genetrate.ui' # # Created by: PyQt5 UI code generator 5.11.3 # # WARNING! All changes made in this file will be lost! from PyQt5 import QtCore, QtGui, QtWidgets class Ui_Dialog(object): def setupUi(self, Dialog): Dialog.se...
# 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 the basic python packages we need import os import sys import tempfile import pprint import traceback # disable python from generating a .pyc file sys.dont_write_bytecode = True # change me to the path of pytan if this script is not running from EXAMPLES/PYTAN_API pytan_loc = "~/gh/pytan" pytan_static_path =...
# Generated by Django 3.1.7 on 2021-03-29 10:16 from django.conf import settings from django.db import migrations, models import django.db.models.deletion import modelcluster.fields class Migration(migrations.Migration): dependencies = [ migrations.swappable_dependency(settings.AUTH_USER_MODEL), ...
# -*- coding: utf-8 -*- # Import Python libs from __future__ import absolute_import, print_function, unicode_literals import os import shutil # Import Salt Libs import salt.utils.platform # Import Salt Testing Libs from tests.support.case import SSHCase from tests.support.unit import skipIf @skipIf(salt.utils.pla...
from itertools import zip_longest def group(iterable, n): """Splits an iterable set into groups of size n and a group of the remaining elements if needed. Args: iterable (list): The list whose elements are to be split into groups of size n. n (int): The number ...
# 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('BaxM', ['BidM', 'BaxA']) Monomer('Apop', ['C...
import pytest import asyncio from collections import OrderedDict from aiohttp import web from aiohttp_utils import negotiation, CONFIG_KEY from aiohttp_utils.negotiation import Response @pytest.fixture() def app(loop): return web.Application(loop=loop) @pytest.fixture() def client(create_client, app): ret...
"""BleBox climate entities tests.""" import logging import blebox_uniapi import pytest from homeassistant.components.climate.const import ( ATTR_CURRENT_TEMPERATURE, ATTR_HVAC_ACTION, ATTR_HVAC_MODE, ATTR_HVAC_MODES, ATTR_MAX_TEMP, ATTR_MIN_TEMP, CURRENT_HVAC_HEAT, CURRENT_HVAC_IDLE, ...
# Generated by Django 2.2.10 on 2020-03-07 16:51 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('dimservice', '0001_initial'), ] operations = [ migrations.AddField( model_name='work', name='duration', ...
from django.db import models from .utils import unique_id, get_object_or_none class BaseModel(models.Model): """Base model""" id = models.CharField(max_length=22, editable=False, primary_key=True) def __make_id(self): uid = unique_id()[::2] # Limited to 11 characters obj = get_object_o...
from accounts import Accounts, Role import cherrypy from webBase import WebBase KEYHOLDER_BARCODE = '999901' class WebMainStation(WebBase): # STATION @cherrypy.expose def index(self, error=''): with self.dbConnect() as dbConnection: (_, keyholder_name) = self.engine.accounts.getActive...
# Copyright 2020-2022 OpenDR European Project # # 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 agree...
#This is the AIManager script. It sends the current state of #the board or other required parameters to the respective AI #that we are using in the game from AI import MinimaxAI, CustomEvaluationAI, ReinforcementLearningAI from RandomMovesBot.RandomMovesBot import return_random_move from board import is_game_over def ...
from twocaptcha import TwoCaptcha from scrapy import Selector from src.core.request import RequestHandler from src.core.captcha import CaptchaHandler from src.core.logging import log from src.settings import SPIDERS_SETTINGS, CAPTCHA from src.utils.format import format_cpf from src.utils.extract import extract_set_coo...
# Generated by the protocol buffer compiler. DO NOT EDIT! # source: object_detection/protos/multiscale_anchor_generator.proto import sys _b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1')) from google.protobuf import descriptor as _descriptor from google.protobuf import message as _message from...
class Person: somePublicProp = 32 # Costruttore; il primo parametro deve essere il self (this in C++) def __init__(self, name, age): self.name = name self.age = age p1 = Person("Davide", 23) print(p1.name) print(p1.age) # Per cancellare l'oggetto p1 del p1 class Student(Person): def __init__(self, name, ag...
# Lint as: python3 # 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 ...
#!/usr/bin/env python # Copyright 2014-2018 The PySCF Developers. 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 # # U...
from dued.artefactos import artefacto @artefacto def miartefacto(c): pass @artefacto def arg_basico(c, arg="val"): pass @artefacto def args_multiples(c, arg1="val1", otroarg="val2"): pass @artefacto def bool_basico(c, mibool=True): pass
from contextlib import contextmanager import shlex import os import sys import subprocess import yaml import datetime from cookiecutter.utils import rmtree from click.testing import CliRunner import importlib @contextmanager def inside_dir(dirpath): """ Execute code from inside the given directory :para...
from django.contrib import admin from expenshare.sharelists.models import Credit, Debt, Sharelist for model in (Sharelist, Credit, Debt): admin.site.register(model)
#!/usr/bin/env python __all__ = ['dilidili_download'] from ..common import * from .ckplayer import ckplayer_download headers = { 'DNT': '1', 'Accept-Encoding': 'gzip, deflate, sdch, br', 'Accept-Language': 'en-CA,en;q=0.8,en-US;q=0.6,zh-CN;q=0.4,zh;q=0.2', 'Upgrade-Insecure-Requests': '1', 'User-...
from model.group import Group class GroupHelper: def __init__(self, app): self.app = app def return_to_groups_page(self): wd = self.app.wd wd.find_element_by_link_text("group page").click() def create(self, group): wd = self.app.wd self.open_groups_page() ...
from __future__ import absolute_import, division, print_function # # Implemented based on PDB v3.2 specification at: # http://www.wwpdb.org/documentation/format32/sect5.html # # NOTE: the routines for extracting hydrogen bonds are not used in phenix. # I have left them here because they're simpler (and probably still...
#!/usr/bin/env python3 # Copyright (c) 2014-2018 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """ ZMQ example using python3's asyncio Aryacoin should be started with the command line argumen...
import logging import numpy as np import pandas as pd from flask_restful import Resource, reqparse from sklearn.preprocessing import MinMaxScaler from sintel.db import DBExplorer, schema from sintel.resources.auth_utils import verify_auth from sintel.resources.computing.utils.search_similars import return_candidate_s...
# Copyright 2020 The Magenta 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 or agreed to in ...
# Generated by Django 3.2.11 on 2022-03-01 18:49 from django.conf import settings from django.db import migrations, models import django.db.models.deletion import markdownx.models class Migration(migrations.Migration): initial = True dependencies = [ migrations.swappable_dependency(settings.AUTH_US...
file = open('vjezba11/Programiranje.txt', 'w') file.write('Danas je jako lijep dan za programiranje!') file.close() file = open('vjezba11/brojevi.txt', 'w') for i in range(100): file.write(str(i)+'\n') file.close() file = open('vjezba11/ulazno_silazno.txt', 'w') for i in range(0,100): file.write("Ulazno: {0},...
# # 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 us...
from django import forms class EmailResetForm(forms.Form): emails = forms.ChoiceField(label='Email') def __init__(self, *args, **kwargs): choices = kwargs.get('initial', {}).get('emails', []) self.base_fields['emails'] = forms.ChoiceField(choices=choices) super(EmailResetForm, self)._...
class Event: name = 'event' class StartEvent(Event): name = 'start' class QuitEvent(Event): name = 'start' class AddQuestionEvent(Event): name = 'add_question' def __init__(self, question: str, answers: list, choice: int=None, bot_name: str=None): self.question = question self...
# coding: utf-8 """ Hydrogen Integration API The Hydrogen Integration API # noqa: E501 OpenAPI spec version: 1.3.1 Contact: info@hydrogenplatform.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ import pprint import re # noqa: F401 import six from integration_api.con...
from __future__ import unicode_literals from frappe import _ def get_data(): return { 'fieldname': 'preparation', 'transactions': [ { 'items': ['Work Permit'] }, { 'items': ['Medical Insurance'] }, { ...
from dataset import get_dataloader from common import config from model import get_autoencoder from functional.utils import cycle from agent import get_training_agent from functional.visualization import visulize_motion_in_training import torch import os from collections import OrderedDict from tqdm import tqdm from te...
NAS_EMM_TYPE_SECURITY_MODE_COMPLETE = 0x5e SECURITY_MODE_COMPLETE_NAME = 'Security mode complete' def create(pkt): try: mac_layer = pkt['mac-lte'] if int(mac_layer.nas_eps_nas_msg_emm_type) == NAS_EMM_TYPE_SECURITY_MODE_COMPLETE: event = { 'event': SECURITY_MODE_COMPLET...
from __future__ import division import numpy as np import warnings try: import matplotlib.pyplot as pl import matplotlib except ImportError: warnings.warn("matplotlib could not be loaded!") pass from ._labels import labels from . import colors from ..utils import convert_name, approximate_interactions ...
positions = list(map(int, open("input_7", "r").readline().split(","))) def cost_1(horizontal_goal): return sum(abs(pos - horizontal_goal) for pos in positions) def cost_2(goal): return sum((abs(pos - goal) * (abs(pos - goal) + 1)) // 2 for pos in positions) ...
import time from functools import wraps """ 包装器, 计时 """ # 计时 def timethis(func): @wraps(func) def wrapper(*args, **kwargs): start = time.time() result = func(*args, **kwargs) end = time.time() print(func.__name__, end-start) return result return wrapper @timethis...
""" DO NOT MODIFY This file is used to validate your publish settings. """ from __future__ import print_function import os import sys import importlib components_package = 'yasqe_dcc' components_lib = importlib.import_module(components_package) missing_dist_msg = 'Warning {} was not found in `{}.__init__.{}`!!!' m...
class Solution: def rotateString(self, A: str, B: str) -> bool: return len(A) == len(B) and B in A + A
# -*- coding: utf-8 -*- """ A simple python script to compute RHF-CCSD linear response function for calculating properties like dipole polarizabilities, optical rotations etc. References: 1. A Whirlwind Introduction to Coupled Cluster Response Theory, T.D. Crawford, Private Notes, (pdf in the current directory)....
"""The SegmenationTrainingDataset is used to load the training data during the training of a model facing a segmenation problem. The SegmenationTrainingDataset is used to load the test data during the evaluation of a model facing a segmenation problem. """ from torch.utils.data.dataset import Dataset from background_su...
import cv2 import numpy as np img = cv2.imread("../tree_lot.png") gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY) kernel_size = 5 # blur_gray = cv2.GaussianBlur(gray, (kernel_size, kernel_size), 0) blur_gray = cv2.GaussianBlur(src=gray, ksize=(5, 5), sigmaX=0) cv2.imshow("blur", blur_gray) edges = cv2.Canny(blur_gray, ...
# Copyright (c) Open-MMLab. All rights reserved. import copy import math import warnings import numpy as np import torch import torch.nn as nn from torch import Tensor from mmcv.utils import Registry, build_from_cfg, get_logger, print_log INITIALIZERS = Registry('initializer') def constant_init(module, val, bias=0...
#!/usr/bin/python3 # # Copyright 2021 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 ag...
import os import sys import time import socket import json import cv2 import numpy as np import logging as log from imutils.video import FPS from argparse import ArgumentParser from inference import Network from multiprocessing import Process, Queue import multiprocessing import threading import queue # Browser an...
# DROP TABLES songplay_table_drop = "DROP TABLE IF EXISTS songplays;" user_table_drop = "DROP TABLE IF EXISTS users;" song_table_drop = "DROP TABLE IF EXISTS songs;" artist_table_drop = "DROP TABLE IF EXISTS artists;" time_table_drop = "DROP TABLE IF EXISTS time;" # CREATE TABLES songplay_table_create = ("""CREATE T...
# Copyright (c) 2020 zfit import matplotlib.pyplot as plt import tensorflow as tf import zfit def plot_conv_comparison(): # test special properties here n_point_plotting = 2000 obs = zfit.Space("obs1", limits=(-5, 5)) param1 = zfit.Parameter('param1', -3) param2 = zfit.Parameter('param2', 0.3)...
#!/usr/bin/env python # Copyright (C) 2013 The Android Open Source Project # # 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...
# generated from catkin/cmake/template/pkg.context.pc.in CATKIN_PACKAGE_PREFIX = "" PROJECT_PKG_CONFIG_INCLUDE_DIRS = "".split(';') if "" != "" else [] PROJECT_CATKIN_DEPENDS = "".replace(';', ' ') PKG_CONFIG_LIBRARIES_WITH_PREFIX = "".split(';') if "" != "" else [] PROJECT_NAME = "tl_detector" PROJECT_SPACE_DIR = "/mn...
#!/usr/bin/python3 """Visualise three-dimensional integer data using heatmaps. To create a heatmap, pass data formatted as HeatmapPoints (at most one for each (x, y) coordinate of the heatmap, any more will be ignored) to the HeatmapDataSet constructor. Pass the heatmap through a ColorMap subclass's color_heatmap met...
"""Tests for the to_primitives transformation.""" import unittest from tt.errors import InvalidArgumentTypeError from tt.expressions import BooleanExpression from tt.transformations import to_primitives class TestToPrimitives(unittest.TestCase): def assert_to_primitives_tranformation(self, original, expected):...
#!/usr/bin/env python # -*- mode: python; encoding: utf-8 -*- """Tests for the Fingerprint flow.""" import os from grr_response_client.client_actions import file_fingerprint from grr.lib import flags from grr.lib.rdfvalues import paths as rdf_paths from grr.server import aff4 from grr.server import flow from grr.serv...
import sys import signal import syslog from twisted.python import usage from jasmin.managers.clients import SMPPClientManagerPB from jasmin.managers.configs import SMPPClientPBConfig from jasmin.queues.configs import AmqpConfig from jasmin.queues.factory import AmqpFactory from jasmin.protocols.http.configs import HTTP...
from aiohttp import web from services.data.postgres_async_db import AsyncPostgresDB from .utils import read_body, format_response, handle_exceptions import json class ArtificatsApi(object): _artifact_table = None def __init__(self, app): app.router.add_route( "GET", "/flows/{...
import sys def flatten(x): result = [] for el in x: if hasattr(el, "__iter__") and not isinstance(el, str) and not isinstance(el, tuple) and not isinstance(el, dict): result.extend(flatten(el)) else: result.append(el) return result def cfn(problem, isMinimization, i...
# encoding: utf-8 '''Helper functions Consists of functions to typically be used within templates, but also available to Controllers. This module is available to templates as 'h'. ''' import email.utils import datetime import logging import re import os import pytz import tzlocal import urllib import pprint import co...
import pyaf.Bench.TS_datasets as tsds import tests.artificial.process_artificial_dataset as art art.process_dataset(N = 32 , FREQ = 'D', seed = 0, trendtype = "MovingAverage", cycle_length = 30, transform = "BoxCox", sigma = 0.0, exog_count = 0, ar_order = 0);
#!/usr/bin/env python # -------------------------------------------------------------------- from mpi4pyve import MPI try: from signal import signal, SIGPIPE, SIG_IGN signal(SIGPIPE, SIG_IGN) except ImportError: pass # -------------------------------------------------------------------- try: from d...
# Decompiled by HTR-TECH | TAHMID RAYAT # Github : https://github.com/htr-tech #--------------------------------------- # Source File : Bot.py # Time : Sat Aug 22 08:00:16 2020 #--------------------------------------- # uncompyle6 version 3.7.3 # Python bytecode 2.7 # Decompiled from: Python 2.7.16 (default, Oct 10 20...
# -*- coding: UTF-8 -*- import setuptools from distutils.core import setup # http://stackoverflow.com/a/7071358/735926 import re VERSIONFILE='wikimd/__init__.py' verstrline = open(VERSIONFILE, 'rt').read() VSRE = r'^__version__\s+=\s+[\'"]([^\'"]+)[\'"]' mo = re.search(VSRE, verstrline, re.M) if mo: verstr = mo.g...
from elasticsearch import Elasticsearch import json import re from utils.constant import WIKIPEDIA_INDEX_NAME es = Elasticsearch(timeout=300) core_title_matcher = re.compile('([^()]+[^\s()])(?:\s*\(.+\))?') core_title_filter = lambda x: core_title_matcher.match(x).group(1) if core_title_matcher.match(x) else x def ...
import os import typing import unittest from threading import Event from unittest.mock import Mock, call, patch import pytest import requests_mock from Crypto.Cipher import AES from Crypto.Util.Padding import pad from streamlink.session import Streamlink from streamlink.stream import hls from tests.mixins.stream_hls ...
# Copyright 2013 IBM Corp. # 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...
from django.shortcuts import render def index(request): return render(request, 'index.html') def demo(request): return render(request, 'demo.html') def result(request): import reactionroute import logging import os import re def parseActiveList(activeList): result = [] if...
from django.db import models from apps.grupo.models import Grupo from apps.cliente.models import Cliente # Create your models here. class Miembro(models.Model): grupo_id = models.ForeignKey(Grupo, on_delete=models.SET_NULL, related_name='miembros', null=True) cliente_id = models.ForeignKey(Cliente, on_delete...
# Copyright (c) 2011 Tencent Inc. # All rights reserved. # # Author: Michaelpeng <michaelpeng@tencent.com> # Date: January 09, 2012 """ This is the configuration parse module which parses the BLADE_ROOT as a configuration file. """ import os import sys import console import build_attributes from blade_util impo...
#!/usr/bin/env python # random-words.py # Generate n number of lists containing m number of words from a list. import os import string import random import json filename = 'ogdens-basic-english-words.json' lines = json.loads(open(filename).read()) random.seed = (os.urandom(1024)) for i in range(1, 10): words = ...
import unittest from .. import PrefJSONRemote, PrefService, PrefRemote import os from datetime import datetime class TestPrefService(unittest.TestCase): remote = PrefJSONRemote() pref_service = PrefService(remote) def test_get_apiKey(self): api_Key = self.pref_service.get_preferences("cooking") ...
#!/usr/bin/env python # -*- coding:Utf-8 -*- """Provides the Farm class for the ants module. The Farm object runs its own thread and continuously create ants according to initial parameters. """ import config import uuid import threading import multiprocessing import time import logging import ant import utils __au...
from otree.api import * doc = """ Select a random round for payment """ class C(BaseConstants): NAME_IN_URL = 'pay_random_round' PLAYERS_PER_GROUP = None NUM_ROUNDS = 4 ENDOWMENT = cu(100) class Subsession(BaseSubsession): pass class Group(BaseGroup): pass class Player(BasePlayer): ...
import pytest from selen.client.driver import Driver, DriverInstance from selen.client.helper import Tools @pytest.hookimpl(hookwrapper=True, tryfirst=True) def pytest_runtest_makereport(item): outcome = yield rep = outcome.get_result() setattr(item, "rep_" + rep.when, rep) return rep @pytest.fixtur...