repo_name stringlengths 5 100 | path stringlengths 4 375 | copies stringclasses 991
values | size stringlengths 4 7 | content stringlengths 666 1M | license stringclasses 15
values |
|---|---|---|---|---|---|
Maccimo/intellij-community | python/testData/inspections/PyDataclassInspection/fieldsOrder.py | 15 | 1775 | import dataclasses
from typing import ClassVar
@dataclasses.dataclass
class A1:
bar1: int
<error descr="Fields with a default value must come after any fields without a default.">baz1</error>: int = 1
foo1: int
<error descr="Fields with a default value must come after any fields without a default.">ba... | apache-2.0 |
endorphinl/horizon | openstack_dashboard/dashboards/identity/projects/views.py | 47 | 9056 | # Copyright 2012 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Copyright 2012 Nebula, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the... | apache-2.0 |
Scapogo/zipline | zipline/testing/slippage.py | 6 | 1028 | from zipline.assets import Equity
from zipline.finance.slippage import SlippageModel
from zipline.utils.sentinel import sentinel
class TestingSlippage(SlippageModel):
"""
Slippage model that fills a constant number of shares per tick, for
testing purposes.
Parameters
----------
filled_per_tic... | apache-2.0 |
chengui/mic | mic/bootstrap.py | 2 | 8915 | #!/usr/bin/python -tt
#
# Copyright (c) 2009, 2010, 2011 Intel, Inc.
#
# This program is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the Free
# Software Foundation; version 2 of the License
#
# This program is distributed in the hope that i... | gpl-2.0 |
kylerbrown/scikit-learn | examples/svm/plot_weighted_samples.py | 188 | 1943 | """
=====================
SVM: Weighted samples
=====================
Plot decision function of a weighted dataset, where the size of points
is proportional to its weight.
The sample weighting rescales the C parameter, which means that the classifier
puts more emphasis on getting these points right. The effect might ... | bsd-3-clause |
tovid-suite/tovid | libtovid/metagui/manpage.py | 1 | 2685 | """This module is for parsing manual pages and extracting necessary information
for creating a metaGUI.
Needed capabilities:
* Retrieve text of a given manpage
* Read manpage for a given program and create a list of command-line options,
with expected parameters and accompanying paragraph(s) of documentation.
"""... | gpl-2.0 |
freakynit/vertx-web | src/test/sockjs-protocol/venv/lib/python2.7/site-packages/setuptools/sandbox.py | 221 | 9994 | import os
import sys
import tempfile
import operator
import functools
import itertools
import re
import pkg_resources
if os.name == "java":
import org.python.modules.posix.PosixModule as _os
else:
_os = sys.modules[os.name]
try:
_file = file
except NameError:
_file = None
_open = open
from distutils.e... | apache-2.0 |
NL66278/OCB | addons/l10n_in_hr_payroll/report/report_payslip_details.py | 374 | 1791 | #-*- coding:utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2011 OpenERP SA (<http://openerp.com>). All Rights Reserved
#
# This program is free software: you can redistribute it and/or modify
# it under th... | agpl-3.0 |
ychen820/microblog | y/google-cloud-sdk/platform/google_appengine/lib/django-1.5/django/db/models/fields/__init__.py | 24 | 48391 | from __future__ import unicode_literals
import copy
import datetime
import decimal
import math
import warnings
from itertools import tee
from django.db import connection
from django.db.models.query_utils import QueryWrapper
from django.conf import settings
from django import forms
from django.core import exceptions, ... | bsd-3-clause |
freakboy3742/django | docs/conf.py | 5 | 13852 | # Django documentation build configuration file, created by
# sphinx-quickstart on Thu Mar 27 09:06:53 2008.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# The contents of this file are pickled, so don't put values in the namespace
# that aren't picklable (module imports are okay... | bsd-3-clause |
ParkJinSang/Logle | sample/common/fileio.py | 2 | 1415 | __author__ = 'PARKJINSANG'
#
def read_file(path):
"""
Read text from file path
:param path: string of path of file to read
:return: contents inside the file
"""
file = open(path, "r", encoding='ISO-8859-1')
contents = ""
while True:
line = file.readline()
if not line:
... | mit |
zhuyue1314/archinfo | archinfo/arch_mips32.py | 1 | 7869 | import capstone as _capstone
from .arch import Arch
# FIXME: Tell fish to fix whatever he was storing in info['current_function']
# TODO: Only persist t9 in PIC programs
class ArchMIPS32(Arch):
def __init__(self, endness="Iend_LE"):
super(ArchMIPS32, self).__init__(endness)
if endness == 'Iend_BE... | bsd-2-clause |
Fl0rianFischer/sme_odoo | addons/crm/report/crm_activity_report.py | 20 | 2126 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from openerp import fields, models
from openerp import tools
class crm_activity_report(models.Model):
""" CRM Lead Analysis """
_name = "crm.activity.report"
_auto = False
_description = "CRM Activity A... | gpl-3.0 |
samdowd/drumm-farm | drumm_env/lib/python2.7/site-packages/boto/ec2/launchspecification.py | 170 | 3829 | # Copyright (c) 2006-2012 Mitch Garnaat http://garnaat.org/
# Copyright (c) 2012 Amazon.com, Inc. or its affiliates. All Rights Reserved
#
# 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 wit... | mit |
lucafavatella/intellij-community | python/testData/inspections/PyNumpyType/Slogdet.py | 79 | 1052 |
def slogdet(a):
"""
Compute the sign and (natural) logarithm of the determinant of an array.
If an array has a very small or very large determinant, than a call to
`det` may overflow or underflow. This routine is more robust against such
issues, because it computes the logarithm of the determinant... | apache-2.0 |
ScottSteiner/uguubot | plugins/wu.py | 1 | 4455 | # weather.py
# Rewritten by ScottSteiner to use Weather Underground instead of Yahoo
from util import hook, database, http, web
base_url = "http://api.wunderground.com/api/{}/{}/q/{}.json"
def format_coordinates(latitude, longitude):
"Formats coordinates into one string"
latitude = round(float(latitude), 2)
longi... | gpl-3.0 |
mustafat/odoo-1 | addons/gamification/models/res_users.py | 386 | 4010 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2013 OpenERP SA (<http://www.openerp.com>)
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the ... | agpl-3.0 |
Pablo126/SSBW | Tarea4/tarea4/lib/python3.5/site-packages/pip/_vendor/distlib/util.py | 327 | 52991 | #
# Copyright (C) 2012-2016 The Python Software Foundation.
# See LICENSE.txt and CONTRIBUTORS.txt.
#
import codecs
from collections import deque
import contextlib
import csv
from glob import iglob as std_iglob
import io
import json
import logging
import os
import py_compile
import re
import shutil
import socket
try:
... | gpl-3.0 |
taknevski/tensorflow-xsmm | tensorflow/contrib/copy_graph/python/util/copy_test.py | 112 | 3739 | # 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... | apache-2.0 |
zyq001/ryu | ryu/lib/packet/igmp.py | 19 | 19270 | # Copyright (C) 2013 Nippon Telegraph and Telephone 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 appli... | apache-2.0 |
debasishm89/burpy | modules/fbxsrf.py | 3 | 1716 | from rawweb import *
def main(raw_stream,ssl):
'''
This Burpy module is specially written to find CSRF vulnerability in Facebook Application.
It has already found few minor CSRF vulnerability in FB application. Few them was qualifed for Bug Bounty.
It simply checks whether CSRF token validation is present in Server... | gpl-2.0 |
tsl143/zamboni | mkt/account/views.py | 1 | 16495 | import hashlib
import hmac
import json
import uuid
import urlparse
from django import http
from django.conf import settings
from django.contrib import auth
from django.contrib.auth.signals import user_logged_in
from django.db import IntegrityError
from django.utils.datastructures import MultiValueDictKeyError
import ... | bsd-3-clause |
andhit-r/account-financial-tools | currency_rate_update/services/update_service_PL_NBP.py | 41 | 4486 | # -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (c) 2009 CamptoCamp. All rights reserved.
# @author Nicolas Bessi
#
# Abstract class to fetch rates from National Bank of Poland
#
# This program is free software: you can redistribute it and... | agpl-3.0 |
mhvk/astropy | astropy/io/ascii/tests/test_c_reader.py | 8 | 62931 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import os
import functools
from io import BytesIO
from textwrap import dedent
import pytest
import numpy as np
from numpy import ma
from astropy.table import Table, MaskedColumn
from astropy.io import ascii
from astropy.io.ascii.core import ParameterEr... | bsd-3-clause |
ferrants/ansible | contrib/inventory/vmware.py | 59 | 16907 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
'''
VMware Inventory Script
=======================
Retrieve information about virtual machines from a vCenter server or
standalone ESX host. When `group_by=false` (in the INI file), host systems
are also returned in addition to VMs.
This script will attempt to read conf... | gpl-3.0 |
abhishekarora12/ansible | lib/ansible/module_utils/redhat.py | 324 | 10219 | # This code is part of Ansible, but is an independent component.
# This particular file snippet, and this file snippet only, is BSD licensed.
# Modules you write using this snippet, which is embedded dynamically by Ansible
# still belong to the author of the module, and may assign their own license
# to the complete wo... | gpl-3.0 |
datakortet/dkmodelfields | tests/test_durationfield.py | 1 | 3701 | # -*- coding: utf-8 -*-
import sys
from datetime import timedelta, datetime
import pytest
import ttcal
from django.core.exceptions import ValidationError
from django.db import connection
from django.forms import Form
from ttcal import Duration
from dkmodelfields import DurationField
from dkmodelfields import adminform... | mit |
chevanlol360/Kernel_LGE_X5 | scripts/gcc-wrapper.py | 1276 | 3382 | #! /usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2011-2012, The Linux Foundation. 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 th... | gpl-2.0 |
justincely/cos_monitoring | docs/source/conf.py | 1 | 8446 | # -*- coding: utf-8 -*-
#
# smov_cos_redo documentation build configuration file, created by
# sphinx-quickstart on Tue Dec 8 10:53:41 2015.
#
# 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.... | bsd-3-clause |
calixtolinux/Android-ics-kernel | 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 |
mattclay/ansible-modules-core | system/systemd.py | 15 | 15771 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2016, Brian Coca <bcoca@ansible.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... | gpl-3.0 |
louisLouL/pair_trading | capstone_env/lib/python3.6/site-packages/pip/_vendor/requests/packages/urllib3/util/retry.py | 360 | 10664 | from __future__ import absolute_import
import time
import logging
from ..exceptions import (
ConnectTimeoutError,
MaxRetryError,
ProtocolError,
ReadTimeoutError,
ResponseError,
)
from ..packages import six
log = logging.getLogger(__name__)
class Retry(object):
""" Retry configuration.
... | mit |
alexbruy/QGIS | python/ext-libs/jinja2/testsuite/utils.py | 415 | 2235 | # -*- coding: utf-8 -*-
"""
jinja2.testsuite.utils
~~~~~~~~~~~~~~~~~~~~~~
Tests utilities jinja uses.
:copyright: (c) 2010 by the Jinja Team.
:license: BSD, see LICENSE for more details.
"""
import gc
import unittest
import pickle
from jinja2.testsuite import JinjaTestCase
from jinja2.utils imp... | gpl-2.0 |
cburbridge/mongodb_store | mongodb_log/scripts/mongodb_log.py | 2 | 24463 | #!/usr/bin/python
###########################################################################
# mongodb_log.py - Python based ROS to MongoDB logger (multi-process)
#
# Created: Sun Dec 05 19:45:51 2010
# Copyright 2010-2012 Tim Niemueller [www.niemueller.de]
# 2010-2011 Carnegie Mellon University
# ... | bsd-3-clause |
matiasherranz/keyczar | cpp/src/tools/scons/scons-local-1.2.0.d20090223/SCons/Tool/packaging/targz.py | 19 | 1792 | """SCons.Tool.Packaging.targz
The targz SRC packager.
"""
#
# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 The SCons Foundation
#
# 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 t... | apache-2.0 |
fogleman/pg | pg/font.py | 3 | 4056 | from OpenGL.GL import *
from itertools import product
from math import ceil, log
from PIL import Image, ImageDraw, ImageFont
from .core import Context, Texture, VertexBuffer, Scene
from .matrix import Matrix
from .programs import TextProgram
from .util import interleave
def float_to_byte_color(color):
return tuple... | mit |
Oliver2213/NVDAYoutube-dl | addon/globalPlugins/nvdaYoutubeDL/youtube_dl/extractor/mtv.py | 9 | 14408 | from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..compat import (
compat_urllib_parse,
compat_str,
)
from ..utils import (
ExtractorError,
find_xpath_attr,
fix_xml_ampersands,
HEADRequest,
sanitized_Request,
unescapeHTML,
url_basename,
R... | gpl-2.0 |
jhaus/pinax | pinax/apps/signup_codes/models.py | 2 | 3734 | import datetime
from django.conf import settings
from django.core.mail import send_mail
from django.db import models
from django.db.models.signals import post_save
from django.dispatch import receiver
from django.template.loader import render_to_string
from django.utils.hashcompat import sha_constructor
from django.c... | mit |
arnavd96/Cinemiezer | myvenv/lib/python3.4/site-packages/docutils/parsers/rst/languages/pl.py | 54 | 3362 | # $Id$
# Author: Robert Wojciechowicz <rw@smsnet.pl>
# Copyright: This module has been placed in the public domain.
# New language mappings are welcome. Before doing a new translation, please
# read <http://docutils.sf.net/docs/howto/i18n.html>. Two files must be
# translated for each language: one in docutils/langu... | mit |
SteveXiSong/ECE757-SnoopingPredictions | src/mem/slicc/generate/dot.py | 92 | 2077 | # Copyright (c) 1999-2008 Mark D. Hill and David A. Wood
# Copyright (c) 2009 The Hewlett-Packard Development Company
# 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 co... | bsd-3-clause |
oostende/blackhole-2 | lib/python/Plugins/SystemPlugins/SoftwareManager/SoftwareTools.py | 47 | 9344 | # -*- coding: iso-8859-1 -*-
from enigma import eConsoleAppContainer
from Components.Console import Console
from Components.About import about
from Components.PackageInfo import PackageInfoHandler
from Components.Language import language
from Components.Sources.List import List
from Components.Ipkg import IpkgComponent... | gpl-2.0 |
pfnet/chainer | chainerx/testing/array.py | 8 | 6059 | import numpy.testing
import chainerx
# NumPy-like assertion functions that accept both NumPy and ChainerX arrays
def _as_numpy(x):
if isinstance(x, chainerx.ndarray):
return chainerx.to_numpy(x)
assert isinstance(x, numpy.ndarray) or numpy.isscalar(x)
return x
def _check_dtype_and_strides(x, y... | mit |
kenshay/ImageScript | ProgramData/SystemFiles/Python/Tools/Scripts/pdeps.py | 96 | 3937 | #! /usr/bin/env python
# pdeps
#
# Find dependencies between a bunch of Python modules.
#
# Usage:
# pdeps file1.py file2.py ...
#
# Output:
# Four tables separated by lines like '--- Closure ---':
# 1) Direct dependencies, listing which module imports which other modules
# 2) The inverse of (1)
# 3) Indirect de... | gpl-3.0 |
kaixinjxq/crosswalk-test-suite | cordova/cordova-lite-android-tests/lite/webapp_install.py | 14 | 1900 | #!/usr/bin/env python
#
# Copyright (c) 2016 Intel Corporation.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of works must retain the original copyright notice, this
# list of conditions and t... | bsd-3-clause |
OptiPop/external_chromium_org | native_client_sdk/src/build_tools/tests/update_nacl_manifest_test.py | 43 | 25883 | #!/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.
import copy
import datetime
import hashlib
import logging
import os
import posixpath
import subprocess
import sys
import tempfile
i... | bsd-3-clause |
alanljj/oca_hr | hr_department_sequence/tests/test_hr_department.py | 18 | 2682 | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# This module copyright (C) 2010 - 2014 Savoir-faire Linux
# (<http://www.savoirfairelinux.com>).
#
# This program is free software: you can redistribute it a... | agpl-3.0 |
rupakc/Kaggle-Compendium | Homesite Quote Conversion/home-baseline.py | 1 | 3586 | import pandas as pd
from sklearn.ensemble import RandomForestClassifier
from sklearn.ensemble import GradientBoostingClassifier
from sklearn.ensemble import BaggingClassifier
from sklearn.ensemble import AdaBoostClassifier
from sklearn.ensemble import ExtraTreesClassifier
from sklearn.neural_network import MLPClassifie... | mit |
cloud9209/cloud9209_flask | lib/flask/wrappers.py | 773 | 6709 | # -*- coding: utf-8 -*-
"""
flask.wrappers
~~~~~~~~~~~~~~
Implements the WSGI wrappers (request and response).
:copyright: (c) 2011 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
from werkzeug.wrappers import Request as RequestBase, Response as ResponseBase
from werkzeug.exce... | apache-2.0 |
rbreitenmoser/snapcraft | snapcraft/tests/test_plugin_catkin.py | 1 | 33334 | # -*- Mode:Python; indent-tabs-mode:nil; tab-width:4 -*-
#
# Copyright (C) 2015 Canonical Ltd
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 3 as
# published by the Free Software Foundation.
#
# This program is distributed in the h... | gpl-3.0 |
adaussy/eclipse-monkey-revival | plugins/python/org.eclipse.eclipsemonkey.lang.python/Lib/test/test_posix.py | 6 | 17908 | "Test posix functions"
from test import test_support
# Skip these tests if there is no posix module.
posix = test_support.import_module('posix')
import errno
import sys
import time
import os
import pwd
import shutil
import stat
import sys
import tempfile
import unittest
import warnings
_DUMMY_SYMLINK = os.path.join... | epl-1.0 |
GoogleCloudPlatform/mlops-on-gcp | workshops/kfp-caip-sklearn/lab-02-kfp-pipeline/pipeline/covertype_training_pipeline.py | 3 | 7714 | # Copyright 2019 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 agreed to in writing, ... | apache-2.0 |
gppezzi/easybuild-easyblocks | easybuild/easyblocks/x/xmipp.py | 2 | 7758 | ##
# Copyright 2015-2015 Ghent University
#
# This file is part of EasyBuild,
# originally created by the HPC team of Ghent University (http://ugent.be/hpc/en),
# with support of Ghent University (http://ugent.be/hpc),
# the Flemish Supercomputer Centre (VSC) (https://vscentrum.be/nl/en),
# the Hercules foundation (htt... | gpl-2.0 |
mensler/ansible | lib/ansible/modules/network/avi/avi_network.py | 49 | 4780 | #!/usr/bin/python
#
# Created on Aug 25, 2016
# @author: Gaurav Rastogi (grastogi@avinetworks.com)
# Eric Anderson (eanderson@avinetworks.com)
# module_check: supported
# Avi Version: 17.1.1
#
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the te... | gpl-3.0 |
kevalds51/sympy | sympy/vector/point.py | 42 | 4853 | from sympy.core.compatibility import range
from sympy.core.basic import Basic
from sympy.vector.vector import Vector
from sympy.vector.coordsysrect import CoordSysCartesian
from sympy.vector.functions import _path
from sympy import Symbol
from sympy.core.cache import cacheit
class Point(Basic):
"""
Represents... | bsd-3-clause |
NathanYee/ThinkBayes2 | code/hockey.py | 2 | 7035 | """This file contains code for use with "Think Bayes",
by Allen B. Downey, available from greenteapress.com
Copyright 2012 Allen B. Downey
License: GNU GPLv3 http://www.gnu.org/licenses/gpl.html
"""
from __future__ import print_function, division
import math
import columns
import thinkbayes2
import thinkbayes2
impo... | gpl-2.0 |
gavinfish/leetcode-share | python/056 Merge Intervals.py | 1 | 1138 | '''
Given a collection of intervals, merge all overlapping intervals.
For example,
Given [1,3],[2,6],[8,10],[15,18],
return [1,6],[8,10],[15,18].
'''
# Definition for an interval.
class Interval(object):
def __init__(self, s=0, e=0):
self.start = s
self.end = e
# To print the result
def _... | mit |
google-research/recsim | recsim/testing/test_environment.py | 1 | 12670 | # coding=utf-8
# coding=utf-8
# Copyright 2019 The RecSim Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by ap... | apache-2.0 |
jcderr/kubernetes | cluster/juju/charms/trusty/kubernetes/hooks/hooks.py | 93 | 8164 | #!/usr/bin/env python
# Copyright 2015 The Kubernetes 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
#
# Unle... | apache-2.0 |
xya/Spark | src/spark/gui/filelist.py | 1 | 9395 | # -*- coding: utf-8 -*-
#
# Copyright (C) 2009, 2010 Pierre-André Saulais <pasaulais@free.fr>
#
# This file is part of the Spark File-transfer Tool.
#
# Spark 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; ei... | gpl-2.0 |
jaxxer/aivm | lib/IP.py | 1 | 1333 | #!/usr/bin/python
#-*- coding: utf-8 -*-
import random
from IPy import IP as ip
class DHCP:
def __hash__(self):
return hash(random.random())
def __eq__(self, other):
return hash(self) == hash(other)
def __str__(self):
return "<DHCP>"
class _IP:
def __init__(self, address, netmask, gateway):
self.add... | gpl-2.0 |
Jordan-Zhu/RoboVision | unsorted/algo-NDT192139AAAD.py | 1 | 6993 | import cv2
import numpy as np
from matplotlib import pyplot as plt
from skimage import morphology
from drawlinefeature import DrawLineFeature,drawconvex#zc
from lineseg import lineseg
from drawedgelist import drawedgelist
from Lseg_to_Lfeat_v2 import Lseg_to_Lfeat_v2 #zc
from LabelLineCurveFeature_v2 import... | gpl-3.0 |
KaranToor/MA450 | google-cloud-sdk/lib/third_party/dulwich/server.py | 7 | 40495 | # server.py -- Implementation of the server side git protocols
# Copyright (C) 2008 John Carr <john.carr@unrouted.co.uk>
# Coprygith (C) 2011-2012 Jelmer Vernooij <jelmer@samba.org>
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as publi... | apache-2.0 |
CantemoInternal/django-comments-xtd | django_comments_xtd/tests/views.py | 1 | 9462 | from __future__ import unicode_literals
from datetime import datetime
import re
import threading
# from django.conf import settings
from django.contrib import comments
from django.contrib.comments.signals import comment_was_posted
from django.contrib.contenttypes.models import ContentType
from django.contrib.sites.mo... | bsd-2-clause |
hbrunn/OCB | openerp/service/report.py | 324 | 5148 | # -*- coding: utf-8 -*-
import base64
import logging
import sys
import threading
import openerp
import openerp.report
from openerp import tools
import security
_logger = logging.getLogger(__name__)
# TODO: set a maximum report number per user to avoid DOS attacks
#
# Report state:
# False -> True
self_reports... | agpl-3.0 |
mozilla/bedrock | tests/pages/regions/send_to_device.py | 4 | 1547 | # 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/.
from selenium.webdriver.common.by import By
from selenium.webdriver.support import expected_conditions as expected
from... | mpl-2.0 |
marcinzaremba/libcloud | libcloud/test/compute/test_ibm_sce.py | 29 | 14632 | # 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 use ... | apache-2.0 |
Inspq/ansible | lib/ansible/modules/network/nxos/nxos_install_os.py | 55 | 7774 | #!/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 |
Anaethelion/django-mapentity | mapentity/decorators.py | 1 | 6019 | from functools import wraps
from django.utils.decorators import available_attrs, method_decorator
from django.views.decorators.cache import never_cache
from django.views.decorators.http import last_modified as cache_last_modified
from django.utils.translation import ugettext_lazy as _
from django.core.exceptions impor... | bsd-3-clause |
wdv4758h/ZipPy | lib-python/3/sqlite3/test/transactions.py | 51 | 7338 | #-*- coding: ISO-8859-1 -*-
# pysqlite2/test/transactions.py: tests transactions
#
# Copyright (C) 2005-2007 Gerhard Häring <gh@ghaering.de>
#
# This file is part of pysqlite.
#
# This software is provided 'as-is', without any express or implied
# warranty. In no event will the authors be held liable for any damages
#... | bsd-3-clause |
jhbradley/moose | framework/contrib/nsiqcppstyle/rules/RULE_3_2_H_do_not_use_underbars_for_cpp_filename.py | 43 | 1450 | """
Do not use unberbars for cpp filename.
Only alphabets, numbers can be used for a cpp filename.
== Vilolation ==
/testdir/test_1.cpp <== Violation. - is used.
/testdir1/_test1.cpp <== Violation. _ is used
== Good ==
testdir/test.cpp
testdir1/test_1.c <== Don't care. it's c file.
"""
from nsiqcp... | lgpl-2.1 |
dkillick/iris | lib/iris/tests/integration/test_pp.py | 5 | 31904 | # (C) British Crown Copyright 2013 - 2017, Met Office
#
# This file is part of Iris.
#
# Iris 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 3 of the License, or
# (at your option) any l... | lgpl-3.0 |
cmelange/ansible | lib/ansible/modules/cloud/openstack/os_nova_host_aggregate.py | 6 | 6737 | #!/usr/bin/python
# Copyright 2016 Jakub Jursa <jakub.jursa1@gmail.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 version 3 of the License, or
# (at your option) any later version.... | gpl-3.0 |
twenty0ne/CocosBuilder-wxPython | cocos/test/test_camera_orbit_reuse.py | 6 | 1290 | from __future__ import division, print_function, unicode_literals
# This code is so you can run the samples without installing the package
import sys
import os
sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..'))
#
# total time duration * action multiplier
testinfo = "s, t 2.0, s, t 4.0, s, t 6.1, s, q"
... | mit |
ssvsergeyev/ZenPacks.zenoss.AWS | src/boto/boto/cloudsearch/domain.py | 153 | 15607 | # Copyright (c) 2012 Mitch Garnaat http://garnaat.org/
# Copyright (c) 2012 Amazon.com, Inc. or its affiliates.
# All Rights Reserved
#
# 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... | gpl-2.0 |
devs1991/test_edx_docmode | venv/lib/python2.7/site-packages/newrelic-2.46.0.37/newrelic/hooks/external_urllib.py | 2 | 2093 | try:
import urlparse
except ImportError:
import urllib.parse as urlparse
import newrelic.packages.six as six
from newrelic.agent import (current_transaction,
wrap_function_wrapper, ExternalTrace)
def _nr_wrapper_factory(bind_params_fn, library):
# Wrapper functions will be similar for monkeypatching ... | agpl-3.0 |
cihai/cihaidata-unihan | unihan_etl/util.py | 1 | 3111 | # -*- coding: utf8 -*-
"""Utility and helper methods for script.
util
~~~~
"""
from __future__ import absolute_import, unicode_literals
import re
import sys
from ._compat import Mapping, string_types, text_type, unichr
def ucn_to_unicode(ucn):
"""Return a python unicode value from a UCN.
Converts a Unico... | mit |
maferelo/saleor | saleor/graphql/decorators.py | 1 | 1429 | from enum import Enum
from functools import wraps
from typing import Iterable, Union
from graphql_jwt import exceptions
from graphql_jwt.decorators import context
def account_passes_test(test_func):
"""Determine if user/service_account has permission to access to content."""
def decorator(f):
@wraps... | bsd-3-clause |
wking/pycalendar | pycalendar/component/calendar.py | 1 | 1371 | # Copyright (C) 2013 W. Trevor King <wking@tremily.us>
#
# This file is part of pycalender.
#
# pycalender 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) a... | gpl-3.0 |
LamCiuLoeng/gap | gapproject/util/master_helper.py | 1 | 3918 | # -*- coding: utf-8 -*-
import traceback
from pylons import cache
from tg import config
from gapproject.model import *
__all__ = ['getOrsayCustomerList', 'getOrsayCustomerInfo', 'getOrsayWashingList', 'getOrsayWashingDetailInfo', 'populateTranslation', 'populateTranslation1']
def getOrsayCustomerList():
def _get... | mit |
TheTypoMaster/asuswrt | release/src/router/wget/testenv/Test-auth-basic.py | 23 | 1565 | #!/usr/bin/env python3
from sys import exit
from test.http_test import HTTPTest
from misc.wget_file import WgetFile
"""
This test ensures Wget's Basic Authorization Negotiation.
Also, we ensure that Wget saves the host after a successfull auth and
doesn't wait for a challenge the second time.
"""
TEST_NAME... | gpl-2.0 |
python-gitlab/python-gitlab | tests/unit/objects/test_hooks.py | 1 | 5269 | """
GitLab API: https://docs.gitlab.com/ce/api/system_hooks.html
GitLab API: https://docs.gitlab.com/ce/api/groups.html#hooks
GitLab API: https://docs.gitlab.com/ee/api/projects.html#hooks
"""
import re
import pytest
import responses
from gitlab.v4.objects import GroupHook, Hook, ProjectHook
hooks_content = [
{... | lgpl-3.0 |
nanolearning/edx-platform | common/lib/xmodule/xmodule/tests/xml/test_policy.py | 248 | 1262 | """
Tests that policy json files import correctly when loading XML
"""
from nose.tools import assert_equals, assert_raises # pylint: disable=no-name-in-module
from xmodule.tests.xml.factories import CourseFactory
from xmodule.tests.xml import XModuleXmlImportTest
class TestPolicy(XModuleXmlImportTest):
"""
... | agpl-3.0 |
yashodhank/erpnext | erpnext/manufacturing/doctype/production_planning_tool/production_planning_tool.py | 4 | 19282 | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
from frappe.utils import cstr, flt, cint, nowdate, add_days, comma_and
from frappe import msgprint, _
from frappe.model.document import ... | agpl-3.0 |
TangHao1987/intellij-community | python/lib/Lib/site-packages/django/contrib/auth/tests/views.py | 71 | 14822 | import os
import re
import urllib
from django.conf import settings
from django.contrib.auth import SESSION_KEY, REDIRECT_FIELD_NAME
from django.contrib.auth.forms import AuthenticationForm
from django.contrib.sites.models import Site
from django.contrib.auth.models import User
from django.test import TestCase
from dja... | apache-2.0 |
jn7163/django | tests/admin_views/customadmin.py | 379 | 2366 | """
A second, custom AdminSite -- see tests.CustomAdminSiteTests.
"""
from __future__ import unicode_literals
from django.conf.urls import url
from django.contrib import admin
from django.contrib.auth.admin import UserAdmin
from django.contrib.auth.models import User
from django.http import HttpResponse
from . import... | bsd-3-clause |
mintoo/NetDim | pyNMS/graph_generation/graph_generation_window.py | 2 | 3175 | # Copyright (C) 2017 Antoine Fourmy <antoine dot fourmy at gmail dot com>
#
# 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.
#
# This program is distributed in the hope that it will be useful,
# ... | gpl-3.0 |
a-e-m/psd-tools | src/psd_tools/decoder/image_resources.py | 7 | 5317 | # -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals, division
import io
import warnings
import collections
from psd_tools.utils import (read_pascal_string, unpack, read_fmt,
read_unicode_string, be_array_from_bytes,
decode_fixed_poi... | mit |
rubennj/pvlib-python | pvlib/atmosphere.py | 1 | 7702 | """
The ``atmosphere`` module contains methods to calculate
relative and absolute airmass and to determine
pressure from altitude or vice versa.
"""
from __future__ import division
import logging
pvl_logger = logging.getLogger('pvlib')
import numpy as np
AIRMASS_MODELS = ['kastenyoung1989', 'kasten1966', 'simple',... | bsd-3-clause |
kurli/blink-crosswalk | Tools/Scripts/webkitpy/common/checkout/scm/svn.py | 24 | 8502 | # Copyright (c) 2009, 2010, 2011 Google Inc. All rights reserved.
# Copyright (c) 2009 Apple 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 reta... | bsd-3-clause |
mjs/juju | acceptancetests/repository/charms/statusstresser/tests/10-deploy-test.py | 8 | 2356 | #!/usr/bin/python3
# This Amulet based tests
# The goal is to ensure the Ubuntu charm
# sucessfully deploys and can be accessed.
# Note the Ubuntu charm does not have any
# relations or config options.
import amulet
#import os
#import requests
# Timeout value, in seconds to deploy the environment
seconds = 900
# S... | agpl-3.0 |
Spiderlover/Toontown | toontown/building/DistributedBankInterior.py | 3 | 8875 | from direct.distributed.ClockDelta import *
from direct.distributed.DistributedObject import DistributedObject
from direct.fsm import ClassicFSM, State
from direct.interval.IntervalGlobal import *
from pandac.PandaModules import *
import random
import ToonInteriorColors
from toontown.dna.DNAParser import DNADoor
from ... | mit |
cntnboys/410Lab6 | build/django/build/lib.linux-x86_64-2.7/django/db/backends/mysql/client.py | 84 | 1380 | import os
import sys
from django.db.backends import BaseDatabaseClient
class DatabaseClient(BaseDatabaseClient):
executable_name = 'mysql'
def runshell(self):
settings_dict = self.connection.settings_dict
args = [self.executable_name]
db = settings_dict['OPTIONS'].get('db', settings_... | apache-2.0 |
adamlwgriffiths/Pyglet | tools/upload/upload.py | 28 | 2341 | #!/usr/bin/env python
'''Upload dist/ files to code.google.com. For Alex only :-)
'''
__docformat__ = 'restructuredtext'
__version__ = '$Id$'
import os
import re
import sys
base = os.path.dirname(__file__)
root = os.path.join(base, '../..')
dist = os.path.join(root, 'dist')
sys.path.insert(0, root)
import pyglet
... | bsd-3-clause |
Imaginashion/cloud-vision | .fr-d0BNfn/django-jquery-file-upload/venv/lib/python3.5/encodings/utf_16_le.py | 860 | 1037 | """ Python 'utf-16-le' Codec
Written by Marc-Andre Lemburg (mal@lemburg.com).
(c) Copyright CNRI, All Rights Reserved. NO WARRANTY.
"""
import codecs
### Codec APIs
encode = codecs.utf_16_le_encode
def decode(input, errors='strict'):
return codecs.utf_16_le_decode(input, errors, True)
class IncrementalEncod... | mit |
miloharper/neural-network-animation | neural_network.py | 4 | 4978 | import matplotlib
matplotlib.use("Agg")
from matplotlib import pyplot
from math import fabs
from formulae import sigmoid, sigmoid_derivative, random_weight, get_synapse_colour, adjust_line_to_perimeter_of_circle, layer_left_margin
import parameters
class Synapse():
def __init__(self, input_neuron_index, x1, x2, y... | mit |
schleichdi2/OpenNfr_E2_Gui-6.0 | lib/python/Components/Converter/ValueToPixmap.py | 50 | 1197 | from Components.Converter.Converter import Converter
from Components.Element import cached, ElementError
from Tools.Directories import SCOPE_SKIN_IMAGE, SCOPE_ACTIVE_SKIN, resolveFilename
from Tools.LoadPixmap import LoadPixmap
class ValueToPixmap(Converter, object):
LANGUAGE_CODE = 0
PATH = 1
def __init__(self, ... | gpl-2.0 |
texperience/wagtail-pythonanywhere-quickstart | home/migrations/0002_create_homepage.py | 1 | 1714 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations
def create_homepage(apps, schema_editor):
# Get models
ContentType = apps.get_model('contenttypes.ContentType')
Page = apps.get_model('wagtailcore.Page')
Site = apps.get_model('wagtailcore.Site')
Home... | isc |
thenewguy/wagtailplus | wagtailplus/wagtaillinks/tests/test_views.py | 2 | 7163 | """
Contains view unit tests.
"""
from django.core.urlresolvers import reverse
from wagtailplus.tests import views
from ..models import Link
class TestLinkIndexView(views.BaseTestIndexView):
url_namespace = 'wagtaillinks'
template_dir = 'wagtaillinks/links'
def _create_sequential_instance(self, ind... | bsd-2-clause |
bytor99999/vertx-web | src/test/sockjs-protocol/venv/lib/python2.7/site-packages/pip/_vendor/requests/packages/charade/langhebrewmodel.py | 2763 | 11318 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Universal charset detector code.
#
# The Initial Developer of the Original Code is
# Simon Montagu
# Portions created by the Initial Developer are Copyright (C) 2005
# the Initial Developer. All Rights Reserved... | apache-2.0 |
mgit-at/ansible | lib/ansible/modules/cloud/amazon/lightsail.py | 40 | 15620 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# 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',
... | gpl-3.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.