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 |
|---|---|---|---|---|---|
#!/usr/bin/env python
# coding: utf-8
"""
Copyright 2015 SYSTRAN Software, 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/licen... | SYSTRAN/resources-api-python-client | systran_resources_api/models/entry_add_response.py | Python | apache-2.0 | 1,639 |
# -*- coding: utf-8 -*-
import base64
import os
import unittest
import uuid
from datetime import (
datetime,
timedelta,
)
try:
from unittest import mock
except ImportError:
import mock
import jwt.jwk
import jwt.jwt
from oidc.interfaces import (
ClientType,
IAccessToken,
IAuthorizationCode... | GehirnInc/python-oidc | oidc/tests/__init__.py | Python | mit | 5,719 |
#!/usr/bin/python
# (c) 2018, NetApp, Inc
# 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',
'status': ['preview'],
... | hryamzik/ansible | lib/ansible/modules/storage/netapp/na_ontap_cluster_ha.py | Python | gpl-3.0 | 3,500 |
# -*- encoding: utf-8
from suplemon.suplemon_module import Module
class Strip(Module):
"""Strips whitespace from start and end of line."""
def run(self, app, editor, args):
line_nums = editor.get_lines_with_cursors()
for n in line_nums:
line = editor.lines[n]
line.set_... | twolfson/suplemon | suplemon/modules/strip.py | Python | mit | 400 |
# -*- coding: utf-8 -*-
# Copyright (c) 2016 Aladom SAS & Hosting Dvpt SAS
from .base import * # noqa
| Aladom/django-mailing | mailing/models/__init__.py | Python | mit | 103 |
# -*- coding: utf-8 -*-
# Copyright 2015-2016 Agile Business Group (<http://www.agilebg.com>)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from datetime import datetime, timedelta
from openerp.tests.common import TransactionCase
from openerp.tools import DEFAULT_SERVER_DATE_FORMAT
from openerp.... | akretion/stock-logistics-workflow | stock_move_backdating/tests/test_stock_move_backdating.py | Python | agpl-3.0 | 4,875 |
from __future__ import print_function, absolute_import, division
import inspect
from .path import path
import imp
import sys
import re
from .debug import log_error
bad_chars = re.compile(u'\W')
sys_modules = "*.so"
if sys.platform == 'win32' or sys.platform == 'cygwin':
sys_modules = "*.dll"
elif sys.platform == ... | PierreBdR/point_tracker | point_tracker/loader.py | Python | gpl-2.0 | 1,878 |
from django.apps import AppConfig
class DjangoHistoryAppConfig(AppConfig):
name = 'djangohistory'
def ready(self):
from djangohistory import signals
| futurice/django-history | djangohistory/apps.py | Python | bsd-3-clause | 168 |
"""
.. _tut_evoked_objects:
The :class:`Evoked <mne.Evoked>` data structure: evoked/averaged data
=====================================================================
"""
import os.path as op
import mne
###############################################################################
# The :class:`Evoked <mne.Evoked>... | jaeilepp/mne-python | tutorials/plot_object_evoked.py | Python | bsd-3-clause | 3,477 |
cats = [{'desc': 'chubby', 'name': 'Zophie'}, {'desc': 'fluffy', 'name': 'Pooka'}]
| rfreiberger/Automate-the-Boring-Stuff | ch8/myCats.py | Python | bsd-2-clause | 83 |
from django.contrib.auth.decorators import login_required
from django.http import Http404
from edxmako.shortcuts import render_to_response
from courseware.courses import get_course_with_access
from notes.models import Note
from notes.utils import notes_enabled_for_course
@login_required
def notes(request, course_id):... | apigee/edx-platform | lms/djangoapps/notes/views.py | Python | agpl-3.0 | 726 |
from mrcrowbar import models as mrc
from mrcrowbar.lib.images import base as img
from mrcrowbar.utils import from_uint32_be as Tag, to_uint32_be as TagB
class RIFF( mrc.Block ):
CHUNK_MAP = {}
magic = mrc.Const( mrc.Bytes( 0x00, length=4 ), b"RIFF" )
size = mrc.UInt32_LE( 0x04 )
form_type = mrc.Bytes... | moralrecordings/mrcrowbar | mrcrowbar/lib/containers/riff.py | Python | bsd-3-clause | 2,231 |
# TestSubmoduleImport.py
#
# This source file is part of the Swift.org open source project
#
# Copyright (c) 2014 - 2016 Apple Inc. and the Swift project authors
# Licensed under Apache License v2.0 with Runtime Library Exception
#
# See https://swift.org/LICENSE.txt for license information
# See https://swift.org/CONT... | apple/swift-lldb | packages/Python/lldbsuite/test/lang/swift/expression/submodule_import/TestSubmoduleImport.py | Python | apache-2.0 | 2,483 |
# -*- coding: utf-8 -*-
"""Unit tests for helpers."""
from __future__ import unicode_literals
import unittest
import mock
import pywikibot
from wikidatastuff.helpers import (
bundle_values,
convert_language_dict_to_json,
fill_cache_wdqs,
get_unit_q,
is_number,
is_int,
is_pos_int,
iso... | lokal-profil/wikidata-stuff | tests/test_helpers.py | Python | mit | 15,085 |
#!/usr/bin/env python
#
# MongoUtils.py
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
# published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY... | pdelsante/thug | utils/MongoUtils.py | Python | gpl-2.0 | 4,991 |
__author__ = 'saintdragon2'
def square_of_list(some_list, num):
if num < len(some_list):
return some_list[num] ** num
return 0
def gap(some_list):
for v in some_list:
# if isinstance(v, str):
if type(v) is str:
return '문자열이 있습니다'
return max(some_list) - min(some_... | saintdragon2/python-3-lecture-2015 | homework_checker/zest_pow_gap_hw/hw_sungyong_list.py | Python | mit | 849 |
# Copyright 2015 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 agreed to in writing, s... | googleapis/python-dns | tests/unit/test_changes.py | Python | apache-2.0 | 12,894 |
#!/usr/bin/env python
from __future__ import print_function
import shutil
import unittest
import glob
import random
from ruffus import follows, split, mkdir, files, transform, suffix, posttask, touch_file, merge, Pipeline
import sys
import os
NUMBER_OF_RANDOMS = 10000
CHUNK_SIZE = 1000
tempdir = os.path.relpath(os... | bunbun/ruffus | ruffus/test/test_tutorial7.py | Python | mit | 5,862 |
"""This module is used to generate atomic orbital basis sets."""
import os
import sys
from StringIO import StringIO
import numpy as np
from numpy.linalg import solve
from ase.units import Hartree
from gpaw.spline import Spline
from gpaw.atom.all_electron import AllElectron, ConvergenceError
from gpaw.atom.generator ... | ajylee/gpaw-rtxs | gpaw/atom/basis.py | Python | gpl-3.0 | 26,542 |
# -*- coding: utf-8 -*-
# © 2017 Akretion (http://www.akretion.com)
# @author Mourad EL HADJ MIMOUNE <mourad.elhadj.mimoune@akretion.com>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
{
"name": "Purchase Free-Of-Paiment shipping",
'version': '10.0.1.0.0',
'author': "Akretion,Odoo C... | Eficent/purchase-workflow | purchase_fop_shipping/__manifest__.py | Python | agpl-3.0 | 627 |
# -*- coding: utf-8 -*-
#Created on Mon Jun 27 14:52:35 2016
#@author:pierreucla
import numpy as np
def deconvolve(sig1, sig2, Fe) :
n=len(sig2);
K = 2**(n).bit_length()
fft1 = np.fft.fft(sig1,K)
fft2 = np.fft.fft(sig2,K)
#borneinf = int(20*K/Fe) + 2;
#bornesup = int(20000*K/Fe);
... | deribaucourt/PAF-station-audio | Server/signalProcessing.py | Python | gpl-3.0 | 512 |
###############################################################################
# lazyflow: data flow based lazy parallel computation framework
#
# Copyright (C) 2011-2014, the ilastik developers
# <team@ilastik.org>
#
# This program is free software; you can redistribute it and/o... | nielsbuwen/ilastik | tests/nanshe/testOpConvertType.py | Python | gpl-3.0 | 3,060 |
import pandas as pd
import json
import warnings
warnings.warn('\n\n\n**** data.table will be deprecated in the next py2cytoscape release. ****\n\n\n')
class Table(object):
"""The Table object provides methods for Cytoscape table manipulation"""
def __init__(self):
self.df = None
self.port = No... | idekerlab/py2cytoscape | py2cytoscape/data/table.py | Python | mit | 748 |
"""
Contains information relevant to Instrument object
Classes and Functions
---------------------
"""
import operator
import unidecode
from nordb.core.validationTools import validateFloat
from nordb.core.validationTools import validateInteger
from nordb.core.validationTools import validateString
from nordb.core.val... | MrCubanfrog/NorDB | nordb/nordic/instrument.py | Python | mit | 10,723 |
"""
Tests for extract_api module.
"""
from os import path
import unittest
import logging
import json
from api_etl.settings import __BASE_DIR__
from api_etl.extract_api import xml_to_json_item_list
logger = logging.getLogger(__name__)
class TestExtractModuleFunctions(unittest.TestCase):
def test_xml_to_json_it... | leonardbinet/Transilien-Api-ETL | tests/test_extract_api.py | Python | mit | 1,890 |
#
# Gramps - a GTK+/GNOME based genealogy program
#
# Copyright (C) 2000-2007 Donald N. Allingham
# 2009 Gary Burton
# 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 ... | Forage/Gramps | gramps/gui/editors/editpersonref.py | Python | gpl-2.0 | 6,336 |
from __future__ import unicode_literals
from mezzanine import template
from mezzanine.conf import settings
from textwrap import wrap
from . import strip_all_white_space
register = template.Library()
@register.simple_tag(takes_context=True)
def text_node_for(context, text):
"""Outputs the text node with the forloop.c... | mush42/mezzanine-live-tile | mezzanine_live_tile/templatetags/tile_tags.py | Python | mit | 1,206 |
# Copyright (c) 2014 Yubico AB
# All rights reserved.
#
# 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... | Yubico/yubikey-piv-manager-dpkg | pivman/view/cert.py | Python | gpl-3.0 | 13,328 |
# -*- coding: utf-8 -*-
#------------------------------------------------------------
# pelisalacarta - XBMC Plugin
# Conector para vodlocker
# http://blog.tvalacarta.info/plugin-xbmc/pelisalacarta/
#------------------------------------------------------------
import urlparse,urllib2,urllib,re
import os
from core imp... | Zanzibar82/streamondemand.test | servers/vodlocker.py | Python | gpl-3.0 | 2,539 |
"""Test the Neato Botvac config flow."""
from unittest.mock import patch
from pybotvac.neato import Neato
from homeassistant import config_entries, data_entry_flow, setup
from homeassistant.components.neato.const import NEATO_DOMAIN
from homeassistant.core import HomeAssistant
from homeassistant.helpers import config... | jawilson/home-assistant | tests/components/neato/test_config_flow.py | Python | apache-2.0 | 5,011 |
#
# This file is part of Healpy.
#
# Healpy is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# Healpy is distributed in the h... | eirikgje/healpy | healpy/projaxes.py | Python | gpl-2.0 | 39,355 |
# 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 Collier(CMakePackage):
"""COLLIER: A Complex One-Loop LIbrary with Extended Regularization... | iulian787/spack | var/spack/repos/builtin/packages/collier/package.py | Python | lgpl-2.1 | 1,409 |
'''
common XBMC Module
Copyright (C) 2011 t0mm0
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.
Th... | bigoldboy/repository.bigoldboy | plugin.video.VADER/lib/urlresolver/lib/net.py | Python | gpl-3.0 | 12,303 |
# -*- coding: cp1252 -*-
from scipy.stats.stats import pearsonr
from nltk.stem.porter import *
from nltk.corpus import wordnet as wn
from nltk.corpus import wordnet_ic as wordnet_ic
import math
brown_ic = wordnet_ic.ic('ic-brown.dat')
semcor_ic = wordnet_ic.ic('ic-semcor.dat')
stemmer = PorterStemmer()
... | lin99/NLPTM-2016 | 1.Docs/lexsim_ci2016 _Jun16.py | Python | mit | 10,300 |
#!/usr/bin/env python
# Jonas Schnelli, 2013
# make sure the groincoin-Qt.app contains the right plist (including the right version)
# fix made because of serval bugs in Qt mac deployment (https://bugreports.qt-project.org/browse/QTBUG-21267)
from string import Template
from datetime import date
bitcoinDir = "./";
i... | classicsxdx/groincoin | share/qt/clean_mac_info_plist.py | Python | mit | 899 |
import googleAPI
import pronouncing
from random import randint
from time import time
from threading import Thread
def addTree(url, strings, index):
tree = handle.getTree(link)
if tree is not None:
strings[index] = tree.xpath("//p/text()")
else:
strings[index] = []
def addCandidates(strings... | WillPiledriver/rapgod | rapgod.py | Python | mit | 5,354 |
#!/usr/bin/env python
# -*- encoding: utf-8 -*-
"""
Sequential modeling
===================
Sequence alignment
------------------
.. autosummary::
:toctree: generated/
dtw
rqa
Viterbi decoding
----------------
.. autosummary::
:toctree: generated/
viterbi
viterbi_discriminative
viterbi_b... | bmcfee/librosa | librosa/sequence.py | Python | isc | 58,343 |
# -*- coding: utf-8 -*-
###############################################################################
#
# (DC)² - DataCenter Deployment Control
# Copyright (C) 2010, 2011, 2012, 2013, 2014 Stephan Adig <sh@sourcecode.de>
# This program is free software; you can redistribute it and/or modify
# it under th... | sadig/DC2 | components/dc2-api/dc2/api/dc2/inventory/hosts.py | Python | gpl-2.0 | 2,449 |
from __future__ import unicode_literals
from django.apps import AppConfig
class ArtcastingConfig(AppConfig):
name = 'artcasting'
| i-DAT-Qualia/Qualia-AC | qualia/artcasting/apps.py | Python | gpl-3.0 | 136 |
# -*- coding: utf-8 -*-
# ProjectEuler/src/python/problem039.py
#
# Integer right triangles
# =======================
# Published on Friday, 14th March 2003, 06:00 pm
#
# If p is the perimeter of a right angle triangle with integral length sides,
# {a,b,c}, there are exactly three solutions for p = 120. {20,48,52},
# ... | olduvaihand/ProjectEuler | src/python/problem039.py | Python | mit | 501 |
#!/usr/bin/env python
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright (c) 2012, AT&T Labs, Yun Mao <yunmao@gmail.com>
# 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... | dmitryilyin/mistral | tools/lintstack.py | Python | apache-2.0 | 6,430 |
"""Test acme_account_deactivate script with real ACME server"""
import unittest
import os
import configparser
import acme_dns_tiny
from tests.config_factory import generate_acme_account_deactivate_config
import tools.acme_account_deactivate
ACME_DIRECTORY = os.getenv("GITLABCI_ACMEDIRECTORY_V2",
... | Trim/acme-dns-tiny | tests/staging_test_acme_account_deactivate.py | Python | mit | 2,131 |
from django.shortcuts import render,get_object_or_404, redirect
from django.views.generic.detail import DetailView
from django.views.generic.list import ListView
from django.http import Http404
from django.db.models import Q
from .forms import VariationInventoryFormSet
from django.contrib import messages
from .mixins i... | abhijitbangera/ecommerce | src/products/views.py | Python | mit | 3,497 |
# Generated by Django 2.1.4 on 2019-01-02 18:56
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('notes', '0001_initial'),
]
operations = [
migrations.AlterField(
model_name='note',
... | asommer70/strangway | notes/migrations/0002_auto_20190102_1856.py | Python | mit | 465 |
from django.conf import settings
from django.contrib.auth.models import User
from django.contrib.contenttypes.fields import GenericForeignKey
from django.contrib.contenttypes.models import ContentType
from django.core.exceptions import ObjectDoesNotExist
from django.db import models
from django.utils import timezone
fr... | renoc/django-experience | experiences/models.py | Python | isc | 2,701 |
from configobj import ConfigObj, Section
from os import path
from sys import stderr
class BaseError(Exception):
'''Base class for local exceptions.'''
class InternalError(BaseError):
'''
Raised only if the code is broken
Should never ever be the case in a production environment.
'''
class Intern... | nima/insecurity | pylib/ConfigFileManager.py | Python | gpl-2.0 | 4,087 |
# -*- coding: utf-8 -*-
import json
import uuid
from eve.io.base import DataLayer
from eve.utils import config, debug_error_message, str_to_date
from flask import abort
from flask.ext import neo4j
from py2neo import NodeSelector, Relationship
from eve_neo4j.structures import Neo4jResultCollection
from eve_neo4j.utils... | Grupo-Abraxas/eve-neo4j | eve_neo4j/neo4j.py | Python | mit | 9,552 |
"""Modern art."""
from galry import *
import numpy.random as rdn
figure(constrain_ratio=True, antialiasing=True)
# random positions
positions = .25 * rdn.randn(1000, 2)
# random colors
colors = rdn.rand(len(positions),4)
# TRIANGLES: three consecutive points = one triangle, no overlap
plot(primitive_type='TRIANGLES... | rossant/galry | examples/modern_art.py | Python | bsd-3-clause | 365 |
# -*- coding: utf-8 -*-
# <nbformat>3.0</nbformat>
# <markdowncell>
# Outline of Notebook Elements:
# * Theme Title
# * Questions
# * DISCOVERY Process (code and narrative)
# * ACCESS Process (code and narrative)
# * USE Process (code and narrative)
# * Results and Conclusions (narrative)
# <headingcell level=... | rsignell-usgs/notebook | system-test/Theme_3_Species_Protection_and_Marine_Habitat_Conservation/Scenario_3A_Assessing_Seabird_Vulnerability_in_the_Bering_Sea/Scenario_3A_Important_Bird_Area_Polygon_Analysis/hannahscontribution.py | Python | mit | 9,533 |
from wal_e.blobstore.s3.s3_credentials import Credentials
from wal_e.blobstore.s3.s3_credentials import InstanceProfileCredentials
from wal_e.blobstore.s3.s3_util import do_lzop_get
from wal_e.blobstore.s3.s3_util import uri_get_file
from wal_e.blobstore.s3.s3_util import uri_put_file
from wal_e.blobstore.s3.s3_util im... | x86Labs/wal-e | wal_e/blobstore/s3/__init__.py | Python | bsd-3-clause | 505 |
__author__ = 'djw'
class CancelledActionException(Exception):
"""
Raised when an action is cancelled
"""
pass
class InvalidActionException(Exception):
"""
Raised when an action is impossible to execute
"""
pass | sourlows/pyagricola | src/actions/exceptions.py | Python | mit | 246 |
import os, sys
import numpy as np
import simplejson as js
import pandas as pa
import yaml
import matplotlib as mpl
mpl.use('Agg')
import pylab as p
from collections import defaultdict
from jobmon import redisbackend as rb
p.rc('font', size=11)
db = rb.RedisDataStore('localhost')
jobhash = db.select_jobfile()
name ... | binarybana/samcnet | exps/jsonplotter.py | Python | mit | 3,904 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from pathlib import Path
from setuptools import find_packages, setup
def get_requirements(name):
return (
open(Path(__file__).parent.joinpath(f"requirements/{name}.txt"))
.read()
.splitlines()
)
requirements = get_requirements("base")
t... | spectresearch/detectem | setup.py | Python | mit | 1,269 |
from django.db import models
from django.core.exceptions import ValidationError
from mozdns.models import MozdnsRecord, LabelDomainMixin
from mozdns.cname.models import CNAME
from mozdns.validation import validate_mx_priority
from mozdns.validation import validate_name
import reversion
from gettext import gettext a... | rtucker-mozilla/mozilla_inventory | mozdns/mx/models.py | Python | bsd-3-clause | 2,455 |
# -*- coding: utf-8 -*-
# Generated by Django 1.10.6 on 2017-04-12 01:50
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('opconsole', '0010_auto_20170411_1949'),
]
operations = [
migrations.RenameField(
... | baalkor/timetracking | opconsole/migrations/0011_auto_20170411_1950.py | Python | apache-2.0 | 428 |
# 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/learn/python/learn/estimators/run_config.py | Python | apache-2.0 | 16,198 |
import cProfile
import StringIO
import pstats
import contextlib
@contextlib.contextmanager
def profiled():
pr = cProfile.Profile()
pr.enable()
yield
pr.disable()
s = StringIO.StringIO()
ps = pstats.Stats(pr, stream=s).sort_stats("cumulative")
ps.print_stats()
# uncomment this to see wh... | DBeath/flask-feedrsub | feedrsub/utils/profiler.py | Python | mit | 386 |
# Authors:
# Rob Crittenden <rcritten@redhat.com>
# Pavel Zuna <pzuna@redhat.com>
#
# Copyright (C) 2008 Red Hat
# see file 'COPYING' for use and warranty information
#
# 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
# th... | apophys/freeipa | ipaclient/plugins/host.py | Python | gpl-3.0 | 1,876 |
# Copyright (c) 2016 foospidy
# https://github.com/foospidy/HoneyPy
# See LICENSE for details
from NtpUdp import pluginMain
| kkusch/HoneyPy | plugins/NtpUdp/__init__.py | Python | gpl-2.0 | 126 |
#/usr/bin/env py
#coding:utf-8
"This is a test module"
import sys
'''
name = 'pel'
print
print 'Hello world!'
print
print 'hello %s' % name
print 'a' * 10
temp = "%r %r %r %r"
print temp % ("first' at", "s", "T", "s")
#age = raw_input()
#print 'The script\'s name is %s' % sys.argv[0]
#print 'The first argument is... | pelucky/python-test | PythonBook_test.py | Python | mit | 12,439 |
# This file is part of project Sverchok. It's copyrighted by the contributors
# recorded in the version control history of the file, available from
# its original location https://github.com/nortikin/sverchok/commit/master
#
# SPDX-License-Identifier: GPL3
# License-Filename: LICENSE
import bpy
from bpy.props import... | DolphinDream/sverchok | nodes/scene/obj_edit.py | Python | gpl-3.0 | 3,066 |
# Copyright (C) 2012,2013
# Max Planck Institute for Polymer Research
# Copyright (C) 2008,2009,2010,2011
# Max-Planck-Institute for Polymer Research & Fraunhofer SCAI
#
# This file is part of ESPResSo++.
#
# ESPResSo++ is free software: you can redistribute it and/or modify
# it under the terms of t... | capoe/espressopp.soap | src/Real3D.py | Python | gpl-3.0 | 3,777 |
__author__ = 'ameadows'
import sys
from setuptools import setup, find_packages
from setuptools.command.test import test as TestCommand
import datanexus
class Tox(TestCommand):
def finalize_options(self):
TestCommand.finalize_options(self)
self.test_args = []
self.test_suite = True
... | OpenDataAlex/dataNexus | setup.py | Python | gpl-2.0 | 1,846 |
from . import config
from requests.exceptions import HTTPError, ConnectionError
from datetime import datetime, timedelta
from threading import Event
from time import sleep
import requests
import logging
import re
log = logging.getLogger("angelo-api")
account_event = Event()
code = None
re_max_id = re.compile(r"(\d... | firemark/python-angel-api | angel_api/api.py | Python | mit | 4,355 |
import numpy as np
class CountryVarietyModel(object):
def __init__(self, gdd1000, kdd1000, avgmin, precip, precip2):
self.gdd1000 = gdd1000
self.kdd1000 = kdd1000
self.avgmin = avgmin
self.precip = precip
self.precip2 = precip2
def predict(self, delta_gdd1000, delta_kdd... | eicoffee/tools | production/model.py | Python | gpl-2.0 | 648 |
# Copyright 2015 Lawrence Kesteloot
#
# 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 ag... | lkesteloot/clock | escapement.py | Python | apache-2.0 | 8,428 |
# -*- coding: utf-8 -*-
"""
Created on Mon Sep 19 11:45:20 2016
@author: johnguttag
"""
import random, pylab, numpy
#set line width
pylab.rcParams['lines.linewidth'] = 4
#set font size for titles
pylab.rcParams['axes.titlesize'] = 20
#set font size for labels on axes
pylab.rcParams['axes.labelsize'] = 20
#set size ... | johntauber/MITx6.00.2x | Unit4/Lecture10Video1Notes.py | Python | mit | 1,486 |
#!/usr/bin/python
# This file is part of DEAP.
#
# DEAP is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as
# published by the Free Software Foundation, either version 3 of
# the License, or (at your option) any later version.
#
# DE... | PyQuake/earthquakemodels | result_exp_benchmark/gaBenchmarksStudy/benchmarks-pseudo-adaptative/benchmarks-gamodelF19.py | Python | bsd-3-clause | 7,709 |
# Copyright (c) 2016-present, Facebook, 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... | davinwang/caffe2 | caffe2/python/models/seq2seq/seq2seq_model_helper.py | Python | apache-2.0 | 3,477 |
import sys
from xml.dom.minidom import parseString
from dicttoxml import dicttoxml
import string
import random
import shelve
import numpy as np
import scipy.sparse as sparse
import cPickle as pickle
from collections import defaultdict, namedtuple
def randomString(length=16):
return "".join([random.choice(string.lett... | clinicalml/anchorExplorer | generate_patients.py | Python | bsd-2-clause | 1,528 |
from staffjoy.resource import Resource
from staffjoy.resources.worker import Worker
from staffjoy.resources.schedule import Schedule
from staffjoy.resources.shift import Shift
from staffjoy.resources.shift_query import ShiftQuery
from staffjoy.resources.recurring_shift import RecurringShift
class Role(Resource):
... | Staffjoy/client_python | staffjoy/resources/role.py | Python | mit | 1,528 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('people', '0003_auto_20160310_2235'),
]
operations = [
migrations.AlterModelOptions(
name='person',
o... | ghostwords/localore | localore/people/migrations/0004_auto_20160314_2320.py | Python | mpl-2.0 | 461 |
#!/usr/bin/env python
#
import sys
import numpy as np
import pyfits as pyf
from transform import *
from parallel import *
from progressbar import ProgressBar
def _rotate_recenter(filesetup, flux, storeall=True, centers=None,
theta=None, newdimen=None, write_files=False, ext="_r"):
#########... | t-brandt/acorns-adi | parallel/_rotate_recenter.py | Python | bsd-2-clause | 3,872 |
# Tweepy
# Copyright 2009-2010 Joshua Roesslein
# See LICENSE for details.
from __future__ import print_function
import os
import mimetypes
import six
from tweepy.binder import bind_api
from tweepy.error import TweepError
from tweepy.parsers import ModelParser, Parser
from tweepy.utils import list_to_csv
class AP... | cogniteev/tweepy | tweepy/api.py | Python | mit | 48,492 |
# -*- coding: utf-8 -*-
__author__ = """Xin Bian"""
__email__ = 'xin.bian@rochester.edu'
__version__ = '0.1.0'
| xinbian/2dns | python_2d_ns/__init__.py | Python | mit | 112 |
import json
from httpretty import HTTPretty
from social.p3 import urlencode
from social.tests.backends.oauth import OAuth1Test
class YahooOAuth1Test(OAuth1Test):
backend_path = 'social.backends.yahoo.YahooOAuth'
user_data_url = 'https://social.yahooapis.com/v1/user/a-guid/profile?' \
'for... | GDGLima/contentbox | third_party/social/tests/backends/test_yahoo.py | Python | apache-2.0 | 1,798 |
"""
Django settings for tests project.
For more information on this file, see
https://docs.djangoproject.com/en/1.6/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.6/ref/settings/
"""
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
impo... | mypebble/djregs | tests/auth_user_tests/tests/settings.py | Python | bsd-3-clause | 3,398 |
# -*- coding: utf-8 -*-
# Generated by Django 1.10.2 on 2016-10-15 23:56
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('picture', '0009_auto_20161015_2200'),
]
operations = [
migrations.AddField(... | ZzCalvinzZ/picturepay | picture/migrations/0010_auto_20161015_2356.py | Python | mit | 838 |
from __future__ import division
from sklearn import svm, preprocessing
import numpy as np
from sklearn.feature_selection import VarianceThreshold
from sklearn import tree
from sklearn.ensemble import RandomForestClassifier
from sklearn.neighbors import KNeighborsClassifier
from sklearn.naive_bayes import MultinomialNB
... | m00nlight/hackerrank | ai/Machine-Learning/Stack-Exchange-Question-Classifier/main.py | Python | gpl-2.0 | 1,631 |
# Authors: Alexandre Gramfort <alexandre.gramfort@telecom-paristech.fr>
# Matti Hamalainen <msh@nmr.mgh.harvard.edu>
#
# License: BSD (3-clause)
import struct
import numpy as np
from .constants import FIFF
from .tag import Tag
from .tag import read_tag
from .write import write_id, start_block, end_block, _wr... | trachelr/mne-python | mne/io/tree.py | Python | bsd-3-clause | 4,708 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('membros', '0001_initial'),
]
operations = [
migrations.AlterField(
model_name='contato',
name='celul... | vitimm144/IEPS | backend/membros/migrations/0002_auto_20151102_1806.py | Python | gpl-2.0 | 1,240 |
# Copyright (c) 2014 Evalf
#
# 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 use, copy, modify, merge, publish, distribute, s... | CVerhoosel/nutils | nutils/warnings.py | Python | mit | 1,898 |
"""Tests for the AsusWrt config flow."""
from socket import gaierror
from unittest.mock import AsyncMock, patch
import pytest
from homeassistant import data_entry_flow
from homeassistant.components.asuswrt.const import (
CONF_DNSMASQ,
CONF_INTERFACE,
CONF_REQUIRE_IP,
CONF_SSH_KEY,
CONF_TRACK_UNKNO... | partofthething/home-assistant | tests/components/asuswrt/test_config_flow.py | Python | apache-2.0 | 9,937 |
# 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... | tensorflow/estimator | tensorflow_estimator/python/estimator/canned/kmeans.py | Python | apache-2.0 | 20,373 |
import concurrent.futures as futures
import grpc
import time
import websocket
import ProtoConfig
import generated.proto_out.sensors_pb2 as sensors_pb2
import generated.proto_out.sensors_pb2_grpc as sensors_grpc
_ONE_DAY_IN_SECONDS = 60 * 60 * 24
class Push(sensors_grpc.PushServicer):
def __init__(self, accessToken... | PeridotYouClod/gRPC-Makerboards | PushServer.py | Python | mit | 2,249 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from __future__ import absolute_import
import difflib
import logging
from django.contrib import messages
from django.contrib.auth.decorators import login_required
from django.db.models import Q
from django.db import transaction
from django.shortcuts impor... | SoftwareExperiment4/SungkyunWiki | wiki/views/article.py | Python | gpl-3.0 | 33,654 |
# --------------------------------------------------------------------------------------------------
# Name: MainWindow
# Purpose: Represents the Application MainWindow and hosts all components inside it:
# Canvas, Animation Display etc.
# Author: Rafael Vasco
#
# Created: 26/01/2013
# ... | rafaelvasco/SpriteMator | src/view/main_window.py | Python | apache-2.0 | 12,241 |
#!/usr/bin/env python
#
# Copyright 2008,2010 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# GNU Radio 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, or (at your optio... | gnu-sandhi/sandhi | modules/gr36/gr-blocks/python/qa_integrate.py | Python | gpl-3.0 | 2,283 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2015, Matt Davis <mdavis_ansible@rolpdog.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 t... | kbrebanov/ansible-modules-extras | windows/win_updates.py | Python | gpl-3.0 | 4,809 |
import math
import time
import os
import sys
import ROOT
import random
import warnings
import rootlogon
from array import array
ROOT.gSystem.Load('exroot/lib/libExRootAnalysis.so')
ROOT.gSystem.Load('delphes/libDelphes.so')
ROOT.gSystem.Load('libpdf.so')
ROOT.gSystem.CompileMacro('higgs_drv.cc', 'O', 'higgs_drv')
R... | nkarast/MG5quadme | tests/TestReweight.py | Python | mit | 8,141 |
import os
max_used_id = -1
cur_node_is_processed = False
conditions = {}
if_nodes = []
if_nodes_with_2_branches = []
branch_end = {}
branch_end_type = {}
branch_type = {}
code = []
init_code = []
terminate_code = []
variables_code = []
balancer_code = ''
id_to_pos_in_code = {}
processed_loops = {}
processed_ends = ... | RomanBelkov/qreal | plugins/tools/visualInterpreter/examples/robotsCodeGeneration/reactionsStorage/Initialization.py | Python | apache-2.0 | 3,823 |
#!/usr/bin/python
__author__ = 'kalcho'
import ctypes
import random
import time
import sys
user32 = ctypes.windll.user32
kernel32 = ctypes.windll.kernel32
keystrokes = 0
mouse_clicks = 0
double_clicks = 0
class LASTINPUTINFO(ctypes.Structure):
_fields_ = [
("cbSize", ctypes.c_uint),
... | kalcho83/black-hat-python | sandbox_detect.py | Python | gpl-3.0 | 3,157 |
<<<<<<< HEAD
<<<<<<< HEAD
"""Script used to test os.kill on Windows, for issue #1220212
This script is started as a subprocess in test_os and is used to test the
CTRL_C_EVENT and CTRL_BREAK_EVENT signals, which requires a custom handler
to be written into the kill target.
See http://msdn.microsoft.com/en-us/library/m... | ArcherSys/ArcherSys | Scripts/Lib/test/win_console_handler.py | Python | mit | 4,388 |
import purplex
from truthy.expression import BiconditionalExpr
from truthy.expression import ConditionalExpr
from truthy.expression import ConjunctionExpr
from truthy.expression import DisjunctionExpr
from truthy.expression import NotExpr
from truthy.expression import VarExpr
class MyLexer(purplex.Lexer):
LABEL ... | mtomwing/truthy | truthy/parse.py | Python | gpl-2.0 | 1,738 |
# Copyright 2012 Nebula, 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 agree... | spring-week-topos/horizon-week | openstack_dashboard/test/test_data/utils.py | Python | apache-2.0 | 4,617 |
import iceflow
ic = iceflow.IceFlow()
self = ic
import numpy as np
import scipy
from scipy.io import loadmat
from scipy.sparse import linalg
import os
import sys
from matplotlib import pyplot as plt
ic.useGRASS = True
ic.location='Monteleone2017_projected'
ic.gisbase = '/usr/local/src/grass7_trunk/dist.x86_64-unknown... | umn-earth-surface/IceFlow | examples/Monteleone2017.py | Python | gpl-3.0 | 1,236 |
# -*- coding: utf-8 -*-
# Copyright 2017 OpenSynergy Indonesia
# Copyright 2022 PT. Simetri Sinergi Indonesia
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
{
"name": "Public Holiday Computation on Worked Days",
"version": "8.0.1.0.2",
"category": "Human Resources",
"website": "https://... | open-synergy/opnsynid-hr | hr_worked_days_compute_holiday/__openerp__.py | Python | agpl-3.0 | 538 |
import webbrowser
import sublime
import sublime_plugin
DUCKDUCK_BANG_URL = "https://duckduckgo.com/?q={{bang}} {{q}}"
QWANT_QWICK_URL = "https://qwant.com/?q=%26{{bang}} {{q}}"
CONFIG_FILE = "bang_search.sublime-settings"
def create_caption(bang,caption,flagFC):
# get config file
panel_label=""
if flagFC... | bsoun/bang-search | bang-search.py | Python | mit | 6,180 |
# This file is part of Booktype.
# Copyright (c) 2012 Aleksandar Erkalovic <aleksandar.erkalovic@sourcefabric.org>
#
# Booktype 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 Li... | eos87/Booktype | lib/booktype/apps/account/signals.py | Python | agpl-3.0 | 947 |
# Copyright 2014-2015 VPAC
#
# This file is part of Karaage.
#
# Karaage 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.
#
# Karaage is... | Karaage-Cluster/karaage-debian | karaage/management/commands/daily_cleanup.py | Python | gpl-3.0 | 1,004 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.