repo_name stringlengths 5 100 | path stringlengths 4 294 | copies stringclasses 990
values | size stringlengths 4 7 | content stringlengths 666 1M | license stringclasses 15
values |
|---|---|---|---|---|---|
JordanReiter/django-pyodbc | sql_server/pyodbc/base.py | 1 | 14472 | """
MS SQL Server database backend for Django.
"""
try:
import pyodbc as Database
except ImportError, e:
from django.core.exceptions import ImproperlyConfigured
raise ImproperlyConfigured("Error loading pyodbc module: %s" % e)
import re
m = re.match(r'(\d+)\.(\d+)\.(\d+)(?:-beta(\d+))?', Database.version)... | bsd-3-clause |
timlegrand/giterm | src/giterm/cursutils.py | 1 | 1232 | # -*- coding: utf-8 -*-
from __future__ import absolute_import
import curses
import pdb
import sys
import time
screen = None
def init(stdscr):
global screen
screen = stdscr
def finalize(stdscr=None):
if not stdscr and not screen:
raise Exception('either call init() first or provide a window o... | bsd-2-clause |
CDE-UNIBE/qcat | apps/qcat/management/commands/memory_profile.py | 1 | 5420 | import subprocess
from pathlib import Path
from django.core.management.base import BaseCommand
from django.db.models import Avg, Sum, Max
from django.utils.dateparse import parse_datetime
from django.utils.timezone import make_aware
from tabulate import tabulate
from qcat.models import MemoryLog
class Command(BaseC... | apache-2.0 |
mitodl/micromasters | micromasters/envs_test.py | 1 | 3916 | """Tests for environment variable parsing functions"""
from unittest.mock import patch
import pytest
from micromasters.envs import (
EnvironmentVariableParseException,
get_any,
get_bool,
get_int,
get_list_of_str,
get_string,
)
FAKE_ENVIRONS = {
'true': 'True',
'false': 'False',
'... | bsd-3-clause |
mSenyor/sl4a | python/src/Lib/xml/etree/__init__.py | 183 | 1604 | # $Id: __init__.py 1821 2004-06-03 16:57:49Z fredrik $
# elementtree package
# --------------------------------------------------------------------
# The ElementTree toolkit is
#
# Copyright (c) 1999-2004 by Fredrik Lundh
#
# By obtaining, using, and/or copying this software and/or its
# associated documentation, you ... | apache-2.0 |
40223119/2015cd_0505 | static/Brython3.1.1-20150328-091302/Lib/tokenize.py | 728 | 24424 | """Tokenization help for Python programs.
tokenize(readline) is a generator that breaks a stream of bytes into
Python tokens. It decodes the bytes according to PEP-0263 for
determining source file encoding.
It accepts a readline-like method which is called repeatedly to get the
next line of input (or b"" for EOF). ... | agpl-3.0 |
escaped/django-video-encoding | video_encoding/files.py | 1 | 1231 | from django.core.files import File
from .backends import get_backend
from .utils import get_local_path
class VideoFile(File):
"""
A mixin for use alongside django.core.files.base.File, which provides
additional features for dealing with videos.
"""
def _get_width(self):
"""
Retur... | bsd-3-clause |
Fireblend/scikit-learn | examples/linear_model/plot_sgd_penalties.py | 249 | 1563 | """
==============
SGD: Penalties
==============
Plot the contours of the three penalties.
All of the above are supported by
:class:`sklearn.linear_model.stochastic_gradient`.
"""
from __future__ import division
print(__doc__)
import numpy as np
import matplotlib.pyplot as plt
def l1(xs):
return np.array([np.... | bsd-3-clause |
GinnyN/towerofdimensions-django | django/contrib/gis/db/models/sql/query.py | 379 | 5314 | from django.db import connections
from django.db.models.query import sql
from django.contrib.gis.db.models.fields import GeometryField
from django.contrib.gis.db.models.sql import aggregates as gis_aggregates
from django.contrib.gis.db.models.sql.conversion import AreaField, DistanceField, GeomField
from django.contri... | bsd-3-clause |
BeegorMif/HTPC-Manager | tornado/test/locale_test.py | 57 | 2170 | from __future__ import absolute_import, division, print_function, with_statement
import datetime
import os
import tornado.locale
from tornado.escape import utf8
from tornado.test.util import unittest
from tornado.util import u, unicode_type
class TranslationLoaderTest(unittest.TestCase):
# TODO: less hacky way t... | gpl-3.0 |
Palasekmar/kaira | gui/datatypes.py | 8 | 9518 | #
# Copyright (C) 2013, 2014 Martin Surkovsky
# Copyright (C) 2013 Stanislav Bohm
#
# This file is part of Kaira.
#
# Kaira 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, version 3 of the Li... | gpl-3.0 |
hyperized/ansible | lib/ansible/modules/network/radware/vdirect_runnable.py | 20 | 12919 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright 2017 Radware LTD.
#
# 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... | gpl-3.0 |
yufengg/tensorflow | tensorflow/python/framework/graph_util_test.py | 36 | 15243 | # 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... | apache-2.0 |
WatanabeYasumasa/edx-platform | cms/djangoapps/contentstore/management/commands/course_id_clash.py | 29 | 1940 | """
Script for finding all courses whose org/name pairs == other courses when ignoring case
"""
from django.core.management.base import BaseCommand
from xmodule.modulestore.django import modulestore
#
# To run from command line: ./manage.py cms --settings dev course_id_clash
#
class Command(BaseCommand):
"""
... | agpl-3.0 |
benoitsteiner/tensorflow-xsmm | tensorflow/compiler/tests/stack_ops_test.py | 10 | 4361 | # 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 |
Nizametdinov/cnn-pos-tagger | server.py | 1 | 2226 | from aiohttp import web
import json
import os
from model import *
from data_reader import DataReader
from vocab import Vocab
from tensor_generator import TensorGenerator
from download_data import OPEN_CORPORA_DEST_FILE
def init():
global loader, vocab, tensor_generator
loader = DataReader(OPEN_CORPORA_DEST_F... | mit |
HackerTool/vivisect | envi/expression.py | 5 | 2531 | """
Unified expression helpers.
"""
def evaluate(pycode, locals):
return eval(pycode, {}, locals)
class ExpressionLocals(dict):
"""
An object to act as the locals dictionary for the evaluation
of envi expressions. You may pass in an envi.symstore.resolver.SymbolResolver
object to automagically us... | apache-2.0 |
darktears/chromium-crosswalk | chrome/common/extensions/docs/server2/redirector_test.py | 44 | 7508 | #!/usr/bin/env python
# Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import json
import unittest
from compiled_file_system import CompiledFileSystem
from object_store_creator import ObjectStoreCreator
fr... | bsd-3-clause |
dgarros/ansible | lib/ansible/modules/notification/pushover.py | 34 | 3712 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright (c) 2012, Jim Richardson <weaselkeeper@gmail.com>
# All rights reserved.
#
# 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 F... | gpl-3.0 |
hamsterbacke23/wagtail | wagtail/wagtaildocs/views/chooser.py | 1 | 4093 | from __future__ import absolute_import, unicode_literals
import json
from django.core.urlresolvers import reverse
from django.shortcuts import get_object_or_404, render
from wagtail.utils.pagination import paginate
from wagtail.wagtailadmin.forms import SearchForm
from wagtail.wagtailadmin.modal_workflow import rend... | bsd-3-clause |
simontakite/sysadmin | pythonscripts/programmingpython/Internet/Sockets/fork-server-signal.py | 2 | 2126 | """
Same as fork-server.py, but use the Python signal module to avoid keeping
child zombie processes after they terminate, instead of an explicit reaper
loop before each new connection; SIG_IGN means ignore, and may not work with
SIG_CHLD child exit signal on all platforms; see Linux documentation for more
about ... | gpl-2.0 |
abtink/openthread | tests/scripts/thread-cert/Cert_6_1_05_REEDAttachConnectivity.py | 4 | 5999 | #!/usr/bin/env python3
#
# 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
# ... | bsd-3-clause |
b0ri5/nishe-googlecode | scons/scons-local-1.3.0/SCons/Tool/aixlink.py | 5 | 2571 | """SCons.Tool.aixlink
Tool-specific initialization for the IBM Visual Age linker.
There normally shouldn't be any need to import this module directly.
It will usually be imported through the generic SCons.Tool.Tool()
selection method.
"""
#
# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 T... | lgpl-3.0 |
davidam/python-examples | sparql/wikidata-humans.py | 1 | 1480 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright (C) 2019 David Arroyo Menéndez
# Author: David Arroyo Menéndez <davidam@gnu.org>
# Maintainer: David Arroyo Menéndez <davidam@gnu.org>
# This file is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as p... | gpl-3.0 |
Harmon758/discord.py | discord/raw_models.py | 2 | 8605 | """
The MIT License (MIT)
Copyright (c) 2015-present Rapptz
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, modify, merg... | mit |
usersource/anno | anno_gec_server/api/account_api.py | 1 | 7816 | import endpoints
from protorpc import message_types
from protorpc import remote
import json
from helper.settings import anno_js_client_id
from helper.utils import validate_email
from helper.utils import validate_password
from helper.utils import validate_team_secret
from helper.utils import md5
from helper... | mpl-2.0 |
CapOM/ChromiumGStreamerBackend | build/android/pylib/results/flakiness_dashboard/results_uploader.py | 7 | 6766 | # Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Uploads the results to the flakiness dashboard server."""
# pylint: disable=E1002,R0201
import logging
import os
import shutil
import tempfile
import... | bsd-3-clause |
LaiTash/OEUO-python | profiles/default/scripts/value_calc.py | 1 | 6134 | from uo.serpent.script import ScriptBase
from uo.serpent.props import *
from uo.tools.items import Item, get_by_id
from uo.tools.extensions import request_target
class ValueCalculatorScript(ScriptBase):
script_name = 'Value calculator'
base_value = IntSetting('Base Value', default=1000)
area_damage_factor... | gpl-3.0 |
malin1993ml/h-store | third_party/cpp/protobuf/python/google/protobuf/internal/generator_test.py | 42 | 9038 | #! /usr/bin/python
#
# Protocol Buffers - Google's data interchange format
# Copyright 2008 Google Inc. All rights reserved.
# http://code.google.com/p/protobuf/
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# ... | gpl-3.0 |
centrologic/django-codenerix-products | codenerix_products/migrations/0001_initial.py | 1 | 61602 | # -*- coding: utf-8 -*-
# Generated by Django 1.10.8 on 2018-01-17 15:28
from __future__ import unicode_literals
import codenerix.fields
import codenerix.lib.helpers
import codenerix_products.models
import django.core.validators
from django.db import migrations, models
import django.db.models.deletion
class Migratio... | apache-2.0 |
google-code/android-scripting | python/src/Lib/test/test_signal.py | 52 | 13731 | import unittest
from test import test_support
from contextlib import closing, nested
import gc
import pickle
import select
import signal
import subprocess
import traceback
import sys, os, time, errno
if sys.platform[:3] in ('win', 'os2') or sys.platform == 'riscos':
raise test_support.TestSkipped("Can't test signa... | apache-2.0 |
mastercoin/mastercoin-source | share/qt/make_spinner.py | 4415 | 1035 | #!/usr/bin/env python
# W.J. van der Laan, 2011
# Make spinning .mng animation from a .png
# Requires imagemagick 6.7+
from __future__ import division
from os import path
from PIL import Image
from subprocess import Popen
SRC='img/reload_scaled.png'
DST='../../src/qt/res/movies/update_spinner.mng'
TMPDIR='/tmp'
TMPNAM... | mit |
waynr/jenkins-job-builder | jenkins_jobs/sphinx/yaml.py | 42 | 4925 | # Copyright 2012 Hewlett-Packard Development Company, L.P.
#
# 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... | apache-2.0 |
kingmotley/SickRage | lib/hachoir_parser/archive/zip.py | 72 | 17756 | """
Zip splitter.
Status: can read most important headers
Authors: Christophe Gisquet and Victor Stinner
"""
from hachoir_parser import Parser
from hachoir_core.field import (FieldSet, ParserError,
Bit, Bits, Enum,
TimeDateMSDOS32, SubFile,
UInt8, UInt16, UInt32, UInt64,
String, PascalString16,
Ra... | gpl-3.0 |
stopstalk/stopstalk-deployment | modules/dashboard_cards.py | 1 | 35586 | """
Copyright (c) 2015-2020 Raj Patel(raj454raj@gmail.com), StopStalk
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
... | mit |
log2timeline/plaso | tests/cli/helpers/process_resources.py | 2 | 2513 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""Tests for the process resources CLI arguments helper."""
import argparse
import unittest
from plaso.cli import tools
from plaso.cli.helpers import process_resources
from plaso.lib import errors
from tests.cli import test_lib as cli_test_lib
class ProcessResourcesAr... | apache-2.0 |
lmazuel/azure-sdk-for-python | azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/error.py | 1 | 1473 | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... | mit |
SebasSBM/django | tests/auth_tests/test_decorators.py | 279 | 4124 | from django.conf import settings
from django.contrib.auth import models
from django.contrib.auth.decorators import login_required, permission_required
from django.core.exceptions import PermissionDenied
from django.http import HttpResponse
from django.test import TestCase, override_settings
from django.test.client impo... | bsd-3-clause |
abircse06/youtube-dl | youtube_dl/extractor/sohu.py | 92 | 7209 | # encoding: utf-8
from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..compat import (
compat_str,
compat_urllib_request,
compat_urllib_parse,
)
from ..utils import (
ExtractorError,
)
class SohuIE(InfoExtractor):
_VALID_URL = r'https?://(?P<mytv>my\.)?tv\.s... | unlicense |
dls-controls/pymalcolm | tests/test_modules/test_builtin/test_choicepart.py | 1 | 1045 | import unittest
from malcolm.core import Controller, Process
from malcolm.modules.builtin.parts import ChoicePart
class TestChoicePart(unittest.TestCase):
def setUp(self):
self.o = ChoicePart(
name="cp", description="desc", choices=["a", "b"], value="a", writeable=True
)
self.... | apache-2.0 |
ruci00/redshift-gui | src/app.py | 1 | 9694 | from gi.repository import Gdk, Gio, GLib, Gtk
import sys
import re
from redshift import RedshiftHelper
from threading import Thread, Event
class RedshiftApp(Gtk.Application):
update_stopflag = Event()
def __init__(self, redshifthelper):
Gtk.Application.__init__(self)
GLib.set_prgname("Redshif... | gpl-2.0 |
Azure/azure-sdk-for-python | sdk/maps/azure-mgmt-maps/azure/mgmt/maps/_azure_maps_management_client.py | 1 | 4203 | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... | mit |
TellinaTool/awesome_nmt | bashlint/data_tools.py | 1 | 15560 | #!/usr/bin/env python
# -*- coding: UTF-8 -*-
"""Domain-specific natural Language and bash command tokenizer."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import sys
if sys.version_info > (3, 0):
from six.moves import xrange
from bashlint impor... | gpl-3.0 |
verdurin/easybuild-easyblocks | easybuild/easyblocks/h/hdf5.py | 10 | 4386 | ##
# Copyright 2009-2015 Ghent University
#
# This file is part of EasyBuild,
# originally created by the HPC team of Ghent University (http://ugent.be/hpc/en),
# with support of Ghent University (http://ugent.be/hpc),
# the Flemish Supercomputer Centre (VSC) (https://vscentrum.be/nl/en),
# the Hercules foundation (htt... | gpl-2.0 |
rokuz/omim | tools/python/booking_hotels_quality.py | 20 | 2632 | #!/usr/bin/env python
# coding: utf8
from __future__ import print_function
from collections import namedtuple, defaultdict
from datetime import datetime
from sklearn import metrics
import argparse
import base64
import json
import logging
import matplotlib.pyplot as plt
import os
import pickle
import time
import urllib... | apache-2.0 |
Pi03k/py3specto | spectlib/plugins/watch_system_port.py | 2 | 3542 | # -*- coding: utf-8 -*-
# Specto , Unobtrusive event notifier
#
# watch_system_port.py
#
# See the AUTHORS file for copyright ownership information
# 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 Fo... | gpl-2.0 |
anthrotype/robofab | Lib/robofab/tools/otFeatures.py | 9 | 4577 | """Simple module to write features to font"""
import string
from types import StringType, ListType, TupleType
from robofab.world import world
if world.inFontLab:
from FL import *
from fl_cmd import *
from robofab.tools.toolsFL import FontIndex
#feat = []
#feat.append('feature smcp {')
#feat.append('\tlook... | bsd-3-clause |
edx/lettuce | tests/integration/lib/Django-1.3/django/contrib/gis/admin/widgets.py | 321 | 4430 | from django.conf import settings
from django.contrib.gis.gdal import OGRException
from django.contrib.gis.geos import GEOSGeometry, GEOSException
from django.forms.widgets import Textarea
from django.template import loader, Context
from django.utils import translation
# Creating a template context that contains Django... | gpl-3.0 |
yjmade/odoo | addons/payment_buckaroo/controllers/main.py | 325 | 1270 | # -*- coding: utf-8 -*-
try:
import simplejson as json
except ImportError:
import json
import logging
import pprint
import werkzeug
from openerp import http, SUPERUSER_ID
from openerp.http import request
_logger = logging.getLogger(__name__)
class BuckarooController(http.Controller):
_return_url = '/pa... | agpl-3.0 |
bit-trade-one/SoundModuleAP | lib-src/lv2/lv2/waflib/Build.py | 5 | 21729 | #! /usr/bin/env python
# encoding: utf-8
# WARNING! Do not edit! http://waf.googlecode.com/git/docs/wafbook/single.html#_obtaining_the_waf_file
import os,sys,errno,re,shutil
try:
import cPickle
except ImportError:
import pickle as cPickle
from waflib import Runner,TaskGen,Utils,ConfigSet,Task,Logs,Options,C... | gpl-2.0 |
googleads/google-ads-python | google/ads/googleads/v8/errors/types/policy_violation_error.py | 1 | 1156 | # -*- 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 |
kapiziak/mtasa-blue | vendor/google-breakpad/src/tools/gyp/test/make/gyptest-noload.py | 362 | 2023 | #!/usr/bin/env python
# Copyright (c) 2010 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.
"""
Tests the use of the NO_LOAD flag which makes loading sub .mk files
optional.
"""
# Python 2.5 needs this for the with statement.
from ... | gpl-3.0 |
pyramania/scipy | scipy/io/tests/test_fortran.py | 95 | 2591 | ''' Tests for fortran sequential files '''
import tempfile
import shutil
from os import path
from glob import iglob
import re
from numpy.testing import assert_equal, assert_allclose, run_module_suite
import numpy as np
from scipy.io import FortranFile
DATA_PATH = path.join(path.dirname(__file__), 'data')
def tes... | bsd-3-clause |
alu042/edx-platform | common/lib/xmodule/xmodule/seq_module.py | 12 | 17301 | """
xModule implementation of a learning sequence
"""
# pylint: disable=abstract-method
import collections
import json
import logging
from pkg_resources import resource_string
import warnings
from lxml import etree
from xblock.core import XBlock
from xblock.fields import Integer, Scope, Boolean, String
from xblock.fr... | agpl-3.0 |
ruchee/vimrc | vimfiles/bundle/vim-python/submodules/astroid/tests/unittest_transforms.py | 1 | 8215 | # Copyright (c) 2015-2018, 2020 Claudiu Popa <pcmanticore@gmail.com>
# Copyright (c) 2015-2016 Ceridwen <ceridwenv@gmail.com>
# Copyright (c) 2016 Jakub Wilk <jwilk@jwilk.net>
# Copyright (c) 2018 Bryce Guinta <bryce.paul.guinta@gmail.com>
# Copyright (c) 2019 Ashley Whetter <ashley@awhetter.co.uk>
# Copyright (c) 2020... | mit |
nvoron23/avos | openstack_dashboard/dashboards/project/databases/views.py | 3 | 8438 | # Copyright 2013 Rackspace Hosting
#
# 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 |
wjwwood/googlemock | scripts/fuse_gmock_files.py | 729 | 8606 | #!/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 |
nnethercote/servo | tests/wpt/webgl/tests/closure-library/closure/bin/build/closurebuilder.py | 134 | 9626 | #!/usr/bin/env python
#
# Copyright 2009 The Closure Library 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
... | mpl-2.0 |
apixandru/intellij-community | python/lib/Lib/site-packages/django/conf/locale/cs/formats.py | 232 | 1288 | # -*- 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 = 'j. E Y'
TIME_FORMAT = 'G:i:s'
DATETIME_FORMAT = 'j. E Y G:i:s'
YEAR_MONTH... | apache-2.0 |
idovear/odoo | addons/account/wizard/account_vat.py | 378 | 2896 | # -*- 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 |
python-dirbtuves/Misago | misago/apps/usercp/avatar/views.py | 2 | 11249 | from path import path
from PIL import Image
from unidecode import unidecode
from zipfile import is_zipfile
from django.core.exceptions import ValidationError
from django.core.urlresolvers import reverse
from django.shortcuts import redirect
from django.utils.translation import ugettext as _
from misago import messages
... | gpl-3.0 |
Umang88/Radon-Kenzo | 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 |
internetarchive/warctools | hanzo/warcextract.py | 1 | 1774 | #!/usr/bin/env python
"""warcextract - dump warc record context to standard out"""
from __future__ import print_function
import os
import sys
import sys
import os.path
from optparse import OptionParser
from contextlib import closing
from .warctools import WarcRecord
parser = OptionParser(usage="%prog [options] wa... | mit |
mosajjal/mitmproxy | test/mitmproxy/test_proxy.py | 2 | 4742 | import os
import argparse
from unittest import mock
from OpenSSL import SSL
import pytest
from mitmproxy.tools import cmdline
from mitmproxy import options
from mitmproxy.proxy import ProxyConfig
from mitmproxy.proxy.server import DummyServer, ProxyServer, ConnectionHandler
from mitmproxy.proxy import config
from mit... | mit |
nabc2017/www | beta/phpmyadmin/doc/_ext/configext.py | 141 | 6618 | from sphinx.domains import Domain, ObjType
from sphinx.roles import XRefRole
from sphinx.domains.std import GenericObject, StandardDomain
from sphinx.directives import ObjectDescription
from sphinx.util.nodes import clean_astext, make_refnode
from sphinx.util import ws_re
from sphinx import addnodes
from sphinx.util.do... | gpl-2.0 |
genos/online_problems | euler/previous/euler70.py | 1 | 1194 | #!/usr/bin/env python
# euler70.py
from __future__ import division
import subprocess
def prime_list_faster(m, n):
"""
Returns a list of primes in [m, n].
Requires the outside program primes from http://cr.yp.to/primegen.html, so
this is really just an exercise in using the subprocess module.
"""
... | mit |
sysalexis/kbengine | kbe/res/scripts/common/Lib/sqlite3/test/hooks.py | 86 | 9414 | #-*- coding: iso-8859-1 -*-
# pysqlite2/test/hooks.py: tests for various SQLite-specific hooks
#
# Copyright (C) 2006-2007 Gerhard Häring <gh@ghaering.de>
#
# This file is part of pysqlite.
#
# This software is provided 'as-is', without any express or implied
# warranty. In no event will the authors be held liable for... | lgpl-3.0 |
bjodah/batemaneq | scripts/coverage_badge.py | 10 | 1892 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
This script generates a "coverage" badge as a svg file from
the html report from coverage.py
Usage:
$ ./coverage_badge.py htmlcov/ coverage.svg
"""
from __future__ import (absolute_import, division, print_function)
import os
# this template was generated from ... | bsd-2-clause |
sullivanmatt/splunk-sdk-python | examples/search.py | 1 | 3867 | #!/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 |
unkyulee/elastic-cms | src/web/modules/task/controllers/task/edit.py | 1 | 1574 | from flask import render_template, request
import lib.es as es
import web.util.tools as tools
def get(p):
# load task
task_id = p['nav'][-1]
p['task'] = es.get(p['host'], 'core_task', 'task', task_id)
if not p['task']:
return tools.alert('task not found - {}'.format(task_id))
if request.me... | mit |
AreaROM/android_external_skia | platform_tools/android/bin/gyp_to_android.py | 66 | 8846 | #!/usr/bin/python
# Copyright 2014 Google Inc.
#
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""
Script for generating the Android framework's version of Skia from gyp
files.
"""
import os
import shutil
import sys
import tempfile
# Find the top of trunk
SCRI... | bsd-3-clause |
kangbiao/tornado | tornado/test/simple_httpclient_test.py | 7 | 27084 | from __future__ import absolute_import, division, print_function, with_statement
import collections
from contextlib import closing
import errno
import gzip
import logging
import os
import re
import socket
import ssl
import sys
from tornado import gen
from tornado.httpclient import AsyncHTTPClient
from tornado.httputi... | apache-2.0 |
ryandvill/flask | scripts/test_import_migration.py | 141 | 2281 | # Tester for the flaskext_migrate.py module located in flask/scripts/
#
# Author: Keyan Pishdadian
import pytest
from redbaron import RedBaron
import flaskext_migrate as migrate
def test_simple_from_import():
red = RedBaron("from flask.ext import foo")
output = migrate.fix_tester(red)
assert output == "im... | bsd-3-clause |
hpi-xnor/BMXNet | example/speech-demo/io_func/feat_readers/reader_htk.py | 25 | 2240 | # 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 |
potsmaster/cinder | cinder/zonemanager/drivers/cisco/cisco_fc_zone_driver.py | 19 | 22944 | # (c) Copyright 2014 Cisco Systems 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
#
# Unl... | apache-2.0 |
w1kke/hyperopt | hyperopt/pyll/tests/test_stochastic.py | 7 | 2027 | import numpy as np
from hyperopt.pyll import scope, as_apply, dfs, rec_eval
from hyperopt.pyll.stochastic import *
def test_recursive_set_rng_kwarg():
uniform = scope.uniform
a = as_apply([uniform(0, 1), uniform(2, 3)])
rng = np.random.RandomState(234)
recursive_set_rng_kwarg(a, rng)
print a
va... | bsd-3-clause |
wtsi-hgi/serapis | serapis/domain/models/identifiers.py | 1 | 2862 | #################################################################################
#
# Copyright (c) 2013 Genome Research Ltd.
#
# Author: Irina Colgiu <ic4@sanger.ac.uk>
#
# 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 ... | agpl-3.0 |
cjcopi/healpy | healpy/__init__.py | 2 | 2998 | #
# This file is part of Healpy.
#
# Healpy 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.
#
# Healpy is distributed in the hope... | gpl-2.0 |
Sentient07/scikit-learn | examples/decomposition/plot_image_denoising.py | 70 | 6249 | """
=========================================
Image denoising using dictionary learning
=========================================
An example comparing the effect of reconstructing noisy fragments
of a raccoon face image using firstly online :ref:`DictionaryLearning` and
various transform methods.
The dictionary is fi... | bsd-3-clause |
pilou-/ansible | lib/ansible/modules/network/avi/avi_backupconfiguration.py | 31 | 4835 | #!/usr/bin/python
#
# @author: Gaurav Rastogi (grastogi@avinetworks.com)
# Eric Anderson (eanderson@avinetworks.com)
# module_check: supported
#
# Copyright: (c) 2017 Gaurav Rastogi, <grastogi@avinetworks.com>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
#
ANSIB... | gpl-3.0 |
clovett/MissionPlanner | Lib/distutils/command/register.py | 50 | 11884 | """distutils.command.register
Implements the Distutils 'register' command (register with the repository).
"""
# created 2002/10/21, Richard Jones
__revision__ = "$Id$"
import urllib2
import getpass
import urlparse
import StringIO
from warnings import warn
from distutils.core import PyPIRCCommand
fr... | gpl-3.0 |
nagyistoce/edx-platform | common/lib/xmodule/setup.py | 72 | 3491 | from setuptools import setup, find_packages
XMODULES = [
"abtest = xmodule.abtest_module:ABTestDescriptor",
"book = xmodule.backcompat_module:TranslateCustomTagDescriptor",
"chapter = xmodule.seq_module:SequenceDescriptor",
"combinedopenended = xmodule.combined_open_ended_module:CombinedOpenEndedDescri... | agpl-3.0 |
Carmezim/tensorflow | tensorflow/python/kernel_tests/fractional_max_pool_op_test.py | 107 | 24134 | # 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 |
kustodian/ansible | test/units/modules/network/cloudvision/test_cv_server_provision.py | 52 | 46155 | # 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.
#
# Ansible is distributed in the hope that ... | gpl-3.0 |
wilblack/lilybot | server/backends/__init__.py | 1 | 1198 | class ApiClientBase(object):
"""
A class to help build formstacks
"""
def __init__(self):
self.bad_responses = []
def get(self, resource, data):
uri = "%s%s" %(self.base_uri, resource)
resp = requests.get(uri)
content = json.loads(resp.text)
... | gpl-2.0 |
llhe/tensorflow | tensorflow/python/ops/distributions/distribution.py | 26 | 38424 | # 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 |
nhenezi/kuma | vendor/packages/python-dateutil/dateutil/rrule.py | 254 | 40402 | """
Copyright (c) 2003-2010 Gustavo Niemeyer <gustavo@niemeyer.net>
This module offers extensions to the standard python 2.3+
datetime module.
"""
__author__ = "Gustavo Niemeyer <gustavo@niemeyer.net>"
__license__ = "PSF License"
import itertools
import datetime
import calendar
import thread
import sys
__all__ = ["... | mpl-2.0 |
jhd/spunout | flask/lib/python2.7/site-packages/pip/_vendor/requests/packages/chardet/euckrprober.py | 2931 | 1675 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is mozilla.org 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 Reserved.
#
# Con... | gpl-3.0 |
watonyweng/horizon | openstack_dashboard/dashboards/settings/user/forms.py | 42 | 5347 | # Copyright 2012 Nebula, 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 or agree... | apache-2.0 |
jalexvig/tensorflow | tensorflow/python/kernel_tests/map_stage_op_test.py | 28 | 21057 | # 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 |
stkubr/zipline | tests/test_events_through_risk.py | 7 | 11411 | #
# Copyright 2013 Quantopian, 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 or agreed to in wr... | apache-2.0 |
Antiun/c2c-rd-addons | c2c_budget_chricar/c2c_budget.py | 4 | 7703 | # -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (c) Camptocamp SA - http://www.camptocamp.com
# Author: Arnaud WÃŒst ported by Nicolas Bessi
#
# This file is part of the c2c_budget module
#
# WARNING: This program as such is intended to be used by... | agpl-3.0 |
cce/kombu | kombu/common.py | 3 | 12037 | """
kombu.common
============
Common Utilities.
"""
from __future__ import absolute_import
import os
import socket
import threading
from collections import deque
from contextlib import contextmanager
from functools import partial
from itertools import count
from uuid import uuid4, uuid3, NAMESPACE_OID
from amqp im... | bsd-3-clause |
mwrightevent38/MissionPlanner | Lib/site-packages/numpy/lib/tests/test_function_base.py | 53 | 38511 | from numpy.testing import *
import numpy.lib
from numpy.lib import *
from numpy.core import *
from numpy import matrix, asmatrix
import numpy as np
class TestAny(TestCase):
def test_basic(self):
y1 = [0, 0, 1, 0]
y2 = [0, 0, 0, 0]
y3 = [1, 0, 1, 0]
assert(any(y1))
assert(an... | gpl-3.0 |
fabtools/fabtools | fabtools/tests/functional_tests/test_ssh.py | 14 | 1998 | """
Test SSH hardening operations
"""
from textwrap import dedent
import pytest
from fabric.api import quiet
from fabric.contrib.files import contains
from fabtools.require import file as require_file
SSHD_CONFIG = '/tmp/sshd_config'
SSHD_CONFIG_CONTENTS = [
"""
""",
"""
PasswordAuthenticatio... | bsd-2-clause |
edeposit/edeposit.amqp.aleph | setup.py | 1 | 1678 | #! /usr/bin/env python
# -*- coding: utf-8 -*-
from setuptools import setup, find_packages
from docs import getVersion
# Variables ===================================================================
changelog = open('CHANGES.rst').read()
long_description = "\n\n".join([
open('README.rst').read(),
open('CONTR... | mit |
huntxu/neutron | neutron/db/port_security/models.py | 5 | 2023 | # 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
# d... | apache-2.0 |
TheLoneRanger14/Decaf.v2 | scripts/dump-guest-memory.py | 20 | 14302 | # This python script adds a new gdb command, "dump-guest-memory". It
# should be loaded with "source dump-guest-memory.py" at the (gdb)
# prompt.
#
# Copyright (C) 2013, Red Hat, Inc.
#
# Authors:
# Laszlo Ersek <lersek@redhat.com>
#
# This work is licensed under the terms of the GNU GPL, version 2 or later. See
# th... | gpl-2.0 |
drummonds/pySage50 | setup.py | 1 | 4088 | # -*- coding: utf-8 -*-
from __future__ import print_function
import os
import sys
import imp
import subprocess
import platform
from setuptools import setup, find_packages, Command
from setuptools.command.test import test as TestCommand
class PyTest(TestCommand):
user_options = [('pytest-args=', 'a', "Arguments ... | mit |
jiangzhuo/kbengine | kbe/src/lib/python/Lib/string.py | 78 | 10444 | """A collection of string constants.
Public module variables:
whitespace -- a string containing all ASCII whitespace
ascii_lowercase -- a string containing all ASCII lowercase letters
ascii_uppercase -- a string containing all ASCII uppercase letters
ascii_letters -- a string containing all ASCII letters
digits -- a ... | lgpl-3.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.