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 |
|---|---|---|---|---|---|
from superdesk.tests import TestCase
from liveblog.blogs.embeds_utils import (
get_setting_value, build_css_selector,
compile_styles_map, convert_styles_map_to_css)
from liveblog.themes.tests.mock_settings import default_seo_theme
default_seo_theme_settings = {
"typography": {
"primary": "Mukta Vaa... | liveblog/liveblog | server/liveblog/blogs/tests/embed_utils_test.py | Python | agpl-3.0 | 3,169 |
# -*- coding: utf-8 -*-
# This file is part of wger Workout Manager.
#
# wger Workout Manager is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any ... | rolandgeider/pk15-orakel | utils/generic_views.py | Python | agpl-3.0 | 10,705 |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.21 on 2019-06-20 16:39
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("services", "0069_update_unitaccessibilityshortcomings"),
]
operations = [
... | City-of-Helsinki/smbackend | services/migrations/0070_longer_unit_data_source.py | Python | agpl-3.0 | 485 |
###########################################################################
# (C) Vrije Universiteit, Amsterdam (the Netherlands) #
# #
# This file is part of AmCAT - The Amsterdam Content Analysis Toolkit #
# ... | amcat/amcat | api/rest/viewsets/__init__.py | Python | agpl-3.0 | 2,395 |
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
from frappe import _
from frappe.utils import flt
from erpnext.accounts.report.financial_statements import (get_period_list, get_columns, ... | mahabuber/erpnext | erpnext/accounts/report/balance_sheet/balance_sheet.py | Python | agpl-3.0 | 2,015 |
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Stock Out Alert
# Copyright (C) 2013 Enterprise Objects Consulting
# http://www.eoconsulting.com.ar
# Authors: Mariano Ruiz <mrsarm@gmail.com>
#
# This program is free so... | iw3hxn/LibrERP | stock_out_alert/__init__.py | Python | agpl-3.0 | 1,087 |
"""
Test cases for Call Stack Manager
"""
from mock import patch
from django.db import models
from django.test import TestCase
from openedx.core.djangoapps.call_stack_manager import donottrack, CallStackManager, CallStackMixin
class ModelMixinCallStckMngr(CallStackMixin, models.Model):
"""
Test Model class w... | B-MOOC/edx-platform | openedx/core/djangoapps/call_stack_manager/tests.py | Python | agpl-3.0 | 8,202 |
# -*- encoding: utf-8 -*-
################################################################################
# #
# Copyright (C) 2013-Today Carlos Eduardo Vercelino - CLVsol #
# ... | CLVsol/odoo_addons | clv_person/__init__.py | Python | agpl-3.0 | 1,531 |
##############################################################################
# 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/gettext/package.py | Python | lgpl-2.1 | 4,056 |
##############################################################################
# Copyright (c) 2013-2017, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
# This file is part of Spack.
# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
# LLNL-CODE-64... | skosukhin/spack | lib/spack/spack/test/make_executable.py | Python | lgpl-2.1 | 5,070 |
from __future__ import annotations
from abilian.sbe.apps.documents.cmis.parser import Entry
XML_ENTRY = b"""\
<?xml version="1.0" encoding="utf-8"?>
<entry xmlns="http://www.w3.org/2005/Atom"
xmlns:app="http://www.w3.org/2007/app"
xmlns:cmisra="http://docs.oasis-open.org/ns/cmis/restatom/200908/">
<cmisra:objec... | abilian/abilian-sbe | src/abilian/sbe/apps/documents/tests/test_parser.py | Python | lgpl-2.1 | 1,918 |
# cerbero - a multi-platform build system for Open Source software
# Copyright (C) 2012 Andoni Morales Alastruey <ylatuya@gmail.com>
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Library General Public
# License as published by the Free Software Foundation; eit... | davibe/cerbero | cerbero/packages/osx/packager.py | Python | lgpl-2.1 | 25,433 |
# Orca
#
# Copyright 2004-2008 Sun Microsystems Inc.
#
# 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
# version 2.1 of the License, or (at your option) any later version.
#
# This... | h4ck3rm1k3/orca-sonar | src/orca/scripts/apps/Thunderbird/script_settings.py | Python | lgpl-2.1 | 1,074 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Licensed under the GNU LGPL v2.1 - http://www.gnu.org/licenses/lgpl.html
"""
Text corpora usually reside on disk, as text files in one format or another
In a common scenario, we need to build a dictionary (a `word->integer id`
mapping), which is then used to construct ... | markroxor/gensim | gensim/corpora/textcorpus.py | Python | lgpl-2.1 | 20,040 |
# -*- coding: latin-1; -*-
import sys, os, os.path, shutil, socket, platform, glob, fnmatch
import datetime, tarfile, subprocess, string
from prmClasses import *
# -- Base Class ----------------------------------------------------------------
class ParametricJob(PRMSet):
def __init__(self,cfgfile, _verb=False):
... | ulgltas/linuxbin | parametricJob.py | Python | lgpl-2.1 | 35,071 |
##############################################################################
# Copyright (c) 2013-2017, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
# This file is part of Spack.
# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
# LLNL-CODE-64... | skosukhin/spack | var/spack/repos/builtin/packages/r-sqldf/package.py | Python | lgpl-2.1 | 2,453 |
import os as _os
import socket as _socket
import threading as _threading
import time as _time
from tunnels.parseutils import addressParse as _addressParse
from tunnels.proxy import MultiplexingProxy as _MultiplexingProxy
from tunnels.proxy import ForwarderProxyThread as _ForwarderProxyThread
from socks import socksocke... | EtiennePerot/tunnels | src/tunnels/proxies/ssh.py | Python | lgpl-3.0 | 7,597 |
# generated from catkin/cmake/template/pkg.context.pc.in
CATKIN_PACKAGE_PREFIX = ""
PROJECT_PKG_CONFIG_INCLUDE_DIRS = "".split(';') if "" != "" else []
PROJECT_CATKIN_DEPENDS = "".replace(';', ' ')
PKG_CONFIG_LIBRARIES_WITH_PREFIX = "".split(';') if "" != "" else []
PROJECT_NAME = "Qt_ROS1"
PROJECT_SPACE_DIR = "/usr/lo... | kuri-kustar/seekur_ground_station_qml | Qt_ROS1/catkin_generated/pkg.installspace.context.pc.py | Python | lgpl-3.0 | 351 |
import datetime
import factory
import mock
from django.test import TestCase
from lizard_datasource import dates
from lizard_datasource import models
## Factories, keep them in the same order as in models.py
class DatasourceModelF(factory.Factory):
FACTORY_FOR = models.DatasourceModel
identifier = "some_id... | lizardsystem/lizard5-apps | lizard_datasource/tests/test_models.py | Python | lgpl-3.0 | 6,549 |
# -*- coding: utf-8 -*-
# Copyright(C) 2014-2015 Oleg Plakhotniuk
#
# This file is part of a weboob module.
#
# This weboob module 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 ... | vicnet/weboob | modules/amazonstorecard/pages.py | Python | lgpl-3.0 | 8,906 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
import re
from communigate import CLI
import unittest
class CliForTest(CLI):
def __init__(self):
self.__missing_method_name = None # Hack!
self._lineSize = 1024
self._peerAddress = '127.0.0.1'
self._peerPort = 106
self._login = 'pos... | rhruiz/pyCommuniGateCLI | test/cli_methodmissing_test.py | Python | lgpl-3.0 | 2,021 |
# (C) British Crown Copyright 2018 - 2019, Met Office
#
# This file is part of cartopy.
#
# cartopy 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)... | ocefpaf/cartopy | lib/cartopy/tests/crs/test_orthographic.py | Python | lgpl-3.0 | 6,881 |
number = 600851475143
divisor = 2
while (number > 1):
if (0 == (number % divisor)):
number /= divisor
divisor -= 1
divisor += 1
print(divisor)
| rck109d/projectEuler | src/euler/p3_eff.py | Python | lgpl-3.0 | 167 |
"""This demo program solves the equations of static linear elasticity
for a gear clamped at two of its ends and twisted 30 degrees."""
# Copyright (C) 2007 Kristian B. Oelgaard
#
# This file is part of DOLFIN.
#
# DOLFIN is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser Gen... | akshmakov/Dolfin-Fijee-Fork | demo/undocumented/elasticity/python/demo_elasticity.py | Python | lgpl-3.0 | 3,069 |
from unittest import TestCase
class TestInicializacionNuevo(TestCase):
def test_fichero_nuevo_dict(self):
from mzbackup.utils.pato import Pato
pato = Pato('cos', '00-01-02', {'fichero': None, 'base': '/opt/backup'})
esperado = {'base': '/opt/backup/', 'directorio': 'cos-00-01-02/',
... | VTacius/MZBackup | tests/utils/pato/test_inicializacion.py | Python | lgpl-3.0 | 2,122 |
#***********************************************************************************************************************
#******************************************************PHASE 2 DTT******************************************************
import math
def metric_statistics(actTempo, recovery, dataIncoming):
activ... | ECYS-USAC/cpfecys | src/cpfecys/controllers/teacher.py | Python | lgpl-3.0 | 75,382 |
"""Module for writing TDMS files"""
try:
from collections import OrderedDict
except ImportError:
OrderedDict = dict
from datetime import datetime
from io import UnsupportedOperation
import numpy as np
from nptdms.common import toc_properties, ObjectPath
from nptdms.types import *
try:
long
except NameErr... | adamreeve/npTDMS | nptdms/writer.py | Python | lgpl-3.0 | 12,151 |
# -*- coding:utf-8 -*-
import time
import itertools
import re
import os
from lib.oldpasswordAnalyze import AnalyzeGetNumbers
from lib.common import FilterList,CountSpecialCharacter,getNameList
from lib.situationhandle import SituationHandle
from lib.passwordDeform import *
"""
MixedKeywordList性质:每一个元素都在preHandlePhase中... | Saferman/cupper | lib/createpassword.py | Python | lgpl-3.0 | 16,456 |
#!/usr/bin/env python
import imp
import os
import sys
try:
zvirtenv = os.path.join(os.environ['OPENSHIFT_PYTHON_DIR'],
'virtenv', 'bin', 'activate_this.py')
execfile(zvirtenv, dict(__file__ = zvirtenv) )
except IOError:
pass
def run_gevent_server(app, ip, port=8080):
from geven... | nervatura/nerva2py-openshift | app.py | Python | lgpl-3.0 | 3,353 |
from django import forms
from .models import SignUp, Post
class ContactForm(forms.Form):
full_name=forms.CharField(required=False)
email=forms.EmailField()
message=forms.CharField()
class SignUpForm(forms.ModelForm):
class Meta:
model=SignUp
fields=['full_name','email']
def clean_email(self):
email= se... | rcaballero218/turtlenotes-project | newsletter/forms.py | Python | unlicense | 659 |
'''
Manually configured and automatic forms defined here.
'''
from flask_wtf import FlaskForm
from wtforms import PasswordField, StringField, SubmitField #, BooleanField
from wtforms.fields.html5 import EmailField
from wtforms.validators import InputRequired, Email, Length
from wtforms_alchemy import model_form_fa... | mixmastamyk/flask-skeleton | src/forms.py | Python | unlicense | 1,656 |
from collections import deque
def search(lines, pattern, history=5):
previous_lines = deque(maxlen=history)
for line in lines:
if pattern in line:
yield line, previous_lines
previous_lines.append(line)
if __name__ == "__main__":
with open('somefile.txt') as f:
for line,... | spanners/python-cookbook | keep_last_n_items.py | Python | unlicense | 473 |
import os
version = "0.5.2.0"
conf_dir = os.path.expanduser(os.path.join("~", ".config", "epour"))
conf_path = os.path.join(conf_dir, "epour.conf")
data_dir = os.path.expanduser(os.path.join("~", ".local", "share", "epour"))
| maikodaraine/EnlightenmentUbuntu | apps/epour/epour/Globals.py | Python | unlicense | 226 |
'''x = 25
def printer():
x = 50
return x
print(x)
print(printer())'''
'''name = "This is a global name"
def greet():
# Enclosing function
name = 'Raihan'
def hello():
print("hello " + name)
hello()
greet()
# Global
print(name)
# Built in
print(len(name))'''
'''
# Local Vari... | theprogrammingthinker/Python-practice | MethodAndFunctions/nasted_statements_and_scope.py | Python | unlicense | 736 |
# -*- coding: utf-8 -*-
#
# Read the Docs Template documentation build configuration file, created by
# sphinx-quickstart on Tue Aug 26 14:19:49 2014.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# autogenera... | SystemRage/py-kms | docs/conf.py | Python | unlicense | 8,231 |
from twython import TwythonStreamer
tweets = []
class MyStreamer(TwythonStreamer):
def on_success(self,data):
if data['lang'] == 'en':
tweets.append(data)
print "received tweet #",len(tweets)
if len(tweets) >= 1000:
self.disconnect()
def on_error(self,status_code,data):
print status_code, data
... | buckiracer/data-science-from-scratch | RefMaterials/Web-Sraping/twitter_streamer.py | Python | unlicense | 991 |
"""
# Problem 63 Powerful digit counts
The 5-digit number, 16807=7^5, is also a fifth power. Similarly, the 9-digit number, 134217728=8^9,
is a ninth power.
How many n-digit positive integers exist which are also an nth power?
"""
from math import log10
# Well, we know that 10^(n-1) <= x^n < 10^n
# n-1 <= log(x^n) <... | zejacobi/ProjectEuler | Solutions/0063.py | Python | unlicense | 820 |
import imp
import re
import six
from django.utils.importlib import import_module
from django.conf import settings
from django.conf.urls import include, url, patterns
from django.conf.urls.i18n import i18n_patterns
from django.core import urlresolvers
from .models import UrlconfIncludePage
def uncache_urlconf(urlcon... | j00bar/django-widgy | widgy/contrib/urlconf_include/middleware.py | Python | apache-2.0 | 4,780 |
from django.conf.urls import url
from django.contrib import admin
import views
urlpatterns = [
url(r'^$', views.Pagina_Principal, name='pagina1'),
url(r'^Ingreso_estudiante/$', views.Ingreso_Estudiante, name='pagina2'),
url(r'^Ingreso_evaluador/$', views.Ingreso_Evaluador, name='pagina3'),
url(r'^Encue... | SebasWS/Programa-permanencia-adacemica | Aplicacion/urls.py | Python | apache-2.0 | 483 |
import requests
def test_can_access_urllib3_attribute():
requests.packages.urllib3
def test_can_access_idna_attribute():
requests.packages.idna
| cloudera/hue | desktop/core/ext-py3/requests-2.27.1/tests/test_packages.py | Python | apache-2.0 | 157 |
# coding: utf-8
"""
Wavefront REST API Documentation
<p>The Wavefront REST API enables you to interact with Wavefront servers using standard REST API tools. You can use the REST API to automate commonly executed operations such as automatically tagging sources.</p><p>When you make REST API calls outside the W... | wavefrontHQ/python-client | test/test_app_search_filter.py | Python | apache-2.0 | 1,306 |
import os
import numpy as np
import pandas as pd
from mljar import Mljar
# please set MLJAR_TOKEN in your ENV
# export MLJAR_TOKEN=token_here
# or set it below
#os.environ["MLJAR_TOKEN"] = "*** your MLJAR_TOKEN goes here ***"
# Read dataset
# Dataset Adult. It is originally from from UCI repository (https://archive.i... | mljar/mljar-examples | UCI-Adult/UCI-Adult-example.py | Python | apache-2.0 | 1,709 |
# requires python 2.7+
# use sli
# db.system.profile.drop()
# db.createCollection("system.profile", {capped:true, size:1024000000});
# db.setProfilingLevel(2)
#
# mongodump --db sli --collection system.profile
# bsondump dump/sli/system.profile.bson > system.profile.json
# (remove lines that have % progress in them)... | inbloom/secure-data-service | sli/config/scripts/parse-profile-dump.py | Python | apache-2.0 | 4,555 |
# Copyright 2012 OpenStack Foundation
# Copyright 2013 Hewlett-Packard Development Company, L.P.
# 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
#
# ht... | Tesora/tesora-tempest | tempest/lib/services/compute/servers_client.py | Python | apache-2.0 | 29,802 |
# -*- coding: utf-8 -*-
# Copyright 2016 Yelp 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 ... | Yelp/kafka-utils | kafka_utils/kafka_cluster_manager/cmds/set_replication_factor.py | Python | apache-2.0 | 5,859 |
#!/usr/bin/env python
# Copyright 2012 NEC Corporation.
# Based on ryu/openvswitch agents.
#
# Copyright 2012 Isaku Yamahata <yamahata at private email ne jp>
# Copyright 2011 VMware, Inc.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except... | subramani95/neutron | neutron/plugins/nec/agent/nec_neutron_agent.py | Python | apache-2.0 | 8,881 |
from numpy import *
import operator
class KNN(object):
def __init__(self, train_x, train_y, k = 1):
self.train_x = train_x
self.train_y = train_y
# self.test_x = test_x
# self.testSize = test_x.shape[0]
self.trainSize = train_x.shape[0]
self.k = k
# print s... | PiscesDream/Ideas | ML/Iris/knn.py | Python | apache-2.0 | 1,281 |
# -*- coding: utf-8 -*-
# Define here the models for your scraped items
#
# See documentation in:
# http://doc.scrapy.org/en/latest/topics/items.html
import scrapy
class QshopItem(scrapy.Item):
# define the fields for your item here like:
# name = scrapy.Field()
item1 = scrapy.Field()
item2 = scrapy... | bryanyang0528/qshop_scrapy | qshop/items.py | Python | apache-2.0 | 651 |
import logging
import math
import statistics
import importlib
import autotrader.hashnest
import pytz
from django.utils import timezone
from django.db import connection
from datetime import datetime
from autotrader.models import *
from autotrader import ticker_apis
__all__ = [
'AccountManager',
'WalletManage... | scealiontach/cryptotrading | src/autotrader/controllers.py | Python | apache-2.0 | 25,352 |
pyType_to_scalaType = {
"object": "string",
"int64": "long",
"float64": "double",
"int32": "integer",
"float32": "double",
"bool": 'bool'
}
schema_header = "<?xml version='1.0' encoding='UTF-8'?>\n"
schema_collection_template = "<gmqlSchemaCollection name= \"{}\" xmlns=\"http://genomic.elet.pol... | DEIB-GECO/PyGMQL | gmql/dataset/storers/__init__.py | Python | apache-2.0 | 582 |
#!/usr/bin/env python
"""
The scripts that compose this module contains a set of datasets
with its respective camera views. Each camera view contains its
calibration and its video.
The module also contains a routine to load each dataset.
"""
import ConfigParser as cp
from threedgeometry.camera import Camera
from va... | lacatus/TFM | datasets/__init__.py | Python | apache-2.0 | 339 |
#!- encoding = utf-8 -!
'''
Author: Dou Liyou
Program Time: 2017-07-14
Version: 1.0
Script using:
'''
import random
import operateDocx
'''
define a method called 'calculate' with 3 parameters: number1, number2 and expression.
the method calculate depend on the expression, this version only support '+' , '-'
other ... | clobob/generate_quizs | auto-generate-quiz.py | Python | apache-2.0 | 5,781 |
import logging
from pytos.common.base_types import XML_Object_Base, XML_List
from pytos.common.definitions.xml_tags import Elements, Attributes
from pytos.common.logging.definitions import XML_LOGGER_NAME
from pytos.common.definitions import xml_tags
from pytos.common.functions.xml import get_xml_text_value, get_xml_... | Tufin/pytos | pytos/securetrack/xml_objects/rest/security_policy.py | Python | apache-2.0 | 23,315 |
# Copyright 2016 Hynek Schlawack
#
# 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 writi... | hynek/prometheus_async | src/prometheus_async/tx/__init__.py | Python | apache-2.0 | 747 |
#!/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... | splunk/splunk-sdk-python | examples/kvstore.py | Python | apache-2.0 | 3,619 |
# tests
# Testing for the ormbad module
#
# Author: Benjamin Bengfort <benjamin@bengfort.com>
# Created: Thu Aug 13 12:34:07 2015 -0400
#
# Copyright (C) 2015 Tipsy Bear Studios
# For license information, see LICENSE.txt
#
# ID: __init__.py [] benjamin@bengfort.com $
"""
Testing for the ormbad module
"""
#########... | tipsybear/ormbad | tests/__init__.py | Python | apache-2.0 | 1,481 |
# Copyright (c) 2010 Arek Korbik
#
# 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... | arkadini/twimp | twimp/vecbuf.py | Python | apache-2.0 | 5,704 |
# from .hardware.parts import RobotBase, LED, Motor
from contextlib import suppress
import asyncio
import signal
from .hardware.wiringpi_parts import (
WPRobotBase as RobotBase,
WPLED as LED,
WPMotor as Motor,
CSpeedEncoder as SpeedEncoder
)
from .hardware.ir_sensor import IR_sensor
from .hardware.ser... | ksurct/MercuryRoboticsEmbedded2016 | ksurobot/robot.py | Python | apache-2.0 | 2,544 |
################################################################################
#
# Library: pydstk
#
# Copyright 2010 Kitware Inc. 28 Corporate Drive,
# Clifton Park, NY, 12065, USA.
#
# All rights reserved.
#
# Licensed under the Apache License, Version 2.0 ( the "License" );
# you may not use this file except in co... | KitwareMedical/pydstk | dtdist.py | Python | apache-2.0 | 2,691 |
# Copyright 2020 DeepMind Technologies Limited. 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 ... | deepmind/tensor_annotations | tensor_annotations/tests/pytype.py | Python | apache-2.0 | 1,618 |
# Copyright 2013 Mellanox Technologies, Ltd
#
# 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... | moshele/old-networking-mlnx | networking_mlnx/plugins/mlnx/agent/eswitch_neutron_agent.py | Python | apache-2.0 | 17,233 |
# Copyright (C) 2014 Universidad Politecnica de Madrid
#
# 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... | Plexical/fiware-idm | deployment/keystone.py | Python | apache-2.0 | 21,716 |
import pytest
from api.base.settings.defaults import API_BASE, MAX_PAGE_SIZE
from api_tests.nodes.filters.test_filters import NodesListFilteringMixin, NodesListDateFilteringMixin
from framework.auth.core import Auth
from osf.models import AbstractNode, Node, NodeLog
from osf.utils.sanitize import strip_html
from osf.u... | icereval/osf.io | api_tests/nodes/views/test_node_list.py | Python | apache-2.0 | 114,985 |
# Copyright (C) 2013 eNovance SAS <licensing@enovance.com>
#
# Author: Artom Lifshitz <artom.lifshitz@enovance.com>
#
# 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.... | grahamhayes/designate | contrib/zoneextractor.py | Python | apache-2.0 | 7,297 |
# Copyright 2021 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | GoogleCloudPlatform/python-docs-samples | composer/workflows/noxfile_config.py | Python | apache-2.0 | 2,094 |
'''Main Used to execute the command line Interpreter'''
import click
from cli import MovieQueue
from server import MQ
def _run_rest():
MQ.run(host="0.0.0.0", port=8080)
def _run_cli():
MovieQueue().cmdloop()
@click.command()
@click.option('--cli', is_flag=True, help='Use the CLI')
@click.option('--serv', is_... | grdlok/mq | src/mq-api/__main__.py | Python | apache-2.0 | 677 |
# Copyright 2014: Mirantis 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 by applicable law or ... | paboldin/rally | rally/plugins/openstack/context/sahara/sahara_cluster.py | Python | apache-2.0 | 5,948 |
# -*- coding: utf-8 -*-
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... | googleapis/python-aiplatform | google/cloud/aiplatform/models.py | Python | apache-2.0 | 151,243 |
import re
def extract(cleanText,options):
"""Basic wrapper functions for the specific options.
options[0] specifies which analysis will be run.
options[1] is for alchemy, and specifies how many keywords will be returned.
options[2] is for sectionExtract, and specifies...
options[3] is for nltk, and specifies..."""... | rebeccamorgan/easyskim | extract.py | Python | apache-2.0 | 3,199 |
import re
import sys
from optparse import OptionParser
from hyperopt import STATUS_OK
import numpy as np
import pandas as pd
from scipy import stats
from scipy import sparse
from . import reusable_holdout
from ..models.sparse_model import SparseModel
from ..experiment import evaluation
from ..util import file_handli... | dallascard/guac | core/experiment/experiment_powerset.py | Python | apache-2.0 | 26,121 |
# Copyright 2018 The Oppia 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 applicable ... | AllanYangZhou/oppia | core/domain/suggestion_services.py | Python | apache-2.0 | 15,844 |
"""yanventory.exceptions."""
class YanventoryError(Exception):
"""Yanventory base exception."""
pass
class YanventoryParsingError(YanventoryError):
"""Yanventory parsing exception."""
pass
| ogenstad/yanventory | lib/yanventory/exceptions.py | Python | apache-2.0 | 211 |
# Copyright 2011 Denali Systems, 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 requ... | HybridF5/jacket | jacket/tests/storage/unit/api/v2/test_snapshots.py | Python | apache-2.0 | 26,086 |
from uuid import UUID
#
# For scratchpad work...
#
services_have = ['delete',
'description', 'enabled', 'get',
'human_id', 'id', 'is_loaded', 'links', 'manager',
'name', 'set_loaded', 'to_dict', 'type']
services = [
{u'description': u'Heat CloudFormation Service',
... | cboling/SDNdbg | deprecated/dummy.py | Python | apache-2.0 | 109,325 |
# -*- coding: utf-8 -*-
# Generated by Django 1.9.2 on 2016-02-25 17:25
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = []
operations = [
migrations.CreateMode... | crccheck/django-object-actions | example_project/polls/migrations/0001_initial.py | Python | apache-2.0 | 1,916 |
import csv
import optparse
import os
import textwrap
import sys
from .. import DuplicateReceipt
from .. import NoSuchReceipt
from .. import NoSuchReport
from .. import delete_receipt
from .. import download_receipt
from .. import initialize_gcloud
from .. import list_receipts
from .. import upload_receipt
class Inva... | GoogleCloudPlatform/google-cloud-python-expenses-demo | gcloud_expenses/scripts/expense_receipts.py | Python | apache-2.0 | 9,512 |
"""
This code was generated by Codezu.
Changes to this file may cause incorrect behavior and will be lost if
the code is regenerated.
"""
from mozurestsdk.mozuclient import default as default_client
from mozurestsdk.mozuurl import MozuUrl;
from mozurestsdk.urllocation import UrlLocation
from mozure... | sanjaymandadi/mozu-python-sdk | mozurestsdk/content/documentlists/view.py | Python | apache-2.0 | 3,137 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# IkaLog
# ======
# Copyright (C) 2015 Takeshi HASEGAWA
#
# 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/l... | kshimo69/IkaLog | ikalog/scenes/game/objective_tracker.py | Python | apache-2.0 | 4,288 |
# Copyright 2021 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, s... | googleapis/python-test-utils | tests/unit/resources/good_package/setup.py | Python | apache-2.0 | 1,413 |
#!/usr/bin/env python
"""
.. py:currentmodule:: FileFormat.Results.test_XraySpectraAtomEmittedDetectedLines
.. moduleauthor:: Hendrix Demers <hendrix.demers@mail.mcgill.ca>
Tests for the module `XraySpectraAtomEmittedDetectedLines`.
"""
# Script information for the file.
__author__ = "Hendrix Demers (hendrix.demers@m... | drix00/pymcxray | pymcxray/FileFormat/Results/test_XraySpectraAtomEmittedDetectedLines.py | Python | apache-2.0 | 2,493 |
# Copyright 2021 The Distla 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 applicable ... | google/distla_core | distla/distla_core/asic_tests/sharded_probability_function/jax_wrappers_test.py | Python | apache-2.0 | 3,826 |
# -*- coding: utf-8 -*-
""" Integer Factoriser 0.4
@author: Ryan Fung
Create Date: 2013-10-15
"""
print("\n===== Integer Factoriser 0.4 by Ryan Fung =====\n")
import time
# input("Enter a number to be factorised:")
def factorise(number):
"""Given an integer, returns a list of of prime factors"""
n = n... | ryanvfung/factoriser | factoriser-0.4.py | Python | apache-2.0 | 3,758 |
# Licensed to the Software Freedom Conservancy (SFC) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The SFC licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not... | Tom-Trumper/selenium | py/selenium/webdriver/safari/webdriver.py | Python | apache-2.0 | 2,761 |
import math
import pickle
import random
def logistic(x):
return 1.0 / (1 + math.exp(-x))
def deriv_logistic(x):
lgst = logistic(x)
return (1 - lgst) * lgst
def hyperbolic_tangent(x):
return math.tanh(x)
def deriv_hyperbolic_tangent(x):
th = math.tanh(x)
return 1 - th * th
def between(m... | Razvy000/ANN_Course | ann_util.py | Python | apache-2.0 | 824 |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.5 on 2017-10-30 21:16
from __future__ import unicode_literals
import datetime
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('stocks', '0018_auto_20171015_1529'),
]
operations = [
migra... | Neitsch/ASE4156 | stocks/migrations/0019_auto_20171030_2116.py | Python | apache-2.0 | 693 |
__author__ = 'saeedamen' # Saeed Amen
#
# Copyright 2016-2020 Cuemacro - https://www.cuemacro.com / @cuemacro
#
# 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/LI... | cuemacro/finmarketpy | finmarketpy/curve/volatility/volstats.py | Python | apache-2.0 | 11,290 |
#!/usr/bin/env python
#
import threading
import Queue
import time
from pysnmp.entity.rfc3413.oneliner import cmdgen
from log import log
from update_servers import update_servers
import config
class ServerAvailability(threading.Thread):
"""
Threaded Server Check. This thread checks availability (up or down) o... | concurrentlabs/laguna | 1.0/api_server-1.0.5/controllers/src/server_availability.py | Python | apache-2.0 | 2,979 |
#===============================================================================
#
# Copyright 2017 VIDAS SIMKUS
#
# 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://ww... | vic-simkus/digi-key_api_access | package_types.py | Python | apache-2.0 | 5,487 |
# Copyright 2021 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, s... | chronicle/api-samples-python | detect/v2/disable_live_rule_test.py | Python | apache-2.0 | 1,873 |
import datetime
import json
import urllib
import httplib
from flask.ext.babel import gettext
from flask import current_app, g, session
try:
from flask import _app_ctx_stack as stack
except ImportError:
from flask import _request_ctx_stack as stack
class MsTranslate(object):
def __init__(self, app=None)... | osleg/Flask-MsTranslate | flask_mstrans.py | Python | apache-2.0 | 3,620 |
# Copyright 2017 Workonline Communications (Pty) Ltd. All rights reserved.
#
# The contents of this file are 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/LIC... | wolcomm/djangolg | tests/test_fields.py | Python | apache-2.0 | 2,633 |
# -*- coding: utf-8 -*-
#
# 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
#... | andyxhadji/incubator-airflow | tests/core.py | Python | apache-2.0 | 108,043 |
# Copyright (c) 2014 X-IO Technologies.
# 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 re... | eharney/cinder | cinder/tests/unit/volume/drivers/test_xio.py | Python | apache-2.0 | 59,567 |
# coding: utf-8
"""
Kubeflow Pipelines API
This file contains REST API specification for Kubeflow Pipelines. The file is autogenerated from the swagger definition.
Contact: kubeflow-pipelines@google.com
Generated by: https://openapi-generator.tech
"""
from __future__ import absolute_import
import ... | kubeflow/pipelines | backend/api/python_http_client/kfp_server_api/api/pipeline_service_api.py | Python | apache-2.0 | 74,340 |
import bson.json_util
from bson.objectid import ObjectId
import json
from pymongo import MongoClient
def freeze(rec):
return (str(rec["_id"]), rec["data"]["id"], bson.json_util.dumps(rec))
def process(frozen):
rec = json.loads(frozen[2])
processed = {"key": rec["_id"]["$oid"]}
processed.update(rec[... | curtislisle/EntityAlignLarge | service/neighborhood.py | Python | apache-2.0 | 3,139 |
from django.conf.urls import patterns, include, url
from sydb.views import current_datetime
# For autocomplete
# import autocomplete_light
# autocomplete_light.autodiscover()
# Uncomment the next two lines to enable the admin:
from django.contrib import admin
from django.views.generic import RedirectView, TemplateView
... | Szkered/BC_2402 | sydb/sydb/urls.py | Python | apache-2.0 | 1,088 |
# -*- coding: utf-8 -*-
import codecs ;
import datetime ;
import os ;
import yaml ;
import cherrypy ;
from application.version import Version ;
path = os.path.abspath(os.path.dirname(__file__))
defaultSetup = {
'view' : {
'title' : 'Peanut, Stars & Me' ,
'titlelink' : '/' ,
'favicon' :... | peanutstars/PiWeb | src/config.py | Python | apache-2.0 | 2,260 |
import requests
from celery import Celery
from django.core.cache import cache
from django.conf import settings
from .models import Banishment
app = Celery('banish')
app.config_from_object(settings.CELERY_CONFIG)
app.autodiscover_tasks(lambda: settings.INSTALLED_APPS, related_name="tasks")
@app.task(bind=True)
def... | intelligenia/django-banish-plus | banish/tasks.py | Python | apache-2.0 | 1,220 |
#!/usr/bin/env python3
"""Base class for all FAUCET unit tests."""
# pylint: disable=missing-docstring
# pylint: disable=too-many-arguments
from functools import partial
import collections
import copy
import glob
import ipaddress
import json
import os
import random
import re
import shutil
import string
import subpro... | trungdtbk/faucet | clib/mininet_test_base.py | Python | apache-2.0 | 124,928 |
from saml2.saml import NAMEID_FORMAT_PERSISTENT
from satosa.backends.saml2 import SAMLBackend
from satosa.exception import SATOSAAuthenticationError
class InAcademiaBackend(SAMLBackend):
def __init__(self, outgoing, internal_attributes, config, base_url, name):
super().__init__(outgoing, internal_attribut... | its-dirg/svs | src/svs/inacademia_backend.py | Python | apache-2.0 | 1,686 |