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 |
|---|---|---|---|---|---|---|---|---|---|---|
Ryven/src/NWENV.py | tfroehlich82/Ryven | 2,872 | 1748131 | """This module automatically imports all requirements for custom widgets.
It should lie in the same location as Ryven.py so it can get imported directly from the custom sources
without path modifications which caused issues in the past."""
import inspect
from ryvencore_qt import Node, IWB, MWB # for use in the widge... | 0 | 0 | 2 | 0 | 2 | 0 |
youtube_dl/extractor/malltv.py | thename2468/youtube-dl-commithistory88 | 927 | 1748146 | <reponame>thename2468/youtube-dl-commithistory88<gh_stars>100-1000
# coding: utf-8
from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..utils import merge_dicts
class MallTVIE(InfoExtractor):
_VALID_URL = r'https?://(?:(?:www|sk)\.)?mall\.tv/(?:[^/]+/)*(?P<id>[^/?#&]+)'
... | 0 | 0 | 0 | 0 | 0 | 0 |
ds-phasespace-drawing-bad.py | RachidStat/PyCX | 176 | 1748177 | from pylab import *
def initialize(x0, y0): ###
global x, y, xresult, yresult
x = x0 ###
y = y0 ###
xresult = [x]
yresult = [y]
def observe():
global x, y, xresult, yresult
xresult.append(x)
yresult.append(y)
def update():
global x, y, xresult, yresult
nextx = - 0.5 * x - 0.7 ... | 0 | 0 | 0 | 0 | 0 | 0 |
util/gerrit-bot/bot.py | hyu-iot/gem5 | 765 | 1748186 | <filename>util/gerrit-bot/bot.py<gh_stars>100-1000
#!/usr/bin/env python3
# Copyright (c) 2020 The Regents of the University of California
# All Rights Reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met: redist... | 0 | 0 | 0 | 0 | 0 | 0 |
seahub/api2/endpoints/admin/users_batch.py | weimens/seahub | 101 | 1748268 | # Copyright (c) 2012-2016 Seafile Ltd.
import logging
from io import BytesIO
from openpyxl import load_workbook
from constance import config
from rest_framework import status
from rest_framework.authentication import SessionAuthentication
from rest_framework.permissions import IsAdminUser
from rest_framework.response... | 0 | 3 | 9 | 0 | 12 | 0 |
tools/trac2rst.py | rkalahasty/nipy | 236 | 1748269 | #!/usr/bin/env python3
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
''' Script to do very basic conversion of TRAC to reST format '''
import sys
import re
rst_section_levels = ['*', '=', '-', '~', '^']
heading_re = re.compile('^(=+) +([^=]+) +(=+)')... | 0 | 0 | 0 | 0 | 0 | 0 |
xclim/indicators/__init__.py | aaronspring/xclim | 169 | 1748273 | <gh_stars>100-1000
# -*- coding: utf-8 -*-
# noqa: D205,D400
"""
Indicators module
=================
Indicators are the main tool xclim provides to compute climate indices. In contrast
to the function defined in `xclim.indices`, Indicators add a layer of health checks
and metadata handling. Indicator objects are split... | 0 | 0 | 0 | 0 | 0 | 0 |
perma_web/perma/tests/test_templatetags.py | rachelaus/perma | 317 | 1748281 | # -*- coding: utf-8 -*-
from django.core.files.base import File
from perma.templatetags.repeat import repeat as perma_repeat
from perma.templatetags.carousel import set_carousel_partners
from perma.models import Registrar
from .utils import PermaTestCase
from io import StringIO, BytesIO
from PIL import Image
class ... | 3 | 2 | 0 | 0 | 5 | 0 |
kgtk/reshape/kgtkexplode.py | vishalbelsare/kgtk | 222 | 1748293 | """Copy records from the first KGTK file to the output file,
exploding a column into several data type-specific columns.
"""
from argparse import ArgumentParser, Namespace
import attr
from pathlib import Path
import sys
import typing
from kgtk.kgtkformat import KgtkFormat
from kgtk.io.kgtkreader import KgtkReader, K... | 4 | 1 | 44 | 0 | 49 | 0 |
tests/fakeeslserver.py | evangilo/greenswitch | 107 | 1748298 | <reponame>evangilo/greenswitch
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import socket
import threading
import time
class FakeESLServer(object):
def __init__(self, address, port, password):
self._address = address
self._port = port
self._password = password
self._client_socket ... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/helpers_test.py | tkoyama010/PVGeo | 145 | 1748314 | <filename>tests/helpers_test.py
import numpy as np
import pandas as pd
# VTK imports:
import vtk
from vtk.numpy_interface import dataset_adapter as dsa
from base import TestBase
from PVGeo import interface
# Functionality to test:
from PVGeo._helpers import xml
RTOL = 0.000001
class TestXML(TestBase):
"""
... | 0 | 0 | 0 | 0 | 0 | 0 |
416 Partition Equal Subset Sum.py | krishna13052001/LeetCode | 872 | 1748377 | #!/usr/bin/python3
from __future__ import annotations
"""
Given a non-empty array containing only positive integers, find if the array can
be partitioned into two subsets such that the sum of elements in both subsets is
equal.
"""
from collections import defaultdict
class Solution:
def canPartition(self, nums) ->... | 0 | 3 | 0 | 0 | 3 | 0 |
Demo/tkinter/guido/listtree.py | cemeyer/tauthon | 2,293 | 1748385 | # List a remote app's widget tree (names and classes only)
import sys
import string
from Tkinter import *
def listtree(master, app) -> object:
list = Listbox(master, name='list')
list.pack(expand=1, fill=BOTH)
listnodes(list, app, '.', 0)
return list
def listnodes(list, app, widget, level):
klas... | 0 | 1 | 0 | 0 | 1 | 0 |
overpass/__init__.py | rscar-89/overpass-api-python-wrapper | 266 | 1748386 | <reponame>rscar-89/overpass-api-python-wrapper<gh_stars>100-1000
# -*- coding: utf-8 -*-
# Copyright 2015-2018 <NAME>.
# This file is part of the overpass-api-python-wrapper project
# which is licensed under Apache 2.0.
# See LICENSE.txt for the full license text.
"""Thin wrapper around the OpenStreetMap Overpass API... | 0 | 0 | 0 | 0 | 0 | 0 |
photologue/tests/helpers.py | erdnaxe/django-photologue | 364 | 1748401 | import warnings
from django.test import TestCase
from .factories import PhotoFactory, PhotoSizeFactory
class PhotologueBaseTest(TestCase):
def setUp(self):
self.s = PhotoSizeFactory(name='testPhotoSize',
width=100,
height=100)
... | 0 | 0 | 0 | 0 | 0 | 0 |
spartan/examples/sgd.py | GabrielWen/spartan | 156 | 1748424 | <gh_stars>100-1000
import numpy as np
import spartan
from spartan import expr
from spartan import util
class SGDRegressor(object):
'''Stochastic gradient descent algorithm
SGDRegressor uses stochastic gradient descent algorithm to approach
the best W(parameters) for regressions.
Formula : W = W - alpha * gra... | 0 | 0 | 0 | 0 | 0 | 0 |
keras/utils/np_utils.py | tsheaff/keras | 37,222 | 1748436 | # Copyright 2018 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... | 3 | 2 | 0 | 0 | 5 | 0 |
GeneratorInterface/RivetInterface/test/runRivetAnalyzerMiniAOD_cfg.py | Purva-Chaudhari/cmssw | 852 | 1748437 | <reponame>Purva-Chaudhari/cmssw
import FWCore.ParameterSet.Config as cms
process = cms.Process('Rivet')
process.load("FWCore.MessageLogger.MessageLogger_cfi")
process.MessageLogger.cerr.FwkReport.reportEvery = cms.untracked.int32(100)
process.load("GeneratorInterface.RivetInterface.mergedGenParticles_cfi")
process.l... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/tensor_base/test_memory_locking.py | kw-0/MyGrad | 147 | 1748484 | <gh_stars>100-1000
from typing import Callable, ContextManager, List, Union
import hypothesis.strategies as st
import numpy as np
import pytest
from hypothesis import given, note, settings
from numpy.testing import assert_allclose
import mygrad as mg
import mygrad._utils.lock_management as mem
from mygrad import (
... | 0 | 0 | 0 | 0 | 0 | 0 |
openbook_posts/migrations/0060_delete_postlink.py | TamaraAbells/okuna-api | 164 | 1748495 | <filename>openbook_posts/migrations/0060_delete_postlink.py
# Generated by Django 2.2.5 on 2019-09-17 14:22
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('openbook_posts', '0059_auto_20190910_1800'),
]
operations = [
migrations.DeleteModel(
... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/unit/models/reddit/test_submission.py | CAM-Gerlach/praw | 2,360 | 1748522 | <filename>tests/unit/models/reddit/test_submission.py<gh_stars>1000+
import pickle
import pytest
from praw.exceptions import ClientException
from praw.models import Submission
from ... import UnitTest
class TestSubmission(UnitTest):
def test_equality(self):
submission1 = Submission(self.reddit, _data={... | 0 | 0 | 0 | 0 | 0 | 0 |
src/visitpy/visit_flow/flow/src/core/filter_graph.py | visit-dav/vis | 226 | 1748569 | # Copyright (c) Lawrence Livermore National Security, LLC and other VisIt
# Project developers. See the top-level LICENSE file for dates and other
# details. No copyright assignment is required to contribute to VisIt.
from __future__ import annotations
"""
file: filter_graph.py
author: <NAME> <<EMAIL>>
created: 1... | 4 | 17 | 0 | 4 | 25 | 0 |
examples/image/tetris.py | mariogeiger/se3cnn | 170 | 1748611 | # pylint: disable=not-callable, no-member, arguments-differ, missing-docstring, invalid-name, line-too-long
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.utils.data
from scipy.ndimage import zoom
from cath.util import lr_schedulers
from se3cnn.image.filter import lo... | 4 | 8 | 0 | 0 | 12 | 0 |
holoviews/core/data/spatialpandas.py | TheoMathurin/holoviews | 864 | 1748619 | import sys
from collections import defaultdict
import numpy as np
from ..dimension import dimension_name
from ..util import isscalar, unique_iterator, pd, unique_array
from .interface import DataError, Interface
from .multipath import MultiInterface, ensure_ring
from .pandas import PandasInterface
class SpatialPan... | 0 | 0 | 0 | 0 | 0 | 1 |
aiida/storage/psql_dos/migrations/utils/duplicate_uuids.py | mkrack/aiida-core | 153 | 1748623 | <reponame>mkrack/aiida-core
# -*- coding: utf-8 -*-
###########################################################################
# Copyright (c), The AiiDA team. All rights reserved. #
# This file is part of the AiiDA code. #
# ... | 0 | 0 | 0 | 0 | 0 | 0 |
benchmark/alpa/old_backup/benchmark_transformer_layer_2d.py | yf225/alpa | 114 | 1748637 | <filename>benchmark/alpa/old_backup/benchmark_transformer_layer_2d.py
import argparse
import copy
import os
import time
from flax import linen as nn
from flax import optim
import jax
import jax.numpy as jnp
import numpy as np
import ray
from alpa import (parallelize, global_config, set_parallelize_options, testing,
... | 0 | 0 | 0 | 0 | 0 | 0 |
pysc2/agents/pysc2-tutorial-master/Build a Raw Protoss Agent/raw_agent_step2.py | Hotpotfish/pysc2 | 294 | 1748666 | import random
import numpy as np
from absl import app
from pysc2.agents import base_agent
from pysc2.lib import actions, features, units
from pysc2.env import sc2_env, run_loop
class RawAgent(base_agent.BaseAgent):
def step(self, obs) -> object:
super(RawAgent, self).step(obs)
return actions.RAW_FUNCTIO... | 0 | 1 | 0 | 0 | 1 | 0 |
devil/devil/utils/lazy/weak_constant_test.py | Martijnve23/catapult | 1,894 | 1748668 | #!/usr/bin/env python
# Copyright 2018 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.
# pylint: disable=protected-access
import time
import unittest
from devil import devil_env
from devil.utils import lazy
from devil.ut... | 0 | 1 | 0 | 0 | 1 | 0 |
hummingbot/model/range_position.py | BGTCapital/hummingbot | 3,027 | 1748676 | <filename>hummingbot/model/range_position.py<gh_stars>1000+
#!/usr/bin/env python
from sqlalchemy import (
Column,
Text,
Index,
BigInteger,
Float
)
from . import HummingbotBase
class RangePosition(HummingbotBase):
__tablename__ = "RangePosition"
__table_args__ = (Index("rp_config_timestamp... | 0 | 0 | 0 | 0 | 0 | 0 |
ports/esp32/boards/UM_FEATHERS2/manifest.py | rxchen/micropython | 13,648 | 1748693 | include("$(PORT_DIR)/boards/manifest.py")
freeze("$(PORT_DIR)/boards/UM_TINYPICO/modules", "dotstar.py")
freeze("modules")
| 0 | 0 | 0 | 0 | 0 | 0 |
tests/test_error.py | kimi98-2020/git-repo | 168 | 1748697 | # Copyright 2021 The Android Open Source Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | 0 | 0 | 0 | 0 | 0 | 0 |
architect/orms/sqlobject/features.py | dimagi/architect | 352 | 1748705 | """
Defines features for the SQLObject ORM.
"""
from sqlobject.main import instanceName
from ..bases import BasePartitionFeature, BaseOperationFeature
class OperationFeature(BaseOperationFeature):
def __init__(self, *args, **kwargs):
super(OperationFeature, self).__init__(*args, **kwargs)
self.c... | 2 | 5 | 1 | 0 | 8 | 0 |
thirdparty/nsiqcppstyle/nsiqcppstyle_checker.py | cfsengineering/tigl | 171 | 1748721 | <gh_stars>100-1000
# Copyright (c) 2009 NHN Inc. All rights reserved.
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of condit... | 0 | 0 | 0 | 0 | 0 | 0 |
miscellaneous/Machine Fix/code.py | ratednull/ctf-challenges | 114 | 1748726 | <reponame>ratednull/ctf-challenges
def convert (n):
if n == 0:
return '0'
nums = []
while n:
n, r = divmod(n, 3)
nums.append(str(r))
return ''.join(reversed(nums))
count=0
n=1
while(n<=523693181734689806809285195318):
str1=convert(n)
str2=convert(n-1)
str2='0'*(... | 0 | 0 | 0 | 0 | 0 | 0 |
tf_quant_finance/experimental/instruments/rate_curve_test.py | slowy07/tf-quant-finance | 3,138 | 1748727 | # Lint as: python3
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agr... | 0 | 2 | 0 | 0 | 2 | 0 |
Python/search/Linear_Search.py | zhcet19/NeoAlgo-1 | 897 | 1748743 | def linearSearch(arr, x):
pos = -1
for i in range(len(arr)):
if arr[i] == x:
pos = i
print("Found at {}".format(pos))
if pos == -1:
print("Not Found") | 0 | 0 | 0 | 0 | 0 | 0 |
tests/conftest.py | chuckyQ/briefcase | 917 | 1748777 | from unittest import mock
import pytest
from git import exc as git_exceptions
@pytest.fixture
def mock_git() -> object:
git = mock.MagicMock()
git.exc = git_exceptions
return git
| 0 | 1 | 0 | 0 | 1 | 0 |
SymbolExtractorAndRenamer/lldb/examples/python/gdbremote.py | Polidea/SiriusObfuscator | 427 | 1748783 | <reponame>Polidea/SiriusObfuscator
#!/usr/bin/python
#----------------------------------------------------------------------
# This module will enable GDB remote packet logging when the
# 'start_gdb_log' command is called with a filename to log to. When the
# 'stop_gdb_log' command is called, it will disable the loggi... | 0 | 0 | 0 | 0 | 0 | 0 |
synapse/config/federation.py | mlakkadshaw/synapse | 9,945 | 1748794 | # Copyright 2020 The Matrix.org Foundation C.I.C.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | 0 | 1 | 1 | 1 | 3 | 0 |
conans/test/functional/utils.py | fanStefan/conan | 6,205 | 1748799 | <gh_stars>1000+
from conan.tools.microsoft.visual import vcvars_command
def check_vs_runtime(artifact, client, vs_version, build_type, architecture="amd64",
static_runtime=False):
vcvars = vcvars_command(version=vs_version, architecture=architecture)
normalized_path = artifact.replace("/"... | 0 | 0 | 0 | 0 | 0 | 0 |
ctools/worker/learner/base_learner.py | XinyuJing/DI-star | 267 | 1748808 | <reponame>XinyuJing/DI-star<filename>ctools/worker/learner/base_learner.py
"""
Copyright 2020 <NAME>. All Rights Reserved
Main Function:
1. base class for model learning
"""
import os
from abc import ABC, abstractmethod
from typing import Any, Union, Callable
from functools import partial
from easydict import Easy... | 0 | 0 | 0 | 0 | 0 | 0 |
test/run/t25.py | timmartin/skulpt | 2,671 | 1748843 | def test():
print "OK"
x = test
x()
| 0 | 0 | 0 | 0 | 0 | 0 |
Sources/Workflows/jc-weather/wunderground.py | yagosys/AlfredWorkflow.com | 2,177 | 1748854 | <gh_stars>1000+
#!/usr/bin/env python
import datetime
import requests
FORECAST_URL = 'http://www.wunderground.com/cgi-bin/findweather/' \
'getForecast'
API_TEMPLATE = 'http://api.wunderground.com/api/{}'
api = None
class WeatherException(Exception):
def __init__(self, message, error=None):
... | 0 | 0 | 0 | 0 | 0 | 0 |
sdk/python/pulumi_azure/media/_inputs.py | ScriptBox99/pulumi-azure | 109 | 1748865 | <gh_stars>100-1000
# coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, over... | 0 | 0 | 0 | 0 | 0 | 0 |
vyapp/notebook.py | iogf/vy | 927 | 1748867 | <filename>vyapp/notebook.py
from vyapp.panel import PanedVerticalWindow
from vyapp.areavi import AreaVi
from tkinter.ttk import Notebook
from tkinter import BOTH
import sys
class NoteVi(Notebook):
"""
This class implements vy tabs.
"""
def __init__(self, *args, **kwargs):
Notebook.__init__(sel... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/test_decoders.py | li657835991/FCN | 235 | 1748871 | import pytest
import numpy as np
import keras.backend as K
from keras.layers import Input
from keras_fcn.decoders import (
Decoder,
VGGDecoder,
VGGUpsampler
)
from keras.utils.test_utils import keras_test
def test_decoder():
with pytest.raises(ValueError):
Decoder(pyramid=['fake1', 'fake2'], ... | 0 | 0 | 0 | 0 | 0 | 0 |
win/pywinauto/unittests/test_XMLHelpers.py | sk8darr/BrowserRefresh-Sublime | 191 | 1748893 | <filename>win/pywinauto/unittests/test_XMLHelpers.py<gh_stars>100-1000
# GUI Application automation and testing library
# Copyright (C) 2006 <NAME>
#
# 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 Softw... | 0 | 0 | 0 | 0 | 0 | 0 |
ServidorPython/python32_web/Lib/site-packages/ipykernel/iostream.py | mak213k/Servidor_automatizado_python | 445 | 1748916 | # coding: utf-8
from __future__ import annotations
"""Wrappers for forwarding stdout/stderr over zmq"""
# Copyright (c) IPython Development Team.
# Distributed under the terms of the Modified BSD License.
from __future__ import print_function
import atexit
from binascii import b2a_hex
from collections import deque
tr... | 3 | 16 | 5 | 3 | 27 | 0 |
mayan/apps/autoadmin/handlers.py | nattangwiwat/Mayan-EDMS-recitation | 343 | 1748919 | from django.apps import apps
def handler_auto_admin_account_password_change(sender, instance, **kwargs):
AutoAdminSingleton = apps.get_model(
app_label='autoadmin', model_name='AutoAdminSingleton'
)
auto_admin_properties, created = AutoAdminSingleton.objects.get_or_create()
if instance == au... | 0 | 0 | 0 | 0 | 0 | 0 |
saliency/core/guided_ig.py | lenbrocki/saliency | 728 | 1748948 | <filename>saliency/core/guided_ig.py
# Copyright 2021 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
#
# Un... | 0 | 0 | 0 | 0 | 0 | 0 |
setup.py | optimiseddesign/KiBoM | 274 | 1748962 | # -*- coding: utf-8 -*-
import setuptools
from kibom.version import KIBOM_VERSION
long_description = "KiBoM is a configurable BOM (Bill of Materials) generation tool for KiCad EDA. Written in Python, it can be used directly with KiCad software without the need for any external libraries or plugins. KiBoM intelligent... | 0 | 0 | 0 | 0 | 0 | 0 |
readthedocs/api/v3/proxied_views.py | yarons/readthedocs.org | 4,054 | 1748965 | from readthedocs.core.utils.extend import SettingsOverrideObject
from readthedocs.embed.v3.views import EmbedAPIBase
from readthedocs.core.mixins import ProxiedAPIMixin
class ProxiedEmbedAPIBase(ProxiedAPIMixin, EmbedAPIBase):
pass
class ProxiedEmbedAPI(SettingsOverrideObject):
_default_class = ProxiedEmb... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/test_models/test_ocr_head.py | jeffreykuang/mmocr-1 | 206 | 1748972 | <reponame>jeffreykuang/mmocr-1<gh_stars>100-1000
import pytest
import torch
from mmocr.models.textrecog import SegHead
def test_seg_head():
with pytest.raises(AssertionError):
SegHead(num_classes='100')
with pytest.raises(AssertionError):
SegHead(num_classes=-1)
seg_head = SegHead(num_cl... | 0 | 0 | 0 | 0 | 0 | 0 |
uefi_firmware/pfs.py | MikeSpreitzer/uefi-firmware-parser | 492 | 1748987 | <gh_stars>100-1000
import struct
import os
from .base import FirmwareObject, RawObject, BaseObject, AutoRawObject
from .uefi import FirmwareVolume
from .utils import print_error, dump_data, sguid, green, blue
PFS_GUIDS = {
"FIRMWARE_VOLUMES": "7ec6c2b0-3fe3-42a0-a316-22dd0517c1e8",
"INTEL_ME": "7439e... | 0 | 0 | 0 | 0 | 0 | 0 |
nipy/algorithms/statistics/models/tests/test_estimable.py | bpinsard/nipy | 236 | 1748998 | <gh_stars>100-1000
""" Testing ``isestimable`` in regression module
"""
from __future__ import absolute_import
import numpy as np
from ..regression import isestimable
from numpy.testing import (assert_almost_equal,
assert_array_equal)
from nose.tools import (assert_true, assert_false, ass... | 0 | 0 | 0 | 0 | 0 | 0 |
locations/spiders/hard_rock.py | nbeecher/alltheplaces | 297 | 1749000 | <reponame>nbeecher/alltheplaces
# -*- coding: utf-8 -*-
import json
import scrapy
from locations.items import GeojsonPointItem
class HardRockSpider(scrapy.Spider):
name = 'hardrock'
item_attributes = {'brand': 'Hard Rock'}
allowed_domains = ['www.hardrock.com']
start_urls = ['https://www.hardrock.com... | 0 | 0 | 0 | 0 | 0 | 0 |
models/activations/__init__.py | blackfeather-wang/GFNet-Pytorch | 164 | 1749013 | from .config import *
from .activations_autofn import *
from .activations_jit import *
from .activations import *
_ACT_FN_DEFAULT = dict(
swish=swish,
mish=mish,
relu=F.relu,
relu6=F.relu6,
sigmoid=sigmoid,
tanh=tanh,
hard_sigmoid=hard_sigmoid,
hard_swish=hard_swish,
)
_ACT_FN_AUTO = ... | 2 | 2 | 0 | 0 | 4 | 0 |
docarray/array/storage/elastic/backend.py | jina-ai/docarray | 591 | 1749057 | import copy
import uuid
from dataclasses import dataclass, field
from typing import (
Dict,
Optional,
TYPE_CHECKING,
Union,
List,
Iterable,
Any,
Mapping,
)
import numpy as np
from elasticsearch import Elasticsearch
from elasticsearch.helpers import bulk
from ..base.backend import BaseB... | 3 | 7 | 10 | 0 | 20 | 0 |
scripts/video_loop.py | charlielito/snapchat-filters-opencv | 191 | 1749115 | <filename>scripts/video_loop.py<gh_stars>100-1000
import argparse
import time
import cv2
import numpy as np
from concurrent_videocapture import ConcurrentVideoCapture
from python_path import PythonPath
with PythonPath("."):
import pyfakewebcam
# Parser
parser = argparse.ArgumentParser()
parser.add_argument("--r... | 0 | 0 | 0 | 0 | 0 | 0 |
examples/userWeiboSpider/analysis.py | PhDLuffy/DecryptLogin | 2,268 | 1749130 | <filename>examples/userWeiboSpider/analysis.py<gh_stars>1000+
'''
Function:
微博数据可视化, pyecharts版本: 1.5.1
Author:
Charles
微信公众号:
Charles的皮卡丘
'''
import os
import jieba
import pickle
from pyecharts import options
from wordcloud import WordCloud
from pyecharts.globals import ThemeType
from pyecharts.charts import Pie, B... | 0 | 0 | 0 | 0 | 0 | 0 |
openbook_hashtags/management/commands/process_post_comment_hashtags.py | TamaraAbells/okuna-api | 164 | 1749174 | <reponame>TamaraAbells/okuna-api<gh_stars>100-1000
from django.core.management.base import BaseCommand
import logging
from django.db import transaction
from openbook_common.utils.model_loaders import get_post_comment_model
from openbook_posts.jobs import _chunked_queryset_iterator
logger = logging.getLogger(__name__... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/features/functions_test.py | asottile/add-trailing-comma | 238 | 1749178 | <gh_stars>100-1000
import sys
import pytest
from add_trailing_comma._main import _fix_src
@pytest.mark.parametrize(
'src',
(
'def f(): pass',
'def f(arg1, arg2): pass',
'def f(\n'
' arg1,\n'
' arg2,\n'
'): pass',
# *args forbid trailing c... | 0 | 0 | 0 | 0 | 0 | 0 |
examples/falsepositive_disabletoids.py | chrisinmtown/PyMISP | 307 | 1749186 | <filename>examples/falsepositive_disabletoids.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
'''
<NAME>
Disable the to_ids flag of an attribute when there are to many false positives
Put this script in crontab to run every /15 or /60
*/5 * * * * mispuser /usr/bin/python3 /home/mispuser/PyMISP/examples/fal... | 0 | 0 | 0 | 0 | 0 | 0 |
deep-rl/lib/python2.7/site-packages/OpenGL/GL/NV/light_max_exponent.py | ShujaKhalid/deep-rl | 210 | 1749208 | <reponame>ShujaKhalid/deep-rl<gh_stars>100-1000
'''OpenGL extension NV.light_max_exponent
This module customises the behaviour of the
OpenGL.raw.GL.NV.light_max_exponent to provide a more
Python-friendly API
Overview (from the spec)
Default OpenGL does not permit a shininess or spot exponent over
128.0. This e... | 0 | 0 | 0 | 0 | 0 | 0 |
custom_components/hacs/store.py | svkowalski/HAcore_QNAP | 167 | 1749239 | from __future__ import annotations
"""Storage handers."""
from homeassistant.helpers.json import JSONEncoder
from homeassistant.helpers.storage import Store
from .hacsbase.const import STORAGE_VERSION
async def async_load_from_store(hass, key) -> dict[object,object] | object:
"""Load the retained data from store ... | 0 | 2 | 0 | 0 | 2 | 0 |
tools/clang_format_merge_driver/install_git_hook.py | google-ar/chromium | 777 | 1749248 | #!/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.
"""Hook to install the git config for using the clang-format merge driver."""
import os
import subprocess
import sys
_VERSION = 1
de... | 0 | 0 | 0 | 0 | 0 | 0 |
sky/tools/webkitpy/layout_tests/layout_package/json_results_generator.py | domenic/mojo | 5,964 | 1749287 | # Copyright (C) 2010 Google Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the ... | 4 | 7 | 0 | 0 | 11 | 0 |
Platform/Win32/CreateRedist/Redist.py | liangjinRK/Sensor | 145 | 1749289 | <reponame>liangjinRK/Sensor<filename>Platform/Win32/CreateRedist/Redist.py
#/****************************************************************************
#* *
#* PrimeSense Sensor 5.x Alpha *
#* C... | 0 | 0 | 0 | 0 | 0 | 0 |
modules/src/help.py | rampreeth/JARVIS-on-Messenger | 1,465 | 1749298 | <gh_stars>1000+
import modules
from templates.quick_replies import add_quick_reply
from templates.text import TextTemplate
def process(input, entities=None):
help = 'Hi there! I\'m Jarvis, your personal assistant.'
if entities is not None:
if 'sender' in entities and 'first_name' in entities['sender']... | 0 | 0 | 0 | 0 | 0 | 0 |
digits/status.py | PhysicsTeacher13/Digits-NVIDIA | 111 | 1749315 | # Copyright (c) 2014-2016, NVIDIA CORPORATION. All rights reserved.
from __future__ import annotations
from __future__ import absolute_import
import time
class Status():
"""
A little class to store the state of Jobs and Tasks
It's pickle-able!
"""
# Enum-like attributes
INIT: str = 'I'
... | 0 | 7 | 6 | 2 | 15 | 0 |
server/auvsi_suas/views/telemetry.py | RMMichael/interop | 175 | 1749317 | """Telemetry view."""
import logging
from auvsi_suas.models.aerial_position import AerialPosition
from auvsi_suas.models.uas_telemetry import UasTelemetry
from auvsi_suas.proto import interop_api_pb2
from auvsi_suas.views.decorators import require_login
from django.http import HttpResponse
from django.http import Http... | 0 | 1 | 0 | 0 | 1 | 0 |
examples/hexrays/vds_xrefs.py | fengjixuchui/src | 1,160 | 1749344 | from __future__ import annotations
"""
summary: show decompiler xrefs
description:
Show decompiler-style Xref when the `Ctrl+X` key is
pressed in the Decompiler window.
* supports any global name: functions, strings, integers, ...
* supports structure member.
author: EiNSTeiN_ <<EMAIL>>
"""
from __future__ i... | 0 | 13 | 0 | 1 | 14 | 0 |
tests/layers/test_input.py | FrostByte266/neupy | 801 | 1749353 | from neupy import layers
from neupy.exceptions import LayerConnectionError
from base import BaseTestCase
class InputTestCase(BaseTestCase):
def test_input_exceptions(self):
layer = layers.Input(10)
error_message = "Input layer got unexpected input"
with self.assertRaisesRegexp(LayerConne... | 0 | 0 | 0 | 0 | 0 | 0 |
adi_analyze/aggregate/handler/ThreadContendHandler.py | Bertlk/ADI | 226 | 1749377 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time : 2019/9/24 5:54 下午
# @Author : kewen
# @File : ThreadContendHandler.py
from aggregate.GlobalAggregateInfo import GlobalAggregateInfo
from aggregate.handler.BaseHandler import BaseHandler
from event.MonitorContendedEvent import MonitorContendedEvent
from util... | 2 | 3 | 0 | 0 | 5 | 0 |
stanza/pipeline/sentiment_processor.py | asears/stanza | 3,633 | 1749385 | <gh_stars>1000+
"""Processor that attaches a sentiment score to a sentence
The model used is a generally a model trained on the Stanford
Sentiment Treebank or some similar dataset. When run, this processor
attaches a score in the form of a string to each sentence in the
document.
TODO: a possible way to generalize t... | 0 | 0 | 0 | 0 | 0 | 0 |
src/whoosh/lang/paicehusk.py | matchup-ir/whooshy | 319 | 1749392 | <gh_stars>100-1000
"""This module contains an object that implements the Paice-Husk stemming
algorithm.
If you just want to use the standard Paice-Husk stemming rules, use the
module's ``stem()`` function::
stemmed_word = stem(word)
If you want to use a custom rule set, read the rules into a string where the
rul... | 0 | 0 | 0 | 0 | 0 | 0 |
util/api.py | SilenceDut/nbaplus-server | 163 | 1749398 | <filename>util/api.py
__author__ = 'silencedut'
#restful api
newsupdate='/api/v1.0/<string:type>/update'
newsloadmore='/api/v1.0/<string:type>/loadmore/<string:newsid>'
perstat='/api/v1.0/nbastat/perstat/<string:perstat>'
teamsort='/api/v1.0/teamsort/sort'
gamesdate='/api/v1.0/gamesdate/<string:date>' | 0 | 0 | 0 | 0 | 0 | 0 |
gendoc.py | chrisdiana/redisearch-py | 153 | 1749404 |
import pydoc
import os, sys
module_header = "# Package {} Documentation\n"
class_header = "## Class {}"
function_header = "### {}"
def getmarkdown(module) -> object:
output = [ module_header.format(module.__name__) ]
if module.__doc__:
output.append(module.__doc__)
output.extend(getcla... | 0 | 4 | 0 | 0 | 4 | 0 |
kamen/0004/word_count.py | saurabh896/python-1 | 3,976 | 1749420 | from collections import Counter
#collections
#counter + - & | most_common
with open('a.txt', 'r') as f:
c=Counter()
for line in f:
line_list=line.split()
c+=Counter(line_list)
print c.most_common()
| 0 | 0 | 0 | 0 | 0 | 0 |
flowtorch/bijectors/fixed.py | vmoens/flowtorch | 207 | 1749467 | <reponame>vmoens/flowtorch<filename>flowtorch/bijectors/fixed.py
# Copyright (c) Meta Platforms, Inc
from typing import Optional, Sequence
import flowtorch
import torch
import torch.distributions
from flowtorch.bijectors.base import Bijector
class Fixed(Bijector):
def __init__(
self,
params_fn: O... | 0 | 0 | 0 | 0 | 0 | 0 |
cozette_builder/changeloggen.py | slavfox/Cozette | 1,616 | 1749468 | from git import Repo
import re
from pathlib import Path
from unicodedata import name
REPO_ROOT = Path(__file__).parent.parent
COZETTE_SFD = REPO_ROOT / "Cozette" / "Cozette.sfd"
repo = Repo(REPO_ROOT)
last_ver = sorted(repo.tags, key=lambda tag: tag.commit.committed_date)[-1]
last_cozette_sfd: str = (
last_ver
... | 1 | 1 | 1 | 0 | 3 | 0 |
astroquery/ukidss/__init__.py | hdevillepoix/astroquery | 577 | 1749484 | <reponame>hdevillepoix/astroquery<filename>astroquery/ukidss/__init__.py<gh_stars>100-1000
# Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
UKIDSS Image and Catalog Query Tool
-----------------------------------
.. topic:: Revision History
Refactored using common API as a part of Google Summer o... | 0 | 0 | 0 | 0 | 0 | 0 |
scripts/release.py | klemenkotar/dcrl | 187 | 1749488 | <reponame>klemenkotar/dcrl<filename>scripts/release.py
import os
import sys
from pathlib import Path
from subprocess import getoutput
def make_package(name, verbose=False):
"""Prepares sdist for allenact or allenact_plugins."""
orig_dir = os.getcwd()
base_dir = os.path.join(os.path.abspath(os.path.dirnam... | 0 | 0 | 0 | 0 | 0 | 0 |
etl/parsers/etw/Microsoft_Windows_SleepStudy.py | IMULMUL/etl-parser | 104 | 1749516 | # -*- coding: utf-8 -*-
"""
Microsoft-Windows-SleepStudy
GUID : d37687e7-8bf0-4d11-b589-a7abe080756a
"""
from construct import Int8sl, Int8ul, Int16ul, Int16sl, Int32sl, Int32ul, Int64sl, Int64ul, Bytes, Double, Float32l, Struct
from etl.utils import WString, CString, SystemTime, Guid
from etl.dtyp import Sid
from etl.... | 0 | 0 | 0 | 0 | 0 | 0 |
nlu/components/spell_checkers/context_spell/context_spell_checker.py | milyiyo/nlu | 480 | 1749519 | from __future__ import annotations
from sparknlp.annotator import *
class ContextSpellChecker:
@staticmethod
def get_default_model() -> object:
return ContextSpellCheckerModel.pretrained() \
.setInputCols(["token"]) \
.setOutputCol("spell")
@staticmethod
def get_pretrain... | 1 | 3 | 0 | 0 | 4 | 0 |
airflow/providers/google/suite/transfers/sql_to_sheets.py | takuti/airflow | 8,092 | 1749534 | # 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... | 10 | 2 | 4 | 0 | 16 | 0 |
tests/test_RI_SAPT.py | andyj10224/psi4numpy | 214 | 1749555 | import pytest
from addons import *
from utils import *
tdir = 'Symmetry-Adapted-Perturbation-Theory'
def test_SAPT0ao(workspace):
exe_py(workspace, tdir, 'SAPT0ao')
def test_SAPT0(workspace):
exe_py(workspace, tdir, 'SAPT0')
@pytest.mark.long
def test_SAPT0_ROHF(workspace):
exe_py(workspace, tdir, '... | 0 | 0 | 0 | 0 | 0 | 0 |
code/quaternions/operations.py | ricklentz/2dimageto3dmodel | 150 | 1749586 | <reponame>ricklentz/2dimageto3dmodel
"""
https://www.haroldserrano.com/blog/quaternions-in-computer-graphics#:~:text=Quaternions%20are%20mainly%20used%20in,sequentially%20as%20matrix%20rotation%20allows.&text=Matrix%20rotations%20suffer%20from%20what%20is%20known%20as%20Gimbal%20Lock.
author: <NAME>
"""
import torch
... | 0 | 0 | 0 | 0 | 0 | 0 |
galpy/df/quasiisothermaldf.py | gusbeane/galpy | 147 | 1749589 | <reponame>gusbeane/galpy<gh_stars>100-1000
#A 'Binney' quasi-isothermal DF
import warnings
import hashlib
import numpy
from scipy import optimize, interpolate, integrate
from .. import potential
from .. import actionAngle
from ..actionAngle import actionAngleIsochrone
from ..potential import IsochronePotential
from ..p... | 0 | 0 | 0 | 0 | 0 | 0 |
examples/wordmath/sendmoremoney.py | kai-pischke/python-constraint | 303 | 1749608 | <reponame>kai-pischke/python-constraint<gh_stars>100-1000
#!/usr/bin/python
#
# Assign equal values to equal letters, and different values to
# different letters, in a way that satisfies the following sum:
#
# SEND
# + MORE
# ------
# MONEY
#
from constraint import Problem, NotInSetConstraint, AllDifferentConstr... | 0 | 0 | 0 | 0 | 0 | 0 |
scripts/ChangeMacAddress.py | WuLC/AmazonRobot | 119 | 1749631 | <gh_stars>100-1000
# -*- coding: utf-8 -*-
# @Author: LC
# @Date: 2016-07-23 22:49:04
# @Last modified by: LC
# @Last Modified time: 2017-03-23 20:31:53
# @Email: <EMAIL>
# #########################################################################
# Function: Change mac address temporally through built-in command ... | 0 | 0 | 0 | 0 | 0 | 0 |
python3/tests/SMBConnectionTests/test_deletepattern.py | frafra/pysmb | 280 | 1749634 | # -*- coding: utf-8 -*-
import os, time, random
from io import BytesIO
from nose2.tools.decorators import with_setup, with_teardown
from smb.SMBConnection import SMBConnection
from smb import smb_structs
from .util import getConnectionInfo
conn = None
def setup_func_SMB1():
global conn
smb_structs.SUPPORT_SM... | 0 | 0 | 0 | 0 | 0 | 0 |
plaso/containers/sessions.py | log2timeline/plaso | 1,253 | 1749639 | # -*- coding: utf-8 -*-
from __future__ import annotations
"""Session related attribute container definitions."""
import collections
import time
import uuid
import plaso
from plaso.containers import interface
from plaso.containers import manager
class Session(interface.AttributeContainer):
"""Session attribute co... | 3 | 3 | 4 | 37 | 47 | 0 |
tests/test_exception.py | surajpotnuru/sqllineage | 238 | 1749646 | import pytest
from sqllineage.exceptions import SQLLineageException
from sqllineage.runner import LineageRunner
def test_select_without_table():
with pytest.raises(SQLLineageException):
LineageRunner("select * from where foo='bar'")._eval()
def test_insert_without_table():
with pytest.raises(SQLLin... | 0 | 0 | 0 | 0 | 0 | 0 |
examples/mnist.py | upul/Aurora | 111 | 1749659 | <reponame>upul/Aurora
import numpy as np
import aurora as au
import aurora.autodiff as ad
import timeit
import argparse
def measure_accuracy(activation, data, use_gpu=False):
X_val, y_val = data
executor = ad.Executor([activation], use_gpu=use_gpu)
prob_val, = executor.run(feed_shapes={X: X_val})
if u... | 0 | 0 | 0 | 0 | 0 | 0 |
migration/migrator/migrations/course/20180607070236_initial.py | elihschiff/Submitty | 411 | 1749677 | <filename>migration/migrator/migrations/course/20180607070236_initial.py
from pathlib import Path
from sqlalchemy import text
def up(config, database, semester, course):
sql_file = Path(Path(__file__).parent.parent.parent, 'data', 'course_tables.sql')
with sql_file.open() as open_file:
database.execut... | 0 | 0 | 0 | 0 | 0 | 0 |
speechbrain/nnet/complex_networks/c_normalization.py | JasonSWFu/speechbrain | 3,913 | 1749681 | <filename>speechbrain/nnet/complex_networks/c_normalization.py
"""Library implementing complex-valued normalization.
Authors
* <NAME> 2020
"""
import torch
from torch.nn import Parameter
import numpy as np
from speechbrain.nnet.complex_networks.c_ops import multi_mean
class CBatchNorm(torch.nn.Module):
"""This... | 0 | 0 | 0 | 0 | 0 | 0 |
youcook_loader.py | bryant1410/MIL-NCE_HowTo100M | 168 | 1749685 |
import torch as th
from torch.utils.data import Dataset
import pandas as pd
import os
import numpy as np
import random
import ffmpeg
import time
import re
import pickle
class Youcook_DataLoader(Dataset):
"""Youcook Video-Text loader."""
def __init__(
self,
data,
video_roo... | 9 | 8 | 0 | 1 | 18 | 0 |
f5/bigip/tm/analytics/test/functional/test_protocol_inspection.py | hixio-mh/f5-common-python | 272 | 1749690 | # Copyright 2018 F5 Networks Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writi... | 0 | 0 | 0 | 0 | 0 | 0 |
HypotenuseOfTriangle/HypotenuseOfTriangle.py | DazEB2/SimplePyScripts | 117 | 1749704 | <gh_stars>100-1000
# coding=utf-8
import math
import argparse
__author__ = 'ipetrash'
def createParser():
parse = argparse.ArgumentParser(description=u"Программа высчитывает гипотенузу прямоугольного треугольника")
parse.add_argument("-a", type=int, help=u"Первый катет")
parse.add_argument("-b", type=int,... | 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.