code stringlengths 2 1.05M | repo_name stringlengths 5 104 | path stringlengths 4 251 | language stringclasses 1
value | license stringclasses 15
values | size int32 2 1.05M |
|---|---|---|---|---|---|
import unittest
from ctree.jit import *
from ctree import CONFIG
from fixtures.sample_asts import *
import ctypes
from ctree.transformations import PyBasicConversions
class TestTranslator(LazySpecializedFunction):
def args_to_subconfig(self, args):
return {'arg_typesig': tuple(type(get_ctype(a)) for a in ... | ucb-sejits/ctree | test/test_jit.py | Python | bsd-2-clause | 4,254 |
import os
import logging
from warnings import catch_warnings
import numpy as np
from AnyQt.QtWidgets import \
QStyle, QComboBox, QMessageBox, QFileDialog, QGridLayout, QLabel, \
QLineEdit
from AnyQt.QtWidgets import QSizePolicy as Policy
from AnyQt.QtCore import Qt, QTimer, QSize
from Orange.canvas.gui.utils ... | cheral/orange3 | Orange/widgets/data/owfile.py | Python | bsd-2-clause | 17,323 |
"""init.py for plotting module.
Author: Federico Tomasi
Copyright (c) 2016, Federico Tomasi.
Licensed under the FreeBSD license (see LICENSE.txt).
"""
| slipguru/ignet | icing/plotting/__init__.py | Python | bsd-2-clause | 152 |
import arrayfire
import sys
import afnumpy
from . import private_utils as pu
import numbers
import numpy
import math
def __slice_len__(idx, shape, axis):
maxlen = shape[axis]
# Out of bounds slices should be converted to None
if(idx.stop is not None and idx.stop >= maxlen):
idx.stop = None
if(i... | FilipeMaia/afnumpy | afnumpy/indexing.py | Python | bsd-2-clause | 10,029 |
import os
import unittest
import cbs
class TestEnv(unittest.TestCase):
def setUp(self):
os.environ.clear()
cbs.DEFAULT_ENV_PREFIX = ''
def test_retrieve_from_method(self):
class Settings:
@cbs.env
def SETTING(self):
return 'bar'
self.a... | MarkusH/django-classy-settings | tests/test_env.py | Python | bsd-2-clause | 1,670 |
"Supporting objects and functions to convert Matplotlib objects into Bokeh."
#-----------------------------------------------------------------------------
# Copyright (c) 2012 - 2014, Continuum Analytics, Inc. All rights reserved.
#
# Powered by the Bokeh Development Team.
#
# The full license is in the file LICENSE.t... | htygithub/bokeh | bokeh/compat/bokeh_renderer.py | Python | bsd-3-clause | 17,781 |
import numpy as np
from ..base import ClassifierMixin
from ..linear_model.base import CoefSelectTransformerMixin
from ..svm.base import BaseLibLinear
from ..svm import liblinear
class LogisticRegression(BaseLibLinear, ClassifierMixin,
CoefSelectTransformerMixin):
"""
Logistic Regress... | joshbohde/scikit-learn | sklearn/linear_model/logistic.py | Python | bsd-3-clause | 4,271 |
"""
Benchmarks on the power iterations phase in randomized SVD.
We test on various synthetic and real datasets the effect of increasing
the number of power iterations in terms of quality of approximation
and running time. A number greater than 0 should help with noisy matrices,
which are characterized by a slow spectr... | manhhomienbienthuy/scikit-learn | benchmarks/bench_plot_randomized_svd.py | Python | bsd-3-clause | 17,938 |
"""tornado_elasticsearch extends the official elasticsearch library adding
asynchronous support for the Tornado stack.
See http://elasticsearch-py.readthedocs.org/en/latest/ for information
on how to use the API beyond the introduction for how to use with Tornado::
from tornado import gen
from tornado import ... | gmr/tornado-elasticsearch | tornado_elasticsearch.py | Python | bsd-3-clause | 46,402 |
import os, unittest
from scraper.models import Event
from scraper.scraper_test import EventSpider, ScraperTest
class ScraperReqOptionsRunTest(ScraperTest):
def setUpWithRequestTypeMethodScraper(self, test_case):
self.event_website.url = os.path.join('http://localhost:8010/scraper/request_type_method/', '... | Brother-Simon/django-dynamic-scraper | tests/scraper/scraper_req_options_run_test.py | Python | bsd-3-clause | 3,155 |
import os.path
from os.path import abspath
import re
import sys
import types
import pickle
from test import support
from test.support import import_helper
import test.test_importlib.util
import unittest
import unittest.mock
import unittest.test
class TestableTestProgram(unittest.TestProgram):
module = None
e... | brython-dev/brython | www/src/Lib/unittest/test/test_discovery.py | Python | bsd-3-clause | 34,059 |
from __future__ import division
from PIL import Image
from . import modes
from .transform import Transform
class ImageSize(object):
@property
def image(self):
if not self._image and self.path:
self._image = Image.open(self.path)
return self._image
def __init__(self, path=No... | knadir/Flask-Images | flask_images/size.py | Python | bsd-3-clause | 3,727 |
"""
Settings and actions for the dummyrunner
This module defines dummyrunner settings and sets up
the actions available to dummy accounts.
The settings are global variables:
TIMESTEP - time in seconds between each 'tick'
CHANCE_OF_ACTION - chance 0-1 of action happening
CHANCE_OF_LOGIN - chance 0-1 of login happenin... | jamesbeebop/evennia | evennia/server/profiling/dummyrunner_settings.py | Python | bsd-3-clause | 8,806 |
import datetime
rcParams = {'font.family':'Times',
'axes.2D.tickson':True,
'axes.2D.title.fontscale':2.0,
'axes.2D.label.fontscale':2.0,
'axes.2D.x.title':"x-coordinate [m]",
'axes.2D.y.title':"z-coordinate [m]",
'axes.3D.tickson':False,
... | amanzi/ats-dev | tools/visit_ats/visit_ats/visit_rcParams.py | Python | bsd-3-clause | 5,950 |
"""
Functions that ignore NaN.
Functions
---------
- `nanmin` -- minimum non-NaN value
- `nanmax` -- maximum non-NaN value
- `nanargmin` -- index of minimum non-NaN value
- `nanargmax` -- index of maximum non-NaN value
- `nansum` -- sum of non-NaN values
- `nanprod` -- product of non-NaN values
- `nanmean` -- mean of... | chiffa/numpy | numpy/lib/nanfunctions.py | Python | bsd-3-clause | 46,492 |
from nose.tools import eq_, ok_, raises
import wtforms
from flask import Flask
from mongoengine import *
from flask_superadmin import Admin
from flask_superadmin.model.backends.mongoengine.view import ModelAdmin
class CustomModelView(ModelAdmin):
def __init__(self, model, name=None, category=None, endpoint=Non... | syrusakbary/Flask-SuperAdmin | flask_superadmin/tests/test_mongoengine.py | Python | bsd-3-clause | 9,707 |
# -*- encoding: utf-8 -*-
# Copyright 2015 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import os
import unittest
import infra_libs
DATA_DIR = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'data')
class ... | endlessm/chromium-browser | third_party/chromite/third_party/infra_libs/test/utils_test.py | Python | bsd-3-clause | 1,350 |
# 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.
import shutil
from profile_creators import profile_generator
from profile_creators import small_profile_extender
from telemetry.page import page as page_mod... | highweb-project/highweb-webcl-html5spec | tools/perf/page_sets/typical_25.py | Python | bsd-3-clause | 4,012 |
"""
This module converts requested URLs to callback view functions.
RegexURLResolver is the main class here. Its resolve() method takes a URL (as
a string) and returns a tuple in this format:
(view_function, function_args, function_kwargs)
"""
from __future__ import unicode_literals
from importlib import import_... | archen/django | django/core/urlresolvers.py | Python | bsd-3-clause | 22,195 |
"""Line-like geometrical entities.
Contains
========
LinearEntity
Line
Ray
Segment
"""
from __future__ import print_function, division
from sympy.core import S, C, sympify, Dummy
from sympy.core.exprtools import factor_terms
from sympy.core.relational import Eq
from sympy.functions.elementary.trigonometric import _p... | AunShiLord/sympy | sympy/geometry/line.py | Python | bsd-3-clause | 46,569 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
import djangobmf.fields.file
class Migration(migrations.Migration):
dependencies = [
('contenttypes', '0002_remove_content_type_name'),
('djangobmf', '0002_remove_old_report'),
]
ope... | django-bmf/django-bmf | djangobmf/migrations/0003_auto_20160511_1609.py | Python | bsd-3-clause | 4,122 |
# -*- coding: UTF-8 -*-
"""
Example Forms for Microformats.
Copyright (c) 2009 Nicholas H.Tollervey (http://ntoll.org/contact)
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 sou... | poswald/microformats | microformats/forms.py | Python | bsd-3-clause | 9,632 |
#!/usr/bin/env python
from skimage._build import cython
import os.path
base_path = os.path.abspath(os.path.dirname(__file__))
def configuration(parent_package='', top_path=None):
from numpy.distutils.misc_util import Configuration, get_numpy_include_dirs
config = Configuration('graph', parent_package, top_... | emmanuelle/scikits.image | skimage/graph/setup.py | Python | bsd-3-clause | 1,429 |
# #dev envs
import logging
from django.conf import settings
from django.contrib import messages
from django.contrib.auth.decorators import user_passes_test
from django.core.urlresolvers import reverse
from django.http import HttpResponseRedirect
from django.shortcuts import render, get_object_or_404
from pytz import t... | grendel513/django-DefectDojo | dojo/development_environment/views.py | Python | bsd-3-clause | 3,251 |
import sqlalchemy as sa
from sqlalchemy_utils.aggregates import aggregated
from tests import TestCase
class TestAggregateValueGenerationForSimpleModelPaths(TestCase):
def create_models(self):
class Thread(self.Base):
__tablename__ = 'thread'
id = sa.Column(sa.Integer, primary_key=T... | tonyseek/sqlalchemy-utils | tests/aggregate/test_simple_paths.py | Python | bsd-3-clause | 2,154 |
from casexml.apps.case.models import CommCareCase
from dimagi.utils.decorators.memoized import memoized
from touchforms.formplayer.api import post_data
import json
from django.conf import settings
from corehq.apps.cloudcare import CLOUDCARE_DEVICE_ID
from django.core.urlresolvers import reverse
from corehq.apps.users.m... | SEL-Columbia/commcare-hq | corehq/apps/cloudcare/touchforms_api.py | Python | bsd-3-clause | 4,169 |
#Key, dictionary[key, int], int --> dictionary[key, int]
#Given a key, dictionary and increment, set the dictionary value at
#key to dictionary[key] + inc. If there is no old value, set to inc
def incrementDict(dictKey, dictionary, inc=1):
if(dictKey in dictionary):
dictionary[dictKey] += inc
else:
dictionary[dic... | Yagniksuchak/CodeParser | src/logChunk/dictUtil.py | Python | bsd-3-clause | 602 |
#!/usr/bin/env python
#
# Copyright 2013 Google Inc. All Rights Reserved.
#
"""A convenience wrapper for starting gsutil."""
import os
import sys
import bootstrapping
from googlecloudsdk.core import config
from googlecloudsdk.core.credentials import gce as c_gce
def main():
"""Launches gsutil."""
project, ac... | ychen820/microblog | y/google-cloud-sdk/bin/bootstrapping/gsutil.py | Python | bsd-3-clause | 2,135 |
# i18n markers
def N_(msg):
'''
Single translatable string marker.
Does nothing, just a marker for \\*.pot file compilers.
Usage::
n = N_('translate me')
translated = env.gettext(n)
'''
return msg
class M_(object):
'''
Marker for translatable string with plural form.
... | boltnev/iktomi | iktomi/utils/i18n.py | Python | mit | 2,033 |
class Solution(object):
def maxSumOfThreeSubarrays(self, nums, k):
"""
:type nums: List[int]
:type k: int
:rtype: List[int]
"""
window = []
c_sum = 0
for i, v in enumerate(nums):
c_sum += v
if i >= k: c_sum -= nums[i-k]
... | Mlieou/leetcode_python | leetcode/python/ex_689.py | Python | mit | 1,077 |
# -*- coding: utf-8 -*-
class bcolors:
HEADER = '\033[95m'
OKBLUE = '\033[94m'
OKGREEN = '\033[92m'
WARNING = '\033[93m'
FAIL = '\033[91m'
ENDC = '\033[0m'
BOLD = '\033[1m'
UNDERLINE = '\033[4m' | synw/django-vvpages | vvpages/management/conf.py | Python | mit | 227 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from runner.koan import *
class AboutStrings(Koan):
def test_double_quoted_strings_are_strings(self):
string = "Hello, world."
self.assertEqual(__, isinstance(string, str))
def test_single_quoted_strings_are_also_strings(self):
string = '... | iceout/python_koans_practice | python3/koans/about_strings.py | Python | mit | 2,971 |
"""
PushBullet platform for notify component.
"""
import logging
from homeassistant.helpers import validate_config
from homeassistant.components.notify import (
DOMAIN, ATTR_TITLE, BaseNotificationService)
from homeassistant.const import CONF_API_KEY
_LOGGER = logging.getLogger(__name__)
def get_service(hass, c... | Jaidan/jaidan-hab-home-assistant | homeassistant/components/notify/pushbullet.py | Python | mit | 1,541 |
# encoding: utf-8
# Copyright 2011 Tree.io Limited
# This file is part of Treeio.
# License www.tree.io/license
"""
Reports models
"""
from django.db import models
from django.core.urlresolvers import reverse
from django.utils.translation import ugettext as _
from treeio.core.models import Object
from jinja2.filters ... | havard024/prego | reports/models.py | Python | mit | 2,739 |
from pandac.PandaModules import *
from direct.distributed.ClockDelta import *
from direct.interval.IntervalGlobal import *
from ElevatorConstants import *
from ElevatorUtils import *
import DistributedElevator
import DistributedElevatorExt
from toontown.toonbase import ToontownGlobals
from direct.directnotify import Di... | ToontownUprising/src | toontown/building/DistributedBossElevator.py | Python | mit | 3,644 |
#!/usr/bin/env python
# Copyright (c) 2012-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.
'''
Generate valid and invalid base58 address and private key test vectors.
Usage:
gen_base58_test_vec... | romanornr/viacoin | contrib/testgen/gen_base58_test_vectors.py | Python | mit | 4,483 |
# coding: utf-8
# Copyright (c) Pymatgen Development Team.
# Distributed under the terms of the MIT License.
"""
This module define a WulffShape class to generate the Wulff shape from
a lattice, a list of indices and their corresponding surface energies,
and the total area and volume of the wulff shape,the weighted su... | czhengsci/pymatgen | pymatgen/analysis/wulff.py | Python | mit | 21,287 |
#
# Copyright (c) 2015 Red Hat
# Licensed under The MIT License (MIT)
# http://opensource.org/licenses/MIT
#
import json
from django.shortcuts import render, get_object_or_404
from django.conf import settings
from kobo.django.views.generic import DetailView, SearchView
from rest_framework import viewsets, mixins, stat... | tzhaoredhat/automation | pdc/apps/release/views.py | Python | mit | 29,999 |
# on success, nothing is printed
import simplexorrequestor
# I'm keeping some of these datastructures tiny in order to make the output
# more readable if an error is discovered
mirrorinfolist = [{'name':'mirror1'}, {'name':'mirror2'}, {'name':'mirror3'}, {'name':'mirror4'}, {'name':'mirror5'}]
blocklist = [12,34]
#... | scotfu/uppir | test_simplexorrequestor.py | Python | mit | 2,272 |
"""The tests for the MQTT automation."""
import unittest
import homeassistant.components.automation as automation
from tests.common import (
mock_mqtt_component, fire_mqtt_message, get_test_home_assistant)
class TestAutomationMQTT(unittest.TestCase):
"""Test the event automation."""
def setUp(self): # ... | justyns/home-assistant | tests/components/automation/test_mqtt.py | Python | mit | 2,684 |
# -*- coding: utf-8 -*-
##
## This file is part of Invenio.
## Copyright (C) 2008, 2009, 2010, 2011 CERN.
##
## Invenio 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 ... | jmartinm/InvenioAuthorLists | modules/bibcirculation/lib/bibcirculation_utils.py | Python | gpl-2.0 | 21,079 |
#!/usr/bin/python -tt
# -*- coding: utf-8 -*-
#
# Copyright 2008-2009 Red Hat, Inc.
# This file is part of python-fedora
#
# python-fedora 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
# versi... | vivekanand1101/python-fedora | fedora/client/wiki.py | Python | gpl-2.0 | 9,280 |
# ################################################################################
# ##
# ## https://github.com/NetASM/NetASM-python
# ##
# ## File:
# ## optimize.py
# ##
# ## Project:
# ## NetASM: A Network Assembly Language for Programmable Dataplanes
# ##
# ## Author:
# ## Muhammad Shahbaz
#... | NetASM/NetASM-python | netasm/netasm/core/optimize.py | Python | gpl-2.0 | 2,688 |
# -*- coding: utf-8 -*-
#
# papyon - a python client library for Msn
#
# Copyright (C) 2005-2006 Ali Sabil <ali.sabil@gmail.com>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version ... | billiob/papyon | papyon/msnp/command.py | Python | gpl-2.0 | 7,857 |
import os
from enigma import eEPGCache, getBestPlayableServiceReference, \
eServiceReference, iRecordableService, quitMainloop, eActionMap, setPreferredTuner
from Components.config import config
from Components.UsageConfig import defaultMoviePath
from Components.TimerSanityCheck import TimerSanityCheck
from Screens.... | lazaronixon/enigma2 | RecordTimer.py | Python | gpl-2.0 | 43,499 |
#!/usr/bin/python
# Copyright 2010-2013 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
#
# This is a helper which ebuild processes can use
# to communicate with portage's main python process.
import logging
import os
import pickle
import platform
import signal
import sys
import ti... | entoo/portage-src | bin/ebuild-ipc.py | Python | gpl-2.0 | 6,192 |
#!/usr/bin/env python
"""Doxygen XML to SWIG docstring converter.
Converts Doxygen generated XML files into a file containing docstrings
that can be used by SWIG >1.3.23
Usage:
extract-docstrings.py input_py_wrapper.py input_xml_dir output_directory
input_py_wrapper.py is a swig generated file, with/without docst... | johnbeard/kicad-git | scripting/build_tools/extract_docstrings.py | Python | gpl-2.0 | 13,143 |
#!/usr/bin/env python3
from os import environ, path
from subprocess import call
HOME = path.join(path.expanduser('~'), '.local/')
PREFIX = environ.get('MESON_INSTALL_PREFIX', HOME)
DATA_DIR = path.join(PREFIX, 'share')
DEST_DIR = environ.get('DESTDIR', '')
EXTENSION_DIR = path.join(DATA_DIR,
... | JasonLG1979/gnome-shell-extensions-mediaplayer | meson_post_install.py | Python | gpl-2.0 | 499 |
# -*- coding: utf-8 -*-
#
# This file is part of Linux Show Player
#
# Copyright 2012-2016 Francesco Ceruti <ceppofrancy@gmail.com>
#
# Linux Show Player 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 ... | FrancescoCeruti/linux-show-player | lisp/layouts/cue_menu_registry.py | Python | gpl-3.0 | 1,849 |
# -*- coding: utf-8 -*-
import re
class StringParser(object):
@staticmethod
def removeCFU(stringToParse):
updatedString = re.sub('\s?[0-9] CFU.*', '', stringToParse)
return updatedString
@staticmethod
def startsWithUpper(stringToParse):
stringToParse = stringToParse[0].upper()+stringToParse[1:]
return strin... | Veeenz/Telegram-DMI-Bot | classes/StringParser.py | Python | gpl-3.0 | 328 |
# -*- coding: utf-8 -*-
def update_recent(items, new_item, max_count):
'''
Move or insert a new_item to begin of items.
Return new list
'''
result = items[:]
if new_item in result:
result.remove(new_item)
result.insert(0, new_item)
result = result[:max_count]
return resul... | unreal666/outwiker | src/outwiker/utilites/collections.py | Python | gpl-3.0 | 322 |
# Copyright (C) 2003 CAMP
# Please see the accompanying LICENSE file for further information.
"""
Ref. to Kresse-paper ... XXX
"""
import numpy as np
from gpaw.utilities.blas import axpy
from gpaw.fd_operators import FDOperator
class BaseMixer:
"""Pulay density mixer."""
def __init__(self, beta=0.1, ... | qsnake/gpaw | gpaw/dfpt/mixer.py | Python | gpl-3.0 | 17,948 |
import numpy as np
import sys
from fafoom import MoleculeDescription, Structure, selection, print_output,\
remover_dir, set_default, file2dict
import fafoom.run_utilities as run_util
# Decide for restart or a simple run.
opt = run_util.simple_or_restart()
p_file = sys.argv[1]
# Build a dictionary from two section... | FHIBioGroup/fafoom-dev | examples/ga.py | Python | gpl-3.0 | 8,274 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2019, Andrew Klychkov (@Andersson007) <aaklychkov@mail.ru>
# 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 =... | alxgu/ansible | lib/ansible/modules/database/postgresql/postgresql_membership.py | Python | gpl-3.0 | 12,662 |
# -*- coding: utf-8 -*-
#
#
# Tech-Receptives Solutions Pvt. Ltd.
# Copyright (C) 2009-TODAY Tech-Receptives(<http://www.techreceptives.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free ... | karelvysinka/connector-woocommerce | woocommerceerpconnect/unit/binder.py | Python | agpl-3.0 | 6,183 |
#
# Copyright (c) 2006, 2007 Canonical
#
# Written by Gustavo Niemeyer <gustavo@niemeyer.net>
#
# This file is part of Storm Object Relational Mapper.
#
# Storm 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 Found... | nwokeo/supysonic | venv/lib/python2.7/site-packages/tests/store/sqlite.py | Python | agpl-3.0 | 3,521 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
fasta_length_filter
Description: Filter a fasta file based on sequence length
fasta_length_filter.py -i input.fa -o output.fa -m 300
fasta_length_filter.py -i input.fa -o output.fa -M 1000
-----------------------------------------------------------------------
... | ppericard/matamog | scripts/fasta_length_filter.py | Python | agpl-3.0 | 3,594 |
# Generated by Django 2.2.24 on 2021-06-21 09:50
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('organizations', '0003_historicalorganizationcourse'),
('course_creators', '0001_initial'),
]
operations = [
migrations.AddField(
... | edx/edx-platform | cms/djangoapps/course_creators/migrations/0002_add_org_support_for_course_creators.py | Python | agpl-3.0 | 827 |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.2 on 2017-12-18 13:08
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('base', '0204_remove_uuid_null'),
]
operations = [
migrations.AlterModelOptions(
... | uclouvain/OSIS-Louvain | base/migrations/0205_auto_20171218_1408.py | Python | agpl-3.0 | 607 |
# -*- coding: utf-8 -*-
# Copyright(C) 2012 Romain Bignon
#
# This file is part of weboob.
#
# weboob is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your opti... | yannrouillard/weboob | modules/ganassurances/browser.py | Python | agpl-3.0 | 2,914 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('core', '0020_auto_20150323_1457'),
]
operations = [
migrations.AddField(
model_name='user',
name='pr... | azavea/nyc-trees | src/nyc_trees/apps/core/migrations/0021_auto_20150408_1216.py | Python | agpl-3.0 | 660 |
# Copyright 2013-2021 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class Pygmo(CMakePackage):
"""Parallel Global Multiobjective Optimizer (and its Python alter ego... | LLNL/spack | var/spack/repos/builtin/packages/pygmo/package.py | Python | lgpl-2.1 | 1,202 |
##############################################################################
# Copyright (c) 2017, Los Alamos National Security, LLC
# Produced at the Los Alamos National Laboratory.
#
# This file is part of Spack.
# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
# LLNL-CODE-647188
#
# For details, ... | TheTimmy/spack | var/spack/repos/builtin/packages/quinoa/package.py | Python | lgpl-2.1 | 2,175 |
# Copyright (C) 2006-2007, Red Hat, Inc.
# Copyright (C) 2007, One Laptop Per Child
#
# This library 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 2 of the License, or (at your option... | sugarlabs/sugar-base | src/sugar/mime.py | Python | lgpl-2.1 | 7,511 |
#!/usr/bin/env python3
# Copyright (C) 2018 Freie Universitat Berlin
# Copyright (C) 2018 Inria
#
# This file is subject to the terms and conditions of the GNU Lesser
# General Public License v2.1. See the file LICENSE in the top level
# directory for more details.
#
# @author Koen Zandberg <koen@bergzand.net>
"""S... | jia200x/RIOT | dist/tools/backport_pr/backport_pr.py | Python | lgpl-2.1 | 10,731 |
# (C) 2016, Markus Wildi, wildi.markus@bluewin.ch
#
# 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, or (at your option)
# any later version.
#
# This program is distr... | RTS2/rts2 | scripts/u_point/u_point/httpd_connection.py | Python | lgpl-3.0 | 3,250 |
from abstractKeyboardMapping import AbstractKeyboardMapping
import evdev
class Qwerty(AbstractKeyboardMapping):
def __init__(self):
super(AbstractKeyboardMapping, self).__init__()
def solo(self):
return { "!" : [evdev.ecodes.KEY_LEFTSHIFT, evdev.ecodes.KEY_1],
"@" : [evdev.ecodes.KEY_LEFTSHIFT, evdev... | dictation-toolbox/aenea | server/linux_wayland/qwerty.py | Python | lgpl-3.0 | 1,666 |
#
# This file is protected by Copyright. Please refer to the COPYRIGHT file
# distributed with this source distribution.
#
# This file is part of REDHAWK code-generator.
#
# REDHAWK code-generator is free software: you can redistribute it and/or modify it under
# the terms of the GNU Lesser General Public License as pu... | RedhawkSDR/framework-codegen | redhawk/packagegen/templates/__init__.py | Python | lgpl-3.0 | 847 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""This file is part of the prometeo project.
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... | zuck/prometeo-erp | core/menus/signals.py | Python | lgpl-3.0 | 1,904 |
# coding: utf-8
from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..utils import (
determine_ext,
float_or_none,
xpath_text,
remove_end,
int_or_none,
ExtractorError,
)
class TwitterBaseIE(InfoExtractor):
def _get_vmap_video_url(self, vmap_url, video... | jcoady9/youtube-dl | youtube_dl/extractor/twitter.py | Python | unlicense | 15,024 |
# 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... | Laurawly/tvm-1 | python/tvm/contrib/mkldnn.py | Python | apache-2.0 | 1,715 |
# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
#
# Copyright 2011, Piston Cloud Computing, Inc.
#
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in ... | badock/nova | nova/virt/disk/api.py | Python | apache-2.0 | 23,062 |
# Copyright 2019 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... | ppwwyyxx/tensorflow | tensorflow/python/tpu/tpu_test_wrapper_test.py | Python | apache-2.0 | 6,679 |
# -*- coding: utf-8 -*-
#
# Copyright 2012-2015 Spotify AB
#
# 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... | samuell/luigi | test/worker_test.py | Python | apache-2.0 | 69,585 |
# -*- coding: utf-8 -*-
"""OLECF plugin related functions and classes for testing."""
import pyolecf
from plaso.engine import single_process
from tests.parsers import test_lib
class OleCfPluginTestCase(test_lib.ParserTestCase):
"""The unit test case for OLE CF based plugins."""
def _OpenOleCfFile(self, path, ... | ostree/plaso | tests/parsers/olecf_plugins/test_lib.py | Python | apache-2.0 | 2,117 |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2013 B1 Systems GmbH
#
# 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
#... | tuskar/tuskar-ui | openstack_dashboard/dashboards/admin/hypervisors/views.py | Python | apache-2.0 | 1,366 |
import mock
import unittest
from mock import patch
from svc_monitor.svc_monitor import SvcMonitor
from pysandesh.sandesh_base import Sandesh
from svc_monitor.logger import ServiceMonitorLogger
from svc_monitor.config_db import *
from cfgm_common.vnc_cassandra import VncCassandraClient
from cfgm_common.vnc_kombu import... | vpramo/contrail-controller | src/config/svc-monitor/svc_monitor/tests/test_svc_monitor.py | Python | apache-2.0 | 2,660 |
import functools
from app.slave.cluster_slave import ClusterSlave
from app.subcommands.service_subcommand import ServiceSubcommand
from app.util import analytics, log
from app.util.conf.configuration import Configuration
from app.web_framework.cluster_slave_application import ClusterSlaveApplication
class SlaveSubco... | josephharrington/ClusterRunner | app/subcommands/slave_subcommand.py | Python | apache-2.0 | 2,529 |
#
# 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... | nathanielvarona/airflow | airflow/providers/google/cloud/example_dags/example_dataflow_flex_template.py | Python | apache-2.0 | 2,774 |
# Copyright 2014 Google 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 applicable law or a... | google/syzygy | syzygy/build/gyp_main.py | Python | apache-2.0 | 3,560 |
from common_fixtures import * # NOQA
def test_link_instance_stop_start(super_client, client, context):
target1 = context.create_container(ports=['180', '122/udp'])
target2 = context.create_container(ports=['280', '222/udp'])
c = context.create_container(instanceLinks={
'target1_link': target1.id... | Cerfoglg/cattle | tests/integration/cattletest/core/test_link.py | Python | apache-2.0 | 4,582 |
"""Support for controlling a Raspberry Pi cover."""
import logging
from time import sleep
import voluptuous as vol
from homeassistant.components.cover import CoverDevice, PLATFORM_SCHEMA
from homeassistant.const import CONF_NAME
from homeassistant.components import rpi_gpio
import homeassistant.helpers.config_validat... | HydrelioxGitHub/home-assistant | homeassistant/components/rpi_gpio/cover.py | Python | apache-2.0 | 3,595 |
#!/usr/bin/env python
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software... | mrangana/kolla | docker/base/set_configs.py | Python | apache-2.0 | 14,400 |
"""Support for DoorBird devices."""
import logging
from urllib.error import HTTPError
import voluptuous as vol
from homeassistant.components.http import HomeAssistantView
from homeassistant.const import (
CONF_DEVICES, CONF_HOST, CONF_MONITORED_CONDITIONS, CONF_NAME,
CONF_PASSWORD, CONF_TOKEN, CONF_USERNAME)
... | HydrelioxGitHub/home-assistant | homeassistant/components/doorbird/__init__.py | Python | apache-2.0 | 14,277 |
from collections import namedtuple
def get_feature(stats):
feature_attributes = ApacheFeature(
stats['BusyWorkers'],
stats['IdleWorkers'],
stats['waiting_for_connection'],
stats['starting_up'],
stats['reading_request'],
stats['sending_reply'],
stats['keepali... | cloudviz/agentless-system-crawler | crawler/plugins/applications/apache/feature.py | Python | apache-2.0 | 1,135 |
"""
Evaluation of Python code in |jedi| is based on three assumptions:
* The code uses as least side effects as possible. Jedi understands certain
list/tuple/set modifications, but there's no guarantee that Jedi detects
everything (list.append in different modules for example).
* No magic is being used:
- metac... | unnikrishnankgs/va | venv/lib/python3.5/site-packages/jedi/evaluate/__init__.py | Python | bsd-2-clause | 26,873 |
from . import SimLibrary
from .. import SIM_PROCEDURES as P
from ...calling_conventions import SimCCStdcall
lib = SimLibrary()
lib.set_library_names('kernel32.dll')
lib.add_all_from_dict(P['win32'])
lib.set_default_cc('X86', SimCCStdcall)
| axt/angr | angr/procedures/definitions/kernel32.py | Python | bsd-2-clause | 240 |
{
"metadata": {},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [
{
"cell_type": "code",
"collapsed": false,
"input": [
"# Example of tuning an SVR model in scikit-learn with Optunity\n",
"# This example requires sklearn\n",
"import math\n",
"import i... | MarkAWard/optunity | notebooks/sklearn-svr.py | Python | bsd-3-clause | 6,245 |
"""
This module contains the 'base' GEOSGeometry object -- all GEOS Geometries
inherit from this object.
"""
# Python, ctypes and types dependencies.
import re
from ctypes import addressof, byref, c_double, c_size_t
from types import UnicodeType
# GEOS-related dependencies.
from django.contrib.gis.geos.coordseq impo... | weigj/django-multidb | django/contrib/gis/geos/base.py | Python | bsd-3-clause | 21,337 |
#!/usr/bin/env python
"""Execute the tests for the sak program.
The golden test outputs are generated by the script generate_outputs.sh.
You have to give the root paths to the source and the binaries as arguments to
the program. These are the paths to the directory that contains the 'projects'
directory.
Usage: ru... | holtgrewe/seqan | core/apps/sak/tests/run_tests.py | Python | bsd-3-clause | 5,131 |
from __future__ import absolute_import
from itertools import count
import anyjson
from kombu.transport import base
class Message(base.Message):
def __init__(self, *args, **kwargs):
self.throw_decode_error = kwargs.get('throw_decode_error', False)
super(Message, self).__init__(*args, **kwargs)
... | depop/kombu | kombu/tests/mocks.py | Python | bsd-3-clause | 4,240 |
#
# Copyright (C) 2002-2008 greg Landrum and Rational Discovery LLC
#
""" unit testing code for molecular descriptor calculators
"""
import unittest,os.path
import io
from rdkit.six.moves import cPickle
from rdkit import RDConfig
from rdkit.ML.Descriptors import MoleculeDescriptors
import numpy
from rdkit import Ch... | soerendip42/rdkit | rdkit/ML/Descriptors/UnitTestMolDescriptors.py | Python | bsd-3-clause | 1,633 |
"""
Test that the debugger handles loops in std::list (which can appear as a result of e.g. memory
corruption).
"""
import lldb
from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
from lldbsuite.test import lldbutil
class LibcxxListDataFormatterTestCase(TestBase):
mydir = TestBase.co... | endlessm/chromium-browser | third_party/llvm/lldb/test/API/functionalities/data-formatter/data-formatter-stl/libcxx/list/loop/TestDataFormatterLibcxxListLoop.py | Python | bsd-3-clause | 2,446 |
"""Tests for coil."""
| marineam/coil | coil/test/__init__.py | Python | mit | 22 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
__author__ = "Ricardo Ribeiro"
__credits__ = ["Ricardo Ribeiro"]
__license__ = "MIT"
__version__ = "1.0"
__maintainer__ = "Ricardo Ribeiro"
__email__ = "ricardojvr@gmail.com"
__status__ = "Production"
| UmSenhorQualquer/pyStateMachine | pyStateMachine/States/__init__.py | Python | mit | 273 |
"""
Support to interface with Sonos players (via SoCo).
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/media_player.sonos/
"""
import datetime
import logging
from os import path
import socket
import voluptuous as vol
from homeassistant.components.media_... | Smart-Torvy/torvy-home-assistant | homeassistant/components/media_player/sonos.py | Python | mit | 13,962 |
# @HEADER
# ************************************************************************
#
# TriBITS: Tribal Build, Integrate, and Test System
# Copyright 2013 Sandia Corporation
#
# Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation,
# the U.S. Government retains certain ri... | wawiesel/BootsOnTheGround | external/TriBITS/tribits/python_utils/CMakeBinaries.py | Python | mit | 4,584 |
#Copyright ReportLab Europe Ltd. 2000-2004
#see license.txt for license details
#history http://www.reportlab.co.uk/cgi-bin/viewcvs.cgi/public/reportlab/trunk/reportlab/platypus/tableofcontents.py
__version__=''' $Id: tableofcontents.py 3627 2010-01-06 14:06:36Z rgbecker $ '''
__doc__="""Experimental class to generate... | fergalmoran/Chrome2Kindle | server/reportlab/platypus/tableofcontents.py | Python | mit | 19,645 |
"""
An experimental support for curvilinear grid.
"""
# TODO :
# *. see if tick_iterator method can be simplified by reusing the parent method.
from itertools import chain
from grid_finder import GridFinder
from axislines import AxisArtistHelper, GridHelperBase
from axis_artist import AxisArtist
from matplotlib.... | Solid-Mechanics/matplotlib-4-abaqus | mpl_toolkits/axisartist/floating_axes.py | Python | mit | 22,614 |
import catalogs
import numpy as np
def VlsrByCoord(RA, Dec, region='OrionA', regionCatalog=None, **kwargs):
"""
For the GAS regions determine the appropriate v0 given coordinates.
If a velocity gradient has been fit, it is hard-coded here. Otherwise,
this uses the catalog velocities.
Parameters... | rfriesen/GAS | GAS/utils.py | Python | mit | 2,765 |