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
import sys, os
# read
from openpyxl import load_workbook
# write
from openpyxl import Workbook
from openpyxl.compat import range
# from openpyxl.cell import get_column_letter
def spelled_word(in_word):
"""
returns spelled_word
"""
return in_word + 'foo'
def read_in_write_out... | beepscore/excely | excely/excely.py | Python | mit | 8,406 |
#Made by Zachary C. on 9/11/16 last edited on 9/20/16
#1. Set amount of stocks purchased
stock = 2000
#2. Set price of each stock when bought (original)
price_o = 40.00
#3. Set price of each stock when sold (end)
price_e = 42.75
#4. Calculate total price of stocks when bought
price_b = stock * price_o
#5. Calculate to... | Tiduszk/CS-100 | Chapter 2/Book Exercises/C2-12.py | Python | gpl-3.0 | 1,108 |
from django.db import models
from django.core.auth.models import User
from django.contrib.contenttypes.models import ContentType
from django.contrib.contenttypes import generic
from core.models import TimeStampedModel
# Create your models here.
class Comment(models.Model):
comment = models.TextField()
user =... | JSchwerberg/review | review/comments/models.py | Python | mit | 561 |
from banana.db import monetdb_list, postgres_list
def monetdb_db_config(host, port, passphrase, console=True):
"""
generates a Django DATABASE configuration dict containing all
MonetDB databases.
"""
databases = {}
for monetdb in monetdb_list(host, port, passphrase):
name = monetdb['n... | bartscheers/banana | project/settings/database.py | Python | bsd-3-clause | 1,085 |
"""
Convert images to b64 and generates images.py module
"""
import os
import os.path
import base64
result = \
"""
\"\"\"
Images used in the app, all images encoded in base 64
\"\"\"
import cStringIO
import base64
import wx
def bitmap_from_base64(str_base64):
\"\"\" Converts a base64 bitmap into a wx.Bitmap \"\... | aliaafee/automo | images/convert.py | Python | unlicense | 779 |
#!/usr/bin/env python2.7
from scipy import stats
import sys
import numpy as np
from scipy.spatial.distance import cdist
SEPARATOR = ' '
NR_SAMPLES = 212
NR_CORESETS = 2048
def simple_adaptive_sampling(data, n_points):
#compute all pairwise distances
distances = cdist(data, data)
#declare weight vectors
... | bvancea/data-mining-project-2014 | kmeans/code/mapper_adaptive.py | Python | gpl-3.0 | 2,229 |
import pygame
'
A class that handles the graphical score counter.
'
class ScoreCounter(pygame.font.Font):
score = None
font = None
def __init__(self):
self.score = 0
self.font = pygame.font.SysFont("monospace", 15)
def update(self, score):
self.score = score
def reset(s... | simon1573/Roadrunner | score_counter.py | Python | gpl-3.0 | 458 |
# Copyright (c) 2008-2013 by Enthought, Inc.
# All rights reserved.
import os
import re
import subprocess
import sys
from setuptools import setup, Extension, find_packages
MAJOR = 4
MINOR = 6
MICRO = 0
IS_RELEASED = False
VERSION = '%d.%d.%d' % (MAJOR, MINOR, MICRO)
# Return the git revision as a string
def git_v... | burnpanck/traits | setup.py | Python | bsd-3-clause | 5,252 |
"""
OVERALL CREDIT TO:
t0mm0, Eldorado, VOINAGE, BSTRDMKR, tknorris, smokdpi, TheHighway
resolveurl XBMC Addon
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 Sof... | felipenaselva/felipe.repository | script.module.resolveurl/lib/resolveurl/plugins/vidhos.py | Python | gpl-2.0 | 1,013 |
#!/usr/bin/env python
"""Contains the Data Model for a cool Resource.
"""
__author__ = "Sanjay Joshi"
__copyright__ = "IBM Copyright 2017"
__credits__ = ["Sanjay Joshi"]
__license__ = "Apache 2.0"
__version__ = "1.0"
__maintainer__ = "Sanjay Joshi"
__email__ = "joshisa@us.ibm.com"
__status__ = "Prototype"
schema = {
... | joshisa/mistub | mistub/models/corporaadatypes.py | Python | apache-2.0 | 667 |
# 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 applicab... | eadgarchen/tensorflow | tensorflow/python/keras/_impl/keras/applications/imagenet_utils_test.py | Python | apache-2.0 | 7,581 |
#!/usr/bin/env python
"""
list_tests
~~~~~~~~~~
Basic tests for use in checking slices.
:copyright: 2018 SuperDARN Canada
:author: Marci Detwiller
"""
def is_increasing(list_to_check):
"""
Check if list is increasing.
:param list_to_check: a list of numbers
:returns: boo... | SuperDARNCanada/placeholderOS | experiment_prototype/list_tests.py | Python | gpl-3.0 | 929 |
# -*- coding: utf-8 -*-
# Copyright (C) 2014-2016 Andrey Antukh <niwi@niwi.nz>
# Copyright (C) 2014-2016 Jesús Espino <jespinog@gmail.com>
# Copyright (C) 2014-2016 David Barragán <bameda@dbarragan.com>
# Copyright (C) 2014-2016 Alejandro Alonso <alejandro.alonso@kaleidos.net>
# This program is free software: you can r... | mattcongy/itshop | docker-images/taigav2/taiga-back/taiga/projects/history/mixins.py | Python | mit | 2,979 |
# -*- coding: utf-8 -*-
"""
This module implements the classes that deal with math.
.. :copyright: (c) 2014 by Jelte Fennema.
:license: MIT, see License for more details.
"""
from .base_classes import Command, Container, Environment
from .package import Package
class Alignat(Environment):
"""Class that rep... | JelteF/PyLaTeX | pylatex/math.py | Python | mit | 3,905 |
import datetime
import os
from django.db import models
from django.utils.itercompat import is_iterable
from djapian.signals import post_save, pre_delete
from django.conf import settings
from django.utils.encoding import smart_unicode, force_unicode
from djapian.resultset import ResultSet
from djapian import utils, de... | akabos/python-django-djapian | src/djapian/indexer.py | Python | bsd-3-clause | 13,642 |
import unittest
from sqlalchemy.orm import sessionmaker
from kiskadee.report import CppcheckReport, FlawfinderReport
from kiskadee.database import Database
class ReportTestCase(unittest.TestCase):
def setUp(self):
self.engine = Database('db_test').engine
Session = sessionmaker(bind=self.engine)
... | LSS-USP/kiskadee | kiskadee/tests/units/test_report.py | Python | agpl-3.0 | 1,645 |
'''
Image
=====
The :class:`Image` widget is used to display an image::
wimg = Image(source='mylogo.png')
Asynchronous Loading
--------------------
To load an image asynchronously (for example from an external webserver), use
the :class:`AsyncImage` subclass::
aimg = AsyncImage(source='http://mywebsite.com... | hansent/kivy | kivy/uix/image.py | Python | mit | 10,174 |
# Copyright 2018 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | jonparrott/google-cloud-python | automl/setup.py | Python | apache-2.0 | 2,316 |
#This file is distributed under the terms of the GNU General Public license.
#Copyright (C) 2011 Jekin Trivedi <jekintrivedi@gmail.com> (See the file COPYING for details).
from atlas import *
from physics import *
from physics import Quaternion
from physics import Vector3D
import server
class Repairing(server.Task):... | alriddoch/cyphesis | rulesets/mason/world/tasks/Repairing.py | Python | gpl-2.0 | 3,147 |
# -*- coding: utf-8 -*-
"""
Created on Fri Jun 17 21:30:02 2016
@author: mtkessel
"""
import pyglet
from pyglet.gl import *
win = pyglet.window.Window()
@win.event
def on_draw():
# Clear buffers
glClear(GL_COLOR_BUFFER_BIT)
# Draw outlines only
glPolygonMode(GL_FRONT_AND_BACK, ... | RocketRedNeck/PythonPlayground | pygletexample.py | Python | mit | 598 |
AR = '/usr/bin/ar'
ARFLAGS = 'rcs'
CCFLAGS = ['-g']
CCFLAGS_MACBUNDLE = ['-fPIC']
CCFLAGS_NODE = ['-D_LARGEFILE_SOURCE', '-D_FILE_OFFSET_BITS=64']
CC_VERSION = ('4', '5', '2')
COMPILER_CXX = 'g++'
CPP = '/usr/bin/cpp'
CPPFLAGS_NODE = ['-D_GNU_SOURCE']
CPPPATH_NODE = '/usr/local/include/node'
CPPPATH_ST = '-I%s'
CXX = [... | Matchbin/radbot | node_modules/hubot-scripts/node_modules/redis/node_modules/hiredis/build/c4che/Release.cache.py | Python | mit | 1,463 |
"""Context information for the current invocation of ansible-test."""
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import os
from . import types as t
from .util import (
ApplicationError,
import_plugins,
is_subdir,
ANSIBLE_LIB_ROOT,
ANSIBLE_TEST_ROOT,
... | kustodian/ansible | test/lib/ansible_test/_internal/data.py | Python | gpl-3.0 | 8,020 |
from django.db import models
from django.conf import settings
from django.core.exceptions import ValidationError
from polymorphic import PolymorphicModel
from django.db.models import F
from django.core.urlresolvers import reverse
from django.contrib.auth.models import User
from celery.exceptions import SoftTimeLimitExc... | dever860/cabot | cabot/cabotapp/models.py | Python | mit | 30,857 |
# Mrs
# Copyright 2008-2012 Brigham Young University
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... | WillChilds-Klein/mistress-mapreduce | mrs/fileformats.py | Python | apache-2.0 | 13,028 |
# udev.py
# Python module for querying the udev database for device information.
#
# Copyright (C) 2009 Red Hat, Inc.
#
# This copyrighted material is made available to anyone wishing to use,
# modify, copy, or redistribute it subject to the terms and conditions of
# the GNU General Public License v.2, or (at your opt... | mattias-ohlsson/anaconda | pyanaconda/baseudev.py | Python | gpl-2.0 | 3,213 |
from .. import utils
from ..api import Gradebook
from . import NbGraderPreprocessor
class GetGrades(NbGraderPreprocessor):
"""Preprocessor for saving grades from the database to the notebook"""
def preprocess(self, nb, resources):
# pull information from the resources
self.notebook_id = resou... | EdwardJKim/nbgrader | nbgrader/preprocessors/getgrades.py | Python | bsd-3-clause | 2,773 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2002-2006 Zuza Software Foundation
#
# This file is part of translate.
#
# translate 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... | lehmannro/translate | storage/csvl10n.py | Python | gpl-2.0 | 7,279 |
from django.contrib import admin
from forms import OptionnalTaggedItemForm
from models import OptionnalTaggedItem
class OptionnalTaggedItemAdmin(admin.ModelAdmin):
form = OptionnalTaggedItemForm
admin.site.register(OptionnalTaggedItem, OptionnalTaggedItemAdmin)
| spookylukey/django-autocomplete-light | test_project/optionnal_gfk_autocomplete/admin.py | Python | mit | 269 |
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | eonezhang/avro | lang/py/test/test_tether_task.py | Python | apache-2.0 | 3,589 |
import mimetypes
import httplib
mimetypes.init()
mimetypes.add_type('image/x-dwg', '.dwg')
mimetypes.add_type('image/x-icon', '.ico')
import os
import re
import stat
import time
import urllib
import karacos
from karacos.lib import http, validate_since, file_generator_limited
def serve_file(pat... | karacos/karacos-wsgi | py/karacos/lib/static.py | Python | lgpl-3.0 | 10,133 |
__author__ = 'elgin'
| pombreda/py2neo | test/ext/__init__.py | Python | apache-2.0 | 21 |
# Copyright 2013 OpenStack Foundation
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requ... | ebagdasa/tempest | tempest/services/identity/v3/json/identity_client.py | Python | apache-2.0 | 25,737 |
# coding=utf-8
import logging
logger = logging.getLogger(__name__)
class Registry():
def __init__(self, session):
self.session = session
def list(self, detail = False, size = None):
params = {}
if size:
params['n'] = size
url = self.sessi... | PinaeCloud/docker-api | docker/registry.py | Python | apache-2.0 | 1,983 |
"""Applications built on Surgeo"""
| theonaun/surgeo | surgeo/app/__init__.py | Python | mit | 35 |
import cmd
class Skills(cmd.Cmd):
"""
Simple program that allows user to add skills, view a list of all the skills added,
indicate the skills studied, indicate the skills studied, view a list of skills studied
and see my learning progress.
"""
def do_input_skill(self,line):
"""
... | Flevian/andelabootcamp16 | day4/views_skills.py | Python | mit | 1,718 |
from __future__ import with_statement
import warnings
from celery.task import base
from celery.tests.compat import catch_warnings
from celery.tests.utils import unittest
def add(x, y):
return x + y
class test_decorators(unittest.TestCase):
def setUp(self):
warnings.resetwarnings()
with ... | WoLpH/celery | celery/tests/test_compat/test_decorators.py | Python | bsd-3-clause | 963 |
# Copyright (C) 2019-2022 Yannick Jadoul
#
# This file is part of Parselmouth.
#
# Parselmouth 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 ... | YannickJadoul/Parselmouth | tests/test_textgrid.py | Python | gpl-3.0 | 2,891 |
from .base import BaseConfig
class AdministrativeGender(BaseConfig):
@classmethod
def build_fhir_object_from_health(cls, health):
# biological_sex
# m --> male
# f --> female
if health == "m":
return cls.get_fhir_male()
elif health == "f":
re... | teffalump/health_fhir | gnu_health_fhir/config/converters/config_admin_gender.py | Python | gpl-3.0 | 1,458 |
import re
import difflib
def strip_spaces_between_tags(value):
"""
Stolen from `django.util.html`
Returns the given HTML with spaces between tags removed.
"""
return re.sub(r'>\s+<', '><', unicode(value))
def assert_no_diff(expected, out):
diff = [l for l in difflib.unified_diff(expected.split... | 0111001101111010/hyde | hyde/tests/util.py | Python | mit | 1,179 |
# -*- coding: utf-8 -*-
##
## This file is part of Invenio.
## Copyright (C) 2005, 2006, 2007, 2008, 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... | MSusik/invenio | invenio/legacy/bibrank/downloads_similarity.py | Python | gpl-2.0 | 4,339 |
#-*- coding: utf-8 -*-
# Copyright 2017 ibelie, Chen Jie, Joungtao. All rights reserved.
# Use of this source code is governed by The MIT License
# that can be found in the LICENSE file.
SymbolDecodeMap = "-ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_"
SymbolEncodeMap = {}
for i, c in enumerate(Symb... | ibelie/typy | typy/Proto.py | Python | mit | 10,795 |
# coding=iso-8859-1
# TODO:
# -test graph generation APIs (from adjacency, etc..)
# -test del_node, del_edge methods
# -test Common.set method
from __future__ import division, print_function
import os
try:
from hashlib import sha256
except ImportError:
import sha
sha256 = sha.new
import subprocess
impor... | krzysbaranski/pydot | test/pydot_unittest.py | Python | mit | 9,948 |
import numpy as np
import cPickle
from sklearn.cross_validation import train_test_split
from edge_crf import EdgeCRF
from pystruct.learners import OneSlackSSVM
from time import time
from data_loader import load_syntetic
from data_loader import load_msrc
from common import compute_error
# testing with full labeled ... | kondra/latent_ssvm | test_full_labeled.py | Python | bsd-2-clause | 5,259 |
"""
Django settings for mercury 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, ...)
im... | greenac/mercury | mercury/mercury/settings.py | Python | mit | 2,058 |
# -*- Mode: Python; py-indent-offset: 4 -*-
# vim: tabstop=4 shiftwidth=4 expandtab
#
# Copyright (C) 2007-2009 Johan Dahlin <johan@gnome.org>
#
# module.py: dynamic module for introspected libraries.
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser Gener... | pexip/pygobject | gi/module.py | Python | lgpl-2.1 | 9,705 |
import myhdl
from myhdl import Signal, intbv, instance, delay, StopSimulation
from rhea.system import Clock, Reset
from rhea.utils.test import run_testbench, tb_args, tb_default_args
from zybo_device_primitives import zybo_device_prim
def test_devprim(args=None):
args = tb_default_args(args)
clock = Clock... | NickShaffner/rhea | examples/boards/zybo/device_primitives/test.py | Python | mit | 917 |
"""
Copyright (C) since 2013 Calliope contributors listed in AUTHORS.
Licensed under the Apache 2.0 License (see LICENSE file).
cli.py
~~~~~~
Command-line interface.
"""
import contextlib
import datetime
import itertools
import os
import pstats
import shutil
import sys
import traceback
import click
from calliope ... | calliope-project/calliope | calliope/cli.py | Python | apache-2.0 | 12,023 |
"""Grunfeld (1950) Investment Data"""
__docformat__ = 'restructuredtext'
COPYRIGHT = """This is public domain."""
TITLE = __doc__
SOURCE = """This is the Grunfeld (1950) Investment Data.
The source for the data was the original 11-firm data set from Grunfeld's Ph.D.
thesis recreated by Kleiber and Zeile... | wesm/statsmodels | scikits/statsmodels/datasets/grunfeld/data.py | Python | bsd-3-clause | 2,708 |
import tkinter
def button1_command():
print('dfsdfs');
def print_hello(event):
print(event.x)
print(event.y)
print(event.num)
me=event.widget
if me==button1:
print('Hello!')
elif me==button2:
print('button2')
else:
raise ValueError()
def init_main_window(... | peryazeva/kpk_python | catch_the_ball/widgets_testing.py | Python | gpl-3.0 | 1,168 |
#
# 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... | SVADemoAPP/AmqpCode | python/qpid/framing.py | Python | apache-2.0 | 8,436 |
import json
from unittest.mock import patch
from federation.hostmeta.parsers import (
parse_nodeinfo_document, parse_nodeinfo2_document, parse_statisticsjson_document, int_or_none,
parse_mastodon_document, parse_matrix_document)
from federation.tests.fixtures.hostmeta import (
NODEINFO2_10_DOC, NODEINFO_10... | jaywink/federation | federation/tests/hostmeta/test_parsers.py | Python | bsd-3-clause | 14,602 |
# -*- coding: utf-8; -*-
"""SCons.Tool.clang
Tool-specific initialization for clang.
There normally shouldn't be any need to import this module directly.
It will usually be imported through the generic SCons.Tool.Tool()
selection method.
"""
#
# Copyright (c) 2001 - 2017 The SCons Foundation
#
# Permission is here... | CartoDB/mapnik | scons/scons-local-3.0.1/SCons/Tool/clang.py | Python | lgpl-2.1 | 2,923 |
"""
Third party modules included in nesoni for convenience
vcf:
PyVCF http://pypi.python.org/pypi/PyVCF
Note:
imports in vcf/__init__.py
converted to relative imports
"""
| Victorian-Bioinformatics-Consortium/nesoni | nesoni/third_party/__init__.py | Python | gpl-2.0 | 193 |
from django.db.models.signals import post_save
from django.dispatch import receiver
from .models import Board, BoardPermissions, User, UserSettings
@receiver(post_save, sender=Board)
def init_board_permissions(sender, **kwargs):
"""Link existing benchmark countries to newly created countries."""
instance = k... | twschiller/open-synthesis | openach/signals.py | Python | gpl-3.0 | 681 |
"""
Deal with the part of a Tx that specifies where the Bitcoin goes to.
The MIT License (MIT)
Copyright (c) 2013 by Richard Kiss
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 restric... | shivaenigma/pycoin | pycoin/tx/TxOut.py | Python | mit | 2,426 |
from mod_descriptor import ModuleDescriptor
from sensor_event import SensorEvent
from perfcount import PerformanceCounter | amcgee/pymomo | pymomo/commander/types/__init__.py | Python | lgpl-3.0 | 121 |
import unittest
class VideoTestCase(unittest.TestCase):
def test_video_unload(self):
# fix issue https://github.com/kivy/kivy/issues/2275
# AttributeError: 'NoneType' object has no attribute 'texture'
from kivy.uix.video import Video
from kivy.clock import Clock
from kivy... | Cheaterman/kivy | kivy/tests/test_video.py | Python | mit | 892 |
import time
import unittest
# this import must be done *BEFORE* Gtk/Glib/etc *AND* pytestshot !
from . import paperwork
import pytestshot
import gi
gi.require_version('Pango', '1.0')
gi.require_version('PangoCairo', '1.0')
gi.require_version('Poppler', '0.18')
gi.require_version('Gdk', '3.0')
gi.require_version('Gtk... | jflesch/paperwork-tests | tests/tests_mainwin.py | Python | gpl-3.0 | 11,195 |
#!/usr/bin/env python2.7
"""
A module for Graph implementations.
DG = Directed Graph.
UG = Un-directed Graph.
SUG = Symbolic Un-directed Graph.
SDG = Symbolic Directed Graph.
"""
#-----------------------------------------------------------------------
import unittest
#-------------------------... | anantpatil/scripts | graph.py | Python | mit | 7,238 |
# python3
# 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in... | GoogleCloudPlatform/solutions-cloud-orchestrate | integration/conftest.py | Python | apache-2.0 | 1,332 |
import scrapy
from packt.items import PacktItem
#//a[@class='twelve-days-claim']/@href
class PacktSpider(scrapy.Spider):
name = "packt"
allowed_domains = ["packtpub.com"]
start_urls = ["https://www.packtpub.com/packt/offers/free-learning/?utm_source=twitter&utm_medium=social&utm_campaign=FL20153"]
de... | cchitsiang/py-scripts | packtCrawler/packt/spiders/packt_spider.py | Python | mit | 743 |
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
{
"name": "Vietnam - Accounting",
"version": "2.0",
"author": "General Solutions",
'website': 'http://gscom.vn',
'category': 'Localization',
"description": """
This is the module to manage the ac... | t3dev/odoo | addons/l10n_vn/__manifest__.py | Python | gpl-3.0 | 1,048 |
import copy
import mock
from okaara.cli import CommandUsage
import base_builtins
from pulp.bindings.exceptions import NotFoundException, PulpServerException
from pulp.client.admin import tasks
from pulp.client.admin.tasks import VALID_STATES
EXAMPLE_CALL_REPORT = {
'exception': None,
'task_type': 'pulp.ser... | ulif/pulp | client_admin/test/unit/test_pulp_tasks_extension.py | Python | gpl-2.0 | 10,720 |
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Addons modules by CLEARCORP S.A.
# Copyright (C) 2009-TODAY CLEARCORP S.A. (<http://clearcorp.co.cr>).
#
# This program is free software: you can redistribute... | sysadminmatmoz/odoo-clearcorp | hr_payroll_extended/contract.py | Python | agpl-3.0 | 1,585 |
#!/usr/bin/python
############################################################################################################
## LIBRARY IMPORT #
####################################################################################... | stevenmcastano/ISY-iCloud-Proximity | tools/listdevices.py | Python | apache-2.0 | 4,415 |
# Copyright 2009 Jordi Esteve <jesteve@zikzakmedia.com>
# Copyright 2013 Ignacio Ibeas <ignacio@acysos.com>
# Copyright 2015 Tecnativa - Sergio Teruel
# Copyright 2016 Tecnativa - Carlos Dauden
# Copyright 2013-2017 Tecnativa - Pedro M. Baeza
# License AGPL-3 - See https://www.gnu.org/licenses/agpl-3.0.html
{
"nam... | factorlibre/l10n-spain | l10n_es_partner/__manifest__.py | Python | agpl-3.0 | 1,054 |
import numpy as np
import prairielearn as pl
def generate(data):
A = np.zeros((2,2))
data['correct_answers']['A'] = pl.to_json(A)
def grade(data):
# get the submitted answers
MatrixA = pl.from_json(data['submitted_answers']['A'])
MatrixB = MatrixA.dot(MatrixA)
if ((not MatrixB.any()) and Ma... | PrairieLearn/PrairieLearn | exampleCourse/questions/workshop/Lesson4_example1/server.py | Python | agpl-3.0 | 462 |
# -*- encoding: utf-8 -*-
import datetime
import dateutil.parser
__all__ = (
'boolean_field_handler', 'date_field_handler', 'float_field_handler', 'ignored_field_handler',
'integer_field_handler', 'text_field_handler'
)
def boolean_field_handler(field, component_name, term):
if term.lower() in ('true', ... | CloudNcodeInc/django-datatable-view | datatableview/handlers.py | Python | apache-2.0 | 2,060 |
# coding: utf-8
import torch
import torch.autograd as autograd
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
CONTEXT_SIZE = 2 # 2 words to the left, 2 to the right
EMBEDDING_DIM = 5
raw_text = """We are about to study the idea of a computational process.
Computational processes ar... | li-yuntao/SiliconLives | PytorchModels/CBOW.py | Python | gpl-3.0 | 2,584 |
# Copyright (c) 2014 NetApp, Inc. All Rights Reserved.
# Copyright (c) 2015 Alex Meade. All Rights Reserved.
# Copyright (c) 2015 Rushil Chugh. All Rights Reserved.
# Copyright (c) 2015 Navneet Singh. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use th... | nikesh-mahalka/cinder | cinder/volume/drivers/netapp/eseries/iscsi_driver.py | Python | apache-2.0 | 3,798 |
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
import os
from glob import glob
import argparse
import time
import datetime
from multiprocessing import Pool
# local import
from ast import ast
import result
AST_EXT_FILE = ".ast"
CSV_EXT_FILE = ".csv"
CPP_EXT_FILE = ("*.cc", "*.cpp")
# TODO support sigterm and close ... | mathben/python_clang_parser | main.py | Python | gpl-3.0 | 12,033 |
#!/bin/python3
import unicodedata
import sys
filt = dict.fromkeys(i for i in range(sys.maxunicode) if not unicodedata.category(chr(i)).startswith('L'))
def main():
if len(sys.argv) != 2:
print("Usage:", sys.argv[0], "[input file]")
exit()
for i in range(128):
filt[i] = None
with o... | w1ndy/learn-js | word-cloud/tag-extraction/clean.py | Python | mit | 474 |
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2016, 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 program is free software: you can redistribute it and/or modify
# it under the... | ThomasMiconi/nupic.research | projects/feedback/feedback_sequences_additional.py | Python | agpl-3.0 | 24,245 |
import os
import sys
sys.path.insert(0, "../../util/python")
import Cons
import Util
import Conf
def Load():
with Cons.MeasureTime("Loading exp data ..."):
for expg, v in Conf.Get().iteritems():
_LoadExpGroup(expg)
_expg_exps = {}
def MaxTotalCost(expg):
global _expg_exps
max_total_cost = None
for e in... | hobinyoon/apache-cassandra-2.2.3-src | mtdb/eval/cost-by-storage-type/ExpData.py | Python | apache-2.0 | 3,478 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os, os.path, sys, logging
from bottle import app, route, redirect, static_file, view
from utils import path_for
from utils.decorators import timed, cache_control
from config import settings
log = logging.getLogger()
@route('/')
def index():
redirect(os.path.... | rcarmo/yaki-gae | routes/static.py | Python | mit | 744 |
"""
Scriptable Packages Installer - Parcks
Copyright (C) 2017 JValck - Setarit
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.... | Parcks/core | src/domain/model/installable.py | Python | gpl-2.0 | 1,024 |
from urdf_parser_py.xml_reflection.basics import *
import sys
import copy
# @todo Get rid of "import *"
# @todo Make this work with decorators
# Is this reflection or serialization? I think it's serialization...
# Rename?
# Do parent operations after, to allow child to 'override' parameters?
# Need to make sure tha... | robotology-dependencies/urdfdom | urdf_parser_py/src/urdf_parser_py/xml_reflection/core.py | Python | bsd-3-clause | 16,161 |
##########################################################################
#
# Copyright (c) 2016, Image Engine Design Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistrib... | chippey/gaffer | python/GafferSceneUI/ShaderViewUI.py | Python | bsd-3-clause | 4,596 |
__author__ = 'student'
import turtle
turtle.shape('turtle')
n = 1
while n < 100:
turtle.forward(10)
turtle.right(3.6)
n += 1 | YellowNettle/Labs-16 | 3_4.py | Python | gpl-3.0 | 138 |
#!/bin/python2.7
from sys import platform as _platform
SEPARATOR="/"
if _platform == "win32":
SEPARATOR="\\"
SCRIPT_PATH="src"+SEPARATOR+"static"+SEPARATOR+"scripts"+SEPARATOR;
PYTHON_BIN="python";
print _platform+" "+SCRIPT_PATH
scripts = [
{
"id": 1,
"title":"Scrit 01",
"name":"Scri... | nomade/watson | src/config.py | Python | bsd-3-clause | 905 |
# Copyright 2015-2016 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
doc = """Directories plug-in module for repoman.
Performs an FilesChecks check on ebuilds."""
__doc__ = doc[:]
module_spec = {
'name': 'directories',
'description': doc,
'provides':{
'directories-module': ... | dol-sen/portage | repoman/pym/repoman/modules/scan/directories/__init__.py | Python | gpl-2.0 | 1,041 |
#!/usr/bin/env python
'''
mavproxy - a MAVLink proxy program
Copyright Andrew Tridgell 2011
Released under the GNU GPL version 3 or later
'''
import sys, os, time, socket, signal
import fnmatch, errno, threading
import serial, Queue, select
import traceback
import select
from MAVProxy.modules.lib import textconsole... | denniszollo/MAVProxy | MAVProxy/mavproxy.py | Python | gpl-3.0 | 38,949 |
import sulley.blocks
import sulley.instrumentation
import sulley.legos
import sulley.pedrpc
import sulley.primitives
import sulley.sex
import sulley.sessions
import sulley.utils
BIG_ENDIAN = ">"
LITTLE_ENDIAN = "<"
###############################################################################################... | cirosantilli/sulley | sulley/__init__.py | Python | gpl-2.0 | 28,700 |
"""
Copyright (c) 2016 Jet Propulsion Laboratory,
California Institute of Technology. All rights reserved
"""
import importlib
import unittest
from os import environ, path
import nexusproto.NexusContent_pb2 as nexusproto
import numpy as np
from nexusproto.serialization import from_shaped_array
class TestAscatbUData... | dataplumber/nexus | nexus-ingest/nexus-xd-python-modules/tests/subtract180longitude_test.py | Python | apache-2.0 | 2,335 |
from otp.avatar import Avatar
from otp.avatar.Avatar import teleportNotify
import ToonDNA
from direct.task.Task import Task
from toontown.suit import SuitDNA
from direct.actor import Actor
import string
from ToonHead import *
from pandac.PandaModules import *
from direct.interval.IntervalGlobal import *
from direct.dir... | ksmit799/Toontown-Source | toontown/toon/Toon.py | Python | mit | 119,267 |
# (C) British Crown Copyright 2014 - 2015, Met Office
#
# This file is part of Iris.
#
# Iris 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 l... | mo-g/iris | docs/iris/example_tests/test_projections_and_annotations.py | Python | gpl-3.0 | 1,398 |
# should be using spacy for everything NLP from now on
from ml.document_features import en_nlp, selectContentWords
from proc.query_extraction import SentenceQueryExtractor, EXTRACTOR_LIST
class FilteredSentenceQueryExtractor(SentenceQueryExtractor):
def getQueryTextFromSentence(self, sent):
doc = en_nlp(... | danieldmm/minerva | proc/nlp_query_extraction.py | Python | gpl-3.0 | 499 |
# -*- coding: utf-8 -*-
# Copyright 2013 Mirantis, 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 requi... | SmartInfrastructures/fuel-web-dev | nailgun/nailgun/test/integration/test_volume_manager.py | Python | apache-2.0 | 4,132 |
#!/usr/bin/env python
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "meetuppizza.settings")
from django.core.management import execute_from_command_line
execute_from_command_line(sys.argv)
| nicole-a-tesla/meetup.pizza | manage.py | Python | mit | 254 |
import datetime
from gigacluster.window import Window
STREAM = [
(datetime.date(2014, 1, 1), ['20140101.a', '20140101.b']),
(datetime.date(2014, 1, 2), ['20140102.a', '20140102.b']),
(datetime.date(2014, 1, 3), ['20140103.a', '20140103.b']),
]
def test_window():
w = Window(STREAM)
w.seek()
as... | schwa-lab/gigacluster | tests/test_window.py | Python | mit | 1,062 |
with open('README.txt') as f:
long_description = f.read()
from distutils.core import setup
setup(
name = "nomit",
packages = ["nomit"],
version = "1.0",
description = "Process Monit HTTP/XML",
author = "Markus Juenemann",
author_email = "markus@juenemann.net",
url = "https://github.com... | mjuenema/nomit | setup.py | Python | bsd-2-clause | 902 |
#!/usr/bin/python
#-*-coding: utf-8 -*-
import unittest
import json
import re
from base64 import b64encode
from flask import url_for
from app import create_app, db
from app.models import User, Role, Post, Comment
class APITestCase(unittest.TestCase):
def setUp(self):
self.app = create_app('testing')
... | singleyoungtao/myblog-flask | tests/test_api.py | Python | mit | 10,718 |
# This file is part of Buildbot. Buildbot 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, version 2.
#
# This program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without eve... | denny820909/builder | lib/python2.7/site-packages/buildbot-0.8.8-py2.7.egg/buildbot/status/web/hooks/base.py | Python | mit | 3,070 |
import bottle
app = bottle.Bottle()
def index():
return 'Hello World with module'
def show(pk):
return 'Hello primary key #%s with module' % pk
@app.route('/other_route', 'GET')
def other_route():
return 'Hello world with other route into de module'
if __name__ == '__main__':
import sys
from... | edersohe/bottle-resource | examples/rest_module.py | Python | mit | 462 |
#!/usr/bin/env python
# Copyright 2018 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required... | GoogleCloudPlatform/python-docs-samples | iam/api-client/grantable_roles.py | Python | apache-2.0 | 1,770 |
""" Testing array utilities
"""
import sys
import numpy as np
from ..arrfuncs import as_native_array
from numpy.testing import (assert_array_almost_equal,
assert_array_equal)
from nose.tools import assert_true, assert_false, assert_equal, assert_raises
NATIVE_ORDER = '<' if sys.byteorde... | mdesco/dipy | dipy/utils/tests/test_arrfuncs.py | Python | bsd-3-clause | 832 |
# Script Name: CutFillStatistics 1.0
#
# Created By: Stephen Jackson
# Date: 01/16/2013
# Import ArcPy site-package and os modules
#
import arcpy
import os
import sys
import time
import string
import subprocess
#set executable program location
executablepath = os.path.dirname(os.path.abspath(__file__))
arcpy... | crwr/OptimizedPitRemoval | ArcGIS Code/CutFillStatistics.py | Python | mit | 1,480 |
"""
Installs and configures neutron
"""
import logging
import os
import re
import uuid
from packstack.installer import utils
from packstack.installer import validators
from packstack.installer.utils import split_hosts
from packstack.modules.shortcuts import get_mq
from packstack.modules.ospluginutils import getManif... | twistedogic/packstack | packstack/plugins/neutron_350.py | Python | apache-2.0 | 41,275 |
'''
Created on 2016-5-7
@author: javacardos@gmail.com
@organization: https://www.javacardos.com/
@copyright: JavaCardOS Technologies. All rights reserved.
'''
class SCInterface(object):
'''
classdocs
'''
def __init__(self, params):
'''
Constructor
'''
def connect(sel... | JavaCardOS/pyResMan | pyResMan/SCInterface.py | Python | gpl-2.0 | 499 |
# -*- Mode: Python; coding: utf-8 -*-
# vi:si:et:sw=4:sts=4:ts=4
##
## Copyright (C) 2011-2013 Async Open Source <http://www.async.com.br>
## 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 Fre... | tiagocardosos/stoq | stoq/gui/shell/shellwindow.py | Python | gpl-2.0 | 43,035 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.