code stringlengths 6 947k | repo_name stringlengths 5 100 | path stringlengths 4 226 | language stringclasses 1
value | license stringclasses 15
values | size int64 6 947k |
|---|---|---|---|---|---|
import datetime
import faker
class FakerFactoryBoyWrapper(object):
"""Small wrapper around faker for factory boy.
Usage:
>>> from factory import LazyAttribute
>>> from pylab.core.helpers.factories import fake
>>> LazyAttribute(fake.company()) # doctest: +ELLIPSIS
<factory.d... | python-dirbtuves/website | pylab/core/helpers/factories.py | Python | agpl-3.0 | 2,104 |
# encoding=utf-8
"""
Student Views
"""
import sys
reload(sys)
sys.setdefaultencoding('utf-8')
import datetime
import json
import logging
import re
import urllib
import uuid
import time
import base64
import socket
import urllib2
import hashlib
from suds.client import Client
import xmltodict
from django.utils import ti... | liuqr/edx-xiaodun | common/djangoapps/student/views.py | Python | agpl-3.0 | 101,263 |
#!/usr/bin/env python
#
# Copyright (C) 2009 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 ... | pistruiatul/hartapoliticii | python/src/ro/vivi/youtube_crawler/gdata/spreadsheets/data.py | Python | agpl-3.0 | 9,070 |
# This file is part of Archivematica.
#
# Copyright 2010-2013 Artefactual Systems Inc. <http://artefactual.com>
#
# Archivematica 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 ... | michal-ruzicka/archivematica | src/dashboard/src/components/mcp/views.py | Python | agpl-3.0 | 1,507 |
# -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2015 ADHOC SA (http://www.adhoc.com.ar)
# All Rights Reserved.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Pu... | adrianpaesani/odoo-argentina | l10n_ar_aeroo_stock/__openerp__.py | Python | agpl-3.0 | 1,827 |
"""
Standalone test runner for OPAT plugin
"""
import os
import sys
from django.conf import settings
settings.configure(DEBUG=True,
DATABASES={
'default': {
'ENGINE': 'django.db.backends.sqlite3',
}
},
... | openhealthcare/opal-opat | runtests.py | Python | agpl-3.0 | 1,960 |
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... | gisce/OCB | openerp/addons/base/res/res_partner.py | Python | agpl-3.0 | 41,659 |
from random import randint
board = []
for x in range(5):
board.append(["O"] * 5)
def print_board(board):
for row in board:
print " ".join(row)
print "Let's play Battleship!"
print_board(board)
def random_row(board):
return randint(0, len(board) - 1)
def random_col(board):
return randint(0,... | oliverwreath/Wide-Range-of-Webs | Python/Battleship/15. Guess 4 turns.py | Python | agpl-3.0 | 1,187 |
# -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
#
# Copyright (c) 2013 Noviat nv/sa (www.noviat.com). All rights reserved.
#
# This program is free software: you can redistribute it and/or modify
# it under... | eneldoserrata/marcos_openerp | addons/report_xls/report_xls.py | Python | agpl-3.0 | 9,067 |
import datetime
import itertools
import re
from urllib import urlencode
from django.conf import settings
from django.contrib.syndication.views import Feed
from django.core import urlresolvers
from django.core.exceptions import PermissionDenied
from django.core.paginator import Paginator, InvalidPage, EmptyPage
from dj... | michaelsmit/openparliament | parliament/politicians/views.py | Python | agpl-3.0 | 10,394 |
# -*- coding: utf-8 -*-
import ast
import base64
import csv
import glob
import itertools
import logging
import operator
import datetime
import hashlib
import os
import re
import simplejson
import time
import urllib
import urllib2
import urlparse
import xmlrpclib
import zlib
from xml.etree import ElementTree
from cStri... | gdgellatly/OCB1 | addons/web/controllers/main.py | Python | agpl-3.0 | 69,619 |
#!/usr/bin/env python3
# -*- coding : utf-8 -*-
# Multi-Lang
print("我爱你")
# Get the encoded int for some data
ord('A')
ord('我')
# decode from int to data
chr(66)
chr(25991)
# Use Hex to show some data
'\u4e2d\u6587'
# Encode or decode from string to bytes via ascii or utf-8
# a string is using a few bytes , but a byt... | kmahyyg/learn_py3 | usage/string_encoding.py | Python | agpl-3.0 | 710 |
#! /usr/bin/env python3
# -*- coding: utf-8 -*-
import logging
from askomics.libaskomics.ParamManager import ParamManager
from askomics.libaskomics.rdfdb.SparqlQueryBuilder import SparqlQueryBuilder
from askomics.libaskomics.rdfdb.QueryLauncher import QueryLauncher
class TripleStoreExplorer(ParamManager):
"""
... | cbettemb/askomics | askomics/libaskomics/TripleStoreExplorer.py | Python | agpl-3.0 | 7,283 |
# -*- coding: utf-8 -*-
# Generated by Django 1.9.7 on 2016-09-05 16:53
from __future__ import unicode_literals
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('organization_network', '000... | Ircam-Web/mezzanine-organization | organization/network/migrations/0005_auto_20160905_1853.py | Python | agpl-3.0 | 2,404 |
from django.test import TestCase
from order.factories import OrderFactory, OrderItemFactory
from billing.models import Billing, calculate_amount_total, BillingManager
import datetime
from member.factories import ClientFactory, RouteFactory
from order.models import Order
from django.core.urlresolvers import reverse
from... | madmath/sous-chef | src/billing/tests.py | Python | agpl-3.0 | 4,079 |
"""Add autograph, interview, and travel plan checklist items
Revision ID: a1a5bd54b2aa
Revises: f619fbd56912
Create Date: 2017-09-21 07:17:46.817443
"""
# revision identifiers, used by Alembic.
revision = 'a1a5bd54b2aa'
down_revision = 'f619fbd56912'
branch_labels = None
depends_on = None
from alembic import op
im... | magfest/ubersystem | alembic/versions/a1a5bd54b2aa_add_autograph_interview_and_travel_plan_.py | Python | agpl-3.0 | 3,669 |
'''
Copyright (C) 2017-2019 Vanessa Sochat.
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
option) any later version.
This program is distribute... | vsoch/singularity-python | singularity/package/clone.py | Python | agpl-3.0 | 2,880 |
#!/usr/bin/env python
#
# Copyright (c) 2017 Stratosphere Laboratory.
#
# This file is part of ManaTI Project
# (see <https://stratosphereips.org>). It was created by 'Raul B. Netto <raulbeni@gmail.com>'
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero Gene... | stratosphereips/Manati | manati/share_modules/whois_distance.py | Python | agpl-3.0 | 12,100 |
# -*- coding: utf-8 -*-
delivery={'weight': '10.0', 'pec_bar': u'9V169001>59647441000000023', 'suivi_bar': u'9V0>50000000024', 'cab_prise_en_charge': u'9V1 69001 964744 1000 000023', 'date': '12/05/2014', 'cab_suivi': u'9V 00000 00002 4', 'ref_client': u'OUT/00007', 'Instructions': ''}
sender={'city': u'city', 'accou... | akretion/laposte_api | laposte_api/data/colissimo_9V_nhas22.py | Python | agpl-3.0 | 2,753 |
# -*- encoding: utf-8 -*-
###############################################################################
# #
# Copyright (C) 2015 Trustcode - www.trustcode.com.br #
# Danimar Ribeiro <danimaribeiro@gmail.co... | Trust-Code/trust-addons | trust_task_time_control/models/__init__.py | Python | agpl-3.0 | 1,625 |
#!/usr/bin/env python
# Copyright (C) 2006-2021 Music Technology Group - Universitat Pompeu Fabra
#
# This file is part of Essentia
#
# Essentia 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 (FSF), e... | MTG/essentia | test/src/unittests/tonal/test_tristimulus.py | Python | agpl-3.0 | 2,180 |
from django.shortcuts import render
from django.http import HttpResponseRedirect
from django.contrib.auth.decorators import login_required
from django.views.decorators.http import require_http_methods, require_GET
from webparticipation.apps.ureporter.models import Ureporter
from webparticipation.apps.latest_poll.decor... | rapidpro/ureport-web-participation | webparticipation/apps/profile_page/views.py | Python | agpl-3.0 | 2,099 |
"""Add the DB table SMTPServer in version 2.10
Revision ID: 2ac117d0a6f5
Revises: 20969b4cbf06
Create Date: 2015-12-27 10:17:23.861696
"""
# revision identifiers, used by Alembic.
revision = '2ac117d0a6f5'
down_revision = '20969b4cbf06'
from alembic import op
import sqlalchemy as sa
from sqlalchemy.exc import (Oper... | privacyidea/privacyidea | migrations/versions/2ac117d0a6f5_.py | Python | agpl-3.0 | 1,451 |
"""Metadata read/write support for bup."""
# Copyright (C) 2010 Rob Browning
#
# This code is covered under the terms of the GNU Library General
# Public License as described in the bup LICENSE file.
from __future__ import absolute_import
from copy import deepcopy
from errno import EACCES, EINVAL, ENOTTY, ENOSYS, EOP... | ToxicFrog/bup | lib/bup/metadata.py | Python | lgpl-2.1 | 43,696 |
#===============================================================================
# wxpyobus - obus client gui in python.
#
# @file busdata.py
#
# @brief wxpython obus client bus data
#
# @author yves-marie.morgan@parrot.com
#
# Copyright (c) 2013 Parrot S.A.
# All rights reserved.
#
# Redistribution and use in source a... | jbdubois/obus | python/hmi/busdata.py | Python | lgpl-2.1 | 5,267 |
#!/usr/bin/python
"""Test of structural navigation by heading."""
from macaroon.playback import *
import utils
sequence = MacroSequence()
sequence.append(KeyComboAction("<Control>Home"))
sequence.append(utils.StartRecordingAction())
sequence.append(KeyComboAction("2"))
sequence.append(utils.AssertPresentationActio... | pvagner/orca | test/keystrokes/firefox/html_struct_nav_heading_in_div_with_text.py | Python | lgpl-2.1 | 3,556 |
from pydevin import *
import math
# ball parameters definitions
BALL_POS_Y_MAX = 115
BALL_POS_Y_MIN = 5
BALL_POS_Y_CENTER = (BALL_POS_Y_MAX + BALL_POS_Y_MIN) / 2.0
BALL_POS_X_MAX = 125
BALL_POS_X_MIN = 20
BALL_POS_X_CENTER = (BALL_POS_X_MAX + BALL_POS_X_MIN) / 2.0
A_X = -1.0/(BALL_POS_X_MAX - BALL_POS_X_CENTER)
B_... | QJonny/spin_emulator | pydevin/devinManager.py | Python | lgpl-2.1 | 2,573 |
from lcapy import R, L
n = (R('R1') | L('L1')) + (R('R2') | L('L2'))
n.draw(__file__.replace('.py', '.png'))
| mph-/lcapy | doc/examples/networks/seriesparallelRL1.py | Python | lgpl-2.1 | 110 |
#! /usr/bin/python
# -*- coding: utf-8 -*-
#-----------------------------------------------------------------------------
# Name: setup.py
# Purpose:
# Author: Fabien Marteau <fabien.marteau@armadeus.com>
# Created: 16/02/2009
#-----------------------------------------------------------------------------
# Co... | magyarm/periphondemand-code | setup.py | Python | lgpl-2.1 | 3,545 |
import logging
import re
import numpy
logger = logging.getLogger(__name__)
from hyo2.soundspeed.formats.readers.abstract import AbstractTextReader
from hyo2.soundspeed.profile.dicts import Dicts
from hyo2.soundspeed.base.callbacks.cli_callbacks import CliCallbacks
from hyo2.soundspeed.temp import coordinates
from h... | hydroffice/hyo_soundspeed | hyo2/soundspeed/formats/readers/simrad.py | Python | lgpl-2.1 | 8,879 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2010 Radim Rehurek <radimrehurek@seznam.cz>
# Licensed under the GNU LGPL v2.1 - http://www.gnu.org/licenses/lgpl.html
"""
Automated tests for checking transformation algorithms (the models package).
"""
from __future__ import division
import logging
imp... | gojomo/gensim | gensim/test/test_word2vec.py | Python | lgpl-2.1 | 55,488 |
from datetime import datetime as dt
import os
from enum import IntEnum
import logging
from typing import Optional
from netCDF4 import Dataset, num2date
from hyo2.soundspeed.base.geodesy import Geodesy
from hyo2.soundspeed.profile.dicts import Dicts
from hyo2.soundspeed.profile.profile import Profile
from hyo2.soundspe... | hydroffice/hyo_soundspeed | hyo2/soundspeed/atlas/regofsoffline.py | Python | lgpl-2.1 | 8,583 |
# encoding: utf-8
class Table(object):
def config_db(self, pkg):
tbl = pkg.table('client', name_short='Client', name_long='Client',name_plural='Clients',
pkey='id',rowcaption='company')
tbl.column('id',size='22',group='_',readOnly='y',name_long='Id')
self.sysFiel... | poppogbr/genropy | legacy_packages/develop/model/client.py | Python | lgpl-2.1 | 683 |
# -*- coding: utf-8 -*-
from pysignfe.corr_unicode import *
from pysignfe.xml_sped import *
from pysignfe.cte.v300 import ESQUEMA_ATUAL
import os
DIRNAME = os.path.dirname(__file__)
class EmiOcc(XMLNFe):
def __init__(self):
super(EmiOcc, self).__init__()
self.CNPJ = TagCaracter(nome='CNPJ', tam... | thiagopena/PySIGNFe | pysignfe/cte/v300/modais_300.py | Python | lgpl-2.1 | 25,635 |
'''
Created on 10 mars 2015
@author: Remi Cattiau
'''
from nxdrive.logging_config import get_logger
from nxdrive.wui.dialog import WebDialog, WebDriveApi
from nxdrive.wui.translator import Translator
from PyQt4 import QtCore
log = get_logger(__name__)
class WebConflictsApi(WebDriveApi):
def __init__(self, appli... | rsoumyassdi/nuxeo-drive | nuxeo-drive-client/nxdrive/wui/conflicts.py | Python | lgpl-2.1 | 3,320 |
# -*- coding: utf-8 -*-
#
# Copyright (C) 2021 Red Hat, Inc.
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This ... | fedora-infra/the-new-hotness | hotness/use_cases/retrieve_data_use_case.py | Python | lgpl-2.1 | 1,991 |
##############################################################################
# Copyright (c) 2013-2017, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
# This file is part of Spack.
# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
# LLNL-CODE-64... | skosukhin/spack | var/spack/repos/builtin/packages/xedit/package.py | Python | lgpl-2.1 | 1,732 |
#!/usr/bin/env python
## \file parallel_regression.py
# \brief Python script for automated regression testing of SU2 examples
# \author A. Aranake, A. Campos, T. Economon, T. Lukaczyk, S. Padron
# \version 6.2.0 "Falcon"
#
# The current SU2 release has been coordinated by the
# SU2 International Developers Society ... | srange/SU2 | TestCases/parallel_regression.py | Python | lgpl-2.1 | 66,999 |
# fsmkfs.py
# Filesystem formatting classes.
#
# Copyright (C) 2015 Red Hat, Inc.
#
# This copyrighted material is made available to anyone wishing to use,
# modify, copy, or redistribute it subject to the terms and conditions of
# the GNU General Public License v.2, or (at your option) any later version.
# This progr... | jkonecny12/blivet | blivet/tasks/fsmkfs.py | Python | lgpl-2.1 | 10,426 |
# -*- coding: UTF-8 -*-
#
"""ServerStore tester"""
class GnrCustomWebPage(object):
py_requires = "gnrcomponents/testhandler:TestHandlerFull,storetester:StoreTester"
dojo_theme = 'claro'
def test_1_current_page(self, pane):
"""On current page """
self.common_form(pane, datapath='test_1')
... | poppogbr/genropy | packages/test15/webpages/tools/server_store.py | Python | lgpl-2.1 | 1,125 |
#!/usr/bin/env python
""" Timeseries generator module """
from supremm.plugin import Plugin
from supremm.subsample import TimeseriesAccumulator
import numpy
from collections import Counter
class MemUsageTimeseries(Plugin):
""" Generate the CPU usage as a timeseries data """
name = property(lambda x: "memused... | ubccr/supremm | src/supremm/plugins/MemUsageTimeseries.py | Python | lgpl-3.0 | 3,532 |
from pycp2k.inputsection import InputSection
from ._aa_planar2 import _aa_planar2
from ._planar2 import _planar2
from ._aa_cylindrical2 import _aa_cylindrical2
from ._aa_cuboidal2 import _aa_cuboidal2
class _dirichlet_bc2(InputSection):
def __init__(self):
InputSection.__init__(self)
self.Verbose_... | SINGROUP/pycp2k | pycp2k/classes/_dirichlet_bc2.py | Python | lgpl-3.0 | 2,187 |
#-*-coding:utf-8-*-
"""
@package bcontext.tests
@brief tests for bcontext
@author Sebastian Thiel
@copyright [GNU Lesser General Public License](https://www.gnu.org/licenses/lgpl.html)
"""
from __future__ import unicode_literals
__all__ = []
| Byron/bcore | src/python/bcontext/tests/__init__.py | Python | lgpl-3.0 | 243 |
from django import forms
from apps.clientes.models import Cliente
from apps.clientes.choices import SEXO_CHOICES
import re
class ClienteForm(forms.ModelForm):
"""
Se declaran los campos y atributos que se mostraran en el formulario
"""
sexo = forms.ChoiceField(choices=SEXO_CHOICES, required=... | axelleonhart/TrainingDjango | materiales/apps/clientes/forms.py | Python | lgpl-3.0 | 2,527 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
from Http import Http
import logging
from sys import exit
from Utils import ErrorSQLRequest, checkOptionsGivenByTheUser
from Constants import *
class UtlHttp (Http):
'''
Allow the user to send HTTP request
'''
def __init__(self,args):
'''
Constructor
'''
logging.d... | quentinhardy/odat | UtlHttp.py | Python | lgpl-3.0 | 4,947 |
# -*- coding: utf-8 -*-
# Copyright(C) 2018 Quentin Defenouillere
#
# This file is part of weboob.
#
# weboob 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 y... | laurentb/weboob | weboob/applications/boobands/boobands.py | Python | lgpl-3.0 | 6,590 |
# -*- coding: utf-8 -*-
import json
import nicfit
from pathlib import Path
from .utils import prompt
from ..common import thumbprint, CLIQUE_D
from .. import Identity, keystore
DEFAULT_KEYFILE = None
@nicfit.command.register
class keygen(nicfit.Command):
HELP = "Generate Clique (i.e. EC 256) encryption keys."
... | nicfit/Clique | clique/app/keygen.py | Python | lgpl-3.0 | 2,677 |
#!/usr/bin/python3
from gi.repository import GLib
from gi.repository import OpenDCS
import sys
class DcsExample(object):
def __init__(self):
self.dcsobject = OpenDCS.Object()
self.dcsobject.set_property('id', 'test')
print("Object hash: ", self.dcsobject.get_property('hash'))
if __name__... | geoffjay/opendcs-core | examples/minimal.py | Python | lgpl-3.0 | 353 |
from coinpy.lib.serialization.common.field import Field
from coinpy.lib.serialization.common.structure import Structure
from coinpy.lib.blockchain.bsddb.objects.disktxpos import DiskTxPos
class DiskTxPosSerializer():
DISKTXPOS = Structure([Field("<I", "file"),
Field("<I", "blockpos"),
... | sirk390/coinpy | coinpy-lib/src/coinpy/lib/blockchain/bsddb/serialization/s11n_disktxpos.py | Python | lgpl-3.0 | 804 |
from pycp2k.inputsection import InputSection
class _screening3(InputSection):
def __init__(self):
InputSection.__init__(self)
self.Rc_taper = None
self.Rc_range = None
self._name = "SCREENING"
self._keywords = {'Rc_range': 'RC_RANGE', 'Rc_taper': 'RC_TAPER'}
| SINGROUP/pycp2k | pycp2k/classes/_screening3.py | Python | lgpl-3.0 | 306 |
# -*- coding: utf-8 -*-
# This file is part of pygal
#
# A python svg graph plotting library
# Copyright © 2012-2014 Kozea
#
# 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... | bintlabs/pygal-nostatics | pygal/graph/frenchmap.py | Python | lgpl-3.0 | 10,495 |
"""
One calculation and two real motors.
The calculation motor has the position of the motor tagged as first.
The real motor tagged as second differs from the first by a fraction.
orientation: label (horizontal | vertical) of the orientation of the motors.
fraction: the difference [mm] between the first and the second... | tiagocoutinho/bliss | bliss/controllers/motors/slitbox.py | Python | lgpl-3.0 | 1,530 |
#AUTOGENERATED!!! Date: 2020-06-19 19:44:10.693270
from opcua.ua.uaerrors import UaStatusCodeError
class StatusCodes:
Good = 0
Uncertain = 0x40000000
Bad = 0x80000000
BadUnexpectedError = 0x80010000
BadInternalError = 0x80020000
BadOutOfMemory = 0x80030000
BadResourceUnavailable = 0x800400... | FreeOpcUa/python-opcua | opcua/ua/status_codes.py | Python | lgpl-3.0 | 38,535 |
# coding: utf-8
r"""Methods to make a solid"""
import functools
import OCC
from OCC.Core.BRepBuilderAPI import BRepBuilderAPI_MakeSolid
from OCC.Core.BRepOffsetAPI import BRepOffsetAPI_MakePipe
# import OCC.TopoDS
from aocutils.common import AssertIsDone
from aocutils.brep.wire_make import polygon
from aocutils.bre... | guillaume-florent/aoc-utils | aocutils/brep/solid_make.py | Python | lgpl-3.0 | 2,302 |
# This program is free software; you can redistribute it and/or modify
# it under the terms of the (LGPL) 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 in the hope that it ... | obsoleter/suds | suds/umx/__init__.py | Python | lgpl-3.0 | 1,849 |
#!/usr/bin/python
#=============================================================================================
# MODULE DOCSTRING
#=============================================================================================
"""
Test examples.
"""
#=================================================================... | sonyahanson/yank | Yank/tests/test_examples.py | Python | lgpl-3.0 | 1,826 |
import re, os, M2Crypto, base64, util
import lostexhaust.config as config
rsakey = M2Crypto.RSA.load_pub_key(os.path.join(config.get('rootDir'), config.get("catlinRsaPemFile")))
def check_token_validity(token, ip, timestamp):
parsed = parse_token(decrypt_rsa(token))
if parsed is None:
return False
... | jakespringer/lostexhaust-v2 | api/lostexhaust/actions/authentication.py | Python | lgpl-3.0 | 1,285 |
import json
# Transliteration map from Cyrillic to Latin script
with open('milanbot/transliteration.json') as json_file:
cyrillic_transliteration = json.load(json_file)
# Supported languages that 'MilanBot' works with
with open('milanbot/languages.json') as json_file:
languages = json.load(json_file)
sparql... | milanjelisavcic/milanbot | milanbot/__init__.py | Python | unlicense | 743 |
from django.conf.urls import url
from scripts import views
urlpatterns = [
url(r'^$', views.index, name='index'),
# ex: /polls/5/
url(r'^(?P<script_id>[0-9]+)/$', views.detail, name='detail'),
# ex: /polls/5/results/
url(r'^(?P<script_id>[0-9]+)/results/$', views.results, name='results'),
# ex... | cphyc/ScriptManager | mysite/scripts/urls.py | Python | unlicense | 407 |
#-*- coding: utf-8 -*-
#django
from django.conf.urls import patterns, include, url
from django.views.generic import RedirectView
urlpatterns = patterns('genealogy',
# strona glowna
url(r'^person-list$', 'views.person_list', n... | kopringo/django-genealogy | genealogy/urls.py | Python | unlicense | 856 |
from django.shortcuts import redirect
def index(request):
return redirect('/feedback2013/')
| viewplatgh/energybean | widgets/widgets/views.py | Python | unlicense | 98 |
#!/usr/bin/python
import utils
print utils.tmpnam()
| DarthMaulware/EquationGroupLeaks | Leak #4 - Don't Forget Your Base/EQGRP-Auction-File/Linux/bin/earlyshovel/tmpnam.py | Python | unlicense | 54 |
#!/usr/bin/env python3
"""Fetch dashboards from provided urls into this chart."""
import json
import textwrap
from os import makedirs, path
import requests
import yaml
from yaml.representer import SafeRepresenter
# https://stackoverflow.com/a/20863889/961092
class LiteralStr(str):
pass
def change_style(style, ... | rimusz/helm-charts | stable/prometheus-operator/hack/sync_grafana_dashboards.py | Python | apache-2.0 | 4,533 |
#
# 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 n... | lhfei/spark-in-action | spark-2.x/src/main/python/ml/count_vectorizer_example.py | Python | apache-2.0 | 1,595 |
## @package predictor_py_utils
# Module caffe2.python.predictor.predictor_py_utils
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
from caffe2.python import core, scope
def create_predict_net(predictor_export_meta):
... | xzturn/caffe2 | caffe2/python/predictor/predictor_py_utils.py | Python | apache-2.0 | 4,921 |
# -*- coding: utf-8 -*-
# Copyright 2022 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | googleapis/python-policy-troubleshooter | google/cloud/policytroubleshooter_v1/services/iam_checker/async_client.py | Python | apache-2.0 | 11,763 |
import os, sys
basePlugPath = os.path.join("..", "..")
sys.path.insert(0, os.path.join(basePlugPath, "api"))
sys.path.insert(0, os.path.join(basePlugPath, "external"))
# TODO - know difference between module import vs package import?
import drawingboard
from pattern.web import Wikipedia
import pprint
pp = pprint.Pr... | decebel/dataAtom_alpha | bin/plug/py/sources/weby/WikipediaDataCommand.py | Python | apache-2.0 | 2,608 |
"""
Copyright 2015 Hewlett-Packard
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, softwar... | openstack/freezer-api | freezer_api/api/v2/jobs.py | Python | apache-2.0 | 11,296 |
#!/usr/bin/env python
print("Example package 1 in ex_pkg1/*")
## Local Variables:
## mode: python
## End:
| egustafson/sandbox | Python/py-setup/ex_pkg1/__init__.py | Python | apache-2.0 | 110 |
#!/usr/bin/env python
# Copyright 2016 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... | BrandonY/python-docs-samples | pubsub/cloud-client/subscriber.py | Python | apache-2.0 | 5,328 |
"""
def name_scope(name, default_name=None, values=None):
Wrapper for Graph.name_scope() using the default graph.
使用默认图包装“Graph.name_scope()
See
Graph.name_scope()
for more details.
Args:
name: A name for the scope.
Returns:
A context manager that installs name as a new name scope in the
default graph.
在默认图中安装名称作为... | Asurada2015/TFAPI_translation | framework_ops/Utility functions/tf_name_scope.py | Python | apache-2.0 | 401 |
def test_delete_first_group(app):
app.session.login(username="admin", password="secret")
app.group.delete_first_group()
app.session.logout()
| alexzoo/python | selenium_tests/test/test_del_group.py | Python | apache-2.0 | 156 |
# coding=utf-8
# Copyright 2022 The init2winit 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 applicable la... | google/init2winit | init2winit/model_lib/models.py | Python | apache-2.0 | 4,094 |
# 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 u... | reminisce/mxnet | example/ssd/quantization.py | Python | apache-2.0 | 8,206 |
# Generated by Django 3.1b1 on 2020-07-16 15:55
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('circuits', '0018_standardize_description'),
]
operations = [
migrations.AlterField(
model_name='circuittermination',
... | digitalocean/netbox | netbox/circuits/migrations/0019_nullbooleanfield_to_booleanfield.py | Python | apache-2.0 | 426 |
from model.project import Project
class ProjectHelper:
def __init__(self, app):
self.app = app
self.project_list_cache = None
def open_page_manage_projects(self):
wd = self.app.wd
wd.find_element_by_link_text("Manage").click()
wd.find_element_by_link_text("Manage Proj... | AndreyBalabanov/python_training_mantisBT | fixture/project.py | Python | apache-2.0 | 1,944 |
import os
import importlib
import logging
from dataclasses import dataclass
import sys
from typing import Any, Dict, Optional, Tuple
from ray.ray_constants import RAY_ADDRESS_ENVIRONMENT_VARIABLE
from ray.job_config import JobConfig
import ray.util.client_connect
logger = logging.getLogger(__name__)
@dataclass
cla... | pcmoritz/ray-1 | python/ray/client_builder.py | Python | apache-2.0 | 6,749 |
# Copyright 2016 OpenMarket Ltd
# Copyright 2017 Vector Creations Ltd
# Copyright 2018-2019 New Vector Ltd
# Copyright 2019 The Matrix.org Foundation C.I.C.
#
# 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 t... | matrix-org/synapse | synapse/rest/client/versions.py | Python | apache-2.0 | 4,936 |
from ztag.transform import *
from ztag import protocols, errors
class NiagaraFoxTransform(ZGrabTransform):
name = "fox/device_id"
port = 1911
protocol = protocols.FOX
subprotocol = protocols.FOX.DEVICE_ID
def _transform_object(self, obj):
zout = ZMapTransformOutput()
wrapped = Tra... | zmap/ztag | ztag/transforms/fox.py | Python | apache-2.0 | 2,652 |
from collections import OrderedDict
from pathlib import Path
from typing import (
Any,
Dict,
List,
Text,
Union,
Optional,
)
from ruamel import yaml
from ruamel.yaml.comments import CommentedMap
from ruamel.yaml.scalarstring import DoubleQuotedScalarString, LiteralScalarString
import rasa.share... | RasaHQ/rasa_nlu | rasa/shared/core/training_data/story_writer/yaml_story_writer.py | Python | apache-2.0 | 14,146 |
import logging
import ibmsecurity.utilities.tools
logger = logging.getLogger(__name__)
module_uri = "/isam/felb/configuration/services/"
requires_modules = None
requires_versions = None
requires_model = "Appliance"
def add(isamAppliance, service_name, name, value, check_mode=False, force=False):
"""
Creates... | IBM-Security/ibmsecurity | ibmsecurity/isam/base/network/felb/services/advanced_tuning.py | Python | apache-2.0 | 6,046 |
__author__ = 'wangp11'
AA=1
l1 = [13, 13]
n = 1
def print_l1():
print "id A.py: %d" % id(l1)
print l1
def extend_l1():
l1.extend([1,31,31])
print l1
def print_n():
print n | peter-wangxu/python_play | test/A.py | Python | apache-2.0 | 195 |
import numpy as np
def FullOut(outfile='results.txt',analysis={}, envelopes={}, index={}):
# Set global output options
np.set_printoptions(precision=5, linewidth=1000)
contents = outfile +'\n\n'
contents += '==LAMINATE CONSTANTS==\n'
for key in analysis:
contents += key+'\n'
contents += str(analysis[key])
... | mattljc/LaminateTools | oldSauce/RevB/text_outputs.py | Python | apache-2.0 | 765 |
from __future__ import absolute_import
if __name__ == '__main__':
import jamenson.compiler.bind
jamenson.compiler.bind.test()
exit()
from ..runtime.ports import (Port, PortList, connect, disconnect, disconnect_all, replace_connection,
count_connections, get_cell, get_cells, ... | matthagy/Jamenson | jamenson/compiler/bind.py | Python | apache-2.0 | 9,851 |
import sys
from deriva.transfer import DerivaBackupCLI
DESC = "Deriva Catalog Backup Utility - CLI"
INFO = "For more information see: https://github.com/informatics-isi-edu/deriva-py"
def main():
cli = DerivaBackupCLI(DESC, INFO, hostname_required=True, config_file_required=False)
return cli.main()
if __na... | informatics-isi-edu/deriva-py | deriva/transfer/backup/__main__.py | Python | apache-2.0 | 361 |
#!/usr/bin/env python3
# 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... | apache/incubator-airflow | scripts/ci/pre_commit/pre_commit_check_provider_yaml_files.py | Python | apache-2.0 | 16,496 |
# 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, ... | google/nitroml | nitroml/automl/autotrainer/subpipeline.py | Python | apache-2.0 | 6,444 |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2012 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Copyright 2012 Nebula, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# no... | savi-dev/horizon | horizon/dashboards/syspanel/projects/forms.py | Python | apache-2.0 | 5,991 |
"""
WSGI config for ajabsacco project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/1.7/howto/deployment/wsgi/
"""
import os
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "ajabsacco.settings.staging")
from d... | AjabWorld/ajabsacco | ajabsacco/wsgi_staging.py | Python | apache-2.0 | 401 |
#!/usr/bin/env python3
def get_strings(alphabet, length):
if length == 0:
yield ''
else:
for ch in alphabet:
for st in get_strings(alphabet, length - 1):
yield ch + st
def main():
alphabet = "T A G C".split()
length = 2
with open("Output.txt", "w") as output_file:
for st in get_strings(alphabet, len... | Daerdemandt/Learning-bioinformatics | LEXF/Solution.py | Python | apache-2.0 | 366 |
from django.conf.urls import patterns, url
from .views import PhotoListView
urlpatterns = patterns('',
url(r'^(?P<slug>[\w-]+)/$', PhotoListView.as_view(), name='image'),
) | mailfish/helena | gallery/urls.py | Python | apache-2.0 | 197 |
# Copyright 2012 OpenStack Foundation
# 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 requ... | cloudbase/neutron-virtualbox | neutron/tests/unit/test_linux_dhcp.py | Python | apache-2.0 | 56,280 |
# Copyright 2021 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... | tensorflow/model-optimization | tensorflow_model_optimization/python/examples/clustering/keras/imdb/imdb_rnn.py | Python | apache-2.0 | 2,554 |
# Copyright King's College London, 2017.
# See the NOTICE file distributed with this work for additional information
# regarding copyright ownership. King's College London licences this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the Lic... | pericles-project/TechnicalAppraisalTool | pericles-ibuilder/ScienceBuilder/main.py | Python | apache-2.0 | 17,935 |
# Copyright (c) 2013 Hewlett-Packard Development Company, L.P.
# Copyright (c) 2012 VMware, 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/lic... | phenoxim/nova | nova/virt/vmwareapi/host.py | Python | apache-2.0 | 4,514 |
import time
from codebox.utils.models import Model, String, Float
from codebox.apps.auth.models import User
class Snippet(Model):
org = String()
user = String()
text = String()
keywords = String(required=False)
lang = String()
created_at = Float(default=time.time)
languages = [
(... | disqus/codebox | codebox/apps/snippets/models.py | Python | apache-2.0 | 1,183 |
from allennlp.modules.encoder_base import _EncoderBase
from allennlp.common import Registrable
class Seq2VecEncoder(_EncoderBase, Registrable):
"""
A `Seq2VecEncoder` is a `Module` that takes as input a sequence of vectors and returns a
single vector. Input shape : `(batch_size, sequence_length, input_di... | allenai/allennlp | allennlp/modules/seq2vec_encoders/seq2vec_encoder.py | Python | apache-2.0 | 1,215 |
import troposphere.elasticloadbalancing as elb
from amazonia.classes.asg import Asg
from amazonia.classes.asg_config import AsgConfig
from amazonia.classes.block_devices_config import BlockDevicesConfig
from amazonia.classes.simple_scaling_policy_config import SimpleScalingPolicyConfig
from network_setup import get_net... | GeoscienceAustralia/amazonia | test/unit_tests/test_asg.py | Python | apache-2.0 | 8,542 |
#!/usr/bin/env python
import sys
import os
os.environ['MPLCONFIGDIR'] = "/tmp/"
import pandas as pd
import numpy as np
import commands
import csv
from sklearn import svm
from sklearn.cross_validation import StratifiedKFold
from sklearn import preprocessing
from sklearn.externals import joblib
current_key = None
key... | WiproOpenSourcePractice/bdreappstore | enu/real_time_event_detection/hadoopstream/reducer_post.py | Python | apache-2.0 | 2,141 |
#!env python
import os
import sys
sys.path.append(
os.path.join(
os.environ.get( "SPLUNK_HOME", "/opt/splunk/6.1.3" ),
"etc/apps/framework/contrib/splunk-sdk-python/1.3.0",
)
)
from collections import Counter, OrderedDict
from math import log
from nltk import tokenize
import execnet
import json
from splunkl... | nlproc/splunkml | bin/nlcluster.py | Python | apache-2.0 | 4,186 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.