src
stringlengths
721
1.04M
from django.contrib.postgres.aggregates.general import ArrayAgg from django.contrib.postgres.aggregates.general import BoolOr from django.db.models import BooleanField from django.db.models import CharField from django.db.models import IntegerField from django.db.models.aggregates import Count from django.db.models.agg...
from __future__ import print_function import re import sys import collections import subprocess from poline.fields import Fields if sys.version_info >= (3,0): from urllib.parse import urlparse else: from urlparse import urlparse if sys.version_info >= (3,5): _collections_Generator = collections.Generator...
from Screens.InfoBar import InfoBar from Screens.Screen import Screen from Screens.Standby import TryQuitMainloop from Screens.MessageBox import MessageBox from Screens.VirtualKeyBoard import VirtualKeyBoard from Components.ActionMap import ActionMap from Components.ConfigList import ConfigListScreen from Components.La...
from __future__ import print_function from ecl.util.util import IntVector from res.enkf.enums import ErtImplType from res.enkf.data import EnkfNode from ert_gui.shell import assertConfigLoaded, ErtShellCollection from ert_gui.shell.libshell import autoCompleteList, splitArguments class Export(ErtShellCollection): ...
#Embedded file name: ACEStream\Core\APIImplementation\makeurl.pyo import sys import urlparse import urllib import math #if sys.platform != 'win32': # import curses.ascii from types import IntType, LongType from struct import pack, unpack from base64 import b64encode, b64decode from M2Crypto import Rand from tracebac...
# uncompyle6 version 2.9.10 # Python bytecode 2.7 (62211) # Decompiled from: Python 3.6.0b2 (default, Oct 11 2016, 05:27:10) # [GCC 6.2.0 20161005] # Embedded file name: queues.py __all__ = [ 'Queue', 'SimpleQueue', 'JoinableQueue'] import sys import os import threading import collections import time import atexit im...
# -*- coding: utf-8 -*- '''Miscellania.''' # This file is part of CBG. # # CBG 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. # # CBG...
#!/usr/bin/env python from __future__ import print_function from collections import defaultdict import os import sys import math import fileinput import matplotlib.pyplot as plt totals = defaultdict(list) for line in fileinput.input(): try: values = map(float, line.split("\t")) totals[os.path.bas...
"""Subclass of EditDialog, which is generated by wxFormBuilder.""" import wx import racm_ui # Implementing EditDialog class EditDialog(racm_ui.EditDialog): _main_frame = None _row = -1 def __init__(self, parent, main_frame, host, port, name, row): racm_ui.EditDialog.__init__(self, parent) ...
# -*- encoding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. import base64 import re from odoo import api, fields, models, _ from odoo.exceptions import UserError, ValidationError FK_HEAD_LIST = ['FK', 'KD_JENIS_TRANSAKSI', 'FG_PENGGANTI', 'NOMOR_FAKTUR', 'MASA_PAJAK', 'TAHUN_P...
from flask import render_template, request import numbers from pprint import pprint from arps.restserver import app, db, ApiException, apiview from arps.globals import * from arps.validation import get_schemas_for_endpoint from arps.models import * METHODS = ['GET', 'POST', 'PUT', 'DELETE'] @app.route('/') def main(...
import inspect import os from tensorflow import gfile import numpy as np import tensorflow as tf import time from tensorflow import logging out_file = gfile.Open("gs://ksh_imagenet/ILSVRC/feature.csv", "w+") out_file.write("filename," + ",".join(["feature" + str(i) for i in range(1, 2049)]) + "\n") files = tf.gfile.Gl...
#!/usr/bin/env python3 try: import requests except ImportError: print("It looks like requests is not installed.") print("Try: pip3 install requests") exit(1) import os import sys import subprocess from getpass import getpass import mod_manager from mod_manager import server from mod_manager.exception...
# -*- coding: utf-8 -*- #Programm zum Kopieren und Einfügen von Datensätzen in Halbstunden- Tages- und Wochentabellen #erstellt am: 26.5.2006 #letzte Änderung am 2.7.2006 #erstellt von: Manuel Meiborg (manuel.meiborg@gmx.de) #Version 2.0 # #Dieses Script ermöglicht es, bestimmte Intervalle von Netzverkehrsdaten innerha...
from __future__ import absolute_import import logging from unittest import TestCase import settings import sys, traceback reload(sys) sys.setdefaultencoding("utf-8") import os from AppCompatProcessor import main from shutil import copyfile from ShimCacheParser_ACP import read_mir, write_it import tempfile import appDB ...
# -*- coding: utf-8 -*- from EXOSIMS.StarCatalog.SIMBADCatalog import SIMBADCatalog from EXOSIMS.util.get_dirs import get_cache_dir import os, inspect class SIMBAD300Catalog(SIMBADCatalog): """SIMBAD300 Catalog class This class populates the star catalog used in EXOSIMS from the SIMBAD300 ca...
# vim: ft=python fileencoding=utf-8 sts=4 sw=4 et: # Copyright 2017-2020 Florian Bruhin (The Compiler) <mail@qutebrowser.org> # # This file is part of qutebrowser. # # qutebrowser 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 S...
# -*- coding: 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 field 'Page.template' db.add_column('pinata_page', 'template', self.gf('djang...
# -*- encoding: utf-8 -*- # ! python2 from __future__ import (absolute_import, division, print_function, unicode_literals) from jinja2 import FileSystemLoader, Environment class TemplateRenderer(object): def __init__(self, templates_directory, template_name, item): """ :type templates_directory:...
"""Network models and submodels. The :class:`Model` class is used to encapsulate a set of Theano shared variables (model parameters), and can create symbolic expressions for model outputs and loss functions. This module also contains subclasses, such as :class:`Linear`, that function as building blocks for more compl...
from autostew_back.event_handlers.base_event_handler import BaseEventHandler from autostew_web_enums.models import EventType, ParticipantState from autostew_web_session.models.event import Event from autostew_web_session.models.participant import Participant warn_at = 0.7 environment_crash_multiplier = 0.1 class Han...
#!/usr/bin/env python """ Copyright 2014 Novartis Institutes for Biomedical Research 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 ...
#!/usr/bin/env python # # This file is part of Flap. # # Flap 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. # # Flap is distributed ...
from django.contrib.auth.mixins import LoginRequiredMixin from django.contrib.auth.models import User from django.db.models import Count from django.views.generic import DetailView, ListView from candidates.models import LoggedAction from wombles.models import WombleTags class SingleWombleView(LoginRequiredMixin, De...
# Copyright 2015-2016 Yelp 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 to in writin...
import json import string import random from django.shortcuts import render from django.http import HttpResponseRedirect, HttpResponse, Http404 from django.contrib.auth import login, authenticate, logout from django.contrib.auth.decorators import login_required from django.db.models.aggregates import Max from django.co...
# -*- coding: utf-8 -*- # Copyright 2020 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...
# Copyright NuoBiT Solutions, S.L. (<https://www.nuobit.com>) # Eric Antones <eantones@nuobit.com> # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl) from odoo import models, fields from odoo.addons.component.core import Component from odoo.addons.queue_job.job import job class ResPartner(models.Model):...
# Anemon Dhcp # Copyright (C) 2005 Mathieu Ignacio -- mignacio@april.org # # 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 2 of the License, or # (at your option) any later versio...
#!/usr/bin/env python # Copyright (c) 2014 The WebRTC project authors. All Rights Reserved. # # Use of this source code is governed by a BSD-style license # that can be found in the LICENSE file in the root of the source # tree. An additional intellectual property rights grant can be found # in the file PATENTS. All c...
import ConfigParser import gc import glob import io import os import cStringIO import re import subprocess import string import sys import numpy as np import pandas as pd def GetConfigParm(section): dict1 = {} options = Config.options(section) for option in options: try: dict1[option] = Con...
from lookahead import CharacterLookAhead, LookAhead from structures import Constant, Struct specials = { ',': 'comma', '(': 'leftparen', ')': 'rightparen', '[': 'leftbracket', ']': 'rightbracket', } operators = set([ 'or', 'and', 'not', '!', ':', '=', '-', '+', '*', '/', '<>', '==', '!=', '->', '<...
""" This page is in the table of contents. Cool is a craft tool to cool the shape. Cool works well with a stepper extruder, it does not work well with a DC motor extruder. If enabled, before each layer that takes less then "Minimum Layer Time" to print the tool head will orbit around the printed area for 'Minimum Lay...
# -*- Mode: Python; tab-width: 4 -*- # Copyright (c) 2005-2010 Slide, Inc. # All rights reserved. # # 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 copyrig...
# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed u...
# Copyright (c) 2015 Red Hat 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...
#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/platypus/paraparser.py __version__=''' $Id$ ''' __doc__='''The parser used to process markup within paragraphs''' import string import re from types im...
# -*- coding: utf-8 -*- # 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 #...
# Copyright 2007 Joe Wreschnig # 2016-17 Nick Boultbee # # 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 2 of the License, or # (at your option) any later version. import ...
# -*- coding: utf-8 -*- # Form implementation generated from reading ui file 'untitled.ui' # # Created by: PyQt5 UI code generator 5.6 # # WARNING! All changes made in this file will be lost! from PyQt5 import QtCore, QtGui, QtWidgets from PyQt5.QtCore import * import sys class Ui_MainWindow(object): def setupUi(...
# 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...
# Copyright 2012 OpenStack Foundation # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless requ...
from tsserver import db from tsserver.strutils import to_camel_case class Model(db.Model): """ Base class for all models. What differs it from default Model class is serializable method, which is used to convert objects to JSON (or any other representation) more easily. """ __abstract__ = Tru...
# Copyright (C) 2014,2015 Nippon Telegraph and Telephone Corporation. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by ...
# -*- coding: utf-8 -*- # Description: # Author: Ilya Mashchenko (ilyam8) # SPDX-License-Identifier: GPL-3.0-or-later from bases.collection import safe_print CHART_PARAMS = ['type', 'id', 'name', 'title', 'units', 'family', 'context', 'chart_type', 'hidden'] DIMENSION_PARAMS = ['id', 'name', 'algorithm', 'multiplier'...
""" See CentresOfInterestManager class """ import re import mylib.checking as checking from mylib.string_op import replace_special_char from mylib.notifier import Notifier from xml.dom import minidom from lxml import etree from centre_of_interest import CentreOfInterest def identity(x): return x class CentresOfI...
"""Utilities for second set of flag examples. """ import os import time import sys import string import argparse from collections import namedtuple from enum import Enum Result = namedtuple('Result', 'status data') HTTPStatus = Enum('Status', 'ok not_found error') POP20_CC = ('CN IN US ID BR PK NG ...
# vim:fileencoding=utf-8:noet from powerline.segments import Segment, with_docstring from powerline.theme import requires_segment_info from subprocess import PIPE, Popen import os, re, string @requires_segment_info class GitStatusSegment(Segment): def execute(self, pl, command): pl.debug('Executing comm...
# -*- coding: utf-8 -*- ######################################################################### # # Copyright (C) 2016 OSGeo # # 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 ...
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. from odoo import fields from odoo.tests.common import SavepointCase, HttpSavepointCase, tagged, Form import time import base64 from lxml import etree @tagged('post_install', '-at_install') class AccountTestInvoicingComm...
""" flags.py - Various constants that have special meaning in describe. INIT - Represents a matcher be instanciated for initialization purposes only NO_ARG - Represents no argument. This is Noner than None. """ __all__ = ( 'NO_ARG', 'NO_ARGS', 'ANY_ARG', 'ANYTHING', 'ANY_ARGS', 'ANY_KWARGS', 'is_flag', ...
import random from django.core.exceptions import ValidationError from django.db.models import CharField, ManyToManyField from django.test import TestCase from tx_people import fields from tx_people import models from tx_people import utils from ._utils import RandomDatesMixin class ReducedDateFieldTestCase(RandomD...
import numpy as np from sklearn.datasets import load_iris from sklearn import tree iris = load_iris() # print iris.feature_names # print iris.target_names # print iris.data[0] # print iris.target[0] # for i in range(len(iris.target)): # print "Example %d: Label %s, feature: %s" % (i, iris.target[i], iris.data[i] ) -...
# -*- coding: utf-8 -*- # Copyright (C) 2013 Stéphane Caron <caron@ynl.t.u-tokyo.ac.jp> # # This file is part of the Time-Optimal Path Parameterization (TOPP) library. # TOPP 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 ...
# Prime Number Sieve # http://inventwithpython.com/hacking (BSD Licensed) import math def isPrime(num): # Returns True if num is a prime number, otherwise False. # Note: Generally, isPrime() is slower than primeSieve(). # all numbers less than 2 are not prime if num < 2: return...
# -*- coding: utf-8 -*- import scrapy import json import re from locations.items import GeojsonPointItem class LjsilversSpider(scrapy.Spider): name = "ljsilvers" allowed_domains = ["ljsilvers.com"] start_urls = ( 'http://www.ljsilvers.com/locator?postalcode=76010', ) def parse(self, resp...
from nltk.corpus import brown import sys from graph import Graph,merge_graphs from nltk.tree import ParentedTree from stat_parser import Parser parser = Parser() user_sentence = sys.argv[1] query = sys.argv[2] trees = [] done = 0 # for sentence in brown.sents(): # if done >= 20: # break # if not query in sentence:...
""" Django Settings for TESTING PURPOSES Do not utilise this settings.py file for your own project. Even if it is not a production environment. This file is only for the automatic testing and is not build for server use. """ import os # Build paths inside the project like this: os.path.join(BASE_DIR, ...) BASE_DIR ...
import os import subprocess import sys from subprocess import CalledProcessError from time import sleep def main(): # Validate current working dir (should be project root). proj_path = os.path.abspath(".") readme_path = os.path.join(proj_path, "README.md") if os.path.exists(readme_path): asse...
# wsse/server/drf/tests/test_authentication.py # coding=utf-8 # pywsse # Authors: Rushy Panchal, Naphat Sanguansin, Adam Libresco, Jérémie Lumbroso # Date: September 1st, 2016 # Description: Test DRF WSSE Authentication backend. import contextlib import hashlib import base64 import datetime import itertools from rest...
import unittest import nose from numpy.testing import assert_almost_equal, assert_allclose from numpy.testing.decorators import slow from pandas.util.testing import (assert_series_equal, assert_frame_equal) import os from tempfile import NamedTemporaryFile import pandas as pd from pandas import DataFrame, Series imp...
# -*- coding: iso-8859-1 -*- """ Created on Wed Jul 12, 2017 @author: Eder Martioli & Janderson Oliveira Laboratorio Nacional de Astrofisica, Brazil """ from astropy.io.fits import getheader import astropy.io.fits as fits import photlib import numpy as np ########### READ TABLE OF COORDINATES #########...
#!/usr/bin/env python #! -*- coding: utf-8 -*- ### # Copyright (c) Rice University 2012-13 # This software is subject to # the provisions of the GNU Affero General # Public License version 3 (AGPLv3). # See LICENCE.txt for details. ### """Rhaptos user profile web application The application is initialized using the...
# # 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 # Copyright 2016 The TensorFlow Authors All Rights Reserved. # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicab...
#!/usr/bin/env python # -------------------------------------------------------- # Test regression propagation on ImageNet VID video # Modified by Kai KANG (myfavouritekk@gmail.com) # -------------------------------------------------------- """Test a Fast R-CNN network on an image database.""" import argparse import...
#!/usr/bin/env python import fiddle.staticanalysis import fiddle.r2_keeper as r2 import sys from fiddle.staticanalysis import LongWriteInfo class LongWriteInfoOld(): #@classmethod #def from_start_end(cls, elf, start, end, thumb): # # get basic block # return cls(elf, branch_ins["offset"], thumb...
# -*- coding: utf-8 -*- """ This simulates the development of a de novo OPL, cancer, or death from old age @author: icromwell """ import random t_OPL_StageOne = random.normalvariate(800,100) # Time to developing stage I oral cancer given OPL+ status t_OPL_NED = random.normalvariate(800,100) ...
from recipe_scrapers.marthastewart import MarthaStewart from tests import ScraperTest class TestMarthaStewart(ScraperTest): scraper_class = MarthaStewart maxDiff = None def test_host(self): self.assertEqual("marthastewart.com", self.harvester_class.host()) def test_canonical_url(self): ...
from setuptools import setup, find_packages import os PACKAGE = 'phylip' VERSION = open(os.path.join(os.path.dirname(os.path.realpath(__file__)), 'oldowan', PACKAGE, 'VERSION')).read().strip() desc_lines = open('README', 'r').readlines() setup(name='oldowan.%s' % PACKAGE, version=VERSION, ...
# 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 # ...
import importlib import logging from django.conf import settings from django.core.urlresolvers import resolve from limits.storage import storage_from_string from limits.strategies import STRATEGIES from limits.errors import ConfigurationError from limits.util import parse_many import six from .decorators import DECOR...
#!/usr/bin/env python """ @package eWRT.ws.yahoo support for the yahoo! search @remarks this module is based on yahoo's boss search service """ from __future__ import print_function # (C)opyrights 2008-2010 by Albert Weichselbraun <albert@weichselbraun.net> # Heinz Peter L...
import sys import os import argparse import json import pickle import functools from itertools import chain from . import delphin from . import config from . import gram """typediff.py Author: Ned Letcher https://github.com/ned2/typediff Typediff is a tool to allow you to quickly explore the types used in the proce...
# third-party imports import pytest # local imports from stretch import application from stretch.triggers import results from tests.utils import fixture_loader @pytest.fixture def configured_app(): app_json = fixture_loader.json_fixture("web-service-configured") return application.Application(app_json) @py...
# -*- coding: 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): db.rename_table('speeches_popolospeaker', 'speeches_speaker') db.alter_column('speeches_recordingtimestamp',...
# Copyright (c) 2015 "Hugo Herter http://hugoherter.com" # # This file is part of Billabong. # # Intercom is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as # published by the Free Software Foundation, either version 3 of the # License, or (at your o...
# Copyright (c) 2006, 2007, 2008, 2009, 2010, 2011, 2012 Andrey Golovizin # # 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 ...
# Copyright (c) 2013 Mirantis 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 to in writ...
#!/usr/bin/python #coding:utf-8 j = '{"action": "print", "method": "onData", "data": {"key1" : 1, "key2":"value2"} }' import json class Payload(object): def __init__(self, j): self.__dict__ = json.loads(j) p = Payload(j) print '-' * 30 print dir(p) print '-' * 30 print p.action print p.method print p.dat...
import pytest from interpreter.ast import Num from interpreter.interpreter import Interpreter, NodeVisitor from interpreter.lexer import Lexer from interpreter.parser import Parser from interpreter.tokens import Token, INTEGER class TestNodeVisitor(object): num_token = Num(Token(INTEGER, 1)) def test_generi...
# -*- coding: utf-8 -*- import argparse import binascii import datetime import hashlib import os import re import requests import time import urllib from evernote.api.client import EvernoteClient from evernote.edam.type import ttypes as Types from BeautifulSoup import BeautifulSoup try: from ConfigParser import Saf...
#!/usr/bin/env python """ forge.forge ~~~~~ :copyright: (c) 2010-2013 by Luis Morales :license: BSD, see LICENSE for more details. """ #heavely based on diamond https://github.com/BrightcoveOS/Diamond import os import sys import argparse import logging import traceback import inspect from util import load_class_fro...
import curses class CursesDialog: def __init__(self, screen, message, title="", isError=False, isFatal=False, isBlocking=False): self.screen = screen self.title = title self.message = message self.isError = isError self.isFatal = isFatal self.isBlocking = i...
# -*- coding: utf-8 -*- from south.utils import datetime_utils as datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding field 'CreditProvider.provider_status_url' db.add_column('credit...
#!/usr/bin/env python import string from types import TupleType from AOR.DoubleList import DoubleList from AOR.BasicStatement import BasicStatement, BasicRepr from AOR.Statements import Assignment # ============================================================================== # Well, thi...
#!/usr/bin/env python # -*- encoding: utf-8 -*- # vim: set et sw=4 ts=4 sts=4 ff=unix fenc=utf8: # Author: Binux<i@binux.me> # http://binux.me # Created on 2014-02-16 23:12:48 import sys import inspect import functools import fractions import six from six import add_metaclass, iteritems from pyspider.libs.ur...
#!/usr/bin/env python # -*- coding: utf-8 -*- import socket import select import logging log = logging.getLogger(__name__) class Server: def __init__(self, relays, timeout=0.3): self._relays = list(relays) self.timeout = timeout self.input_map = {} self.links = {} def main_...
# Copyright 2017 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 required by applicable law or agreed to in writing, ...
# Copyright 2004-2008 Roman Yakovenko. # Distributed under the Boost Software License, Version 1.0. (See # accompanying file LICENSE_1_0.txt or copy at # http://www.boost.org/LICENSE_1_0.txt) """This module contains the implementation of the L{config_t} class. """ import os import sys import copy class p...
# -*- coding: utf-8 -*- import json import datetime from .api import library as lib from . import util class Context(object): def __init__(self): self._ctx_ptr = lib.ph_context_init() self._cfg = Config() def __del__(self): self._ctx_ptr = None self._cfg = None lib.p...
from django.conf import settings from django.http import HttpResponseRedirect #from django.core.urlresolvers import reverse from django.contrib.auth import login as auth_login, logout, authenticate #from django.views.generic import ListView, DetailView from django.contrib.auth.forms import AuthenticationForm from djang...
from StringIO import StringIO from flask import make_response import pycountry import re from datetime import datetime from flask import Blueprint from flask import abort, jsonify from flask import redirect, flash from flask import request, render_template from flask import url_for from xhtml2pdf import pisa from ap...
import sys import sqlite3 as lite import time con = lite.connect("passwords.db") cur = con.cursor() cur.execute("CREATE TABLE if not EXISTS passwords(site VARCHAR(50), username VARCHAR(20), password VARCHAR(20));") print ("\n***** Welcome to Passwords.py. *****\n\n") choice = None while choice == None...
import datetime from django.conf import settings as django_settings from django.core.urlresolvers import reverse from django.test.client import Client from askbot.tests.utils import AskbotTestCase from askbot.conf import settings from askbot import models from askbot.models.badges import award_badges_signal class Badg...
import time import urllib.request import urllib.error import urllib.parse import config import logging from fiatconverter import FiatConverter class Market(object): def __init__(self, currency): self.name = self.__class__.__name__ self.currency = currency self.depth_updated = 0 sel...
#!/usr/bin/env python ## category General ## desc Appends name annotation from UCSC Xref file '''Adds gene name annotations to a GTF file (xref) This adds gene name annotations based upon the KnownGene annotations from the UCSC Genome Browser. Gene names will be taken from the kgXref table. This table must be download...
# # General-purpose Photovoltaic Device Model - a drift diffusion base/Shockley-Read-Hall # model for 1st, 2nd and 3rd generation solar cells. # Copyright (C) 2012-2017 Roderick C. I. MacKenzie r.c.i.mackenzie at googlemail.com # # https://www.gpvdm.com # Room B86 Coates, University Park, Nottingham, NG7 2RD...
# Use a different solved board to generate different tests. valid = [[5,3,4,6,7,8,9,1,2], [6,7,2,1,9,5,3,4,8], [1,9,8,3,4,2,5,6,7], [8,5,9,7,6,1,4,2,3], [4,2,6,8,5,3,7,9,1], [7,1,3,9,2,4,8,5,6], [9,6,1,5,3,7,2,8,4], [2,8,7,4,1,9,6,3,5], [3,4,5,2,8,...
# -*- coding: utf-8 -*- import json from django.http import HttpResponse, Http404, HttpResponseRedirect from django.template import RequestContext from django.shortcuts import render_to_response from common import utils, page from www.journey import interface from www.misc.decorators import member_required, staff_req...
#!/usr/bin/python # -*- coding: utf-8 -*- ############################################################################## # # Copyright (C) 2010-2012 Associazione OpenERP Italia # (<http://www.openerp-italia.org>). # Copyright(c)2008-2010 SIA "KN dati".(http://kndati.lv) All Rights Reserved. # Ge...