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 |
|---|---|---|---|---|---|
from bisect import insort
from time import strftime, time, localtime, mktime
from enigma import eTimer
import datetime
class TimerEntry:
StateWaiting = 0
StatePrepared = 1
StateRunning = 2
StateEnded = 3
StateFailed = 4
def __init__(self, begin, end):
self.begin = begin
self.prepare_time = 20
self.... | postla/e2-gui | timer.py | Python | gpl-2.0 | 8,176 |
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under t... | briancurtin/python-openstacksdk | openstack/orchestration/v1/software_config.py | Python | apache-2.0 | 2,111 |
#
# Licensed under the GNU General Public License Version 3
#
# 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 p... | jdobes/spacewalk | spacecmd/src/lib/cryptokey.py | Python | gpl-2.0 | 5,706 |
# ******************************************************************************
# Copyright 2017-2018 Intel Corporation
#
# 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.apa... | NervanaSystems/neon | neon/transforms/activation.py | Python | apache-2.0 | 10,173 |
'''
Created on Nov 12, 2014
@author: apuser
'''
import os
import datetime
import sys
files=""
def list_dir(path, res,level):
'''''
res = {'dir':'root', 'child_dirs' : [] , 'files' : [],'level':0}
print list_dir('/root', res)
'''
global files
level+=1
for i in os.listdir(path):... | GdZ/scriptfile | sh/v2.3.3/genDir.py | Python | mit | 1,786 |
import os
import mimetypes
# use our own mime types file because not all extensions are supported on all
# linux distros
_mime_types_file = os.path.join(os.path.dirname(__file__), 'mime.types')
mimetypes.init([_mime_types_file])
def drop_extension(filepath):
index = filepath.rindex('.')
return filepath[0:ind... | wilbertom/fileconversions | fileconversions/helpers.py | Python | mit | 776 |
# -*- coding: utf-8 -*-
import base64
from odoo import fields, models, api, _
class FatturaPAAttachmentIn(models.Model):
_name = "fatturapa.attachment.in"
_description = "E-bill import file"
_inherits = {'ir.attachment': 'ir_attachment_id'}
_inherit = ['mail.thread']
_order = 'id desc'
ir_at... | linkitspa/l10n-italy | l10n_it_fatturapa_in/models/attachment.py | Python | agpl-3.0 | 4,485 |
# -*- coding: utf-8 -*-
#
# Copyright © 2014 René Samselnig
#
# This file is part of Database Navigator.
#
# Database Navigator 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, ... | resamsel/dbmanagr | src/tests/command/daemon/test_daemon.py | Python | gpl-3.0 | 1,631 |
import numpy as np
import cartopy.crs as ccrs
from geoviews.element import Image
from geoviews.element.comparison import ComparisonTestCase
from geoviews.operation import project
class TestProjection(ComparisonTestCase):
def test_image_latlon360_wrapping(self):
xs = np.linspace(72, 360, 5)
ys = ... | ioam/geoviews | geoviews/tests/testprojection.py | Python | bsd-3-clause | 1,253 |
default_app_config = 'nodeshot.ui.default.apps.AppConfig'
| SCORE42/nodeshot | nodeshot/ui/default/__init__.py | Python | gpl-3.0 | 58 |
# -*- coding: utf-8 -*-
##
## This file is part of CDS Invenio.
## Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008 CERN.
##
## CDS Invenio is free software; you can redistribute it and/or
## modify it under the terms of the GNU General Public License as
## published by the Free Software Foundation; either versio... | lbjay/cds-invenio | modules/bibrank/lib/bibrank_citerank_indexer.py | Python | gpl-2.0 | 37,250 |
# -*- coding: utf-8 -*-
"""
/***************************************************************************
LecoS
A QGIS plugin
Contains analytical functions for landscape analysis
-------------------
begin : 2012-09-06
copyrig... | Martin-Jung/LecoS | nlmpy_sextantewrapper.py | Python | gpl-3.0 | 34,338 |
"""
Support to interface with the Emby API.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/media_player.emby/
"""
import logging
from datetime import timedelta
import voluptuous as vol
import homeassistant.helpers.config_validation as cv
from homeassi... | kyvinh/home-assistant | homeassistant/components/media_player/emby.py | Python | apache-2.0 | 11,042 |
def adagrad(opfunc, x, config, state=None):
"""ADAGRAD implementation
ARGS:
- `opfunc` : a function that takes a single input (X), the point of
evaluation, and returns f(X) and df/dX
- `x` : the initial point
- `state` : a table describing the state of the optimizer; after each
... | RPGOne/Skynet | pytorch-master/torch/legacy/optim/adagrad.py | Python | bsd-3-clause | 1,854 |
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# ... | pratikmallya/heat | heat/tests/test_stack_lock.py | Python | apache-2.0 | 10,326 |
from __future__ import unicode_literals
from io import StringIO
import logging
import os
import shutil
import tempfile
from django.test import TestCase
from django.test.utils import override_settings
import mock
from archives.tasks import (
archive_artifact_from_jenkins, process_build_artifacts,
link_artifa... | caio1982/capomastro | archives/tests/test_tasks.py | Python | mit | 22,115 |
'Hello ' + models['mvc'].encoders.html(models['name']) | dmaidaniuk/ozark | test/jsr223/src/main/webapp/WEB-INF/views/index.py | Python | apache-2.0 | 54 |
#!/usr/bin/python
# -*- coding: utf-8; -*-
#
# Copyright (c) 2009 Google Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyrigh... | fishpepper/OpenSky | stylecheck/cpplint_unittest.py | Python | gpl-3.0 | 228,992 |
"""
Component to interface with various locks that can be controlled remotely.
For more details about this component, please refer to the documentation
at https://home-assistant.io/components/lock/
"""
from datetime import timedelta
import functools as ft
import logging
import voluptuous as vol
from homeassistant.lo... | PetePriority/home-assistant | homeassistant/components/lock/__init__.py | Python | apache-2.0 | 4,322 |
from __future__ import with_statement
import datetime
import logging
try:
import threading
except ImportError:
threading = None
from flask_debugtoolbar.panels import DebugPanel
from flask_debugtoolbar.utils import format_fname
_ = lambda x: x
class ThreadTrackingHandler(logging.Handler):
def __init__(s... | morreene/tradenews | venv/Lib/site-packages/flask_debugtoolbar/panels/logger.py | Python | bsd-3-clause | 3,262 |
import unittest
from unittest.mock import mock_open, patch
from pandas import Series, DataFrame
from pandas.util.testing import assert_series_equal, assert_frame_equal, assert_panel_equal
from fa.database import models
class PandasTestCase(unittest.TestCase):
""" For test case with assertion involving Pandas ND... | kakarukeys/algo-fa | tests/util.py | Python | gpl-2.0 | 2,457 |
# coding=utf-8
# Copyright 2022 The Google Research 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 applicab... | google-research/google-research | hyperbolic_discount/hyperbolic_dqn_agent.py | Python | apache-2.0 | 13,894 |
import _plotly_utils.basevalidators
class XperiodalignmentValidator(_plotly_utils.basevalidators.EnumeratedValidator):
def __init__(self, plotly_name="xperiodalignment", parent_name="heatmap", **kwargs):
super(XperiodalignmentValidator, self).__init__(
plotly_name=plotly_name,
pare... | plotly/plotly.py | packages/python/plotly/plotly/validators/heatmap/_xperiodalignment.py | Python | mit | 572 |
from __future__ import (absolute_import, division, print_function,
unicode_literals)
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import matplotlib as mpl
from .components import aes, assign_visual_mapping
from .components import colors, shapes
from .components.legend... | eco32i/ggplot | ggplot/ggplot.py | Python | bsd-2-clause | 25,992 |
def extractSimonwesterosBlogspotCom(item):
'''
Parser for 'simonwesteros.blogspot.com'
'''
vol, chp, frag, postfix = extractVolChapterFragmentPostfix(item['title'])
if not (chp or vol) or "preview" in item['title'].lower():
return None
tagmap = [
('PRC', 'PRC', 'translated'),
(... | fake-name/ReadableWebProxy | WebMirror/management/rss_parser_funcs/feed_parse_extractSimonwesterosBlogspotCom.py | Python | bsd-3-clause | 564 |
# This file is part of Shuup.
#
# Copyright (c) 2012-2021, Shuup Commerce Inc. All rights reserved.
#
# This source code is licensed under the OSL-3.0 license found in the
# LICENSE file in the root directory of this source tree.
from shuup.utils import update_module_attributes
from ._theme import override_current_the... | shoopio/shoop | shuup/xtheme/testing.py | Python | agpl-3.0 | 425 |
from __future__ import absolute_import
from __future__ import print_function
from __future__ import division
def _gap_insertion_sort(a_list, start, gap):
for i in range(start + gap, len(a_list), gap):
current_value = a_list[i]
position = i
while (position >= gap) and (a_list[position - ga... | bowen0701/algorithms_data_structures | alg_shell_sort.py | Python | bsd-2-clause | 1,092 |
"""
The Plaid API
The Plaid REST API. Please see https://plaid.com/docs/api for more details. # noqa: E501
Generated by: https://openapi-generator.tech
"""
import re # noqa: F401
import sys # noqa: F401
from plaid.model_utils import ( # noqa: F401
ApiTypeError,
ModelComposed,
ModelNormal... | plaid/plaid-python | plaid/model/paystub_details.py | Python | mit | 8,019 |
# Copyright (c) 2015 The Johns Hopkins University/Applied Physics Laboratory
# 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/LICEN... | OpenKMIP/PyKMIP | kmip/demos/pie/destroy.py | Python | apache-2.0 | 1,553 |
#!/usr/bin/env python
#
# Copyright 2013 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# GNU Radio 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, or (at your option)
... | Gabotero/GNURadioNext | gr-digital/python/qa_ofdm_txrx.py | Python | gpl-3.0 | 5,471 |
"""
MB85RC04 driver code is placed under the BSD license.
Copyright (c) 2014, Emlid Limited, www.emlid.com
Written by Vladislav Zakharov
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributio... | muawijhe/ccnavio | ext/navio/Python/FRAM/MB85RC04.py | Python | mit | 3,115 |
from django.conf.urls.defaults import patterns, url
urlpatterns = patterns('converter.views',
url(r'^formats/$', 'formats_list', (), 'formats_list'),
)
| appsembler/mayan_appsembler | apps/converter/urls.py | Python | gpl-3.0 | 157 |
"""Provides a class for managing BIG-IP Profile resources."""
# coding=utf-8
#
# Copyright (c) 2017,2018, F5 Networks, 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.a... | ryan-talley/f5-cccl | f5_cccl/resource/ltm/profile/profile.py | Python | apache-2.0 | 1,655 |
from django.conf.urls import patterns, include, url
from django.contrib import admin
urlpatterns = patterns('',
# Examples:
# url(r'^$', 'domoton.views.home', name='home'),
# url(r'^blog/', include('blog.urls')),
url(r'^admin/', include(admin.site.urls)),
)
| sonirico/domoton | domoton/urls.py | Python | gpl-2.0 | 276 |
'''
Created on Jul 22, 2011
@author: Rio
'''
import copy
from datetime import datetime
import itertools
from logging import getLogger
from math import floor
import os
import re
import random
import shutil
import struct
import time
import traceback
import weakref
import zlib
import sys
import blockrotation
from box i... | tinkerinestudio/Tinkerine-Suite | TinkerineSuite/Cura/util/pymclevel/infiniteworld.py | Python | agpl-3.0 | 61,606 |
#!/usr/bin/env python2
import sys
import os
import gettext
import glob
from optparse import OptionParser
import shutil
import gi
gi.require_version("Gtk", "3.0")
gi.require_version("CMenu", "3.0")
from gi.repository import GLib, Gtk, Gio, CMenu, GdkPixbuf
sys.path.insert(0, '/usr/share/cinnamon/cinnamon-menu-editor'... | RavetcoFX/Cinnamon | files/usr/share/cinnamon/cinnamon-desktop-editor/cinnamon-desktop-editor.py | Python | gpl-2.0 | 20,812 |
from django.db import models
from django.db.models import Sum
from django.utils.translation import ugettext as _
from django.db.models.signals import post_save
from django.dispatch import receiver
from smartmin.models import SmartModel
from model_utils import Choices
from model_utils.models import TimeStampedModel
from... | savioabuga/phoenix | phoenix/animals/models.py | Python | bsd-3-clause | 6,605 |
#!/usr/bin/python
import urllib2
import sys
def print_http_respose_header(url):
try:
response = urllib2.urlopen(url)
for key, value in response.info().items():
print key + ' => ' + value
except:
print 'error message'
def main():
print_http_respose_header(sys.argv[1])
if __name__ == '__main__':
main()
| ajitabhpandey/learn-programming | python/httpResponseHeader.py | Python | gpl-2.0 | 319 |
# coding=utf-8
# Copyright 2021 The HuggingFace Inc. team.
#
# 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... | huggingface/transformers | src/transformers/feature_extraction_sequence_utils.py | Python | apache-2.0 | 18,114 |
import pygame.camera
import pygame.image
from datetime import datetime
from datetime import timedelta
import signal # Import Signals
import sys
class EventTimer(object):
def __init__(self, hours = 0, minutes = 0, seconds = 0):
self.__delta = timedelta(hours = hours, minutes = minutes, seconds = seconds)... | Azrrael-exe/RPiPhotoShoot | Tests/takePhoto.py | Python | mit | 1,169 |
# -*- coding: utf-8 -*-
'''
Exodus Add-on
Copyright (C) 2016 Exodus
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 l... | viranch/exodus | resources/lib/indexers/movies.py | Python | gpl-3.0 | 44,317 |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright (c) 2010 Citrix Systems, Inc.
# Copyright 2010 OpenStack Foundation
#
# 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
#
# ... | ntt-sic/nova | nova/virt/xenapi/vmops.py | Python | apache-2.0 | 88,905 |
"""
=============
Generic Views
=============
Class based helper views.
"""
class GenericManyToMany(object):
"""Generic view to edit many to many relations with extra fields."""
left_table = None
right_table = None
allow_multiple = True
| tjnapster555/django-edu | djangoedu/core/generic_views.py | Python | mit | 264 |
CODES = {
200: 'thunderstorm with light rain',
201: 'thunderstorm with rain',
202: 'thunderstorm with heavy rain',
210: 'light thunderstorm',
211: 'thunderstorm',
212: 'heavy thunderstorm',
221: 'ragged thunderstorm',
230: 'thunderstorm with light drizzle',
231: 'thunderstorm with d... | bkosciow/doton | service/openweather_codes.py | Python | mit | 1,557 |
"""
* Copyright 2008 Google 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, so... | Hasimir/pyjs | pyjswidgets/pyjamas/Canvas/GWTCanvasImplDefault.py | Python | apache-2.0 | 6,520 |
#/usr/bin/python
# -*- coding: UTF-8 -*-
import tornado.httpserver
import tornado.ioloop
import tornado.options
import tornado.web
import tornado.httpclient
import urllib
import json
import datetime
import time
import re
import urlparse
import hashlib
import time
import json
from pymongo import MongoClient
from bson... | icatholic/icc | scripts/weixin/service.py | Python | bsd-3-clause | 10,180 |
from django.core.exceptions import ObjectDoesNotExist, ValidationError
from django.db import models
import mozdns
from mozdns.domain.models import Domain
from mozdns.view.models import View
from mozdns.mixins import ObjectUrlMixin, DisplayMixin
from mozdns.validation import validate_first_label, validate_name
from moz... | rtucker-mozilla/mozilla_inventory | mozdns/models.py | Python | bsd-3-clause | 8,260 |
import time
from pulsar import HttpException
from pulsar.apps import ws
from pulsar.apps.data import PubSubClient, create_store
from pulsar.utils.system import json
from pulsar.utils.string import random_string
def home(request):
from django.shortcuts import render_to_response
from django.template import Req... | ymero/pulsar | examples/djchat/djchat/views.py | Python | bsd-3-clause | 4,766 |
from django.shortcuts import render_to_response,get_object_or_404,render
from django.template import Context, RequestContext,loader
from django.http import HttpResponse
from django.http import HttpResponseRedirect
from models import Auth
from forms import LoginForm
authenticated = 0
def index(request):
global authe... | aswinm/libman | login/views.py | Python | gpl-2.0 | 1,296 |
#!/usr/bin/python3
# -*- coding: utf-8 -*-
import subprocess
import stations
windows = subprocess.check_output(
['tmux', 'list-windows', '-F', '#{window_name}']).strip().decode().split()
count = 0
for key in stations.city.keys():
if key in windows:
print(key)
count += 1
exit(count)
#print(wind... | endlisnis/weather-records | activeWindowCount.py | Python | gpl-3.0 | 325 |
# Copyright (c) 2011 Justin Santa Barbara
#
# 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 applicab... | github-borat/cinder | cinder/tests/integrated/api/client.py | Python | apache-2.0 | 7,946 |
from .miscutils import *
from .timeutils import *
from .logutils import *
from .argsutils import *
from .error_message_utils import *
from .handleutils import * # This needs argsutils
from .routingkeys import * | IS-ENES-Data/esgf-pid | esgfpid/utils/allutils.py | Python | apache-2.0 | 213 |
#!/usr/bin/env python2.7
import os
import subprocess as sub
import time
wd = os.path.dirname(os.path.realpath(__file__))
print os.path.dirname(os.path.realpath(__file__))
cmd = os.path.join( wd, 'n_jobs.sh' )
res = sub.check_output( [cmd] )
print int(res)
while int(sub.check_output( [cmd] )) >= 1 :
time.sleep(... | jdbrice/rcpMaker | runner/wait_for_jobs.py | Python | mit | 327 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Tests for the Sphinx build configuration and documentation file writer."""
import unittest
from l2tdevtools import dependencies
from l2tdevtools.dependency_writers import sphinx_docs
from l2tdevtools.helpers import project
from tests import test_lib
class SphinxBuil... | joachimmetz/l2tdevtools | tests/dependency_writers/sphinx_docs.py | Python | apache-2.0 | 1,974 |
# Copyright 2007, 2008, 2009, 2010 Manuel Arriaga
#
#
# 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 i... | kisp/oyepa-git | fslayer.py | Python | gpl-2.0 | 32,224 |
import os
import sys
WIN = sys.platform == 'win32' or os.name == 'nt'
if not WIN:
def get_binpath(prefix):
return os.path.join(prefix, 'bin')
def get_exec_path(binpath, execbin):
return os.path.join(binpath, execbin)
def exec_bin(execbin, argv, env):
os.execve(execbin, argv, env)... | bertjwregeer/vrun | src/vrun/oscompat.py | Python | isc | 884 |
#!/usr/bin/env python
from struct import pack
import bq78350
import smbus
import srec
import sys
import time
# Load SREC
data = srec.Segment(bq78350.data_srec_origin, bq78350.data_segment_size, \
pack('>B', 0xFF))
code = srec.Segment(bq78350.code_srec_origin, bq78350.code_segment_size * 4, \
pack('>L', bq78350... | taiwenko/python | bmutest/program.py | Python | mit | 1,499 |
import sys
import logging
from jetcomcrawl.modes import categories, items, details
if __name__ == '__main__':
logging.basicConfig(level=logging.INFO)
if len(sys.argv) < 2:
print('Please enter the mode you wish to run:\npython3 run.py [get_categories|get_items|get_details]')
sys.exit()
mod... | tdickman/jetcom-crawl | jetcomcrawl/run.py | Python | mit | 601 |
# -*- coding: utf-8 -*-
#
# DDT documentation build configuration file, created by
# sphinx-quickstart on Tue Feb 21 23:00:01 2012.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# All con... | domidimi/ddt | docs/conf.py | Python | mit | 8,103 |
import pkg_resources
from pyramid.static import static_view
def includeme(config):
"""Add static route support to the Configurator.
"""
config.add_directive('add_static_route', add_static_route)
def add_static_route(config, package, subdir, cache_max_age=3600,
**add_route_args):
"""Add a route and... | hlwsmith/akhet | akhet/static.py | Python | mit | 2,988 |
#coding=utf-8
from django.contrib import admin
from biz.floating.models import Floating
class FloatingAdmin(admin.ModelAdmin):
list_display = ("id", "ip", "status", "instance","user")
admin.site.register(Floating, FloatingAdmin)
| zhanghui9700/eonboard | eoncloud_web/biz/floating/admin.py | Python | apache-2.0 | 241 |
from colab.plugins.views import ColabProxyView
class TaigaPluginProxyView(ColabProxyView):
app_label = 'colab_taiga'
diazo_theme_template = 'proxy/taiga.html'
add_remote_user = True
| mes-2016-1/colab-taiga-plugin | src/colab_taiga/views.py | Python | gpl-3.0 | 196 |
import contextlib
import unittest
import pytest
from cryptography import x509
import six
from ipapython.dn import DN, RDN, AVA
if six.PY3:
unicode = str
def cmp(a, b):
if a == b:
assert not a < b
assert not a > b
assert not a != b
assert a <= b
... | apophys/freeipa | ipatests/test_ipapython/test_dn.py | Python | gpl-3.0 | 48,955 |
import numpy as np
class Comparison(object):
def get_num_features(self,shp):
return shp[1] * shp[2] * shp[3]
class Concatenate(Comparison):
def get_num_features(self, shp):
return 2 * shp[1] * shp[2] * shp[3]
def __call__(self, x, y):
return np.concatenate([x.flatten(),y.flatte... | yamins81/thor_model_exploration | thor_model_exploration/comparisons.py | Python | mit | 982 |
from . import res_partner
from . import account_move
| avanzosc/odoo-addons | account_invoice_report_grouped_by_event/models/__init__.py | Python | agpl-3.0 | 53 |
# -*- coding: utf-8 -*-
# @author: vuolter
from __future__ import absolute_import, unicode_literals
import os
import re
import sys
from future import standard_library
standard_library.install_aliases()
def char(text, chars, repl=''):
return re.sub(r'[{0}]+'.format(chars), repl, text)
_UNIXBADCHARS = ('\0', ... | pyblub/pyload | pyload/utils/purge.py | Python | agpl-3.0 | 1,743 |
# Copyright 2008, Patrick C. McGinty
# 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 distribut... | epronk/mktoc | src/mktoc/parser.py | Python | gpl-3.0 | 21,169 |
# -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*-
# Copyright 2012 Canonical
# Author: Thomi Richards
#
# This program is free software: you can redistribute it and/or modify it
# under the terms of the GNU General Public License version 3, as published
# by the Free Software Foundation.
from ... | foer/linuxmuster-client-unity | tests/autopilot/unity/tests/test_command_lens.py | Python | gpl-3.0 | 4,262 |
# coding: utf-8
#
# Copyright 2011 Yesudeep Mangalapilly <yesudeep@gmail.com>
# Copyright 2012 Google, Inc & contributors.
#
# 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.a... | snakeleon/YouCompleteMe-x64 | third_party/ycmd/third_party/watchdog_deps/watchdog/src/watchdog/observers/polling.py | Python | gpl-3.0 | 4,798 |
from datetime import datetime
import logging
from dns import resolver
from ruxit.api.base_plugin import RemoteBasePlugin
from dynatrace import Dynatrace
from dynatrace.environment_v1.synthetic_third_party import SYNTHETIC_EVENT_TYPE_OUTAGE
log = logging.getLogger(__name__)
class DNSExtension(RemoteBasePlugin):
... | ruxit/data-export-api | third-party-synthetic/active-gate-extensions/extension-third-party-dns/src/dns_extension.py | Python | bsd-3-clause | 4,210 |
# -*- coding: utf-8 -*-
import sys
from django.db import migrations
from django.db import migrations, transaction
from django.db.backends.postgresql_psycopg2.schema import DatabaseSchemaEditor
from django.db.migrations.state import StateApps
from django.db.models import F
def set_initial_value_of_is_private_flag(
... | jackrzhang/zulip | zerver/migrations/0182_set_initial_value_is_private_flag.py | Python | apache-2.0 | 1,962 |
# -*- coding: utf-8 -*-
from __future__ import absolute_import, division, print_function
# Bring everything from c++ module to global namespace.
from moose._moose import *
# Bring everything from moose.py to global namespace.
# IMP: It will overwrite any c++ function with the same name. We can override
# some C++ ... | BhallaLab/moose-core | pymoose/__init__.py | Python | gpl-3.0 | 613 |
# -*- coding: utf-8 -*-
from south.utils import datetime_utils as datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding field 'Environment.migrate_environment'
db.add_column(u'physical... | globocom/database-as-a-service | dbaas/physical/migrations/0049_auto__add_field_environment_migrate_environment.py | Python | bsd-3-clause | 16,738 |
from django.contrib.auth.models import User
from django.test import TestCase, Client
from django.urls import reverse
# Declaration of Username and Password
username = 'admin'
password = 'Test1234$'
"""
Method to replicate
~~~~~~~~~~~~~~~~~~~
1. Bring up a new instance of NearBeach (grab from fixtures)
2. Try and log ... | robotichead/NearBeach | NearBeach/tests/tests_specific_bugs/test_new_instance.py | Python | mit | 1,174 |
# sql/compiler.py
# Copyright (C) 2005-2019 the SQLAlchemy authors and contributors
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
"""Base SQL and DDL compiler implementations.
Classes provided include:
:class:`.c... | wujuguang/sqlalchemy | lib/sqlalchemy/sql/compiler.py | Python | mit | 126,093 |
import time
import pandas as pd
import spacy
import scattertext as st
nlp = spacy.load('en_core_web_sm', parser=False)
t0 = time.time()
reviews_df = pd.read_csv('https://github.com/JasonKessler/ICLR18ReviewVis/raw/master/iclr2018_reviews.csv.bz2')
reviews_df['parse'] = reviews_df['review'].apply(st.whitespace_nlp_wi... | JasonKessler/scattertext | demo_four_square.py | Python | apache-2.0 | 2,829 |
# -*- coding: utf-8 -*-
# Copyright 2016 Onestein (<http://www.onestein.eu>)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from odoo.tests import common
class TestOptOut(common.TransactionCase):
def setUp(self):
super(TestOptOut, self).setUp()
self.company = self.env.ref('... | VitalPet/addons-onestein | mail_opt_out_default/test/test_opt_out.py | Python | agpl-3.0 | 1,004 |
import bpy
import bmesh
import sys,getopt
import os
from math import pi
bpy.ops.object.mode_set(mode='OBJECT')
lista = sys.argv
print("Argument List:"+ str(lista))
print(str(lista[len(sys.argv)-1]))
profZ = float(lista[len(sys.argv)-1])
print("hello, imprimir vetices del poligono en " + str(profZ))
#bpy.context.tool_s... | marshallcoz/turnt-octo-happiness | LayIBEM3d/geometria3d/poligonoZ0/poligonoEnLaSuperficie.py | Python | mit | 3,151 |
# coding: utf-8
# In[1]:
import numpy as np
import os
import sys
import multiprocessing
import scipy.sparse
import pickle
import getopt
# In[2]:
def data_to_dist(X):
s = np.sum(X,axis=1)
X = X / s[:,None]
return X, s
# In[3]:
try:
opts, args = getopt.getopt(sys.argv[1:],"i:m:t:d:",["idir=","num... | govinda-kamath/clustering_on_transcript_compatibility_counts | Trapnell_pipeline/get_tcc_dist.py | Python | mit | 2,722 |
# -*- coding: utf-8 -*-
"""
Created on Wed Sep 24 19:01:10 2014
@author: zhaoyd
"""
| adamchau/goagent_localupdate | backup_ini.py | Python | mit | 93 |
#!/usr/bin/env python3
# imports
import logging
from hardware_controller import *
from time import sleep, time
import queue
class Robot:
""" Main class for controlling our robot morTimmy
The brain of the robot is a raspberry Pi and the low level
electronic are handled by an Arduino. The Arduino provides... | thiezn/morTimmy | raspberrypi/morTimmy/morTimmy.py | Python | mit | 5,132 |
"""
@author: kt12
Kenneth Tsuji
2017-07-17
@editor: adomakor12
Kenneth Tsuji
2017-07-17
"""
import sys, os, logging
from dotenv import load_dotenv
import time
import pymongo
import tweepy
import json
# Set number of tweets to record, sleep between API calls, and subject matter
num_tweets = int(sys.argv[1])
sleep = f... | adomakor412/ENODO_global | social_analyzer.py | Python | mit | 7,562 |
from __future__ import print_function, division, absolute_import
#
# Copyright (c) 2010 Red Hat, Inc.
#
# Authors: Jeff Ortel <jortel@redhat.com>
#
# This software is licensed to you under the GNU General Public License,
# version 2 (GPLv2). There is NO WARRANTY for this software, express or
# implied, including the i... | Lorquas/subscription-manager | src/plugins/product-id.py | Python | gpl-2.0 | 4,795 |
#!/usr/bin/env python3
# Copyright (c) 2015-2018 The Bitcoin Unlimited developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
import test_framework.loginit
import os
import os.path
import time
import sys
if sys.version_info[0] ... | BitcoinUnlimited/BitcoinUnlimited | qa/rpc-tests/pingearly.py | Python | mit | 2,275 |
#!/usr/bin/env python
'''
Example module
Take a look at the test module to check how events are handled.
'''
about = "About message goes here."
def main(server, initOnChannel, usrManager):
# This gets called when the module is initialized.
# InitOnChannel is the channel this module was loaded. Or nothing
# ... | dom96/MDSBot | modules/base.py | Python | gpl-2.0 | 539 |
import clq
import clq.extensions
import clq.backends.opencl as ocl
import clq.extensions.language_types as lang #the regex types extension.
OpenCL = ocl.Backend()
#TEST: Memoizing Language based on regular expression equivalence
L1 = lang.ConstrainedString(OpenCL, "(.?)+")
L2 = lang.ConstrainedString(OpenCL, ".*")
ass... | cyrus-/ace | tests/subtyping_hello.py | Python | lgpl-3.0 | 4,474 |
"""The tests for the State vacuum Mqtt platform."""
from copy import deepcopy
import json
from unittest.mock import patch
import pytest
from homeassistant.components import vacuum
from homeassistant.components.mqtt import CONF_COMMAND_TOPIC, CONF_STATE_TOPIC
from homeassistant.components.mqtt.vacuum import CONF_SCHEM... | mezz64/home-assistant | tests/components/mqtt/test_state_vacuum.py | Python | apache-2.0 | 21,078 |
from . import rbtree
import warnings
warnings.warn("This API is completely experimental and likely to change very soon. Use with caution.", FutureWarning)
try:
from autogenerated_path import getDrakePath
except ImportError:
from insource_path import getDrakePath | hanssusilo/drake | drake/bindings/python/pydrake/__init__.py | Python | bsd-3-clause | 272 |
'''
Created on 7 jun. 2021
@author: Gregorio Corral
'''
from rest_framework import serializers
from colony.models import Client, Space, NetAddress
class NetAddressSerializer(serializers.ModelSerializer):
class Meta:
model = NetAddress
fields = '__all__'
class ClientSerial... | gcorral/hivequeen | HiveQueen/rest_hq/serializers.py | Python | gpl-2.0 | 680 |
'Tokenize input text for the Recognizer.'
__author__ = 'Nick Montfort'
__copyright__ = 'Copyright 2011 Nick Montfort'
__license__ = 'ISC'
__version__ = '0.5.0.0'
__status__ = 'Development'
import sys
import re
try:
import readline
except ImportError:
pass
import input_model
def prepare(separator, prompt='',... | cjb/curveship | preparer.py | Python | isc | 1,809 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
from django.conf import settings
class Migration(migrations.Migration):
dependencies = [
('users', '0014_auto_20151005_1357'),
]
operations = [
migrations.AddField(
model... | xdevelsistemas/taiga-back-community | taiga/users/migrations/0015_auto_20160120_1409.py | Python | agpl-3.0 | 827 |
# Copyright 2019 Verily Life Sciences 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed t... | verilylifesciences/classifaedes | classifaedes/hparams_lib_test.py | Python | apache-2.0 | 1,292 |
# -*- coding: utf-8 -*-
"""
Created on Mon Oct 14 21:23:43 2013
@author: Yigong
"""
import sqlite3
import pandas as pd
import numpy as np
connection = sqlite3.connect('airport.db')
cursor = connection.cursor()
sql_cmd = '''CREATE TABLE IF NOT EXISTS top50(id INTEGER PRIMARY KEY AUTOINCREMENT, City TEXT, FAA TEXT, IATA... | yigong/AY250 | hw6/hw_6_data/top50.py | Python | mit | 1,090 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
]
operations = [
migrations.CreateModel(
name='Court',
fields=[
('id', models.AutoField(verbos... | khansrk/khanadvocates | advocates/migrations/0001_initial.py | Python | bsd-3-clause | 1,766 |
#!/usr/bin/env python
#
# Copyright 2005 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# GNU Radio 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, or (at your option)
... | trnewman/VT-USRP-daughterboard-drivers_python | gnuradio-core/src/python/gnuradio/gr/qa_kludged_imports.py | Python | gpl-3.0 | 1,262 |
#!/usr/bin/env python
#
# Jetduino Example for using the Grove Thumb Joystick (http://www.seeedstudio.com/wiki/Grove_-_Thumb_Joystick)
#
# The Jetduino connects the Jetson and Grove sensors. You can learn more about the Jetduino here: http://www.NeuroRoboticTech.com/Projects/Jetduino
#
# Have a question about t... | NeuroRoboticTech/Jetduino | Software/Python/grove_thumb_joystick.py | Python | mit | 3,602 |
#Licensed to the Apache Software Foundation (ASF) under one
#or more contributor license agreements. See the NOTICE file
#distributed with this work for additional information
#regarding copyright ownership. The ASF licenses this file
#to you under the Apache License, Version 2.0 (the
#"License"); you may not use thi... | ZhangXFeng/hadoop | src/hadoop-mapreduce1-project/src/contrib/hod/hodlib/Hod/hod.py | Python | apache-2.0 | 29,420 |
# Copyright 2013-2021 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 Hdf5VfdGds(CMakePackage, CudaPackage):
"""This package enables GPU Direct Storage Virtual ... | LLNL/spack | var/spack/repos/builtin/packages/hdf5-vfd-gds/package.py | Python | lgpl-2.1 | 1,102 |
'''
Created on Sep 28, 2013
@author: justin
'''
class databaseConstants():
'''
Holds the metadata behind the database creation
'''
_connDict = {
'DBType':'mysql',
'DBUsername':'root',
'DBPassword':'Ginger*12',
'DBNAme':'SportsStatistics',
'DBServer':'local... | JJarczyk12/Sports-Statistical-Scraper | SportsStatistics/model/databaseConstants.py | Python | mit | 2,575 |
#!/usr/bin/env python
"""
This file is a series of tasks to preprocess COBRE dataset
Installation
------------
It runs on Python > 3.3 or Python2.7 and uses invoke (or Fabric when a Python3 version is released) to execute
the tasks from the command line.
- requirements
pip install invoke
pip install git@github.com:N... | alexsavio/cobre | fabfile.py | Python | bsd-3-clause | 68,111 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.