repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
hugobuddel/orange3 | refs/heads/master | Orange/widgets/unsupervised/owcorrespondence.py | 1 | import sys
import numpy
from PyQt4.QtGui import (
QListView, QItemSelectionModel, QItemSelection, QBrush, QColor, QPainter,
QApplication
)
from PyQt4.QtCore import Qt, QEvent
import pyqtgraph as pg
import Orange.data
from Orange.statistics import contingency
from Orange.widgets import widget, gui, settings
... |
NMGRL/pychron | refs/heads/develop | docs/user_guide/operation/scripts/examples/argus/measurement/jan_ic_peak_hop3.py | 2 | #!Measurement
'''
'''
#counts
#baselines
BASELINE_COUNTS= 75
BASELINE_DETECTOR= 'H1'
BASELINE_MASS= 34.2
BASELINE_BEFORE= False
BASELINE_AFTER= True
BASELINE_SETTLING_TIME= 15
#equilibration
EQ_TIME= eqtime
INLET= 'R'
OUTLET= 'O'
EQ_DELAY= 3.0
ACTIVE_DETECTORS = ('H1','AX','L2')
FITS = ('Ar40H1:parabolic','Ar40AX:pa... |
oceanobservatories/mi-instrument | refs/heads/master | mi/dataset/driver/ctdbp_cdef/dcl/ctdbp_cdef_dcl_recovered_driver.py | 7 | #!/usr/bin/env python
"""
@package mi.dataset.driver.ctdbp_cdef.dcl
@file mi-dataset/mi/dataset/driver/ctdbp_cdef/dcl/ctdbp_cdef_dcl_recovered_driver.py
@author Jeff Roy
@brief Driver for the ctdbp_cdef_dcl instrument (Recovered Data)
Release notes:
Initial Release
"""
from mi.dataset.dataset_driver import SimpleDa... |
faisalp4p/slang-python | refs/heads/master | step4/ExpressionBuilder.py | 4 |
from RDParser import RDParser
class ExpressionBuilder:
@classmethod
def __init__(self, expr):
self. _expr_string = expr
@classmethod
def GetExpression(self):
p = RDParser(self._expr_string)
return p.CallExpr()
if __name__ == "__main__":
exp_string = "2+4"
ex... |
Magicked/crits | refs/heads/master | crits/vocabulary/ips.py | 1 | from crits.vocabulary.vocab import vocab
class IPTypes(vocab):
"""
Vocabulary for IP Types.
"""
IPV4_ADDRESS = "Address - ipv4-addr"
IPV4_SUBNET = "Address - ipv4-net"
IPV6_ADDRESS = "IPv6 Address"
IPV6_SUBNET = "IPv6 Subnet"
|
appapantula/scikit-learn | refs/heads/master | examples/cluster/plot_birch_vs_minibatchkmeans.py | 333 | """
=================================
Compare BIRCH and MiniBatchKMeans
=================================
This example compares the timing of Birch (with and without the global
clustering step) and MiniBatchKMeans on a synthetic dataset having
100,000 samples and 2 features generated using make_blobs.
If ``n_clusters... |
ProjectSWGCore/NGECore2 | refs/heads/master | scripts/object/tangible/loot/mustafar/cube_loot/cube_loot_3k.py | 85615 | import sys
def setup(core, object):
return |
elkingtowa/pyrake | refs/heads/master | build/lib/pyrake/mail.py | 2 | """
Mail sending helpers
See documentation in docs/topics/email.rst
"""
from six.moves import cStringIO as StringIO
import six
from email.utils import COMMASPACE, formatdate
from six.moves.email_mime_multipart import MIMEMultipart
from six.moves.email_mime_text import MIMEText
from six.moves.email_mime_base import MI... |
QISKit/qiskit-sdk-py | refs/heads/master | qiskit/transpiler/models.py | 1 | # -*- coding: utf-8 -*-
# This code is part of Qiskit.
#
# (C) Copyright IBM 2017, 2019.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
#
# Any... |
rooi/CouchPotatoServer | refs/heads/master | libs/pynma/pynma.py | 73 | #!/usr/bin/python
from xml.dom.minidom import parseString
from httplib import HTTPSConnection
from urllib import urlencode
__version__ = "0.1"
API_SERVER = 'nma.usk.bz'
ADD_PATH = '/publicapi/notify'
USER_AGENT="PyNMA/v%s"%__version__
def uniq_preserve(seq): # Dave Kirby
# Order preserving
seen = set()
... |
gurneyalex/OpenUpgrade | refs/heads/master | addons/auth_openid/res_users.py | 44 | ##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2010-2012 OpenERP s.a. (<http://openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General P... |
home-assistant/home-assistant | refs/heads/dev | homeassistant/components/netgear_lte/__init__.py | 16 | """Support for Netgear LTE modems."""
import asyncio
from datetime import timedelta
import logging
import aiohttp
import attr
import eternalegypt
import voluptuous as vol
from homeassistant.components.binary_sensor import DOMAIN as BINARY_SENSOR_DOMAIN
from homeassistant.components.notify import DOMAIN as NOTIFY_DOMA... |
googlefonts/pyfontaine | refs/heads/main | fontaine/charsets/noto_glyphs/notosansoldturkic_regular.py | 2 | # -*- coding: utf-8 -*-
class Charset(object):
common_name = 'NotoSansOldTurkic-Regular'
native_name = ''
def glyphs(self):
glyphs = []
glyphs.append(0x0039) #glyph00057
glyphs.append(0x0038) #glyph00056
glyphs.append(0x0013) #glyph00019
glyphs.append(0x0012) #... |
jeremycline/fmn | refs/heads/develop | alembic/versions/59ee93c4bf71_add_the_oneshot_column.py | 3 | """Add the oneshot column.
Revision ID: 59ee93c4bf71
Revises: 3de9ad66862f
Create Date: 2015-03-20 13:38:03.081566
"""
# revision identifiers, used by Alembic.
revision = '59ee93c4bf71'
down_revision = '3de9ad66862f'
from alembic import op
import sqlalchemy as sa
def upgrade():
op.add_column('filters', sa.Col... |
wisniew/Harfix2_kernel_I9300 | refs/heads/cm-13.0 | tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/Core.py | 11088 | # Core.py - Python extension for perf script, core functions
#
# Copyright (C) 2010 by Tom Zanussi <tzanussi@gmail.com>
#
# This software may be distributed under the terms of the GNU General
# Public License ("GPL") version 2 as published by the Free Software
# Foundation.
from collections import defaultdict
def aut... |
flaminscotsman/TwistedLilypad | refs/heads/master | twistedlilypad/requests/notify_player_request.py | 1 | from struct import unpack_from, calcsize
from twistedlilypad.requests.abstract_request import AbstractRequest, AbstractRequestCodec
from twistedlilypad.utilities import boolean_encoder, varint_prefixed_string_encoder, varint_prefixed_string_parser
class RequestNotifyPlayer(AbstractRequest):
opcode = 0x21
de... |
skuda/client-python | refs/heads/master | kubernetes/test/test_v1beta1_stateful_set_list.py | 1 | # coding: utf-8
"""
Kubernetes
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
OpenAPI spec version: v1.6.1
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from __future__ import absolute_import
import os
import sys
im... |
tbeckham/eutester | refs/heads/master | eutester/eusnapshot.py | 5 | # Software License Agreement (BSD License)
#
# Copyright (c) 2009-2011, Eucalyptus Systems, Inc.
# All rights reserved.
#
# Redistribution and use of this software in source and binary forms, with or
# without modification, are permitted provided that the following conditions
# are met:
#
# Redistributions of source ... |
QEF/q-e_schrodinger | refs/heads/master | test-suite/epw_mob/pp.py | 1 | #
# Post-processing script QE --> EPW
# 14/07/2015 - Samuel Ponce
#
import numpy as np
import os
# Enter the number of irr. q-points
user_input = raw_input('Enter the prefix used for PH calculations (e.g. diam)\n')
prefix = str(user_input)
# Enter the number of irr. q-points
user_input = raw_input('Enter the numb... |
danielfrg/jupyterhub-kubernetes_spawner | refs/heads/master | kubernetes_spawner/swagger_client/models/v1_node_address.py | 1 | # coding: utf-8
"""
Copyright 2015 SmartBear Software
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... |
saurabh6790/omnitech-apps | refs/heads/master | hr/doctype/holiday/__init__.py | 37694 | from __future__ import unicode_literals
|
coderfi/ansible-modules-extras | refs/heads/devel | monitoring/bigpanda.py | 36 | #!/usr/bin/python
DOCUMENTATION = '''
---
module: bigpanda
author: BigPanda
short_description: Notify BigPanda about deployments
version_added: "1.8"
description:
- Notify BigPanda when deployments start and end (successfully or not). Returns a deployment object containing all the parameters for future module call... |
cboling/SDNdbg | refs/heads/master | docs/old-stuff/pydzcvr/doc/neutron/api/rpc/handlers/dhcp_rpc.py | 5 | # Copyright (c) 2012 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 law or agreed to... |
wohlgejm/accountable | refs/heads/master | tests/conftest.py | 1 | from __future__ import absolute_import
import json
import pytest
import requests
from doubles import allow
from tests import fixtures
class MockResponse(object):
def __init__(self, status_code, data):
self.status_code = status_code
self.data = data
def json(self):
return json.loads... |
ric2b/Vivaldi-browser | refs/heads/master | chromium/third_party/mako/examples/bench/basic.py | 58 | # basic.py - basic benchmarks adapted from Genshi
# Copyright (C) 2006 Edgewall Software
# 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 ... |
andela-bojengwa/talk | refs/heads/master | venv/lib/python2.7/site-packages/django/core/management/commands/squashmigrations.py | 34 | import sys
from optparse import make_option
from django.core.management.base import BaseCommand, CommandError
from django.utils import six
from django.conf import settings
from django.db import connections, DEFAULT_DB_ALIAS, migrations
from django.db.migrations.loader import AmbiguityError
from django.db.migrations.ex... |
dezynetechnologies/odoo | refs/heads/8.0 | addons/website_hr_recruitment/controllers/main.py | 170 | # -*- coding: utf-8 -*-
import base64
from openerp import SUPERUSER_ID
from openerp import http
from openerp.tools.translate import _
from openerp.http import request
from openerp.addons.website.models.website import slug
class website_hr_recruitment(http.Controller):
@http.route([
'/jobs',
'/job... |
hopeall/odoo | refs/heads/8.0 | openerp/service/websrv_lib.py | 380 | # -*- coding: utf-8 -*-
#
# Copyright P. Christeas <p_christ@hol.gr> 2008-2010
#
# WARNING: This program as such is intended to be used by professional
# programmers who take the whole responsibility of assessing all potential
# consequences resulting from its eventual inadequacies and bugs
# End users who are looking ... |
VaibhavAgarwalVA/sympy | refs/heads/master | sympy/functions/special/tests/test_beta_functions.py | 115 | from sympy import (Symbol, gamma, expand_func, beta, digamma, diff)
def test_beta():
x, y = Symbol('x'), Symbol('y')
assert isinstance(beta(x, y), beta)
assert expand_func(beta(x, y)) == gamma(x)*gamma(y)/gamma(x + y)
assert expand_func(beta(x, y) - beta(y, x)) == 0 # Symmetric
assert expand_fu... |
chris-chris/tensorflow | refs/heads/master | tensorflow/contrib/keras/api/keras/preprocessing/__init__.py | 132 | # 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... |
grevian/GraphViz-Site | refs/heads/master | requests/status_codes.py | 695 | # -*- coding: utf-8 -*-
from .structures import LookupDict
_codes = {
# Informational.
100: ('continue',),
101: ('switching_protocols',),
102: ('processing',),
103: ('checkpoint',),
122: ('uri_too_long', 'request_uri_too_long'),
200: ('ok', 'okay', 'all_ok', 'all_okay', 'all_good', '\\o/'... |
songfj/calibre | refs/heads/master | src/calibre/gui2/actions/show_template_tester.py | 11 | #!/usr/bin/env python2
# vim:fileencoding=UTF-8:ts=4:sw=4:sta:et:sts=4:ai
__license__ = 'GPL v3'
__copyright__ = '2010, Kovid Goyal <kovid@kovidgoyal.net>'
__docformat__ = 'restructuredtext en'
from calibre.gui2.actions import InterfaceAction
from calibre.gui2.dialogs.template_dialog import TemplateDialog
from cal... |
coinkeeper/2015-04-19_21-21_mozzshare | refs/heads/master | contrib/qt_translations.py | 4110 | #!/usr/bin/env python
# Helpful little script that spits out a comma-separated list of
# language codes for Qt icons that should be included
# in binary bitcoin distributions
import glob
import os
import re
import sys
if len(sys.argv) != 3:
sys.exit("Usage: %s $QTDIR/translations $BITCOINDIR/src/qt/locale"%sys.arg... |
cmdunkers/DeeperMind | refs/heads/master | PythonEnv/lib/python2.7/site-packages/numpy/f2py/common_rules.py | 176 | #!/usr/bin/env python
"""
Build common block mechanism for f2py2e.
Copyright 2000 Pearu Peterson all rights reserved,
Pearu Peterson <pearu@ioc.ee>
Permission to use, modify, and distribute this software is given under the
terms of the NumPy License
NO WARRANTY IS EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK.
$Date: ... |
CraigHarris/gpdb | refs/heads/master | src/test/tinc/tincrepo/mpp/gpdb/tests/storage/filerep/mpp19612/test_mpp19612.py | 9 | """
Copyright (C) 2004-2015 Pivotal Software, Inc. All rights reserved.
This program and the accompanying materials are made available under
the terms of the 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
... |
shaulkf/bitcoin | refs/heads/master | share/qt/extract_strings_qt.py | 321 | #!/usr/bin/python
'''
Extract _("...") strings for translation and convert to Qt4 stringdefs so that
they can be picked up by Qt linguist.
'''
from subprocess import Popen, PIPE
import glob
import operator
import os
import sys
OUT_CPP="qt/bitcoinstrings.cpp"
EMPTY=['""']
def parse_po(text):
"""
Parse 'po' for... |
F30/storm | refs/heads/partitionAggregate-docs | dev-tools/report/formatter.py | 28 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# 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 t... |
DanteOnline/free-art | refs/heads/master | venv/lib/python3.4/site-packages/django/template/backends/dummy.py | 480 | # Since this package contains a "django" module, this is required on Python 2.
from __future__ import absolute_import
import errno
import io
import string
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
from django.template import Origin, TemplateDoesNotExist
from django.utils... |
indictranstech/erpnext | refs/heads/develop | erpnext/stock/__init__.py | 23 | from __future__ import unicode_literals
import frappe
install_docs = [
{"doctype":"Role", "role_name":"Stock Manager", "name":"Stock Manager"},
{"doctype":"Role", "role_name":"Item Manager", "name":"Item Manager"},
{"doctype":"Role", "role_name":"Stock User", "name":"Stock User"},
{"doctype":"Role", "role_name":"Q... |
jhcepas/ete | refs/heads/master | examples/treeview/tree_faces.py | 6 | import random
from ete3 import Tree, TreeStyle, NodeStyle, faces, AttrFace, TreeFace
# Tree Style used to render small trees used as leaf faces
small_ts = TreeStyle()
small_ts.show_leaf_name = True
small_ts.scale = 10
def layout(node):
if node.is_leaf():
# Add node name to laef nodes
N = AttrFace(... |
saradbowman/osf.io | refs/heads/develop | osf/migrations/0095_ensure_licenses.py | 16 | # -*- coding: utf-8 -*-
# Generated by Django 1.11.11 on 2018-04-06 16:52
from __future__ import unicode_literals
import logging
from django.db import migrations
from osf.utils.migrations import ensure_licenses, remove_licenses
logger = logging.getLogger(__file__)
class Migration(migrations.Migration):
depen... |
zearan/icinga2 | refs/heads/master | contrib/discover-api.py | 2 | #!/usr/bin/env python
# Icinga 2
# Copyright (C) 2012-2016 Icinga Development Team (https://www.icinga.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; either version 2
# of the License, ... |
HelloLily/hellolily | refs/heads/develop | lily/notes/models.py | 1 | from django.contrib.contenttypes.models import ContentType
from django.contrib.contenttypes.fields import GenericForeignKey
from django.db import models
from django.utils.translation import ugettext_lazy as _
from lily.tenant.models import TenantMixin
from lily.utils.models.mixins import DeletedMixin
from lily.users.m... |
adfernandes/mbed | refs/heads/master | UNITTESTS/unit_test/new.py | 27 | """
Copyright (c) 2018, Arm Limited
SPDX-License-Identifier: Apache-2.0
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... |
EaseCloud/wechatpy | refs/heads/master | wechatpy/oauth.py | 7 | # -*- coding: utf-8 -*-
"""
wechatpy.oauth
~~~~~~~~~~~~~~~
This module provides OAuth2 library for WeChat
:copyright: (c) 2014 by messense.
:license: MIT, see LICENSE for more details.
"""
from __future__ import absolute_import, unicode_literals
import six
import requests
from wechatpy._compat im... |
wagtail/wagtail | refs/heads/stable/2.13.x | wagtail/core/migrations/0001_squashed_0016_change_page_url_path_to_text_field.py | 24 | # -*- coding: utf-8 -*-
import django.db.models.deletion
from django.conf import settings
from django.db import migrations, models
import wagtail.search.index
def initial_data(apps, schema_editor):
ContentType = apps.get_model('contenttypes.ContentType')
Group = apps.get_model('auth.Group')
Page = apps.g... |
TheTimmy/spack | refs/heads/develop | lib/spack/spack/test/install.py | 2 | ##############################################################################
# Copyright (c) 2013-2017, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
# This file is part of Spack.
# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
# LLNL-CODE-64... |
hashedin/logan-python-client | refs/heads/master | logan/helpers.py | 4 |
""" This file contains some helpers methods in both Python2 and 3 """
import sys
import re
if sys.version < '3':
# Python2.x imports
import Queue
import codecs
else:
# Python 3.x imports
import queue
def check_token(token):
""" Checks if the given token is a valid UUID."""
valid = re.com... |
Amber-Creative/amber-frappe | refs/heads/master | frappe/website/doctype/portal_settings/portal_settings.py | 7 | # -*- coding: utf-8 -*-
# Copyright (c) 2015, Frappe Technologies and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe.model.document import Document
class PortalSettings(Document):
def add_item(self, item):
'''insert new portal menu i... |
dwf/fuel | refs/heads/master | docs/conf.py | 14 | # -*- coding: utf-8 -*-
#
# Fuel documentation build configuration file, created by
# sphinx-quickstart2 on Wed Oct 8 17:59:44 2014.
#
# 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... |
himleyb85/django | refs/heads/master | tests/handlers/views.py | 359 | from __future__ import unicode_literals
from django.core.exceptions import SuspiciousOperation
from django.db import connection, transaction
from django.http import HttpResponse, StreamingHttpResponse
from django.views.decorators.csrf import csrf_exempt
def regular(request):
return HttpResponse(b"regular content... |
dezynetechnologies/odoo | refs/heads/8.0 | addons/edi/models/__init__.py | 442 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Business Applications
# Copyright (c) 2011 OpenERP S.A. <http://openerp.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GN... |
pwong-mapr/private-hue | refs/heads/HUE-1096-abe | desktop/core/ext-py/requests-2.0.0/requests/structures.py | 398 | # -*- coding: utf-8 -*-
"""
requests.structures
~~~~~~~~~~~~~~~~~~~
Data structures that power Requests.
"""
import os
import collections
from itertools import islice
class IteratorProxy(object):
"""docstring for IteratorProxy"""
def __init__(self, i):
self.i = i
# self.i = chain.from_iter... |
thaim/ansible | refs/heads/fix-broken-link | test/units/modules/network/fortios/test_fortios_user_device_group.py | 21 | # 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 License, or
# (at your option) any later version.
#
# This program is distributed in the... |
Peddle/hue | refs/heads/master | desktop/core/ext-py/Django-1.6.10/django/contrib/gis/db/backends/util.py | 119 | """
A collection of utility routines and classes used by the spatial
backends.
"""
class SpatialOperation(object):
"""
Base class for generating spatial SQL.
"""
sql_template = '%(geo_col)s %(operator)s %(geometry)s'
def __init__(self, function='', operator='', result='', **kwargs):
self.f... |
TieSoul/befunge | refs/heads/master | befunge-exec.py | 1 | from random import choice # Used for ? instruction
from time import sleep # Used for Visual mode
import getopt # Used in another version of this code
import sys # Same
import os
import datetime
import string
digs = string.digits + string.ascii_lowercase
def int2base(x, base):
if x < 0: sign = -1
elif x==0... |
MaartenGr/BERTopic | refs/heads/master | bertopic/plotting/_topics_per_class.py | 1 | import pandas as pd
from typing import List
import plotly.graph_objects as go
def visualize_topics_per_class(topic_model,
topics_per_class: pd.DataFrame,
top_n_topics: int = 10,
topics: List[int] = None,
... |
wreckJ/intellij-community | refs/heads/master | python/testData/refactoring/move/class/before/src/a.py | 83 | from lib1 import URLOpener
import lib1
class C(object):
def __init__(self):
self.opener = lib1.URLOpener(None)
def f(self, x):
o = URLOpener(x)
return o.urlopen()
def g(self, x):
return 'f({0!r}) = {1!r}'.format(URLOpener(x), lib1.URLOpener(x))
def main():
c = C()
... |
ychen820/microblog | refs/heads/master | y/google-cloud-sdk/platform/gcutil/lib/google_compute_engine/gcutil_lib/auth_helper_test.py | 4 | #!/usr/bin/python
#
# Copyright 2012 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... |
MariaSolovyeva/inasafe | refs/heads/develop | safe/impact_functions/inundation/flood_raster_road/impact_function.py | 1 | # coding=utf-8
"""Impact of flood on roads."""
from qgis.core import (
QGis,
QgsCoordinateReferenceSystem,
QgsCoordinateTransform,
QgsFeature,
QgsFeatureRequest,
QgsField,
QgsGeometry,
QgsPoint,
QgsRectangle,
QgsSpatialIndex,
QgsVectorFileWriter,
QgsVectorLayer
)
from PyQ... |
wemanuel/smry | refs/heads/master | server-auth/ls/google-cloud-sdk/lib/googlecloudapis/dns/v1/dns_v1_client.py | 4 | """Generated client library for dns version v1."""
# NOTE: This file is autogenerated and should not be edited by hand.
from googlecloudapis.apitools.base.py import base_api
from googlecloudapis.dns.v1 import dns_v1_messages as messages
class DnsV1(base_api.BaseApiClient):
"""Generated client library for service d... |
sahilshekhawat/pydy | refs/heads/master | pydy/system.py | 1 | """The System class manages the simulation (integration) of a system whose
equations are given by KanesMethod.
Many of the attributes are also properties, and can be directly modified.
Here is the procedure for using this class.
1. specify your options either via the constructor or via the
attributes.
... |
donkirkby/django | refs/heads/master | django/core/management/commands/sendtestemail.py | 349 | import socket
from django.core.mail import mail_admins, mail_managers, send_mail
from django.core.management.base import BaseCommand
from django.utils import timezone
class Command(BaseCommand):
help = "Sends a test email to the email addresses specified as arguments."
missing_args_message = "You must specif... |
lisael/pg-django | refs/heads/master | django/contrib/auth/tests/auth_backends.py | 59 | from django.conf import settings
from django.contrib.auth.models import User, Group, Permission, AnonymousUser
from django.contrib.contenttypes.models import ContentType
from django.core.exceptions import ImproperlyConfigured
from django.test import TestCase
class BackendTest(TestCase):
backend = 'django.contrib... |
bert9bert/statsmodels | refs/heads/master | statsmodels/graphics/__init__.py | 276 | from statsmodels import NoseWrapper as Tester
test = Tester().test
|
natemacfadden/math121 | refs/heads/master | geneticGreed/All Files/SecondWeights/evaluateEvolutionary.py | 1 | import json
import NateToolbox
import greedFunctions
from greedEvolutionary import *
import pr1testing
def load_fam(fileName,generation = None):
data=NateToolbox.load_json(fileName)
loadedFamily=[]
if generation == None:
maxGen=0
for item in data:
if item['ge... |
TheMOOCAgency/edx-platform | refs/heads/master | openedx/core/djangoapps/content/course_overviews/admin.py | 51 | """
Django admin page for CourseOverviews, the basic metadata about a course that
is used in user dashboard queries and other places where you need info like
name, and start dates, but don't actually need to crawl into course content.
"""
from django.contrib import admin
from config_models.admin import ConfigurationMo... |
tpazderka/pysaml2 | refs/heads/master | tests/sp_mdext_conf.py | 2 | from pathutils import full_path
CONFIG = {
"entityid": "urn:mace:example.com:saml:roland:sp",
"name": "urn:mace:example.com:saml:roland:sp",
"description": "My own SP",
"service": {
"sp": {
"endpoints": {
"assertion_consumer_service": [
"http://li... |
jn7163/django | refs/heads/master | django/db/migrations/migration.py | 326 | from __future__ import unicode_literals
from django.db.transaction import atomic
from django.utils.encoding import python_2_unicode_compatible
from .exceptions import IrreversibleError
@python_2_unicode_compatible
class Migration(object):
"""
The base class for all migrations.
Migration files will impo... |
anhstudios/swganh | refs/heads/develop | data/scripts/templates/object/tangible/firework/shared_firework_two.py | 2 | #### NOTICE: THIS FILE IS AUTOGENERATED
#### MODIFICATIONS MAY BE LOST IF DONE IMPROPERLY
#### PLEASE SEE THE ONLINE DOCUMENTATION FOR EXAMPLES
from swgpy.object import *
def create(kernel):
result = Tangible()
result.template = "object/tangible/firework/shared_firework_two.iff"
result.attribute_template_id = -1... |
math4youbyusgroupillinois/python-postmark | refs/heads/master | setup.py | 1 | from distutils.core import setup
setup(
name="python-postmark",
version="0.4.7",
packages=['postmark'],
author="Dave Martorana (http://davemartorana.com), Richard Cooper (http://frozenskys.com), Bill Jones (oraclebill), Dmitry Golomidov (deeGraYve)",
license='BSD',
description="Postmark library... |
megarcia/WxCD | refs/heads/master | source/process_NCEI_04a.py | 2 | """
Python script 'process_NCEI_04a.py'
by Matthew Garcia, PhD student
Dept. of Forest and Wildlife Ecology
University of Wisconsin - Madison
matt.e.garcia@gmail.com
Copyright (C) 2015-2016 by Matthew Garcia
Licensed Gnu GPL v3; see 'LICENSE_GnuGPLv3.txt' for complete terms
Send questions, bug reports, any related req... |
AndreLamurias/IBRel | refs/heads/master | src/crossvalidation.py | 2 | import itertools
import logging
import random
import time
import argparse
import pickle
import sys
from config.corpus_paths import paths
from classification.ner.crfsuitener import CrfSuiteModel
from classification.ner.simpletagger import feature_extractors
from classification.ner.stanfordner import StanfordNERModel
fr... |
ojengwa/oh-mainline | refs/heads/master | mysite/profile/migrations/0032_put_the_last_polled_field_back_into_person.py | 17 | # This file is part of OpenHatch.
# Copyright (C) 2009 OpenHatch, Inc.
#
# 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 Foundation, either version 3 of the License, or
# (at your option) any later v... |
adrianholovaty/django | refs/heads/master | django/core/management/commands/sqlclear.py | 90 | from optparse import make_option
from django.core.management.base import AppCommand
from django.core.management.sql import sql_delete
from django.db import connections, DEFAULT_DB_ALIAS
class Command(AppCommand):
help = "Prints the DROP TABLE SQL statements for the given app name(s)."
option_list = AppComman... |
Trixter69/BookMarka | refs/heads/master | lib/html5lib/__init__.py | 17 | """
HTML parsing library based on the WHATWG "HTML5"
specification. The parser is designed to be compatible with existing
HTML found in the wild and implements well-defined error recovery that
is largely compatible with modern desktop web browsers.
Example usage:
import html5lib
f = open("my_document.html")
tree = ht... |
almarklein/zoof | refs/heads/master | make/__main__.py | 2 | # Launch maker
import os
import sys
from make import Maker
START_DIR = os.path.abspath(os.getcwd())
try:
Maker(sys.argv)
finally:
os.chdir(START_DIR)
|
unseenlaser/python-for-android | refs/heads/master | python-modules/twisted/twisted/test/test_log.py | 59 | # Copyright (c) 2001-2010 Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Tests for L{twisted.python.log}.
"""
import os, sys, time, logging, warnings
from cStringIO import StringIO
from twisted.trial import unittest
from twisted.python import log, failure
class FakeWarning(Warning):
"""
A uni... |
moondrop-entertainment/django-nonrel-drawp | refs/heads/master | django/db/backends/postgresql/introspection.py | 308 | from django.db.backends import BaseDatabaseIntrospection
class DatabaseIntrospection(BaseDatabaseIntrospection):
# Maps type codes to Django Field types.
data_types_reverse = {
16: 'BooleanField',
20: 'BigIntegerField',
21: 'SmallIntegerField',
23: 'IntegerField',
25: 'T... |
jhamman/RVIC | refs/heads/master | rvic/parameters.py | 2 | # -*- coding: utf-8 -*-
'''
RVIC parameter file development driver
'''
import os
import numpy as np
import pandas as pd
from logging import getLogger
from .core.log import init_logger, close_logger, LOG_NAME
from .core.multi_proc import error
from .core.utilities import make_directories, copy_inputs, strip_invalid_char... |
pombreda/rst2pdf | refs/heads/master | rst2pdf/tests/input/sphinx-issue169/conf.py | 9 | # -*- coding: utf-8 -*-
#
# Issue 169 documentation build configuration file, created by
# sphinx-quickstart on Mon Aug 24 08:58:31 2009.
#
# 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.
#
# A... |
gmist/kay-ru | refs/heads/master | kay/tests/datastore_settings.py | 5 | # -*- coding: utf-8 -*-
"""
A sample of kay settings.
:Copyright: (c) 2009 Accense Technology, Inc.
Takashi Matsuo <tmatsuo@candit.jp>,
All rights reserved.
:license: BSD, see LICENSE for more details.
"""
DEFAULT_TIMEZONE = 'Asia/Tokyo'
DEBUG = True
PROFILE = False
SECRET_... |
mm112287/2015cda_g8_0421 | refs/heads/master | static/Brython3.1.1-20150328-091302/Lib/site-packages/test_sp.py | 727 | test = "site package"
|
hiway/micropython | refs/heads/master | tests/basics/gc1.py | 18 | # basic tests for gc module
try:
import gc
except ImportError:
print("SKIP")
raise SystemExit
print(gc.isenabled())
gc.disable()
print(gc.isenabled())
gc.enable()
print(gc.isenabled())
gc.collect()
if hasattr(gc, 'mem_free'):
# uPy has these extra functions
# just test they execute and return an... |
matthagy/rtchemstats | refs/heads/master | Demo/compute_vacf.py | 1 | '''Compute the velocity autocorrelation function C_v(t) for a
Lennard Jones system at T=1.46 and rho=0.4. Results can be compared
to Fig. 1 of Levesque D. and Verlet L. Phys. Rev. A. 2514. 201. (1970)
'''
from rtchemstats.tcf import VelocityAutocorrelationComputer
import matplotlib.pyplot as plt
from util impor... |
sujeetv/incubator-hawq | refs/heads/master | tools/bin/gppylib/test/test_pg8000.py | 10 | #!/usr/bin/env python
#
# Copyright (c) Greenplum Inc 2008. All Rights Reserved.
#
""" Unittesting for pg8000 module
"""
import logging
import unittest
try:
from pg8000 import *
except ImportError, e:
sys.exit('Error: unable to import module: ' + str(e))
from gppylib import gplog
from gppylib.db.dbconn i... |
serialdoom/ansible | refs/heads/devel | test/units/parsing/yaml/test_objects.py | 14 | # 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 in the hope that ... |
espadrine/opera | refs/heads/master | chromium/src/ppapi/generators/idl_namespace.py | 40 | #!/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.
"""
IDLNamespace for PPAPI
This file defines the behavior of the AST namespace which allows for resolving
a symbol as one or more ... |
mims2707/bite-project | refs/heads/master | deps/gdata-python-client/tests/gdata_tests/apps/live_client_test.py | 22 | #!/usr/bin/python2.4
#
# Copyright 2011 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 require... |
Jeebeevee/DouweBot | refs/heads/master | plugins_org/stock.py | 17 | from util import hook, http
@hook.command
def stock(inp):
'''.stock <symbol> -- gets stock information'''
url = ('http://query.yahooapis.com/v1/public/yql?format=json&'
'env=store%3A%2F%2Fdatatables.org%2Falltableswithkeys')
parsed = http.get_json(url, q='select * from yahoo.finance.quote '
... |
Elico-Corp/odoo_OCB | refs/heads/9.0 | addons/hw_posbox_homepage/controllers/main.py | 30 | # -*- coding: utf-8 -*-
import logging
import os
import time
import werkzeug
import subprocess
from os import listdir
import openerp
from openerp import http
from openerp.http import request
from openerp.tools.translate import _
_logger = logging.getLogger(__name__)
index_style = """
<style>
body... |
luispedro/milksets | refs/heads/master | milksets/iris/__init__.py | 2 | # -*- coding: utf-8 -*-
# Copyright (C) 2012, Luis Pedro Coelho <luis@luispedro.org>
# vim: set ts=4 sts=4 sw=4 expandtab smartindent:
#
# 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 with... |
agry/NGECore2 | refs/heads/master | scripts/mobiles/generic/faction/imperial/imp_sergeant_16.py | 2 | import sys
from services.spawn import MobileTemplate
from services.spawn import WeaponTemplate
from resources.datatables import WeaponType
from resources.datatables import Difficulty
from resources.datatables import Options
from resources.datatables import FactionStatus
from java.util import Vector
def addTemplate(co... |
gangadharkadam/tailorfrappe | refs/heads/master | frappe/tests/test_filemanager.py | 37 | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
import frappe
import os
import unittest
from frappe.utils.file_manager import save_file, get_file, get_files_path
test_content1 = 'Hello'
test_content2 = 'Hello World'
def make_test_doc():
d = frappe.new_doc('ToD... |
DelazJ/QGIS | refs/heads/master | tests/src/python/test_qgsfields.py | 28 | # -*- coding: utf-8 -*-
"""QGIS Unit tests for QgsField.
.. 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... |
a40223217/w16b_test | refs/heads/master | static/Brython3.1.1-20150328-091302/Lib/importlib/abc.py | 743 | """Abstract base classes related to import."""
from . import _bootstrap
from . import machinery
try:
import _frozen_importlib
except ImportError as exc:
if exc.name != '_frozen_importlib':
raise
_frozen_importlib = None
import abc
import imp
import marshal
import sys
import tokenize
import warnings
... |
cmelange/ansible | refs/heads/devel | lib/ansible/modules/network/lenovo/cnos_backup.py | 19 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2017 Lenovo, 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
# ... |
kenshinthebattosai/readthedocs.org | refs/heads/master | readthedocs/rtd_tests/tests/test_project_views.py | 21 | from django.contrib.auth.models import User
from django.contrib.messages import constants as message_const
from django_dynamic_fixture import get
from django_dynamic_fixture import new
from mock import patch
from readthedocs.rtd_tests.base import WizardTestCase, MockBuildTestCase
from readthedocs.projects.models impor... |
Mirantis/swift-encrypt | refs/heads/master | swift/common/key_manager/migration.py | 1 | # Copyright (c) 2010-2012 OpenStack, 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 ... |
sjperkins/tensorflow | refs/heads/master | tensorflow/python/training/rmsprop_test.py | 113 | # 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... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.