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 |
|---|---|---|---|---|---|
390910131/Misago | misago/threads/views/generic/posting.py | 8 | 5575 | from django.contrib import messages
from django.db.transaction import atomic
from django.http import JsonResponse
from django.shortcuts import redirect
from django.utils import html
from django.utils.translation import ugettext as _
from django.views.generic import View
from misago.core.errorpages import not_allowed
f... | gpl-2.0 |
junhuac/MQUIC | depot_tools/ENV/lib/python2.7/site-packages/google/protobuf/internal/encoder.py | 31 | 26717 | # 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:
#
# * Redistributions o... | mit |
SteveClement/crazyflie-clients-python | lib/cfclient/utils/input/inputinterfaces/zmqpull.py | 4 | 3808 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# || ____ _ __
# +------+ / __ )(_) /_______________ _____ ___
# | 0xBC | / __ / / __/ ___/ ___/ __ `/_ / / _ \
# +------+ / /_/ / / /_/ /__/ / / /_/ / / /_/ __/
# || || /_____/_/\__/\___/_/ \__,_/ /___/\___/
#
# Copyright (C) 20... | gpl-2.0 |
aronsky/home-assistant | homeassistant/components/skybell.py | 5 | 2781 | """
Support for the Skybell HD Doorbell.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/skybell/
"""
import logging
from requests.exceptions import HTTPError, ConnectTimeout
import voluptuous as vol
from homeassistant.const import (
ATTR_ATTRIBUTIO... | apache-2.0 |
adamchainz/ansible | lib/ansible/plugins/lookup/credstash.py | 131 | 1891 | # (c) 2015, Ensighten <infra@ensighten.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version... | gpl-3.0 |
Sonicbids/django | tests/modeladmin/models.py | 147 | 1539 | # -*- coding: utf-8 -*-
from django.contrib.auth.models import User
from django.db import models
from django.utils.encoding import python_2_unicode_compatible
@python_2_unicode_compatible
class Band(models.Model):
name = models.CharField(max_length=100)
bio = models.TextField()
sign_date = models.DateFiel... | bsd-3-clause |
mattboyer/sqbrite | src/record.py | 1 | 5656 | # MIT License
#
# Copyright (c) 2017 Matt Boyer
#
# 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, merge, p... | mit |
Limags/MissionPlanner | Lib/site-packages/scipy/fftpack/tests/test_basic.py | 51 | 30299 | #!"C:\Users\hog\Documents\Visual Studio 2010\Projects\ArdupilotMega\ArdupilotMega\bin\Debug\ipy.exe"
# Created by Pearu Peterson, September 2002
""" Test functions for fftpack.basic module
"""
__usage__ = """
Build fftpack:
python setup_fftpack.py build
Run tests if scipy is installed:
python -c 'import scipy;scipy... | gpl-3.0 |
seaotterman/tensorflow | tensorflow/python/lib/io/python_io.py | 112 | 1273 | # 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 |
toobaz/pandas | pandas/tests/indexes/timedeltas/test_setops.py | 2 | 6937 | import numpy as np
import pytest
import pandas as pd
from pandas import Int64Index, TimedeltaIndex, timedelta_range
import pandas.util.testing as tm
from pandas.tseries.offsets import Hour
class TestTimedeltaIndex:
def test_union(self):
i1 = timedelta_range("1day", periods=5)
i2 = timedelta_ran... | bsd-3-clause |
danielvdende/incubator-airflow | airflow/migrations/versions/86770d1215c0_add_kubernetes_scheduler_uniqueness.py | 7 | 1318 | # flake8: noqa
#
# 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
# distrib... | apache-2.0 |
krafczyk/spack | lib/spack/spack/package_prefs.py | 4 | 9389 | ##############################################################################
# Copyright (c) 2013-2018, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
# This file is part of Spack.
# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
# LLNL-CODE-64... | lgpl-2.1 |
popazerty/e2-gui | lib/python/Tools/KeyBindings.py | 4 | 9650 | keyBindings = {}
from keyids import KEYIDS
from Components.config import config
from Components.RcModel import rc_model
keyDescriptions = [
{
KEYIDS["BTN_0"]: ("UP", "fp"),
KEYIDS["BTN_1"]: ("DOWN", "fp"),
KEYIDS["KEY_OK"]: ("OK", ""),
KEYIDS["KEY_UP"]: ("UP",),
KEYIDS["KEY_DOWN"]: ("DOWN",),
KEYIDS["KEY... | gpl-2.0 |
nvoron23/scikit-learn | sklearn/linear_model/tests/test_theil_sen.py | 234 | 9928 | """
Testing for Theil-Sen module (sklearn.linear_model.theil_sen)
"""
# Author: Florian Wilhelm <florian.wilhelm@gmail.com>
# License: BSD 3 clause
from __future__ import division, print_function, absolute_import
import os
import sys
from contextlib import contextmanager
import numpy as np
from numpy.testing import ... | bsd-3-clause |
CobraDroid/android_kernel_goldfish | tools/perf/scripts/python/syscall-counts-by-pid.py | 11180 | 1927 | # system call counts, by pid
# (c) 2010, Tom Zanussi <tzanussi@gmail.com>
# Licensed under the terms of the GNU GPL License version 2
#
# Displays system-wide system call totals, broken down by syscall.
# If a [comm] arg is specified, only syscalls called by [comm] are displayed.
import os, sys
sys.path.append(os.env... | gpl-2.0 |
muzixing/ryu | pbr-0.10.0-py2.7.egg/pbr/tests/base.py | 10 | 5950 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2010-2011 OpenStack Foundation
# Copyright (c) 2013 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 Lic... | apache-2.0 |
flgiordano/netcash | +/google-cloud-sdk/lib/googlecloudsdk/third_party/appengine/tools/appengine_rpc_test_util.py | 1 | 6895 | # Copyright 2016 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | bsd-3-clause |
niktre/espressopp | src/interaction/VSpherePair.py | 5 | 4571 | # Copyright (C) 2012,2013,2017
# Max Planck Institute for Polymer Research
# Copyright (C) 2008,2009,2010,2011
# Max-Planck-Institute for Polymer Research & Fraunhofer SCAI
#
# This file is part of ESPResSo++.
#
# ESPResSo++ is free software: you can redistribute it and/or modify
# it under the terms... | gpl-3.0 |
tadebayo/myedge | myvenv/Lib/site-packages/crispy_forms/helper.py | 15 | 14337 | # -*- coding: utf-8 -*-
import re
from django.core.urlresolvers import reverse, NoReverseMatch
from django.utils.safestring import mark_safe
from crispy_forms.compatibility import string_types
from crispy_forms.layout import Layout
from crispy_forms.layout_slice import LayoutSlice
from crispy_forms.utils import rende... | mit |
lyndonChen/eonboard | eoncloud_web/cloud/api/ceilometer.py | 4 | 44217 | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under t... | apache-2.0 |
damien-dg/horizon | openstack_dashboard/dashboards/project/loadbalancers/tests.py | 14 | 38461 | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under t... | apache-2.0 |
Intel-Corporation/tensorflow | tensorflow/contrib/predictor/contrib_estimator_predictor_test.py | 93 | 2508 | # 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 |
prateek05/crfsuite | bench/bench_wapiti.py | 7 | 2013 | #!/usr/bin/env python
import sys
import os
import string
from bench import *
WAPITI='/home/okazaki/install/wapiti-1.1.3/wapiti'
OUTDIR='wapiti/'
training_patterns = (
('num_features', r'nb features: (\d+)', 1, int, last),
('time', r'^([\d.]+)user ([\d.]+)system', (1, 2), float, sum),
('iterations', r'\[\... | bsd-3-clause |
soulweaver91/batchpatch | batchpatch.py | 1 | 27396 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
__author__ = 'Soulweaver'
import argparse
import os
import re
import time
import shutil
import colorama
import subprocess
import unicodedata
import gettext
import zipfile
import zlib
from datetime import datetime
from dateutil import tz
from logger import LogLevel, Logger
... | mit |
nan86150/shadowsocks | shadowsocks/server.py | 652 | 4836 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2015 clowwindy
#
# 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 requir... | apache-2.0 |
mitchelljkotler/django | tests/contenttypes_tests/tests.py | 76 | 18947 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import datetime
from django.apps.registry import Apps, apps
from django.contrib.contenttypes import management
from django.contrib.contenttypes.fields import (
GenericForeignKey, GenericRelation,
)
from django.contrib.contenttypes.models import Conte... | bsd-3-clause |
TheMightyX/PreminePlus | contrib/bitrpc/bitrpc.py | 2348 | 7835 | from jsonrpc import ServiceProxy
import sys
import string
# ===== BEGIN USER SETTINGS =====
# if you do not set these you will be prompted for a password for every command
rpcuser = ""
rpcpass = ""
# ====== END USER SETTINGS ======
if rpcpass == "":
access = ServiceProxy("http://127.0.0.1:8332")
else:
access = Ser... | mit |
dionisos2/CI | src/centres_of_interest_manager.py | 1 | 14888 | """
See CentresOfInterestManager class
"""
import re
import mylib.checking as checking
from mylib.string_op import replace_special_char
from mylib.notifier import Notifier
from xml.dom import minidom
from lxml import etree
from centre_of_interest import CentreOfInterest
def identity(x):
return x
class CentresOfI... | gpl-2.0 |
sahiljain/catapult | telemetry/telemetry/util/statistics_unittest.py | 84 | 8162 | # 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.
import math
import random
import unittest
from telemetry.util import statistics
def Relax(samples, iterations=10):
"""Lloyd relaxation in 1D.
Keeps t... | bsd-3-clause |
luzheqi1987/nova-annotation | nova/paths.py | 36 | 2182 | # Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
# Copyright 2012 Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the ... | apache-2.0 |
Jaiz909/youtube-dl | youtube_dl/extractor/toypics.py | 150 | 2768 | # -*- coding:utf-8 -*-
from __future__ import unicode_literals
from .common import InfoExtractor
import re
class ToypicsIE(InfoExtractor):
IE_DESC = 'Toypics user profile'
_VALID_URL = r'https?://videos\.toypics\.net/view/(?P<id>[0-9]+)/.*'
_TEST = {
'url': 'http://videos.toypics.net/view/514/cha... | unlicense |
canassa/django-rest-framework | tests/test_atomic_requests.py | 60 | 5244 | from __future__ import unicode_literals
from django.conf.urls import patterns, url
from django.db import connection, connections, transaction
from django.http import Http404
from django.test import TestCase, TransactionTestCase
from django.utils.decorators import method_decorator
from django.utils.unittest import skip... | bsd-2-clause |
skorokithakis/django-fancy-cache | fancy_tests/tests/test_views.py | 1 | 8032 | import unittest
import re
from nose.tools import eq_, ok_
from django.test.client import RequestFactory
from django.core.cache import cache
from fancy_cache.memory import find_urls
from . import views
class TestViews(unittest.TestCase):
def setUp(self):
self.factory = RequestFactory()
def tearDown(... | bsd-3-clause |
pombredanne/similarityPy | tests/algorihtm_tests/find_nearest_tests/numerical_data/normalized_squared_euclidean_distance_test.py | 2 | 4264 | from unittest import TestCase
from similarityPy.algorithms.find_nearest import FindNearest
from similarityPy.measure.numerical_data.normalized_squared_euclidean_distance import NormalizedSquaredEuclideanDistance
from tests import test_logger
__author__ = 'cenk'
class FindNearestTest(TestCase):
def setUp(self):... | mit |
lordB8r/polls | ENV/lib/python2.7/site-packages/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... | mit |
mitocw/edx-platform | lms/djangoapps/certificates/tests/factories.py | 3 | 2699 | # Factories are self documenting
from uuid import uuid4
from factory.django import DjangoModelFactory
from lms.djangoapps.certificates.models import (
CertificateHtmlViewConfiguration,
CertificateInvalidation,
CertificateStatuses,
CertificateWhitelist,
GeneratedCertificate
)
from student.models ... | agpl-3.0 |
ProteinDF/QCLObot | tests/test_amberobject.py | 1 | 1267 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import unittest
import cProfile
from pstats import Stats
from qclobot.amberobject import AmberObject
from qclobot.utils import get_model
import proteindf_bridge as bridge
class TestAmberObject(unittest.TestCase):
def setUp(self):
pass
#self.pr = cProf... | gpl-3.0 |
epssy/hue | desktop/core/ext-py/guppy-0.1.10/guppy/heapy/test/test_Classifiers.py | 37 | 26467 | #._cv_part guppy.heapy.test.test_Classifiers
from guppy.heapy.test import support
PORTABLE_TEST = 1 # Relax tests to be more portable
class TestCase(support.TestCase):
def setUp(self):
support.TestCase.setUp(self)
self.View.is_rg_update_all = False
self.US = US = self.heapy.UniSet
self.Use = Use = self.he... | apache-2.0 |
tjsavage/rototutor_djangononrel | django/contrib/admin/widgets.py | 15 | 11759 | """
Form Widget classes specific to the Django admin site.
"""
import django.utils.copycompat as copy
from django import forms
from django.forms.widgets import RadioFieldRenderer
from django.forms.util import flatatt
from django.utils.html import escape
from django.utils.text import truncate_words
from django.utils.t... | bsd-3-clause |
sanbinabu/Wox | PythonHome/Lib/site-packages/requests/adapters.py | 293 | 14608 | # -*- coding: utf-8 -*-
"""
requests.adapters
~~~~~~~~~~~~~~~~~
This module contains the transport adapters that Requests uses to define
and maintain connections.
"""
import socket
from .models import Response
from .packages.urllib3.poolmanager import PoolManager, proxy_from_url
from .packages.urllib3.response impo... | mit |
maohongyuan/kbengine | kbe/src/lib/python/Tools/scripts/md5sum.py | 58 | 2508 | #! /usr/bin/env python3
"""Python utility to print MD5 checksums of argument files.
"""
bufsize = 8096
fnfilter = None
rmode = 'rb'
usage = """
usage: md5sum.py [-b] [-t] [-l] [-s bufsize] [file ...]
-b : read files in binary mode (default)
-t : read files in text mode (you almost certainly don't want... | lgpl-3.0 |
indictranstech/fbd_frappe | frappe/templates/pages/login.py | 33 | 7237 | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
from __future__ import unicode_literals
import frappe
import json
import frappe.utils
from frappe import _
class SignupDisabledError(frappe.PermissionError): pass
no_cache = True
def get_context(context):
if frappe.... | mit |
Chilledheart/chromium | tools/telemetry/third_party/gsutilz/third_party/boto/boto/pyami/startup.py | 153 | 2475 | # Copyright (c) 2006,2007 Mitch Garnaat http://garnaat.org/
#
# 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, modi... | bsd-3-clause |
sanja7s/SR_Twitter | src_general/explain_FORMATION_DELETION_REL.py | 1 | 6415 | #!/usr/bin/env python
# a bar plot with errorbars
import matplotlib
import numpy as np
import matplotlib.pyplot as plt
from matplotlib.patches import Ellipse, Polygon
from pylab import *
width = 0.28 # the width of the bars
font = {'family' : 'sans-serif',
'variant' : 'normal',
'weight' : 'light',
... | mit |
BartoszCichecki/onlinepython | onlinepython/pypy-2.4.0-win32/lib-python/2.7/multiprocessing/reduction.py | 217 | 6582 | #
# Module to allow connection and socket objects to be transferred
# between processes
#
# multiprocessing/reduction.py
#
# Copyright (c) 2006-2008, R Oudkerk
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditio... | gpl-2.0 |
andyfaff/scipy | scipy/stats/tests/test_qmc.py | 10 | 40495 | import os
from collections import Counter
import pytest
import numpy as np
from numpy.testing import (assert_allclose, assert_almost_equal,
assert_equal, assert_array_almost_equal,
assert_array_equal)
from scipy.stats import shapiro
from scipy.stats._sobol import ... | bsd-3-clause |
dbckz/ansible | lib/ansible/modules/system/debconf.py | 63 | 5925 | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""
Ansible module to configure .deb packages.
(c) 2014, Brian Coca <briancoca+ansible@gmail.com>
This file is part of Ansible
Ansible is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Softwa... | gpl-3.0 |
HiSPARC/station-software | user/python/Lib/site-packages/win32comext/mapi/emsabtags.py | 2 | 61422 | # Converted "manually" from EMSABTAG.H
from .mapitags import PT_UNSPECIFIED, PT_NULL, PT_I2, PT_LONG, PT_R4, \
PT_DOUBLE, PT_CURRENCY, PT_APPTIME, PT_ERROR, \
PT_BOOLEAN, PT_OBJECT, PT_I8, PT_STRING8, PT_UNICODE, \
PT_SYSTIME, PT_CLSID, PT_BINARY, PT_SHO... | gpl-3.0 |
CouchPotato/CouchPotatoServer | libs/guessit/matcher.py | 94 | 7768 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# GuessIt - A library for guessing information from filenames
# Copyright (c) 2012 Nicolas Wack <wackou@gmail.com>
#
# GuessIt is free software; you can redistribute it and/or modify it under
# the terms of the Lesser GNU General Public License as published by
# the Free ... | gpl-3.0 |
etos/django | django/db/backends/dummy/base.py | 125 | 2244 | """
Dummy database backend for Django.
Django uses this if the database ENGINE setting is empty (None or empty string).
Each of these API functions, except connection.close(), raise
ImproperlyConfigured.
"""
from django.core.exceptions import ImproperlyConfigured
from django.db.backends.base.base import BaseDatabase... | bsd-3-clause |
wwjiang007/flink | flink-python/pyflink/table/environment_settings.py | 7 | 11623 | ################################################################################
# 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... | apache-2.0 |
incf-nidash/nidm-results_afni | test/test_fsl_export.py | 2 | 11158 | #!/usr/bin/env python
"""
Test of NIDM FSL export tool
@author: Camille Maumet <c.m.j.maumet@warwick.ac.uk>
@copyright: University of Warwick 2013-2014
"""
import unittest
import os
from rdflib.graph import Graph
import shutil
import sys
import logging
logger = logging.getLogger(__name__)
# Display log messages in c... | mit |
tumbl3w33d/ansible | test/units/modules/network/fortios/test_fortios_webfilter_search_engine.py | 20 | 9717 | # Copyright 2019 Fortinet, Inc.
#
# 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 distributed in the... | gpl-3.0 |
DavidCPhillips/spfjs | configure.py | 1 | 26384 | #!/usr/bin/env python
#
# Copyright 2014 Google Inc. All rights reserved.
#
# Use of this source code is governed by The MIT License.
# See the LICENSE file for details.
"""Script that generates the build.ninja file for SPF."""
__author__ = 'nicksay@google.com (Alex Nicksay)'
import errno
import distutils.version
im... | mit |
LittleRichard/luxalert | luxweb/luxweb/spiders/KensingtonSpider.py | 1 | 4229 | import datetime
import re
import scrapy
from nest.storage.luxalert.entity.Apartment import Apartment
from nest.storage.luxalert.entity.ApartmentSnapshot import ApartmentSnapshot
from luxweb.luxweb import HMTL_SPIDER_DATA_TUPLE_KEY
from luxweb.luxweb.ScrapeErrorHandler import ScrapeErrorHandler
from luxweb.luxweb.spid... | gpl-3.0 |
ephes/scikit-learn | sklearn/feature_selection/base.py | 149 | 4186 | # -*- coding: utf-8 -*-
"""Generic feature selection mixin"""
# Authors: G. Varoquaux, A. Gramfort, L. Buitinck, J. Nothman
# License: BSD 3 clause
from abc import ABCMeta, abstractmethod
from warnings import warn
import numpy as np
from scipy.sparse import issparse, csc_matrix
from ..base import TransformerMixin
f... | bsd-3-clause |
gdhungana/desispec | py/desispec/pipeline/core.py | 2 | 2958 | #
# See top-level LICENSE.rst file for Copyright information
#
# -*- coding: utf-8 -*-
"""
desispec.pipeline.core
======================
Core functions.
"""
from __future__ import absolute_import, division, print_function
import os
import time
import desispec.log
def runcmd(cmd, args=None, inputs=[], outputs=[], c... | bsd-3-clause |
clovertrail/cloudinit-bis | cloudinit/config/cc_scripts_per_boot.py | 1 | 1760 | # vi: ts=4 expandtab
#
# Copyright (C) 2011 Canonical Ltd.
# Copyright (C) 2012 Hewlett-Packard Development Company, L.P.
#
# Author: Scott Moser <scott.moser@canonical.com>
# Author: Juerg Haefliger <juerg.haefliger@hp.com>
#
# This program is free software: you can redistribute it and/or modify
# it... | gpl-3.0 |
gitonio/pycoin | tests/tx_test.py | 12 | 11802 | #!/usr/bin/env python
import binascii
import unittest
from pycoin.serialize import b2h, h2b_rev
from pycoin.tx.Tx import Tx
TX_E1A18B843FC420734DEEB68FF6DF041A2585E1A0D7DBF3B82AAB98291A6D9952_HEX = (
"0100000001a8f57056b016d7d243fc0fc2a73f9146e7e4c7766ec6033b5ac4cb89c"
"64e19d0000000008a4730440220251acb534ba... | mit |
anggorodewanto/oppia | core/domain/value_generators_domain_test.py | 23 | 1202 | # 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 |
doduytrung/odoo-8.0 | addons/account/project/report/analytic_balance.py | 358 | 7060 | # -*- 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 |
superdesk/superdesk-core | content_api/tests/items_versions_service_test.py | 2 | 2014 | # -*- coding: utf-8; -*-
#
# This file is part of Superdesk.
#
# Copyright 2013, 2014, 2015, 2016, 2017 Sourcefabric z.u. and contributors.
#
# For the full copyright and license information, please see the
# AUTHORS and LICENSE files distributed with this source code, or
# at https://www.sourcefabric.org/superdesk/lic... | agpl-3.0 |
DentonGentry/jinja2 | tests/test_security.py | 23 | 6015 | # -*- coding: utf-8 -*-
"""
jinja2.testsuite.security
~~~~~~~~~~~~~~~~~~~~~~~~~
Checks the sandbox and other security features.
:copyright: (c) 2010 by the Jinja Team.
:license: BSD, see LICENSE for more details.
"""
import pytest
from jinja2 import Environment
from jinja2.sandbox import Sandboxe... | bsd-3-clause |
atruberg/django-custom | django/utils/tzinfo.py | 119 | 3263 | "Implementation of tzinfo classes for use with datetime.datetime."
from __future__ import unicode_literals
import time
from datetime import timedelta, tzinfo
from django.utils.encoding import force_str, force_text, DEFAULT_LOCALE_ENCODING
# Python's doc say: "A tzinfo subclass must have an __init__() method that ca... | bsd-3-clause |
doismellburning/edx-platform | cms/djangoapps/contentstore/features/video_editor.py | 101 | 11308 | # -*- coding: utf-8 -*-
# disable missing docstring
# pylint: disable=missing-docstring
import requests
from lettuce import world, step
from nose.tools import assert_true, assert_equal, assert_in, assert_not_equal # pylint: disable=no-name-in-module
from terrain.steps import reload_the_page
from django.conf import se... | agpl-3.0 |
terrameijar/oppia | core/domain/stats_jobs_continuous.py | 3 | 32921 | # 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 required by applicable ... | apache-2.0 |
webnotes/wnframework | core/doctype/page/page.py | 34 | 2806 | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
from __future__ import unicode_literals
import webnotes
class DocType:
def __init__(self, d, dl):
self.doc, self.doclist = d,dl
def autoname(self):
"""
Creates a url friendly name for this page.
Will r... | mit |
huggingface/pytorch-transformers | tests/test_modeling_tf_mt5.py | 2 | 2170 | # coding=utf-8
# Copyright 2020 The HuggingFace Team. 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 requir... | apache-2.0 |
joshrule/LOTlib | LOTlib/Legacy/MCMCSummary/MCMCSummary.py | 3 | 5607 |
import pickle
from LOTlib import break_ctrlc
class MCMCSummary(object):
"""Superclass for collecting, computing, and displaying summary statistics from model runs.
Arguments:
skip (int): Skip this many samples before adding another; e.g. if skip=100, take 1 sample every 100.
cap (int): If we... | gpl-3.0 |
AMOboxTV/AMOBox.LegoBuild | plugin.video.salts/scrapers/onlinedizi_scraper.py | 1 | 4676 | """
SALTS XBMC Addon
Copyright (C) 2014 tknorris
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.
T... | gpl-2.0 |
hailongqiu/new-deepin-media-player | src/plugins/youku/youku_web_parse.py | 1 | 5006 | #! /usr/bin/python
# -*- coding: utf-8 -*-
# Copyright (C) 2013 XXX, Inc.
# 2013 红铭曼,王芳
#
# Author: 红铭曼,王芳 <hongmingman@sina.com>
# Maintainer: 红铭曼,王芳 <hongmingman@sina.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License ... | gpl-3.0 |
savoirfairelinux/django | tests/model_fields/test_floatfield.py | 4 | 1149 | from django.db import transaction
from django.test import TestCase
from .models import FloatModel
class TestFloatField(TestCase):
def test_float_validates_object(self):
instance = FloatModel(size=2.5)
# Try setting float field to unsaved object
instance.size = instance
with trans... | bsd-3-clause |
Bysmyyr/blink-crosswalk | Source/build/scripts/make_css_property_names.py | 8 | 7529 | #!/usr/bin/env python
import subprocess
import sys
import css_properties
import in_generator
import license
HEADER_TEMPLATE = """
%(license)s
#ifndef %(class_name)s_h
#define %(class_name)s_h
#include "core/css/parser/CSSParserMode.h"
#include "wtf/HashFunctions.h"
#include "wtf/HashTraits.h"
#include <string.h>
... | bsd-3-clause |
lwiecek/django | tests/contenttypes_tests/models.py | 172 | 2882 | from __future__ import unicode_literals
from django.contrib.contenttypes.fields import (
GenericForeignKey, GenericRelation,
)
from django.contrib.contenttypes.models import ContentType
from django.db import models
from django.utils.encoding import python_2_unicode_compatible
from django.utils.http import urlquote... | bsd-3-clause |
jesolem/PCV | PCV/localdescriptors/dsift.py | 11 | 1360 | from PIL import Image
from numpy import *
import os
from PCV.localdescriptors import sift
def process_image_dsift(imagename,resultname,size=20,steps=10,force_orientation=False,resize=None):
""" Process an image with densely sampled SIFT descriptors
and save the results in a file. Optional input: size of... | bsd-2-clause |
codenamejason/data_from_pdf | utils.py | 1 | 3856 | # vim: sw=4:expandtab:foldmethod=marker
#
# Copyright (c) 2014, Jason Romero
# 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 ... | artistic-2.0 |
dpgeorge/micropython | tests/misc/rge_sm.py | 15 | 4422 | # evolve the RGEs of the standard model from electroweak scale up
# by dpgeorge
import math
class RungeKutta(object):
def __init__(self, functions, initConditions, t0, dh, save=True):
self.Trajectory, self.save = [[t0] + initConditions], save
self.functions = [lambda *args: 1.0] + list(functions)... | mit |
0sc0d3r/enigma2 | lib/python/Plugins/SystemPlugins/UI3DSetup/plugin.py | 44 | 4592 | from Screens.Screen import Screen
from Components.ConfigList import ConfigListScreen
from Components.config import config, ConfigSubsection, ConfigInteger, ConfigSelection, ConfigSlider, getConfigListEntry
from Components.Sources.StaticText import StaticText
modelist = {"off": _("Off"), "auto": _("Auto"), "sidebyside"... | gpl-2.0 |
MalkIPP/ipp_work | ipp_work/example/tax_rate_by_decile.py | 1 | 1569 | # -*- coding: utf-8 -*-
"""
Created on Mon Jun 1 17:07:33 2015
@author: malkaguillot
"""
from ipp_work.utils import survey_simulate, df_weighted_average_grouped
from ipp_work.simulations.ir_marg_rate import varying_survey_simulation
from ipp_work.example.quantiles_of_revimp import make_weighted_deciles_of_variable
i... | agpl-3.0 |
bvernoux/micropython | tests/bytecode/pylib-tests/wave.py | 22 | 18093 | """Stuff to parse WAVE files.
Usage.
Reading WAVE files:
f = wave.open(file, 'r')
where file is either the name of a file or an open file pointer.
The open file pointer must have methods read(), seek(), and close().
When the setpos() and rewind() methods are not used, the seek()
method is not necessary.
This ... | mit |
okuta/chainer | examples/sentiment/train_recursive_minibatch.py | 6 | 8430 | import argparse
import warnings
import numpy
import chainer
import chainer.functions as F
import chainer.links as L
from chainer import reporter
from chainer import training
from chainer.training import extensions
import data
import thin_stack
def linearize_tree(vocab, root, xp=numpy):
# Left node indexes for ... | mit |
boundlessgeo/QGIS | python/plugins/processing/algs/qgis/LinesToPolygons.py | 8 | 4842 | # -*- coding: utf-8 -*-
"""
***************************************************************************
LinesToPolygons.py
---------------------
Date : August 2012
Copyright : (C) 2012 by Victor Olaya
Email : volayaf at gmail dot com
***********************... | gpl-2.0 |
gpetretto/pymatgen | pymatgen/analysis/xas/spectrum.py | 8 | 1581 | # coding: utf-8
# Copyright (c) Pymatgen Development Team.
# Distributed under the terms of the MIT License.
from pymatgen.core.spectrum import Spectrum
import numpy as np
"""
This module defines classes to represent all xas
"""
__author__ = "Chen Zheng"
__copyright__ = "Copyright 2012, The Materials Project"
__vers... | mit |
joongh/robotframework | src/robot/result/configurer.py | 7 | 2853 | # Copyright 2008-2015 Nokia Networks
# Copyright 2016- Robot Framework Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
... | apache-2.0 |
srznew/heat | heat/engine/resources/openstack/nova/server.py | 1 | 65002 | #
# 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 |
firmanm/ansible | test/units/playbook/test_attribute.py | 219 | 1824 | # (c) 2015, Marius Gedminas <marius@gedmin.as>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later vers... | gpl-3.0 |
shaufi/odoo | addons/l10n_in_hr_payroll/report/report_hr_salary_employee_bymonth.py | 374 | 5518 | #-*- coding:utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2011 OpenERP SA (<http://openerp.com>). All Rights Reserved
#
# This program is free software: you can redistribute it and/or modify
# it under th... | agpl-3.0 |
ayumilong/rethinkdb | external/v8_3.30.33.16/tools/testrunner/server/daemon.py | 123 | 3753 | #!/usr/bin/env python
# This code has been written by Sander Marechal and published at:
# http://www.jejik.com/articles/2007/02/a_simple_unix_linux_daemon_in_python/
# where the author has placed it in the public domain (see comment #6 at
# http://www.jejik.com/articles/2007/02/a_simple_unix_linux_daemon_in_python/#c6... | agpl-3.0 |
Nitaco/ansible | test/units/modules/network/f5/test_bigip_monitor_https.py | 26 | 13827 | # -*- coding: utf-8 -*-
#
# Copyright (c) 2017 F5 Networks Inc.
# GNU General Public License v3.0 (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import os
import json
import sys
import pytest
from nose.plugins.skip imp... | gpl-3.0 |
monikasulik/django-oscar | src/oscar/apps/dashboard/users/forms.py | 27 | 1400 | from django import forms
from django.utils.translation import ugettext_lazy as _, pgettext_lazy
from oscar.core.loading import get_model
from oscar.core.compat import get_user_model
User = get_user_model()
ProductAlert = get_model('customer', 'ProductAlert')
class UserSearchForm(forms.Form):
email = forms.CharF... | bsd-3-clause |
line72/subte | libsubte/interface/StopMarker.py | 1 | 9828 | #
# Copyright (C) 2012 - Marcus Dillavou
#
# 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, or (at your option)
# any later version.
#
# This program is distributed in the hope ... | gpl-3.0 |
MarkRegalla27/ThinkStats2 | code/hypothesis.py | 75 | 10162 | """This file contains code used in "Think Stats",
by Allen B. Downey, available from greenteapress.com
Copyright 2010 Allen B. Downey
License: GNU GPLv3 http://www.gnu.org/licenses/gpl.html
"""
from __future__ import print_function, division
import nsfg
import nsfg2
import first
import thinkstats2
import thinkplot
... | gpl-3.0 |
DaKaZ/Ti.UX.Templates | plugins/ti.alloy/plugin.py | 1729 | 5251 | import os, sys, subprocess, hashlib
import subprocess
def check_output(*popenargs, **kwargs):
r"""Run command with arguments and return its output as a byte string.
Backported from Python 2.7 as it's implemented as pure python on stdlib.
>>> check_output(['/usr/bin/python', '--version'])
Python 2.6.... | apache-2.0 |
cortext/crawtextV2 | ~/venvs/crawler/lib/python2.7/site-packages/nltk/util.py | 12 | 40286 | # Natural Language Toolkit: Utility functions
#
# Copyright (C) 2001-2012 NLTK Project
# Author: Steven Bird <sb@csse.unimelb.edu.au>
# URL: <http://www.nltk.org/>
# For license information, see LICENSE.TXT
import locale
import re
import types
import textwrap
import pydoc
import bisect
import os
from itertools import... | mit |
rlugojr/django | tests/auth_tests/client.py | 85 | 1414 | import re
from django.contrib.auth.views import (
INTERNAL_RESET_SESSION_TOKEN, INTERNAL_RESET_URL_TOKEN,
)
from django.test import Client
def extract_token_from_url(url):
token_search = re.search(r'/reset/.*/(.+?)/', url)
if token_search:
return token_search.group(1)
class PasswordResetConfirm... | bsd-3-clause |
jonnyhtw/cylc | lib/cherrypy/tutorial/tut05_derived_objects.py | 7 | 2140 | """
Tutorial - Object inheritance
You are free to derive your request handler classes from any base
class you wish. In most real-world applications, you will probably
want to create a central base class used for all your pages, which takes
care of things like printing a common page header and footer.
"""
import cherr... | gpl-3.0 |
dya2/python-for-android | python-build/python-libs/gdata/build/lib/gdata/docs/service.py | 133 | 22521 | #!/usr/bin/python
#
# Copyright 2009 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required b... | apache-2.0 |
dataDogma/Computer-Science | Django-MVP-page/venv/Lib/site-packages/pip/_vendor/requests/packages/chardet/euckrfreq.py | 3121 | 45978 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Communicator client code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998
# the Initial Developer. All Rights R... | gpl-3.0 |
johnbachman/belpy | indra/sources/medscan/api.py | 4 | 3627 | from collections import defaultdict
from .processor import *
logger = logging.getLogger(__name__)
def process_directory_statements_sorted_by_pmid(directory_name):
"""Processes a directory filled with CSXML files, first normalizing the
character encoding to utf-8, and then processing into INDRA statements
... | mit |
piontec/docker-enforcer | test/test_docker_image_helper.py | 1 | 2127 | import unittest
from unittest.mock import create_autospec
import docker
from docker.errors import NotFound
from dockerenforcer.config import Config
from dockerenforcer.docker_image_helper import DockerImageHelper
class DockerHelperTests(unittest.TestCase):
def setUp(self):
self._config = Config()
... | gpl-3.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.