hexsha stringlengths 40 40 | size int64 2 1.05M | ext stringclasses 9
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 193 | max_stars_repo_name stringlengths 6 109 | max_stars_repo_head_hexsha stringlengths 40 78 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 36.6k ⌀ | 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 193 | max_issues_repo_name stringlengths 6 109 | max_issues_repo_head_hexsha stringlengths 40 78 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 29.8k ⌀ | 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 193 | max_forks_repo_name stringlengths 6 109 | max_forks_repo_head_hexsha stringlengths 40 78 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 11.2k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 2 1.05M | avg_line_length float64 1 404k | max_line_length int64 1 1.03M | alphanum_fraction float64 0 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
733dac65863a2423b849a4c409f705c8b9bff8b8 | 2,085 | py | Python | alipay/aop/api/domain/AlipayOpenSearchAbilityBatchqueryModel.py | antopen/alipay-sdk-python-all | 8e51c54409b9452f8d46c7bb10eea7c8f7e8d30c | [
"Apache-2.0"
] | 213 | 2018-08-27T16:49:32.000Z | 2021-12-29T04:34:12.000Z | alipay/aop/api/domain/AlipayOpenSearchAbilityBatchqueryModel.py | antopen/alipay-sdk-python-all | 8e51c54409b9452f8d46c7bb10eea7c8f7e8d30c | [
"Apache-2.0"
] | 29 | 2018-09-29T06:43:00.000Z | 2021-09-02T03:27:32.000Z | alipay/aop/api/domain/AlipayOpenSearchAbilityBatchqueryModel.py | antopen/alipay-sdk-python-all | 8e51c54409b9452f8d46c7bb10eea7c8f7e8d30c | [
"Apache-2.0"
] | 59 | 2018-08-27T16:59:26.000Z | 2022-03-25T10:08:15.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
from alipay.aop.api.constant.ParamConstants import *
from alipay.aop.api.domain.SearchOperPageQueryRequest import SearchOperPageQueryRequest
class AlipayOpenSearchAbilityBatchqueryModel(object):
def __init__(self):
self._biz_data = None
s... | 27.8 | 87 | 0.59952 |
733dbafc9b99b0b384385b75dbfc318500beac17 | 1,108 | py | Python | pandaharvester/harvestertest/getQueuedata.py | tsulaiav/harvester | ca3f78348019dd616738f2da7d50e81700a8e6b9 | [
"Apache-2.0"
] | 11 | 2017-06-01T10:16:58.000Z | 2019-11-22T08:41:36.000Z | pandaharvester/harvestertest/getQueuedata.py | tsulaiav/harvester | ca3f78348019dd616738f2da7d50e81700a8e6b9 | [
"Apache-2.0"
] | 34 | 2016-10-25T19:15:24.000Z | 2021-03-05T12:59:04.000Z | pandaharvester/harvestertest/getQueuedata.py | tsulaiav/harvester | ca3f78348019dd616738f2da7d50e81700a8e6b9 | [
"Apache-2.0"
] | 17 | 2016-10-24T13:29:45.000Z | 2021-03-23T17:35:27.000Z | import json
from pandaharvester.harvesterbody.cacher import Cacher
from pandaharvester.harvestercore.db_proxy import DBProxy
from pandaharvester.harvestercore.communicator_pool import CommunicatorPool
from pandaharvester.harvestercore import core_utils
# make communication channel to PanDA
com = CommunicatorPool()
pr... | 27.7 | 92 | 0.745487 |
733df1340f287c18b4a2a711254742980b3db493 | 987 | py | Python | src/buildstream/_versions.py | doraskayo/buildstream | 1c72d4342ae7df360808de22c5e49f55dbb6bec6 | [
"Apache-2.0"
] | null | null | null | src/buildstream/_versions.py | doraskayo/buildstream | 1c72d4342ae7df360808de22c5e49f55dbb6bec6 | [
"Apache-2.0"
] | null | null | null | src/buildstream/_versions.py | doraskayo/buildstream | 1c72d4342ae7df360808de22c5e49f55dbb6bec6 | [
"Apache-2.0"
] | null | null | null | #
# Copyright (C) 2018 Codethink Limited
#
# 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 agre... | 36.555556 | 75 | 0.755826 |
733df859b982c8952455638ba117e75234859159 | 1,442 | py | Python | tests/facebook/models/test_page.py | Socian-Ltd/python-facebook-1 | e9a4f626b37541103c9534a29342ef6033c09c06 | [
"Apache-2.0"
] | 2 | 2021-03-16T02:58:10.000Z | 2021-03-16T16:53:23.000Z | tests/facebook/models/test_page.py | nedsons/python-facebook | bf2b4a70ef0e0a67a142f5856586ea318f9807ea | [
"Apache-2.0"
] | null | null | null | tests/facebook/models/test_page.py | nedsons/python-facebook | bf2b4a70ef0e0a67a142f5856586ea318f9807ea | [
"Apache-2.0"
] | 1 | 2021-06-02T07:15:35.000Z | 2021-06-02T07:15:35.000Z | import json
import unittest
import pyfacebook.models as models
class PageModelTest(unittest.TestCase):
BASE_PATH = "testdata/facebook/models/pages/"
with open(BASE_PATH + 'page_categories.json', 'rb') as f:
PAGE_CATEGORIES = json.loads(f.read().decode('utf-8'))
with open(BASE_PATH + 'pages.json'... | 38.972973 | 104 | 0.694175 |
733e10122267b710ebf42755ef2236411bf27e52 | 15,626 | py | Python | data/us-tn/tn-doh/harvester.py | mtna/covid-19 | 93d28204033bb22937f359044bbba59751f9c90b | [
"Apache-2.0"
] | 10 | 2020-05-15T17:30:47.000Z | 2021-08-23T06:08:40.000Z | data/us-tn/tn-doh/harvester.py | mtna/covid-19 | 93d28204033bb22937f359044bbba59751f9c90b | [
"Apache-2.0"
] | null | null | null | data/us-tn/tn-doh/harvester.py | mtna/covid-19 | 93d28204033bb22937f359044bbba59751f9c90b | [
"Apache-2.0"
] | 4 | 2020-10-20T01:31:05.000Z | 2021-04-19T10:31:03.000Z | import addfips
import os
import pandas as pd
import datetime
ageVariables = {
'DATE': 'date_stamp',
'AGE_RANGE': 'age_group',
'AR_TOTALCASES': 'cnt_confirmed',
'AR_TOTALPERCENT': 'pct_confirmed',
'AR_NEWCASES': 'cnt_confirmed_new',
'AR_NEWPERCENT': 'pct_confirmed_new',
'AR_TOTALDEATHS' : 'cnt_death',
'AR_NEWDE... | 47.495441 | 375 | 0.709971 |
733e138c5115b2372e0a46ee79d8ba4f63d04b6f | 5,343 | py | Python | metrics-extractor/tests/test_extractor.py | gavinmbell/benchmark-ai-1 | a697e67d68b843fe9350e55871dad867bab5d51d | [
"Apache-2.0"
] | 6 | 2020-09-29T09:03:04.000Z | 2022-03-14T06:52:25.000Z | metrics-extractor/tests/test_extractor.py | gavinmbell/benchmark-ai-1 | a697e67d68b843fe9350e55871dad867bab5d51d | [
"Apache-2.0"
] | null | null | null | metrics-extractor/tests/test_extractor.py | gavinmbell/benchmark-ai-1 | a697e67d68b843fe9350e55871dad867bab5d51d | [
"Apache-2.0"
] | 4 | 2020-10-01T07:49:22.000Z | 2021-06-16T19:44:12.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import re
from unittest.mock import ANY, MagicMock
import kubernetes
import kubernetes.watch
import pytest
from kubernetes.client.rest import ApiException
from mock import call
from anubis_metrics_extractor import log_listener
from anubis_metrics_extractor.log_listener i... | 30.884393 | 118 | 0.720007 |
733e1e8c3fb6ef27bbf87dfb2f0e8c721499fb31 | 19,983 | py | Python | textbox/model/VAE/cvae.py | StevenTang1998/TextBox | acd8298c7e6618384d585146f799d02cc475520c | [
"MIT"
] | 347 | 2021-01-09T07:55:55.000Z | 2022-03-27T00:46:36.000Z | textbox/model/VAE/cvae.py | StevenTang1998/TextBox | acd8298c7e6618384d585146f799d02cc475520c | [
"MIT"
] | 18 | 2021-01-12T07:37:06.000Z | 2022-01-11T02:26:49.000Z | textbox/model/VAE/cvae.py | StevenTang1998/TextBox | acd8298c7e6618384d585146f799d02cc475520c | [
"MIT"
] | 67 | 2021-01-09T07:23:52.000Z | 2022-03-27T12:02:12.000Z | # @Time : 2021/03/02
# @Author : Yifan Du
# @Email : yifandu99@outlook.com
r"""
Conditional VAE
################################################
Reference:
Juntao Li et al. "Generating Classical Chinese Poems via Conditional Variational Autoencoder and Adversarial Training" in ACL 2018.
"""
import torch
import... | 54.747945 | 135 | 0.631737 |
733e84163676acb6478615f499e98cbf27688a6a | 5,000 | py | Python | tests/resources/conftest.py | mitsosf/invenio-rdm-records | e5c30395dc8de71de11af86409ae6492098eec41 | [
"MIT"
] | null | null | null | tests/resources/conftest.py | mitsosf/invenio-rdm-records | e5c30395dc8de71de11af86409ae6492098eec41 | [
"MIT"
] | null | null | null | tests/resources/conftest.py | mitsosf/invenio-rdm-records | e5c30395dc8de71de11af86409ae6492098eec41 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
#
# Copyright (C) 2020 CERN.
# Copyright (C) 2020 Northwestern University.
# Copyright (C) 2021 TU Wien.
#
# Invenio-RDM-Records is free software; you can redistribute it and/or modify
# it under the terms of the MIT License; see LICENSE file for more details.
"""Pytest configuration.
See http... | 28.248588 | 78 | 0.6274 |
733ea702cd1495d78314dcc31758b12ff19c5f44 | 7,959 | py | Python | code/lib/osm/osmclient/client.py | superfluidity/RDCL3D | 3c5717941bd4046aa1be178e9004db1dc1c469a0 | [
"Apache-2.0"
] | 8 | 2017-03-13T16:34:28.000Z | 2021-11-16T11:35:56.000Z | code/lib/osm/osmclient/client.py | superfluidity/RDCL3D | 3c5717941bd4046aa1be178e9004db1dc1c469a0 | [
"Apache-2.0"
] | null | null | null | code/lib/osm/osmclient/client.py | superfluidity/RDCL3D | 3c5717941bd4046aa1be178e9004db1dc1c469a0 | [
"Apache-2.0"
] | 3 | 2017-03-28T09:26:40.000Z | 2020-12-08T14:16:12.000Z | import requests
import logging
import json
from lib.util import Util
import hashlib
logging.basicConfig(level=logging.DEBUG)
log = logging.getLogger('helper.py')
class Client(object):
def __init__(self, host=None, so_port=9999, so_project='admin', ro_host=None, ro_port=9090, **kwargs):
self._user = 'ad... | 41.889474 | 173 | 0.579218 |
733ef0442f8b538867338da3127a541b52f92404 | 1,751 | py | Python | timemory/options.py | m-gul/timemory | 36520ff4aedc09ea7b54981dd8c97c4960f6ee79 | [
"MIT"
] | 1 | 2019-12-06T22:21:13.000Z | 2019-12-06T22:21:13.000Z | timemory/options.py | hbrunie/timemory | 36520ff4aedc09ea7b54981dd8c97c4960f6ee79 | [
"MIT"
] | null | null | null | timemory/options.py | hbrunie/timemory | 36520ff4aedc09ea7b54981dd8c97c4960f6ee79 | [
"MIT"
] | null | null | null | #!@PYTHON_EXECUTABLE@
# MIT License
#
# Copyright (c) 2018, The Regents of the University of California,
# through Lawrence Berkeley National Laboratory (subject to receipt of any
# required approvals from the U.S. Dept. of Energy). All rights reserved.
#
# Permission is hereby granted, free of charge, to any person o... | 40.72093 | 80 | 0.777841 |
733ef241db445073eccc95be6f818fc03dee2c58 | 75,990 | py | Python | libcloudforensics/providers/gcp/internal/compute.py | zkck/cloud-forensics-utils | ac1cdf74b595cf57629c23a52e46da98283e552f | [
"Apache-2.0"
] | null | null | null | libcloudforensics/providers/gcp/internal/compute.py | zkck/cloud-forensics-utils | ac1cdf74b595cf57629c23a52e46da98283e552f | [
"Apache-2.0"
] | null | null | null | libcloudforensics/providers/gcp/internal/compute.py | zkck/cloud-forensics-utils | ac1cdf74b595cf57629c23a52e46da98283e552f | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright 2020 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 law ... | 36.065496 | 156 | 0.650612 |
733f2a8d7bc1543858e5f8583bba064749e45acc | 4,528 | py | Python | tools/odrive/tests/analog_input_test.py | rowanG077/ODrive | 431bf9116408691ec631f8286507f627e57b06d2 | [
"MIT"
] | 19 | 2018-09-08T09:51:54.000Z | 2020-10-02T06:52:26.000Z | tools/odrive/tests/analog_input_test.py | rowanG077/ODrive | 431bf9116408691ec631f8286507f627e57b06d2 | [
"MIT"
] | 2 | 2019-06-30T05:35:29.000Z | 2020-06-25T16:41:18.000Z | tools/odrive/tests/analog_input_test.py | rowanG077/ODrive | 431bf9116408691ec631f8286507f627e57b06d2 | [
"MIT"
] | 25 | 2019-02-09T13:39:27.000Z | 2020-09-04T03:03:29.000Z |
import test_runner
import time
import math
import os
import numpy as np
from odrive.enums import *
from test_runner import *
teensy_code_template = """
void setup() {
analogWriteResolution(10);
// base clock of the PWM timer is 150MHz (on Teensy 4.0)
int freq = 150000000/1024; // ~146.5kHz PWM frequency
an... | 39.719298 | 242 | 0.641564 |
733f7a025ee4e21175e08d194a24584b733f1f04 | 1,994 | py | Python | hivwholeseq/patients/get_allele_cocounts.py | neherlab/hivwholeseq | 978ce4060362e4973f92b122ed5340a5314d7844 | [
"MIT"
] | 3 | 2016-09-13T12:15:47.000Z | 2021-07-03T01:28:56.000Z | hivwholeseq/patients/get_allele_cocounts.py | iosonofabio/hivwholeseq | d504c63b446c3a0308aad6d6e484ea1666bbe6df | [
"MIT"
] | null | null | null | hivwholeseq/patients/get_allele_cocounts.py | iosonofabio/hivwholeseq | d504c63b446c3a0308aad6d6e484ea1666bbe6df | [
"MIT"
] | 3 | 2016-01-17T03:43:46.000Z | 2020-03-25T07:00:11.000Z | #!/usr/bin/env python
# vim: fdm=marker
'''
author: Fabio Zanini
date: 20/03/14
content: Get the joint counts at two sites for patient samples, after mapping.
'''
# Modules
import argparse
import numpy as np
import matplotlib.pyplot as plt
from hivwholeseq.patients.samples import load_samples_sequenced as... | 32.16129 | 96 | 0.628385 |
733fa6618102889a99b9090560a6c2f53fb529ab | 1,576 | py | Python | bph/tools/windows/sysinspector.py | fortinet/ips-bph-framework | 145e14cced2181f388ade07d78b4f0e9452143dd | [
"Apache-2.0"
] | 21 | 2019-10-24T04:59:52.000Z | 2021-05-11T12:47:17.000Z | bph/tools/windows/sysinspector.py | fortinet/ips-bph-framework | 145e14cced2181f388ade07d78b4f0e9452143dd | [
"Apache-2.0"
] | null | null | null | bph/tools/windows/sysinspector.py | fortinet/ips-bph-framework | 145e14cced2181f388ade07d78b4f0e9452143dd | [
"Apache-2.0"
] | 9 | 2019-10-26T16:56:08.000Z | 2021-03-15T14:10:21.000Z | #!/usr/bin/python
#
# Copyright 2019 Fortinet 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... | 36.651163 | 100 | 0.704949 |
733fb1c83c2569db97db8b43b00750269e24c423 | 9,104 | py | Python | devito/ir/iet/scheduler.py | cc-a/devito | 24ede9131473f69c1e44ba3b852f8654d3fd953e | [
"MIT"
] | null | null | null | devito/ir/iet/scheduler.py | cc-a/devito | 24ede9131473f69c1e44ba3b852f8654d3fd953e | [
"MIT"
] | null | null | null | devito/ir/iet/scheduler.py | cc-a/devito | 24ede9131473f69c1e44ba3b852f8654d3fd953e | [
"MIT"
] | 1 | 2020-01-13T01:17:24.000Z | 2020-01-13T01:17:24.000Z | from collections import OrderedDict
import cgen as c
from devito.ir.iet import (ArrayCast, Expression, Increment, LocalExpression, Element,
Iteration, List, Conditional, Section, HaloSpot,
ExpressionBundle, MapSections, Transformer, FindNodes,
... | 35.5625 | 90 | 0.599407 |
733fb6fb2afb7013695fb2f96bc4e6354c7c5057 | 136 | py | Python | project_apis/admin.py | HemanthKumar-Thope/ecommerce-api | a93603b6b9db2e16ae4511f2643662200d11b85e | [
"MIT"
] | null | null | null | project_apis/admin.py | HemanthKumar-Thope/ecommerce-api | a93603b6b9db2e16ae4511f2643662200d11b85e | [
"MIT"
] | null | null | null | project_apis/admin.py | HemanthKumar-Thope/ecommerce-api | a93603b6b9db2e16ae4511f2643662200d11b85e | [
"MIT"
] | null | null | null | from django.contrib import admin
from project_apis import models
# Register your models here.
admin.site.register(models.UserProfile)
| 19.428571 | 39 | 0.823529 |
733fd948ad1b87feeacee24f0ed8942aa6037751 | 2,074 | py | Python | polly/plugins/maya/load/mindbender_rig.py | mindbender-studio/config | d12a99391afcdc1a52bc3c5d159506f2f9b348f7 | [
"MIT"
] | 5 | 2017-06-18T15:53:56.000Z | 2021-06-18T10:29:10.000Z | polly/plugins/maya/load/mindbender_rig.py | BigRoy/config | d12a99391afcdc1a52bc3c5d159506f2f9b348f7 | [
"MIT"
] | 12 | 2017-06-21T14:25:13.000Z | 2021-10-14T05:57:23.000Z | polly/plugins/maya/load/mindbender_rig.py | mindbender-studio/config | d12a99391afcdc1a52bc3c5d159506f2f9b348f7 | [
"MIT"
] | 5 | 2017-06-14T14:07:17.000Z | 2020-01-06T08:00:39.000Z | import avalon.maya
class RigLoader(avalon.maya.Loader):
"""Specific loader for rigs
This automatically creates an instance for animators upon load.
"""
families = ["mindbender.rig"]
representations = ["ma"]
def process(self, name, namespace, context, data):
from maya import cmds
... | 34 | 74 | 0.530376 |
733fdff7860aa5a1045ff5ec081f5ca9c6e58a60 | 2,552 | py | Python | metrics.py | Neronjust2017/BayesianCNN | 33fc227b3ec2ff9cde816403db6aa4ae68d586e2 | [
"MIT"
] | 2 | 2020-07-07T12:29:07.000Z | 2021-04-12T12:49:40.000Z | metrics.py | Neronjust2017/BayesianCNN | 33fc227b3ec2ff9cde816403db6aa4ae68d586e2 | [
"MIT"
] | 1 | 2021-05-18T13:12:18.000Z | 2021-05-18T13:12:18.000Z | metrics.py | Neronjust2017/BayesianCNN | 33fc227b3ec2ff9cde816403db6aa4ae68d586e2 | [
"MIT"
] | 3 | 2020-05-29T08:05:51.000Z | 2021-05-26T13:19:36.000Z | import numpy as np
import torch.nn.functional as F
from torch import nn
import torch
class ELBO(nn.Module):
def __init__(self, train_size):
super(ELBO, self).__init__()
self.train_size = train_size
def forward(self, input, target, kl, kl_weight=1.0):
# loss = criterion(log_outputs, la... | 36.457143 | 105 | 0.689655 |
733ffaa8e06739628d7139aab84f1bbd9e0f2d9b | 14,624 | py | Python | oscar/lib/python2.7/site-packages/haystack/backends/elasticsearch2_backend.py | sainjusajan/django-oscar | 466e8edc807be689b0a28c9e525c8323cc48b8e1 | [
"BSD-3-Clause"
] | null | null | null | oscar/lib/python2.7/site-packages/haystack/backends/elasticsearch2_backend.py | sainjusajan/django-oscar | 466e8edc807be689b0a28c9e525c8323cc48b8e1 | [
"BSD-3-Clause"
] | null | null | null | oscar/lib/python2.7/site-packages/haystack/backends/elasticsearch2_backend.py | sainjusajan/django-oscar | 466e8edc807be689b0a28c9e525c8323cc48b8e1 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import absolute_import, division, print_function, unicode_literals
import datetime
from django.conf import settings
from haystack.backends import BaseEngine
from haystack.backends.elasticsearch_backend import ElasticsearchSearchBackend, ElasticsearchSearchQuery
from h... | 43.784431 | 185 | 0.479759 |
7340005e88a4569b9dba46bebd785c32a7bdbb1f | 4,490 | py | Python | pyEpiabm/pyEpiabm/utility/distance_metrics.py | SABS-R3-Epidemiology/epiabm | 8eb83fd2de84104f6f77929e3771095f7b033ddc | [
"BSD-3-Clause"
] | 11 | 2021-12-02T15:24:02.000Z | 2022-03-10T14:02:13.000Z | pyEpiabm/pyEpiabm/utility/distance_metrics.py | SABS-R3-Epidemiology/epiabm | 8eb83fd2de84104f6f77929e3771095f7b033ddc | [
"BSD-3-Clause"
] | 119 | 2021-11-24T13:56:48.000Z | 2022-03-30T11:52:07.000Z | pyEpiabm/pyEpiabm/utility/distance_metrics.py | SABS-R3-Epidemiology/epiabm | 8eb83fd2de84104f6f77929e3771095f7b033ddc | [
"BSD-3-Clause"
] | 3 | 2022-01-13T03:05:19.000Z | 2022-03-11T22:00:17.000Z | #
# Calculates distance metrics between spatial points
#
import typing
import numpy as np
class DistanceFunctions:
"""Class which contains multiple distance functions
for use when considering spatial infections, either
inter-place or inter-cell.
"""
@staticmethod
def dist(loc1: typing.Tuple[... | 34.274809 | 76 | 0.581069 |
73402c75cb3146f04e678b2f36576bfa5192187a | 13,313 | py | Python | rstblog/builder.py | agateau/rstblog | 680d567a8bf42f3fce6e3cc067547cb171e7b373 | [
"BSD-3-Clause"
] | null | null | null | rstblog/builder.py | agateau/rstblog | 680d567a8bf42f3fce6e3cc067547cb171e7b373 | [
"BSD-3-Clause"
] | null | null | null | rstblog/builder.py | agateau/rstblog | 680d567a8bf42f3fce6e3cc067547cb171e7b373 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
"""
rstblog.builder
~~~~~~~~~~~~~~~
The building components.
:copyright: (c) 2010 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
import logging
import re
import os
import posixpath
from fnmatch import fnmatch
from urllib.parse import urlparse
from docu... | 33.78934 | 82 | 0.600391 |
734046e0e8d897fb1954c9d04333bfd2f961124e | 6,565 | py | Python | experiments/vitchyr/probabilistic_goal_reaching/harder_minimal_exploration/exp_6_box_wall_action_scale_sweep_longer_redo_0p025.py | Asap7772/railrl_evalsawyer | baba8ce634d32a48c7dfe4dc03b123e18e96e0a3 | [
"MIT"
] | 1 | 2020-10-23T14:40:09.000Z | 2020-10-23T14:40:09.000Z | experiments/vitchyr/probabilistic_goal_reaching/harder_minimal_exploration/exp_6_box_wall_action_scale_sweep_longer_redo_0p025.py | Asap7772/railrl_evalsawyer | baba8ce634d32a48c7dfe4dc03b123e18e96e0a3 | [
"MIT"
] | null | null | null | experiments/vitchyr/probabilistic_goal_reaching/harder_minimal_exploration/exp_6_box_wall_action_scale_sweep_longer_redo_0p025.py | Asap7772/railrl_evalsawyer | baba8ce634d32a48c7dfe4dc03b123e18e96e0a3 | [
"MIT"
] | 1 | 2021-05-27T20:38:45.000Z | 2021-05-27T20:38:45.000Z | import rlkit.misc.hyperparameter as hyp
from rlkit.launchers.experiments.vitchyr.probabilistic_goal_reaching.launcher import \
probabilistic_goal_reaching_experiment
from rlkit.launchers.launcher_util import run_experiment
if __name__ == "__main__":
variant = dict(
qf_kwargs=dict(
hidden_si... | 32.5 | 117 | 0.541508 |
73404e8eb6471201d3eac20862c096cbf62efc9d | 5,998 | py | Python | src/spn/algorithms/MEU.py | SwarajPawar/SPFlow | ac128935a901359679a098b51ac70ba0f9d7d687 | [
"Apache-2.0"
] | 2 | 2021-09-29T19:51:25.000Z | 2021-09-29T19:51:27.000Z | src/spn/algorithms/MEU.py | minimum-LaytonC/SPFlow | 6890436c9b9ebd2cac02e9fe8e902f3b82b6abbc | [
"Apache-2.0"
] | null | null | null | src/spn/algorithms/MEU.py | minimum-LaytonC/SPFlow | 6890436c9b9ebd2cac02e9fe8e902f3b82b6abbc | [
"Apache-2.0"
] | 1 | 2022-03-01T20:14:19.000Z | 2022-03-01T20:14:19.000Z | """
Created on March 28, 2019
@author: Hari Teja Tatavarti
"""
from spn.algorithms.MPE import get_node_funtions
from spn.algorithms.Inference import likelihood, max_likelihood, log_likelihood, sum_likelihood, prod_likelihood
from spn.algorithms.Validity import is_valid
from spn.structure.Base import get_nodes_by_typ... | 37.024691 | 330 | 0.706235 |
734056e2c072c3ef940135b3125a708600aa74b0 | 6,440 | py | Python | sdk/python/kfp/v2/components/for_loop_test.py | Iuiu1234/pipelines | 1e032f550ce23cd40bfb6827b995248537b07d08 | [
"Apache-2.0"
] | 2,860 | 2018-05-24T04:55:01.000Z | 2022-03-31T13:49:56.000Z | sdk/python/kfp/v2/components/for_loop_test.py | Iuiu1234/pipelines | 1e032f550ce23cd40bfb6827b995248537b07d08 | [
"Apache-2.0"
] | 7,331 | 2018-05-16T09:03:26.000Z | 2022-03-31T23:22:04.000Z | sdk/python/kfp/v2/components/for_loop_test.py | Iuiu1234/pipelines | 1e032f550ce23cd40bfb6827b995248537b07d08 | [
"Apache-2.0"
] | 1,359 | 2018-05-15T11:05:41.000Z | 2022-03-31T09:42:09.000Z | # Copyright 2021 The Kubeflow 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... | 31.568627 | 85 | 0.526863 |
73407ea9307ae1fe2c662175fbff32b1bfd39275 | 5,382 | py | Python | setup.py | just4jc/cuml | bd7824bff0a60634b11c1f036dd41cc7f8c05bc1 | [
"Apache-2.0"
] | 1 | 2019-02-14T05:32:35.000Z | 2019-02-14T05:32:35.000Z | setup.py | just4jc/cuml | bd7824bff0a60634b11c1f036dd41cc7f8c05bc1 | [
"Apache-2.0"
] | null | null | null | setup.py | just4jc/cuml | bd7824bff0a60634b11c1f036dd41cc7f8c05bc1 | [
"Apache-2.0"
] | null | null | null | #
# Copyright (c) 2018, NVIDIA CORPORATION.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed ... | 37.901408 | 211 | 0.658677 |
7340a960f72ab8a3dc23122be0be861c49a7db38 | 4,244 | py | Python | geneticalgorithm2/selections.py | mudesire/geneticalgorithm2 | 165d87b182a0b56e035f7a37a17a16950de20ddd | [
"MIT"
] | 34 | 2020-11-25T15:01:19.000Z | 2022-03-23T17:10:33.000Z | geneticalgorithm2/selections.py | mudesire/geneticalgorithm2 | 165d87b182a0b56e035f7a37a17a16950de20ddd | [
"MIT"
] | null | null | null | geneticalgorithm2/selections.py | mudesire/geneticalgorithm2 | 165d87b182a0b56e035f7a37a17a16950de20ddd | [
"MIT"
] | 7 | 2020-11-30T16:50:16.000Z | 2022-02-22T16:03:45.000Z |
import math
import random
import numpy as np
class Selection:
@staticmethod
def __inverse_scores(scores: np.ndarray):
"""
inverse scores (min val goes to max)
"""
minobj = scores[0]
normobj = scores - minobj if minobj < 0 else scores
return (... | 25.566265 | 139 | 0.509661 |
7340ec9acac34a624c6ff1b298683b0604276b97 | 848 | py | Python | switch_model/hawaii/emission_rules.py | ashutosh-pande/switch3 | 769d25a42c8323f24740567aa15c980f905a03e2 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | switch_model/hawaii/emission_rules.py | ashutosh-pande/switch3 | 769d25a42c8323f24740567aa15c980f905a03e2 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | switch_model/hawaii/emission_rules.py | ashutosh-pande/switch3 | 769d25a42c8323f24740567aa15c980f905a03e2 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | from pyomo.environ import *
def define_components(m):
"""
prevent non-cogen plants from burning pure LSFO after 2017 due to MATS emission restrictions
"""
# TODO: move this set into a parameter list in fuels.tab, e.g, 'banned_after', which can be a year or NULL
m.FUEL_BANS = Set(dimen=2, initializ... | 38.545455 | 110 | 0.604953 |
7340f2283b00e35e0795c572dedda8f1b69b570d | 499 | py | Python | tests/test_html_tags/test_del_tag.py | bharadwajyarlagadda/korona | ee4662b6a29907495e31ed2581dc5484bb03eadc | [
"MIT"
] | 2 | 2016-10-11T03:57:30.000Z | 2018-01-19T20:13:47.000Z | tests/test_html_tags/test_del_tag.py | iskodirajga/korona | ee4662b6a29907495e31ed2581dc5484bb03eadc | [
"MIT"
] | 16 | 2016-08-19T04:08:45.000Z | 2016-09-27T03:26:39.000Z | tests/test_html_tags/test_del_tag.py | iskodirajga/korona | ee4662b6a29907495e31ed2581dc5484bb03eadc | [
"MIT"
] | 1 | 2016-10-11T03:57:33.000Z | 2016-10-11T03:57:33.000Z |
from ..fixtures import parametrize
from korona.html.tags import Del
from korona.templates.html.tags import delete
@parametrize('attributes', [
({'cite': 'www.abcd.com'}),
({'datetime': '2014-11-15T22:55:03Z'}),
({'datetime': '2015-11-15T22:55:03Z', 'text': 'abcd'})
])
def test_construct_del_tag(attribut... | 27.722222 | 79 | 0.679359 |
7340fc002866aa186ba198eb4c900a9b35d40eab | 838 | py | Python | test/unittests/test_AdjQTotal.py | mudkipmaster/gwlf-e | 9e058445537dd32d1916f76c4b73ca64261771cd | [
"Apache-2.0"
] | null | null | null | test/unittests/test_AdjQTotal.py | mudkipmaster/gwlf-e | 9e058445537dd32d1916f76c4b73ca64261771cd | [
"Apache-2.0"
] | 6 | 2018-07-24T22:46:28.000Z | 2018-07-29T19:13:09.000Z | test/unittests/test_AdjQTotal.py | mudkipmaster/gwlf-e | 9e058445537dd32d1916f76c4b73ca64261771cd | [
"Apache-2.0"
] | 1 | 2018-07-24T18:22:01.000Z | 2018-07-24T18:22:01.000Z | import numpy as np
from VariableUnittest import VariableUnitTest
from gwlfe.MultiUse_Fxns.Discharge import AdjQTotal
class TestAdjQTotal(VariableUnitTest):
def test_AdjQTotal(self):
z = self.z
np.testing.assert_array_almost_equal(
AdjQTotal.AdjQTotal_f(z.NYrs, z.DaysMonth, z.Temp, z.... | 46.555556 | 117 | 0.599045 |
7341033d6cfac31e42522c931aed90e1a74abe8f | 15,057 | py | Python | Tools/BuildSlaveSupport/build.webkit.org-config/run-buildbot-test.py | jacadcaps/webkitty | 9aebd2081349f9a7b5d168673c6f676a1450a66d | [
"BSD-2-Clause"
] | 6 | 2021-07-05T16:09:39.000Z | 2022-03-06T22:44:42.000Z | Tools/BuildSlaveSupport/build.webkit.org-config/run-buildbot-test.py | jacadcaps/webkitty | 9aebd2081349f9a7b5d168673c6f676a1450a66d | [
"BSD-2-Clause"
] | 7 | 2022-03-15T13:25:39.000Z | 2022-03-15T13:25:44.000Z | Tools/BuildSlaveSupport/build.webkit.org-config/run-buildbot-test.py | jacadcaps/webkitty | 9aebd2081349f9a7b5d168673c6f676a1450a66d | [
"BSD-2-Clause"
] | null | null | null | #!/usr/bin/env python
#
# Copyright (C) 2017 Igalia S.L.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and t... | 43.267241 | 130 | 0.653649 |
734104e6e6f21a191f8bdd9007dc4ead919836cf | 4,400 | py | Python | examples/variational_autoencoder/vae_mnist.py | thuwzy/ZhuSuan-PyTorch | 471e4d401a6edce07312b01b2b76fa2c56b15c0f | [
"MIT"
] | 12 | 2021-08-11T10:28:21.000Z | 2022-03-12T14:20:02.000Z | examples/variational_autoencoder/vae_mnist.py | thuwzy/ZhuSuan-PyTorch | 471e4d401a6edce07312b01b2b76fa2c56b15c0f | [
"MIT"
] | null | null | null | examples/variational_autoencoder/vae_mnist.py | thuwzy/ZhuSuan-PyTorch | 471e4d401a6edce07312b01b2b76fa2c56b15c0f | [
"MIT"
] | 2 | 2021-08-17T12:05:15.000Z | 2022-01-12T09:47:49.000Z | import torch
import torch.nn as nn
import math
import os
import sys
sys.path.append('..')
from zhusuan.framework.bn import BayesianNet
from zhusuan.variational.elbo import ELBO
from examples.utils import load_mnist_realval, save_img
class Generator(BayesianNet):
def __init__(self, x_dim, z_dim, batch_size):
... | 29.530201 | 123 | 0.556136 |
734111c07281885374c0965d5cff09b82f557d33 | 2,495 | py | Python | padertorch/modules/fully_connected.py | sibange/padertorch | 494692d877f04c66847c2943795b23aea488217d | [
"MIT"
] | 62 | 2019-12-22T08:30:29.000Z | 2022-03-22T11:02:59.000Z | padertorch/modules/fully_connected.py | sibange/padertorch | 494692d877f04c66847c2943795b23aea488217d | [
"MIT"
] | 47 | 2020-01-06T09:23:47.000Z | 2022-01-24T16:55:06.000Z | padertorch/modules/fully_connected.py | sibange/padertorch | 494692d877f04c66847c2943795b23aea488217d | [
"MIT"
] | 13 | 2019-12-16T08:12:46.000Z | 2021-11-08T14:37:06.000Z | import collections
from typing import List
from torch import nn
from padertorch.ops.mappings import ACTIVATION_FN_MAP
def fully_connected_stack(
input_size: int,
hidden_size: List[int],
output_size: int,
activation: str = 'relu',
dropout: float = 0.5,
output_activatio... | 37.238806 | 103 | 0.634469 |
7341695c72df000bd60ce3f957ff8f7f5a7718c8 | 4,468 | py | Python | utils/Water_Classifier.py | sarah-cheesbrough/odc-sandbox-notebooks | f8b37f2efad77a5acddb56dc4a4c93b4abffe6d0 | [
"Apache-2.0"
] | 7 | 2019-05-25T04:10:29.000Z | 2022-03-24T22:43:59.000Z | utils/Water_Classifier.py | sarah-cheesbrough/odc-sandbox-notebooks | f8b37f2efad77a5acddb56dc4a4c93b4abffe6d0 | [
"Apache-2.0"
] | 3 | 2019-04-16T00:50:04.000Z | 2019-07-10T06:24:51.000Z | utils/Water_Classifier.py | sarah-cheesbrough/odc-sandbox-notebooks | f8b37f2efad77a5acddb56dc4a4c93b4abffe6d0 | [
"Apache-2.0"
] | 6 | 2019-05-18T20:52:01.000Z | 2020-02-06T05:32:50.000Z | import numpy as np
import gc
import warnings
import datacube
from datacube.storage import masking
import xarray as xr
def water_classifier(dataset_in):
def _band_ratio(a, b):
"""
Calculates a normalized ratio index
"""
return (a - b) / (a + b)
def _run_regression(band1, band2... | 25.101124 | 362 | 0.549015 |
73418fc41479ed48faa479be47ae0461c5d41885 | 907 | py | Python | setup.py | ajayp10/derive_event_pm4py | d1fd16c65081348b617dc0697b372a294c91023a | [
"MIT"
] | null | null | null | setup.py | ajayp10/derive_event_pm4py | d1fd16c65081348b617dc0697b372a294c91023a | [
"MIT"
] | null | null | null | setup.py | ajayp10/derive_event_pm4py | d1fd16c65081348b617dc0697b372a294c91023a | [
"MIT"
] | null | null | null | import pathlib
from setuptools import setup
CURRENT_PATH = pathlib.Path(__file__).parent
README = (CURRENT_PATH/"README.md").read_text()
setup(
name="derive_event_pm4py",
version="1.0.1",
description="It derives new events based on rules provided as inputs.",
long_description=README,
long_descrip... | 28.34375 | 75 | 0.651599 |
734196e9b7d29e490ab9372b2fdcf31ad8c2c048 | 19,447 | py | Python | tests/utils/test_checkpoint.py | kmarathe10/mmf | 93cd2a7f333ad14e88fa6c2453a0f54b64b36210 | [
"BSD-3-Clause"
] | null | null | null | tests/utils/test_checkpoint.py | kmarathe10/mmf | 93cd2a7f333ad14e88fa6c2453a0f54b64b36210 | [
"BSD-3-Clause"
] | null | null | null | tests/utils/test_checkpoint.py | kmarathe10/mmf | 93cd2a7f333ad14e88fa6c2453a0f54b64b36210 | [
"BSD-3-Clause"
] | null | null | null | import contextlib
import os
import tempfile
import unittest
from copy import deepcopy
from io import StringIO
from unittest.mock import Mock, patch
import torch
from omegaconf import OmegaConf
from mmf.common.registry import registry
from mmf.models.base_model import BaseModel
from mmf.utils.checkpoint import Checkpo... | 36.417603 | 88 | 0.569908 |
7341d0f86ddc6d8a38a3cf8cbc2f2ef08f4bd6c7 | 8,258 | py | Python | aiida_cp2k/calculations/__init__.py | borellim/aiida-cp2k | a049931946992a5332edc7efd6b9d7e78b42156e | [
"MIT"
] | 1 | 2021-06-13T09:14:46.000Z | 2021-06-13T09:14:46.000Z | aiida_cp2k/calculations/__init__.py | borellim/aiida-cp2k | a049931946992a5332edc7efd6b9d7e78b42156e | [
"MIT"
] | null | null | null | aiida_cp2k/calculations/__init__.py | borellim/aiida-cp2k | a049931946992a5332edc7efd6b9d7e78b42156e | [
"MIT"
] | 3 | 2018-10-16T16:34:35.000Z | 2018-10-19T16:13:01.000Z | # -*- coding: utf-8 -*-
###############################################################################
# Copyright (c), The AiiDA-CP2K authors. #
# SPDX-License-Identifier: MIT #
# AiiDA-CP2K is hosted on GitHub at https://github.com/a... | 47.45977 | 120 | 0.624849 |
7341fa071070b10f5b8ab6b9bd4d191212cef88c | 222 | py | Python | testproject/testproject/urls.py | dszmaj/channels | be07934debaf620bf30f08103d88eff39cb4d6eb | [
"BSD-3-Clause"
] | null | null | null | testproject/testproject/urls.py | dszmaj/channels | be07934debaf620bf30f08103d88eff39cb4d6eb | [
"BSD-3-Clause"
] | 1 | 2022-02-11T03:46:32.000Z | 2022-02-11T03:46:32.000Z | testproject/testproject/urls.py | zsjohny/channels | 6d71106c3c6a8924f75e5058cd6c54e765af3b94 | [
"BSD-3-Clause"
] | 1 | 2022-03-04T22:00:32.000Z | 2022-03-04T22:00:32.000Z | from django.conf.urls import url
from chtest import views
urlpatterns = [url(r'^$', views.index)]
try:
from chtest import consumers
channel_routing = {"websocket.receive": consumers.ws_message}
except:
pass
| 18.5 | 65 | 0.725225 |
73422518d32a912e9187f34d2521909640a24110 | 2,065 | py | Python | services/traction/acapy_wrapper/models/credential.py | Open-Earth-Foundation/traction | 908b555a7f408a88541b7692d3730e37a297c919 | [
"Apache-2.0"
] | 12 | 2022-01-29T20:30:03.000Z | 2022-03-29T11:46:14.000Z | services/traction/acapy_wrapper/models/credential.py | Open-Earth-Foundation/traction | 908b555a7f408a88541b7692d3730e37a297c919 | [
"Apache-2.0"
] | 38 | 2021-11-22T17:52:50.000Z | 2022-03-31T17:52:00.000Z | services/traction/acapy_wrapper/models/credential.py | Open-Earth-Foundation/traction | 908b555a7f408a88541b7692d3730e37a297c919 | [
"Apache-2.0"
] | 9 | 2021-11-22T18:05:48.000Z | 2022-03-29T11:25:08.000Z | # coding: utf-8
from __future__ import annotations
from datetime import date, datetime # noqa: F401
import re # noqa: F401
from typing import Any, Dict, List, Optional # noqa: F401
from pydantic import AnyUrl, BaseModel, EmailStr, validator # noqa: F401
from acapy_wrapper.models.linked_data_proof import LinkedDa... | 33.306452 | 138 | 0.613075 |
73426b534a1e6d292b5e1b45c9faefc868cbd6da | 3,447 | py | Python | tf2onnx/tflite/LocalResponseNormalizationOptions.py | LoicDagnas/tensorflow-onnx | 6691850e79047d05d85017573170fd8240393b57 | [
"Apache-2.0"
] | 1,473 | 2018-03-16T02:47:33.000Z | 2022-03-31T03:43:52.000Z | tf2onnx/tflite/LocalResponseNormalizationOptions.py | LoicDagnas/tensorflow-onnx | 6691850e79047d05d85017573170fd8240393b57 | [
"Apache-2.0"
] | 1,208 | 2018-03-14T09:58:49.000Z | 2022-03-31T17:56:20.000Z | tf2onnx/tflite/LocalResponseNormalizationOptions.py | LoicDagnas/tensorflow-onnx | 6691850e79047d05d85017573170fd8240393b57 | [
"Apache-2.0"
] | 350 | 2018-04-03T03:48:40.000Z | 2022-03-30T11:23:55.000Z | # SPDX-License-Identifier: Apache-2.0
# automatically generated by the FlatBuffers compiler, do not modify
# namespace: tflite
import flatbuffers
from flatbuffers.compat import import_numpy
np = import_numpy()
class LocalResponseNormalizationOptions(object):
__slots__ = ['_tab']
@classmethod
def GetRoo... | 41.035714 | 114 | 0.723818 |
734273b3dfc75e37f0fbf42e324a367da8920f2b | 19,850 | py | Python | brian2/codegen/translation.py | achilleas-k/brian2 | 906563b6b1321585b082f79f74f1b4ab386347ec | [
"BSD-2-Clause"
] | null | null | null | brian2/codegen/translation.py | achilleas-k/brian2 | 906563b6b1321585b082f79f74f1b4ab386347ec | [
"BSD-2-Clause"
] | null | null | null | brian2/codegen/translation.py | achilleas-k/brian2 | 906563b6b1321585b082f79f74f1b4ab386347ec | [
"BSD-2-Clause"
] | null | null | null | '''
This module translates a series of statements into a language-specific
syntactically correct code block that can be inserted into a template.
It infers whether or not a variable can be declared as
constant, etc. It should handle common subexpressions, and so forth.
The input information needed:
* The se... | 41.440501 | 108 | 0.595164 |
7342c3580585926f18c597c3af9980ba2c793f5e | 2,544 | py | Python | mozz_archiver/resolvers.py | michael-lazar/mozz-archiver | 12617d2efca91663699647654bcd3e40f5f388f2 | [
"BlueOak-1.0.0"
] | 9 | 2020-09-17T05:44:26.000Z | 2022-02-10T07:25:47.000Z | mozz_archiver/resolvers.py | michael-lazar/mozz-archiver | 12617d2efca91663699647654bcd3e40f5f388f2 | [
"BlueOak-1.0.0"
] | 9 | 2020-09-24T03:17:40.000Z | 2020-11-07T04:34:35.000Z | mozz_archiver/resolvers.py | michael-lazar/mozz-archiver | 12617d2efca91663699647654bcd3e40f5f388f2 | [
"BlueOak-1.0.0"
] | null | null | null | from scrapy.resolver import dnscache
from twisted.internet.interfaces import IHostnameResolver, IResolutionReceiver
from twisted.internet._resolver import HostResolution
from zope.interface.declarations import implementer, provider
class HostnameResolver:
def __init__(self, reactor):
self.reactor = react... | 29.929412 | 78 | 0.654481 |
73432d13b804a067d74680d0ba8b156a12845cd9 | 2,242 | py | Python | tests/common/test_op/ascend/scatter_nd.py | tianjiashuo/akg | a9cbf642063fb1086a93e8bc6be6feb145689817 | [
"Apache-2.0"
] | 286 | 2020-06-23T06:40:44.000Z | 2022-03-30T01:27:49.000Z | tests/common/test_op/ascend/scatter_nd.py | tianjiashuo/akg | a9cbf642063fb1086a93e8bc6be6feb145689817 | [
"Apache-2.0"
] | 10 | 2020-07-31T03:26:59.000Z | 2021-12-27T15:00:54.000Z | tests/common/test_op/ascend/scatter_nd.py | tianjiashuo/akg | a9cbf642063fb1086a93e8bc6be6feb145689817 | [
"Apache-2.0"
] | 30 | 2020-07-17T01:04:14.000Z | 2021-12-27T14:05:19.000Z | # Copyright 2019-2021 Huawei Technologies Co., Ltd
#
# 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 agre... | 37.366667 | 105 | 0.673506 |
73432fcbadd8f65c1d0067b4caa2e95f1947115f | 7,824 | py | Python | docs/conf.py | PFdevelopment/locallibrary | 7e061a72d67d1bc89fa792850c7a699fec48dea9 | [
"MIT"
] | null | null | null | docs/conf.py | PFdevelopment/locallibrary | 7e061a72d67d1bc89fa792850c7a699fec48dea9 | [
"MIT"
] | null | null | null | docs/conf.py | PFdevelopment/locallibrary | 7e061a72d67d1bc89fa792850c7a699fec48dea9 | [
"MIT"
] | null | null | null | # LocalLibrary documentation build configuration file, created by
# sphinx-quickstart.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# All configuration values have a default; values that... | 32.065574 | 80 | 0.707311 |
7343323c2e07888974a79b78ecc8d97ca08bbb9f | 2,473 | py | Python | stackoverflow-solutions/submission-scripts/SO_Q67132064_multiprocessor_as_decorator.py | MarkMoretto/python-examples-main | 37b8c41d2f175029f4536ca970f037ff19b4e951 | [
"MIT"
] | 1 | 2020-07-21T23:24:25.000Z | 2020-07-21T23:24:25.000Z | stackoverflow-solutions/submission-scripts/SO_Q67132064_multiprocessor_as_decorator.py | MarkMoretto/python-examples-main | 37b8c41d2f175029f4536ca970f037ff19b4e951 | [
"MIT"
] | 4 | 2021-06-29T00:38:57.000Z | 2022-01-15T00:22:15.000Z | stackoverflow-solutions/submission-scripts/SO_Q67132064_multiprocessor_as_decorator.py | MarkMoretto/python-examples-main | 37b8c41d2f175029f4536ca970f037ff19b4e951 | [
"MIT"
] | null | null | null |
"""
Purpose: Stackoverflow
Date created: 2021-04-17
Title: Python Multiprocessing Pool as Decorator
URL: https://stackoverflow.com/questions/67132064/python-multiprocessing-pool-as-decorator
https://docs.python.org/3/reference/datamodel.html#metaclasses
https://docs.python.org/3/reference/datamodel.html
https://docs... | 25.234694 | 93 | 0.637687 |
734336720958e522d8e9f0d8012d72ab0dcb2e0c | 339 | py | Python | riboviz/__init__.py | rasilab/riboviz | a2ebaa7dac383e6ce0972626bf57fdba105d1780 | [
"Apache-2.0"
] | 13 | 2020-10-20T13:03:11.000Z | 2022-02-17T02:07:41.000Z | riboviz/__init__.py | rasilab/riboviz | a2ebaa7dac383e6ce0972626bf57fdba105d1780 | [
"Apache-2.0"
] | 306 | 2020-03-04T14:23:34.000Z | 2022-02-26T14:51:02.000Z | riboviz/__init__.py | rasilab/riboviz | a2ebaa7dac383e6ce0972626bf57fdba105d1780 | [
"Apache-2.0"
] | 9 | 2020-04-26T20:27:02.000Z | 2022-02-01T13:16:52.000Z | """
General constants.
"""
import os.path
BASE_PATH = os.path.dirname(os.path.dirname(__file__))
""" Path to parent of :py:mod:`riboviz` module. """
PY_SCRIPTS = os.path.join(BASE_PATH, "riboviz/tools")
""" Path to ``riboviz/tools/`` directory. """
R_SCRIPTS = os.path.join(BASE_PATH, "rscripts")
""" Path to ``rscripts... | 28.25 | 54 | 0.678466 |
73435894b2fd669261b50479a82443cc559a8bc9 | 10,891 | py | Python | awx_collection/plugins/modules/tower_workflow_job_template.py | Mayses/awx | 35441694a9707d0d2f57c701970db22110091163 | [
"Apache-2.0"
] | 1 | 2021-08-02T10:37:09.000Z | 2021-08-02T10:37:09.000Z | awx_collection/plugins/modules/tower_workflow_job_template.py | Mayses/awx | 35441694a9707d0d2f57c701970db22110091163 | [
"Apache-2.0"
] | 4 | 2022-02-14T22:19:48.000Z | 2022-03-02T12:36:11.000Z | awx_collection/plugins/modules/tower_workflow_job_template.py | hostinger/awx | dac01b14e2c04c201a162ea03ef8386d822e3923 | [
"Apache-2.0"
] | 24 | 2020-11-27T08:37:35.000Z | 2021-03-08T13:27:15.000Z | #!/usr/bin/python
# coding: utf-8 -*-
# (c) 2020, John Westcott IV <john.westcott.iv@redhat.com>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version':... | 37.297945 | 132 | 0.683133 |
7343788613b94176a1a50da0aea7d96c865d0b24 | 268 | py | Python | pni_customization/pni_customization/doctype/pni_packing_carton/pni_packing_carton.py | DaizyModi/pni_customization | 577946e91c8fe956ca64c089327ce18174002ec4 | [
"MIT"
] | null | null | null | pni_customization/pni_customization/doctype/pni_packing_carton/pni_packing_carton.py | DaizyModi/pni_customization | 577946e91c8fe956ca64c089327ce18174002ec4 | [
"MIT"
] | null | null | null | pni_customization/pni_customization/doctype/pni_packing_carton/pni_packing_carton.py | DaizyModi/pni_customization | 577946e91c8fe956ca64c089327ce18174002ec4 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright (c) 2019, Jigar Tarpara and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
# import frappe
from frappe.model.document import Document
class PNIPackingCarton(Document):
pass
| 24.363636 | 52 | 0.779851 |
7343abbc7e6bd214a47c6e4491261403c209f818 | 4,233 | py | Python | tests/test_metrics.py | b-biswas/BlendingToolKit | 2e85da4df99a84bcdff1d85ed66eb8589eb72499 | [
"MIT"
] | null | null | null | tests/test_metrics.py | b-biswas/BlendingToolKit | 2e85da4df99a84bcdff1d85ed66eb8589eb72499 | [
"MIT"
] | null | null | null | tests/test_metrics.py | b-biswas/BlendingToolKit | 2e85da4df99a84bcdff1d85ed66eb8589eb72499 | [
"MIT"
] | null | null | null | from unittest.mock import patch
import matplotlib.pyplot as plt
import numpy as np
import btk.plot_utils as plot_utils
from btk.catalog import CatsimCatalog
from btk.draw_blends import CatsimGenerator
from btk.measure import MeasureGenerator
from btk.measure import sep_measure
from btk.metrics import auc
from btk.met... | 34.137097 | 100 | 0.659107 |
7343e9d3568ac7fb859a9269ad97068c5e2d6c9a | 106 | py | Python | modules/homie/model/HomieProperty.py | Korbier/PyWsServer | 95510a935c3019ead04d2de71e4344d94b3ac560 | [
"MIT"
] | null | null | null | modules/homie/model/HomieProperty.py | Korbier/PyWsServer | 95510a935c3019ead04d2de71e4344d94b3ac560 | [
"MIT"
] | null | null | null | modules/homie/model/HomieProperty.py | Korbier/PyWsServer | 95510a935c3019ead04d2de71e4344d94b3ac560 | [
"MIT"
] | null | null | null | class HomieProperty:
def __init__( self, id, node ):
self.id = id
self.node = node
| 17.666667 | 35 | 0.556604 |
734413b621e743187b31141282f710ac543cdd18 | 3,718 | py | Python | datatype_tools/utils/string_functions.py | edmundpf/datatype_tools | 903094fe3aa76cf6714a8f2e53d24afcca244a39 | [
"MIT"
] | null | null | null | datatype_tools/utils/string_functions.py | edmundpf/datatype_tools | 903094fe3aa76cf6714a8f2e53d24afcca244a39 | [
"MIT"
] | null | null | null | datatype_tools/utils/string_functions.py | edmundpf/datatype_tools | 903094fe3aa76cf6714a8f2e53d24afcca244a39 | [
"MIT"
] | null | null | null | import sys
from datetime import datetime
from base64 import b64encode, b64decode
#: Replace Multiple Values
def replace_multiple(self, dictionary):
"""
Replaces multiple items with dictionary keys being the item to replace, and values being replacements.
>>> replace_multiple('The Apple is Red.', {'Apple': 'Grass',... | 27.138686 | 146 | 0.637171 |
734483a10a01b26ae896593cd904809440d859fb | 1,253 | py | Python | utils/daemonping.py | QuantumLeaper/uplexa-python | 7382e1bbcf757f4852ef8238c9385ccda339147f | [
"BSD-3-Clause"
] | 2 | 2019-09-04T17:06:02.000Z | 2020-10-19T02:22:46.000Z | utils/daemonping.py | uPlexa/uplexa-python | e0074d7fb778a5fe150baf9a6badb3c2fc20afbb | [
"BSD-3-Clause"
] | 1 | 2021-07-17T22:30:15.000Z | 2021-07-17T22:30:15.000Z | utils/daemonping.py | QuantumLeaper/uplexa-python | 7382e1bbcf757f4852ef8238c9385ccda339147f | [
"BSD-3-Clause"
] | 1 | 2019-03-05T17:52:36.000Z | 2019-03-05T17:52:36.000Z | #!/usr/bin/python
import argparse
import logging
import operator
import re
from uplexa.backends.jsonrpc import JSONRPCDaemon
from uplexa.daemon import Daemon
def url_data(url):
gs = re.compile(
r'^(?P<host>[^:\s]+)(?::(?P<port>[0-9]+))?$'
).match(url).groupdict()
return dict(filter(operator.it... | 32.973684 | 98 | 0.652833 |
73448ca6510e9c850181a82a9599297607d7b4b4 | 9,807 | py | Python | contrib/scrooge/src/python/pants/contrib/scrooge/tasks/scrooge_gen.py | dturner-tw/pants | 3a04f2e46bf2b8fb0a7999c09e4ffdf9057ed33f | [
"Apache-2.0"
] | null | null | null | contrib/scrooge/src/python/pants/contrib/scrooge/tasks/scrooge_gen.py | dturner-tw/pants | 3a04f2e46bf2b8fb0a7999c09e4ffdf9057ed33f | [
"Apache-2.0"
] | null | null | null | contrib/scrooge/src/python/pants/contrib/scrooge/tasks/scrooge_gen.py | dturner-tw/pants | 3a04f2e46bf2b8fb0a7999c09e4ffdf9057ed33f | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# Copyright 2014 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
import hashlib
impor... | 40.8625 | 100 | 0.694096 |
73449d33be509aeb5701c5edb5f563afaec7c1e9 | 230 | py | Python | problems/1295_find-numbers-with-even-number-of-digits.py | okuda-seminar/review_leetcode | 9774dbb85b836c3ebab4b24d77774ed05abb7a32 | [
"MIT"
] | null | null | null | problems/1295_find-numbers-with-even-number-of-digits.py | okuda-seminar/review_leetcode | 9774dbb85b836c3ebab4b24d77774ed05abb7a32 | [
"MIT"
] | 170 | 2021-05-11T14:03:05.000Z | 2021-11-30T14:22:52.000Z | problems/1295_find-numbers-with-even-number-of-digits.py | ryuji0123/review_leetcode | 9774dbb85b836c3ebab4b24d77774ed05abb7a32 | [
"MIT"
] | null | null | null | class Solution:
def findNumbers(self, nums: List[int]) -> int:
digits = [len(str(i)) for i in nums]
count = 0
for i in digits:
if i % 2 == 0:
count += 1
return count
| 25.555556 | 50 | 0.469565 |
7344f32128524ca727ee76652e5d48ed2c1e964f | 5,695 | py | Python | ferrox/lib/image.py | hsuaz/ferrox | ac89b698e6c12c57c7a3128b6a25a3dc100bfc15 | [
"MIT"
] | 3 | 2017-01-03T20:55:16.000Z | 2022-03-01T15:21:53.000Z | ferrox/lib/image.py | hsuaz/ferrox | ac89b698e6c12c57c7a3128b6a25a3dc100bfc15 | [
"MIT"
] | null | null | null | ferrox/lib/image.py | hsuaz/ferrox | ac89b698e6c12c57c7a3128b6a25a3dc100bfc15 | [
"MIT"
] | 4 | 2017-01-03T20:48:09.000Z | 2022-03-01T15:21:58.000Z | # This is my image library. It behaves as follows:
# declare an object using the with statement. (This is not strictly necessary if you're using the C library, but the failover
# code relies on it for temp file cleanup. Python 2.5 ONLY. Also, the failover code should NOT be used in production. Ever.)
#
# with ImageC... | 34.93865 | 129 | 0.572432 |
734525303ea1d861644bbefc66203d0df484dc68 | 38,123 | py | Python | consensus/poet/core/tests/test_consensus/test_poet_block_publisher.py | trust-tech/sawtooth-core | fcd66ff2f13dba51d7642049e0c0306dbee3b07d | [
"Apache-2.0"
] | null | null | null | consensus/poet/core/tests/test_consensus/test_poet_block_publisher.py | trust-tech/sawtooth-core | fcd66ff2f13dba51d7642049e0c0306dbee3b07d | [
"Apache-2.0"
] | null | null | null | consensus/poet/core/tests/test_consensus/test_poet_block_publisher.py | trust-tech/sawtooth-core | fcd66ff2f13dba51d7642049e0c0306dbee3b07d | [
"Apache-2.0"
] | null | null | null | # Copyright 2017 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wri... | 42.078366 | 80 | 0.670881 |
73454e9f1fc505f690aca33480419f2e94064b47 | 759 | py | Python | h2o-py/tests/testdir_algos/pca/pyunit_arrestsPCA.py | My-Technical-Architect/h2o-3 | d383802fb7f9c3ec9c72b7869fe636059a333d88 | [
"Apache-2.0"
] | 1 | 2018-03-22T12:45:32.000Z | 2018-03-22T12:45:32.000Z | h2o-py/tests/testdir_algos/pca/pyunit_arrestsPCA.py | My-Technical-Architect/h2o-3 | d383802fb7f9c3ec9c72b7869fe636059a333d88 | [
"Apache-2.0"
] | null | null | null | h2o-py/tests/testdir_algos/pca/pyunit_arrestsPCA.py | My-Technical-Architect/h2o-3 | d383802fb7f9c3ec9c72b7869fe636059a333d88 | [
"Apache-2.0"
] | 1 | 2018-10-23T02:52:55.000Z | 2018-10-23T02:52:55.000Z | from __future__ import print_function
from builtins import str
from builtins import range
import sys
sys.path.insert(1,"../../../")
import h2o
from tests import pyunit_utils
from h2o.transforms.decomposition import H2OPCA
def pca_arrests():
print("Importing USArrests.csv data...")
arrestsH2O = h2o.upload_file(... | 22.323529 | 87 | 0.720685 |
73456830f01260c3eb68f67656a81d901fb8bb50 | 3,191 | py | Python | sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2021_07_01/_configuration.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | 1 | 2022-03-09T08:59:13.000Z | 2022-03-09T08:59:13.000Z | sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2021_07_01/_configuration.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | null | null | null | sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2021_07_01/_configuration.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | 1 | 2022-03-04T06:21:56.000Z | 2022-03-04T06:21:56.000Z | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... | 46.246377 | 125 | 0.690066 |
73456be370b941ca99a1b99c227d3c472623a658 | 4,141 | py | Python | scripts/generate_graph_annotation.py | AMARTELKE/Pangenome-with-Panaroo | b720debf8616882668d53600038c334393080d9b | [
"MIT"
] | 116 | 2019-11-28T07:54:26.000Z | 2022-03-31T03:20:44.000Z | scripts/generate_graph_annotation.py | AMARTELKE/Pangenome-with-Panaroo | b720debf8616882668d53600038c334393080d9b | [
"MIT"
] | 120 | 2019-12-08T21:01:46.000Z | 2022-03-30T04:11:52.000Z | scripts/generate_graph_annotation.py | AMARTELKE/Pangenome-with-Panaroo | b720debf8616882668d53600038c334393080d9b | [
"MIT"
] | 19 | 2019-12-19T05:34:03.000Z | 2022-03-19T05:54:51.000Z | import networkx as nx
def generate_annotation(annotation, graph, node_out, edge_out):
annot_dicts = {}
#resolve hzi isolate name
#read in graph and get isolate names
g = nx.read_gml(graph)
import re
#id2isol = dict([(re.sub(r'_spades3.10.0_careful$', '', i), str(j)) for i, j in zip(g.graph["is... | 42.255102 | 183 | 0.56822 |
73459f1f0748a651a1f06203b1087eec7f903413 | 1,917 | py | Python | examples/plots/plot_heatmap.py | abhijith-git/mplsoccer | 7359ed83117cb6f191f82c44fe953eb421395695 | [
"MIT"
] | 1 | 2021-05-20T16:31:21.000Z | 2021-05-20T16:31:21.000Z | examples/plots/plot_heatmap.py | eddwebster/mplsoccer | eb260bc9ab8a94473b4082d922ed490ce11e7982 | [
"MIT"
] | null | null | null | examples/plots/plot_heatmap.py | eddwebster/mplsoccer | eb260bc9ab8a94473b4082d922ed490ce11e7982 | [
"MIT"
] | null | null | null | """
=======
Heatmap
=======
This example shows how to plot all pressure events from three matches as a heatmap.
"""
from mplsoccer.pitch import Pitch
from mplsoccer.statsbomb import read_event, EVENT_SLUG
import os
import pandas as pd
import numpy as np
# get data
match_files = ['19789.json', '19794.json', '19805.js... | 43.568182 | 116 | 0.642671 |
7345a603c28013f2bbbcd738d393c90085c5c2f5 | 49,167 | py | Python | qcdb/qcvars/glossary.py | nuwandesilva/qcdb | b47fb2ed550fc4176198ddb1dbea3724d6704d23 | [
"BSD-3-Clause"
] | null | null | null | qcdb/qcvars/glossary.py | nuwandesilva/qcdb | b47fb2ed550fc4176198ddb1dbea3724d6704d23 | [
"BSD-3-Clause"
] | null | null | null | qcdb/qcvars/glossary.py | nuwandesilva/qcdb | b47fb2ed550fc4176198ddb1dbea3724d6704d23 | [
"BSD-3-Clause"
] | null | null | null | qcvardefs = {}
#.. include:: autodoc_abbr_options_c.rst
#
#.. _`apdx:psivariables_alpha`:
#
#PSI Variables by Alpha
#======================
#
#.. note:: Lowercase letters in PSI variable names represent portions of
# the variable name that vary by root number, calculation order, etc.
# See text for fuller descripti... | 31.598329 | 134 | 0.647752 |
7345bb01836a1f56265c737ecc672c31294553d6 | 19,215 | py | Python | doozerlib/rpm_builder.py | vfreex/doozer | 8ad0a1234120cdc30890afbbdda1bc40e4a4fc76 | [
"Apache-2.0"
] | null | null | null | doozerlib/rpm_builder.py | vfreex/doozer | 8ad0a1234120cdc30890afbbdda1bc40e4a4fc76 | [
"Apache-2.0"
] | null | null | null | doozerlib/rpm_builder.py | vfreex/doozer | 8ad0a1234120cdc30890afbbdda1bc40e4a4fc76 | [
"Apache-2.0"
] | null | null | null | import asyncio
import logging
import re
import shutil
import threading
from os import PathLike
from pathlib import Path
from typing import Dict, List, Optional
import aiofiles
import aiofiles.os
from doozerlib import brew, exectools
from doozerlib.distgit import RPMDistGitRepo
from doozerlib.model import Missing
from... | 44.376443 | 227 | 0.560396 |
7345cca4c21d59b8989a7fd7e6031be454975b6c | 3,356 | py | Python | riemann/neural/manifold_layer.py | arunchaganty/riemannian-nlp | bcaa0590a6be22e1cd2103dd12835400f35f170d | [
"MIT"
] | null | null | null | riemann/neural/manifold_layer.py | arunchaganty/riemannian-nlp | bcaa0590a6be22e1cd2103dd12835400f35f170d | [
"MIT"
] | null | null | null | riemann/neural/manifold_layer.py | arunchaganty/riemannian-nlp | bcaa0590a6be22e1cd2103dd12835400f35f170d | [
"MIT"
] | null | null | null | import torch.nn as nn
import torch
from ..manifolds import RiemannianManifold
from ..manifold_tensors import ManifoldParameter
from ..embed_save import Savable
from torch.nn.init import orthogonal_
import math
class ManifoldLayer(nn.Module):
def __init__(
self,
in_manifold: RiemannianManifo... | 40.926829 | 140 | 0.646305 |
73460752405ac2f8bac2203bfd99038c62172a1d | 1,352 | py | Python | mpinterfaces/scripts/fabfile.py | yw-fang/MPInterfaces | ca2e43b590fdfbcf87a116c5c758e54cb7cb2d2e | [
"MIT"
] | 56 | 2015-06-23T03:03:18.000Z | 2022-02-06T16:41:34.000Z | mpinterfaces/scripts/fabfile.py | yw-fang/MPInterfaces | ca2e43b590fdfbcf87a116c5c758e54cb7cb2d2e | [
"MIT"
] | 21 | 2015-09-03T17:50:18.000Z | 2022-03-01T02:26:34.000Z | mpinterfaces/scripts/fabfile.py | joshgabriel/MPInterfaces | 2799ae161fa94c78842092fb24ef468607afa465 | [
"MIT"
] | 50 | 2015-09-17T19:09:36.000Z | 2021-11-15T19:13:20.000Z | from __future__ import with_statement, division, unicode_literals, \
print_function, absolute_import
"""
remote job launch using the fabric package.
usage:
example: launch firework with id 10 on lithium
fab launch:10,lithium
Note:
Before launching make sure that the machine to the which the
j... | 30.727273 | 70 | 0.681953 |
73460e7a29c9574b8a3339c7c5e967b45a969213 | 6,661 | py | Python | python3/pandas/Pandas_WorkingOnTextData.py | Nahid-Hassan/code-snippets | 24bd4b81564887822a0801a696001fcbeb6a7a75 | [
"MIT"
] | 2 | 2020-09-29T04:09:41.000Z | 2020-10-18T13:33:36.000Z | python3/pandas/Pandas_WorkingOnTextData.py | Nahid-Hassan/code-snippets | 24bd4b81564887822a0801a696001fcbeb6a7a75 | [
"MIT"
] | null | null | null | python3/pandas/Pandas_WorkingOnTextData.py | Nahid-Hassan/code-snippets | 24bd4b81564887822a0801a696001fcbeb6a7a75 | [
"MIT"
] | 1 | 2021-12-26T04:55:55.000Z | 2021-12-26T04:55:55.000Z | import pandas as pd
import numpy as np
#Working with series data
ser = pd.Series(['a','v','nahid',np.nan,'AbaaB','Hassan','d'])
print(ser,"\n")
'''
Output:
0 a
1 v
2 nahid
3 NaN
4 AbaaB
5 Hassan
6 d
'''
#***************Converting to lowerCase and UpperCase**************
low = se... | 26.967611 | 89 | 0.511485 |
73461340bf3746792c57f6812cf43181d5947808 | 75,853 | py | Python | geowombat/util/web.py | jgrss/geowombat | e691102a3dcce13b272810b43bc9586681ae6934 | [
"MIT"
] | 38 | 2020-01-13T22:45:18.000Z | 2022-03-31T05:44:35.000Z | geowombat/util/web.py | jgrss/geowombat | e691102a3dcce13b272810b43bc9586681ae6934 | [
"MIT"
] | 41 | 2020-01-27T00:57:58.000Z | 2022-03-10T19:52:20.000Z | geowombat/util/web.py | jgrss/geowombat | e691102a3dcce13b272810b43bc9586681ae6934 | [
"MIT"
] | 4 | 2020-01-14T19:27:38.000Z | 2021-08-23T03:08:37.000Z | import os
import shutil
import fnmatch
import tarfile
import subprocess
from pathlib import Path
from datetime import datetime
from collections import namedtuple
import time
import logging
import concurrent.futures
from ..handler import add_handler
from ..radiometry import BRDF, LinearAdjustments, RadTransforms, lands... | 43.493693 | 173 | 0.396636 |
7346463f8ac5387f811d12429e08d0bd35ddc275 | 2,417 | py | Python | test.py | LBaritone/BlueSim | fa2d777e1105cdde34fd846ff8be4623612f1ac6 | [
"MIT"
] | null | null | null | test.py | LBaritone/BlueSim | fa2d777e1105cdde34fd846ff8be4623612f1ac6 | [
"MIT"
] | null | null | null | test.py | LBaritone/BlueSim | fa2d777e1105cdde34fd846ff8be4623612f1ac6 | [
"MIT"
] | null | null | null | from pprint import pprint
import numpy as np
arena_size = np.array([1780, 1780, 1170])
res = 10
x_vals = np.linspace(0, arena_size[0], res)
y_vals = np.linspace(0, arena_size[1], res)
z_vals = np.linspace(0, arena_size[2], res)
zero = np.zeros((res, res))
x_end = np.full((res, res), arena_size[0])
y_end = np.full((... | 33.109589 | 81 | 0.563508 |
734646843412d952a5024218d0013ab8418165c2 | 1,207 | py | Python | modelscript/scripts/accesses/printer.py | ScribesZone/ModelScribes | a36be1047283f2e470dc2dd4353f2a714377bb7d | [
"MIT"
] | 1 | 2019-02-22T14:27:06.000Z | 2019-02-22T14:27:06.000Z | modelscript/scripts/accesses/printer.py | ScribesZone/ModelScribes | a36be1047283f2e470dc2dd4353f2a714377bb7d | [
"MIT"
] | 4 | 2019-02-12T07:49:15.000Z | 2019-02-12T07:50:12.000Z | modelscript/scripts/accesses/printer.py | ScribesZone/ModelScribes | a36be1047283f2e470dc2dd4353f2a714377bb7d | [
"MIT"
] | null | null | null | # coding=utf-8
from modelscript.base.printers import (
AbstractPrinter
)
from modelscript.metamodels.permissions.accesses import (
METAMODEL,
AccessModel,
)
class AccessModelPrinter(AbstractPrinter): # TODO:4 check this
def __init__(self, accessModel, displayLineNos=True):
#type: (AccessMode... | 26.822222 | 70 | 0.650373 |
73464c31d0d9e338d7551556c5d1b356b7dcbe0d | 411 | py | Python | pharmaplot/tests/test_mm.py | praelfj/pharm-interactive-plotting | 13ce865cf23333e26ef17fe685985b7015708f36 | [
"MIT"
] | null | null | null | pharmaplot/tests/test_mm.py | praelfj/pharm-interactive-plotting | 13ce865cf23333e26ef17fe685985b7015708f36 | [
"MIT"
] | null | null | null | pharmaplot/tests/test_mm.py | praelfj/pharm-interactive-plotting | 13ce865cf23333e26ef17fe685985b7015708f36 | [
"MIT"
] | null | null | null | """
unit testing framework for michaelis-menten kinetics module
"""
import pytest
import numpy as np
from pharmaplot.mm import michaelis_menten
def test_mm_kinetics():
"""make sure that the mm function is returning reasonable values"""
test_substrate = np.array([1, 2])
test_vo = (5 * test_substrate) / (2 ... | 25.6875 | 71 | 0.727494 |
7346663917a8318dd2b89239b9a2513a71a7b464 | 310 | py | Python | samples/config_samples/config1.py | cnheider/warg | 4bcc5d3e86dd843773ca6cbca21bcab3b8ae84eb | [
"Apache-2.0"
] | 1 | 2018-11-30T09:14:28.000Z | 2018-11-30T09:14:28.000Z | samples/config_samples/async_test/config2.py | aivclab/warg | 4bcc5d3e86dd843773ca6cbca21bcab3b8ae84eb | [
"Apache-2.0"
] | 49 | 2019-04-02T12:06:10.000Z | 2019-08-31T14:30:12.000Z | samples/config_samples/config1.py | cnHeider/warg | 4bcc5d3e86dd843773ca6cbca21bcab3b8ae84eb | [
"Apache-2.0"
] | 1 | 2019-03-16T13:56:03.000Z | 2019-03-16T13:56:03.000Z | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
__author__ = "Christian Heider Nielsen"
__doc__ = r"""
Created on 11-12-2020
"""
from pathlib import Path
from warg.imports import import_warning
import_warning(Path(__file__).with_suffix("").name)
A_CONSTANT = 2
ANOTHER_CONSTANT = 42
| 17.222222 | 51 | 0.674194 |
7346671c3dc669760faba90d8eb8a301c9cb233f | 33,909 | py | Python | tests/_utils.py | minwook-shin/aws-data-wrangler | 304e734db5e96cc5e11ff54b4f3a1cf7c4e5736b | [
"Apache-2.0"
] | null | null | null | tests/_utils.py | minwook-shin/aws-data-wrangler | 304e734db5e96cc5e11ff54b4f3a1cf7c4e5736b | [
"Apache-2.0"
] | null | null | null | tests/_utils.py | minwook-shin/aws-data-wrangler | 304e734db5e96cc5e11ff54b4f3a1cf7c4e5736b | [
"Apache-2.0"
] | null | null | null | import random
import time
from datetime import datetime
from decimal import Decimal
from typing import Any, Dict, Iterator
import boto3
import botocore.exceptions
import pandas as pd
import awswrangler as wr
from awswrangler._utils import try_it
ts = lambda x: datetime.strptime(x, "%Y-%m-%d %H:%M:%S.%f") # noqa
dt ... | 55.497545 | 117 | 0.509629 |
73466cc8eb35cf0e6c51f23a7b69e875cd5c2849 | 4,583 | py | Python | src/nwc_pattern_miner/tests/mining/test_candidatepattern.py | anirudhagar13/nwc_pattern_mining | f13a6c5e4be69a99f38000294033a82118345b78 | [
"MIT"
] | null | null | null | src/nwc_pattern_miner/tests/mining/test_candidatepattern.py | anirudhagar13/nwc_pattern_mining | f13a6c5e4be69a99f38000294033a82118345b78 | [
"MIT"
] | null | null | null | src/nwc_pattern_miner/tests/mining/test_candidatepattern.py | anirudhagar13/nwc_pattern_mining | f13a6c5e4be69a99f38000294033a82118345b78 | [
"MIT"
] | 1 | 2021-02-23T01:37:49.000Z | 2021-02-23T01:37:49.000Z | import unittest
import numpy as np
import pandas as pd
from module.utilities import stringify_dataframe
from module.patterncount import SequenceMap
from module.mining import EnumeratedPattern
class TestEnumeratedPattern(unittest.TestCase):
engrpm = np.array([2015, 1755, 1076, 2015, 1755, 1076, 2014, 1755, 1076])
... | 41.663636 | 85 | 0.67794 |
73467053a5ae33f6f9caafa6e9ff2801ee5d3cc5 | 351 | py | Python | yourss/webapp/__init__.py | essembeh/YouRSS | c9ceda791296cdf7c92f0bcec58922e0552b5505 | [
"Apache-2.0"
] | null | null | null | yourss/webapp/__init__.py | essembeh/YouRSS | c9ceda791296cdf7c92f0bcec58922e0552b5505 | [
"Apache-2.0"
] | 2 | 2021-05-31T11:56:17.000Z | 2021-06-30T22:32:07.000Z | yourss/webapp/__init__.py | essembeh/youtube-rss-viewer | c9ceda791296cdf7c92f0bcec58922e0552b5505 | [
"Apache-2.0"
] | null | null | null | """
"""
from os import environ
from .. import __name__ as appname
from ..api import api, jwt
from ..database import db
from .login import login_manager
from .server import initialize_app
app = initialize_app(appname, environ["APP_SECRETKEY"], environ["APP_DATABASE"])
db.init_app(app)
jwt.init_app(app)
api.init_app(ap... | 21.9375 | 80 | 0.77208 |
73467b61337126dca7205cb1da84dcb793e63775 | 669 | py | Python | analyze/urls.py | UUDigitalHumanitieslab/AASP | 61da47d098971d25246125cffdd4bc9c32ab9313 | [
"BSD-3-Clause"
] | null | null | null | analyze/urls.py | UUDigitalHumanitieslab/AASP | 61da47d098971d25246125cffdd4bc9c32ab9313 | [
"BSD-3-Clause"
] | 12 | 2020-10-07T12:40:04.000Z | 2021-10-13T14:19:25.000Z | analyze/urls.py | UUDigitalHumanitieslab/AASP | 61da47d098971d25246125cffdd4bc9c32ab9313 | [
"BSD-3-Clause"
] | null | null | null | from django.conf.urls import url
from django.urls import path
from analyze.views import AnalyzeView, \
FDASmoothingView, SelectTierView, FDASelectIntervalView
from analyze.charts import get_gcv_err_plot, get_combined_images
urlpatterns = [
path('', AnalyzeView.as_view(), name='analyze'),
path('fda_smooth... | 41.8125 | 110 | 0.762332 |
73467f835bc2c2adbacdf4711d07584a9661798c | 13,512 | py | Python | cadnano/util.py | sherwoodyao/cadnano2.5 | ce6ff019b88ee7728de947bd86b35861cf57848d | [
"BSD-3-Clause"
] | 69 | 2015-01-13T02:54:40.000Z | 2022-03-27T14:25:51.000Z | cadnano/util.py | scholer/cadnano2.5 | ce6ff019b88ee7728de947bd86b35861cf57848d | [
"BSD-3-Clause"
] | 127 | 2015-01-01T06:26:34.000Z | 2022-03-02T12:48:05.000Z | cadnano/util.py | scholer/cadnano2.5 | ce6ff019b88ee7728de947bd86b35861cf57848d | [
"BSD-3-Clause"
] | 48 | 2015-01-22T19:57:49.000Z | 2022-03-27T14:27:53.000Z | # -*- coding: utf-8 -*-
from typing import (
Union,
Tuple,
Iterable,
List
)
import argparse
import inspect
import logging
import logging.handlers
import os
import platform
import string
import sys
from os import path
from traceback import extract_stack
from cadnano.cntypes import (
CNObjectT,
U... | 33.949749 | 113 | 0.638618 |
73468324513a3d109e386e99fffe8e64d112f329 | 1,110 | py | Python | setup.py | datasets-org/datasets-lib | 8b4ec0b0ee2ce8fc8f518599d4cd7ce72f0e0de7 | [
"MIT"
] | null | null | null | setup.py | datasets-org/datasets-lib | 8b4ec0b0ee2ce8fc8f518599d4cd7ce72f0e0de7 | [
"MIT"
] | null | null | null | setup.py | datasets-org/datasets-lib | 8b4ec0b0ee2ce8fc8f518599d4cd7ce72f0e0de7 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from setuptools import setup
setup(
name='datasets_lib',
version='1.2.3',
description='datasets library',
url='https://github.com/datasets-org/datasets-lib',
author='Vit Listik',
author_email='tivvit@seznam.cz',
license='MIT',
install_requires=[
"typing"... | 30 | 67 | 0.579279 |
7346b5853279a7de49fdb47687dc6f3bf1d3c4b4 | 3,564 | py | Python | Bots/Python/Skills/CodeFirst/CardSkillBot/app.py | harish0404/BotFramework-FunctionalTests | 42264bfa5128c6636761fa1273dffc058020bab2 | [
"MIT"
] | null | null | null | Bots/Python/Skills/CodeFirst/CardSkillBot/app.py | harish0404/BotFramework-FunctionalTests | 42264bfa5128c6636761fa1273dffc058020bab2 | [
"MIT"
] | null | null | null | Bots/Python/Skills/CodeFirst/CardSkillBot/app.py | harish0404/BotFramework-FunctionalTests | 42264bfa5128c6636761fa1273dffc058020bab2 | [
"MIT"
] | null | null | null | # Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.
import sys
import traceback
from datetime import datetime
from aiohttp import web
from aiohttp.web import Request, Response
from botbuilder.core import (
BotFrameworkAdapter,
BotFrameworkAdapterSettings,
Conversa... | 33.622642 | 112 | 0.731481 |
7346d1d7b5f455665cd05b1e1087b0f2cf9372f1 | 6,526 | py | Python | PlaqueGAN/metrics/metric_utils.py | ciaran-coleman/PlaqueGAN2 | 4c0c005be3d3879e5a27cb029f54845d89d7f1a6 | [
"MIT"
] | null | null | null | PlaqueGAN/metrics/metric_utils.py | ciaran-coleman/PlaqueGAN2 | 4c0c005be3d3879e5a27cb029f54845d89d7f1a6 | [
"MIT"
] | null | null | null | PlaqueGAN/metrics/metric_utils.py | ciaran-coleman/PlaqueGAN2 | 4c0c005be3d3879e5a27cb029f54845d89d7f1a6 | [
"MIT"
] | null | null | null | import torch
from torch.cuda import amp
import torch.nn as nn
import torch.nn.functional as F
import torchvision
from scipy.stats import truncnorm
import pandas as pd
import numpy as np
from tqdm import tqdm
import os
import copy
from torch.nn.functional import adaptive_avg_pool2d
from metrics.vgg... | 40.283951 | 121 | 0.633926 |
7346d9fd28f7e6eb34e2ef4ff4e43b7c81a4340f | 1,809 | py | Python | backend/api/python_http_client/test/test_pipeline_spec_runtime_config.py | Iuiu1234/pipelines | 1e032f550ce23cd40bfb6827b995248537b07d08 | [
"Apache-2.0"
] | 2,860 | 2018-05-24T04:55:01.000Z | 2022-03-31T13:49:56.000Z | backend/api/python_http_client/test/test_pipeline_spec_runtime_config.py | Iuiu1234/pipelines | 1e032f550ce23cd40bfb6827b995248537b07d08 | [
"Apache-2.0"
] | 7,331 | 2018-05-16T09:03:26.000Z | 2022-03-31T23:22:04.000Z | backend/api/python_http_client/test/test_pipeline_spec_runtime_config.py | Iuiu1234/pipelines | 1e032f550ce23cd40bfb6827b995248537b07d08 | [
"Apache-2.0"
] | 1,359 | 2018-05-15T11:05:41.000Z | 2022-03-31T09:42:09.000Z | # coding: utf-8
"""
Kubeflow Pipelines API
This file contains REST API specification for Kubeflow Pipelines. The file is autogenerated from the swagger definition.
Contact: kubeflow-pipelines@google.com
Generated by: https://openapi-generator.tech
"""
from __future__ import absolute_import
import ... | 30.661017 | 124 | 0.657822 |
734726c3d4e99bcfe01f2530123a169b4e05df2a | 15,887 | py | Python | intersight/apis/inventory_dn_mo_binding_api.py | gumpcraca/intersight-python | 780e6703c739f329084beacbbf2ad7a6a2e59b2b | [
"Apache-2.0"
] | null | null | null | intersight/apis/inventory_dn_mo_binding_api.py | gumpcraca/intersight-python | 780e6703c739f329084beacbbf2ad7a6a2e59b2b | [
"Apache-2.0"
] | null | null | null | intersight/apis/inventory_dn_mo_binding_api.py | gumpcraca/intersight-python | 780e6703c739f329084beacbbf2ad7a6a2e59b2b | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
"""
Intersight REST API
This is Intersight REST API
OpenAPI spec version: 1.0.9-255
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from __future__ import absolute_import
import sys
import os
import re
# python 2 and python 3 compatibility library
from s... | 56.137809 | 818 | 0.647825 |
73472b821837e4ec4e545ca51ce0732aabf0b4c1 | 2,567 | py | Python | pymanopt/manifolds/complexcircle.py | codedecde/EmbedMap | bd128c190f3e75146d2e85df05904aaa72117bb0 | [
"MIT"
] | null | null | null | pymanopt/manifolds/complexcircle.py | codedecde/EmbedMap | bd128c190f3e75146d2e85df05904aaa72117bb0 | [
"MIT"
] | null | null | null | pymanopt/manifolds/complexcircle.py | codedecde/EmbedMap | bd128c190f3e75146d2e85df05904aaa72117bb0 | [
"MIT"
] | 1 | 2018-07-01T07:45:53.000Z | 2018-07-01T07:45:53.000Z | from __future__ import division
import warnings
import numpy as np
import numpy.linalg as la
import numpy.random as rnd
from pymanopt.manifolds.manifold import Manifold
class ComplexCircle(Manifold):
"""
The manifold of complex numbers with unit-modulus.
Description of vectors z in C^n (complex) such ... | 25.67 | 76 | 0.572263 |
73473e2e72a68220aa9c886a56120d9340edf45c | 489 | py | Python | deploy.py | i2mint/dacc | 09f8048cf7ad5e21cb0b930ddad3e9ca79896974 | [
"MIT"
] | 5 | 2020-08-14T19:53:42.000Z | 2021-11-08T12:51:06.000Z | deploy.py | thorwhalen/equate | fb28d0d60f7c24e8ce972813d09bf52059576379 | [
"MIT"
] | 6 | 2020-06-14T20:19:19.000Z | 2022-01-28T23:16:37.000Z | deploy.py | thorwhalen/equate | fb28d0d60f7c24e8ce972813d09bf52059576379 | [
"MIT"
] | 1 | 2020-05-27T19:09:53.000Z | 2020-05-27T19:09:53.000Z | import subprocess
# # TODO: Both of these are python. Change to use python objects directly.
print('--------------------------- setup_output ---------------------------')
setup_output = subprocess.run('python setup.py sdist bdist_wheel'.split(' '))
# print(f"{setup_output}\n")
print('--------------------------- uploa... | 37.615385 | 78 | 0.562372 |
7347630f125f6c29cf128ac50b3d355d3c83b98c | 2,965 | py | Python | setup.py | saligrama/genienlp | 35659911883c43fdbe38c4391e75ca106763eb40 | [
"BSD-3-Clause"
] | null | null | null | setup.py | saligrama/genienlp | 35659911883c43fdbe38c4391e75ca106763eb40 | [
"BSD-3-Clause"
] | null | null | null | setup.py | saligrama/genienlp | 35659911883c43fdbe38c4391e75ca106763eb40 | [
"BSD-3-Clause"
] | null | null | null | # Copyright 2019 The Board of Trustees of the Leland Stanford Junior University
#
# Author: Giovanni Campagna <gcampagn@cs.stanford.edu>
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source co... | 39.013158 | 103 | 0.686341 |
7347a6b01fa3f6bc75c5e18f848286a18bff7f2a | 11,795 | py | Python | tests/reporting.py | JakubTesarek/dbgr | fc55cee5d5a69f3fa691579bc7d2627f51cbca03 | [
"Apache-2.0"
] | 8 | 2019-05-23T19:45:46.000Z | 2021-02-08T17:21:21.000Z | tests/reporting.py | JakubTesarek/dbgr | fc55cee5d5a69f3fa691579bc7d2627f51cbca03 | [
"Apache-2.0"
] | 86 | 2019-05-13T14:20:20.000Z | 2019-06-19T11:48:59.000Z | tests/reporting.py | JakubTesarek/dbgr | fc55cee5d5a69f3fa691579bc7d2627f51cbca03 | [
"Apache-2.0"
] | 1 | 2021-02-08T17:21:22.000Z | 2021-02-08T17:21:22.000Z | from dbgr import reporting
from dbgr.reporting import Reporter, ProgressBar, report_result
from dbgr.types import PrimitiveType
import pytest
from dbgr.results import Result
from tests.conftest import MockedResponse, AiohttpParams, escape_ansi, MockedTraceContext
import asyncio
import re
import aiohttp
import os
@pyt... | 27.818396 | 125 | 0.664773 |
7347b3210c29ba59b3484347bdc62af253da1fb4 | 1,877 | py | Python | Analytics/test_sendgrid_management.py | thanosbnt/SharingCitiesDashboard | 5d123691d1f25d0b85e20e4e8293266bf23c9f8a | [
"Apache-2.0"
] | 4 | 2018-11-21T14:42:18.000Z | 2020-05-11T10:52:59.000Z | Analytics/test_sendgrid_management.py | thanosbnt/SharingCitiesDashboard | 5d123691d1f25d0b85e20e4e8293266bf23c9f8a | [
"Apache-2.0"
] | 60 | 2018-11-21T15:11:59.000Z | 2019-12-02T10:46:44.000Z | Analytics/test_sendgrid_management.py | thanosbnt/SharingCitiesDashboard | 5d123691d1f25d0b85e20e4e8293266bf23c9f8a | [
"Apache-2.0"
] | 7 | 2018-11-21T14:42:44.000Z | 2019-11-28T16:24:14.000Z | import unittest
from app import create_app
from models.users import Users
class SendgridManagementTestCase(unittest.TestCase):
"""
Test whether the validity of the current Sendgrid API key can be tested
"""
def setUp(self):
""" Create testing client version of flask app """
self.tes... | 34.127273 | 77 | 0.617475 |
7347bf7a21283646208dc2d1763c7e05ff9093ba | 6,633 | py | Python | myia/validate.py | strint/myia | 3d00d3fb3df80ab7a264a724226c5f56c6ff1a8a | [
"MIT"
] | 222 | 2019-02-13T07:56:28.000Z | 2022-03-28T07:07:54.000Z | myia/validate.py | strint/myia | 3d00d3fb3df80ab7a264a724226c5f56c6ff1a8a | [
"MIT"
] | 107 | 2019-02-12T21:56:39.000Z | 2022-03-12T01:08:03.000Z | myia/validate.py | strint/myia | 3d00d3fb3df80ab7a264a724226c5f56c6ff1a8a | [
"MIT"
] | 27 | 2017-11-14T17:58:15.000Z | 2019-01-14T01:36:09.000Z | """Validate that a graph has been cleaned up and is ready for optimization."""
from types import SimpleNamespace
from ovld import ovld
from . import xtype
from .abstract import (
ANYTHING,
DEAD,
POLY,
AbstractArray,
AbstractClass,
AbstractError,
AbstractExternal,
AbstractFunction,
... | 28.965066 | 79 | 0.615559 |
7347c8a8b10401f34f3a7b1aed85522b96951023 | 1,347 | py | Python | ascii_art/__main__.py | dawsonbooth/ascii-art | 2350696f1a9a2446d3cef4261edb656dc9e0e465 | [
"MIT"
] | 25 | 2020-11-18T16:30:19.000Z | 2022-03-12T03:54:05.000Z | ascii_art/__main__.py | dawsonbooth/ascii-art | 2350696f1a9a2446d3cef4261edb656dc9e0e465 | [
"MIT"
] | 3 | 2020-08-28T09:59:43.000Z | 2020-12-20T05:58:38.000Z | ascii_art/__main__.py | dawsonbooth/ascii-art | 2350696f1a9a2446d3cef4261edb656dc9e0e465 | [
"MIT"
] | 9 | 2020-10-15T17:38:06.000Z | 2021-12-25T22:52:53.000Z | import argparse
from PIL import Image
from . import image_to_ascii
def main() -> int:
"""ASCII art generator with multiple customization parameters"""
parser = argparse.ArgumentParser(description="Convert your favorite image into ASCII art")
parser.add_argument("input", type=str, help="Path to image fro... | 35.447368 | 118 | 0.701559 |
73480648726e998a1ea01919e81282800e961ad2 | 1,100 | py | Python | medium/Word Search/solution.py | ashutosh1919/leetcode-problems | 65f99a3694549af88c7702b598de1a8ccb7db5fb | [
"MIT"
] | 8 | 2021-08-21T19:10:04.000Z | 2022-03-11T14:30:02.000Z | medium/Word Search/solution.py | ashutosh1919/leetcode-problems | 65f99a3694549af88c7702b598de1a8ccb7db5fb | [
"MIT"
] | null | null | null | medium/Word Search/solution.py | ashutosh1919/leetcode-problems | 65f99a3694549af88c7702b598de1a8ccb7db5fb | [
"MIT"
] | 1 | 2021-08-24T06:29:02.000Z | 2021-08-24T06:29:02.000Z | # Time complexity: O(m*n)
# Approach: DFS traversal from each cell.
class Solution:
def dfs(self, board, visited, row, col, word, index):
m, n = len(board), len(board[0])
if index == len(word):
return True
if board[row][col]!=word[index]:
return False
if ind... | 35.483871 | 109 | 0.489091 |
73480ac6ed165d09a4c60de36d8c412ad2b9c627 | 9,782 | py | Python | src/py42/services/orgs.py | ryanvanasse/py42 | 4664c45d41c32f48323b552b7b11f885c055bff3 | [
"MIT"
] | null | null | null | src/py42/services/orgs.py | ryanvanasse/py42 | 4664c45d41c32f48323b552b7b11f885c055bff3 | [
"MIT"
] | null | null | null | src/py42/services/orgs.py | ryanvanasse/py42 | 4664c45d41c32f48323b552b7b11f885c055bff3 | [
"MIT"
] | null | null | null | from collections import namedtuple
from py42 import settings
from py42.clients.settings.org_settings import OrgSettings
from py42.exceptions import Py42Error
from py42.services import BaseService
from py42.services.util import get_all_pages
OrgSettingsResponse = namedtuple(
u"OrgSettingsResponse", [u"error", u"or... | 39.603239 | 147 | 0.634226 |
734853d7540b4728dc5718ed2ec4101edb1a132f | 1,242 | py | Python | contrib/packs/actions/pack_mgmt/info.py | UbuntuEvangelist/st2 | 36af04f2caa03b396fb8ab00fd6d700e827fda8d | [
"Apache-2.0"
] | 1 | 2020-11-21T10:11:25.000Z | 2020-11-21T10:11:25.000Z | contrib/packs/actions/pack_mgmt/info.py | UbuntuEvangelist/st2 | 36af04f2caa03b396fb8ab00fd6d700e827fda8d | [
"Apache-2.0"
] | 1 | 2015-06-08T15:27:11.000Z | 2015-06-08T15:27:11.000Z | contrib/packs/actions/pack_mgmt/info.py | UbuntuEvangelist/st2 | 36af04f2caa03b396fb8ab00fd6d700e827fda8d | [
"Apache-2.0"
] | 13 | 2017-01-12T11:07:20.000Z | 2019-04-19T09:55:49.000Z | # Licensed to the StackStorm, Inc ('StackStorm') under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use th... | 38.8125 | 74 | 0.719807 |
73486ee07738c7612bf80a4fd84a2681c8bf7152 | 12,364 | py | Python | Barbican/Server/barbican-stable-mitaka/barbican/functionaltests/api/v1/functional/test_secrets_rbac.py | cloud-security-research/sgx-kms | 2f07bf36721dafe0e4a000ca3f41529dc8d2004a | [
"Apache-2.0"
] | 36 | 2017-11-08T23:36:35.000Z | 2022-03-20T16:01:55.000Z | Barbican/Server/barbican-stable-mitaka/barbican/functionaltests/api/v1/functional/test_secrets_rbac.py | Calctopia-OpenSource/sgx-kms | 2f07bf36721dafe0e4a000ca3f41529dc8d2004a | [
"Apache-2.0"
] | 2 | 2017-11-17T03:19:17.000Z | 2018-07-04T03:37:36.000Z | Barbican/Server/barbican-stable-mitaka/barbican/functionaltests/api/v1/functional/test_secrets_rbac.py | Calctopia-OpenSource/sgx-kms | 2f07bf36721dafe0e4a000ca3f41529dc8d2004a | [
"Apache-2.0"
] | 12 | 2017-11-13T03:20:40.000Z | 2021-07-16T03:26:41.000Z | # Copyright (c) 2015 Cisco Systems
#
# 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 writ... | 40.273616 | 77 | 0.666532 |
734870a3266f471e107e8c70de975b38cf0b69bf | 3,126 | py | Python | external/sbml/bindings/python/test/sbml/TestInitialAssignment_newSetters.py | dchandran/evolvenetworks | 072f9e1292552f691a86457ffd16a5743724fb5e | [
"BSD-3-Clause"
] | 1 | 2019-08-22T17:17:41.000Z | 2019-08-22T17:17:41.000Z | external/sbml/bindings/python/test/sbml/TestInitialAssignment_newSetters.py | dchandran/evolvenetworks | 072f9e1292552f691a86457ffd16a5743724fb5e | [
"BSD-3-Clause"
] | null | null | null | external/sbml/bindings/python/test/sbml/TestInitialAssignment_newSetters.py | dchandran/evolvenetworks | 072f9e1292552f691a86457ffd16a5743724fb5e | [
"BSD-3-Clause"
] | null | null | null | #
# @file TestInitialAssignment_newSetters.py
# @brief InitialAssignment unit tests for new set function API
#
# @author Akiya Jouraku (Python conversion)
# @author Sarah Keating
#
# $Id$
# $HeadURL$
#
# This test file was converted from src/sbml/test/TestInitialAssignment_newSetters.c
# with the help of conv... | 32.5625 | 84 | 0.669866 |
7348752b0daaff2084f020ebc87990b46e70d2b4 | 4,756 | py | Python | src/pyprocessing/fonts.py | agarwalnaimish/pyprocessing | 46695c379c95a7b874f76257c37f44f4b59d39e9 | [
"MIT"
] | 3 | 2018-04-23T17:33:02.000Z | 2021-01-05T04:52:36.000Z | src/pyprocessing/fonts.py | agarwalnaimish/pyprocessing | 46695c379c95a7b874f76257c37f44f4b59d39e9 | [
"MIT"
] | 1 | 2018-04-23T17:37:37.000Z | 2018-04-23T17:37:37.000Z | src/pyprocessing/fonts.py | agarwalnaimish/pyprocessing | 46695c379c95a7b874f76257c37f44f4b59d39e9 | [
"MIT"
] | 2 | 2019-01-16T06:34:52.000Z | 2019-10-15T14:03:07.000Z | # ************************
# FONT/TEXT STUFF
# ************************
import pyglet
from pyglet.gl import *
from .globs import *
from .constants import *
from . import config
__all__ = ['textAlign', 'createFont', 'textFont', 'htmlText', 'text',
'textSize', 'textWidth', 'textAscent', 'textDescent']
de... | 32.575342 | 76 | 0.530698 |
7348d55faf111346a0c061a0042e018093f8d155 | 6,661 | py | Python | webapp/flask-react-auth/services/users/src/tests/test_users.py | zeroam/build-your-own-x | e7932cd25145aa3c347511db6846b1242dbb30eb | [
"MIT"
] | null | null | null | webapp/flask-react-auth/services/users/src/tests/test_users.py | zeroam/build-your-own-x | e7932cd25145aa3c347511db6846b1242dbb30eb | [
"MIT"
] | 5 | 2021-04-08T21:59:04.000Z | 2022-02-10T14:19:59.000Z | webapp/flask-react-auth/services/users/src/tests/test_users.py | zeroam/build-your-own-x | e7932cd25145aa3c347511db6846b1242dbb30eb | [
"MIT"
] | null | null | null | import json
import pytest
from src.api.users.models import User
def test_add_user(test_app, test_database):
client = test_app.test_client()
resp = client.post(
"/users",
data=json.dumps(
{
"username": "michael",
"email": "michael@testdriven.io",
... | 32.024038 | 88 | 0.628284 |
73490d8959b2a3b9632dab080f73340cd7e200e1 | 185 | py | Python | tests/datasets/test_video_download.py | rtoengi/transfer-learning-for-sign-language-recognition | e0627115e6b68d6b85244d484011bb3895ccf4ee | [
"MIT"
] | 1 | 2021-09-25T14:11:22.000Z | 2021-09-25T14:11:22.000Z | tests/datasets/test_video_download.py | rtoengi/transfer-learning-for-sign-language-recognition | e0627115e6b68d6b85244d484011bb3895ccf4ee | [
"MIT"
] | null | null | null | tests/datasets/test_video_download.py | rtoengi/transfer-learning-for-sign-language-recognition | e0627115e6b68d6b85244d484011bb3895ccf4ee | [
"MIT"
] | 4 | 2021-04-10T01:33:03.000Z | 2021-11-11T06:58:59.000Z | from datasets.msasl.video_download import _extract_video_id
def test__extract_video_id():
assert _extract_video_id('https://www.youtube.com/watch?v=S2cqitZ0qes') == 'S2cqitZ0qes'
| 30.833333 | 92 | 0.8 |
73490deaa5b5d8a9ce076156ec77a94e0344f7ce | 901 | py | Python | tests/test_docs/test_bash_yaml/md_files/__init__.py | valory-xyz/agents-aea | 8f38efa96041b0156ed1ae328178e395dbabf2fc | [
"Apache-2.0"
] | 28 | 2021-10-31T18:54:14.000Z | 2022-03-17T13:10:43.000Z | tests/test_docs/test_bash_yaml/md_files/__init__.py | valory-xyz/agents-aea | 8f38efa96041b0156ed1ae328178e395dbabf2fc | [
"Apache-2.0"
] | 66 | 2021-10-31T11:55:48.000Z | 2022-03-31T06:26:23.000Z | tests/test_docs/test_bash_yaml/md_files/__init__.py | valory-xyz/agents-aea | 8f38efa96041b0156ed1ae328178e395dbabf2fc | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# ------------------------------------------------------------------------------
#
# Copyright 2022 Valory AG
# Copyright 2018-2020 Fetch.AI Limited
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# ... | 40.954545 | 80 | 0.592675 |
734915a0d773f26b0f5228d619a119ac6f5c9a85 | 659 | py | Python | xiao_asgi/__init__.py | jonathanstaniforth/xiao-asgi | 9a1c2b59d034a242574736a2a8130804bb799049 | [
"MIT"
] | null | null | null | xiao_asgi/__init__.py | jonathanstaniforth/xiao-asgi | 9a1c2b59d034a242574736a2a8130804bb799049 | [
"MIT"
] | 17 | 2021-11-10T12:08:29.000Z | 2021-12-04T18:34:04.000Z | xiao_asgi/__init__.py | jonathanstaniforth/xiao-asgi | 9a1c2b59d034a242574736a2a8130804bb799049 | [
"MIT"
] | null | null | null | """xiao asgi is a small ASGI framework for creating ASGI applications.
Contained in the package are modules that handle receiving requests, routing
requests to an endpoint and sending responses.
Modules:
applications: receives the initial request and passing it
to the appropriate route.
connections: h... | 38.764706 | 78 | 0.76176 |
73491d2d19f842cc19b3f3e535426e24c1450789 | 9,313 | py | Python | src/sage/schemes/toric/sheaf/constructor.py | saraedum/sage-renamed | d2da67b14da2ad766a5906425d60d43a3b3e1270 | [
"BSL-1.0"
] | null | null | null | src/sage/schemes/toric/sheaf/constructor.py | saraedum/sage-renamed | d2da67b14da2ad766a5906425d60d43a3b3e1270 | [
"BSL-1.0"
] | null | null | null | src/sage/schemes/toric/sheaf/constructor.py | saraedum/sage-renamed | d2da67b14da2ad766a5906425d60d43a3b3e1270 | [
"BSL-1.0"
] | null | null | null | r"""
Construct sheaves on toric varieties
A toric vector bundle (on a toric variety) is a vector bundle that is
equivariant with respect to the algebraic torus action.
"""
from __future__ import absolute_import
#*****************************************************************************
# Copyright (C) 2013 ... | 28.832817 | 89 | 0.58574 |
73492d6fe68967a631149284bfc779e2282988c9 | 9,213 | py | Python | plugin/core/transports.py | mrbrian/LSP | 72ea25a57fe31eed1466a610ac59be9cac105793 | [
"MIT"
] | null | null | null | plugin/core/transports.py | mrbrian/LSP | 72ea25a57fe31eed1466a610ac59be9cac105793 | [
"MIT"
] | null | null | null | plugin/core/transports.py | mrbrian/LSP | 72ea25a57fe31eed1466a610ac59be9cac105793 | [
"MIT"
] | null | null | null | from abc import ABCMeta, abstractmethod
import threading
import time
import socket
from queue import Queue
import subprocess
from .logging import exception_log, debug
try:
from typing import Callable, Dict, Any, Optional, IO
assert Callable and Dict and Any and Optional and subprocess and IO
except ImportError... | 35.298851 | 119 | 0.564854 |
734949fad70e74bd3904b5f20090f8d1caa7df0b | 113 | py | Python | django_sass_compiler/apps.py | dmitriykhalturin/django-sass-compiler | bb932c3a551c7c91eda985c73d1372280858bbb6 | [
"BSD-3-Clause"
] | 1 | 2020-05-15T14:06:01.000Z | 2020-05-15T14:06:01.000Z | django_sass_compiler/apps.py | dmitriykhalturin/django-sass-compiler | bb932c3a551c7c91eda985c73d1372280858bbb6 | [
"BSD-3-Clause"
] | null | null | null | django_sass_compiler/apps.py | dmitriykhalturin/django-sass-compiler | bb932c3a551c7c91eda985c73d1372280858bbb6 | [
"BSD-3-Clause"
] | 1 | 2020-07-21T21:04:24.000Z | 2020-07-21T21:04:24.000Z | from django.apps import AppConfig
class DjangoSassCompilerConfig(AppConfig):
name = 'django_sass_compiler'
| 18.833333 | 42 | 0.80531 |
73496c8c2e5c44cc2fdf474b89a0496c0e740f04 | 1,441 | py | Python | NAIP/metadata.py | monocilindro/qgis-earthengine-examples | 82aea8926d34ed3f4ad4a4a345ddbd225819d28f | [
"MIT"
] | 646 | 2019-12-03T06:09:03.000Z | 2022-03-28T03:37:08.000Z | NAIP/metadata.py | csaybar/qgis-earthengine-examples | ba8942683834d2847ff3246bdd1859b36e50fe44 | [
"MIT"
] | 10 | 2019-12-30T03:42:44.000Z | 2021-05-22T07:34:07.000Z | NAIP/metadata.py | csaybar/qgis-earthengine-examples | ba8942683834d2847ff3246bdd1859b36e50fe44 | [
"MIT"
] | 219 | 2019-12-06T02:20:53.000Z | 2022-03-30T15:14:27.000Z | import ee
from ee_plugin import Map
# fc = (ee.FeatureCollection('ft:1fRY18cjsHzDgGiJiS2nnpUU3v9JPDc2HNaR7Xk8')
# .filter(ee.Filter().eq('Name', 'Minnesota')))
def print_image_id(image):
index = image.get('system:time_start')
print(index.getInfo())
lat = 46.80514
lng = -99.22023
lng_lat = ee.Geometr... | 23.241935 | 75 | 0.705066 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.