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 |
|---|---|---|---|---|---|
#!/home/upmc_aren/python_env/bin/python
#-------------------------------------------------------------------------------
# Name: client.py
# Purpose: Pilot client for remote commands on planetlab nodes
#
# Author: Guthemberg Silvestre
#
# License:
#======================================================... | guthemberg/yanoama | contrib/yanoama/pilot_client.py | Python | bsd-3-clause | 3,811 |
#!/usr/bin/env python3
import urllib3
import sys
import os
import json
import re
from datetime import datetime
import urllib.parse
import requests
import time
urllib3.disable_warnings()
projects_url = 'https://bitbucket.test.com/rest/api/1.0/projects'
project_key = 'IMA'
batch_size = 100
workspace = os.getenv('WORKSPA... | gwsu2008/automation | python/ipa-branch-diff.py | Python | gpl-2.0 | 4,161 |
from shyft import api
from netcdftime import utime
import numpy as np
""" These are the current supported regular time-step intervals """
delta_t_dic = {'days': api.deltahours(24), 'hours': api.deltahours(1), 'minutes': api.deltaminutes(1),
'seconds': api.Calendar.SECOND}
def convert_netcdf_time(time_... | felixmatt/shyft | shyft/repository/netcdf/time_conversion.py | Python | lgpl-3.0 | 1,170 |
"""Setup for the deepmind_lab module."""
import setuptools
setuptools.setup(
name='deepmind-lab',
version='1.0',
description='DeepMind Lab: A 3D learning environment',
long_description='',
url='https://github.com/deepmind/lab',
author='DeepMind',
packages=setuptools.find_packages(),
in... | deepmind/lab | python/pip_package/setup.py | Python | gpl-2.0 | 491 |
from google.appengine.ext import ndb
from backend.common.models.event import Event
from backend.common.models.event_team import EventTeam
from backend.common.models.keys import EventKey
from backend.common.models.team import Team
from backend.common.queries.team_query import EventEventTeamsQuery
def preseed_event_te... | the-blue-alliance/the-blue-alliance | src/backend/common/queries/tests/event_event_teams_query_test.py | Python | mit | 984 |
#!/usr/bin/env python
topics = {
'arn:aws:sns:us-east-1::dynamodb' : 'qa',
#'arn:aws:sns:us-east-1::alp-demo-dynamodb' : 'demo',
#'arn:aws:sns:us-east-1::alp-staging-dynamodb' : 'staging',
#'arn:aws:sns:us-east-1::dynamodb-throttledRequests' : 'prod',
... | johnkastler/aws | get_dynamodb_metrics.py | Python | gpl-3.0 | 2,198 |
# Embedded file name: /usr/lib/enigma2/python/Plugins/SystemPlugins/ItalyCore/__init__.py
from Components.Language import language
from Tools.Directories import resolveFilename, SCOPE_PLUGINS, SCOPE_LANGUAGE
import os, gettext
PluginLanguageDomain = 'italysat'
PluginLanguagePath = 'SystemPlugins/ItalyCore/locale'
... | kingvuplus/boom2 | lib/python/Plugins/SystemPlugins/ItalyCore/__init__.py | Python | gpl-2.0 | 751 |
# encoding: latin2
"""
Objective functions
"""
__author__ = "Juan C. Duque"
__credits__ = "Copyright (c) 2009-11 Juan C. Duque"
__license__ = "New BSD License"
__version__ = "1.0.0"
__maintainer__ = "RiSE Group"
__email__ = "contacto@rise-group.org"
from distanceFunctions import distMethods
import numpy as np
def ge... | clusterpy/clusterpy | clusterpy/core/toolboxes/cluster/componentsAlg/objFunctions.py | Python | bsd-3-clause | 4,562 |
# -*- coding: utf-8 -*-
"""
* Copyright (c) 2017 SUSE LLC
*
* openATTIC is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 2.
*
* This package is distributed in the hope that it will be usefu... | openattic/openattic | backend/ceph_nfs/views/ganesha_mgr_view.py | Python | gpl-2.0 | 4,167 |
from rest_framework import response
from rest_framework import serializers
from rest_framework_jwt.views import ObtainJSONWebToken
from rest_framework_jwt.settings import api_settings
from rest_framework.settings import api_settings as rest_api_settings
from djangorestframework_camel_case.render import CamelCaseJSONRen... | ballotify/django-backend | ballotify/apps/api_v1/auth/views.py | Python | agpl-3.0 | 1,287 |
from distutils.core import setup, Extension
cservice_mod = Extension("cservice",
define_macros = [
('MAJOR_VERSION', '1'),
('MINOR_VERSION', '0')
],
extra_compile_args=['-std=c99'],
include_dirs = ['cservice'],
sources = [
... | pmermoz/picammory | picammory/setup.py | Python | gpl-2.0 | 725 |
import imex
from imex.metadata import Tag, ImageMetadata
class MetadataEditor(object):
def __init__(self, rules, keep_timestamps = True, **kwargs):
"""
Supported keyword arguments:
* debug
* dry_run
"""
self._keep_timestamps = keep_timestamps
s... | jdevera/imex | src/imex/metadataeditor.py | Python | mit | 10,950 |
# 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
#
#... | rickerc/neutron_audit | neutron/plugins/openvswitch/common/config.py | Python | apache-2.0 | 3,910 |
from __future__ import absolute_import
import json
import sys
import os
import time
from subprocess import call, Popen
from multiprocessing import cpu_count
import click
import pip
from realms import config, create_app, db, __version__, cli, cache
from realms.lib.util import random_string, in_virtualenv, green, yell... | larsimmisch/realms-wiki | realms/commands.py | Python | gpl-2.0 | 11,088 |
# configobj.py
# A config file reader/writer that supports nested sections in config files.
# Copyright (C) 2005-2010 Michael Foord, Nicola Larosa
# E-mail: fuzzyman AT voidspace DOT org DOT uk
# nico AT tekNico DOT net
# ConfigObj 4
# http://www.voidspace.org.uk/python/configobj.html
# Released subject to th... | rhinoman/wikifeat | scripts/libs/configobj.py | Python | bsd-3-clause | 87,184 |
#import CV libraries
import numpy
import cv2
img=cv2.imread("/home/udayan/Downloads/J.png", 0) #read image, 0=read as grayscale, -1=read as color
ret,thresh=cv2.threshold(img, 127, 255, cv2.THRESH_BINARY) #threshold image
kernel=cv2.getStructuringElement(cv2.MORPH_RECT, (5,5)) #get 5x5 structuring element,... | UdayanSinha/Code_Blocks | OpenCV/cv_morphological_operations.py | Python | mit | 2,134 |
# Rekall Memory Forensics
#
# Copyright 2013 Google Inc. All Rights Reserved.
#
# Authors:
# Michael Cohen <scudette@gmail.com>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2... | palaniyappanBala/rekall | rekall-core/rekall/plugins/windows/pfn.py | Python | gpl-2.0 | 19,124 |
# -*- coding: utf-8 -*-
# Copyright 2012 Loris Corazza, Sakis Christakidis
#
# 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
#
# U... | schristakidis/p2ner | p2ner/components/pipeelement/messageparserelement/messageparserelement/constructs/basemessage.py | Python | apache-2.0 | 1,086 |
import mock
from datetime import datetime
from flask import current_app
from oauth2client import GOOGLE_REVOKE_URI, GOOGLE_TOKEN_URI
from oauth2client.client import OAuth2Credentials
from changes.models import User
from changes.testutils import TestCase
class LoginViewTest(TestCase):
def test_simple(self):
... | alex/changes | tests/changes/web/test_auth.py | Python | apache-2.0 | 1,928 |
'''
Created on Oct 28, 2016
@author: Jeff
'''
import os, inspect
cmdFolder = os.path.realpath(os.path.abspath(os.path.split(inspect.getfile( inspect.currentframe() ))[0]))
import wx
from psettings import PrtSettings
from images import Images
from manualctl import ManualCtl
from heaters import Heaters
from tempgrap... | jbernardis/repraptoolbox | src/Printer/printer.py | Python | gpl-3.0 | 12,308 |
#!/usr/bin/env python
#Boa:PyApp:main
#-----------------------------------------------------------------------------
# Name: XMLtagsNattrsNvalsWrefs.py
# Purpose: Displays xml tags with attributes used and values. Gives
# reference for first occurance of each value.
#
# Author: <greg... | sillsdev/DblMetaData | xmlMarkup/XMLtagsNattrsNvalsWrefs.py | Python | mit | 4,655 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import pykka
from urlparse import urlparse
from multiprocessing.pool import ThreadPool
from mopidy import backend
from mopidy.models import Track
from mopidy.models import Album
from mopidy.models import SearchResult
from grooveshark import Client
from... | camilonova/mopidy-grooveshark | mopidy_grooveshark/backend.py | Python | mit | 3,481 |
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
# This program is distributed in the hope that it will be useful,
# but... | csutherl/sos | sos/plugins/ntp.py | Python | gpl-2.0 | 1,526 |
# Copyright 2015 Rackspace Australia
#
# 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 ... | wikimedia/integration-zuul | zuul/lib/connections.py | Python | apache-2.0 | 2,373 |
# -*- coding: utf-8 -*-
"Differential operators."
# Copyright (C) 2008-2016 Martin Sandve Alnæs
#
# This file is part of UFL (https://www.fenicsproject.org)
#
# SPDX-License-Identifier: LGPL-3.0-or-later
#
# Modified by Anders Logg, 2009.
from ufl.log import error
from ufl.core.expr import Expr
from ufl.core.termi... | FEniCS/ufl | ufl/differentiation.py | Python | lgpl-3.0 | 13,722 |
from types import FunctionType
from typing import Callable, Optional, Union
from ray.serve.pipeline.node import ExecutorPipelineNode, INPUT, PipelineNode
from ray.serve.pipeline.common import ExecutionMode, str_to_execution_mode, StepConfig
def _validate_step_args(*args, **kwargs):
"""Validate arguments passed i... | ray-project/ray | python/ray/serve/pipeline/step.py | Python | apache-2.0 | 4,708 |
# Todo build a more comprehensive list of throughways.
# See: http://www.semaphorecorp.com/cgi/abbrev.html
# have to treat broadway & bowery as a thhoroughfare
# because they are valid street names and thoroughfares in of
# themselves
names = [
'avenue',
'boulevard',
'bowery',
'broadway',
'circle',... | cds-amal/addressparser | nyctext/neighborhoods/throughways.py | Python | mit | 608 |
# -*- coding: utf-8 -*-
##
# Copyright 2017 FIWARE Foundation, e.V.
# 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... | flopezag/fiware-management-scripts | Common/emailer.py | Python | apache-2.0 | 9,073 |
# This file is part of Buildbot. Buildbot is free software: you can
# redistribute it and/or modify it under the terms of the GNU General Public
# License as published by the Free Software Foundation, version 2.
#
# This program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without eve... | nysan/yocto-autobuilder | lib/python2.6/site-packages/buildbot-0.8.4p1-py2.6.egg/buildbot/test/unit/test_db_buildsets.py | Python | gpl-2.0 | 19,394 |
# -*- coding: UTF-8 -*-
# Copyright (C) 2011 Juan David Ibáñez Palomar <jdavid@itaapy.com>
#
# 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 of the License, or
# (at your option... | bepatient-fr/ikaaro | ikaaro/config_captcha.py | Python | gpl-3.0 | 8,533 |
# 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... | hfp/tensorflow-xsmm | tensorflow/python/ops/init_ops_v2.py | Python | apache-2.0 | 24,709 |
from yapsy.IPlugin import IPlugin
from yapsy.PluginManager import PluginManager
from django.template import loader, Context
from django.db.models import Count
from server.models import *
from django.shortcuts import get_object_or_404
import server.utils as utils
class OperatingSystem(IPlugin):
def show_widget(self... | salsoftware/sal | server/plugins/munkiversion/munkiversion.py | Python | gpl-3.0 | 2,210 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
__author__ = 'Michael Liao'
'''
Build release package.
'''
import os, re
from datetime import datetime
from fabric.api import *
# linux user:
env.user = 'root'
# linux hosts:
# env.hosts = ['www.liaoxuefeng.com', 'www.liaoxuefeng.com:23']
# linux mysql user and passw... | AnXi-TieGuanYin-Tea/itranswarp.js | fabfile.py | Python | apache-2.0 | 5,750 |
# -*- coding: utf-8 -*-
from setuptools import setup, find_packages
setup(
name='django-xanax',
version='0.1.0',
author='Vishnevski Alexey',
author_email='vishnevski.a@gmail.com',
packages=find_packages(),
include_package_data=True,
url='http://pypi.python.org/pypi/django-xanax/',
lice... | vishnevski/django-xanax | setup.py | Python | bsd-3-clause | 543 |
#Known Types
import integer
import string
import path
import bool
from map import map
from list import list
| amcgee/pymomo | pymomo/utilities/typedargs/types/__init__.py | Python | lgpl-3.0 | 109 |
#!/usr/bin/env python
import sys
import json
import argparse
from turtlelsystem.LSystem import LSystem, LSystemOverflow
from turtlelsystem.TurtleCommands import TurtleCommands
from turtlelsystem.TurtleMachine import TurtleMachine
from turtlelsystem.TurtleSVGMachine import TurtleSVGMachine
from turtlelsystem.Sph... | ptrgags/turtle-fractals | fractals.py | Python | gpl-2.0 | 1,645 |
#------------------------------------------------------------------------------
# Copyright (c) 2008, Riverbank Computing Limited
# All rights reserved.
#
# This software is provided without warranty under the terms of the BSD license.
# However, when used with the GPL version of PyQt the additional terms described
# i... | enthought/traitsbackendqt | enthought/traits/ui/qt4/table_model.py | Python | gpl-2.0 | 11,338 |
from __future__ import unicode_literals
import time
from decimal import Decimal
from unittest import TestCase
from django.http import HttpResponse, HttpResponseForbidden
import jwt
from mock import MagicMock
from . import GoogleWalletProvider
PAYMENT_TOKEN = '5a4dae68-2715-4b1e-8bb2-2c2dbe9255f6'
SELLER_ID = 'abc123... | bogdal/django-payments | payments/wallet/tests.py | Python | bsd-3-clause | 3,631 |
# Copyright 2021 The QHBM Library 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appl... | google/qhbm-library | qhbmlib/data/qhbm_data.py | Python | apache-2.0 | 1,341 |
"""Example of using hangups to receive chat messages.
Uses the high-level hangups API.
"""
import asyncio
import hangups
from common import run_example
async def receive_messages(client, args):
print('loading conversation list...')
user_list, conv_list = (
await hangups.build_user_conversation_lis... | das7pad/hangups | examples/receive_messages.py | Python | mit | 689 |
##
# Copyright 2009-2016 Ghent University
#
# This file is part of hanythingondemand
# originally created by the HPC team of Ghent University (http://ugent.be/hpc/en),
# with support of Ghent University (http://ugent.be/hpc),
# the Flemish Supercomputer Centre (VSC) (https://vscentrum.be/nl/en),
# the Hercules foundati... | boegel/hanythingondemand | hod/config/autogen/hbase.py | Python | gpl-2.0 | 4,659 |
import os
import sys
import logging
from sendfile import sendfile
from tqdm import tqdm
import usbdisks
BUFFSIZE = (1024 ** 2) * 2 # 2MB
def filesize(filepath):
return os.path.getsize(filepath)
def write(filepath, target):
"""
Copy a large file while reporting progress.
This functi... | Sanqui/fedorator | src/write.py | Python | gpl-2.0 | 1,510 |
# Copyright 2013 IBM Corp.
#
# 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... | nikesh-mahalka/nova | nova/api/openstack/compute/legacy_v2/contrib/extended_virtual_interfaces_net.py | Python | apache-2.0 | 2,104 |
# coding: utf-8
from __future__ import unicode_literals
import json
import os
import re
import subprocess
import tempfile
from .common import InfoExtractor
from ..compat import (
compat_urlparse,
compat_kwargs,
)
from ..utils import (
check_executable,
determine_ext,
encodeArgument,
ExtractorE... | ping/youtube-dl | youtube_dl/extractor/openload.py | Python | unlicense | 14,805 |
import argparse
import torch
import torch.nn.functional as F
from torch.utils.data import DataLoader
from torch_geometric.utils import negative_sampling
from ogb.linkproppred import PygLinkPropPredDataset, Evaluator
from logger import Logger
class LinkPredictor(torch.nn.Module):
def __init__(self, in_channels,... | snap-stanford/ogb | examples/linkproppred/ddi/mf.py | Python | mit | 7,690 |
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/
'''
Scanning module to interact with OPSWAT Metadefender Core 4 Version 3.x.
The scan() method submits a set of files to t... | awest1339/multiscanner | modules/Antivirus/Metadefender.py | Python | mpl-2.0 | 11,342 |
# The MIT License (MIT)
#
# Copyright (c) 2015 Christian Zielinski
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, cop... | czielinski/portfolioopt | portfolioopt/portfolioopt.py | Python | mit | 9,550 |
# -*- coding: utf-8 -*-
''' accpy.math.specialfuns
author: felix.kramer(at)physik.hu-berlin.de
'''
from numpy import exp, sqrt, pi, sin, cos, linspace, logspace, log2
def gauss(x, amp, mu, sigma, offset):
''' gauss(x, a, mu, sigma, offset) =
a*exp(-(((x-mu)/sigma)**2)/2)/sigma/sqrt(2*pi)+offset
x ... | kramerfelix/accpy | accpy/math/specialfuns.py | Python | gpl-3.0 | 1,992 |
#
#
# Copyright (C) 2006, 2007, 2010, 2013 Google 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 2 of the License, or
# (at your option) any later version.
#
# This progr... | vladimir-ipatov/ganeti | lib/client/gnt_os.py | Python | gpl-2.0 | 8,471 |
#!/usr/bin/python
#
# 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 ag... | google-research/tiny-differentiable-simulator | python/examples/d_meshcat_tinymultibody.py | Python | apache-2.0 | 4,168 |
###############################################################################
##
## Copyright (C) 2014-2015, New York University.
## Copyright (C) 2011-2014, NYU-Poly.
## Copyright (C) 2006-2011, University of Utah.
## All rights reserved.
## Contact: contact@vistrails.org
##
## This file is part of VisTrails.
##
## ... | hjanime/VisTrails | vistrails/db/versions/v0_8_0/__init__.py | Python | bsd-3-clause | 1,965 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
from django.db import models
from django.contrib.contenttypes.models import ContentType
from django.contrib.contenttypes import generic
from .boundary import BoundaryType
import datetime
from .institution import default_end_date
class Programme(models.Model):
""" This clas... | klpdotorg/tada | apps/schools/models/programs.py | Python | mit | 1,273 |
# -*- 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-contact-center-insights | samples/generated_samples/contactcenterinsights_v1_generated_contact_center_insights_update_view_async.py | Python | apache-2.0 | 1,530 |
__all__ = ["piece", "puzzle", "compatibility"]
| JanTkacik/nao-puzzle-solver | imageresolve/puzzlesolver/model/__init__.py | Python | mit | 47 |
#!/usr/bin/python
from openLSmisc import *
REQUEST_GEOCODE_START_FREE_FORM_ADDRESS = " <xls:Request methodName=\"GeocodeRequest\" requestID=\"123456789\" version=\"1.1\"><xls:GeocodeRequest><xls:Address countryCode=\"DE\"> <xls:freeFormAddress>"
REQUEST_GEOCODE_STOP_FREE_FORM_ADDRESS = "</xls:freeFormAddress></xls:Add... | doedeloe/v-bike-routing | openLS/geocoding.py | Python | gpl-2.0 | 1,893 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Date : 2015-12-19 02:09:53
# @Author : Gefu Tang (tanggefu@gmail.com)
# @Link : https://github.com/primetang/pylsd
# @Version : 0.0.1
from PIL import Image, ImageDraw
import numpy as np
import os
from pylsd import lsd
fullName = 'house.png'
folder, imgName = os.p... | primetang/LSD-OpenCV-MATLAB | pylsd/example/example_PIL.py | Python | gpl-3.0 | 746 |
# Copyright 2014 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.
from telemetry.page import page as page_module
from telemetry.page import page_set as page_set_module
class MobileMemoryPage(page_module.Page):
def __ini... | mou4e/zirconium | tools/perf/page_sets/mobile_memory.py | Python | bsd-3-clause | 3,444 |
# -*- coding: utf-8 -*-
#Canto-curses - ncurses RSS reader
# Copyright (C) 2014 Jack Miller <jack@codezen.org>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
# published by the Free Software Foundation.
from canto_ne... | stpx/canto-curses | canto_curses/color.py | Python | gpl-2.0 | 1,942 |
#!/usr/bin/env python
#
# 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
# "... | wprice/qpid-proton | examples/python/helloworld.py | Python | apache-2.0 | 1,622 |
# -*- coding: utf-8 -*-
"""
Copyright (C) 2015, MuChu Hsu
Contributed by Muchu Hsu (muchu1983@gmail.com)
This file is part of BSD license
<https://opensource.org/licenses/BSD-3-Clause>
"""
import unittest
import logging
from cameo.spiderForPEDAILY import SpiderForPEDAILY
"""
測試 抓取 PEDAILY
"""
class SpiderForPEDAILYTe... | muchu1983/104_cameo | test/unit/test_spiderForPEDAILY.py | Python | bsd-3-clause | 1,237 |
import _plotly_utils.basevalidators
class UirevisionValidator(_plotly_utils.basevalidators.AnyValidator):
def __init__(self, plotly_name="uirevision", parent_name="scattermapbox", **kwargs):
super(UirevisionValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name... | plotly/python-api | packages/python/plotly/plotly/validators/scattermapbox/_uirevision.py | Python | mit | 453 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
from django.conf import settings
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
operations = [
migrations.Create... | soshace/taskboard | website/migrations/0001_initial.py | Python | unlicense | 1,626 |
import json
from django.db import models
from django.forms.fields import Field
from django.forms.utils import ValidationError
# modified version of JSONField and JSONFormField: bradjasper/django-jsonfield
class EnvironmentFormField(Field):
def clean(self, value):
if not value and not self.required:
... | blossomica/airmozilla | airmozilla/main/fields.py | Python | bsd-3-clause | 2,417 |
#!/bin/python
import os, subprocess
import logging
from autotest.client import test
from autotest.client.shared import error
class setup(test.test):
"""
Autotest module for testing basic functionality
of setup
@author Madhuri Appana, madhuria@linux.vnet.ibm.com
"""
version = 1
nfail = 0
... | PoornimaNayak/autotest-client-tests | linux-tools/setup/setup.py | Python | gpl-2.0 | 1,170 |
import py
from rpython.rtyper.lltypesystem.lloperation import LL_OPERATIONS, llop, void
from rpython.rtyper.lltypesystem import lltype, opimpl
from rpython.rtyper.llinterp import LLFrame
from rpython.rtyper.test.test_llinterp import interpret
from rpython.rtyper import rclass
from rpython.rlib.rarithmetic import LONGLO... | oblique-labs/pyVM | rpython/rtyper/lltypesystem/test/test_lloperation.py | Python | mit | 6,506 |
"""Support for Iperf3 network measurement tool."""
from datetime import timedelta
import logging
import iperf3
import voluptuous as vol
from homeassistant.components.sensor import DOMAIN as SENSOR_DOMAIN
from homeassistant.const import (
CONF_HOST,
CONF_HOSTS,
CONF_MONITORED_CONDITIONS,
CONF_PORT,
... | joopert/home-assistant | homeassistant/components/iperf3/__init__.py | Python | apache-2.0 | 5,605 |
##############################################################################
# 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/soapsnp/package.py | Python | lgpl-2.1 | 1,823 |
#!/usr/bin/python
#
# pyTES_Jenkins.py
# Copyright (C) 2017 eabeda <elyes.abeda@gmail.com>
#
# pyTES is free software: you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the
# Free Software Foundation, either version 3 of the License, or
# (at your option) any ... | eabeda/pyTES | src/pyTES_Jenkins.py | Python | gpl-3.0 | 30,358 |
#!/usr/bin/env python3
from setuptools import setup, find_packages
setup(
name='flask_truss',
version='0.0.1',
packages=find_packages(),
zip_safe=False,
include_package_data=True,
package_data={
'templates': 'flask_truss/templates/*',
'static': 'flask_truss/static/*',
'... | bmoar/flask-truss | setup.py | Python | mit | 1,261 |
# -*- coding: utf-8 -*-
# Copyright 2007-2022 The HyperSpy developers
#
# This file is part of HyperSpy.
#
# HyperSpy is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at y... | jat255/hyperspy | hyperspy/tests/signals/test_complex_signal.py | Python | gpl-3.0 | 8,325 |
class NotFound(Exception):
pass
class BadRequest(Exception):
pass
| kevinjqiu/mailchute | mailchute/api/exception.py | Python | bsd-3-clause | 76 |
from app.models import Permission
__author__ = 'rabbi'
from flask import Blueprint
main = Blueprint('main', __name__)
from . import views, errors
@main.app_context_processor
def inject_permissions():
return dict(Permission=Permission) | rabbicse/Python-SocialBlog | app/main/__init__.py | Python | lgpl-3.0 | 242 |
# coding=utf-8
import unittest
from u2flib_server.utils import websafe_encode, websafe_decode
class TestWebSafe(unittest.TestCase):
# Base64 vectors adapted from https://tools.ietf.org/html/rfc4648#section-10
def test_websafe_decode(self):
self.assertEqual(websafe_decode(b''), b'')
self.ass... | Yubico/python-u2flib-server | test/test_utils.py | Python | bsd-2-clause | 1,425 |
from cfn_pyplates import core, functions
from respawn import util
from errors import RespawnResourceError
class BlockDeviceMapping(core.JSONableDict):
"""
Creates a Block Device Mapping
:param device_name: String
kwargs
- ebs: EC2 EBS Block Device
- no_device: Boo... | dowjones/respawn | respawn/ec2.py | Python | isc | 20,375 |
# Copyright (c) 2015 RIPE NCC
#
# 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 of the License, or
# (at your option) any later version.
#
# This program is distributed in the h... | robert-kisteleki/ripe-atlas-tools | tests/helpers/validators.py | Python | gpl-3.0 | 5,549 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from app.controllers import IndexController
from app.controllers import QController
from app.controllers import SettingsPartiesController
from app.controllers import SettingsTubiController
from app.controllers import StartController
from app.controllers.auth import LoginAu... | comick/barduino | app/urls.py | Python | mit | 1,110 |
"""Tests for acme.challenges."""
import unittest
import mock
import OpenSSL
import requests
from six.moves.urllib import parse as urllib_parse # pylint: disable=import-error
from acme import errors
from acme import jose
from acme import test_util
CERT = test_util.load_comparable_cert('cert.pem')
KEY = jose.JWKRSA... | mitnk/letsencrypt | acme/acme/challenges_test.py | Python | apache-2.0 | 15,928 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright 2009 Luca Beltrame <einar@heavensinferno.net>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License, under
# version 2 of the License, or (at your option) any later version.
#
# ... | lbeltrame/danbooru-client | danbooru/mainwindow.py | Python | gpl-2.0 | 18,760 |
__author__ = 'Nils Schmidt'
class Resetable:
def reset(self):
raise NotImplementedError
| miniworld-project/miniworld_core | miniworld/model/singletons/Resetable.py | Python | mit | 103 |
import datetime
import os
from collections import defaultdict
from django import forms
from django.conf import settings
import basket
import happyforms
import waffle
from tower import ugettext as _, ugettext_lazy as _lazy
import amo
from addons.models import Addon, AddonUpsell, BlacklistedSlug, Webapp
from amo.utils... | jinankjain/zamboni | mkt/submit/forms.py | Python | bsd-3-clause | 19,036 |
import unittest
from _importer import refresh_gui
from gtkmvc3 import Model, View, Controller
from gi.repository import Gtk
# Shows how a group of radio actions can be adapted to a
# unique OP. The integer value of the OP is the value of the
# actions. The setting is bi-directional, but to set the
# active radio the ... | roboogle/gtkmvc3 | gtkmvco/tests/adapter_radio_buttons_active.py | Python | lgpl-2.1 | 2,519 |
# -*- coding: utf-8 -*-
import re
from django.db import models
from wms.models import Style, Variable
from wms.utils import DotDict
from wms.utils import split
from wms import logger
class LayerBase(models.Model):
var_name = models.CharField(max_length=200, help_text="Variable name from dataset")
std_na... | brianmckenna/sci-wms | wms/models/layer.py | Python | gpl-3.0 | 6,384 |
from utils import dp
from enum_csv import CSV_TEMP, CSV_RH
# dla wygody zmieniam to w jeden slownik danych. Mega wygodne
def get_output_data(data_row, temp_stats):
dew_point = dp(float(data_row[CSV_TEMP]), float(data_row[CSV_RH]))
return {
'temperature': data_row[CSV_TEMP],
'max': temp_stats['a... | firemark/cc-workshop | modules/output.py | Python | mit | 1,160 |
#!/usr/bin/env python
#coding=utf-8
#======================================================================
#$RCSfile: setup.py,v $
#$Author: bing.jian $
#$Date: 2009-02-10 02:13:49 -0500 (Tue, 10 Feb 2009) $
#$Revision: 121 $
#======================================================================
from distutils.cor... | bing-jian/gmmreg | C++/setup.py | Python | gpl-3.0 | 1,191 |
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import http
from odoo.http import request
class OnboardingController(http.Controller):
@http.route('/sales/sale_quotation_onboarding_panel', auth='user', type='json')
def sale_quotation_onboarding(se... | ddico/odoo | addons/sale/controllers/onboarding.py | Python | agpl-3.0 | 922 |
# -*- coding: utf-8 -*-
#
# This file is part of INSPIRE.
# Copyright (C) 2014-2017 CERN.
#
# INSPIRE is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any ... | zzacharo/inspire-next | inspirehep/modules/migrator/cli.py | Python | gpl-3.0 | 6,753 |
import logging
from django.core.exceptions import ImproperlyConfigured
from rest_framework.permissions import BasePermission
from ...settings import oauth2_settings
log = logging.getLogger('oauth2_provider')
SAFE_HTTP_METHODS = ['GET', 'HEAD', 'OPTIONS']
class TokenHasScope(BasePermission):
"""
The requ... | vmalavolta/django-oauth-toolkit | oauth2_provider/ext/rest_framework/permissions.py | Python | bsd-2-clause | 1,922 |
import pprint
pp = pprint.PrettyPrinter(indent=4)
def getFileAsList(file):
list = []
for line in open(file, 'rb').readlines():
line = line.rstrip('\n')
line = line.rstrip('\r')
if line <> "":
list.append(line)
return list
tl... | LewisMcMahon/Domain-hack-checker | checker.py | Python | mit | 765 |
#!/bin/env python
import csv
from dd import def_dict
from postcodes import fix_postcode
import sys
def read_GP_address(gpfile, location_lookup):
"""
GP address file is like this:
201406,A81001,THE DENSHAM SURGERY ,THE HEALTH CENTRE ,LAWSON STREET ,STOCKTON ,CLEVELAND ,TS18 1HU
[0] [1] ... | barryrowlingson/dispensr | inst/python/gp_reader.py | Python | mit | 1,498 |
from django.core.urlresolvers import reverse
from django.test.client import Client
from bulbs.utils.test import BaseAPITestCase
from bulbs.content.models import FeatureType
class FeatureTypeApiTestCase(BaseAPITestCase):
"""A base test case, allowing tearDown and setUp of the ES index"""
def test_tag_api_se... | pombredanne/django-bulbs | tests/api/test_feature_type_api.py | Python | mit | 1,132 |
import pandas as pd
import numpy as np
import pyaf.HierarchicalForecastEngine as hautof
import pyaf.Bench.TS_datasets as tsds
import datetime
#get_ipython().magic('matplotlib inline')
b1 = tsds.load_AU_infant_grouped_dataset();
# reduce the number of possible values of State.
b1.mHierarchy['Groups']['State'] = ["NS... | antoinecarme/pyaf | tests/hierarchical/test_grouped.py | Python | bsd-3-clause | 840 |
# Copyright (c) 2014 Mirantis Inc.
#
# Licensed under the Apache License, Version 2.0 (the License);
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agreed to in writing, ... | Mirantis/pumphouse | pumphouse/tasks/node.py | Python | apache-2.0 | 19,990 |
class Solution(object):
def search(self, nums, target):
"""
:type nums: List[int]
:type target: int
:rtype: int
"""
low, high = 0, len(nums) - 1
while low <= high:
mid = (low + high) / 2
# nums = 4 5 6 7 0 1 2, target = 6
# ... | zqfan/leetcode | algorithms/33. Search in Rotated Sorted Array/solution.py | Python | gpl-3.0 | 894 |
import shutil
import sys
from distutils import sysconfig
def main():
if sys.platform == 'win32':
shutil.rmtree('%s\\pacparser' % sysconfig.get_python_lib(),
ignore_errors=True)
shutil.copytree('pacparser', '%s\\pacparser' % sysconfig.get_python_lib())
else:
print 'This script should b... | mattseymour/pacparser | src/pymod/install_win32.py | Python | lgpl-3.0 | 389 |
from shortuuid.main import (
encode,
decode,
uuid,
random,
get_alphabet,
set_alphabet,
ShortUUID,
)
| devs1991/test_edx_docmode | venv/lib/python2.7/site-packages/shortuuid/__init__.py | Python | agpl-3.0 | 128 |
#!/usr/bin/python3.2
#
x = " "
words = [ "I'm", "done", "Mr.", "Duck" ]
print("words is ... ", words)
print("' '.join(...) is ... ", x.join(words))
print("split(' ') is ... ", x.join(words).split(" "))
#
r = "124.456"
print("r is ... ", float(r))
o = "777777"
print("octal 777777 is ... ", int(o))
#
try:
r = "1.4"
int... | ombt/ombt | pythonsrc/quick_python_book/chap6/string_ops.py | Python | mit | 1,089 |
#! /usr/bin/python3
########################################################################
# #
# Cyprium is a multifunction cryptographic, steganographic and #
# cryptanalysis tool developped by members of The Hackademy. #
# Fre... | underloki/Cyprium | kernel/stegano/text/spaces.py | Python | gpl-3.0 | 7,994 |
# Generated by Django 2.0 on 2018-01-25 06:41
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('adventure', '0043_auto_20170813_1501'),
]
operations = [
migrations.AddField(
model_name='artifact',
name='linked_door... | kdechant/eamon | adventure/migrations/0044_auto_20180124_2241.py | Python | mit | 880 |
# upgrade.py
# Upgrade CLI command.
#
# Copyright (C) 2014-2016 Red Hat, Inc.
#
# This copyrighted material is made available to anyone wishing to use,
# modify, copy, or redistribute it subject to the terms and conditions of
# the GNU General Public License v.2, or (at your option) any later version.
# This program is... | jsilhan/dnf | dnf/cli/commands/upgrade.py | Python | gpl-2.0 | 4,033 |
# Copyright 2015 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | DailyActie/Surrogate-Model | 01-codes/tensorflow-master/tensorflow/python/kernel_tests/cholesky_op_test.py | Python | mit | 3,822 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.