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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f7320db42cd644873d257e35043851fb92abef28 | 62,440 | py | Python | lib/wallet.py | Skirmant/electrum-trump | 9b0d4e6dd3317900f3d81dec8924f07ffa60e8b5 | [
"MIT"
] | null | null | null | lib/wallet.py | Skirmant/electrum-trump | 9b0d4e6dd3317900f3d81dec8924f07ffa60e8b5 | [
"MIT"
] | null | null | null | lib/wallet.py | Skirmant/electrum-trump | 9b0d4e6dd3317900f3d81dec8924f07ffa60e8b5 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
#
# Electrum - lightweight Bitcoin client
# Copyright (C) 2015 Thomas Voegtlin
#
# 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... | 35.947035 | 126 | 0.575801 |
import os
import hashlib
import ast
import threading
import random
import time
import json
import copy
import re
import stat
from functools import partial
from collections import namedtuple, defaultdict
from i18n import _
from util import NotEnoughFunds, PrintError, UserCancelled, profiler
f... | true | true |
f7320dd67249784102fd2dc4e3484ed2393a91cc | 1,593 | py | Python | kf_cavatica/files.py | kids-first/kf-cavatica-python-tools | 5f821511685dc63df8785a54c1ac31caebc2cba2 | [
"Apache-2.0"
] | null | null | null | kf_cavatica/files.py | kids-first/kf-cavatica-python-tools | 5f821511685dc63df8785a54c1ac31caebc2cba2 | [
"Apache-2.0"
] | 10 | 2021-03-30T13:16:34.000Z | 2021-08-10T19:17:29.000Z | kf_cavatica/files.py | kids-first/kf-cavatica-python-tools | 5f821511685dc63df8785a54c1ac31caebc2cba2 | [
"Apache-2.0"
] | 1 | 2022-02-04T04:13:48.000Z | 2022-02-04T04:13:48.000Z | import sevenbridges as sbg
from pathlib import Path
# generate the list of files
def list_files_recursively(
api,
query,
parent,
files=[],
folder_name="",
):
"""List all the files in a project.
:param api: API object generated by sevenbridges.Api()
:type api: Sevenbridges API Object
... | 31.235294 | 77 | 0.638418 | import sevenbridges as sbg
from pathlib import Path
def list_files_recursively(
api,
query,
parent,
files=[],
folder_name="",
):
if isinstance(parent, sbg.models.project.Project):
parent_id = parent.root_folder
elif isinstance(parent, sbg.models.file.File):
parent_id ... | true | true |
f7320eb4b502e470801de71bcd1debc943db995d | 1,075 | py | Python | alfred_wrapper.py | fur6y/timely-alfred-workflow | 4ddfd2bd2f37becc78c45c6c07664d44fec5ccde | [
"MIT"
] | 1 | 2018-10-24T20:09:46.000Z | 2018-10-24T20:09:46.000Z | alfred_wrapper.py | fabianfetting/timely-alfred-workflow | 4ddfd2bd2f37becc78c45c6c07664d44fec5ccde | [
"MIT"
] | null | null | null | alfred_wrapper.py | fabianfetting/timely-alfred-workflow | 4ddfd2bd2f37becc78c45c6c07664d44fec5ccde | [
"MIT"
] | null | null | null | import subprocess
import sys
import json
def print_time(t):
output = {
'items': [
{
'uid': 'result',
'type': 'file',
'title': t,
'subtitle': sys.argv[1],
'arg': sys.argv[1],
'icon': {
... | 20.673077 | 68 | 0.413953 | import subprocess
import sys
import json
def print_time(t):
output = {
'items': [
{
'uid': 'result',
'type': 'file',
'title': t,
'subtitle': sys.argv[1],
'arg': sys.argv[1],
'icon': {
... | true | true |
f7320f0efd80d6927395a59cc57e82be5509efc8 | 594 | py | Python | Vivy/setup.py | yametetomete/EncodeScripts | 925c175b56cdbe1251cf7978620808b01cfca4e5 | [
"MIT"
] | 3 | 2020-08-01T09:39:37.000Z | 2021-12-05T07:31:34.000Z | Vivy/setup.py | yametetomete/EncodeScripts | 925c175b56cdbe1251cf7978620808b01cfca4e5 | [
"MIT"
] | null | null | null | Vivy/setup.py | yametetomete/EncodeScripts | 925c175b56cdbe1251cf7978620808b01cfca4e5 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import setuptools
name = "vivy_common"
version = "0.0.0"
release = "0.0.0"
setuptools.setup(
name=name,
version=release,
author="louis",
author_email="louis@poweris.moe",
description="yametetomete vivy common module",
packages=["vivy_common"],
classifiers=[
... | 22.846154 | 74 | 0.619529 |
import setuptools
name = "vivy_common"
version = "0.0.0"
release = "0.0.0"
setuptools.setup(
name=name,
version=release,
author="louis",
author_email="louis@poweris.moe",
description="yametetomete vivy common module",
packages=["vivy_common"],
classifiers=[
"Programming Language ... | true | true |
f73210129a2c3754a07a4faf0ce894d3104d954c | 5,446 | py | Python | losses.py | koba35/retinanet | 99820cde438a2fc14e38973437766de6fe6a94a3 | [
"Apache-2.0"
] | null | null | null | losses.py | koba35/retinanet | 99820cde438a2fc14e38973437766de6fe6a94a3 | [
"Apache-2.0"
] | null | null | null | losses.py | koba35/retinanet | 99820cde438a2fc14e38973437766de6fe6a94a3 | [
"Apache-2.0"
] | null | null | null | import numpy as np
import torch
import torch.nn as nn
def calc_iou(a, b):
area = (b[:, 2] - b[:, 0]) * (b[:, 3] - b[:, 1])
iw = torch.min(torch.unsqueeze(a[:, 2], dim=1), b[:, 2]) - torch.max(torch.unsqueeze(a[:, 0], 1), b[:, 0])
ih = torch.min(torch.unsqueeze(a[:, 3], dim=1), b[:, 3]) - torch.max(torch.... | 38.9 | 126 | 0.57051 | import numpy as np
import torch
import torch.nn as nn
def calc_iou(a, b):
area = (b[:, 2] - b[:, 0]) * (b[:, 3] - b[:, 1])
iw = torch.min(torch.unsqueeze(a[:, 2], dim=1), b[:, 2]) - torch.max(torch.unsqueeze(a[:, 0], 1), b[:, 0])
ih = torch.min(torch.unsqueeze(a[:, 3], dim=1), b[:, 3]) - torch.max(torch.... | true | true |
f73211257b07190070fdd8e364260ba0efeb2273 | 922 | py | Python | test/testCommentOptions.py | apiiro/lizard | 083c3a023559ddc9be44581a207bf5e16ce7e16b | [
"MIT"
] | null | null | null | test/testCommentOptions.py | apiiro/lizard | 083c3a023559ddc9be44581a207bf5e16ce7e16b | [
"MIT"
] | null | null | null | test/testCommentOptions.py | apiiro/lizard | 083c3a023559ddc9be44581a207bf5e16ce7e16b | [
"MIT"
] | null | null | null | import unittest
from .testHelpers import get_cpp_function_list
class TestCommentOptions(unittest.TestCase):
def test_function_with_comment_option_should_be_forgiven(self):
function_list = get_cpp_function_list("void foo(){/* #lizard forgives*/}")
self.assertEqual(0, len(function_list))
def ... | 40.086957 | 94 | 0.74295 | import unittest
from .testHelpers import get_cpp_function_list
class TestCommentOptions(unittest.TestCase):
def test_function_with_comment_option_should_be_forgiven(self):
function_list = get_cpp_function_list("void foo(){/* #lizard forgives*/}")
self.assertEqual(0, len(function_list))
def ... | true | true |
f7321235fc8b743ae4d4140233e088137b8036ee | 14,754 | py | Python | contextual_lenses/train_utils.py | googleinterns/protein-embedding-retrieval | be198b5f95d7b97a06ed04a6b131fc10573365fb | [
"Apache-2.0"
] | 31 | 2020-10-29T13:59:18.000Z | 2021-09-13T08:37:31.000Z | contextual_lenses/train_utils.py | amirshane/protein-embedding-retrieval | 388563d3206e1486fe5dbcfd8326be6f1185a00e | [
"Apache-2.0"
] | 7 | 2020-06-01T20:42:12.000Z | 2021-05-31T10:48:10.000Z | contextual_lenses/train_utils.py | amirshane/protein-embedding-retrieval | 388563d3206e1486fe5dbcfd8326be6f1185a00e | [
"Apache-2.0"
] | 7 | 2020-05-18T21:07:23.000Z | 2020-11-23T11:46:23.000Z | """Train utils
General tools for instantiating and training models.
"""
import flax
from flax import nn
from flax import optim
from flax.training import checkpoints
from flax.training import common_utils
import jax
from jax import random
import jax.nn
import jax.numpy as jnp
from jax.config import config
config.enab... | 34.232019 | 89 | 0.560729 |
import flax
from flax import nn
from flax import optim
from flax.training import checkpoints
from flax.training import common_utils
import jax
from jax import random
import jax.nn
import jax.numpy as jnp
from jax.config import config
config.enable_omnistaging()
import tensorflow as tf
import numpy as np
import fun... | true | true |
f73212a4f983365554182ac75a527d12007f372c | 130 | py | Python | DappurMake/core/__init__.py | DapperX/DappurMake | 48a9559e891890a3b797fdf8f51cc17d6daf56d3 | [
"BSD-2-Clause"
] | null | null | null | DappurMake/core/__init__.py | DapperX/DappurMake | 48a9559e891890a3b797fdf8f51cc17d6daf56d3 | [
"BSD-2-Clause"
] | null | null | null | DappurMake/core/__init__.py | DapperX/DappurMake | 48a9559e891890a3b797fdf8f51cc17d6daf56d3 | [
"BSD-2-Clause"
] | null | null | null | from .variable import variable
from .make import make
from .rule import rule
__all__ = ["variable", "make", "rule"]
print(dir()) | 18.571429 | 38 | 0.715385 | from .variable import variable
from .make import make
from .rule import rule
__all__ = ["variable", "make", "rule"]
print(dir()) | true | true |
f73212cf0f4772ea728789c0c196c35ce4427f28 | 6,015 | py | Python | tests/test_30_store.py | arista-netdevops-community/runAM | c461b0fada8ddb22ed1607eb5773cd6aef43dbf9 | [
"BSD-3-Clause"
] | null | null | null | tests/test_30_store.py | arista-netdevops-community/runAM | c461b0fada8ddb22ed1607eb5773cd6aef43dbf9 | [
"BSD-3-Clause"
] | 3 | 2021-01-15T08:06:41.000Z | 2021-02-17T13:23:11.000Z | tests/test_30_store.py | arista-netdevops-community/runAM | c461b0fada8ddb22ed1607eb5773cd6aef43dbf9 | [
"BSD-3-Clause"
] | null | null | null | import pytest
import os
import sys
import runAM
import json
# insert project directory to $PATH for imports to work
test_file = os.path.realpath(__file__)
test_dir = os.path.dirname(test_file)
project_dir = os.path.dirname(test_dir)
sys.path.append(project_dir)
bookstore_json = {"store": {
"book": [
{
... | 33.232044 | 103 | 0.556608 | import pytest
import os
import sys
import runAM
import json
test_file = os.path.realpath(__file__)
test_dir = os.path.dirname(test_file)
project_dir = os.path.dirname(test_dir)
sys.path.append(project_dir)
bookstore_json = {"store": {
"book": [
{
"category": "reference",
"author":... | true | true |
f732135ed8fd5cb28d543d0c92d4201d25d4de6a | 5,547 | py | Python | algorand/TmplSig.py | cryptorites-scotti/wormhole | 2e220a6f76a1ec03364fa2fac2e571b9824744f8 | [
"Apache-2.0"
] | null | null | null | algorand/TmplSig.py | cryptorites-scotti/wormhole | 2e220a6f76a1ec03364fa2fac2e571b9824744f8 | [
"Apache-2.0"
] | 36 | 2022-02-21T13:31:14.000Z | 2022-03-28T04:47:23.000Z | algorand/TmplSig.py | cryptorites-scotti/wormhole | 2e220a6f76a1ec03364fa2fac2e571b9824744f8 | [
"Apache-2.0"
] | null | null | null | from time import time, sleep
from typing import List, Tuple, Dict, Any, Optional, Union
from base64 import b64decode
import base64
import random
import hashlib
import uuid
import sys
import json
import uvarint
import pprint
from local_blob import LocalBlob
from algosdk.v2client.algod import AlgodClient
from algosdk.k... | 38.520833 | 149 | 0.589508 | from time import time, sleep
from typing import List, Tuple, Dict, Any, Optional, Union
from base64 import b64decode
import base64
import random
import hashlib
import uuid
import sys
import json
import uvarint
import pprint
from local_blob import LocalBlob
from algosdk.v2client.algod import AlgodClient
from algosdk.k... | true | true |
f7321391696b0402752b89e18571a7b90492e6b0 | 1,713 | py | Python | date_sniff/tests.py | nanvel/date-sniff | 5a142861656b985fdbb9029cdf4a541455e16b9a | [
"MIT"
] | null | null | null | date_sniff/tests.py | nanvel/date-sniff | 5a142861656b985fdbb9029cdf4a541455e16b9a | [
"MIT"
] | null | null | null | date_sniff/tests.py | nanvel/date-sniff | 5a142861656b985fdbb9029cdf4a541455e16b9a | [
"MIT"
] | null | null | null | from date_sniff.sniffer import DateSniffer
def test_years_separation():
sniffer = DateSniffer(year=2019)
assert sniffer.sniff('2019') == {'2019': []}
assert sniffer.sniff('prefix 2019 and long text') == {'prefix 2019 and long text': []}
res = {'prefix 2019 and long text another 2019': []}
assert s... | 39.837209 | 114 | 0.663164 | from date_sniff.sniffer import DateSniffer
def test_years_separation():
sniffer = DateSniffer(year=2019)
assert sniffer.sniff('2019') == {'2019': []}
assert sniffer.sniff('prefix 2019 and long text') == {'prefix 2019 and long text': []}
res = {'prefix 2019 and long text another 2019': []}
assert s... | true | true |
f73216568bc0065366c2d6d33f8c92b81662b090 | 6,286 | py | Python | lte/gateway/python/scripts/config_stateless_agw.py | saurabhsoni88/magma | 4236c9d8edb7bd203707ff7e861b1f7c12fb84c7 | [
"BSD-3-Clause"
] | null | null | null | lte/gateway/python/scripts/config_stateless_agw.py | saurabhsoni88/magma | 4236c9d8edb7bd203707ff7e861b1f7c12fb84c7 | [
"BSD-3-Clause"
] | null | null | null | lte/gateway/python/scripts/config_stateless_agw.py | saurabhsoni88/magma | 4236c9d8edb7bd203707ff7e861b1f7c12fb84c7 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python3
"""
Copyright 2020 The Magma Authors.
This source code is licensed under the BSD-style license found in the
LICENSE file in the root directory of this source tree.
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BAS... | 28.703196 | 77 | 0.685173 |
import argparse
import os
import subprocess
import sys
import shlex
import time
from enum import Enum
from magma.configuration.service_configs import (
load_override_config,
load_service_config,
save_override_config,
)
return_codes = Enum(
"return_codes", "STATELESS STATEFUL CORRUPT INVALID", star... | true | true |
f732168707cd1e2c13f9b34495a0213b31ec4c9d | 2,164 | py | Python | flow/benchmarks/rllib/ars_runner.py | berkeleyflow/flow | bed5ec959aaf0eaa8dbc7fa03f0c3fd3f0184b80 | [
"MIT"
] | 16 | 2018-05-25T06:30:28.000Z | 2020-08-08T00:03:47.000Z | flow/benchmarks/rllib/ars_runner.py | berkeleyflow/flow | bed5ec959aaf0eaa8dbc7fa03f0c3fd3f0184b80 | [
"MIT"
] | 46 | 2018-05-22T21:32:55.000Z | 2019-06-12T13:10:02.000Z | flow/benchmarks/rllib/ars_runner.py | berkeleyflow/flow | bed5ec959aaf0eaa8dbc7fa03f0c3fd3f0184b80 | [
"MIT"
] | 6 | 2018-06-22T14:59:14.000Z | 2019-08-29T06:00:34.000Z | """
Runner script for environments located in flow/benchmarks.
The environment file can be modified in the imports to change the environment
this runner script is executed on. Furthermore, the rllib specific algorithm/
parameters can be specified here once and used on multiple environments.
"""
import json
import ray... | 30.914286 | 78 | 0.657116 | import json
import ray
import ray.rllib.ars as ars
from ray.tune import run_experiments, grid_search
from ray.tune.registry import register_env
from flow.utils.registry import make_create_env
from flow.utils.rllib import FlowParamsEncoder
from flow.benchmarks.figureeight2 import flow_params
N_ROLLOUTS = 25
PARAL... | true | true |
f732169581c39351b8a2047a34b4fbc17e58829f | 1,325 | py | Python | test/integration/modules/test_sfp_comodo.py | khiemtq-cyber/spiderfoot | 66e671918853b0334931fd2fbabad0096d506726 | [
"MIT"
] | null | null | null | test/integration/modules/test_sfp_comodo.py | khiemtq-cyber/spiderfoot | 66e671918853b0334931fd2fbabad0096d506726 | [
"MIT"
] | null | null | null | test/integration/modules/test_sfp_comodo.py | khiemtq-cyber/spiderfoot | 66e671918853b0334931fd2fbabad0096d506726 | [
"MIT"
] | null | null | null | import pytest
import unittest
from modules.sfp_comodo import sfp_comodo
from sflib import SpiderFoot
from spiderfoot import SpiderFootEvent, SpiderFootTarget
@pytest.mark.usefixtures
class TestModuleIntegrationcomodo(unittest.TestCase):
def test_handleEvent_event_data_safe_internet_name_not_blocked_should_not_r... | 30.813953 | 97 | 0.703396 | import pytest
import unittest
from modules.sfp_comodo import sfp_comodo
from sflib import SpiderFoot
from spiderfoot import SpiderFootEvent, SpiderFootTarget
@pytest.mark.usefixtures
class TestModuleIntegrationcomodo(unittest.TestCase):
def test_handleEvent_event_data_safe_internet_name_not_blocked_should_not_r... | true | true |
f7321779e9a3a21168aeabf948fff5b7c3a72cf1 | 4,197 | py | Python | python/ray/serve/tests/test_router.py | yuanchi2807/ray | cf512254bb4bcd71ff1818dff5c868ab10c5f620 | [
"Apache-2.0"
] | 1 | 2021-09-20T15:45:59.000Z | 2021-09-20T15:45:59.000Z | python/ray/serve/tests/test_router.py | yuanchi2807/ray | cf512254bb4bcd71ff1818dff5c868ab10c5f620 | [
"Apache-2.0"
] | 53 | 2021-10-06T20:08:04.000Z | 2022-03-21T20:17:25.000Z | python/ray/serve/tests/test_router.py | yuanchi2807/ray | cf512254bb4bcd71ff1818dff5c868ab10c5f620 | [
"Apache-2.0"
] | 1 | 2022-03-27T09:01:59.000Z | 2022-03-27T09:01:59.000Z | """
Unit tests for the router class. Please don't add any test that will involve
controller or the actual replica wrapper, use mock if necessary.
"""
import asyncio
import pytest
import ray
from ray.serve.common import RunningReplicaInfo
from ray.serve.router import Query, ReplicaSet, RequestMetadata
from ray._privat... | 29.145833 | 81 | 0.65928 | import asyncio
import pytest
import ray
from ray.serve.common import RunningReplicaInfo
from ray.serve.router import Query, ReplicaSet, RequestMetadata
from ray._private.test_utils import SignalActor
pytestmark = pytest.mark.asyncio
@pytest.fixture
def ray_instance():
ray.init(num... | true | true |
f73217e8aa5f2356b52094b22ac6b982820b535f | 1,605 | py | Python | module-3/app/service/mythicalMysfitsService.py | kpiljoong/aws-modern-application-workshop | 9eb05451ecb28d01fbcf875d1fd9432c4e3aa8d5 | [
"Apache-2.0"
] | 17 | 2019-11-05T05:30:16.000Z | 2021-11-25T01:20:16.000Z | module-3/app/service/mythicalMysfitsService.py | kpiljoong/aws-modern-application-workshop | 9eb05451ecb28d01fbcf875d1fd9432c4e3aa8d5 | [
"Apache-2.0"
] | null | null | null | module-3/app/service/mythicalMysfitsService.py | kpiljoong/aws-modern-application-workshop | 9eb05451ecb28d01fbcf875d1fd9432c4e3aa8d5 | [
"Apache-2.0"
] | 17 | 2019-11-04T12:27:17.000Z | 2021-12-13T05:41:12.000Z | from flask import Flask, jsonify, json, Response, request
from flask_cors import CORS
import mysfitsTableClient
# A very basic API created using Flask that has two possible routes for requests.
app = Flask(__name__)
app.config['JSONIFY_PRETTYPRINT_REGULAR'] = False
CORS(app)
# The service basepath has a short respon... | 35.666667 | 94 | 0.720249 | from flask import Flask, jsonify, json, Response, request
from flask_cors import CORS
import mysfitsTableClient
app = Flask(__name__)
app.config['JSONIFY_PRETTYPRINT_REGULAR'] = False
CORS(app)
@app.route("/")
def healthCheckResponse():
return jsonify({"message" : "Nothing here, used for health check. Try /my... | true | true |
f73218bda9737f9a09039fb3e086c4956b2a87d2 | 1,903 | py | Python | get_url.py | tracysmith/RGAPepPipe | f334c2a58f41d0b38c0d5884a430e24a21788304 | [
"MIT"
] | 3 | 2017-08-06T18:01:43.000Z | 2018-06-20T04:54:49.000Z | get_url.py | tracysmith/RGAPepPipe | f334c2a58f41d0b38c0d5884a430e24a21788304 | [
"MIT"
] | 28 | 2015-01-05T18:00:48.000Z | 2016-09-06T18:30:29.000Z | otherScripts/get_url.py | pepperell-lab/RGAPepPipe | 0122dca9aca75756ad412599c7922bf08edc7f6d | [
"MIT"
] | 2 | 2017-07-27T14:07:51.000Z | 2018-07-25T15:00:05.000Z | #!/usr/bin/python
import sys, argparse, os
from subprocess import call
from multiprocessing.dummy import Pool as ThreadPool
###################################################################
#This is a phython script to download fastq files from ENA
#You can use this directly with the enaFileParser output
##########... | 31.716667 | 115 | 0.636889 |
import sys, argparse, os
from subprocess import call
from multiprocessing.dummy import Pool as ThreadPool
| true | true |
f73218c79517c1e795e724cc6b80bf59bad88d37 | 1,586 | py | Python | tempest/api/compute/servers/test_virtual_interfaces_negative.py | BeenzSyed/tempest | 7a64ee1216d844f6b99928b53f5c665b84cb8719 | [
"Apache-2.0"
] | null | null | null | tempest/api/compute/servers/test_virtual_interfaces_negative.py | BeenzSyed/tempest | 7a64ee1216d844f6b99928b53f5c665b84cb8719 | [
"Apache-2.0"
] | null | null | null | tempest/api/compute/servers/test_virtual_interfaces_negative.py | BeenzSyed/tempest | 7a64ee1216d844f6b99928b53f5c665b84cb8719 | [
"Apache-2.0"
] | null | null | null | # Copyright 2013 OpenStack Foundation
# 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 requ... | 35.244444 | 78 | 0.716267 |
import uuid
from tempest.api.compute import base
from tempest import exceptions
from tempest import test
class VirtualInterfacesNegativeTestJSON(base.BaseV2ComputeTest):
_interface = 'json'
@classmethod
def setUpClass(cls):
cls.set_network_resources()
super(Virtua... | true | true |
f7321a754102fe3085336a9211af18b93a46aa05 | 49,633 | py | Python | geetools/ui/ipymap.py | guy1ziv2/gee_tools | 22a0fabe0be4f0a206a0c09e28638562bb36055f | [
"MIT"
] | null | null | null | geetools/ui/ipymap.py | guy1ziv2/gee_tools | 22a0fabe0be4f0a206a0c09e28638562bb36055f | [
"MIT"
] | null | null | null | geetools/ui/ipymap.py | guy1ziv2/gee_tools | 22a0fabe0be4f0a206a0c09e28638562bb36055f | [
"MIT"
] | null | null | null | # coding=utf-8
""" This module is designed to use ONLY in the Jupyter Notebook. It is
inspired on Tyler Erickson's contribution on
https://github.com/gee-community/ee-jupyter-contrib/blob/master/examples/getting-started/display-interactive-map.ipynb
"""
import ipyleaflet
from ipywidgets import HTML, Tab, Accordion, HB... | 39.611333 | 118 | 0.499829 |
import ipyleaflet
from ipywidgets import HTML, Tab, Accordion, HBox, SelectMultiple, Select,\
Button, VBox, RadioButtons, Dropdown, Layout, \
FloatRangeSlider
from IPython.display import display
from traitlets import Dict, observe
import ee
if not ee.data._initialized: ee.... | true | true |
f7321a82ba7c73b42aae51ba6c7f94a79eb940ad | 7,521 | py | Python | src/scanoss/cyclonedx.py | tardyp/scanoss.py | 88ad27e36dd00f420fed08a240f5bbd62169778c | [
"MIT"
] | 8 | 2021-08-19T12:35:58.000Z | 2022-03-23T02:44:36.000Z | src/scanoss/cyclonedx.py | tardyp/scanoss.py | 88ad27e36dd00f420fed08a240f5bbd62169778c | [
"MIT"
] | 4 | 2021-10-31T10:21:11.000Z | 2022-03-24T15:24:54.000Z | src/scanoss/cyclonedx.py | tardyp/scanoss.py | 88ad27e36dd00f420fed08a240f5bbd62169778c | [
"MIT"
] | 1 | 2021-08-19T12:36:02.000Z | 2021-08-19T12:36:02.000Z | """
SPDX-License-Identifier: MIT
Copyright (c) 2021, SCANOSS
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, c... | 36.867647 | 106 | 0.550725 | import json
import os.path
import sys
import hashlib
import time
class CycloneDx:
def __init__(self, debug: bool = False, output_file: str = None):
self.output_file = output_file
self.debug = debug
@staticmethod
def print_stderr(*args, **kwargs):
print(*args, file=sys.stderr, **kw... | true | true |
f7321afb7e4193fbb1ac06c566dac390abb97b12 | 8,689 | py | Python | keras/applications/vgg16.py | asanoboy/keras | e467ee5a1a00afdfa1cb7f5508fdbfd2c5eab1e5 | [
"MIT"
] | 7 | 2017-06-02T19:07:36.000Z | 2021-07-23T21:01:44.000Z | keras/applications/vgg16.py | EnjoyLifeFund/Debian_py36_packages | 1985d4c73fabd5f08f54b922e73a9306e09c77a5 | [
"BSD-3-Clause",
"BSD-2-Clause",
"MIT"
] | null | null | null | keras/applications/vgg16.py | EnjoyLifeFund/Debian_py36_packages | 1985d4c73fabd5f08f54b922e73a9306e09c77a5 | [
"BSD-3-Clause",
"BSD-2-Clause",
"MIT"
] | 4 | 2017-05-27T02:37:54.000Z | 2017-08-05T16:01:31.000Z | # -*- coding: utf-8 -*-
"""VGG16 model for Keras.
# Reference
- [Very Deep Convolutional Networks for Large-Scale Image Recognition](https://arxiv.org/abs/1409.1556)
"""
from __future__ import print_function
from __future__ import absolute_import
import os
import warnings
from ..models import Model
from ..layers i... | 43.663317 | 145 | 0.605478 |
from __future__ import print_function
from __future__ import absolute_import
import os
import warnings
from ..models import Model
from ..layers import Flatten
from ..layers import Dense
from ..layers import Input
from ..layers import Conv2D
from ..layers import MaxPooling2D
from ..layers import GlobalAveragePooling2... | true | true |
f7321b2a7c56ae6bf342d7170057105d25b67432 | 166 | py | Python | demo/demo1.py | sharangdhar/Testit | e0be60933144beb20a728df807e7c60f77917a2c | [
"MIT"
] | null | null | null | demo/demo1.py | sharangdhar/Testit | e0be60933144beb20a728df807e7c60f77917a2c | [
"MIT"
] | null | null | null | demo/demo1.py | sharangdhar/Testit | e0be60933144beb20a728df807e7c60f77917a2c | [
"MIT"
] | null | null | null | # true if n is prime
def isPrime(n):
if n <= 1 or int(n) != n:
return False
for x in range(2, int(n*.5)+1):
if n%x == 0:
return False
return True
| 18.444444 | 33 | 0.548193 |
def isPrime(n):
if n <= 1 or int(n) != n:
return False
for x in range(2, int(n*.5)+1):
if n%x == 0:
return False
return True
| true | true |
f7321b5ba3eb4d439f4753d430002c7a1fb1a908 | 216 | py | Python | Codechef/helping_chef.py | Ritz2626/Hacktoberfest-2 | a2c48a23c62532227b0b4cd88783dcddaca98519 | [
"MIT"
] | null | null | null | Codechef/helping_chef.py | Ritz2626/Hacktoberfest-2 | a2c48a23c62532227b0b4cd88783dcddaca98519 | [
"MIT"
] | null | null | null | Codechef/helping_chef.py | Ritz2626/Hacktoberfest-2 | a2c48a23c62532227b0b4cd88783dcddaca98519 | [
"MIT"
] | null | null | null | try:
t=int(input(''))
while t>0:
n=int(input(''))
if n<10:
print('What an obedient servant you are!')
else:
print('-1')
t=t-1
except Exception as e:
pass
| 18 | 51 | 0.462963 | try:
t=int(input(''))
while t>0:
n=int(input(''))
if n<10:
print('What an obedient servant you are!')
else:
print('-1')
t=t-1
except Exception as e:
pass
| true | true |
f7321c7afea8a5dc0c9d73994a9d89d4dc165398 | 2,158 | py | Python | phonemeconversion.py | AustinCasteel/pocketsphinx_kws | ae0067e9a728e7e48a5153b9272cb8c52bcb20e6 | [
"MIT"
] | 194 | 2018-07-28T14:54:35.000Z | 2022-03-18T12:40:10.000Z | plugins/stt/pocketsphinx-stt/phonemeconversion.py | HoltTechnologyCorporation/Naomi | 16d5f6ba03ea96c3fa13ed4e2c1f082041d9de31 | [
"MIT"
] | 239 | 2018-07-13T16:15:25.000Z | 2022-03-31T17:55:01.000Z | plugins/stt/pocketsphinx-stt/phonemeconversion.py | Longshotpro2/Naomi | 9330c63fe24606dc45194d297c665f37a4ec10f7 | [
"MIT"
] | 64 | 2018-07-26T02:18:33.000Z | 2022-01-07T06:53:01.000Z | # -*- coding: utf-8 -*-
import logging
XSAMPA_TO_ARPABET_MAPPING = {
# stop
'p': 'P',
'b': 'B',
't': 'T',
'd': 'D',
'k': 'K',
'g': 'G',
'?': 'Q',
# 2 consonants
'pf': 'PF',
'ts': 'TS',
'tS': 'CH',
'dZ': 'JH',
# fricative
'f': 'F',
'v': 'V',
'T': 'TH... | 17.544715 | 74 | 0.376738 |
import logging
XSAMPA_TO_ARPABET_MAPPING = {
'p': 'P',
'b': 'B',
't': 'T',
'd': 'D',
'k': 'K',
'g': 'G',
'?': 'Q',
'pf': 'PF',
'ts': 'TS',
'tS': 'CH',
'dZ': 'JH',
'f': 'F',
'v': 'V',
'T': 'TH',
'D': 'DH',
's': 'S',
'z': 'Z',
'S':... | true | true |
f7321d390042f6c5d74c536e7d5991129b32374f | 19,784 | py | Python | kplr/mast.py | danielrios12/kplr---acesso-a-dados-do-kepler | 4c6a823ad6a88ccd2d5cf8d9eed912a1e57489a2 | [
"MIT"
] | 35 | 2015-01-21T22:38:12.000Z | 2020-08-05T21:15:19.000Z | kplr/mast.py | danielrios12/kplr---acesso-a-dados-do-kepler | 4c6a823ad6a88ccd2d5cf8d9eed912a1e57489a2 | [
"MIT"
] | 12 | 2015-03-17T18:54:15.000Z | 2021-08-06T18:19:13.000Z | kplr/mast.py | danielrios12/kplr---acesso-a-dados-do-kepler | 4c6a823ad6a88ccd2d5cf8d9eed912a1e57489a2 | [
"MIT"
] | 17 | 2015-02-11T19:49:00.000Z | 2019-10-15T18:06:28.000Z | # -*- coding: utf-8 -*-
"""
Adapters for the field names/types returned by the MAST API.
"""
from __future__ import (division, print_function, absolute_import,
unicode_literals)
__all__ = ["koi_adapter", "planet_adapter", "star_adapter", "dataset_adapter",
"epic_adapter"]
import l... | 38.19305 | 78 | 0.584361 |
from __future__ import (division, print_function, absolute_import,
unicode_literals)
__all__ = ["koi_adapter", "planet_adapter", "star_adapter", "dataset_adapter",
"epic_adapter"]
import logging
import six
try:
unicode
except NameError:
unicode = str
class Adapter(obje... | true | true |
f7321eca94435f51e5be0a02668db295e22b7a07 | 5,713 | py | Python | mavsim_python/chap3/mav_dynamics.py | sethmnielsen/mavsim_template_files | 453ec4f7d38fc2d1162198b554834b5bdb7de96f | [
"MIT"
] | null | null | null | mavsim_python/chap3/mav_dynamics.py | sethmnielsen/mavsim_template_files | 453ec4f7d38fc2d1162198b554834b5bdb7de96f | [
"MIT"
] | null | null | null | mavsim_python/chap3/mav_dynamics.py | sethmnielsen/mavsim_template_files | 453ec4f7d38fc2d1162198b554834b5bdb7de96f | [
"MIT"
] | null | null | null | """
mav_dynamics
- this file implements the dynamic equations of motion for MAV
- use unit quaternion for the attitude state
part of mavsimPy
- Beard & McLain, PUP, 2012
- Update history:
12/17/2018 - RWB
1/14/2019 - RWB
"""
import sys
sys.path.append('..')
import numpy as np
# load me... | 35.70625 | 87 | 0.514266 | import sys
sys.path.append('..')
import numpy as np
from message_types.msg_state import msg_state
import parameters.aerosonde_parameters as MAV
from tools.rotations import Quaternion2Euler
from IPython.core.debugger import Pdb
class mav_dynamics:
def __init__(self, Ts):
self.ts_simulation = Ts
... | true | true |
f7321f3d1f5fe29a720bf5116f40781e9a3db6af | 6,868 | py | Python | docs/conf.py | VictorCoCo/flask-ask | 526b3a272fdd6e1438e2191c5ab08ff20853817d | [
"Apache-2.0"
] | null | null | null | docs/conf.py | VictorCoCo/flask-ask | 526b3a272fdd6e1438e2191c5ab08ff20853817d | [
"Apache-2.0"
] | null | null | null | docs/conf.py | VictorCoCo/flask-ask | 526b3a272fdd6e1438e2191c5ab08ff20853817d | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
#
# Flask documentation build configuration file, created by
# sphinx-quickstart on Tue Apr 6 15:24:58 2010.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# All c... | 34.512563 | 84 | 0.71491 |
from __future__ import print_function
import sys, os
sys.path.append(os.path.abspath("_themes"))
sys.path.append(os.path.abspath("."))
extensions = ["sphinx.ext.autodoc", "sphinx.ext.intersphinx", "flaskdocext"]
templates_path = ["_templates"]
source_suffix = ".rst"
master_doc = "index"... | true | true |
f7321f77d6d135374ca6addceb6958ab720ca656 | 1,435 | py | Python | solutions/previous_solution_python/leetcode_210.py | YuhanShi53/Leetcode_solutions | cdcad34656d25d6af09b226e17250c6070305ab0 | [
"MIT"
] | null | null | null | solutions/previous_solution_python/leetcode_210.py | YuhanShi53/Leetcode_solutions | cdcad34656d25d6af09b226e17250c6070305ab0 | [
"MIT"
] | null | null | null | solutions/previous_solution_python/leetcode_210.py | YuhanShi53/Leetcode_solutions | cdcad34656d25d6af09b226e17250c6070305ab0 | [
"MIT"
] | null | null | null | """ Leetcode 210 - Course Schedule II
https://leetcode.com/problems/course-schedule-ii/
1. Topological-Sorting & BFS: Time: O(E+V) Space: O(E+V)
"""
from typing import List
class Solution1:
""" 1. Topological Sorting & BFS """
def find_order(self, numCourses: int,
prerequisites: List[L... | 25.625 | 64 | 0.531707 |
from typing import List
class Solution1:
def find_order(self, numCourses: int,
prerequisites: List[List[int]]) -> List[int]:
if numCourses == 1:
return [0]
out_dict = {}
in_dict = {}
for x in range(numCourses):
in_dict[x] = 0
... | true | true |
f7321f8b7e649e817c57077e164139a3d84e2925 | 1,003 | py | Python | users/models.py | Sundaybrian/hood-watch | 728283260336bf164d66832dd6b8fe4aa3e60a33 | [
"MIT"
] | null | null | null | users/models.py | Sundaybrian/hood-watch | 728283260336bf164d66832dd6b8fe4aa3e60a33 | [
"MIT"
] | 11 | 2020-06-05T22:55:53.000Z | 2022-03-11T23:59:17.000Z | users/models.py | Sundaybrian/hood-watch | 728283260336bf164d66832dd6b8fe4aa3e60a33 | [
"MIT"
] | null | null | null | from django.db import models
from django.contrib.auth.models import User
from hood.models import NeighbourHood,Business,Location
from PIL import Image
# Create your models here.
class Profile(models.Model):
user=models.OneToOneField(User,on_delete=models.CASCADE)
image=models.ImageField(default='naomi.jpg',up... | 31.34375 | 88 | 0.698903 | from django.db import models
from django.contrib.auth.models import User
from hood.models import NeighbourHood,Business,Location
from PIL import Image
class Profile(models.Model):
user=models.OneToOneField(User,on_delete=models.CASCADE)
image=models.ImageField(default='naomi.jpg',upload_to='profile_pics')
... | true | true |
f73221ee086a3cbdeb523e8624bb53b115cb883f | 968 | py | Python | get_amazon_prices/alter_database.py | schollz/extract_recipe | f55cfda951fe866467f4304bf561584962e4ad8b | [
"Apache-2.0"
] | 52 | 2015-02-13T16:08:33.000Z | 2022-02-26T02:20:46.000Z | get_amazon_prices/alter_database.py | schollz/extract_recipe | f55cfda951fe866467f4304bf561584962e4ad8b | [
"Apache-2.0"
] | 1 | 2019-07-05T09:40:08.000Z | 2019-07-12T10:39:15.000Z | get_amazon_prices/alter_database.py | schollz/extract_recipe | f55cfda951fe866467f4304bf561584962e4ad8b | [
"Apache-2.0"
] | 21 | 2015-03-01T01:15:27.000Z | 2022-02-19T11:31:39.000Z | import json
import urllib
import sqlite3 as lite
from unidecode import unidecode
# Alter the database
con = lite.connect('../db')
with con:
cur = con.cursor()
print "alter table food_des add column price real;"
print "alter table food_des add column unit varchar(60);"
with open('ndb_mean_std_unit.txt','rb') a... | 29.333333 | 80 | 0.683884 | import json
import urllib
import sqlite3 as lite
from unidecode import unidecode
con = lite.connect('../db')
with con:
cur = con.cursor()
print "alter table food_des add column price real;"
print "alter table food_des add column unit varchar(60);"
with open('ndb_mean_std_unit.txt','rb') as f:
for line in... | false | true |
f732221b585588f0d4ac5cd124691e264ed6d756 | 179 | py | Python | apps/node/src/app/main/routes/__init__.py | next-fernandocerezal/PyGrid | b82793b0beecd26338c102573a9891c2e86707c8 | [
"Apache-2.0"
] | 1 | 2021-10-05T18:57:02.000Z | 2021-10-05T18:57:02.000Z | apps/node/src/app/main/routes/__init__.py | next-fernandocerezal/PyGrid | b82793b0beecd26338c102573a9891c2e86707c8 | [
"Apache-2.0"
] | null | null | null | apps/node/src/app/main/routes/__init__.py | next-fernandocerezal/PyGrid | b82793b0beecd26338c102573a9891c2e86707c8 | [
"Apache-2.0"
] | null | null | null | from .data_centric.routes import *
from .general import *
from .model_centric.routes import *
from .user_related import *
from .role_related import *
from .group_related import *
| 25.571429 | 35 | 0.787709 | from .data_centric.routes import *
from .general import *
from .model_centric.routes import *
from .user_related import *
from .role_related import *
from .group_related import *
| true | true |
f7322312f3d2f82f8c036e5d17590635e08e0c15 | 1,784 | py | Python | unrecognized.py | timvandermeij/sentiment-analysis | 39a1bdbe56248c9dbbc25107ed339621ef0d65df | [
"MIT"
] | 12 | 2015-06-04T10:33:22.000Z | 2021-07-25T07:49:04.000Z | unrecognized.py | timvandermeij/sentiment-analysis | 39a1bdbe56248c9dbbc25107ed339621ef0d65df | [
"MIT"
] | null | null | null | unrecognized.py | timvandermeij/sentiment-analysis | 39a1bdbe56248c9dbbc25107ed339621ef0d65df | [
"MIT"
] | 3 | 2015-06-17T08:28:04.000Z | 2020-01-16T00:21:30.000Z | import sys
import linecache
from analyze import Analyzer
from classify import Classifier
from utils import Utilities
from sklearn.ensemble import RandomForestRegressor
def main(argv):
# Constants for the analyzer and the classifier
dataset = 'commit_comments-dump.2015-01-29.json'
group = 'id'
model_fil... | 29.733333 | 100 | 0.640695 | import sys
import linecache
from analyze import Analyzer
from classify import Classifier
from utils import Utilities
from sklearn.ensemble import RandomForestRegressor
def main(argv):
dataset = 'commit_comments-dump.2015-01-29.json'
group = 'id'
model_file = 'model.pickle'
analyzer = Ana... | true | true |
f732239fbe0f1f3f991aa2396e2c32ab3b933115 | 13,202 | py | Python | pipelines/ASR/opts.py | csalt-research/OpenASR-py | 9aea6753689d87d321260d7eb0ea0544e1b3403a | [
"MIT"
] | 2 | 2019-11-29T15:46:14.000Z | 2021-05-28T06:54:41.000Z | pipelines/DAT/opts.py | csalt-research/OpenASR-py | 9aea6753689d87d321260d7eb0ea0544e1b3403a | [
"MIT"
] | null | null | null | pipelines/DAT/opts.py | csalt-research/OpenASR-py | 9aea6753689d87d321260d7eb0ea0544e1b3403a | [
"MIT"
] | null | null | null | def build_preprocess_parser(parser):
preprocess_opts(parser)
return parser
def build_train_parser(parser):
model_opts(parser)
general_opts(parser)
train_opts(parser)
translate_opts(parser)
return parser
def build_test_parser(parser):
general_opts(parser)
translate_opts(parser)
... | 50.197719 | 82 | 0.604302 | def build_preprocess_parser(parser):
preprocess_opts(parser)
return parser
def build_train_parser(parser):
model_opts(parser)
general_opts(parser)
train_opts(parser)
translate_opts(parser)
return parser
def build_test_parser(parser):
general_opts(parser)
translate_opts(parser)
... | true | true |
f73225b22c2dc40bcb99cfec0c85cf7a9faf4caa | 276 | py | Python | src/main.py | Hudson-Newey/Global-Search | 3095b0002e44994142fa4b815cf8e56b05f012e2 | [
"MIT"
] | 1 | 2020-09-25T05:38:11.000Z | 2020-09-25T05:38:11.000Z | src/main.py | Grathium-Industries/Global-Search | 3095b0002e44994142fa4b815cf8e56b05f012e2 | [
"MIT"
] | null | null | null | src/main.py | Grathium-Industries/Global-Search | 3095b0002e44994142fa4b815cf8e56b05f012e2 | [
"MIT"
] | null | null | null | # readfile "rf()" function
def rf(filename):
return open(filename, "r").read()
# import external files
exec(rf("translate.py"))
exec(rf("parse.py"))
exec(rf("fileServer.py"))
# main body
# arg1 defines live server port
# main calling point of program
startServer(8080)
| 18.4 | 37 | 0.702899 |
def rf(filename):
return open(filename, "r").read()
exec(rf("translate.py"))
exec(rf("parse.py"))
exec(rf("fileServer.py"))
startServer(8080)
| true | true |
f73226da285f8746d282b6368e6dadea4572096c | 4,050 | py | Python | tyrant/cogs/fruit_vs_vegetables.py | AadilVarsh/tyrant | f4a5cebf09cd217b89823ca28180cb434c009b12 | [
"MIT"
] | 1 | 2021-10-12T05:10:04.000Z | 2021-10-12T05:10:04.000Z | tyrant/cogs/fruit_vs_vegetables.py | AadilVarsh/tyrant | f4a5cebf09cd217b89823ca28180cb434c009b12 | [
"MIT"
] | null | null | null | tyrant/cogs/fruit_vs_vegetables.py | AadilVarsh/tyrant | f4a5cebf09cd217b89823ca28180cb434c009b12 | [
"MIT"
] | null | null | null | import asyncio
from disnake.ext.commands import Bot, Cog
from tyrant import constants
class FruitVsVegetables(Cog):
"""Assign fruit and vegetable roles."""
def __init__(self, bot: Bot):
"""Initialize this cog with the Bot instance."""
self.bot = bot
self.locks = {}
@Cog.listene... | 41.326531 | 123 | 0.589383 | import asyncio
from disnake.ext.commands import Bot, Cog
from tyrant import constants
class FruitVsVegetables(Cog):
def __init__(self, bot: Bot):
self.bot = bot
self.locks = {}
@Cog.listener()
async def on_raw_reaction_add(self, payload):
if payload.channel_id == constants.Chan... | true | true |
f732285ceeeaed769e47aab9658083e763fee6e4 | 2,947 | py | Python | tests/legacy/test_cross_cov.py | EEmGuzman/orphics | f8f25f9db7c9104dba5cbeaac0b4924bf4f6920e | [
"BSD-2-Clause"
] | 10 | 2018-01-12T16:12:11.000Z | 2021-02-11T18:46:47.000Z | tests/legacy/test_cross_cov.py | EEmGuzman/orphics | f8f25f9db7c9104dba5cbeaac0b4924bf4f6920e | [
"BSD-2-Clause"
] | 20 | 2016-11-17T20:20:53.000Z | 2021-02-02T10:08:38.000Z | tests/legacy/test_cross_cov.py | EEmGuzman/orphics | f8f25f9db7c9104dba5cbeaac0b4924bf4f6920e | [
"BSD-2-Clause"
] | 17 | 2017-04-28T23:28:16.000Z | 2021-08-15T20:28:25.000Z | from __future__ import print_function
from orphics import maps,io,cosmology,symcoupling as sc,stats,lensing
from enlib import enmap,bench
import numpy as np
import os,sys
cache = True
hdv = False
deg = 5
px = 1.5
shape,wcs = maps.rect_geometry(width_deg = deg,px_res_arcmin=px)
mc = sc.LensingModeCoupling(shape,wcs)
... | 33.488636 | 98 | 0.650153 | from __future__ import print_function
from orphics import maps,io,cosmology,symcoupling as sc,stats,lensing
from enlib import enmap,bench
import numpy as np
import os,sys
cache = True
hdv = False
deg = 5
px = 1.5
shape,wcs = maps.rect_geometry(width_deg = deg,px_res_arcmin=px)
mc = sc.LensingModeCoupling(shape,wcs)
... | true | true |
f73229b10a319926c7005288cb0476184c0feb80 | 952 | py | Python | twitterBot.py | f0xHiero/Learning_Still | 53721c0da1e2d280433e68979dbf5a4d692bd955 | [
"CC0-1.0"
] | null | null | null | twitterBot.py | f0xHiero/Learning_Still | 53721c0da1e2d280433e68979dbf5a4d692bd955 | [
"CC0-1.0"
] | null | null | null | twitterBot.py | f0xHiero/Learning_Still | 53721c0da1e2d280433e68979dbf5a4d692bd955 | [
"CC0-1.0"
] | null | null | null | #!/usr/bin/python3
import tweepy
import time, datetime
consumer_key = 'REDACTED'
consumer_secret = 'REDACTED'
key = 'REDACTED'
secret = 'REDACTED'
auth = tweepy.OAuthHandler(consumer_key, consumer_secret)
auth.set_access_token(key, secret)
api = tweepy.API(auth)
def twitter_bot(hashtag, delay):
while True... | 21.636364 | 78 | 0.594538 |
import tweepy
import time, datetime
consumer_key = 'REDACTED'
consumer_secret = 'REDACTED'
key = 'REDACTED'
secret = 'REDACTED'
auth = tweepy.OAuthHandler(consumer_key, consumer_secret)
auth.set_access_token(key, secret)
api = tweepy.API(auth)
def twitter_bot(hashtag, delay):
while True:
print(f"... | true | true |
f73229f61512eeeef654392625e73b17e8a5aff6 | 19,243 | py | Python | tests/extensions/test_version.py | jisantuc/pystac | 12eff70f9423d642c9909c92b4ba228bf97bef0e | [
"Apache-2.0"
] | 130 | 2020-09-08T08:30:23.000Z | 2022-03-29T19:38:26.000Z | tests/extensions/test_version.py | jisantuc/pystac | 12eff70f9423d642c9909c92b4ba228bf97bef0e | [
"Apache-2.0"
] | 536 | 2020-08-20T17:24:49.000Z | 2022-03-31T23:49:37.000Z | tests/extensions/test_version.py | jisantuc/pystac | 12eff70f9423d642c9909c92b4ba228bf97bef0e | [
"Apache-2.0"
] | 42 | 2020-08-20T09:08:11.000Z | 2022-03-08T07:44:12.000Z | """Tests for pystac.extensions.version."""
import datetime
import unittest
from typing import List, Optional
import pystac
from pystac import ExtensionTypeError
from pystac.extensions import version
from pystac.extensions.version import VersionExtension, VersionRelType
from tests.utils import TestCases
URL_TEMPLATE:... | 40.426471 | 87 | 0.693187 |
import datetime
import unittest
from typing import List, Optional
import pystac
from pystac import ExtensionTypeError
from pystac.extensions import version
from pystac.extensions.version import VersionExtension, VersionRelType
from tests.utils import TestCases
URL_TEMPLATE: str = "http://example.com/catalog/%s.json"... | true | true |
f7322b5afc332aa2306c32d240c945d3ffe9d0d3 | 2,660 | py | Python | prepare_data/preparing_faces_parallel.py | yuval-alaluf/stylegan3-editing | ab01a5d90b8ba67e0da0e1388f0931482601006c | [
"MIT"
] | 347 | 2022-01-31T18:36:35.000Z | 2022-03-31T08:08:39.000Z | prepare_data/preparing_faces_parallel.py | yuval-alaluf/stylegan3-editing | ab01a5d90b8ba67e0da0e1388f0931482601006c | [
"MIT"
] | 11 | 2022-02-13T20:21:53.000Z | 2022-03-29T12:20:57.000Z | prepare_data/preparing_faces_parallel.py | yuval-alaluf/stylegan3-editing | ab01a5d90b8ba67e0da0e1388f0931482601006c | [
"MIT"
] | 24 | 2022-02-02T23:18:15.000Z | 2022-03-23T02:16:26.000Z | import math
import multiprocessing as mp
import sys
import time
from functools import partial
from pathlib import Path
import pyrallis
import dlib
from dataclasses import dataclass
sys.path.append(".")
sys.path.append("..")
from configs.paths_config import model_paths
from utils.alignment_utils import align_face, c... | 28.913043 | 101 | 0.659398 | import math
import multiprocessing as mp
import sys
import time
from functools import partial
from pathlib import Path
import pyrallis
import dlib
from dataclasses import dataclass
sys.path.append(".")
sys.path.append("..")
from configs.paths_config import model_paths
from utils.alignment_utils import align_face, c... | true | true |
f7322d56ef9db59648ac91a2cf2ff4d481a60519 | 13,087 | py | Python | models/data/issue_submission_data.py | 0xNuggan/commons-config-backend | e462e9c1625eef0c44f21685f171782aedc56316 | [
"MIT"
] | 1 | 2021-11-03T18:26:12.000Z | 2021-11-03T18:26:12.000Z | models/data/issue_submission_data.py | 0xNuggan/commons-config-backend | e462e9c1625eef0c44f21685f171782aedc56316 | [
"MIT"
] | 36 | 2021-10-06T17:14:04.000Z | 2021-12-21T12:22:00.000Z | models/data/issue_submission_data.py | 0xNuggan/commons-config-backend | e462e9c1625eef0c44f21685f171782aedc56316 | [
"MIT"
] | 3 | 2021-08-19T22:21:02.000Z | 2021-11-30T15:49:20.000Z | advanced_settings_data = """
### *Advanced Settings
>This will be empty or non-existent if the user did not change any advanced settings from their default. Any settings changed from default will show up here
| Parameter | Value |
|:-----------------------:|:----------------------... | 61.731132 | 301 | 0.589058 | advanced_settings_data = """
### *Advanced Settings
>This will be empty or non-existent if the user did not change any advanced settings from their default. Any settings changed from default will show up here
| Parameter | Value |
|:-----------------------:|:----------------------... | true | true |
f7322d6acf0bb63777abeccc59db6c90f96b1fe9 | 2,443 | py | Python | Python/phonenumbers/data/region_GR.py | skykisl/uberbruns2 | 26933efce04dba700d93cc75c7b74e069fb02d26 | [
"Unlicense"
] | 5 | 2015-04-27T20:10:56.000Z | 2018-06-14T18:19:09.000Z | python/phonenumbers/data/region_GR.py | vemel/python-phonenumbers | 595c322bf12106a3b95e3f202e948a7c6b6c15b8 | [
"Apache-2.0"
] | 2 | 2017-06-08T16:11:13.000Z | 2018-05-07T11:50:13.000Z | python/phonenumbers/data/region_GR.py | vemel/python-phonenumbers | 595c322bf12106a3b95e3f202e948a7c6b6c15b8 | [
"Apache-2.0"
] | 6 | 2015-02-19T11:11:04.000Z | 2022-03-15T19:38:31.000Z | """Auto-generated file, do not edit by hand. GR metadata"""
from ..phonemetadata import NumberFormat, PhoneNumberDesc, PhoneMetadata
PHONE_METADATA_GR = PhoneMetadata(id='GR', country_code=30, international_prefix='00',
general_desc=PhoneNumberDesc(national_number_pattern='[26-9]\\d{9}', possible_number_pattern='\... | 116.333333 | 482 | 0.693819 | from ..phonemetadata import NumberFormat, PhoneNumberDesc, PhoneMetadata
PHONE_METADATA_GR = PhoneMetadata(id='GR', country_code=30, international_prefix='00',
general_desc=PhoneNumberDesc(national_number_pattern='[26-9]\\d{9}', possible_number_pattern='\\d{10}'),
fixed_line=PhoneNumberDesc(national_number_pat... | true | true |
f7322f621bf5191e1411b871cefba6a1f2f1057f | 9,058 | py | Python | tests/test_0022-number-of-branches.py | nikoladze/uproot4 | 57fafcfd73c40aea21dd19a439c76c79fd370768 | [
"BSD-3-Clause"
] | null | null | null | tests/test_0022-number-of-branches.py | nikoladze/uproot4 | 57fafcfd73c40aea21dd19a439c76c79fd370768 | [
"BSD-3-Clause"
] | null | null | null | tests/test_0022-number-of-branches.py | nikoladze/uproot4 | 57fafcfd73c40aea21dd19a439c76c79fd370768 | [
"BSD-3-Clause"
] | null | null | null | # BSD 3-Clause License; see https://github.com/scikit-hep/uproot4/blob/master/LICENSE
from __future__ import absolute_import
import sys
import json
import numpy
import pytest
import skhep_testdata
import uproot4
import uproot4.interpretation.library
import uproot4.interpretation.jagged
import uproot4.interpretation... | 39.212121 | 88 | 0.520534 |
from __future__ import absolute_import
import sys
import json
import numpy
import pytest
import skhep_testdata
import uproot4
import uproot4.interpretation.library
import uproot4.interpretation.jagged
import uproot4.interpretation.numerical
def test_branchname():
with uproot4.open(
skhep_testdata.dat... | true | true |
f7322f73d610fd86e37f5dd2157b9b28bca8a8f7 | 43 | py | Python | msg.py | AlexCustodio1801099/alexcustodio1801099 | 96a4d45585b46087b78498f79d23b98f00b80a0c | [
"Apache-2.0"
] | null | null | null | msg.py | AlexCustodio1801099/alexcustodio1801099 | 96a4d45585b46087b78498f79d23b98f00b80a0c | [
"Apache-2.0"
] | null | null | null | msg.py | AlexCustodio1801099/alexcustodio1801099 | 96a4d45585b46087b78498f79d23b98f00b80a0c | [
"Apache-2.0"
] | null | null | null | def mensagem():
print("olá mundo!!!")
| 10.75 | 25 | 0.55814 | def mensagem():
print("olá mundo!!!")
| true | true |
f7322f82e6e309e3b1e8ce6dc31cde69ea6df68e | 1,018 | py | Python | app/forms.py | ssloat/wheatonultimate-www | 9ea27dc03adfbe63dccb404f621f9e5fa83def6b | [
"MIT"
] | null | null | null | app/forms.py | ssloat/wheatonultimate-www | 9ea27dc03adfbe63dccb404f621f9e5fa83def6b | [
"MIT"
] | null | null | null | app/forms.py | ssloat/wheatonultimate-www | 9ea27dc03adfbe63dccb404f621f9e5fa83def6b | [
"MIT"
] | null | null | null | from flask_wtf import FlaskForm
from wtforms import RadioField, SelectMultipleField, widgets
class MultiCheckBoxField(SelectMultipleField):
widget = widgets.ListWidget(prefix_label=False)
option_widget = widgets.CheckboxInput()
class GoogleGroupsSubscribe(FlaskForm):
group = MultiCheckBoxField(
'... | 33.933333 | 67 | 0.639489 | from flask_wtf import FlaskForm
from wtforms import RadioField, SelectMultipleField, widgets
class MultiCheckBoxField(SelectMultipleField):
widget = widgets.ListWidget(prefix_label=False)
option_widget = widgets.CheckboxInput()
class GoogleGroupsSubscribe(FlaskForm):
group = MultiCheckBoxField(
'... | true | true |
f7322f8996b9015fbab55e9d33bd023ad461052d | 15,526 | py | Python | spirl/data/block_stacking/src/demo_gen/block_demo_policy.py | kouroshHakha/fist | 328c098789239fd892e17edefd799fc1957ab637 | [
"BSD-3-Clause"
] | 8 | 2021-10-14T03:14:23.000Z | 2022-03-15T21:31:17.000Z | spirl/data/block_stacking/src/demo_gen/block_demo_policy.py | kouroshHakha/fist | 328c098789239fd892e17edefd799fc1957ab637 | [
"BSD-3-Clause"
] | null | null | null | spirl/data/block_stacking/src/demo_gen/block_demo_policy.py | kouroshHakha/fist | 328c098789239fd892e17edefd799fc1957ab637 | [
"BSD-3-Clause"
] | 1 | 2021-09-13T20:42:28.000Z | 2021-09-13T20:42:28.000Z | import numpy as np
from collections import deque
import copy
from spirl.utils.general_utils import AttrDict, split_along_axis
from spirl.data.block_stacking.src.utils.utils import quat2euler
from spirl.data.block_stacking.src.block_stacking_env import BlockStackEnv
class BlockStackDemoPolicy:
"""Follows plan on ... | 45.002899 | 135 | 0.631972 | import numpy as np
from collections import deque
import copy
from spirl.utils.general_utils import AttrDict, split_along_axis
from spirl.data.block_stacking.src.utils.utils import quat2euler
from spirl.data.block_stacking.src.block_stacking_env import BlockStackEnv
class BlockStackDemoPolicy:
GRASP_OFFSET = 0.08... | true | true |
f7323123b654734d406913c73fe56a176996774e | 1,456 | py | Python | packages/merlin/cli/About.py | PyreFramework/pyre | 345c7449a3416eea1c1affa74fb32faff30a6aaa | [
"BSD-3-Clause"
] | null | null | null | packages/merlin/cli/About.py | PyreFramework/pyre | 345c7449a3416eea1c1affa74fb32faff30a6aaa | [
"BSD-3-Clause"
] | null | null | null | packages/merlin/cli/About.py | PyreFramework/pyre | 345c7449a3416eea1c1affa74fb32faff30a6aaa | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
#
# michael a.g. aïvázis <michael.aivazis@para-sim.com>
# (c) 1998-2022 all rights reserved
# externals
import merlin
# declaration
class About(merlin.shells.command, family='merlin.cli.about'):
"""
Display information about this application
"""
@merlin.export(tip="print th... | 23.111111 | 68 | 0.592033 |
import merlin
class About(merlin.shells.command, family='merlin.cli.about'):
@merlin.export(tip="print the copyright note")
def copyright(self, plexus, **kwds):
plexus.info.log(merlin.meta.copyright)
return
@merlin.export(tip="print out the acknowledgments")
... | true | true |
f732324215dffd9d37733babb43056a844a03632 | 140,440 | py | Python | python/paddle/fluid/layers/control_flow.py | grasswolfs/Paddle | 0c2fff447c7d5b0bbad473a1590872c5343e1e56 | [
"Apache-2.0"
] | null | null | null | python/paddle/fluid/layers/control_flow.py | grasswolfs/Paddle | 0c2fff447c7d5b0bbad473a1590872c5343e1e56 | [
"Apache-2.0"
] | null | null | null | python/paddle/fluid/layers/control_flow.py | grasswolfs/Paddle | 0c2fff447c7d5b0bbad473a1590872c5343e1e56 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... | 40.944606 | 449 | 0.592815 |
from __future__ import print_function
from ..wrapped_decorator import signature_safe_contextmanager
from .layer_function_generator import autodoc, templatedoc
from .tensor import assign, cast, fill_constant
from .. import core
from ..framework import Program, Variable, Operator
from ..layer_helper import... | true | true |
f73237cb25ef0fec908c5cdf07d7c7b7b9907d50 | 332 | py | Python | ogreserver/forms/search.py | oii/ogreserver | 942d8ee612206fb094f04b3ff976187abebf3069 | [
"BSD-2-Clause-FreeBSD"
] | null | null | null | ogreserver/forms/search.py | oii/ogreserver | 942d8ee612206fb094f04b3ff976187abebf3069 | [
"BSD-2-Clause-FreeBSD"
] | null | null | null | ogreserver/forms/search.py | oii/ogreserver | 942d8ee612206fb094f04b3ff976187abebf3069 | [
"BSD-2-Clause-FreeBSD"
] | null | null | null | from __future__ import absolute_import
from __future__ import unicode_literals
from flask_wtf import FlaskForm
from wtforms import TextField, BooleanField
class SearchForm(FlaskForm):
s = TextField('s')
is_curated = BooleanField('Curated Only?', default=True)
is_fiction = BooleanField('Fiction Only?', de... | 27.666667 | 60 | 0.783133 | from __future__ import absolute_import
from __future__ import unicode_literals
from flask_wtf import FlaskForm
from wtforms import TextField, BooleanField
class SearchForm(FlaskForm):
s = TextField('s')
is_curated = BooleanField('Curated Only?', default=True)
is_fiction = BooleanField('Fiction Only?', de... | true | true |
f732394175903cc275173763bb703893ecd75976 | 369 | py | Python | tests/test_initial_data.py | luiscberrocal/django-acp-calendar | 7251d7cbb1ba16983bbc3ba9af6178eb31408bee | [
"BSD-3-Clause"
] | 1 | 2016-10-05T05:17:35.000Z | 2016-10-05T05:17:35.000Z | tests/test_initial_data.py | luiscberrocal/django-acp-calendar | 7251d7cbb1ba16983bbc3ba9af6178eb31408bee | [
"BSD-3-Clause"
] | 17 | 2016-09-30T13:43:20.000Z | 2021-06-10T20:44:40.000Z | tests/test_initial_data.py | luiscberrocal/django-acp-calendar | 7251d7cbb1ba16983bbc3ba9af6178eb31408bee | [
"BSD-3-Clause"
] | 6 | 2016-04-11T14:41:44.000Z | 2017-10-20T21:16:39.000Z | from django.test import TestCase
from acp_calendar.initial_data import get_holidays_list
class TestInitialData(TestCase):
def test_get_holidays_list(self):
holidays = get_holidays_list()
self.assertEqual(144, len(holidays))
self.assertEqual('2006-01-01', holidays[0]['date'])
self... | 28.384615 | 60 | 0.710027 | from django.test import TestCase
from acp_calendar.initial_data import get_holidays_list
class TestInitialData(TestCase):
def test_get_holidays_list(self):
holidays = get_holidays_list()
self.assertEqual(144, len(holidays))
self.assertEqual('2006-01-01', holidays[0]['date'])
self... | true | true |
f73239a9d45e6658e36f048b96ff430af7d2667e | 7,748 | py | Python | ironicclient/tests/unit/v1/test_driver_shell.py | sapcc/python-ironicclient | 8dcbf5b6d0bc2c2dc3881dbc557e2e403e2fe2b4 | [
"Apache-2.0"
] | null | null | null | ironicclient/tests/unit/v1/test_driver_shell.py | sapcc/python-ironicclient | 8dcbf5b6d0bc2c2dc3881dbc557e2e403e2fe2b4 | [
"Apache-2.0"
] | null | null | null | ironicclient/tests/unit/v1/test_driver_shell.py | sapcc/python-ironicclient | 8dcbf5b6d0bc2c2dc3881dbc557e2e403e2fe2b4 | [
"Apache-2.0"
] | null | null | null | # Copyright 2014 Hewlett-Packard Development Company, L.P.
#
# 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 ... | 39.329949 | 78 | 0.657073 |
import mock
from ironicclient.common import cliutils
from ironicclient.tests.unit import utils
import ironicclient.v1.driver as v1_driver
import ironicclient.v1.driver_shell as d_shell
class DriverShellTest(utils.BaseTestCase):
def setUp(self):
super(DriverShellTest, self).setUp()
c... | true | true |
f73239b4487781d61b40f39c0bd8795ca4336a53 | 484 | py | Python | json_encoder.py | luksurious/faster-teaching | 1493311d5b723ca3f216f537bda8db5907196443 | [
"MIT"
] | 2 | 2020-08-06T13:21:51.000Z | 2021-04-15T04:29:03.000Z | json_encoder.py | luksurious/faster-teaching | 1493311d5b723ca3f216f537bda8db5907196443 | [
"MIT"
] | null | null | null | json_encoder.py | luksurious/faster-teaching | 1493311d5b723ca3f216f537bda8db5907196443 | [
"MIT"
] | null | null | null | import json
import numpy as np
from actions import Actions
class CustomEncoder(json.JSONEncoder):
def default(self, obj):
if isinstance(obj, np.integer):
return int(obj)
elif isinstance(obj, np.floating):
return float(obj)
elif isinstance(obj, np.ndarray):
... | 25.473684 | 58 | 0.609504 | import json
import numpy as np
from actions import Actions
class CustomEncoder(json.JSONEncoder):
def default(self, obj):
if isinstance(obj, np.integer):
return int(obj)
elif isinstance(obj, np.floating):
return float(obj)
elif isinstance(obj, np.ndarray):
... | true | true |
f73239bc46550b56b6efc3d11e7395420f4d3bb7 | 1,554 | py | Python | src/fonduer/utils/utils_parser.py | SenWu/fonduer | c4f8d95cec97552b34412c6787eb7370ae17424f | [
"MIT"
] | 1 | 2018-11-02T06:02:13.000Z | 2018-11-02T06:02:13.000Z | src/fonduer/utils/utils_parser.py | SenWu/fonduer | c4f8d95cec97552b34412c6787eb7370ae17424f | [
"MIT"
] | null | null | null | src/fonduer/utils/utils_parser.py | SenWu/fonduer | c4f8d95cec97552b34412c6787eb7370ae17424f | [
"MIT"
] | 1 | 2018-09-24T03:27:04.000Z | 2018-09-24T03:27:04.000Z | from typing import List, Optional, Tuple
def build_node(type: str, name: str, content: str) -> str:
"""
Wrap up content in to a html node.
:param type: content type (e.g., doc, section, text, figure)
:type path: str
:param name: content name (e.g., the name of the section)
:type path: str
... | 30.470588 | 79 | 0.611326 | from typing import List, Optional, Tuple
def build_node(type: str, name: str, content: str) -> str:
if type == "doc":
return f"<html>{content}</html>"
if type == "section":
return f"<section name='{name}'>{content}</section>"
if type == "text":
return f"<p name='{name}'>{content}</... | true | true |
f7323bb40b17dc7bb6c240025103a25a642c8bc1 | 259 | py | Python | ecdc_status/crime_scene/urls.py | ess-dmsc/ecdc-status | 8057b2995f2404b6eac6b6a723f8776137a71328 | [
"BSD-2-Clause"
] | null | null | null | ecdc_status/crime_scene/urls.py | ess-dmsc/ecdc-status | 8057b2995f2404b6eac6b6a723f8776137a71328 | [
"BSD-2-Clause"
] | null | null | null | ecdc_status/crime_scene/urls.py | ess-dmsc/ecdc-status | 8057b2995f2404b6eac6b6a723f8776137a71328 | [
"BSD-2-Clause"
] | null | null | null | from django.urls import path
from . import views
urlpatterns = [
path('', views.list),
path('random/', views.random_crime_scene),
path('<int:id>/', views.crime_scene),
path('data/<int:id>', views.crime_scene_data, name="crime_scene_data"),
] | 25.9 | 75 | 0.675676 | from django.urls import path
from . import views
urlpatterns = [
path('', views.list),
path('random/', views.random_crime_scene),
path('<int:id>/', views.crime_scene),
path('data/<int:id>', views.crime_scene_data, name="crime_scene_data"),
] | true | true |
f7323bfabed34ca36a6d78e1a86dbd6f1606129a | 1,888 | py | Python | handlers/message.py | cvatricks/VoiceChatPyroBot | 4f45b2d75027e652fe1992369eaec4a7bf925b85 | [
"MIT"
] | 3 | 2021-01-23T07:33:43.000Z | 2021-02-05T18:21:06.000Z | handlers/message.py | Vivektp/VoiceChatPyroBot-1 | e3fda36ee0267a271d79938048a60d7d9ffeb383 | [
"MIT"
] | null | null | null | handlers/message.py | Vivektp/VoiceChatPyroBot-1 | e3fda36ee0267a271d79938048a60d7d9ffeb383 | [
"MIT"
] | 3 | 2020-12-31T12:06:28.000Z | 2021-03-23T16:32:39.000Z | from pyrogram import filters
from pyrogram.handlers import MessageHandler
from helpers import is_youtube
from ytdl import download
import player
from config import LOG_GROUP
async def message(client, message):
if message.text.startswith("/"):
return
if not is_youtube(message.text):
... | 26.222222 | 87 | 0.423729 | from pyrogram import filters
from pyrogram.handlers import MessageHandler
from helpers import is_youtube
from ytdl import download
import player
from config import LOG_GROUP
async def message(client, message):
if message.text.startswith("/"):
return
if not is_youtube(message.text):
... | true | true |
f7323c1c4fea94b6dad136f49474d89ef42d1a21 | 1,459 | py | Python | utils/test/testapi/opnfv_testapi/resources/project_models.py | kkltcjk/reporting | 460731b8b2da037159649b02ffed798656dad8a9 | [
"Apache-2.0"
] | null | null | null | utils/test/testapi/opnfv_testapi/resources/project_models.py | kkltcjk/reporting | 460731b8b2da037159649b02ffed798656dad8a9 | [
"Apache-2.0"
] | null | null | null | utils/test/testapi/opnfv_testapi/resources/project_models.py | kkltcjk/reporting | 460731b8b2da037159649b02ffed798656dad8a9 | [
"Apache-2.0"
] | null | null | null | ##############################################################################
# Copyright (c) 2015 Orange
# guyrodrigue.koffi@orange.com / koffirodrigue@gmail.com
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the Apache License, Version 2.0
# which accompani... | 29.77551 | 78 | 0.611378 | true | true | |
f7323c996636da5b03b4665b07a0e5c0fa576a77 | 274 | py | Python | alert_rules/alr_get.py | PaloAltoNetworks/pcs-migration-management | 766c8c861befa92e593b23ad6d248e33f62054bb | [
"ISC"
] | 1 | 2022-03-17T12:51:45.000Z | 2022-03-17T12:51:45.000Z | alert_rules/alr_get.py | PaloAltoNetworks/pcs-migration-management | 766c8c861befa92e593b23ad6d248e33f62054bb | [
"ISC"
] | 2 | 2021-11-03T15:34:40.000Z | 2021-12-14T19:50:20.000Z | alert_rules/alr_get.py | PaloAltoNetworks/pcs-migration-management | 766c8c861befa92e593b23ad6d248e33f62054bb | [
"ISC"
] | 4 | 2021-11-09T17:57:01.000Z | 2022-01-24T17:41:21.000Z | def get_alert_rules(session: object, logger):
'''
Accepts a tenant session object.
Gets all alert rules from a tenant
'''
logger.debug('API - Getting Alert Rules')
res = session.request("GET", "/v2/alert/rule")
data = res.json()
return data | 24.909091 | 50 | 0.638686 | def get_alert_rules(session: object, logger):
logger.debug('API - Getting Alert Rules')
res = session.request("GET", "/v2/alert/rule")
data = res.json()
return data | true | true |
f7323d4c992046056cb702fd74ddd0fe7f0a0f02 | 6,820 | py | Python | CornerNetEngine.py | gordonjun2/CornerNet | d1a8d87903433ddbe0fa8b96c7388b955021e53c | [
"BSD-3-Clause"
] | 2 | 2020-01-22T06:22:16.000Z | 2020-02-10T08:47:20.000Z | CornerNetEngine.py | gordonjun2/CornerNet | d1a8d87903433ddbe0fa8b96c7388b955021e53c | [
"BSD-3-Clause"
] | null | null | null | CornerNetEngine.py | gordonjun2/CornerNet | d1a8d87903433ddbe0fa8b96c7388b955021e53c | [
"BSD-3-Clause"
] | null | null | null | import argparse
import time
import cv2
from config import system_configs
from utils.drawer import Drawer # Import Drawer to add bboxes
import os
import torch
import pprint
import json
import importlib
import numpy as np
import matplotlib
from test.coco_video import kp_detection
from nnet.py_fa... | 42.098765 | 164 | 0.533871 | import argparse
import time
import cv2
from config import system_configs
from utils.drawer import Drawer
import os
import torch
import pprint
import json
import importlib
import numpy as np
import matplotlib
from test.coco_video import kp_detection
from nnet.py_factory_video import NetworkFac... | true | true |
f7323d86d734c82e47f24220097e9e149b478eae | 2,663 | py | Python | tests/trees.py | andrewguy9/farmfs | 1cad69237ace53869b044afcb322773acf9bf447 | [
"MIT"
] | 5 | 2015-01-28T19:09:33.000Z | 2022-03-01T07:35:02.000Z | tests/trees.py | andrewguy9/farmfs | 1cad69237ace53869b044afcb322773acf9bf447 | [
"MIT"
] | 22 | 2015-01-01T19:10:28.000Z | 2022-01-18T21:52:39.000Z | tests/trees.py | andrewguy9/farmfs | 1cad69237ace53869b044afcb322773acf9bf447 | [
"MIT"
] | 1 | 2021-05-06T03:39:34.000Z | 2021-05-06T03:39:34.000Z | from farmfs.fs import sep, ROOT, Path, LINK, DIR
from itertools import permutations, combinations, chain, product
from collections import defaultdict
def permute_deep(options):
options = [permutations(options, pick) for pick in range(1,1+len(options))]
return list(chain.from_iterable(options))
def combine_dee... | 30.965116 | 97 | 0.699211 | from farmfs.fs import sep, ROOT, Path, LINK, DIR
from itertools import permutations, combinations, chain, product
from collections import defaultdict
def permute_deep(options):
options = [permutations(options, pick) for pick in range(1,1+len(options))]
return list(chain.from_iterable(options))
def combine_dee... | true | true |
f7323e093756717649d847aad33677262eb94277 | 12,590 | py | Python | cirq/google/devices/serializable_device.py | abhik-99/Cirq | d244bf71ba78cee461bfd83a5edcf62dbbc5b3ca | [
"Apache-2.0"
] | null | null | null | cirq/google/devices/serializable_device.py | abhik-99/Cirq | d244bf71ba78cee461bfd83a5edcf62dbbc5b3ca | [
"Apache-2.0"
] | null | null | null | cirq/google/devices/serializable_device.py | abhik-99/Cirq | d244bf71ba78cee461bfd83a5edcf62dbbc5b3ca | [
"Apache-2.0"
] | null | null | null | # Copyright 2019 The Cirq Developers
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in ... | 40.876623 | 80 | 0.608261 |
from typing import (Any, Callable, cast, Dict, Iterable, Optional, List, Set,
Tuple, Type, TYPE_CHECKING, FrozenSet)
from cirq import circuits, devices
from cirq.google import serializable_gate_set
from cirq.google.api import v2
from cirq.value import Duration
if TYPE_CHECKING:
i... | true | true |
f7323e47ca19d683e6fb6a280cc58c5744dc8f71 | 124 | py | Python | output_test.py | AnkurDesai11/PY4E | bfd185ef89d4b054a2286ca8a6eae476c086b782 | [
"BSD-3-Clause"
] | null | null | null | output_test.py | AnkurDesai11/PY4E | bfd185ef89d4b054a2286ca8a6eae476c086b782 | [
"BSD-3-Clause"
] | null | null | null | output_test.py | AnkurDesai11/PY4E | bfd185ef89d4b054a2286ca8a6eae476c086b782 | [
"BSD-3-Clause"
] | null | null | null | '''
Created on 30 Aug, 2020
@author: ABD
'''
#total = 0
#for abc in range(5):
# total = total + abc
#print(total) | 13.777778 | 24 | 0.564516 | true | true | |
f7323f11dbc39df24cc3c39879fb06935d88ff17 | 2,454 | py | Python | fixtures/createJson.py | AKSHANSH47/crowdsource-platform2 | a31446d44bc10dca56a0d534cab226947a6bbb4e | [
"MIT"
] | null | null | null | fixtures/createJson.py | AKSHANSH47/crowdsource-platform2 | a31446d44bc10dca56a0d534cab226947a6bbb4e | [
"MIT"
] | null | null | null | fixtures/createJson.py | AKSHANSH47/crowdsource-platform2 | a31446d44bc10dca56a0d534cab226947a6bbb4e | [
"MIT"
] | 2 | 2020-01-27T05:35:50.000Z | 2020-02-29T12:55:39.000Z | __author__ = 'Megha'
# Script to transfer csv containing data about various models to json
# Input csv file constituting of the model data
# Output json file representing the csv data as json object
# Assumes model name to be first line
# Field names of the model on the second line
# Data seperated by __DELIM__
# Examp... | 37.181818 | 106 | 0.707416 | __author__ = 'Megha'
import numpy as np
import pandas as pd
import json as json
__MODULE_NAME__ = 7
__INPUT_FILE__ = 'meghaWorkerData.csv'
__OUTPUT_FILE__ = 'meghaWorkerData.json'
__NEWLINE__ = '\n'
__KEY1__ = 0
__KEY2__ = 0
__DELIM__ = ','
__APPEND__ = 'crowdsourcing.'
__KEY_MODEL__ = 'model'
__KEY_FIEL... | true | true |
f73241d287661520cf1d7ff6db55cdc259ea7d50 | 1,170 | py | Python | python_modules/supersense_list.py | cltl/MFS_classifier | ef3ea52f23aebe798241057046d4b49f181328f3 | [
"Apache-2.0"
] | 2 | 2016-08-12T05:11:36.000Z | 2020-09-20T09:23:28.000Z | python_modules/supersense_list.py | cltl/MFS_classifier | ef3ea52f23aebe798241057046d4b49f181328f3 | [
"Apache-2.0"
] | null | null | null | python_modules/supersense_list.py | cltl/MFS_classifier | ef3ea52f23aebe798241057046d4b49f181328f3 | [
"Apache-2.0"
] | null | null | null | SS = {}
SS['00'] = 'adj.all'
SS['01'] = 'adj.pert'
SS['02'] = 'adv.all'
SS['03'] = 'noun.Tops'
SS['04'] = 'noun.act'
SS['05'] = 'noun.animal'
SS['06'] = 'noun.artifact'
SS['07'] = 'noun.attribute'
SS['08'] = 'noun.body'
SS['09'] = 'noun.cognition'
SS['10'] = 'noun.communication'
SS['11'] = 'noun.event'
SS['12'] = 'noun... | 23.877551 | 31 | 0.570085 | SS = {}
SS['00'] = 'adj.all'
SS['01'] = 'adj.pert'
SS['02'] = 'adv.all'
SS['03'] = 'noun.Tops'
SS['04'] = 'noun.act'
SS['05'] = 'noun.animal'
SS['06'] = 'noun.artifact'
SS['07'] = 'noun.attribute'
SS['08'] = 'noun.body'
SS['09'] = 'noun.cognition'
SS['10'] = 'noun.communication'
SS['11'] = 'noun.event'
SS['12'] = 'noun... | true | true |
f73242295fa78051db57900a4402d3561b804f9b | 3,229 | py | Python | sport/solutions/cf/1196 div3/1196B-4.py | Epikem/dev-tips | ed5a258334dd18ef505f51e320f7a9f5ee535cf9 | [
"MIT"
] | null | null | null | sport/solutions/cf/1196 div3/1196B-4.py | Epikem/dev-tips | ed5a258334dd18ef505f51e320f7a9f5ee535cf9 | [
"MIT"
] | 8 | 2020-04-03T15:33:54.000Z | 2022-03-02T10:24:22.000Z | sport/solutions/cf/1196 div3/1196B-4.py | Epikem/dev-tips | ed5a258334dd18ef505f51e320f7a9f5ee535cf9 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
#!/usr/bin/python
false = False
true = True
null = None
# import math
TEST = false
try:
import sys
for arg in sys.argv:
if(arg == 'test'):
print('test mode')
TEST = True
pass
except:
pass
def AddImports(libraryNames):
for... | 23.918519 | 175 | 0.482502 |
false = False
true = True
null = None
TEST = false
try:
import sys
for arg in sys.argv:
if(arg == 'test'):
print('test mode')
TEST = True
pass
except:
pass
def AddImports(libraryNames):
for libname in libraryNames:
if (type(libname) == ... | true | true |
f7324374f56ad89ad7d856e2040b3f5fad0425c3 | 46,804 | py | Python | venv/lib/python3.7/site-packages/ccxt/okcoinusd.py | balibou/ccxt-ohlcv-fetcher | a64cd43cbfd3fe09de34d8a66416ecc6c10d3b2f | [
"MIT"
] | 2 | 2020-12-17T16:07:27.000Z | 2021-02-10T18:25:41.000Z | venv/lib/python3.7/site-packages/ccxt/okcoinusd.py | balibou/ccxt-ohlcv-fetcher | a64cd43cbfd3fe09de34d8a66416ecc6c10d3b2f | [
"MIT"
] | null | null | null | venv/lib/python3.7/site-packages/ccxt/okcoinusd.py | balibou/ccxt-ohlcv-fetcher | a64cd43cbfd3fe09de34d8a66416ecc6c10d3b2f | [
"MIT"
] | 1 | 2020-03-29T02:05:41.000Z | 2020-03-29T02:05:41.000Z | # -*- coding: utf-8 -*-
# PLEASE DO NOT EDIT THIS FILE, IT IS GENERATED AND WILL BE OVERWRITTEN:
# https://github.com/ccxt/ccxt/blob/master/CONTRIBUTING.md#how-to-contribute-code
from ccxt.base.exchange import Exchange
import math
from ccxt.base.errors import ExchangeError
from ccxt.base.errors import AuthenticationE... | 45.396702 | 381 | 0.510512 |
ge import Exchange
import math
from ccxt.base.errors import ExchangeError
from ccxt.base.errors import AuthenticationError
from ccxt.base.errors import ArgumentsRequired
from ccxt.base.errors import BadRequest
from ccxt.base.errors import InsufficientFunds
from ccxt.base.errors import InvalidOrder
from ccxt.base.err... | true | true |
f73244177849f7ecbf3d99cbfddf1b55449d8ed5 | 1,805 | py | Python | days/day8.py | vanHavel/AdventOfCode2021 | a83ee21cffff56ba3f49de7af5113bf0b11fea7a | [
"MIT"
] | null | null | null | days/day8.py | vanHavel/AdventOfCode2021 | a83ee21cffff56ba3f49de7af5113bf0b11fea7a | [
"MIT"
] | null | null | null | days/day8.py | vanHavel/AdventOfCode2021 | a83ee21cffff56ba3f49de7af5113bf0b11fea7a | [
"MIT"
] | null | null | null | import itertools
from aocd import get_data, submit
DAY = 8
YEAR = 2021
def part1(data: str) -> str:
lines = data.splitlines()
ans = 0
for line in lines:
left, right = line.split('|')
segments = left.split(' ')
code = right.split(' ')
for item in code:
if len(it... | 30.59322 | 152 | 0.491967 | import itertools
from aocd import get_data, submit
DAY = 8
YEAR = 2021
def part1(data: str) -> str:
lines = data.splitlines()
ans = 0
for line in lines:
left, right = line.split('|')
segments = left.split(' ')
code = right.split(' ')
for item in code:
if len(it... | true | true |
f7324580edafa22a20c02c94b053cf9a702a9918 | 6,782 | py | Python | src/network-manager/azext_network_manager/vendored_sdks/operations/_network_manager_deployment_status_operations.py | haroonf/azure-cli-extensions | 61c044d34c224372f186934fa7c9313f1cd3a525 | [
"MIT"
] | null | null | null | src/network-manager/azext_network_manager/vendored_sdks/operations/_network_manager_deployment_status_operations.py | haroonf/azure-cli-extensions | 61c044d34c224372f186934fa7c9313f1cd3a525 | [
"MIT"
] | 9 | 2022-03-25T19:35:49.000Z | 2022-03-31T06:09:47.000Z | src/network-manager/azext_network_manager/vendored_sdks/operations/_network_manager_deployment_status_operations.py | haroonf/azure-cli-extensions | 61c044d34c224372f186934fa7c9313f1cd3a525 | [
"MIT"
] | 1 | 2022-03-10T22:13:02.000Z | 2022-03-10T22:13:02.000Z | # pylint: disable=too-many-lines
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRe... | 43.197452 | 226 | 0.69537 |
from typing import Any, Callable, Dict, Optional, TypeVar
from msrest import Serializer
from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error
from azure.core.pipeline import PipelineResponse
from azure.core.pipeline.transport impo... | true | true |
f732469f36d304c9834025f63e03b387b2c8a05a | 4,386 | py | Python | src/train.py | convergence-lab/covid19-detection | 6a57e87ec1d8688712e6170a4c3aafb6e113ca73 | [
"Apache-2.0"
] | 3 | 2020-04-24T12:55:58.000Z | 2020-07-05T22:02:36.000Z | src/train.py | convergence-lab/covid19-detection | 6a57e87ec1d8688712e6170a4c3aafb6e113ca73 | [
"Apache-2.0"
] | null | null | null | src/train.py | convergence-lab/covid19-detection | 6a57e87ec1d8688712e6170a4c3aafb6e113ca73 | [
"Apache-2.0"
] | null | null | null | import toml
from sklearn.model_selection import train_test_split
from sklearn.metrics import accuracy_score, f1_score, roc_auc_score
from logzero import logger
import torch
from torch import nn, optim
from torch.utils.data import DataLoader
from torchvision import transforms
from model import Model
from data import l... | 37.810345 | 168 | 0.628363 | import toml
from sklearn.model_selection import train_test_split
from sklearn.metrics import accuracy_score, f1_score, roc_auc_score
from logzero import logger
import torch
from torch import nn, optim
from torch.utils.data import DataLoader
from torchvision import transforms
from model import Model
from data import l... | true | true |
f73246b8b79ad99643dd8a62e8dbfdb9e865ba77 | 2,837 | py | Python | tests/test_cli.py | dewancse/csimpy | 58c32e40e5d991b4ca98df05e6f61020def475a9 | [
"Apache-2.0"
] | null | null | null | tests/test_cli.py | dewancse/csimpy | 58c32e40e5d991b4ca98df05e6f61020def475a9 | [
"Apache-2.0"
] | null | null | null | tests/test_cli.py | dewancse/csimpy | 58c32e40e5d991b4ca98df05e6f61020def475a9 | [
"Apache-2.0"
] | 1 | 2020-08-21T02:32:57.000Z | 2020-08-21T02:32:57.000Z | from csimpy import __main__
import csimpy
import os
import shutil
import tempfile
import unittest
class CliTestCase(unittest.TestCase):
EXAMPLE_SEDML_FILENAME = 'tests/fixtures/sine_imports.xml'
def setUp(self):
self.dirname = tempfile.mkdtemp()
def tearDown(self):
shutil.rmtree(self.dir... | 42.343284 | 137 | 0.621431 | from csimpy import __main__
import csimpy
import os
import shutil
import tempfile
import unittest
class CliTestCase(unittest.TestCase):
EXAMPLE_SEDML_FILENAME = 'tests/fixtures/sine_imports.xml'
def setUp(self):
self.dirname = tempfile.mkdtemp()
def tearDown(self):
shutil.rmtree(self.dir... | true | true |
f73247e50e5c0c5c07af1f4e8737b690accc78c9 | 8,242 | py | Python | contrib/devtools/security-check.py | PaulieD/dash | 5be0935889a4faadf12793bb81f4da05eee9818f | [
"MIT"
] | null | null | null | contrib/devtools/security-check.py | PaulieD/dash | 5be0935889a4faadf12793bb81f4da05eee9818f | [
"MIT"
] | 14 | 2021-07-16T00:54:07.000Z | 2022-01-04T20:56:20.000Z | contrib/devtools/security-check.py | PaulieD/dash | 5be0935889a4faadf12793bb81f4da05eee9818f | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) 2015-2016 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
'''
Perform basic ELF security checks on a series of executables.
Exit status will be 0 if successful, and... | 38.157407 | 167 | 0.639044 |
import subprocess
import sys
import os
READELF_CMD = os.getenv('READELF', '/usr/bin/readelf')
OBJDUMP_CMD = os.getenv('OBJDUMP', '/usr/bin/objdump')
NONFATAL = {}
def check_ELF_PIE(executable):
p = subprocess.Popen([READELF_CMD, '-h', '-W', executable], stdout=subprocess.PIPE, stderr=subprocess.PIPE, stdin=s... | true | true |
f7324802c626b3c05b5f37a799a82b7a683fbb30 | 919 | py | Python | soupy/utils/vector2function.py | cpempire/soupy | 9f65e3329fa126619c893daa4cd80478d83f840c | [
"MIT"
] | 1 | 2021-12-07T15:22:23.000Z | 2021-12-07T15:22:23.000Z | soupy/utils/vector2function.py | cpempire/soupy | 9f65e3329fa126619c893daa4cd80478d83f840c | [
"MIT"
] | null | null | null | soupy/utils/vector2function.py | cpempire/soupy | 9f65e3329fa126619c893daa4cd80478d83f840c | [
"MIT"
] | null | null | null | # Copyright (c) 2016, The University of Texas at Austin & University of
# California, Merced.
#
# All Rights reserved.
# See file COPYRIGHT for details.
#
# This file is part of the hIPPYlib library. For more information and source code
# availability see https://hippylib.github.io.
#
# hIPPYlib is free software; you c... | 32.821429 | 95 | 0.733406 |
from __future__ import absolute_import, division, print_function
from dolfin import Function
def vector2Function(x,Vh, **kwargs):
fun = Function(Vh,**kwargs)
fun.vector().zero()
fun.vector().axpy(1., x)
return fun
| true | true |
f732485708d463cf7bbae78662a8c0acf679efce | 1,010 | py | Python | testing/CinemaRenderTest.py | JonasLukasczyk/workbench | 4a59faeb181185bc57d8bce605bdd1f0bfe4fe42 | [
"BSD-3-Clause"
] | null | null | null | testing/CinemaRenderTest.py | JonasLukasczyk/workbench | 4a59faeb181185bc57d8bce605bdd1f0bfe4fe42 | [
"BSD-3-Clause"
] | null | null | null | testing/CinemaRenderTest.py | JonasLukasczyk/workbench | 4a59faeb181185bc57d8bce605bdd1f0bfe4fe42 | [
"BSD-3-Clause"
] | null | null | null | import pytest
import pytest_xvfb
import os
import cinemasci
@pytest.fixture(autouse=True, scope='session')
def ensure_xvfb():
if not pytest_xvfb.xvfb_available():
raise Exception("Tests need Xvfb to run.")
def test_render():
# create a test database
os.system("./bin/create-database --database scratch/cine... | 28.055556 | 74 | 0.723762 | import pytest
import pytest_xvfb
import os
import cinemasci
@pytest.fixture(autouse=True, scope='session')
def ensure_xvfb():
if not pytest_xvfb.xvfb_available():
raise Exception("Tests need Xvfb to run.")
def test_render():
os.system("./bin/create-database --database scratch/cinema.cdb")
cdb = cin... | true | true |
f73248e41a1991164ec0c0c4fe0a9e0935251679 | 2,181 | py | Python | tests/test_local_storage.py | parikshitsaikia1619/pqai-db | bf550448fee3c2ca766cbdaf6ef8a1ccb613004e | [
"MIT"
] | 3 | 2022-01-18T04:44:13.000Z | 2022-03-29T19:10:48.000Z | tests/test_local_storage.py | parikshitsaikia1619/pqai-db | bf550448fee3c2ca766cbdaf6ef8a1ccb613004e | [
"MIT"
] | 4 | 2022-01-14T19:32:24.000Z | 2022-03-28T15:15:32.000Z | tests/test_local_storage.py | parikshitsaikia1619/pqai-db | bf550448fee3c2ca766cbdaf6ef8a1ccb613004e | [
"MIT"
] | 2 | 2022-01-31T18:54:37.000Z | 2022-03-25T14:42:43.000Z | """
Unit test for custom wrapper around local storage
"""
import unittest
import sys
import json
from pathlib import Path
BASE_DIR = Path(__file__).parent.parent
sys.path.append(str(BASE_DIR.resolve()))
#pylint: disable=wrong-import-position
from core.local_storage_wrapper import LocalStorage
import testutil
class ... | 27.961538 | 79 | 0.657038 | import unittest
import sys
import json
from pathlib import Path
BASE_DIR = Path(__file__).parent.parent
sys.path.append(str(BASE_DIR.resolve()))
from core.local_storage_wrapper import LocalStorage
import testutil
class TestLocalStorage(unittest.TestCase):
def setUp(self):
root = testutil.set_up_test_... | true | true |
f7324aefd9332ce661a8bd4ef6f4f2249ee510e7 | 13,225 | py | Python | trains/backend_config/config.py | MatthewYee92/trains | f5f13658c335250165d9c57c0ba30abffdda4171 | [
"Apache-2.0"
] | 1 | 2021-05-06T13:33:36.000Z | 2021-05-06T13:33:36.000Z | trains/backend_config/config.py | iridiumblue/trains | 101e5393d1ba73462a6a85df55a2dfb4b629cb0d | [
"Apache-2.0"
] | 4 | 2020-09-26T00:55:57.000Z | 2022-02-10T01:18:20.000Z | trains/backend_config/config.py | iridiumblue/trains | 101e5393d1ba73462a6a85df55a2dfb4b629cb0d | [
"Apache-2.0"
] | null | null | null | from __future__ import print_function
import functools
import json
import os
import sys
import warnings
from fnmatch import fnmatch
from os.path import expanduser
from typing import Any
import six
from pathlib2 import Path
from ..utilities.pyhocon import ConfigTree, ConfigFactory
from pyparsing import (
ParseFata... | 32.256098 | 123 | 0.569603 | from __future__ import print_function
import functools
import json
import os
import sys
import warnings
from fnmatch import fnmatch
from os.path import expanduser
from typing import Any
import six
from pathlib2 import Path
from ..utilities.pyhocon import ConfigTree, ConfigFactory
from pyparsing import (
ParseFata... | true | true |
f7324e9d85c6b26f3d0e35e8b0a6ac93397d49bb | 1,086 | py | Python | alipay/aop/api/response/AlipayMsaasMediarecogAftscvpayTransactionInitializeResponse.py | snowxmas/alipay-sdk-python-all | 96870ced60facd96c5bce18d19371720cbda3317 | [
"Apache-2.0"
] | 213 | 2018-08-27T16:49:32.000Z | 2021-12-29T04:34:12.000Z | alipay/aop/api/response/AlipayMsaasMediarecogAftscvpayTransactionInitializeResponse.py | snowxmas/alipay-sdk-python-all | 96870ced60facd96c5bce18d19371720cbda3317 | [
"Apache-2.0"
] | 29 | 2018-09-29T06:43:00.000Z | 2021-09-02T03:27:32.000Z | alipay/aop/api/response/AlipayMsaasMediarecogAftscvpayTransactionInitializeResponse.py | snowxmas/alipay-sdk-python-all | 96870ced60facd96c5bce18d19371720cbda3317 | [
"Apache-2.0"
] | 59 | 2018-08-27T16:59:26.000Z | 2022-03-25T10:08:15.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
from alipay.aop.api.response.AlipayResponse import AlipayResponse
class AlipayMsaasMediarecogAftscvpayTransactionInitializeResponse(AlipayResponse):
def __init__(self):
super(AlipayMsaasMediarecogAftscvpayTransactionInitializeResponse, self).__in... | 30.166667 | 132 | 0.713628 |
import json
from alipay.aop.api.response.AlipayResponse import AlipayResponse
class AlipayMsaasMediarecogAftscvpayTransactionInitializeResponse(AlipayResponse):
def __init__(self):
super(AlipayMsaasMediarecogAftscvpayTransactionInitializeResponse, self).__init__()
self._result = None
s... | true | true |
f7324ff40cd974939b80147b034871e58952ecc3 | 1,329 | py | Python | dvd540crop.py | tai271828/session-video-publisher | 7c3ea170759e53b94345e655a1299ba9ab32158c | [
"0BSD"
] | null | null | null | dvd540crop.py | tai271828/session-video-publisher | 7c3ea170759e53b94345e655a1299ba9ab32158c | [
"0BSD"
] | 5 | 2020-11-15T12:45:03.000Z | 2021-12-07T08:29:40.000Z | dvd540crop.py | tai271828/session-video-publisher | 7c3ea170759e53b94345e655a1299ba9ab32158c | [
"0BSD"
] | 4 | 2018-06-23T16:48:03.000Z | 2021-04-18T09:51:29.000Z | """Crop letterbox from videos fixed by dvd540fix.
This assumes the input video is of dimension 720x540.
Example usage:
python dvd540crop.py 自製高擴充性機器學習系統 --height=480 --top=40
"""
import argparse
import os
import pathlib
import subprocess
i_dir = pathlib.Path(os.environ["VIDEO_ROOT"], "in")
o_dir = pathlib.Pat... | 23.732143 | 71 | 0.696764 |
import argparse
import os
import pathlib
import subprocess
i_dir = pathlib.Path(os.environ["VIDEO_ROOT"], "in")
o_dir = pathlib.Path(os.environ["VIDEO_ROOT"], "out")
o_dir.mkdir(parents=True, exist_ok=True)
input_mapping = {i_path.stem: i_path for i_path in i_dir.glob("*.avi")}
parser = argparse.ArgumentParser()... | true | true |
f73250a01c56694962e8ffc0fb3a96d714bf4401 | 1,598 | py | Python | mytreeview.py | xiaoyaofe/bale-backstage | 6d1955e7a6038c9588f86530cd4519e0f719f285 | [
"MIT"
] | null | null | null | mytreeview.py | xiaoyaofe/bale-backstage | 6d1955e7a6038c9588f86530cd4519e0f719f285 | [
"MIT"
] | null | null | null | mytreeview.py | xiaoyaofe/bale-backstage | 6d1955e7a6038c9588f86530cd4519e0f719f285 | [
"MIT"
] | null | null | null | from tkinter import *
from tkinter import ttk
class MyTreeview(Frame):
def __init__(self, master):
super().__init__(master)
self.treeview = ttk.Treeview(self)
# attach a vertical scrollbar to the frame
verbar = ttk.Scrollbar(self, orient='vertical')
verbar.pack(side = 'righ... | 36.318182 | 99 | 0.614518 | from tkinter import *
from tkinter import ttk
class MyTreeview(Frame):
def __init__(self, master):
super().__init__(master)
self.treeview = ttk.Treeview(self)
verbar = ttk.Scrollbar(self, orient='vertical')
verbar.pack(side = 'right', fill = 'y')
verbar.configure(c... | true | true |
f73251238eb97dd177c8621e70d07e8df4721a2a | 629 | py | Python | dashboard/manage.py | hebergui/webtrade | 338fbf334b6ba173296635b380b53b088a87bb95 | [
"Apache-2.0"
] | 9 | 2019-11-13T18:05:51.000Z | 2021-05-05T16:04:35.000Z | dashboard/manage.py | hebergui/webtrade | 338fbf334b6ba173296635b380b53b088a87bb95 | [
"Apache-2.0"
] | 9 | 2019-12-04T23:50:52.000Z | 2022-02-10T12:02:50.000Z | dashboard/manage.py | hebergui/webtrade | 338fbf334b6ba173296635b380b53b088a87bb95 | [
"Apache-2.0"
] | 7 | 2020-04-19T17:34:58.000Z | 2021-12-25T22:09:33.000Z | #!/usr/bin/env python
"""Django's command-line utility for administrative tasks."""
import os
import sys
def main():
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'dashboard.settings')
try:
from django.core.management import execute_from_command_line
except ImportError as exc:
raise Impo... | 28.590909 | 73 | 0.683625 |
import os
import sys
def main():
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'dashboard.settings')
try:
from django.core.management import execute_from_command_line
except ImportError as exc:
raise ImportError(
"Couldn't import Django. Are you sure it's installed and "
... | true | true |
f73251bfb4f2a7f1536890502a96d262792a3c60 | 602 | py | Python | baseline/baseline_classifier.py | HLTCHKUST/emotion-dialogue | 0d58b339134dd9a2f386948ae474b270a77370f9 | [
"MIT"
] | 40 | 2019-04-29T09:17:48.000Z | 2021-11-19T06:32:02.000Z | baseline/baseline_classifier.py | HLTCHKUST/emotion-dialogue | 0d58b339134dd9a2f386948ae474b270a77370f9 | [
"MIT"
] | null | null | null | baseline/baseline_classifier.py | HLTCHKUST/emotion-dialogue | 0d58b339134dd9a2f386948ae474b270a77370f9 | [
"MIT"
] | 4 | 2019-09-01T10:00:56.000Z | 2020-03-08T16:00:22.000Z | from utils import constant
from sklearn import svm
from sklearn.svm import SVC
from sklearn.linear_model import LogisticRegression
from xgboost import XGBClassifier
def get_classifier(ty="LR", c=1.0, max_depth=5, n_estimators=300, gamma=0):
if(ty=="LR"):
classifier = LogisticRegression(solver='lbfgs',mult... | 40.133333 | 148 | 0.727575 | from utils import constant
from sklearn import svm
from sklearn.svm import SVC
from sklearn.linear_model import LogisticRegression
from xgboost import XGBClassifier
def get_classifier(ty="LR", c=1.0, max_depth=5, n_estimators=300, gamma=0):
if(ty=="LR"):
classifier = LogisticRegression(solver='lbfgs',mult... | true | true |
f732535face63b7bf467ecb42cb63a898b1c32f2 | 446 | py | Python | SideProjectsPython/quadratic.py | EthanLawr/ComputerScience | 5edb37c05023f3cd0d4160bcc480c3d2fdabc3a8 | [
"Apache-2.0"
] | 2 | 2021-08-21T17:40:07.000Z | 2021-11-08T10:37:25.000Z | SideProjectsPython/quadratic.py | EthanLawr/ComputerScience | 5edb37c05023f3cd0d4160bcc480c3d2fdabc3a8 | [
"Apache-2.0"
] | 1 | 2017-12-11T16:08:15.000Z | 2017-12-11T16:08:15.000Z | SideProjectsPython/quadratic.py | EthanLawr/ComputerScience | 5edb37c05023f3cd0d4160bcc480c3d2fdabc3a8 | [
"Apache-2.0"
] | null | null | null | import math
num1 = int(input("Enter a:"))
num2 = int(input("Enter b:"))
num3 = int(input("Enter c:"))
result1 = (-num2 + math.sqrt(num2**2 - 4 * (num1) * (num3)))
result2 = (result1 / (2 * num1))
print("Positive: ")
print(result2)
print("-------------------------------------------------------------")
print("Ne... | 29.733333 | 71 | 0.5 | import math
num1 = int(input("Enter a:"))
num2 = int(input("Enter b:"))
num3 = int(input("Enter c:"))
result1 = (-num2 + math.sqrt(num2**2 - 4 * (num1) * (num3)))
result2 = (result1 / (2 * num1))
print("Positive: ")
print(result2)
print("-------------------------------------------------------------")
print("Ne... | true | true |
f73253d8f8ec0e7ce8cc0868d1b80b62f06e7512 | 3,697 | py | Python | apps/portalbase/system/system__usermanager/methodclass/system_usermanager.gen.py | jumpscale7/jumpscale_portal | 8c99265e48f85643f8a52bc40a23f5266fb09231 | [
"Apache-2.0"
] | 2 | 2016-04-14T14:05:01.000Z | 2016-04-21T07:20:36.000Z | apps/portalbase/system/system__usermanager/methodclass/system_usermanager.gen.py | jumpscale7/jumpscale_portal | 8c99265e48f85643f8a52bc40a23f5266fb09231 | [
"Apache-2.0"
] | 13 | 2016-03-07T12:07:15.000Z | 2018-02-28T13:11:59.000Z | apps/portalbase/system/system__usermanager/methodclass/system_usermanager.gen.py | jumpscale7/jumpscale_portal | 8c99265e48f85643f8a52bc40a23f5266fb09231 | [
"Apache-2.0"
] | 5 | 2016-03-08T07:49:51.000Z | 2018-10-19T13:57:04.000Z | from JumpScale import j
class system_usermanager(j.code.classGetBase()):
"""
get a user
"""
def __init__(self):
pass
self._te={}
self.actorname="usermanager"
self.appname="system"
#system_usermanager_osis.__init__(self)
def authenticate(self, name,... | 32.147826 | 85 | 0.621315 | from JumpScale import j
class system_usermanager(j.code.classGetBase()):
def __init__(self):
pass
self._te={}
self.actorname="usermanager"
self.appname="system"
def authenticate(self, name, secret, **kwargs):
raise NotImplementedError ("not i... | true | true |
f73253edbec788340fa63d923f7d8dd39807876f | 24,052 | py | Python | research/syntaxnet/dragnn/python/transformer_units.py | vincentcheny/models | afb1a59fc1bc792ac72d1a3e22e2469020529788 | [
"Apache-2.0"
] | 1 | 2019-09-11T09:41:11.000Z | 2019-09-11T09:41:11.000Z | research/syntaxnet/dragnn/python/transformer_units.py | vincentcheny/models | afb1a59fc1bc792ac72d1a3e22e2469020529788 | [
"Apache-2.0"
] | null | null | null | research/syntaxnet/dragnn/python/transformer_units.py | vincentcheny/models | afb1a59fc1bc792ac72d1a3e22e2469020529788 | [
"Apache-2.0"
] | null | null | null | # Copyright 2017 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable ... | 41.11453 | 81 | 0.61866 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import numpy as np
import tensorflow as tf
from dragnn.python import network_units
def add_timing_signal_1d(x, min_timescale=1.0, max_timescale=1.0e4):
length = tf.shape(x)[1]
... | true | true |
f732540c032f69259ef86b76fd0153508799d6e2 | 4,475 | py | Python | scripts/grid_search.py | shamirtowsif/soft_patterns | bd0b3d4cb46e49ad36f39b3a1d6f369da7e8ad6e | [
"MIT"
] | 58 | 2018-05-17T03:48:05.000Z | 2020-12-20T20:39:55.000Z | scripts/grid_search.py | shamirtowsif/soft_patterns | bd0b3d4cb46e49ad36f39b3a1d6f369da7e8ad6e | [
"MIT"
] | 5 | 2018-05-17T01:58:08.000Z | 2020-12-16T18:38:05.000Z | scripts/grid_search.py | shamirtowsif/soft_patterns | bd0b3d4cb46e49ad36f39b3a1d6f369da7e8ad6e | [
"MIT"
] | 10 | 2018-06-08T20:18:20.000Z | 2021-06-06T17:44:38.000Z | #!/usr/bin/env python
import sys
import os
import os.path
import copy
import subprocess
from operator import mul
from random import shuffle
from operator import mul
from functools import reduce
dirs=['stanford_sentiment_binary', 'amazon_reviews', 'ROC_stories', 'stanford_sentiment_binary_100',
'stanford_sentimen... | 31.076389 | 132 | 0.667486 |
import sys
import os
import os.path
import copy
import subprocess
from operator import mul
from random import shuffle
from operator import mul
from functools import reduce
dirs=['stanford_sentiment_binary', 'amazon_reviews', 'ROC_stories', 'stanford_sentiment_binary_100',
'stanford_sentiment_binary_500', 'stanfo... | true | true |
f732550aa5d382fb0ee404be3464702f9e7a57b7 | 2,722 | py | Python | examples/node_classification.py | dedsec-9/AutoGL | 487f2b2f798b9b1363ad5dc100fb410b12222e06 | [
"MIT"
] | null | null | null | examples/node_classification.py | dedsec-9/AutoGL | 487f2b2f798b9b1363ad5dc100fb410b12222e06 | [
"MIT"
] | null | null | null | examples/node_classification.py | dedsec-9/AutoGL | 487f2b2f798b9b1363ad5dc100fb410b12222e06 | [
"MIT"
] | null | null | null | import yaml
import random
import torch.backends.cudnn
import numpy as np
from autogl.datasets import build_dataset_from_name
from autogl.solver import AutoNodeClassifier
from autogl.module import Acc
from autogl.backend import DependentBackend
if __name__ == "__main__":
from argparse import ArgumentParser, Argume... | 32.404762 | 81 | 0.64144 | import yaml
import random
import torch.backends.cudnn
import numpy as np
from autogl.datasets import build_dataset_from_name
from autogl.solver import AutoNodeClassifier
from autogl.module import Acc
from autogl.backend import DependentBackend
if __name__ == "__main__":
from argparse import ArgumentParser, Argume... | true | true |
f732557435b6dc4f0046e12a67a471a54ffca701 | 982 | py | Python | mysite/mysite/urls.py | BAXTOR95/blog_project | a167c9f63a33a5075a001de29720a58624fd1636 | [
"MIT"
] | 1 | 2021-03-30T07:51:30.000Z | 2021-03-30T07:51:30.000Z | mysite/mysite/urls.py | BAXTOR95/blog_project | a167c9f63a33a5075a001de29720a58624fd1636 | [
"MIT"
] | null | null | null | mysite/mysite/urls.py | BAXTOR95/blog_project | a167c9f63a33a5075a001de29720a58624fd1636 | [
"MIT"
] | 1 | 2021-01-16T13:48:39.000Z | 2021-01-16T13:48:39.000Z | """mysite URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/2.0/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')
Class-based ... | 36.37037 | 77 | 0.690428 | from django.contrib import admin
from django.urls import path, include
from django.contrib.auth import views
urlpatterns = [
path('admin/', admin.site.urls),
path('', include('blog.urls')),
path('accounts/login/', views.login, name='login'),
path('accounts/logout/', views.logout,
name='logout'... | true | true |
f73255f453208be5b49bcb21a383512d9ef8a752 | 6,524 | py | Python | rasa/engine/training/components.py | Next-Trends/rasa | c06dc26b3a57dd1114b60aebcc9ccd3bbb8308d7 | [
"Apache-2.0"
] | 3,603 | 2017-05-21T18:34:55.000Z | 2019-04-16T11:58:09.000Z | rasa/engine/training/components.py | Next-Trends/rasa | c06dc26b3a57dd1114b60aebcc9ccd3bbb8308d7 | [
"Apache-2.0"
] | 2,782 | 2017-05-21T20:36:15.000Z | 2019-04-16T14:35:20.000Z | rasa/engine/training/components.py | Next-Trends/rasa | c06dc26b3a57dd1114b60aebcc9ccd3bbb8308d7 | [
"Apache-2.0"
] | 1,337 | 2017-05-21T18:10:33.000Z | 2019-04-16T09:14:42.000Z | from __future__ import annotations
from typing import Any, Dict, Optional, Text, Type
import dataclasses
import uuid
from rasa.engine.caching import Cacheable, TrainingCache
from rasa.engine.graph import ExecutionContext, GraphComponent, SchemaNode
from rasa.engine.storage.resource import Resource
from rasa.engine.sto... | 36.858757 | 88 | 0.667689 | from __future__ import annotations
from typing import Any, Dict, Optional, Text, Type
import dataclasses
import uuid
from rasa.engine.caching import Cacheable, TrainingCache
from rasa.engine.graph import ExecutionContext, GraphComponent, SchemaNode
from rasa.engine.storage.resource import Resource
from rasa.engine.sto... | true | true |
f732568bc73bb8b78f184a2659fa83180b3c902d | 367 | py | Python | 10420/10420.py | Keilan/uva | 4218328466c3ab2fdf34cdf45fc7a8dea90964bc | [
"MIT"
] | null | null | null | 10420/10420.py | Keilan/uva | 4218328466c3ab2fdf34cdf45fc7a8dea90964bc | [
"MIT"
] | null | null | null | 10420/10420.py | Keilan/uva | 4218328466c3ab2fdf34cdf45fc7a8dea90964bc | [
"MIT"
] | null | null | null | import sys
n = int(sys.stdin.readline())
countries = {}
for _ in range(n):
country = sys.stdin.readline().split()[0]
#Add to the current value (or 0 if not present)
countries[country] = countries.get(country, 0) + 1
#Order keys alphabetically
keys = sorted(countries.keys())
for k in key... | 20.388889 | 55 | 0.623978 | import sys
n = int(sys.stdin.readline())
countries = {}
for _ in range(n):
country = sys.stdin.readline().split()[0]
countries[country] = countries.get(country, 0) + 1
keys = sorted(countries.keys())
for k in keys:
print('{} {}'.format(k,countries[k]))
| true | true |
f73256e3b561a6f89abbc2dc5ccfdde8a6475f77 | 1,135 | py | Python | portia_server/portia_dashboard/tasks.py | rmdes/portia-dashboard | 97e698c7232c15eff47d20fd3529251bbd284226 | [
"BSD-3-Clause"
] | 223 | 2018-01-22T07:43:58.000Z | 2022-03-25T12:52:30.000Z | portia_server/portia_dashboard/tasks.py | rmdes/portia-dashboard | 97e698c7232c15eff47d20fd3529251bbd284226 | [
"BSD-3-Clause"
] | 9 | 2018-03-17T15:16:26.000Z | 2019-11-11T09:35:04.000Z | portia_server/portia_dashboard/tasks.py | rmdes/portia-dashboard | 97e698c7232c15eff47d20fd3529251bbd284226 | [
"BSD-3-Clause"
] | 76 | 2018-01-22T04:20:00.000Z | 2021-11-13T09:53:26.000Z | from __future__ import absolute_import, unicode_literals
from django.conf import settings
from .models import Schedule
from celery.task.schedules import crontab
from celery import shared_task
from celery import task
import logging
import time, datetime
import requests
logger = logging.getLogger('portia_dashboard')
... | 31.527778 | 125 | 0.663436 | from __future__ import absolute_import, unicode_literals
from django.conf import settings
from .models import Schedule
from celery.task.schedules import crontab
from celery import shared_task
from celery import task
import logging
import time, datetime
import requests
logger = logging.getLogger('portia_dashboard')
... | true | true |
f7325868460a157150006054167b4d86c914b192 | 2,535 | py | Python | setup.py | uwbmrb/PyNMRSTAR | c6e3cdccb4aa44dfbc3b4e984837a6bcde3cf171 | [
"MIT"
] | 16 | 2017-02-02T05:00:50.000Z | 2021-05-25T11:13:15.000Z | setup.py | uwbmrb/PyNMRSTAR | c6e3cdccb4aa44dfbc3b4e984837a6bcde3cf171 | [
"MIT"
] | 29 | 2016-07-14T21:02:18.000Z | 2021-06-26T17:24:07.000Z | setup.py | bmrb-io/PyNMRSTAR | 55df5bf7de192e7a6c95f37e0756f09e3f504170 | [
"MIT"
] | 4 | 2016-04-14T16:29:49.000Z | 2017-02-28T02:01:57.000Z | #!/usr/bin/env python3
import os
from setuptools import setup, Extension
def get_version():
internal_file_location = os.path.join(os.path.abspath(os.path.dirname(__file__)), 'pynmrstar', '_internal.py')
with open(internal_file_location, 'r') as internal_file:
for line in internal_file:
i... | 39.609375 | 116 | 0.586588 |
import os
from setuptools import setup, Extension
def get_version():
internal_file_location = os.path.join(os.path.abspath(os.path.dirname(__file__)), 'pynmrstar', '_internal.py')
with open(internal_file_location, 'r') as internal_file:
for line in internal_file:
if line.startswith('__v... | true | true |
f73258eae4d5169d7051cca79bea9e0c5febac33 | 20 | py | Python | upconvert/parser/t/__init__.py | lehaianh1986/schematic-file-converter | ed67274511a5b0e1b378e4e0fd3943ec8a189f43 | [
"Apache-2.0"
] | 29 | 2016-05-19T02:04:51.000Z | 2021-09-16T06:25:59.000Z | upconvert/parser/t/__init__.py | 84ace/schematic-file-converter | a5975a521d842396605c05a9f197bfe088906bb4 | [
"Apache-2.0"
] | null | null | null | upconvert/parser/t/__init__.py | 84ace/schematic-file-converter | a5975a521d842396605c05a9f197bfe088906bb4 | [
"Apache-2.0"
] | 24 | 2016-05-19T02:05:00.000Z | 2022-01-14T18:20:01.000Z | """ Parser tests """ | 20 | 20 | 0.55 | true | true | |
f732596a48cb52363db0bf4dd853807f96f22319 | 4,315 | py | Python | benchmarks/image_recognition/tensorflow_serving/inceptionv3/inference/fp32/image_recognition_benchmark.py | hekaplex/resnet_dl | fc8d4dcc0adffbe22d01d333e6cf5db955f2f011 | [
"Apache-2.0"
] | null | null | null | benchmarks/image_recognition/tensorflow_serving/inceptionv3/inference/fp32/image_recognition_benchmark.py | hekaplex/resnet_dl | fc8d4dcc0adffbe22d01d333e6cf5db955f2f011 | [
"Apache-2.0"
] | null | null | null | benchmarks/image_recognition/tensorflow_serving/inceptionv3/inference/fp32/image_recognition_benchmark.py | hekaplex/resnet_dl | fc8d4dcc0adffbe22d01d333e6cf5db955f2f011 | [
"Apache-2.0"
] | null | null | null | #
# -*- coding: utf-8 -*-
#
# Copyright (c) 2019 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requ... | 35.958333 | 112 | 0.672074 |
from __future__ import print_function
import os
import random
import grpc
import numpy as np
import sys
import tensorflow as tf
import tensorflow.compat.v1 as tf_v1
import time
from tensorflow_serving.apis import predict_pb2
from tensorflow_serving.apis import prediction_service_pb2... | true | true |
f7325b9e40c3db2e572ba5e1f7ec33a8559aa03b | 18,306 | py | Python | fattureincloud_python_sdk/model/permissions.py | fattureincloud/fattureincloud-python-sdk | f3a40fac345751014ea389680efdaef90f03bac1 | [
"MIT"
] | 2 | 2022-02-17T08:33:17.000Z | 2022-03-22T09:27:00.000Z | fattureincloud_python_sdk/model/permissions.py | fattureincloud/fattureincloud-python-sdk | f3a40fac345751014ea389680efdaef90f03bac1 | [
"MIT"
] | null | null | null | fattureincloud_python_sdk/model/permissions.py | fattureincloud/fattureincloud-python-sdk | f3a40fac345751014ea389680efdaef90f03bac1 | [
"MIT"
] | null | null | null | """
Fatture in Cloud API v2 - API Reference
Connect your software with Fatture in Cloud, the invoicing platform chosen by more than 400.000 businesses in Italy. The Fatture in Cloud API is based on REST, and makes possible to interact with the user related data prior authorization via OAuth2 protocol. # noq... | 50.709141 | 278 | 0.60106 |
import re
import sys
from fattureincloud_python_sdk.model_utils import (
ApiTypeError,
ModelComposed,
ModelNormal,
ModelSimple,
cached_property,
change_keys_js_to_python,
convert_js_args_to_python_args,
date,
datetime,
file_type,
none_type,
validate_get_composed_... | true | true |
f7325bdb93b55decc83345de041763385b298627 | 847 | py | Python | arboretum_project/arboretum_project/urls.py | m-libbrecht/django-arboretum | 11b97254ed9885b03d25d99188157c3f79a14a4f | [
"MIT"
] | null | null | null | arboretum_project/arboretum_project/urls.py | m-libbrecht/django-arboretum | 11b97254ed9885b03d25d99188157c3f79a14a4f | [
"MIT"
] | null | null | null | arboretum_project/arboretum_project/urls.py | m-libbrecht/django-arboretum | 11b97254ed9885b03d25d99188157c3f79a14a4f | [
"MIT"
] | null | null | null | """arboretum URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.8/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
Class-b... | 30.25 | 77 | 0.700118 |
from django.conf.urls import include, url
from django.contrib import admin
from demoapp.views import TreeView
urlpatterns = [
url(r'^$', TreeView.as_view(), name='home'),
url(r'^admin/', include(admin.site.urls)),
]
| true | true |
f7325c79a928bd9ff8953a9a81a3e2e12fa93031 | 855 | py | Python | python3-virtualenv/lib/python3.8/site-packages/setuptools/command/bdist_rpm.py | bbalkaransingh23888/OrientationHack | 7eae6cce1226112c000ea8a175f6dc5a82ee0ac2 | [
"MIT"
] | null | null | null | python3-virtualenv/lib/python3.8/site-packages/setuptools/command/bdist_rpm.py | bbalkaransingh23888/OrientationHack | 7eae6cce1226112c000ea8a175f6dc5a82ee0ac2 | [
"MIT"
] | null | null | null | python3-virtualenv/lib/python3.8/site-packages/setuptools/command/bdist_rpm.py | bbalkaransingh23888/OrientationHack | 7eae6cce1226112c000ea8a175f6dc5a82ee0ac2 | [
"MIT"
] | null | null | null | import distutils.command.bdist_rpm as orig
class bdist_rpm(orig.bdist_rpm):
"""
Override the default bdist_rpm behavior to do the following:
1. Run egg_info to ensure the name and version are properly calculated.
2. Always run 'install' using --single-version-externally-managed to
disable eggs... | 29.482759 | 75 | 0.617544 | import distutils.command.bdist_rpm as orig
class bdist_rpm(orig.bdist_rpm):
def run(self):
self.run_command("egg_info")
orig.bdist_rpm.run(self)
def _make_spec_file(self):
spec = orig.bdist_rpm._make_spec_file(self)
spec = [
line.replace(
... | true | true |
f7325c9bd6d6204726d8f2c239e94b0f13af7be3 | 83,032 | py | Python | purestorage/purestorage.py | kjetijor/rest-client | 43934a78e95e9719584a66189e4c4851eeb9ebaf | [
"BSD-2-Clause"
] | null | null | null | purestorage/purestorage.py | kjetijor/rest-client | 43934a78e95e9719584a66189e4c4851eeb9ebaf | [
"BSD-2-Clause"
] | null | null | null | purestorage/purestorage.py | kjetijor/rest-client | 43934a78e95e9719584a66189e4c4851eeb9ebaf | [
"BSD-2-Clause"
] | null | null | null | """
This library provides an easy way to script administration tasks for the
Pure Storage FlashArray.
When passing arguments to methods that take \*\*kwargs, the exact
parameters that can be passed can be found in the REST API guide for the
given release of Purity running on the FlashArray.
"""
import json
import req... | 32.207913 | 91 | 0.589989 |
import json
import requests
from distutils.version import LooseVersion
VERSION = "1.11.3"
class FlashArray(object):
supported_rest_versions = [
"1.11",
"1.10",
"1.9",
"1.8",
"1.7",
"1.6",
"1.5",
"1.4",
... | true | true |
f7325d5471f3864ebbc211b12867d82ff5de718c | 1,304 | py | Python | web_test/assist/selene/shared/hook.py | yashaka/selene-pytest-template | 12ed37ac5970f415c61cae50d03c62a7d31975fa | [
"MIT"
] | null | null | null | web_test/assist/selene/shared/hook.py | yashaka/selene-pytest-template | 12ed37ac5970f415c61cae50d03c62a7d31975fa | [
"MIT"
] | null | null | null | web_test/assist/selene/shared/hook.py | yashaka/selene-pytest-template | 12ed37ac5970f415c61cae50d03c62a7d31975fa | [
"MIT"
] | null | null | null | import allure
from selene.core.exceptions import TimeoutException
from selene.support.shared import browser
def attach_snapshots_on_failure(error: TimeoutException) -> Exception:
"""
An example of selene hook_wait_failure that attaches snapshots to failed test step.
It is actually might not needed,
be... | 37.257143 | 87 | 0.696319 | import allure
from selene.core.exceptions import TimeoutException
from selene.support.shared import browser
def attach_snapshots_on_failure(error: TimeoutException) -> Exception:
last_screenshot = browser.config.last_screenshot
if last_screenshot:
allure.attach.file(source=last_screenshot,
... | true | true |
f7325e38e6b3e37a43fb029d0d2a6c0bc984703c | 1,956 | py | Python | experiments/Scripts for creating plots/sac_performance_over_generations.py | arlo-lib/ARLO | 159669884044686e36e07bd1cc0948884ed7cc8d | [
"MIT"
] | null | null | null | experiments/Scripts for creating plots/sac_performance_over_generations.py | arlo-lib/ARLO | 159669884044686e36e07bd1cc0948884ed7cc8d | [
"MIT"
] | null | null | null | experiments/Scripts for creating plots/sac_performance_over_generations.py | arlo-lib/ARLO | 159669884044686e36e07bd1cc0948884ed7cc8d | [
"MIT"
] | null | null | null | import numpy as np
import matplotlib.pyplot as plt
if __name__ == '__main__':
x=np.arange(50)
y=np.array([-59.00138158129509,
-43.966695525591895,
-52.5277642686108,
-32.1793153104166,
-37.81484603001339,
-24.97787027415733,... | 33.152542 | 37 | 0.463701 | import numpy as np
import matplotlib.pyplot as plt
if __name__ == '__main__':
x=np.arange(50)
y=np.array([-59.00138158129509,
-43.966695525591895,
-52.5277642686108,
-32.1793153104166,
-37.81484603001339,
-24.97787027415733,... | true | true |
f7325e94e83568ba3af3aaa3e3f4c4a03332c471 | 1,351 | py | Python | contract.py | wxz52155/OpenFarmerOnAnchor | c089f0955cc4041818a64e01e3f13e5337ddd396 | [
"Apache-2.0"
] | null | null | null | contract.py | wxz52155/OpenFarmerOnAnchor | c089f0955cc4041818a64e01e3f13e5337ddd396 | [
"Apache-2.0"
] | null | null | null | contract.py | wxz52155/OpenFarmerOnAnchor | c089f0955cc4041818a64e01e3f13e5337ddd396 | [
"Apache-2.0"
] | 1 | 2022-01-21T04:09:52.000Z | 2022-01-21T04:09:52.000Z | import datetime as dt
from requests import HTTPError
import eospy.cleos
import eospy.keys
import pytz
from settings import user_param
def push_transaction(params_json):
# this url is to a testnet that may or may not be working.
# We suggest using a different testnet such as kylin or jungle
#
ce = eosp... | 33.775 | 83 | 0.679497 | import datetime as dt
from requests import HTTPError
import eospy.cleos
import eospy.keys
import pytz
from settings import user_param
def push_transaction(params_json):
ce = eospy.cleos.Cleos(url=user_param.rpc_domain)
arguments = params_json['actions'][0]['data']
payload = {
"acco... | true | true |
f7325f7757fea1fb00807643e7b1200d995cc928 | 2,142 | py | Python | setup.py | harrymvr/absorbing-centrality | d143e5bfe042dc863da28851448f2b811ed45c68 | [
"0BSD"
] | 19 | 2015-09-03T12:38:40.000Z | 2021-01-06T09:38:27.000Z | setup.py | harrymvr/absorbing-centrality | d143e5bfe042dc863da28851448f2b811ed45c68 | [
"0BSD"
] | 2 | 2015-09-01T15:08:14.000Z | 2015-11-16T13:38:36.000Z | setup.py | harrymvr/absorbing-centrality | d143e5bfe042dc863da28851448f2b811ed45c68 | [
"0BSD"
] | 5 | 2015-10-09T22:03:59.000Z | 2018-05-25T08:32:32.000Z | #!/usr/bin/env python
# -*- encoding: utf-8 -*-
from __future__ import absolute_import, print_function
import io
import os
import re
from glob import glob
from os.path import basename
from os.path import dirname
from os.path import join
from os.path import relpath
from os.path import splitext
from setuptools import f... | 31.970149 | 116 | 0.641457 |
from __future__ import absolute_import, print_function
import io
import os
import re
from glob import glob
from os.path import basename
from os.path import dirname
from os.path import join
from os.path import relpath
from os.path import splitext
from setuptools import find_packages
from setuptools import setup
def... | true | true |
f7325fa0e342ce06f43789c08ccef69fbef643ab | 14,935 | py | Python | src/sage/misc/memory_info.py | bopopescu/sage | 2d495be78e0bdc7a0a635454290b27bb4f5f70f0 | [
"BSL-1.0"
] | 3 | 2019-07-15T13:48:24.000Z | 2019-11-08T12:31:43.000Z | src/sage/misc/memory_info.py | bopopescu/sage | 2d495be78e0bdc7a0a635454290b27bb4f5f70f0 | [
"BSL-1.0"
] | 2 | 2018-10-30T13:40:20.000Z | 2020-07-23T12:13:30.000Z | src/sage/misc/memory_info.py | bopopescu/sage | 2d495be78e0bdc7a0a635454290b27bb4f5f70f0 | [
"BSL-1.0"
] | 7 | 2021-11-08T10:01:59.000Z | 2022-03-03T11:25:52.000Z | """
Information about available RAM/swap
There is no portable way to figure these out, nor should you generally
have to. But GAP currently needs to allocate a cache of fixed size
upon startup, and we would like a certain fraction of the swap address
space.
EXAMPLES::
sage: from sage.misc.memory_info import Memor... | 28.666027 | 108 | 0.566856 |
from sage.misc.superseded import deprecation
deprecation(21805, "the module sage.misc.memory_info is deprecated, use the psutil package instead.")
import subprocess
from sys import maxsize
from sage.structure.sage_object import SageObject
memory_info_instance = None
def MemoryInfo():
global memory_in... | true | true |
f73260433b527d8ba6321087e688077524d361a8 | 3,993 | py | Python | tests/integ/test_ntm.py | satishpasumarthi/sagemaker-python-sdk | 255a339ae985041ef47e3a80da91b9f54bca17b9 | [
"Apache-2.0"
] | 1 | 2021-12-10T16:18:29.000Z | 2021-12-10T16:18:29.000Z | tests/integ/test_ntm.py | satishpasumarthi/sagemaker-python-sdk | 255a339ae985041ef47e3a80da91b9f54bca17b9 | [
"Apache-2.0"
] | 20 | 2021-09-17T20:50:11.000Z | 2021-12-09T00:29:02.000Z | tests/integ/test_ntm.py | satishpasumarthi/sagemaker-python-sdk | 255a339ae985041ef47e3a80da91b9f54bca17b9 | [
"Apache-2.0"
] | null | null | null | # Copyright Amazon.com, Inc. or its affiliates. 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. A copy of
# the License is located at
#
# http://aws.amazon.com/apache2.0/
#
# or in the "license" file accompan... | 38.394231 | 99 | 0.717506 |
from __future__ import absolute_import
import os
import numpy as np
import pytest
from sagemaker import NTM, NTMModel, Predictor
from sagemaker.amazon.common import read_records
from sagemaker.serverless import ServerlessInferenceConfig
from sagemaker.utils import unique_name_from_base
from tests.integ i... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.