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 |
|---|---|---|---|---|
test/inference_correctness/dcn_multi_hot.py | x-y-z/HugeCTR | 130 | 4039 | <filename>test/inference_correctness/dcn_multi_hot.py
import hugectr
from mpi4py import MPI
solver = hugectr.CreateSolver(model_name = "dcn",
max_eval_batches = 1,
batchsize_eval = 16384,
batchsize = 16384,
... |
vbdiar/scoring/normalization.py | VarunSrivastava19/VBDiarization | 101 | 4051 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2018 Brno University of Technology FIT
# Author: <NAME> <<EMAIL>>
# All Rights Reserved
import os
import logging
import pickle
import multiprocessing
import numpy as np
from sklearn.metrics.pairwise import cosine_similarity
from vbdiar.features.segments... |
nuke/pymmh3.py | jfpanisset/Cryptomatte | 543 | 4066 | '''
pymmh3 was written by <NAME> and enhanced by <NAME>, and is placed in the public
domain. The authors hereby disclaim copyright to this source code.
pure python implementation of the murmur3 hash algorithm
https://code.google.com/p/smhasher/wiki/MurmurHash3
This was written for the times when you do not want to c... |
ambari-common/src/main/python/resource_management/libraries/functions/get_bare_principal.py | likenamehaojie/Apache-Ambari-ZH | 1,664 | 4075 | #!/usr/bin/env 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
"License");... |
util/config/validators/test/test_validate_bitbucket_trigger.py | giuseppe/quay | 2,027 | 4082 | import pytest
from httmock import urlmatch, HTTMock
from util.config import URLSchemeAndHostname
from util.config.validator import ValidatorContext
from util.config.validators import ConfigValidationException
from util.config.validators.validate_bitbucket_trigger import BitbucketTriggerValidator
from test.fixtures i... |
rlcycle/dqn_base/loss.py | cyoon1729/Rlcycle | 128 | 4089 | from typing import List, Tuple
from omegaconf import DictConfig
import torch
import torch.nn as nn
import torch.nn.functional as F
from rlcycle.common.abstract.loss import Loss
class DQNLoss(Loss):
"""Compute double DQN loss"""
def __init__(self, hyper_params: DictConfig, use_cuda: bool):
Loss.__in... |
venv/Lib/site-packages/zmq/tests/test_draft.py | ajayiagbebaku/NFL-Model | 603 | 4103 | # -*- coding: utf8 -*-
# Copyright (C) PyZMQ Developers
# Distributed under the terms of the Modified BSD License.
import os
import platform
import time
import pytest
import zmq
from zmq.tests import BaseZMQTestCase, skip_pypy
class TestDraftSockets(BaseZMQTestCase):
def setUp(self):
if not zmq.DRAFT_AP... |
base/site-packages/django_qbe/urls.py | edisonlz/fastor | 285 | 4106 | <filename>base/site-packages/django_qbe/urls.py
# -*- coding: utf-8 -*-
from django.conf.urls.defaults import patterns, url
from django_qbe.exports import formats
urlpatterns = patterns('django_qbe.views',
url(r'^$', 'qbe_form', name="qbe_form"),
url(r'^js/$', 'qbe_js', name="qbe_js"),
url(r'^results/bookm... |
augment.py | docongminh/Text-Image-Augmentation-python | 217 | 4107 | # -*- coding:utf-8 -*-
# Author: RubanSeven
# import cv2
import numpy as np
# from transform import get_perspective_transform, warp_perspective
from warp_mls import WarpMLS
def distort(src, segment):
img_h, img_w = src.shape[:2]
cut = img_w // segment
thresh = cut // 3
# thresh = img_h... |
devito/passes/iet/languages/C.py | guaacoelho/devito | 199 | 4111 | from devito.ir import Call
from devito.passes.iet.definitions import DataManager
from devito.passes.iet.langbase import LangBB
__all__ = ['CBB', 'CDataManager']
class CBB(LangBB):
mapper = {
'aligned': lambda i:
'__attribute__((aligned(%d)))' % i,
'host-alloc': lambda i, j, k:
... |
donkeycar/parts/pytorch/torch_data.py | adricl/donkeycar | 1,100 | 4113 | # PyTorch
import torch
from torch.utils.data import IterableDataset, DataLoader
from donkeycar.utils import train_test_split
from donkeycar.parts.tub_v2 import Tub
from torchvision import transforms
from typing import List, Any
from donkeycar.pipeline.types import TubRecord, TubDataset
from donkeycar.pipeline.sequence ... |
tests/test_ordering.py | deepio-oc/pabot | 379 | 4131 | from robot import __version__ as ROBOT_VERSION
import sys
import tempfile
import textwrap
import unittest
import shutil
import subprocess
class PabotOrderingGroupTest(unittest.TestCase):
def setUp(self):
self.tmpdir = tempfile.mkdtemp()
def tearDown(self):
shutil.rmtree(self.tmpdir)
def ... |
models/SelectionGAN/person_transfer/tool/rm_insnorm_running_vars.py | xianjian-xie/pose-generation | 445 | 4137 | import torch
ckp_path = './checkpoints/fashion_PATN/latest_net_netG.pth'
save_path = './checkpoints/fashion_PATN_v1.0/latest_net_netG.pth'
states_dict = torch.load(ckp_path)
states_dict_new = states_dict.copy()
for key in states_dict.keys():
if "running_var" in key or "running_mean" in key:
del states_dict_new[key]... |
mistral/tests/unit/utils/test_utils.py | shubhamdang/mistral | 205 | 4170 | # Copyright 2013 - Mirantis, Inc.
# Copyright 2015 - StackStorm, Inc.
# Copyright 2015 - 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:/... |
cors/resources/cors-makeheader.py | meyerweb/wpt | 14,668 | 4186 | import json
from wptserve.utils import isomorphic_decode
def main(request, response):
origin = request.GET.first(b"origin", request.headers.get(b'origin') or b'none')
if b"check" in request.GET:
token = request.GET.first(b"token")
value = request.server.stash.take(token)
if value is n... |
demos/interactive-classifier/config.py | jepabe/Demo_earth2 | 1,909 | 4194 | #!/usr/bin/env python
"""Handles Earth Engine service account configuration."""
import ee
# The service account email address authorized by your Google contact.
# Set up a service account as described in the README.
EE_ACCOUNT = '<EMAIL>'
# The private key associated with your service account in Privacy Enhanced
# E... |
src/sqlfluff/rules/L024.py | NathanHowell/sqlfluff | 3,024 | 4198 | <gh_stars>1000+
"""Implementation of Rule L024."""
from sqlfluff.core.rules.doc_decorators import document_fix_compatible
from sqlfluff.rules.L023 import Rule_L023
@document_fix_compatible
class Rule_L024(Rule_L023):
"""Single whitespace expected after USING in JOIN clause.
| **Anti-pattern**
.. code-... |
option_c.py | wrosecrans/colormap | 231 | 4210 |
from matplotlib.colors import LinearSegmentedColormap
from numpy import nan, inf
# Used to reconstruct the colormap in viscm
parameters = {'xp': [-5.4895292543686764, 14.790571669586654, 82.5546687431056, 29.15531114139253, -4.1316769886951761, -13.002076438907238],
'yp': [-35.948168839230306, -42.27337... |
examples/resources.py | willvousden/clint | 1,230 | 4249 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import print_function
import sys
import os
sys.path.insert(0, os.path.abspath('..'))
from clint import resources
resources.init('kennethreitz', 'clint')
lorem = 'Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt... |
tests/components/airthings/test_config_flow.py | MrDelik/core | 30,023 | 4256 | <reponame>MrDelik/core<filename>tests/components/airthings/test_config_flow.py
"""Test the Airthings config flow."""
from unittest.mock import patch
import airthings
from homeassistant import config_entries
from homeassistant.components.airthings.const import CONF_ID, CONF_SECRET, DOMAIN
from homeassistant.core impor... |
src/oci/apm_traces/models/query_result_row_type_summary.py | Manny27nyc/oci-python-sdk | 249 | 4262 | <reponame>Manny27nyc/oci-python-sdk<filename>src/oci/apm_traces/models/query_result_row_type_summary.py
# coding: utf-8
# Copyright (c) 2016, 2021, Oracle and/or its affiliates. All rights reserved.
# This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.... |
jaxformer/hf/sample.py | salesforce/CodeGen | 105 | 4263 | <gh_stars>100-1000
# Copyright (c) 2022, salesforce.com, inc.
# All rights reserved.
# SPDX-License-Identifier: BSD-3-Clause
# For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/BSD-3-Clause
import os
import re
import time
import random
import argparse
import torch
from t... |
retrain_with_rotnet.py | ericdaat/self-label | 440 | 4265 | import argparse
import warnings
warnings.simplefilter("ignore", UserWarning)
import files
from tensorboardX import SummaryWriter
import os
import numpy as np
import time
import torch
import torch.optim
import torch.nn as nn
import torch.utils.data
import torchvision
import torchvision.transforms as tfs
from data impo... |
API-Reference-Code-Generator.py | sawyercade/Documentation | 116 | 4308 | import pathlib
import yaml
documentations = {"Our Platform": "QuantConnect-Platform-2.0.0.yaml",
"Alpha Streams": "QuantConnect-Alpha-0.8.yaml"}
def RequestTable(api_call, params):
writeUp = '<table class="table qc-table">\n<thead>\n<tr>\n'
writeUp += f'<th colspan="2"><code>{api_call}</code... |
test/core/024-sc4-gridftp-http/Rosetta.py | ahnitz/pegasus | 127 | 4329 | <reponame>ahnitz/pegasus
#!/usr/bin/env python3
import logging
import sys
import subprocess
from pathlib import Path
from datetime import datetime
from Pegasus.api import *
logging.basicConfig(level=logging.DEBUG)
# --- Work Dir Setup -----------------------------------------------------------
RUN_ID = "024-sc4-gri... |
ludwig/data/cache/manager.py | ludwig-ai/ludw | 970 | 4337 | import logging
import os
import re
import uuid
from pathlib import Path
from ludwig.constants import CHECKSUM, META, TEST, TRAINING, VALIDATION
from ludwig.data.cache.util import calculate_checksum
from ludwig.utils import data_utils
from ludwig.utils.fs_utils import delete, path_exists
logger = logging.getLogger(__n... |
guillotina/contrib/workflows/events.py | rboixaderg/guillotina | 173 | 4351 | from guillotina.contrib.workflows.interfaces import IWorkflowChangedEvent
from guillotina.events import ObjectEvent
from zope.interface import implementer
@implementer(IWorkflowChangedEvent)
class WorkflowChangedEvent(ObjectEvent):
"""An object has been moved"""
def __init__(self, object, workflow, action, c... |
tools/chrome_proxy/integration_tests/chrome_proxy_pagesets/html5test.py | google-ar/chromium | 2,151 | 4363 | # 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.
from common.chrome_proxy_shared_page_state import ChromeProxySharedPageState
from telemetry.page import page as page_module
from telemetry import story
cla... |
video_encoding/fields.py | fossabot/django-video-encoding | 164 | 4406 | from django.db.models.fields.files import (FieldFile, ImageField,
ImageFileDescriptor)
from django.utils.translation import ugettext as _
from .backends import get_backend_class
from .files import VideoFile
class VideoFileDescriptor(ImageFileDescriptor):
pass
class Vi... |
dialogue-engine/test/programytest/config/brain/test_oob.py | cotobadesign/cotoba-agent-oss | 104 | 4415 | """
Copyright (c) 2020 COTOBA DESIGN, Inc.
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, merge, publish, distri... |
widgets/datepicker_ctrl/codegen.py | RSabet/wxGlade | 225 | 4438 | """\
Code generator functions for wxDatePickerCtrl objects
@copyright: 2002-2007 <NAME>
@copyright: 2014-2016 <NAME>
@copyright: 2016-2021 <NAME>
@license: MIT (see LICENSE.txt) - THIS PROGRAM COMES WITH NO WARRANTY
"""
import common, compat
import wcodegen
class PythonDatePickerCtrlGenerator(wcodegen.PythonWidgetC... |
tests/checks/run_performance_tests.py | stjordanis/mljar-supervised | 1,882 | 4442 | import os
import sys
import unittest
from tests.tests_bin_class.test_performance import *
if __name__ == "__main__":
unittest.main()
|
tests/unit/small_text/integrations/pytorch/test_strategies.py | chschroeder/small-text | 218 | 4451 | <reponame>chschroeder/small-text<filename>tests/unit/small_text/integrations/pytorch/test_strategies.py
import unittest
import pytest
from small_text.integrations.pytorch.exceptions import PytorchNotFoundError
try:
from small_text.integrations.pytorch.query_strategies import (
BADGE,
ExpectedGrad... |
pymterm/colour/tango.py | stonewell/pymterm | 102 | 4452 | <gh_stars>100-1000
TANGO_PALLETE = [
'2e2e34343636',
'cccc00000000',
'4e4e9a9a0606',
'c4c4a0a00000',
'34346565a4a4',
'757550507b7b',
'060698989a9a',
'd3d3d7d7cfcf',
'555557575353',
'efef29292929',
'8a8ae2e23434',
'fcfce9e94f4f',
'72729f9fcfcf',
'adad... |
examples/django_mongoengine/bike/models.py | pfrantz/graphene-mongo | 260 | 4456 | <filename>examples/django_mongoengine/bike/models.py
from mongoengine import Document
from mongoengine.fields import (
FloatField,
StringField,
ListField,
URLField,
ObjectIdField,
)
class Shop(Document):
meta = {"collection": "shop"}
ID = ObjectIdField()
name = StringField()
addres... |
pyxley/charts/plotly/base.py | snowind/pyxley | 2,536 | 4463 |
from ..charts import Chart
from flask import jsonify, request
_BASE_CONFIG = {
"showLink": False,
"displaylogo": False,
"modeBarButtonsToRemove": ["sendDataToCloud"]
}
class PlotlyAPI(Chart):
""" Base class for Plotly.js API
This class is used to create charts using the plotly.js api
... |
Lib/test/test_runpy.py | arvindm95/unladen-swallow | 2,293 | 4467 | # Test the runpy module
import unittest
import os
import os.path
import sys
import tempfile
from test.test_support import verbose, run_unittest, forget
from runpy import _run_code, _run_module_code, run_module
# Note: This module can't safely test _run_module_as_main as it
# runs its tests in the current process, whic... |
mmdet/ops/dcn/__init__.py | TJUsym/TJU_Advanced_CV_Homework | 1,158 | 4471 | <reponame>TJUsym/TJU_Advanced_CV_Homework
from .functions.deform_conv import deform_conv, modulated_deform_conv
from .functions.deform_pool import deform_roi_pooling
from .modules.deform_conv import (DeformConv, ModulatedDeformConv,
DeformConvPack, ModulatedDeformConvPack)
from .module... |
.modules/.theHarvester/discovery/twittersearch.py | termux-one/EasY_HaCk | 1,103 | 4486 | import string
import requests
import sys
import myparser
import re
class search_twitter:
def __init__(self, word, limit):
self.word = word.replace(' ', '%20')
self.results = ""
self.totalresults = ""
self.server = "www.google.com"
self.hostname = "www.google.com"
s... |
tests/basics/generator_pend_throw.py | iotctl/pycopy | 663 | 4493 | def gen():
i = 0
while 1:
yield i
i += 1
g = gen()
try:
g.pend_throw
except AttributeError:
print("SKIP")
raise SystemExit
print(next(g))
print(next(g))
g.pend_throw(ValueError())
v = None
try:
v = next(g)
except Exception as e:
print("raised", repr(e))
print("ret was:"... |
lib/roi_data/loader.py | BarneyQiao/pcl.pytorch | 233 | 4511 | import math
import numpy as np
import numpy.random as npr
import torch
import torch.utils.data as data
import torch.utils.data.sampler as torch_sampler
from torch.utils.data.dataloader import default_collate
from torch._six import int_classes as _int_classes
from core.config import cfg
from roi_data.minibatch import ... |
Bindings/Python/examples/Moco/examplePredictAndTrack.py | mcx/opensim-core | 532 | 4518 | <reponame>mcx/opensim-core
# -------------------------------------------------------------------------- #
# OpenSim Moco: examplePredictAndTrack.py #
# -------------------------------------------------------------------------- #
# Copyright (c) 2018 Stanford University and the Authors... |
tests/syntax/missing_in_with_for.py | matan-h/friendly | 287 | 4529 | <filename>tests/syntax/missing_in_with_for.py
for x range(4):
print(x)
|
tests/factories.py | luzik/waliki | 324 | 4535 | <reponame>luzik/waliki<filename>tests/factories.py
import factory
from django.contrib.auth.models import User, Group, Permission
from waliki.models import ACLRule, Page, Redirect
class UserFactory(factory.django.DjangoModelFactory):
username = factory.Sequence(lambda n: u'user{0}'.format(n))
password = factor... |
nxt_editor/commands.py | dalteocraft/nxt_editor | 131 | 4536 | # Built-in
import copy
import logging
import time
# External
from Qt.QtWidgets import QUndoCommand
# Internal
from nxt_editor import colors
from nxt_editor import user_dir
from nxt import nxt_path
from nxt.nxt_layer import LAYERS, SAVE_KEY
from nxt.nxt_node import (INTERNAL_ATTRS, META_ATTRS, get_node_as_dict,
... |
premium/backend/src/baserow_premium/api/admin/dashboard/views.py | cjh0613/baserow | 839 | 4553 | <reponame>cjh0613/baserow
from datetime import timedelta
from django.contrib.auth import get_user_model
from drf_spectacular.utils import extend_schema
from rest_framework.response import Response
from rest_framework.permissions import IsAdminUser
from rest_framework.views import APIView
from baserow.api.decorators... |
lib/networks/Resnet50_train.py | yangxue0827/TF_Deformable_Net | 193 | 4570 | <reponame>yangxue0827/TF_Deformable_Net
# --------------------------------------------------------
# TFFRCNN - Resnet50
# Copyright (c) 2016
# Licensed under The MIT License [see LICENSE for details]
# Written by miraclebiu
# --------------------------------------------------------
import tensorflow as tf
from .networ... |
lib/aws_sso_lib/assignments.py | vdesjardins/aws-sso-util | 330 | 4571 | import re
import numbers
import collections
import logging
from collections.abc import Iterable
import itertools
import aws_error_utils
from .lookup import Ids, lookup_accounts_for_ou
from .format import format_account_id
LOGGER = logging.getLogger(__name__)
_Context = collections.namedtuple("_Context", [
"sess... |
tensorhive/config.py | roscisz/TensorHive | 129 | 4588 | from pathlib import PosixPath
import configparser
from typing import Dict, Optional, Any, List
from inspect import cleandoc
import shutil
import tensorhive
import os
import logging
log = logging.getLogger(__name__)
class CONFIG_FILES:
# Where to copy files
# (TensorHive tries to load these by default)
con... |
ML/Pytorch/more_advanced/Seq2Seq/seq2seq.py | xuyannus/Machine-Learning-Collection | 3,094 | 4590 | <filename>ML/Pytorch/more_advanced/Seq2Seq/seq2seq.py<gh_stars>1000+
import torch
import torch.nn as nn
import torch.optim as optim
from torchtext.datasets import Multi30k
from torchtext.data import Field, BucketIterator
import numpy as np
import spacy
import random
from torch.utils.tensorboard import SummaryWriter # ... |
test/examples/integrated/codec/vip/vip_agent.py | rodrigomelo9/uvm-python | 140 | 4618 | <gh_stars>100-1000
#//
#// -------------------------------------------------------------
#// Copyright 2011 Synopsys, Inc.
#// Copyright 2019-2020 <NAME> (tpoikela)
#// All Rights Reserved Worldwide
#//
#// Licensed under the Apache License, Version 2.0 (the
#// "License"); you may not use this file ex... |
lib/django-0.96/django/views/generic/list_detail.py | MiCHiLU/google_appengine_sdk | 790 | 4626 | from django.template import loader, RequestContext
from django.http import Http404, HttpResponse
from django.core.xheaders import populate_xheaders
from django.core.paginator import ObjectPaginator, InvalidPage
from django.core.exceptions import ObjectDoesNotExist
def object_list(request, queryset, paginate_by=None, p... |
ghostwriter/rolodex/apps.py | bbhunter/Ghostwriter | 601 | 4674 | """This contains the configuration of the Rolodex application."""
# Django Imports
from django.apps import AppConfig
class RolodexConfig(AppConfig):
name = "ghostwriter.rolodex"
def ready(self):
try:
import ghostwriter.rolodex.signals # noqa F401 isort:skip
except ImportError:
... |
src/foremast/validate.py | dnava013/foremast | 157 | 4690 | <gh_stars>100-1000
"""Spinnaker validate functions."""
import logging
from .consts import API_URL
from .utils.credentials import get_env_credential
LOG = logging.getLogger(__name__)
def validate_gate():
"""Check Gate connection."""
try:
credentials = get_env_credential()
LOG.debug('Found cre... |
clarifai/rest/grpc/custom_converters/custom_message_to_dict.py | Taik/clarifai-python | 322 | 4696 | <reponame>Taik/clarifai-python
import typing # noqa
from google.protobuf import descriptor
from google.protobuf.json_format import _IsMapEntry, _Printer
from google.protobuf.message import Message # noqa
from clarifai.rest.grpc.proto.clarifai.api.utils import extensions_pb2
def protobuf_to_dict(object_protobuf, u... |
download.py | JamesWang007/Open3D-PointNet | 120 | 4702 | <reponame>JamesWang007/Open3D-PointNet<gh_stars>100-1000
#!/usr/bin/env python3
# Copyright (c) 2017 Computer Vision Center (CVC) at the Universitat Autonoma de
# Barcelona (UAB).
#
# This work is licensed under the terms of the MIT license.
# For a copy, see <https://opensource.org/licenses/MIT>.
"""Download big fil... |
tests/test_models/test_backbones/test_encoder_decoders/test_deepfill_encoder.py | Jian137/mmediting-1 | 1,884 | 4711 | <gh_stars>1000+
# Copyright (c) OpenMMLab. All rights reserved.
import torch
from mmedit.models.backbones import ContextualAttentionNeck, DeepFillEncoder
from mmedit.models.common import SimpleGatedConvModule
def test_deepfill_enc():
encoder = DeepFillEncoder()
x = torch.randn((2, 5, 256, 256))
outputs =... |
vmca/python/get_cert.py | wfu8/lightwave | 357 | 4724 | <gh_stars>100-1000
#!/usr/bin/env python
#
# Copyright © 2012-2016 VMware, 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... |
sdk/python/pulumi_gcp/securitycenter/notification_config.py | sisisin/pulumi-gcp | 121 | 4725 | <filename>sdk/python/pulumi_gcp/securitycenter/notification_config.py
# 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 i... |
unittests/tools/test_intsights_parser.py | M-Rod101/django-DefectDojo | 249 | 4732 | from ..dojo_test_case import DojoTestCase
from dojo.models import Test
from dojo.tools.intsights.parser import IntSightsParser
class TestIntSightsParser(DojoTestCase):
def test_intsights_parser_with_one_critical_vuln_has_one_findings_json(
self):
testfile = open("unittests/scans/intsights/ints... |
SymbolExtractorAndRenamer/lldb/packages/Python/lldbsuite/test/lang/cpp/class_types/TestClassTypesDisassembly.py | Polidea/SiriusObfuscator | 427 | 4741 | <gh_stars>100-1000
"""
Test the lldb disassemble command on each call frame when stopped on C's ctor.
"""
from __future__ import print_function
import os
import time
import lldb
from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
from lldbsuite.test import lldbutil
class IterateFrameAndDi... |
scalability/tests/test_misc.py | ggreif/ic | 941 | 4754 | import unittest
from unittest import TestCase
from misc import verify
class TestVerify(TestCase):
"""Tests misc.py verifies function."""
def test_verify__with_zero_threshold_and_expected_succeeds(self):
"""Test passes when expected rate, actual rate and threshold are all zero."""
result = ve... |
runtime/Python3/src/antlr4/dfa/DFASerializer.py | maximmenshikov/antlr4 | 11,811 | 4771 | #
# Copyright (c) 2012-2017 The ANTLR Project. All rights reserved.
# Use of this file is governed by the BSD 3-clause license that
# can be found in the LICENSE.txt file in the project root.
#/
# A DFA walker that knows how to dump them to serialized strings.#/
from io import StringIO
from antlr4 import DFA
from antl... |
hierarchical_foresight/env/environment.py | deepneuralmachine/google-research | 23,901 | 4780 | <gh_stars>1000+
# coding=utf-8
# Copyright 2021 The Google Research 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 requ... |
contrib/micronet/scripts/file2buf.py | pmalhaire/WireHub | 337 | 4784 | <reponame>pmalhaire/WireHub
#!/usr/bin/env python3
import os
import sys
MAX = 8
fpath = sys.argv[1]
name = sys.argv[2]
with open(fpath, "rb") as fh:
sys.stdout.write("char %s[] = {" % (name,) )
i = 0
while True:
if i > 0:
sys.stdout.write(", ")
if i % MAX == 0:
... |
braintree/account_updater_daily_report.py | futureironman/braintree_python | 182 | 4789 | from braintree.configuration import Configuration
from braintree.resource import Resource
class AccountUpdaterDailyReport(Resource):
def __init__(self, gateway, attributes):
Resource.__init__(self, gateway, attributes)
if "report_url" in attributes:
self.report_url = attributes.pop("re... |
kafka/structs.py | informatique-cdc/kafka-python | 4,389 | 4795 | """ Other useful structs """
from __future__ import absolute_import
from collections import namedtuple
"""A topic and partition tuple
Keyword Arguments:
topic (str): A topic name
partition (int): A partition id
"""
TopicPartition = namedtuple("TopicPartition",
["topic", "partition"])
"""A Kafka broker... |
Notebooks/SentinelUtilities/SentinelAnomalyLookup/__init__.py | ytognder/Azure-Sentinel | 266 | 4806 | # pylint: disable-msg=C0103
"""
SentinelAnomalyLookup: This package is developed for Azure Sentinel Anomaly lookup
"""
# __init__.py
from .anomaly_lookup_view_helper import AnomalyLookupViewHelper
from .anomaly_finder import AnomalyQueries, AnomalyFinder
|
src/extractors/emojiextractor.py | chmduquesne/rofimoji | 574 | 4819 | import html
from collections import namedtuple
from pathlib import Path
from typing import List, Dict
import requests
from bs4 import BeautifulSoup
from lxml import etree
from lxml.etree import XPath
Emoji = namedtuple('Emoji', 'char name')
class EmojiExtractor(object):
def __init__(self):
self.all_emo... |
PhysicsTools/PatAlgos/python/producersLayer1/pfParticleProducer_cfi.py | ckamtsikis/cmssw | 852 | 4825 | <filename>PhysicsTools/PatAlgos/python/producersLayer1/pfParticleProducer_cfi.py
import FWCore.ParameterSet.Config as cms
patPFParticles = cms.EDProducer("PATPFParticleProducer",
# General configurables
pfCandidateSource = cms.InputTag("noJet"),
# MC matching configurables
addGenMatch = cms.bool(False... |
tests/test_api.py | ines/spacy-js | 141 | 4826 | <filename>tests/test_api.py
# coding: utf8
from __future__ import unicode_literals
import pytest
import spacy
import json
from api.server import parse, doc2json, load_model
@pytest.fixture(scope="session")
def model():
return "en_core_web_sm"
@pytest.fixture(scope="session")
def text():
return "This is a ... |
cocos2d/tools/coding-style/tailing-spaces.py | NIKEA-SOFT/TestGame | 898 | 4838 | #!/usr/bin/env python
#coding=utf-8
'''
Remove tailing whitespaces and ensures one and only one empty ending line.
'''
import os, re
def scan(*dirs, **kwargs):
files = []
extensions = kwargs['extensions'] if kwargs.has_key('extensions') else None
excludes = kwargs['excludes'] if kwargs.has_key('excludes') else... |
generate/lib/run-firefox/firefox_runner.py | flamencist/browser-extensions | 102 | 4841 | <reponame>flamencist/browser-extensions
import os
import shutil
import codecs
import json
from cuddlefish.runner import run_app
from cuddlefish.rdf import RDFManifest
def run():
original_harness_options = os.path.join('development', 'firefox', 'harness-options.json')
backup_harness_options = os.path.join('developme... |
src/oci/log_analytics/models/log_analytics_association.py | Manny27nyc/oci-python-sdk | 249 | 4856 | # coding: utf-8
# Copyright (c) 2016, 2021, Oracle and/or its affiliates. All rights reserved.
# This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may c... |
mmcls/models/utils/se_layer.py | YuxinZou/mmclassification | 1,190 | 4867 | <gh_stars>1000+
# Copyright (c) OpenMMLab. All rights reserved.
import mmcv
import torch.nn as nn
from mmcv.cnn import ConvModule
from mmcv.runner import BaseModule
from .make_divisible import make_divisible
class SELayer(BaseModule):
"""Squeeze-and-Excitation Module.
Args:
channels (int): The input... |
core/recognizer.py | awen1988/yry | 129 | 4870 | """
recognize face landmark
"""
import json
import os
import requests
import numpy as np
FACE_POINTS = list(range(0, 83))
JAW_POINTS = list(range(0, 19))
LEFT_EYE_POINTS = list(range(19, 29))
LEFT_BROW_POINTS = list(range(29, 37))
MOUTH_POINTS = list(range(37, 55))
NOSE_POINTS = list(range(55, 65))
RIGHT_EYE_POINTS =... |
src/promnesia/sources/telegram.py | halhenke/promnesia | 1,327 | 4877 | <reponame>halhenke/promnesia<filename>src/promnesia/sources/telegram.py
'''
Uses [[https://github.com/fabianonline/telegram_backup#readme][telegram_backup]] database for messages data
'''
from pathlib import Path
from textwrap import dedent
from typing import Optional, Union, TypeVar
from urllib.parse import unquote #... |
ngraph/test/frontend/paddlepaddle/test_models/gen_scripts/generate_slice.py | monroid/openvino | 2,406 | 4887 | <reponame>monroid/openvino
#
# slice paddle model generator
#
import numpy as np
from save_model import saveModel
import paddle as pdpd
import sys
data_type = 'float32'
def slice(name : str, x, axes : list, start : list, end : list):
pdpd.enable_static()
with pdpd.static.program_guard(pdpd.static.Program(), ... |
tacker/sol_refactored/common/vnf_instance_utils.py | h1r0mu/tacker | 116 | 4888 | # Copyright (C) 2021 Nippon Telegraph and Telephone Corporation
# 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/LICE... |
old_py2/tests/models_tests/notifications/test_match_score.py | ofekashery/the-blue-alliance | 266 | 4890 | <reponame>ofekashery/the-blue-alliance<filename>old_py2/tests/models_tests/notifications/test_match_score.py<gh_stars>100-1000
import re
import unittest2
from google.appengine.ext import ndb
from google.appengine.ext import testbed
from consts.notification_type import NotificationType
from helpers.event.event_test_cr... |
configs/mobilenet_cfbi.py | yoxu515/CFBI | 312 | 4902 | import torch
import argparse
import os
import sys
import cv2
import time
class Configuration():
def __init__(self):
self.EXP_NAME = 'mobilenetv2_cfbi'
self.DIR_ROOT = './'
self.DIR_DATA = os.path.join(self.DIR_ROOT, 'datasets')
self.DIR_DAVIS = os.path.join(self.DIR_DATA, 'DAVIS'... |
tools/jdk/local_java_repository.bzl | loongarch64/bazel | 16,989 | 4905 | <reponame>loongarch64/bazel
# Copyright 2020 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
#
# Unle... |
tensorflow/contrib/metrics/__init__.py | DEVESHTARASIA/tensorflow | 384 | 4925 | # 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... |
eth/vm/forks/petersburg/blocks.py | ggs134/py-evm | 1,641 | 4943 | <reponame>ggs134/py-evm
from rlp.sedes import (
CountableList,
)
from eth.rlp.headers import (
BlockHeader,
)
from eth.vm.forks.byzantium.blocks import (
ByzantiumBlock,
)
from .transactions import (
PetersburgTransaction,
)
class PetersburgBlock(ByzantiumBlock):
transaction_builder = PetersburgT... |
numba/stencils/stencil.py | auderson/numba | 6,620 | 4959 | <reponame>auderson/numba<filename>numba/stencils/stencil.py<gh_stars>1000+
#
# Copyright (c) 2017 Intel Corporation
# SPDX-License-Identifier: BSD-2-Clause
#
import copy
import numpy as np
from llvmlite import ir as lir
from numba.core import types, typing, utils, ir, config, ir_utils, registry
from numba.core.typin... |
runway/core/providers/__init__.py | troyready/runway | 134 | 4963 | """Runway providers."""
|
demos/restful-users/index.py | karldoenitz/karlooper | 161 | 4972 | # -*-encoding:utf-8-*-
import os
from karlooper.web.application import Application
from karlooper.web.request import Request
class UsersHandler(Request):
def get(self):
return self.render("/user-page.html")
class UserInfoHandler(Request):
def post(self):
print(self.get_http_request_message(... |
conans/server/server_launcher.py | Wonders11/conan | 6,205 | 4991 | <gh_stars>1000+
from conans.server.launcher import ServerLauncher
from conans.util.env_reader import get_env
launcher = ServerLauncher(server_dir=get_env("CONAN_SERVER_HOME"))
app = launcher.server.root_app
def main(*args):
launcher.launch()
if __name__ == "__main__":
main()
|
sdk/videoanalyzer/azure-mgmt-videoanalyzer/azure/mgmt/videoanalyzer/models/_models.py | praveenkuttappan/azure-sdk-for-python | 2,728 | 4992 | <filename>sdk/videoanalyzer/azure-mgmt-videoanalyzer/azure/mgmt/videoanalyzer/models/_models.py
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root fo... |
codigo_das_aulas/aula_09/aula_09_03.py | VeirichR/curso-python-selenium | 234 | 5017 | from functools import partial
from selenium.webdriver import Firefox
from selenium.webdriver.support.ui import (
WebDriverWait
)
def esperar_elemento(elemento, webdriver):
print(f'Tentando encontrar "{elemento}"')
if webdriver.find_elements_by_css_selector(elemento):
return True
return False
... |
env/lib/python3.6/site-packages/odf/meta.py | anthowen/duplify | 5,079 | 5051 | # -*- coding: utf-8 -*-
# Copyright (C) 2006-2007 <NAME>, European Environment Agency
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your op... |
flametree/utils.py | Edinburgh-Genome-Foundry/Flametree | 165 | 5056 | <gh_stars>100-1000
import os
import shutil
from .ZipFileManager import ZipFileManager
from .DiskFileManager import DiskFileManager
from .Directory import Directory
import string
printable = set(string.printable) - set("\x0b\x0c")
def is_hex(s):
return any(c not in printable for c in s)
def file_tree(target, ... |
scripts/kconfig-split.py | Osirium/linuxkit | 7,798 | 5089 | <reponame>Osirium/linuxkit<gh_stars>1000+
#!/usr/bin/env python
# This is a slightly modified version of ChromiumOS' splitconfig
# https://chromium.googlesource.com/chromiumos/third_party/kernel/+/stabilize-5899.B-chromeos-3.14/chromeos/scripts/splitconfig
"""See this page for more details:
http://dev.chromium.org/ch... |
plugins/Operations/Crypto/blowfish_encrypt_dialog.py | nmantani/FileInsight-plugins | 120 | 5092 | <filename>plugins/Operations/Crypto/blowfish_encrypt_dialog.py
#
# Blowfish encrypt - Encrypt selected region with Blowfish
#
# Copyright (c) 2019, <NAME>
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following condit... |
tools/lib/auth.py | shoes22/openpilot | 121 | 5097 | #!/usr/bin/env python3
"""
Usage::
usage: auth.py [-h] [{google,apple,github,jwt}] [jwt]
Login to your comma account
positional arguments:
{google,apple,github,jwt}
jwt
optional arguments:
-h, --help show this help message and exit
Examples::
./auth.py # Log in with google accou... |
src/xmltollvm.py | Tejvinder/thesis-ghidra | 101 | 5112 | from llvmlite import ir
import xml.etree.ElementTree as et
int32 = ir.IntType(32)
int64 = ir.IntType(64)
int1 = ir.IntType(1)
void_type = ir.VoidType()
function_names = []
registers, functions, uniques, extracts = {}, {}, {}, {}
internal_functions = {}
memory = {}
flags = ["ZF", "CF", "OF", "SF"]
pointers = ["RSP", "R... |
example/shovel/bar.py | demiurgestudios/shovel | 202 | 5123 | from shovel import task
@task
def hello(name='Foo'):
'''Prints "Hello, " followed by the provided name.
Examples:
shovel bar.hello
shovel bar.hello --name=Erin
http://localhost:3000/bar.hello?Erin'''
print('Hello, %s' % name)
@task
def args(*args):
'''Echos back all the ar... |
scripts/external_libs/scapy-2.4.3/scapy/config.py | timgates42/trex-core | 956 | 5124 | # This file is part of Scapy
# See http://www.secdev.org/projects/scapy for more information
# Copyright (C) <NAME> <<EMAIL>>
# This program is published under a GPLv2 license
"""
Implementation of the configuration object.
"""
from __future__ import absolute_import
from __future__ import print_function
import functo... |
tools/ldbc_benchmark/neo4j/load_scripts/time_index.py | carlboudreau007/ecosys | 245 | 5132 | from datetime import datetime
with open('/home/neo4j/neo4j-community-3.5.1/logs/debug.log', 'r') as log:
begin = []
end = []
for line in log:
if 'Index population started' in line:
begin.append(line[:23])
elif 'Index creation finished' in line:
end.append(line[:23])
if len(begin) == 0 or le... |
examples/pybullet/gym/pybullet_envs/minitaur/envs/env_randomizers/minitaur_terrain_randomizer.py | felipeek/bullet3 | 9,136 | 5145 | """Generates a random terrain at Minitaur gym environment reset."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os, inspect
currentdir = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe())))
parentdir = os.path.dirname(os.path... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.