src
stringlengths
721
1.04M
# -*- coding: utf-8 -*- # # Django PostcodeLookup documentation build configuration file, created by # sphinx-quickstart on Wed Aug 10 17:06:14 2016. # # This file is execfile()d with the current directory set to its # containing dir. # # Note that not all possible configuration values are present in this # autogenerat...
# 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...
# 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 ...
"Test codecontext, coverage 100%" from idlelib import codecontext import unittest import unittest.mock from test.support import requires from tkinter import NSEW, Tk, Frame, Text, TclError from unittest import mock import re from idlelib import config usercfg = codecontext.idleConf.userCfg testcfg = { 'main': c...
from numpy import dot from neupy.utils import format_data from neupy.exceptions import NotTrained from neupy.core.properties import BoundedProperty from neupy.algorithms.base import BaseSkeleton from .utils import pdf_between_data __all__ = ('GRNN',) class GRNN(BaseSkeleton): """ Generalized Regression Neu...
# Copyright (C) 2007, Eduardo Silva <edsiper@gmail.com> # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2 of the License, or (at your option) any later version. # # Thi...
#!/usr/bin/env python # # qexec.py -- Subaru Telescope Queue Execution Tool # """ Usage: qexec.py --help qexec.py [options] """ import sys, os from ginga.misc.Bunch import Bunch from qplan import main, version defaultServiceName = 'qexecute' plugins = [ Bunch(name='slewchart', module='SlewChart', klass=...
from gopay.enums import PaymentInstrument, BankSwiftCode, Currency, Language class Utils: GO_ID = '8712700986' CLIENT_ID = '1689337452' CLIENT_SECRET = 'CKr7FyEE' CLIENT_ID_EET = "1365575992" CLIENT_SECRET_EET = "NUVsrv4W" GO_ID_EET = '8289213768' @staticmethod def create_base_payme...
# Copyright (C) 2003-2007 Robey Pointer <robeypointer@gmail.com> # # This file is part of paramiko. # # Paramiko is free software; you can redistribute it and/or modify it under the # terms of the GNU Lesser General Public License as published by the Free # Software Foundation; either version 2.1 of the License, or (a...
#! /usr/bin/env python3 """Software library containing common bioinformatic functions Copyright: __init__.py software library containing common bioinformatic functions Copyright (C) 2015 William Brazelton, Alex Hyer This program is free software: you can redistribute it and/or modify it under the t...
#-*- coding: UTF-8 -*- from ctypes import POINTER, c_int, c_uint, c_char, c_float, Structure, c_char_p, c_double, c_ubyte class Matrix3x3(Structure): """ See 'aiMatrix3x3.h' for details. """ _fields_ = [ ("a1", c_float),("a2", c_float),("a3", c_float), ("b1", c_float),("b2"...
#!/usr/bin/env python # vim: ts=4 sw=4 et import logging import random import string import unittest import openstack_sg_provisioner.tasks as tasks RANDOM_LEN = 3 # cosmo_test_nova_XXX_something PORT = 65000 CIDR = '1.2.3.0/24' class OpenstackSGProvisionerTestCase(unittest.TestCase): def setUp(self): ...
# Copyright 2011 OpenStack Foundation. # All Rights Reserved. # Copyright 2013 Red Hat, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licens...
#!/usr/bin/env python # -*- coding: utf-8 -*- from urllib import quote, urlencode import urllib2 import time import uuid import hmac, hashlib from config import consumer_key, client_secret def get_token(): URL = 'http://fanfou.com/oauth/request_token' params = [ ('oauth_consumer_key', consumer_key), ...
#-*- coding:utf-8 -*- ############################################################################## # # Copyright (C) 2015 One Click Software (http://oneclick.solutions) # and Copyright (C) 2013 Michael Telahun Makonnen <mmakonnen@gmail.com>. # # This program is free software: you can redistribute it and/or m...
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. from odoo import models, fields, api, SUPERUSER_ID class test_model(models.Model): _name = 'test_converter.test_model' _description = 'Test Converter Model' char = fields.Char() integer = fields.Integer...
# coding=utf-8 import time import copy from mycodo.inputs.base_input import AbstractInput # Measurements measurements_dict = { 0: { 'measurement': 'revolutions', 'unit': 'rpm' } } # Input information INPUT_INFORMATION = { 'input_name_unique': 'SIGNAL_RPM', 'input_manufacturer': 'Rasp...
""" This file is part of HexACO. HexACO 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 your option) any later version. HexACO is distributed in t...
from PIL import ImageEnhance, ImageOps from .pillow_utils import image_to_pil, pil_to_cv_array """ These functions are not suitable for use on images to be grounded and then trained, as the file on disk is not actually modified. These functions are only to be used on ImageFile objects that are meant to be performed OC...
# Copyright 2018 Red Hat, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed ...
import unittest from etlt.helper.Allen import Allen class AllenTest(unittest.TestCase): """ Test cases for class Allen algebra. """ # ------------------------------------------------------------------------------------------------------------------ def _test1(self, expected, x, y): relat...
#!/usr/bin/env python2 """ Copyright (c) 2012 Alexander Abbott This file is part of the Cheshire Cyber Defense Scoring Engine (henceforth referred to as Cheshire). Cheshire is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as publi...
import os from setuptools import setup # Utility function to read the README file. # Used for the long_description. It's nice, because now 1) we have a top level # README file and 2) it's easier to type in the README file than to put a raw # string in below ... def read(fname): return open(os.path.join(os.path.di...
# Copyright (c) 2012-2021, Mark Peek <mark@peek.org> # All rights reserved. # # See LICENSE file for full license. from .aws import Action as BaseAction from .aws import BaseARN service_name = "Amazon S3" prefix = "s3" class Action(BaseAction): def __init__(self, action: str = None) -> None: super().__i...
# -*- coding: utf-8 -*- import sys from os.path import join, dirname from setuptools import setup, find_packages VERSION = (1, 1, 0) __version__ = VERSION __versionstr__ = '.'.join(map(str, VERSION)) long_description = 'Should have been loaded from README.md.' with open(join(dirname(__file__), 'README.md')) as f: ...
"""Tests for jobs API endpoints.""" import os import requests import uuid from behave import given, then, when from src.attribute_checks import check_timestamp, check_job_token_attributes from src.parsing import parse_token_clause from src.authorization_tokens import jobs_api_authorization @given('Jobs debug API is...
#!/usr/bin/python import datetime import email.utils import os import glob import pytz import re import subprocess import sys import tempfile DRY_RUN = False if os.environ.get('DRY_RUN', ''): DRY_RUN = True def handle_one(tar_filename): # We're already in a tmpdir, yay. But there might be other # people...
(S'cd1fa3a91cdd47fc48d66dea479da68c' p1 (ihappydoclib.parseinfo.moduleinfo ModuleInfo p2 (dp3 S'_namespaces' p4 ((dp5 (dp6 S'_traverse' p7 (ihappydoclib.parseinfo.functioninfo FunctionInfo p8 (dp9 g4 ((dp10 (dp11 tp12 sS'_exception_info' p13 (dp14 sS'_parameter_names' p15 (S'atom' p16 S'traverse' p17 S'prevAtom' p18 S'...
import numpy as np from sklearn.cluster import KMeans from sklearn import preprocessing import pandas as pd ''' Pclass Passenger Class (1 = 1st; 2 = 2nd; 3 = 3rd) survival Survival (0 = No; 1 = Yes) name Name sex Sex age Age sibsp Number of Siblings/Spouses Aboard parch Number of Parents/Children Aboard ticket Ticket ...
from dataclasses import dataclass from datetime import date, datetime, timedelta from operator import itemgetter from typing import Dict, List, Optional, Set, Tuple from pytz import timezone import libarchive.public import logging import ftplib import json import re import os from .const import DIR_DOWNLOAD, DIR_CONVE...
# This file was generated by decode.py. Do not edit! # For each instruction the information available is:' # re_parser, input_regs, output_regs, double_regs, long_latency, delayed, extra_phy_inputs, extra_phy_outputs' import re class insn_metadata(object): def __init__(self, info): self.inputs, self.outputs...
# coding=utf-8 """GUI utilities for the dock and the multi Exposure Tool.""" from PyQt4.QtCore import Qt from qgis.core import QgsMapLayerRegistry from safe.utilities.i18n import tr def layer_from_combo(combo): """Get the QgsMapLayer currently selected in a combo. Obtain QgsMapLayer id from the userrole o...
# -*- coding: utf-8 -*- # Copyright(C) 2010 Romain Bignon # # 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, version 3 of the License. # # This program is distributed in the hope that it will b...
from __future__ import absolute_import from __future__ import division from __future__ import print_function import os import time import numpy as np import pickle import tensorflow as tf from tensorflow.python import debug as tf_debug import ray from ray.rllib.common import Agent, TrainingResult from ray.rllib.ppo....
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. from openerp.osv import fields, osv class base_config_settings(osv.osv_memory): _name = 'base.config.settings' _inherit = 'res.config.settings' _columns = { 'group_multi_company': fields.boolean('M...
# -*- coding: utf-8 -*- from __future__ import absolute_import import mock from django.contrib.auth.models import User from django.core.urlresolvers import reverse from sentry.constants import MEMBER_OWNER, MEMBER_USER from sentry.models import Team from tests.base import TestCase class BaseTeamTest(TestCase): ...
# # NEPI, a framework to manage network experiments # Copyright (C) 2014 INRIA # # 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 your ...
import unittest from lbry.wallet.dewies import lbc_to_dewies as l2d, dewies_to_lbc as d2l class TestDeweyConversion(unittest.TestCase): def test_good_output(self): self.assertEqual(d2l(1), "0.00000001") self.assertEqual(d2l(10**7), "0.1") self.assertEqual(d2l(2*10**8), "2.0") sel...
import glob import os import subprocess from ccmlib import common from ccmlib.node import ToolError from dtest import Tester, debug from tools.decorators import since from tools.intervention import InterruptCompaction # These must match the stress schema names KeyspaceName = 'keyspace1' TableName = 'standard1' def...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """""" from tkinter import IntVar __title__ = "Time" __author__ = "DeflatedPickle" __version__ = "1.3.1" class Time(object): def __init__(self, hours: int = 0, minutes: int = 0, seconds: int = 0): self._hours = IntVar(value=hours) self._minutes = In...
import numpy as np #rotate vector def Rotvec(v, axis, angle): I = (axis, (axis+1)%3, (axis+2)%3) v_r = np.zeros(3) v_r[I[0]] = v[I[0]] v_r[I[1]] = v[I[1]]*np.cos(angle) - v[I[2]]*np.sin(angle) v_r[I[2]] = v[I[2]]*np.cos(angle) + v[I[1]]*np.sin(angle) return v_r #cross product def CrossP(v1, v2): v = np...
#!/usr/bin/python import glob import os import sys ## find the labels and identify the right columns; put in labeldic # vers = "0.3" # vers 0.3 updated to output in fortran formatted numbers print "**** reorder starfile for individual particle correction using LMBFGS v {0}".format(vers) ### ---- function: reorde...
"""Tensor term definition and utility.""" import abc import collections import functools import itertools import operator import types import typing import warnings from collections.abc import Iterable, Mapping, Callable, Sequence from sympy import ( sympify, Symbol, KroneckerDelta, Eq, solveset, S, Integer, Add,...
import random def sequentialy(qset): rset = [] for i in range(0, len(qset)): rset.append(qset[i]) return rset def randomly(_qset): qset = list(_qset) rset = [] while qset: sel = random.choice(qset) rset.append(sel) qset.remove(sel) return rset def fullBFS(qset): if l...
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('images', '0002_auto_20141201_0515'), ] operations = [ migrations.CreateModel( name='EXIFEntry', fiel...
import logging import ibmsecurity.utilities.tools logger = logging.getLogger(__name__) def get(isamAppliance, directory_name, check_mode=False, force=False): """ Retrieving the list of suffixes for a particular federated directory """ return isamAppliance.invoke_get("Retrieving the list of suffixes f...
## # Copyright (c) 2005-2015 Apple Inc. All rights reserved. # # 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, mod...
# Copyright 2008-2009 WebDriver committers # Copyright 2008-2009 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless requ...
# encoding: utf-8 import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding model 'BandExamResult' db.create_table('bandexams_bandexamresult', ( ('id...
""" ******************************************************* * * calc_integral - APPROXIMATE INTEGRAL OF POSTERIOR * * License: Apache 2.0 * Written by: Michael Slugocki * Created on: September 17, 2018 * Last updated: September 17, 2018 * ******************************************************* """ ######...
# -*- coding: utf-8 -*- import os from operator import itemgetter def closest(p, c, n): # выбираем из p и n, кто ближе к c try: ptup = p, teams[c] - teams[p] except KeyError: ptup = c, teams[c] try: ntup = n, teams[n] - teams[c] except KeyError: ntup = c, teams[c] ...
#!/usr/bin/env python # ---------------------------------------------------------------------- # Numenta Platform for Intelligent Computing (NuPIC) # Copyright (C) 2015, Numenta, Inc. Unless you have an agreement # with Numenta, Inc., for a separate license for this software code, the # following terms and conditions ...
#! /usr/bin/python3 # -*- coding: utf-8 -*- ''' Copyright 2016,王思远 <darknightghost.cn@gmail.com> 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, o...
#!/usr/bin/env python # # Electrum - lightweight Bitcoin client # Copyright (C) 2014 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...
#!/usr/bin/env python # -*- coding: utf-8 -*- import os import re import codecs from setuptools import setup directory_name = os.path.dirname(__file__) with codecs.open(os.path.join(directory_name, 'pytest_testbook', '__init__.py'), encoding='utf-8') as fd: VERSION = re.compile(r".*__version__ = '(.*?)'", re.S)....
import pytest import numpy as np from cplpy import run_test, prepare_config, parametrize_file import os import sys import subprocess try: from PyFoam.RunDictionary.ParsedParameterFile import ParsedParameterFile except: "Error: PyFoam package is required to run the tests" sys.exit() # -----Forces TESTS----...
""" High-level KVM test utility functions. This module is meant to reduce code size by performing common test procedures. Generally, code here should look like test code. More specifically: - Functions in this module should raise exceptions if things go wrong (unlike functions in kvm_utils.py and kvm_vm.py w...
# # Copyright (c) 2013 Juniper Networks, Inc. All rights reserved. # import os import gevent import logging import kazoo.client import kazoo.exceptions import kazoo.handlers.gevent import kazoo.recipe.election from kazoo.client import KazooState from kazoo.retry import KazooRetry from bitarray import bitarray from cfg...
from gi.repository import Gtk from file_list import FileList from gio_provider import TrashProvider from operation import DeleteOperation class TrashList(FileList): """Trash file list plugin Generic operations related to trash management are provided with this class. By extending FileList standard features such ...
# Copyright (c) 2014, Salesforce.com, Inc. All rights reserved. # Copyright (c) 2015, Google, Inc. # # 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 ...
__author__ = 'eblubin@mit.edu, nanaya@mit.edu' import math import numpy as np from random import choice from inspect import isfunction from matplotlib import pyplot as plt from UserDict import IterableUserDict import random import operator import heapq from progressbar import AnimatedProgressBar # This is used to hel...
# Copyright 2020 by Kurt Rathjen. All Rights Reserved. # # This library is free software: you can redistribute it and/or modify it # under the terms of the GNU Lesser General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. This ...
""" python API module for Cobbler see source for cobbler.py, or pydoc, for example usage. CLI apps and daemons should import api.py, and no other cobbler code. Copyright 2006-2009, Red Hat, Inc Michael DeHaan <mdehaan@redhat.com> This program is free software; you can redistribute it and/or modify it under the terms ...
# coding: utf-8 import html.entities as htmlentities import re class HtmlEntities: def __init__(self, my_string): self.my_string = my_string def html_entity_decode_char(self, m, defs=htmlentities.entitydefs): """ decode html entity into one of the html char """ tr...
import asyncio import numpy as np from sklearn import linear_model # For Kalman filtering from filterpy.kalman import KalmanFilter from filterpy.common import Q_discrete_white_noise from thingflow.base import OutputThing, InputThing, from_iterable, Scheduler class SGDLinearRegressionModel(OutputThing, InputThing): ...
from __future__ import absolute_import, division, print_function, unicode_literals import os import glob import shutil import unittest import AdaptivePELE.adaptiveSampling as adaptiveSampling class TestMD(unittest.TestCase): def check_succesful_simulation(self, output, epochs, nTrajs): for epoch in range...
"""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 applicable law or agreed to in ...
""" # Copyright (C) 2007 Nathan Ramella (nar@remix.net) # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version....
# -*- coding: utf-8 -*- #! \file ./tests/test_text/test_fmt/test_format.py #! \author Jiří Kučera, <sanczes@gmail.com> #! \stamp 2016-08-11 15:55:31 (UTC+01:00, DST+01:00) #! \project DoIt!: Tools and Libraries for Building DSLs #! \license MIT #! \version 0...
# Standard library imports. from itertools import combinations import logging # System library imports. from pyface.qt import QtCore, QtGui # Enthought library imports. from traits.api import Any, HasTraits # Local imports. from dock_pane import AREA_MAP from pyface.tasks.task_layout import LayoutContainer, PaneItem...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import lib.PyratApi as api import lib.travelHeuristics as th import lib.utils as ut import time import operator BOT_NAME = "greedy" PATH = [] METAGRAPH = {} BESTPATH = {} MOVING = False EATENCOINS = [] NB_COINS_TO_COMPUTE = 5 CURRENTCOIN = [] # This function should no...
"""Ipython parallel ready entry points for parallel execution """ import contextlib try: from ipyparallel import require except ImportError: from IPython.parallel import require from bcbio import heterogeneity, hla, chipseq, structural, upload from bcbio.bam import callable from bcbio.rnaseq import sailfish f...
# coding: utf-8 from __future__ import unicode_literals, absolute_import import json from boxsdk.util.text_enum import TextEnum from .base_object import BaseObject from ..pagination.limit_offset_based_object_collection import LimitOffsetBasedObjectCollection from ..util.api_call_decorator import api_call from ..util....
#!/usr/bin/python # # Copyright 2018-2021 Polyaxon, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable ...
# -*- coding: utf-8 -*- ''' Checksum ======== Provides an extendable checksum calculation and validation library for different checksum algorithms. ''' class ChecksumStrategy(object): ''' An interface class for checksum algorithm classes. ''' def checksum(self, body): ''' Calculates a check...
""" Scheme tests """ from AnyQt.QtCore import QObject, QEventLoop, QTimer, QCoreApplication, QEvent from typing import List class EventSpy(QObject): """ A testing utility class (similar to QSignalSpy) to record events delivered to a QObject instance. Note ---- Only event types can be recorded...
# -*- coding: utf-8 -*- import re from .helpers import clean_list, list_hash __author__ = 'vahid' class Stanza(object): _type = None _filename = None _headers = None def __init__(self, filename, *headers): self._filename = filename self._headers = list(headers) def __repr__(sel...
from pprint import pprint from django.db.models import Exists, OuterRef from django.http import JsonResponse from fo2.connections import db_cursor_so from systextil.queries.deposito.total_modelo import totais_modelos_depositos import comercial.models def estoque_depositos_modelo(request, modelo, filtra=''): c...
import re class hQCommand( object ): """! @brief Command """ def __init__( self, name, regExp, arguments = [], permission = None, fct = None, help = "", fullhelp = "" ): self.n...
#TODO: allow missing params and args lists to pass tests from src import logging class dict_mgm: #creates ansible command to run def make_play(data,db_data,location): if dict_mgm.data_check(data, db_data) == 'OK': command = 'ansible-playbook {location}'.format(location=location) #did and incredi bad if else t...
""" Inherited fields for all XBlocks. """ from __future__ import absolute_import from datetime import datetime from django.conf import settings from pytz import utc from xblock.fields import Scope, Boolean, String, Float, XBlockMixin, Dict, Integer, List from platform_core.lib.partitions.partitions import UserPartiti...
#!/usr/bin/env python """ One of the most controversial issues in the US educational system is the efficacy of standardized tests, and whether they are unfair to certain groups. Given our prior knowledge about this topic, investigating the correlations between SAT scores and demographic factors might be an interesting ...
""" Django settings for transcroobie project. Generated by 'django-admin startproject' using Django 1.10.1. For more information on this file, see https://docs.djangoproject.com/en/1.10/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.10/ref/settings/ """ impo...
""" General operation library Contains the master class for all operations """ import os import logging import socket import subprocess import numpy as np import sys import uuid from factor import _logging from jinja2 import Environment, FileSystemLoader from lofarpipe.support.utilities import create_directory DIR = ...
""" Force10 Backend. This backend will only work with SSH version 2 capable Force10 switches. This excludes most, if not all, of the etherscale series. The backend has been developed for the E series. The backend has been developed and tested on a Terascale E300 switch. The switch (or router, depending on your leve...
# -*- coding: utf-8 *-* from pymongolab import database from mongolabclient import MongoLabClient class MongoClient(object): """Instance class with the API key located at https://mongolab.com/user?username=[username]. Example usage: .. code-block:: python >>> from pymongolab import MongoClie...
from datetime import datetime from sqlalchemy import Column, Integer, String, ForeignKey, Boolean, Date, Table, Enum from sqlalchemy.orm import validates, relationship from db_handler import Base from password import Password class User(Base): __tablename__ = 'users' email = Column(String(120), unique=True,...
# This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at https://mozilla.org/MPL/2.0/. # Common codegen classes. from collections import defaultdict from itertools import groupby import operator import os...
""" TwitterURLs.py is a class that can be used to obtain the URLs of user tweets """ #import all secret keys for twitter access from Secret import * #import TwitterAPI from TwitterAPI import TwitterAPI #Global Printing Variable VERBOSE = False class TwitterURLs(): """ Twitter URLs enables access to the URLs pos...
#! /usr/bin/python import sys try: inp = sys.argv[1] files = open(inp) except: files = open("lista_out.txt") # process RM *.out file dict_count = {} dict_diver = {} header = """ SW perc perc perc query position in query matching repe...
""" Classes and utilities for talking to an OpenMRS server version 1.9 :Authors: Sana Dev Team :Version: 2.0 """ import urllib import cookielib import logging import urllib2 import cjson import time import base64 from django.conf import settings from . import openers from mds.api.responses import succeed, fail __al...
from setuptools import setup, find_packages from torch.utils.cpp_extension import BuildExtension, CUDAExtension import sys if sys.version_info < (3,): sys.exit('Sorry, Python3 is required for gnmt.') with open('requirements.txt') as f: reqs = f.read() extra_cuda_compile_args = { 'cxx': ['-O2', ], 'nvcc...
# -*- coding: utf-8 -*- """Example Google style docstrings. This module demonstrates documentation as specified by the `Google Python Style Guide`_. Docstrings may extend over multiple lines. Sections are created with a section header and a colon followed by a block of indented text. Example: Examples can be give...
import struct from bpf.opcodes import (BPF_CLASS, BPF_LD, BPF_LDX, BPF_MODE, BPF_MEMWORDS, BPF_IMM, BPF_IND, BPF_MSH, BPF_ABS, BPF_LEN, BPF_MEM, BPF_ST, BPF_STX, BPF_ALU, BPF_OP, BPF_ADD, BPF_SUB, BPF_MUL, BPF_OR, BPF_AND, BPF_RSH, BPF_LSH, BPF...
#!/usr/bin/env python # This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. # Copyright (c) 2014 Mozilla Corporation import sys import logging import requests import json fr...
# 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 ...
from django.contrib import admin, messages from django.contrib.sites.requests import RequestSite from django.contrib.sites.models import Site from django.utils.translation import ugettext_lazy as _ from registration.models import RegistrationProfile class RawMixin(object): def formfield_for_dbfield(self, db_field, ...
""" gpscap - GPS/AIS capability dictionary class. This file is Copyright (c) 2010 by the GPSD project BSD terms apply: see the file COPYING in the distribution root for details. """ import ConfigParser class GPSDictionary(ConfigParser.RawConfigParser): def __init__(self, *files): "Initialize the capabili...
__author__ = 'matt' import threading import spotify_wrapper from redisBroker import RedisBroker from time import sleep from collections import deque import requests from sys import stdin SERVER = 'pyply.j.layershift.co.uk' SKIP_THRESHOLD = 3 class JukeboxController: def __init__(self): self.playlist = N...
#!/usr/bin/python # -*- coding: iso8859-1 -*- # Autor: Víctor Ruiz Gómez # Descripción: Este script define distintos bots que son jugadores del # juego Othello. from game2 import Player from random import choice from minmax import MinMax, MinMaxAlphaBeta from othello import OthelloEval, OthelloEvalDiffPiezas, OthelloE...