code
stringlengths
1
25.8M
language
stringclasses
18 values
source
stringclasses
4 values
repo
stringclasses
78 values
path
stringlengths
0
268
from sympy import I, symbols, sqrt, Add, Mul, Rational, Pow, Symbol, sympify from sympy import Integer, conjugate, pretty, latex from sympy.physics.quantum.dagger import Dagger from sympy.physics.quantum.qexpr import QExpr from sympy.physics.quantum.state import ( Ket, Bra, TimeDepKet, TimeDepBra, KetBase, Bra...
unknown
codeparrot/codeparrot-clean
#!/bin/bash set -xe # Script used in CI and CD pipeline # Intel® software for general purpose GPU capabilities. # Refer to https://www.intel.com/content/www/us/en/developer/articles/tool/pytorch-prerequisites-for-intel-gpus.html # Users should update to the latest version as it becomes available function install_ubu...
unknown
github
https://github.com/pytorch/pytorch
.ci/docker/common/install_xpu.sh
# Copyright (C) Ivan Kravets <me@ikravets.com> # See LICENSE for details. class PlatformioException(Exception): MESSAGE = None def __str__(self): # pragma: no cover if self.MESSAGE: return self.MESSAGE % self.args else: return Exception.__str__(self) class ReturnErro...
unknown
codeparrot/codeparrot-clean
# This file is part of beets. # Copyright 2013, Jakob Schnitzer. # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy,...
unknown
codeparrot/codeparrot-clean
# Copyright (c) 2006-2010 Mitch Garnaat http://garnaat.org/ # # Permission is hereby granted, free of charge, to any person obtaining a # copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modi...
unknown
codeparrot/codeparrot-clean
"""Support for controlling projector via the PJLink protocol.""" import logging import voluptuous as vol from homeassistant.components.media_player import ( MediaPlayerDevice, PLATFORM_SCHEMA) from homeassistant.components.media_player.const import ( SUPPORT_SELECT_SOURCE, SUPPORT_TURN_OFF, SUPPORT_TURN_ON, ...
unknown
codeparrot/codeparrot-clean
// Copyright 2019-2024 Tauri Programme within The Commons Conservancy // SPDX-License-Identifier: Apache-2.0 // SPDX-License-Identifier: MIT use crate::{ error::{Context, ErrorExt}, helpers::config::{reload_config, Config as TauriConfig, ConfigMetadata}, interface::{AppInterface, AppSettings, DevProcess, Options...
rust
github
https://github.com/tauri-apps/tauri
crates/tauri-cli/src/mobile/mod.rs
# Mantid Repository : https://github.com/mantidproject/mantid # # Copyright &copy; 2018 ISIS Rutherford Appleton Laboratory UKRI, # NScD Oak Ridge National Laboratory, European Spallation Source # & Institut Laue - Langevin # SPDX - License - Identifier: GPL - 3.0 + import mantidqtpython import mantidplottests ...
unknown
codeparrot/codeparrot-clean
from __future__ import absolute_import from datetime import timedelta __all__ = ["TimeRange"] class TimeRange: """ Timerange(a, b) or Timerange((a, b)) An object to handle time ranges. Parameters ---------- a : the start time specified as a time string, or datetime object A 2d list o...
unknown
codeparrot/codeparrot-clean
#!/usr/bin/python # # @author: Gaurav Rastogi (grastogi@avinetworks.com) # Eric Anderson (eanderson@avinetworks.com) # module_check: supported # Avi Version: 17.1.1 # # Copyright: (c) 2017 Gaurav Rastogi, <grastogi@avinetworks.com> # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses...
unknown
codeparrot/codeparrot-clean
""" ----------------- Collapse Gaussfit ----------------- This was an early attempt to automate gaussian fitting over a data cube using (multiple) gaussian decomposition for each spectrum. It's reasonably effective, but the uses are somewhat minimal. I've tried shifting my cube-related work to `pyspeckit <pyspeckit...
unknown
codeparrot/codeparrot-clean
// // CachedResponseHandler.swift // // Copyright (c) 2019 Alamofire Software Foundation (http://alamofire.org/) // // 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...
swift
github
https://github.com/Alamofire/Alamofire
Source/Features/CachedResponseHandler.swift
from __future__ import unicode_literals from ..utils import ( int_or_none, str_to_int, unified_strdate, ) from .keezmovies import KeezMoviesIE class MofosexIE(KeezMoviesIE): _VALID_URL = r'https?://(?:www\.)?mofosex\.com/videos/(?P<id>\d+)/(?P<display_id>[^/?#&.]+)\.html' _TESTS = [{ 'url'...
unknown
codeparrot/codeparrot-clean
## Input ```javascript function Component(props) { const x = {}; const y = []; x.y = y; x.y.push(props.input); let z = 0; if (x.y[0]) { z = 1; } return [z]; } export const FIXTURE_ENTRYPOINT = { fn: Component, params: [], sequentialRenders: [ {input: true}, {input: true}, {inpu...
unknown
github
https://github.com/facebook/react
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/reactivity-via-aliased-mutation-through-property-load.expect.md
/* * Copyright 2014-2025 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license. */ package ktorbuild.internal import org.gradle.api.Project import org.gradle.api.Task import org.gradle.api.provider.Provider import org.gradle.api.services.BuildService import org.gradle.api.s...
kotlin
github
https://github.com/ktorio/ktor
build-logic/src/main/kotlin/ktorbuild/internal/LimitedParallelismService.kt
#!/usr/bin/env python3 # -*- coding: utf-8 -*- try: # Change main dir to this (need for Pentest Box) import os os.path.abspath(__file__) from Classes import (Credits, OKadminFinderClass, MessengerClass) import argparse from colorama import Fore,...
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/utils/LogContext.java
<?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\Bridge\Doctrine\Tests\Fixtures; use Doctrine\ORM\Mapping\Column...
php
github
https://github.com/symfony/symfony
src/Symfony/Bridge/Doctrine/Tests/Fixtures/SingleIntIdNoToStringEntity.php
import unittest from test import support import smtplib import socket ssl = support.import_module("ssl") support.requires("network") def check_ssl_verifiy(host, port): context = ssl.create_default_context() with socket.create_connection((host, port)) as sock: try: sock = context.wrap_sock...
unknown
codeparrot/codeparrot-clean
<!--- Copyright 2020 The HuggingFace Team. 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 applicable law or ...
unknown
github
https://github.com/huggingface/transformers
examples/pytorch/token-classification/README.md
<!--Copyright 2023 The HuggingFace Team. 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 applicable law or agreed...
unknown
github
https://github.com/huggingface/transformers
docs/source/ja/generation_strategies.md
# coding=utf-8 # Copyright 2015 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). from __future__ import (absolute_import, division, generators, nested_scopes, print_function, unicode_literals, with_statement) import os from conte...
unknown
codeparrot/codeparrot-clean
# Copyright 2013-2014 MongoDB, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writin...
unknown
codeparrot/codeparrot-clean
# ---------------------------------------------------------------------- # Numenta Platform for Intelligent Computing (NuPIC) # Copyright (C) 2013, Numenta, Inc. Unless you have an agreement # with Numenta, Inc., for a separate license for this software code, the # following terms and conditions apply: # # This progra...
unknown
codeparrot/codeparrot-clean
# helper functions for working with convnet visualization images from PIL import Image as PILImage import numpy as np import sys, os import cv2 from matplotlib import pyplot as plt def make_filter_weight_image(filter_weights, image_file_name, dim=11): imstack = np.dstack((filter_weights[0], filter_weights[1], fi...
unknown
codeparrot/codeparrot-clean
from __future__ import unicode_literals from calendar import timegm from django.conf import settings from django.contrib.sites.shortcuts import get_current_site from django.core.exceptions import ImproperlyConfigured, ObjectDoesNotExist from django.http import HttpResponse, Http404 from django.template import loader,...
unknown
codeparrot/codeparrot-clean
# Copyright (c) 1999-2008 Mark D. Hill and David A. Wood # Copyright (c) 2009 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 co...
unknown
codeparrot/codeparrot-clean
package client import ( "context" "net/url" ) // PluginDisableOptions holds parameters to disable plugins. type PluginDisableOptions struct { Force bool } // PluginDisableResult represents the result of a plugin disable operation. type PluginDisableResult struct { // Currently empty; can be extended in the futur...
go
github
https://github.com/moby/moby
client/plugin_disable.go
#!/usr/bin/python # Copyright (c) 2014 Wladmir J. van der Laan # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. ''' Script to generate list of seed nodes for chainparams.cpp. This script expects two text files in the directory that...
unknown
codeparrot/codeparrot-clean
import logging import logging.config # needed when logging_config doesn't start with logging.config from copy import copy from django.conf import settings from django.core import mail from django.core.mail import get_connection from django.core.management.color import color_style from django.utils.module_loading impo...
python
github
https://github.com/django/django
django/utils/log.py
#!/usr/bin/env python3 """ MongoDB Toolchain configuration generator for DevContainers. Generates toolchain_config.env with URLs and SHA256 checksums for both ARM64 and AMD64. """ import os import sys import tempfile from datetime import datetime # Add script directory to path for importing local modules sys.path.in...
python
github
https://github.com/mongodb/mongo
.devcontainer/toolchain.py
''' Created on Sep 8, 2012 @author: peymankazemian ''' from utils.helper import dotted_subnet_to_int, mac_to_int, dotted_ip_to_int, l2_proto_to_int from utils.wildcard_utils import set_header_field from utils.wildcard import wildcard, wildcard_create_bit_repeat, wildcard_to_str import json class WildcardTypeEncoder(j...
unknown
codeparrot/codeparrot-clean
""" Utilities for fast persistence of big data, with optional compression. """ # Author: Gael Varoquaux <gael dot varoquaux at normalesup dot org> # Copyright (c) 2009 Gael Varoquaux # License: BSD Style, 3 clauses. import pickle import traceback import os import zlib import warnings from io import BytesIO from ._co...
unknown
codeparrot/codeparrot-clean
########################################################################## # # Copyright (c) 2018, Image Engine Design Inc. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistrib...
unknown
codeparrot/codeparrot-clean
# SchedGui.py - Python extension for perf script, basic GUI code for # traces drawing and overview. # # Copyright (C) 2010 by Frederic Weisbecker <fweisbec@gmail.com> # # This software is distributed under the terms of the GNU General # Public License ("GPL") version 2 as published by the Free Software # Foundation. ...
unknown
codeparrot/codeparrot-clean
import time from importlib import import_module from django.conf import settings from django.contrib.sessions.backends.base import UpdateError from django.contrib.sessions.exceptions import SessionInterrupted from django.utils.cache import patch_vary_headers from django.utils.deprecation import MiddlewareMixin from dj...
python
github
https://github.com/django/django
django/contrib/sessions/middleware.py
import datetime from django.conf import settings from django.shortcuts import get_object_or_404, render_to_response from django.views.generic import date_based, list_detail from coltrane.models import Category def _category_kwarg_helper(category, kwarg_dict): if 'extra_context' in kwarg_dict: kwarg_dict[...
unknown
codeparrot/codeparrot-clean
""" ldap - base module See http://www.python-ldap.org/ for details. $Id: __init__.py,v 1.70 2011/02/19 14:36:53 stroeder Exp $ """ # This is also the overall release version number __version__ = '2.3.13' import sys if __debug__: # Tracing is only supported in debugging mode import traceback _trace_level = 0...
unknown
codeparrot/codeparrot-clean
/*------------------------------------------------------------------------- * * array_userfuncs.c * Misc user-visible array support functions * * Copyright (c) 2003-2026, PostgreSQL Global Development Group * * IDENTIFICATION * src/backend/utils/adt/array_userfuncs.c * *-----------------------------------...
c
github
https://github.com/postgres/postgres
src/backend/utils/adt/array_userfuncs.c
version: 2 updates: - package-ecosystem: github-actions directory: / schedule: interval: weekly labels: - "CI" - "Dependencies"
unknown
github
https://github.com/pandas-dev/pandas
.github/dependabot.yml
# Copyright (c) 2007-2008 The Hewlett-Packard Development Company # All rights reserved. # # The license below extends only to copyright in the software and shall # not be construed as granting a license to any other intellectual # property including but not limited to intellectual property relating # to a hardware imp...
unknown
codeparrot/codeparrot-clean
//===----------------------------------------------------------------------===// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===---------------------------...
cpp
github
https://github.com/llvm/llvm-project
clang-tools-extra/clang-tidy/modernize/ShrinkToFitCheck.cpp
def maximum_segments(n, a, b, c) : dp = [-1] * (n + 10) dp[0] = 0 for i in range(0, n) : if (dp[i] != -1) : if(i + a <= n ): dp[i + a] = max(dp[i] + 1, dp[i + a]) if(i + b <= n ): dp[i + b] = max(dp[i] + 1, dp[i + b]) if(i + c <= n ): dp[i + c] = max(dp[i] + 1, dp[i + c]) ...
unknown
mbpp
This is a [Next.js](https://nextjs.org/) template to use when reporting a [bug in the Next.js repository](https://github.com/vercel/next.js/issues). ## Getting Started These are the steps you should follow when creating a bug report: - Bug reports must be verified against the `next@canary` release. The canary versio...
unknown
github
https://github.com/vercel/next.js
examples/reproduction-template-pages/README.md
/* * 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/test/java/org/apache/kafka/clients/consumer/internals/AcknowledgementCommitCallbackHandlerTest.java
import bpy, os, sys, logging, pickle, mathutils from pprint import pprint from bpy.props import * AXIS_MODES = [ ('xyz', 'xyz', 'no swapping'), ('xz-y', 'xz-y', 'ogre standard'), ('-xzy', '-xzy', 'non standard'), ] CONFIG_PATH = bpy.utils.user_resource('CONFIG', path='scripts', create=True) CONFIG_FILENA...
unknown
codeparrot/codeparrot-clean
@file:Suppress("NAMED_ARGUMENTS_NOT_ALLOWED") // KT-21913 package kotlinx.coroutines import kotlinx.coroutines.testing.* import kotlin.test.* class CoroutinesTest : TestBase() { @Test fun testSimple() = runTest { expect(1) finish(2) } @Test fun testYield() = runTest { ex...
kotlin
github
https://github.com/Kotlin/kotlinx.coroutines
kotlinx-coroutines-core/common/test/CoroutinesTest.kt
/* * 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
configuration-metadata/spring-boot-configuration-processor/src/test/java/org/springframework/boot/configurationprocessor/AbstractMetadataGenerationTests.java
import font from 'cool-fonts/target.css?{"path":"pages/test.tsx","import":"","arguments":[{"prop":true}],"variableName":"font"}';
javascript
github
https://github.com/vercel/next.js
crates/next-custom-transforms/tests/fixture/next-font-loaders/default-import/output.js
# # 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...
python
github
https://github.com/apache/airflow
airflow-core/tests/unit/plugins/test_plugin_ignore.py
"""Core application test suite.""" import pytest import holocron def test_metadata(): """.metadata property works like mapping.""" testapp = holocron.Application() with pytest.raises(KeyError, match="'yoda'"): testapp.metadata["yoda"] assert testapp.metadata.get("yoda", "master") == "master...
unknown
codeparrot/codeparrot-clean
<!--Copyright 2025 the HuggingFace Team. 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 applicable law or ag...
unknown
github
https://github.com/huggingface/transformers
docs/source/en/model_doc/olmo3.md
#!/usr/bin/env python # -*- coding: utf-8 -*- # tifffile.py # Copyright (c) 2008-2012, Christoph Gohlke # Copyright (c) 2008-2012, 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 wit...
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...
java
github
https://github.com/apache/hadoop
hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/util/Progressable.java
/* * Copyright 2014-2021 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license. */ package io.ktor.client.utils import io.ktor.http.* /** * Builds an instance of [Headers] using the [block] function. * * [Report a problem](https://ktor.io/feedback/?fqname=io.ktor.client.u...
kotlin
github
https://github.com/ktorio/ktor
ktor-client/ktor-client-core/common/src/io/ktor/client/utils/headers.kt
/* Write Python objects to files and read them back. This is primarily intended for writing and reading compiled Python code, even though dicts, lists, sets and frozensets, not commonly seen in code objects, are supported. Version 3 of this protocol properly supports circular links and sharing. */ #incl...
c
github
https://github.com/python/cpython
Python/marshal.c
# Copyright 2025 TII and the HuggingFace Inc. team. 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...
python
github
https://github.com/huggingface/transformers
src/transformers/models/falcon_h1/configuration_falcon_h1.py
# Copyright 2008 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
unknown
codeparrot/codeparrot-clean
#!/usr/bin/env python # Copyright 2015 The Kubernetes Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appli...
unknown
codeparrot/codeparrot-clean
""" The casket module provides an alternative container format to zipfile. The motivation for an alternative container format is twofold: * It is not possible to stream data in to a zip file in the API. The work-around we have of creating a temporary file and copying it in works, but is quite slow. * When reading fro...
unknown
codeparrot/codeparrot-clean
import itertools import os import subprocess def GetFlagsFromMakefile(varname): return subprocess.check_output([ "make", "-s", "print-%s" % varname]).decode().split() def Flatten(lists): return list(itertools.chain.from_iterable(lists)) def DirectoryOfThisScript(): return os.path.dirname(os.path.abspath(...
unknown
codeparrot/codeparrot-clean
from typing import TYPE_CHECKING, Any from langchain_classic._api import create_importer if TYPE_CHECKING: from langchain_community.chat_message_histories import StreamlitChatMessageHistory # Create a way to dynamically look up deprecated imports. # Used to consolidate logic for raising deprecation warnings and ...
python
github
https://github.com/langchain-ai/langchain
libs/langchain/langchain_classic/memory/chat_message_histories/streamlit.py
from itertools import imap, repeat from mock import patch from validator.testcases import content from tests.helper import MockXPI from tests.js_helper import TestCase class TestFunctionTraversal(TestCase): """ Consider the following tree: - body |-function a() | |- foo | |- bar ...
unknown
codeparrot/codeparrot-clean
import os import json import stat import shutil import argparse os.chdir(os.path.dirname(os.path.realpath(__file__))) os.chdir('..') review = os.path.join(os.getcwd(), 'review') MASK = stat.S_IRWXU|stat.S_IRGRP|stat.S_IXGRP|stat.S_IROTH|stat.S_IXOTH HTML = '''<!doctype html> <html lang='en'> <head> <title>%(ti...
unknown
codeparrot/codeparrot-clean
/* Copyright (c) Alexander Zaitsev <zamazan4ik@gmail.by>, 2017. Distributed under the Boost Software License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) */ /// \file is_partitioned_until.hpp /// \brief Tell if a sequence is partitioned /// \author Al...
unknown
github
https://github.com/mysql/mysql-server
extra/boost/boost_1_87_0/boost/algorithm/is_partitioned_until.hpp
/* * Copyright 2014-2024 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license. */ package io.ktor.tests.http import io.ktor.http.* import java.net.* import java.util.* import kotlin.test.* class URLBuilderTestJvm { private val urlString = "http://localhost:8080/path" ...
kotlin
github
https://github.com/ktorio/ktor
ktor-http/jvm/test/io/ktor/tests/http/URLBuilderTest.kt
// Copyright 2021 The Cockroach Authors. // // Use of this software is governed by the CockroachDB Software License // included in the /LICENSE file. package sql_test import ( "context" "fmt" "regexp" "strings" "testing" "github.com/cockroachdb/cockroach/pkg/base" "github.com/cockroachdb/cockroach/pkg/securit...
go
github
https://github.com/cockroachdb/cockroach
pkg/sql/session_migration_test.go
#!/usr/bin/env python # This file is part of Responder # Original work by Laurent Gaffie - Trustwave Holdings # # 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, o...
unknown
codeparrot/codeparrot-clean
import numpy as n from scipy.io import wavfile as w class LPFilter: pass class Notch: pass class Notch: pass class Utils: def __init__(self): pass def normalize(self, vector): return -1+2*(vector-vector.min())/(vector.max()-vector.min()) def normalizeRows(self,vector): "...
unknown
codeparrot/codeparrot-clean
C = int(input()) while C: C-= 1 H, W = raw_input().split() H = int(H) W = int(W) matrix = list() for i in range(H): row = [(x == '#' and True or False) for x in list(raw_input())] matrix.append(row) Lblock = (((1, -1),(1, 0)), ((1, 0),(1, 1)), ((0,...
unknown
codeparrot/codeparrot-clean
from django.db import models from swampdragon.models import SelfPublishModel from .serializers import NotificationSerializer class Notification(SelfPublishModel, models.Model): serializer_class = NotificationSerializer message = models.TextField() from os import urandom from base64 import b64encode, b64decode...
unknown
codeparrot/codeparrot-clean
from langchain_classic import storage EXPECTED_ALL = [ "EncoderBackedStore", "InMemoryStore", "InMemoryByteStore", "LocalFileStore", "RedisStore", "InvalidKeyException", "create_lc_store", "create_kv_docstore", "UpstashRedisByteStore", "UpstashRedisStore", ] def test_all_import...
python
github
https://github.com/langchain-ai/langchain
libs/langchain/tests/unit_tests/storage/test_imports.py
/* * 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 ...
java
github
https://github.com/apache/hadoop
hadoop-cloud-storage-project/hadoop-tos/src/main/java/org/apache/hadoop/fs/tosfs/object/PrefixStorage.java
import sys import re import numpy as np from scipy.sparse import csc_matrix, csr_matrix, lil_matrix from sklearn.utils.testing import (assert_almost_equal, assert_array_equal, assert_true) from sklearn.datasets import load_digits from sklearn.externals.six.moves import cStringIO as ...
unknown
codeparrot/codeparrot-clean
# Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """ Tests for the inotify wrapper in L{twisted.internet.inotify}. """ from twisted.internet import defer, reactor from twisted.python import filepath, runtime from twisted.python.reflect import requireModule from twisted.trial import unittest if...
unknown
codeparrot/codeparrot-clean
import fixtures import constants from authomatic.providers import oauth2 conf = fixtures.get_configuration('deviantart') PICTURE = 'http://a.deviantart.net/avatars/p/e/{0}.jpg?1'\ .format(conf.user_username) CONFIG = { 'pre_login_xpaths': [ '//*[@id="joinform"]/fieldset/small/a' ], 'login_xpa...
unknown
codeparrot/codeparrot-clean
# -*- coding: utf-8 -*- """ tests/test_shipping.py """ import unittest from datetime import date from decimal import Decimal import trytond.tests.test_tryton from trytond.tests.test_tryton import POOL, USER, with_transaction from trytond.transaction import Transaction from trytond.exceptions import UserError cla...
unknown
codeparrot/codeparrot-clean
import os import traceback from couchpotato import CPLog from couchpotato.core.event import addEvent, fireEvent, fireEventAsync from couchpotato.core.helpers.encoding import toUnicode from couchpotato.core.plugins.base import Plugin import six log = CPLog(__name__) class MediaBase(Plugin): _type = None def...
unknown
codeparrot/codeparrot-clean
# -*- coding: utf-8 -*- from __future__ import unicode_literals import os import unittest import warnings from unittest import skipUnless from django.conf import settings from django.contrib.gis.geoip import HAS_GEOIP from django.contrib.gis.geos import HAS_GEOS, GEOSGeometry from django.test import ignore_warnings f...
unknown
codeparrot/codeparrot-clean
// Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Package os provides a platform-independent interface to operating system // functionality. The design is Unix-like, although the error handling is // Go-like...
go
github
https://github.com/golang/go
src/os/file.go
.hello { font: 15px Helvetica, Arial, sans-serif; background: #eee; padding: 100px; text-align: center; transition: 100ms ease-in background; } .hello:hover { background: #ccc; }
css
github
https://github.com/vercel/next.js
examples/basic-css/styles.module.css
#!/usr/bin/env python # Copyright (c) 2013 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """ Verifies that dependencies on generated headers work, even if the header has a mixed-case file name. """ import TestGyp test = TestGyp...
unknown
codeparrot/codeparrot-clean
#!/usr/bin/python # # @author: Gaurav Rastogi (grastogi@avinetworks.com) # Eric Anderson (eanderson@avinetworks.com) # module_check: supported # Avi Version: 17.1.1 # # Copyright: (c) 2017 Gaurav Rastogi, <grastogi@avinetworks.com> # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses...
unknown
codeparrot/codeparrot-clean
#!/usr/bin/env python3 import sys import os path = os.path.join(os.path.dirname(sys.argv[0]), '..', '..', 'data', 'categories.txt') if len(sys.argv) < 2: print('Merges some language in categories.txt with English') print('Usage: {} <lang> [path_to_categories.txt]'.format(sys.argv[0])) print('Default path t...
unknown
codeparrot/codeparrot-clean
<?php declare(strict_types=1); /* * This file is part of Composer. * * (c) Nils Adermann <naderman@naderman.de> * Jordi Boggiano <j.boggiano@seld.be> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Composer\Filter\...
php
github
https://github.com/composer/composer
src/Composer/Filter/PlatformRequirementFilter/IgnoreListPlatformRequirementFilter.php
## Input ```javascript import {identity, Stringify} from 'shared-runtime'; function Component({x, ...rest}) { const restAlias = rest; const z = restAlias.z; identity(z); return <Stringify x={x} z={z} />; } export const FIXTURE_ENTRYPOINT = { fn: Component, params: [{x: 'Hello', z: 'World'}], }; ``` ## ...
unknown
github
https://github.com/facebook/react
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/nonmutated-spread-props-local-indirection.expect.md
from utils import get_navtree, get_navbar from django.conf import settings MAX_DEPTH = getattr(settings, 'NAVBAR_MAX_DEPTH', -1) MARK_SELECTED = getattr(settings, 'NAVBAR_MARK_SELECTED', True) SHOW_DEPTH = getattr(settings, 'NAVBAR_SHOW_DEPTH', -1) CRUMBS_STRIP_ROOT = getattr(settings, 'NAVBAR_CRUMBS_STRIP_ROOT', Tru...
unknown
codeparrot/codeparrot-clean
/* * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one * or more contributor license agreements. Licensed under the "Elastic License * 2.0", the "GNU Affero General Public License v3.0 only", and the "Server Side * Public License v 1"; you may not use this file except in compliance with, ...
java
github
https://github.com/elastic/elasticsearch
distribution/tools/server-cli/src/main/java/org/elasticsearch/server/cli/JvmErgonomics.java
""" An implementation of a RequestCache. This cache is reset at the beginning and end of every request. """ import crum import threading class _RequestCache(threading.local): """ A thread-local for storing the per-request cache. """ def __init__(self): super(_RequestCache, self).__init__() ...
unknown
codeparrot/codeparrot-clean
# Copyright (c) 2010 Chris Moyer http://coredumped.org/ # # Permission is hereby granted, free of charge, to any person obtaining a # copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, ...
unknown
codeparrot/codeparrot-clean
//===--- OptionSet.h - Sets of boolean options ------------------*- C++ -*-===// // // 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...
c
github
https://github.com/apple/swift
include/swift/Basic/OptionSet.h
#!/bin/sh test_description='test multi-tree read-tree without merging' GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME . ./test-lib.sh . "$TEST_DIRECTORY"/lib-read-tree.sh test_expect_success setup ' echo one >a && git add a && git commit -m initial && git tag initial && e...
unknown
github
https://github.com/git/git
t/t1008-read-tree-overlay.sh
#vim: set encoding=utf-8 from regulations.generator import generator from regulations.generator.html_builder import HTMLBuilder from regulations.generator.layers.toc_applier import TableOfContentsLayer from regulations.generator.node_types import EMPTYPART, REGTEXT from regulations.generator.section_url import Section...
unknown
codeparrot/codeparrot-clean
// This file is part of OpenCV project. // It is subject to the license terms in the LICENSE file found in the top-level directory // of this distribution and at http://opencv.org/license.html #ifndef __OPENCV_PERF_PRECOMP_HPP__ #define __OPENCV_PERF_PRECOMP_HPP__ #include "opencv2/ts.hpp" #include "opencv2/calib3d.hp...
unknown
github
https://github.com/opencv/opencv
modules/calib3d/perf/perf_precomp.hpp
<!--- # 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...
unknown
github
https://github.com/apache/hadoop
hadoop-common-project/hadoop-common/src/site/markdown/release/0.2.0/CHANGELOG.0.2.0.md
# Copyright 2010 Canonical Ltd. This software is licensed under the # GNU Affero General Public License version 3 (see the file LICENSE). from django.conf import settings from django.core import mail from identityprovider.models.authtoken import AuthToken from identityprovider.tests.utils import SSOBaseTestCase fro...
unknown
codeparrot/codeparrot-clean
# Generated by the protocol buffer compiler. DO NOT EDIT! # source: vtrpc.proto from google.protobuf.internal import enum_type_wrapper from google.protobuf import descriptor as _descriptor from google.protobuf import message as _message from google.protobuf import reflection as _reflection from google.protobuf import...
unknown
codeparrot/codeparrot-clean
from enigma import eDBoxLCD, eRCInput, fbClass, eConsoleAppContainer from Screens.Screen import Screen from Screens.MessageBox import MessageBox class PluginRunner(Screen): skin = """ <screen position="1,1" size="1,1" title="Plugin" > </screen>""" def __init__(self, session, pluginname, args = None): sel...
unknown
codeparrot/codeparrot-clean
# Copyright (c) 2010 Cloud.com, Inc # Copyright 2012 Cloudbase Solutions Srl / Pedro Navarro Perez # 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 # # ...
unknown
codeparrot/codeparrot-clean
// WITH_STDLIB val p : UInt = <expr>42u</expr>
kotlin
github
https://github.com/JetBrains/kotlin
analysis/analysis-api/testData/components/compileTimeConstantProvider/evaluate/propertyInit_UInt.kt