code
stringlengths
3
1.05M
repo_name
stringlengths
5
104
path
stringlengths
4
251
language
stringclasses
1 value
license
stringclasses
15 values
size
int64
3
1.05M
#coding=utf8 import wx import os from WeiboClass import WeiboControl class MainWindow(wx.Frame): def __init__(self, parent, title): self.dirname='' self.WeiboText = '' self.PicPath = '' # A "-1" in the size parameter instructs wxWidgets to use the default size. # I...
owenyang0/sinaweibopy
WeiBoForm.py
Python
apache-2.0
4,163
""" The rechunk module defines: intersect_chunks: a function for converting chunks to new dimensions rechunk: a function to convert the blocks of an existing dask array to new chunks or blockshape """ from __future__ import absolute_import, division, print_function import math import heapq fro...
kenshay/ImageScript
ProgramData/SystemFiles/Python/Lib/site-packages/dask/array/rechunk.py
Python
gpl-3.0
21,896
# Copyright (C) Jean-Paul Calderone # Copyright (C) Twisted Matrix Laboratories. # See LICENSE for details. """ Helpers for the OpenSSL test suite, largely copied from U{Twisted<http://twistedmatrix.com/>}. """ import shutil import sys import traceback from tempfile import mktemp, mkdtemp from unittest import TestCa...
aalba6675/pyopenssl
tests/util.py
Python
apache-2.0
15,081
#!/usr/bin/env python import socket, re, requests, json, random, os, os.path, random,datetime from bs4 import BeautifulSoup from PIL import Image from io import StringIO from isodate import parse_duration chans = ('#sadbot-dev', "")#, '#wormhole') images = ('image/jpeg', 'image/png', 'image/gif','image/jpg...
doidbb/pybot
pybot.py
Python
mit
18,127
# Copyright 2013 Thierry Carrez <thierry@openstack.org> # 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 ...
ttx/storyboard
storyboard/projects/views.py
Python
apache-2.0
2,033
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2010 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compli...
maheshp/novatest
nova/api/ec2/cloud.py
Python
apache-2.0
74,367
# Copyright (c) 2016, Xilinx, 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: # # 1. Redistributions of source code must retain the above copyright notice, # this list of ...
Xilinx/PYNQ
pynq/lib/arduino/__init__.py
Python
bsd-3-clause
2,604
import time import logging import pickle import functools import warnings from packaging import version from typing import Any, Callable, Dict, List, Optional, Tuple, Union from ray.tune.result import DEFAULT_METRIC, TRAINING_ITERATION from ray.tune.sample import ( Categorical, Domain, Float, Integer, ...
ray-project/ray
python/ray/tune/suggest/optuna.py
Python
apache-2.0
24,252
""" This package contains tests for the Search community. """
vandenheuvel/tribler
Tribler/Test/Community/Search/__init__.py
Python
lgpl-3.0
62
import unittest, random, sys, time sys.path.extend(['.','..','../..','py']) import h2o, h2o_cmd, h2o_glm, h2o_import as h2i, h2o_util, h2o_exec as h2e def define_params(): paramDict = { 'ignored_cols': [None, 0, 1], # response col must be categorical? # laplace smoothing parameter #...
111t8e/h2o-2
py/testdir_single_jvm/test_bayes_rand2.py
Python
apache-2.0
2,951
import os import sys import fnmatch for root, dirnames, filenames in os.walk(sys.argv[1]): for filename in fnmatch.filter(filenames, 'COMPLETED'): print root
maxwelld90/searcher_simulations
scripts/old/completed_check.py
Python
gpl-2.0
161
# coding=utf-8 # Copyright 2022 The Uncertainty Baselines 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 ap...
google/uncertainty-baselines
experimental/language_structure/vrnn/data_preprocessor_test.py
Python
apache-2.0
4,654
# coding: utf-8 # ------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # --------------------------------------------------------------------...
Azure/azure-sdk-for-python
sdk/tables/azure-data-tables/samples/sample_batching.py
Python
mit
3,308
from unittest import TestCase from neo.VM.InteropService import ByteArray, Integer, BigInteger, Boolean from neo.SmartContract.ContractParameter import ContractParameter from neo.SmartContract.ContractParameterType import ContractParameterType from neo.Core.UInt256 import UInt256 from neo.Core.UInt160 import UInt160 fr...
hal0x2328/neo-python
neo/SmartContract/tests/test_contract_parameters.py
Python
mit
8,878
# 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, sof...
google-research/long-range-arena
lra_benchmarks/models/bigbird/bigbird_attention.py
Python
apache-2.0
27,009
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # # Code generated by Microsoft (R) AutoRest Code Generator. # Changes ...
lmazuel/azure-sdk-for-python
azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/models/identity.py
Python
mit
1,517
#!/usr/bin/env python # -*- coding: utf-8 """ This command-line tool is the interface for the deepseg API that performs segmentation using deep learning from the ivadomed package. """ # TODO: Add link to example image so users can decide wether their images look "close enough" to some of the proposed # models (e.g., ...
neuropoly/spinalcordtoolbox
spinalcordtoolbox/scripts/sct_deepseg.py
Python
mit
10,157
import shutil, errno, os, time def setuppingDir(src,dst): try: shutil.copytree(src, dst) print 'Done!' except OSError as exc: # python >2.5 if exc.errno == errno.ENOTDIR: shutil.copy(src, dst) print 'Done!' else: raise def setuppingFile(src,dst): try: shutil.copyfile(src,...
ubalance-team/magum
UbalancedChart/setup.py
Python
gpl-2.0
1,137
from __future__ import absolute_import, division, print_function, with_statement import traceback from tornado.concurrent import Future from tornado import gen from tornado.httpclient import HTTPError, HTTPRequest from tornado.log import gen_log, app_log from tornado.testing import AsyncHTTPTestCase, gen_test, bind_u...
bdh1011/wau
venv/lib/python2.7/site-packages/tornado/test/websocket_test.py
Python
mit
14,775
class Modules(object): def __init__(self, host): self._host = host def list(self): status, stdout, stderr = self._host.execute('lsmod') if not status: raise LinuxError(stderr) return [line.split()[0] for line in stdout.splitlines()[1:]] def tree(self): p...
fmenabe/python-unix
unix/linux/modules.py
Python
mit
862
# -*- coding: utf-8 -*- """ Compute a ridge that combines PET model and fMRI correlations. The general formula is : |Xw - y|^2 + alpha |w - lambda w_tep|^2 By making : beta = w - lambda w_tep We have : |X beta - (y - lambda X w_tep)|^2 + alpha |beta|^2 Created on Wed Jan 21 09:05:28 2015 @author: mehdi.rahim@cea.f...
mrahim/adni_petmr_analysis
classification_fmri_stacking.py
Python
bsd-2-clause
2,956
from .checkdata import check_any class ElementTemplate: def __init__(self, type, data, children, id=None): self.__id = id self.__type = type self.__data = data self.__children = children @property def id(self): return self.__id @property def type(s...
umlfri/umlfri2
umlfri2/metamodel/projecttemplate/element.py
Python
gpl-3.0
760
# -*- coding: utf-8 -*- # # This file is part of Invenio Demosite. # Copyright (C) 2006, 2007, 2008, 2010, 2011, 2013 CERN. # # Invenio Demosite 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...
mvesper/invenio-demosite
invenio_demosite/testsuite/regression/test_bibindex.py
Python
gpl-2.0
67,493
# -*- coding: utf-8 -*- # Generated by Django 1.9.2 on 2016-07-08 19:15 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('core', '0003_auto_20160708_1614'), ] operations = [ migrations.AlterField( ...
nanomolina/JP
src/odontology/core/migrations/0004_auto_20160708_1615.py
Python
apache-2.0
631
# -*-coding:Utf-8 -* # Copyright (c) 2014 LE GOFF Vincent # 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 copyright notice, this # lis...
stormi/tsunami
src/secondaires/navigation/commandes/matelot/score.py
Python
bsd-3-clause
2,523
#!/usr/bin/env python # Software License Agreement (BSD License) # # Copyright (c) 2008, Willow Garage, 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...
bandi13/cs980-ROS-bot
ROS_ws/src/eyes/003_listener_with_user_data/listener_with_user_data.py
Python
gpl-2.0
2,829
ENCODING = 'utf-8' METADATA_FILE_SUFFIX = '.meta.py' ALL_SETTINGS = ('asset_dir', 'assets_only', 'base_url', 'do_nothing', 'force', 'hide_index_html', 'locale_dir', 'ignore_files', 'logger_le...
dbaty/soho
soho/config.py
Python
bsd-3-clause
858
"""setup.py Licensed under a BSD license. See LICENSE for more information. Author: Christopher Rink""" try: from setuptools import setup except ImportError: from distutils.core import setup setup( name='mumpy', version='0.1', packages=['mumpy'], install_requires=['ply>=3.4', 'blist>=1.3.6'],...
chrisrink10/mumpy
setup.py
Python
bsd-3-clause
619
"""The roomba constants.""" DOMAIN = "roomba" PLATFORMS = ["sensor", "binary_sensor", "vacuum"] CONF_CERT = "certificate" CONF_CONTINUOUS = "continuous" CONF_BLID = "blid" DEFAULT_CERT = "/etc/ssl/certs/ca-certificates.crt" DEFAULT_CONTINUOUS = True DEFAULT_DELAY = 1 ROOMBA_SESSION = "roomba_session" BLID = "blid_key"
partofthething/home-assistant
homeassistant/components/roomba/const.py
Python
apache-2.0
320
# -*- coding: utf-8 -*- """ Project name: Open Methodology for Security Tool Developers Project URL: https://github.com/cr0hn/OMSTD Copyright (c) 2014, cr0hn<-AT->cr0hn.com All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following ...
cr0hn/OMSTD
examples/develop/lp/002/lp-002-p1.py
Python
bsd-2-clause
2,269
import sys, re import pandas as pd def calculate_ratios(df): """ Calculate opportunity ratio per user """ opportunity_ratios = {} print "Analyzing target_emails" for target_email in df.target_email.unique(): sys.stdout.write('.') sys.stdout.flush() reports_sent = df[...
solitateppo/experiment-analysis
analyze_opportunities.py
Python
mit
1,676
from flask.globals import current_app def test_no_cookies(client): for url in ("/", "/imprint", "/privacy"): r = client.get(url) assert "Set-Cookie" not in r.headers, url current_app.testing = False # disable: forms only show CSRF when not in testing for url in ("/login", "/register"): ...
paulgessinger/coalics
tests/test_cookies.py
Python
mit
442
""" Specific overrides to the base prod settings to make development easier. """ from .aws import * # pylint: disable=wildcard-import, unused-wildcard-import DEBUG = True USE_I18N = True TEMPLATE_DEBUG = True SITE_NAME = 'localhost:8000' # By default don't use a worker, execute tasks as if they were local functions C...
hkawasaki/kawasaki-aio8-1
lms/envs/devstack.py
Python
agpl-3.0
2,843
# -*- mode:python -*- # Copyright (c) 2007 MIPS Technologies, 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 copyright # notice, this ...
xiaoyaozi5566/GEM5_DRAMSim2
src/arch/mips/MipsSystem.py
Python
bsd-3-clause
2,607
#!/usr/bin/env python # -*- mode: python; encoding: utf-8 -*- """Tests for memory related flows.""" import copy import gzip import json import os from grr.client.client_actions import file_fingerprint from grr.client.client_actions import searching from grr.client.client_actions import standard from grr.client.client...
destijl/grr
grr/lib/flows/general/memory_test.py
Python
apache-2.0
12,695
"""Python generation tests. Copyright (c) 2015 by Cisco Systems, Inc. All rights reserved. """ # ---------------------------------------------------------------- # Copyright 2016 Cisco Systems # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with th...
psykokwak4/ydk-gen
test/pygen_tests.py
Python
apache-2.0
13,719
#!/usr/bin/env python import requests import re import os import platform distributionInfo = platform.platform() matchObj = re.match( r'linux|darwin', distributionInfo, re.I) OS= matchObj.group().lower() def main(): pattern = re.compile(".*%s-amd64.tgz$" % OS) r = requests.get('https://api.github.com/repos/...
budhrg/minishift-centos-iso
tests/utils/minishift_latest_version.py
Python
lgpl-3.0
523
""" Django settings for TIMStest project. Generated by 'django-admin startproject' using Django 1.8.4. For more information on this file, see https://docs.djangoproject.com/en/1.8/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.8/ref/settings/ """ # Build pat...
Terrenceluo/TIMSTest
TIMStest/settings.py
Python
apache-2.0
3,364
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. import hashlib from odoo import api, models from odoo.tools import pycompat from odoo.tools import html_escape as escape class Image(models.AbstractModel): """ Widget options: ``class`` set as att...
maxive/erp
addons/web/models/ir_qweb.py
Python
agpl-3.0
2,540
from django.db.models.aggregates import StdDev from django.db.utils import ProgrammingError from django.utils.functional import cached_property class BaseDatabaseFeatures: gis_enabled = False allows_group_by_pk = False allows_group_by_selected_pks = False empty_fetchmany_value = [] update_can_self...
mattseymour/django
django/db/backends/base/features.py
Python
bsd-3-clause
10,173
# This file is part of Gajim. # # Gajim 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; version 3 only. # # Gajim is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the...
gajim/gajim
gajim/common/modules/annotations.py
Python
gpl-3.0
2,038
from dbindexer.lookups import StandardLookup from dbindexer.api import register_index from app_users.models import UserProfile register_index(UserProfile, {'user__username': (StandardLookup(), 'iexact'),})
marco-lancini/Showcase
app_users/dbindexes.py
Python
mit
207
from ScalingFunction import ScalingFunction from ScalingBunch import ScalingBunch from Linear import Linear from Logarithmic import Logarithmic
aerialhedgehog/VyPy
trunk/VyPy/data/scaling/__init__.py
Python
bsd-3-clause
162
import json from datetime import datetime from urllib.parse import unquote from django.contrib.auth.mixins import LoginRequiredMixin from django.db.models import Q from django.http import HttpResponse from django.shortcuts import render, redirect, get_object_or_404 from django.urls import reverse from django.urls impo...
StichtingBorrelbeheerZilverling/sbzwebsite
apps/multivers/views.py
Python
bsd-3-clause
11,814
from math import ceil class Pagination(object): def __init__(self, page, per_page, total_count): self.page = page self.per_page = per_page self.total_count = total_count @property def pages(self): return int(ceil(self.total_count / float(self.per_page))) @property ...
pwyf/data-quality-tester
DataQualityTester/lib/pagination.py
Python
mit
927
"""""" import importlib import os import traceback from collections import defaultdict from pathlib import Path from typing import Dict, List, Set, Tuple, Type, Any, Callable from datetime import datetime, timedelta from concurrent.futures import ThreadPoolExecutor from vnpy.event import Event, EventEngine from vnpy....
msincenselee/vnpy
vnpy/app/portfolio_strategy/engine.py
Python
mit
19,597
'''Packages for Data Hacking Project''' from min_hash import * from lsh_sims import * from hcluster import * from simple_stats import * from yara_signature import * __version__ = '0.2.0'
brifordwylie/data_hacking
data_hacking/__init__.py
Python
mit
187
from __future__ import division import sys import math import numpy as np import scipy.ndimage as ndi import scipy.linalg.lapack as lp import scipy.linalg.blas as bl import scipy.linalg as sla from scipy.optimize import fmin, fmin_powell, fmin_cg from scipy.stats import norm from scipy.ndimage import median_filter a...
hpparvi/KeplerJC
src/core.py
Python
gpl-3.0
2,804
#!/usr/bin/python # # Copyright 2014 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 b...
richardfergie/googleads-python-lib
examples/dfa/v1_20/get_pricing_types.py
Python
apache-2.0
1,665
import server import os if __name__ == "__main__": server.Server()
HackinGuy/EasyDLP
src/Server/main.py
Python
mit
73
# -*- coding: utf-8 -*- __author__ = 'study_sun' from stock.analysis import * from collector import * from spider_base.convenient import now_day from outputer import * from fund.analysis import * import os reload(sys) sys.setdefaultencoding('utf-8') #这里主要还是输出纯原始数据,图表交由output搞定,所以直接用的话可能会有比较夸张的数据,比如市盈率超过一万这种 class In...
s6530085/FundSpider
index/analysis.py
Python
mit
10,399
# author zach.wang # -*- coding:utf-8 -*- def highfunc(ch): ''' This is a 高阶函数 :param ch: type str :return: ''' def basic(choice): if choice == "a": basicuse() else: basicuse2() def basicuse2(): print("bbb") def basicuse(): print("...
WZQ1397/automatic-repo
python/decorate_demo.py
Python
lgpl-3.0
1,179
from . import * from bfg9000.file_types import * from bfg9000.path import Path, Root def pathfn(file): return file.path.reroot() class FileTest(TestCase): def assertSameFile(self, a, b, extra=set(), seen=None): if seen is None: seen = set() seen.add(id(a)) self.assertEq...
jimporter/bfg9000
test/unit/test_file_types.py
Python
bsd-3-clause
10,516
#!/usr/bin/env python # # Author: Pablo Iranzo Gomez (Pablo.Iranzo@redhat.com) # # Description: Script for setting the keyring password for RHEV scripts # # Requires: python keyring # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as publish...
DragonRoman/rhevm-utils
rhev-keyring.py
Python
gpl-3.0
2,000
# -*- coding: utf-8 -*- # Code for Life # # Copyright (C) 2015, Ocado Innovation Limited # # 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 o...
mikebryant/rapid-router
game/widgets.py
Python
agpl-3.0
2,586
#coding=utf-8 ''' Created on 2015年10月27日 各种api的获取方式,最后通过这些api计算出私有api的集合,用来后续计算app中是否使用私有api @author: atool ''' from db import dsidx_dbs import os import api from api import api_helpers from dump import class_dump_utils from itertools import groupby def framework_dump_apis(sdk, framework_folder): ''' class-dum...
hustcc/iOS-private-api-checker
api/api_utils.py
Python
gpl-2.0
7,963
USERS_FILE = u'users.ini' GROUPS_FILE = u'groups.ini' POLICIES_DIR = u'policies'
percolate/iamer
iamer/constants.py
Python
gpl-3.0
81
# 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...
mikalstill/nova
nova/api/openstack/placement/wsgi.py
Python
apache-2.0
3,599
from scrapy.item import Item, Field class BenefitProgramItem(Item): program_title = Field() program_description = Field() program_details_link = Field() class ProgramDetail(Item): program_title = Field() program_description = Field() managing_agency = Field() managing_agency_url = Field() general_prog...
rdempsey/ddl-data-wrangling
part-two-web-scraping/govbenefitsspider/govbenefitsspider/items.py
Python
mit
418
from quodlibet.plugins.events import EventPlugin import socket SOCKET_PATH = "/dev/shm/pyorbital" class LCDStatus(EventPlugin): PLUGIN_ID = 'LCD Status' PLUGIN_NAME = _('LCD Status Message') PLUGIN_DESC = _("Output player status to Matrix Orbital LCD using pyorbital.py.") PLUGIN_VERSION = '0.2' d...
ohel/pyorbital-gizmod-tweaks
pyorbital/pyorbital_ql.py
Python
unlicense
1,428
#python import k3d import testing document = k3d.new_document() reader = k3d.plugin.create("K3DMeshReader", document) # load a mesh that has multiple polyhedra, triangles, quads, n-sided polygons and holes. (i.e. a mesh from hell) reader.file = k3d.filesystem.generic_path(testing.source_path() + "/meshes/polyhedron....
barche/k3d
tests/mesh/mesh.modifier.CatmullClark.complex.py
Python
gpl-2.0
757
#!/usr/bin/env python # encoding: utf-8 ''' edu.cornell.gobii.TransposeMatrix -- shortdesc edu.cornell.gobii.TransposeMatrix is a description It defines classes_and_methods @author: yn259 @copyright: 2016 Cornell University. All rights reserved. @license: license @contact: yn259@cornell.edu @deffield ...
gobiiproject/GOBii-System
gobiiscripts/loaders/TransposeMatrix.py
Python
mit
3,241
# -*- coding: utf-8 -*- #+---------------------------------------------------------------------------+ #| 01001110 01100101 01110100 01111010 01101111 01100010 | #| | #| Netzob : Inferring communication protocol...
nagyistoce/netzob
resources/sdist/utils.py
Python
gpl-3.0
4,039
import py, sys from testing import backend_tests from cffi.backend_ctypes import CTypesBackend class TestCTypes(backend_tests.BackendTests): # for individual tests see # ====> backend_tests.py Backend = CTypesBackend TypeRepr = "<class 'ffi.CData<%s>'>" def test_array_of_func_ptr(self): ...
mhnatiuk/phd_sociology_of_religion
scrapper/build/cffi/testing/test_ctypes.py
Python
gpl-2.0
1,315
import logging from django.core.management.base import BaseCommand logger = logging.getLogger(__name__) class BaseImportCommand(BaseCommand): def _import(self, fp): """ Abstract method to import data from the supplied open file object """ pass def add_arguments(self, parser...
jarvis-cochrane/paranuara
paranuara_api/management/base.py
Python
bsd-3-clause
724
# -*- coding: utf-8 -*- #!/usr/bin/python __doc__ = ''' Reasonable Python A module for integrating F-logic into Python dbms.py --- easy interface to ZODB by Markus Schatten <markus_dot_schatten_at_foi_dot_hr> Faculty of Organization and Informatics, Varaždin, Croatia, 2007 This library is free software; you can r...
johannesloetzsch/reasonablepy
rp/dbms.py
Python
lgpl-2.1
5,346
from wagtail.core.models import Page, get_translatable_models def get_locale_usage(locale): """ Returns the number of pages and other objects that use a locale """ num_pages = Page.objects.filter(locale=locale).exclude(depth=1).count() num_others = 0 for model in get_translatable_models(): ...
zerolab/wagtail
wagtail/locales/utils.py
Python
bsd-3-clause
467
# -*- coding: utf-8 -*- # Dioptas - GUI program for fast processing of 2D X-ray diffraction data # Principal author: Clemens Prescher (clemens.prescher@gmail.com) # Copyright (C) 2014-2019 GSECARS, University of Chicago, USA # Copyright (C) 2015-2018 Institute for Geology and Mineralogy, University of Cologne, Germany ...
Dioptas/Dioptas
dioptas/widgets/integration/control/PhaseWidget.py
Python
gpl-3.0
13,154
'''Handle configuration for zarkov. We support full configuration on the command line with defaults supplied by either an .ini-style config file or a yaml (and thus json) config file. ''' import sys import logging.config from optparse import OptionParser from ConfigParser import ConfigParser import yaml import coland...
joeywen/zarkov
zarkov/config.py
Python
apache-2.0
10,451
# Copyright 2014 Hewlett-Packard Development Company, L.P. # # 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...
ionutbalutoiu/ironic
ironic/drivers/modules/ilo/common.py
Python
apache-2.0
25,880
# Copyright 2018 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, ...
tensorflow/moonlight
moonlight/training/generation/generation.py
Python
apache-2.0
11,447
import re from pybb.processors import BaseProcessor from pybb.compat import get_user_model from . import settings class MentionProcessor(BaseProcessor): username_re = r'@([\w\-]+)' format = '@%(username)s' tag = '[mention=%(user_id)s]%(username)s[/mention]' model = get_user_model() def get_user...
thoas/pybbm
pybb/contrib/mentions/processors.py
Python
bsd-2-clause
1,223
""" @author: """ import bottle # this variable MUST be used as the name for the cookie used by this application COOKIE_NAME = 'sessionid' def check_login(db, usernick, password): """returns True if password matches stored""" def generate_session(db, usernick): """create a new session and add a cookie to t...
stevecassidy/pyunitgrading
tests/bad/single/43684882/comp249-psst-starter-master/users.py
Python
bsd-3-clause
815
# -*- coding: utf-8 -*- from odoo.tests.common import HttpCase from odoo.exceptions import ValidationError class AccountingTestCase(HttpCase): """ This class extends the base TransactionCase, in order to test the accounting with localization setups. It is configured to run the tests after the installation ...
Aravinthu/odoo
addons/account/tests/account_test_classes.py
Python
agpl-3.0
2,749
from django.conf.urls import patterns, url urlpatterns = patterns('', url(r'^index/$', 'view_tests.views.index_page', name='index'), )
atruberg/django-custom
tests/view_tests/regression_21530_urls.py
Python
bsd-3-clause
140
#!/usr/bin/env python # -*- coding: utf-8 -*- """Update encrypted deploy password in Travis config file.""" from __future__ import print_function import base64 import json import os from getpass import getpass import yaml from cryptography.hazmat.primitives.serialization import load_pem_public_key from cryptography.h...
farmlab/AgronoPy
travis_pypi_setup.py
Python
mit
4,075
# # Gramps - a GTK+/GNOME based genealogy program # # Copyright (C) 2012 Nick Hall # # 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) a...
SNoiraud/gramps
gramps/gui/plug/export/__init__.py
Python
gpl-2.0
973
# # Copyright (C) Red Hat, 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...
enovance/dci-control-server
dci/alembic/versions/e06d36c55bfe_add_jobs_tags.py
Python
apache-2.0
1,429
# -*- coding: utf-8 -*- from rip.schema.string_field import StringField from rip.api_schema import ApiSchema from rip.crud.crud_resource import CrudResource from rip.crud.crud_actions import CrudActions from rip.generic_steps.default_entity_actions import DefaultEntityActions class BlankTestSchema(ApiSchema): na...
Aplopio/rip
tests/integration_tests/blank_test_resource.py
Python
mit
644
ten_things = "Apples Oranges Crows Telephone Light Sugar" print "Wait there's not 10 things in that list, let's fix that." stuff = ten_things.split(' ') more_stuff = ["Day", "Night", "Song", "Frisbee", "Corn", "Banana", "Girl", "Boy"] while len(stuff) != 10: next_one = more_stuff.pop() print "Adding: ", next_one ...
kaitlinahrens/learn-python-the-hard-way
ex38.py
Python
apache-2.0
1,086
# -*- coding: utf-8 -*- import os import os.path import re import sys import string from django.apps.registry import apps from django.core.management.base import BaseCommand, CommandError from python_translate.extractors import base as extractors from python_translate import operations from python_translate.translat...
adamziel/django_translate
django_translate/management/commands/tranzdump.py
Python
mit
8,550
# -*- coding: utf-8 -*- """ Sahana Eden Document Library @copyright: 2011-2013 (c) Sahana Software Foundation @license: MIT Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software wi...
code-for-india/sahana_shelter_worldbank
modules/s3db/doc.py
Python
mit
25,045
# -*- coding: utf-8 -*- # # Copyright (C) 2013 Jason R. Coombs <jaraco@jaraco.com> # All rights reserved. # # This software is licensed as described in the file COPYING, which # you should have received as part of this distribution. import unittest import datetime import time import jsonpickle from jsonpickle import ...
mandx/jsonpickle
tests/datetime_test.py
Python
bsd-3-clause
8,271
from typing import NewType, NamedTuple, Union, Tuple, Optional, Dict, Any class Bounds(NamedTuple): lower: float upper: float BoundsInput = Union[Bounds, Tuple[float, float]] L0 = NewType("L0", float) L1 = NewType("L1", float) L2 = NewType("L2", float) Linf = NewType("Linf", float) Preprocessing = Optiona...
bethgelab/foolbox
foolbox/types.py
Python
mit
338
# Copyright (c) 2008 Agostino Russo # # Written by Agostino Russo <agostino.russo@gmail.com> # # This file is part of Wubi the Win32 Linux Mint Installer. # # Wubi is free software; you can redistribute it and/or modify # it under 5the terms of the GNU Lesser General Public License as # published by the Free Software F...
linuxmint/mint4win
src/wubi/frontends/win32/accessibility_page.py
Python
gpl-2.0
3,440
import click from click.testing import CliRunner from textkit.filter.transliterate import transliterate def test_transliterate(): runner = CliRunner() filename = 'test_data/international.txt' ## ???
learntextvis/textkit
tests/transliterate.py
Python
mit
213
# -*- coding: utf-8 -*- # Copyright 2017 Onestein (<http://www.onestein.eu>) # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). from . import test_employee_display_own_info
VitalPet/addons-onestein
hr_employee_display_own_info/tests/__init__.py
Python
agpl-3.0
192
# Copyright (c) 2014 Alexander Bredo # All rights reserved. # # Redistribution and use in source and binary forms, with or # without modification, are permitted provided that the # following conditions are met: # # 1. Redistributions of source code must retain the above # copyright notice, this list of conditions ...
alexbredo/ipfix-receiver
handler/file.py
Python
bsd-2-clause
1,574
# Copyright (C) 2014 ETH Zurich, Institute for Astronomy ''' A simple example to demonstrate the supported functionality with class methods. Note: this should be used with precaution as unboxing member variables causes some overhead Created on Oct 23, 2014 author: jakeret ''' from __future__ import print_function, ...
cosmo-ethz/hope
examples/hope_class.py
Python
gpl-3.0
1,063
from . import decompHess, clusterScripts, VdmPairwise as Vdm
GutenkunstLab/SloppyCell
SloppyCell/Vandermonde/__init__.py
Python
bsd-3-clause
61
# # 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 us...
RyanSkraba/beam
sdks/python/apache_beam/examples/streaming_wordcount_it_test.py
Python
apache-2.0
4,580
""" WSGI config for kakashinenpo 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.8/howto/deployment/wsgi/ """ import os from django.core.wsgi import get_wsgi_application os.environ.setdefault("DJANGO_...
kennydo/kakashi-nenpo
kakashinenpo/kakashinenpo/wsgi.py
Python
mit
401
device_parents = {} try: from molly.wurfl import wurfl_data except ImportError: pass else: def get_parents(device): if device == 'root' or device is None: return [] device = unicode(device) try: return device_parents[device] except KeyError: ...
mollyproject/mollyproject
molly/wurfl/__init__.py
Python
apache-2.0
759
from .utils import imshow from .video import Video from .contour import Contour, find_biggest_contours __all__ = [ 'imshow', 'Video', 'Contour', 'find_biggest_contours', ]
cachitas/ocvu
ocvu/__init__.py
Python
mit
190
from xml.dom.minidom import Document from xml.dom import minidom from django.http import HttpRequest, HttpResponseRedirect import urllib2 from urllib2 import Request, urlopen, HTTPError, URLError import base64 from itxland.cart.models import CartItem from itxland.cart import cart from itxland import settings def get_...
davidhenry/ITX-Land
checkout/google_checkout.py
Python
mit
3,600
# Copyright 2016-2017 Eric S. Tellez # 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 writ...
INGEOTEC/microTC
microtc/textmodel.py
Python
apache-2.0
18,021
from AZutilities import dataUtilities """ <name>Similarity Descriptors</name> <description>Calculates similarity descriptors</description> <icon>icons/SimDesc.png</icon> <contact>Pedro Rafael Almeida</contact> <priority>14</priority> """ import string,time from OWWidget import * import OWGUI import orange import AZOra...
JonnaStalring/AZOrange
orange/OrangeWidgets/Data/OWSimBoostedQSAR.py
Python
lgpl-3.0
6,475
import blah
dontalton/imagerunner
drivers/openstack/glance.py
Python
bsd-2-clause
12
from setuptools import setup, find_packages import sys, os, glob version = '0.7.1' setup(name='seqtools', version=version, description="", long_description="""\ """, classifiers=[], # Get strings from http://pypi.python.org/pypi?%3Aaction=list_classifiers keywords='', author='Sean ...
lowks/SDST
setup.py
Python
mit
788
# Standard imports import pytest import tempfile import sqlite3 # Custom imports from cutevariant.core.importer import import_reader, import_pedfile from cutevariant.core.reader import FakeReader, VcfReader from cutevariant.core.writer import CsvWriter, PedWriter, VcfWriter, BedWriter from tests import utils @pytest...
labsquare/CuteVariant
tests/core/test_writer.py
Python
gpl-3.0
3,821