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
# This file is part of Indico. # Copyright (C) 2002 - 2015 European Organization for Nuclear Research (CERN). # # Indico is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License as # published by the Free Software Foundation; either version 3 of the # License, or (a...
XeCycle/indico
indico_zodbimport/modules/event_logs.py
Python
gpl-3.0
5,771
#!/usr/bin/env python # Copyright (c) 2012 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Unit tests for git_cl.py.""" import os import StringIO import stat import sys import unittest sys.path.insert(0, os.path.dirna...
coreos/depot_tools
tests/git_cl_test.py
Python
bsd-3-clause
25,738
import unittest import textwrap import antlr3 import antlr3.tree import testbase class T(testbase.ANTLRTest): def walkerClass(self, base): class TWalker(base): def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) self.buf = "" def t...
ekcs/congress
thirdparty/antlr3-antlr-3.5/runtime/Python3/tests/t051treeRewriteAST.py
Python
apache-2.0
40,084
import os path = os.path.dirname(os.path.realpath(__file__)) sbmlFilePath = os.path.join(path, 'MODEL1204280031.xml') with open(sbmlFilePath,'r') as f: sbmlString = f.read() def module_exists(module_name): try: __import__(module_name) except ImportError: return False else: ret...
biomodels/MODEL1204280031
MODEL1204280031/model.py
Python
cc0-1.0
427
from neuralnet.test_linalg import linalg_speed_benchmarks if __name__ == '__main__': linalg_speed_benchmarks()
joshloyal/geneva
tests/speed_benchmark.py
Python
mit
116
# # Paasmaker - Platform as a Service # # This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. # import json import time import paasmaker from paasmaker.common.controller imp...
kaze/paasmaker
paasmaker/pacemaker/controller/router.py
Python
mpl-2.0
3,257
# # Copyright 2015 Mirantis 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 writ...
pkilambi/ceilometer
ceilometer/dispatcher/resources/orchestration.py
Python
apache-2.0
973
#!/usr/bin/env python # -*- coding: utf-8 -*- import os,sys import unittest sys.path.append (os.path.join (os.path.dirname (__file__), '..')) from mavencoord import MavenCoord import mavenversioncmp as vercmp class MavenVersionCompareTest (unittest.TestCase): def testGetCanonical (self): (major, minor, rev...
pausan/python-maven
test/mavenversioncmptest.py
Python
mit
10,752
import sys from math import radians from spyce.vector import Mat4 from gspyce.graphics import * import gspyce.mesh import gspyce.textures class Scene: """A simple Scene handling zooming and camera orientation""" def __init__(self, title=b'Scene'): # default settings self.zoom = .25 se...
qsantos/spyce
gspyce/scene.py
Python
gpl-3.0
7,368
# -*- coding: utf-8 -*- from django.test.utils import override_settings import json from nose.tools import eq_, ok_ import mkt from mkt.constants.applications import DEVICE_TYPES from mkt.reviewers.models import EscalationQueue, RereviewQueue from mkt.search.utils import get_boost from mkt.site.fixtures import fixtur...
kumar303/zamboni
mkt/webapps/tests/test_indexers.py
Python
bsd-3-clause
11,222
# # Copyright (C) 2011, 2012 Pablo Barenbaum <foones@gmail.com> # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Th...
MorellatoAriel/PyGobstones
interpreter/vgbs/lang/ast.py
Python
gpl-3.0
13,806
# -*- coding: utf-8 -*- from os import path from django.conf.urls import url, include from django.utils._os import upath from django.views import defaults, i18n from . import views base_dir = path.dirname(path.abspath(upath(__file__))) media_dir = path.join(base_dir, 'media') locale_dir = path.join(base_dir, 'local...
aleksandra-tarkowska/django
tests/view_tests/urls.py
Python
bsd-3-clause
2,674
# -*- coding: iso-8859-1 -*- import os, sys import time import uuid import win32api import win32con import win32gui import win32console import win32gui from winsys import core, registry def set_console_title (text): title = win32console.GetConsoleTitle () win32console.SetConsoleTitle (text) ret...
one2pret/winsys
winsys/misc.py
Python
mit
988
from owtf.managers.resource import get_resources from owtf.plugin.helper import plugin_helper DESCRIPTION = "Plugin to assist manual testing" def run(PluginInfo): resource = get_resources("ExternalCSRF") Content = plugin_helper.resource_linklist("Online Resources", resource) return Content
owtf/owtf
owtf/plugins/web/external/Testing_for_CSRF@OWTF-SM-005.py
Python
bsd-3-clause
306
import logging import re from mvc import converter class WebM_HD(converter.FFmpegConverterInfo720p): media_type = 'format' extension = 'webm' parameters = ('-f webm -vcodec libvpx -g 120 -lag-in-frames 16 ' '-deadline good -cpu-used 0 -vprofile 0 -qmax 51 -qmin 11 ' '-s...
pculture/mirovideoconverter3
mvc/basicconverters.py
Python
gpl-3.0
4,647
# 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
tests/python/unittest/test_gluon_estimator.py
Python
apache-2.0
12,747
#!/usr/bin/python # CACConsole Copyright (C) 2015 foospidy # https://github.com/foospidy/CACConsole # See LICENSE for details # This software includes/uses the python-cloudatcost library which # is MIT licensed, see https://github.com/adc4392/python-cloudatcost/blob/master/LICENSE import os import sys from twisted.int...
foospidy/CACConsole
cacconsole.py
Python
gpl-2.0
1,460
#!/usr/bin/env python # Copyright (C) 2010-2015 Cuckoo Foundation. # This file is part of Cuckoo Sandbox - http://www.cuckoosandbox.org # See the file 'docs/LICENSE' for copying permission. import time import logging from pymongo import MongoClient from lib.cuckoomx.common.config import Config from lib.cuckoomx.core...
88d52bdba0366127fffca9dfa93895/cuckoomx
lib/cuckoomx/core/checking.py
Python
gpl-3.0
2,682
vals = {}
iitml/AL
front_end/gui/plot_vals.py
Python
gpl-2.0
10
from river.handlers.backends.loader import load_handler_backend from river.handlers.transition import PostTransitionHandler from river.models import Handler from river.services.config import RiverConfig from river.services.object import ObjectService from river.tests.services.proceeding_service_based_test import Procee...
mstzn36/django-river
river/tests/handlers/backends/test__database_handler_backend.py
Python
gpl-3.0
3,713
""" QUESTION: Note: This is an extension of House Robber. After robbing those houses on that street, the thief has found himself a new place for his thievery so that he will not get too much attention. This time, all houses at this place are arranged in a circle. That means the first house is the neighbor of the last ...
tktrungna/leetcode
Python/house-robber-ii.py
Python
mit
1,868
from flask.sessions import SessionInterface, SessionMixin from sqlalchemy.orm.attributes import flag_modified from datetime import timedelta from uuid import uuid4 from datetime import datetime from flask_sqlalchemy_session import current_session from sqlalchemy import String, Column, DateTime from sqlalchemy.dialects....
uc-cdis/flask-postgres-session
flask_postgres_session/__init__.py
Python
apache-2.0
4,067
# Empty file that nonetheless makes Django happy
duduklein/django-vinaigrette
vinaigrette/models.py
Python
bsd-3-clause
48
import unittest import os import sys # for local debugging if os.path.exists("../provisioning") is True: sys.path.insert(0, "../../") import shutil from tempfile import mkdtemp from elijah.test.util import Const as Const from elijah.test.util import VMUtility from elijah.provisioning.package import PackagingUtil ...
cmusatyalab/elijah-provisioning
elijah/test/test_base_VM.py
Python
apache-2.0
2,967
class CfpCommon(object): maxv = 0 commons = {} @staticmethod def register_common(common): v = common.version() if v > CfpCommon.maxv: CfpCommon.maxv = v CfpCommon.commons[common.version()] = common @staticmethod def get_latest_common(): ...
sitexa/scipher
cfp_common.py
Python
mit
2,408
# -*- coding: utf-8 -*- from collections import namedtuple import pytest from cartoframes.auth import Credentials from cartoframes.viz import all_publications, delete_publication, Layer, Map from cartoframes.viz.source import Source from cartoframes.viz.kuviz import KuvizPublisher, DEFAULT_PUBLIC, kuviz_to_dict from...
CartoDB/cartoframes
tests/unit/viz/test_kuviz.py
Python
bsd-3-clause
7,766
# coding=utf-8 # Copyright 2014 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). from __future__ import (absolute_import, division, generators, nested_scopes, print_function, unicode_literals, with_statement) import re from colle...
sameerparekh/pants
src/python/pants/backend/jvm/tasks/jvm_platform_analysis.py
Python
apache-2.0
19,279
# Opus/UrbanSim urban simulation software. # Copyright (C) 2005-2009 University of Washington # See opus_core/LICENSE from urbansim.datasets.building_type_dataset import BuildingTypeDataset from numpy import array class VacantLandAndBuildingTypeDataset(BuildingTypeDataset): """building_types table with a...
christianurich/VIBe2UrbanSim
3rdparty/opus/src/urbansim/datasets/vacant_land_and_building_type_dataset.py
Python
gpl-2.0
759
#!/usr/bin/env python import math def step(C) : if C == 0: return _ = input() r, c = map(int, input().split()) n = math.ceil((r+c)/2) m = r if r <= c else c d = abs(c - r) print(n) for i in range(m): print(i, i) for i in range(1, d, 2): if r < c: print(m - 1, m +...
tuestudy/ipsc
2017/A/bill/AutomatedFlooding.py
Python
mit
546
# Copyright 2022 Nisaba 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 law or agreed to in writi...
google-research/nisaba
nisaba/scripts/utils/proto.py
Python
apache-2.0
1,054
# 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 agreed to in writing, softw...
google/fuzzbench
fuzzers/glibfuzzer/fuzzer.py
Python
apache-2.0
3,179
""" This test file will test registration, login, activation, and session activity timeouts """ import time import mock import unittest from ddt import ddt, data, unpack from django.test import TestCase from django.test.utils import override_settings from django.core.cache import cache from django.conf import settings...
Learningtribes/edx-platform
cms/djangoapps/contentstore/tests/tests.py
Python
agpl-3.0
13,942
""" Team Testing Module """ import pytest import api.user import api.team import api.common import bcrypt from api.common import WebException, InternalException from common import clear_collections, ensure_empty_collections from conftest import setup_db, teardown_db class TestTeams(object): """ API Tests for...
failedxyz/picoCTF-Platform-2
api/tests/team_test.py
Python
mit
3,408
from pytz import timezone, UnknownTimeZoneError from datetime import datetime def gettime(args): """Get the time in the given timezone.""" usage = "usage: s!gettime (timezone)" if len(args[2]) != 2: return usage viewer = args[1] tz = args[2][1] try: zone = timezone(tz) ...
Shakajiub/RoboJiub
src/commands/gettime.py
Python
gpl-3.0
569
""" WSGI config for alex 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.10/howto/deployment/wsgi/ """ import os from django.core.wsgi import get_wsgi_application os.environ.setdefault("DJANGO_SETTING...
xualex/DjangoTutorial
alex/alex/wsgi.py
Python
mit
386
# -*- coding: utf-8 -*- """ Textlinks plugin """ import re from hyde.plugin import Plugin class TextlinksPlugin(Plugin): """ The plugin class for syntax text replacement. """ def __init__(self, site): super(TextlinksPlugin, self).__init__(site) def begin_text_resource(self, resource, text...
stiell/hyde
hyde/ext/plugins/textlinks.py
Python
mit
1,097
from sfepy.fem.periodic import * import sfepy.homogenization.coefs_base as cb from sfepy.homogenization.utils import define_box_regions def expand_regions( eqs, expand ): out = {} for key, val in eqs.iteritems(): out[key] = val % expand return out expr_elastic = """dw_lin_elastic.3.%s( matrix.D, P...
olivierverdier/sfepy
examples/phononic/coef_conf_elastic.py
Python
bsd-3-clause
3,994
# # Gramps - a GTK+/GNOME based genealogy program # # Copyright (C) 2000-2006 Donald N. Allingham # Copyright (C) 2011 Tim G L Lyons # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; eith...
Forage/Gramps
gramps/gui/selectors/selectorfactory.py
Python
gpl-2.0
2,120
from .. import NextGenInstanceResource, NextGenListResource from .statistics import Statistics class TaskQueue(NextGenInstanceResource): """ A TaskQueue resource """ subresources = [ Statistics, ] def delete(self): """ Delete a task queue. """ return se...
trueblue2704/AskMeAnything
lib/python2.7/site-packages/twilio/rest/resources/task_router/task_queues.py
Python
mit
2,004
import time import logging import argparse import importlib from datetime import datetime, timedelta from dateutil.parser import parse from website.app import init_app from website.settings import KEEN as keen_settings from keen.client import KeenClient logger = logging.getLogger(__name__) logging.basicConfig(level=l...
rdhyee/osf.io
scripts/analytics/base.py
Python
apache-2.0
7,942
# poisson clustering import numpy as np from scipy import sparse from .pois_ll import poisson_ll, poisson_dist eps = 1e-10 def kmeans_pp(data, k, centers=None): """ Generates kmeans++ initial centers. Args: data (array): A 2d array- genes x cells k (int): Number of clusters cent...
yjzhang/uncurl_python
uncurl/clustering.py
Python
mit
4,846
"""Tests for 'site'. Tests assume the initial paths in sys.path once the interpreter has begun executing have not been removed. """ import unittest from test.test_support import run_unittest, TESTFN, EnvironmentVarGuard from test.test_support import captured_output import __builtin__ import os import sys ...
j5shi/Thruster
pylibs/test/test_site.py
Python
gpl-2.0
15,991
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Modbus TestKit: Implementation of Modbus protocol in python (C)2009 - Luc Jean - luc.jean@gmail.com (C)2009 - Apidev - http://www.apidev.fr This is distributed under GNU LGPL license, see license.txt """ from __future__ import print_function import so...
dragondjf/QtPython
python/modbus_tk/simulator_rpc_client.py
Python
gpl-2.0
4,821
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2012, Michael DeHaan <michael.dehaan@gmail.com>, and others # (c) 2016, Toshio Kuratomi <tkuratomi@ansible.com> # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as ...
QijunPan/ansible
lib/ansible/modules/commands/command.py
Python
gpl-3.0
7,690
#!/usr/bin/python import sys import time import MPL3115A2 as altibar from ctypes import * def main(argv): print "=== MPL3115A2 Sensor demo ===" print "******************************************" AltiBar = altibar.MPL3115A2() #initialize sensor AltiBar.ActiveMode() #puts sensor in active mode id = AltiBar...
sensorian/sensorian-firmware
Drivers_Python/MPL3115A2/EX1_ThermometerDemo.py
Python
lgpl-3.0
802
import datetime from ecl.util.test import TestAreaContext from tests import ResTest from ecl.util.util import BoolVector from res.enkf import MeasBlock class MeasBlockTest(ResTest): def test_create(self): key = "OBS" ens_size = 100 obs_size = 77 ens_mask = BoolVector( default_v...
Statoil/libres
python/tests/res/enkf/test_meas_block.py
Python
gpl-3.0
2,670
"""Tests for the missions module.""" import functools import io import json import zipfile from auvsi_suas.models import test_utils from auvsi_suas.models.gps_position import GpsPosition from auvsi_suas.models.mission_config import MissionConfig from django.contrib.auth.models import User from django.test import TestC...
auvsi-suas/interop
server/auvsi_suas/views/missions_test.py
Python
apache-2.0
16,069
from config import settings from lib import geocoder def geolocate(**kwargs): geo = geocoder.Geocoder('TexasAm', {'apiKey':settings.TEXAS_AM_API_KEY}) geo.lookup(**kwargs) return geo.lat_long() def reverse_geolocate(lat, lng): geo = geocoder.Geocoder('TexasAm', {'apiKey':settings.TEXAS_AM_API_KEY}) ...
sunlightlabs/the-phantom-mask
services/geolocation_service.py
Python
mit
359
from typing import Any from django.conf import settings try: import aioredis except ImportError: use_redis = False else: # set use_redis to true, if there is a value for REDIS_ADDRESS in the settings redis_address = getattr(settings, "REDIS_ADDRESS", "") use_redis = bool(redis_address) class Re...
emanuelschuetze/OpenSlides
openslides/utils/redis.py
Python
mit
1,009
## ## $Release: 1.1.1 $ ## $Copyright: copyright(c) 2007-2012 kuwata-lab.com all rights reserved. $ ## $License: MIT License $ ## ## Permission is hereby granted, free of charge, to any person obtaining ## a copy of this software and associated documentation files (the ## "Software"), to deal in the Software without re...
groboclown/py-book-selfpub
src/selfpub/outp/template/tenjin.py
Python
apache-2.0
78,874
#!/usr/bin/env python # example menu.py import pygtk pygtk.require('2.0') import gtk class MenuExample: def __init__(self): # create a new window window = gtk.Window(gtk.WINDOW_TOPLEVEL) window.set_size_request(200, 100) window.set_title("GTK Menu Test") window.connect("de...
minghuascode/pyj
pygtkweb/demos/038-menu.py
Python
apache-2.0
3,504
# # create links for picon # usage: create_picon_links lamedb # run in picon directory. # It will read the servicenames from the lamedb and create symlinks # for the servicereference names. import os, sys f = open(sys.argv[1]).readlines() f = f[f.index("services\n")+1:-3] while len(f): ref = [int(x, 0x10) for x ...
kakunbsc/enigma2.4
tools/create_picon_links.py
Python
gpl-2.0
991
from typing import Tuple, Callable, Set, Any, TYPE_CHECKING from blueman.plugins.BasePlugin import BasePlugin import gi gi.require_version("Gtk", "3.0") from gi.repository import Gtk if TYPE_CHECKING: from blueman.main.Applet import BluemanApplet class AppletPlugin(BasePlugin): __icon__ = "blueman-plugin" ...
blueman-project/blueman
blueman/plugins/AppletPlugin.py
Python
gpl-3.0
3,035
import logging from pyvisdk.exceptions import InvalidArgumentError ######################################## # Automatically generated, do not edit. ######################################## log = logging.getLogger(__name__) def VirtualMachineConsolePreferences(vim, *args, **kwargs): '''Preferences for the legacy...
xuru/pyvisdk
pyvisdk/do/virtual_machine_console_preferences.py
Python
mit
1,181
# -*- coding: utf-8 -*- import json import os from datetime import timedelta import openprocurement.tender.openua.tests.base as base_test from openprocurement.api.models import get_now from openprocurement.api.tests.base import PrefixedRequestClass from openprocurement.tender.openua.tests.tender import BaseTenderUAWeb...
openprocurement/openprocurement.tender.openua
docs.py
Python
apache-2.0
53,394
# Copyright Iryna Vyshnevska 2020 Camptocamp # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). import odoo.tests.common as common class TestFillwithStock(common.TransactionCase): def setUp(self): super(TestFillwithStock, self).setUp() self.env = self.env( context=dict( ...
OCA/stock-logistics-warehouse
stock_move_location/tests/test_stock_fillwithstock.py
Python
agpl-3.0
2,846
# coding: utf8 { '\nDear Attendee,\n\nTo proceed with your registration and verify your email, click on the following link:\n\n%s\n\n--\n%s\n': '\nDear Attendee,\n\nTo proceed with your registration and verify your email, click on the following link:\n\n%s\n\n--\n%s\n', '\nDear Attendee,\n\nTo proceed with your registr...
bkahlerventer/web2congress
languages/sp.py
Python
bsd-3-clause
44,919
# -*- coding: utf-8 -*- import sys import os from os.path import dirname # Set the directory for using the modules in the same project such as eshop. PROJECT_PATH = dirname(os.path.abspath(os.path.dirname(__file__))) ESHOP_PATH = os.path.join(PROJECT_PATH, 'eshop/') sys.path.append(PROJECT_PATH)
mikuyves/fashion-finder
flickr/settings.py
Python
gpl-3.0
298
#!/usr/bin/env python3 # Copyright (c) 2015-2016 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. # # Test new DeepOnion multisig prefix functionality. # from test_framework.test_framework import Bitcoi...
deeponion/deeponion
test/functional/wallet_scriptaddress2.py
Python
mit
3,974
import time import os import posixpath import datetime import math import re import logging from django import template from django.utils.encoding import smart_unicode from django.utils.safestring import mark_safe from forum.models import Question, Answer, QuestionRevision, AnswerRevision, NodeRevision from django.util...
CLLKazan/iCQA
qa-engine/forum/templatetags/extra_tags.py
Python
gpl-3.0
7,925
#!/usr/bin/env python # -*- coding: utf-8 -*- try: from setuptools import setup except ImportError: from distutils.core import setup readme = open('README.rst').read() history = open('HISTORY.rst').read().replace('.. :changelog:', '') requirements = open('requirements.txt').read().splitlines() test_requireme...
JelleAalbers/plunc
setup.py
Python
mit
1,342
""" Convert the NCBI taxonomy to an SQLite database for faster access """ import os import sys import argparse import sqlite3 import json from config import get_db_dir defaultdir = get_db_dir() def connect_to_db(dbname, verbose=False): """ Connect to the database :param dbname: the database file name ...
linsalrob/PhageHosts
code/taxon/sqlite_taxon.py
Python
mit
14,692
#!/usr/bin/env python # -*- coding: UTF-8 -*- """ SYNOPSIS . DESCRIPTION EXAMPLES python inverse_document.py EXIT STATUS 0 program exit normal 1 program had problem on execution AUTHOR Theofilis George <theofilis.g@gmail.com> LICENSE This program is free software: you ca...
theofilis/tutorial-information-retrieval
read_sgml.py
Python
gpl-3.0
1,333
#!/usr/bin/env python """add DMPs to jbrowse as gff3 and bigbed files""" import argparse import os import gzip import cPickle as pickle import xml.etree.cElementTree as ET from Bio import SeqIO from nested_dict import nested_dict def parse_args(): """Parse command line arguments""" parser = argparse.ArgumentP...
thomasvangurp/epiGBS
jbrowse/add_dmp.py
Python
mit
15,139
# -*- coding: utf-8 -*- # Copyright (c) 2014 Baidu.com, 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 requi...
baidubce/bce-sdk-python
test/vpc/test_vpc_client.py
Python
apache-2.0
3,571
filename = "/home/laboratory/github/leetCode/情感分析60000/pos60000_copy.txt" fw = open(filename +"utf-8", 'wb') with open(filename, 'rb') as f: for line in f: # source encoding line = line.decode("gbk") # text # target encoding line = line.encode("utf-8") fw.write(line) ...
zhuango/python
pythonLearning/text/decodeAndEncode.py
Python
gpl-2.0
338
from MMD.Domain import domain from MMD.utils import create_file from MMD.strings import * import requests from requests.exceptions import ConnectionError, ConnectTimeout, MissingSchema from bs4 import BeautifulSoup from threading import Thread from queue import Queue import os class Downloader(domain.Downloader): ...
hXtreme/MangaDownloader
build/lib/MMD/Domain/MangaHere.py
Python
gpl-2.0
5,997
# coding=utf-8 __author__ = 'Marten Fischer (m.fischer@hs-osnabrueck.de)' from virtualisation.wrapper.abstractwrapper import AbstractComposedWrapper, AbstractWrapper from virtualisation.sensordescription import SensorDescription from virtualisation.wrapper.history.csvhistory import CSVHistoryReader from virtualisation...
CityPulse/CP_Resourcemanagement
wrapper_dev/romania_weather/romaniaweather_aw.py
Python
mit
9,102
import numpy as np import shelve import sys,os,glob,pickle,zipfile,re from urllib.request import urlretrieve from phievo.AnalysisTools import palette import matplotlib.patches as mpatches import matplotlib.pyplot as plt from matplotlib.lines import Line2D def read_network(filename,verbose=False): """Retrieve a who...
phievo/phievo
phievo/AnalysisTools/main_functions.py
Python
lgpl-3.0
7,449
# Copyright 2014 Symantec. # # 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, s...
Symantec/load-runner
load_runner/run.py
Python
apache-2.0
2,282
import collections # @include def can_string_be_a_palindrome(s): # A string can be permuted to form a palindrome if and only if the number # of chars whose frequencies is odd is at most 1. return sum(v % 2 for v in collections.Counter(s).values()) <= 1 # @exclude
meisamhe/GPLshared
Programming/MPI — AMath 483 583, Spring 2013 1.0 documentation_files/can_string_be_palindrome_hash.py
Python
gpl-3.0
278
# The base classes for Anaconda TUI Spokes # # Copyright (C) (2012) 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...
mairin/anaconda
pyanaconda/ui/tui/spokes/__init__.py
Python
gpl-2.0
12,105
#!/usr/bin/env python3 # NOTE: this example requires PyAudio because it uses the Microphone class import speech_recognition as sr # obtain audio from the microphone r = sr.Recognizer() with sr.Microphone() as source: print("Say something!") audio = r.listen(source) '''# recognize speech using Sphinx try: ...
Mathih13/IS-105_2016_Gruppe-5
Uke 7 - ICA 4/ICA 4.py
Python
mit
2,771
from __future__ import (absolute_import, division, print_function) import PyQt5.uic import sys, os import licorne.NumericParameter import numpy as np import collections ui = os.path.join(os.path.dirname(__file__), 'UI/NumericParameterWidget.ui') Ui_NumericParameter, QtBaseClass = PyQt5.uic.loadUiType(ui) class Numer...
neutrons/Licorne-Py
licorne/NumericParameterWidget.py
Python
gpl-3.0
5,632
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # code documentation build configuration file, created by # sphinx-quickstart on Thu Sep 10 12:41:08 2015. # # This file is execfile()d with the current directory set to its # containing dir. # # Note that not all possible configuration values are present in this # autog...
valentina-s/GLM_PythonModules
doc/conf.py
Python
bsd-2-clause
11,219
import numpy as np import matplotlib.pyplot as plt import scipy.io as sio from ex8_utility import * ## Machine Learning Online Class - Exercise 8: Anomaly Detection and Collaborative Filtering # Instructions # ------------ # # This file contains code that helps you get started on the # exercise. You will need to...
cameronlai/ml-class-python
solutions/ex8/ex8.py
Python
mit
4,241
"""Monitor the NZBGet API.""" import logging from homeassistant.core import callback from homeassistant.helpers.dispatcher import async_dispatcher_connect from homeassistant.helpers.entity import Entity from . import DATA_NZBGET, DATA_UPDATED _LOGGER = logging.getLogger(__name__) DEFAULT_NAME = "NZBGet" SENSOR_TYP...
qedi-r/home-assistant
homeassistant/components/nzbget/sensor.py
Python
apache-2.0
3,476
# 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 may ...
Azure/azure-sdk-for-python
sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_04_30/models/_models_py3.py
Python
mit
30,777
from __future__ import (absolute_import, division, print_function, unicode_literals) from mpl_toolkits.axisartist.axislines import *
jonyroda97/redbot-amigosprovaveis
lib/mpl_toolkits/axes_grid/axislines.py
Python
gpl-3.0
158
from __future__ import absolute_import from __future__ import print_function import itertools # general imports from builtins import zip from collections import defaultdict from qgis.PyQt.QtCore import (QObject, pyqtSignal, QVariant) from qgis.core import (QgsGeometry, QgsSpatialIndex, QgsFields, QgsField, QgsFeature...
SpaceGroupUCL/qgisSpaceSyntaxToolkit
esstoolkit/rcl_cleaner/sGraph/sGraph.py
Python
gpl-3.0
34,222
# Copyright (C) 2013 Google Inc., authors, and contributors <see AUTHORS file> # Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file> # Created By: # Maintained By: from .bootstrap import db, logger
hamyuan/ggrc-self-test
src/ggrc/__init__.py
Python
apache-2.0
225
import asyncore import unittest import select import os import socket import sys import time import warnings import errno from test import test_support from test.test_support import TESTFN, run_unittest, unlink from StringIO import StringIO try: import threading except ImportError: threading = None HOST = te...
bussiere/pypyjs
website/demo/home/rfk/repos/pypy/lib-python/2.7/test/test_asyncore.py
Python
mit
22,190
import math, random, pytest from itertools import product from src.graph.wgraph import WeightedDiGraph from src.graph.spt import Dijkstra, BellmanFord def is_shortest(spt, wdgraph): for n1 in wdgraph: # there may be several connected components if spt.costs[n1] is None: continue for n2,...
all3fox/algos-py
test/test_graph/test_spt.py
Python
mit
4,076
from permuta.misc import ordered_set_partitions, flatten from permstruct.permutation_sets import PermutationSet, StaticPermutationSet, PointPermutationSet, InputPermutationSet from permstruct import X, N, P, empty, generate_all_of_length from permuta import Permutation, Permutations from permstruct.permutation_sets im...
PermutaTriangle/PermStruct
scratch/overlays.py
Python
bsd-3-clause
2,734
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright 2009-2013 Zuza Software Foundation # # This file is part of Pootle. # # 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...
ttreeagency/PootleTypo3Org
pootle/apps/pootle_store/templatetags/store_tags.py
Python
gpl-2.0
6,952
""" Computes and plots the ROC Curve from a predictive model. ROC code from http://scikit-learn.org/0.11/auto_examples/plot_roc.html. @copyright: The Broad Institute of MIT and Harvard 2015 """ import os, random import numpy as np from matplotlib import pyplot as plt from sklearn.metrics import roc_curve, auc def r...
broadinstitute/ebola-predictor
utils/roc.py
Python
bsd-2-clause
1,516
""" Tests speech parsing """ # pylint: disable=redefined-builtin # library import unittest # module from avwx import static, structs from avwx.current.base import get_wx_codes from avwx.current.metar import parse_altimeter from avwx.parsing import core, speech class TestSpeech(unittest.TestCase): """ Tests...
flyinactor91/AVWX-Engine
tests/parsing/test_speech.py
Python
mit
10,810
# -*- coding: utf-8 -*- """ dtmovenodebyarea_dialog ``````````````````````` """ """ Part of DigitizingTools, a QGIS plugin that subsumes different tools neded during digitizing sessions * begin : 2013-08-14 * copyright : (C) 2013 by Angelos Tzotsos * email : tzotsos@gmail.com ...
qgispt/DigitizingTools
tools/dtmovenodebyarea_dialog.py
Python
gpl-2.0
1,363
""" Testing utilities for the rdb backend. This file is part of the everest project. See LICENSE.txt for licensing, CONTRIBUTORS.txt for contributor information. Created on Nov 26, 2013. """ from functools import update_wrapper from pyramid.compat import iteritems_ from pyramid.threadlocal import get_current_registr...
helixyte/everest
everest/repositories/rdb/testing.py
Python
mit
6,879
# # Copyright (c) 2008-2015 Citrix Systems, 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 l...
mahabs/nitro
nssrc/com/citrix/netscaler/nitro/resource/config/lb/lbmonbindings_binding.py
Python
apache-2.0
3,875
# -*- coding: utf-8 -*- from django.db import migrations, models # todo: remove in Spirit 0.5 def render_comments(apps, schema_editor): # This is due to a changes in the emoji renderer (images -> css) and no-follow links from ...core.utils.markdown import Markdown Comment = apps.get_model("spirit_commen...
nitely/Spirit
spirit/comment/migrations/0003_auto_20151115_0400.py
Python
mit
664
""" Discriminant analysis type classifiers """ import numpy from copy import deepcopy import warnings from pySPACE.missions.nodes.base_node import BaseNode from pySPACE.resources.data_types.prediction_vector import PredictionVector class DiscriminantAnalysisClassifierBase(BaseNode): """ Template for discriminant ...
Crespo911/pyspace
pySPACE/missions/nodes/classification/discriminant_analysis_classifier.py
Python
gpl-3.0
12,239
from peewee import * from datetime import date db = SqliteDatabase('book.db') class Book(Model): title = CharField() author = CharField() date = DateField() ISBN = CharField() ext = CharField() language = CharField() md5 = CharField() class Meta: database = db # This model use...
Propaghanda/bokhyllan
initDb.py
Python
gpl-2.0
549
''' A tool that generates FS API calls to generate a filesystem, and packages the files to work with that. This is called by emcc. You can also call it yourself. You can split your files into "asset bundles", and create each bundle separately with this tool. Then just include the generated js for each and they will l...
PopCap/GameIdea
Engine/Source/ThirdParty/HTML5/emsdk/emscripten/1.30.0/tools/file_packager.py
Python
bsd-2-clause
29,386
def f(): def g(): print("g executed\n") g() print("f executed\n") f()
pez2001/sVimPy
test_scripts/test22.py
Python
gpl-2.0
76
# coding: utf-8 """Tests for character length calculating.""" import pytest from colorclass import Color from terminaltables.width_and_alignment import align_and_pad_cell, string_width @pytest.mark.parametrize('string,expected_length', [ ('hello, world', 12), ('世界你好', 8), ('蓝色', 4), ('hello 世界', 10)...
rtulke/terminaltables
tests/test_width_and_alignment.py
Python
mit
4,838
class ObjectXEDA: kind= -1 name= '' posX= 0 posY= 0 centerX= 0 centerY= 0 w= 0 h= 0 angle= 0 selected= False mirrored= False locked= False glow= False dragging= False def is_over(self, x, y): '''responde se a coordenada indicado esta sobre esse o...
xgvargas/xeda
sw/objects.py
Python
apache-2.0
2,224
import requests class Wolf(object): ''' Wolfram|Alpha response handler ''' def __init__(self, app_id, query): ''' Initializes Wolf object ''' self.query = str(query) self.url = "http://api.wolframalpha.com/v2/query?&appid={0}&input=({1})&output=json".format(str(app_id), self.query).rep...
theshteves/tweet-the-wolf
wolf.py
Python
mit
662
def agts(queue): al = queue.add('surface.agts.py') queue.add('work_function.py', ncpus=1, deps=[al]) if __name__ == '__main__': execfile('Al100.py', {'k': 6, 'N': 5})
qsnake/gpaw
doc/exercises/surface/surface.agts.py
Python
gpl-3.0
180
"""All-in-one sgf programmatic compilation routine.""" from .parser import SensorGraphFileParser from .optimizer import SensorGraphOptimizer from .model import DeviceModel def compile_sgf(in_path, optimize=True, model=None): """Compile and optionally optimize an SGF file. Args: in_path (str): The in...
iotile/coretools
iotilesensorgraph/iotile/sg/compiler.py
Python
gpl-3.0
1,032