repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
bird50/birdproj | refs/heads/master | birdproj/profiles/models.py | 3 | import os
import uuid
from django.db import models
from django.utils import timezone
from django.contrib.auth.models import User
def avatar_upload(instance, filename):
ext = filename.split(".")[-1]
filename = "%s.%s" % (uuid.uuid4(), ext)
return os.path.join("avatars", filename)
class Profile(models.M... |
vineet-rh/incubator-airflow | refs/heads/master | airflow/operators/presto_to_mysql.py | 46 | # -*- 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 to in writing, software
... |
wethegang/wethegang.github.io | refs/heads/master | node_modules/npm-shrinkwrap/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/common_test.py | 2542 | #!/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.
"""Unit tests for the common.py file."""
import gyp.common
import unittest
import sys
class TestTopologicallySorted(unittest.TestCase):
... |
Bashar/django | refs/heads/master | tests/get_or_create/models.py | 90 | from __future__ import unicode_literals
from django.db import models
from django.utils.encoding import python_2_unicode_compatible
@python_2_unicode_compatible
class Person(models.Model):
first_name = models.CharField(max_length=100)
last_name = models.CharField(max_length=100)
birthday = models.DateFiel... |
amarandon/opencore | refs/heads/master | opencore/models/tests/test_forum.py | 4 | # Copyright (C) 2008-2009 Open Society Institute
# Thomas Moroz: tmoroz.org
# 2010-2011 Large Blue
# Fergus Doyle: fergus.doyle@largeblue.com
#
# This program is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License Version ... |
arista-eosplus/ansible | refs/heads/devel | lib/ansible/modules/notification/grove.py | 34 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# 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.
... |
rschnapka/odoo | refs/heads/7.0 | addons/base_gengo/wizard/__init__.py | 434 | # -*- 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... |
mesocentrefc/Janua-SMS | refs/heads/master | janua/activity/process_command.py | 1 | # -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*-
#
# Copyright (c) 2016 Cédric Clerget - HPC Center of Franche-Comté University
#
# This file is part of Janua-SMS
#
# http://github.com/mesocentrefc/Janua-SMS
#
# This program is free software: you can redistribute it and/or modify
# it under th... |
mgedmin/ansible | refs/heads/devel | lib/ansible/modules/network/netvisor/pn_ospf.py | 29 | #!/usr/bin/python
""" PN-CLI vrouter-ospf-add/remove """
#
# 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... |
Evervolv/android_kernel_htc_msm7x30-3.0 | refs/heads/mm-6.0 | tools/perf/scripts/python/sctop.py | 11180 | # system call top
# (c) 2010, Tom Zanussi <tzanussi@gmail.com>
# Licensed under the terms of the GNU GPL License version 2
#
# Periodically displays system-wide system call totals, broken down by
# syscall. If a [comm] arg is specified, only syscalls called by
# [comm] are displayed. If an [interval] arg is specified,... |
ron8hu/spark | refs/heads/master | examples/src/main/python/mllib/k_means_example.py | 123 | #
# 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... |
gautamMalu/rootfs_xen_arndale | refs/heads/master | usr/lib/python3/dist-packages/gi/_signalhelper.py | 6 | # -*- Mode: Python; py-indent-offset: 4 -*-
# pygobject - Python bindings for the GObject library
# Copyright (C) 2012 Simon Feltman
#
# gi/_signalhelper.py: GObject signal binding decorator object
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General ... |
TalShafir/ansible | refs/heads/devel | lib/ansible/modules/network/aci/aci_aep_to_domain.py | 15 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2017, Dag Wieers <dag@wieers.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_version': '1.1'... |
tersmitten/ansible | refs/heads/devel | lib/ansible/parsing/yaml/__init__.py | 2520 | # (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) an... |
JeremyViehland/bru | refs/heads/master | brulib/library.py | 3 | """ Helpers for accessing files in the ./library dir.
This dir has a $module/$version.bru+gyp structure, containing information
about how to download tar.gzs for (or hwo to clone) each module, as well
as for how to build the module's libs and some of its tests/examples.
"""
from __future__ import absolute_... |
GunoH/intellij-community | refs/heads/master | python/testData/codeInsight/smartEnter/multilineSetLiteral.py | 10 | xs = {
1<caret>
} |
CMPUT404F16T04/sturdy-octo-computing-machine | refs/heads/develop | mysite/manage.py | 709 | #!/usr/bin/env python
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "mysite.settings")
from django.core.management import execute_from_command_line
execute_from_command_line(sys.argv)
|
fieldaware/optimoroute | refs/heads/master | tests/test_encoders.py | 1 | # -*- coding: utf-8 -*-
import datetime
import json
from decimal import Decimal
from optimo.util import CoreOptimoEncoder
def test_coreoptimoencoder():
dt = datetime.datetime(year=2014, month=12, day=5, hour=8, minute=0)
dec = Decimal('4.5')
d = {'datetime': dt, 'a_decimal': dec, 'integer': 5}
asser... |
danielreed/python-hpOneView | refs/heads/master | examples/scripts/get-restores.py | 2 | #!/usr/bin/env python
###
# (C) Copyright (2012-2015) Hewlett Packard Enterprise Development LP
#
# 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 limita... |
thaleslima/WS-pedido-venda | refs/heads/master | pedidovenda/admin.py | 1 | from django.contrib import admin
# Register your models here.
from pedidovenda.models import Categoria
from pedidovenda.models import Produto
from pedidovenda.models import Pedido
from pedidovenda.models import ItemPedido
from pedidovenda.models import Mesa
from pedidovenda.models import Usuario
from django.contrib i... |
sarlalian/ansible | refs/heads/devel | lib/ansible/plugins/shell/csh.py | 92 | # (c) 2014, Chris Church <chris@ninemoreminutes.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... |
t11e/django | refs/heads/master | django/contrib/gis/geos/tests/test_mutable_list.py | 75 | # Copyright (c) 2008-2009 Aryeh Leib Taurog, http://www.aryehleib.com
# All rights reserved.
#
# Modified from original contribution by Aryeh Leib Taurog, which was
# released under the New BSD license.
import unittest
from django.contrib.gis.geos.mutable_list import ListMixin
class UserListA(ListMixin):
_mytype =... |
mathstuf/bugwarrior | refs/heads/develop | bugwarrior/services/githubutils.py | 2 | """ Tools for querying github.
I tried using pygithub3, but it really sucks.
"""
import requests
def _link_field_to_dict(field):
""" Utility for ripping apart github's Link header field.
It's kind of ugly.
"""
if not field:
return dict()
return dict([
(
part.split('... |
sankroh/satchmo | refs/heads/master | satchmo/payment/modules/cod/processor.py | 2 | """
Handle a cash-on-delivery payment.
"""
from django.utils.translation import ugettext as _
from satchmo.payment.utils import record_payment
class PaymentProcessor(object):
def __init__(self, settings):
self.settings = settings
def prepareData(self, order):
self.order = order
def proce... |
plumgrid/plumgrid-nova | refs/heads/master | nova/cmd/novnc.py | 12 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright (c) 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.a... |
mozilla/make.mozilla.org | refs/heads/master | vendor-local/lib/python/kombu/transport/virtual/exchange.py | 13 | """
kombu.transport.virtual.exchange
================================
Implementations of the standard exchanges defined
by the AMQ protocol (excluding the `headers` exchange).
:copyright: (c) 2009 - 2012 by Ask Solem.
:license: BSD, see LICENSE for more details.
"""
from __future__ import absolute_import
import re... |
srimai/odoo | refs/heads/8.0 | addons/document/__init__.py | 434 | # -*- 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... |
weleen/mxnet | refs/heads/master | example/caffe/caffe_net.py | 18 | # 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... |
adamwwt/chvac | refs/heads/master | venv/lib/python2.7/site-packages/pip/_vendor/requests/packages/chardet/mbcharsetprober.py | 2923 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Universal charset detector code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 2001
# the Initial Developer. All R... |
bhairavmehta95/flashcard-helper-alexa-skill | refs/heads/master | venv/lib/python2.7/site-packages/requests/packages/chardet/mbcharsetprober.py | 2923 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Universal charset detector code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 2001
# the Initial Developer. All R... |
oomlout/oomlout-OOMP | refs/heads/master | OOMPpart_RESE_0402_X_O471_67.py | 1 | import OOMP
newPart = OOMP.oompItem(9264)
newPart.addTag("oompType", "RESE")
newPart.addTag("oompSize", "0402")
newPart.addTag("oompColor", "X")
newPart.addTag("oompDesc", "O471")
newPart.addTag("oompIndex", "67")
OOMP.parts.append(newPart)
|
Fenixin/Minecraft-Region-Fixer | refs/heads/master | gui/version.py | 1 | '''
Created on 24/06/2014
@author: Alejandro
'''
version_string = "0.0.1"
version_numbers = version_string.split(".")
|
tmpgit/intellij-community | refs/heads/master | python/testData/mover/py950.py | 83 | class A:
def foo(self):
if a: pass
else: pass
a <caret>= 0
if a: pass
else: pass |
msporny/node-gyp | refs/heads/master | gyp/pylib/gyp/common_test.py | 2542 | #!/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.
"""Unit tests for the common.py file."""
import gyp.common
import unittest
import sys
class TestTopologicallySorted(unittest.TestCase):
... |
smkr/pyclipse | refs/heads/master | plugins/org.python.pydev.jython/Lib/zipfile.py | 8 | "Read and write ZIP files."
import struct, os, time
import binascii
try:
import zlib # We may need its compression method
except ImportError:
zlib = None
__all__ = ["BadZipfile", "error", "ZIP_STORED", "ZIP_DEFLATED", "is_zipfile",
"ZipInfo", "ZipFile", "PyZipFile"]
class BadZipfile(Exception):
... |
PyAndy/Py3NES | refs/heads/master | addressing.py | 1 | from typing import Optional
import numpy as np
import cpu as c
class Addressing(object):
data_length = 0
@classmethod
def get_instruction_length(cls):
return cls.data_length + 1
@classmethod
def get_offset(cls, cpu):
return 0
class XRegOffset(object):
@classmethod
def... |
fgirault/smeuhsocial | refs/heads/master | apps/smeuhoverride/tests.py | 1 | # -*- encoding: utf-8 -*-
from django.test import TestCase
from django.contrib.auth.models import User
class BaseTestCase(TestCase):
def setUp(self):
self.me = self.create_user('bob')
self.login(self.me.username)
self.her = self.create_user('alice')
def create_user(self, username='bo... |
JoannaKielas/wedding-gallery | refs/heads/master | photologue/models.py | 1 | import os
import random
from datetime import datetime
from inspect import isclass
import logging
from io import BytesIO
from importlib import import_module
import exifread
import unicodedata
from django.utils.timezone import now
from django.db import models
from django.db.models.signals import post_save
from django.co... |
fake-name/ReadableWebProxy | refs/heads/master | WebMirror/management/rss_parser_funcs/feed_parse_extractAcountrybetweenBlogspotCom.py | 1 |
def extractAcountrybetweenBlogspotCom(item):
'''
Parser for 'acountrybetween.blogspot.com'
'''
vol, chp, frag, postfix = extractVolChapterFragmentPostfix(item['title'])
if not (chp or vol) or "preview" in item['title'].lower():
return None
tagmap = [
('PRC', 'PRC', 'translated'),... |
xavierwu/scikit-learn | refs/heads/master | sklearn/tests/test_random_projection.py | 79 | from __future__ import division
import numpy as np
import scipy.sparse as sp
from sklearn.metrics import euclidean_distances
from sklearn.random_projection import johnson_lindenstrauss_min_dim
from sklearn.random_projection import gaussian_random_matrix
from sklearn.random_projection import sparse_random_matrix
from... |
charris/numpy | refs/heads/dependabot/pip/mypy-0.910 | numpy/core/einsumfunc.py | 9 | """
Implementation of optimized einsum.
"""
import itertools
import operator
from numpy.core.multiarray import c_einsum
from numpy.core.numeric import asanyarray, tensordot
from numpy.core.overrides import array_function_dispatch
__all__ = ['einsum', 'einsum_path']
einsum_symbols = 'abcdefghijklmnopqrstuvwxyzABCDEF... |
mxjl620/scikit-learn | refs/heads/master | examples/ensemble/plot_ensemble_oob.py | 259 | """
=============================
OOB Errors for Random Forests
=============================
The ``RandomForestClassifier`` is trained using *bootstrap aggregation*, where
each new tree is fit from a bootstrap sample of the training observations
:math:`z_i = (x_i, y_i)`. The *out-of-bag* (OOB) error is the average er... |
nerdyLawman/officeHack | refs/heads/master | src/game/game_messages.py | 1 | from libtcod import libtcodpy as libtcod
import gameconfig
# GAME MESSAGES
DEFINED_MESSAGES = {
'WELCOME_MESSAGE' : ['Welcome to your NEW JOB.', libtcod.flame],
'LEVEL_REST_MESSAGE' : ['You take a moment to lay low.', libtcod.sky],
'LEVEL_CONTINUE_MESSAGE' : ['You decide to continue probing deeper.', libtc... |
Arc-Team/android_kernel_htc_holiday | refs/heads/cm-12.0 | tools/perf/scripts/python/sctop.py | 11180 | # system call top
# (c) 2010, Tom Zanussi <tzanussi@gmail.com>
# Licensed under the terms of the GNU GPL License version 2
#
# Periodically displays system-wide system call totals, broken down by
# syscall. If a [comm] arg is specified, only syscalls called by
# [comm] are displayed. If an [interval] arg is specified,... |
wooga/airflow | refs/heads/master | airflow/executors/celery_executor.py | 1 | #
# 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... |
krunal3103/servo | refs/heads/master | tests/wpt/css-tests/css-text-decor-3_dev/xhtml1/support/generate-text-emphasis-line-height-tests.py | 829 | #!/usr/bin/env python
# - * - coding: UTF-8 - * -
"""
This script generates tests text-emphasis-line-height-001 ~ 004 except
001z. They test the line height expansion in different directions. This
script outputs a list of all tests it generated in the format of Mozilla
reftest.list to the stdout.
"""
from __future__ ... |
ntuecon/server | refs/heads/master | pyenv/Lib/site-packages/win32com/test/testDictionary.py | 4 | # testDictionary.py
#
import sys
import win32com.server.util
import win32com.test.util
import win32com.client
import traceback
import pythoncom
import pywintypes
import winerror
import unittest
error = "dictionary test error"
def MakeTestDictionary():
return win32com.client.Dispatch("Python.Dicti... |
Danath/gyp | refs/heads/master | test/lib/TestCommon.py | 307 | """
TestCommon.py: a testing framework for commands and scripts
with commonly useful error handling
The TestCommon module provides a simple, high-level interface for writing
tests of executable commands and scripts, especially commands and scripts
that interact with the file system. All methods throw... |
jyap808/jumbucks | refs/heads/master | share/qt/extract_strings_qt.py | 1294 | #!/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
OUT_CPP="src/qt/bitcoinstrings.cpp"
EMPTY=['""']
def parse_po(text):
"""
Parse 'po' format produced by xgettext.
Ret... |
takaakiaoki/PyFoam | refs/heads/master | examples/TestRunner/runIcoFoamCavityParallel.py | 3 | #! /usr/bin/env python
from runIcoFoamCavity import PlainIcoFoamCavity
from PyFoam.Applications.Decomposer import Decomposer
class ParallelIcoFoamCavity(PlainIcoFoamCavity):
def init(self):
self.setParameters(parallel=True,
autoDecompose=False,
nrCpus=... |
spthaolt/socorro | refs/heads/master | socorro/webapi/servers.py | 8 | # This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
import web
import os
from socorro.webapi.classPartial import classWithPartialInit
from configman import Namespace, Req... |
bastianh/swampdragon | refs/heads/master | swampdragon/serializers/serializer_tools.py | 9 | from collections import namedtuple
from django.db.models.fields.related import ForeignKey, ReverseSingleRelatedObjectDescriptor, \
ManyRelatedObjectsDescriptor, ReverseManyRelatedObjectsDescriptor, ForeignRelatedObjectsDescriptor, \
SingleRelatedObjectDescriptor
# from django.db.models.related import RelatedObj... |
kenshay/ImageScripter | refs/heads/master | ProgramData/SystemFiles/Python/Lib/site-packages/win32/lib/sspicon.py | 24 | # Generated by h2py from c:\microsoft sdk\include\sspi.h
ISSP_LEVEL = 32
ISSP_MODE = 1
ISSP_LEVEL = 32
ISSP_MODE = 0
ISSP_LEVEL = 32
ISSP_MODE = 1
def SEC_SUCCESS(Status): return ((Status) >= 0)
SECPKG_FLAG_INTEGRITY = 1
SECPKG_FLAG_PRIVACY = 2
SECPKG_FLAG_TOKEN_ONLY = 4
SECPKG_FLAG_DATAGRAM = 8
SECPKG_FLAG_CONNECTION... |
ecometrica/django-wapiti | refs/heads/master | wapiti/parsers.py | 1 | # Copyright (c) Ecometrica. All rights reserved.
# Distributed under the BSD license. See LICENSE for details.
import datetime as dt
from decimal import Decimal
from inspect import getargspec
import json
import re
import warnings
from django.db import models
from django.db.models.fields.files import FieldFile
from dja... |
Rawk/xbmc | refs/heads/master | tools/EventClients/Clients/PS3 BD Remote/ps3_remote.py | 138 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright (C) 2008-2013 Team XBMC
#
# 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) ... |
jabesq/home-assistant | refs/heads/dev | homeassistant/components/websocket_api/permissions.py | 2 | """Permission constants for the websocket API.
Separate file to avoid circular imports.
"""
from homeassistant.const import (
EVENT_COMPONENT_LOADED,
EVENT_SERVICE_REGISTERED,
EVENT_SERVICE_REMOVED,
EVENT_STATE_CHANGED,
EVENT_THEMES_UPDATED)
from homeassistant.components.persistent_notification imp... |
aiyyoi/DevFest-MaxBond | refs/heads/master | MaxBond/env/lib/python2.7/site-packages/pymysql/tests/thirdparty/test_MySQLdb/dbapi20.py | 29 | #!/usr/bin/env python
''' Python DB API 2.0 driver compliance unit test suite.
This software is Public Domain and may be used without restrictions.
"Now we have booze and barflies entering the discussion, plus rumours of
DBAs on drugs... and I won't tell you what flashes through my mind each
time I read the ... |
cogeorg/black_rhino | refs/heads/master | examples/firesales_SA/networkx/generators/hybrid.py | 47 | """
Hybrid
"""
__author__ = """Aric Hagberg (hagberg@lanl.gov)\nDan Schult (dschult@colgate.edu)"""
# Copyright (C) 2004-2008 by
# Aric Hagberg <hagberg@lanl.gov>
# Dan Schult <dschult@colgate.edu>
# Pieter Swart <swart@lanl.gov>
# All rights reserved.
# BSD license.
_all__ = ['kl_connected_subgra... |
iDTLabssl/kitsune | refs/heads/master | kitsune/messages/tests/test_views.py | 15 | from multidb.middleware import PINNING_COOKIE
from nose.tools import eq_
from kitsune.messages.models import InboxMessage, OutboxMessage
from kitsune.sumo.tests import TestCase, LocalizingClient
from kitsune.sumo.urlresolvers import reverse
from kitsune.users.tests import user
class ReadMessageTests(TestCase):
... |
thdb-theo/Zombie-Survival | refs/heads/master | tests/test_baseclass.py | 1 | import unittest
import sys
import os
sys.path.insert(0, os.getcwd() + "/src")
from baseclass import BaseClass
from tile import Tile
from maths import Vector
class BaseClassTest(unittest.TestCase):
def setUpClass():
Tile.create()
def tearDownClass():
Tile.delete()
def test... |
cjaymes/pyscap | refs/heads/master | src/scap/model/oval_5/defs/GlobToRegexFunctionType.py | 1 | # Copyright 2016 Casey Jaymes
# This file is part of PySCAP.
#
# PySCAP 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.
#
# PySCAP is ... |
fungxu/Arduino | refs/heads/esp8266 | arduino-core/src/processing/app/i18n/python/requests/packages/charade/utf8prober.py | 2918 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is mozilla.org code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998
# the Initial Developer. All Rights Reserved.
#
# Con... |
lucafavatella/intellij-community | refs/heads/cli-wip | python/testData/refactoring/move/qualifiedImport/after/src/c.py | 79 | import a
import b
def main():
print(b.f(42))
|
tiagochiavericosta/edx-platform | refs/heads/master | common/djangoapps/course_modes/migrations/0004_auto__add_field_coursemode_expiration_date.py | 114 | # -*- coding: 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 'CourseMode.expiration_date'
db.add_column('course_modes_coursemode', 'expiration_date',
... |
Kortemme-Lab/klab | refs/heads/master | klab/bio/openbabel_util.py | 1 | import openbabel as ob
def read_molecules(filepath, single = False):
in_format = filepath.strip().split( '.' )[-1]
obconversion = ob.OBConversion()
obconversion.SetInFormat( in_format )
obmol = ob.OBMol()
molecules = []
notatend = obconversion.ReadFile( obmol, filepath )
while notatend:
... |
lakshayg/tensorflow | refs/heads/master | tensorflow/python/kernel_tests/conv2d_transpose_test.py | 22 | # 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... |
brianv0/sqlalchemy | refs/heads/master | lib/sqlalchemy/ext/baked.py | 40 | # sqlalchemy/ext/baked.py
# Copyright (C) 2005-2015 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
"""Baked query extension.
Provides a creational pattern for the :class:`.que... |
piergiaj/caffe-to-theano | refs/heads/master | downsample.py | 1 | """ Ops for downsampling images.
Planned:
DownsampleFactorMax, DownsampleAvg, DownsampleSoftmax.
"""
# This file should move along with conv.py
import __builtin__
import numpy
import theano
from theano import gof, Op, tensor, Variable, Apply
def max_pool2D(*args, **kwargs):
import sys
print >> sys.stderr,... |
paulsheridan/django-portfolio | refs/heads/master | portfolio/projects/migrations/0007_auto_20160620_2131.py | 1 | # -*- coding: utf-8 -*-
# Generated by Django 1.9.6 on 2016-06-20 21:31
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('projects', '0006_auto_20160618_0323'),
]
operations = [
migrations.AlterFiel... |
liikGit/MissionPlanner | refs/heads/master | Lib/site-packages/scipy/optimize/nnls.py | 51 | import _nnls
from numpy import asarray_chkfinite, zeros, double
def nnls(A,b):
"""
Solve ``argmin_x || Ax - b ||_2`` for ``x>=0``.
Parameters
----------
A : ndarray
Matrix ``A`` as shown above.
b : ndarray
Right-hand side vector.
Returns
-------
x : ndarray
... |
dinhoabreu/yowsup | refs/heads/master | yowsup/env/__init__.py | 39 | from .env_android import AndroidYowsupEnv
from .env_s40 import S40YowsupEnv
CURRENT_ENV = S40YowsupEnv()
|
fernandezcuesta/ansible | refs/heads/devel | lib/ansible/modules/network/cloudengine/ce_snmp_contact.py | 39 | #!/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 distribut... |
Lab41/pelops | refs/heads/master | pelops/training/utils.py | 3 | from pelops.datasets.chip import ChipDataset
from pelops.utils import SetType
import json
import os
import os.path
import numpy as np
from keras.preprocessing import image
from keras.applications.resnet50 import preprocess_input
import random
def tuple_to_string(tup):
"""Convert a tuple (or other iterable, we are... |
vheon/YouCompleteMe | refs/heads/master | python/ycm/tests/server_test.py | 3 | # Copyright (C) 2016 YouCompleteMe contributors
#
# This file is part of YouCompleteMe.
#
# YouCompleteMe 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) ... |
iancarv/EPBuildSystem | refs/heads/master | testes/tester.py | 2 | from testes.teste import Teste, FalhouNoTeste
class Tester(object):
def __init__(self):
teste = Teste()
self.testes = [teste]
def test(self):
for teste in self.testes:
try:
teste.run()
except FalhouNoTeste:
print('O teste falhou! =(')
return False
print('O teste passou com sucesso!')
r... |
diegocepedaw/oncall | refs/heads/master | src/oncall/api/v0/team_admins.py | 1 | # Copyright (c) LinkedIn Corporation. All rights reserved. Licensed under the BSD-2 Clause license.
# See LICENSE in the project root for license information.
from urllib.parse import unquote
from falcon import HTTPError, HTTP_201, HTTPBadRequest
from ujson import dumps as json_dumps
from ... import db
from .users imp... |
DDEFISHER/servo | refs/heads/master | tests/wpt/web-platform-tests/fetch/api/resources/method.py | 161 | def main(request, response):
headers = []
if "cors" in request.GET:
headers.append(("Access-Control-Allow-Origin", "*"))
headers.append(("Access-Control-Allow-Credentials", "true"))
headers.append(("Access-Control-Allow-Methods", "GET, POST, PUT, FOO"))
headers.append(("Access-Co... |
csuttles/utils | refs/heads/master | python/todo-api/flask/lib/python2.7/site-packages/wheel/signatures/ed25519py.py | 565 | # -*- coding: utf-8 -*-
import warnings
import os
from collections import namedtuple
from . import djbec
__all__ = ['crypto_sign', 'crypto_sign_open', 'crypto_sign_keypair', 'Keypair',
'PUBLICKEYBYTES', 'SECRETKEYBYTES', 'SIGNATUREBYTES']
PUBLICKEYBYTES=32
SECRETKEYBYTES=64
SIGNATUREBYTES=64
Keypair = n... |
mogoweb/webkit_for_android5.1 | refs/heads/master | webkit/Tools/Scripts/webkitpy/common/prettypatch.py | 140 | # Copyright (c) 2010 Google Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the ... |
ReachingOut/unisubs | refs/heads/staging | apps/webdriver_testing/check_teams/test_dashboard.py | 5 | # -*- coding: utf-8 -*-
import datetime
import os
from subtitles import pipeline
from django.core import management
from utils.factories import *
from webdriver_testing.webdriver_base import WebdriverTestCase
from webdriver_testing import data_helpers
from webdriver_testing.pages.site_pages import editor_page
from we... |
zoeyangyy/event-extraction | refs/heads/master | bishi/toutiao1.py | 1 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# @Time : 2018/5/12 上午10:04
# @Author : Zoe
# @File : toutiao1.py
# @Description :
import re
line = input().strip()
article = ''
try:
while line:
article += line
line = input().strip()
except EOFError:
pass
print(article)
patter... |
alshedivat/tensorflow | refs/heads/master | tensorflow/python/estimator/keras.py | 35 | # 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... |
s-gv/rnicu-webapp | refs/heads/master | stream-plot/src/galry/managers/mesh_manager.py | 2 | from galry import NavigationEventProcessor, InteractionManager, \
PaintManager, \
GridEventProcessor, scale_matrix, rotation_matrix, translation_matrix, \
MeshNavigationEventProcessor
from .default_manager import DefaultPaintManager, DefaultInteractionManager, \
DefaultBindings
from .plot_manager import... |
kirbyfan64/shedskin | refs/heads/master | examples/ac_encode.py | 6 | ## Arithmetic coding compressor and uncompressor for binary source.
## This is a cleaned-up version of AEncode.py
## (c) David MacKay - Free software. License: GPL
import os
BETA0=1;BETA1=1 ## default prior distribution
M = 30 ; ONE = (1<<M) ; HALF = (1<<(M-1))
QUARTER = (1<<(M-2)) ; THREEQU = HALF+QUARTER
def clear... |
Myasuka/scikit-learn | refs/heads/master | doc/tutorial/text_analytics/skeletons/exercise_01_language_train_model.py | 254 | """Build a language detector model
The goal of this exercise is to train a linear classifier on text features
that represent sequences of up to 3 consecutive characters so as to be
recognize natural languages by using the frequencies of short character
sequences as 'fingerprints'.
"""
# Author: Olivier Grisel <olivie... |
navnm/green-hacker | refs/heads/master | examples/swift_rockstar.py | 20 | from rockstar import RockStar
swift_code = "println('Hello world')"
rock_it_bro = RockStar(days=400, file_name='hello.swift', code=swift_code)
rock_it_bro.make_me_a_rockstar()
|
keerts/home-assistant | refs/heads/dev | tests/components/light/__init__.py | 104 | """The tests for Light platforms."""
|
chdecultot/frappe | refs/heads/develop | frappe/patches/v4_1/file_manager_fix.py | 16 | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
from __future__ import unicode_literals, print_function
import frappe
import os
from frappe.utils.file_manager import get_content_hash, get_file, get_file_name
from frappe.utils import get_files_path, get_site_path
# ... |
odoousers2014/addons-yelizariev | refs/heads/8.0 | res_users_signature_hr/__openerp__.py | 7 | {
'name': "Signature templates for user emails (HR)",
'version': '1.0.0',
'author': 'Ivan Yelizariev',
'category': 'Custom',
'website': 'https://yelizariev.github.io',
'depends': ['res_users_signature', 'hr'],
'data': [
'views.xml',
],
'installable': True,
'auto_insta... |
nicobustillos/odoo | refs/heads/8.0 | addons/mrp/report/workcenter_load.py | 437 | # -*- 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... |
mKeRix/home-assistant | refs/heads/dev | tests/components/hue/test_device_trigger.py | 12 | """The tests for Philips Hue device triggers."""
import pytest
from homeassistant.components import hue
import homeassistant.components.automation as automation
from homeassistant.components.hue import device_trigger
from homeassistant.setup import async_setup_component
from .conftest import setup_bridge_for_sensors ... |
Plexxi/st2 | refs/heads/master | st2tests/st2tests/mocks/action.py | 3 | # Copyright 2020 The StackStorm Authors.
# Copyright 2019 Extreme Networks, 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 ... |
Tinkerforge/brickv | refs/heads/master | src/brickv/plugin_system/plugins/red/program_info_octave.py | 1 | # -*- coding: utf-8 -*-
"""
RED Plugin
Copyright (C) 2014-2015 Matthias Bolte <matthias@tinkerforge.com>
program_info_octave.py: Program Octave Info Widget
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... |
MarkTseng/django-farmersale | refs/heads/master | farmersale-env/lib/python2.7/site-packages/django/contrib/auth/tests/test_tokens.py | 117 | from datetime import date, timedelta
import sys
import unittest
from django.conf import settings
from django.contrib.auth.models import User
from django.contrib.auth.tokens import PasswordResetTokenGenerator
from django.contrib.auth.tests.utils import skipIfCustomUser
from django.test import TestCase
@skipIfCustomUs... |
puckipedia/youtube-dl | refs/heads/master | youtube_dl/extractor/escapist.py | 98 | from __future__ import unicode_literals
import json
from .common import InfoExtractor
from ..compat import compat_urllib_request
from ..utils import (
determine_ext,
clean_html,
int_or_none,
float_or_none,
)
def _decrypt_config(key, string):
a = ''
i = ''
r = ''
while len(a) < (len... |
logicus4078/vertx-web | refs/heads/master | src/test/sockjs-protocol/venv/lib/python2.7/site-packages/pip/_vendor/requests/packages/urllib3/poolmanager.py | 550 | # urllib3/poolmanager.py
# Copyright 2008-2014 Andrey Petrov and contributors (see CONTRIBUTORS.txt)
#
# This module is part of urllib3 and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
import logging
try: # Python 3
from urllib.parse import urljoin
except ImportError:
... |
eranchetz/nupic | refs/heads/master | external/linux32/lib/python2.6/site-packages/pylab.py | 105 | from matplotlib.pylab import *
import matplotlib.pylab
__doc__ = matplotlib.pylab.__doc__
|
damoguyan8844/TeamTalk | refs/heads/master | win-client/3rdParty/src/json/test/runjsontests.py | 175 | import sys
import os
import os.path
from glob import glob
import optparse
VALGRIND_CMD = 'valgrind --tool=memcheck --leak-check=yes --undef-value-errors=yes '
def compareOutputs( expected, actual, message ):
expected = expected.strip().replace('\r','').split('\n')
actual = actual.strip().replace('\r','').spli... |
hynnet/openwrt-mt7620 | refs/heads/master | staging_dir/host/lib/python2.7/multiprocessing/reduction.py | 217 | #
# Module to allow connection and socket objects to be transferred
# between processes
#
# multiprocessing/reduction.py
#
# Copyright (c) 2006-2008, R Oudkerk
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditio... |
chafique-delli/OpenUpgrade | refs/heads/master | addons/website_certification/__openerp__.py | 64 | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-TODAY OpenERP S.A. <http://www.openerp.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.