repo_name stringlengths 5 100 | path stringlengths 4 294 | copies stringclasses 990
values | size stringlengths 4 7 | content stringlengths 666 1M | license stringclasses 15
values |
|---|---|---|---|---|---|
songjs1993/DeepLearning | 5Project/facenet/src/validate_on_lfw.py | 1 | 5447 | """Validate a face recognizer on the "Labeled Faces in the Wild" dataset (http://vis-www.cs.umass.edu/lfw/).
Embeddings are calculated using the pairs from http://vis-www.cs.umass.edu/lfw/pairs.txt and the ROC curve
is calculated and plotted. Both the model metagraph and the model parameters need to exist
in the same d... | apache-2.0 |
damdam-s/account-financial-tools | account_constraints/model/account_move.py | 36 | 1613 | # -*- coding: utf-8 -*-
##############################################################################
#
# Author Joel Grand-Guillaume. Copyright 2012 Camptocamp SA
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# pub... | agpl-3.0 |
mkrautz/external-protobuf | python/google/protobuf/descriptor.py | 228 | 26625 | # 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... | bsd-3-clause |
tomkralidis/inasafe | safe/engine/core.py | 4 | 11963 | # coding=utf-8
"""Computational engine for InaSAFE core.
Provides the function calculate_impact()
"""
import numpy
from datetime import datetime
import logging
from PyQt4.QtCore import QSettings
from safe.common.exceptions import RadiiException
from safe.gis.geodesy import Point
from safe.storage.geometry import Po... | gpl-3.0 |
HyperBaton/ansible | lib/ansible/modules/network/panos/_panos_lic.py | 41 | 4794 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Ansible module to manage PaloAltoNetworks Firewall
# (c) 2016, techbizdev <techbizdev@paloaltonetworks.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 publish... | gpl-3.0 |
Alwnikrotikz/pychess | lib/pychess/widgets/pydock/PyDockLeaf.py | 20 | 7637 | from __future__ import absolute_import
from gi.repository import Gtk
from gi.repository import GObject
from pychess.System.prefix import addDataPrefix
from .__init__ import CENTER
from .__init__ import DockComposite, DockLeaf, TopDock
from .PyDockComposite import PyDockComposite
from .StarArrowButton import StarArrow... | gpl-3.0 |
SantosDevelopers/sborganicos | venv/lib/python3.5/site-packages/django/contrib/admin/templatetags/log.py | 499 | 2080 | from django import template
from django.contrib.admin.models import LogEntry
register = template.Library()
class AdminLogNode(template.Node):
def __init__(self, limit, varname, user):
self.limit, self.varname, self.user = limit, varname, user
def __repr__(self):
return "<GetAdminLog Node>"
... | mit |
heemanshu/swift_liberty | setup.py | 608 | 1045 | #!/usr/bin/env python
# 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 License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unle... | apache-2.0 |
XeCycle/indico | indico/testing/fixtures/event.py | 2 | 1974 | # This file is part of Indico.
# Copyright (C) 2002 - 2015 European Organization for Nuclear Research (CERN).
#
# Indico 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 (a... | gpl-3.0 |
bpsinc-native/src_tools_gyp | pylib/gyp/generator/msvs.py | 13 | 126748 | # Copyright (c) 2012 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import copy
import ntpath
import os
import posixpath
import re
import subprocess
import sys
import gyp.common
import gyp.easy_xml as easy_xml
import gyp.generator... | bsd-3-clause |
wubr2000/googleads-python-lib | examples/dfp/v201508/company_service/update_companies.py | 4 | 2372 | #!/usr/bin/python
#
# 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 b... | apache-2.0 |
Klaudit/phantomjs | src/qt/qtwebkit/Tools/Scripts/webkitpy/layout_tests/views/buildbot_results_unittest.py | 122 | 4562 | #!/usr/bin/env python
# Copyright (C) 2012 Google Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list ... | bsd-3-clause |
Cloverleaves/minCloud | Settings.py | 2 | 1188 | #!/usr/bin/python3
import os
import configparser
class Settings(object):
# Get main path from current file
dirname = os.path.dirname(__file__)
configParser = configparser.RawConfigParser()
configParser.read(os.path.join(dirname, 'config.ini'))
# Default port is 9999
PORT = configParser.ge... | mit |
azlanismail/prismgames | examples/games/car/networkx/classes/tests/test_multigraph.py | 1 | 8826 | #!/usr/bin/env python
from nose.tools import *
import networkx
from test_graph import BaseAttrGraphTester, TestGraph
class BaseMultiGraphTester(BaseAttrGraphTester):
def test_has_edge(self):
G=self.K3
assert_equal(G.has_edge(0,1),True)
assert_equal(G.has_edge(0,-1),False)
... | gpl-2.0 |
shipci/sympy | sympy/physics/vector/fieldfunctions.py | 18 | 8520 | from sympy import diff, integrate, S
from sympy.physics.vector import ReferenceFrame, Vector, express
from sympy.physics.vector.frame import _check_frame
from sympy.physics.vector.vector import _check_vector
__all__ = ['curl', 'divergence', 'gradient', 'is_conservative',
'is_solenoidal', 'scalar_potential'... | bsd-3-clause |
rtindru/django | tests/sites_tests/tests.py | 251 | 10760 | from __future__ import unicode_literals
from django.apps import apps
from django.conf import settings
from django.contrib.sites import models
from django.contrib.sites.management import create_default_site
from django.contrib.sites.middleware import CurrentSiteMiddleware
from django.contrib.sites.models import Site, c... | bsd-3-clause |
mattcongy/itshop | docker-images/taigav2/taiga-back/taiga/webhooks/permissions.py | 2 | 1798 | # -*- coding: utf-8 -*-
# Copyright (C) 2014-2016 Andrey Antukh <niwi@niwi.nz>
# Copyright (C) 2014-2016 Jesús Espino <jespinog@gmail.com>
# Copyright (C) 2014-2016 David Barragán <bameda@dbarragan.com>
# Copyright (C) 2014-2016 Alejandro Alonso <alejandro.alonso@kaleidos.net>
# This program is free software: you can r... | mit |
beblount/Steer-Clear-Backend-Web | env/Lib/site-packages/nose/ext/dtcompat.py | 96 | 88063 | # Module doctest.
# Released to the public domain 16-Jan-2001, by Tim Peters (tim@python.org).
# Major enhancements and refactoring by:
# Jim Fulton
# Edward Loper
# Provided as-is; use at your own risk; no warranty; no promises; enjoy!
#
# Modified for inclusion in nose to provide support for DocFileTest in
#... | mit |
hobbyjobs/photivo | scons-local-2.2.0/SCons/Variables/PackageVariable.py | 14 | 3646 | """engine.SCons.Variables.PackageVariable
This file defines the option type for SCons implementing 'package
activation'.
To be used whenever a 'package' may be enabled/disabled and the
package path may be specified.
Usage example:
Examples:
x11=no (disables X11 support)
x11=yes (will search for the... | gpl-3.0 |
agriffis/django-allauth | allauth/socialaccount/providers/instagram/provider.py | 75 | 1150 | from allauth.socialaccount import providers
from allauth.socialaccount.providers.base import ProviderAccount
from allauth.socialaccount.providers.oauth2.provider import OAuth2Provider
class InstagramAccount(ProviderAccount):
PROFILE_URL = 'http://instagram.com/'
def get_profile_url(self):
return sel... | mit |
fighterlyt/bite-project | deps/gdata-python-client/src/gdata/test_data.py | 103 | 348233 | #!/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 ... | apache-2.0 |
zerotired/kotori | kotori/__init__.py | 1 | 3791 | # -*- coding: utf-8 -*-
"""
Kotori is a data acquisition, routing and graphing toolkit
Copyright (C) 2014-2019 Andreas Motl, <andreas@getkotori.org>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published
by the Free Software Foundat... | agpl-3.0 |
ertugerata/iso-work | pisiman/gui/packages.py | 2 | 9103 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2005-2009, TUBITAK/UEKAE
#
# 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 ... | gpl-2.0 |
GoogleCloudPlatform/keras-idiomatic-programmer | zoo/autoencoder/dc_autoencoder_c.py | 1 | 5160 | # Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | apache-2.0 |
SnShine/aima-python | nlp.py | 1 | 21162 | """Natural Language Processing; Chart Parsing and PageRanking (Chapter 22-23)"""
from collections import defaultdict
from utils import weighted_choice
import urllib.request
import re
# ______________________________________________________________________________
# Grammars and Lexicons
def Rules(**rules):
"""C... | mit |
kenrestivo/linux | Documentation/target/tcm_mod_builder.py | 200 | 39622 | #!/usr/bin/python
# The TCM v4 multi-protocol fabric module generation script for drivers/target/$NEW_MOD
#
# Copyright (c) 2010 Rising Tide Systems
# Copyright (c) 2010 Linux-iSCSI.org
#
# Author: nab@kernel.org
#
import os, sys
import subprocess as sub
import string
import re
import optparse
tcm_dir = ""
fabric_ops... | gpl-2.0 |
mariosky/evo-drawings | venv/lib/python2.7/site-packages/pystache/renderer.py | 48 | 16537 | # coding: utf-8
"""
This module provides a Renderer class to render templates.
"""
import sys
from pystache import defaults
from pystache.common import TemplateNotFoundError, MissingTags, is_string
from pystache.context import ContextStack, KeyNotFoundError
from pystache.loader import Loader
from pystache.parsed im... | agpl-3.0 |
OpusVL/odoo | addons/account_payment/__openerp__.py | 1 | 2931 | # -*- 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 |
caplio/android_kernel_samsung_hltedcm | scripts/gcc-wrapper.py | 44 | 3444 | #! /usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2011-2012, The Linux Foundation. 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 th... | gpl-2.0 |
hdinsight/hue | desktop/core/ext-py/lxml-3.4.4/src/lxml/tests/test_etree.py | 4 | 155661 | # -*- coding: utf-8 -*-
"""
Tests specific to the extended etree API
Tests that apply to the general ElementTree API should go into
test_elementtree
"""
import os.path
import unittest
import copy
import sys
import re
import gc
import operator
import tempfile
import textwrap
import zlib
import gzip
this_dir = os.pat... | apache-2.0 |
bpsinc-native/src_tools_grit | grit/format/resource_map.py | 27 | 4029 | #!/usr/bin/env python
# Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
'''This file contains item formatters for resource_map_header and
resource_map_source files. A resource map is a mapping between r... | bsd-2-clause |
gak/pygooglechart | docs/conf.py | 1 | 8296 | # -*- coding: utf-8 -*-
#
# Python Google Chart documentation build configuration file, created by
# sphinx-quickstart on Sun Jul 1 13:00:34 2012.
#
# 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 f... | gpl-3.0 |
yinquan529/platform-external-chromium_org | tools/telemetry/examples/telemetry_perf_test.py | 24 | 1317 | #!/usr/bin/env python
# Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import os
import sys
import time
sys.path.append(os.path.join(os.path.dirname(__file__), '..'))
from telemetry.core import browser... | bsd-3-clause |
h00701350103/necro_score_bot | nsb_steam_board.py | 1 | 10069 | import datetime
import nsb_database
import nsb_format_points
import nsb_steam
##character
#All-Char DLC, All-Char, story mode, Aria, Bard, Bolt, Cadence, Coda, Diamond, Dorian, Dove, Eli, Mary, Melody, Monk, Nocturna, Tempo, None
##Mode
#Speed, Score, Deathless, Daily, None
##dlc
#True, False
##seeded
#True, False
... | gpl-2.0 |
alexdglover/shill-isms | venv/lib/python2.7/site-packages/sqlalchemy/engine/url.py | 21 | 8472 | # engine/url.py
# Copyright (C) 2005-2016 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
"""Provides the :class:`~sqlalchemy.engine.url.URL` class which encapsulates
informati... | mit |
tesidroni/mp | Lib/ctypes/macholib/framework.py | 268 | 2414 | ######################################################################
# This file should be kept compatible with Python 2.3, see PEP 291. #
######################################################################
"""
Generic framework path manipulation
"""
import re
__all__ = ['framework_info']
STRICT_FRAMEWORK_RE =... | gpl-3.0 |
FEniCS/dolfin | demo/undocumented/multimesh-poisson/python/demo_multimesh-poisson.py | 1 | 3820 | # Copyright (C) 2015 Anders Logg
#
# This file is part of DOLFIN.
#
# DOLFIN 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.
#
#... | lgpl-3.0 |
fujunwei/chromium-crosswalk | tools/json_schema_compiler/cpp_type_generator.py | 23 | 11489 | # Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
from code import Code
from model import PropertyType
import cpp_util
from json_parse import OrderedDict
import schema_util
class _TypeDependency(object)... | bsd-3-clause |
kenshay/ImageScripter | ProgramData/SystemFiles/Python/Lib/site-packages/sphinx/builders/gettext.py | 4 | 8853 | # -*- coding: utf-8 -*-
"""
sphinx.builders.gettext
~~~~~~~~~~~~~~~~~~~~~~~
The MessageCatalogBuilder class.
:copyright: Copyright 2007-2016 by the Sphinx team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
from __future__ import unicode_literals
from os import path, walk, getenv
from... | gpl-3.0 |
tahmid-tanzim/youtube-dl | youtube_dl/extractor/groupon.py | 132 | 1903 | from __future__ import unicode_literals
from .common import InfoExtractor
class GrouponIE(InfoExtractor):
_VALID_URL = r'https?://www\.groupon\.com/deals/(?P<id>[^?#]+)'
_TEST = {
'url': 'https://www.groupon.com/deals/bikram-yoga-huntington-beach-2#ooid=tubGNycTo_9Uxg82uESj4i61EYX8nyuf',
'in... | unlicense |
DanielSantoyo/SmallBarrel | source/lib_scribi/nomi_lingue.py | 1 | 1463 | ####################################################
#Software License: #
#--------------------------------------------------#
#The Artistic License 2.0 #
# #
# Copyright (c) 2016, Daniel Santoyo Gomez. ... | artistic-2.0 |
kobejean/tensorflow | tensorflow/python/ops/spectral_ops.py | 8 | 12880 | # 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 |
GdZ/scriptfile | software/googleAppEngine/lib/django_1_3/tests/regressiontests/forms/localflavor/se.py | 88 | 6442 | # -*- coding: utf-8 -*-
from django.contrib.localflavor.se.forms import (SECountySelect,
SEOrganisationNumberField, SEPersonalIdentityNumberField,
SEPostalCodeField)
import datetime
from utils import LocalFlavorTestCase
class SELocalFlavorTests(LocalFlavorTestCase):
def setUp(self):
# Mocking da... | mit |
carlcarl/rcard | rcard/urls.py | 1 | 1170 | """rcard URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.8/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
Class-based... | mit |
spotman/ArduinoJson | third-party/gtest-1.7.0/test/gtest_xml_output_unittest.py | 1815 | 14580 | #!/usr/bin/env python
#
# Copyright 2006, 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... | mit |
Lekensteyn/buildbot | worker/buildbot_worker/__init__.py | 6 | 2300 | # This file is part of Buildbot. Buildbot is free software: you can
# redistribute it and/or modify it under the terms of the GNU General Public
# License as published by the Free Software Foundation, version 2.
#
# This program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without eve... | gpl-2.0 |
FusionSP/android_external_chromium_org | tools/perf/benchmarks/scirra.py | 33 | 2465 | # 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.
"""Scirra WebGL and Canvas2D rendering benchmark suite.
The Scirra WebGL performance test measures the number of 2D triangles
represented onscreen when the ... | bsd-3-clause |
revanthkolli/osf.io | website/addons/dataverse/views/crud.py | 5 | 1822 | # -*- coding: utf-8 -*-
import httplib
import logging
import datetime
from framework.exceptions import HTTPError
from website.addons.dataverse.client import (
publish_dataset, get_dataset, get_dataverse, connect_from_settings_or_401,
publish_dataverse,
)
from website.project.decorators import must_have_permiss... | apache-2.0 |
jaspreetw/tempest | tempest/api/image/admin/v2/test_images.py | 18 | 2150 | # Copyright 2015 Red Hat, 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... | apache-2.0 |
magicrub/mavlink | pymavlink/tools/magfit_gps.py | 47 | 4972 | #!/usr/bin/env python
'''
fit best estimate of magnetometer offsets
'''
import sys, time, os, math
from argparse import ArgumentParser
parser = ArgumentParser(description=__doc__)
parser.add_argument("--no-timestamps", dest="notimestamps", action='store_true', help="Log doesn't have timestamps")
parser.add_argument(... | lgpl-3.0 |
gauribhoite/personfinder | env/google_appengine/lib/django-1.4/django/contrib/gis/gdal/feature.py | 92 | 3941 | # The GDAL C library, OGR exception, and the Field object
from django.contrib.gis.gdal.base import GDALBase
from django.contrib.gis.gdal.error import OGRException, OGRIndexError
from django.contrib.gis.gdal.field import Field
from django.contrib.gis.gdal.geometries import OGRGeometry, OGRGeomType
# ctypes function pro... | apache-2.0 |
ohmannomma/proofofexistence | babel/messages/jslexer.py | 162 | 5317 | # -*- coding: utf-8 -*-
"""
babel.messages.jslexer
~~~~~~~~~~~~~~~~~~~~~~
A simple JavaScript 1.5 lexer which is used for the JavaScript
extractor.
:copyright: (c) 2013 by the Babel Team.
:license: BSD, see LICENSE for more details.
"""
from operator import itemgetter
import re
from babel._co... | mit |
dhoffman34/django | django/contrib/gis/geos/geometry.py | 9 | 24742 | """
This module contains the 'base' GEOSGeometry object -- all GEOS Geometries
inherit from this object.
"""
from __future__ import unicode_literals
# Python, ctypes and types dependencies.
from ctypes import addressof, byref, c_double
# super-class for mutable list behavior
from django.contrib.gis.geos.mutable_lis... | bsd-3-clause |
lfranchi/zulip | zerver/views/__init__.py | 41 | 108563 | from __future__ import absolute_import
from django.conf import settings
from django.contrib.auth import authenticate, login, get_backends
from django.contrib.auth.decorators import login_required
from django.core.urlresolvers import reverse
from django.http import HttpResponseRedirect, HttpResponseForbidden, HttpRespo... | apache-2.0 |
frhumanes/consulting | web/src/cal/utils.py | 1 | 5973 | # -*- encoding: utf-8 -*-
import calendar
import time
import copy
from django.utils.translation import ugettext_lazy as _
from django.shortcuts import get_object_or_404
from django.contrib.auth.models import User
from django.conf import settings
from datetime import date, datetime, timedelta
from datetime import time ... | apache-2.0 |
b0ttl3z/SickRage | lib/babelfish/converters/__init__.py | 71 | 9253 | # Copyright (c) 2013 the BabelFish authors. All rights reserved.
# Use of this source code is governed by the 3-clause BSD license
# that can be found in the LICENSE file.
#
import collections
from pkg_resources import iter_entry_points, EntryPoint
from ..exceptions import LanguageConvertError, LanguageReverseError
#... | gpl-3.0 |
readevalprint/zipline | docs/conf.py | 9 | 8040 | # -*- coding: utf-8 -*-
#
# QSim documentation build configuration file, created by
# sphinx-quickstart on Wed Feb 8 15:29:56 2012.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# All co... | apache-2.0 |
eunchong/build | third_party/coverage-3.7.1/coverage/results.py | 160 | 10005 | """Results of coverage measurement."""
import os
from coverage.backward import iitems, set, sorted # pylint: disable=W0622
from coverage.misc import format_lines, join_regex, NoSource
from coverage.parser import CodeParser
class Analysis(object):
"""The results of analyzing a code unit."""
def __init... | bsd-3-clause |
MiltosD/CEF-ELRC | lib/python2.7/site-packages/django/contrib/gis/db/backends/oracle/models.py | 310 | 2184 | """
The GeometryColumns and SpatialRefSys models for the Oracle spatial
backend.
It should be noted that Oracle Spatial does not have database tables
named according to the OGC standard, so the closest analogs are used.
For example, the `USER_SDO_GEOM_METADATA` is used for the GeometryColumns
model and the `SDO_... | bsd-3-clause |
Shrhawk/edx-platform | common/test/acceptance/tests/test_annotatable.py | 54 | 5361 | # -*- coding: utf-8 -*-
"""
E2E tests for the LMS.
"""
from unittest import skip
from .helpers import UniqueCourseTest
from ..pages.studio.auto_auth import AutoAuthPage
from ..pages.lms.courseware import CoursewarePage
from ..pages.lms.annotation_component import AnnotationComponentPage
from ..fixtures.course import C... | agpl-3.0 |
Wattpad/dd-agent | utils/checkfiles.py | 7 | 3605 | """Helpers to work with check files (Python and YAML)."""
# std
import logging
import os
from urlparse import urljoin
# project
from util import check_yaml
log = logging.getLogger(__name__)
def get_conf_path(check_name):
"""Return the yaml config file path for a given check name or raise an IOError."""
from... | bsd-3-clause |
YeelerG/scrapy | tests/test_closespider.py | 140 | 2413 | from twisted.internet import defer
from twisted.trial.unittest import TestCase
from scrapy.utils.test import get_crawler
from tests.spiders import FollowAllSpider, ItemSpider, ErrorSpider
from tests.mockserver import MockServer
class TestCloseSpider(TestCase):
def setUp(self):
self.mockserver = MockServe... | bsd-3-clause |
bdh1011/wau | venv/lib/python2.7/site-packages/celery/tests/backends/test_cassandra.py | 8 | 6412 | from __future__ import absolute_import
import socket
from pickle import loads, dumps
from celery import states
from celery.exceptions import ImproperlyConfigured
from celery.tests.case import (
AppCase, Mock, mock_module, depends_on_current_app,
)
class Object(object):
pass
def install_exceptions(mod):
... | mit |
Gitlab11/odoo | addons/stock/wizard/orderpoint_procurement.py | 326 | 2844 | # -*- 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 |
bootswithdefer/ansible | lib/ansible/runner/lookup_plugins/sequence.py | 85 | 6836 | # (c) 2013, Jayson Vantuyl <jayson@aggressive.ly>
#
# 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... | gpl-3.0 |
tangentlabs/wagtail | wagtail/tests/testapp/migrations/0001_initial.py | 22 | 18850 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import django.db.models.deletion
from django.conf import settings
import modelcluster.contrib.taggit
import wagtail.wagtailimages.models
import wagtail.wagtailadmin.taggable
import modelcluster.fields
import wagtai... | bsd-3-clause |
255BITS/HyperGAN | hypergan/trainers/gang_trainer.py | 1 | 23759 | import tensorflow as tf
import numpy as np
import hyperchamber as hc
import inspect
import nashpy as nash
import hypergan as hg
import hyperchamber as hc
import sys
import gc
import os
import random
from hypergan.trainers.base_trainer import BaseTrainer
TINY = 1e-12
class GangTrainer(BaseTrainer):
def create(sel... | mit |
ligo-cbc/pycbc | pycbc/results/scatter_histograms.py | 4 | 29832 | # Copyright (C) 2016 Miriam Cabero Mueller, Collin Capano
#
# 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 pro... | gpl-3.0 |
hcrlab/access_teleop | rosbridge_suite/rosbridge_library/test/internal/publishers/test_publisher_consistency_listener.py | 3 | 5489 | #!/usr/bin/env python
from __future__ import print_function
import sys
import rospy
import rostest
import unittest
from time import sleep, time
from rosbridge_library.internal.publishers import *
from rosbridge_library.internal import ros_loader
from rosbridge_library.internal.message_conversion import *
from std_msg... | mit |
mandshaw/lethe | lethe/reminder.py | 1 | 2665 | # -*- coding: utf-8 -*-
import sys
import random
from datetime import datetime, timedelta
from lethe.rollardex import RollarDex
from lethe.email_utils import send_basic_email
import logging
LOG = logging.getLogger(__name__)
LOG.setLevel(logging.INFO)
ch = logging.StreamHandler(sys.stdout)
formatter = logging.Formatter... | mit |
Teamxrtc/webrtc-streaming-node | third_party/depot_tools/external_bin/gsutil/gsutil_4.15/gsutil/third_party/boto/tests/unit/swf/test_layer2_domain.py | 94 | 6008 | import boto.swf.layer2
from boto.swf.layer2 import Domain, ActivityType, WorkflowType, WorkflowExecution
from tests.unit import unittest
from mock import Mock
class TestDomain(unittest.TestCase):
def setUp(self):
boto.swf.layer2.Layer1 = Mock()
self.domain = Domain(name='test-domain', description... | mit |
yodalee/servo | tests/wpt/css-tests/tools/pywebsocket/src/mod_pywebsocket/common.py | 489 | 9947 | # Copyright 2012, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the f... | mpl-2.0 |
emk/rust | src/etc/2014-06-rewrite-bytes-macros.py | 46 | 3582 | #!/usr/bin/env python
#
# Copyright 2014 The Rust Project Developers. See the COPYRIGHT
# file at the top-level directory of this distribution and at
# http://rust-lang.org/COPYRIGHT.
#
# Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
# http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
#... | apache-2.0 |
slevenhagen/odoo | addons/project/report/__init__.py | 444 | 1069 | # -*- 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 |
CatsAndDogsbvba/odoo | addons/sale/sales_team.py | 57 | 4229 | # -*- coding: utf-8 -*-
import calendar
from datetime import date
from dateutil import relativedelta
import json
from openerp import tools
from openerp.osv import fields, osv
from openerp.tools.float_utils import float_repr
class crm_case_section(osv.osv):
_inherit = 'crm.case.section'
def _get_sale_orders_... | agpl-3.0 |
rspavel/spack | var/spack/repos/builtin/packages/xxhash/package.py | 1 | 1692 | # Copyright 2013-2020 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class Xxhash(MakefilePackage):
"""xxHash is an Extremely fast Hash algorithm, running at RAM spe... | lgpl-2.1 |
blink1073/pexpect | pexpect/FSM.py | 73 | 13419 | #!/usr/bin/env python
'''This module implements a Finite State Machine (FSM). In addition to state
this FSM also maintains a user defined "memory". So this FSM can be used as a
Push-down Automata (PDA) since a PDA is a FSM + memory.
The following describes how the FSM works, but you will probably also need to
see the... | isc |
jpopelka/fabric8-analytics-worker | f8a_worker/setup_celery.py | 3 | 2243 | #!/usr/bin/env python
"""Functions to setup Selinon/Celery."""
from celery import Celery
from celery import __version__ as celery_version
import logging
from pathlib import Path
from selinon import Config, selinon_version
from f8a_worker.celery_settings import CelerySettings
YAML_FILES_DIR = Path(__file__).resolve()... | gpl-3.0 |
JoshOY/shadowsocks | shadowsocks/local.py | 1015 | 2248 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2012-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 r... | apache-2.0 |
youfoh/TizenProject | tools/perf/scripts/python/syscall-counts.py | 11181 | 1522 | # system call counts
# (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
import sys
sys.path.append(os.envir... | gpl-2.0 |
helldorado/ansible | lib/ansible/modules/network/fortios/fortios_firewall_ssh_setting.py | 24 | 9453 | #!/usr/bin/python
from __future__ import (absolute_import, division, print_function)
# 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 Lic... | gpl-3.0 |
SaberMod/gdb-saber | gdb/python/lib/gdb/prompt.py | 68 | 4209 | # Extended prompt utilities.
# Copyright (C) 2011-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 your option) any ... | gpl-2.0 |
HopeFOAM/HopeFOAM | ThirdParty-0.1/ParaView-5.0.1/VTK/Imaging/Core/Testing/Python/TestExtractVOI.py | 20 | 1491 | #!/usr/bin/env python
import vtk
from vtk.test import Testing
from vtk.util.misc import vtkGetDataRoot
VTK_DATA_ROOT = vtkGetDataRoot()
# to mark the origin
sphere = vtk.vtkSphereSource()
sphere.SetRadius(2.0)
sphereMapper = vtk.vtkPolyDataMapper()
sphereMapper.SetInputConnection(sphere.GetOutputPort())
sphereMapper.... | gpl-3.0 |
arskom/spyne | spyne/model/primitive/string.py | 2 | 9512 |
#
# spyne - Copyright (C) Spyne contributors.
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any later version.
#
# This libra... | lgpl-2.1 |
dntt1/youtube-dl | youtube_dl/extractor/c56.py | 91 | 2083 | # coding: utf-8
from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..utils import js_to_json
class C56IE(InfoExtractor):
_VALID_URL = r'https?://(?:(?:www|player)\.)?56\.com/(?:.+?/)?(?:v_|(?:play_album.+-))(?P<textid>.+?)\.(?:html|swf)'
IE_NAME = '56.com'
_TESTS = ... | unlicense |
RaoUmer/django | tests/regressiontests/utils/tzinfo.py | 149 | 3072 | import copy
import datetime
import os
import pickle
import time
from django.utils.tzinfo import FixedOffset, LocalTimezone
from django.utils import unittest
class TzinfoTests(unittest.TestCase):
@classmethod
def setUpClass(cls):
cls.old_TZ = os.environ.get('TZ')
os.environ['TZ'] = 'US/Eastern'... | bsd-3-clause |
CaptTofu/ansible | test/units/TestVaultEditor.py | 28 | 5331 | #!/usr/bin/env python
from unittest import TestCase
import getpass
import os
import shutil
import time
import tempfile
from binascii import unhexlify
from binascii import hexlify
from nose.plugins.skip import SkipTest
from ansible import errors
from ansible.utils.vault import VaultLib
from ansible.utils.vault import ... | gpl-3.0 |
pypingou/pagure | tests/test_pagure_flask_api_fork.py | 1 | 137631 | # -*- coding: utf-8 -*-
"""
(c) 2015 - Copyright Red Hat Inc
Authors:
Pierre-Yves Chibon <pingou@pingoured.fr>
"""
from __future__ import unicode_literals, absolute_import
import datetime
import unittest
import shutil
import sys
import os
import json
from mock import patch, MagicMock
sys.path.insert(0, os.p... | gpl-2.0 |
kevinmost/LiteSync | venv/lib/python2.7/site-packages/jinja2/nodes.py | 623 | 28875 | # -*- coding: utf-8 -*-
"""
jinja2.nodes
~~~~~~~~~~~~
This module implements additional nodes derived from the ast base node.
It also provides some node tree helper functions like `in_lineno` and
`get_nodes` used by the parser and translator in order to normalize
python and jinja nodes.
:... | gpl-3.0 |
Nitrate/Nitrate | src/tcms/xmlrpc/serializer.py | 2 | 19833 | # -*- coding: utf-8 -*-
import operator
from collections import OrderedDict
from datetime import datetime
from datetime import timedelta
from itertools import groupby
from typing import Optional
from django.db.models import ObjectDoesNotExist
from django.db.models.fields.related import ForeignKey
# TODO: to encode ... | gpl-2.0 |
jorik041/the-backdoor-factory | machobin.py | 33 | 26456 | #!/usr/bin/env python
'''
Copyright (c) 2013-2015, Joshua Pitts
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice,
this li... | bsd-3-clause |
mvidalgarcia/indico | indico/modules/categories/models/legacy_mapping.py | 2 | 1283 | # This file is part of Indico.
# Copyright (C) 2002 - 2019 CERN
#
# Indico is free software; you can redistribute it and/or
# modify it under the terms of the MIT License; see the
# LICENSE file for more details.
from __future__ import unicode_literals
from indico.core.db import db
from indico.util.string import retu... | mit |
egabancho/invenio | invenio/modules/cloudconnector/fsopeners/dropbox_factory.py | 4 | 3380 | # -*- coding: utf-8 -*-
##
## This file is part of Invenio.
## Copyright (C) 2013, 2014 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 opt... | gpl-2.0 |
OndroNR/ga-bitbot | libs/cache.py | 18 | 5642 | """
cache v0.01
simple object serializing cache wrapper and client side partitioner for redis
Copyright 2012 Brian Monkaba
This file is part of ga-bitbot.
ga-bitbot 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 Softw... | gpl-3.0 |
NeovaHealth/odoo | addons/sale_stock/__init__.py | 376 | 1045 | # -*- 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 |
huyphan/pyyawhois | test/record/parser/test_response_whois_nic_ag_status_available.py | 1 | 2000 |
# This file is autogenerated. Do not edit it manually.
# If you want change the content of this file, edit
#
# spec/fixtures/responses/whois.nic.ag/status_available
#
# and regenerate the tests with the following script
#
# $ scripts/generate_tests.py
#
from nose.tools import *
from dateutil.parser import parse a... | mit |
Juniper/tempest | tempest/tests/lib/services/image/v2/test_image_members_client.py | 5 | 3755 | # Copyright 2016 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 |
elbeardmorez/quodlibet | quodlibet/quodlibet/ext/songsmenu/fingerprint/util.py | 1 | 1232 | # -*- coding: utf-8 -*-
# Copyright 2011,2013,2014 Christoph Reiter
#
# 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.
i... | gpl-2.0 |
UNINETT/nav | tests/integration/querysets_test.py | 2 | 2152 | import datetime as dt
from django.test import TestCase
from nav.models.event import AlertHistory
from nav.models.event import AlertHistoryVariable
from nav.models.event import EventType
from nav.models.event import Subsystem
from nav.models.fields import INFINITY
from nav.models.manage import Netbox
from nav.models.m... | gpl-2.0 |
iredelmeier/snakespec | snakespec/snakespec.py | 1 | 2448 | from inspect import getmembers
from os import environ
from os.path import sep
import re
from types import MethodType
from nose.plugins import Plugin
def describe(test_case):
test_case._is_describe = True
return test_case
class SnakeSpec(Plugin):
env_option = 'NOSE_SNAKESPEC'
def __init__(self):
... | mit |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.