repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
tensorflow/federated | refs/heads/master | tensorflow_federated/python/simulation/baselines/stackoverflow/tag_prediction_preprocessing.py | 1 | # 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing... |
castlecms/castle.cms | refs/heads/master | castle/cms/tasks/email.py | 1 | from castle.cms import subscribe
from castle.cms import utils
from castle.cms.browser.utils import Utils
from collective.celery import task
from plone import api
from urllib import urlencode
from zope.globalrequest import getRequest
@task.as_admin()
def send_email(*args, **kwargs):
utils.send_email(*args, **kwarg... |
bhilburn/gnuradio | refs/heads/master | gr-filter/examples/benchmark_filters.py | 17 | #!/usr/bin/env python
#
# Copyright 2005-2007,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 ... |
smn/garelay | refs/heads/develop | setup.py | 1 | import os
from setuptools import setup, find_packages
here = os.path.abspath(os.path.dirname(__file__))
with open(os.path.join(here, 'README.rst')) as f:
README = f.read()
with open(os.path.join(here, 'requirements.txt')) as f:
requires = filter(None, f.readlines())
with open(os.path.join(here, 'VERSION')) ... |
RAPD/RAPD | refs/heads/master | src/plugins/subcontractors/aimless.py | 1 | """Functions for parsing aimless logs"""
"""
This file is part of RAPD
Copyright (C) 2017, Cornell University
All rights reserved.
RAPD is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, version 3.
RAPD is... |
Cinntax/home-assistant | refs/heads/dev | homeassistant/components/device_tracker/setup.py | 3 | """Device tracker helpers."""
import asyncio
from typing import Dict, Any, Callable, Optional
from types import ModuleType
import attr
from homeassistant.core import callback
from homeassistant.setup import async_prepare_setup_platform
from homeassistant.helpers import config_per_platform
from homeassistant.exception... |
flochaz/horizon | refs/heads/stable/juno | openstack_dashboard/dashboards/project/access_and_security/keypairs/urls.py | 6 | # 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... |
nhorelik/django-rest-framework | refs/heads/master | rest_framework/utils/model_meta.py | 71 | """
Helper function for returning the field information that is associated
with a model class. This includes returning all the forward and reverse
relationships and their associated metadata.
Usage: `get_field_info(model)` returns a `FieldInfo` instance.
"""
import inspect
from collections import namedtuple
from djan... |
abhisg/scikit-learn | refs/heads/master | sklearn/__init__.py | 2 | """
Machine learning module for Python
==================================
sklearn is a Python module integrating classical machine
learning algorithms in the tightly-knit world of scientific Python
packages (numpy, scipy, matplotlib).
It aims to provide simple and efficient solutions to learning problems
that are acc... |
SchrodingersGat/kicad-library-utils | refs/heads/master | schlib/rules/S7_1.py | 2 | # -*- coding: utf-8 -*-
from rules.rule import *
import re
class Rule(KLCRule):
"""
Create the methods check and fix to use with the kicad lib files.
"""
def __init__(self, component):
super(Rule, self).__init__(component, 'Power-flag symbols follow some special rules/KLC-exceptions')
... |
jcsaaddupuy/clu-python | refs/heads/master | src/tests/test_configurableagent.py | 1 | #!/usr/bin/env python2
import unittest
from mock import Mock, MagicMock
from clu.agents.base import ConfigurableCluAgent
from clu.agents import CluAgent, ConfigurableCluAgent, CluException, CluAgentException
class ConfigurableCluAgentTestCase(unittest.TestCase):
def test_init_empty_params(self):
co = Configur... |
conductor-tutti/space_for_us | refs/heads/master | lib/werkzeug/contrib/sessions.py | 295 | # -*- coding: utf-8 -*-
r"""
werkzeug.contrib.sessions
~~~~~~~~~~~~~~~~~~~~~~~~~
This module contains some helper classes that help one to add session
support to a python WSGI application. For full client-side session
storage see :mod:`~werkzeug.contrib.securecookie` which implements a
secure,... |
openatx/uiautomator2 | refs/heads/master | uiautomator2/widget.py | 1 | # coding: utf-8
#
import logging
import re
import time
from collections import defaultdict, namedtuple
from functools import partial
from pprint import pprint
from typing import Union
import requests
from logzero import logger, setup_logger
from lxml import etree
import uiautomator2 as u2
import uiautomator2.image as... |
sriks/titanium_mobile | refs/heads/master | support/android/androidsdk.py | 32 | #!/usr/bin/python
#
# An autodetection utility for the Android SDK
#
import os, sys, platform, glob, subprocess, types, re
DEFAULT_API_LEVEL = 21
android_api_levels = {
3: 'android-1.5',
4: 'android-1.6',
5: 'android-2.0',
6: 'android-2.0.1',
7: 'android-2.1',
8: 'android-2.2',
9: 'android-2.3',
10: 'android... |
Zentyal/mss | refs/heads/samba4-poc | modules/davical/__init__.py | 3 | # -*- coding: UTF-8 -*-
#
# (c) 2012 Mandriva, http://www.mandriva.com/
#
# This file is part of Mandriva Server Setup
#
# MSS 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, o... |
kylemsguy/FPGA-Litecoin-Miner | refs/heads/master | ICARUS-LX150/MiningSoftware/pyserial-2.6/test/test_iolib.py | 6 | #! /usr/bin/env python
#
# Python Serial Port Extension for Win32, Linux, BSD, Jython
# see __init__.py
#
# (C) 2001-2009 Chris Liechti <cliechti@gmx.net>
# this is distributed under a free software license, see license.txt
"""\
Some tests for the serial module.
Part of pyserial (http://pyserial.sf.net) (C)2001-2009 ... |
NickelMedia/phantomjs | refs/heads/master | src/qt/qtwebkit/Tools/Scripts/webkitpy/port/factory.py | 118 | # Copyright (C) 2010 Google Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the ... |
yoer/hue | refs/heads/master | desktop/core/ext-py/Django-1.6.10/tests/logging_tests/views.py | 126 | from __future__ import unicode_literals
from django.core.exceptions import SuspiciousOperation, DisallowedHost
def suspicious(request):
raise SuspiciousOperation('dubious')
def suspicious_spec(request):
raise DisallowedHost('dubious')
|
smalyshev/pywikibot-core | refs/heads/master | scripts/pagefromfile.py | 3 | #!/usr/bin/python
# -*- coding: utf-8 -*-
r"""
Bot to upload pages from a file.
This bot takes its input from a file that contains a number of
pages to be put on the wiki. The pages should all have the same
begin and end text (which may not overlap).
By default the text should have the intended title of the page
as ... |
ktsitsikas/odemis | refs/heads/master | src/odemis/acq/drift/__init__.py | 1 | # -*- coding: utf-8 -*-
"""
Created on 27 Feb 2014
@author: Kimon Tsitsikas
Copyright © 2013-2014 Éric Piel & Kimon Tsitsikas, Delmic
This file is part of Odemis.
Odemis is free software: you can redistribute it and/or modify it under the
terms of the GNU General Public License version 2 as published by the Free
S... |
mogotest/selenium | refs/heads/master | remote/client/src/py/errorhandler.py | 1 | # Copyright 2010 WebDriver committers
# Copyright 2010 Google 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 ap... |
brandonium21/snowflake | refs/heads/master | snowflakeEnv/lib/python2.7/site-packages/pip/_vendor/distlib/metadata.py | 427 | # -*- coding: utf-8 -*-
#
# Copyright (C) 2012 The Python Software Foundation.
# See LICENSE.txt and CONTRIBUTORS.txt.
#
"""Implementation of the Metadata for Python packages PEPs.
Supports all metadata formats (1.0, 1.1, 1.2, and 2.0 experimental).
"""
from __future__ import unicode_literals
import codecs
from email... |
natefoo/pip | refs/heads/develop | pip/cmdoptions.py | 34 | """
shared options and groups
The principle here is to define options once, but *not* instantiate them
globally. One reason being that options with action='append' can carry state
between parses. pip parses general options twice internally, and shouldn't
pass on state. To be consistent, all options will follow this de... |
bukepo/openthread | refs/heads/master | tools/harness-automation/cases/router_5_1_2.py | 18 | #!/usr/bin/env python
#
# Copyright (c) 2016, The OpenThread Authors.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# 1. Redistributions of source code must retain the above copyright
# notic... |
angelapper/edx-platform | refs/heads/master | openedx/features/course_bookmarks/plugins.py | 8 | """
Platform plugins to support course bookmarks.
"""
from courseware.access import has_access
from django.core.urlresolvers import reverse
from django.utils.translation import ugettext as _
from openedx.features.course_experience.course_tools import CourseTool
from student.models import CourseEnrollment
class Cours... |
dsiganos/git-repo | refs/heads/master | command.py | 9 | #
# Copyright (C) 2008 The Android Open Source Project
#
# 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 la... |
wimac/home | refs/heads/master | Dropbox/skel/bin/sick-beard/cherrypy/lib/caching.py | 35 | import datetime
import threading
import time
import cherrypy
from cherrypy.lib import cptools, httputil
class Cache(object):
def get(self):
raise NotImplemented
def put(self, obj, size):
raise NotImplemented
def delete(self):
raise NotImplemented
... |
izapolsk/integration_tests | refs/heads/master | cfme/fixtures/artifactor_plugin.py | 1 | """An example config::
artifactor:
log_dir: /home/test/workspace/cfme_tests/artiout
per_run: test #test, run, None
reuse_dir: True
squash_exceptions: False
threaded: False
server_address: 127.0.0.1
server_port: 21212
server_enabled: True
plugi... |
michael-dev2rights/ansible | refs/heads/ansible-d2r | lib/ansible/modules/network/aci/aci_bd.py | 22 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# 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'],
... |
Gebesa-Dev/Addons-gebesa | refs/heads/9.0 | sales_order_dealer/models/mrp_production.py | 1 | # -*- coding: utf-8 -*-
# Copyright 2018, Esther Cisneros
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from openerp import fields, models
class MrpProduction(models.Model):
_name = 'mrp.production'
_inherit = 'mrp.production'
dealer_id = fields.Many2one('res.partner', string="Com... |
elec-otago/agbase | refs/heads/master | testing/selenium-tests/test_user_change_farm_permission.py | 1 | from end_to_end_test import EndToEndTest
import test_config as config
#=============================================================
# This tests that an account with permission to manage a farm
# can give another account management permissions.
# Requires test farm, test farmer, and test farm manager to
# be created... |
USStateDept/FPA_Core | refs/heads/master | openspending/tests/model/test_country.py | 2 | import json
import urllib2
from flask import url_for, current_app
from openspending.core import db
from openspending.model.country import Country
from openspending.tests.base import ControllerTestCase
from openspending.command.geometry import create as createcountries
class TestCountryModel(ControllerTestCase):... |
fzadow/CATMAID | refs/heads/master | scripts/database/backup-database.py | 4 | #!/usr/bin/env python
# This is a small helper script to back up a CATMAID
# database.
# For example, I'm calling this script from cron with the following
# crontab entry, which will cause a backup to happen every 8 hours at
# 20 past the hour:
#
# 20 0-23/8 * * * CATMAID_CONFIGURATION=$HOME/.catmaid-db.whatever $HOM... |
alanmcruickshank/superset-dev | refs/heads/master | superset/utils.py | 1 | """Utility functions used across Superset"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
from builtins import object
from datetime import date, datetime, time, timedelta
import decimal
from email.mime.application i... |
elba7r/lite-system | refs/heads/master | erpnext/schools/doctype/student_log/student_log.py | 54 | # -*- coding: utf-8 -*-
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe.model.document import Document
class StudentLog(Document):
pass
|
andrea4ever/l10n-italy | refs/heads/8.0 | __unported__/l10n_it_DDT_webkit/__init__.py | 3 | # -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2013
# Associazione OpenERP Italia (<http://www.openerp-italia.org>)
#
# Copyright (c) 2013 Agile Business Group (http://www.agilebg.com)
# @author Lorenzo Battistini
#
# This program ... |
balloob/home-assistant | refs/heads/dev | homeassistant/components/zoneminder/camera.py | 27 | """Support for ZoneMinder camera streaming."""
import logging
from homeassistant.components.mjpeg.camera import (
CONF_MJPEG_URL,
CONF_STILL_IMAGE_URL,
MjpegCamera,
filter_urllib3_logging,
)
from homeassistant.const import CONF_NAME, CONF_VERIFY_SSL
from . import DOMAIN as ZONEMINDER_DOMAIN
_LOGGER =... |
dsemi/Flexget | refs/heads/develop | flexget/plugins/__init__.py | 44 | """Standard plugin package."""
|
nickdechant/teletraan | refs/heads/master | deploy-agent/deployd/common/executor.py | 6 | # Copyright 2016 Pinterest, 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... |
crosswalk-project/blink-crosswalk | refs/heads/master | Tools/Scripts/webkitpy/common/net/buildbot/buildbot_unittest.py | 35 | # Copyright (C) 2009 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 f... |
g-weatherill/hmtk | refs/heads/master | hmtk/faults/mfd/anderson_luco_area_mmax.py | 1 | # -*- coding: utf-8 -*-
# vim: tabstop=4 shiftwidth=4 softtabstop=4
#
# LICENSE
#
# Copyright (c) 2010-2013, GEM Foundation, G. Weatherill, M. Pagani,
# D. Monelli.
#
# The Hazard Modeller's Toolkit is free software: you can redistribute
# it and/or modify it under the terms of the GNU Affero General Public
#License a... |
evanbiederstedt/RRBSfun | refs/heads/master | scripts/repeat_finder_scripts/repeat_finder_RRBS_NormalBCD19pCD27pcell67_88_GCTACGCT.G.py | 1 | import glob
import numpy as np
import pandas as pd
from numpy import nan
import os
os.chdir("/gpfs/commons/home/biederstedte-934/evan_projects/RRBS_anno_clean")
repeats = pd.read_csv("repeats_hg19.csv")
annofiles = glob.glob("RRBS_NormalBCD19pCD27pcell67_88_GCTACGCT.G*")
def between_range(row):
subset = repeats.... |
darktears/chromium-crosswalk | refs/heads/master | tools/win/new_analyze_warnings/retrieve_warnings.py | 43 | # 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.
"""
This retrieves the latest warnings from the Chrome /analyze build machine, and
does a diff.
This script is intended to be run from retrieve_latest_war... |
Teagan42/home-assistant | refs/heads/dev | homeassistant/components/yeelight/binary_sensor.py | 3 | """Sensor platform support for yeelight."""
import logging
from homeassistant.components.binary_sensor import BinarySensorDevice
from homeassistant.core import callback
from homeassistant.helpers.dispatcher import async_dispatcher_connect
from . import DATA_UPDATED, DATA_YEELIGHT
_LOGGER = logging.getLogger(__name__... |
vks/servo | refs/heads/master | tests/wpt/web-platform-tests/tools/pywebsocket/src/test/test_dispatch.py | 488 | #!/usr/bin/env python
#
# Copyright 2011, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list... |
timdiels/chicken_turtle_util | refs/heads/master | pytil/__init__.py | 1 | # Copyright (C) 2016 VIB/BEG/UGent - Tim Diels <timdiels.m@gmail.com>
#
# This file is part of pytil.
#
# pytil 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 ... |
vitan/hue | refs/heads/master | desktop/core/ext-py/Pygments-1.3.1/pygments/util.py | 56 | # -*- coding: utf-8 -*-
"""
pygments.util
~~~~~~~~~~~~~
Utility functions.
:copyright: Copyright 2006-2010 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import re
import sys
import codecs
split_path_re = re.compile(r'[/\\ ]')
doctype_lookup_re = re.compile(r'''(... |
RGood/praw | refs/heads/master | tests/unit/models/reddit/test_wikipage.py | 6 | import pickle
from praw.models import Subreddit, WikiPage
from ... import UnitTest
class TestWikiPage(UnitTest):
def test_equality(self):
page1 = WikiPage(self.reddit, subreddit=Subreddit(self.reddit, 'a'),
name='x')
page2 = WikiPage(self.reddit, subreddit=Subreddit(self... |
protonyx/labtronyx | refs/heads/master | labtronyx/common/jsonrpc.py | 1 | """
JSON RPC Python class for PTX-RPC
Conforms to the JSON RPC 2.0 Spec (http://www.jsonrpc.org/specification) with
a small addition to allow for both positional and keyword arguments
This class can either be instantiated with a JSON encoded string or used as
a utility helper class
"""
import json
from . import err... |
Zlash65/erpnext | refs/heads/develop | erpnext/hr/doctype/employee_onboarding/employee_onboarding.py | 6 | # -*- coding: utf-8 -*-
# Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe import _
from erpnext.hr.utils import EmployeeBoardingController
from frappe.model.mapper import get_mapped_do... |
suncycheng/intellij-community | refs/heads/master | python/lib/Lib/sre_parse.py | 116 | #
# Secret Labs' Regular Expression Engine
#
# convert re-style regular expression to sre pattern
#
# Copyright (c) 1998-2001 by Secret Labs AB. All rights reserved.
#
# See the sre.py file for information on usage and redistribution.
#
"""Internal support module for sre"""
# XXX: show string offset and offending ch... |
pipermerriam/django | refs/heads/master | tests/utils_tests/test_numberformat.py | 307 | # -*- encoding: utf-8 -*-
from __future__ import unicode_literals
from decimal import Decimal
from sys import float_info
from unittest import TestCase
from django.utils.numberformat import format as nformat
class TestNumberFormat(TestCase):
def test_format_number(self):
self.assertEqual(nformat(1234, '... |
LumPenPacK/NetworkExtractionFromImages | refs/heads/master | osx_build/nefi2_osx_amd64_xcode_2015/site-packages/numpy_1.11/numpy/testing/setup.py | 151 | #!/usr/bin/env python
from __future__ import division, print_function
def configuration(parent_package='',top_path=None):
from numpy.distutils.misc_util import Configuration
config = Configuration('testing', parent_package, top_path)
config.add_data_dir('tests')
return config
if __name__ == '__main_... |
commtrack/temp-aquatest | refs/heads/master | apps/xformmanager/tests/xsd_checker.py | 1 | from xformmanager.tests.util import *
from xformmanager.xformdef import FormDef
from decimal import Decimal
from datetime import *
import unittest
class CompatibleTestCase(unittest.TestCase):
def setUp(self):
self.f1 = FormDef.from_file( get_file("data/versioning/base.xsd") )
def tes... |
Artimi/neng | refs/heads/master | neng/cmaes.py | 1 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#Copyright (C) 2013 Petr Šebek
#Permission is hereby granted, free of charge, to any person obtaining a copy
#of this software and associated documentation files (the "Software"), to deal
#in the Software without restriction, including without limitation the rights
#to us... |
petrjasek/superdesk-core | refs/heads/master | content_api/companies/__init__.py | 1 | # -*- coding: utf-8; -*-
#
# This file is part of Superdesk.
#
# Copyright 2013, 2014, 2015 Sourcefabric z.u. and contributors.
#
# For the full copyright and license information, please see the
# AUTHORS and LICENSE files distributed with this source code, or
# at https://www.sourcefabric.org/superdesk/license
from c... |
kxepal/simpleubjson | refs/heads/master | simpleubjson/tools/inspect.py | 4 | # -*- coding: utf-8 -*-
#
# Copyright (C) 2011-2014 Alexander Shorin
# All rights reserved.
#
# This software is licensed as described in the file LICENSE, which
# you should have received as part of this distribution.
#
import sys
import simpleubjson
from ..draft8 import Draft8Decoder
from ..draft9 import Draft9Decod... |
richpolis/siveinpy | refs/heads/master | env/lib/python2.7/site-packages/pip/_vendor/requests/packages/charade/constants.py | 3007 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Universal charset detector code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 2001
# the Initial Developer. All R... |
freshplanet/AppEngine-SocketPool | refs/heads/master | tlslite/utils/rijndael.py | 3 | # Authors:
# Bram Cohen
# Trevor Perrin - various changes
#
# See the LICENSE file for legal information regarding use of this file.
# Also see Bram Cohen's statement below
"""
A pure python (slow) implementation of rijndael with a decent interface
To include -
from rijndael import rijndael
To do a key setup -
... |
arbrandes/edx-platform | refs/heads/master | openedx/features/announcements/migrations/0001_initial.py | 4 | from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
]
operations = [
migrations.CreateModel(
name='Announcement',
fields=[
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_k... |
IONISx/edx-platform | refs/heads/master | common/lib/xmodule/xmodule/modulestore/__init__.py | 11 | """
This module provides an abstraction for working with XModuleDescriptors
that are stored in a database an accessible using their Location as an identifier
"""
import logging
import re
import json
import datetime
from pytz import UTC
from collections import defaultdict
import collections
from contextlib import cont... |
dreamsxin/kbengine | refs/heads/master | kbe/res/scripts/common/Lib/distutils/tests/test_install_headers.py | 147 | """Tests for distutils.command.install_headers."""
import sys
import os
import unittest
import getpass
from distutils.command.install_headers import install_headers
from distutils.tests import support
from test.support import run_unittest
class InstallHeadersTestCase(support.TempdirManager,
... |
Geheimorganisation/sltv | refs/heads/master | sltv/ui/encoding/vp8enc.py | 4 | # -*- coding: utf-8 -*-
# Copyright (C) 2010 Holoscopio Tecnologia
# Copyright (C) 2010 Gustavo Noronha Silva <gns@gnome.org>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 o... |
saurabh6790/omn-app | refs/heads/master | setup/doctype/backup_manager/backup_googledrive.py | 30 | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
# SETUP:
# install pip install --upgrade google-api-python-client
#
# In Google API
# - create new API project
# - create new oauth2 client (create installed app type as google \
# does no... |
pschmitt/home-assistant | refs/heads/dev | tests/components/deconz/test_scene.py | 7 | """deCONZ scene platform tests."""
from copy import deepcopy
from homeassistant.components import deconz
import homeassistant.components.scene as scene
from homeassistant.setup import async_setup_component
from .test_gateway import DECONZ_WEB_REQUEST, setup_deconz_integration
from tests.async_mock import patch
GROU... |
remaudcorentin-dev/python-allrecipes | refs/heads/master | setup.py | 1 |
from setuptools import setup
setup(
name='python-allrecipes',
version='0.2.1',
description='Easy-to-use Python API for the allrecipes.com cokking website.',
packages=['allrecipes'],
url='https://github.com/remaudcorentin-dev/python-allrecipes',
author='Corentin Remaud',
author_email='remaudcorentin.dev@gmail.c... |
perlygatekeeper/glowing-robot | refs/heads/master | Little_Alchemy_2/Scraper_python/env/lib/python3.7/site-packages/setuptools/_vendor/packaging/_structures.py | 1152 | # This file is dual licensed under the terms of the Apache License, Version
# 2.0, and the BSD License. See the LICENSE file in the root of this repository
# for complete details.
from __future__ import absolute_import, division, print_function
class Infinity(object):
def __repr__(self):
return "Infinity... |
dulems/hue | refs/heads/master | desktop/core/ext-py/Django-1.6.10/tests/generic_inline_admin/tests.py | 49 | # -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
from django.conf import settings
from django.contrib import admin
from django.contrib.admin.sites import AdminSite
from django.contrib.contenttypes.generic import (
generic_inlineformset_factory, GenericTabularInline)
from django.form... |
LockScreen/Backend | refs/heads/master | venv/lib/python2.7/site-packages/botocore/loaders.py | 2 | # Copyright 2012-2015 Amazon.com, Inc. or its affiliates. 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. A copy of
# the License is located at
#
# http://aws.amazon.com/apache2.0/
#
# or in the "license" file ac... |
sjsrey/pysal | refs/heads/master | pysal/model/spopt/__init__.py | 2 | from spopt import region
|
prasadtalasila/INET-Vagrant-Demos | refs/heads/master | Nonce_Demo/impacket-0.9.12/impacket/testcases/ImpactPacket/test_ICMP6.py | 1 | #!/usr/bin/env python
#Impact test version
try:
from impacket import IP6_Address, IP6, ImpactDecoder, ICMP6
except:
pass
#Standalone test version
try:
import sys
sys.path.insert(0,"../..")
import IP6_Address, IP6, ImpactDecoder, ICMP6
except:
pass
import unittest
class TestICMP6(unittest.Tes... |
arajparaj/pysub | refs/heads/master | subtitle.py | 1 |
#!/usr/bin/python -tt
import os
import hashlib
import urllib2
import sys
from PyQt4 import QtGui,QtCore
def get_hash(name):
readsize = 64 * 1024
with open(name, 'rb') as f:
size = os.path.getsize(name)
data = f.read(readsize)
f.seek(-readsize, os.SEEK_END)
... |
fsufitch/dailyprogrammer | refs/heads/master | ideas/iddqd/inputgen.py | 1 | import random, sys
rows = int(sys.argv[1])
cols = int(sys.argv[2])
zombies = int(sys.argv[3])
print(rows, cols)
positions = set()
while len(positions) < zombies:
row = random.randrange(0, rows)
col = random.randrange(0, cols)
positions.add( (row, col) )
for row, col in positions:
print(row, col)
|
Anaphory/p4-phylogeny | refs/heads/master | share/Examples/L_mcmc/A_simple/sMcmc.py | 4 | read("../d.nex")
d = Data()
t = func.randomTree(taxNames=d.taxNames)
t.data = d
t.newComp(free=1, spec='empirical')
t.newRMatrix(free=1, spec='ones')
t.setNGammaCat(nGammaCat=4)
t.newGdasrv(free=1, val=0.5)
t.setPInvar(free=1, val=0.2)
m = Mcmc(t, nChains=4, runNum=0, sampleInterval=10, checkPointInterval=2000)
m.run(4... |
thundernet8/WRGameVideos-Server | refs/heads/master | venv/lib/python2.7/site-packages/sqlalchemy/sql/util.py | 9 | # sql/util.py
# Copyright (C) 2005-2015 the SQLAlchemy authors and contributors
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
"""High level utilities which build upon other modules here.
"""
from .. import exc, u... |
fuhongliang/odoo | refs/heads/8.0 | addons/hr_timesheet/__init__.py | 410 | # -*- 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... |
jnovinger/peewee | refs/heads/master | playhouse/kv.py | 15 | from base64 import b64decode
from base64 import b64encode
import operator
import pickle
try:
import simplejson as json
except ImportError:
import json
from peewee import *
from peewee import Node
try:
from playhouse.apsw_ext import APSWDatabase
def KeyValueDatabase(db_name, **kwargs):
return A... |
mbayon/TFG-MachineLearning | refs/heads/master | venv/lib/python3.6/site-packages/django/core/servers/basehttp.py | 44 | """
HTTP server that implements the Python WSGI protocol (PEP 333, rev 1.21).
Based on wsgiref.simple_server which is part of the standard library since 2.5.
This is a simple server for use in testing or debugging Django apps. It hasn't
been reviewed for security issues. DON'T USE IT FOR PRODUCTION USE!
"""
from __f... |
sparky-making-code-fun/DjangoBoots | refs/heads/master | boots/fields/tests/tests.py | 1 | # coding=utf-8
"""
Widget Tests
"""
import django.test
from boots.fields import widgets
from boots.fields import fields as boot_fields
class TestWidgets(django.test.TestCase):
def test_calendar_widget_render(self):
"""
does our calendar widget have an ID?
"""
cal_widg = widgets.C... |
philanthropy-u/edx-platform | refs/heads/master | openedx/core/djangoapps/oauth_dispatch/tests/test_dop_adapter.py | 3 | """
Tests for DOP Adapter
"""
from datetime import timedelta
import ddt
from django.test import TestCase
from django.utils.timezone import now
from provider.oauth2 import models
from provider import constants
from student.tests.factories import UserFactory
from ..adapters import DOPAdapter
from .constants import DU... |
msincenselee/vnpy | refs/heads/vnpy2 | vnpy/chart/base.py | 1 | from vnpy.trader.ui import QtGui
WHITE_COLOR = (255, 255, 255)
BLACK_COLOR = (0, 0, 0)
GREY_COLOR = (100, 100, 100)
UP_COLOR = (255, 0, 0)
DOWN_COLOR = (0, 255, 50)
CURSOR_COLOR = (255, 245, 162)
PEN_WIDTH = 1
BAR_WIDTH = 0.4
AXIS_WIDTH = 0.8
NORMAL_FONT = QtGui.QFont("Arial", 9)
def to_int(value: float) -> int:... |
ollej/piapi | refs/heads/master | pijobs/buildsjob.py | 1 | import scrollphat
from pijobs.scrollphatjob import ScrollphatJob
from pyteamcity import TeamCity
class BuildsJob(ScrollphatJob):
def __init__(self, options):
self.tc = TeamCity('dashing', 'l,sA-j2s9a', 'https://ci.avidity.se/httpAuth/app/rest/')
def run(self):
print(self.tc.get_projects())
Bu... |
yodalee/servo | refs/heads/master | tests/wpt/web-platform-tests/tools/localpaths.py | 40 | import os
import sys
here = os.path.abspath(os.path.split(__file__)[0])
repo_root = os.path.abspath(os.path.join(here, os.pardir))
sys.path.insert(0, os.path.join(repo_root, "tools"))
sys.path.insert(0, os.path.join(repo_root, "tools", "six"))
sys.path.insert(0, os.path.join(repo_root, "tools", "html5lib"))
sys.path.... |
andrewsmedina/django | refs/heads/master | tests/contenttypes_tests/models.py | 58 | from __future__ import absolute_import, unicode_literals
from django.db import models
from django.utils.encoding import python_2_unicode_compatible
@python_2_unicode_compatible
class Author(models.Model):
name = models.CharField(max_length=100)
def __str__(self):
return self.name
def get_absolut... |
sahmed95/sympy | refs/heads/master | sympy/series/residues.py | 84 | """
This module implements the Residue function and related tools for working
with residues.
"""
from __future__ import print_function, division
from sympy import sympify
from sympy.utilities.timeutils import timethis
@timethis('residue')
def residue(expr, x, x0):
"""
Finds the residue of ``expr`` at the po... |
FaustoMora/Proyecto1_Problemas | refs/heads/master | airbnb_mexico/airbnb_mexico/pipelines.py | 1 | # -*- coding: utf-8 -*-
# Define your item pipelines here
#
# Don't forget to add your pipeline to the ITEM_PIPELINES setting
# See: http://doc.scrapy.org/en/latest/topics/item-pipeline.html
class AirbnbMexicoPipeline(object):
def process_item(self, item, spider):
return item
|
schatt/zulip | refs/heads/master | zerver/test_events.py | 116 | # -*- coding: utf-8 -*-
from django.test import TestCase
from zerver.models import (
get_client, get_realm, get_stream, get_user_profile_by_email,
Message, Recipient,
)
from zerver.lib.actions import (
apply_events,
create_stream_if_needed,
do_add_alert_words,
do_add_realm_emoji,
do_add_re... |
mmgen/mmgen | refs/heads/master | mmgen/color.py | 1 | #!/usr/bin/env python3
#
# mmgen = Multi-Mode GENerator, command-line Bitcoin cold storage solution
# Copyright (C)2013-2021 The MMGen Project <mmgen@tuta.io>
#
# 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 Softwa... |
seize-the-dave/XlsxWriter | refs/heads/master | xlsxwriter/test/comparison/test_chart_bar19.py | 8 | ###############################################################################
#
# Tests for XlsxWriter.
#
# Copyright (c), 2013-2015, John McNamara, jmcnamara@cpan.org
#
from ..excel_comparsion_test import ExcelComparisonTest
from ...workbook import Workbook
class TestCompareXLSXFiles(ExcelComparisonTest):
"""... |
saturn597/stem | refs/heads/master | test/integ/__init__.py | 8 | """
Integration tests for the stem library.
"""
__all__ = [
"connection",
"control",
"descriptor",
"response",
"socket",
"util",
"process",
"version",
]
|
stuarth/pixie | refs/heads/master | pixie/vm/libs/string.py | 10 | import pixie.vm.rt as rt
from pixie.vm.string import String
from pixie.vm.code import as_var, intern_var, wrap_fn, MultiArityFn
from pixie.vm.object import affirm, runtime_error
from pixie.vm.numbers import Integer
from rpython.rlib.unicodedata import unicodedb_6_2_0 as unicodedb
import rpython.rlib.rstring as rstring... |
shaded-enmity/dnf | refs/heads/master | tests/test_cli_progress.py | 12 | # Copyright (C) 2012-2013 Red Hat, Inc.
#
# This copyrighted material is made available to anyone wishing to use,
# modify, copy, or redistribute it subject to the terms and conditions of
# the GNU General Public License v.2, or (at your option) any later version.
# This program is distributed in the hope that it will... |
donfucius/pyew | refs/heads/master | plugins/packer.py | 4 | #!/usr/bin/env python
"""
Pyew! A Python Tool like the populars *iew
Copyright (C) 2009,2010 Joxean Koret
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 you... |
ojengwa/oh-mainline | refs/heads/master | vendor/packages/celery/contrib/release/sphinx-to-rst.py | 44 | #!/usr/bin/env python
import os
import re
import sys
dirname = ""
RE_CODE_BLOCK = re.compile(r'.. code-block:: (.+?)\s*$')
RE_INCLUDE = re.compile(r'.. include:: (.+?)\s*$')
RE_REFERENCE = re.compile(r':(.+?):`(.+?)`')
def include_file(lines, pos, match):
global dirname
orig_filename = match.groups()[0]
... |
fabian4/ceilometer | refs/heads/master | ceilometer/storage/models.py | 13 | #
# Copyright 2013 New Dream Network, LLC (DreamHost)
#
# 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... |
koharjidan/litecoin | refs/heads/master | share/qt/clean_mac_info_plist.py | 229 | #!/usr/bin/env python
# Jonas Schnelli, 2013
# make sure the Litecoin-Qt.app contains the right plist (including the right version)
# fix made because of serval bugs in Qt mac deployment (https://bugreports.qt-project.org/browse/QTBUG-21267)
from string import Template
from datetime import date
bitcoinDir = "./";
in... |
knowledgepoint-devs/askbot-devel | refs/heads/merge1 | askbot/admin.py | 1 | # -*- coding: utf-8 -*-
"""
:synopsis: connector to standard Django admin interface
To make more models accessible in the Django admin interface, add more classes subclassing ``django.contrib.admin.Model``
Names of the classes must be like `SomeModelAdmin`, where `SomeModel` must
exactly match name of the model used ... |
cmoutard/mne-python | refs/heads/master | mne/simulation/tests/test_evoked.py | 9 | # Author: Alexandre Gramfort <alexandre.gramfort@telecom-paristech.fr>
#
# License: BSD (3-clause)
import os.path as op
import numpy as np
from numpy.testing import assert_array_almost_equal, assert_array_equal
from nose.tools import assert_true, assert_raises
import warnings
from mne.datasets import testing
from mn... |
tensorflow/tfx | refs/heads/master | tfx/utils/io_utils.py | 1 | # Copyright 2019 Google LLC. 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 applicable law or a... |
mikel-egana-aranguren/SADI-Galaxy-Docker | refs/heads/master | galaxy-dist/scripts/extract_dataset_part.py | 1 | """
Reads a JSON file and uses it to call into a datatype class to extract
a subset of a dataset for processing.
Used by jobs that split large files into pieces to be processed concurrently
on a gid in a scatter-gather mode. This does part of the scatter.
"""
import json
import logging
import os
import sys
logging.ba... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.