code
stringlengths
1
25.8M
language
stringclasses
18 values
source
stringclasses
4 values
repo
stringclasses
78 values
path
stringlengths
0
268
""" Polygon path. """ from __future__ import absolute_import #Init has to be imported first because it has code to workaround the python bug where relative imports don't work if the module is imported as a main module. import __init__ from fabmetheus_utilities.geometry.geometry_utilities import evaluate __author__ ...
unknown
codeparrot/codeparrot-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...
unknown
codeparrot/codeparrot-clean
import * as React from "react"; export default function LazyComponent() { return <h1>Lazy</h1>; }
typescript
github
https://github.com/remix-run/react-router
packages/react-router/__tests__/dom/components/LazyComponent.tsx
# Copyright 2022 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...
python
github
https://github.com/tensorflow/tensorflow
tensorflow/core/function/polymorphism/function_type.py
# -*- coding: utf-8 -*- import csv import numbers from itertools import izip pass_throughs = [ 'register_dialect', 'unregister_dialect', 'get_dialect', 'list_dialects', 'field_size_limit', 'Dialect', 'excel', 'excel_tab', 'Sniffer', 'QUOTE_ALL', 'QUOTE_MINIMAL', 'QUOTE_...
unknown
codeparrot/codeparrot-clean
#!/usr/bin/env python # -*- coding: utf-8 -*- __author__ = 'Peter M. Landwehr <plandweh@cs.cmu.edu>' from collections import defaultdict from datetime import datetime from lxml import etree def node_tuple(): """ :returns: The tuple that defines a node :rtype: :class:`tuple_(dict, dict)` """ retur...
unknown
codeparrot/codeparrot-clean
from __future__ import absolute_import import warnings from functools import wraps from itertools import count from django.db import transaction, connection try: from django.db import connections, router except ImportError: # pre-Django 1.2 connections = router = None # noqa from django.db import models f...
unknown
codeparrot/codeparrot-clean
# -*- coding: utf-8 -*- # Copyright (c) 2012-2015, Anima Istanbul # # This module is part of anima-tools and is released under the BSD 2 # License: http://www.opensource.org/licenses/BSD-2-Clause """Anima Previs Editor """ import os import pymel import anima from anima.env.mayaEnv import Maya from pymel import core...
unknown
codeparrot/codeparrot-clean
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright: (c) 2018, Abhijeet Kasurde <akasurde@redhat.com> # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = { 'metadata_...
unknown
codeparrot/codeparrot-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 ...
unknown
codeparrot/codeparrot-clean
CREATE EXTENSION hstore_plperl CASCADE; SELECT transforms.udt_schema, transforms.udt_name, routine_schema, routine_name, group_name, transform_type FROM information_schema.transforms JOIN information_schema.routines USING (specific_catalog, specific_schema, specific_name) ORDER BY 1, 2, 5, 6; -- te...
sql
github
https://github.com/postgres/postgres
contrib/hstore_plperl/sql/hstore_plperl.sql
from __future__ import absolute_import from __future__ import division from __future__ import print_function from keras.optimizers import SGD from keras.optimizers import Adam import os # ------------------------------------------------- # Background config: # DATA_DIR= '/home/pratik/DeepIntent_Datasets/KITTI_Dataset...
unknown
codeparrot/codeparrot-clean
from kivy.properties import BooleanProperty, ObjectProperty, StringProperty from kivy.uix.boxlayout import BoxLayout class CodeInputFind(BoxLayout): '''Widget responsible for searches in the Python Code Input ''' query = StringProperty('') '''Search query :data:`query` is a :class:`~kivy.propertie...
unknown
codeparrot/codeparrot-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...
python
github
https://github.com/tensorflow/tensorflow
tensorflow/examples/speech_commands/train_test.py
import pytest import os import fnmatch import tarfile import numpy as np import dask from contextlib import contextmanager import py import tempfile import hashlib try: import urllib.request as req except ImportError: # urllib in python2 has different structure import urllib as req from xmitgcm.file_utils ...
unknown
codeparrot/codeparrot-clean
// Copyright © 2022 Apple Inc. #include <ATen/ATen.h> #include <ATen/Tensor.h> #include <ATen/Utils.h> #include <torch/library.h> #include <ATen/mps/EmptyTensor.h> #include <ATen/mps/MPSDevice.h> #include <ATen/native/Resize.h> #include <ATen/native/ResizeCommon.h> #include <ATen/native/mps/Copy.h> #include <ATen/nat...
cpp
github
https://github.com/pytorch/pytorch
aten/src/ATen/native/mps/TensorFactory.cpp
#!/bin/sh # # Copyright (c) 2005 Junio C Hamano # test_description='git apply handling binary patches ' GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME . ./test-lib.sh test_expect_success 'setup' ' cat >file1 <<-\EOF && A quick brown fox jumps over the lazy dog. A tiny littl...
unknown
github
https://github.com/git/git
t/t4103-apply-binary.sh
# -*- coding: utf-8 -*- # (c) 2015 Ainara Galdona - AvanzOSC # License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html from openerp import api, fields, models class MrpConfigSettings(models.TransientModel): _inherit = 'mrp.config.settings' final_product_analytic_cost = fields.Boolean( string='...
unknown
codeparrot/codeparrot-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 us...
unknown
github
https://github.com/apache/airflow
CODE_OF_CONDUCT.md
from unittest import TestCase import textwrap from jsonschema import Draft4Validator, exceptions from jsonschema.compat import PY3 class TestBestMatch(TestCase): def best_match(self, errors): errors = list(errors) best = exceptions.best_match(errors) reversed_best = exceptions.best_match(r...
unknown
codeparrot/codeparrot-clean
<?php /* * This file is part of the Symfony package. * * (c) Fabien Potencier <fabien@symfony.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\DependencyInjection\Loader\Configurator; use Symfony\...
php
github
https://github.com/symfony/symfony
src/Symfony/Bundle/SecurityBundle/Resources/config/security_role_hierarchy_dump_command.php
#!/usr/bin/env python2 __license__ = 'GPL v3' __copyright__ = '2008, Kovid Goyal kovid@kovidgoyal.net' __docformat__ = 'restructuredtext en' from PyQt5.Qt import ( QDialog, Qt, QPixmap, QIcon, QSize, QVBoxLayout, QHBoxLayout, QLabel, QCheckBox, QDialogButtonBox) from calibre import confirm_config_name from...
unknown
codeparrot/codeparrot-clean
from datetime import datetime from recurrence import Recurrence, Rule import recurrence def test_truthiness_with_single_rrule(): rule = Rule( recurrence.DAILY ) object = Recurrence( rrules=[rule] ) assert bool(object) def test_truthiness_with_single_exrule(): rule = Rule( ...
unknown
codeparrot/codeparrot-clean
/////////////////////////////////////////////////////////////////////////// // // Copyright (c) 2004, Industrial Light & Magic, a division of Lucas // Digital Ltd. LLC // // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the fol...
c
github
https://github.com/opencv/opencv
3rdparty/openexr/IlmImf/ImfPizCompressor.h
from sqlalchemy import create_engine from sqlalchemy.orm import sessionmaker from sqlalchemy.ext.declarative import declarative_base from sqlalchemy.engine.url import URL from sqlalchemy_utils import database_exists, create_database, drop_database from contextlib import contextmanager import pytest from . import settin...
unknown
codeparrot/codeparrot-clean
from __future__ import absolute_import, division, print_function, with_statement import traceback from tornado.concurrent import Future from tornado import gen from tornado.httpclient import HTTPError, HTTPRequest from tornado.log import gen_log, app_log from tornado.testing import AsyncHTTPTestCase, gen_test, bind_u...
unknown
codeparrot/codeparrot-clean
from pandas.io.parsers.readers import ( TextFileReader, TextParser, read_csv, read_fwf, read_table, ) __all__ = ["TextFileReader", "TextParser", "read_csv", "read_fwf", "read_table"]
python
github
https://github.com/pandas-dev/pandas
pandas/io/parsers/__init__.py
# Copyright (c) 2010 The Hewlett-Packard Development Company # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: redistributions of source code must retain the above copyright # notice, this list of...
unknown
codeparrot/codeparrot-clean
/* * Copyright 2002-present the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required b...
java
github
https://github.com/spring-projects/spring-framework
spring-aop/src/main/java/org/aopalliance/intercept/ConstructorInterceptor.java
# -*- coding: utf-8 -*- from django.conf.urls import patterns, url from geonode.qgis_server.views import ( download_zip, tile, legend, thumbnail, qgis_server_request, qgis_server_pdf, qgis_server_map_print ) __author__ = 'ismailsunni' __project_name__ = 'geonode' __filename__ = 'urls' __da...
unknown
codeparrot/codeparrot-clean
#!/usr/bin/env python # -*- coding: utf-8 -*- ''' External inventory script for Abiquo ==================================== Shamelessly copied from an existing inventory script. This script generates an inventory that Ansible can understand by making API requests to Abiquo API Requires some python libraries, ensure ...
unknown
codeparrot/codeparrot-clean
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2015, Manuel Sousa <manuel.sousa@gmail.com> # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the...
unknown
codeparrot/codeparrot-clean
import os import time from nose.tools import eq_, ok_ from pushtest.client import ( quick_register ) def check_environ(): return os.environ.get("PUSH_SERVER") def test_delivery_while_disconnected(url=None): url = url or check_environ() client = quick_register(url) client.disconnect() ok_(cli...
unknown
codeparrot/codeparrot-clean
// Copyright (c) HashiCorp, Inc. // SPDX-License-Identifier: BUSL-1.1 package command import ( "bytes" "os" "path/filepath" "strings" "testing" "github.com/hashicorp/cli" "github.com/hashicorp/terraform/internal/addrs" "github.com/hashicorp/terraform/internal/providers" "github.com/hashicorp/terraform/inte...
go
github
https://github.com/hashicorp/terraform
internal/command/state_rm_test.go
// Copyright 2018 Gin Core Team. All rights reserved. // Use of this source code is governed by a MIT style // license that can be found in the LICENSE file. package render import ( "io" "net/http" "strconv" ) // Reader contains the IO reader and its length, and custom ContentType and other headers. type Reader s...
go
github
https://github.com/gin-gonic/gin
render/reader.go
DOCUMENTATION: name: b64encode author: ansible core team version_added: 'historical' short_description: Encode a string as Base64 description: - Base64 encoding function. positional: _input options: _input: description: A string to encode. type: string required: true encoding...
unknown
github
https://github.com/ansible/ansible
lib/ansible/plugins/filter/b64encode.yml
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)) ...
unknown
codeparrot/codeparrot-clean
# Python CircleCI 2.1 configuration file # # Check https://circleci.com/docs/2.1/language-python/ for more details # version: 2.1 # Aliases to reuse _defaults: &defaults docker: # CircleCI maintains a library of pre-built images # documented at https://circleci.com/developer/images/image/cimg/python - im...
unknown
github
https://github.com/numpy/numpy
.circleci/config.yml
""" Table of Contents Extension for Python-Markdown * * * (c) 2008 [Jack Miller](http://codezen.org) Dependencies: * [Markdown 2.1+](http://packages.python.org/Markdown/) Pull request to include the below code in Python-Markdown: https://github.com/waylan/Python-Markdown/pull/191 Until it's released, we have a copy...
unknown
codeparrot/codeparrot-clean
/* * Copyright 2010-2023 JetBrains s.r.o. and Kotlin Programming Language contributors. * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. */ @file:Suppress("DEPRECATION") package org.jetbrains.kotlin.analysis.api.descriptors.components import org.je...
kotlin
github
https://github.com/JetBrains/kotlin
analysis/analysis-api-fe10/src/org/jetbrains/kotlin/analysis/api/descriptors/components/KaFe10OriginalPsiProvider.kt
#!/usr/bin/env python """Compatibility check of synchronous interface automata""" __author__ = "Simon Maurer" __version__ = "0.9.0" __maintainer__ = "Simon Maurer" __email__ = "s.maurer@herts.ac.uk" __status__ = "Prototype" import igraph, sia import sys, argparse import igraph.vendor.texttable sys.settrace parser =...
unknown
codeparrot/codeparrot-clean
from setuptools import setup, find_packages version = '0.1' LONG_DESCRIPTION = """ AwesomeStream ============= AwesomeStream is a set of tools for creating a "stream server". That is, a server which can store information about events that happen, and can query back those events in reverse-chronological order, slice...
unknown
codeparrot/codeparrot-clean
/*------------------------------------------------------------------------- * * storage.c * code to create and destroy physical storage for relations * * Portions Copyright (c) 1996-2026, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * * IDENTIFI...
c
github
https://github.com/postgres/postgres
src/backend/catalog/storage.c
# orm/evaluator.py # Copyright (C) 2005-2014 the SQLAlchemy authors and contributors <see AUTHORS file> # # This module is part of SQLAlchemy and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php import operator from ..sql import operators class UnevaluatableError(Exception): ...
unknown
codeparrot/codeparrot-clean
/* To learn more about this file see: https://angular.io/config/tsconfig. */ { "extends": "./tsconfig.json", "compilerOptions": { "outDir": "./out-tsc/app", "types": [ "node" ] }, "files": [ "src/main.ts", "src/main.server.ts" ], "include": [ "src/**/*.d.ts" ] }
json
github
https://github.com/angular/angular
integration/platform-server-hydration/tsconfig.app.json
""" ====================================== Gradient Boosting Out-of-Bag estimates ====================================== Out-of-bag (OOB) estimates can be a useful heuristic to estimate the "optimal" number of boosting iterations. OOB estimates are almost identical to cross-validation estimates but they can be compute...
unknown
codeparrot/codeparrot-clean
""" The GDAL/OGR library uses an Envelope structure to hold the bounding box information for a geometry. The envelope (bounding box) contains two pairs of coordinates, one for the lower left coordinate and one for the upper right coordinate: +----------o Upper right; (max_x, max_y) ...
unknown
codeparrot/codeparrot-clean
#![warn(rust_2018_idioms)] use tokio::pin; use tokio::sync::oneshot; use tokio_util::sync::{CancellationToken, WaitForCancellationFuture}; use core::future::Future; use core::task::{Context, Poll}; use futures_test::task::new_count_waker; #[test] fn cancel_token() { let (waker, wake_counter) = new_count_waker();...
rust
github
https://github.com/tokio-rs/tokio
tokio-util/tests/sync_cancellation_token.rs
"use strict"; module.exports = function PluginEnvironment() { /** * @type {{ name: string, handler: EXPECTED_FUNCTION }[]} */ const events = []; /** * @param {string} name the name * @param {EXPECTED_FUNCTION} handler the handler */ function addEvent(name, handler) { events.push({ name, handler ...
javascript
github
https://github.com/webpack/webpack
test/helpers/PluginEnvironment.js
/* @Copyright Barrett Adair 2015-2017 Distributed under the Boost Software License, Version 1.0. (See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt) */ #ifndef BOOST_CLBL_TRTS_ADD_MEMBER_VOLATILE_HPP #define BOOST_CLBL_TRTS_ADD_MEMBER_VOLATILE_HPP #include <boost/callable_traits/detail/co...
unknown
github
https://github.com/mysql/mysql-server
extra/boost/boost_1_87_0/boost/callable_traits/add_member_volatile.hpp
# -*- 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): def forwards(self, orm): # Changing field 'Punto8y9Plagas.equipos' db.alter_column(u'guias_cacao_p...
unknown
codeparrot/codeparrot-clean
/* * Copyright 2002-present the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required b...
java
github
https://github.com/spring-projects/spring-framework
spring-context-support/src/main/java/org/springframework/cache/jcache/config/AbstractJCacheConfiguration.java
{ "name": "@tailwindcss/root", "private": true, "version": "1.0.0", "prettier": { "semi": false, "singleQuote": true, "printWidth": 100, "plugins": [ "prettier-plugin-organize-imports" ], "overrides": [ { "files": [ "tsconfig.json" ], "option...
json
github
https://github.com/tailwindlabs/tailwindcss
package.json
import unittest import pickle import cPickle import StringIO import cStringIO import pickletools import copy_reg from test.test_support import TestFailed, verbose, have_unicode, TESTFN try: from test.test_support import _2G, _1M, precisionbigmemtest, impl_detail except ImportError: # this import might fail whe...
unknown
codeparrot/codeparrot-clean
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright: (c) 2015, Hans-Joachim Kliemeck <git@kliemeck.de> # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': ['preview'], 'supported...
unknown
codeparrot/codeparrot-clean
""" General functions for HTML manipulation. """ import re as _re from html.entities import html5 as _html5 __all__ = ['escape', 'unescape'] def escape(s, quote=True): """ Replace special characters "&", "<" and ">" to HTML-safe sequences. If the optional flag quote is true (the default), the quotation m...
python
github
https://github.com/python/cpython
Lib/html/__init__.py
#!/usr/bin/env python3 import unittest import os.path import sys sys.path.insert(0, os.path.join(os.path.abspath(os.path.dirname(__file__)), "..", "..")) # Import this to set the SIP API correctly. It is otherwise not used in these # tests. from enki.core.locator import splitLine class Test(unittest.TestCase): ...
unknown
codeparrot/codeparrot-clean
//===--- Linking.cpp - Name mangling for IRGen entities -------------------===// // // This source file is part of the Swift.org open source project // // Copyright (c) 2014 - 2017 Apple Inc. and the Swift project authors // Licensed under Apache License v2.0 with Runtime Library Exception // // See https://swift.org/L...
cpp
github
https://github.com/apple/swift
lib/IRGen/Linking.cpp
from __future__ import absolute_import import numpy as nm from sfepy.base.base import output, assert_, get_default, Struct from sfepy.homogenization.coefs_base import CorrSolution, \ TCorrectorsViaPressureEVP, CorrMiniApp from sfepy.solvers.ts import TimeStepper from six.moves import range class PressureRHSVecto...
unknown
codeparrot/codeparrot-clean
#ifndef SRC_NODE_REALM_H_ #define SRC_NODE_REALM_H_ #if defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS #include <v8.h> #include <unordered_map> #include "cleanup_queue.h" #include "cppgc_helpers.h" #include "env_properties.h" #include "memory_tracker.h" #include "node_snapshotable.h" namespace node { struct Re...
c
github
https://github.com/nodejs/node
src/node_realm.h
name: WebAssembly on: push: paths-ignore: - 'doc/**' - '**/man/*' - '**.md' - '**.rdoc' - '**/.document' - '.*.yml' pull_request: paths-ignore: - 'doc/**' - '**/man/*' - '**.md' - '**.rdoc' - '**/.document' - '.*.yml' merge_group: co...
unknown
github
https://github.com/ruby/ruby
.github/workflows/wasm.yml
"""Provide XBlock urls""" from django.conf.urls import include, patterns, url from django.contrib.staticfiles.urls import staticfiles_urlpatterns from django.contrib import admin from workbench.scenarios import init_scenarios admin.autodiscover() init_scenarios() urlpatterns = patterns( 'workbench.views', ...
unknown
codeparrot/codeparrot-clean
# mysql/mysqlconnector.py # Copyright (C) 2005-2014 the SQLAlchemy authors and contributors <see AUTHORS file> # # This module is part of SQLAlchemy and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php """ .. dialect:: mysql+mysqlconnector :name: MySQL Connector/Python :d...
unknown
codeparrot/codeparrot-clean
# Elasticsearch Docker Distribution The ES build can generate several types of Docker image. These are enumerated in the [DockerBase] enum. * Default - this is what most people use, and is based on [RedHat's UBI images][ubi], specifically their minimal flavour. * Wolfi - the same as the default image, but ...
unknown
github
https://github.com/elastic/elasticsearch
distribution/docker/README.md
control: 1 realpath: !vault | $ANSIBLE_VAULT;1.1;AES256 64343436666664636436363065356463363630653766323230333931366661656262343030386366 6536616433353864616132303033623835316430623762360a646234383932656637623439353333 36336362616564333663353739313766363333376461353962643531366338...
unknown
github
https://github.com/ansible/ansible
test/integration/targets/ansible-vault/vars/vaulted.yml
# -*- coding: utf-8 -*- import sys,os notconvert=['Autoelektrik','Brauereibedarf', 'Bildhauer', 'Bauelemente', 'Feuerwehren'] format = sys.argv[1] CalcFiles = os.listdir('./') print CalcFiles for onefile in CalcFiles: if onefile[len(onefile)-4:] == '.xls': os.system('unoconvCSV.py ' + onefile) CalcFile...
unknown
codeparrot/codeparrot-clean
/* * Copyright 2012-present the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required b...
java
github
https://github.com/spring-projects/spring-boot
core/spring-boot/src/test/java/org/springframework/boot/LazyInitializationExcludeFilterTests.java
#include "git-compat-util.h" #include "levenshtein.h" /* * This function implements the Damerau-Levenshtein algorithm to * calculate a distance between strings. * * Basically, it says how many letters need to be swapped, substituted, * deleted from, or added to string1, at least, to get string2. * * The idea is...
c
github
https://github.com/git/git
levenshtein.c
#!/usr/bin/env python # # Created on 7/5/2013 Pat Cappelaere - Vightel Corporation # # Requirements: # gdal... # # DEM Manipulation and Visualization utilities for HydroSHEDS # # Inpiration from: # http://blog.thematicmapping.org/2012/07/terrain-mapping-with-mapnik.html # # import os, inspect import argparse import sub...
unknown
codeparrot/codeparrot-clean
# coding=utf-8 """Definitions relating to exposure in InaSAFE.""" from safe.definitions.caveats import caveat_incomplete_data from safe.definitions.concepts import concepts from safe.definitions.exposure_classifications import ( generic_place_classes, generic_road_classes, generic_structure_classes, ge...
unknown
codeparrot/codeparrot-clean
// SPDX-License-Identifier: GPL-2.0 #include <linux/memcontrol.h> #include <linux/rwsem.h> #include <linux/shrinker.h> #include <linux/rculist.h> #include <trace/events/vmscan.h> #include "internal.h" LIST_HEAD(shrinker_list); DEFINE_MUTEX(shrinker_mutex); #ifdef CONFIG_MEMCG static int shrinker_nr_max; static inli...
c
github
https://github.com/torvalds/linux
mm/shrinker.c
# # (c) 2018 Extreme Networks Inc. # # 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. # # Ans...
unknown
codeparrot/codeparrot-clean
# Copyright 2010 OpenStack Foundation # # 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...
unknown
codeparrot/codeparrot-clean
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (c) 2010 kazacube (http://kazacube.com). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU ...
unknown
codeparrot/codeparrot-clean
### BEGIN LICENSE # Copyright (C) 2012 Owais Lone <hello@owaislone.org> # This program is free software: you can redistribute it and/or modify it # under the terms of the GNU General Public License version 3, as published # by the Free Software Foundation. # # This program is distributed in the hope that it will be use...
unknown
codeparrot/codeparrot-clean
{ "description": "Content Security", "files": [ "!**/*.d.ts", "!**/*.js" ], "file": "src/app/app.component.ts", "tags": ["security"] }
json
github
https://github.com/angular/angular
adev/src/content/examples/security/stackblitz.json
# Lint as: python3 # Copyright 2018 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless ...
unknown
codeparrot/codeparrot-clean
# -*- coding: utf-8 -*- # # Copyright (c) 2017 F5 Networks Inc. # GNU General Public License v3.0 (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import (absolute_import, division, print_function) __metaclass__ = type import os import json import pytest import sys if sys.version_info < (2, ...
unknown
codeparrot/codeparrot-clean
from compiler import * ui_strings = [ ("music_volume", "Music Volume:"), ("sound_volume", "Sound Volume:"), ("mouse_sensitivity", "Mouse Sensitivity:"), ("invert_mouse_y_axis", "Invert Mouse Y Axis"), ("enabled", "Enabled"), ("disabled", "Disabled"), ("damage_to_player", "Damage to Player:...
unknown
codeparrot/codeparrot-clean
//// [tests/cases/conformance/async/es6/functionDeclarations/asyncFunctionDeclaration9_es6.ts] //// //// [asyncFunctionDeclaration9_es6.ts] async function foo(): Promise<void> { var v = { [await]: foo } } //// [asyncFunctionDeclaration9_es6.js] "use strict"; function foo() { return __awaiter(this, void 0, void ...
javascript
github
https://github.com/microsoft/TypeScript
tests/baselines/reference/asyncFunctionDeclaration9_es6.js
#!/usr/bin/env bash # Copyright 2023 The Cockroach Authors. # # Use of this software is governed by the CockroachDB Software License # included in the /LICENSE file. TELEMETRY_DISABLED=true ./build/teamcity/internal/release/process/build-cockroach-release-docker.sh
unknown
github
https://github.com/cockroachdb/cockroach
build/teamcity/internal/release/process/build-cockroach-release-docker-no-telemetry.sh
# 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 ...
unknown
github
https://github.com/apache/kafka
.github/workflows/docker_scan.yml
//// [tests/cases/compiler/cachedModuleResolution6.ts] //// //// [app.ts] import {x} from "foo"; //// [lib.ts] import {x} from "foo"; //// [app.js] export {}; //// [lib.js] export {};
javascript
github
https://github.com/microsoft/TypeScript
tests/baselines/reference/cachedModuleResolution6.js
#!/usr/bin/env python import numpy import subprocess import vtk import matplotlib matplotlib.use('Agg') import matplotlib.pyplot as plt class fluid: def __init__(self, name = 'unnamed'): ''' A Navier-Stokes two-dimensional fluid flow simulation object. Most simulation values are assigned ...
unknown
codeparrot/codeparrot-clean
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-TODAY OpenERP S.A. <http://www.openerp.com> # # This program is free software: you can redistribute it and / or modify # it under the ter...
unknown
codeparrot/codeparrot-clean
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2017, Ansible by Red Hat, inc # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1.1', ...
unknown
codeparrot/codeparrot-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...
unknown
codeparrot/codeparrot-clean
# Copyright 2014 VMware, 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 a...
unknown
codeparrot/codeparrot-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 n...
java
github
https://github.com/apache/kafka
clients/src/main/java/org/apache/kafka/common/errors/ApiException.java
"""SCons.Tool.mwld Tool-specific initialization for the Metrowerks CodeWarrior linker. There normally shouldn't be any need to import this module directly. It will usually be imported through the generic SCons.Tool.Tool() selection method. """ # # __COPYRIGHT__ # # Permission is hereby granted, free of charge, to an...
unknown
codeparrot/codeparrot-clean
from subprocess import call import os import json BUILDER_PATH = os.path.dirname(os.path.abspath(__file__)) ROOT_PATH = os.path.join(BUILDER_PATH, '..') FONTS_FOLDER_PATH = os.path.join(ROOT_PATH, 'fonts') CSS_FOLDER_PATH = os.path.join(ROOT_PATH, 'css') SCSS_FOLDER_PATH = os.path.join(ROOT_PATH, 'scss') LESS_FOLDER_P...
unknown
codeparrot/codeparrot-clean
#!/usr/bin/env python import serial import os import platform import sys import time from struct import pack def unix_get_maple_path(file_prefix): """Try to find the device file for the Maple on *nix; assuming that it looks like /dev/<file_prefix>*. If there are multiple possibilities, ask the user what ...
unknown
codeparrot/codeparrot-clean
"""Functions that read and write gzipped files. The user of the file doesn't have to worry about the compression, but random access is not allowed.""" # based on Andrew Kuchling's minigzip.py distributed with the zlib module import struct, sys, time, os import zlib import io import __builtin__ __all__ = ["GzipFile"...
unknown
codeparrot/codeparrot-clean
import {Directive, effect, input, TemplateRef, ViewContainerRef} from '@angular/core'; import {Loaded, LoadingState} from './loading-state'; @Directive({ selector: '[appIfLoaded]', }) export class IfLoadedDirective<T> { private isViewCreated = false; state = input.required<LoadingState<T>>({alias: 'appIfLoaded...
typescript
github
https://github.com/angular/angular
adev/src/content/examples/structural-directives/src/app/if-loaded.directive.ts
#!/usr/bin/env python ######################################################################################### # # Validation of WM atlas # # This script generates a synthetic volume from an atlas of white matter # It then estimates the np.mean value within each tract using different methods. # The estimation is after...
unknown
codeparrot/codeparrot-clean
''' Easy integration of DataFrame into pyqt framework Copyright: Jev Kuznetsov Licence: BSD ''' from PyQt4.QtCore import (QAbstractTableModel,Qt,QVariant,QModelIndex,SIGNAL) from PyQt4.QtGui import (QApplication,QDialog,QVBoxLayout, QHBoxLayout, QTableView, QPushButton, QWidget,QTableWidget, ...
unknown
codeparrot/codeparrot-clean
_fixture: model_class: Post second_welcome: author_id: 1 title: Welcome to the another weblog body: It's really nice today legacy_comments_count: 1
unknown
github
https://github.com/rails/rails
activerecord/test/fixtures/other_posts.yml
# Copyright 2009 Michael Murr # # This file is part of LibForensics. # # LibForensics is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later ver...
unknown
codeparrot/codeparrot-clean
#!ruby require "pathname" require "open3" require "tmpdir" def backup_gcda_files(gcda_files) gcda_files = gcda_files.map do |gcda| [gcda, gcda.sub_ext(".bak")] end begin gcda_files.each do |before, after| before.rename(after) end yield ensure gcda_files.each do |before, after| a...
ruby
github
https://github.com/ruby/ruby
tool/run-lcov.rb
# event/registry.py # Copyright (C) 2005-2014 the SQLAlchemy authors and contributors <see AUTHORS file> # # This module is part of SQLAlchemy and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php """Provides managed registration services on behalf of :func:`.listen` arguments. B...
unknown
codeparrot/codeparrot-clean