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 |
|---|---|---|---|---|---|
# -*- coding: utf-8 -*-
# Copyright 2020 OpenSynergy Indonesia
# Copyright 2020 PT. Simetri Sinergi Indonesia
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from openerp import api, fields, models
from openerp.tools.translate import _
class StockWarehouse(models.Model):
_inherit = "stock.warehou... | open-synergy/opnsynid-stock-logistics-warehouse | stock_rental_operation/models/stock_warehouse.py | Python | agpl-3.0 | 24,093 |
from __future__ import absolute_import, unicode_literals
import importlib
from functools import wraps
from case import patch, skip
from celery.bin import events
def _old_patch(module, name, mocked):
module = importlib.import_module(module)
def _patch(fun):
@wraps(fun)
def __patched(*args,... | cloudera/hue | desktop/core/ext-py/celery-4.2.1/t/unit/bin/test_events.py | Python | apache-2.0 | 2,715 |
# -*- coding: utf-8 -*-
import os
import glob
import pickle
from utils import Utils
import numpy as np
import pdb
# The readin flag when set enables the wiring to be read in from pre-existing
# pickled files with rank specific file names.
from mpi4py import MPI
import neuron as h
MPI.COMM = MPI.COMM_WORLD
utils = Uti... | russelljjarvis/neurogateway | init.py | Python | gpl-3.0 | 6,919 |
"""Create tables
Revision ID: 1c2b0e17447d
Revises: None
Create Date: 2014-10-31 12:23:21.956730
"""
import sqlalchemy as sa
from alembic import op
from sqlalchemy.dialects import postgresql
from sqlalchemy.sql.ddl import CreateSchema, DropSchema
from indico.core.db.sqlalchemy import UTCDateTime
# revision identif... | nop33/indico-plugin-livesync | indico_livesync/migrations/201410311223_1c2b0e17447d_create_tables.py | Python | gpl-3.0 | 2,098 |
# ##### BEGIN GPL LICENSE BLOCK #####
#
# JewelCraft jewelry design toolkit for Blender.
# Copyright (C) 2015-2019 Mikhail Rachinskiy
#
# 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... | mrachinskiy/blender-addon-jewelcraft | ops_utils/scene_ops.py | Python | mit | 1,477 |
# -*- coding: utf-8 -*-
__author__ = 'tintsing'
import requests
from bs4 import BeautifulSoup
import re
import codecs
from datetime import datetime, date
import argparse
import logging
import json
from SportsOdds import FootballOdds
from CrawlerUtils import remove_nbsp_suffix, parse_float, parse_int, date_range, check... | ChenjunZou/QuantBet | crawler/sina_football_macau.py | Python | apache-2.0 | 7,301 |
"""Imports for Python API.
This file is MACHINE GENERATED! Do not edit.
Generated by: tensorflow/tools/api/generator/create_python_api.py script.
"""
from tensorflow.python.ops.math_ops import polyval | ryfeus/lambda-packs | Keras_tensorflow_nightly/source2.7/tensorflow/tools/api/generator/api/math/__init__.py | Python | mit | 201 |
#!/usr/bin/env python2
import sys, time, timeit
sys.path.append("../dev/")
import brkga, grasp, memproblem, tabumemex
def get_grasp_code(filename, iters, alpha):
"""Creates code templates."""
command = "print grasp(problem," + str(alpha) + ","+str(iters)+")[-1]"
code = """
import memproblem
from grasp import gras... | dplbsd/memexplorerpy | dev/run_tests.py | Python | bsd-3-clause | 3,201 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Tests for service state checks."""
from grr.lib import flags
from grr.lib import test_lib
from grr.lib.checks import checks_test_lib
from grr.lib.rdfvalues import client as rdf_client
from grr.parsers import linux_service_parser
from grr.parsers import linux_service_par... | statik/grr | checks/services_test.py | Python | apache-2.0 | 6,613 |
import unittest
from datetime import datetime
from quickbooks.objects.base import Ref
from quickbooks.objects.bill import Bill, BillLine, AccountBasedExpenseLineDetail
from quickbooks.objects.vendor import Vendor
class BillTest(unittest.TestCase):
def setUp(self):
self.account_number = datetime.now().st... | emburse/python-quickbooks | tests/integration/test_bill.py | Python | mit | 1,189 |
# 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/.
import unittest
import time
try:
from unittest import TextTestResult
except ImportError:
# bug 971243 - python ... | JasonGross/mozjs | testing/mozbase/moztest/moztest/adapters/unit.py | Python | mpl-2.0 | 4,366 |
from app.controllers.matrix import MatrixController
matrix = MatrixController.create("../sample_matrices/A50")
array = MatrixController.loadAsArray(matrix)
MatrixController.writeArrayToFile(array, "../sample_matrices/test")
MatrixController.delete(matrix)
| JelteF/bottor | tracker/app/controllers/test.py | Python | mit | 260 |
# Copyright 2014 Open Source Robotics Foundation, 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 ... | viccro/diarc | ros/ros_parser.py | Python | apache-2.0 | 2,535 |
# __author__ = 'sandy'
# -*- coding=utf-8 -*-
import sys
import MySQLdb
import datetime
from time import time
from swift.common.utils import cache_from_env, get_logger, \
split_path, config_true_value, register_swift_info
from swift.common.swob import Response, Request
from swift.common.swob import HTTPBadRequest, ... | hbhdytf/mac | swift/common/middleware/mac.py | Python | apache-2.0 | 35,497 |
'''
'''
# 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");... | duke8253/trafficserver | tests/gold_tests/next_hop/strategies_ch/strategies_ch.test.py | Python | apache-2.0 | 5,008 |
#!/usr/bin/python
"""
* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
* isingrand: postprocessing of isingrand data
* Copyright (c) 2013 Analabha Roy (daneel@utexas.edu)
*
* This is free software: you can redistribute it and/or modify it under the
* terms of version 3 of the GNU L... | hariseldon99/archives | isingrand/scripts/disorder_average.py | Python | gpl-2.0 | 4,032 |
# 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 __future__ import absolute_import
import os
import sys
im... | skuda/client-python | kubernetes/test/test_v1beta1_replica_set_spec.py | Python | apache-2.0 | 909 |
import shelve
import os
import re
from resource_api.interfaces import Resource as BaseResource, Link as BaseLink, AbstractUriPolicy
from resource_api.schema import StringField, DateTimeField, IntegerField
from resource_api.service import Service
from resource_api.errors import ValidationError
RE_SHA1 = re.compile("^... | gurunars/resource-api | documentation/tutorial/service_v4.py | Python | apache-2.0 | 8,456 |
'''
Created on Oct 24, 2014
@author: wahib
'''
from __future__ import print_function
import csv
import numpy as np
from sklearn import preprocessing
import pandas as pd
import sys
print(__doc__)
#folderName = '10000rows'
def generateMeanStd(folderName):
fullData = pd.read_csv(folderName + '/Xtr.csv', delimiter=... | wahibhaq/android-speaker-audioanalysis | Python/Basic/csv/libsvm/generate_mean_std.py | Python | mit | 1,218 |
from flask_user import login_required
from app.API_Rest.Services.BaseService import BaseService
from app.models.generadorJSON.respuestas_encuestas_generadorJSON import generarJSON_encuesta_alumno
from app.models.respuestas_encuesta_models import EncuestaAlumno, RespuestaEncuestaTematica, RespuestaEncuestaTags
from app.... | jennywoites/MUSSA | MUSSA_Flask/app/API_Rest/Services/AlumnoServices/EncuestaAlumnoService.py | Python | gpl-3.0 | 6,276 |
import datetime
from pick import pick
from API_client.python.lib.predef_locations import locations
import dateutil.parser
class variable:
def __init__(self, varname, input_variables, scope, ds, debug=False):
self.varname = varname
self.ds = ds
var_attrs = [i for i in input_variables if i['... | planet-os/notebooks | api-examples/API_client/python/lib/variables.py | Python | mit | 4,340 |
##########################################################################################
## Project Euler #20: Factorial digit sum ##
## ##
## Link: https://www.hackerrank.com/contests/p... | fgallegosalido/Algorithms | Hackerrank/ProjecEuler/20__Factorial_digit_sum.py | Python | gpl-3.0 | 877 |
import json
import os
from django.conf import settings
from django.core.files.storage import default_storage as storage
import mock
from nose import SkipTest
from nose.tools import eq_
from PIL import Image
import amo
import amo.tests
from amo.tests.test_helpers import get_image_path
from amo.urlresolvers import rev... | muffinresearch/addons-server | apps/devhub/tests/test_forms.py | Python | bsd-3-clause | 25,853 |
from sqlalchemy import *
from migrate import *
from migrate.changeset import schema
pre_meta = MetaData()
post_meta = MetaData()
workout = Table('workout', pre_meta,
Column('id', INTEGER, primary_key=True, nullable=False),
Column('athlete_id', INTEGER),
Column('date', DATETIME),
Column('distance', FLO... | ericgarig/runner_tracker | db_repository/versions/009_migration.py | Python | mit | 833 |
from cherrypy.test import test
test.prefer_parent_path()
import cherrypy
script_names = ["", "/path/to/myapp"]
def setup_server():
# Set up site
cherrypy.config.update({
'environment': 'test_suite',
'tools.proxy.on': True,
'tools.proxy.base': 'www.mydomain.test',
... | cread/ec2id | cherrypy/test/test_proxy.py | Python | apache-2.0 | 4,957 |
from core.models import Slice, SlicePrivilege, SliceRole, Sliver, Site, Node, User
from plus import PlusObjectMixin
from operator import itemgetter, attrgetter
from rest_framework.exceptions import APIException
class SlicePlus(Slice, PlusObjectMixin):
class Meta:
proxy = True
def __init__(self, *args,... | wathsalav/xos | xos/core/xoslib/objects/sliceplus.py | Python | apache-2.0 | 10,528 |
#!/usr/bin/env python
"""
Build F90 module support for f2py2e.
Copyright 2000 Pearu Peterson all rights reserved,
Pearu Peterson <pearu@ioc.ee>
Permission to use, modify, and distribute this software is given under the
terms of the NumPy License.
NO WARRANTY IS EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK.
... | beiko-lab/gengis | bin/Lib/site-packages/numpy/f2py/f90mod_rules.py | Python | gpl-3.0 | 9,536 |
from CRABClient.UserUtilities import config, getUsernameFromSiteDB
config = config()
config.section_('General')
config.General.requestName = 'MCSTtWantitop_v2'
config.General.workArea = 'crab_projects'
config.General.transferOutputs = True
config.General.transferLogs = False
config.section_('JobType')
config.JobType... | mverwe/UserCode | topConfigs/crabConfigPPMCSTtwatop.py | Python | cc0-1.0 | 1,264 |
# -*- coding: utf-8 -*-
# Copyright (c) 2013, Theo Crevon
# Copyright (c) 2013, Greg Leclercq
#
# See the file LICENSE for copying permission.
from boto.swf.exceptions import SWFResponseError
from swf.constants import REGISTERED
from swf.querysets.base import BaseQuerySet
from swf.models import Domain
from swf.model... | botify-labs/python-simple-workflow | swf/querysets/workflow.py | Python | mit | 25,485 |
from django.db.models import Sum
from django.utils.timezone import now
from le_utils.constants import content_kinds
from le_utils.constants import exercises
from rest_framework import serializers
from kolibri.core.auth.models import FacilityUser
from kolibri.core.logger.constants.exercise_attempts import MAPPING
from ... | lyw07/kolibri | kolibri/core/logger/serializers.py | Python | mit | 9,243 |
from rapprentice import ros2rave, func_utils, berkeley_pr2
import fastrapp
import numpy as np
import cv2
import openravepy
import os.path as osp
def extract_joints(bag):
"""returns (names, traj)
"""
traj = []
stamps = []
for (_, msg, _) in bag.read_messages(topics=['/joint_states']):
... | dhadfieldmenell/bootstrapping-lfd | rapprentice/bag_proc.py | Python | bsd-2-clause | 6,334 |
# This file is part of beets.
# Copyright 2015, Adrian Sampson.
#
# 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, ... | untitaker/beets | beets/mediafile.py | Python | mit | 65,757 |
""" An example that defines two apps, one with a single hbox and
one with hboxes in vboxes in hboxes. For performance testing
"""
import time
import zoof
from zoof import ui
class MyApp1(ui.App):
def init(self):
with ui.HBox(self):
ui.Button(text='Box A', flex=0)
ui.... | almarklein/zoof | examples/ui/box_performance.py | Python | bsd-2-clause | 2,492 |
# -*- coding: utf-8 -*-
#!/usr/bin/env python
#
# Copyright 2015 BigML
#
# 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 b... | ShaguptaS/python | bigml/tests/test_06_batch_predictions.py | Python | apache-2.0 | 11,551 |
from vFense.core._constants import CPUThrottleValues
class DefaultCustomers():
DEFAULT = 'default'
class CustomerDefaults():
NET_THROTTLE = 0
CPU_THROTTLE = CPUThrottleValues.NORMAL
SERVER_QUEUE_TTL = 10 #minutes
AGENT_QUEUE_TTL = 10 #minutes
| dtklein/vFense | tp/src/core/customer/_constants.py | Python | lgpl-3.0 | 269 |
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
from __future__ import unicode_literals
import frappe
from frappe.core.doctype.notification_count.notification_count import delete_notification_count_for
from frappe.core.doctype.user.user import STANDARD_USERS
from ... | rohitwaghchaure/New_Theme_frappe | frappe/core/page/messages/messages.py | Python | mit | 3,625 |
#!/usr/bin/env python
#
# Copyright (C) 2017 - Massachusetts Institute of Technology (MIT)
#
# 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... | azariven/BioSig_SEAS | bin_stable/a.Transmission/save_simuated_spectra.py | Python | gpl-3.0 | 5,375 |
# -*- 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 ... | jacquerie/inspire-dojson | inspire_dojson/hep/rules/bd5xx.py | Python | gpl-3.0 | 12,341 |
# Generated by Django 2.2.13 on 2021-02-11 08:43
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('base', '0566_fix_link_orders'),
]
operations = [
migrations.AlterField(
model_name='person',
name='source',
... | uclouvain/OSIS-Louvain | base/migrations/0567_auto_20210211_0843.py | Python | agpl-3.0 | 562 |
"""
GREP Plugin for Cookies Attributes
NOTE: GREP plugins do NOT send traffic to the target and only grep the HTTP Transaction Log
"""
from owtf.plugin.helper import plugin_helper
DESCRIPTION = "Searches transaction DB for Cookie attributes"
def run(PluginInfo):
title = "This plugin looks for cookie setting head... | owtf/owtf | owtf/plugins/web/grep/Cookies_attributes@OWTF-SM-002.py | Python | bsd-3-clause | 557 |
import sys
import textwrap
name_text = ', '.join(sorted(sys.builtin_module_names))
print(textwrap.fill(name_text, width=64))
| jasonwee/asus-rt-n14uhp-mrtg | src/lesson_runtime_features/sys_builtins.py | Python | apache-2.0 | 128 |
import os
import json
from celery import shared_task
from django.conf import settings
from django.db import transaction
from django.db.models import Count, F, Avg
from imagekit.utils import open_image
from pilkit.processors import ResizeToFit
from photos.utils import numpy_to_pil
from common.utils import save_obj_at... | seanbell/opensurfaces | server/intrinsic/tasks.py | Python | mit | 12,219 |
# Copyright (C) 2019 Greenweaves Software Limited
#
# This 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 s... | weka511/bioinformatics | BA6G.py | Python | gpl-3.0 | 1,844 |
from pythonforandroid.recipe import PythonRecipe
class BabelRecipe(PythonRecipe):
name = 'babel'
version = '2.1.1'
url = 'https://pypi.python.org/packages/source/B/Babel/Babel-{version}.tar.gz'
depends = [('python2', 'python3crystax'), 'setuptools', 'pytz']
call_hostpython_via_targetpython = False
install_in_... | cbenhagen/python-for-android | pythonforandroid/recipes/babel/__init__.py | Python | lgpl-2.1 | 363 |
# Protocol Buffers - Google's data interchange format
# Copyright 2008 Google Inc. All rights reserved.
# http://code.google.com/p/protobuf/
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions o... | Andproject/tools_protobuf | python/google/protobuf/internal/decoder_test.py | Python | bsd-3-clause | 10,614 |
# -*- coding: utf-8 -*-
#
# http://www.privacyidea.org
# 2015-12-16 Initial writeup.
# Cornelius Kölbel <cornelius@privacyidea.org>
#
#
# This code is free software; you can redistribute it and/or
# modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
# License as published by the Free Softw... | jalr/privacyidea | privacyidea/lib/tokens/questionnairetoken.py | Python | agpl-3.0 | 10,789 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2016, Gregory Shulov (gregory.shulov@gmail.com)
# 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': '... | e-gob/plataforma-kioscos-autoatencion | scripts/ansible-play/.venv/lib/python2.7/site-packages/ansible/modules/storage/infinidat/infini_vol.py | Python | bsd-3-clause | 4,232 |
import factory
from django.db.models import signals
from django.test import TestCase
from django.contrib.sites.models import Site
from factory.django import DjangoModelFactory, mute_signals
from .models import Building, Apartment
class SiteFactory(DjangoModelFactory):
class Meta:
model = Site
@mute... | danjac/ownblock | ownblock/ownblock/apps/buildings/tests.py | Python | mit | 1,316 |
import re
def parseconfig(configfile):
settings = {}
f = open(configfile)
for line in f:
# skip comment lines
m = re.search('^\s*#', line)
if m:
continue
# parse key=value lines
m = re.search('^(\w+)\s*=\s*(\S.*)$', line)
if m is None:
... | thequbit/chatterstats | cfgfile.py | Python | gpl-3.0 | 405 |
import socket
import select
import errno
import threading
import logging
log = logging.getLogger('sephiroth')
MSG_SEPARATOR = '\n'
log.setLevel(logging.INFO)
# Exceptions for flow control
class WrongUID(Exception):
pass
class EndpointExists(Exception):
pass
class SephirothReadError(Exception):
... | phasnox/sephiroth | sephiroth.py | Python | gpl-3.0 | 4,037 |
from django import forms
from taggee.forms import TagFormMixin
from .models import TagModel
class EmptyTagForm(TagFormMixin, forms.Form):
pass
class TagForm(TagFormMixin, forms.Form):
tags = forms.CharField()
class EmptyTagModelForm(TagFormMixin, forms.ModelForm):
class Meta:
model = TagModel
... | koorgoo/django-taggee | tests/forms.py | Python | mit | 434 |
# -*- coding: utf-8 -*-
# © 2014-2016 Numérigraphe SARL
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
import logging
from itertools import groupby
from openerp import models, api
_logger = logging.getLogger(__name__)
class PurchaseOrder(models.Model):
_inherit = "purchase.order"
@api... | andrius-preimantas/purchase-workflow | purchase_delivery_split_date/purchase.py | Python | agpl-3.0 | 1,464 |
import json
import os.path
import tornado.gen
import tornado.web
import tornado.testing
from testexample.ticker_handler import TickerHandler
RATES_FIXTURE = {}
with open(os.path.join(os.path.dirname(__file__), 'fixtures/ticker.json')) as f:
RATES_FIXTURE = json.load(f)
@tornado.gen.coroutine
def dummy_loader():
... | wmalinowski/test-example | testexample/test/test_ticker_handler.py | Python | unlicense | 1,318 |
test = {
'name': 'fimp',
'points': 1,
'suites': [
{
'cases': [
{
'code': r"""
scm> (fimp '(5 2 4 3) 4)
4
scm> (fimp '(5 2 4 4 3) 4)
4
scm> (fimp '(5 2 4 4 3) 5)
5
scm> (fimp '(5 2 4 4 3) 6)
2
scm>... | tavaresdong/courses | ucb_cs61A/quiz/quiz03/tests/fimp.py | Python | mit | 708 |
import game
import pygame
from pygame.locals import *
class Resources:
<<<<<<< HEAD
def cambiar(self,imagen):
sheet = game.load_image(imagen)
rects = [pygame.Rect(112,2,26,40),
pygame.Rect(112,2,26,40),
pygame.Rect(112,2,26,40),
pygame.Rect(4,4,30,... | cangothic/2D-Platformer | resources.py | Python | mit | 2,891 |
import components
"""Class containing build configuration."""
class BuildConfig(object):
"""Constructor. Reads configuration from commandline arguments."""
def __init__(self, argc, argv):
self.firstComponent = 0 # Index of first compiled component in component list.
self.compileAllComponents = Tru... | DriverCity/SPARK | src/smart_meter/buildtools/BuildConfig.py | Python | mit | 3,712 |
# -*- coding: utf-8 -*-
# See README.rst file on addon root folder for license details
{
"name": "Project Recalculate",
"version": "8.0.1.0.0",
"author": "Antiun Ingeniería S.L., "
"Odoo Community Association (OCA)",
"website": "http://www.antiun.com",
"license": "AGPL-3",
"catego... | akretion/project-service | project_recalculate/__openerp__.py | Python | agpl-3.0 | 580 |
from config import *
def build_nested_schema(struct):
schema = []
for tup in struct:
if type(tup) != tuple:
print("struct type not tuple")
return None
size = len(tup)
if size == 2:
res = build_nested_schema(tup[1])
if not re... | Lanceolata/log2hdfs | orc-schema/build.py | Python | mit | 2,842 |
from keras.layers import Input, Dense
from keras.models import Model
import numpy as np
from game.reversi import Reversi
board_size = 64
encoded_size = 32
board_input = Input(shape=(board_size,))
encoded = Dense(encoded_size, activation='relu')(board_input)
decoded = Dense(board_size, activation='sigmoid')(encoded... | andysalerno/reversi_ai | neural_net/autoencoder.py | Python | mit | 1,868 |
# -*- coding: utf-8 -*-
# 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 +
# All configuration v... | mganeva/mantid | docs/source/conf-qthelp.py | Python | gpl-3.0 | 1,613 |
#! /usr/bin/env python
import sys
import numpy as np
def convfft(a,b):
len_c = len(a)+len(b)-1
a=np.array(a)
b=np.array(b)
az=np.zeros(len_c-len(a))
bz=np.zeros(len_c-len(b))
a=np.append(a,az)
b=np.append(b,bz)
x=np.fft.fft(a)
y=np.fft.fft(b)
z=x*y
oup=np.fft.ifft(z)
... | buck06191/BayesCMD | batch/wavepy/convol.py | Python | gpl-2.0 | 704 |
from PyQt4 import QtGui
class EditorSplitter(QtGui.QSplitter):
def __init__(self, editor, editor2, DATA, editorTabWidget, parent):
QtGui.QSplitter.__init__(self, parent)
self.editorTabWidget = editorTabWidget
self.DATA = DATA
self.parent = parent
self.editor = editor
... | ntoll/Pcode | Extensions/EditorSplitter.py | Python | gpl-3.0 | 1,064 |
#!/usr/bin/evn python
"""
Senty Project
Copyright(c) 2017 Senty.
This program is free software; you can redistribute it and/or modify it
under the terms and conditions of the GNU General Public License,
version 2, as published by the Free Software Foundation.
This program is distributed in the hope it will be useful... | Kamalheib/senty | senty/utils/logger.py | Python | gpl-2.0 | 1,518 |
"""
Sample configuration file for the "mirror" script that will use
rsync://rsync.kernel.org to fetch a kernel file list and schedule jobs on new
kernel releases.
This file has to be valid python code executed by the "mirror" script. The file
may define and do anything but the following "names" are special:
- a globa... | lmr/autotest | mirror/config-sample.py | Python | gpl-2.0 | 4,405 |
#!/usr/bin/python
'''wsgi2 middleware route
dispatch based on the environ['PATH_INFO']
transfer http path_info segment to class attribute
transfer http request_method to some name class function
EXAMPLE
class Node:
def __init__(self, environ):
self._env = environ
class Base(Node):
def get(self):
... | huanguan1978/web3 | web3/middleware/route.py | Python | gpl-2.0 | 4,065 |
# -*- 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... | googleapis/python-bigquery-logging | setup.py | Python | apache-2.0 | 2,278 |
import datetime
from django.conf import settings
from django.db import models
from django.template.defaultfilters import slugify
from django.utils import timezone
from blogtools.utils.embargo import EmbargoedContent, EmbargoedContentPublicManager, EmbargoedContentPrivateManager
#TODO, put this in glamkit somewhere.
... | ixc/glamkit-blogtools | blogtools/models.py | Python | bsd-3-clause | 3,335 |
"""Files API Tests for Version 1.0.
This is a testing template for the generated FilesAPI Class.
"""
import unittest
import requests
import secrets
from pycanvas.apis.files import FilesAPI
from pycanvas.apis.files import Folder
from pycanvas.apis.files import Usagerights
from pycanvas.apis.files import Licen... | PGower/PyCanvas | pycanvas/tests/files.py | Python | mit | 11,948 |
# Copyright 2016, 2017 Richard Rodrigues, Nyle Rodgers, Mark Williams,
# Virginia Tech
#
# This file is part of Coremic.
#
# Coremic 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 Lice... | richrr/coremicro | scripts/script.py | Python | gpl-2.0 | 2,801 |
###############################################################################
# plot_mapflare.py: make of plot of the flaring of MAPs
###############################################################################
import os, os.path
import sys
import csv
import pickle
import numpy
import matplotlib
matplotlib.use('Ag... | jobovy/apogee-maps | py/plot_mapflare.py | Python | bsd-3-clause | 5,575 |
# encoding: utf-8
import requests
import re
import os
import os.path
class HuabanCrawler():
def __init__(self):
self.homeUrl = "http://huaban.com/boards/17375733/"
self.images = []
if not os.path.exists('G:/images'):
os.mkdir('G:/images')
def __load_homePage(self):
... | zhangyake/python-itchat | test/down_img.py | Python | mit | 2,234 |
import unittest
from macke.Macke import Macke
class TestMackeWithMain(unittest.TestCase):
def run_macke_test_on_file(self, bcfile):
m = Macke(bcfile, quiet=True,
flags_user=["--max-time=60"],
posixflags=["--sym-files", "1", "2"],
posix4main=['--sym-a... | tum-i22/macke | tests/test_Macke_WithMain.py | Python | apache-2.0 | 1,046 |
__author__ = "Jurismarches <it@jurismarches.com>"
__version__ = "4.0.0"
| jurismarches/geoconvert | geoconvert/__init__.py | Python | mit | 72 |
from typing import Callable, Dict, NamedTuple
import collections
class SchemaEntry(
NamedTuple("SchemaEntry", [("schema", type), ("creator", Callable),
("meta", Dict)])):
"""Represents a single entry in the context map.
Attributes:
schema: Schema used for t... | stanfordnqp/spins-b | spins/goos/schema_registry.py | Python | gpl-3.0 | 2,009 |
"""gameon URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.10/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
Class-bas... | SphinxNZ/game-on | gameon/urls.py | Python | apache-2.0 | 763 |
from django.conf.urls.defaults import patterns, url
urlpatterns = patterns('radios.views',
url(r'^json/$', 'get_radiolist_json'),
url(r'^report_broken/$','report_broken_link'),
# Uncomment following lines to enable POST request adding/updateing/deleting radios.
# Please mind that further implementation of fol... | eskultety/RadioStream | server/radios/urls.py | Python | gpl-3.0 | 465 |
# -*- coding: utf-8 -*-
import datetime
from collections import Counter
from django.core.exceptions import ImproperlyConfigured
from django.core.urlresolvers import reverse, NoReverseMatch
from django.db import models
from django.db.models import Q
from django.template.defaultfilters import slugify
from django.utils i... | aldryn/aldryn-blog | aldryn_blog/models.py | Python | bsd-3-clause | 9,546 |
# nxt.error module -- LEGO Mindstorms NXT error handling
# Copyright (C) 2006,2007 Douglas P Lau
#
# 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... | xarg/nxtpython | nxt/error.py | Python | gpl-2.0 | 2,963 |
from __future__ import division, print_function
"""
backend_cocoaagg.py
A native Cocoa backend via PyObjC in OSX.
Author: Charles Moad (cmoad@users.sourceforge.net)
Notes:
- Requires PyObjC (currently testing v1.3.7)
- The Tk backend works nicely on OSX. This code
primarily serves as an example of embed... | cactusbin/nyt | matplotlib/lib/matplotlib/backends/backend_cocoaagg.py | Python | unlicense | 9,838 |
from emoint.featurizers.base_featurizers import Featurizer
from emoint.featurizers.utils import negation_lexicon_path
import gzip
from collections import defaultdict
class NegationFeaturizer(Featurizer):
"""Negation Featurizer"""
@property
def id(self):
return self._id
@property
def lexi... | SEERNET/EmoInt | emoint/featurizers/negating_featurizer.py | Python | gpl-3.0 | 1,538 |
import plotly.graph_objs as go
from plotly.offline import plot
import cea.plots.demand
from cea.plots.variable_naming import LOGO, COLOR, NAMING
__author__ = "Jimeno A. Fonseca"
__copyright__ = "Copyright 2018, Architecture and Building Systems - ETH Zurich"
__credits__ = ["Jimeno A. Fonseca"]
__license__ = "MIT"
... | architecture-building-systems/CEAforArcGIS | cea/plots/demand/energy_end_use_intensity.py | Python | mit | 5,070 |
"""This module implements decorators for implementing other decorators
as well as some commonly used decorators.
"""
import sys
PY2 = sys.version_info[0] == 2
PY3 = sys.version_info[0] == 3
if PY3:
string_types = str,
import builtins
exec_ = getattr(builtins, "exec")
del builtins
else:
string_... | danielecook/gist-alfred | wrapt/decorators.py | Python | mit | 20,089 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import regex as re
from datetime import datetime
from datetime import time
from dateutil.relativedelta import relativedelta
from dateparser.utils import apply_timezone, localize_timezone
from .parser import time_parser
_UNITS = r'year|month|week|day|h... | mpercich/Calendarize | ios/dateparser/lib/python2.7/site-packages/dateparser/freshness_date_parser.py | Python | mit | 3,641 |
# -*- Mode: Python -*-
# GDBus - GLib D-Bus Library
#
# Copyright (C) 2008-2011 Red Hat, Inc.
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2 of the License, or (at ... | johne53/MB3Glib | gio/gdbus-2.0/codegen/parse/__init__.py | Python | lgpl-2.1 | 866 |
from clawpack.petclaw.solution import Solution
import matplotlib
matplotlib.use('Agg')
import matplotlib.pylab as pl
import matplotlib.cm as cm
from matplotlib import rc
import numpy as np
import os
def plot_p(frame,slices_xlimits=None,init_cond=False):
sol=Solution(frame,file_format='petsc',read_aux=False,path='.... | ketch/effective_dispersion_RR | numerical_experiments/2D-propagation/FV_simulations/c-dispersion/layered/plots_to_paper.py | Python | bsd-2-clause | 2,067 |
"""
FCKeditor - The text editor for Internet - http://www.fckeditor.net
Copyright (C) 2003-2007 Frederico Caldeira Knabben
== BEGIN LICENSE ==
Licensed under the terms of any of the following licenses at your
choice:
- GNU General Public License Version 2 or later (the "GPL")
http://www.gnu.org/licens... | clausche/correfax | fckeditor/fckeditor.py | Python | gpl-2.0 | 4,035 |
# Copyright 2010-2014 Google
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, so... | WendellDuncan/or-tools | examples/python/simple_meeting.py | Python | apache-2.0 | 7,726 |
#
# This file is part of pyasn1-modules software.
#
# Created by Russ Housley.
#
# Copyright (c) 2019, Vigil Security, LLC
# License: http://snmplabs.com/pyasn1/license.html
#
# Experiment for Hash Functions with Parameters in the CMS
#
# ASN.1 source from:
# https://www.rfc-editor.org/rfc/rfc6210.txt
#
from pyasn1.ty... | martbhell/wasthereannhlgamelastnight | src/lib/pyasn1_modules/rfc6210.py | Python | mit | 1,052 |
# -*- 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... | googleapis/python-datacatalog | samples/generated_samples/datacatalog_generated_datacatalog_v1beta1_data_catalog_update_tag_template_async.py | Python | apache-2.0 | 1,525 |
# -*- encoding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
| vileopratama/vitech | src/addons/l10n_ve/__init__.py | Python | mit | 101 |
"""
Audio Interchange File Format (AIFF) parser.
Author: Victor Stinner
Creation: 27 december 2006
"""
from lib.hachoir_parser import Parser
from lib.hachoir_core.field import (FieldSet,
UInt16, UInt32, Float80, TimestampMac32,
RawBytes, NullBytes,
String, Enum, PascalString32)
from lib.hachoir_core.endia... | Branlala/docker-sickbeardfr | sickbeard/lib/hachoir_parser/audio/aiff.py | Python | mit | 4,043 |
from marshmallow_jsonapi import Schema, fields
from marshmallow import validate
# The schemas defined here are used to serialize / deserialize JSON
# from the model instances, and also to add validation to model fields.
class UsersSchema(Schema):
not_blank = validate.Length(min=1, error='Field cannot b... | tiagoprn/experiments | flask/api_exposing_database_as_rest_with_jsonapi/app/auth/schemas.py | Python | mit | 772 |
# -*- coding: utf-8 -*-
#
# Copyright (C) Pootle contributors.
# Copyright (C) Zing contributors.
#
# This file is a part of the Zing project. It is distributed under the GPL3
# or later license. See the LICENSE file for a copy of the license and the
# AUTHORS file for copyright and authorship information.
import os
... | iafan/zing | pootle/apps/pootle_app/management/commands/dump.py | Python | gpl-3.0 | 6,069 |
# Copyright (c) 2001-2017, Canal TP and/or its affiliates. All rights reserved.
#
# This file is part of Navitia,
# the software to build cool stuff with public transport.
#
# Hope you'll enjoy and contribute to this project,
# powered by Canal TP (www.canaltp.fr).
# Help us simplify mobility and open public tr... | Tisseo/navitia | source/jormungandr/jormungandr/scenarios/helper_classes/fallback_durations.py | Python | agpl-3.0 | 10,486 |
"""
Load pp, plot and save
"""
import os, sys
#%matplotlib inline
#%pylab inline
import matplotlib
matplotlib.use('Agg')
# Must be before importing matplotlib.pyplot or pylab!
from matplotlib import rc
from matplotlib.font_manager import FontProperties
from matplotlib import rcParams
from mpl_toolkits.basemap... | peterwilletts24/Python-Scripts | plot_scripts/EMBRACE/plot_from_pp_interp_p_levs_temp_geop_sp_hum_hourly_time_Axis_diff.py | Python | mit | 13,535 |
# Copyright (c) 2015 Mirantis, Inc.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requir... | dims/neutron | neutron/pecan_wsgi/hooks/policy_enforcement.py | Python | apache-2.0 | 9,507 |
# -*- coding: utf-8 -*-
import sqlite3
from os import remove
import ThreadFinder
def init_database():
"""Create the table we need.
"""
connection = sqlite3.connect("books.db")
c = connection.cursor()
c.execute("CREATE TABLE books (name text, url text)")
connection.commit()
connection.close... | ibabushkin/ez-bookscraper | Database.py | Python | gpl-3.0 | 1,507 |
import re
from typing import TYPE_CHECKING, Any, Callable, Iterable, List, Optional
if TYPE_CHECKING:
from .settings import Config
else:
Config = Any
_import_line_intro_re = re.compile("^(?:from|import) ")
_import_line_midline_import_re = re.compile(" import ")
def module_key(
module_name: str,
conf... | PyCQA/isort | isort/sorting.py | Python | mit | 4,515 |
from synergine_xyz.SynergyObject import SynergyObject as XyzSynergyObject
class Hole(XyzSynergyObject):
pass | buxx/intelligine | intelligine/synergy/object/Hole.py | Python | apache-2.0 | 114 |
# coding = utf-8
from ip_proxy.connection.mysql_connection import mysqlAsyn
from ip_proxy.connection.redis_connection import redisDb1
from ip_proxy.config import QUEUE_KEY, CHECK_TIMES
import time
import json
from ip_proxy.utils.log import Log
import traceback
import copy
class CheckPipeline(object):
def __init_... | owlsn/h_crawl | spiders/ip_proxy/ip_proxy/pipelines/check_pipeline.py | Python | mit | 1,914 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.