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 |
|---|---|---|---|---|
Script/reflect/tool_helper.py | ValtoGameEngines/Fish-Engine | 240 | 12730251 | <gh_stars>100-1000
from __future__ import print_function
import re
import os
'''CamelCase -> CamelCase
m_fieldOfView -> Field Of View
'''
def CamelCaseToReadable(string):
# http://stackoverflow.com/questions/1175208/elegant-python-function-to-convert-camelcase-to-snake-case
if string.startswith('m_'):
string = str... |
examples/package_example.py | ywchiu/flasgger | 1,696 | 12730263 | # coding: utf-8
"""
This tests the use of a view coming from installed
package.
"""
from flask import Flask, jsonify
from flasgger import Swagger
from flasgger_package import package_view
app = Flask(__name__)
swag = Swagger(app)
app.add_url_rule(
'/v1/decorated/<username>',
view_func=package_view
)
@app.... |
dirigible/sheet/cell.py | EnoX1/dirigible-spreadsheet | 168 | 12730274 | # Copyright (c) 2010 Resolver Systems Ltd, PythonAnywhere LLP
# See LICENSE.md
#
from .formula_interpreter import (
get_dependencies_from_parse_tree,
get_python_formula_from_parse_tree
)
from .parser import FormulaError, parser
class Undefined(object):
def __repr__(self):
return "<undef... |
lpot/experimental/metric/bleu.py | intelkevinputnam/lpot-docs | 172 | 12730293 | <gh_stars>100-1000
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (c) 2021 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/... |
PS4Joystick/PS4Joystick.py | jensanjo/QuadrupedRobot | 545 | 12730303 |
import sys
import time
import subprocess
import math
from threading import Thread
from collections import OrderedDict, deque
from ds4drv.actions import ActionRegistry
from ds4drv.backends import BluetoothBackend, HidrawBackend
from ds4drv.config import load_options
from ds4drv.daemon import Daemon
from ds4drv.eventl... |
tests/plugins/trackers/__init__.py | DmitryRibalka/monitorrent | 465 | 12730444 | from monitorrent.plugins.trackers import TrackerSettings
class TrackerSettingsMock(TrackerSettings):
def get_requests_kwargs(self):
result = super(TrackerSettingsMock, self).get_requests_kwargs()
result.pop('timeout')
result['verify'] = False
return result
|
pyjobs/marketing/newsletter.py | Mdslino/PyJobs | 132 | 12730477 | from django.conf import settings
import requests
import json
from mailchimp3 import MailChimp
def subscribe_user_to_mailer(profile):
status = True
if not settings.MAILERLITE_API_KEY:
return
content = json.dumps({"email": profile.user.email})
headers = {
"content-type": "application/j... |
tests/commands/test_config.py | kapb14/hatch | 2,549 | 12730483 | from click.testing import CliRunner
from hatch.cli import hatch
from hatch.settings import (
SETTINGS_FILE, copy_default_settings, load_settings, save_settings
)
from hatch.utils import temp_chdir, temp_move_path
def test_show_location():
with temp_chdir():
runner = CliRunner()
result = runne... |
tests/test_core_ants_image_io.py | xemio/ANTsPy | 338 | 12730490 | <gh_stars>100-1000
"""
Test ants_image.py
nptest.assert_allclose
self.assertEqual
self.assertTrue
"""
import os
import unittest
from common import run_tests
from tempfile import mktemp
import numpy as np
import nibabel as nib
import numpy.testing as nptest
import ants
class TestModule_ants_image_io(unittest.Test... |
corehq/apps/auditcare/tests/data/auditcare_migration.py | akashkj/commcare-hq | 471 | 12730513 | <gh_stars>100-1000
from datetime import datetime
navigation_test_docs = [
{
'description': 'Test User',
'extra': {},
'status_code': 200,
'user': '<EMAIL>',
'session_key': '14f8fb95aece47d8341dc561dfd108df',
'ip_address': '0.0.0.0',
'request_path': '/a/test-dom... |
memcnn/config/tests/test_config.py | classner/memcnn | 224 | 12730538 | import unittest
import json
import os
from memcnn.experiment.factory import load_experiment_config, experiment_config_parser
from memcnn.config import Config
import memcnn.config
class ConfigTestCase(unittest.TestCase):
class ConfigTest(Config):
@staticmethod
def get_filename():
retur... |
dialogue-engine/test/programytest/security/authorise/test_usergroups.py | cotobadesign/cotoba-agent-oss | 104 | 12730557 | <filename>dialogue-engine/test/programytest/security/authorise/test_usergroups.py<gh_stars>100-1000
"""
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 witho... |
observations/r/morley.py | hajime9652/observations | 199 | 12730598 | # -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import csv
import numpy as np
import os
import sys
from observations.util import maybe_download_and_extract
def morley(path):
"""Michelson Speed of Light Data
A classical data of... |
mayan/apps/documents/tests/test_document_views.py | atitaya1412/Mayan-EDMS | 343 | 12730623 | <gh_stars>100-1000
from django.test import override_settings
from ..events import event_document_type_changed, event_document_viewed
from ..permissions import (
permission_document_properties_edit, permission_document_view
)
from .base import GenericDocumentViewTestCase
from .mixins.document_mixins import Documen... |
test/test_consistency.py | olliethomas/torchtyping | 881 | 12730626 | import pytest
from torch import rand
from torchtyping import TensorType
from typeguard import typechecked
x = y = None
def test_single():
@typechecked
def func1(x: TensorType["x"], y: TensorType["x"]):
pass
@typechecked
def func2(x: TensorType["x"], y: TensorType["x"]) -> TensorType["x"]:
... |
03-machine-learning-tabular-crossection/06 - Clustering/01/solutions/solutions/solution_05.py | abefukasawa/datascience_course | 331 | 12730629 | <filename>03-machine-learning-tabular-crossection/06 - Clustering/01/solutions/solutions/solution_05.py
X, _ = make_blobs(n_samples = 800, centers = clusters, n_features=3) |
checkmate/checkmate_schedule.py | stjordanis/MONeT-1 | 161 | 12730649 | import torch
from collections import namedtuple
import monet.lm_ops as lm_ops
import numpy as np
from monet.graph import *
from checkmate.checkmate_solver import *
from monet.solver_info import *
from monet.pipelined_solver_info import *
from models.unet import UNet
ScheduleType = namedtuple('ScheduleType', 'recomput... |
tools/odrive/tests/endstop_manualtest.py | deafloo/ODrive | 1,068 | 12730652 | <reponame>deafloo/ODrive<gh_stars>1000+
import odrive
from odrive.enums import *
from odrive.utils import *
print("finding an odrive...")
odrv0 = odrive.find_any()
print('Odrive found')
odrv0.axis1.controller.config.vel_limit = 50000
odrv0.axis1.controller.config.control_mode = CONTROL_MODE_POSITION_CONTROL
odrv0.axi... |
envi/archs/z80/__init__.py | rnui2k/vivisect | 716 | 12730653 | '''
Z80 architecture base...
'''
|
mods/NERO_Battle/menu.py | SummitChen/opennero | 215 | 12730656 | <filename>mods/NERO_Battle/menu.py<gh_stars>100-1000
import os
import sys
sys.path.append(os.path.join(sys.path[0], os.pardir))
import NERO.menu
import NERO.constants
try:
import wx
except:
import tkMessageBox
tkMessageBox.showwarning('Warning!', 'Could not start the external menu for NERO because wxPyth... |
code/automate-download/auto-download-cu-covid19.py | eycramer/covid19-forecast-hub | 428 | 12730664 | # Before executing the script, we need urllib3. Run `pip install urllib3`
# A simple script for automatically download the ihme-covid19.zip file and extract it
import requests
import os
import sys
import calendar
import datetime
def download_file_by_date(path, date):
# metadata
prefix = "https://raw.githubuserc... |
examples/stacked_area_examples.py | ahlusar1989/vincent | 1,052 | 12730706 | <reponame>ahlusar1989/vincent
# -*- coding: utf-8 -*-
"""
Vincent Stacked Area Examples
"""
#Build a Stacked Area Chart from scratch
from vincent import *
import pandas as pd
import pandas.io.data as web
all_data = {}
for ticker in ['AAPL', 'GOOG', 'IBM', 'YHOO', 'MSFT']:
all_data[ticker] = web.get_data_yahoo(t... |
parameter_search.py | LaudateCorpus1/RIDDLE-1 | 110 | 12730723 | """parameter_search.py
Search for optimal parameters for RIDDLE and various ML classifiers.
Requires: Keras, NumPy, scikit-learn, RIDDLE (and their dependencies)
Author: <NAME>, Rzhetsky Lab
Copyright: 2018, all rights reserved
"""
from __future__ import print_function
import argparse
import os
import pickl... |
alembic/versions/2020-01-20_669e9df34ea7_add_new_netloc_tracking_table.py | fake-name/ReadableWebProxy | 193 | 12730840 | <gh_stars>100-1000
"""add new netloc tracking table
Revision ID: 669e9df34ea7
Revises: <KEY>
Create Date: 2020-01-20 01:36:51.862767
"""
# revision identifiers, used by Alembic.
revision = '669e9df34ea7'
down_revision = '<KEY>'
branch_labels = None
depends_on = None
from alembic import op
import sqlalchemy as sa
f... |
src/functionapp/azext_functionapp/_help.py | haroonf/azure-cli-extensions | 207 | 12730843 | # 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.
# -------------------------------------------------... |
python_web/manage.py | LouisYZK/Frodo | 123 | 12730880 | import os
import aiofiles
import yaml
import click
import asyncio
from datetime import datetime
from models.user import create_user
from models import Post, User
def run_async(coro):
asyncio.run(coro)
@click.group()
def cli():
...
async def _adduser(**kwargs):
try:
user = await create_user(**kwar... |
剑指offer/19_MirrorOfBinaryTree(二叉树镜像).py | PegasusWang/python_data_structures_and_algorithms | 2,468 | 12730900 | <reponame>PegasusWang/python_data_structures_and_algorithms<filename>剑指offer/19_MirrorOfBinaryTree(二叉树镜像).py
"""
请完成一个函数,输入一个二叉树,该函数输出它的镜像。
https://leetcode.com/problems/invert-binary-tree/
"""
# Definition for a binary tree node.
# class TreeNode:
# def __init__(self, x):
# self.val = x
# self.lef... |
tg/__init__.py | JingMatrix/tg | 558 | 12730903 | """
Terminal client for telegram
"""
__version__ = "0.17.0"
|
boto3_type_annotations_with_docs/boto3_type_annotations/marketplace_entitlement/paginator.py | cowboygneox/boto3_type_annotations | 119 | 12730926 | <filename>boto3_type_annotations_with_docs/boto3_type_annotations/marketplace_entitlement/paginator.py
from typing import Dict
from botocore.paginate import Paginator
class GetEntitlements(Paginator):
def paginate(self, ProductCode: str, Filter: Dict = None, PaginationConfig: Dict = None) -> Dict:
"""
... |
contact/forms.py | sreekanth1990/djangoproject.com | 1,440 | 12730936 | import logging
import django
from contact_form.forms import ContactForm
from django import forms
from django.conf import settings
from django.contrib.sites.models import Site
from django.utils.encoding import force_bytes
from pykismet3 import Akismet, AkismetServerError
logger = logging.getLogger(__name__)
class Ba... |
tests/resources/test_comment.py | Glushiator/jira | 1,639 | 12730974 | <gh_stars>1000+
from tests.conftest import JiraTestCase
class CommentTests(JiraTestCase):
def setUp(self):
JiraTestCase.setUp(self)
self.issue_1 = self.test_manager.project_b_issue1
self.issue_2 = self.test_manager.project_b_issue2
self.issue_3 = self.test_manager.project_b_issue3
... |
performance_tests/storage/test_random_access.py | avkudr/aim | 2,195 | 12730975 | <filename>performance_tests/storage/test_random_access.py
from parameterized import parameterized
from aim import Repo
from performance_tests.base import StorageTestBase
from performance_tests.utils import get_baseline, write_baseline
from performance_tests.storage.utils import random_access_metric_values
class Tes... |
common/tests/test_utils.py | krisshol/bach-kmno | 248 | 12730976 | <reponame>krisshol/bach-kmno<gh_stars>100-1000
#
# Copyright (c) 2013-2018 Quarkslab.
# This file is part of IRMA 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 in the top-level direct... |
CONFidence CTF 2014/Main event/Memory/solution/disasm.py | IMULMUL/ctf-tasks | 581 | 12730981 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Filename: disasm.py
# Author: <NAME>
# Task: Memory
# Competition: CONFidence CTF 2014
# Category: Reverse engineering
# Scoring: 50 pts (easy)
# Number of solves: 2 out of 11 participants
import struct
... |
hummingbot/connector/exchange/beaxy/beaxy_misc.py | BGTCapital/hummingbot | 3,027 | 12731000 | class BeaxyIOError(IOError):
def __init__(self, msg, response, result, *args, **kwargs):
self.response = response
self.result = result
super(BeaxyIOError, self).__init__(msg, *args, **kwargs)
|
wooey/migrations/0030_populate-sv-m2m.py | fridmundklaus/wooey | 1,572 | 12731026 | # -*- coding: utf-8 -*-
# Generated by Django 1.9.13 on 2018-01-15 15:43
from __future__ import unicode_literals
from django.db import migrations
def populate_m2m(apps, schema_editor):
ScriptParser = apps.get_model('wooey', 'ScriptParser')
ScriptParameterGroup = apps.get_model('wooey', 'ScriptParameterGroup'... |
tests/test_downloadermiddleware_stats.py | HyunTruth/scrapy | 41,267 | 12731048 | <filename>tests/test_downloadermiddleware_stats.py
from unittest import TestCase
from scrapy.downloadermiddlewares.stats import DownloaderStats
from scrapy.http import Request, Response
from scrapy.spiders import Spider
from scrapy.utils.test import get_crawler
class MyException(Exception):
pass
class TestDown... |
client/verta/tests/registry/model_version/test_log_code.py | fool-sec-review/modeldb | 835 | 12731066 | # -*- coding: utf-8 -*-
import pytest
from verta.code import Git, Notebook
pytestmark = pytest.mark.not_oss # skip if run in oss setup. Applied to entire module
class TestLogCode:
def test_log_code(self, model_version):
key1, key2, key3 = "version1", "version2", "version3"
version1 = Git(
... |
ansible/roles/monitoring_agent/files/plugins/check_drive_health.py | thogaw/docker-tools | 180 | 12731092 | <reponame>thogaw/docker-tools
#!/usr/bin/env python3
"""check_drive_health
Nagios plugin to check health of SSD and magnetic drives. Examines
SMART attributes and software-RAID status. As a drive ages,
reallocated sector counts may be recorded in SMART attributes - this
plugin provides a way to define per-drive tolera... |
venv/Lib/site-packages/ipywidgets/widgets/tests/test_docutils.py | ajayiagbebaku/NFL-Model | 2,015 | 12731143 | <reponame>ajayiagbebaku/NFL-Model
# Copyright (c) Jupyter Development Team.
# Distributed under the terms of the Modified BSD License.
from unittest import TestCase
from ipywidgets.widgets.docutils import doc_subst
class TestDocSubst(TestCase):
def test_substitution(self):
snippets = {'key': '62'}
... |
zamiaai/skills/food/food.py | 0zAND1z/zamia-ai | 129 | 12731180 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2016, 2017, 2018 <NAME>
#
# 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
#
# Unl... |
language/orqa/utils/scann_utils_test.py | Xtuden-com/language | 1,199 | 12731190 | <reponame>Xtuden-com/language
# coding=utf-8
# Copyright 2018 The Google AI Language Team 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/LICEN... |
examples/notebooks/solutions/cartpole_analytical_derivatives.py | pFernbach/crocoddyl | 322 | 12731194 | def cartpole_analytical_derivatives(model, data, x, u=None):
if u is None:
u = model.unone
# Getting the state and control variables
y, th, ydot, thdot = x[0].item(), x[1].item(), x[2].item(), x[3].item()
f = u[0].item()
# Shortname for system parameters
m1, m2, l, g = model.m1, model.... |
observations/r/nsw74psid_a.py | hajime9652/observations | 199 | 12731205 | <reponame>hajime9652/observations
# -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import csv
import numpy as np
import os
import sys
from observations.util import maybe_download_and_extract
def nsw74psid_a(path):
"""A Subset of t... |
numba/tests/doc_examples/test_llvm_pass_timings.py | auderson/numba | 6,620 | 12731237 | # "magictoken" is used for markers as beginning and ending of example text.
import unittest
from numba.tests.support import captured_stdout, override_config
class DocsLLVMPassTimings(unittest.TestCase):
def test_pass_timings(self):
with override_config('LLVM_PASS_TIMINGS', True):
with captur... |
tests/unit/alertapi30/test_enums.py | ahertz/pyowm | 799 | 12731241 | <reponame>ahertz/pyowm<filename>tests/unit/alertapi30/test_enums.py
import unittest
from pyowm.alertapi30.enums import AlertChannelsEnum, OperatorsEnum, WeatherParametersEnum
class TestAlertChannelsEnum(unittest.TestCase):
def test_items(self):
alert_channels_enum = AlertChannelsEnum()
self.asser... |
.venv/lib/python3.8/site-packages/seasonal/__init__.py | eo1989/VectorBTanalysis | 357 | 12731369 | # -*- coding: utf-8 -*-
"""
Seasonal Adjustment
==========================================
Robustly estimate and remove trend and periodicity in a noisy timeseries.
Functions
---------
fit_slope -- estimate slope of a timeseries
fit_seasons -- estimate periodicity and seasonal offsets for a timeseries
adjust_... |
ground_truth_labeling_jobs/multi_modal_parallel_sagemaker_labeling_workflows_with_step_functions/src/lambda_test/api_batch_create/main_test.py | jerrypeng7773/amazon-sagemaker-examples | 2,610 | 12731385 | import json
import os
import unittest
from unittest import TestCase
from unittest.mock import Mock, patch
from api_batch_create.main import lambda_handler
from botocore.exceptions import ClientError
from test_shared.mock_objects import InputTestData, TestContext
class TestCase(TestCase):
def mock_sagemaker_api_c... |
scvelo/pp.py | WeilerP/scvelo | 272 | 12731422 | <gh_stars>100-1000
from scvelo.preprocessing import * # noqa
|
tests/test_stringsifter.py | digitalsleuth/stringsifter | 523 | 12731457 | <reponame>digitalsleuth/stringsifter
# Copyright (C) 2019 FireEye, Inc. All Rights Reserved.
import os
import numpy
from io import StringIO
import stringsifter.rank_strings as rank_strings
test_strings = 'testing text\n' \
'nagain\n' \
'wheredoesitgo\n' \
'testing text\... |
src/plugins_/in_file_completions/in_file_completions.py | jcberquist/sublimetext-cfml | 130 | 12731459 | from ... import utils, component_index
def get_script_completions(cfml_view):
completions = component_index.build_file_completions(cfml_view.view_metadata)[
utils.get_setting("cfml_cfc_completions")
]
completions = [
make_completion(completion, cfml_view.file_path)
for completion i... |
bin/commands/citations_csv.py | davidmcclure/open-syllabus-project | 220 | 12731481 |
import click
import csv
from osp.citations.models import Text, Citation, Text_Index
from peewee import fn
@click.group()
def cli():
pass
@cli.command()
@click.argument('out_file', type=click.File('w'))
@click.option('--min_count', default=100)
def fuzz(out_file, min_count):
"""
Write a CSV with tit... |
example/extensions/lib_custom_op/test_gemm.py | mozga-intel/incubator-mxnet | 211 | 12731555 | <filename>example/extensions/lib_custom_op/test_gemm.py
#!/usr/bin/env python3
# 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... |
lib/python2.7/site-packages/samba/netcmd/gpo.py | abankalarm/pth-toolkit | 480 | 12731560 | <gh_stars>100-1000
# implement samba_tool gpo commands
#
# Copyright <NAME> 2010
# Copyright <NAME> 2011-2012 <<EMAIL>>
#
# based on C implementation by <NAME> and <NAME>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the... |
python/ql/test/library-tests/frameworks/aiohttp/routing_test.py | timoles/codeql | 4,036 | 12731565 | # Inspired by https://docs.aiohttp.org/en/stable/web_quickstart.html
# and https://docs.aiohttp.org/en/stable/web_quickstart.html#resources-and-routes
from aiohttp import web
app = web.Application()
## ================================= ##
## Ways to specify routes / handlers ##
## =================================... |
parallel/1-Async-Q-Learning/worker.py | g6ling/Pytorch-Cartpole | 116 | 12731652 | <filename>parallel/1-Async-Q-Learning/worker.py
import gym
import torch
import torch.multiprocessing as mp
import numpy as np
from model import QNet
from memory import Memory
from config import env_name, async_update_step, update_target, max_episode, device, log_interval, goal_score
class Worker(mp.Process):
def ... |
models/image_recognition/tensorflow/resnet50v1_5/training/mlperf_compliance/_ssd_tags.py | yangw1234/models-1 | 567 | 12731674 | # Copyright 2018 MLBenchmark Group. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable l... |
tools/Vitis-AI-Quantizer/vai_q_pytorch/pytorch_binding/pytorch_nndct/utils/__init__.py | bluetiger9/Vitis-AI | 848 | 12731704 | from .torch_op_attr import *
from .nndct2torch_op_map import *
from .op_register import *
from .torch_const import *
from .tensor_utils import *
from .schema import *
|
tests/test_action_interface_vrrp_vip.py | cognifloyd/stackstorm-vdx | 164 | 12731732 | <gh_stars>100-1000
"""Generated test for checking pynos based actions
"""
import xml.etree.ElementTree as ET
from st2tests.base import BaseActionTestCase
from interface_vrrp_vip import interface_vrrp_vip
__all__ = [
'TestInterfaceVrrpVip'
]
class MockCallback(object): # pylint:disable=too-few-public-methods
... |
tests/test_dithering.py | hamidralmasi/byteps | 3,361 | 12731753 | # Copyright 2020 Amazon Technologies, Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... |
html_parsing/Wikipedia__Timeline_of_release_years/Mortal_Kombat__series.py | DazEB2/SimplePyScripts | 117 | 12731778 | <reponame>DazEB2/SimplePyScripts<filename>html_parsing/Wikipedia__Timeline_of_release_years/Mortal_Kombat__series.py
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
__author__ = 'ipetrash'
# Хронология выхода игр
from common import get_parsed_two_column_wikitable
def is_match_table_func(table) -> bool:
return... |
src/chime_dash/app/components/intro.py | riverkoko/chime | 222 | 12731832 | <gh_stars>100-1000
"""components/intro
initializes the leading text as of right now
currently both classes handle control and view this should be separated
with the logic for dynamic text moving to services.
"""
from typing import List
from dash.development.base_component import ComponentMeta
from dash_core_component... |
tests/test_models.py | kaaass/BGmi | 483 | 12731838 | <filename>tests/test_models.py
from bgmi.lib.models import Filter
from bgmi.website.model import Episode
def test_include():
e = Filter(include="2,3,5").apply_on_episodes(
[
Episode(name="1", title="1", download="1", episode=1),
Episode(name="1", title="1", download="2", episode=1)... |
release/stubs.min/System/__init___parts/ResolveEventArgs.py | htlcnn/ironpython-stubs | 182 | 12731863 | <filename>release/stubs.min/System/__init___parts/ResolveEventArgs.py
class ResolveEventArgs(EventArgs):
"""
Provides data for loader resolution events,such as the System.AppDomain.TypeResolve,System.AppDomain.ResourceResolve,System.AppDomain.ReflectionOnlyAssemblyResolve,and System.AppDomain.AssemblyResolve events... |
tridet/data/augmentations/color_transform.py | flipson/dd3d | 227 | 12731923 | # Copyright 2021 Toyota Research Institute. All rights reserved.
# pylint: disable=unused-argument
from fvcore.transforms.transform import BlendTransform
from detectron2.data.transforms import RandomBrightness as _RandomBrightness
from detectron2.data.transforms import RandomContrast as _RandomContrast
from detectron... |
datapackage_pipelines/generators/schedules.py | gperonato/datapackage-pipelines | 109 | 12731981 | SCHEDULE_NONE = None
SCHEDULE_HOURLY = '0 * * * *'
SCHEDULE_DAILY = '0 0 * * *'
SCHEDULE_WEEKLY = '0 0 * * 0'
SCHEDULE_MONTHLY = '0 0 1 * *'
SCHEDULE_YEARLY = '0 0 1 1 *'
|
indra/util/perm_cache.py | zebulon2/indra | 136 | 12731999 | <gh_stars>100-1000
__all__ = ['perm_cache']
import json
import pickle
from functools import update_wrapper
from os.path import exists
def perm_cache(cache_type='pkl', cache_file=None):
class PermCache(object):
_cache_type = cache_type
_cache_file = cache_file
def __init__(self, func):
... |
toy/visualise-dataset.py | Cyanogenoid/vqa-counting | 205 | 12732035 | <reponame>Cyanogenoid/vqa-counting
import sys
import random
import data
import torch
import matplotlib.pyplot as plt
import matplotlib.patches as patches
plt.rc('text', usetex=True)
plt.rc('font', family='serif', serif='Times')
q = float(sys.argv[1])
# guessing seeds for nice looking datasets
torch.manual_seed(int... |
pages/cache.py | timbortnik/django-page-cms | 113 | 12732098 | # -*- coding: utf-8 -*-
from django.core.cache import caches
from django.core.cache.backends.base import InvalidCacheBackendError
try:
cache = caches['pages']
except InvalidCacheBackendError:
cache = caches['default']
|
tests/godagtimed_old.py | flying-sheep/goatools | 477 | 12732122 | #!/usr/bin/env python
"""Test deprecated location of GoDagTimed"""
import os
import timeit
from goatools.test_data.godag_timed import GoDagTimed
from goatools.test_data.godag_timed import prt_hms
from goatools.base import download_go_basic_obo
REPO = os.path.join(os.path.dirname(os.path.abspath(__file__)), "..")
def... |
tools/noms/pushd.py | rajeev02101987/noms | 8,126 | 12732137 | #!/usr/bin/python
# Copyright 2016 <NAME>, Inc. All rights reserved.
# Licensed under the Apache License, version 2.0:
# http://www.apache.org/licenses/LICENSE-2.0
import os
from contextlib import contextmanager
@contextmanager
def pushd(path):
currentDir = os.getcwd()
os.chdir(path)
yield
os.chdir(c... |
social/backends/beats.py | raccoongang/python-social-auth | 1,987 | 12732147 | <filename>social/backends/beats.py<gh_stars>1000+
from social_core.backends.beats import BeatsOAuth2
|
gateway/lora/aes-python-lib/LoRaWAN/PhyPayload.py | leavitia/ioticd | 654 | 12732166 | <filename>gateway/lora/aes-python-lib/LoRaWAN/PhyPayload.py
#
# lorawan packet: mhdr(1) mac_payload(1..N) mic(4)
#
from MalformedPacketException import MalformedPacketException
from MHDR import MHDR
from Direction import Direction
from MacPayload import MacPayload
class PhyPayload:
def __init__(self, key):
... |
google-api-client-generator/src/googleapis/codegen/unicode_test.py | cclauss/discovery-artifact-manager | 709 | 12732170 | #!/usr/bin/python2.7
# -*- coding: utf-8 -*-
# Copyright 2010 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/LICEN... |
tests/test_tower.py | theosech/ec | 290 | 12732191 | <gh_stars>100-1000
import unittest
class TestTowerMain(unittest.TestCase):
def test_imports(self):
try:
from dreamcoder.domains.tower.main import (
Flatten,
TowerCNN,
tower_options,
dreamOfTowers,
visualizePrimiti... |
shynet/core/migrations/0006_service_hide_referrer_regex.py | f97/shynet | 1,904 | 12732201 | # Generated by Django 3.0.6 on 2020-05-07 21:23
from django.db import migrations, models
import core.models
class Migration(migrations.Migration):
dependencies = [
("core", "0005_service_ignored_ips"),
]
operations = [
migrations.AddField(
model_name="service",
... |
lithops/util/joblib/lithops_backend.py | kpavel/lithops | 158 | 12732237 | #
# (C) Copyright Cloudlab URV 2021
#
# 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 wr... |
gammapy/astro/darkmatter/utils.py | Rishank2610/gammapy | 155 | 12732238 | <filename>gammapy/astro/darkmatter/utils.py
# Licensed under a 3-clause BSD style license - see LICENSE.rst
"""Utilities to compute J-factor maps."""
import astropy.units as u
__all__ = ["JFactory"]
class JFactory:
"""Compute J-Factor maps.
All J-Factors are computed for annihilation. The assumed dark matte... |
iCaRL-Tensorflow/main_resnet_tf.py | augustoolucas/iCaRL | 215 | 12732314 | <filename>iCaRL-Tensorflow/main_resnet_tf.py<gh_stars>100-1000
import tensorflow as tf
config = tf.ConfigProto()
config.gpu_options.allow_growth = True
import numpy as np
import scipy
import os
import scipy.io
import sys
try:
import cPickle
except:
import _pickle as cPickle
# Syspath for the folder with the uti... |
quarkc/test/ffi/expected/py/dependencies/docs/conf.py | datawire/quark | 112 | 12732336 | # -*- coding: utf-8 -*-
#
# dependencies documentation build configuration file, created by Quark
extensions = [
'sphinx.ext.autodoc',
'sphinx.ext.napoleon'
]
templates_path = ['_templates']
source_suffix = '.rst'
master_doc = 'index'
project = u'dependencies'
copyright = u'2015, dependencies authors'
author = ... |
misc/update/python/backfill_threaded.py | sy3kic/nZEDb | 472 | 12732351 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import print_function
import sys, os, time
import threading
try:
import queue
except ImportError:
import Queue as queue
import subprocess
import string
import signal
import datetime
import lib.info as info
from lib.info import bcolors
conf = info.readCon... |
modules/nltk_contrib/mit/six863/tagging/tagparse.py | h4ck3rm1k3/NLP-project | 123 | 12732377 | <reponame>h4ck3rm1k3/NLP-project<filename>modules/nltk_contrib/mit/six863/tagging/tagparse.py
from nltk.parse import chart
from nltk import cfg
from drawchart import ChartDemo
from nltk.tokenize.regexp import wordpunct
#from nltk_contrib.mit.six863.kimmo import *
import re, pickle
def chart_tagger(tagger):
def ins... |
ai_economist/foundation/base/base_agent.py | sarahlc888/ai-economist | 795 | 12732385 | # Copyright (c) 2020, 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 random
import numpy as np
from ai_economist.foundation.base.registrar import Registry
cla... |
test/tests/test_compatibility.py | nolim1t/specter-diy | 279 | 12732407 | <filename>test/tests/test_compatibility.py
from unittest import TestCase
from apps.compatibility import *
import json
from io import BytesIO
WALLET_SOFTWARE = b'{"label": "blah", "blockheight": 0, "descriptor": "wsh(sortedmulti(1,[fb7c1f11/48h/1h/0h/2h]tpubDExnGppazLhZPNadP8Q5Vgee2QcvbyAf9GvGaEY7ALVJREaG2vdTqv1MHRoDtP... |
plenum/test/metrics/conftest.py | andkononykhin/plenum | 148 | 12732411 | <gh_stars>100-1000
import pytest
from plenum.common.constants import KeyValueStorageType
from storage.helper import initKeyValueStorage
from storage.kv_store import KeyValueStorage
db_no = 0
@pytest.yield_fixture(params=[KeyValueStorageType.Rocksdb,
KeyValueStorageType.Leveldb,
... |
scitbx/source_generators/lbfgs_fem.py | rimmartin/cctbx_project | 155 | 12732419 | from __future__ import absolute_import, division, print_function
import os
def run():
import libtbx.load_env
src_dir = libtbx.env.under_dist(
module_name="scitbx", path="lbfgs", test=os.path.isdir)
import fable.read
all_fprocs = fable.read.process(
file_names=[os.path.join(src_dir, f) for f in ["sdriv... |
python_toolbox/wx_tools/widgets/hue_selection_dialog/textual.py | hboshnak/python_toolbox | 119 | 12732495 | <reponame>hboshnak/python_toolbox
# Copyright 2009-2011 <NAME>.
# This program is distributed under the LGPL2.1 license.
'''
Defines the `Textual` class.
See its documentation for more details.
'''
from __future__ import division
import wx
from python_toolbox import freezing
from python_toolbox import wx_tools
fro... |
dataflows/processors/conditional.py | cschloer/dataflows | 160 | 12732500 | from .. import DataStreamProcessor
class conditional(DataStreamProcessor):
def __init__(self, predicate, flow):
super().__init__()
self.predicate = predicate
self.flow = flow
def _process(self):
ds = self.source._process()
if self.predicate(ds.dp):
if call... |
caffe2/python/operator_test/string_ops_test.py | KevinKecc/caffe2 | 585 | 12732522 | # Copyright (c) 2016-present, Facebook, 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... |
tests/integration/cartography/intel/pagerduty/test_schedules.py | ramonpetgrave64/cartography | 2,322 | 12732614 | <reponame>ramonpetgrave64/cartography
import cartography.intel.pagerduty.schedules
import tests.data.pagerduty.schedules
TEST_UPDATE_TAG = 123456789
def test_load_schedule_data(neo4j_session):
schedule_data = tests.data.pagerduty.schedules.LIST_SCHEDULES_DATA
cartography.intel.pagerduty.schedules.load_schedu... |
pyclue/tf1/models/engine/__init__.py | CLUEbenchmark/PyCLUE | 122 | 12732618 | <reponame>CLUEbenchmark/PyCLUE
#!/usr/bin/python3
"""
@Author: <NAME>
@Site: https://github.com/liushaoweihua
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
|
utils/ngworead.py | haygcao/UnicomDailyTask | 148 | 12732621 | <reponame>haygcao/UnicomDailyTask
# -*- coding: utf8 -*-
from utils.config import BASE_DIR
from Crypto.Cipher import AES
from Crypto.Util.Padding import unpad, pad
from hashlib import md5
import base64
import execjs
import json
def auth_sign(appId, timestamp, key='<KEY>'):
return md5(''.join([appId, key, str(time... |
machina/models/__init__.py | AswinRetnakumar/Machina | 302 | 12732625 | from machina.models.base import BaseModel
from machina.models.deterministic_state_model import DeterministicSModel
|
scripts/staging/sklearn/tests/util.py | mgd-hin/systemds | 372 | 12732636 | # -------------------------------------------------------------
#
# 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 unde... |
tests/integration/workflows/go_modules/utils.py | ekmixon/aws-lambda-builders | 180 | 12732678 | from elftools.elf.elffile import ELFFile
def get_executable_arch(path):
"""
Returns the architecture of an executable binary
Parameters
----------
path : str
path to the Go binaries generated
Returns
-------
str
Architecture type of the generated binaries
"""
... |
tests/core/wrapper/test_solc_wrapper.py | Jonasmpi/py-solc | 153 | 12732681 | from __future__ import unicode_literals
import pytest
import json
import os
from solc import get_solc_version
from solc.wrapper import (
solc_wrapper,
)
def is_benign(err):
return not err or err in (
'Warning: This is a pre-release compiler version, please do not use it in production.\n',
)
d... |
examples/property_prediction/MTL/model/__init__.py | siboehm/dgl-lifesci | 390 | 12732683 | <filename>examples/property_prediction/MTL/model/__init__.py
from .gcn import GCNRegressor, GCNRegressorBypass
from .gat import GATRegressor, GATRegressorBypass
from .mpnn import MPNNRegressor, MPNNRegressorBypass
from .attentivefp import AttentiveFPRegressor, AttentiveFPRegressorBypass |
nautobot/core/runner/importer.py | psmware-ltd/nautobot | 384 | 12732698 | <filename>nautobot/core/runner/importer.py<gh_stars>100-1000
"""
logan.importer
~~~~~~~~~~~~~~
:copyright: (c) 2012 <NAME>.
:license: Apache License 2.0, see LICENSE for more details.
"""
from __future__ import absolute_import, unicode_literals
try:
unicode
except NameError:
basestring = unicode = str # Pyt... |
pollbot/display/__init__.py | tigerdar004/RweddingPoll | 112 | 12732703 | <reponame>tigerdar004/RweddingPoll
# Import for easier re-export
from .poll import * # noqa
from .settings import * # noqa
|
train.py | DoranLyong/person-reid-tiny-baseline | 202 | 12732779 | import os
from torch.backends import cudnn
from config import Config
from utils.logger import setup_logger
from datasets import make_dataloader
from model import make_model
from solver import make_optimizer, WarmupMultiStepLR
from loss import make_loss
from processor import do_train
if __name__ == '__main__':
cfg... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.