max_stars_repo_path stringlengths 4 245 | max_stars_repo_name stringlengths 7 115 | max_stars_count int64 101 368k | id stringlengths 2 8 | content stringlengths 6 1.03M |
|---|---|---|---|---|
autox/autox_server/model/lgb_with_fe.py | fanghy06/AutoX | 499 | 12762478 | import warnings
warnings.filterwarnings('ignore')
from autox.autox_server.model import model_util
def lgb_with_fe(G_df_dict, G_data_info, G_hist, is_train, remain_time, params, lgb_para_dict, data_name, exp_name):
remain_time = model_util.lgb_model(G_df_dict['BIG_FE'], G_data_info, G_hist, is_train, remain_time, e... |
machina/apps/forum_member/admin.py | BrendaH/django-machina | 572 | 12762490 | """
Forum member model admin definitions
====================================
This module defines admin classes used to populate the Django administration dashboard.
"""
from django.contrib import admin
from machina.core.db.models import get_model
from machina.models.fields import MarkupTextField, Marku... |
compressai/layers/gdn.py | Conzel/CompressAI | 515 | 12762501 | <reponame>Conzel/CompressAI<filename>compressai/layers/gdn.py
# Copyright (c) 2021-2022, InterDigital Communications, Inc
# All rights reserved.
# Redistribution and use in source and binary forms, with or without
# modification, are permitted (subject to the limitations in the disclaimer
# below) provided that the fo... |
tests/common/test_run/ascend/five2four_run.py | tianjiashuo/akg | 286 | 12762521 | <reponame>tianjiashuo/akg
# Copyright 2019-2021 Huawei Technologies Co., Ltd
#
# 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... |
asv_bench/benchmarks/io/style.py | umangino/pandas | 28,899 | 12762524 | import numpy as np
from pandas import (
DataFrame,
IndexSlice,
)
class Render:
params = [[12, 24, 36], [12, 120]]
param_names = ["cols", "rows"]
def setup(self, cols, rows):
self.df = DataFrame(
np.random.randn(rows, cols),
columns=[f"float_{i+1}" for i in range(... |
third_party/closure_compiler/compiler.py | zealoussnow/chromium | 14,668 | 12762538 | <reponame>zealoussnow/chromium<filename>third_party/closure_compiler/compiler.py
#!/usr/bin/python
# Copyright 2015 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.
"""Runs Closure compiler on JavaScript files to check for ... |
src/main/starlark/builtins_bzl/common/rule_util.bzl | AyuMol758/bazel | 16,989 | 12762541 | <reponame>AyuMol758/bazel
# Copyright 2021 The Bazel 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... |
unit_testing_course/lesson1/task1/task.py | behzod/pycharm-courses | 213 | 12762546 | # TODO: type solution here
|
vlm/data.py | woojeongjin/vokenization | 173 | 12762555 | <gh_stars>100-1000
import copy
import os
import random
import h5py
import torch
from torch.utils.data import DataLoader, Dataset
import tqdm
class CoLDataset(Dataset):
IGNORE_ID = -100
sent_strategy = 'first'
def __init__(self, file_path, tokenizer_name, tokenizer, block_size=512,
split... |
tests/test_query.py | pooya/disco | 786 | 12762560 | <filename>tests/test_query.py<gh_stars>100-1000
from disco.test import TestCase, TestPipe
from disco.compat import bytes_to_str, str_to_bytes
from disco.worker.pipeline.worker import Stage
from disco.worker.task_io import task_input_stream
import csv
from functools import partial
import hashlib
PREFIX='/tmp/'
def rea... |
jactorch/transforms/coor/functional.py | dapatil211/Jacinle | 114 | 12762572 | #! /usr/bin/env python3
# -*- coding: utf-8 -*-
# File : functional.py
# Author : <NAME>
# Email : <EMAIL>
# Date : 03/03/2018
#
# This file is part of Jacinle.
# Distributed under terms of the MIT license.
import math
from PIL import Image
import numpy as np
import torchvision.transforms.functional as TF
impor... |
services/engine/model.py | chrkaatz/BitVision | 1,070 | 12762574 | <reponame>chrkaatz/BitVision
#########
# GLOBALS
#########
from sklearn.linear_model import LogisticRegression
from sklearn.preprocessing import StandardScaler
######
# MAIN
######
class Model(object):
def __init__(self, training_data, hyperopt=False):
self.scaler = StandardScaler()
self.scale... |
graphormer/data/__init__.py | shawnwang-tech/Graphormer | 858 | 12762590 | DATASET_REGISTRY = {}
def register_dataset(name: str):
def register_dataset_func(func):
DATASET_REGISTRY[name] = func()
return register_dataset_func
|
models/kp2uv_model.py | google/retiming | 152 | 12762591 | # Copyright 2020 Google LLC
#
# 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, ... |
extra/cda/cachegen.py | heinsm/qira | 2,056 | 12762592 | #!/usr/bin/env python2.7
import os
import sys
import cda_config
basedir = os.path.dirname(os.path.realpath(__file__))
#sys.path.append(basedir+"/clang/llvm/tools/clang/bindings/python")
import clang.cindex as ci
ci.Config.set_library_file(cda_config.LIBCLANG_PATH)
import pickle
from clang.cindex import CursorKind
im... |
mnist/DecoyMNIST/00_make_data.py | laura-rieger/deep-explanation-penalization | 105 | 12762597 | <reponame>laura-rieger/deep-explanation-penalization
import torch
import torchvision
import torchvision.datasets as datasets
import sys
import numpy as np
import torch.utils.data as utils
from colour import Color
from os.path import join as oj
mnist_trainset = datasets.MNIST(root='../data', train=True, downlo... |
src/debugpy/_vendored/pydevd/tests_python/test_smart_step_into_bytecode.py | r3m0t/debugpy | 695 | 12762639 | <gh_stars>100-1000
import sys
try:
from _pydevd_bundle import pydevd_bytecode_utils
except ImportError:
pass
import pytest
pytestmark = pytest.mark.skipif(sys.version_info[0] < 3, reason='Only available for Python 3.')
@pytest.fixture(autouse=True, scope='function')
def enable_strict():
# In tests enable... |
se3cnn/point/self_interaction.py | mariogeiger/se3cnn | 170 | 12762641 | <filename>se3cnn/point/self_interaction.py
# pylint: disable=arguments-differ, no-member, missing-docstring, invalid-name, line-too-long
from functools import reduce
import torch
from se3cnn.point.kernel import Kernel
from se3cnn.point.radial import ConstantRadialModel
class SortSphericalSignals(torch.nn.Module):
... |
start.py | DennyDai/angr-management | 474 | 12762645 | <filename>start.py
#!/usr/bin/env python3
from angrmanagement.__main__ import main
if __name__ == '__main__':
main()
|
pykeops/torch/kernel_product/__init__.py | mdiazmel/keops | 695 | 12762648 | <reponame>mdiazmel/keops<gh_stars>100-1000
import warnings
warnings.simplefilter("default")
warnings.warn(
"[pyKeOps]: the kernel_product syntax is deprecated. Please consider using the LazyTensor helper instead.",
DeprecationWarning,
)
from .kernels import Kernel, kernel_product, kernel_formulas
from .formul... |
v2/backend/blog/models/category.py | jonfairbanks/rtsp-nvr | 558 | 12762652 | <filename>v2/backend/blog/models/category.py
from backend.database import (
Column,
Model,
String,
relationship,
slugify,
)
@slugify('name')
class Category(Model):
name = Column(String(32))
slug = Column(String(32))
articles = relationship('Article', back_populates='category')
ser... |
pronto/entity/__init__.py | althonos/pronto | 182 | 12762685 | <reponame>althonos/pronto<filename>pronto/entity/__init__.py<gh_stars>100-1000
import datetime
import operator
import typing
import weakref
from typing import AbstractSet, Any, Dict, FrozenSet, Iterable, Iterator, Optional, Set
from ..definition import Definition
from ..pv import PropertyValue
from ..synonym import Sy... |
tests/composite/examples/prim_composite_full.py | strint/myia | 222 | 12762706 | """Definitions for the primitive `composite_full`."""
from myia.lib import (
SHAPE,
TYPE,
VALUE,
AbstractArray,
AbstractScalar,
AbstractType,
abstract_array,
distribute,
force_pending,
scalar_cast,
u64tup_typecheck,
)
from myia.operations import primitives as P
from myia.xtyp... |
src/patchy/api.py | adamchainz/patchy | 105 | 12762718 | <gh_stars>100-1000
import __future__
import ast
import inspect
import os
import shutil
import subprocess
import sys
from functools import wraps
from tempfile import mkdtemp
from textwrap import dedent
from types import CodeType, TracebackType
from typing import (
Any,
Callable,
Dict,
List,
Optional... |
Adafruit_BluefruitLE/bluez_dbus/device.py | acoomans/Adafruit_Python_BluefruitLE | 415 | 12762744 | <reponame>acoomans/Adafruit_Python_BluefruitLE
# Python object to represent the bluez DBus device object. Provides properties
# and functions to easily interact with the DBus object.
# Author: <NAME>
#
# Copyright (c) 2015 Adafruit Industries
#
# Permission is hereby granted, free of charge, to any person obtaining a ... |
pmm_scripts/hello_world_script.py | cardosofede/hummingbot | 542 | 12762756 | from hummingbot.pmm_script.pmm_script_base import PMMScriptBase
class HelloWorldPMMScript(PMMScriptBase):
"""
Demonstrates how to send messages using notify and log functions. It also shows how errors and commands are handled.
"""
def on_tick(self):
if len(self.mid_prices) < 3:
se... |
tests/settings.py | DamnedScholar/django-sockpuppet | 371 | 12762775 | """
Django settings for example project.
"""
import os
from pathlib import Path
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
BASE_DIR = Path.cwd()
# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = "a_not_so_secret_key"
# SECURITY WARNING: don't run with debug ... |
API/src/main/resources/images/_backup/_color/color.sikuli/color.py | MiguelDomingues/SikuliX1 | 1,746 | 12762817 | reg = Region(106,108,370,160)
img1 = "source_activate.jpg"
img2 = "source_activated.jpg"
button = "buttonactivate.png"
"""
m = find(button)
m.highlight(2)
exit()
"""
ib = Finder(Image.create(button))
ib.find(button)
print "button:", ib.next().getScore()
ib = Finder(Image.create(img1))
ib.find(button)
print "img1:", ... |
parsing/views.py | playyard/infomate.club | 327 | 12762841 | <reponame>playyard/infomate.club<gh_stars>100-1000
from django.contrib.syndication.views import Feed
from parsing.telegram.parser import parse_channel
class TelegramChannelFeed(Feed):
FEED_ITEMS = 30
def get_object(self, request, channel_name):
limit = int(request.GET.get("size") or self.FEED_ITEMS)... |
GPyOpt/util/stats.py | zhenwendai/GPyOpt | 850 | 12762878 | <reponame>zhenwendai/GPyOpt
# Copyright (c) 2016, the GPyOpt Authors
# Licensed under the BSD 3-clause license (see LICENSE.txt)
#from ..util.general import samples_multidimensional_uniform, multigrid, iroot
import numpy as np
|
geocube/_version.py | snowman2/geocube | 152 | 12762885 | """GeoCube Version"""
__version__ = "0.1.1.dev0"
|
receipt_parser_core/enhancer.py | Dielee/receipt-parser-legacy | 611 | 12762903 | # !/usr/bin/python3
# coding: utf-8
# Copyright 2015-2018
#
# 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... |
src/local/butler/create_config.py | mi-ac/clusterfuzz | 5,023 | 12762931 | # Copyright 2019 Google LLC
#
# 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, ... |
nuitka/utils/Jinja2.py | mikehaben69/Nuitka | 5,421 | 12762933 | # Copyright 2021, <NAME>, mailto:<EMAIL>
#
# Part of "Nuitka", an optimizing Python compiler that is compatible and
# integrates with CPython, but also works on its own.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the Lice... |
tests/unit/trace/propagation/test_text_format.py | Flared/opencensus-python | 650 | 12762967 | <reponame>Flared/opencensus-python
# Copyright 2017, OpenCensus 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 ... |
setup.py | Jingren-hou/NeuralCDE | 438 | 12762972 | <reponame>Jingren-hou/NeuralCDE<filename>setup.py
import pathlib
import setuptools
here = pathlib.Path(__file__).resolve().parent
with open(here / 'controldiffeq/README.md', 'r') as f:
readme = f.read()
setuptools.setup(name='controldiffeq',
version='0.0.1',
author='<NAME>',
... |
util/chplenv/chplenv.py | MayukhSobo/chapel | 1,602 | 12762973 | import chpl_cpu
import chpl_atomics
import chpl_aux_filesys
import chpl_bin_subdir
import chpl_make
import chpl_platform
import chpl_comm
import chpl_comm_debug
import chpl_comm_segment
import chpl_comm_substrate
import chpl_compiler
import chpl_gasnet
import chpl_gmp
import chpl_hwloc
import chpl_jemalloc
import chpl_... |
tests/r/test_swahili.py | hajime9652/observations | 199 | 12762974 | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import shutil
import sys
import tempfile
from observations.r.swahili import swahili
def test_swahili():
"""Test module swahili.py by downloading
swahili.csv and testing shape of
extracted data has 48... |
mods/Maze/main.py | SummitChen/opennero | 215 | 12763036 | # OpenNero will execute ModMain when this mod is loaded
from Maze.client import ClientMain
def ModMain(mode = ""):
ClientMain(mode)
def StartMe():
from Maze.module import getMod
getMod().set_speedup(1.0) # full speed ahead
getMod().start_sarsa() # start an algorithm for headless mode
|
tests/arch/arm/translators/test_branch.py | IMULMUL/barf-project | 1,395 | 12763040 | <reponame>IMULMUL/barf-project
# Copyright (c) 2019, Fundacion Dr. <NAME>
# All rights reserved.
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# 1. Redistributions of source code must retain the above copyright notice... |
examples/tenant_tutorial/customers/apps.py | buraketmen/django-tenants | 514 | 12763057 | from __future__ import unicode_literals
from django.apps import AppConfig
class CustomersConfig(AppConfig):
name = 'customers'
verbose_name = 'Customers'
def ready(self):
import customers.handlers
|
GRU.py | harrys17451/CryptocurrencyPrediction | 669 | 12763088 | <reponame>harrys17451/CryptocurrencyPrediction
import pandas as pd
import numpy as numpy
from keras.models import Sequential
from keras.layers import Dense, Dropout, Activation, Flatten,Reshape
from keras.layers import Conv1D, MaxPooling1D, LeakyReLU
from keras.utils import np_utils
from keras.layers import GRU,CuDNNGR... |
sdk/cognitivelanguage/azure-ai-language-conversations/tests/test_conversation_app.py | praveenkuttappan/azure-sdk-for-python | 2,728 | 12763097 | <reponame>praveenkuttappan/azure-sdk-for-python
# coding=utf-8
# ------------------------------------
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
# ------------------------------------
import pytest
from azure.core.exceptions import HttpResponseError, ClientAuthenticationError
from azure.... |
bip_utils/ss58/ss58.py | MIPPLTeam/bip_utils | 149 | 12763114 | <reponame>MIPPLTeam/bip_utils
# Copyright (c) 2021 <NAME>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify... |
CondTools/DT/test/popcon_keyconf_user.py | ckamtsikis/cmssw | 852 | 12763119 | import FWCore.ParameterSet.Config as cms
process = cms.Process("TEST")
process.load("CondCore.DBCommon.CondDBCommon_cfi")
process.CondDBCommon.connect = 'sqlite_file:userconf.db'
process.CondDBCommon.DBParameters.authenticationPath = '.'
process.PoolDBOutputService = cms.Service("PoolDBOutputService",
process.Co... |
AISnake/Algorithm_2/modules/agent.py | EdgarLi/AIGames | 543 | 12763122 | <reponame>EdgarLi/AIGames
'''
Function:
define the ai agent
Author:
Charles
微信公众号:
Charles的皮卡丘
'''
from modules.food import *
from operator import itemgetter
from collections import OrderedDict
'''ai agent'''
class Agent():
def __init__(self, cfg, snake, **kwargs):
self.cfg = cfg
self.num_rows = cfg.GAME_MATR... |
Deep_Crossing/modules.py | jingxiufenghua/rec-model | 1,323 | 12763140 | <filename>Deep_Crossing/modules.py
"""
Created on May 18, 2021
modules of Deep&Crossing: Residual units
@author: <NAME>(<EMAIL>)
"""
import tensorflow as tf
from tensorflow.keras.layers import Dense, ReLU, Layer
class Residual_Units(Layer):
"""
Residual Units
"""
def __init__(self, hidden_unit, dim... |
mangle-infra-agent/Faults/NetworkFaults.py | vmaligireddy/mangle | 151 | 12763158 | from enum import Enum
class NetworkFaults(Enum):
NETWORK_DELAY_MILLISECONDS = 1
PACKET_DUPLICATE_PERCENTAGE = 2
PACKET_CORRUPT_PERCENTAGE = 3
PACKET_LOSS_PERCENTAGE = 4 |
tests/generators/transition/main.py | jacobkaufmann/consensus-specs | 2,161 | 12763166 | from typing import Iterable
from eth2spec.test.helpers.constants import ALTAIR, MINIMAL, MAINNET, PHASE0
from eth2spec.test.altair.transition import (
test_transition as test_altair_transition,
test_activations_and_exits as test_altair_activations_and_exits,
test_leaking as test_altair_leaking,
test_sl... |
mlflow/entities/model_registry/__init__.py | PeterSulcs/mlflow | 10,351 | 12763168 | from mlflow.entities.model_registry.registered_model import RegisteredModel
from mlflow.entities.model_registry.model_version import ModelVersion
from mlflow.entities.model_registry.registered_model_tag import RegisteredModelTag
from mlflow.entities.model_registry.model_version_tag import ModelVersionTag
__all__ = [
... |
tests/issues/test_project_issue.py | mubashshirjamal/code | 1,582 | 12763173 | # encoding: UTF-8
from tests.base import TestCase
from vilya.models.issue import Issue
from vilya.models.project_issue import ProjectIssue
class TestProjectIssue(TestCase):
def test_add_issue(self):
p = ProjectIssue.add('test', 'test description', 'test', project=1)
assert isinstance(p, Project... |
sdk/python/pulumi_gcp/dns/get_keys.py | sisisin/pulumi-gcp | 121 | 12763237 | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from .. import... |
bin/lib/releases.py | jfalcou/infra | 135 | 12763257 | <filename>bin/lib/releases.py<gh_stars>100-1000
from enum import Enum
from typing import Optional, Tuple
from attr import dataclass
@dataclass(frozen=True)
class Hash:
hash: str
def __str__(self) -> str:
return f'{str(self.hash[:6])}..{str(self.hash[-6:])}'
class VersionSource(Enum):
value: Tu... |
modelchimp/migrations/0049_auto_20190516_0759.py | samzer/modelchimp-server | 134 | 12763272 | # Generated by Django 2.2 on 2019-05-16 07:59
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('modelchimp', '0048_auto_20190515_1032'),
]
operations = [
migrations.RemoveField(
model_name='experiment',
name='algorithm',
... |
dfirtrack_artifacts/tests/artifact/test_artifact_creator_forms.py | stuhli/dfirtrack | 273 | 12763274 | from django.contrib.auth.models import User
from django.test import TestCase
from dfirtrack_artifacts.forms import ArtifactCreatorForm
from dfirtrack_artifacts.models import Artifactpriority, Artifactstatus, Artifacttype
from dfirtrack_main.models import System, Systemstatus, Tag, Tagcolor
class ArtifactCreatorFormT... |
alipay/aop/api/response/ZolozIdentificationUserWebQueryResponse.py | snowxmas/alipay-sdk-python-all | 213 | 12763306 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
from alipay.aop.api.response.AlipayResponse import AlipayResponse
class ZolozIdentificationUserWebQueryResponse(AlipayResponse):
def __init__(self):
super(ZolozIdentificationUserWebQueryResponse, self).__init__()
self._extern_info = None
... |
tests/__init__.py | szabosteve/eland | 335 | 12763311 | <filename>tests/__init__.py
# Licensed to Elasticsearch B.V. under one or more contributor
# license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright
# ownership. Elasticsearch B.V. licenses this file to you under
# the Apache License, Version 2.0 (the "Li... |
tests/core/test_record_components.py | ai-fast-track/mantisshrimp | 580 | 12763320 | import pytest
from icevision.all import *
@pytest.fixture
def dummy_class_map():
return ClassMap(["dummy-1", "dummy-2"], background=None)
@pytest.fixture
def dummy_class_map_elaborate():
return ClassMap(["dummy-1", "dummy-2", "dummy-3", "dummy-4"], background=None)
def test_classification_multilabel(dummy... |
earth_enterprise/src/update_fusion_version.py | ezeeyahoo/earthenterprise | 2,661 | 12763324 | <reponame>ezeeyahoo/earthenterprise
#!/usr/bin/env python2.7
#
# Copyright 2017 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0... |
office365/sharepoint/sharing/sharingLinkInfo.py | rikeshtailor/Office365-REST-Python-Client | 544 | 12763331 | <gh_stars>100-1000
from office365.runtime.client_value import ClientValue
class SharingLinkInfo(ClientValue):
def __init__(self):
"""
Specifies the information about the tokenized sharing link.
"""
super(SharingLinkInfo, self).__init__()
self.AllowsAnonymousAccess = None
... |
ansible/roles/blade.cumulus/library/ssh_user_alias.py | ClashTheBunny/cmdb | 111 | 12763333 | <filename>ansible/roles/blade.cumulus/library/ssh_user_alias.py
#!/usr/bin/python
DOCUMENTATION = """
---
module: ssh_user_alias.py
short_description: Create alias for users in SSH authorized_keys
options:
user:
description:
- base user to make alias for
groups:
description:
- list of groups we... |
stix2/v20/vocab.py | frank7y/cti-python-stix2 | 277 | 12763360 | """
STIX 2.0 open vocabularies and enums
"""
ATTACK_MOTIVATION_ACCIDENTAL = "accidental"
ATTACK_MOTIVATION_COERCION = "coercion"
ATTACK_MOTIVATION_DOMINANCE = "dominance"
ATTACK_MOTIVATION_IDEOLOGY = "ideology"
ATTACK_MOTIVATION_NOTORIETY = "notoriety"
ATTACK_MOTIVATION_ORGANIZATIONAL_GAIN = "organizational-gain"
ATTA... |
htmlmin/tests/test_decorator.py | Embed-Engineering/django-htmlmin | 389 | 12763369 | <filename>htmlmin/tests/test_decorator.py
# Copyright 2013 django-htmlmin authors. All rights reserved.
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file.
import unittest
from django.test.client import Client
class TestDecorator(unittest.TestCase):
@classmetho... |
pygimli/physics/SIP/siptools.py | baender/gimli | 224 | 12763373 | <gh_stars>100-1000
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""pygimli functions for dc resistivity / SIP data."""
# TODO Please sort the content into SIP package!
import pylab as P
import numpy as N
import pygimli as pg
from pygimli.utils import rndig
def astausgleich(ab2org, mn2org, rhoaorg):
"""shifts ... |
examples/plotting/file/hover_glyph.py | g-parki/bokeh | 15,193 | 12763408 | from bokeh.models import HoverTool
from bokeh.plotting import figure, output_file, show
from bokeh.sampledata.glucose import data
x = data.loc['2010-10-06'].index.to_series()
y = data.loc['2010-10-06']['glucose']
# Basic plot setup
p = figure(width=800, height=400, x_axis_type="datetime",
tools="", toolbar... |
Code-Sleep-Python/Encryption-Techniques/AES/tables.py | shardul08/Code-Sleep-Python | 420 | 12763421 | sbox = [
0x63, 0x7C, 0x77, 0x7B, 0xF2, 0x6B, 0x6F, 0xC5, 0x30, 0x01, 0x67, 0x2B, 0xFE, 0xD7, 0xAB, 0x76,
0xCA, 0x82, 0xC9, 0x7D, 0xFA, 0x59, 0x47, 0xF0, 0xAD, 0xD4, 0xA2, 0xAF, 0x9C, 0xA4, 0x72, 0xC0,
0xB7, 0xFD, 0x93, 0x26, 0x36, 0x3F, 0xF7, 0xCC, 0x34, 0xA5, 0xE5, 0xF1, 0x71, 0xD8, 0x31, 0x15,
0x04, 0xC7, 0x23, 0... |
corehq/ex-submodules/couchforms/const.py | dimagilg/commcare-hq | 471 | 12763439 |
TAG_TYPE = "#type"
TAG_XML = "#xml"
TAG_VERSION = "@version"
TAG_UIVERSION = "@uiVersion"
TAG_NAMESPACE = "@xmlns"
TAG_NAME = "@name"
TAG_META = "meta"
TAG_FORM = 'form'
ATTACHMENT_NAME = "form.xml"
MAGIC_PROPERTY = 'xml_submission_file'
RESERVED_WORDS = [TAG_TYPE, TAG_XML, TAG_VERSION, TAG_UIVERSION, TAG_NAMESPA... |
rlschool/metamaze/test.py | HaojieSHI98/RLSchool | 169 | 12763440 | import gym
import sys
import rlschool.metamaze
def test_2d_maze(max_iteration):
print("Testing 2D Maze...")
maze_env = gym.make("meta-maze-2D-v0", enable_render=False)
cell_scale = 9
task = maze_env.sample_task(cell_scale=cell_scale)
maze_env.set_task(task)
iteration = 0
while iteration < m... |
openaddr/ci/webdotmap.py | MiniCodeMonkey/machine | 101 | 12763456 | import apsw
import boto3
import os
import json
from flask import Blueprint, Response, abort, current_app, render_template, url_for
from . import setup_logger
from .webcommon import log_application_errors, flask_log_level
from .webhooks import get_memcache_client
dots = Blueprint('dots', __name__)
# https://stackove... |
notebooks-text-format/linreg_hierarchical_non_centered_numpyro.py | arpitvaghela/probml-notebooks | 166 | 12763485 | <reponame>arpitvaghela/probml-notebooks
# ---
# jupyter:
# jupytext:
# text_representation:
# extension: .py
# format_name: light
# format_version: '1.5'
# jupytext_version: 1.11.3
# kernelspec:
# display_name: Python [default]
# language: python
# name: python3
# ---
# + [m... |
src/storage-preview/azext_storage_preview/vendored_sdks/azure_storagev2/fileshare/v2020_02_10/_shared/request_handlers.py | Mannan2812/azure-cli-extensions | 2,728 | 12763487 | # -------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
# --------------------------------------------------------------------------
from typi... |
ssod/datasets/pipelines/formatting.py | huimlight/SoftTeacher | 604 | 12763496 | import numpy as np
from mmdet.datasets import PIPELINES
from mmdet.datasets.pipelines.formating import Collect
from ssod.core import TrimapMasks
@PIPELINES.register_module()
class ExtraAttrs(object):
def __init__(self, **attrs):
self.attrs = attrs
def __call__(self, results):
for k, v in sel... |
observations/r/davis.py | hajime9652/observations | 199 | 12763520 | # -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import csv
import numpy as np
import os
import sys
from observations.util import maybe_download_and_extract
def davis(path):
"""Self-Reports of Height and Weight
The `Davis` data... |
nasdaqdatalink/model/data_list.py | edvn0/data-link-python | 1,178 | 12763553 | from .model_list import ModelList
from .data_mixin import DataMixin
class DataList(DataMixin, ModelList):
pass
|
puput/wagtail_hooks.py | UCBerkeleySETI/puput | 554 | 12763554 | <gh_stars>100-1000
import wagtail.admin.rich_text.editors.draftail.features as draftail_features
from wagtail.admin.rich_text.converters.html_to_contentstate import InlineStyleElementHandler, BlockElementHandler
from wagtail.core import hooks
@hooks.register('register_rich_text_features')
def register_blockquote_feat... |
lightnion/cache.py | pthevenet/lightnion | 120 | 12763614 | <reponame>pthevenet/lightnion
import os
import time
import json
import shutil
import base64
import logging
cache_directory = '.lightnion-cache.d'
def directory(base_dir=None):
if base_dir is None:
base_dir = os.getcwd()
base_dir = os.path.join(base_dir, cache_directory)
if not os.path.isdir(base_... |
models/Lightweight/MobileNetV1.py | Dou-Yu-xuan/deep-learning-visal | 150 | 12763616 | <filename>models/Lightweight/MobileNetV1.py
import torch
import torch.nn as nn
import torchvision
def BottleneckV1(in_channels, out_channels, stride):
return nn.Sequential(
nn.Conv2d(in_channels=in_channels,out_channels=in_channels,kernel_size=3,stride=stride,padding=1,groups=in_channels),
nn.BatchN... |
enaml/qt/qt_html.py | xtuzy/enaml | 1,080 | 12763627 | <filename>enaml/qt/qt_html.py
#------------------------------------------------------------------------------
# Copyright (c) 2013-2017, Nucleic Development Team.
#
# Distributed under the terms of the Modified BSD License.
#
# The full license is in the file LICENSE, distributed with this software.
#------------------... |
tick/robust/tests/model_huber_test.py | sumau/tick | 411 | 12763639 | # License: BSD 3 clause
import unittest
import numpy as np
from scipy.sparse import csr_matrix
from tick.robust import ModelHuber
from tick.base_model.tests.generalized_linear_model import TestGLM
from tick.linear_model import SimuLinReg
class Test(TestGLM):
def test_ModelHuber(self):
"""...Numerical c... |
d2go/data/dataset_mappers/rotated_dataset_mapper.py | wenliangzhao2018/d2go | 687 | 12763656 | #!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved
import copy
import logging
import numpy as np
import torch
from d2go.data.dataset_mappers.d2go_dataset_mapper import D2GoDatasetMapper
from detectron2.data import detection_utils as utils, transforms as T
from detectron2.st... |
corus/sources/toloka.py | Ilseyar/corus | 205 | 12763706 |
from corus.record import Record
from corus.io import (
load_lines,
parse_tsv,
skip_header,
)
class LRWCRecord(Record):
__attributes__ = ['hyponym', 'hypernym', 'genitive', 'judgement', 'confidence']
def __init__(self, hyponym, hypernym, genitive, judgement, confidence):
self.hyponym = hy... |
Code/python/Py/PostProcess.py | cy15196/FastCAE | 117 | 12763709 | #-------关联C++库---------------
import ctypes
import platform
system = platform.system()
if system == "Windows":
pre = "./"
suff = ".dll"
else:
pre = "./lib"
suff = ".so"
libfile = ctypes.cdll.LoadLibrary
filename = pre+"GraphicsAnalyse"+suff
postPro = libfile(filename)
import MainWindow
#--------------------... |
mcg/sampling.py | nyu-dl/dl4mt-multi | 143 | 12763811 | <reponame>nyu-dl/dl4mt-multi
import logging
import copy
import numpy
import operator
import os
import re
import signal
import time
import theano
from blocks.extensions import SimpleExtension
from collections import OrderedDict
from subprocess import Popen, PIPE
from toolz import merge
from .utils import _p, get_enc_... |
arachne/tests/test_extensions.py | sliderSun/arachne | 137 | 12763827 | <filename>arachne/tests/test_extensions.py<gh_stars>100-1000
"""
To see if we have the right pipelines in place
"""
import inspect
from unittest import TestCase
from scrapy import signals, Field, Item
from mock import patch, mock_open, Mock, call
from arachne.extensions import ExportCSV, ExportData, ExportJSON
from scr... |
test/examples/simple/tlm2/blocking_simple/initiator.py | rodrigomelo9/uvm-python | 140 | 12763828 | #//----------------------------------------------------------------------
#// Copyright 2010-2011 Mentor Graphics Corporation
#// Copyright 2010-2011 Synopsys, Inc
#// Copyright 2019-2020 <NAME> (tpoikela)
#// All Rights Reserved Worldwide
#//
#// Licensed under the Apache License, Version 2.0 (the
#// "Lic... |
tests/spells/test_length_of.py | awesome-archive/geomancer | 216 | 12763867 | # -*- coding: utf-8 -*-
# Import modules
import pytest
from google.cloud import bigquery
from tests.spells.base_test_spell import BaseTestSpell, SpellDB
# Import from package
from geomancer.backend.settings import SQLiteConfig
from geomancer.spells import LengthOf
params = [
SpellDB(
spell=LengthOf(
... |
test/test_pwm_setup.py | mrtnschltr/CHIP_IO | 295 | 12763868 | <reponame>mrtnschltr/CHIP_IO<filename>test/test_pwm_setup.py
import pytest
import os
import time
import CHIP_IO.PWM as PWM
import CHIP_IO.OverlayManager as OM
import CHIP_IO.Utilities as UT
def setup_module(module):
if not UT.is_chip_pro():
OM.load("PWM0")
def teardown_module(module):
PWM.cleanup()
... |
tests/py/test_fake_data.py | kant/gratipay.com | 517 | 12763876 | from __future__ import print_function, unicode_literals
from gratipay import fake_data
from gratipay.testing import Harness
from gratipay.cli.fake_data import main
class TestFakeData(Harness):
def test_fake_data_cli(self):
num_participants = 6
num_tips = 25
num_teams = 5
num_pack... |
scripts/owner/what_do_i_own.py | wwjiang007/fuchsia-1 | 210 | 12763916 | <filename>scripts/owner/what_do_i_own.py
#!/usr/bin/env python2.7
# Copyright 2019 The Fuchsia Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import argparse
import os
import re
import sys
SCRIPT_DIR = os.path.dirname(os.path.abspath... |
src/robusta/core/reporting/consts.py | robusta-dev/robusta | 273 | 12763924 | from enum import Enum
SYNC_RESPONSE_SINK = "robusta-synchronized-response-sink"
class FindingType(Enum):
ISSUE = "issue"
CONF_CHANGE = "configuration_change"
HEALTH_CHECK = "health_check"
REPORT = "report"
# Finding sources
class FindingSource(Enum):
NONE = None # empty default
KUBERNETES_... |
threedod/benchmark_scripts/utils/tenFpsDataLoader.py | Levintsky/ARKitScenes | 237 | 12763985 | import copy
import cv2
import glob
import json
import numpy as np
import os
from .box_utils import compute_box_3d, boxes_to_corners_3d, get_size
from .rotation import convert_angle_axis_to_matrix3
from .taxonomy import class_names, ARKitDatasetConfig
def TrajStringToMatrix(traj_str):
""" convert traj_str into tr... |
regionator/parse_object_db.py | lubber-de/neohabitat | 181 | 12763994 | '''
Parse the MC_object database from the Habitat Stratus backup.
There are still lots of unknowns:
* Many objects have container 0x20202020. They appear to be unused, but it's
unclear why.
* Some address strings have unprintable characters. It's unclear if this
was intentional or garbage data.
* Matchbook (class... |
ast/test_NodeVisitor.py | MaxTurchin/pycopy-lib | 126 | 12764014 | import sys
import ast
import io
class Visitor(ast.NodeVisitor):
def __init__(self, f):
self.f = f
def generic_visit(self, node):
self.f.write(ast.dump(node))
self.f.write("\n")
super().generic_visit(node)
def visit_Assign(self, node):
for n in node.targets:
... |
src/lib/SocketServer.py | DTenore/skulpt | 2,671 | 12764017 | import _sk_fail; _sk_fail._("SocketServer")
|
src/Sastrawi/Stemmer/Filter/TextNormalizer.py | ZenaNugraha/PySastrawi | 282 | 12764048 | import re
def normalize_text(text):
result = text.lower() #lower the text even unicode given
result = re.sub(r'[^a-z0-9 -]', ' ', result, flags = re.IGNORECASE|re.MULTILINE)
result = re.sub(r'( +)', ' ', result, flags = re.IGNORECASE|re.MULTILINE)
return result.strip()
|
sympy/matrices/expressions/tests/test_funcmatrix.py | ovolve/sympy | 319 | 12764112 | from sympy import (symbols, FunctionMatrix, MatrixExpr, Lambda, Matrix)
def test_funcmatrix():
i, j = symbols('i,j')
X = FunctionMatrix(3, 3, Lambda((i, j), i - j))
assert X[1, 1] == 0
assert X[1, 2] == -1
assert X.shape == (3, 3)
assert X.rows == X.cols == 3
assert Matrix(X) == Matrix(3, ... |
matplotlibTUT/plt12_contours.py | subshine/tutorials | 10,786 | 12764129 | # View more python tutorials on my Youtube and Youku channel!!!
# Youtube video tutorial: https://www.youtube.com/channel/UCdyjiB5H8Pu7aDTNVXTTpcg
# Youku video tutorial: http://i.youku.com/pythontutorial
# 12 - contours
"""
Please note, this script is for python3+.
If you are using python2+, please modify it accordi... |
tools/win/linker_verbose_tracking.py | google-ar/chromium | 777 | 12764132 | <filename>tools/win/linker_verbose_tracking.py
# Copyright (c) 2016 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.
"""
This script parses the /verbose output from the VC++ linker and uses it to
explain why a particular ob... |
setup.py | berryweinst/pytorch-attention | 149 | 12764133 | from distutils.core import setup
setup(
name='attention',
version='0.1.0',
author='tllake',
author_email='<EMAIL>',
packages=['attention'],
description='An attention function for PyTorch.',
long_description=open('README.md').read()) |
switch.py | yangchuansheng/WSL-Distribution-Switcher | 1,917 | 12764152 | #!/usr/bin/env python3
# coding=utf-8
import glob
import sys
import os.path
import subprocess
from utils import Fore, parse_image_arg, probe_wsl, get_label, path_trans, handle_sigint
# handle arguments
handle_sigint()
if len(sys.argv) < 2:
# print usage information
print('usage: ./switch.py image[:tag]')
# che... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.