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 |
|---|---|---|---|---|---|
__author__ = 'Davide'
import pathlib
import shutil
import sys
import argparse
import logging
def parseArgs():
parser = argparse.ArgumentParser(description='Apply diffs.')
parser.add_argument('diff_file', type=str, help='diff file')
parser.add_argument('path_from', type=str, help='src folder')
parser.... | DavideCanton/PyComparePaths | apply_diff.py | Python | mit | 3,015 |
from django.forms import ModelForm, DateInput
from django.core.urlresolvers import reverse
from .models import Patient, PhoneLink, EmailLink, AddressLink, WebLink, Anamnesis, AnamnesisPrecision
from crispy_forms.helper import FormHelper
from crispy_forms.bootstrap import StrictButton
from bootstrap3_datetime.widgets im... | duarteluis/losteod | losteod/patient/forms.py | Python | gpl-2.0 | 6,845 |
#!/usr/bin/env python3
###############################################################################
# Copyright 2017 The Apollo 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... | xiaoxq/apollo | modules/tools/record_play/rtk_recorder.py | Python | apache-2.0 | 6,831 |
from django.http import HttpResponse
##
## Courtesy of tastypie
##
from djrest.common.helpers import json_parse
class HttpCreated(HttpResponse):
status_code = 201
def __init__(self, *args, **kwargs):
location = kwargs.pop('location', '')
super(HttpCreated, self).__init__(*args, **kwargs)
... | humwerthuz/djrest | djrest/http/responses.py | Python | mit | 2,012 |
# Copyright (c) 2014 Alcatel-Lucent Enterprise
# 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
#
# Un... | OpenTouch/python-facette | src/facette/client.py | Python | apache-2.0 | 1,202 |
# -*- 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 | tests/acceptance/steps/config_update.py | Python | apache-2.0 | 2,155 |
from panda3d.core import TrueClock
from direct.directnotify.DirectNotifyGlobal import directNotify
from direct.showbase.PythonUtil import (
StdoutCapture, _installProfileCustomFuncs,_removeProfileCustomFuncs,
_profileWithoutGarbageLeak, _getProfileResultFileInfo, _setProfileResultsFileInfo,
_clearProfileRes... | jjkoletar/panda3d | direct/src/showbase/ProfileSession.py | Python | bsd-3-clause | 12,702 |
import re
import types
from datetime import datetime, timedelta
from decimal import Decimal
from unittest import TestCase, mock
from django.core.exceptions import ValidationError
from django.core.files.base import ContentFile
from django.core.validators import (
BaseValidator, DecimalValidator, EmailValidator, Fil... | ar4s/django | tests/validators/tests.py | Python | bsd-3-clause | 30,598 |
# Copyright 2017 DataCentred 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 ag... | spjmurray/openstack-sentinel | sentinel/tests/functional/metering/v2/test_meters.py | Python | apache-2.0 | 1,567 |
import math
import sys
sys.path.append('..')
import Analyse.AFX as AFX
class State:
def __init__(self):
self.SenShifterState = True
self.MoodStrength = 1.0
self.positive = 0.0
self.negative = 0.0
def Process(self, score):
if self.SenShifterState is True:
self.positive += score
else:
self.negative ... | MyRookie/SentimentAnalyse | src/Algorithm/ScoreCaculating.py | Python | mit | 1,593 |
from baseContext import BaseContext
class DummyContext(BaseContext):
pass
| bitforks/drawbot | drawBot/context/dummyContext.py | Python | bsd-2-clause | 80 |
import numpy as np
import pandas as pd
import sys
import os
from datetime import datetime
from include.feature_lists import feature_list_names, numeric_features, categoric_features, date_features, idList
from include.dataset_fnames import generate_station_data_fname, generate_data_fname
from include.dataset_fnames im... | zakkum42/Bosch | src/00-create_data_files/extract_station_features.py | Python | apache-2.0 | 3,485 |
# coding=utf-8
# Copyright 2019 The Google AI Language Team Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by ... | google-research/tapas | tapas/utils/synthesize_entablement_test.py | Python | apache-2.0 | 17,659 |
#!/usr/bin/python2 -OO
import argparse
import os
import shutil
# archivematicaCommon
import archivematicaFunctions
from archivematicaFunctions import REQUIRED_DIRECTORIES, OPTIONAL_FILES
from custom_handlers import get_script_logger
import fileOperations
def restructureForComplianceFileUUIDsAssigned(unit_path, unit... | michal-ruzicka/archivematica | src/MCPClient/lib/clientScripts/restructureForComplianceSIP.py | Python | agpl-3.0 | 3,382 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# || ____ _ __
# +------+ / __ )(_) /_______________ _____ ___
# | 0xBC | / __ / / __/ ___/ ___/ __ `/_ / / _ \
# +------+ / /_/ / / /_/ /__/ / / /_/ / / /_/ __/
# || || /_____/_/\__/\___/_/ \__,_/ /___/\___/
#
# Copyright (C) 20... | manojngb/Crazyfly_simple_lift | src/cfclient/utils/input/inputinterfaces/__init__.py | Python | gpl-2.0 | 3,515 |
"""Mayavi/traits GUI for converting data from KIT systems."""
# Authors: Christian Brodbeck <christianbrodbeck@nyu.edu>
#
# License: BSD (3-clause)
from collections import Counter
import os
import queue
import sys
from threading import Thread
import numpy as np
from mayavi.core.ui.mayavi_scene import MayaviScene
fr... | kambysese/mne-python | mne/gui/_kit2fiff_gui.py | Python | bsd-3-clause | 28,793 |
from pygame import Rect
from widget import Widget
class GridView(Widget):
# cell_size (width, height) size of each cell
#
# Abstract methods:
#
# num_rows() --> no. of rows
# num_cols() --> no. of columns
# draw_cell(surface, row, col, rect)
# click_cell(row, col, event)
def __init__(se... | vejmelkam/emotiv-reader | albow/grid_view.py | Python | gpl-3.0 | 1,254 |
from __future__ import division, print_function, absolute_import
import warnings
import numpy as np
from numpy import cos, sin, pi
from numpy.testing import TestCase, run_module_suite, assert_equal, \
assert_almost_equal, assert_allclose, assert_
from scipy.integrate import (quadrature, romberg, romb, newton_cote... | asnorkin/sentiment_analysis | site/lib/python2.7/site-packages/scipy/integrate/tests/test_quadrature.py | Python | mit | 8,594 |
#
# $Id$
#
# Unpack binary data, all in network (big-endian) byte order.
#
import struct
from datetime import datetime, timedelta
def read_uint1(buf):
return struct.unpack("!B", buf)[0]
def read_uint2(buf):
return struct.unpack("!H", buf)[0]
def read_uint4(buf):
return struct.unpack("!I", buf)[0]
def r... | metno/mipp | mipp/xrit/bin_reader.py | Python | lgpl-3.0 | 1,406 |
""" Convert values between RGB hex codes and xterm-256 color codes.
Nice long listing of all 256 colors and their codes. Useful for
developing console color themes, or even script output schemes.
Thanks Micah Elliott http://MicahElliott.com for this helpful code.
"""
import sys, re
CLUT = [ # color look-up table
# ... | vuonghv/letgithub | letgithub/colortrans.py | Python | gpl-3.0 | 7,773 |
# Mantid Repository : https://github.com/mantidproject/mantid
#
# Copyright © 2018 ISIS Rutherford Appleton Laboratory UKRI,
# NScD Oak Ridge National Laboratory, European Spallation Source
# & Institut Laue - Langevin
# SPDX - License - Identifier: GPL - 3.0 +
#pylint: disable=invalid-name, no-init
from _... | mganeva/mantid | Framework/PythonInterface/plugins/algorithms/ExportSpectraMask.py | Python | gpl-3.0 | 7,860 |
import pygame
from pygame.locals import *
from lib.gameelements import *
__version__ = "0.1.1"
__author__ = 'MaxA <max.mazin@gmail.com>'
WINDOWWIDTH = 480
WINDOWHEIGHT = 640
BARWIDTH = 70
BARHEIGHT = 20
BARCOLOR = (180, 180, 180)
BASELINE = 10
BRICKWIDTH = 55
BRICKHEIGHT = 20
BRICKINTERVAL = 4
BRICKCOLOR = (0, ... | HookTeam/learning_proj | arcanoid.py | Python | gpl-2.0 | 11,082 |
'''
This module was created to get information available in the interpreter, such as libraries,
paths, etc.
what is what:
sys.builtin_module_names: contains the builtin modules embeeded in python (rigth now, we specify all manually).
sys.prefix: A string giving the site-specific directory prefix where the platform ind... | dannyperry571/theapprentice | script.module.pydevd/lib/interpreterInfo.py | Python | gpl-2.0 | 8,047 |
#
# IIT Kharagpur - Hall Management System
# System to manage Halls of residences, Warden grant requests, student complaints
# hall worker attendances and salary payments
#
# MIT License
#
"""
@ authors: Madhav Datt, Avikalp Srivastava
"""
import sys
from PyQt4.QtGui import *
from PyQt4 import QtCore, QtGui
import HM... | madhav-datt/kgp-hms | src/ui/HMC_GUI.py | Python | mit | 13,718 |
# Copyright 2013 Red Hat, 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 ... | tanglei528/glance | glance/store/gridfs.py | Python | apache-2.0 | 7,853 |
import GPy
import numpy as np
from scipy.optimize import check_grad
from emukit.bayesian_optimization.acquisitions import MultipointExpectedImprovement
from emukit.model_wrappers import GPyModelWrapper
# Tolerance needs to be quite high since the q-EI is also an approximation.
TOL = 5e-3
# Tolerance for the gradient ... | EmuKit/emukit | tests/emukit/bayesian_optimization/test_multipoint_expected_improvement.py | Python | apache-2.0 | 2,394 |
# Copyright (c) 2012 Ian C. Good
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distrib... | slimta/python-slimta-celeryqueue | slimta/__init__.py | Python | mit | 1,188 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations
def forward(apps, schema_editor):
Binary = apps.get_model('packages', 'Binary')
Binary.objects.filter(generated_binaries__isnull=True).delete()
class Migration(migrations.Migration):
dependencies = [
... | lamby/buildinfo.debian.net | bidb/packages/migrations/0002_drop-orphaned-binary-instances.py | Python | agpl-3.0 | 424 |
import argparse
import base64
import json
import numpy as np
import socketio
import eventlet
import eventlet.wsgi
import time
from PIL import Image
from PIL import ImageOps
from flask import Flask, render_template
from io import BytesIO
from keras.models import load_model
from keras.preprocessing.image import ImageD... | brianz/udacity-sdc-p3 | drive.py | Python | mit | 2,198 |
#! coding: utf-8
import logging
from django import http
from django import template
from django.conf import settings
from django.template import loader
from common import api
from common import component
from common import exception
from common import decorator
from common import display
from common import google_conta... | AloneRoad/Inforlearn | join/views.py | Python | apache-2.0 | 12,639 |
import urlparse
from copy import copy
from time import time
class HTTPHelper:
def __init__(self, init_request):
# Links a payload with an http request. Needed for async fuzzing.
# variable schema payload_table[id(request)] = payload
self.payload_table = {}
self.init_request = init... | sharad1126/owtf | framework/http/wafbypasser/core/http_helper.py | Python | bsd-3-clause | 2,583 |
# -*- coding: UTF-8 -*-
# Copyright 2009-2017 Rumma & Ko Ltd
# License: GNU Affero General Public License v3 (see file COPYING for details)
"""
Summary from <http://en.wikipedia.org/wiki/Restful>:
On an element:
- GET : Retrieve a representation of the addressed member of the collection expressed in an appr... | lino-framework/extjs6 | lino_extjs6/extjs/views.py | Python | bsd-2-clause | 17,893 |
#!/usr/bin/env python
"""
@package mi.dataset.driver.fdchp_a.dcl
@file mi/dataset/driver/fdchp_a/dcl/fdchp_a_dcl_telemetered_driver.py
@author Emily Hahn
@brief Driver for the fdchp series a through dcl telemetered instrument
"""
from mi.dataset.dataset_driver import SimpleDatasetDriver
from mi.dataset.parser.fdchp_a... | JeffRoy/mi-dataset | mi/dataset/driver/fdchp_a/dcl/fdchp_a_dcl_telemetered_driver.py | Python | bsd-2-clause | 1,442 |
# This file is part of pi-jukebox.
#
# pi-jukebox 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 later version.
#
# pi-jukebox is distributed ... | mark-me/Pi-Jukebox | screen_settings.py | Python | agpl-3.0 | 15,042 |
{
'submit': 'wy\xc5\x9blij',
'"update" is an optional expression like "field1=\'newvalue\'". You cannot update or delete the results of a JOIN': '"Uaktualnij" jest dodatkowym wyra\xc5\xbceniem postaci "pole1=\'nowawarto\xc5\x9b\xc4\x87\'". Nie mo\xc5\xbcesz uaktualni\xc4\x87 lub usun\xc4\x85\xc4\x87 wynik\xc3\xb3w z JO... | henkelis/sonospy | web2py/applications/admin/languages/pl.py | Python | gpl-3.0 | 14,805 |
import argparse
import sys
from threading import Thread
import cfme.utils.conf
from cfme.utils import path, trackerbot
from cfme.utils.conf import cfme_data
from cfme.utils.log import logger, add_stdout_handler
from cfme.utils.providers import list_provider_keys
from cfme.utils.template.base import TemplateUploadExcep... | lkhomenk/integration_tests | cfme/utils/template/template_upload.py | Python | gpl-2.0 | 6,617 |
import logging
import mock
import unittest
from mock import patch, Mock, MagicMock
import boto3
from botocore.stub import Stubber
import sys
sys.path.append("..")
import awslambda
from .lambda_helpers import MockLambdaContext, MockLambdaEvents
@patch('awslambda.utils.custom_resource.CFNCustomResource._send_response... | dliggat/local-lambda-toolkit | tests/test_custom_resource.py | Python | mit | 1,910 |
import logging
# Choose where to output your logs
logtoconsole = True
logtojournal = False
logtofile = True
"""
Set the threshold for this logger to lvl. Logging messages which are less
severe than lvl will be ignored. Choose one of these levels:
* CRITICAL
* ERROR
* WARNING
* INFO
* DEBUG
* NOTSET
"""
level = loggin... | naturalis/storage-analytics | utils/log.py | Python | apache-2.0 | 853 |
#!/usr/bin/env python
import unicornhat as unicorn
from PIL import Image
import sys, signal, numpy, time
unicorn.rotation(90)
unicorn.brightness(0.09)
def drawChar(offset_y, offset_x):
for x in range(7,-1,-1):
for y in range(8):
pixel = img.getpixel(((offset_x*8)+x,(offset_y*8)+y))
... | ukscone/unicornhat | unimess.py | Python | unlicense | 1,048 |
# -*- coding: utf-8 -*-
# !/usr/bin/env python
import glob
import re
import os
import sys
import xlrd
import django
sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))) + '/settings.py')
os.environ['DJANGO_SETTINGS_MODULE'] = 'znu.settings'
django.setup()
from timetable.models import Timetable,... | Vadimkin/ZNU-Timetable | parser/parser.py | Python | apache-2.0 | 4,204 |
'''
LICENSING
-------------------------------------------------
hypergolix: A python Golix client.
Copyright (C) 2016 Muterra, Inc.
Contributors
------------
Nick Badger
badg@muterra.io | badg@nickbadger.com | nickbadger.com
This library is free software; you can redistribute it and/o... | Muterra/py_hypergolix | hypergolix/embed.py | Python | unlicense | 24,158 |
class Rectangle:
def __init__(self, x=0, y=0, width=0, height=0):
self.x = x
self.y = y
self.width = width
self.height = height
def intersect(self, src):
pass
def union(self, src):
pass
| lovelysystems/pyjamas | pyjs/src/pyjs/lib/gdk.py | Python | apache-2.0 | 248 |
#!/usr/bin/env python
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
setup(
name='requests-data',
version='1.0',
description="'data' URL scheme support for the popular Requests HTTP library.",
long_description="'data' URL scheme support for the popular R... | jvantuyl/requests-data | setup.py | Python | lgpl-3.0 | 1,245 |
#!/usr/bin/env python
# (c) Copyright [2016] Hewlett Packard Enterprise Development LP
# 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/lic... | open-switch/ops-cli | tests/test_vtysh_ct_domainname.py | Python | gpl-2.0 | 4,303 |
# Copyright 2014 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 to in wri... | takeshineshiro/keystone | keystone/tests/unit/tests/test_core.py | Python | apache-2.0 | 1,740 |
"""
wxAnyThread: allow methods on wxPython objects to be called from any thread
In wxPython, methods that alter the state of the GUI are only safe to call from
the thread running the main event loop. Other threads must typically post
events to the GUI thread instead of invoking methods directly.
While there are ... | rfk/wxanythread | wxAnyThread/__init__.py | Python | mit | 3,472 |
#
# SelectTimeWidget and SplitSelectDateTimeWidget
#
# Original from:
# - http://djangosnippets.org/snippets/1206/
# - http://bradmontgomery.blogspot.gr/2008/11/extending-djangos-multiwidget.html
#
# Modified for reps.mozilla.org
#
import re
import time
from django.forms.extras.widgets import SelectDateWidget
from d... | ppapadeas/wprevents | vendor-local/lib/python/datetimewidgets.py | Python | bsd-3-clause | 9,015 |
# -*- coding: utf-8 -*-
#-------------------------------------------------------------------------------
# Name: rules.py
# Purpose: music21 class to define rules used in realization
# Authors: Jose Cabal-Ugaz
#
# Copyright: Copyright © 2010 Michael Scott Cuthbert and the music21 Project
# License:... | arnavd96/Cinemiezer | myvenv/lib/python3.4/site-packages/music21/figuredBass/rules.py | Python | mit | 8,992 |
# -*- coding: utf-8 -*-
import collections
import cStringIO
import datetime
import hashlib
import json
import itertools
import logging
import math
import os
import re
import sys
import textwrap
import uuid
from subprocess import Popen, PIPE
from urlparse import urlparse
import babel
import babel.dates
import werkzeug
... | bealdav/OCB | openerp/addons/base/ir/ir_qweb.py | Python | agpl-3.0 | 59,243 |
import sys
import os
from StringIO import StringIO
import textwrap
from distutils.core import Extension, Distribution
from distutils.command.build_ext import build_ext
from distutils import sysconfig
from distutils.tests import support
from distutils.errors import (DistutilsSetupError, CompileError,
... | MonicaHsu/truvaluation | venv/lib/python2.7/distutils/tests/test_build_ext.py | Python | mit | 19,477 |
"""
===========
Scheme Link
===========
"""
import enum
from AnyQt.QtCore import QObject
from AnyQt.QtCore import pyqtSignal as Signal, pyqtProperty as Property
from ..utils import name_lookup
from .errors import IncompatibleChannelTypeError
def compatible_channels(source_channel, sink_channel):
"""
Do the... | cheral/orange3 | Orange/canvas/scheme/link.py | Python | bsd-2-clause | 6,554 |
import os
import webapp2
from app import routes
webapp2_config = {'webapp2_extras.sessions':
{'secret_key': 'hfgskahjfgd736987qygukr3279rtigu',
'webapp2_extras.jinja2': {'template_path': os.path.join(os.path.abspath(os.path.dirname(__file__)), 'templates')}}}
application = webapp2.WSGIApplication(debug=True, c... | Terhands/saskdance | app/main.py | Python | gpl-3.0 | 373 |
def progress(current, total, percent=10, iteration=None):
"""
Used in a loop to indicate progress
"""
current += 1
if current:
previous = current - 1
else:
previous = current
# print out every percent
frac = percent/100.
value = max(1, frac*total)
retur... | CDNoyes/EDL-Py | Utils/progress.py | Python | gpl-3.0 | 521 |
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2013-Today OpenERP SA (<http://www.openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms ... | poiesisconsulting/openerp-restaurant | website_sale/models/product.py | Python | agpl-3.0 | 7,238 |
# coding: utf-8
"""
Kubernetes
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
OpenAPI spec version: v1.6.1
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from pprint import pformat
from six import iteritems
import re
... | skuda/client-python | kubernetes/client/models/v1alpha1_cluster_role_binding_list.py | Python | apache-2.0 | 6,312 |
import sys
if sys.version_info >= (3, 8):
from importlib import metadata
else:
import importlib_metadata as metadata
extensions = [
"sphinx.ext.autodoc",
"sphinx.ext.doctest",
"sphinx.ext.intersphinx",
"sphinx.ext.coverage",
"sphinx.ext.viewcode",
]
# Add any paths that contain templates... | RonnyPfannschmidt/pluggy | docs/conf.py | Python | mit | 2,311 |
# -*- coding: utf8 -*-
# This file is part of PyBossa.
#
# Copyright (C) 2013 SF Isle of Man Limited
#
# PyBossa 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... | OpenNewsLabs/pybossa | test/test_model/test_model_task.py | Python | agpl-3.0 | 1,833 |
#coding=utf-8
# Copyright (C) 2016 Tian Gao
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, p... | gaogaotiantian/zhihuquestions | topic.py | Python | mit | 6,091 |
"""Vislcg class is a writer for the VISL-cg format."""
from udapi.core.basewriter import BaseWriter
# https://dev.w3.org/html5/html-author/charref
ESCAPE_TABLE = {
'§': '§sect.',
'"': '§quot.',
'#': '§num.',
';': '§semi.',
'=': '§equals.',
'(': '§lpar.',
')': '§rpar.',
'|': '§verbar.',
... | udapi/udapi-python | udapi/block/write/vislcg.py | Python | gpl-3.0 | 3,261 |
# proxy module
from traitsui.wx.table_editor import *
| enthought/etsproxy | enthought/traits/ui/wx/table_editor.py | Python | bsd-3-clause | 54 |
# 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 agreed... | GoogleCloudPlatform/err-stackdriver | gcloudutils.py | Python | apache-2.0 | 1,486 |
# Copyright 2013-2020 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class Transabyss(Package):
"""De novo assembly of RNAseq data using ABySS"""
homepage = "ht... | iulian787/spack | var/spack/repos/builtin/packages/transabyss/package.py | Python | lgpl-2.1 | 971 |
# -*- coding: utf-8 -*-
import tkinter
def affiche_touche_pressee():
root.event_generate("<<perso>>", rooty=-5)
def perso(evt):
print("perso", evt.y_root)
root = tkinter.Tk()
b = tkinter.Button(text="clic", command=affiche_touche_pressee)
b.pack()
root.bind("<<perso>>", perso) # on intercepte un é... | sdpython/teachpyx | _todo/programme/exemple_bind_my.py | Python | mit | 361 |
from .base import Base
from core.bots.enums import TradeMode
import time
class Live(Base):
"""
Main class for Live Trading
"""
mode = TradeMode.live
def __init__(self):
super(Live, self).__init__(self.mode)
self.counter = 0
# open_orders = self.exchange.get_open_orders()
... | miti0/mosquito | core/bots/live.py | Python | gpl-3.0 | 2,187 |
"""
Module for harvesting data from the
Gatwick Aviation Society (GAS) aircraft database
DO NOT USE
"""
# Imports
import requests
from bs4 import BeautifulSoup
from db.pghandler import Connection
# Constants
GAS_URL = "http://www.gatwickaviationsociety.org.uk/modeslookup.asp"
GAS_FIELDS = {"Registration": "registrat... | GBPeters/upair | bot/gatwick.py | Python | gpl-3.0 | 3,495 |
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
from __future__ import unicode_literals
"""
Syncs a database table to the `DocType` (metadata)
.. note:: This module is only used internally
"""
import os
import frappe
from frappe import _
from frappe.utils import... | rohitwaghchaure/New_Theme_frappe | frappe/model/db_schema.py | Python | mit | 11,698 |
#!/bin/python
import vtk
import vtk.util.colors
points = vtk.vtkPoints()
points.InsertNextPoint(0, 0, 0)
points.InsertNextPoint(0, 1, 0)
points.InsertNextPoint(1, 0, 0)
points.InsertNextPoint(0, 0, 1)
pointsPolyData = vtk.vtkPolyData()
pointsPolyData.SetPoints(points)
pointsImageData = vtk.vtkImageData()
pointsImag... | trianam/tests | python/vtkBSplineOLD.py | Python | gpl-2.0 | 1,583 |
# Download the Python helper library from twilio.com/docs/python/install
from twilio.rest import Client
# Your Account Sid and Auth Token from twilio.com/user/account
account_sid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
auth_token = "your_auth_token"
client = Client(account_sid, auth_token)
maps = client.sync \
.se... | teoreteetik/api-snippets | sync/rest/maps/list-maps/list-maps.6.x.py | Python | mit | 459 |
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from datetime import datetime
from odoo.tools import DEFAULT_SERVER_DATETIME_FORMAT
from odoo.addons.product.tests import common
class TestCreatePicking(common.TestProductCommon):
def setUp(self):
super(Te... | t3dev/odoo | addons/purchase_stock/tests/test_create_picking.py | Python | gpl-3.0 | 14,473 |
#!/usr/bin/python
#
# LICENSE: See LICENSE file.
#
# WARNING: The Windows/Linux iface by is EXPERIMENTAL and has nothing to do
# with good coding, security, etc. USE AT YOUR OWN RISK.
#
import ifaceclientlib
print "Stopping WinLin iface: %s" % (
str(ifaceclientlib.Invoke("__shutdown"))
)
| gynvael/iface | if-stop.py | Python | mit | 305 |
# coding: utf-8
from vilya.models.utils import _missing
# from werkzeug.utils
# https://github.com/mitsuhiko/werkzeug/blob/master/werkzeug/utils.py#L35
class cached_property(object):
"""A decorator that converts a function into a lazy property. The
function wrapped is called the first time to retrieve the r... | xtao/code | vilya/models/utils/decorators.py | Python | bsd-3-clause | 1,607 |
from __future__ import print_function, division
import matplotlib
import logging
from sys import stdout
matplotlib.use('Agg') # Must be before importing matplotlib.pyplot or pylab!
from neuralnilm import (Net, RealApplianceSource,
BLSTMLayer, DimshuffleLayer,
Bidirectiona... | mmottahedi/neuralnilm_prototype | scripts/e525.py | Python | mit | 6,412 |
"""
Support for plotting vector fields.
Presently this contains Quiver and Barb. Quiver plots an arrow in the
direction of the vector, with the size of the arrow related to the
magnitude of the vector.
Barbs are like quiver in that they point along a vector, but
the magnitude of the vector is given schematically by t... | jonyroda97/redbot-amigosprovaveis | lib/matplotlib/quiver.py | Python | gpl-3.0 | 46,115 |
"""Tests for letsencrypt.storage."""
import datetime
import os
import shutil
import tempfile
import unittest
import configobj
import mock
import pytz
from letsencrypt import configuration
from letsencrypt import errors
from letsencrypt.storage import ALL_FOUR
from letsencrypt.tests import test_util
CERT = test_uti... | TheBoegl/letsencrypt | letsencrypt/tests/storage_test.py | Python | apache-2.0 | 32,669 |
# This file is part of ConfigFile - Parse and edit configuration files.
# Copyright (C) 2011-present Dario Giovannetti <dev@dariogiovannetti.net>
# Licensed under MIT
# https://github.com/kynikos/lib.py.configfile/blob/master/LICENSE
"""
This library provides the :py:class:`ConfigFile` class, whose goal is to
provide... | kynikos/lib.py.configfile | configfile/__init__.py | Python | mit | 60,029 |
"""OpenGL drawing functions for geometric primitives."""
import math
from ..math import vectorops
from ..math import se3
from ..math import spline
import ctypes
from OpenGL.GL import *
from OpenGL.GLUT import *
def point(p):
"""Draws a point at position p (either a 2d or 3d list/tuple)"""
glBegin(GL_POINTS)
... | krishauser/Klampt | Python/python2_version/klampt/vis/gldraw.py | Python | bsd-3-clause | 6,578 |
# 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.
"""Bootstrap Chrome Telemetry by downloading all its files from SVN servers.
Requires a DEPS file to specify which directories on which SVN servers
are requ... | Bysmyyr/chromium-crosswalk | tools/telemetry/telemetry/internal/util/bootstrap.py | Python | bsd-3-clause | 5,547 |
import numpy as np
import warnings
import subprocess
import pogoFunctions as pF
import pdb
from PolyInterface import poly
class PogoInput:
def __init__(self,
fileName,
elementTypes,
signals,
historyMeasurement,
nodes = None,
... | ab9621/PogoLibrary | pogoInput.py | Python | gpl-3.0 | 17,129 |
"""
SALTS XBMC Addon
Copyright (C) 2014 tknorris
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.
T... | JamesLinEngineer/RKMC | addons/plugin.video.salts/scrapers/santaseries_scraper.py | Python | gpl-2.0 | 3,959 |
# This file is part of beets.
# Copyright 2011, Philippe Mongeau.
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy... | MusikPolice/beets | beetsplug/rdm.py | Python | mit | 1,998 |
import time
from weather import get_data, get_temp_forecast, get_temp, get_forecast
from chat_suite import start_client, send_message, end_client, get_prev_msg
# here is a function that returns a string of all the function
def print_options():
return 'gt -> get temp for 13 days\ngt [1..13] -> get specific day temp... | kevink97/Teaching-Materials | tutor_hs/les6/weatherbot.py | Python | mit | 2,932 |
import logging
from random import randint
from django.conf import settings
from django.db import models
from django.db.utils import ProgrammingError
from django.utils.translation import ugettext_lazy as _
from ..utils import slugify, pick_attrs
from .common import CommonFields
from .media_spec import MediaSpec
logg... | conikuvat/edegal | backend/edegal/models/picture.py | Python | mit | 4,633 |
def read(path):
with open(path) as fp:
return fp.read()
| KeepSafe/content-validator | tests/utils.py | Python | apache-2.0 | 69 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
'''
cc_plugin_ncei/ncei_trajectory.py
'''
from compliance_checker.base import BaseCheck
from cc_plugin_ncei.ncei_base import TestCtx, NCEI1_1Check, NCEI2_0Check
from cc_plugin_ncei import util
from isodate import parse_duration
class NCEITrajectoryBase(BaseCheck):
_c... | ioos/cc-plugin-ncei | cc_plugin_ncei/ncei_trajectory.py | Python | apache-2.0 | 7,802 |
'''
Created on Mar 12, 2011
from __future__ import division
@author: johnsalvatier
'''
import numpy as np
from numpy import exp, log, sqrt
from ..core import *
__all__ = ['approx_hessian', 'find_hessian', 'trace_cov', 'guess_scaling']
def approx_hessian(point, vars=None, model=None):
"""
Returns an approxim... | evidation-health/pymc3 | pymc3/tuning/scaling.py | Python | apache-2.0 | 3,227 |
import re
import sys
import warnings
def print_deprecation_warning(old_param_name, new_param_name):
warnings.warn("'%s' has been deprecated to be in line with pymongo implementation, "
"a new parameter '%s' should be used instead. the old parameter will be kept for backward "
"... | chartbeat-labs/mongomock | mongomock/helpers.py | Python | bsd-3-clause | 1,910 |
from . import misc
from . import index
| by46/recipe | templates/python.flask/{{cookiecutter.project_safe_name}}/app/main/views/__init__.py | Python | mit | 41 |
import functools
import gc
import operator
import platform
import unittest
from datetime import datetime
from itertools import count
from warnings import catch_warnings
from scrapy.utils.python import (
memoizemethod_noargs, binary_is_text, equal_attributes,
WeakKeyCache, get_func_args, to_bytes, to_unicode,
... | starrify/scrapy | tests/test_utils_python.py | Python | bsd-3-clause | 7,687 |
##############################################################################
#
# OSIS stands for Open Student Information System. It's an application
# designed to manage the core business of higher education institutions,
# such as universities, faculties, institutes and professional schools.
# The core ... | uclouvain/OSIS-Louvain | education_group/tests/ddd/factories/domain/campus.py | Python | agpl-3.0 | 1,589 |
# This file is dual licensed under the terms of the Apache License, Version
# 2.0, and the BSD License. See the LICENSE file in the root of this repository
# for complete details.
from __future__ import absolute_import, division, print_function
import pretend
import pytest
from cryptography import utils
from crypto... | sholsapp/cryptography | tests/hazmat/primitives/test_hashes.py | Python | bsd-3-clause | 5,091 |
import numpy as np
import sys
import os
import argparse
import time
import paddle.v2 as paddle
import paddle.fluid as fluid
from config import TrainConfig as conf
def parse_args():
parser = argparse.ArgumentParser()
parser.add_argument(
'--dict_path',
type=str,
required=True,
... | Superjom/models-1 | fluid/text_classification/train.py | Python | apache-2.0 | 4,687 |
################################################################################
#
# Copyright 2015-2021 Félix Brezo and Yaiza Rubio
#
# This program is part of OSRFramework. You can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Softwa... | i3visio/osrframework | osrframework/upgrade.py | Python | agpl-3.0 | 4,591 |
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import unittest
import frappe
from erpnext.selling.doctype.sales_order.test_sales_order import make_sales_order
from erpnext.accounts.doctype.sales_inv... | indictranstech/erpnext | erpnext/accounts/doctype/pricing_rule/test_pricing_rule.py | Python | agpl-3.0 | 9,422 |
# -*- coding: utf-8 -*-
"""
Miscellaneous functions for spectral analysis
0. bandpass_default: default bandpass filter
0a. highpass_default: default highpass filter
1. fftmed: calculate the PSD by taking fourier transform followed by median filter
2. slope: calculate slope of power spectrum
3. centerfreq: calculate th... | srcole/tools | spec.py | Python | mit | 18,099 |
import unittest,logging
import zlib,tempfile,numpy
from numpy.testing import assert_equal,assert_almost_equal
from tests.multimedia_data import multimediaData as md
from pimpy.video import Video
from pimpy.video.frameextractor import FrameExtractor
class FrameExtractorTestCase(unittest.TestCase):
def setUp(self):... | scampion/pimpy | tests/test_frameextractor.py | Python | agpl-3.0 | 766 |
# -*- coding: utf-8 -*-
"""Assemble a BEL graph as bipartite graph of nodes and reified edges."""
from .assembler import * # noqa: F401,F403
| pybel/pybel-tools | src/pybel_tools/assembler/reified_graph/__init__.py | Python | mit | 144 |
from flask_restful import Resource
from flask_restful import reqparse
from ...models import User
parser = reqparse.RequestParser()
class UserResource(Resource):
def get(self, id):
return User.query.get_or_404(id).json()
def post(self):
parser.add_argument('username', type=str)
pars... | moonlitlaputa/scheduler-service | old/app/api/v1/users.py | Python | bsd-2-clause | 985 |
import numpy as np
from bayesnet.tensor.constant import Constant
from bayesnet.tensor.tensor import Tensor
from bayesnet.function import Function
class Softplus(Function):
def forward(self, x):
x = self._convert2tensor(x)
self.x = x
output = np.maximum(x.value, 0) + np.log1p(np.exp(-np.ab... | ctgk/BayesianNetwork | bayesnet/nonlinear/softplus.py | Python | mit | 697 |
from scikit2pmml import scikit2pmml
from sklearn.datasets import load_boston
import numpy as np
from sklearn.linear_model import LinearRegression
boston = load_boston()
X = boston.data.astype(np.float32)
y = boston.target.astype(np.float32)
model = LinearRegression()
model.fit(X, y)
params = {
'pmml_version': '4... | vaclavcadek/sklearn2pmml | examples/boston.py | Python | mit | 595 |
# coding=utf-8
# Author: Bart Sommer <bart.sommer88@gmail.com>
#
# URL: https://sickrage.github.io
#
# 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 version... | Elettronik/SickRage | sickbeard/providers/immortalseed.py | Python | gpl-3.0 | 7,917 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.