code stringlengths 2 1.05M | repo_name stringlengths 5 104 | path stringlengths 4 251 | language stringclasses 1
value | license stringclasses 15
values | size int32 2 1.05M |
|---|---|---|---|---|---|
# -*- coding: utf-8 -*-
from __future__ import absolute_import
from ... import *
from talon.signature.learning import featurespace as fs
def test_apply_features():
s = '''This is John Doe
Tuesday @3pm suits. I'll chat to you then.
VP Research and Development, Xxxx Xxxx Xxxxx
555-226-2345
[email protected]'''... | mailgun/talon | tests/signature/learning/featurespace_test.py | Python | apache-2.0 | 1,402 |
#!/usr/bin/env python3
"""Generate an updated requirements_all.txt."""
import importlib
import os
import pathlib
import pkgutil
import re
import sys
from script.hassfest.model import Integration
COMMENT_REQUIREMENTS = (
"Adafruit-DHT",
"Adafruit_BBIO",
"avion",
"beacontools",
"blinkt",
"bluepy... | fbradyirl/home-assistant | script/gen_requirements_all.py | Python | apache-2.0 | 11,383 |
# Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0
# For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt
"""Source file annotation for coverage.py."""
import os
import re
from coverage.files import flat_rootname
from coverage.misc import ensure_dir, isolate_module
fr... | sonntagsgesicht/regtest | .aux/venv/lib/python3.9/site-packages/coverage/annotate.py | Python | apache-2.0 | 3,528 |
# Copyright 2014 IBM Corp.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed t... | masayukig/tempest | tempest/tests/cmd/test_verify_tempest_config.py | Python | apache-2.0 | 29,474 |
import py_compile
import time
import marshal
import errno
import traceback
from os.path import join as path_join, isfile, isdir, getmtime
from translate import translate_file, translate_string, pystmts_to_string
from struct import unpack
from errors import TempyError, TempyImportError, TempyCompileError, TempyNativeC... | Algy/tempy | tempy/env.py | Python | apache-2.0 | 9,404 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""Tests for Twitter on iOS 8+ plugin."""
import unittest
from plaso.lib import definitions
from plaso.parsers.sqlite_plugins import twitter_ios
from tests.parsers.sqlite_plugins import test_lib
class TwitterIOSTest(test_lib.SQLitePluginTestCase):
"""Tests for Twitt... | kiddinn/plaso | tests/parsers/sqlite_plugins/twitter_ios.py | Python | apache-2.0 | 3,854 |
import zstackwoodpecker.test_state as ts_header
import os
TestAction = ts_header.TestAction
def path():
return dict(initial_formation="template5", checking_point=1, faild_point=100000, path_list=[
[TestAction.create_mini_vm, 'vm1', 'cluster=cluster2'],
[TestAction.reboot_vm, 'vm1'],
[TestAction.create_vm_bac... | zstackio/zstack-woodpecker | integrationtest/vm/mini/multiclusters/paths/multi_path88.py | Python | apache-2.0 | 2,871 |
from django.db.models import Q
from beetle.models import PrincipalGroup, GatewayGroup
from .models import Rule, RuleException
def __get_applicable_rules(from_gateway, from_principal, to_gateway,
to_principal, timestamp=None):
"""Get the queryset of rules that apply for the mapping."""
to_principal_groups = Princ... | helena-project/beetle | controller/access/lookup.py | Python | apache-2.0 | 2,657 |
#!/bin/env python
# encoding:utf-8
#
#
#
__Author__ = "CORDEA"
__date__ = "2014-08-21"
from collections import Counter
infile = open("pred_info.vcf", "r")
lines = infile.readlines()
infile.close()
# 0001a56c,chr1,5088617,2169089,44.2448979592,G,092a8efa7cd6427c91900bded95cab33,A,4:37:7:12,14:36:24:23,0:54:5:2,0:... | CORDEA/analysis_of_1000genomes-data | programs/machine_learning/extract_pred.py | Python | apache-2.0 | 1,133 |
# coding=utf-8
# Copyright 2014 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
import functools
imp... | tejal29/pants | src/python/pants/backend/python/thrift_builder.py | Python | apache-2.0 | 4,568 |
"""
Django settings for laboite_erp project.
Generated by 'django-admin startproject' using Django 1.10.5.
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/
"""
impor... | laboiteproject/laboite-erp | laboite_erp/settings.py | Python | apache-2.0 | 3,111 |
#!/usr/bin/python
"""postprocess"""
import argparse
import ruamel.yaml
import os
def read(filename):
"""return file contents"""
with open(filename, 'r') as file_in:
return file_in.read()
def write(filename, cwl):
"""write to file"""
with open(filename, 'w') as file_out:
file_out.wr... | rhshah/basicfiltering | vardict/postprocess.py | Python | apache-2.0 | 1,171 |
#!/usr/bin/env python
import SimpleITK as sitk
import skimage as ski
import skimage.segmentation
import numpy as np
import timeit
def mask_label_contour(image, seg):
"""Combine an image and segmentation by masking the segmentation contour.
For an input image (scalar or vector), and a multi-label
segmentati... | blowekamp/itkSuperPixel | doc/scripts/evaluation_ski.py | Python | apache-2.0 | 1,526 |
# -*- cpy-indent-level: 4; indent-tabs-mode: nil -*-
# ex: set expandtab softtabstop=4 shiftwidth=4:
#
# Copyright (C) 2008,2009,2010,2011,2012,2013,2014,2015,2016,2017 Contributor
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# Y... | guillaume-philippon/aquilon | lib/aquilon/worker/commands/add_interface_network_device.py | Python | apache-2.0 | 2,483 |
# -*- coding: utf-8 -*-
#
# 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
#... | Fokko/incubator-airflow | airflow/contrib/operators/s3_list_operator.py | Python | apache-2.0 | 3,690 |
from processor import Processor
file_name = "program_samples\hello.hex"
processor = Processor(file_name)
processor.load()
processor.run()
if __name__ == '__main__':
pass
| AlexLitvino/i8080_simulator | runner.py | Python | apache-2.0 | 177 |
# -*- 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, softw... | jprovaznik/tripleo-common | tripleo_common/exception.py | Python | apache-2.0 | 1,750 |
#!/usr/local/bin/python2.7
# -*- coding: utf-8 -*-
__author__ = 'https://github.com/password123456/'
import sys
reload(sys)
sys.setdefaultencoding('utf-8')
import requests
import urllib
import urllib2
import json
import datetime
class bcolors:
HEADER = '\033[95m'
OKBLUE = '\033[94m'
OKGREEN = '\033[92m'
... | password123456/lotto | get_recent_lotto.py | Python | apache-2.0 | 1,787 |
# Copyright (c) 2010-2011 OpenStack, LLC.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to ... | genius1611/Keystone | keystone/logic/types/user.py | Python | apache-2.0 | 9,678 |
# Copyright (c) 2015 The Pycroft Authors. See the AUTHORS file.
# This file is part of the Pycroft project and licensed under the terms of
# the Apache License, Version 2.0. See the LICENSE file for details.
from sqlalchemy import Column, ForeignKey, CheckConstraint, \
PrimaryKeyConstraint, func, or_, and_, true, ... | agdsn/pycroft | pycroft/model/traffic.py | Python | apache-2.0 | 8,996 |
#!/usr/bin/env python
# Copyright 2020 gRPC authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... | nicolasnoble/grpc | tools/run_tests/run_xds_tests.py | Python | apache-2.0 | 148,710 |
#-*- coding: utf-8 -*-
'''
Created on Jul 4, 2013
@author: jin
'''
from django.contrib import admin
from apps.agent.models import Client, RecommendRecord
class ClientAdmin(admin.ModelAdmin):
search_fields = ('username','user_username','IDCard')
class RecommendRecordAdmin(admin.ModelAdmin):
search_fields = ... | SnailJin/house | apps/agent/admin.py | Python | apache-2.0 | 461 |
#!/usr/bin/env python
"""
Created by _UserName_
11/28/2013
"""
import Connect, DB
import uuid
def Register():
# Generate A Unique Idenfifier
ident = uuid.uuid4().hex
# Allow For Database Manipulation
database = DB.DB()
# Create Database
database.create()
# Add Self To Datab... | Us3rNam/F2F-Network | Register.py | Python | artistic-2.0 | 398 |
"""
hmmer module
"""
from __future__ import print_function
from mungo.mungoCore import *
import blast, sequence
from mungo.useful import smartopen, extractRootName, ClassFromDict, warnDeprecated
import sys, re, warnings
hmmer2frame = {0: 1, 1: 2, 2: 3, 3: -1, 4: -2, 5: -3}
frame2hmmer = dict([(v,k) for k,v in hmmer... | PapenfussLab/Mungo | mungo/hmmer.py | Python | artistic-2.0 | 15,959 |
#! /usr/bin/env python
"""
stats -- Prints some channel information.
disconnect -- Disconnect the bot. The bot will try to reconnect
after 60 seconds.
die -- Let the bot cease to exist.
"""
import liblo
import irc.bot
import irc.strings
from irc.client import ip_numstr_to_quad, ip_quad_... | sonoprob/0x56 | bot/py/ircoscbot.py | Python | artistic-2.0 | 3,668 |
# -*- 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 'Event.location'
db.add_column(u'calendar_event', 'location',
self.gf('... | orlenko/sfpirg | mezzanine/calendar/migrations/0006_auto__add_field_event_location__add_field_event_link_url.py | Python | bsd-2-clause | 12,037 |
from django.conf import settings
from django.db.models.loading import get_model
from models import MasterSetting, SettingTypes
def get(name, default=None):
try:
setting = MasterSetting.objects.get(name=name)
if setting.type == SettingTypes.INT:
return int(setting.value)
elif se... | MasterAlish/django-ma-settings | ma_settings/master_settings.py | Python | bsd-2-clause | 1,876 |
# coding: utf-8
"""
MINDBODY Public API
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501
OpenAPI spec version: v6
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from __future__ import absolute_import
impo... | mindbody/API-Examples | SDKs/Python/test/test_get_session_types_request.py | Python | bsd-2-clause | 1,006 |
# Copyright (c) 2003-present, Jodd Team (http://jodd.org)
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice,
# thi... | vilmospapp/jodd | jodd-core/src/main/python/ConvertBean.py | Python | bsd-2-clause | 4,825 |
#!/usr/bin/env python
#
# :copyright: (c) 2013 by Mike Taylor
# :author: Mike Taylor
# :license: BSD 2-Clause
#
# See LICENSE file for details
#
import os
import time
import json
import argparse
import pyrax
_data_centers = [ 'DFW', 'ORD' ]
_commands = [ 'list' ]
_config_file = '~/.rackspace.... | bear/rsinfo | rsinfo.py | Python | bsd-2-clause | 6,094 |
# Example: How to prepare a new refund with the Mollie API.
#
import os
from mollie.api.client import Client
from mollie.api.error import Error
def main():
try:
#
# Initialize the Mollie API library with your API key.
#
# See: https://www.mollie.com/dashboard/settings/profiles
... | mollie/mollie-api-python | examples/11-refund-payment.py | Python | bsd-2-clause | 1,522 |
# -*- coding: utf-8 -*-
# This code is distributed under the two-clause BSD license.
# Copyright (c) 2012-2013 Raphaël Barrois
from __future__ import absolute_import, unicode_literals
import logging
from django.core import exceptions
from django.db import models
from . import conf
PERM_USER = 'user'
PERM_GROUP_... | Polytechnique-org/django-authgroupex | django_authgroupex/auth.py | Python | bsd-2-clause | 8,966 |
#!/usr/bin/env python
from __future__ import print_function
import json
import logging
from .taxon_concept_node import TaxonConceptSemNode
from .verbatim_name import VerbatimSemNode
from .names_for_ranks import (GenusGroupSemNode,
HigherGroupSemNode,
Specimen... | mtholder/taxalotl | taxalotl/sem_graph/graph.py | Python | bsd-2-clause | 13,901 |
import codecs
import six
from builtins import super
from builtins import range
import struct
import time
class InvalidPacketError(Exception):
pass
class BootloaderError(Exception):
pass
class BootloaderTimeoutError(BootloaderError):
pass
# TODO: Implement Security key functionality
class BootloaderK... | arachnidlabs/cyflash | cyflash/protocol.py | Python | bsd-2-clause | 15,768 |
"""
Django settings for d3matt project.
For more information on this file, see
https://docs.djangoproject.com/en/1.6/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.6/ref/settings/
"""
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
imp... | d3matt/d3matt.com | src/d3matt/d3matt/settings.py | Python | bsd-2-clause | 2,826 |
"""
Copyright (c) 2013 The Regents of the University of California, AMERICAN INSTITUTES FOR RESEARCH
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the abo... | CSSIP-AIR/PatentsProcessor | start.py | Python | bsd-2-clause | 7,205 |
import json
import re
from kqml import KQMLString
from .kqml_list import KQMLList
from .kqml_token import KQMLToken
from .kqml_exceptions import KQMLException
class CLJsonConverter(object):
def __init__(self, token_bools=False):
self.token_bools = token_bools
def cl_from_json(self, json_obj):
... | bgyori/pykqml | kqml/cl_json.py | Python | bsd-2-clause | 6,768 |
import csv
import os
from json import loads
from os.path import exists
from old.project import CassandraInsert
from old.project import CassandraUtils
cassandra = CassandraUtils()
QTD_STS_KEY = 'quotedStatus'
RTD_STS_KEY = 'retweetedStatus'
MT_STS_KEY = 'userMentionEntities'
def check_mention_entities(tweet):
r... | jblupus/PyLoyaltyProject | old/project/integration/to_files2.py | Python | bsd-2-clause | 7,009 |
"""
Environment variable configuration loading class.
Using a class here doesn't really model anything but makes state passing (in a
situation requiring it) more convenient.
This module is currently considered private/an implementation detail and should
not be included in the Sphinx API documentation.
"""
import os
... | mkusz/invoke | invoke/env.py | Python | bsd-2-clause | 4,077 |
#
# Polymorphic Mixins
#
from silverflask import db
from sqlalchemy.ext.declarative import declared_attr
from silverflask.helper import classproperty
class PolymorphicMixin(object):
type = db.Column(db.String(50))
@declared_attr
def __mapper_args__(cls):
if hasattr(cls, '__versioned_draft_class__... | wolfv/SilverFlask | silverflask/mixins/PolymorphicMixin.py | Python | bsd-2-clause | 850 |
from speakeasy import app
app.run(debug=True)
| TinnedTuna/speakeasyspeeches | wsgi/run.py | Python | bsd-2-clause | 46 |
"""
OpenVZ containers
=================
"""
from contextlib import contextmanager
import hashlib
import os
import posixpath
import tempfile
from fabric.api import (
env,
hide,
output,
settings,
sudo,
)
from fabric.operations import (
_AttributeString,
_execute,
_prefix_commands,
_p... | bitmonk/fabtools | fabtools/openvz/contextmanager.py | Python | bsd-2-clause | 9,146 |
# -*- coding: utf-8 -*-
# Generated by Django 1.9.5 on 2016-04-29 07:17
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('crimeprediction', '0003_auto_20160406_1610'),
]
operations = [
migrations.RemoveFiel... | jayArnel/crimemapping | crimeprediction/migrations/0004_auto_20160429_0717.py | Python | bsd-2-clause | 586 |
import unittest
import tempfile
import shutil
import os
from simlammps.io.lammps_data_file_parser import LammpsDataFileParser
from simlammps.io.lammps_simple_data_handler import LammpsSimpleDataHandler
class TestLammpsSimpleDataHandler(unittest.TestCase):
""" Tests the data reader class
"""
def setUp(se... | simphony/simphony-lammps-md | simlammps/io/tests/test_lammps_simple_data_handler.py | Python | bsd-2-clause | 2,811 |
from django.conf import settings
class Breadcrumb(object):
"""
A single breadcrumb, which is a 1:1 mapping to a view.
This is simply a wrapper class for the template tag.
"""
def __init__(self, name, url):
self.name = name
self.url = url
class Breadcrumbs(object):
"""
The s... | sjkingo/django-breadcrumbs3 | breadcrumbs3/middleware.py | Python | bsd-2-clause | 2,010 |
# -*- coding: utf-8 -*-
import json
import logging
from django.conf import settings
from django.contrib.auth.decorators import login_required
from django.views.decorators.http import last_modified as cache_last_modified
from django.views.decorators.cache import never_cache as force_cache_validation
from django.core.ca... | camillemonchicourt/Geotrek | geotrek/core/views.py | Python | bsd-2-clause | 6,257 |
class LimeError(Exception):
"""Raise for errors"""
| marcotcr/lime | lime/exceptions.py | Python | bsd-2-clause | 55 |
import re
from streamlink.plugin import Plugin
from streamlink.plugin.api import validate
YOUTUBE_URL = "https://www.youtube.com/watch?v={0}"
_url_re = re.compile(r'http(s)?://www\.skai.gr/.*')
_youtube_id = re.compile(r'<span\s+itemprop="contentUrl"\s+href="(.*)"></span>', re.MULTILINE)
_youtube_url_schema = validat... | back-to/streamlink | src/streamlink/plugins/skai.py | Python | bsd-2-clause | 889 |
from django.contrib.auth import authenticate, login, logout
from django.shortcuts import redirect, render
from users.forms import UserCreationForm
def create_user_account(request):
if request.method == 'POST':
form = UserCreationForm(request.POST)
if form.is_valid():
form.save()
... | kbarnes3/BaseDjangoSite | web/users/views.py | Python | bsd-2-clause | 696 |
# The Nexus software is licensed under the BSD 2-Clause license.
#
# You should have recieved a copy of this license with the software.
# If you did not, you can find one at the following link.
#
# http://opensource.org/licenses/bsd-license.php
entitylist.append(["confetti",(x,y,z),6,6])
| TheArchives/Nexus | core/entities/confetti_create.py | Python | bsd-2-clause | 291 |
from .api import *
from .reduction import Reduce
from .cudadrv.devicearray import (device_array, device_array_like, pinned,
pinned_array, pinned_array_like, to_device, auto_device)
from .cudadrv import devicearray
from .cudadrv.devices import require_context, gpus
from .cudadrv.devices import get_co... | sklam/numba | numba/cuda/simulator/__init__.py | Python | bsd-2-clause | 1,170 |
from confduino.boardlist import boards_txt
from entrypoint2 import entrypoint
import logging
log = logging.getLogger(__name__)
@entrypoint
def remove_board(board_id):
"""remove board.
:param board_id: board id (e.g. 'diecimila')
:rtype: None
"""
log.debug('remove %s', board_id)
lines = boa... | ponty/confduino | confduino/boardremove.py | Python | bsd-2-clause | 452 |
import time
import os
import threading
import collections
from xlog import getLogger
xlog = getLogger("cloudflare_front")
xlog.set_buffer(500)
import simple_http_client
from config import config
import http_dispatcher
import connect_control
import check_ip
class Front(object):
name = "cloudflare_front"
def ... | qqzwc/XX-Net | code/default/x_tunnel/local/cloudflare_front/front.py | Python | bsd-2-clause | 6,638 |
import warnings
import numpy as np
import numbers
import collections
from warnings import warn
from scipy.sparse import csr_matrix
from scipy.spatial.distance import cdist
from menpo.transform import WithDims
from .base import Shape
def bounding_box(closest_to_origin, opposite_corner):
r"""
Return a boundi... | grigorisg9gr/menpo | menpo/shape/pointcloud.py | Python | bsd-3-clause | 48,399 |
from typing import List, Iterable, Type
import gzip
import numpy as np
def get_string_vector_reader(dtype: Type = np.float32, columns: int = None):
"""Get a reader for vectors encoded as whitespace-separated numbers"""
def process_line(line: str, lineno: int, path: str) -> np.ndarray:
numbers = line.s... | bastings/neuralmonkey | neuralmonkey/readers/string_vector_reader.py | Python | bsd-3-clause | 1,449 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import djangocms_text_ckeditor.fields
def migrate_club_journal(apps, schema_editor):
import re
ClubJournalEntry = apps.get_model('domecek', 'ClubJournalEntry')
for entry in ClubJournalEntry.objec... | misli/django-domecek | domecek/migrations/0012_new_clubjournalentry.py | Python | bsd-3-clause | 2,269 |
# -*- coding: utf-8 -*-
from django.shortcuts import render
from django.http import HttpResponse
from .models import Story
def index(request):
stories = Story.objects.order_by('score')
return render(request, 'reader/stories.html', {'stories': stories})
| n3bukadn3zar/reservo | reservo/reader/views.py | Python | bsd-3-clause | 263 |
__version__ = '0.1dev'
import argparse
import string
import re
from rap.processing_unit import ProcessingUnit
from rap.program import Program, ProgramError
input_pair_regex = re.compile("^\s*([a-zA-Z0-9]+)\s*:\s*([0-9]+)\s*$")
def parse_input(string, sep=',', pair_regex=input_pair_regex):
registers = {}
f... | lemon24/rap | rap/__init__.py | Python | bsd-3-clause | 5,176 |
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'pygesture/ui/templates/process_widget_template.ui'
#
# Created by: PyQt5 UI code generator 5.4.2
#
# WARNING! All changes made in this file will be lost!
from PyQt5 import QtCore, QtGui, QtWidgets
class Ui_ProcessWidget(object):
def se... | ixjlyons/pygesture | pygesture/ui/templates/process_widget_template.py | Python | bsd-3-clause | 3,894 |
# -#- coding: utf-8 -#-
import feedparser
from django.db import models
from django.utils.translation import ugettext_lazy as _
from leonardo.module.web.models import ContentProxyWidgetMixin
from leonardo.module.web.models import Widget
from leonardo.module.web.widgets.mixins import JSONContentMixin
from leonardo.modu... | django-leonardo/django-leonardo | leonardo/module/web/widget/feedreader/models.py | Python | bsd-3-clause | 888 |
# Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
The astropy.utils.iers package provides access to the tables provided by
the International Earth Rotation and Reference Systems Service, in
particular allowing interpolation of published UT1-UTC values for given
times. These are used in `astropy.time`... | bsipocz/astropy | astropy/utils/iers/iers.py | Python | bsd-3-clause | 31,536 |
from helper import CompatTestCase
from validator.compat import FX22_DEFINITION
class TestFX22Compat(CompatTestCase):
"""Test that compatibility tests for Gecko 22 are properly executed."""
VERSION = FX22_DEFINITION
def test_nsigh2(self):
self.run_regex_for_compat("nsIGlobalHistory2", is_js=True)... | mattbasta/amo-validator | tests/compat/test_gecko22.py | Python | bsd-3-clause | 1,747 |
from pylons import tmpl_context as c
from pylons import app_globals as g
from pylons.i18n import _
from r2.config import feature
from r2.controllers import add_controller
from r2.controllers.reddit_base import RedditController
from r2.lib.errors import errors
from r2.lib.require import require, RequirementException
fr... | madbook/reddit-plugin-gold | reddit_gold/controllers.py | Python | bsd-3-clause | 3,510 |
from django.http import HttpResponse
from error_capture_middleware import ErrorCaptureHandler
class PlainExceptionsMiddleware(ErrorCaptureHandler):
def handle(self, request, exception, tb):
return HttpResponse("\n".join(tb),
content_type="text/plain", status=500) | enderlabs/django-error-capture-middleware | src/error_capture_middleware/handlers/plain.py | Python | bsd-3-clause | 306 |
# Copyright 2015 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import os
import random
import unittest
from infra_libs.event_mon import router
from infra_libs.event_mon.log_request_lite_pb2 import LogRequestLite
DATA_... | nicko96/Chrome-Infra | infra_libs/event_mon/test/router_test.py | Python | bsd-3-clause | 1,648 |
# -*- coding: utf-8 -*-
from django.db import models, migrations
import django.utils.timezone
import django.contrib.auth.models
import django.core.validators
class Migration(migrations.Migration):
dependencies = [
('auth', '0006_require_contenttypes_0002'),
]
operations = [
migrations.... | GeoMatDigital/django-geomat | geomat/users/migrations/0001_initial.py | Python | bsd-3-clause | 3,014 |
from enum import Enum
from django.conf import settings
from django.utils.translation import npgettext_lazy, pgettext_lazy
from django_prices.templatetags import prices_i18n
from prices import Money
class OrderStatus:
DRAFT = 'draft'
UNFULFILLED = 'unfulfilled'
PARTIALLY_FULFILLED = 'partially fulfilled'
... | UITools/saleor | saleor/order/__init__.py | Python | bsd-3-clause | 8,246 |
from pprint import pprint as pp
from scout.load.transcript import load_transcripts
def test_load_transcripts(adapter, gene_bulk, transcripts_handle):
# GIVEN a empty database
assert sum(1 for i in adapter.all_genes()) == 0
assert sum(1 for i in adapter.transcripts()) == 0
# WHEN inserting a number o... | Clinical-Genomics/scout | tests/load/test_load_transcripts.py | Python | bsd-3-clause | 707 |
from __future__ import absolute_import, unicode_literals
from django.core.urlresolvers import reverse
from casepro.test import BaseCasesTest
class OrgExtCRUDLTest(BaseCasesTest):
def test_home(self):
url = reverse('orgs_ext.org_home')
self.login(self.admin)
response = self.url_get('unic... | praekelt/helpdesk | casepro/orgs_ext/tests.py | Python | bsd-3-clause | 382 |
from smtplib import SMTPException
from django.conf import settings
from django.core.mail import send_mail
from django.views.decorators.http import require_GET
from django.shortcuts import redirect
from django.template.loader import render_to_string
from django.contrib.auth.decorators import login_required
from django.c... | ResearchSoftwareInstitute/MyHPOM | myhpom/views/verification.py | Python | bsd-3-clause | 2,927 |
# -*- coding: utf-8 -*-
#
# django cms documentation build configuration file, created by
# sphinx-quickstart on Tue Sep 15 10:47:03 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.
#
... | czpython/django-cms | docs/conf.py | Python | bsd-3-clause | 8,185 |
# -*-coding:Utf-8 -*
# Copyright (c) 2010 DAVY Guillaume
# 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... | stormi/tsunami | src/secondaires/magie/sorts.py | Python | bsd-3-clause | 3,125 |
from tests.modules.ffi.base import BaseFFITest
from rpython.rtyper.lltypesystem import rffi
# Most of the stuff is still very vague.
# This is because lots of the constants had to be set to something in order to
# run some specs but the specs weren't about them.
class TestTypeDefs(BaseFFITest):
def test_it_is_kin... | babelsberg/babelsberg-r | tests/modules/ffi/test_ffi.py | Python | bsd-3-clause | 2,305 |
from django_sqlalchemy.test import *
from apps.blog.models import Category
class TestContains(object):
def setup(self):
Category.__table__.insert().execute({'name': 'Python'},
{'name': 'PHP'}, {'name': 'Ruby'}, {'name': 'Smalltalk'},
{'name': 'CSharp'}, {'name': 'Modula'}, {'name'... | brosner/django-sqlalchemy | tests/query/test_contains.py | Python | bsd-3-clause | 1,486 |
'''
script @ mandrewcito
'''
import cv2
import numpy as np
import sys
def callback(x):
x = cv2.getTrackbarPos('Kernel X','image')
y = cv2.getTrackbarPos('Kernel Y','image')
sigma = cv2.getTrackbarPos('sigma/100','image')
img =cv2.GaussianBlur(imgOrig,(x,y),sigma/100.0)
cv2.imshow('image',img)
# Get the to... | mandrewcito/EOpenCV | scriptExamples/gaussianFilter.py | Python | bsd-3-clause | 826 |
"""
SymPy core decorators.
The purpose of this module is to expose decorators without any other
dependencies, so that they can be easily imported anywhere in sympy/core.
"""
from functools import wraps
from sympify import SympifyError, sympify
def deprecated(func):
"""This is a decorator which can be used to mar... | ichuang/sympy | sympy/core/decorators.py | Python | bsd-3-clause | 3,543 |
from .models import CreateModel, DeleteModel, AlterModelTable, AlterUniqueTogether, AlterIndexTogether
from .fields import AddField, RemoveField, AlterField, RenameField
| denisenkom/django | django/db/migrations/operations/__init__.py | Python | bsd-3-clause | 170 |
# -*- coding: utf-8 -*-
"""
ulmo.ncdc.ghcn_daily.core
~~~~~~~~~~~~~~~~~~~~~~~~~
This module provides direct access to `National Climatic Data Center`_
`Global Historical Climate Network - Daily`_ dataset.
.. _National Climatic Data Center: http://www.ncdc.noaa.gov
.. _Global Historical Climat... | timcera/tsgettoolbox | src/tsgettoolbox/ulmo/ncdc/ghcn_daily/core.py | Python | bsd-3-clause | 9,898 |
import unittest
from sympy import sympify
from nineml.abstraction import (
Dynamics, AnalogSendPort, Alias,
AnalogReceivePort, AnalogReducePort, Regime, On,
OutputEvent, EventReceivePort, Constant, StateVariable, Parameter,
OnCondition, OnEvent, Trigger)
import nineml.units as un
from nineml.exceptions ... | INCF/lib9ML | test/unittests/abstraction_test/dynamics_test.py | Python | bsd-3-clause | 37,676 |
from django.db import models
class Place(models.Model):
name = models.CharField(max_length=128)
url = models.URLField(max_length=256, verify_exists=False)
date = models.DateTimeField(auto_now_add=True)
class Meta(object):
topsoil_exclude = ['date']
def get_absolute_url(self):
... | wooster/django-topsoil | tests/test_provider/testapp/models.py | Python | bsd-3-clause | 430 |
#!/usr/bin/env python
import glob
import os
for f in sorted(glob.glob('*.ini')):
print 'Running ' + f + '...'
os.system('./src/engine ' + f)
| timvdm/ComputerGraphics | run_engine.py | Python | bsd-3-clause | 151 |
from django.conf.urls import patterns, url
urlpatterns = patterns('ietf.secr.drafts.views',
url(r'^$', 'search', name='drafts'),
url(r'^add/$', 'add', name='drafts_add'),
url(r'^approvals/$', 'approvals', name='drafts_approvals'),
url(r'^dates/$', 'dates', name='drafts_dates'),
url(r'^nudge-report/... | wpjesus/codematch | ietf/secr/drafts/urls.py | Python | bsd-3-clause | 1,671 |
# -*- coding: utf-8 -*-
import os
from time import sleep
import nipype.interfaces.base as nib
import pytest
import nipype.pipeline.engine as pe
from nipype.pipeline.plugins.somaflow import soma_not_loaded
class InputSpec(nib.TraitedSpec):
input1 = nib.traits.Int(desc='a random int')
input2 = nib.traits.Int(... | mick-d/nipype | nipype/pipeline/plugins/tests/test_somaflow.py | Python | bsd-3-clause | 1,509 |
# -*- coding: utf-8 -*-
#
# Copyright (C) 2007-2009 Christopher Lenz
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution.
from datetime import datetime
import doctest
import os
import os.path
import shutil
from StringIO im... | ryanolson/couchdb-python | couchdb/tests/client.py | Python | bsd-3-clause | 26,584 |
#!/usr/bin/env python
"""
heatsequer plot window gui (2nd plot window) module
imported from plotwin.py when you plotexp() and set usegui=True
"""
# amnonscript
__version__ = "0.91"
import heatsequer as hs
import os
import sys
import numpy as np
import matplotlib as mpl
mpl.use('Qt5Agg')
import matplotlib.pyplot ... | amnona/heatsequer | heatsequer/plots/plotwingui.py | Python | bsd-3-clause | 28,472 |
import sys
import time
import traceback
import dis
from browser import document as doc, window, alert
from javascript import JSObject
# set height of container to 66% of screen
_height = doc.documentElement.clientHeight
_s = doc['container']
_s.style.height = '%spx' % int(_height * 0.66)
has_ace = True
try:
edit... | firmlyjin/brython | www/tests/editor.py | Python | bsd-3-clause | 2,743 |
from django.apps import AppConfig
from django.utils.translation import ugettext_lazy as _
class StaticgenAppConfig(AppConfig):
name = 'staticgen'
verbose_name = _('StaticGen')
| mishbahr/django-staticgen | staticgen/apps.py | Python | bsd-3-clause | 186 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# polyencoder
# Copyright 2015 Neil Freeman [email protected]
# 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 so... | fitnr/polyencoder | polyencoder/polyencode_layer.py | Python | bsd-3-clause | 3,370 |
# Configuration file for the Sphinx documentation builder.
#
# This file only contains a selection of the most common options. For a full
# list see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html
# -- Path setup --------------------------------------------------------------
# If ex... | OstapHEP/ostap | docs/conf.py | Python | bsd-3-clause | 2,147 |
import base64
import os
import tempfile
import zipfile
from cumulusci.core.utils import process_bool_arg
from cumulusci.salesforce_api.metadata import ApiDeploy
from cumulusci.tasks.salesforce import BaseSalesforceMetadataApiTask
from cumulusci.utils import zip_clean_metaxml
from cumulusci.utils import zip_inject_name... | e02d96ec16/CumulusCI | cumulusci/tasks/salesforce/Deploy.py | Python | bsd-3-clause | 4,641 |
from .store import (
Command, Store, RemoteStore, PubSub, PubSubClient,
parse_store_url, create_store, register_store, data_stores,
NoSuchStore
)
from .channels import Channels
from . import redis # noqa
from .pulsards.startds import start_store
__all__ = [
'Command',
'Store',
'RemoteStore... | quantmind/pulsar | pulsar/apps/data/__init__.py | Python | bsd-3-clause | 496 |
# -*- coding:utf-8 -*-
from __future__ import (
absolute_import, division, print_function, unicode_literals
)
from unittest import mock, skipIf
import django
import pytest
from django.core.management import CommandError, call_command
from django.db.utils import ConnectionHandler
from django.test import SimpleTest... | nickmeharry/django-mysql | tests/testapp/management/commands/test_dbparams.py | Python | bsd-3-clause | 3,738 |
# -*- coding: utf-8 -*-
"""
Django settings for djangocali-portal project.
For more information on this file, see
https://docs.djangoproject.com/en/dev/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/dev/ref/settings/
"""
from __future__ import absolute_import, u... | Swappsco/portal | config/settings/common.py | Python | bsd-3-clause | 9,483 |
# -*- coding: utf-8 -*-
#
# Smisk documentation build configuration file, created by
# sphinx-quickstart on Sun Oct 26 20:24:33 2008.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# The contents of this file are pickled, so don't put values in the namespace
# that aren't pickleabl... | rsms/tc | docs/source/conf.py | Python | bsd-3-clause | 5,778 |
# -*- coding: utf-8 -*-
# /etl/database.py
"""Database module, including the SQLAlchemy database object and DB-related utilities."""
from sqlalchemy.orm import relationship
from .compat import basestring
from .extensions import db
# Alias common SQLAlchemy names
Column = db.Column
relationship = relationship
clas... | tomtom92/etl | etl/database.py | Python | bsd-3-clause | 2,331 |
# -*- coding: utf-8 -*-
# Copyright (c) 2015, Vispy Development Team.
# Distributed under the (new) BSD License. See LICENSE.txt for more info.
from __future__ import division
import re
from ... import gloo
class Compiler(object):
"""
Compiler is used to convert Function and Variable instances into
rea... | hronoses/vispy | vispy/visuals/shaders/compiler.py | Python | bsd-3-clause | 7,604 |
# Copyright 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Finds browsers that can be controlled by telemetry."""
import logging
from telemetry import decorators
from telemetry.internal.backends.chrome import an... | catapult-project/catapult-csm | telemetry/telemetry/internal/browser/browser_finder.py | Python | bsd-3-clause | 6,167 |
import os
from django.core.management.base import BaseCommand
from django.conf import settings
from fabtastic import db
class Command(BaseCommand):
args = '[<output_file_path>]'
help = 'Dumps a SQL backup of your entire DB. Defaults to CWD.'
def get_dump_path(self, db_alias):
... | duointeractive/django-fabtastic | fabtastic/management/commands/ft_dump_db.py | Python | bsd-3-clause | 1,185 |
# -*- coding: utf-8 -*-
import json
import datetime
from djangocms_text_ckeditor.cms_plugins import TextPlugin
from djangocms_text_ckeditor.models import Text
from django.contrib import admin
from django.contrib.admin.models import LogEntry
from django.contrib.admin.sites import site
from django.contrib.auth import ge... | timgraham/django-cms | cms/tests/test_admin.py | Python | bsd-3-clause | 63,904 |
# Copyright (c) 2010-2012 ARM Limited
# All rights reserved.
#
# The license below extends only to copyright in the software and shall
# not be construed as granting a license to any other intellectual
# property including but not limited to intellectual property relating
# to a hardware implementation of the functiona... | lokeshjindal15/gem5_transform | configs/common/FSConfig.py | Python | bsd-3-clause | 21,365 |