code
stringlengths
1
25.8M
language
stringclasses
18 values
source
stringclasses
4 values
repo
stringclasses
78 values
path
stringlengths
0
268
#!/usr/bin/env python """ Simple AIS library. This library supports creating and decoding NMEA formatted AIS type 1,5,24 messages @author Daniel Hong https://github.com/doodleincode/aislib This program is licensed under the GNU GENERAL PUBLIC LICENSE Version 2. A LICENSE file should have accompanied this program....
unknown
codeparrot/codeparrot-clean
#!/usr/bin/python # # (c) 2017 Apstra Inc, <community@apstra.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 opt...
unknown
codeparrot/codeparrot-clean
import maya.cmds as cmds import RMUncategorized def MirrorChildren(Objects): for eachObject in Objects: children = cmds.listRelatives(eachObject, children = True,type='transform') if (children): MirrorChildren(children) for eachObject in Objects: ObjectTransformDic = RMUnca...
unknown
codeparrot/codeparrot-clean
import Image, { ImageProps } from "next/image"; import ViewSource from "../../components/view-source"; import styles from "../../styles.module.css"; // Note: we cannot use `priority` or `loading="eager" // because we depend on the default `loading="lazy"` // behavior to wait for CSS to reveal the proper image. type Pr...
typescript
github
https://github.com/vercel/next.js
examples/image-component/app/theme/page.tsx
from w3lib.http import headers_dict_to_raw from scrapy.utils.datatypes import CaselessDict class Headers(CaselessDict): """Case insensitive http headers dictionary""" def __init__(self, seq=None, encoding='utf-8'): self.encoding = encoding super(Headers, self).__init__(seq) def normkey(se...
unknown
codeparrot/codeparrot-clean
/* * Copyright 2010-2024 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. */ package org.jetbrains.kotlin.analysis.api.fir.symbols import com.intellij.psi.PsiElement import org.jetbrains...
kotlin
github
https://github.com/JetBrains/kotlin
analysis/analysis-api-fir/src/org/jetbrains/kotlin/analysis/api/fir/symbols/KaFirSyntheticJavaPropertySymbol.kt
/* Copyright 2016 The TensorFlow Authors. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or a...
c
github
https://github.com/tensorflow/tensorflow
tensorflow/core/util/example_proto_helper.h
#!/usr/bin/env bash # 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. # See golang.org/s/go15bootstrap for an overview of the build process. # Environment variables that control make.bash: # # GOHOSTARCH: The arc...
unknown
github
https://github.com/golang/go
src/make.bash
/* * 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
build-tools-internal/src/test/java/org/elasticsearch/gradle/internal/test/rest/transform/TransformTests.java
#!/usr/bin/env python ''' Python DB API 2.0 driver compliance unit test suite. This software is Public Domain and may be used without restrictions. "Now we have booze and barflies entering the discussion, plus rumours of DBAs on drugs... and I won't tell you what flashes through my mind each time I read the ...
unknown
codeparrot/codeparrot-clean
# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) %YAML 1.2 --- $id: http://devicetree.org/schemas/clock/mediatek,mt8196-clock.yaml# $schema: http://devicetree.org/meta-schemas/core.yaml# title: MediaTek Functional Clock Controller for MT8196 maintainers: - Guangjie Song <guangjie.song@mediatek.com> - Laura Na...
unknown
github
https://github.com/torvalds/linux
Documentation/devicetree/bindings/clock/mediatek,mt8196-clock.yaml
// Copyright (c) HashiCorp, Inc. // SPDX-License-Identifier: BUSL-1.1 package local import ( "log" "sync" "time" "github.com/hashicorp/terraform/internal/schemarepo" "github.com/hashicorp/terraform/internal/states" "github.com/hashicorp/terraform/internal/states/statemgr" "github.com/hashicorp/terraform/inter...
go
github
https://github.com/hashicorp/terraform
internal/backend/local/hook_state.go
#!/usr/bin/env python """Adds whitelisted Friends and Sends Snaps to Story Usage: updateStory.py -u <username> [-p <password> -d <tmpdir> -sv] WHITELIST Options: -h Show usage -u=<username> Username -p=<password> Password(optional, will promp if ommitted) -d=<tmpdir> Wher...
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
codeparrot/codeparrot-clean
# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under t...
unknown
codeparrot/codeparrot-clean
#!/usr/bin/env ruby # frozen_string_literal: true require "forwardable" require "colorator" require "liquid" require "benchmark/ips" require "memory_profiler" # Set up (memory) profiler class Profiler def self.run yield new(ARGV[0] || 10_000) end def initialize(count) @count = count.to_i end def ...
ruby
github
https://github.com/jekyll/jekyll
benchmark/static-drop-vs-forwarded.rb
""" Tests for bulk operations in Split Modulestore. """ # pylint: disable=protected-access import copy import unittest import six import ddt from bson.objectid import ObjectId from mock import MagicMock, Mock, call from opaque_keys.edx.locator import CourseLocator from six.moves import range from xmodule.modulestore...
unknown
codeparrot/codeparrot-clean
#!/usr/bin/python ### BEGIN INIT INFO # Provides: eth0.1.up # Required-Start: network-manager # Required-Stop: # Default-Start: # Default-Stop: # Short-Description: Raise eth0:1 network interface. ### END INIT INFO # usage: # -daemon (or --daemon): run in background LAN_SETTINGS = { 'eth0': { 'address':...
unknown
codeparrot/codeparrot-clean
#!/usr/bin/python # # Copyright (c) 2019 Liu Qingyi, (@smile37773) # # 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', 'st...
unknown
codeparrot/codeparrot-clean
from test import test_support from test.test_support import bigmemtest, _1G, _2G, _4G, precisionbigmemtest import unittest import operator import string import sys # Bigmem testing houserules: # # - Try not to allocate too many large objects. It's okay to rely on # refcounting semantics, but don't forget that 's ...
unknown
codeparrot/codeparrot-clean
# pylint: skip-file import json import logging from collections import defaultdict from datetime import datetime from django.conf import settings from django.contrib.auth.models import User from django.db import connection from django.http import HttpResponse from django.urls import reverse from django.utils.deprecat...
unknown
codeparrot/codeparrot-clean
//! Peephole optimizations that can be performed while creating clif ir. use cranelift_codegen::ir::condcodes::IntCC; use cranelift_codegen::ir::{InstructionData, Opcode, Value, ValueDef}; use cranelift_frontend::FunctionBuilder; /// If the given value was produced by the lowering of `Rvalue::Not` return the input an...
rust
github
https://github.com/rust-lang/rust
compiler/rustc_codegen_cranelift/src/optimize/peephole.rs
# -*- coding: utf-8 -*- ######################################################################### # # Copyright (C) 2016 OSGeo # # 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 ...
unknown
codeparrot/codeparrot-clean
#----------------------------------------------------------------------------- # Copyright (c) 2012 - 2015, Continuum Analytics, Inc. All rights reserved. # # Powered by the Bokeh Development Team. # # The full license is in the file LICENSE.txt, distributed with this software. #----------------------------------------...
unknown
codeparrot/codeparrot-clean
# -*- coding: utf-8 -*- """ This tokenizer has been copied from the ``tokenize.py`` standard library tokenizer. The reason was simple: The standard library tokenizer fails if the indentation is not right. The fast parser of jedi however requires "wrong" indentation. Basically this is a stripped down version of the sta...
unknown
codeparrot/codeparrot-clean
// RUN: clang-tidy -dump-config | FileCheck %s // RUN: clang-tidy -dump-config -use-color | FileCheck -check-prefix=CHECK-CONFIG-COLOR %s // RUN: clang-tidy -dump-config -use-color=false | FileCheck -check-prefix=CHECK-CONFIG-NO-COLOR %s // RUN: clang-tidy -config='UseColor: true' -dump-config | FileCheck -check-prefix...
cpp
github
https://github.com/llvm/llvm-project
clang-tools-extra/test/clang-tidy/infrastructure/use-color.cpp
/* * 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/ipc/package-info.java
import docutils.frontend import docutils.parsers.rst import docutils.writers.html4css1 import docutils.utils from sphinx_testing.path import path from sphinx_testing import with_app as with_sphinx_testing test_root = path(__file__).parent.joinpath('root').abspath() test_roots = path(__file__).parent.joinpath('roots')....
unknown
codeparrot/codeparrot-clean
import logging from autotest.client.shared import utils, error from virttest import virsh, virt_vm from virttest.libvirt_xml import vm_xml def run_virsh_setmaxmem(test, params, env): """ Test command: virsh setmaxmem. 1) Prepare vm environment. 2) Handle params 3) Run test command and get vm start...
unknown
codeparrot/codeparrot-clean
# -*- coding: utf-8 -*- """ werkzeug.contrib.fixers ~~~~~~~~~~~~~~~~~~~~~~~ .. versionadded:: 0.5 This module includes various helpers that fix bugs in web servers. They may be necessary for some versions of a buggy web server but not others. We try to stay updated with the status of the bug...
unknown
codeparrot/codeparrot-clean
/* deflate_medium.c -- The deflate_medium deflate strategy * * Copyright (C) 2013 Intel Corporation. All rights reserved. * Authors: * Arjan van de Ven <arjan@linux.intel.com> * * For conditions of distribution and use, see copyright notice in zlib.h */ #ifndef NO_MEDIUM_STRATEGY #include "zbuild.h" #include...
c
github
https://github.com/opencv/opencv
3rdparty/zlib-ng/deflate_medium.c
# -*- coding: UTF-8 -*- ## Copyright 2013 Luc Saffre ## This file is part of the Lino project. ## Lino 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) ...
unknown
codeparrot/codeparrot-clean
# Copyright (C) 2007-2012 Red Hat # see file 'COPYING' for use and warranty information # # policygentool is a tool for the initial generation of SELinux policy # # 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 ...
unknown
codeparrot/codeparrot-clean
# Copyright (c) 2001-2008 Twisted Matrix Laboratories. # See LICENSE for details. """ Tests for L{twisted.words.xmpproutertap}. """ from twisted.application import internet from twisted.trial import unittest from twisted.words import xmpproutertap as tap from twisted.words.protocols.jabber import component class XMP...
unknown
codeparrot/codeparrot-clean
#!/usr/bin/python #----------------------------------------------------------------------------- # Copyright (c) 2013, PyInstaller Development Team. # # Distributed under the terms of the GNU General Public License with exception # for distributing bootloader. # # The full license is in the file COPYING.txt, distribute...
unknown
codeparrot/codeparrot-clean
/********************************************************************** windows_1257.c - Oniguruma (regular expression library) **********************************************************************/ /*- * Copyright (c) 2002-2007 K.Kosako <sndgk393 AT ybb DOT ne DOT jp> * All rights reserved. * * Redistributio...
c
github
https://github.com/ruby/ruby
enc/windows_1257.c
""" Utility functions for sparse matrix module """ from __future__ import division, print_function, absolute_import __all__ = ['upcast','getdtype','isscalarlike','isintlike', 'isshape','issequence','isdense','ismatrix'] import warnings import numpy as np from scipy._lib._version import NumpyVersion # k...
unknown
codeparrot/codeparrot-clean
""" DefaultHeaders downloader middleware See documentation in docs/topics/downloader-middleware.rst """ from __future__ import annotations from typing import TYPE_CHECKING from scrapy.utils.decorators import _warn_spider_arg from scrapy.utils.python import without_none_values if TYPE_CHECKING: from collections...
python
github
https://github.com/scrapy/scrapy
scrapy/downloadermiddlewares/defaultheaders.py
/** * Represents the completion of an asynchronous operation */ interface Promise<T> { /** * Attaches a callback that is invoked when the Promise is settled (fulfilled or rejected). The * resolved value cannot be modified from the callback. * @param onfinally The callback to execute when the Promis...
typescript
github
https://github.com/microsoft/TypeScript
src/lib/es2018.promise.d.ts
/** * 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/io/TwoDArrayWritable.java
//===----------------------------------------------------------------------===// // // 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/ReplaceDisallowCopyAndAssignMacroCheck.cpp
#include <acl/acl.h> #include <unistd.h> // fork() #include <iostream> int main(int /*argc*/, char** /*argv*/) { int ret = aclInit(NULL); if (ret != 0) { std::cerr << "Failed to initialize Ascend, ret = " << ret; } ret = aclFinalize(); if (ret != 0) { std::cerr << "Failed t...
cpp
github
https://github.com/opencv/opencv
cmake/checks/cann.cpp
/* * 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/clients/producer/internals/ProducerBatch.java
#!/usr/bin/env python3 # Copyright (C) 2017 Inria # # This file is subject to the terms and conditions of the GNU Lesser # General Public License v2.1. See the file LICENSE in the top level # directory for more details. import os import sys PS_EXPECTED = ( ('\tpid | name | state Q | pri | stac...
unknown
codeparrot/codeparrot-clean
from __future__ import absolute_import from __future__ import with_statement from mock import patch from celery import current_app from celery import states from celery.exceptions import RetryTaskError from celery.task.trace import TraceInfo, eager_trace_task, trace_task from celery.tests.utils import Case, Mock @cu...
unknown
codeparrot/codeparrot-clean
from __future__ import annotations from collections import deque from typing import TYPE_CHECKING from twisted.internet import defer from twisted.internet.defer import Deferred from twisted.python.failure import Failure from twisted.web.client import ( URI, BrowserLikePolicyForHTTPS, ResponseFailed, _...
python
github
https://github.com/scrapy/scrapy
scrapy/core/http2/agent.py
"""Agent factory for creating agents with middleware support.""" from __future__ import annotations import itertools from dataclasses import dataclass, field from typing import ( TYPE_CHECKING, Annotated, Any, Generic, cast, get_args, get_origin, get_type_hints, ) from langchain_core....
python
github
https://github.com/langchain-ai/langchain
libs/langchain_v1/langchain/agents/factory.py
package daemon import ( "context" "errors" "fmt" "io" "github.com/containerd/log" "github.com/moby/go-archive" "github.com/moby/go-archive/chrootarchive" "github.com/moby/go-archive/compression" "github.com/moby/moby/api/types/events" "github.com/moby/moby/v2/daemon/container" "github.com/moby/moby/v2/errd...
go
github
https://github.com/moby/moby
daemon/export.go
/* * 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
build-tools-internal/src/main/java/org/elasticsearch/gradle/internal/BwcVersions.java
#encoding=utf8 import os import sys import math import pdb import random class BinNode: ''' 二项树节点 ''' def __init__(self, e): self.element = e self.left_child = None self.next_sibling = None class BinQueue: ''' 二项队列 一些二项树组成的森林 二项队列的NB之处在于: 插入操作O(N), 最坏O(l...
unknown
codeparrot/codeparrot-clean
"""Simple API for XML (SAX) implementation for Python. This module provides an implementation of the SAX 2 interface; information about the Java version of the interface can be found at http://www.megginson.com/SAX/. The Python version of the interface is documented at <...>. This package contains the following modu...
unknown
codeparrot/codeparrot-clean
# -*- encoding: utf-8 -*- # This file is distributed under the same license as the Django package. # # The *_FORMAT strings use the Django date format syntax, # see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date DATE_FORMAT = r'j \d\e F \d\e Y' TIME_FORMAT = 'H:i:s' DATETIME_FORMAT = r'j \d\e F \d\e...
unknown
codeparrot/codeparrot-clean
#!/usr/bin/env python # Copyright 2013 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. from appengine_wrappers import GetAppVersion from compiled_file_system import CompiledFileSystem from copy import deepcopy from file_sy...
unknown
codeparrot/codeparrot-clean
# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause %YAML 1.2 --- $id: http://devicetree.org/schemas/i2c/i2c-arb-gpio-challenge.yaml# $schema: http://devicetree.org/meta-schemas/core.yaml# title: GPIO-based I2C Arbitration Using a Challenge & Response Mechanism maintainers: - Doug Anderson <dianders@chromium.or...
unknown
github
https://github.com/torvalds/linux
Documentation/devicetree/bindings/i2c/i2c-arb-gpio-challenge.yaml
# Copyright (c) 2013 The WebRTC project authors. All Rights Reserved. # # Use of this source code is governed by a BSD-style license # that can be found in the LICENSE file in the root of the source # tree. An additional intellectual property rights grant can be found # in the file PATENTS. All contributing project au...
unknown
codeparrot/codeparrot-clean
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2012, Red Hat, 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 # ...
unknown
codeparrot/codeparrot-clean
/* * 'OpenSSL for Ruby' project * Copyright (C) 2001-2002 Michal Rokos <m.rokos@sh.cvut.cz> * All rights reserved. */ /* * This program is licensed under the same licence as Ruby. * (See the file 'COPYING'.) */ #if !defined(_OSSL_H_) #define _OSSL_H_ #include RUBY_EXTCONF_H #include <assert.h> #include <ruby....
c
github
https://github.com/ruby/ruby
ext/openssl/ossl.h
use super::MAX_SAFE_MILLIS_DURATION; use crate::time::{Clock, Duration, Instant}; /// A structure which handles conversion from Instants to `u64` timestamps. #[derive(Debug)] pub(crate) struct TimeSource { start_time: Instant, } impl TimeSource { pub(crate) fn new(clock: &Clock) -> Self { Self { ...
rust
github
https://github.com/tokio-rs/tokio
tokio/src/runtime/time/source.rs
#! /usr/bin/env python # Copyright (c) 2009, Code Aurora Forum. 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...
unknown
codeparrot/codeparrot-clean
#!/usr/bin/env python # # Wrapper script for Java Conda packages that ensures that the java runtime # is invoked with the right options. Adapted from the bash script (http://stackoverflow.com/questions/59895/can-a-bash-script-tell-what-directory-its-stored-in/246128#246128). # # Program Parameters # import os import s...
unknown
codeparrot/codeparrot-clean
// SPDX-License-Identifier: GPL-2.0-only /* * async.c: Asynchronous function calls for boot performance * * (C) Copyright 2009 Intel Corporation * Author: Arjan van de Ven <arjan@linux.intel.com> */ /* Goals and Theory of Operation The primary goal of this feature is to reduce the kernel boot time, by doing var...
c
github
https://github.com/torvalds/linux
kernel/async.c
# Copyright (c) 2011 Google 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: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the ...
unknown
codeparrot/codeparrot-clean
/****************************************************************************** * Remote Debugging Module - Asyncio Functions * * This file contains functions for parsing asyncio tasks, coroutines, * and awaited_by relationships from remote process memory. **********************************************************...
c
github
https://github.com/python/cpython
Modules/_remote_debugging/asyncio.c
#!/usr/bin/env python # -*- coding: utf-8 -*- # tifffile.py # Copyright (c) 2008-2014, Christoph Gohlke # Copyright (c) 2008-2014, 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 may not u...
unknown
github
https://github.com/apache/airflow
.github/actions/prepare_breeze_and_image/action.yml
# -*- coding: utf-8 -*- """ pygments.lexers.chapel ~~~~~~~~~~~~~~~~~~~~~~ Lexer for the Chapel language. :copyright: Copyright 2006-2015 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ from pygments.lexer import RegexLexer, bygroups, words from pygments.token import...
unknown
codeparrot/codeparrot-clean
import sys import logging from os.path import exists from functools import lru_cache from contextlib import contextmanager from importlib import invalidate_caches from importlib.machinery import FileFinder, SourceFileLoader import lib2to3 from lib2to3.refactor import RefactoringTool, get_fixers_from_package from . im...
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...
unknown
codeparrot/codeparrot-clean
import os import sys from itertools import takewhile from django.apps import apps from django.core.management.base import BaseCommand, CommandError from django.db.migrations import Migration from django.db.migrations.autodetector import MigrationAutodetector from django.db.migrations.loader import MigrationLoader from...
unknown
codeparrot/codeparrot-clean
/* global QUnit, RelatedObjectLookups */ 'use strict'; QUnit.module('admin.RelatedObjectLookups', { beforeEach: function() { const $ = django.jQuery; $('#qunit-fixture').append(` <input type="text" id="test_id" name="test" /> <input type="text" id="many_test_id" name="many_t...
javascript
github
https://github.com/django/django
js_tests/admin/RelatedObjectLookups.test.js
import io from unittest import mock import pytest from mitmproxy.test import tflow, tutils import mitmproxy.io from mitmproxy import flowfilter from mitmproxy import options from mitmproxy.io import tnetstring from mitmproxy.exceptions import FlowReadException, ReplayException, ControlException from mitmproxy import f...
unknown
codeparrot/codeparrot-clean
from __future__ import generators import unittest # tests for deeply nested try/except/finally's class FinallyTests(unittest.TestCase): def gen1(self): try: pass finally: yield 1 def genContinue(self): for i in range(3): try: continue...
unknown
codeparrot/codeparrot-clean
'use strict' /** * Module dependencies. */ var express = require('../../..'); var fs = require('node:fs'); var path = require('node:path'); module.exports = function(parent, options){ var dir = path.join(__dirname, '..', 'controllers'); var verbose = options.verbose; fs.readdirSync(dir).forEach(function(name...
javascript
github
https://github.com/expressjs/express
examples/mvc/lib/boot.js
""" Copyright 2009-2015 Olivier Belanger This file is part of pyo, a python module to help digital signal processing script creation. pyo 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 o...
unknown
codeparrot/codeparrot-clean
import numpy as np from scipy.stats import norm def measure_from_means(sample_mean, pop_mean, pop_std_dev): """Calculate the value of Cohen's D from the specified means. Keyword arguments: sample_mean -- sample mean pop_mean -- population mean pop_std_dev -- population standard deviation "...
unknown
codeparrot/codeparrot-clean
/* * Copyright (C) 2012 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 agre...
java
github
https://github.com/google/guava
android/guava/src/com/google/common/collect/TreeTraverser.java
<?php namespace Illuminate\Contracts\Container; use Closure; use Psr\Container\ContainerInterface; interface Container extends ContainerInterface { /** * {@inheritdoc} * * @template TClass of object * * @param string|class-string<TClass> $id * @return ($id is class-string<TClass> ...
php
github
https://github.com/laravel/framework
src/Illuminate/Contracts/Container/Container.php
#! /usr/bin/env python """Stupid little script to automate generation of MANIFEST and po/POTFILES.in Really this should have been handled by using distutils, but oh well, distutils is a hoary beast and I can't fault people for not wanting to spend days spelunking around inside it to find the solutions... """ from dist...
unknown
codeparrot/codeparrot-clean
import threading import select import time import utils import global_var as g from xlog import getLogger xlog = getLogger("smart_router") class Buf(object): def __init__(self): self.buf = [] self.size = 0 self.num = 0 def add(self, data): self.buf.append(data) self.s...
unknown
codeparrot/codeparrot-clean
#ifndef RUBY_BACKWARD2_ASSUME_H /*-*-C++-*-vi:se ft=cpp:*/ #define RUBY_BACKWARD2_ASSUME_H /** * @file * @author Ruby developers <ruby-core@ruby-lang.org> * @copyright This file is a part of the programming language Ruby. * Permission is hereby granted, to either...
c
github
https://github.com/ruby/ruby
include/ruby/backward/2/assume.h
#/u/GoldenSights import traceback from dateutil.parser import parse as dateparse import string import datetime import time import praw import sqlite3 import re """ USER CONFIG """ USERAGENT = "" #Describe the bot and what it does. Include your username USERNAME = "GoldenSights" #This is the bot's username PASSWORD = ...
unknown
codeparrot/codeparrot-clean
#!/usr/bin/python APVER='basen sauna 07.10.2015' # for olinuxino # get_conf kasutusse ka mac jaoks # get_ip lisatud ip jalgimiseks, sh tun olemasolu puhul # molemad uniscada.py sisse, mis neid vajavad (votmesonade mac ja ip kontroll!) ##################################################### #### functions ####### def ...
unknown
codeparrot/codeparrot-clean
#ifndef JEMALLOC_INTERNAL_EXTENT_DSS_H #define JEMALLOC_INTERNAL_EXTENT_DSS_H typedef enum { dss_prec_disabled = 0, dss_prec_primary = 1, dss_prec_secondary = 2, dss_prec_limit = 3 } dss_prec_t; #define DSS_PREC_DEFAULT dss_prec_secondary #define DSS_DEFAULT "secondary" extern const char *dss_prec_names[]...
c
github
https://github.com/redis/redis
deps/jemalloc/include/jemalloc/internal/extent_dss.h
# Licensed to the StackStorm, Inc ('StackStorm') 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 th...
unknown
codeparrot/codeparrot-clean
""" XX. Proxy model inheritance Proxy model inheritance across apps can result in syncdb not creating the table for the proxied model (as described in #12286). This test creates two dummy apps and calls syncdb, then verifies that the table has been created. """ import os import sys from django.conf import settings,...
unknown
codeparrot/codeparrot-clean
from oauth2client.client import GoogleCredentials from googleapiclient import discovery from googleapiclient import errors import json class MLEngine: def __init__(self, projectID='cloudml-demo', service='ml', version='v1'): self.projectID = projectID self.service=service self.version=version self.svc = self....
unknown
codeparrot/codeparrot-clean
import re from ..game.structure_utils import StructureBase class ParsignError(Exception): pass class DefinitionNotFoundError(ParsignError): pass def hex_format(num, digits=2): return ('{0:0>' + str(digits) + '}').format(hex(num)[2::]) class CParser: @staticmethod def get_custom_initialization_p...
unknown
codeparrot/codeparrot-clean
/* Global table styles */ @use '@angular/material' as mat; @use './typography'; table[mat-table], table.ng-table { width: 100%; tr { th { @extend %body-bold-01; margin: 0; } td { @extend %body-01; } } } table[mat-table] { @include mat.table-overrides( ( row-item-l...
unknown
github
https://github.com/angular/angular
devtools/projects/ng-devtools/src/styles/_tables.scss
from django import forms from django.test import TestCase from django.core.exceptions import NON_FIELD_ERRORS from modeltests.validation import ValidationTestCase from modeltests.validation.models import Author, Article, ModelToValidate # Import other tests for this package. from modeltests.validation.validators impor...
unknown
codeparrot/codeparrot-clean
// Copyright 2023 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. // Generated from: // // GOARCH=ppc64 go tool cgo -godefs defs_openbsd.go // // Then converted to the form used by the runtime. package runtime import "unsa...
go
github
https://github.com/golang/go
src/runtime/defs_openbsd_ppc64.go
# Copyright 2015 Mirantis 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 applicable law or a...
unknown
codeparrot/codeparrot-clean
import json from httpretty import HTTPretty from social.p3 import urlencode from social.tests.backends.oauth import OAuth1Test class BitbucketOAuth1Test(OAuth1Test): backend_path = 'social.backends.bitbucket.BitbucketOAuth' user_data_url = 'https://bitbucket.org/api/1.0/users/foo@bar.com' expected_usernam...
unknown
codeparrot/codeparrot-clean
@import "@sass/abstracts/vars"; .indent { margin: 0 $extralarge-margin; } .indent-top { margin-top: $middle-margin; } .indent-bottom { margin-bottom: $middle-margin; }
unknown
github
https://github.com/vercel/next.js
examples/cms-sitecore-xmcloud/src/assets/sass/components/spacing/_indent.scss
# 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 writin...
unknown
codeparrot/codeparrot-clean
/* contrib/sslinfo/sslinfo--1.2.sql */ -- complain if script is sourced in psql, rather than via CREATE EXTENSION \echo Use "CREATE EXTENSION sslinfo" to load this file. \quit CREATE FUNCTION ssl_client_serial() RETURNS numeric AS 'MODULE_PATHNAME', 'ssl_client_serial' LANGUAGE C STRICT PARALLEL RESTRICTED; CREATE F...
sql
github
https://github.com/postgres/postgres
contrib/sslinfo/sslinfo--1.2.sql
# A binary morphology add-on for the Python Imaging Library # # History: # 2014-06-04 Initial version. # # Copyright (c) 2014 Dov Grobgeld <dov.grobgeld@gmail.com> from __future__ import print_function from . import Image, _imagingmorph import re LUT_SIZE = 1 << 9 class LutBuilder(object): """A class for buil...
unknown
codeparrot/codeparrot-clean
# Copyright 2018 The HuggingFace Inc. team. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed ...
python
github
https://github.com/huggingface/transformers
src/transformers/models/fsmt/convert_fsmt_original_pytorch_checkpoint_to_pytorch.py
""" Django settings for api project. Generated by 'django-admin startproject' using Django 1.9.7. For more information on this file, see https://docs.djangoproject.com/en/1.9/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.9/ref/settings/ """ import os # Bui...
unknown
codeparrot/codeparrot-clean
# -*- coding: utf-8 -*- ############################################################################## # # Author: Nicolas Bessi # Copyright 2014 Camptocamp SA # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as # publi...
unknown
codeparrot/codeparrot-clean
// run // 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. // Test the 'for range' construct. package main // test range over channels func gen(c chan int, lo, hi int) { for i := lo; i <= hi; i++ { c <- i ...
go
github
https://github.com/golang/go
test/range.go