repo_name stringlengths 6 100 | path stringlengths 4 294 | copies stringlengths 1 5 | size stringlengths 4 6 | content stringlengths 606 896k | license stringclasses 15
values |
|---|---|---|---|---|---|
jelly/calibre | src/calibre/ebooks/oeb/reader.py | 1 | 28670 | """
Container-/OPF-based input OEBBook reader.
"""
from __future__ import with_statement
__license__ = 'GPL v3'
__copyright__ = '2008, Marshall T. Vandegrift <llasram@gmail.com>'
import sys, os, uuid, copy, re, cStringIO
from itertools import izip
from urlparse import urldefrag, urlparse
from urllib import unquote ... | gpl-3.0 |
csuttles/utils | python/todo-api/flask/lib/python2.7/site-packages/jinja2/parser.py | 336 | 35442 | # -*- coding: utf-8 -*-
"""
jinja2.parser
~~~~~~~~~~~~~
Implements the template parser.
:copyright: (c) 2010 by the Jinja Team.
:license: BSD, see LICENSE for more details.
"""
from jinja2 import nodes
from jinja2.exceptions import TemplateSyntaxError, TemplateAssertionError
from jinja2.lexer impo... | apache-2.0 |
openstack/tooz | tooz/partitioner.py | 1 | 3970 | # -*- coding: utf-8 -*-
#
# Copyright (C) 2016 Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless r... | apache-2.0 |
Spotipo/spotipo | tests/modules/analytics/test_methods.py | 1 | 1724 | import sys
import pytest
from flask import current_app,url_for
from flask_wtf import Form
from wtforms import TextField
from faker import Faker
import arrow
import uuid
import stripe
from unifispot.core.models import Wifisite,Device,Guesttrack,Guest
from unifispot.core.guestutils import init_track,validate_track,redi... | agpl-3.0 |
thinkopensolutions/tkobr-addons | tko_br_delivery_sale_stock/models/sale.py | 1 | 1879 |
from odoo import models, api, _
from odoo.exceptions import UserError
class SaleOrder(models.Model):
_inherit ='sale.order'
# do not create delivery line but set the value in total_frete
@api.multi
def delivery_set(self):
# Remove delivery products from the sale order
self._delivery_... | agpl-3.0 |
scrollback/kuma | kuma/wiki/views.py | 2 | 88560 | # coding=utf-8
from datetime import datetime
import json
import logging
import re
from urllib import urlencode
try:
from cStringIO import cStringIO as StringIO
except:
from StringIO import StringIO
import newrelic.agent
from pyquery import PyQuery as pq
from tower import ugettext_lazy as _lazy, ugettext as _
... | mpl-2.0 |
ktan2020/legacy-automation | win/Lib/site-packages/Crypto/Hash/SHA.py | 123 | 2841 | # -*- coding: utf-8 -*-
#
# ===================================================================
# The contents of this file are dedicated to the public domain. To
# the extent that dedication to the public domain is not available,
# everyone is granted a worldwide, perpetual, royalty-free,
# non-exclusive license to e... | mit |
deeplook/svglib | tests/test_samples.py | 1 | 16463 | #!/usr/bin/env python
"""Testsuite for svglib.
This tests conversion of sample SVG files into PDF files.
Some tests try using a tool called uniconv (if installed)
to convert SVG files into PDF for comparision with svglib.
Read ``tests/README.rst`` for more information on testing!
"""
import os
import glob
import re... | lgpl-3.0 |
nkhare/rockstor-core | src/rockstor/scripts/qgroup_clean.py | 2 | 2109 | """
Copyright (c) 2012-2015 RockStor, Inc. <http://rockstor.com>
This file is part of RockStor.
RockStor 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 la... | gpl-3.0 |
takayasaito/mikan | src/test/lib/googletest/test/gtest_list_tests_unittest.py | 292 | 6537 | #!/usr/bin/env python
#
# Copyright 2006, Google 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 copyright
# notice, this list... | gpl-3.0 |
ehashman/oh-mainline | vendor/packages/scrapy/scrapy/utils/queue.py | 16 | 4817 | from __future__ import with_statement
import os
import struct
import glob
from collections import deque
from scrapy.utils.py26 import json
class FifoMemoryQueue(object):
"""Memory FIFO queue."""
def __init__(self):
self.q = deque()
def push(self, obj):
self.q.appendleft(obj)
def p... | agpl-3.0 |
eadgarchen/tensorflow | tensorflow/contrib/timeseries/python/timeseries/state_space_models/kalman_filter_test.py | 66 | 18449 | # Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | apache-2.0 |
flamingspaz/remo | remo/voting/templatetags/helpers.py | 3 | 1709 | from django.db.models import Q
from django.contrib.auth.models import User
from django_jinja import library
from remo.base.utils import get_object_or_none
from remo.voting.models import Vote
@library.filter
def get_users_voted(poll):
"""Return the number of users voted to the specific poll."""
return poll.... | bsd-3-clause |
gelbander/blues | blues/rabbitmq.py | 2 | 2242 | """
RabbitMQ Blueprint
==================
**Fabric environment:**
.. code-block:: yaml
blueprints:
- blues.rabbitmq
"""
from fabric.decorators import task
from fabric.utils import abort
from refabric.api import run, info
from refabric.context_managers import sudo
from refabric.contrib import blueprints
... | mit |
horazont/aioxmpp | aioxmpp/shim/__init__.py | 1 | 1907 | ########################################################################
# File name: __init__.py
# This file is part of: aioxmpp
#
# LICENSE
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as
# published by the Free Software Foundat... | lgpl-3.0 |
mt2d2/servo | tests/wpt/harness/wptrunner/manifestupdate.py | 40 | 15142 | # This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this file,
# You can obtain one at http://mozilla.org/MPL/2.0/.
import os
import urlparse
from collections import namedtuple, defaultdict
from wptmanifest.node import (DataNode, Condi... | mpl-2.0 |
blueskycoco/rtt | bsp/mini2440/rtconfig.py | 1 | 2546 | import os
# panel options
# 'PNL_A70','PNL_N35', 'PNL_T35' , 'PNL_X35'
RT_USING_LCD_TYPE = 'PNL_T35'
# toolchains options
ARCH = 'arm'
CPU = 's3c24x0'
TextBase = '0x30000000'
CROSS_TOOL = 'keil'
if os.getenv('RTT_CC'):
CROSS_TOOL = os.getenv('RTT_CC')
if CROSS_TOOL == 'gcc':
PLATFORM = 'gcc'
... | gpl-2.0 |
danmergens/mi-instrument | mi/dataset/parser/common_regexes.py | 2 | 1902 | __author__ = 'mworden'
# A regex used to match any characters
ANY_CHARS_REGEX = r'.*'
# A regex used to match any characters
ANY_NON_SPACE_CHARS_REGEX = r'([^\s]*)'
# A regex used to match a single space
SPACE_REGEX = ' '
# A regex used to match the end of a line
END_OF_LINE_REGEX = r'(?:\r\n|\n)'
# A regex used ... | bsd-2-clause |
Ben-Baert/irail-cli | irail/commands/cmd_vehicle.py | 2 | 1102 | import click
from irail.cli import pass_context
from irail.commands.utils import *
import requests
from datetime import datetime, timedelta
from time import time
def is_on_the_move(vehicle):
current_time = time()
return (int(vehicle[0]["time"]) < int(current_time) and
int(vehicle[-1]["time"]) > int... | mit |
rohitw1991/frappe | frappe/widgets/query_report.py | 18 | 6318 | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
from __future__ import unicode_literals
import frappe
import os, json
from frappe import _
from frappe.modules import scrub, get_module_path
from frappe.utils import flt, cint, get_html_format
from frappe.translate... | mit |
bigswitch/snac-nox | src/nox/apps/directory/dm_ws_groups.py | 1 | 18122 | # Copyright 2008 (C) Nicira, Inc.
#
# This file is part of NOX.
#
# NOX 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.
#
# NOX is dist... | gpl-3.0 |
misterhat/youtube-dl | youtube_dl/extractor/mgoon.py | 177 | 2695 | # coding: utf-8
from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..utils import (
ExtractorError,
qualities,
unified_strdate,
)
class MgoonIE(InfoExtractor):
_VALID_URL = r'''(?x)https?://(?:www\.)?
(?:(:?m\.)?mgoon\.com/(?:ch/(?:.+)/v|play/view)|
... | unlicense |
laurentgo/pants | src/python/pants/backend/jvm/tasks/classpath_products.py | 1 | 3952 | # coding=utf-8
# Copyright 2015 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 os
from pant... | apache-2.0 |
kmarquardsen/kubernetes | cluster/juju/layers/kubeapi-load-balancer/reactive/load_balancer.py | 58 | 5962 | #!/usr/bin/env python
# Copyright 2015 The Kubernetes 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 appli... | apache-2.0 |
Y3K/django | django/core/urlresolvers.py | 59 | 26445 | """
This module converts requested URLs to callback view functions.
RegexURLResolver is the main class here. Its resolve() method takes a URL (as
a string) and returns a tuple in this format:
(view_function, function_args, function_kwargs)
"""
from __future__ import unicode_literals
import functools
import re
im... | bsd-3-clause |
MartinThoma/PyMySQL | pymysql/connections.py | 1 | 53902 | # Python implementation of the MySQL client-server protocol
# http://dev.mysql.com/doc/internals/en/client-server-protocol.html
# Error codes:
# http://dev.mysql.com/doc/refman/5.5/en/error-messages-client.html
from __future__ import print_function
from ._compat import PY2, range_type, text_type, str_type, JYTHON, IRON... | mit |
elbeardmorez/quodlibet | quodlibet/quodlibet/player/xinebe/player.py | 1 | 12177 | # -*- coding: utf-8 -*-
# Copyright 2006-2007 Lukas Lalinsky
#
# 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.
from gi.... | gpl-2.0 |
philanthropy-u/edx-platform | openedx/core/djangoapps/programs/tests/test_utils.py | 2 | 66265 | """Tests covering Programs utilities."""
import datetime
import json
import uuid
from copy import deepcopy
import ddt
import httpretty
import mock
from django.conf import settings
from django.urls import reverse
from django.test import TestCase
from django.test.utils import override_settings
from pytz import utc
from... | agpl-3.0 |
mihaip/readerisdead | reader_archive/reader_archive.py | 1 | 21719 | import argparse
import itertools
import json
import logging
import os.path
import urllib
import urllib2
import sys
import xml.etree.cElementTree as ET
import base.api
import base.atom
import base.log
import base.tag_helper
import base.url_fetcher
import base.worker
def main():
base.log.init()
base.atom.init()
... | apache-2.0 |
gs0510/coala-bears | tests/js/JSONFormatBearTest.py | 2 | 1777 | from bears.js import JSONFormatBear
from coalib.testing.LocalBearTestHelper import verify_local_bear
test_file1 = """{
"a": 5,
"b": 5
}"""
test_file2 = """{
"b": 5,
"a": 5
}"""
test_file3 = """{
"b": 5,
"a": 5
}"""
unicode_file = """{
"⌘": 5
}"""
JSONFormatBearTest = verify_local_bea... | agpl-3.0 |
naturalness/unnaturalcode | unnaturalcode/lex2json.py | 2 | 1607 | #!/bin/env python
from unnaturalcode import pythonSource
import os, sys, re, json
# parts taken from https://stackoverflow.com/questions/2212643/python-recursive-folder-read 2015-06-28
walk_dir = sys.argv[1]
#print('walk_dir = ' + walk_dir)
# If your current working directory may change during script execution, it... | agpl-3.0 |
mitocw/edx-platform | cms/djangoapps/contentstore/management/commands/tests/test_export_all_courses.py | 4 | 2084 | """
Test for export all courses.
"""
import shutil
from tempfile import mkdtemp
import six
from contentstore.management.commands.export_all_courses import export_courses_to_output_path
from xmodule.modulestore import ModuleStoreEnum
from xmodule.modulestore.django import modulestore
from xmodule.modulestore.tests.d... | agpl-3.0 |
tavaresdong/courses | ucb_cs61A/lab/lab01/lab01.py | 3 | 3533 | """Lab 1."""
# Boolean Operators
def both_positive(x, y):
"""Returns True if both x and y are positive.
>>> both_positive(-1, 1)
False
>>> both_positive(1, 1)
True
"""
return x > 0 and y > 0 # You can replace this line!
# If Statements
def xk(c, d):
if c == 4:
return 6
... | mit |
darktears/chromium-crosswalk | third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/views/buildbot_results.py | 17 | 8164 | # Copyright (C) 2012 Google 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 copyright
# notice, this list of conditions and the ... | bsd-3-clause |
masayoshi-nakamura/CognitiveArchitectureLecture | examples/brica_agent/tf/listener.py | 4 | 12709 | # Copyright (c) 2008, Willow Garage, 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 copyright
# notice, this list of co... | apache-2.0 |
drewmoore/python-koans | python3/koans/about_modules.py | 66 | 2375 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# This is very different to AboutModules in Ruby Koans
# Our AboutMultipleInheritance class is a little more comparable
#
from runner.koan import *
from .another_local_module import *
from .local_module_with_all_defined import *
class AboutModules(Koan):
def test_... | mit |
RayMick/scikit-learn | sklearn/metrics/classification.py | 95 | 67713 | """Metrics to assess performance on classification task given classe prediction
Functions named as ``*_score`` return a scalar value to maximize: the higher
the better
Function named as ``*_error`` or ``*_loss`` return a scalar value to minimize:
the lower the better
"""
# Authors: Alexandre Gramfort <alexandre.gram... | bsd-3-clause |
outofmem0ry/incubator-hawq | tools/bin/gppylib/db/dbconn.py | 7 | 9738 | #!/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
# "Li... | apache-2.0 |
Brett55/moto | moto/ec2/responses/vpn_connections.py | 8 | 13470 | from __future__ import unicode_literals
from moto.core.responses import BaseResponse
from moto.ec2.utils import filters_from_querystring
class VPNConnections(BaseResponse):
def create_vpn_connection(self):
type = self._get_param('Type')
cgw_id = self._get_param('CustomerGatewayId')
vgw_id... | apache-2.0 |
brucekg/xhtml2pdf | tests/test_utils.py | 89 | 8136 | #-*- coding: utf-8 -*-
from reportlab.lib.colors import Color
from unittest import TestCase
from xhtml2pdf.util import getCoords, getColor, getSize, getFrameDimensions, \
getPos, getBox
from xhtml2pdf.tags import int_to_roman
class UtilsCoordTestCase(TestCase):
def test_getCoords_simple(self):
... | apache-2.0 |
helloiloveit/VkxPhoneProject | submodules/externals/antlr3/runtime/Python/antlr3/streams.py | 11 | 45253 | """ANTLR3 runtime package"""
# begin[licence]
#
# [The "BSD licence"]
# Copyright (c) 2005-2008 Terence Parr
# 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 ... | gpl-2.0 |
vivekanand1101/neutron | neutron/tests/unit/plugins/brocade/test_brocade_vlan.py | 29 | 2002 | # Copyright (c) 2013 OpenStack Foundation.
#
# 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... | apache-2.0 |
DepthDeluxe/ansible | lib/ansible/plugins/connection/ssh.py | 18 | 40724 | # (c) 2012, Michael DeHaan <michael.dehaan@gmail.com>
# Copyright 2015 Abhijit Menon-Sen <ams@2ndQuadrant.com>
# Copyright 2017 Toshio Kuratomi <tkuratomi@ansible.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public Lice... | gpl-3.0 |
trezorg/django | django/conf/locale/ka/formats.py | 329 | 1888 | # -*- encoding: utf-8 -*-
# This file is distributed under the same license as the Django package.
#
# The *_FORMAT strings use the Django date format syntax,
# see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
DATE_FORMAT = 'l, j F, Y'
TIME_FORMAT = 'h:i:s a'
DATETIME_FORMAT = 'j F, Y h:i:s a'
YEA... | bsd-3-clause |
slashmili/alchemist.vim | t/erl_terms_test.py | 2 | 4704 | import erl_terms
import unittest
class Tests(unittest.TestCase):
def test_basic_atom(self):
hello = erl_terms._encode_atom('hello')
self.assertEqual(hello, b'd\x00\x05hello')
self.assertEqual(erl_terms._decode_atom(hello), "hello")
def test_basic_boolean(self):
true_term = er... | gpl-3.0 |
lakshayg/tensorflow | tensorflow/contrib/factorization/python/kernel_tests/masked_matmul_benchmark.py | 136 | 5711 | # Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | apache-2.0 |
ivandevp/django | django/contrib/gis/geos/coordseq.py | 374 | 5482 | """
This module houses the GEOSCoordSeq object, which is used internally
by GEOSGeometry to house the actual coordinates of the Point,
LineString, and LinearRing geometries.
"""
from ctypes import byref, c_double, c_uint
from django.contrib.gis.geos import prototypes as capi
from django.contrib.gis.geos.base import... | bsd-3-clause |
karllessard/tensorflow | tensorflow/python/ops/ragged/ragged_reverse_op_test.py | 14 | 3428 | # Copyright 2018 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | apache-2.0 |
MoKee/android_kernel_goldfish | tools/perf/util/setup.py | 4998 | 1330 | #!/usr/bin/python2
from distutils.core import setup, Extension
from os import getenv
from distutils.command.build_ext import build_ext as _build_ext
from distutils.command.install_lib import install_lib as _install_lib
class build_ext(_build_ext):
def finalize_options(self):
_build_ext.finalize_optio... | gpl-2.0 |
luzheqi1987/nova-annotation | nova/tests/unit/api/openstack/compute/contrib/test_cloudpipe.py | 1 | 8260 | # Copyright 2011 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... | apache-2.0 |
fengbaicanhe/intellij-community | python/lib/Lib/email/test/test_email_renamed.py | 134 | 118811 | # Copyright (C) 2001-2007 Python Software Foundation
# Contact: email-sig@python.org
# email package unit tests
import os
import sys
import time
import base64
import difflib
import unittest
import warnings
from cStringIO import StringIO
import email
from email.charset import Charset
from email.header import Header, ... | apache-2.0 |
mdrumond/tensorflow | tensorflow/python/ops/linalg/linear_operator_diag.py | 19 | 9005 | # Copyright 2016 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | apache-2.0 |
jscn/django | django/views/generic/dates.py | 64 | 25785 | from __future__ import unicode_literals
import datetime
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
from django.db import models
from django.http import Http404
from django.utils import timezone
from django.utils.encoding import force_str, force_text
from django.utils.func... | bsd-3-clause |
krieghan/kobold_python | kobold/tests/test_swap.py | 1 | 3135 | import asyncio
import unittest
from kobold import (
assertions,
compare,
doubles,
swap)
class Host(object):
def subject(self, arg, kwarg=None):
return "original subject"
async def subject_cr(self, arg, kwarg=None):
return "original subject"
class TestInstallP... | mit |
Allow2CEO/browser-ios | brave/node_modules/bloom-filter-cpp/vendor/depot_tools/third_party/gsutil/oauth2_plugin/oauth2_client_test.py | 51 | 13606 | # Copyright 2010 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | mpl-2.0 |
vmarkovtsev/django | django/utils/datastructures.py | 394 | 9231 | import copy
from collections import OrderedDict
from django.utils import six
class OrderedSet(object):
"""
A set which keeps the ordering of the inserted items.
Currently backs onto OrderedDict.
"""
def __init__(self, iterable=None):
self.dict = OrderedDict(((x, None) for x in iterable) ... | bsd-3-clause |
carlini/cleverhans | examples/multigpu_advtrain/utils_cifar.py | 1 | 5805 | """
https://github.com/renmengye/revnet-public/blob/master/resnet/data/cifar_input.py
MIT License
Copyright (c) 2017 Mengye Ren
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 restrictio... | mit |
WoLpH/CouchPotatoServer | libs/apscheduler/scheduler.py | 17 | 21031 | """
This module is the main part of the library. It houses the Scheduler class
and related exceptions.
"""
from threading import Thread, Event, Lock
from datetime import datetime, timedelta
from logging import getLogger
import os
import sys
from apscheduler.util import *
from apscheduler.triggers import SimpleTrigger... | gpl-3.0 |
marcoantoniooliveira/labweb | oscar/lib/python2.7/site-packages/django/contrib/gis/geos/prototypes/__init__.py | 314 | 1305 | """
This module contains all of the GEOS ctypes function prototypes. Each
prototype handles the interaction between the GEOS library and Python
via ctypes.
"""
# Coordinate sequence routines.
from django.contrib.gis.geos.prototypes.coordseq import (create_cs, get_cs,
cs_clone, cs_getordinate, cs_setordinate, cs... | bsd-3-clause |
evan-erdos/cboe | pkg/win/gen-data.py | 2 | 1087 |
from os.path import normpath as makepath
from glob import glob
import sys
root = makepath(sys.argv[1])
# To add directories to the list of sources to generate file lists from,
# simply edit this dictionary. The key is the directory path (relative to
# the build output directory), and the value is either a glob patte... | gpl-2.0 |
tensorflow/tfx | tfx/benchmarks/benchmark_utils.py | 1 | 1823 | # Copyright 2019 Google LLC. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | apache-2.0 |
CERN-Stage-3/vitess | py/net/bsonrpc.py | 6 | 3543 | # Copyright 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.
# Go-style RPC client using BSON as the codec.
import bson
import hmac
import struct
try:
# use optimized cbson which has slightly different API
import cbson
d... | bsd-3-clause |
felexx90/service.subtitles.subdivx | service.py | 1 | 21861 | # -*- coding: utf-8 -*-
# Subdivx.com subtitles, based on a mod of Undertext subtitles
# Adaptation: enric_godes@hotmail.com | Please use email address for your
# comments
# Port to XBMC 13 Gotham subtitles infrastructure: cramm, Mar 2014
from __future__ import print_function
from json import loads
import os
from os.p... | gpl-2.0 |
mikebenfield/scipy | scipy/spatial/tests/test_spherical_voronoi.py | 29 | 4636 | from __future__ import print_function
import numpy as np
from numpy.testing import (TestCase,
assert_almost_equal,
assert_array_equal,
assert_array_almost_equal)
from scipy.spatial import SphericalVoronoi, distance
from scipy.spatial impor... | bsd-3-clause |
muntasirsyed/intellij-community | python/helpers/docutils/writers/__init__.py | 49 | 4252 | # $Id: __init__.py 6111 2009-09-02 21:36:05Z milde $
# Author: David Goodger <goodger@python.org>
# Copyright: This module has been placed in the public domain.
"""
This package contains Docutils Writer modules.
"""
__docformat__ = 'reStructuredText'
import os.path
import docutils
from docutils import languages, Co... | apache-2.0 |
PriceChild/ansible | lib/ansible/modules/cloud/openstack/os_user_role.py | 49 | 6456 | #!/usr/bin/python
# Copyright (c) 2016 IBM
#
# This module 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.
#
# This software is distrib... | gpl-3.0 |
amith01994/intellij-community | python/lib/Lib/email/Parser.py | 392 | 3300 | # Copyright (C) 2001-2006 Python Software Foundation
# Author: Barry Warsaw, Thomas Wouters, Anthony Baxter
# Contact: email-sig@python.org
"""A parser of RFC 2822 and MIME email messages."""
__all__ = ['Parser', 'HeaderParser']
import warnings
from cStringIO import StringIO
from email.feedparser import FeedParser
... | apache-2.0 |
akhilari7/pa-dude | lib/python2.7/site-packages/wheel/signatures/keys.py | 471 | 3320 | """Store and retrieve wheel signing / verifying keys.
Given a scope (a package name, + meaning "all packages", or - meaning
"no packages"), return a list of verifying keys that are trusted for that
scope.
Given a package name, return a list of (scope, key) suggested keys to sign
that package (only the verifying key... | mit |
marcuskelly/recover | Lib/site-packages/Crypto/Cipher/_mode_ofb.py | 9 | 8502 | # -*- coding: utf-8 -*-
#
# Cipher/mode_ofb.py : OFB mode
#
# ===================================================================
# The contents of this file are dedicated to the public domain. To
# the extent that dedication to the public domain is not available,
# everyone is granted a worldwide, perpetual, royalty... | bsd-2-clause |
xujb/odoo | addons/l10n_us/__openerp__.py | 341 | 1763 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... | agpl-3.0 |
nabinhait/frappe | webnotes/install_lib/setup_public_folder.py | 34 | 1160 | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
# make public folders
from __future__ import unicode_literals
import os
import webnotes
def make(site=None):
"""make public folder symlinks if missing"""
from webnotes.utils import get_site_base_path, get_base_pa... | mit |
anandpdoshi/erpnext | erpnext/manufacturing/doctype/production_planning_tool/production_planning_tool.py | 1 | 17777 | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
from frappe.utils import cstr, flt, cint, nowdate, add_days, comma_and
from frappe import msgprint, _
from frappe.model.document import ... | agpl-3.0 |
bdastur/pyvim | .vim/bundle/python-mode/pymode/libs3/rope/base/oi/soa.py | 91 | 5618 | import rope.base.ast
import rope.base.oi.soi
import rope.base.pynames
from rope.base import pyobjects, evaluate, astutils, arguments
def analyze_module(pycore, pymodule, should_analyze,
search_subscopes, followed_calls):
"""Analyze `pymodule` for static object inference
Analyzes scopes for... | apache-2.0 |
MajorBiscuit/gr-tutorial | gr-tutorial/docs/doxygen/doxyxml/generated/indexsuper.py | 348 | 19286 | #!/usr/bin/env python
#
# Generated Thu Jun 11 18:43:54 2009 by generateDS.py.
#
import sys
import getopt
from string import lower as str_lower
from xml.dom import minidom
from xml.dom import Node
#
# User methods
#
# Calls to the methods in these classes are generated by generateDS.py.
# You can replace these metho... | gpl-3.0 |
yati-sagade/RyDyrect | django/test/utils.py | 185 | 3644 | import sys
import time
import os
import warnings
from django.conf import settings
from django.core import mail
from django.core.mail.backends import locmem
from django.test import signals
from django.template import Template
from django.utils.translation import deactivate
__all__ = ('Approximate', 'ContextList', 'setu... | bsd-3-clause |
mfherbst/spack | var/spack/repos/builtin/packages/lua-mpack/package.py | 5 | 1786 | ##############################################################################
# Copyright (c) 2013-2018, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
# This file is part of Spack.
# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
# LLNL-CODE-64... | lgpl-2.1 |
shawnadelic/shuup | shuup/xtheme/plugins/_base.py | 2 | 8136 | # -*- coding: utf-8 -*-
# This file is part of Shuup.
#
# Copyright (c) 2012-2016, Shoop Ltd. All rights reserved.
#
# This source code is licensed under the AGPLv3 license found in the
# LICENSE file in the root directory of this source tree.
from __future__ import unicode_literals
from django.template.loader import ... | agpl-3.0 |
sudheesh001/oh-mainline | mysite/profile/migrations/0068_add_homepage_url_models.py | 17 | 13507 | # This file is part of OpenHatch.
# Copyright (C) 2010 OpenHatch, Inc.
#
# This program 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 option) any later v... | agpl-3.0 |
uwosh/uwosh.emergency.client | uwosh/emergency/client/tests.py | 1 | 1484 | import unittest
from zope.testing import doctestunit
from zope.component import testing
from Testing import ZopeTestCase as ztc
from Products.Five import zcml
from Products.Five import fiveconfigure
from Products.PloneTestCase import PloneTestCase as ptc
from Products.PloneTestCase.layer import PloneSite
ptc.setupPlo... | gpl-2.0 |
akamel001/Sick-Beard | lib/unidecode/x098.py | 252 | 4645 | data = (
'Hu ', # 0x00
'Ye ', # 0x01
'Ding ', # 0x02
'Qing ', # 0x03
'Pan ', # 0x04
'Xiang ', # 0x05
'Shun ', # 0x06
'Han ', # 0x07
'Xu ', # 0x08
'Yi ', # 0x09
'Xu ', # 0x0a
'Gu ', # 0x0b
'Song ', # 0x0c
'Kui ', # 0x0d
'Qi ', # 0x0e
'Hang ', # 0x0f
'Yu ', # 0x10
'Wan '... | gpl-3.0 |
trondhindenes/ansible | test/units/modules/network/f5/test_bigip_gtm_monitor_tcp_half_open.py | 8 | 5629 | # -*- coding: utf-8 -*-
#
# Copyright: (c) 2017, F5 Networks Inc.
# GNU General Public License v3.0 (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import os
import json
import pytest
import sys
from nose.plugins.skip i... | gpl-3.0 |
vipins/ccccms | env/Lib/site-packages/django/contrib/gis/db/backends/oracle/operations.py | 45 | 12472 | """
This module contains the spatial lookup types, and the `get_geo_where_clause`
routine for Oracle Spatial.
Please note that WKT support is broken on the XE version, and thus
this backend will not work on such platforms. Specifically, XE lacks
support for an internal JVM, and Java libraries are required to use... | bsd-3-clause |
Dineshs91/youtube-dl | youtube_dl/extractor/pladform.py | 103 | 3156 | # coding: utf-8
from __future__ import unicode_literals
from .common import InfoExtractor
from ..utils import (
ExtractorError,
int_or_none,
xpath_text,
qualities,
)
class PladformIE(InfoExtractor):
_VALID_URL = r'''(?x)
https?://
(?:
... | unlicense |
dl1ksv/gnuradio | gr-analog/python/analog/qa_fastnoise.py | 5 | 5725 | #!/usr/bin/env python
#
# Copyright 2007,2010,2012 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# SPDX-License-Identifier: GPL-3.0-or-later
#
#
from gnuradio import gr, gr_unittest, analog, blocks
import numpy
class test_fastnoise_source(gr_unittest.TestCase):
def setUp(self):
se... | gpl-3.0 |
tectronics/faint-graphics-editor | py/test/src/html_index.py | 3 | 1560 | import os
def _urlify(f):
f = f.replace('C:\\', 'C:/')
f = f.replace('\\', '/')
f = 'file://' + f
return f
def target_name(source_file_path, target_type):
"""Returns the target file name from the source svg file path."""
# Fixme: Move elsewhere
ext = '.' + target_type
bas... | apache-2.0 |
HuBandiT/trelby | src/titlesdlg.py | 6 | 16000 | import gutil
import misc
import pdf
import pml
import titles
import util
import copy
import wx
class TitlesDlg(wx.Dialog):
def __init__(self, parent, titles, cfg, cfgGl):
wx.Dialog.__init__(self, parent, -1, "Title pages",
style = wx.DEFAULT_DIALOG_STYLE)
self.titles =... | gpl-2.0 |
joshmoore/openmicroscopy | components/tools/OmeroWeb/omeroweb/webgateway/webgateway_cache.py | 1 | 30403 | #
# webgateway/webgateway_cache - web cache handler for webgateway
#
# Copyright (c) 2008, 2009 Glencoe Software, Inc. All rights reserved.
#
# This software is distributed under the terms described by the LICENCE file
# you can find at the root of the distribution bundle, which states you are
# free to use it only f... | gpl-2.0 |
nguyentu1602/statsmodels | statsmodels/nonparametric/bandwidths.py | 23 | 4412 | from __future__ import division
import numpy as np
from scipy.stats import scoreatpercentile as sap
from statsmodels.sandbox.nonparametric import kernels
#from scipy.stats import norm
def _select_sigma(X):
"""
Returns the smaller of std(X, ddof=1) or normalized IQR(X) over axis 0.
References
-------... | bsd-3-clause |
ernstp/kivy | examples/canvas/lines.py | 32 | 6172 | '''
Line (SmoothLine) Experiment
============================
This demonstrates the experimental and unfinished SmoothLine feature
for fast line drawing. You should see a multi-segment
path at the top of the screen, and sliders and buttons along the bottom.
You can click to add new points to the segment, change the tr... | mit |
yodalee/servo | tests/wpt/css-tests/tools/pywebsocket/src/test/test_endtoend.py | 449 | 26811 | #!/usr/bin/env python
#
# Copyright 2012, Google 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 copyright
# notice, this list... | mpl-2.0 |
yordan-desta/QgisIns | python/ext-libs/owslib/fes.py | 29 | 16239 | # -*- coding: ISO-8859-15 -*-
# =============================================================================
# Copyright (c) 2009 Tom Kralidis
#
# Authors : Tom Kralidis <tomkralidis@gmail.com>
#
# Contact email: tomkralidis@gmail.com
# =============================================================================
"""... | gpl-2.0 |
deka108/meas_deka | apiv2/serializers_hyperlink.py | 2 | 4568 | from django.contrib.auth.models import User
from rest_framework import serializers
# from drf_haystack.serializers import HaystackSerializer
# from search.search_indexes import QuestionIndex
from apiv2.models import *
class EducationLevelSerializer(serializers.HyperlinkedModelSerializer):
class Meta:
mo... | apache-2.0 |
aperigault/ansible | lib/ansible/utils/shlex.py | 267 | 1279 | # (c) 2015, Marius Gedminas <marius@gedmin.as>
#
# This file is part of Ansible
#
# Ansible 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 vers... | gpl-3.0 |
splunk/splunk-sdk-python | examples/explorer/explorer.py | 2 | 2293 | #!/usr/bin/env python
#
# Copyright 2011-2015 Splunk, 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... | apache-2.0 |
johnlb/strange_wp | strange_bak/tests/test_text.py | 1 | 25260 | # coding: utf-8
"""
weasyprint.tests.test_text
--------------------------
Test the text layout.
:copyright: Copyright 2011-2014 Simon Sapin and contributors, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
from __future__ import division, unicode_literals
from ..css impor... | gpl-3.0 |
cisco-openstack/tempest | tempest/tests/lib/services/compute/test_migrations_client.py | 7 | 2017 | # Copyright 2015 NEC 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 required ... | apache-2.0 |
seem-sky/FrameworkBenchmarks | php-yaf/setup.py | 5 | 1351 | import subprocess
import sys
import setup_util
from os.path import expanduser
home = expanduser("~")
def start(args, logfile, errfile):
setup_util.replace_text("php-yaf/app/conf/application.ini", "host=localhost", "host="+ args.database_host +"")
setup_util.replace_text("php-yaf/deploy/nginx.conf", "root .*\/Fram... | bsd-3-clause |
stephanepechard/mediapp | mediapp/libs/kaa_metadata/audio/ID3.py | 3 | 4330 | # -*- coding: iso-8859-1 -*-
# -----------------------------------------------------------------------------
# id3.py - id3 listings
# -----------------------------------------------------------------------------
# $Id: ID3.py 2236 2006-12-15 15:13:47Z dmeyer $
#
# ------------------------------------------------------... | gpl-3.0 |
SebDieBln/QGIS | python/ext-libs/pygments/formatters/latex.py | 264 | 13946 | # -*- coding: utf-8 -*-
"""
pygments.formatters.latex
~~~~~~~~~~~~~~~~~~~~~~~~~
Formatter for LaTeX fancyvrb output.
:copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
from pygments.formatter import Formatter
from pygments.token import T... | gpl-2.0 |
bolkedebruin/airflow | tests/providers/amazon/aws/operators/test_s3_copy_object.py | 1 | 4133 | # -*- 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
#... | apache-2.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.