text
stringlengths
4
1.02M
meta
dict
"""Astroid hooks for numpy ndarray class.""" import astroid def infer_numpy_ndarray(node, context=None): ndarray = """ class ndarray(object): def __init__(self, shape, dtype=float, buffer=None, offset=0, strides=None, order=None): self.T = numpy.ndarray([0, 0]) ...
{ "content_hash": "33d41bd1b146c9d73f216123d8fe6a31", "timestamp": "", "source": "github", "line_count": 146, "max_line_length": 110, "avg_line_length": 56.78767123287671, "alnum_prop": 0.5936557713182969, "repo_name": "ruchee/vimrc", "id": "2d0ad77a371d85331f4567e9f29bcaecf6b20f4e", "size": "8705",...
import SimpleHTTPServer class CORSHTTPRequestHandler(SimpleHTTPServer.SimpleHTTPRequestHandler): def send_head(self): """Common code for GET and HEAD commands. This sends the response code and MIME headers. Return value is either a file object (which has to be copied to the outputf...
{ "content_hash": "8a9fb4b8b9b73ecc892d4cf7755e8350", "timestamp": "", "source": "github", "line_count": 62, "max_line_length": 78, "avg_line_length": 35.54838709677419, "alnum_prop": 0.588475499092559, "repo_name": "crankycoder/libmarisa", "id": "699f90ea934449a48888d378f360c90a89823eb9", "size": "...
#!/usr/bin/env python3 # # Copyright 2017 Two Pore Guys, Inc. # All rights reserved # # Redistribution and use in source and binary forms, with or without # modification, are permitted providing that the following conditions # are met: # 1. Redistributions of source code must retain the above copyright # notice, thi...
{ "content_hash": "2d34acc7f9f75732989d9fb22cf2a4f9", "timestamp": "", "source": "github", "line_count": 96, "max_line_length": 89, "avg_line_length": 34.291666666666664, "alnum_prop": 0.6780072904009721, "repo_name": "twoporeguys/librpc", "id": "6cdd34af7c96bf56620b149500070f1447b9e024", "size": "3...
import MySQLdb as mdb import sys import re from nltk import config_megam from nltk import MaxentClassifier from nltk import classify from numpy import array_split config_megam('/var/www/test/tagging/tools/db/tags/classifier/MEGAM/megam-64.opt') algorithm = 'MEGAM' def getClassesDict(): f = open('hindiclasses....
{ "content_hash": "a2c7557ea7c315df0d06bb7017b903ae", "timestamp": "", "source": "github", "line_count": 313, "max_line_length": 678, "avg_line_length": 40.460063897763575, "alnum_prop": 0.6100758054327227, "repo_name": "rjawor/tagging", "id": "051b9c8d5816509a218bfd2efe9ee4912c168000", "size": "127...
from paypalrestsdk import CreditCard, ResourceNotFound import logging logging.basicConfig(level=logging.INFO) try: # Retrieve the CreditCard by calling the # static `find` method on the CreditCard class, # and pass CreditCard ID credit_card = CreditCard.find("CARD-5BT058015C739554AKE2GCEI") print("Got Credi...
{ "content_hash": "cc5b068ba41bcd89aa6348fe404080b3", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 64, "avg_line_length": 32, "alnum_prop": 0.7740384615384616, "repo_name": "stafur/pyTRUST", "id": "4651b4a8704a9620267eed5dac1692dcc362cdc7", "size": "590", "binary": fal...
import random from java.lang import String Runtime.createAndStart("sweety", "Sweety") sweety.chatBot.startSession("ProgramAB", "default", "sweety") sweety.chatBot.setPredicate("default","name","unknow") # Add route from webKitSpeechRecognition to Program AB sweety.ear.addTextListener(sweety.chatBot) # Add route from...
{ "content_hash": "e665dce63646ad6d77979700f60d87fc", "timestamp": "", "source": "github", "line_count": 19, "max_line_length": 66, "avg_line_length": 30.157894736842106, "alnum_prop": 0.7766143106457243, "repo_name": "MyRobotLab/pyrobotlab", "id": "f917fcb06091a2468eb8be23a58d4eb99ffb274a", "size":...
from .container import Container as IContainer from .expandcollapse import ExpandCollapse as IExpandCollapse from .invoke import Invoke as IInvoke from .selection import Selection as ISelection from .selectionitem import SelectionItem as ISelectionItem from .table import Table as ITable from .text import Text as IText ...
{ "content_hash": "f81f1798687418c130c44abe57b29814", "timestamp": "", "source": "github", "line_count": 9, "max_line_length": 61, "avg_line_length": 43.666666666666664, "alnum_prop": 0.8396946564885496, "repo_name": "WesleyPeng/uiXautomation", "id": "c84de9944daa684961e00f4d7e01b82beb9e0e68", "size...
import torch from .task import Task class MILNCETask(Task): def reshape_subsample(self, sample): if ( hasattr(self.config.dataset, "subsampling") and self.config.dataset.subsampling is not None and self.config.dataset.subsampling > 1 ): for key in s...
{ "content_hash": "870f9442d932d7a2c2b194639734ef6e", "timestamp": "", "source": "github", "line_count": 22, "max_line_length": 64, "avg_line_length": 35.27272727272727, "alnum_prop": 0.49871134020618557, "repo_name": "pytorch/fairseq", "id": "61b6ab0597f9f3a78bbcf1474613630b20c5a874", "size": "954"...
import yaml from pseudo.pseudo_tree import Node Iterable = (list, tuple, set) class FragmentGenerator: @property def y(self): result = yaml.dump(self) return result.replace('!python/object:pseudo.code_generator_dsl.', '') # we can't set __str__ and __repr__ because this makes yaml.dump ins...
{ "content_hash": "0308b41be7d17ab0f5111f0a529c2bc3", "timestamp": "", "source": "github", "line_count": 159, "max_line_length": 125, "avg_line_length": 31.044025157232703, "alnum_prop": 0.5775931928687196, "repo_name": "alehander42/pseudo", "id": "24ca8f5ef106bb15e5c660ddf8ce0afacdd3a87f", "size": ...
from omics_pipe.parameters.default_parameters import default_parameters from omics_pipe.utils import * p = Bunch(default_parameters) def GATK_Varscan_Annotation(sample, extension, GATK_Varscan_Annotation_flag): '''Intersect GATK and Varscan VCF files and annotating with MyVariant.info. input: ...
{ "content_hash": "74eb39071353199934c638cca5264a6b", "timestamp": "", "source": "github", "line_count": 31, "max_line_length": 600, "avg_line_length": 49.935483870967744, "alnum_prop": 0.66343669250646, "repo_name": "adammaikai/PipeMaster", "id": "16c544acc11ba0c4fbab4fe78218ad78c0157105", "size": ...
import mock from rally.task import scenario from rally.task import types from tests.unit import test class ConvertTestCase(test.TestCase): # NOTE(stpierre): These cases test types.convert(), # types._get_preprocessor_loader(), and bits of # types.preprocess(). This may not look very elegant, but it's th...
{ "content_hash": "4a742f2966c868bce493b7c7a07f1f36", "timestamp": "", "source": "github", "line_count": 111, "max_line_length": 76, "avg_line_length": 38.36036036036036, "alnum_prop": 0.5749178017848755, "repo_name": "yeming233/rally", "id": "150f2644a26b51dac69df75337dc9a6d817bd9d9", "size": "4910...
""" Test the mock remote OS access class. """ import unittest from ..os_remote_access import OsRemoteAccessMock from ....plugin.manager import PluginManager from ....utilities.remote_access_data import RemoteAccessData class TestMockPlugin(unittest.TestCase): """Test teh remote mocking class.""" def test_api...
{ "content_hash": "dc0ee7ec5790cbd74a2dcc0be78c8c39", "timestamp": "", "source": "github", "line_count": 35, "max_line_length": 68, "avg_line_length": 41.714285714285715, "alnum_prop": 0.6397260273972603, "repo_name": "intel-ctrlsys/actsys", "id": "f60a5d8bd51ed9721548f88cd77e51a8e0f2a18d", "size": ...
from __future__ import absolute_import from __future__ import division from __future__ import print_function import functools import logging import time from six.moves import range # pylint: disable=redefined-builtin def RetryOnException(exc_type, retries): """Decorator to retry running a function if an exception i...
{ "content_hash": "14bbfd6cb27eb1b8aef44a31b09fcfba", "timestamp": "", "source": "github", "line_count": 58, "max_line_length": 80, "avg_line_length": 38.46551724137931, "alnum_prop": 0.6929627969520394, "repo_name": "endlessm/chromium-browser", "id": "a11bd806db0a2e812740290707089364a28f812a", "siz...
"""Main import for Python module dependency program. Contains main class for executing a project dependency search as well as utility code for outputting the found results. """ import os # Constant which specifies what version of moduledependency this is VERSION = "0.1" # Directory containing this module...
{ "content_hash": "c1c5d5644576a8dffbc49fe4e8afad88", "timestamp": "", "source": "github", "line_count": 37, "max_line_length": 80, "avg_line_length": 34.16216216216216, "alnum_prop": 0.7325949367088608, "repo_name": "DonaldWhyte/module-dependency", "id": "ea6b25ae29c16abb6b51cae663486a792c159e7d", ...
import urllib2 import BeautifulSoup as soup from config import gymID lectioScrapeURL = "https://www.lectio.dk/lectio/"+str(gymID)+"/" lectioScrapeCall = lectioScrapeURL+"FindSkema.aspx?type=laerer" laerere = [] html = soup.BeautifulSoup(urllib2.urlopen(lectioScrapeCall).read()) lectioLaerereDiv = html.findAll('div'...
{ "content_hash": "cadfebc099804c19d875eed0b58f26b5", "timestamp": "", "source": "github", "line_count": 24, "max_line_length": 77, "avg_line_length": 26.333333333333332, "alnum_prop": 0.7420886075949367, "repo_name": "ludvigbruchmann/lectio-scraper", "id": "307cf705a667478111b568a73151a55251698382", ...
""" This module defines constant values for the ScrambleSuit protocol. While some values can be changed, in general they should not. If you do not obey, be at least careful because the protocol could easily break. """ # Length of the key of the HMAC which used to authenticate tickets in bytes. TICKET_HMAC_KEY_LENGTH...
{ "content_hash": "7d92bb04e710f658a2db33182d83ad69", "timestamp": "", "source": "github", "line_count": 117, "max_line_length": 79, "avg_line_length": 31.358974358974358, "alnum_prop": 0.7402562005996184, "repo_name": "catinred2/obfsproxy", "id": "df4b0af25257dc80b34c04154573ef49cdc13318", "size": ...
from datetime import time import random import sys import numpy as np import Orange from Orange.statistics.basic_stats import DomainBasicStats from Orange.widgets.settings import Setting from Orange.widgets.utils.datacaching import getCached, setCached # noinspection PyBroadException def checksum(x): if x is No...
{ "content_hash": "f713516e1a338657e20d22947484808f", "timestamp": "", "source": "github", "line_count": 548, "max_line_length": 137, "avg_line_length": 45.34124087591241, "alnum_prop": 0.5535477119974243, "repo_name": "qPCR4vir/orange3", "id": "90e77f94e5a2728b350fe5ef7dac67a656af0c59", "size": "24...
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER # LIABILITY, WH...
{ "content_hash": "64a09b2024ce007446beb351a5a3b4ce", "timestamp": "", "source": "github", "line_count": 27, "max_line_length": 79, "avg_line_length": 33.851851851851855, "alnum_prop": 0.6827133479212254, "repo_name": "jeremiedecock/snippets", "id": "899daba47a3b7c679fb586abc2583fc27dbfb03d", "size"...
from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('heathen', '0001_initial'), ] operations = [ migrations.AddField( model_name='member', name='gender', field=model...
{ "content_hash": "2d95b1fc01cb38088107e7175157827c", "timestamp": "", "source": "github", "line_count": 18, "max_line_length": 95, "avg_line_length": 22.77777777777778, "alnum_prop": 0.5829268292682926, "repo_name": "boyombo/django-stations", "id": "c77770bd0bc9f8c636e24ae61f7ee29e2b501245", "size"...
""" print server program for elo322 - Redes de Computadores """ import socket import threading class Client_thread(threading.Thread): """ Echos the message from a client connection """ def __init__(self, client_socket): super().__init__() self.socket = client_socket self.addr = self.s...
{ "content_hash": "680eb61c427c521fae83f7a6c557ccfb", "timestamp": "", "source": "github", "line_count": 47, "max_line_length": 69, "avg_line_length": 24.361702127659573, "alnum_prop": 0.5973799126637555, "repo_name": "Grulfen/pychat", "id": "b1947f0051e9d70c36b8caeb8c27e9dae1a79837", "size": "1145"...
import sys import os __version__ = "0.6.7" try: import setuptools from setuptools import setup, find_packages packages = find_packages() except: setuptools = None from distutils.core import setup packages = ['coherence',] def find_packages(path): for f in os.listdir(path): ...
{ "content_hash": "83d9e5b3db3b349edab753a0c39ea6e8", "timestamp": "", "source": "github", "line_count": 209, "max_line_length": 95, "avg_line_length": 40.39234449760765, "alnum_prop": 0.6567164179104478, "repo_name": "ismaelgaudioso/Coherence", "id": "8ca6dfcb5f5d616ebcb34e033b58a853ee0ba80a", "siz...
import MySQLdb import sys, string import Config class CommonFunctions( ) : def __init__( self, db, cursor ) : self.db = db self.cursor = cursor def fetchOrganismList( self, isUniprot = False ) : if isUniprot : self.cursor.execute( "SELECT organism_id, entrez_taxid, organism_common_name...
{ "content_hash": "f0c56cbaffc823cf79d42690e00737ab", "timestamp": "", "source": "github", "line_count": 25, "max_line_length": 232, "avg_line_length": 39.44, "alnum_prop": 0.7190669371196755, "repo_name": "BioGRID/BioGRID-Annotation", "id": "939361b757499beb6583ed205f9176d831789895", "size": "1063"...
from django.core.urlresolvers import reverse from django import http from mox import IgnoreArg # noqa from mox import IsA # noqa from openstack_dashboard import api from openstack_dashboard.dashboards.project.data_processing.utils \ import workflow_helpers from openstack_dashboard.test import helpers as test ...
{ "content_hash": "e926d25a8b42ffa78f8d49859a8df4d9", "timestamp": "", "source": "github", "line_count": 164, "max_line_length": 79, "avg_line_length": 42.43292682926829, "alnum_prop": 0.5598505532404081, "repo_name": "tsufiev/horizon", "id": "44d450c11e25a52fc2875cd4b3dd9aeb360e6f3f", "size": "7505...
import warnings from typing import Callable, Dict, Optional, Sequence, Tuple, Union from google.api_core import grpc_helpers from google.api_core import gapic_v1 import google.auth # type: ignore from google.auth import credentials as ga_credentials # type: ignore from google.auth.transport.grpc import SslCredential...
{ "content_hash": "372ba80ea1b989b95df7b7f6259da580", "timestamp": "", "source": "github", "line_count": 403, "max_line_length": 91, "avg_line_length": 44.68982630272953, "alnum_prop": 0.6219322598556357, "repo_name": "googleapis/python-dialogflow", "id": "cda5b75fc2a71ff34e219159c1d1ea109a1c53b6", ...
import mvp_app import pytest @pytest.fixture def login(client, username, password): return client.post('/login', data=dict( username=username, password=password ), follow_redirects=True) def logout(client): return client.get('/logout', follow_redirects=True)
{ "content_hash": "b0c276a14b6e731101f3dca0071b230b", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 55, "avg_line_length": 22.23076923076923, "alnum_prop": 0.698961937716263, "repo_name": "kdurril/mvp_app", "id": "beacce30b68929788781859360fd3c7b985594aa", "size": "412", ...
from oslo_log import log from keystone import exception from keystone.i18n import _, _LW from keystone.models import token_model AUTH_CONTEXT_ENV = 'KEYSTONE_AUTH_CONTEXT' """Environment variable used to convey the Keystone auth context. Auth context is essentially the user credential used for policy enforcement. I...
{ "content_hash": "cde0127507df502b9224cf4d66145945", "timestamp": "", "source": "github", "line_count": 86, "max_line_length": 78, "avg_line_length": 39.395348837209305, "alnum_prop": 0.6269185360094451, "repo_name": "ajayaa/keystone", "id": "44e7c6d3c293622b5ccf27f3ca2facaddc4771f0", "size": "4203...
""" ------------------------------------------------------------------------------- | Copyright 2016 Esri | | 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/l...
{ "content_hash": "5fde75d600b60e012ff68fa94def6fb8", "timestamp": "", "source": "github", "line_count": 38, "max_line_length": 120, "avg_line_length": 45.28947368421053, "alnum_prop": 0.6467170249854736, "repo_name": "JRosenfeldIntern/data-assistant", "id": "81dd4c9972edcb17f96fc1ad0ab5b2b53f006c81",...
from flask import Flask import requests app = Flask(__name__) from api_key import key # [START app] @app.route('/get_author/<title>') def get_author(title): url = 'https://www.googleapis.com/books/v1/volumes?q={}&key={}&country=US'.format(title, key) try: response = requests.get(url) except reque...
{ "content_hash": "3d3af28274cc9cf235ba34155bf31990", "timestamp": "", "source": "github", "line_count": 25, "max_line_length": 97, "avg_line_length": 25.04, "alnum_prop": 0.6293929712460063, "repo_name": "GoogleCloudPlatform/continuous-deployment-demo", "id": "f535c00f938136efdcb276c4e70c28d3b21a1c4d...
from django.db import models from django.contrib.auth.models import User class Project(models.Model): name = models.CharField(max_length=50) description = models.TextField(blank=True) location = models.TextField(blank=True) start_date = models.DateTimeField(null=True, blank=True) end_date = models.DateTimeField(n...
{ "content_hash": "d052730d1f637a49045e88d7fa33f694", "timestamp": "", "source": "github", "line_count": 20, "max_line_length": 62, "avg_line_length": 31, "alnum_prop": 0.7532258064516129, "repo_name": "tjsavage/tmrwmedia", "id": "52d4cc386b1a71b7f57060da9343f2c0081ff740", "size": "620", "binary":...
""" Provides generic filtering backends that can be used to filter the results returned by list views. """ from __future__ import unicode_literals from django.core.exceptions import ImproperlyConfigured from django.db import models from django.utils import six from rest_framework.compat import django_filters, guardian,...
{ "content_hash": "896418b406c2ad442a42fcad9ee92741", "timestamp": "", "source": "github", "line_count": 196, "max_line_length": 100, "avg_line_length": 35.433673469387756, "alnum_prop": 0.624334053275738, "repo_name": "anistark/mozillians", "id": "18f4862e0f5a564da47a85c0ccbf4a93c990a874", "size": ...
import sys import unittest from decimal import Decimal sys.path.insert(0, "./../../") from eway import config from eway.client import EwayPaymentClient from eway.fields import Customer, CreditCard class ClientTestCase(unittest.TestCase): def setUp(self): self.eway_client = EwayPaymentClient('87654321', ...
{ "content_hash": "83422f81d9d74a9a859daabdb1449d77", "timestamp": "", "source": "github", "line_count": 126, "max_line_length": 126, "avg_line_length": 37.682539682539684, "alnum_prop": 0.5667649536647009, "repo_name": "alexhayes/python-eway", "id": "9a0f5eedc947c664c2a9eebc53a87a2928918e04", "size...
from cliff.command import Command import call_server as server class ContainerList(Command): def get_parser(self, prog_name): parser = super(ContainerList, self).get_parser(prog_name) return parser def take_action(self, parsed_args): response = server.TakeAction().get_container...
{ "content_hash": "b4a9ddec339233ef69c04780f03ceac4", "timestamp": "", "source": "github", "line_count": 15, "max_line_length": 65, "avg_line_length": 23.466666666666665, "alnum_prop": 0.6789772727272727, "repo_name": "cloud-ark/cloudark", "id": "a994f7802536eee560720c01ddff785fd3406319", "size": "3...
from sqlalchemy.dialects.postgresql import JSON from indico.core.db.sqlalchemy import UTCDateTime, db from indico.util.date_time import now_utc class LiveSyncAgent(db.Model): __tablename__ = 'agents' __table_args__ = {'schema': 'plugin_livesync'} #: Agent ID id = db.Column( db.Integer, ...
{ "content_hash": "ce1713d978ab115fecbe43f9e373d9eb", "timestamp": "", "source": "github", "line_count": 65, "max_line_length": 78, "avg_line_length": 23.4, "alnum_prop": 0.6055226824457594, "repo_name": "ThiefMaster/indico-plugins", "id": "554475e1c4fcafef068d531016cfd7b97d6b0116", "size": "1764", ...
import sequent as sqnt import logging import os from examples.run_progs import Step appname = os.path.basename(__file__) logger = logging.getLogger(appname) class Prog(Step): def main(self, progname, step_to_fail=None, iteration_to_fail=''): logger = logging.getLogger(os.getenv("SEQUENT_LOGGER_NAM...
{ "content_hash": "fadbc65aa120804179cd53611f81502c", "timestamp": "", "source": "github", "line_count": 57, "max_line_length": 159, "avg_line_length": 45.6140350877193, "alnum_prop": 0.5334615384615384, "repo_name": "Acrisel/sequent", "id": "8c8fe31253f44492e1becec59a735acb504a6573", "size": "3542"...
import os import numpy from numpy.distutils.misc_util import Configuration def configuration(parent_package="", top_path=None): config = Configuration("cluster", parent_package, top_path) libraries = [] if os.name == 'posix': libraries.append('m') config.add_extension("_expected_mutual_info_f...
{ "content_hash": "799ced86f750d531653b250794cb43b2", "timestamp": "", "source": "github", "line_count": 24, "max_line_length": 68, "avg_line_length": 27.791666666666668, "alnum_prop": 0.6101949025487257, "repo_name": "ndingwall/scikit-learn", "id": "c39e414d9f3b0cffe19b06312b880c4666810b71", "size"...
""" Testing for Clustering methods """ import numpy as np import pytest from scipy.sparse import csr_matrix from sklearn.exceptions import ConvergenceWarning from sklearn.utils._testing import ( assert_array_equal, assert_warns, assert_warns_message, assert_no_warnings) from sklearn.cluster import AffinityP...
{ "content_hash": "4aa590a6bcfcdcecbbfda6267fbe356a", "timestamp": "", "source": "github", "line_count": 233, "max_line_length": 79, "avg_line_length": 36.4549356223176, "alnum_prop": 0.6516364492583, "repo_name": "bnaul/scikit-learn", "id": "238e02dbd60db6209ee06560b7b911b9be432949", "size": "8494"...
from OpenSSL.crypto import load_certificate, FILETYPE_ASN1 #Ref to https://github.com/pyca/pyopenssl/tree/master/examples class Certificate_Mgmt: ''' IEEE 8.11 Device Certificate is issued by manifacturer at the time of creation [Not implemented yet] [Future to be one of the inverter models] Self-Signed...
{ "content_hash": "73643ea646e6e47993d0786c55e50707", "timestamp": "", "source": "github", "line_count": 79, "max_line_length": 136, "avg_line_length": 39.78481012658228, "alnum_prop": 0.5590200445434298, "repo_name": "rlutes/volttron-applications", "id": "8c125d14b5c0579eb2d154987162e9f3432991c4", ...
""" 'rm' command. """ # Copyright © 2015 – 2017 1&1 Group <git@1and1.com> # # 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 requir...
{ "content_hash": "3cd7d0ff0c924165ebcf8f37ee7e3456", "timestamp": "", "source": "github", "line_count": 74, "max_line_length": 111, "avg_line_length": 39.24324324324324, "alnum_prop": 0.5730027548209367, "repo_name": "1and1/confluencer", "id": "dd71b03e8ccfa8516e15110bde01e090405fa85f", "size": "29...
from __future__ import unicode_literals from django.template import Context, Template from django.test import SimpleTestCase from django.utils import html, six, text from django.utils.encoding import force_bytes from django.utils.functional import lazy, lazystr from django.utils.safestring import ( EscapeD...
{ "content_hash": "56837584a59ff56e3ec1dfddefa92963", "timestamp": "", "source": "github", "line_count": 106, "max_line_length": 115, "avg_line_length": 35.264150943396224, "alnum_prop": 0.57223113964687, "repo_name": "yephper/django", "id": "473c7fe24d5ceba059ad4e11c927eb5d025b162b", "size": "3738"...
"""Classes for merging web tests results directories together. This is split into three parts: * Generic code to merge JSON data together. * Generic code to merge directories together. * Code to specifically merge the web tests result data together. The JSON data merger will recursively merge dictionaries by defa...
{ "content_hash": "7fa1978f6df4d1da2ce505cf0631f3a0", "timestamp": "", "source": "github", "line_count": 1016, "max_line_length": 109, "avg_line_length": 35.19488188976378, "alnum_prop": 0.5993623804463337, "repo_name": "scheib/chromium", "id": "42d8f06cf5f610ce81794424a62aef9389df7546", "size": "35...
'''Autogenerated by xml_generate script, do not edit!''' from OpenGL import platform as _p, arrays # Code generation uses this from OpenGL.raw.GL import _types as _cs # End users want this... from OpenGL.raw.GL._types import * from OpenGL.raw.GL import _errors from OpenGL.constant import Constant as _C import ctypes _...
{ "content_hash": "cc61b0e5d986d00c8ef0122ed0be6cba", "timestamp": "", "source": "github", "line_count": 15, "max_line_length": 118, "avg_line_length": 38.46666666666667, "alnum_prop": 0.755632582322357, "repo_name": "alexus37/AugmentedRealityChess", "id": "e01bd6f6a1ad78828239f9accd5124fa3af4fd6e", ...
""" Base class for Scrapy spiders See documentation in docs/topics/spiders.rst """ from scrapy import log from scrapy.settings import SpiderSettings from scrapy.http import Request from scrapy.utils.misc import arg_to_iter from scrapy.utils.trackref import object_ref from scrapy.utils.url import url_is_from_spider ...
{ "content_hash": "5e5f66f219959bd07032a7f27c13f1df", "timestamp": "", "source": "github", "line_count": 82, "max_line_length": 137, "avg_line_length": 28.951219512195124, "alnum_prop": 0.6415332771693345, "repo_name": "developerworks/scrapy", "id": "1829a9d3b3478aa898024fcade31a36ec3fc8a7b", "size"...
""" Written by Jesse Evers This program converts binary numbers to base 10 and vice versa. """ # Gets the user to choose between binary -> decimal or decimal -> binary # "b" gets binary -> decimal, "bt" gets decimal -> binary # Anything else gets new user input def binOrDec(): print("Would you like to convert bin...
{ "content_hash": "542ad09ce3d31d32df4b5a0e7080dd14", "timestamp": "", "source": "github", "line_count": 88, "max_line_length": 103, "avg_line_length": 25.306818181818183, "alnum_prop": 0.6070947462954648, "repo_name": "TheAtomicGoose/karan", "id": "00fd14ea835da13d69f7d5ddedeedbfcc36e6f9d", "size":...
""" This module converts requested URLs to callback view functions. URLResolver is the main class here. Its resolve() method takes a URL (as a string) and returns a ResolverMatch object which provides access to all attributes of the resolved URL match. """ import functools import re import threading from importlib imp...
{ "content_hash": "c85406ce93da835f4e0d37cee97aa06a", "timestamp": "", "source": "github", "line_count": 624, "max_line_length": 109, "avg_line_length": 39.607371794871796, "alnum_prop": 0.554885696945175, "repo_name": "reinout/django", "id": "3f48d72fedece497f2768f47d2ed9a05395f2579", "size": "2471...
# Hive Appier Framework # Copyright (c) 2008-2022 Hive Solutions Lda. # # This file is part of Hive Appier Framework. # # Hive Appier Framework is free software: you can redistribute it and/or modify # it under the terms of the Apache License as published by the Apache # Foundation, either version 2.0 of the L...
{ "content_hash": "48b6adf120120cde7b4b87e881a7688d", "timestamp": "", "source": "github", "line_count": 53, "max_line_length": 79, "avg_line_length": 36.24528301886792, "alnum_prop": 0.706923477355544, "repo_name": "hivesolutions/appier", "id": "8851ebaa8a10d985baea2e5127f2fd84c5fcf609", "size": "1...
"""Tests for variable store.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import gc import threading import numpy from tensorflow.python.eager import context from tensorflow.python.eager import function from tensorflow.python.eager import wrap_funct...
{ "content_hash": "28d9035ac0116b3b50c728eef9b0000e", "timestamp": "", "source": "github", "line_count": 1806, "max_line_length": 80, "avg_line_length": 43.39867109634552, "alnum_prop": 0.6544310903569879, "repo_name": "brchiu/tensorflow", "id": "0aac4adfa6e4b176e9fcf9ae935a218a13b65961", "size": "7...
import _plotly_utils.basevalidators class DyValidator(_plotly_utils.basevalidators.NumberValidator): def __init__(self, plotly_name="dy", parent_name="bar", **kwargs): super(DyValidator, self).__init__( plotly_name=plotly_name, parent_name=parent_name, anim=kwargs.pop("...
{ "content_hash": "ef2e038a6c177895d4e20c4fb04d51ea", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 70, "avg_line_length": 35.76923076923077, "alnum_prop": 0.5806451612903226, "repo_name": "plotly/python-api", "id": "c2908ef619c7f024ffdb2497ef22eb5e8cc04afe", "size": "465...
""" Test cases for DataFrame.plot """ import pytest import string import warnings from datetime import datetime, date import pandas as pd from pandas import (Series, DataFrame, MultiIndex, PeriodIndex, date_range, bdate_range) from pandas.core.dtypes.api import is_list_like from pandas.compat imp...
{ "content_hash": "6b6084689b2fe3d3905d5fcd9d64ae33", "timestamp": "", "source": "github", "line_count": 2889, "max_line_length": 79, "avg_line_length": 41.20699203876774, "alnum_prop": 0.5272287415894563, "repo_name": "jmmease/pandas", "id": "a428d73fce1e3e4a0c973664eb60b3635f23f893", "size": "1190...
""" Django settings for django_photos project. For more information on this file, see https://docs.djangoproject.com/en/1.6/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.6/ref/settings/ """ from configurations import Configuration # Build paths inside the pro...
{ "content_hash": "a60b30f53299284051b894ca65f24dd3", "timestamp": "", "source": "github", "line_count": 107, "max_line_length": 77, "avg_line_length": 25.074766355140188, "alnum_prop": 0.6395825568393589, "repo_name": "markcharyk/django-photos", "id": "ec49141d204286e72532e1b84e0a5fe7666cef84", "si...
try: from hashlib import sha1 as sha except ImportError: from sha import sha from random import randint #this is ugly, hopefully os.entropy will be in 2.4 try: from entropy import entropy except ImportError: def entropy(n): s = '' for i in range(n): s += chr(randint(0,255)) ...
{ "content_hash": "ce0d4af44ee3eb76d1f7010d43cf4466", "timestamp": "", "source": "github", "line_count": 113, "max_line_length": 89, "avg_line_length": 27.053097345132745, "alnum_prop": 0.5374550212626759, "repo_name": "galaxy001/libtorrent", "id": "920c88f8ad52d15a1faa9a647b1bd622d479fa50", "size":...
# # Based on AboutArrayAssignments in the Ruby Koans # from runner.koan import * class AboutListAssignments(Koan): def test_non_parallel_assignment(self): names = ["John", "Smith"] self.assertEqual(["John", "Smith"], names) def test_parallel_assignments(self): fi...
{ "content_hash": "ed596a6a2955119e738aca038d952f1b", "timestamp": "", "source": "github", "line_count": 28, "max_line_length": 62, "avg_line_length": 34.857142857142854, "alnum_prop": 0.5809426229508197, "repo_name": "matehall/Python-koan", "id": "943f9666e17bab309b1ca064e27aedd76fa7e214", "size": ...
import copy from django.utils.functional import empty # noqa from django.utils.functional import LazyObject # noqa class LazySettings(LazyObject): def _setup(self, name=None): from django.conf import settings # noqa from horizon.conf.default import HORIZON_CONFIG as DEFAULT_CONFIG # noqa ...
{ "content_hash": "5846b0c35798b7edae41e929295bb70c", "timestamp": "", "source": "github", "line_count": 35, "max_line_length": 81, "avg_line_length": 43.57142857142857, "alnum_prop": 0.6609836065573771, "repo_name": "neudesk/neucloud", "id": "b9043df45762b14e8eb7e0270207157632692dfb", "size": "2071...
""" Created on 2014-4-4 @author: Danny<manyunkai@hotmail.com> DannyWork Project. """ from __future__ import unicode_literals import os from django.db.models.fields.files import ImageField, ImageFieldFile from django.core.exceptions import ImproperlyConfigured from tools.imageutils import ImageTrimTools, ImageIOToo...
{ "content_hash": "90d90f4615feb77671238301f6490981", "timestamp": "", "source": "github", "line_count": 108, "max_line_length": 111, "avg_line_length": 35.074074074074076, "alnum_prop": 0.5947729672650475, "repo_name": "manyunkai/dannysite4", "id": "4f26dc0164495dd9dc4c776d48ddaece9deab7de", "size"...
import unittest import bslint.constants as const import bslint.lexer.handlers.regex_handler as regex_handler from bslint.lexer.lexer import Lexer as Lexer from bslint.lexer.token import Token as Token from tests.resources.common.test_methods import CommonMethods as Common class TestIdentifierRegex(unittest.TestCase)...
{ "content_hash": "b2d18025608b35f2a34a9698e4ac04a5", "timestamp": "", "source": "github", "line_count": 102, "max_line_length": 116, "avg_line_length": 46.71568627450981, "alnum_prop": 0.6329485834207765, "repo_name": "sky-uk/bslint", "id": "ae2027bffc89806f1240cd24231bc2cdfd14be18", "size": "4765"...
""" The visibility module ===================== This module provides helper classes to manage and compute values that should be displayed when considering a tree of forums. This includes post counts, topic counts, siblings, ... """ from __future__ import unicode_literals from django.db.models.query ...
{ "content_hash": "cbc169ea77ccdb50020cb747e9c13586", "timestamp": "", "source": "github", "line_count": 215, "max_line_length": 100, "avg_line_length": 42.12093023255814, "alnum_prop": 0.6278710247349824, "repo_name": "franga2000/django-machina", "id": "a99be2575dd40ec4906403922af7b100af7917ee", "s...
import socket, errno, sys from pysnmp.carrier.asynsock.base import AbstractSocketTransport from pysnmp.carrier import error from pysnmp import debug sockErrors = { # Ignore these socket errors errno.ESHUTDOWN: 1, errno.ENOTCONN: 1, errno.ECONNRESET: 0, errno.ECONNREFUSED: 0, errno.EAGAIN: 0, er...
{ "content_hash": "a8bbaa2040e36b6327211263b55b2bc4", "timestamp": "", "source": "github", "line_count": 91, "max_line_length": 226, "avg_line_length": 44.53846153846154, "alnum_prop": 0.6262028127313102, "repo_name": "InviNets/ReadingsToSNMP", "id": "45b73d7809a2a1644b9051fa87ed241e0ba6b04b", "size...
from tempest_lib.common.utils import data_utils # noqa from tempest_lib import exceptions as lib_exc # noqa from tempest.api.share import base from tempest import clients_share as clients from tempest import test class ShareTypesNegativeTest(base.BaseSharesTest): @classmethod def _create_share_type(cls): ...
{ "content_hash": "ad30359eab9de4c7d060c95e75ee96bb", "timestamp": "", "source": "github", "line_count": 49, "max_line_length": 75, "avg_line_length": 40.714285714285715, "alnum_prop": 0.5944862155388471, "repo_name": "weiting-chen/manila", "id": "eb10b0ceaac946e161aa18dfe94e02412eaa601d", "size": "...
from contextlib import closing from glob import glob import os import shutil import tarfile import subprocess import signal from cabalgata.silla.configuration import Definition from cabalgata.silla.util import pid from cabalgata.zookeeper import catalog, util class ZookeeperFactory(object): definitions = ( ...
{ "content_hash": "c4ffd63de41a201db183c3c07ff2124e", "timestamp": "", "source": "github", "line_count": 179, "max_line_length": 114, "avg_line_length": 38.737430167597765, "alnum_prop": 0.5974906259013556, "repo_name": "cabalgata/cabalgata-zookeeper", "id": "ce42837cd67aae9c4bc7d9c1622c0fc208abb31e",...
import base64 import logging import os import shutil import sys import tempfile import threading import unittest from io import StringIO from flask import json from werkzeug.serving import make_server class TestCase(unittest.TestCase): def setUp(self): # We want our test cases quiet logging.basic...
{ "content_hash": "cf04c7733c3b3ad292be7657db6f9219", "timestamp": "", "source": "github", "line_count": 164, "max_line_length": 77, "avg_line_length": 26.79268292682927, "alnum_prop": 0.5987710514337733, "repo_name": "pegasus-isi/pegasus", "id": "748f33ed5097abfbcbfef46549b92060a98419e9", "size": "...
from CIM15.CDPSM.Geographical.IEC61970.Core.IdentifiedObject import IdentifiedObject class Location(IdentifiedObject): """The place, scene, or point of something where someone or something has been, is, and/or will be at a given moment in time. It can be defined with one or more postition points (coordinates) in a...
{ "content_hash": "d0f6a5bb407a39c20e7a4d2b2eea49b0", "timestamp": "", "source": "github", "line_count": 92, "max_line_length": 225, "avg_line_length": 39.04347826086956, "alnum_prop": 0.6815144766146993, "repo_name": "rwl/PyCIM", "id": "91456ad6909875133978b4d42eda32650627672a", "size": "4692", "...
from .core import (DataFrame, DataFrames, Frame, Frames, Series, Seriess, Index, Rolling, Window, PeriodicDataFrame, Random, GroupBy) from .aggregations import Aggregation
{ "content_hash": "6f16f346e647eaaf686e884d5f32fd92", "timestamp": "", "source": "github", "line_count": 3, "max_line_length": 80, "avg_line_length": 63.666666666666664, "alnum_prop": 0.7225130890052356, "repo_name": "mrocklin/streams", "id": "240da25c0b871fcb43d83ac5548bbdfdab506b81", "size": "191"...
from swgpy.object import * def create(kernel): result = Weapon() result.template = "object/weapon/melee/2h_sword/crafted_saber/shared_sword_lightsaber_two_handed_s11_gen1.iff" result.attribute_template_id = 10 result.stfName("weapon_name","sword_lightsaber_2h_type11") #### BEGIN MODIFICATIONS #### #### EN...
{ "content_hash": "b13ed9410bf42a72d8fe9ee4b280f3ba", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 111, "avg_line_length": 27.53846153846154, "alnum_prop": 0.7178770949720671, "repo_name": "anhstudios/swganh", "id": "13a858f3ed7525d587241da197bc798b999353c3", "size": "50...
from braintree.attribute_getter import AttributeGetter class DisputeEvidence(AttributeGetter): def __init__(self, attributes): attributes["tag"] = attributes.get("category") AttributeGetter.__init__(self, attributes)
{ "content_hash": "97733f3da7e4f45dd6a021ed183324fc", "timestamp": "", "source": "github", "line_count": 6, "max_line_length": 54, "avg_line_length": 39.666666666666664, "alnum_prop": 0.7226890756302521, "repo_name": "braintree/braintree_python", "id": "8943136a4229f938a0aa2b3858ff62ac381e4458", "si...
from optparse import OptionParser import os import sys import copy import numpy as np import pandas as pd import scipy as sp COLUMNS = ["age", "workclass", "fnlwgt", "education", "education_num", "marital_status", "occupation", "relationship", "race", "gender", "capital_gain", "capital_loss", "h...
{ "content_hash": "b47b16bb14c97a0f8e67eb2850607ac6", "timestamp": "", "source": "github", "line_count": 195, "max_line_length": 119, "avg_line_length": 42.738461538461536, "alnum_prop": 0.6011519078473722, "repo_name": "whatbeg/Data-Analysis", "id": "dbaef2ce2ade0c2d17eb5b8441d3ebb86f36595f", "size...
import datetime import functools import logging import os from six.moves import configparser import botocore_eb.config from botocore_eb.compat import total_seconds from botocore_eb.exceptions import UnknownCredentialError from botocore_eb.exceptions import PartialCredentialsError from botocore_eb.exceptions import Co...
{ "content_hash": "a668745176c4d4073123a40c5e52d33d", "timestamp": "", "source": "github", "line_count": 576, "max_line_length": 83, "avg_line_length": 35.404513888888886, "alnum_prop": 0.606482616584122, "repo_name": "ianblenke/awsebcli", "id": "5b72290137687e5bbb6431f1031fbb34be3f4b7a", "size": "2...
"""Module containing a framework for integration testing of AMPLE modules""" __author__ = "Jens Thomas, and Felix Simkovic" __date__ = "25 Mar 2016" __version__ = "1.0" from unittest import TestCase, TestLoader, TextTestRunner, TestSuite import glob import imp import logging import os import shutil import sys from a...
{ "content_hash": "c01fa6c56c489077d0ec2cb42bdb07bc", "timestamp": "", "source": "github", "line_count": 321, "max_line_length": 113, "avg_line_length": 41.54205607476636, "alnum_prop": 0.6018747656542932, "repo_name": "linucks/ample", "id": "56398842251aeafb82d3e41a47aa4bff1a703090", "size": "13335...
import _plotly_utils.basevalidators class ColorValidator(_plotly_utils.basevalidators.ColorValidator): def __init__(self, plotly_name="color", parent_name="histogram.marker", **kwargs): super(ColorValidator, self).__init__( plotly_name=plotly_name, parent_name=parent_name, ...
{ "content_hash": "1b175aad57e33d7ed5e81676d6f8188d", "timestamp": "", "source": "github", "line_count": 16, "max_line_length": 86, "avg_line_length": 38.5, "alnum_prop": 0.5844155844155844, "repo_name": "plotly/python-api", "id": "78dff74fa8338569fa624121cb54f387a3447790", "size": "616", "binary"...
import unittest import numpy import chainer from chainer import cuda from chainer import functions from chainer import gradient_check from chainer import testing from chainer.testing import attr from chainer.testing import condition class TestMax(unittest.TestCase): def setUp(self): self.x = numpy.rand...
{ "content_hash": "37e2fb5a830131a57ce7dde96e67940f", "timestamp": "", "source": "github", "line_count": 344, "max_line_length": 79, "avg_line_length": 34.0406976744186, "alnum_prop": 0.6182749786507259, "repo_name": "cemoody/chainer", "id": "afe9fb7697ecaec9fdd62f98fa76b99e7666aa2c", "size": "11710...
from __future__ import unicode_literals from django.db import models from django.core.validators import RegexValidator from imagekit.models import ProcessedImageField from imagekit.processors import ResizeToFill from markdownx.models import MarkdownxField from markdownx.utils import markdownify class Profile(models....
{ "content_hash": "055375073c80462ff33c1fc80062d70e", "timestamp": "", "source": "github", "line_count": 52, "max_line_length": 93, "avg_line_length": 42.23076923076923, "alnum_prop": 0.6607468123861566, "repo_name": "wuga214/Django-Wuga", "id": "d0ddf45666bd9284b15031ffd4d73ee8e93fc319", "size": "2...
''' File: sql_io.py Author: Jon Eisen Description: Input and output routines for sql-disco ''' # Package mappings to DB-API 2.0 compliant dbs sql_packages = { 'mssql': 'pymssql' } def _import(sqltype): ''' Import the sql package in question ''' return __import__(sql_packages[sqltype]) ## Allow the throw conditi...
{ "content_hash": "cc505b97222fea875e7114e1a8c946d2", "timestamp": "", "source": "github", "line_count": 62, "max_line_length": 99, "avg_line_length": 27.79032258064516, "alnum_prop": 0.656993615786419, "repo_name": "yanatan16/sql-disco", "id": "0cd94b8fe9c6987c1c98847fa9c704aee11a75a7", "size": "17...
import procgame from procgame import * import locale import logging class DropTargets(game.Mode): """docstring for Bonus""" def __init__(self, game, priority): super(DropTargets, self).__init__(game, priority) self.dropTargetHurryUpEnabled = False #### Load Mode Feature Defaults #### #self.dropTargetHur...
{ "content_hash": "aa079166ee9106f05f9f0745e245bad9", "timestamp": "", "source": "github", "line_count": 48, "max_line_length": 160, "avg_line_length": 32.166666666666664, "alnum_prop": 0.741580310880829, "repo_name": "Curbfeeler/PinbotFromES", "id": "e10dbb7409a14c4b0d46d8ce6b3142d7b0e10b6d", "size...
import pytest import bassist.diff.flavor import bassist.flavor.obj @pytest.fixture(scope='function') def type_missing(): return bassist.diff.flavor.Flavor({}) def test_missing_type_different(type_missing): assert type_missing.different() is True def test_missing_type_matches(type_missing): assert type_m...
{ "content_hash": "d36fc664d11c6fb3b7e4ebbacfd27f6c", "timestamp": "", "source": "github", "line_count": 76, "max_line_length": 57, "avg_line_length": 30.473684210526315, "alnum_prop": 0.7167530224525043, "repo_name": "Doveps/bassist", "id": "2beb885408818570565b0e152c73522d770f998c", "size": "2395"...
from subprocess import call, check_output#, run import subprocess import os from multiprocessing import Pool import time import argparse import logging def chunks(l, n): """Yield successive n-sized chunks from l.""" for i in range(0, len(l), n): yield l[i:i + n] parser = argparse.ArgumentParser() pa...
{ "content_hash": "138581e22a5df1f10070bd231b673f81", "timestamp": "", "source": "github", "line_count": 221, "max_line_length": 161, "avg_line_length": 31.809954751131222, "alnum_prop": 0.6968705547652916, "repo_name": "raonyguimaraes/ngs_metrics", "id": "bff7f3b4a4a9b7a64e2e8b95cdf659f9931e91ba", ...
from __future__ import unicode_literals from botocore.vendored import requests from botocore.vendored.requests.packages import urllib3 def _exception_from_packed_args(exception_cls, args=None, kwargs=None): # This is helpful for reducing Exceptions that only accept kwargs as # only positional arguments can be...
{ "content_hash": "ae88364221246af453555e0374eabe87", "timestamp": "", "source": "github", "line_count": 552, "max_line_length": 80, "avg_line_length": 30.731884057971016, "alnum_prop": 0.6801461919358642, "repo_name": "gregbdunn/aws-ec2rescue-linux", "id": "9b39b61e8d8bd34a19a8cd66b76efe449884819f", ...
from paddle.fluid.tests.unittests.hdfs_test_utils import FSTestBase import unittest import paddle.fluid as fluid import os from paddle.distributed.fleet.utils.fs import FSTimeOut, HDFSClient java_home = os.environ["JAVA_HOME"] class FSTest1(FSTestBase): def test_timeout(self): fs = HDFSClient( ...
{ "content_hash": "2cd22e5af1ac1e33a1ec8b1e4c500d77", "timestamp": "", "source": "github", "line_count": 82, "max_line_length": 166, "avg_line_length": 39.68292682926829, "alnum_prop": 0.6296865396435156, "repo_name": "luotao1/Paddle", "id": "0b1f7b34b317ffa8632e4fc21cac96bf3a8aa41f", "size": "3865"...
""" profiling.timers ~~~~~~~~~~~~~~~~ """ from __future__ import absolute_import import time __all__ = ['Timer', 'ContextualTimer'] class Timer(object): """The basic timer.""" #: The raw function to get the CPU time. clock = time.clock def __call__(self): return self.clock() d...
{ "content_hash": "848f366cf7b525fc7cb63eea73761a98", "timestamp": "", "source": "github", "line_count": 51, "max_line_length": 76, "avg_line_length": 25.352941176470587, "alnum_prop": 0.6024748646558391, "repo_name": "tuxos/profiling", "id": "74d5a8ece9aaa0c7ac200ed7e742ccabe90117ba", "size": "1317...
import os as _os from setuptools import setup, find_packages # Get the version number execfile(_os.path.join('repobuddy', 'version.py')) setup( name='RepoBuddy', version=__version__, # pylint: disable=E0602 author='Ash', author_email='tuxdude.github@gmail.com', description='Multi-repository ma...
{ "content_hash": "941f16792ef2090f867a9fc101e62830", "timestamp": "", "source": "github", "line_count": 27, "max_line_length": 66, "avg_line_length": 32.851851851851855, "alnum_prop": 0.6482525366403608, "repo_name": "Tuxdude/repobuddy", "id": "6ad783370b8136716b9426b71c011e0b970e235b", "size": "15...
from neutron.api import extensions from neutron.api.v2 import attributes as attr from neutron.common import exceptions as excp from oslo_log import log as logging LOG = logging.getLogger(__name__) class InvalidInterfaceForCSRFW(excp.NotFound): message = _("Interface id %(port_id)s provided " "no...
{ "content_hash": "8db2d88ced7b1c2f49b844e34e0d0e96", "timestamp": "", "source": "github", "line_count": 66, "max_line_length": 78, "avg_line_length": 29.560606060606062, "alnum_prop": 0.627883136852896, "repo_name": "gaolichuang/neutron-fwaas", "id": "d1ab89b8e71bdda61463e750bf2cb4d5705aae5e", "siz...
def main(): print("This is the variables.py file.") if __name__ == "__main__": main()
{ "content_hash": "847e0f12ea69c693f636c77770379d6f", "timestamp": "", "source": "github", "line_count": 4, "max_line_length": 43, "avg_line_length": 22.75, "alnum_prop": 0.5494505494505495, "repo_name": "hckrtst/learnpython", "id": "f5f40033e094d295cefbae7cdf713a21bba851e1", "size": "274", "binar...
"""Starter script for Nova Conductor.""" import sys from oslo_concurrency import processutils from oslo_config import cfg from oslo_log import log as logging from nova import config from nova import objects from nova import service from nova import utils CONF = cfg.CONF CONF.import_opt('topic', 'nova.conductor.api'...
{ "content_hash": "7e5dafab926ca876a5f9aec483824e74", "timestamp": "", "source": "github", "line_count": 29, "max_line_length": 71, "avg_line_length": 27.551724137931036, "alnum_prop": 0.6795994993742178, "repo_name": "devendermishrajio/nova", "id": "2949f0b37d10f98462a0a355c09721ae48bf645d", "size"...
from absl import logging from absl.testing import parameterized import tensorflow as tf import utils from tf2 import util_keras class KerasUtilTest(tf.test.TestCase, parameterized.TestCase): @parameterized.named_parameters( ('train_local', True, ''), ('eval_local', False, ''), ('train_tpu', True, 'tpu...
{ "content_hash": "8315907c5345c398cf627f07f022ba59", "timestamp": "", "source": "github", "line_count": 26, "max_line_length": 74, "avg_line_length": 32.23076923076923, "alnum_prop": 0.6945107398568019, "repo_name": "google/automl", "id": "3284d20de1289eec1124647546bd1e26adf1d773", "size": "1520", ...
''' Manage the information in the hosts file ''' # Import python libs from __future__ import absolute_import import os # Import salt libs import salt.utils import salt.utils.odict as odict # Import 3rd-party libs import salt.ext.six as six from salt.ext.six.moves import range # pylint: disable=import-error,no-name-...
{ "content_hash": "03339a3211b2de10eae2aacd35a42c81", "timestamp": "", "source": "github", "line_count": 279, "max_line_length": 104, "avg_line_length": 25.13978494623656, "alnum_prop": 0.5470487596236099, "repo_name": "stephane-martin/salt-debian-packaging", "id": "28a80c33034bf50aa0936e3413d23d6b2c6...
class Session(object): """ This class concerns session code for Application to extend from """ def session(self, name=None, no_instance_error=False): """ The session to use :param name: The name of the session instance :type name: str ...
{ "content_hash": "84145750d08653fb957d7e917b7e9969", "timestamp": "", "source": "github", "line_count": 20, "max_line_length": 96, "avg_line_length": 34.1, "alnum_prop": 0.5645161290322581, "repo_name": "LowieHuyghe/edmunds", "id": "970175978e840bd5fffda0adf07ecae7cf5e3e6f", "size": "683", "binar...
""" Implements high-level access to committed datatypes in the file. """ from __future__ import absolute_import import posixpath as pp from ..h5t import TypeID from .base import HLObject, with_phil class Datatype(HLObject): """ Represents an HDF5 named datatype stored in a file. To store a...
{ "content_hash": "378571cdb23fdeed1a3c032f4e2bdf84", "timestamp": "", "source": "github", "line_count": 48, "max_line_length": 74, "avg_line_length": 27.645833333333332, "alnum_prop": 0.5674453654860587, "repo_name": "ryfeus/lambda-packs", "id": "8ecbb0f36c4bcd4333f2fc2c87620861851441dd", "size": "...
""" Python Interchangeable Virtual Instrument Library Copyright (c) 2012-2017 Alex Forencich 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...
{ "content_hash": "a36a0d084a2c81b85ecc8656f0f0ee06", "timestamp": "", "source": "github", "line_count": 44, "max_line_length": 86, "avg_line_length": 38.31818181818182, "alnum_prop": 0.7366548042704626, "repo_name": "alexforencich/python-ivi", "id": "a7396b979fac9a76f1282e2ff6f3354cf19ed82e", "size...
""" ClearCase file system; used to work with CC views """ import os, sys import time import copy import random import socket import pexpect from plumbum import local import rpyc socket.setdefaulttimeout(3) from thread import allocate_lock TWISTER_PATH = os.getenv('TWISTER_PATH') if not TWISTER_PATH: print '$TWI...
{ "content_hash": "467e6a16d3e044ca1596be3a368bbb49", "timestamp": "", "source": "github", "line_count": 284, "max_line_length": 116, "avg_line_length": 34.644366197183096, "alnum_prop": 0.49110681979876003, "repo_name": "ctgriffiths/twister", "id": "ab22b8b17133eb8ed2fe0be792043668cd4c0976", "size"...
from books.model.PageContext import PageContext class RecurringInvoiceList: """This class is used to create object for Recurring invoice list.""" def __init__(self): """Initialize parameters for Recurring invoice list.""" self.recurring_invoices = [] self.page_context = PageContext() ...
{ "content_hash": "dd291b24d3fa5f19df82ecd52a9849d8", "timestamp": "", "source": "github", "line_count": 45, "max_line_length": 73, "avg_line_length": 25.57777777777778, "alnum_prop": 0.6038227628149435, "repo_name": "zoho/books-python-wrappers", "id": "6a224317c7d793bc9214a6e59ba029e07568e6b5", "si...
""" This module provides classes and methods used to describe deformations and strains, including applying those deformations to structure objects and generating deformed structure sets for further calculations. """ import numpy as np import scipy import itertools import collections from pymatgen.core.lattice import...
{ "content_hash": "9648fbf410350a67ebab89019923edb0", "timestamp": "", "source": "github", "line_count": 259, "max_line_length": 77, "avg_line_length": 33.73359073359073, "alnum_prop": 0.60146503376445, "repo_name": "tschaume/pymatgen", "id": "48d1db4b3b65290db6ef7d152ae43ae7b44e941d", "size": "8848...
__author__ = 'jonathan' import test.nova._fixtures as models from lib.rome.core.orm.query import Query from lib.rome.core.orm.query import Query as RomeQuery from lib.rome.core.session.session import Session as RomeSession # from oslo.utils import timeutils from lib.rome.core.utils import timeutils import logging imp...
{ "content_hash": "28517bb44b42479be780d94a4d01f08b", "timestamp": "", "source": "github", "line_count": 114, "max_line_length": 80, "avg_line_length": 33.280701754385966, "alnum_prop": 0.650764364786505, "repo_name": "BeyondTheClouds/rome", "id": "2800b4274887ae1189de0c8f8ae72f51c4ff73c6", "size": ...
from netmiko.ssh_dispatcher import ConnectHandler from netmiko.ssh_dispatcher import ssh_dispatcher from netmiko.ssh_dispatcher import platforms from netmiko.scp_handler import SCPConn from netmiko.scp_handler import FileTransfer from netmiko.ssh_exception import NetMikoTimeoutException from netmiko.ssh_exception impor...
{ "content_hash": "abfc018add5d848797cd531e9900998f", "timestamp": "", "source": "github", "line_count": 11, "max_line_length": 86, "avg_line_length": 48.63636363636363, "alnum_prop": 0.805607476635514, "repo_name": "MikeOfNoTrades/netmiko", "id": "d3f865cb830d121ed959dd5a96465236f4552e1f", "size": ...
from __future__ import unicode_literals, print_function import cStringIO lines = open("../../../SDL/include/SDL_opengl_glext.h").readlines() funcs = ["glShaderSource", "glUseProgram", "glVertexAttribPointer", "glActiveTexture", "glEnableVertexAttribArray", "glDisableVertex...
{ "content_hash": "7c08411d318db31214374c45912ad1c8", "timestamp": "", "source": "github", "line_count": 164, "max_line_length": 88, "avg_line_length": 27.652439024390244, "alnum_prop": 0.5067254685777288, "repo_name": "daltomi/oxygine-framework", "id": "7a611eeddc22d529d1f3b9a471332b0c7e5bc223", "s...
from __future__ import absolute_import import types from tornado.options import define from tornado.options import options DEFAULT_CONFIG_FILE = 'flowerconfig.py' define("port", default=5555, help="run on the given port", type=int) define("address", default='', help="run on the given address", type=...
{ "content_hash": "e1efb649a1245cff16c0cd0cac6c64ef", "timestamp": "", "source": "github", "line_count": 67, "max_line_length": 96, "avg_line_length": 40.83582089552239, "alnum_prop": 0.7017543859649122, "repo_name": "raphaelmerx/flower", "id": "88da2a698c2744b1dc8db3e0aae5ca23b73456e2", "size": "27...
import math import warnings from copy import deepcopy from typing import Any, Optional import torch from torch import Tensor from ..distributions import MultivariateNormal, base_distributions from ..lazy import ZeroLazyTensor from ..utils.warnings import GPInputWarning from .likelihood import Likelihood from .noise_m...
{ "content_hash": "e7a86ec23d0ead9149a5fe5f4c0f500c", "timestamp": "", "source": "github", "line_count": 199, "max_line_length": 114, "avg_line_length": 40.904522613065325, "alnum_prop": 0.6423832923832924, "repo_name": "jrg365/gpytorch", "id": "e151ea415af1dfc4df4e88a1445f92f573ce8bf0", "size": "81...
import unittest from selenium import webdriver from selenium.webdriver.common.keys import Keys class php4dvd_search_film_negative(unittest.TestCase): def setUp(self): self.driver = webdriver.Firefox() self.driver.implicitly_wait(20) def test_search_negative(self): driver = self.drive...
{ "content_hash": "6a64ddced08c12a79fb63adb548aa1ce", "timestamp": "", "source": "github", "line_count": 32, "max_line_length": 75, "avg_line_length": 34.03125, "alnum_prop": 0.6556473829201102, "repo_name": "ArtemVavilov88/test2-Se-Python-14", "id": "17bfe54006d17070012401dde68cb28e9ff70063", "size...
"""create and manipulate C data types in Python""" import os as _os, sys as _sys __version__ = "1.1.0" from _ctypes import Union, Structure, Array from _ctypes import _Pointer from _ctypes import CFuncPtr as _CFuncPtr from _ctypes import __version__ as _ctypes_version from _ctypes import RTLD_LOCAL, RTLD_GLOBAL from...
{ "content_hash": "ab5132907a9fe6a312c965293d7c3d2a", "timestamp": "", "source": "github", "line_count": 543, "max_line_length": 97, "avg_line_length": 31.364640883977902, "alnum_prop": 0.6172861253009219, "repo_name": "maxdeliso/elevatorSim", "id": "f0bd66a17c86c92e1983d06b8d4fde4643c05ac1", "size"...
import tweepy # PIN-based OAuth # https://developer.twitter.com/en/docs/authentication/oauth-1-0a/pin-based-oauth # Your app's API/consumer key and secret can be found under the Consumer Keys # section of the Keys and Tokens tab of your app, under the # Twitter Developer Portal Projects & Apps page at # https://devel...
{ "content_hash": "27611c4934b5279a92f784eed90fb2cc", "timestamp": "", "source": "github", "line_count": 28, "max_line_length": 81, "avg_line_length": 32.964285714285715, "alnum_prop": 0.7659804983748646, "repo_name": "svven/tweepy", "id": "471aa881a99c94b250b9b319d678a5c0bc08966e", "size": "923", ...
from ..codes import CodeRun from .input import AbinitInput import os class AbinitRun(CodeRun): def __init__(self, workdir): CodeRun.__init__(self, executable='abinit', workdir=workdir, use_mpi=True) self.stdout_filename = 'abinit.out' self.stderr_filename = 'abinit.err' self.stdin...
{ "content_hash": "c93068722e534f2eb1b3c264be11fd85", "timestamp": "", "source": "github", "line_count": 28, "max_line_length": 86, "avg_line_length": 28.142857142857142, "alnum_prop": 0.6116751269035533, "repo_name": "MaterialsDiscovery/PyChemia", "id": "12c5bf46b67b30a97443d0fce6fef5cb459b6f35", "...
import time, traceback import collections import re import os import sys import csv import pprint, json import optparse from django.core.files.base import ContentFile from nameparser import HumanName from django.core.serializers import serialize from django.core.management.base import BaseCommand from django.conf impo...
{ "content_hash": "f50e2ebcea4c1f4e971625eb06b45c25", "timestamp": "", "source": "github", "line_count": 609, "max_line_length": 172, "avg_line_length": 58.592775041050906, "alnum_prop": 0.41193285317938516, "repo_name": "mykonosbiennale/mykonosbiennale.github.io", "id": "659fd83828277eff7d087e06a37e0...
from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('restaurant', '0040_auto_20150710_0845'), ] operations = [ migrations.AlterField( model_name='kitchen', name='status', ...
{ "content_hash": "fba22b1f7307465d078658db5521d46e", "timestamp": "", "source": "github", "line_count": 18, "max_line_length": 260, "avg_line_length": 32.888888888888886, "alnum_prop": 0.6216216216216216, "repo_name": "gauravbose/digital-menu", "id": "4939f6431b1b39d0ad642a8cd1ab6a4e37e2a167", "siz...
from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ( ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundEr...
{ "content_hash": "081cbb283f3f21b10b6ab8a9e42fe917", "timestamp": "", "source": "github", "line_count": 806, "max_line_length": 266, "avg_line_length": 50.56699751861042, "alnum_prop": 0.6633216380008342, "repo_name": "Azure/azure-sdk-for-python", "id": "b0b5324f92eae60445c1a549c4da06c04b1feed0", "...