repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
ibmsoe/tensorflow | refs/heads/master | tensorflow/contrib/distributions/python/ops/chi2.py | 16 | # 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... |
sunfounder/SunFounder_PiSmart | refs/heads/master | pismart/SpeakPython/SpeakPythonJSGFParser.py | 3 | # $ANTLR 3.4 SpeakPythonJSGF.g 2015-09-25 20:19:04
import sys
from antlr3 import *
from antlr3.compat import set, frozenset
# for convenience in actions
HIDDEN = BaseRecognizer.HIDDEN
# token types
EOF=-1
ARROW=4
AT=5
AT_GLOBAL_OPTIONS=6
AT_OPTIONS=7
AT_RESULTS=8
AT_TESTS=9
B_ARROW=10
COMMA=11
COMMENT=12
END_DQUOT... |
moio/spacewalk | refs/heads/master | client/debian/packages-already-in-debian/rhn-client-tools/src/bin/rhnreg_ks.py | 3 | #!/usr/bin/python
#
# Registration client for the Red Hat Network for useage with kickstart
# Copyright (c) 1999--2012 Red Hat, Inc. Distributed under GPLv2.
#
# Authors:
# Adrian Likins <alikins@redhat.com>
# James Bowes <jbowes@redhat.com>
#
# see the output of "--help" for the valid options.
#
# The c... |
petteyg/intellij-community | refs/heads/master | python/testData/findUsages/ClassUsages.py | 83 | class C<caret>ow:
def __init__(self):
pass
c = Cow()
|
madan96/sympy | refs/heads/master | sympy/utilities/pkgdata.py | 109 | """
pkgdata is a simple, extensible way for a package to acquire data file
resources.
The getResource function is equivalent to the standard idioms, such as
the following minimal implementation::
import sys, os
def getResource(identifier, pkgname=__name__):
pkgpath = os.path.dirname(sys.modules[pkgna... |
Digilent/u-boot-digilent | refs/heads/master | tools/binman/etype/u_boot_spl_with_ucode_ptr.py | 1 | # Copyright (c) 2016 Google, Inc
# Written by Simon Glass <sjg@chromium.org>
#
# SPDX-License-Identifier: GPL-2.0+
#
# Entry-type module for an SPL binary with an embedded microcode pointer
#
import struct
import command
from entry import Entry
from blob import Entry_blob
from u_boot_with_ucode_ptr import Entry_... |
gangadharkadam/office_erp | refs/heads/develop | erpnext/stock/doctype/item/item.py | 3 | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
from frappe import msgprint, _
from frappe.utils import cstr, flt, getdate, now_datetime, formatdate
from frappe.website.website_genera... |
campbe13/openhatch | refs/heads/master | vendor/packages/python-mimeparse/setup.py | 15 | #!/usr/bin/env python
from distutils.core import setup
import mimeparse
setup(
name="python-mimeparse",
py_modules=["mimeparse"],
version=mimeparse.__version__,
description="A module provides basic functions for parsing mime-type names and matching them against a list of media-ranges.",
author="Da... |
titansgroup/python-phonenumbers | refs/heads/dev | python/phonenumbers/shortdata/region_CV.py | 11 | """Auto-generated file, do not edit by hand. CV metadata"""
from ..phonemetadata import NumberFormat, PhoneNumberDesc, PhoneMetadata
PHONE_METADATA_CV = PhoneMetadata(id='CV', country_code=None, international_prefix=None,
general_desc=PhoneNumberDesc(national_number_pattern='1\\d{2}', possible_number_pattern='\\d{... |
jerome-nexedi/dream | refs/heads/master | dream/plugins/DefaultTabularExit.py | 1 | from copy import copy
import json
import time
import random
import operator
import StringIO
import xlrd
from dream.plugins import plugin
class DefaultTabularExit(plugin.OutputPreparationPlugin):
""" Output the exit stats in a tab
"""
def postprocess(self, data):
numberOfReplications=int(data['gen... |
catapult-project/catapult-csm | refs/heads/master | third_party/gsutil/third_party/boto/boto/mturk/price.py | 170 | # Copyright (c) 2006,2007 Mitch Garnaat http://garnaat.org/
#
# 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, copy, modi... |
reinout/django | refs/heads/master | tests/proxy_model_inheritance/app1/models.py | 515 | # TODO: why can't I make this ..app2
from app2.models import NiceModel
class ProxyModel(NiceModel):
class Meta:
proxy = True
|
joshrule/LOTlib | refs/heads/master | LOTlib/Legacy/Visualization/iPy.py | 4 | """
Tools for visualizing useful things.
>>> import LOTlib.Visualization as viz
"""
from IPython.display import clear_output
import sys
def print_iters(i, num_iters, increm=20):
"""Print incremental statements as we generate a large number of hypotheses.
TODO: should this be made into a more general version... |
Distrotech/intellij-community | refs/heads/master | python/testData/inspections/RemoveTrailingSemicolon_after.py | 83 | a = 4; b = 5 |
robk5uj/invenio | refs/heads/bft2012-01-03 | modules/bibedit/lib/refextract_tests.py | 3 | # -*- coding: utf-8 -*-
##
## This file is part of Invenio.
## Copyright (C) 2010, 2011 CERN.
##
## Invenio is free software; you can redistribute it and/or
## modify it under the terms of the GNU General Public License as
## published by the Free Software Foundation; either version 2 of the
## License, or (at your opt... |
jeff-alves/Tera | refs/heads/master | game/message/unused/C_USER_AIM.py | 1 | from util.tipo import tipo
class C_USER_AIM(object):
def __init__(self, tracker, time, direction, opcode, data):
print(str(type(self)).split('.')[3]+'('+str(len(data))+'): '+ str(data.get_array_hex(1))[1:-1])
|
Bachaco-ve/odoo | refs/heads/8.0 | addons/hr/res_users.py | 303 | from openerp import api
from openerp.osv import fields, osv
class res_users(osv.Model):
""" Update of res.users class
- if adding groups to an user, check if base.group_user is in it
(member of 'Employee'), create an employee form linked to it.
"""
_name = 'res.users'
_inherit = ['res.... |
whereismyjetpack/ansible | refs/heads/devel | lib/ansible/modules/network/cumulus/cl_bridge.py | 21 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2016, Cumulus Networks <ce-ceng@cumulusnetworks.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... |
lmazuel/azure-sdk-for-python | refs/heads/master | azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/hardware_profile.py | 1 | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... |
gem/oq-engine | refs/heads/master | openquake/hazardlib/tests/gsim/zalachoris_rathje_2019_test.py | 1 | # The Hazard Library
# Copyright (C) 2015-2021 GEM Foundation
#
# 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 version.
#... |
kawamon/hue | refs/heads/master | desktop/libs/hadoop/src/hadoop/confparse.py | 40 | #!/usr/bin/env python
# Licensed to Cloudera, Inc. under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. Cloudera, Inc. licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you ma... |
mindnervestech/mnrp | refs/heads/master | addons/l10n_pl/__init__.py | 340 | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2008 Tiny SPRL (<http://tiny.be>). All Rights Reserved
# $Id$
#
# l10n_pl module improved for Poland
# by Grzegorz Grzelak grzegorz.g... |
slarse/pdfebc-web | refs/heads/master | pdfebc_web/main/views.py | 1 | # -*- coding: utf-8 -*-
"""This module contains all views for the main blueprint.
.. module:: views
:platform: Unix
:synopsis: Views for the main blueprint.
.. moduleauthor:: Simon Larsén <slarse@kth.se>
"""
import os
import uuid
from pdfebc_core import email_utils, config_utils
from flask import render_templ... |
mrfuxi/django | refs/heads/master | django/contrib/gis/db/models/aggregates.py | 414 | from django.contrib.gis.db.models.fields import ExtentField
from django.db.models.aggregates import Aggregate
__all__ = ['Collect', 'Extent', 'Extent3D', 'MakeLine', 'Union']
class GeoAggregate(Aggregate):
function = None
is_extent = False
def as_sql(self, compiler, connection):
# this will be c... |
ppanczyk/ansible | refs/heads/devel | lib/ansible/modules/cloud/amazon/ec2_vol_facts.py | 29 | #!/usr/bin/python
# Copyright: Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
... |
revolutionaryG/phantomjs | refs/heads/master | src/qt/qtwebkit/Source/ThirdParty/gtest/test/run_tests_util_test.py | 233 | #!/usr/bin/env python
#
# Copyright 2009 Google Inc. All Rights Reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of... |
mihailignatenko/erp | refs/heads/master | addons/hw_escpos/__init__.py | 385 | # -*- 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... |
goldcoin/gldcoin | refs/heads/master | BuildDeps/deps/boost/libs/python/pyste/src/Pyste/CppParser.py | 54 | # Copyright Bruno da Silva de Oliveira 2003. Use, modification and
# distribution is subject to the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or copy at
# http://www.boost.org/LICENSE_1_0.txt)
from GCCXMLParser import ParseDeclarations
import tempfile
import shutil
import os
impor... |
MichaelNedzelsky/intellij-community | refs/heads/master | python/testData/highlighting/unicode33.py | 83 | print(u'text') |
rooshilp/CMPUT410W15-project | refs/heads/master | testenv/lib/python2.7/site-packages/django/contrib/comments/signals.py | 311 | """
Signals relating to comments.
"""
from django.dispatch import Signal
# Sent just before a comment will be posted (after it's been approved and
# moderated; this can be used to modify the comment (in place) with posting
# details or other such actions. If any receiver returns False the comment will be
# discarded a... |
joone/chromium-crosswalk | refs/heads/2016.04.css-round-display-edtior-draft-1 | third_party/markdown/extensions/__init__.py | 109 | # markdown is released under the BSD license
# Copyright 2007, 2008 The Python Markdown Project (v. 1.7 and later)
# Copyright 2004, 2005, 2006 Yuri Takhteyev (v. 0.2-1.6b)
# Copyright 2004 Manfred Stienstra (the original version)
#
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or... |
pkimber/crm | refs/heads/master | example_crm/tests/test_view_perm.py | 1 | # -*- encoding: utf-8 -*-
import pytest
from django.core.urlresolvers import reverse
from django.test import TestCase
from contact.tests.factories import ContactFactory, UserContactFactory
from crm.tests.factories import CrmContactFactory, TicketFactory
from login.tests.factories import TEST_PASSWORD, UserFactory
fro... |
synety-jdebp/rtpproxy | refs/heads/master | misc/PFD.py | 7 | from math import trunc
def sigmoid(x):
return (x / (1 + abs(x)))
class PFD(object):
target_clk = None
def __init__(self, ctime):
self.target_clk = trunc(ctime) + 1.0
def get_error(self, ctime, raw_error = False):
err0r = self.target_clk - ctime
next_clk = trunc(ctime) + 1.0
... |
arshsingh/hellosign-python-sdk | refs/heads/v3 | hellosign_sdk/resource/unclaimed_draft.py | 2 | from .resource import Resource
#
# The MIT License (MIT)
#
# Copyright (C) 2014 hellosign.com
#
# 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 limit... |
crossbario/autobahn-python | refs/heads/master | examples/twisted/websocket/slowsquare/client.py | 3 | ###############################################################################
#
# The MIT License (MIT)
#
# Copyright (c) Crossbar.io Technologies GmbH
#
# 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 ... |
vmagamedov/hiku | refs/heads/master | tests/test_executor_asyncio.py | 1 | import asyncio
import pytest
from hiku.executors.queue import Queue, Workflow
from hiku.executors.asyncio import AsyncIOExecutor
def func():
pass
def func2():
return []
def gen():
yield
def gen2():
yield from gen()
async def coroutine():
return 'smiting'
@pytest.mark.asyncio
async def ... |
jiezhu2007/scrapy | refs/heads/master | scrapy/contrib/loader/__init__.py | 144 | import warnings
from scrapy.exceptions import ScrapyDeprecationWarning
warnings.warn("Module `scrapy.contrib.loader` is deprecated, "
"use `scrapy.loader` instead",
ScrapyDeprecationWarning, stacklevel=2)
from scrapy.loader import *
|
camptocamp/mapproxy | refs/heads/master | mapproxy/script/grids.py | 8 | # This file is part of the MapProxy project.
# Copyright (C) 2011 Omniscale <http://omniscale.de>
#
# 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... |
SurfasJones/djcmsrc3 | refs/heads/master | venv/lib/python2.7/site-packages/django/shortcuts/__init__.py | 116 | """
This module collects helper functions and classes that "span" multiple levels
of MVC. In other words, these functions/classes introduce controlled coupling
for convenience's sake.
"""
import warnings
from django.template import loader, RequestContext
from django.http import HttpResponse, Http404
from django.http i... |
jlaura/pysal | refs/heads/master | pysal/contrib/pdio/shp.py | 7 | import pandas as pd
import pysal as ps
def shp2series(filepath):
"""
reads a shapefile, stuffing each shape into an element of a Pandas Series
"""
f = ps.open(filepath)
s = pd.Series(poly for poly in f)
f.close()
return s
def series2shp(series, filepath):
"""
writes a series of pys... |
mstriemer/amo-validator | refs/heads/master | tests/test_js_overwrite.py | 7 | from js_helper import TestCase
class TestOverwrite(TestCase):
"""Test that JS variables can be properly overwritten."""
def test_new_overwrite(self):
"""Tests that objects created with `new` can be overwritten."""
self.run_script("""
var x = new String();
x += "asdf";
... |
viveksh13/gymkhana | refs/heads/master | venv/bin/venv/lib/python2.7/site-packages/pip/_vendor/html5lib/tokenizer.py | 1710 | from __future__ import absolute_import, division, unicode_literals
try:
chr = unichr # flake8: noqa
except NameError:
pass
from collections import deque
from .constants import spaceCharacters
from .constants import entities
from .constants import asciiLetters, asciiUpper2Lower
from .constants import digits, ... |
vpoggi/catalogue_toolkit | refs/heads/master | eqcat/__init__.py | 6 | # -*- coding: utf-8 -*-
# vim: tabstop=4 shiftwidth=4 softtabstop=4
#
# LICENSE
#
# Copyright (c) 2015 GEM Foundation
#
# The Catalogue Toolkit 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 ... |
melphi/article-extractor | refs/heads/master | python/extract_cmd.py | 1 | #!/usr/bin/env python3.6
# Standalone command to extract a single page.
import asyncio
from argparse import ArgumentParser
from app.modules.extractor.services import DocumentExtractorService
def _extract(args: any) -> dict:
loop = asyncio.get_event_loop()
with DocumentExtractorService(loop) as extractor:
... |
openstack/os-testr | refs/heads/master | os_testr/tests/test_return_codes.py | 1 | # Copyright 2015 Hewlett-Packard Development Company, L.P.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requir... |
adrn/gala | refs/heads/master | gala/dynamics/mockstream/__init__.py | 2 | from .core import *
from ._mockstream import mockstream_dop853
from .mockstream_generator import *
from .df import *
|
JioCloud/cinder | refs/heads/master | cinder/backup/driver.py | 1 | # Copyright (C) 2013 Deutsche Telekom AG
# 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 r... |
johankaito/fufuka | refs/heads/master | microblog/flask/venv/lib/python2.7/site-packages/wheel/signatures/keys.py | 471 | """Store and retrieve wheel signing / verifying keys.
Given a scope (a package name, + meaning "all packages", or - meaning
"no packages"), return a list of verifying keys that are trusted for that
scope.
Given a package name, return a list of (scope, key) suggested keys to sign
that package (only the verifying key... |
limix/glimix-core | refs/heads/master | glimix_core/lik/test/test_lik.py | 2 | from __future__ import unicode_literals
from numpy.random import RandomState
from numpy.testing import assert_, assert_allclose
from glimix_core.lik import (
BernoulliProdLik,
BinomialProdLik,
DeltaProdLik,
PoissonProdLik,
)
from glimix_core.link import ProbitLink
def test_delta_prod_lik():
rand... |
BorisJeremic/Real-ESSI-Examples | refs/heads/master | analytic_solution/test_cases/Contact/Interface_Mesh_Types/Interface_1/HardContact_ElPPlShear/compare_HDF5_Element_Output.py | 402 | #!/usr/bin/python
import h5py
import sys
import numpy as np
import os
import re
import random
# find the path to my own python function:
cur_dir=os.getcwd()
sep='test_cases'
test_DIR=cur_dir.split(sep,1)[0]
scriptDIR=test_DIR+'compare_function'
sys.path.append(scriptDIR)
# import my own function for color and comparat... |
PanagiotisDrakatos/Light_IoT_CryptoDevice | refs/heads/master | PythonClient/Configuration/__init__.py | 1 | """Miscellaneous modules
Contains useful modules that don't belong into any of the
subpackages.
========================
Module
========================
`PythonClient.Configuration.Format`
`PythonClient.Configuration.JsonObject`
`PythonClient.Configuration.Properties`
========================
"""
__all__ = ['Format', '... |
yangleo/cloud-github | refs/heads/master | openstack_dashboard/dashboards/admin/networks/panel.py | 79 | # Copyright 2012 NEC Corporation
#
# 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 ag... |
codilime/contrail-controller | refs/heads/windows3.1 | src/config/schema-transformer/test/test_route_target.py | 2 | #
# Copyright (c) 2013 Juniper Networks, Inc. All rights reserved.
#
try:
import config_db
except ImportError:
from schema_transformer import config_db
from vnc_api.vnc_api import RouteTargetList, NoIdError
from test_case import STTestCase, retries
from test_policy import VerifyPolicy
class VerifyRouteTarge... |
siamese/SIS | refs/heads/master | share/qt/make_spinner.py | 4415 | #!/usr/bin/env python
# W.J. van der Laan, 2011
# Make spinning .mng animation from a .png
# Requires imagemagick 6.7+
from __future__ import division
from os import path
from PIL import Image
from subprocess import Popen
SRC='img/reload_scaled.png'
DST='../../src/qt/res/movies/update_spinner.mng'
TMPDIR='/tmp'
TMPNAM... |
cchurch/ansible | refs/heads/devel | lib/ansible/modules/storage/infinidat/infini_host.py | 44 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2016, Gregory Shulov (gregory.shulov@gmail.com)
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_... |
shirishgoyal/crowdsource-platform | refs/heads/develop2 | csp/utils.py | 3 | from django.core.exceptions import PermissionDenied
from oauth2_provider.oauth2_backends import get_oauthlib_core
from django.conf import settings
from django.utils.functional import SimpleLazyObject
from django.contrib.auth import get_user
try:
# django >= 1.8 && python >= 2.7
# https://docs.djangoproject.com... |
catsmith/magpy | refs/heads/master | magpy/server/api.py | 1 | """REST service, used via JavaScript API or directly."""
from __future__ import print_function
from datetime import datetime
from copy import deepcopy
import json
import re
import os
import base64
import tornado.web
from bson import json_util
from functools import partial
from magpy.server.validators import validate_... |
AxelDelmas/ansible | refs/heads/devel | lib/ansible/module_utils/facts.py | 27 | # (c) 2012, 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) any lat... |
gavin-feng/odoo | refs/heads/8.0 | addons/website_customer/__openerp__.py | 313 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2013-Today OpenERP S.A. (<http://www.openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the term... |
edx/edx-analytics-data-api | refs/heads/master | analytics_data_api/v0/views/learners.py | 1 | """
API methods for module level data.
"""
import logging
from django.conf import settings
from edx_django_utils.cache import TieredCache, get_cache_key
from enterprise_data.models import EnterpriseUser
from rest_framework import generics, status
from analytics_data_api.v0.exceptions import (
LearnerEngagementT... |
garmin/connectiq-apps | refs/heads/master | barrels/LogMonkey/parse_log_file.py | 1 | #
# This script will parse and output a filtered version
# of a given log file generated by the LogMonkey Connect
# IQ Monkey Barrel. See the print_help() function for details.
#
import getopt
import sys
import re
import os.path
LOG_FILE_OUTPUT_FORMAT = "({0})[{1}] {{{2}}} {3}: {4}"
CSV_FILE_OUTPUT_FORMAT = "{0},{1},... |
googleapis/googleapis-gen | refs/heads/master | google/cloud/osconfig/v1alpha/osconfig-v1alpha-py/google/cloud/osconfig_v1alpha/types/config_common.py | 1 | # -*- 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... |
frascoweb/frasco-upload | refs/heads/master | frasco_upload/__init__.py | 1 | from frasco import Feature, current_app, action
from .backends import upload_backends, StorageBackend
from werkzeug import secure_filename, FileStorage
from flask import send_from_directory
import uuid
import os
from .utils import *
from io import BytesIO
from tempfile import TemporaryFile, NamedTemporaryFile, gettempd... |
mihi-tr/eriwan | refs/heads/master | eriwan/eriwan/wsgi.py | 1 | """
WSGI config for eriwan project.
This module contains the WSGI application used by Django's development server
and any production WSGI deployments. It should expose a module-level variable
named ``application``. Django's ``runserver`` and ``runfcgi`` commands discover
this application via the ``WSGI_APPLICATION`` s... |
2014c2g19/2014c2g19 | refs/heads/master | exts/wsgi/static/Brython2.1.0-20140419-113919/Lib/logging/handlers.py | 736 | # Copyright 2001-2013 by Vinay Sajip. All Rights Reserved.
#
# Permission to use, copy, modify, and distribute this software and its
# documentation for any purpose and without fee is hereby granted,
# provided that the above copyright notice appear in all copies and that
# both that copyright notice and this permissio... |
zzjkf2009/Acme-Robotics-Project | refs/heads/master | vendor/googletest/googletest/test/gtest_shuffle_test.py | 3023 | #!/usr/bin/env python
#
# Copyright 2009 Google Inc. All Rights Reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of... |
OmgOhnoes/Flexget | refs/heads/develop | flexget/plugins/sites/hliang.py | 7 | from __future__ import unicode_literals, division, absolute_import
import logging
import re
from flexget import plugin
from flexget.event import event
from flexget.plugins.internal.urlrewriting import UrlRewritingError
from flexget.utils.soup import get_soup
log = logging.getLogger('hliang')
class UrlRewriteHliang(... |
socialsweethearts/django-allauth | refs/heads/master | allauth/socialaccount/views.py | 46 | from django.contrib import messages
from django.http import HttpResponseRedirect
from django.core.urlresolvers import reverse, reverse_lazy
from django.contrib.auth.decorators import login_required
from django.views.generic.base import TemplateView
from django.views.generic.edit import FormView
from ..account.views im... |
tanmaykm/thrift | refs/heads/julia1.0-thrift-0.11.0 | test/crossrunner/report.py | 4 | #
# 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... |
calancha/DIRAC | refs/heads/rel-v6r12 | RequestManagementSystem/private/OperationHandlerBase.py | 1 | ########################################################################
# $HeadURL $
# File: OperationHandlerBase.py
# Author: Krzysztof.Ciba@NOSPAMgmail.com
# Date: 2013/03/13 13:48:52
########################################################################
""" :mod: OperationHandlerBase
=========================... |
jsayles/wedding | refs/heads/master | wedding/migrations/0009_plantext.py | 1 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('wedding', '0008_auto_20150708_1817'),
]
operations = [
migrations.CreateModel(
name='PlanText',
fiel... |
shsingh/ansible | refs/heads/devel | test/units/modules/cloud/amazon/test_iam_password_policy.py | 13 | # Make coding more python3-ish
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import pytest
from units.modules.utils import set_module_args
from ansible.module_utils.ec2 import HAS_BOTO3
if not HAS_BOTO3:
pytestmark = pytest.mark.skip("iam_password_policy.py requires the ... |
github-account-because-they-want-it/django | refs/heads/master | tests/base/models.py | 430 | from __future__ import unicode_literals
from django.db import models
from django.utils import six
# The models definitions below used to crash. Generating models dynamically
# at runtime is a bad idea because it pollutes the app registry. This doesn't
# integrate well with the test suite but at least it prevents reg... |
imruahmed/microblog | refs/heads/master | flask/lib/python2.7/site-packages/whoosh/analysis/filters.py | 88 | # coding=utf-8
# Copyright 2007 Matt Chaput. 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 co... |
scotthartbti/android_external_chromium_org | refs/heads/kk44 | chrome/common/extensions/docs/server2/availability_finder.py | 23 | # Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
from collections import Mapping
from api_schema_graph import APISchemaGraph
from branch_utility import BranchUtility
from extensions_paths import API, JSON_... |
GeertAltCoin/Geertcoin | refs/heads/master | contrib/seeds/makeseeds.py | 1 | #!/usr/bin/env python
#
# Generate pnSeed[] from Pieter's DNS seeder
#
NSEEDS=600
import re
import sys
from subprocess import check_output
def main():
lines = sys.stdin.readlines()
ips = []
pattern = re.compile(r"^(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3}):64333")
for line in lines:
m = patt... |
lewisc/spark-tk | refs/heads/master | regression-tests/sparktkregtests/testcases/frames/frame_group_by_test.py | 13 | # vim: set encoding=utf-8
# Copyright (c) 2016 Intel Corporation
#
# 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... |
goodwinnk/intellij-community | refs/heads/master | python/testData/completion/importNamespacePackageInMultipleRoots/a.py | 19 | import nspackage.a<caret> |
YannThorimbert/ThorPy-1.4.1 | refs/heads/master | thorpy/painting/graphics.py | 5 | """Provides some functions that can be used to produce procedural graphical
elements.
"""
# -*- coding: utf-8 -*-
from math import sin, cos, pi, radians, hypot
try:
from pygame import surfarray
HAS_NUMPY = True
except ImportError:
HAS_NUMPY = False
import pygame.draw
from pygame import Surface, RLEACCEL, ... |
trondhindenes/ansible-modules-core | refs/heads/devel | cloud/amazon/ec2_elb_lb.py | 8 | #!/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... |
Pakoach/Sick-Beard | refs/heads/master | lib/hachoir_parser/video/flv.py | 90 | """
FLV video parser.
Documentation:
- FLV File format: http://osflash.org/flv
- libavformat from ffmpeg project
- flashticle: Python project to read Flash (SWF and FLV with AMF metadata)
http://undefined.org/python/#flashticle
Author: Victor Stinner
Creation date: 4 november 2006
"""
from lib.hachoir_parser ... |
wiltonlazary/arangodb | refs/heads/devel | 3rdParty/V8/V8-5.0.71.39/tools/swarming_client/third_party/pyasn1/pyasn1/debug.py | 185 | import sys
from pyasn1.compat.octets import octs2ints
from pyasn1 import error
from pyasn1 import __version__
flagNone = 0x0000
flagEncoder = 0x0001
flagDecoder = 0x0002
flagAll = 0xffff
flagMap = {
'encoder': flagEncoder,
'decoder': flagDecoder,
'all': flagAll
}
class Debug:
defaultPr... |
misccoin/MiscCoin | refs/heads/master | share/qt/extract_strings_qt.py | 2945 | #!/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
OUT_CPP="src/qt/bitcoinstrings.cpp"
EMPTY=['""']
def parse_po(text):
"""
Parse 'po' format produced by x... |
tjcsl/director | refs/heads/master | web3/apps/auth/oauth.py | 1 | from social_core.backends.oauth import BaseOAuth2
from social_core.pipeline.user import get_username as social_get_username
from ...utils.tjldap import get_uid
from ..users.models import Group
def get_username(strategy, details, user=None, *args, **kwargs):
result = social_get_username(strategy, details, user=us... |
andriisoldatenko/Django-facebook | refs/heads/master | docs/docs_env/Lib/encodings/gbk.py | 816 | #
# gbk.py: Python Unicode Codec for GBK
#
# Written by Hye-Shik Chang <perky@FreeBSD.org>
#
import _codecs_cn, codecs
import _multibytecodec as mbc
codec = _codecs_cn.getcodec('gbk')
class Codec(codecs.Codec):
encode = codec.encode
decode = codec.decode
class IncrementalEncoder(mbc.MultibyteIncrementalEnco... |
dmytroKarataiev/MachineLearning | refs/heads/master | learning/ud120-projects/pca/eigenfaces.py | 1 | """
===================================================
Faces recognition example using eigenfaces and SVMs
===================================================
The dataset used in this example is a preprocessed excerpt of the
"Labeled Faces in the Wild", aka LFW_:
http://vis-www.cs.umass.edu/lfw/lfw-funneled.tgz (2... |
FHannes/intellij-community | refs/heads/master | python/testData/inspections/PyCompatibilityInspection/numericLiteralExpression.py | 13 | a = <warning descr="Python version 3.0, 3.1, 3.2, 3.3, 3.4, 3.5, 3.6 do not support a trailing 'l' or 'L'.">12l</warning>
v = <warning descr="Python version 3.0, 3.1, 3.2, 3.3, 3.4, 3.5, 3.6 do not support this syntax. It requires '0o' prefix for octal literals">04</warning><error descr="End of statement expected">8</e... |
ramcn/demo3 | refs/heads/master | venv/lib/python3.4/site-packages/oauth2_provider/compat.py | 1 | """
The `compat` module provides support for backwards compatibility with older
versions of django and python..
"""
from __future__ import unicode_literals
import django
from django.conf import settings
# urlparse in python3 has been renamed to urllib.parse
try:
from urlparse import urlparse, parse_qs, parse_qsl... |
idea4bsd/idea4bsd | refs/heads/idea4bsd-master | python/lib/Lib/site-packages/django/db/models/sql/compiler.py | 71 | from django.core.exceptions import FieldError
from django.db import connections
from django.db.backends.util import truncate_name
from django.db.models.sql.constants import *
from django.db.models.sql.datastructures import EmptyResultSet
from django.db.models.sql.expressions import SQLEvaluator
from django.db.models.sq... |
goldmedal/spark | refs/heads/master | python/pyspark/sql/tests/test_pandas_grouped_map.py | 6 | #
# 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 us... |
TwigWorld/django-crispy-forms | refs/heads/dev | crispy_forms/tests/test_layout.py | 6 | # -*- coding: utf-8 -*-
import re
import django
from django import forms
from django.conf import settings
from django.core.urlresolvers import reverse
from django.forms.models import formset_factory, modelformset_factory
from django.middleware.csrf import _get_new_csrf_key
from django.shortcuts import render_to_respon... |
ImpalaToGo/ImpalaToGo | refs/heads/master | tests/comparison/query_profile.py | 4 | # Copyright (c) 2014 Cloudera, 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 o... |
ProjectOpenCannibal/android_kernel_lg_geehrc4g | refs/heads/master | tools/perf/scripts/python/failed-syscalls-by-pid.py | 11180 | # failed system call counts, by pid
# (c) 2010, Tom Zanussi <tzanussi@gmail.com>
# Licensed under the terms of the GNU GPL License version 2
#
# Displays system-wide failed system call totals, broken down by pid.
# If a [comm] arg is specified, only syscalls called by [comm] are displayed.
import os
import sys
sys.pa... |
sherbondy/simple-flash | refs/heads/master | jinja2/meta.py | 406 | # -*- coding: utf-8 -*-
"""
jinja2.meta
~~~~~~~~~~~
This module implements various functions that exposes information about
templates that might be interesting for various kinds of applications.
:copyright: (c) 2010 by the Jinja Team, see AUTHORS for more details.
:license: BSD, see LICENSE fo... |
mattpap/sympy-polys | refs/heads/master | sympy/solvers/recurr.py | 2 | """This module is intended for solving recurrences or, in other words,
difference equations. Currently supported are linear, inhomogeneous
equations with polynomial or rational coefficients.
The solutions are obtained among polynomials, rational functions,
hypergeometric terms, or combinations of hypergeom... |
tst-lsavoie/earthenterprise | refs/heads/master | earth_enterprise/src/server/wsgi/serve/publish/__init__.py | 9 | """The package indicator for wsgi.serve.publish.
Modules for making pushed data available via Earth Server.
"""
|
ResolveWang/algrithm_qa | refs/heads/master | 分类代表题目/字符串/排列组合问题.py | 1 | class Solution:
def conbition(self, input_str):
if not input_str:
return list()
length = len(input_str)
res = list()
for i in range(1, length+1):
self.pick_n_from_str(input_str, '', i, res)
return res
def pick_n_from_str(self, input_str, pre_str,... |
talishte/ctigre | refs/heads/master | env/lib/python2.7/site-packages/paramiko/server.py | 34 | # Copyright (C) 2003-2007 Robey Pointer <robeypointer@gmail.com>
#
# This file is part of paramiko.
#
# Paramiko is free software; you can redistribute it and/or modify it under the
# terms of the GNU Lesser General Public License as published by the Free
# Software Foundation; either version 2.1 of the License, or (a... |
RobGrimm/prediction_based | refs/heads/master | Eval/functions.py | 1 | import os
import numpy as np
from sklearn.manifold import TSNE
from sklearn.neighbors import KNeighborsClassifier
from sklearn.dummy import DummyClassifier
from sklearn.metrics import classification_report, f1_score
from matplotlib import pyplot
# set parameters for plots
pyplot.rcParams.update({'figure.figsize': (25,... |
ratschlab/ASP | refs/heads/master | applications/ocr/Ai.py | 1 | # File : $HeadURL$
# Version: $Id$
from modshogun import RealFeatures, Labels
from modshogun import GaussianKernel
from modshogun import GMNPSVM
import numpy as np
import gzip as gz
import pickle as pkl
import common as com
class Ai:
def __init__(self):
self.x = None
self.y = None
sel... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.