hexsha stringlengths 40 40 | size int64 2 1.02M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 245 | max_stars_repo_name stringlengths 6 130 | max_stars_repo_head_hexsha stringlengths 40 40 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 245 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 245 | max_forks_repo_name stringlengths 6 130 | max_forks_repo_head_hexsha stringlengths 40 40 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 2 1.02M | avg_line_length float64 1 958k | max_line_length int64 1 987k | alphanum_fraction float64 0 1 | content_no_comment stringlengths 0 1.01M | is_comment_constant_removed bool 2
classes | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1c31dd3666a6e69efaca05e0c7374cf000e8afd4 | 4,336 | py | Python | tests/primitives.py | plotdevice/plotdevice | 598f66a19cd58b8cfea8295024998b322ed66adf | [
"MIT"
] | 110 | 2015-01-17T03:22:51.000Z | 2022-02-12T06:04:27.000Z | tests/primitives.py | Jason-Cooke/plotdevice | 598f66a19cd58b8cfea8295024998b322ed66adf | [
"MIT"
] | 38 | 2015-01-02T01:06:59.000Z | 2021-10-05T06:34:42.000Z | tests/primitives.py | Jason-Cooke/plotdevice | 598f66a19cd58b8cfea8295024998b322ed66adf | [
"MIT"
] | 17 | 2015-04-28T17:29:03.000Z | 2021-07-11T21:26:25.000Z | # encoding: utf-8
import unittest
from . import PlotDeviceTestCase, reference
from plotdevice import *
class PrimitivesTests(PlotDeviceTestCase):
@reference('primitives/primitives-arc.png')
def test_primitives_arc(self):
# tut/Primitives (1)
size(150, 75)
arc(75,25, 25)
@reference(... | 26.278788 | 52 | 0.573801 |
import unittest
from . import PlotDeviceTestCase, reference
from plotdevice import *
class PrimitivesTests(PlotDeviceTestCase):
@reference('primitives/primitives-arc.png')
def test_primitives_arc(self):
size(150, 75)
arc(75,25, 25)
@reference('primitives/primitives-square.png')
... | true | true |
1c31dd6a0b4063761667a82dffffdd16b7808469 | 333 | py | Python | foreshadow/concrete/__init__.py | adithyabsk/foreshadow | ca2e927c396ae0d61923b287d6e32e142f3ba96f | [
"Apache-2.0"
] | 25 | 2018-07-26T17:30:31.000Z | 2021-02-23T22:54:01.000Z | foreshadow/concrete/__init__.py | adithyabsk/foreshadow | ca2e927c396ae0d61923b287d6e32e142f3ba96f | [
"Apache-2.0"
] | 150 | 2018-11-02T18:09:12.000Z | 2020-05-15T01:01:35.000Z | foreshadow/concrete/__init__.py | adithyabsk/foreshadow | ca2e927c396ae0d61923b287d6e32e142f3ba96f | [
"Apache-2.0"
] | 1 | 2019-02-20T22:24:00.000Z | 2019-02-20T22:24:00.000Z | """All the concrete transformers provided by foreshadow."""
from foreshadow.concrete.externals import * # noqa: F403, F401
from foreshadow.concrete.externals import __all__ as e_all
from foreshadow.concrete.internals import * # noqa: F403, F401
from foreshadow.concrete.internals import __all__ as i_all
__all__ = i... | 33.3 | 63 | 0.78979 |
from foreshadow.concrete.externals import *
from foreshadow.concrete.externals import __all__ as e_all
from foreshadow.concrete.internals import *
from foreshadow.concrete.internals import __all__ as i_all
__all__ = i_all + e_all
| true | true |
1c31dd8a5d1d70e3cb9aa10c601dc19b9d8805e7 | 1,564 | py | Python | flexget/components/bittorrent/magnet_info_hash.py | metaMMA/Flexget | a38986422461d7935ead1e2b4ed4c88bcd0a90f5 | [
"MIT"
] | null | null | null | flexget/components/bittorrent/magnet_info_hash.py | metaMMA/Flexget | a38986422461d7935ead1e2b4ed4c88bcd0a90f5 | [
"MIT"
] | 1 | 2017-10-09T23:06:44.000Z | 2017-10-09T23:06:44.000Z | flexget/components/bittorrent/magnet_info_hash.py | metaMMA/Flexget | a38986422461d7935ead1e2b4ed4c88bcd0a90f5 | [
"MIT"
] | null | null | null | from __future__ import unicode_literals, division, absolute_import
from builtins import * # noqa pylint: disable=unused-import, redefined-builtin
import logging
import base64
import re
from flexget import plugin
from flexget.event import event
log = logging.getLogger('magnet_btih')
class MagnetBtih(object):
"... | 35.545455 | 91 | 0.582481 | from __future__ import unicode_literals, division, absolute_import
from builtins import *
import logging
import base64
import re
from flexget import plugin
from flexget.event import event
log = logging.getLogger('magnet_btih')
class MagnetBtih(object):
schema = {'type': 'boolean'}
def on_task_metainfo(... | true | true |
1c31df6c495e7182d04ca6e28ef9d3d06610c7dd | 15,222 | py | Python | src/sage/schemes/toric/ideal.py | LaisRast/sage | 5fb2a6ea44400e469caee82748cf863ca0c5f724 | [
"BSL-1.0"
] | null | null | null | src/sage/schemes/toric/ideal.py | LaisRast/sage | 5fb2a6ea44400e469caee82748cf863ca0c5f724 | [
"BSL-1.0"
] | null | null | null | src/sage/schemes/toric/ideal.py | LaisRast/sage | 5fb2a6ea44400e469caee82748cf863ca0c5f724 | [
"BSL-1.0"
] | null | null | null | r"""
Toric ideals
A toric ideal (associated to an integer matrix `A`) is an ideal of the
form
.. MATH::
I_A = \left<
x^u - x^v
: u,v \in \ZZ_\geq^n
, u-v \in \ker(A)
\right>
In other words, it is an ideal generated by irreducible "binomials",
that is, differences of monomials wit... | 32.87689 | 100 | 0.549074 |
from sage.rings.polynomial.polynomial_ring_constructor import PolynomialRing
from sage.misc.misc_c import prod
from sage.matrix.constructor import matrix
from sage.rings.integer_ring import ZZ
from sage.rings.rational_field import QQ
from sage.rings.polynomial.multi_polynomial_ideal import MPolynomialI... | true | true |
1c31e113234907191663c0d92055af47b297a82a | 4,808 | py | Python | utils.py | Wendy-Xiao/ext_summ_disco_tree_attn | 5ff99c8260350c677e140b02521c75ac03d16673 | [
"MIT"
] | 6 | 2020-11-14T04:31:31.000Z | 2021-12-31T02:18:56.000Z | utils.py | Wendy-Xiao/ext_summ_disco_tree_attn | 5ff99c8260350c677e140b02521c75ac03d16673 | [
"MIT"
] | 1 | 2020-12-16T07:08:11.000Z | 2020-12-16T19:46:29.000Z | utils.py | Wendy-Xiao/ext_summ_disco_tree_attn | 5ff99c8260350c677e140b02521c75ac03d16673 | [
"MIT"
] | 1 | 2022-02-16T13:12:56.000Z | 2022-02-16T13:12:56.000Z | from collections import Counter
from pathlib import Path
from random import random
import rouge_papier_v2
import pandas as pd
import re
import numpy as np
import os
import json
import torch
import os
import subprocess
# import matplotlib.pyplot as plt
# Utility functions
def get_posweight(inputs_dir):
inputs_dir = P... | 35.614815 | 119 | 0.720674 | from collections import Counter
from pathlib import Path
from random import random
import rouge_papier_v2
import pandas as pd
import re
import numpy as np
import os
import json
import torch
import os
import subprocess
def get_posweight(inputs_dir):
inputs_dir = Path(inputs_dir)
all_files = [path for path in input... | true | true |
1c31e28c29cf19ed0c6c02d83971db1f3eb61dc1 | 3,107 | py | Python | tests/unit/scenarios/ironic/test_nodes.py | RSE-Cambridge/rally-openstack | 32bbc091bbce1db625a2fc22da28b32718befa13 | [
"Apache-2.0"
] | null | null | null | tests/unit/scenarios/ironic/test_nodes.py | RSE-Cambridge/rally-openstack | 32bbc091bbce1db625a2fc22da28b32718befa13 | [
"Apache-2.0"
] | null | null | null | tests/unit/scenarios/ironic/test_nodes.py | RSE-Cambridge/rally-openstack | 32bbc091bbce1db625a2fc22da28b32718befa13 | [
"Apache-2.0"
] | 1 | 2018-12-10T12:31:27.000Z | 2018-12-10T12:31:27.000Z | # Copyright 2015: Mirantis 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 b... | 37.890244 | 79 | 0.635661 |
import mock
from rally import exceptions
from rally_openstack.scenarios.ironic import nodes
from tests.unit import test
class IronicNodesTestCase(test.ScenarioTestCase):
def test_create_and_list_node(self):
class Node(object):
def __init__(self, name):
self.nam... | true | true |
1c31e295e8c14d94e58e8f3701d4b9e685c4ce8f | 486 | py | Python | django-loaders/loaders/migrations/0003_auto_20171211_2042.py | nabbisen/python-django2-tutorials | c6fd75366587f936e22293e02e1c1c1e374adf2a | [
"MIT"
] | null | null | null | django-loaders/loaders/migrations/0003_auto_20171211_2042.py | nabbisen/python-django2-tutorials | c6fd75366587f936e22293e02e1c1c1e374adf2a | [
"MIT"
] | null | null | null | django-loaders/loaders/migrations/0003_auto_20171211_2042.py | nabbisen/python-django2-tutorials | c6fd75366587f936e22293e02e1c1c1e374adf2a | [
"MIT"
] | null | null | null | # Generated by Django 2.0 on 2017-12-11 11:42
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('loaders', '0002_auto_20171211_1732'),
]
operations = [
migrations.AlterField(
model_name='agency'... | 24.3 | 110 | 0.652263 |
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('loaders', '0002_auto_20171211_1732'),
]
operations = [
migrations.AlterField(
model_name='agency',
name='commission_form',
... | true | true |
1c31e2a3e3db553efe6f011e3997b03fa5efba1c | 1,180 | py | Python | tests/test_cli_serve_server.py | mwatts/datasette | 8c401ee0f054de2f568c3a8302c9223555146407 | [
"Apache-2.0"
] | 5,978 | 2017-11-13T21:59:52.000Z | 2022-03-31T12:10:42.000Z | tests/test_cli_serve_server.py | mwatts/datasette | 8c401ee0f054de2f568c3a8302c9223555146407 | [
"Apache-2.0"
] | 1,482 | 2017-11-13T21:19:43.000Z | 2022-03-31T07:45:26.000Z | tests/test_cli_serve_server.py | mwatts/datasette | 8c401ee0f054de2f568c3a8302c9223555146407 | [
"Apache-2.0"
] | 439 | 2017-11-13T22:03:30.000Z | 2022-03-30T08:00:39.000Z | import httpx
import pytest
import socket
@pytest.mark.serial
def test_serve_localhost_http(ds_localhost_http_server):
response = httpx.get("http://localhost:8041/_memory.json")
assert {
"database": "_memory",
"path": "/_memory",
"tables": [],
}.items() <= response.json().items()
... | 28.780488 | 83 | 0.666102 | import httpx
import pytest
import socket
@pytest.mark.serial
def test_serve_localhost_http(ds_localhost_http_server):
response = httpx.get("http://localhost:8041/_memory.json")
assert {
"database": "_memory",
"path": "/_memory",
"tables": [],
}.items() <= response.json().items()
... | true | true |
1c31e2b3fe42291dc91cfb70aee5b32968fa8ba2 | 70,017 | py | Python | src/command_modules/azure-cli-vm/azure/cli/command_modules/vm/_help.py | stefanb995/azure-cli | d1c0c406d3ec42e496770fc3f81f53de06e4b18c | [
"MIT"
] | null | null | null | src/command_modules/azure-cli-vm/azure/cli/command_modules/vm/_help.py | stefanb995/azure-cli | d1c0c406d3ec42e496770fc3f81f53de06e4b18c | [
"MIT"
] | null | null | null | src/command_modules/azure-cli-vm/azure/cli/command_modules/vm/_help.py | stefanb995/azure-cli | d1c0c406d3ec42e496770fc3f81f53de06e4b18c | [
"MIT"
] | null | null | null | # 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.
# -----------------------------------------------------... | 39.006685 | 329 | 0.707185 |
from knack.help_files import helps
helps['disk'] = """
type: group
short-summary: Manage Azure Managed Disks.
long-summary: >4
Azure Virtual Machines use disks as a place to store an operating system, applications, and data.
All Azure virtual machines have at least two disks: An operating system disk, ... | true | true |
1c31e33a225d329db4b0d6e1fde6090b3aa90df9 | 881 | py | Python | back/depends/user.py | Bash-Air/bashair | 76d07c0cca9323f5089d0c49450470bde887c4ea | [
"MIT"
] | null | null | null | back/depends/user.py | Bash-Air/bashair | 76d07c0cca9323f5089d0c49450470bde887c4ea | [
"MIT"
] | null | null | null | back/depends/user.py | Bash-Air/bashair | 76d07c0cca9323f5089d0c49450470bde887c4ea | [
"MIT"
] | 1 | 2022-02-14T11:27:50.000Z | 2022-02-14T11:27:50.000Z | from django.contrib.auth.models import User
from fastapi import Depends, HTTPException
from fastapi.security import HTTPBearer, HTTPAuthorizationCredentials
from fastapi_jwt_auth import AuthJWT
from jose import JWTError
from back.utils.exceptions import Credentials
def get_current_user(auth: AuthJWT = Depends(), cre... | 31.464286 | 115 | 0.750284 | from django.contrib.auth.models import User
from fastapi import Depends, HTTPException
from fastapi.security import HTTPBearer, HTTPAuthorizationCredentials
from fastapi_jwt_auth import AuthJWT
from jose import JWTError
from back.utils.exceptions import Credentials
def get_current_user(auth: AuthJWT = Depends(), cre... | true | true |
1c31e3562725a00bab24cf0a53bf3d7bbc8ab967 | 32,836 | py | Python | djangosaml2/tests/__init__.py | yvess/djangosaml2 | 5561d114c8721abde6d7b9967e9cc36732bcfb9d | [
"Apache-2.0"
] | 2 | 2021-04-23T09:16:15.000Z | 2021-06-14T14:35:49.000Z | djangosaml2/tests/__init__.py | yvess/djangosaml2 | 5561d114c8721abde6d7b9967e9cc36732bcfb9d | [
"Apache-2.0"
] | 1 | 2018-11-26T17:02:54.000Z | 2018-11-26T17:02:54.000Z | djangosaml2/tests/__init__.py | yvess/djangosaml2 | 5561d114c8721abde6d7b9967e9cc36732bcfb9d | [
"Apache-2.0"
] | 1 | 2018-04-23T15:17:32.000Z | 2018-04-23T15:17:32.000Z | # Copyright (C) 2012 Sam Bull (lsb@pocketuniverse.ca)
# Copyright (C) 2011-2012 Yaco Sistemas (http://www.yaco.es)
# Copyright (C) 2010 Lorenzo Gil Sanchez <lorenzo.gil.sanchez@gmail.com>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the Licens... | 58.116814 | 1,852 | 0.701578 |
import datetime
import base64
import re
from unittest import skip
import sys
from django.conf import settings
from django.contrib.auth import SESSION_KEY, get_user_model
from django.contrib.auth.models import AnonymousUser
from django.contrib.sessions.middleware import SessionMiddleware
try:
from d... | true | true |
1c31e595cdd83f4d43facb3e59e7e4944fd03f64 | 6,572 | py | Python | continuous_delivery_scripts/plugins/golang.py | ARMmbed/continuous-delivery-scripts | 3df724ae5705c675261349ecd3ac38b0781c1d65 | [
"Apache-2.0"
] | 2 | 2021-09-10T14:01:24.000Z | 2022-02-08T10:21:27.000Z | continuous_delivery_scripts/plugins/golang.py | acabarbaye/continuous-delivery-scripts-1 | 3df724ae5705c675261349ecd3ac38b0781c1d65 | [
"Apache-2.0"
] | 29 | 2020-11-30T10:02:57.000Z | 2022-03-29T06:14:54.000Z | continuous_delivery_scripts/plugins/golang.py | acabarbaye/continuous-delivery-scripts-1 | 3df724ae5705c675261349ecd3ac38b0781c1d65 | [
"Apache-2.0"
] | 1 | 2021-09-10T14:01:38.000Z | 2021-09-10T14:01:38.000Z | #
# Copyright (C) 2020-2021 Arm Limited or its affiliates and Contributors. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
#
"""Plugin for Golang projects."""
import logging
import os
from pathlib import Path
from typing import Optional, List
from subprocess import check_call
from continuous_delivery_script... | 38.209302 | 113 | 0.706939 |
import logging
import os
from pathlib import Path
from typing import Optional, List
from subprocess import check_call
from continuous_delivery_scripts.utils.language_specifics_base import BaseLanguage, get_language_from_file_name
from continuous_delivery_scripts.spdx_report.spdx_project import SpdxProject
from cont... | true | true |
1c31e59cfa13f341e8e9d09d9ddc476b52177ea9 | 7,442 | py | Python | ml-agents/mlagents/trainers/tests/test_simple_rl.py | robertnoneman/ml-agents | 797b0e880f4db61ab36783357bf555621affce2a | [
"Apache-2.0"
] | 1 | 2019-01-20T19:57:46.000Z | 2019-01-20T19:57:46.000Z | ml-agents/mlagents/trainers/tests/test_simple_rl.py | ruairidhcumming/ml-agents | d4205fed06b5ac5c2cac6c594bbd25dfe128103f | [
"Apache-2.0"
] | null | null | null | ml-agents/mlagents/trainers/tests/test_simple_rl.py | ruairidhcumming/ml-agents | d4205fed06b5ac5c2cac6c594bbd25dfe128103f | [
"Apache-2.0"
] | null | null | null | import math
import random
import tempfile
import pytest
import yaml
from typing import Any, Dict
from mlagents.trainers.trainer_controller import TrainerController
from mlagents.trainers.trainer_util import TrainerFactory
from mlagents.envs.base_unity_environment import BaseUnityEnvironment
from mlagents.envs.brain i... | 29.41502 | 119 | 0.619323 | import math
import random
import tempfile
import pytest
import yaml
from typing import Any, Dict
from mlagents.trainers.trainer_controller import TrainerController
from mlagents.trainers.trainer_util import TrainerFactory
from mlagents.envs.base_unity_environment import BaseUnityEnvironment
from mlagents.envs.brain i... | true | true |
1c31e777172d3840499c8f68ec880d29b6f62b21 | 1,307 | py | Python | .github/scripts/build_assets/util.py | eldadfux/devicon | 6a98c2349c7f8f7eb2ac4547c1cb95b3120d0005 | [
"MIT"
] | null | null | null | .github/scripts/build_assets/util.py | eldadfux/devicon | 6a98c2349c7f8f7eb2ac4547c1cb95b3120d0005 | [
"MIT"
] | null | null | null | .github/scripts/build_assets/util.py | eldadfux/devicon | 6a98c2349c7f8f7eb2ac4547c1cb95b3120d0005 | [
"MIT"
] | null | null | null | from pathlib import Path
from argparse import ArgumentParser
from build_assets.PathResolverAction import PathResolverAction
def get_commandline_args():
parser = ArgumentParser(description="Upload svgs to Icomoon to create icon files.")
parser.add_argument("--headless",
help="Whether to... | 39.606061 | 102 | 0.614384 | from pathlib import Path
from argparse import ArgumentParser
from build_assets.PathResolverAction import PathResolverAction
def get_commandline_args():
parser = ArgumentParser(description="Upload svgs to Icomoon to create icon files.")
parser.add_argument("--headless",
help="Whether to... | true | true |
1c31e8071a530c20a30e496539b63456f9d6a8c9 | 833 | py | Python | computation_migration/distComputing/distComputing/urls.py | mengyingzhou/ipv6_firewall_computation_migration | 3fbc1f910e1fffdf2d5bb25eed631dffc6d7d842 | [
"MIT"
] | null | null | null | computation_migration/distComputing/distComputing/urls.py | mengyingzhou/ipv6_firewall_computation_migration | 3fbc1f910e1fffdf2d5bb25eed631dffc6d7d842 | [
"MIT"
] | null | null | null | computation_migration/distComputing/distComputing/urls.py | mengyingzhou/ipv6_firewall_computation_migration | 3fbc1f910e1fffdf2d5bb25eed631dffc6d7d842 | [
"MIT"
] | null | null | null | """distComputing URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/3.1/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, name='home'... | 36.217391 | 78 | 0.687875 | from django.contrib import admin
from django.urls import path, include
urlpatterns = [
path('imgProc/', include('imgProc.urls')),
path('admin/', admin.site.urls),
]
| true | true |
1c31e879297ecc47e67cac0d04f8704694e52b60 | 3,478 | py | Python | examples/vn_trader/run.py | JonnyORZ/vnpy | c3bb624d95625412a2dd593326abf3833321d2e2 | [
"MIT"
] | 11 | 2019-11-18T06:07:16.000Z | 2020-10-12T11:36:21.000Z | examples/vn_trader/run.py | dovnekai/vnpy | 222475fdf97f77f60cec4ecee231f1b85f44df21 | [
"MIT"
] | 2 | 2019-07-17T09:39:34.000Z | 2019-10-19T16:21:55.000Z | examples/vn_trader/run.py | dovnekai/vnpy | 222475fdf97f77f60cec4ecee231f1b85f44df21 | [
"MIT"
] | 6 | 2019-10-30T14:52:21.000Z | 2021-01-11T05:41:17.000Z | # flake8: noqa
from vnpy.event import EventEngine
from vnpy.trader.engine import MainEngine
from vnpy.trader.ui import MainWindow, create_qapp
# from vnpy.gateway.binance import BinanceGateway
from vnpy.gateway.bitmex import BitmexGateway
# from vnpy.gateway.futu import FutuGateway
# from vnpy.gateway.ib import IbGat... | 36.229167 | 55 | 0.797297 |
from vnpy.event import EventEngine
from vnpy.trader.engine import MainEngine
from vnpy.trader.ui import MainWindow, create_qapp
from vnpy.gateway.bitmex import BitmexGateway
from vnpy.gateway.bitfinex import BitfinexGateway
from vnpy.gateway.okexf import OkexfGateway
from vnpy.gateway.okexs import Okex... | true | true |
1c31e8eafc6d1dc8ae142df00cc0a77b3b1bfb28 | 2,284 | py | Python | tests/test_ext_graphviz.py | merwok-forks/sphinx | b7cada236f765003a73ab5dca48f975d54c0c298 | [
"BSD-2-Clause"
] | null | null | null | tests/test_ext_graphviz.py | merwok-forks/sphinx | b7cada236f765003a73ab5dca48f975d54c0c298 | [
"BSD-2-Clause"
] | null | null | null | tests/test_ext_graphviz.py | merwok-forks/sphinx | b7cada236f765003a73ab5dca48f975d54c0c298 | [
"BSD-2-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
"""
test_ext_graphviz
~~~~~~~~~~~~~~~~~
Test sphinx.ext.graphviz extension.
:copyright: Copyright 2007-2016 by the Sphinx team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import re
import pytest
@pytest.mark.sphinx('html', testroot='ext-graphviz')
@pytest.... | 34.606061 | 86 | 0.613398 |
import re
import pytest
@pytest.mark.sphinx('html', testroot='ext-graphviz')
@pytest.mark.usefixtures('if_graphviz_found')
def test_graphviz_html(app, status, warning):
app.builder.build_all()
content = (app.outdir / 'index.html').text()
html = (r'<div class="figure" .*?>\s*<img .*?/>\s*<p class="capt... | true | true |
1c31eaa2cf359f1c2f09be374a8e93c2bb06a001 | 41,569 | py | Python | turfpy/measurement.py | synapticarbors/turfpy | fc25954354f08c4d326aea6303314962ee97688c | [
"MIT"
] | null | null | null | turfpy/measurement.py | synapticarbors/turfpy | fc25954354f08c4d326aea6303314962ee97688c | [
"MIT"
] | null | null | null | turfpy/measurement.py | synapticarbors/turfpy | fc25954354f08c4d326aea6303314962ee97688c | [
"MIT"
] | null | null | null | """
This module implements some of the spatial analysis techniques and processes used to
understand the patterns and relationships of geographic features.
This is mainly inspired by turf.js.
link: http://turfjs.org/
"""
from math import asin, atan2, cos, degrees, log, pi, pow, radians, sin, sqrt, tan
from typing import... | 31.161169 | 139 | 0.587722 | from math import asin, atan2, cos, degrees, log, pi, pow, radians, sin, sqrt, tan
from typing import Optional, Union
from geojson import (
Feature,
FeatureCollection,
LineString,
MultiLineString,
MultiPoint,
MultiPolygon,
Point,
Polygon,
)
from turfpy.helper import (
avg_earth_radi... | true | true |
1c31eaa39d0ff84ca5d659ef2cfbd15c184a0b91 | 32,188 | py | Python | release/scripts/modules/bpy_types.py | arubertoson/blender | 9d3550d7819807064dd39365322295ebd8ea0a09 | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | 1 | 2020-09-23T21:30:18.000Z | 2020-09-23T21:30:18.000Z | release/scripts/modules/bpy_types.py | arubertoson/blender | 9d3550d7819807064dd39365322295ebd8ea0a09 | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | null | null | null | release/scripts/modules/bpy_types.py | arubertoson/blender | 9d3550d7819807064dd39365322295ebd8ea0a09 | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | null | null | null | # ##### BEGIN GPL LICENSE BLOCK #####
#
# 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 Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distrib... | 30.42344 | 106 | 0.591929 | t__.keys(),
"bl_rna", "rna_type", "copy",
)
for attr in dir(self):
if not (attr.startswith("_") or attr in generic_attrs):
value = getattr(self, attr)
if type(value) != BuiltinMethodType:
new_context[attr] = value
retur... | true | true |
1c31eb7da047e246ff8503a95a8181e5e53cb3d3 | 102 | py | Python | utils/__init__.py | rizwan09/Tagger | 7622f10561a0f6074abde0c9c26a4f25405b204b | [
"BSD-3-Clause"
] | null | null | null | utils/__init__.py | rizwan09/Tagger | 7622f10561a0f6074abde0c9c26a4f25405b204b | [
"BSD-3-Clause"
] | null | null | null | utils/__init__.py | rizwan09/Tagger | 7622f10561a0f6074abde0c9c26a4f25405b204b | [
"BSD-3-Clause"
] | null | null | null | # __init__.py
# author: Playinf
# email: playinf@stu.xmu.edu.cn
from .parallel import parallel_model
| 17 | 36 | 0.764706 |
from .parallel import parallel_model
| true | true |
1c31ec3c6b93fee9e2dbf2f4584e4bd3c40726b0 | 1,525 | py | Python | cad_tickers/news/ceo/scrap.py | FriendlyUser/cad_tickers | 2f99a4494498419d8decf41fb0fbc77722dbc712 | [
"MIT"
] | 2 | 2022-03-16T02:19:25.000Z | 2022-03-16T02:22:39.000Z | cad_tickers/news/ceo/scrap.py | FriendlyUser/cad_tickers | 2f99a4494498419d8decf41fb0fbc77722dbc712 | [
"MIT"
] | 57 | 2020-07-30T15:43:43.000Z | 2022-03-28T02:04:13.000Z | cad_tickers/news/ceo/scrap.py | FriendlyUser/cad_tickers | 2f99a4494498419d8decf41fb0fbc77722dbc712 | [
"MIT"
] | null | null | null | import requests
import bs4
from bs4 import BeautifulSoup
from cad_tickers.news.ceo.utils import module_logger
def extract_article(article_url: str)-> bs4.element.Tag:
"""Extracts data from given ceo news url"""
r = requests.get(article_url)
if r == None:
module_logger.warning('No data returned f... | 36.309524 | 117 | 0.656393 | import requests
import bs4
from bs4 import BeautifulSoup
from cad_tickers.news.ceo.utils import module_logger
def extract_article(article_url: str)-> bs4.element.Tag:
r = requests.get(article_url)
if r == None:
module_logger.warning('No data returned from the url')
data = r.text
soup = Beaut... | true | true |
1c31ed135cafc524fbead487f5bdf0e5b5daaa3e | 18,480 | py | Python | src_convertors/simple_convertors/analyzer.py | mansi-team/mansi_corpus | 369c71b8bb9e4d19999a88edf31d0017069d0d40 | [
"MIT"
] | null | null | null | src_convertors/simple_convertors/analyzer.py | mansi-team/mansi_corpus | 369c71b8bb9e4d19999a88edf31d0017069d0d40 | [
"MIT"
] | 1 | 2021-02-07T17:52:22.000Z | 2021-02-07T17:52:22.000Z | src_convertors/simple_convertors/analyzer.py | mansi-team/mansi_corpus | 369c71b8bb9e4d19999a88edf31d0017069d0d40 | [
"MIT"
] | 1 | 2020-06-13T06:44:22.000Z | 2020-06-13T06:44:22.000Z | import re
import copy
import os
class DumbMorphParser:
"""
Contains methods that add context-independent word-level
morhological information from a parsed word list to a
collection of JSON sentences. No actual parsing takes
place here.
"""
rxWordsRNC = re.compile('<w>(<ana.*?/(?:ana)?>)([... | 40.526316 | 113 | 0.516126 | import re
import copy
import os
class DumbMorphParser:
rxWordsRNC = re.compile('<w>(<ana.*?/(?:ana)?>)([^<>]+)</w>', flags=re.DOTALL)
rxAnalysesRNC = re.compile('<ana *([^<>]+)(?:></ana>|/>)\\s*')
rxAnaFieldRNC = re.compile('([^ <>"=]+) *= *"([^<>"]+)')
rxSplitGramTags = re.compile('[,, /=]')
rxH... | true | true |
1c31ede3914959095a9ee760e2abf2ee39c46497 | 356 | py | Python | classification/item_map.py | Data-Scientist/LP01_DSWAC_0706 | ee75d0f6810a5f993ef16a6911092f526747df22 | [
"MIT"
] | 4 | 2016-09-10T08:29:57.000Z | 2019-04-04T10:08:36.000Z | classification/item_map.py | Data-Scientist/LP01_DSWAC_0706 | ee75d0f6810a5f993ef16a6911092f526747df22 | [
"MIT"
] | null | null | null | classification/item_map.py | Data-Scientist/LP01_DSWAC_0706 | ee75d0f6810a5f993ef16a6911092f526747df22 | [
"MIT"
] | 4 | 2015-09-16T14:43:08.000Z | 2018-12-21T03:19:36.000Z | #!/usr/bin/python
# coding=utf8
import sys
def main():
# Read all lines from stdin
for line in sys.stdin:
key, value = line.strip().split('\t')
items = value.split(',')
# Emit every item in the set paired with the user ID
for item in items:
print "%s\t%s" % (item, key)
i... | 19.777778 | 58 | 0.575843 |
import sys
def main():
for line in sys.stdin:
key, value = line.strip().split('\t')
items = value.split(',')
for item in items:
print "%s\t%s" % (item, key)
if __name__ == '__main__':
main()
| false | true |
1c31ef0bec97c351e5a257803f09682c31dad000 | 5,653 | py | Python | plotly/graph_objs/surface/contours/x/_project.py | omridanan/plotly.py | a8d26670cba49ce15ce9b7639ae0f55a6088a825 | [
"MIT"
] | null | null | null | plotly/graph_objs/surface/contours/x/_project.py | omridanan/plotly.py | a8d26670cba49ce15ce9b7639ae0f55a6088a825 | [
"MIT"
] | null | null | null | plotly/graph_objs/surface/contours/x/_project.py | omridanan/plotly.py | a8d26670cba49ce15ce9b7639ae0f55a6088a825 | [
"MIT"
] | 1 | 2019-02-18T04:12:56.000Z | 2019-02-18T04:12:56.000Z | from plotly.basedatatypes import BaseTraceHierarchyType
import copy
class Project(BaseTraceHierarchyType):
# x
# -
@property
def x(self):
"""
Determines whether or not these contour lines are projected on
the x plane. If `highlight` is set to *true* (the default), the
... | 31.405556 | 79 | 0.546082 | from plotly.basedatatypes import BaseTraceHierarchyType
import copy
class Project(BaseTraceHierarchyType):
@property
def x(self):
return self['x']
@x.setter
def x(self, val):
self['x'] = val
@property
def y(self):
return self['y']
@y.setter
... | true | true |
1c31f0165563b2c602dfa5708fec677735dd636a | 5,527 | py | Python | coogger/cooggerapp/views/home.py | ewuoso/coogger | 11df6f8487b59bd06f9a496efde3fec998a64217 | [
"MIT"
] | null | null | null | coogger/cooggerapp/views/home.py | ewuoso/coogger | 11df6f8487b59bd06f9a496efde3fec998a64217 | [
"MIT"
] | null | null | null | coogger/cooggerapp/views/home.py | ewuoso/coogger | 11df6f8487b59bd06f9a496efde3fec998a64217 | [
"MIT"
] | null | null | null | #django
from django.http import *
from django.shortcuts import render
from django.contrib.auth import *
from django.db.models import Q
from django.contrib import messages as ms
from django.contrib.auth.models import User
#django class based
from django.views.generic.base import TemplateView
from django.views import Vi... | 36.361842 | 129 | 0.671974 |
from django.http import *
from django.shortcuts import render
from django.contrib.auth import *
from django.db.models import Q
from django.contrib import messages as ms
from django.contrib.auth.models import User
from django.views.generic.base import TemplateView
from django.views import View
from django.contrib.aut... | true | true |
1c31f0b1f24381e5502feacf82f5d0b19649b603 | 69 | py | Python | optimized_transducer/python/optimized_transducer/__init__.py | luomingshuang/optimized_transducer | 80883bb2910d7d9619adb88bfde4034207b7f79a | [
"Apache-2.0"
] | 40 | 2021-12-23T09:25:01.000Z | 2022-03-31T07:29:16.000Z | optimized_transducer/python/optimized_transducer/__init__.py | thangdepzai/optimized_transducer | 4b9c97f37749b2507dfc5aed02d404b235cebc56 | [
"Apache-2.0"
] | 9 | 2021-12-28T12:54:20.000Z | 2022-03-21T10:35:06.000Z | optimized_transducer/python/optimized_transducer/__init__.py | thangdepzai/optimized_transducer | 4b9c97f37749b2507dfc5aed02d404b235cebc56 | [
"Apache-2.0"
] | 8 | 2021-12-28T12:29:38.000Z | 2022-03-23T02:33:17.000Z | from .transducer_loss import TransducerLoss, transducer_loss # noqa
| 34.5 | 68 | 0.84058 | from .transducer_loss import TransducerLoss, transducer_loss
| true | true |
1c31f0db5a4ffa44fe3ea5398ec5b665b4f6c693 | 573 | py | Python | rng/test_rng.py | brahamirabah94/teo-project-rabah | 55dceec8a19124a12cb50c3eac90138b5002be67 | [
"Apache-2.0"
] | null | null | null | rng/test_rng.py | brahamirabah94/teo-project-rabah | 55dceec8a19124a12cb50c3eac90138b5002be67 | [
"Apache-2.0"
] | null | null | null | rng/test_rng.py | brahamirabah94/teo-project-rabah | 55dceec8a19124a12cb50c3eac90138b5002be67 | [
"Apache-2.0"
] | 1 | 2021-04-11T23:53:01.000Z | 2021-04-11T23:53:01.000Z | import rng
import socket
import pytest
hostname = socket.gethostname()
@pytest.fixture
def tester():
tester = rng.index()
return tester
def test_index_type(tester):
assert type(tester) is str
def test_index_content(tester):
assert "RNG running on {}\n".format(hostname) in tester
@pytest.fixture ... | 19.1 | 61 | 0.712042 | import rng
import socket
import pytest
hostname = socket.gethostname()
@pytest.fixture
def tester():
tester = rng.index()
return tester
def test_index_type(tester):
assert type(tester) is str
def test_index_content(tester):
assert "RNG running on {}\n".format(hostname) in tester
@pytest.fixture ... | true | true |
1c31f0e249e863c2aaf5c8ca2c12a20dbc48509b | 524 | py | Python | test/unit/api/test_configuration.py | rhpvorderman/galaxy | 178015f8eff0b0c7a59c0d6756658f6428222837 | [
"CC-BY-3.0"
] | 1 | 2021-05-18T02:20:43.000Z | 2021-05-18T02:20:43.000Z | test/unit/api/test_configuration.py | rhpvorderman/galaxy | 178015f8eff0b0c7a59c0d6756658f6428222837 | [
"CC-BY-3.0"
] | null | null | null | test/unit/api/test_configuration.py | rhpvorderman/galaxy | 178015f8eff0b0c7a59c0d6756658f6428222837 | [
"CC-BY-3.0"
] | null | null | null | from galaxy.webapps.galaxy.api.configuration import parse_serialization_params
def test_parse_serialization_params():
view, default_view = 'a', 'b'
keys = 'foo'
serialized = parse_serialization_params(view, keys, default_view)
assert serialized['view'] == view
assert serialized['default_view'] == ... | 34.933333 | 78 | 0.709924 | from galaxy.webapps.galaxy.api.configuration import parse_serialization_params
def test_parse_serialization_params():
view, default_view = 'a', 'b'
keys = 'foo'
serialized = parse_serialization_params(view, keys, default_view)
assert serialized['view'] == view
assert serialized['default_view'] == ... | true | true |
1c31f16bbdcd758726438a6e84c843cc19fe9ff0 | 8,936 | py | Python | orttraining/orttraining/test/python/orttraining_test_ortmodule_poc.py | mrshu/onnxruntime | 335edaa2c485ba0dec877bf4cdbd652e2d5d105c | [
"MIT"
] | 1 | 2021-03-23T16:25:11.000Z | 2021-03-23T16:25:11.000Z | orttraining/orttraining/test/python/orttraining_test_ortmodule_poc.py | zener90818/onnxruntime | a7a2a16edddc283b53d7737f897b4bbda5e86209 | [
"MIT"
] | null | null | null | orttraining/orttraining/test/python/orttraining_test_ortmodule_poc.py | zener90818/onnxruntime | a7a2a16edddc283b53d7737f897b4bbda5e86209 | [
"MIT"
] | null | null | null | import argparse
import logging
import os
import torch
import time
from torchvision import datasets, transforms
import onnxruntime
from onnxruntime.training import ORTModule
class NeuralNet(torch.nn.Module):
def __init__(self, input_size, hidden_size, num_classes):
super(NeuralNet, self).__init__()
... | 41.953052 | 120 | 0.614593 | import argparse
import logging
import os
import torch
import time
from torchvision import datasets, transforms
import onnxruntime
from onnxruntime.training import ORTModule
class NeuralNet(torch.nn.Module):
def __init__(self, input_size, hidden_size, num_classes):
super(NeuralNet, self).__init__()
... | true | true |
1c31f26c118cd7f40e870719edf96e1745687330 | 3,482 | py | Python | server/web/src/app/settings.py | jphacks/D_2002 | 6f97fa23d7512bad9b04bec81a2668cf43dfa1bc | [
"MIT"
] | 4 | 2020-11-01T07:28:02.000Z | 2022-02-05T04:31:03.000Z | server/web/src/app/settings.py | jphacks/D_2002 | 6f97fa23d7512bad9b04bec81a2668cf43dfa1bc | [
"MIT"
] | 33 | 2020-10-31T05:12:12.000Z | 2020-11-06T03:57:22.000Z | server/web/src/app/settings.py | jphacks/D_2002 | 6f97fa23d7512bad9b04bec81a2668cf43dfa1bc | [
"MIT"
] | 2 | 2020-11-22T01:43:32.000Z | 2021-01-23T07:43:37.000Z | """
Django settings for app project.
Generated by 'django-admin startproject' using Django 2.2.4.
For more information on this file, see
https://docs.djangoproject.com/en/2.2/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/2.2/ref/settings/
"""
import os
# Bui... | 25.602941 | 91 | 0.691557 |
import os
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
SECRET_KEY = 'yzlz!c6gwp4gs#_51=wxzc2%a%c&%(4y38w7eqsb(l#qc87t&$'
DEBUG = True
ALLOWED_HOSTS = ["*"]
# Application definition
INSTALLED_APPS = [
'accounts.apps.AccountsConfig',
'django.contrib.admin',
'django.con... | true | true |
1c31f3c27afc537cf565ec4d4405ca174b0b6db4 | 430 | py | Python | tools/emmakenxx.py | diclophis/emscripten | 1e6009144e50f9a920208868003b6b93ea972732 | [
"MIT"
] | 8 | 2015-04-15T16:23:11.000Z | 2020-04-07T13:38:25.000Z | tools/emmakenxx.py | comforx/emscripten | f842201acec3c1edafb2916a76a8eb8d75474c2b | [
"MIT"
] | null | null | null | tools/emmakenxx.py | comforx/emscripten | f842201acec3c1edafb2916a76a8eb8d75474c2b | [
"MIT"
] | null | null | null | #!/usr/bin/env python
'''
see emmaken.py
'''
import os, subprocess, sys
__rootpath__ = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
def path_from_root(*pathelems):
return os.path.join(__rootpath__, *pathelems)
sys.path += [path_from_root('')]
from tools.shared import *
emmaken = path_from_root('too... | 22.631579 | 74 | 0.713953 |
import os, subprocess, sys
__rootpath__ = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
def path_from_root(*pathelems):
return os.path.join(__rootpath__, *pathelems)
sys.path += [path_from_root('')]
from tools.shared import *
emmaken = path_from_root('tools', 'emmaken.py')
os.environ['EMMAKEN_CXX']... | true | true |
1c31f48b540da46313b4bee4b84efc5fd97a0e71 | 11,718 | py | Python | src/app/mongodb.py | smlng/lbv | b8a584eac413ac85bd363154c69036cddc328477 | [
"MIT"
] | 1 | 2016-03-09T14:40:40.000Z | 2016-03-09T14:40:40.000Z | src/app/mongodb.py | smlng/lbv | b8a584eac413ac85bd363154c69036cddc328477 | [
"MIT"
] | 2 | 2016-03-23T07:46:03.000Z | 2016-04-19T15:05:55.000Z | src/app/mongodb.py | smlng/lbv | b8a584eac413ac85bd363154c69036cddc328477 | [
"MIT"
] | null | null | null | """
"""
import logging
from datetime import datetime
from pymongo import MongoClient, DESCENDING
from netaddr import IPNetwork
def get_ipversion_stats(dbconnstr):
""" generate ip version specific stats from database """
client = MongoClient(dbconnstr)
database = client.get_default_database()
if "valid... | 42 | 98 | 0.540963 | import logging
from datetime import datetime
from pymongo import MongoClient, DESCENDING
from netaddr import IPNetwork
def get_ipversion_stats(dbconnstr):
client = MongoClient(dbconnstr)
database = client.get_default_database()
if "validity_latest" not in database.collection_names() or \
datab... | true | true |
1c31f49fe0392d66c30abd8428803d2c2bbee716 | 46,197 | py | Python | tests/core/test_model.py | jld23/sasoptpy | f96911f04d6c0c01fce902f1f995935583df69a8 | [
"Apache-2.0"
] | null | null | null | tests/core/test_model.py | jld23/sasoptpy | f96911f04d6c0c01fce902f1f995935583df69a8 | [
"Apache-2.0"
] | null | null | null | tests/core/test_model.py | jld23/sasoptpy | f96911f04d6c0c01fce902f1f995935583df69a8 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# encoding: utf-8
#
# Copyright SAS Institute
#
# 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 b... | 39.620069 | 125 | 0.453514 |
from collections import OrderedDict
from difflib import SequenceMatcher
import inspect
import os
import unittest
import warnings
from inspect import cleandoc
import sasoptpy as so
from tests.swat_config import create_cas_connection
class MockSASconfig:
def __init__(self, name):
self.n... | true | true |
1c31f535a8cc4c7d63da95d2f6c8c48bb23f12c0 | 7,157 | py | Python | ungroupedCommands.py | atnguye2/HerosHavenBot | 6d82d79e0c0d22bd0ffb7d9f3b9f070f0d3d1103 | [
"MIT"
] | null | null | null | ungroupedCommands.py | atnguye2/HerosHavenBot | 6d82d79e0c0d22bd0ffb7d9f3b9f070f0d3d1103 | [
"MIT"
] | null | null | null | ungroupedCommands.py | atnguye2/HerosHavenBot | 6d82d79e0c0d22bd0ffb7d9f3b9f070f0d3d1103 | [
"MIT"
] | 1 | 2018-11-30T02:11:15.000Z | 2018-11-30T02:11:15.000Z | import discord
import commandHelpers
import string
import unicodedata
import random
from discord.ext import commands
import googleSheets
# Read the Oz Config Google Sheets
dmxpRows = googleSheets.getDmXpRows()
flavorTextRows = googleSheets.getFlavorTextRows()
judgeTextRows = googleSheets.getJudgeTextRows()
resRows = g... | 45.878205 | 149 | 0.667458 | import discord
import commandHelpers
import string
import unicodedata
import random
from discord.ext import commands
import googleSheets
dmxpRows = googleSheets.getDmXpRows()
flavorTextRows = googleSheets.getFlavorTextRows()
judgeTextRows = googleSheets.getJudgeTextRows()
resRows = googleSheets.getResRows()
pfxpRows ... | true | true |
1c31f5eda1f264abdaca5c1a26c381a3dde81e5f | 6,829 | py | Python | scripts/rpc/lvol.py | michalwy/spdk | 2389caa4f51583425efd993d7066021b17e97ff3 | [
"BSD-3-Clause"
] | 2,107 | 2015-09-23T01:53:51.000Z | 2022-03-29T09:55:13.000Z | scripts/rpc/lvol.py | michalwy/spdk | 2389caa4f51583425efd993d7066021b17e97ff3 | [
"BSD-3-Clause"
] | 2,382 | 2015-09-24T02:36:59.000Z | 2022-03-31T22:53:45.000Z | scripts/rpc/lvol.py | michalwy/spdk | 2389caa4f51583425efd993d7066021b17e97ff3 | [
"BSD-3-Clause"
] | 916 | 2015-09-23T03:04:41.000Z | 2022-03-31T05:45:04.000Z | from .helpers import deprecated_alias
@deprecated_alias('construct_lvol_store')
def bdev_lvol_create_lvstore(client, bdev_name, lvs_name, cluster_sz=None, clear_method=None):
"""Construct a logical volume store.
Args:
bdev_name: bdev on which to construct logical volume store
lvs_name: name o... | 29.820961 | 113 | 0.679602 | from .helpers import deprecated_alias
@deprecated_alias('construct_lvol_store')
def bdev_lvol_create_lvstore(client, bdev_name, lvs_name, cluster_sz=None, clear_method=None):
params = {'bdev_name': bdev_name, 'lvs_name': lvs_name}
if cluster_sz:
params['cluster_sz'] = cluster_sz
if clear_method:
... | true | true |
1c31f67fc9203c9333792670dfa9525e9a6a035e | 3,050 | py | Python | numpyro/distributions/__init__.py | hessammehr/numpyro | d0f9a46e81d4dae79a49cb4f5d18354a6587c961 | [
"Apache-2.0"
] | null | null | null | numpyro/distributions/__init__.py | hessammehr/numpyro | d0f9a46e81d4dae79a49cb4f5d18354a6587c961 | [
"Apache-2.0"
] | null | null | null | numpyro/distributions/__init__.py | hessammehr/numpyro | d0f9a46e81d4dae79a49cb4f5d18354a6587c961 | [
"Apache-2.0"
] | null | null | null | # Copyright Contributors to the Pyro project.
# SPDX-License-Identifier: Apache-2.0
from numpyro.distributions.conjugate import (
BetaBinomial,
DirichletMultinomial,
GammaPoisson,
)
from numpyro.distributions.continuous import (
LKJ,
Beta,
Cauchy,
Chi2,
Dirichlet,
Exponential,
G... | 20.608108 | 71 | 0.676066 |
from numpyro.distributions.conjugate import (
BetaBinomial,
DirichletMultinomial,
GammaPoisson,
)
from numpyro.distributions.continuous import (
LKJ,
Beta,
Cauchy,
Chi2,
Dirichlet,
Exponential,
Gamma,
GaussianRandomWalk,
Gumbel,
HalfCauchy,
HalfNormal,
Inve... | true | true |
1c31f688fb9919f97f9783ddc962d1788f56d98c | 1,222 | py | Python | tools/project-creator/Python2.6.6/Lib/test/test_undocumented_details.py | gohopo/nineck.ca | 9601f5ae4c20f8a3ea27b06551556fa5e1eecce3 | [
"MIT"
] | 81 | 2017-03-13T08:24:01.000Z | 2021-04-02T09:48:38.000Z | tools/project-creator/Python2.6.6/Lib/test/test_undocumented_details.py | gohopo/nineck.ca | 9601f5ae4c20f8a3ea27b06551556fa5e1eecce3 | [
"MIT"
] | 6 | 2017-04-30T08:36:55.000Z | 2017-09-22T01:37:28.000Z | tools/project-creator/Python2.6.6/Lib/test/test_undocumented_details.py | gohopo/nineck.ca | 9601f5ae4c20f8a3ea27b06551556fa5e1eecce3 | [
"MIT"
] | 41 | 2017-03-18T14:11:58.000Z | 2021-04-14T05:06:09.000Z | from test.test_support import run_unittest, _check_py3k_warnings
import unittest
import sys
class TestImplementationComparisons(unittest.TestCase):
def test_type_comparisons(self):
self.assertTrue(str < int or str > int)
self.assertTrue(int <= str or int >= str)
self.assertTrue(cm... | 29.804878 | 65 | 0.576105 | from test.test_support import run_unittest, _check_py3k_warnings
import unittest
import sys
class TestImplementationComparisons(unittest.TestCase):
def test_type_comparisons(self):
self.assertTrue(str < int or str > int)
self.assertTrue(int <= str or int >= str)
self.assertTrue(cm... | true | true |
1c31f6ea35b6973d6c217223464a76192228dec4 | 2,983 | py | Python | blaze/thirdparty/onnx/onnx-1.2.2/onnx/backend/test/case/node/pool_op_common.py | Ru-Xiang/x-deeplearning | 04cc0497150920c64b06bb8c314ef89977a3427a | [
"Apache-2.0"
] | 4,071 | 2018-12-13T04:17:38.000Z | 2022-03-30T03:29:35.000Z | blaze/thirdparty/onnx/onnx-1.2.2/onnx/backend/test/case/node/pool_op_common.py | laozhuang727/x-deeplearning | 781545783a4e2bbbda48fc64318fb2c6d8bbb3cc | [
"Apache-2.0"
] | 359 | 2018-12-21T01:14:57.000Z | 2022-02-15T07:18:02.000Z | blaze/thirdparty/onnx/onnx-1.2.2/onnx/backend/test/case/node/pool_op_common.py | laozhuang727/x-deeplearning | 781545783a4e2bbbda48fc64318fb2c6d8bbb3cc | [
"Apache-2.0"
] | 1,054 | 2018-12-20T09:57:42.000Z | 2022-03-29T07:16:53.000Z | import numpy as np # type: ignore
import itertools
from typing import Text, Sequence
def get_pad_shape(auto_pad, # type: Text
input_spatial_shape, # type: np.ndarray
kernel_spatial_shape, # type: np.ndarray
strides_spatial, # type: Sequence[int]
... | 43.867647 | 117 | 0.555816 | import numpy as np
import itertools
from typing import Text, Sequence
def get_pad_shape(auto_pad,
input_spatial_shape,
kernel_spatial_shape,
strides_spatial,
output_spatial_shape
):
pad_shape = [0] * len(input_... | true | true |
1c31f80878529767fd649ae96736f4dc633dc1cd | 678 | py | Python | Exercicios/exercicio23.py | Juanszf/CursoEmVideo | 9ea6e7ef24b89c921cf6eb6b647e3ef5f467385e | [
"MIT"
] | null | null | null | Exercicios/exercicio23.py | Juanszf/CursoEmVideo | 9ea6e7ef24b89c921cf6eb6b647e3ef5f467385e | [
"MIT"
] | null | null | null | Exercicios/exercicio23.py | Juanszf/CursoEmVideo | 9ea6e7ef24b89c921cf6eb6b647e3ef5f467385e | [
"MIT"
] | null | null | null | '''Faça um programa que leia do número 0 ao 9999 e mostre cada número na tela separado:
Unidade:
Dezena:
Centana:
Milhar: '''
num = (input('Digite um número de 0 até 9999\n'))
y=-1
if num.isnumeric():
if (int(num)>= 0 and int(num) <= 9999):
for x in num:
if y == -1:
print(f'\nUn... | 27.12 | 87 | 0.501475 |
num = (input('Digite um número de 0 até 9999\n'))
y=-1
if num.isnumeric():
if (int(num)>= 0 and int(num) <= 9999):
for x in num:
if y == -1:
print(f'\nUnidade: {num[y]}')
elif y == -2:
print(f'Dezena: {num[y]}')
elif y == -3:
... | true | true |
1c31f85d6f23045413e37773754560d0392717bf | 1,513 | py | Python | applications/physics/ICF/train_jag_wae.py | vishalbelsare/lbann | c41421b177d8cdd4a0a780d7bb4a35a5a73a2ca2 | [
"Apache-2.0"
] | null | null | null | applications/physics/ICF/train_jag_wae.py | vishalbelsare/lbann | c41421b177d8cdd4a0a780d7bb4a35a5a73a2ca2 | [
"Apache-2.0"
] | null | null | null | applications/physics/ICF/train_jag_wae.py | vishalbelsare/lbann | c41421b177d8cdd4a0a780d7bb4a35a5a73a2ca2 | [
"Apache-2.0"
] | null | null | null | import jag_models
from os.path import abspath, dirname, join
import google.protobuf.text_format as txtf
# ==============================================
# Setup and launch experiment
# ==============================================
# Default data reader
model_zoo_dir = dirname(dirname(abspath(__file__)))
data_reader_... | 36.02381 | 69 | 0.554527 | import jag_models
from os.path import abspath, dirname, join
import google.protobuf.text_format as txtf
model_zoo_dir = dirname(dirname(abspath(__file__)))
data_reader_prototext = join(model_zoo_dir,
'data',
'jag_100Kdata.prototext')
if __name__ == '__mai... | true | true |
1c31f9649f50f6ffae3c29c127cb8e14883bb8fd | 258 | py | Python | bayes_race/models/__init__.py | DaniMarts/bayesrace | 3d0d2b26dac2e33ad7e38513304cfb259abe351c | [
"MIT"
] | 23 | 2020-03-27T03:28:04.000Z | 2022-02-24T11:21:18.000Z | bayes_race/models/__init__.py | DaniMarts/bayesrace | 3d0d2b26dac2e33ad7e38513304cfb259abe351c | [
"MIT"
] | 1 | 2021-07-08T22:02:15.000Z | 2021-07-08T22:02:15.000Z | bayes_race/models/__init__.py | DaniMarts/bayesrace | 3d0d2b26dac2e33ad7e38513304cfb259abe351c | [
"MIT"
] | 17 | 2020-10-27T06:09:34.000Z | 2022-03-23T05:28:23.000Z | from bayes_race.models.kinematic import Kinematic
from bayes_race.models.kinematic6 import Kinematic6
from bayes_race.models.dynamic import Dynamic
from bayes_race.models.dynamicst import DynamicsST
from bayes_race.models.frictioncircle import FrictionCircle | 51.6 | 59 | 0.887597 | from bayes_race.models.kinematic import Kinematic
from bayes_race.models.kinematic6 import Kinematic6
from bayes_race.models.dynamic import Dynamic
from bayes_race.models.dynamicst import DynamicsST
from bayes_race.models.frictioncircle import FrictionCircle | true | true |
1c31fa312978d713a42ff2753694165e3abc29be | 5,186 | py | Python | scdiff2/prerun.py | haochenucr/scdiff2 | ebc4149851399b2f15ed5b5874d44764b5f130fb | [
"MIT"
] | 6 | 2020-08-02T23:13:43.000Z | 2021-12-12T03:53:57.000Z | scdiff2/prerun.py | haochenucr/scdiff2 | ebc4149851399b2f15ed5b5874d44764b5f130fb | [
"MIT"
] | 8 | 2020-07-11T12:24:45.000Z | 2021-07-31T04:25:35.000Z | scdiff2/prerun.py | haochenucr/scdiff2 | ebc4149851399b2f15ed5b5874d44764b5f130fb | [
"MIT"
] | 2 | 2020-10-07T22:39:00.000Z | 2022-01-17T20:07:53.000Z | #!/usr/bin/env python
# coding: utf-8
# Author: Jun Ding
# Email: junding (at) cs (dot) cmu (dot) edu
# Date: June. 29th, 2020
#
# This scdiff software suite is desinged to infer the clusters, trajectories, and regulatory
# networks underlying dynamic biological process (e.g., cell differntiation, disease progression)... | 42.162602 | 179 | 0.688199 |
import pdb,sys,os
import anndata
import scanpy as sc
from File import *
import pandas as pd
import argparse
import matplotlib
matplotlib.use('Agg')
def prerun(exFn,outdir,iformat,mindisp,cluRes,skipGeneFilter):
os.mkdir(outdir)
TabFile(exFn).toH5("\t","%s/%s"%(outdir,exFn.split("/")[-1... | true | true |
1c31fa3d8622c8b1cdd04a8dc4e6ff913cb0eb43 | 16,761 | py | Python | CompuRacer_Core/src/batch_sender_async.py | computestdev/CompuRacer | c212c4b582ae0b6316a73ecd6868b6b69de224a6 | [
"MIT"
] | 1 | 2021-12-16T16:22:28.000Z | 2021-12-16T16:22:28.000Z | CompuRacer_Core/src/batch_sender_async.py | computestdev/CompuRacer | c212c4b582ae0b6316a73ecd6868b6b69de224a6 | [
"MIT"
] | null | null | null | CompuRacer_Core/src/batch_sender_async.py | computestdev/CompuRacer | c212c4b582ae0b6316a73ecd6868b6b69de224a6 | [
"MIT"
] | 2 | 2019-05-23T09:06:25.000Z | 2021-07-07T10:33:58.000Z | #!/usr/bin/env python3
"""
The batch async sender file contains functions for sending a Batch asynchronously and very quickly.
It will encode the requests that are send and also read and decode the results.
"""
# --- All imports --- #
import asyncio
import base64
import binascii
import copy
import datetime
import json... | 42.325758 | 156 | 0.601873 |
import asyncio
import base64
import binascii
import copy
import datetime
import json
import pprint
import random
import sys
import time
import urllib
from collections import defaultdict
from async_timeout import timeout as async_timeout
import src.aiohttp as aiohttp
import chardet
import uvloop
from src.aiohttp imp... | true | true |
1c31fb315f7247d4966153dbfaa07683628c0828 | 8,247 | py | Python | e2cnn/nn/modules/nonlinearities/norm.py | ziatdinovmax/e2cnn | e486a0d2cec71f2bde2d61f2f1315922f2883cee | [
"BSD-3-Clause"
] | null | null | null | e2cnn/nn/modules/nonlinearities/norm.py | ziatdinovmax/e2cnn | e486a0d2cec71f2bde2d61f2f1315922f2883cee | [
"BSD-3-Clause"
] | null | null | null | e2cnn/nn/modules/nonlinearities/norm.py | ziatdinovmax/e2cnn | e486a0d2cec71f2bde2d61f2f1315922f2883cee | [
"BSD-3-Clause"
] | null | null | null | from collections import defaultdict
from torch.nn import Parameter
from e2cnn.gspaces import *
from e2cnn.nn import FieldType
from e2cnn.nn import GeometricTensor
from ..equivariant_module import EquivariantModule
import torch
from typing import List, Tuple, Any
import numpy as np
__all__ = ["NormNonLinearity"]
... | 33.79918 | 116 | 0.56178 | from collections import defaultdict
from torch.nn import Parameter
from e2cnn.gspaces import *
from e2cnn.nn import FieldType
from e2cnn.nn import GeometricTensor
from ..equivariant_module import EquivariantModule
import torch
from typing import List, Tuple, Any
import numpy as np
__all__ = ["NormNonLinearity"]
... | true | true |
1c31fd9617e834df542ea98eca33b0edac8531de | 2,550 | py | Python | data_cleaner.py | PhilippMaxx/semeval2019_task3 | 0093fbffeb0dc0500b9c59ab7517ed89fa8edd8e | [
"Apache-2.0"
] | 2 | 2020-05-07T08:33:43.000Z | 2021-05-24T14:35:26.000Z | data_cleaner.py | PhilippMaxx/semeval2019_task3 | 0093fbffeb0dc0500b9c59ab7517ed89fa8edd8e | [
"Apache-2.0"
] | 1 | 2021-09-28T00:23:41.000Z | 2021-09-28T00:23:41.000Z | data_cleaner.py | PhilippMaxx/semeval2019_task3 | 0093fbffeb0dc0500b9c59ab7517ed89fa8edd8e | [
"Apache-2.0"
] | 1 | 2021-02-04T12:39:29.000Z | 2021-02-04T12:39:29.000Z | # coding=utf-8
""" Cleaning pipeline and data loader for SemEval 2019 task 3."""
from typing import List
import csv
from ekphrasis.classes.preprocessor import TextPreProcessor
from ekphrasis.classes.tokenizer import SocialTokenizer
from ekphrasis.dicts.emoticons import emoticons
import emoji
from emot import EMOTIC... | 31.875 | 80 | 0.702353 |
from typing import List
import csv
from ekphrasis.classes.preprocessor import TextPreProcessor
from ekphrasis.classes.tokenizer import SocialTokenizer
from ekphrasis.dicts.emoticons import emoticons
import emoji
from emot import EMOTICONS
from utils import *
EMOTICONS = {expr: emo_transf(emo) for expr, emo in EM... | true | true |
1c31fe3e5c862bed78d4be14380cc1753d44d6b6 | 1,254 | py | Python | tests/testapp/test_test_utils.py | Incopro/django-mysql | 60df164ab21cd7c08ab3c734111bedda8efc113a | [
"BSD-3-Clause"
] | null | null | null | tests/testapp/test_test_utils.py | Incopro/django-mysql | 60df164ab21cd7c08ab3c734111bedda8efc113a | [
"BSD-3-Clause"
] | null | null | null | tests/testapp/test_test_utils.py | Incopro/django-mysql | 60df164ab21cd7c08ab3c734111bedda8efc113a | [
"BSD-3-Clause"
] | 1 | 2020-06-14T01:01:51.000Z | 2020-06-14T01:01:51.000Z | import django
import pytest
from django.db import connections
from django.test import TestCase
from django_mysql.test.utils import override_mysql_variables
class OverrideVarsMethodTest(TestCase):
@override_mysql_variables(SQL_MODE="MSSQL")
def test_method_sets_mssql(self):
self.check_sql_mode("MSSQL"... | 27.866667 | 62 | 0.681021 | import django
import pytest
from django.db import connections
from django.test import TestCase
from django_mysql.test.utils import override_mysql_variables
class OverrideVarsMethodTest(TestCase):
@override_mysql_variables(SQL_MODE="MSSQL")
def test_method_sets_mssql(self):
self.check_sql_mode("MSSQL"... | true | true |
1c31fe536e02d32fab4c8f36834d18288af37cc2 | 2,563 | py | Python | google/cloud/spanner_admin_database_v1/types/__init__.py | asthamohta/python-spanner | 321bc7faf364ad423da08ae4e2c0d6f76834dc09 | [
"Apache-2.0"
] | 49 | 2020-02-06T17:36:32.000Z | 2022-03-31T05:32:29.000Z | google/cloud/spanner_admin_database_v1/types/__init__.py | asthamohta/python-spanner | 321bc7faf364ad423da08ae4e2c0d6f76834dc09 | [
"Apache-2.0"
] | 417 | 2020-01-31T23:12:28.000Z | 2022-03-30T22:42:11.000Z | google/cloud/spanner_admin_database_v1/types/__init__.py | asthamohta/python-spanner | 321bc7faf364ad423da08ae4e2c0d6f76834dc09 | [
"Apache-2.0"
] | 46 | 2020-01-31T22:54:25.000Z | 2022-03-29T12:04:55.000Z | # -*- coding: utf-8 -*-
# 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | 27.55914 | 74 | 0.742489 |
from .backup import (
Backup,
BackupInfo,
CreateBackupEncryptionConfig,
CreateBackupMetadata,
CreateBackupRequest,
DeleteBackupRequest,
GetBackupRequest,
ListBackupOperationsRequest,
ListBackupOperationsResponse,
ListBackupsRequest,
ListBackupsResponse,
Upd... | true | true |
1c31feb3a0beed2b13b1024885dee420f9a90e4f | 15,152 | py | Python | src/sage/combinat/rigged_configurations/rc_crystal.py | Findstat/sage | d661c2c2bd18676014c151e9eec1e81ed12db9f6 | [
"BSL-1.0"
] | null | null | null | src/sage/combinat/rigged_configurations/rc_crystal.py | Findstat/sage | d661c2c2bd18676014c151e9eec1e81ed12db9f6 | [
"BSL-1.0"
] | null | null | null | src/sage/combinat/rigged_configurations/rc_crystal.py | Findstat/sage | d661c2c2bd18676014c151e9eec1e81ed12db9f6 | [
"BSL-1.0"
] | null | null | null | r"""
Crystal of Rigged Configurations
AUTHORS:
- Travis Scrimshaw (2010-09-26): Initial version
We only consider the highest weight crystal structure, not the
Kirillov-Reshetikhin structure, and we extend this to symmetrizable types.
"""
#*****************************************************************************... | 36.07619 | 101 | 0.590285 |
from sage.misc.cachefunc import cached_method
from sage.misc.lazy_attribute import lazy_attribute
from sage.structure.unique_representation import UniqueRepresentation
from sage.structure.parent import Parent
from sage.categories.highest_weight_crystals import HighestWeightCrystals
from sage.categories.... | true | true |
1c31fee605abafb3e22c85cd2383cccfa60a89f8 | 2,597 | py | Python | runtime/hetdesrun/runtime/logging.py | JulianGrote1904/hetida-designer | 05350810eb3e0548c9d8a2a5a6afbf455635b5fd | [
"MIT"
] | null | null | null | runtime/hetdesrun/runtime/logging.py | JulianGrote1904/hetida-designer | 05350810eb3e0548c9d8a2a5a6afbf455635b5fd | [
"MIT"
] | null | null | null | runtime/hetdesrun/runtime/logging.py | JulianGrote1904/hetida-designer | 05350810eb3e0548c9d8a2a5a6afbf455635b5fd | [
"MIT"
] | null | null | null | from typing import Any, Literal
import contextvars
import datetime
import json
from uuid import UUID
import logging
import numpy as np
_WF_EXEC_LOGGING_CONTEXT_VAR: contextvars.ContextVar[dict] = contextvars.ContextVar(
"workflow_execution_logging_context"
)
class MinimallyMoreCapableJsonEncoder(json.JSONEncode... | 31.670732 | 89 | 0.683481 | from typing import Any, Literal
import contextvars
import datetime
import json
from uuid import UUID
import logging
import numpy as np
_WF_EXEC_LOGGING_CONTEXT_VAR: contextvars.ContextVar[dict] = contextvars.ContextVar(
"workflow_execution_logging_context"
)
class MinimallyMoreCapableJsonEncoder(json.JSONEncode... | true | true |
1c31ffc0e49197fad9fcd6de0fe0caeed253e8ea | 15,436 | py | Python | galpopfm/dust_infer.py | IQcollaboratory/galpopFM | 1b30abc1cc2fd1119d0f34a237b0c1112d7afc9d | [
"MIT"
] | 1 | 2020-02-08T17:36:06.000Z | 2020-02-08T17:36:06.000Z | galpopfm/dust_infer.py | IQcollaboratory/galpopFM | 1b30abc1cc2fd1119d0f34a237b0c1112d7afc9d | [
"MIT"
] | 35 | 2020-02-07T19:02:27.000Z | 2021-02-04T14:28:05.000Z | galpopfm/dust_infer.py | IQcollaboratory/galpopFM | 1b30abc1cc2fd1119d0f34a237b0c1112d7afc9d | [
"MIT"
] | null | null | null | '''
'''
import os
import sys
import h5py
import numpy as np
from scipy.stats import chi2
np.seterr(divide='ignore', invalid='ignore')
# -- abcpmc --
import abcpmc
from abcpmc import mpi_util
# -- galpopfm --
from . import dustfm as dustFM
from . import measure_obs as measureObs
dat_dir = os.environ['GALPOPFM_... | 36.752381 | 109 | 0.561415 | import os
import sys
import h5py
import numpy as np
from scipy.stats import chi2
np.seterr(divide='ignore', invalid='ignore')
import abcpmc
from abcpmc import mpi_util
from . import dustfm as dustFM
from . import measure_obs as measureObs
dat_dir = os.environ['GALPOPFM_DIR']
def distance_metric(x_obs, x_model... | true | true |
1c31ffdd2b45111c693651f89499b6e4ef53720a | 403 | py | Python | src/master.py | guavadata/peru_sinadef_eda | 4e57f08cf4496d124e5297d4d30a1a0736efc37d | [
"MIT"
] | null | null | null | src/master.py | guavadata/peru_sinadef_eda | 4e57f08cf4496d124e5297d4d30a1a0736efc37d | [
"MIT"
] | null | null | null | src/master.py | guavadata/peru_sinadef_eda | 4e57f08cf4496d124e5297d4d30a1a0736efc37d | [
"MIT"
] | null | null | null | #!/usr/bin/env python
"""
This is the master script for recreating the results
It imports each of the key other scripts and
runs them one by one.
Run the whole thing from the root directory
to replicate all of the python analysis
"""
import src.download_raw_data as dwl_raw
import src.clean_data as cln_data
import ... | 20.15 | 52 | 0.784119 |
import src.download_raw_data as dwl_raw
import src.clean_data as cln_data
import src.transform_data as ts_data
dwl_raw.main()
cln_data.clean_data()
ts_data.main()
| true | true |
1c320081365f5d4e0c730b1b9a1090eb3d5e77e0 | 1,144 | py | Python | src/public/src/FM7/util/python/txt2cpp.py | rothberg-cmu/rothberg-run | a42df5ca9fae97de77753864f60d05295d77b59f | [
"MIT"
] | 1 | 2019-08-10T00:24:09.000Z | 2019-08-10T00:24:09.000Z | src/public/src/FM7/util/python/txt2cpp.py | rothberg-cmu/rothberg-run | a42df5ca9fae97de77753864f60d05295d77b59f | [
"MIT"
] | null | null | null | src/public/src/FM7/util/python/txt2cpp.py | rothberg-cmu/rothberg-run | a42df5ca9fae97de77753864f60d05295d77b59f | [
"MIT"
] | 2 | 2019-05-01T03:11:10.000Z | 2019-05-01T03:30:35.000Z | import sys
import os
# Limitation: header and cpp needs to be in the same directory.
def TextFileToCpp(cppFName,hFName,varName,binFName):
strArray=[]
fp=open(binFName,"r")
for str in fp:
str=str.replace('\n','')
str=str.replace('\r','')
strArray.append(str)
fp.close()
TextToCpp(cppFName,hFName,varName,st... | 20.070175 | 63 | 0.652972 | import sys
import os
def TextFileToCpp(cppFName,hFName,varName,binFName):
strArray=[]
fp=open(binFName,"r")
for str in fp:
str=str.replace('\n','')
str=str.replace('\r','')
strArray.append(str)
fp.close()
TextToCpp(cppFName,hFName,varName,strArray)
def TextToCpp(cppFName,hFName,varName,strArray):
HF... | true | true |
1c32009e48bfe3934197a2d23c0e6d0a42c586f9 | 5,578 | py | Python | tests/test_visitors/test_ast/test_conditions/test_implicit_complex_compare.py | cdhiraj40/wemake-python-styleguide | 7cef9be081d594c30045b7a98cae77a9be46e1aa | [
"MIT"
] | 1,931 | 2018-03-17T13:52:45.000Z | 2022-03-27T09:39:17.000Z | tests/test_visitors/test_ast/test_conditions/test_implicit_complex_compare.py | cdhiraj40/wemake-python-styleguide | 7cef9be081d594c30045b7a98cae77a9be46e1aa | [
"MIT"
] | 2,231 | 2018-03-09T21:19:05.000Z | 2022-03-31T08:35:37.000Z | tests/test_visitors/test_ast/test_conditions/test_implicit_complex_compare.py | cdhiraj40/wemake-python-styleguide | 7cef9be081d594c30045b7a98cae77a9be46e1aa | [
"MIT"
] | 492 | 2018-05-18T21:20:28.000Z | 2022-03-20T14:11:50.000Z | import pytest
from wemake_python_styleguide.violations.consistency import (
ImplicitComplexCompareViolation,
)
from wemake_python_styleguide.visitors.ast.conditions import (
ImplicitBoolPatternsVisitor,
)
# Won't match our rule with any values:
less_or_less = '{0} < {1} or {2} < {3}'
less_or_more = '{0} < {1... | 23.939914 | 69 | 0.576371 | import pytest
from wemake_python_styleguide.violations.consistency import (
ImplicitComplexCompareViolation,
)
from wemake_python_styleguide.visitors.ast.conditions import (
ImplicitBoolPatternsVisitor,
)
less_or_less = '{0} < {1} or {2} < {3}'
less_or_more = '{0} < {1} or {2} > {3}'
more_or_more = '{0} > {... | true | true |
1c3201552e943a88d2210587978744feca81cc31 | 1,520 | py | Python | .history/classes/Menu_20171107132254.py | reecebenson/DADSA-Tennis-PartA | d0763f819b300fcd0ce27041f5bc4ef0519c00bf | [
"MIT"
] | null | null | null | .history/classes/Menu_20171107132254.py | reecebenson/DADSA-Tennis-PartA | d0763f819b300fcd0ce27041f5bc4ef0519c00bf | [
"MIT"
] | null | null | null | .history/classes/Menu_20171107132254.py | reecebenson/DADSA-Tennis-PartA | d0763f819b300fcd0ce27041f5bc4ef0519c00bf | [
"MIT"
] | null | null | null | # DADSA - Assignment 1
# Reece Benson
class Menu():
# Define the variables we will be using
_app = None
_menu = None
_current_menu = "main"
def __init__(self, app):
# Set our Application
self._app = app
def load(self):
# Define our Menu
self._menu = {
... | 24.126984 | 55 | 0.465789 |
class Menu():
_app = None
_menu = None
_current_menu = "main"
def __init__(self, app):
self._app = app
def load(self):
self._menu = {
'main':
{
'New Season': 'new_season',
'Load Season': ... | true | true |
1c32015a3c35228c38c5bac706f794e1cdc33050 | 7,376 | py | Python | validation/utils/m1.py | PedrV/stfX | 017436cd4ade7f0ea95185d82408697c43ac6ce6 | [
"MIT"
] | null | null | null | validation/utils/m1.py | PedrV/stfX | 017436cd4ade7f0ea95185d82408697c43ac6ce6 | [
"MIT"
] | null | null | null | validation/utils/m1.py | PedrV/stfX | 017436cd4ade7f0ea95185d82408697c43ac6ce6 | [
"MIT"
] | null | null | null | import unittest
import os
from matplotlib import pyplot as plt
from shapely import geometry, affinity
X_COORDINATE = 0
Y_COORDINATE = 1
def extract_x_y(polygon: list) -> (list, list):
"""Extract the x and y coordinates as two separate lists"""
x_list = []
y_list = []
for vertex in polygon:
x... | 33.990783 | 102 | 0.590564 | import unittest
import os
from matplotlib import pyplot as plt
from shapely import geometry, affinity
X_COORDINATE = 0
Y_COORDINATE = 1
def extract_x_y(polygon: list) -> (list, list):
x_list = []
y_list = []
for vertex in polygon:
x_list.append(vertex[X_COORDINATE])
y_list.append(vertex[... | true | true |
1c32021dbc6606cac205c70d2190b3573b2a43c5 | 132 | py | Python | major_leagues/__init__.py | jvolden/major_leagues | 1245baab2c4af92285fe3a026391e429cec5af57 | [
"MIT"
] | null | null | null | major_leagues/__init__.py | jvolden/major_leagues | 1245baab2c4af92285fe3a026391e429cec5af57 | [
"MIT"
] | null | null | null | major_leagues/__init__.py | jvolden/major_leagues | 1245baab2c4af92285fe3a026391e429cec5af57 | [
"MIT"
] | null | null | null | """Top-level package for Major Leagues."""
__author__ = """Jon Patrick Volden"""
__email__ = 'volden@ku.edu'
__version__ = '0.1.0'
| 22 | 42 | 0.681818 |
__author__ = """Jon Patrick Volden"""
__email__ = 'volden@ku.edu'
__version__ = '0.1.0'
| true | true |
1c3202268e3ed7be78e98ac5031be316427fe925 | 4,488 | py | Python | exp.py | tenagusami-ms/exp | 9b439a768d5788baf3f882282643aa72b9ffd314 | [
"MIT"
] | null | null | null | exp.py | tenagusami-ms/exp | 9b439a768d5788baf3f882282643aa72b9ffd314 | [
"MIT"
] | null | null | null | exp.py | tenagusami-ms/exp | 9b439a768d5788baf3f882282643aa72b9ffd314 | [
"MIT"
] | null | null | null | #! /usr/bin/env python
"""Overview:
exp.py : open a directory or a file looked from WSL2 with Windows Explorer
if it is in the Windows filesystem.
If no path is specified, current directory is opened.
Usage:
exp.py [<path>]
exp.py -h | --help
Options:
-h --help ... | 26.093023 | 93 | 0.623217 |
from __future__ import annotations
import dataclasses
import os
from subprocess import run
import re
import pathlib as p
import sys
from functools import reduce
from typing import Optional, MutableMapping
from docopt import docopt
from schema import Schema, SchemaError, Use, And
def main() -> None:
if os.name ... | true | true |
1c320305e20833fd746725118724dbff700e7fbd | 22,271 | py | Python | cvxpy/tests/test_examples.py | rostyboost/cvxpy | 0eb2b20dab92407e4b45f13b6cc124ce96859515 | [
"ECL-2.0",
"Apache-2.0"
] | 1 | 2020-10-21T22:15:55.000Z | 2020-10-21T22:15:55.000Z | cvxpy/tests/test_examples.py | yfzheng11/cvxpy | 95e728b01b6bb442c924812c7eac631019c5cbc6 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | cvxpy/tests/test_examples.py | yfzheng11/cvxpy | 95e728b01b6bb442c924812c7eac631019c5cbc6 | [
"ECL-2.0",
"Apache-2.0"
] | 1 | 2019-04-12T22:40:22.000Z | 2019-04-12T22:40:22.000Z | """
Copyright 2013 Steven Diamond
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 writing, software... | 32.137085 | 84 | 0.532217 |
from __future__ import print_function
import cvxpy as cvx
import cvxpy.interface as intf
from cvxpy.tests.base_test import BaseTest
from cvxpy.reductions.solvers.conic_solvers import ecos_conif
import numpy as np
import unittest
class TestExamples(BaseTest):
def test_chebyshev_center(self):
... | true | true |
1c32035411faf1edc3412842970183b236a6dbfa | 20,364 | py | Python | lib/galaxy/visualization/plugins/config_parser.py | mmiladi/galaxy | 7857b152cd10d9490ac2433ff2905ca1a47ee32c | [
"CC-BY-3.0"
] | 4 | 2018-10-29T18:34:38.000Z | 2021-09-29T23:30:42.000Z | lib/galaxy/visualization/plugins/config_parser.py | mmiladi/galaxy | 7857b152cd10d9490ac2433ff2905ca1a47ee32c | [
"CC-BY-3.0"
] | 1 | 2019-02-04T16:21:27.000Z | 2019-02-04T16:45:17.000Z | lib/galaxy/visualization/plugins/config_parser.py | mmiladi/galaxy | 7857b152cd10d9490ac2433ff2905ca1a47ee32c | [
"CC-BY-3.0"
] | 3 | 2020-02-12T15:22:24.000Z | 2021-08-19T10:27:39.000Z | from six import string_types
import galaxy.model
from galaxy import util
import logging
log = logging.getLogger(__name__)
class ParsingException(ValueError):
"""
An exception class for errors that occur during parsing of the visualizations
framework configuration XML file.
"""
pass
class Visua... | 43.982721 | 117 | 0.638283 | from six import string_types
import galaxy.model
from galaxy import util
import logging
log = logging.getLogger(__name__)
class ParsingException(ValueError):
pass
class VisualizationsConfigParser(object):
ALLOWED_ENTRY_POINT_TYPES = ['mako', 'html', 'script']
VALID_RENDER_TARGETS = ['galaxy_... | true | true |
1c320402f1fb2dfd1546245fc84da34912074997 | 798 | py | Python | interactive/mechanism/urls.py | mattldawson/music-box-interactive | 6b2610b4f0f255f0e78e23628dc7ba6cc844d0f4 | [
"Apache-2.0"
] | null | null | null | interactive/mechanism/urls.py | mattldawson/music-box-interactive | 6b2610b4f0f255f0e78e23628dc7ba6cc844d0f4 | [
"Apache-2.0"
] | null | null | null | interactive/mechanism/urls.py | mattldawson/music-box-interactive | 6b2610b4f0f255f0e78e23628dc7ba6cc844d0f4 | [
"Apache-2.0"
] | null | null | null | from django.urls import path, include
from . import views
urlpatterns = [
path('', views.species_home_handler),
path('conditions-species-list', views.conditions_species_list_handler),
path('reactions', views.reactions_home_handler),
path('reaction-detail', views.reaction_detail_handler),
path('reac... | 44.333333 | 81 | 0.759398 | from django.urls import path, include
from . import views
urlpatterns = [
path('', views.species_home_handler),
path('conditions-species-list', views.conditions_species_list_handler),
path('reactions', views.reactions_home_handler),
path('reaction-detail', views.reaction_detail_handler),
path('reac... | true | true |
1c3204778ce9d06783a0992f4a8fc8455b948397 | 8,955 | py | Python | espnet/nets/pytorch_backend/transducer/rnn_decoder.py | roshansh-cmu/espnet | 5fa6dcc4e649dc66397c629d0030d09ecef36b80 | [
"Apache-2.0"
] | null | null | null | espnet/nets/pytorch_backend/transducer/rnn_decoder.py | roshansh-cmu/espnet | 5fa6dcc4e649dc66397c629d0030d09ecef36b80 | [
"Apache-2.0"
] | null | null | null | espnet/nets/pytorch_backend/transducer/rnn_decoder.py | roshansh-cmu/espnet | 5fa6dcc4e649dc66397c629d0030d09ecef36b80 | [
"Apache-2.0"
] | null | null | null | """RNN decoder definition for Transducer model."""
from typing import Any, Dict, List, Optional, Tuple, Union
import torch
from espnet.nets.transducer_decoder_interface import (
ExtendedHypothesis,
Hypothesis,
TransducerDecoderInterface,
)
class RNNDecoder(TransducerDecoderInterface, torch.nn.Module):
... | 30.56314 | 88 | 0.552205 |
from typing import Any, Dict, List, Optional, Tuple, Union
import torch
from espnet.nets.transducer_decoder_interface import (
ExtendedHypothesis,
Hypothesis,
TransducerDecoderInterface,
)
class RNNDecoder(TransducerDecoderInterface, torch.nn.Module):
def __init__(
self,
odim: int,... | true | true |
1c3204b5c753a39ab2806a24f625af7ab5c53c3e | 2,520 | py | Python | Python/libraries/recognizers-date-time/recognizers_date_time/date_time/chinese/datetime_extractor_config.py | ahmedabuamra/Recognizers-Text | 31193d89d3532839742992a2755c1d8539c68116 | [
"MIT"
] | 10 | 2019-05-11T18:07:14.000Z | 2021-08-20T03:02:47.000Z | Python/libraries/recognizers-date-time/recognizers_date_time/date_time/chinese/datetime_extractor_config.py | ahmedabuamra/Recognizers-Text | 31193d89d3532839742992a2755c1d8539c68116 | [
"MIT"
] | 1 | 2020-07-10T08:25:36.000Z | 2020-07-10T08:25:36.000Z | Python/libraries/recognizers-date-time/recognizers_date_time/date_time/chinese/datetime_extractor_config.py | ahmedabuamra/Recognizers-Text | 31193d89d3532839742992a2755c1d8539c68116 | [
"MIT"
] | 18 | 2019-08-19T12:11:00.000Z | 2021-10-12T09:36:27.000Z | from typing import Pattern
import regex
from recognizers_text import RegExpUtility
from ...resources.chinese_date_time import ChineseDateTime
from ..extractors import DateTimeExtractor
from ..base_datetime import DateTimeExtractorConfiguration
from .date_extractor import ChineseDateExtractor
from .time_extractor impo... | 28.636364 | 98 | 0.717063 | from typing import Pattern
import regex
from recognizers_text import RegExpUtility
from ...resources.chinese_date_time import ChineseDateTime
from ..extractors import DateTimeExtractor
from ..base_datetime import DateTimeExtractorConfiguration
from .date_extractor import ChineseDateExtractor
from .time_extractor impo... | true | true |
1c320652313fc5533b8b6a4c7546f83353505333 | 2,858 | py | Python | Pricing/Binomial_Tree/streamlit_binomial_tree.py | jingshenghua/QuantTopics | 20e64710f9a4f22b626fa0ac0a7b062baccdc62a | [
"MIT"
] | null | null | null | Pricing/Binomial_Tree/streamlit_binomial_tree.py | jingshenghua/QuantTopics | 20e64710f9a4f22b626fa0ac0a7b062baccdc62a | [
"MIT"
] | null | null | null | Pricing/Binomial_Tree/streamlit_binomial_tree.py | jingshenghua/QuantTopics | 20e64710f9a4f22b626fa0ac0a7b062baccdc62a | [
"MIT"
] | null | null | null | import streamlit as st
from datetime import datetime
import matplotlib.pyplot as plt
from tree_generator import BinomialTree
import numpy as np
st.set_option('deprecation.showPyplotGlobalUse', False)
# headings
month = datetime.now().month
title = "Binomial Tree Option Pricing"
st.title(title + "🌲🎄")
st.sidebar.title... | 43.30303 | 114 | 0.730581 | import streamlit as st
from datetime import datetime
import matplotlib.pyplot as plt
from tree_generator import BinomialTree
import numpy as np
st.set_option('deprecation.showPyplotGlobalUse', False)
month = datetime.now().month
title = "Binomial Tree Option Pricing"
st.title(title + "🌲🎄")
st.sidebar.title("Paramete... | true | true |
1c3206ca231af4cca09ce5d975865a86ce75b5f5 | 2,305 | py | Python | sqlalchemy_i18n/__init__.py | matthias-k/sqlalchemy-i18n | d168aa61658ae1f1e01150d0fb086781ab101832 | [
"BSD-3-Clause"
] | null | null | null | sqlalchemy_i18n/__init__.py | matthias-k/sqlalchemy-i18n | d168aa61658ae1f1e01150d0fb086781ab101832 | [
"BSD-3-Clause"
] | null | null | null | sqlalchemy_i18n/__init__.py | matthias-k/sqlalchemy-i18n | d168aa61658ae1f1e01150d0fb086781ab101832 | [
"BSD-3-Clause"
] | null | null | null | import sqlalchemy as sa
from .builders import ImproperlyConfigured
from .manager import translation_base, translation_manager, TranslationManager
from .translatable import Translatable, UnknownLocaleError
__all__ = (
translation_base,
ImproperlyConfigured,
Translatable,
TranslationManager,
transla... | 25.054348 | 78 | 0.646421 | import sqlalchemy as sa
from .builders import ImproperlyConfigured
from .manager import translation_base, translation_manager, TranslationManager
from .translatable import Translatable, UnknownLocaleError
__all__ = (
translation_base,
ImproperlyConfigured,
Translatable,
TranslationManager,
transla... | true | true |
1c32074128ded1c5400004bf892b57033fd0659d | 9,824 | py | Python | plugins/trezor/clientbase.py | electrummoneroclassic/electrummoneroclassic | 5a0d22ae52a73b41788112c3ff75799c6b45a701 | [
"MIT"
] | 1 | 2018-04-14T19:02:36.000Z | 2018-04-14T19:02:36.000Z | plugins/trezor/clientbase.py | electrummoneroclassic/electrummoneroclassic | 5a0d22ae52a73b41788112c3ff75799c6b45a701 | [
"MIT"
] | 2 | 2021-06-02T02:54:27.000Z | 2021-11-15T17:52:11.000Z | plugins/trezor/clientbase.py | electrummoneroclassic/electrummoneroclassic | 5a0d22ae52a73b41788112c3ff75799c6b45a701 | [
"MIT"
] | null | null | null | import time
from struct import pack
from electrum.i18n import _
from electrum.util import PrintError, UserCancelled
from electrum.keystore import bip39_normalize_passphrase
from electrum.bitcoin import serialize_xpub
class GuiMixin(object):
# Requires: self.proto, self.device
messages = {
3: _("Conf... | 38.225681 | 136 | 0.613599 | import time
from struct import pack
from electrum.i18n import _
from electrum.util import PrintError, UserCancelled
from electrum.keystore import bip39_normalize_passphrase
from electrum.bitcoin import serialize_xpub
class GuiMixin(object):
messages = {
3: _("Confirm the transaction output on your ... | true | true |
1c320786f51b632b86c2f6c0d8837796e78e198e | 3,767 | py | Python | cryptodome.py | dougalhatesrabbits/cryptodome | 71d0c40146aec0b5538989c203946ba685c327a7 | [
"MIT"
] | null | null | null | cryptodome.py | dougalhatesrabbits/cryptodome | 71d0c40146aec0b5538989c203946ba685c327a7 | [
"MIT"
] | null | null | null | cryptodome.py | dougalhatesrabbits/cryptodome | 71d0c40146aec0b5538989c203946ba685c327a7 | [
"MIT"
] | null | null | null | from Crypto import Random # use to generate a random byte string of a length we decide
from Cryptodome.Cipher import AES
from Cryptodome.Hash import SHA256
from Cryptodome import Random
from Cryptodome.Random import get_random_bytes
# Builtins
import base64
import hashlib
'''
https://tutorialsoverflow.com/python-enc... | 35.87619 | 116 | 0.692328 | from Crypto import Random
from Cryptodome.Cipher import AES
from Cryptodome.Hash import SHA256
from Cryptodome import Random
from Cryptodome.Random import get_random_bytes
import base64
import hashlib
BS = 16
def pad(s):
return s + (BS - len(s) % BS) * chr(BS - len(s) % BS)
def unpad(s):
return s[0... | true | true |
1c3209001d306c11f2a53706283e9bff8107721b | 4,496 | py | Python | src/sentry/runner/commands/devserver.py | mitsuhiko/sentry | cddc3b643a13b52ac6d07ff22e4bd5d69ecbad90 | [
"BSD-3-Clause"
] | 4 | 2016-03-16T07:21:36.000Z | 2017-09-04T07:29:56.000Z | src/sentry/runner/commands/devserver.py | mitsuhiko/sentry | cddc3b643a13b52ac6d07ff22e4bd5d69ecbad90 | [
"BSD-3-Clause"
] | null | null | null | src/sentry/runner/commands/devserver.py | mitsuhiko/sentry | cddc3b643a13b52ac6d07ff22e4bd5d69ecbad90 | [
"BSD-3-Clause"
] | null | null | null | """
sentry.runner.commands.devserver
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:copyright: (c) 2016 by the Sentry Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
from __future__ import absolute_import, print_function
import click
from sentry.runner.decorators import configuration, log_opti... | 33.058824 | 109 | 0.623888 | from __future__ import absolute_import, print_function
import click
from sentry.runner.decorators import configuration, log_options
@click.command()
@click.option('--reload/--no-reload', default=True, help='Autoreloading of python files.')
@click.option('--watchers/--no-watchers', default=True, help='Watch static fi... | true | true |
1c320ae3be5e3bae0e53964b1f5a4e7025074013 | 1,927 | py | Python | demos/anisotropic_distribution.py | nids2001/UncertainSCI | b3105bddc064575477589d7a930c71fa3149ef36 | [
"MIT"
] | 1 | 2021-07-25T17:02:36.000Z | 2021-07-25T17:02:36.000Z | demos/anisotropic_distribution.py | nids2001/UncertainSCI | b3105bddc064575477589d7a930c71fa3149ef36 | [
"MIT"
] | 70 | 2020-04-09T17:38:12.000Z | 2022-03-18T17:06:09.000Z | demos/anisotropic_distribution.py | nids2001/UncertainSCI | b3105bddc064575477589d7a930c71fa3149ef36 | [
"MIT"
] | 7 | 2020-05-28T17:26:05.000Z | 2021-08-13T21:41:10.000Z | # Demonstrates generation of anisotropic distributions. Example is similar to
# quantiles.py demo.
import numpy as np
from matplotlib import pyplot as plt
from UncertainSCI.distributions import BetaDistribution
from UncertainSCI.model_examples import sine_modulation
from UncertainSCI.indexing import TotalDegreeSet
fr... | 27.140845 | 121 | 0.709912 |
import numpy as np
from matplotlib import pyplot as plt
from UncertainSCI.distributions import BetaDistribution
from UncertainSCI.model_examples import sine_modulation
from UncertainSCI.indexing import TotalDegreeSet
from UncertainSCI.pce import PolynomialChaosExpansion
alpha = [1., 2., 3.]
beta = [3., 2., 1.]
d... | true | true |
1c320b1e440389a8b19643a86cd2a8d9b42b3eae | 1,486 | py | Python | src/components/game-server/lib/data/model/tictactoe/tictactoe_factory.py | rorik/UBU-DMS | 7c3fc38823478054499e233dd36b8b4430d3f3d3 | [
"MIT"
] | null | null | null | src/components/game-server/lib/data/model/tictactoe/tictactoe_factory.py | rorik/UBU-DMS | 7c3fc38823478054499e233dd36b8b4430d3f3d3 | [
"MIT"
] | null | null | null | src/components/game-server/lib/data/model/tictactoe/tictactoe_factory.py | rorik/UBU-DMS | 7c3fc38823478054499e233dd36b8b4430d3f3d3 | [
"MIT"
] | 1 | 2020-02-07T11:36:04.000Z | 2020-02-07T11:36:04.000Z | from lib.data.model.shared.abstract_factory import AbstractFactory
from lib.data.model.tictactoe.tictactoe_gamemaster import TicTacToeGameMaster
from lib.data.model.tictactoe.tictactoe_board import TicTacToeBoard
class TicTacToeFactory(AbstractFactory):
def __init__(self):
super().__init__()
def _bu... | 37.15 | 130 | 0.600942 | from lib.data.model.shared.abstract_factory import AbstractFactory
from lib.data.model.tictactoe.tictactoe_gamemaster import TicTacToeGameMaster
from lib.data.model.tictactoe.tictactoe_board import TicTacToeBoard
class TicTacToeFactory(AbstractFactory):
def __init__(self):
super().__init__()
def _bu... | true | true |
1c320b6b9517633e2d1bc6c012f0d1a7f77e9a2b | 2,734 | py | Python | infra/bots/recipes/g3_compile.py | umberto-sonnino/skia | 7ecc54217889025b3e0c512f92fb84d20a26b9f7 | [
"BSD-3-Clause"
] | 1 | 2021-04-09T23:24:57.000Z | 2021-04-09T23:24:57.000Z | infra/bots/recipes/g3_compile.py | umberto-sonnino/skia | 7ecc54217889025b3e0c512f92fb84d20a26b9f7 | [
"BSD-3-Clause"
] | 1 | 2019-11-22T15:25:32.000Z | 2019-11-22T15:25:32.000Z | infra/bots/recipes/g3_compile.py | promoter/skia | bc5ed776134c60ae13d22cabc8e0f6aca0fdd422 | [
"BSD-3-Clause"
] | null | null | null | # Copyright 2019 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
DEPS = [
'recipe_engine/file',
'recipe_engine/json',
'recipe_engine/path',
'recipe_engine/properties',
'recipe_engine/raw_io',
'recipe_engine/st... | 30.719101 | 78 | 0.64338 |
DEPS = [
'recipe_engine/file',
'recipe_engine/json',
'recipe_engine/path',
'recipe_engine/properties',
'recipe_engine/raw_io',
'recipe_engine/step',
'vars',
]
def RunSteps(api):
api.vars.setup()
if not api.vars.is_trybot:
raise Exception('%s can only be run as a trybot.' % api.vars.builder_... | true | true |
1c320be6ba63c28d56b3362c3d113f00860e4ccb | 2,221 | py | Python | learn/prog/01/01.py | git001/milq | d4ca676a72e5d09842bbbc592e54f9b73a05894a | [
"MIT"
] | 2 | 2020-05-20T22:26:34.000Z | 2021-04-24T20:23:32.000Z | learn/prog/01/01.py | VirgoCoachman/milq | ee794087759d4a0cbd8f830bc42976fdf44b5483 | [
"MIT"
] | null | null | null | learn/prog/01/01.py | VirgoCoachman/milq | ee794087759d4a0cbd8f830bc42976fdf44b5483 | [
"MIT"
] | 1 | 2017-09-15T01:52:52.000Z | 2017-09-15T01:52:52.000Z |
# This is a comment
'''
This is a comment
on multiple lines
'''
# VARIABLES
#
# A variable is a symbol that represents a quantity that may vary.
#
# $identifier = value;
age = 25 # The value 25 is assigned to variable age
# BASIC DATA TYPES
age = 25 # Integer
te... | 27.7625 | 89 | 0.481765 |
age = 25
age = 25
temperature = -3.82
name = 'Nacho López'
has_car = True
x = 5
y = 2
z = x + y
z = x - y
z = x * y
z = x / y
z = x % y
z =... | true | true |
1c320bfc84a9615be392b8014ec39ae39c885a21 | 31,893 | py | Python | conference.py | xuemeiwei/Conference-Central_Udacity | e1e7d94f9c18d772cb12da8e943b4e39feeda7c4 | [
"Apache-2.0"
] | null | null | null | conference.py | xuemeiwei/Conference-Central_Udacity | e1e7d94f9c18d772cb12da8e943b4e39feeda7c4 | [
"Apache-2.0"
] | null | null | null | conference.py | xuemeiwei/Conference-Central_Udacity | e1e7d94f9c18d772cb12da8e943b4e39feeda7c4 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
"""
conference.py -- Udacity conference server-side Python App Engine API;
uses Google Cloud Endpoints
$Id: conference.py,v 1.25 2014/05/24 23:42:19 wesc Exp wesc $
created by wesc on 2014 apr 21
"""
__author__ = 'wesc+api@google.com (Wesley Chun)'
from datetime import datetime
import ... | 40.268939 | 106 | 0.612924 |
__author__ = 'wesc+api@google.com (Wesley Chun)'
from datetime import datetime
import endpoints
from protorpc import messages
from protorpc import message_types
from protorpc import remote
from google.appengine.api import urlfetch
from google.appengine.api import memcache
from google.appengine.api import taskque... | true | true |
1c320c87b3d8770c338cf4316ed1452f8194399a | 27 | py | Python | src/access/access_exam.py | monkeychen/python-tutorial | a24785da6b4d857200b819ad4d960885b1ef7a20 | [
"Apache-2.0"
] | null | null | null | src/access/access_exam.py | monkeychen/python-tutorial | a24785da6b4d857200b819ad4d960885b1ef7a20 | [
"Apache-2.0"
] | null | null | null | src/access/access_exam.py | monkeychen/python-tutorial | a24785da6b4d857200b819ad4d960885b1ef7a20 | [
"Apache-2.0"
] | null | null | null | print("hello")
a = "test"
| 6.75 | 14 | 0.555556 | print("hello")
a = "test"
| true | true |
1c320c941caf00a0a7504d386a9d4dfb1ff705f3 | 8,153 | py | Python | code/src/functionality_helpers.py | ZohrehShams/IntegrativeRuleExtractionMethodology | fd7b569d11de540ffe94e0cc588e78305e45689e | [
"MIT"
] | 1 | 2022-03-20T12:33:16.000Z | 2022-03-20T12:33:16.000Z | code/src/functionality_helpers.py | ZohrehShams/IntegrativeRuleExtractionMethodology | fd7b569d11de540ffe94e0cc588e78305e45689e | [
"MIT"
] | null | null | null | code/src/functionality_helpers.py | ZohrehShams/IntegrativeRuleExtractionMethodology | fd7b569d11de540ffe94e0cc588e78305e45689e | [
"MIT"
] | 1 | 2022-03-20T12:33:58.000Z | 2022-03-20T12:33:58.000Z | import numpy as np
import pickle
import dnn_re
from evaluate_rules.predict_explain import predict_explain, print_explanation
from evaluate_rules.overlapping_features import features_recurrence_in_explanation
from src import *
from evaluate_rules.predict_explain import predict_explain, print_explanation
from evaluate_ru... | 40.562189 | 182 | 0.707592 | import numpy as np
import pickle
import dnn_re
from evaluate_rules.predict_explain import predict_explain, print_explanation
from evaluate_rules.overlapping_features import features_recurrence_in_explanation
from src import *
from evaluate_rules.predict_explain import predict_explain, print_explanation
from evaluate_ru... | true | true |
1c320cc60c9746c59bab9a2b8976d83777960563 | 13,423 | py | Python | intermediate_source/pruning_tutorial.py | Justin-A/PyTorch-tutorials-kr | 0d8e407523e5e75de0081becf800b82b37eb912f | [
"BSD-3-Clause"
] | 1 | 2021-11-16T05:29:28.000Z | 2021-11-16T05:29:28.000Z | intermediate_source/pruning_tutorial.py | Justin-A/PyTorch-tutorials-kr | 0d8e407523e5e75de0081becf800b82b37eb912f | [
"BSD-3-Clause"
] | null | null | null | intermediate_source/pruning_tutorial.py | Justin-A/PyTorch-tutorials-kr | 0d8e407523e5e75de0081becf800b82b37eb912f | [
"BSD-3-Clause"
] | 1 | 2022-02-27T10:47:39.000Z | 2022-02-27T10:47:39.000Z | # -*- coding: utf-8 -*-
"""
가지치기 기법(Pruning) 튜토리얼
=====================================
**저자**: `Michela Paganini <https://github.com/mickypaganini>`_
**번역** : `안상준 <https://github.com/Justin-A>`_
최첨단 딥러닝 모델들은 굉장히 많은 수의 파라미터값들로 구성되기 때문에, 쉽게 배포되기 어렵습니다.
이와 반대로, 생물학적 신경망들은 효율적으로 희소하게 연결된 것으로 알려져 있습니다.
모델의 정확도가 손상되지 않는 범... | 37.494413 | 99 | 0.53088 |
import torch
from torch import nn
import torch.nn.utils.prune as prune
import torch.nn.functional as F
| true | true |
1c320dffcec86724926d3d7d3a725d71e7aef05a | 1,141 | py | Python | hata/ext/slash/menus/closer.py | albertopoljak/hata | 96d0b3182eb4f5291eaf36bd23d521787c6b01f1 | [
"0BSD"
] | null | null | null | hata/ext/slash/menus/closer.py | albertopoljak/hata | 96d0b3182eb4f5291eaf36bd23d521787c6b01f1 | [
"0BSD"
] | null | null | null | hata/ext/slash/menus/closer.py | albertopoljak/hata | 96d0b3182eb4f5291eaf36bd23d521787c6b01f1 | [
"0BSD"
] | 1 | 2020-09-17T20:10:15.000Z | 2020-09-17T20:10:15.000Z | __all__ = ('Closer', )
from scarletio import CancelledError
from ....discord.interaction import ComponentButton, ComponentRow
from .menu import Menu
from .helpers import EMOJI_CANCEL, top_level_check, top_level_get_timeout, CUSTOM_ID_CANCEL, get_auto_check
class Closer(Menu):
BUTTON_CANCEL = ComponentButto... | 27.829268 | 107 | 0.655565 | __all__ = ('Closer', )
from scarletio import CancelledError
from ....discord.interaction import ComponentButton, ComponentRow
from .menu import Menu
from .helpers import EMOJI_CANCEL, top_level_check, top_level_get_timeout, CUSTOM_ID_CANCEL, get_auto_check
class Closer(Menu):
BUTTON_CANCEL = ComponentButto... | true | true |
1c321021a8d46291c5590afb59264fb3d1935edc | 956 | py | Python | expert_python/src/socket_http.py | MaiXiaochai/Droplet | 6d7fed9ca76678768a3752fa8df86a021acc3509 | [
"MIT"
] | null | null | null | expert_python/src/socket_http.py | MaiXiaochai/Droplet | 6d7fed9ca76678768a3752fa8df86a021acc3509 | [
"MIT"
] | null | null | null | expert_python/src/socket_http.py | MaiXiaochai/Droplet | 6d7fed9ca76678768a3752fa8df86a021acc3509 | [
"MIT"
] | null | null | null | #!/usr/bin/python
# -*- coding: utf-8 -*-
# @File : socket_http.py
# @Time : 2019/3/4 23:26
# @Author : MaiXiaochai
# @Site : https://github.com/MaiXiaochai
import socket
from urllib.parse import urlparse
def get_url(url):
# 通过socket请求html
url = urlparse(url)
host = url.netloc
path = url.p... | 19.916667 | 107 | 0.574268 |
import socket
from urllib.parse import urlparse
def get_url(url):
url = urlparse(url)
host = url.netloc
path = url.path
if path == "":
path = '/'
client = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
client.connect((host, 80))
client.send... | true | true |
1c321066b129f999453f696b189573231cce56ca | 601 | py | Python | AGONS/AGONS/test.py | CWSmith022/yigit-lab | 8ec1f7d0242d36351ef92bc6698358c9431f4c34 | [
"MIT"
] | null | null | null | AGONS/AGONS/test.py | CWSmith022/yigit-lab | 8ec1f7d0242d36351ef92bc6698358c9431f4c34 | [
"MIT"
] | null | null | null | AGONS/AGONS/test.py | CWSmith022/yigit-lab | 8ec1f7d0242d36351ef92bc6698358c9431f4c34 | [
"MIT"
] | null | null | null | # %%
"""Test how custom functions work with sklearn package."""
import numpy as np
from sklearn.preprocessing import FunctionTransformer
from sklearn.preprocessing import StandardScaler, MinMaxScaler
x = np.array([[1,2,3], [6,5,4], [8,7,9]])
print(x)
def SSRow(X):
X_ = X.copy()
X_t = StandardScaler().fit_transf... | 25.041667 | 62 | 0.698835 |
import numpy as np
from sklearn.preprocessing import FunctionTransformer
from sklearn.preprocessing import StandardScaler, MinMaxScaler
x = np.array([[1,2,3], [6,5,4], [8,7,9]])
print(x)
def SSRow(X):
X_ = X.copy()
X_t = StandardScaler().fit_transform(X_.T).T
return X_t
def MMRow(X):
X_ = X.copy()
... | true | true |
1c32122e73533e7f7ceb0fa50188f83c9951b7fd | 2,283 | py | Python | prepare-data.py | waytrue17/dynamic-training-with-apache-mxnet-on-aws | d6289f4002e4a3886f97a799a68bb653fea12672 | [
"Apache-2.0"
] | 54 | 2018-11-27T06:00:52.000Z | 2022-03-24T09:41:01.000Z | prepare-data.py | waytrue17/dynamic-training-with-apache-mxnet-on-aws | d6289f4002e4a3886f97a799a68bb653fea12672 | [
"Apache-2.0"
] | 3 | 2018-11-27T16:45:44.000Z | 2020-10-21T00:15:02.000Z | prepare-data.py | waytrue17/dynamic-training-with-apache-mxnet-on-aws | d6289f4002e4a3886f97a799a68bb653fea12672 | [
"Apache-2.0"
] | 18 | 2018-11-29T21:18:38.000Z | 2022-03-17T22:18:43.000Z | # Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy of this
# software and associated documentation files (the "Software"), to deal in the Software
# without restriction, including without limitation the rights to use... | 40.052632 | 87 | 0.697766 |
import subprocess
import os
import errno
def download_file(url, local_fname=None, force_write=False):
import requests
if local_fname is None:
local_fname = url.split('/')[-1]
if not force_write and os.path.exists(local_fname):
return local_fname
dir_name = os.pat... | true | true |
1c3213af9141a47d8c41a7dc75aec7b0dc6fc928 | 6,351 | py | Python | test/unit/module/config/test_config_mixin.py | Adam-sHub/cfn-lint | 4c501d01f87ec0ef9432dc407c5a9ac0025f00b6 | [
"MIT-0"
] | 1,134 | 2019-03-02T14:58:34.000Z | 2021-05-15T00:57:16.000Z | test/unit/module/config/test_config_mixin.py | Adam-sHub/cfn-lint | 4c501d01f87ec0ef9432dc407c5a9ac0025f00b6 | [
"MIT-0"
] | 1,122 | 2019-03-03T04:27:15.000Z | 2021-05-14T20:51:16.000Z | test/unit/module/config/test_config_mixin.py | Adam-sHub/cfn-lint | 4c501d01f87ec0ef9432dc407c5a9ac0025f00b6 | [
"MIT-0"
] | 297 | 2019-03-11T09:56:57.000Z | 2021-05-14T16:41:19.000Z | """
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
SPDX-License-Identifier: MIT-0
"""
import logging
import os
from test.testlib.testcase import BaseTestCase
from mock import patch
import cfnlint.config # pylint: disable=E0401
from cfnlint.helpers import REGIONS
LOGGER = logging.getLogger('cfnlin... | 33.781915 | 102 | 0.572981 | import logging
import os
from test.testlib.testcase import BaseTestCase
from mock import patch
import cfnlint.config
from cfnlint.helpers import REGIONS
LOGGER = logging.getLogger('cfnlint')
class TestConfigMixIn(BaseTestCase):
def tearDown(self):
for handler in LOGGER.handlers:
LOGGER.re... | true | true |
1c32142d0236311c8aff644fbcf2d183aa3841e8 | 1,544 | py | Python | pip_services3_messaging/test/TestMessageReceiver.py | pip-services-python/pip-services-messaging-python | edaca5cd620a51e9d9f713811e64bb0f532851ce | [
"MIT"
] | null | null | null | pip_services3_messaging/test/TestMessageReceiver.py | pip-services-python/pip-services-messaging-python | edaca5cd620a51e9d9f713811e64bb0f532851ce | [
"MIT"
] | null | null | null | pip_services3_messaging/test/TestMessageReceiver.py | pip-services-python/pip-services-messaging-python | edaca5cd620a51e9d9f713811e64bb0f532851ce | [
"MIT"
] | 1 | 2020-03-19T22:19:30.000Z | 2020-03-19T22:19:30.000Z | # -*- coding: utf-8 -*-
import threading
from typing import List, Optional
from pip_services3_commons.run import ICleanable
from pip_services3_messaging.queues import IMessageReceiver, MessageEnvelope, IMessageQueue
class TestMessageReceiver(IMessageReceiver, ICleanable):
"""
TODO add description
"""
... | 29.132075 | 102 | 0.658031 |
import threading
from typing import List, Optional
from pip_services3_commons.run import ICleanable
from pip_services3_messaging.queues import IMessageReceiver, MessageEnvelope, IMessageQueue
class TestMessageReceiver(IMessageReceiver, ICleanable):
def __init__(self):
self.__messages: List[MessageEnve... | true | true |
1c32155b38f939a3e5358977f470abd59cc365fb | 2,354 | py | Python | tflite_handtrack/handtrack.py | slothkong/handtrack | e4825535f858f83c15dc611fd80953313177f835 | [
"Apache-2.0"
] | null | null | null | tflite_handtrack/handtrack.py | slothkong/handtrack | e4825535f858f83c15dc611fd80953313177f835 | [
"Apache-2.0"
] | 5 | 2020-02-07T20:38:13.000Z | 2022-02-10T00:38:26.000Z | tflite_handtrack/handtrack.py | slothkong/handtrack | e4825535f858f83c15dc611fd80953313177f835 | [
"Apache-2.0"
] | null | null | null | """
Custom script to perform hand tracking and optionally cropping and saving the bounding boxes content. I created it using
the following libraries/resources:
1. Video capture uses Opencv to stream from a webcam.
2. The detection utilizes a pre-trained Palm Detector model developed by Google AI Research,
which was... | 32.694444 | 120 | 0.657604 |
import os
import time
import argparse
import numpy as np
import cv2
from utils import preprocess_image, rescale_bbox
from detector import Detector
def parse_arguments():
parser = argparse.ArgumentParser()
parser.add_argument("--modeldir",
help="Folder the .tflite file is locate... | true | true |
1c3215928d8c8c04642d33f7563762d1827f09b1 | 2,711 | py | Python | theano/scan_module/tests/test_scan_checkpoints.py | gundun/theano | 09d17fff10487dca7149e34601b8c6efdc572a19 | [
"BSD-3-Clause"
] | null | null | null | theano/scan_module/tests/test_scan_checkpoints.py | gundun/theano | 09d17fff10487dca7149e34601b8c6efdc572a19 | [
"BSD-3-Clause"
] | null | null | null | theano/scan_module/tests/test_scan_checkpoints.py | gundun/theano | 09d17fff10487dca7149e34601b8c6efdc572a19 | [
"BSD-3-Clause"
] | null | null | null | from __future__ import absolute_import, print_function, division
import numpy
import unittest
import theano
import theano.tensor as T
try:
from pygpu.gpuarray import GpuArrayException
PYGPU_AVAILABLE = True
except ImportError:
PYGPU_AVAILABLE = False
class TestScanCheckpoint(unittest.TestCase):
de... | 38.183099 | 78 | 0.61564 | from __future__ import absolute_import, print_function, division
import numpy
import unittest
import theano
import theano.tensor as T
try:
from pygpu.gpuarray import GpuArrayException
PYGPU_AVAILABLE = True
except ImportError:
PYGPU_AVAILABLE = False
class TestScanCheckpoint(unittest.TestCase):
de... | true | true |
1c32165cf5ae8a05b1774be9a26bf5f4f47899aa | 64 | py | Python | network/__init__.py | laerreal/librfunc | 5f46e75d52966481c19ca19081892ff9b2c17990 | [
"BSD-3-Clause"
] | null | null | null | network/__init__.py | laerreal/librfunc | 5f46e75d52966481c19ca19081892ff9b2c17990 | [
"BSD-3-Clause"
] | null | null | null | network/__init__.py | laerreal/librfunc | 5f46e75d52966481c19ca19081892ff9b2c17990 | [
"BSD-3-Clause"
] | null | null | null | from ..importall import gen_this
gen_this()
from .this import *
| 16 | 32 | 0.765625 | from ..importall import gen_this
gen_this()
from .this import *
| true | true |
1c3216d667f35002ba73f3edc96d6e94321b667a | 20,079 | py | Python | python/services/bigquery/beta/routine.py | trodge/declarative-resource-client-library | 2cb7718a5074776b3113cc18a7483b54022238f3 | [
"Apache-2.0"
] | null | null | null | python/services/bigquery/beta/routine.py | trodge/declarative-resource-client-library | 2cb7718a5074776b3113cc18a7483b54022238f3 | [
"Apache-2.0"
] | null | null | null | python/services/bigquery/beta/routine.py | trodge/declarative-resource-client-library | 2cb7718a5074776b3113cc18a7483b54022238f3 | [
"Apache-2.0"
] | null | null | null | # Copyright 2022 Google LLC. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... | 36.243682 | 88 | 0.675581 |
from connector import channel
from google3.cloud.graphite.mmv2.services.google.bigquery import routine_pb2
from google3.cloud.graphite.mmv2.services.google.bigquery import routine_pb2_grpc
from typing import List
class Routine(object):
def __init__(
self,
etag: str = None,
na... | true | true |
1c3218445516a8e8e61d1a56cba390d2063fdbb0 | 7,575 | py | Python | Network.py | qingqinl/Movie_recommendation_system | 8896813b56a02e80c30dec845cc9ffb9d946426a | [
"MIT"
] | 4 | 2019-05-07T13:57:44.000Z | 2021-05-04T10:00:20.000Z | Network.py | qingqinl/Movie_recommendation_system | 8896813b56a02e80c30dec845cc9ffb9d946426a | [
"MIT"
] | null | null | null | Network.py | qingqinl/Movie_recommendation_system | 8896813b56a02e80c30dec845cc9ffb9d946426a | [
"MIT"
] | 5 | 2018-04-21T08:02:11.000Z | 2019-05-07T13:58:44.000Z | from model_Init import *
## 定义User的嵌入矩阵
def get_user_embedding(uid, user_gender, user_age, user_job):
with tf.name_scope("user_embedding"):
uid_embed_matrix = tf.Variable(tf.random_uniform([uid_max, embed_dim], -1, 1), name = "uid_embed_matrix")
uid_embed_layer = tf.nn.embedding_lookup(uid_embed_matrix, uid, name... | 45.63253 | 146 | 0.777954 | from model_Init import *
_embedding(uid, user_gender, user_age, user_job):
with tf.name_scope("user_embedding"):
uid_embed_matrix = tf.Variable(tf.random_uniform([uid_max, embed_dim], -1, 1), name = "uid_embed_matrix")
uid_embed_layer = tf.nn.embedding_lookup(uid_embed_matrix, uid, name = "uid_embed_layer")
g... | true | true |
1c3218e98425eccd4ffcd85d939ce07c12783071 | 4,990 | py | Python | xpython/byteop/byteop26.py | rocky/xpython | ce4ed4329cee2af0aab94254276f5a5687dd25f9 | [
"MIT"
] | 1 | 2020-04-28T13:18:13.000Z | 2020-04-28T13:18:13.000Z | xpython/byteop/byteop26.py | rocky/xbyterun | fde8f8a31ffd3e3c4545d76b4b1edf4b7e0191d9 | [
"MIT"
] | null | null | null | xpython/byteop/byteop26.py | rocky/xbyterun | fde8f8a31ffd3e3c4545d76b4b1edf4b7e0191d9 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""Bytecode Interpreter operations for Python 2.6
Note: this is subclassed so later versions may use operations from here.
"""
import os
import sys
import xpython.stdlib
from xdis.version_info import PYTHON_VERSION_TRIPLE
try:
import importlib
except ImportError:
importlib = None
fr... | 38.091603 | 126 | 0.597996 |
import os
import sys
import xpython.stdlib
from xdis.version_info import PYTHON_VERSION_TRIPLE
try:
import importlib
except ImportError:
importlib = None
from xpython.byteop.byteop import fmt_binary_op
from xpython.byteop.byteop24 import fmt_make_function, Version_info
from xpython.byteop.byteop25 import B... | true | true |
1c32191e5989ca9ffe4e2cced12fb25f432a9b47 | 45 | py | Python | CodingBat/Warmup-2/string_times.py | arthxvr/coding--python | 1e91707be6cb8fef816dad0c1a65f2cc3327357e | [
"MIT"
] | null | null | null | CodingBat/Warmup-2/string_times.py | arthxvr/coding--python | 1e91707be6cb8fef816dad0c1a65f2cc3327357e | [
"MIT"
] | null | null | null | CodingBat/Warmup-2/string_times.py | arthxvr/coding--python | 1e91707be6cb8fef816dad0c1a65f2cc3327357e | [
"MIT"
] | null | null | null | def string_times(str, n):
return str * n
| 15 | 25 | 0.644444 | def string_times(str, n):
return str * n
| true | true |
1c3219f35ecf247590dfae96ca5c7f08de0a65c4 | 563 | py | Python | locust_demo/example2.py | jmkhael/locust_demo | d5c82bc56cd3c5d30a8944d796f88f093e058182 | [
"MIT"
] | null | null | null | locust_demo/example2.py | jmkhael/locust_demo | d5c82bc56cd3c5d30a8944d796f88f093e058182 | [
"MIT"
] | 1 | 2021-03-24T21:44:45.000Z | 2021-03-24T21:44:45.000Z | locust_demo/example2.py | jmkhael/locust_demo | d5c82bc56cd3c5d30a8944d796f88f093e058182 | [
"MIT"
] | null | null | null | import random
from locust import HttpUser, task, between
class MyTaskSet(HttpUser):
wait_time = between(5, 9)
def on_start(self):
res = self.client.post('login',
{
"username": 'admin',
"password": 'default'
... | 21.653846 | 56 | 0.48135 | import random
from locust import HttpUser, task, between
class MyTaskSet(HttpUser):
wait_time = between(5, 9)
def on_start(self):
res = self.client.post('login',
{
"username": 'admin',
"password": 'default'
... | true | true |
1c3219fd5bd2b16ac6a8609f575a8b587dbfa400 | 33,904 | py | Python | lib/python2.7/distutils/command/build_ext.py | TinkerEdgeR-Android/prebuilts_python_linux-x86_2.7.5 | 5bcc5eb23dbb00d5e5dbf75835aa2fb79e8bafa2 | [
"PSF-2.0"
] | 2,151 | 2020-04-18T07:31:17.000Z | 2022-03-31T08:39:18.000Z | lib/python2.7/distutils/command/build_ext.py | TinkerEdgeR-Android/prebuilts_python_linux-x86_2.7.5 | 5bcc5eb23dbb00d5e5dbf75835aa2fb79e8bafa2 | [
"PSF-2.0"
] | 395 | 2020-04-18T08:22:18.000Z | 2021-12-08T13:04:49.000Z | lib/python2.7/distutils/command/build_ext.py | TinkerEdgeR-Android/prebuilts_python_linux-x86_2.7.5 | 5bcc5eb23dbb00d5e5dbf75835aa2fb79e8bafa2 | [
"PSF-2.0"
] | 338 | 2020-04-18T08:03:10.000Z | 2022-03-29T12:33:22.000Z | """distutils.command.build_ext
Implements the Distutils 'build_ext' command, for building extension
modules (currently limited to C extensions, should accommodate C++
extensions ASAP)."""
# This module should be kept compatible with Python 2.1.
__revision__ = "$Id$"
import sys, os, string, re
from types import *
fr... | 42.38 | 86 | 0.578958 | """distutils.command.build_ext
Implements the Distutils 'build_ext' command, for building extension
modules (currently limited to C extensions, should accommodate C++
extensions ASAP)."""
__revision__ = "$Id$"
import sys, os, string, re
from types import *
from site import USER_BASE, USER_SITE
from distutils.core ... | false | true |
1c321c8b04ced57168a44d64a949a88e3dc7091a | 623 | py | Python | test.py | bitscuit/Text-Deduplication | 7f9921ea7ca01a56557b4145daede7f59258f02e | [
"MIT"
] | null | null | null | test.py | bitscuit/Text-Deduplication | 7f9921ea7ca01a56557b4145daede7f59258f02e | [
"MIT"
] | null | null | null | test.py | bitscuit/Text-Deduplication | 7f9921ea7ca01a56557b4145daede7f59258f02e | [
"MIT"
] | null | null | null | import keras
from keras.preprocessing.text import Tokenizer
from keras.preprocessing.sequence import pad_sequences
string1 = 'this is a sample sentence to test similarity'
string2 = 'this is a sample sentence to test similarity too'
t = Tokenizer()
t.fit_on_texts([string1])
t.fit_on_texts([string2])
sequence1 = t.te... | 31.15 | 93 | 0.784912 | import keras
from keras.preprocessing.text import Tokenizer
from keras.preprocessing.sequence import pad_sequences
string1 = 'this is a sample sentence to test similarity'
string2 = 'this is a sample sentence to test similarity too'
t = Tokenizer()
t.fit_on_texts([string1])
t.fit_on_texts([string2])
sequence1 = t.te... | true | true |
1c321d2118d7f632e4969aca96520b34012f982a | 3,427 | py | Python | imperative/python/megengine/optimizer/adadelta.py | chenls/MegEngine | 3f783aba4b81ab628ad911d0c66a49d163a8aaf6 | [
"Apache-2.0"
] | 3 | 2021-08-08T12:55:53.000Z | 2021-12-10T06:01:04.000Z | imperative/python/megengine/optimizer/adadelta.py | MediosZ/MegEngine | 5c775d02dd0b8f20b5acc6b400cf722e92f2e86b | [
"Apache-2.0"
] | 6 | 2020-04-24T08:52:06.000Z | 2021-08-16T06:38:23.000Z | imperative/python/megengine/optimizer/adadelta.py | MediosZ/MegEngine | 5c775d02dd0b8f20b5acc6b400cf722e92f2e86b | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# MegEngine is Licensed under the Apache License, Version 2.0 (the "License")
#
# Copyright (c) 2014-2021 Megvii Inc. All rights reserved.
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT ARRANTI... | 34.969388 | 110 | 0.610155 |
from typing import Iterable, Union
import numpy as np
from ..tensor import Parameter, tensor
from .optimizer import Optimizer
class Adadelta(Optimizer):
def __init__(
self,
params: Union[Iterable[Parameter], dict],
lr: float = 1.0,
rho: float = 0.9,
eps: float = ... | true | true |
1c321e0d1e6c72eea8bae445367a295f62188a6b | 4,613 | py | Python | projects_oss/detr/detr/d2/dataset_mapper.py | Pandinosaurus/d2go | fd79c680749184509efb2017d478d8c00656bbe2 | [
"Apache-2.0"
] | null | null | null | projects_oss/detr/detr/d2/dataset_mapper.py | Pandinosaurus/d2go | fd79c680749184509efb2017d478d8c00656bbe2 | [
"Apache-2.0"
] | null | null | null | projects_oss/detr/detr/d2/dataset_mapper.py | Pandinosaurus/d2go | fd79c680749184509efb2017d478d8c00656bbe2 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved
import copy
import logging
import numpy as np
import torch
from detectron2.data import detection_utils as utils
from detectron2.data import transforms as... | 36.904 | 111 | 0.638413 |
import copy
import logging
import numpy as np
import torch
from detectron2.data import detection_utils as utils
from detectron2.data import transforms as T
__all__ = ["DetrDatasetMapper"]
def build_transform_gen(cfg, is_train):
if is_train:
min_size = cfg.INPUT.MIN_SIZE_TRAIN
max_size = cfg.... | true | true |
1c321e9f6ae93086f8db8edb4eaff14d6eb11ecc | 523 | py | Python | odoo-13.0/addons/website_event_sale/__manifest__.py | VaibhavBhujade/Blockchain-ERP-interoperability | b5190a037fb6615386f7cbad024d51b0abd4ba03 | [
"MIT"
] | null | null | null | odoo-13.0/addons/website_event_sale/__manifest__.py | VaibhavBhujade/Blockchain-ERP-interoperability | b5190a037fb6615386f7cbad024d51b0abd4ba03 | [
"MIT"
] | null | null | null | odoo-13.0/addons/website_event_sale/__manifest__.py | VaibhavBhujade/Blockchain-ERP-interoperability | b5190a037fb6615386f7cbad024d51b0abd4ba03 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
{
'name': "Online Event Ticketing",
'category': 'Website/Website',
'summary': "Sell event tickets online",
'description': """
Sell event tickets through eCommerce app.
""",
'depends': ['website_event', 'event_sale', 'website_sale'],
'data': [
'data/event_data... | 26.15 | 63 | 0.600382 |
{
'name': "Online Event Ticketing",
'category': 'Website/Website',
'summary': "Sell event tickets online",
'description': """
Sell event tickets through eCommerce app.
""",
'depends': ['website_event', 'event_sale', 'website_sale'],
'data': [
'data/event_data.xml',
'views/e... | true | true |
1c321f14440a1f1ca4249e457c5620d7f377ce0f | 13,615 | py | Python | cvat/apps/tf_annotation/views.py | lravindr/cvat | b025acea43fbb55c7ea7eac7b12007f0eb6d3f45 | [
"MIT"
] | 1 | 2020-07-19T08:15:20.000Z | 2020-07-19T08:15:20.000Z | cvat/apps/tf_annotation/views.py | lravindr/cvat | b025acea43fbb55c7ea7eac7b12007f0eb6d3f45 | [
"MIT"
] | 17 | 2020-11-13T18:58:43.000Z | 2022-02-27T08:06:04.000Z | cvat/apps/tf_annotation/views.py | lravindr/cvat | b025acea43fbb55c7ea7eac7b12007f0eb6d3f45 | [
"MIT"
] | 4 | 2021-09-03T13:13:40.000Z | 2022-03-04T18:19:38.000Z |
# Copyright (C) 2018-2020 Intel Corporation
#
# SPDX-License-Identifier: MIT
from django.http import HttpResponse, JsonResponse, HttpResponseBadRequest
from rest_framework.decorators import api_view
from rules.contrib.views import permission_required, objectgetter
from cvat.apps.authentication.decorators import login... | 39.236311 | 154 | 0.593537 |
from django.http import HttpResponse, JsonResponse, HttpResponseBadRequest
from rest_framework.decorators import api_view
from rules.contrib.views import permission_required, objectgetter
from cvat.apps.authentication.decorators import login_required
from cvat.apps.dataset_manager.task import put_task_data
from cv... | true | true |
1c321f1f4f98f8c5bb24f8b5a4a96a2bb27fd616 | 10,137 | py | Python | hammers/scripts/maintenance_reservation.py | ChameleonCloud/bag-o-hammers | 0faaf9b21aceb155dc7da2ea92cf77af815c11e7 | [
"Apache-2.0"
] | null | null | null | hammers/scripts/maintenance_reservation.py | ChameleonCloud/bag-o-hammers | 0faaf9b21aceb155dc7da2ea92cf77af815c11e7 | [
"Apache-2.0"
] | 8 | 2018-05-24T01:07:27.000Z | 2021-09-01T18:02:29.000Z | hammers/scripts/maintenance_reservation.py | ChameleonCloud/bag-o-hammers | 0faaf9b21aceb155dc7da2ea92cf77af815c11e7 | [
"Apache-2.0"
] | 2 | 2016-12-07T01:12:41.000Z | 2018-08-17T16:57:54.000Z | import datetime
import logging
import os
import sys
import traceback
from dateutil import tz
from blazarclient import client as blazar_client
from ironicclient import client as ironic_client
from keystoneauth1 import adapter, loading, session
from keystoneauth1.identity import v3
from hammers import MySqlArgs
from h... | 38.988462 | 125 | 0.61606 | import datetime
import logging
import os
import sys
import traceback
from dateutil import tz
from blazarclient import client as blazar_client
from ironicclient import client as ironic_client
from keystoneauth1 import adapter, loading, session
from keystoneauth1.identity import v3
from hammers import MySqlArgs
from h... | true | true |
1c321f551a7a9daf6e1a0849a0b6f9fcf2550348 | 25,940 | py | Python | core/platform/auth/firebase_auth_services.py | TheoLipeles/oppia | cd0bb873e08fa716014f3d1480fbbfee95b89121 | [
"Apache-2.0"
] | null | null | null | core/platform/auth/firebase_auth_services.py | TheoLipeles/oppia | cd0bb873e08fa716014f3d1480fbbfee95b89121 | [
"Apache-2.0"
] | null | null | null | core/platform/auth/firebase_auth_services.py | TheoLipeles/oppia | cd0bb873e08fa716014f3d1480fbbfee95b89121 | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
#
# Copyright 2020 The Oppia 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 requi... | 40.404984 | 80 | 0.712452 |
from __future__ import absolute_import
from __future__ import unicode_literals
import logging
from constants import constants
from core.domain import auth_domain
from core.platform import models
import feconf
import python_utils
import firebase_admin
from firebase_admin import auth as firebase_a... | true | true |
1c321f97ee430e4a3ee9e112f6ace089525c4b15 | 1,187 | py | Python | django_kmatch/fields.py | wesleykendall/django-kmatch | 0ca5d8465461210aa98fd3fb9afd2ec3838a4f9b | [
"MIT"
] | null | null | null | django_kmatch/fields.py | wesleykendall/django-kmatch | 0ca5d8465461210aa98fd3fb9afd2ec3838a4f9b | [
"MIT"
] | 2 | 2015-03-27T18:10:34.000Z | 2015-03-30T17:39:44.000Z | django_kmatch/fields.py | wesleykendall/django-kmatch | 0ca5d8465461210aa98fd3fb9afd2ec3838a4f9b | [
"MIT"
] | 5 | 2015-03-27T17:49:20.000Z | 2016-11-28T22:29:54.000Z | from jsonfield import JSONField
from kmatch import K
class KField(JSONField):
"""Stores a kmatch pattern and returns a compiled K object.
The KField field stores a kmatch pattern in a JSONField. The pattern is compiled and returned as
a K object when accessing the field. Invalid kmatch patterns cannot be... | 39.566667 | 103 | 0.680708 | from jsonfield import JSONField
from kmatch import K
class KField(JSONField):
description = 'A kmatch pattern'
def pre_init(self, value, obj):
value = super(KField, self).pre_init(value, obj)
return K(value) if not isinstance(value, K) and value is not None else value
def get_db_prep_val... | true | true |
1c322128e9fb297f1e65f06a7d4a1823b754ab52 | 9,854 | py | Python | tests/python/contrib/test_hexagon/test_launcher.py | HeRCLab/tvm | bd14a4d36e0d364ef9bd34b2ee96cc09ce64d4b3 | [
"Apache-2.0"
] | null | null | null | tests/python/contrib/test_hexagon/test_launcher.py | HeRCLab/tvm | bd14a4d36e0d364ef9bd34b2ee96cc09ce64d4b3 | [
"Apache-2.0"
] | null | null | null | tests/python/contrib/test_hexagon/test_launcher.py | HeRCLab/tvm | bd14a4d36e0d364ef9bd34b2ee96cc09ce64d4b3 | [
"Apache-2.0"
] | 1 | 2022-03-02T16:24:54.000Z | 2022-03-02T16:24:54.000Z | # 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... | 36.496296 | 98 | 0.667242 |
import sys
import pytest
import numpy as np
import logging
import tvm.testing
from tvm import te
from tvm import relay
from tvm.relay.backend import Executor, Runtime
from tvm.contrib import utils, ndk
from tvm.contrib.hexagon.build import HexagonLauncher
import tvm.contrib.hexagon.hexagon as hexagon
... | true | true |
1c32213da081ce5136d5611d545b3075a72813fe | 358 | py | Python | abc/abc130/abc130d.py | c-yan/atcoder | 940e49d576e6a2d734288fadaf368e486480a948 | [
"MIT"
] | 1 | 2019-08-21T00:49:34.000Z | 2019-08-21T00:49:34.000Z | abc/abc130/abc130d.py | c-yan/atcoder | 940e49d576e6a2d734288fadaf368e486480a948 | [
"MIT"
] | null | null | null | abc/abc130/abc130d.py | c-yan/atcoder | 940e49d576e6a2d734288fadaf368e486480a948 | [
"MIT"
] | null | null | null | # しゃくとり法
N, K = map(int, input().split())
a = list(map(int, input().split()))
result = 0
i = 0
j = 0
v = 0
while True:
v += a[j]
if v < K:
j += 1
else:
result += N - j
v -= a[i]
if j > i:
v -= a[j]
i += 1
if j < i:
j += 1
if j == N... | 14.916667 | 35 | 0.351955 |
N, K = map(int, input().split())
a = list(map(int, input().split()))
result = 0
i = 0
j = 0
v = 0
while True:
v += a[j]
if v < K:
j += 1
else:
result += N - j
v -= a[i]
if j > i:
v -= a[j]
i += 1
if j < i:
j += 1
if j == N:
... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.