code
stringlengths
1
25.8M
language
stringclasses
18 values
source
stringclasses
4 values
repo
stringclasses
78 values
path
stringlengths
0
268
# -*- coding: utf-8 -*- { 'name': 'Events Sales', 'version': '1.1', 'category': 'Tools', 'website': 'https://www.odoo.com/page/events', 'description': """ Creating registration with sale orders. ======================================= This module allows you to automate and connect your registratio...
unknown
codeparrot/codeparrot-clean
#! /usr/bin/env python import sys import os import errno import shared from multiprocessing import Process class singleinstance: """ Implements a single instance application by creating a lock file at appdata. This is based upon the singleton class from tendo https://github.com/pycontribs/tendo which...
unknown
codeparrot/codeparrot-clean
# Copyright (c) 2012, GPy authors (see AUTHORS.txt). # Licensed under the BSD 3-clause license (see LICENSE.txt) """ The package for the psi statistics computation """ import numpy as np try: from scipy import weave def _psicomputations(variance, lengthscale, Z, variational_posterior): """ Z...
unknown
codeparrot/codeparrot-clean
# -*-coding:Utf-8 -* # ---------------------------------------------------------------------- # ---------------------------------------------------------------------- # External libraries # ---------------------------------------------------------------------- import sys import os # ---------------------------------...
unknown
codeparrot/codeparrot-clean
#!/usr/bin/env python import requests import json from json import encoder import sys import six import ec2 def add_pretty_names(instances): family_names = { 't2': 'T2 General Purpose', 'r3': 'R3 Memory Optimized', 'r4': 'R4 Memory Optimized', 'c3': 'C3 High-CPU', 'c4': 'C...
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
/* * Copyright (C) 2014 The Guava Authors * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed ...
java
github
https://github.com/google/guava
guava/src/com/google/common/base/MoreObjects.java
"""This is a sample module that doesn't really test anything all that interesting. It simply has a few tests, some of which succeed and some of which fail. It's important that the numbers remain constant as another test is testing the running of these tests. >>> 2+2 4 """ def foo(): """ >>> 2+2 5 ...
unknown
codeparrot/codeparrot-clean
/*------------------------------------------------------------------------- * * indexam.c * general index access method routines * * Portions Copyright (c) 1996-2026, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * * IDENTIFICATION * src/backe...
c
github
https://github.com/postgres/postgres
src/backend/access/index/indexam.c
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) %YAML 1.2 --- $id: http://devicetree.org/schemas/net/davicom,dm9051.yaml# $schema: http://devicetree.org/meta-schemas/core.yaml# title: Davicom DM9051 SPI Ethernet Controller maintainers: - Joseph CHANG <josright123@gmail.com> description: | The DM9051 is...
unknown
github
https://github.com/torvalds/linux
Documentation/devicetree/bindings/net/davicom,dm9051.yaml
''' Copyright 2016 University of Auckland 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 agre...
unknown
codeparrot/codeparrot-clean
"""Test helpers for Panasonic Viera.""" from unittest.mock import Mock, patch from panasonic_viera import TV_TYPE_ENCRYPTED, TV_TYPE_NONENCRYPTED import pytest from homeassistant.components.panasonic_viera.const import ( ATTR_FRIENDLY_NAME, ATTR_MANUFACTURER, ATTR_MODEL_NUMBER, ATTR_UDN, CONF_APP...
unknown
codeparrot/codeparrot-clean
""" Mazhalai ------- Custom code interpreter. :copyright: (c) 2017 by Gokul Sridhar. :license: MIT """ import pprint _pp = pprint.PrettyPrinter(indent=2) def _print_node(node, indent, indent_symbol): if isinstance(node, list): for child in node: for p in _print_node(child, indent, indent_s...
unknown
codeparrot/codeparrot-clean
# pylint: disable=missing-docstring import ddt from unittest import TestCase from track import contexts @ddt.ddt class TestContexts(TestCase): COURSE_ID = 'test/course_name/course_run' SPLIT_COURSE_ID = 'course-v1:test+course_name+course_run' ORG_ID = 'test' @ddt.data( (COURSE_ID, ''), ...
unknown
codeparrot/codeparrot-clean
/* contrib/jsonb_plpython/jsonb_plpython3u--1.0.sql */ -- complain if script is sourced in psql, rather than via CREATE EXTENSION \echo Use "CREATE EXTENSION jsonb_plpython3u" to load this file. \quit CREATE FUNCTION jsonb_to_plpython3(val internal) RETURNS internal LANGUAGE C STRICT IMMUTABLE AS 'MODULE_PATHNAME', '...
sql
github
https://github.com/postgres/postgres
contrib/jsonb_plpython/jsonb_plpython3u--1.0.sql
# frozen_string_literal: true class BookIdentifier < ActiveRecord::Base belongs_to :book end
ruby
github
https://github.com/rails/rails
activerecord/test/models/book_identifier.rb
# (c) 2012, Michael DeHaan <michael.dehaan@gmail.com> # (c) 2013, Dylan Martin <dmartin@seattlecentral.edu> # # 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 v...
unknown
codeparrot/codeparrot-clean
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). All Rights Reserved # $Id$ # # This program is free software: you can redistribute it and/or modify # ...
unknown
codeparrot/codeparrot-clean
/* 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 applicable law or a...
c
github
https://github.com/tensorflow/tensorflow
tensorflow/core/lib/monitoring/cell_reader-inl.h
# Frames Each call to a Python function has an activation record, commonly known as a "frame". It contains information about the function being executed, consisting of three conceptual sections: * Local variables (including arguments, cells and free variables) * Evaluation stack * Specials: The per-frame object refer...
unknown
github
https://github.com/python/cpython
InternalDocs/frames.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/AsyncKafkaConsumerTest.java
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU...
unknown
codeparrot/codeparrot-clean
#Test the FitPara classes import sys sys.path.append("/home/mscook/Desktop/PhD/Projects/pyParaTools") from ParaParser import * from CalcPara import * from FitPara import * from ParaUtils import * print 80*'-' print " Testing FitPara.py" print 80*'-' #python test_FitPara.py pre ~/Desktop/PREfit_python/TESTDATA/PDB/...
unknown
codeparrot/codeparrot-clean
name: Misc on: [push, pull_request, merge_group] concurrency: group: ${{ github.workflow }} / ${{ startsWith(github.event_name, 'pull') && github.ref_name || github.sha }} cancel-in-progress: ${{ startsWith(github.event_name, 'pull') }} permissions: contents: read jobs: checks: name: Miscellaneous checks...
unknown
github
https://github.com/ruby/ruby
.github/workflows/check_misc.yml
#!/usr/bin/env ruby require 'benchmark' i, o = IO.pipe o.sync = true DOT = ".".freeze chunks = 100_000.times.collect{DOT} thread = Thread.new do while i.read(1024) end end 100.times do o.write(*chunks) end o.close thread.join
ruby
github
https://github.com/ruby/ruby
benchmark/io_write.rb
# populator/helpers/luks.py # LUKS backend code for populating a DeviceTree. # # Copyright (C) 2009-2015 Red Hat, Inc. # # This copyrighted material is made available to anyone wishing to use, # modify, copy, or redistribute it subject to the terms and conditions of # the GNU Lesser General Public License v.2, or (at ...
unknown
codeparrot/codeparrot-clean
# Copyright 2014-2015 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 writi...
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/security/token/delegation/web/ServletUtils.java
import logging import re class CPLog(object): context = '' replace_private = ['api', 'apikey', 'api_key', 'password', 'username', 'h', 'uid', 'key', 'passkey'] Env = None is_develop = False def __init__(self, context = ''): if context.endswith('.main'): context = context[:-5]...
unknown
codeparrot/codeparrot-clean
# -*- coding: utf-8 -*- """ werkzeug.testsuite.wrappers ~~~~~~~~~~~~~~~~~~~~~~~~~~~ Tests for the response and request objects. :copyright: (c) 2013 by Armin Ronacher. :license: BSD, see LICENSE for more details. """ import unittest import pickle from io import BytesIO from datetime import datetim...
unknown
codeparrot/codeparrot-clean
// Copyright 2019-2024 Tauri Programme within The Commons Conservancy // SPDX-License-Identifier: Apache-2.0 // SPDX-License-Identifier: MIT const HEADERS = `// Copyright 2019-2024 Tauri Programme within The Commons Conservancy // SPDX-License-Identifier: Apache-2.0 // SPDX-License-Identifier: MIT` const fs = require...
javascript
github
https://github.com/tauri-apps/tauri
packages/cli/append-headers.js
/** * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.dev/license */ import { Component, ElementRef, effect, input, output, signal, viewChild, ChangeDetectionStrategy, ...
typescript
github
https://github.com/angular/angular
devtools/projects/ng-devtools/src/lib/shared/object-tree-explorer/property-editor/property-editor.component.ts
from util.ncconv.experimental.ocg_stat import OcgStatFunction class Section(object): _title = None def __init__(self,lines=[],title=None): self.lines = lines self.title = title or self._title @property def formatted_title(self): msg = '=== {0} ==='.format(self._title) ...
unknown
codeparrot/codeparrot-clean
/* This file is generated by scripts/process-messages/index.js. Do not edit! */ export * from '../shared/errors.js'; /** * The node API `AsyncLocalStorage` is not available, but is required to use async server rendering. * @returns {never} */ export function async_local_storage_unavailable() { const error = new ...
javascript
github
https://github.com/sveltejs/svelte
packages/svelte/src/internal/server/errors.js
//go:build linux package nftabler import ( "github.com/moby/moby/v2/daemon/libnetwork/internal/nftables" ) // mirroredWSL2Workaround adds IPv4 NAT rule if docker's host Linux appears to // be a guest running under WSL2 in with mirrored mode networking. // https://learn.microsoft.com/en-us/windows/wsl/networking#mir...
go
github
https://github.com/moby/moby
daemon/libnetwork/drivers/bridge/internal/nftabler/wsl2.go
""" [2016-12-09] Challenge #294 [Hard] Rack management 3 https://www.reddit.com/r/dailyprogrammer/comments/5hcd0x/20161209_challenge_294_hard_rack_management_3/ # Description Today's challenge is an optimization problem. I'll give you the rules of a game, loosely inspired by solitaire Scrabble, and you try to get the...
unknown
codeparrot/codeparrot-clean
<?php namespace Illuminate\Tests\Cache; use Exception; use Illuminate\Cache\FileStore; use Illuminate\Contracts\Filesystem\FileNotFoundException; use Illuminate\Filesystem\Filesystem; use Illuminate\Support\Carbon; use Illuminate\Support\Str; use Mockery as m; use PHPUnit\Framework\TestCase; class CacheFileStoreTest...
php
github
https://github.com/laravel/framework
tests/Cache/CacheFileStoreTest.php
# script to convert the newly generated Relative Humidity def convert_to_hur( tas_arr, vap_arr ): import numpy as np with np.errstate( over='ignore' ): esa_arr = 6.112 * np.exp( 17.62 * tas_arr/ (243.12 + tas_arr) ) # esa_arr = 6.112 * np.exp( 22.46 * tas_arr / (272.62 + tas_arr) ) return vap_arr/esa_arr * 100 ...
unknown
codeparrot/codeparrot-clean
# Copyright (C) 2016 Google Inc. # Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file> """Add AssessmentTemplate Revision ID: 1894405f14ef Revises: 1e2abee7566c Create Date: 2016-02-25 11:49:25.128231 """ # pylint: disable=invalid-name import sqlalchemy as sa from alembic import op # rev...
unknown
codeparrot/codeparrot-clean
/* * Copyright (c) 2007 Mockito contributors * This program is made available under the terms of the MIT License. */ package org.mockitousage.strictness; import static org.assertj.core.api.Assertions.assertThatThrownBy; import static org.mockito.Mockito.lenient; import static org.mockito.Mockito.when; import org.a...
java
github
https://github.com/mockito/mockito
mockito-core/src/test/java/org/mockitousage/strictness/StrictnessWithRulesTest.java
import os def needs_notifying(size_trigger, size_available): """Checks whether we need to send a notification Args: size_trigger: minimum amount of free space in GB size_available: currently available free space in bytes """ return size_available <= (size_trigger * 1024*1024*1024) def format_...
unknown
codeparrot/codeparrot-clean
// Copyright 2012 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. // This file implements API tests across platforms and will never have a build // tag. package net import ( "internal/testenv" "os" "runtime" "testing" "...
go
github
https://github.com/golang/go
src/net/protoconn_test.go
{ "key": { "algo": "rsa", "size": 2048 }, "names": [ { "O": "etcd", "OU": "etcd Security", "L": "San Francisco", "ST": "California", "C": "USA" } ], "CN": "ca", "ca": { "expiry": "87600h" } }
json
github
https://github.com/etcd-io/etcd
pkg/proxy/fixtures/ca-csr.json
''' Copyright 2010-2013 DIMA Research Group, TU Berlin 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...
unknown
codeparrot/codeparrot-clean
########################################################## # THIS IS A GENERATED FILE -- DO NOT MODIFY. # IF YOU WISH TO MODIFY THIS SUITE, MODIFY THE CORRESPONDING MATRIX SUITE MAPPING FILE # AND REGENERATE THE MATRIX SUITES. # # matrix suite mapping file: buildscripts/resmokeconfig/matrix_suites/mappings/core_repeat_...
unknown
github
https://github.com/mongodb/mongo
buildscripts/resmokeconfig/matrix_suites/generated_suites/core_repeat_queries.yml
from trakt.core.errors import ERRORS from trakt.core.exceptions import ServerError, ClientError from trakt.helpers import setdefault from functools import wraps import logging log = logging.getLogger(__name__) def authenticated(func): @wraps(func) def wrap(*args, **kwargs): kwargs['authenticated'] = ...
unknown
codeparrot/codeparrot-clean
# -*- coding: utf-8 -*- # # Newfies-Dialer License # http://www.newfies-dialer.org # # This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this file, # You can obtain one at http://mozilla.org/MPL/2.0/. # # Copyright (C) 2011-2014 Star2Bil...
unknown
codeparrot/codeparrot-clean
#!/usr/bin/env python # -*- coding: utf-8 -*- import os import sys import warnings import getopt from shutil import move from os import remove, close """Modify meta information in raw experimental data. While comparing algorithms with the bbob_proc package, it is sometimes needed to change the algorithm name (given ...
unknown
codeparrot/codeparrot-clean
''' Description Check for each generation n, compare the list of individual IDs in the sim file, to the list of individual IDs in the nth pop in the genepop file ''' from __future__ import print_function __filename__ ="" __date__ = "20160825" __author__ = "Ted Cosart<ted.cosart@umontana.edu>" import sys import supp_ut...
unknown
codeparrot/codeparrot-clean
import warnings from rope.base import exceptions, pyobjects, pynames, taskhandle, evaluate, worder, codeanalyze from rope.base.change import ChangeSet, ChangeContents, MoveResource from rope.refactor import occurrences, sourceutils class Rename(object): """A class for performing rename refactoring It can ren...
unknown
codeparrot/codeparrot-clean
""" A model of an Infrastructure Cluster in CFME :var page: A :py:class:`cfme.web_ui.Region` object describing common elements on the Cluster pages. """ from functools import partial from navmazing import NavigateToSibling, NavigateToAttribute from cfme.fixtures import pytest_selenium as sel from utils.app...
unknown
codeparrot/codeparrot-clean
"""SCons.Tool.pdflatex Tool-specific initialization for pdflatex. 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 (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 The SCons Foundation #...
unknown
codeparrot/codeparrot-clean
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2015, Manuel Sousa <manuel.sousa@gmail.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_version': '1.1',...
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
class Flap(object): """Common registration methods for applications & blueprints""" def __init__(self, flail): self.flail = flail def configure_context_processors(self, app, context_processors): """Sets app wide context processors.""" app.context_processor(lambda: context_processors...
unknown
codeparrot/codeparrot-clean
/*------------------------------------------------------------------------- * * allpaths.c * Routines to find possible search paths for processing a query * * Portions Copyright (c) 1996-2026, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * * IDE...
c
github
https://github.com/postgres/postgres
src/backend/optimizer/path/allpaths.c
from PySide import QtGui, QtCore class Tree(QtGui.QTreeView): def __init__(self, parent=None): super(Tree, self).__init__(parent) self.dir_path = None # TODO: resize tree according to contents. # For now, max width is hardcoded. self.setMaximumWidth(180) def load_from_dir(self, dir_path): """ Load dire...
unknown
codeparrot/codeparrot-clean
""" The :mod:`websockets.client` module defines a simple WebSocket client API. """ __all__ = ['connect', 'WebSocketClientProtocol'] import asyncio from .exceptions import InvalidHandshake from .handshake import build_request, check_response from .http import read_response, USER_AGENT from .protocol import WebSocketC...
unknown
codeparrot/codeparrot-clean
// Copyright 2017 The Abseil 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 by applicable law or agr...
c
github
https://github.com/mysql/mysql-server
extra/abseil/abseil-cpp-20230802.1/absl/base/internal/thread_identity.h
from django import template from django.contrib.admin.utils import quote from django.core.urlresolvers import Resolver404, get_script_prefix, resolve from django.utils.http import urlencode from django.utils.six.moves.urllib.parse import parse_qsl, urlparse, urlunparse register = template.Library() @register.filter d...
unknown
codeparrot/codeparrot-clean
""" Tests for kqueue wrapper. """ import errno import os import select import socket import sys import time import unittest from test import support if not hasattr(select, "kqueue"): raise unittest.SkipTest("test works only on BSD") class TestKQueue(unittest.TestCase): def test_create_queue(self): kq ...
unknown
codeparrot/codeparrot-clean
#################################### IMPORTS ################################### if __name__ == '__main__': import sys import os pkg_dir = os.path.split(os.path.abspath(__file__))[0] parent_dir, pkg_name = os.path.split(pkg_dir) is_pygame_pkg = (pkg_name == 'tests' and os.path....
unknown
codeparrot/codeparrot-clean
""" Tools for memoization of function results. """ from functools import wraps from six import iteritems from weakref import WeakKeyDictionary class lazyval(object): """ Decorator that marks that an attribute should not be computed until needed, and that the value should be memoized. Example -----...
unknown
codeparrot/codeparrot-clean
/* Copyright (c) 2000, 2025, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, as published by the Free Software Foundation. This program is designed to work with certain software (including...
c
github
https://github.com/mysql/mysql-server
client/include/caching_sha2_passwordopt-longopts.h
name: Release Doctor on: push: branches: - main workflow_dispatch: jobs: release_doctor: name: release doctor runs-on: ubuntu-latest environment: publish if: github.repository == 'openai/openai-python' && (github.event_name == 'push' || github.event_name == 'workflow_dispatch' || starts...
unknown
github
https://github.com/openai/openai-python
.github/workflows/release-doctor.yml
# -*- coding: utf-8 -*- import re import os import logging from lxml import etree, html from eduskunta.importer import Importer from parliament.models.member import Seat, MemberSeat, Member class SeatImporter(Importer): SEAT_FILENAME = 'seats.txt' MPSEAT_FILENAME = 'mp-seats.txt' def import_seats(self): ...
unknown
codeparrot/codeparrot-clean
#!/usr/bin/env python # # Copyright (c) 2001 - 2016 The SCons Foundation # # 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 us...
unknown
codeparrot/codeparrot-clean
import sys, time from django.conf import settings from django.db import connection, transaction, backend from django.core import management from django.dispatch import dispatcher from django.test import signals from django.template import Template # The prefix to put on the default database name when creating # the te...
unknown
codeparrot/codeparrot-clean
#ifndef _OPENCV_IMAGESTORAGE_H_ #define _OPENCV_IMAGESTORAGE_H_ class CvCascadeImageReader { public: bool create( const std::string _posFilename, const std::string _negFilename, cv::Size _winSize ); void restart() { posReader.restart(); } bool getNeg(cv::Mat &_img) { return negReader.get( _img ); } boo...
c
github
https://github.com/opencv/opencv
apps/traincascade/imagestorage.h
#!/usr/bin/python # coding=UTF-8 # # BitCurator NLP (Disk Image Access for the Web) # Copyright (C) 2014 - 2016 # All rights reserved. # # This code is distributed under the terms of the GNU General Public # License, Version 3. See the text file "COPYING" for further details # about the terms of this license. # # This ...
unknown
codeparrot/codeparrot-clean
# 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...
unknown
github
https://github.com/tensorflow/tensorflow
.github/workflows/scorecards-analysis.yml
import os def parse_distributions_h(ffi, inc_dir): """ Parse distributions.h located in inc_dir for CFFI, filling in the ffi.cdef Read the function declarations without the "#define ..." macros that will be filled in when loading the library. """ with open(os.path.join(inc_dir, 'random', 'bit...
python
github
https://github.com/numpy/numpy
numpy/random/_examples/cffi/parse.py
from builtins import str from builtins import object import logging import copy from elasticsearch import Elasticsearch class BmajIndex(object): ''' ElasticSearch indexation and search ''' ''' ElasticSearch server ''' es = None ''' Index name ''' index = 'biomaj' ''' ...
unknown
codeparrot/codeparrot-clean
from optparse import OptionParser import sys import graph def init_parser(): parser = OptionParser() parser.add_option("-f", "--file", dest = "File", type = "string", help = "") parser.add_option("-o", "--output", dest = "Output", type = "string", help = "") (options, args) = parser.parse_args() # use...
unknown
codeparrot/codeparrot-clean
"""Calendar module for Zinnia""" from __future__ import absolute_import from datetime import date from calendar import HTMLCalendar from django.utils.dates import MONTHS from django.utils.dates import WEEKDAYS_ABBR from django.utils.formats import get_format from django.utils.formats import date_format from django.co...
unknown
codeparrot/codeparrot-clean
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) %YAML 1.2 --- $id: http://devicetree.org/schemas/dma/loongson,ls1b-apbdma.yaml# $schema: http://devicetree.org/meta-schemas/core.yaml# title: Loongson-1 APB DMA Controller maintainers: - Keguang Zhang <keguang.zhang@gmail.com> description: Loongson-1 APB ...
unknown
github
https://github.com/torvalds/linux
Documentation/devicetree/bindings/dma/loongson,ls1b-apbdma.yaml
/* __next_internal_client_entry_do_not_use__ default auto */ export default function App() { async function fn() { 'use server'; } return <div>App</div>; }
javascript
github
https://github.com/vercel/next.js
crates/next-custom-transforms/tests/errors/server-actions/client-graph/1/output.js
""" Module simplifying manipulation of XML described at http://libvirt.org/formatstorage.html#StorageVol """ from virttest.libvirt_xml import base, accessors from virttest.libvirt_xml.xcepts import LibvirtXMLNotFoundError class VolXMLBase(base.LibvirtXMLBase): """ Accessor methods for VolXML class. Prop...
unknown
codeparrot/codeparrot-clean
# frozen_string_literal: true require "cases/helper" require "models/auto_id" require "models/aircraft" require "models/dashboard" require "models/clothing_item" require "models/post" require "models/comment" require "models/author" require "models/topic" require "models/reply" require "models/category" require "model...
ruby
github
https://github.com/rails/rails
activerecord/test/cases/persistence_test.rb
import { test, expect } from "@playwright/test"; import { PlaywrightFixture } from "./helpers/playwright-fixture.js"; import type { Fixture, AppFixture } from "./helpers/create-fixture.js"; import { createAppFixture, createFixture, js, } from "./helpers/create-fixture.js"; let fixture: Fixture; let appFixture: ...
typescript
github
https://github.com/remix-run/react-router
integration/request-test.ts
package kotlinx.coroutines.test import kotlinx.coroutines.testing.* import kotlinx.coroutines.* import kotlin.test.* @Suppress("DEPRECATION", "DEPRECATION_ERROR") class TestRunBlockingOrderTest: OrderedExecutionTestBase() { @Test fun testLaunchImmediate() = runBlockingTest { expect(1) launch ...
kotlin
github
https://github.com/Kotlin/kotlinx.coroutines
kotlinx-coroutines-test/jvm/test/migration/TestRunBlockingOrderTest.kt
''' Setup script for M-LOOP using setuptools. See the documentation of setuptools for further details. ''' from __future__ import absolute_import, division, print_function import multiprocessing as mp import mloop as ml from setuptools import setup, find_packages from os import path def main(): long_description ...
unknown
codeparrot/codeparrot-clean
import sys from optparse import OptionParser import os import re usage = "usage: %prog [options] file" version = "2.1.0" version_text = "%prog {}".format(version) opt = OptionParser(usage = usage, version = version_text) opt.add_option ("-l","--language" ,action = "store" ,dest = "lan...
unknown
codeparrot/codeparrot-clean
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2010 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # All Rights Reserved. # Copyright (c) 2010 Citrix Systems, Inc. # Copyright 2013 IBM Corp. # # Licensed under the Apache License, Version...
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
build-plugin/spring-boot-gradle-plugin/src/test/resources/com/example/boottestrun/nomain/BootTestRunNoMain.java
# # Gramps - a GTK+/GNOME based genealogy program # # Copyright (C) 2010 Michiel D. Nauta # # 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...
unknown
codeparrot/codeparrot-clean
# Copyright 2015 Abhijit Menon-Sen <ams@2ndQuadrant.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 License, or # (at your option) any ...
unknown
codeparrot/codeparrot-clean
from wtforms import TextField from wtforms import IntegerField as _IntegerField from wtforms import DecimalField as _DecimalField from wtforms import DateField as _DateField from wtforms.widgets import Input class DateInput(Input): """ Creates `<input type=date>` widget """ input_type = "date" class N...
unknown
codeparrot/codeparrot-clean
# (c) 2016 Red Hat 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. # # Ansible is dis...
unknown
codeparrot/codeparrot-clean
from django.conf import settings from django.contrib.auth import authenticate, login from django.contrib.auth.models import User from django.http import HttpResponseRedirect from django.utils import importlib from django.utils.translation import ugettext_lazy as _ from django.views.generic.base import TemplateResponseM...
unknown
codeparrot/codeparrot-clean
# # ElementTree # $Id: ElementTree.py 2326 2005-03-17 07:45:21Z fredrik $ # # light-weight XML support for Python 1.5.2 and later. # # history: # 2001-10-20 fl created (from various sources) # 2001-11-01 fl return root from parse method # 2002-02-16 fl sort attributes in lexical order # 2002-04-06 fl TreeBuilde...
unknown
codeparrot/codeparrot-clean
#-*- coding: utf-8 -*- from django.contrib.auth.models import AnonymousUser from django.core.exceptions import ObjectDoesNotExist from shop.models import AddressModel #=============================================================================== # Addresses handling #=================================================...
unknown
codeparrot/codeparrot-clean
.d.svelte-xyz ~ .e:where(.svelte-xyz) { color: green; } .a.svelte-xyz ~ .g:where(.svelte-xyz) { color: green; } .a.svelte-xyz ~ .b:where(.svelte-xyz) { color: green; } .f.svelte-xyz ~ .g:where(.svelte-xyz) { color: green; } .b.svelte-xyz ~ .g:where(.svelte-xyz) { color: green; } /* no match */ /* (unused) .b ~ ....
css
github
https://github.com/sveltejs/svelte
packages/svelte/tests/css/samples/general-siblings-combinator-slot/expected.css
""" Tests for tab functions (just primitive). """ import json from contentstore.views import tabs from contentstore.tests.utils import CourseTestCase from contentstore.utils import reverse_course_url from xmodule.x_module import STUDENT_VIEW from xmodule.modulestore.tests.factories import CourseFactory, ItemFactory f...
unknown
codeparrot/codeparrot-clean
# -*- coding: utf-8 -*- from django.db import models import jsonschema from website.util import api_v2_url from osf.models.base import BaseModel, ObjectIDMixin from osf.utils.datetime_aware_jsonfield import DateTimeAwareJSONField from osf.exceptions import ValidationValueError from website.project.metadata.utils imp...
unknown
codeparrot/codeparrot-clean
# frozen_string_literal: true require "cases/helper" class PostgresqlExtensionMigrationTest < ActiveRecord::PostgreSQLTestCase self.use_transactional_tests = false class EnableHstore < ActiveRecord::Migration::Current def change enable_extension "hstore" end end class DisableHstore < ActiveRec...
ruby
github
https://github.com/rails/rails
activerecord/test/cases/adapters/postgresql/extension_migration_test.rb
from . import main if __name__ == "__main__": main()
python
github
https://github.com/python/cpython
Lib/zipfile/__main__.py
# Design patterns for AI SDKs and signal APIs Interacting with AI and Large Language Model (LLM) APIs introduces unique challenges, such as managing asynchronous operations, handling streaming data, and designing a responsive user experience for potentially slow or unreliable network requests. Angular [signals](guide/...
unknown
github
https://github.com/angular/angular
adev/src/content/ai/design-patterns.md
""" Python Character Mapping Codec mac_cyrillic generated from 'MAPPINGS/VENDORS/APPLE/CYRILLIC.TXT' with gencodec.py. """#" import codecs ### Codec APIs class Codec(codecs.Codec): def encode(self,input,errors='strict'): return codecs.charmap_encode(input,errors,encoding_table) def decode(self,inp...
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