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
albertoferna/compmech
setup.py
1
1198
from glob import glob import sys import os from subprocess import Popen import numpy #params = 'build_ext -inplace -IC:\clones\cubature\cubature ' + ' '.join(sys.argv[1:]) params = 'build_ext --inplace -I%s' % numpy.get_include() + ' '.join(sys.argv[1:]) + ' clean' cwd = os.getcwd() if os.name == 'nt': use_sdk =...
bsd-3-clause
transientskp/tkp
tests/test_accessors/test_detection.py
3
2726
import os import unittest from tkp.accessors.detection import isfits, islofarhdf5, detect, iscasa from tkp.accessors.lofarcasaimage import LofarCasaImage from tkp.accessors.casaimage import CasaImage from tkp.accessors.fitsimage import FitsImage from tkp.accessors.amicasaimage import AmiCasaImage import tkp.accessor...
bsd-2-clause
Endika/edx-platform
common/djangoapps/util/tests/test_date_utils.py
55
7800
# -*- coding: utf-8 -*- """ Tests for util.date_utils """ from datetime import datetime, timedelta, tzinfo import unittest import ddt from mock import patch from nose.tools import assert_equals, assert_false # pylint: disable=no-name-in-module from pytz import UTC from util.date_utils import ( get_default_time_...
agpl-3.0
bgris/ODL_bgris
lib/python3.5/site-packages/scipy/signal/tests/test_fir_filter_design.py
22
19826
from __future__ import division, print_function, absolute_import import numpy as np from numpy.testing import TestCase, run_module_suite, assert_raises, \ assert_almost_equal, assert_array_almost_equal, assert_equal, \ assert_, assert_allclose from scipy.special import sinc from scipy.signal import ka...
gpl-3.0
MicBrain/Scheme-Interpreter
scheme.py
1
21214
"""This module implements the core Scheme interpreter functions, including the eval/apply mutual recurrence, environment model, and read-eval-print loop. """ from scheme_primitives import * from scheme_reader import * from ucb import main, trace ############## # Eval/Apply # ############## def scheme_eval(expr, env)...
apache-2.0
danilito19/django
django/utils/feedgenerator.py
183
17059
""" Syndication feed generation library -- used for generating RSS, etc. Sample usage: >>> from django.utils import feedgenerator >>> feed = feedgenerator.Rss201rev2Feed( ... title="Poynter E-Media Tidbits", ... link="http://www.poynter.org/column.asp?id=31", ... description="A group Weblog by the sharpes...
bsd-3-clause
Kussie/HTPC-Manager
libs/sqlobject/classregistry.py
10
4903
""" classresolver.py 2 February 2004, Ian Bicking <ianb@colorstudy.com> Resolves strings to classes, and runs callbacks when referenced classes are created. Classes are referred to only by name, not by module. So that identically-named classes can coexist, classes are put into individual registries, which are keye...
mit
blighj/django
tests/generic_inline_admin/tests.py
47
22688
from django.contrib import admin from django.contrib.admin.sites import AdminSite from django.contrib.auth.models import User from django.contrib.contenttypes.admin import GenericTabularInline from django.contrib.contenttypes.forms import generic_inlineformset_factory from django.contrib.contenttypes.models import Cont...
bsd-3-clause
huobaowangxi/scikit-learn
sklearn/mixture/tests/test_dpgmm.py
261
4490
import unittest import sys import numpy as np from sklearn.mixture import DPGMM, VBGMM from sklearn.mixture.dpgmm import log_normalize from sklearn.datasets import make_blobs from sklearn.utils.testing import assert_array_less, assert_equal from sklearn.mixture.tests.test_gmm import GMMTester from sklearn.externals.s...
bsd-3-clause
nlholdem/icodoom
.venv/lib/python2.7/site-packages/tensorflow/python/ops/standard_ops.py
20
11074
# Copyright 2015 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
gpl-3.0
beefoo/still-i-rise
collect_sound_data.py
1
2076
# -*- coding: utf-8 -*- # Description: generate audio clips for lines, words, and syllables import argparse import json import os from pprint import pprint import re import subprocess import sys # input parser = argparse.ArgumentParser() parser.add_argument('-in', dest="INPUT_FILE", default="still_i_rise.wav", help=...
mit
Grirrane/odoo
addons/mrp/res_config.py
4
3430
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Business Applications # Copyright (C) 2004-2012 OpenERP S.A. (<http://openerp.com>). # # This program is free software: you can redistribute it and/or modify # it under the terms o...
agpl-3.0
mozaik-association/mozaik
odoo_addons/mozaik_address/wizard/change_main_address.py
2
5253
# -*- coding: utf-8 -*- ############################################################################## # # This file is part of mozaik_address, an Odoo module. # # Copyright (c) 2015 ACSONE SA/NV (<http://acsone.eu>) # # mozaik_address is free software: # you can redistribute it and/or # modify it u...
agpl-3.0
googleapis/googleapis-gen
google/cloud/talent/v4beta1/talent-v4beta1-py/google/cloud/talent_v4beta1/services/job_service/transports/grpc.py
1
23359
# -*- coding: utf-8 -*- # Copyright 2020 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 # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or...
apache-2.0
terencehonles/mailman
src/mailman/handlers/member_recipients.py
3
6310
# Copyright (C) 1998-2012 by the Free Software Foundation, Inc. # # This file is part of GNU Mailman. # # GNU Mailman 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-3.0
chungjjang80/FRETBursts
fretbursts/burstlib.py
1
133746
# # FRETBursts - A single-molecule FRET burst analysis toolkit. # # Copyright (C) 2013-2016 The Regents of the University of California, # Antonino Ingargiola <tritemio@gmail.com> # """ This module contains all the main FRETBursts analysis functions. `burstslib.py` defines the fundamental object `Data()`...
gpl-2.0
julien78910/CouchPotatoServer
couchpotato/core/media/movie/providers/trailer/youtube_dl/extractor/savefrom.py
185
1131
# coding: utf-8 from __future__ import unicode_literals import os.path import re from .common import InfoExtractor class SaveFromIE(InfoExtractor): IE_NAME = 'savefrom.net' _VALID_URL = r'https?://[^.]+\.savefrom\.net/\#url=(?P<url>.*)$' _TEST = { 'url': 'http://en.savefrom.net/#url=http://yout...
gpl-3.0
steveb/heat
heat/tests/openstack/heat/test_cloud_config.py
4
2112
# # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # ...
apache-2.0
takuya/namebench
libnamebench/reporter.py
173
16737
# Copyright 2009 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or ...
apache-2.0
sl2017/campos
campos_jobber_final/models/campos_jobber_accom_group.py
1
1182
# -*- coding: utf-8 -*- # Copyright 2017 Stein & Gabelgaard ApS # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). from openerp import api, fields, models, _ class CamposJobberAccomGroup(models.Model): _name = 'campos.jobber.accom.group' _description = 'Campos Jobber Accom Group' # TODO n...
agpl-3.0
lakshayg/tensorflow
tensorflow/python/eager/execute.py
16
8289
# 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
zephyrplugins/zephyr
zephyr.plugin.jython/jython2.5.2rc3/Lib/aifc.py
91
33417
"""Stuff to parse AIFF-C and AIFF files. Unless explicitly stated otherwise, the description below is true both for AIFF-C files and AIFF files. An AIFF-C file has the following structure. +-----------------+ | FORM | +-----------------+ | <size> | +----+------------+ | | AIFC ...
epl-1.0
aristanetworks/neutron
neutron/agent/l3/ha_router.py
3
13905
# Copyright (c) 2015 Openstack Foundation # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable ...
apache-2.0
OpenTouch/python-facette
src/facette/v1/groupentry.py
1
1278
# Copyright (c) 2014 Alcatel-Lucent Enterprise # 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 # # Un...
apache-2.0
RafaelRMachado/qtwebkit
Tools/Scripts/webkitpy/tool/commands/download.py
113
18403
# Copyright (c) 2009, 2011 Google Inc. All rights reserved. # Copyright (c) 2009 Apple 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...
gpl-2.0
homann/stand-browser
test/test_stand_browser_dockwidget.py
1
1123
# coding=utf-8 """DockWidget test. .. 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. """ __author__ = ...
gpl-2.0
macarthur-lab/xbrowse
xbrowse_server/api/views.py
1
67273
import datetime import csv import json import logging import sys import traceback from collections import defaultdict from django.views.decorators.csrf import csrf_exempt from django.conf import settings from django.contrib.auth.decorators import login_required from django.shortcuts import get_object_or_404 from django...
agpl-3.0
dvklopfenstein/PrincetonAlgorithms
py/AlgsSedgewickWayne/Topological.py
1
2002
"""Compute topological ordering(w DFS) of a DAG or edge-weighted DAG. Runs in O(E + V) time.""" # TBD Finish Python port from AlgsSedgewickWayne.DirectedCycle import DirectedCycle from AlgsSedgewickWayne.DepthFirstOrder import DepthFirstOrder from AlgsSedgewickWayne.EdgeWeightedDigraph import EdgeWeightedDigraph from...
gpl-2.0
antepsis/anteplahmacun
sympy/external/tests/test_codegen.py
73
11832
# This tests the compilation and execution of the source code generated with # utilities.codegen. The compilation takes place in a temporary directory that # is removed after the test. By default the test directory is always removed, # but this behavior can be changed by setting the environment variable # SYMPY_TEST_CL...
bsd-3-clause
CoolProp/CoolProp
dev/scripts/viscosity_builder.py
2
3895
from math import sqrt, exp from CoolProp.CoolProp import Props import numpy as np import matplotlib.pyplot as plt from scipy.odr import * from math import log E_K = {'REFPROP-Ammonia': 386, 'REFPROP-Argon': 143.2 } SIGMA = {'REFPROP-Ammonia': 0.2957, 'REFPROP-Argon': 0.335 } E_K['REFPRO...
mit
gaddman/ansible
lib/ansible/plugins/action/voss_config.py
63
4227
# # (c) 2018 Extreme Networks 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. # # Ans...
gpl-3.0
WizeCommerce/medusa
setup.py
1
1292
#!/usr/bin/env python import os from setuptools import setup, find_packages # Utility function to read the README file. # Used for the long_description. It's nice, because now 1) we have a top level # README file and 2) it's easier to type in the README file than to put a raw # string in below ... def read(fname): ...
apache-2.0
sanyaade-teachings/turbulenz_engine
scripts/buildassets.py
5
24091
#!/usr/bin/env python # Copyright (c) 2013-2014 Turbulenz Limited # pylint:disable=C0330 from sys import argv, stdout from json import loads as load_json, dumps as dump_json from yaml import load as load_yaml from os.path import join as path_join, exists as path_exists, splitext, basename, normpath, getmtime, dirname...
mit
erjohnso/ansible
lib/ansible/modules/cloud/ovirt/ovirt_snapshots_facts.py
73
4381
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright (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 #...
gpl-3.0
pllim/stginga
experimental/plugins/MultiImage.py
2
16207
import logging from math import cos, hypot, radians from ginga import GingaPlugin from ginga.gw import Widgets, Viewers instructions = ( 'To add images to the group, simply ensure that the plugin is active' 'and display the image in the main viewer.' '\n\nThen move, drag, or edit the region as needed.' ...
bsd-3-clause
Plantain/sms-mailinglist
lib/googlecloudapis/sqladmin/v1beta1/sqladmin_v1beta1_client.py
5
19012
"""Generated client library for sqladmin version v1beta1.""" from googlecloudapis.apitools.base.py import base_api from googlecloudapis.sqladmin.v1beta1 import sqladmin_v1beta1_messages as messages class SqladminV1beta1(base_api.BaseApiClient): """Generated client library for service sqladmin version v1beta1.""" ...
apache-2.0
jokey2k/sentry
tests/sentry/interfaces/test_user.py
15
1620
# -*- coding: utf-8 -*- from __future__ import absolute_import import mock from exam import fixture from sentry.testutils import TestCase from sentry.interfaces.user import User from sentry.models import Event class UserTest(TestCase): @fixture def event(self): return mock.Mock(spec=Event()) @...
bsd-3-clause
sanjeevtripurari/hue
desktop/core/ext-py/pysaml2-2.4.0/example/idp2/idp.py
29
37717
#!/usr/bin/env python import argparse import base64 import importlib import logging import os import re import socket import time from Cookie import SimpleCookie from hashlib import sha1 from urlparse import parse_qs from saml2 import BINDING_HTTP_ARTIFACT from saml2 import BINDING_URI from saml2 import BINDING_PAOS ...
apache-2.0
kleinfeld/medpy
medpy/features/__init__.py
1
1324
""" @package medpy.features Functionality to extract features from images and present/manipulate them. Packages: - histogram: Functions to create and manipulate (fuzzy) histograms. - intensity: Functions to extracts voxel-wise intensity based features from (medical) images. - texture: Run-time optimised fe...
gpl-3.0
open-austin/influence-texas
src/influencetx/legislators/migrations/0001_initial.py
1
1680
# -*- coding: utf-8 -*- # Generated by Django 1.11.15 on 2019-01-17 17:38 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): initial = True dependencies = [ ] operations = [ migrations.CreateModel( name='Legis...
gpl-2.0
MyPureCloud/kafka
tests/kafkatest/tests/tools/trogdor_test.py
17
4508
# 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 use ...
apache-2.0
devs1991/test_edx_docmode
lms/djangoapps/course_wiki/views.py
5
4720
""" This file contains view functions for wrapping the django-wiki. """ import logging import re import cgi from django.conf import settings from django.contrib.sites.models import Site from django.core.exceptions import ImproperlyConfigured from django.shortcuts import redirect from django.utils.translation import ug...
agpl-3.0
silly-wacky-3-town-toon/SOURCE-COD
Panda3D-1.10.0/panda3d/core.py
1
36364
# This file is automatically generated by makepanda.py. Do not modify. from __future__ import absolute_import from ._core import * ### BEGIN direct/src/extensions_native/core_extensions.py import sys main_dir = Filename() if sys.argv and sys.argv[0]: main_dir = Filename.from_os_specific(sys.argv[0]) if main_dir...
apache-2.0
raphaelrpl/portal
backend/appengine/routes/questions/rest.py
1
4013
# -*- coding: utf-8 -*- from __future__ import absolute_import, unicode_literals from time import sleep from gaebusiness.business import CommandExecutionException from permission_app.permission_facade import main_user_form from tekton.gae.middleware.json_middleware import JsonResponse from question_app import question_...
mit
vineodd/PIMSim
GEM5Simulation/gem5/src/mem/slicc/parser.py
10
22989
# Copyright (c) 2009 The Hewlett-Packard Development Company # Copyright (c) 2017 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...
gpl-3.0
nightjean/Deep-Learning
tensorflow/contrib/solvers/python/ops/util.py
116
2092
# 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
wojciechtanski/robotframework
utest/model/test_keyword.py
21
3891
import unittest from robot.utils.asserts import assert_equal, assert_true, assert_raises from robot.model import TestSuite, Message from robot.model.keyword import Keyword, Keywords class TestKeyword(unittest.TestCase): def test_id_without_parent(self): assert_equal(Keyword().id, 'k1') def test_id_...
apache-2.0
mozillazg/bustard
tests/httpbin/core.py
1
21325
# -*- coding: utf-8 -*- """ httpbin.core ~~~~~~~~~~~~ This module provides the core HttpBin experience. """ import base64 import json import os import random import time import uuid from bustard.app import Bustard from bustard.http import ( Response, Headers, jsonify as bustard_jsonify, redirect ) from bustard....
mit
yanchen036/tensorflow
tensorflow/python/kernel_tests/padding_fifo_queue_test.py
49
58572
# Copyright 2015 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
apache-2.0
SurfasJones/icecream-info
icecream/lib/python2.7/site-packages/sphinx/search/__init__.py
1
11415
# -*- coding: utf-8 -*- """ sphinx.search ~~~~~~~~~~~~~ Create a full-text search index for offline search. :copyright: Copyright 2007-2013 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. """ from __future__ import with_statement import re import cPickle as pickle from do...
mit
fsimkovic/cptbx
conkit/applications/hhblits.py
2
7994
# coding=utf-8 # # BSD 3-Clause License # # Copyright (c) 2016-19, University of Liverpool # 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 abov...
gpl-3.0
darrenbilby/grr
lib/flows/general/network.py
8
1499
#!/usr/bin/env python """These are network related flows.""" from grr.lib import aff4 from grr.lib import flow # pylint: disable=unused-import from grr.lib.aff4_objects import network # pylint: enable=unused-import class Netstat(flow.GRRFlow): """List running processes on a system.""" category = "/Network/" ...
apache-2.0
agaurav/ansible
lib/ansible/inventory/vars_plugins/noop.py
317
1632
# (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com> # (c) 2014, Serge van Ginderachter <serge@vanginderachter.be> # # 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 Foundat...
gpl-3.0
flyfei/python-for-android
python-modules/twisted/twisted/test/test_roots.py
81
1823
# Copyright (c) 2001-2004 Twisted Matrix Laboratories. # See LICENSE for details. from twisted.trial import unittest from twisted.python import roots import types class RootsTest(unittest.TestCase): def testExceptions(self): request = roots.Request() try: request.write("blah") ...
apache-2.0
omarkohl/pytest
_pytest/python.py
1
89408
""" Python test discovery, setup and run of test functions. """ import fnmatch import functools import inspect import re import types import sys import py import pytest from _pytest._code.code import TerminalRepr from _pytest.mark import MarkDecorator, MarkerError try: import enum except ImportError: # pragma: n...
mit
rockyzhang/zhangyanhit-python-for-android-mips
python3-alpha/python3-src/Lib/test/test_wait3.py
63
1057
"""This test checks for correct wait3() behavior. """ import os import time import unittest from test.fork_wait import ForkWait from test.support import run_unittest, reap_children try: os.fork except AttributeError: raise unittest.SkipTest("os.fork not defined -- skipping test_wait3") try: os.wait3 exce...
apache-2.0
cryptovein/p2pool-mintcoin
SOAPpy/WSDL.py
294
5100
"""Parse web services description language to get SOAP methods. Rudimentary support.""" ident = '$Id: WSDL.py 1467 2008-05-16 23:32:51Z warnes $' from version import __version__ import wstools import xml from Errors import Error from Client import SOAPProxy, SOAPAddress from Config import Config import urllib class...
gpl-3.0
jevonearth/frappe
frappe/async.py
6
6369
# -*- coding: utf-8 -*- # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and contributors # For license information, please see license.txt from __future__ import unicode_literals import frappe import os import time import redis from functools import wraps from frappe.utils import get_site_path from frappe import...
mit
darktears/chromium-crosswalk
tools/telemetry/third_party/typ/tools/cov.py
35
4646
#!/usr/bin/python # Copyright 2014 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 ap...
bsd-3-clause
ahmedaljazzar/edx-platform
openedx/core/djangoapps/header_control/tests/test_decorators.py
34
1095
"""Tests for remove_headers and force_header decorator. """ from django.http import HttpResponse, HttpRequest from django.test import TestCase from openedx.core.djangoapps.header_control.decorators import remove_headers, force_header def fake_view(_request): """Fake view that returns an empty response.""" re...
agpl-3.0
ilya-epifanov/ansible
lib/ansible/plugins/strategies/linear.py
1
14293
# (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
ceejatec/git-repo
subcmds/version.py
90
1376
# # Copyright (C) 2009 The Android Open Source Project # # 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 la...
apache-2.0
programadorjc/django
tests/user_commands/tests.py
205
7165
import os from django.apps import apps from django.core import management from django.core.management import BaseCommand, CommandError, find_commands from django.core.management.utils import find_command, popen_wrapper from django.db import connection from django.test import SimpleTestCase, ignore_warnings, override_s...
bsd-3-clause
befair/gasistafelice
gasistafelice/rest/views/contextmenu.py
3
3240
from django.utils.translation import ugettext as _, ugettext_lazy as _lazy from django.conf import settings from django.core.urlresolvers import reverse import copy, time from socket import gethostname from lib.shortcuts import render_to_response #--------------------------------------------------------------------...
agpl-3.0
bowang/tensorflow
tensorflow/python/estimator/canned/metric_keys.py
48
1578
# 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
jcpyun/Django-facebook
django_facebook/api.py
14
26484
try: from django.forms.utils import ValidationError except ImportError: from django.forms.util import ValidationError from django_facebook import settings as facebook_settings, signals from django_facebook.exceptions import FacebookException from django_facebook.utils import get_user_model, mass_get_or_create,...
bsd-3-clause
mramanathan/pydiary_notes
decorators/starter.py
1
1078
# _*_ coding: utf-8 _*_ #!/usr/bin/env/python def jewel(crown): ''' Novice decorator function ''' def necklace(*args, **kwargs): print("necklace is always below the crown {}".format(jewel.__name__)) return crown(*args, **kwargs) return necklace def funcLog(crowns): ''' Real wo...
gpl-3.0
ProfessorX/Config
.PyCharm30/system/python_stubs/-1247972723/PyQt4/QtGui/__init__/QWorkspace.py
2
4443
# encoding: utf-8 # module PyQt4.QtGui # from /usr/lib/python2.7/dist-packages/PyQt4/QtGui.so # by generator 1.135 # no doc # imports import PyQt4.QtCore as __PyQt4_QtCore from QWidget import QWidget class QWorkspace(QWidget): """ QWorkspace(QWidget parent=None) """ def activateNextWindow(self): # real sign...
gpl-2.0
ryangallen/django
tests/bash_completion/tests.py
327
3888
""" A series of tests to establish that the command-line bash completion works. """ import os import sys import unittest from django.apps import apps from django.core.management import ManagementUtility from django.test.utils import captured_stdout class BashCompletionTests(unittest.TestCase): """ Testing th...
bsd-3-clause
zrhans/pythonanywhere
.virtualenvs/django19/lib/python3.4/site-packages/django/core/files/move.py
554
2794
""" Move a file in the safest way possible:: >>> from django.core.files.move import file_move_safe >>> file_move_safe("/tmp/old_file", "/tmp/new_file") """ import os from shutil import copystat from django.core.files import locks __all__ = ['file_move_safe'] def _samefile(src, dst): # Macintosh, Unix....
apache-2.0
sindrig/django-guardian
guardian/management/__init__.py
13
1719
from __future__ import unicode_literals import django from django.db.models import signals from guardian import models as guardian_app from guardian.conf import settings as guardian_settings from guardian.compat import get_user_model from guardian.compat import import_string def get_init_anonymous_user(User): "...
bsd-2-clause
dhananjay92/servo
tests/wpt/css-tests/tools/webdriver/webdriver/keys.py
263
1481
"""Constants for special keys.""" class Keys: """Constants for special keys.""" NULL = '\uE000' CANCEL = '\uE001' HELP = '\uE002' BACK_SPACE = '\uE003' TAB = '\uE004' CLEAR = '\uE005' RETURN = '\uE006' ENTER = '\uE007' SHIFT = '\uE008' LEFT_SHIFT = '\uE008' CONTROL = '\u...
mpl-2.0
mammique/django
tests/regressiontests/extra_regress/tests.py
2
14184
from __future__ import absolute_import, unicode_literals import datetime from django.contrib.auth.models import User from django.test import TestCase from django.utils.datastructures import SortedDict from .models import TestObject, Order, RevisionableModel class ExtraRegressTests(TestCase): def setUp(self): ...
bsd-3-clause
Huyuwei/tvm
topi/python/topi/image/resize.py
1
7184
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not u...
apache-2.0
dulems/hue
desktop/core/ext-py/Django-1.6.10/django/db/models/fields/__init__.py
64
53213
from __future__ import unicode_literals import copy import datetime import decimal import math import warnings from base64 import b64decode, b64encode from itertools import tee from django.db import connection from django.db.models.loading import get_model from django.db.models.query_utils import QueryWrapper from dj...
apache-2.0
jandersson/website
lib/flask/config.py
781
6234
# -*- coding: utf-8 -*- """ flask.config ~~~~~~~~~~~~ Implements the configuration related objects. :copyright: (c) 2011 by Armin Ronacher. :license: BSD, see LICENSE for more details. """ import imp import os import errno from werkzeug.utils import import_string from ._compat import string_type...
apache-2.0
kenshay/ImageScript
ProgramData/Android/ADB/platform-tools/systrace/catapult/telemetry/telemetry/internal/results/csv_pivot_table_output_formatter.py
5
2408
# Copyright 2014 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import csv from telemetry.internal.results import output_formatter from telemetry.value import scalar from telemetry.value import trace class CsvPivotTabl...
gpl-3.0
cloudbase/lis-tempest
tempest/services/volume/xml/availability_zone_client.py
3
1525
# Copyright 2014 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
yelizariev/addons-yelizariev
web_debranding/__manifest__.py
1
1144
# Copyright 2015-2020 Ivan Yelizariev <https://it-projects.info/team/yelizariev> # Copyright 2017 Ilmir Karamov <https://it-projects.info/team/ilmir-k> # Copyright 2018-2019 Kolushov Alexandr <https://it-projects.info/team/KolushovAlexandr> # Copyright 2018 Ildar Nasyrov <https://it-projects.info/team/iledarn> # Copyri...
lgpl-3.0
beomyeol/models
slim/nets/resnet_v2_test.py
15
19147
# 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 applicable ...
apache-2.0
byt3bl33d3r/Empire
lib/modules/powershell/management/mailraider/mail_search.py
10
4295
from lib.common import helpers class Module: def __init__(self, mainMenu, params=[]): self.info = { 'Name': 'Invoke-MailSearch', 'Author': ['@xorrior'], 'Description': ("Searches the given Outlook folder for items (Emails, Contacts, Tasks, Notes, etc. *Depending on t...
bsd-3-clause
msabramo/kallithea
kallithea/lib/caching_query.py
2
10467
"""caching_query.py Represent persistence structures which allow the usage of Beaker caching with SQLAlchemy. The three new concepts introduced here are: * CachingQuery - a Query subclass that caches and retrieves results in/from Beaker. * FromCache - a query option that establishes caching parameters on a Q...
gpl-3.0
FreeScienceCommunity/or-tools
tools/setup.py
5
2452
from setuptools import setup, Extension from os.path import join as pjoin from os.path import dirname # Utility function to read the README file. # Used for the long_description. It's nice, because now 1) we have a top level # README file and 2) it's easier to type in the README file than to put a raw # string in bel...
apache-2.0
AxelDelmas/ansible
lib/ansible/plugins/action/package.py
50
2340
# (c) 2015, Ansible 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 di...
gpl-3.0
nekulin/arangodb
3rdParty/V8-4.3.61/third_party/python_26/Lib/test/test_import.py
48
14273
import unittest import os import random import shutil import sys import py_compile import warnings import marshal from test.test_support import unlink, TESTFN, unload, run_unittest, check_warnings def remove_files(name): for f in (name + os.extsep + "py", name + os.extsep + "pyc", name...
apache-2.0
geerlingguy/ansible
test/support/network-integration/collections/ansible_collections/vyos/vyos/plugins/doc_fragments/vyos.py
47
2643
# -*- coding: utf-8 -*- # Copyright: (c) 2015, Peter Sprygada <psprygada@ansible.com> # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) class ModuleDocFragment(object): # Standard files documentation fragment DOCUMENTATION = r"""options: provider: description...
gpl-3.0
ictofnwi/coach
dashboard/views.py
1
19639
import random import re import json import pytz import dateutil.parser from datetime import datetime, timedelta from pprint import pformat from hashlib import md5 from django.http import HttpResponse from django.core.exceptions import ObjectDoesNotExist from django.shortcuts import render, redirect from django.conf im...
agpl-3.0
mikacousin/olc
src/ascii_load.py
1
25915
"""ASCII file: Load functions""" import array from olc.channel_time import ChannelTime from olc.cue import Cue from olc.define import MAX_CHANNELS, NB_UNIVERSES, App from olc.device import Device, Parameter, Template from olc.group import Group from olc.independent import Independent from olc.master import Master fro...
gpl-3.0
agconti/njode
env/lib/python2.7/site-packages/allauth/socialaccount/providers/paypal/provider.py
68
1192
from allauth.socialaccount import providers from allauth.socialaccount.providers.base import ProviderAccount from allauth.socialaccount.providers.oauth2.provider import OAuth2Provider class PaypalAccount(ProviderAccount): def get_avatar_url(self): return self.account.extra_data.get('picture') def to_...
bsd-3-clause
wisechengyi/pants
tests/python/pants_test/backend/docgen/tasks/test_markdown_to_html_integration.py
2
2372
# Copyright 2014 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). import os from pants.base.build_environment import get_buildroot from pants.testutil.pants_run_integration_test import PantsRunIntegrationTest from pants.util.dirutil import safe_open c...
apache-2.0
mementum/backtrader
samples/vctest/vctest.py
1
15011
#!/usr/bin/env python # -*- coding: utf-8; py-indent-offset:4 -*- ############################################################################### # # Copyright (C) 2015-2020 Daniel Rodriguez # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License a...
gpl-3.0
sxhao/phantomjs
src/qt/qtwebkit/Tools/Scripts/webkitpy/common/checksvnconfigfile.py
135
2718
# Copyright (C) 2012 Balazs Ankes (bank@inf.u-szeged.hu) University of Szeged # # 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 lis...
bsd-3-clause
GrimDerp/thrust
performance/build/testsuite.py
28
2505
"""functions that generate reports and figures using the .xml output from the performance tests""" __all__ = ['TestSuite', 'parse_testsuite_xml'] class TestSuite: def __init__(self, name, platform, tests): self.name = name self.platform = platform self.tests = tests def __repr__(self)...
apache-2.0
potatolondon/potato-mapreduce
test/mapreduce/combiner_test.py
15
5268
#!/usr/bin/env python # Copyright 2011 Google Inc. All Rights Reserved. # Using opensource naming conventions, pylint: disable=g-bad-name import unittest import pipeline import cloudstorage from google.appengine.ext import db # pylint: disable=g-direct-third-party-import from mapreduce import input_readers from ...
apache-2.0
dansanderson/picotool
tests/pico8/music/music_test.py
1
3789
#!/usr/bin/env python3 import unittest from unittest.mock import Mock from unittest.mock import patch from pico8.music import music VALID_MUSIC_LINES = [b'00 41424344\n'] * 64 class TestMusic(unittest.TestCase): def testFromLines(self): m = music.Music.from_lines(VALID_MUSIC_LINES, 4) self.ass...
mit
vivisect/synapse
synapse/lib/trigger.py
1
1918
import logging import synapse.lib.cache as s_cache logger = logging.getLogger(__name__) class Triggers: def __init__(self): self._trig_list = [] self._trig_match = s_cache.MatchCache() self._trig_byname = s_cache.Cache(onmiss=self._onTrigNameMiss) def clear(self): ''' ...
apache-2.0
joelddiaz/openshift-tools
openshift/installer/vendored/openshift-ansible-3.2.13/filter_plugins/oo_filters.py
9
38540
#!/usr/bin/python # -*- coding: utf-8 -*- # vim: expandtab:tabstop=4:shiftwidth=4 """ Custom filters for use in openshift-ansible """ from ansible import errors from collections import Mapping from distutils.version import LooseVersion from operator import itemgetter import OpenSSL.crypto import os import pdb import p...
apache-2.0
vlegoff/tsunami
src/secondaires/navigation/equipage/postes/chirurgien.py
1
1796
# -*-coding:Utf-8 -* # Copyright (c) 2010-2017 LE GOFF Vincent # 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
allenai/allennlp
tests/training/metrics/covariance_test.py
1
7843
import numpy as np import torch from torch.testing import assert_allclose from allennlp.common.testing import ( AllenNlpTestCase, multi_device, # global_distributed_metric, # run_distributed_test, ) from allennlp.training.metrics import Covariance class CovarianceTest(AllenNlpTestCase): @multi_de...
apache-2.0
orionzhou/robin
utils/counter.py
1
6732
""" Counter class for py2.6 back compat. <http://code.activestate.com/recipes/576611/> """ from operator import itemgetter from heapq import nlargest from itertools import repeat, ifilter class Counter(dict): '''Dict subclass for counting hashable objects. Sometimes called a bag or multiset. Elements are st...
gpl-2.0