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 |
|---|---|---|---|---|---|
""" Test class for Job Agent
"""
# imports
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import pytest
from collections import defaultdict
# DIRAC Components
from DIRAC.WorkloadManagementSystem.Agent.PushJobAgent import PushJobAgent
from DIRAC.Core.Utilit... | ic-hep/DIRAC | src/DIRAC/WorkloadManagementSystem/Agent/test/Test_Agent_PushJobAgent.py | Python | gpl-3.0 | 3,574 |
"""
migro.uploader
~~~~~~~~~~~~~~
Uploadcare migration uploader.
""" | uploadcare/migro | migro/uploader/__init__.py | Python | mit | 83 |
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import pytz
import datetime
import itertools
import logging
import hmac
from collections import defaultdict
from itertools import chain, repeat
from lxml import etree
from lxml.builder import E
from hashlib import sha256... | maxive/erp | odoo/addons/base/models/res_users.py | Python | agpl-3.0 | 38,610 |
from .. import abc
from .. import util
machinery = util.import_importlib('importlib.machinery')
import errno
import os
import py_compile
import stat
import sys
import tempfile
from test.support import make_legacy_pyc
import unittest
import warnings
class FinderTests(abc.FinderTests):
"""For a top-level module,... | Microvellum/Fluid-Designer | win64-vc/2.78/python/lib/test/test_importlib/source/test_finder.py | Python | gpl-3.0 | 8,775 |
# -*- coding: utf-8 -*-
##############################################################################
#
# Mongotail, Log all MongoDB queries in a "tail"able way.
# Copyright (C) 2015 Mariano Ruiz (<http://mrdev.com.ar>).
#
# Author: Mariano Ruiz <mrsarm@gmail.com>
#
# This program is free software: you can redistr... | ChrisMcKee/mongotail | setup.py | Python | gpl-3.0 | 1,975 |
# Copyright (C) 2013-2014 Codethink Limited.
#
# 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) any later version.
#
# This program i... | CodethinkLabs/toucan | toucanlib/cli/rendering.py | Python | agpl-3.0 | 27,619 |
# -*- coding: utf-8 -*-
#
# API Documentation:
# http://api.letitbit.net/reg/static/api.pdf
#
# Test links:
# http://letitbit.net/download/07874.0b5709a7d3beee2408bb1f2eefce/random.bin.html
import re
import urlparse
from module.common.json_layer import json_loads, json_dumps
from module.network.RequestFactory import ... | ace02000/pyload | module/plugins/hoster/LetitbitNet.py | Python | gpl-3.0 | 4,185 |
# pyOCD debugger
# Copyright (c) 2020 NXP
# Copyright (c) 2018 Arm Limited
# SPDX-License-Identifier: Apache-2.0
#
# 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/... | pyocd/pyOCD | pyocd/target/builtin/target_MIMXRT1176xxxxx.py | Python | apache-2.0 | 77,742 |
import pytest
from waterbutler.providers.bitbucket.path import BitbucketPath
COMMIT_SHA = 'abcea54a123'
BRANCH = 'develop'
class TestBitbucketPath:
def test_id_accessors(self):
bb_path = BitbucketPath('/foo', _ids=[(COMMIT_SHA, BRANCH), (COMMIT_SHA, BRANCH)])
assert bb_path.commit_sha == COMMIT... | TomBaxter/waterbutler | tests/providers/bitbucket/test_path.py | Python | apache-2.0 | 2,701 |
"""
Module containing a class for getting the BNGL NET file for a given PySB model.
Serves as a wrapper around :py:func:`pysb.bng.generate_network`, which
generates the BNGL for the model and then invokes BNG to generate the NET file.
For information on how to use the model exporters, see the documentation
for :py:mo... | neurord/pysb | pysb/export/bng_net.py | Python | bsd-2-clause | 1,147 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import sqlite3 as sqlite
from dbFile import dbFile
name = 'Sqlite 3'
class database_handler_sqlite(dbFile):
def __init__(self, path):
dbFile.__init__(self, path)
self.path = path
self.db_type = 'sqlite'
def connect(self):
... | Smaed/pyDbManager | dbHandlers/database_handler_sqlite.py | Python | gpl-2.0 | 485 |
"""
Test that make+request is making correct HTTP requests
Uses the awesome httpbin.org to validate responses
"""
import twilio
from nose.tools import raises
from mock import patch, Mock
from twilio import TwilioRestException
from twilio.rest.resources.base import make_request, make_twilio_request
get_headers = {
... | clearcare/twilio-python | tests/test_make_request.py | Python | mit | 2,409 |
# Configuration file for jupyter-notebook.
#------------------------------------------------------------------------------
# Configurable configuration
#------------------------------------------------------------------------------
#------------------------------------------------------------------------------
# Logg... | ljishen/ga4gh-testing | client/jupyter_notebook_config.py | Python | apache-2.0 | 21,179 |
# This program is free software; you can redistribute it and/or modify
# it under the terms of the (LGPL) GNU Lesser General Public License as
# published by the Free Software Foundation; either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will ... | kennu/suds | suds/sax/element.py | Python | lgpl-3.0 | 36,541 |
#!/usr/bin/env python
# coding=utf-8
#
from suds.client import Client as Suds
class Core:
api_username = None
api_password = None
api_context = None
api_translator = None
class Api:
RPC_LITERAL_BRANDED = 'http://paint.pure360.com/paint.pure360.com/ctrlPaintLiteral.wsdl'
RPC_LIT... | TriggeredMessaging/pyresponse | lib/core.py | Python | mit | 16,115 |
# -*- coding: utf-8; -*-
# Copyright (C) 2015 - 2019 Lionel Ott
#
# 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.
#
# T... | WhiteMagic/JoystickGremlin | gremlin/code_runner.py | Python | gpl-3.0 | 15,898 |
from flask import Flask
import enlil.api.root
def create_app(config):
app = Flask('enlil')
app.register_blueprint(enlil.api.root.blueprint)
return app
| EliRibble/enlil | enlil/server.py | Python | mit | 164 |
#!/usr/bin/python
'''
work out total flight time for a mavlink log
'''
import sys, time, os, glob
from optparse import OptionParser
parser = OptionParser("flighttime.py [options]")
parser.add_option("--condition", default=None, help="condition for packets")
parser.add_option("--groundspeed", type='float', default=3.... | rileychapman/roscopter-1 | mavlink/pymavlink/build/scripts-2.7/mavflighttime.py | Python | bsd-3-clause | 1,892 |
#Material.py
import numpy as np
class Material(object):
#constructor
def __init__(self):
self.color = np.array([.0,.0,.0])
#================================================================
#========================== SETTERS =============================
#===================================================... | parer800/munte-carlu | src/material.py | Python | mit | 2,190 |
import _plotly_utils.basevalidators
class HoverinfosrcValidator(_plotly_utils.basevalidators.SrcValidator):
def __init__(
self, plotly_name="hoverinfosrc", parent_name="histogram2dcontour", **kwargs
):
super(HoverinfosrcValidator, self).__init__(
plotly_name=plotly_name,
... | plotly/plotly.py | packages/python/plotly/plotly/validators/histogram2dcontour/_hoverinfosrc.py | Python | mit | 433 |
import numpy as np
import amnet
from amnet.util import mfp
import z3
import cvxpy
import itertools
class VerificationResult(object):
# possible flags for result of a verification problem
SUCCESS = 1
FAIL = 2
FAIL_WITH_COUNTEREXAMPLE = 3
# constructor
def __init__(self, code):
self.c... | ipapusha/amnet | amnet/lyap.py | Python | bsd-3-clause | 13,444 |
import functools
import os
import tempfile
import unittest
import mock
import numpy
import pytest
import six
import chainer
from chainer import cuda
from chainer import functions
from chainer import links
from chainer import testing
from chainer.testing import attr
from chainer import variable
class TestSequential(... | okuta/chainer | tests/chainer_tests/test_sequential.py | Python | mit | 22,695 |
"""WebUI tests for the Docker feature.
:Requirement: Docker
:CaseAutomation: Automated
:CaseLevel: Acceptance
:CaseComponent: UI
:TestType: Functional
:CaseImportance: High
:Upstream: No
"""
from nailgun import entities
from robottelo.constants import (
ENVIRONMENT,
DEFAULT_CV,
DOCKER_REGISTRY_HUB,
... | sghai/robottelo | tests/foreman/ui_airgun/test_container.py | Python | gpl-3.0 | 2,307 |
class FrontInput(object):
"""
Object of this class represents line in the file.
"""
def __init__(self, offset, line_content, line_source):
"""
Basic constructor of FrontInput.
:param offset: byte of the first character of line in the file.
:param line_content: the conten... | kgromadzki/whylog | whylog/front/utils.py | Python | bsd-3-clause | 836 |
from django.contrib import admin
# Register your models here.
from members.models import MemberRole
class MemberRoleAdmin(admin.ModelAdmin):
pass
admin.site.register(MemberRole, MemberRoleAdmin)
| michel-cf/taggy | members/admin.py | Python | lgpl-3.0 | 203 |
from __future__ import print_function
import sys
import os
import odbAccess as oa
import numpy as np
HYDRA = 'HYDRA'
def main():
if not len(sys.argv) == 2:
print('usage:\n {0} <job name>'.format(sys.argv[0]),
file=sys.stderr)
sys.exit(2)
odbpath = sys.argv[1] + '.odb'
jac... | PoliHydra/hydra | abapython/mkjac.py | Python | mit | 1,855 |
from flask.ext.appbuilder import Model
from flask.ext.appbuilder.models.mixins import AuditMixin, FileColumn, ImageColumn
"""
You can use the extra Flask-AppBuilder fields and Mixin's
AuditMixin will add automatic timestamp of created and modified by who
"""
| rpiotti/Flask-AppBuilder | examples/oauth/app/models.py | Python | bsd-3-clause | 273 |
"""
PiDeF Ebook downloader
Version 1.0
Coded in Python 2.7
Modules used:
Tkinter – For designing GUI interface
Json – For decoding json files
Urllib – for downloading pdf files
Sqllite3 – for handling databases
Googleapiclient – API connect for Google search
Features:
Searches f... | arulthileeban/PiDeF-Ebook-Downloader | main.py | Python | apache-2.0 | 9,521 |
#
# Code to read, write and edit VCF files
#
# VCF lines are encoded as a dictionary with these keys (note: all lowercase):
# 'chrom': string
# 'pos': integer
# 'id': string
# 'ref': string
# 'alt': list of strings
# 'qual': integer
# 'filter': None (missing value), or list of keys (strings); empty list... | andyrimmer/Platypus | src/python/vcf.py | Python | gpl-3.0 | 46,514 |
#!/usr/bin/env python3
import time
import argparse
import configparser
import logging
import getpass
import requests
import serial
import sys
NETATMO_URL_AUTH = "https://api.netatmo.com/oauth2/token"
NETATMO_URL_STATION = "https://api.netatmo.com/api/getstationsdata"
NETATMO_URL_TIMEOUT = 20
config = None
config_fil... | guiduc/LCDTemp | lcdtemp.py | Python | mit | 9,014 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
]
operations = [
migrations.CreateModel(
name='Info_Struts2',
fields=[
('id', models.AutoField... | tiaotiaolong/vulnerability_platform | struts2/migrations/0001_initial.py | Python | gpl-3.0 | 884 |
from jira.exceptions import JIRAError
from tests.conftest import JiraTestCase
DEFAULT_NEW_REMOTE_LINK_OBJECT = {"url": "http://google.com", "title": "googlicious!"}
class RemoteLinkTests(JiraTestCase):
def setUp(self):
JiraTestCase.setUp(self)
self.issue_1 = self.test_manager.project_b_issue1
... | pycontribs/jira | tests/resources/test_remote_link.py | Python | bsd-2-clause | 6,299 |
from datetime import datetime
from django.test import TestCase
from adaptor.fields import *
from adaptor.model import CsvModel, CsvDbModel, ImproperlyConfigured,\
CsvException, CsvDataException, TabularLayout, SkipRow,\
GroupedCsvModel, CsvFieldDataException
from tests.test_app.models import *
class TestCsvMo... | anthony-tresontani/django-adaptors | tests/csv_tests.py | Python | bsd-3-clause | 22,471 |
from MergeIndependent import *
| mica-gossip/MiCA | tools/micavis/custom/RoundRobinMerge.py | Python | bsd-3-clause | 31 |
#!/usr/bin/python3
from ch21 import MersenneTwister
import random
import time
# Set 3, challenge 22: crack a MT19937 seed.
MIN_PAUSE = 40
MAX_PAUSE = 1000
def RandWithTimestampedSeed():
pause = random.randint(MIN_PAUSE, MAX_PAUSE)
time.sleep(pause)
seed = int(time.time())
# Just to know if we did it right.
pr... | shainer/matasano | set3/ch22.py | Python | gpl-3.0 | 1,579 |
"""
Python 2 + 3 compatibility functions. This is a very small subset of six.
"""
import sys
PY3 = sys.version_info[0] == 3
if PY3:
string_types = str,
text_type = str
raw_input = input
import io
StringIO = io.StringIO
else:
string_types = basestring,
text_type = unicode
raw_input =... | ifduyue/sentry | src/south/utils/py3.py | Python | bsd-3-clause | 852 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
This module contains the FloatValue class.
"""
from harpia.GUI.fieldtypes import *
from harpia.model.plugin import Plugin
class FloatValue(Plugin):
# -------------------------------------------------------------------------
def __init__(self):
Plugin._... | llgoncalves/harpia | harpia/extensions/javascript/webaudio/floatvalue.py | Python | gpl-2.0 | 2,487 |
#
# Copyright (c) 2007-2009 FastMQ Inc.
#
# This file is part of 0MQ.
#
# 0MQ is free software; you can redistribute it and/or modify it under
# the terms of the Lesser GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any... | floydprice/helloworld | perf/tests/zmq/py_local_thr.py | Python | gpl-3.0 | 2,155 |
"""
Routines for rigidly aligning point clouds
"""
import numpy as np
def robust_horn(X0, X1, ransac_rounds=4096, ransac_threshold=10.0):
"""
Use Horn's method to align corresponding points
clouds X0 and X1. Wrap this inside a RANSAC loop
for robustness.
"""
hypothesis_size = 3
n = X0.sha... | RangerKD/SfM_Init | sfminit/hornsmethod.py | Python | bsd-2-clause | 5,651 |
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... | SUSE/azure-sdk-for-python | azure-servicefabric/azure/servicefabric/models/create_compose_application_description.py | Python | mit | 1,678 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# This file is part of picapy
#
# Copyright (C) 2010-2016 Lorenzo Carbonell
# lorenzo.carbonell.cerezo@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 So... | atareao/Picapy | src/informacionalbum.py | Python | gpl-3.0 | 4,338 |
from setuptools import setup
from os import path
from codecs import open
from pypushwoosh import __version__
with open(path.join(path.abspath(path.dirname(__file__)), 'README.rst'), encoding='utf-8') as f:
long_description = f.read()
setup(
name='pypushwoosh',
version=__version__,
author='Konstantin... | Pushwoosh/pushwoosh-python-lib | setup.py | Python | mit | 1,409 |
#!/usr/bin/env python
import os
import sys
if __name__ == '__main__':
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'tests.settings')
try:
from django.core.management import execute_from_command_line
except ImportError as exc:
raise ImportError(
"Couldn't import Django. Are yo... | samastur/Impostor | tests/manage.py | Python | mit | 537 |
#!/usr/bin/env python3
import os
import sys
import requests
import argparse
from base64 import b64decode
_REPO = "https://api.github.com/repos/github/gitignore"
__version__ = "1.0.1"
def cmd_parse():
"""parse command line arguments"""
parser = argparse.ArgumentParser(
description="Get gitignore files... | tlatsas/ignore | ignore.py | Python | gpl-3.0 | 4,178 |
"""Defines the unit tests for the :mod:`colour.models.jzazbz` module."""
import numpy as np
import unittest
from itertools import permutations
from colour.models import (
XYZ_to_Izazbz,
Izazbz_to_XYZ,
XYZ_to_Jzazbz,
Jzazbz_to_XYZ,
)
from colour.utilities import domain_range_scale, ignore_numpy_errors
... | colour-science/colour | colour/models/tests/test_jzazbz.py | Python | bsd-3-clause | 12,337 |
# (c) 2012, Daniel Hokka Zakrisson <daniel@hozac.com>
# (c) 2013, Javier Candeira <javier@candeira.com>
# (c) 2013, Maykel Moya <mmoya@speedyrails.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published... | andreaso/ansible | lib/ansible/plugins/lookup/password.py | Python | gpl-3.0 | 9,268 |
import os
import sys
import requests
import time
from pocket import Pocket
import webbrowser
import collections
import json
sys.dont_write_bytecode = True
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "trex.settings")
import django
django.setup()
from restapi.models import *
from random import randint
# POCKET_CON... | tavy14t/tw_project | Testing/Pocket_Testing.py | Python | mit | 4,909 |
TUS_RESUMABLE_FIELD_NAME = "tus_resumable"
UPLOAD_DEFER_LENGTH_FIELD_NAME = "tus_upload_defer_length"
UPLOAD_LENGTH_FIELD_NAME = "tus_upload_length"
UPLOAD_OFFSET_NAME = "tus_upload_offset"
UPLOAD_METADATA_FIELD_NAME = "tus_upload_metadata"
UPLOAD_CHECKSUM_FIELD_NAME = "tus_upload_checksum"
| fin/froide | froide/upload/constants.py | Python | mit | 293 |
# SPDX-License-Identifier: GPL-2.0+
# Copyright (c) 2016 Google, Inc
# Written by Simon Glass <sjg@chromium.org>
#
# Entry-type module for blobs, which are binary objects read from files
#
from binman.entry import Entry
from dtoc import fdt_util
from patman import tools
from patman import tout
class Entry_blob(Entry)... | Digilent/u-boot-digilent | tools/binman/etype/blob.py | Python | gpl-2.0 | 2,472 |
# Copyright 2010-2014 Google
# 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, so... | AlperSaltabas/OR_Tools_Google_API | examples/python/hidato_table.py | Python | apache-2.0 | 5,560 |
# -*- coding: utf-8 -*-
# Generated by Django 1.10.dev20160107235441 on 2016-10-03 18:42
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('groups', '0001_initial'),
]
operations = [
migrations.AddFi... | yayoiukai/signalserver | groups/migrations/0002_auto_20161003_1842.py | Python | mit | 633 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import math
from django.utils.encoding import smart_text
from .registry import register
@register.simple_tag()
def get_avatar_color(user):
# returns 0-215
return smart_text(int(215 * math.log10(user.pk)))
| ramaseshan/Spirit | spirit/core/tags/avatar.py | Python | mit | 282 |
"""
Pages object for the Django's /admin/ views.
"""
import django
from bok_choy.page_object import PageObject
from common.test.acceptance.pages.lms import BASE_URL
class ChangeUserAdminPage(PageObject):
"""
Change user page in Django's admin.
"""
def __init__(self, browser, user_pk):
super(Ch... | procangroup/edx-platform | common/test/acceptance/pages/lms/admin.py | Python | agpl-3.0 | 2,154 |
#
# Copyright (c) 2009-2015, Jack Poulson
# All rights reserved.
#
# This file is part of Elemental and is under the BSD 2-Clause License,
# which can be found in the LICENSE file in the root directory, or at
# http://opensource.org/licenses/BSD-2-Clause
#
import El
# TODO: Add noise so that the soft margin is ... | mcopik/Elemental | examples/interface/SVMDense.py | Python | bsd-3-clause | 2,902 |
# Copyright 2016 The Johns Hopkins University Applied Physics Laboratory
#
# 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... | jhuapl-boss/intern | intern/service/boss/v1/__init__.py | Python | apache-2.0 | 723 |
"""
Django settings for mediamapper project.
For more information on this file, see
https://docs.djangoproject.com/en/1.7/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.7/ref/settings/
"""
# Build paths inside the project like this: os.path.join(BASE_DIR, ...... | pedregalux/mediamapperhackday | mediamapper/settings.py | Python | gpl-3.0 | 2,498 |
#!/usr/bin/env python
# Copyright (c) 2012 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""
Verifies that a project hierarchy created with the --generator-output=
option can be built even when it's relocated to a different path.... | BozhkoAlexander/mtasa-blue | vendor/google-breakpad/src/tools/gyp/test/standalone/gyptest-standalone.py | Python | gpl-3.0 | 869 |
import tweepy
# Melissa
from melissa import profile
from melissa.tts import tts
WORDS = {'post_tweet': {'groups': ['tweet']}}
def post_tweet(text):
if profile.data['twitter']['consumer_key'] == "xxxx" \
or profile.data['twitter']['consumer_secret'] == "xxxx" \
or profile.data['twitter']... | anurag-ks/Melissa-Core | melissa/actions/twitter_interaction.py | Python | mit | 1,106 |
#!/usr/bin/env python3
# Copyright(c) 2014-2019 Daniel Kraft
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
# Utility routines for auxpow that are needed specifically by the regtests.
# This is mostly about actually *solving* an ... | rnicoll/dogecoin | test/functional/test_framework/auxpow_testing.py | Python | mit | 2,342 |
from .. import ndtypes
from .. ndtypes import ArrayT, Int64, elt_type, empty_tuple_t, TupleT, TypeValueT
from .. frontend import macro, jit, typed_macro
from .. syntax import (Attribute, Tuple, Ravel, Shape, Reshape, TypeValue, Transpose, Const)
from .. syntax.helpers import const_int, zero_i64
@macro
def trans... | pombredanne/parakeet | parakeet/lib/array_properties.py | Python | bsd-3-clause | 1,224 |
#
# 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 us... | lukecwik/incubator-beam | sdks/python/apache_beam/runners/dataflow/internal/apiclient_test.py | Python | apache-2.0 | 47,214 |
# -*- coding: utf-8 -*-
# Copyright © 2009-2013 Amber and Zooko Wilcox-O'Hearn
#
# See README.rst for licensing information.
PKG='BackOffTrigramModel'
import os
import versioneer
versioneer.versionfile_source = os.path.join('src', 'Python', 'BackOffTrigramModel', '_version.py')
versioneer.versionfile_build = os.pat... | ambimorph/BackOffTrigramModel | setup.py | Python | agpl-3.0 | 1,860 |
# -*- coding: utf-8 -*-
from collections import OrderedDict
from jukoro.pg.exceptions import AlreadyRegistered
from jukoro.pg.introspect import inspect
class SqlDescr(object):
"""
Python descriptor acting as a factory for sql abstraction
:param target: :class:`~AbstractSql`-derived class
"""
... | ysegorov/jukoro | jukoro/pg/storage.py | Python | mit | 21,052 |
# Copyright 2013-2020 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 Libev(AutotoolsPackage):
"""A full-featured and high-performance event loop that is loosel... | iulian787/spack | var/spack/repos/builtin/packages/libev/package.py | Python | lgpl-2.1 | 942 |
# -*- coding: utf-8 -*-
#
# Gramps documentation build configuration file, created by
# sphinx-quickstart on Sat Dec 1 14:38:29 2012.
#
# 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.
#
# All ... | pmghalvorsen/gramps_branch | data/man/pl/conf.py | Python | gpl-2.0 | 7,708 |
# ==============================================================================
# Copyright 2019 - Philip Paquette
#
# NOTICE: 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 rest... | diplomacy/research | diplomacy_research/models/policy/token_based/adapter.py | Python | mit | 43,003 |
# Copyright 2010 Arjan Scherpenisse <arjan@scherpenisse.net>
# See LICENSE for details.
__version__ = "0.4"
api_key = '5849a9d2bc2a2400c8b9f3a5f77fa68d'
api_secret = 'edc0a2b9af331d32'
| arjan/plemp | plemp/__init__.py | Python | mit | 187 |
from __future__ import (absolute_import, print_function, division)
import sys
import traceback
import six
from netlib import tcp
from netlib.exceptions import HttpException, HttpReadDisconnect, NetlibException
from netlib.http import http1, Headers
from netlib.http import CONTENT_MISSING
from netlib.tcp import Addres... | Endika/mitmproxy | libmproxy/protocol/http.py | Python | mit | 23,453 |
"""
Process the fits from input to output files.
Marina Wahl, 2014
"""
import numpy
def saving_output(array_from_files, pathoutput):
"""
Write the results from the fits in text files.
"""
for f in array_from_files:
fc1 = f[3][0][1]
w01 = f[3][0][0]
fc2 = f... | bt3gl/MFits-Astrophysical-Analyzer | mfits-4/src/processing.py | Python | apache-2.0 | 1,307 |
import subprocess
from thefuck.specific.apt import apt_available
from thefuck.specific.sudo import sudo_support
from thefuck.utils import for_app, eager, replace_command
enabled_by_default = apt_available
@sudo_support
@for_app('apt', 'apt-get', 'apt-cache')
def match(command):
return 'E: Invalid operation' in c... | SimenB/thefuck | thefuck/rules/apt_invalid_operation.py | Python | mit | 1,813 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from django.conf.urls import patterns, include, url
from views import *
urlpatterns = patterns('',
url(r'^$', leaderboard, name='leaderboard'),
url(r'^score/(?P<cron_key>[^/]+)/$', score, name='score'),
) | videntity/tweatwell | apps/leaderboard/urls.py | Python | gpl-2.0 | 271 |
'''
Implements the RTS Target backstore and storage object classes.
This file is part of RTSLib.
Copyright (c) 2011-2013 by Datera, Inc
Copyright (c) 2011-2014 by Red Hat, 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 obta... | mikenawrocki/rtslib-fb | rtslib/tcm.py | Python | apache-2.0 | 33,926 |
#!/usr/bin/env python
#
# test_doctests.py - test runner for COT doctests
#
# July 2016, Glenn F. Matthews
# Copyright (c) 2016-2017 the COT project developers.
# See the COPYRIGHT.txt file at the top-level directory of this distribution
# and at https://github.com/glennmatthews/cot/blob/master/COPYRIGHT.txt.
#
# This ... | glennmatthews/cot | COT/tests/test_doctests.py | Python | mit | 1,224 |
from __future__ import absolute_import, division, print_function
from bcam import loader
from bcam.calc_utils import rgb255_to_rgb1, transform_pt
from bcam.path import ELine, EArc, ECircle, EPoint, Path
from bcam.singleton import Singleton
from logging import debug, info, warning, error, critical
from bcam.util impor... | Tempel/bcam | bcam/loader_dxf.py | Python | gpl-3.0 | 6,528 |
"""
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 use this ... | arenadata/ambari | ambari-server/src/main/resources/stacks/ADH/1.5/services/TEZ/package/scripts/tez_client.py | Python | apache-2.0 | 3,757 |
import os
from setuptools import find_packages
from setuptools import setup
version = '0.1dev'
here = os.path.abspath(os.path.dirname(__file__))
try:
README = open(os.path.join(here, 'README.rst')).read()
CHANGES = ''
# CHANGES = open(os.path.join(here, 'CHANGES.txt')).read()
except IOError:
README = ... | DataFighter/Lasagne-tutorial | setup.py | Python | mit | 1,475 |
import os
from .settings import *
# NOTE: environment set by pg_virtualenv
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql_psycopg2',
'NAME': os.environ.get('PGDATABASE', 'autocomplete_light_test'),
'USER': os.environ.get('PGUSER', 'postgres'),
'PASSWORD': os.en... | Visgean/django-autocomplete-light | test_project/test_project/settings_postgres.py | Python | mit | 451 |
# coding: utf-8
# ETHERCUT SUITE
# Author: Ivan 'evilgroot' Luengo
# Email: evilgroot@gmail.com
# This project is released under a GPLv3 license
"""
Program context: handles global states and data
"""
import Queue
import logging
class Context:
"""
master : The master
opt : Program options
log ... | evilgroot/ethercut | ethercut/context.py | Python | gpl-3.0 | 1,272 |
from email.MIMEBase import MIMEBase
from django.core.mail.backends.base import BaseEmailBackend
from django.core.mail import EmailMultiAlternatives
from django.core.exceptions import ImproperlyConfigured
from google.appengine.api import mail as aeemail
from google.appengine.runtime import apiproxy_errors
def _send_... | luxnovalabs/enjigo_door | web_interface/djangoappengine/mail.py | Python | unlicense | 3,189 |
import quex.engine.utf8 as utf8
import quex.output.cpp.action_preparation as action_preparation
from quex.engine.interval_handling import NumberSet
from quex.engine.misc.file_in import error_msg
from quex.blackboard import setup as Setup
__line_counter_in_loop = """
__QUEX_IF... | coderjames/pascal | quex-0.63.1/quex/engine/generator/skipper/common.py | Python | bsd-2-clause | 3,878 |
"""Helps build config packages for installer-specific templates.
Takes in a bunch of configuration files, as well as functions to calculate the values/strings which
need to be put into the configuration.
Operates strictly:
- All parameters are strings. All things calculated / derived are strings.
- Every given pa... | dcos/dcos | gen/__init__.py | Python | apache-2.0 | 31,610 |
#!/usr/bin/env python
import sys
import argparse
import collections
import numpy as np
import tifffile as TIFF
import sane
import click
import toml
def quick_scan(settings = {}, test = False):
"""Make scan using first scanning device found by SANE driver.
"""
# init and find devices
sane.init()
... | pmagwene/unscanny | scanit.py | Python | gpl-3.0 | 1,722 |
# coding: utf-8
import random
from modder import on, get_storage, notify
import requests
def random_quin_nick():
'''Return random nickname of Mr.Quin'''
return random.choice((
u'秦川', u'秦先森', u'秦喵喵', u'秦智障', u'川川子', u'机核摸鱼王奎恩',
u'Quin', u'缺', u'缺哥哥', u'缺神', u'Q酱', u'二五仔',
))
def is_quin_... | JokerQyou/Modder2 | modder/mods/check_quin_livestream.py | Python | mit | 2,569 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2016, Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
... | romain-dartigues/ansible | lib/ansible/modules/database/postgresql/postgresql_schema.py | Python | gpl-3.0 | 9,622 |
import os
import platform
import sys
import struct
import subprocess
import codecs
import locale
import importlib
def get_sys_info():
"Returns system information as a dict"
blob = []
# get full commit hash
commit = None
if os.path.isdir(".git") and os.path.isdir("pandas"):
try:
... | pratapvardhan/pandas | pandas/util/_print_versions.py | Python | bsd-3-clause | 5,189 |
# -*- coding: utf-8 -*-
from django.conf import settings
from django.db import migrations, models
def fill_oauth2_slug(apps, schema_editor):
"""
Fill in the provider_slug to be the same as backend_name for backwards compatability.
"""
OAuth2ProviderConfig = apps.get_model('third_party_auth', 'OAuth2... | stvstnfrd/edx-platform | common/djangoapps/third_party_auth/migrations/0005_add_site_field.py | Python | agpl-3.0 | 2,833 |
import scrape
'''game = dict()
game = scrape.scrapeRoster("c:\\Users\\nicka\\dev\\moneypuck\\rawHtml\\rosters\\20072008_774.HTM",game)
game = scrape.scrapePlayByPlay("c:\\Users\\nicka\\dev\\moneypuck\\rawHtml\\playbyplay\\20072008_774.HTM",game)'''
from pymongo import MongoClient
def main():
client ... | shawger/pucklab | db/scraping/test.py | Python | gpl-3.0 | 675 |
# coding: utf-8
'''
if you are using multicore machine (and i can bet that you do) this script demonstrates how to use all
cores, please beware to set line 127 to a number which divides number of columns without reminder
(for ex. if you have x step equal to 0.5 you will have 10/0.5 = 20 columns hence you can use 2, 4,... | autumn-lake/Facebook-V-Predicting-Check-Ins | valeriu parallel knn.py | Python | mit | 5,865 |
'''
Created on Dec 2, 2017
@author: Taoheng
'''
class Target(object):
def execute(self,request):
print("Executing request: ",request)
class AuthenticationFilter(object):
def execute(self,request):
print("Authenticating request: ",request)
class DebugFilter(object):
def execute(self,requ... | hengfanz/franztao.Algorithm.io | pythonLearn/designPattern/interceptingFilter.py | Python | lgpl-2.1 | 1,676 |
"""
Django module for Course Metadata class -- manages advanced settings and related parameters
"""
import six
from crum import get_current_user
from django.conf import settings
from django.utils.translation import ugettext as _
from six import text_type
from xblock.fields import Scope
from cms.djangoapps.contentsto... | cpennington/edx-platform | cms/djangoapps/models/settings/course_metadata.py | Python | agpl-3.0 | 10,413 |
# -*- coding: utf-8 -*-
#
# Copyright © 2012 - 2016 Michal Čihař <michal@cihar.com>
#
# This file is part of Weblate <https://weblate.org/>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, eith... | dtschan/weblate | weblate/api/serializers.py | Python | gpl-3.0 | 8,730 |
import sys
from cli_client import APP_KEY, APP_SECRET, DropboxTerm
def main(path):
if APP_KEY == '' or APP_SECRET == '':
exit("You need to set your APP_KEY and APP_SECRET!")
term = DropboxTerm(APP_KEY, APP_SECRET)
if path != "":
term.do_cd(path)
term.do_ls()
if __name__ == '__main__':... | astrieanna/haiku-dropbox-client | db_ls.py | Python | mit | 476 |
__version__ = '0.1.2'
from .betfair import Betfair
| aa403/betfair.py | betfair/__init__.py | Python | mit | 52 |
"""Generators for classes of graphs used in studying social networks."""
import itertools
import math
import random
import networkx as nx
# Copyright(C) 2011 by
# Ben Edwards <bedwards@cs.unm.edu>
# Aric Hagberg <hagberg@lanl.gov>
# All rights reserved.
# BSD license.
__author__ = """\n""".join(['Ben Edw... | ltiao/networkx | networkx/generators/community.py | Python | bsd-3-clause | 11,961 |
import collections
from supriya.enums import CalculationRate
from supriya.ugens.UGen import UGen
class ScopeOut2(UGen):
"""
::
>>> scope_out_2 = supriya.ugens.ScopeOut2.ar(
... input_array=input_array,
... max_frames=4096,
... scope_frames=scope_frames,
..... | Pulgama/supriya | etc/pending_ugens/ScopeOut2.py | Python | mit | 5,124 |
from bot import Command, categories
class Fullwidth(Command):
__version__ = '1.0.0'
__author__ = 'makzk'
__description__ = 'Translate a set of allowed characters (below) to the fullwidth format.'
supported = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ!"#$%&()+,-./:;<=>?@[\\]^`{|}'... | jvicu2001/alexis-bot | modules/fullwidth.py | Python | mit | 993 |
from functools import singledispatch
@singledispatch
def to_description(ob):
return str(ob)
@to_description.register(type(None))
def none_to_description(_):
return '–'
@to_description.register(bool)
def bool_to_description(b):
return '✓' if b else ''
| dahlstrom-g/intellij-community | python/testData/inspections/PyUnresolvedReferencesInspection3K/usingFunctoolsSingledispatch.py | Python | apache-2.0 | 273 |
# #
# Copyright 2018-2020 Ghent University
#
# This file is part of EasyBuild,
# originally created by the HPC team of Ghent University (http://ugent.be/hpc/en),
# with support of Ghent University (http://ugent.be/hpc),
# the Flemish Supercomputer Centre (VSC) (https://www.vscentrum.be),
# Flemish Research Foundation (... | pescobar/easybuild-framework | test/framework/lib.py | Python | gpl-2.0 | 5,005 |
import json
import shapely
import shapely.wkt as wkt
import logging
import uuid
from tempfile import SpooledTemporaryFile
from string import Template
from datetime import datetime
from ckan import logic
from ckan.logic import NotFound, get_action
from ckan import model
from ckan.model import Session
from ckan import p... | geosolutions-it/ckanext-geonode | ckanext/geonode/harvesters/geonode.py | Python | gpl-2.0 | 21,226 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('users', '0017_auto_20160911_2126'),
]
operations = [
migrations.AlterUniqueTogether(
name='leaguerating',
... | rocket-league-replays/rocket-league-replays | rocket_league/apps/users/migrations/0018_auto_20160913_2030.py | Python | gpl-3.0 | 405 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.