src stringlengths 721 1.04M |
|---|
# coding=utf-8
from builtins import range
from builtins import object
from datetime import datetime, timedelta
from math import isnan
from django.utils.translation import ugettext as _
import numpy
import pytz
from realtime.models.earthquake import Earthquake
__author__ = 'Rizky Maulana Nugraha "lucernae" <lana.pcfre@... |
# -*- coding: utf-8 -*-
# Copyright (C) 2015 Baifendian 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 appl... |
# -*- coding: utf-8 -*-
#
# app documentation build configuration file, created by
# sphinx-quickstart on Wed Oct 21 13:18:22 2009.
#
# 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
# autogenerated file.
#
# All con... |
# txopenid
# Copyright (c) 2007 Phil Christensen
#
# See LICENSE for details
"""
Test protocol module.
"""
import sha, cgi, base64, urllib
from twisted.trial import unittest
from twisted.internet.defer import inlineCallbacks, returnValue
from nevow import url
from txopenid import util, protocol
from txopenid.test ... |
# 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 ... |
#!/usr/bin/env python
# coding: utf-8
# Lambert Scattering (irrad_method='horvat')
# ============================
#
# Setup
# -----------------------------
# Let's first make sure we have the latest version of PHOEBE 2.0 installed. (You can comment out this line if you don't use pip for your installation or don't wa... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
import django.utils.timezone
import django.db.models.deletion
from django.conf import settings
class Migration(migrations.Migration):
dependencies = [
('money', '0007_auto_20150816_0629'),
]
... |
from __future__ import absolute_import
import sys
import os
HERE = os.path.dirname(__file__)
sys.path.insert(0, os.path.join(HERE, '..', '..'))
from alot.commands import *
from alot.commands import COMMANDS
import alot.buffers
from argparse import HelpFormatter, SUPPRESS, OPTIONAL, ZERO_OR_MORE, ONE_OR_MORE, PARSER, RE... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import datetime
from django.db import migrations, models
from django.utils.timezone import utc
class Migration(migrations.Migration):
dependencies = [
("delft3dworker", "0059_merge"),
]
operations = [
migrations.AlterField... |
# -*- coding: utf-8 -*-
# This file is part of Shuup.
#
# Copyright (c) 2012-2019, Shoop Commerce Ltd. All rights reserved.
#
# This source code is licensed under the OSL-3.0 license found in the
# LICENSE file in the root directory of this source tree.
import os
import time
import pytest
from django.core.urlresolvers... |
"""Implementation of the Apriori algorithm for sequential patterns, F(k-1) x F(k-1) variant.
Model sequences like ((1, 2, 3), (4, 5), (4, 6)).
To get course sequences with empty elements as (0,):
course_seqs = [x.course_sequence for x in s.students]
course_seqs2 = [tuple([seq or (0,) for seq in x.course_sequence]) fo... |
# Copyright 2021 The FedLearner 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... |
from share.normalize import *
class AgentIdentifier(Parser):
uri = IRI(ctx)
class WorkIdentifier(Parser):
uri = IRI(ctx)
class Tag(Parser):
name = ctx.name
class ThroughTags(Parser):
tag = Delegate(Tag, ctx)
class Maintainer(Parser):
schema = tools.GuessAgentType(ctx.maintainer)
name =... |
from channels.consumer import AsyncConsumer
from ..exceptions import StopConsumer
class AsyncHttpConsumer(AsyncConsumer):
"""
Async HTTP consumer. Provides basic primitives for building asynchronous
HTTP endpoints.
"""
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs... |
#!/usr/bin/env python3
#
# Copyright (c) 2017 Weitian LI <liweitianux@live.com>
# MIT license
"""
Calculate the particle background flux (e.g., 9.5-12.0 keV) of the spectra.
flux = counts / exposure / area
where 'counts' is the total photon counts within the specified energy range;
'area' is the value of the ``BACKSC... |
# Copyright (c) 2013, Cornell University
# 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 copyright notice,
# this list of condi... |
"""
@Author: Thuc VX<vxthuc@labsofthings.com>
@ORG: labsofthings.com
@date: 27 May 2017
Purpose: This package is for search for user in captured image.
It does some processing:
- Request to get Linkedface token,
- Post search image to Linkedace,
- Ssearch user appear in image
"""
import time
import req... |
import requests
import random
import subprocess
import sys
def random_line(filename):
with open(filename) as f:
lines = [x.rstrip() for x in f.readlines()]
return random.choice(lines)
with open("users.txt") as usersfile:
users = [x.rstrip().split(" ") for x in usersfile.readlines()]
captcha = sy... |
def build_base_message(msisdn, result):
message = '<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?>' + \
'<msg>' + \
'<header action=\"1\" id=\"1111\"/>' + \
'<resp>' + \
'<op>rslt_comp_promo</op>' + \
'<msisdn>' + str(msisdn) + '</msisdn>' + \
'<result>' + str(result... |
#!/usr/bin/env python
import os
rootdir ='enron_mail_20110402/maildir'
for user in os.listdir(rootdir):
sent_items = 0
sent = 0
_sent_mail = 0
inbox = 0
total = 0
for folder in os.listdir(rootdir+'/'+user):
# print '%s\t%s' % ((folder, os.path.isdir(folde... |
import cherrypy
from basepage import BasePage
import framework
from openipam.web.resource.submenu import submenu
from openipam.config import frontend
perms = frontend.perms
class Access(BasePage):
'''The access class. This includes all pages that are /access/*'''
def __init__(self):
BasePage.__init__(self)
... |
from __future__ import print_function
from Screens.InfoBar import InfoBar
from enigma import eServiceReference
from Components.ActionMap import HelpableActionMap
from Screens.EpgSelectionChannel import EPGSelectionChannel
from Screens.EpgSelectionBase import EPGServiceZap
from Screens.TimerEntry import addTimerFromEven... |
# -*- coding: utf-8 -*-
from collections import defaultdict
import json
import logging
from ._compat import ElementTree, urlopen
MDN_SITEMAP = 'https://developer.mozilla.org/sitemaps/en-US/sitemap.xml'
SITEMAP_NS = 'http://www.sitemaps.org/schemas/sitemap/0.9'
log = logging.getLogger(__name__)
def parse():
"""... |
from sample.forms import NewPatientForm
from sample.models import Patient
from django.db import IntegrityError
from django.http import HttpResponseServerError, HttpResponseRedirect
from django.shortcuts import render_to_response
from django.template import RequestContext
from utilities import create_case_attributes
fro... |
from datetime import datetime
import endpoints
from google.appengine.ext import ndb
from google.appengine.api import taskqueue, memcache
from lib.db import Profile, Conference
from lib.models import ConflictException, ProfileForm, BooleanMessage, ConferenceForm, TeeShirtSize
MEMCACHE_ANNOUNCEMENTS_KEY = "RECENT_ANN... |
# Copyright (c) 2015 Jonathan M. Lange <jml@mumak.net>
#
# 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... |
import unittest
from lbry.schema.url import URL
claim_id = "63f2da17b0d90042c559cc73b6b17f853945c43e"
class TestURLParsing(unittest.TestCase):
segments = 'stream', 'channel'
fields = 'name', 'claim_id', 'sequence', 'amount_order'
def _assert_url(self, url_string, **kwargs):
url = URL.parse(ur... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2005, 2006 Zuza Software Foundation
#
# This file is part of translate.
#
# translate 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 ... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Python installation file.
"""
from setuptools import setup
import re
verstr = 'unknown'
VERSIONFILE = "bruges/_version.py"
with open(VERSIONFILE, "r")as f:
verstrline = f.read().strip()
pattern = re.compile(r"__version__ = ['\"](.*)['\"]")
mo = pattern.sear... |
# Copyright (C) 2014-2015 Andrey Antukh <niwi@niwi.be>
# Copyright (C) 2014-2015 JesΓΊs Espino <jespinog@gmail.com>
# Copyright (C) 2014-2015 David BarragΓ‘n <bameda@dbarragan.com>
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# pub... |
# -*- coding: utf-8 -*-
from .sharescurve import (
MemberSharesCurve,
PlantSharesCurve,
MixTotalSharesCurve,
LayeredShareCurve,
)
import unittest
from yamlns import namespace as ns
from .isodates import isodate
class ItemProvider_MockUp(object):
def __init__(self, items):
self._items ... |
#!/usr/bin/env python
'''
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")... |
import os, sys, shutil
if "SGE_ROOT" not in os.environ:
print "main(): Please set SGE_ROOT to the path of your SGE installation"
print "main(): before scrambling DRMAA_python"
sys.exit(1)
# change back to the build dir
if os.path.dirname( sys.argv[0] ) != "":
os.chdir( os.path.dirname( sys.argv[0] ) )... |
#!/usr/bin/env python
#####################################################
## Parse codahale/yammer/dropwizard JSON metrics ##
## put the tuples into a list, ##
## pickle the list and dump it into the graphite ##
## pickle port ##
##########################... |
# -*- coding: utf-8 -*-
import sqlparse
class SqlText(object):
def __init__(self, mongo_client, start_date,
stop_date, schema, hostname, db_client=None):
self.db_client = db_client
self.mongo_client = mongo_client
self.start_date = start_date
self.stop_date = stop... |
#! /usr/bin/env python
# -*- coding: utf-8 -*-
#
# This file is part of Export Layers.
#
# Copyright (C) 2013-2019 khalim19 <khalim19@gmail.com>
#
# Export Layers 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... |
from __future__ import print_function
from __future__ import absolute_import
import warnings
import copy
import time
import numpy as np
import multiprocessing
import threading
import six
try:
import queue
except ImportError:
import Queue as queue
from .topology import Container
from .. import backend as K
f... |
# This file is part of project Sverchok. It's copyrighted by the contributors
# recorded in the version control history of the file, available from
# its original location https://github.com/nortikin/sverchok/commit/master
#
# SPDX-License-Identifier: GPL3
# License-Filename: LICENSE
import ast
from math import *
from... |
import contextlib
import os.path
import sys
from typing import Generator
from typing import Sequence
from typing import Tuple
import pre_commit.constants as C
from pre_commit import git
from pre_commit.envcontext import envcontext
from pre_commit.envcontext import PatchesT
from pre_commit.envcontext import Var
from pr... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# import threading
import sys, os.path
import signal
from Phoniebox import Phoniebox
from time import sleep, time
# get absolute path of this script
dir_path = os.path.dirname(os.path.realpath(__file__))
defaultconfigFilePath = os.path.join(dir_path, 'phoniebox.conf')
#... |
# -*- coding: utf-8 -*-
def test_public_api():
# The idea of this test is to ensure that all functions we expect to be in the
# public API under the correct namespace are indeed there.
import allel
# allel.model.ndarray
assert callable(allel.GenotypeVector)
assert callable(allel.GenotypeArray)... |
# Copyright 2015 Intel 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 applicable law or agreed to in wri... |
from __future__ import absolute_import
from sentry.integrations import Integration, IntegrationFeatures, IntegrationProvider, IntegrationMetadata
from sentry.pipeline import NestedPipelineView
from sentry.identity.pipeline import IdentityProviderPipeline
from django.utils.translation import ugettext_lazy as _
from sen... |
# ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2015, Numenta, Inc. Unless you have purchased from
# Numenta, Inc. a separate commercial license for this software code, the
# following terms and conditions apply:
#
# This pro... |
<<<<<<< HEAD
<<<<<<< HEAD
#!/usr/bin/env python
# Copyright (c) 2012 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Argument-less script to select what to run on the buildbots."""
import os
import shutil
import subprocess
imp... |
# -*- coding: utf-8 -*-
"""setup.py: setuptools control."""
import re
from setuptools import setup
#import sys
#if not sys.version_info[0] == 3:
# print("\n \
# sys.exit("\n \
# ****************************************************************\n \
# * The CLI has only been tested with ... |
""" Using convolutional net on MNIST dataset of handwritten digit
(http://yann.lecun.com/exdb/mnist/)
Author: Chip Huyen
Prepared for the class CS 20SI: "TensorFlow for Deep Learning Research"
cs20si.stanford.edu
"""
from __future__ import print_function
from __future__ import division
from __future__ import print_func... |
from __future__ import absolute_import, unicode_literals, print_function
import hashlib
import logging
import re
import zlib
from .compat import OrderedDict, parse_qsl, quote
from .filters import (make_batch_relative_url_filter, make_multipart_filter, make_query_filter,
make_url_filter, make_eli... |
# coding: utf-8
import sublime
import os
import re
st_version = int(sublime.version())
if st_version > 3000:
from JoomlaPack.lib import *
from JoomlaPack.lib.extensions.base import Base
from JoomlaPack.lib.inflector import *
else:
from lib import *
from lib.extensions.base import Base
from lib.... |
#!/usr/bin/env python
'''-------------------------------------------------------------------------------------------------
Equally divide BAM file (m alignments) into n parts. Each part contains roughly m/n alignments
that are randomly sampled from total alignments.
----------------------------------------------------... |
#!/usr/bin/env python
"""
@file checkSvnProps.py
@author Michael Behrisch
@date 2010-08-29
@version $Id: checkSvnProps.py 22608 2017-01-17 06:28:54Z behrisch $
Checks svn property settings for all files.
SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/
Copyright (C) 2010-2017 DLR (http://www.dlr.de/... |
# -*-python-*-
# GemRB - Infinity Engine Emulator
# Copyright (C) 2011 The GemRB Project
#
# 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) ... |
import sys
import os
import csv
import json
import re
import math
import djfixture
from optparse import make_option
from djredcap import _csv
from django.core.management.base import BaseCommand, CommandError
__project_name__ = ''
class Command(BaseCommand):
requires_model_validation = False
db_... |
#!/usr/bin/env python
import os
import click
from matplotlib import use
use('Agg') # noqa
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import seaborn as sns
from skbio import read, DistanceMatrix
from skbio.stats import isubsample
from skbio.stats.ordination import OrdinationResults
from col... |
from django.contrib import admin
from import_export import admin as import_export_admin
from modeltranslation import admin as modeltranslation_admin
from . import models
from .import_export_resources import ChecklistResource
class CategoryAdmin(import_export_admin.ImportExportModelAdmin):
fields = ('icon', 'name... |
# -*- coding: utf-8 -*-
from luckydonaldUtils.logger import logging
from pytgbot.bot import Bot
from pytgbot.exceptions import TgApiServerException, TgApiParseException
__author__ = 'luckydonald'
logger = logging.getLogger(__name__)
class Webhook(Bot):
"""
Subclass of Bot, will be returned of a sucessful we... |
from collections import defaultdict
import html
from itertools import chain
from functools import partial
import re
import textwrap
import threading
import uuid
import sublime
import sublime_plugin
from .lint import persist, events, style, util, queue, quick_fix
from .lint.const import PROTECTED_REGIONS_KEY, ERROR, W... |
# apis_v1/documentation_source/position_retrieve_doc.py
# Brought to you by We Vote. Be good.
# -*- coding: UTF-8 -*-
def position_retrieve_doc_template_values(url_root):
"""
Show documentation about positionRetrieve
"""
required_query_parameter_list = [
{
'name': 'voter_de... |
import os
import couchdb
import uuid
import requests
from datetime import datetime
from flask import Flask, jsonify, session, render_template, request, redirect, g, url_for, flash
# from .models import User
from datetime import datetime
from couchdb.mapping import Document, TextField, DateTimeField, ListField, FloatF... |
#!python
###############################################################################
# Orkid SCONS Build System
# Copyright 2010, Michael T. Mayers
# email: michael@tweakoz.com
# The Orkid Build System is published under the GPL 2.0 license
# see http://www.gnu.org/licenses/gpl-2.0.html
#####################... |
# Copyright (c) 2006-2013 Regents of the University of Minnesota.
# For licensing terms, see the file LICENSE.
import os
import sys
import conf
import g
from item import geofeature
from item.util.item_type import Item_Type
from util_ import gml
log = g.log.getLogger('terrain')
class Geofeature_Layer(object):
#... |
import re
from util import hook, database, user
import seen, channel
#@hook.event('353')
#def onnames(input, conn=None, bot=None):
# global userlist
# inp = re.sub('[~&@+%,\.]', '', ' '.join(input))
# chan,users = re.match(r'.*#(\S+)(.*)', inp.lower()).group(1, 2)
# try: userlist[chan]
# except: userlis... |
# Copyright (C) 2017 HuaWei Corporation.
# 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... |
import unittest
from StringIO import StringIO
from codekata04.kata04_part_three import (
Kata04WeatherTable,
Kata04FootballTable
)
class Kata04Tests(unittest.TestCase):
def common_test_record_creation(self):
for test_item in self.test_items:
ds = StringIO(test_item[0])
t =... |
#!/usr/bin/env python
# This is a sample of server that will run in the package server, that will send
# files to this mod-pacmanager server
#
# modcommon comes from mod-python package.
# Although the fileserver package is copied inside this repository, this server won't run in
# same environment
from modcommon.commun... |
from qtpy.QtCore import QTimer
from qtpy.QtWidgets import QApplication, QMainWindow
from magnolia.ui import Ui_MainWindow, signaler, positioners, LineDrawable
from magnolia.positioners import (
RingPositioner, ChangingRingPositioner, LowestAvailablePositioner
)
from magnolia.front import BudFronter
from magnolia.m... |
import os
from unittest.mock import patch
from pytest import fixture, mark
from ..bitbucket import BitbucketOAuthenticator
from .mocks import setup_oauth_mock
def user_model(username):
"""Return a user model"""
return {
'username': username,
}
@fixture
def bitbucket_client(client):
setup_o... |
"""
engineering-open: open-source tooling for engineering
Copyright (C) 2013-2019 Jeroen Coenders
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 option) ... |
"""
Tests for go_api utility functions.
"""
from twisted.internet.defer import Deferred, inlineCallbacks, succeed
from twisted.internet.task import Clock
from twisted.trial.unittest import TestCase
from go_api.utils import defer_async, simulate_async
class DummyError(Exception):
"""
Exception for use in tes... |
""" asterix/APDU.py
__author__ = "Petr Tobiska"
Author: Petr Tobiska, mailto:petr.tobiska@gmail.com
This file is part of asterix, a framework for communication with smartcards
based on pyscard. This file implements handfull APDU commands.
asterix is free software; you can redistribute it and/or modify
it under th... |
import collections
from rx import AnonymousObservable, Observable
from rx.disposables import CompositeDisposable
from rx.internal import default_comparer
from rx.internal import extensionmethod
@extensionmethod(Observable)
def sequence_equal(self, second, comparer=None):
"""Determines whether two sequences are e... |
#!/usr/bin/env python
# This work was created by participants in the DataONE project, and is
# jointly copyrighted by participating institutions in DataONE. For
# more information on DataONE, see our web site at http://dataone.org.
#
# Copyright 2009-2019 DataONE
#
# Licensed under the Apache License, Version 2.0 (t... |
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'checkSumGui.ui'
#
# Created: Thu Jan 8 02:22:42 2015
# by: PyQt5 UI code generator 5.4
#
# WARNING! All changes made in this file will be lost!
from PyQt5 import QtCore, QtGui, QtWidgets
class Ui_Form(object):
def setupUi(self, Form)... |
"""Manage class and methods for data validity indicators."""
import logging
import pandas
from indicator import Indicator
from session import update_session_status
# Load logging configuration
log = logging.getLogger(__name__)
class Validity(Indicator):
"""Class used to compute indicators of type validity."""
... |
# -*- 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... |
from mock import Mock
from django.http import HttpResponseRedirect
from django.test import RequestFactory
from careers.base.middleware import LocaleRedirectionMiddleware
from careers.base.tests import TestCase
class RedirectionTests(TestCase):
def setUp(self):
self.requestfactory = RequestFactory()
... |
from rest_framework.pagination import PageNumberPagination
from rest_framework import serializers
from rest_framework import permissions
from collections import OrderedDict
typing_arr = {
'AutoField': 'int',
'CharField': 'string',
'DateTimeField': 'datetime',
'DateField': 'date',
'BooleanField': 'b... |
"""Undocumented Module"""
__all__ = ['DirectButton']
from panda3d.core import *
import DirectGuiGlobals as DGG
from DirectFrame import *
class DirectButton(DirectFrame):
"""
DirectButton(parent) - Create a DirectGuiWidget which responds
to mouse clicks and execute a callback function if defined
"""
... |
#
# Copyright (c) 2004 Conectiva, Inc.
#
# Written by Gustavo Niemeyer <niemeyer@conectiva.com>
#
# This file is part of Smart Package Manager.
#
# Smart Package Manager 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 Fou... |
'''This automation helps you to automatically sign in to yahoo mail
without a single mouse/keyboard stroke. To run this piece of code successfully,
you need to have an existing yahoo account'''
from selenium import webdriver
import time
from Configure import Configure
def if_exists(idstr):
try:
el... |
"""The airvisual component."""
import asyncio
from datetime import timedelta
from math import ceil
from pyairvisual import CloudAPI, NodeSamba
from pyairvisual.errors import (
AirVisualError,
InvalidKeyError,
KeyExpiredError,
NodeProError,
)
from homeassistant.config_entries import SOURCE_REAUTH
from ... |
# urls.py
# Copyright (C) 2009-2013 PalominoDB, Inc.
#
# You may contact the maintainers at eng@palominodb.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 2 of the Licens... |
import unittest
import json
import flask
import friendsNet.resources as resources
import friendsNet.database as database
DB_PATH = 'db/friendsNet_test.db'
ENGINE = database.Engine(DB_PATH)
COLLECTION_JSON = "application/vnd.collection+json"
HAL_JSON = "application/hal+json"
GROUP_MEMBERSHIP_REQUEST_PROFILE = "/profi... |
import math
# add back later
# import GeoIP
nauticalMilePerLat = 60.00721
nauticalMilePerLongitude = 60.10793
rad = math.pi / 180.0
milesPerNauticalMile = 1.15078
def calcDistance(lat1, lon1, lat2, lon2):
"""
Caclulate distance between two lat lons in NM
"""
lat1 = float(lat1)
lat2 = float(... |
from .basewidget import *
from .editorext import *
from .defs import *
__all__ = (
"ACTION_OK",
"ACTION_CANCEL",
"ACTION_NEXT",
"ACTION_PREV",
"EditableWidget",
"Dialog",
"WLabel",
"WFrame",
"WButton",
"WCheckbox",
"WRadioButton",
"WListBox",
"WPopupList",
"WDro... |
import os
from setuptools import setup
README = open(os.path.join(os.path.dirname(__file__), 'README.md')).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='django-skilltreeapp',
version='0.1',
packages=['skilltreea... |
import io
from textwrap import dedent
import pytest
from vdirsyncer import cli
@pytest.fixture
def read_config(tmpdir):
def inner(cfg):
f = io.StringIO(dedent(cfg.format(base=str(tmpdir))))
return cli.utils.read_config(f)
return inner
def test_read_config(read_config, monkeypatch):
err... |
'''
Path: magpy.lib.format_lemi
Part of package: stream (read/write)
Type: Input filter, part of read library
PURPOSE:
Auxiliary input filter for Lemi data.
CONTAINS:
isLEMIBIN: (Func) Checks if file is LEMI format binary file.
readLEMIBIN: (F... |
from lettuce import step,before,world,after
from lettuce.django import django_url
from django.contrib.auth.models import User
from frontend.models import UserProfile, Feature
# Steps used in more than one feature's steps file
# Features
@step(u'(?:Given|And) the "([^"]*)" feature exists')
def and_the_feature_exists(st... |
# -*- coding: utf-8 -*-
#
# Copyright 2018 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law... |
#!/usr/bin/env python2
# vim:fileencoding=utf-8
# License: GPLv3 Copyright: 2016, Kovid Goyal <kovid at kovidgoyal.net>
from __future__ import (unicode_literals, division, absolute_import,
print_function)
import os
from .constants import PYTHON, MAKEOPTS, build_dir, PREFIX, isosx, iswindows
fr... |
# python script to rip click data from a sql database from the fossilfinder data
# NOTES
# raw data should have a reference_key that is clean - starting at 1 and incrementing by 1 for each row - not doing this will throw an error
# this code rips T3 from the data - so clicks are for individual object ids of interest
# ... |
#!/usr/bin/env python
#coding:utf-8
# Author: mozman --<mozman@gmx.at>
# Purpose: element factory
# Created: 15.10.2010
# Copyright (C) 2010, Manfred Moitzi
# License: MIT License
from svgwrite import container
from svgwrite import shapes
from svgwrite import path
from svgwrite import image
from svgwrite ... |
#!/usr/bin/env python
import sys
sys.path.append("../shared/")
import os
import harmonics_data
import sys
import mode_decays
import published_constants
import adjust_decays
import tables
# no clue why I need this. :(
from harmonics_data import HarmonicsStats
def process(dirname, basename, recalc=False, plot=Fa... |
"""
Generation of sed code for numsed.
"""
from __future__ import print_function
import re
import subprocess
try:
import common
import opcoder
except:
from . import common
from . import opcoder
class SedConversion(common.NumsedConversion):
def __init__(self, source, transformation):
com... |
#!/usr/bin/env python2
"""This script takes an provider and edomain as optional parameters, and
searches for old templates on specified provider's export domain and deletes
them. In case of no --provider parameter specified then this script
traverse all the rhevm providers in cfme_data.
"""
import argparse
import dat... |
"""
Creates and simulates a circuit for Quantum Fourier Transform(QFT)
on a 4 qubit system.
In this example we demonstrate Fourier Transform on
(1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0) vector. To do the same, we prepare
the input state of the qubits as |0000>.
=== EXAMPLE OUTPUT ===
Circuit:
(0, 0): βHβββ@^0.5βββΓβββHββββββ... |
# Copyright (c), 2016-2020, SISSA (International School for Advanced Studies).
# All rights reserved.
# This file is distributed under the terms of the MIT License.
# See the file 'LICENSE' in the root directory of the present
# distribution, or http://opensource.org/licenses/MIT.
#
# @author Davide Brunato <brunato@si... |
# encoding: utf-8
"""
swatch, a parser for adobe swatch exchange files
Copyright (c) 2014 Marcos A Ojeda http://generic.cx/
With notes from
http://iamacamera.org/default.aspx?id=109 and
http://www.colourlovers.com/ase.phps
All Rights Reserved
MIT Licensed, see LICENSE.TXT for details
"""
import logging
import struct
... |
# Copyright 2013 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 by... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.