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 |
|---|---|---|---|---|---|
coteyr/home-assistant | homeassistant/components/notify/rest.py | 2 | 2882 | """
homeassistant.components.notify.rest
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
REST platform for notify component.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/notify.rest/
"""
import logging
import requests
from homeassistant.components.notify import ... | mit |
harterj/moose | python/MooseDocs/test/common/test_load_config.py | 8 | 4287 | #!/usr/bin/env python3
#* This file is part of the MOOSE framework
#* https://www.mooseframework.org
#*
#* All rights reserved, see COPYRIGHT for full restrictions
#* https://github.com/idaholab/moose/blob/master/COPYRIGHT
#*
#* Licensed under LGPL 2.1, please see LICENSE for details
#* https://www.gnu.org/licenses/lgp... | lgpl-2.1 |
rosswhitfield/mantid | Framework/PythonInterface/plugins/algorithms/CreateCacheFilename.py | 3 | 5097 | # Mantid Repository : https://github.com/mantidproject/mantid
#
# Copyright © 2018 ISIS Rutherford Appleton Laboratory UKRI,
# NScD Oak Ridge National Laboratory, European Spallation Source,
# Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS
# SPDX - License - Identifier: GPL - 3.0 +
#pyl... | gpl-3.0 |
pi0/oh-my-zsh | plugins/git-prompt/gitstatus.py | 343 | 2372 | #!/usr/bin/env python
# -*- coding: UTF-8 -*-
from subprocess import Popen, PIPE
import re
# change those symbols to whatever you prefer
symbols = {
'ahead of': '↑',
'behind': '↓',
'staged': '♦',
'changed': '‣',
'untracked': '…',
'clean': '⚡',
'unmerged': '≠',
'sha1': ':'
}
output, err... | mit |
jscn/django | tests/template_tests/syntax_tests/test_exceptions.py | 513 | 2099 | from django.template import TemplateDoesNotExist, TemplateSyntaxError
from django.test import SimpleTestCase
from ..utils import setup
from .test_extends import inheritance_templates
class ExceptionsTests(SimpleTestCase):
@setup({'exception01': "{% extends 'nonexistent' %}"})
def test_exception01(self):
... | bsd-3-clause |
lenovo-Kraft-T/android_kernel_lenovo_msm8916 | scripts/tracing/draw_functrace.py | 14676 | 3560 | #!/usr/bin/python
"""
Copyright 2008 (c) Frederic Weisbecker <fweisbec@gmail.com>
Licensed under the terms of the GNU GPL License version 2
This script parses a trace provided by the function tracer in
kernel/trace/trace_functions.c
The resulted trace is processed into a tree to produce a more human
view of the call ... | gpl-2.0 |
mateuszmidor/GumtreeOnMap | src/onlineview.py | 1 | 1895 | '''
Created on 03-08-2014
@author: mateusz
'''
from webpagetemplate import WebPageTemplate
from locations import Locations
from googlemappoints import GoogleMapPoints
from httpresponse import HttpResponse
from injectdependency import InjectDependency, Inject
@InjectDependency('geocoder', 'logger')
class O... | gpl-2.0 |
presidentielcoin/presidentielcoin | qa/rpc-tests/bipdersig-p2p.py | 1 | 6875 | #!/usr/bin/env python3
# Copyright (c) 2015-2016 The Presidentielcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
from test_framework.test_framework import ComparisonTestFramework
from test_framework.util impor... | mit |
unixhot/opencmdb | django_mongoengine/mongo_auth/managers.py | 1 | 3935 | from importlib import import_module
from django.conf import settings
from django.contrib.auth.models import UserManager
from django.db.models import CharField, BooleanField, DateTimeField, DateField
from django.utils import timezone
from django.utils.translation import ugettext_lazy as _
from mongoengine.errors import... | apache-2.0 |
shibaniahegde/OpenStak_swift | test/unit/common/middleware/test_tempurl.py | 5 | 45995 | # Copyright (c) 2011-2014 Greg Holt
# Copyright (c) 2012-2013 Peter Portante
# Copyright (c) 2012 Iryoung Jeong
# Copyright (c) 2012 Michael Barton
# Copyright (c) 2013 Alex Gaynor
# Copyright (c) 2013 Chuck Thier
# Copyright (c) 2013 David Goetz
# Copyright (c) 2015 Donagh McCabe
# Copyright (c) 2013 Greg Lange
# Copy... | apache-2.0 |
bregman-arie/ansible | lib/ansible/modules/cloud/cloudstack/cs_region.py | 50 | 5319 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# (c) 2016, René Moser <mail@renemoser.net>
#
# 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 Lice... | gpl-3.0 |
Shaswat27/scipy | scipy/optimize/_lsq/trf.py | 5 | 19737 | """Trust Region Reflective algorithm for least-squares optimization.
The algorithm is based on ideas from paper [STIR]_. The main idea is to
account for presence of the bounds by appropriate scaling of the variables (or
equivalently changing a trust-region shape). Let's introduce a vector v:
| ub[i] - x[i]... | bsd-3-clause |
areitz/pants | src/python/pants/backend/jvm/tasks/scalastyle.py | 5 | 6176 | # coding=utf-8
# Copyright 2014 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
import os
import re
... | apache-2.0 |
fzheng/codejam | lib/python2.7/site-packages/pygments/lexers/resource.py | 46 | 2913 | # -*- coding: utf-8 -*-
"""
pygments.lexers.resource
~~~~~~~~~~~~~~~~~~~~~~~~
Lexer for resource definition files.
:copyright: Copyright 2006-2015 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import re
from pygments.lexer import RegexLexer, bygroups, words
from ... | mit |
Vagab0nd/SiCKRAGE | lib3/sqlalchemy/testing/profiling.py | 2 | 8741 | # testing/profiling.py
# Copyright (C) 2005-2020 the SQLAlchemy authors and contributors
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
"""Profiling support for unit and performance tests.
These are special purpose... | gpl-3.0 |
HubbleStack/Hubble | hubblestack/hangtime/linux_itimers.py | 2 | 6678 | # -*- coding: utf-8 -*-
'''
Module for handling timeouts in code that may not be designed for it.
'''
import signal
import time
import logging
log = logging.getLogger('hangtime')
class HangTime(Exception):
# NOTE: this will break completely in multithreading
# it should work just fine in multiprocessing
... | apache-2.0 |
gentledevil/ansible | lib/ansible/plugins/lookup/csvfile.py | 82 | 2628 | # (c) 2013, Jan-Piet Mens <jpmens(at)gmail.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later ver... | gpl-3.0 |
qrkourier/ansible | lib/ansible/module_utils/facts/system/apparmor.py | 232 | 1311 | # Collect facts related to apparmor
#
# 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.
#
# An... | gpl-3.0 |
jscott1989/happening | src/happening/templatetags/plugins.py | 2 | 2896 | """Template tags relating to plugins."""
from django import template
import importlib
from django.utils.safestring import mark_safe
from happening.utils import convert_to_underscore
register = template.Library()
@register.simple_tag(takes_context=True)
def navigation_items(context, *params):
"""Render navigatio... | mit |
mmnelemane/nova | nova/tests/unit/objects/test_security_group.py | 57 | 7086 | # Copyright 2013 IBM Corp.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agree... | apache-2.0 |
wilvk/ansible | test/units/modules/network/ios/test_ios_system.py | 57 | 5380 | #
# (c) 2016 Red Hat Inc.
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is d... | gpl-3.0 |
hiroakis/ansible | lib/ansible/parsing/yaml/objects.py | 169 | 2012 | # (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) an... | gpl-3.0 |
TomHeatwole/osf.io | api_tests/users/views/test_user_list.py | 24 | 2669 | # -*- coding: utf-8 -*-
import urlparse
from nose.tools import * # flake8: noqa
from tests.base import ApiTestCase
from tests.factories import AuthUserFactory
from api.base.settings.defaults import API_BASE
class TestUsers(ApiTestCase):
def setUp(self):
super(TestUsers, self).setUp()
self.user... | apache-2.0 |
SiLab-Bonn/pyBAR | pybar/fei4/fei4_defines.py | 1 | 28743 | from collections import OrderedDict
# FEI4A
fei4a = {
'flavor': 'fei4a',
'calibration_parameters': OrderedDict([
('C_Inj_Low', 2.0), # fF, C_Low
('C_Inj_Med', 4.1), # fF, C_High
('C_Inj_High', 6.05), # fF, C_Low + C_High
('Vcal_Coeff_0', 0.0), # mV, offset
... | bsd-3-clause |
lokeshbv/TizenRT | external/gmock/gtest/test/gtest_shuffle_test.py | 3023 | 12549 | #!/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 of... | apache-2.0 |
dT9r/Neo | lib/parameter_updates.py | 2 | 1178 | import gnumpy as gp
class ParameterUpdate:
def parameters_delta(self, gradient, rate):
pass
class SGD(ParameterUpdate):
def __init__(self):
pass
def parameters_delta(self, gradient, rate):
return -rate * gradient
class Momentum(ParameterUpdate):
"""
mu is usually somet... | mit |
WillGuan105/django | django/core/serializers/pyyaml.py | 439 | 2843 | """
YAML serializer.
Requires PyYaml (http://pyyaml.org/), but that's checked for in __init__.
"""
import collections
import decimal
import sys
from io import StringIO
import yaml
from django.core.serializers.base import DeserializationError
from django.core.serializers.python import (
Deserializer as PythonDes... | bsd-3-clause |
cherusk/ansible | lib/ansible/modules/cloud/google/gce_img.py | 70 | 6747 | #!/usr/bin/python
# Copyright 2015 Google Inc. 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 Foundation, either version 3 of the License, or
# (at your o... | gpl-3.0 |
georgefrank/ansible-modules-extras | notification/mqtt.py | 101 | 4848 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2013, 2014, Jan-Piet Mens <jpmens () gmail.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of... | gpl-3.0 |
opoplawski/ansible-modules-extras | network/f5/bigip_node.py | 77 | 13267 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2013, Matt Hite <mhite@hotmail.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... | gpl-3.0 |
TeamRegular/android_kernel_tegra | tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/SchedGui.py | 12980 | 5411 | # SchedGui.py - Python extension for perf script, basic GUI code for
# traces drawing and overview.
#
# Copyright (C) 2010 by Frederic Weisbecker <fweisbec@gmail.com>
#
# This software is distributed under the terms of the GNU General
# Public License ("GPL") version 2 as published by the Free Software
# Foundation.
... | gpl-2.0 |
msramalho/Pocket-ReadingTime-Estimation-Visualization | main.py | 1 | 2260 | import requests, re, json
from pocket import Pocket, PocketException
from bs4 import BeautifulSoup
from newspaper import Article
with open('configs.json') as configsFile: #read the configuration file
configs = json.load(configsFile)
p = Pocket(consumer_key=configs["consumer_key"], access_token=configs["access_token"]... | mit |
teltek/edx-platform | lms/djangoapps/certificates/migrations/0007_certificateinvalidation.py | 14 | 1324 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
import django.utils.timezone
from django.conf import settings
import model_utils.fields
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODE... | agpl-3.0 |
knmkr/perGENIE | pergenie/apps/riskreport/test_model.py | 3 | 3663 | from decimal import Decimal
from django.test import TestCase
from django.test.utils import override_settings
from apps.authentication.models import User
from apps.gwascatalog.models import GwasCatalogSnp, GwasCatalogPhenotype
from apps.snp.models import Snp
from apps.genome.models import Genome, Genotype
from .models... | agpl-3.0 |
yury-s/v8-inspector | Source/chrome/tools/auto_bisect/request_build.py | 45 | 6930 | # 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.
"""This module contains functionality for starting build try jobs via HTTP.
This includes both sending a request to start a job, and also related code
for q... | bsd-3-clause |
blondegeek/pymatgen | pymatgen/vis/structure_vtk.py | 2 | 46835 | # coding: utf-8
# Copyright (c) Pymatgen Development Team.
# Distributed under the terms of the MIT License.
"""
This module contains classes to wrap Python VTK to make nice molecular plots.
"""
__author__ = "Shyue Ping Ong"
__copyright__ = "Copyright 2011, The Materials Project"
__version__ = "0.1"
__maintainer__ ... | mit |
xkfz007/binutils-gdb | gdb/python/lib/gdb/xmethod.py | 14 | 10448 | # Python side of the support for xmethods.
# Copyright (C) 2013-2015 Free Software Foundation, 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 you... | gpl-2.0 |
IssamLaradji/scikit-learn | sklearn/ensemble/tests/test_weight_boosting.py | 9 | 15843 | """Testing for the boost module (sklearn.ensemble.boost)."""
import numpy as np
from sklearn.utils.testing import assert_array_equal, assert_array_less
from sklearn.utils.testing import assert_array_almost_equal
from sklearn.utils.testing import assert_equal
from sklearn.utils.testing import assert_raises, assert_rais... | bsd-3-clause |
WiReD-/metagoofil | hachoir_core/field/float.py | 84 | 3539 | from hachoir_core.field import Bit, Bits, FieldSet
from hachoir_core.endian import BIG_ENDIAN, LITTLE_ENDIAN
import struct
# Make sure that we use right struct types
assert struct.calcsize("f") == 4
assert struct.calcsize("d") == 8
assert struct.unpack("<d", "\x1f\x85\xebQ\xb8\x1e\t@")[0] == 3.14
assert struct.unpack(... | gpl-2.0 |
odicraig/kodi2odi | addons/plugin.video.roggerstream-2.0.5/mechanize/_clientcookie.py | 5 | 67227 | """HTTP cookie handling for web clients.
This module originally developed from my port of Gisle Aas' Perl module
HTTP::Cookies, from the libwww-perl library.
Docstrings, comments and debug strings in this code refer to the
attributes of the HTTP cookie system as cookie-attributes, to distinguish
them clearly f... | gpl-3.0 |
Dave667/service | script.module.html5lib/lib/html5lib/treebuilders/etree.py | 721 | 12609 | from __future__ import absolute_import, division, unicode_literals
from six import text_type
import re
from . import _base
from .. import ihatexml
from .. import constants
from ..constants import namespaces
from ..utils import moduleFactoryFactory
tag_regexp = re.compile("{([^}]*)}(.*)")
def getETreeBuilder(Elemen... | gpl-2.0 |
felipenaselva/repo.felipe | plugin.video.sembilhete.tv/resources/lib/requests/api.py | 188 | 5419 | # -*- coding: utf-8 -*-
"""
requests.api
~~~~~~~~~~~~
This module implements the Requests API.
:copyright: (c) 2012 by Kenneth Reitz.
:license: Apache2, see LICENSE for more details.
"""
from . import sessions
def request(method, url, **kwargs):
"""Constructs and sends a :class:`Request <Request>`.
:par... | gpl-2.0 |
kylewm/blitzdb | blitzdb/document.py | 4 | 15346 | import copy
import uuid
import logging
logger = logging.getLogger(__name__)
import six
if six.PY3:
unicode = str
class MetaDocument(type):
"""
Here we inject class-dependent exceptions into the Document class.
"""
def __new__(meta, name, bases, dct):
class DoesNotExist(BaseException)... | mit |
havatv/QGIS | tests/src/python/test_qgsgeonodeconnection.py | 45 | 3132 | # -*- coding: utf-8 -*-
"""QGIS Unit tests for QgsGeoNodeConnection
.. note:: 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.
"... | gpl-2.0 |
ninja-ide/ninja-ide | ninja_ide/gui/editor/side_area/line_number_widget.py | 2 | 3562 | # -*- coding: utf-8 -*-
#
# This file is part of NINJA-IDE (http://ninja-ide.org).
#
# NINJA-IDE 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
# any later version.
#
# NIN... | gpl-3.0 |
Pluto-tv/chromium-crosswalk | build/android/pylib/linker/setup.py | 37 | 1434 | # 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.
"""Setup for linker tests."""
import os
import sys
from pylib import constants
from pylib.linker import test_case
from pylib.linker import test_runner
sys... | bsd-3-clause |
batxes/4Cin | SHH_WT_models_highres/SHH_WT_models_highres_final_output_0.1_-0.1_5000/mtx1_models/SHH_WT_models_highres31225.py | 4 | 88215 | import _surface
import chimera
try:
import chimera.runCommand
except:
pass
from VolumePath import markerset as ms
try:
from VolumePath import Marker_Set, Link
new_marker_set=Marker_Set
except:
from VolumePath import volume_path_dialog
d= volume_path_dialog(True)
new_marker_set= d.new_marker_set
marker_set... | gpl-3.0 |
lsaffre/lino_book | lino_book/projects/lydia/tests/dumps/18.12.0/ledger_account.py | 2 | 5342 | # -*- coding: UTF-8 -*-
logger.info("Loading 27 objects to table ledger_account...")
# fields: id, ref, seqno, name, sheet_item, common_account, needs_partner, clearable, default_amount, sales_allowed, purchases_allowed, wages_allowed, taxes_allowed, clearings_allowed, bank_po_allowed, vat_column, ana_account, needs_an... | agpl-3.0 |
riking/youtube-dl | youtube_dl/extractor/screencast.py | 12 | 4228 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..utils import (
ExtractorError,
compat_parse_qs,
compat_urllib_request,
)
class ScreencastIE(InfoExtractor):
_VALID_URL = r'https?://www\.screencast\.com/t/(?P<id>[a-zA-Z0-9]+)'
_TES... | unlicense |
sekikn/incubator-airflow | tests/providers/google/suite/hooks/test_drive.py | 5 | 8251 | #
# 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 |
sharifmamun/ansible | lib/ansible/utils/module_docs.py | 44 | 4944 | #!/usr/bin/env python
# (c) 2012, Jan-Piet Mens <jpmens () gmail.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your... | gpl-3.0 |
wxgeo/geophar | wxgeometrie/sympy/liealgebras/root_system.py | 18 | 6892 | # -*- coding: utf-8 -*-
from .cartan_type import CartanType
from sympy.core.backend import Basic
from sympy.core.compatibility import range
class RootSystem(Basic):
"""Represent the root system of a simple Lie algebra
Every simple Lie algebra has a unique root system. To find the root
system, we first co... | gpl-2.0 |
cruzegoodin/TSC-ShippingDetails | flask/lib/python2.7/site-packages/babel/localtime/_unix.py | 160 | 5116 | from __future__ import with_statement
import os
import re
import sys
import pytz
import subprocess
_systemconfig_tz = re.compile(r'^Time Zone: (.*)$(?m)')
def _tz_from_env(tzenv):
if tzenv[0] == ':':
tzenv = tzenv[1:]
# TZ specifies a file
if os.path.exists(tzenv):
with open(tzenv, 'rb')... | bsd-3-clause |
h3llrais3r/Auto-Subliminal | lib/html5lib/__init__.py | 45 | 1145 | """
HTML parsing library based on the `WHATWG HTML specification
<https://whatwg.org/html>`_. The parser is designed to be compatible with
existing HTML found in the wild and implements well-defined error recovery that
is largely compatible with modern desktop web browsers.
Example usage::
import html5lib
wit... | gpl-3.0 |
BT-rmartin/odoo | addons/l10n_si/__openerp__.py | 430 | 1826 | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright: (C) 2012 - Mentis d.o.o., Dravograd
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affe... | agpl-3.0 |
Shrhawk/edx-platform | common/djangoapps/enrollment/data.py | 6 | 9290 | """
Data Aggregation Layer of the Enrollment API. Collects all enrollment specific data into a single
source to be used throughout the API.
"""
import logging
from django.contrib.auth.models import User
from opaque_keys.edx.keys import CourseKey
from xmodule.modulestore.django import modulestore
from enrollment.errors... | agpl-3.0 |
peschir/btce-bot | samples/hello-world-bot.py | 5 | 5864 | #!/usr/bin/python
# Copyright (c) 2013 Alan McIntyre
import decimal
import time
import btceapi
import btcebot
class RangeTrader(btcebot.TraderBase):
'''
This is a simple trader that handles a single currency pair, selling
all available inventory if price is above sell_price, buying with
all available... | mit |
sjperkins/tensorflow | tensorflow/contrib/slim/python/slim/summaries.py | 63 | 7497 | # 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 |
mr-ping/tornado | tornado/test/options_test.py | 3 | 10341 | # -*- coding: utf-8 -*-
from __future__ import absolute_import, division, print_function, with_statement
import datetime
import os
import sys
from tornado.options import OptionParser, Error
from tornado.util import basestring_type, PY3
from tornado.test.util import unittest
if PY3:
from io import StringIO
else:
... | apache-2.0 |
jaseweston/NAMAS | dataset/pull.py | 9 | 1603 | #
# Copyright (c) 2015, Facebook, Inc.
# All rights reserved.
#
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree. An additional grant
# of patent rights can be found in the PATENTS file in the same directory.
#
# Author: Alexander M R... | bsd-3-clause |
Captain-Coder/tribler | Tribler/Test/Core/Video/test_vod.py | 1 | 4570 | import os
from tempfile import mkstemp
from M2Crypto import Rand
from Tribler.Test.tools import trial_timeout
from twisted.internet.defer import inlineCallbacks, Deferred
from Tribler.Core.DownloadConfig import DownloadStartupConfig
from Tribler.Core.Libtorrent.LibtorrentDownloadImpl import VODFile
from Tribler.Core.... | lgpl-3.0 |
oskar456/youtube-dl | youtube_dl/extractor/ynet.py | 64 | 1807 | # coding: utf-8
from __future__ import unicode_literals
import re
import json
from .common import InfoExtractor
from ..compat import compat_urllib_parse_unquote_plus
class YnetIE(InfoExtractor):
_VALID_URL = r'https?://(?:.+?\.)?ynet\.co\.il/(?:.+?/)?0,7340,(?P<id>L(?:-[0-9]+)+),00\.html'
_TESTS = [
... | unlicense |
TRESCLOUD/odoo | addons/report_webkit/wizard/__init__.py | 431 | 1482 | # -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (c) 2010 Camptocamp SA (http://www.camptocamp.com)
# All Right Reserved
#
# Author : Vincent Renaville
#
# WARNING: This program as such is intended to be used by professional
# programmers who take the... | agpl-3.0 |
18padx08/PPTex | PPTexEnv_x86_64/lib/python2.7/site-packages/scipy/io/__init__.py | 46 | 2247 | # -*- encoding:utf-8 -*-
"""
==================================
Input and output (:mod:`scipy.io`)
==================================
.. currentmodule:: scipy.io
SciPy has many modules, classes, and functions available to read data
from and write data to a variety of file formats.
.. seealso:: :ref:`numpy-reference.... | mit |
luotao1/Paddle | python/paddle/fluid/tests/unittests/new_group.py | 1 | 2850 | # Copyright (c) 2020 PaddlePaddle 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 appli... | apache-2.0 |
blighj/django | django/db/backends/oracle/utils.py | 52 | 1457 | import datetime
from .base import Database
class InsertIdVar:
"""
A late-binding cursor variable that can be passed to Cursor.execute
as a parameter, in order to receive the id of the row created by an
insert statement.
"""
def bind_parameter(self, cursor):
param = cursor.cursor.var(... | bsd-3-clause |
UManPychron/pychron | pychron/hardware/pychron_motion.py | 2 | 1152 | # ===============================================================================
# Copyright 2012 Jake Ross
#
# 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/licens... | apache-2.0 |
easyfmxu/zulip | tools/deprecated/generate-activity-metrics.py | 114 | 5910 | #!/usr/bin/env python
#
# Generates % delta activity metrics from graphite/statsd data
#
import os, sys
sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..'))
import optparse
from datetime import timedelta, datetime
from zerver.lib.timestamp import datetime_to_timestamp
from zerver.lib.utils import statsd_... | apache-2.0 |
bow/bioconda-recipes | recipes/biopet-validatevcf/0.1/biopet-validatevcf.py | 60 | 3373 | #!/usr/bin/env python
#
# Wrapper script for starting the biopet-validatevcf JAR package
#
# This script is written for use with the Conda package manager and is copied
# from the peptide-shaker wrapper. Only the parameters are changed.
# (https://github.com/bioconda/bioconda-recipes/blob/master/recipes/peptide-shaker/... | mit |
admcrae/tensorflow | tensorflow/examples/learn/random_forest_mnist.py | 73 | 4030 | # 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 appl... | apache-2.0 |
brownharryb/erpnext | erpnext/education/doctype/student_attendance/student_attendance.py | 21 | 2306 | # -*- coding: utf-8 -*-
# Copyright (c) 2015, Frappe Technologies and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe.model.document import Document
from frappe import _
from frappe.utils import cstr
from erpnext.education.api import get_... | gpl-3.0 |
soulmachine/scikit-learn | sklearn/setup.py | 4 | 3091 | import os
from os.path import join
import warnings
def configuration(parent_package='', top_path=None):
from numpy.distutils.misc_util import Configuration
from numpy.distutils.system_info import get_info, BlasNotFoundError
import numpy
libraries = []
if os.name == 'posix':
libraries.appe... | bsd-3-clause |
abdoosh00/edx-platform | lms/djangoapps/instructor_task/tasks.py | 44 | 6455 | """
This file contains tasks that are designed to perform background operations on the
running state of a course.
At present, these tasks all operate on StudentModule objects in one way or another,
so they share a visitor architecture. Each task defines an "update function" that
takes a module_descriptor, a particula... | agpl-3.0 |
steventimberman/masterDebater | venv/lib/python2.7/site-packages/multiselectfield/forms/fields.py | 3 | 1659 | # -*- coding: utf-8 -*-
# Copyright (c) 2012 by Pablo Martín <goinnn@gmail.com>
#
# This program 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 3 of the License, or
# (at your option) an... | mit |
XiaosongWei/chromium-crosswalk | tools/telemetry/telemetry/internal/actions/mouse_click_unittest.py | 31 | 1617 | # Copyright 2015 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
from telemetry.core import exceptions
from telemetry.internal.actions import mouse_click
from telemetry.testing import tab_test_case
class MouseClickAction... | bsd-3-clause |
rgerkin/neuroConstruct | lib/jython/Lib/test/test_jser2.py | 23 | 2165 | from test import test_support
import unittest
from java.io import ByteArrayInputStream, ByteArrayOutputStream, ObjectInputStream, ObjectOutputStream
from org.python.util import PythonObjectInputStream
def serialize(o, special=False):
b = ByteArrayOutputStream()
objs = ObjectOutputStream(b)
objs.writeObject... | gpl-2.0 |
gwhittey23/ComicStreamServer | comicstreamerlib/main.py | 5 | 3653 | #!/usr/bin/env python
"""
ComicStreamer main server classes
"""
"""
Copyright 2012-2014 Anthony Beville
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.... | apache-2.0 |
abstract-open-solutions/OCB | addons/l10n_ae/__init__.py | 669 | 1059 | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2014 Tech Receptives (<http://techreceptives.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the te... | agpl-3.0 |
yencarnacion/jaikuengine | .google_appengine/lib/django-1.4/django/contrib/localflavor/jp/forms.py | 194 | 1257 | """
JP-specific Form helpers
"""
from __future__ import absolute_import
from django.contrib.localflavor.jp.jp_prefectures import JP_PREFECTURES
from django.forms.fields import RegexField, Select
from django.utils.translation import ugettext_lazy as _
class JPPostalCodeField(RegexField):
"""
A form field tha... | apache-2.0 |
devops2014/djangosite | django/utils/translation/__init__.py | 118 | 7000 | """
Internationalization support.
"""
from __future__ import unicode_literals
import re
from django.utils.decorators import ContextDecorator
from django.utils.encoding import force_text
from django.utils.functional import lazy
from django.utils import six
__all__ = [
'activate', 'deactivate', 'override', 'deactiv... | bsd-3-clause |
EDUlib/edx-platform | openedx/core/djangoapps/course_groups/tests/test_partition_scheme.py | 4 | 15226 | """
Test the partitions and partitions service
"""
from unittest.mock import patch
import django.test
from lms.djangoapps.courseware.tests.test_masquerade import StaffMasqueradeTestCase
from openedx.core.djangoapps.user_api.partition_schemes import RandomUserPartitionScheme
from openedx.core.djangolib.testing.utils... | agpl-3.0 |
carsongee/edx-platform | common/djangoapps/student/management/commands/anonymized_id_mapping.py | 27 | 2644 | # -*- coding: utf-8 -*-
"""Dump username, per-student anonymous id, and per-course anonymous id triples as CSV.
Give instructors easy access to the mapping from anonymized IDs to user IDs
with a simple Django management command to generate a CSV mapping. To run, use
the following:
./manage.py lms anonymized_id_mappin... | agpl-3.0 |
txemi/ansible | lib/ansible/modules/network/haproxy.py | 21 | 13849 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2014, Ravi Bhure <ravibhure@gmail.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the Lice... | gpl-3.0 |
colinnewell/odoo | openerp/addons/test_converter/tests/test_html.py | 257 | 13533 | # -*- encoding: utf-8 -*-
import json
import os
import datetime
from lxml import etree
from openerp.tests import common
from openerp.tools import html_escape as e
from openerp.addons.base.ir import ir_qweb
directory = os.path.dirname(__file__)
class TestExport(common.TransactionCase):
_model = None
def set... | agpl-3.0 |
juliadolgova/pyshtrih | pyshtrih/commands.py | 1 | 19184 | # -*- coding: utf-8 -*-
import sys
import time
import inspect
from . import misc, excepts
def state(self):
"""
Состояние ККМ в коротком виде.
"""
return self.protocol.command(
0x10,
self.password
)
state.cmd = 0x10
def full_state(self):
"""
Состояние ККМ.
"""
... | mit |
cmichal/python-social-auth | social/strategies/tornado_strategy.py | 52 | 2469 | import json
import six
from tornado.template import Loader, Template
from social.utils import build_absolute_uri
from social.strategies.base import BaseStrategy, BaseTemplateStrategy
class TornadoTemplateStrategy(BaseTemplateStrategy):
def render_template(self, tpl, context):
path, tpl = tpl.rsplit('/',... | bsd-3-clause |
migonzalvar/youtube-dl | youtube_dl/extractor/tv4.py | 117 | 3631 | # coding: utf-8
from __future__ import unicode_literals
from .common import InfoExtractor
from ..utils import (
ExtractorError,
parse_iso8601,
)
class TV4IE(InfoExtractor):
IE_DESC = 'tv4.se and tv4play.se'
_VALID_URL = r'''(?x)https?://(?:www\.)?
(?:
tv4\.se/(?:[^/]+)/klipp/(?:.*... | unlicense |
davidzchen/tensorflow | tensorflow/python/ops/proto_ops.py | 14 | 1244 | # Copyright 2018 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | apache-2.0 |
KaranToor/MA450 | google-cloud-sdk/lib/surface/pubsub/topics/list_subscriptions.py | 6 | 3464 | # Copyright 2015 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... | apache-2.0 |
ojengwa/oh-mainline | vendor/packages/gdata/tests/gdata_tests/photos_test.py | 133 | 2360 | #!/usr/bin/python
#
# Copyright (C) 2006 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law ... | agpl-3.0 |
benschmaus/catapult | telemetry/third_party/modulegraph/modulegraph_tests/test_modulegraph.py | 23 | 38509 | import unittest
from modulegraph import modulegraph
import pkg_resources
import os
import imp
import sys
import shutil
import warnings
from altgraph import Graph
import textwrap
import xml.etree.ElementTree as ET
import pickle
try:
bytes
except NameError:
bytes = str
try:
from StringIO import StringIO
exc... | bsd-3-clause |
HybridF5/nova | nova/api/openstack/compute/legacy_v2/contrib/floating_ips.py | 8 | 12529 | # Copyright 2011 OpenStack Foundation
# Copyright (c) 2011 X.commerce, a business unit of eBay Inc.
# Copyright 2011 Grid Dynamics
# Copyright 2011 Eldar Nugaev, Kirill Shileev, Ilya Alekseyev
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with... | apache-2.0 |
napalm-automation/napalm-yang | napalm_yang/models/openconfig/network_instances/network_instance/protocols/protocol/ospfv2/areas/area/lsdb/lsa_types/lsa_type/lsas/lsa/summary_lsa/types_of_service/type_of_service/__init__.py | 1 | 19354 | # -*- coding: utf-8 -*-
from operator import attrgetter
from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType
from pyangbind.lib.yangtypes import RestrictedClassType
from pyangbind.lib.yangtypes import TypedListType
from pyangbind.lib.yangtypes import YANGBool
from pyangbind.lib.yangtypes import YANGListTy... | apache-2.0 |
nju520/youtube-dl | youtube_dl/extractor/sina.py | 107 | 2755 | # coding: utf-8
from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..compat import (
compat_urllib_request,
compat_urllib_parse,
)
class SinaIE(InfoExtractor):
_VALID_URL = r'''(?x)https?://(.*?\.)?video\.sina\.com\.cn/
(
... | unlicense |
GbalsaC/bitnamiP | venv/lib/python2.7/site-packages/gitdb/test/test_util.py | 3 | 3322 | # Copyright (C) 2010, 2011 Sebastian Thiel (byronimo@gmail.com) and contributors
#
# This module is part of GitDB and is released under
# the New BSD License: http://www.opensource.org/licenses/bsd-license.php
"""Test for object db"""
import tempfile
import os
from gitdb.test.lib import TestBase
from gitdb.util import... | agpl-3.0 |
omnirom/android_kernel_samsung_lt03lte | arch/ia64/scripts/unwcheck.py | 13143 | 1714 | #!/usr/bin/python
#
# Usage: unwcheck.py FILE
#
# This script checks the unwind info of each function in file FILE
# and verifies that the sum of the region-lengths matches the total
# length of the function.
#
# Based on a shell/awk script originally written by Harish Patil,
# which was converted to Perl by Matthew Ch... | gpl-2.0 |
yarikoptic/NiPy-OLD | nipy/io/imageformats/analyze.py | 1 | 37856 | ''' Header and image for the basic Mayo Analyze format
The basic principle of the header object is that it manages and
contains header information. Each header type may have different
attributes that can be set. Some headers can contain only subsets of
possible passed values - for example the basic Analyze header ca... | bsd-3-clause |
hankcs/HanLP | hanlp/layers/embeddings/char_cnn.py | 1 | 7436 | # Adopted from https://github.com/allenai/allennlp under Apache Licence 2.0.
# Changed the packaging and created a subclass CharCNNEmbedding
from typing import Union, Tuple, Optional, Callable
import torch
from torch import nn
from alnlp.modules.cnn_encoder import CnnEncoder
from alnlp.modules.time_distributed import ... | apache-2.0 |
aitjcize/cppman | cppman/crawler.py | 1 | 6250 | # -*- coding: utf-8 -*-
#
# crawler.py
#
# Copyright (C) 2010 - 2016 Wei-Ning Huang (AZ) <aitjcize@gmail.com>
# All Rights reserved.
#
# This file is part of cppman.
#
# 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 Fre... | gpl-3.0 |
liqin75/vse-vpnaas-plugin | quantum/plugins/cisco/common/cisco_exceptions.py | 5 | 5383 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
#
# Copyright 2011 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... | apache-2.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.