text stringlengths 6 947k | repo_name stringlengths 5 100 | path stringlengths 4 231 | language stringclasses 1
value | license stringclasses 15
values | size int64 6 947k | score float64 0 0.34 |
|---|---|---|---|---|---|---|
#!/usr/bin/env python
import bottle
from bottle import (
get,
run,
abort,
static_file,
template
)
import thisplace
example_locs = [("sydney", (-33.867480754852295, 151.20700120925903)),
("battery", (40.70329427719116, -74.0170168876648)),
("san_fran", (37.79011487... | amueller/ThisPlace | app.py | Python | mit | 1,992 | 0.006024 |
from decouple import config
from selenium import webdriver
HOME = config('HOME')
# page = webdriver.Firefox()
page = webdriver.Chrome(executable_path=HOME + '/chromedriver/chromedriver')
page.get('http://localhost:8000/admin/login/')
# pegar o campo de busca onde podemos digitar algum termo
campo_busca = page.find_el... | rg3915/orcamentos | selenium/selenium_login.py | Python | mit | 613 | 0 |
# -*- coding: UTF-8 -*-
import datetime
import json
import logging
import re
from mercado.core.base import Mercado
from mercado.core.common import nt_merge
log = logging.getLogger(__name__)
class Safeway(Mercado):
def __init__(self, auth, urls, headers, sleep_multiplier=1.0):
self.auth = auth
se... | furritos/mercado-api | mercado/core/safeway.py | Python | mit | 6,259 | 0.003834 |
class Solution(object):
def myGCD(self, x, y):
if y == 0:
return x
else:
return self.myGCD(y, x % y)
def canMeasureWater(self, x, y, z):
"""
:type x: int
:type y: int
:type z: int
:rtype: bool
"""
if x == 0 and y ==... | hawkphantomnet/leetcode | WaterAndJugProblem/Solution.py | Python | mit | 545 | 0 |
#
# rtlsdr_scan
#
# http://eartoearoak.com/software/rtlsdr-scanner
#
# Copyright 2012 - 2017 Al Brown
#
# A frequency scanning GUI for the OsmoSDR rtl-sdr library at
# http://sdr.osmocom.org/trac/wiki/rtl-sdr
#
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Gene... | EarToEarOak/RTLSDR-Scanner | setup.py | Python | gpl-3.0 | 2,016 | 0.001488 |
# 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.
"""
See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts
for more details on the presubmit API built into depot_tools.
"""
def Ch... | Chilledheart/chromium | tools/valgrind/drmemory/PRESUBMIT.py | Python | bsd-3-clause | 1,175 | 0.009362 |
import unittest, time, sys
sys.path.extend(['.','..','../..','py'])
import h2o, h2o_cmd, h2o_browse as h2b, h2o_import as h2i
class Basic(unittest.TestCase):
def tearDown(self):
h2o.check_sandbox_for_errors()
@classmethod
def setUpClass(cls):
# assume we're at 0xdata with it's hdfs namenod... | rowhit/h2o-2 | py/testdir_0xdata_only/test_hdfs_multi_copies.py | Python | apache-2.0 | 1,029 | 0.013605 |
import unittest
from charlesbot.util.parse import parse_msg_with_prefix
class TestMessageParser(unittest.TestCase):
def test_prefix_uppercase(self):
msg = "!ALL hi, there!"
retval = parse_msg_with_prefix("!all", msg)
self.assertEqual("hi, there!", retval)
def test_prefix_mixed(self):... | marvinpinto/charlesbot | tests/util/parse/test_message_parser.py | Python | mit | 1,817 | 0 |
"""
This module contains the default values for all settings used by Scrapy.
For more information about these settings you can read the settings
documentation in docs/topics/settings.rst
Scrapy developers, if you add a setting here remember to:
* add it in alphabetical order
* group similar settings without leaving ... | starrify/scrapy | scrapy/settings/default_settings.py | Python | bsd-3-clause | 9,161 | 0.000982 |
# force floating point division. Can still use integer with //
from __future__ import division
# This file is used for importing the common utilities classes.
import numpy as np
import matplotlib.pyplot as plt
import sys
sys.path.append("../../../../../../")
from Util import Test
from Util.Test import _f_assert,Hummer... | prheenan/BioModel | EnergyLandscapes/InverseWeierstrass/Python/TestExamples/Testing/MainTestingWeightedHistograms.py | Python | gpl-2.0 | 747 | 0.013387 |
# Copyright 2013-2021 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from os import chmod
from spack import *
class Tbl2asn(Package):
"""Tbl2asn is a command-line program that automate... | LLNL/spack | var/spack/repos/builtin/packages/tbl2asn/package.py | Python | lgpl-2.1 | 866 | 0.002309 |
# -*- coding: utf-8 -*-
from __future__ import print_function
import re
import sys
from datetime import datetime, timedelta
import pytest
import numpy as np
import pandas as pd
import pandas.compat as compat
from pandas.core.dtypes.common import (
is_object_dtype, is_datetimetz,
needs_i8_conversion)
import pa... | zfrenchee/pandas | pandas/tests/test_base.py | Python | bsd-3-clause | 43,476 | 0 |
# Copyright 2022 The Magenta 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 ... | magenta/magenta | magenta/models/onsets_frames_transcription/infer_util_test.py | Python | apache-2.0 | 1,356 | 0.001475 |
#!/usr/bin/python
# Author: Jon Trulson <jtrulson@ics.com>
# Copyright (c) 2016 Intel Corporation.
#
# 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 l... | whbruce/upm | examples/python/bmx055.py | Python | mit | 2,781 | 0.001798 |
"""
Special purpose k - medoids algorithm
"""
import numpy as np
def fit(sim_mat, D_len, cidx):
"""
Algorithm maximizes energy between clusters, which is distinction in this algorithm. Distance matrix contains mostly 0, which are overlooked due to search of maximal distances. Algorithm does not try to retai... | romanorac/discomll | discomll/ensemble/core/k_medoids.py | Python | apache-2.0 | 1,504 | 0.001995 |
import os
from pyjs import linker
from pyjs import translator
from pyjs import util
from optparse import OptionParser
import pyjs
PLATFORM='spidermonkey'
APP_TEMPLATE = """
var $wnd = new Object();
$wnd.document = new Object();
var $doc = $wnd.document;
var $moduleName = "%(app_name)s";
var $pyjs = new Object();
$pyj... | andreyvit/pyjamas | pyjs/src/pyjs/sm.py | Python | apache-2.0 | 5,725 | 0.003493 |
import time
from django import forms
from django.forms.util import ErrorDict
from django.conf import settings
from django.contrib.contenttypes.models import ContentType
from django.utils.crypto import salted_hmac, constant_time_compare
from django.utils.encoding import force_text
from django.utils.text import get_text_... | boldprogressives/django-opendebates | opendebates/opendebates_comments/forms.py | Python | apache-2.0 | 7,408 | 0.006479 |
'''
This module should be run to recreate the files that we generate automatically
(i.e.: modules that shouldn't be traced and cython .pyx)
'''
from __future__ import print_function
import os
import struct
def is_python_64bit():
return (struct.calcsize('P') == 8)
root_dir = os.path.join(os.path.dirname(__file... | idea4bsd/idea4bsd | python/helpers/pydev/build_tools/generate_code.py | Python | apache-2.0 | 5,381 | 0.003531 |
#
# Copyright (c) 2015 Juniper Networks, Inc. All rights reserved.
#
from gevent import monkey
monkey.patch_all()
from pysandesh.sandesh_base import sandesh_global
from sandesh_common.vns.ttypes import Module
from nodemgr.common.event_manager import EventManager, EventManagerTypeInfo
class ConfigEventManager(EventM... | eonpatapon/contrail-controller | src/nodemgr/config_nodemgr/event_manager.py | Python | apache-2.0 | 616 | 0.006494 |
##############################################################################
#
# OSIS stands for Open Student Information System. It's an application
# designed to manage the core business of higher education institutions,
# such as universities, faculties, institutes and professional schools.
# The core ... | uclouvain/osis | program_management/ddd/repositories/program_tree_version.py | Python | agpl-3.0 | 19,400 | 0.002165 |
#!/usr/bin/env python
# Copyright 2009-2014 Eucalyptus 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 app... | nephomaniac/eucio | eucio/topology/userfacing/__init__.py | Python | apache-2.0 | 611 | 0.001637 |
# -*- coding: utf-8 -*-
"""
"""
from __future__ import unicode_literals
import logging
import os
import hashlib
logger = logging.getLogger(__name__)
_log = "pelican_comment_system: avatars: "
try:
from . identicon import identicon
_identiconImported = True
except ImportError as e:
logger.warning(_log + "identi... | znegva/pelican-plugins | pelican_comment_system/avatars.py | Python | agpl-3.0 | 2,305 | 0.023861 |
'''
Created on Nov 10, 2014
@author: lauritz
'''
from mock import Mock
from fakelargefile.segmenttail import OverlapSearcher
def test_index_iter_stop():
os = OverlapSearcher("asdf")
segment = Mock()
segment.start = 11
try:
os.index_iter(segment, stop=10).next()
except ValueError:
... | LauritzThaulow/fakelargefile | tests/test_segmenttail.py | Python | agpl-3.0 | 365 | 0 |
#### NOTICE: THIS FILE IS AUTOGENERATED
#### MODIFICATIONS MAY BE LOST IF DONE IMPROPERLY
#### PLEASE SEE THE ONLINE DOCUMENTATION FOR EXAMPLES
from swgpy.object import *
def create(kernel):
result = Static()
result.template = "object/static/structure/general/shared_palette_supply_01.iff"
result.attribute_templa... | anhstudios/swganh | data/scripts/templates/object/static/structure/general/shared_palette_supply_01.py | Python | mit | 455 | 0.048352 |
# -*- coding: utf-8 -*-
# Copyright (C) Duncan Macleod (2013)
#
# This file is part of GWSumm.
#
# GWSumm 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) ... | duncanmmacleod/gwsumm | gwsumm/plot/__init__.py | Python | gpl-3.0 | 1,636 | 0 |
"""Integration project URL Configuration"""
from django.contrib import admin
from django.urls import re_path
from django.views.generic import TemplateView
urlpatterns = [
re_path(r"^admin/", admin.site.urls),
re_path(
r"^$", TemplateView.as_view(template_name="home.html"), name="home"
),
]
| jambonsw/django-improved-user | example_integration_project/config/urls.py | Python | bsd-2-clause | 312 | 0 |
# -*- coding: utf8 -*-
# Copyright (c) 2017-2021 THL A29 Limited, a Tencent company. 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... | tzpBingo/github-trending | codespace/python/tencentcloud/ie/v20200304/models.py | Python | mit | 146,031 | 0.003101 |
# -*- coding: utf-8 -*-
import collections
class InvalidOperatorError(ValueError):
pass
class DuplicateFieldError(ValueError):
pass
class FieldDict(dict):
def __setitem__(self, k, v):
if k in self:
raise DuplicateFieldError('Field "{0}" already set.'.format(k))
super(Field... | voxelbrain/dibble | dibble/update.py | Python | bsd-3-clause | 2,635 | 0.000759 |
# -*- python -*-
# Package : omniidl
# template.py Created on: 2000/01/18
# Author : David Scott (djs)
#
# Copyright (C) 2003-2008 Apasphere Ltd
# Copyright (C) 1999 AT&T Laboratories Cambridge
#
# This file is part of omniidl.
#
# omniidl is free software; you... | ogata-lab/rtmsdk-mac | x86_64/lib/python2.7/site-packages/omniidl_be/cxx/header/template.py | Python | lgpl-2.1 | 39,776 | 0.001282 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Multiple documentation build configuration file, created by
# sphinx-quickstart on Thu Apr 14 09:34:49 2016.
#
# 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
# a... | Wevolver/HAVE | docs/source/conf.py | Python | gpl-3.0 | 9,459 | 0.006026 |
sum = 0
for i in range(1, 1000):
if i % 3 == 0 or i % 5 == 0:
sum += i
print sum
| huangshenno1/algo | project_euler/1.py | Python | mit | 84 | 0.02381 |
"""
Django rules for student roles
"""
from __future__ import absolute_import
import rules
from lms.djangoapps.courseware.access import has_access
from openedx.core.djangoapps.waffle_utils import CourseWaffleFlag, WaffleFlag, WaffleFlagNamespace
from .roles import CourseDataResearcherRole
# Waffle flag to enable th... | cpennington/edx-platform | common/djangoapps/student/rules.py | Python | agpl-3.0 | 894 | 0.004474 |
#### NOTICE: THIS FILE IS AUTOGENERATED
#### MODIFICATIONS MAY BE LOST IF DONE IMPROPERLY
#### PLEASE SEE THE ONLINE DOCUMENTATION FOR EXAMPLES
from swgpy.object import *
def create(kernel):
result = Tangible()
result.template = "object/tangible/component/weapon/shared_projectile_feed_mechanism.iff"
result.attri... | obi-two/Rebelion | data/scripts/templates/object/tangible/component/weapon/shared_projectile_feed_mechanism.py | Python | mit | 498 | 0.044177 |
"""
Entry point to API application. This will be for running simple checks on the application
"""
from flask import jsonify, url_for, redirect, request
from flask_login import current_user
from . import home
from ..__meta__ import __version__, __project__, __copyright__
@home.route("")
@home.route("home")
@home.rout... | BrianLusina/Arco | server/app/mod_home/views.py | Python | mit | 557 | 0.001795 |
from django.contrib import messages
from django.views.generic.base import ContextMixin
from edc_constants.constants import OPEN
from ..models import DataActionItem
from ..model_wrappers import DataActionItemModelWrapper
from .user_details_check_view_mixin import UserDetailsCheckViewMixin
class DataActionItemsViewMi... | botswana-harvard/edc-data-manager | edc_data_manager/view_mixins/data_manager_view_mixin.py | Python | gpl-2.0 | 2,162 | 0 |
#
# 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
# ... | dims/heat | heat/tests/convergence/scenarios/update_replace_rollback.py | Python | apache-2.0 | 1,550 | 0.000645 |
"""
"""
import os
import pandas
from matplotlib import pyplot
from matplotlib import dates as mdates
import matplotlib.ticker as mticker
PROCESSED_DATA_DIR = os.path.join(
os.path.dirname(os.path.realpath(__file__)),
os.pardir,
"processed_data"
)
def insert_nans(station_df):
"""
Only when NaNs... | 1kastner/analyse_weather_data | plot_weather_data/__init__.py | Python | agpl-3.0 | 1,869 | 0.003215 |
# Touchy is Copyright (c) 2009 Chris Radek <chris@timeguy.com>
#
# Touchy is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 2 of the License, or
# (at your option) any later version.
#
# Touchy i... | CalvinHsu1223/LinuxCNC-EtherCAT-HAL-Driver | src/emc/usr_intf/touchy/mdi.py | Python | gpl-2.0 | 10,007 | 0.006196 |
#!/usr/bin/env python
# Copyright 2014 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.
"""Generate a spatial analysis against an arbitrary library.
To use, build the 'binary_size_tool' target. Then run this tool, passing
... | hgl888/chromium-crosswalk-efl | tools/binary_size/run_binary_size_analysis.py | Python | bsd-3-clause | 35,816 | 0.010051 |
# -*- coding: utf-8 -*-
#
# Tutorial documentation build configuration file, created by
# sphinx-quickstart on Thu Dec 8 12:57:03 2011.
#
# 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.
#
# Al... | qunying/gps | docs/tutorial/conf.py | Python | gpl-3.0 | 8,459 | 0.006975 |
from aiohttp.web import View, HTTPFound
def http_found(func):
async def wrapped(self, *args, **kwargs):
await func(self, *args, **kwargs)
return HTTPFound(self.request.rel_url)
return wrapped
class CoreView(View):
sensor = None
def __init__(self, *args, **kwargs):
super()._... | insolite/alarme | alarme/extras/sensor/web/views/core.py | Python | mit | 386 | 0 |
"""
Tests for Discussion API serializers
"""
from __future__ import absolute_import
import itertools
import ddt
import httpretty
import mock
import six
from django.test.client import RequestFactory
from six.moves.urllib.parse import urlparse # pylint: disable=import-error
from lms.djangoapps.discussion.django_comme... | ESOedX/edx-platform | lms/djangoapps/discussion/rest_api/tests/test_serializers.py | Python | agpl-3.0 | 34,613 | 0.001416 |
from setuptools import setup
# Replace the place holders with values for your project
setup(
# Do not use underscores in the plugin name.
name='custom-wf-plugin',
version='0.1',
author='alien',
author_email='alien@fastconnect.fr',
description='custom generated workflows',
# This must co... | victorkeophila/alien4cloud-cloudify3-provider | src/test/resources/outputs/blueprints/openstack/tomcat/plugins/custom_wf_plugin/setup.py | Python | apache-2.0 | 650 | 0.001538 |
#Created on 14 Aug 2014
#@author: neil.butcher
from PySide2 import QtCore, QtWidgets
from pyqt_units.CurrentUnitSetter import setter
class UnitDisplay(QtWidgets.QWidget):
def __init__(self, parent, measurement=None, measurementLabel='normal'):
QtWidgets.QWidget.__init__(self, parent)
self.layo... | ergoregion/pyqt-units | pyqt_units/MeasurementWidgets.py | Python | mit | 6,390 | 0.002191 |
#----------------------------------------------------------------------
# Copyright (c) 2008 Board of Trustees, Princeton University
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and/or hardware specification (the "Work") to
# deal in the Work without restriction, i... | onelab-eu/sfa | sfa/util/xrn.py | Python | mit | 10,231 | 0.010849 |
"""Hello World API implemented using Google Cloud Endpoints.
Contains declarations of endpoint, endpoint methods,
as well as the ProtoRPC message class and container required
for endpoint method definition.
"""
import endpoints
from protorpc import messages
from protorpc import message_types
from protorpc import remot... | paul-jean/ud858 | Lesson_2/000_Hello_Endpoints/helloworld_api.py | Python | gpl-3.0 | 1,742 | 0.012055 |
"""
Dictionary with lazy evaluation on access, via a supplied update function
"""
import itertools
class LazyDict(dict):
"""
A dictionary type that lazily updates values when they are accessed.
All the usual dictionary methods work as expected, with automatic lazy
updates occuring behind the scen... | vikramsunkara/PyME | pyme/lazy_dict.py | Python | agpl-3.0 | 3,974 | 0.007549 |
VERSION = (2, 0, 4, 'final', 0)
def get_version():
"""
Returns a PEP 386-compliant version number from VERSION.
"""
assert len(VERSION) == 5
assert VERSION[3] in ('alpha', 'beta', 'rc', 'final')
# Now build the two parts of the version number:
# main = X.Y[.Z]
# sub = .devN - for pre... | opencloudinfra/orchestrator | venv/Lib/site-packages/registration/__init__.py | Python | gpl-3.0 | 666 | 0 |
import logging
import os
from lib.Settings import Settings
from lib.Wrappers.NullLogger import NullLogger
class Logger:
def __init__(self, name):
if 'UNITTESTING' in os.environ:
self.logging = NullLogger()
else:
settings = Settings().getSettings()
logging.basicC... | Open365/Open365 | lib/Wrappers/Logger.py | Python | agpl-3.0 | 1,007 | 0.000993 |
from epumgmt.api.actions import ACTIONS
from epumgmt.main import ControlArg
import optparse
a = []
ALL_EC_ARGS_LIST = a
################################################################################
# EM ARGUMENTS
#
# The following cmdline arguments may be queried via Parameters, using either
# the 'name' as the ar... | nimbusproject/epumgmt | src/python/epumgmt/main/em_args.py | Python | apache-2.0 | 3,947 | 0.00532 |
import pingo
'''
In order to use this set of cases, it is necessary to set
the following attributes on your TestCase setUp:
self.analog_input_pin_number = 0
self.expected_analog_input = 1004
self.expected_analog_ratio = 0.98
'''
class AnalogReadBasics(object):
'''
Wire a 10K Ohm resistence fr... | garoa/pingo | pingo/test/level1/cases.py | Python | mit | 1,331 | 0.000751 |
#!/usr/bin/env python
import sys
import argparse
import os
import unittest2 as unittest
from ruamel import yaml
from smacha.util import Tester
import rospy
import rospkg
import rostest
ROS_TEMPLATES_DIR = '../src/smacha_ros/templates'
TEMPLATES_DIR = 'smacha_templates/smacha_test_examples'
WRITE_OUTPUT_FILES = Fa... | ReconCell/smacha | smacha_ros/test/smacha_diff_test_examples.py | Python | bsd-3-clause | 3,604 | 0.003607 |
import datetime
import math
import time
import ephem
from PyQt5 import QtCore
from src.business.EphemObserverFactory import EphemObserverFactory
from src.business.configuration.configProject import ConfigProject
from src.business.configuration.settingsCamera import SettingsCamera
from src.business.consoleThreadOutput... | pliniopereira/ccd10 | src/business/shooters/EphemerisShooter.py | Python | gpl-3.0 | 6,596 | 0.001365 |
from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..compat import (
compat_str,
compat_urlparse,
)
from ..utils import (
ExtractorError,
determine_ext,
int_or_none,
sanitized_Request,
)
class VoiceRepublicIE(InfoExtractor):
_VALID_URL = r'https?://voicerepublic\.com/(?:... | valmynd/MediaFetcher | src/plugins/youtube_dl/youtube_dl/extractor/voicerepublic.py | Python | gpl-3.0 | 3,272 | 0.025978 |
# Copyright 2018-present Facebook, 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 i... | brettwooldridge/buck | programs/buck_project.py | Python | apache-2.0 | 6,332 | 0.000632 |
import asyncio
import datetime
import json
from collections import Counter, defaultdict
from pathlib import Path
from typing import Mapping
import aiohttp
import discord
from redbot.core import Config
from redbot.core.bot import Red
from redbot.core.commands import Cog
from redbot.core.data_manager import cog_data_p... | palmtree5/Red-DiscordBot | redbot/cogs/audio/core/__init__.py | Python | gpl-3.0 | 5,241 | 0.000382 |
# Copyright 2018 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applic... | chemelnucfin/tensorflow | tensorflow/python/data/experimental/kernel_tests/csv_dataset_test.py | Python | apache-2.0 | 20,082 | 0.004531 |
from scraper import *
WD2_url = "http://www.cms-ud.com/UD/table/WD2.htm"; crit_name_WD2 = "WD2/"
WD2_list = find_urls(url=WD2_url,crit_name=crit_name_WD2)
for url in WD2_list:
try:
url = url.replace('^','%5E')
url = "http://www.cms-ud.com/UD/table/"+url
design = find_design(url)
#pr... | HAOYU-LI/UniDOE | Scraper/WD2.py | Python | apache-2.0 | 590 | 0.020339 |
# -*- coding: utf-8 -*-
# Copyright 2022 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | googleapis/python-aiplatform | samples/generated_samples/aiplatform_v1_generated_metadata_service_create_context_sync.py | Python | apache-2.0 | 1,468 | 0.000681 |
# Copyright 2021 The TensorFlow 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 ... | tensorflow/similarity | tensorflow_similarity/stores/__init__.py | Python | apache-2.0 | 1,292 | 0.000774 |
#
# Copyright 2014 Telefonica Investigacion y Desarrollo, S.A.U
#
# 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 unde... | telefonicaid/fiware-keystone-spassword | keystone_spassword/tests/unit/contrib/spassword/test_checker.py | Python | apache-2.0 | 1,246 | 0.002408 |
# -*- coding: utf-8 -*-
__author__ = 'Tom Chen'
import urllib2,sys,re,time
from sgmllib import SGMLParser
from datetime import datetime,date
from urllib import unquote,quote
default_encoding = 'utf-8' #设置文件使用UTF-8编码
if sys.getdefaultencoding() != default_encoding:
reload(sys)
sys.setde... | cwdtom/qqbot | tom/findbilibili.py | Python | gpl-3.0 | 4,769 | 0.009097 |
# (C) British Crown Copyright 2010 - 2014, Met Office
#
# This file is part of Iris.
#
# Iris is free software: you can redistribute it and/or modify it under
# the terms of the GNU Lesser General Public License as published by the
# Free Software Foundation, either version 3 of the License, or
# (at your option) any l... | Jozhogg/iris | tools/generate_std_names.py | Python | lgpl-3.0 | 4,434 | 0.001579 |
# 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... | rh-s/heat | heat_integrationtests/scenario/test_ceilometer_alarm.py | Python | apache-2.0 | 2,412 | 0 |
import decimal
from datetime import datetime
from django.conf import settings
from django.conf.urls import url, include
from pinax.stripe.forms import PlanForm
from .base import ViewConfig
invoices = [
dict(date=datetime(2017, 10, 1), subscription=dict(plan=dict(name="Pro")), period_start=datetime(2017, 10, 1),... | pinax/pinax_theme_tester | pinax_theme_tester/configs/stripe.py | Python | mit | 3,913 | 0.0046 |
"""
Derived module from filehandler.py to handle STereoLithography files.
"""
import numpy as np
from mpl_toolkits import mplot3d
from matplotlib import pyplot
from stl import mesh, Mode
import pygem.filehandler as fh
class StlHandler(fh.FileHandler):
"""
STereoLithography file handler class
:cvar string infile: ... | fsalmoir/PyGeM | pygem/stlhandler.py | Python | mit | 3,986 | 0.032614 |
# $Id$
# importing this module shouldn't directly cause other large imports
# do large imports in the init() hook so that you can call back to the
# ModuleManager progress handler methods.
"""vtk_kit package driver file.
This performs all initialisation necessary to use VTK from DeVIDE. Makes
sure that all VTK clas... | nagyistoce/devide | module_kits/vtk_kit/__init__.py | Python | bsd-3-clause | 3,965 | 0.003279 |
# Patchwork - automated patch tracking system
# Copyright (C) 2008 Jeremy Kerr <jk@ozlabs.org>
# Copyright (C) 2015 Intel Corporation
#
# This file is part of the Patchwork package.
#
# Patchwork is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published ... | ivyl/patchwork | patchwork/models.py | Python | gpl-2.0 | 33,987 | 0.000382 |
# -*- coding: utf-8 -*-
# Define here the models for your scraped items
#
# See documentation in:
# http://doc.scrapy.org/en/latest/topics/items.html
import scrapy
import scrapy.log
import datetime
def now():
return datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S")
class JmProductItem(scrapy.Item):
# d... | GordonWang/JM-VIP | JMVIPCrawler/items.py | Python | apache-2.0 | 7,573 | 0.015325 |
howmany = input("How many numbers are you using?: ")
count = howmany
num = []
while count > 0:
for i in howmany:
x = input("Insert number ",i,": ")
num.append(x)
count -= 1
def sort(num):
size = len(num)
for i in range(size):
for j in range(size-i-1):
if(num[j] ... | cheesyc/basicpython | mmm.py | Python | mit | 628 | 0.017516 |
import os
from record import Record
from timeutils import isodate
from git import Git
import applib
import re
class XmlStorage:
""" XML storage engine for the record
"""
@staticmethod
def setup(dataDir):
engineDir = os.path.join(dataDir, 'xml')
os.makedirs(engineDir, exist_ok=True)
... | iesugrace/log-with-git | xmlstorage.py | Python | gpl-2.0 | 13,529 | 0.001626 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import print_function
from glob import glob
import os
import sys
from setuptools import setup, Extension
from Cython.Build import cythonize
if sys.version_info[:2] < (2, 7):
print(
'nxcpy requires Python version 2.7 or later' +
' ({}.{... | OrkoHunter/nxcpy | setup.py | Python | bsd-3-clause | 1,193 | 0.020117 |
from django.core.management.base import BaseCommand, CommandError
from django.db import transaction
from operator import itemgetter
import face.models.models as regis
import random, math
class Command(BaseCommand):
args = 'none'
help = 'Analyze user performance and modify individual question orderings.'
... | anyweez/regis | face/management/commands/personalize.py | Python | gpl-2.0 | 8,409 | 0.006541 |
import unittest
import os.path
import numpy as np
import pandas as pd
from pandas.util.testing import assert_frame_equal
import test_helper
import copy
from operator import lt, le, eq, ne, ge, gt
from pandas.core.index import Index
__index_symbol__ = {
Index.union: ',',
Index.intersection: '&',
Index.diff... | Quantipy/quantipy | tests/test_rules.py | Python | mit | 81,385 | 0.003883 |
#!/usr/bin/env python
#
# A library that provides a Python interface to the Telegram Bot API
# Copyright (C) 2015-2018
# Leandro Toledo de Souza <devs@python-telegram-bot.org>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser Public License as published by
#... | d-qoi/TelegramBots | RoseAssassins/cust_handlers/conversationhandler.py | Python | lgpl-3.0 | 15,351 | 0.004755 |
# -*- coding: utf-8 -*-
"""
Consolidate any user interface rgw calls for Wolffish and openATTIC.
All operations will happen using the rest-api of RadosGW. The one execption
is getting the credentials for an administrative user which is implemented
here.
"""
import logging
import os
import json
import re
import glob... | supriti/DeepSea | srv/modules/runners/ui_rgw.py | Python | gpl-3.0 | 5,055 | 0.001583 |
from re import compile as regex
def matches(patts, filename):
for p in patts:
if not p.match(filename) is None:
return True
return False
class SpecialSection():
def __init__(self, name, pathPatterns, filePatterns, all_conditions = False):
self.name = name
self.allcond = all_conditions
se... | SBT-community/Starbound_RU | tools/special_cases.py | Python | apache-2.0 | 2,754 | 0.017234 |
import pytest
from cinp.common import URI
# TODO: test mutli-object setting
def test_splituri_builduri(): # TODO: test invlid URIs, mabey remove some tests from client_test that are just checking the URI
uri = URI( '/api/v1/' )
( ns, model, action, id_list, multi ) = uri.split( '/api/v1/' )
assert ns == []
... | cinp/python | cinp/common_test.py | Python | apache-2.0 | 7,291 | 0.055411 |
#!/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... | wubr2000/googleads-python-lib | examples/dfp/v201411/team_service/create_teams.py | Python | apache-2.0 | 1,762 | 0.007946 |
# sqlalchemy/events.py
# Copyright (C) 2005-2015 the SQLAlchemy authors and contributors
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
"""Core event interfaces."""
from . import event, exc
from .pool import Pool
f... | adamwwt/chvac | venv/lib/python2.7/site-packages/sqlalchemy/events.py | Python | mit | 40,130 | 0.0001 |
from django.conf.urls import include, url
from . import views
urlpatterns = [
url(r'^$', views.subform, name='subform'),
url(r'^submit', views.submit, name='submit'),
] | jameskane05/final_helpstl | submit/urls.py | Python | gpl-2.0 | 177 | 0.00565 |
#!/usr/bin/env python
#
# A library that provides a Python interface to the Telegram Bot API
# Copyright (C) 2015-2017
# Leandro Toledo de Souza <devs@python-telegram-bot.org>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as publis... | rogerscristo/BotFWD | env/lib/python3.6/site-packages/pytests/test_inlinequeryresultlocation.py | Python | mit | 5,366 | 0.002795 |
#### NOTICE: THIS FILE IS AUTOGENERATED
#### MODIFICATIONS MAY BE LOST IF DONE IMPROPERLY
#### PLEASE SEE THE ONLINE DOCUMENTATION FOR EXAMPLES
from swgpy.object import *
def create(kernel):
result = Tangible()
result.template = "object/tangible/wearables/ithorian/shared_ith_backpack_s01.iff"
result.attribute_te... | anhstudios/swganh | data/scripts/templates/object/tangible/wearables/ithorian/shared_ith_backpack_s01.py | Python | mit | 470 | 0.046809 |
#!/usr/bin/python
# coding=utf-8
import hashlib
import os
import re
import subprocess
import sys
import tempfile
from datetime import datetime
from gtts import gTTS
while 1:
line = sys.stdin.readline().strip()
if line == '':
break
key, data = line.split(':')
if key[:4] != 'agi_':
#skip input... | lucascudo/pytherisk | pytherisk.py | Python | gpl-3.0 | 4,654 | 0.010314 |
import base64
import json
from twisted.internet.defer import inlineCallbacks, DeferredQueue, returnValue
from twisted.web.http_headers import Headers
from twisted.web import http
from twisted.web.server import NOT_DONE_YET
from vumi.config import ConfigContext
from vumi.message import TransportUserMessage, TransportE... | praekelt/vumi-go | go/apps/http_api/tests/test_vumi_app.py | Python | bsd-3-clause | 31,622 | 0 |
# -*- coding: utf-8 -*-
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | googleapis/python-aiplatform | samples/generated_samples/aiplatform_generated_aiplatform_v1_model_service_get_model_async.py | Python | apache-2.0 | 1,466 | 0.000682 |
# -*- coding: utf-8 -*-
#
# This file is part of Invenio.
# Copyright (C) 2015 CERN.
#
# Invenio is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation; either version 2 of the
# License, or (at your option) any later... | hachreak/invenio-oaiharvester | invenio_oaiharvester/upgrades/oaiharvester_2015_07_14_innodb.py | Python | gpl-2.0 | 1,535 | 0 |
#
# 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
# ... | miguelgrinberg/heat | heat/tests/keystone/test_role_assignments.py | Python | apache-2.0 | 12,401 | 0 |
STRICT = False
try:
from django.conf import settings
STRICT = getattr(settings, 'PDF_MINER_IS_STRICT', STRICT)
except Exception:
# in case it's not a django project
pass
| tiffanyjaya/kai | vendors/pdfminer.six/pdfminer/settings.py | Python | mit | 187 | 0 |
from __future__ import absolute_import, print_function
import base64
import logging
import six
import traceback
from time import time
from django.conf import settings
from django.contrib.auth.models import AnonymousUser
from django.core.cache import cache
from django.core.urlresolvers import reverse
from django.http... | gencer/sentry | src/sentry/web/api.py | Python | bsd-3-clause | 26,313 | 0.001254 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
wfdiff test suite.
Run with pytest.
:copyright:
Lion Krischer (krischer@geophysik.uni-muenchen.de), 2014-2015
:license:
GNU General Public License, Version 3
(http://www.gnu.org/copyleft/gpl.html)
"""
import inspect
import os
# Most generic way to get th... | krischer/wfdiff | src/wfdiff/tests/test_wfdiff.py | Python | gpl-3.0 | 452 | 0 |
### Implementation of the numerical Stehfest inversion inspired by J Barker https://www.uni-leipzig.de/diffusion/presentations_DFII/pdf/DFII_Barker_Reduced.pdf
import inversion
import math
def finiteConc(t, v, De, R, deg, x, c0, L, N):
''' t is time (T), v is velocity (L/T), De is effective hydrodynamic dis... | tachylyte/HydroGeoPy | one_d_numerical.py | Python | bsd-2-clause | 3,784 | 0.013214 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('quizzes', '0004_auto_20150811_1354'),
]
operations = [
migrations.AlterModelOptions(
name='choice',
... | ikedumancas/ikequizgen | quizzes/migrations/0005_auto_20150813_0645.py | Python | mit | 1,156 | 0.000865 |
#!/usr/bin/env python
#
# Copyright 2007 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... | elsigh/browserscope | third_party/appengine_tools/devappserver2/endpoints/discovery_api_proxy.py | Python | apache-2.0 | 3,882 | 0.005667 |
# -*- coding: utf-8 -*-
##--------------------------------------#######
# Cryptographie #
##--------------------------------------#######
# WxGeometrie
# Dynamic geometry, graph plotter, and more for french mathematic teachers.
# Copyright (C) 2005-2013 Nicolas Pourcelot
#
# ... | wxgeo/geophar | wxgeometrie/modules/cryptographie/__init__.py | Python | gpl-2.0 | 12,975 | 0.006816 |
from string import printable
import re
from urlparse import urlunparse
from itertools import chain, ifilter
from fnmatch import fnmatch
from werkzeug import cached_property
from swarm import transport, swarm
from swarm.ext.http.helpers import parser, URL
from ..text import PageText
from .tree import TrieTree as Tree
... | denz/swarm-crawler | swarm_crawler/dataset/datasource.py | Python | bsd-3-clause | 7,406 | 0.009317 |
class River(object):
def __init__(self, index_name=None, index_type=None, bulk_size=100, bulk_timeout=None):
self.name = index_name
self.index_name = index_name
self.index_type = index_type
self.bulk_size = bulk_size
self.bulk_timeout = bulk_timeout
def serialize(self):... | openlabs/pyes | pyes/rivers.py | Python | bsd-3-clause | 4,849 | 0.000619 |
# Authors: Emmanuelle Gouillart <emmanuelle.gouillart@normalesup.org>
# Gael Varoquaux <gael.varoquaux@normalesup.org>
# License: BSD 3 clause
import numpy as np
import scipy as sp
from scipy import ndimage
from nose.tools import assert_equal, assert_true
from numpy.testing import assert_raises
from sklearn... | toastedcornflakes/scikit-learn | sklearn/feature_extraction/tests/test_image.py | Python | bsd-3-clause | 11,187 | 0.000089 |
# Copyright 2008-2014 Nokia Solutions and Networks
#
# 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... | userzimmermann/robotframework-python3 | src/robot/output/listeners.py | Python | apache-2.0 | 10,498 | 0.001048 |
#!/usr/bin/env python2
'''
Description:
Author: Ronald van Haren, NLeSC (r.vanharen@esciencecenter.nl)
Created: -
Last Modified: -
License: Apache 2.0
Notes: -
'''
from lxml.html import parse
import csv
import urllib2
from lxml import html
import numbers
import json
import os
import ut... | rvanharen/SitC | knmi_getdata.py | Python | apache-2.0 | 5,962 | 0.003187 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.