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 |
|---|---|---|---|---|
crawl_data.py | Sharad24/NeurIPS2021Datasets-OpenReviewData | 493 | 12757412 | <gh_stars>100-1000
import numpy as np
import h5py
import string
from util import crawl_meta
import time
CRAWL_DATA = True
AFTER_DECISION = False
CRAWL_REVIEW = True
# Get the meta data
meta_list = crawl_meta(
meta_hdf5=None,
write_meta_name='data_{}.hdf5'.format(time.strftime("%Y%m%d%H%M%S")),
... |
pyNastran/dev/bdf_vectorized/cards/elements/bar/cbar.py | ACea15/pyNastran | 293 | 12757443 | from numpy import array, arange, zeros, unique, searchsorted, full, nan
from numpy.linalg import norm # type: ignore
from pyNastran.utils.numpy_utils import integer_types
from pyNastran.bdf.field_writer_8 import print_card_8, set_blank_if_default
from pyNastran.bdf.field_writer_16 import print_card_16
from pyNastran.... |
cea/utilities/doc_graphviz.py | architecture-building-systems/cea-toolbox | 121 | 12757452 | <gh_stars>100-1000
"""
doc_graphviz.py
Creates the graphviz output used to visualize script dependencies.
This file relies on the schemas.yml to create the graphviz plots.
"""
import os
import cea.config
import cea.schemas
from jinja2 import Template
__author__ = "<NAME>"
__copyright__ = "Copyright 2018, Archite... |
cpgf/samples/irrlicht/05.userinterface.py | mousepawmedia/libdeps | 187 | 12757457 | cpgf._import(None, "builtin.debug");
cpgf._import(None, "builtin.core");
class SAppContext:
device = None,
counter = 0,
listbox = None
Context = SAppContext();
GUI_ID_QUIT_BUTTON = 101;
GUI_ID_NEW_WINDOW_BUTTON = 102;
GUI_ID_FILE_OPEN_BUTTON = 103;
GUI_ID_TRANSPARENCY_SCROLL_BAR = 104;
def makeM... |
tests/test_import.py | Attsun1031/schematics | 1,430 | 12757487 | # -*- coding: utf-8 -*-
from copy import deepcopy
import pytest
from schematics.models import Model
from schematics.types import *
from schematics.types.compound import *
from schematics.exceptions import *
from schematics.undefined import Undefined
@pytest.mark.parametrize('init', (True, False))
def test_import_d... |
tests/algorithms/memory/test_bam.py | FrostByte266/neupy | 801 | 12757494 | import pickle
import numpy as np
from neupy import algorithms
from neupy.exceptions import NotTrained
from algorithms.memory.data import zero, one, half_one, half_zero
from base import BaseTestCase
from helpers import vectors_for_testing
zero_hint = np.array([[0, 1, 0, 0]])
one_hint = np.array([[1, 0, 0, 0]])
cl... |
venv/Lib/site-packages/IPython/core/magics/auto.py | ajayiagbebaku/NFL-Model | 6,989 | 12757506 | """Implementation of magic functions that control various automatic behaviors.
"""
#-----------------------------------------------------------------------------
# Copyright (c) 2012 The IPython Development Team.
#
# Distributed under the terms of the Modified BSD License.
#
# The full license is in the file COPYING... |
lib/dynamic_screening_solutions/utils.py | goztrk/django-htk | 206 | 12757510 | # Python Standard Library Imports
import base64
import hashlib
import hmac
import json
# HTK Imports
from htk.utils import htk_setting
from htk.utils.general import resolve_method_dynamically
def validate_webhook_request(request):
"""Validates a 321Forms webhook request
Returns a JSON request body if it is ... |
server.py | Totsui/Voice_cloner | 113 | 12757511 | import socket
import os
from playsound import playsound
from pydub import AudioSegment
def sendToClient(msg):
msg = msg.decode('utf-8')
lang = msg[:3] # ITA or ENG
msg = msg[3:] # actual message
words = msg.split(" ")
if len(words) > 18:
sentences = []
sentence = ""
for i i... |
jchart/tests.py | monasysinfo/django-jchart | 125 | 12757514 | <reponame>monasysinfo/django-jchart<filename>jchart/tests.py
import json
from django.test import TestCase, RequestFactory
from django.utils import six
from django.core.exceptions import ImproperlyConfigured
from .views import ChartView
from . import Chart
from .config import (Title, Legend, Tooltips, Hover,
... |
AutotestWebD/apps/common/func/send_mail.py | yangjourney/sosotest | 422 | 12757524 | from AutotestWebD.settings import EMAIL_SENDER,EMAIL_PASSWORD,EMAIL_SERVER,EMAIL_USERNAME
import smtplib
import traceback
from email.mime.multipart import MIMEMultipart
from email.mime.text import MIMEText
from email.mime.base import MIMEBase
from email.header import Header
import os
import email.encoders
import time
i... |
sdk/customproviders/azure-mgmt-customproviders/azure/mgmt/customproviders/models/__init__.py | rsdoherty/azure-sdk-for-python | 2,728 | 12757531 | <reponame>rsdoherty/azure-sdk-for-python
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R... |
wakatime/main.py | sklirg/wakatime | 220 | 12757542 | # -*- coding: utf-8 -*-
"""
wakatime.main
~~~~~~~~~~~~~
Module entry point.
:copyright: (c) 2013 <NAME>.
:license: BSD, see LICENSE for more details.
"""
from __future__ import print_function
import logging
import os
import sys
import time
import traceback
pwd = os.path.dirname(os.path.abspath(... |
single_inference/test_kitti.py | yohannes-taye/mobilePydnet | 182 | 12757578 | """
Evaluate the model using Eigen split of KITTI dataset
- prepare gt depth running the script https://github.com/nianticlabs/monodepth2/blob/master/export_gt_depth.py
"""
import argparse
import os
import cv2
import numpy as np
import tensorflow as tf
from tqdm import tqdm
from eval_utils import compute_errors, comp... |
Pyto/Samples/SciKit-Image/plot_edge_filter.py | snazari/Pyto | 701 | 12757585 | """
==============
Edge operators
==============
Edge operators are used in image processing within edge detection algorithms.
They are discrete differentiation operators, computing an approximation of the
gradient of the image intensity function.
"""
import numpy as np
import matplotlib.pyplot as plt
from skimage.d... |
VA/main/models/blocks.py | YuJaceKim/Activity-Recognition-with-Combination-of-Deeply-Learned-Visual-Attention-and-Pose-Estimation | 343 | 12757589 | import tensorflow as tf
from keras.models import Model
from deephar.layers import *
from deephar.utils import *
def conv_block(inp, kernel_size, filters, last_act=True):
filters1, filters2, filters3 = filters
x = conv_bn_act(inp, filters1, (1, 1))
x = conv_bn_act(x, filters2, kernel_size)
x = conv... |
schedule/migrations/0002_event_color_event.py | kimarakov/schedule | 1,065 | 12757618 | <gh_stars>1000+
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [("schedule", "0001_initial")]
operations = [
migrations.AddField(
model_name="event",
name="color_event",
field=models.CharField(
verbos... |
sld-schedule/helpers/api_token.py | guorenxi/Stack-Lifecycle-Deployment | 115 | 12757622 | <reponame>guorenxi/Stack-Lifecycle-Deployment
from helpers.api_request import request_url
from config.api import settings
def get_token(data):
response = request_url(
verb='POST',
headers={'Content-Type': 'application/json'},
uri='authenticate/access-token-json',
json=data
)
... |
tests/models/hyper_dt_regression_test.py | lixfz/DeepTables | 828 | 12757635 | # -*- coding:utf-8 -*-
__author__ = 'yangjian'
"""
"""
import pandas as pd
from deeptables.models import DeepTable
from deeptables.models.hyper_dt import HyperDT, tiny_dt_space
from hypernets.core.callbacks import SummaryCallback, FileStorageLoggingCallback
from hypernets.core.searcher import OptimizeDirection
from hy... |
luminaire/model/window_density.py | Dima2022/luminaire | 525 | 12757654 | from luminaire.model.base_model import BaseModel, BaseModelHyperParams
from luminaire.exploration.data_exploration import DataExploration
class WindowDensityHyperParams(BaseModelHyperParams):
"""
Hyperparameter class for Luminaire Window density model.
:param str freq: The frequency of the time-series. L... |
tools/android/roll/update_support_library.py | google-ar/chromium | 777 | 12757664 | #!/usr/bin/env python
#
# Copyright 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.
"""
Updates the Android support repository (m2repository).
"""
import argparse
import fnmatch
import os
import subprocess
import shu... |
PyObjCTest/test_nsset.py | Khan/pyobjc-framework-Cocoa | 132 | 12757699 | <gh_stars>100-1000
from PyObjCTools.TestSupport import *
import objc
from Foundation import *
class TestNSSetInteraction(TestCase):
def __testRepeatedAllocInit( self ):
for i in range(1,1000):
a = NSSet.alloc().init()
def __testContains( self ):
x = NSSet.setWithArray_( ["foo", "b... |
fuzzymetaphone.py | sskadamb/csvmatch | 146 | 12757722 | import doublemetaphone
def match(value1, value2):
value1metaphone = doublemetaphone.doublemetaphone(value1)
value2metaphone = doublemetaphone.doublemetaphone(value2)
possibilities = [
value1metaphone[0] == value2metaphone[0],
value1metaphone[0] == value2metaphone[1],
value1metaphone... |
projectCreation/import_images.py | MattSkiff/aerial_wildlife_detection | 166 | 12757788 | <filename>projectCreation/import_images.py
'''
Helper function that imports a set of unlabeled images into the database.
Works recursively (i.e., with images in nested folders) and different file
formats and extensions (.jpg, .JPEG, .png, etc.).
Skips images that have already been added to the database.... |
sparkmagic/sparkmagic/tests/test_sessionmanager.py | sciserver/sparkmagic | 1,141 | 12757798 | <reponame>sciserver/sparkmagic<filename>sparkmagic/sparkmagic/tests/test_sessionmanager.py<gh_stars>1000+
import atexit
from mock import MagicMock, PropertyMock
from nose.tools import raises, assert_equals
import sparkmagic.utils.configuration as conf
from sparkmagic.livyclientlib.exceptions import SessionManagementE... |
persimmon/view/pins/pin.py | AlvarBer/Persimmon | 206 | 12757843 | from persimmon.view.pins.circularbutton import CircularButton # MYPY HACK
from persimmon.view.util import Type, AbstractWidget, Connection
from kivy.properties import ObjectProperty
from kivy.lang import Builder
from kivy.graphics import Color, Ellipse, Line
from kivy.input import MotionEvent
from abc import abstractm... |
src/django-nonrel/django/forms/extras/__init__.py | adamjmcgrath/glancydesign | 790 | 12757868 | <gh_stars>100-1000
from widgets import *
|
geomdl/multi.py | Maik93/NURBS-Python | 382 | 12757873 | """
.. module:: Multi
:platform: Unix, Windows
:synopsis: Provides container classes for spline geoemtries
.. moduleauthor:: <NAME> <<EMAIL>>
"""
import abc
import warnings
from functools import partial
from multiprocessing import Value, Lock
from . import abstract
from . import vis
from . import voxelize
fr... |
tests/nnapi/specs/Ex/transpose_conv_ex_float_1.mod.py | bogus-sudo/ONE-1 | 255 | 12757886 | <gh_stars>100-1000
# model
model = Model()
i0 = Input("op_shape", "TENSOR_INT32", "{4}")
weights = Parameter("ker", "TENSOR_FLOAT32", "{1, 3, 3, 1}", [1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0])
i1 = Input("in", "TENSOR_FLOAT32", "{1, 4, 4, 1}" )
pad = Int32Scalar("pad_same", 1)
s_x = Int32Scalar("stride_x", 1)
s_y =... |
src/datashare/azext_datashare/vendored_sdks/datashare/aio/operations_async/__init__.py | Mannan2812/azure-cli-extensions | 207 | 12757896 | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... |
src/bitmessageqt/messagecompose.py | BeholdersEye/PyBitmessage | 1,583 | 12757902 | """
Message editor with a wheel zoom functionality
"""
# pylint: disable=bad-continuation
from PyQt4 import QtCore, QtGui
class MessageCompose(QtGui.QTextEdit):
"""Editor class with wheel zoom functionality"""
def __init__(self, parent=0):
super(MessageCompose, self).__init__(parent)
self.set... |
py/testdir_multi_jvm/test_many_cols_enum_multi.py | gigliovale/h2o | 882 | 12757903 | <reponame>gigliovale/h2o<filename>py/testdir_multi_jvm/test_many_cols_enum_multi.py
import unittest, random, sys, time, os
sys.path.extend(['.','..','../..','py'])
import h2o, h2o_cmd, h2o_browse as h2b, h2o_import as h2i
import h2o_exec as h2e
def write_syn_dataset(csvPathname, rowCount, colCount, header, SEED):
... |
test_install.py | flothesof/sfepy | 510 | 12757913 | <filename>test_install.py
#!/usr/bin/env python
"""
Simple script for testing various SfePy functionality, examples not
covered by tests, and running the tests.
The script just runs the commands specified in its main() using the
`subprocess` module, captures the output and compares one or more key
words to the expecte... |
cvat/apps/engine/migrations/0018_jobcommit.py | wsp-digital/cvat | 4,197 | 12757930 | # Generated by Django 2.1.7 on 2019-04-17 09:25
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('engine', '0017_db_redesi... |
third_party/shaderc/src/glslc/test/parameter_tests.py | zipated/src | 2,151 | 12757943 | # Copyright 2015 The Shaderc 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... |
libraries/botframework-streaming/botframework/streaming/payloads/disassemblers/cancel_disassembler.py | andreikop/botbuilder-python | 388 | 12757946 | # Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.
from uuid import UUID
from botframework.streaming.payload_transport import PayloadSender
from botframework.streaming.payloads.models import Header
class CancelDisassembler:
def __init__(self, *, sender: PayloadSender, ... |
data_preprocess.py | smlin2000/OmniAnomaly | 344 | 12757965 | <gh_stars>100-1000
import ast
import csv
import os
import sys
from pickle import dump
import numpy as np
from tfsnippet.utils import makedirs
output_folder = 'processed'
makedirs(output_folder, exist_ok=True)
def load_and_save(category, filename, dataset, dataset_folder):
temp = np.genfromtxt(os.path.join(datas... |
tests/test_visualization_metrics.py | aniketmaurya/Chitra | 158 | 12758002 | from unittest.mock import MagicMock, Mock, patch
import numpy as np
import pytest
from chitra.visualization.metrics import (
cm_accuracy,
detect_multilabel,
plot_confusion_matrix,
)
def test_detect_multilabel():
with pytest.raises(UserWarning):
detect_multilabel({"label1": "this will raise U... |
scale/scheduler/cleanup/node.py | kaydoh/scale | 121 | 12758037 | <gh_stars>100-1000
"""Defines the class that handles a node's cleanup"""
from __future__ import unicode_literals
import logging
from job.execution.tasks.cleanup_task import CleanupTask
from scheduler.manager import scheduler_mgr
JOB_EXES_WARNING_THRESHOLD = 100
MAX_JOB_EXES_PER_CLEANUP = 25
logger = logging.getLo... |
vlcp/service/sdn/icmpresponder.py | hubo1016/vlcp | 252 | 12758061 | import itertools
import os
import vlcp.service.sdn.ofpportmanager as ofpportmanager
import vlcp.service.kvdb.objectdb as objectdb
import vlcp.service.sdn.ioprocessing as iop
from vlcp.service.sdn.flowbase import FlowBase
from vlcp.server.module import depend, call_api
from vlcp.config.config import defaultconfig
from ... |
11_stream/src/push_notification_to_sns.py | dpai/workshop | 2,327 | 12758065 | <reponame>dpai/workshop
from __future__ import print_function
import boto3
import base64
import os
SNS_TOPIC_ARN = os.environ["SNS_TOPIC_ARN"]
sns = boto3.client("sns")
print("Loading function")
def lambda_handler(event, context):
output = []
success = 0
failure = 0
highest_score = 0
print("ev... |
docker/test/integration/minifi/validators/SegfaultValidator.py | dtrodrigues/nifi-minifi-cpp | 113 | 12758080 | from .OutputValidator import OutputValidator
class SegfaultValidator(OutputValidator):
"""
Validate that a file was received.
"""
def validate(self):
return True
|
dashboard/dashboard/pinpoint/models/tasks/evaluator.py | Martijnve23/catapult | 1,894 | 12758097 | # Copyright 2019 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.
"""Consolidated evaluator factory module.
This module consolidates the creation of specific evaluator combinators, used
throughout Pinpoint to evaluate task ... |
external/iotivity/iotivity_1.2-rel/build_common/iotivityconfig/compiler/configuration.py | SenthilKumarGS/TizenRT | 1,433 | 12758103 | # ------------------------------------------------------------------------
# Copyright 2015 Intel Corporation
#
# 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/li... |
aps/transform/utils.py | ishine/aps | 117 | 12758104 | <reponame>ishine/aps
# Copyright 2019 <NAME>
# License: Apache 2.0 (http://www.apache.org/licenses/LICENSE-2.0)
import math
import numpy as np
import torch as th
import torch.nn as nn
import torch.nn.functional as tf
import librosa.filters as filters
from aps.const import EPSILON, TORCH_VERSION
from typing import Op... |
tensorflow_gnn/models/gat_v2/layers.py | tensorflow/gnn | 611 | 12758123 | """Contains a Graph Attention Network v2 and associated layers."""
from typing import Any, Callable, Mapping, Optional, Union
import tensorflow as tf
import tensorflow_gnn as tfgnn
@tf.keras.utils.register_keras_serializable(package="GNN>models>gat_v2")
class GATv2Conv(tfgnn.keras.layers.AnyToAnyConvolutionBase):
... |
jorldy/test/core/network/test_rainbow_network.py | zenoengine/JORLDY | 300 | 12758130 | import torch
from core.network.rainbow import Rainbow
def test_rainbow_call():
D_in, D_out, D_hidden = 2, 3, 4
N_atom = 5
noise_type = "factorized"
net = Rainbow(
D_in=D_in, D_out=D_out, N_atom=N_atom, noise_type=noise_type, D_hidden=D_hidden
)
batch_size = 6
mock_input = torch.... |
m2cgen/interpreters/ruby/code_generator.py | Symmetry-International/m2cgen | 2,161 | 12758138 | <reponame>Symmetry-International/m2cgen
from contextlib import contextmanager
from m2cgen.interpreters.code_generator import CodeTemplate, ImperativeCodeGenerator
class RubyCodeGenerator(ImperativeCodeGenerator):
tpl_var_declaration = CodeTemplate("")
tpl_num_value = CodeTemplate("{value}")
tpl_infix_ex... |
lldb/test/API/functionalities/module_cache/debug_index/TestDebugIndexCache.py | LaudateCorpus1/llvm-project | 605 | 12758184 | <filename>lldb/test/API/functionalities/module_cache/debug_index/TestDebugIndexCache.py
import glob
import json
import lldb
from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
from lldbsuite.test import lldbutil
import os
import time
class DebugIndexCacheTestcase(TestBase):
mydir = Test... |
semantic_segmentation/main.py | pedrohtg/pytorch | 205 | 12758188 | <filename>semantic_segmentation/main.py
from argparse import ArgumentParser
import os
import random
from matplotlib import pyplot as plt
import torch
from torch import optim
from torch import nn
from torch.nn import functional as F
from torch.autograd import Variable
from torch.utils.data import DataLoader
from torchvi... |
tests/functional/custom_singular_tests/test_custom_singular_tests.py | tomasfarias/dbt-core | 799 | 12758210 | <gh_stars>100-1000
import pytest
from pathlib import Path
from dbt.tests.util import run_dbt
# from `test/integration/009_data_test`
#
# Models
#
models__table_copy = """
{{
config(
materialized='table'
)
}}
select * from {{ this.schema }}.seed
"""
#
# Tests
#
tests__fail_email_is_always_null = ... |
linear_attention_transformer/__init__.py | lucidrains/linear-attention | 361 | 12758228 | from linear_attention_transformer.linear_attention_transformer import LinearAttentionTransformer, LinearAttentionTransformerLM, LinformerSettings, LinformerContextSettings
from linear_attention_transformer.autoregressive_wrapper import AutoregressiveWrapper
from linear_attention_transformer.images import ImageLinearAtt... |
datadog_checks_base/tests/base/checks/win/test_winpdh.py | mchelen-gov/integrations-core | 663 | 12758258 | # (C) Datadog, Inc. 2018-present
# All rights reserved
# Licensed under a 3-clause BSD style license (see LICENSE)
import logging
from collections import defaultdict
import pytest
from datadog_checks.dev.testing import requires_windows
try:
from datadog_test_libs.win.pdh_mocks import ( # noqa: F401
init... |
OracleInternetDirectory/dockerfiles/12.2.1.4.0/container-scripts/start_oid_component.py | rmohare/oracle-product-images | 5,519 | 12758264 | #!/usr/bin/python
#
# Copyright (c) 2021, Oracle and/or its affiliates.
#
# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
#
# Author: <NAME>
#
import os, sys, re
domain_name = os.environ.get("DOMAIN_NAME", "oid_domain")
oracle_home = os.environ.get("ORACLE_HOME"... |
kfac/examples/mnist.py | ntselepidis/kfac | 179 | 12758265 | <filename>kfac/examples/mnist.py<gh_stars>100-1000
# Copyright 2019 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/... |
metrics/kvret/evaluator.py | HKUNLP/UnifiedSKG | 191 | 12758298 | <reponame>HKUNLP/UnifiedSKG<gh_stars>100-1000
# encoding=utf8
from collections import OrderedDict
import json
import nltk
from datasets import load_metric
def load_entities(kvret_entity_file_path):
"""
@param kvret_entity_file_path: the path of kvret_entities.json
@return:
"""
under_... |
examples/backends/plot_unmix_optim_torch.py | kguerda-idris/POT | 830 | 12758308 | # -*- coding: utf-8 -*-
r"""
=================================
Wasserstein unmixing with PyTorch
=================================
In this example we estimate mixing parameters from distributions that minimize
the Wasserstein distance. In other words we suppose that a target
distribution :math:`\mu^t` can be expressed... |
IntelligentUAVPathPlanningSimulationSystem/core/main.py | wangwei39120157028/IntelligentUAVPathPlanningSimulationSystem-Drone | 208 | 12758323 | # -*- coding:utf-8 -*-
import os
import sys
sys.path.append(os.path.dirname(os.path.abspath(__file__)))
from appUI.MainWindow import main
if __name__ == "__main__":
#
main()
|
js2py/internals/prototypes/jsboolean.py | renesugar/Js2Py | 1,926 | 12758332 | from __future__ import unicode_literals
from ..conversions import *
from ..func_utils import *
class BooleanPrototype:
def toString(this, args):
if GetClass(this) != 'Boolean':
raise MakeError('TypeError',
'Boolean.prototype.toString is not generic')
if is_... |
app/my_bokeh_app.py | adarsh0806/scipy2015-blaze-bokeh | 168 | 12758365 | # -*- coding: utf-8 -*-
import math
from collections import OrderedDict
import flask
import pandas as pd
import netCDF4
import numpy as np
from bokeh.embed import components
from bokeh.resources import INLINE
from bokeh.templates import RESOURCES
from bokeh.util.string import encode_utf8
from bokeh.models import Da... |
scripts/compute_possible_instructions.py | m-smith/babyai | 411 | 12758377 | <reponame>m-smith/babyai<filename>scripts/compute_possible_instructions.py
#!/usr/bin/env python3
"""
Compute the number of possible instructions in the BabyAI grammar.
"""
from gym_minigrid.minigrid import COLOR_NAMES
def count_Sent():
return (
count_Sent1() +
# Sent1, then Sent1
count_S... |
sdk/core/azure-common/tests/test_credentials.py | rsdoherty/azure-sdk-for-python | 2,728 | 12758450 | # coding: utf-8
#-------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#----------------------------------------------------------------------... |
equip/analysis/graph/io.py | neuroo/equip | 102 | 12758504 | <reponame>neuroo/equip
# -*- coding: utf-8 -*-
"""
equip.analysis.graph.io
~~~~~~~~~~~~~~~~~~~~~~~
Outputs the graph structures
:copyright: (c) 2014 by <NAME> (@rgaucher)
:license: Apache 2, see LICENSE for more details.
"""
from .graphs import DiGraph, Tree
DOT_STYLE = """
rankdir=TD; ordering=out;
graph... |
utils/helper.py | parksunwoo/daanet | 145 | 12758509 | <gh_stars>100-1000
import importlib
import logging
import math
import os
import re
import shutil
import subprocess
import sys
import time
import traceback
from collections import defaultdict
from random import shuffle
import GPUtil
import tensorflow as tf
from ruamel.yaml import YAML
from ruamel.yaml.comments import C... |
deepnet/sparse_code_layer.py | airingzhang/deepnet | 626 | 12758521 | from layer import *
class SparseCodeLayer(Layer):
def AllocateBatchsizeDependentMemory(self, batchsize):
super(SparseCodeLayer, self).AllocateBatchsizeDependentMemory(batchsize)
self.approximator = cm.empty(self.state.shape)
self.temp3 = cm.empty(self.state.shape)
self.grad = cm.empty(self.state.sha... |
pool_automation/roles/aws_manage/library/test_stateful_set.py | Rob-S/indy-node | 627 | 12758527 | <reponame>Rob-S/indy-node<gh_stars>100-1000
import random
import string
import json
import boto3
import pytest
from stateful_set import (
AWS_REGIONS, InstanceParams, find_ubuntu_ami,
AwsEC2Launcher, AwsEC2Terminator, find_instances,
valid_instances, get_tag, manage_instances
)
class EC2TestCtx(object):... |
.modules/.sqlmap/lib/takeover/abstraction.py | termux-one/EasY_HaCk | 1,103 | 12758531 | <reponame>termux-one/EasY_HaCk
#!/usr/bin/env python
"""
Copyright (c) 2006-2018 sqlmap developers (http://sqlmap.org/)
See the file 'LICENSE' for copying permission
"""
import sys
from extra.safe2bin.safe2bin import safechardecode
from lib.core.common import dataToStdout
from lib.core.common import Backend
from lib... |
observations/r/bmw.py | hajime9652/observations | 199 | 12758584 | <gh_stars>100-1000
# -*- 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 bmw(path):
"""Daily Log Returns on BMW Share Price... |
general/add-watermark-pdf/pdf_watermarker.py | caesarcc/python-code-tutorials | 1,059 | 12758586 | from PyPDF4 import PdfFileReader, PdfFileWriter
from PyPDF4.pdf import ContentStream
from PyPDF4.generic import TextStringObject, NameObject
from PyPDF4.utils import b_
import os
import argparse
from io import BytesIO
from typing import Tuple
# Import the reportlab library
from reportlab.pdfgen import canvas
# The size... |
data/base_dataset.py | ArlenCHEN/SNE-RoadSeg | 213 | 12758589 | import torch.utils.data as data
class BaseDataset(data.Dataset):
def __init__(self):
super(BaseDataset, self).__init__()
def name(self):
return 'BaseDataset'
@staticmethod
def modify_commandline_options(parser, is_train):
return parser
def initialize(self, opt):
... |
jorldy/core/env/gym_env.py | zenoengine/JORLDY | 300 | 12758616 | <filename>jorldy/core/env/gym_env.py
import gym
import numpy as np
from .base import BaseEnv
class _Gym(BaseEnv):
"""Gym environment.
Args:
name (str): name of environment in Gym.
render (bool): parameter that determine whether to render.
custom_action (bool): parameter that determine... |
stores/apps/users/admin.py | diassor/CollectorCity-Market-Place | 135 | 12758631 | from models import *
from django.contrib import admin
admin.site.register(Profile)
admin.site.register(EmailVerify)
|
ide/tasks/gist.py | Ramonrlb/cloudpebble | 147 | 12758646 | <filename>ide/tasks/gist.py
import json
import github
from celery import task
from django.db import transaction
from django.conf import settings
from ide.models.user import User
from ide.models.project import Project
from ide.utils.sdk import load_manifest_dict
from ide.models.files import SourceFile, ResourceFile, R... |
lib/utils/adb.py | vividmuse/frida-skeleton | 520 | 12758701 | <reponame>vividmuse/frida-skeleton
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from lib.utils.shell import Shell
class Adb(Shell):
def __init__(self, serial):
super().__init__()
self.serial = serial
# if we are root shell
self.is_root = False
self.check_root()
@cla... |
src/platform/weblogic/deployers/webs_deploy.py | 0x27/clusterd | 539 | 12758712 | <filename>src/platform/weblogic/deployers/webs_deploy.py
from src.platform.weblogic.interfaces import WINTERFACES
import src.platform.weblogic.deployers.web_deploy as web_deploy
versions = ["10", "11", "12"]
title = WINTERFACES.WLS
def deploy(fingerengine, fingerprint):
return web_deploy.deploy(fingerengine, fing... |
chainer_/datasets/cifar10_cls_dataset.py | naviocean/imgclsmob | 2,649 | 12758715 | <filename>chainer_/datasets/cifar10_cls_dataset.py<gh_stars>1000+
"""
CIFAR-10 classification dataset.
"""
import os
import numpy as np
from chainer.dataset import DatasetMixin
from chainer.datasets.cifar import get_cifar10
from chainercv.transforms import random_crop
from chainercv.transforms import random_flip
f... |
Anaconda-files/Program_19d.py | arvidl/dynamical-systems-with-applications-using-python | 106 | 12758720 | # Program 19d: Generalized synchronization.
# See Figure 19.8(a).
import numpy as np
import matplotlib.pyplot as plt
from scipy.integrate import odeint
# Constants
mu = 5.7
sigma = 16
b = 4
r = 45.92
g = 8 # When g=4, there is no synchronization.
tmax = 100
t = np.arange(0.0, tmax, 0.1)
def rossler_lorenz_odes(X,t... |
model-optimizer/extensions/front/ATenToEmbeddingBag.py | monroid/openvino | 2,406 | 12758723 | <gh_stars>1000+
# Copyright (C) 2018-2021 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
from extensions.ops.embedding_bag import EmbeddingBagOffsetsSum, EmbeddingBagPackedSum
from extensions.ops.rank import Rank
from mo.front.common.partial_infer.utils import int64_array
from mo.front.common.replacement impo... |
fn/stream.py | bmintz/fn.py | 2,260 | 12758737 | from sys import version_info
if version_info[0] == 2:
from sys import maxint
else:
from sys import maxsize as maxint
from itertools import chain
from .iters import map, range
class Stream(object):
__slots__ = ("_last", "_collection", "_origin")
class _StreamIterator(object):
__slot... |
tests/classification/dataset_readers/boolq.py | shunk031/allennlp-models | 402 | 12758748 | <reponame>shunk031/allennlp-models
# -*- coding: utf-8 -*-
from allennlp.common.util import ensure_list
from allennlp.data.tokenizers import PretrainedTransformerTokenizer
from allennlp.data.token_indexers import PretrainedTransformerIndexer
from allennlp_models.classification import BoolQDatasetReader
from tests impo... |
benchmarks/django_simple/app.py | p7g/dd-trace-py | 308 | 12758757 | <gh_stars>100-1000
import os
import django
from django.db import connection
from django.template import Context
from django.template import Template
from django.urls import path
BASE_DIR = os.path.dirname(os.path.abspath(__file__))
DEBUG = False
ROOT_URLCONF = __name__
DATABASES = {
"default": {
"ENGINE"... |
data/transcoder_evaluation_gfg/python/CHECK_WHETHER_TRIANGLE_VALID_NOT_SIDES_GIVEN.py | mxl1n/CodeGen | 241 | 12758775 | <reponame>mxl1n/CodeGen<gh_stars>100-1000
# Copyright (c) 2019-present, Facebook, Inc.
# All rights reserved.
#
# This source code is licensed under the license found in the
# LICENSE file in the root directory of this source tree.
#
def f_gold ( a , b , c ) :
if ( a + b <= c ) or ( a + c <= b ) or ( b + c <= a ) :... |
examples/monthly_budget_mover_example.py | Ressmann/starthinker | 138 | 12758799 | <filename>examples/monthly_budget_mover_example.py
###########################################################################
#
# Copyright 2021 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 ... |
tests/test_target.py | iksteen/dpf | 133 | 12758802 | import mock
import pytest
import pwny
def test_default_arch_x86():
with mock.patch('platform.machine') as platform_mock:
platform_mock.return_value = 'i386'
assert pwny.Target().arch is pwny.Target.Arch.x86
def test_default_arch_x86_64():
with mock.patch('platform.machine') as platform_mock... |
src/whylogs/features/__init__.py | cswarth/whylogs | 603 | 12758803 | <filename>src/whylogs/features/__init__.py
_IMAGE_FEATURES = ["Hue", "Brightness", "Saturation"]
|
src/encoded/tests/fixtures/schemas/award.py | procha2/encoded | 102 | 12758813 | import pytest
@pytest.fixture
def ENCODE3_award(testapp):
item = {
'name': 'ABC1234',
'rfa': 'ENCODE3',
'project': 'ENCODE',
'title': 'A Generic ENCODE3 Award'
}
return testapp.post_json('/award', item, status=201).json['@graph'][0]
@pytest.fixture
def award_a():
retur... |
digits/model/tasks/test_caffe_train.py | PhysicsTeacher13/Digits-NVIDIA | 111 | 12758827 | # Copyright (c) 2014-2016, NVIDIA CORPORATION. All rights reserved.
from __future__ import absolute_import
from digits import test_utils
def test_caffe_imports():
test_utils.skipIfNotFramework('caffe')
import numpy # noqa
import google.protobuf # noqa
|
server/server.py | cattlepi/cattlepi | 257 | 12758837 | <reponame>cattlepi/cattlepi<filename>server/server.py<gh_stars>100-1000
import falcon
import json
import os
import hashlib
class ServerUtils(object):
@staticmethod
def get_file_location(filename):
dirname = os.path.dirname(__file__)
relpath = os.path.join(dirname, '../builder/latest/output', fi... |
src/0064.minimum-path-sum/minimum-path-sum.py | lyphui/Just-Code | 782 | 12758838 | <filename>src/0064.minimum-path-sum/minimum-path-sum.py
class Solution:
def minPathSum(self, grid: List[List[int]]) -> int:
m, n = len(grid), len(grid[0])
dp = grid[0][:]
for i in range(1, n):
dp[i] += dp[i-1]
for i in range(1, m):
for j in range(n):
... |
scripts/standalone_blob_server.py | nishp77/lbry-sdk | 4,996 | 12758848 | <filename>scripts/standalone_blob_server.py<gh_stars>1000+
import sys
import os
import asyncio
from lbry.blob.blob_manager import BlobManager
from lbry.blob_exchange.server import BlobServer
from lbry.schema.address import decode_address
from lbry.extras.daemon.storage import SQLiteStorage
async def main(address: str... |
orbitdeterminator/doppler/utils/utils.py | DewanshiDewan/orbitdeterminator | 158 | 12758851 | <reponame>DewanshiDewan/orbitdeterminator<filename>orbitdeterminator/doppler/utils/utils.py
import numpy as np
from scipy.integrate import odeint # Orbit propagation
from scipy.optimize import fsolve # For solving TDoA
from sgp4.api import Satrec
from astropy import units as u
from astropy.time import Time
from as... |
regtests/typed/float32vec.py | ahakingdom/Rusthon | 622 | 12758866 | """simd float32vec"""
def get_data():
return [1.9, 1.8, 1.7, 0.6, 0.99,0.88,0.77,0.66]
def main():
## the translator knows this is a float32vec because there are more than 4 elements
x = y = z = w = 22/7
a = numpy.array( [1.1, 1.2, 1.3, 0.4, x,y,z,w], dtype=numpy.float32 )
## in this case the translator is not s... |
test/onnx/test_pytorch_onnx_onnxruntime.py | jsun94/nimble | 206 | 12758876 | <gh_stars>100-1000
import unittest
import onnxruntime # noqa
import torch
import numpy as np
import io
import itertools
import copy
from torch.nn.utils import rnn as rnn_utils
from model_defs.lstm_flattening_result import LstmFlatteningResult
from model_defs.rnn_model_with_packed_sequence import RnnModelWithPackedSe... |
readthedocs/projects/migrations/0021_add-webhook-deprecation-feature.py | tkoyama010/readthedocs.org | 4,054 | 12758887 | <gh_stars>1000+
# -*- coding: utf-8 -*-
"""Add feature for allowing access to deprecated webhook endpoints."""
from django.db import migrations
FEATURE_ID = 'allow_deprecated_webhooks'
def forward_add_feature(apps, schema_editor):
Feature = apps.get_model('projects', 'Feature')
Feature.objects.create(
... |
test/tet_train.py | luoyudong593/Keras-TextClassification | 1,339 | 12758889 | # !/usr/bin/python
# -*- coding: utf-8 -*-
# @time : 2019/11/12 16:45
# @author : Mo
# @function:
from keras_textclassification import train
train(graph='TextCNN', # 必填, 算法名, 可选"ALBERT","BERT","XLNET","FASTTEXT","TEXTCNN","CHARCNN",
# "TEXTRNN","RCNN","DCNN","DPCNN","VDCNN","CRNN","DEEPMOJI... |
gcp_variant_transforms/transforms/merge_header_definitions_test.py | tsa87/gcp-variant-transforms | 113 | 12758894 | # Copyright 2018 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... |
demo/helper.py | scottx611x/napkin | 190 | 12758913 | <reponame>scottx611x/napkin
import inspect
import os
import napkin
def generate_markdown_file(title, src_path):
name, _ = os.path.splitext(os.path.basename(src_path))
src_file = name + '.py'
napkin.generate(output_format='plantuml_png', output_dir='../images')
text = """# {title}
Following examples ar... |
tests/unit/output/schema/__init__.py | jaebradley/draftkings_client | 111 | 12758925 | <gh_stars>100-1000
"""
Represents tests defined in the draft_kings.output.schema module.
Most tests center around serializing / deserializing output objects using the marshmallow library
"""
|
junction/conferences/migrations/0001_initial.py | theSage21/junction | 192 | 12758931 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import django_extensions.db.fields
from django.conf import settings
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
opera... |
smartsheet/models/webhook_stats.py | bromic007/smartsheet-python-sdk | 106 | 12758933 | # pylint: disable=C0111,R0902,R0904,R0912,R0913,R0915,E1101
# Smartsheet Python SDK.
#
# Copyright 2017 Smartsheet.com, 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.... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.