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 |
|---|---|---|---|---|---|
"""
API MAPPING FOR Zendesk API V2
"""
mapping_table = {
# Tickets
'list_all_tickets': {
'path': '/tickets.json',
'method': 'GET',
},
'show_ticket': {
'path': '/tickets/{{ticket_id}}.json',
'method': 'GET',
},
'create_ticket': {
'path': '/tickets.json',
... | GbalsaC/bitnamiP | zendesk/zendesk/endpoints_v2.py | Python | agpl-3.0 | 17,249 |
# coding: utf-8
from __future__ import (absolute_import, division, print_function,
unicode_literals)
import os
import sys
import pip
from .. import click, sync
from ..exceptions import PipToolsError
from ..logging import log
from ..utils import assert_compatible_pip_version, flat_map
# Make ... | nateprewitt/pipenv | pipenv/patched/piptools/scripts/sync.py | Python | mit | 3,144 |
import wx
import urllib
import urllib2
import os
class customColorDialog(wx.Dialog):
def DialogSetup(self):
self.rows = []
yPos = 25
while yPos <= 155:
temp = wx.TextCtrl(self, -1, "", size = (60, 20), pos=(20, yPos),
style = wx.TE_PROCESS_ENTER)
... | fxb22/BioGUI | plugins/Views/AlignViewPlugins/WebLogo.py | Python | gpl-2.0 | 11,645 |
from kivy.app import App
from kivy.uix.widget import Widget
from kivy.uix.button import Button
from kivy.uix.boxlayout import BoxLayout
from kivy.properties import ListProperty
class RootWidget(BoxLayout):
def __init__(self, **kwargs):
super(RootWidget, self).__init__(**kwargs)
self.add_widget(Label(text='... | victor-rene/MicroScada | archive/day_01/main.py | Python | mit | 1,614 |
# pylint: disable=unused-wildcard-import, wildcard-import
from .base import *
DEBUG = True
TEMPLATE_DEBUG = True
STATIC_ROOT = 'static'
| SgtHotshot/forge-cortex | cortex/settings/dev.py | Python | mit | 149 |
from __future__ import print_function, division
from contextlib import closing
import gzip
import optparse
import os
import shutil
import struct
import tempfile
import sys
import subprocess
import itertools
from concurrent.futures import ThreadPoolExecutor, as_completed
from colorama import init, Fore, Style
import gu... | nicoddemus/ss | ss.py | Python | gpl-3.0 | 17,390 |
# -*- coding: utf-8 -*-
#------------------------------------------------------------
# Movie Ultra 7K -
# Version 0.2.9 (18.07.2014)
#------------------------------------------------------------
# License: GPL (http://www.gnu.org/licenses/gpl-3.0.html)
# Gracias a la librería plugintools de Jesús (www.mimediacenter.in... | corvorepack/REPOIVAN | plugin.video.movie.ultra.7k/resources/regex/freebroadcast.py | Python | gpl-2.0 | 5,087 |
from django.test import TestCase
from django.utils import timezone
from .. import utils
from .. import models as survey_models
from myvoice.core.tests import factories
from operator import itemgetter
class TestDisplayFeedback(TestCase):
def test_false(self):
bad_feedback = [None, '', ' ', ' 1', '1'... | myvoice-nigeria/myvoice | myvoice/survey/tests/test_utils.py | Python | bsd-2-clause | 7,181 |
age = dict(tom=23, jane=32, mike=27, linda=25)
| codermoji-contrib/python | start/Intro to Dicts/printdict/printval1.py | Python | mit | 47 |
import warnings
import numpy as np
import pandas as pd
from statsmodels.base import model
import statsmodels.base.wrapper as wrap
from statsmodels.tools.sm_exceptions import ConvergenceWarning
class _DimReductionRegression(model.Model):
"""
A base class for dimension reduction regression methods.
"""
... | bashtage/statsmodels | statsmodels/regression/dimred.py | Python | bsd-3-clause | 20,343 |
from __future__ import absolute_import
from django.db.models import F
from rest_framework import serializers, status
from rest_framework.response import Response
from sentry.api.base import DocSection
from sentry.api.bases.project import ProjectEndpoint
from sentry.api.serializers import serialize
from sentry.models ... | mvaled/sentry | src/sentry/api/endpoints/project_keys.py | Python | bsd-3-clause | 3,820 |
#!/usr/bin/env python3
#
# Copyright 2014 Simone Campagna
#
# 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 ... | simone-campagna/rubik | rubik/cubes/internals.py | Python | apache-2.0 | 1,309 |
# -*- coding: utf-8 -*-
def classFactory(iface):
# load FeatureTemplates class from file FeatureTemplates
from featuretemplates import FeatureTemplates
return FeatureTemplates(iface)
| NathanW2/featuretemplates | __init__.py | Python | gpl-2.0 | 196 |
# -*- coding:utf-8 -*-
from flask import Blueprint
from flask import jsonify
from flask import request
from lib.ci_type import CITypeRelationManager
from lib.auth import auth_with_key
cityperelation = Blueprint("cityperelation", __name__)
@cityperelation.route("/types", methods=["GET"])
def get_types():
man... | kdyq007/cmdb-api | core/ci_type_relation.py | Python | gpl-2.0 | 1,664 |
"""
Contains tests for the statistics aggregator base class as well
as the default aggregator class.
"""
import time
from tests.base import TestBase
from statsite.aggregator import Aggregator, DefaultAggregator
from statsite.metrics import Counter, KeyValue, Timer
class TestAggregator(TestBase):
def test_fold_met... | kiip/statsite | tests/unit/test_aggregator.py | Python | bsd-3-clause | 1,745 |
#!/usr/bin/python
# (c) 2019, XLAB d.o.o <www.xlab.si>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['pr... | roadmapper/ansible | lib/ansible/modules/cloud/amazon/s3_bucket_notification.py | Python | gpl-3.0 | 9,017 |
# -*- coding: utf-8 -*-
#
# Copyright 2016 edX PDR Lab, National Central University, Taiwan.
#
# http://edxpdrlab.ncu.cc/
#
# 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://w... | yrchen/CommonRepo | commonrepo/elos/__init__.py | Python | apache-2.0 | 901 |
"""
loadconfig_primitive
====================
:Module: pyfileserver.loadconfig_primitive
:Author: Ho Chun Wei, fuzzybr80(at)gmail.com
:Project: PyFileServer, http://pyfilesync.berlios.de/
:Copyright: Lesser GNU Public License, see LICENSE file attached with package
Loads a python module file returning its module nam... | selfcommit/gaedav | pyfileserver/loadconfig_primitive.py | Python | lgpl-2.1 | 1,082 |
'''
Tex: Compressed texture
'''
__all__ = ('ImageLoaderTex', )
import json
from struct import unpack
from kivy.logger import Logger
from kivy.core.image import ImageLoaderBase, ImageData, ImageLoader
class ImageLoaderTex(ImageLoaderBase):
@staticmethod
def extensions():
return ('tex', )
def lo... | KeyWeeUsr/kivy | kivy/core/image/img_tex.py | Python | mit | 1,549 |
import sys
from geopy import Point
from django.apps import apps as django_apps
from django.core.exceptions import ImproperlyConfigured
from django.core.management.color import color_style
from .geo_mixin import GeoMixin
LANDMARK_NAME = 0
LATITUDE = 2
LETTERS = list(map(chr, range(65, 91)))
LONGITUDE = 1
style = co... | botswana-harvard/edc-map | edc_map/mapper.py | Python | gpl-2.0 | 2,309 |
import netaddr
from oslo.config import cfg
from neutron import manager
from neutron.common import rpc as q_rpc
from neutron.db import api as qdbapi
from neutron.db import common_db_mixin as db_base_plugin_v2
from neutron.db.servicechain import servicechain_db
from neutron.db.servicechain import servicechain_pool as sc... | nash-x/hws | neutron/services/servicechain/plugin.py | Python | apache-2.0 | 12,790 |
from django import template
import markdown2
from django.utils.safestring import mark_safe
from django.utils.encoding import force_unicode
register = template.Library()
@register.filter(is_safe=True)
def markdowner(value):
value = markdown2.markdown(str(value), extras={"html-classes" : {"img" : "testing" } })
... | Nimmard/james-olson.com | blog/templatetags/entryfilters.py | Python | gpl-2.0 | 609 |
# -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import unicode_literals
import os
import re
import glob
from argparse import Namespace
from os import path
from babel import Locale
from babel.core import UnknownLocaleError
from convert import key_plural_keywords
from config import Config... | ekager/focus-android | tools/l10n/android2po/env.py | Python | mpl-2.0 | 25,197 |
# -*- 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):
# Changing field 'UserProfile.user'
db.alter_column(u'spa_userprofile', 'user_id', self.gf('dja... | fergalmoran/dss | spa/migrations/0006_auto__chg_field_userprofile_user.py | Python | bsd-2-clause | 16,601 |
# Natural Language Toolkit: NomBank Corpus Reader
#
# Copyright (C) 2001-2016 NLTK Project
# Authors: Paul Bedaride <paul.bedaride@gmail.com>
# Edward Loper <edloper@gmail.com>
# URL: <http://nltk.org/>
# For license information, see LICENSE.TXT
from __future__ import unicode_literals
from nltk.tree import T... | JFriel/honours_project | venv/lib/python2.7/site-packages/nltk/corpus/reader/nombank.py | Python | gpl-3.0 | 16,317 |
###############################################################################
# This file is part of openWNS (open Wireless Network Simulator)
# _____________________________________________________________________________
#
# Copyright (C) 2004-2007
# Chair of Communication Networks (ComNets)
# Kopernikusstr. 5, D-5... | creasyw/IMTAphy | framework/library/PyConfig/openwns/scheduler/APCStrategy.py | Python | gpl-2.0 | 3,677 |
#!/usr/bin/env python
import sys
from setuptools import setup
from bugjar import VERSION
try:
readme = open('README.rst')
long_description = str(readme.read())
finally:
readme.close()
required_pkgs = [
'Pygments>=1.5',
'tkreadonly>=0.5.2',
]
if sys.version_info < (2, 7):
required_pkgs.append... | pombredanne/bugjar | setup.py | Python | bsd-3-clause | 1,241 |
# -*- coding: utf-8 -*-
#########################################################################
# #
# #
#########################################################################
... | akretion/rma | __unported__/product_warranty/__openerp__.py | Python | agpl-3.0 | 2,439 |
import six
import requests
from bugwarrior.config import die
from bugwarrior.services import Issue, IssueService, ServiceClient
import logging
log = logging.getLogger(__name__)
class TeamLabClient(ServiceClient):
def __init__(self, hostname, verbose=False):
self.hostname = hostname
self.verbose ... | lyarwood/bugwarrior | bugwarrior/services/teamlab.py | Python | gpl-3.0 | 4,419 |
from .test_settings import * # NOQA
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': 'db.sqlite',
}
} | ateoto/django-recipebook | recipebook/tests/persistent_settings.py | Python | mit | 153 |
import os
from app import create_app, db
from app.models import User, Machine, Revision, Role, RevokedToken
from flask_migrate import Migrate
import click
from flask_jwt_extended import JWTManager
app = create_app(os.getenv('FLASK_CONFIG') or 'default')
jwt = JWTManager(app)
migrate = Migrate(app, db)
# Why does t... | rivalrockets/benchmarks.rivalrockets.com | rivalrockets-api.py | Python | mit | 866 |
# -*- coding: utf-8 -*-
import logging
import unittest
import uuid
import boto3
import moto
from smart_open import open
BUCKET_NAME = 'test-smartopen'
KEY_NAME = 'test-key'
logger = logging.getLogger(__name__)
@moto.mock_s3
def setUpModule():
'''Called once by unittest when initializing this module. Sets u... | piskvorky/smart_open | smart_open/tests/test_s3_version.py | Python | mit | 3,937 |
import os, yaml, util
from kivy.uix.floatlayout import FloatLayout
from kivy.graphics import Color, ClearColor, Rectangle
from kivy.clock import Clock
class Valve:
def __init__(self, pos):
self.pos = pos
self.modifier = 1
def rotate_modifier(self):
if self.modifier == -1:
self.modifier = 1... | victor-rene/MicroScada | archive/day_09/simulator.py | Python | mit | 12,003 |
from SassyMQ.CommonClasses.BaseClasses import *
from SassyMQ.CommonClasses.SMQActorBase import *
from json import JSONEncoder
class SMQPublicBase(SMQActorBase):
def __init__(self, isAutoConnect = True):
super(SMQPublicBase, self).__init__("public.all", isAutoConnect)
# Ope... | CODEiverse/SassyMQ-OpenSourceTools | PySassyMQ/SassyMQ/SMQActors/SMQPublicBase.py | Python | mpl-2.0 | 1,084 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# vim: autoindent tabstop=4 shiftwidth=4 expandtab softtabstop=4 filetype=python
#
# Copyright (c) 2013 Greenhost VOF
# https://greenhost.nl -\- https://greenhost.io
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Af... | greenhost/viper | viper/windows/firewall.py | Python | gpl-3.0 | 5,108 |
import numpy as np
from trans_rot_coords import get_normal, get_unit
D2R = 3.14159265358979/180.0
Mass_table = {'O':15.999, 'H':1.008}
## Indices of one square:
Grid_Quarts_wtr = { 0: [ 0, 1, 13, 14] ,
1: [ 1, 2, 14, 15] ,
2: [ 2, 3, 15, 16] ,
3: [ 3, 4, 16, ... | sethbrin/QM | version2/python/grids_structures_general.py | Python | mit | 6,582 |
"""
<Module Name>
dsa.py
<Author>
Santiago Torres-Arias <santiago@nyu.edu>
<Started>
Nov 15, 2017
<Copyright>
See LICENSE for licensing information.
<Purpose>
DSA-specific handling routines for signature verification and key parsing
"""
import binascii
CRYPTO = True
NO_CRYPTO_MSG = 'DSA key support for G... | secure-systems-lab/securesystemslib | securesystemslib/gpg/dsa.py | Python | mit | 7,171 |
from . import api, example, bauth, friendAPI, apiHelper, postAPI | CMPUT404W16/social-dist | fbook/api/__init__.py | Python | apache-2.0 | 64 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Script to download time tables as PDF and calculate route durations based on relations for the routes in OpenStreetMap
from common import *
import os
import sys
import io
import logging
import requests
import json
import datetime
import time
#from unidecode import unidecod... | Skippern/GV-scraper | creators/planeta/get_duration.py | Python | gpl-3.0 | 2,121 |
"""
Dambreak flow - Ubbink (1997)
"""
import numpy as np
from math import sqrt
from proteus import (Domain, Context,
FemTools as ft,
#SpatialTools as st,
MeshTools as mt,
WaveTools as wt)
from proteus.mprans import SpatialTools as st
fr... | erdc-cm/air-water-vv | 2d/benchmarks/dambreak_Ubbink/dambreak_Ubbink.py | Python | mit | 8,038 |
import sys
import numpy
import math
from KMCLib.PluginInterfaces.KMCAnalysisPlugin import KMCAnalysisPlugin
from KMCLib.Utilities.CheckUtilities import checkSequenceOfPositiveIntegers
from KMCLib.Utilities.CheckUtilities import checkPositiveFloat
from KMCLib.Utilities.CheckUtilities import checkPositiveInteger
from KM... | joshuahellier/PhDStuff | codes/thesisCodes/kmc/customAnalysis/RateCalc.py | Python | mit | 1,393 |
# coding: utf8
# Copyright 2018 The Servo Project Developers. See the COPYRIGHT
# file at the top-level directory of this distribution.
#
# Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
# http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
# <LICENSE-MIT or http://opensource.org/licenses... | saneyuki/servo | etc/taskcluster/decisionlib.py | Python | mpl-2.0 | 30,561 |
# Exercise 18: Names, Variables, Code, Functions
# this one is like your scripts with argv
def print_two(*args):
arg1, arg2 = args
print "arg1: %r, arg2: %r" % (arg1, arg2)
# ok, that *args is actually pointless, we can just do this
def print_two_again(arg1, arg2):
print "arg1: %r, arg2: %r" % (arg1, arg2)... | paulcarroty/Learn-Python-The-Hard-Way | ex18.py | Python | gpl-3.0 | 575 |
# -*- coding:utf-8 -*-
# Copyright 2015 NEC Corporation. #
# #
# Licensed under the Apache License, Version 2.0 (the "License"); #
# you may not use this file except in compliance with the License... | haizawa/odenos | src/test/python/org/o3project/odenos/core/component/network/topology/test_node_changed.py | Python | apache-2.0 | 4,446 |
from django.conf import settings
from .. import Tags, Warning, register
def add_session_cookie_message(message):
return message + (
" Using a secure-only session cookie makes it more difficult for "
"network traffic sniffers to hijack user sessions."
)
W010 = Warning(
add_session_cookie_... | BitWriters/Zenith_project | zango/lib/python3.5/site-packages/django/core/checks/security/sessions.py | Python | mit | 2,595 |
from __future__ import print_function, unicode_literals, division, absolute_import
import datetime
import time
import ntplib
from pyotp import utils
from pyotp.otp import OTP
class TOTP(OTP):
systime_offset = None
def __init__(self, *args, **kwargs):
"""
@option options [Integer] interval ... | projectarkc/arkc-server | arkcserver/pyotp/totp.py | Python | gpl-2.0 | 2,787 |
__version__ = '0.1.0'
from .reports import Report
| grantmcconnaughey/django-reports | djreports/__init__.py | Python | bsd-3-clause | 51 |
# Authors: Mr_Orange <mr_orange@hotmail.it>, EchelonFour
# URL: http://code.google.com/p/sickbeard/
#
# This file is part of SickRage.
#
# SickRage 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 versio... | whitepyro/debian_server_setup | sickbeard/clients/utorrent.py | Python | gpl-3.0 | 4,180 |
import json
from coalib.bearlib.abstractions.Linter import linter
from dependency_management.requirements.NpmRequirement import NpmRequirement
from coalib.results.Result import Result
from coalib.settings.Setting import path
@linter(executable='tslint')
class TSLintBear:
"""
Check TypeScript code for style v... | refeed/coala-bears | bears/typescript/TSLintBear.py | Python | agpl-3.0 | 2,040 |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2012 Nebula, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# ... | developerworks/horizon | horizon/tabs/__init__.py | Python | apache-2.0 | 709 |
####
#Importing modules can serve 3 purposes if done right
#1-Allows you to add features to bare bones python
#2-Only importing what you need lets your imports serve as documentation for
# someone else reading your code later.
#3-By forcing you to import things, python helps you keep your programs small
####
#import ... | isaac-friedman/lphw | ex13.py | Python | mit | 777 |
import numpy as np
from PIL import Image, ImageEnhance
import cv2
from skimage.transform import rotate
def RandomResize(img, scale=0.12):
rn = np.random.uniform(1 - scale, 1 + scale)
h = np.shape(img)[0]
w = np.shape(img)[1]
h = int(h * rn)
w = int(w * rn)
return img.resize((h, w))
#########... | ivanlai/Kaggle-Planet-Amazon | Image_transformation.py | Python | mit | 1,310 |
{
'name': 'SaaS Portal Sign Up',
'version': '1.0.0',
'author': 'Cesar Lage',
'license': 'GPL-3',
'category': 'SaaS',
'website': 'https://it-projects.info',
'depends': ['auth_signup', 'saas_portal'],
'data': ['views/signup.xml'],
'installable': True,
'description': '''
Module to ... | Endika/odoo-saas-tools | saas_portal_signup/__openerp__.py | Python | gpl-3.0 | 377 |
from sympy.holonomic import (DifferentialOperator, HolonomicFunction,
DifferentialOperators, from_hyper,
from_meijerg, expr_to_holonomic)
from sympy.holonomic.recurrence import RecurrenceOperators, HolonomicSequence
from sympy import (symbols, hyper, S, sqrt, pi... | wxgeo/geophar | wxgeometrie/sympy/holonomic/tests/test_holonomic.py | Python | gpl-2.0 | 33,101 |
from pyqtgraph import RectROI
from pyqtgraph import QtCore
from pyqtgraph import QtGui
from pyqtgraph import LayoutWidget
from .utils import delete_content
from .utils import compute_bbox_of_points
from .color import JChooseColor
from .color import setup_color
from .remove_item import JRemoveItem
class Jrectangle... | jakaspeh/JDesigner | jdesigner/jrectangle.py | Python | mit | 3,610 |
__author__ = 'andreas'
from random import randint
secret = randint(1,10)
print("Welcome!")
guess = 0
while guess != secret:
g = input("Guess the Number")
guess = int(g)
if guess == secret:
print("You win!")
else:
if guess > secret:
print("Your guess is too high")
else... | Nebucatnetzer/Learning_python | guessing_game/guessing_game.py | Python | gpl-2.0 | 371 |
from bs4 import BeautifulSoup
import urllib
r = urllib.urlopen("https://nl.wikipedia.org/wiki/Tweede_Kamerverkiezingen_2012").read()
soup = BeautifulSoup(r, "html.parser")
for item in soup.findAll("div", {"class": "thumb tright"}):
tekst = item.findAll("div", {"class": "thumbcaption"}) [0].getText()
... | ArtezGDA/MappingTheCity-Data | ElectionData/ElectionData-Scraper-Wikipedia.py | Python | mit | 560 |
#
# 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
# distributed under... | openstack/ceilometer | ceilometer/event/models.py | Python | apache-2.0 | 4,780 |
from django.shortcuts import get_object_or_404, render
# Create your views here.
from django.http import HttpResponse
from django.template import RequestContext
from .models import Text
def index(request):
latest_text_list = Text.objects.order_by("-pub_date")[:5]
context = RequestContext(request, {"latest_te... | citizenline/citizenline | bettertexts/views.py | Python | mit | 852 |
#
# 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... | wileeam/airflow | airflow/providers/google/cloud/example_dags/example_functions.py | Python | apache-2.0 | 5,490 |
from django.core.management.base import BaseCommand, CommandError
from apps.models.models import Initiative
# TODO: tests!!!
"""
A manage.py command to migrate cities from a CSV file
"""
class Command(BaseCommand):
help = "Delete all Initiative models from database."
"""
Deletes all Initiative objects
... | Ale-/civics | apps/models/management/commands/delete_initiatives.py | Python | gpl-3.0 | 409 |
# This file is part of the REMOTE API
#
# Copyright 2006-2015 Coppelia Robotics GmbH. All rights reserved.
# marc@coppeliarobotics.com
# www.coppeliarobotics.com
#
# The REMOTE API is licensed under the terms of GNU GPL:
#
# -------------------------------------------------------------------
# The REMOTE A... | USC-ACTLab/pyCreate2 | pyCreate2/vrep/vrepConst.py | Python | mit | 36,458 |
# Miro - an RSS based video player application
# Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011
# Participatory Culture Foundation
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; eithe... | debugger06/MiroX | tv/lib/frontends/widgets/tablistdnd.py | Python | gpl-2.0 | 11,806 |
# -*- coding: utf-8 -*-
"""Algorithms for spectral clustering"""
# Author: Gael Varoquaux gael.varoquaux@normalesup.org
# Brian Cheung
# Wei LI <kuantkid@gmail.com>
# License: BSD 3 clause
import warnings
import numpy as np
from ..base import BaseEstimator, ClusterMixin
from ..utils import check_rand... | nhejazi/scikit-learn | sklearn/cluster/spectral.py | Python | bsd-3-clause | 19,173 |
"""Mocks used for testing."""
import httmock
# Modoboa API mocks
@httmock.urlmatch(
netloc=r"api\.modoboa\.org$", path=r"^/1/instances/search/", method="post")
def modo_api_instance_search(url, request):
"""Return empty response."""
return {"status_code": 404}
@httmock.urlmatch(
netloc=r"api\.modo... | modoboa/modoboa | modoboa/core/mocks.py | Python | isc | 1,365 |
#!/usr/bin/env python
# pylint: disable=missing-docstring
import pkg_resources
import yaml
import six
from functest.utils import env
class Config():
def __init__(self):
try:
with open(pkg_resources.resource_filename(
'functest', 'ci/config_functest.yaml'),
... | opnfv/functest | functest/utils/config.py | Python | apache-2.0 | 2,430 |
"""distutils.file_util
Utility functions for operating on single files.
"""
__revision__ = "$Id$"
import os
from distutils.errors import DistutilsFileError
from distutils import log
# for generating verbose output in 'copy_file()'
_copy_action = {None: 'copying',
'hard': 'hard linking',... | nmercier/linux-cross-gcc | win32/bin/Lib/distutils/file_util.py | Python | bsd-3-clause | 8,370 |
import numpy as np
def sample_to_sum(rng, target, sd, count):
s = rng.randn(count) * sd / np.sqrt(count)
s += (target - sum(s)) / count
return s
| tcstewar/sham | sample.py | Python | gpl-2.0 | 158 |
# vim:set noet ts=4:
#
# ibus-anthy - The Anthy engine for IBus
#
# Copyright (c) 2007-2008 Peng Huang <shawn.p.huang@gmail.com>
# Copyright (c) 2009 Hideaki ABE <abe.sendai@gmail.com>
# Copyright (c) 2010-2017 Takao Fujiwara <takao.fujiwara1@gmail.com>
# Copyright (c) 2007-2017 Red Hat, Inc.
#
# This program is free s... | ibus/ibus-anthy | setup/python2/prefs.py | Python | gpl-2.0 | 13,312 |
# Copyright (c) 2014 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
#
# Unless required by applicable law or agreed to in writ... | henaras/sahara | sahara/utils/proxy.py | Python | apache-2.0 | 11,094 |
# Licensed to the StackStorm, Inc ('StackStorm') 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 th... | emedvedev/st2 | st2actions/st2actions/runners/windows_command_runner.py | Python | apache-2.0 | 4,081 |
# -*- coding: utf-8 -*-
#
# Copyright © 2012 - 2016 Michal Čihař <michal@cihar.com>
#
# This file is part of Weblate <https://weblate.org/>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, eith... | jitka/weblate | weblate/trans/specialchars.py | Python | gpl-3.0 | 9,767 |
from django.conf.urls.defaults import *
urlpatterns = patterns('content.views',
url(r'^gallery', 'gallery', name="gallery"),
url(r'^pagetree', 'gallery', name="pagetree"),
url(r'(.*)', 'page', name="page"),
)
| jholster/django-birdie | content/urls.py | Python | bsd-3-clause | 222 |
# -*- 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 or... | googleads/google-ads-python | google/ads/googleads/v10/services/services/experiment_service/pagers.py | Python | apache-2.0 | 3,497 |
import nose.tools as nt
import numpy as np
import theano
import theano.tensor as T
import treeano
import treeano.nodes as tn
from treeano.sandbox.nodes import spp_net
fX = theano.config.floatX
def test_spatial_pyramid_pooling_node_serialization():
tn.check_serialization(spp_net.SpatialPyramidPoolingNode("a"))
... | nsauder/treeano | treeano/sandbox/nodes/tests/spp_net_test.py | Python | apache-2.0 | 2,148 |
#!/usr/bin/python2
# Copyright 2015 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Configuration Option Checker.
Script to ensure that all configuration options for the Chrome EC are defined
in config.h.
"""
from __... | akappy7/ChromeOS_EC_LED_Diagnostics | util/config_option_check.py | Python | bsd-3-clause | 12,167 |
# -*- coding: utf-8 -*-
# Requires Python 2.7 or later
import io, os, sys, unittest
if sys.platform == "win32":
import XiteWin as Xite
else:
import XiteQt as Xite
keywordsHTML = [
b"b body content head href html link meta "
b"name rel script strong title type xmlns",
b"function",
b"sub"
]
keywor... | apmckinlay/csuneido | vs2019scintilla/test/lexTests.py | Python | gpl-2.0 | 6,652 |
import logging
import subprocess
from subprocess import CalledProcessError
from .runnable import Runnable
class Shell(Runnable):
"""
:param str cmd: Command with arguments to be run.
:param str title: A title to be displayed in log outputs.
If None, :attr:`cmd` will be shown.
:pa... | cemsbr/expyrimenter | expyrimenter/shell.py | Python | gpl-3.0 | 2,943 |
#!/usr/bin/env python3
import os
import yaml
class Service():
def __init__(self, port, should_log, frequency, decimation=None):
self.port = port
self.should_log = should_log
self.frequency = frequency
self.decimation = decimation
service_list_path = os.path.join(os.path.dirname(__file__), "service... | vntarasov/openpilot | cereal/services.py | Python | mit | 1,161 |
from collections import OrderedDict
from sympy import true
from devito.tools import as_tuple, is_integer, memoized_meth
from devito.types import Dimension
__all__ = ['Vector', 'LabeledVector', 'vmin', 'vmax']
class Vector(tuple):
"""
An object in an N-dimensional space.
The elements of a vector can b... | opesci/devito | devito/ir/support/vector.py | Python | mit | 14,039 |
import os
from Foundation import *
def getApplicationDirectory(appName):
"""Return appliction directory path"""
paths = NSSearchPathForDirectoriesInDomains(NSApplicationSupportDirectory,
NSUserDomainMask, True)
basePath = (len(paths) > 0 and paths[0]) or NSTemporaryDirectory()
fullPath = b... | SPlyer/MacTimeLog | common/settings_utils.py | Python | gpl-2.0 | 957 |
import re
from typing import Tuple
import pytest
from .._receivebuffer import ReceiveBuffer
def test_receivebuffer() -> None:
b = ReceiveBuffer()
assert not b
assert len(b) == 0
assert bytes(b) == b""
b += b"123"
assert b
assert len(b) == 3
assert bytes(b) == b"123"
assert byte... | python-hyper/h11 | h11/tests/test_receivebuffer.py | Python | mit | 3,454 |
''' The validation module provides the capability to perform integrity
checks on an entire collection of Bokeh models.
To create a Bokeh visualization, the central task is to assemble a collection
model objects from |bokeh.models| into a graph that represents the scene that
should be created in the client. It is possi... | schoolie/bokeh | bokeh/core/validation/__init__.py | Python | bsd-3-clause | 1,147 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
... | hyperized/ansible | lib/ansible/modules/remote_management/ucs/ucs_query.py | Python | gpl-3.0 | 4,605 |
import json
import time
from indy import ledger, did, wallet, pool
from src.utils import get_pool_genesis_txn_path, run_coroutine, PROTOCOL_VERSION
import logging
logger = logging.getLogger(__name__)
async def demo():
logger.info("Ledger sample -> started")
# Set protocol version 2 to work with Indy Node 1... | srottem/indy-sdk | samples/python/src/ledger.py | Python | apache-2.0 | 3,737 |
#############################################################################
#
# Copyright (C) 2013 Navi-X
#
# This file is part of Navi-X.
#
# Navi-X 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 Fou... | JamesLinEngineer/RKMC | addons/script.navi-x/src/CLogin.py | Python | gpl-2.0 | 3,203 |
import logging
import uuid
import datetime
import mimetypes
from Cookie import BaseCookie
from google.appengine.runtime import DeadlineExceededError
from google.appengine.runtime.apiproxy_errors import CapabilityDisabledError, ApplicationError
from google.appengine.ext import webapp, db
from google.appengine.ext.webapp... | pfn/passifox-appengine | main.py | Python | gpl-2.0 | 9,782 |
import textwrap
import string
import pathlib, contextlib
from keypad import buffers, control, core, options
from keypad.util import listdict
from keypad.core import Keys
from keypad.testutil import mocks
from keypad.buffers.testutil import placeholder_insert
from keypad.plugins.pymodel import PythonCodeModelPlugin
... | sam-roth/Keypad | keypad_tests/test_indent.py | Python | gpl-3.0 | 2,458 |
__author__ = 'asergeev'
| ZJlblDEHb/ya-test-tasks | tests/__init__.py | Python | mit | 24 |
from __future__ import unicode_literals
from __future__ import print_function
from __future__ import division
from __future__ import absolute_import
from future import standard_library
standard_library.install_aliases()
from queue import Queue
class IndexableQueue(Queue):
""" Taken from http://stackoverflow.com/qu... | Bounti/avatar-python | avatar/util/indexable_queue.py | Python | apache-2.0 | 732 |
# -*- coding: utf-8 -*-
# Generated by Django 1.10 on 2016-08-22 12:25
from __future__ import unicode_literals
import datetime
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
... | DmitryRendov/mob-site | mob/library/migrations/0001_initial.py | Python | mit | 2,704 |
#!/usr/bin/python
from yyparse.ZCCparser import parser, printAST
from yyparse.ZCClex import lexer as ZCClexer
from symbol.symtab import c_types
from public.ZCCglobal import global_context, FuncType, error, Context
from generation.generation import generator
import os
import sys
def preprocess(source):
stream = os... | BadStudent/ZCC | main.py | Python | gpl-2.0 | 986 |
# -*- coding: utf-8 -*-
# Taboot - Client utility for performing deployments with Func.
# Copyright © 2009,2010, Red Hat, Inc.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 ... | tbielawa/Taboot | taboot/tasks/rpm.py | Python | gpl-3.0 | 3,484 |
from . import api
from . import utils
| jvanasco/pyramid_caching_api | pyramid_caching_api/__init__.py | Python | mit | 38 |
import random
import numpy as np
from sklearn.base import RegressorMixin, BaseEstimator
from sklearn import cross_validation
class EnsembleRegressor(RegressorMixin, BaseEstimator):
"""Basic EnsembleRegressor model.
Parameters
----------
models : seq
Models to constitute the ensemble
weig... | skirklin/modopt | modopt/ensemble.py | Python | mit | 1,558 |
# encoding: utf-8
# module pyexpat
# from /usr/lib/python2.7/lib-dynload/pyexpat.x86_64-linux-gnu.so
# by generator 1.135
""" Python wrapper for Expat parser. """
# imports
import pyexpat.errors as errors # <module 'pyexpat.errors' (built-in)>
import pyexpat.model as model # <module 'pyexpat.model' (built-in)>
# Vari... | ProfessorX/Config | .PyCharm30/system/python_stubs/-1247972723/pyexpat/__init__.py | Python | gpl-2.0 | 1,861 |
from .views import admin | joehand/DataNews | data_news/admin/__init__.py | Python | bsd-3-clause | 24 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
from setuptools import setup, find_packages
__author__ = 'Tim Martin'
__pkg_name__ = 'ripozo'
version = '1.2.4.dev0'
setup(
author=__author__,
author_email='ti... | AlexMaskovyak/ripozo | setup.py | Python | gpl-2.0 | 1,658 |
# -*- coding: utf-8 -*-
'''
A module to pull data from Cobbler via its API into the Pillar dictionary
Configuring the Cobbler ext_pillar
==================================
The same cobbler.* parameters are used for both the Cobbler tops and Cobbler pillar
modules.
.. code-block:: yaml
ext_pillar:
- cobbler:
... | MadeiraCloud/salt | sources/salt/pillar/cobbler.py | Python | apache-2.0 | 1,743 |
#!/usr/bin/env python2.6
import sys
import pika
host = sys.argv[1]
port = int(sys.argv[2])
user = sys.argv[3]
password = sys.argv[4]
ephemeral = sys.argv[5].lower() == 'true' # Indicates if the exchange is only temporary (for testing)
key = sys.argv[6]
body = sys.argv[7]
exchange='irods'
credentials = pika.PlainCred... | angrygoat/DE-Reference | ansible/roles/irods-config/files/amqptopicsend.py | Python | bsd-2-clause | 944 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.