hexsha stringlengths 40 40 | size int64 2 1.02M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 245 | max_stars_repo_name stringlengths 6 130 | max_stars_repo_head_hexsha stringlengths 40 40 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 245 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 245 | max_forks_repo_name stringlengths 6 130 | max_forks_repo_head_hexsha stringlengths 40 40 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 2 1.02M | avg_line_length float64 1 958k | max_line_length int64 1 987k | alphanum_fraction float64 0 1 | content_no_comment stringlengths 0 1.01M | is_comment_constant_removed bool 2
classes | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1c2e157292b3ec5293e01f313fef45c0f7400d12 | 5,989 | py | Python | tensorflow/python/distribute/cross_device_utils_test.py | uve/tensorflow | e08079463bf43e5963acc41da1f57e95603f8080 | [
"Apache-2.0"
] | null | null | null | tensorflow/python/distribute/cross_device_utils_test.py | uve/tensorflow | e08079463bf43e5963acc41da1f57e95603f8080 | [
"Apache-2.0"
] | null | null | null | tensorflow/python/distribute/cross_device_utils_test.py | uve/tensorflow | e08079463bf43e5963acc41da1f57e95603f8080 | [
"Apache-2.0"
] | null | null | null | # Copyright 2018 The TensorFlow 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... | 41.881119 | 81 | 0.68008 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from absl.testing import parameterized
from tensorflow.python.distribute import combinations
from tensorflow.python.distribute import cross_device_utils
from tensorflow.python.distribut... | true | true |
1c2e15f2b3b1565a30f03c85e3501e602cd8a15e | 113 | py | Python | core/__init__.py | luckylwk/neural-network-theano | 420c89e7028fcd9671866918c22a837d04387012 | [
"MIT"
] | null | null | null | core/__init__.py | luckylwk/neural-network-theano | 420c89e7028fcd9671866918c22a837d04387012 | [
"MIT"
] | null | null | null | core/__init__.py | luckylwk/neural-network-theano | 420c89e7028fcd9671866918c22a837d04387012 | [
"MIT"
] | null | null | null | from .datasets import *
from .layers import *
from .models import *
#from .trainers import *
from .utils import * | 22.6 | 24 | 0.734513 | from .datasets import *
from .layers import *
from .models import *
from .utils import * | true | true |
1c2e1629fe3fa776921a9c5d7b007b9b903c32cf | 761 | py | Python | test/log/test_LogLevelConverter.py | pip-services-python/pip-services-components-python | 428ec7a9f0f0bdfa4d39cecb2541e87b1e5d33e0 | [
"MIT"
] | null | null | null | test/log/test_LogLevelConverter.py | pip-services-python/pip-services-components-python | 428ec7a9f0f0bdfa4d39cecb2541e87b1e5d33e0 | [
"MIT"
] | null | null | null | test/log/test_LogLevelConverter.py | pip-services-python/pip-services-components-python | 428ec7a9f0f0bdfa4d39cecb2541e87b1e5d33e0 | [
"MIT"
] | 1 | 2020-03-11T21:46:42.000Z | 2020-03-11T21:46:42.000Z | # -*- coding: utf-8 -*-
"""
tests.log.test_LogLevelConverter
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:copyright: (c) Conceptual Vision Consulting LLC 2015-2016, see AUTHORS for more details.
:license: MIT, see LICENSE for more details.
"""
from pip_services3_components.log import LogLevel
from pip_servi... | 30.44 | 93 | 0.69251 |
from pip_services3_components.log import LogLevel
from pip_services3_components.log import LogLevelConverter
class TestLogLevel:
def test_to_log_level(self):
assert LogLevelConverter.to_log_level("1") == LogLevel.Fatal
assert LogLevelConverter.to_log_level("fatal") == LogLevel.Fatal
def te... | true | true |
1c2e1675329e828da8d7efd98263b261a253de83 | 11,417 | py | Python | one/util.py | OpenNebula/addon-linstor | 71cc6d5d625929f0350cec866ff07e953fcebe12 | [
"Apache-2.0"
] | 11 | 2018-10-18T19:53:52.000Z | 2021-11-08T11:42:56.000Z | one/util.py | OpenNebula/addon-linstor | 71cc6d5d625929f0350cec866ff07e953fcebe12 | [
"Apache-2.0"
] | 13 | 2018-11-26T16:15:35.000Z | 2021-08-02T18:24:14.000Z | one/util.py | OpenNebula/addon-linstor | 71cc6d5d625929f0350cec866ff07e953fcebe12 | [
"Apache-2.0"
] | 7 | 2018-11-08T03:44:59.000Z | 2021-05-16T20:47:19.000Z | # -*- coding: utf-8 -*-
"""
OpenNebula Driver for Linstor
Copyright 2018 LINBIT USA 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... | 29.57772 | 117 | 0.666287 |
from __future__ import print_function
import sys
import os
import subprocess
import syslog
import traceback
import json
import re
REMOTES_DIR = "/var/lib/one/remotes/"
ONE_LOCATION = os.getenv("ONE_LOCATION")
if ONE_LOCATION:
REMOTES_DIR = os.path.join(ONE_LOCATION, "var/remotes")
SCRIPTS_COMMON = REMOTES_DIR... | true | true |
1c2e16a41b14402840f19096fafcac8f8c1402b8 | 6,926 | py | Python | src/sardana/sardanabase.py | schooft/sardana | 76287b416650f40da79871ee3849340d0ff31f1d | [
"CC-BY-3.0"
] | null | null | null | src/sardana/sardanabase.py | schooft/sardana | 76287b416650f40da79871ee3849340d0ff31f1d | [
"CC-BY-3.0"
] | null | null | null | src/sardana/sardanabase.py | schooft/sardana | 76287b416650f40da79871ee3849340d0ff31f1d | [
"CC-BY-3.0"
] | null | null | null | #!/usr/bin/env python
##############################################################################
##
# This file is part of Sardana
##
# http://www.sardana-controls.org/
##
# Copyright 2011 CELLS / ALBA Synchrotron, Bellaterra, Spain
##
# Sardana is free software: you can redistribute it and/or modify
# it under th... | 32.669811 | 85 | 0.618539 | true | true | |
1c2e16a8640c5d8ca1be6a0c510284f122c75808 | 1,549 | py | Python | local-tests/run_nodes.py | kumandra/kumandra-node | eceacafde002f8a14dedfdc2ab953b213b8fb699 | [
"Apache-2.0"
] | null | null | null | local-tests/run_nodes.py | kumandra/kumandra-node | eceacafde002f8a14dedfdc2ab953b213b8fb699 | [
"Apache-2.0"
] | 8 | 2022-03-21T04:41:05.000Z | 2022-03-21T06:36:19.000Z | local-tests/run_nodes.py | kumandra/kumandra-node | eceacafde002f8a14dedfdc2ab953b213b8fb699 | [
"Apache-2.0"
] | null | null | null | #!/bin/env python
# Short script demonstrating the basic usage of `chainrunner` package.
# Reproduces (more or less) the behavior of `run_nodes.sh`.
# For running local experiments it's much more convenient to manage the chain
# using an interactive environment (Python console, Jupyter notebook etc.)
from time import... | 29.226415 | 99 | 0.647515 |
# using an interactive environment (Python console, Jupyter notebook etc.)
from time import sleep
from chainrunner import Chain, Seq, generate_keys, check_finalized
nodes = 4
workdir = '.'
binary = '../target/release/kumandra-node'
port = 30334
ws_port = 9944
rpc_port = 9933
phrases = ['//Alice', '//Bob', '//C... | true | true |
1c2e17c4bf587013e11f885311464167a66ecff8 | 23,032 | py | Python | Server/Python/tests/dbsserver_t/utils/DBSDataProvider.py | vkuznet/DBS | 14df8bbe8ee8f874fe423399b18afef911fe78c7 | [
"Apache-2.0"
] | 8 | 2015-08-14T04:01:32.000Z | 2021-06-03T00:56:42.000Z | Server/Python/tests/dbsserver_t/utils/DBSDataProvider.py | yuyiguo/DBS | 14df8bbe8ee8f874fe423399b18afef911fe78c7 | [
"Apache-2.0"
] | 162 | 2015-01-07T21:34:47.000Z | 2021-10-13T09:42:41.000Z | Server/Python/tests/dbsserver_t/utils/DBSDataProvider.py | yuyiguo/DBS | 14df8bbe8ee8f874fe423399b18afef911fe78c7 | [
"Apache-2.0"
] | 16 | 2015-01-22T15:27:29.000Z | 2021-04-28T09:23:28.000Z | """
Class to provide data for unit- and integration tests
"""
from itertools import izip
from collections import defaultdict
import cPickle as pickle
import getpass
import os.path
import uuid
import time
import os
import random
def create_dbs_data_provider(data_type='persistent',data_location=None):
data_types = {... | 39.986111 | 138 | 0.622308 | from itertools import izip
from collections import defaultdict
import cPickle as pickle
import getpass
import os.path
import uuid
import time
import os
import random
def create_dbs_data_provider(data_type='persistent',data_location=None):
data_types = {'persistent' : DBSDataProvider(DBSPersistentData()),
... | true | true |
1c2e18717f79affbbd5759b5c38a77e944e4f5e5 | 16,165 | py | Python | sdk/python/pulumi_azure_nextgen/network/v20200401/subnet.py | pulumi/pulumi-azure-nextgen | 452736b0a1cf584c2d4c04666e017af6e9b2c15c | [
"Apache-2.0"
] | 31 | 2020-09-21T09:41:01.000Z | 2021-02-26T13:21:59.000Z | sdk/python/pulumi_azure_nextgen/network/v20200401/subnet.py | pulumi/pulumi-azure-nextgen | 452736b0a1cf584c2d4c04666e017af6e9b2c15c | [
"Apache-2.0"
] | 231 | 2020-09-21T09:38:45.000Z | 2021-03-01T11:16:03.000Z | sdk/python/pulumi_azure_nextgen/network/v20200401/subnet.py | pulumi/pulumi-azure-nextgen | 452736b0a1cf584c2d4c04666e017af6e9b2c15c | [
"Apache-2.0"
] | 4 | 2020-09-29T14:14:59.000Z | 2021-02-10T20:38:16.000Z | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union
from ... import _utilities, _tables
from... | 54.063545 | 2,279 | 0.691432 |
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union
from ... import _utilities, _tables
from . import outputs
from ._enums import *
from ._inputs import *
__all__ = ['Subnet']
class Subnet(pulumi.CustomResource):
def __init__(__self__,
... | true | true |
1c2e18e9cbd368c6827997206237fb7931ec5395 | 12,886 | py | Python | nemo/collections/asr/parts/submodules/multi_head_attention.py | hamjam/NeMo | b3484d32e1317666151f931bfa39867d88ed8658 | [
"Apache-2.0"
] | 1 | 2022-03-08T02:48:44.000Z | 2022-03-08T02:48:44.000Z | nemo/collections/asr/parts/submodules/multi_head_attention.py | hamjam/NeMo | b3484d32e1317666151f931bfa39867d88ed8658 | [
"Apache-2.0"
] | 1 | 2022-03-06T14:09:02.000Z | 2022-03-06T14:09:02.000Z | nemo/collections/asr/parts/submodules/multi_head_attention.py | hamjam/NeMo | b3484d32e1317666151f931bfa39867d88ed8658 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... | 41.169329 | 118 | 0.621527 |
import math
import torch
import torch.nn as nn
__all__ = [
'RelPositionMultiHeadAttention',
'RelPositionalEncoding',
'PositionalEncoding',
]
class MultiHeadAttention(nn.Module):
def __init__(self, n_head, n_feat, dropout_rate):
super(MultiHeadAttention, self).... | true | true |
1c2e1cd8e3fac74e232aa6bb8af903e8e59a0397 | 7,768 | py | Python | examples/mujoco/train_ppo_batch_gym.py | cnheider/chainerrl | 018a29132d77e5af0f92161250c72aba10c6ce29 | [
"MIT"
] | 923 | 2017-06-01T08:27:42.000Z | 2022-03-24T02:17:04.000Z | examples/mujoco/train_ppo_batch_gym.py | hardmaru/chainerrl | 018a29132d77e5af0f92161250c72aba10c6ce29 | [
"MIT"
] | 374 | 2017-06-02T02:07:50.000Z | 2021-06-29T22:05:38.000Z | examples/mujoco/train_ppo_batch_gym.py | hardmaru/chainerrl | 018a29132d77e5af0f92161250c72aba10c6ce29 | [
"MIT"
] | 253 | 2017-06-04T10:31:50.000Z | 2022-03-19T15:20:51.000Z | """An example of training PPO against OpenAI Gym Envs.
This script is an example of training a PPO agent against OpenAI Gym envs.
Both discrete and continuous action spaces are supported.
To solve CartPole-v0, run:
python train_ppo_gym.py --env CartPole-v0
"""
import argparse
import functools
import chainer
from... | 37.892683 | 91 | 0.644954 | import argparse
import functools
import chainer
from chainer import functions as F
from chainer import links as L
import gym
import gym.spaces
import numpy as np
import chainerrl
from chainerrl.agents import PPO
from chainerrl import experiments
from chainerrl import misc
from chainerrl.optimizers.nonbias_weight_deca... | true | true |
1c2e1d04399dd2ab41dcc73c61b9cb123cf6a55d | 11,815 | py | Python | hw0_release/.env/lib/python3.7/site-packages/skimage/data/__init__.py | Renhy/CS131_release | 23b92d04c4cbb122da18dc929199d3d06fb0251f | [
"MIT"
] | 1 | 2019-01-12T13:17:32.000Z | 2019-01-12T13:17:32.000Z | rcnn/lib/python3.6/site-packages/skimage/data/__init__.py | dreamingweaver/making_passportImage | 68f23411780ff82abe934dfae5fc04acb80f2c49 | [
"MIT"
] | null | null | null | rcnn/lib/python3.6/site-packages/skimage/data/__init__.py | dreamingweaver/making_passportImage | 68f23411780ff82abe934dfae5fc04acb80f2c49 | [
"MIT"
] | null | null | null | # coding: utf-8
"""Standard test images.
For more images, see
- http://sipi.usc.edu/database/database.php
"""
import os as _os
import numpy as _np
from .. import data_dir
from ..io import imread, use_plugin
from .._shared._warnings import expected_warnings, warn
from .. import img_as_bool
from ._binary_blobs im... | 27.412993 | 104 | 0.65019 |
import os as _os
import numpy as _np
from .. import data_dir
from ..io import imread, use_plugin
from .._shared._warnings import expected_warnings, warn
from .. import img_as_bool
from ._binary_blobs import binary_blobs
__all__ = ['load',
'astronaut',
'binary_blobs',
'camera',
... | true | true |
1c2e1deaf306e0ed002b9293002fa360230bcd40 | 418 | py | Python | exercise8.py | iansantana00/Python-Course | 43852aa64c93099342ab4765b0fe8729a959449e | [
"MIT"
] | 2 | 2022-01-13T15:55:58.000Z | 2022-02-11T23:18:34.000Z | exercise8.py | iansantana00/Python-Course | 43852aa64c93099342ab4765b0fe8729a959449e | [
"MIT"
] | null | null | null | exercise8.py | iansantana00/Python-Course | 43852aa64c93099342ab4765b0fe8729a959449e | [
"MIT"
] | null | null | null | # -*- Coding: utf-8 -*-
print("VERIFICADOR DE CONSUMO")
print("-----------------------")
d = float(input("Distância percorrida pelo carro em km: "))
v = float(input("Quantidade de gasolina consumida em l: "))
c = d/v
if c < 8:
print(f"Consumo de {c}km/l, VENDA O CARRO!")
elif c > 8 and c < 14:
p... | 27.866667 | 60 | 0.574163 |
print("VERIFICADOR DE CONSUMO")
print("-----------------------")
d = float(input("Distância percorrida pelo carro em km: "))
v = float(input("Quantidade de gasolina consumida em l: "))
c = d/v
if c < 8:
print(f"Consumo de {c}km/l, VENDA O CARRO!")
elif c > 8 and c < 14:
print(f"Consumo de {c}km/l... | true | true |
1c2e1e065a6bb1b61bcba4f5de7902153878b816 | 502 | py | Python | app/auth/__init__.py | muli3203/blogting | 9fc048b7cf42fa7751de34317dc186909a9fa8c9 | [
"MIT"
] | null | null | null | app/auth/__init__.py | muli3203/blogting | 9fc048b7cf42fa7751de34317dc186909a9fa8c9 | [
"MIT"
] | null | null | null | app/auth/__init__.py | muli3203/blogting | 9fc048b7cf42fa7751de34317dc186909a9fa8c9 | [
"MIT"
] | 1 | 2020-02-21T13:22:36.000Z | 2020-02-21T13:22:36.000Z | # from flask_mail import Message
# from flask import render_template
# from . import mail
# def mail_message(subject,template,to,**kwargs):
# sender_email = "moringademo@gmail.com"
# email = Message(subject, sender= sender_email, recipients=[to])
# email.body = render_template(template + ".txt",**kwar... | 31.375 | 69 | 0.705179 |
from flask import Blueprint
auth = Blueprint('auth', __name__)
from . import views, forms | true | true |
1c2e1ea426c69378e7820b30572031dd68c0043c | 3,285 | py | Python | iteration2/ZoomPollViewer/Poll.py | a-haruntokyer/Zoom-Poll-Data-Match | ac46cfadbb743f34411b530ce4f5bd464362e622 | [
"MIT"
] | null | null | null | iteration2/ZoomPollViewer/Poll.py | a-haruntokyer/Zoom-Poll-Data-Match | ac46cfadbb743f34411b530ce4f5bd464362e622 | [
"MIT"
] | null | null | null | iteration2/ZoomPollViewer/Poll.py | a-haruntokyer/Zoom-Poll-Data-Match | ac46cfadbb743f34411b530ce4f5bd464362e622 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
"""
ZOOM POLL VIEWER v0.1
POLL CLASS
11 Function
3 Object
"""
from .Question import Question
class Poll:
def __init__(self, zpv, poll_name, poll_type="QUIZ"):
self.zpv = zpv
self._name = poll_name
self._type = poll_type
self._questions = []
self._... | 29.863636 | 102 | 0.625266 |
from .Question import Question
class Poll:
def __init__(self, zpv, poll_name, poll_type="QUIZ"):
self.zpv = zpv
self._name = poll_name
self._type = poll_type
self._questions = []
self._number_of_questions = None
self._session_grades = {}
self._number_of_... | true | true |
1c2e1ebe11f2d9f090f081f98954d52c29c6346a | 13,914 | py | Python | awacs/ec2.py | chizou/awacs | 335c545d13ea22488b318245af891eb427c139db | [
"BSD-2-Clause"
] | null | null | null | awacs/ec2.py | chizou/awacs | 335c545d13ea22488b318245af891eb427c139db | [
"BSD-2-Clause"
] | null | null | null | awacs/ec2.py | chizou/awacs | 335c545d13ea22488b318245af891eb427c139db | [
"BSD-2-Clause"
] | null | null | null | # Copyright (c) 2012-2013, Mark Peek <mark@peek.org>
# All rights reserved.
#
# See LICENSE file for full license.
from aws import Action as BaseAction
from aws import BaseARN
service_name = 'Amazon EC2 Spot Fleet'
prefix = 'ec2'
class Action(BaseAction):
def __init__(self, action=None):
sup = super(Act... | 48.821053 | 73 | 0.840089 |
from aws import Action as BaseAction
from aws import BaseARN
service_name = 'Amazon EC2 Spot Fleet'
prefix = 'ec2'
class Action(BaseAction):
def __init__(self, action=None):
sup = super(Action, self)
sup.__init__(prefix, action)
class ARN(BaseARN):
def __init__(self, resource='', regio... | true | true |
1c2e217d058dd1b7ec6b25e09d68c49a4bf5dc41 | 24,975 | py | Python | tests/__init__.py | korkeatw/pythainlp | 6fc7c3434d5e58c8e8e2bf13470445cbab0866bd | [
"Apache-2.0"
] | null | null | null | tests/__init__.py | korkeatw/pythainlp | 6fc7c3434d5e58c8e8e2bf13470445cbab0866bd | [
"Apache-2.0"
] | null | null | null | tests/__init__.py | korkeatw/pythainlp | 6fc7c3434d5e58c8e8e2bf13470445cbab0866bd | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Unit test
"""
import datetime
import os
import unittest
from collections import Counter
from nltk.corpus import wordnet as wn
from pythainlp import word_vector
from pythainlp.corpus import (
_CORPUS_PATH,
conceptnet,
countries,
download,
provinces,
remove,
thai_n... | 38.364055 | 88 | 0.603524 |
import datetime
import os
import unittest
from collections import Counter
from nltk.corpus import wordnet as wn
from pythainlp import word_vector
from pythainlp.corpus import (
_CORPUS_PATH,
conceptnet,
countries,
download,
provinces,
remove,
thai_negations,
thai_stopwords,
thai_sy... | true | true |
1c2e22a90ad2aaad5a60b61d2ee131476440569c | 24,455 | py | Python | pytorch_src/engagement_classifier.py | PlusLabNLP/PredictiveEngagement | 214d3eb20901982d192b05b4d496420dfb273f8e | [
"MIT"
] | 13 | 2020-08-16T10:19:35.000Z | 2021-11-19T07:35:57.000Z | pytorch_src/engagement_classifier.py | PlusLabNLP/PredictiveEngagement | 214d3eb20901982d192b05b4d496420dfb273f8e | [
"MIT"
] | null | null | null | pytorch_src/engagement_classifier.py | PlusLabNLP/PredictiveEngagement | 214d3eb20901982d192b05b4d496420dfb273f8e | [
"MIT"
] | 2 | 2020-01-04T02:35:07.000Z | 2020-01-23T20:18:32.000Z | import random
import numpy as np
import torch
import torch.optim as optim
import matplotlib.pyplot as plt
from sklearn.metrics import classification_report, roc_auc_score
import pickle
import torch.nn as nn
import os
import csv
random.seed(1000)
np.random.seed(1000)
torch.manual_seed(1000)
# torch.backends.cudnn.ben... | 45.881801 | 217 | 0.604457 | import random
import numpy as np
import torch
import torch.optim as optim
import matplotlib.pyplot as plt
from sklearn.metrics import classification_report, roc_auc_score
import pickle
import torch.nn as nn
import os
import csv
random.seed(1000)
np.random.seed(1000)
torch.manual_seed(1000)
class Engagement_cls()... | true | true |
1c2e22d242454048924dcdcb258ef19ca93433b3 | 7,544 | py | Python | tests/rados/test_9929.py | hmaheswa/cephci | b75c1e58e1222865c81c0558ff98b3708dc4236a | [
"MIT"
] | null | null | null | tests/rados/test_9929.py | hmaheswa/cephci | b75c1e58e1222865c81c0558ff98b3708dc4236a | [
"MIT"
] | null | null | null | tests/rados/test_9929.py | hmaheswa/cephci | b75c1e58e1222865c81c0558ff98b3708dc4236a | [
"MIT"
] | null | null | null | import json
import random
import time
import traceback
from ceph.rados_utils import RadosHelper
from utility.log import Log
log = Log(__name__)
def run(ceph_cluster, **kw):
"""
CEPH-9929-RADOS:
Corrupt an object in ec pool followed by
list-inconsistent-* commands
1. create a jerasure ec pool wit... | 34.290909 | 86 | 0.615986 | import json
import random
import time
import traceback
from ceph.rados_utils import RadosHelper
from utility.log import Log
log = Log(__name__)
def run(ceph_cluster, **kw):
log.info("Running CEPH-9929")
log.info(run.__doc__)
ceph_nodes = kw.get("ceph_nodes")
config = kw.get("config")
build = co... | true | true |
1c2e22d8ae316b4a6d4048c96dab0849ac091011 | 182 | py | Python | setup.py | Hekstra-Lab/napari-labeller | 74913dce72c773df2ec94e1cb3798dd40fedf219 | [
"BSD-3-Clause"
] | null | null | null | setup.py | Hekstra-Lab/napari-labeller | 74913dce72c773df2ec94e1cb3798dd40fedf219 | [
"BSD-3-Clause"
] | 1 | 2021-12-03T21:26:27.000Z | 2021-12-03T21:26:27.000Z | setup.py | Hekstra-Lab/napari-labeller | 74913dce72c773df2ec94e1cb3798dd40fedf219 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
from setuptools import setup
# https://github.com/pypa/setuptools_scm
use_scm = {"write_to": "src/napari_labeller/_version.py"}
setup(use_scm_version=use_scm)
| 26 | 57 | 0.78022 |
from setuptools import setup
use_scm = {"write_to": "src/napari_labeller/_version.py"}
setup(use_scm_version=use_scm)
| true | true |
1c2e2463dffc444c3ccdc2e39b33c19f6d840870 | 1,604 | py | Python | official/nlp/mass/mindspore_hub_conf.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 77 | 2021-10-15T08:32:37.000Z | 2022-03-30T13:09:11.000Z | official/nlp/mass/mindspore_hub_conf.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 3 | 2021-10-30T14:44:57.000Z | 2022-02-14T06:57:57.000Z | official/nlp/mass/mindspore_hub_conf.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 24 | 2021-10-15T08:32:45.000Z | 2022-03-24T18:45:20.000Z | # Copyright 2020-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... | 41.128205 | 88 | 0.698254 |
import os
import mindspore.common.dtype as mstype
from config import TransformerConfig
from src.transformer import TransformerNetworkWithLoss, TransformerInferModel
def get_config(config):
config = TransformerConfig.from_json_file(config)
config.compute_type = mstype.float16
config.dtype = ms... | true | true |
1c2e251fe2c93f024f77f51ca40430d2ad2eb207 | 3,121 | py | Python | spacebase/user/models.py | hugoantunes/spacebase | b33c53ec093ed1ff3c0fcb6161bffeda98cc8ba6 | [
"MIT"
] | null | null | null | spacebase/user/models.py | hugoantunes/spacebase | b33c53ec093ed1ff3c0fcb6161bffeda98cc8ba6 | [
"MIT"
] | 6 | 2020-06-05T23:28:15.000Z | 2022-02-10T12:45:02.000Z | spacebase/user/models.py | hugoantunes/spacebase | b33c53ec093ed1ff3c0fcb6161bffeda98cc8ba6 | [
"MIT"
] | null | null | null | from django.db import models
from django.db.models.signals import post_save
class User(models.Model):
first_name = models.CharField(max_length=30, blank=False)
last_name = models.CharField(max_length=30, blank=False)
iban = models.CharField(max_length=34, blank=False)
class UserAddress(models.Model):
... | 37.60241 | 99 | 0.622877 | from django.db import models
from django.db.models.signals import post_save
class User(models.Model):
first_name = models.CharField(max_length=30, blank=False)
last_name = models.CharField(max_length=30, blank=False)
iban = models.CharField(max_length=34, blank=False)
class UserAddress(models.Model):
... | true | true |
1c2e25da33d65d9515679a6ce73b93544c39a8a3 | 29,741 | py | Python | virtualsmartcard-0.8/src/vpicc/virtualsmartcard/cards/nPA.py | CMelas/foo | d7a34b24606c7b9ab04ea8c39a8b3716ca6255c1 | [
"MIT"
] | 1 | 2021-11-09T12:01:56.000Z | 2021-11-09T12:01:56.000Z | virtualsmartcard-0.8/src/vpicc/virtualsmartcard/cards/nPA.py | CMelas/foo | d7a34b24606c7b9ab04ea8c39a8b3716ca6255c1 | [
"MIT"
] | null | null | null | virtualsmartcard-0.8/src/vpicc/virtualsmartcard/cards/nPA.py | CMelas/foo | d7a34b24606c7b9ab04ea8c39a8b3716ca6255c1 | [
"MIT"
] | null | null | null | #
# Copyright (C) 2011 Dominik Oepen, Frank Morgner
#
# This file is part of virtualsmartcard.
#
# virtualsmartcard is free software: you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the Free
# Software Foundation, either version 3 of the License, or (at your ... | 39.920805 | 79 | 0.547325 |
from virtualsmartcard.SmartcardSAM import SAM
from virtualsmartcard.VirtualSmartcard import Iso7816OS
from virtualsmartcard.SEutils import ControlReferenceTemplate, \
Security_Environment
from virtualsmartcard.SWutils import SwError, SW
from virtualsmartcard.ConstantDefinitions import CRT_TEMPLATE... | false | true |
1c2e2699c29161f428e7a7edc801cf5bc77c1afb | 3,008 | py | Python | www/src/Lib/browser/indexed_db.py | raspberrypieman/brython | 2cc23d1da6acda604d4a56b4c9d464eb7e374eda | [
"BSD-3-Clause"
] | 5,926 | 2015-01-01T07:45:08.000Z | 2022-03-31T12:34:38.000Z | www/src/Lib/browser/indexed_db.py | raspberrypieman/brython | 2cc23d1da6acda604d4a56b4c9d464eb7e374eda | [
"BSD-3-Clause"
] | 1,728 | 2015-01-01T01:09:12.000Z | 2022-03-30T23:25:22.000Z | www/src/Lib/browser/indexed_db.py | raspberrypieman/brython | 2cc23d1da6acda604d4a56b4c9d464eb7e374eda | [
"BSD-3-Clause"
] | 574 | 2015-01-02T01:36:10.000Z | 2022-03-26T10:18:48.000Z | class EventListener:
def __init__(self, events=[]):
self._events=events
def append(self, event):
self._events.append(event)
def fire(self, e):
for _event in self._events:
_event(e)
class IndexedDB:
def __init__(self):
if not __BRYTHON__.has_indexedDB:
raise NotImple... | 28.11215 | 76 | 0.665891 | class EventListener:
def __init__(self, events=[]):
self._events=events
def append(self, event):
self._events.append(event)
def fire(self, e):
for _event in self._events:
_event(e)
class IndexedDB:
def __init__(self):
if not __BRYTHON__.has_indexedDB:
raise NotImple... | true | true |
1c2e26f6a8e0d4b0d26ae185c527fffe209c3a78 | 7,353 | py | Python | examples/run_value_movielens.py | Ulian7/DeepCTR | d8f519a722a4d6a4f1fe18e04af54cfd1369c9a5 | [
"Apache-2.0"
] | null | null | null | examples/run_value_movielens.py | Ulian7/DeepCTR | d8f519a722a4d6a4f1fe18e04af54cfd1369c9a5 | [
"Apache-2.0"
] | null | null | null | examples/run_value_movielens.py | Ulian7/DeepCTR | d8f519a722a4d6a4f1fe18e04af54cfd1369c9a5 | [
"Apache-2.0"
] | null | null | null | import numpy as np
import pandas as pd
import torch
import pdb
import sys
sys.path.append('../')
from sklearn.preprocessing import LabelEncoder
from tensorflow.python.keras.preprocessing.sequence import pad_sequences
from deepctr_torch.inputs import SparseFeat, VarLenSparseFeat, get_feature_names
from deepctr_torch.mo... | 41.542373 | 188 | 0.604107 | import numpy as np
import pandas as pd
import torch
import pdb
import sys
sys.path.append('../')
from sklearn.preprocessing import LabelEncoder
from tensorflow.python.keras.preprocessing.sequence import pad_sequences
from deepctr_torch.inputs import SparseFeat, VarLenSparseFeat, get_feature_names
from deepctr_torch.mo... | true | true |
1c2e27654280503dead196b514c01b654de4b805 | 5,084 | py | Python | lib/morning_greeting.py | tluong0/Alarm-Pi | b26680d168a71b536ac00be22c515980e8cd4fd2 | [
"Apache-2.0"
] | null | null | null | lib/morning_greeting.py | tluong0/Alarm-Pi | b26680d168a71b536ac00be22c515980e8cd4fd2 | [
"Apache-2.0"
] | null | null | null | lib/morning_greeting.py | tluong0/Alarm-Pi | b26680d168a71b536ac00be22c515980e8cd4fd2 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# ___ AlarmPi V 1.1.1 by nickpettican ___
# ___ Your smart alarm clock for the Raspberry Pi ___
# ___ Copyright 2017 Nicolas Pettican ___
# ___ This software is licensed under the Apache 2 ___
# ___ license. You may not u... | 38.515152 | 169 | 0.619001 |
import itertools, random, time, arrow
class Greeting:
def __init__(self, owner):
self.owner = owner
self.time_in_day = {'morning': False,
'afternoon': False,
'evening': False,
'night': False}
self.import_quotes()
self.get_day()
self.generate_greeting()
def ... | false | true |
1c2e27b4c45588a8f4eb9e6c487a361c90839bab | 1,597 | py | Python | tatk/policy/rule/camrest/rule.py | keshuichonglx/tatk | 7e8ad18ca98b105cb0168192bddf80b747067c1b | [
"Apache-2.0"
] | 2 | 2020-09-05T13:12:44.000Z | 2020-10-12T16:51:16.000Z | tatk/policy/rule/camrest/rule.py | keshuichonglx/tatk | 7e8ad18ca98b105cb0168192bddf80b747067c1b | [
"Apache-2.0"
] | null | null | null | tatk/policy/rule/camrest/rule.py | keshuichonglx/tatk | 7e8ad18ca98b105cb0168192bddf80b747067c1b | [
"Apache-2.0"
] | 1 | 2019-11-25T15:34:33.000Z | 2019-11-25T15:34:33.000Z | # -*- coding: utf-8 -*-
import torch
from tatk.policy.policy import Policy
from tatk.policy.rule.camrest.rule_based_camrest_bot import RuleBasedCamrestBot
from tatk.policy.rule.camrest.policy_agenda_camrest import UserPolicyAgendaCamrest
DEVICE = torch.device("cuda" if torch.cuda.is_available() else "cpu")
class Rule... | 30.711538 | 111 | 0.620539 |
import torch
from tatk.policy.policy import Policy
from tatk.policy.rule.camrest.rule_based_camrest_bot import RuleBasedCamrestBot
from tatk.policy.rule.camrest.policy_agenda_camrest import UserPolicyAgendaCamrest
DEVICE = torch.device("cuda" if torch.cuda.is_available() else "cpu")
class Rule(Policy):
def ... | true | true |
1c2e2827127ca09db1965ad1e596f372ea8f2ad7 | 2,056 | py | Python | tests/infra/test_utils.py | Keendata/impala | b25e250d321f329b98e017c648df75d052497963 | [
"Apache-2.0"
] | 1,523 | 2015-01-01T03:42:24.000Z | 2022-02-06T22:24:04.000Z | tests/infra/test_utils.py | xwzbupt/impala | 97dda2b27da99367f4d07699aa046b16cda16dd4 | [
"Apache-2.0"
] | 10 | 2015-01-09T06:46:05.000Z | 2022-03-29T21:57:57.000Z | tests/infra/test_utils.py | xwzbupt/impala | 97dda2b27da99367f4d07699aa046b16cda16dd4 | [
"Apache-2.0"
] | 647 | 2015-01-02T04:01:40.000Z | 2022-03-30T15:57:35.000Z | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | 41.959184 | 87 | 0.708658 |
from tests.util.filesystem_utils import prepend_with_fs
from tests.util.parse_util import get_bytes_summary_stats_counter
def test_filesystem_utils():
path = "/fake-warehouse"
assert prepend_with_fs("", path) == path
fs = "fakeFs://bucket"
path = "/fake-warehouse"
assert prepend_wi... | true | true |
1c2e2904a3aedd99529257cced819199ac3608c7 | 2,985 | py | Python | linalg/lu_decomp.py | lpierezan/cp_playground | 818d116391b762c1ca03be772a50bb997b7958a4 | [
"Apache-2.0"
] | null | null | null | linalg/lu_decomp.py | lpierezan/cp_playground | 818d116391b762c1ca03be772a50bb997b7958a4 | [
"Apache-2.0"
] | null | null | null | linalg/lu_decomp.py | lpierezan/cp_playground | 818d116391b762c1ca03be772a50bb997b7958a4 | [
"Apache-2.0"
] | null | null | null | import numpy as np
def lu_decomp(A):
n = len(A)
U = A.copy()
L = np.eye(n)
row_idx = list(range(n))
for col in range(n):
# find best row
best_row, best_elem = None, None
for row in range(col,n):
row_i = row_idx[row]
elem = U[row_i][col]
i... | 23.139535 | 92 | 0.473032 | import numpy as np
def lu_decomp(A):
n = len(A)
U = A.copy()
L = np.eye(n)
row_idx = list(range(n))
for col in range(n):
best_row, best_elem = None, None
for row in range(col,n):
row_i = row_idx[row]
elem = U[row_i][col]
if best_row is N... | true | true |
1c2e29327dc4182eec73106e98a86215fcaad2e2 | 15,873 | py | Python | pdm/pep517/metadata.py | danieleades/pdm-pep517 | 129697f841c0f635465caf83332c75f5e30b0c6f | [
"MIT"
] | null | null | null | pdm/pep517/metadata.py | danieleades/pdm-pep517 | 129697f841c0f635465caf83332c75f5e30b0c6f | [
"MIT"
] | null | null | null | pdm/pep517/metadata.py | danieleades/pdm-pep517 | 129697f841c0f635465caf83332c75f5e30b0c6f | [
"MIT"
] | null | null | null | import glob
import os
import re
import warnings
from pathlib import Path
from typing import (
Any,
Callable,
Dict,
Generic,
Iterable,
List,
Mapping,
Optional,
Type,
TypeVar,
Union,
)
from pdm.pep517._vendor import toml
from pdm.pep517._vendor.packaging.requirements import Re... | 36.489655 | 88 | 0.564544 | import glob
import os
import re
import warnings
from pathlib import Path
from typing import (
Any,
Callable,
Dict,
Generic,
Iterable,
List,
Mapping,
Optional,
Type,
TypeVar,
Union,
)
from pdm.pep517._vendor import toml
from pdm.pep517._vendor.packaging.requirements import Re... | true | true |
1c2e296046eb40e47029a156980229e65ae057e3 | 23,662 | py | Python | featuretools/computational_backends/pandas_backend.py | kunalvats/featuretools | 25d8a36b7d636546161122095f5d6ca793a0b974 | [
"BSD-3-Clause"
] | 1 | 2019-06-06T15:16:26.000Z | 2019-06-06T15:16:26.000Z | featuretools/computational_backends/pandas_backend.py | kunalvats/featuretools | 25d8a36b7d636546161122095f5d6ca793a0b974 | [
"BSD-3-Clause"
] | null | null | null | featuretools/computational_backends/pandas_backend.py | kunalvats/featuretools | 25d8a36b7d636546161122095f5d6ca793a0b974 | [
"BSD-3-Clause"
] | null | null | null | import cProfile
import logging
import os
import pstats
import sys
import warnings
from datetime import datetime
import numpy as np
import pandas as pd
import pandas.api.types as pdtypes
from future import standard_library
from .base_backend import ComputationalBackend
from .feature_tree import FeatureTree
from featu... | 44.645283 | 107 | 0.584946 | import cProfile
import logging
import os
import pstats
import sys
import warnings
from datetime import datetime
import numpy as np
import pandas as pd
import pandas.api.types as pdtypes
from future import standard_library
from .base_backend import ComputationalBackend
from .feature_tree import FeatureTree
from featu... | true | true |
1c2e2aaab2e6d66ef8843c2a09921db66922ee45 | 6,758 | py | Python | tests/cli/test_cli_parser.py | wegamekinglc/incubator-airflow | fc174635b0729253a86e8c877d6d8551a815a2cb | [
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"ECL-2.0",
"BSD-3-Clause"
] | 7 | 2018-11-19T12:05:13.000Z | 2020-01-17T08:30:38.000Z | tests/cli/test_cli_parser.py | wegamekinglc/incubator-airflow | fc174635b0729253a86e8c877d6d8551a815a2cb | [
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"ECL-2.0",
"BSD-3-Clause"
] | 4 | 2021-06-28T20:57:42.000Z | 2022-02-26T02:11:11.000Z | tests/cli/test_cli_parser.py | wegamekinglc/incubator-airflow | fc174635b0729253a86e8c877d6d8551a815a2cb | [
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"ECL-2.0",
"BSD-3-Clause"
] | 1 | 2021-03-03T01:44:08.000Z | 2021-03-03T01:44:08.000Z | #!/usr/bin/env python
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "... | 39.988166 | 109 | 0.606244 |
import argparse
import contextlib
import io
import re
from collections import Counter
from unittest import TestCase
import pytest
from airflow.cli import cli_parser
ILLEGAL_LONG_OPTION_PATTERN = re.compile("^--[a-z]+_[a-z]+|^--.*[A-Z].*")
LEGAL_SHORT_OPTION_PATTERN = re.compile("^-[a-zA-z]$")
c... | true | true |
1c2e2bf8cd12b512636be05fa4bca246f5094a61 | 325 | py | Python | custom_components/react/enums.py | gertjanstulp/ha-mapper | 9cc84a4856e5f3e45077fd7d2586188b199f83d8 | [
"Apache-2.0"
] | null | null | null | custom_components/react/enums.py | gertjanstulp/ha-mapper | 9cc84a4856e5f3e45077fd7d2586188b199f83d8 | [
"Apache-2.0"
] | null | null | null | custom_components/react/enums.py | gertjanstulp/ha-mapper | 9cc84a4856e5f3e45077fd7d2586188b199f83d8 | [
"Apache-2.0"
] | null | null | null | from enum import Enum
class ReactStage(str, Enum):
SETUP = "setup"
STARTUP = "startup"
WAITING = "waiting"
RUNNING = "running"
BACKGROUND = "background"
class ReactDisabledReason(str, Enum):
REMOVED = "removed"
LOAD_REACT = "load_react"
RESTORE = "restore"
CONSTRAINTS = "constrai... | 19.117647 | 37 | 0.655385 | from enum import Enum
class ReactStage(str, Enum):
SETUP = "setup"
STARTUP = "startup"
WAITING = "waiting"
RUNNING = "running"
BACKGROUND = "background"
class ReactDisabledReason(str, Enum):
REMOVED = "removed"
LOAD_REACT = "load_react"
RESTORE = "restore"
CONSTRAINTS = "constrai... | true | true |
1c2e2c3f297014f04fdf8b9a69ec8380ed2aa5c6 | 1,866 | py | Python | airflow_concert/motif/bigquery_query_job.py | NiltonDuarte/AirflowConcert | a2503a981f24be32d1478a7bb07620568b5e277a | [
"MIT"
] | null | null | null | airflow_concert/motif/bigquery_query_job.py | NiltonDuarte/AirflowConcert | a2503a981f24be32d1478a7bb07620568b5e277a | [
"MIT"
] | null | null | null | airflow_concert/motif/bigquery_query_job.py | NiltonDuarte/AirflowConcert | a2503a981f24be32d1478a7bb07620568b5e277a | [
"MIT"
] | null | null | null | from typing import Optional
from airflow_concert.motif.motif_base import MotifBase
from airflow_concert.motif.mixins.bigquery_job import BigQueryJobMixin, BigQueryTimePartitioning
from airflow_concert.phrase.protocols import PExecuteQueryMotif
class BigQueryQueryJobMotif(MotifBase, BigQueryJobMixin, PExecuteQueryMoti... | 43.395349 | 96 | 0.695606 | from typing import Optional
from airflow_concert.motif.motif_base import MotifBase
from airflow_concert.motif.mixins.bigquery_job import BigQueryJobMixin, BigQueryTimePartitioning
from airflow_concert.phrase.protocols import PExecuteQueryMotif
class BigQueryQueryJobMotif(MotifBase, BigQueryJobMixin, PExecuteQueryMoti... | true | true |
1c2e2cd1ed9af9f97446de32934f76fb590241e6 | 441 | py | Python | githistorydata/filechanges.py | webedx-spark/git-history-data | 14b60ab229b840c14be37d48aade28e462f29cb0 | [
"BSD-2-Clause"
] | 15 | 2015-12-30T03:01:59.000Z | 2021-04-18T12:32:36.000Z | githistorydata/filechanges.py | webedx-spark/git-history-data | 14b60ab229b840c14be37d48aade28e462f29cb0 | [
"BSD-2-Clause"
] | 2 | 2016-02-08T18:37:26.000Z | 2020-01-28T09:51:58.000Z | githistorydata/filechanges.py | webedx-spark/git-history-data | 14b60ab229b840c14be37d48aade28e462f29cb0 | [
"BSD-2-Clause"
] | 6 | 2016-01-09T02:57:33.000Z | 2021-05-27T00:55:01.000Z |
class FileChanges( object ):
def __init__( self, added, removed, name ):
self.added = added
self.removed = removed
self.name = name
def __str__( self ):
return "+%d -%d %s" % ( self.added, self.removed, self.name )
def __eq__( self, other ):
return (
s... | 24.5 | 69 | 0.537415 |
class FileChanges( object ):
def __init__( self, added, removed, name ):
self.added = added
self.removed = removed
self.name = name
def __str__( self ):
return "+%d -%d %s" % ( self.added, self.removed, self.name )
def __eq__( self, other ):
return (
s... | true | true |
1c2e2e76ec0affa83efc22ac66d44eb80e53185d | 5,877 | py | Python | project/src/irgen/ir_generation.py | vaishious/comperler | 24b3f853ae134e46435005c4509276a4020b8b02 | [
"MIT"
] | 6 | 2016-01-09T14:11:20.000Z | 2017-01-26T10:10:01.000Z | project/src/irgen/ir_generation.py | vaishious/comperler | 24b3f853ae134e46435005c4509276a4020b8b02 | [
"MIT"
] | null | null | null | project/src/irgen/ir_generation.py | vaishious/comperler | 24b3f853ae134e46435005c4509276a4020b8b02 | [
"MIT"
] | null | null | null | """
Module : ir_generation
Function : Contains class and function definitions used to perform IR generation
"""
import debug as DEBUG
INT_DATA_TYPE, STR_DATA_TYPE, UNKNOWN_DATA_TYPE = range(3)
NextInstr = 0
ProgLineNum = 0
InstrMap = [0]
FuncMap = {}
FuncReturnMap = {}
CurFuncID = ''
CurActivationRecord = None
### ... | 22.261364 | 82 | 0.594011 | """
Module : ir_generation
Function : Contains class and function definitions used to perform IR generation
"""
import debug as DEBUG
INT_DATA_TYPE, STR_DATA_TYPE, UNKNOWN_DATA_TYPE = range(3)
NextInstr = 0
ProgLineNum = 0
InstrMap = [0]
FuncMap = {}
FuncReturnMap = {}
CurFuncID = ''
CurActivationRecord = None
:
... | false | true |
1c2e2f46711fc360cb68a5335f3b09e7bd551c6b | 3,763 | py | Python | server/fullstackChallenge/settings.py | thiagobrez/newsWebsite | 130f01d29dd776eaa096080982274bb27d19ad8f | [
"MIT"
] | null | null | null | server/fullstackChallenge/settings.py | thiagobrez/newsWebsite | 130f01d29dd776eaa096080982274bb27d19ad8f | [
"MIT"
] | 7 | 2020-09-07T18:44:00.000Z | 2022-02-10T19:05:41.000Z | server/fullstackChallenge/settings.py | thiagobrez/newsWebsite | 130f01d29dd776eaa096080982274bb27d19ad8f | [
"MIT"
] | null | null | null | """
Django settings for fullstackChallenge project.
Generated by 'django-admin startproject' using Django 2.1.7.
For more information on this file, see
https://docs.djangoproject.com/en/2.1/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/2.1/ref/settings/
"""
i... | 25.598639 | 91 | 0.688546 |
import os
from decouple import config
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
SECRET_KEY = config('SECRET_KEY')
DEBUG = config('DEBUG', cast=bool)
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql_psycopg2',
'NAME': config('DB_NAME'),
'... | true | true |
1c2e310f57502b89e03733838eb5436fa364367d | 3,051 | py | Python | tests/test_tutorial/test_handling_errors/test_tutorial002.py | 0x20bf-org/fastapi | 46a1d68387b2bfb6513bfe956e84fc99767d737a | [
"MIT"
] | null | null | null | tests/test_tutorial/test_handling_errors/test_tutorial002.py | 0x20bf-org/fastapi | 46a1d68387b2bfb6513bfe956e84fc99767d737a | [
"MIT"
] | null | null | null | tests/test_tutorial/test_handling_errors/test_tutorial002.py | 0x20bf-org/fastapi | 46a1d68387b2bfb6513bfe956e84fc99767d737a | [
"MIT"
] | null | null | null | from docs_src.handling_errors.tutorial002 import app
from fastapi.testclient import TestClient
client = TestClient(app)
openapi_schema = {
"openapi": "3.0.2",
"info": {"title": "FastAPI", "version": "0.1.0"},
"paths": {
"/items-header/{item_id}": {
"get": {
"responses":... | 33.9 | 86 | 0.405113 | from docs_src.handling_errors.tutorial002 import app
from fastapi.testclient import TestClient
client = TestClient(app)
openapi_schema = {
"openapi": "3.0.2",
"info": {"title": "FastAPI", "version": "0.1.0"},
"paths": {
"/items-header/{item_id}": {
"get": {
"responses":... | true | true |
1c2e318001a9ef9165216d8e65a780d5afcf3532 | 3,618 | py | Python | pycritty/commands/run.py | binRick/pycritty | ae27e61fe597c22e6830d62533e11d64bf06a3ae | [
"MIT"
] | null | null | null | pycritty/commands/run.py | binRick/pycritty | ae27e61fe597c22e6830d62533e11d64bf06a3ae | [
"MIT"
] | null | null | null | pycritty/commands/run.py | binRick/pycritty | ae27e61fe597c22e6830d62533e11d64bf06a3ae | [
"MIT"
] | null | null | null | from typing import Dict, Any, Union
import sys
from pathlib import Path
from .. import PycrittyError
from .command import Command
from ..io import log, yio
from ..resources import config_file, saves_dir
from ..resources.resource import ConfigFile
from rich import print, pretty, inspect
from rich.console import Console
... | 38.084211 | 89 | 0.571034 | from typing import Dict, Any, Union
import sys
from pathlib import Path
from .. import PycrittyError
from .command import Command
from ..io import log, yio
from ..resources import config_file, saves_dir
from ..resources.resource import ConfigFile
from rich import print, pretty, inspect
from rich.console import Console
... | true | true |
1c2e31e4d91019f9a9d7ed49e73b96ac5eae1835 | 1,715 | py | Python | my_classes/ScopesClosuresAndDecorators/.history/Decoraators2_20210716225144.py | minefarmer/deep-Dive-1 | b0675b853180c5b5781888266ea63a3793b8d855 | [
"Unlicense"
] | null | null | null | my_classes/ScopesClosuresAndDecorators/.history/Decoraators2_20210716225144.py | minefarmer/deep-Dive-1 | b0675b853180c5b5781888266ea63a3793b8d855 | [
"Unlicense"
] | null | null | null | my_classes/ScopesClosuresAndDecorators/.history/Decoraators2_20210716225144.py | minefarmer/deep-Dive-1 | b0675b853180c5b5781888266ea63a3793b8d855 | [
"Unlicense"
] | null | null | null | """ Decorator Parametors
In the previous ideos we saw some built-in decorators that can handle some arguments:
@wraps(fn) @lru_cache(maxsize=256) <\
def inner(): def factorial(n): \
... ... \>function call
This should loo... | 27.66129 | 89 | 0.542857 | from symbol import parameters
from time import perf_counter
from unittest import result
def timed(fn):
from time import perf_counter
def inner(*arhs, **kwarrgs):
total_elapse = 0
for i in range(10): nter()
result = fn(*args, **kwargs)
total_elapsed += (perf_cou... | true | true |
1c2e3231607b33d5619c4351426be2731fa7fda7 | 1,272 | py | Python | setup.py | aiven/aiven-db-migrate | e3751aadfc8ad9a011d64ba5dec96118e52c68b2 | [
"Apache-2.0"
] | 10 | 2020-08-03T17:45:18.000Z | 2022-02-18T00:12:17.000Z | setup.py | aiven/aiven-db-migrate | e3751aadfc8ad9a011d64ba5dec96118e52c68b2 | [
"Apache-2.0"
] | 12 | 2020-08-27T15:15:54.000Z | 2022-02-24T16:11:18.000Z | setup.py | aiven/aiven-db-migrate | e3751aadfc8ad9a011d64ba5dec96118e52c68b2 | [
"Apache-2.0"
] | 1 | 2022-01-07T12:00:17.000Z | 2022-01-07T12:00:17.000Z | # Copyright (c) 2020 Aiven, Helsinki, Finland. https://aiven.io/
from importlib.machinery import SourceFileLoader
from setuptools import find_packages, setup
import sys
def get_version():
return SourceFileLoader("version", "aiven_db_migrate/migrate/version.py").load_module().__version__
setup(
author="Aiv... | 29.581395 | 103 | 0.636006 |
from importlib.machinery import SourceFileLoader
from setuptools import find_packages, setup
import sys
def get_version():
return SourceFileLoader("version", "aiven_db_migrate/migrate/version.py").load_module().__version__
setup(
author="Aiven",
author_email="support@aiven.io",
entry_points={
... | true | true |
1c2e3323d8a8bfa2b1d3b5d79d47be08567a9379 | 16,309 | py | Python | heat/engine/parser.py | devcamcar/heat | 0f1bd5d29102318e62b5a10281d809807bd3b163 | [
"Apache-2.0"
] | 1 | 2015-05-11T04:54:30.000Z | 2015-05-11T04:54:30.000Z | heat/engine/parser.py | devcamcar/heat | 0f1bd5d29102318e62b5a10281d809807bd3b163 | [
"Apache-2.0"
] | null | null | null | heat/engine/parser.py | devcamcar/heat | 0f1bd5d29102318e62b5a10281d809807bd3b163 | [
"Apache-2.0"
] | null | null | null | # vim: tabstop=4 shiftwidth=4 softtabstop=4
#
# 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.981859 | 79 | 0.499785 |
import eventlet
import json
import logging
import sys
from heat.common import exception
from heat.engine import resources
from heat.engine import instance
from heat.engine import volume
from heat.engine import eip
from heat.engine import security_group
from heat.engine import wait_condition
from heat.d... | true | true |
1c2e33aae33d7676078b930aae7d76313c38fcbb | 2,971 | py | Python | main.py | YuhangSong/alley | c20111189d3e83b4a902140361089a7b1d11702a | [
"MIT"
] | null | null | null | main.py | YuhangSong/alley | c20111189d3e83b4a902140361089a7b1d11702a | [
"MIT"
] | null | null | null | main.py | YuhangSong/alley | c20111189d3e83b4a902140361089a7b1d11702a | [
"MIT"
] | null | null | null | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
"""Simple example of using Multi-Agent and Hierarchical
(https://ray.readthedocs.io/en/latest/rllib-env.html#multi-agent-and-hierarchical)
from rllib to train an arena environment in ArenaRllibEnv.
"""
import a... | 32.648352 | 96 | 0.685291 | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import argparse
import random
import time
import numpy as np
import ray
from ray import tune
from ray.rllib.utils import try_import_tf
from envs_layer import ArenaRllibEnv
tf = try_import_tf()
parser = arg... | true | true |
1c2e33dd468219d592ebd684a35db138aaa243e7 | 1,078 | py | Python | slow_processing_times/blueprints/processing.py | GeoffreyDlvl/SlowwwwwProcessingTimes | f0e37d11fef6d4922e6c9c8fc68766f29bd21bb4 | [
"MIT"
] | null | null | null | slow_processing_times/blueprints/processing.py | GeoffreyDlvl/SlowwwwwProcessingTimes | f0e37d11fef6d4922e6c9c8fc68766f29bd21bb4 | [
"MIT"
] | null | null | null | slow_processing_times/blueprints/processing.py | GeoffreyDlvl/SlowwwwwProcessingTimes | f0e37d11fef6d4922e6c9c8fc68766f29bd21bb4 | [
"MIT"
] | null | null | null | import time
from flask import (
Blueprint, request, current_app
)
from .. import utils
from ..enums.state_enum import State
from ..blueprints.crack import archives
bp = Blueprint('processing', __name__, url_prefix='/processing')
def some_processing():
print('PROCESSING...')
time.sleep(10)
print('DONE... | 28.368421 | 99 | 0.702226 | import time
from flask import (
Blueprint, request, current_app
)
from .. import utils
from ..enums.state_enum import State
from ..blueprints.crack import archives
bp = Blueprint('processing', __name__, url_prefix='/processing')
def some_processing():
print('PROCESSING...')
time.sleep(10)
print('DONE... | true | true |
1c2e34a3a089e4d5a4555dea0f99551b3b7517cc | 942 | py | Python | apiclient/request_formatters.py | Phonebooth/api-client | c2820fa4c4997aad8a07e408b80a52df4d6c9978 | [
"MIT"
] | 112 | 2019-02-18T15:07:50.000Z | 2022-03-31T07:05:23.000Z | apiclient/request_formatters.py | Phonebooth/api-client | c2820fa4c4997aad8a07e408b80a52df4d6c9978 | [
"MIT"
] | 34 | 2019-02-20T13:32:47.000Z | 2022-01-22T23:09:50.000Z | apiclient/request_formatters.py | Phonebooth/api-client | c2820fa4c4997aad8a07e408b80a52df4d6c9978 | [
"MIT"
] | 23 | 2019-03-15T10:50:03.000Z | 2022-03-17T09:49:21.000Z | import json
from apiclient.utils.typing import OptionalJsonType, OptionalStr
class BaseRequestFormatter:
"""Format the outgoing data accordingly and set the content-type headers."""
content_type = None
@classmethod
def get_headers(cls) -> dict:
if cls.content_type:
return {"Cont... | 23.55 | 80 | 0.680467 | import json
from apiclient.utils.typing import OptionalJsonType, OptionalStr
class BaseRequestFormatter:
content_type = None
@classmethod
def get_headers(cls) -> dict:
if cls.content_type:
return {"Content-type": cls.content_type}
else:
return {}
@classmetho... | true | true |
1c2e34b2c0fc0aca1bbc78728b67afbf95f4a6cd | 6,714 | py | Python | src/python/pants/backend/python/goals/run_pex_binary_integration_test.py | chebbyChefNEQ/pants | a53b9d29a160f36f9af1d1a2c43a693b6a55fa55 | [
"Apache-2.0"
] | 1 | 2016-04-27T15:35:42.000Z | 2016-04-27T15:35:42.000Z | src/python/pants/backend/python/goals/run_pex_binary_integration_test.py | chebbyChefNEQ/pants | a53b9d29a160f36f9af1d1a2c43a693b6a55fa55 | [
"Apache-2.0"
] | null | null | null | src/python/pants/backend/python/goals/run_pex_binary_integration_test.py | chebbyChefNEQ/pants | a53b9d29a160f36f9af1d1a2c43a693b6a55fa55 | [
"Apache-2.0"
] | null | null | null | # Copyright 2020 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
import json
import os
from textwrap import dedent
from typing import Optional
import pytest
from pants.backend.python.target_types import PexExecutionMode
from pants.testutil.pants_integ... | 32.434783 | 97 | 0.545576 |
import json
import os
from textwrap import dedent
from typing import Optional
import pytest
from pants.backend.python.target_types import PexExecutionMode
from pants.testutil.pants_integration_test import PantsResult, run_pants, setup_tmpdir
@pytest.mark.parametrize(
("entry_point", "execution_mode", "includ... | true | true |
1c2e350653f5047348cfa08e90c9d50892d88626 | 318 | py | Python | Practice Problems/13-Decorators/Beginner/test_decorators_beginner.py | vishnu-rvn/PyPractice | 521cf6582b49aabd9a4c1c0aef0dd3608c9ee63b | [
"MIT"
] | 9 | 2018-07-13T16:29:41.000Z | 2018-07-14T14:40:38.000Z | Practice Problems/13-Decorators/Beginner/test_decorators_beginner.py | vishnu-rvn/PyPractice | 521cf6582b49aabd9a4c1c0aef0dd3608c9ee63b | [
"MIT"
] | 11 | 2018-07-15T07:56:57.000Z | 2018-07-21T17:41:13.000Z | Practice Problems/13-Decorators/Beginner/test_decorators_beginner.py | vishnu-rvn/PyPractice | 521cf6582b49aabd9a4c1c0aef0dd3608c9ee63b | [
"MIT"
] | 8 | 2018-07-13T02:37:53.000Z | 2018-07-14T20:36:44.000Z | from unittest import TestCase, TestSuite, TextTestRunner, main
class DecoratorsBeginnerTestCase(TestCase):
pass
def test_one(test_name):
suite = TestSuite()
suite.addTest(DecoratorsBeginnerTestCase(test_name))
runner = TextTestRunner()
runner.run(suite)
if __name__ == "__main__":
main()
| 18.705882 | 62 | 0.732704 | from unittest import TestCase, TestSuite, TextTestRunner, main
class DecoratorsBeginnerTestCase(TestCase):
pass
def test_one(test_name):
suite = TestSuite()
suite.addTest(DecoratorsBeginnerTestCase(test_name))
runner = TextTestRunner()
runner.run(suite)
if __name__ == "__main__":
main()
| true | true |
1c2e35b8dc64792855acbd02758e9d8d72ce1652 | 1,971 | py | Python | test_project/test_project_py3/settings.py | yprez/django-useful | 288aa46df6f40fb0323c3d0c0efcded887472538 | [
"0BSD"
] | 3 | 2015-09-30T09:26:31.000Z | 2019-03-19T05:44:24.000Z | test_project/test_project_py3/settings.py | yprez/django-useful | 288aa46df6f40fb0323c3d0c0efcded887472538 | [
"0BSD"
] | 3 | 2020-02-11T22:13:27.000Z | 2021-06-10T17:40:52.000Z | test_project/test_project_py3/settings.py | yprez/django-useful | 288aa46df6f40fb0323c3d0c0efcded887472538 | [
"0BSD"
] | 1 | 2016-08-08T14:35:02.000Z | 2016-08-08T14:35:02.000Z | # Django settings for test_project project.
DEBUG = True
TEMPLATE_DEBUG = DEBUG
ADMINS = (
# ('Your Name', 'your_email@example.com'),
)
MANAGERS = ADMINS
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': 'test.db',
}
}
TIME_ZONE = 'Etc/UTC'
LANGUAGE_CODE = 'en-u... | 24.333333 | 75 | 0.710299 |
DEBUG = True
TEMPLATE_DEBUG = DEBUG
ADMINS = (
)
MANAGERS = ADMINS
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': 'test.db',
}
}
TIME_ZONE = 'Etc/UTC'
LANGUAGE_CODE = 'en-us'
SITE_ID = 1
STATIC_URL = '/static/'
SECRET_KEY = 't^4dt#fkxftpborp@%lg*#h2wj%vi... | true | true |
1c2e35d4a10895371f644ea4da834848880fabab | 13,265 | py | Python | trove/tests/unittests/common/test_common_extensions.py | zh-f/trove | 4998becb4da14547798cece21858282761409052 | [
"Apache-2.0"
] | 1 | 2017-11-24T10:28:48.000Z | 2017-11-24T10:28:48.000Z | trove/tests/unittests/common/test_common_extensions.py | 2020human/trove-new | 012da9a334bc4e9c7711dc918eea3f011463ec82 | [
"Apache-2.0"
] | null | null | null | trove/tests/unittests/common/test_common_extensions.py | 2020human/trove-new | 012da9a334bc4e9c7711dc918eea3f011463ec82 | [
"Apache-2.0"
] | null | null | null | # Copyright 2013 Hewlett-Packard Development Company, L.P.
# 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... | 41.583072 | 79 | 0.671014 |
from mock import Mock
from mock import patch
from oslo_config.cfg import NoSuchOptError
from trove.common import exception
from trove.common import utils
from trove.extensions.common import models
from trove.extensions.common.service import ClusterRootController
from trove.extensions.common.service imp... | true | true |
1c2e367c90621a2f3c539e2a56a294a69368a509 | 3,022 | py | Python | corehq/apps/reminders/management/commands/remove_dup_reminders.py | dslowikowski/commcare-hq | ad8885cf8dab69dc85cb64f37aeaf06106124797 | [
"BSD-3-Clause"
] | 1 | 2015-02-10T23:26:39.000Z | 2015-02-10T23:26:39.000Z | corehq/apps/reminders/management/commands/remove_dup_reminders.py | SEL-Columbia/commcare-hq | 992ee34a679c37f063f86200e6df5a197d5e3ff6 | [
"BSD-3-Clause"
] | 1 | 2022-03-12T01:03:25.000Z | 2022-03-12T01:03:25.000Z | corehq/apps/reminders/management/commands/remove_dup_reminders.py | johan--/commcare-hq | 86ee99c54f55ee94e4c8f2f6f30fc44e10e69ebd | [
"BSD-3-Clause"
] | null | null | null | from django.core.management.base import BaseCommand, CommandError
from corehq.apps.reminders.models import (CaseReminder, CaseReminderHandler,
CASE_CRITERIA)
from corehq.apps.reminders.signals import case_changed_receiver
from casexml.apps.case.models import CommCareCase
from optparse import make_option
class Comm... | 35.552941 | 84 | 0.534083 | from django.core.management.base import BaseCommand, CommandError
from corehq.apps.reminders.models import (CaseReminder, CaseReminderHandler,
CASE_CRITERIA)
from corehq.apps.reminders.signals import case_changed_receiver
from casexml.apps.case.models import CommCareCase
from optparse import make_option
class Comm... | false | true |
1c2e370fce6aba1a51bb9131766055f18fc82eea | 5,979 | py | Python | config/defaults.py | Ehsan-Yaghoubi/my_reid_Pytorch_template | 8b346ad8010084536a7c998107979fab2bff2ca3 | [
"MIT"
] | null | null | null | config/defaults.py | Ehsan-Yaghoubi/my_reid_Pytorch_template | 8b346ad8010084536a7c998107979fab2bff2ca3 | [
"MIT"
] | null | null | null | config/defaults.py | Ehsan-Yaghoubi/my_reid_Pytorch_template | 8b346ad8010084536a7c998107979fab2bff2ca3 | [
"MIT"
] | null | null | null | from yacs.config import CfgNode as CN
# -----------------------------------------------------------------------------
# The following configurations will be modified when they are set in the .yml files.
# Therefore, if you want to your configurations, please create your_costumed.yml file, instead of changing this scri... | 36.907407 | 176 | 0.628366 | from yacs.config import CfgNode as CN
_C = CN()
_C.MODEL = CN()
_C.MODEL.DEVICE = "cuda"
_C.MODEL.DEVICE_ID = '0'
_C.MODEL.NAME = 'resnet50'
_C.MODEL.LAST_STRIDE = 1
_C.MODEL.PRETRAIN_PATH = "set/the/path/in/.yml/file"
_C.MODEL.PRETRAIN_CHOICE = 'imagenet'
_C.MODEL.NECK = 'no'
_C.MODEL.IF_WITH_CENTER = ... | true | true |
1c2e399c351804410c4ec2623c9930aad9d9a7f0 | 15,627 | py | Python | tests/test_refpixel.py | uniomni/PyRate | f77ad6e7fd90f3c0eb255bd553d4666b5db40bcf | [
"Apache-2.0"
] | 1 | 2020-09-12T00:01:33.000Z | 2020-09-12T00:01:33.000Z | tests/test_refpixel.py | uniomni/PyRate | f77ad6e7fd90f3c0eb255bd553d4666b5db40bcf | [
"Apache-2.0"
] | null | null | null | tests/test_refpixel.py | uniomni/PyRate | f77ad6e7fd90f3c0eb255bd553d4666b5db40bcf | [
"Apache-2.0"
] | null | null | null | # This Python module is part of the PyRate software package.
#
# Copyright 2020 Geoscience Australia
#
# 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/... | 38.021898 | 112 | 0.6531 |
import copy
import shutil
from subprocess import check_call, run
from pathlib import Path
import pytest
from numpy import nan, mean, std, isnan
import pyrate.core.refpixel
from pyrate.core import config as cf
from pyrate.core.refpixel import ref_pixel, _step, RefPixelError
from pyrate.core import shared... | true | true |
1c2e39c02248ac535e7f4e4f4f871e156c50c176 | 2,070 | py | Python | ops-tests/feature/test_switch.py | nshinde5486/ansible_2switchtopo | e49a883d385c36bea7b12ff9f38b2f2ac22431f6 | [
"Apache-2.0"
] | null | null | null | ops-tests/feature/test_switch.py | nshinde5486/ansible_2switchtopo | e49a883d385c36bea7b12ff9f38b2f2ac22431f6 | [
"Apache-2.0"
] | null | null | null | ops-tests/feature/test_switch.py | nshinde5486/ansible_2switchtopo | e49a883d385c36bea7b12ff9f38b2f2ac22431f6 | [
"Apache-2.0"
] | null | null | null | # Copyright (C) 2016 Hewlett Packard Enterprise Development LP
#
# 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... | 28.75 | 71 | 0.630435 |
import time
TOPOLOGY = """
#
# +-----------------+ +------------+
# | Ansible | eth0 eth0 | |
# | control machine |-------------| OpenSwitch |
# | (server) | | (switch) |
# +-----------------+ +------------+
#
# ... | true | true |
1c2e3a596f63c8d59e25f4a3ad1f356d75d198af | 280 | py | Python | other/application/windowApp/test/showTestList.py | Ethan7102/FYP | c6560a0b95ad78d5e1a341ab2d93c063e10c6631 | [
"MIT"
] | null | null | null | other/application/windowApp/test/showTestList.py | Ethan7102/FYP | c6560a0b95ad78d5e1a341ab2d93c063e10c6631 | [
"MIT"
] | null | null | null | other/application/windowApp/test/showTestList.py | Ethan7102/FYP | c6560a0b95ad78d5e1a341ab2d93c063e10c6631 | [
"MIT"
] | 1 | 2021-01-23T07:59:57.000Z | 2021-01-23T07:59:57.000Z | import sys
import testList
from PyQt5.QtWidgets import QApplication, QMainWindow
if __name__ == '__main__':
app = QApplication(sys.argv)
MainWindow = QMainWindow()
ui = testList.Ui_MainWindow()
ui.setupUi(MainWindow)
MainWindow.show()
sys.exit(app.exec_()) | 28 | 53 | 0.721429 | import sys
import testList
from PyQt5.QtWidgets import QApplication, QMainWindow
if __name__ == '__main__':
app = QApplication(sys.argv)
MainWindow = QMainWindow()
ui = testList.Ui_MainWindow()
ui.setupUi(MainWindow)
MainWindow.show()
sys.exit(app.exec_()) | true | true |
1c2e3bb30191572e984a79039352c93ea0460f76 | 2,861 | py | Python | LogAnalysis.py | ZeinaKittaneh/LogAnalysis_Udacity | 860651042c0dd5376f23aa478bb37d04c3538641 | [
"Unlicense",
"MIT"
] | null | null | null | LogAnalysis.py | ZeinaKittaneh/LogAnalysis_Udacity | 860651042c0dd5376f23aa478bb37d04c3538641 | [
"Unlicense",
"MIT"
] | null | null | null | LogAnalysis.py | ZeinaKittaneh/LogAnalysis_Udacity | 860651042c0dd5376f23aa478bb37d04c3538641 | [
"Unlicense",
"MIT"
] | null | null | null | #!/usr/bin/env python
import psycopg2
DBNAME = "news"
question1 = "\nWhat are the most popular three articles of all time?\n"
query1 = '''SELECT
title,
COUNT(substr(path, 10)) AS views
FROM
articles
JOIN
log
ON slug = substr(path, 10)
GROUP BY
title
ORDER BY
vi... | 24.042017 | 77 | 0.487941 |
import psycopg2
DBNAME = "news"
question1 = "\nWhat are the most popular three articles of all time?\n"
query1 = '''SELECT
title,
COUNT(substr(path, 10)) AS views
FROM
articles
JOIN
log
ON slug = substr(path, 10)
GROUP BY
title
ORDER BY
views DESC LIMIT 3;'''
... | true | true |
1c2e3c444ff71978eb57327f35fbb39ec72a91ea | 9,081 | py | Python | lib/fast_rcnn/config.py | svebk/py-faster-rcnn | 1d0c40c42930f8e89634c057a0ed902aace395bd | [
"BSD-2-Clause"
] | null | null | null | lib/fast_rcnn/config.py | svebk/py-faster-rcnn | 1d0c40c42930f8e89634c057a0ed902aace395bd | [
"BSD-2-Clause"
] | null | null | null | lib/fast_rcnn/config.py | svebk/py-faster-rcnn | 1d0c40c42930f8e89634c057a0ed902aace395bd | [
"BSD-2-Clause"
] | null | null | null | # --------------------------------------------------------
# Fast R-CNN
# Copyright (c) 2015 Microsoft
# Licensed under The MIT License [see LICENSE for details]
# Written by Ross Girshick
# --------------------------------------------------------
"""Fast R-CNN config system.
This file specifies default config option... | 31.975352 | 91 | 0.689462 |
import os
import os.path as osp
import numpy as np
from easydict import EasyDict as edict
__C = edict()
# Consumers can get config by:
# from fast_rcnn_config import cfg
cfg = __C
#
# Training options
#
__C.TRAIN = edict()
# Scales to use during training (can list multiple scales)
# Each scale is the pix... | true | true |
1c2e3c9b914af797b1b040a129e2c66f74970371 | 1,833 | py | Python | payment_gateway/api/external/sqs_base.py | MayaraMachado/sns_and_sqs_project | 4fcc5bbb5f6841543ea8dda353dd85a43024f683 | [
"MIT"
] | 5 | 2020-06-22T21:29:54.000Z | 2021-11-01T20:12:04.000Z | payment_gateway/api/external/sqs_base.py | MayaraMachado/sns_and_sqs_project | 4fcc5bbb5f6841543ea8dda353dd85a43024f683 | [
"MIT"
] | 5 | 2021-03-30T13:38:15.000Z | 2021-09-22T19:10:27.000Z | payment_gateway/api/external/sqs_base.py | MayaraMachado/sns_and_sqs_project | 4fcc5bbb5f6841543ea8dda353dd85a43024f683 | [
"MIT"
] | null | null | null | import boto3
import logging
from django.conf import settings
class SQSConnection:
def __init__(self):
'''
Instanciação do cliente SQS utilizando boto3;
Returns:
---------
sqs : pyboto3.sqs
Instância sqs.
'''... | 30.04918 | 108 | 0.623568 | import boto3
import logging
from django.conf import settings
class SQSConnection:
def __init__(self):
self.sqs_client = boto3.client(
'sqs',
aws_access_key_id=settings.AWS_ACCESS_KEY_ID,
aws_secret_access_key=settings.AWS_SECRET_ACCESS_KEY,
region_name='us-... | true | true |
1c2e3e29450951f7817fa320c3125f8a88f35010 | 733 | py | Python | codes/MIGraph/Encoders/CompoundEncoder.py | KentaroKutsukake/Integrating-multiple-materials-science-projects | a6f09583718fc00431a3ce67d5fc6f026646f91c | [
"MIT"
] | 5 | 2020-07-31T01:35:49.000Z | 2021-07-30T13:05:48.000Z | codes/MIGraph/Encoders/CompoundEncoder.py | KentaroKutsukake/Integrating-multiple-materials-science-projects | a6f09583718fc00431a3ce67d5fc6f026646f91c | [
"MIT"
] | null | null | null | codes/MIGraph/Encoders/CompoundEncoder.py | KentaroKutsukake/Integrating-multiple-materials-science-projects | a6f09583718fc00431a3ce67d5fc6f026646f91c | [
"MIT"
] | 2 | 2020-10-21T19:17:06.000Z | 2021-05-17T10:38:41.000Z |
"""
Compound encoder
this class returns vector information of a target smiles
"""
import numpy as np
from Config import Config
CF=Config()
categoryEmbed=CF.categoryEmbed
#compound encoder class
class CompEncoder:
def __init__(self,CompDat,num):
"""
CompDat: CompDatabase class
num: =CF.I... | 20.942857 | 56 | 0.608458 |
import numpy as np
from Config import Config
CF=Config()
categoryEmbed=CF.categoryEmbed
class CompEncoder:
def __init__(self,CompDat,num):
self.CompDat=CompDat
self.num=num
def getEVector(self,string):
num=self.num
res=self.CompDat.getCompDesc(string)
... | true | true |
1c2e3e3aee69136d4d47437ed81e6f8478aef8ce | 670 | py | Python | tests/python/test_cuda_internals.py | gaoxinge/taichi | 86d403f071b8505858763d4712b37cd71b89db91 | [
"MIT"
] | 1 | 2020-11-10T07:17:01.000Z | 2020-11-10T07:17:01.000Z | tests/python/test_cuda_internals.py | gaoxinge/taichi | 86d403f071b8505858763d4712b37cd71b89db91 | [
"MIT"
] | 1 | 2020-08-24T05:18:43.000Z | 2020-08-24T05:18:43.000Z | tests/python/test_cuda_internals.py | gaoxinge/taichi | 86d403f071b8505858763d4712b37cd71b89db91 | [
"MIT"
] | null | null | null | from taichi.lang import impl
import taichi as ti
from tests import test_utils
# TODO: these are not really tests...
@test_utils.test(arch=ti.cuda)
def test_do_nothing():
@ti.kernel
def test():
for i in range(10):
impl.call_internal("do_nothing")
test()
@test_utils.test(arch=ti.cud... | 17.631579 | 54 | 0.602985 | from taichi.lang import impl
import taichi as ti
from tests import test_utils
@test_utils.test(arch=ti.cuda)
def test_do_nothing():
@ti.kernel
def test():
for i in range(10):
impl.call_internal("do_nothing")
test()
@test_utils.test(arch=ti.cuda)
def test_active_mask():
@ti.ke... | true | true |
1c2e3e50d1e8a86414fb26a4710c822625cf9f44 | 4,769 | py | Python | bwt.py | broestls/pycuda-bw-test | 0ac9a377363bb99bc1b9e5dd42bbdd0bd6d697c3 | [
"MIT"
] | null | null | null | bwt.py | broestls/pycuda-bw-test | 0ac9a377363bb99bc1b9e5dd42bbdd0bd6d697c3 | [
"MIT"
] | null | null | null | bwt.py | broestls/pycuda-bw-test | 0ac9a377363bb99bc1b9e5dd42bbdd0bd6d697c3 | [
"MIT"
] | null | null | null | import numpy as np
import pycuda.driver as cuda
from pycuda.compiler import SourceModule
from pycuda.tools import make_default_context, clear_context_caches
import glob
import sys
import os
from datetime import datetime
import ctypes
import atexit
import argparse
import subprocess
import psutil
import itertools
from... | 43.354545 | 280 | 0.695743 | import numpy as np
import pycuda.driver as cuda
from pycuda.compiler import SourceModule
from pycuda.tools import make_default_context, clear_context_caches
import glob
import sys
import os
from datetime import datetime
import ctypes
import atexit
import argparse
import subprocess
import psutil
import itertools
from... | true | true |
1c2e3f6cda81575e2f211c0c19990a5adcb75fb9 | 2,608 | py | Python | src/third_party/wiredtiger/test/suite/test_upgrade.py | hgGeorg/mongo | b5bea92504b2612f433b55e7b901f9ae276d11ec | [
"Apache-2.0"
] | 1 | 2020-01-01T06:16:58.000Z | 2020-01-01T06:16:58.000Z | src/third_party/wiredtiger/test/suite/test_upgrade.py | Man1029/CMONGO | c40380caa14e05509f46993aa8b8da966b09b0b5 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | src/third_party/wiredtiger/test/suite/test_upgrade.py | Man1029/CMONGO | c40380caa14e05509f46993aa8b8da966b09b0b5 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
#
# Public Domain 2014-2016 MongoDB, Inc.
# Public Domain 2008-2014 WiredTiger, Inc.
#
# This is free and unencumbered software released into the public domain.
#
# Anyone is free to copy, modify, publish, use, compile, sell, or
# distribute this software, either in source code form or as a compil... | 36.222222 | 73 | 0.705521 |
import os, time
import wiredtiger, wttest
from helper import complex_populate, simple_populate
from wtscenario import make_scenarios
class test_upgrade(wttest.WiredTigerTestCase):
name = 'test_upgrade'
scenarios = make_scenarios([
('file', dict(uri='file:')),
('ta... | true | true |
1c2e3fb6bad79b1aacdb5023df3f230ddeafaff8 | 863 | py | Python | tests/conftest.py | radarlabs/radar-python | 5b9a61bda3e405565eb16d76b120cc27f7a2a7b3 | [
"MIT"
] | 8 | 2020-03-16T18:14:49.000Z | 2021-01-26T20:27:54.000Z | tests/conftest.py | radarlabs/radar-python | 5b9a61bda3e405565eb16d76b120cc27f7a2a7b3 | [
"MIT"
] | 1 | 2020-03-21T19:54:49.000Z | 2020-03-21T19:54:49.000Z | tests/conftest.py | radarlabs/radar-python | 5b9a61bda3e405565eb16d76b120cc27f7a2a7b3 | [
"MIT"
] | 3 | 2020-07-02T00:31:26.000Z | 2020-08-26T08:20:35.000Z | import os
import json
import pytest
from radar import RadarClient
MOCK_DATA_PATH = "tests/mock_data/{file_name}"
class TestHelpers:
def load_mock_data(file_name):
json_path = MOCK_DATA_PATH.format(file_name=file_name)
with open(json_path) as f:
return json.load(f)
@pytest.fixture(... | 20.547619 | 72 | 0.73117 | import os
import json
import pytest
from radar import RadarClient
MOCK_DATA_PATH = "tests/mock_data/{file_name}"
class TestHelpers:
def load_mock_data(file_name):
json_path = MOCK_DATA_PATH.format(file_name=file_name)
with open(json_path) as f:
return json.load(f)
@pytest.fixture(... | true | true |
1c2e403be24638bc95e9583ee92456a7ed4bf692 | 487 | py | Python | src/CELERY/wsgi.py | terean-dspd/django-celery-celerybeat-ubuntu-deamon-example | 162a8d50ba03146137225d029f6102efcf53aaf2 | [
"MIT"
] | 1 | 2018-02-03T18:24:48.000Z | 2018-02-03T18:24:48.000Z | src/CELERY/wsgi.py | terean-dspd/django-celery-celerybeat-ubuntu-deamon-example | 162a8d50ba03146137225d029f6102efcf53aaf2 | [
"MIT"
] | null | null | null | src/CELERY/wsgi.py | terean-dspd/django-celery-celerybeat-ubuntu-deamon-example | 162a8d50ba03146137225d029f6102efcf53aaf2 | [
"MIT"
] | null | null | null | """
WSGI config for CELERY project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/2.0/howto/deployment/wsgi/
"""
import os
import sys
path = '/home/dennis/myproject/src'
if path not in sys.path:
sys.path.app... | 23.190476 | 78 | 0.770021 |
import os
import sys
path = '/home/dennis/myproject/src'
if path not in sys.path:
sys.path.append(path)
from django.core.wsgi import get_wsgi_application
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "CELERY.settings")
application = get_wsgi_application()
| true | true |
1c2e405d8358df0c72f1ce7fb8b607ea11f4d86b | 747 | py | Python | src/profiles/migrations/0008_document.py | MisaelMvM/bookAnalytics-ACC-Project | 954eb47f19c5fd83abbc46a6224dc588dbd20887 | [
"MIT"
] | null | null | null | src/profiles/migrations/0008_document.py | MisaelMvM/bookAnalytics-ACC-Project | 954eb47f19c5fd83abbc46a6224dc588dbd20887 | [
"MIT"
] | null | null | null | src/profiles/migrations/0008_document.py | MisaelMvM/bookAnalytics-ACC-Project | 954eb47f19c5fd83abbc46a6224dc588dbd20887 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by Django 1.10.5 on 2017-05-14 20:33
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('profiles', '0007_auto_20170513_2020'),
]
operations = [
migrations.CreateMo... | 29.88 | 114 | 0.603748 |
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('profiles', '0007_auto_20170513_2020'),
]
operations = [
migrations.CreateModel(
name='Document',
fields=[
... | true | true |
1c2e40e328bf407c26f76e9787a116626dbf5a00 | 932 | py | Python | docs/build/html/xas/xas_ft-5.py | marcoalsina/araucaria | 78039106ae27d3fdef9265503c33f33992199d8e | [
"BSD-2-Clause"
] | 8 | 2021-07-11T22:54:21.000Z | 2022-02-16T20:22:25.000Z | docs/build/html/xas/xas_ft-5.py | marcoalsina/araucaria | 78039106ae27d3fdef9265503c33f33992199d8e | [
"BSD-2-Clause"
] | null | null | null | docs/build/html/xas/xas_ft-5.py | marcoalsina/araucaria | 78039106ae27d3fdef9265503c33f33992199d8e | [
"BSD-2-Clause"
] | null | null | null | from numpy import arange, sin, pi
from scipy.fftpack import fftfreq
from araucaria.xas import ftwindow, xftf_kwin, xftr_kwin
nfft = 2048 # number of points for FFT
ks = 0.05 # delta k (angstrom^-1)
f1 = 0.5 # freq1 (angstrom)
k = arange(0, 10, ks)
wink = ftwindow(k, x_range=(0,10), dx1=0.5, win='sine')
chi ... | 33.285714 | 63 | 0.680258 | from numpy import arange, sin, pi
from scipy.fftpack import fftfreq
from araucaria.xas import ftwindow, xftf_kwin, xftr_kwin
nfft = 2048
ks = 0.05
f1 = 0.5
k = arange(0, 10, ks)
wink = ftwindow(k, x_range=(0,10), dx1=0.5, win='sine')
chi = 0.5*sin(2*pi*k*f1)
chir = xftf_kwin(wink*chi, nfft=nfft, kstep=ks... | true | true |
1c2e40f354a326634308047ef393dea19c9186a2 | 7,291 | py | Python | kolibri/core/analytics/measurements.py | priyanka-choubey/kolibri | 4070dc158634ab47c6e127768f0aed7548c0a182 | [
"MIT"
] | 2 | 2021-05-13T10:20:46.000Z | 2021-11-15T12:31:03.000Z | kolibri/core/analytics/measurements.py | priyanka-choubey/kolibri | 4070dc158634ab47c6e127768f0aed7548c0a182 | [
"MIT"
] | 3 | 2021-03-10T08:57:45.000Z | 2021-09-02T07:03:34.000Z | kolibri/core/analytics/measurements.py | priyanka-choubey/kolibri | 4070dc158634ab47c6e127768f0aed7548c0a182 | [
"MIT"
] | 1 | 2019-12-04T12:26:16.000Z | 2019-12-04T12:26:16.000Z | import time
from collections import namedtuple
from datetime import timedelta
import requests
from django.contrib.sessions.models import Session
from django.db import connection
from django.db.models import Count
from django.db.models import Sum
from django.db.utils import OperationalError
from django.utils import tim... | 34.885167 | 113 | 0.645728 | import time
from collections import namedtuple
from datetime import timedelta
import requests
from django.contrib.sessions.models import Session
from django.db import connection
from django.db.models import Count
from django.db.models import Sum
from django.db.utils import OperationalError
from django.utils import tim... | true | true |
1c2e4108dea4f61e84c54e7da24a415af6455d96 | 15,581 | py | Python | model/metric.py | bhadreshpsavani/TAPER-EHR | ab938749756fcaaef52a7002a074421f483e3562 | [
"MIT"
] | 12 | 2020-04-10T02:24:20.000Z | 2021-11-09T22:52:24.000Z | model/metric.py | bhadreshpsavani/TAPER-EHR | ab938749756fcaaef52a7002a074421f483e3562 | [
"MIT"
] | 7 | 2020-05-03T10:03:29.000Z | 2022-02-09T23:38:21.000Z | model/metric.py | bhadreshpsavani/TAPER-EHR | ab938749756fcaaef52a7002a074421f483e3562 | [
"MIT"
] | 10 | 2020-06-14T09:37:35.000Z | 2022-02-04T22:21:16.000Z | import torch
from sklearn.metrics import roc_auc_score, average_precision_score, roc_curve, auc, roc_curve, precision_recall_curve
def roc_auc(output,target):
# temporary place holders..
# these will be run at the end of the epoch once all probabilities are obtained..
# refer to pr_auc_1
#output = out... | 30.611002 | 117 | 0.546627 | import torch
from sklearn.metrics import roc_auc_score, average_precision_score, roc_curve, auc, roc_curve, precision_recall_curve
def roc_auc(output,target):
return 1.0
def pr_auc(output, target):
return 1.0
def roc_auc_1(ou... | true | true |
1c2e41dd856bb7d1bb94896fc537c0a340c99cdb | 1,800 | py | Python | marrow/mailer/transport/ses.py | digiturtle/mailer | 3b718f415a4a955ba0fdb7e7ae135c0ab1f9d900 | [
"MIT"
] | 1 | 2019-02-13T12:40:30.000Z | 2019-02-13T12:40:30.000Z | marrow/mailer/transport/ses.py | digiturtle/mailer | 3b718f415a4a955ba0fdb7e7ae135c0ab1f9d900 | [
"MIT"
] | 1 | 2021-03-24T13:02:56.000Z | 2021-03-24T16:27:14.000Z | marrow/mailer/transport/ses.py | LexMachinaInc/mailer | 5b144797a412f4816ecc25f237a6ebc0737f6897 | [
"MIT"
] | 1 | 2018-03-29T19:11:45.000Z | 2018-03-29T19:11:45.000Z | # encoding: utf-8
try:
import boto.ses
from boto.ses import SESConnection
except ImportError:
raise ImportError("You must install the boto package to deliver mail via Amazon SES.")
__all__ = ['AmazonTransport']
log = __import__('logging').getLogger(__name__)
class AmazonTransport(object): # pragma:... | 34.615385 | 106 | 0.628333 |
try:
import boto.ses
from boto.ses import SESConnection
except ImportError:
raise ImportError("You must install the boto package to deliver mail via Amazon SES.")
__all__ = ['AmazonTransport']
log = __import__('logging').getLogger(__name__)
class AmazonTransport(object):
__slots__ = ('ephemer... | true | true |
1c2e425b2fdcf310e1a53834ab48adeaac7c57cc | 388 | py | Python | datamodel_code_generator/model/pydantic/dataclass.py | adaamz/datamodel-code-generator | 3b34573f35f8d420e4668a85047c757fd1da7754 | [
"MIT"
] | 891 | 2019-07-23T04:23:32.000Z | 2022-03-31T13:36:33.000Z | datamodel_code_generator/model/pydantic/dataclass.py | adaamz/datamodel-code-generator | 3b34573f35f8d420e4668a85047c757fd1da7754 | [
"MIT"
] | 663 | 2019-07-23T09:50:26.000Z | 2022-03-29T01:56:55.000Z | datamodel_code_generator/model/pydantic/dataclass.py | adaamz/datamodel-code-generator | 3b34573f35f8d420e4668a85047c757fd1da7754 | [
"MIT"
] | 108 | 2019-07-23T08:50:37.000Z | 2022-03-09T10:50:22.000Z | from typing import ClassVar, Tuple
from datamodel_code_generator.imports import Import
from datamodel_code_generator.model import DataModel
from datamodel_code_generator.model.pydantic.imports import IMPORT_DATACLASS
class DataClass(DataModel):
TEMPLATE_FILE_PATH: ClassVar[str] = 'pydantic/dataclass.jinja2'
... | 35.272727 | 76 | 0.822165 | from typing import ClassVar, Tuple
from datamodel_code_generator.imports import Import
from datamodel_code_generator.model import DataModel
from datamodel_code_generator.model.pydantic.imports import IMPORT_DATACLASS
class DataClass(DataModel):
TEMPLATE_FILE_PATH: ClassVar[str] = 'pydantic/dataclass.jinja2'
... | true | true |
1c2e4387f8d476e9d7aadd89fb94f15969de13b9 | 769 | py | Python | supreme/lib/klt/setup.py | KirillDZR/supreme | c296722599363bd0cbcce6877bd9de9b066cb74b | [
"BSD-3-Clause"
] | 95 | 2015-01-17T09:48:20.000Z | 2021-11-07T16:02:38.000Z | supreme/lib/klt/setup.py | KirillDZR/supreme | c296722599363bd0cbcce6877bd9de9b066cb74b | [
"BSD-3-Clause"
] | 4 | 2015-10-23T15:13:34.000Z | 2019-09-23T22:47:10.000Z | supreme/lib/klt/setup.py | KirillDZR/supreme | c296722599363bd0cbcce6877bd9de9b066cb74b | [
"BSD-3-Clause"
] | 34 | 2015-02-22T20:54:40.000Z | 2022-02-27T13:39:32.000Z | from supreme._build import CExtension
def configuration(parent_package='', top_path=None):
from numpy.distutils.misc_util import Configuration, get_numpy_include_dirs
config = Configuration('klt', parent_package, top_path)
config.ext_modules.append(CExtension('libklt_',
... | 40.473684 | 79 | 0.50065 | from supreme._build import CExtension
def configuration(parent_package='', top_path=None):
from numpy.distutils.misc_util import Configuration, get_numpy_include_dirs
config = Configuration('klt', parent_package, top_path)
config.ext_modules.append(CExtension('libklt_',
... | true | true |
1c2e4421cbf7299f4b6ac2145e779f62caffe157 | 939 | py | Python | data/test/python/1c2e4421cbf7299f4b6ac2145e779f62caffe157SecurityService.py | harshp8l/deep-learning-lang-detection | 2a54293181c1c2b1a2b840ddee4d4d80177efb33 | [
"MIT"
] | 84 | 2017-10-25T15:49:21.000Z | 2021-11-28T21:25:54.000Z | data/test/python/1c2e4421cbf7299f4b6ac2145e779f62caffe157SecurityService.py | vassalos/deep-learning-lang-detection | cbb00b3e81bed3a64553f9c6aa6138b2511e544e | [
"MIT"
] | 5 | 2018-03-29T11:50:46.000Z | 2021-04-26T13:33:18.000Z | data/test/python/1c2e4421cbf7299f4b6ac2145e779f62caffe157SecurityService.py | vassalos/deep-learning-lang-detection | cbb00b3e81bed3a64553f9c6aa6138b2511e544e | [
"MIT"
] | 24 | 2017-11-22T08:31:00.000Z | 2022-03-27T01:22:31.000Z | # _*_ coding:utf-8 _*_
from web.broker.Brokers import Broker
__author__ = 'Administrator'
class SecurityService(object):
def __init__(self):
pass
'''杀毒'''
def antivirus(self, hostKey, path):
broker = Broker.getBroker(hostKey)
return broker.antivirus(path)
'''取消ip限制'''
... | 20.413043 | 42 | 0.610224 |
from web.broker.Brokers import Broker
__author__ = 'Administrator'
class SecurityService(object):
def __init__(self):
pass
def antivirus(self, hostKey, path):
broker = Broker.getBroker(hostKey)
return broker.antivirus(path)
def ipOpen(self, hostKey, ip):
broker = Brok... | true | true |
1c2e4429e2fc1fc28a8adeeca84d861f861b453c | 8,192 | py | Python | sudoku.py | bryanlimy/samurai-sudoku-solver | 2b3e1f0dfe2c1cf352df375633ca70981d7968bf | [
"MIT"
] | 7 | 2017-07-23T13:19:31.000Z | 2021-11-14T11:08:27.000Z | sudoku.py | bryanlimy/samurai-sudoku-solver | 2b3e1f0dfe2c1cf352df375633ca70981d7968bf | [
"MIT"
] | null | null | null | sudoku.py | bryanlimy/samurai-sudoku-solver | 2b3e1f0dfe2c1cf352df375633ca70981d7968bf | [
"MIT"
] | 2 | 2019-03-14T21:07:55.000Z | 2021-09-18T14:47:52.000Z | ## Solve Every Sudoku Puzzle
## See http://norvig.com/sudoku.html
## Throughout this program we have:
## r is a row, e.g. 'A'
## c is a column, e.g. '3'
## s is a square, e.g. 'A3'
## d is a digit, e.g. '9'
## u is a unit, e.g. ['A1','B1','C1','D1','E1','F1','G1','H1','I1']
## grid is a gr... | 41.165829 | 150 | 0.561768 | ss(rs, cs) for rs in ('ABC','DEF','GHI') for cs in ('123','456','789')])
units = dict((s, [u for u in unitlist if s in u])
for s in squares)
peers = dict((s, set(sum(units[s],[]))-set([s]))
for s in squares)
################ Unit Tests ################
def test():
assert len(squ... | true | true |
1c2e447c8ebd033d153d63b0073ddd1fecc39a3c | 52,937 | py | Python | sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_p2_svpn_gateways_operations.py | beltr0n/azure-sdk-for-python | 2f7fb8bee881b0fc0386a0ad5385755ceedd0453 | [
"MIT"
] | 2 | 2021-03-24T06:26:11.000Z | 2021-04-18T15:55:59.000Z | sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_p2_svpn_gateways_operations.py | beltr0n/azure-sdk-for-python | 2f7fb8bee881b0fc0386a0ad5385755ceedd0453 | [
"MIT"
] | 4 | 2019-04-17T17:57:49.000Z | 2020-04-24T21:11:22.000Z | sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_p2_svpn_gateways_operations.py | beltr0n/azure-sdk-for-python | 2f7fb8bee881b0fc0386a0ad5385755ceedd0453 | [
"MIT"
] | 2 | 2021-05-23T16:46:31.000Z | 2021-05-26T23:51:09.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 ... | 50.272555 | 248 | 0.66768 |
from typing import TYPE_CHECKING
import warnings
from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error
from azure.core.paging import ItemPaged
from azure.core.pipeline import PipelineResponse
from azure.core.pipeline.transport impor... | true | true |
1c2e44acca47cb034eaa829d2aea0746a82c253c | 271 | py | Python | tz_detect/utils.py | dkirkham/django-tz-detect | ec3c66a967e2518adf070bfd42a9076471f1bc2a | [
"MIT"
] | null | null | null | tz_detect/utils.py | dkirkham/django-tz-detect | ec3c66a967e2518adf070bfd42a9076471f1bc2a | [
"MIT"
] | null | null | null | tz_detect/utils.py | dkirkham/django-tz-detect | ec3c66a967e2518adf070bfd42a9076471f1bc2a | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
def convert_header_name(django_header):
"""Converts header name from django settings to real header name.
For example:
'HTTP_CUSTOM_CSRF' -> 'custom-csrf'
"""
return django_header.lower().replace('_', '-').split('http-')[-1]
| 27.1 | 69 | 0.645756 |
def convert_header_name(django_header):
return django_header.lower().replace('_', '-').split('http-')[-1]
| true | true |
1c2e44c4a90f8779ad9a447ea28d87f5a7458299 | 3,107 | py | Python | cannabis/protocols/timelord_protocol.py | CannabisChain/cannabis-blockchain | 6a1dc045cdcca45d0ffdcbdebe805c49f04b3faf | [
"Apache-2.0"
] | 12 | 2021-07-24T14:50:56.000Z | 2022-02-09T04:28:28.000Z | cannabis/protocols/timelord_protocol.py | CannabisChain/cannabis-blockchain | 6a1dc045cdcca45d0ffdcbdebe805c49f04b3faf | [
"Apache-2.0"
] | 27 | 2021-07-23T15:16:41.000Z | 2022-03-22T10:11:23.000Z | cannabis/protocols/timelord_protocol.py | CannabisChain/cannabis-blockchain | 6a1dc045cdcca45d0ffdcbdebe805c49f04b3faf | [
"Apache-2.0"
] | 7 | 2021-07-23T15:48:54.000Z | 2022-01-20T20:03:51.000Z | from dataclasses import dataclass
from typing import List, Optional, Tuple
from cannabis.types.blockchain_format.foliage import Foliage
from cannabis.types.blockchain_format.reward_chain_block import RewardChainBlock, RewardChainBlockUnfinished
from cannabis.types.blockchain_format.sized_bytes import bytes32
from cann... | 33.771739 | 120 | 0.801738 | from dataclasses import dataclass
from typing import List, Optional, Tuple
from cannabis.types.blockchain_format.foliage import Foliage
from cannabis.types.blockchain_format.reward_chain_block import RewardChainBlock, RewardChainBlockUnfinished
from cannabis.types.blockchain_format.sized_bytes import bytes32
from cann... | true | true |
1c2e460373f0cb1f36cd06f1a55dcf13a8557ea3 | 4,052 | py | Python | src/batch_runner/net_eval_batch.py | haleqiu/TLIO | d4fea31517fb8db662dc14c388a792217b172e64 | [
"BSD-3-Clause"
] | 127 | 2020-06-15T18:16:09.000Z | 2022-03-28T08:57:18.000Z | src/batch_runner/net_eval_batch.py | ori-drs/tlio | 259247bea2e10bf47922071d235b7f80d7685e61 | [
"BSD-3-Clause"
] | 12 | 2020-10-01T14:38:04.000Z | 2022-03-14T10:11:11.000Z | src/batch_runner/net_eval_batch.py | ori-drs/tlio | 259247bea2e10bf47922071d235b7f80d7685e61 | [
"BSD-3-Clause"
] | 38 | 2020-06-15T18:46:41.000Z | 2022-03-06T09:33:58.000Z | import argparse
import json
import os
import os.path as osp
import subprocess as sp
from pathlib import Path
from utils.logging import logging
homedir = Path.home()
if __name__ == "__main__":
parser = argparse.ArgumentParser()
# ----------------------- io params -----------------------
io_groups = parser... | 28.942857 | 84 | 0.439289 | import argparse
import json
import os
import os.path as osp
import subprocess as sp
from pathlib import Path
from utils.logging import logging
homedir = Path.home()
if __name__ == "__main__":
parser = argparse.ArgumentParser()
io_groups = parser.add_argument_group("io")
io_groups.add_argument(
... | true | true |
1c2e467cd4fc6eaf6552db91bf2a99fe684155dc | 2,670 | py | Python | bingo/Base/MuPlusLambdaEA.py | tylertownsend/bingo | 0aeebe03df71a632f833c56ceb9c697dddbe78fc | [
"Apache-2.0"
] | null | null | null | bingo/Base/MuPlusLambdaEA.py | tylertownsend/bingo | 0aeebe03df71a632f833c56ceb9c697dddbe78fc | [
"Apache-2.0"
] | null | null | null | bingo/Base/MuPlusLambdaEA.py | tylertownsend/bingo | 0aeebe03df71a632f833c56ceb9c697dddbe78fc | [
"Apache-2.0"
] | null | null | null | """The "Mu + Lambda"
This module defines the basis of the "mu plus lambda"
evolutionary algorithm in bingo analyses. The next generation
is evaluated and selected from both the parent and offspring
populations.
"""
from .EvolutionaryAlgorithm import EvolutionaryAlgorithm
from .VarOr import VarOr
class MuPlusLambda(E... | 37.605634 | 74 | 0.623596 | from .EvolutionaryAlgorithm import EvolutionaryAlgorithm
from .VarOr import VarOr
class MuPlusLambda(EvolutionaryAlgorithm):
def __init__(self, evaluation, selection, crossover, mutation,
crossover_probability, mutation_probability,
number_offspring):
super().__init__(var... | true | true |
1c2e4716e42cad5bc4c78a3108ee05cc872214b3 | 21,852 | py | Python | neurox/interpretation/utils.py | davidarps/NeuroX | 591cabce7a317d2a1ff2b07e6a3b277250815454 | [
"BSD-3-Clause"
] | null | null | null | neurox/interpretation/utils.py | davidarps/NeuroX | 591cabce7a317d2a1ff2b07e6a3b277250815454 | [
"BSD-3-Clause"
] | null | null | null | neurox/interpretation/utils.py | davidarps/NeuroX | 591cabce7a317d2a1ff2b07e6a3b277250815454 | [
"BSD-3-Clause"
] | null | null | null | import math
import numpy as np
from imblearn.under_sampling import RandomUnderSampler
def isnotebook():
"""
Utility function to detect if the code being run is within a jupyter
notebook. Useful to change progress indicators for example.
Returns
-------
isnotebook : bool
True if the fu... | 34.9632 | 141 | 0.610608 | import math
import numpy as np
from imblearn.under_sampling import RandomUnderSampler
def isnotebook():
try:
shell = get_ipython().__class__.__name__
if shell == "ZMQInteractiveShell":
return True
elif shell == "TerminalInteractiveShell":
return False
el... | true | true |
1c2e478bdfe0ea24a0b1714571dfbbe8815e468a | 6,584 | py | Python | share/common/utils/restcall.py | onap/multicloud-openstack | d0e41eb1b1a1cb79365836da728908ed26253db4 | [
"CC-BY-4.0"
] | 4 | 2018-10-24T15:20:14.000Z | 2020-03-09T06:29:11.000Z | share/common/utils/restcall.py | onap/multicloud-openstack | d0e41eb1b1a1cb79365836da728908ed26253db4 | [
"CC-BY-4.0"
] | null | null | null | share/common/utils/restcall.py | onap/multicloud-openstack | d0e41eb1b1a1cb79365836da728908ed26253db4 | [
"CC-BY-4.0"
] | 2 | 2020-08-03T13:45:44.000Z | 2021-09-15T21:10:26.000Z | # Copyright (c) 2017-2018 Wind River Systems, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at:
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | 36.782123 | 94 | 0.609356 |
import six
import base64
import codecs
import json
import traceback
import sys
import logging
from six.moves import urllib
import httplib2
import uuid
from rest_framework import status
from django.conf import settings
from common.utils import aai_cache
rest_no_auth, rest_oneway_auth, rest_bothway_auth =... | true | true |
1c2e47c00a8520777c086214fe06e3a52f73817f | 21,859 | py | Python | readtwice/models/trivia_qa/preprocess_lib.py | shaun95/google-research | d41bbaca1eb9bfd980ec2b3fd201c3ddb4d1f2e5 | [
"Apache-2.0"
] | 1 | 2022-03-13T21:48:52.000Z | 2022-03-13T21:48:52.000Z | readtwice/models/trivia_qa/preprocess_lib.py | shaun95/google-research | d41bbaca1eb9bfd980ec2b3fd201c3ddb4d1f2e5 | [
"Apache-2.0"
] | null | null | null | readtwice/models/trivia_qa/preprocess_lib.py | shaun95/google-research | d41bbaca1eb9bfd980ec2b3fd201c3ddb4d1f2e5 | [
"Apache-2.0"
] | 1 | 2022-03-30T07:20:29.000Z | 2022-03-30T07:20:29.000Z | # coding=utf-8
# Copyright 2022 The Google Research Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicab... | 38.964349 | 87 | 0.679308 |
import json
import os
import re
import string
from typing import Any, Iterator, List, Optional, Set, Text, Tuple
import apache_beam as beam
from apache_beam import metrics
import dataclasses
import nltk
import tensorflow.compat.v1 as tf
from readtwice.data_utils import beam_utils
from readtwice.data_ut... | true | true |
1c2e47c636c1783dcf57665f6534a758cd499e93 | 520 | py | Python | Dependencies/gyp-master/test/win/gyptest-midl-includedirs.py | knight666/exlibris | b21b46e0c84e5c4f81f8048022cda88e7bb3dca2 | [
"MIT"
] | null | null | null | Dependencies/gyp-master/test/win/gyptest-midl-includedirs.py | knight666/exlibris | b21b46e0c84e5c4f81f8048022cda88e7bb3dca2 | [
"MIT"
] | null | null | null | Dependencies/gyp-master/test/win/gyptest-midl-includedirs.py | knight666/exlibris | b21b46e0c84e5c4f81f8048022cda88e7bb3dca2 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# Copyright (c) 2014 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""
Verify that 'midl_include_dirs' is handled.
"""
import TestGyp
import sys
if sys.platform == 'win32':
test = TestGyp... | 23.636364 | 73 | 0.682692 |
import TestGyp
import sys
if sys.platform == 'win32':
test = TestGyp.TestGyp(formats=['msvs', 'ninja'])
CHDIR = 'idl-includedirs'
test.run_gyp('idl-includedirs.gyp', chdir=CHDIR)
test.build('idl-includedirs.gyp', test.ALL, chdir=CHDIR)
test.pass_test()
| true | true |
1c2e490b3e72e07c39bc7fa5d700e8208b53f383 | 6,264 | py | Python | server.py | itssathya/techathon-product-development | 4c0a4e79e194837628996a6b00cc1d97c7442fb3 | [
"MIT"
] | null | null | null | server.py | itssathya/techathon-product-development | 4c0a4e79e194837628996a6b00cc1d97c7442fb3 | [
"MIT"
] | null | null | null | server.py | itssathya/techathon-product-development | 4c0a4e79e194837628996a6b00cc1d97c7442fb3 | [
"MIT"
] | null | null | null | from flask import Flask, render_template,request,redirect,url_for,flash,session,g
from dbCode import loginVerify,addUser,studentPopulateClasses,ownerPopulateClasses,retrieveClassData,addClass,joinClassroom,allUsers,deleteUserDB,findClass
from examDB import createTestDB,createAssignmentDB
app = Flask(__name__)
app.secr... | 35.794286 | 155 | 0.64288 | from flask import Flask, render_template,request,redirect,url_for,flash,session,g
from dbCode import loginVerify,addUser,studentPopulateClasses,ownerPopulateClasses,retrieveClassData,addClass,joinClassroom,allUsers,deleteUserDB,findClass
from examDB import createTestDB,createAssignmentDB
app = Flask(__name__)
app.secr... | true | true |
1c2e4918ba1a3933f30f85a9410175d9db93dd40 | 16,898 | py | Python | dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numba/tests/test_nrt.py | jeikabu/lumberyard | 07228c605ce16cbf5aaa209a94a3cb9d6c1a4115 | [
"AML"
] | 8 | 2019-10-07T16:33:47.000Z | 2020-12-07T03:59:58.000Z | dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numba/tests/test_nrt.py | jeikabu/lumberyard | 07228c605ce16cbf5aaa209a94a3cb9d6c1a4115 | [
"AML"
] | 1 | 2017-12-21T23:31:59.000Z | 2017-12-29T16:56:05.000Z | dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numba/tests/test_nrt.py | jeikabu/lumberyard | 07228c605ce16cbf5aaa209a94a3cb9d6c1a4115 | [
"AML"
] | 5 | 2020-08-27T20:44:18.000Z | 2021-08-21T22:54:11.000Z | from __future__ import absolute_import, division, print_function
import math
import os
import sys
import re
import numpy as np
from numba import unittest_support as unittest
from numba import njit
from numba.compiler import compile_isolated, Flags, types
from numba.runtime import rtsys
from numba.runtime import nrto... | 35.351464 | 909 | 0.59439 | from __future__ import absolute_import, division, print_function
import math
import os
import sys
import re
import numpy as np
from numba import unittest_support as unittest
from numba import njit
from numba.compiler import compile_isolated, Flags, types
from numba.runtime import rtsys
from numba.runtime import nrto... | true | true |
1c2e4c0a10f3cb8b077049e6c82ff994b4f0e5e5 | 15,130 | py | Python | rliable/library.py | DennisSoemers/rliable | 9f4c97d59196b70518f1ee3ba6d4f03a302c3241 | [
"Apache-2.0"
] | 361 | 2021-08-20T00:45:20.000Z | 2022-03-31T15:59:54.000Z | rliable/library.py | DennisSoemers/rliable | 9f4c97d59196b70518f1ee3ba6d4f03a302c3241 | [
"Apache-2.0"
] | 7 | 2021-09-04T00:37:39.000Z | 2022-01-31T19:21:45.000Z | rliable/library.py | DennisSoemers/rliable | 9f4c97d59196b70518f1ee3ba6d4f03a302c3241 | [
"Apache-2.0"
] | 22 | 2021-08-31T22:09:22.000Z | 2022-03-10T01:21:36.000Z | # coding=utf-8
# Copyright 2021 The Rliable 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... | 42.619718 | 80 | 0.706345 |
from typing import Callable, Dict, List, Optional, Tuple, Union, Mapping
from absl import logging
import arch.bootstrap as arch_bs
import numpy as np
from numpy import random
Float = Union[float, np.float32, np.float64]
args_shapes = {key: val.shape for key, val in self._kwargs.items()}
self._args_... | true | true |
1c2e4c6f4061b20735d75dc5ba9f1d42d8f45267 | 3,535 | py | Python | zvt/tag/tags/cycle_tag.py | KtineXu/zvt | 3c1fdbb1c579225a59567ff211001f3c2c16a915 | [
"MIT"
] | null | null | null | zvt/tag/tags/cycle_tag.py | KtineXu/zvt | 3c1fdbb1c579225a59567ff211001f3c2c16a915 | [
"MIT"
] | null | null | null | zvt/tag/tags/cycle_tag.py | KtineXu/zvt | 3c1fdbb1c579225a59567ff211001f3c2c16a915 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from enum import Enum
from zvt.domain import Stock, BlockStock, Block
from zvt.tag.dataset.stock_tags import StockTags
from zvt.tag.tag import StockTagger
class CycleTag(Enum):
# 强周期
strong_cycle = 'strong_cycle'
# 弱周期
weak_cycle = 'weak_cycle'
# 非周期,受周期影响不大,比如消费,医药
no... | 44.746835 | 116 | 0.584724 |
from enum import Enum
from zvt.domain import Stock, BlockStock, Block
from zvt.tag.dataset.stock_tags import StockTags
from zvt.tag.tag import StockTagger
class CycleTag(Enum):
strong_cycle = 'strong_cycle'
weak_cycle = 'weak_cycle'
non_cycle = 'non_cycle'
cycle_map_industry = {
... | true | true |
1c2e4c7dbc3b5f88af53b55c65475ce89c3a4685 | 11,268 | py | Python | venv/Lib/site-packages/gevent/lock.py | asanka9/Quession-Discussion-App-Socket.Io-NLP | 95a49a8afa572dc3908a0bade45e424c3751f191 | [
"Apache-2.0"
] | 6 | 2020-08-04T13:12:42.000Z | 2020-08-16T13:26:19.000Z | venv/Lib/site-packages/gevent/lock.py | asanka9/Quession-Discussion-App-Socket.Io-NLP | 95a49a8afa572dc3908a0bade45e424c3751f191 | [
"Apache-2.0"
] | null | null | null | venv/Lib/site-packages/gevent/lock.py | asanka9/Quession-Discussion-App-Socket.Io-NLP | 95a49a8afa572dc3908a0bade45e424c3751f191 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2009-2012 Denis Bilenko. See LICENSE for details.
"""
Locking primitives.
These include semaphores with arbitrary bounds (:class:`Semaphore` and
its safer subclass :class:`BoundedSemaphore`) and a semaphore with
infinite bounds (:class:`DummySemaphore`), along with a reentrant lock
(:class:`RLock`) wit... | 29.888594 | 100 | 0.631434 |
from __future__ import absolute_import
from gevent.hub import getcurrent
from gevent._compat import PURE_PYTHON
from gevent._compat import PY2
from gevent import monkey
from gevent._semaphore import Semaphore
from gevent._semaphore import BoundedSemaphore
__all__ = [
'Semaphore',
'BoundedSemaphore',
'... | true | true |
1c2e4db653cb665625fad9379f5532990b041c03 | 65,422 | py | Python | watertap3/watertap3/wt_units/ion_exchange.py | NREL/WaterTAP3 | 74b83dbd189784ccfddac4bc5d27002190473619 | [
"BSD-3-Clause"
] | null | null | null | watertap3/watertap3/wt_units/ion_exchange.py | NREL/WaterTAP3 | 74b83dbd189784ccfddac4bc5d27002190473619 | [
"BSD-3-Clause"
] | 34 | 2021-06-25T17:54:12.000Z | 2021-06-25T17:54:27.000Z | watertap3/watertap3/wt_units/ion_exchange.py | NREL/WaterTAP3 | 74b83dbd189784ccfddac4bc5d27002190473619 | [
"BSD-3-Clause"
] | 4 | 2021-06-25T18:32:31.000Z | 2022-03-24T20:24:18.000Z | import pandas as pd
from pyomo.environ import *
from pyomo.environ import units as pyunits
from pyomo.repn.plugins.baron_writer import NonNegativeReals
from watertap3.utils import financials
from watertap3.wt_units.wt_unit import WT3UnitProcess
## REFERENCE: ADD REFERENCE HERE
module_name = 'ion_exchange'
basis_year... | 49.300678 | 248 | 0.493978 | import pandas as pd
from pyomo.environ import *
from pyomo.environ import units as pyunits
from pyomo.repn.plugins.baron_writer import NonNegativeReals
from watertap3.utils import financials
from watertap3.wt_units.wt_unit import WT3UnitProcess
basis_year = 2016
tpec_or_tic = 'TIC'
class UnitProcess(WT3UnitProcess... | true | true |
1c2e4df7b8e87e20fc2ffdcee9c0190fe573eba3 | 9,042 | py | Python | src/scripts/gamma_filter.py | xuanxiaoliqu/CRC4Docker | 5ee26f9a590b727693202d8ad3b6460970304bd9 | [
"MIT"
] | 1 | 2020-10-26T12:02:08.000Z | 2020-10-26T12:02:08.000Z | src/scripts/gamma_filter.py | TonyZPW/CRC4Docker | e52a6e88d4469284a071c0b96d009f6684dbb2ea | [
"MIT"
] | null | null | null | src/scripts/gamma_filter.py | TonyZPW/CRC4Docker | e52a6e88d4469284a071c0b96d009f6684dbb2ea | [
"MIT"
] | null | null | null | #!/usr/bin/env python
#******************************************************************************
# Name: gamma_filter.py
# Purpose: ; gamma MAP adaptive filtering for polarized SAR intensity images
# Ref: Oliver and Quegan (2004) Understanding SAR Images, Scitech
# Usage:
# py... | 36.906122 | 89 | 0.493143 |
import os, sys, time, getopt
import numpy as np
from osgeo import gdal
from osgeo.gdalconst import GDT_Float32, GA_ReadOnly
from ipyparallel import Client
def gamma_filter((k,inimage,rows,cols,m)):
from scipy.ndimage import zoom
def get_windex(j,cols):
windex = np.zeros(49,dtype=i... | false | true |
1c2e4e8ccd6bde2732204fcd388857bed85a4f35 | 1,147 | py | Python | tests/test_film.py | kiniadit/swapit-wrapper | 46ba13683f77b53575b3f10398288791ad863426 | [
"MIT"
] | null | null | null | tests/test_film.py | kiniadit/swapit-wrapper | 46ba13683f77b53575b3f10398288791ad863426 | [
"MIT"
] | null | null | null | tests/test_film.py | kiniadit/swapit-wrapper | 46ba13683f77b53575b3f10398288791ad863426 | [
"MIT"
] | null | null | null | import responses
from swapi_wrapper import Film, make_url
@responses.activate
def test_film_get(film_data):
responses.add(responses.GET, film_data['url'], json=film_data)
assert Film.resource_url == 'https://swapi.co/api/films/'
film = Film.get(1)
assert isinstance(film, Film)
assert film.title... | 26.674419 | 79 | 0.718396 | import responses
from swapi_wrapper import Film, make_url
@responses.activate
def test_film_get(film_data):
responses.add(responses.GET, film_data['url'], json=film_data)
assert Film.resource_url == 'https://swapi.co/api/films/'
film = Film.get(1)
assert isinstance(film, Film)
assert film.title... | true | true |
1c2e4f25610415e051c3646eb03b6dfb4efe06d5 | 235 | py | Python | atividade2/RetornarVerticesAdjacentes.py | mateus2810/atividadesIa | 0ffc816c962889fb9e0b9635692d616e46a0d0c5 | [
"Apache-2.0"
] | null | null | null | atividade2/RetornarVerticesAdjacentes.py | mateus2810/atividadesIa | 0ffc816c962889fb9e0b9635692d616e46a0d0c5 | [
"Apache-2.0"
] | null | null | null | atividade2/RetornarVerticesAdjacentes.py | mateus2810/atividadesIa | 0ffc816c962889fb9e0b9635692d616e46a0d0c5 | [
"Apache-2.0"
] | null | null | null | #Questão 7 - Retornar os vertes adjacentes
import numpy as np
matrixIa = [[0,5,0,0,15,2], [5,0,0,9,22,4], [0,0,0,13,1,0], [9,0,12,0,0,6], [15,22,1,0,0,0], [2,4,0,6,0,0]]
#Mostrar os vertes adjacentes ]
print(np.matrix(matrixIa))
| 26.111111 | 107 | 0.617021 |
import numpy as np
matrixIa = [[0,5,0,0,15,2], [5,0,0,9,22,4], [0,0,0,13,1,0], [9,0,12,0,0,6], [15,22,1,0,0,0], [2,4,0,6,0,0]]
print(np.matrix(matrixIa))
| true | true |
1c2e5066f3b9c3767bdcfbe8c26f9f81315452be | 372 | py | Python | app/core/migrations/0002_user_is_staff.py | EdgarGGamartgo/recipe-app-api | e1749710b61bd1478527cc6d0415f335b914eb70 | [
"MIT"
] | null | null | null | app/core/migrations/0002_user_is_staff.py | EdgarGGamartgo/recipe-app-api | e1749710b61bd1478527cc6d0415f335b914eb70 | [
"MIT"
] | null | null | null | app/core/migrations/0002_user_is_staff.py | EdgarGGamartgo/recipe-app-api | e1749710b61bd1478527cc6d0415f335b914eb70 | [
"MIT"
] | null | null | null | # Generated by Django 3.0.8 on 2020-07-28 02:04
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('core', '0001_initial'),
]
operations = [
migrations.AddField(
model_name='user',
name='is_staff',
field=... | 19.578947 | 52 | 0.583333 |
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('core', '0001_initial'),
]
operations = [
migrations.AddField(
model_name='user',
name='is_staff',
field=models.BooleanField(default=True),
),
... | true | true |
1c2e50d3f6208bc987f1ae48612865cc8e89d195 | 5,112 | py | Python | pelayanan/views.py | diaksizz/Adisatya | 1b20e523aede6ab3e8effb1ca63adf72016a6839 | [
"MIT"
] | null | null | null | pelayanan/views.py | diaksizz/Adisatya | 1b20e523aede6ab3e8effb1ca63adf72016a6839 | [
"MIT"
] | 7 | 2021-03-30T14:04:35.000Z | 2022-01-13T03:07:50.000Z | pelayanan/views.py | diaksizz/Adisatya | 1b20e523aede6ab3e8effb1ca63adf72016a6839 | [
"MIT"
] | null | null | null | from django.shortcuts import render, redirect
from django.http import HttpResponse
from django.contrib import messages
from django.contrib.auth.decorators import login_required
from aitc_service.views import *
from aitc_service.forms import *
from .forms import *
from .models import *
from .filters import PelayananFi... | 35.748252 | 124 | 0.676839 | from django.shortcuts import render, redirect
from django.http import HttpResponse
from django.contrib import messages
from django.contrib.auth.decorators import login_required
from aitc_service.views import *
from aitc_service.forms import *
from .forms import *
from .models import *
from .filters import PelayananFi... | true | true |
1c2e511591999b44847ebd94d2fabef97267fc38 | 1,510 | py | Python | local/lib/python3.6/site-packages/pgadmin4/pgadmin/browser/server_groups/servers/pgagent/tests/tests_pgagent_get.py | sahilsdei/django_ecommerce | edc2513e41aca178d1ccae14ebaa6c7b1d709e73 | [
"MIT"
] | null | null | null | local/lib/python3.6/site-packages/pgadmin4/pgadmin/browser/server_groups/servers/pgagent/tests/tests_pgagent_get.py | sahilsdei/django_ecommerce | edc2513e41aca178d1ccae14ebaa6c7b1d709e73 | [
"MIT"
] | null | null | null | local/lib/python3.6/site-packages/pgadmin4/pgadmin/browser/server_groups/servers/pgagent/tests/tests_pgagent_get.py | sahilsdei/django_ecommerce | edc2513e41aca178d1ccae14ebaa6c7b1d709e73 | [
"MIT"
] | null | null | null | ##########################################################################
#
# pgAdmin 4 - PostgreSQL Tools
#
# Copyright (C) 2013 - 2018, The pgAdmin Development Team
# This software is released under the PostgreSQL Licence
#
##########################################################################
import uuid
from ... | 32.826087 | 74 | 0.576159 | true | true | |
1c2e513ed9092fe958702b468646efc642b43f91 | 183 | py | Python | tests/datasets/test_ncbi.py | iwasakishuto/Keras-Imitation | 8ac0cd7c8912d49d13b19a0182ad534c0781fbfe | [
"MIT"
] | 4 | 2020-04-25T08:50:36.000Z | 2020-04-26T04:49:16.000Z | tests/datasets/test_ncbi.py | iwasakishuto/Keras-Imitation | 8ac0cd7c8912d49d13b19a0182ad534c0781fbfe | [
"MIT"
] | null | null | null | tests/datasets/test_ncbi.py | iwasakishuto/Keras-Imitation | 8ac0cd7c8912d49d13b19a0182ad534c0781fbfe | [
"MIT"
] | null | null | null | # coding: utf-8
from kerasy.datasets import ncbi
def test_get_seq():
# SARS coronavirus, complete genome
sequence = ncbi.getSeq("NC_004718")
assert sequence is not None
| 20.333333 | 39 | 0.721311 |
from kerasy.datasets import ncbi
def test_get_seq():
sequence = ncbi.getSeq("NC_004718")
assert sequence is not None
| true | true |
1c2e51d9a46484396d7bb44c506394b105fd35ba | 433 | py | Python | examples/nodes.py | hamersaw/stippy | ad341eab764c4a4162e90afba2e80bdb25e8e25d | [
"MIT"
] | null | null | null | examples/nodes.py | hamersaw/stippy | ad341eab764c4a4162e90afba2e80bdb25e8e25d | [
"MIT"
] | null | null | null | examples/nodes.py | hamersaw/stippy | ad341eab764c4a4162e90afba2e80bdb25e8e25d | [
"MIT"
] | null | null | null | #!/bin/python3
import os
import sys
# import realative 'stippy' python project
script_dir = os.path.dirname(os.path.realpath(__file__))
sys.path.append(script_dir + '/../')
import stippy
if __name__ == '__main__':
host_addr = '127.0.0.1:15606'
# print nodes
print('-----NODES-----')
nodes = stippy.lis... | 24.055556 | 70 | 0.646651 |
import os
import sys
script_dir = os.path.dirname(os.path.realpath(__file__))
sys.path.append(script_dir + '/../')
import stippy
if __name__ == '__main__':
host_addr = '127.0.0.1:15606'
print('-----NODES-----')
nodes = stippy.list_nodes(host_addr)
for node in nodes:
print(str(node.id) ... | true | true |
1c2e51ee4c404b48454f87a0e072862466af6ed6 | 4,456 | py | Python | uninvited-extract.py | egjlund/uninvited-scriptutils | 4d3d169a7192f5e0bda0b6bd2dbcb4964d7c6bb8 | [
"WTFPL"
] | null | null | null | uninvited-extract.py | egjlund/uninvited-scriptutils | 4d3d169a7192f5e0bda0b6bd2dbcb4964d7c6bb8 | [
"WTFPL"
] | null | null | null | uninvited-extract.py | egjlund/uninvited-scriptutils | 4d3d169a7192f5e0bda0b6bd2dbcb4964d7c6bb8 | [
"WTFPL"
] | null | null | null | # encoding: ibm850
from bitio import *
rom_filename = "uninvited.nes"
#
# NOTE: as of now, this can ONLY be relied on to dump the stock script --
# or, rather: only scripts using the default frequency table. this means
# you can not insert a custom script and then dump it back out if you have
# modified th... | 29.509934 | 297 | 0.635772 |
from bitio import *
rom_filename = "uninvited.nes"
print "Uninvited script dumper v0.91"
print
a = raw_input("Include debug info in script (Y/N)? ")
if a[0] == "y" or a[0] == "Y":
debug = True
else:
debug = False
base_addresses = [0x0000, 0x4000, 0xE000]
num_strings = [256, 243, 148]... | false | true |
1c2e52342ca11109dc41f59d2289fc2c9c8ac5bb | 18,480 | py | Python | dimod/utilities.py | wbernoudy/dimod | c39677b4a743574dc795bc140dce703abd61087b | [
"Apache-2.0"
] | null | null | null | dimod/utilities.py | wbernoudy/dimod | c39677b4a743574dc795bc140dce703abd61087b | [
"Apache-2.0"
] | null | null | null | dimod/utilities.py | wbernoudy/dimod | c39677b4a743574dc795bc140dce703abd61087b | [
"Apache-2.0"
] | null | null | null | # Copyright 2018 D-Wave Systems Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | 32.824156 | 106 | 0.613582 |
import copy
import os
import itertools
from functools import reduce
import numpy as np
__all__ = ['ising_energy',
'qubo_energy',
'ising_to_qubo',
'qubo_to_ising',
'child_structure_dfs',
'get_include',
]
def ising_energy(sample, h, J, o... | true | true |
1c2e52715e112ad281fe0514e66107bb8805dd44 | 6,571 | py | Python | third_party/a2c_ppo_acktr/algo/ppo.py | jyf588/SimGAN | 23283d7b5629f1653567b2437bb28aac1cc17169 | [
"Apache-2.0"
] | 30 | 2021-06-16T23:28:58.000Z | 2022-03-23T17:20:58.000Z | third_party/a2c_ppo_acktr/algo/ppo.py | jyf588/SimGAN | 23283d7b5629f1653567b2437bb28aac1cc17169 | [
"Apache-2.0"
] | 1 | 2021-06-25T09:21:29.000Z | 2021-08-11T23:14:14.000Z | third_party/a2c_ppo_acktr/algo/ppo.py | jyf588/SimGAN | 23283d7b5629f1653567b2437bb28aac1cc17169 | [
"Apache-2.0"
] | 8 | 2021-06-19T12:51:50.000Z | 2021-12-23T08:31:10.000Z | # MIT License
#
# Copyright (c) 2017 Ilya Kostrikov
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify... | 41.588608 | 110 | 0.575559 |
import torch
import torch.nn as nn
import torch.optim as optim
from my_pybullet_envs.utils import mirror_obsact_batch
class PPO():
def __init__(self,
actor_critic,
clip_param,
ppo_epoch,
num_mini_batch,
valu... | true | true |
1c2e52deeec86ee00757fa67e77d28c322c9ffd1 | 3,829 | py | Python | scripts/simulate.py | kblondal/RMG-Py | ee14e35321c1dc3cd1900c6d2ebb27931d1bb542 | [
"MIT"
] | 1 | 2020-03-17T13:16:51.000Z | 2020-03-17T13:16:51.000Z | scripts/simulate.py | kblondal/RMG-Py | ee14e35321c1dc3cd1900c6d2ebb27931d1bb542 | [
"MIT"
] | null | null | null | scripts/simulate.py | kblondal/RMG-Py | ee14e35321c1dc3cd1900c6d2ebb27931d1bb542 | [
"MIT"
] | 1 | 2018-10-03T19:36:40.000Z | 2018-10-03T19:36:40.000Z | #!/usr/bin/env python3
###############################################################################
# #
# RMG - Reaction Mechanism Generator #
# ... | 50.381579 | 115 | 0.532254 | true | true | |
1c2e5356a51e4433e91dfeaa4e7b0fc62446dccd | 400 | py | Python | projeto_cliente/cliente/migrations/0003_auto_20210615_2006.py | LeandroMelloo/curso_completo_api_rest_django_framework | c56771a2103ac755e68984b2b1b78f591c1d4b5a | [
"Apache-2.0"
] | null | null | null | projeto_cliente/cliente/migrations/0003_auto_20210615_2006.py | LeandroMelloo/curso_completo_api_rest_django_framework | c56771a2103ac755e68984b2b1b78f591c1d4b5a | [
"Apache-2.0"
] | null | null | null | projeto_cliente/cliente/migrations/0003_auto_20210615_2006.py | LeandroMelloo/curso_completo_api_rest_django_framework | c56771a2103ac755e68984b2b1b78f591c1d4b5a | [
"Apache-2.0"
] | null | null | null | # Generated by Django 3.0.8 on 2021-06-15 23:06
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('cliente', '0002_auto_20210615_1759'),
]
operations = [
migrations.AlterField(
model_name='cliente',
name='email',
... | 21.052632 | 64 | 0.605 |
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('cliente', '0002_auto_20210615_1759'),
]
operations = [
migrations.AlterField(
model_name='cliente',
name='email',
field=models.EmailField(max_length=30... | true | true |
1c2e53c1762cf1429f24b1c0b740c323994335fd | 342 | py | Python | backend/models/profiles.py | jimbunny/AdminSystem | d9a42e2d8608cb0d9bc88f4c1945da48fb8cc925 | [
"MIT"
] | null | null | null | backend/models/profiles.py | jimbunny/AdminSystem | d9a42e2d8608cb0d9bc88f4c1945da48fb8cc925 | [
"MIT"
] | null | null | null | backend/models/profiles.py | jimbunny/AdminSystem | d9a42e2d8608cb0d9bc88f4c1945da48fb8cc925 | [
"MIT"
] | 1 | 2021-09-20T10:53:40.000Z | 2021-09-20T10:53:40.000Z | #!/usr/bin/env python
#-*- coding:utf-8 -*-
# author:jingtongyu
# datetime:2020/6/7 10:14 下午
# software: PyCharm
from . import db
from .base import BaseModel
class ProfilesModel(db.Model, BaseModel):
"""
示例模型类
"""
__tablename__ = 'profiles'
nickname = db.Column(db.String(32))
signature = db.C... | 18 | 41 | 0.654971 |
from . import db
from .base import BaseModel
class ProfilesModel(db.Model, BaseModel):
__tablename__ = 'profiles'
nickname = db.Column(db.String(32))
signature = db.Column(db.String(32))
| true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.