code stringlengths 2 1.05M | repo_name stringlengths 5 104 | path stringlengths 4 251 | language stringclasses 1
value | license stringclasses 15
values | size int32 2 1.05M |
|---|---|---|---|---|---|
# -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# This module copyright (C) 2014 Savoir-faire Linux
# (<http://www.savoirfairelinux.com>).
#
# This program is free software: you can redistribute it and/or m... | rschnapka/knowledge | document_multiple_records/__openerp__.py | Python | agpl-3.0 | 1,965 |
#
# Copyright (c) 2013-2014, Scott J Maddox
#
# This file is part of SimplePL.
#
# SimplePL 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 opt... | scott-maddox/simplepl | src/simplepl/expanding_buffer.py | Python | agpl-3.0 | 3,653 |
"""
Your module documentation here
"""
class PrimeClass(object):
"""This is a class that contains a is_prime method which checks primes"""
def is_prime(self, num_int):
""" This is a method called is_prime which checks primes number"""
# your primes code here
number = int(num_int)
... | IsabelEsparza/jarsa-applicant | primes.py | Python | agpl-3.0 | 694 |
# -*- coding: utf-8 -*-
# Copyright (C) 2014 Johannes Baiter <johannes.baiter@gmail.com>
#
# This program 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 ... | DIYBookScanner/spreads | spreads/config.py | Python | agpl-3.0 | 8,701 |
import io
import qrcode
from qrcode.image import pil, svg
from odoo import api, models
class IrActionsReport(models.Model):
_inherit = "ir.actions.report"
@api.model
def qr_generate(self, value, box_size=3, border=5, factory="png", **kwargs):
factories = {
"png": pil.PilImage,
... | OCA/reporting-engine | report_qr/models/ir_actions_report.py | Python | agpl-3.0 | 1,138 |
# -*- coding: utf-8 -*-
# Copyright 2016-2017 LasLabs Inc.
# License GPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html).
{
'name': 'Prescription Verification - States and Logic',
'summary': 'Introduces verified prescription states and related logic',
'version': '10.0.1.0.0',
'author': 'LasLabs, O... | laslabs/vertical-medical | medical_prescription_state_verify/__manifest__.py | Python | agpl-3.0 | 897 |
# -*- coding: utf-8 -*-
# ยฉ 2016 OpenSynergy Indonesia
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from .base import BaseTestHrPayslip
class TestWorkedDaysFromActivity(BaseTestHrPayslip):
def test_1(self):
self.timesheet1.button_confirm()
self.timesheet1.signal_workflow("... | open-synergy/opnsynid-hr | hr_worked_days_from_activity/tests/test_hr_payslip.py | Python | agpl-3.0 | 1,897 |
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from . import account_journal
from . import account_tax_registry
from . import account
from . import vat_registry
| OCA/l10n-italy | l10n_it_vat_registries/models/__init__.py | Python | agpl-3.0 | 179 |
# Copyright 2018 OpenSynergy Indonesia
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
{
"name": "Partner Experiences",
"version": "8.0.1.3.0",
"category": "Partner",
"website": "https://simetri-sinergi.id",
"author": "OpenSynergy Indonesia, PT. Simetri Sinergi Indonesia",
"licen... | open-synergy/opnsynid-partner-contact | partner_experience/__openerp__.py | Python | agpl-3.0 | 792 |
#!/usr/bin/env python
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "armada.settings")
from django.core.management import execute_from_command_line
execute_from_command_line(sys.argv)
| kriberg/eve-armada | manage.py | Python | agpl-3.0 | 249 |
# This file is part of Booktype.
# Copyright (c) 2014 Helmy Giacoman <helmy.giacoman@sourcefabric.org>
#
# Booktype 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
# ... | MiczFlor/Booktype | lib/booktype/apps/account/tests/test_dashboard.py | Python | agpl-3.0 | 4,013 |
import base
import os
import re
import unittest
class ClassGenerator(object):
def __init__(self, workflows_directory, module, **kwargs):
self.workflows_directory = workflows_directory
self.module = module
self.pass_through_args = kwargs
def generate_classes(self):
for workflo... | genome/flow-workflow | system_tests/generator.py | Python | agpl-3.0 | 2,388 |
# -*- coding: utf-8 -*-
##############################################################################
#
# Nautical
# Copyright (C) 2013 Sistemas ADHOC
# No email
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# ... | ingadhoc/odoo-saas-manager | addons/saas_manager_invoicing/TOREM_invoice_line.py | Python | agpl-3.0 | 1,408 |
# Copyright 2013-2021 Akretion (http://www.akretion.com)
# @author Alexis de Lattre <alexis.delattre@akretion.com>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from odoo import fields, models
class AccountTax(models.Model):
_inherit = "account.tax"
account_accrued_revenue_id = fields.Man... | OCA/account-closing | account_cutoff_base/models/account_tax.py | Python | agpl-3.0 | 707 |
import os
import sys
import logging
import fixture.examples.django_example
sys.path.append(os.path.dirname(fixture.examples.django_example.__file__))
## this is set by the test script?
# os.environ['DJANGO_SETTINGS_MODULE'] = 'project.settings'
## handled by NoseDjango now?
# from django.core.management import call_... | patrickod/fixture | fixture/test/test_loadable/test_django/__init__.py | Python | lgpl-2.1 | 505 |
"""Loading icons."""
# Copyright (C) 2009, Thomas Leonard
# See the README file for details, or visit http://0install.net.
from zeroinstall import _
import gtk
from logging import warn
import math
def load_icon(icon_path, icon_width=None, icon_height=None):
"""Load icon from path. Icon MUST be in PNG format.
@param... | pombredanne/zero-install | zeroinstall/gtkui/icon.py | Python | lgpl-2.1 | 1,367 |
# Copyright (C) 2008 Red Hat, Inc.
# Copyright (C) 2016 Sam Parkinson <sam@sam.today>
#
# 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 your opti... | i5o/sugar-toolkit-gtk3 | src/sugar3/activity/bundlebuilder.py | Python | lgpl-2.1 | 25,269 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# ####################################################################
# Copyright (C) 2005-2009 by the FIFE team
# http://www.fifengine.de
# This file is part of FIFE.
#
# FIFE is free software; you can redistribute it and/or
# modify it under the terms of the GNU Le... | mgeorgehansen/FIFE_Technomage | tools/ruleset_tester.py | Python | lgpl-2.1 | 6,272 |
#!/usr/bin/python2.4
# vim:ts=4:sw=4:softtabstop=4:smarttab:expandtab
#
# $Id$
#
# Copyright (C) 1999-2006 Keith Dart <keith@kdart.com>
#
# 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... | xiangke/pycopia | WWW/pycopia/WWW/__init__.py | Python | lgpl-2.1 | 954 |
#!/usr/bin/python2.4
# vim:ts=4:sw=4:softtabstop=4:smarttab:expandtab
#
# $Id$
#
# Copyright (C) 1999-2006 Keith Dart <keith@kdart.com>
#
# 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... | xiangke/pycopia | experimental/pycopia/_unittest/test_x_gzip.py | Python | lgpl-2.1 | 2,104 |
from markdown.blockprocessors import BlockProcessor
from MooseCommonExtension import MooseCommonExtension
import glob
import re
import os
from markdown.util import etree
class MooseCarousel(BlockProcessor, MooseCommonExtension):
"""
Markdown extension for showing a bootstrap carousel of images.
Markdown sy... | katyhuff/moose | python/MooseDocs/extensions/MooseCarousel.py | Python | lgpl-2.1 | 7,185 |
# Written by Bram Cohen
# see LICENSE.txt for license information
import sys
from types import UnicodeType, StringType, LongType, IntType, ListType, DictType
from re import compile
#reg = compile(r'^[^/\\.~][^/\\]*$')
#reg = compile(r'^[^/\\]*$')
ints = (LongType, IntType)
def check_info(info):
if ... | egbertbouman/tribler-g | Tribler/Core/BitTornado/BT1/btformats.py | Python | lgpl-2.1 | 5,210 |
# Copyright (C) 2015-2022 by the RBniCS authors
#
# This file is part of RBniCS.
#
# SPDX-License-Identifier: LGPL-3.0-or-later
from .beta_distribution import BetaDistribution
__all__ = [
"BetaDistribution"
]
| mathLab/RBniCS | tutorials/10_weighted_uq/sampling/distributions/__init__.py | Python | lgpl-3.0 | 215 |
import celery.decorators
from celery.task.base import Task
task = celery.task
from celery.execute import send_task
Task = Task
CONFIG = None
| cloud9ers/j25framework | j25/tasks/__init__.py | Python | lgpl-3.0 | 142 |
#!/usr/bin/env python
# coding:utf-8
# Copyright (c) 2011, Vadim Velikodniy <vadim-velikodniy@yandex.ru>
#
# 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.1 of the Lic... | velikodniy/python-fotki | fotki/collection.py | Python | lgpl-3.0 | 8,440 |
"""
Copyright (C) 2014, ็ณ็็ (Ruimin Shen)
This program 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 3 of the License, or
(at your option) any later version.
This program is distributed i... | O-T-L/PyOptimization | Data/CommunityDiscovery/make_matrix.py | Python | lgpl-3.0 | 1,369 |
#! /usr/bin/python
# -*- coding: utf-8 -*-
from PySide2.QtWidgets import QGroupBox, QCheckBox, QGridLayout, QPushButton, QSpinBox, \
QLabel, QSlider
from PySide2.QtCore import Qt
class Zoom_UI(QGroupBox):
"""
A QGroupbox widget with all properties of a Visca camera
"""
... | PixelStereo/viscam | src/zoom.py | Python | lgpl-3.0 | 3,377 |
#
# setup.py
#
"""
A (non-web) graphic user interface for interacting with AliMonitor
"""
import os
from setuptools import (setup, find_packages)
from importlib.machinery import SourceFileLoader
metadata_path = os.path.join(".", "alimaster", "metadata.py")
metadata = SourceFileLoader("metadata", metadata_path).load_m... | akubera/AliMaster | setup.py | Python | lgpl-3.0 | 1,311 |
from nodesk_template import model_manager
import nodesk_template.models
from django.core.management import call_command
model_manager.sync_model("./nodesk_template/template_yaml")
| NoDesk/NoDesk-Server | nodesk_server/test_data.py | Python | lgpl-3.0 | 181 |
from pycp2k.inputsection import InputSection
from ._each274 import _each274
from ._density_gradient1 import _density_gradient1
from ._dielectric_function1 import _dielectric_function1
from ._polarisation_potential1 import _polarisation_potential1
class _sccs1(InputSection):
def __init__(self):
InputSectio... | SINGROUP/pycp2k | pycp2k/classes/_sccs1.py | Python | lgpl-3.0 | 1,144 |
# -*- coding: utf-8 -*-
# Copyright (C) 2016 Matthias Luescher
#
# Authors:
# Matthias Luescher
#
# This file is part of edi.
#
# edi 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 3 of... | lueschem/edi | edi/commands/imagecommands/__init__.py | Python | lgpl-3.0 | 806 |
# anxt/CameraSensor.py
# pyNXT - Python wrappers for aNXT
# Copyright (C) 2011 Janosch Grรคf <janosch.graef@gmx.net>
#
# This program 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 ... | jgraef/pyNXT | anxt/CameraSensor.py | Python | lgpl-3.0 | 5,070 |
#
# This file is protected by Copyright. Please refer to the COPYRIGHT file
# distributed with this source distribution.
#
# This file is part of REDHAWK rtl-demo-app.
#
# REDHAWK rtl-demo-app is free software: you can redistribute it and/or modify it under
# the terms of the GNU Lesser General Public License as publis... | RedhawkSDR/rtl-demo-app | server/devices/__init__.py | Python | lgpl-3.0 | 958 |
"""
unit tests for 'schema' module
"""
import unittest
from rez.vendor.schema.test_schema import TestSchema
if __name__ == '__main__':
unittest.main()
# Copyright 2013-2016 Allan Johns.
#
# This library is free software: you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public... | fnaum/rez | src/rez/tests/test_schema.py | Python | lgpl-3.0 | 851 |
__author__ = 'Stuart Gordon Reid'
__email__ = 'stuartgordonreid@gmail.com'
__website__ = 'http://www.stuartreid.co.za'
"""
This file contains a collection of Grid Elements which can be used by the primary window object. These files include,
GridElement :- Abstract Base Class & Canvas
TextGridElement :- Grid Element c... | StuartGordonReid/Comp-Finance | Interface/GridElements.py | Python | lgpl-3.0 | 1,437 |
from hpp.corbaserver.rbprm.rbprmbuilder import Builder
from hpp.corbaserver.rbprm.rbprmfullbody import FullBody
from hpp.gepetto import Viewer
import stair_bauzil_hrp2_path as tp
import time
packageName = "hrp2_14_description"
meshPackageName = "hrp2_14_description"
rootJointType = "freeflyer"
##
# Information to ... | mylene-campana/hpp-rbprm-corba | script/scenarios/demos/stair_bauzil_hrp2_interp.py | Python | lgpl-3.0 | 7,729 |
# -*- coding: utf-8 -*-
import json
class ItemMetaInformation(object):
def __init__(self, instance, d):
self.instance = instance
self.d = d
def __getitem__(self, key):
return self.d[key]
def __setitem__(self, key, value):
self.d[key] = value
self.instance.metafld... | ydm/django-cart2 | cart/meta.py | Python | lgpl-3.0 | 924 |
"""
Creates sheet music for the song "O My Beloved Father".
Notes
-----
#. Written by David C. Stauffer in April 2017.
"""
#%% Imports
import abjad as ab
#%% Script
if __name__ == '__main__':
pass
#%% Score
score = ab.Score([])
staff = ab.Staff([])
time_signature = ab.TimeSignature((6, 8))
... | DStauffman/dstauffman2 | dstauffman2/music/O_My_Beloved_Father.py | Python | lgpl-3.0 | 3,060 |
from ..base import ShopifyResource
from shopify import mixins
from collect import Collect
import product
class CustomCollection(ShopifyResource, mixins.Metafields, mixins.Events):
def products(self):
return product.Product.find(collection_id=self.id)
def add_product(self, product):
return Co... | roninio/gae-shopify-python-boilerplate | shopify/resources/custom_collection.py | Python | lgpl-3.0 | 560 |
import json
import logging
import pymongo
import re
import time
from tweepy import OAuthHandler, Stream
from tweepy.streaming import StreamListener
import urllib2
class TwitterStreamListener(StreamListener):
def __init__(self, follow_id):
self.init_twitter(follow_id)
self.targets = [".*@mtb.com", "... | dwindsor/arachnid-old | arachnid/twitter/streamlistener.py | Python | lgpl-3.0 | 3,635 |
import Queue
from src.utils import logger
class OperationQueue():
"""Simple queue specifically for server operations."""
def __init__(self):
self.queue = Queue.Queue()
self.op_in_progress = False
self.paused = False
def queue_dump(self):
return [op for op in self.queue... | vFense/vFenseAgent-nix | agent/src/serveroperation/operationqueue.py | Python | lgpl-3.0 | 4,766 |
from config import settings
print settings
print settings['core']['location'] | jonshern/raspberrypi-indoorhealthmonitor | testing/configtest.py | Python | unlicense | 80 |
#The whole point of this file is that python27 uses "ConfigParser", and python34 uses "configparser"..... or something like that.
#This allows the script to run on all Python versions...I think...probably? At least 27 and 34.
#The only difference between the try-except is the import statement.
def login():
try:... | xvang/reddit-bots | Karma_info_bot/login.py | Python | unlicense | 1,033 |
import logging
from app.models import Rc, Button, Node, Arduino, Radio
from app import db
from datetime import datetime
class RcHelper:
def __init__(self, rc_id = None):
self.set(rc_id)
def get(self):
return self.rc
def set(self, rc_id):
self.rc = Rc.query.filter_by(id = rc_id).f... | notfoundsam/raspberry | app/helpers.py | Python | unlicense | 17,532 |
# -*- coding: utf-8 -*-
"""
Default configuration which is always loaded
"""
import logging
DEBUG = False
LOGGING_SEVERITY = logging.WARNING
| tbalive/website | config/default.py | Python | unlicense | 143 |
๏ปฟimport pyglet, util
pyglet.resource.path = ['../resources']
pyglet.resource.reindex()
player_image = pyglet.resource.image("player.png")
bullet_image = pyglet.resource.image("bullet.png")
asteroid_image = pyglet.resource.image("asteroid.png")
engine_image = pyglet.resource.image("engine_trail.png")
engine_image.anch... | CyanCorsair/asteroids | version_2/game/resources.py | Python | unlicense | 499 |
from django import forms
from blog.models import Entry, Comment, UserProfile
from django.contrib.auth.models import User
from django.contrib.auth import authenticate
class LoginForm(forms.Form):
username = forms.CharField(max_length=25,
required=True,
... | paulmouzas/blogodrone | blog/forms.py | Python | unlicense | 3,005 |
# Copyright 2021 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,... | googleapis/python-db-dtypes-pandas | setup.py | Python | apache-2.0 | 2,466 |
# -*- coding: utf-8 -*-
"""Base class for SQLite plugin path helper."""
import abc
class BaseSQLitePluginPathHelper(object):
"""Class representing the base class for the SQLite plugin path helper.
Attributes:
formatter_file_path (str): the path to the formatter file
parser_file_path (str): the path to t... | ClaudiaSaxer/PlasoScaffolder | src/plasoscaffolder/bll/services/base_sqlite_plugin_path_helper.py | Python | apache-2.0 | 1,053 |
# Copyright (c) 2015 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.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in ... | enableiot/iotanalytics-rule-engine | job.py | Python | apache-2.0 | 1,400 |
# -*- coding: utf-8 -*-
"""
requests_toolbelt.multipart
===========================
This holds all of the implementation details of the MultipartEncoder
"""
from requests.utils import super_len
from requests.packages.urllib3.filepost import iter_field_objects
from uuid import uuid4
import io
def encode_with(stri... | czgu/metaHack | env/lib/python2.7/site-packages/requests_toolbelt/multipart.py | Python | apache-2.0 | 8,075 |
#!/usr/bin/env python2.7
"""opencachemongodb.py - Manages the state of the node contents using a MongoDB database."""
import time
import pymongo
TAG = 'state'
class State:
def __init__(self, node):
"""Initialise state instance with useful objects.
Instantiated controller and configuration obj... | opencache-project/opencache-node | opencache/node/state/opencachemongodb.py | Python | apache-2.0 | 1,488 |
"""
Utility functions for dealing with files
"""
import logging
import hashlib
__author__ = 'Stephen Brown (Little Fish Solutions LTD)'
log = logging.getLogger(__name__)
def extension_from_filename(filename):
return filename.rsplit('.')[-1]
def read_file(filename):
with open(filename, 'rb') as f:
... | stevelittlefish/littlefish | littlefish/fileutil.py | Python | apache-2.0 | 908 |
#!/usr/bin/python
# Copyright (c) Facebook, Inc. and its affiliates.
"""These are the org-specific AutoDMG package building tools."""
import os
import sys
import tempfile
import shutil
from autodmg_utility import build_pkg, run, populate_ds_repo, pkgbuild
sys.path.append('/Library/CPE/lib/flib/modules')
try:
import... | facebook/IT-CPE | legacy/autodmg_cache_builder/autodmg_org.py | Python | apache-2.0 | 5,866 |
from child_kinect import *
from transformer import *
from nao_move import * | CuriosityLabTAU/physicial_curiosity | curious_game/__init__.py | Python | apache-2.0 | 75 |
import os
import time
import json
import codecs
import elasticsearch
import progressbar
from backports import csv
from functools import wraps
FLUSH_BUFFER = 1000 # Chunk of docs to flush in temp file
CONNECTION_TIMEOUT = 120
TIMES_TO_TRY = 3
RETRY_DELAY = 60
META_FIELDS = [u'_id', u'_index', u'_score', u'_type']
#... | taraslayshchuk/es2csv | es2csv.py | Python | apache-2.0 | 9,872 |
from django.utils.translation import ugettext_lazy as _
from horizon import tables
from openstack_dashboard.dashboards.project.access_and_security.keypairs.tables import KeypairsTable as OldKeypairsTable
from tukey.cloud_attribute import get_cloud, get_cloud_id
class KeypairsTable(OldKeypairsTable):
# Thie shou... | LabAdvComp/tukey_portal | tukey/dashboards/project/access_and_security/keypairs/tables.py | Python | apache-2.0 | 617 |
# This module was automatically generated.
import viper.lexer as vl
from .ast import AST
from typing import List, Optional
class SingleInput(AST):
pass
class Term(AST):
pass
class FileLine(AST):
pass
class PlainStmt(AST):
pass
class Parameter(AST):
def __init__(self, external: Optional[v... | pdarragh/Viper | viper/parser/ast/nodes.py | Python | apache-2.0 | 8,645 |
# Copyright 2020 The HuggingFace Team. 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 applicabl... | huggingface/transformers | tests/reformer/test_tokenization_reformer.py | Python | apache-2.0 | 11,990 |
# 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
# distribu... | jarrodmcc/OpenFermion | src/openfermion/transforms/_binary_code_transform_test.py | Python | apache-2.0 | 2,123 |
#!/usr/bin/python
#
# Copyright 2002-2019 Barcelona Supercomputing Center (www.bsc.es)
#
# 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
... | mF2C/COMPSs | compss/programming_model/bindings/python/src/pycompss/api/task.py | Python | apache-2.0 | 71,968 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Script to extract MSIE zone information."""
import argparse
import logging
import sys
from dfvfs.helpers import volume_scanner as dfvfs_volume_scanner
from winregrc import msie_zone_info
from winregrc import output_writers
from winregrc import volume_scanner
class S... | libyal/winreg-kb | scripts/msie_zone_info.py | Python | apache-2.0 | 9,437 |
"""
Module holds all stuff regarding Grinder tool usage
Copyright 2015 BlazeMeter 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 require... | Nefry/taurus | bzt/modules/grinder.py | Python | apache-2.0 | 20,175 |
#! /usr/bin/env python
# A script for cernet login at XJTU
import urllib
import urllib.parse
import urllib.request
import sys
username = 'your_username'
password = 'your_password'
url = 'http://10.6.8.2/cgi-bin/srun_portal'
login_data = {
'action': 'login',
'username': username,
'password': password,
... | JingkaiTang/XJTU_CERNET | cernet.py | Python | apache-2.0 | 684 |
# 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 unde... | openstack/senlin | senlin/common/utils.py | Python | apache-2.0 | 7,679 |
#!/usr/bin/env python
"""A more advanced Reducer, using Python iterators and generators."""
import sys
print_format = "{0}{1}{2}"
def main(separator='\t'):
cantidad_total = 0
suma_total = 0
for line in sys.stdin:
suma, cantidad = line.rstrip().split(separator, 1)
cantidad_total += int(can... | santiavenda2/hadoop-with-python | src/variance/mean_reducer.py | Python | apache-2.0 | 471 |
# See the NOTICE file distributed with this work for additional information
# regarding copyright ownership.
# 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/li... | Ensembl/ensembl-production | src/python/ensembl/production/datafile/scraper/parsers/embl.py | Python | apache-2.0 | 2,568 |
# -*- 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... | sasha-gitg/python-aiplatform | google/cloud/aiplatform/v1/schema/predict/prediction/__init__.py | Python | apache-2.0 | 2,407 |
# Copyright 2012 NEC 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.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | spandanb/horizon | openstack_dashboard/dashboards/admin/networks/ports/forms.py | Python | apache-2.0 | 4,657 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from datetime import datetime
import copy
import logging
import os
import pickle
import six
import time
import tempfile
import ray
from ray.exceptions import RayError
from ray.rllib.models import MODEL_DEFAULT... | ujvl/ray-ng | rllib/agents/trainer.py | Python | apache-2.0 | 35,232 |
#!/usr/bin/env python
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "L... | mlperf/training_results_v0.7 | Fujitsu/benchmarks/resnet/implementations/implementation_open/mxnet/python/mxnet/io/__init__.py | Python | apache-2.0 | 1,335 |
from datetime import datetime, timedelta
from django.db import connection
from core.libs.exlib import dictfetchall
from core.iDDS.useconstants import SubstitleValue
from core.settings.config import DB_SCHEMA_IDDS
from core.settings.local import defaultDatetimeFormat
subtitleValue = SubstitleValue()
def getTransforms(... | PanDAWMS/panda-bigmon-core | core/iDDS/rawsqlquery.py | Python | apache-2.0 | 4,650 |
# 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
# d... | HybridF5/jacket | jacket/tests/storage/unit/targets/test_scst_driver.py | Python | apache-2.0 | 10,762 |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright (c) 2011 Zadara Storage Inc.
# Copyright (c) 2011 OpenStack 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
#
# ... | tomasdubec/openstack-cinder | cinder/api/contrib/types_manage.py | Python | apache-2.0 | 3,054 |
from optparse import OptionParser
import os
import re
import sys
import codecs
from .sentiment_tree import SentimentTree
from .binary_tree import BinaryTree
def main():
usage = "%prog data_dir"
parser = OptionParser(usage=usage)
#parser.add_option('--keyword', dest='key', default=None,
# ... | dallascard/guac | core/dataset_scripts/sst/read_data.py | Python | apache-2.0 | 7,998 |
# -*- coding: utf-8 -*-
from __future__ import absolute_import, division, print_function, unicode_literals
from enum import Enum
from genericpath import exists
from logging import DEBUG, getLogger
from os.path import join
import sys
from textwrap import dedent
from .index import get_reduced_index
from .link import Pr... | Microsoft/PTVS | Python/Product/Miniconda/Miniconda3-x64/Lib/site-packages/conda/core/solve.py | Python | apache-2.0 | 44,797 |
from django.conf import settings
USERNAME_COOKIE_NAME = getattr(settings, 'USERNAME_COOKIE_NAME', 'username')
MAX_COOKIE_SIZE = getattr(settings, 'MAX_COOKIE_SIZE', 4096)
| callowayproject/django-cookiesession | cookiesession/settings.py | Python | apache-2.0 | 173 |
from flask import Flask, render_template
import subprocess
app = Flask(__name__)
@app.route('/', methods=['GET'])
def index(name=None):
return render_template('hello.html', name=name)
@app.route('/b', methods=['GET'])
def b_start():
subprocess.call(['python3', 'alarmclock.py'])
return 'Hello'
if __name_... | Xibuk/iot-alarm | button.py | Python | apache-2.0 | 378 |
# FiveDollarTenCents / memehk.py
# by Kobura.Nephilim
# version 2.0
# Tested on raspberry pi
#
# This python program will get the page from memehk,
# extract the youtube id of the live stream and
# pass the youtube id to livestreamer to record into mp4
import urllib2
import re
memehk_url='http://www.memehk.com/index.ph... | kobura-nephilim/FiveDollarTenCents | memehk.py | Python | apache-2.0 | 497 |
# 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 | pse/dm_control/utils/helper_utils.py | Python | apache-2.0 | 5,035 |
# Copyright (c) 2016 NTT All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | ramineni/my_congress | congress/datasources/doctor_driver.py | Python | apache-2.0 | 3,563 |
# -*- coding: utf8 -*-
# ๊ทธ๋ํ, ์ํ ๊ธฐ๋ฅ์ ๋ด๊ณ ์๋ pylab ๋ชจ๋์ ๋ชจ๋ ๊ธฐ๋ฅ์ ๋ถ๋ฌ๋ค์
from pylab import *
# data ์ค๋น ์์
# normal distribution center at x=0 and y=5
# x = 0, y = 5 ์ ์ ์ค์ฌ์ผ๋ก ํ ์ ๊ท ๋ถํฌ ์์ฑ
x = randn(100000)
y = randn(100000) + 5
# 2์ฐจ์ ํ์คํ ๊ทธ๋จ
# 40๊ฐ์ ๊ตฌ๊ฐ์ ์์ฑ
H, xedges, yedges = histogram2d(x, y, bins=40)
# histogram ์ ํ์ํ ๋ฒ์๋ฅผ ์ง์
# y... | kangwonlee/ECA | lab_01_intro/07_hist2d_log_demo.py | Python | apache-2.0 | 857 |
# 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, so... | googleinterns/power-data-graphing-intern-2020 | backend/data_fetcher_test.py | Python | apache-2.0 | 2,341 |
from HARK.ConsumptionSaving.ConsPrefShockModel import (
PrefShockConsumerType,
KinkyPrefConsumerType,
)
import numpy as np
import unittest
class testPrefShockConsumerType(unittest.TestCase):
def setUp(self):
self.agent = PrefShockConsumerType()
self.agent.cycles = 0
self.agent.sol... | econ-ark/HARK | HARK/ConsumptionSaving/tests/test_ConsPrefShockModel.py | Python | apache-2.0 | 2,426 |
# Copyright 2013 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable l... | zhangg/trove | trove/tests/unittests/conductor/test_methods.py | Python | apache-2.0 | 8,262 |
from django.contrib import admin
from models import Media
admin.site.register(Media) | jamesmfriedman/django-primer | primer/media/admin.py | Python | apache-2.0 | 85 |
from datetime import date
from django.contrib.humanize.templatetags.humanize import ordinal
from django.core import urlresolvers
from django.shortcuts import get_object_or_404
from django.views.generic import list_detail, date_based, simple
from project_utils import annotate, get_page
from site_preferences.utils imp... | mazelife/django-belleville | belleville/blogging/blog_views.py | Python | apache-2.0 | 3,737 |
#!/usr/bin/python
import Pydap as pd
def get_object(url):
return open_url(url)
def get_variables(url):
return data.keys():
def get_grids(url):
data = open_url(url)
# dataset = open_url() -> structure
# vars = data.keys()
# var.dimensions -> structure
# var.{shape,type}
# var.attributes -> dict
# var... | KimberleyOpie/common-tools | shape-dap/bbox_dap.py | Python | apache-2.0 | 706 |
# Copyright 2022 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 ... | googleapis/python-retail | samples/interactive-tutorials/events/setup_events/setup_cleanup.py | Python | apache-2.0 | 7,256 |
#!/usr/bin/env python
###############################################################################
#
# Copyright 2010 Locomatix, 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
#
# ... | locomatix/locomatix-python | locomatix/cli/search_nearby.py | Python | apache-2.0 | 2,578 |
"""
Contains the definition of the Inception Resnet V2 architecture.
As described in http://arxiv.org/abs/1602.07261.
Inception-v4, Inception-ResNet and the Impact of Residual Connections
on Learning
Christian Szegedy, Sergey Ioffe, Vincent Vanhoucke, Alex Alemi
"""
import mxnet as mx
import proposal
import p... | likelyzhao/mxnet | example/rcnn/rcnn/symbol/symbol_inceptionresnet.py | Python | apache-2.0 | 18,850 |
def init_actions_(service, args):
"""
this needs to returns an array of actions representing the depencies between actions.
Looks at ACTION_DEPS in this module for an example of what is expected
"""
# some default logic for simple actions
return {
'test': ['install']
}
de... | Jumpscale/ays_jumpscale8 | tests/test_services/test_validate_run_steps/actions.py | Python | apache-2.0 | 3,971 |
# Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserved
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applic... | PaddlePaddle/Paddle | python/paddle/optimizer/lr.py | Python | apache-2.0 | 65,986 |
# coding=utf-8
# Copyright 2019 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import absolute_import, division, print_function, unicode_literals
import functools
import re
from pants.backend.python.python_requirement import PythonReq... | twitter/pants | tests/python/pants_test/backend/python/tasks/test_unpack_wheels.py | Python | apache-2.0 | 4,024 |
# Copyright 2020 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | keras-team/keras | keras/applications/efficientnet_weight_update_util.py | Python | apache-2.0 | 13,341 |
# data.world-py
# Copyright 2017 data.world, 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 agr... | datadotworld/data.world-py | datadotworld/cli.py | Python | apache-2.0 | 1,688 |
#!/usr/bin/env python
#
# 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 requir... | Aloomaio/googleads-python-lib | examples/ad_manager/v201808/custom_field_service/deactivate_all_line_item_custom_fields.py | Python | apache-2.0 | 2,682 |
""" Cloud API asynchronous "PDF To Text" job example.
Allows to avoid timeout errors when processing huge or scanned PDF documents.
"""
import os
import requests # pip install requests
import time
import datetime
# The authentication key (API Key).
# Get your own by registering at https://app.pdf.co
API_KEY = "***... | bytescout/ByteScout-SDK-SourceCode | PDF.co Web API/Image To PDF API/Python/Convert Images To PDF From URLs Asynchronously/ConvertImagesToPdfFromUrlsAsynchronously.py | Python | apache-2.0 | 3,883 |
#!/usr/bin/env python
import pyeapi, sys, argparse, pprint
#pynet.py is in ~/pylib https://github.com/jrogers512/pynet/blob/master/pynet.py
import pynet
def valid_id(i):
##Check that the VLAN is valid and not already in use
vlan_id = int(i)
if vlan_id > 999 or vlan_id < 100:
raise argparse.Argumen... | jrogers512/pynet | class7/ex2.py | Python | apache-2.0 | 2,922 |
from django import http
from django.utils.deprecation import MiddlewareMixin
from wagtail.core.models import Site
try:
from django.conf import settings
XS_SHARING_ALLOWED_ORIGINS = settings.XS_SHARING_ALLOWED_ORIGINS
XS_SHARING_ALLOWED_METHODS = settings.XS_SHARING_ALLOWED_METHODS
XS_SHARING_ALLOWED_HE... | parksandwildlife/oim-cms | oim_cms/middleware.py | Python | apache-2.0 | 2,264 |