max_stars_repo_path string | max_stars_repo_name string | max_stars_count int64 | id string | content string | add_param_types int64 | add_return_types int64 | add_class_field_types int64 | add_instance_field_types int64 | add_total int64 | add_error int64 |
|---|---|---|---|---|---|---|---|---|---|---|
dev/scripts/diagrams_nodes.py | baajur/airflow-diagrams | 128 | 1694458 | <reponame>baajur/airflow-diagrams<filename>dev/scripts/diagrams_nodes.py
"""
Helper script to output available diagram nodes.
"""
import ast
import json
import os
from operator import itemgetter
import diagrams
def find_nodes(directory_name):
_nodes = []
for root, _, files in os.walk(os.path.dirname(director... | 0 | 0 | 0 | 0 | 0 | 0 |
pyathena/model.py | l1x/PyAthena | 363 | 1694459 | # -*- coding: utf-8 -*-
import logging
from datetime import datetime
from typing import Any, Dict, Optional
from pyathena.error import DataError
_logger = logging.getLogger(__name__) # type: ignore
class AthenaQueryExecution(object):
STATE_QUEUED: str = "QUEUED"
STATE_RUNNING: str = "RUNNING"
STATE_SU... | 3 | 22 | 17 | 19 | 61 | 0 |
src/adafruit_blinka/board/beagleboard/beaglev_starlight.py | twa127/Adafruit_Blinka | 294 | 1694460 | """Pin definitions for the BeagleV StarLight."""
from adafruit_blinka.microcontroller.starfive.JH71x0 import pin
D0 = pin.D0
D1 = pin.D1
SDA = pin.I2C2_SDA
SCL = pin.I2C2_SCL
D4 = pin.D4
D5 = pin.D5
D6 = pin.D6
D7 = pin.D7
CE1 = pin.D7
D8 = pin.D8
CE0 = pin.D8
D9 = pin.D9
MISO = pin.SPI_MISO
D10 = pin.D10
MOSI = p... | 0 | 0 | 0 | 0 | 0 | 0 |
pymterm/session/ssh_session.py | stonewell/pymterm | 102 | 1694476 | <reponame>stonewell/pymterm
import logging
import os
import socket
import stat
import sys
import threading
import time
import paramiko
import client.ssh_client
from session import Session
class SSHSession(Session):
def __init__(self, cfg, terminal):
super(SSHSession, self).__init__(cfg, ... | 0 | 0 | 0 | 0 | 0 | 0 |
packages/core/minos-microservice-common/tests/test_common/test_config/test_v2/test_with_env.py | bhardwajRahul/minos-python | 247 | 1694499 | <reponame>bhardwajRahul/minos-python
import os
import unittest
from unittest import (
mock,
)
from minos.common import (
ConfigV2,
)
from tests.utils import (
BASE_PATH,
)
class TestConfigV2WithEnvironment(unittest.TestCase):
def setUp(self) -> None:
self.file_path = BASE_PATH / "config" / "v... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/resources/common/download_htmls.py | come2ry/atcoder-tools | 313 | 1694501 | #!/usr/bin/python3
# -*- coding: utf-8 -*-
import errno
import os
from atcodertools.client.atcoder import AtCoderClient
class NoPatternFoundError(Exception):
pass
atcoder = AtCoderClient()
def mkdirs(path):
try:
os.makedirs(path)
except OSError as exc:
if exc.errno == errno.EEXIST and... | 0 | 0 | 0 | 0 | 0 | 0 |
tools/redis_import/test.py | abeusher/ledisdb | 2,669 | 1694514 | <filename>tools/redis_import/test.py
#coding: utf-8
import random, string
import redis
import ledis
from redis_import import copy, scan, set_ttl
rds = redis.Redis()
lds = ledis.Ledis(port=6380)
def random_word(words, length):
return ''.join(random.choice(words) for i in range(length))
def get_words():
w... | 0 | 0 | 0 | 0 | 0 | 0 |
socialoauth/sites/kaixin.py | oncereply/social-oauth | 102 | 1694519 | <gh_stars>100-1000
# -*- coding: utf-8 -*-
from socialoauth.sites.base import OAuth2
class KaiXin(OAuth2):
AUTHORIZE_URL = 'http://api.kaixin001.com/oauth2/authorize'
ACCESS_TOKEN_URL = 'https://api.kaixin001.com/oauth2/access_token'
API_URL_PREFIX = 'https://api.kaixin001.com'
def build_api_url(s... | 0 | 0 | 0 | 0 | 0 | 0 |
mongoaudit/tools.py | security-geeks/mongoaudit | 1,319 | 1694543 | # -*- coding: utf-8 -*-
from __future__ import annotations
import json
import os
import sys
try:
# For Python 3.0 and later
from urllib import parse
from urllib.request import urlopen, HTTPError, URLError, Request
except ImportError:
# Fall back to Python 2's urllib2
from urllib2 import urlopen, HTT... | 0 | 12 | 0 | 0 | 12 | 0 |
python/torch_mlir_e2e_test/torchscript/annotations.py | anupgangwar/torch-mlir | 213 | 1694558 | # Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
# See https://llvm.org/LICENSE.txt for license information.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
# Also available under a BSD-style license. See LICENSE.
from typing import List, Optional, Tuple, NamedTuple
import tor... | 1 | 3 | 0 | 0 | 4 | 0 |
tf_object_detection/utils.py | AndresGarciaEscalante/bstld | 148 | 1694566 | from __future__ import annotations
"""
List of quick helper functions
"""
import os
LOWER_IMAGE_EXTENSIONS = ['.jpg', '.jpeg', '.png', '.bmp', '.pgm', '.ppm', '.gif']
IMAGE_EXTENSIONS = LOWER_IMAGE_EXTENSIONS + list(map(lambda x: x.upper(), LOWER_IMAGE_EXTENSIONS))
def ir(some_value) -> object:
""" Because open... | 0 | 6 | 0 | 0 | 6 | 0 |
GP/Assets/code/extensions/KeyframeEditor.py | EnviralDesign/GeoPix | 134 | 1694611 | <filename>GP/Assets/code/extensions/KeyframeEditor.py
'''
ANIMATION EDITOR
'''
import copy
from TDStoreTools import StorageManager
TDF = op.TDModules.mod.TDFunctions
class Helper:
def __init__(self, ownerComp):
# The component to which this extension is attached
self.ownerComp = ownerComp
self.StartStopCho... | 0 | 0 | 0 | 0 | 0 | 0 |
programs/pyeos/tests/python/cryptokitties/clockauction.py | learnforpractice/pyeos | 144 | 1694691 | <gh_stars>100-1000
from backend import *
from basement import *
#from pausable import Pausable
from pausable import *
from clockauctionbase import ClockAuctionBase
from erc721 import ERC721
from auction import Auction
# @title Clock auction for non-fungible tokens.
# @notice We omit a fallback function to prevent acci... | 0 | 0 | 0 | 0 | 0 | 0 |
tool/pipe_join.py | y0ssar1an/CSS3 | 192 | 1694720 | <filename>tool/pipe_join.py<gh_stars>100-1000
import sublime_plugin
class ReversePipeJoinMultilineCommand(sublime_plugin.TextCommand):
def run(self, edit):
"""
BEFORE
blue
red
green
purple
orange
yellow
AFTER
... | 0 | 0 | 0 | 0 | 0 | 0 |
ckg/report_manager/apps/importsApp.py | igg-bioinfo/CKG | 189 | 1694725 | <filename>ckg/report_manager/apps/importsApp.py<gh_stars>100-1000
import os
from ckg import ckg_utils
from ckg.report_manager.apps import basicApp
from ckg.report_manager.apps import imports
from ckg.analytics_core.viz import viz
class ImportsApp(basicApp.BasicApp):
"""
Defines what the imports App is in the ... | 0 | 0 | 0 | 0 | 0 | 0 |
python/ql/test/query-tests/Imports/deprecated/test.py | vadi2/codeql | 4,036 | 1694732 | # Some deprecated modules
import rfc822
import posixfile
# We should only report a bad import once
class Foo(object):
def foo(self):
import md5
# Backwards compatible code, should not report
try:
from hashlib import md5
except ImportError:
from md5 import md5
| 0 | 0 | 0 | 0 | 0 | 0 |
tests/datasets/test_icl.py | glebshevchukk/gradslam | 1,048 | 1694733 | <reponame>glebshevchukk/gradslam
import os
import logging
import unittest
from pathlib import Path
import numpy as np
import pytest
import torch
from torch.testing import assert_allclose
from torch.utils.data import DataLoader
from gradslam.datasets.icl import ICL
ICL_ROOT = "G:/Datasets/ICL"
# Tests below can only... | 0 | 0 | 0 | 0 | 0 | 0 |
RecoTracker/MkFit/python/customizeHLTIter0ToMkFit.py | malbouis/cmssw | 852 | 1694748 | import FWCore.ParameterSet.Config as cms
import RecoTracker.MkFit.mkFitGeometryESProducer_cfi as mkFitGeometryESProducer_cfi
import RecoTracker.MkFit.mkFitSiPixelHitConverter_cfi as mkFitSiPixelHitConverter_cfi
import RecoTracker.MkFit.mkFitSiStripHitConverter_cfi as mkFitSiStripHitConverter_cfi
import RecoTracker.MkF... | 0 | 1 | 0 | 0 | 1 | 0 |
irc3/plugins/logger.py | tnt4brain/irc3 | 178 | 1694754 | # -*- coding: utf-8 -*-
from __future__ import annotations
import os
import irc3
import logging
import codecs
from datetime import datetime
__doc__ = '''
================================================
:mod:`irc3.plugins.logger` Channel logger plugin
================================================
Log channels
..
... | 7 | 0 | 1 | 0 | 8 | 0 |
src/penn_chime/__init__.py | jandreu/chime | 222 | 1694764 | """Penn Chime."""
| 0 | 0 | 0 | 0 | 0 | 0 |
auto_LiRPA/bounded_tensor.py | vtu81/auto_LiRPA | 161 | 1694768 | import torch
import torch.nn as nn
from torch import Tensor as Tensor
import torch._C as _C
class BoundedTensor(Tensor):
@staticmethod
# We need to override the __new__ method since Tensor is a C class
def __new__(cls, x, ptb, *args, **kwargs):
if isinstance(x, Tensor):
tensor = super... | 0 | 0 | 0 | 0 | 0 | 1 |
airflow/providers/google/suite/transfers/local_to_drive.py | npodewitz/airflow | 8,092 | 1694772 | <filename>airflow/providers/google/suite/transfers/local_to_drive.py<gh_stars>1000+
# 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 ... | 0 | 0 | 0 | 0 | 0 | 0 |
scriptedforms/_scriptedforms_handlers.py | SimonBiggs/scripted-forms | 533 | 1694798 | <gh_stars>100-1000
# Copyright (c) Jupyter Development Team.
# Distributed under the terms of the Modified BSD License.
import os
import re
from glob import glob
from notebook.base.handlers import IPythonHandler, FileFindHandler
from notebook.utils import url_path_join as ujoin
from jinja2 import FileSystemLoader
... | 0 | 0 | 0 | 0 | 0 | 0 |
integration/tests/error_assert_newline.py | youhavethewrong/hurl | 1,013 | 1694801 | from tests import app
@app.route("/error-assert-newline")
def error_assert_newline() -> str:
return '<p>Hello</p>\n\n'
| 0 | 1 | 0 | 0 | 1 | 0 |
deprecated/training_structures/MVAE_finetune.py | kapikantzari/MultiBench | 148 | 1694805 | <reponame>kapikantzari/MultiBench
import torch
from torch import nn
from torch.utils.data import DataLoader
from torch.autograd import Variable
from torch.nn import functional as F
from torch.nn.parameter import Parameter
import math
from utils.AUPRC import AUPRC
class MVAE(nn.Module):
"""Multimodal Variational A... | 0 | 0 | 0 | 0 | 0 | 0 |
capabilities/scan/syn.py | zezomehdawii/pina-colada | 287 | 1694852 | <reponame>zezomehdawii/pina-colada<gh_stars>100-1000
from capability import *
from scapy.all import *
import time
import datetime
class syn(Capability):
def __init__(self, core):
super(syn, self).__init__(core)
self.name = "<NAME>"
self.intro = GOOD + "Using Syn Scan module..."
sel... | 0 | 0 | 0 | 0 | 0 | 0 |
DialogueGCN-mianzhang/dgcn/model/GCN.py | NouamaneTazi/conv-emotion | 488 | 1694859 | import torch.nn as nn
from torch_geometric.nn import RGCNConv, GraphConv
class GCN(nn.Module):
def __init__(self, g_dim, h1_dim, h2_dim, args):
super(GCN, self).__init__()
self.num_relations = 2 * args.n_speakers ** 2
self.conv1 = RGCNConv(g_dim, h1_dim, self.num_relations, num_bases=30)
... | 0 | 1 | 0 | 0 | 1 | 0 |
taint_analysis/unlock_checker.py | k-karakatsanis/BootStomp | 354 | 1694864 | <filename>taint_analysis/unlock_checker.py
import _coretaint
import angr
import claripy
import archinfo
import simuvex
import logging
from itertools import product, izip
from summary_functions import *
import datetime
import sys
import json
l = logging.getLogger("UnlockCheckerAnalysis")
l.setLevel("DEBUG")
arch_mappi... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/endtoend/test_eventhub_functions.py | anandagopal6/azure-functions-python-worker | 277 | 1694867 | <reponame>anandagopal6/azure-functions-python-worker<filename>tests/endtoend/test_eventhub_functions.py<gh_stars>100-1000
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.
import json
import time
from datetime import datetime
from dateutil import parser, tz
from azure_functi... | 0 | 0 | 0 | 0 | 0 | 0 |
tasks/utils.py | dtczest/syrupy | 147 | 1694872 | import os
def ctx_run(ctx, *args, **kwargs) -> object:
kwargs["pty"] = os.name == "posix"
return ctx.run(*args, **kwargs)
| 0 | 1 | 0 | 0 | 1 | 0 |
scrapy/http/request/form.py | FingerCrunch/scrapy | 41,267 | 1694896 | <filename>scrapy/http/request/form.py
"""
This module implements the FormRequest class which is a more convenient class
(than Request) to generate Requests based on form data.
See documentation in docs/topics/request-response.rst
"""
from typing import Iterable, List, Optional, Tuple, Type, TypeVar, Union
from urllib... | 0 | 0 | 0 | 0 | 0 | 0 |
src/similarity.py | aolney/dgm_latent_bow | 119 | 1694946 | <reponame>aolney/dgm_latent_bow
"""The matching model for measuring semantic similarity
based on:
https://github.com/airalcorn2/Deep-Semantic-Similarity-Model/blob/master/deep_semantic_similarity_keras.py
and the MSR paper:
A Latent Semantic Model with Convolutional-Pooling Structure for Information
Retrieval
<NAM... | 0 | 0 | 0 | 0 | 0 | 0 |
sdk/cognitiveservices/azure-cognitiveservices-search-newssearch/azure/cognitiveservices/search/newssearch/operations/_news_operations.py | rsdoherty/azure-sdk-for-python | 2,728 | 1694966 | # 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 ... | 53 | 3 | 0 | 1 | 57 | 0 |
tests/bench/bench.py | learnforpractice/micropython-cpp | 692 | 1694975 | <gh_stars>100-1000
import time
ITERS = 20000000
def run(f):
t = time.time()
f(ITERS)
t = time.time() - t
print(t)
| 0 | 0 | 0 | 0 | 0 | 0 |
fhir/resources/paymentreconciliation.py | cstoltze/fhir.resources | 144 | 1694988 | # -*- coding: utf-8 -*-
"""
Profile: http://hl7.org/fhir/StructureDefinition/PaymentReconciliation
Release: R4
Version: 4.0.1
Build ID: 9346c8cc45
Last updated: 2019-11-01T09:29:23.356+11:00
"""
import typing
from pydantic import Field, root_validator
from pydantic.error_wrappers import ErrorWrapper, ValidationError
f... | 1 | 5 | 36 | 0 | 42 | 0 |
solutions/problem_054.py | ksvr444/daily-coding-problem | 1,921 | 1694990 | <reponame>ksvr444/daily-coding-problem
BOARD_DIM = 9
GRID_DIM = 3
def get_grid_details(x, y):
grid_row = x - (x % GRID_DIM)
grid_col = y - (y % GRID_DIM)
return grid_row, grid_col
def solveSudokuHelper(board, row_elements, col_elements, grid_elements):
for i in range(BOARD_DIM):
for k in ra... | 0 | 0 | 0 | 0 | 0 | 0 |
mindmeld/components/request.py | Zozman/mindmeld | 580 | 1695020 | <gh_stars>100-1000
# -*- coding: utf-8 -*-
#
# Copyright (c) 2015 Cisco Systems, Inc. and others. 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.o... | 0 | 0 | 0 | 0 | 0 | 0 |
graphgym/custom_graphgym/optimizer/example.py | NucciTheBoss/pytorch_geometric | 2,350 | 1695043 | <reponame>NucciTheBoss/pytorch_geometric
from typing import Iterator
from torch.nn import Parameter
from torch.optim import Adagrad, Optimizer
from torch.optim.lr_scheduler import ReduceLROnPlateau
import torch_geometric.graphgym.register as register
@register.register_optimizer('adagrad')
def adagrad_optimizer(par... | 0 | 0 | 0 | 0 | 0 | 0 |
.ipynb_checkpoints/models-checkpoint.py | linda-huang/SEAL_OGB | 121 | 1695047 | # Copyright (c) Facebook, Inc. and its affiliates.
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
from __future__ import annotations
import math
import numpy as np
import torch
from torch.nn import (ModuleList, Linear, Conv1d, MaxPool1d, Embe... | 29 | 4 | 0 | 0 | 33 | 0 |
crawler/cdi/dochealthcheck_config.py | gaybro8777/CiteSeerX | 108 | 1695050 | <gh_stars>100-1000
# Django setting module
django_settings_module = 'settings'
# directory where output files are saved (add the "/")
outputdir = 'dochealthcheck/'
# repository (input directory)
inputdir = '/data/csxcrawl/repository/'
# toggle: delete from db
toggle_delete_from_db = True
# toggle: delete from reposito... | 0 | 0 | 0 | 0 | 0 | 0 |
anode/conv_models.py | gaozhihan/augmented-neural-odes | 449 | 1695060 | <filename>anode/conv_models.py
import torch
import torch.nn as nn
from anode.models import ODEBlock
from torchdiffeq import odeint, odeint_adjoint
class Conv2dTime(nn.Conv2d):
"""
Implements time dependent 2d convolutions, by appending the time variable as
an extra channel.
"""
def __init__(self, ... | 0 | 0 | 0 | 0 | 0 | 0 |
basic/movies/models.py | neechadi/django-basic-apps | 548 | 1695065 | from django.db import models
from django.db.models import permalink
from django.conf import settings
from basic.people.models import Person
class Genre(models.Model):
"""Genre model"""
title = models.CharField(max_length=100)
slug = models.SlugField(unique=True)
class Meta:
db_table: str = 'm... | 0 | 10 | 6 | 0 | 16 | 0 |
test/table_test.py | screamingskulls/sofi | 402 | 1695069 | <filename>test/table_test.py
from sofi.ui import Table
def test_basic():
assert(str(Table()) == "<table class=\"table\"></table>")
def test_striped():
assert(str(Table(striped=True)) == "<table class=\"table table-striped\"></table>")
def test_bordered():
assert(str(Table(bordered=True)) == "<table class... | 0 | 0 | 0 | 0 | 0 | 0 |
tools/deploy/aurora/api/AuroraSchedulerManager.py | bopopescu/peloton | 617 | 1695087 | <gh_stars>100-1000
#
# Autogenerated by Thrift Compiler (0.9.3)
#
# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
#
# options string: py:new_style,slots,utf8strings
#
from thrift.Thrift import TType, TMessageType, TException, TApplicationException
import aurora.api.ReadOnlyScheduler
import logging
... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/test_stamp.py | profintegra/stumpy | 2,296 | 1695107 | import numpy as np
import numpy.testing as npt
from stumpy import stamp, core
import pytest
import naive
test_data = [
(
np.array([9, 8100, -60, 7], dtype=np.float64),
np.array([584, -11, 23, 79, 1001, 0, -19], dtype=np.float64),
),
(
np.random.uniform(-1000, 1000, [8]).astype(np.fl... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/slack_bolt_async/logger/test_unmatched_suggestions.py | hirosassa/bolt-python | 504 | 1695114 | <filename>tests/slack_bolt_async/logger/test_unmatched_suggestions.py
from slack_bolt.request.async_request import AsyncBoltRequest
from slack_bolt.logger.messages import warning_unhandled_request
class TestUnmatchedPatternSuggestions:
def setup_method(self):
pass
def teardown_method(self):
p... | 0 | 0 | 0 | 0 | 0 | 0 |
texar/torch/run/executor_utils.py | qinzzz/texar-pytorch | 746 | 1695117 | <filename>texar/torch/run/executor_utils.py
# Copyright 2019 The Texar 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/LI... | 0 | 0 | 0 | 0 | 0 | 0 |
test/python/mock/test_new_qasm_backend.py | Roshan-Thomas/qiskit-terra | 1,456 | 1695121 | <filename>test/python/mock/test_new_qasm_backend.py
# This code is part of Qiskit.
#
# (C) Copyright IBM 2021.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/fixtures/standalone_script1.py | fredstro/mrq | 745 | 1695125 | <reponame>fredstro/mrq
from __future__ import print_function
from mrq.context import setup_context, run_task, get_current_config
# Autoconfigure MRQ's environment
setup_context()
print(run_task("tests.tasks.general.Add", {"a": 41, "b": 1}))
print(get_current_config()["name"]) | 0 | 0 | 0 | 0 | 0 | 0 |
test/gui_test.py | tusharsarkar3/XBNet | 167 | 1695143 | <reponame>tusharsarkar3/XBNet
import torch
import numpy as np
import pandas as pd
from sklearn.preprocessing import LabelEncoder
from sklearn.model_selection import train_test_split
from XBNet.training_utils import training,predict
from XBNet.models import XBNETClassifier
from XBNet.run import run_XBNET
from os import... | 0 | 0 | 0 | 0 | 0 | 0 |
python/tvm/meta_schedule/schedule_rule/multi_level_tiling.py | shengxinhu/tvm | 4,640 | 1695154 | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | 13 | 3 | 3 | 0 | 19 | 0 |
querybook/server/const/time.py | shivammmmm/querybook | 1,144 | 1695161 | seconds_in_a_day = 60 * 60 * 24
| 0 | 0 | 0 | 0 | 0 | 0 |
examples/query_attribute_app.py | zelogik/remi | 3,224 | 1695165 | <reponame>zelogik/remi<gh_stars>1000+
"""
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 t... | 0 | 0 | 0 | 0 | 0 | 0 |
ztag/annotations/FtpNetApp.py | justinbastress/ztag | 107 | 1695176 | <gh_stars>100-1000
from ztag.annotation import Annotation
from ztag.annotation import Manufacturer
from ztag import protocols
import ztag.test
import re
class FtpNetApp(Annotation):
name = "NetApp FTP Server"
protocol = protocols.FTP
subprotocol = protocols.FTP.BANNER
port = None
manufact_re = re... | 0 | 0 | 0 | 0 | 0 | 0 |
amadeus/shopping/availability/_flight_availabilities.py | minjikarin/amadeus-python | 125 | 1695210 | from amadeus.client.decorator import Decorator
class FlightAvailabilities(Decorator, object):
def post(self, body) -> object:
'''
Get available seats in different fare classes
.. code-block:: python
amadeus.shopping.availability.flight_availabilities.post(body)
:para... | 0 | 1 | 0 | 0 | 1 | 0 |
clip_retrieval/clip_front.py | techthiyanes/clip-retrieval | 201 | 1695219 | <reponame>techthiyanes/clip-retrieval<filename>clip_retrieval/clip_front.py
"""clip front"""
from flask import Flask, send_from_directory, request
import json
import fire
def add_static_endpoints(app, default_backend=None, default_index=None, url_column="url"):
"""add static endpoints to the flask app"""
imp... | 0 | 0 | 0 | 0 | 0 | 0 |
unfurl/repo.py | john-gaughan/unfurl | 109 | 1695221 | <reponame>john-gaughan/unfurl
# Copyright (c) 2020 <NAME>
# SPDX-License-Identifier: MIT
import os
import os.path
from pathlib import Path
import git
from git.repo.fun import is_git_dir
import logging
from six.moves.urllib.parse import urlparse
from .util import UnfurlError, save_to_file, to_text
import toscaparser.rep... | 0 | 0 | 0 | 0 | 0 | 0 |
core/trakt.py | 0x20Man/Watcher3 | 320 | 1695243 | <gh_stars>100-1000
from core.helpers import Url
from core.helpers import Comparisons
from core.library import Manage
import json
import core
import datetime
from core import searcher
import xml.etree.cElementTree as ET
import re
import logging
logging = logging.getLogger(__name__)
searcher = searcher
date_format = '... | 0 | 0 | 0 | 0 | 0 | 0 |
env/Lib/site-packages/OpenGL/GLES2/OES/sample_shading.py | 5gconnectedbike/Navio2 | 210 | 1695248 | <reponame>5gconnectedbike/Navio2
'''OpenGL extension OES.sample_shading
This module customises the behaviour of the
OpenGL.raw.GLES2.OES.sample_shading to provide a more
Python-friendly API
Overview (from the spec)
In standard multisample rendering, an implementation is allowed to
assign the same sets of fragme... | 0 | 0 | 0 | 0 | 0 | 0 |
src/genie/libs/parser/asa/tests/ShowVersion/cli/equal/golden_output2_expected.py | balmasea/genieparser | 204 | 1695255 | <reponame>balmasea/genieparser
expected_output = {
'version': {
'asa_version': '8.4(1)',
'asdm_version': '6.4(1)',
'bios_flash': 'AT49LW080 @ 0xfff00000, 1024KB',
'system_image': 'disk0:/cdisk.bin',
'boot_config_file': 'disk0:/tomm_backup.cfg',
'compiled_by': 'builder... | 0 | 0 | 0 | 0 | 0 | 0 |
causal_curve/__init__.py | ronikobrosly/causal-curve | 212 | 1695268 | <reponame>ronikobrosly/causal-curve<filename>causal_curve/__init__.py
"""causal_curve module"""
import warnings
from statsmodels.genmod.generalized_linear_model import DomainWarning
from causal_curve.gps_classifier import GPS_Classifier
from causal_curve.gps_regressor import GPS_Regressor
from causal_curve.tmle_reg... | 0 | 0 | 0 | 0 | 0 | 0 |
dashboard/isthislegit.py | robertsimmons514/isthislegit | 282 | 1695282 | <gh_stars>100-1000
from app.report import report_blueprint
from app.views import app_blueprint
from app.api import api_blueprint
from app.ajax import ajax_blueprint
from extensions import csrf_protect
from flask import Flask, render_template
import os
app = Flask(__name__, static_url_path='/static')
#app.config['DEB... | 0 | 0 | 0 | 0 | 0 | 0 |
runtime/Python3/src/antlr4/StdinStream.py | maximmenshikov/antlr4 | 11,811 | 1695283 | import codecs
import sys
from antlr4.InputStream import InputStream
class StdinStream(InputStream):
def __init__(self, encoding:str='ascii', errors:str='strict') -> None:
bytes = sys.stdin.buffer.read()
data = codecs.decode(bytes, encoding, errors)
super().__init__(data)
| 2 | 1 | 0 | 0 | 3 | 0 |
OnePy/custom_module/api/oanda_api.py | Chandlercjy/OnePyfx | 321 | 1695284 | from __future__ import annotations
import json
import oandapyV20
import oandapyV20.endpoints.accounts as accounts
import oandapyV20.endpoints.instruments as instruments
import oandapyV20.endpoints.orders as orders
import oandapyV20.endpoints.positions as positions
import oandapyV20.endpoints.pricing as pricing
import ... | 15 | 16 | 0 | 0 | 31 | 0 |
src/quicknlp/models/__init__.py | jalajthanaki/quick-nlp | 287 | 1695306 | from .hred import HRED
from .cvae import CVAE
from .seq2seq import Seq2Seq
from .seq2seq_attention import Seq2SeqAttention
from .transformer import Transformer
| 0 | 0 | 0 | 0 | 0 | 0 |
scripts/sentiment/process_utils.py | de9uch1/stanza | 3,633 | 1695327 | import csv
import glob
import os
from collections import namedtuple
Split = namedtuple('Split', ['filename', 'weight'])
def write_list(out_filename, dataset):
with open(out_filename, 'w') as fout:
for line in dataset:
fout.write(line)
fout.write("\n")
def write_splits(out_directo... | 1 | 2 | 0 | 0 | 3 | 0 |
test/integration_test/tools/lib/ofp/ofp_flow_removed.py | ryoon/lagopus | 281 | 1695329 | import os
import sys
import copy
import logging
from checker import *
from .ofp import register_ofp_creators
from .ofp import OfpBase
from .ofp_match import SCE_MATCH
from .ofp_match import OfpMatchCreator
# YAML:
# flow_removed:
# cookie: 0
# priority: 0
# reason: 0
# table_id: 0
# idle_timeout: 0
# ... | 0 | 1 | 0 | 0 | 1 | 0 |
palantir_problems/problem_6.py | loftwah/Daily-Coding-Problem | 129 | 1695331 | <reponame>loftwah/Daily-Coding-Problem
"""This problem was asked by Palantir.
The ancient Egyptians used to express fractions as a sum of several terms where each numerator is one.
For example, 4 / 13 can be represented as 1 / 4 + 1 / 18 + 1 / 468.
Create an algorithm to turn an ordinary fraction a / b, where a < b,... | 0 | 0 | 0 | 0 | 0 | 0 |
qt__pyqt__pyside__pyqode/One_ball__in_outer_circle_area__collision_with_mouse__QPainter/main.py | DazEB2/SimplePyScripts | 117 | 1695359 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
__author__ = 'ipetrash'
# SOURCE: https://ru.stackoverflow.com/a/970882/201445
# SOURCE: https://github.com/gil9red/SimplePyScripts/blob/d50de0f237d778f7d69ee75e328503f8c8344743/qt__pyqt__pyside__pyqode/QWebEngineView__one_ball__in_outer_circle_area__collision_with_mous... | 1 | 2 | 9 | 4 | 16 | 0 |
synapse/lib/aha.py | vishalbelsare/synapse | 216 | 1695389 | from __future__ import annotations
import os
import asyncio
import logging
import synapse.exc as s_exc
import synapse.common as s_common
import synapse.lib.cell as s_cell
import synapse.lib.coro as s_coro
import synapse.lib.nexus as s_nexus
import synapse.lib.jsonstor as s_jsonstor
import synapse.lib.lmdbslab as s_lm... | 14 | 16 | 1 | 0 | 31 | 0 |
universe/spaces/vnc_observation_space.py | BitJetKit/universe | 8,120 | 1695398 | <reponame>BitJetKit/universe<filename>universe/spaces/vnc_observation_space.py
import gym
class VNCObservationSpace(gym.Space):
# For now, we leave the VNC ObservationSpace wide open, since
# there isn't much use-case for this object.
def contains(self, x):
return True
| 0 | 0 | 0 | 0 | 0 | 0 |
src/cloudservice/azext_cloudservice/manual/custom.py | haroonf/azure-cli-extensions | 207 | 1695412 | <filename>src/cloudservice/azext_cloudservice/manual/custom.py
# --------------------------------------------------------------------------
# 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 M... | 0 | 0 | 0 | 0 | 0 | 0 |
ros_ws/src/crazyswarm/scripts/individual_hover.py | marios-stam/crazyswarm | 219 | 1695432 | <reponame>marios-stam/crazyswarm
#!/usr/bin/env python
from __future__ import print_function
from pycrazyswarm import *
def main():
swarm = Crazyswarm()
timeHelper = swarm.timeHelper
allcfs = swarm.allcfs
for cf in allcfs.crazyflies:
print(cf.id)
cf.takeoff(1.0, 2.5)
print("p... | 0 | 0 | 0 | 0 | 0 | 0 |
weibospider/run_spider.py | Raychanan/WeiboSpider | 2,697 | 1695447 | <reponame>Raychanan/WeiboSpider
#!/usr/bin/env python
# encoding: utf-8
"""
File Description:
Author: nghuyong
Mail: <EMAIL>
Created Time: 2019-12-07 21:27
"""
import os
import sys
from scrapy.crawler import CrawlerProcess
from scrapy.utils.project import get_project_settings
from spiders.tweet import TweetSpider
from... | 0 | 0 | 0 | 0 | 0 | 0 |
tf/reader.py | deeperic/SpikeFlow | 158 | 1695514 | #deeperic
import os
import glob
import csv
import tensorflow as tf
import numpy as np
from PIL import Image
def _read_raw_images(path, is_directory: bool=True) -> None:
"""Reads directory of images in tensorflow
Args:
path:
is_directory:
Returns:
"""
images = []
png_files = []
jpeg_files = []... | 6 | 6 | 0 | 0 | 12 | 0 |
src/down.py | Kadantte/twist.moe | 112 | 1695546 | <reponame>Kadantte/twist.moe
import signal
import sys
import requests
import cfscrape
from tqdm import tqdm
scraper = cfscrape.create_scraper()
# to prevent ctrl+c traceback
signal.signal(signal.SIGINT, lambda x, y: sys.exit(0))
headers = {
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:69.0) Gecko... | 0 | 0 | 0 | 0 | 0 | 0 |
Configuration/GlobalRuns/python/reco_TLR_35X.py | ckamtsikis/cmssw | 852 | 1695645 | <gh_stars>100-1000
import FWCore.ParameterSet.Config as cms
def customiseCommon(process):
#####################################################################################################
####
#### Top level replaces for handling strange scenarios of early collisions
####
## TRACKING:
... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/examples/test_example_change_some_fields.py | Playfloor/bonobo | 1,573 | 1695671 | <gh_stars>1000+
from collections import namedtuple
import bonobo
from bonobo.config import use_raw_input
from bonobo.execution.contexts import GraphExecutionContext
from bonobo.util.bags import BagType
Extracted = namedtuple("Extracted", ["id", "name", "value"])
ExtractedBT = BagType("ExtractedBT", ["id", "name", "va... | 0 | 0 | 0 | 0 | 0 | 0 |
src/test/tests/rendering/image.py | visit-dav/vis | 226 | 1695680 | <reponame>visit-dav/vis<gh_stars>100-1000
# ----------------------------------------------------------------------------
# CLASSES: nightly
#
# Test Case: image.py
#
# Tests: mesh - 2D curvilinear, single domain
# plots - Pseudocolor
# annotations - Image
#
# Defect ID: ... | 0 | 0 | 0 | 0 | 0 | 0 |
searches/sentinel_linear_search.py | joeyzhou85/python | 1,568 | 1695684 | <reponame>joeyzhou85/python
"""
This is pure python implementation of sentinel linear search algorithm
For doctests run following command:
python -m doctest -v sentinel_linear_search.py
or
python3 -m doctest -v sentinel_linear_search.py
For manual testing run:
python sentinel_linear_search.py
"""
def sentinel_linear... | 0 | 0 | 0 | 0 | 0 | 0 |
nasbench301/surrogate_models/bananas/bananas_src/bo/ds/__init__.py | Basvanstein/nasbench301 | 167 | 1695702 | <gh_stars>100-1000
"""
Code for makept (serializing and subprocesses) strategy.
"""
| 0 | 0 | 0 | 0 | 0 | 0 |
fairml/__init__.py | ravish0007/fairml | 330 | 1695712 | <gh_stars>100-1000
from .orthogonal_projection import audit_model
from .graphing import plot_dependencies
| 0 | 0 | 0 | 0 | 0 | 0 |
tests/test_backtrack.py | vansh-tiwari/algorithms | 22,426 | 1695715 | from algorithms.backtrack import (
add_operators,
permute,
permute_iter,
anagram,
array_sum_combinations,
unique_array_sum_combinations,
combination_sum,
get_factors,
recursive_get_factors,
find_words,
generate_abbreviations,
generate_parenthesis_v1,
generate_parenthe... | 0 | 0 | 0 | 0 | 0 | 1 |
sdk/python/core/tests/test_netconf_provider.py | YDK-Solutions/ydk | 125 | 1695735 | # ----------------------------------------------------------------
# Copyright 2017 Cisco Systems
#
# 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/LICENS... | 0 | 0 | 0 | 0 | 0 | 0 |
mayan/apps/metadata/search.py | eshbeata/open-paperless | 2,743 | 1695757 | from __future__ import absolute_import, unicode_literals
from django.utils.translation import ugettext_lazy as _
from dynamic_search.classes import SearchModel
from .permissions import permission_metadata_type_view
metadata_type_search = SearchModel(
app_label='metadata', model_name='MetadataType',
permissi... | 0 | 0 | 0 | 0 | 0 | 0 |
src/core/tests/widgets/test_tree.py | luizoti/toga | 1,261 | 1695763 | <filename>src/core/tests/widgets/test_tree.py<gh_stars>1000+
import toga
import toga_dummy
from toga.sources import TreeSource
from toga_dummy.utils import TestCase
class TreeTests(TestCase):
def setUp(self):
super().setUp()
self.headings = ['Heading {}'.format(x) for x in range(3)]
self... | 0 | 0 | 0 | 0 | 0 | 0 |
modules/auxiliary/scanner/wproxy/att_open_proxy.py | OsmanDere/metasploit-framework | 26,932 | 1695784 | #!/usr/bin/env python3
from metasploit import module, probe_scanner
metadata = {
'name': 'Open WAN-to-LAN proxy on AT&T routers',
'description': '''
The Arris NVG589 and NVG599 routers configured with AT&T U-verse
firmware 9.2.2h0d83 expose an un-authenticated proxy that allows
connec... | 0 | 0 | 0 | 0 | 0 | 0 |
pytorch_pfn_extras/nn/parallel/__init__.py | yasuyuky/pytorch-pfn-extras | 243 | 1695795 | from pytorch_pfn_extras.nn.parallel.distributed import DistributedDataParallel # NOQA
| 0 | 0 | 0 | 0 | 0 | 0 |
h/jinja_extensions/back_link_label.py | BearerPipelineTest/h | 2,103 | 1695810 | from __future__ import annotations
"""A context-aware link to the previous page."""
from urllib.parse import urlparse
from h.i18n import TranslationString as _
def back_link_label(request) -> object | None:
"""
Get a link which takes the user back to the previous page on the site.
This is used in `temp... | 0 | 2 | 0 | 0 | 2 | 0 |
rig/autoModuleBuild.py | fsanges/glTools | 165 | 1695832 | <filename>rig/autoModuleBuild.py
import maya.cmds as mc
import glTools.tools.controlBuilder
import glTools.nrig.module.fkChain
import glTools.nrig.module.ikChain
import autoModuleTemplate
import ast
def checkModuleTemplate(moduleTemplateGrp,moduleType,moduleAttrs):
'''
Check for standard module template elements... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/pytest_extension/issues/test_issue_fixture_union2.py | broglep-work/python-pytest-cases | 213 | 1695836 | # Authors: <NAME> <<EMAIL>>
# + All contributors to <https://github.com/smarie/python-pytest-cases>
#
# License: 3-clause BSD, <https://github.com/smarie/python-pytest-cases/blob/master/LICENSE>
import pytest
from pytest_cases.common_pytest_marks import PYTEST3_OR_GREATER
from pytest_cases import fixture_unio... | 0 | 2 | 0 | 0 | 2 | 0 |
Hierarchical_Attention_Network/HAN.py | JasmineZhen218/DeepResearch | 264 | 1695840 | <filename>Hierarchical_Attention_Network/HAN.py<gh_stars>100-1000
import pandas as pd
import numpy as np
from keras.preprocessing.text import Tokenizer, text_to_word_sequence
from keras.engine.topology import Layer
from keras import initializers as initializers, regularizers, constraints
from keras.callbacks import Ca... | 0 | 0 | 0 | 0 | 0 | 0 |
netdissect/upsegmodel/models.py | jmh07/dissect | 526 | 1695853 | from __future__ import annotations
import torch
import torch.nn as nn
import torch.nn.functional as F
import torchvision
from . import resnet, resnext
try:
from lib.nn import SynchronizedBatchNorm2d
except ImportError:
from torch.nn import BatchNorm2d as SynchronizedBatchNorm2d
class SegmentationModuleBase(nn... | 20 | 10 | 0 | 5 | 35 | 0 |
python/perspective/perspective/client/table_api.py | shinny-yangyang/perspective | 1,821 | 1695855 | ################################################################################
#
# Copyright (c) 2019, the Perspective Authors.
#
# This file is part of the Perspective library, distributed under the terms of
# the Apache License 2.0. The full license can be found in the LICENSE file.
#
from __future__ import annot... | 12 | 16 | 0 | 0 | 28 | 0 |
self_organising_systems/shared/colab_util.py | Bathsheba/self-organising-systems | 121 | 1695883 | # Lint as: python3
""" Useful functions for running in colab.
"""
import PIL.Image, PIL.ImageDraw
from IPython.display import Image, HTML, clear_output
from self_organising_systems.shared.util import imencode
def imshow(a, fmt: str='jpeg'):
display(Image(data=imencode(a, fmt)))
| 1 | 0 | 0 | 0 | 1 | 0 |
src/tests/test_data_loader.py | joseph-zhong/LipReading | 133 | 1695913 | #!/usr/bin/env python3
"""
"""
import os
import json
import glob
import torch
import torch.utils.data as _data
import src.utils.utility as _util
import src.data.data_loader as _data_loader
import src.scripts.train_model as _train
dataset="StephenColbert/micro"
batch=4
num_workers=1
hidden_size=800
hidden_layers=5... | 0 | 0 | 0 | 0 | 0 | 0 |
awacs/ssm_contacts.py | michael-k/awacs | 358 | 1695922 | # Copyright (c) 2012-2021, <NAME> <<EMAIL>>
# All rights reserved.
#
# See LICENSE file for full license.
from .aws import Action as BaseAction
from .aws import BaseARN
service_name = "AWS Systems Manager Incident Manager Contacts"
prefix = "ssm-contacts"
class Action(BaseAction):
def __init__(self, action: str... | 4 | 2 | 0 | 0 | 6 | 0 |
api_tests/providers/preprints/views/test_preprint_provider_request_list.py | gaybro8777/osf.io | 628 | 1695925 | import pytest
from api.base.settings.defaults import API_BASE
from api_tests.requests.mixins import PreprintRequestTestMixin
@pytest.mark.django_db
class TestPreprintProviderWithdrawalRequstList(PreprintRequestTestMixin):
def url(self, provider) -> object:
return '/{}providers/preprints/{}/withdraw_reques... | 0 | 1 | 0 | 0 | 1 | 0 |
pysnow/response.py | Akasurde/pysnow | 121 | 1695950 | <gh_stars>100-1000
# -*- coding: utf-8 -*-
import ijson
from ijson.common import ObjectBuilder
from itertools import chain
from .exceptions import (
ResponseError,
NoResults,
InvalidUsage,
MultipleResults,
EmptyContent,
MissingResult,
)
class Response(object):
"""Takes a :class:`requests... | 0 | 0 | 0 | 0 | 0 | 0 |
rdkit/ML/NaiveBayes/ClassificationModel.py | kazuyaujihara/rdkit | 1,609 | 1695951 | <reponame>kazuyaujihara/rdkit
# $Id$
#
# Copyright (C) 2004-2008 <NAME> and Rational Discovery LLC
# All Rights Reserved
#
""" Defines Naive Baysean classification model
Based on development in: Chapter 6 of "Machine Learning" by <NAME>
"""
import numpy
from rdkit.ML.Data import Quantize
def _getBinId(val, ... | 0 | 0 | 0 | 0 | 0 | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.