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
# -*- coding: utf-8 -*- # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors and contributors # For license information, please see license.txt from __future__ import unicode_literals import frappe from frappe.model.document import Document class ContactDetails(Document): pass
Tejal011089/osmosis_erpnext
erpnext/selling/doctype/contact_details/contact_details.py
Python
agpl-3.0
297
# Write a function to decode the following. Yms bgb gr! Cmlepyrsjyrgmlq! Dgb wms sqc qrpgle.kyicrpylq? Id wms bgbl'r wms qfmsjb npmzyzjw em afcai gr msr. Ir kyicq rfgq ksaf cyqgcp. # A hint # a = c # z = b # m = o # maybe # r = s # g = i # m = h
bobbybabra/codeGuild
codeChallenge_three.py
Python
bsd-2-clause
253
import datetime from django.utils.html import linebreaks from django.contrib.sites.models import Site def camelcase(name): return ''.join(x.capitalize() or ' ' for x in name.split(' ')) def camelcase_lower(name): pname = camelcase(name) return pname[0].lower() + pname[1:] def split_thousands(n, sep=',...
valnet/valuenetwork
valuenetwork/valueaccounting/utils.py
Python
agpl-3.0
24,494
# -*- coding: utf-8 -*- from __future__ import unicode_literals import logging from rest_framework import viewsets from permissions import CategoryPermissions, PostPermissions, AnnouncementPermissions from models import Category, Post, Announcement from serializers import CategorySerializer, PostSerializer, Announcem...
Diwaniya-Labs/django-rest-forum
discussion/views.py
Python
lgpl-3.0
2,033
def foo(): pass
siddhika1889/Pydev-Editor
tests/pysrc/mod/utils.py
Python
epl-1.0
19
#!/usr/bin/env python # vim:fileencoding=UTF-8:ts=4:sw=4:sta:et:sts=4:ai from __future__ import with_statement __license__ = 'GPL v3' __copyright__ = '2009, Kovid Goyal <kovid@kovidgoyal.net>' __docformat__ = 'restructuredtext en' import subprocess, tempfile, os, time from setup import Command, installer_name from...
Eksmo/calibre
setup/installer/__init__.py
Python
gpl-3.0
6,405
# # DAPLink Interface Firmware # Copyright (c) 2016-2017, ARM Limited, All Rights Reserved # SPDX-License-Identifier: Apache-2.0 # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www...
google/DAPLink-port
test/stress_tests/hid_usb_test.py
Python
apache-2.0
2,358
# -*- coding: utf-8 -*- # import re import data_tree from collections import OrderedDict from itertools import chain import logging import datetime import uuid from functools import wraps import time import ipaddress import psutil from django.utils.translation import ugettext_lazy as _ from ..exceptions import JMSExcep...
skyoo/jumpserver
apps/common/utils/common.py
Python
gpl-2.0
5,947
import numpy as np from numpy.testing import assert_array_equal from nose import with_setup try: from nose.tools import assert_is except ImportError: from landlab.testing.tools import assert_is from landlab import RasterModelGrid _GRIDS = {} def setup_grids(): """Set up test grids with unit and non-uni...
csherwood-usgs/landlab
landlab/grid/tests/test_raster_funcs/test_gradients_at_active_links.py
Python
mit
3,093
#!/usr/bin/env python # Tests check_format.py. This must be run under docker via # check_format_test.py, or you are liable to get the wrong clang, and # all kinds of bad results. import os import shutil import subprocess def getenvFallback(envvar, fallback): val = os.getenv(envvar) if not val: val = fallback...
sebrandon1/envoy
tools/check_format_test_run_under_docker.py
Python
apache-2.0
4,508
""" The :mod:`dic.video` module provides functions to export video frames and convert an image sequence to a video. The latter assumes the FFMPEG is installed and available on your path. """ from __future__ import absolute_import, division, print_function import itertools from matplotlib.backends.backend_agg import Fi...
latture/dic
dic/video.py
Python
mit
7,111
# 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...
Huyuwei/tvm
topi/recipe/conv/test_conv2d_hwcn_map.py
Python
apache-2.0
3,208
# This file has to be run in pure Python mode! # Imports from the CO𝘕CEPT code from commons import * from snapshot import load import species # Absolute path and name of this test this_dir = os.path.dirname(os.path.realpath(__file__)) this_test = os.path.basename(os.path.dirname(this_dir)) # Read in data from the ...
jmd-dk/concept
test/multicomponent/analyze.py
Python
gpl-3.0
8,969
#!/usr/bin/env python # -*- coding: utf-8 -*- ######################################################################### # Copyright/License Notice (BSD License) # ######################################################################### ###################################################...
haxwithaxe/ddp
examples/xrproxy_server.py
Python
bsd-3-clause
11,364
# ______________________________________________________________________________ # ****************************************************************************** # ______________________________________________________________________________ # ***************************************************************************...
stack-of-tasks/sot-dyninv
python/2013_coursens/p105_demo_romeo.py
Python
lgpl-3.0
15,440
#! /usr/bin/python from __future__ import print_function from time import time # Project Euler # 39 def is_solution(a, b, c): return a ** 2 + b ** 2 == c ** 2 def find_solutions(p): solutions = [] for i in range(1, p - 2): for j in range(2, p - i - 2): k = p - i - j # this...
henry808/euler
039/eul039.py
Python
mit
1,017
# coding: utf-8 import sys import os import os.path import time import copy from flask import Flask, request, render_template, Response, abort, \ redirect, url_for, g, flash, session sys.path = ([sys.path[0]] + [os.path.join(os.path.dirname(__file__), "../lib")] + sys.path[1:]) import dat...
termoshtt/DataProcessor
server/webapp.py
Python
gpl-3.0
5,921
#!/usr/bin/env python # -*- coding: utf-8 -*- from setuptools import setup, find_packages setup( name = "crypto", version = "1.1.0", url = 'http://ondrejsika.com/docs/python-crypto', download_url = 'https://github.com/sikaondrej/python-crypto', license = 'GNU LGPL v.3', description = "Simply t...
inna92/python-crypto
setup.py
Python
lgpl-3.0
511
# -*- coding: utf-8 -*- from model.group import Group import pytest import allure # ТЕСТ # json_groups - берем данные из data\group.json # data_groups - берем данные из data\groups.py @allure.feature('Feature1') @allure.story('Story1') def test_create_group(app, db, json_groups): group = json_groups with pytes...
MaxDavion/Python_traning
test/test_add_group.py
Python
apache-2.0
1,364
# coding=utf-8 # -------------------------------------------------------------------------- # Code generated by Microsoft (R) AutoRest Code Generator 1.2.2.0 # Changes may cause incorrect behavior and will be lost if the code is # regenerated. # --------------------------------------------------------------------------...
lmazuel/azure-sdk-for-python
azure-mgmt-reservations/azure/mgmt/reservations/models/reservation_order_response.py
Python
mit
3,717
import pyb from pyb import I2C i2c = I2C(1) i2c2 = I2C(2) i2c.init(I2C.MASTER, baudrate=400000) print(i2c.scan()) i2c.deinit() # use accelerometer to test i2c bus accel_addr = 76 pyb.Accel() # this will init the bus for us print(i2c.scan()) print(i2c.is_ready(accel_addr)) print(i2c.mem_read(1, accel_addr, 7, tim...
warner83/micropython
tests/pyb/i2c.py
Python
mit
435
import json import re from datetime import datetime, timedelta from os import path, unlink from django.conf import settings from django.core.management.base import BaseCommand, CommandError import six import olympia.core.logger from olympia import amo from olympia.addons.models import Addon from olympia.stats.mode...
kumar303/addons-server
src/olympia/stats/management/commands/update_counts_from_file.py
Python
bsd-3-clause
13,457
# coding: utf-8 from __future__ import unicode_literals """ Yandex.Maps API wrapper """ import json from six import text_type, binary_type from six.moves.urllib.parse import urlencode from six.moves.urllib.request import urlopen STATIC_MAPS_URL = 'https://static-maps.yandex.ru/1.x/?' HOSTED_MAPS_URL = 'https://maps.y...
hovel/yandex-maps
yandex_maps/api.py
Python
mit
2,178
from setuptools import setup, find_packages setup( name="django-abtesting", version = "1.0", url='http://github.com/dalou/django-abtesting', license='BSD', platforms=['OS Independent'], description="A/B Testing module allow separate versionned templates and views.", setup_requires = [ ...
dalou/django-abtesting
setup.py
Python
gpl-2.0
998
#!/usr/bin/python # -*- coding: utf-8 -*- # # --- BEGIN_HEADER --- # # uploadprogress - Plain file upload progress monitor back end # Copyright (C) 2003-2014 The MiG Project lead by Brian Vinter # # This file is part of MiG. # # MiG is free software: you can redistribute it and/or modify # it under the terms of the GN...
heromod/migrid
mig/shared/functionality/uploadprogress.py
Python
gpl-2.0
5,743
# -*- coding: utf-8 -*- # Copyright(C) 2010-2011 Romain Bignon # # This file is part of weboob. # # weboob 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...
laurentb/weboob
weboob/applications/weboobcli/weboobcli.py
Python
lgpl-3.0
1,802
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright (c) 2004 Chris Liechti <cliechti@gmx.net> # All Rights Reserved. # Simplified BSD License (see LICENSE.txt for full text) """\ Using the MSP430 JTAG parallel port board as SPI interface. Requires Python 2+, ctypes and HIL.dll/libHIL.so """ import HIL #~ imp...
cetic/python-msp430-tools
msp430/jtag/hilspi.py
Python
bsd-3-clause
2,146
#!/usr/bin/python import base64 from Crypto.Cipher import DES3 secret = base64.decodestring('2x2X7sgphyw/K9CM6LSGQASgmWFAtKWkAA4+oP7bBdk=') password = base64.decodestring('/6g3lrMTok3Dp2HV++g0lg==') print DES3.new(secret[:24], DES3.MODE_CBC, secret[24:]).decrypt(password)
sysadmiral/sysadmiral-puppet-control
site/users/files/amo/binfiles/remmpw.py
Python
mit
276
# -*- coding: utf-8 -*- # Generated by Django 1.11.3 on 2017-08-14 08:21 from __future__ import unicode_literals from django.conf import settings import django.contrib.auth.models import django.contrib.auth.validators from django.db import migrations, models import django.db.models.deletion import django.utils.timezon...
unicef/un-partner-portal
backend/unpp_api/apps/account/migrations/0001_initial.py
Python
apache-2.0
3,754
#!/usr/bin/env python3 # -*- coding: utf8 -*- # TODO: Add args for WEBSITE_TO_TARGET import re import sys import urllib import webbrowser from bs4 import BeautifulSoup import requests HEADERS = {'User-Agent': 'Mozilla/5.0 (Windows NT 6.1; WOW64; rv:54.0) Gecko/20100101 Firefox/54.0'} URL_RANDOM = "https://www.meta...
Zar-rok/RandoMetal
RandoMetal.py
Python
mit
6,811
# This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at https://mozilla.org/MPL/2.0/. from django.http.response import Http404 from django.shortcuts import get_object_or_404 from django.views.generic impor...
mozilla/bedrock
bedrock/careers/views.py
Python
mpl-2.0
2,736
"""Simple CLI-builder Build interactive Command Line Interfaces, leaving the argument validation and parsing logic to the `argparse` Standard Library module. """ import sys import argparse def reraise(e): raise e #TODO: use ArgumentParser.add_subparsers to implement external CLIs instead class CLI(object): "...
anrosent/cli
cli.py
Python
mit
4,591
# Lint as: python3 # Copyright 2019 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 # # Unl...
zephyrproject-rtos/zephyr
samples/modules/tflite-micro/magic_wand/train/data_split_person_test.py
Python
apache-2.0
2,039
# Copyright (c) 2014 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 ...
samsu/neutron
tests/unit/ml2/drivers/mechanism_bulkless.py
Python
apache-2.0
872
import unittest from zope.testing import doctestunit from zope.component import testing from Testing import ZopeTestCase as ztc from Products.Five import zcml from Products.Five import fiveconfigure from Products.PloneTestCase import PloneTestCase as ptc from Products.PloneTestCase.layer import PloneSite ptc.setupPlo...
uwosh/uwosh.filariasis
uwosh/filariasis/tests.py
Python
gpl-2.0
1,472
# -*- coding: utf-8 -*- # vim: set expandtab tabstop=4 shiftwidth=4 : import sqlite3 class Database: def __init__(self, dbfile): self.database = sqlite3.connect(dbfile) # can be :memory: to run db in memory self.db = self.database.cursor() if not os.path.isfile(dbfile): se...
cmotc/Byzantium
distdns/records.py
Python
gpl-3.0
1,161
import sys def _f(): pass FunctionType = type(_f) assert isinstance(_f, FunctionType) LambdaType = type(lambda: None) # Same as FunctionType assert isinstance(lambda: None, LambdaType) CodeType = type(_f.__code__) assert isinstance(_f.__code__, CodeType) MappingProxyType = type(type.__dict__) assert isins...
Hasimir/brython
www/tests/test_types.py
Python
bsd-3-clause
1,373
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*- # vi: set ft=python sts=4 ts=4 sw=4 et: from PyQt4.QtCore import * from PyQt4.QtGui import * from froi.algorithm import imtool class ROIFilterDialog(QDialog): """ A dialog for action of intersection. """ last_mask_idx = 0 ...
liuzhaoguo/FreeROI
froi/gui/component/unused/roifilterdialog.py
Python
bsd-3-clause
4,860
from distutils import log import distutils.command.sdist as orig import os import sys import io import contextlib from setuptools.extern import six from .py36compat import sdist_add_defaults import pkg_resources _default_revctrl = list def walk_revctrl(dirname=''): """Find all files under revision control""" ...
pdxwebdev/yadapy
yada/lib/python2.7/site-packages/setuptools/command/sdist.py
Python
gpl-3.0
6,650
import pandas as pd import mymsms import os import myHAF import time import my_global_functions import matplotlib.pyplot as plt import numpy as np import matplotlib matplotlib.rc('text', usetex=True) matplotlib.rcParams['text.latex.preamble']=[r"\usepackage{amsmath}"] color_map = plt.cm.Set1(np.linspace(0, 1, 10)) imp...
airanmehr/bio
Scripts/Miscellaneous/Ali/ihs_nsl.py
Python
mit
2,295
# # 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...
Fokko/incubator-airflow
airflow/plugins_manager.py
Python
apache-2.0
11,711
''' Copyright (c) 2017 Vanessa Sochat 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...
pydicom/sendit
sendit/apps/main/views/batch.py
Python
mit
2,050
# Copyright (c) 2010-2013 OpenStack, 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 ...
NeCTAR-RC/swift
swift/obj/mem_server.py
Python
apache-2.0
4,239
#!/usr/bin/env python # -*- coding: utf-8 -*- """ test_txgeocodio ---------------------------------- Tests for `txgeocodio` module. """ from twisted.trial import unittest import txgeocodio class TestTxgeocodio(unittest.TestCase): def setUp(self): pass def tearDown(self): pass def te...
trenton42/txgeocodio
tests/test_txgeocodio.py
Python
bsd-3-clause
536
from __future__ import print_function import numpy as np import pandas as pd import regreg.api as rr from ...tests.flags import SET_SEED, SMALL_SAMPLES from ...tests.instance import logistic_instance from ...tests.decorators import (wait_for_return_value, set_seed_iftrue, ...
selective-inference/selective-inference
sandbox/randomized_tests/test_multiple_queries.py
Python
bsd-3-clause
11,009
# -*- coding: utf-8 -*- # Generated by Django 1.10.4 on 2017-02-09 08:55 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('api', '0017_mentorinfo_availability'), ] operations = [ migrations.AddField...
andrewsosa/hackfsu_com
api/api/migrations/0018_hackathonsponsor_on_mobile.py
Python
apache-2.0
466
""" Created on 9 Nov 2012 @author: plish """ class TrelloObject(object): """ This class is a base object that should be used by all trello objects; Board, List, Card, etc. It contains methods needed and used by all those objects and masks the client calls as methods belonging to the object. """ ...
Oksisane/RSS-Bot
Trolly-master/trolly/trelloobject.py
Python
gpl-3.0
3,944
# Copyright (c) 2014 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 required by applicable law or agreed to in writing, so...
mirrorcoder/CloudFerry
cloud/os2os.py
Python
apache-2.0
18,523
# -*- coding: utf-8 -*- """Model unit tests.""" import datetime as dt import pytest from fm_database.models.user import Role, User from .factories import UserFactory @pytest.mark.usefixtures("tables") class TestUser: """User tests.""" @staticmethod def test_get_by_id(): """Get user by ID.""" ...
nstoik/farm_monitor
api/tests/test_models.py
Python
apache-2.0
2,089
#!/usr/bin/env python # Copyright (c) 2014 Wladimir J. van der Laan # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. ''' Run this script from the root of the repository to update all translations from transifex. It will do the follo...
CrimsonDev14/crimsoncoin
contrib/devtools/update-translations.py
Python
lgpl-3.0
8,075
# # Copyright (c) 2006 rPath, Inc. # # This program is distributed under the terms of the Common Public License, # version 1.0. A copy of this license should have been distributed with this # source file in a file called LICENSE. If it is not present, the license # is always available at http://www.opensource.org/licen...
abelboldu/nagpy-pushover
nagpy/util/mail.py
Python
epl-1.0
2,039
import gettext as gettext_module import importlib import json import os from django import http from django.apps import apps from django.conf import settings from django.template import Context, Engine from django.utils import six from django.utils._os import upath from django.utils.encoding import smart_te...
diego-d5000/MisValesMd
env/lib/python2.7/site-packages/django/views/i18n.py
Python
mit
11,359
# -*- coding: utf-8 -*- import 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 'Payment.payment_state' db.add_column(u'payment_payment', 'payment_state', ...
zionist/mon
mon/apps/payment/migrations/0004_auto__add_field_payment_payment_state.py
Python
bsd-3-clause
20,627
# # Copyright (C) 2012-2014 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 option) any later version. # This program is distributed in the hope that it wi...
vathpela/anaconda
pyanaconda/ui/gui/xkl_wrapper.py
Python
gpl-2.0
15,362
""" ============== Non-linear SVM ============== Perform binary classification using non-linear SVC with RBF kernel. The target to predict is a XOR of the inputs. The color map illustrates the decision function learned by the SVC. """ print(__doc__) import numpy as np import matplotlib.pyplot as plt from sklearn imp...
glemaitre/scikit-learn
examples/svm/plot_svm_nonlinear.py
Python
bsd-3-clause
1,136
''' New Integration Test for resizing root volume. @author: czhou25 ''' import zstackwoodpecker.test_util as test_util import zstackwoodpecker.test_state as test_state import zstackwoodpecker.test_lib as test_lib import zstackwoodpecker.operations.resource_operations as res_ops import zstackwoodpecker.ope...
zstackorg/zstack-woodpecker
integrationtest/vm/multihosts/volumes/test_snapshot_resize_vm.py
Python
apache-2.0
1,782
# Xlib.protocol.__init__ -- glue for Xlib.protocol package # # Copyright (C) 2000 Peter Liljenberg <petli@ctrl-c.liu.se> # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public License # as published by the Free Software Foundation; either versio...
cristian99garcia/xjoy
xevents/Xlib/protocol/__init__.py
Python
gpl-3.0
951
from pybindgen import Module, FileCodeSink, param, retval, cppclass, typehandlers import pybindgen.settings import warnings class ErrorHandler(pybindgen.settings.ErrorHandler): def handle_error(self, wrapper, exception, traceback_): warnings.warn("exception %r in wrapper %s" % (exception, wrapper)) ...
hanyassasa87/ns3-802.11ad
src/csma/bindings/modulegen__gcc_LP64.py
Python
gpl-2.0
475,193
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # Copyright 2017-2022 F4PGA Authors # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unl...
SymbiFlow/fasm
docs/conf.py
Python
isc
7,055
from django.conf.urls import url from django.contrib.auth.decorators import login_required from apps.employees import ajax from . import views urlpatterns = ( url(r'^home/$', login_required(views.home), name="employee_home_redirect"), url(r'^(?P<pk>[\d]+)/$', login_required(views.EmployeeDetail.as_view()), na...
lmann4/cis526-final-project
resource_management/apps/employees/urls.py
Python
mit
807
#!/usr/bin/env python ## \file tools.py # \brief mesh functions # \author Trent Lukaczyk, Aerospace Design Laboratory (Stanford University) <http://su2.stanford.edu>. # \version 2.0.6 # # Stanford University Unstructured (SU2) Code # Copyright (C) 2012 Aerospace Design Laboratory # # This program is free software:...
AmritaLonkar/trunk
SU2_PY/SU2/mesh/tools.py
Python
gpl-2.0
11,442
from .utils import Impl
comp-imaging/ProxImaL
proximal/utils/__init__.py
Python
mit
24
from setuptools import setup setup( name='Flask-SubdomainDevserver', version='0.1.1', url='http://github.com/saltycrane/flask-subdomaindevserver/', license='BSD', author='Eliot', author_email='saltycrane@gmail.com', description='Flask subdomain devserver', py_modules=['subdomaindevser...
saltycrane/flask-subdomaindevserver
setup.py
Python
bsd-3-clause
848
""" WSGI config for metabotnik project. It exposes the WSGI callable as a module-level variable named ``application``. For more information on this file, see https://docs.djangoproject.com/en/1.6/howto/deployment/wsgi/ """ import os os.environ.setdefault("DJANGO_SETTINGS_MODULE", "metabotnik.settings") from django....
epoz/metabotnik
src/metabotnik/wsgi.py
Python
mit
395
import pyaf.Bench.TS_datasets as tsds import tests.artificial.process_artificial_dataset as art art.process_dataset(N = 128 , FREQ = 'D', seed = 0, trendtype = "MovingMedian", cycle_length = 7, transform = "Integration", sigma = 0.0, exog_count = 100, ar_order = 0);
antoinecarme/pyaf
tests/artificial/transf_Integration/trend_MovingMedian/cycle_7/ar_/test_artificial_128_Integration_MovingMedian_7__100.py
Python
bsd-3-clause
270
import datetime import json import re import sys import lxml.etree from lxml.etree import tostring from itertools import izip from billy.scrape.bills import Bill, BillScraper from billy.scrape.votes import Vote from openstates.utils import LXMLMixin #Skip Amendment for now, data is included in Bill entry _scrapable_...
cliftonmcintosh/openstates
openstates/vi/bills.py
Python
gpl-3.0
11,961
# Copyright (c) 2015 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 required by applicable law or agreed to in writin...
stevelle/glance
glance/tests/unit/common/test_semver.py
Python
apache-2.0
3,342
from distutils.core import Extension def get_extension(): return Extension( 'japronto.request.crequest', sources=['crequest.c', '../response/cresponse.c', '../router/match_dict.c', '../capsule.c'], include_dirs=['../../picohttpparser', '..', '../respo...
squeaky-pl/japronto
src/japronto/request/crequest_ext.py
Python
mit
387
from zope.interface import implements from axiom.item import Item, declareLegacyItem, POWERUP_BEFORE from axiom import attributes from axiom.upgrade import (registerAttributeCopyingUpgrader, registerUpgrader) from axiom.dependency import dependsOn from xmantissa import ixmantissa, prefs, we...
twisted/quotient
xquotient/quotientapp.py
Python
mit
5,429
# Copyright 2014 Cloudbase Solutions Srl # # 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...
alexpilotti/cloudbase-init
cloudbaseinit/utils/debiface.py
Python
apache-2.0
4,319
import Tkinter as tk import re class CustomText(tk.Text): def __init__(self, *args, **kwargs): tk.Text.__init__(self, *args, **kwargs) self.tk.eval(''' proc widget_proxy {widget widget_command args} { # call the real tk widget command with the real args...
cbustamantegarres/Regstyle
PythonExample.py
Python
gpl-3.0
9,074
from __future__ import division, absolute_import, unicode_literals from functools import partial from qtpy import QtGui from qtpy.QtCore import Qt from qtpy import QtWidgets from ..i18n import N_ from ..widgets import standard from ..qtutils import get from .. import icons from .. import qtutils from .toolbarcmds imp...
AndiDog/git-cola
cola/widgets/toolbar.py
Python
gpl-2.0
15,536
import post as posts import user import thread as threads from util.StringBuilder import * from api_helpers.common_helper import * from api_helpers.user_helper import get_id_by_email def create(ds, **args): required(['name', 'short_name', 'user'], args) user_id = get_id_by_email(ds, args['user']) #ds.cl...
igorcoding/forum-api
api/forum.py
Python
mit
2,579
import importlib from .devices.api_interface import IoDeviceApi # TODO: Make this dynamic I2C = IoDeviceApi.I2C def get_device(dev_type, flags=None): device_impl_module = importlib.import_module('.devices.%s' % dev_type, __name__) device_impl_class_name = dev_type.title().replace('_','') + 'IoDevice' de...
sgnn7/sgfc
io_dev/sgfc_io/__init__.py
Python
lgpl-2.1
417
""" Demonstration Bokeh app of how to register event callbacks in both Javascript and Python using an adaptation of the color_scatter example from the bokeh gallery. This example extends the js_events.py example with corresponding Python event callbacks. """ import numpy as np from bokeh.io import curdoc from bokeh.p...
dennisobrien/bokeh
examples/howto/events_app.py
Python
bsd-3-clause
5,564
"""Read and write configuration settings """ from milc import cli def print_config(section, key): """Print a single config setting to stdout. """ cli.echo('%s.%s{fg_cyan}={fg_reset}%s', section, key, cli.config[section][key]) def show_config(): """Print the current configuration to stdout. """ ...
kmtoki/qmk_firmware
lib/python/qmk/cli/config.py
Python
gpl-2.0
3,720
import socket from NEGRAV import * ###################### FUNCTIONS FOR BASE STATION ############################## def server_listening(): s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) s.bind(('',TCP_PORT_SERVER)) s.listen(1) conn, address = s.accept() data = conn.recv (BUFFER_SIZE) #Aca va el parser? ...
Nickiler531/NEGRAV_implemetation
src/socket-functions.py
Python
gpl-3.0
1,273
#from distutils.core import setup import setuptools setuptools.setup( name = 'p3270', packages = ['p3270'], version = '0.1.3', description = 'Python library to communicate with IBM hosts', author = 'Mossaab Stiri', author_email = 'mossaab.stiri@gmail.com', url = ...
mstiri/p3270
setup.py
Python
gpl-3.0
1,698
# -*- coding: utf-8 -*- import configparser import enum import logging import os import re from datetime import datetime from typing import Dict from django.core.exceptions import ValidationError from django.core.validators import MaxLengthValidator, RegexValidator from django.db import models from django.db.models i...
Nitrate/Nitrate
src/tcms/issuetracker/models.py
Python
gpl-2.0
24,620
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2016 Michael Gruener <michael.gruener@chaosmoon.net> # 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_versio...
kvar/ansible
lib/ansible/modules/crypto/acme/acme_certificate_revoke.py
Python
gpl-3.0
10,293
import numpy as np from scipy.signal import decimate l = range(128) print l def downsample(l, factor): chunks = len(l)/factor new_l = [] for i in range(chunks): idx = i * factor new_l.append(sum(l[idx:idx+factor])/factor) return new_l print downsample(l, 32)
Falaina/pypgf
pypgf/interp.py
Python
cc0-1.0
287
import numpy as np from gym.spaces import Box from metaworld.envs import reward_utils from metaworld.envs.asset_path_utils import full_v2_path_for from metaworld.envs.mujoco.sawyer_xyz.sawyer_xyz_env import SawyerXYZEnv, _assert_task_is_set from scipy.spatial.transform import Rotation class SawyerPegInsertionSideEnv...
rlworkgroup/metaworld
metaworld/envs/mujoco/sawyer_xyz/v2/sawyer_peg_insertion_side_v2.py
Python
mit
7,286
#!/usr/bin/env python2 """Trains a CNN using Keras. Includes a bunch of fancy stuff so that you don't lose your work when you Ctrl + C.""" from argparse import ArgumentParser, ArgumentTypeError import datetime from itertools import groupby from json import dumps import logging from logging import info, warn from os i...
qxcv/joint-regressor
keras/train.py
Python
apache-2.0
27,660
#!/usr/bin/env python # # Copyright (c) 2015 Intel Corporation. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # * Redistributions of works must retain the original copyright notice, this # list of conditions and t...
kangxu/crosswalk-test-suite
apptools/apptools-ios-tests/apptools/CI/manifest_basic.py
Python
bsd-3-clause
2,784
#!/usr/bin/env python #============================================================================ # P Y I B E X # File : test_Bsc.cpp # Author : Benoit Desrochers # Copyright : Benoit Desrochers # License : See the LICENSE file # Created : Dec 28, 2014 #===========...
msis/pyIbex
tests/test_Bsc.py
Python
lgpl-3.0
1,034
#!/usr/bin/python3 # Copyright 2016 Francisco Pina Martins <f.pinamartins@gmail.com> # This file is part of layer_data_extractor. # layer_data_extractor 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 ...
StuntsPT/Misc_GIS_scripts
simple_coordinate_converter.py
Python
gpl-3.0
2,069
""" A test spanning all the capabilities of all the serializers. This class sets up a model for each model field type (except for image types, because of the Pillow dependency). """ from django.contrib.contenttypes.fields import ( GenericForeignKey, GenericRelation, ) from django.contrib.contenttypes.models import...
devops2014/djangosite
tests/serializers_regress/models.py
Python
bsd-3-clause
8,282
import searchFiles import EnglishFile def compareEngFilesAux(enFile, tokenList, listNotUsed): while 1: token = enFile.getNextToken() if token: if not token in tokenList: listNotUsed.append(token) else: return listNotUsed def c...
pearltrees/tree-shape-visualization
tools/languageSynchronizer/compareEngFiles.py
Python
mit
1,413
def hackathon_specifics(request): return {'HACKATHON_NAME': 'MadHacks'}
austinhartzheim/madhacks-live
madhacks/context_processors.py
Python
mit
76
# # (c) 2017 Red Hat Inc. # # 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 later version. # # Ansible is d...
dagwieers/ansible
lib/ansible/plugins/cliconf/exos.py
Python
gpl-3.0
9,931
# -*- coding: utf-8 -*- import re from jinja2 import Environment from .observable import Observable def get_attribute(render_data, variable): levels = variable.split('.') r = render_data for level in levels: if hasattr(r, level): r = getattr(r, level) else: r = r.ge...
soasme/riotpy
riot/template.py
Python
mit
1,172
from graph_explorer import structured_metrics import testhelpers def test_parse_count_and_rate(): s_metrics = structured_metrics.StructuredMetrics() s_metrics.load_plugins() tags_base = { 'n1': 'foo', 'n2': 'req', 'plugin': 'catchall_statsd', 'source': 'statsd', } ...
vimeo/graph-explorer
graph_explorer/test/test_structured_metrics_plugin_catchall_statsd.py
Python
apache-2.0
4,466
import dbus CONNMAN_OBJECT_PATH = 'net.connman' bus = dbus.SystemBus() def is_technology_available(technology): if get_technology_info(technology) is not None: return True return False def is_technology_enabled(technology): if get_technology_info(technology) is not None: technology_di...
ActionAdam/osmc
package/mediacenter-addon-osmc/src/script.module.osmcsetting.networking/resources/lib/connman.py
Python
gpl-2.0
1,951
## Copyright 2008-2013 Luc Saffre ## This file is part of the Lino project. ## Lino 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 ver...
MaxTyutyunnikov/lino
lino/modlib/contacts/__init__.py
Python
gpl-3.0
979
# Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. # SPDX-License-Identifier: Apache-2.0 from .models import IDifferentiable # noqa: F401 from .models import IJointlyDifferentiable # noqa: F401 from .models import IModel # noqa: F401 from .models import IModelWithNoise # noqa: F401 from .mo...
EmuKit/emukit
emukit/core/interfaces/__init__.py
Python
apache-2.0
368
from django.db import models class Question(models.Model): question_text = models.CharField(max_length=200) pub_date = models.DateTimeField('date published') slug = models.CharField(max_length=10, unique=True, default="question") def __str__(self): return self.ques...
chfw/django-excel
polls/models.py
Python
bsd-3-clause
579
''' Copyright 2016, EMC, Inc. Author(s): George Paulos This script load SKU packs from sources specified in global_config.json. ''' import os import sys import subprocess # set path to common libraries sys.path.append(subprocess.check_output("git rev-parse --show-toplevel", shell=True).rstrip("\n") + "/test/common"...
tldavies/RackHD
test/util/load_sku_packs.py
Python
apache-2.0
3,381
# Support for the Media RSS format # Copyright 2010-2015 Kurt McKee <contactme@kurtmckee.org> # Copyright 2002-2008 Mark Pilgrim # All rights reserved. # # This file is a part of feedparser. # # Redistribution and use in source and binary forms, with or without modification, # are permitted provided that the following ...
coderbone/SickRage
lib/feedparser/namespaces/mediarss.py
Python
gpl-3.0
5,377
from bs4 import BeautifulSoup as BS import Util def clean_story(file_name): print('Processing story ' + file_name) # extract the basic data out of html flags with open(file_name) as f: soup = BS(''.join(f.readlines()), 'html.parser') title = soup.title.text parser = Util.Parser() parser.skip_non_empty_attrs ...
daphnei/nn_chatbot
story_corpus/rft/clean_story.py
Python
mit
428
""" soupselect.py - https://code.google.com/p/soupselect/ CSS selector support for BeautifulSoup. soup = BeautifulSoup('<html>...') select(soup, 'div') - returns a list of div elements select(soup, 'div#main ul a') - returns a list of links inside a ul inside div#main """ import re from bs4 import BeautifulSoup t...
devilry/devilry-django
devilry/project/develop/testhelpers/soupselect.py
Python
bsd-3-clause
5,265