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 |
|---|---|---|---|---|---|
fengbaicanhe/intellij-community | python/helpers/pydev/third_party/pep8/lib2to3/lib2to3/pytree.py | 325 | 29039 | # Copyright 2006 Google, Inc. All Rights Reserved.
# Licensed to PSF under a Contributor Agreement.
"""
Python parse tree definitions.
This is a very concrete parse tree; we need to keep every token and
even the comments and whitespace between tokens.
There's also a pattern matching implementation here.
"""
__autho... | apache-2.0 |
pepeantena4040/MiSitioWeb | lib/toaster/orm/migrations/0011_auto__add_field_projectlayer_dirpath.py | 6 | 17973 | # -*- coding: utf-8 -*-
from south.utils import datetime_utils as datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding field 'ProjectLayer.dirpath'
db.add_column(u'orm_projectlayer', ... | gpl-2.0 |
jabesq/home-assistant | homeassistant/components/totalconnect/alarm_control_panel.py | 1 | 4506 | """Interfaces with TotalConnect alarm control panels."""
import logging
import homeassistant.components.alarm_control_panel as alarm
from homeassistant.const import (
STATE_ALARM_ARMED_AWAY, STATE_ALARM_ARMED_HOME, STATE_ALARM_ARMED_NIGHT,
STATE_ALARM_DISARMED, STATE_ALARM_ARMING, STATE_ALARM_DISARMING,
ST... | apache-2.0 |
iguzu/gae-django | django/contrib/gis/gdal/prototypes/generation.py | 321 | 3766 | """
This module contains functions that generate ctypes prototypes for the
GDAL routines.
"""
from ctypes import c_char_p, c_double, c_int, c_void_p
from django.contrib.gis.gdal.prototypes.errcheck import \
check_arg_errcode, check_errcode, check_geom, check_geom_offset, \
check_pointer, check_srs, check_str... | bsd-3-clause |
watermelo/libcloud | example_loadbalancer.py | 58 | 2483 | #!/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 "Licen... | apache-2.0 |
w1kke/pylearn2 | pylearn2/linear/tests/test_conv2d.py | 45 | 5497 | import theano
from theano import tensor
import numpy
from pylearn2.linear.conv2d import Conv2D, make_random_conv2D
from pylearn2.space import Conv2DSpace
from pylearn2.utils import sharedX
import unittest
try:
scipy_available = True
import scipy.ndimage
except ImportError:
scipy_available = False
class Te... | bsd-3-clause |
pedja1/aNmap | dSploit/jni/nmap/zenmap/zenmapGUI/higwidgets/higprogressbars.py | 4 | 9819 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# ***********************IMPORTANT NMAP LICENSE TERMS************************
# * *
# * The Nmap Security Scanner is (C) 1996-2013 Insecure.Com LLC. Nmap is *
# * also a registered trademark of Inse... | gpl-3.0 |
kutuhal/oracle-r12-accounting | lib/django/core/management/commands/migrate.py | 36 | 17808 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import itertools
import time
import traceback
import warnings
from collections import OrderedDict
from importlib import import_module
from django.apps import apps
from django.core.management import call_command
from django.core.management.base import Bas... | bsd-3-clause |
zyq001/ryu | ryu/controller/ofp_handler.py | 18 | 11003 | # Copyright (C) 2011, 2012 Nippon Telegraph and Telephone Corporation.
# Copyright (C) 2011, 2012 Isaku Yamahata <yamahata at valinux co jp>
#
# 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
#
... | apache-2.0 |
ahnitz/pycbc | pycbc/rate.py | 14 | 12540 | import numpy
import bisect
from . import bin_utils
def integral_element(mu, pdf):
'''
Returns an array of elements of the integrand dP = p(mu) dmu
for a density p(mu) defined at sample values mu ; samples need
not be equally spaced. Uses a simple trapezium rule.
Number of dP elements is 1 - (numb... | gpl-3.0 |
westinedu/newertrends | mezzanine/utils/email.py | 4 | 2334 |
from django.contrib.auth.tokens import default_token_generator
from django.core.mail import EmailMultiAlternatives
from django.core.urlresolvers import reverse
from django.template import loader, Context
from django.utils.http import int_to_base36
from mezzanine.conf import settings
def send_mail_template(subject, ... | bsd-3-clause |
gabrielecker/DogAdoption-Backend | views/dogs.py | 1 | 1667 | # encoding: utf-8
from flask import jsonify, request
from flask_login import login_required, current_user
from project.app import db
from project.models import Dog
from utils.rest import RestView
class DogAPI(RestView):
schema = 'Dog'
def get(self, id):
page = request.args.get('page') or 1
if... | mit |
mrcslws/htmresearch | projects/feedback/feedback_sequences_additional.py | 7 | 24229 |
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2016, 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 program is free software: you can redistribute it and/or modify
# it under the... | agpl-3.0 |
saguziel/incubator-airflow | airflow/hooks/zendesk_hook.py | 6 | 3835 | # -*- coding: utf-8 -*-
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
... | apache-2.0 |
akipta/autokey | src/lib/interface.py | 46 | 44692 | # -*- coding: utf-8 -*-
# Copyright (C) 2011 Chris Dekter
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This pr... | gpl-3.0 |
linjoahow/cd0505 | static/Brython3.1.1-20150328-091302/Lib/unittest/test/test_functiontestcase.py | 791 | 5478 | import unittest
from .support import LoggingResult
class Test_FunctionTestCase(unittest.TestCase):
# "Return the number of tests represented by the this test object. For
# TestCase instances, this will always be 1"
def test_countTestCases(self):
test = unittest.FunctionTestCase(lambda: None)
... | agpl-3.0 |
quamilek/django | tests/update_only_fields/tests.py | 296 | 9780 | from __future__ import unicode_literals
from django.db.models.signals import post_save, pre_save
from django.test import TestCase
from .models import Account, Employee, Person, Profile, ProxyEmployee
class UpdateOnlyFieldsTests(TestCase):
def test_update_fields_basic(self):
s = Person.objects.create(nam... | bsd-3-clause |
efiop/dvc | dvc/repo/experiments/base.py | 1 | 4573 | from typing import Optional
from dvc.exceptions import DvcException, InvalidArgumentError
# Experiment refs are stored according baseline git SHA:
# refs/exps/01/234abcd.../<exp_name>
EXPS_NAMESPACE = "refs/exps"
EXPS_STASH = f"{EXPS_NAMESPACE}/stash"
EXEC_NAMESPACE = f"{EXPS_NAMESPACE}/exec"
EXEC_APPLY = f"{EXEC_N... | apache-2.0 |
becm/meson | mesonbuild/modules/pkgconfig.py | 1 | 25361 | # Copyright 2015 The Meson 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 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 |
manteapi/hokusai | test/gtest-1.7.0/test/gtest_test_utils.py | 1100 | 10812 | #!/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-2.0 |
Pexego/l10n-spain | l10n_es_aeat_mod130/wizard/export_mod130_to_boe.py | 3 | 7462 | # -*- encoding: utf-8 -*-
##############################################################################
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the Licens... | agpl-3.0 |
gangadharkadam/verveerp | erpnext/hr/doctype/employee/employee.py | 4 | 7457 | # 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 getdate, validate_email_add, cint, today
from frappe.model.naming import make_autoname
from frappe import throw,... | agpl-3.0 |
mohanprasath/Course-Work | data_analysis/uh_data_analysis_with_python/hy-data-analysis-with-python-spring-2020/part01-e16_transform/tmc/utils.py | 91 | 2610 | import importlib
import sys
from unittest.mock import MagicMock
def load(pkg, method, err=None):
if not err:
err = '{0}.{1} does not exist!'.format(pkg, method)
def fail(*args, **kwargs):
raise AssertionError(err)
try:
return getattr(importlib.import_module(pkg), method)
exce... | gpl-3.0 |
petrutlucian94/cinder | cinder/volume/drivers/srb.py | 14 | 33627 | # Copyright (c) 2014 Scality
#
# 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... | apache-2.0 |
ds0nt/or-tools | examples/python/set_covering4.py | 15 | 4793 | # Copyright 2010 Hakan Kjellerstrand hakank@bonetmail.com
#
# 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 |
kimvais/cryptography | src/cryptography/hazmat/primitives/serialization.py | 11 | 5152 | # This file is dual licensed under the terms of the Apache License, Version
# 2.0, and the BSD License. See the LICENSE file in the root of this repository
# for complete details.
from __future__ import absolute_import, division, print_function
import abc
import base64
import struct
from enum import Enum
import six
... | bsd-3-clause |
labordoc/labordoc-next | modules/bibformat/lib/bibformat_templates.py | 1 | 86532 | # -*- coding: utf-8 -*-
##
## This file is part of Invenio.
## Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012 CERN.
##
## Invenio 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 t... | gpl-2.0 |
stormrose-va/xobox | tests/t_cli/test_logger.py | 1 | 1540 | # -*- coding: utf-8 -*-
"""
tests.t_cli.test_logger
~~~~~~~~~~~~~~~~~~~~~~~
:copyright: Copyright 2017 by the Stormrose Project team, see AUTHORS.
:license: MIT License, see LICENSE for details.
"""
import os
import sys
import tempfile
from unittest import TestCase, skipIf
from xobox.cli.logger impor... | mit |
ltilve/ChromiumGStreamerBackend | tools/telemetry/third_party/gsutilz/third_party/boto/tests/integration/ec2containerservice/__init__.py | 99 | 1122 | # Copyright (c) 2015 Amazon.com, Inc. or its affiliates. All Rights Reserved
#
# 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 t... | bsd-3-clause |
CORDEA/analysis_of_1000genomes-data | programs/add_annotations/missense.py | 1 | 1346 | #!/bin/env python
# encoding:utf-8
#
# Author: CORDEA
# Created: 2014-09-12
#
infile = open("ilm_missene.onmis.vcf", "r")
lines = infile.readlines()
infile.close()
msDict = {}
for line in lines:
samples = line.split(",")[5]
tmp = samples.split("|")
for i in range(len(tmp)):
try:
m... | apache-2.0 |
Saviio/ClawMonitor | urls.py | 1 | 1245 | from utils import current_random, current, timestring
import urllib, time
class urls():
def __init__():
return None
@staticmethod
def verify_usr(usr):
return "http://login.xunlei.com/check/?u=%s&business_type=108&cachetime=%d&" % (usr, current())
@staticmethod
def login():
... | mit |
Balance-Breaker/Algo_Ds_Notes | Dijkstra_Algorithm/Dijkstra_Algorithm.py | 4 | 3700 | '''
Dijkstra's algorithm for weighted undirected graph
'''
from collections import deque
class Dijkstra:
def __init__(self, graph):
self.vertex_visited = list()
self.distance = {}
self.graph = graph
self.source = None
self.queue_size = 0
self.min_queue = deque()
... | gpl-3.0 |
blx/pyjade | examples/django_example/settings.py | 9 | 5251 | # Django settings for django_prueba project.
DEBUG = True
TEMPLATE_DEBUG = DEBUG
ADMINS = (
# ('Your Name', 'your_email@example.com'),
)
MANAGERS = ADMINS
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.', # Add 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.
'N... | mit |
tzmgit/fast-api-ui | fast_api_ui/database.py | 28 | 2310 | # -*- coding: utf-8 -*-
"""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
class CRUDMixin(object):
... | bsd-3-clause |
Chilledheart/chromium | third_party/closure_linter/closure_linter/common/tokens_test.py | 126 | 3089 | #!/usr/bin/env python
# Copyright 2011 The Closure Linter 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
#
#... | bsd-3-clause |
oleksa-pavlenko/gae-django-project-template | django/views/i18n.py | 68 | 11000 | import importlib
import json
import os
import gettext as gettext_module
from django import http
from django.apps import apps
from django.conf import settings
from django.template import Context, Template
from django.utils.translation import check_for_language, to_locale, get_language, LANGUAGE_SESSION_KEY
from django.... | mit |
marbindrakon/eve-wspace | evewspace/Alerts/models.py | 10 | 3002 | # Eve W-Space
# Copyright 2014 Andrew Austin and contributors
#
# 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 requi... | apache-2.0 |
tracierenea/gnuradio | gr-filter/examples/fir_filter_ccc.py | 47 | 4019 | #!/usr/bin/env python
#
# Copyright 2013 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# GNU Radio 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, or (at your option)
# ... | gpl-3.0 |
maryklayne/Funcao | sympy/ntheory/residue_ntheory.py | 16 | 23167 | # -*- coding: utf-8 -*-
from __future__ import print_function, division
from sympy.core.singleton import S
from sympy.core.numbers import igcd, igcdex
from sympy.core.compatibility import as_int, xrange
from sympy.core.function import Function
from .primetest import isprime
from .factor_ import factorint, trailing, t... | bsd-3-clause |
Khan/pygments | pygments/lexers/compiled.py | 6 | 130406 | # -*- coding: utf-8 -*-
"""
pygments.lexers.compiled
~~~~~~~~~~~~~~~~~~~~~~~~
Lexers for compiled languages.
:copyright: Copyright 2006-2012 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import re
from string import Template
from pygments.lexer import Lexer, Rege... | bsd-2-clause |
souravsingh/sympy | sympy/matrices/expressions/transpose.py | 21 | 2382 | from __future__ import print_function, division
from sympy import Basic
from sympy.functions import adjoint, conjugate
from sympy.matrices.expressions.matexpr import MatrixExpr
class Transpose(MatrixExpr):
"""
The transpose of a matrix expression.
This is a symbolic object that simply stores its argumen... | bsd-3-clause |
ykaneko/quantum | quantum/tests/unit/test_agent_netns_cleanup.py | 7 | 10378 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright (c) 2012 OpenStack Foundation.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.... | apache-2.0 |
openvapour/ryu | ryu/contrib/ncclient/operations/__init__.py | 65 | 1469 | # Copyright 2009 Shikhar Bhushan
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writin... | apache-2.0 |
zhangpanrobot/myblog | node_modules/grunt-docker/node_modules/docker/node_modules/pygmentize-bundled/vendor/pygments/external/rst-directive-old.py | 118 | 2518 | # -*- coding: utf-8 -*-
"""
The Pygments reStructuredText directive
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This fragment is a Docutils_ 0.4 directive that renders source code
(to HTML only, currently) via Pygments.
To use it, adjust the options below and copy the code into a module
that you i... | mit |
Kjwon15/earthreader-web | earthreader/web/__init__.py | 3 | 26309 | """:mod:`earthreader.web` --- Earth Reader for Web
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
"""
import datetime
import os
from flask import Flask, jsonify, render_template, request, url_for
from libearth.codecs import Rfc3339
from libearth.compat import text_type
from libearth.crawler import crawl, open_url... | agpl-3.0 |
renaldopringle/python_koans | python3/koans/about_regex.py | 79 | 4803 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from runner.koan import *
import re
class AboutRegex(Koan):
"""
These koans are based on the Ben's book: Regular Expressions in 10 minutes.
I found this books very useful so I decided to write a koans in order to practice everything I had learned from i... | mit |
sekikn/ambari | ambari-server/src/main/resources/scripts/takeover_config_merge.py | 3 | 24177 | #!/usr/bin/env python
'''
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License");... | apache-2.0 |
googleapis/googleapis-gen | google/ads/googleads/v7/googleads-py/google/ads/googleads/v7/resources/types/managed_placement_view.py | 1 | 1296 | # -*- coding: utf-8 -*-
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | apache-2.0 |
TamiaLab/PySkCode | skcode/utility/cosmetics.py | 1 | 1689 | """
SkCode cosmetics replacement utility code.
"""
import re
# Default cosmetics replacement map (compiled regex)
DEFAULT_COSMETICS_MAP = (
(re.compile(r'(\s+)---(\s+)'), r'\1—\2'),
(re.compile(r'(\s+)--(\s+)'), r'\1—\2'),
(re.compile(r'\.\.\.'), r'…'),
(re.compile(r'\(tm\)'), r'™'),
)
# Document a... | agpl-3.0 |
steveb/heat | heat/tests/test_support.py | 13 | 3769 | #
# 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 |
Connexions/openstax-cms | oxauth/management/commands/prune_accounts.py | 2 | 2416 | from wagtail.core.models import Page
from django.core.management.base import BaseCommand
from django.contrib.auth.models import User
class Command(BaseCommand):
help = "remove all users that do not have content created or admin access"
def handle(self, *args, **options):
pages = Page.objects.all()
... | agpl-3.0 |
gregbanks/suds | suds/bindings/binding.py | 1 | 19048 | # This program is free software; you can redistribute it and/or modify
# it under the terms of the (LGPL) GNU Lesser General Public License as
# published by the Free Software Foundation; either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will ... | lgpl-3.0 |
UNINETT/nav | tools/eventgenerators/snmpevent.py | 2 | 2774 | #!/usr/bin/env python3
#
# Copyright (C) 2007, 2012, 2017 Uninett AS
#
# This file is part of Network Administration Visualized (NAV).
#
# NAV is free software: you can redistribute it and/or modify it under
# the terms of the GNU General Public License version 3 as published by
# the Free Software Foundation.
#
# This... | gpl-2.0 |
freedomtan/tensorflow | tensorflow/python/estimator/export/export_output.py | 41 | 1319 | # 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 |
hatoncat/limbo-android | jni/qemu/roms/seabios/tools/acpi_extract.py | 44 | 10031 | #!/usr/bin/python
# Copyright (C) 2011 Red Hat, Inc., Michael S. Tsirkin <mst@redhat.com>
#
# This file may be distributed under the terms of the GNU GPLv3 license.
# Process mixed ASL/AML listing (.lst file) produced by iasl -l
# Locate and execute ACPI_EXTRACT directives, output offset info
#
# Documentation of ACP... | gpl-2.0 |
yury-s/v8-inspector | Source/chrome/tools/telemetry/telemetry/unittest_util/test_page_test_results.py | 53 | 1158 | # Copyright 2014 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.
from telemetry.page import page as page_module
from telemetry.results import page_test_results
from telemetry.value import scalar
class TestPageTestResults... | bsd-3-clause |
pyq881120/amoco | amoco/arch/x64/formats.py | 5 | 1941 | # -*- coding: utf-8 -*-
from amoco.arch.core import Formatter
def pfx(i):
if i.misc['pfx'] is None: return ''
pfxgrp0 = i.misc['pfx'][0]
if pfxgrp0 is None: return ''
return '%s '%pfxgrp0
def mnemo(i):
mnemo = i.mnemonic.replace('cc','')
if hasattr(i,'cond'): mnemo += i.cond[0].split('/')[0]
... | gpl-2.0 |
geminateCoder/Character-Archive-Website | Lib/site-packages/sqlalchemy/orm/query.py | 20 | 147616 | # orm/query.py
# Copyright (C) 2005-2016 the SQLAlchemy authors and contributors
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
"""The Query class and support.
Defines the :class:`.Query` class, the central
constru... | cc0-1.0 |
friedrich420/S5-AEL-Kernel | tools/perf/scripts/python/check-perf-trace.py | 11214 | 2503 | # perf script event handlers, generated by perf script -g python
# (c) 2010, Tom Zanussi <tzanussi@gmail.com>
# Licensed under the terms of the GNU GPL License version 2
#
# This script tests basic functionality such as flag and symbol
# strings, common_xxx() calls back into perf, begin, end, unhandled
# events, etc. ... | gpl-2.0 |
annarev/tensorflow | tensorflow/python/keras/integration_test/multi_worker_tutorial_test.py | 2 | 13552 | # Copyright 2020 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 |
stvstnfrd/edx-platform | lms/djangoapps/courseware/tests/test_context_processor.py | 1 | 1674 | """
Unit tests for courseware context_processor
"""
from django.contrib.auth.models import AnonymousUser
from mock import Mock
from lms.djangoapps.courseware.context_processor import user_timezone_locale_prefs
from openedx.core.djangoapps.user_api.preferences.api import set_user_preference
from common.djangoapps.stu... | agpl-3.0 |
tagatac/scrapy | scrapy/loader/processors.py | 145 | 2850 | """
This module provides some commonly used processors for Item Loaders.
See documentation in docs/topics/loaders.rst
"""
from scrapy.utils.misc import arg_to_iter
from scrapy.utils.datatypes import MergeDict
from .common import wrap_loader_context
class MapCompose(object):
def __init__(self, *functions, **def... | bsd-3-clause |
LibiSC/tab10test | tools/perf/scripts/python/futex-contention.py | 11261 | 1486 | # futex contention
# (c) 2010, Arnaldo Carvalho de Melo <acme@redhat.com>
# Licensed under the terms of the GNU GPL License version 2
#
# Translation of:
#
# http://sourceware.org/systemtap/wiki/WSFutexContention
#
# to perf python scripting.
#
# Measures futex contention
import os, sys
sys.path.append(os.environ['PER... | gpl-2.0 |
hzj123/56th | pombola/core/tests/test_positions.py | 3 | 18319 | import random
import datetime
from django.contrib.contenttypes.models import ContentType
from django.core import exceptions
from django.test import TestCase
from django_date_extensions.fields import ApproximateDate
from pombola.core import models
class PositionTest(TestCase):
def setUp(self):
self.person... | agpl-3.0 |
havard024/prego | crm/lib/python2.7/site-packages/docutils/transforms/components.py | 196 | 1993 | # $Id: components.py 4564 2006-05-21 20:44:42Z wiemann $
# Author: David Goodger <goodger@python.org>
# Copyright: This module has been placed in the public domain.
"""
Docutils component-related transforms.
"""
__docformat__ = 'reStructuredText'
import sys
import os
import re
import time
from docutils import nodes,... | mit |
Matt-Deacalion/django | tests/model_forms/models.py | 135 | 14126 | """
XX. Generating HTML forms from models
This is mostly just a reworking of the ``form_for_model``/``form_for_instance``
tests to use ``ModelForm``. As such, the text may not make sense in all cases,
and the examples are probably a poor fit for the ``ModelForm`` syntax. In other
words, most of these tests should be r... | bsd-3-clause |
destinokm/DesHabitat | backend/articles/migrations/0001_initial.py | 1 | 1937 | # -*- coding: utf-8 -*-
# Generated by Django 1.10.5 on 2017-02-26 07:54
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Articl... | gpl-3.0 |
butterscotchstallion/SpiffyRPG | SpiffyRPG/SpiffyWorld/db.py | 1 | 1041 | # -*- coding: utf-8 -*-
import sqlite3 as lite
import os
class Database:
"""
Handles db connection
"""
def __init__(self, **kwargs):
self.log = None
if "log" in kwargs:
self.log = kwargs["log"]
if "path" in kwargs:
path = kwargs["path"]
... | mit |
afeyrer/Final-Project | ggame/sysdeps.py | 227 | 1916 | def module_exists(module_name):
try:
__import__(module_name)
except ImportError:
return False
else:
return True
if module_exists('browser') and module_exists('javascript'):
from browser import window, document
from javascript import JSObject, JSConstructor
GFX = JSObject(w... | mit |
learningequality/kolibri | kolibri/core/device/test/test_api.py | 2 | 18219 | import os
import platform
import sys
from collections import namedtuple
import mock
from django.conf import settings
from django.core.exceptions import ValidationError
from django.core.urlresolvers import reverse
from mock import patch
from morango.models import DatabaseIDModel
from morango.models import InstanceIDMod... | mit |
yonglehou/spiderfoot | ext/stem/util/test_tools.py | 12 | 10810 | # Copyright 2015, Damian Johnson and The Tor Project
# See LICENSE for licensing information
"""
Helper functions for testing.
.. versionadded:: 1.2.0
::
clean_orphaned_pyc - delete *.pyc files without corresponding *.py
is_pyflakes_available - checks if pyflakes is available
is_pep8_available - checks if pe... | gpl-2.0 |
jakevdp/klsh | klsh/hamming_ann.py | 1 | 6489 | """
This is a set of classes to perform fast (approximate) nearest neighbors
searches over Hamming spaces.
[1] M. Charikar. Similarity Estimation Techniques from Rounding Algorithms.
ACM Symposium on Theory of Computing, 2002.
"""
__all__ = ["HammingANN", "HammingBrute", "HammingBallTree"]
import numpy as np
from... | bsd-3-clause |
prakritish/ansible | test/runner/units/test_diff.py | 203 | 2975 | """Tests for diff module."""
import os
import subprocess
import pytest
from lib.diff import (
parse_diff,
FileDiff,
)
def get_diff(base, head=None):
"""Return a git diff between the base and head revision.
:type base: str
:type head: str | None
:rtype: list[str]
"""
if not head or hea... | gpl-3.0 |
pygeek/python-oauth2 | oauth2/clients/imap.py | 885 | 1685 | """
The MIT License
Copyright (c) 2007-2010 Leah Culver, Joe Stump, Mark Paschal, Vic Fryzel
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 ... | mit |
nicoTrombon/DjangoPolls | env/Lib/site-packages/django/contrib/gis/db/models/lookups.py | 84 | 10596 | from __future__ import unicode_literals
import re
from django.core.exceptions import FieldDoesNotExist
from django.db.models.constants import LOOKUP_SEP
from django.db.models.expressions import Col, Expression
from django.db.models.lookups import Lookup
from django.utils import six
gis_lookups = {}
class GISLookup... | bsd-3-clause |
brandicted/nefertari | tests/test_view.py | 2 | 26327 | #!/usr/bin/python
# -*- coding: utf-8 -*-
import pytest
from mock import Mock, MagicMock, patch, call, PropertyMock
from nefertari.view import (
BaseView, error_view, key_error_view, value_error_view)
from nefertari.utils import dictset
from nefertari.json_httpexceptions import (
JHTTPBadRequest, JHTTPNotFound... | apache-2.0 |
dcmichael/stardict-3 | tools/src/stardict_images.py | 41 | 7885 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from gimpfu import *
import os
def prepare_image(image, visibleLayers, size, numColors = None):
"""prepare custom image
image - image object to change
size - size of the image in pixels
visibleLayers - a list of layers that must be visible
"""
for layer in imag... | gpl-3.0 |
rajalokan/nova | nova/tests/unit/api/openstack/test_api_version_request.py | 11 | 7131 | # 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... | apache-2.0 |
palerdot/calibre | src/calibre/utils/fonts/free_type.py | 5 | 2580 | #!/usr/bin/env python
# vim:fileencoding=UTF-8:ts=4:sw=4:sta:et:sts=4:fdm=marker:ai
from __future__ import (unicode_literals, division, absolute_import,
print_function)
__license__ = 'GPL v3'
__copyright__ = '2012, Kovid Goyal <kovid at kovidgoyal.net>'
__docformat__ = 'restructuredtext en'
... | gpl-3.0 |
niltonlk/nest-simulator | pynest/examples/spatial/test_3d.py | 14 | 2140 | # -*- coding: utf-8 -*-
#
# test_3d.py
#
# This file is part of NEST.
#
# Copyright (C) 2004 The NEST Initiative
#
# NEST 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
# (... | gpl-2.0 |
Jgarcia-IAS/SITE | openerp/exceptions.py | 312 | 3157 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2011 OpenERP s.a. (<http://openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the G... | agpl-3.0 |
os2webscanner/os2webscanner | django-os2webscanner/os2webscanner/validate.py | 1 | 3231 | # The contents of this file are subject to the Mozilla Public 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.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS IS"basis,
#... | mpl-2.0 |
nvbn/thefuck | thefuck/rules/omnienv_no_such_command.py | 1 | 1061 | import re
from thefuck.utils import (cache, for_app, replace_argument, replace_command,
which)
from subprocess import PIPE, Popen
supported_apps = 'goenv', 'nodenv', 'pyenv', 'rbenv'
enabled_by_default = any(which(a) for a in supported_apps)
COMMON_TYPOS = {
'list': ['versions', 'inst... | mit |
nextgis-extra/tests | lib_gdal/gdrivers/wmts.py | 1 | 55102 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
###############################################################################
# $Id: wmts.py 33793 2016-03-26 13:02:07Z goatbar $
#
# Project: GDAL/OGR Test Suite
# Purpose: WMTS driver test suite.
# Author: Even Rouault, even dot rouault at spatialys.com
#
##########... | gpl-2.0 |
ZhangXinNan/tensorflow | tensorflow/contrib/rnn/python/ops/lstm_ops.py | 22 | 24792 | # 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 |
jinankjain/zamboni | mkt/reviewers/tests/test_forms.py | 4 | 1746 | from django.conf import settings
from django.core.files.uploadedfile import SimpleUploadedFile
from mock import patch
from nose.tools import eq_
import amo
import amo.tests
from mkt.comm.forms import CommAttachmentForm
@patch.object(settings, 'MAX_REVIEW_ATTACHMENT_UPLOAD_SIZE', 1024)
class TestReviewAppAttachment... | bsd-3-clause |
HumanExposure/factotum | dashboard/views/functional_use_curation.py | 1 | 5589 | from dashboard.models.functional_use import FunctionalUseToRawChem
from django.contrib import messages
from django.contrib.auth.mixins import LoginRequiredMixin
from django.shortcuts import render, reverse, get_object_or_404, redirect
from django.contrib.auth.decorators import login_required
from django.db.models impor... | gpl-3.0 |
hr87/advcubit | tests/block.py | 2 | 1864 | """ block module testing
"""
import unittest
import advcubit.system_module as _system
import advcubit.utility_module as _utility
import advcubit.block_module as _block
class BlockTest(unittest.TestCase):
def setUp(self):
""" test set up function """
_utility.startCubit()
_utility.newFile... | lgpl-2.1 |
guschmue/tensorflow | tensorflow/python/ops/nn_fused_batchnorm_test.py | 4 | 21424 | # 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 |
mihailignatenko/erp | addons/base_gengo/res_company.py | 321 | 1890 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Business Applications
# Copyright (C) 2004-2012 OpenERP S.A. (<http://openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms o... | agpl-3.0 |
Serveurperso/SiK | Firmware/tools/reflector.py | 26 | 1218 | #!/usr/bin/env python
# reflect input bytes to output, printing as it goes
import serial, sys, optparse
parser = optparse.OptionParser("reflector")
parser.add_option("--baudrate", type='int', default=57600, help='baud rate')
parser.add_option("--echo", action='store_true', default=False, help='echo to stdout')
parser... | bsd-2-clause |
spapadim/OctoPrint | src/octoprint/plugins/softwareupdate/updaters/pip.py | 7 | 2496 | # coding=utf-8
from __future__ import absolute_import
__author__ = "Gina Häußge <osd@foosel.net>"
__license__ = 'GNU Affero General Public License http://www.gnu.org/licenses/agpl.html'
__copyright__ = "Copyright (C) 2014 The OctoPrint Project - Released under terms of the AGPLv3 License"
import logging
import pkg_r... | agpl-3.0 |
xuweiliang/Codelibrary | openstack_dashboard/dashboards/project/access_and_security/tabs.py | 9 | 5556 | # Copyright 2012 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Copyright 2012 Nebula, Inc.
# Copyright 2012 OpenStack Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use t... | apache-2.0 |
AViisiion/namebench | nb_third_party/graphy/common.py | 205 | 15215 | #!/usr/bin/python2.4
#
# Copyright 2008 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... | apache-2.0 |
tungvx/deploy | .google_appengine/google/appengine/_internal/django/core/management/commands/syncdb.py | 23 | 8047 | from optparse import make_option
import sys
from google.appengine._internal.django.conf import settings
from google.appengine._internal.django.core.management.base import NoArgsCommand
from google.appengine._internal.django.core.management.color import no_style
from google.appengine._internal.django.core.management.sq... | apache-2.0 |
kidmaple/CoolWall | user/python/Lib/dos-8x3/test_win.py | 11 | 5449 | # Test the windows specific win32reg module.
# Only win32reg functions not hit here: FlushKey, LoadKey and SaveKey
from _winreg import *
import os, sys
test_key_name = "SOFTWARE\\Python Registry Test Key - Delete Me"
test_data = [
("Int Value", 45, REG_DWORD),
("Strin... | gpl-2.0 |
scenarios/tensorflow | tensorflow/contrib/tensor_forest/python/kernel_tests/count_extremely_random_stats_op_test.py | 22 | 14818 | # 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 |
NcLang/vimrc | sources_non_forked/YouCompleteMe/third_party/ycmd/third_party/python-future/src/past/types/olddict.py | 62 | 2735 | """
A dict subclass for Python 3 that behaves like Python 2's dict
Example use:
>>> from past.builtins import dict
>>> d1 = dict() # instead of {} for an empty dict
>>> d2 = dict(key1='value1', key2='value2')
The keys, values and items methods now return lists on Python 3.x and there are
methods for iterkeys, ite... | mit |
nielsvanoch/django | django/conf/locale/de/formats.py | 115 | 1100 | # -*- encoding: utf-8 -*-
# This file is distributed under the same license as the Django package.
#
from __future__ import unicode_literals
# The *_FORMAT strings use the Django date format syntax,
# see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
DATE_FORMAT = 'j. F Y'
TIME_FORMAT = 'H:i'
DATET... | bsd-3-clause |
Omegaphora/external_chromium_org | build/escape_unicode.py | 155 | 1482 | #!/usr/bin/env python
# Copyright (c) 2011 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.
"""Convert any unicode characters found in the input file to C literals."""
import codecs
import optparse
import os
import sys
d... | bsd-3-clause |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.