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
# ----------------------------------------------------------------------------- # Copyright (c) 2014--, The Qiita Development Team. # # Distributed under the terms of the BSD 3-clause License. # # The full license is in the file LICENSE, distributed with this software. # ------------------------------------------------...
ElDeveloper/qiita
qiita_pet/handlers/rest/__init__.py
Python
bsd-3-clause
1,643
# !/usr/bin/python # -*- coding: utf-8 -*- """ __title__ = '' __author__ = 'HaiFeng' __mtime__ = '2017/11/13' """ import time from .structs import IntervalType from .bar import Bar from .data import Data from .order import OrderItem class Strategy(object): '''策略类 ''' def __init__(self, dict_cfg): '''...
haifengat/hf_at_py
hfpy/strategy.py
Python
apache-2.0
6,908
# -*- coding: utf-8 -*- from south.db import db from south.v2 import SchemaMigration from django.conf import settings class Migration(SchemaMigration): def forwards(self, orm): if not db.dry_run: # For permissions to work properly after migrating moved = ['restrictedareatype', '...
johan--/Geotrek
geotrek/zoning/migrations/0002_fix_content_types.py
Python
bsd-2-clause
14,474
# ---------------------------------------------------------------------------- # pyglet # Copyright (c) 2006-2008 Alex Holkner # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # # * Redistribu...
sangh/LaserShow
pyglet-hg/experimental/mt_media/mt_app_carbon.py
Python
bsd-3-clause
9,254
""" @author: Seven Lju @date: 2016.04.27 """ constStops = [ '\n', '\t', ' ', '~', '!', '#', '$', '%', '@', '&', '*', '(', ')', '-', '=', '+', '[', ']', '{', '}', '\\', '|', '\'', '"', ';', ':', ',', '<', '.', '>', '/', '?', '^', '`' ] class TextWalker(object): def __init__(self, text, stops=constStops): ...
dna2github/dna2oldmemory
PyLangParser/source/walker.py
Python
mit
2,919
import xml.etree.ElementTree as ET import time from objects.cube.rubiks_cube import RubiksCube from objects.xml import xml_step from objects.xml.abstact_xml import AbstractXml from objects.xml.xml_cube import XmlCube from xml_step import Step from helper import Helper class XmlObject(AbstractXml): def __init__(s...
Willempie/Artificial_Intelligence_Cube
objects/xml/xml_move.py
Python
apache-2.0
3,237
import pytest from fastapi.testclient import TestClient from ...utils import needs_py310 openapi_schema = { "openapi": "3.0.2", "info": {"title": "FastAPI", "version": "0.1.0"}, "paths": { "/items/": { "get": { "responses": { "200": { ...
tiangolo/fastapi
tests/test_tutorial/test_dependencies/test_tutorial001_py310.py
Python
mit
5,538
from .autocomplete import *
vinoth3v/In_addon_thodar
thodar/page/__init__.py
Python
apache-2.0
28
# (c) Copyright 2014, University of Manchester # # This file is part of PyNSim. # # PyNSim 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 optio...
UMWRG/pynsim
examples/trivial_demo/components/node.py
Python
gpl-3.0
2,510
#!/usr/bin/env python """Flask-script management script.""" import dateutil.parser import datetime import database import math from server_common import database_session, get_mturk_connection from sqlalchemy import func, desc from flask.ext.script import Manager from admin_site import APP MANAGER = Manager(APP) ...
kmatzen/nyc3dcars-labeler
src/labeler/manage.py
Python
bsd-3-clause
10,532
# coding = utf-8 from selenium import webdriver import os import time #调入time函数 browser = webdriver.Firefox() browser.get("http://www.baidu.com") time.sleep(0.3) #休眠0.3秒 browser.find_element_by_id("kw").send_keys("selenium") browser.find_element_by_id("su").click() time.sleep(3) # 休眠3秒 print(driver.title) # 把页...
xiaoxiaoyao/PythonApplication1
PythonApplication1/爬虫练习/FIREFOX/StartFirefox.py
Python
unlicense
382
# -*- coding: utf-8 -*- # # Licensed under the terms of the PyQwt License # Copyright (C) 2003-2009 Gerard Vermeulen, for the original PyQwt example # Copyright (c) 2015 Pierre Raybaut, for the PyQt5/PySide port and further # developments (e.g. ported to python-qwt API) # (see LICENSE file for more details) import sy...
mindw/python-qwt
examples/CartesianDemo.py
Python
lgpl-2.1
3,786
from __future__ import division import patterny.synthesize.topic as _tsynthesize import patterny.ml.similarity as _similarity import requests class AnalysisRecommendation(object): def __init__(self, k, delta, n_topics, tmodel, problem_similarity_vector, analysis_similarity_map=None): self.k = k se...
marquesarthur/BugAnalysisRecommender
patterny/patterny/recommender/analysis.py
Python
mit
7,272
from __future__ import with_statement from fabric.api import task @task def locales(): """ Check locales configuration """ from fabtools import require require.system.locale('en_US.UTF-8') require.system.locale('fr_FR.UTF-8')
juanantoniofm/accesible-moodle
fabtools/tests/fabfiles/system.py
Python
gpl-2.0
255
import unittest from oscleanup.utils import * class TestUtils(unittest.TestCase): def test_fff(self): # source the creds # x = fff() self.assertIsNotNone(x)
sureshkvl/os-cleanup
oscleanup/tests/test_utils.py
Python
apache-2.0
198
import datetime from sqlalchemy import Column, Date, DateTime, ForeignKey, Integer, String, func from sqlalchemy.ext.declarative import declarative_base from sqlalchemy.ext.hybrid import hybrid_property from sqlalchemy.orm import backref, relationship Base = declarative_base() class User(Base): """Define a User...
Pegase745/sqlalchemy-datatables
tests/models.py
Python
mit
1,630
import os import tarfile from configobj import ConfigObj from twisted.internet.defer import inlineCallbacks from Tribler.Core.CacheDB.SqliteCacheDBHandler import (BasicDBHandler, LimitedOrderedDict) from Tribler.Core.CacheDB.sqlitecachedb import SQLiteCacheDB from Tribler.Core.Config.tribler_config import TriblerConf...
vandenheuvel/tribler
Tribler/Test/Core/test_sqlitecachedbhandler.py
Python
lgpl-3.0
2,757
# Author: Gorka Muñoz # Example of use of the confusion scheme introduced in https://arxiv.org/abs/1610.02048 # to differenciate phases. In this case, we will try to differentiate between two numbers # of the MNIST database. The value we get from the Linear Discriminant Analysis will make # the form of the order para...
peterwittek/qml-rg
Archiv_Session_Spring_2018/Coding_Exercises/week1_confusion_CNN.py
Python
gpl-3.0
6,200
import pytest from vcr.persisters.filesystem import FilesystemPersister from vcr.serializers import jsonserializer, yamlserializer @pytest.mark.parametrize("cassette_path, serializer", [ ('tests/fixtures/migration/old_cassette.json', jsonserializer), ('tests/fixtures/migration/old_cassette.yaml', yamlseriali...
poussik/vcrpy
tests/unit/test_persist.py
Python
mit
1,021
#This example is meant to be used from within the CadQuery module of FreeCAD. import cadquery import Part #Parameter definitions p_outerWidth = 100.0 # Outer width of box enclosure p_outerLength = 150.0 # Outer length of box enclosure p_outerHeight = 50.0 # Outer height of box enclosure p_thickness = 3.0 # Thickn...
dcowden/cadquery-freecad-module
CadQuery/Examples/Ex023_Parametric_Enclosure.py
Python
lgpl-3.0
3,817
""" AST nodes for C constructs. """ import os import types import subprocess import logging log = logging.getLogger(__name__) from ctypes import CFUNCTYPE from ctree.nodes import CtreeNode, File import ctree from ctree.util import singleton, highlight, truncate from ctree.types import get_ctype, get_common_ctype im...
mbdriscoll/ctree
ctree/c/nodes.py
Python
bsd-2-clause
17,455
# coding: utf-8 """ An API to insert and retrieve metadata on cloud artifacts. No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501 OpenAPI spec version: v1alpha1 Generated by: https://github.com/swagger-api/swagger-codegen.git """ ...
grafeas/client-python
grafeas/models/discovery_discovered_details.py
Python
apache-2.0
3,542
# coding=utf-8 # Copyright 2022 The Google Research Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicab...
google-research/google-research
readtwice/layers/embedding.py
Python
apache-2.0
4,969
# sample documentation build configuration file, created by # sphinx-quickstart on Mon Apr 16 21:22:43 2012. # # This file is execfile()d with the current directory set to its containing dir. # # Note that not all possible configuration values are present in this # autogenerated file. # # All configuration values have ...
AcademicTorrents/python-r-api
docs/conf.py
Python
mit
7,748
# # FishPi - An autonomous drop in the ocean # # Main View classes for POCV UI. # import tkFont from Tkinter import * from PIL import Image, ImageTk class MainView(Frame, object): """ MainView class for POCV UI. """ def __init__(self, master, view_controller): super(MainView, self).__init__(mas...
FishPi/FishPi-POCV---Command---Control
fishpi/ui/main_view_tk.py
Python
bsd-2-clause
13,484
# -*- coding: utf-8 -*- from ccxt.async.base.exchange import Exchange import base64 import hashlib import math import json from ccxt.base.errors import ExchangeError from ccxt.base.errors import NotSupported from ccxt.base.errors import AuthenticationError from ccxt.base.errors import InvalidOrder class gdax (Exchan...
tritoanst/ccxt
python/ccxt/async/gdax.py
Python
mit
18,421
"""Stemgraphic.graphic. Stemgraphic provides a complete set of functions to handle everything related to stem-and-leaf plots. Stemgraphic.graphic is a module implementing a graphical stem-and-leaf plot function and a stem-and-leaf heatmap plot function for numerical data. It also provides a density_plot """ import mat...
fdion/stemgraphic
stemgraphic/graphic.py
Python
mit
45,609
## # Copyright (c) 2010-2014 Apple Inc. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicab...
trevor/calendarserver
contrib/performance/httpclient.py
Python
apache-2.0
2,220
# -*- coding: utf-8 -*- # Generated by Django 1.9.6 on 2016-05-06 04:34 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): replaces = [(b'coding', '0001_initial'), (b'coding', '...
geosoco/reddit_coding
coding/migrations/0001_squashed_0003_auto_20160506_0427.py
Python
bsd-3-clause
8,587
# coding: utf-8 from __future__ import unicode_literals from .common import InfoExtractor from ..utils import ( ExtractorError, get_element_by_attribute, parse_duration, try_get, update_url_query, ) from ..compat import compat_str class USATodayIE(InfoExtractor): _VALID_URL = r'https?://(?:ww...
vinegret/youtube-dl
youtube_dl/extractor/usatoday.py
Python
unlicense
2,703
# coding: utf-8 ## Random blink # This program uses three different libraries which we must "import" before we can use them: # In[ ]: import pibrella, random, time # Next we have the program itself: # In[ ]: mychoices = ( pibrella.light.red, pibrella.light.yellow, pibrella.light.green ) for i in range(50): ...
daniel-thompson/pibrella-examples
five_liners/random_blink.py
Python
mit
2,937
from django.conf import settings from django.core.exceptions import ValidationError, ObjectDoesNotExist from rest_framework import serializers from rest_framework.fields import CharField from rest_framework.generics import get_object_or_404 from apis.betterself.v1.supplements.serializers import SupplementReadSerialize...
jeffshek/betterself
apis/betterself/v1/events/serializers.py
Python
mit
15,381
""" Django settings for issuebox project. Generated by 'django-admin startproject' using Django 1.9.3. For more information on this file, see https://docs.djangoproject.com/en/1.9/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.9/ref/settings/ """ import os f...
UKS-Tim3/Issuebox
issuebox/issuebox/settings/development.py
Python
mit
3,844
######################################################################## # $Id$ ######################################################################## __RCSID__ = "$Id$" from DIRAC import S_OK, S_ERROR, gLogger from DIRAC.DataManagementSystem.DB.FileCat...
coberger/DIRAC
DataManagementSystem/DB/FileCatalogComponents/WithFkAndPs/FileManagerPs.py
Python
gpl-3.0
30,500
# !/usr/bin/env python # -*- coding:utf-8 -*- """ @File : `$NAME.py` @Author : `long` @Date : `2016-01-08` @About : '' """ import ConfigParser import os # 读取配置文件 config_parser = ConfigParser.ConfigParser() project_path = os.path.split(os.path.realpath(__file__))[0] file_path = project_path + '/pr...
ST9527/django_game_server
configs/__init__.py
Python
gpl-2.0
470
"""Module for generating candidate k-itemsets.""" from itertools import combinations def generate_candidate_one_itemset(transactions): """Generates candidate 1-itemset.""" return {frozenset([item, item]) for item in set.union(*transactions)} def generate_candidate_itemsets(itemsets): """Generates candida...
christian-stephen/apriori-algorithm
apriori/generate_candidates.py
Python
mit
727
#!/bin/env python # vim: expandtab:tabstop=4:shiftwidth=4 # Copyright 2016 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/LICEN...
rhdedgar/openshift-tools
scripts/iam-tools/check_sso_service.py
Python
apache-2.0
5,581
from django.contrib.admin import site from girox.core.admin import CustomModelAdmin from girox.advertising.models import Advertiser class AdvertiserModelAdmin(CustomModelAdmin): list_display = ('title_tags', 'link_tags', 'admin_thumbnail') def admin_thumbnail(self, obj): return u'<img src="%s" />' % ...
sandrofolk/girox
girox/advertising/admin.py
Python
gpl-3.0
789
#!/usr/bin/env python # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "L...
renesugar/arrow
python/setup.py
Python
apache-2.0
24,250
from colorama import Style from contextlib import contextmanager from typing import Any, Dict, Iterator from queue import Queue, Empty from xml.sax.saxutils import XMLGenerator import codecs import os import sys import time import unicodedata class Logger: def __init__(self) -> None: self.logfile = os.env...
NixOS/nixpkgs
nixos/lib/test-driver/test_driver/logger.py
Python
mit
3,250
# # 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...
tgroh/incubator-beam
sdks/python/apache_beam/transforms/cy_combiners.py
Python
apache-2.0
8,141
# # Copyright (C) 2013 Mathias Weber <mathew.weber@gmail.com> # 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, # th...
mweb/appconfig
appconfig/__init__.py
Python
bsd-2-clause
1,435
# -*- coding: utf-8 -*- # vim:set shiftwidth=4 softtabstop=4 expandtab textwidth=79: from typing import Dict, Iterator, List import gdb from crash.exceptions import InvalidArgumentError, CorruptedError from crash.types.list import list_for_each_entry from crash.util import AddressSpecifier, get_typed_pointer from cr...
jeffmahoney/crash-python
crash/subsystem/cgroup/__init__.py
Python
gpl-2.0
3,342
import logging import io import unittest from samfp.io.logger import get_logger, SamFpLogFormatter class TestLogFormat(unittest.TestCase): logger_name = 'TestLogFormatApp' def setUp(self): self.formatter = SamFpLogFormatter() self.stream = io.StringIO() self.handler = logging.Stre...
b1quint/samfp
samfp/io/tests/test_logger.py
Python
bsd-3-clause
3,620
import logging import subprocess from os import path, remove, rename import tempfile from textwrap import dedent __all__ = ['call_astrometry', 'add_astrometry'] logger = logging.getLogger(__name__) def call_astrometry(filename, sextractor=False, custom_sextractor_config=False, feder_settings=Tru...
mwcraig/msumastro
msumastro/header_processing/astrometry.py
Python
bsd-3-clause
14,999
''' common XBMC Module Copyright (C) 2011 t0mm0 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...
mrknow/filmkodi
script.mrknow.urlresolver/lib/urlresolver9/lib/net.py
Python
apache-2.0
12,168
#!/usr/bin/env python3 # -*- encoding: utf-8 -*- # 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 Apach...
twitter/heron
heron/tools/tracker/src/python/handlers/logicalplanhandler.py
Python
apache-2.0
3,748
# This file is part of Korman. # # Korman 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. # # Korman is distributed i...
Deledrius/korman
korman/ui/modifiers/gui.py
Python
gpl-3.0
4,145
# Copyright (c) 2008, Aldo Cortesi. All rights reserved. # # 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 restriction, including without limitation the rights # to use, copy, modify,...
de-vri-es/qtile
libqtile/manager.py
Python
mit
63,587
#!/usr/bin/env python """ DragonPy - Simple6809 memory info ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ :created: 2013 by Jens Diemer - www.jensdiemer.de :copyleft: 2013 by the DragonPy team, see AUTHORS for more details. :license: GNU GPL v3 or above, see LICENSE for more details. """ import logging fro...
jedie/DragonPy
dragonpy/Simple6809/mem_info.py
Python
gpl-3.0
233,609
#!/usr/bin/env python # This script searches a given folder for .h5 files, loads the first ([0] index) and evaluates the test results from keras import backend as K import os import cv2 import numpy as np import sys import glob from utils import load_data_rgb, display_results_RGB, enumerate2 from keras.models import l...
charterscruz/auto-encoder-tests
evaluate_best_model_rgb_forth_scale_.py
Python
mit
3,718
#!/usr/bin/env python3 '''Fix backlinks after moving a page. Usage: {0} <page> <src> <dest> <edit-summary> [minor] Example: {0} P A B "Fix links: A was moved to B" m The example above will modify links in page P following these rules: * [A] -> [B|A] * [A|B] -> [B] * [A|C] -> [B|C] ''' import re from bot import Bot...
Arnie97/wiki-bot
backlink.py
Python
gpl-3.0
1,394
# coding: utf-8 # # Copyright 2014 The Oppia 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 requi...
mindpin/mindpin_oppia
core/platform/users/gae_current_user_services.py
Python
apache-2.0
2,327
""" Publishes the Primary Package =============================================================================== usage: orc [common-opts] publish [options] <semver> <comments> orc [common-opts] publish [options] help orc [common-opts] publish [options] Arguments: <semver> The Semantic vers...
johnttaylor/Outcast
bin/commands/publish.py
Python
bsd-3-clause
6,194
from shelf.logger_creator import LoggerCreator from shelf.hook.background.container import Container import json def execute_command(command, log_level, event, uri, meta_uri, cwd="."): """ Entry point to execute a command hook. Args: command(string) The command to execute. This can in...
not-nexus/shelf
shelf/hook/background/action.py
Python
mit
1,898
from flask import Flask from flask import jsonify, Response, render_template, abort, make_response from flask import request from cookbook_manager import CookbookManager from barista import Barista import json import httplib from threading import Thread from utils import channel from utils import json_config # ===...
Swind/TuringCoffee
src/api_server.py
Python
mit
7,419
#!/usr/bin/env python # ---------------------------------------------------------------------- # Numenta Platform for Intelligent Computing (NuPIC) # Copyright (C) 2013, Numenta, Inc. Unless you have an agreement # with Numenta, Inc., for a separate license for this software code, the # following terms and conditions ...
jkthompson/nupic
examples/opf/clients/hotgym_anomaly/hotgym_anomaly.py
Python
gpl-3.0
2,483
# -*- coding: utf-8 -*- # Generated by Django 1.11.5 on 2018-01-04 19:12 from __future__ import unicode_literals from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('infrastructure', '0004_auto_20180104_1901'), ] operations = [ migrations.RemoveFiel...
zapcoop/vertex
vertex_api/infrastructure/migrations/0005_remove_devicedefinition_subdevice_role.py
Python
agpl-3.0
418
from pypwrctrl.pypwrctrl import Plug, PlugDevice, PlugMaster
Innovailable/pypwrctrl
pypwrctrl/__init__.py
Python
gpl-3.0
61
# -*- coding: utf-8 -*- from __future__ import division, absolute_import, print_function import sys import numpy as np from numpy.testing import ( TestCase, run_module_suite, assert_, assert_equal ) class TestArrayRepr(object): def test_nan_inf(self): x = np.array([np.nan, np.inf]) assert_eq...
bringingheavendown/numpy
numpy/core/tests/test_arrayprint.py
Python
bsd-3-clause
10,221
#!/usr/bin/env python # -*- coding: utf-8 -*- # generated by wxGlade 0.6.3 on Sun Jan 31 10:48:54 2010 """ ================================== simGUI.py - Experiment Monitor GUI ================================== A basic user interface for watching the state of the robot during simulation/experiment, ...
wongkaiweng/LTLMoP
src/lib/simGUI.py
Python
gpl-3.0
19,795
#!/usr/bin/env python import os import sys if __name__ == "__main__": os.environ.setdefault("DJANGO_SETTINGS_MODULE", "clone.settings") from django.core.management import execute_from_command_line execute_from_command_line(sys.argv)
sigma-geosistemas/clone
src/manage.py
Python
lgpl-3.0
248
#!/usr/bin/env python3 # -*- encoding: utf-8 -*- import os import sys import time def findfile(start, name): for relpath, dirs, files in os.walk(start): if name in files: full_path = os.path.join(start, relpath, name) print(os.path.normpath(os.path.abspath(full_path))) def modif...
xu6148152/Binea_Python_Project
PythonCookbook/shell_system/find_file.py
Python
mit
867
#!/usr/bin/env python # -*- coding: utf-8 -*- # # RoundTM - A Round based Tournament Manager # Copyright (c) 2013 Rémi Alvergnat <toilal.dev@gmail.com> # # RoundTM is free software; you can redistribute it and/or modify it under # the terms of the Lesser GNU General Public License as published by # the Free Software Fo...
Toilal/roundtm
roundtm/console.py
Python
lgpl-3.0
1,499
import os import pymatbridge as pymat from pymatbridge.compat import text_type import numpy as np import numpy.testing as npt import test_utils as tu class TestRunCode: # Start a Matlab session before running any tests @classmethod def setup_class(cls): cls.mlab = tu.connect_to_matlab() # T...
arokem/python-matlab-bridge
pymatbridge/tests/test_run_code.py
Python
bsd-2-clause
3,685
# Given a collection of numbers that might contain duplicates, return all possible unique permutations. # For example, # [1,1,2] have the following unique permutations: # [1,1,2], [1,2,1], and [2,1,1]. class Solution: # @param {integer[]} nums # @return {integer[][]} def permuteUnique(self, nums): ...
abawchen/leetcode
solutions/047_permutations_ii.py
Python
mit
1,205
import capstone as _capstone try: import unicorn as _unicorn except ImportError: _unicorn = None from .arch import Arch # TODO: determine proper base register (if it exists) # TODO: handle multiple return registers? # TODO: which endianness should be default? class ArchARM(Arch): def __init__(self, endn...
chubbymaggie/archinfo
archinfo/arch_arm.py
Python
bsd-2-clause
8,208
#!/usr/bin/env python ''' Copyright (C) 2010 Aurelio A. Heckert, aurium (a) gmail dot 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 2 of the License, or (at your option) any late...
mattdangerw/inkscape
share/extensions/webslicer_effect.py
Python
gpl-2.0
2,071
import sys import os.path import pprint sys.path.append(os.path.abspath(__file__ + "\..\..")) import windows import windows.test import windows.debug import windows.native_exec.simple_x86 as x86 from windows.generated_def.winstructs import * class MyDebugger(windows.debug.Debugger): def __init__(self, *args, **...
hakril/PythonForWindows
samples/debug/debugger_membp_singlestep.py
Python
bsd-3-clause
2,140
# Variational Bayes for binary logistic regression # Written by Amazasp Shaumyan #https://github.com/AmazaspShumik/sklearn-bayes/blob/master/ipython_notebooks_tutorials/linear_models/bayesian_logistic_regression_demo.ipynb import superimport #from skbayes.linear_models import EBLogisticRegression,VBLogisticRegressio...
probml/pyprobml
scripts/vb_logreg_2d_demo.py
Python
mit
1,811
#! /usr/bin/env python # -*- coding: utf-8 -*- import requests import random import time from pyquery import PyQuery as pq from mongodb import db, conn from requests.exceptions import ConnectionError from chem_log import log # urls = [ # 'http://www.sigmaaldrich.com/china-mainland/zh/analytical-chromatography/ana...
mutoulbj/chem_spider
chem_spider/sigma_urls.py
Python
mit
10,348
# Copyright 2013 Nebula 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...
nttcom/eclcli
eclcli/security_order/client.py
Python
apache-2.0
1,013
#!/usr/bin/python # Copyright 2015 Huawei Devices USA 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 r...
corakwue/ftrace
ftrace/parsers/workqueue_activate_work.py
Python
apache-2.0
1,803
import _plotly_utils.basevalidators class ValuesuffixValidator(_plotly_utils.basevalidators.StringValidator): def __init__(self, plotly_name="valuesuffix", parent_name="sankey", **kwargs): super(ValuesuffixValidator, self).__init__( plotly_name=plotly_name, parent_name=parent_name,...
plotly/python-api
packages/python/plotly/plotly/validators/sankey/_valuesuffix.py
Python
mit
453
# solution for http://rosalind.info/problems/grph/ import re Strings = {} Prefixes = {} Suffixes = {} index = "" f = open('fasta.txt', 'r') for line in f: match = re.match(r">", line) #match = str(line).find(">") if match: index = line.strip() index = index[1:len(index)] Strings[index] = "" Pr...
guylaor/rosalind
strings/OverlapGraphs.py
Python
mpl-2.0
643
from setuptools import setup, find_packages version = "0.2.0" requires = [ "pyapi-gitlab==6.2.1", ] with open("README.rst") as f: readme = f.read() setup( name="git-lab", version=version, description="sub-command of git for access to gitlab", long_description=readme, author="kamekoopa", ...
kamekoopa/git-lab
setup.py
Python
apache-2.0
521
import sys import socket import string import os import traceback try: import irc.bot except ImportError: raise ImportError("Requires irclib; pip install irc") from giotto.controllers import GiottoController from giotto.exceptions import ProgramNotFound from giotto.utils import parse_kwargs irc_execution_snip...
priestc/giotto
giotto/controllers/irc_.py
Python
bsd-2-clause
5,822
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt import webnotes from webnotes import msgprint, _ import json from webnotes.utils import flt, cstr, nowdate, add_days, cint from webnotes.defaults import get_global_default from webnotes.uti...
Tejal011089/med2-app
stock/utils.py
Python
agpl-3.0
14,450
from __future__ import division ''' consensus.py This is the collation and aggregation code for the Radio Galaxy Zoo project. The main intent of the code is to take in the raw classifications generated by Ouroboros (as a MongoDB file), combine classifications by independent users, and generate a single consensus ans...
willettk/rgz-analysis
python/consensus.py
Python
mit
55,278
# Script for creating different kind of indexes in a small space as possible. # This is intended for testing purposes. import tables as tb class Descr(tb.IsDescription): var1 = tb.StringCol(itemsize=4, shape=(), dflt='', pos=0) var2 = tb.BoolCol(shape=(), dflt=False, pos=1) var3 = tb.Int32Col(shape=(), d...
avalentino/PyTables
tables/tests/create_backcompat_indexes.py
Python
bsd-3-clause
1,167
""" WSGI config for djello 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 from whitenoise.django import Django...
commoncode/djello
djello/wsgi.py
Python
mit
455
#!/usr/bin/env python # Self documented - trivial, see the source code. # Possible alternatives: jq (c, fastest). # ; jshon from sys import stdin, stdout try: # Or use anyjson. from simplejson import load, dump except ImportError: try: from json import load, dump except ImportError: #print...
alexkross/cisco_aci
json-pretty.py
Python
gpl-3.0
611
# Natural Language Toolkit: Product Reviews Corpus Reader # # Copyright (C) 2001-2015 NLTK Project # Author: Pierpaolo Pantone <24alsecondo@gmail.com> # URL: <http://nltk.org/> # For license information, see LICENSE.TXT """ CorpusReader for reviews corpora (syntax based on Customer Review Corpus). - Custome...
enriquesanchezb/practica_utad_2016
venv/lib/python2.7/site-packages/nltk/corpus/reader/reviews.py
Python
apache-2.0
12,832
from django.db import models from django.db.models import Sum, Count, QuerySet __author__ = 'lberrocal' class MaximoTimeRegisterMixin(object): def get_employee_total_regular_hours(self, employee, date): #qs = self.get_queryset() return self.filter(employee=employee, date=date).aggregate(total_reg...
luiscberrocal/homeworkpal
homeworkpal_project/maximo/managers.py
Python
mit
1,547
# -*- coding: utf-8 -*- # continued from pattern.py # defining the basic object we will be working with # Note: makeVideo - it doesn't work yet - i haven't yet solved the issues about opencv # so i am outputing the slides only for the moment # 2013-09-23 ######################...
yaukwankiu/armor
pattern2.py
Python
cc0-1.0
14,030
# Day 14: Random Quote Machine # Random Quote Machine - Program should print out quotes that have been stored randomly. # You don't need to use any API. Store some quotes in your program, # and print one at random each time the program executes. import random quotes = { 0: { 'quote': "Strive not to be ...
ConsonanceNg/100_Days_of_code_submissions
submissions/faeludire/Day_14/random_quote_machine.py
Python
mit
1,266
import sys import os import numpy as np data_dir = sys.argv[1] filenames = os.listdir(data_dir) timeseries = [] preprocessing = np.load('model/preprocessing.npz') timeseries_means = preprocessing['means'] timeseries_stds = preprocessing['stds'] change = preprocessing['change'] print "Reading files from", data_dir ...
jrieke/timeseries-rnn
predict.py
Python
mit
2,936
# -*- coding: utf-8 -*- from django.contrib.auth import login from django.shortcuts import redirect, get_object_or_404 from django.contrib.auth.decorators import login_required from annoying.decorators import render_to from django.contrib.auth.models import User from Aluno.models import Aluno from Professor.models i...
arruda/amao
AMAO/apps/Core/views.py
Python
mit
2,266
# -*- coding: utf-8 -*- # import numpy as _np # import pandas as _pd # import os as _os # import atmPy.general.timeseries as _timeseries # import atmPy.aerosols.physics.column_optical_properties as _column_optical_properties import atmPy.general.measurement_site as _measurement_site # import pathlib # import warnings a...
hagne/atm-py
atmPy/data_archives/NOAA_ESRL_GMD_GRAD/baseline/baseline.py
Python
mit
1,433
input = """ a | b. a :- b. b :- a. """ output = """ {a, b} """
Yarrick13/hwasp
tests/asp/gringo/modelchecker.015.test.py
Python
apache-2.0
63
import collections import math from django.db import models from django.urls import reverse import data.models class AndalusianStyle(object): def get_style(self): return "andalusian" def get_object_map(self, key): return {"performance": InstrumentPerformance, "release": Alb...
MTG/dunya
andalusian/models.py
Python
agpl-3.0
14,269
import setuptools import glob import os with open("README.rst", "r") as fh: long_description = fh.read() datafiles = [('fixgw/config', ['config/default.yaml', 'config/default.db', 'config/default.ini','config/fg_172.ini']), ('fixgw/config/canfix', ['config/canfix/map.yaml']), # ('share/fi...
birkelbach/FIX-Gateway
setup.py
Python
gpl-2.0
1,501
# Copyright 2015 Michael Rice <michael@michaelrice.org> # # 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 a...
virtdevninja/steel_pigs
steel_pigs/tests/test_flask_app.py
Python
apache-2.0
3,200
""" WSGI config for cloudlynt project. This module contains the WSGI application used by Django's development server and any production WSGI deployments. It should expose a module-level variable named ``application``. Django's ``runserver`` and ``runfcgi`` commands discover this application via the ``WSGI_APPLICATION`...
drunken-pypers/cloudlynt
cloudlynt/wsgi.py
Python
mit
1,140
__version__ = "0.0.1a"
kevin-brown/drf-nested-viewsets
rest_nested_viewsets/__init__.py
Python
mit
23
""" NetCDF reader/writer module. This module is used to read and create NetCDF files. NetCDF files are accessed through the `netcdf_file` object. Data written to and from NetCDF files are contained in `netcdf_variable` objects. Attributes are given as member variables of the `netcdf_file` and `netcdf_variable` objects...
sargas/scipy
scipy/io/netcdf.py
Python
bsd-3-clause
30,912
"""helicopter URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/1.10/topics/http/urls/ Examples: Function views 1. Add an import: from my_app import views 2. Add a URL to urlpatterns: url(r'^$', views.home, name='home') Class...
georgesk/helicopter
helicopter/urls.py
Python
gpl-3.0
1,175
import scrapy from scrapy_splash import SplashRequest from w3lib.http import basic_auth_header class QuotesJs2Spider(scrapy.Spider): """Example spider using Splash to render JavaScript-based pages. Make sure you configure settings.py with your Splash credentials (available on Scrapy Cloud). """ ...
fpldataspiders/SPIDERS
splash_based_project/splash_based_project/spiders/quotes-js-2.py
Python
mit
1,239
# -*- coding: utf-8 -*- # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl from . import mod111
RamonGuiuGou/l10n-spain
l10n_es_aeat_mod111/models/__init__.py
Python
agpl-3.0
108
#!/usr/bin/python3 """ run_weatherlight.py Version 1.0 www.henryleach.com Script to collect weather data from wunderground.com and set an LED colour and pattern that hopefully gives and intuative impression for the weather forecast. Frequency and intensity of (white) pulses represent precipitation, base colour is tempe...
henryleach/lampi
run_weatherlight.py
Python
mit
5,564