code stringlengths 1 25.8M | language stringclasses 18
values | source stringclasses 4
values | repo stringclasses 78
values | path stringlengths 0 268 |
|---|---|---|---|---|
#coding=utf-8
from uliweb.orm import *
from uliweb.utils.common import get_var
import datetime
def get_modified_user():
from uliweb import request
if request and request.user and request.user.id:
return request.user.id
else:
return None
class Workflow(Model):
"""
工作流实例表
"""
... | 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 | buildpack/spring-boot-buildpack-platform/src/test/java/org/springframework/boot/buildpack/platform/io/ContentTests.java |
"""
Support for a generic MQTT vacuum.
For more details about this platform, please refer to the documentation
https://home-assistant.io/components/vacuum.mqtt/
"""
import asyncio
import logging
import voluptuous as vol
from homeassistant.components import mqtt
from homeassistant.components.mqtt import MqttAvailabil... | unknown | codeparrot/codeparrot-clean | ||
import pytest
import struct
from functools import partial
from ..validators import validate_response_mbap
from umodbus.client.serial import rtu
from umodbus.client.serial.redundancy_check import (get_crc, validate_crc,
add_crc, CRCError)
def test_no_response_for_re... | unknown | codeparrot/codeparrot-clean | ||
import discord
from discord.ext import commands
import random
description = '''An example bot to showcase the discord.ext.commands extension
module.
There are a number of utility commands being showcased here.'''
bot = commands.Bot(command_prefix='?', description=description)
@bot.event
async def on_ready():
pri... | unknown | codeparrot/codeparrot-clean | ||
use rustc_hir::attrs::{CollapseMacroDebuginfo, MacroUseArgs};
use rustc_session::lint::builtin::INVALID_MACRO_EXPORT_ARGUMENTS;
use super::prelude::*;
pub(crate) struct MacroEscapeParser;
impl<S: Stage> NoArgsAttributeParser<S> for MacroEscapeParser {
const PATH: &[Symbol] = &[sym::macro_escape];
const ON_DUP... | rust | github | https://github.com/rust-lang/rust | compiler/rustc_attr_parsing/src/attributes/macro_attrs.rs |
html {
font-size: 62.5%;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
margin-bottom: 0px;
height: auto !important;
}
body {
@include opensans-font-stack();
position: relative;
overflow: auto;
color: $text-basic;
font-size: 16px;
line-height: 1.5;
background: $page-bg... | unknown | github | https://github.com/vercel/next.js | examples/cms-sitecore-xmcloud/src/assets/sass/_app.scss |
# 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 2010 OpenStack Foundation
# Copyright 2013 IBM Corp.
#
# Licensed under the Apache License, Version 2... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
"""
pygments.lexers.console
~~~~~~~~~~~~~~~~~~~~~~~
Lexers for misc console output.
:copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
from pygments.lexer import RegexLexer, include, bygroups
from pygments.token i... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
#
# Copyright 2008 The Closure Linter 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
#... | unknown | codeparrot/codeparrot-clean | ||
# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/input/mediatek,pmic-keys.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#
title: MediaTek PMIC Keys
maintainers:
- Chen Zhong <chen.zhong@mediatek.com>
allOf:
- $ref: input.yaml#
description: |
Th... | unknown | github | https://github.com/torvalds/linux | Documentation/devicetree/bindings/input/mediatek,pmic-keys.yaml |
# Registered listeners for event `event1` ordered by descending priority
## Listener 1
- Type: `function`
- Name: `var_dump`
- Priority: `255`
## Listener 2
- Type: `closure`
- Priority: `-1` | unknown | github | https://github.com/symfony/symfony | src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/event_dispatcher_1_event1.md |
######################## BEGIN LICENSE BLOCK ########################
# The Original Code is mozilla.org code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998
# the Initial Developer. All Rights Reserved.
#
# Con... | unknown | codeparrot/codeparrot-clean | ||
/*
* Copyright 2002-present the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required b... | java | github | https://github.com/spring-projects/spring-framework | spring-context-support/src/main/java/org/springframework/cache/jcache/JCacheCache.java |
# Copyright 2014 - Rackspace Hosting
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python | python | github | https://github.com/ansible/ansible | test/integration/targets/ansible-test-sanity-shebang/ansible_collections/ns/col/scripts/env_python.py |
# AS @ KIT 04/2015
# modified JB 04/2016
# modified MP 05/2017 switch from pickle to JSON
# Sample Class to define all values necessary to measure a sample
import json, pickle
import logging
import os, copy
from qkit.measure.json_handler import QkitJSONEncoder, QkitJSONDecoder
from qkit.storage.hdf_DateTimeGenerator ... | unknown | codeparrot/codeparrot-clean | ||
"""
A simple test script to check if all dependencies are installed
"""
print('---- Running Dependencies Test ----')
import time
import traceback
dep = ['PyAudio', 'pocketsphinx', 'SpeechRecognition', 'gTTS',
'pygame', 'WolframAlpha', 'HeyAthena']
passed = True
def test_case(case):
global passed
try... | unknown | codeparrot/codeparrot-clean | ||
@import "component-title"; | unknown | github | https://github.com/vercel/next.js | examples/cms-sitecore-xmcloud/src/assets/sass/components/title/index.scss |
from __future__ import print_function
import time
import subprocess
from .base import Browser, ExecutorBrowser, require_arg
from ..webdriver_server import EdgeDriverServer
from ..executors import executor_kwargs as base_executor_kwargs
from ..executors.executorselenium import (SeleniumTestharnessExecutor, # noqa: F401... | 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 use ... | unknown | codeparrot/codeparrot-clean | ||
// Protocol Buffers - Google's data interchange format
// Copyright 2008 Google Inc. All rights reserved.
// https://developers.google.com/protocol-buffers/
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// ... | c | github | https://github.com/opencv/opencv | 3rdparty/protobuf/src/google/protobuf/stubs/status.h |
// Copyright IBM Corp. 2016, 2025
// SPDX-License-Identifier: BUSL-1.1
package cockroachdb
import (
"context"
"database/sql"
"fmt"
"sync"
"time"
"github.com/hashicorp/go-uuid"
"github.com/hashicorp/vault/sdk/physical"
)
const (
// The lock TTL matches the default that Consul API uses, 15 seconds.
// Used a... | go | github | https://github.com/hashicorp/vault | physical/cockroachdb/cockroachdb_ha.go |
# Glumol - An adventure game creator
# Copyright (C) 1998-2008 Sylvain Baubeau & Alexis Contour
# This file is part of Glumol.
# Glumol 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 th... | unknown | codeparrot/codeparrot-clean | ||
'''
This function function used for training and cross-validating model using. The database is not
included in this repo, please download the CinC Challenge database and truncate/pad data into a
NxM matrix array, being N the number of recordings and M the window accepted by the network (i.e.
30 seconds).
For more inf... | unknown | codeparrot/codeparrot-clean | ||
## Input
```javascript
function foo() {
const {'data-foo-bar': x, a: y, data: z} = {'data-foo-bar': 1, a: 2, data: 3};
return [x, y, z];
}
export const FIXTURE_ENTRYPOINT = {
fn: foo,
params: [],
isComponent: false,
};
```
## Code
```javascript
import { c as _c } from "react/compiler-runtime";
function f... | unknown | github | https://github.com/facebook/react | compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/destructure-mixed-property-key-types.expect.md |
// This file was automatically generated from flow.md by Knit tool. Do not edit.
package kotlinx.coroutines.guide.test
import kotlinx.coroutines.knit.*
import org.junit.Test
class FlowGuideTest {
@Test
fun testExampleFlow01() {
test("ExampleFlow01") { kotlinx.coroutines.guide.exampleFlow01.main() }.ve... | kotlin | github | https://github.com/Kotlin/kotlinx.coroutines | kotlinx-coroutines-core/jvm/test/guide/test/FlowGuideTest.kt |
"""Locations where we look for configs, install stuff, etc"""
# The following comment should be removed at some point in the future.
# mypy: strict-optional=False
from __future__ import absolute_import
import os
import os.path
import platform
import site
import sys
import sysconfig
from distutils import sysconfig as... | unknown | codeparrot/codeparrot-clean | ||
import types
from DIRAC import S_OK, S_ERROR
from DIRAC.Core.Utilities import DEncode, ThreadScheduler
from DIRAC.Core.Security import Properties
from DIRAC.Core.Base.ExecutorMindHandler import ExecutorMindHandler
from DIRAC.WorkloadManagementSystem.Client.JobState.JobState import JobState
from DIRAC.WorkloadManagement... | unknown | codeparrot/codeparrot-clean | ||
# Author: Mathieu Blondel <mathieu@mblondel.org>
# Arnaud Joly <a.joly@ulg.ac.be>
# Maheshakya Wijewardena <maheshakya.10@cse.mrt.ac.lk>
# License: BSD 3 clause
from __future__ import division
import warnings
import numpy as np
import scipy.sparse as sp
from .base import BaseEstimator, ClassifierMixin... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
# Copyright 2017 Dag Wieers <dag@wieers.com>
# Copyright 2017 Swetha Chunduri (@schunduri)
# This file is part of Ansible by Red Hat
#
# 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 Fo... | unknown | codeparrot/codeparrot-clean | ||
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
from frappe.utils import flt
from frappe import msgprint, _
def execute(filters=None):
return _execute(filters)
def _execute(filters=No... | unknown | codeparrot/codeparrot-clean | ||
from axolotl.state.sessionstore import SessionStore
from axolotl.state.sessionrecord import SessionRecord
class LiteSessionStore(SessionStore):
def __init__(self, dbConn):
"""
:type dbConn: Connection
"""
self.dbConn = dbConn
dbConn.execute("CREATE TABLE IF NOT EXISTS session... | unknown | codeparrot/codeparrot-clean | ||
/* this file was generated by Tools/unicode/makeunicodedata.py 3.3 */
#define NAME_MAXLEN 256
/* name->code dictionary */
static const unsigned char packed_name_dawg[] = {
136, 135, 5, 254, 2, 65, 246, 145, 3, 66, 206, 160, 3, 67, 146, 251, 4,
68, 250, 135, 1, 69, 230, 157, 1, 70, 174, 55, 71, 214, 169, 1, 72... | c | github | https://github.com/python/cpython | Modules/unicodename_db.h |
# coding: utf-8
from __future__ import unicode_literals
from .common import InfoExtractor
from ..utils import (
ExtractorError,
parse_iso8601,
)
class DRTVIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?dr\.dk/tv/se/(?:[^/]+/)*(?P<id>[\da-z-]+)(?:[/#?]|$)'
_TEST = {
'url': 'https://www.d... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
# Licensed under a 3-clause BSD style license - see LICENSE.rst
"""Converters for Quantity."""
import threading
import numpy as np
from astropy.units.core import (UnitsError, UnitConversionError, UnitTypeError,
dimensionless_unscaled)
__all__ = ['can_have_arbi... | unknown | codeparrot/codeparrot-clean | ||
#
# cfg_gnu.py - GNU target configurator
#
# Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com)
#
# 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... | unknown | codeparrot/codeparrot-clean | ||
"""
Module that tracks analytics events by sending them to different
configurable backends.
The backends can be configured using Django settings as the example
below::
TRACKING_BACKENDS = {
'tracker_name': {
'ENGINE': 'class.name.for.backend',
'OPTIONS': {
'host': ... ,
... | unknown | codeparrot/codeparrot-clean | ||
"""browsepict - Display all "ICON" resources found"""
import FrameWork
import EasyDialogs
from Carbon import Res
from Carbon import Qd
from Carbon import Win
from Carbon import Controls
from Carbon import List
import sys
import struct
from Carbon import Icn
import macresource
#
# Resource definitions
ID_MAIN=512
MAIN... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/python
import libmsym as msym, numpy as np, argparse, random, sys
def read_xyz(fin):
length = int(fin.readline())
comment = fin.readline()[:-1]
elements = []
for i in range(0,length):
line = fin.readline().split()
elements.append(msym.Element(name = line[0], coordinates = ma... | 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/dtensor/mlir/sparse_expander_common.h |
#!/usr/bin/python
# (c) 2016, NetApp, Inc
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
... | unknown | codeparrot/codeparrot-clean | ||
# Accepting data with input properties
TIP: This guide assumes you've already read the [Essentials Guide](essentials). Read that first if you're new to Angular.
TIP: If you're familiar with other web frameworks, input properties are similar to _props_.
When you use a component, you commonly want to pass some data to... | unknown | github | https://github.com/angular/angular | adev/src/content/guide/components/inputs.md |
"""
=============================
Species distribution modeling
=============================
Modeling species' geographic distributions is an important
problem in conservation biology. In this example, we
model the geographic distribution of two South American
mammals given past observations and 14 environmental
vari... | python | github | https://github.com/scikit-learn/scikit-learn | examples/applications/plot_species_distribution_modeling.py |
##########################################################################
#
# Copyright (c) 2008-2013, Image Engine Design Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redis... | unknown | codeparrot/codeparrot-clean | ||
#define USE_THE_REPOSITORY_VARIABLE
#include "git-compat-util.h"
#include "config.h"
#include "environment.h"
#include "gettext.h"
#include "string-list.h"
#include "run-command.h"
#include "commit.h"
#include "trailer.h"
#include "list.h"
/*
* Copyright (c) 2013, 2014 Christian Couder <chriscool@tuxfamily.org>
*/
... | c | github | https://github.com/git/git | trailer.c |
"""
Testing indexing of the courseware as it is changed
"""
import ddt
import json
from lazy.lazy import lazy
import time
from datetime import datetime
from dateutil.tz import tzutc
from mock import patch, call
from pytz import UTC
from uuid import uuid4
from unittest import skip
from django.conf import settings
from... | unknown | codeparrot/codeparrot-clean | ||
// Copyright (c) HashiCorp, Inc.
// SPDX-License-Identifier: BUSL-1.1
package stackeval
import (
"context"
"fmt"
"github.com/hashicorp/hcl/v2"
"github.com/zclconf/go-cty/cty"
"github.com/zclconf/go-cty/cty/convert"
"github.com/hashicorp/terraform/internal/lang/marks"
"github.com/hashicorp/terraform/internal/... | go | github | https://github.com/hashicorp/terraform | internal/stacks/stackruntime/internal/stackeval/input_variable.go |
#!/usr/bin/env bash
# Make sure that ansible-test is able to parse collection config when using a venv.
set -eu
source ../collection/setup.sh
set -x
# On systems with a Python version below the minimum controller Python version, such as the default container, this test
# will verify that the content config is worki... | unknown | github | https://github.com/ansible/ansible | test/integration/targets/ansible-test-config/runme.sh |
"""This module provides dynamic access to deprecated Zapier tools in LangChain.
It supports backward compatibility by forwarding references such as
`ZapierNLAListActions` and `ZapierNLARunAction` to their updated locations
in the `langchain_community.tools` package.
Developers using older import paths will continue t... | python | github | https://github.com/langchain-ai/langchain | libs/langchain/langchain_classic/tools/zapier/tool.py |
//===--- IDEInspectionCallbacks.h - Parser's interface to IDE inspection --===//
//
// This source file is part of the Swift.org open source project
//
// Copyright (c) 2014 - 2018 Apple Inc. and the Swift project authors
// Licensed under Apache License v2.0 with Runtime Library Exception
//
// See https://swift.org/L... | c | github | https://github.com/apple/swift | include/swift/Parse/IDEInspectionCallbacks.h |
# -*- coding: utf-8 -*-
#
# Copyright 2012-2015 Spotify AB
#
# 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... | unknown | codeparrot/codeparrot-clean | ||
/*
* Copyright 2012-present the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required b... | java | github | https://github.com/spring-projects/spring-boot | core/spring-boot-docker-compose/src/main/java/org/springframework/boot/docker/compose/core/DockerCli.java |
```yaml {applies_to}
serverless: ga
stack: ga
```
The `WHERE` processing command produces a table that contains all the rows from
the input table for which the provided condition evaluates to `true`.
::::{tip}
In case of value exclusions, fields with `null` values will be excluded from search results.
In this context... | unknown | github | https://github.com/elastic/elasticsearch | docs/reference/query-languages/esql/_snippets/commands/layout/where.md |
# -*- coding: utf-8 -*-
'''
Specto Add-on
Copyright (C) 2015 lambda
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 l... | unknown | codeparrot/codeparrot-clean | ||
from coredata.forms import PersonField
from django import forms
from django.core.files.uploadedfile import SimpleUploadedFile
from django.forms.fields import MultipleChoiceField
from django.forms.models import ModelForm
from coredata.models import Person
from coredata.queries import add_person, SIMSProblem
from course... | 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 | ||
/** @import { Effect, EffectNodes, TemplateNode } from '#client' */
import { FILENAME, NAMESPACE_SVG } from '../../../../constants.js';
import {
hydrate_next,
hydrate_node,
hydrating,
set_hydrate_node,
set_hydrating
} from '../hydration.js';
import { create_element, create_text, get_first_child } from '../operatio... | javascript | github | https://github.com/sveltejs/svelte | packages/svelte/src/internal/client/dom/blocks/svelte-element.js |
#!/usr/bin/python
# 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 "Licen... | unknown | codeparrot/codeparrot-clean | ||
#include <cassert>
#include <iostream>
#include <memory>
#include <string>
#include <fbjni/ByteBuffer.h>
#include <fbjni/fbjni.h>
#include <c10/util/irange.h>
#include <torch/csrc/jit/mobile/import.h>
#include <torch/csrc/jit/mobile/module.h>
#include <torch/script.h>
#include "caffe2/serialize/read_adapter_interface... | cpp | github | https://github.com/pytorch/pytorch | android/pytorch_android/src/main/cpp/pytorch_jni_lite.cpp |
// #docplaster
// #docregion
import {Component} from '@angular/core';
import {FormControl, FormGroup, Validators, ReactiveFormsModule} from '@angular/forms';
import {forbiddenNameValidator} from '../shared/forbidden-name.directive';
@Component({
selector: 'app-actor-form-reactive',
templateUrl: './actor-form-react... | typescript | github | https://github.com/angular/angular | adev/src/content/examples/form-validation/src/app/reactive/actor-form-reactive.component.1.ts |
# Copyright 2019 The Magenta 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 to in ... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
address_mode_def = {}
address_mode_def['S_IMPLIED'] = dict(size=1, short='sngl')
address_mode_def['S_IMMEDIATE'] = dict(size=2, short='imm')
address_mode_def['S_IMMEDIATE_WITH_MODIFIER'] = dict(size=2, short='imm')
address_mode_def['S_ACCUMULATOR'] = dict(size=1, short='acc')
address_mode_def['... | unknown | codeparrot/codeparrot-clean | ||
import sys
import os
import logging
import pandas as pd
from glob import glob
def add_pyspark_path():
"""Add PySpark to the library path based on the value of SPARK_HOME. """
try:
spark_home = os.environ['SPARK_HOME']
sys.path.append(os.path.join(spark_home, 'python'))
py4j_src_zip =... | unknown | codeparrot/codeparrot-clean | ||
import pandas
import numpy as np
from statsmodels.tools import data
def test_missing_data_pandas():
"""
Fixes GH: #144
"""
X = np.random.random((10,5))
X[1,2] = np.nan
df = pandas.DataFrame(X)
vals, cnames, rnames = data.interpret_data(df)
np.testing.assert_equal(rnames.tolist(), [0,2,... | unknown | codeparrot/codeparrot-clean | ||
export default function Notes() {
return <div>Notes</div>;
} | javascript | github | https://github.com/remix-run/react-router | examples/notes/src/routes/notes.jsx |
#!/bin/sh
test_description='basic sanity checks for git var'
. ./test-lib.sh
sane_unset_all_editors () {
sane_unset GIT_EDITOR &&
sane_unset VISUAL &&
sane_unset EDITOR
}
test_expect_success 'get GIT_AUTHOR_IDENT' '
test_tick &&
echo "$GIT_AUTHOR_NAME <$GIT_AUTHOR_EMAIL> $GIT_AUTHOR_DATE" >expect &&
git var G... | unknown | github | https://github.com/git/git | t/t0007-git-var.sh |
# Copyright (c) 2015 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 bash
# Copyright 2022 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 applica... | unknown | github | https://github.com/kubernetes/kubernetes | hack/verify-golangci-lint-pr-hints.sh |
#!/usr/bin/python
# 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 distributed... | unknown | codeparrot/codeparrot-clean | ||
import argparse
import os
import sys
from collections import OrderedDict
from distutils.spawn import find_executable
from datetime import timedelta
import config
import wpttest
import formatters
def abs_path(path):
return os.path.abspath(os.path.expanduser(path))
def url_or_path(path):
import urlparse
p... | unknown | codeparrot/codeparrot-clean | ||
from django.forms import ChoiceField, Form, SelectMultiple
from .base import WidgetTest
class SelectMultipleTest(WidgetTest):
widget = SelectMultiple
numeric_choices = (("0", "0"), ("1", "1"), ("2", "2"), ("3", "3"), ("0", "extra"))
def test_format_value(self):
widget = self.widget(choices=self.n... | python | github | https://github.com/django/django | tests/forms_tests/widget_tests/test_selectmultiple.py |
<div class="not-match">
<div></div>
</div>
<div class="match svelte-xyz">
<div class="svelte-xyz"></div>
<div class="svelte-xyz"></div>
</div> | html | github | https://github.com/sveltejs/svelte | packages/svelte/tests/css/samples/general-siblings-combinator-star/expected.html |
# Angular i18n Internationalization Example
This sample comes from the Angular documentation's "[Example Angular Internationalization application](https://angular.dev/guide/i18n/example)" page.
## Install and Run the Download
1. `npm install` the node_module packages
2. `npm start` to see it run in English
3. `npm r... | unknown | github | https://github.com/angular/angular | adev/src/content/examples/i18n/readme.md |
// Copyright 2016 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package main
// int the_answer();
import "C"
import (
"fmt"
"os"
)
func TheAnswer() int {
return int(C.the_answer())
}
func main() {
if a := TheAnswer();... | go | github | https://github.com/golang/go | src/cmd/cgo/internal/testfortran/testdata/testprog/fortran.go |
"""Test for properties for devices common to all entity types."""
from google_nest_sdm.device import Device
from homeassistant.components.nest.device_info import DeviceInfo
def test_device_custom_name():
"""Test a device name from an Info trait."""
device = Device.MakeDevice(
{
"name": "s... | unknown | codeparrot/codeparrot-clean | ||
/*
* Copyright 2010-2025 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.impl.base.projectStructure
import com.intellij.psi.search.GlobalSea... | kotlin | github | https://github.com/JetBrains/kotlin | analysis/analysis-api-impl-base/src/org/jetbrains/kotlin/analysis/api/impl/base/projectStructure/KaResolveExtensionGeneratedFilesScope.kt |
# (c) 2014, James Tanner <tanner.jc@gmail.com>
#
# 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 distributed i... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
#
# Copyright 2009 Facebook
#
# 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 | ||
// Copyright (c) HashiCorp, Inc.
// SPDX-License-Identifier: BUSL-1.1
package renderers
import (
"bytes"
"fmt"
"sort"
"github.com/hashicorp/terraform/internal/command/jsonformat/computed"
"github.com/hashicorp/terraform/internal/plans"
)
var (
_ computed.DiffRenderer = (*blockRenderer)(nil)
importantAttrib... | go | github | https://github.com/hashicorp/terraform | internal/command/jsonformat/computed/renderers/block.go |
# -*- coding: utf-8 -*-
from .jsregexp import Exec
import re
DIGS = set('0123456789')
WHITE = u"\u0009\u000A\u000B\u000C\u000D\u0020\u00A0\u1680\u180E\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF"
def replacement_template(rep, source, span, npar):
"""Takes t... | unknown | codeparrot/codeparrot-clean | ||
WINDOWS_1256_TO_UCS_TBL = [
["A0",0xA0],
["A2",0xA2],
["A3",0xA3],
["A4",0xA4],
["A5",0xA5],
["A6",0xA6],
["A7",0xA7],
["A8",0xA8],
["A9",0xA9],
["AB",0xAB],
["AC",0xAC],
["AD",0xAD],
["AE",0xAE],
["AF",0xAF],
["B0",0xB0],
["B1",0xB1],
["B2",0xB2],
["B3",0xB3],
["B4",0xB4],
["B5"... | ruby | github | https://github.com/ruby/ruby | enc/trans/windows-1256-tbl.rb |
# -*- coding: utf-8 -*-
"""Algorithms for spectral clustering"""
# Author: Gael Varoquaux gael.varoquaux@normalesup.org
# Brian Cheung
# Wei LI <kuantkid@gmail.com>
# License: BSD 3 clause
import warnings
import numpy as np
from ..base import BaseEstimator, ClusterMixin
from ..utils import check_rand... | unknown | codeparrot/codeparrot-clean | ||
"""
Unit tests for the differential global minimization algorithm.
"""
from scipy.optimize import _differentialevolution
from scipy.optimize._differentialevolution import DifferentialEvolutionSolver
from scipy.optimize import differential_evolution
import numpy as np
from scipy.optimize import rosen
from numpy.testing ... | unknown | codeparrot/codeparrot-clean | ||
# Copyright 2013 Viewfinder Inc. All Rights Reserved.
"""Viewfinder base operation.
ViewfinderOperation is the base class for all other Viewfinder operations. It contains code
that is common across at least two derived operations.
"""
__authors__ = ['andy@emailscrubbed.com (Andy Kimball)']
from copy import deepcopy... | unknown | codeparrot/codeparrot-clean | ||
#
# Copyright (C) 2019 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 General Public License v.2, or (at your option) any later version.
# This program is distributed in the hope that it will be... | unknown | codeparrot/codeparrot-clean | ||
// @flow @enableTransitivelyFreezeFunctionExpressions:false @enableNewMutationAliasingModel
import {setPropertyByKey, Stringify} from 'shared-runtime';
/**
* Variation of bug in `bug-aliased-capture-aliased-mutate`.
* Fixed in the new inference model.
*
* Found differences in evaluator results
* Non-forget (expec... | javascript | github | https://github.com/facebook/react | compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/repro-aliased-capture-mutate.js |
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | python | github | https://github.com/apache/airflow | airflow-core/src/airflow/utils/log/non_caching_file_handler.py |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Ansible module to manage Big Monitoring Fabric service chains
# (c) 2016, Ted Elhourani <ted@bigswitch.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 publish... | unknown | codeparrot/codeparrot-clean | ||
import unittest
from kyu7.total_licks import total_licks
class TestTotalClicks(unittest.TestCase):
def test_freezing_temps_260(self):
self.assertEqual('It took 260 licks to get to the tootsie roll center of a tootsie pop. The toughest challenge was freezing temps.',
total_licks({... | unknown | codeparrot/codeparrot-clean | ||
import math
import ahocorasick
import tqdm
from collections import defaultdict
import unicodedata
import os
import pickle
############################################################
# Trie loading and creation
# ja: source, en: target
#
def unsegment(s):
res = []
for w in s.split(" "):
if w.startswit... | unknown | codeparrot/codeparrot-clean | ||
# -*- encoding:ascii -*-
from mako import runtime, filters, cache
UNDEFINED = runtime.UNDEFINED
__M_dict_builtin = dict
__M_locals_builtin = locals
_magic_number = 6
_modified_time = 1417442147.008255
_template_filename='templates/grid_base_async.mako'
_template_uri='grid_base_async.mako'
_template_cache=cache.Cache(__... | unknown | codeparrot/codeparrot-clean | ||
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2011 Cisco Systems, 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... | unknown | codeparrot/codeparrot-clean | ||
# Copyright 2015, Rackspace, US, 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 ... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
# Copyright 2014 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.
"""Run a pinned gsutil."""
import argparse
import base64
import hashlib
import json
import os
import shutil
import subprocess
import s... | unknown | codeparrot/codeparrot-clean | ||
import txrestapi
__package__="txrestapi"
import re
import os.path
import doctest
from six import PY2, b, u
from twisted.internet import reactor
from twisted.internet.defer import inlineCallbacks
from twisted.web.resource import Resource, NoResource
from twisted.web.server import Request, Site
from twisted.web.client im... | unknown | codeparrot/codeparrot-clean | ||
"""Module contains typedefs that are used with `Runnable` objects."""
from __future__ import annotations
from typing import TYPE_CHECKING, Any, Literal
from typing_extensions import NotRequired, TypedDict
if TYPE_CHECKING:
from collections.abc import Sequence
class EventData(TypedDict, total=False):
"""Dat... | python | github | https://github.com/langchain-ai/langchain | libs/core/langchain_core/runnables/schema.py |
# This module contains ``ast.unparse()``, defined here
# to improve the import time for the ``ast`` module.
import sys
from _ast import *
from ast import NodeVisitor
from contextlib import contextmanager, nullcontext
from enum import IntEnum, auto, _simple_enum
# Large float and imaginary literals get turned into infi... | python | github | https://github.com/python/cpython | Lib/_ast_unparse.py |
from urlparse import urlparse
from threading import Thread
import httplib, sys, multiprocessing
from Queue import Queue
import simplejson
import time
import base64
num_processes = int(sys.argv[1])
num_threads = int(sys.argv[2])
num_requests = int(sys.argv[3])
num_metrics_per_request = int(sys.argv[4])
series_name = sy... | unknown | codeparrot/codeparrot-clean | ||
""" generic mechanism for marking and selecting python functions. """
import inspect
class MarkerError(Exception):
"""Error in use of a pytest marker/attribute."""
def pytest_namespace():
return {'mark': MarkGenerator()}
def pytest_addoption(parser):
group = parser.getgroup("general")
group._addopti... | unknown | codeparrot/codeparrot-clean |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.