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 |
|---|---|---|---|---|---|
thnee/ansible | lib/ansible/modules/network/system/_net_system.py | 10 | 3369 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2017, Ansible by Red Hat, 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
ANSIBLE_METADATA = {'metadata_version': '1.1',
... | gpl-3.0 |
cooperra/antlr4 | runtime/Python3/src/antlr4/Lexer.py | 17 | 12466 | # [The "BSD license"]
# Copyright (c) 2012 Terence Parr
# Copyright (c) 2012 Sam Harwell
# Copyright (c) 2014 Eric Vergnaud
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# 1. Redistr... | bsd-3-clause |
apark263/tensorflow | tensorflow/contrib/distributions/python/ops/bijectors/fill_triangular.py | 12 | 5973 | # 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 |
vadimtk/chrome4sdp | tools/usb_gadget/package.py | 62 | 2539 | #!/usr/bin/python
# 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.
"""Utility to package and upload the USB gadget framework.
"""
import argparse
import hashlib
import os
import StringIO
import urllib2
imp... | bsd-3-clause |
neuronalysis/engulfing-core | vendor/bootstrap-datepicker/docs/conf.py | 276 | 8002 | # -*- coding: utf-8 -*-
#
# bootstrap-datepicker documentation build configuration file, created by
# sphinx-quickstart on Fri Aug 2 14:45:57 2013.
#
# 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 ... | mit |
kelseyoo14/Wander | venv_2_7/lib/python2.7/site-packages/IPython/core/historyapp.py | 9 | 6048 | # encoding: utf-8
"""
An application for managing IPython history.
To be invoked as the `ipython history` subcommand.
"""
from __future__ import print_function
import os
import sqlite3
from traitlets.config.application import Application
from IPython.core.application import BaseIPythonApplication
from traitlets impo... | artistic-2.0 |
cnsoft/kbengine-cocos2dx | kbe/res/scripts/common/Lib/lib2to3/fixer_base.py | 61 | 6839 | # Copyright 2006 Google, Inc. All Rights Reserved.
# Licensed to PSF under a Contributor Agreement.
"""Base class for fixers (optional, but recommended)."""
# Python imports
import logging
import itertools
# Local imports
from .patcomp import PatternCompiler
from . import pygram
from .fixer_util import does_tree_imp... | lgpl-3.0 |
PythonScientists/Shape | env/lib/python3.5/site-packages/jinja2/compiler.py | 117 | 62929 | # -*- coding: utf-8 -*-
"""
jinja2.compiler
~~~~~~~~~~~~~~~
Compiles nodes into python code.
:copyright: (c) 2017 by the Jinja Team.
:license: BSD, see LICENSE for more details.
"""
from itertools import chain
from copy import deepcopy
from keyword import iskeyword as is_python_keyword
from functo... | apache-2.0 |
ruslanloman/nova | nova/api/openstack/compute/plugins/v3/security_groups.py | 33 | 23050 | # Copyright 2011 OpenStack Foundation
# Copyright 2012 Justin Santa Barbara
# 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/l... | apache-2.0 |
tttthemanCorp/CardmeleonAppEngine | django/conf/locale/nn/formats.py | 685 | 1657 | # -*- encoding: utf-8 -*-
# This file is distributed under the same license as the Django package.
#
# The *_FORMAT strings use the Django date format syntax,
# see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
DATE_FORMAT = 'j. F Y'
TIME_FORMAT = 'H:i'
DATETIME_FORMAT = 'j. F Y H:i'
YEAR_MONTH_FOR... | bsd-3-clause |
jart/tensorflow | tensorflow/contrib/timeseries/__init__.py | 46 | 1353 | # 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 |
tgerla/ansible | lib/ansible/plugins/connections/__init__.py | 39 | 5781 | # (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com>
# (c) 2015 Toshio Kuratomi <tkuratomi@ansible.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... | gpl-3.0 |
prarthitm/edxplatform | openedx/core/djangoapps/embargo/tests/test_middleware.py | 3 | 7481 | """
Tests for EmbargoMiddleware with CountryAccessRules
"""
from mock import patch
from nose.plugins.attrib import attr
import ddt
from django.core.urlresolvers import reverse
from django.conf import settings
from django.core.cache import cache as django_cache
from config_models.models import cache as config_cache
f... | agpl-3.0 |
aferr/TemporalPartitioningMemCtl | src/mem/cache/tags/iic_repl/Repl.py | 19 | 1901 | # Copyright (c) 2005-2008 The Regents of The University of Michigan
# 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 ... | bsd-3-clause |
aaron-fz/neutron_full_sync | neutron/tests/unit/nec/test_nec_agent.py | 5 | 15244 | # Copyright 2013 NEC Corporation. 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 ... | apache-2.0 |
sorenk/ansible | lib/ansible/modules/cloud/openstack/os_ironic_inspect.py | 15 | 4998 | #!/usr/bin/python
# coding: utf-8 -*-
# (c) 2015-2016, Hewlett Packard Enterprise Development Company LP
# 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
ANSIBLE_METADATA = {'metadata_ve... | gpl-3.0 |
lanius/hunk | hunk/production.py | 1 | 1206 | # -*- coding: utf-8 -*-
"""
hunk.production
~~~~~~~~~~~~~~~
Provides a class to configure production environment.
"""
import importlib
import os
import sys
from ._compat import urljoin, urlunsplit
class ProductionEnvironment(object):
"""Holds information for a production environment to dispatch to it."""
... | mit |
jackru/pybrain | docs/tutorials/blackboxoptimization.py | 25 | 4601 | from __future__ import print_function
############################################################################
# PyBrain Tutorial "Black Box Optimization"
#
# Author: Tom Schaul, tom@idsia.ch
############################################################################
__author__ = 'Tom Schaul, tom@idsia.ch'
"""... | bsd-3-clause |
sam-tsai/django | tests/max_lengths/tests.py | 380 | 1589 | from __future__ import unicode_literals
import unittest
from .models import PersonWithCustomMaxLengths, PersonWithDefaultMaxLengths
class MaxLengthArgumentsTests(unittest.TestCase):
def verify_max_length(self, model, field, length):
self.assertEqual(model._meta.get_field(field).max_length, length)
... | bsd-3-clause |
gnuhub/intellij-community | python/helpers/pydev/stubs/_django_manager_body.py | 102 | 8951 | # This is a dummy for code-completion purposes.
def __unicode__(self):
"""
Return "app_label.model_label.manager_name".
"""
def _copy_to_model(self, model):
"""
Makes a copy of the manager and assigns it to 'model', which should be
a child of the existing model (used when inheriting a manager... | apache-2.0 |
jimi-c/ansible | lib/ansible/plugins/action/assert.py | 6 | 3165 | # Copyright 2012, Dag Wieers <dag@wieers.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 versi... | gpl-3.0 |
CongSmile/avocado-vt | virttest/libvirt_xml/devices/panic.py | 11 | 1347 | """
panic device support class(es)
http://libvirt.org/formatdomain.html#elementsPanic
"""
from virttest.libvirt_xml import accessors
from virttest.libvirt_xml.devices import base
class Panic(base.UntypedDeviceBase):
__slots__ = ('model', 'addr_type', 'addr_iobase', 'addr_controller',
'addr_bus... | gpl-2.0 |
humbhenri/Sudoku_Poliglota | python/test_sudoku.py | 1 | 2125 | import unittest
from .sudoku import *
from copy import deepcopy
SUDOKU_SAMPLE = [
[2, 0, 0, 0, 0, 0, 0, 6, 0],
[0, 0, 0, 0, 7, 5, 0, 3, 0],
[0, 4, 8, 0, 9, 0, 1, 0, 0],
[0, 0, 0, 3, 0, 0, 0, 0, 0],
[3, 0, 0, 0, 1, 0, 0, 0, 9],
[0, 0, 0, 0, 0, 8, 0... | mit |
igou/rt-thread | tools/building.py | 1 | 31441 | #
# File : building.py
# This file is part of RT-Thread RTOS
# COPYRIGHT (C) 2006 - 2015, RT-Thread Development Team
#
# 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... | apache-2.0 |
godfather1103/WeiboRobot | python27/1.0/lib/bsddb/test/test_dbenv.py | 68 | 19274 | import unittest
import os, glob
from test_all import db, test_support, get_new_environment_path, \
get_new_database_path
#----------------------------------------------------------------------
class DBEnv(unittest.TestCase):
def setUp(self):
self.homeDir = get_new_environment_path()
self.... | gpl-3.0 |
rwarren14/robotframework | src/robot/writer/filewriters.py | 22 | 5515 | # Copyright 2008-2015 Nokia Solutions and Networks
#
# 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 l... | apache-2.0 |
actmd/Diamond | src/collectors/sqs/sqs.py | 56 | 2330 | # coding=utf-8
"""
The SQS collector collects metrics for one or more Amazon AWS SQS queues
#### Configuration
Below is an example configuration for the SQSCollector.
You can specify an arbitrary amount of regions
```
enabled = True
interval = 60
[regions]
[[region-code]]
access_key_id = '...'
... | mit |
xiaoyaozi5566/DynamicCache | src/arch/x86/isa/insts/simd128/integer/logical/por.py | 91 | 2658 | # Copyright (c) 2007 The Hewlett-Packard Development Company
# All rights reserved.
#
# The license below extends only to copyright in the software and shall
# not be construed as granting a license to any other intellectual
# property including but not limited to intellectual property relating
# to a hardware implemen... | bsd-3-clause |
CiscoSystems/quantum | neutron/tests/base.py | 4 | 2827 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2010-2011 OpenStack Foundation
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/l... | apache-2.0 |
bodi000/odoo | addons/website_sale/models/product.py | 10 | 7529 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2013-Today OpenERP SA (<http://www.openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms ... | agpl-3.0 |
keedio/hue | desktop/libs/librdbms/src/librdbms/design.py | 28 | 3677 | #!/usr/bin/env python
# Licensed to Cloudera, Inc. under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. Cloudera, Inc. licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you ma... | apache-2.0 |
joelthompson/ansible-modules-core | network/basics/uri.py | 5 | 16891 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2013, Romeo Theriault <romeot () hawaii.edu>
#
# 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 th... | gpl-3.0 |
petrushev/txplaya | txplayagui/librarywidget.py | 1 | 4653 | import json
from PyQt5.QtCore import pyqtSlot, pyqtSignal, QModelIndex, Qt
from PyQt5.QtWidgets import QWidget, QSpacerItem, QSizePolicy, QShortcut
from PyQt5.QtGui import QKeySequence
from txplayagui.ui.library import Ui_LibraryWidget
from txplayagui.library import LibraryModel
from txplayagui.utilities import unwra... | gpl-3.0 |
hyperNURb/ggrc-core | src/ggrc_risks/__init__.py | 2 | 2680 | # Copyright (C) 2015 Reciprocity, Inc - All Rights Reserved
# Unauthorized use, copying, distribution, displaying, or public performance
# of this file, via any medium, is strictly prohibited. All information
# contained herein is proprietary and confidential and may not be shared
# with any third party without the exp... | apache-2.0 |
MER-GROUP/intellij-community | python/lib/Lib/distutils/dep_util.py | 85 | 3570 | """distutils.dep_util
Utility functions for simple, timestamp-based dependency of files
and groups of files; also, function based entirely on such
timestamp dependency analysis."""
# This module should be kept compatible with Python 2.1.
__revision__ = "$Id: dep_util.py 37828 2004-11-10 22:23:15Z loewis $"
import o... | apache-2.0 |
bbbbanjax/CloudBot | plugins/remind.py | 2 | 5853 | """
remind.py
Allows users to add reminders for various tasks.
Created By:
- Pangea <https://github.com/PangeaCake>
- Luke Rogers <https://github.com/lukeroge>
License: GPL v3
"""
from datetime import datetime
import time
import asyncio
from sqlalchemy import Table, Column, String, DateTime, PrimaryKeyCo... | gpl-3.0 |
Lilykos/invenio | invenio/modules/upgrader/upgrades/invenio_2013_09_13_new_bibEDITCACHE.py | 15 | 1408 | # -*- coding: utf-8 -*-
#
# This file is part of Invenio.
# Copyright (C) 2013 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 option) any later... | gpl-2.0 |
angelicadly/prog-script | tekton-master/backend/appengine/routes/courses/rest.py | 28 | 1086 | # -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
from gaebusiness.business import CommandExecutionException
from tekton.gae.middleware.json_middleware import JsonResponse
from course_app import facade
def index():
cmd = facade.list_courses_cmd()
course_list = cmd()
short_fo... | mit |
swarna-k/MyDiary | flask/lib/python2.7/site-packages/wtforms/csrf/session.py | 193 | 3056 | """
A provided CSRF implementation which puts CSRF data in a session.
This can be used fairly comfortably with many `request.session` type
objects, including the Werkzeug/Flask session store, Django sessions, and
potentially other similar objects which use a dict-like API for storing
session keys.
The basic concept i... | bsd-3-clause |
Sotera/aggregate-micro-paths | hive-streaming/AggregateMicroPath.py | 1 | 9018 | # Copyright 2016 Sotera Defense Solutions 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 agre... | apache-2.0 |
PongPi/isl-odoo | addons/account/wizard/account_report_common_journal.py | 385 | 2942 | # -*- 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 |
Multiscale-Genomics/mg-process-fastq | process_mnaseseq.py | 1 | 6459 | #!/usr/bin/env python
"""
.. See the NOTICE file distributed with this work for additional information
regarding copyright ownership.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
... | apache-2.0 |
rakeshmi/cinder | cinder/volume/drivers/netapp/dataontap/iscsi_7mode.py | 7 | 3256 | # Copyright (c) 2014 Clinton Knight. 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 |
LucianU/ThinkStats2 | code/probability.py | 69 | 4286 | """This file contains code used in "Think Stats",
by Allen B. Downey, available from greenteapress.com
Copyright 2014 Allen B. Downey
License: GNU GPLv3 http://www.gnu.org/licenses/gpl.html
"""
from __future__ import print_function
import math
import numpy as np
import nsfg
import first
import thinkstats2
import th... | gpl-3.0 |
txemi/ansible | lib/ansible/utils/module_docs_fragments/openswitch.py | 166 | 4001 | #
# (c) 2015, Peter Sprygada <psprygada@ansible.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 late... | gpl-3.0 |
phalt/django | tests/admin_views/test_templatetags.py | 28 | 1026 | from __future__ import unicode_literals
from django.contrib.admin.templatetags.admin_modify import submit_row
from django.contrib.auth.admin import UserAdmin
from django.contrib.auth.models import User
from django.test import RequestFactory
from django.urls import reverse
from .admin import site
from .tests import Ad... | bsd-3-clause |
Nirvedh/CoarseCoherence | tests/quick/se/02.insttest/test.py | 56 | 1707 | # Copyright (c) 2007 The Regents of The University of Michigan
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met: redistributions of source code must retain the above copyright
# notice, this list ... | bsd-3-clause |
alff0x1f/Misago | misago/users/api/userendpoints/signature.py | 8 | 2049 | from django.core.exceptions import PermissionDenied
from django.utils.translation import ugettext as _
from rest_framework import status
from rest_framework.response import Response
from misago.conf import settings
from misago.core.utils import format_plaintext_for_html
from misago.users.forms.options import EditSig... | gpl-2.0 |
0k/OpenUpgrade | addons/l10n_be_hr_payroll_account/__init__.py | 430 | 1046 | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2011 OpenERP SA (<http://openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the G... | agpl-3.0 |
500neo/tomorrow-theme | ipythonqt/tomorrownight.py | 31 | 2459 | # -*- coding: utf-8 -*-
"""
pygments.styles.autumn
~~~~~~~~~~~~~~~~~~~~~~
Tomorrow Night theme for ipython qtconsole (invoke with
ipython qtconsole --style=tomorrownight)
See https://github.com/chriskempson/tomorrow-theme for theme info
:copyright: Copyright 2012 André Risnes, risnes@gmail.c... | mit |
llvm-mirror/lldb | packages/Python/lldbsuite/test/lang/objc/ivar-IMP/TestObjCiVarIMP.py | 5 | 1484 | """
Test that dynamically discovered ivars of type IMP do not crash LLDB
"""
from __future__ import print_function
import lldb
from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
from lldbsuite.test import lldbutil
class ObjCiVarIMPTestCase(TestBase):
mydir = TestBase.compute_mydir(... | apache-2.0 |
matrixise/odoo | addons/crm_project_issue/project_issue.py | 380 | 2373 |
from openerp.osv import osv, fields
class crm_lead_to_project_issue_wizard(osv.TransientModel):
""" wizard to convert a Lead into a Project Issue and move the Mail Thread """
_name = "crm.lead2projectissue.wizard"
_inherit = 'crm.partner.binding'
_columns = {
"lead_id": fields.many2one("crm.... | agpl-3.0 |
shacker/django | tests/aggregation/tests.py | 21 | 46656 | import datetime
import re
from decimal import Decimal
from django.core.exceptions import FieldError
from django.db import connection
from django.db.models import (
Avg, Count, DecimalField, DurationField, F, FloatField, Func, IntegerField,
Max, Min, Sum, Value,
)
from django.test import TestCase
from django.te... | bsd-3-clause |
dymkowsk/mantid | scripts/Interface/reduction_gui/reduction/reflectometer/refl_sf_calculator_data_series.py | 2 | 2342 | """
Classes for each reduction step. Those are kept separately
from the the interface class so that the HFIRReduction class could
be used independently of the interface implementation
"""
from __future__ import (absolute_import, division, print_function)
import xml.dom.minidom
from reduction_gui.reduction.s... | gpl-3.0 |
pretyman/hunter | scripts/upload-cache-to-github.py | 3 | 16852 | #!/usr/bin/env python3
from __future__ import print_function
import argparse
import hashlib
import json
import os
import requests
import sys
import time
if os.getenv('HUNTER_GIT_EXECUTABLE'):
os.environ["GIT_PYTHON_GIT_EXECUTABLE"] = os.getenv('HUNTER_GIT_EXECUTABLE')
try:
import git
except ImportError as exc:
... | bsd-2-clause |
stefanpl/sublime-config | User/linters/go.py | 2 | 1051 | import os
from lint import Linter
def find_files(root, ext):
root = root.rstrip(os.sep) + os.sep
ret = []
for base, dirs, names in os.walk(root):
for name in names:
if name.endswith(ext):
base = base.replace(root, '', 1)
ret.append(os.path.join(base, name... | mit |
pigate/mongo-python-driver | test/test_uri_spec.py | 11 | 4682 | # Copyright 2011-2015 MongoDB, 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 writin... | apache-2.0 |
patilsangram/erpnext | erpnext/erpnext_integrations/connectors/shopify_connection.py | 8 | 9495 | from __future__ import unicode_literals
import frappe
from frappe import _
import json
from frappe.utils import cstr, cint, nowdate, flt
from erpnext.erpnext_integrations.utils import validate_webhooks_request
from erpnext.selling.doctype.sales_order.sales_order import make_delivery_note, make_sales_invoice
from erpnex... | gpl-3.0 |
jldbc/pybaseball | pybaseball/standings.py | 1 | 3820 | from typing import List, Optional
import pandas as pd
import requests
from bs4 import BeautifulSoup, Comment, PageElement, ResultSet
from . import cache
from .utils import most_recent_season
def get_soup(year: int) -> BeautifulSoup:
url = f'http://www.baseball-reference.com/leagues/MLB/{year}-standings.shtml'
... | mit |
rmerlino/dleyna-server | test/dbus/monitor_changed.py | 6 | 1511 | #!/usr/bin/env python
# monitor_last_change
#
# Copyright (C) 2012 Intel Corporation. All rights reserved.
#
# This program is free software; you can redistribute it and/or modify it
# under the terms and conditions of the GNU Lesser General Public License,
# version 2.1, as published by the Free Software Foundation.
... | lgpl-2.1 |
jbbskinny/sympy | sympy/polys/tests/test_partfrac.py | 48 | 5244 | """Tests for algorithms for partial fraction decomposition of rational
functions. """
from sympy.polys.partfrac import (
apart_undetermined_coeffs,
apart,
apart_list, assemble_partfrac_list
)
from sympy import (S, Poly, E, pi, I, Matrix, Eq, RootSum, Lambda,
Symbol, Dummy, factor, toget... | bsd-3-clause |
schnittstabil/findd | tests/utils/test_path.py | 1 | 2655 | from os import pathsep
from os.path import basename
from os.path import dirname
from os.path import join
from mock import patch
from mock import Mock
from .. import TestCase
import findd.utils.path as sut
class Parents(TestCase):
def test_should_work_with_empty_paths(self):
self.assertEqual(list(sut.par... | mit |
lalanne/SmallServers | py/common/ResponseBuilder.py | 1 | 1947 |
def build_base_message(msisdn, result):
message = '<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?>' + \
'<msg>' + \
'<header action=\"1\" id=\"1111\"/>' + \
'<resp>' + \
'<op>rslt_comp_promo</op>' + \
'<msisdn>' + str(msisdn) + '</msisdn>' + \
'<result>' + str(result... | gpl-3.0 |
sam-tsai/django | tests/update_only_fields/tests.py | 296 | 9780 | from __future__ import unicode_literals
from django.db.models.signals import post_save, pre_save
from django.test import TestCase
from .models import Account, Employee, Person, Profile, ProxyEmployee
class UpdateOnlyFieldsTests(TestCase):
def test_update_fields_basic(self):
s = Person.objects.create(nam... | bsd-3-clause |
susansalkeld/discsongs | discsongs/lib/python2.7/site-packages/setuptools/tests/test_svn.py | 300 | 7806 | # -*- coding: utf-8 -*-
"""svn tests"""
import io
import os
import subprocess
import sys
import unittest
from setuptools.tests import environment
from setuptools.compat import unicode, unichr
from setuptools import svn_utils
from setuptools.tests.py26compat import skipIf
def _do_svn_check():
try:
subpro... | mit |
sgerhart/ansible | test/units/modules/network/nso/nso_module.py | 28 | 3992 | # Copyright (c) 2017 Cisco and/or its affiliates.
#
# 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 v... | mit |
theheros/kbengine | kbe/res/scripts/common/Lib/multiprocessing/process.py | 2 | 10113 | #
# Module providing the `Process` class which emulates `threading.Thread`
#
# multiprocessing/process.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 conditions
# ... | lgpl-3.0 |
Carrotsmile/CS428 | steerstats/tools/deap/benchmarks/binary.py | 19 | 4840 | # This file is part of DEAP.
#
# DEAP 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) any later version.
#
# DEAP is distributed ... | gpl-3.0 |
redebian/documentation | django/contrib/comments/admin.py | 361 | 3299 | from django.contrib import admin
from django.contrib.comments.models import Comment
from django.utils.translation import ugettext_lazy as _, ungettext
from django.contrib.comments import get_model
from django.contrib.comments.views.moderation import perform_flag, perform_approve, perform_delete
class CommentsAdmin(adm... | bsd-3-clause |
DontBelieveMe/RoboIDE | qdarkstyle/__init__.py | 3 | 3698 | # -*- coding: utf-8 -*-
#
# The MIT License (MIT)
#
# Copyright (c) <2013-2014> <Colin Duquesnoy>
#
# 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 limi... | mit |
giginet/django-generic-tagging | generic_tagging/templatetags/tagging.py | 1 | 1210 | from django import template
from django.contrib.contenttypes.models import ContentType
from django.template.loader import render_to_string
from ..models import TaggedItem, Tag
register = template.Library()
@register.assignment_tag
def get_tagged_items_for(object):
'''retrieve tagged items which relative with the... | mit |
raymondxyang/tensorflow | tensorflow/contrib/integrate/python/ops/odes.py | 60 | 24150 | # 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 |
framon/samba | source3/selftest/tests.py | 1 | 27373 | #!/usr/bin/python
# This script generates a list of testsuites that should be run as part of
# the Samba 3 test suite.
# The output of this script is parsed by selftest.pl, which then decides
# which of the tests to actually run. It will, for example, skip all tests
# listed in selftest/skip or only run a subset durin... | gpl-3.0 |
pplatek/odoo | addons/hr_recruitment/__openerp__.py | 260 | 2780 | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). All Rights Reserved
# $Id$
#
# This program is free software: you can redistribute it and/or modify
# ... | agpl-3.0 |
watsonpy/watson-filters | tests/watson/filters/test_string.py | 1 | 1528 | # -*- coding: utf-8 -*-
from datetime import datetime
from watson.filters.string import Trim, RegEx, Numbers, Upper, Lower, StripTags, HtmlEntities, Date
class TestTrim(object):
def test_trim_string(self):
filter = Trim()
assert filter(' Test') == 'Test'
assert filter('Test') == 'Test'
... | bsd-3-clause |
happyleavesaoc/home-assistant | homeassistant/components/cover/rpi_gpio.py | 7 | 3381 | """
Support for controlling a Raspberry Pi cover.
Instructions for building the controller can be found here
https://github.com/andrewshilliday/garage-door-controller
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/cover.rpi_gpio/
"""
import logging
from... | apache-2.0 |
python-security/pyt | pyt/core/module_definitions.py | 1 | 4715 | """This module handles module definitions
which basically is a list of module definition."""
import ast
# Contains all project definitions for a program run
# Only used in framework_adaptor.py, but modified here
project_definitions = dict()
class ModuleDefinition():
"""Handling of a definition."""
module_... | gpl-2.0 |
mrquim/mrquimrepo | repo/script.module.exodus/lib/resources/lib/modules/tvmaze.py | 5 | 4098 | # -*- coding: utf-8 -*-
'''
Exodus Add-on
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 progra... | gpl-2.0 |
abramhindle/UnnaturalCodeFork | python/testdata/launchpad/lib/lp/registry/xmlrpc/softwarecenteragent.py | 1 | 1672 | # Copyright 2010-2011 Canonical Ltd. This software is licensed under the
# GNU Affero General Public License version 3 (see the file LICENSE).
"""XMLRPC APIs for person set."""
__metaclass__ = type
__all__ = [
'SoftwareCenterAgentAPI',
]
from zope.component import getUtility
from zope.interface import impl... | agpl-3.0 |
harigowtham/sos | sos/plugins/kdump.py | 12 | 1514 | # 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 in the hope that it will be useful,
# but... | gpl-2.0 |
BrainTech/openbci | obci/analysis/csp/MLogit.py | 1 | 11792 | #!/usr/bin/env python
#-*- coding:utf-8 -*-
"""This is a class for Multinomial Logit Regression
Class uses scipy.optimize package for minimalization of a cost function.
The gradient of the cost function is passed to the minimizer.
Piotr Milanowski, November 2011, Warsaw
"""
from scipy.optimize import fmin_ncg, fmin_... | gpl-3.0 |
ccomb/OpenUpgrade | addons/hr_timesheet_sheet/wizard/__init__.py | 443 | 1075 | # -*- 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 |
vijayanandau/KnowledgeShare | makahiki/apps/widgets/bonus_points/migrations/0004_auto__add_field_bonuspoint_claim_date__add_field_bonuspoint_create_dat.py | 7 | 4911 | # encoding: utf-8
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding field 'BonusPoint.claim_date'
db.add_column('bonus_points_bonuspoint', 'claim_date', self.gf('dja... | mit |
cslosiu/TweetList | oauthlib/oauth2/rfc6749/grant_types/resource_owner_password_credentials.py | 35 | 8389 | # -*- coding: utf-8 -*-
"""
oauthlib.oauth2.rfc6749.grant_types
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
"""
from __future__ import unicode_literals, absolute_import
import json
import logging
from .base import GrantTypeBase
from .. import errors
from ..request_validator import RequestValidator
log = logging.getLogger(_... | apache-2.0 |
koorukuroo/networkx_for_unicode | build/lib/networkx/algorithms/shortest_paths/tests/test_astar.py | 76 | 4927 | #!/usr/bin/env python
from nose.tools import *
import networkx as nx
from random import random, choice
class TestAStar:
def setUp(self):
self.XG=nx.DiGraph()
self.XG.add_edges_from([('s','u',{'weight':10}),
('s','x',{'weight':5}),
('u... | bsd-3-clause |
baylee/django | tests/defer/tests.py | 25 | 11390 | from __future__ import unicode_literals
from django.db.models.query_utils import InvalidQuery
from django.test import TestCase
from .models import (
BigChild, Child, ChildProxy, Primary, RefreshPrimaryProxy, Secondary,
)
class AssertionMixin(object):
def assert_delayed(self, obj, num):
"""
I... | bsd-3-clause |
pmarques/ansible | test/units/module_utils/urls/test_urls.py | 74 | 4040 | # -*- coding: utf-8 -*-
# (c) 2018 Matt Martz <matt@sivel.net>
# 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
from ansible.module_utils import urls
from ansible.module_utils._text import... | gpl-3.0 |
shlee89/athena | tools/test/topos/tower.py | 39 | 1460 | #!/usr/bin/env python
from mininet.topo import Topo
from mininet.cli import CLI
from mininet.net import Mininet
from mininet.node import RemoteController, OVSKernelSwitch
from mininet.log import setLogLevel
class TowerTopo( Topo ):
"""Create a tower topology"""
def build( self, k=4, h=6 ):
spines = ... | apache-2.0 |
aonotas/chainer | chainer/functions/array/select_item.py | 3 | 3414 | import numpy
import six
import chainer
from chainer.backends import cuda
from chainer import function_node
from chainer.utils import type_check
class SelectItem(function_node.FunctionNode):
"""Select elements stored in given indices."""
def check_type_forward(self, in_types):
type_check.expect(in_t... | mit |
jeremiahyan/odoo | odoo/addons/base/populate/res_company.py | 1 | 1638 | import collections
import logging
from odoo import models, Command
from odoo.tools import populate
_logger = logging.getLogger(__name__)
class Partner(models.Model):
_inherit = "res.company"
_populate_sizes = {
'small': 5,
'medium': 10,
'large': 50,
}
def _populate_factorie... | gpl-3.0 |
alperyeg/elephant | elephant/test/test_spike_train_generation.py | 1 | 42885 | # -*- coding: utf-8 -*-
"""
Unit tests for the spike_train_generation module.
:copyright: Copyright 2014-2016 by the Elephant team, see `doc/authors.rst`.
:license: Modified BSD, see LICENSE.txt for details.
"""
from __future__ import division
import os
import sys
import unittest
import warnings
import neo
import n... | bsd-3-clause |
hchen1202/django-react | virtualenv/lib/python3.6/site-packages/django/core/checks/registry.py | 114 | 3399 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from itertools import chain
from django.utils.itercompat import is_iterable
class Tags(object):
"""
Built-in tags for internal checks.
"""
admin = 'admin'
caches = 'caches'
compatibility = 'compatibility'
database = 'databas... | mit |
sid24ss/distcc | include_server/parse_file.py | 24 | 12527 | #! /usr/bin/python2.4
# Copyright 2007 Google 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 2
# of the License, or (at your option) any later version.
#
# This program i... | gpl-2.0 |
eshook/Forest | test_forest.py | 1 | 1438 | """
Copyright (c) 2017 Eric Shook. All rights reserved.
Use of this source code is governed by a BSD-style license that can be found in the LICENSE file.
@author: eshook (Eric Shook, eshook@gmail.edu)
@contributors: <Contribute and add your name here!>
"""
# Begin coverage testing
import coverage
cov = coverage.covera... | bsd-3-clause |
RongxinZhang/bitcoinxt | qa/rpc-tests/script_test.py | 94 | 9499 | #!/usr/bin/env python2
#
# Distributed under the MIT/X11 software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
#
'''
Test notes:
This test uses the script_valid and script_invalid tests from the unittest
framework to do end-to-end testing where we compare that two... | mit |
bridadan/pyOCD | pyOCD/pyDAPAccess/interface/__init__.py | 3 | 1881 | """
mbed CMSIS-DAP debugger
Copyright (c) 2006-2013 ARM Limited
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 |
vortex-exoplanet/VIP | vip_hci/negfc/utils_negfc.py | 2 | 8821 | #! /usr/bin/env python
"""
Module with post-processing related functions called from within the NFC
algorithm.
"""
__author__ = 'Carlos Alberto Gomez Gonzalez'
__all__ = ['cube_planet_free']
import numpy as np
from ..metrics import cube_inject_companions
import math
from matplotlib.pyplot import plot, xlim, ylim, ax... | mit |
apyrgio/synnefo | snf-astakos-app/astakos/im/views/util.py | 7 | 12280 | # Copyright (C) 2010-2014 GRNET S.A.
#
# 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 i... | gpl-3.0 |
bguillot/OpenUpgrade | addons/gamification_sale_crm/__openerp__.py | 67 | 1369 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2013 OpenERP SA (<http://openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... | agpl-3.0 |
CiscoSystems/jujucharm-n1k | charms/precise/juju-gui/server/guiserver/auth.py | 1 | 15759 | # This file is part of the Juju GUI, which lets users view and manage Juju
# environments within a graphical interface (https://launchpad.net/juju-gui).
# Copyright (C) 2013 Canonical Ltd.
#
# This program is free software: you can redistribute it and/or modify it under
# the terms of the GNU Affero General Public Lice... | apache-2.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.