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 os
import numpy as np
from pkg_resources import resource_filename
from digicampipe.io.event_stream import event_stream
from digicampipe.calib.trigger import fill_trigger_input_7, fill_trigger_patch,\
fill_digicam_baseline
example_file_path = resource_filename(
'digicampipe',
os.path.join(
'... | calispac/digicampipe | digicampipe/tests/test_trigger.py | Python | gpl-3.0 | 1,846 |
#
# Gramps - a GTK+/GNOME based genealogy program
#
# Copyright (C) 2002-2006 Donald N. Allingham
# Copyright (C) 2011 Tim G L Lyons
#
# 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... | Forage/Gramps | gramps/gen/filters/rules/family/_hassourceof.py | Python | gpl-2.0 | 1,812 |
#
# 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... | sebbASF/infrastructure-puppet | modules/aim_server/files/pages/__init__.py | Python | apache-2.0 | 1,524 |
#
# 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
# ... | redhat-openstack/heat | heat/tests/test_neutron_firewall.py | Python | apache-2.0 | 17,615 |
from __future__ import unicode_literals, division, absolute_import
from builtins import * # noqa pylint: disable=unused-import, redefined-builtin
import logging
from flexget import plugin
from flexget.event import event
from flexget.plugins.modify.torrent import TorrentFilename
from flexget.utils import bittorrent
l... | drwyrm/Flexget | flexget/plugins/modify/torrent_scrub.py | Python | mit | 4,010 |
from plotly.basedatatypes import BaseTraceHierarchyType as _BaseTraceHierarchyType
import copy as _copy
class Line(_BaseTraceHierarchyType):
# class properties
# --------------------
_parent_path_str = "scattergl"
_path_str = "scattergl.line"
_valid_props = {"color", "dash", "shape", "width"}
... | plotly/python-api | packages/python/plotly/plotly/graph_objs/scattergl/_line.py | Python | mit | 7,223 |
#!/usr/bin/python
import csv
import datetime
class Portfolio:
def __init__(self):
self.buy_trns = [] # List of all buy trans(date,stock,trn_type, qty, price)
self.sell_trns = [] # List of all sell trans(date,stock,trn_type, qty, price)
'''
Function to read the transactin file ... | pradeepbp/stocker2 | capgain.py | Python | gpl-3.0 | 2,113 |
# -*- coding: utf-8 -*-
'''
salt.utils.master
-----------------
Utilities that can only be used on a salt master.
'''
# Import python libs
from __future__ import absolute_import
import os
import logging
import multiprocessing
import signal
import tempfile
from threading import Thread, Event
# Import sal... | smallyear/linuxLearn | salt/salt/utils/master.py | Python | apache-2.0 | 27,724 |
"""
mbed SDK
Copyright (c) 2011-2013 ARM Limited
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 wr... | fpiot/mbed-ats | workspace_tools/export/gccarm.py | Python | apache-2.0 | 3,603 |
# -*- coding: utf-8 -*-
#
# Copyright (c) 2016 Intel Corp.
#
"""
Tests to test the interface for resource_control.
"""
import unittest
from ..resource_control import ResourceControl
class TestResourceControl(unittest.TestCase):
"""class to run the UT for the resource_control interface."""
def test_all_tests(s... | intel-ctrlsys/actsys | actsys/control/resource/tests/test_resource_control.py | Python | apache-2.0 | 610 |
# -*- 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... | googleapis/python-aiplatform | samples/generated_samples/aiplatform_generated_aiplatform_v1_featurestore_service_list_features_async.py | Python | apache-2.0 | 1,555 |
# -*- coding: utf-8 -*-
# Copyright (c) 2013 OpenStack Foundation
#
# 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 appl... | daasbank/swift | test/unit/common/middleware/test_slo.py | Python | apache-2.0 | 107,787 |
# coding: utf-8
"""
Kubernetes
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
OpenAPI spec version: v1.7.4
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from pprint import pformat
from six import iteritems
import re
... | djkonro/client-python | kubernetes/client/models/v1beta1_replica_set_status.py | Python | apache-2.0 | 8,340 |
#!/usr/bin/env python
#coding=utf-8
foo = 'abc'
def show():
print "foo from imptee:",foo
| licongyu95/learning_python | core_python_programming/cap12/imptee.py | Python | unlicense | 96 |
'''
Cyberlocker urlresolver plugin
Copyright (C) 2013 Vinnydude
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 i... | xmbcrios/xmbcrios.repository | script.module.urlresolver/lib/urlresolver/plugins/cyberlocker.py | Python | gpl-2.0 | 3,313 |
# coding=utf-8
"""QGIS Expressions which are available in the QGIS GUI interface."""
from qgis.core import (
qgsfunction,
QgsMapLayerRegistry,
QgsExpressionContextUtils,
)
import datetime
from safe.definitions.provenance import provenance_layer_analysis_impacted_id
from safe.utilities.i18n import tr
fro... | myarjunar/inasafe | safe/gis/generic_expressions.py | Python | gpl-3.0 | 7,673 |
#
# Copyright 2016 Quantopian, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wr... | humdings/zipline | zipline/data/data_portal.py | Python | apache-2.0 | 51,743 |
from pic18f45k50 import *
| sgnn7/sgfc | io_dev/sgfc_io/devices/pic18f45k50/__init__.py | Python | lgpl-2.1 | 26 |
# -*- coding: utf-8 -*-
import bpy
from bpy.types import Operator
from mmd_tools import register_wrap
from mmd_tools.bpyutils import SceneOp
from mmd_tools.core.bone import FnBone
from mmd_tools.translations import DictionaryEnum
import mmd_tools.core.model as mmd_model
@register_wrap
class MorphSliderSetup(Operato... | powroupi/blender_mmd_tools | mmd_tools/operators/model.py | Python | gpl-3.0 | 17,794 |
import importlib
import inspect
import pathlib
from .adapters import TerminalProvider
def _is_adapter(member) -> bool:
return (inspect.isclass(member)
and issubclass(member, TerminalProvider)
and member != TerminalProvider)
def _get_adapter_classes() -> [TerminalProvider]:
"""
T... | LazoCoder/Pokemon-Terminal | pokemonterminal/terminal/__init__.py | Python | gpl-3.0 | 1,053 |
"""
Copyright 2013-2016 Tuomas Jaakola
This file is part of TOE.
TOE 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.
TOE is distributed in... | iqqmuT/toe | export/mapnik/tileloader.py | Python | gpl-3.0 | 4,326 |
"""newsApi URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.8/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
Class-bas... | yinzishao/NewsScrapy | newsApi/api/urls.py | Python | lgpl-3.0 | 1,341 |
# Copyright (c) 2013 Intel, Inc.
# Copyright (c) 2012 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/li... | klmitch/nova | nova/tests/unit/pci/test_utils.py | Python | apache-2.0 | 10,569 |
import httplib
import json
def application(environ, start_response):
kml = environ['wsgi.input'].read()
api_dev_key = 'd0d28998a18c515e9706f159dbd348fa'
api_option = 'paste'
api_paste_code = kml
# Get the URL of the KML file from paste.kde.org.
request_data = {
'data': kml,
'l... | xordspar0/Data61-capstone-2016 | kmlFileGenerator.py | Python | gpl-3.0 | 1,069 |
import json
from hashlib import md5
from typing import Dict, List, Optional, Tuple
from zeus.config import redis
from zeus.constants import Permission
from zeus.exceptions import ApiError, ApiUnauthorized, IdentityNeedsUpgrade
from zeus.models import Identity, Repository, User
from zeus.utils.github import GitHubClie... | getsentry/zeus | zeus/vcs/providers/github.py | Python | apache-2.0 | 6,063 |
#!/usr/bin/python
"""Test to verify presentation of selectable list items."""
from macaroon.playback import *
import utils
sequence = MacroSequence()
sequence.append(KeyComboAction("<Control><Shift>n"))
sequence.append(KeyComboAction("Tab"))
sequence.append(utils.StartRecordingAction())
sequence.append(KeyComboAct... | pvagner/orca | test/keystrokes/oowriter/ui_role_list_item.py | Python | lgpl-2.1 | 1,384 |
import asyncio
import gc
import socket
import sys
import time
from unittest import mock
import psycopg2
import psycopg2.extensions
import psycopg2.extras
import pytest
import aiopg
from aiopg import DEFAULT_TIMEOUT, Connection, Cursor
PY_341 = sys.version_info >= (3, 4, 1)
@pytest.fixture
def connect(make_connecti... | aio-libs/aiopg | tests/test_connection.py | Python | bsd-2-clause | 16,350 |
class IndexedTextSearch:
"""
:param statement_comparison_function: A comparison class.
Defaults to ``LevenshteinDistance``.
:param search_page_size:
The maximum number of records to load into memory at a time when searching.
Defaults to 1000
"""
name = 'indexed_text_search'... | vkosuri/ChatterBot | chatterbot/search.py | Python | bsd-3-clause | 5,138 |
# -*- coding: utf-8 -*-
# Generated by Django 1.9.7 on 2016-10-13 22:04
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('councilmatic_core', '0019_auto_20161013_1702'),
]
operations = [
migrations.... | datamade/django-councilmatic | councilmatic_core/migrations/0020_auto_20161013_1704.py | Python | mit | 480 |
##############################################################################
# Copyright (c) 2013-2017, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
# This file is part of Spack.
# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
# LLNL-CODE-64... | TheTimmy/spack | var/spack/repos/builtin/packages/geos/package.py | Python | lgpl-2.1 | 3,067 |
# -*- coding: utf-8 -*-
# Define here the models for your scraped items
#
# See documentation in:
# http://doc.scrapy.org/en/latest/topics/items.html
import scrapy
class GjqyxyxxcxxtItem(scrapy.Item):
#base
UNISCID = scrapy.Field() #统一社会信用代码
ENTNAME = scrapy.Field() #名称 || 企业名称
ENTTYPE = scrapy.Field()... | AisinoPythonTeam/PythonAiniso | gjqyxyxxcxxt/gjqyxyxxcxxt/items.py | Python | apache-2.0 | 2,430 |
'''
Created on Sep 4, 2014
@author: sergio
'''
import neo.core
import numpy
import psycopg2
from .. import dbutils
from quantities import s
class SpikeDB(neo.core.Spike):
'''
'''
#TODO: Documentation of SpikeDB.
def __init__(self, id_unit = None, id_segment = None, id_recordingchannel = None,
... | sergiohr/NeoDB | neodb/core/spikedb.py | Python | gpl-3.0 | 8,447 |
from __future__ import unicode_literals
import frappe
import frappe.utils
import frappe.defaults
from frappe.utils import add_days, cint, cstr, date_diff, flt, getdate, nowdate, \
get_first_day, get_last_day, comma_and, split_emails
from frappe.model.naming import make_autoname
from frappe import _, msgprint, throw
... | susuchina/ERPNEXT | erpnext/controllers/recurring_document.py | Python | agpl-3.0 | 6,909 |
import shlex
import envi.archs.i386 as e_i386
def eflags(vdb, line):
'''
Shows or flips the status of the eflags register bits.
Usage: eflags [flag short name]
'''
trace = vdb.getTrace()
argv = shlex.split(line)
if len(argv) not in (0, 1):
return vdb.do_help('eflags')
if len(a... | imjonsnooow/vivisect | vdb/extensions/i386.py | Python | apache-2.0 | 1,800 |
# Copyright 1999-2009 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
import sys
from _emerge.SlotObject import SlotObject
from collections import deque
class SequentialTaskQueue(SlotObject):
__slots__ = ("max_jobs", "running_tasks") + \
("_dirty", "_scheduling", "_task_queue")... | Neuvoo/legacy-portage | pym/_emerge/SequentialTaskQueue.py | Python | gpl-2.0 | 2,131 |
#! /usr/bin/env python
"""Wrapper for the BioTaxIDMapper package."""
from os import sys
import argparse
from taxonomydb import TaxDb
from own_exceptions import NoRecord, NoProteinLink
usage = """Biological Taxonomies ID Mapper.
This simple tool allows to map NCBI taxonomy database information onto files
containing ... | mkorycinski/BioTaxIDMapper | mapper.py | Python | apache-2.0 | 4,168 |
# -*- coding: utf-8 -*-
# flake8: noqa
# Vendored copy from git://github.com/reallistic/rq-gevent-worker.git
# because there isn't a working release.
from __future__ import absolute_import, division, print_function, unicode_literals
from gevent import monkey
from gevent.hub import LoopExit
monkey.patch_all()
impor... | Dallinger/Dallinger | dallinger/heroku/rq_gevent_worker.py | Python | mit | 7,652 |
"""
FLI.focuser.py
Object-oriented interface for handling FLI (Finger Lakes Instrumentation) USB
focusers
author: Craig Wm. Versek, Yankee Environmental Systems
author_email: cwv@yesinc.com
"""
__author__ = 'Craig Wm. Versek'
__date__ = '2012-08-16'
from ctypes import byref, c_char, c_char_p, c_long... | cversek/python-FLI | src/FLI/focuser.py | Python | mit | 3,382 |
########
# Copyright (c) 2015 GigaSpaces Technologies 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... | codilime/cloudify-system-tests | cosmo_tester/test_suites/test_snapshots/snapshots_single_manager_helloworld_test.py | Python | apache-2.0 | 7,453 |
from skoolkittest import SkoolKitTestCase
from skoolkit.textutils import find_unquoted, split_unquoted, partition_unquoted, split_quoted
TEST_FIND = (
# args, kwargs, result
(('abc', 'b'), {}, 1),
(('abc', 'd'), {}, 3),
(('abc', 'd'), {'neg': True}, -1),
(('abc', 'c'), {'end': 1}, 1),
(('abc', ... | skoolkid/skoolkit | tests/test_textutils.py | Python | gpl-3.0 | 3,109 |
"""PyDbLite.py adapted for MySQL backend
Differences with PyDbLite:
- pass the connection to the MySQL db as argument to Base()
- in create(), field definitions must specify a type
- no index
- the Base() instance has a cursor attribute, so that SQL requests
can be executed :
db.cursor.execute(an_sql_req... | leleobhz/scripts | python/chat_back_machine/engine/PyDbLite/MySQL.py | Python | gpl-2.0 | 11,904 |
# py.test --cov=xcs C:\Users\Metron\Documents\GitHub\pyalcs\tests\lcs\agents\xncs
| ParrotPrediction/pyalcs | tests/lcs/agents/xcs/__init__.py | Python | mit | 82 |
# Protocol Buffers - Google's data interchange format
# Copyright 2008 Google Inc. All rights reserved.
# https://developers.google.com/protocol-buffers/
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redi... | google/mysql-protobuf | protobuf/python/google/protobuf/__init__.py | Python | gpl-2.0 | 1,768 |
#coding: utf-8
from __future__ import division, absolute_import, print_function, unicode_literals
from kasaya.conf import settings
from kasaya.core.protocol import messages
from kasaya.core import exceptions
#from kasaya.core.lib.binder import get_bind_address
from kasaya.core.protocol.comm import MessageLoop, send_and... | AYAtechnologies/Kasaya-esb | kasaya/workers/kasayad/syncworker.py | Python | bsd-2-clause | 14,173 |
"""
This is the toy example problem in the SNOPT documentation.
min x1
s.t . x1**2 + 4x2**2 <= 4
(x1-2)**2 + x2**2 <= 5
x1 >=0
We define the function F(x):
F(x) = [ x1 ]
[ x1**2 + 4x2**2 ]
[ (x1-2)**2 + x2**2 ]
with ObjRow = 1... | snopt/snopt-python | examples/sntoya.py | Python | mit | 3,256 |
# coding: utf-8
from __future__ import unicode_literals
import re
import json
from .common import InfoExtractor
from ..compat import (
compat_etree_fromstring,
compat_parse_qs,
compat_str,
compat_urllib_parse_urlparse,
compat_urlparse,
compat_xml_parse_error,
compat_HTTPError,
)
from ..uti... | Dunkas12/BeepBoopBot | lib/youtube_dl/extractor/brightcove.py | Python | gpl-3.0 | 28,139 |
# Copyright (c) 2012 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 ... | Stavitsky/nova | nova/tests/unit/compute/test_resource_tracker.py | Python | apache-2.0 | 61,929 |
from rllab.algos.trpo import TRPO
from rllab.baselines.linear_feature_baseline import LinearFeatureBaseline
#from rllab.envs.grid_world_env import GridWorldEnv
from envs.grid_world_2D_env import GridWorld2DEnv
from rllab.envs.normalized_env import normalize
from rllab.policies.categorical_mlp_policy import CategoricalM... | roboticslab-uc3m/xgnitive | programs/drl/grid_2D_world.py | Python | lgpl-2.1 | 1,063 |
from pulsar.utils.log import lazyproperty
from lux.models import fields
from lux.utils.data import as_tuple
from sqlalchemy.orm.exc import NoResultFound
def get_primary_keys(model):
"""Get primary key properties for a SQLAlchemy model.
:param model: SQLAlchemy model class
"""
mapper = model.__mappe... | quantmind/lux | lux/ext/odm/fields.py | Python | bsd-3-clause | 3,012 |
import Logger | samdmarshall/pyLoggingHelper | Logger/__init__.py | Python | bsd-3-clause | 13 |
# This is a distutils/py2exe script to build the Windows binary version
# of gambit-enumphc
from distutils.core import setup
import py2exe
setup(console=["enumphc.py"],
data_files=[(".",
[ "phc.exe", "README" ])])
| chumsley/gambit | contrib/scripts/enumpoly/setup.py | Python | gpl-2.0 | 241 |
"""
Module for declaration of common constants available throughout Open Civic Data code.
"""
import re
DIVISION_ID_REGEX = r'^ocd-division/country:[a-z]{2}(/[^\W\d]+:[\w.~-]+)*$'
JURISDICTION_ID_REGEX = r'^ocd-jurisdiction/country:[a-z]{2}(/[^\W\d]+:[\w.~-]+)*/\w+$'
# helper for making options-only lists
_keys = la... | influence-usa/python-opencivicdata-django | opencivicdata/common.py | Python | bsd-3-clause | 5,815 |
# -*- coding: utf-8 -*-
__all__ = ['bt', 'ps3', 'defs', 'ps3_remote', 'xbmcclient', 'zeroconf']
| French77/osmc | package/mediacenter-eventclients-common-osmc/files/usr/share/pyshared/xbmc/__init__.py | Python | gpl-2.0 | 96 |
r"""``sphobjinv`` *package execution module*.
``sphobjinv`` is a toolkit for manipulation and inspection of
Sphinx |objects.inv| files.
**Author**
Brian Skinn (bskinn@alum.mit.edu)
**File Created**
15 May 2020
**Copyright**
\(c) Brian Skinn 2016-2022
**Source Repository**
https://github.com/bskinn/... | bskinn/sphobjinv | src/sphobjinv/__main__.py | Python | mit | 701 |
"""
LTI Provider API endpoint urls.
"""
from django.conf import settings
from django.conf.urls import url
from lti_provider import views
urlpatterns = [
url(
r'^courses/{course_id}/{usage_id}$'.format(
course_id=settings.COURSE_ID_PATTERN,
usage_id=settings.USAGE_ID_PATTERN
... | CredoReference/edx-platform | lms/djangoapps/lti_provider/urls.py | Python | agpl-3.0 | 456 |
import bh_plugin
import re
import sublime
class BracketRemove(bh_plugin.BracketPluginCommand):
def decrease_indent_level(self, edit, row_first, row_last):
"""
Decrease indent level on removal
"""
tab_size = self.view.settings().get("tab_size", 4)
indents = re.compile(r"^(?... | herove/dotfiles | sublime/Packages/BracketHighlighter/bh_modules/bracketremove.py | Python | mit | 1,916 |
import glob
import os
from .. import *
@skip_if('java' not in test_features, 'skipping java tests')
@skip_if_backend('msbuild')
class TestJava(IntegrationTest):
def __init__(self, *args, **kwargs):
super().__init__(os.path.join('languages', 'java'), install=True,
*args, **kwargs)... | jimporter/bfg9000 | test/integration/languages/test_java.py | Python | bsd-3-clause | 2,704 |
class PackedBinary(object):
def __init__(self, i=0):
self.id = i
def __repr__(self):
return str(self.id)
def __getitem__(self, v):
b, m = v
return (self.id >> b) & m
def __setitem__(self, b, v):
b, m = b
self.id = (self.id & ~(m << b)) | ((v & m) << b)
... | lunixbochs/vaporbat | vaporbat/steam/ids.py | Python | mit | 1,035 |
###########################################################
# #
# This specific module is written by ASHWIN RAVISHANKAR.
# It includes some of the Hermit java classes
# #
###################################... | ashwingoldfish/eddy | eddy/reasoners/HermiT/HermiT.py | Python | gpl-3.0 | 2,173 |
#!/usr/bin/env python
#coding=utf-8
# Copyright (C) 2011, Alibaba Cloud Computing
#Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to ... | lufornpy/aliyun-cli | aliyuncli/ossadp/ossHandler.py | Python | apache-2.0 | 88,246 |
# ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2017, Numenta, Inc. Unless you have an agreement
# with Numenta, Inc., for a separate license for this software code, the
# following terms and conditions apply:
#
# This progra... | mrcslws/nupic.research | packages/columns/tests/apical_dependent_temporal_memory/adtm_sequence_memory_test.py | Python | agpl-3.0 | 6,293 |
# (c) 2014, Michael DeHaan <michael.dehaan@gmail.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 by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any lat... | s-hertel/ansible | lib/ansible/utils/display.py | Python | gpl-3.0 | 19,334 |
from os import environ
from uwsgiconf.presets.nice import Section, PythonSection
def test_nice_section(assert_lines):
assert_lines([
'env = LANG=en_US.UTF-8',
'workers = %k',
'die-on-term = true',
'vacuum = true',
'threads = 4',
], Section(threads=4))
assert_lin... | idlesign/uwsgiconf | tests/presets/test_nice.py | Python | bsd-3-clause | 4,893 |
# -*- coding: utf-8 -*-
from south.utils import datetime_utils as datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding field 'Notification.silent'
db.add_column(u'ios_notifications_no... | stephenmuss/django-ios-notifications | ios_notifications/south_migrations/0004_auto__add_field_notification_silent.py | Python | bsd-3-clause | 7,719 |
# -*- coding: utf-8 -*-
"""Count number of features in all building dataset"""
import codecs
import os
import sys
sys.path.insert(0, os.path.abspath('.'))
import catatom2osm
import download
import layer
import setup
from osmxml import etree
baseurl = "http://www.catastro.minhap.es/INSPIRE/Buildings/"
fh = codecs.open... | javiersanp/CatAtom2Osm | test/count_buildings.py | Python | bsd-2-clause | 1,594 |
# -*- coding: utf-8 -*-
##
## This file is part of Invenio.
## Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012 CERN.
##
## Invenio is free software; you can redistribute it and/or
## modify it under the terms of the GNU General Public License as
## published by the Free Software Foundation; either version 2 of t... | jmartinm/invenio | modules/websearch/lib/websearch_services_regression_tests.py | Python | gpl-2.0 | 15,343 |
# -*- coding: utf-8 -*-
#
# This file is part of INSPIRE.
# Copyright (C) 2014-2017 CERN.
#
# INSPIRE 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 ... | zzacharo/inspire-next | inspirehep/modules/fixtures/users.py | Python | gpl-3.0 | 4,337 |
# 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... | rabipanda/tensorflow | tensorflow/python/debug/examples/debug_tflearn_iris.py | Python | apache-2.0 | 7,267 |
#! /usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import print_function, division
from otdistfunc import wrapper_data
import os
print('== test WrapperDataCoreIn')
# write
wd = wrapper_data.WrapperDataCoreIn()
wd.point = [1, 2]
wd.write()
# read
wd_r = wrapper_data.WrapperDataCoreIn()
wd_r.read()
print(... | openturns/otdistfunc | python/test/t_wrapper_data.py | Python | lgpl-3.0 | 2,706 |
import re
from livestreamer.plugin import Plugin
from livestreamer.plugin.api import http, validate
from livestreamer.plugin.api.utils import parse_query
from livestreamer.stream import RTMPStream
BALANCER_URL = "http://www.mips.tv:1935/loadbalancer"
PLAYER_URL = "http://mips.tv/embedplayer/{0}/1/500/400"
SWF_URL = "... | Masaz-/livestreamer | src/livestreamer/plugins/mips.py | Python | bsd-2-clause | 1,840 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('servo', '0022_auto_20150612_0803'),
]
operations = [
migrations.AlterField(
model_name='device',
nam... | filipp/Servo | servo/migrations/0023_auto_20150612_0822.py | Python | bsd-2-clause | 1,255 |
# Django settings for example project.
DEBUG = True
TEMPLATE_DEBUG = DEBUG
ADMINS = (
# ('Your Name', 'your_email@example.com'),
)
MANAGERS = ADMINS
# Hosts/domain names that are valid for this site; required if DEBUG is False
# See https://docs.djangoproject.com/en/1.5/ref/settings/#allowed-hosts
ALLOWED_HOSTS... | Charnelx/django-split-settings | tests/settings/components/base.py | Python | bsd-3-clause | 610 |
import tests.exog.test_random_exogenous as testrandexog
testrandexog.test_random_exogenous( 8,160); | antoinecarme/pyaf | tests/exog/random/random_exog_8_160.py | Python | bsd-3-clause | 101 |
"""Example using Sigopt's multi-objective functionality."""
import sys
import time
import numpy as np
from ray import tune
from ray.tune.suggest.sigopt import SigOptSearch
np.random.seed(0)
vector1 = np.random.normal(0, 0.1, 100)
vector2 = np.random.normal(0, 0.1, 100)
def evaluate(w1, w2):
total = w1 * vector1... | ray-project/ray | python/ray/tune/examples/sigopt_multi_objective_example.py | Python | apache-2.0 | 1,895 |
# -- encoding: utf-8 --
from __future__ import with_statement
from stackspy.utils import url_replace
def detect_robots(context):
robots = context.get_url(url_replace(context.base_url, path="/robots.txt"))
if robots.exists:
robots.add_result("Robots.txt", "Robots.txt exists")
def detect_humans(context):
humans =... | akx/stackspy | stackspy/detectors/misc.py | Python | mit | 738 |
import pandas as pd
df1 = pd.DataFrame({'A': ['A0', 'A1', 'A2', 'A3'],
'B': ['B0', 'B1', 'B2', 'B3'],
'C': ['C0', 'C1', 'C2', 'C3'],
'D': ['D0', 'D1', 'D2', 'D3']},
index=[0, 1, 2, 3])
df2 = pd.DataFrame({'A': ['A4', 'A5', 'A6', 'A7']... | davidam/python-examples | pandas/pandas-concat.py | Python | gpl-3.0 | 2,930 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# longer_weather.py - Collect GIFs, split into frames, collect frames, then
# merge them together to create one long animation.
# Originally used to create long weather radar animations
# but may work with other ... | kizniche/longer-weather | longer_weather.py | Python | gpl-3.0 | 10,250 |
#
# The Python Imaging Library.
# $Id$
#
# SGI image file handling
#
# See "The SGI Image File Format (Draft version 0.97)", Paul Haeberli.
# <ftp://ftp.sgi.com/graphics/SGIIMAGESPEC>
#
# History:
# 1995-09-10 fl Created
#
# Copyright (c) 2008 by Karsten Hiddemann.
# Copyright (c) 1997 by Secret Labs AB.
# Copyright ... | zhaochl/python-utils | verify_code/Imaging-1.1.7/build/lib.linux-x86_64-2.7/SgiImagePlugin.py | Python | apache-2.0 | 2,168 |
import pkg_resources
from .vggish_params import *
MODEL_PARAMS = pkg_resources.resource_filename(
__name__, '.model/vggish_model.cpkt')
PCA_PARAMS = pkg_resources.resource_filename(
__name__, '.model/vggish_pca_params.npz')
| cosmir/dev-set-builder | audioset/__init__.py | Python | mit | 235 |
from django.db import models
class Empresa(models.Model):
nombre = models.CharField(max_length=100)
ciudad = models.CharField(max_length=50)
sector = models.CharField(max_length=200)
def __str__(self):
return self.nombre
class Calificacion(models.Model):
alumno = models.CharField(max_length=100)
calificacion ... | JesGor/test_rest | apprest/models.py | Python | gpl-2.0 | 432 |
import os
def get_files_list(path_dir):
return os.listdir(path_dir)
def absolute_path_file(path_file):
return os.path.abspath(path_file)
def extract_file_from_path_file(path_file):
path, file = os.path.split(path_file)
return file
def extract_path_from_file(file):
path_file = os.path.abspath... | paulinus/OpenDroneMap | opendm/io.py | Python | gpl-3.0 | 600 |
#coding=utf-8
'''
Created on 2015-4-3
@author: Devuser
'''
from gateside.autotesting.settings import GlobalConfig
from gateside.autotesting.Gat.manager.istepparametermanager import IStepParameterManager
from gateside.autotesting.Gat.util.stepvaluepool import StepValuePool
class TestStep(object):
'''
测试Stepme... | skyzhang2006/PyGAT | PyGAT/gateside/autotesting/iat_stepgroups/teststep.py | Python | gpl-2.0 | 884 |
import numpy as np
class Mesh(object):
"""
Mesh design and storage. Currently the left edge is fixed at 0.0
"""
def __init__(self, delta_x=(0.1 * np.ones(10))):
"""
Sum the spacings to get cell centers,
but the cell center is at the halfway point, so we have to
subtra... | tbenthompson/rupturotops | source/core/mesh.py | Python | lgpl-3.0 | 1,954 |
from __future__ import unicode_literals, division, absolute_import
from builtins import * # pylint: disable=unused-import, redefined-builtin
from future.moves.urllib.parse import quote
import logging
import feedparser
from requests import RequestException
from flexget import plugin
from flexget.entry import Entry
f... | qvazzler/Flexget | flexget/plugins/search/kat.py | Python | mit | 3,694 |
# -*- coding: utf-8 -*-
#
import codecs
import datetime
import os
import abstractRenderer
import books
#
# Simplest renderer. Ignores everything except ascii text.
#
STANDARD_SUFFIX = '.html'
class Renderer(abstractRenderer.AbstractRenderer):
def __init__(self, inputDir, outputDir, outputName, config):
... | openenglishbible/USFM-Tools | transform/support/singlehtmlRenderer.py | Python | mit | 6,765 |
from edc_sync.site_sync_models import site_sync_models
site_sync_models.register_for_app('edc_identifier')
| botswana-harvard/edc-identifier | edc_identifier/sync_models.py | Python | gpl-2.0 | 108 |
# Copyright 2008-2015 Nokia Solutions and Networks
#
# 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 l... | caio2k/RIDE | src/robotide/application/__init__.py | Python | apache-2.0 | 646 |
"""
The points P (x1, y1) and Q (x2, y2) are plotted at integer co-ordinates and are joined to the origin, O(0,0), to form triange OPQ.
There are exactly fourteen triangles containing a right angle that can be formed when each co-ordinate lies between 0 and 2 inclusive; that is,
0 x1, y1, x2, y2 2.
Given that 0 ... | peterstace/project-euler | OLD_PY_CODE/project_euler_old_old/91/91.py | Python | unlicense | 755 |
#from eden.converter.fasta import fasta_to_sequence
from eden_rna.io.fasta import load
import itertools
def rfam_uri(family_id):
return 'http://rfam.xfam.org/family/%s/alignment?acc=%s&format=fastau&download=0'%(family_id,family_id)
def rfam_uri(family_id):
return '%s.fa'%(family_id)
def get_sequences(size=... | fabriziocosta/GraphLearn_examples | notebooks/Abstract/forgi_revival.py | Python | gpl-2.0 | 1,781 |
# -*- coding: utf-8 -*-
'''\
autoremove command
'''
#*****************************************************************************
# Copyright (C) 2009 Giuseppe Ottaviano <giuott@gmail.com>
#
# Distributed under the terms of the GPL License. The full license is in
# the file COPYING, distributed as part of thi... | ot/bpt | bpt/ui/commands/autoremove.py | Python | gpl-2.0 | 2,003 |
# 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, json
from frappe import _
from frappe.utils import cint, formatdate
@frappe.whitelist(allow_guest=True)
def send_message(subject="Websi... | hassanibi/erpnext | erpnext/templates/utils.py | Python | gpl-3.0 | 1,754 |
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'test.ui'
#
# Created by: PyQt4 UI code generator 4.10.3
#
# WARNING! All changes made in this file will be lost!
from PyQt4 import QtCore, QtGui
try:
_fromUtf8 = QtCore.QString.fromUtf8
except AttributeError:
def _fromUtf8(s):
... | patta42/pySICM | pySICMgui/test.py | Python | gpl-3.0 | 2,073 |
# Copyright (c) 2012 NetApp, Inc. All rights reserved.
# Copyright (c) 2014 Ben Swartzlander. All rights reserved.
# Copyright (c) 2014 Navneet Singh. All rights reserved.
# Copyright (c) 2014 Clinton Knight. All rights reserved.
# Copyright (c) 2014 Alex Meade. All rights reserved.
# Copyright (c) 2014 Andrew Ker... | openstack/cinder | cinder/volume/drivers/netapp/dataontap/block_cmode.py | Python | apache-2.0 | 42,861 |
""":mod:`libearth.tz` --- Basic timezone implementations
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Almost of this module is from the official documentation of
:mod:`datetime` module in Python standard library.
.. data:: utc
(:class:`Utc`, :class:`datetime.timezone`) The :class:`~datetime.tzinfo`
... | 0hoo/libearth | libearth/tz.py | Python | gpl-2.0 | 2,576 |
import unittest
from os.path import join
from unittest import mock
from tests.recipes.recipe_lib_test import RecipeCtx
class TestPandasRecipe(RecipeCtx, unittest.TestCase):
"""
TestCase for recipe :mod:`~pythonforandroid.recipes.pandas`
"""
recipe_name = "pandas"
@mock.patch("pythonforandroid.r... | germn/python-for-android | tests/recipes/test_pandas.py | Python | mit | 1,651 |
import json
from google.appengine.ext import ndb
from datastore.models import WebResource, Indexer
from handlers.basehandler import JSONBaseHandler
__author__ = 'Lorenzo'
class ArticlesJSONv1(JSONBaseHandler):
"""
Articles JSON API Handlers.
Extended from JSONBaseHandler.
See http://hypermedia.pr... | SpaceAppsXploration/rdfendpoints | handlers/articlesjsonapi.py | Python | apache-2.0 | 8,493 |
import ltask,json
from ltask import pset
class Task(ltask.Task):
#def __init__(self,params):
#super(ltask.Task,self).__init__(self,params)
def transform_params(self,p): #called in ltask.Task processed_params
return p
def out_dir(self):
return './examples/out/'
def kill(self)... | redsh/Tasks-In-A-Bottle | examples/dummy.py | Python | mit | 641 |
"""
gstation-edit GrpParameter definition
"""
# this file is part of gstation-edit
# Copyright (C) F LAIGNEL 2009-2017 <fengalin@free.fr>
#
# gstation-edit 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... | fengalin/gstation-edit | gstation_edit/ui_core/grp_parameter.py | Python | lgpl-3.0 | 2,162 |
# -*- 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... | jcoady9/beets | test/test_dbcore.py | Python | mit | 20,402 |
# Generated by Django 2.2.5 on 2019-09-26 12:18
from django.db import migrations, models
import weblate.utils.backup
class Migration(migrations.Migration):
dependencies = [("wladmin", "0005_auto_20190926_1332")]
operations = [
migrations.AddField(
model_name="backupservice",
... | dontnod/weblate | weblate/wladmin/migrations/0006_auto_20190926_1218.py | Python | gpl-3.0 | 1,322 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.