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
SNET-Entrance/Entrance-KEX
src/bootstrap/oauth.py
1
3710
import json from datetime import datetime, timedelta from flask import request, render_template, make_response, current_app from flask.ext.login import current_user from flask.ext.oauthlib.provider import OAuth2Provider from flask.ext.user import login_required, passwords from werkzeug.security import gen_salt from b...
apache-2.0
xiandiancloud/ji
lms/djangoapps/courseware/features/certificates.py
20
9780
# pylint: disable=C0111 # pylint: disable=W0621 from lettuce import world, step from lettuce.django import django_url from course_modes.models import CourseMode from nose.tools import assert_equal UPSELL_LINK_CSS = '.message-upsell a.action-upgrade[href*="edx/999/Certificates"]' def create_cert_course(): world....
agpl-3.0
danwent/libvirt-ovs
examples/domain-events/events-python/event-test.py
2
19937
#!/usr/bin/python -u # # # ################################################################################# # Start off by implementing a general purpose event loop for anyones use ################################################################################# import sys import getopt import os import libvirt impor...
lgpl-2.1
dparlevliet/zelenka-report-storage
server-local/twisted/web/twcgi.py
17
10780
# -*- test-case-name: twisted.web.test.test_cgi -*- # Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """ I hold resource classes and helper classes that deal with CGI scripts. """ # System Imports import string import os import urllib # Twisted Imports from twisted.web import http from twiste...
lgpl-3.0
rmatsuda/invesalius3
invesalius/data/bases.py
5
8288
import numpy as np import invesalius.data.coordinates as dco import invesalius.data.transformations as tr import invesalius.data.coregistration as dcr def angle_calculation(ap_axis, coil_axis): """ Calculate angle between two given axis (in degrees) :param ap_axis: anterior posterior axis represe...
gpl-2.0
rcbops/opencenter-agent
tests/plugins/output/test_broken.py
1
1755
#!/usr/bin/env python # OpenCenter(TM) is Copyright 2013 by Rackspace US, Inc. ############################################################################## # # OpenCenter is licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License....
apache-2.0
COCS4950G7/COSC4950
Source/Network/GUI_WXPythonExamples/GUI_KeyEvent.py
1
1124
__author__ = 'Chris HAmm' #GUI_KeyEvent #when we press a key on our keyboard, wx.KeyEvent is generated. This event is sent to the widget that currently has focus #three different key handlers #wx.EVT_KEY_DOWN #wx.EVT_KEY_UP #wx.EVT_CHAR #common request is to close the application when the ESC key is pressed import ...
gpl-3.0
JasonKessler/scattertext
scattertext/test/test_PriorFactory.py
1
4207
from unittest import TestCase import numpy as np import pandas as pd from scattertext import LogOddsRatioInformativeDirichletPrior from scattertext.PriorFactory import PriorFactory from scattertext.test.test_semioticSquare import get_test_corpus class TestPriorFactory(TestCase): def test_all_categories(self): ...
apache-2.0
robbwagoner/ansible-modules-core
files/assemble.py
11
6786
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2012, Stephen Fromm <sfromm@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 Lice...
gpl-3.0
jostep/tensorflow
tensorflow/contrib/distributions/python/kernel_tests/mixture_test.py
9
35750
# 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...
apache-2.0
Orange-OpenSource/cf-php-build-pack
vendor/node-semver/semver/tests/test_increment_version.py
5
2371
# -*- coding:utf-8 -*- import pytest # node-semver/test/index.js # import logging # logging.basicConfig(level=logging.DEBUG, format="%(message)s") cands = [ ['1.2.3', 'major', '2.0.0', False], ['1.2.3', 'minor', '1.3.0', False], ['1.2.3', 'patch', '1.2.4', False], ['1.2.3tag', 'major', '2.0.0', True]...
apache-2.0
henrytao-me/openerp.positionq
openerp/addons/base/ir/workflow/workflow.py
41
8979
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Business Applications # Copyright (C) 2004-2012 OpenERP S.A. (<http://openerp.com>). # # This program is free software: you can redistribute it and/or modify # it under the terms o...
agpl-3.0
nitroglycerine33/kernel_asus_grouper
Documentation/target/tcm_mod_builder.py
3119
42754
#!/usr/bin/python # The TCM v4 multi-protocol fabric module generation script for drivers/target/$NEW_MOD # # Copyright (c) 2010 Rising Tide Systems # Copyright (c) 2010 Linux-iSCSI.org # # Author: nab@kernel.org # import os, sys import subprocess as sub import string import re import optparse tcm_dir = "" fabric_ops...
gpl-2.0
cespare/pastedown
vendor/pygments/pygments/console.py
24
1850
# -*- coding: utf-8 -*- """ pygments.console ~~~~~~~~~~~~~~~~ Format colored console output. :copyright: Copyright 2006-2012 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ esc = "\x1b[" codes = {} codes[""] = "" codes["reset"] = esc + "39;49;00m" cod...
mit
sgibbes/carbon-budget
gain/cumulative_gain_mangrove.py
1
2558
### This script calculates the cumulative above and belowground carbon gain in mangrove forest pixels from 2001-2015. ### It multiplies the annual biomass gain rate by the number of years of gain by the biomass-to-carbon conversion. import utilities import datetime import subprocess import sys sys.path.append('../') i...
apache-2.0
egenerat/gae-django
django/contrib/localflavor/ca/ca_provinces.py
13
1455
""" An alphabetical list of provinces and territories for use as `choices` in a formfield., and a mapping of province misspellings/abbreviations to normalized abbreviations Source: http://www.canada.gc.ca/othergov/prov_e.html This exists in this standalone file so that it's only imported into memory when...
mit
atcemgil/notes
DrawNN.py
1
2429
#Code from https://gist.github.com/craffel/2d727968c3aaebd10359 import matplotlib.pyplot as plt def draw_neural_net(ax, left, right, bottom, top, layer_sizes, bias=0, draw_edges=False): ''' Draw a neural network cartoon using matplotilb. :usage: >>> fig = plt.figure(figsize=(12, 12)) ...
mit
zfil/ansible-modules-core
cloud/rackspace/rax_network.py
157
4110
#!/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
matthijsvk/multimodalSR
code/Experiments/neon-master/examples/whale_calls/make_submission.py
1
2183
#!/usr/bin/env python # ---------------------------------------------------------------------------- # Copyright 2016 Nervana Systems 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 # # ...
mit
Timurdov/bionic
bionic/Lib/site-packages/django/core/management/templates.py
61
13198
import cgi import errno import mimetypes import os import posixpath import re import shutil import stat import sys import tempfile from optparse import make_option from os import path import django from django.template import Template, Context from django.utils import archive from django.utils.six.moves.urllib.reques...
apache-2.0
alvin319/CarnotKE
jyhton/lib-python/2.7/lib-tk/Tkinter.py
43
157840
"""Wrapper functions for Tcl/Tk. Tkinter provides classes which allow the display, positioning and control of widgets. Toplevel widgets are Tk and Toplevel. Other widgets are Frame, Label, Entry, Text, Canvas, Button, Radiobutton, Checkbutton, Scale, Listbox, Scrollbar, OptionMenu, Spinbox LabelFrame and PanedWindow. ...
apache-2.0
satvikdhandhania/vit-11
moca/mrs/legacy_api.py
3
14520
from __future__ import absolute_import try: import json except ImportError, e: import simplejson as json import logging import urllib2 import telnetlib import urllib from django.conf import settings from django.template import loader from django.http import HttpResponse from django import forms from django.c...
bsd-3-clause
xpansa/odoomrp-wip
procurement_service/models/sale_order.py
21
1623
# -*- coding: utf-8 -*- ############################################################################## # For copyright and license notices, see __openerp__.py file in root directory ############################################################################## from openerp import models, api class SaleOrder(models.Mo...
agpl-3.0
andela/codango
codango/community/models.py
1
3713
from cloudinary.models import CloudinaryField from django.contrib.auth.models import User from django.db import models from multiselectfield import MultiSelectField group_permissions = ( ('INVITE_MEMBER', 'Send invites'), ('DELETE_MEMBER', 'Remove members'), ('BLOCK_MEMBER', 'Block members'), ('SUSPEND...
mit
uberpye/gwdetchar
gwdetchar/io/tests/test_html.py
1
22674
# -*- coding: utf-8 -*- # Copyright (C) Alex Urban (2019) # # This file is part of the GW DetChar python package. # # GW DetChar 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
gspilio/nova
nova/manager.py
2
12022
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2010 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compli...
apache-2.0
danielharbor/openerp
build/lib/openerp/addons/base/tests/test_osv.py
446
4722
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2010 OpenERP S.A. http://www.openerp.com # # This program is free software: you can redistribute it and/or modify # it under the terms of the GN...
agpl-3.0
virtualopensystems/neutron
neutron/plugins/brocade/nos/nctemplates.py
8
6478
# Copyright (c) 2013 Brocade Communications Systems, Inc. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2....
apache-2.0
amcgee/pymomo
pymomo/config/site_scons/utilities.py
2
2048
#utilities.py from SCons.Script import * from SCons.Environment import Environment import os import fnmatch import json as json import sys import os.path import pic12 import StringIO sys.path.append(os.path.join(os.path.dirname(__file__), '..')) from pymomo.utilities import build from pymomo.mib.config12 import MIB1...
lgpl-3.0
xurantju/angr
tests/manual_performance.py
9
1101
#!/usr/bin/env python import time #import nose import logging l = logging.getLogger("angr_tests.counter") l.setLevel(logging.INFO) try: # pylint: disable=W0611,F0401 import standard_logging import angr_debug except ImportError: pass addresses_counter = { 'armel': None, 'armhf': None, # addr...
bsd-2-clause
broferek/ansible
test/units/modules/network/check_point/test_cp_mgmt_tag_facts.py
19
2815
# Ansible module to manage CheckPoint Firewall (c) 2019 # # 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 dist...
gpl-3.0
dacb/elvizCluster
unit_tests/test_elviz_abundance_utils.py
2
1469
import unittest import pandas as pd class testCompletenessOfSummarisedData(unittest.TestCase): def test_animal_data(self): """ Make sure each sample's fraction of abundance values sums very close to 1. On toy data set only. """ animal_df = pd.read_csv("./summarised_animals...
bsd-3-clause
liavkoren/djangoDev
django/utils/deconstruct.py
38
1087
def deconstructible(*args, **kwargs): """ Class decorator that allow the decorated class to be serialized by the migrations subsystem. Accepts an optional kwarg `path` to specify the import path. """ path = kwargs.pop('path', None) def decorator(klass): def __new__(cls, *args, **kw...
bsd-3-clause
y12uc231/edx-platform
cms/djangoapps/contentstore/tests/test_transcripts_utils.py
16
19943
# -*- coding: utf-8 -*- """ Tests for transcripts_utils. """ import unittest from uuid import uuid4 import copy import textwrap from mock import patch, Mock from django.test.utils import override_settings from django.conf import settings from django.utils import translation from nose.plugins.skip import SkipTest fro...
agpl-3.0
jlegendary/nupic
nupic/regions/PyRegion.py
8
11217
# ---------------------------------------------------------------------- # Numenta Platform for Intelligent Computing (NuPIC) # Copyright (C) 2013-2014, Numenta, Inc. Unless you have an agreement # with Numenta, Inc., for a separate license for this software code, the # following terms and conditions apply: # # This p...
gpl-3.0
CTSRD-SOAAP/chromium-42.0.2311.135
tools/grit/grit/gather/admin_template_unittest.py
61
3929
#!/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. '''Unit tests for the admin template gatherer.''' import os import sys if __name__ == '__main__': sys.path.append(os.path.join(o...
bsd-3-clause
smi96/django-blog_website
lib/python2.7/site-packages/django/conf/locale/fi/formats.py
504
1390
# -*- 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. E Y' TIME_FORMAT = 'G.i' DATET...
mit
Trois-Six/ansible-modules-core
cloud/rackspace/rax_cdb.py
28
8017
#!/usr/bin/python -tt # 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 distrib...
gpl-3.0
xxd3vin/spp-sdk
opt/Python27/Lib/lib-tk/Tix.py
4
77781
# -*-mode: python; fill-column: 75; tab-width: 8; coding: iso-latin-1-unix -*- # # $Id: Tix.py 81008 2010-05-08 20:59:42Z benjamin.peterson $ # # Tix.py -- Tix widget wrappers. # # For Tix, see http://tix.sourceforge.net # # - Sudhir Shenoy (sshenoy@gol.com), Dec. 1995. # based on an idea of Jean-Ma...
mit
VitalPet/account-financial-reporting
account_financial_report/report/__init__.py
38
1484
# -*- encoding: utf-8 -*- ########################################################################### # Module Writen to OpenERP, Open Source Management Solution # Copyright (C) OpenERP Venezuela (<http://openerp.com.ve>). # All Rights Reserved # Credits###################################################### # ...
agpl-3.0
srcLurker/home-assistant
homeassistant/components/qwikswitch.py
9
6190
""" Support for Qwikswitch devices. For more details about this component, please refer to the documentation at https://home-assistant.io/components/qwikswitch/ """ import logging import voluptuous as vol from homeassistant.const import (EVENT_HOMEASSISTANT_START, EVENT_HOMEASSISTANT_...
mit
ghedsouza/django
tests/template_tests/syntax_tests/test_filter_syntax.py
29
9422
from django.template import TemplateSyntaxError from django.test import SimpleTestCase from ..utils import SomeClass, SomeOtherException, UTF8Class, setup class FilterSyntaxTests(SimpleTestCase): @setup({'filter-syntax01': '{{ var|upper }}'}) def test_filter_syntax01(self): """ Basic filter ...
bsd-3-clause
tracierenea/gnuradio
gr-vocoder/python/vocoder/qa_g721_vocoder.py
57
1573
#!/usr/bin/env python # # Copyright 2011,2013 Free Software Foundation, Inc. # # This file is part of GNU Radio # # GNU Radio 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, or (at your optio...
gpl-3.0
phalax4/CarnotKE
jyhton/lib-python/2.7/encodings/iso8859_16.py
593
13813
""" Python Character Mapping Codec iso8859_16 generated from 'MAPPINGS/ISO8859/8859-16.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,input,errors...
apache-2.0
supermeng/console
apis/utils.py
1
7361
# -*- coding: utf-8 import requests import tarfile import yaml import json import subprocess import re from retrying import retry from time import gmtime, strftime import docker from docker.types import IPAMConfig, IPAMPool from cStringIO import StringIO from commons.miscs import NoAvailableImages import commons.utils...
mit
fivejjs/GPy
GPy/testing/likelihood_tests.py
4
30412
# Copyright (c) 2014, Alan Saul # Licensed under the BSD 3-clause license (see LICENSE.txt) import numpy as np import unittest import GPy from GPy.models import GradientChecker import functools import inspect from GPy.likelihoods import link_functions from GPy.core.parameterization import Param from functools import pa...
bsd-3-clause
Anveling/sp17-i524
project/S17-IR-P013/code/weather_data_analysis/run/wda_mapper.py
19
2000
#!/usr/bin/env python import sys import logging import iu.i524.S17IRP013.hadoop.hbase_to_hdfs as h2h DEFAULT_STATION_ID = 'DST:IND000DEF' logging.basicConfig(format = '%(asctime)s %(message)s',\ datefmt = '%m/%d/%Y %I:%M:%S %p',\ filename = 'wda_app.log',\ ...
apache-2.0
Mattze96/youtube-dl
test/helper.py
63
8488
from __future__ import unicode_literals import errno import io import hashlib import json import os.path import re import types import sys import youtube_dl.extractor from youtube_dl import YoutubeDL from youtube_dl.utils import ( compat_str, preferredencoding, write_string, ) def get_params(override=No...
unlicense
stackforge/tricircle
tricircle/network/local_l3_plugin.py
1
2505
# Copyright 2015 Huawei Technologies Co., Ltd. # 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 # # Unl...
apache-2.0
technicalpickles/zulip
zerver/lib/bugdown/testing_mocks.py
124
8065
from __future__ import absolute_import import ujson NORMAL_TWEET = """{ "coordinates": null, "created_at": "Sat Sep 10 22:23:38 +0000 2011", "truncated": false, "favorited": false, "id_str": "112652479837110273", "in_reply_to_user_id_str": "783214", "text": "@twitter meets @seepicturely at #tcdisrupt c...
apache-2.0
totolef/Sick-beard
sickbeard/notifiers/libnotify.py
49
4677
# Author: Nic Wolfe <nic@wolfeden.ca> # URL: http://code.google.com/p/sickbeard/ # # This file is part of Sick Beard. # # Sick Beard 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 Lice...
gpl-3.0
maximmbed/mbed
tools/host_tests/hello_auto.py
122
1148
""" mbed SDK Copyright (c) 2011-2013 ARM Limited 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 wr...
apache-2.0
rkokkelk/CouchPotatoServer
libs/tornado/testing.py
22
26389
#!/usr/bin/env python """Support classes for automated testing. * `AsyncTestCase` and `AsyncHTTPTestCase`: Subclasses of unittest.TestCase with additional support for testing asynchronous (`.IOLoop` based) code. * `ExpectLog` and `LogTrapTestCase`: Make test logs less spammy. * `main()`: A simple test runner (wra...
gpl-3.0
miminar/openshift-ansible
roles/openshift_openstack/library/os_lbaas_deletion.py
15
3149
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright 2018 Red Hat, Inc. and/or its affiliates # and other contributors as indicated by the @author tags. # # 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...
apache-2.0
CingHu/neutron-ustack
neutron/plugins/ml2/drivers/arista/arista_l3_driver.py
3
18083
# Copyright 2014 Arista Networks, Inc. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless requ...
apache-2.0
fginter/twitter_pp
filter_tw.py
1
1551
#-*- coding: utf-8 -*- import json import sys import re import codecs out8=codecs.getwriter("utf-8")(sys.stdout) focus_h_tags=set((u"pakolaiset",u"refugeecrisis",u"syrianrefugees",u"syria",u"syyria",u"pakolaiskriisi",u"migrantcrisis",u"refugeeswelcome",u"migrants",u"réfugiés",u"syrie")) def keep(tweet): """in go...
mit
parlar/calls2xls
external/CrossMap/usr/lib64/python2.7/site-packages/bx/seq/seq_tests.py
7
2063
""" Tests for `bx.seq.seq`. """ import unittest import os.path import sys import bx.seq, fasta_tests, nib_tests, qdna_tests test_fa = "test_data/seq_tests/test.fa" test2_fa = "test_data/seq_tests/test2.fa" test_nib = "test_data/seq_tests/test.nib" test_qdna = "test_data/seq_tests/test.qdna" valid_fasta ...
mit
boneyao/sentry
src/sentry/migrations/0174_auto__del_field_projectkey_user_added.py
34
37246
# -*- coding: utf-8 -*- from south.utils import datetime_utils as datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Deleting field 'ProjectKey.user_added' db.delete_column(u'sentry_projec...
bsd-3-clause
darron/dd-agent
checks.d/sqlserver.py
22
17085
''' Check the performance counters from SQL Server See http://blogs.msdn.com/b/psssql/archive/2013/09/23/interpreting-the-counter-values-from-sys-dm-os-performance-counters.aspx for information on how to report the metrics available in the sys.dm_os_performance_counters table ''' # stdlib import traceback # 3rd party...
bsd-3-clause
jking6884/RESTapi
app/users/views.py
2
4603
from flask import Blueprint, request, jsonify, make_response from app.users.models import Users, UsersSchema from flask_restful import Api from app.baseviews import Resource from app.basemodels import db from sqlalchemy.exc import SQLAlchemyError from marshmallow import ValidationError from werkzeug.security import gen...
mit
mustafat/odoo-1
openerp/addons/base/tests/test_basecase.py
379
3895
# -*- coding: utf-8 -*- import unittest2 from openerp.tests import common class test_single_transaction_case(common.SingleTransactionCase): """ Check the whole-class transaction behavior of SingleTransactionCase. """ def test_00(self): """Create a partner.""" cr, uid = self.cr, self.u...
agpl-3.0
haxoza/django
tests/serializers/models/base.py
112
4314
""" Serialization ``django.core.serializers`` provides interfaces to converting Django ``QuerySet`` objects to and from "flat" data (i.e. strings). """ from __future__ import unicode_literals from decimal import Decimal from django.db import models from django.utils import six from django.utils.encoding import pytho...
bsd-3-clause
izonder/intellij-community
plugins/hg4idea/testData/bin/mercurial/cmdutil.py
90
77434
# cmdutil.py - help for command processing in mercurial # # Copyright 2005-2007 Matt Mackall <mpm@selenic.com> # # This software may be used and distributed according to the terms of the # GNU General Public License version 2 or any later version. from node import hex, nullid, nullrev, short from i18n import _ import ...
apache-2.0
matthiasdiener/spack
var/spack/repos/builtin/packages/r-xlsx/package.py
5
1669
############################################################################## # Copyright (c) 2013-2018, Lawrence Livermore National Security, LLC. # Produced at the Lawrence Livermore National Laboratory. # # This file is part of Spack. # Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved. # LLNL-CODE-64...
lgpl-2.1
neurodata/ndstore
test/params.py
2
1086
# Copyright 2014 NeuroData (http://neurodata.io) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or ag...
apache-2.0
unnikrishnankgs/va
venv/lib/python3.5/site-packages/pip/_vendor/requests/packages/urllib3/connection.py
511
11617
from __future__ import absolute_import import datetime import logging import os import sys import socket from socket import error as SocketError, timeout as SocketTimeout import warnings from .packages import six try: # Python 3 from http.client import HTTPConnection as _HTTPConnection from http.client import...
bsd-2-clause
Edu-Glez/Bank_sentiment_analysis
env/lib/python3.6/site-packages/setuptools/command/install_egg_info.py
412
2203
from distutils import log, dir_util import os from setuptools import Command from setuptools import namespaces from setuptools.archive_util import unpack_archive import pkg_resources class install_egg_info(namespaces.Installer, Command): """Install an .egg-info directory for the package""" description = "In...
apache-2.0
SiCKRAGETV/SickRage
sickrage/providers/torrent/torrentz.py
2
3890
# Author: echel0n <echel0n@sickrage.ca> # URL: https://sickrage.ca # Git: https://git.sickrage.ca/SiCKRAGE/sickrage # # This file is part of SickRage. # # SickRage 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 Foundatio...
gpl-3.0
kreatorkodi/repository.torrentbr
plugin.video.yatp/site-packages/hachoir_metadata/image.py
73
10800
from hachoir_metadata.metadata import (registerExtractor, Metadata, RootMetadata, MultipleMetadata) from hachoir_parser.image import ( BmpFile, IcoFile, PcxFile, GifFile, PngFile, TiffFile, XcfFile, TargaFile, WMF_File, PsdFile) from hachoir_parser.image.png import getBitsPerPixel as pngBitsPerPixel from ha...
gpl-2.0
michaelkourlas/gini
frontend/src/gbuilder/Core/Interfaceable.py
1
10393
"""A device that can have interfaces""" from Device import * from Attachable import * class Interfaceable(Attachable): def __init__(self): """ Create a device that can have interfaces. """ Attachable.__init__(self) self.adjacentRouterList = [] self.adj...
mit
hryamzik/ansible
lib/ansible/modules/cloud/google/gce.py
43
27529
#!/usr/bin/python # Copyright 2013 Google Inc. # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': ['preview'], ...
gpl-3.0
ramcn/demo2
crowdsourcing/models.py
5
14284
from django.contrib.auth.models import User from django.db import models from django.utils import timezone class RegistrationModel(models.Model): user = models.OneToOneField(User) activation_key = models.CharField(max_length=40) created_timestamp = models.DateTimeField(auto_now_add=True, auto_now=False) ...
mit
stackforge/solum
solum/api/controllers/v1/app.py
2
6442
# Copyright 2015 - Rackspace US, 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 agreed to in...
apache-2.0
wwj718/murp-edx
lms/djangoapps/courseware/tests/test_grades.py
33
5102
""" Test grade calculation. """ from django.http import Http404 from django.test.utils import override_settings from mock import patch from courseware.tests.modulestore_config import TEST_DATA_MIXED_MODULESTORE from student.tests.factories import UserFactory from xmodule.modulestore.tests.factories import CourseFactor...
agpl-3.0
ajdawson/colormaps
setup.py
1
2163
"""Build and install the colormaps package.""" # Copyright (c) 2012 Andrew Dawson # # 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 right...
mit
lammps/lammps
tools/python/neb_combine.py
51
2170
#!/usr/bin/env python # make new dump file by combining snapshots from multiple NEB replica dumps # Syntax: neb_combine.py -switch arg(s) -switch arg(s) ... # -o outfile = new dump file # each snapshot has NEB atoms from all replicas # -r dump1 dump2 ... = replica dump files of NEB atoms # ...
gpl-2.0
stefan-balke/librosa
tests/test_display.py
2
9298
#!/usr/bin/env python # -*- encoding: utf-8 -*- # CREATED:2015-02-14 22:51:01 by Brian McFee <brian.mcfee@nyu.edu> '''Unit tests for display module''' import warnings # Disable cache import os try: os.environ.pop('LIBROSA_CACHE_DIR') except KeyError: pass import matplotlib matplotlib.use('Agg') matplotlib.rc...
isc
hbhzwj/imalse
core/configure/Anomaly.py
2
10446
#!/usr/bin/env python ### -- [2012-03-04 14:56:03] FlowRate and FlowSize anomaly parameter has be changed as ### -- ratio instead of absolute value ##-- [2012-04-08 22:31:20] Add GenAnomalyDot ##-- [2012-04-09 18:31:22] refactoring the whole file ## -- [2012-04-10 01:14:07] FLOW_RATE can work ##-- [2012-04-10 17:16:27...
gpl-3.0
solitone/sdsreader
sdsreader.py
1
1549
import arrow, logging, time from pmuploader import PmDataUploader from sdserror import SdsError, SdsNoPacketError from sdssensor import SdsSensor LOGLEVEL = logging.INFO PORT = '/dev/serial0' # Time delta between measurements, in seconds: SAMPLING_PERIOD = 15 URL = "http://dusty.pythonanywhere.com/pm/sav...
gpl-3.0
oopy/micropython
tests/float/complex1.py
2
2018
# test basic complex number functionality # constructor print(complex(1)) print(complex(1.2)) print(complex(1.2j)) print(complex("1")) print(complex("1.2")) print(complex("1.2j")) print(complex(1, 2)) print(complex(1j, 2j)) # unary ops print(bool(1j)) print(+(1j)) print(-(1 + 2j)) # binary ops print(1j + False) prin...
mit
dmlc/tvm
tests/python/frontend/mxnet/model_zoo/inception_v3.py
5
11306
# 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...
apache-2.0
devendermishrajio/nova
nova/scheduler/filters/availability_zone_filter.py
1
2359
# Copyright (c) 2011-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.apache.org/licenses/LICENSE-2.0 # # Un...
apache-2.0
downpoured/lnzscript
lnzeditor/app/pyversion/python_extension_src/scite225_mainline/scintilla/test/XiteWin.py
5
16993
# -*- coding: utf-8 -*- from __future__ import with_statement import os, sys, unittest import ctypes from ctypes import wintypes from ctypes import c_int, c_ulong, c_char_p, c_wchar_p, c_ushort user32=ctypes.windll.user32 gdi32=ctypes.windll.gdi32 kernel32=ctypes.windll.kernel32 from MessageNumbers import msgs, sgsm...
gpl-3.0
kytvi2p/tahoe-lafs
setuptools-0.6c16dev4.egg/setuptools/command/alias.py
7
2449
import distutils, os from setuptools import Command from distutils.util import convert_path from distutils import log from distutils.errors import * from setuptools.command.setopt import edit_config, option_base, config_file def shquote(arg): """Quote an argument for later parsing by shlex.split()""" for c in ...
gpl-2.0
Jaironlanda/yowsup
yowsup/layers/protocol_groups/protocolentities/iq_groups_leave_success.py
39
1424
from yowsup.structs import ProtocolTreeNode from yowsup.layers.protocol_iq.protocolentities import ResultIqProtocolEntity class SuccessLeaveGroupsIqProtocolEntity(ResultIqProtocolEntity): ''' <iq type="result" from="g.us" id="{{ID}}"> <leave> <group id="{{GROUP_JID}}"></group> </le...
gpl-3.0
DOAJ/doaj
portality/models/editors.py
1
2710
from portality.dao import DomainObject from portality.models import Account class EditorGroup(DomainObject): __type__ = "editor_group" @classmethod def group_exists_by_name(cls, name): q = EditorGroupQuery(name) res = cls.query(q=q.query()) ids = [hit.get("_source", {}).get("id") ...
apache-2.0
p0deje/selenium
py/selenium/webdriver/firefox/service.py
7
2439
# Licensed to the Software Freedom Conservancy (SFC) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The SFC licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not...
apache-2.0
naves-thiago/mbed-midi
workspace_tools/export/iar.py
8
6321
""" mbed SDK Copyright (c) 2011-2013 ARM Limited 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 wr...
apache-2.0
keysona/python
burness/0002/save_to_mysql.py
40
1463
#-*- coding: utf-8-*- import mysql.connector config = { 'user': 'root', 'password': 'root', 'host': '127.0.0.1', 'database': 'test', 'raise_on_warnings': True, } class save_keys_to_mysql: def __init__(self,path): self.path=path print(self.path) def __conn(self,**conf): try: conn=mysql.connector....
mit
40223226/2015cd_midterm2
static/Brython3.1.1-20150328-091302/Lib/_sysconfigdata.py
731
18167
build_time_vars={'HAVE_SYS_WAIT_H': 1, 'HAVE_UTIL_H': 0, 'HAVE_SYMLINKAT': 1, 'HAVE_LIBSENDFILE': 0, 'SRCDIRS': 'Parser Grammar Objects Python Modules Mac', 'SIZEOF_OFF_T': 8, 'BASECFLAGS': '-Wno-unused-result', 'HAVE_UTIME_H': 1, 'EXTRAMACHDEPPATH': '', 'HAVE_SYS_TIME_H': 1, 'CFLAGSFORSHARED': '-fPIC', 'HAVE_HYPOT': 1...
gpl-3.0
uclaros/QGIS
tests/src/python/test_qgslayoutunitscombobox.py
45
2465
# -*- coding: utf-8 -*- """QGIS Unit tests for QgsLayoutUnitsComboBox .. note:: This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version....
gpl-2.0
proxysh/Safejumper-for-Mac
buildlinux/env32/local/lib/python2.7/sre_compile.py
28
16357
# # Secret Labs' Regular Expression Engine # # convert template to internal format # # Copyright (c) 1997-2001 by Secret Labs AB. All rights reserved. # # See the sre.py file for information on usage and redistribution. # """Internal support module for sre""" import _sre, sys import sre_parse from sre_constants impo...
gpl-2.0
abagh0703/RetailTrail
flask/lib/python2.7/site-packages/requests/packages/urllib3/util/response.py
199
2167
from __future__ import absolute_import from ..packages.six.moves import http_client as httplib from ..exceptions import HeaderParsingError def is_fp_closed(obj): """ Checks whether a given file-like object is closed. :param obj: The file-like object to check. """ try: # Check vi...
mit
sriki18/scipy
scipy/sparse/linalg/_onenormest.py
96
15138
"""Sparse block 1-norm estimator. """ from __future__ import division, print_function, absolute_import import numpy as np from scipy.sparse.linalg import aslinearoperator __all__ = ['onenormest'] def onenormest(A, t=2, itmax=5, compute_v=False, compute_w=False): """ Compute a lower bound of the 1-norm of ...
bsd-3-clause
fighterCui/L4ReFiascoOC
l4/pkg/python/contrib/Demo/tkinter/matt/dialog-box.py
47
2440
from Tkinter import * from Dialog import Dialog # this shows how to create a new window with a button in it # that can create new windows class Test(Frame): def printit(self): print "hi" def makeWindow(self): """Create a top-level dialog with some buttons. This uses the Dialog class,...
gpl-2.0
JacobJacob/pyew
pymsasid/inst.py
16
5413
from operand import O_NONE, P_none import syn_intel as intel #hack MK from syn_intel import intel_operand_syntax #from syn_att import * operator_list_invalid = [ 'invalid'] operator_list_call = ['syscall', 'call', 'vmcall', 'vmmcall'] operator_list...
gpl-2.0
arpitparmar5739/youtube-dl
youtube_dl/extractor/pornovoisines.py
113
3388
# coding: utf-8 from __future__ import unicode_literals import re import random from .common import InfoExtractor from ..utils import ( int_or_none, float_or_none, unified_strdate, ) class PornoVoisinesIE(InfoExtractor): _VALID_URL = r'http://(?:www\.)?pornovoisines\.com/showvideo/(?P<id>\d+)/(?P<di...
unlicense
ansible/ansible
lib/ansible/modules/import_role.py
15
3445
#!/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 DOCUMENTATION = r''' --- author: Ansible Core Team (@ansible) modul...
gpl-3.0
anmolonruby/mongo-connector
mongo_connector/connector.py
1
41715
# Copyright 2013-2014 MongoDB, 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 agreed to in writing...
apache-2.0
maohongyuan/kbengine
kbe/res/scripts/common/Lib/asyncio/queues.py
63
9019
"""Queues""" __all__ = ['Queue', 'PriorityQueue', 'LifoQueue', 'JoinableQueue', 'QueueFull', 'QueueEmpty'] import collections import heapq from . import events from . import futures from . import locks from .tasks import coroutine class QueueEmpty(Exception): 'Exception raised by Queue.get(block=0)/...
lgpl-3.0