code
stringlengths
1
25.8M
language
stringclasses
18 values
source
stringclasses
4 values
repo
stringclasses
78 values
path
stringlengths
0
268
from __future__ import annotations import sys from typing import Iterator from pathlib import Path import rich import griffe from rich.text import Text from rich.style import Style def public_members(obj: griffe.Object | griffe.Alias) -> dict[str, griffe.Object | griffe.Alias]: if isinstance(obj, griffe.Alias): ...
python
github
https://github.com/openai/openai-python
scripts/detect-breaking-changes.py
# Mantid Repository : https://github.com/mantidproject/mantid # # Copyright © 2018 ISIS Rutherford Appleton Laboratory UKRI, # NScD Oak Ridge National Laboratory, European Spallation Source, # Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS # SPDX - License - Identifier: GPL - 3.0 + impo...
unknown
codeparrot/codeparrot-clean
# coding: utf-8 from __future__ import unicode_literals from .common import InfoExtractor from ..utils import ( determine_ext, int_or_none, parse_iso8601, ) class HeiseIE(InfoExtractor): _VALID_URL = r'''(?x) https?://(?:www\.)?heise\.de/video/artikel/ .+?(?P<id>[0-9]+)\.html(?:$|[?#])...
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
""" FilterSpec encapsulates the logic for displaying filters in the Django admin. Filters are specified in models with the "list_filter" option. Each filter subclass knows how to display a filter for a field that passes a certain test -- e.g. being a DateField or ForeignKey. """ from django.db import models from djan...
unknown
codeparrot/codeparrot-clean
from nose import SkipTest from nose.tools import assert_raises, assert_true, assert_equal import networkx as nx from networkx.generators.classic import barbell_graph,cycle_graph,path_graph class TestConvertNumpy(object): numpy=1 # nosetests attribute, use nosetests -a 'not numpy' to skip test @classmethod ...
unknown
codeparrot/codeparrot-clean
"Test posix functions" from test import support # Skip these tests if there is no posix module. posix = support.import_module('posix') import errno import sys import time import os import pwd import shutil import stat import tempfile import unittest import warnings _DUMMY_SYMLINK = os.path.join(tempfile.gettempdir(...
unknown
codeparrot/codeparrot-clean
from __future__ import (absolute_import, division, print_function) __metaclass__ = type from ansible.plugins.action import ActionBase import linchpin.MockUtils.MockUtils as mock_utils class ActionModule(ActionBase): def run(self, tmp=None, task_vars=None): """ Simple action plugin that returns the...
unknown
codeparrot/codeparrot-clean
name: Ubuntu on: push: paths-ignore: - 'doc/**' - '**/man/*' - '**.md' - '**.rdoc' - '**/.document' - '.*.yml' pull_request: # Do not use paths-ignore for required status checks # https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/collaborating-...
unknown
github
https://github.com/ruby/ruby
.github/workflows/ubuntu.yml
# -*- 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
"""Generate CODEOWNERS.""" from typing import Dict from .model import Config, Integration BASE = """ # This file is generated by script/hassfest/codeowners.py # People marked here will be automatically requested for a review # when the code that they own is touched. # https://github.com/blog/2392-introducing-code-own...
unknown
codeparrot/codeparrot-clean
# -*- coding: utf-8 -*- # ------------------------------------------------------------------------------ # cloudscaper+alfa_assistant # ------------------------------------------------------------------------------ import sys PY3 = False if sys.version_info[0] >= 3: PY3 = True; unicode = str; unichr = chr; long = int ...
unknown
codeparrot/codeparrot-clean
# Copyright 2019 Fortinet, Inc. # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the...
unknown
codeparrot/codeparrot-clean
# Copyright 2015 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
unknown
codeparrot/codeparrot-clean
# Copyright (c) 2012 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. import filecmp import gyp.common import gyp.xcodeproj_file import errno import os import sys import posixpath import re import shutil import subprocess import temp...
unknown
codeparrot/codeparrot-clean
/* * jcmaster.h * * This file was part of the Independent JPEG Group's software: * Copyright (C) 1991-1995, Thomas G. Lane. * libjpeg-turbo Modifications: * Copyright (C) 2016, D. R. Commander. * For conditions of distribution and use, see the accompanying README.ijg * file. * * This file contains master cont...
c
github
https://github.com/opencv/opencv
3rdparty/libjpeg-turbo/src/jcmaster.h
# 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...
python
github
https://github.com/apache/airflow
airflow-ctl-tests/tests/airflowctl_tests/__init__.py
# Lint as: python3 # Copyright 2020 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless ...
unknown
codeparrot/codeparrot-clean
# Copyright 2016 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
unknown
codeparrot/codeparrot-clean
"Test the functionality of Python classes implementing operators." import unittest from test import test_support testmeths = [ # Binary operations "add", "radd", "sub", "rsub", "mul", "rmul", "div", "rdiv", "mod", "rmod", "divmod", "rdivmod", "pow", "rpow", ...
unknown
codeparrot/codeparrot-clean
"""Support for interacting with Smappee Comport Plugs.""" import logging from homeassistant.components.switch import SwitchDevice from . import DATA_SMAPPEE _LOGGER = logging.getLogger(__name__) ICON = "mdi:power-plug" def setup_platform(hass, config, add_entities, discovery_info=None): """Set up the Smappee C...
unknown
codeparrot/codeparrot-clean
#-*- coding: utf-8 -*- """ Group Configuration Tests. """ from __future__ import absolute_import import json from operator import itemgetter import ddt import six from mock import patch from six.moves import range from contentstore.course_group_config import CONTENT_GROUP_CONFIGURATION_NAME, ENROLLMENT_SCHEME, Grou...
unknown
codeparrot/codeparrot-clean
"""Various tests on satisfiability using dimacs cnf file syntax You can find lots of cnf files in ftp://dimacs.rutgers.edu/pub/challenge/satisfiability/benchmarks/cnf/ """ from sympy.logic.utilities.dimacs import load from sympy.logic.algorithms.dpll import dpll_satisfiable from sympy.utilities.pytest import skip def...
unknown
codeparrot/codeparrot-clean
// Code generated by "stringer -type phaseState"; DO NOT EDIT. package terraform import "strconv" func _() { // An "invalid array index" compiler error signifies that the constant values have changed. // Re-run the stringer command to generate them again. var x [1]struct{} _ = x[workingState-0] _ = x[refreshSta...
go
github
https://github.com/hashicorp/terraform
internal/terraform/phasestate_string.go
# # 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/always/test_secrets.py
import mimetypes from random import randint from cogs.utils.dataIO import dataIO quick = [('shrug', '¯\_(ツ)_/¯'), ('flip', '(╯°□°)╯︵ ┻━┻'), ('unflip', '┬─┬ ノ( ゜-゜ノ)'), ('lenny', '( ͡° ͜ʖ ͡°)'), ('comeatmebro', '(ง’̀-‘́)ง')] # Quick cmds for da memes def quickcmds(message): for i in quick: if message == i...
unknown
codeparrot/codeparrot-clean
// // packaged_task.hpp // ~~~~~~~~~~~~~~~~~ // // Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com) // // 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) // #ifndef BOOST_ASIO_PACKAGED_TASK_...
unknown
github
https://github.com/mysql/mysql-server
extra/boost/boost_1_87_0/boost/asio/packaged_task.hpp
- name: Testing end_play with multiple plays with strategy {{ test_strategy | default('linear') }} hosts: testhost gather_facts: no strategy: "{{ test_strategy | default('linear') }}" tasks: - debug: msg: "Play 1" - meta: end_play - fail: msg: 'Failed to end using end_play' - name: ...
unknown
github
https://github.com/ansible/ansible
test/integration/targets/meta_tasks/test_end_play_multiple_plays.yml
#!/usr/bin/python # # Copyright (c) 2016 Matt Davis, <mdavis@ansible.com> # Chris Houseknecht, <house@redhat.com> # # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type ANSI...
unknown
codeparrot/codeparrot-clean
""" Static file finders for Django. https://docs.djangoproject.com/en/1.8/ref/settings/#std:setting-STATICFILES_FINDERS Yes, this interface is private and undocumented, but we need to access it anyway. In order to deploy Open edX in production, it's important to be able to collect and process static assets: images, CS...
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/metrics2/MetricsSource.java
# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) %YAML 1.2 --- $id: http://devicetree.org/schemas/mfd/atmel,hlcdc.yaml# $schema: http://devicetree.org/meta-schemas/core.yaml# title: Atmel's HLCD Controller maintainers: - Nicolas Ferre <nicolas.ferre@microchip.com> - Alexandre Belloni <alexandre.belloni@bootli...
unknown
github
https://github.com/torvalds/linux
Documentation/devicetree/bindings/mfd/atmel,hlcdc.yaml
# configobj.py # A config file reader/writer that supports nested sections in config files. # Copyright (C) 2005-2010 Michael Foord, Nicola Larosa # E-mail: fuzzyman AT voidspace DOT org DOT uk # nico AT tekNico DOT net # ConfigObj 4 # http://www.voidspace.org.uk/python/configobj.html # Released subject to th...
unknown
codeparrot/codeparrot-clean
# -*- coding: utf-8 -*- """ *************************************************************************** PointsDisplacement.py --------------------- Date : July 2013 Copyright : (C) 2013 by Alexander Bruy Email : alexander dot bruy at gmail dot com *********...
unknown
codeparrot/codeparrot-clean
# coding: utf-8 from django import forms from django.contrib.auth.models import User from django.utils.translation import ugettext_lazy as _ from django.core.validators import RegexValidator my_validator = RegexValidator( r"^[a-z\-]+\.[a-z\-]+.[0-9]+@ens.etsmtl.ca$", u"Votre email doit être du style prenom.no...
unknown
codeparrot/codeparrot-clean
#pragma once #include <c10/macros/Export.h> namespace torch::verbose { TORCH_API int _mkl_set_verbose(int enable); TORCH_API int _mkldnn_set_verbose(int level); } // namespace torch::verbose
c
github
https://github.com/pytorch/pytorch
aten/src/ATen/native/verbose_wrapper.h
#!/usr/bin/env python3 import os, subprocess, sys, hashlib, argparse, shutil def mkdir_p(path): if not os.path.exists(path): os.makedirs(path) def msg(text, level = 3): sys.stdout.write(('#' * level) + ' ' + text + '\n') def error(text): sys.stderr.write('!!!!!! ' + text + '\n') def hashfile_blk(afile, hasher,...
unknown
codeparrot/codeparrot-clean
#!/usr/bin/env python # -*- coding: Utf-8 -*- # # WIRELESS ACCESS POINT FUCKER # Interactive, Multifunction, Destruction Mode Included # # Thanks to BackTrack crew, especially ShamanVirtuel and ASPJ # # USAGE: Launch the script as root using "python AP-Fucker.py", follow instructions, enjoy! # Prerequisites: Have mdk3 ...
unknown
codeparrot/codeparrot-clean
#!/usr/bin/env python # # Copyright (c) 2015 Intel Corporation. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # * Redistributions of works must retain the original copyright notice, this # list of conditions and t...
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/serialization/LongDeserializer.java
from __future__ import division, absolute_import, print_function from .info import __doc__ from numpy.version import version as __version__ # disables OpenBLAS affinity setting of the main thread that limits # python threads or processes to one core import os env_added = [] for envkey in ['OPENBLAS_MAIN_FREE', 'GOTOB...
unknown
codeparrot/codeparrot-clean
// Copyright IBM Corp. 2016, 2025 // SPDX-License-Identifier: BUSL-1.1 package pki import ( "context" "crypto/rand" "crypto/x509" "crypto/x509/pkix" "encoding/asn1" "encoding/base64" "encoding/hex" "encoding/pem" "errors" "fmt" "math/big" "net/http" "strconv" "strings" "time" "github.com/hashicorp/go...
go
github
https://github.com/hashicorp/vault
builtin/logical/pki/path_resign_crls.go
#ifndef Py_CPYTHON_COMPILE_H # error "this header file must not be included directly" #endif /* Public interface */ #define PyCF_MASK (CO_FUTURE_DIVISION | CO_FUTURE_ABSOLUTE_IMPORT | \ CO_FUTURE_WITH_STATEMENT | CO_FUTURE_PRINT_FUNCTION | \ CO_FUTURE_UNICODE_LITERALS | CO_FUTURE...
c
github
https://github.com/python/cpython
Include/cpython/compile.h
# Copyright (c) 2011 The Chromium Embedded Framework 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 cef_parser import * def make_gypi_file(header): # header string result = \ """# Copyright (c) $YEAR$ The Chromium Embedd...
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/io/serializer/SerializationFactory.java
# Licensed to the Software Freedom Conservancy (SFC) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The SFC licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not...
unknown
codeparrot/codeparrot-clean
""" Face of a triangle mesh. """ from __future__ import absolute_import #Init has to be imported first because it has code to workaround the python bug where relative imports don't work if the module is imported as a main module. import __init__ from fabmetheus_utilities.geometry.geometry_tools import dictionary fro...
unknown
codeparrot/codeparrot-clean
#-*- coding: utf-8 -*- from naoqi import ALProxy import time import argparse # 命令行参数解析 """ moveToward()函数用法示例 void ALMotionProxy::moveToward(const float& x, const float& y, const float& theta) 控制机器人以给定的速率移动(归一化的单位,并非m/s,与moveToward()的区别),参考系w为FRAME_ROBOT;非阻塞函数。 参数x, X轴的速率(+1表示正方向的最大速率, -1为反方向)。向X轴负方向则使用负速率。 参数y, Y...
unknown
codeparrot/codeparrot-clean
from PIL import Image length = 128 width = 128 def init_pixel_data(pixel_data, length, width, color = (0,0,0)): for i in xrange(length): for j in xrange(width): # img.putpixel((i, j), ) pixel_data.append( color ) def draw_line(x1, x2, y1, y2, width, pixel_data): dx = x2 - x1 dy = y2 - y1 ux = 1 if x2 >...
unknown
codeparrot/codeparrot-clean
# -*- coding: utf-8 -*- """Doctest for method/function calls. We're going the use these types for extra testing >>> from UserList import UserList >>> from UserDict import UserDict We're defining four helper functions >>> def e(a,b): ... print a, b >>> def f(*a, **k): ... print a, t...
unknown
codeparrot/codeparrot-clean
import sys from scipy.stats.stats import pearsonr import matplotlib from matplotlib.backends.backend_agg import FigureCanvasAgg as FigureCanvas from matplotlib.figure import Figure import matplotlib.mlab as mlab def main(f): fh = open(f, 'r') zic1_expression = [] other_expression = {} for line in fh: ...
unknown
codeparrot/codeparrot-clean
"""Draws DAG in ASCII. Adapted from https://github.com/iterative/dvc/blob/main/dvc/dagascii.py. """ from __future__ import annotations import math import os from typing import TYPE_CHECKING, Any try: from grandalf.graphs import Edge, Graph, Vertex # type: ignore[import-untyped] from grandalf.layouts import...
python
github
https://github.com/langchain-ai/langchain
libs/core/langchain_core/runnables/graph_ascii.py
"""Miscellaneous utility functions and classes specific to ansible cli tools.""" from __future__ import (absolute_import, division, print_function) __metaclass__ = type import json import os from . import types as t from .constants import ( SOFT_RLIMIT_NOFILE, ) from .util import ( common_environment, d...
unknown
codeparrot/codeparrot-clean
""" DE-specific Form helpers """ from django.forms import ValidationError from django.forms.fields import Field, RegexField, Select, EMPTY_VALUES from django.utils.translation import ugettext_lazy as _ import re id_re = re.compile(r"^(?P<residence>\d{10})(?P<origin>\w{1,3})[-\ ]?(?P<birthday>\d{7})[-\ ]?(?P<validity>...
unknown
codeparrot/codeparrot-clean
#!/usr/bin/env python """ Which - locate a command * adapted from Brian Curtin's http://bugs.python.org/file15381/shutil_which.patch * see http://bugs.python.org/issue444582 * uses ``PATHEXT`` on Windows * searches current directory before ``PATH`` on Windows, but not before an explicitly passed ...
unknown
codeparrot/codeparrot-clean
__author__ = 'penny' ''' Use gaussian density kernel estimation to smooth catalogue points into a continuous function, and apply it as the input for isosurface. ''' import sys import numpy as np from scipy import stats from mayavi import mlab import pyfits from vispy import app, scene fitsfile = pyfits.open('cloud_cat...
unknown
codeparrot/codeparrot-clean
"""Utility functions for HTTP header value parsing and construction. Copyright 1997-1998, Gisle Aas Copyright 2002-2006, John J. Lee This code is free software; you can redistribute it and/or modify it under the terms of the BSD or ZPL 2.1 licenses (see the file COPYING.txt included with the distribution). """ impo...
unknown
codeparrot/codeparrot-clean
# Copyright (C) 2014 Andrey Antukh <niwi@niwi.be> # Copyright (C) 2014 Jesús Espino <jespinog@gmail.com> # Copyright (C) 2014 David Barragán <bameda@dbarragan.com> # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as # published by the F...
unknown
codeparrot/codeparrot-clean
# (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com> # (c) 2017 Ansible Project # 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 crypt import multiprocessing import random im...
unknown
codeparrot/codeparrot-clean
{"Modules":[{"Key":"","Source":"","Dir":"."},{"Key":"foo","Source":"./foo","Dir":"foo"},{"Key":"foo.bar","Source":"./bar","Dir":"foo/bar"}]}
json
github
https://github.com/hashicorp/terraform
internal/configs/configload/testdata/already-installed-now-invalid/.terraform/modules/modules.json
/* * * Copyright (c) 1998-2002 * John Maddock * * Use, modification and distribution are subject to 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) * */ /* * LOCATION: see http://www.boost.org/libs/regex for documenta...
unknown
github
https://github.com/mysql/mysql-server
extra/boost/boost_1_87_0/boost/regex_fwd.hpp
import os import sys import json import fnmatch TEST_DIR = "/webvtt/" CATEGORIES_FILE = "../categories.json" class Test: def __init__(self, file, name, status, message): self.file = file self.name = name self.status = status self.message = message self.passed = status == 'P...
unknown
codeparrot/codeparrot-clean
#!/usr/bin/env python # Copyright (c) 2012 OpenStack Foundation # 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/LICEN...
unknown
codeparrot/codeparrot-clean
############################################################################## # # OSIS stands for Open Student Information System. It's an application # designed to manage the core business of higher education institutions, # such as universities, faculties, institutes and professional schools. # The core ...
unknown
codeparrot/codeparrot-clean
/* * Copyright (C) Igor Sysoev * Copyright (C) Nginx, Inc. */ #ifndef _NGX_SOLARIS_CONFIG_H_INCLUDED_ #define _NGX_SOLARIS_CONFIG_H_INCLUDED_ #ifndef _REENTRANT #define _REENTRANT #endif #define _FILE_OFFSET_BITS 64 /* must be before <sys/types.h> */ #include <sys/types.h> #include <sys/time.h> #include <unis...
c
github
https://github.com/nginx/nginx
src/os/unix/ngx_solaris_config.h
import hashlib import os import pathlib import shutil import tarfile import toml import typer import yaml from buildscripts.util.expansions import get_expansion RULE_ROOT = str(pathlib.Path(__file__).parents[1]) file_name = "bazel_rules_mongo.tar.gz" sha256_file_name = f"{file_name}.sha256" release_file_name = f"re...
python
github
https://github.com/mongodb/mongo
buildscripts/bazel_rules_mongo/scripts/package_mongo_rules.py
""" ID-specific Form helpers """ from __future__ import absolute_import, unicode_literals import re import time from django.core.validators import EMPTY_VALUES from django.forms import ValidationError from django.forms.fields import Field, Select from django.utils.translation import ugettext_lazy as _ from django.ut...
unknown
codeparrot/codeparrot-clean
# Copyright (c) 2014 Amazon.com, Inc. or its affiliates. All Rights Reserved # # 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 t...
unknown
codeparrot/codeparrot-clean
#!/usr/bin/env python '''Test that an empty document doesn't break, even when its (nonexistent) text is set to bold. ''' __docformat__ = 'restructuredtext' __noninteractive = True import unittest from pyglet import gl from pyglet import graphics from pyglet.text import document from pyglet.text import layout from ...
unknown
codeparrot/codeparrot-clean
# Licensed to the Software Freedom Conservancy (SFC) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The SFC licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not...
unknown
codeparrot/codeparrot-clean
//go:build linux /* Copyright 2014 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 applicable law or agre...
go
github
https://github.com/kubernetes/kubernetes
cmd/kube-proxy/app/server_linux.go
// Copyright 2021 The Cockroach Authors. // // Use of this software is governed by the CockroachDB Software License // included in the /LICENSE file. package jobs import ( "context" "github.com/cockroachdb/cockroach/pkg/jobs/jobspb" "github.com/cockroachdb/cockroach/pkg/sql/isql" "github.com/cockroachdb/cockroac...
go
github
https://github.com/cockroachdb/cockroach
pkg/jobs/test_helpers.go
class CsvFile(object): def __init__(self, name): self.name = name self.data = [] self.columns = [] def __str__(self): return self.name def empty(self): self.data = [] def fill(self): import csv self.data = csv.reader(open(self.name)) self...
unknown
codeparrot/codeparrot-clean
# frozen_string_literal: true require_relative "../helper" class Arel::Nodes::UpdateStatementTest < Arel::Spec describe "#clone" do it "clones wheres and values" do statement = Arel::Nodes::UpdateStatement.new statement.wheres = %w[a b c] statement.values = %w[x y z] dolly = statement.c...
ruby
github
https://github.com/rails/rails
activerecord/test/cases/arel/nodes/update_statement_test.rb
//===--- ClangSyntaxPrinter.cpp - Printer for C and C++ code ----*- C++ -*-===// // // This source file is part of the Swift.org open source project // // Copyright (c) 2014 - 2022 Apple Inc. and the Swift project authors // Licensed under Apache License v2.0 with Runtime Library Exception // // See https://swift.org/L...
cpp
github
https://github.com/apple/swift
lib/PrintAsClang/ClangSyntaxPrinter.cpp
"""SCons.Tool.PharLapCommon This module contains common code used by all Tools for the Phar Lap ETS tool chain. Right now, this is linkloc and 386asm. """ # # Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtai...
unknown
codeparrot/codeparrot-clean
--- mapped_pages: - https://www.elastic.co/guide/en/elasticsearch/reference/current/sql-functions-math.html --- # Mathematical functions [sql-functions-math] All math and trigonometric functions require their input (where applicable) to be numeric. ## Generic [sql-functions-math-generic] ## `ABS` [sql-functions-m...
unknown
github
https://github.com/elastic/elasticsearch
docs/reference/query-languages/sql/sql-functions-math.md
//===-- URITests.cpp ---------------------------------*- C++ -*-----------===// // // 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/clangd/unittests/URITests.cpp
name: Release on: release: types: [published] jobs: release: permissions: contents: write id-token: write environment: release runs-on: ubuntu-latest steps: - uses: actions/checkout@v6 - name: Set up Ruby uses: ruby/setup-ruby@v1 with: ruby-version: r...
unknown
github
https://github.com/rails/rails
.github/workflows/release.yml
#!/usr/bin/python # Copyright (c) 2009 Las Cumbres Observatory (www.lcogt.net) # Copyright (c) 2010 Jan Dittberner # # 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, inclu...
unknown
codeparrot/codeparrot-clean
## Input ```javascript function Component(props) { let x = makeObject(); x.foo((x = makeObject())); return x; } ``` ## Code ```javascript import { c as _c } from "react/compiler-runtime"; function Component(props) { const $ = _c(1); let x; if ($[0] === Symbol.for("react.memo_cache_sentinel")) { x = ...
unknown
github
https://github.com/facebook/react
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/call-args-assignment.expect.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/main/java/org/apache/kafka/clients/MetadataSnapshot.java
<!--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/en/model_doc/mpt.md
from selenium.webdriver.common.by import By from selenium.webdriver.common.keys import Keys from selenium.webdriver.support.ui import Select from selenium.common.exceptions import NoSuchElementException from test.testmodeltestcase import TestModelTestCase as Super import unittest, time, re from imuser import TemporaryU...
unknown
codeparrot/codeparrot-clean
# -*- coding: utf-8 -*- from south.utils import datetime_utils as datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding field 'Article.created_at' db.add_column(u'detective_article', 'c...
unknown
codeparrot/codeparrot-clean
# $Id: mod_recvfrom.py 3259 2010-08-09 07:31:34Z nanang $ import imp import sys import inc_sip as sip import inc_const as const import re from inc_cfg import * # Read configuration cfg_file = imp.load_source("cfg_file", ARGS[1]) # Default server port (should we randomize?) srv_port = 50070 def test_func(test): pjsu...
unknown
codeparrot/codeparrot-clean
import tensorflow as tf from tensorflow.python.framework.graph_util import convert_variables_to_constants from dataset import read_dataset, Dataset from util import to_one_hot, print_acc, suffle_dataset, from_one_hot from consts import * def create_computation_graph(x): weights = { 'h1': tf.Variable(tf.ran...
unknown
codeparrot/codeparrot-clean
import datetime from . import * check = Method("check") # checks arguments are correct type and in range only. def month_number_from_arg(month, error): try: month_number = Months.options[month] except KeyError: error( "Months should be e.g. Jan/January or numbers " "in...
unknown
codeparrot/codeparrot-clean
#!/usr/bin/env python # testing/runner.py # Copyright (C) 2005-2014 the SQLAlchemy authors and contributors <see AUTHORS file> # # This module is part of SQLAlchemy and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php """ Nose test runner module. This script is a front-end to "no...
unknown
codeparrot/codeparrot-clean
#!/usr/bin/env python # Copyright 2014 the V8 project authors. 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
/////////////////////////////////////////////////////////////////////////// // // Copyright (c) 2002, Industrial Light & Magic, a division of Lucas // Digital Ltd. LLC // // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the fol...
c
github
https://github.com/opencv/opencv
3rdparty/openexr/IlmImf/ImfXdr.h
#!/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
from __future__ import unicode_literals import random import string import logging import json import urllib import urllib2 import os import sys import subprocess # import tornado.web # import tornado.websocket # import tornado.ioloop # from mopidy import config # from mopidy import ext # from mopidy.core import CoreLi...
unknown
codeparrot/codeparrot-clean
#!/usr/bin/env python2.7 # -*- coding: utf-8 -*- from math import floor, ceil def swap(collection, index1, index2): """ Swaps the value of the item at index1 in the collection with the value of index2 in the collection. """ n = len(collection) # if we're reaching outside of bounds, throw an e...
unknown
codeparrot/codeparrot-clean
#!/usr/bin/python # Script that compiles a set of resources into a single C++ source file. The C++ file # offers an initResources() function, which registers the resources with the resource # manager (class ResourceMgr) # # Copyright (C) 1997-2015 by Dimitri van Heesch. # # Permission to use, copy, modify, and distribu...
unknown
codeparrot/codeparrot-clean
#!/usr/bin/env python # -*- coding: utf-8 -*- ''' Author: Corentin Arnaud Module: Cost Description: Class to calcul reward ''' import numpy as np from Cost import Cost class CostCMAESNoPer(Cost): def __init__(self, rs): self.rs=rs def computeFinalReward(self, arm, t, coordHand, sizeOfTarget): ...
unknown
codeparrot/codeparrot-clean
from __future__ import annotations from typing import Any, List, Tuple, Union, Mapping, TypeVar from urllib.parse import parse_qs, urlencode from typing_extensions import Literal, get_args from ._types import NotGiven, not_given from ._utils import flatten _T = TypeVar("_T") ArrayFormat = Literal["comma", "repeat",...
python
github
https://github.com/openai/openai-python
src/openai/_qs.py
// Targets the Cortex-M3 processor (ARMv7-M) use crate::spec::{Abi, Arch, FloatAbi, Os, Target, TargetMetadata, TargetOptions, base, cvs}; pub(crate) fn target() -> Target { Target { llvm_target: "thumbv7m-none-eabi".into(), metadata: TargetMetadata { description: None, tie...
rust
github
https://github.com/rust-lang/rust
compiler/rustc_target/src/spec/targets/thumbv7m_nuttx_eabi.rs
# Volatility # Copyright (C) 2007-2013 Volatility Foundation # Copyright (c) 2010, 2011, 2012 Michael Ligh <michael.ligh@mnin.org> # # This file is part of Volatility. # # Volatility 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...
unknown
codeparrot/codeparrot-clean
prelude: | long_lived = [] if RUBY_VERSION > "2.2.0" 3.times{ GC.start(full_mark: false, immediate_mark: true, immediate_sweep: true) } elsif GC.start end short_lived = '' benchmark: vm_gc_wb_ary_promoted: | long_lived[0] = short_lived # write barrier loop_count: 30000000
unknown
github
https://github.com/ruby/ruby
benchmark/vm_gc_wb_ary_promoted.yml