repo_name stringlengths 5 104 | path stringlengths 4 248 | content stringlengths 102 99.9k |
|---|---|---|
linearregression/socorro | webapp-django/crashstats/api/tests/test_views.py | import datetime
import json
import re
from django.contrib.auth.models import User, Permission
from django.core.urlresolvers import reverse
from django.conf import settings
import mock
from nose.tools import eq_, ok_
from crashstats.base.tests.testbase import TestCase
from crashstats.crashstats.tests.test_views impor... |
Conjuror/tcParser | pywlibs/xhtml.py | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright (c) 2011-2012 Martin Beran (info@berycz.net)
# license MIT/X11 (read more in the file LICENSE)
# Homepage: http://www.pywlibs.net/
# Source code: https://github.com/berycz/pywlibs
# Documentation: http://www.pywlibs.net/docs/xhtml
#VERSION 1.0
# Supported doctyp... |
Jet-Streaming/framework | deps/v8/test/intl/testcfg.py | # Copyright 2013 the V8 project 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:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditi... |
prrvchr/gMailOOo | gMailOOo/AuthenticatorService.py | #!
# -*- coding: utf_8 -*-
import uno
import unohelper
from com.sun.star.lang import XServiceInfo, XInitialization, XLocalizable
from com.sun.star.mail import XAuthenticator
from com.sun.star.util import XStringEscape
from com.sun.star.task import XInteractionHandler
from com.sun.star.beans import XProperty... |
spaceninja/mltshp | test/unit/task_tests.py | from base import BaseTestCase
from models import User, Shake, Sourcefile, Sharedfile, Shakesharedfile, Post, Magicfile
from tasks.timeline import add_posts, delete_posts
from tornado.options import options
import tweepy
from mock import patch
class MockTweepy(object):
count = 0
@classmethod
def API(cls,... |
GLolol/PyLink | launcher.py | #!/usr/bin/env python3
"""
PyLink IRC Services launcher.
"""
import os
import signal
import sys
import time
from pylinkirc import __version__, conf, real_version, world
try:
import psutil
except ImportError:
psutil = None
args = {}
def _main():
conf.load_conf(args.config)
from pylinkirc.log import... |
chengdh/openerp-ktv | openerp/addons/ktv_sale/discount_card_type.py | # -*- coding: utf-8 -*-
#打折卡类别设置
from osv import fields, osv
import ktv_helper
import decimal_precision as dp
class discount_card_type(osv.osv):
_name = "ktv.discount_card_type"
_description = "打折卡类别信息设置"
_columns = {
'name' : fields.char('name',size = 64,required = True),
#酒水折扣,按照... |
xtaran/debian-devel-changes-bot | DebianDevelChangesBot/messages/__init__.py | # -*- coding: utf-8 -*-
#
# Debian Changes Bot
# Copyright (C) 2008 Chris Lamb <chris@chris-lamb.co.uk>
# Copyright (C) 2015 Sebastian Ramacher <sramacher@debian.org>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# p... |
ccnz/eqnz-ocitysmap | ocitysmap2/draw_utils.py | # -*- coding: utf-8 -*-
# ocitysmap, city map and street index generator from OpenStreetMap data
# Copyright (C) 2010 David Decotigny
# Copyright (C) 2010 Frédéric Lehobey
# Copyright (C) 2010 Pierre Mauduit
# Copyright (C) 2010 David Mentré
# Copyright (C) 2010 Maxime Petazzoni
# Copyright (C) 2010 Thomas Petaz... |
Stanford-Online/edx-analytics-dashboard | analytics_dashboard/courses/tests/test_views/test_engagement.py | from ddt import ddt
import httpretty
import mock
from mock import patch, Mock
from django.test import TestCase
from django.core.urlresolvers import reverse
from django.utils.translation import ugettext_lazy as _
from waffle.testutils import override_switch
import analyticsclient.constants.activity_type as AT
from c... |
eduardoklosowski/ergo-notes | ergonotes/managers.py | # -*- coding: utf-8 -*-
#
# Copyright 2015 Eduardo Augusto Klosowski
#
# This file is part of Ergo Notes.
#
# Ergo Notes 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, ... |
swayf/pyLoad | module/plugins/hoster/HellshareCz.py | # -*- coding: utf-8 -*-
"""
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 your option) any later version.
This program is distributed in ... |
PlayCircular/play_circular | apps/grupos/views.py | # coding=utf-8
# Copyright (C) 2014 by Víctor Romero Blanco <info at playcircular dot com>.
# http://playcircular.com/
# It's licensed under the AFFERO GENERAL PUBLIC LICENSE unless stated otherwise.
# You can get copies of the licenses here: http://www.affero.org/oagpl.html
# AFFERO GENERAL PUBLIC LICENSE is also i... |
rory/openstreetmap-remove-tags | setup.py | #! /usr/bin/env python
from setuptools import setup
exec(open("./osmrmtags/_version.py").read())
setup(name="openstreetmap-rmtags",
version=__version__,
author="Rory McCann",
author_email="rory@technomancy.org",
packages=['osmrmtags'],
install_requires = [
"six",
"op... |
ovnicraft/server-tools | webhook/controllers/main.py | # -*- coding: utf-8 -*-
# Copyright 2016 Vauxoo - https://www.vauxoo.com/
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
import pprint
from odoo import http
from odoo.http import request
from odoo import exceptions
from odoo.tools.translate import _
class WebhookController(http.Controller):
@h... |
OCA/l10n-germany | l10n_de_tax_statement_zm/models/l10n_de_tax_statement_zm_line.py | # Copyright 2020 sewisoft (<https://sewisoft.de>)
# Copyright 2018 Onestein (<http://www.onestein.eu>)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from odoo import _, api, fields, models
from odoo.tools.misc import formatLang
from odoo.exceptions import ValidationError
class VatStatementZmLi... |
clubit/edi-workflow | edi_routes_invoic_refund/__openerp__.py | {
'name': 'edi_routes_invoic_refund',
'summary': 'Edifact INVOIC refund using the EDI framework',
'version': '1.0',
'category': 'EDI Tools',
'author': 'Clubit BVBA',
'website': 'http://www.clubit.be',
'depends': [
'edi_tools',
'edi_account_enable',
'edi_routes_desadv'... |
akintolga/superdesk-aap | server/aap/macros/ap_weather_format.py | # -*- coding: utf-8; -*-
#
# This file is part of Superdesk.
#
# Copyright 2013, 2014 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
import re
fr... |
MuckRock/muckrock | muckrock/project/migrations/0009_auto_20160412_1804.py | # -*- coding: utf-8 -*-
# Generated by Django 1.9.5 on 2016-04-12 18:04
# Django
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('project', '0008_project_newsletter'),
]
operations = [
migrations.AddField(
model_name='project... |
avanzosc/avanzosc6.1 | avanzosc_fleet_vehicles_extension/avanzosc_fleet_vehicles_extension.py | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (c) 2011-2012 Daniel (Avanzosc) <http://www.avanzosc.com>
# 09/11/2011
#
# This program is free software: you can redistribute it and/or modify
# ... |
fedora-infra/fedora-packages | fedoracommunity/lib/utils.py | # This file is part of Fedora Community.
# Copyright (C) 2008-2010 Red Hat, Inc.
#
# 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 Software Foundation, either version 3 of the
# License, or (at your option) ... |
interDist/pasportaservo | pasportaservo/settings/base.py | from os import environ, path
from django.conf import global_settings
from django.core.exceptions import ObjectDoesNotExist
def get_env_setting(setting):
""" Get the environment setting or return exception """
from django.core.exceptions import ImproperlyConfigured
try:
return environ[setting]
... |
Stanford-Online/edx-ora2 | openassessment/xblock/test/test_self.py | # -*- coding: utf-8 -*-
"""
Tests for self assessment handlers in Open Assessment XBlock.
"""
import copy
import datetime
import json
import mock
import pytz
from openassessment.assessment.api import self as self_api
from openassessment.workflow import api as workflow_api
from openassessment.xblock.data_conversion im... |
MuckRock/muckrock | muckrock/foia/migrations/0061_foiarequest_deleted.py | # -*- coding: utf-8 -*-
# Generated by Django 1.11.4 on 2018-08-27 19:50
# Django
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('foia', '0060_auto_20180713_1455'),
]
operations = [
migrations.AddField(
model_name='foiareque... |
Vauxoo/partner-contact | base_vat_unique/__openerp__.py | # -*- coding: utf-8 -*-
#
#
# OpenERP, Open Source Management Solution
# Copyright (c) 2014 Vauxoo - http://www.vauxoo.com/
# All Rights Reserved.
# info Vauxoo (info@vauxoo.com)
#
# Coded by: Luis Torres (luis_t@vauxoo.com)
#
#
# This program is free software: you can redistribute it and/or modify
# ... |
TudorRosca/enklave | server/backend/utils/geo_lib.py | __author__ = 'radu'
from rest_framework.exceptions import ValidationError
from backend.models import UserLocation
from backend.utils import processing
def validate_proximity(enklave, user):
if enklave.id == 16066:
return
user_location = validate_and_get_user_location(user)
distance = processing.c... |
akx/shoop | shoop_tests/simple_cms/test_languages.py | # This file is part of Shoop.
#
# Copyright (c) 2012-2016, Shoop Ltd. All rights reserved.
#
# This source code is licensed under the AGPLv3 license found in the
# LICENSE file in the root directory of this source tree.
import pytest
from django.utils import translation
from shoop.simple_cms.models import Page
from sh... |
skylines-project/skylines | skylines/model/trace.py | # -*- coding: utf-8 -*-
from sqlalchemy.dialects import postgresql
from sqlalchemy.types import String, Integer, DateTime, Interval
from geoalchemy2.types import Geometry
from geoalchemy2.elements import WKTElement
from geoalchemy2.shape import to_shape
from skylines.database import db
from .geo import Location
cla... |
cartertech/odoo-hr-ng | hr_policy_presence/hr_policy_presence.py | #-*- coding:utf-8 -*-
##############################################################################
#
# Copyright (C) 2015 One Click Software (http://oneclick.solutions)
# and Copyright (C) 2013 Michael Telahun Makonnen <mmakonnen@gmail.com>.
# All Rights Reserved.
#
# This program is free software: you ca... |
geotagx/pybossa | test/test_sched.py | # -*- coding: utf8 -*-
# This file is part of PyBossa.
#
# Copyright (C) 2015 SciFabric LTD.
#
# PyBossa 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 op... |
open-synergy/opnsynid-l10n-indonesia | l10n_id_djbc_kite_lap_pemakaian_wip_subkontrak/__openerp__.py | # -*- coding: utf-8 -*-
# Copyright 2019 OpenSynergy Indonesia
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
{
"name": "Indonesia - Laporan Pemakaian WIP Subkontrak for KITE",
"version": "8.0.1.1.0",
"category": "localization",
"website": "https://opensynergy-indonesia.com",
"autho... |
hasgeek/funnel | funnel/transports/sms/send.py | """Support functions for sending an SMS."""
from __future__ import annotations
from flask import url_for
import itsdangerous
from twilio.base.exceptions import TwilioRestException
from twilio.rest import Client
import requests
from baseframe import _
from ... import app
from ...serializers import token_serializer
... |
plamut/superdesk | server/features/steps/steps.py | # -*- coding: utf-8; -*-
#
# This file is part of Superdesk.
#
# Copyright 2013, 2014 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
import os
i... |
isard-vdi/isard | webapp/webapp/webapp/lib/trees.py | # Copyright 2017 the Isard-vdi project authors:
# Josep Maria Viñolas Auquer
# Alberto Larraz Dalmases
# License: AGPLv3
import os
import pickle
import random
import socket
import tarfile
#!/usr/bin/env python
# coding=utf-8
import time
from contextlib import closing
from datetime import datetime, timedelta... |
cherrygirl/micronaet7 | Script/Importation/library/posta.py | #!/usr/bin/env python
# -*- encoding: utf-8 -*-
#
# I find this on site: http://snippets.dzone.com/posts/show/2038
# sorry but, as the publisher, I don't know the origin and the owner of this code
# Let me tell him thank you, very useful code ;)
#
# The procedure send an E-mail to recipient list with recipient attachm... |
antoniov/tools | z0bug_odoo/tests/z0bug_odoo_test_02.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (C) 2015-2020 SHS-AV s.r.l. (<http://www.zeroincombenze.org>)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
"""
Zeroincombenze® unit test library for python programs Regression Test Suite
"""
import os
import sys
import shutil
from zerobug ... |
edx/edx-enterprise | integrated_channels/degreed2/client.py | # -*- coding: utf-8 -*-
"""
Client for connecting to Degreed2.
"""
import json
import logging
import requests
from six.moves.urllib.parse import urljoin
from django.apps import apps
from django.http.request import QueryDict
from integrated_channels.exceptions import ClientError
from integrated_channels.integrated_c... |
maljac/odoo-addons | project_closure_restrictions/__openerp__.py | # -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2015 ADHOC SA (http://www.adhoc.com.ar)
# All Rights Reserved.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Pu... |
OpusVL/odoo | addons/l10n_lu/__openerp__.py | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
# Copyright (C) 2011 Thamini S.à.R.L (<http://www.thamini.com>)
# Copyright (C) 2011 ADN Consultants S.à... |
charbeljc/project-service | project_stage_state/__openerp__.py | # -*- coding: utf-8 -*-
##############################################################################
#
# Daniel Reis, 2014
#
# 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 Software Foundation, eith... |
CiviWiki/OpenCiviWiki | project/accounts/tests/test_models.py | from django.contrib.auth import get_user_model
from django.test import TestCase
from accounts.models import Profile
class BaseTestCase(TestCase):
"""Base test class to set up test cases"""
def setUp(self) -> None:
user = get_user_model().objects.create_user(
username="testuser", email="te... |
OpenAT/cu_hofe | hofe_config/__openerp__.py | # -*- coding: utf-8 -*-
##############################################################################
#
# 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 Software Foundation, either version 3 of the
#... |
avanzosc/cost_simulator | cost_simulator/wizard/__init__.py | # -*- encoding: utf-8 -*-
##############################################################################
#
# 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 Software Foundation, either version 3 of the... |
jswope00/GAI | common/lib/xmodule/xmodule/modulestore/loc_mapper_store.py | '''
Method for converting among our differing Location/Locator whatever reprs
'''
from random import randint
import re
import pymongo
import bson.son
from xmodule.modulestore.exceptions import InvalidLocationError, ItemNotFoundError
from xmodule.modulestore.locator import BlockUsageLocator, CourseLocator
from xmodule.... |
OpusVL/Odoo-Delivery-Notes | stock_delivery_note/stock_move.py | # -*- coding: utf-8 -*-
##############################################################################
#
# Delivery Notes
# Copyright (C) 2015 OpusVL (<http://opusvl.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
# publis... |
abramhindle/UnnaturalCodeFork | python/testdata/launchpad/lib/lp/services/browser_helpers.py | # Copyright 2009 Canonical Ltd. This software is licensed under the
# GNU Affero General Public License version 3 (see the file LICENSE).
"""Helpers for examining the browser user_agent header."""
__metaclass__ = type
__all__ = [
'get_user_agent_distroseries',
'get_plural_text',
]
import re
def get_us... |
frePPLe/frePPLe | freppledb/input/migrations/0049_parameter_completed.py | # Copyright (C) 2020 by frePPLe bv
#
# This library 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 option) any later version.
#
# This library is distribu... |
jolyonb/edx-platform | common/lib/xmodule/xmodule/tests/test_video.py | # -*- coding: utf-8 -*-
# pylint: disable=protected-access
"""Test for Video Xmodule functional logic.
These test data read from xml, not from mongo.
We have a ModuleStoreTestCase class defined in
common/lib/xmodule/xmodule/modulestore/tests/django_utils.py. You can
search for usages of this in the cms and lms tests f... |
MuckRock/muckrock | muckrock/tags/apps.py | """
App config for tags
"""
# Django
from django.apps import AppConfig
class TagConfig(AppConfig):
"""Configures the project application to use activity streams"""
name = "muckrock.tags"
def ready(self):
"""Registers the application with the watson plugin"""
# pylint: disable=invalid-na... |
Curahelper/Cura | cura/Settings/CuraContainerRegistry.py | # Copyright (c) 2017 Ultimaker B.V.
# Cura is released under the terms of the AGPLv3 or higher.
import os
import os.path
import re
from typing import Optional
from PyQt5.QtWidgets import QMessageBox
from UM.Decorators import override
from UM.Settings.ContainerRegistry import ContainerRegistry
from UM.S... |
anandpdoshi/erpnext | erpnext/setup/doctype/company/fixtures/india/__init__.py | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
def install(company):
docs = [
{'doctype': 'Salary Component', 'salary_component': 'Professional Tax', 'description': 'Professional T... |
HelloLily/hellolily | lily/accounts/migrations/0011_account_status_data_migrate.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations
# Mapping statuses from the old to new one.
status_mapping = {
'inactive': 'Relation',
'active': 'Active',
'pending': 'Prospect',
'prev_customer': 'Previous customer',
'bankrupt': 'Previous customer',... |
CLVsol/odoo_addons | clv_person_mng/__openerp__.py | # -*- encoding: utf-8 -*-
################################################################################
# #
# Copyright (C) 2013-Today Carlos Eduardo Vercelino - CLVsol #
# ... |
kailIII/emaresa | trunk.cl/purchase_expense_distribution/__openerp__.py | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
# Copyright (C) 2010-2012 OpenERP s.a. (<http://openerp.com>).
#
# This program is free software: you ca... |
SamR1/FitTrackee | fittrackee/users/utils_token.py | from datetime import datetime, timedelta
from typing import Optional
import jwt
from flask import current_app
def get_user_token(
user_id: int, password_reset: Optional[bool] = False
) -> str:
"""
Return authentication token for a given user.
Token expiration time depends on token type (authenticatio... |
pemryan/DAKOTA | packages/plplot/examples/python/x01.py | #!/usr/bin/env python
#
# x01c.c
#
# Simple line plot and multiple windows demo.
import math
#import pl
import sys
import os
module_dir = "@MODULE_DIR@"
if module_dir[0] == '@':
module_dir = os.getcwd ()
sys.path.insert (0, module_dir)
from Numeric import *
from pl import *
# main
#
# Generates several simple li... |
FedoraScientific/salome-paravis | test/VisuPrs/GaussPoints/C9.py | # Copyright (C) 2010-2014 CEA/DEN, EDF R&D
#
# 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.1 of the License, or (at your option) any later version.
#
# This library ... |
gbenson/i8c | contrib/libi8x-testnote-export.py | # -*- coding: utf-8 -*-
# Copyright (C) 2016 Red Hat, Inc.
# This file is part of the Infinity Note Compiler.
#
# The Infinity Note Compiler 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
... |
FlowCloud/climate-control-demo | pc_app/climate_control/doc/source/conf.py | # -*- coding: utf-8 -*-
#
# climate_control documentation build configuration file, created by
# sphinx-quickstart on Tue Apr 28 15:41:02 2015.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated fil... |
jcupitt/libvips | test/test-suite/test_arithmetic.py | # vim: set fileencoding=utf-8 :
import math
import pytest
import pyvips
from helpers import unsigned_formats, float_formats, noncomplex_formats, \
all_formats, run_fn, run_image2, run_const, run_cmp, \
assert_almost_equal_objects
class TestArithmetic:
def run_arith(self, fn, fmt=all_formats):
[r... |
markroxor/gensim | gensim/models/word2vec.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2013 Radim Rehurek <me@radimrehurek.com>
# Licensed under the GNU LGPL v2.1 - http://www.gnu.org/licenses/lgpl.html
"""
Produce word vectors with deep learning via word2vec's "skip-gram and CBOW models", using either
hierarchical softmax or negative samp... |
nightrune/ola | tools/rdm/DMXSender.py | #!/usr/bin/python
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it wi... |
ThomasMcVay/MediaApp | MediaAppWidgets/__init__.py | #===============================================================================
# @Author: Madison Aster
# @ModuleDescription:
# @License:
# MediaApp Library - Python Package framework for developing robust Media
# Applications with Qt Library
# Copyright (C) 2013 Madison Aster
# ... |
chrys87/fenrir | src/fenrirscreenreader/commands/commands/inc_alsa_volume.py | #!/bin/python
# -*- coding: utf-8 -*-
# Fenrir TTY screen reader
# By Chrys, Storm Dragon, and contributers.
initialized = False
try:
import alsaaudio
initialized = True
except:
pass
from fenrirscreenreader.core import debug
class command():
def __init__(self):
pass
def initialize(self, ... |
mupif/mupif | obsolete/examples/PingTest/conf.py | # List of job applications - server details
# The format is (name, serverName, username, localNATPort, serverPort,sshClient, options, sshHost)
import sys
#Edit these paths for your SSH-client and location of private key
if(sys.platform.lower().startswith('win')):
sshClient = 'C:\\Program Files\\Putty\\putty.exe'
... |
McIntyre-Lab/papers | nanni_maize_2022/scripts/flag_intron_retention.py | #!/usr/bin/env python
import argparse
import pandas as pd
import numpy as np
import gffutils
def getOptions():
# Parse command line arguments
parser = argparse.ArgumentParser(description="Flag exonic regions (fusions) with intron retention events")
# Input data
parser.add_argument("-d", "... |
pixelspark/corespark | Libraries/Spirit/boost/miniboost/tools/build/v2/test/alias.py | #!/usr/bin/python
from BoostBuild import Tester, List
t = Tester()
# Test that top-level project can affect build dir
t.write("project-root.jam", "")
t.write("Jamfile", """
exe a : a.cpp ;
exe b : b.cpp ;
exe c : c.cpp ;
alias bin1 : a ;
alias bin2 : a b ;
alias src : s.cpp ;
exe hello : hello.cpp... |
wangy1931/tcollector | collectors/builtin/hive.py | import time
try:
import pyhs2
except ImportError:
pyhs2 = None
from collectors.lib.collectorbase import CollectorBase
class Hive(CollectorBase):
def __init__(self, config, logger, readq):
super(Hive, self).__init__(config, logger, readq)
self.user = self.get_config("user", 'root')
... |
live-clones/dolfin-adjoint | examples/salt-fingering/salt-fingering.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# .. _salt-fingering-example:
#
# .. py:currentmodule:: dolfin_adjoint
#
# Generalised stability analysis of double-diffusive salt fingering
# =================================================================
#
# .. sectionauthor:: Patrick E. Farrell <patrick.farrell@maths... |
lfcnassif/MultiContentViewer | release/modules/ext/libreoffice/program/wizards/common/ConfigGroup.py | #
# This file is part of the LibreOffice project.
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
#
# This file incorporates work covered by the following license noti... |
dbarbier/privot | python/test/t_LogUniform_std.py | #! /usr/bin/env python
from openturns import *
TESTPREAMBLE()
RandomGenerator().SetSeed(0)
try :
# Instanciate one distribution object
distribution = LogUniform(-0.5, 1.5)
print "Distribution ", repr(distribution)
print "Distribution ", distribution
# Get mean and covariance
print "Mean= ", ... |
xtiankisutsa/MARA_Framework | tools/qark/qark/modules/useCheckPermission.py | from __future__ import absolute_import
'''Copyright 2015 LinkedIn Corp. 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... |
QuantumQuadrate/CsPyController | python/rubidium.py | from __future__ import division
import logging
from cs_errors import PauseError
from atom.api import Member, Int
# Bring in other files in this package
import functional_waveforms, analysis, save2013style, TTL, LabView
import DDS
import AWG
import andor, AnalogInput
import unlock_pause, nidaq_ai
logger = logging.getL... |
abcdef123/stem | stem/descriptor/reader.py | """
Utilities for reading descriptors from local directories and archives. This is
mostly done through the :class:`~stem.descriptor.reader.DescriptorReader`
class, which is an iterator for the descriptor data in a series of
destinations. For example...
::
my_descriptors = [
"/tmp/server-descriptors-2012-03.tar.... |
dbarbier/privot | python/test/t_NormalFactory_std.py | #! /usr/bin/env python
from openturns import *
TESTPREAMBLE()
RandomGenerator().SetSeed(0)
try :
dim = 3
mean = NumericalPoint(dim)
sigma = NumericalPoint(dim)
R = CorrelationMatrix(dim)
for i in range(dim) :
mean[i] = i + 0.5
sigma[i] = 2 * i + 1.0
for j in range(i) :
... |
a1ezzz/wasp-general | wasp_general/task/base.py | # -*- coding: utf-8 -*-
# wasp_general/task/base.py
#
# Copyright (C) 2016 the wasp-general authors and contributors
# <see AUTHORS file>
#
# This file is part of wasp-general.
#
# Wasp-general is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as publi... |
Pardus-LiderAhenk/lider-ahenk-local-user-plugin | ahenk-local-user/local-user/init.py | #!/usr/bin/python3
# -*- coding: utf-8 -*-
# Author:Mine DOGAN <mine.dogan@agem.com.tr>
from base.plugin.abstract_plugin import AbstractPlugin
class Init(AbstractPlugin):
def __init__(self, context):
super(Init, self).__init__()
self.context = context
self.logger = self.get_logger()
... |
DataDog/pylons-exceptional | src/exceptional/__init__.py | from cStringIO import StringIO
import datetime
import gzip
import logging
import os
import re
import sys
import traceback
import types
import urllib
import urllib2
from pylons import config
from webob import Request, Response
try:
import json
except ImportError:
import simplejson as json
__version__ = '0.2.3'... |
ic3man5/capslock-disable | main.py | import sys
from PySide import QtGui, QtCore
import win32api
import win32con
from threading import Thread, Event
import time
def setup_menu():
menu = QtGui.QMenu()
enable_action = menu.addAction("&Enable")
disable_action = menu.addAction("&Disable")
exit_action = menu.addAction("E&xit")
enable_act... |
mpillar/codeeval | 1-moderate/filename-pattern/main.py | import sys
import re
def matches(pattern, case):
pattern = re.sub('\.', '\.', pattern)
pattern = re.sub('\*', '.*', pattern)
pattern = re.sub('\?', '.', pattern)
return re.match('^' + pattern + '$', case) is not None
def main():
test_cases = open(sys.argv[1], 'r')
for test in test_cases:
... |
W0mpRat/IntroToComputerScience | Lesson1/7Palindrome.py | ###############################################
# Exercise by Websten from forums #
###############################################
# A palindrome is a word or a phrase that reads
# the same backwards as forwards. Make a program
# that checks if a word is a palindrome.
# If the word is a palindrome, print 0... |
google/tcli | tcli/text_buffer_test.py | # Copyright 2019 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 ... |
BD2KOnFHIR/i2FHIRb2 | tests/fhirtests/test_fhir_ontology_part2.py |
import unittest
import os
from fhirtordf.rdfsupport.namespaces import FHIR
from i2fhirb2.fhir.fhirmetadatavocabulary import FMVGraphNode
from i2fhirb2.fhir.fhirontologytable import FHIROntologyTable
from i2fhirb2.fhir.fhirw5ontology import FHIRW5Ontology
from tests.utils.shared_graph import shared_graph
save_output... |
huggingface/pytorch-transformers | src/transformers/models/pegasus/modeling_pegasus.py | # coding=utf-8
# Copyright 2021, Google and The HuggingFace Inc. team. 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
... |
emilssolmanis/tapes | tapes/reporting/tornado/__init__.py | from tornado import ioloop
from .. import ScheduledReporter
class TornadoScheduledReporter(ScheduledReporter):
"""Scheduled reporter that uses a tornado IOLoop for scheduling"""
def __init__(self, interval, registry=None, io_loop=None):
"""
:param interval: a timedelta
:param registry... |
RedHatInsights/insights-core | insights/parsers/ip.py | """
Parsers for ``ip`` command outputs
==================================
This module provides the following parsers:
IpAddr - command ``ip addr``
----------------------------
RouteDevices - command ``ip route show table all``
--------------------------------------------------
IpNeighParser - command ``ip neigh sho... |
dstufft/warehouse | tests/unit/admin/test_flags.py | # 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
# distributed under the Li... |
Xaxetrov/OSCAR | test/env/test_pysc2MineralshardEnv2.py | import unittest
from oscar.env.envs.pysc2_mineralshard_env2 import Pysc2MineralshardEnv2
from pysc2.lib import actions
class TestPysc2MineralshardEnv2(unittest.TestCase):
def test_get_action_id_from_action(self):
number_of_action = Pysc2MineralshardEnv2.action_space.n
for i in range(number_of_acti... |
caorun0728/shadowsocks | server_pool.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2014 clowwindy
#
# 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
#... |
xissy/titanium-mobile-sdk | module/module.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Module Project Create Script
#
import os, sys, shutil, string, uuid, re, zipfile, glob
from string import capitalize
from StringIO import StringIO
from datetime import date
template_dir = os.path.abspath(os.path.dirname(sys._getframe(0).f_code.co_filename))
sdk_dir =... |
captiosus/treadmill | treadmill/vipfile.py | """Manage Treadmill vIPs allocations.
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import errno
import glob
import logging
import os
import six
from treadmill import fs
_LOGGER = logging.getLogger(__name__)... |
openstack/networking-ale-omniswitch | networking_ale_omniswitch/omniswitch_constants.py | #
# Copyright 2014 Alcatel-Lucent Enterprise.
#
# 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 o... |
googleads/google-ads-python | google/ads/googleads/v8/enums/types/flight_placeholder_field.py | # -*- coding: utf-8 -*-
# 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... |
OrkoHunter/ping-me | ping_me/engine.py | """The engine module of ping-me"""
from __future__ import absolute_import
from __future__ import print_function
from __future__ import division
import datetime
import os
import requests
import sys
import time
import ping_me.authenticate
from ping_me.utils import cryptex
today = datetime.date.today()
home = os.path.ex... |
google/deluca-lung | deluca/lung/environments/_single_comp_lung_pid.py | import torch
import numpy as np
from deluca.lung.core import TorchLungEnv
def PropValve(x): # copied from Controller.__SimulatedPropValve
y = 3 * x
flow_new = 1.0 * (torch.tanh(0.03 * (y - 130)) + 1)
return torch.clamp(flow_new, 0.0, 1.72)
def Solenoid(x): # copied from Controller.__SimulatedSolenoid... |
yeming233/rally | tests/unit/plugins/common/sla/test_max_average_duration.py | # Copyright 2014: Mirantis 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 b... |
google-research/exoplanet-ml | exoplanet-ml/light_curve/binning.py | # Copyright 2018 The Exoplanet ML Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed t... |
MBoustani/Geothon | Create Spatial File/Vector/create_geojson_multipolygon.py | #!/usr/bin/env python
'''
Project: Geothon (https://github.com/MBoustani/Geothon)
File: Vector/create_geojson_multipolygon.py
Description: This code creates a multipolygon geojson file from some points.
Author: Maziyar Boustani (github.com/MBoustani)
'''
try:
import ogr
except ImportError:... |
jmouriz/sanaviron | sanaviron/ui/stock.py | #!/usr/bin/python
# -*- coding: utf-8 -*-
__all__ = ['ALIGN_OBJECTS_CENTER_BOTH', 'ALIGN_OBJECTS_CENTER_HORIZONTAL', 'ALIGN_OBJECTS_CENTER_VERTICAL',
'ALIGN_OBJECTS_EAST', 'ALIGN_OBJECTS_NORTH', 'ALIGN_OBJECTS_NORTHEAST', 'ALIGN_OBJECTS_NORTHWEST',
'ALIGN_OBJECTS_SOUTH', 'ALIGN_OBJECTS_SOUTHEA... |
emonty/pyos | pyos/tests/unit/test_cloud_databases.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import unittest
from mock import patch
from mock import MagicMock as Mock
from pyos.clouddatabases import CloudDatabaseBackupManager
from pyos.clouddatabases import CloudDatabaseDatabase
from pyos.clouddatabases import CloudDatabaseFlavor
from pyos.clouddatabases import ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.