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 |
|---|---|---|---|---|---|
chrislit/abydos | tests/distance/test_distance_canberra.py | 1 | 2809 | # Copyright 2019-2020 by Christopher C. Little.
# This file is part of Abydos.
#
# Abydos 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 versio... | gpl-3.0 |
imbasimba/astroquery | astroquery/utils/tap/xmlparser/sharedItemsSaxParser.py | 2 | 3840 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
=============
TAP plus
=============
@author: Javier Duran
@contact: javier.duran@sciops.esa.int
European Space Astronomy Centre (ESAC)
European Space Agency (ESA)
Created on 28 sep. 2018
"""
import xml.sax
from astroquery.utils.tap.xmlparser im... | bsd-3-clause |
sxjscience/tvm | python/tvm/topi/nn/conv2d_transpose.py | 1 | 6465 | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | apache-2.0 |
piece601/Openkore | src/scons-local-2.0.1/SCons/Tool/MSCommon/vs.py | 61 | 18216 | #
# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without li... | gpl-2.0 |
mwmuni/LIGGGHTS_GUI | OpenGL/raw/GL/ARB/tessellation_shader.py | 9 | 3282 | '''Autogenerated by xml_generate script, do not edit!'''
from OpenGL import platform as _p, arrays
# Code generation uses this
from OpenGL.raw.GL import _types as _cs
# End users want this...
from OpenGL.raw.GL._types import *
from OpenGL.raw.GL import _errors
from OpenGL.constant import Constant as _C
import ctypes
_... | gpl-3.0 |
flywheel-io/gears | gears/generator.py | 2 | 5568 |
"""
Flywheel Gear manifest generator
"""
import argparse
import copy
import json
import os
import sys
# Normal validation can happen via jsonschema. For validating a schema itself, Draft4Validator is used.
import jsonschema
from jsonschema import Draft4Validator
# jsonschema will silently ignore manifest URI format... | mit |
hughperkins/coriander | test/test_memcpy.py | 2 | 1595 | # Copyright Hugh Perkins 2017
"""
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
... | apache-2.0 |
mislavcimpersak/anydo-widget | anydo.widget/requests/packages/urllib3/util/ssl_.py | 39 | 8840 | from binascii import hexlify, unhexlify
from hashlib import md5, sha1, sha256
from ..exceptions import SSLError
SSLContext = None
HAS_SNI = False
create_default_context = None
import errno
import ssl
try: # Test for SSL features
from ssl import wrap_socket, CERT_NONE, PROTOCOL_SSLv23
from ssl import HAS_S... | mit |
corvorepack/REPOIVAN | plugin.video.movie.ultra.7k/resources/lib/unpackerjs.py | 17 | 3102 | # -*- coding: utf-8 -*-
#------------------------------------------------------------
# pelisalacarta - XBMC Plugin
# Descifra el empaquetado javascript PACK de Dean Edwards
# No está bien probado, así que no garantizo que funcione aunque en los casos de este plugin va muy bien :)
# http://blog.tvalacarta.info/plugin-x... | gpl-2.0 |
amitjamadagni/sympy | sympy/statistics/distributions.py | 1 | 14654 | from sympy.core import sympify, Lambda, Dummy, Integer, Rational, oo, Float, pi
from sympy.functions import sqrt, exp, erf
from sympy.printing import sstr
import random
class Sample(tuple):
"""
Sample([x1, x2, x3, ...]) represents a collection of samples.
Sample parameters like mean, variance and stddev c... | bsd-3-clause |
sharpdeep/pyspider | pyspider/fetcher/tornado_fetcher.py | 55 | 19305 | #!/usr/bin/env python
# -*- encoding: utf-8 -*-
# vim: set et sw=4 ts=4 sts=4 ff=unix fenc=utf8:
# Author: Binux<i@binux.me>
# http://binux.me
# Created on 2012-12-17 11:07:19
from __future__ import unicode_literals
import six
import copy
import time
import json
import logging
import threading
import tornado.... | apache-2.0 |
cortedeltimo/SickRage | lib/bencode/__init__.py | 171 | 3305 | # The contents of this file are subject to the BitTorrent Open Source License
# Version 1.1 (the License). You may not copy or use this file, in either
# source code or executable form, except in compliance with the License. You
# may obtain a copy of the License at http://www.bittorrent.com/license/.
#
# Software di... | gpl-3.0 |
JianfengXu/crosswalk-test-suite | webapi/tct-appcache-html5-tests/inst.xpk.py | 456 | 6809 | #!/usr/bin/env python
import os
import shutil
import glob
import time
import sys
import subprocess
import string
from optparse import OptionParser, make_option
SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
PKG_NAME = os.path.basename(SCRIPT_DIR)
PARAMETERS = None
#XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=... | bsd-3-clause |
synergeticsedx/deployment-wipro | pavelib/utils/envs.py | 9 | 7203 | """
Helper functions for loading environment settings.
"""
from __future__ import print_function
import os
import sys
import json
from lazy import lazy
from path import Path as path
import memcache
class Env(object):
"""
Load information about the execution environment.
"""
# Root of the git reposito... | agpl-3.0 |
verma-varsha/zulip | zerver/webhooks/zapier/view.py | 8 | 1052 | from __future__ import absolute_import
from django.utils.translation import ugettext as _
from typing import Any, Callable, Dict
from django.http import HttpRequest, HttpResponse
from zerver.lib.actions import check_send_message
from zerver.lib.response import json_success, json_error
from zerver.decorator import REQ, ... | apache-2.0 |
tkaitchuck/nupic | py/regions/ImageSensorExplorers/ExhaustiveSweep.py | 2 | 11962 | # ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2013, 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... | gpl-3.0 |
lucidmotifs/auto-aoc | .venv/lib/python3.5/site-packages/pylint/test/unittest_checker_typecheck.py | 1 | 8353 | # -*- coding: utf-8 -*-
# Copyright (c) 2014 Google, Inc.
# Copyright (c) 2014 LOGILAB S.A. (Paris, FRANCE) <contact@logilab.fr>
# Copyright (c) 2014 Holger Peters <email@holger-peters.de>
# Copyright (c) 2015-2016 Claudiu Popa <pcmanticore@gmail.com>
# Copyright (c) 2015 Dmitry Pribysh <dmand@yandex.ru>
# Copyright (c... | mit |
lucafavatella/intellij-community | python/lib/Lib/fnmatch.py | 194 | 3019 | """Filename matching with shell patterns.
fnmatch(FILENAME, PATTERN) matches according to the local convention.
fnmatchcase(FILENAME, PATTERN) always takes case in account.
The functions operate by translating the pattern into a regular
expression. They cache the compiled regular expressions for speed.
The function... | apache-2.0 |
MiLk/ansible | lib/ansible/modules/storage/netapp/netapp_e_auth.py | 63 | 9786 | #!/usr/bin/python
# (c) 2016, NetApp, Inc
#
# 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 version.... | gpl-3.0 |
cpyou/odoo | addons/subscription/subscription.py | 337 | 8906 | # -*- 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... | agpl-3.0 |
kaarolch/ansible | lib/ansible/modules/network/panos/panos_admin.py | 48 | 6001 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Ansible module to manage PaloAltoNetworks Firewall
# (c) 2016, techbizdev <techbizdev@paloaltonetworks.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 License as publish... | gpl-3.0 |
pgurumur/netconf | core/lib/ip.py | 1 | 12491 | # Copyright (c) 2015 Prabhu Gurumurthy <pgurumur@users.noreply.github.com>
# Permission to use, copy, modify, and distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
# copyright notice and this permission notice appear in all copies.
# THE SOFTWARE IS PROVIDED "AS... | isc |
dongritengfei/phantomjs | src/qt/qtwebkit/Tools/Scripts/webkitpy/w3c/test_importer.py | 115 | 20224 | #!/usr/bin/env python
# Copyright (C) 2013 Adobe Systems Incorporated. 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 n... | bsd-3-clause |
guaix-ucm/numina | numina/array/rutilities.py | 3 | 6863 | #
# Copyright 2015 Universidad Complutense de Madrid
#
# This file is part of Numina
#
# SPDX-License-Identifier: GPL-3.0+
# License-Filename: LICENSE.txt
#
"""Utility classes and functions to employ R from python using rpy2."""
from __future__ import division
from __future__ import print_function
import numpy as np... | gpl-3.0 |
guoshijian/apm321 | Tools/autotest/pysim/util.py | 129 | 13700 | import math
from math import sqrt, acos, cos, pi, sin, atan2
import os, sys, time, random
from rotmat import Vector3, Matrix3
from subprocess import call, check_call,Popen, PIPE
def m2ft(x):
'''meters to feet'''
return float(x) / 0.3048
def ft2m(x):
'''feet to meters'''
return float(x) * 0.3048
def k... | gpl-3.0 |
larrybradley/photutils | photutils/morphology/tests/test_core.py | 2 | 1429 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
Tests for the core module.
"""
import numpy as np
from numpy.testing import assert_allclose
import pytest
from ..core import data_properties
try:
import skimage # noqa
HAS_SKIMAGE = True
except ImportError:
HAS_SKIMAGE = False
XCS = [... | bsd-3-clause |
danielharbor/openerp | addons/purchase/purchase.py | 9 | 82532 | # -*- 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 |
UjuE/zaproxy | python/api/src/zapv2/pscan.py | 16 | 3063 | # Zed Attack Proxy (ZAP) and its related class files.
#
# ZAP is an HTTP/HTTPS proxy for assessing web application security.
#
# Copyright 2015 the ZAP development team
#
# 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... | apache-2.0 |
sankha93/servo | tests/wpt/web-platform-tests/tools/py/py/_process/cmdexec.py | 273 | 1814 | import sys
import subprocess
import py
from subprocess import Popen, PIPE
def cmdexec(cmd):
""" return unicode output of executing 'cmd' in a separate process.
raise cmdexec.Error exeception if the command failed.
the exception will provide an 'err' attribute containing
the error-output from the comma... | mpl-2.0 |
maohongyuan/kbengine | kbe/res/scripts/common/Lib/test/test_pep292.py | 116 | 9548 | # Copyright (C) 2004 Python Software Foundation
# Author: barry@python.org (Barry Warsaw)
# License: http://www.opensource.org/licenses/PythonSoftFoundation.php
import unittest
from string import Template
class Bag:
pass
class Mapping:
def __getitem__(self, name):
obj = self
for part in name... | lgpl-3.0 |
MeirKriheli/Open-Knesset | simple/management/commands/sync_dev.py | 5 | 4964 | # no handling now: posts
import logging
from django.core.management.base import NoArgsCommand
from django.core.management import call_command
from django.db.models import get_apps, get_models, get_model
from django.db import transaction
from django.contrib.auth.models import User
from user.models import UserProfile
fr... | bsd-3-clause |
osmr/utct | TFLearn/feed_dict_flow_cp.py | 1 | 1917 | from tflearn import data_flow
class FeedDictFlowCp(data_flow.FeedDictFlow):
"""
Wrapper of TFLearn's FeedDictFlow for some types of augmentation.
"""
def __init__(self,
feed_dict,
coord,
batch_size=128,
num_threads=8,
... | mit |
jjmiranda/edx-platform | lms/djangoapps/grades/course_grades.py | 7 | 2451 | """
Functionality for course-level grades.
"""
from collections import namedtuple
from logging import getLogger
import dogstats_wrapper as dog_stats_api
from opaque_keys.edx.keys import CourseKey
from courseware.courses import get_course_by_id
from .new.course_grade import CourseGradeFactory
log = getLogger(__name_... | agpl-3.0 |
gjtorikian/readthedocs.org | readthedocs/donate/forms.py | 39 | 2972 | import logging
from django import forms
from django.conf import settings
from django.utils.translation import ugettext_lazy as _
import stripe
from .models import Supporter
log = logging.getLogger(__name__)
class SupporterForm(forms.ModelForm):
class Meta:
model = Supporter
fields = (
... | mit |
mveyrenc/mveyrenc.github.io | docker/conf.py | 1 | 9766 | # -*- coding: utf-8 -*-
#
# Docker build configuration file, created by
# sphinx-quickstart on Thu Jul 23 09:30:31 2015.
#
# 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 configuratio... | gpl-2.0 |
potatolondon/django-nonrel-1-4 | django/contrib/localflavor/ru/forms.py | 89 | 2204 | """
Russian-specific forms helpers
"""
from __future__ import absolute_import
import re
from django.contrib.localflavor.ru.ru_regions import RU_COUNTY_CHOICES, RU_REGIONS_CHOICES
from django.forms.fields import RegexField, Select
from django.utils.translation import ugettext_lazy as _
phone_digits_re = re.compile(r... | bsd-3-clause |
SnappleCap/oh-mainline | vendor/packages/gdata/tests/gdata_tests/sites/data_test.py | 41 | 12028 | #!/usr/bin/python
#
# Copyright 2009 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 b... | agpl-3.0 |
uglyboxer/linear_neuron | net-p3/lib/python3.5/site-packages/scipy/sparse/linalg/isolve/minres.py | 128 | 9207 | from __future__ import division, print_function, absolute_import
from numpy import sqrt, inner, finfo, zeros
from numpy.linalg import norm
from .utils import make_system
from .iterative import set_docstring
__all__ = ['minres']
header = \
"""Use MINimum RESidual iteration to solve Ax=b
MINRES minimizes norm(A*x -... | mit |
ShineFan/odoo | addons/document/wizard/__init__.py | 444 | 1084 | # -*- 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... | agpl-3.0 |
HybridF5/jacket | jacket/db/storage/api.py | 1 | 44700 | # Copyright (c) 2011 X.commerce, a business unit of eBay Inc.
# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file... | apache-2.0 |
nhomar/odoo | addons/decimal_precision/tests/test_qweb_float.py | 335 | 1986 | # -*- coding: utf-8 -*-
from openerp.tests import common
class TestFloatExport(common.TransactionCase):
def setUp(self):
super(TestFloatExport, self).setUp()
self.Model = self.registry('decimal.precision.test')
def get_converter(self, name):
converter = self.registry('ir.qweb.field.flo... | agpl-3.0 |
mckerrj/ansible | lib/ansible/cli/playbook.py | 4 | 9471 | #!/usr/bin/env python
# (c) 2012, Michael DeHaan <michael.dehaan@gmail.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 License as published by
# the Free Software Foundation, either version 3 of the License, or
# (... | gpl-3.0 |
intip/django-cms | cms/south_migrations/0048_auto__add_field_page_application_namespace__add_unique_page_publisher_.py | 48 | 16928 | # -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
try:
from django.contrib.auth import get_user_model
except ImportError: # django < 1.5
from django.contrib.auth.models import User
else:
User = get_user_model()
user_orm_label... | bsd-3-clause |
rrati/origin | cmd/service-catalog/go/src/github.com/kubernetes-incubator/service-catalog/vendor/k8s.io/kubernetes/cluster/juju/layers/kubernetes-master/reactive/kubernetes_master.py | 31 | 32680 | #!/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 |
xydinesh/youtube-dl | youtube_dl/extractor/tlc.py | 93 | 2594 | # encoding: utf-8
from __future__ import unicode_literals
import re
from .common import InfoExtractor
from .brightcove import BrightcoveIE
from .discovery import DiscoveryIE
from ..compat import compat_urlparse
class TlcIE(DiscoveryIE):
IE_NAME = 'tlc.com'
_VALID_URL = r'http://www\.tlc\.com\/[a-zA-Z0-9\-]*/... | unlicense |
dwitvliet/CATMAID | django/applications/catmaid/control/neuron_annotations.py | 2 | 48334 | import json
import re
from string import upper
from itertools import izip
from django.http import HttpResponse
from django.shortcuts import get_object_or_404
from django.db import connection
from rest_framework.decorators import api_view
from catmaid.models import UserRole, Project, Class, ClassInstance, \
C... | gpl-3.0 |
alanjumpi/mptcp | tools/perf/scripts/python/syscall-counts-by-pid.py | 11180 | 1927 | # system call counts, by pid
# (c) 2010, Tom Zanussi <tzanussi@gmail.com>
# Licensed under the terms of the GNU GPL License version 2
#
# Displays system-wide system call totals, broken down by syscall.
# If a [comm] arg is specified, only syscalls called by [comm] are displayed.
import os, sys
sys.path.append(os.env... | gpl-2.0 |
HelloLily/hellolily | lily/search/scan_search.py | 1 | 1365 | import inspect
from django.conf import settings
from elasticutils.contrib.django import MappingType
from lily.search.base_mapping import BaseMapping
class ModelMappings(object):
mappings = []
model_to_mappings = {}
app_to_mappings = {}
@classmethod
def scan(cls, apps_to_scan=settings.INSTALLED_... | agpl-3.0 |
brev/nupic | examples/opf/experiments/multistep/simple_3_f2/description.py | 32 | 1679 | # ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2013, Numenta, Inc. Unless you have an agreement
# with Numenta, Inc., for a separate license for this software code, the
# following terms and conditions apply:
#
# This progra... | agpl-3.0 |
chainer/chainer | tests/chainer_tests/functions_tests/loss_tests/test_absolute_error.py | 6 | 2692 | import unittest
import numpy
import chainer
from chainer.backends import cuda
from chainer import functions
from chainer import testing
from chainer.testing import attr
from chainer import utils
@testing.parameterize(*testing.product({
'dtype': [numpy.float16, numpy.float32, numpy.float64],
'shape': [(), (1... | mit |
jobovy/galpy | galpy/potential/interpSphericalPotential.py | 1 | 4568 | ###################3###################3###################3##################
# interpSphericalPotential.py: build spherical potential through interpolation
###################3###################3###################3##################
import numpy
from scipy import interpolate
from .SphericalPotential import Spherica... | bsd-3-clause |
sparkslabs/kamaelia | Sketches/MPS/BugReports/FixTests/Kamaelia/Examples/Handles/simplehttpclient.py | 6 | 1634 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2010 British Broadcasting Corporation and Kamaelia Contributors(1)
#
# (1) Kamaelia Contributors are listed in the AUTHORS file and at
# http://www.kamaelia.org/AUTHORS - please extend this file,
# not this notice.
#
# Licensed under the Apache License... | apache-2.0 |
Acehaidrey/incubator-airflow | airflow/providers/google/cloud/example_dags/example_presto_to_gcs.py | 7 | 6149 | #
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not... | apache-2.0 |
nacc/autotest | frontend/afe/resources.py | 3 | 32385 | from django import http
from autotest.frontend.shared import query_lib, resource_lib, exceptions
from autotest.frontend.afe import control_file, models, rpc_utils
from autotest.frontend.afe import model_attributes
from autotest.frontend import thread_local
from autotest.client.shared import host_protections
class Ent... | gpl-2.0 |
fernandog/Medusa | ext/stevedore/enabled.py | 16 | 3569 | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed u... | gpl-3.0 |
sorenk/ansible | test/units/modules/network/netscaler/netscaler_module.py | 57 | 1638 | import sys
from ansible.compat.tests.mock import patch, Mock
from units.modules.utils import AnsibleExitJson, AnsibleFailJson, ModuleTestCase
base_modules_mock = Mock()
nitro_service_mock = Mock()
nitro_exception_mock = Mock()
base_modules_to_mock = {
'nssrc': base_modules_mock,
'nssrc.com': base_modules_mo... | gpl-3.0 |
h4ck3rm1k3/BeautifulSoup4 | bs4/tests/test_html5lib.py | 38 | 3401 | """Tests to ensure that the html5lib tree builder generates good trees."""
import warnings
try:
from bs4.builder import HTML5TreeBuilder
HTML5LIB_PRESENT = True
except ImportError, e:
HTML5LIB_PRESENT = False
from bs4.element import SoupStrainer
from bs4.testing import (
HTML5TreeBuilderSmokeTest,
... | mit |
Achint08/open-event-orga-server | app/api/helpers/query_filters.py | 8 | 4681 | import requests
from sqlalchemy import or_, func, and_
from app.helpers.helpers import get_date_range
from app.models.event import Event
from app.models.session import Session
from custom_fields import DateTime
def extract_special_queries(queries):
"""
Separate special queries from normal queries
"""
s... | gpl-3.0 |
pschmitt/home-assistant | homeassistant/components/huawei_lte/notify.py | 8 | 1932 | """Support for Huawei LTE router notifications."""
import logging
import time
from typing import Any, List
import attr
from huawei_lte_api.exceptions import ResponseErrorException
from homeassistant.components.notify import ATTR_TARGET, BaseNotificationService
from homeassistant.const import CONF_RECIPIENT, CONF_URL... | apache-2.0 |
OpenTechFund/WebApp | opentech/apply/funds/migrations/0045_new_workflow.py | 1 | 1533 | # Generated by Django 2.0.8 on 2018-10-24 12:13
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('funds', '0044_add_named_blocks'),
]
operations = [
migrations.AlterField(
model_name='applicationbase',
name='workfl... | gpl-2.0 |
ActiveState/code | recipes/Python/496993_Separating_Pattern_ImplementatiYour/recipe-496993.py | 1 | 3324 | ##########
# pattern_impl.py
##########
from installmethod import installmethod # the installmethod from recipe: 223613
class ObserverPattern:
"""
A reusable implementation of the Observer pattern.
"""
theSubject = None
observers = {}
class Subject:
def __init__(self):
... | mit |
takaaptech/sky_engine | mojo/tools/perf_test_runner.py | 9 | 2953 | #!/usr/bin/env python
# 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.
"""A tool that runs a perf test and uploads the resulting data to the
performance dashboard.
"""
import argparse
from mopy import perf... | bsd-3-clause |
jcshen007/cloudstack | python/lib/cloudutils/globalEnv.py | 3 | 1831 | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | apache-2.0 |
1013553207/django | tests/shortcuts/tests.py | 199 | 5776 | from django.test import SimpleTestCase, ignore_warnings, override_settings
from django.test.utils import require_jinja2
from django.utils.deprecation import RemovedInDjango110Warning
@override_settings(
ROOT_URLCONF='shortcuts.urls',
)
class ShortcutTests(SimpleTestCase):
def test_render_to_response(self):
... | bsd-3-clause |
HyperBaton/ansible | lib/ansible/modules/network/cumulus/nclu.py | 23 | 7641 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2016-2018, Cumulus Networks <ce-ceng@cumulusnetworks.com>
# 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
ANSIBLE_METADATA = {'metadata_v... | gpl-3.0 |
mathstuf/beets | beets/art.py | 14 | 6851 | # This file is part of beets.
# Copyright 2015, Adrian Sampson.
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, ... | mit |
bitmovin/bitmovin-python | tests/bitmovin/services/encodings/drms/playready_drm_tests.py | 1 | 16848 | import unittest
import uuid
import json
from bitmovin import Bitmovin, Response, Stream, StreamInput, EncodingOutput, ACLEntry, Encoding, \
FMP4Muxing, MuxingStream, PlayReadyDRM, SelectionMode, ACLPermission, PlayReadyDRMAdditionalInformation
from bitmovin.errors import BitmovinApiError, InvalidTypeError
from test... | unlicense |
semonte/intellij-community | python/helpers/pydev/_pydevd_bundle/pydevd_comm.py | 3 | 63749 | ''' pydevd - a debugging daemon
This is the daemon you launch for python remote debugging.
Protocol:
each command has a format:
id\tsequence-num\ttext
id: protocol command number
sequence-num: each request has a sequence number. Sequence numbers
originating at the debugger are odd, sequence numbers ori... | apache-2.0 |
davidsminor/cortex | test/IECoreRI/PatchMeshTest.py | 5 | 8193 | ##########################################################################
#
# Copyright (p) 2009-2013, Image Engine Design 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:
#
# * Redis... | bsd-3-clause |
emory-libraries/eulfedora | eulfedora/server.py | 1 | 19607 | # file eulfedora/server.py
#
# Copyright 2010,2011 Emory University Libraries
#
# 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
#
# ... | apache-2.0 |
turon/openthread | tools/harness-automation/cases/router_5_2_7.py | 1 | 1879 | #!/usr/bin/env python
#
# Copyright (c) 2016, The OpenThread Authors.
# 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
# notic... | bsd-3-clause |
jlcarmic/producthunt_simulator | venv/lib/python2.7/site-packages/pip/basecommand.py | 92 | 11429 | """Base Command class, and related routines"""
from __future__ import absolute_import
import logging
import os
import sys
import optparse
import warnings
from pip import cmdoptions
from pip.index import PackageFinder
from pip.locations import running_under_virtualenv
from pip.download import PipSession
from pip.excep... | mit |
Cepave/portal | web/controller/host.py | 1 | 6380 | # -*- coding:utf-8 -*-
__author__ = 'Ulric Qin'
from flask import jsonify, request, render_template, g, make_response
from web import app
from web.model.host_group import HostGroup
from web.model.group_host import GroupHost
from web.model.grp_tpl import GrpTpl
from web.model.host import Host
from web.model.template imp... | apache-2.0 |
dslomov/intellij-community | python/lib/Lib/site-packages/django/contrib/localflavor/ro/ro_counties.py | 428 | 1231 | # -*- coding: utf-8 -*-
"""
A list of Romanian counties as `choices` in a formfield.
This exists as a standalone file so that it's only imported into memory when
explicitly needed.
"""
COUNTIES_CHOICES = (
('AB', u'Alba'),
('AR', u'Arad'),
('AG', u'Argeş'),
('BC', u'Bacău'),
('BH', u'Bihor'),
... | apache-2.0 |
LaMi-/pmatic | ccu_pkg/python/local/lib/python2.7/dist-packages/requests/packages/chardet/universaldetector.py | 1776 | 6840 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Universal charset detector code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 2001
# the Initial Developer. All R... | gpl-2.0 |
InitialState/python_appender | ISStreamer/Streamer.py | 1 | 10347 | # local config helper stuff
try:
import ISStreamer.configutil as configutil
except ImportError:
import configutil
try:
import ISStreamer.version as version
except ImportError:
import version
import uuid
# python 2 and 3 conversion support
import sys
if (sys.version_info < (2,7,0)):
sys.stderr.write("You need at l... | mit |
Denisolt/Tensorflow_Chat_Bot | local/lib/python2.7/site-packages/tensorflow/python/lib/io/file_io.py | 7 | 14215 | # Copyright 2015 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... | gpl-3.0 |
ak2703/edx-platform | cms/envs/aws_migrate.py | 288 | 1256 | """
A Django settings file for use on AWS while running
database migrations, since we don't want to normally run the
LMS with enough privileges to modify the database schema.
"""
# We intentionally define lots of variables that aren't used, and
# want to import all variables from base settings files
# pylint: disable=... | agpl-3.0 |
APM602/APM602 | Tools/scripts/update_wiki.py | 275 | 2870 | #!/usr/bin/env python
'''
update a wordpress wiki page
Andrew Tridgell
May 2013
See http://codex.wordpress.org/XML-RPC_WordPress_API/Posts
'''
import xmlrpclib, sys
from optparse import OptionParser
parser = OptionParser("update_wiki.py [options] <file>")
parser.add_option("--username", help="Wordpress username", de... | gpl-3.0 |
Guts/isogeo-api-py-minsdk | isogeo_pysdk/enums/limitation_types.py | 1 | 1993 | # -*- coding: UTF-8 -*-
#! python3
"""
Isogeo API v1 - Enums for Limitation types entity accepted values.
See: http://help.isogeo.com/api/complete/index.html
"""
# #############################################################################
# ########## Libraries #############
# ############################... | gpl-3.0 |
alex/html5lib-python | html5lib/tests/support.py | 450 | 5496 | from __future__ import absolute_import, division, unicode_literals
import os
import sys
import codecs
import glob
import xml.sax.handler
base_path = os.path.split(__file__)[0]
test_dir = os.path.join(base_path, 'testdata')
sys.path.insert(0, os.path.abspath(os.path.join(base_path,
... | mit |
15Dkatz/pants | src/python/pants/engine/build_files.py | 1 | 13721 | # 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 collections
f... | apache-2.0 |
svn2github/vbox | src/VBox/Devices/EFI/Firmware/BaseTools/Source/Python/Table/TablePcd.py | 11 | 4171 | ## @file
# This file is used to create/update/query/erase table for pcds
#
# Copyright (c) 2008, Intel Corporation. All rights reserved.<BR>
# This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License
# which accompanies this distribution. The full ... | gpl-2.0 |
jcoady9/youtube-dl | devscripts/make_supportedsites.py | 39 | 1152 | #!/usr/bin/env python
from __future__ import unicode_literals
import io
import optparse
import os
import sys
# Import youtube_dl
ROOT_DIR = os.path.join(os.path.dirname(__file__), '..')
sys.path.insert(0, ROOT_DIR)
import youtube_dl
def main():
parser = optparse.OptionParser(usage='%prog OUTFILE.md')
optio... | unlicense |
myhdl/myhdl | myhdl/test/core/test_modbv.py | 4 | 5262 | # This file is part of the myhdl library, a Python package for using
# Python as a Hardware Description Language.
#
# Copyright (C) 2003-2011 Jan Decaluwe
#
# The myhdl library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public License as
# published by t... | lgpl-2.1 |
e2/googletest | scripts/upload_gtest.py | 1963 | 2851 | #!/usr/bin/env python
#
# Copyright 2009, 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... | bsd-3-clause |
sanghinitin/golismero | thirdparty_libs/django/utils/regex_helper.py | 229 | 12685 | """
Functions for reversing a regular expression (used in reverse URL resolving).
Used internally by Django and not intended for external use.
This is not, and is not intended to be, a complete reg-exp decompiler. It
should be good enough for a large class of URLS, however.
"""
from __future__ import unicode_literals
... | gpl-2.0 |
Tiotao/morpherpy | env/Lib/site-packages/sqlalchemy/dialects/sybase/base.py | 12 | 28776 | # sybase/base.py
# Copyright (C) 2010-2013 the SQLAlchemy authors and contributors <see AUTHORS file>
# get_select_precolumns(), limit_clause() implementation
# copyright (C) 2007 Fisch Asset Management
# AG http://www.fam.ch, with coding by Alexander Houben
# alexander.houben@thor-solutions.ch
#
# This module is part ... | mit |
gylian/headphones | lib/beets/ui/commands.py | 3 | 50830 | # This file is part of beets.
# Copyright 2014, Adrian Sampson.
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, ... | gpl-3.0 |
epsy/pyflakes | pyflakes/test/test_doctests.py | 13 | 12486 | import sys
import textwrap
from pyflakes import messages as m
from pyflakes.checker import (
DoctestScope,
FunctionScope,
ModuleScope,
)
from pyflakes.test.test_other import Test as TestOther
from pyflakes.test.test_imports import Test as TestImports
from pyflakes.test.test_undefined_names import Test as T... | mit |
Japanuspus/Site-in-a-Dropbox | app/dropbox/auth.py | 3 | 9723 | """
The dropbox.auth module is responsible for making OAuth work for the Dropbox
Client API. It glues together all the separate parts of the Python OAuth
reference implementation and gives a nicer API to it. You'll pass a
configure dropbox.auth.Authenticator object to dropbox.client.DropboxClient
in order to work wit... | mit |
julianofischer/caederm | caed/models.py | 1 | 2456 | # encoding: utf-8
# Author: Juliano Fischer Naves
# julianofischer at gmail dot com
# April, 2014
from django.db import models
from django.utils.translation import ugettext_lazy as _
# Create your models here.
class StudentClass(models.Model):
name = models.CharField(max_length=30,verbose_name='Turma')
d... | gpl-3.0 |
virtualopensystems/neutron | neutron/tests/unit/ryu/test_ryu_plugin.py | 23 | 1640 | # Copyright (c) 2012 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 |
dimroc/tensorflow-mnist-tutorial | lib/python3.6/site-packages/numpy/core/info.py | 99 | 4692 | """Defines a multi-dimensional array and useful procedures for Numerical computation.
Functions
- array - NumPy Array construction
- zeros - Return an array of all zeros
- empty - Return an uninitialized array
- shape - Return... | apache-2.0 |
yhoshino11/pytest_example | .tox/flake8/lib/python2.7/site-packages/pip/_vendor/requests/packages/chardet/langgreekmodel.py | 2763 | 12628 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Communicator client code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998
# the Initial Developer. All Rights R... | mit |
96boards/wilink8-wlan_backports | devel/git-tracker.py | 6 | 10662 | #!/usr/bin/env python
"""
backports git tracker
=======================
The idea here is to put the backported drivers/etc. into a git tree
that follows the input git tree, for example wireless-testing or the
Linux upstream tree. This can then be used by end users who prefer
git over downloading tarballs, or develope... | gpl-2.0 |
jackylee0424/Physioboard | sc-phonegap-tornado-websocket/Server/tornado/test/escape_test.py | 8 | 8326 | #!/usr/bin/env python
import tornado.escape
import unittest
from tornado.escape import utf8, xhtml_escape, xhtml_unescape, url_escape, url_unescape, to_unicode, json_decode, json_encode
from tornado.util import b
linkify_tests = [
# (input, linkify_kwargs, expected_output)
("hello http://world.com/!", {},
... | mit |
jeremiahmarks/sl4a | python/src/Lib/test/test_fpformat.py | 61 | 2316 | '''
Tests for fpformat module
Nick Mathewson
'''
from test.test_support import run_unittest, import_module
import unittest
fpformat = import_module('fpformat', deprecated=True)
fix, sci, NotANumber = fpformat.fix, fpformat.sci, fpformat.NotANumber
StringType = type('')
# Test the old and obsolescent fpformat mo... | apache-2.0 |
ifduyue/sentry | src/sentry/south_migrations/0394_auto__chg_field_project_team.py | 2 | 99797 | # -*- coding: utf-8 -*-
from south.utils import datetime_utils as datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
# Flag to indicate if this migration is too risky
# to run online and needs to be coordinated for offline
... | bsd-3-clause |
jorisvandenbossche/numpy | numpy/core/shape_base.py | 1 | 28964 | from __future__ import division, absolute_import, print_function
__all__ = ['atleast_1d', 'atleast_2d', 'atleast_3d', 'block', 'hstack',
'stack', 'vstack']
import functools
import operator
import warnings
from . import numeric as _nx
from . import overrides
from ._asarray import array, asanyarray
from .mu... | bsd-3-clause |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.