repo_name stringlengths 6 100 | path stringlengths 4 294 | copies stringlengths 1 5 | size stringlengths 4 6 | content stringlengths 606 896k | license stringclasses 15
values |
|---|---|---|---|---|---|
emirot/codefights | interviewPractice/isListPalindrome.py | 1 | 1577 | # Definition for singly-linked list:
# class ListNode(object):
# def __init__(self, x):
# self.value = x
# self.next = None
#
def isListPalindrome(l):
tmp = l
list_len = 0
left = 0
right = 0
while tmp:
list_len += 1
tmp = tmp.next
tmp = l
if list_len == 0 or ... | apache-2.0 |
hehongliang/tensorflow | tensorflow/contrib/eager/python/examples/revnet/main_estimator_tpu.py | 18 | 15642 | # 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... | apache-2.0 |
onitake/ansible | lib/ansible/modules/network/nxos/nxos_ospf.py | 100 | 4148 | #!/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... | gpl-3.0 |
lmazuel/azure-sdk-for-python | azure-batch/azure/batch/models/pool_evaluate_auto_scale_options.py | 1 | 1773 | # 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 ... | mit |
WillGuan105/django | tests/gis_tests/test_geoip2.py | 75 | 6007 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import os
import unittest
from unittest import skipUnless
from django.conf import settings
from django.contrib.gis.geoip2 import HAS_GEOIP2
from django.contrib.gis.geos import HAS_GEOS, GEOSGeometry
from django.test import mock
from django.utils import s... | bsd-3-clause |
bartscheers/tkp | tkp/db/quality.py | 2 | 2082 | """
check image quality
"""
import logging
from collections import namedtuple
import tkp.db
logger = logging.getLogger(__name__)
# TODO: need to think of a way to sync this with tkp/db/tables/rejection.sql
RejectReason = namedtuple('RejectReason', 'id desc')
reason = {
'rms': RejectReason(id=0, desc='RMS invalid... | bsd-2-clause |
Robobench/rapman-subuser | logic/subuserCommands/subuser.py | 1 | 5001 | #!/usr/bin/env python
# This file should be compatible with both Python 2 and 3.
# If it is not, please file a bug report.
import pathConfig
#external imports
import sys,optparse
#internal imports
import subuserlib.classes.user,subuserlib.commandLineArguments,subuserlib.subuser
def parseCliArgs(sysargs):
usage = "u... | lgpl-3.0 |
jean/sentry | src/sentry/features/__init__.py | 1 | 1610 | from __future__ import absolute_import
from .base import * # NOQA
from .handler import * # NOQA
from .manager import * # NOQA
default_manager = FeatureManager() # NOQA
default_manager.add('auth:register')
default_manager.add('organizations:api-keys', OrganizationFeature) # NOQA
default_manager.add('organizations... | bsd-3-clause |
psanxiao/gtranslator | plugins/charmap/charmap/panel.py | 3 | 2371 | # -*- coding: utf-8 -*-
#
# Copyright (C) 2006 Steve Frécinaux <steve@istique.net>
# 2010 Ignacio Casal Quinteiro <icq@gnome.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, ... | gpl-3.0 |
clovett/MissionPlanner | Lib/MimeWriter.py | 67 | 6668 | """Generic MIME writer.
This module defines the class MimeWriter. The MimeWriter class implements
a basic formatter for creating MIME multi-part files. It doesn't seek around
the output file nor does it use large amounts of buffer space. You must write
the parts out in the order that they should occur in the fi... | gpl-3.0 |
acuicultor/android_kernel_oneplus_msm8974 | tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/Util.py | 12527 | 1935 | # Util.py - Python extension for perf script, miscellaneous utility code
#
# 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.
import errno, os
FUTEX_WAIT = 0... | gpl-2.0 |
ArcherSys/ArcherSys | Lib/site-packages/github/HookDescription.py | 73 | 3481 | # -*- coding: utf-8 -*-
# ########################## Copyrights and license ############################
# #
# Copyright 2012 Vincent Jacques <vincent@vincent-jacques.net> #
# Copyright 2012 Zearin <zearin@gonk.net> ... | mit |
ppapadeas/wprevents | vendor-local/lib/python/unidecode/x089.py | 252 | 4628 | data = (
'Ji ', # 0x00
'Zhi ', # 0x01
'Gua ', # 0x02
'Ken ', # 0x03
'Che ', # 0x04
'Ti ', # 0x05
'Ti ', # 0x06
'Fu ', # 0x07
'Chong ', # 0x08
'Xie ', # 0x09
'Bian ', # 0x0a
'Die ', # 0x0b
'Kun ', # 0x0c
'Duan ', # 0x0d
'Xiu ', # 0x0e
'Xiu ', # 0x0f
'He ', # 0x10
'Yuan ... | bsd-3-clause |
srinathv/vispy | examples/basics/scene/grid.py | 17 | 2786 | # -*- coding: utf-8 -*-
# vispy: gallery 30
# -----------------------------------------------------------------------------
# Copyright (c) 2015, Vispy Development Team. All Rights Reserved.
# Distributed under the (new) BSD License. See LICENSE.txt for more info.
# -----------------------------------------------------... | bsd-3-clause |
TeslaProject/external_chromium_org | tools/gyp-explain.py | 153 | 3035 | #!/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.
"""Prints paths between gyp targets.
"""
import json
import os
import sys
import time
from collections import deque
def usage():... | bsd-3-clause |
saulshanabrook/pushgp.py | setup.py | 1 | 1109 | from setuptools import setup, find_packages
setup(
name='pushgp',
version='0.1.0',
description='Use genetic programming, implemented with Push, for machine learning.',
long_description=open('README.rst').read(),
author='Saul Shanabrook',
author_email='s.shanabrook@gmail.com',
url='https://g... | bsd-3-clause |
justathoughtor2/atomicApe | cygwin/lib/python2.7/site-packages/unidecode/x09a.py | 253 | 4623 | data = (
'E ', # 0x00
'Cheng ', # 0x01
'Xin ', # 0x02
'Ai ', # 0x03
'Lu ', # 0x04
'Zhui ', # 0x05
'Zhou ', # 0x06
'She ', # 0x07
'Pian ', # 0x08
'Kun ', # 0x09
'Tao ', # 0x0a
'Lai ', # 0x0b
'Zong ', # 0x0c
'Ke ', # 0x0d
'Qi ', # 0x0e
'Qi ', # 0x0f
'Yan ', # 0x10
'Fei '... | gpl-3.0 |
prakritish/ansible | lib/ansible/modules/cloud/amazon/ec2_vpc_nat_gateway_facts.py | 10 | 4604 | #!/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... | gpl-3.0 |
batxes/4c2vhic | Six_mouse_models/Six_mouse_models_final_output_0.2_-0.1_11000/Six_mouse_models48513.py | 2 | 18207 | import _surface
import chimera
try:
import chimera.runCommand
except:
pass
from VolumePath import markerset as ms
try:
from VolumePath import Marker_Set, Link
new_marker_set=Marker_Set
except:
from VolumePath import volume_path_dialog
d= volume_path_dialog(True)
new_marker_set= d.new_marker_set
marker_set... | gpl-3.0 |
Anonymous-X6/django | django/conf/locale/sk/formats.py | 504 | 1173 | # -*- encoding: utf-8 -*-
# This file is distributed under the same license as the Django package.
#
from __future__ import unicode_literals
# The *_FORMAT strings use the Django date format syntax,
# see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
DATE_FORMAT = 'j. F Y'
TIME_FORMAT = 'G:i'
DATET... | bsd-3-clause |
JensRantil/ansible | lib/ansible/runner/lookup_plugins/inventory_hostnames.py | 173 | 1756 | # (c) 2012, Michael DeHaan <michael.dehaan@gmail.com>
# (c) 2013, Steven Dossett <sdossett@panath.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 versio... | gpl-3.0 |
moondrop-entertainment/django-nonrel-drawp | tests/regressiontests/admin_widgets/tests.py | 49 | 15099 | # encoding: utf-8
from datetime import datetime
from django import forms
from django.conf import settings
from django.contrib import admin
from django.contrib.admin import widgets
from django.contrib.admin.widgets import (FilteredSelectMultiple,
AdminSplitDateTime, AdminFileWidget, ForeignKeyRawIdWidget, AdminRad... | bsd-3-clause |
horatiulefter/pokemon | pogom/pgoapi/rpc_api.py | 33 | 8817 | """
pgoapi - Pokemon Go API
Copyright (c) 2016 tjado <https://github.com/tejado>
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... | agpl-3.0 |
AirChen/MachineLearningDoc | collective_intelligence/chapter_3/Imaging-1.1.7/PIL/ImageDraw2.py | 40 | 3155 | #
# The Python Imaging Library
# $Id$
#
# WCK-style drawing interface operations
#
# History:
# 2003-12-07 fl created
# 2005-05-15 fl updated; added to PIL as ImageDraw2
# 2005-05-15 fl added text support
# 2005-05-20 fl added arc/chord/pieslice support
#
# Copyright (c) 2003-2005 by Secret Labs AB
# Copyright ... | mit |
gsehub/edx-platform | lms/djangoapps/courseware/tests/test_about.py | 8 | 27678 | """
Test the about xblock
"""
import datetime
import ddt
import pytz
from ccx_keys.locator import CCXLocator
from django.conf import settings
from django.urls import reverse
from django.test.utils import override_settings
from milestones.tests.utils import MilestonesTestCaseMixin
from mock import patch
from nose.plugin... | agpl-3.0 |
osungjin/livechat | lib/flask/sessions.py | 348 | 12882 | # -*- coding: utf-8 -*-
"""
flask.sessions
~~~~~~~~~~~~~~
Implements cookie based sessions based on itsdangerous.
:copyright: (c) 2012 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
import uuid
import hashlib
from datetime import datetime
from werkzeug.http import http_date, ... | apache-2.0 |
JakeBrand/CMPUT410-E6 | v1/lib/python2.7/site-packages/django/core/management/commands/syncdb.py | 49 | 2048 | import warnings
from optparse import make_option
from django.apps import apps
from django.contrib.auth import get_user_model
from django.db import DEFAULT_DB_ALIAS
from django.core.management import call_command
from django.core.management.base import NoArgsCommand
from django.utils.deprecation import RemovedInDjango1... | apache-2.0 |
kerzhner/airflow | airflow/contrib/hooks/bigquery_hook.py | 2 | 35738 | # -*- 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
... | apache-2.0 |
llvm-mirror/lldb | packages/Python/lldbsuite/test/concurrent_base.py | 5 | 12391 | """
A stress-test of sorts for LLDB's handling of threads in the inferior.
This test sets a breakpoint in the main thread where test parameters (numbers of
threads) can be adjusted, runs the inferior to that point, and modifies the
locals that control the event thread counts. This test also sets a breakpoint in
breakp... | apache-2.0 |
stansonhealth/ansible-modules-core | cloud/openstack/os_security_group.py | 57 | 4292 | #!/usr/bin/python
# Copyright (c) 2015 Hewlett-Packard Development Company, L.P.
# Copyright (c) 2013, Benno Joy <benno@ansible.com>
#
# This module 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 vers... | gpl-3.0 |
nagnath006/Soccer-Analytics | Soccer-Analytics/Lib/encodings/cp1252.py | 594 | 13767 | """ Python Character Mapping Codec cp1252 generated from 'MAPPINGS/VENDORS/MICSFT/WINDOWS/CP1252.TXT' with gencodec.py.
"""#"
import codecs
### Codec APIs
class Codec(codecs.Codec):
def encode(self,input,errors='strict'):
return codecs.charmap_encode(input,errors,encoding_table)
def decode(self,in... | mpl-2.0 |
gtamazian/bioformats | bioformats/eggnog.py | 1 | 4319 | #!/usr/bin/env python3
# -*- coding: utf8 -*-
# Gaik Tamazian, 2019
# mail (at) gtamazian (dot) com
"""Routines for reading, writing and processing eggNOG output files."""
import sys
from . import gff3
from . import snpeff
from . import vcf
assert sys.version_info >= (3, 5), "Python 3.5 or higher required"
def lo... | mit |
stormi/tsunami | src/secondaires/exportaide/config.py | 1 | 2088 | # -*-coding:Utf-8 -*
# Copyright (c) 2013 LE GOFF Vincent
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright notice, this
# lis... | bsd-3-clause |
mbareta/edx-platform-ft | common/test/acceptance/fixtures/discussion.py | 13 | 4618 | """
Tools for creating discussion content fixture data.
"""
from datetime import datetime
import json
import factory
import requests
from common.test.acceptance.fixtures import COMMENTS_STUB_URL
class ContentFactory(factory.Factory):
class Meta(object):
model = dict
id = None
user_id = "1234"
... | agpl-3.0 |
willcode/gnuradio | gr-digital/python/digital/generic_mod_demod.py | 6 | 16852 | #
# Copyright 2005,2006,2007,2009,2011 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# SPDX-License-Identifier: GPL-3.0-or-later
#
#
"""
Generic modulation and demodulation.
"""
# See gnuradio-examples/python/digital for examples
from gnuradio import gr, blocks, filter, analog
from .modulation... | gpl-3.0 |
epic-math/sfvue2 | resources/migrations/0002_auto__add_field_topic_official_website.py | 4 | 6831 | # -*- 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 'Topic.official_website'
db.add_column('resources_topic', 'official_website',
... | mit |
amdouglas/OpenPNM | test/integration/test_source1.py | 1 | 4317 | import OpenPNM
import scipy as sp
print('-----> Using OpenPNM version: '+OpenPNM.__version__)
pn = OpenPNM.Network.Cubic(shape=[10,10,40],spacing=0.0001)
pn.add_boundaries()
Ps = pn.pores('boundary',mode='not')
Ts = pn.find_neighbor_throats(pores=Ps,mode='intersection',flatten=True)
geom = OpenPNM.Geometry.Toray090(ne... | mit |
asnorkin/sentiment_analysis | site/lib/python2.7/site-packages/scipy/sparse/data.py | 9 | 12278 | """Base class for sparse matrice with a .data attribute
subclasses must provide a _with_data() method that
creates a new matrix with the same sparsity pattern
as self but with a different data array
"""
from __future__ import division, print_function, absolute_import
import numpy as np
from .base impor... | mit |
Samuel789/MediPi | MedManagementWeb/env/lib/python3.5/site-packages/pkg_resources/__init__.py | 59 | 101373 | """
Package resource API
--------------------
A resource is a logical file contained within a package, or a logical
subdirectory thereof. The package resource API expects resource names
to have their path parts separated with ``/``, *not* whatever the local
path separator is. Do not use os.path operations to manipul... | apache-2.0 |
ntuecon/server | pyenv/Lib/site-packages/twisted/words/test/test_basechat.py | 63 | 2504 | # Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Tests for L{twisted.words.im.basechat}.
"""
from twisted.trial import unittest
from twisted.words.im import basechat, basesupport
class ChatUITests(unittest.TestCase):
"""
Tests for the L{basechat.ChatUI} chat client.
"""
de... | bsd-3-clause |
saisaizhang/Food | flask/lib/python2.7/site-packages/coverage/backward.py | 211 | 5187 | """Add things to old Pythons so I can pretend they are newer."""
# This file does lots of tricky stuff, so disable a bunch of lintisms.
# pylint: disable=F0401,W0611,W0622
# F0401: Unable to import blah
# W0611: Unused import blah
# W0622: Redefining built-in blah
import os, re, sys
# Python 2.3 doesn't have `set`
t... | bsd-3-clause |
luwei0917/awsemmd_script | script/BuildAllAtomsFromLammps_seq.py | 1 | 12949 | #!/usr/bin/python
# ----------------------------------------------------------------------
# Copyright (2010) Aram Davtyan and Garegin Papoian
# Papoian's Group, University of Maryland at Collage Park
# http://papoian.chem.umd.edu/
# Last Update: 03/04/2011
# ---------------------------------------------------------... | mit |
qsorix/django-rest-framework | tests/conftest.py | 84 | 1809 | def pytest_configure():
from django.conf import settings
settings.configure(
DEBUG_PROPAGATE_EXCEPTIONS=True,
DATABASES={'default': {'ENGINE': 'django.db.backends.sqlite3',
'NAME': ':memory:'}},
SITE_ID=1,
SECRET_KEY='not very secret in tests',
... | bsd-2-clause |
tsiegleauq/OpenSlides | server/tests/unit/config/test_api.py | 7 | 1334 | from typing import cast
from unittest import TestCase
from unittest.mock import patch
from openslides.core.config import ConfigVariable, ConfigVariableDict, config
from openslides.core.exceptions import ConfigNotFound
class TestConfigVariable(TestCase):
@patch("openslides.core.config.config", {"test_variable": N... | mit |
monkeysecurity/botor | setup.py | 1 | 1204 | """
Botor
=====
A thin wrapper around boto3
:copyright: (c) 2016 by Netflix, see AUTHORS for more
:license: Apache, see LICENSE for more details.
"""
import sys
import os.path
from setuptools import setup, find_packages
ROOT = os.path.realpath(os.path.join(os.path.dirname(__file__)))
# When executing the setup.py,... | apache-2.0 |
aitjcize/QCamber | src/codegen/codegen.py | 1 | 3393 | #!/usr/bin/env python
#-*- coding: utf-8 -*-
#
# codegen.py
#
# Copyright (C) 2013 - Wei-Ning Huang (AZ) <aitjcize@gmail.com>
# All Rights reserved.
#
# 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 Found... | gpl-3.0 |
coll-gate/collgate | server/accession/migrations/0007_auto_20180328_1749.py | 1 | 2013 | # Generated by Django 2.0.2 on 2018-03-28 15:49
import django.contrib.postgres.fields.jsonb
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('accession', '0006_action_name'),
]
operations = [
migrations.Cr... | mit |
cubicova17/annet | venv/lib/python2.7/site-packages/django/db/models/base.py | 92 | 45515 | from __future__ import unicode_literals
import copy
import sys
from functools import update_wrapper
from django.utils.six.moves import zip
import django.db.models.manager # Imported to register signal handler.
from django.conf import settings
from django.core.exceptions import (ObjectDoesNotExist,
MultipleObject... | mit |
jcjl013/ylplines | setup.py | 1 | 1461 | #!/usr/bin/env python
"""
ylplines - Clarity for Yelp
Copyright (C) 2016 Jeff Lee
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 versi... | gpl-3.0 |
jonashaag/ansible | test/units/errors/test_errors.py | 170 | 3108 | # (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) an... | gpl-3.0 |
msabramo/ansible | lib/ansible/utils/module_docs_fragments/f5.py | 121 | 2006 | # -*- 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.
#
# Ansible is dis... | gpl-3.0 |
alaski/nova | nova/virt/hyperv/serialproxy.py | 12 | 4366 | # Copyright 2016 Cloudbase Solutions Srl
# 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... | apache-2.0 |
tedder/ansible | lib/ansible/modules/cloud/amazon/aws_config_recorder.py | 27 | 7722 | #!/usr/bin/python
# Copyright: (c) 2018, Aaron Smith <ajsmith10381@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_version': '1.1',
... | gpl-3.0 |
iamtrask/keras | keras/wrappers/scikit_learn.py | 54 | 8842 | from __future__ import absolute_import
import abc
import copy
import numpy as np
from ..utils.np_utils import to_categorical
class BaseWrapper(object):
"""
Base class for the Keras scikit-learn wrapper.
Warning: This class should not be used directly. Use derived classes instead.
Parameters
---... | mit |
TEAM-Gummy/android_kernel_samsung_smdk4412 | Documentation/networking/cxacru-cf.py | 14668 | 1626 | #!/usr/bin/env python
# Copyright 2009 Simon Arlott
#
# 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.
#
# This program i... | gpl-2.0 |
0jpq0/kbengine | kbe/src/lib/python/Lib/ctypes/test/test_cfuncs.py | 102 | 7680 | # A lot of failures in these tests on Mac OS X.
# Byte order related?
import unittest
from ctypes import *
from ctypes.test import need_symbol
import _ctypes_test
class CFunctions(unittest.TestCase):
_dll = CDLL(_ctypes_test.__file__)
def S(self):
return c_longlong.in_dll(self._dll, "last_tf_arg_s")... | lgpl-3.0 |
kelchuan/snac-1 | StGermain/pyre/Bindings/__init__.py | 6 | 1942 | #!/usr/bin/env python
##~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
##
## Copyright (C), 2003, Victorian Partnership for Advanced Computing (VPAC) Ltd, 110 Victoria Street, Melbourne, 3053, Australia.
##
## Authors:
## Stevan M. Quen... | gpl-2.0 |
chrish42/pylearn | pylearn2/models/rbm.py | 44 | 58469 | """
Implementations of Restricted Boltzmann Machines and associated sampling
strategies.
"""
# Standard library imports
import logging
# Third-party imports
import numpy
N = numpy
np = numpy
from theano.compat import six
from theano.compat.six.moves import xrange
import theano
from theano import tensor
from theano.com... | bsd-3-clause |
StellarCN/py-stellar-base | stellar_sdk/xdr/transaction_result_result.py | 1 | 4426 | # This is an automatically generated file.
# DO NOT EDIT or your changes may be overwritten
import base64
from typing import List
from xdrlib import Packer, Unpacker
from .inner_transaction_result_pair import InnerTransactionResultPair
from .operation_result import OperationResult
from .transaction_result_code import ... | apache-2.0 |
propublica/Capitol-Words | capitolweb/legislators/views.py | 2 | 3696 | # -*- coding: utf-8 -*-
from .models import CongressPerson, ExternalId, get_current_legislators
from rest_framework.decorators import api_view
import logging
from django.http import JsonResponse
from legislators.serializers import CongressPersonSerializer, CongressPersonShortSerializer
logger = logging.getLogger(__nam... | bsd-3-clause |
martindale/letsencrypt | acme/acme/jose/util_test.py | 45 | 6462 | """Tests for acme.jose.util."""
import functools
import unittest
import six
from acme import test_util
class ComparableX509Test(unittest.TestCase):
"""Tests for acme.jose.util.ComparableX509."""
def setUp(self):
# test_util.load_{csr,cert} return ComparableX509
self.req1 = test_util.load_cs... | apache-2.0 |
dneg/cortex | python/IECoreMaya/mayaDo.py | 17 | 4222 | ##########################################################################
#
# Copyright (c) 2007, Image Engine Design 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:
#
# * Redistribu... | bsd-3-clause |
rzambre/servo | tests/wpt/web-platform-tests/tools/pywebsocket/src/test/test_util.py | 449 | 7538 | #!/usr/bin/env python
#
# Copyright 2011, 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... | mpl-2.0 |
dudepare/django | tests/dates/tests.py | 293 | 3733 | from __future__ import unicode_literals
import datetime
from django.core.exceptions import FieldError
from django.test import TestCase
from django.utils import six
from .models import Article, Category, Comment
class DatesTests(TestCase):
def test_related_model_traverse(self):
a1 = Article.objects.crea... | bsd-3-clause |
sfstpala/Victory-Chat | cherrypy/test/test_core.py | 35 | 26914 | """Basic tests for the CherryPy core: request handling."""
import os
localDir = os.path.dirname(__file__)
import sys
import types
import cherrypy
from cherrypy._cpcompat import IncompleteRead, itervalues, ntob
from cherrypy import _cptools, tools
from cherrypy.lib import httputil, static
favicon_path = os.path.join... | isc |
aabbox/kbengine | kbe/res/scripts/common/Lib/unittest/test/test_runner.py | 71 | 11704 | import io
import os
import sys
import pickle
import subprocess
import unittest
from unittest.case import _Outcome
from unittest.test.support import (LoggingResult,
ResultWithNoStartTestRunStopTestRun)
class TestCleanUp(unittest.TestCase):
def testCleanUp(self):
class ... | lgpl-3.0 |
Balandat/cont_no_regret | ContNoRegret/NoRegretAlgos.py | 1 | 23992 | '''
Basic Algorithms for the Continuous No-Regret Problem.
@author: Maximilian Balandat
@date May 25, 2015
'''
import numpy as np
from .LossFunctions import ZeroLossFunction, ctypes_integrate
from .DualAveraging import compute_nustar
from .Domains import nBox, UnionOfDisjointnBoxes, DifferenceOfnBoxes
from .Potential... | mit |
bennettp123/CouchPotatoServer | libs/pyutil/odict.py | 106 | 20991 | # Copyright (c) 2002-2009 Zooko "Zooko" Wilcox-O'Hearn
"""
This module offers a Ordered Dict, which is a dict that preserves
insertion order. See PEP 372 for description of the problem. This
implementation uses a linked-list to get good O(1) asymptotic
performance. (Actually it is O(hashtable-update-cost), but wha... | gpl-3.0 |
ProfessionalIT/maxigenios-website | sdk/google_appengine/lib/django-1.5/django/templatetags/tz.py | 114 | 5523 | from datetime import datetime, tzinfo
try:
import pytz
except ImportError:
pytz = None
from django.template import Node
from django.template import TemplateSyntaxError, Library
from django.utils import six
from django.utils import timezone
register = Library()
# HACK: datetime is an old-style class, create... | mit |
Jan-zou/LeetCode | python/HashTable/205_isomorphic_strings.py | 1 | 1289 | # !/usr/bin/env python
# -*- coding: utf-8 -*-
'''
Description:
Given two strings s and t, determine if they are isomorphic.
Two strings are isomorphic if the characters in s can be replaced to get t.
All occurrences of a character must be replaced with another character while preserving the order of chara... | mit |
msegado/edx-platform | common/djangoapps/student/tests/test_views.py | 25 | 4004 | """
Test the student dashboard view.
"""
import ddt
import unittest
from mock import patch
from pyquery import PyQuery as pq
from django.core.urlresolvers import reverse
from django.conf import settings
from student.tests.factories import UserFactory, CourseEnrollmentFactory
from student.models import CourseEnrollmen... | agpl-3.0 |
mbayon/TFG-MachineLearning | vbig/lib/python2.7/site-packages/pandas/tests/frame/test_indexing.py | 7 | 104529 | # -*- coding: utf-8 -*-
from __future__ import print_function
from warnings import catch_warnings
from datetime import datetime, date, timedelta, time
from pandas.compat import map, zip, range, lrange, lzip, long
from pandas import compat
from numpy import nan
from numpy.random import randn
import pytest
import nu... | mit |
hurrinico/sale-workflow | partner_prepayment/model/res_partner.py | 35 | 1297 | # -*- coding: utf-8 -*-
#
#
# Author: Guewen Baconnier
# Copyright 2013 Camptocamp SA
#
# 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... | agpl-3.0 |
sauloal/cufflinksviewer | venvlin/lib/python2.7/encodings/euc_kr.py | 816 | 1027 | #
# euc_kr.py: Python Unicode Codec for EUC_KR
#
# Written by Hye-Shik Chang <perky@FreeBSD.org>
#
import _codecs_kr, codecs
import _multibytecodec as mbc
codec = _codecs_kr.getcodec('euc_kr')
class Codec(codecs.Codec):
encode = codec.encode
decode = codec.decode
class IncrementalEncoder(mbc.MultibyteIncrem... | mit |
jamdin/jdiner-mobile-byte3 | lib/numpy/lib/benchmarks/benchmark.py | 45 | 1366 | from timeit import Timer
class Benchmark(dict):
"""Benchmark a feature in different modules."""
def __init__(self,modules,title='',runs=3,reps=1000):
self.module_test = dict((m,'') for m in modules)
self.runs = runs
self.reps = reps
self.title = title
def __setitem__(self,... | apache-2.0 |
yatinkumbhare/openstack-nova | nova/virt/event.py | 76 | 3420 | # Copyright 2013 Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agre... | apache-2.0 |
sagangwee/sagangwee.github.io | build/pygments/doc/conf.py | 6 | 8074 | # -*- coding: utf-8 -*-
#
# Pygments documentation build configuration file, created by
# sphinx-quickstart on Sat Jan 18 17:07:37 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.
#
# Al... | mit |
gpapakyriakopoulos/PyFlask | pyflask/lib/python2.7/site-packages/pip/commands/__init__.py | 476 | 2236 | """
Package containing all pip commands
"""
from pip.commands.bundle import BundleCommand
from pip.commands.completion import CompletionCommand
from pip.commands.freeze import FreezeCommand
from pip.commands.help import HelpCommand
from pip.commands.list import ListCommand
from pip.commands.search import SearchComman... | gpl-3.0 |
Nirlendu/Dummy-Search-Engine | tornado-3.2/build/lib.win32-2.7/tornado/iostream.py | 18 | 42917 | #!/usr/bin/env python
#
# Copyright 2009 Facebook
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | mit |
40223250/lego | static/Brython3.1.1-20150328-091302/Lib/unittest/result.py | 727 | 6397 | """Test result object"""
import io
import sys
import traceback
from . import util
from functools import wraps
__unittest = True
def failfast(method):
@wraps(method)
def inner(self, *args, **kw):
if getattr(self, 'failfast', False):
self.stop()
return method(self, *args, **kw)
... | agpl-3.0 |
thaim/ansible | test/units/module_utils/basic/test_imports.py | 50 | 5561 | # -*- coding: utf-8 -*-
# (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com>
# (c) 2016 Toshio Kuratomi <tkuratomi@ansible.com>
# (c) 2017 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
... | mit |
40223104/2015cd_0512 | static/Brython3.1.1-20150328-091302/Lib/browser/indexed_db.py | 632 | 3008 | class EventListener:
def __init__(self, events=[]):
self._events=events
def append(self, event):
self._events.append(event)
def fire(self, e):
for _event in self._events:
_event(e)
class IndexedDB:
def __init__(self):
if not __BRYTHON__.has_indexedDB:
raise NotImple... | agpl-3.0 |
invisiblek/python-for-android | python-modules/twisted/twisted/test/test_internet.py | 59 | 46415 | # Copyright (c) 2001-2010 Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Tests for lots of functionality provided by L{twisted.internet}.
"""
import os
import sys
import time
from twisted.trial import unittest
from twisted.internet import reactor, protocol, error, abstract, defer
from twisted.internet i... | apache-2.0 |
Alwnikrotikz/cortex-vfx | python/IECoreNuke/__init__.py | 12 | 2342 | ##########################################################################
#
# Copyright (c) 2008-2010, Image Engine Design 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:
#
# * Redis... | bsd-3-clause |
BhallaLab/moose-examples | traub_2005/py/test_singlecomp.py | 2 | 7203 | # test_singlecomp.py ---
#
# Filename: test_singlecomp.py
# Description:
# Author: Subhasis Ray
# Maintainer:
# Created: Tue Jul 17 21:01:14 2012 (+0530)
# Version:
# Last-Updated: Sun Jun 25 15:37:21 2017 (-0400)
# By: subha
# Update #: 320
# URL:
# Keywords:
# Compatibility:
#
#
# Commentary:... | gpl-2.0 |
40023256/2015cd_midterm- | static/Brython3.1.0-20150301-090019/Lib/encodings/__init__.py | 764 | 5067 | """ Standard "encodings" Package
Standard Python encoding modules are stored in this package
directory.
Codec modules must have names corresponding to normalized encoding
names as defined in the normalize_encoding() function below, e.g.
'utf-8' must be implemented by the module 'utf_8.py'.
Ea... | gpl-3.0 |
BT-jmichaud/account-invoicing | stock_picking_invoicing/tests/test_picking_invoicing.py | 21 | 3137 | # -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2015 Lorenzo Battistini <lorenzo.battistini@agilebg.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public Licens... | agpl-3.0 |
mdpiper/topoflow | topoflow/utils/ncps_files.py | 2 | 23964 |
# S.D. Peckham
# May 2010
import os
import sys
import time
import numpy as np
import file_utils
# import rti_files # (not used)
import netCDF4 as nc
#---------------------------------------------------------------------
# This class is for I/O of time-indexed 1D profiles to netCDF files.
#-----------------------... | mit |
takis/django | django/utils/numberformat.py | 431 | 1944 | from __future__ import unicode_literals
from decimal import Decimal
from django.conf import settings
from django.utils import six
from django.utils.safestring import mark_safe
def format(number, decimal_sep, decimal_pos=None, grouping=0, thousand_sep='',
force_grouping=False):
"""
Gets a number (... | bsd-3-clause |
Nikea/VisTrails | examples/scripting/vtk_book_3rd_p189_script.py | 2 | 4662 | import os
import sys
try:
import vistrails
except:
#try to append vistrails source dir relative to examples/scripting
this_dir = os.path.split(__file__)[0]
sys.path.append(os.path.join(this_dir, '../..'))
import vistrails
import vistrails.core.application
import vistrails.core.db.action
import vis... | bsd-3-clause |
ddd332/presto | presto-docs/target/sphinx/reportlab/pdfbase/pdfpattern.py | 14 | 2452 | __doc__="""helper for importing pdf structures into a ReportLab generated document
"""
from reportlab.pdfbase.pdfdoc import format
import string
class PDFPattern:
__PDFObject__ = True
__RefOnly__ = 1
def __init__(self, pattern_sequence, **keywordargs):
"""
Description of a kind of PDF obje... | apache-2.0 |
Coelhon/MasterRepo.repository | plugin.video.specto/resources/lib/sources/disabled/ddlvalley_mv_tv.py | 2 | 6510 | # -*- coding: utf-8 -*-
'''
Specto Add-on
Copyright (C) 2015 lambda
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 l... | gpl-2.0 |
vnsofthe/odoo-dev | addons/hr_holidays/wizard/hr_holidays_summary_department.py | 337 | 2335 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
# $Id: account.py 1005 2005-07-25 08:41:42Z nicoe $
#
# This program is free software: you can redistrib... | agpl-3.0 |
windedge/odoomrp-wip | product_purchase_warrant/models/product.py | 29 | 1035 |
# -*- encoding: utf-8 -*-
##############################################################################
#
# 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 Licen... | agpl-3.0 |
elventear/ansible | lib/ansible/modules/cloud/docker/docker_container.py | 7 | 75877 | #!/usr/bin/python
#
# Copyright 2016 Red Hat | Ansible
#
# 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 la... | gpl-3.0 |
Ant-OS/android_packages_apps_OTAUpdates | jni/boost_1_57_0/tools/litre/tool.py | 67 | 1749 | try:
import locale
locale.setlocale(locale.LC_ALL, '')
except:
pass
# try to import a litre_config.py file.
try:
import litre_config as config
except:
class config: pass
import sys
try: # if the user has set up docutils_root in his config, add it to the PYTHONPATH.
sys.path += ['%s/docuti... | apache-2.0 |
qsnake/gpaw | doc/tutorials/dielectric_response/silicon_ABS_simpleversion.py | 2 | 1071 | import numpy as np
from ase.structure import bulk
from gpaw import GPAW
from gpaw.response.df import DF
# Part 1: Ground state calculation
atoms = bulk('Si', 'diamond', a=5.431) # Generate diamond crystal structure for silicon
calc = GPAW(h=0.20, kpts=(4,4,4)) # GPAW calculator initialization
atoms.set_calc... | gpl-3.0 |
gaasedelen/lighthouse | coverage/frida/frida-drcov.py | 1 | 10181 | #!/usr/bin/env python
from __future__ import print_function
import argparse
import json
import os
import signal
import sys
import frida
"""
Frida BB tracer that outputs in DRcov format.
Frida script is responsible for:
- Getting and sending the process module map initially
- Getting the code execution events
- Pars... | mit |
nextgis-extra/tests | lib_gdal/pyscripts/test_gdal_ls_py.py | 1 | 9097 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
###############################################################################
# $Id: test_gdal_ls_py.py 33811 2016-03-29 23:12:41Z goatbar $
#
# Project: GDAL/OGR Test Suite
# Purpose: gdal_ls.py testing
# Author: Even Rouault <even dot rouault @ mines-paris dot org>
... | gpl-2.0 |
nikolas/edx-platform | cms/djangoapps/contentstore/views/assets.py | 113 | 14959 | import logging
from functools import partial
import math
import json
from django.http import HttpResponseBadRequest
from django.contrib.auth.decorators import login_required
from django.views.decorators.csrf import ensure_csrf_cookie
from django.views.decorators.http import require_http_methods, require_POST
from djan... | agpl-3.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.