code stringlengths 3 1.05M | repo_name stringlengths 5 104 | path stringlengths 4 251 | language stringclasses 1
value | license stringclasses 15
values | size int64 3 1.05M |
|---|---|---|---|---|---|
import json, codecs
class Transformer:
options = {
'config_file': "mapper.json",
'data_file': "data.csv",
'output_file': "output.json",
'encoding': "ISO-8859-1",
'sep': ";",
'limit': None,
'header': True,
'verbose': True
}
mapper = None
de... | klesouza/transformer | src/transform.py | Python | mit | 5,644 |
#!/usr/bin/python2.7
"""
This script should be copied to a running SecureDrop 0.3 instance, along with
the output of `0.2.1_collect.py`. When run (as root), it migrates all of the
information from the 0.2.1 instance to create a matching 0.3 instance.
"""
import sys
import os
import re
import tarfile
import subprocess
... | chadmiller/securedrop | migration_scripts/0.2.1/0.3_migrate.py | Python | agpl-3.0 | 12,134 |
# Create your views here.
from django.shortcuts import render_to_response, render
from organization.models import *
from django import forms
from organization.forms import *
from django.http import HttpResponseRedirect, HttpResponse
def orgedit(request,organization):
try:
orgname=org.objects.filter(org_na... | Rhombik/rhombik-object-repository | organization/views.py | Python | agpl-3.0 | 496 |
# The OARN Relief Nursery Database
# Copyright (C) 2015 Oregon Association of Relief Nurseries
#
# 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... | wire-rabbit/oarn-database | oarndb/tests/test_program_models.py | Python | agpl-3.0 | 4,463 |
#!/usr/bin/env python3
#
# Electrum - lightweight Bitcoin client
# Copyright (C) 2015 Thomas Voegtlin
#
# 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 withou... | fyookball/electrum | gui/qt/invoice_list.py | Python | mit | 4,215 |
import sys, csv
import pandas as pd
import numpy as np
filename = 'export.csv'
df = pd.read_csv(filename, sep=";")
brands_list = df.brand.drop_duplicates().tolist()
brands_list.sort()
brands = {}
def csv2html(row, f):
f.write("\n<h2>ean %s</h2>\n<ul>" % (row["ean"]))
for k in ["description", "manufactu... | matteoredaelli/scrapy_tyres | bin/csv2html.py | Python | gpl-3.0 | 945 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
import traceback
import os
import threading
import time
import datetime
import signal
import subprocess
import re
descriptors = list()
Desc_Skel = {}
_Worker_Thread = None
_Lock = threading.Lock() # synchronization lock
Debug = False
def dprint(f, *v):
i... | Mitali-Sodhi/CodeLingo | Dataset/python/passenger.py | Python | mit | 6,620 |
import requests
import logging
from django.core.cache import cache
from django.conf import settings
LOG = logging.getLogger(__name__)
def is_prerelease(version_str):
"""
Checks if the given version_str represents a prerelease version.
"""
return any([c.isalpha() for c in version_str])
def get_ver... | django-de/django-de-v3 | django_de/versions/utils.py | Python | bsd-3-clause | 1,906 |
#!/usr/bin/env python
"""Setup."""
import glob
import os
import subprocess
import sys
from setuptools import setup # type: ignore[import]
###############################################################################################
# fmt: off
try:
# make dataclasses.js from dataclasses.py
import inspec... | WIPACrepo/iceprod | setup.py | Python | mit | 2,208 |
"""
Data models for the core Sana data engine. These should be extended as
required.
:Authors: Sana dev team
:Version: 2.0
"""
from .concept import Concept, Relationship, RelationshipCategory
from .device import Device
from .encounter import Encounter
from .events import Event
from .instruction import Instruction
f... | dekatzenel/team-k | mds/core/models/__init__.py | Python | bsd-3-clause | 948 |
# Copyright 2012-2013, Damian Johnson
# Copyright 2013, Sean Robinson
# See LICENSE for licensing information
"""
Package for parsing and processing descriptor data.
**Module Overview:**
::
parse_file - Parses the descriptors in a file.
Descriptor - Common parent for all descriptor file types.
|- get_path ... | soult/stem | stem/descriptor/__init__.py | Python | lgpl-3.0 | 21,533 |
from django.apps import AppConfig
class OlafConfig(AppConfig):
name = 'olaf'
| An-Alone-Cow/pyChess | pyChess/olaf/apps.py | Python | mit | 83 |
"""
CCX Enrollment operations for use by Coach APIs.
Does not include any access control, be sure to check access before calling.
"""
import datetime
import logging
from contextlib import contextmanager
from smtplib import SMTPException
import pytz
from django.contrib.auth.models import User
from django.core.exceptio... | a-parhom/edx-platform | lms/djangoapps/ccx/utils.py | Python | agpl-3.0 | 15,559 |
from test_CRF import *
| becxer/pytrain | test_pytrain/test_CRF/__init__.py | Python | mit | 23 |
import datetime
import logging
from urlparse import urljoin
from analytics import Client as SegmentClient
from django.conf import settings
from django.contrib.auth.models import AbstractUser
from django.contrib.sites.models import Site
from django.core.cache import cache
from django.core.exceptions import ValidationEr... | mferenca/HMS-ecommerce | ecommerce/core/models.py | Python | agpl-3.0 | 12,966 |
__author__ = 'bromix'
from resources.lib.youtube.helper import yt_context_menu
from resources.lib import kodion
from resources.lib.kodion import items
from resources.lib.youtube.helper.yt_change_api import Change_API
from . import utils
import xbmcaddon
def _process_list_response(provider, context, json_data):
... | dannyperry571/theapprentice | plugin.video.youtube/resources/lib/youtube/helper/v3.py | Python | gpl-2.0 | 12,697 |
# Copyright 2016 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | npuichigo/ttsflow | third_party/tensorflow/tensorflow/contrib/linalg/python/ops/linear_operator_test_util.py | Python | apache-2.0 | 25,544 |
#coding:utf8
'''
Created on 2013-8-11
@author: lan (www.9miao.com)
'''
import urllib,sys
def execute(*args):
"""
"""
if not args:
masterport =9998
hostname = "localhost"
else:
if len(args)>1:
hostname = args[0]
masterport = int(args[1])
else:
... | yangdw/PyRepo | src/annotation/gfirefly/gfirefly/gfirefly/management/commands/stopservice.py | Python | mit | 675 |
"""
Support for MQTT locks.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/lock.mqtt/
"""
import asyncio
import logging
import voluptuous as vol
from homeassistant.core import callback
from homeassistant.components.lock import LockDevice
from homeassis... | ewandor/home-assistant | homeassistant/components/lock/mqtt.py | Python | apache-2.0 | 4,693 |
import unittest
from random import randint
from collections import OrderedDict
from deck import Card, Deck
from player import Player
from ai_player import AIPlayer
from game import Game
class TestSeparateCards(unittest.TestCase):
def test_is_equal(self):
card = Card('Spades', '6', 6)
other_card = ... | chivankich/ohio | tests.py | Python | gpl-2.0 | 12,217 |
from cms.models.Base import BaseModel
from cms.models.Game import Game
from cms.models.GameSession import GameSession
from cms.models.Player import Player
from cms.models.Role import Role
from cms.models.Affiliation import Affiliation | tehdiplomat/hidden-role-games | masq/cms/models/__init__.py | Python | mit | 234 |
import csv
import random
class Dominion:
cards = []
def __init__(self):
reader = csv.reader(open('data/cards.txt'), delimiter="|", quotechar="", quoting=csv.QUOTE_NONE)
for row in reader:
self.cards.append(row)
def get_random_cards(self, sets=[]):
if (sets is []):
return []
filtered = []
for card... | themrwilliams/flask-dominion-card-randomizer | app/dominion.py | Python | unlicense | 477 |
import unittest
from lifter import models
class TModel(models.Model):
field = models.CharField()
def __repr__(self):
return 'test'
class TestMeta(unittest.TestCase):
def test__meta_attribute_is_available_on_model(self):
meta = TModel._meta
self.assertTrue(isinstance(meta, models... | EliotBerriot/lifter | tests/test_meta.py | Python | isc | 597 |
import os
import signal
import sys
import tempfile
__test__ = False
def parent(signal_path, pid):
eventlet.Timeout(5)
port = None
while True:
try:
contents = open(signal_path, 'rb').read()
port = int(contents.strip())
break
except Exception:
... | kawamon/hue | desktop/core/ext-py/eventlet-0.24.1/tests/isolated/hub_fork_simple.py | Python | apache-2.0 | 1,357 |
# -*- coding: utf-8 -*-
#
# wincc_connect documentation build configuration file, created by
# sphinx-quickstart on Wed Aug 26 22:37:37 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 file.... | Idefux/pywincc | docs/conf.py | Python | gpl-3.0 | 9,365 |
from flask import render_template, session, redirect, url_for, current_app, flash, jsonify
from .. import mongo
from ..models import User, Miner
from . import main
from .forms import LoginForm, RegistrationForm, TransactionForm
from .table import BlockchainTable
@main.route('/', methods=['GET', 'POST'])
def index():
... | ScottMcCormack/CITS3002 | app/main/views.py | Python | mit | 3,926 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('articles', '0034_auto_20150813_1728'),
]
operations = [
migrations.AddField(
model_name='seriespage',
... | CIGIHub/greyjay | greyjay/articles/migrations/0035_auto_20150813_1802.py | Python | mit | 767 |
import AlphaBase as AlphaBase
import os
import numpy as np
class LanguageSource(object):
""" A class for training data.
"""
def __init__(self, alpha_set: AlphaBase):
""" Constructor, must be constructed after alpha_set is computed.
:param alpha_set: information about the characters used in... | LogicAtlas/LanguageDetectionRNN | LanguageSource.py | Python | mit | 5,778 |
# -*- coding: utf-8 -*-
# Copyright 2018 Simone Rubino - Agile Business Group
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
{
"name": "Delivery carrier partner",
"summary": "Add a partner in the delivery carrier",
"version": "10.0.1.0.0",
"development_status": "Beta",
"category": ... | OCA/carrier-delivery | delivery_carrier_partner/__manifest__.py | Python | agpl-3.0 | 674 |
import os
import subprocess
import uuid
from feather.compat import guid, tobytes
R_READ_WRITE_TEMPLATE = """
library(feather)
df <- read_feather("{0}")
write_feather(df, "{1}")
"""
def random_path():
return 'feather_{}'.format(guid())
def remove_paths(paths):
for x in paths:
try:
os.r... | wesm/feather | integration-tests/util.py | Python | apache-2.0 | 777 |
# 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 logging
import os
import re
import shutil
import sys
from pylib import constants
from pylib.base import base_test_result
from pylib.base import test_... | sgraham/nope | build/android/pylib/gtest/gtest_test_instance.py | Python | bsd-3-clause | 7,957 |
# Lint as: python3
# Copyright 2018 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless ... | tensorflow/lingvo | lingvo/core/attention.py | Python | apache-2.0 | 143,702 |
# -*- coding: utf-8 -*-
from builtins import str
from flask import render_template,g
from flask_mail import Message
from cineapp import mail, db
from cineapp.models import User
from threading import Thread
from cineapp import app
import html2text, time, json, traceback
# Send mail into a dedicated thread in order to ... | ptitoliv/cineapp | cineapp/emails.py | Python | mit | 11,336 |
## Created 2015, Zack Gainsforth
import matplotlib
#matplotlib.use('Qt4Agg')
import matplotlib.pyplot as plt
import numpy as np
from collections import OrderedDict
from scipy.optimize import curve_fit, fmin
from QuantSpectra import Section, GaussianComponent, LinearComponent
import h5py
import QuickPlot
import ALCHEMIC... | ZGainsforth/ALCHEMI | PlotALCHEMIEDS.py | Python | bsd-2-clause | 4,978 |
##############################################################################
#
# OSIS stands for Open Student Information System. It's an application
# designed to manage the core business of higher education institutions,
# such as universities, faculties, institutes and professional schools.
# The core ... | uclouvain/osis_louvain | reference/models/domain.py | Python | agpl-3.0 | 3,300 |
#/usr/bin/env python
# -*- coding: utf-8 -*-
##
## Copyright (c) 2010-2012 Jorge J. García Flores, LIMSI/CNRS
## This file is part of Unoporuno.
## Unoporuno 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... | jorgegarciaflo/unoporuno | webapp/cidesal/unoporuno/search_task.py | Python | gpl-3.0 | 53,549 |
from __future__ import unicode_literals
import base64
import json
import re
import six
from moto.core.responses import BaseResponse
from .models import kms_backends
from .exceptions import NotFoundException, ValidationException, AlreadyExistsException, NotAuthorizedException
reserved_aliases = [
'alias/aws/ebs',... | whummer/moto | moto/kms/responses.py | Python | apache-2.0 | 14,169 |
#!/usr/bin/env python
# -*- coding: utf8 -*-
from agate import Table
from agate.data_types import Number, Text
from agate.testcase import AgateTestCase
from agate.type_tester import TypeTester
class TestDenormalize(AgateTestCase):
def setUp(self):
self.rows = (
('Jane', 'Code', 'gender', 'fem... | wireservice/agate | tests/test_table/test_denormalize.py | Python | mit | 4,147 |
import logging
import time
from errors import CacheUpstreamError
import history
from infrastructure import infrastructure
from infrastructure_cache import cache
from jobs import TaskTypes
import storage
from sync import sync_manager
from task import Task
logger = logging.getLogger('mm.jobs')
class HistoryRemoveNod... | yandex/mastermind | src/cocaine-app/jobs/tasks/history_remove_node.py | Python | gpl-2.0 | 5,587 |
from unittest import TestCase
from readability_score.textanalyzer import TextAnalyzer
class LibTestCase(TestCase):
def test_incorrect_locale(self):
with self.assertRaises(LookupError):
t = TextAnalyzer("some text","bad_locale")
def test_short_locale(self):
with self.assertRaises(Lo... | wimmuskee/readability-score | test/test_lib.py | Python | gpl-2.0 | 1,359 |
from zeeguu_core.definition_of_learned import CORRECTS_IN_DISTINCT_DAYS_FOR_LEARNED
class SortedExerciseLog(object):
def __init__(self, bookmark):
self.exercises = sorted(
bookmark.exercise_log,
key=lambda x: x.time,
reverse=True)
# string rep for logging
def ... | mircealungu/Zeeguu-Core | zeeguu_core/model/SortedExerciseLog.py | Python | mit | 1,994 |
from flask_wtf import Form
from wtforms.fields.html5 import DecimalRangeField
from wtforms.fields import TextField, SubmitField, DateTimeField, DecimalField,\
HiddenField, BooleanField, PasswordField
from wtforms import ValidationError
from wtforms.validators import Optional, EqualTo, Requir... | paulfantom/Central-Heating-webpage | app/core/forms.py | Python | mpl-2.0 | 3,303 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2016, Peter Sagerson <psagers@ignorare.net>
# Copyright: (c) 2016, Jiri Tyr <jiri.tyr@gmail.com>
#
# 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
__... | 2ndQuadrant/ansible | lib/ansible/modules/net_tools/ldap/ldap_entry.py | Python | gpl-3.0 | 8,459 |
"""
Provides a collection of utilities for comparing (image) results.
"""
from __future__ import (absolute_import, division, print_function,
unicode_literals)
import six
import atexit
import functools
import hashlib
import itertools
import os
import re
import shutil
import sys
from tempfile i... | jonyroda97/redbot-amigosprovaveis | lib/matplotlib/testing/compare.py | Python | gpl-3.0 | 18,106 |
# Copyright 2011 OpenStack Foundation
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requ... | Metaswitch/calico-nova | nova/tests/unit/api/openstack/compute/contrib/test_scheduler_hints.py | Python | apache-2.0 | 8,265 |
from benevole import *
from DPS import *
from organisateur import *
from structure import *
from team import *
| DUlSine/DUlSine | DUlSine/models/__init__.py | Python | agpl-3.0 | 111 |
"""Configuration for pytest runner."""
pytest_plugins = 'pytester'
| pytest-dev/pytest-fixture-tools | tests/conftest.py | Python | mit | 68 |
#
# calcpos.py -- module for wrapping astronomical ephemeris calculations
#
import math
# third-party imports
import numpy as np
from datetime import datetime, timedelta
from dateutil import tz
import dateutil.parser
# right now we just have pyephem...
import ephem
# Constants
#earth_radius = 6378160.0
# TODO: more... | naojsoft/qplan | qplan/util/calcpos.py | Python | bsd-3-clause | 24,170 |
from ncclient.operations.retrieve import *
import unittest
from mock import patch
from ncclient import manager
import ncclient.manager
import ncclient.transport
from ncclient.xml_ import *
from ncclient.operations import RaiseMode
from ncclient.operations.errors import MissingCapabilityError
from xml.etree import Eleme... | leopoul/ncclient | test/unit/operations/test_retrieve.py | Python | apache-2.0 | 7,973 |
# encoding: utf-8
from __future__ import absolute_import, division, print_function
import os
# TODO: most of these (except possibly input_directory) should be moved to
# Simulation attributes (or in the context)
debug = os.environ.get("DEBUG", "False").lower() == "true"
input_directory = "."
output_directory... | liam2/liam2 | liam2/config.py | Python | gpl-3.0 | 585 |
import gym
from baselines import deepq
def main():
env = gym.make("PongNoFrameskip-v4")
env = deepq.wrap_atari_dqn(env)
model = deepq.learn(
env,
"conv_only",
convs=[(32, 8, 4), (64, 4, 2), (64, 3, 1)],
hiddens=[256],
dueling=True,
total_timesteps=0
)
... | dsbrown1331/CoRL2019-DREX | drex-mujoco/learner/baselines/baselines/deepq/experiments/enjoy_pong.py | Python | mit | 625 |
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import models, fields, api
from odoo.tools.safe_eval import safe_eval
class AccountTaxPython(models.Model):
_inherit = "account.tax"
amount_type = fields.Selection(selection_add=[('code', 'Python Cod... | t3dev/odoo | addons/account_tax_python/models/account_tax.py | Python | gpl-3.0 | 4,229 |
from __future__ import absolute_import
import os
import re
import warnings
from .compatibility import FileNotFoundError
# standard defaults
conf_defaults = {'host': 'localhost', 'port': 8020}
conf = conf_defaults.copy()
def hdfs_conf(confd, more_files=None):
""" Load HDFS config from default locations.
Par... | blaze/hdfs3 | hdfs3/conf.py | Python | bsd-3-clause | 3,414 |
# -*- coding: utf-8 -*-
"""Script to compact all Brython scripts in a single one."""
import time
import datetime
import os
import re
import sys
import tarfile
import zipfile
import shutil
import javascript_minifier
if sys.version_info[0] != 3:
raise ValueError("This script only works with Python 3")
# path of... | Hasimir/brython | scripts/make_dist.py | Python | bsd-3-clause | 7,571 |
#!/home/paulk/software/bin/python
from __future__ import division
from sys import argv,exit,stderr
from key_functions import process_feature
import pysam
tabixfile = pysam.Tabixfile("resources/Homo_sapiens.GRCh37.66.gtf.gz")
c = 0
f = open("alternative_exons.hg19.bed")
meps = dict()
for row in f:
if c > 5: break
l =... | polarise/RP-python | get_const_alt_exons.py | Python | gpl-2.0 | 1,028 |
#!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
"""
Subclass of TorchAgent used for handling image features.
"""
from typing import Optional
from parlai.core.params imp... | facebookresearch/ParlAI | parlai/core/torch_image_agent.py | Python | mit | 3,581 |
import sys
import platform
if platform.system() == 'Linux':
sys.path.insert(0,'/nethome/palmerio/Dropbox/Plotting_GUI/Src')
elif platform.system() == 'Darwin':
sys.path.insert(0,'/Users/palmerio/Dropbox/Plotting_GUI/Src')
# print platform.system()
# print sys.path
import numpy as np
import matplotlib.pyplot a... | JPalmerio/GRB_population_code | catalogs/GBM_cat/GBM_cat_cutoff.py | Python | gpl-3.0 | 19,713 |
from __future__ import absolute_import
from django.db import IntegrityError, transaction
from rest_framework.response import Response
from sentry import analytics, features
from sentry.api.bases import GroupEndpoint
from sentry.api.serializers import serialize
from sentry.api.serializers.models.integration import In... | ifduyue/sentry | src/sentry/api/endpoints/group_integration_details.py | Python | bsd-3-clause | 10,686 |
# -*- coding: utf-8 -*-
# This file is part of beets.
# Copyright 2016, Adrian Sampson.
#
# 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 t... | bbsan2k/nzbToMedia | libs/beetsplug/discogs.py | Python | gpl-3.0 | 14,456 |
"""Training objective for self-critical learning.
Self-critic learning is a modification of the REINFORCE algorithm that uses the
reward of the train-time decoder output as a baseline in the update step.
For more details see: https://arxiv.org/pdf/1612.00563.pdf
"""
from typing import Callable, Iterable, Tuple
from ... | bastings/neuralmonkey | neuralmonkey/trainers/self_critical_objective.py | Python | bsd-3-clause | 7,547 |
# -*- coding: utf-8 -*-
#
# diffoscope: in-depth comparison of files, archives, and directories
#
# Copyright © 2015 Jérémy Bobbio <lunar@debian.org>
#
# diffoscope 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 Foundati... | bnewbold/diffoscope | tests/comparators/test_png.py | Python | gpl-3.0 | 2,097 |
# -*- coding: utf-8 -*-
# Copyright © 2014-2015 Cask Data, 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 appli... | mpouttuclarke/cdap | cdap-docs/_common/highlevel_conf.py | Python | apache-2.0 | 5,790 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('api', '0123_auto_20160401_0019'),
]
operations = [
migrations.AddField(
model_name='eventparticipation',
... | dburr/SchoolIdolAPI | api/migrations/0124_eventparticipation_account_owner_status.py | Python | apache-2.0 | 669 |
#!/usr/bin/python
#
# Copyright (c) 2016 Matt Davis, <mdavis@ansible.com>
# Chris Houseknecht, <house@redhat.com>
# 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
ANSI... | roadmapper/ansible | lib/ansible/modules/cloud/azure/azure_rm_storageaccount_info.py | Python | gpl-3.0 | 22,917 |
# #######
# Copyright (c) 2016-2020 Cloudify Platform Ltd. All rights reserved
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless... | cloudify-cosmo/cloudify-azure-plugin | cloudify_azure/resources/storage/disk.py | Python | apache-2.0 | 6,253 |
from sfa.rspecs.elements.element import Element
class PLTag(Element):
fields = [
'tagname',
'value',
]
| onelab-eu/sfa | sfa/rspecs/elements/pltag.py | Python | mit | 138 |
# -*- coding: utf-8 -*-
default_app_config = 'allink_apps.locations.apps.AllinkLocationsConfig'
__version__ = '0.0.1'
| allink/allink-apps | locations/__init__.py | Python | bsd-3-clause | 118 |
"""
Main point of entry for the web application
"""
import flask_sijax
from flask import render_template, g, send_from_directory
from app import app
from sijax_handlers.container_handler import container_handler
import os
@flask_sijax.route(app, '/')
def login():
# Check if is a sijax request
if g.sijax.is_... | sfloresk/NCA-Container-Builder | app/views.py | Python | apache-2.0 | 1,155 |
#!/usr/bin/env python
"""
Monitor the Daylite Touch syncfile (DLTouchd.log)
and notify the administrator of any syncs.
A sync is an up- or download of data
to a mobile device (iPad, iPhone)
This is useful to check the health of
a network with many mobile clients.
"""
# Needed for monitoring
import time
from watchdo... | mre/Daylite-Touch-Sync-Notification | server/dtouchserver.py | Python | gpl-3.0 | 3,703 |
# 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 t... | openstack/nova | nova/tests/functional/libvirt/test_machine_type.py | Python | apache-2.0 | 15,042 |
# -*- coding: utf-8 -*-
#
# This file is part of Django appschema released under the MIT license.
# See the LICENSE for more information.
from django.conf import settings
from django.core.management.base import BaseCommand, CommandError
from django.core.management import call_command
from south.management.commands imp... | allanlei/django-saas | saas/multischema/management/commands/migrate.py | Python | bsd-3-clause | 3,287 |
###############################################################################
#
# Tests for XlsxWriter.
#
# Copyright (c), 2013, John McNamara, jmcnamara@cpan.org
#
import unittest
import os
from ...workbook import Workbook
from ..helperfunctions import _compare_xlsx_files
class TestCompareXLSXFiles(unittest.TestC... | ivmech/iviny-scope | lib/xlsxwriter/test/comparison/test_table06.py | Python | gpl-3.0 | 2,178 |
# -*- coding: utf-8 -*-
#
# Picard, the next-generation MusicBrainz tagger
# Copyright (C) 2004 Robert Kaye
# Copyright (C) 2006 Lukáš Lalinský
#
# 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; ... | dufferzafar/picard | picard/util/__init__.py | Python | gpl-2.0 | 13,983 |
#!/usr/bin/env python
# -*- coding: UTF-8 -*-
"""
Contains some function to make the package run-able.
These are also used by the start-skript - ``stream_desktop`` - which is
created if this this package is installed.
"""
from __future__ import absolute_import
from __future__ import print_function
import sys
from... | brutus/Desktop-Streamer | desktopstreamer/__main__.py | Python | gpl-3.0 | 1,335 |
'''
Copyright 2013 purpleflame
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 the hope th... | 3kakakhel/pygw2sim | SampleSim.py | Python | gpl-3.0 | 2,053 |
from urllib.parse import urljoin
OAUTH_BASE_ENDPOINT = "account/api/oauth/"
AUTH_ENDPOINT = urljoin(OAUTH_BASE_ENDPOINT, 'authorize.htm')
USER_ENDPOINT = urljoin(OAUTH_BASE_ENDPOINT, 'user.htm')
EMAIL_VALIDATION_ENDPOINT = "/account/validateEmail.htm"
EMAIL_VALIDATION_STATUS_ENDPOINT = "/account/api/isEmailValidated... | CityOfNewYork/NYCOpenRecords | app/constants/web_services.py | Python | apache-2.0 | 649 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import matplotlib.pyplot as plt
plt.plot([1, 2, 3, 4], [-4, -3, -2, -1])
plt.show()
| weiqiangdragonite/blog_tmp | python/matplotlib/课件/1_课程简介和环境搭建/ex.py | Python | gpl-2.0 | 134 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright 2013 The Plaso Project Authors.
# Please see the AUTHORS file for details on individual 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 L... | iwm911/plaso | plaso/unix/bsmtoken.py | Python | apache-2.0 | 23,718 |
# vim: ai et ts=4 sw=4 sts=4
from twisted.internet import defer, protocol, reactor
from twisted.protocols import basic
from twisted.python import log
import logging
import sys
import twisted
import re
RESPONSE_PATTERN = re.compile('^([^ ]*) +(.*?) +[* ]([^ ]*)')
class FingerClient(protocol.Protocol):
def connec... | teisenbe/xmppbot | example/finger.py | Python | mit | 2,332 |
#!/usr/bin/env python
class ShapeGrid(object):
"""
Generic shape grid interface. Should be subclassed by specific shapes.
"""
def __init__(self):
pass
def create_grid(self, layer, extent, num_across=10):
raise NotImplementedError('Provided by each subclass of ShapeGrid.')
| kevinschaul/binify | binify/shapegrids/shapegrid.py | Python | mit | 313 |
"""
Admin
"""
from django.contrib import admin
from .models import BackingInstance
admin.site.register(BackingInstance)
| mitodl/ccxcon | oauth_mgmt/admin.py | Python | agpl-3.0 | 122 |
"""
Tests for the MerchantFulfillment API class.
"""
import unittest
import mws
from .utils import CommonRequestTestTools
class MerchantFulfillmentTestCase(unittest.TestCase, CommonRequestTestTools):
"""
Test cases for MerchantFulfillment.
"""
# TODO: Add remaining methods for MerchantFulfillment
... | Bobspadger/python-amazon-mws | tests/request_methods/test_merchantfulfillment.py | Python | unlicense | 1,858 |
# Copyright 2015 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... | DailyActie/Surrogate-Model | 01-codes/tensorflow-master/tensorflow/python/framework/tensor_util_test.py | Python | mit | 16,873 |
from ctypes import windll, pointer
from ctypes.wintypes import DWORD
from prompt_toolkit.key_binding.input_processor import KeyPress
from prompt_toolkit.keys import Keys
from prompt_toolkit.win32_types import EventTypes, KEY_EVENT_RECORD, INPUT_RECORD, STD_INPUT_HANDLE
__all__ = (
'ConsoleInputReader',
'raw_m... | jaseg/python-prompt-toolkit | prompt_toolkit/terminal/win32_input.py | Python | bsd-3-clause | 8,877 |
# Copyright 2013 OpenStack Foundation
# Copyright 2013 IBM Corp
# 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/LICE... | afaheem88/tempest_neutron | tempest/api/image/v2/test_images.py | Python | apache-2.0 | 9,365 |
# -*- coding: utf-8 -*-
# © 2015 Therp BV <http://therp.nl>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from openerp.tests.common import TransactionCase
class TestMailFollowerCustomNotification(TransactionCase):
def test_mail_follower_custom_notification(self):
self.env['mail.thre... | open-synergy/social | mail_follower_custom_notification/tests/test_mail_follower_custom_notification.py | Python | agpl-3.0 | 3,092 |
"""Useful wrappers and other tools."""
import re
from collections import namedtuple
from ...utils import parse_qsd as parse_query, parse_json, parse_xml
__all__ = ["parse_json", "parse_xml", "parse_query"]
tag_re = re.compile('''(?=<(?P<tag>[a-zA-Z]+)(?P<attr>.*?)(?P<end>/)?>(?:(?P<inner>.*?)</\s*(?P=tag)\s*>)?)'''... | back-to/streamlink | src/streamlink/plugin/api/utils.py | Python | bsd-2-clause | 1,130 |
import unittest
from donkus import parser
import importlib
importlib.reload(parser)
class Test_parser_tests(unittest.TestCase):
def test_peek(self):
result = parser.peek([('noun', 'bear'), ('verb', 'eat')])
self.assertEqual('noun', 'noun')
def test_match(self):
word_list = [('ve... | jclosure/donkus | tests/parser_tests.py | Python | mit | 3,315 |
from django.apps import apps
from wagtail.contrib.frontend_cache.utils import purge_page_from_cache
from wagtail.core.signals import page_published, page_unpublished
def page_published_signal_handler(instance, **kwargs):
purge_page_from_cache(instance)
def page_unpublished_signal_handler(instance, **kwargs):
... | wagtail/wagtail | wagtail/contrib/frontend_cache/signal_handlers.py | Python | bsd-3-clause | 826 |
# Create your views here.
from django.contrib.syndication.views import Feed
from q4wine.news.models import News
from django.utils.feedgenerator import Atom1Feed
import string
class RssSiteNewsFeed(Feed):
title = "News related to q4wine development stuff and its community life."
link = "/rss/"
description ... | brezerk/q4wine-web | rss/views.py | Python | gpl-3.0 | 1,075 |
import os
import logging
from logging.handlers import WatchedFileHandler
from flask import Flask
from flask.ext.sqlalchemy import SQLAlchemy
from flask.ext import restful
from flask.ext.login import LoginManager
from flask.ext.cache import Cache
from flask_wtf.csrf import CsrfProtect
from flask.ext.assets import Envi... | zzzombat/mailflow | src/mailflow/front/__init__.py | Python | apache-2.0 | 2,576 |
from django.conf import settings
from importlib import import_module
# import django_comment_client.utils as utils
# from courseware.courses import get_course_with_access
import pymongo
import logging
from pytz import UTC
import datetime
log = logging.getLogger("tracking")
from bson import ObjectId
from collections i... | EduPepperPDTesting/pepper2013-testing | common/djangoapps/student/feeding.py | Python | agpl-3.0 | 5,579 |
import numpy as np
from ..local_interpolation import ThirdOrderHermitePolynomialInterpolation
from .runge_kutta import AbstractESDIRK, ButcherTableau
# This γ notation is from the original paper. All the coefficients are described in
# terms of it.
γ = 0.43586652150
a21 = γ
a31 = (-4 * γ**2 + 6 * γ - 1) / (4 * γ)
a3... | patrick-kidger/diffrax | diffrax/solver/kvaerno3.py | Python | apache-2.0 | 1,793 |
# @package regularizer_context
# Module caffe2.python.regularizer_context
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
from caffe2.python import context
from caffe2.python.modifier_context import (
ModifierConte... | xzturn/caffe2 | caffe2/python/regularizer_context.py | Python | apache-2.0 | 1,177 |
#
# comments.py - View/Edit Comments
#
# This file is part of gshogi
#
# gshogi 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 vers... | johncheetham/gshogi | gshogi/comments.py | Python | gpl-3.0 | 6,049 |
# TreeLearn
#
# Copyright (C) Capital K Partners
# Author: Alex Rubinsteyn
# Contact: alex [at] capitalkpartners [dot] com
#
# 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
# vers... | capitalk/treelearn | treelearn/oblique_tree.py | Python | lgpl-3.0 | 4,543 |
# 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... | yajiedesign/mxnet | contrib/tvmop/compile.py | Python | apache-2.0 | 6,325 |
# pyui2
# Copyright (C) 2005 John Judd
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of version 2.1 of the GNU Lesser General Public
# License as published by the Free Software Foundation.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT A... | Ripsnorta/pyui2 | widgets/toolbar.py | Python | lgpl-2.1 | 2,460 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
"""Tests for the Firefox history event formatter."""
import unittest
from plaso.formatters import firefox
from tests.formatters import test_lib
class FirefoxBookmarkAnnotationFormatterTest(test_lib.EventFormatterTestCase):
"""Tests for the Firefox bookmark annotation eve... | dc3-plaso/plaso | tests/formatters/firefox.py | Python | apache-2.0 | 3,864 |
'''
Constants for beamtools package
Created Thu Mar 23
@author: cpkmanchee
'''
from numpy import pi
c = 299792458.0 #Speed of light, m/s
h = 6.62607004081E-34 #Planck constant, J*s
hbar = 1.05457180013E-34 #Reduced Planck constant, J*s
e = 1.602176620898E-19 #Elementary charge, C
mu0 = pi*... | kikimaroca/beamtools | build/lib/beamtools/constants.py | Python | mit | 695 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.