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
MaxLeiter/packages.knightos.org
packages/email.py
1
1898
import smtplib import pystache import os import html.parser from email.mime.text import MIMEText from werkzeug.utils import secure_filename from flask import url_for from packages.database import db from packages.objects import User from packages.config import _cfg, _cfgi def send_confirmation(user): if _cfg("smt...
mit
synsun/robotframework
src/robot/running/handlerstore.py
2
2996
# Copyright 2008-2015 Nokia Solutions and Networks # # 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 l...
apache-2.0
wackymaster/QTClock
Libraries/matplotlib/backends/backend_webagg.py
7
12216
""" Displays Agg images in the browser, with interactivity """ from __future__ import (absolute_import, division, print_function, unicode_literals) # The WebAgg backend is divided into two modules: # # - `backend_webagg_core.py` contains code necessary to embed a WebAgg # plot inside of a web...
mit
is06/navitia
source/jormungandr/jormungandr/interfaces/v1/Disruptions.py
7
4082
# coding=utf-8 # Copyright (c) 2001-2014, Canal TP and/or its affiliates. All rights reserved. # # This file is part of Navitia, # the software to build cool stuff with public transport. # # Hope you'll enjoy and contribute to this project, # powered by Canal TP (www.canaltp.fr). # Help us simplify mobility a...
agpl-3.0
twitter/pants
src/python/pants/backend/jvm/tasks/resources_task.py
2
3211
# coding=utf-8 # Copyright 2015 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). from __future__ import absolute_import, division, print_function, unicode_literals from abc import abstractmethod from pants.task.task import Task class ResourcesTask(Ta...
apache-2.0
Omegaphora/external_chromium_org_tools_gyp
test/cflags/gyptest-cflags.py
90
1750
#!/usr/bin/env python # Copyright (c) 2012 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """ Verifies the use of the environment during regeneration when the gyp file changes, specifically via build of an executable with C prepro...
bsd-3-clause
Ernesto99/odoo
openerp/service/__init__.py
380
1613
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). # Copyright (C) 2010-2013 OpenERP SA (<http://www.openerp.com>) # # This program is free software: you c...
agpl-3.0
uqbar-project/wollok-blockly
blockly/i18n/common.py
204
7619
#!/usr/bin/python # Code shared by translation conversion scripts. # # Copyright 2013 Google Inc. # https://developers.google.com/blockly/ # # 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 # #...
lgpl-3.0
kevinr/750book-web
750book-web-env/lib/python2.7/site-packages/django/db/models/related.py
81
2269
class BoundRelatedObject(object): def __init__(self, related_object, field_mapping, original): self.relation = related_object self.field_mappings = field_mapping[related_object.name] def template_name(self): raise NotImplementedError def __repr__(self): return repr(self.__d...
mit
alfanugraha/LUMENS-repo
processing/grass/ext/r_info.py
4
1238
# -*- coding: utf-8 -*- """ *************************************************************************** r_info.py --------------------- Date : December 2012 Copyright : (C) 2012 by Victor Olaya Email : volayaf at gmail dot com ******************************...
gpl-2.0
google/apitools
samples/dns_sample/dns_v1/dns_v1_messages.py
1
16709
"""Generated message classes for dns version v1. The Google Cloud DNS API provides services for configuring and serving authoritative DNS records. """ # NOTE: This file is autogenerated and should not be edited by hand. from __future__ import absolute_import from apitools.base.protorpclite import messages as _messag...
apache-2.0
cristianquaglio/odoo
addons/account_check_writing/report/__init__.py
446
1066
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU...
apache-2.0
wspi/pyvmomi-community-samples
samples/tools/vm.py
12
1843
# VMware vSphere Python SDK Community Samples Addons # Copyright (c) 2014 VMware, 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/licen...
apache-2.0
v21/tws-to-twee-converter
tiddlywiki.py
1
11118
# # TiddlyWiki.py # # A Python implementation of the Twee compiler. # # This code was written by Chris Klimas <klimas@gmail.com> # It is licensed under the GNU General Public License v2 # http://creativecommons.org/licenses/GPL/2.0/ # # This file defines two classes: Tiddler and TiddlyWiki. These match what # you'd nor...
mit
grlee77/scipy
scipy/interpolate/ndgriddata.py
12
8976
""" Convenience interface to N-D interpolation .. versionadded:: 0.9 """ import numpy as np from .interpnd import LinearNDInterpolator, NDInterpolatorBase, \ CloughTocher2DInterpolator, _ndim_coords_from_arrays from scipy.spatial import cKDTree __all__ = ['griddata', 'NearestNDInterpolator', 'LinearNDInterpolat...
bsd-3-clause
xxshutong/openerp-7.0
openerp/addons/l10n_be/wizard/__init__.py
438
1145
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU...
agpl-3.0
mSenyor/sl4a
python/src/Tools/webchecker/tktools.py
100
11186
"""Assorted Tk-related subroutines used in Grail.""" from types import * from Tkinter import * def _clear_entry_widget(event): try: widget = event.widget widget.delete(0, INSERT) except: pass def install_keybindings(root): root.bind_class('Entry', '<Control-u>', _clear_entry_widget) def...
apache-2.0
datreant/datreant.core
src/datreant/tests/test_util.py
3
1280
from unittest import mock import os import pytest import errno import datreant as dtr def test_makedirs(tmpdir): with tmpdir.as_cwd(): dtr.util.makedirs('this/should/exist', exist_ok=True) assert os.path.exists('this/should/exist') assert os.path.isdir('this/should/exist') def test_make...
bsd-3-clause
certeu/do-portal
app/api/emails.py
1
3340
import os from mimetypes import MimeTypes from flask import request, redirect, url_for, abort, current_app from flask_jsonschema import validate from flask_mail import Message from .. import db, mail from ..models import Email, MailmanUser from .decorators import json_response from . import api #: the /emails endpoint...
bsd-3-clause
wetneb/django
tests/forms_tests/tests/test_widgets.py
10
103506
# -*- coding: utf-8 -*- from __future__ import unicode_literals import copy import datetime from django.contrib.admin.tests import AdminSeleniumWebDriverTestCase from django.core.files.uploadedfile import SimpleUploadedFile from django.core.urlresolvers import reverse from django.forms import ( BooleanField, Char...
bsd-3-clause
delinhabit/django
django/db/models/functions.py
194
6908
""" Classes that represent database functions. """ from django.db.models import DateTimeField, IntegerField from django.db.models.expressions import Func, Value class Coalesce(Func): """ Chooses, from left to right, the first non-null expression and returns it. """ function = 'COALESCE' def __ini...
bsd-3-clause
Buggaarde/youtube-dl
youtube_dl/extractor/soundgasm.py
149
2041
# coding: utf-8 from __future__ import unicode_literals import re from .common import InfoExtractor class SoundgasmIE(InfoExtractor): IE_NAME = 'soundgasm' _VALID_URL = r'https?://(?:www\.)?soundgasm\.net/u/(?P<user>[0-9a-zA-Z_\-]+)/(?P<title>[0-9a-zA-Z_\-]+)' _TEST = { 'url': 'http://soundgasm....
unlicense
taxido/django-xadmin
xadmin/plugins/details.py
37
2923
from django.utils.translation import ugettext as _ from django.core.urlresolvers import reverse, NoReverseMatch from django.db import models from xadmin.sites import site from xadmin.views import BaseAdminPlugin, ListAdminView class DetailsPlugin(BaseAdminPlugin): show_detail_fields = [] show_all_rel_deta...
bsd-3-clause
strint/tensorflow
tensorflow/contrib/session_bundle/bundle_shim_test.py
147
16424
# 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
codrut3/tensorflow
tensorflow/contrib/timeseries/examples/known_anomaly.py
53
6786
# Copyright 2017 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
rdallasgray/melpa
scripts/process_log.py
155
3709
#!/usr/bin/env python import argparse from datetime import datetime import gzip import json import os import re import sys import time import tempfile import sqlite3 from operator import or_ LOGFILE = "/home/melpa/log/melpa.access.log" LOGREGEX = r'(?P<ip>[\d.]+) [ -]+ \[(?P<date>[\w/: +-]+)\] ' \ r'"GET ...
gpl-3.0
Hybrid-Rom/kernel_lge_ls970
scripts/gcc-wrapper.py
501
3410
#! /usr/bin/env python # -*- coding: utf-8 -*- # Copyright (c) 2011-2012, Code Aurora Forum. 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 a...
gpl-2.0
crazyAxe/tp-libvirt
libvirt/tests/src/virsh_cmd/volume/virsh_volume_application.py
4
6513
import os import logging from autotest.client.shared import error from avocado.utils import process from virttest import libvirt_storage from virttest import virsh from virttest import data_dir from virttest import utils_selinux from virttest.utils_test import libvirt as utlv from virttest.tests import unattended_in...
gpl-2.0
Voluntarynet/BitmessageKit
BitmessageKit/Vendor/static-python/Lib/idlelib/Percolator.py
91
2616
from idlelib.WidgetRedirector import WidgetRedirector from idlelib.Delegator import Delegator class Percolator: def __init__(self, text): # XXX would be nice to inherit from Delegator self.text = text self.redir = WidgetRedirector(text) self.top = self.bottom = Delegator(text) ...
mit
pfmoore/pip
src/pip/_vendor/requests/status_codes.py
63
4188
# -*- coding: utf-8 -*- r""" The ``codes`` object defines a mapping from common names for HTTP statuses to their numerical codes, accessible either as attributes or as dictionary items. Example:: >>> import requests >>> requests.codes['temporary_redirect'] 307 >>> requests.codes.teapot 418 >>...
mit
googleapis/python-aiplatform
samples/snippets/export_model_tabular_classification_sample_test.py
1
1578
# Copyright 2020 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
apache-2.0
jordanemedlock/psychtruths
temboo/Library/Parse/GeoPoints/GeoPoint.py
5
3871
# -*- coding: utf-8 -*- ############################################################################### # # GeoPoint # Associates a Geo point with an existing object. # # Python versions 2.6, 2.7, 3.x # # Copyright 2014, Temboo Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use ...
apache-2.0
plotly/plotly.py
packages/python/plotly/plotly/graph_objs/scattergeo/_marker.py
1
59392
from plotly.basedatatypes import BaseTraceHierarchyType as _BaseTraceHierarchyType import copy as _copy class Marker(_BaseTraceHierarchyType): # class properties # -------------------- _parent_path_str = "scattergeo" _path_str = "scattergeo.marker" _valid_props = { "autocolorscale", ...
mit
tmerrick1/spack
lib/spack/spack/reporters/__init__.py
42
1235
############################################################################## # 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
edofic/ggrc-core
src/ggrc_basic_permissions/migrations/versions/20140118142225_41270fab9540_convert_all_roles_to.py
7
2059
# Copyright (C) 2016 Google Inc. # Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file> """Convert all roles to code declared roles. Revision ID: 41270fab9540 Revises: 4ab49eafe820 Create Date: 2014-01-18 14:22:25.419593 """ # revision identifiers, used by Alembic. revision = '41270fab9540'...
apache-2.0
PriviPK/privipk-sync-engine
tests/api/test_views.py
2
1202
import pytest from tests.util.base import api_client, test_client def generic_test_resource(resource_name, db, client): """Exercises various tests for views, mostly related to filtering. Note: this only tests views, it assumes the resources are working as expected.""" elements = client.get_data('/{}'....
agpl-3.0
wilvk/ansible
lib/ansible/modules/files/ini_file.py
34
10180
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright: (c) 2012, Jan-Piet Mens <jpmens () gmail.com> # Copyright: (c) 2015, Ales Nosek <anosek.nosek () gmail.com> # Copyright: (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 ...
gpl-3.0
lisael/pg-django
django/template/loaders/filesystem.py
90
1941
""" Wrapper for loading templates from the filesystem. """ from django.conf import settings from django.template.base import TemplateDoesNotExist from django.template.loader import BaseLoader from django.utils._os import safe_join class Loader(BaseLoader): is_usable = True def get_template_sources(self, temp...
bsd-3-clause
ToBeReplaced/ansible-modules-extras
cloud/vmware/vmware_dvs_host.py
49
8500
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2015, Joseph Callen <jcallen () csc.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 Li...
gpl-3.0
batxes/4c2vhic
Six_mouse_models/Six_mouse_models_final_output_0.2_-0.1_11000/Six_mouse_models30079.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
srimai/odoo
addons/base_setup/res_config.py
261
5089
# -*- 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
vmthunder/nova
nova/openstack/common/middleware/base.py
40
1854
# Copyright 2011 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 # # Unless req...
apache-2.0
bottompawn/kbengine
kbe/src/lib/python/Lib/test/test_sys.py
60
38258
import unittest, test.support from test.script_helper import assert_python_ok, assert_python_failure import sys, io, os import struct import subprocess import textwrap import warnings import operator import codecs import gc import sysconfig import platform # count the number of test runs, used to create unique # strin...
lgpl-3.0
vuntz/glance
glance/contrib/plugins/artifacts_sample/base.py
14
1205
# Copyright 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 # # Unless...
apache-2.0
csherwood-usgs/landlab
landlab/io/gebco/read.py
6
2904
#! /usr/bin/env python """Read data from a GEBCO NetCDF file into a RasterModelGrid.""" try: import netCDF4 as nc4 except ImportError: import warnings warnings.warn('Unable to import netCDF4.', ImportWarning) from scipy.io import netcdf as nc from landlab import RasterModelGrid from landlab.io.netcdf.er...
mit
souravbadami/zulip
zerver/management/commands/bulk_change_user_name.py
42
1299
from __future__ import absolute_import from __future__ import print_function from typing import Any from argparse import ArgumentParser from django.core.management.base import BaseCommand from zerver.lib.actions import do_change_full_name from zerver.models import UserProfile, get_user_profile_by_email class Comman...
apache-2.0
tensorflow/tpu
models/official/retinanet/dataloader.py
1
21006
# 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
boh1996/LectioAPI
scrapers/phase.py
1
6108
#!/usr/bin/python # -*- coding: utf8 -*- from bs4 import BeautifulSoup as Soup import urls import re import proxy from datetime import * import time from time import mktime import values import codecs import functions import authenticate def phase ( config, session = False ): url = "https://www.lectio.dk/lectio/%s/s...
mit
dmoliveira/networkx
networkx/algorithms/centrality/tests/test_current_flow_betweenness_centrality.py
89
7721
#!/usr/bin/env python from nose.tools import * from nose import SkipTest import networkx from nose.plugins.attrib import attr from networkx import edge_current_flow_betweenness_centrality \ as edge_current_flow from networkx import approximate_current_flow_betweenness_centrality \ as approximate_cfbc class T...
bsd-3-clause
RuudBurger/CouchPotatoServer
libs/requests/packages/urllib3/util/retry.py
699
9924
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. Each retry attempt will create a new Re...
gpl-3.0
openhatch/oh-mainline
vendor/packages/Django/django/contrib/localflavor/it/forms.py
100
3180
""" IT-specific Form helpers """ from __future__ import absolute_import, unicode_literals import re from django.contrib.localflavor.it.it_province import PROVINCE_CHOICES from django.contrib.localflavor.it.it_region import REGION_CHOICES from django.contrib.localflavor.it.util import ssn_check_digit, vat_number_chec...
agpl-3.0
victos/busuu_anki
anki/exporting.py
1
10693
# -*- coding: utf-8 -*- # Copyright: Damien Elmes <anki@ichi2.net> # License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html import os import re import shutil import zipfile from anki import Collection from anki.hooks import runHook from anki.lang import _ from anki.utils import ids2str, splitFie...
agpl-3.0
Tesora-Release/tesora-trove
trove/tests/scenario/helpers/mongodb_helper.py
6
1634
# Copyright 2015 Tesora Inc. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by a...
apache-2.0
luisguiserrano/luisguiserrano.github.io
node_modules/node-gyp/gyp/pylib/gyp/generator/cmake.py
1355
44604
# Copyright (c) 2013 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """cmake output module This module is under development and should be considered experimental. This module produces cmake (2.8.8+) input as its output. One CMake...
mit
jwhitlock/django-allauth
allauth/socialaccount/providers/xing/tests.py
10
1938
# -*- coding: utf-8 -*- from __future__ import unicode_literals from allauth.socialaccount.tests import OAuthTestsMixin from allauth.tests import MockedResponse, TestCase from .provider import XingProvider class XingTests(OAuthTestsMixin, TestCase): provider_id = XingProvider.id def get_mocked_response(sel...
mit
calcutec/homeporch
db_repository/versions/005_migration.py
3
1054
from sqlalchemy import * from migrate import * from migrate.changeset import schema pre_meta = MetaData() post_meta = MetaData() post = Table('post', pre_meta, Column('id', INTEGER, primary_key=True, nullable=False), Column('header', VARCHAR(length=140)), Column('body', TEXT), Column('timestamp', TIME...
bsd-3-clause
shurihell/testasia
common/djangoapps/student/tests/test_parental_controls.py
155
3850
"""Unit tests for parental controls.""" import datetime from django.test import TestCase from django.test.utils import override_settings from student.models import UserProfile from student.tests.factories import UserFactory class ProfileParentalControlsTest(TestCase): """Unit tests for requires_parental_consent...
agpl-3.0
leoc/home-assistant
homeassistant/components/device_tracker/automatic.py
6
5190
""" Support for the Automatic platform. For more details about this platform, please refer to the documentation at https://home-assistant.io/components/device_tracker.automatic/ """ from datetime import timedelta import logging import re import requests import voluptuous as vol from homeassistant.components.device_t...
mit
MCME/WebStatus
mcmeAPI/lib/requests/packages/chardet/euckrfreq.py
3121
45978
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is Mozilla Communicator client code. # # The Initial Developer of the Original Code is # Netscape Communications Corporation. # Portions created by the Initial Developer are Copyright (C) 1998 # the Initial Developer. All Rights R...
gpl-3.0
bikashgupta11/javarobot
src/main/resources/jython/Lib/selenium/webdriver/common/actions/input_device.py
39
1279
# 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...
gpl-3.0
halberom/ansible
lib/ansible/modules/cloud/amazon/ec2_lc_facts.py
25
7245
#!/usr/bin/python # -*- coding: utf-8 -*- # # This is a 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. # # This Ansible library is distri...
gpl-3.0
Orav/kbengine
kbe/res/scripts/common/Lib/test/test_decimal.py
2
208691
# Copyright (c) 2004 Python Software Foundation. # All rights reserved. # Written by Eric Price <eprice at tjhsst.edu> # and Facundo Batista <facundo at taniquetil.com.ar> # and Raymond Hettinger <python at rcn.com> # and Aahz (aahz at pobox.com) # and Tim Peters """ These are the test cases for...
lgpl-3.0
hcwiley/the-front
the_front/the_front/artist/models.py
1
2604
from django.db import models from django.conf import settings from django.utils.text import slugify from django.contrib.auth.models import User from front_material.models import FrontMedia # Create your models here. class Artist(models.Model): name = models.CharField(max_length=100, blank=False, null=False, default...
gpl-2.0
teltek/edx-platform
lms/djangoapps/grades/subsection_grade_factory.py
17
7117
from collections import OrderedDict from logging import getLogger from lazy import lazy from courseware.model_data import ScoresClient from lms.djangoapps.grades.config import assume_zero_if_absent, should_persist_grades from lms.djangoapps.grades.models import PersistentSubsectionGrade from lms.djangoapps.grades.sco...
agpl-3.0
Bismarrck/tensorflow
tensorflow/python/ops/unconnected_gradients.py
40
1787
# Copyright 2017 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
thinkasoft/ProyectoRD-dev
l10n_ve_fiscal_book/model/invoice.py
1
3527
#!/usr/bin/python # -*- 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
Nashenas88/servo
tests/wpt/web-platform-tests/old-tests/webdriver/element_location/element_location_test.py
142
2647
import os import sys import unittest sys.path.insert(1, os.path.abspath(os.path.join(__file__, "../.."))) import base_test class ElementLocationTest(base_test.WebDriverBaseTest): def test_find_element_by_name(self): self.driver.get(self.webserver.where_is("element_location/res/elements.html")) e =...
mpl-2.0
broferek/ansible
lib/ansible/plugins/action/ios.py
3
3596
# # (c) 2016 Red Hat Inc. # # 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 d...
gpl-3.0
timzhangau/ml_nano
smartcab/visuals.py
17
7709
########################################### # Suppress matplotlib user warnings # Necessary for newer version of matplotlib import warnings warnings.filterwarnings("ignore", category = UserWarning, module = "matplotlib") ########################################### # # Display inline matplotlib plots with IPython from I...
mit
valentin-krasontovitsch/ansible
lib/ansible/modules/cloud/google/gcp_sql_database.py
1
9605
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright (C) 2017 Google # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # ---------------------------------------------------------------------------- # # *** AUTO GENERATED CODE *** AUTO GENERATED CODE *** # ...
gpl-3.0
jdotjdot/Coding-Fun
Facebook Hacker Cup/deadpixels.py
1
2899
from __future__ import division import re def split_string(m, k): return re.findall('.'*(len(k)/m), k) class Memoize: def __init__ (self, f): self.f = f self.mem = {} def __call__(self, *args, **kwargs): if (args, str(kwargs)) in self.mem: return self.mem[args, str(kwargs)] else: tmp = self.f(*arg...
mit
nburn42/tensorflow
tensorflow/contrib/distribute/python/cross_tower_ops.py
1
23227
# 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
johankaito/fufuka
microblog/old-flask/lib/python2.7/site-packages/wtforms/ext/csrf/form.py
177
1785
from __future__ import unicode_literals from wtforms.form import Form from wtforms.validators import ValidationError from .fields import CSRFTokenField class SecureForm(Form): """ Form that enables CSRF processing via subclassing hooks. """ csrf_token = CSRFTokenField() def __init__(self, formd...
apache-2.0
backmari/moose
gui/gui/InputFileTextbox.py
8
8545
#!/usr/bin/python import os, sys, getopt try: from PyQt4 import QtCore, QtGui QtCore.Signal = QtCore.pyqtSignal QtCore.Slot = QtCore.pyqtSlot except ImportError: try: from PySide import QtCore, QtGui QtCore.QString = str except ImportError: raise ImportError("Cannot load eit...
lgpl-2.1
danShumway/python_math
source/PythonMath.activity/libraries/gprof2dot.py
6
88594
#!/usr/bin/env python # # Copyright 2008-2009 Jose Fonseca # # This program 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 later version. # # ...
mit
ms7s/tornado
tornado/platform/common.py
285
3403
"""Lowest-common-denominator implementations of platform functionality.""" from __future__ import absolute_import, division, print_function, with_statement import errno import socket from tornado.platform import interface class Waker(interface.Waker): """Create an OS independent asynchronous pipe. For use ...
apache-2.0
ryfeus/lambda-packs
Sklearn_scipy_numpy/source/numpy/distutils/command/build_clib.py
152
12217
""" Modified version of build_clib that handles fortran source files. """ from __future__ import division, absolute_import, print_function import os from glob import glob import shutil from distutils.command.build_clib import build_clib as old_build_clib from distutils.errors import DistutilsSetupError, DistutilsError...
mit
cvium/Flexget
flexget/plugins/input/plex.py
6
15444
"""Plugin for plex media server (www.plexapp.com).""" from xml.dom.minidom import parseString import re import logging import os from os.path import basename from socket import gethostbyname from flexget import plugin from flexget.entry import Entry from flexget.event import event from flexget.utils import requests l...
mit
bowang/tensorflow
tensorflow/contrib/tensor_forest/hybrid/python/models/hard_decisions_to_data_then_nn.py
189
2852
# 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
asnorkin/sentiment_analysis
site/lib/python2.7/site-packages/scipy/sparse/linalg/tests/test_interface.py
38
12724
"""Test functions for the sparse.linalg.interface module """ from __future__ import division, print_function, absolute_import from functools import partial from itertools import product import operator import nose from numpy.testing import TestCase, assert_, assert_equal, \ assert_raises import numpy as np ...
mit
Hasimir/brython
www/src/Lib/test/test_tuple.py
104
6941
from test import support, seq_tests import gc import pickle class TupleTest(seq_tests.CommonTest): type2test = tuple def test_constructors(self): super().test_constructors() # calling built-in types without argument must return empty self.assertEqual(tuple(), ()) t0_3 = (0, 1,...
bsd-3-clause
sander76/home-assistant
homeassistant/components/miflora/sensor.py
3
7891
"""Support for Xiaomi Mi Flora BLE plant sensor.""" from datetime import timedelta import logging import btlewrap from btlewrap import BluetoothBackendException from miflora import miflora_poller import voluptuous as vol from homeassistant.components.sensor import PLATFORM_SCHEMA, SensorEntity from homeassistant.con...
apache-2.0
mistercrunch/airflow
tests/ti_deps/deps/test_runnable_exec_date_dep.py
5
4457
# # 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...
apache-2.0
tillahoffmann/tensorflow
tensorflow/tools/api/generator/create_python_api.py
16
6624
# Copyright 2017 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
Pluto-tv/chromium-crosswalk
chrome/app/nibs/PRESUBMIT.py
4
3054
# 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. """Presubmit script to verify that XIB changes are done with the right version. See http://dev.chromium.org/developers/design-documents/mac-xib-files fo...
bsd-3-clause
OlgaLa/task_1
fixture/contact.py
1
14000
import re from selenium.webdriver.support.ui import Select from model.parameters import Contact class ContactHelper: def __init__(self, app): self.app = app def enter_address(self, address): wd = self.app.wd wd.find_element_by_name("address2").click() wd.find_element_by_name(...
apache-2.0
zhuwenping/python-for-android
python3-alpha/python3-src/Lib/mailbox.py
45
75952
#! /usr/bin/env python3 """Read/write support for Maildir, mbox, MH, Babyl, and MMDF mailboxes.""" # Notes for authors of new mailbox subclasses: # # Remember to fsync() changes to disk before closing a modified file # or returning from a flush() method. See functions _sync_flush() and # _sync_close(). import sys i...
apache-2.0
yousafsyed/casperjs
bin/Lib/distutils/tests/test_install_data.py
147
2603
"""Tests for distutils.command.install_data.""" import sys import os import unittest import getpass from distutils.command.install_data import install_data from distutils.tests import support from test.support import run_unittest class InstallDataTestCase(support.TempdirManager, support.Logg...
mit
calvinsettachatgul/athena
athena_env/lib/python3.7/site-packages/pip/_vendor/chardet/langgreekmodel.py
269
12688
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is Mozilla Communicator client code. # # The Initial Developer of the Original Code is # Netscape Communications Corporation. # Portions created by the Initial Developer are Copyright (C) 1998 # the Initial Developer. All Rights R...
mit
nwjs/chromium.src
build/android/pylib/base/environment.py
11
1307
# Copyright 2014 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. class Environment(object): """An environment in which tests can be run. This is expected to handle all logic that is applicable to an entire specific ...
bsd-3-clause
electrumalt/electrum-doge
gui/qt/transaction_dialog.py
1
7691
#!/usr/bin/env python # # Electrum - lightweight Bitcoin client # Copyright (C) 2012 thomasv@gitorious # # 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...
gpl-3.0
zenweasel/i-python-gitlab
gitlab/__init__.py
1
40542
# -*- coding: utf-8 -*- """ python-gitlab, a gitlab python wrapper for the gitlab API by Itxaka Serrano Garcia <itxakaserrano@gmail.com> """ import requests import json import markdown class Gitlab(object): """ Gitlab class """ def __init__(self, host, user, token=""): """ on init we ...
gpl-3.0
cms-externals/openloops
scons-local/scons-local-2.3.0/SCons/Tool/install.py
11
17425
"""SCons.Tool.install Tool-specific initialization for the install tool. There normally shouldn't be any need to import this module directly. It will usually be imported through the generic SCons.Tool.Tool() selection method. """ # # Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 201...
gpl-3.0
ivan-fedorov/intellij-community
python/lib/Lib/urlparse.py
99
12042
"""Parse (absolute and relative) URLs. See RFC 1808: "Relative Uniform Resource Locators", by R. Fielding, UC Irvine, June 1995. """ __all__ = ["urlparse", "urlunparse", "urljoin", "urldefrag", "urlsplit", "urlunsplit"] # A classification of schemes ('' means apply by default) uses_relative = ['ftp', 'htt...
apache-2.0
webOS-ports/qtwebkit
Tools/Scripts/webkitpy/common/config/contributionareas.py
121
8537
# Copyright (c) 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 of conditions and the ...
gpl-2.0
RadonX-ROM/external_skia
tools/roll_deps.py
68
19518
#!/usr/bin/python2 # Copyright 2014 Google Inc. # # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Skia's Chromium DEPS roll script. This script: - searches through the last N Skia git commits to find out the hash that is associated with the SVN revision numb...
bsd-3-clause
DavidLP/home-assistant
homeassistant/components/smappee/__init__.py
6
12597
"""Support for Smappee energy monitor.""" import logging from datetime import datetime, timedelta import re import voluptuous as vol from requests.exceptions import RequestException from homeassistant.const import ( CONF_USERNAME, CONF_PASSWORD, CONF_HOST ) from homeassistant.util import Throttle from homeassistant...
apache-2.0
Cloud-CV/CloudCV
tests/unit/demos/test_views.py
1
3456
import os from django.core.urlresolvers import reverse_lazy from rest_framework import status from rest_framework.test import APITestCase from django.core.files.uploadedfile import SimpleUploadedFile from demos.models import Demo, Project class GetDemoTest(APITestCase): def setUp(self): self.url = rever...
gpl-3.0
ds-hwang/chromium-crosswalk
tools/perf/metrics/__init__.py
22
1413
# Copyright 2013 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. class Metric(object): """Base class for all the metrics that are used by telemetry measurements. The Metric class represents a way of measuring somethi...
bsd-3-clause
wirwolf/minexcoin
qa/rpc-tests/p2p-versionbits-warning.py
86
6836
#!/usr/bin/env python3 # Copyright (c) 2016 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. from test_framework.mininode import * from test_framework.test_framework import BitcoinTestFramework from test...
mit