hexsha stringlengths 40 40 | size int64 4 996k | ext stringclasses 8
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 4 996k | avg_line_length float64 1.33 58.2k | max_line_length int64 2 323k | alphanum_fraction float64 0 0.97 | content_no_comment stringlengths 0 946k | is_comment_constant_removed bool 2
classes | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f7f6e89e15a90d8fdaed00abaf8db9749abc5e01 | 14,872 | py | Python | oauth/oidc.py | sferich888/quay | 4672db1df76874238baf134d04e74112ac9f630d | [
"Apache-2.0"
] | null | null | null | oauth/oidc.py | sferich888/quay | 4672db1df76874238baf134d04e74112ac9f630d | [
"Apache-2.0"
] | null | null | null | oauth/oidc.py | sferich888/quay | 4672db1df76874238baf134d04e74112ac9f630d | [
"Apache-2.0"
] | null | null | null | import time
import json
import logging
import urllib.parse
import jwt
from cachetools.func import lru_cache
from cachetools.ttl import TTLCache
from cryptography.hazmat.backends import default_backend
from cryptography.hazmat.primitives.serialization import load_der_public_key
from jwkest.jwk import KEYS
from oauth.... | 37.555556 | 106 | 0.626412 | import time
import json
import logging
import urllib.parse
import jwt
from cachetools.func import lru_cache
from cachetools.ttl import TTLCache
from cryptography.hazmat.backends import default_backend
from cryptography.hazmat.primitives.serialization import load_der_public_key
from jwkest.jwk import KEYS
from oauth.... | true | true |
f7f6e8d8f60b2a3366b18929b2d59a9f0703a9dd | 771 | py | Python | google/cloud/aiplatform/training_utils/cloud_profiler/cloud_profiler_utils.py | sakagarwal/python-aiplatform | 62b4a1ea589235910c6e87f027899a29bf1bacb1 | [
"Apache-2.0"
] | 180 | 2020-09-23T17:21:15.000Z | 2022-03-30T17:25:47.000Z | google/cloud/aiplatform/training_utils/cloud_profiler/cloud_profiler_utils.py | sakagarwal/python-aiplatform | 62b4a1ea589235910c6e87f027899a29bf1bacb1 | [
"Apache-2.0"
] | 601 | 2020-09-23T16:23:44.000Z | 2022-03-31T19:08:23.000Z | google/cloud/aiplatform/training_utils/cloud_profiler/cloud_profiler_utils.py | sakagarwal/python-aiplatform | 62b4a1ea589235910c6e87f027899a29bf1bacb1 | [
"Apache-2.0"
] | 109 | 2020-09-23T16:22:04.000Z | 2022-03-28T21:18:29.000Z | # -*- coding: utf-8 -*-
# Copyright 2021 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law ... | 35.045455 | 81 | 0.740597 |
import_error_msg = (
"Could not load the cloud profiler. To use the profiler, "
"install the SDK using 'pip install google-cloud-aiplatform[cloud-profiler]'"
)
| true | true |
f7f6e9525f84940691488a6a43f0fbbd4ea19caa | 1,991 | py | Python | experiments/gen_white_table.py | Derek-Wds/MAD-VAE | 267ce6ca98f1b1ecc8ebec22ddeca32e2c502d5b | [
"MIT"
] | 3 | 2019-12-12T14:35:42.000Z | 2021-12-16T03:06:16.000Z | experiments/gen_white_table.py | Derek-Wds/MAD-VAE | 267ce6ca98f1b1ecc8ebec22ddeca32e2c502d5b | [
"MIT"
] | null | null | null | experiments/gen_white_table.py | Derek-Wds/MAD-VAE | 267ce6ca98f1b1ecc8ebec22ddeca32e2c502d5b | [
"MIT"
] | null | null | null | import json
import numpy as np
if __name__ == "__main__":
models = {'vanilla': 0, 'classification': 0, 'proxi_dist': 0, 'combined': 0}
models_list = ['vanilla', 'classification', 'proxi_dist', 'combined'] # for consistency in older versions
for flavor in models_list:
with open(f'./accuracy_{flavor... | 53.810811 | 374 | 0.602712 | import json
import numpy as np
if __name__ == "__main__":
models = {'vanilla': 0, 'classification': 0, 'proxi_dist': 0, 'combined': 0}
models_list = ['vanilla', 'classification', 'proxi_dist', 'combined']
for flavor in models_list:
with open(f'./accuracy_{flavor}.txt', 'r') as f:
mode... | true | true |
f7f6e9843e0892bf302ce20849464558acc7b351 | 11,155 | py | Python | django_auth_adfs/backend.py | samukasmk/django-auth-adfs | e7d0ff27e3610f8412293086c440fc0a6357f1fa | [
"BSD-2-Clause"
] | null | null | null | django_auth_adfs/backend.py | samukasmk/django-auth-adfs | e7d0ff27e3610f8412293086c440fc0a6357f1fa | [
"BSD-2-Clause"
] | null | null | null | django_auth_adfs/backend.py | samukasmk/django-auth-adfs | e7d0ff27e3610f8412293086c440fc0a6357f1fa | [
"BSD-2-Clause"
] | null | null | null | import logging
from pprint import pformat
import jwt
from django.contrib.auth import get_user_model
from django.contrib.auth.backends import ModelBackend
from django.contrib.auth.models import Group
from django.core.exceptions import ImproperlyConfigured, PermissionDenied, ObjectDoesNotExist
from django_auth_adfs.con... | 42.576336 | 119 | 0.575885 | import logging
from pprint import pformat
import jwt
from django.contrib.auth import get_user_model
from django.contrib.auth.backends import ModelBackend
from django.contrib.auth.models import Group
from django.core.exceptions import ImproperlyConfigured, PermissionDenied, ObjectDoesNotExist
from django_auth_adfs.con... | true | true |
f7f6e9b68385293a77f39a1cdf629efcf677b67c | 415 | py | Python | saleor/product/migrations/0065_product_code.py | fcopantoja/saleor-ecommerce | d8745de423e1afc7aa60a59dbe05fec43b67ba80 | [
"BSD-3-Clause"
] | null | null | null | saleor/product/migrations/0065_product_code.py | fcopantoja/saleor-ecommerce | d8745de423e1afc7aa60a59dbe05fec43b67ba80 | [
"BSD-3-Clause"
] | 1 | 2022-02-13T22:52:38.000Z | 2022-02-13T22:52:38.000Z | saleor/product/migrations/0065_product_code.py | fcopantoja/saleor-ecommerce | d8745de423e1afc7aa60a59dbe05fec43b67ba80 | [
"BSD-3-Clause"
] | null | null | null | # Generated by Django 2.0.3 on 2018-09-18 23:03
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('product', '0064_productvariant_handle_stock'),
]
operations = [
migrations.AddField(
model_name='product',
name='cod... | 21.842105 | 73 | 0.612048 |
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('product', '0064_productvariant_handle_stock'),
]
operations = [
migrations.AddField(
model_name='product',
name='code',
field=models.CharField(blank=Tr... | true | true |
f7f6eab3596e65d5440c386cb70b4bdee2535f77 | 1,415 | py | Python | tests/search/test_nodal_surface.py | zx-sdu/NodeFinder | edaeeba8fb5a1ca28222313f6de7a6dfa8253093 | [
"Apache-2.0"
] | null | null | null | tests/search/test_nodal_surface.py | zx-sdu/NodeFinder | edaeeba8fb5a1ca28222313f6de7a6dfa8253093 | [
"Apache-2.0"
] | null | null | null | tests/search/test_nodal_surface.py | zx-sdu/NodeFinder | edaeeba8fb5a1ca28222313f6de7a6dfa8253093 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# © 2017-2019, ETH Zurich, Institut für Theoretische Physik
# Author: Dominik Gresch <greschd@gmx.ch>
"""
Tests with a nodal line.
"""
import numpy as np
import pytest
from nodefinder.search import run
from nodefinder.search.refinement_stencil import get_mesh_stencil
@pytest.fixture
def nod... | 24.824561 | 110 | 0.650883 |
import numpy as np
import pytest
from nodefinder.search import run
from nodefinder.search.refinement_stencil import get_mesh_stencil
@pytest.fixture
def nodal_surface_properties():
def dist_fct(pos):
_, _, dz = (np.array(pos) % 1) - 0.5
return abs(dz)
def gap_fct(pos):
dx, _, d... | true | true |
f7f6ebce3e0c34b4be5f37c8d7b552c6a51e54a1 | 1,170 | py | Python | opsplugins/vlan.py | OpenSwitchNOS/openswitch-ops-vland | 426c825ab4247d1a19d27f3a97d85645a32f8f6d | [
"Apache-2.0"
] | null | null | null | opsplugins/vlan.py | OpenSwitchNOS/openswitch-ops-vland | 426c825ab4247d1a19d27f3a97d85645a32f8f6d | [
"Apache-2.0"
] | null | null | null | opsplugins/vlan.py | OpenSwitchNOS/openswitch-ops-vland | 426c825ab4247d1a19d27f3a97d85645a32f8f6d | [
"Apache-2.0"
] | null | null | null | from opsvalidator.base import BaseValidator
from opsvalidator import error
from opsvalidator.error import ValidationError
from opsrest.utils.utils import get_column_data_from_row
class VlanValidator(BaseValidator):
resource = "vlan"
def validate_deletion(self, validation_args):
vlan_row = validation_... | 40.344828 | 73 | 0.688889 | from opsvalidator.base import BaseValidator
from opsvalidator import error
from opsvalidator.error import ValidationError
from opsrest.utils.utils import get_column_data_from_row
class VlanValidator(BaseValidator):
resource = "vlan"
def validate_deletion(self, validation_args):
vlan_row = validation_... | true | true |
f7f6ed0e62e70df672d08b36fce19754a9ac746b | 1,036 | py | Python | tests/utils/test_helper_ab_test.py | avisionh/abtest | 9b4e640b67b2b4d2c3501f1549b63ddd675f058e | [
"MIT"
] | 1 | 2021-01-13T06:39:08.000Z | 2021-01-13T06:39:08.000Z | tests/utils/test_helper_ab_test.py | avisionh/abtest | 9b4e640b67b2b4d2c3501f1549b63ddd675f058e | [
"MIT"
] | null | null | null | tests/utils/test_helper_ab_test.py | avisionh/abtest | 9b4e640b67b2b4d2c3501f1549b63ddd675f058e | [
"MIT"
] | null | null | null | import src.utils.helper_ab_test as f
def test_report_conversions(df_ab_test, out_report_conversions):
assert (
f.report_conversions(
data=df_ab_test,
group_col="group",
group_filter="control",
convert_col="converted",
page_col="landing_page",
... | 31.393939 | 76 | 0.705598 | import src.utils.helper_ab_test as f
def test_report_conversions(df_ab_test, out_report_conversions):
assert (
f.report_conversions(
data=df_ab_test,
group_col="group",
group_filter="control",
convert_col="converted",
page_col="landing_page",
... | true | true |
f7f6ed3bd4c9d8bd8935a951ff4dfd52fcbf6d89 | 808 | py | Python | src/context/__init__.py | vanelk/vpp | 09ad7fdd6ed80b0a9a2c3f8fcffd1c24d6e1dfcd | [
"MIT"
] | null | null | null | src/context/__init__.py | vanelk/vpp | 09ad7fdd6ed80b0a9a2c3f8fcffd1c24d6e1dfcd | [
"MIT"
] | null | null | null | src/context/__init__.py | vanelk/vpp | 09ad7fdd6ed80b0a9a2c3f8fcffd1c24d6e1dfcd | [
"MIT"
] | null | null | null | from src.valtypes import Value
class SymbolTable:
def __init__(self, parent = None):
self.symbols = {}
self.parent = parent
def get(self, name)->Value:
value = self.symbols.get(name, None)
if value == None and self.parent:
return self.parent.get(name)
return ... | 29.925926 | 70 | 0.641089 | from src.valtypes import Value
class SymbolTable:
def __init__(self, parent = None):
self.symbols = {}
self.parent = parent
def get(self, name)->Value:
value = self.symbols.get(name, None)
if value == None and self.parent:
return self.parent.get(name)
return ... | true | true |
f7f6ed5cc2dee07926555f7b276346aa758afe9f | 11,292 | py | Python | protobuf/python/content_provider_pb2.py | HsingPeng/ExtendBinderExperiment | 10a8d15e1640396dd7f351a9d146f182432955fb | [
"MIT"
] | null | null | null | protobuf/python/content_provider_pb2.py | HsingPeng/ExtendBinderExperiment | 10a8d15e1640396dd7f351a9d146f182432955fb | [
"MIT"
] | null | null | null | protobuf/python/content_provider_pb2.py | HsingPeng/ExtendBinderExperiment | 10a8d15e1640396dd7f351a9d146f182432955fb | [
"MIT"
] | null | null | null | # Generated by the protocol buffer compiler. DO NOT EDIT!
# source: content_provider.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflection ... | 37.144737 | 1,141 | 0.725735 |
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflection as _reflection
from google.protobuf import symbol_database as _symbol_database
from google... | true | true |
f7f6ef3b9447e120b4323c22f27c9a826fd71637 | 3,988 | py | Python | processing/tasks/delete_items.py | voyagersearch/tasks | 04e6541d757285628cbb1341b2754f41da609d69 | [
"Apache-2.0"
] | 5 | 2017-09-13T12:57:24.000Z | 2021-12-28T19:40:09.000Z | processing/tasks/delete_items.py | voyagersearch/tasks | 04e6541d757285628cbb1341b2754f41da609d69 | [
"Apache-2.0"
] | 11 | 2015-02-12T19:21:42.000Z | 2018-04-10T21:18:14.000Z | processing/tasks/delete_items.py | voyagersearch/tasks | 04e6541d757285628cbb1341b2754f41da609d69 | [
"Apache-2.0"
] | 6 | 2015-02-12T18:48:34.000Z | 2019-07-23T18:32:39.000Z | # -*- coding: utf-8 -*-
# (C) Copyright 2014 Voyager Search
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable l... | 38.718447 | 165 | 0.669759 |
import os
import sys
import requests
from utils import status
from utils import task_utils
import warnings
from requests.packages.urllib3.exceptions import InsecureRequestWarning
warnings.simplefilter('ignore', InsecureRequestWarning)
verify_ssl = task_utils.get_ssl_mode()
status_writer = status.Write... | true | true |
f7f6ef4d563cfc3eb9ca06cff2f6513e07df9a98 | 2,723 | py | Python | experiments/steven-images/discrete_classic_envs.py | Asap7772/railrl_evalsawyer | baba8ce634d32a48c7dfe4dc03b123e18e96e0a3 | [
"MIT"
] | null | null | null | experiments/steven-images/discrete_classic_envs.py | Asap7772/railrl_evalsawyer | baba8ce634d32a48c7dfe4dc03b123e18e96e0a3 | [
"MIT"
] | null | null | null | experiments/steven-images/discrete_classic_envs.py | Asap7772/railrl_evalsawyer | baba8ce634d32a48c7dfe4dc03b123e18e96e0a3 | [
"MIT"
] | null | null | null | """
Run DQN on grid world.
"""
import gym
import numpy as np
from rlkit.torch.dqn.double_dqn import DoubleDQN
import rlkit.misc.hyperparameter as hyp
import rlkit.torch.pytorch_util as ptu
from rlkit.launchers.launcher_util import run_experiment
from rlkit.torch.networks import Mlp
from rlkit.torch.networks.experime... | 28.072165 | 78 | 0.594198 |
import gym
import numpy as np
from rlkit.torch.dqn.double_dqn import DoubleDQN
import rlkit.misc.hyperparameter as hyp
import rlkit.torch.pytorch_util as ptu
from rlkit.launchers.launcher_util import run_experiment
from rlkit.torch.networks import Mlp
from rlkit.torch.networks.experimental import HuberLoss
from rlki... | true | true |
f7f6f2c8b3f7e336ad74f8b08e1c28298b4a4d13 | 1,283 | py | Python | cli/polyaxon/schemas/fields/tensor.py | hackerwins/polyaxon | ff56a098283ca872abfbaae6ba8abba479ffa394 | [
"Apache-2.0"
] | null | null | null | cli/polyaxon/schemas/fields/tensor.py | hackerwins/polyaxon | ff56a098283ca872abfbaae6ba8abba479ffa394 | [
"Apache-2.0"
] | null | null | null | cli/polyaxon/schemas/fields/tensor.py | hackerwins/polyaxon | ff56a098283ca872abfbaae6ba8abba479ffa394 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python
#
# Copyright 2019 Polyaxon, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... | 33.763158 | 87 | 0.670304 |
from __future__ import absolute_import, division, print_function
import six
from marshmallow import ValidationError, fields
class Tensor(fields.Field):
def _deserialize(self, value, attr, data, **kwargs):
if isinstance(value, six.string_types):
return [value, 0, 0]
i... | true | true |
f7f6f2e3841a377ef759e9e7376a0cf572113a16 | 885 | py | Python | web/gatekeeping/api/submission_reason.py | gabegm/Headcount-Planning-Management-System | 6946509e6d8c530b9f0e51b68047c4cb01dedd2e | [
"MIT"
] | 2 | 2020-03-17T10:55:39.000Z | 2022-03-21T00:04:38.000Z | web/gatekeeping/api/submission_reason.py | gabegm/Headcount-Planning-Management-System | 6946509e6d8c530b9f0e51b68047c4cb01dedd2e | [
"MIT"
] | null | null | null | web/gatekeeping/api/submission_reason.py | gabegm/Headcount-Planning-Management-System | 6946509e6d8c530b9f0e51b68047c4cb01dedd2e | [
"MIT"
] | null | null | null | from gatekeeping.db import get_db
from flask import abort
def get_submission_reasons():
submission_reasons = get_db().execute(
'SELECT *'
' FROM submission_reason'
).fetchall()
return submission_reasons
def get_submission_reason(id):
submission_status = get_db().execute(
'SELE... | 24.583333 | 72 | 0.637288 | from gatekeeping.db import get_db
from flask import abort
def get_submission_reasons():
submission_reasons = get_db().execute(
'SELECT *'
' FROM submission_reason'
).fetchall()
return submission_reasons
def get_submission_reason(id):
submission_status = get_db().execute(
'SELE... | true | true |
f7f6f3bacdda0b558edd2631aae48cf8ea97b618 | 4,501 | py | Python | gen_CARAE_con_logP_SAS_TPSA.py | gicsaw/ARAE_SMILES | 05cd508be0450ad0e8944e6280b8fa2863cc8dd0 | [
"BSD-3-Clause"
] | 19 | 2019-03-20T08:26:59.000Z | 2021-11-20T11:29:15.000Z | gen_CARAE_con_logP_SAS_TPSA.py | gicsaw/ARAE_SMILES | 05cd508be0450ad0e8944e6280b8fa2863cc8dd0 | [
"BSD-3-Clause"
] | 1 | 2020-05-31T11:34:55.000Z | 2021-06-20T11:58:09.000Z | gen_CARAE_con_logP_SAS_TPSA.py | gicsaw/ARAE_SMILES | 05cd508be0450ad0e8944e6280b8fa2863cc8dd0 | [
"BSD-3-Clause"
] | 2 | 2019-12-21T06:06:58.000Z | 2021-04-06T19:40:41.000Z | from model.CARAE import ARAE
#from utils.utils import *
import numpy as np
import os, sys
import time
import tensorflow as tf
import collections
import copy
from six.moves import cPickle
#os.environ["CUDA_VISIBLE_DEVICES"] = ""
def convert_to_smiles(vector, char):
smiles=""
for i in vector:
smiles+=cha... | 27.956522 | 100 | 0.610975 | from model.CARAE import ARAE
import numpy as np
import os, sys
import time
import tensorflow as tf
import collections
import copy
from six.moves import cPickle
def convert_to_smiles(vector, char):
smiles=""
for i in vector:
smiles+=char[i]
return smiles
def cal_accuracy(S1, S2, length):
coun... | true | true |
f7f6f491f228f56ba1af199f3b02bb6c0fecda27 | 685 | py | Python | xsec-tools/nesteddict.py | jsturdy/wsu-ci-analysis-tools | 672661d12ea751190a67e64dd9864ad54c5ad267 | [
"MIT"
] | null | null | null | xsec-tools/nesteddict.py | jsturdy/wsu-ci-analysis-tools | 672661d12ea751190a67e64dd9864ad54c5ad267 | [
"MIT"
] | null | null | null | xsec-tools/nesteddict.py | jsturdy/wsu-ci-analysis-tools | 672661d12ea751190a67e64dd9864ad54c5ad267 | [
"MIT"
] | null | null | null | from collections import defaultdict as cdict
class nesteddict(dict):
"""
Helper class for creating dictionaries that self-initialize
rather than having to create sub-level of a dictionary, one
can simply index all the keys above the desired level
Effectively, mkdir -p for dicts!
Example:
m... | 31.136364 | 115 | 0.683212 | from collections import defaultdict as cdict
class nesteddict(dict):
def __missing__(self, key):
value = self[key] = type(self)()
return value
| true | true |
f7f6f5ec9d1bf323f10952f740fa415fa974483a | 3,134 | py | Python | rec_to_nwb/processing/validation/ntrode_validator.py | jihyunbak/rec_to_nwb | 6e65f8bf0a4faa4d986483ec2442ba19d70c92a9 | [
"Apache-2.0"
] | 8 | 2020-05-29T13:48:35.000Z | 2021-11-19T04:24:48.000Z | rec_to_nwb/processing/validation/ntrode_validator.py | jihyunbak/rec_to_nwb | 6e65f8bf0a4faa4d986483ec2442ba19d70c92a9 | [
"Apache-2.0"
] | 8 | 2020-07-13T00:42:35.000Z | 2020-11-16T16:17:12.000Z | rec_to_nwb/processing/validation/ntrode_validator.py | jihyunbak/rec_to_nwb | 6e65f8bf0a4faa4d986483ec2442ba19d70c92a9 | [
"Apache-2.0"
] | 1 | 2020-08-28T01:34:35.000Z | 2020-08-28T01:34:35.000Z | import logging.config
import os
from rec_to_nwb.processing.exceptions.invalid_header_exception import InvalidHeaderException
from rec_to_nwb.processing.exceptions.invalid_metadata_exception import InvalidMetadataException
from rec_to_nwb.processing.header.module.header import Header
from rec_to_nwb.processing.tools.be... | 51.377049 | 98 | 0.736758 | import logging.config
import os
from rec_to_nwb.processing.exceptions.invalid_header_exception import InvalidHeaderException
from rec_to_nwb.processing.exceptions.invalid_metadata_exception import InvalidMetadataException
from rec_to_nwb.processing.header.module.header import Header
from rec_to_nwb.processing.tools.be... | true | true |
f7f6f6d9152763afcbf0216e257c13b489de2a2d | 20,049 | py | Python | sunpy/instr/tests/test_lyra.py | mridullpandey/sunpy | 65bf70731a8147899b8c0fca8b3b1a386e47c010 | [
"BSD-2-Clause"
] | null | null | null | sunpy/instr/tests/test_lyra.py | mridullpandey/sunpy | 65bf70731a8147899b8c0fca8b3b1a386e47c010 | [
"BSD-2-Clause"
] | 2 | 2015-06-15T17:16:11.000Z | 2016-11-23T17:12:07.000Z | sunpy/instr/tests/test_lyra.py | mridullpandey/sunpy | 65bf70731a8147899b8c0fca8b3b1a386e47c010 | [
"BSD-2-Clause"
] | 2 | 2016-11-22T01:35:15.000Z | 2017-04-26T19:37:53.000Z | import os.path
import datetime
import tempfile
import numpy as np
import pandas
import pytest
import astropy.units as u
from astropy.time import TimeDelta
from sunpy import timeseries
from sunpy.data.test import rootdir
from sunpy.instr import lyra
from sunpy.time import is_time_equal, parse_time
# Define location ... | 49.139706 | 90 | 0.633049 | import os.path
import datetime
import tempfile
import numpy as np
import pandas
import pytest
import astropy.units as u
from astropy.time import TimeDelta
from sunpy import timeseries
from sunpy.data.test import rootdir
from sunpy.instr import lyra
from sunpy.time import is_time_equal, parse_time
TEST_DATA_PATH = ... | true | true |
f7f6f7720b316ca02583ff5e36719b1bb5fcee5f | 2,940 | py | Python | src/utils/resize.py | BolachasDaAvo/PyTorch-StudioGAN | 21d0f1d976d0c5c3d240295e9efa83c105e40ac7 | [
"MIT"
] | null | null | null | src/utils/resize.py | BolachasDaAvo/PyTorch-StudioGAN | 21d0f1d976d0c5c3d240295e9efa83c105e40ac7 | [
"MIT"
] | null | null | null | src/utils/resize.py | BolachasDaAvo/PyTorch-StudioGAN | 21d0f1d976d0c5c3d240295e9efa83c105e40ac7 | [
"MIT"
] | null | null | null | """
MIT License
Copyright (c) 2021 Gaurav Parmar
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, copy, modify, merge, publish,... | 35.853659 | 88 | 0.679252 |
egacy":
return make_resizer("PyTorch", "bilinear", (size, size))
else:
raise ValueError(f"Invalid mode {mode} specified")
def make_resizer(library, filter, output_size):
if library == "PIL":
s1, s2 = output_size
def resize_single_channel(x_np):
img = Image.fromarra... | true | true |
f7f6f7bd485f7f9e2bbbdff540a933edbb81011a | 598 | py | Python | src/Chebyshev_Nodes/examples.py | Roseck16/Interpolation | 20513e02241824e37c9eab6642fc2f3139dd8e00 | [
"MIT"
] | 1 | 2021-07-14T03:33:57.000Z | 2021-07-14T03:33:57.000Z | src/Chebyshev_Nodes/examples.py | Roseck16/Interpolation | 20513e02241824e37c9eab6642fc2f3139dd8e00 | [
"MIT"
] | null | null | null | src/Chebyshev_Nodes/examples.py | Roseck16/Interpolation | 20513e02241824e37c9eab6642fc2f3139dd8e00 | [
"MIT"
] | null | null | null | #%%
from Chebyshev_Nodes import chebyshev_nodes, lagrange, graf, np
# %%
WID = 15
HEI = 10
#%% Example 1
# Evenly spaced nodes
f = lambda a: abs(a) + a/2 - a**2
#%%
x = np.linspace(-1, 1, 9)
y = f(x)
p = np.linspace(np.min(x), np.max(x),100)
#%%
pol = lagrange(x,y, p)
#%%
graf(p, f, pol, WID, HEI, save_path="../../imag... | 22.148148 | 91 | 0.618729 |
from Chebyshev_Nodes import chebyshev_nodes, lagrange, graf, np
WID = 15
HEI = 10
f = lambda a: abs(a) + a/2 - a**2
x = np.linspace(-1, 1, 9)
y = f(x)
p = np.linspace(np.min(x), np.max(x),100)
pol = lagrange(x,y, p)
graf(p, f, pol, WID, HEI, save_path="../../images/Chebyshev nodes/Example1_chebyshev1.png")
x =... | true | true |
f7f6f93d9c5a52aba801c6cc168a2dbacaa2e2ff | 570 | py | Python | api_sync/v1/models/jobs_alternate_titles.py | robinsonkwame/skills-airflow | 085f9eede4c174b37766856ea437cdd39e06b22c | [
"Apache-2.0"
] | null | null | null | api_sync/v1/models/jobs_alternate_titles.py | robinsonkwame/skills-airflow | 085f9eede4c174b37766856ea437cdd39e06b22c | [
"Apache-2.0"
] | null | null | null | api_sync/v1/models/jobs_alternate_titles.py | robinsonkwame/skills-airflow | 085f9eede4c174b37766856ea437cdd39e06b22c | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
from . import Base
import sqlalchemy as db
class JobAlternateTitle(Base):
__tablename__ = 'jobs_alternate_titles'
uuid = db.Column(db.String, primary_key=True)
title = db.Column(db.String)
nlp_a = db.Column(db.String)
job_uuid = db.Column(db.String, db.ForeignKey('jobs_ma... | 24.782609 | 70 | 0.645614 |
from . import Base
import sqlalchemy as db
class JobAlternateTitle(Base):
__tablename__ = 'jobs_alternate_titles'
uuid = db.Column(db.String, primary_key=True)
title = db.Column(db.String)
nlp_a = db.Column(db.String)
job_uuid = db.Column(db.String, db.ForeignKey('jobs_master.uuid'))
def _... | true | true |
f7f6f94b13c230923629b7b9ecf8e3b0a7608dc7 | 20,820 | py | Python | driver/ixsystems/common.py | mlipscombe/cinder-driver-truenas | 34b29024da05f154314086ad3e9a4ab13de67c0a | [
"BSD-3-Clause"
] | null | null | null | driver/ixsystems/common.py | mlipscombe/cinder-driver-truenas | 34b29024da05f154314086ad3e9a4ab13de67c0a | [
"BSD-3-Clause"
] | null | null | null | driver/ixsystems/common.py | mlipscombe/cinder-driver-truenas | 34b29024da05f154314086ad3e9a4ab13de67c0a | [
"BSD-3-Clause"
] | null | null | null | #vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright (c) 2016 iXsystems
from oslo_log import log as logging
from cinder import exception
from cinder.volume.drivers.ixsystems.freenasapi import FreeNASApiError
from cinder.volume.drivers.ixsystems.freenasapi import FreeNASServer
from oslo_config import cfg
import os
im... | 48.758782 | 132 | 0.617627 |
from oslo_log import log as logging
from cinder import exception
from cinder.volume.drivers.ixsystems.freenasapi import FreeNASApiError
from cinder.volume.drivers.ixsystems.freenasapi import FreeNASServer
from oslo_config import cfg
import os
import urllib.parse
from cinder.volume.drivers.ixsystems import utils as i... | true | true |
f7f6f9de82b5a679b636553f4554bdba769b692e | 610 | py | Python | 2017/day01/captcha.py | kgaughan/aoc | ffd1d8f28adb3b5b61da15402fb6ca489b9025b0 | [
"BSD-3-Clause"
] | null | null | null | 2017/day01/captcha.py | kgaughan/aoc | ffd1d8f28adb3b5b61da15402fb6ca489b9025b0 | [
"BSD-3-Clause"
] | null | null | null | 2017/day01/captcha.py | kgaughan/aoc | ffd1d8f28adb3b5b61da15402fb6ca489b9025b0 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python3
def runner(path, fn):
with open(path) as fh:
for i, line in enumerate(fh):
print('{}: {}'.format(i + 1, fn(line.rstrip())))
def captcha1(data):
result = 0
last = None
for ch in data + data[0]:
if last == ch:
result += int(ch)
las... | 18.484848 | 60 | 0.519672 |
def runner(path, fn):
with open(path) as fh:
for i, line in enumerate(fh):
print('{}: {}'.format(i + 1, fn(line.rstrip())))
def captcha1(data):
result = 0
last = None
for ch in data + data[0]:
if last == ch:
result += int(ch)
last = ch
return resu... | true | true |
f7f6faf6f2b978ff07730a7858ff45f9dea806a8 | 305 | py | Python | 2017/07/female-homicide-rates-20170721/graphic_config.py | nprapps/graphics-archive | 97b0ef326b46a959df930f5522d325e537f7a655 | [
"FSFAP"
] | 14 | 2015-05-08T13:41:51.000Z | 2021-02-24T12:34:55.000Z | 2017/07/female-homicide-rates-20170721/graphic_config.py | nprapps/graphics-archive | 97b0ef326b46a959df930f5522d325e537f7a655 | [
"FSFAP"
] | null | null | null | 2017/07/female-homicide-rates-20170721/graphic_config.py | nprapps/graphics-archive | 97b0ef326b46a959df930f5522d325e537f7a655 | [
"FSFAP"
] | 7 | 2015-04-04T04:45:54.000Z | 2021-02-18T11:12:48.000Z | #!/usr/bin/env python
import base_filters
COPY_GOOGLE_DOC_KEY = '1Oho_mMqOBUmVsj7VAfTlkkvphRaGl2lZKU2b1bZp8ik'
USE_ASSETS = False
# Use these variables to override the default cache timeouts for this graphic
# DEFAULT_MAX_AGE = 20
# ASSETS_MAX_AGE = 300
JINJA_FILTER_FUNCTIONS = base_filters.FILTERS
| 21.785714 | 77 | 0.819672 |
import base_filters
COPY_GOOGLE_DOC_KEY = '1Oho_mMqOBUmVsj7VAfTlkkvphRaGl2lZKU2b1bZp8ik'
USE_ASSETS = False
JINJA_FILTER_FUNCTIONS = base_filters.FILTERS
| true | true |
f7f6fc4844645190ce3f9119ad21b13cdee163f2 | 8,855 | py | Python | aitextgen/train.py | SeanNaren/aitextgen | 12a647cd6e8f2a9f8b0dfa5e380ad50d10a527cd | [
"MIT"
] | null | null | null | aitextgen/train.py | SeanNaren/aitextgen | 12a647cd6e8f2a9f8b0dfa5e380ad50d10a527cd | [
"MIT"
] | null | null | null | aitextgen/train.py | SeanNaren/aitextgen | 12a647cd6e8f2a9f8b0dfa5e380ad50d10a527cd | [
"MIT"
] | 1 | 2020-07-24T05:46:52.000Z | 2020-07-24T05:46:52.000Z | import pytorch_lightning as pl
from pytorch_lightning.callbacks.progress import ProgressBarBase
from tqdm.auto import tqdm
import sys
import torch
from torch.optim import AdamW
from torch.utils.data import DataLoader
from transformers import get_linear_schedule_with_warmup
import os
import shutil
import subprocess
cl... | 33.289474 | 93 | 0.578882 | import pytorch_lightning as pl
from pytorch_lightning.callbacks.progress import ProgressBarBase
from tqdm.auto import tqdm
import sys
import torch
from torch.optim import AdamW
from torch.utils.data import DataLoader
from transformers import get_linear_schedule_with_warmup
import os
import shutil
import subprocess
cl... | true | true |
f7f6fcd3d0ebddcd93263488c0ab0657c752e36f | 37,900 | py | Python | site-packages/cryptography/x509/extensions.py | NickFlatow/winnf-rel2-testharness | f5174ae643c13b6753fac434569e907df4d50cf1 | [
"Apache-2.0"
] | 132 | 2021-02-24T12:14:35.000Z | 2022-03-28T13:06:22.000Z | site-packages/cryptography/x509/extensions.py | NickFlatow/winnf-rel2-testharness | f5174ae643c13b6753fac434569e907df4d50cf1 | [
"Apache-2.0"
] | 2 | 2022-02-10T16:51:56.000Z | 2022-02-10T18:23:52.000Z | site-packages/cryptography/x509/extensions.py | NickFlatow/winnf-rel2-testharness | f5174ae643c13b6753fac434569e907df4d50cf1 | [
"Apache-2.0"
] | 3 | 2021-12-08T15:20:46.000Z | 2021-12-13T04:55:08.000Z | # This file is dual licensed under the terms of the Apache License, Version
# 2.0, and the BSD License. See the LICENSE file in the root of this repository
# for complete details.
from __future__ import absolute_import, division, print_function
import abc
import datetime
import hashlib
import ipaddress
import warning... | 31.244847 | 79 | 0.647045 |
from __future__ import absolute_import, division, print_function
import abc
import datetime
import hashlib
import ipaddress
import warnings
from enum import Enum
from pyasn1.codec.der import decoder
from pyasn1.type import namedtype, univ
import six
from cryptography import utils
from cryptography.hazmat.primit... | true | true |
f7f6fd16d9ea150115bb9ff2a2d94e41a940d9e8 | 610 | py | Python | segm/utils/torch.py | urasakikeisuke/segmenter | 69ff016e621b7d1e4b8573a8b150e80dbc70cf84 | [
"MIT"
] | 418 | 2021-05-12T20:27:13.000Z | 2022-03-30T14:34:27.000Z | segm/utils/torch.py | urasakikeisuke/segmenter | 69ff016e621b7d1e4b8573a8b150e80dbc70cf84 | [
"MIT"
] | 38 | 2021-05-13T03:36:17.000Z | 2022-03-22T19:34:52.000Z | segm/utils/torch.py | urasakikeisuke/segmenter | 69ff016e621b7d1e4b8573a8b150e80dbc70cf84 | [
"MIT"
] | 95 | 2021-05-13T03:23:59.000Z | 2022-03-28T09:08:32.000Z | import os
import torch
"""
GPU wrappers
"""
use_gpu = False
gpu_id = 0
device = None
distributed = False
dist_rank = 0
world_size = 1
def set_gpu_mode(mode):
global use_gpu
global device
global gpu_id
global distributed
global dist_rank
global world_size
gpu_id = int(os.environ.get("SL... | 18.484848 | 65 | 0.685246 | import os
import torch
use_gpu = False
gpu_id = 0
device = None
distributed = False
dist_rank = 0
world_size = 1
def set_gpu_mode(mode):
global use_gpu
global device
global gpu_id
global distributed
global dist_rank
global world_size
gpu_id = int(os.environ.get("SLURM_LOCALID", 0))
... | true | true |
f7f6fd59551340f97f86fc20c09799f81bd6fa9a | 10,424 | py | Python | quspin/tools/expm_multiply_parallel_core/expm_multiply_parallel_core.py | anton-buyskikh/QuSpin | 4e46b495e399414d9361d659e186492a1ac5b511 | [
"BSD-3-Clause"
] | null | null | null | quspin/tools/expm_multiply_parallel_core/expm_multiply_parallel_core.py | anton-buyskikh/QuSpin | 4e46b495e399414d9361d659e186492a1ac5b511 | [
"BSD-3-Clause"
] | null | null | null | quspin/tools/expm_multiply_parallel_core/expm_multiply_parallel_core.py | anton-buyskikh/QuSpin | 4e46b495e399414d9361d659e186492a1ac5b511 | [
"BSD-3-Clause"
] | null | null | null | from scipy.sparse.linalg import LinearOperator,onenormest,aslinearoperator
from .expm_multiply_parallel_wrapper import _wrapper_expm_multiply,_wrapper_csr_trace
import scipy.sparse as _sp
import numpy as _np
class expm_multiply_parallel(object):
"""Implements `scipy.sparse.linalg.expm_multiply()` for *openmp*.
Note... | 25.738272 | 154 | 0.671815 | from scipy.sparse.linalg import LinearOperator,onenormest,aslinearoperator
from .expm_multiply_parallel_wrapper import _wrapper_expm_multiply,_wrapper_csr_trace
import scipy.sparse as _sp
import numpy as _np
class expm_multiply_parallel(object):
def __init__(self,A,a=1.0):
if _np.array(a).ndim == 0:
self._a = a
... | true | true |
f7f6fe58b1ade27a1089441821ab646de50cdb18 | 2,726 | py | Python | src/data/make_dataset.py | acbart/csedm20-paper-cs1-analysis | 0bd54894e8768caeadcc2b1bc2043d4282d4c6ed | [
"MIT"
] | null | null | null | src/data/make_dataset.py | acbart/csedm20-paper-cs1-analysis | 0bd54894e8768caeadcc2b1bc2043d4282d4c6ed | [
"MIT"
] | null | null | null | src/data/make_dataset.py | acbart/csedm20-paper-cs1-analysis | 0bd54894e8768caeadcc2b1bc2043d4282d4c6ed | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import click
import logging
from pathlib import Path
from dotenv import find_dotenv, load_dotenv
import os
import sqlite3
import pandas as pd
import json
from src.data.process_quizzes import process_quizzes
@click.command()
@click.argument('input_filepath', type=click.Path(exists=True))
@click.... | 37.861111 | 97 | 0.707263 |
import click
import logging
from pathlib import Path
from dotenv import find_dotenv, load_dotenv
import os
import sqlite3
import pandas as pd
import json
from src.data.process_quizzes import process_quizzes
@click.command()
@click.argument('input_filepath', type=click.Path(exists=True))
@click.argument('output_filepa... | true | true |
f7f6ff0700b23db94f28ae36bc0083c4b68b1b5f | 3,059 | py | Python | primitiveMining/primitiveTwitter.py | juleskt/SentimentOracle | f24ab9551aedbf08900de5f8cd5ac91805912937 | [
"MIT"
] | 1 | 2016-01-06T06:58:58.000Z | 2016-01-06T06:58:58.000Z | primitiveMining/primitiveTwitter.py | juleskt/SentimentOracle | f24ab9551aedbf08900de5f8cd5ac91805912937 | [
"MIT"
] | null | null | null | primitiveMining/primitiveTwitter.py | juleskt/SentimentOracle | f24ab9551aedbf08900de5f8cd5ac91805912937 | [
"MIT"
] | null | null | null | #Minqing Hu and Bing Liu. "Mining and Summarizing Customer Reviews."
#Proceedings of the ACM SIGKDD International Conference on Knowledge
#Discovery and Data Mining (KDD-2004), Aug 22-25, 2004, Seattle,
#Washington, USA,
#Bing Liu, Minqing Hu and Junsheng Cheng. "Opinion Observer: Analyzing
#and Comparing Opinions... | 26.833333 | 105 | 0.712651 |
#and Comparing Opinions on the Web." Proceedings of the 14th
from os import path
import twitter
from wordcloud import WordCloud
OAUTH_TOKEN = 'xxxx'
OAUTH_SECRET = 'xxxx'
CONSUMER_KEY = 'xxxx'
CONSUMER_SECRET = 'xxxx'
def binarySearch(alist,item):
first = 0
last = len(alist)-1
found = False
while firs... | false | true |
f7f700d638e18614ca377341088ad873b1037c34 | 2,301 | py | Python | GPflow/testing/test_triang.py | mlilab/Mixed-Effect-Composite-RNN-Gaussian-Process | dd7da89ce3c41d459a26ad1ce5ed2f40ab4ca85d | [
"Apache-2.0"
] | 24 | 2018-11-29T07:00:59.000Z | 2021-04-22T19:12:31.000Z | GPflow/testing/test_triang.py | mlilab/Mixed-Effect-Composite-RNN-Gaussian-Process | dd7da89ce3c41d459a26ad1ce5ed2f40ab4ca85d | [
"Apache-2.0"
] | 1 | 2018-12-04T11:51:21.000Z | 2018-12-04T11:51:21.000Z | GPflow/testing/test_triang.py | OpenXAIProject/Mixed-Effect-Composite-RNN-Gaussian-Process | dd7da89ce3c41d459a26ad1ce5ed2f40ab4ca85d | [
"Apache-2.0"
] | 12 | 2018-11-30T00:40:13.000Z | 2019-10-30T16:09:52.000Z | import unittest
from gpflow.tf_wraps import vec_to_tri
import tensorflow as tf
import numpy as np
from testing.gpflow_testcase import GPflowTestCase
from gpflow.tf_wraps import vec_to_tri
class TestVecToTri(GPflowTestCase):
def referenceInverse(self, matrices):
#this is the inverse operation of the vec_to_tri
... | 37.721311 | 88 | 0.65189 | import unittest
from gpflow.tf_wraps import vec_to_tri
import tensorflow as tf
import numpy as np
from testing.gpflow_testcase import GPflowTestCase
from gpflow.tf_wraps import vec_to_tri
class TestVecToTri(GPflowTestCase):
def referenceInverse(self, matrices):
D, N, _ = matrices.shape
M = ... | true | true |
f7f70226d29b1929ac0dfeeb4fa929cf051f1d06 | 6,668 | py | Python | spacy/training/loggers.py | rynoV/spaCy | d8805a1073c01468e8b284ef7ca91eb80f37d237 | [
"BSD-3-Clause",
"MIT"
] | null | null | null | spacy/training/loggers.py | rynoV/spaCy | d8805a1073c01468e8b284ef7ca91eb80f37d237 | [
"BSD-3-Clause",
"MIT"
] | null | null | null | spacy/training/loggers.py | rynoV/spaCy | d8805a1073c01468e8b284ef7ca91eb80f37d237 | [
"BSD-3-Clause",
"MIT"
] | null | null | null | from typing import TYPE_CHECKING, Dict, Any, Tuple, Callable, List, Optional, IO
from wasabi import Printer
import tqdm
import sys
from ..util import registry
from .. import util
from ..errors import Errors
if TYPE_CHECKING:
from ..language import Language # noqa: F401
def setup_table(
*, cols: List[str], ... | 37.044444 | 88 | 0.535243 | from typing import TYPE_CHECKING, Dict, Any, Tuple, Callable, List, Optional, IO
from wasabi import Printer
import tqdm
import sys
from ..util import registry
from .. import util
from ..errors import Errors
if TYPE_CHECKING:
from ..language import Language
def setup_table(
*, cols: List[str], widths: List... | true | true |
f7f702355a4331722a6306d9e6cd4f2f9e0ddb0c | 1,496 | py | Python | pollination_streamlit/selectors.py | mostaphaRoudsari/pollination-streamlit | 5930ad3f8484301f145d0d646acafe6d1314ec8a | [
"Apache-2.0"
] | null | null | null | pollination_streamlit/selectors.py | mostaphaRoudsari/pollination-streamlit | 5930ad3f8484301f145d0d646acafe6d1314ec8a | [
"Apache-2.0"
] | 1 | 2022-03-16T12:28:08.000Z | 2022-03-16T12:28:08.000Z | pollination_streamlit/selectors.py | mostaphaRoudsari/pollination-streamlit | 5930ad3f8484301f145d0d646acafe6d1314ec8a | [
"Apache-2.0"
] | 3 | 2021-11-21T13:29:41.000Z | 2022-03-17T13:17:09.000Z | import streamlit as st
from .api.client import ApiClient
from .authentication import get_jwt_from_browser
from .interactors import Job, Run
def get_api_client(st_element: st = st) -> ApiClient:
client = ApiClient()
client.jwt_token = get_jwt_from_browser()
if client.jwt_token is None:
client.api_... | 28.769231 | 92 | 0.649733 | import streamlit as st
from .api.client import ApiClient
from .authentication import get_jwt_from_browser
from .interactors import Job, Run
def get_api_client(st_element: st = st) -> ApiClient:
client = ApiClient()
client.jwt_token = get_jwt_from_browser()
if client.jwt_token is None:
client.api_... | true | true |
f7f702a284d173171315a38138931e0c50c9b4f0 | 12,869 | py | Python | tpqoa/tpqoa.py | jordan-owen/tpqoa | 7f75b3399ec5b05ad8c543e95c815a76372db98d | [
"MIT"
] | null | null | null | tpqoa/tpqoa.py | jordan-owen/tpqoa | 7f75b3399ec5b05ad8c543e95c815a76372db98d | [
"MIT"
] | null | null | null | tpqoa/tpqoa.py | jordan-owen/tpqoa | 7f75b3399ec5b05ad8c543e95c815a76372db98d | [
"MIT"
] | 1 | 2021-11-20T00:48:42.000Z | 2021-11-20T00:48:42.000Z | #
# tpqoa is a wrapper class for the
# Oanda v20 API (RESTful & streaming)
# making use of the v20 Python package
#
# (c) Dr. Yves J. Hilpisch
# The Python Quants GmbH
#
#
# Trading forex/CFDs on margin carries a high level of risk and may
# not be suitable for all investors as you could sustain losses
# in excess of d... | 37.51895 | 78 | 0.564535 |
import v20
import json
import configparser
import pandas as pd
from v20.transaction import StopLossDetails, ClientExtensions
from v20.transaction import TrailingStopLossDetails, TakeProfitDetails
class tpqoa(object):
def __init__(self, conf_file):
self.config = configparser.C... | true | true |
f7f703284c94234e0f7dc5f03b9978d6ef9405d0 | 4,116 | py | Python | samples/basic/executor/models/cisco-ios-xr/Cisco-IOS-XR-ping-act/nc-execute-xr-ping-act-28-ydk.py | deom119/ydk-py-samples | 1ad6cc2b798f358ff835df93d12924df308b85fc | [
"Apache-2.0"
] | 104 | 2016-03-15T17:04:01.000Z | 2021-12-31T06:09:35.000Z | samples/basic/executor/models/cisco-ios-xr/Cisco-IOS-XR-ping-act/nc-execute-xr-ping-act-28-ydk.py | https-maxus-github-com/ydk-py-samples | 1ad6cc2b798f358ff835df93d12924df308b85fc | [
"Apache-2.0"
] | 15 | 2016-03-15T23:09:47.000Z | 2020-08-13T12:13:18.000Z | samples/basic/executor/models/cisco-ios-xr/Cisco-IOS-XR-ping-act/nc-execute-xr-ping-act-28-ydk.py | https-maxus-github-com/ydk-py-samples | 1ad6cc2b798f358ff835df93d12924df308b85fc | [
"Apache-2.0"
] | 87 | 2016-04-15T16:59:23.000Z | 2021-09-18T18:05:47.000Z | #!/usr/bin/env python
#
# Copyright 2016 Cisco Systems, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicab... | 35.791304 | 92 | 0.619776 |
from argparse import ArgumentParser
from urlparse import urlparse
from ydk.services import ExecutorService
from ydk.providers import NetconfServiceProvider
from ydk.models.cisco_ios_xr import Cisco_IOS_XR_ping_act \
as xr_ping_act
import logging
def prepare_ping(ping):
ping.input.destinatio... | true | true |
f7f703600a5cd0bd2ae5cdcd72a2f6b613ba0d2a | 29,689 | py | Python | test_tablib.py | rhunwicks/tablib | bbdf5f11ab0c77e0b8907c593cdd73e287c2948d | [
"MIT"
] | null | null | null | test_tablib.py | rhunwicks/tablib | bbdf5f11ab0c77e0b8907c593cdd73e287c2948d | [
"MIT"
] | null | null | null | test_tablib.py | rhunwicks/tablib | bbdf5f11ab0c77e0b8907c593cdd73e287c2948d | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Tests for Tablib."""
import json
import unittest
import sys
import os
import tablib
from tablib.compat import markup, unicode, is_py3
from tablib.core import Row
class TablibTestCase(unittest.TestCase):
"""Tablib test cases."""
def setUp(self):
"""... | 30.141117 | 108 | 0.587996 |
import json
import unittest
import sys
import os
import tablib
from tablib.compat import markup, unicode, is_py3
from tablib.core import Row
class TablibTestCase(unittest.TestCase):
def setUp(self):
global data, book
data = tablib.Dataset()
book = tablib.Databook()
self.h... | true | true |
f7f703f86b7893d23ba25c2035987377669cf8a2 | 9,783 | py | Python | models/unet_original_dice&BCE.py | FarCaptain/MyUnet | a02516a7ffa9e6fd5730e05fb5f95386bbb4b3d6 | [
"MIT"
] | 1 | 2021-12-28T11:14:04.000Z | 2021-12-28T11:14:04.000Z | models/unet_original_dice&BCE.py | FarCaptain/MyUnet | a02516a7ffa9e6fd5730e05fb5f95386bbb4b3d6 | [
"MIT"
] | null | null | null | models/unet_original_dice&BCE.py | FarCaptain/MyUnet | a02516a7ffa9e6fd5730e05fb5f95386bbb4b3d6 | [
"MIT"
] | null | null | null |
# coding: utf-8
# In[1]:
import matplotlib as mpl
import matplotlib.pyplot as plt
#get_ipython().magic('matplotlib inline')
import numpy as np
import sklearn
from sklearn.model_selection import train_test_split
import pandas as pd
import os
import sys
import time
#import keras
#from keras.layers.convolutional import... | 30.101538 | 273 | 0.660227 |
import matplotlib as mpl
import matplotlib.pyplot as plt
import numpy as np
import sklearn
from sklearn.model_selection import train_test_split
import pandas as pd
import os
import sys
import time
import tensorflow as tf
tf.enable_eager_execution()
from tensorflow import keras
print(tf.__version__)
print(sys... | true | true |
f7f704dab6740d9e28698ecf657c76bf7754f1a3 | 9,160 | py | Python | longformer_scripts/sequence_encoder.py | ChristineBasta/fairseq | c349ec3ec7fa0da7306c91769fbdc6146569a0ee | [
"MIT"
] | null | null | null | longformer_scripts/sequence_encoder.py | ChristineBasta/fairseq | c349ec3ec7fa0da7306c91769fbdc6146569a0ee | [
"MIT"
] | null | null | null | longformer_scripts/sequence_encoder.py | ChristineBasta/fairseq | c349ec3ec7fa0da7306c91769fbdc6146569a0ee | [
"MIT"
] | null | null | null | # Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import math
from typing import Dict, List, Optional
import torch
import torch.nn as nn
from fairseq import search, utils
from fairseq.data im... | 33.800738 | 112 | 0.572707 |
import math
from typing import Dict, List, Optional
import torch
import torch.nn as nn
from fairseq import search, utils
from fairseq.data import data_utils
from fairseq.models import FairseqIncrementalDecoder
from torch import Tensor
from fairseq.ngram_repeat_block import NGramRepeatBlock
class SequenceEncoder... | true | true |
f7f706a9be7a12dadff0bc73a6a7babb0ab53dab | 1,594 | py | Python | test/test_events.py | odanoburu/rdflib | af625d0bc48b656b614629b9ad56df63b88a0d17 | [
"BSD-3-Clause"
] | 1 | 2021-08-09T16:32:00.000Z | 2021-08-09T16:32:00.000Z | test/test_events.py | odanoburu/rdflib | af625d0bc48b656b614629b9ad56df63b88a0d17 | [
"BSD-3-Clause"
] | null | null | null | test/test_events.py | odanoburu/rdflib | af625d0bc48b656b614629b9ad56df63b88a0d17 | [
"BSD-3-Clause"
] | null | null | null |
import unittest
from rdflib import events
class AddedEvent(events.Event):
pass
class RemovedEvent(events.Event):
pass
def subscribe_to(source, target):
target.subscribe(AddedEvent, source._add_handler)
target.subscribe(RemovedEvent, source._remove_handler)
def subscribe_all(caches):
for cac... | 21.835616 | 58 | 0.617942 |
import unittest
from rdflib import events
class AddedEvent(events.Event):
pass
class RemovedEvent(events.Event):
pass
def subscribe_to(source, target):
target.subscribe(AddedEvent, source._add_handler)
target.subscribe(RemovedEvent, source._remove_handler)
def subscribe_all(caches):
for cac... | true | true |
f7f7077f2960b540d3a1561391600c2bbca2cb12 | 15,800 | py | Python | zipline/_version.py | liudengfeng/zipline | 01fdd51d83efeb3453e92b7d02c255a06eba49ac | [
"Apache-2.0"
] | 6 | 2017-12-11T06:12:00.000Z | 2019-05-23T17:39:10.000Z | zipline/_version.py | liudengfeng/zipline | 01fdd51d83efeb3453e92b7d02c255a06eba49ac | [
"Apache-2.0"
] | null | null | null | zipline/_version.py | liudengfeng/zipline | 01fdd51d83efeb3453e92b7d02c255a06eba49ac | [
"Apache-2.0"
] | 1 | 2018-01-26T14:19:38.000Z | 2018-01-26T14:19:38.000Z |
# This file helps to compute a version number in source trees obtained from
# git-archive tarball (such as those provided by githubs download-from-tag
# feature). Distribution tarballs (built by setup.py sdist) and build
# directories (produced by setup.py build) will contain a much shorter file
# that just contains t... | 34.273319 | 79 | 0.588924 |
import errno
import os
import re
import subprocess
import sys
def get_keywords():
git_refnames = " (HEAD -> master)"
git_full = "47b5f506f2fccb472417daef014fdce9734c5262"
keywords = {"refnames": git_refnames, "full": git_full}
return keywords
class VersioneerConfig:
... | true | true |
f7f70854847abbc571223b1e682156066637ec94 | 7,501 | py | Python | cloudkeeperV1/plugins/cleanup_aws_vpcs/cloudkeeper_plugin_cleanup_aws_vpcs/__init__.py | mesosphere/cloudkeeper | 11be262df5874c1033cfec9964bba1596cab6a36 | [
"Apache-2.0"
] | 99 | 2020-04-15T22:56:34.000Z | 2021-06-13T15:04:55.000Z | cloudkeeperV1/plugins/cleanup_aws_vpcs/cloudkeeper_plugin_cleanup_aws_vpcs/__init__.py | mesosphere/cloudkeeper | 11be262df5874c1033cfec9964bba1596cab6a36 | [
"Apache-2.0"
] | null | null | null | cloudkeeperV1/plugins/cleanup_aws_vpcs/cloudkeeper_plugin_cleanup_aws_vpcs/__init__.py | mesosphere/cloudkeeper | 11be262df5874c1033cfec9964bba1596cab6a36 | [
"Apache-2.0"
] | 14 | 2020-04-14T22:13:59.000Z | 2021-04-05T16:42:31.000Z | import cklib.logging
import threading
import yaml
from cklib.baseplugin import BasePlugin
from cloudkeeper_plugin_aws.resources import (
AWSVPC,
AWSVPCPeeringConnection,
AWSEC2NetworkAcl,
AWSEC2NetworkInterface,
AWSELB,
AWSALB,
AWSALBTargetGroup,
AWSEC2Subnet,
AWSEC2SecurityGroup,
... | 35.051402 | 111 | 0.510599 | import cklib.logging
import threading
import yaml
from cklib.baseplugin import BasePlugin
from cloudkeeper_plugin_aws.resources import (
AWSVPC,
AWSVPCPeeringConnection,
AWSEC2NetworkAcl,
AWSEC2NetworkInterface,
AWSELB,
AWSALB,
AWSALBTargetGroup,
AWSEC2Subnet,
AWSEC2SecurityGroup,
... | true | true |
f7f708fdd1fd65fa0937410bf18ec42e90c36cff | 26,844 | py | Python | pytorch_lightning/trainer/connectors/logger_connector/result.py | FeryET/pytorch-lightning | b1f8b111b5085373599758a4e155a482259cdbf0 | [
"Apache-2.0"
] | null | null | null | pytorch_lightning/trainer/connectors/logger_connector/result.py | FeryET/pytorch-lightning | b1f8b111b5085373599758a4e155a482259cdbf0 | [
"Apache-2.0"
] | 1 | 2022-02-09T17:24:56.000Z | 2022-02-09T17:24:56.000Z | pytorch_lightning/trainer/connectors/logger_connector/result.py | FeryET/pytorch-lightning | b1f8b111b5085373599758a4e155a482259cdbf0 | [
"Apache-2.0"
] | null | null | null | # Copyright The PyTorch Lightning team.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to i... | 38.680115 | 118 | 0.631985 |
from collections.abc import Generator
from dataclasses import asdict, dataclass, replace
from functools import partial, wraps
from typing import Any, Callable, cast, Dict, List, Optional, Tuple, Union
import torch
from torchmetrics import Metric
from typing_extensions import TypedDict
from pytorch_lightn... | true | true |
f7f70935c9b029703531a2e75bfe3d5fdc21b428 | 13,176 | py | Python | mealpy/swarm_based/SSpiderO.py | rishavpramanik/mealpy | d4a4d5810f15837764e4ee61517350fef3dc92b3 | [
"MIT"
] | null | null | null | mealpy/swarm_based/SSpiderO.py | rishavpramanik/mealpy | d4a4d5810f15837764e4ee61517350fef3dc92b3 | [
"MIT"
] | null | null | null | mealpy/swarm_based/SSpiderO.py | rishavpramanik/mealpy | d4a4d5810f15837764e4ee61517350fef3dc92b3 | [
"MIT"
] | null | null | null | # !/usr/bin/env python
# Created by "Thieu" at 12:00, 17/03/2020 ----------%
# Email: nguyenthieu2102@gmail.com %
# Github: https://github.com/thieu1995 %
# --------------------------------------------------%
import numpy as np
from copy import deepcopy
from mealpy.optimizer import Optimi... | 44.969283 | 127 | 0.571949 |
import numpy as np
from copy import deepcopy
from mealpy.optimizer import Optimizer
class BaseSSpiderO(Optimizer):
ID_POS = 0
ID_TAR = 1
ID_WEI = 2
def __init__(self, problem, epoch=10000, pop_size=100, fp=(0.65, 0.9), **kwargs):
super().__init__(problem, kwargs)
self.epoch = s... | true | true |
f7f70a5ecfd42971596974d39c584f7e3a1ad0e9 | 196 | py | Python | syslog_parse/message.py | BingerYang/syslog_parse | c5d88c6792d67c4a5cf92e0344475a7f84f59447 | [
"MIT"
] | 2 | 2019-08-25T13:37:35.000Z | 2020-03-19T13:58:34.000Z | syslog_parse/message.py | BingerYang/syslog_parse | c5d88c6792d67c4a5cf92e0344475a7f84f59447 | [
"MIT"
] | 1 | 2020-10-24T04:50:08.000Z | 2020-10-24T04:50:08.000Z | syslog_parse/message.py | BingerYang/syslog_parse | c5d88c6792d67c4a5cf92e0344475a7f84f59447 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from collections import namedtuple
Message = namedtuple('Message',
['facility', 'severity', 'timestamp', 'hostname', 'module', 'digest', 'content'])
| 28 | 102 | 0.596939 |
from collections import namedtuple
Message = namedtuple('Message',
['facility', 'severity', 'timestamp', 'hostname', 'module', 'digest', 'content'])
| true | true |
f7f70a6c061b0a1b0fd0b4a0972ff9ce651c67fd | 518 | py | Python | mysite/storehouse/migrations/0007_user_create_date.py | othmankurdi/storehouse | c702abac6ad7bceef59913485ae7ead4f0f884d7 | [
"MIT"
] | null | null | null | mysite/storehouse/migrations/0007_user_create_date.py | othmankurdi/storehouse | c702abac6ad7bceef59913485ae7ead4f0f884d7 | [
"MIT"
] | 3 | 2021-11-28T10:18:00.000Z | 2021-11-28T10:39:55.000Z | mysite/storehouse/migrations/0007_user_create_date.py | othmankurdi/storehouse | c702abac6ad7bceef59913485ae7ead4f0f884d7 | [
"MIT"
] | null | null | null | # Generated by Django 3.2.6 on 2021-11-27 20:17
from django.db import migrations, models
import django.utils.timezone
class Migration(migrations.Migration):
dependencies = [
('storehouse', '0006_rename_update_time_product_update_date'),
]
operations = [
migrations.AddField(
... | 24.666667 | 93 | 0.65251 |
from django.db import migrations, models
import django.utils.timezone
class Migration(migrations.Migration):
dependencies = [
('storehouse', '0006_rename_update_time_product_update_date'),
]
operations = [
migrations.AddField(
model_name='user',
name='create_dat... | true | true |
f7f70ae3e3cc30f82f990dc17bb654eea7024c34 | 8,868 | py | Python | exercises/networking_selfpaced/networking-workshop/collections/ansible_collections/community/general/plugins/module_utils/network/exos/exos.py | tr3ck3r/linklight | 5060f624c235ecf46cb62cefcc6bddc6bf8ca3e7 | [
"MIT"
] | null | null | null | exercises/networking_selfpaced/networking-workshop/collections/ansible_collections/community/general/plugins/module_utils/network/exos/exos.py | tr3ck3r/linklight | 5060f624c235ecf46cb62cefcc6bddc6bf8ca3e7 | [
"MIT"
] | null | null | null | exercises/networking_selfpaced/networking-workshop/collections/ansible_collections/community/general/plugins/module_utils/network/exos/exos.py | tr3ck3r/linklight | 5060f624c235ecf46cb62cefcc6bddc6bf8ca3e7 | [
"MIT"
] | null | null | null | # This code is part of Ansible, but is an independent component.
# This particular file snippet, and this file snippet only, is BSD licensed.
# Modules you write using this snippet, which is embedded dynamically by Ansible
# still belong to the author of the module, and may assign their own license
# to the complete wo... | 40.309091 | 160 | 0.689671 |
import json
from ansible.module_utils._text import to_text
from ansible.module_utils.basic import env_fallback
from ansible_collections.ansible.netcommon.plugins.module_utils.network.common.utils import to_list, ComplexList
from ansible.module_utils.common._collections_compat import Mapping
f... | true | true |
f7f70b7e1e0c6f557a53a74eb09efafeb4968d24 | 9,438 | py | Python | main.py | ArkAngeL43/DBROWSER-V2 | 2b753d919314d5c3bab8eb8d04257fd352da1d44 | [
"MIT"
] | 6 | 2021-07-30T17:42:32.000Z | 2021-09-28T17:48:38.000Z | main.py | ThomTiber/DBROWSER-V2 | 2b753d919314d5c3bab8eb8d04257fd352da1d44 | [
"MIT"
] | null | null | null | main.py | ThomTiber/DBROWSER-V2 | 2b753d919314d5c3bab8eb8d04257fd352da1d44 | [
"MIT"
] | 1 | 2021-10-04T21:46:41.000Z | 2021-10-04T21:46:41.000Z | import os
import sys
import time
import colorama
import pyfiglet
from colorama import Fore
import json
import subprocess
os.system(' clear ')
def restart_program():
python = sys.executable
os.execl(python, python, * sys.argv)
curdir = os.getcwd()
def load_animation():
load_str = "Loading DBRO... | 28.862385 | 101 | 0.475207 | import os
import sys
import time
import colorama
import pyfiglet
from colorama import Fore
import json
import subprocess
os.system(' clear ')
def restart_program():
python = sys.executable
os.execl(python, python, * sys.argv)
curdir = os.getcwd()
def load_animation():
load_str = "Loading DBRO... | true | true |
f7f70bba530c2576066b46b6f29fec1d0183d8fb | 2,533 | py | Python | modules/frame.py | manparvesh/chenab | b91d4fe9a3295526d46a8424ec22ed8a4f5e110f | [
"MIT"
] | 1 | 2018-06-16T20:19:07.000Z | 2018-06-16T20:19:07.000Z | modules/frame.py | manparvesh/chenab | b91d4fe9a3295526d46a8424ec22ed8a4f5e110f | [
"MIT"
] | null | null | null | modules/frame.py | manparvesh/chenab | b91d4fe9a3295526d46a8424ec22ed8a4f5e110f | [
"MIT"
] | null | null | null | import collections
Block = collections.namedtuple("Block", "type, handler, stack_height")
class Frame(object):
"""
collection of attributes with no methods
the attributes include the code object created by the compiler;
the local, global, and builtin namespaces; a reference to the previous frame;
... | 26.113402 | 81 | 0.564153 | import collections
Block = collections.namedtuple("Block", "type, handler, stack_height")
class Frame(object):
def __init__(self, code_object, global_names, local_names, previous_frame):
self.code_obj = code_object
self.global_names = global_names
self.local_names = local_names
s... | true | true |
f7f70c1eae77eab98bb230631a9efba5e604e4ad | 19,347 | py | Python | ml-agents/mlagents/trainers/ppo/trainer.py | yueqiw/ml-agents | 499120a45c6a0203ff39770ded9a9dc6069ffa46 | [
"Apache-2.0"
] | null | null | null | ml-agents/mlagents/trainers/ppo/trainer.py | yueqiw/ml-agents | 499120a45c6a0203ff39770ded9a9dc6069ffa46 | [
"Apache-2.0"
] | null | null | null | ml-agents/mlagents/trainers/ppo/trainer.py | yueqiw/ml-agents | 499120a45c6a0203ff39770ded9a9dc6069ffa46 | [
"Apache-2.0"
] | null | null | null | # # Unity ML-Agents Toolkit
# ## ML-Agent Learning (PPO)
# Contains an implementation of PPO as described (https://arxiv.org/abs/1707.06347).
import logging
import os
from collections import deque
import numpy as np
import tensorflow as tf
from mlagents.envs import AllBrainInfo, BrainInfo
from mlagents.trainers.buff... | 49.735219 | 119 | 0.622732 | np
import tensorflow as tf
from mlagents.envs import AllBrainInfo, BrainInfo
from mlagents.trainers.buffer import Buffer
from mlagents.trainers.ppo.policy import PPOPolicy
from mlagents.trainers.trainer import UnityTrainerException, Trainer
logger = logging.getLogger("mlagents.envs")
class PPOTrainer(Trainer):
... | true | true |
f7f70c5704b0f62eb733995a6c895799f78fe3b1 | 4,148 | py | Python | paddlespeech/s2t/training/optimizer.py | JiehangXie/PaddleSpeech | 60090b49ec27437127ab62358026dd5bb95fccc7 | [
"Apache-2.0"
] | 1,540 | 2017-11-14T13:26:33.000Z | 2021-11-09T14:05:08.000Z | paddlespeech/s2t/training/optimizer.py | JiehangXie/PaddleSpeech | 60090b49ec27437127ab62358026dd5bb95fccc7 | [
"Apache-2.0"
] | 599 | 2017-11-14T13:19:12.000Z | 2021-11-09T01:58:26.000Z | paddlespeech/s2t/training/optimizer.py | JiehangXie/PaddleSpeech | 60090b49ec27437127ab62358026dd5bb95fccc7 | [
"Apache-2.0"
] | 449 | 2017-11-14T12:48:46.000Z | 2021-11-06T09:34:33.000Z | # Copyright (c) 2021 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... | 33.723577 | 108 | 0.652604 |
from typing import Any
from typing import Dict
from typing import Text
import paddle
from paddle.optimizer import Optimizer
from paddle.regularizer import L2Decay
from paddlespeech.s2t.training.gradclip import ClipGradByGlobalNormWithLog
from paddlespeech.s2t.utils.dynamic_import import dynamic_import
f... | true | true |
f7f70f3e857c7fdd7abe636dc4ad200a8c0402c9 | 2,054 | py | Python | metriche.py | ferr26/toolMusicPlagiarism | cc6985d9847ca5589b5a0792845b7e85ce80e634 | [
"MIT"
] | null | null | null | metriche.py | ferr26/toolMusicPlagiarism | cc6985d9847ca5589b5a0792845b7e85ce80e634 | [
"MIT"
] | null | null | null | metriche.py | ferr26/toolMusicPlagiarism | cc6985d9847ca5589b5a0792845b7e85ce80e634 | [
"MIT"
] | null | null | null | import textdistance as td
import math
import numpy as np
global y_predNorm
global y_trueNorm
#Token based
def jaccard(y_predNorm,y_trueNorm):
return td.jaccard.similarity(y_predNorm, y_trueNorm)
def coseno(y_predNorm,y_trueNorm):
return td.cosine.similarity(y_predNorm, y_trueNorm)
#da fare
def cityblock_d... | 24.746988 | 68 | 0.684518 | import textdistance as td
import math
import numpy as np
global y_predNorm
global y_trueNorm
def jaccard(y_predNorm,y_trueNorm):
return td.jaccard.similarity(y_predNorm, y_trueNorm)
def coseno(y_predNorm,y_trueNorm):
return td.cosine.similarity(y_predNorm, y_trueNorm)
def cityblock_distance(A, B):
r... | true | true |
f7f710dfe8ec9eba4b1abe779369d7eae6491957 | 8,770 | py | Python | ddsp/training/ddsp_run.py | Tiamat-Tech/ddsp | cd57829b9caa8643d37994caf6e1ee0a7fc11ad8 | [
"Apache-2.0"
] | 2,148 | 2020-01-14T20:08:54.000Z | 2022-03-29T22:17:08.000Z | ddsp/training/ddsp_run.py | Tiamat-Tech/ddsp | cd57829b9caa8643d37994caf6e1ee0a7fc11ad8 | [
"Apache-2.0"
] | 197 | 2020-01-15T15:22:29.000Z | 2022-03-24T22:50:00.000Z | ddsp/training/ddsp_run.py | Tiamat-Tech/ddsp | cd57829b9caa8643d37994caf6e1ee0a7fc11ad8 | [
"Apache-2.0"
] | 261 | 2020-01-15T08:16:03.000Z | 2022-03-28T08:42:07.000Z | # Copyright 2021 The DDSP Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wri... | 37.478632 | 80 | 0.648233 |
import os
import time
from absl import app
from absl import flags
from absl import logging
from ddsp.training import cloud
from ddsp.training import eval_util
from ddsp.training import models
from ddsp.training import train_util
from ddsp.training import trainers
import gin
import pkg_resources
import ... | true | true |
f7f711562faf6e3d8f4d9e1dd446c228d4ab9b50 | 9,468 | py | Python | test/functional/tool_wallet.py | cruro/cruro | 80aa93365db5e6653bb8235fb61914ee4aa087e8 | [
"MIT"
] | null | null | null | test/functional/tool_wallet.py | cruro/cruro | 80aa93365db5e6653bb8235fb61914ee4aa087e8 | [
"MIT"
] | null | null | null | test/functional/tool_wallet.py | cruro/cruro | 80aa93365db5e6653bb8235fb61914ee4aa087e8 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) 2018-2019 The Cruro Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test bitcoin-wallet."""
import hashlib
import os
import stat
import subprocess
import textwrap
from tes... | 45.085714 | 144 | 0.668145 |
import hashlib
import os
import stat
import subprocess
import textwrap
from test_framework.test_framework import BitcoinTestFramework
from test_framework.util import assert_equal
BUFFER_SIZE = 16 * 1024
class ToolWalletTest(BitcoinTestFramework):
def set_test_params(self):
self.num_nodes = 1
... | true | true |
f7f711b68471ce5e5da3e55ce3108bab95f2f8f1 | 14,774 | py | Python | supcon/losses_test.py | pedersor/google-research | 6fa751dd261b3f6d918fd2cd35efef5d8bf3eea6 | [
"Apache-2.0"
] | null | null | null | supcon/losses_test.py | pedersor/google-research | 6fa751dd261b3f6d918fd2cd35efef5d8bf3eea6 | [
"Apache-2.0"
] | null | null | null | supcon/losses_test.py | pedersor/google-research | 6fa751dd261b3f6d918fd2cd35efef5d8bf3eea6 | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# Copyright 2022 The Google Research Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicab... | 44.634441 | 80 | 0.627657 |
from absl.testing import parameterized
import numpy as np
import tensorflow.compat.v2 as tf
from supcon import enums
from supcon import losses
class LossesTest(tf.test.TestCase, parameterized.TestCase):
def testKerasImplementation(self):
features = np.random.uniform(0., 1., (12, 2, 20))
lab... | true | true |
f7f711c01c02b0177cefeee4a613b3e4f7162a98 | 288 | py | Python | Module_system 1.171/header_map_icons.py | Sea-Monster/WarbandModuleSystem | 66c67147692707b85c457db10a112627118733a5 | [
"MIT"
] | 14 | 2018-09-20T23:01:27.000Z | 2021-05-25T11:05:09.000Z | Module_system 1.171/header_map_icons.py | Sea-Monster/WarbandModuleSystem | 66c67147692707b85c457db10a112627118733a5 | [
"MIT"
] | 44 | 2018-09-15T03:05:50.000Z | 2022-03-22T02:46:24.000Z | Module_system 1.171/header_map_icons.py | Sea-Monster/WarbandModuleSystem | 66c67147692707b85c457db10a112627118733a5 | [
"MIT"
] | 13 | 2018-10-02T11:45:24.000Z | 2021-08-22T18:41:44.000Z | ###################################################
# header_map_icons.py
# This file contains declarations for module_map_icons
# DO NOT EDIT THIS FILE!
###################################################
from header_common import *
## map icon flags
mcn_no_shadow = 0x00000001
| 22.153846 | 54 | 0.486111 | true | true | |
f7f7121942955db3d7a66be39b8f8eff225cc10a | 1,665 | py | Python | project1.py | AideenByrne/python-project | 90100295360db810d49cda3f0377fcca3866e33a | [
"Apache-2.0"
] | null | null | null | project1.py | AideenByrne/python-project | 90100295360db810d49cda3f0377fcca3866e33a | [
"Apache-2.0"
] | null | null | null | project1.py | AideenByrne/python-project | 90100295360db810d49cda3f0377fcca3866e33a | [
"Apache-2.0"
] | null | null | null |
#Aideen Byrne 26th March 2018
#Code for investigating Iris Data Set for Programming & Scripting module project
#Select only the rows of the Virginica flowers and assign it to virginica
import pandas as pd #import pandas library
df1 = pd.read_csv("data/iris.csv") #label contents of iris.csv file as dataframe
my_c... | 53.709677 | 208 | 0.771171 |
import pandas as pd
df1 = pd.read_csv("data/iris.csv")
my_columns = ["Sepal Length", "Sepal Width", "Petal Length", "Petal Width", "Species"]
df1.columns = my_columns
species = df1[["Species"]]
virginica = df1.loc[(df1["Species"] == "Iris-virginica")]
print (virginica)
vsepallength = virginica["Sepal Lengt... | true | true |
f7f712a4bfdda3ce48839e69af5b1f695fc2bfe5 | 877 | py | Python | farmer/urls.py | manulangat1/farmer | b71041fe8d961d815c1a70fb2be4357008d3a05f | [
"MIT"
] | 2 | 2020-02-06T20:54:00.000Z | 2020-02-10T08:37:28.000Z | farmer/urls.py | manulangat1/farmer | b71041fe8d961d815c1a70fb2be4357008d3a05f | [
"MIT"
] | 7 | 2020-06-05T19:24:13.000Z | 2022-03-11T23:32:22.000Z | farmer/urls.py | manulangat1/farmer | b71041fe8d961d815c1a70fb2be4357008d3a05f | [
"MIT"
] | null | null | null | """farmer URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.11/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-bas... | 36.541667 | 79 | 0.701254 | from django.conf.urls import url,include
from django.contrib import admin
urlpatterns = [
url(r'^admin/', admin.site.urls),
url(r'',include('farmer1.urls')),
url(r'^accounts/',include('registration.backends.simple.urls'))
]
| true | true |
f7f7136342fed3982ffb0acb7a12a76faa329167 | 4,916 | py | Python | nhentai/cmdline.py | violetdarkness/nhentai | c95ecdded4d15e47e520a7371f62fc8820e95418 | [
"MIT"
] | null | null | null | nhentai/cmdline.py | violetdarkness/nhentai | c95ecdded4d15e47e520a7371f62fc8820e95418 | [
"MIT"
] | null | null | null | nhentai/cmdline.py | violetdarkness/nhentai | c95ecdded4d15e47e520a7371f62fc8820e95418 | [
"MIT"
] | null | null | null | # coding: utf-8
from __future__ import print_function
import sys
from optparse import OptionParser
from nhentai import __version__
try:
from itertools import ifilter as filter
except ImportError:
pass
import nhentai.constant as constant
from nhentai.utils import urlparse, generate_html
from nhentai.logger impo... | 39.645161 | 117 | 0.591538 |
from __future__ import print_function
import sys
from optparse import OptionParser
from nhentai import __version__
try:
from itertools import ifilter as filter
except ImportError:
pass
import nhentai.constant as constant
from nhentai.utils import urlparse, generate_html
from nhentai.logger import logger
try:... | true | true |
f7f7137e588ca6e9ed60088050026169f4a815e3 | 269 | py | Python | sms_extras/sms_extras/doctype/sms_recipient_list_number/sms_recipient_list_number.py | libermatic/sms_extras | 8e94013b26970edda2c80c6d4e9ecd515e9a1fa7 | [
"MIT"
] | 4 | 2020-08-26T23:08:26.000Z | 2022-02-12T13:20:30.000Z | sms_extras/sms_extras/doctype/sms_recipient_list_number/sms_recipient_list_number.py | libermatic/sms_extras | 8e94013b26970edda2c80c6d4e9ecd515e9a1fa7 | [
"MIT"
] | null | null | null | sms_extras/sms_extras/doctype/sms_recipient_list_number/sms_recipient_list_number.py | libermatic/sms_extras | 8e94013b26970edda2c80c6d4e9ecd515e9a1fa7 | [
"MIT"
] | 3 | 2020-09-13T16:12:35.000Z | 2022-03-03T05:14:43.000Z | # -*- coding: utf-8 -*-
# Copyright (c) 2019, Libermatic and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe.model.document import Document
class SMSRecipientListNumber(Document):
pass
| 24.454545 | 49 | 0.791822 |
from __future__ import unicode_literals
import frappe
from frappe.model.document import Document
class SMSRecipientListNumber(Document):
pass
| true | true |
f7f713875b309e22d774f50051288268b0691c73 | 620 | py | Python | Task2B.py | PerryLewis01/FloodWarning | 6bdce9277755ef0826789eb193ddf3f7f3457ab7 | [
"MIT"
] | null | null | null | Task2B.py | PerryLewis01/FloodWarning | 6bdce9277755ef0826789eb193ddf3f7f3457ab7 | [
"MIT"
] | null | null | null | Task2B.py | PerryLewis01/FloodWarning | 6bdce9277755ef0826789eb193ddf3f7f3457ab7 | [
"MIT"
] | null | null | null | from floodsystem.flood import stations_level_over_threshold
from floodsystem.stationdata import build_station_list, update_water_levels
def run():
# Build list of stations
stations = build_station_list()
# Update latest level data for all stations
update_water_levels(stations)
for i in stati... | 29.52381 | 75 | 0.7 | from floodsystem.flood import stations_level_over_threshold
from floodsystem.stationdata import build_station_list, update_water_levels
def run():
stations = build_station_list()
update_water_levels(stations)
for i in stations_level_over_threshold(stations, 0.8):
print("{} {}".for... | true | true |
f7f71465bf2f2a6598ac225bae59bb7d73a52b14 | 22,672 | py | Python | manila/tests/share/drivers/hdfs/test_hdfs_native.py | mail2nsrajesh/manila | ec052a6cff2ddc722e3b78ab208801e6b94ab55a | [
"Apache-2.0"
] | null | null | null | manila/tests/share/drivers/hdfs/test_hdfs_native.py | mail2nsrajesh/manila | ec052a6cff2ddc722e3b78ab208801e6b94ab55a | [
"Apache-2.0"
] | null | null | null | manila/tests/share/drivers/hdfs/test_hdfs_native.py | mail2nsrajesh/manila | ec052a6cff2ddc722e3b78ab208801e6b94ab55a | [
"Apache-2.0"
] | null | null | null | # Copyright 2015 Intel, Corp.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agree... | 46.746392 | 78 | 0.615914 |
import socket
import mock
from oslo_concurrency import processutils
from oslo_config import cfg
import six
from manila import context
from manila import exception
import manila.share.configuration as config
import manila.share.drivers.hdfs.hdfs_native as hdfs_native
from manila import test
from manila.... | true | true |
f7f7159c9914610b6bf75c401a71383dc8f50e28 | 1,267 | py | Python | mlplaygrounds/datasets/tests/test_serializers/test_mlmodel_lite_serializer.py | rennym19/ml-playgrounds | a3927c0b5b73588745f07527eb6c1a542fac8afb | [
"MIT"
] | null | null | null | mlplaygrounds/datasets/tests/test_serializers/test_mlmodel_lite_serializer.py | rennym19/ml-playgrounds | a3927c0b5b73588745f07527eb6c1a542fac8afb | [
"MIT"
] | 7 | 2020-06-12T03:13:50.000Z | 2021-09-22T19:01:10.000Z | mlplaygrounds/datasets/tests/test_serializers/test_mlmodel_lite_serializer.py | rennym19/ml-playgrounds | a3927c0b5b73588745f07527eb6c1a542fac8afb | [
"MIT"
] | null | null | null | from unittest import TestCase
from unittest.mock import patch
from django_mock_queries.query import MockModel
from bson import ObjectId
from mlplaygrounds.datasets.serializers.models import MLModelLiteSerializer
class TestMLModelLiteSerializer(TestCase):
def setUp(self):
self.valid_instance = MockModel... | 35.194444 | 75 | 0.624309 | from unittest import TestCase
from unittest.mock import patch
from django_mock_queries.query import MockModel
from bson import ObjectId
from mlplaygrounds.datasets.serializers.models import MLModelLiteSerializer
class TestMLModelLiteSerializer(TestCase):
def setUp(self):
self.valid_instance = MockModel... | true | true |
f7f71655698243e910fdac17b3b7914ec21baa13 | 85 | py | Python | store/__init__.py | Semior001/tg2pub | cdd0474ec27b061b52ac26011126eec66276c0ca | [
"MIT"
] | null | null | null | store/__init__.py | Semior001/tg2pub | cdd0474ec27b061b52ac26011126eec66276c0ca | [
"MIT"
] | null | null | null | store/__init__.py | Semior001/tg2pub | cdd0474ec27b061b52ac26011126eec66276c0ca | [
"MIT"
] | null | null | null | from .store import Store
from .vedisdb import VedisDB
__all__ = ['Store', 'VedisDB'] | 21.25 | 30 | 0.741176 | from .store import Store
from .vedisdb import VedisDB
__all__ = ['Store', 'VedisDB'] | true | true |
f7f7165a4cf43f704d703f203482929bb09a0bda | 2,347 | py | Python | Advance_Python/Database_Connectivity/Prepared_Statement.py | siddharth-143/Python | 293f4643a3a13e3b82d23fd8922db54dbb0f12bc | [
"MIT"
] | null | null | null | Advance_Python/Database_Connectivity/Prepared_Statement.py | siddharth-143/Python | 293f4643a3a13e3b82d23fd8922db54dbb0f12bc | [
"MIT"
] | null | null | null | Advance_Python/Database_Connectivity/Prepared_Statement.py | siddharth-143/Python | 293f4643a3a13e3b82d23fd8922db54dbb0f12bc | [
"MIT"
] | null | null | null | # Prepared Statement
import mysql.connector
def student_data(fetch): # def student_data(nm, ro, fe)
try:
conn = mysql.connector.connect(
user="root",
password="password",
host="localhost",
database="pdb",
port=3306
)
if con... | 27.290698 | 108 | 0.551768 |
import mysql.connector
def student_data(fetch):
try:
conn = mysql.connector.connect(
user="root",
password="password",
host="localhost",
database="pdb",
port=3306
)
if conn.is_connected():
print("Connect Suc... | true | true |
f7f7191bb1bd9fa1d266f49d60d0fde8ffb3ac7d | 475 | py | Python | integration_tests/test_transforms_torchvision.py | andreaconti/torch_k | a5bf09b22d3bef9092d7313dda529af83da15dc6 | [
"MIT"
] | 6 | 2021-06-26T18:19:50.000Z | 2022-02-04T14:16:56.000Z | integration_tests/test_transforms_torchvision.py | andreaconti/torch_k | a5bf09b22d3bef9092d7313dda529af83da15dc6 | [
"MIT"
] | 3 | 2020-11-19T14:41:53.000Z | 2020-11-20T12:26:02.000Z | integration_tests/test_transforms_torchvision.py | andreaconti/torch_kitti | a5bf09b22d3bef9092d7313dda529af83da15dc6 | [
"MIT"
] | null | null | null | """
testing integration between torchvision and transformations
"""
import torch
import torchvision.transforms as V
import torch_kitti.transforms as K
def test_random_crop():
# simulate input
fake_img_1 = torch.randn(1, 600, 600)
fake_img_2 = fake_img_1.clone()
x = {"img_left": fake_img_1, "img_rig... | 23.75 | 72 | 0.72 |
import torch
import torchvision.transforms as V
import torch_kitti.transforms as K
def test_random_crop():
fake_img_1 = torch.randn(1, 600, 600)
fake_img_2 = fake_img_1.clone()
x = {"img_left": fake_img_1, "img_right": fake_img_2}
output = K.functional.apply_to_features(V.RandomCrop([200, 200... | true | true |
f7f71bed6073f64979f789e6ef5964c27e7d1eb0 | 1,941 | py | Python | TemplateTest/templatetest/config/environment.py | mohseenrm/pylons | 3a21c5399832a1d47f12646598c4d82d4c15da9c | [
"MIT"
] | null | null | null | TemplateTest/templatetest/config/environment.py | mohseenrm/pylons | 3a21c5399832a1d47f12646598c4d82d4c15da9c | [
"MIT"
] | null | null | null | TemplateTest/templatetest/config/environment.py | mohseenrm/pylons | 3a21c5399832a1d47f12646598c4d82d4c15da9c | [
"MIT"
] | null | null | null | """Pylons environment configuration"""
import os
from mako.lookup import TemplateLookup
from pylons.configuration import PylonsConfig
from pylons.error import handle_mako_error
from sqlalchemy import engine_from_config
import templatetest.lib.app_globals as app_globals
import templatetest.lib.helpers
from templatetes... | 35.290909 | 79 | 0.717156 | import os
from mako.lookup import TemplateLookup
from pylons.configuration import PylonsConfig
from pylons.error import handle_mako_error
from sqlalchemy import engine_from_config
import templatetest.lib.app_globals as app_globals
import templatetest.lib.helpers
from templatetest.config.routing import make_map
from t... | true | true |
f7f71ca8b451dd13607185cac141abc57a6b68a3 | 7,676 | py | Python | u2flib_host/hid_transport.py | o-/python-u2flib-host | 27dc866368f96f071c9edb3ba90bd628f14ad21c | [
"BSD-2-Clause"
] | 43 | 2015-01-12T18:27:25.000Z | 2021-11-16T21:11:56.000Z | u2flib_host/hid_transport.py | o-/python-u2flib-host | 27dc866368f96f071c9edb3ba90bd628f14ad21c | [
"BSD-2-Clause"
] | 35 | 2015-04-07T18:01:43.000Z | 2019-12-05T12:25:30.000Z | u2flib_host/hid_transport.py | o-/python-u2flib-host | 27dc866368f96f071c9edb3ba90bd628f14ad21c | [
"BSD-2-Clause"
] | 26 | 2015-02-25T15:31:04.000Z | 2021-11-16T21:11:40.000Z | # Copyright (c) 2013 Yubico AB
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or
# without modification, are permitted provided that the following
# conditions are met:
#
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditi... | 32.803419 | 74 | 0.614513 |
from __future__ import print_function
import os
try:
import hidraw as hid
except ImportError:
import hid
from time import time, sleep
from u2flib_host.device import U2FDevice
from u2flib_host.yubicommon.compat import byte2int, int2byte
from u2flib_host import exc
DEVICES = [
(... | true | true |
f7f71d7ea12eaf040de22ec23d2beb9d36c13c15 | 399 | py | Python | intraviewAI/wsgi.py | underflow101/intraviewAI | 0775fe532d650c53d3248a3ccf5b6d67b948ebbe | [
"MIT"
] | null | null | null | intraviewAI/wsgi.py | underflow101/intraviewAI | 0775fe532d650c53d3248a3ccf5b6d67b948ebbe | [
"MIT"
] | null | null | null | intraviewAI/wsgi.py | underflow101/intraviewAI | 0775fe532d650c53d3248a3ccf5b6d67b948ebbe | [
"MIT"
] | null | null | null | """
WSGI config for intraviewAI project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/2.2/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault('DJANGO_S... | 23.470588 | 78 | 0.789474 |
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'intraviewAI.settings')
application = get_wsgi_application()
| true | true |
f7f71da609b1fc21903cf0e2256ad87f6168887c | 36 | py | Python | src/genderizerQc/__init__.py | jaytouz/genderizeQc | 79449634a15023c1ddcab51bce77eb3d61b51689 | [
"MIT"
] | null | null | null | src/genderizerQc/__init__.py | jaytouz/genderizeQc | 79449634a15023c1ddcab51bce77eb3d61b51689 | [
"MIT"
] | null | null | null | src/genderizerQc/__init__.py | jaytouz/genderizeQc | 79449634a15023c1ddcab51bce77eb3d61b51689 | [
"MIT"
] | null | null | null | from .genderizer import GenderizerQc | 36 | 36 | 0.888889 | from .genderizer import GenderizerQc | true | true |
f7f71dceb0f115a3cfbbe40ea73ccc793514d974 | 25,788 | py | Python | corankco/experiments/stats/bootstrap_experiment.py | pierreandrieu/corankcolight | dce9d05c62f25faae5f73f150f44cc20bfa87b33 | [
"MIT"
] | null | null | null | corankco/experiments/stats/bootstrap_experiment.py | pierreandrieu/corankcolight | dce9d05c62f25faae5f73f150f44cc20bfa87b33 | [
"MIT"
] | null | null | null | corankco/experiments/stats/bootstrap_experiment.py | pierreandrieu/corankcolight | dce9d05c62f25faae5f73f150f44cc20bfa87b33 | [
"MIT"
] | null | null | null | from corankco.algorithms.median_ranking import MedianRanking
from corankco.dataset import DatasetSelector, Dataset
from corankco.scoringscheme import ScoringScheme
from corankco.experiments.experiment import ExperimentFromDataset, ExperimentFromOrphanetDataset
from corankco.experiments.stats.bootstrap import bootstrap_... | 46.464865 | 139 | 0.569567 | from corankco.algorithms.median_ranking import MedianRanking
from corankco.dataset import DatasetSelector, Dataset
from corankco.scoringscheme import ScoringScheme
from corankco.experiments.experiment import ExperimentFromDataset, ExperimentFromOrphanetDataset
from corankco.experiments.stats.bootstrap import bootstrap_... | true | true |
f7f71e0011d41427e8bdcc44986f9e10bc21d3cb | 11,681 | py | Python | ament_tools/helper.py | richmattes/ament_tools | 2a25cdcc273fcd73e81e8a47fe892a0b5963307d | [
"Apache-2.0"
] | 1 | 2020-05-19T14:33:49.000Z | 2020-05-19T14:33:49.000Z | ros2_mod_ws/install/lib/python3.7/site-packages/ament_tools/helper.py | mintforpeople/robobo-ros2-ios-port | 1a5650304bd41060925ebba41d6c861d5062bfae | [
"Apache-2.0"
] | null | null | null | ros2_mod_ws/install/lib/python3.7/site-packages/ament_tools/helper.py | mintforpeople/robobo-ros2-ios-port | 1a5650304bd41060925ebba41d6c861d5062bfae | [
"Apache-2.0"
] | null | null | null | # Copyright 2014 Open Source Robotics Foundation, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law... | 37.925325 | 98 | 0.623491 |
import argparse
import filecmp
from multiprocessing import cpu_count
import os
import re
import shlex
import shutil
import stat
from ament_tools.package_types import package_exists_at
def argparse_existing_dir(path):
if not os.path.exists(path):
raise argparse.ArgumentTypeError("Path '%s' d... | true | true |
f7f71e598a74aa91592c5e8c711b50241522cb79 | 2,028 | py | Python | otlplus/urls.py | victory-jooyon/otlplus | 88bf72972e5d63e29355a9e60f7a5fec247b5890 | [
"MIT"
] | null | null | null | otlplus/urls.py | victory-jooyon/otlplus | 88bf72972e5d63e29355a9e60f7a5fec247b5890 | [
"MIT"
] | null | null | null | otlplus/urls.py | victory-jooyon/otlplus | 88bf72972e5d63e29355a9e60f7a5fec247b5890 | [
"MIT"
] | null | null | null | """otlplus 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-bas... | 36.872727 | 105 | 0.720414 | from django.conf.urls import include, url
from django.contrib import admin
from django.http import HttpResponse, HttpResponseRedirect
from settings import BASE_DIR
import os
from django.conf.urls import (
handler400, handler403, handler404, handler500
)
from django.conf import settings
from django.conf.urls.static... | true | true |
f7f71f473620bf4be8dbe525823f8a59b77bb274 | 2,347 | py | Python | util/eval_tools.py | QUVA-Lab/lang-tracker | 6cb3630471765565b6f2d34a160f0cd51d95a082 | [
"BSD-2-Clause-FreeBSD"
] | 31 | 2017-09-13T13:40:59.000Z | 2022-01-25T16:55:19.000Z | util/eval_tools.py | zhenyangli/lang-tracker | dddd808a22582573ab0a5e4c3dbf0ba054e42d61 | [
"BSD-3-Clause"
] | 4 | 2017-09-14T01:56:58.000Z | 2021-01-28T00:58:58.000Z | util/eval_tools.py | QUVA-Lab/lang-tracker | 6cb3630471765565b6f2d34a160f0cd51d95a082 | [
"BSD-2-Clause-FreeBSD"
] | 9 | 2017-09-28T03:22:08.000Z | 2021-01-19T10:56:44.000Z | from __future__ import absolute_import, division, print_function
import numpy as np
import pyximport; pyximport.install()
from util.nms import cpu_nms as nms
# all boxes are [xmin, ymin, xmax, ymax] format, 0-indexed, including xmax and ymax
def compute_bbox_iou(bboxes, target):
if isinstance(bboxes, list):
... | 36.107692 | 84 | 0.587133 | from __future__ import absolute_import, division, print_function
import numpy as np
import pyximport; pyximport.install()
from util.nms import cpu_nms as nms
def compute_bbox_iou(bboxes, target):
if isinstance(bboxes, list):
bboxes = np.array(bboxes)
bboxes = bboxes.reshape((-1, 4))
if isinstanc... | true | true |
f7f720c190c39423b35613c01e9bd1634592fdfa | 887 | py | Python | model/utils/losses.py | katsugeneration/ml-project-template | fe68c2f3fa6b6e51cc29b340cb2a1aeeca221322 | [
"MIT"
] | 5 | 2019-08-29T06:25:38.000Z | 2021-01-22T17:10:13.000Z | model/utils/losses.py | katsugeneration/ml-project-template | fe68c2f3fa6b6e51cc29b340cb2a1aeeca221322 | [
"MIT"
] | null | null | null | model/utils/losses.py | katsugeneration/ml-project-template | fe68c2f3fa6b6e51cc29b340cb2a1aeeca221322 | [
"MIT"
] | null | null | null | # Copyright 2020 Katsuya Shimabukuro. All rights reserved.
# Licensed under the MIT License.
import tensorflow as tf
class MaskedSparseCategoricalCrossentropy():
"""SparseCategoricalCrossentropy without padding mask."""
def __call__(self, label, pred, **kwargs):
"""Calculate loss.
Args:
... | 32.851852 | 104 | 0.65389 |
import tensorflow as tf
class MaskedSparseCategoricalCrossentropy():
def __call__(self, label, pred, **kwargs):
mask = tf.math.logical_not(tf.math.equal(label, 0))
loss = tf.keras.losses.sparse_categorical_crossentropy(label, pred)
mask = tf.cast(mask, dtype=loss.dtype)
loss *=... | true | true |
f7f722da438db87fea079f7a44fffb6a8bae4acd | 2,682 | py | Python | app/core/models.py | VPuosk/recipe-app-api | 777bcac607664aea04d62e08fcc7c0baf80dd061 | [
"MIT"
] | null | null | null | app/core/models.py | VPuosk/recipe-app-api | 777bcac607664aea04d62e08fcc7c0baf80dd061 | [
"MIT"
] | null | null | null | app/core/models.py | VPuosk/recipe-app-api | 777bcac607664aea04d62e08fcc7c0baf80dd061 | [
"MIT"
] | null | null | null | import uuid
import os
from django.db import models
from django.contrib.auth.models import AbstractBaseUser, BaseUserManager, \
PermissionsMixin
from django.conf import settings
def recipe_image_file_path(instance, filename):
"""Generate file path for new recipe image"""
... | 29.152174 | 76 | 0.673751 | import uuid
import os
from django.db import models
from django.contrib.auth.models import AbstractBaseUser, BaseUserManager, \
PermissionsMixin
from django.conf import settings
def recipe_image_file_path(instance, filename):
ext = filename.split('.')[-1]
filename = f'{u... | true | true |
f7f72571461d757b4ac3d41732fd608785d342ce | 2,957 | py | Python | core/keyvalue/tests.py | jlin/inventory | c098c98e570c3bf9fadfd811eb75e1213f6ea428 | [
"BSD-3-Clause"
] | 22 | 2015-01-16T01:36:32.000Z | 2020-06-08T00:46:18.000Z | core/keyvalue/tests.py | jlin/inventory | c098c98e570c3bf9fadfd811eb75e1213f6ea428 | [
"BSD-3-Clause"
] | 8 | 2015-12-28T18:56:19.000Z | 2019-04-01T17:33:48.000Z | core/keyvalue/tests.py | jlin/inventory | c098c98e570c3bf9fadfd811eb75e1213f6ea428 | [
"BSD-3-Clause"
] | 13 | 2015-01-13T20:56:22.000Z | 2022-02-23T06:01:17.000Z | from django.test import TestCase
from django.test.client import Client
from core.group.models import Group
from mozdns.tests.utils import create_fake_zone
from core.registration.static.models import StaticReg
from systems.tests.utils import create_fake_host
class KVApiTests(TestCase):
def setUp(self):
s... | 32.494505 | 79 | 0.607034 | from django.test import TestCase
from django.test.client import Client
from core.group.models import Group
from mozdns.tests.utils import create_fake_zone
from core.registration.static.models import StaticReg
from systems.tests.utils import create_fake_host
class KVApiTests(TestCase):
def setUp(self):
s... | true | true |
f7f726b31142890a4cf0035a5abfee7c2a9c0ecb | 5,421 | py | Python | img_proc/overlap_canny_deeplearning.py | norton-chris/MARS-Net | 6f671837d0629422680c78adf9b643894debae70 | [
"MIT"
] | 2 | 2021-09-09T14:20:16.000Z | 2022-03-28T15:02:33.000Z | img_proc/overlap_canny_deeplearning.py | norton-chris/MARS-Net | 6f671837d0629422680c78adf9b643894debae70 | [
"MIT"
] | 3 | 2021-11-10T16:33:56.000Z | 2022-03-30T11:56:52.000Z | img_proc/overlap_canny_deeplearning.py | norton-chris/MARS-Net | 6f671837d0629422680c78adf9b643894debae70 | [
"MIT"
] | 2 | 2022-03-28T01:33:09.000Z | 2022-03-28T01:38:33.000Z | '''
Author Junbong Jang
8/18/2020
1. extract edge from deep learning segmentation
2. overlap canny edge from raw image and result from 1.
3. fill the edge
4. overlay edge with raw image
'''
import matplotlib
matplotlib.use('Agg') # Must be before importing matplotlib.pyplot or pylab!
import cv2
impor... | 35.900662 | 127 | 0.646929 |
import matplotlib
matplotlib.use('Agg')
import cv2
import numpy as np
from skimage import io
import matplotlib.pyplot as plt
import glob
import os
from PIL import Image
from scipy import ndimage
def auto_canny(image, canny_std_multiplier):
img_mean = np.average(image)
img_std = np.std(imag... | true | true |
f7f7271d14c4203d881dd61fee9b56bdf2239749 | 2,035 | py | Python | compare.py | trawick/emptyhammock-project-template | 4f102bbe314a8065e2b9dcaa627e8e03b34d9eab | [
"Apache-2.0"
] | null | null | null | compare.py | trawick/emptyhammock-project-template | 4f102bbe314a8065e2b9dcaa627e8e03b34d9eab | [
"Apache-2.0"
] | 14 | 2018-12-06T23:02:15.000Z | 2021-06-11T17:51:56.000Z | compare.py | trawick/emptyhammock-project-template | 4f102bbe314a8065e2b9dcaa627e8e03b34d9eab | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
import os
import re
import subprocess
import sys
def get_project_name(project_dir):
with open(os.path.join(project_dir, 'deploy', 'environments', 'all', 'vars.yml')) as f:
for l in f.readlines():
m = re.match('^project_name: (.*)$', l)
if m:
... | 29.492754 | 91 | 0.540049 |
import os
import re
import subprocess
import sys
def get_project_name(project_dir):
with open(os.path.join(project_dir, 'deploy', 'environments', 'all', 'vars.yml')) as f:
for l in f.readlines():
m = re.match('^project_name: (.*)$', l)
if m:
return m.group(1)
... | true | true |
f7f7286c577af9328a1e7d0026499528338d7bfe | 930 | py | Python | setup.py | LaurenceKuhl/rmageddon-cli | 5ea067ddab452cfa809f52495ca8232870cb2a54 | [
"MIT"
] | null | null | null | setup.py | LaurenceKuhl/rmageddon-cli | 5ea067ddab452cfa809f52495ca8232870cb2a54 | [
"MIT"
] | null | null | null | setup.py | LaurenceKuhl/rmageddon-cli | 5ea067ddab452cfa809f52495ca8232870cb2a54 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
from setuptools import setup, find_packages
import sys
version = '0.3.0'
with open('README.md') as f:
readme = f.read()
with open('LICENSE') as f:
license = f.read()
with open('requirements.txt') as f:
required = f.read().splitlines()
setup(
name='rmageddon',
version=ver... | 25.833333 | 82 | 0.622581 |
from setuptools import setup, find_packages
import sys
version = '0.3.0'
with open('README.md') as f:
readme = f.read()
with open('LICENSE') as f:
license = f.read()
with open('requirements.txt') as f:
required = f.read().splitlines()
setup(
name='rmageddon',
version=version,
description... | true | true |
f7f7291987fbcc394ca11997ce2000fa2fa962bd | 2,382 | py | Python | appengine/monorail/tracker/test/rerank_helpers_test.py | xinghun61/infra | b5d4783f99461438ca9e6a477535617fadab6ba3 | [
"BSD-3-Clause"
] | 2 | 2021-04-13T21:22:18.000Z | 2021-09-07T02:11:57.000Z | appengine/monorail/tracker/test/rerank_helpers_test.py | asdfghjjklllllaaa/infra | 8f63af54e46194cd29291813f2790ff6e986804d | [
"BSD-3-Clause"
] | 21 | 2020-09-06T02:41:05.000Z | 2022-03-02T04:40:01.000Z | appengine/monorail/tracker/test/rerank_helpers_test.py | xinghun61/infra | b5d4783f99461438ca9e6a477535617fadab6ba3 | [
"BSD-3-Clause"
] | null | null | null | # Copyright 2016 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file or at
# https://developers.google.com/open-source/licenses/bsd
"""Unittests for monorail.tracker.rerank_helpers."""
from __future__ import print_function
from... | 30.538462 | 75 | 0.675483 |
from __future__ import print_function
from __future__ import division
from __future__ import absolute_import
import unittest
from tracker import rerank_helpers
rerank_helpers.MAX_RANKING = 10
class Rerank_HelpersTest(unittest.TestCase):
def testGetInsertRankings(self):
lower = [(1, 0)]
higher = [(... | true | true |
f7f7299adba17fa579a06603bcb4c423be0c7817 | 1,858 | py | Python | env/lib/python2.7/site-packages/django/conf/locale/ml/formats.py | diego-d5000/MisValesMd | b641782bc2546776e9f55f452ec7fb48100dc482 | [
"MIT"
] | null | null | null | env/lib/python2.7/site-packages/django/conf/locale/ml/formats.py | diego-d5000/MisValesMd | b641782bc2546776e9f55f452ec7fb48100dc482 | [
"MIT"
] | null | null | null | env/lib/python2.7/site-packages/django/conf/locale/ml/formats.py | diego-d5000/MisValesMd | b641782bc2546776e9f55f452ec7fb48100dc482 | [
"MIT"
] | null | null | null | # -*- encoding: utf-8 -*-
# This file is distributed under the same license as the Django package.
#
from __future__ import unicode_literals
# The *_FORMAT strings use the Django date format syntax,
# see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
DATE_FORMAT = 'N j, Y'
TIME_FORMAT = 'P'... | 42.227273 | 82 | 0.519914 |
from __future__ import unicode_literals
FORMAT = 'N j, Y'
TIME_FORMAT = 'P'
DATETIME_FORMAT = 'N j, Y, P'
YEAR_MONTH_FORMAT = 'F Y'
MONTH_DAY_FORMAT = 'F j'
SHORT_DATE_FORMAT = 'm/d/Y'
SHORT_DATETIME_FORMAT = 'm/d/Y P'
FIRST_DAY_OF_WEEK = 0
'%Y-%m-%d', '%m/%d/%Y', '%m/%d/%y',
-%m-%d', ... | true | true |
f7f729cadd4540117d08793efdc87c511a3c09f8 | 5,716 | py | Python | circ2/parser.py | kepbod/CIRCexplorer2 | a7df1003d260a525aac36f9e2f81e9db5c3f5ec2 | [
"MIT"
] | 1 | 2016-07-18T07:34:29.000Z | 2016-07-18T07:34:29.000Z | circ2/parser.py | kepbod/CIRCexplorer2 | a7df1003d260a525aac36f9e2f81e9db5c3f5ec2 | [
"MIT"
] | null | null | null | circ2/parser.py | kepbod/CIRCexplorer2 | a7df1003d260a525aac36f9e2f81e9db5c3f5ec2 | [
"MIT"
] | null | null | null | import os
import pysam
from collections import defaultdict
from itertools import groupby
from .genomic_interval import Interval
class Segment(object):
'''
Modified from https://github.com/brentp/cigar
'''
def __init__(self, pos, cigar):
self.ref_start = int(pos) - 1
self.ref_end = self... | 35.283951 | 78 | 0.528341 | import os
import pysam
from collections import defaultdict
from itertools import groupby
from .genomic_interval import Interval
class Segment(object):
def __init__(self, pos, cigar):
self.ref_start = int(pos) - 1
self.ref_end = self.ref_start
read_consuming_ops = ("M", "I")
ref_con... | true | true |
f7f72a25b450822753412e7bd2164c22391555bf | 483 | py | Python | sim_scripts/SaveImage.py | avbotz/eva-public | 29996eba2c1c7df35025b8a2e7ab27169fa1fe10 | [
"MIT"
] | 2 | 2016-08-15T05:33:42.000Z | 2019-09-29T21:09:47.000Z | sim_scripts/SaveImage.py | avbotz/eva-public | 29996eba2c1c7df35025b8a2e7ab27169fa1fe10 | [
"MIT"
] | null | null | null | sim_scripts/SaveImage.py | avbotz/eva-public | 29996eba2c1c7df35025b8a2e7ab27169fa1fe10 | [
"MIT"
] | null | null | null | ## SaveImage.py
## Description: Saves Camera Images periodically (depending on the value set in the Logic Editor) for EVA.
## If SleepState is true, image saving is paused.
from bge import render
from bge import logic
controller = logic.getCurrentController()
object = controller.owner
path = logic.expand... | 34.5 | 106 | 0.726708 | render.setWindowSize(object['WindowWidth'], object['WindowHeight']*2)
render.makeScreenshot(path + 'Camera.png') | true | true |
f7f72ac6d4026f944a7a5728b4f9e1a4fa9a9425 | 547 | py | Python | backend/extensions.py | hpf0532/corona | 020f7766dbac808961cc8f7ebb921aac6825464f | [
"MIT"
] | 6 | 2020-03-09T13:05:04.000Z | 2021-12-14T08:57:22.000Z | backend/extensions.py | hpf0532/corona | 020f7766dbac808961cc8f7ebb921aac6825464f | [
"MIT"
] | 7 | 2021-04-07T20:53:53.000Z | 2022-03-12T00:23:06.000Z | backend/extensions.py | hpf0532/corona | 020f7766dbac808961cc8f7ebb921aac6825464f | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Author: hpf
# Date: 2020/3/1 上午10:44
# File: extensions.py
# IDE: PyCharm
import redis
from flask_sqlalchemy import SQLAlchemy
from flask_migrate import Migrate
from flask_mail import Mail
from flask_avatars import Avatars
from flask_limiter import Limiter
from flask_limiter.util import get_r... | 21.88 | 49 | 0.786106 |
import redis
from flask_sqlalchemy import SQLAlchemy
from flask_migrate import Migrate
from flask_mail import Mail
from flask_avatars import Avatars
from flask_limiter import Limiter
from flask_limiter.util import get_remote_address
from backend.settings import POOL
db = SQLAlchemy()
migrate = Migrate()
mail = ... | true | true |
f7f72b0250b2e7a7cd533ba1ac086659508049b0 | 595 | py | Python | src/Services/Event/UpcomingRaw.py | MetuMobile/server-side | fcbe59833c308b16e5d43c8aab1e78550b71040d | [
"MIT"
] | null | null | null | src/Services/Event/UpcomingRaw.py | MetuMobile/server-side | fcbe59833c308b16e5d43c8aab1e78550b71040d | [
"MIT"
] | 7 | 2017-06-07T13:19:27.000Z | 2017-06-07T14:22:15.000Z | src/Services/Event/UpcomingRaw.py | MetuMobile/server-side | fcbe59833c308b16e5d43c8aab1e78550b71040d | [
"MIT"
] | null | null | null | from flask.views import MethodView
from flask import jsonify
from Services.Event.MetuEventsDb import MetuEventsDb
class UpcomingRaw(MethodView):
def get(self):
return jsonify(RawUpcomingEvents=self.getRawUpcomingEvents())
def getRawUpcomingEvents(self):
db = MetuEventsDb()
events = db... | 27.045455 | 69 | 0.689076 | from flask.views import MethodView
from flask import jsonify
from Services.Event.MetuEventsDb import MetuEventsDb
class UpcomingRaw(MethodView):
def get(self):
return jsonify(RawUpcomingEvents=self.getRawUpcomingEvents())
def getRawUpcomingEvents(self):
db = MetuEventsDb()
events = db... | true | true |
f7f72b21fb947df53e998432e3045f57df11c0bc | 71,664 | bzl | Python | dotnet/private/deps/nuget.bzl | lb5tr/rules_dotnet | 43479c10ef07156a29a4265caa72db33279219db | [
"Apache-2.0"
] | null | null | null | dotnet/private/deps/nuget.bzl | lb5tr/rules_dotnet | 43479c10ef07156a29a4265caa72db33279219db | [
"Apache-2.0"
] | null | null | null | dotnet/private/deps/nuget.bzl | lb5tr/rules_dotnet | 43479c10ef07156a29a4265caa72db33279219db | [
"Apache-2.0"
] | null | null | null | load("@io_bazel_rules_dotnet//dotnet/private:rules/nuget.bzl", "nuget_package")
def dotnet_repositories_nuget():
### Generated by the tool
nuget_package(
name = "microsoft.netcore.platforms",
package = "microsoft.netcore.platforms",
version = "1.1.0",
sha256 = "15e338d24b5c39b40... | 36.193939 | 85 | 0.471059 | load("@io_bazel_rules_dotnet//dotnet/private:rules/nuget.bzl", "nuget_package")
def dotnet_repositories_nuget():
etcore.platforms",
package = "microsoft.netcore.platforms",
version = "1.1.0",
sha256 = "15e338d24b5c39b4099389cc612841eb51ff13c07bb4829f97d39b27420e7023",
)
nuget_packag... | true | true |
f7f72b6815007845f1e334348196a1e2f205da44 | 5,510 | py | Python | lib/kb_cufflinks/core/script_utils.py | mclark58/kb_cufflinks | c60fffba2da63c1bf5b15823115af0200ad47490 | [
"MIT"
] | 1 | 2020-01-13T21:19:27.000Z | 2020-01-13T21:19:27.000Z | lib/kb_cufflinks/core/script_utils.py | mclark58/kb_cufflinks | c60fffba2da63c1bf5b15823115af0200ad47490 | [
"MIT"
] | 5 | 2017-11-14T17:47:49.000Z | 2019-06-10T17:07:03.000Z | lib/kb_cufflinks/core/script_utils.py | mclark58/kb_cufflinks | c60fffba2da63c1bf5b15823115af0200ad47490 | [
"MIT"
] | 7 | 2017-06-20T13:54:44.000Z | 2019-10-10T20:30:44.000Z | import logging
import os
import subprocess
import traceback
from os import listdir
from os.path import isfile, join
from zipfile import ZipFile
'''
A utility python module containing a set of methods necessary for this kbase
module.
'''
LEVELS = {'debug': logging.DEBUG,
'info': logging.INFO,
'warn... | 30.10929 | 97 | 0.6 | import logging
import os
import subprocess
import traceback
from os import listdir
from os.path import isfile, join
from zipfile import ZipFile
LEVELS = {'debug': logging.DEBUG,
'info': logging.INFO,
'warning': logging.WARNING,
'error': logging.ERROR,
'critical': logging.CRITIC... | true | true |
f7f72bebf424dab07c5da33aaf954ba76312dcbd | 11,313 | py | Python | tronapi/main.py | h1ght1me/tron-api-python | 7cdb23d0480fe86126aa5121e47a6029f3f1b0c7 | [
"MIT"
] | null | null | null | tronapi/main.py | h1ght1me/tron-api-python | 7cdb23d0480fe86126aa5121e47a6029f3f1b0c7 | [
"MIT"
] | null | null | null | tronapi/main.py | h1ght1me/tron-api-python | 7cdb23d0480fe86126aa5121e47a6029f3f1b0c7 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# --------------------------------------------------------------------
# Copyright (c) iEXBase. All rights reserved.
# Licensed under the MIT License.
# See License.txt in the project root for license information.
# --------------------------------------------------------------------
"""
tr... | 31.77809 | 108 | 0.623442 |
from tronapi.common.datastructures import AttributeDict
from urllib.parse import urlencode
from eth_utils import (
apply_to_return_value,
to_hex,
keccak as tron_keccak,
)
from hexbytes import HexBytes
from trx_utils import (
to_sun,
from_sun,
is_integer,
add_0x_prefix,
remove_0x_... | true | true |
f7f72c248b7243f2a88b8f9e81a1db3360dec1e2 | 13,446 | py | Python | main.py | williamscott701/ETM-1 | 4a8f5b139df4567527b3ec99a27b310be6a65a6d | [
"MIT"
] | null | null | null | main.py | williamscott701/ETM-1 | 4a8f5b139df4567527b3ec99a27b310be6a65a6d | [
"MIT"
] | null | null | null | main.py | williamscott701/ETM-1 | 4a8f5b139df4567527b3ec99a27b310be6a65a6d | [
"MIT"
] | null | null | null | #/usr/bin/python
from __future__ import print_function
import argparse
import torch
import pickle
import numpy as np
import os
import math
import random
import sys
import matplotlib.pyplot as plt
import data
import scipy.io
from torch import nn, optim
from torch.nn import functional as F
from etm import ETM
f... | 35.291339 | 131 | 0.615722 |
from __future__ import print_function
import argparse
import torch
import pickle
import numpy as np
import os
import math
import random
import sys
import matplotlib.pyplot as plt
import data
import scipy.io
from torch import nn, optim
from torch.nn import functional as F
from etm import ETM
from utils import... | false | true |
f7f72d01bf1c5e7a126de3643ca43a450f7ce40c | 8,590 | py | Python | tests/test_scanner.py | eigenein/python-as3 | 323b58fd19359842332a1b045857f793cd124aa3 | [
"MIT"
] | 1 | 2019-05-27T11:25:18.000Z | 2019-05-27T11:25:18.000Z | tests/test_scanner.py | eigenein/python-as3 | 323b58fd19359842332a1b045857f793cd124aa3 | [
"MIT"
] | null | null | null | tests/test_scanner.py | eigenein/python-as3 | 323b58fd19359842332a1b045857f793cd124aa3 | [
"MIT"
] | null | null | null | from __future__ import annotations
from typing import List
from pytest import mark, param
from as3.enums import TokenType
from as3.scanner import Token, scan
def make_test_params(value: str, type_: TokenType, xfail: bool = False):
marks = mark.xfail(strict=True) if xfail else ()
return param(value, Token(t... | 48.258427 | 103 | 0.674738 | from __future__ import annotations
from typing import List
from pytest import mark, param
from as3.enums import TokenType
from as3.scanner import Token, scan
def make_test_params(value: str, type_: TokenType, xfail: bool = False):
marks = mark.xfail(strict=True) if xfail else ()
return param(value, Token(t... | true | true |
f7f72d4ff545d7ee1d873925fa199a288cf5a5ef | 9,521 | py | Python | bin/validator/transitfeed/stoptime.py | conveyal/otp-deployer | 4628a1cdcc68a0477ef11e77253afcb649b99075 | [
"MIT"
] | 1 | 2017-03-21T15:31:11.000Z | 2017-03-21T15:31:11.000Z | bin/validator/transitfeed/stoptime.py | conveyal/otp-deployer | 4628a1cdcc68a0477ef11e77253afcb649b99075 | [
"MIT"
] | null | null | null | bin/validator/transitfeed/stoptime.py | conveyal/otp-deployer | 4628a1cdcc68a0477ef11e77253afcb649b99075 | [
"MIT"
] | null | null | null | #!/usr/bin/python2.5
# Copyright (C) 2007 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable la... | 40.34322 | 79 | 0.659174 |
import problems as problems_module
from stop import Stop
import util
class StopTime(object):
_REQUIRED_FIELD_NAMES = ['trip_id', 'arrival_time', 'departure_time',
'stop_id', 'stop_sequence']
_OPTIONAL_FIELD_NAMES = ['stop_headsign', 'pickup_type',
... | true | true |
f7f72da001f7c3708cce704d8989f8e9c9550fe4 | 488 | py | Python | Dataset/Leetcode/test/13/17.py | kkcookies99/UAST | fff81885aa07901786141a71e5600a08d7cb4868 | [
"MIT"
] | null | null | null | Dataset/Leetcode/test/13/17.py | kkcookies99/UAST | fff81885aa07901786141a71e5600a08d7cb4868 | [
"MIT"
] | null | null | null | Dataset/Leetcode/test/13/17.py | kkcookies99/UAST | fff81885aa07901786141a71e5600a08d7cb4868 | [
"MIT"
] | null | null | null | class Solution:
def XXX(self, s: str) -> int:
single = {
'I':1,
'V':5,
'X':10,
'L':50,
'C':100,
'D':500,
'M':1000
}
double = ('IV', 'IX', 'XL', 'XC', 'CD', 'CM')
res = 0
for i, ch in enumer... | 19.52 | 53 | 0.315574 | class Solution:
def XXX(self, s: str) -> int:
single = {
'I':1,
'V':5,
'X':10,
'L':50,
'C':100,
'D':500,
'M':1000
}
double = ('IV', 'IX', 'XL', 'XC', 'CD', 'CM')
res = 0
for i, ch in enumer... | true | true |
f7f72e3807dcb369f998fa23f5bcc3552f568c12 | 40,618 | py | Python | python/paddle/tensor/search.py | Liyulingyue/Paddle | f3f0824df52b6051ac365268a3a8cd2682c6c8d5 | [
"Apache-2.0"
] | null | null | null | python/paddle/tensor/search.py | Liyulingyue/Paddle | f3f0824df52b6051ac365268a3a8cd2682c6c8d5 | [
"Apache-2.0"
] | null | null | null | python/paddle/tensor/search.py | Liyulingyue/Paddle | f3f0824df52b6051ac365268a3a8cd2682c6c8d5 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2020 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 app... | 38.573599 | 257 | 0.551824 |
from __future__ import print_function
import numpy as np
import paddle
from ..framework import LayerHelper
from ..fluid.data_feeder import check_variable_and_dtype, check_type, check_dtype
from ..fluid import layers
from ..framework import core, in_dygraph_mode, _non_static_mode
from ..fluid.framework impo... | true | true |
f7f72efec349bd940b76f6e67fb9d4c1e6556ae2 | 8,808 | py | Python | Sketches/RJL/bittorrent/BitTorrent/BitTorrent/language.py | sparkslabs/kamaelia_orig | 24b5f855a63421a1f7c6c7a35a7f4629ed955316 | [
"Apache-2.0"
] | 12 | 2015-10-20T10:22:01.000Z | 2021-07-19T10:09:44.000Z | Sketches/RJL/bittorrent/BitTorrent/BitTorrent/language.py | sparkslabs/kamaelia_orig | 24b5f855a63421a1f7c6c7a35a7f4629ed955316 | [
"Apache-2.0"
] | 2 | 2015-10-20T10:22:55.000Z | 2017-02-13T11:05:25.000Z | Sketches/RJL/bittorrent/BitTorrent/BitTorrent/language.py | sparkslabs/kamaelia_orig | 24b5f855a63421a1f7c6c7a35a7f4629ed955316 | [
"Apache-2.0"
] | 6 | 2015-03-09T12:51:59.000Z | 2020-03-01T13:06:21.000Z | # -*- coding: UTF-8 -*-
# The contents of this file are subject to the BitTorrent Open Source License
# Version 1.1 (the License). You may not copy or use this file, in either
# source code or executable form, except in compliance with the License. You
# may obtain a copy of the License at http://www.bittorrent.com/l... | 43.389163 | 77 | 0.500114 |
language_names = {
'af' :u'Afrikaans' , 'bg' :u'Български' ,
'da' :u'Dansk' , 'ca' :u'Català' ,
'cs' :u'Čeština' , 'de' :u'Deutsch' ,
'en' :u'English' , 'es' :u'Español' ... | false | true |
f7f72ff289edd2c3014caa3c0048999f749246e0 | 154 | py | Python | Afvaldienst/test_afvalstoffendienstkalender.py | xirixiz/python-afvalwijzer-afvalstoffendienst | ef76b07033848a6f7092e941c6c4a3ec214f2842 | [
"MIT"
] | 1 | 2019-10-28T12:26:14.000Z | 2019-10-28T12:26:14.000Z | Afvaldienst/test_afvalstoffendienstkalender.py | xirixiz/afvaldienst | ef76b07033848a6f7092e941c6c4a3ec214f2842 | [
"MIT"
] | 3 | 2020-09-11T08:38:50.000Z | 2020-09-23T07:08:44.000Z | Afvaldienst/test_afvalstoffendienstkalender.py | xirixiz/python-afvalwijzer-afvalstoffendienst | ef76b07033848a6f7092e941c6c4a3ec214f2842 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
from Afvaldienst import Afvaldienst
trash = Afvaldienst('afvalstoffendienstkalender', 'api_token', '5061DR', '120', '', 'false')
| 25.666667 | 92 | 0.733766 |
from Afvaldienst import Afvaldienst
trash = Afvaldienst('afvalstoffendienstkalender', 'api_token', '5061DR', '120', '', 'false')
| true | true |
f7f730bf8842e3bd333770a584ed2aaa1cb4eafa | 5,134 | py | Python | ucsmsdk/mometa/bios/BiosVfInterleaveConfiguration.py | thinkitdata/ucsmsdk | da6599e1dbc1207a30eabe548a7e5791af5f476b | [
"Apache-2.0"
] | null | null | null | ucsmsdk/mometa/bios/BiosVfInterleaveConfiguration.py | thinkitdata/ucsmsdk | da6599e1dbc1207a30eabe548a7e5791af5f476b | [
"Apache-2.0"
] | null | null | null | ucsmsdk/mometa/bios/BiosVfInterleaveConfiguration.py | thinkitdata/ucsmsdk | da6599e1dbc1207a30eabe548a7e5791af5f476b | [
"Apache-2.0"
] | null | null | null | """This module contains the general information for BiosVfInterleaveConfiguration ManagedObject."""
from ...ucsmo import ManagedObject
from ...ucscoremeta import MoPropertyMeta, MoMeta
from ...ucsmeta import VersionMeta
class BiosVfInterleaveConfigurationConsts:
SUPPORTED_BY_DEFAULT_NO = "no"
SUPPORTED_BY_DE... | 64.987342 | 353 | 0.714842 |
from ...ucsmo import ManagedObject
from ...ucscoremeta import MoPropertyMeta, MoMeta
from ...ucsmeta import VersionMeta
class BiosVfInterleaveConfigurationConsts:
SUPPORTED_BY_DEFAULT_NO = "no"
SUPPORTED_BY_DEFAULT_YES = "yes"
VP_CHANNEL_INTERLEAVING_1_WAY = "1-way"
VP_CHANNEL_INTERLEAVING_2_WAY = "2... | true | true |
f7f73118b3173a14028afff5936a580bfccc2d1b | 3,435 | py | Python | VGG, ResNet, Inception (200821).py | Adrian123K/tensor | f5cb9bbb8b98d3ca52356454b1c6adf2851ed507 | [
"MIT"
] | null | null | null | VGG, ResNet, Inception (200821).py | Adrian123K/tensor | f5cb9bbb8b98d3ca52356454b1c6adf2851ed507 | [
"MIT"
] | null | null | null | VGG, ResNet, Inception (200821).py | Adrian123K/tensor | f5cb9bbb8b98d3ca52356454b1c6adf2851ed507 | [
"MIT"
] | null | null | null | # # 설명:
# from tensorflow.keras.applications import *
#
# mobilenet = MobileNet(weights = None, input_shape = None, include_top = True)
# resnet50 = ResNet50(weights = None, input_shape = None, include_top = True)
# xception = Xception(weights = None, input_shape = None, include_top = True)
#
# # 예제:
# from tensorflow.... | 31.227273 | 127 | 0.635226 |
------------------------------------------------------------------------------------------------------------
from tensorflow.keras.datasets import cifar10
import numpy as np
(x_train, y_train), (x_test, y_test) = cifar10.load_data()
x_mean = np.mean(x_train, axis = (0, 1, 2))
x_std = np.std(x_train, axis = (0,... | false | true |
f7f7313b4d3c137275828a6b64b0f44fc1e7f7d0 | 7,106 | py | Python | bin/gComposite.py | liguowang/epage | 2ce60ddbcd23f06dc4d635681e8e52b66ba519f9 | [
"MIT"
] | null | null | null | bin/gComposite.py | liguowang/epage | 2ce60ddbcd23f06dc4d635681e8e52b66ba519f9 | [
"MIT"
] | null | null | null | bin/gComposite.py | liguowang/epage | 2ce60ddbcd23f06dc4d635681e8e52b66ba519f9 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Fri Aug 30 10:04:05 2019
@author: m102324
Description
-----------
This program Calculates the Composite Expression Scores:
* Gene Set Variation Analysis (GSVA). (Hänzelmann et al, 2013)
* Single Sample GSEA (ssGSEA). (Barbie et al, 2009)
* zscore (Lee ... | 55.085271 | 469 | 0.687729 |
import sys
from time import strftime
import pandas as pd
from optparse import OptionParser
from pacmodule import iList,iMatrix,iPas,gsva,cpca
__author__ = "Liguo Wang"
__copyright__ = "Copyleft"
__credits__ = []
__license__ = "MIT"
__version__="1.0.0"
__maintainer__ = "Liguo Wang"
__email__ = "wang.liguo@mayo.edu"... | true | true |
f7f7328cc96e45fe0471559aa23e6a9c17ca25f3 | 2,107 | py | Python | Step1.py | Byunggun/Project6-DL-Project-of-Classification | adddd17e93d46231cfa5b43c8cc2422d7fb92152 | [
"MIT"
] | null | null | null | Step1.py | Byunggun/Project6-DL-Project-of-Classification | adddd17e93d46231cfa5b43c8cc2422d7fb92152 | [
"MIT"
] | null | null | null | Step1.py | Byunggun/Project6-DL-Project-of-Classification | adddd17e93d46231cfa5b43c8cc2422d7fb92152 | [
"MIT"
] | null | null | null | #Q)불러오기 후 각각의 파일에 저장해 수많은 파일 생성?
#<자료 수집>
#네이버 뉴스, 2018.2.9.-2.25., 키워드: 스포츠 도핑
#cf.https://search.naver.com/search.naver?where=news&query=%EC%8A%A4%ED%8F%AC%EC%B8%A0%20%EB%8F%84%ED%95%91&sm=tab_opt&sort=0&photo=0&field=0&reporter_article=&pd=3&ds=2018.02.09&de=2018.02.25&docid=&nso=so%3Ar%2Cp%3Afrom20180209to20180225... | 35.116667 | 291 | 0.707167 |
bs4 import BeautifulSoup
import urllib.request as req
from bs4 import BeautifulSoup
import urllib.request as req
doping1_OUTPUT_FILE_NAME='D:\Python\MyGitHub\Project6-DL-Project-of-Classification\Doping Data/doping1.txt'
doping1_URL="http://www.sportalkorea.com/news/view.php?gisa_uniq=2018022508475516§ion... | true | true |
f7f732bfd7ffad3e52cb8142ee180a25289c7b6e | 41 | py | Python | tests/__init__.py | ShipKore/libshipkore | e009b614952c32f9c23669ccf6e8ae7a9a58b1c6 | [
"MIT"
] | 6 | 2021-02-06T05:50:33.000Z | 2022-02-11T15:21:09.000Z | tests/__init__.py | ShipKore/libshipkore | e009b614952c32f9c23669ccf6e8ae7a9a58b1c6 | [
"MIT"
] | 1 | 2021-02-11T15:58:33.000Z | 2021-02-11T16:01:18.000Z | tests/__init__.py | ShipKore/libshipkore | e009b614952c32f9c23669ccf6e8ae7a9a58b1c6 | [
"MIT"
] | null | null | null | """Unit test package for libshipkore."""
| 20.5 | 40 | 0.707317 | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.