code
stringlengths
2
1.05M
repo_name
stringlengths
5
104
path
stringlengths
4
251
language
stringclasses
1 value
license
stringclasses
15 values
size
int32
2
1.05M
# -*- coding: utf-8 -*- ###################################################################### # # Note: Program metadata is available in /__init__.py # ###################################################################### { "name" : "Product Documents", "version" : "1.8", "author" : "Ursa Information S...
raycarnes/odoo-8.0-dev
product_documents/__openerp__.py
Python
agpl-3.0
1,119
#!/usr/bin/env python ''' Wikipath Extension for Python-Markdown ====================================== Converts [Link Name](wiki:ArticleName) to relative links pointing to article. Requires Python-Markdown 2.0+ Basic usage: >>> import markdown >>> text = "Some text with a [Link Name](wiki:ArticleName)." ...
devs1991/test_edx_docmode
venv/lib/python2.7/site-packages/wiki/plugins/links/mdx/djangowikilinks.py
Python
agpl-3.0
5,397
# -*- coding: utf-8 -*- # (c) 2015 Alfredo de la Fuente - AvanzOSC # License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html from openerp import models, fields, api from dateutil.relativedelta import relativedelta class ProcurementOrder(models.Model): _inherit = 'procurement.order' @api.multi def ...
Eficent/odoomrp-wip
procurement_plan/models/procurement.py
Python
agpl-3.0
5,962
from __future__ import unicode_literals from datetime import date from django.db import migrations def create_calendar_events_propositions(apps, schema_editor): data_years_to_create = [2019, 2020, 2021, 2022, 2023, 2024, 2025] for year in data_years_to_create: academic_year_mdl = apps.get_model("bas...
uclouvain/OSIS-Louvain
base/migrations/0500_create_events_creation_and_end_date_proposition.py
Python
agpl-3.0
7,361
from ..utils import * ## # Minions class OG_149: "Ravaging Ghoul" play = Hit(ALL_MINIONS - SELF, 1) class OG_218: "Bloodhoof Brave" enrage = Refresh(SELF, buff="OG_218e") OG_218e = buff(atk=3) class OG_220: "Malkorok" play = Summon(CONTROLLER, RandomWeapon()) class OG_312: "N'Zoth's First Mate" play =...
beheh/fireplace
fireplace/cards/wog/warrior.py
Python
agpl-3.0
781
from controller.controllable import Controllable class BioSignal(Controllable): """ Biosignal is a Controllabe object that can update itself with incoming signal samples, and process these signals. """ def __init__(self): super(BioSignal, self).__init__() # CONSTANTS------...
neurotechuoft/MindType
Code/V1/src/deprecated/biosignals/biosignal.py
Python
agpl-3.0
749
#!/usr/bin/env python3 import json import sys results = { 'success': 1, 'stix': 0, 'cybox': 0, 'mixbox': 0, 'maec': 0, 'pymisp': 0 } try: import pymisp results['pymisp'] = pymisp.__version__ except Exception: results['success'] = 0 try: import stix results['stix'] = stix.__...
Rafiot/MISP
app/files/scripts/stixtest.py
Python
agpl-3.0
927
# Generated by Django 3.0.4 on 2020-07-21 14:59 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('errata', '0044_auto_20200714_1429'), ] operations = [ migrations.AlterField( model_name='errata', name='resource', ...
openstax/openstax-cms
errata/migrations/0045_auto_20200721_0959.py
Python
agpl-3.0
881
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. import base64 import logging from odoo import _, api, fields, models, tools from odoo.exceptions import UserError _logger = logging.getLogger(__name__) class MailTemplate(models.Model): "Templates for sending em...
rven/odoo
addons/mail/models/mail_template.py
Python
agpl-3.0
15,133
# -*- coding: utf-8 -*- ############################################################################## # # Author: Nicolas Bessi # Copyright 2015 Camptocamp SA # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as # publi...
BT-aestebanez/l10n-switzerland
l10n_ch_payment_slip_layouts/__openerp__.py
Python
agpl-3.0
1,561
############################################################################ # # OSIS stands for Open Student Information System. It's an application # designed to manage the core business of higher education institutions, # such as universities, faculties, institutes and professional schools. # The core bu...
uclouvain/OSIS-Louvain
base/tests/factories/education_group_certificate_aim.py
Python
agpl-3.0
2,003
""" Views for the course home page. """ from django.core.urlresolvers import reverse from django.template.context_processors import csrf from django.template.loader import render_to_string from django.utils.decorators import method_decorator from django.views.decorators.cache import cache_control from django.views.dec...
lduarte1991/edx-platform
openedx/features/course_experience/views/course_home.py
Python
agpl-3.0
9,522
from __future__ import print_function from subprocess import PIPE, Popen import re import sys PY3 = sys.version_info[0] == 3 modules = { 'base': { 'depends': ['_unsafe'], 'classes': [ 'ELJClient', 'ELJConnection', 'ELJLocale', ...
kenz-gelsoft/wxRust
src/codegen.py
Python
lgpl-2.1
72,999
# 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.main import SpackCommand spack_test = SpackCommand('unit-test') cmd_test_py = 'lib/spack/spack/test/cmd/unit_t...
iulian787/spack
lib/spack/spack/test/cmd/unit_test.py
Python
lgpl-2.1
3,404
############################################################################## # Copyright (c) 2013-2018, Lawrence Livermore National Security, LLC. # Produced at the Lawrence Livermore National Laboratory. # # This file is part of Spack. # Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved. # LLNL-CODE-64...
EmreAtes/spack
var/spack/repos/builtin/packages/openblas/package.py
Python
lgpl-2.1
8,415
# # images driver for migration (without FS transfer) # import os import tempfile import tarfile import time import shutil import time import threading import util import criu_api def_path = "/var/local/p.haul-fs/" class opendir: def __init__(self, path): self._dirname = path self._dirfd = os.open(path, os.O_DI...
marcosnils/p.haul
phaul/images.py
Python
lgpl-2.1
3,843
# 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) class PyKerberos(PythonPackage): """This Python package is a high-level wrapper for Kerberos (GSSAPI) operations....
iulian787/spack
var/spack/repos/builtin/packages/py-kerberos/package.py
Python
lgpl-2.1
927
#!/usr/bin/env python # encoding: utf8 # # Copyright © Burak Arslan <burak at arskom dot com dot tr>, # Arskom Ltd. http://www.arskom.com.tr # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are ...
plq/spyne
examples/async_.py
Python
lgpl-2.1
3,621
# Copyright 2012-2013 Greg Horn # # This file is part of rawesome. # # rawesome 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. ...
ghorn/rawesome
rawe/runnmpc.py
Python
lgpl-3.0
2,000
#!/usr/bin/env python3 """ This module contains helper functions to ease various tasks. """ import os from datetime import datetime def get_path_relative_to_module(module_file_path, relative_target_path): """ Calculate a path relative to the specified module file. :param module_file_path: The file path...
christoffkok/auxi.0
src/core/helpers.py
Python
lgpl-3.0
920
import logging import importlib from .. import settings from .container import list_containers logger = logging.getLogger(__name__) def get_enabled_backend(): return importlib.import_module(settings.BACKEND) def get_myaas_containers(): return filter(_is_database_container, list_containers()) def list_da...
habitissimo/myaas
src/myaas/utils/database.py
Python
lgpl-3.0
1,350
from ._config import Config as _Config # default config instance config = _Config()
markovmodel/PyEMMA
pyemma/util/__init__.py
Python
lgpl-3.0
85
from socket import gethostname from django.utils.translation import ugettext_lazy as _ from mezzanine.conf import register_setting #################################################################### # This first set of settings already exists in Mezzanine but can # # be overridden or appended to here with Cart...
orlenko/bccf
src/cartridge/shop/defaults.py
Python
unlicense
9,380
# IMDb lookup plugin by Ghetto Wizard (2011). from __future__ import unicode_literals from util import hook, http # http://www.omdbapi.com/apikey.aspx @hook.api_key('omdbapi') @hook.command def imdb(inp, api_key=None): '''.imdb <movie> -- gets information about <movie> from IMDb''' if not api_key: r...
crisisking/skybot
plugins/imdb.py
Python
unlicense
1,014
import os import yaml DEFAULT_JIRA_SERVER = "https://jira.mongodb.org" DEFAULT_BB_CONFIG = "~/.buildbaron.yaml" def jira_server(): return DEFAULT_JIRA_SERVER def jira_user(): if os.getenv("JIRA_USER_NAME") is not None: return os.getenv("JIRA_USER_NAME") file = os.path.expanduser(DEFAULT_BB_CO...
markbenvenuto/buildbaron
analyzer/analyzer_config.py
Python
apache-2.0
791
# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # d...
tbachman/group-based-policy
gbpservice/neutron/services/grouppolicy/drivers/extensions/proxy_group_driver.py
Python
apache-2.0
4,986
from django.conf.urls import patterns, include, url from django.views.generic import RedirectView from . import views urlpatterns = patterns('', (r'^$', RedirectView.as_view(url='hello/')), (r'^hello/', views.hello), )
j00bar/django-widgy
demo/demo_url/urls.py
Python
apache-2.0
229
from django.contrib.postgres import search from django.db import models from unravel import models as app_models class DocumentVersion(app_models.BaseModel): """A Document version.""" CONTENT_TEXT_LANGUAGES = ( ('english', 'English Language'), ('danish', 'Danish Language'), ('dutch',...
cofiem/legalosity
unravel/models/document_version.py
Python
apache-2.0
2,490
"""This component provides basic support for Foscam IP cameras.""" import logging import voluptuous as vol from homeassistant.components.camera import ( Camera, PLATFORM_SCHEMA, SUPPORT_STREAM) from homeassistant.const import ( CONF_NAME, CONF_USERNAME, CONF_PASSWORD, CONF_PORT) from homeassistant.helpers imp...
aequitas/home-assistant
homeassistant/components/foscam/camera.py
Python
apache-2.0
3,746
# Copyright 2017 Battelle Energy Alliance, 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 t...
joshua-cogliati-inl/raven
framework/SupervisedLearning/ScikitLearn/LinearModel/PassiveAggressiveRegressor.py
Python
apache-2.0
8,083
from hazelcast.serialization.bits import * from hazelcast.protocol.client_message import ClientMessage from hazelcast.protocol.custom_codec import * from hazelcast.util import ImmutableLazyDataList from hazelcast.protocol.codec.ringbuffer_message_type import * REQUEST_TYPE = RINGBUFFER_CAPACITY RESPONSE_TYPE = 103 RET...
cangencer/hazelcast-python-client
hazelcast/protocol/codec/ringbuffer_capacity_codec.py
Python
apache-2.0
1,052
#!/usr/bin/python # # Copyright (c) 2014 Juniper Networks, Inc. All rights reserved. # from optparse import OptionParser import subprocess import os import glob import platform import ConfigParser import socket import requests from StringIO import StringIO from lxml import etree from sandesh_common.vns.constants impor...
tcpcloud/contrail-controller
src/config/utils/contrail-status.py
Python
apache-2.0
16,711
import os import sys import re root = sys.argv[1] s = 'scripts' v = 'views' for r, subfolders, files in os.walk(root): for filename in files: path = os.path.join(r, filename) with open(path, 'r+') as f: lines = f.readlines() f.seek(0) f.truncate() for line in lines: newline =...
zanthrash/deck-1
templates.py
Python
apache-2.0
873
#!/bin/sh - # Copyright 2011,2012,2013 James McCauley # # 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 la...
5GExchange/escape
pox/pox/boot.py
Python
apache-2.0
18,000
# Copyright (c) 2014 Clinton Knight. 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 requir...
rakeshmi/cinder
cinder/tests/unit/volume/drivers/netapp/test_common.py
Python
apache-2.0
4,731
# 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 applicable law or agreed to in...
mikalstill/nova
nova/tests/functional/notification_sample_tests/test_service.py
Python
apache-2.0
7,352
# Copyright (C) 2015 Google Inc., authors, and contributors <see AUTHORS file> # Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file> # Created By: anze@reciprocitylabs.com # Maintained By: anze@reciprocitylabs.com scope = "Audit" description = """ The permissions required by an auditor to ac...
hyperNURb/ggrc-core
src/ggrc_basic_permissions/roles/Auditor.py
Python
apache-2.0
1,386
import unittest import csv import random from amaasutils.random_utils import random_string from amaascore.csv_upload.data import Uploader class EquityUploaderTest(unittest.TestCase): def setUp(self): self.longMessage = True # Print complete error message on failure self.asset_manager_id = self.c...
nedlowe/amaas-core-sdk-python
tests/unit/csv_upload/assets/equity.py
Python
apache-2.0
1,564
"""The tests for the sun automation.""" from datetime import datetime from unittest.mock import patch import pytest from homeassistant.components import sun import homeassistant.components.automation as automation from homeassistant.const import ( ATTR_ENTITY_ID, ENTITY_MATCH_ALL, SERVICE_TURN_OFF, SE...
turbokongen/home-assistant
tests/components/sun/test_trigger.py
Python
apache-2.0
32,931
#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright (c) 2012 - Seweryn Dynerowicz, FUNDP. # 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 ...
sdynerow/Semirings-Library
python/Metarouting/Algebra/Matrix.py
Python
apache-2.0
3,929
# Copyright 2010 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # 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 ...
NeCTAR-RC/cinder
cinder/db/base.py
Python
apache-2.0
1,344
# -*- coding: ascii -*- # # Copyright 2007-2012 # Andr\xe9 Malo or his licensors, as applicable # # 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-...
ndparker/wtf
wtf/app/services/static.py
Python
apache-2.0
12,288
import numpy as np import pandas as pd import seaborn as sns # pandas aware plotting library import xarray as xr np.random.seed(123) times = pd.date_range('2000-01-01', '2001-12-31', name='time') annual_cycle = np.sin(2 * np.pi * (times.dayofyear.values / 365.25 - 0.28)) base = 10 + 15 * annual_cycle.reshape(-1, 1...
jcmgray/xarray
doc/examples/_code/weather_data_setup.py
Python
apache-2.0
644
from a10sdk.common.A10BaseClass import A10BaseClass class SystemAuditLog(A10BaseClass): """This class does not support CRUD Operations please use parent. :param log_audit_data: {"type": "string", "format": "string"} :param log_audit_search: {"type": "string", "format": "string"} :param partition...
amwelch/a10sdk-python
a10sdk/core/sys/sys_audit_log_oper.py
Python
apache-2.0
2,455
#!/usr/bin/env python3 import logging import copy class BasicIRD(): """ """ BASIC_ATTR = ['register', 'unregister', 'generate_dir', 'generate', 'update'] ON_REGISTER = 'on_register' ON_UNREGISTER = 'on_unregister' ON_UPDATE = 'on_update' ON_GENERATE = 'on_generate' def __init__(self):...
snlab/alto-server
palto/ird/basicird.py
Python
apache-2.0
4,982
#!/usr/bin/env python import re import sys # # This script parses the stdout of zfstest, which has this format: # # Test: /path/to/testa (run as root) [00:00] [PASS] # Test: /path/to/testb (run as jkennedy) [00:00] [PASS] # Test: /path/to/testc (run as root) [00:00] [FAIL] # [...many more results...] # # Results Summ...
prakashsurya/openzfs-ci
jenkins/sh/run-zfstest/zfstest-report.py
Python
apache-2.0
4,787
import io import email from .parse_data_url import parse_data_url # DataResponse exposes the mediatype and emulates some methods/properties of # HTTPResponse: msg, headers, length, info, geturl, getheader and getheaders class DataResponse(io.BytesIO): __slots__ = 'url','mediatype','msg','headers','length' def...
tetherless-world/satoru
whyis/dataurl/data_response.py
Python
apache-2.0
1,069
from leapp.tags import Tag class ThirdPhaseTag(Tag): name = 'third_phase'
vinzenz/prototype
tests/data/workflow-tests/tags/thirdphase.py
Python
apache-2.0
80
"""Support for w800rf32 devices.""" import logging import voluptuous as vol from homeassistant.const import ( CONF_DEVICE, EVENT_HOMEASSISTANT_START, EVENT_HOMEASSISTANT_STOP, ) import homeassistant.helpers.config_validation as cv from homeassistant.helpers.dispatcher import dispatcher_send DATA_W800RF3...
Cinntax/home-assistant
homeassistant/components/w800rf32/__init__.py
Python
apache-2.0
1,663
#Licensed to the Apache Software Foundation (ASF) under one #or more contributor license agreements. See the NOTICE file #distributed with this work for additional information #regarding copyright ownership. The ASF licenses this file #to you under the Apache License, Version 2.0 (the #"License"); you may not use thi...
justinsb/avro
src/py/avro/ipc.py
Python
apache-2.0
13,687
from __future__ import unicode_literals import logging logger = logging.getLogger(__name__) from django.views.generic import ListView, DetailView, UpdateView, CreateView, DeleteView, TemplateView from django.views.generic.edit import ModelFormMixin from django.views.generic.detail import SingleObjectMixin from django...
SeattleAttic/HedyNet
HedyNet/profiles/views.py
Python
apache-2.0
17,748
# Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not use ...
apache/libcloud
libcloud/test/compute/test_elasticstack.py
Python
apache-2.0
10,355
# -*- cpy-indent-level: 4; indent-tabs-mode: nil -*- # ex: set expandtab softtabstop=4 shiftwidth=4: # # Copyright (C) 2008,2009,2010,2011,2012,2013 Contributor # # 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...
stdweird/aquilon
lib/python2.6/aquilon/aqdb/model/host_environment.py
Python
apache-2.0
2,255
# 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...
dmlc/tvm
tests/python/contrib/test_ethosu/cascader/test_ethosu_pooling_matcher.py
Python
apache-2.0
2,759
# Copyright 2015 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...
freedomtan/tensorflow
tensorflow/python/ops/math_ops.py
Python
apache-2.0
183,215
# # Copyright 2016 The BigDL 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 # # Unless required by applicable law or agreed to in ...
intel-analytics/BigDL
python/chronos/src/bigdl/chronos/autots/deprecated/preprocessing/impute/LastFill.py
Python
apache-2.0
1,278
#!/usr/bin/env python # # Copyright 2011-2015 Splunk, 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...
ww9rivers/splunk-sdk-python
examples/spcmd.py
Python
apache-2.0
4,531
from django.test import TestCase from unittest import skip class TestProvider(TestCase): @skip('Test OSF account to string') def test_to_string(self): pass @skip('Test extract common fields, mocking responses can be helpful') def test_extract_common_fields(self): pass @skip('Tes...
jnayak1/osf-meetings
meetings/osf_oauth2_adapter/tests.py
Python
apache-2.0
515
''' Copyright 2015 University of Auckland 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 agre...
alan-wu/neon
src/opencmiss/neon/ui/views/simulationview.py
Python
apache-2.0
2,229
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # # Copyright 2012 Red Hat, Inc # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 ...
maoy/zknova
nova/tests/fakeguestfs.py
Python
apache-2.0
4,077
# Copyright 2014 MongoDB, 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...
spencerjackson/mongo-orchestration
tests/__init__.py
Python
apache-2.0
1,011
# coding: utf-8 """ Kubernetes No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) OpenAPI spec version: v1.7.4 Generated by: https://github.com/swagger-api/swagger-codegen.git """ from pprint import pformat from six import iteritems import re ...
djkonro/client-python
kubernetes/client/models/v1_horizontal_pod_autoscaler_spec.py
Python
apache-2.0
7,143
from zerver.lib.actions import check_send_stream_message from zerver.lib.response import json_success from zerver.decorator import REQ, has_request_variables, api_key_only_webhook_view from zerver.models import UserProfile from django.http import HttpRequest, HttpResponse from typing import Dict, Any, Optional, Text ...
Galexrt/zulip
zerver/webhooks/gci/view.py
Python
apache-2.0
3,265
from django import forms import django from django.core.exceptions import ObjectDoesNotExist from django.forms.forms import BoundField from django.forms.models import ModelFormMetaclass, BaseInlineFormSet from django.utils.functional import cached_property from django.utils.translation import get_language from django.u...
ellmetha/django-parler
parler/forms.py
Python
apache-2.0
11,753
#!/usr/bin/env python # -*- coding: utf-8 -*- """Tests for the file entry implementation using the zipfile.""" import unittest from dfvfs.lib import definitions from dfvfs.path import factory as path_spec_factory from dfvfs.resolver import context from dfvfs.vfs import zip_file_entry from dfvfs.vfs import zip_file_sy...
joachimmetz/dfvfs
tests/vfs/zip_file_entry.py
Python
apache-2.0
14,776
#!/usr/bin/env python # -*- coding: utf-8 -*- __author__ = 'liuzhijun' import tornado from base import BaseHandler from models import JavaPost, PythonPost, Post class ItemListHandler(BaseHandler): @tornado.gen.coroutine def get(self): try: first_id = int(self.get_argument("f_id", None))...
liangmingjie/ImportNewAPI
handlers/item_service.py
Python
apache-2.0
1,519
#!/usr/bin/env python # # Cloudlet Infrastructure for Mobile Computing # # Author: Kiryong Ha <krha@cmu.edu> # # Copyright (C) 2011-2013 Carnegie Mellon 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 ob...
cmusatyalab/elijah-provisioning
test/misc/ec2_rapid.py
Python
apache-2.0
10,343
# -*- coding: utf-8 -*- # Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or...
googleapis/python-aiplatform
google/cloud/aiplatform_v1beta1/services/dataset_service/__init__.py
Python
apache-2.0
769
# -*- coding: utf-8 -*- from nose.tools import * # flake8: noqa from api.base.settings.defaults import API_BASE from website.models import NodeLog from framework.auth.core import Auth from tests.base import ApiTestCase from tests.factories import ( ProjectFactory, AuthUserFactory, UserFactory ) from te...
RomanZWang/osf.io
api_tests/nodes/views/test_node_contributors_list.py
Python
apache-2.0
68,958
# Generated by Django 3.0.9 on 2021-07-14 08:09 from django.db import migrations class Migration(migrations.Migration): dependencies = [ ("example", "0009_labresults_author"), ] operations = [ migrations.AlterModelOptions( name="labresults", options={"ordering": ...
django-json-api/rest_framework_ember
example/migrations/0010_auto_20210714_0809.py
Python
bsd-2-clause
347
# Test methods with long descriptive names can omit docstrings # pylint: disable=missing-docstring import unittest import numpy as np from Orange.data import Table, Domain, DiscreteVariable from Orange import preprocess from Orange.preprocess.score import InfoGain, GainRatio, Gini, Chi2, ANOVA,\ UnivariateLinear...
cheral/orange3
Orange/tests/test_score_feature.py
Python
bsd-2-clause
5,246
import uuid import pytest from django.core.exceptions import ImproperlyConfigured from django.utils.datastructures import MultiValueDict from rest_framework import serializers from rest_framework.fields import empty from rest_framework.test import APISimpleTestCase from .utils import ( BadType, MockObject, MockQ...
callorico/django-rest-framework
tests/test_relations.py
Python
bsd-2-clause
8,863
from batoid.trace import reflect from . import _batoid class Coating: """Class to control ray reflection/transmission at an `Interface`. Coatings can be used to split a ray into reflected/refracted components using `Surface.rSplit`, or control the transmission or reflection efficiency using `Surface....
jmeyers314/batoid
batoid/coating.py
Python
bsd-2-clause
3,076
from bs4 import BeautifulSoup def check_post_action(resp): mod = 'check_post_action' answer = "U" soup = BeautifulSoup(resp.text, 'lxml') found = soup.find_all('form', method = "post") if len(found) == 0: return answer, mod for action in found: a = action.get('action') if a: if 'php' not in a: a...
mjkim610/phishing-detection
phishing_detection/modules/check_post_action.py
Python
bsd-2-clause
384
print '... Importing simuvex/engines/vex/statements/abihint.py ...' from angr.engines.vex.statements.abihint import *
Ruide/angr-dev
simuvex/simuvex/engines/vex/statements/abihint.py
Python
bsd-2-clause
118
# -*- coding: utf-8 -*- import re from copy import deepcopy from time import time from django.conf import settings from django.core import signals from django.db.models import Q from django.db.models.base import ModelBase from django.utils import tree from django.utils.encoding import force_unicode from haystack.consta...
soad241/django-haystack
haystack/backends/__init__.py
Python
bsd-3-clause
24,704
""" sentry.tasks.activity ~~~~~~~~~~~~~~~~~~~~~ :copyright: (c) 2010-2015 by the Sentry Team, see AUTHORS for more details. :license: BSD, see LICENSE for more details. """ from __future__ import absolute_import import logging from sentry.utils.safe import safe_execute from sentry.tasks.base import instrumented_tas...
nicholasserra/sentry
src/sentry/tasks/activity.py
Python
bsd-3-clause
1,245
""" ============================================ Tuning a scikit-learn estimator with `skopt` ============================================ Gilles Louppe, July 2016 Katie Malone, August 2016 Reformatted by Holger Nahrstaedt 2020 .. currentmodule:: skopt If you are looking for a :obj:`sklearn.model_selection.GridSearc...
scikit-optimize/scikit-optimize.github.io
0.8/_downloads/88cba5cd0a3cd7c57cbd0a7201157e8f/hyperparameter-optimization.py
Python
bsd-3-clause
4,311
# Copyright 2015 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Provides the web interface for displaying an overview of alerts.""" import json from google.appengine.ext import ndb from dashboard import email_templa...
zeptonaut/catapult
dashboard/dashboard/alerts.py
Python
bsd-3-clause
6,450
#!/usr/bin/env python import threading import inspect import thread __all__ = ['dataflow_vars', 'spawn'] from var import var def dataflow_vars(func): argspec = inspect.getargspec(func) if any([x is not None for x in argspec[1:]]): raise ValueError( "dataflow_vars expects wrapped function " "to accept only n...
timbertson/py-dataflow
dataflow/dataflow.py
Python
bsd-3-clause
689
import os def up(config): os.system("apt-get install libzbar0 --yes") os.system("pip3 install pyzbar") os.system("pip3 install pdf2image") def down(config): pass
RCOS-Grading-Server/HWserver
migration/migrator/migrations/system/20181028021533_qr_codes.py
Python
bsd-3-clause
183
# Copyright 2012 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Provides stubs for os, sys and subprocess for testing This test allows one to test code that itself uses os, sys, and subprocess. """ import os import r...
mou4e/zirconium
tools/telemetry/telemetry/unittest_util/system_stub.py
Python
bsd-3-clause
15,429
from rest_framework import serializers from openbudgets.apps.international.utilities import translated_fields from openbudgets.apps.sheets import models from openbudgets.apps.accounts.serializers import AccountMin from openbudgets.commons.serializers import UUIDRelatedField from openbudgets.apps.entities.serializers im...
moshe742/openbudgets
openbudgets/apps/sheets/serializers.py
Python
bsd-3-clause
6,238
#!/usr/bin/env python import os.path import sys def gen_xmacro_add(): # the maximum number from which addition can happen i = 64 print("Generating rf_xmacro_add.h ...") f = open(os.path.dirname( sys.argv[0]) + "/../include/Preprocessor/rf_xmacro_add.h", "w") # put some required definition...
LefterisJP/refuclib
scripts/gen_rf_xmacro_add.py
Python
bsd-3-clause
1,245
# Licensed under a 3-clause BSD style license - see LICENSE.rst """ SOLARSYSTEM.IMCCE.MIRIADE ------------------------- :author: Michael Mommert (mommermiscience@gmail.com) """ from ....imcce import Miriade, MiriadeClass from . import *
ceb8/astroquery
astroquery/solarsystem/imcce/miriade/__init__.py
Python
bsd-3-clause
240
# Copyright (c) 2014, Salesforce.com, 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: # # - Redistributions of source code must retain the above copyright # notice, this list of conditions...
forcedotcom/distributions
update_license.py
Python
bsd-3-clause
4,062
# ----------------------------------------------------------------------------- # Copyright (c) 2014--, The Qiita Development Team. # # Distributed under the terms of the BSD 3-clause License. # # The full license is in the file LICENSE, distributed with this software. # ------------------------------------------------...
ElDeveloper/qiita
qiita_db/handlers/tests/test_artifact.py
Python
bsd-3-clause
15,319
# -*- coding: utf-8 -*- from contextlib import contextmanager from _pytest.python import FixtureRequest from mock import Mock from pyramid.httpexceptions import exception_response import pytest import simplejson # Parameterize pyramid_swagger.swagger_versions @pytest.fixture(params=[['1.2'], ['2.0'], ['1.2', '2.0']]...
brianthelion/pyramid_swagger
tests/acceptance/request_test.py
Python
bsd-3-clause
6,749
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('dailydigest', '0001_initial'), ] operations = [ migrations.CreateModel( name='InitialText', fields=[...
PyNSK/pynsk.ru
apps/dailydigest/migrations/0002_initialtext.py
Python
bsd-3-clause
1,032
"""Migration for the Submitty master database.""" def up(config, database): database.execute("ALTER TABLE emails DROP COLUMN IF EXISTS recipient") def down(config, database): database.execute("ALTER TABLE emails ADD COLUMN IF NOT EXISTS recipient VARCHAR(255)")
RCOS-Grading-Server/HWserver
migration/migrator/migrations/master/20190719144150_remove_email_recipient_column.py
Python
bsd-3-clause
274
""" Riemann zeta and related function. """ from sympy.core import Function, S, C, sympify, pi from sympy.core.function import ArgumentIndexError ############################################################################### ###################### LERCH TRANSCENDENT ##################################### ##############...
amitjamadagni/sympy
sympy/functions/special/zeta_functions.py
Python
bsd-3-clause
15,918
""" ============================================================================ Demonstration of multi-metric evaluation on cross_val_score and GridSearchCV ============================================================================ Multiple metric parameter search can be done by setting the ``scoring`` parameter to...
manhhomienbienthuy/scikit-learn
examples/model_selection/plot_multi_metric_evaluation.py
Python
bsd-3-clause
3,719
#!/usr/bin/env python # -*- coding: utf-8 -*- # ----------------------------------------------------------------------------- # # FreeType high-level python API - Copyright 2011 Nicolas P. Rougier # Distributed under the terms of the new BSD license. # # ---------------------------------------------------------------...
davidcox/freetype-py
examples/example_1.py
Python
bsd-3-clause
2,975
from nose.tools import eq_ from django.test import TestCase from django.contrib.auth.models import User from django.utils import timezone from django.core.urlresolvers import reverse from airmozilla.suggest.templatetags.jinja_helpers import ( next_url, state_description, truncate_url ) from airmozilla.main...
blossomica/airmozilla
airmozilla/suggest/tests/test_jinja_helpers.py
Python
bsd-3-clause
2,433
# Django settings for testprj project. from django.conf.global_settings import * from mongoengine import connect DEBUG = True TEMPLATE_DEBUG = DEBUG ADMINS = ( # ('Your Name', 'your_email@example.com'), ) MANAGERS = ADMINS DB = connect('test') TEST_RUNNER = 'testprj.tests.MongoengineDjangoTestSuiteRunner' # ...
stephrdev/django-mongoforms
testprj/settings.py
Python
bsd-3-clause
4,547
from __future__ import unicode_literals from django import forms from django.forms.util import flatatt from django.utils.safestring import mark_safe class AceWidget(forms.Textarea): def __init__(self, mode=None, theme=None, wordwrap=False, *args, **kwargs): self.mode = mode self.theme = theme ...
Osmose/snippets-service
vendor-local/lib/python/django_ace/widgets.py
Python
bsd-3-clause
1,380
# -*- coding: utf-8 -*- import time, random try: from unittest import _strclass except ImportError: _strclass = str from django import forms from django_any import any_form from django.test.client import Client as DjangoClient from django_any.contrib.auth import any_user from django.contrib.admin.helpers impo...
softak/webfaction_demo
vendor-local/lib/python/django_any/test.py
Python
bsd-3-clause
4,701
"""Metrics to assess performance on classification task given scores. Functions named as ``*_score`` return a scalar value to maximize: the higher the better. Function named as ``*_error`` or ``*_loss`` return a scalar value to minimize: the lower the better. """ # Authors: Alexandre Gramfort <alexandre.gramfort@inr...
glemaitre/scikit-learn
sklearn/metrics/_ranking.py
Python
bsd-3-clause
67,379
""" Use lldb Python SBWatchpoint API to set the ignore count. """ from __future__ import print_function import os import time import re import lldb from lldbsuite.test.decorators import * from lldbsuite.test.lldbtest import * from lldbsuite.test import lldbutil class WatchpointIgnoreCountTestCase(TestBase): m...
youtube/cobalt
third_party/llvm-project/lldb/packages/Python/lldbsuite/test/python_api/watchpoint/TestWatchpointIgnoreCount.py
Python
bsd-3-clause
3,552
from cms.apphook_pool import apphook_pool from cms.views import details from django.conf import settings from django.conf.urls import url, patterns if settings.APPEND_SLASH: reg = url(r'^(?P<slug>[0-9A-Za-z-_.//]+)/$', details, name='pages-details-by-slug') else: reg = url(r'^(?P<slug>[0-9A-Za-z-_.//]+)$', det...
pbs/django-cms
cms/test_utils/project/second_cms_urls_for_apphook_tests.py
Python
bsd-3-clause
822