repo_name
stringlengths
5
100
ref
stringlengths
12
67
path
stringlengths
4
244
copies
stringlengths
1
8
content
stringlengths
0
1.05M
adrianholovaty/django
refs/heads/master
django/core/management/base.py
5
""" Base classes for writing management commands (named commands which can be executed through ``django-admin.py`` or ``manage.py``). """ import os import sys from io import BytesIO from optparse import make_option, OptionParser import traceback import django from django.core.exceptions import ImproperlyConfigured f...
alexandriagroup/rakuten-ws
refs/heads/master
tests/webservice/rms/test_item.py
1
# coding: utf-8 from __future__ import unicode_literals from ... import slugify URLS = { 'insert': slugify('item test 01'), 'search': slugify('item test 02'), 'update1': slugify('item test 03'), 'update2': slugify('item test 04'), } def cleanup(ws): for label in URLS: result = ws.rms.it...
alirizakeles/tendenci
refs/heads/master
tendenci/apps/profiles/templatetags/profile_filters.py
4
from django.db.models import Q from django.template import Library from tendenci.apps.invoices.models import Invoice register = Library() @register.filter def allow_edit_by(profile, user): """ Check if the profile allows to be edited by the user. Returns True/False. """ return profile.allow_edit_by...
astocko/agpy
refs/heads/master
agpy/collapse_gaussfit.py
6
""" ----------------- Collapse Gaussfit ----------------- This was an early attempt to automate gaussian fitting over a data cube using (multiple) gaussian decomposition for each spectrum. It's reasonably effective, but the uses are somewhat minimal. I've tried shifting my cube-related work to `pyspeckit <pyspeckit...
kogotko/carburetor
refs/heads/master
openstack_dashboard/enabled/_1640_project_template_versions_panel.py
9
# The slug of the panel to be added to HORIZON_CONFIG. Required. PANEL = 'stacks.template_versions' # The slug of the dashboard the PANEL associated with. Required. PANEL_DASHBOARD = 'project' # The slug of the panel group the PANEL is associated with. PANEL_GROUP = 'orchestration' # Python panel class of the PANEL to...
leafclick/intellij-community
refs/heads/master
python/testData/inspections/PyUnresolvedReferencesInspection/NamespacePackageAttributes/p1/m1.py
819
def foo(): pass
Intel-Corporation/tensorflow
refs/heads/master
tensorflow/python/eager/def_function_test.py
1
# 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...
sander76/home-assistant
refs/heads/dev
homeassistant/components/google_travel_time/sensor.py
1
"""Support for Google travel time sensors.""" from datetime import datetime, timedelta import logging import googlemaps import voluptuous as vol from homeassistant.components.sensor import PLATFORM_SCHEMA, SensorEntity from homeassistant.const import ( ATTR_ATTRIBUTION, ATTR_LATITUDE, ATTR_LONGITUDE, ...
jacksonwilliams/arsenalsuite
refs/heads/master
cpp/lib/PyQt4/examples/mainwindows/mdi/mdi.py
14
#!/usr/bin/env python ############################################################################# ## ## Copyright (C) 2010 Riverbank Computing Limited. ## Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). ## All rights reserved. ## ## This file is part of the examples of PyQt. ## ## $QT_BEGIN_LICENS...
jjmiranda/edx-platform
refs/heads/master
lms/djangoapps/courseware/tests/test_video_mongo.py
7
# -*- coding: utf-8 -*- """Video xmodule tests in mongo.""" import ddt import json from collections import OrderedDict from path import Path as path from lxml import etree from mock import patch, MagicMock, Mock from nose.plugins.attrib import attr from django.conf import settings from django.test import TestCase fr...
robertdenton/twitter-list-to-csv
refs/heads/master
example-config.py
1
# Get your credentials at https://apps.twitter.com/ consumer_key = 'asdf' consumer_secret = 'asdf' access_token = 'asdf' access_token_secret = 'asdf'
chainer/chainer
refs/heads/master
chainer/functions/normalization/__init__.py
12133432
heisencoder/route-finder
refs/heads/master
third_party/lib/python/django/core/checks/compatibility/__init__.py
12133432
reddymeghraj/showroom
refs/heads/master
erpnext/stock/doctype/price_list/test_price_list.py
121
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals import frappe # test_ignore = ["Item"] test_records = frappe.get_test_records('Price List')
guard163/tarantool
refs/heads/master
doc/www/pelicanconf.py
8
#!/usr/bin/env python # -*- coding: utf-8 -*- # from __future__ import unicode_literals import re import urlparse AUTHOR = u'Tarantool' SITENAME = u'Tarantool - a NoSQL database running in a Lua application server' SITEURL = 'http://tarantool.org' PATH = 'content' THEME = "theme" TIMEZONE = 'Europe/Moscow' DEFAULT_L...
bd339/servo
refs/heads/master
tests/wpt/web-platform-tests/websockets/handlers/empty-message_wsh.py
284
#!/usr/bin/python from mod_pywebsocket import msgutil def web_socket_do_extra_handshake(request): pass # Always accept. def web_socket_transfer_data(request): line = msgutil.receive_message(request) if line == "": msgutil.send_message(request, 'pass') else: msgutil.send_message(reque...
microelly2/cadquery-freecad-module
refs/heads/master
CadQuery/Libs/docutils/examples.py
180
# $Id: examples.py 7320 2012-01-19 22:33:02Z milde $ # Author: David Goodger <goodger@python.org> # Copyright: This module has been placed in the public domain. """ This module contains practical examples of Docutils client code. Importing this module from client code is not recommended; its contents are subject to c...
kisel/trex-core
refs/heads/master
scripts/external_libs/scapy-2.3.1/python3/scapy/layers/x509.py
22
## This file is part of Scapy ## See http://www.secdev.org/projects/scapy for more informations ## Copyright (C) Philippe Biondi <phil@secdev.org> ## This program is published under a GPLv2 license """ X.509 certificates. """ from scapy.asn1packet import * from scapy.asn1fields import * ########## ## X509 ## #######...
tntnatbry/tensorflow
refs/heads/master
tensorflow/python/kernel_tests/pooling_ops_3d_test.py
29
# 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...
spblightadv/rethinkdb
refs/heads/next
external/v8_3.30.33.16/build/gyp/test/mac/gyptest-postbuild-static-library.py
349
#!/usr/bin/env python # 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. """ Verifies that a postbuilds on static libraries work, and that sourceless libraries don't cause failures at gyp time. """ import TestGyp...
mikelambert/urllib3
refs/heads/master
urllib3/__init__.py
2
""" urllib3 - Thread-safe connection pooling and re-using. """ from __future__ import absolute_import import warnings from .connectionpool import ( HTTPConnectionPool, HTTPSConnectionPool, connection_from_url ) from . import exceptions from .filepost import encode_multipart_formdata from .poolmanager impo...
talon-one/talon_one.py
refs/heads/master
test/test_error_source.py
1
# coding: utf-8 """ Talon.One API The Talon.One API is used to manage applications and campaigns, as well as to integrate with your application. The operations in the _Integration API_ section are used to integrate with our platform, while the other operations are used to manage applications and campaigns. #...
mbad/kitabu
refs/heads/master
kitabu/migrations/__init__.py
12133432
go-bears/rally
refs/heads/master
tests/unit/plugins/openstack/scenarios/sahara/__init__.py
12133432
rodrigob/keras
refs/heads/master
tests/__init__.py
12133432
petteyg/intellij-community
refs/heads/master
python/testData/refactoring/move/relativeImportSourceWithSpacesInsideMovedModule/before/src/pkg/subpkg1/__init__.py
12133432
mudbungie/NetExplorer
refs/heads/master
env/lib/python3.4/site-packages/networkx/algorithms/components/weakly_connected.py
42
# -*- coding: utf-8 -*- """Weakly connected components. """ # Copyright (C) 2004-2015 by # Aric Hagberg <hagberg@lanl.gov> # Dan Schult <dschult@colgate.edu> # Pieter Swart <swart@lanl.gov> # All rights reserved. # BSD license. import networkx as nx from networkx.utils.decorators import not_implement...
LilithWittmann/froide
refs/heads/master
froide/publicbody/south_migrations/0007_auto__del_field_publicbody_topic_slug.py
6
# encoding: utf-8 import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models from froide.helper.auth_migration_util import USER_DB_NAME APP_MODEL, APP_MODEL_NAME = 'account.User', 'account.user' class Migration(SchemaMigration): def forwards(self, orm): ...
zimmermegan/MARDA
refs/heads/master
nltk-3.0.3/nltk/corpus/reader/nombank.py
10
# Natural Language Toolkit: NomBank Corpus Reader # # Copyright (C) 2001-2015 NLTK Project # Authors: Paul Bedaride <paul.bedaride@gmail.com> # Edward Loper <edloper@gmail.com> # URL: <http://nltk.org/> # For license information, see LICENSE.TXT from __future__ import unicode_literals from nltk.tree import T...
KDB2/OpenReliability
refs/heads/master
veusz/widgets/colorbar.py
4
# Copyright (C) 2007 Jeremy S. Sanders # Email: Jeremy Sanders <jeremy@jeremysanders.net> # # 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 # ...
allotria/intellij-community
refs/heads/master
python/testData/types/ImportDecoratedFunctionType/a.py
27
from ext import func value = func("sd") dec_func = func
admcrae/tensorflow
refs/heads/master
tensorflow/python/framework/contrib_test.py
38
# 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...
wenkaiqiu/petal
refs/heads/master
uniform_model/devices/device_group.py
2
import logging logging.basicConfig(format='%(asctime)s <%(name)s> %(message)s') logger = logging.getLogger('uniform_model.devices.group') logger.setLevel(logging.DEBUG) class DeviceGroup: def __init__(self, *args): logger.info(f"group devices: {args}") self.group = list(args) def __str__(sel...
ericfc/django
refs/heads/master
tests/invalid_models_tests/test_backend_specific.py
121
# -*- encoding: utf-8 -*- from __future__ import unicode_literals from types import MethodType from django.core.checks import Error from django.db import connection, models from .base import IsolatedModelsTestCase class BackendSpecificChecksTests(IsolatedModelsTestCase): def test_check_field(self): ""...
Jumpscale/jumpscale6_core
refs/heads/master
apps/gridportal/base/Grid/.macros/wiki/vdisks/1_vdisks.py
1
def main(j, args, params, tags, tasklet): params.merge(args) doc = params.doc actor = j.apps.actorsloader.getActor("system", "gridmanager") machineid = args.getTag('machineid') out = [] #this makes sure bootstrap datatables functionality is used out.append("{{datatables_use}}}}\n") ...
mancoast/CPythonPyc_test
refs/heads/master
cpython/275_test_exception_variations.py
214
from test.test_support import run_unittest import unittest class ExceptionTestCase(unittest.TestCase): def test_try_except_else_finally(self): hit_except = False hit_else = False hit_finally = False try: raise Exception, 'nyaa!' except: hit_except =...
osvalr/odoo
refs/heads/8.0
openerp/addons/test_impex/tests/test_export.py
211
# -*- coding: utf-8 -*- import itertools import openerp.modules.registry import openerp from openerp.tests import common class CreatorCase(common.TransactionCase): model_name = False def __init__(self, *args, **kwargs): super(CreatorCase, self).__init__(*args, **kwargs) self.model = None ...
perfidia/afefuc
refs/heads/master
src/gui/MainWindowWrapper.py
2
''' Created on Apr 25, 2013 @author: Bartosz Alchimowicz ''' import os from PyQt4 import QtCore, QtGui from generated.ui.MainWindow import Ui_MainWindow from gui.ActorsTabWrapper import ActorsTabWrapper from gui.PropertiesTabWrapper import PropertiesTabWrapper from gui.UseCasesTabWrapper import UseCasesTabWrapper fr...
tinloaf/home-assistant
refs/heads/dev
homeassistant/components/weblink.py
9
""" Support for links to external web pages. For more details about this component, please refer to the documentation at https://home-assistant.io/components/weblink/ """ import logging import voluptuous as vol from homeassistant.const import (CONF_NAME, CONF_ICON, CONF_URL) from homeassistant.helpers.entity import ...
DiptoDas8/Biponi
refs/heads/master
lib/python2.7/site-packages/setuptools/site-patch.py
720
def __boot(): import sys import os PYTHONPATH = os.environ.get('PYTHONPATH') if PYTHONPATH is None or (sys.platform=='win32' and not PYTHONPATH): PYTHONPATH = [] else: PYTHONPATH = PYTHONPATH.split(os.pathsep) pic = getattr(sys,'path_importer_cache',{}) stdpath = sys.path[le...
LiveZenLK/CeygateERP
refs/heads/master
addons/mail/controllers/bus.py
4
# -*- coding: utf-8 -* import base64 import openerp from openerp import SUPERUSER_ID from openerp.http import request class MailChatController(openerp.addons.bus.controllers.main.BusController): def _default_request_uid(self): """ For Anonymous people, they receive the access right of SUPERUSER_ID since...
rnixx/python-for-android
refs/heads/master
tests/test_androidmodule_ctypes_finder.py
4
# This test is still expected to support Python 2, as it tests # on-Android functionality that we still maintain try: # Python 3+ from unittest import mock from unittest.mock import MagicMock except ImportError: # Python 2 import mock from mock import MagicMock import os import shutil import sys impo...
mlperf/training_results_v0.6
refs/heads/master
Google/benchmarks/gnmt/implementations/tpu-v3-512-gnmt/nmt/estimator.py
5
# Copyright 2018 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 a...
TRUFIL/erpnext
refs/heads/develop
erpnext/buying/doctype/request_for_quotation/test_request_for_quotation.py
13
# -*- coding: utf-8 -*- # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # See license.txt from __future__ import unicode_literals import unittest import frappe from erpnext.templates.pages.rfq import check_supplier_has_docname_access from frappe.utils import nowdate class TestRequestforQuotation...
tkovalsky/folio
refs/heads/master
folio/users/views.py
95
# -*- coding: utf-8 -*- from __future__ import absolute_import, unicode_literals from django.core.urlresolvers import reverse from django.views.generic import DetailView, ListView, RedirectView, UpdateView from django.contrib.auth.mixins import LoginRequiredMixin from .models import User class UserDetailView(Login...
pilou-/ansible-modules-core
refs/heads/devel
cloud/google/gc_storage.py
21
#!/usr/bin/python # 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 distributed...
mdanielwork/intellij-community
refs/heads/master
python/testData/testRunner/env/nose/test_with_slow/test_with_slow.py
30
from nose.plugins.attrib import attr def test_fast(): pass @attr('slow') def test_Slow(): pass
akhilaananthram/nupic
refs/heads/master
examples/opf/experiments/anomaly/spatial/2field_few_skewed/description.py
160
# ---------------------------------------------------------------------- # Numenta Platform for Intelligent Computing (NuPIC) # Copyright (C) 2013, Numenta, Inc. Unless you have an agreement # with Numenta, Inc., for a separate license for this software code, the # following terms and conditions apply: # # This progra...
MartinDelzant/scikit-learn
refs/heads/master
sklearn/utils/sparsetools/_graph_validation.py
364
from __future__ import division, print_function, absolute_import import numpy as np from scipy.sparse import csr_matrix, isspmatrix, isspmatrix_csc from ._graph_tools import csgraph_to_dense, csgraph_from_dense,\ csgraph_masked_from_dense, csgraph_from_masked DTYPE = np.float64 def validate_graph(csgraph, direc...
mbox/django
refs/heads/master
django/contrib/staticfiles/utils.py
114
import os import fnmatch from django.conf import settings from django.core.exceptions import ImproperlyConfigured def matches_patterns(path, patterns=None): """ Return True or False depending on whether the ``path`` should be ignored (if it matches any pattern in ``ignore_patterns``). """ if patte...
cbitstech/Purple-Robot-Django
refs/heads/master
migrations/0034_auto__add_purplerobotdevicenote.py
1
# -*- coding: utf-8 -*- from south.utils import datetime_utils as datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding model 'PurpleRobotDeviceNote' db.create_table(u'purple_robot_app...
paplorinc/intellij-community
refs/heads/master
python/testData/refactoring/makeFunctionTopLevel/methodSelfUsedAsOperand.py
44
class C(int): def me<caret>thod(self): print(self + 42)
grpc/grpc
refs/heads/master
bazel/test/python_test_repo/helloworld.py
13
# Copyright 2019 the gRPC authors. # # 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 wri...
paulot/NodeVector
refs/heads/master
node-0.12.0/deps/v8/tools/testrunner/__init__.py
651
# Copyright 2012 the V8 project authors. 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 conditi...
ryfeus/lambda-packs
refs/heads/master
LightGBM_sklearn_scipy_numpy/source/numpy/core/_internal.py
9
""" A place for code to be called from core C-code. Some things are more easily handled Python. """ from __future__ import division, absolute_import, print_function import re import sys from numpy.compat import basestring from .multiarray import dtype, array, ndarray try: import ctypes except ImportError: c...
Code4SA/mma-dexter
refs/heads/master
dexter/analysis/utils.py
1
from __future__ import division from collections import defaultdict import logging import math logger = logging.getLogger(__name__) def calculate_entropy(table): """ Calculate entropy across +table+, which is a map representing a table: the keys are the columns and the values are dicts whose keys in turn...
hitmoon/MyRop
refs/heads/master
gadget.py
1
import re from capstone import * import sys gadget_arm = [ [b"[\x30-\x3f]\xff\x2f\xe1", 4, 4], # blx, arm mode [b"[\x10-\x1f]\xff\x2f\xe1", 4, 4], # bx, arm mode [b"[\x00-\xff]\x80\xbd\xe8", 4, 4], # pop {,pc}, arm mode [b"[\x00-\xff]\x00\x00\xef", 4, 4], # swi, arm mode ] gadget_thumb = [ [b"[\x8...
waveform80/dbsuite
refs/heads/master
dbsuite/main/__init__.py
1
# vim: set et sw=4 sts=4: # Copyright 2012 Dave Hughes. # # This file is part of dbsuite. # # dbsuite 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 l...
jacksonokuhn/dataverse
refs/heads/develop
tests/test_create_test_account.py
18
from selenium import webdriver import time, unittest, config def is_alert_present(wd): try: wd.switch_to_alert().text return True except: return False class test_create_test_account(unittest.TestCase): def setUp(self): if (config.local): self.wd = webdriver.Fire...
linlife/Zabbix
refs/heads/master
alert_by_email/zabbix_sendmail.py
1
#!/usr/bin/python #coding:utf-8 import smtplib from email.mime.text import MIMEText import os import argparse import logging import datetime mail_host = 'smtp.qq.com' mail_user = '' mail_pass = '' mail_postfix = 'qq.com' def send_mail(mail_to,subject,content): me = mail_user+"<"+mail_user+"@"+mail_po...
sciCloud/OLiMS
refs/heads/master
lims/browser/header_table.py
2
"""ARs and Samples use HeaderTable to display object fields in their custom view and edit screens. """ from dependencies.dependency import getToolByName from lims.browser import BrowserView from lims.interfaces import IHeaderTableFieldRenderer from dependencies.dependency import ViewPageTemplateFile from dependencies....
ccellis/WHACK2016
refs/heads/master
flask/lib/python2.7/site-packages/sqlalchemy/ext/declarative/api.py
34
# ext/declarative/api.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 """Public API functions and helpers for declarative.""" from ...schema impor...
ealegol/kolla-newton
refs/heads/master
kolla/cmd/genpwd.py
2
#!/usr/bin/env python # 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...
1suming/readthedocs.org
refs/heads/master
readthedocs/projects/migrations/0018_add_doctypes.py
16
# 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 'Project.documentation_type' db.add_column('projects_project', 'documentation_type', self.g...
axbaretto/beam
refs/heads/master
sdks/python/.tox/docs/lib/python2.7/site-packages/hamcrest/library/number/ordering_comparison.py
6
from hamcrest.core.base_matcher import BaseMatcher import operator __author__ = "Jon Reid" __copyright__ = "Copyright 2011 hamcrest.org" __license__ = "BSD, see License.txt" class OrderingComparison(BaseMatcher): def __init__(self, value, comparison_function, comparison_description): self.value = value ...
DavidCain/WinterSchool
refs/heads/master
ws/migrations/0001_initial.py
1
# -*- coding: utf-8 -*- # Generated by Django 1.10.8 on 2018-02-26 23:54 from __future__ import unicode_literals import django.core.validators import django.db.models.deletion import django.utils.timezone import localflavor.us.models import phonenumber_field.modelfields from django.db import migrations, models import...
innerr/stars
refs/heads/master
_libs/flup/client/scgi_app.py
1
# Copyright (c) 2006 Allan Saddi <allan@saddi.com> # 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 list of c...
justathoughtor2/atomicApe
refs/heads/encaged
cygwin/lib/python2.7/site-packages/astroid/tests/testdata/python2/data/absimp/string.py
34
from __future__ import absolute_import, print_function import string print(string)
jannon/slumber
refs/heads/master
slumber/utils.py
10
import posixpath try: from urllib.parse import urlsplit, urlunsplit except ImportError: from urlparse import urlsplit, urlunsplit def url_join(base, *args): """ Helper function to join an arbitrary number of url segments together. """ scheme, netloc, path, query, fragment = urlsplit(base) ...
ryfx/gyp
refs/heads/master
test/sibling/gyptest-all.py
100
#!/usr/bin/env python # 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 TestGyp test = TestGyp.TestGyp() # The xcode-ninja generator handles gypfiles which are not at the # project root incorrectly. # cf...
CraigLoomis/ics_hxActor
refs/heads/master
python/hxActor/main.py
1
#!/usr/bin/env python import logging import actorcore.ICC try: from pfscore import spectroIds instrument = "PFS" except ImportError: instrument = "CHARIS" class OurActor(actorcore.ICC.ICC): def __init__(self, name, productName=None, camName=None, im...
Amber-Creative/amber-frappe
refs/heads/master
frappe/model/docfield.py
61
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # MIT License. See license.txt from __future__ import unicode_literals """docfield utililtes""" import frappe def rename(doctype, fieldname, newname): """rename docfield""" df = frappe.db.sql("""select * from tabDocField where parent=%s and field...
devsim/devsim
refs/heads/main
examples/diode/diode_1d.py
1
# Copyright 2013 Devsim 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 agreed to in writing, s...
DelazJ/QGIS
refs/heads/master
tests/src/python/test_qgsaggregatemappingwidget.py
18
# -*- coding: utf-8 -*- """QGIS Unit tests for QgsAggregateMapping widget and model. From build dir, run: ctest -R PyQgsAggregateMappingWidget -V .. 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 Founda...
omarkohl/pytest
refs/heads/master
doc/en/example/assertion/failure_demo.py
179
from pytest import raises import _pytest._code import py def otherfunc(a,b): assert a==b def somefunc(x,y): otherfunc(x,y) def otherfunc_multi(a,b): assert (a == b) def test_generative(param1, param2): assert param1 * 2 < param2 def pytest_generate_tests(metafunc): if 'param1' in me...
jmesteve/openerp
refs/heads/master
openerp/addons/account/account_invoice.py
1
# -*- 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...
vdmann/cse-360-image-hosting-website
refs/heads/master
lib/python2.7/site-packages/django/utils/timezone.py
16
""" Timezone-related classes and functions. This module uses pytz when it's available and fallbacks when it isn't. """ from datetime import datetime, timedelta, tzinfo from threading import local import sys import time as _time try: import pytz except ImportError: pytz = None from django.conf import setting...
hannespetur/SeqAnHTS
refs/heads/master
util/py_lib/seqan/__init__.py
12133432
boblefrag/python-rest-api-framework
refs/heads/master
tests/controllers_test.py
1
from unittest import TestCase import json import time from werkzeug.wrappers import BaseResponse from werkzeug.test import Client from app import ApiApp from rest_api_framework.authentication import ApiKeyAuthentication from rest_api_framework.datastore import PythonListDataStore from rest_api_framework import models...
isaacl/meliae
refs/heads/master
remove_expensive_references.py
3
#!/usr/bin/env python # Copyright (C) 2009 Canonical Ltd # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License version 3 as # published by the Free Software Foundation. # # This program is distributed in the hope that it will be useful, but # W...
aflaxman/mpld3
refs/heads/master
mpld3/test_plots/test_patches.py
19
"""Plot to test patches""" import matplotlib.pyplot as plt from matplotlib import patches import numpy as np import mpld3 def create_plot(): fig, ax = plt.subplots() ax.grid(color='lightgray') rcolor = lambda: np.random.random(3) p = [patches.Arrow(0.75, 0.75, 0.5, 0.5), patches.Circle((1, ...
adykstra/mne-python
refs/heads/master
mne/viz/backends/_pysurfer_mayavi.py
1
""" Core visualization operations based on Mayavi. Actual implementation of _Renderer and _Projection classes. """ # Authors: Alexandre Gramfort <alexandre.gramfort@telecom-paristech.fr> # Denis Engemann <denis.engemann@gmail.com> # Martin Luessi <mluessi@nmr.mgh.harvard.edu> # Eric Larson ...
naomidb/polyjuice
refs/heads/master
setup.py
1
from setuptools import setup, find_packages setup(name='polyjuice', version='0.1.0', description='Anonymize dicom files.', url='https://github.com/ctsit/polyjuice', author='Naomi Braun and Ajantha Ramineni', author_email='naomi.d.braun@gmail.com, ajantha.5779@gmail.com', license='Apache 2.0', ...
andredias/nikola
refs/heads/master
nikola/image_processing.py
4
# -*- coding: utf-8 -*- # Copyright © 2014 Roberto Alsina and others. # Permission is hereby granted, free of charge, to any # person obtaining a copy of this software and associated # documentation files (the "Software"), to deal in the # Software without restriction, including without limitation # the rights to use...
dhruvagarwal/django
refs/heads/master
django/db/migrations/operations/__init__.py
394
from .fields import AddField, AlterField, RemoveField, RenameField from .models import ( AlterIndexTogether, AlterModelManagers, AlterModelOptions, AlterModelTable, AlterOrderWithRespectTo, AlterUniqueTogether, CreateModel, DeleteModel, RenameModel, ) from .special import RunPython, RunSQL, SeparateDatabase...
adviti/melange
refs/heads/master
app/atom/core.py
80
#!/usr/bin/env python # # Copyright (C) 2008 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...
citrix-openstack-build/neutron
refs/heads/master
neutron/tests/unit/test_attributes.py
2
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2012 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.apach...
Zlash65/erpnext
refs/heads/develop
erpnext/manufacturing/notification/material_request_receipt_notification/__init__.py
12133432
devs1991/test_edx_docmode
refs/heads/master
venv/lib/python2.7/site-packages/django/conf/app_template/__init__.py
12133432
Shrhawk/edx-platform
refs/heads/master
lms/lib/xblock/test/__init__.py
12133432
zhanghenry/stocks
refs/heads/master
django/conf/locale/et/__init__.py
12133432
40223220/2015_cdb_g7_40223220
refs/heads/master
static/Brython3.1.1-20150328-091302/Lib/fnmatch.py
894
"""Filename matching with shell patterns. fnmatch(FILENAME, PATTERN) matches according to the local convention. fnmatchcase(FILENAME, PATTERN) always takes case in account. The functions operate by translating the pattern into a regular expression. They cache the compiled regular expressions for speed. The function...
saisankargochhayat/algo_quest
refs/heads/master
leetcode/kth-largest-element-in-an-array/kth_largest.py
1
# Problem link - https://leetcode.com/problems/kth-largest-element-in-an-array/ class Heap: def __init__(self,A): self.A = A self.heapSize = len(self.A) # This method maintains the max heap property. def max_heapify(self, i): largest = i left = 2*i + 1 right = 2*i + 2...
RydrDojo/Ridr_app
refs/heads/master
pylotVenv/lib/python2.7/site-packages/setuptools/depends.py
114
import sys import imp import marshal from imp import PKG_DIRECTORY, PY_COMPILED, PY_SOURCE, PY_FROZEN from distutils.version import StrictVersion from setuptools.extern import six __all__ = [ 'Require', 'find_module', 'get_module_constant', 'extract_constant' ] class Require: """A prerequisite to building or...
huaweiswitch/neutron
refs/heads/master
neutron/plugins/nec/common/ofc_client.py
7
# Copyright 2012 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 ...
gregpechiro/dndtools
refs/heads/master
dndtools/dnd/migrations/0065_auto__add_field_characterclassvariant_required_bab.py
1
# 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 'CharacterClassVariant.required_bab' db.add_column('dnd_characterclassvariant', 'required_b...
evanma92/routeh
refs/heads/master
flask/lib/python2.7/site-packages/flask_social/views.py
2
# -*- coding: utf-8 -*- """ flask.ext.social.views ~~~~~~~~~~~~~~~~~~~~~~ This module contains the Flask-Social views :copyright: (c) 2012 by Matt Wright. :license: MIT, see LICENSE for more details. """ from importlib import import_module from flask import Blueprint, current_app, redirect, reque...
ShineFan/odoo
refs/heads/8.0
openerp/addons/base/res/res_currency.py
96
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU...
miyataken999/weblate
refs/heads/master
weblate/trans/management/commands/lock_translation.py
2
# -*- coding: utf-8 -*- # # Copyright © 2012 - 2015 Michal Čihař <michal@cihar.com> # # This file is part of Weblate <https://weblate.org/> # # 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, eith...
blankenberg/bioconda-recipes
refs/heads/master
recipes/varscan/2.3.7/varscan.py
62
#!/usr/bin/env python # # Wrapper script for invoking the VarScan JAR package. # # This script is written for use with the Conda package manager and is ported # from a bash script that does the same thing, adapting the style in # the peptide-shaker wrapper # (https://github.com/bioconda/bioconda-recipes/blob/master/rec...