text
stringlengths
5.09k
178k
domain
stringclasses
106 values
#!/usr/bin/python # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Ansible is distribut...
codeparrot/github-code-clean
import unittest import pandas as pd import pyspark.sql import pytest import random import hail as hl import hail.expr.aggregators as agg from hail.utils import new_temp_file from hail.utils.java import Env from ..helpers import * from test.hail.matrixtable.test_file_formats import create_all_values_datasets setUpMod...
codeparrot/github-code-clean
# coding: utf-8 from sqlalchemy import and_ from sqlalchemy import cast from sqlalchemy import Column from sqlalchemy import Computed from sqlalchemy import delete from sqlalchemy import Enum from sqlalchemy import exc from sqlalchemy import func from sqlalchemy import Index from sqlalchemy import Integer from sqlalch...
codeparrot/github-code-clean
# -*- coding: utf-8 -*- '''Chemical Engineering Design Library (ChEDL). Utilities for process modeling. Copyright (C) 2019 Caleb Bell <Caleb.Andrew.Bell@gmail.com> Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal ...
codeparrot/github-code-clean
#!/usr/bin/env python """A class for handling 5C analysis.""" import os import sys from math import log import numpy from scipy.stats import linregress import h5py from scipy.optimize import fmin_l_bfgs_b as bfgs import libraries._fivec_binning as _binning import libraries._fivec_optimize as _optimize import fivec_...
codeparrot/github-code-clean
# -*- coding: utf-8 -*- import logging # Get an instance of a logger logger = logging.getLogger(__name__) import mimetypes from django.conf.urls import url import json from tastypie.resources import ModelResource, Resource, ALL, ALL_WITH_RELATIONS from django.core.exceptions import ObjectDoesNotExist from tastypie.se...
codeparrot/github-code-clean
# -*- coding: UTF-8 -*- """ Data literal storing emoji names and unicode codes """ __all__ = ['EMOJI_UNICODE', 'UNICODE_EMOJI', 'EMOJI_ALIAS_UNICODE', 'UNICODE_EMOJI_ALIAS'] EMOJI_UNICODE = { u':1st_place_medal:': u'\U0001F947', u':2nd_place_medal:': u'\U0001F948', u':3rd_place_medal:': u'\U0001F949',...
codeparrot/github-code-clean
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright (C) 2009, 2010, 2012 Google Inc. All rights reserved. # Copyright (C) 2009 Torch Mobile Inc. # Copyright (C) 2009 Apple Inc. All rights reserved. # Copyright (C) 2010 Chris Jerdonek (cjerdonek@webkit.org) # # Redistribution and use in source and binary forms, with...
codeparrot/github-code-clean
#!/usr/bin/env python """ olevba.py olevba is a script to parse OLE and OpenXML files such as MS Office documents (e.g. Word, Excel), to extract VBA Macro code in clear text, deobfuscate and analyze malicious macros. Supported formats: - Word 97-2003 (.doc, .dot), Word 2007+ (.docm, .dotm) - Excel 97-2003 (.xls), Exc...
codeparrot/github-code-clean
#!/usr/bin/python # -*- coding: utf-8 -*- import nltk import sys import os.path reload(sys) sys.setdefaultencoding('utf8') def load_dictionary(fn): dictionary = {} with open(fn) as f: for line in f: line = line.replace('\r', '') chinese, pinyin, defn = line.rstrip('\n').split('\t') trad = chinese.split(' ...
codeparrot/github-code-clean
# -*- coding: utf-8 -*- # # 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 ...
codeparrot/github-code-clean
"""Filter design. """ from __future__ import division, print_function, absolute_import import warnings import numpy from numpy import atleast_1d, poly, polyval, roots, real, asarray, allclose, \ resize, pi, absolute, logspace, r_, sqrt, tan, log10, arctan, arcsinh, \ cos, exp, cosh, arccosh, ceil, conjugate, ...
codeparrot/github-code-clean
from __future__ import print_function, division import decimal import fractions import math import re as regex from collections import defaultdict from .containers import Tuple from .sympify import converter, sympify, _sympify, SympifyError from .singleton import S, Singleton from .expr import Expr, AtomicExpr from ....
codeparrot/github-code-clean
import vstruct from vstruct.primitives import * class RadioConfig(vstruct.VStruct): def __init__(self): vstruct.VStruct.__init__(self) self.sync1 = v_uint8() #df00 self.sync0 = v_uint8() #df01 self.pktlen = v_uint8() #df02 self.pktctrl1 = v_...
codeparrot/github-code-clean
# Copyright (c) 2012 Rackspace Hosting # All Rights Reserved. # Copyright 2010 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # All Rights Reserved. # Copyright 2013 Red Hat, Inc. # # Licensed under the Apache License, Version 2.0 (the "License");...
codeparrot/github-code-clean
# Copyright (c) Gary Strangman. All rights reserved # # Disclaimer # # This software is provided "as-is". There are no expressed or implied # warranties of any kind, including, but not limited to, the warranties # of merchantability and fitness for a given application. In no event # shall Gary Strangman be liable fo...
codeparrot/github-code-clean
#!/usr/bin/env python3 # Copyright (c) 2016-2019 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """Test segwit transactions and blocks on P2P network.""" import math import random import struct import t...
codeparrot/github-code-clean
# -*- coding: utf-8 -*- import sys import textwrap import pytest from _pytest import fixtures from _pytest.fixtures import FixtureLookupError from _pytest.fixtures import FixtureRequest from _pytest.pathlib import Path from _pytest.pytester import get_public_names from _pytest.warnings import SHOW_PYTEST_WARNINGS_ARG ...
codeparrot/github-code-clean
# Copyright (c), Michael DeHaan <michael.dehaan@gmail.com>, 2012-2013 # Copyright (c), Toshio Kuratomi <tkuratomi@ansible.com> 2016 # Simplified BSD License (see licenses/simplified_bsd.txt or https://opensource.org/licenses/BSD-2-Clause) from __future__ import absolute_import, division, print_function SIZE_RANGES = ...
codeparrot/github-code-clean
# This code is part of Ansible, but is an independent component. # This particular file snippet, and this file snippet only, is BSD licensed. # Modules you write using this snippet, which is embedded dynamically by Ansible # still belong to the author of the module, and may assign their own license # to the complete wo...
codeparrot/github-code-clean
#!/usr/bin/env python """ A linting tool to check if templates are safe """ from __future__ import print_function import argparse import ast import os import re import sys import textwrap from enum import Enum class StringLines(object): """ StringLines provides utility methods to work with a string in terms...
codeparrot/github-code-clean
# Copyright 2012 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # All Rights Reserved. # # Copyright 2012 Nebula, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the...
codeparrot/github-code-clean
# # Copyright (c) 2008-2015 Citrix Systems, Inc. # # Licensed under the Apache License, Version 2.0 (the "License") # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable l...
codeparrot/github-code-clean
# Copyright 2019 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 applica...
codeparrot/github-code-clean
# # Copyright (c) 2016 Juniper Networks, Inc. All rights reserved. # """ This file contains implementation of data model for kube manager """ import json from cfgm_common.vnc_db import DBBase from bitstring import BitArray from vnc_api.vnc_api import (KeyValuePair) from kube_manager.vnc.vnc_kubernetes_config import V...
codeparrot/github-code-clean
from pybindgen import Module, FileCodeSink, param, retval, cppclass, typehandlers import pybindgen.settings import warnings class ErrorHandler(pybindgen.settings.ErrorHandler): def handle_error(self, wrapper, exception, traceback_): warnings.warn("exception %r in wrapper %s" % (exception, wrapper)) ...
codeparrot/github-code-clean
#!/usr/bin/env python # # run-tests.py - Run a set of tests on Mercurial # # Copyright 2006 Matt Mackall <mpm@selenic.com> # # This software may be used and distributed according to the terms of the # GNU General Public License version 2 or any later version. # Modifying this script is tricky because it has many modes...
codeparrot/github-code-clean
"""Unit/Functional tests""" import datetime import os from django.contrib.admin.sites import AdminSite from django.contrib.admin.views.main import ChangeList from django.contrib.auth.models import User, AnonymousUser from django.contrib.messages.storage.fallback import FallbackStorage from django.db.models import Q f...
codeparrot/github-code-clean
# # File: courseware/capa/responsetypes.py # """ Problem response evaluation. Handles checking of student responses, of a variety of types. Used by capa_problem.py """ # pylint: disable=attribute-defined-outside-init # standard library imports import abc # TODO: Refactor this code and fix this issue. import cgi im...
codeparrot/github-code-clean
# Copyright (c) 2016 PaddlePaddle 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...
codeparrot/github-code-clean
# Copyright (c), Michael DeHaan <michael.dehaan@gmail.com>, 2012-2013 # Copyright (c), Toshio Kuratomi <tkuratomi@ansible.com> 2016 # Simplified BSD License (see licenses/simplified_bsd.txt or https://opensource.org/licenses/BSD-2-Clause) from __future__ import absolute_import, division, print_function FILE_ATTRIBUTE...
codeparrot/github-code-clean
# # @BEGIN LICENSE # # Psi4: an open-source quantum chemistry software package # # Copyright (c) 2007-2021 The Psi4 Developers. # # The copyrights for code used from other parties are included in # the corresponding files. # # This file is part of Psi4. # # Psi4 is free software; you can redistribute it and/or modify #...
codeparrot/github-code-clean
# Copyright 2015 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 applica...
codeparrot/github-code-clean
# Copyright 2016 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 applica...
codeparrot/github-code-clean
# Author: Steven J. Bethard <steven.bethard@gmail.com>. """Command-line parsing library This module is an optparse-inspired command-line parsing library that: - handles both optional and positional arguments - produces highly informative usage messages - supports parsers that dispatch to sub-parsers The...
codeparrot/github-code-clean
from rpython.jit.codewriter import heaptracker, longlong from rpython.jit.codewriter.jitcode import JitCode, SwitchDictDescr from rpython.jit.metainterp.compile import ResumeAtPositionDescr from rpython.jit.metainterp.jitexc import get_llexception, reraise from rpython.jit.metainterp import jitexc from rpython.jit.meta...
codeparrot/github-code-clean
"""basic tests of eager loaded attributes""" from sqlalchemy.test.testing import eq_, is_, is_not_ import sqlalchemy as sa from sqlalchemy.test import testing from sqlalchemy.orm import joinedload, deferred, undefer, joinedload_all, backref from sqlalchemy import Integer, String, Date, ForeignKey, and_, select, func f...
codeparrot/github-code-clean
from __future__ import absolute_import from __future__ import division import math from builtins import str from builtins import range from past.utils import old_div import proteus from proteus import Profiling import numpy as np from proteus.Transport import OneLevelTransport import os from proteus import cfemIntegral...
codeparrot/github-code-clean
# Copyright 2005 Duke University # Copyright (C) 2012-2013 Red Hat, Inc. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later versi...
codeparrot/github-code-clean
"""Wrapper functions for Tcl/Tk. Tkinter provides classes which allow the display, positioning and control of widgets. Toplevel widgets are Tk and Toplevel. Other widgets are Frame, Label, Entry, Text, Canvas, Button, Radiobutton, Checkbutton, Scale, Listbox, Scrollbar, OptionMenu, Spinbox LabelFrame and PanedWindow. ...
codeparrot/github-code-clean
#! /usr/bin/env python2 # Copyright (c) 2012-2014 Michael Haggerty and others # Derived from contrib/hooks/post-receive-email, which is # Copyright (c) 2007 Andy Parkins # and also includes contributions by other authors. # # This file is part of git-multimail. # # git-multimail is free software: you can redistribute ...
codeparrot/github-code-clean
# -*- coding: utf8 -*- list = [ { 'title' : u'VOCABULARIO COMPARATIVO - Palabras Selectas de Lenguas Indígenas de Colombia', 'author' : u'Huber, Randall Q. & Reed, Robert B.', 'year' : 1992, 'bibtex_key' : u'huber1992', 'pages' : 392, 'columns' : 0, 'is_ready' : ...
codeparrot/github-code-clean
# -*- coding: utf-8 -*- import base64 import datetime import json import time from urlparse import urlparse import mock import pytest import requests_mock from constance.test import override_config from django.conf import settings from django.contrib.auth.models import Permission from django.contrib.sites.models impor...
codeparrot/github-code-clean
# Copyright 2010-2011 OpenStack Foundation # Copyright 2011 Piston Cloud Computing, 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...
codeparrot/github-code-clean
# Copyright (c) 2013 Hewlett-Packard Development Company, L.P. # Copyright (c) 2012 VMware, Inc. # Copyright (c) 2011 Citrix Systems, Inc. # Copyright 2011 OpenStack Foundation # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. Yo...
codeparrot/github-code-clean
#!/usr/bin/env ambari-python-wrap """ Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the...
codeparrot/github-code-clean
# Copyright 2010 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a ...
codeparrot/github-code-clean
from __future__ import annotations import math import warnings from collections import namedtuple import numpy as np from numpy import (isscalar, r_, log, around, unique, asarray, zeros, arange, sort, amin, amax, atleast_1d, sqrt, array, compress, pi, exp, ravel, count_nonzero, si...
codeparrot/github-code-clean
# coding: utf-8 # Copyright (c) Pymatgen Development Team. # Distributed under the terms of the MIT License. """ This module implements plotter for DOS and band structure. """ import copy import itertools import logging import math import warnings from collections import Counter, OrderedDict import matplotlib.lines a...
codeparrot/github-code-clean
# Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not use ...
codeparrot/github-code-clean
# # Authors: Travis Oliphant, Ed Schofield, Robert Cimrman, Nathan Bell, and others """ Test functions for sparse matrices. Each class in the "Matrix class based tests" section become subclasses of the classes in the "Generic tests" section. This is done by the functions in the "Tailored base class for generic tests" ...
codeparrot/github-code-clean
# -*- coding: utf-8 -*- # transformations.py # Copyright (c) 2006-2013, Christoph Gohlke # Copyright (c) 2006-2013, The Regents of the University of California # Produced at the Laboratory for Fluorescence Dynamics # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modifica...
codeparrot/github-code-clean
"""Tests for items views.""" import json from datetime import datetime, timedelta import ddt from mock import patch from pytz import UTC from webob import Response from django.http import Http404 from django.test import TestCase from django.test.client import RequestFactory from django.core.urlresolvers import revers...
codeparrot/github-code-clean
# Copyright 2015 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 applica...
codeparrot/github-code-clean
""" An extension of scipy.stats.stats to support masked arrays :author: Pierre GF Gerard-Marchant :contact: pierregm_at_uga_edu """ #TODO : f_value_wilks_lambda looks botched... what are dfnum & dfden for ? #TODO : ttest_reel looks botched: what are x1,x2,v1,v2 for ? #TODO : reimplement ksonesamp __author__ = "Pierr...
codeparrot/github-code-clean
#Copyright ReportLab Europe Ltd. 2000-2012 #see license.txt for license details #history http://www.reportlab.co.uk/cgi-bin/viewcvs.cgi/public/reportlab/trunk/reportlab/platypus/flowables.py __version__=''' $Id$ ''' __doc__=""" A flowable is a "floating element" in a document whose exact position is determined by the o...
codeparrot/github-code-clean
import struct, binascii,hashlib from Crypto.PublicKey import RSA from Crypto.Cipher import PKCS1_OAEP ## serpent.py - pure Python implementation of the Serpent algorithm. ## Bjorn Edstrom <be@bjrn.se> 13 december 2007. ## ## Copyrights ## ========== ## ## This code is a derived from an implementation by Dr B...
codeparrot/github-code-clean
# -*- coding: utf-8 -*- """ NeuroTools.signals.spikes ================== A collection of functions to create, manipulate and play with spikes signals. Classes ------- SpikeTrain - object representing a spike train, for one cell. Useful for plots, calculations such as ISI, CV, mean rate(), ...
codeparrot/github-code-clean
from MemoryTape import MemoryTape import putget as pg ptr=0 mem=MemoryTape() ptr+=1 ptr+=1 ptr+=1 ptr+=1 ptr+=1 ptr+=1 while mem[ptr]: mem[ptr]-=1 mem[ptr]+=1 mem[ptr]+=1 mem[ptr]+=1 mem[ptr]+=1 ptr+=1 ptr+=1 ptr+=1 ptr+=1 ptr+=1 ptr+=1 ptr+=1 ptr+=1 while mem[ptr]: mem[ptr]-=1 mem[ptr]+=1 mem[ptr]+=1 mem[ptr]+=1 m...
codeparrot/github-code-clean
#!/usr/bin/env python # # Electrum - lightweight Bitcoin client # Copyright (C) 2012 thomasv@gitorious # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at...
codeparrot/github-code-clean
import datetime import json import re from django.contrib.auth.models import User, Permission from django.core.urlresolvers import reverse from django.conf import settings import mock from nose.tools import eq_, ok_ from waffle import Switch from crashstats.base.tests.testbase import TestCase from crashstats.crashst...
codeparrot/github-code-clean
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU...
codeparrot/github-code-clean
#*************************************************************************** #* * #* Copyright (c) 2014 * #* Yorik van Havre <yorik@uncreated.net> * #* ...
codeparrot/github-code-clean
# Copyright 2017 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 applica...
codeparrot/github-code-clean
# -*- coding: utf-8 -*- from south.utils import datetime_utils as datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): # Flag to indicate if this migration is too risky # to run online and needs to be coordinated for offline ...
codeparrot/github-code-clean
# -*- coding: utf-8 -*- import re from datetime import datetime from urllib.parse import quote, quote_plus, urlencode from plexapi import X_PLEX_CONTAINER_SIZE, log, media, utils from plexapi.base import OPERATORS, PlexObject from plexapi.exceptions import BadRequest, NotFound from plexapi.settings import Setting from...
codeparrot/github-code-clean
# coding=utf-8 # 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 by appl...
codeparrot/github-code-clean
# Videos from Evangelidis (with highway and cars), taking out frames at 1 fps (jump every 25 frames) import numpy as np harlocsQ = [None] * 31 #np.zeros(()) harlocsR = [None] * 92 #for i, h in enumerate(harlocsQ): # harlocsQ[i] = harlocsQ[0] = np.array(\ [[131.632095, 6.154750, 1.000000], [146.831779,...
codeparrot/github-code-clean
# -*- coding: Latin-1 -*- """pefile, Portable Executable reader module All the PE file basic structures are available with their default names as attributes of the instance returned. Processed elements such as the import table are made available with lowercase names, to differentiate them from the upper case basic s...
codeparrot/github-code-clean
# Licensed under a 3-clause BSD style license - see PYFITS.rst import copy import operator import re import sys import warnings import weakref from functools import reduce from collections import OrderedDict import numpy as np from numpy import char as chararray from . import _numpy_hacks as nh from .card import Ca...
codeparrot/github-code-clean
#!/usr/bin/env python # Copyright (c) 2012 Trent Mick. # Copyright (c) 2007-2008 ActiveState Corp. # License: MIT (http://www.opensource.org/licenses/mit-license.php) from __future__ import generators r"""A fast and complete Python implementation of Markdown. [from http://daringfireball.net/projects/markdown/] > Mar...
codeparrot/github-code-clean
#!/usr/bin/env python # Copyright (c) 2012 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Basic pyauto performance tests. For tests that need to be run for multiple iterations (e.g., so that average and standard devia...
codeparrot/github-code-clean
# Copyright 2010 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # Copyright 2011 Piston Cloud Computing, Inc. # Copyright 2012-2013 Red Hat, Inc. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # ...
codeparrot/github-code-clean
# Copyright 2015 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 applica...
codeparrot/github-code-clean
from pybindgen import Module, FileCodeSink, param, retval, cppclass, typehandlers import pybindgen.settings import warnings class ErrorHandler(pybindgen.settings.ErrorHandler): def handle_error(self, wrapper, exception, traceback_): warnings.warn("exception %r in wrapper %s" % (exception, wrapper)) ...
codeparrot/github-code-clean
# coding=utf-8 # (The line above is necessary so that I can use 世界 in the # *comment* below without Python getting all bent out of shape.) # Copyright 2007-2009 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 o...
codeparrot/github-code-clean
# # File: courseware/capa/responsetypes.py # """ Problem response evaluation. Handles checking of student responses, of a variety of types. Used by capa_problem.py """ # standard library imports import abc import cgi import inspect import json import logging import html5lib import numbers import numpy import os fr...
codeparrot/github-code-clean
""" Locale support. The module provides low-level access to the C lib's locale APIs and adds high level number formatting APIs as well as a locale aliasing engine to complement these. The aliasing engine includes support for many commonly used locale names and maps them to values suitable for pass...
codeparrot/github-code-clean
# Copyright (C) 2003-2007 Robey Pointer <robeypointer@gmail.com> # # This file is part of paramiko. # # Paramiko 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 2.1 of the License, or (a...
codeparrot/github-code-clean
"""Wrapper functions for Tcl/Tk. Tkinter provides classes which allow the display, positioning and control of widgets. Toplevel widgets are Tk and Toplevel. Other widgets are Frame, Label, Entry, Text, Canvas, Button, Radiobutton, Checkbutton, Scale, Listbox, Scrollbar, OptionMenu, Spinbox LabelFrame and PanedWindow. ...
codeparrot/github-code-clean
#!/usr/bin/env python # -*- coding: utf-8 -*- import urllib, urllib2, re, xbmcplugin, xbmcgui, os import xml.etree.ElementTree as ET import cookielib import settings, time from t0mm0.common.net import Net import xbmcaddon import io import json import random import datetime import xbmc from operator import itemgetter f...
codeparrot/github-code-clean
# -*- coding: utf-8 -*- # Resource object code # # Created by: The Resource Compiler for PyQt5 (Qt v5.4.1) # # WARNING! All changes made in this file will be lost! from PyQt5 import QtCore qt_resource_data = b"\ \x00\x00\x0a\x37\ \x89\ \x50\x4e\x47\x0d\x0a\x1a\x0a\x00\x00\x00\x0d\x49\x48\x44\x52\x00\ \x00\x00\x5a\x0...
codeparrot/github-code-clean
# -*- coding: utf-8 -*- # # Copyright (c) 2009-2021 Tom Keffer <tkeffer@gmail.com> # # See the file LICENSE.txt for your full rights. # """Data structures and functions for dealing with units.""" # # The doctest examples work only under Python 3!! # from __future__ import absolute_import from __future__ import...
codeparrot/github-code-clean
# Copyright 2010 by Dana Larose # This file is part of crashRun. # crashRun is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. ...
codeparrot/github-code-clean
#!/usr/bin/env python ############################################################################### # ____ _ _ _ ____ _ _ # # | _ \ __ _ _ __| |_(_) ___| | ___/ ___|| |_ __ _| |_ ___ # # | |_) / _` | '__| __| |/ __| |/ _ \___ \| __/ _` |...
codeparrot/github-code-clean
# Copyright(C) 2011,2012,2013 by John Tobey <jtobey@john-edwin-tobey.org> # DataStore.py: back end database access for Abe. # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as # published by the Free Software Foundation, either versio...
codeparrot/github-code-clean
#!/usr/bin/python # api.py # # Copyright (C) 2008-2018 Veselin Penev, https://bitdust.io # # This file (api.py) is part of BitDust Software. # # BitDust is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by # the Free Software Foundation, e...
codeparrot/github-code-clean
""" Student Views """ import datetime import logging import uuid import json import warnings from collections import defaultdict from urlparse import urljoin from pytz import UTC from requests import HTTPError from ipware.ip import get_ip from django.conf import settings from django.contrib.auth import logout, authen...
codeparrot/github-code-clean
# # 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 # ...
codeparrot/github-code-clean
# coding=utf-8 # Copyright 2022 The REALM authors and The HuggingFace Inc. team. # # 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 ...
codeparrot/github-code-clean
# -*- 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...
codeparrot/github-code-clean
# Copyright 2010 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a ...
codeparrot/github-code-clean
# Copyright (c) 2012 Rackspace Hosting # All Rights Reserved. # Copyright 2010 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # All Rights Reserved. # Copyright 2013 Red Hat, Inc. # # Licensed under the Apache License, Version 2.0 (the "License");...
codeparrot/github-code-clean
#!/usr/bin/env python """Library for test_valve.py.""" # Copyright (C) 2015 Research and Innovation Advanced Network New Zealand Ltd. # Copyright (C) 2015--2019 The Contributors # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You...
codeparrot/github-code-clean
from collections import namedtuple from dataclasses import make_dataclass import numpy as np import warnings from itertools import combinations, permutations, product import scipy.stats from scipy.optimize import shgo from . import distributions from ._common import ConfidenceInterval from ._continuous_distns import ch...
codeparrot/github-code-clean
""" Automatically running tests for this library. Run these from the project directory (i.e. parent directory) via python test.py """ from __future__ import print_function, division #import sys #import os #sys.path.append(os.path.join(os.path.dirname(__file__), '..')) import imgaug as ia from imgaug import augmen...
codeparrot/github-code-clean
import unittest import warnings from collections import OrderedDict import numpy as np import numpy.testing as np_test from pgmpy.factors.discrete import DiscreteFactor from pgmpy.factors.discrete import JointProbabilityDistribution as JPD from pgmpy.factors import factor_divide from pgmpy.factors import factor_produ...
codeparrot/github-code-clean
# Copyright 2002 Gary Strangman. All rights reserved # Copyright 2002-2016 The SciPy Developers # # The original code from Gary Strangman was heavily adapted for # use in SciPy by Travis Oliphant. The original code came with the # following disclaimer: # # This software is provided "as-is". There are no expressed or...
codeparrot/github-code-clean
import unittest import random import time import math import sys import array import urllib import tarfile import hashlib import os import getopt import operator import functools import cv class OpenCVTests(unittest.TestCase): depths = [ cv.IPL_DEPTH_8U, cv.IPL_DEPTH_8S, cv.IPL_DEPTH_16U, cv.IPL_DEPTH_16S, cv.IP...
codeparrot/github-code-clean
# # Author: Travis Oliphant 2002-2011 with contributions from # SciPy Developers 2004-2011 # from __future__ import division, print_function, absolute_import import warnings from scipy.special import comb from scipy.misc.doccer import inherit_docstring_from from scipy import special from scipy import optim...
codeparrot/github-code-clean