repo_name stringlengths 5 100 | path stringlengths 4 375 | copies stringclasses 991
values | size stringlengths 4 7 | content stringlengths 666 1M | license stringclasses 15
values |
|---|---|---|---|---|---|
mydongistiny/external_chromium_org | third_party/tlslite/tlslite/utils/asn1parser.py | 206 | 1191 | # Author: Trevor Perrin
# Patch from Google adding getChildBytes()
#
# See the LICENSE file for legal information regarding use of this file.
"""Class for parsing ASN.1"""
from .compat import *
from .codec import *
#Takes a byte array which has a DER TLV field at its head
class ASN1Parser(object):
def __init__(se... | bsd-3-clause |
vainglori0us/supreme-enigma | node_modules/pygmentize-bundled/vendor/pygments/build-2.7/pygments/styles/manni.py | 364 | 2374 | # -*- coding: utf-8 -*-
"""
pygments.styles.manni
~~~~~~~~~~~~~~~~~~~~~
A colorful style, inspired by the terminal highlighting style.
This is a port of the style used in the `php port`_ of pygments
by Manni. The style is called 'default' there.
:copyright: Copyright 2006-2013 by the Pygments... | mit |
google/active-qa | px/nmt/train_combined.py | 1 | 21724 | # Copyright 2018 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | apache-2.0 |
GRArmstrong/invenio-inspire-ops | modules/websubmit/lib/websubmitadmin_regression_tests.py | 5 | 11942 | # -*- coding: utf-8 -*-
##
## This file is part of Invenio.
## Copyright (C) 2006, 2007, 2008, 2010, 2011 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 the
## Licens... | gpl-2.0 |
KevinOConnor/klipper | klippy/extras/thermistor.py | 1 | 5754 | # Temperature measurements with thermistors
#
# Copyright (C) 2016-2019 Kevin O'Connor <kevin@koconnor.net>
#
# This file may be distributed under the terms of the GNU GPLv3 license.
import math, logging
from . import adc_temperature
KELVIN_TO_CELSIUS = -273.15
# Analog voltage to temperature converter for thermisto... | gpl-3.0 |
Russell-IO/ansible | lib/ansible/modules/network/nxos/nxos_pim_interface.py | 16 | 18888 | #!/usr/bin/python
#
# 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 distribut... | gpl-3.0 |
Softmotions/edx-platform | common/lib/i18n/tests/test_extract_and_generate.py | 121 | 4581 | """
This test tests that i18n extraction (`paver i18n_extract -v`) works properly.
"""
from datetime import datetime, timedelta
import os
import random
import re
import sys
import string
import subprocess
from unittest import TestCase
from mock import patch
from polib import pofile
from pytz import UTC
from i18n impo... | agpl-3.0 |
tempbottle/kbengine | kbe/src/lib/python/Lib/test/test_codecencodings_iso2022.py | 88 | 1464 | # Codec encoding tests for ISO 2022 encodings.
from test import support
from test import multibytecodec_support
import unittest
COMMON_CODEC_TESTS = (
# invalid bytes
(b'ab\xFFcd', 'replace', 'ab\uFFFDcd'),
(b'ab\x1Bdef', 'replace', 'ab\x1Bdef'),
(b'ab\x1B$def', 'replace', 'ab\uFFFD'),... | lgpl-3.0 |
GeoscienceAustralia/PF3D | testing/extract_windprofiles_for_guntur.py | 1 | 1345 | """Test script for aim to extract wind profiles from NCEP1 data
"""
# Vent location in geographic coordinates (decimal degrees) of the Guntur crater
vent_easting = 439423
vent_northing = 9167213
vent_zone = 49
vent_hemisphere = 'S'
# Time to start extraction
start_year = 2003
start_month = 10
start_day = 29
start_hou... | gpl-3.0 |
santisiri/popego | envs/ALPHA-POPEGO/lib/python2.5/site-packages/SQLAlchemy-0.4.5-py2.5.egg/sqlalchemy/ext/sqlsoup.py | 3 | 19461 | """
Introduction
============
SqlSoup provides a convenient way to access database tables without
having to declare table or mapper classes ahead of time.
Suppose we have a database with users, books, and loans tables
(corresponding to the PyWebOff dataset, if you're curious). For
testing purposes, we'll create this... | bsd-3-clause |
alshedivat/tensorflow | tensorflow/python/keras/layers/serialization.py | 24 | 2693 | # 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 |
python-cn/flask-social-blueprint | example/sqla/website/settings.py | 5 | 2741 | # coding=utf-8
# Created 2014 by Janusz Skonieczny
import logging
import os
SRC_DIR = os.path.abspath(os.path.dirname(os.path.dirname(__file__)))
# ============================================================================
# a flask settings
# http://flask.pocoo.org/docs/config/#configuring-from-files
# =======... | mit |
31415us/trajectory | py/env/lib/python2.7/site-packages/pip/commands/search.py | 84 | 4717 | import sys
import textwrap
import pkg_resources
import pip.download
from pip.basecommand import Command, SUCCESS
from pip.util import get_terminal_size
from pip.log import logger
from pip.backwardcompat import xmlrpclib, reduce, cmp
from pip.exceptions import CommandError
from pip.status_codes import NO_MATCHES_FOUND
f... | mit |
rtucker-mozilla/mozilla_inventory | vendor-local/src/django-tastypie/tests/core/tests/throttle.py | 13 | 6172 | import time
from django.core.cache import cache
from django.test import TestCase
from tastypie.models import ApiAccess
from tastypie.throttle import BaseThrottle, CacheThrottle, CacheDBThrottle
class NoThrottleTestCase(TestCase):
def test_init(self):
throttle_1 = BaseThrottle()
self.assertEqual(th... | bsd-3-clause |
wileeam/airflow | tests/providers/google/cloud/operators/test_functions.py | 4 | 29951 | #
# 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 |
Branlala/docker-sickbeardfr | sickbeard/lib/requests/packages/chardet2/hebrewprober.py | 63 | 13248 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Universal charset detector code.
#
# The Initial Developer of the Original Code is
# Shy Shalom
# Portions created by the Initial Developer are Copyright (C) 2005
# the Initial Developer. All Rights Reserved.
#... | mit |
curtisstpierre/django | django/contrib/gis/geos/collections.py | 292 | 4986 | """
This module houses the Geometry Collection objects:
GeometryCollection, MultiPoint, MultiLineString, and MultiPolygon
"""
import json
from ctypes import byref, c_int, c_uint
from django.contrib.gis.geos import prototypes as capi
from django.contrib.gis.geos.geometry import (
GEOSGeometry, ProjectInterpolateM... | bsd-3-clause |
TRESCLOUD/odoopub | openerp/addons/base/__openerp__.py | 336 | 3703 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
# Copyright (C) 2010-2012 OpenERP s.a. (<http://openerp.com>).
#
# This program is free software: you ca... | agpl-3.0 |
CanalTP/fabric_navitia | integration_tests/test_kraken/test_distributed.py | 2 | 8607 | # encoding: utf-8
import time
from ..test_common import skipifdev
from ..test_common.test_kraken import (_test_stop_restart_kraken,
_test_stop_start_apache,
_test_test_kraken_nowait_nofail,
)
from ..u... | agpl-3.0 |
vegetableman/phantomjs | src/qt/qtwebkit/Tools/QueueStatusServer/config/charts.py | 122 | 2458 | # Copyright (C) 2013 Google Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the ... | bsd-3-clause |
dpmatthews/cylc | lib/parsec/tests/test_parsec.py | 2 | 1416 | #!/usr/bin/env python3
# THIS FILE IS PART OF THE CYLC SUITE ENGINE.
# Copyright (C) 2008-2019 NIWA & British Crown (Met Office) & Contributors.
#
# 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... | gpl-3.0 |
southpawtech/TACTIC-DEV | src/pyasm/biz/hierarchical_status_attr.py | 6 | 3607 | ###########################################################
#
# Copyright (c) 2005, Southpaw Technology
# All Rights Reserved
#
# PROPRIETARY INFORMATION. This software is proprietary to
# Southpaw Technology, and is not to be reproduced, transmitted,
# or disclosed in any way without written permi... | epl-1.0 |
dnozay/lettuce | tests/integration/lib/Django-1.2.5/django/utils/timesince.py | 319 | 2698 | import datetime
import time
from django.utils.tzinfo import LocalTimezone
from django.utils.translation import ungettext, ugettext
def timesince(d, now=None):
"""
Takes two datetime objects and returns the time between d and now
as a nicely formatted string, e.g. "10 minutes". If d occurs after now,
... | gpl-3.0 |
jackru/pybrain | pybrain/rl/environments/mazes/tasks/mdp.py | 31 | 1145 | __author__ = 'Thomas Rueckstiess, ruecksti@in.tum.de'
from pybrain.rl.environments import Task
from scipy import array
class MDPMazeTask(Task):
""" This is a MDP task for the MazeEnvironment. The state is fully observable,
giving the agent the current position of perseus. Reward is given on reaching
... | bsd-3-clause |
TravisCG/SI_scripts | vcfrevange.py | 1 | 1407 | #!/usr/bin/python
# This script is a very complicated one, because I need
# to use another script which is not suitable for a task
# but there is no better solution.
#
# So this hack helps me to run another hack.
import sys
import os
table = open(sys.argv[1])
table.readline()
for i in table:
fields = i.rstrip().spl... | gpl-3.0 |
b1-systems/kiwi | test/unit/storage_subformat_vdi_test.py | 2 | 1223 | from mock import patch
import mock
from kiwi.storage.subformat.vdi import DiskFormatVdi
class TestDiskFormatVdi(object):
@patch('platform.machine')
def setup(self, mock_machine):
mock_machine.return_value = 'x86_64'
xml_data = mock.Mock()
xml_data.get_name = mock.Mock(
re... | gpl-3.0 |
blueyed/pip | pip/_vendor/requests/packages/urllib3/poolmanager.py | 550 | 8977 | # urllib3/poolmanager.py
# Copyright 2008-2014 Andrey Petrov and contributors (see CONTRIBUTORS.txt)
#
# This module is part of urllib3 and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
import logging
try: # Python 3
from urllib.parse import urljoin
except ImportError:
... | mit |
thedrow/django | tests/select_related_onetoone/tests.py | 301 | 10516 | from __future__ import unicode_literals
import unittest
from django.core.exceptions import FieldError
from django.test import SimpleTestCase, TestCase
from .models import (
AdvancedUserStat, Child1, Child2, Child3, Child4, Image, Parent1, Parent2,
Product, StatDetails, User, UserProfile, UserStat, UserStatRe... | bsd-3-clause |
leoliujie/odoo | addons/mail/ir_attachment.py | 378 | 5643 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2014-TODAY OpenERP SA (http://www.openerp.com)
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of ... | agpl-3.0 |
sjdines/mezzanine | mezzanine/galleries/migrations/0001_initial.py | 40 | 1837 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import mezzanine.core.fields
class Migration(migrations.Migration):
dependencies = [
('pages', '__first__'),
]
operations = [
migrations.CreateModel(
name='Gallery',
... | bsd-2-clause |
inspirehep/invenio | modules/bibformat/lib/elements/bfe_record_url.py | 11 | 1270 | # -*- coding: utf-8 -*-
##
## This file is part of Invenio.
## Copyright (C) 2007, 2008, 2009, 2010, 2011 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 the
## Licens... | gpl-2.0 |
inspirehep/invenio | modules/oairepository/lib/oai_repository_webinterface.py | 3 | 6039 | ## 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 the
## License, or (at your ... | gpl-2.0 |
yvaucher/stock-logistics-barcode | __unported__/tr_barcode_on_product/__openerp__.py | 3 | 1774 | # -*- coding: utf-8 -*-
#################################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2012 Julius Network Solutions SARL <contact@julius.fr>
#
# This program is free software: you can redistribute it and/or modify
# it under th... | agpl-3.0 |
doormon/doormon-server | server/lib/jinja2/testsuite/ext.py | 402 | 18086 | # -*- coding: utf-8 -*-
"""
jinja2.testsuite.ext
~~~~~~~~~~~~~~~~~~~~
Tests for the extensions.
:copyright: (c) 2010 by the Jinja Team.
:license: BSD, see LICENSE for more details.
"""
import re
import unittest
from jinja2.testsuite import JinjaTestCase
from jinja2 import Environment, DictLoader... | gpl-2.0 |
stkubr/zipline | zipline/finance/commission.py | 33 | 5126 | #
# Copyright 2014 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 |
robbi/pyload | module/plugins/hoster/FileStoreTo.py | 6 | 2003 | # -*- coding: utf-8 -*-
import re
from ..internal.SimpleHoster import SimpleHoster
class FileStoreTo(SimpleHoster):
__name__ = "FileStoreTo"
__type__ = "hoster"
__version__ = "0.12"
__status__ = "testing"
__pattern__ = r'http://(?:www\.)?filestore\.to/\?d=(?P<ID>\w+)'
__config__ = [("activa... | gpl-3.0 |
arunkgupta/gramps | gramps/plugins/drawreport/descendtree.py | 1 | 66162 | #
# Gramps - a GTK+/GNOME based genealogy program
#
# Copyright (C) 2000-2007 Donald N. Allingham
# Copyright (C) 2007-2008 Brian G. Matherly
# Copyright (C) 2010 Jakim Friant
# Copyright (C) 2009-2010 Craig J. Anderson
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the... | gpl-2.0 |
LubyRuffy/spiderfoot | ext/stem/descriptor/server_descriptor.py | 11 | 30404 | # Copyright 2012-2015, Damian Johnson and The Tor Project
# See LICENSE for licensing information
"""
Parsing for Tor server descriptors, which contains the infrequently changing
information about a Tor relay (contact information, exit policy, public keys,
etc). This information is provided from a few sources...
* Th... | gpl-2.0 |
ChristosChristofidis/bokeh | bokeh/models/formatters.py | 18 | 12319 | """ Models for controlling the text and visual formatting of tick
labels on Bokeh plot axes.
"""
from __future__ import absolute_import
from .tickers import Ticker
from ..plot_object import PlotObject
from ..properties import Bool, Int, String, Enum, Auto, List, Dict, Either, Instance
from ..enums import DatetimeUnit... | bsd-3-clause |
mikewiebe-ansible/ansible | lib/ansible/modules/cloud/google/gcp_compute_instance.py | 10 | 70672 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2017 Google
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# ----------------------------------------------------------------------------
#
# *** AUTO GENERATED CODE *** AUTO GENERATED CODE ***
#
... | gpl-3.0 |
Fizzixnerd/pydel | del.py | 1 | 7908 | #! /usr/bin/python
# This script shouldn't be dependant on the version of python, as long
# as it's at least, like, 2.6 or something like that. Will work with
# python3.
# February 24ish, 2012 (1.0):
# * initial version
# February 27, 2012 (1.0.1):
# * changed version info
# * removed "copyright" notice
... | gpl-3.0 |
twiest/openshift-tools | openshift/installer/vendored/openshift-ansible-3.8.36-1/roles/lib_openshift/library/oc_obj.py | 6 | 57367 | #!/usr/bin/env python
# pylint: disable=missing-docstring
# flake8: noqa: T001
# ___ ___ _ _ ___ ___ _ _____ ___ ___
# / __| __| \| | __| _ \ /_\_ _| __| \
# | (_ | _|| .` | _|| / / _ \| | | _|| |) |
# \___|___|_|\_|___|_|_\/_/_\_\_|_|___|___/_ _____
# | \ / _ \ | \| |/ _ \_ _| | __| \_ ... | apache-2.0 |
saradbowman/osf.io | osf/utils/tokens/handlers.py | 3 | 4246 | from rest_framework import status as http_status
from flask import redirect, request
import markupsafe
from framework.auth.decorators import must_be_logged_in
from framework.exceptions import HTTPError, PermissionsError
from framework import status
from osf.exceptions import UnsupportedSanctionHandlerKind, TokenErro... | apache-2.0 |
mrquim/repository.mrquim | script.module.youtube.dl/lib/youtube_dl/extractor/spike.py | 34 | 2296 | from __future__ import unicode_literals
import re
from .mtv import MTVServicesInfoExtractor
class SpikeIE(MTVServicesInfoExtractor):
_VALID_URL = r'https?://(?:[^/]+\.)?spike\.com/[^/]+/[\da-z]{6}(?:[/?#&]|$)'
_TESTS = [{
'url': 'http://www.spike.com/video-clips/lhtu8m/auction-hunters-can-allen-ride... | gpl-2.0 |
wangxinxi/litecoin | test/functional/pruning.py | 10 | 21280 | #!/usr/bin/env python3
# Copyright (c) 2014-2016 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test the pruning code.
WARNING:
This test uses 4GB of disk space.
This test takes 30 mins or more (up ... | mit |
pratyushanand/linux | tools/perf/python/twatch.py | 625 | 2726 | #! /usr/bin/python
# -*- python -*-
# -*- coding: utf-8 -*-
# twatch - Experimental use of the perf python interface
# Copyright (C) 2011 Arnaldo Carvalho de Melo <acme@redhat.com>
#
# This application is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License... | gpl-2.0 |
dannyman/ganeti_webmgr | ganeti_webmgr/muddle/shots/tests/templatetags.py | 3 | 1527 | from django.template import Context, Template
from ganeti_webmgr.muddle.shots import register, TemplateMixer
from ganeti_webmgr.muddle.shots.tests.registration import ShotsTestsBase
__all__ = ['ShotTagTests']
TEMPLATE = "<b>{% load shots %}{% shot foo %}{% endshot %}</b>"
TEMPLATE_INNER = (
"<ul>{% load shots %... | gpl-2.0 |
seaotterman/tensorflow | tensorflow/python/ops/sparse_grad.py | 19 | 10174 | # 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 |
Dineshs91/youtube-dl | youtube_dl/extractor/historicfilms.py | 142 | 1580 | from __future__ import unicode_literals
from .common import InfoExtractor
from ..utils import parse_duration
class HistoricFilmsIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?historicfilms\.com/(?:tapes/|play)(?P<id>\d+)'
_TEST = {
'url': 'http://www.historicfilms.com/tapes/4728',
'md5'... | unlicense |
segwit/atbcoin-insight | qa/rpc-tests/bipdersig.py | 107 | 3245 | #!/usr/bin/env python3
# Copyright (c) 2014-2016 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
#
# Test the BIP66 changeover logic
#
from test_framework.test_framework import BitcoinTestFramework
fro... | mit |
Jgarcia-IAS/localizacion | openerp/addons/mrp/wizard/stock_move.py | 110 | 3398 | # -*- 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 |
shubhdev/edx-platform | cms/djangoapps/contentstore/views/tests/test_checklists.py | 104 | 7657 | """ Unit tests for checklist methods in views.py. """
from contentstore.utils import reverse_course_url
from contentstore.views.checklist import expand_checklist_action_url
from xmodule.modulestore.tests.factories import CourseFactory
from xmodule.modulestore.django import modulestore
import json
from contentstore.tes... | agpl-3.0 |
zeehio/META-SHARE | metashare/accounts/tests.py | 4 | 30182 | import logging
import django.test
from django.contrib.admin.helpers import ACTION_CHECKBOX_NAME
from django.contrib.admin.sites import LOGIN_FORM_KEY
from django.contrib.auth import REDIRECT_FIELD_NAME
from django.contrib.auth.models import User, Permission, Group
from django.contrib.contenttypes.models import ContentT... | bsd-3-clause |
iakovos-panourgias/fluidity | python/fluidity/diagnostics/structured_fields.py | 5 | 10761 | #!/usr/bin/env python
# This 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 the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the ... | lgpl-2.1 |
sankhesh/VTK | Rendering/Annotation/Testing/Python/xyPlot.py | 20 | 5899 | #!/usr/bin/env python
import vtk
from vtk.test import Testing
from vtk.util.misc import vtkGetDataRoot
VTK_DATA_ROOT = vtkGetDataRoot()
# create pipeline
#
pl3d = vtk.vtkMultiBlockPLOT3DReader()
pl3d.SetXYZFileName("" + str(VTK_DATA_ROOT) + "/Data/combxyz.bin")
pl3d.SetQFileName("" + str(VTK_DATA_ROOT) + "/Data/combq.... | bsd-3-clause |
vpelletier/neoppod | neo/lib/patch.py | 1 | 2705 | #
# Copyright (C) 2015-2016 Nexedi SA
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed ... | gpl-2.0 |
tianyi33/simple_blog | django/core/management/sql.py | 104 | 7942 | from __future__ import unicode_literals
import codecs
import os
import re
from django.conf import settings
from django.core.management.base import CommandError
from django.db import models
from django.db.models import get_models
from django.utils._os import upath
def sql_create(app, style, connection):
"Returns... | mit |
barachka/odoo | addons/crm/wizard/crm_lead_to_opportunity.py | 24 | 13972 | # -*- 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 |
diminishedprime/dotfiles | i3/i3-pretty-mode/i3-pretty-mode.py | 1 | 2125 | #!/usr/bin/env python3
import i3ipc
import Tkinter
import sys
import re
from functools import reduce
def parse_entry(acc, entry):
key, value = entry.split("=")
acc[key] = value
return acc
def parse_args(args):
rest = args[1:]
arg_map = reduce(parse_entry, rest, {})
return arg_map
args = parse... | mit |
donkirkby/django | django/conf/locale/en_AU/formats.py | 504 | 2117 | # -*- 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 M Y' # '25 Oc... | bsd-3-clause |
msaffarm/DeepRetina | tensorflow/tf_unet/image_util.py | 2 | 5554 | # tf_unet 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.
#
# tf_unet is distributed in the hope that it will be useful,
# but WITHOUT... | gpl-3.0 |
rahlk/Experimental-Algorithms | multiProc/src/Models/_XOMO.py | 1 | 1220 | from _model import *
import sys
import pdb
import os
_HOME = os.path.expanduser('~')
sys.path.insert(0, _HOME + "/git/ai-se/Rahul/DEADANT")
# from deadant import *
import math
import numpy as np
class Model:
def __init__(self, name):
self.name = name
if name == '_POM3':
self.model = Pom()
elif na... | mit |
bak1an/django | django/contrib/gis/gdal/raster/source.py | 23 | 13935 | import json
import os
from ctypes import addressof, byref, c_double, c_void_p
from django.contrib.gis.gdal.base import GDALBase
from django.contrib.gis.gdal.driver import Driver
from django.contrib.gis.gdal.error import GDALException
from django.contrib.gis.gdal.prototypes import raster as capi
from django.contrib.gis... | bsd-3-clause |
seem-sky/kbengine | kbe/res/scripts/common/Lib/site-packages/setuptools/tests/test_easy_install.py | 73 | 13214 | """Easy install Tests
"""
import sys
import os
import shutil
import tempfile
import unittest
import site
import contextlib
import textwrap
import tarfile
import logging
import distutils.core
from setuptools.compat import StringIO, BytesIO, next, urlparse
from setuptools.sandbox import run_setup, SandboxViolation
from ... | lgpl-3.0 |
stevenewey/django | django/db/__init__.py | 17 | 2316 | from django.core import signals
from django.db.utils import (DEFAULT_DB_ALIAS, DJANGO_VERSION_PICKLE_KEY,
DataError, OperationalError, IntegrityError, InternalError, ProgrammingError,
NotSupportedError, DatabaseError, InterfaceError, Error, ConnectionHandler,
ConnectionRouter)
__all__ = [
'backend', '... | bsd-3-clause |
loretoparisi/pattern | pattern/text/es/__init__.py | 21 | 8726 | #### PATTERN | ES ##################################################################################
# -*- coding: utf-8 -*-
# Copyright (c) 2012 University of Antwerp, Belgium
# Author: Tom De Smedt <tom@organisms.be>
# License: BSD (see LICENSE.txt for details).
# http://www.clips.ua.ac.be/pages/pattern
############... | bsd-3-clause |
brad-h/expy | ExPy/ExPy/module23.py | 1 | 1965 | """ Troubleshooting Car Issues """
QUESTIONS = [
{
'question': 'Is the car silent when you turn the key?',
'answers': {
'Yes': 1,
'No': 2
}
},
{
'question': 'Are the battery terminals corroded?',
'answers': {
'Yes': 'Clean terminal... | mit |
adamwwt/chvac | venv/lib/python2.7/site-packages/pip/_vendor/colorama/win32.py | 451 | 4833 | # Copyright Jonathan Hartley 2013. BSD 3-Clause license, see LICENSE file.
# from winbase.h
STDOUT = -11
STDERR = -12
try:
from ctypes import windll
from ctypes import wintypes
except ImportError:
windll = None
SetConsoleTextAttribute = lambda *_: None
else:
from ctypes import (
byref, Str... | mit |
mbiciunas/nix | test/config/tag/test_createTag.py | 1 | 1342 | # Nix
# Copyright (c) 2017 Mark Biciunas.
#
# 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 program is distrib... | gpl-3.0 |
ESA-VirES/eoxserver-magnetism | instance/instance/urls.py | 1 | 2679 | #-------------------------------------------------------------------------------
#
# Project: EOxServer <http://eoxserver.org>
# Authors: Stephan Krause <stephan.krause@eox.at>
# Stephan Meissl <stephan.meissl@eox.at>
#
#-------------------------------------------------------------------------------
# Copyrigh... | mit |
Endika/django-debug-toolbar | tests/panels/test_profiling.py | 4 | 2143 | from __future__ import absolute_import, unicode_literals
from django.contrib.auth.models import User
from django.db import IntegrityError, transaction
from django.test import TestCase
from django.test.utils import override_settings
from ..base import BaseTestCase
from ..views import regular_view
@override_settings(... | bsd-3-clause |
wackymaster/QTClock | Libraries/numpy/lib/tests/test_io.py | 19 | 72111 | from __future__ import division, absolute_import, print_function
import sys
import gzip
import os
import threading
from tempfile import NamedTemporaryFile
import time
import warnings
import gc
from io import BytesIO
from datetime import datetime
import numpy as np
import numpy.ma as ma
from numpy.lib._iotools import ... | mit |
pebble/pebble-tool | pebble_tool/commands/sdk/project/debug.py | 1 | 9277 | from __future__ import absolute_import, print_function, division
__author__ = 'katharine'
from six import iteritems
import collections
import os
import signal
import subprocess
from libpebble2.exceptions import TimeoutError
from libpebble2.protocol.apps import AppRunState, AppRunStateRequest, AppRunStateStart
from ... | mit |
linjoahow/w17test_1 | static/Brython3.1.1-20150328-091302/Lib/getopt.py | 845 | 7488 | """Parser for command line options.
This module helps scripts to parse the command line arguments in
sys.argv. It supports the same conventions as the Unix getopt()
function (including the special meanings of arguments of the form `-'
and `--'). Long options similar to those supported by GNU software
may be used as ... | gpl-3.0 |
alanjw/GreenOpenERP-Win-X86 | python/Lib/Crypto/Util/number.py | 127 | 95488 | #
# number.py : Number-theoretic functions
#
# Part of the Python Cryptography Toolkit
#
# Written by Andrew M. Kuchling, Barry A. Warsaw, and others
#
# ===================================================================
# The contents of this file are dedicated to the public domain. To
# the extent that dedicati... | agpl-3.0 |
aycanirican/nixops | nixops/resources/azure_reserved_ip_address.py | 6 | 6605 | # -*- coding: utf-8 -*-
# Automatic provisioning of Azure reserved IP addresses.
import os
import azure
import time
from nixops.util import attr_property
from nixops.azure_common import ResourceDefinition, ResourceState, normalize_location
from azure.mgmt.network import *
class AzureReservedIPAddressDefinition(Res... | lgpl-3.0 |
EDUlib/edx-platform | openedx/core/djangoapps/credit/routers.py | 9 | 1339 | """ DRF routers. """
from rest_framework import routers
class SimpleRouter(routers.SimpleRouter):
""" Simple DRF router. """
# Note (CCB): This is a retrofit of a DRF 2.4 feature onto DRF 2.3. This is, sadly, simpler than
# updating edx-ora2 to work with DRF 2.4. See https://github.com/tomchristie/djan... | agpl-3.0 |
abendleiter/Django-facebook | docs/docs_env/Lib/encodings/unicode_escape.py | 852 | 1184 | """ Python 'unicode-escape' Codec
Written by Marc-Andre Lemburg (mal@lemburg.com).
(c) Copyright CNRI, All Rights Reserved. NO WARRANTY.
"""
import codecs
### Codec APIs
class Codec(codecs.Codec):
# Note: Binding these as C functions will result in the class not
# converting them to methods. This is inte... | bsd-3-clause |
jacksonwilliams/arsenalsuite | cpp/lib/PyQt4/doc/sphinx/conf.py | 4 | 6459 | # -*- coding: utf-8 -*-
#
# PyQt documentation build configuration file, created by
# sphinx-quickstart on Sat May 30 14:28:55 2009.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# All co... | gpl-2.0 |
pancentric/django-cms | menus/migrations/0001_initial.py | 36 | 1235 | # -*- coding: utf-8 -*-
from south.db import db
from south.v2 import SchemaMigration
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding model 'CacheKey'
db.create_table('menus_cachekey', (
('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),... | bsd-3-clause |
google-code-export/pychess | lib/pychess/widgets/TaskerManager.py | 20 | 11005 | from __future__ import absolute_import
from gi.repository import Gtk
from gi.repository import Pango
from gi.repository import GObject
from gi.repository import GdkPixbuf
import math
import random
#from Gtk.gdk import pixbuf_new_from_file
from pychess.Players.Human import Human
from pychess.Players.engineNest import ... | gpl-3.0 |
vortex-ape/scikit-learn | sklearn/externals/joblib/_store_backends.py | 16 | 14502 | """Storage providers backends for Memory caching."""
import re
import os
import os.path
import datetime
import json
import shutil
import warnings
import collections
import operator
import threading
from abc import ABCMeta, abstractmethod
from ._compat import with_metaclass, _basestring
from .backports import concurre... | bsd-3-clause |
jtbandes/swift | utils/swift_build_support/tests/test_workspace.py | 58 | 7061 | # tests/test_workspace.py ---------------------------------------*- python -*-
#
# This source file is part of the Swift.org open source project
#
# Copyright (c) 2014 - 2017 Apple Inc. and the Swift project authors
# Licensed under Apache License v2.0 with Runtime Library Exception
#
# See https://swift.org/LICENSE.tx... | apache-2.0 |
dentaku65/pelisalacarta | python/main-classic/servers/lumfile.py | 43 | 1270 | # -*- coding: utf-8 -*-
#------------------------------------------------------------
# pelisalacarta - XBMC Plugin
# Conector para lumfile
# http://blog.tvalacarta.info/plugin-xbmc/pelisalacarta/
#------------------------------------------------------------
import urlparse,urllib2,urllib,re
import os
from core impor... | gpl-3.0 |
christinahedges/PyKE | pyke/tests/test_utils.py | 2 | 1732 | import argparse
from numpy.testing import assert_almost_equal
from ..utils import PyKEArgumentHelpFormatter
from ..utils import module_output_to_channel, channel_to_module_output
from ..utils import running_mean
def test_PyKEArgumentHelpFormatter():
parser = argparse.ArgumentParser(
description=(... | mit |
madjam/mxnet | example/module/python_loss.py | 26 | 2816 | # 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 |
kennho/oppia | core/storage/base_model/gae_models_test.py | 18 | 3158 | # coding: utf-8
#
# Copyright 2014 The Oppia 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 requi... | apache-2.0 |
ClearCorp-dev/odoo-clearcorp | TODO-8.0/sale_order_ccorp_report/ccorp_sale.py | 3 | 2450 | # -*- encoding: utf-8 -*-
##############################################################################
#
# ccorp_account.py
# ccorp_account
# First author: Carlos Vásquez <carlos.vasquez@clearcorp.co.cr> (ClearCorp S.A.)
# Copyright (c) 2010-TODAY ClearCorp S.A. (http://clearcorp.co.cr). All rights reserv... | agpl-3.0 |
openpgh/askpgh | askbot/user_messages/context_processors.py | 10 | 1947 | """
Context processor for lightweight session messages.
Time-stamp: <2008-07-19 23:16:19 carljm context_processors.py>
"""
from django.conf import settings as django_settings
from django.utils.encoding import StrAndUnicode
from askbot.user_messages import get_and_delete_messages
def user_messages(request):
"""
... | gpl-3.0 |
krunal3103/servo | tests/wpt/web-platform-tests/tools/pytest/testing/test_resultlog.py | 171 | 7770 | import os
import _pytest._code
import py
import pytest
from _pytest.main import Node, Item, FSCollector
from _pytest.resultlog import generic_path, ResultLog, \
pytest_configure, pytest_unconfigure
def test_generic_path(testdir):
from _pytest.main import Session
config = testdir.parseconfig()
ses... | mpl-2.0 |
heytcass/homeassistant-config | deps/requests/packages/chardet/codingstatemachine.py | 2931 | 2318 | ######################## 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... | mit |
pamoakoy/invenio | modules/bibformat/lib/elements/bfe_fulltext.py | 1 | 15271 | # -*- coding: utf-8 -*-
##
## This file is part of Invenio.
## Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011 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 the
## ... | gpl-2.0 |
reinout/django | django/core/management/commands/loaddata.py | 2 | 14253 | import functools
import glob
import gzip
import os
import sys
import warnings
import zipfile
from itertools import product
from django.apps import apps
from django.conf import settings
from django.core import serializers
from django.core.exceptions import ImproperlyConfigured
from django.core.management.base import Ba... | bsd-3-clause |
renzon/antigonovo | antigonovo/urls.py | 1 | 1328 | """antigonovo URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/2.0/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, name='home')
Class-ba... | agpl-3.0 |
ryanoberto/homevolution | server.py | 1 | 11051 | #!/usr/bin/python
# all the imports
import sqlite3
import os.path
from flask import Flask, request, session, g, redirect, url_for, abort, render_template, flash
from homevolution.db import init_db
from flask_cors import CORS
from contextlib import closing
from homevolution.device import action, get_devices, list_device... | mit |
microresearch/diana | weight-test.py | 1 | 5228 | import nltk,random
from pyevolve import G1DList
from pyevolve import GSimpleGA, Consts
from pyevolve import Selectors
from pyevolve import Initializators, Mutators, Crossovers
import math
from textclean.textclean import textclean
train_txt = open("/root/diana/chapters/3_glass-crash/texts/allnvfmold").read()
#train_txt... | gpl-2.0 |
WilliamDiakite/ExperimentationsACA | processing/image_processing/main.py | 1 | 1560 | import numpy as np
import matplotlib.pyplot as plt
from PIL import Image
import pytesseract
from scipy import misc
from sklearn.cluster import KMeans
def remove_dominant_color(image):
# Reshape image for kmeans
image = np.reshape(image, (image.shape[0]*image.shape[1]))
image = np.reshape(image, (-1, 1))
# F... | mit |
bruckhaus/challenges | python_challenges/project_euler/p032_pandigital_products.py | 1 | 2935 | # coding=utf-8
import os
import sys
current_path = os.path.dirname(os.path.abspath(__file__))
lib_path = os.path.join(current_path, '..')
sys.path.append(lib_path)
from lib.pandigital import Pandigital
class PandigitalProducts:
"""
Pandigital products
Problem 32
We shall say that an n-digit number ... | mit |
VeryLonelyCocks/shiva | shiva/__init__.py | 1 | 1038 | from .core import Core
from .config import config
import datetime
from .commands import TelegramCommands
core = Core(config)
telegramHandler = TelegramCommands(core)
# def log_event(event):
# table = core.db['events']
# date = datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S")
# event_model = {
# ... | gpl-3.0 |
dvliman/jaikuengine | .google_appengine/lib/django-1.5/django/contrib/auth/tests/remote_user.py | 91 | 7817 | from datetime import datetime
from django.conf import settings
from django.contrib.auth import authenticate
from django.contrib.auth.backends import RemoteUserBackend
from django.contrib.auth.models import User, AnonymousUser
from django.contrib.auth.tests.utils import skipIfCustomUser
from django.test import TestCase... | apache-2.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.