text
stringlengths
2
999k
# Copyright 2014 The Emscripten Authors. All rights reserved. # Emscripten is available under two separate licenses, the MIT license and the # University of Illinois/NCSA Open Source License. Both these licenses can be # found in the LICENSE file. from .toolchain_profiler import ToolchainProfiler import glob import...
#!/usr/bin/env python3 import bottle import csv import datetime import json import os import requests import threading BASE_JSON_URL = "https://new.dineoncampus.com/v1/location/menu.json?platform=0"; JSON_TIMEOUT = 15 LOCATIONS = { "Stwest": { "location_id": "586d05e4ee596f6e6c04b528", "site_id": ...
import unittest import os from parsons import CivisClient, Table # from . import scratch_creds @unittest.skipIf(not os.environ.get('LIVE_TEST'), 'Skipping because not running live test') class TestCivisClient(unittest.TestCase): def setUp(self): self.civis = CivisClient() # Create a schema, cr...
from flask import Blueprint, jsonify, request from flask_login import login_required from app.models import db, Comment, CommentTaggedUser import json comment_routes = Blueprint('comments', __name__) @comment_routes.route('/') @login_required def allComments(): # query to grab all comments comments = Commen...
# Module providing the `Pool` class for managing a process pool # # multiprocessing/pool.py # # Copyright (c) 2006-2008, R Oudkerk # Licensed to PSF under a Contributor Agreement. # # Modifications Copyright (c) 2020 Cloudlab URV # # # Imports # import queue import itertools import logging from lithops import Functi...
# Copyright 2021 The Feast 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in wr...
# Generated by Django 2.2.10 on 2020-09-10 19:25 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('core', '0001_initial'), ] operations = [ migrations.AddField( model_name='servicepage', name='icon_classes', ...
# Authors: Krzysztof Rusek <krusek@agh.edu.pl> # Jakub Nawała <jnawala@agh.edu.pl> import numpy as np import probability_grid_estimation as pge def prob(psi, sigma, cdf=False): """ :param psi: QNormal parameter, vector :param sigma: QNormal parameter, vector :param cdf: If true return pdf...
import collections import json import os import threading import time import urllib.request from urllib.parse import urlencode from bs4 import BeautifulSoup import SpiderEngine # CACHE_FILE_NAME = 'cache.json' # cache = { # 'current_page': 0, # 'nodes': {}, # 'task': [] # } status = { } url = 'https://ww...
# -*- coding: utf-8 -*- from pyqtgraph.Qt import QtCore, QtGui __all__ = ['FeedbackButton'] class FeedbackButton(QtGui.QPushButton): """ QPushButton which flashes success/failure indication for slow or asynchronous procedures. """ ### For thread-safetyness sigCallSuccess = QtCore.Signal(...
"""Constants. """ import sys # Defines where data should be downloaded and loaded DATA_FOLDER = 'data/' # A constant value used to avoid division by zero, zero logarithms # and any possible mathematical error EPSILON = 1e-32 # When the agents are initialized, their fitness is defined as # the maximum float value po...
# coding: utf-8 """ LUSID API FINBOURNE Technology # noqa: E501 The version of the OpenAPI document: 0.11.3648 Contact: info@finbourne.com Generated by: https://openapi-generator.tech """ try: from inspect import getfullargspec except ImportError: from inspect import getargspec as getf...
import logging import re from django.conf import settings from django.contrib.sessions.middleware import SessionMiddleware from django.core.exceptions import PermissionDenied from django.http.response import HttpResponse from django.utils.translation import ugettext as _ from oscar.core.loading import get_class from...
from django.http import HttpResponseRedirect from django.shortcuts import render from django.urls import reverse from contact_form.forms import ContactForm def index(request): return render(request, 'index.html') def contact(request): if request.method == 'POST': form = ContactForm(request.POST) ...
# Copyright 2020 - 2021 MONAI Consortium # 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...
from nodeutils import * from cgutils import * from pointerutils import * from callgraph import * from utils import * # func takes lock around a call to targ def takes_lock_for(func, targ): locks = nc([]) unlocks = nc([]) calls = nc([]) for c in get_all_descendants(func).spelled("_rw_enter_write"): if get_...
# Copyright (c) 2021 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 appli...
from pysimm.apps import mc_md from pysimm import system frame = system.read_lammps('irmof1_drei.lmps') gas1 = system.read_lammps('ch4.lmps') mc_props = {'rigid_type': False, 'max_ins': 1000, 'Chemical_Potential_Info': -30.09, 'Temperature_Info': 300, 'Run_Type': {'steps...
# -*- coding: utf-8 -*- from OCP.Graphic3d import Graphic3d_Camera, Graphic3d_StereoMode from PyQt5.QtWidgets import (QWidget, QPushButton, QDialog, QTreeWidget, QTreeWidgetItem, QVBoxLayout, QFileDialog, QHBoxLayout, QFrame, QLabel, QApplication, ...
import os import bottle import bottle_session try: import urlparse except: from urllib import parse as urlparse import random import redis import string import logging logger = logging.getLogger() handler = logging.StreamHandler() formatter = logging.Formatter( '%(asctime)s %(name)-12s %(levelname)-8s ...
# Copyright 2019 DeepMind Technologies Ltd. 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 appl...
# 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...
import sys import os from subprocess import call from . import core import itertools if sys.version_info >= (3, 0): from xmlrpc.client import Server def make_pypi_client(url): return Server(url) else: from xmlrpclib import Transport # @UnresolvedImport from xmlrpclib import ServerProxy i...
#!/usr/bin/env python3 import base64 import difflib import http.client import json import logging import os import shutil log = logging.getLogger(__name__) logging.basicConfig(level=logging.DEBUG, format="%(message)s") # By default, publish GA releases at 0, 100, 200, 300, ... to allow hotfixes within releases. ga_i...
from django.http import HttpResponseRedirect, HttpResponse from django.shortcuts import get_object_or_404, render from django.core.urlresolvers import reverse from .models import Choice, Question def search_form(request): return render(request, 'search_form.html') def search(request): request.encoding = 'utf-8' m...
# Attention interviewers!!! - this code is indicative of how I like to write. Not better, not worse. # Judge me based off of this # Thanks, Derek Gloudemans 2021 import torch import numpy as np import cv2 import sys, os import csv def line_to_point(line,point): """ Given a line defined by two points, finds th...
#!/usr/bin/env python ########################## # liveping.py - Displays a live graph with ping stats # By makzk, 2015 - https://github.com/makzk/liveping # Licensed under MIT license, available here: # https://github.com/makzk/liveping/blob/master/LICENSE ########################## import sys, time, threading, socke...
#----------------------------------------------------------------------------- # Copyright (c) 2012 - 2017, Anaconda, Inc. All rights reserved. # # Powered by the Bokeh Development Team. # # The full license is in the file LICENSE.txt, distributed with this software. #---------------------------------------------------...
import base64 import pathlib import sys import threading def read(path: pathlib.Path, stdout_lock: threading.Lock): with path.open(mode='rb') as file, stdout_lock: sys.stdout.write( f'{{"contents":"{base64.b64encode(file.read()).decode("utf-8")}"}}\n', ) sys.stdout.flush()
from .adjoint import ( AbstractAdjoint, BacksolveAdjoint, NoAdjoint, RecursiveCheckpointAdjoint, ) from .brownian import AbstractBrownianPath, UnsafeBrownianPath, VirtualBrownianTree from .global_interpolation import ( AbstractGlobalInterpolation, backward_hermite_coefficients, CubicInterpol...
"""Support for NWS weather service.""" from datetime import timedelta import logging from homeassistant.components.weather import ( ATTR_FORECAST_CONDITION, ATTR_FORECAST_TEMP, ATTR_FORECAST_TIME, ATTR_FORECAST_WIND_BEARING, ATTR_FORECAST_WIND_SPEED, WeatherEntity, ) from homeassistant.const im...
import torch import torch.nn as nn import torch.nn.functional as F from torch.autograd import Variable from layers import * from data import voc, coco import os class SSD(nn.Module): """Single Shot Multibox Architecture The network is composed of a base VGG network followed by the added multibox conv laye...
from common import MyHelpFormatter from config import activeConfig def argument(*name_or_flags, **kwargs): """Convenience function to properly format arguments to pass to the subcommand decorator. """ return [*name_or_flags], kwargs def subcommand(parent, subHelp="", epilog="", reqArgs=None, optArgs...
from prompt_toolkit import Application from prompt_toolkit.layout import Dimension, WindowAlign from prompt_toolkit.widgets import HorizontalLine, VerticalLine, MenuContainer, MenuItem from prompt_toolkit.layout.containers import Window, HSplit, VSplit from prompt_toolkit.layout.controls import FormattedTextControl fro...
# Engines for forcefield typing
# coding: utf-8 """ FlashBlade REST API A lightweight client for FlashBlade REST API 2.1, developed by Pure Storage, Inc. (http://www.purestorage.com/). OpenAPI spec version: 2.1 Generated by: https://github.com/swagger-api/swagger-codegen.git """ import pprint import re import six import typ...
import numpy as np from sklearn import datasets, linear_model import matplotlib.pyplot as plt class Config: nn_input_dim = 2 # input layer dimensionality nn_output_dim = 2 # output layer dimensionality # Gradient descent parameters (I picked these by hand) epsilon = 0.01 # learning rate for gradien...
""" InceptionResNetV1 for ImageNet-1K, implemented in TensorFlow. Original paper: 'Inception-v4, Inception-ResNet and the Impact of Residual Connections on Learning,' https://arxiv.org/abs/1602.07261. """ __all__ = ['InceptionResNetV1', 'inceptionresnetv1', 'InceptionAUnit', 'InceptionBUnit', 'InceptionCUn...
# Repo Watcher automatically pulls updates from the Repo. It'll cause all containers to reload. # Repo Watcher is only updated on reboot. import os import asyncio import RPi.GPIO as GPIO GPIO.setmode(GPIO.BCM) GPIO.setwarnings(False) GPIO.setup(24,GPIO.OUT) async def watcher(GLOBAL_ASYNC_STATE): while GLOBAL_ASY...
from selenium import webdriver from selenium.webdriver.support.ui import Select from django.contrib.staticfiles.testing import StaticLiveServerTestCase from django.core.urlresolvers import reverse CHROMEDRIVER_PATH = '/usr/bin/chromedriver' class BaseTestCase(StaticLiveServerTestCase): fixtures = ['base.json']...
from data import * from utils.augmentations import SSDAugmentation from layers.modules import MultiBoxLoss from ssd import build_ssd import os import sys import time import torch from torch.autograd import Variable import torch.nn as nn import torch.optim as optim import torch.backends.cudnn as cudnn import torch.nn.in...
# 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 from .tables import Table, TableBase from .columns import (BooleanColumn, Column, CheckBoxColumn, DateColumn, DateTimeColumn, EmailColumn, FileColumn, JSONColumn, LinkColumn, ManyToManyColumn, RelatedLinkColumn, TemplateColumn, TimeColumn...
# -*- coding: utf-8 -*- """ Methods to read in and process features from coordinates. """ from .pyemma_features import * from .mda_distances import * from .processing import * from .atom_features import * from .water_features import * from .txt_features import * from .csv_features import *
# modified from https://github.com/learningtitans/isbi2017-part1/blob/master/metrics.py import numpy as np from sklearn.metrics import jaccard_similarity_score smooth_default = 1. def dice_coef(y_true, y_pred, smooth=smooth_default): y_true_f = y_true.flatten() y_pred_f = y_pred.flatten() tp = np.sum(...
# Copyright 2021 QuantumBlack Visual Analytics 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 # # THE SOFTWARE IS PROVIDED "AS IS",...
import datetime def parse_ymd(date): ''' Convert string to `datetime.datetime` object. Args: date: string contains year, month, day, split by `-` Returns: `datetime.datetime` object ''' return datetime.datetime(*map(int, date.split('-'))) def next_date(date): '''Get next...
import os from os import listdir from underthesea.file_utils import DATASETS_FOLDER from typing import List from flair.data import Sentence, Token from flair.models import SequenceTagger WS_FOLDER = f'{DATASETS_FOLDER}/VLSP2020-DP-V1A2/Output/System2.1' POS_FOLDER = f'{DATASETS_FOLDER}/VLSP2020-DP-V1A2/Output/System2....
#!/usr/bin/env python # -*- coding: utf-8 -*- import web from bson.objectid import ObjectId from config import setting import helper, jpush db = setting.db_web url = ('/delivery/order_view') class handler: def GET(self): if helper.logged(helper.PRIV_DELIVERY,'DELVERY_ORDER'): render = helper.create_render(glo...
from setuptools import find_packages, setup setup( name='src', packages=find_packages(), version='0.1.0', description='A short description of the project.', author='jolfr', license='MIT', )
import importlib from importlib.util import module_from_spec, spec_from_file_location import os from stp_core.common.log import Logger, getlogger from stp_core.types import HA from stp_core.loop.looper import Looper from indy_common.config_helper import NodeConfigHelper from indy_node.server.node import Node def in...
import hashlib import hmac import json import random import string import urllib from . import config class InstagramIdCodec: ENCODING_CHARS = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_" @staticmethod def encode(num, alphabet=ENCODING_CHARS): """Covert a numeric value to a...
_base_ = [ '../common/mstrain-poly_3x_coco_instance.py', '../_base_/models/mask_rcnn_r50_fpn.py' ] model = dict( backbone=dict( _delete_=True, type='RegNet', arch='regnetx_4.0gf', out_indices=(0, 1, 2, 3), frozen_stages=1, norm_cfg=dict(type='BN', requires_gr...
"""Generated class for metadata_testing.json""" from .metadata_testing_target import TargetTestingMetadata class TestingMetadata: """Generated schema class""" def __init__(self): self.targets = None @staticmethod def from_dict(source): if not source: return None result = TestingMetadata() ...
from io import StringIO from dataactvalidator.scripts.read_zips import update_state_congr_table_census from dataactcore.models.domainModels import StateCongressional def test_parse_census_district_file(database): census_file_mock = StringIO("""state_code,congressional_district_no,census_year\nA,1,20""") sess...
import sqlite3 import logging DATABASE = '/Users/wcampbell/Library/Application Support/Skype/willcampbell_ha/main.db' unique_participants_sql = 'SELECT DISTINCT(participants) FROM Chats' messages_by_author_sql = 'SELECT from_dispname, body_xml FROM Messages where dialog_partner = ?' def most_common(t): word_coun...
""" Spadille is the nickname for the Ace of Spades in some games (see `Webster 1913`_) >>> beer_card = Card('7', Suite.diamonds) >>> beer_card Card('7', Suite.diamonds) >>> spadille = Card('A', Suite.spades, long_rank='Ace') >>> spadille Card('A', Suite.spades) >>> print(spadille) Ace ...
''' Clipboard Dbus: an implementation of the Clipboard using dbus and klipper. ''' __all__ = ('ClipboardDbusKlipper', ) from kivy.utils import platform from kivy.core.clipboard import ClipboardBase if platform != 'linux': raise SystemError('unsupported platform for dbus kde clipboard') try: import dbus ...
from config import * from struct import pack class DES(): def __init__(self, key): if len(key) < 8: raise "Key lenght must be 64 bits" if len(key) > 8: key = key[:8] self.key = key self.keys = self.generate_16_keys() def generate_16_keys(self): ...
#!/usr/bin/env python # 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...
#!/usr/bin/env python import pandas as pd import numpy as np import sys, os from datetime import * import sqlite3 import cartopy from cartopy.geodesic import Geodesic from mpl_toolkits.basemap import * from matplotlib.path import Path def usa_filter(df): # convert storm lat lons to map proj coords lats, lons ...
from gym_nats.envs.nats_env import NatsEnv
# Copyright 2015 The Chromium OS Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Module used for run-time determination of toplogy information. By Toplogy, we mean a specification of which external server dependencies are located w...
import time from crownstone_core.util.Timestamp import reconstructTimestamp from crownstone_core.protocol.SwitchState import SwitchState from crownstone_core.util.BufferReader import BufferReader from crownstone_core.packets.serviceDataParsers.containers.AdvCrownstoneState import AdvCrownstoneState from...
#!/usr/bin/env python # standalone = True import os os.environ['MCVINE_MPI_BINDING'] = 'NONE' import mcni, shutil, numpy as np from mccomponents.sample import samplecomponent import unittest class TestCase(unittest.TestCase): def test1a(self): "intersection: two blocks" self._test('sampleasse...
# Copyright (c) Facebook, Inc. and its affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. from loguru import logger import os import numpy as np from fairseq import utils, utils_loguru from fairseq.data import ( ConcatSentences...
import unittest import numpy as np from pycompss.api.api import compss_wait_on import dislib as ds import dislib.trees.decision_tree as dt from dislib.trees import RfClassifierDataset, transform_to_rf_dataset class DecisionTreeTest(unittest.TestCase): def test_decision_tree(self): x1 = np.array( ...
# functions/add.py import torch from torch.autograd import Function from _ext import forward_utils if torch.cuda.is_available(): from _ext import forward_utils_cuda class OccupancyToTopology(Function): """ Convert the occupancy probability to topology probability see ../src/occupancy_to_topology.c ...
# Copyright 2015 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 applicable law or a...
"""Form-related classes for the administration Change Form pages.""" from __future__ import unicode_literals import itertools from django import forms from django.contrib.admin.helpers import Fieldline, Fieldset from django.contrib.admin.widgets import FilteredSelectMultiple from django.contrib.auth.models import Us...
""" PDBBind dataset loader. """ import logging import multiprocessing import os import re import time import deepchem import numpy as np import pandas as pd import tarfile from deepchem.feat import RdkitGridFeaturizer from deepchem.feat import ComplexNeighborListFragmentAtomicCoordinates from deepchem.feat.graph_featu...
# -*- coding: utf-8 -*- # ---------------------------------------------------------------------------- # Created By : Vítor Pereira # Created Date: 01-09-2021 # version ='0.0.1' # --------------------------------------------------------------------------- """Defines an interface for supervised learning models""" # ---...
# 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 # d...
import json import pytest import os import time from client_cli import Wallet, Transaction, run PASSPHRASE = "123456" CRO = 10**8 def delete_all_wallet(): wallet_names = Wallet.list() wallet_list = [Wallet(name, PASSPHRASE) for name in wallet_names] for wallet in wallet_list: wallet.delete() w...
# -*- coding: UTF-8 -*- """ Kodi urlresolver plugin Copyright (C) 2016 alifrezser This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at ...
# Generated by Django 3.0.8 on 2020-07-13 11:18 import cloudinary.models from django.conf import settings from django.db import migrations, models import django.db.models.deletion import tinymce.models class Migration(migrations.Migration): dependencies = [ migrations.swappable_dependency(settings.AUTH_...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- ''' cli.arguments: default arguments with the ability to override them ''' import re from datetime import timedelta from cli.utils.dictionary import merge from cli.config import CFG CALLS_STYLE = [ 'simple', 'detail', ] DETAIL = [ 'summary', 'detailed' ...
from enum import Enum token = '1204975875:AAEMu946PZhuCbAY-MZP34UPtzsbZTE2qKQ' db_file = 'database.vdb' class States(Enum): S_START = "0" S_ENTER_DAY = "1" S_COUNTRY_OR_REGION = "2" S_ENTER_COUNTRY_OR_REGION = "3" S_ENTER_FIELD_LIST = "4"
from .wikidata import *
#O mesmo professor do desafio 019 quer sortear a ordem de apresentação de #trabalhos dos alunos.Faça um programa que leia o nome dos quatro alunos e #mostre a ordem sorteada. import random lista = [] for x in range(4): lista.append(str(input("Insira o nome dos aluno: "))) random.shuffle(lista) print("A ...
# # Copyright (c) 2018 Stefan Seefeld # All rights reserved. # # This file is part of Faber. It is made available under the # Boost Software License, Version 1.0. # (Consult LICENSE or http://www.boost.org/LICENSE_1_0.txt) from ..action import action from ..feature import set from ..tool import tool from .xslt import ...
"""Delete all unpinned posts""" from discord import Client import os client = Client() TOKEN = os.getenv("DISCORD_TOKEN") CHANNEL_IDS = [ 764408838626607115, ] @client.event async def on_ready(): print(f"logged in as {client.user}") for channel_id in CHANNEL_IDS: channel = client.get_channel(chan...
# SPDX-License-Identifier: Apache-2.0 # # The OpenSearch Contributors require contributions made to # this file be licensed under the Apache-2.0 license or a # compatible open source license. # Modifications Copyright OpenSearch Contributors. See # GitHub history for details. # Licensed to Elasticsearch B.V. under one ...
#!/usr/bin/env python # -*- mode: python; encoding: utf-8 -*- """Test client vfs.""" import os import stat import psutil # pylint: disable=unused-import,g-bad-import-order from grr.client import client_plugins # pylint: enable=unused-import,g-bad-import-order import logging from grr.client import vfs from grr.cl...
from typing import List import hashlib from assemblyline import odm from assemblyline.common import forge Classification = forge.get_classification() SUBMISSION_STATES = ['failed', 'submitted', 'completed'] DEFAULT_SRV_SEL = ["Filtering", "Antivirus", "Static Analysis", "Extraction", "Networking"] DEFAULT_RESUBMIT = [...
#Copyright ReportLab Europe Ltd. 2000-2004 #see license.txt for license details #history http://www.reportlab.co.uk/cgi-bin/viewcvs.cgi/public/reportlab/trunk/reportlab/lib/styles.py __version__=''' $Id: styles.py 3767 2010-09-07 10:35:23Z rgbecker $ ''' __doc__='''Classes for ParagraphStyle and similar things. ...
"""newsite URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/2.2/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-based...
import FWCore.ParameterSet.Config as cms import FWCore.ParameterSet.VarParsing as VarParsing process = cms.Process("MCvertices") #prepare options options = VarParsing.VarParsing("analysis") options.register ('globalTag', "DONOTEXIST", VarParsing.VarParsing.multiplicity.singleton,...
# Add import from parent directory possible import matplotlib.pyplot as plt from helpers.DataOperations import FindIntersections, CreateSubsetByValues from core.indicator import indicator # Creates object def CreateBollinger(prices, n=20, k=2): return Bollinger(prices, n, k) # Bollinger object which creates Bol...
# -*- coding: utf-8 -*- """ Created on Fri Feb 1 07:45:15 2019 @author: PAULA """ import numpy as np import pandas as pd ########################## # Funciones de selección # ########################## print('##########################') print('# Funciones de selección #') print('##########################') ...
{ "targets": [ { "target_name": "binding", "sources": [ "src/binding.cc" ] } ] }
""" This module contains classes that represent the following database objects - * :class:`~db.objects.DbObject` - this represents a single database row * :class:`~db.objects.MemObject` - a subclass of DbObject that exists only in memory """ from json import loads, dumps import operator from lxml.etree import fromstr...
# -*- coding: utf-8-*- import re import random import os,sys,inspect currentdir = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe()))) parentdir = os.path.dirname(currentdir) sys.path.append(parentdir) import utils import re WORDS = ["affirmatives"] PRIORITY = 0 def handle(text): content = uti...
#!/usr/bin/env python #coding=utf-8 """ main.py: When creating a Python module, it is common to make the module execute some functionality (usually contained in a main function) when run as the entry point of the program. """ __author__ = "Francisco Maria Calisto" __maintainer__ = "Fr...
from afqa_toolbox.features import block_properties import numpy as np import cv2 def gabor_filter(theta, freq, sigma, shen=False): """Produces a Gabor filter based on the provided parameters :param theta: The angle of the filter :param freq: The frequency of the filter :param sigma: The standard devi...
import os from flaskapp import create_app, mongodb app = create_app(os.getenv("FLASK_CONFIG") or "default") @app.shell_context_processor def make_shell_context(): return dict(mongodb=mongodb)
#!/usr/bin/env python3 # Copyright (c) 2021 CINN 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 r...
from mongoengine import Document from mongoengine.fields import StringField, UUIDField, BooleanField class PostDocument(Document): id = UUIDField(binary=False, primary_key=True) title = StringField(max_length=512, required=True) body = StringField(max_length=1024, required=True) published = BooleanFie...
import os from setuptools import setup README = open(os.path.join(os.path.dirname(__file__), 'README.rst')).read() # allow setup.py to be run from any path os.chdir(os.path.normpath(os.path.join(os.path.abspath(__file__), os.pardir))) setup( name='transity-statuspageio', version='0.0.2', description='St...
#!/usr/bin/python3 # # Created: 2019-06-04 16:00:00 # Main author: # - Marc Dorval <marc.dorval@silabs.com> # # Standard library imports import logging import os import sys import time logging.basicConfig(level=logging.INFO) class AbstractConnection(object): link = None connection = None nickname = ...