hexsha stringlengths 40 40 | size int64 3 1.03M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 3 972 | max_stars_repo_name stringlengths 6 130 | max_stars_repo_head_hexsha stringlengths 40 78 | 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 3 972 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 78 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 116k ⌀ | 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 3 972 | max_forks_repo_name stringlengths 6 130 | max_forks_repo_head_hexsha stringlengths 40 78 | 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 3 1.03M | avg_line_length float64 1.13 941k | max_line_length int64 2 941k | alphanum_fraction float64 0 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
13948c88190e7862c9ca8494927bb8865b6216e8 | 4,919 | py | Python | _docs/source/conf.py | akaihola/importhook | 157765d2eacf036718ab8f9b7f17cf3f032bb470 | [
"MIT"
] | 8 | 2019-07-08T06:50:47.000Z | 2021-12-03T16:57:23.000Z | _docs/source/conf.py | akaihola/importhook | 157765d2eacf036718ab8f9b7f17cf3f032bb470 | [
"MIT"
] | 5 | 2020-03-09T16:57:25.000Z | 2021-03-07T17:53:21.000Z | _docs/source/conf.py | akaihola/importhook | 157765d2eacf036718ab8f9b7f17cf3f032bb470 | [
"MIT"
] | 3 | 2020-06-13T18:43:49.000Z | 2022-02-14T14:02:18.000Z | # -*- coding: utf-8 -*-
#
# Configuration file for the Sphinx documentation builder.
#
# This file does only contain a selection of the most common options. For a
# full list see the documentation:
# http://www.sphinx-doc.org/en/master/config
# -- Path setup ------------------------------------------------------------... | 30.74375 | 79 | 0.649726 |
682d98cf9e422adb12ea708c4910e45e51cedb79 | 10,352 | py | Python | pymia/data/creation/callback.py | NunoEdgarGFlowHub/pymia | 142842e322b2f712aa45850f23f4875dc2c0f493 | [
"Apache-2.0"
] | null | null | null | pymia/data/creation/callback.py | NunoEdgarGFlowHub/pymia | 142842e322b2f712aa45850f23f4875dc2c0f493 | [
"Apache-2.0"
] | null | null | null | pymia/data/creation/callback.py | NunoEdgarGFlowHub/pymia | 142842e322b2f712aa45850f23f4875dc2c0f493 | [
"Apache-2.0"
] | null | null | null | import os
import typing
import numpy as np
import pymia.data.conversion as conv
import pymia.data.definition as defs
import pymia.data.indexexpression as expr
import pymia.data.subjectfile as subj
from . import writer as wr
class Callback:
"""Base class for the interaction with the dataset creation.
Implem... | 38.917293 | 124 | 0.660452 |
a37e3f0e6a7fe688ee02766f2e83a31e3a7cfee0 | 3,613 | py | Python | watertap/core/util/tests/test_infeasible.py | srikanthallu/watertap | 6ad5552b91163917fb19342754b9b57b3d9cbd85 | [
"BSD-3-Clause-LBNL"
] | 4 | 2021-11-06T01:13:22.000Z | 2022-02-08T21:16:38.000Z | watertap/core/util/tests/test_infeasible.py | srikanthallu/watertap | 6ad5552b91163917fb19342754b9b57b3d9cbd85 | [
"BSD-3-Clause-LBNL"
] | 233 | 2021-10-13T12:53:44.000Z | 2022-03-31T21:59:50.000Z | watertap/core/util/tests/test_infeasible.py | srikanthallu/watertap | 6ad5552b91163917fb19342754b9b57b3d9cbd85 | [
"BSD-3-Clause-LBNL"
] | 12 | 2021-11-01T19:11:03.000Z | 2022-03-08T22:20:58.000Z | ###############################################################################
# WaterTAP Copyright (c) 2021, The Regents of the University of California,
# through Lawrence Berkeley National Laboratory, Oak Ridge National
# Laboratory, National Renewable Energy Laboratory, and National Energy
# Technology Laboratory ... | 28.674603 | 81 | 0.587877 |
11516f25c40aee831ef345a9fd53d3e45ef6965d | 2,145 | py | Python | 04_NEURAL_NETWORKS/cap_03_adding_layers/dense_layer.py | san99tiago/ML_BASICS | ebd51827f7dd427c848b5c8e1d4bfd017d2fb56f | [
"MIT"
] | 2 | 2021-03-18T06:07:09.000Z | 2021-05-08T22:14:14.000Z | 04_NEURAL_NETWORKS/cap_03_adding_layers/dense_layer.py | san99tiago/ML_BASICS | ebd51827f7dd427c848b5c8e1d4bfd017d2fb56f | [
"MIT"
] | null | null | null | 04_NEURAL_NETWORKS/cap_03_adding_layers/dense_layer.py | san99tiago/ML_BASICS | ebd51827f7dd427c848b5c8e1d4bfd017d2fb56f | [
"MIT"
] | null | null | null | # CODE FOR A DENSE LAYER OF NEURONS CLASS USING NUMPY
# SANTIAGO GARCIA ARANGO
import numpy as np
import nnfs
import matplotlib.pyplot as plt
from nnfs.datasets import spiral_data
# Initialize Neural Networks From Scratch package for following the book
nnfs.init(dot_precision_workaround=True, default_dtype='float32',... | 36.355932 | 80 | 0.64662 |
910b2fc5e7bf03bbf8e3ec1b1cbf829bb582a764 | 3,219 | py | Python | som_anomaly_detector/anomaly_detection.py | FlorisHoogenboom/som-anomaly-detector | 40a84665ec322850792015bfa84c7c287f0956f5 | [
"MIT"
] | 27 | 2017-07-27T00:13:20.000Z | 2022-03-20T13:10:15.000Z | som_anomaly_detector/anomaly_detection.py | FlorisHoogenboom/som-anomaly-detector | 40a84665ec322850792015bfa84c7c287f0956f5 | [
"MIT"
] | 3 | 2017-07-28T00:27:44.000Z | 2020-06-08T18:20:35.000Z | som_anomaly_detector/anomaly_detection.py | FlorisHoogenboom/som-anomaly-detector | 40a84665ec322850792015bfa84c7c287f0956f5 | [
"MIT"
] | 14 | 2017-11-28T04:04:28.000Z | 2022-03-20T13:10:17.000Z | import numpy as np
from sklearn.neighbors import NearestNeighbors
from som_anomaly_detector.kohonen_som import KohonenSom
class AnomalyDetection(KohonenSom):
""""
This class uses provides an specific implementation of Kohonnen Som for anomaly detection.
"""
def __init__(
self,
shape,... | 36.579545 | 98 | 0.645231 |
7c3692a5e323a3152dd65dcfb4555352d444b84f | 6,239 | py | Python | lvsm/firewall.py | khosrow/lvsm | 516ee1422f736d016ccc198e54f5f019102504a6 | [
"MIT"
] | 15 | 2015-03-18T21:45:24.000Z | 2021-02-22T09:41:30.000Z | lvsm/firewall.py | khosrow/lvsm | 516ee1422f736d016ccc198e54f5f019102504a6 | [
"MIT"
] | 12 | 2016-01-15T19:32:36.000Z | 2016-10-27T14:21:14.000Z | lvsm/firewall.py | khosrow/lvsm | 516ee1422f736d016ccc198e54f5f019102504a6 | [
"MIT"
] | 8 | 2015-03-20T00:24:56.000Z | 2021-11-19T06:21:19.000Z | """Firewall funcationality"""
import subprocess
import socket
import utils
import termcolor
import logging
logger = logging.getLogger('lvsm')
class Firewall():
def __init__(self, iptables):
self.iptables = iptables
def show(self, numeric, color):
args = [self.iptables, "-L", "-v"]
if... | 37.359281 | 114 | 0.484212 |
f353999cabd0b31f74ad52f4e235abfa57b62882 | 3,111 | py | Python | lotto_class.py | idel28102001/loto_game | fb672f6878f871bf294ff0f1f99fea2eda4aeb15 | [
"MIT"
] | null | null | null | lotto_class.py | idel28102001/loto_game | fb672f6878f871bf294ff0f1f99fea2eda4aeb15 | [
"MIT"
] | null | null | null | lotto_class.py | idel28102001/loto_game | fb672f6878f871bf294ff0f1f99fea2eda4aeb15 | [
"MIT"
] | null | null | null | import random
from lotto_funcs import rand_nums, lotto_nums, lines_lotto
def decorator(f):
def inner_func(*args, **kwargs):
line, name = f(*args, **kwargs)
print('-' * 6, name, '-' * 6)
print(line[:-2])
print('-' * 26)
return inner_func
class Bingo:
def __init__(self, n... | 27.776786 | 106 | 0.533269 |
943d262b257456b160300d08e106173ec369e225 | 2,494 | py | Python | spirit/core/tests/utils.py | igorshevk/oknoname | 0828504afb8fdae5f5e85040bec1d95cb27ce471 | [
"MIT"
] | 1 | 2022-01-09T19:53:55.000Z | 2022-01-09T19:53:55.000Z | spirit/core/tests/utils.py | igorshevk/oknoname | 0828504afb8fdae5f5e85040bec1d95cb27ce471 | [
"MIT"
] | 5 | 2021-06-08T21:03:58.000Z | 2022-03-12T00:18:43.000Z | spirit/core/tests/utils.py | BinaryTree0/fer3 | 85c3bbf2f328e69ad4d7c01b6e2c8d4ef1d9e0a3 | [
"MIT"
] | 1 | 2022-02-15T16:56:49.000Z | 2022-02-15T16:56:49.000Z | # -*- coding: utf-8 -*-
from django.contrib.auth import get_user_model
from django.core.cache import caches, cache
from ...core.conf import settings
from ...topic.models import Topic
from ...category.models import Category
from ...comment.models import Comment
from ...topic.private.models import TopicPrivate
User = ... | 28.022472 | 78 | 0.677626 |
a9d1c8cd39193b1f1a77daa6269dff38eff2f75c | 15,764 | py | Python | main.py | stefansturlu/FederatedMedical | d753acda850e0d8cf64fc1d5c19e7018494bc16a | [
"MIT"
] | 3 | 2021-06-24T12:27:26.000Z | 2022-03-28T02:30:04.000Z | main.py | stefansturlu/FederatedMedical | d753acda850e0d8cf64fc1d5c19e7018494bc16a | [
"MIT"
] | null | null | null | main.py | stefansturlu/FederatedMedical | d753acda850e0d8cf64fc1d5c19e7018494bc16a | [
"MIT"
] | 1 | 2021-11-29T20:18:18.000Z | 2021-11-29T20:18:18.000Z | from torch import optim
from utils.typings import BlockedLocations, Errors, FreeRiderAttack, PersonalisationMethod
from datasetLoaders.DatasetInterface import DatasetInterface
from experiment.CustomConfig import CustomConfig
import os
from typing import Callable, Dict, List, NewType, Optional, Tuple, Dict, Type
import ... | 34.876106 | 138 | 0.66544 |
ea75cf2bae82bd5a8cf388363cec92729ee4c815 | 51 | py | Python | scripts/fib.py | alif0/hello_world | 529ec2540eb19fc4868aceaf5915b4a849f187b1 | [
"Apache-2.0"
] | 1 | 2020-06-23T03:34:04.000Z | 2020-06-23T03:34:04.000Z | scripts/fib.py | alif0/hello_world | 529ec2540eb19fc4868aceaf5915b4a849f187b1 | [
"Apache-2.0"
] | null | null | null | scripts/fib.py | alif0/hello_world | 529ec2540eb19fc4868aceaf5915b4a849f187b1 | [
"Apache-2.0"
] | null | null | null | import fibonacci as f
print (__name__)
f.fib(20)
| 8.5 | 21 | 0.72549 |
4498f9936a9002fc6c6c6e44cf10a77d138cdcfd | 1,056 | py | Python | ngboost/scores.py | FoundryAI/ngboost | 7a151f849b95eb31e66ea7bb290b342be4981b54 | [
"Apache-2.0"
] | 1 | 2021-08-24T14:23:20.000Z | 2021-08-24T14:23:20.000Z | ngboost/scores.py | FoundryAI/ngboost | 7a151f849b95eb31e66ea7bb290b342be4981b54 | [
"Apache-2.0"
] | null | null | null | ngboost/scores.py | FoundryAI/ngboost | 7a151f849b95eb31e66ea7bb290b342be4981b54 | [
"Apache-2.0"
] | null | null | null | import numpy as np
from ngboost.helpers import Y_from_censored
class Score():
def total_score(self, Y, sample_weight=None):
return np.average(self.score(Y), weights=sample_weight)
def grad(self, Y, natural=True):
grad = self.d_score(Y)
if natural:
metric = self.metric()
... | 32 | 203 | 0.667614 |
064a5c1ef1053bc4c87fd3d21ca301c8e4a21c2a | 5,547 | py | Python | keras_synthetic_genome_sequence/multivariate_gap_sequence.py | LucaCappelletti94/keras_synthetic_genome_sequence | b25c846b0bddd438da96dab9974cd3bd3fe44858 | [
"MIT"
] | null | null | null | keras_synthetic_genome_sequence/multivariate_gap_sequence.py | LucaCappelletti94/keras_synthetic_genome_sequence | b25c846b0bddd438da96dab9974cd3bd3fe44858 | [
"MIT"
] | null | null | null | keras_synthetic_genome_sequence/multivariate_gap_sequence.py | LucaCappelletti94/keras_synthetic_genome_sequence | b25c846b0bddd438da96dab9974cd3bd3fe44858 | [
"MIT"
] | null | null | null | """Keras Sequence that returns tuples of nucleotide sequences, one with multivariate synthetic gaps and the other without as ground truth."""
from typing import Union, Dict, Tuple
import pandas as pd
import numpy as np
from keras_bed_sequence import BedSequence
from keras_mixed_sequence.utils import NumpySequence
from ... | 36.019481 | 141 | 0.603209 |
e36729c52489f5b1ca441bd3a7ff4b7a0ed44a8e | 14,861 | py | Python | mne/io/write.py | dokato/mne-python | a188859b57044fa158af05852bcce2870fabde91 | [
"BSD-3-Clause"
] | null | null | null | mne/io/write.py | dokato/mne-python | a188859b57044fa158af05852bcce2870fabde91 | [
"BSD-3-Clause"
] | null | null | null | mne/io/write.py | dokato/mne-python | a188859b57044fa158af05852bcce2870fabde91 | [
"BSD-3-Clause"
] | 1 | 2021-04-12T12:45:31.000Z | 2021-04-12T12:45:31.000Z | # Authors: Alexandre Gramfort <alexandre.gramfort@telecom-paristech.fr>
# Matti Hamalainen <msh@nmr.mgh.harvard.edu>
#
# License: BSD (3-clause)
from gzip import GzipFile
import os.path as op
import re
import time
import uuid
import numpy as np
from scipy import linalg, sparse
from .constants import FIFF
fr... | 34.803279 | 79 | 0.630913 |
123f5cb869d204c260fcd85b06de56c91146ed32 | 2,180 | py | Python | setup.py | marcoscleison/PyOPF | f386c90e63b4f2c46c6d5305f261b6b6619df69f | [
"Apache-2.0"
] | 3 | 2019-05-06T14:43:32.000Z | 2019-09-03T18:20:33.000Z | setup.py | marcoscleison/PyOPF | f386c90e63b4f2c46c6d5305f261b6b6619df69f | [
"Apache-2.0"
] | 2 | 2019-05-06T17:42:59.000Z | 2019-06-26T14:35:00.000Z | setup.py | marcoscleison/PyOPF | f386c90e63b4f2c46c6d5305f261b6b6619df69f | [
"Apache-2.0"
] | null | null | null | """
Copyright 2019 PyOPF Contributors
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to i... | 29.066667 | 96 | 0.705505 |
2ab323ae580625cfd641b6a95439c169381380dd | 1,576 | py | Python | eg/table-of-contents.py | catseye/Feedmark | 4fc7668f7baf40870661fe7f01a2065d6c010005 | [
"MIT"
] | null | null | null | eg/table-of-contents.py | catseye/Feedmark | 4fc7668f7baf40870661fe7f01a2065d6c010005 | [
"MIT"
] | null | null | null | eg/table-of-contents.py | catseye/Feedmark | 4fc7668f7baf40870661fe7f01a2065d6c010005 | [
"MIT"
] | 1 | 2020-05-14T08:01:39.000Z | 2020-05-14T08:01:39.000Z | #
# Example of a Python script that creates a table of contents from
# the JSON extracted by feedmark from a set of Feedmark documents.
#
import json
import re
import subprocess
import sys
import urllib
def generate_toc_line(document):
title = document['title']
filename = urllib.quote(document['filename'])
... | 29.735849 | 100 | 0.653553 |
2be22a0a3bce3aabf451c6c8336e908a42ec7376 | 1,650 | py | Python | utils.py | YilinLiu97/AmygNet-Pytorch | d5bb244fd930791345d38f09870a7ded633f4622 | [
"MIT"
] | 3 | 2019-06-11T01:38:34.000Z | 2020-04-16T00:36:10.000Z | utils.py | YilinLiu97/Amygdala-Net | d5bb244fd930791345d38f09870a7ded633f4622 | [
"MIT"
] | null | null | null | utils.py | YilinLiu97/Amygdala-Net | d5bb244fd930791345d38f09870a7ded633f4622 | [
"MIT"
] | null | null | null | import numpy as np
class AverageMeter(object):
"""Computes and stores the average and current value"""
def __init__(self):
self.reset()
def reset(self):
self.val = 0
self.avg = 0
self.sum = 0
self.count = 0
def update(self, val, n=1):
self.val = val
... | 28.448276 | 76 | 0.603636 |
9fda6bfcb68d1b67a6c1ee26cd214b8d9a8f4641 | 5,264 | py | Python | python_scripts/tests/api_tests/test_ah_get_ops_in_block.py | ZhengGuoDeveloper/steem | c6d6f0687879b47f97ce786b049d3d8bfc6d1c35 | [
"MIT"
] | 2,189 | 2016-04-02T21:49:13.000Z | 2022-03-31T23:31:07.000Z | python_scripts/tests/api_tests/test_ah_get_ops_in_block.py | ZhengGuoDeveloper/steem | c6d6f0687879b47f97ce786b049d3d8bfc6d1c35 | [
"MIT"
] | 2,798 | 2016-04-11T18:01:05.000Z | 2022-01-15T23:05:39.000Z | python_scripts/tests/api_tests/test_ah_get_ops_in_block.py | ZhengGuoDeveloper/steem | c6d6f0687879b47f97ce786b049d3d8bfc6d1c35 | [
"MIT"
] | 908 | 2016-03-23T18:26:20.000Z | 2022-03-07T21:43:27.000Z | #!/usr/bin/env python3
"""
Usage: script_name jobs url1 url2 [wdir [last_block [first_block]]]
Example: script_name 4 http://127.0.0.1:8090 http://127.0.0.1:8091 ./ 5000000 0
set jobs to 0 if you want use all processors
if last_block == 0, it is read from url1 (as reference)
"""
import sys
import json
im... | 29.407821 | 118 | 0.647226 |
2518e4d0d7d622ed15ecf5e332e9ea29a799908d | 2,178 | py | Python | desktop/core/ext-py/amqp-2.4.1/amqp/spec.py | maulikjs/hue | 59ac879b55bb6fb26ecb4e85f4c70836fc21173f | [
"Apache-2.0"
] | 5,079 | 2015-01-01T03:39:46.000Z | 2022-03-31T07:38:22.000Z | desktop/core/ext-py/amqp-2.4.1/amqp/spec.py | zks888/hue | 93a8c370713e70b216c428caa2f75185ef809deb | [
"Apache-2.0"
] | 1,623 | 2015-01-01T08:06:24.000Z | 2022-03-30T19:48:52.000Z | desktop/core/ext-py/amqp-2.4.1/amqp/spec.py | zks888/hue | 93a8c370713e70b216c428caa2f75185ef809deb | [
"Apache-2.0"
] | 2,033 | 2015-01-04T07:18:02.000Z | 2022-03-28T19:55:47.000Z | """AMQP Spec."""
from __future__ import absolute_import, unicode_literals
from collections import namedtuple
method_t = namedtuple('method_t', ('method_sig', 'args', 'content'))
def method(method_sig, args=None, content=False):
"""Create amqp method specification tuple."""
return method_t(method_sig, args, ... | 17.707317 | 68 | 0.52663 |
3f3eacc271d902d8a908677b96194569fa02bd7b | 80,193 | py | Python | control/timeresp.py | berezhko/python-control | 78ec3eedd5a4a5f3d8409eec7c7f7e787793b357 | [
"BSD-3-Clause"
] | 1,112 | 2015-01-14T08:01:33.000Z | 2022-03-31T11:54:00.000Z | control/timeresp.py | berezhko/python-control | 78ec3eedd5a4a5f3d8409eec7c7f7e787793b357 | [
"BSD-3-Clause"
] | 646 | 2015-02-02T15:35:23.000Z | 2022-03-30T08:19:26.000Z | control/timeresp.py | berezhko/python-control | 78ec3eedd5a4a5f3d8409eec7c7f7e787793b357 | [
"BSD-3-Clause"
] | 366 | 2015-01-28T17:58:06.000Z | 2022-03-29T11:04:10.000Z | """
timeresp.py - time-domain simulation routines.
The :mod:`~control.timeresp` module contains a collection of
functions that are used to compute time-domain simulations of LTI
systems.
Arguments to time-domain simulations include a time vector, an input
vector (when needed), and an initial condition vector. The mo... | 39.023358 | 84 | 0.618558 |
e3dfaac3be8985031a4476b2dbb55999aee86f00 | 1,953 | py | Python | azure-mgmt-batch/azure/mgmt/batch/models/application.py | CharaD7/azure-sdk-for-python | 9fdf0aac0cec8a15a5bb2a0ea27dd331dbfa2f5c | [
"MIT"
] | 1 | 2017-10-29T15:14:35.000Z | 2017-10-29T15:14:35.000Z | azure-mgmt-batch/azure/mgmt/batch/models/application.py | Berryliao84/Python-Azure | a96ed6e8bbf4290372980a2919b31110da90b164 | [
"MIT"
] | null | null | null | azure-mgmt-batch/azure/mgmt/batch/models/application.py | Berryliao84/Python-Azure | a96ed6e8bbf4290372980a2919b31110da90b164 | [
"MIT"
] | null | null | null | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... | 40.6875 | 108 | 0.640041 |
abc406167946c82604f2e58f3835d4a37bbb694d | 5,289 | py | Python | tools/search_strategy.py | PaddlePaddle/PaddleCLS | 22531707527fb01f0e7f628509ed4b3d2b860316 | [
"Apache-2.0"
] | 1 | 2020-04-08T02:45:06.000Z | 2020-04-08T02:45:06.000Z | tools/search_strategy.py | PaddlePaddle/PaddleCLS | 22531707527fb01f0e7f628509ed4b3d2b860316 | [
"Apache-2.0"
] | null | null | null | tools/search_strategy.py | PaddlePaddle/PaddleCLS | 22531707527fb01f0e7f628509ed4b3d2b860316 | [
"Apache-2.0"
] | 1 | 2020-04-07T17:03:24.000Z | 2020-04-07T17:03:24.000Z | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os
import sys
__dir__ = os.path.dirname(os.path.abspath(__file__))
sys.path.append(os.path.abspath(os.path.join(__dir__, '../')))
import subprocess
import numpy as np
from ppcls.utils import config
de... | 37.246479 | 90 | 0.589525 |
a3f6486648a7c43a7119e885d12840c7fcdaf276 | 197 | py | Python | 51.py | renato-felix/PythonCursoEmVideo | 267b862c7afdde6d5f7e630e0a203fe923ca74a8 | [
"MIT"
] | null | null | null | 51.py | renato-felix/PythonCursoEmVideo | 267b862c7afdde6d5f7e630e0a203fe923ca74a8 | [
"MIT"
] | null | null | null | 51.py | renato-felix/PythonCursoEmVideo | 267b862c7afdde6d5f7e630e0a203fe923ca74a8 | [
"MIT"
] | null | null | null | a1 = int(input('Digite o primeiro termo da PA: '))
r = int(input('Digite a razão da PA: '))
an = 0
n = 0
for c in range(1, 11):
an = an + 1
n = n + 1
pa = a1 + (n - 1) * r
print(pa) | 21.888889 | 50 | 0.507614 |
deb21c72606c9f0ffc9e3e7757593eb82973bb72 | 36,593 | py | Python | tempest/api/compute/servers/test_server_actions.py | AurelienLourot/tempest | 4d14a22a1a0eb7aaa4aafb917273baa0739f55c3 | [
"Apache-2.0"
] | null | null | null | tempest/api/compute/servers/test_server_actions.py | AurelienLourot/tempest | 4d14a22a1a0eb7aaa4aafb917273baa0739f55c3 | [
"Apache-2.0"
] | null | null | null | tempest/api/compute/servers/test_server_actions.py | AurelienLourot/tempest | 4d14a22a1a0eb7aaa4aafb917273baa0739f55c3 | [
"Apache-2.0"
] | null | null | null | # Copyright 2012 OpenStack Foundation
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requ... | 46.55598 | 79 | 0.645096 |
e222133f97f82175476b81cea67a73fa5c226257 | 1,973 | py | Python | cf_xarray/utils.py | kmpaul/cf-xarray | 5133a4dada23b18221f2136e1f763cda8e65f249 | [
"Apache-2.0"
] | null | null | null | cf_xarray/utils.py | kmpaul/cf-xarray | 5133a4dada23b18221f2136e1f763cda8e65f249 | [
"Apache-2.0"
] | 5 | 2020-09-11T20:54:31.000Z | 2020-10-18T18:12:58.000Z | cf_xarray/utils.py | kmpaul/cf-xarray | 5133a4dada23b18221f2136e1f763cda8e65f249 | [
"Apache-2.0"
] | null | null | null | from typing import Any, Dict, Hashable, Mapping, Optional, TypeVar, cast
K = TypeVar("K")
V = TypeVar("V")
T = TypeVar("T")
def either_dict_or_kwargs(
pos_kwargs: Optional[Mapping[Hashable, T]],
kw_kwargs: Mapping[str, T],
func_name: str,
) -> Mapping[Hashable, T]:
if pos_kwargs is not None:
... | 28.185714 | 76 | 0.621389 |
f655851d18c746da26ebbd0599f194d4730bdbaa | 2,915 | py | Python | rson/pyjson.py | tundish/rson | dd37de14c02c048720e3dd159464aa7b8c4709a6 | [
"MIT"
] | 1 | 2016-07-22T19:40:58.000Z | 2016-07-22T19:40:58.000Z | rson/pyjson.py | pombreda/rson | dd37de14c02c048720e3dd159464aa7b8c4709a6 | [
"MIT"
] | null | null | null | rson/pyjson.py | pombreda/rson | dd37de14c02c048720e3dd159464aa7b8c4709a6 | [
"MIT"
] | null | null | null | '''
This module provides enough compatibility with simplejson to run
the testsuite, if desired.
Copyright (c) 2010, Patrick Maupin. All rights reserved.
See http://code.google.com/p/rson/source/browse/trunk/license.txt
'''
import re
import rson
class PyJsonTokenizer(rson.base.Tokenizer):
''' Fudges location i... | 33.895349 | 82 | 0.610635 |
c1a690a524e5f4492ef10dd5d8a2840fa2e0bc0a | 7,039 | py | Python | django/db/models/query_utils.py | kix/django | 5262a288df07daa050a0e17669c3f103f47a8640 | [
"BSD-3-Clause"
] | 790 | 2015-01-03T02:13:39.000Z | 2020-05-10T19:53:57.000Z | AppServer/lib/django-1.5/django/db/models/query_utils.py | nlake44/appscale | 6944af660ca4cb772c9b6c2332ab28e5ef4d849f | [
"Apache-2.0"
] | 1,361 | 2015-01-08T23:09:40.000Z | 2020-04-14T00:03:04.000Z | AppServer/lib/django-1.5/django/db/models/query_utils.py | nlake44/appscale | 6944af660ca4cb772c9b6c2332ab28e5ef4d849f | [
"Apache-2.0"
] | 155 | 2015-01-08T22:59:31.000Z | 2020-04-08T08:01:53.000Z | """
Various data structures used in query construction.
Factored out from django.db.models.query to avoid making the main module very
large and/or so that they can be used by other modules without getting into
circular import difficulties.
"""
from __future__ import unicode_literals
from django.db.backends import uti... | 35.913265 | 85 | 0.636312 |
aae5911023caf8c6853b337ffea6634855cbfb95 | 4,709 | py | Python | pbx_gs_python_utils/utils/Misc.py | owasp-sbot/pbx-gs-python-utils | f448aa36c4448fc04d30c3a5b25640ea4d44a267 | [
"Apache-2.0"
] | 3 | 2018-12-14T15:43:46.000Z | 2019-04-25T07:44:58.000Z | pbx_gs_python_utils/utils/Misc.py | owasp-sbot/pbx-gs-python-utils | f448aa36c4448fc04d30c3a5b25640ea4d44a267 | [
"Apache-2.0"
] | 1 | 2019-05-11T14:19:37.000Z | 2019-05-11T14:51:04.000Z | pbx_gs_python_utils/utils/Misc.py | owasp-sbot/pbx-gs-python-utils | f448aa36c4448fc04d30c3a5b25640ea4d44a267 | [
"Apache-2.0"
] | 4 | 2018-12-27T04:54:14.000Z | 2019-05-11T14:07:47.000Z | import hashlib
import json
import pprint
import random
import string
import textwrap
import re
from time import sleep
class Misc:
@staticmethod
def array_add(array, value):
array.append(value)
return value
@staticmethod
def array_find(array, item):
try:
return arr... | 26.60452 | 124 | 0.55808 |
e7f1431813e1c7008a5fce26daf88ca9458f8e11 | 1,109 | py | Python | catboost/python-package/ut/medium/test_whl.py | PallHaraldsson/catboost | f4b86aae0acb853f0216081518d490e52722ad88 | [
"Apache-2.0"
] | null | null | null | catboost/python-package/ut/medium/test_whl.py | PallHaraldsson/catboost | f4b86aae0acb853f0216081518d490e52722ad88 | [
"Apache-2.0"
] | null | null | null | catboost/python-package/ut/medium/test_whl.py | PallHaraldsson/catboost | f4b86aae0acb853f0216081518d490e52722ad88 | [
"Apache-2.0"
] | null | null | null | import yatest.common
import shutil
import os
import zipfile
PYTHON_PACKAGE_DIR = os.path.join("catboost", "python-package")
def test_wheel():
shutil.copy(yatest.common.source_path(os.path.join(PYTHON_PACKAGE_DIR, "mk_wheel.py")), 'mk_wheel.py')
from mk_wheel import PythonTrait, make_wheel
cpu_so_name = ... | 38.241379 | 131 | 0.706041 |
528405100008497b018b1d02621a1181b42c55a5 | 2,772 | py | Python | src/ip.py | thoolihan/LogIPsToAWSDynamoDB | 528734d4aca0fc27a5a702a95898b7de6fbb48bc | [
"Apache-2.0"
] | 1 | 2016-11-12T15:12:30.000Z | 2016-11-12T15:12:30.000Z | src/ip.py | thoolihan/LogIPsToAWSDynamoDB | 528734d4aca0fc27a5a702a95898b7de6fbb48bc | [
"Apache-2.0"
] | null | null | null | src/ip.py | thoolihan/LogIPsToAWSDynamoDB | 528734d4aca0fc27a5a702a95898b7de6fbb48bc | [
"Apache-2.0"
] | null | null | null | from flask import Flask
from flask import jsonify
from flask import request, Response
from functools import wraps
from datetime import datetime
import os
import boto3
import json
import argparse
from boto3.dynamodb.conditions import Key, Attr
app = Flask(__name__)
cred_file = open('credentials.json').read()
creds = js... | 28.875 | 82 | 0.651876 |
5c25f9e962723718a17029599a22f23c42cea82d | 5,449 | py | Python | zproject/test_settings.py | acguglielmo/zulip | 97ed71ca699c3abd1c2584cc3c6a8370430ae2f6 | [
"Apache-2.0"
] | null | null | null | zproject/test_settings.py | acguglielmo/zulip | 97ed71ca699c3abd1c2584cc3c6a8370430ae2f6 | [
"Apache-2.0"
] | null | null | null | zproject/test_settings.py | acguglielmo/zulip | 97ed71ca699c3abd1c2584cc3c6a8370430ae2f6 | [
"Apache-2.0"
] | null | null | null | import os
# test_settings.py works differently from
# dev_settings.py/prod_settings.py; it actually is directly referenced
# by the test suite as DJANGO_SETTINGS_MODULE and imports settings.py
# directly and then hacks up the values that are different for the
# test suite. As will be explained, this is kinda messy and... | 33.024242 | 81 | 0.750413 |
094c1dde0edea66ebc71734d2f9f45549868ce35 | 2,201 | py | Python | tools/src/test/python/dlpx/virtualization/_internal/fake_plugin/staged/multiple_warnings.py | vr-delphix/virtualization-sdk | ebf934c9eb1337b35f7eb34e807af63ea259da6a | [
"Apache-2.0"
] | null | null | null | tools/src/test/python/dlpx/virtualization/_internal/fake_plugin/staged/multiple_warnings.py | vr-delphix/virtualization-sdk | ebf934c9eb1337b35f7eb34e807af63ea259da6a | [
"Apache-2.0"
] | 95 | 2020-03-06T00:25:42.000Z | 2020-06-09T00:22:25.000Z | tools/src/test/python/dlpx/virtualization/_internal/fake_plugin/staged/multiple_warnings.py | vr-delphix/virtualization-sdk | ebf934c9eb1337b35f7eb34e807af63ea259da6a | [
"Apache-2.0"
] | 3 | 2019-10-14T18:33:30.000Z | 2019-10-23T17:08:08.000Z | #
# Copyright (c) 2019 by Delphix. All rights reserved.
#
# flake8: noqa
from __future__ import print_function
import logging
from dlpx.virtualization.platform import Plugin
logger = logging.getLogger()
logger.setLevel(logging.NOTSET)
staged = Plugin()
# Renamed source_connection to connection to test if named ar... | 21.578431 | 77 | 0.769196 |
c240f22df109a27a78549581e86086e54cb7a57b | 12,003 | py | Python | crowdstrike/src/crowdstrike/core.py | RomainGUIGNARD/connectors | 526c5c21267ec4c5c97436d76a7a23156c0f5281 | [
"Apache-2.0"
] | 1 | 2020-10-08T18:39:06.000Z | 2020-10-08T18:39:06.000Z | crowdstrike/src/crowdstrike/core.py | RomainGUIGNARD/connectors | 526c5c21267ec4c5c97436d76a7a23156c0f5281 | [
"Apache-2.0"
] | null | null | null | crowdstrike/src/crowdstrike/core.py | RomainGUIGNARD/connectors | 526c5c21267ec4c5c97436d76a7a23156c0f5281 | [
"Apache-2.0"
] | 1 | 2020-05-03T12:41:47.000Z | 2020-05-03T12:41:47.000Z | # -*- coding: utf-8 -*-
"""OpenCTI CrowdStrike connector core module."""
import os
import time
from typing import Any, Dict, List, Mapping, Optional
import yaml
from crowdstrike_client.client import CrowdStrikeClient
from pycti import OpenCTIConnectorHelper
from pycti.connector.opencti_connector_helper import get_c... | 35.617211 | 88 | 0.653087 |
e25d3dce75a0dec79df3cccade8b4c1fd5b69560 | 20,648 | py | Python | tests/test_grid.py | borsden/pyvista | dface2fbec53f9a3679bad9454d95358cb2695a4 | [
"MIT"
] | null | null | null | tests/test_grid.py | borsden/pyvista | dface2fbec53f9a3679bad9454d95358cb2695a4 | [
"MIT"
] | null | null | null | tests/test_grid.py | borsden/pyvista | dface2fbec53f9a3679bad9454d95358cb2695a4 | [
"MIT"
] | null | null | null | import pathlib
import os
import weakref
import numpy as np
import pytest
import vtk
import pyvista
from pyvista import examples
from pyvista.plotting import system_supports_plotting
test_path = os.path.dirname(os.path.abspath(__file__))
VTK9 = vtk.vtkVersion().GetVTKMajorVersion() >= 9
# must be manually set until... | 33.249597 | 105 | 0.649651 |
5eb3521837976c52bee8c1b7b77beb247e2debbc | 29,648 | py | Python | apps/log_databus/handlers/storage.py | ptaoapeng/bk-log | f54735a21ecea4e90c5ac2f5dbc0be13d0b9ab80 | [
"MIT"
] | 75 | 2021-07-14T09:32:36.000Z | 2022-03-31T15:26:53.000Z | apps/log_databus/handlers/storage.py | ptaoapeng/bk-log | f54735a21ecea4e90c5ac2f5dbc0be13d0b9ab80 | [
"MIT"
] | 561 | 2021-07-14T07:45:47.000Z | 2022-03-31T11:41:28.000Z | apps/log_databus/handlers/storage.py | ptaoapeng/bk-log | f54735a21ecea4e90c5ac2f5dbc0be13d0b9ab80 | [
"MIT"
] | 41 | 2021-07-14T07:39:50.000Z | 2022-03-25T09:22:18.000Z | # -*- coding: utf-8 -*-
"""
Tencent is pleased to support the open source community by making BK-LOG 蓝鲸日志平台 available.
Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
BK-LOG 蓝鲸日志平台 is licensed under the MIT License.
License for BK-LOG 蓝鲸日志平台:
------------------------------------------------... | 40.950276 | 118 | 0.616601 |
14a852167c96b6fd3935ed85b7f84704d2379bb7 | 16,898 | py | Python | models/rotatespade_model.py | Jack12xl/Rotate-and-Render | 6f04aeaf4bb631cdc8e694277bf8fd22e6a7df07 | [
"CC-BY-4.0"
] | null | null | null | models/rotatespade_model.py | Jack12xl/Rotate-and-Render | 6f04aeaf4bb631cdc8e694277bf8fd22e6a7df07 | [
"CC-BY-4.0"
] | null | null | null | models/rotatespade_model.py | Jack12xl/Rotate-and-Render | 6f04aeaf4bb631cdc8e694277bf8fd22e6a7df07 | [
"CC-BY-4.0"
] | null | null | null | import torch
import models.networks as networks
import util.util as util
from data import curve
import numpy as np
import os
class RotateSPADEModel(torch.nn.Module):
@staticmethod
def modify_commandline_options(parser, is_train):
networks.modify_commandline_options(parser, is_train)
return par... | 42.779747 | 137 | 0.586105 |
67257598368a15646fcafd54069b287508ea5b4f | 12,272 | py | Python | article/experiments/exp3.py | andycasey/mcfa | 8c4135e665e47006e9ca725e8bfc67315508366e | [
"MIT"
] | 2 | 2018-08-23T06:54:17.000Z | 2021-03-05T14:38:41.000Z | article/experiments/exp3.py | andycasey/mcfa | 8c4135e665e47006e9ca725e8bfc67315508366e | [
"MIT"
] | null | null | null | article/experiments/exp3.py | andycasey/mcfa | 8c4135e665e47006e9ca725e8bfc67315508366e | [
"MIT"
] | null | null | null |
"""
Experiment using all GALAH data.
"""
from __future__ import division # Just in case. Use Python 3.
import os
import sys
import pickle
import numpy as np
import matplotlib
import matplotlib.pyplot as plt
import yaml
from matplotlib.ticker import MaxNLocator
from collections import Counter
from scipy import linalg... | 29.149644 | 183 | 0.641705 |
41082b631863e667da63c3e0b99d92600e6d8ee7 | 615 | py | Python | xd/utils/logger.py | smly/xview3-kohei-solution | f6933ff437240c6c07fd61c3bd4290b639d17531 | [
"MIT"
] | 2 | 2022-01-14T08:00:34.000Z | 2022-01-17T12:42:44.000Z | xd/utils/logger.py | smly/xview3-kohei-solution | f6933ff437240c6c07fd61c3bd4290b639d17531 | [
"MIT"
] | null | null | null | xd/utils/logger.py | smly/xview3-kohei-solution | f6933ff437240c6c07fd61c3bd4290b639d17531 | [
"MIT"
] | 1 | 2022-01-31T21:25:21.000Z | 2022-01-31T21:25:21.000Z | import sys
from logging import INFO, FileHandler, Formatter, StreamHandler
def set_logger(logger):
logformat = "%(asctime)s %(levelname)s %(message)s"
handler_out = StreamHandler(sys.stdout)
handler_out.setLevel(INFO)
handler_out.setFormatter(Formatter(logformat))
logger.setLevel(INFO)
logger.... | 30.75 | 67 | 0.744715 |
83a973dd65aa3363e9d8ad4c07b99900e2dd9857 | 242,711 | py | Python | tensorflow/python/framework/ops.py | davidkirwan/tensorflow | 185a465225a520a1855145efda58b17b1a83d3a5 | [
"Apache-2.0"
] | 1 | 2020-08-07T22:18:01.000Z | 2020-08-07T22:18:01.000Z | tensorflow/python/framework/ops.py | davidkirwan/tensorflow | 185a465225a520a1855145efda58b17b1a83d3a5 | [
"Apache-2.0"
] | null | null | null | tensorflow/python/framework/ops.py | davidkirwan/tensorflow | 185a465225a520a1855145efda58b17b1a83d3a5 | [
"Apache-2.0"
] | null | null | null | # Copyright 2015 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 applica... | 36.432153 | 115 | 0.692222 |
f5fdf531191cce59cbcc7728a6e6c256a035ba05 | 91 | py | Python | 30.strings/4.center.py | robinson-1985/python-zero-dnc | df510d67e453611fcd320df1397cdb9ca47fecb8 | [
"MIT"
] | null | null | null | 30.strings/4.center.py | robinson-1985/python-zero-dnc | df510d67e453611fcd320df1397cdb9ca47fecb8 | [
"MIT"
] | null | null | null | 30.strings/4.center.py | robinson-1985/python-zero-dnc | df510d67e453611fcd320df1397cdb9ca47fecb8 | [
"MIT"
] | null | null | null | # 3. center() -> Retorna a string como centro e preenche com espaços o restante do tamanho. | 91 | 91 | 0.747253 |
0d29da29b850a83458cf0e0f1ddbf27e84c72b91 | 8,820 | py | Python | yt_dlp/extractor/frontendmasters.py | michaeljohnm/yt-dlp | 962a5cd9c4e92c3140ae2fe245c0cb0de6e177c7 | [
"Unlicense"
] | 2 | 2022-03-14T15:34:14.000Z | 2022-03-23T17:05:42.000Z | yt_dlp/extractor/frontendmasters.py | michaeljohnm/yt-dlp | 962a5cd9c4e92c3140ae2fe245c0cb0de6e177c7 | [
"Unlicense"
] | null | null | null | yt_dlp/extractor/frontendmasters.py | michaeljohnm/yt-dlp | 962a5cd9c4e92c3140ae2fe245c0cb0de6e177c7 | [
"Unlicense"
] | 1 | 2022-01-03T08:13:27.000Z | 2022-01-03T08:13:27.000Z | # coding: utf-8
from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..compat import (
compat_str,
compat_urlparse,
)
from ..utils import (
ExtractorError,
parse_duration,
url_or_none,
urlencode_postdata,
)
class FrontendMastersBaseIE(InfoExtractor):
_... | 33.409091 | 113 | 0.560884 |
f84f70308497ce4354165d036ecda0e135aac898 | 4,678 | py | Python | scripts/hex2bin.py | pablovillars/intelhex | c9beea9f1000d632057efa7ee15f8d1645d0ca97 | [
"BSD-3-Clause"
] | null | null | null | scripts/hex2bin.py | pablovillars/intelhex | c9beea9f1000d632057efa7ee15f8d1645d0ca97 | [
"BSD-3-Clause"
] | null | null | null | scripts/hex2bin.py | pablovillars/intelhex | c9beea9f1000d632057efa7ee15f8d1645d0ca97 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/python
# Copyright (c) 2005-2018 Alexander Belchenko
# All rights reserved.
#
# Redistribution and use in source and binary forms,
# with or without modification, are permitted provided
# that the following conditions are met:
#
# * Redistributions of source code must retain
# the above copyright notice, ... | 35.172932 | 107 | 0.579521 |
229b6ab192226872d3b3a56df57bf2c8db312dab | 647 | py | Python | apps/wiki/management/commands/dump_topics.py | storagebot/kitsune | 613ba2ca09104f330ab77088b452391169096249 | [
"BSD-3-Clause"
] | 2 | 2019-08-19T17:08:47.000Z | 2019-10-05T11:37:02.000Z | apps/wiki/management/commands/dump_topics.py | taliasman/kitsune | f8085205eef143011adb4c52d1f183da06c1c58e | [
"BSD-3-Clause"
] | null | null | null | apps/wiki/management/commands/dump_topics.py | taliasman/kitsune | f8085205eef143011adb4c52d1f183da06c1c58e | [
"BSD-3-Clause"
] | null | null | null | from django.core.management.base import BaseCommand
from taggit.models import TaggedItem
from wiki.models import Document
class Command(BaseCommand):
help = 'Dumps out a python file with the topic strings.'
def handle(self, *arg, **kwargs):
print '###################################################... | 35.944444 | 74 | 0.53323 |
b3ff712aa637333e97271cd44bd5b56d05e8873a | 14,323 | py | Python | evap/staff/tests/test_tools.py | Sohn123/EvaP | 8b0ba8365cb673ef59829cf8db5ab829472a9c58 | [
"MIT"
] | null | null | null | evap/staff/tests/test_tools.py | Sohn123/EvaP | 8b0ba8365cb673ef59829cf8db5ab829472a9c58 | [
"MIT"
] | null | null | null | evap/staff/tests/test_tools.py | Sohn123/EvaP | 8b0ba8365cb673ef59829cf8db5ab829472a9c58 | [
"MIT"
] | null | null | null | from django.test import TestCase
from django.contrib.auth.models import Group
from django.core.cache import cache
from django.core.cache.utils import make_template_fragment_key
from model_bakery import baker
from evap.evaluation.tests.tools import WebTest
from evap.evaluation.models import Contribution, Course, Evalu... | 56.837302 | 172 | 0.702367 |
d759a5aab5ee09f4975c12551de36e2dda78f418 | 26,026 | py | Python | test/functional/feature_rbf.py | cocovault/bitcoin | 5455279a71e01c0bf9ed3070fa597e8f4e750e9d | [
"MIT"
] | 213 | 2015-01-25T19:45:22.000Z | 2022-02-24T22:48:03.000Z | test/functional/feature_rbf.py | cocovault/bitcoin | 5455279a71e01c0bf9ed3070fa597e8f4e750e9d | [
"MIT"
] | 43 | 2015-01-20T19:37:19.000Z | 2021-04-28T13:01:56.000Z | test/functional/feature_rbf.py | cocovault/bitcoin | 5455279a71e01c0bf9ed3070fa597e8f4e750e9d | [
"MIT"
] | 32 | 2015-05-12T17:42:55.000Z | 2022-01-26T11:02:51.000Z | #!/usr/bin/env python3
# Copyright (c) 2014-2020 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test the RBF code."""
from copy import deepcopy
from decimal import Decimal
from test_framework.messa... | 41.376789 | 126 | 0.637132 |
81546c8d57f79b489b68e06db43e8c91d7ca9ce7 | 3,449 | py | Python | pipeline/mask_constant_regions.py | greninger-lab/tprk_diversity2 | c7fba6a42ae1476f6dce923184d0c0c0b7eed846 | [
"MIT"
] | null | null | null | pipeline/mask_constant_regions.py | greninger-lab/tprk_diversity2 | c7fba6a42ae1476f6dce923184d0c0c0b7eed846 | [
"MIT"
] | null | null | null | pipeline/mask_constant_regions.py | greninger-lab/tprk_diversity2 | c7fba6a42ae1476f6dce923184d0c0c0b7eed846 | [
"MIT"
] | null | null | null | # Masks constant regions in full length sequences from unwrap.fasta, which can be generated from the following command:
# awk 'BEGIN {RS=">";FS="\n";OFS=""} NR>1 {print ">"$1; $1=""; print}' Isolates_aa_filt_fullORFs.aln.fasta > unwrap.fasta
# Constant regions are found with fuzzy match based on length, and replaced ... | 34.838384 | 180 | 0.733546 |
0cc5e89622e5abf0cfd01ce1a97aad5032d83ba8 | 678 | py | Python | google/cloud/memcache_v1beta2/services/cloud_memcache/__init__.py | vam-google/python-memcache | 247ad6661e64d32fc4ba83b65b8f1562748dabe0 | [
"Apache-2.0"
] | null | null | null | google/cloud/memcache_v1beta2/services/cloud_memcache/__init__.py | vam-google/python-memcache | 247ad6661e64d32fc4ba83b65b8f1562748dabe0 | [
"Apache-2.0"
] | null | null | null | google/cloud/memcache_v1beta2/services/cloud_memcache/__init__.py | vam-google/python-memcache | 247ad6661e64d32fc4ba83b65b8f1562748dabe0 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... | 32.285714 | 74 | 0.750737 |
b6d9bf785b5406fe0d86ca83d6b96535ff39dd37 | 11,701 | py | Python | pkgs/ipython-1.2.1-py27_0/lib/python2.7/site-packages/IPython/core/pylabtools.py | wangyum/anaconda | 6e5a0dbead3327661d73a61e85414cf92aa52be6 | [
"Apache-2.0",
"BSD-3-Clause"
] | 26 | 2018-02-14T23:52:58.000Z | 2021-08-16T13:50:03.000Z | pkgs/ipython-1.2.1-py27_0/lib/python2.7/site-packages/IPython/core/pylabtools.py | wangyum/anaconda | 6e5a0dbead3327661d73a61e85414cf92aa52be6 | [
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | pkgs/ipython-1.2.1-py27_0/lib/python2.7/site-packages/IPython/core/pylabtools.py | wangyum/anaconda | 6e5a0dbead3327661d73a61e85414cf92aa52be6 | [
"Apache-2.0",
"BSD-3-Clause"
] | 10 | 2018-08-13T19:38:39.000Z | 2020-04-19T03:02:00.000Z | # -*- coding: utf-8 -*-
"""Pylab (matplotlib) support utilities.
Authors
-------
* Fernando Perez.
* Brian Granger
"""
#-----------------------------------------------------------------------------
# Copyright (C) 2009 The IPython Development Team
#
# Distributed under the terms of the BSD License. The full lice... | 34.414706 | 87 | 0.627724 |
0c4f9df7b10e49a9781d16ebba44dffa8e5e8c88 | 699 | py | Python | config.py | njiiri12/News-Highlights | ff9e2170c2b8f7f54534a4b9de38a55a111b0ad8 | [
"MIT"
] | null | null | null | config.py | njiiri12/News-Highlights | ff9e2170c2b8f7f54534a4b9de38a55a111b0ad8 | [
"MIT"
] | null | null | null | config.py | njiiri12/News-Highlights | ff9e2170c2b8f7f54534a4b9de38a55a111b0ad8 | [
"MIT"
] | null | null | null | import os
class Config:
'''
General configuration parent class
'''
NEWS_API_BASE_URL = 'https://newsapi.org/v2/sources?apiKey={}'
NEWS_API_KEY = os.environ.get('NEWS_API_KEY')
SECRET_KEY = os.environ.get('SECRET_KEY')
class ProdConfig(Config):
'''
Production configuration child class
... | 20.558824 | 82 | 0.683834 |
bc5e03b2e0f3899b490b55bc52487166fc9e49c1 | 385 | py | Python | pydoccano/features.py | evstratbg/pydoccano | ce14307cae53f785f714656981b5b9a463758ef3 | [
"MIT"
] | 2 | 2020-04-11T14:48:28.000Z | 2020-09-24T12:38:30.000Z | pydoccano/features.py | evstratbg/pydoccano | ce14307cae53f785f714656981b5b9a463758ef3 | [
"MIT"
] | null | null | null | pydoccano/features.py | evstratbg/pydoccano | ce14307cae53f785f714656981b5b9a463758ef3 | [
"MIT"
] | 2 | 2020-04-06T11:46:45.000Z | 2020-04-27T03:18:46.000Z | from requests import Session
from .base_api import BaseApi
class Features(BaseApi):
def __init__(self, base_url: str, session: Session, version='v1'):
super().__init__(base_url)
self.session = session
self.version = version
self.base_endpoint = f"{self.version}/features"
def ... | 25.666667 | 70 | 0.680519 |
94f31e77d2a4496e05d3edc5301d8705bf4f2c2f | 108,821 | py | Python | cottonformation/res/kinesisanalyticsv2.py | MacHu-GWU/cottonformation-project | 23e28c08cfb5a7cc0db6dbfdb1d7e1585c773f3b | [
"BSD-2-Clause"
] | 5 | 2021-07-22T03:45:59.000Z | 2021-12-17T21:07:14.000Z | cottonformation/res/kinesisanalyticsv2.py | MacHu-GWU/cottonformation-project | 23e28c08cfb5a7cc0db6dbfdb1d7e1585c773f3b | [
"BSD-2-Clause"
] | 1 | 2021-06-25T18:01:31.000Z | 2021-06-25T18:01:31.000Z | cottonformation/res/kinesisanalyticsv2.py | MacHu-GWU/cottonformation-project | 23e28c08cfb5a7cc0db6dbfdb1d7e1585c773f3b | [
"BSD-2-Clause"
] | 2 | 2021-06-27T03:08:21.000Z | 2021-06-28T22:15:51.000Z | # -*- coding: utf-8 -*-
"""
This module
"""
import attr
import typing
from ..core.model import (
Property, Resource, Tag, GetAtt, TypeHint, TypeCheck,
)
from ..core.constant import AttrMeta
#--- Property declaration ---
@attr.s
class PropApplicationReferenceDataSourceRecordColumn(Property):
"""
AWS Obj... | 70.662987 | 292 | 0.806572 |
f51eff90ca841ee72accff3faef75c4e7bd858be | 1,035 | py | Python | Curso/paquete/41_filter.py | jsalmoralp/Python-Proyecto-Apuntes | cf4265e08e947aca1dbe9ec4ed1dfb7cb10e9309 | [
"MIT"
] | null | null | null | Curso/paquete/41_filter.py | jsalmoralp/Python-Proyecto-Apuntes | cf4265e08e947aca1dbe9ec4ed1dfb7cb10e9309 | [
"MIT"
] | null | null | null | Curso/paquete/41_filter.py | jsalmoralp/Python-Proyecto-Apuntes | cf4265e08e947aca1dbe9ec4ed1dfb7cb10e9309 | [
"MIT"
] | null | null | null | """
Filter: Funciones de orden superior (programación funcional).
Verifica que los elementos de una lista cumplan una determinada condición, devolviendo
un objeto iterable (iterador) con los elementos que cumplieron con la condición.
"""
edades = [12, 11, 24, 36, 8, 6, 10, 41, 32, 58, 14, 50, 7]
def mayor_edad(edad)... | 23.522727 | 86 | 0.676329 |
e1fafbf1c177c2e91863fff7c640cad693c00f12 | 4,478 | py | Python | 抖音爬取签名,喜欢列表和关注列表/爬取抖音的用户信息和视频连接/douying.py | 13060923171/xianmu | 3deb9cdcf4ed1d821043ba1d3947ff35697e4aae | [
"MIT"
] | 29 | 2020-08-02T12:06:10.000Z | 2022-03-07T17:51:54.000Z | 抖音爬取签名,喜欢列表和关注列表/爬取抖音的用户信息和视频连接/douying.py | 13060923171/xianmu | 3deb9cdcf4ed1d821043ba1d3947ff35697e4aae | [
"MIT"
] | 3 | 2020-08-16T15:56:47.000Z | 2021-11-20T21:49:59.000Z | 抖音爬取签名,喜欢列表和关注列表/爬取抖音的用户信息和视频连接/douying.py | 13060923171/xianmu | 3deb9cdcf4ed1d821043ba1d3947ff35697e4aae | [
"MIT"
] | 15 | 2020-08-16T08:28:08.000Z | 2021-09-29T07:17:38.000Z | import requests
import urllib3
'''
GET https://api3-core-c-hl.amemv.com/aweme/v1/aweme/post/?source=0&publish_video_strategy_type=0&max_cursor=1587528101000&sec_user_id=MS4wLjABAAAA4s3jerVDPUA_xvyoGhRypnn8ijAtUfrt9rCWL2aXxtU&count=10&ts=1587635299&host_abi=armeabi-v7a&_rticket=1587635299508&mcc_mnc=46007& HTTP/1.1
Host... | 69.96875 | 628 | 0.792541 |
f21a3256b17eeb96c8b30caae7ed89f9a8f1e826 | 225 | py | Python | blog/forms.py | emreatadl/atadil-personal-blog | 88c7be19d6a27b39fd86ff3d9c34b11443291e0e | [
"MIT"
] | 1 | 2021-08-23T18:30:39.000Z | 2021-08-23T18:30:39.000Z | blog/forms.py | emreatadl/atadil-personal-blog | 88c7be19d6a27b39fd86ff3d9c34b11443291e0e | [
"MIT"
] | 1 | 2021-06-02T02:44:15.000Z | 2021-06-02T02:44:15.000Z | blog/forms.py | emreatadl/atadil-personal-blog | 88c7be19d6a27b39fd86ff3d9c34b11443291e0e | [
"MIT"
] | null | null | null | from django import forms
from .models import Comment
class CommentForm(forms.ModelForm):
class Meta:
model = Comment
fields = (
'author',
'email',
'comment'
) | 17.307692 | 35 | 0.528889 |
1f385a96bb33542591c5e83aa3bccfc2d936b58f | 6,614 | py | Python | OLD_MNIST_train_test.py | sansseriff/ee148_FinalProject | 64938c7cb9bd3f9bcf295eb134dbaa209f76f88a | [
"MIT"
] | null | null | null | OLD_MNIST_train_test.py | sansseriff/ee148_FinalProject | 64938c7cb9bd3f9bcf295eb134dbaa209f76f88a | [
"MIT"
] | null | null | null | OLD_MNIST_train_test.py | sansseriff/ee148_FinalProject | 64938c7cb9bd3f9bcf295eb134dbaa209f76f88a | [
"MIT"
] | null | null | null |
def train(args, model, device, train_loader, optimizer, epoch):
'''
#This is your training function. When you call this function, the model is
#trained for 1 epoch.
'''
model.train() # Set the model to training mode
total_loss = 0
for batch_idx, (data, target) in enumerate(train_loader):... | 34.092784 | 121 | 0.513456 |
f271b87283aadabb9026ab47462e1036593b6b47 | 1,207 | py | Python | classification/utils/cutout.py | voldemortX/DST-CBC | e392313c129f6814c1a1c0f20c0abbd5505c3d7d | [
"BSD-3-Clause"
] | 103 | 2020-04-21T01:25:16.000Z | 2022-03-24T07:45:45.000Z | classification/utils/cutout.py | voldemortX/DST-CBC | e392313c129f6814c1a1c0f20c0abbd5505c3d7d | [
"BSD-3-Clause"
] | 13 | 2021-03-24T06:52:21.000Z | 2022-01-18T08:17:50.000Z | classification/utils/cutout.py | voldemortX/DST-CBC | e392313c129f6814c1a1c0f20c0abbd5505c3d7d | [
"BSD-3-Clause"
] | 12 | 2020-04-29T02:33:11.000Z | 2021-12-28T07:59:20.000Z | # Copied from uoguelph-mlrg/Cutout
import torch
import numpy as np
class Cutout(object):
"""Randomly mask out one or more patches from an image.
Args:
n_holes (int): Number of patches to cut out of each image.
length (int): The length (in pixels) of each square patch.
"""
def __init__... | 26.822222 | 82 | 0.528583 |
fdef9f4a13087312fde8e594440a942c62ea763c | 4,277 | py | Python | rapid/gui/controller.py | jensengrouppsu/rapid | 9f925e0561327a169a44b45df2cd6dd1af188023 | [
"MIT"
] | 1 | 2021-05-12T22:40:20.000Z | 2021-05-12T22:40:20.000Z | rapid/gui/controller.py | lassejensen-psu/rapid | 9f925e0561327a169a44b45df2cd6dd1af188023 | [
"MIT"
] | null | null | null | rapid/gui/controller.py | lassejensen-psu/rapid | 9f925e0561327a169a44b45df2cd6dd1af188023 | [
"MIT"
] | 1 | 2017-03-03T23:21:41.000Z | 2017-03-03T23:21:41.000Z | from __future__ import print_function, division, absolute_import
# Non-std. lib imports
from PySide.QtCore import Signal, QObject
from numpy import ndarray, isnan, sum
# Local imports
from rapid.common import spectrum
from rapid.gui.peak import PeakModel
from rapid.gui.exchange import ExchangeModel, NumPeaks
from rap... | 33.944444 | 82 | 0.631985 |
0af9039aca18f5bd4ba800252a0ca6ad845d181b | 10,944 | py | Python | Tools/benchmarks/richards_static_basic_lib.py | mananpal1997/cinder | a8804cc6e3a5861463ff959abcd09ad60a0763e5 | [
"CNRI-Python-GPL-Compatible"
] | 1,886 | 2021-05-03T23:58:43.000Z | 2022-03-31T19:15:58.000Z | Tools/benchmarks/richards_static_basic_lib.py | mananpal1997/cinder | a8804cc6e3a5861463ff959abcd09ad60a0763e5 | [
"CNRI-Python-GPL-Compatible"
] | 70 | 2021-05-04T23:25:35.000Z | 2022-03-31T18:42:08.000Z | Tools/benchmarks/richards_static_basic_lib.py | mananpal1997/cinder | a8804cc6e3a5861463ff959abcd09ad60a0763e5 | [
"CNRI-Python-GPL-Compatible"
] | 52 | 2021-05-04T21:26:03.000Z | 2022-03-08T18:02:56.000Z | # Copyright (c) Facebook, Inc. and its affiliates. (http://www.facebook.com)
"""
based on a Java version:
Based on original version written in BCPL by Dr Martin Richards
in 1981 at Cambridge University Computer Laboratory, England
and a C++ version derived from a Smalltalk version written by
L Peter Deutsch.
Java ... | 25.811321 | 102 | 0.567343 |
d0a5d3dc002db24fd5e6d16c04416c065a74ad3f | 1,390 | py | Python | client_led_slider.py | chenphilip888/rockpi4b-qt5-wifi | e36deba2b12b8c5a6586c92713651ba849d3190b | [
"MIT"
] | null | null | null | client_led_slider.py | chenphilip888/rockpi4b-qt5-wifi | e36deba2b12b8c5a6586c92713651ba849d3190b | [
"MIT"
] | null | null | null | client_led_slider.py | chenphilip888/rockpi4b-qt5-wifi | e36deba2b12b8c5a6586c92713651ba849d3190b | [
"MIT"
] | null | null | null | #!/usr/bin/python3
import socket
import time
import sys
from PyQt5.QtWidgets import (QWidget, QMainWindow, QHBoxLayout, QStatusBar, QSlider, QApplication)
from PyQt5.QtCore import Qt
HOST = '192.168.86.205' # The remote host
PORT = 50007 # The same port as used by the server
sock=socket.socket(socket.... | 24.385965 | 98 | 0.605755 |
e8bf77eeac01b0a9f8b86fa914fce8bfc398b174 | 16,665 | py | Python | jose/jwt.py | Budovi/python-jose | a247cec58a5aa4ea5d3b45e3c90d55f66d98288f | [
"MIT"
] | 1 | 2018-12-19T10:30:05.000Z | 2018-12-19T10:30:05.000Z | jose/jwt.py | Budovi/python-jose | a247cec58a5aa4ea5d3b45e3c90d55f66d98288f | [
"MIT"
] | null | null | null | jose/jwt.py | Budovi/python-jose | a247cec58a5aa4ea5d3b45e3c90d55f66d98288f | [
"MIT"
] | null | null | null |
import json
from calendar import timegm
from collections import Mapping
from datetime import datetime
from datetime import timedelta
from six import string_types
from jose import jws
from .exceptions import JWSError
from .exceptions import JWTClaimsError
from .exceptions import JWTError
from .exceptions import Expi... | 34.64657 | 117 | 0.666787 |
ba08121f88fb3ccf2749280317bf3409d5497413 | 9,944 | py | Python | test/MCTS_test.py | choshina/coverage-confidence | c8b7fb2dc43094f0eb78abbdd6211dcefb6d4a63 | [
"CNRI-Python"
] | null | null | null | test/MCTS_test.py | choshina/coverage-confidence | c8b7fb2dc43094f0eb78abbdd6211dcefb6d4a63 | [
"CNRI-Python"
] | null | null | null | test/MCTS_test.py | choshina/coverage-confidence | c8b7fb2dc43094f0eb78abbdd6211dcefb6d4a63 | [
"CNRI-Python"
] | null | null | null | import sys
import os
model = ''
algorithm = ''
optimization = []
phi_str = []
controlpoints = ''
scalar = []
partitions = []
T_playout = []
N_max = []
input_name = []
input_range = []
status = 0
arg = ''
linenum = 0
timespan = ''
parameters = []
T = ''
loadfile = ''
addpath = []
argument = ''
trials = 30
#fal_home... | 40.422764 | 306 | 0.567981 |
544046bd19bc3dcf26bc0fe9edb7569c58870669 | 2,193 | py | Python | quiz/users/models.py | diego-marcelino/valora-quiz | 3218628a857153449dde47ed52d60bc901e9be0b | [
"MIT"
] | null | null | null | quiz/users/models.py | diego-marcelino/valora-quiz | 3218628a857153449dde47ed52d60bc901e9be0b | [
"MIT"
] | 3 | 2022-02-28T11:07:18.000Z | 2022-03-02T11:07:20.000Z | quiz/users/models.py | diego-marcelino/valora-quiz | 3218628a857153449dde47ed52d60bc901e9be0b | [
"MIT"
] | null | null | null | from django.contrib.auth.models import AbstractUser
from django.contrib.auth.models import BaseUserManager
from django.db import models
from django.db.models import CharField
from django.utils.translation import gettext_lazy as _
from quiz.core.events.new_user import notify as notify_new_user
class UserManager(BaseU... | 33.227273 | 79 | 0.632011 |
59d9a5de3ed1cc29bc72fcebb7bda7363d618922 | 4,027 | py | Python | scripts/make_confidence_report.py | iamgroot42/cleverhans | 53da9cd6daf9d7457800831c3eaa75f729a39145 | [
"MIT"
] | 21 | 2019-06-07T17:05:30.000Z | 2022-02-07T03:25:15.000Z | scripts/make_confidence_report.py | iamgroot42/cleverhans | 53da9cd6daf9d7457800831c3eaa75f729a39145 | [
"MIT"
] | 1 | 2021-03-01T15:06:09.000Z | 2021-03-01T15:06:09.000Z | scripts/make_confidence_report.py | iamgroot42/cleverhans | 53da9cd6daf9d7457800831c3eaa75f729a39145 | [
"MIT"
] | 8 | 2019-06-11T03:06:29.000Z | 2022-01-18T04:18:27.000Z | #!/usr/bin/env python3
"""
make_confidence_report.py
Usage:
python make_confidence_report.py model.joblib
where model.joblib is a file created by cleverhans.serial.save containing
a picklable cleverhans.model.Model instance.
This script will run the model on a variety of types of data and save an
instance of cl... | 41.947917 | 79 | 0.732555 |
1893cc4397532c7c4826225e5c37feb6bd97a8ba | 4,102 | py | Python | conv64.py | DeuterCat/VAEAN | b369fc84a7ca2d062f60bb0d634e26be21c72fa2 | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | null | null | null | conv64.py | DeuterCat/VAEAN | b369fc84a7ca2d062f60bb0d634e26be21c72fa2 | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | null | null | null | conv64.py | DeuterCat/VAEAN | b369fc84a7ca2d062f60bb0d634e26be21c72fa2 | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | null | null | null | import torch
from torch import nn
class Conv64F(nn.Module):
def __init__(
self,
is_flatten=False,
is_feature=False,
leaky_relu=False,
negative_slope=0.2,
last_pool=True,
maxpool_last2=True,
):
super(Conv64F, self).__init__()
self.is_flat... | 27.530201 | 83 | 0.532667 |
5e1a120d90308fa97611261b3a007f1c096b0d7a | 46,859 | py | Python | sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_p2_svpn_gateways_operations.py | rsdoherty/azure-sdk-for-python | 6bba5326677468e6660845a703686327178bb7b1 | [
"MIT"
] | 3 | 2020-06-23T02:25:27.000Z | 2021-09-07T18:48:11.000Z | sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_p2_svpn_gateways_operations.py | rsdoherty/azure-sdk-for-python | 6bba5326677468e6660845a703686327178bb7b1 | [
"MIT"
] | 510 | 2019-07-17T16:11:19.000Z | 2021-08-02T08:38:32.000Z | sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_p2_svpn_gateways_operations.py | rsdoherty/azure-sdk-for-python | 6bba5326677468e6660845a703686327178bb7b1 | [
"MIT"
] | 5 | 2019-09-04T12:51:37.000Z | 2020-09-16T07:28:40.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.277897 | 248 | 0.667556 |
fee121e91f15c0fb122ff98f7dadff1010d8f474 | 3,958 | py | Python | kubernetes/client/models/v1_secret_reference.py | anemerovsky-essextec/python | 6e40b9169b27c3f1f9422c0f6dd1cd9caef8d57c | [
"Apache-2.0"
] | null | null | null | kubernetes/client/models/v1_secret_reference.py | anemerovsky-essextec/python | 6e40b9169b27c3f1f9422c0f6dd1cd9caef8d57c | [
"Apache-2.0"
] | null | null | null | kubernetes/client/models/v1_secret_reference.py | anemerovsky-essextec/python | 6e40b9169b27c3f1f9422c0f6dd1cd9caef8d57c | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
"""
Kubernetes
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
OpenAPI spec version: v1.12.1
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from pprint import pformat
from six import iteritems
import re... | 25.535484 | 105 | 0.555584 |
f023956c3093611564ed32065189f13dc835a269 | 6,015 | py | Python | mars/tensor/statistics/percentile.py | hxri/mars | f7864f00911883b94800b63856f0e57648d3d9b4 | [
"Apache-2.0"
] | 2,413 | 2018-12-06T09:37:11.000Z | 2022-03-30T15:47:39.000Z | mars/tensor/statistics/percentile.py | hxri/mars | f7864f00911883b94800b63856f0e57648d3d9b4 | [
"Apache-2.0"
] | 1,335 | 2018-12-07T03:06:18.000Z | 2022-03-31T11:45:57.000Z | mars/tensor/statistics/percentile.py | hxri/mars | f7864f00911883b94800b63856f0e57648d3d9b4 | [
"Apache-2.0"
] | 329 | 2018-12-07T03:12:41.000Z | 2022-03-29T21:49:57.000Z | # Copyright 1999-2021 Alibaba Group Holding 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 a... | 36.90184 | 92 | 0.609643 |
c36f9f7f9418e2f2919b628f31db8666f993916d | 6,483 | py | Python | lenstronomy/LensModel/Profiles/spp.py | jiwoncpark/lenstronomy | c1d12580f8d8cf1d065d80568a58c0694e23945a | [
"MIT"
] | 1 | 2020-07-31T07:55:17.000Z | 2020-07-31T07:55:17.000Z | lenstronomy/LensModel/Profiles/spp.py | jiwoncpark/lenstronomy | c1d12580f8d8cf1d065d80568a58c0694e23945a | [
"MIT"
] | null | null | null | lenstronomy/LensModel/Profiles/spp.py | jiwoncpark/lenstronomy | c1d12580f8d8cf1d065d80568a58c0694e23945a | [
"MIT"
] | 2 | 2020-10-26T10:45:11.000Z | 2021-03-04T12:25:19.000Z | __author__ = 'sibirrer'
import numpy as np
import scipy.special as special
from lenstronomy.LensModel.Profiles.base_profile import LensProfileBase
class SPP(LensProfileBase):
"""
class for circular power-law mass distribution
"""
param_names = ['theta_E', 'gamma', 'center_x', 'center_y']
lower_l... | 28.685841 | 146 | 0.518896 |
b8f5ca62b55f214730bf24e33e3a4af325b39862 | 3,249 | py | Python | openstack-placement-1.0.0/api-ref/source/conf.py | scottwedge/OpenStack-Stein | 7077d1f602031dace92916f14e36b124f474de15 | [
"Apache-2.0"
] | null | null | null | openstack-placement-1.0.0/api-ref/source/conf.py | scottwedge/OpenStack-Stein | 7077d1f602031dace92916f14e36b124f474de15 | [
"Apache-2.0"
] | 5 | 2019-08-14T06:46:03.000Z | 2021-12-13T20:01:25.000Z | openstack-placement-1.0.0/api-ref/source/conf.py | scottwedge/OpenStack-Stein | 7077d1f602031dace92916f14e36b124f474de15 | [
"Apache-2.0"
] | 2 | 2018-08-23T00:07:14.000Z | 2018-08-27T10:10:02.000Z | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the... | 31.543689 | 79 | 0.700523 |
7479a986334cf911345532f80bba6314495d33be | 2,640 | py | Python | tests/test_regularization_plot.py | UBC-MDS/ezmodel | 66f7d38c41778c65bbdbec85533c496bb796be47 | [
"MIT"
] | 3 | 2018-02-15T01:31:50.000Z | 2018-03-03T18:56:45.000Z | tests/test_regularization_plot.py | UBC-MDS/ezmodel | 66f7d38c41778c65bbdbec85533c496bb796be47 | [
"MIT"
] | 15 | 2018-02-15T01:38:55.000Z | 2018-03-24T19:31:51.000Z | tests/test_regularization_plot.py | UBC-MDS/ezmodel | 66f7d38c41778c65bbdbec85533c496bb796be47 | [
"MIT"
] | null | null | null | import pytest
import numpy as np
from sklearn.linear_model import Ridge, Lasso, LogisticRegression, LinearRegression
from sklearn.datasets import load_boston, load_breast_cancer
from ezmodel.ezmodel import regularization_plot
def test_input_model_type():
"""Checks TypeError is raised when input model isn't of allo... | 40.615385 | 99 | 0.704167 |
bfbd5447f293c90d5faa94ba91266c9c7c3ef7d5 | 3,476 | py | Python | tests/modeltests/unmanaged_models/models.py | yarko/django | 90b6240c8753ece3e52cafc37e1088b0646b843f | [
"BSD-3-Clause"
] | 1 | 2016-03-02T01:21:34.000Z | 2016-03-02T01:21:34.000Z | tests/modeltests/unmanaged_models/models.py | yarko/django | 90b6240c8753ece3e52cafc37e1088b0646b843f | [
"BSD-3-Clause"
] | null | null | null | tests/modeltests/unmanaged_models/models.py | yarko/django | 90b6240c8753ece3e52cafc37e1088b0646b843f | [
"BSD-3-Clause"
] | null | null | null | """
Models can have a ``managed`` attribute, which specifies whether the SQL code
is generated for the table on various manage.py operations.
"""
from django.db import models
# All of these models are created in the database by Django.
class A01(models.Model):
f_a = models.CharField(max_length=10, db_index=True... | 27.587302 | 79 | 0.686421 |
789fe3d9ed9df615d7efd0662fc6ed5d9a1a6442 | 2,741 | py | Python | src/utils/idmapper/tests.py | reddcoin-project/ReddConnect | 5c212683de6b80b81fd15ed05239c3a1b46c3afd | [
"BSD-3-Clause"
] | 5 | 2015-08-24T10:00:48.000Z | 2020-04-18T07:10:50.000Z | src/utils/idmapper/tests.py | reddcoin-project/ReddConnect | 5c212683de6b80b81fd15ed05239c3a1b46c3afd | [
"BSD-3-Clause"
] | 2 | 2017-12-28T21:36:48.000Z | 2017-12-28T21:36:57.000Z | src/utils/idmapper/tests.py | reddcoin-project/ReddConnect | 5c212683de6b80b81fd15ed05239c3a1b46c3afd | [
"BSD-3-Clause"
] | 2 | 2019-09-29T01:32:26.000Z | 2021-07-13T07:13:55.000Z | from django.test import TestCase
from base import SharedMemoryModel
from django.db import models
class Category(SharedMemoryModel):
name = models.CharField(max_length=32)
class RegularCategory(models.Model):
name = models.CharField(max_length=32)
class Article(SharedMemoryModel):
name = models.CharField... | 39.157143 | 109 | 0.680409 |
8d4ee6524d65e8e3e9c85747ea1a22e8ed346ff9 | 265 | py | Python | manage.py | Mohammad-Kabajah/django_project | 6598668dbc4f8d777ccf716464d259c49d881cd8 | [
"Apache-2.0"
] | null | null | null | manage.py | Mohammad-Kabajah/django_project | 6598668dbc4f8d777ccf716464d259c49d881cd8 | [
"Apache-2.0"
] | null | null | null | manage.py | Mohammad-Kabajah/django_project | 6598668dbc4f8d777ccf716464d259c49d881cd8 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "project_name.settings")
from django.core.management import execute_from_command_line
execute_from_command_line(sys.argv)
| 24.090909 | 77 | 0.74717 |
cc10d218140090c05fe0605c38f3bf69e6dfa278 | 108,892 | py | Python | src/azure-cli/azure/cli/command_modules/storage/_help.py | nexxai/azure-cli | 3f24ada49f3323d9310d46ccc1025dc99fc4cf8e | [
"MIT"
] | null | null | null | src/azure-cli/azure/cli/command_modules/storage/_help.py | nexxai/azure-cli | 3f24ada49f3323d9310d46ccc1025dc99fc4cf8e | [
"MIT"
] | null | null | null | src/azure-cli/azure/cli/command_modules/storage/_help.py | nexxai/azure-cli | 3f24ada49f3323d9310d46ccc1025dc99fc4cf8e | [
"MIT"
] | null | null | null | # coding=utf-8
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# -----------------------------------------------------... | 50.483078 | 417 | 0.734306 |
e2a0387552e4669637861a8103e4af53e322bd8e | 5,145 | py | Python | pipeline_template_new.py | linlabcode/pipeline | 396ff17a67c9323024b9448665529142b6aa18be | [
"MIT"
] | 3 | 2017-10-05T10:04:48.000Z | 2018-11-15T17:19:58.000Z | pipeline_template_new.py | linlabcode/pipeline | 396ff17a67c9323024b9448665529142b6aa18be | [
"MIT"
] | 2 | 2017-02-14T14:33:55.000Z | 2018-12-27T11:30:51.000Z | pipeline_template_new.py | linlabcode/pipeline | 396ff17a67c9323024b9448665529142b6aa18be | [
"MIT"
] | 10 | 2016-09-07T18:02:30.000Z | 2019-02-28T00:11:24.000Z | #!/usr/bin/python
'''
The MIT License (MIT)
Copyright (c) 2018 Charles Lin
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, c... | 33.627451 | 214 | 0.577065 |
fbc2e525c1c5a58efcff08c48f1071f63a34f477 | 12,299 | py | Python | SimpleCV/Features/BlobMaker.py | ingenuitas/SimpleCV | f9ed8ba40a36423f9beac6931590297a8bb5b064 | [
"BSD-3-Clause"
] | 14 | 2015-02-10T13:07:27.000Z | 2021-02-10T16:26:48.000Z | SimpleCV/Features/BlobMaker.py | hav3n/SimpleCV | a9bb3fc2eb7b47d2ae106c2e8efc28b61eb497c1 | [
"BSD-3-Clause"
] | null | null | null | SimpleCV/Features/BlobMaker.py | hav3n/SimpleCV | a9bb3fc2eb7b47d2ae106c2e8efc28b61eb497c1 | [
"BSD-3-Clause"
] | 16 | 2015-02-23T21:18:28.000Z | 2019-04-17T11:10:28.000Z | from SimpleCV.base import *
#import cv2 as cv2
class BlobMaker:
"""
Blob maker encapsulates all of the contour extraction process and data, so
it can be used inside the image class, or extended and used outside the image
class. The general idea is that the blob maker provides the utilites that one
... | 40.19281 | 299 | 0.61005 |
1b687a77cbb03c16d138693d050c1be02eb29de1 | 761 | py | Python | simplyscript_django/urls.py | kokhoor/SimplyScript_django | 6d7f12af400a14a2415893dabfed8746dda46a9f | [
"Apache-2.0"
] | null | null | null | simplyscript_django/urls.py | kokhoor/SimplyScript_django | 6d7f12af400a14a2415893dabfed8746dda46a9f | [
"Apache-2.0"
] | null | null | null | simplyscript_django/urls.py | kokhoor/SimplyScript_django | 6d7f12af400a14a2415893dabfed8746dda46a9f | [
"Apache-2.0"
] | null | null | null | """simplyscript_django URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/3.2/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, name='home')... | 34.590909 | 77 | 0.713535 |
107a5e35b2847e17b36a7e72cc9765c9c287e8fa | 2,423 | py | Python | sympy/tensor/array/expressions/tests/test_as_explicit.py | shilpiprd/sympy | 556e9c61b31d0d5f101cd56b43e843fbf3bcf121 | [
"BSD-3-Clause"
] | 8,323 | 2015-01-02T15:51:43.000Z | 2022-03-31T13:13:19.000Z | sympy/tensor/array/expressions/tests/test_as_explicit.py | shilpiprd/sympy | 556e9c61b31d0d5f101cd56b43e843fbf3bcf121 | [
"BSD-3-Clause"
] | 15,102 | 2015-01-01T01:33:17.000Z | 2022-03-31T22:53:13.000Z | sympy/tensor/array/expressions/tests/test_as_explicit.py | shilpiprd/sympy | 556e9c61b31d0d5f101cd56b43e843fbf3bcf121 | [
"BSD-3-Clause"
] | 4,490 | 2015-01-01T17:48:07.000Z | 2022-03-31T17:24:05.000Z | from sympy import ImmutableDenseNDimArray, tensorproduct, MatrixSymbol, tensorcontraction, tensordiagonal, permutedims, \
Symbol
from sympy.tensor.array.expressions.array_expressions import ZeroArray, OneArray, ArraySymbol, \
ArrayTensorProduct, PermuteDims, ArrayDiagonal, ArrayContraction, ArrayAdd
from sympy.... | 39.080645 | 121 | 0.684276 |
ca437d905b6c26a81af3fb014e39b7bd82767d8b | 3,304 | py | Python | 2015/23-opening_lock/solve.py | BrendanLeber/adventofcode | ea12330888b22609d4b7c849d388e42ed56291a8 | [
"MIT"
] | null | null | null | 2015/23-opening_lock/solve.py | BrendanLeber/adventofcode | ea12330888b22609d4b7c849d388e42ed56291a8 | [
"MIT"
] | null | null | null | 2015/23-opening_lock/solve.py | BrendanLeber/adventofcode | ea12330888b22609d4b7c849d388e42ed56291a8 | [
"MIT"
] | 1 | 2019-03-21T16:21:03.000Z | 2019-03-21T16:21:03.000Z | # -*- coding: utf-8 -*-
import argparse
import pdb
import traceback
from dataclasses import dataclass
from typing import Dict, List, Optional, Tuple
@dataclass
class Instruction:
name: str
reg: Optional[str]
offset: Optional[int]
def __str__(self) -> str:
if self.name in ["hlf", "tpl", "inc"... | 28.730435 | 95 | 0.516041 |
b41caeee14a7463da250e2f2b4b3ed0ef3e584b6 | 7,183 | py | Python | src/dynamodb_encryption_sdk/delegated_keys/__init__.py | robin-aws/aws-dynamodb-encryption-python | 25c7c3d80bfbe0deb661b4beb86f61b8b2f8545e | [
"Apache-2.0"
] | null | null | null | src/dynamodb_encryption_sdk/delegated_keys/__init__.py | robin-aws/aws-dynamodb-encryption-python | 25c7c3d80bfbe0deb661b4beb86f61b8b2f8545e | [
"Apache-2.0"
] | 1 | 2021-03-20T05:42:35.000Z | 2021-03-20T05:42:35.000Z | src/dynamodb_encryption_sdk/delegated_keys/__init__.py | robin-aws/aws-dynamodb-encryption-python | 25c7c3d80bfbe0deb661b4beb86f61b8b2f8545e | [
"Apache-2.0"
] | null | null | null | # Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"). You
# may not use this file except in compliance with the License. A copy of
# the License is located at
#
# http://aws.amazon.com/apache2.0/
#
# or in the "license" file accompa... | 41.281609 | 110 | 0.678686 |
03a56608307d0d70cb834db624a458069a8a7ffd | 1,775 | py | Python | src/tools/tile_hist.py | Vizzuality/DeforestationAnalysisTool | 30ce145404a333fecab05898053981f782a8e432 | [
"MIT",
"BSD-3-Clause"
] | 5 | 2018-05-28T08:02:11.000Z | 2022-01-22T11:34:08.000Z | src/tools/tile_hist.py | ImazonSadGoogle/DeforestationAnalysisTool | 1d2fd5f13b06265f8c043f44064c453f8d662086 | [
"MIT",
"BSD-3-Clause"
] | null | null | null | src/tools/tile_hist.py | ImazonSadGoogle/DeforestationAnalysisTool | 1d2fd5f13b06265f8c043f44064c453f8d662086 | [
"MIT",
"BSD-3-Clause"
] | 3 | 2016-01-18T09:37:14.000Z | 2020-07-10T10:57:56.000Z |
import sys
import Image
from os import walk
from os.path import join
from itertools import chain
from collections import defaultdict
from multiprocessing import Pool
from pipe import Pipe
def image_hist(image_path):
hist = defaultdict(float)
try:
i = Image.open(image_path)
except IOError:
... | 22.1875 | 95 | 0.588732 |
a6076cde61f1c09f0d21e196d1e2f3219bd1ac79 | 1,984 | py | Python | lib/models/roi_align/roi_align/roi_align.py | liuqk3/GSM | 188965b3a11f9cdbe166d79cac7cd2e9fb4c1785 | [
"MIT"
] | 3 | 2021-06-16T13:06:27.000Z | 2021-12-27T03:52:51.000Z | models/planercnn/roi_align/roi_align.py | namanshrimali/doepd.ai | fc57af2e131965d9d6c89e39a3eeab41c8dff40b | [
"MIT"
] | 5 | 2021-08-25T16:16:51.000Z | 2022-03-12T00:57:46.000Z | models/planercnn/roi_align/roi_align.py | namanshrimali/doepd.ai | fc57af2e131965d9d6c89e39a3eeab41c8dff40b | [
"MIT"
] | 1 | 2021-12-01T13:31:38.000Z | 2021-12-01T13:31:38.000Z | import torch
from torch import nn
from .crop_and_resize import CropAndResizeFunction, CropAndResize
class RoIAlign(nn.Module):
def __init__(self, crop_height, crop_width, extrapolation_value=0, transform_fpcoor=True):
super(RoIAlign, self).__init__()
self.crop_height = crop_height
self.... | 40.489796 | 146 | 0.626008 |
bf6fcc361f0c04fa007014f555fbdd35c528747f | 48,008 | py | Python | openprocurement/auctions/appraisal/tests/blanks/tender_blanks.py | oleksiyVeretiuk/openprocurement.auctions.appraisal | 710130ae54f4c46c17cb4fbc0cf485b81cd3624e | [
"Apache-2.0"
] | null | null | null | openprocurement/auctions/appraisal/tests/blanks/tender_blanks.py | oleksiyVeretiuk/openprocurement.auctions.appraisal | 710130ae54f4c46c17cb4fbc0cf485b81cd3624e | [
"Apache-2.0"
] | null | null | null | openprocurement/auctions/appraisal/tests/blanks/tender_blanks.py | oleksiyVeretiuk/openprocurement.auctions.appraisal | 710130ae54f4c46c17cb4fbc0cf485b81cd3624e | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
from copy import deepcopy
from hashlib import sha512
from uuid import uuid4
from datetime import timedelta
from iso8601 import parse_date
import pytz
from openprocurement.auctions.core.tests.base import JSON_RENDERER_ERROR
from openprocurement.auctions.core.utils import (
SANDBOX_MODE, TZ, ... | 51.677072 | 205 | 0.661306 |
e930369d5416d6bf19a394dfa48251e9106724e2 | 315 | py | Python | xpense.py | jsbruglie/xpense | 95e4e4925e6fcf058520ab3fb149f8d9498d836f | [
"MIT"
] | 3 | 2020-08-12T08:48:20.000Z | 2020-09-08T09:34:30.000Z | xpense.py | jsbruglie/xpense | 95e4e4925e6fcf058520ab3fb149f8d9498d836f | [
"MIT"
] | null | null | null | xpense.py | jsbruglie/xpense | 95e4e4925e6fcf058520ab3fb149f8d9498d836f | [
"MIT"
] | null | null | null | from app import create_app, db
from app.models import Transaction, TransactionType, Account
app = create_app()
@app.shell_context_processor
def make_shell_context():
return {
'db': db,
'Transaction': Transaction,
'TransactionType': TransactionType,
'Account': Account,
}
| 19.6875 | 60 | 0.67619 |
49bd163ba33cbab16eb82032dc84915b63c47817 | 895 | py | Python | userbot/plugins/bomber.py | apurba007/ubot0 | 73344dc4dc9263db541f43146402958094962919 | [
"MIT"
] | null | null | null | userbot/plugins/bomber.py | apurba007/ubot0 | 73344dc4dc9263db541f43146402958094962919 | [
"MIT"
] | null | null | null | userbot/plugins/bomber.py | apurba007/ubot0 | 73344dc4dc9263db541f43146402958094962919 | [
"MIT"
] | null | null | null | """NTC Bomber custom plugin by @scifidemon
Format .bombntc [phone number]"""
import asyncio
import requests
from userbot.utils import admin_cmd
@borg.on(admin_cmd("bombntc (.*)"))
async def _(event):
num=0
n=100
input_str = event.pattern_match.group(1)
if input_str:
num = int(input_str)
else... | 34.423077 | 226 | 0.694972 |
b9a4b3214ed9e21695e6ff96d50743f16e4eb98c | 2,189 | py | Python | ssseg/cfgs/apcnet/cfgs_cityscapes_resnet50os16.py | nianjiuhuiyi/sssegmentation | 4fc12ea7b80fe83170b6d3da0826e53a99ef5325 | [
"MIT"
] | 411 | 2020-10-22T02:24:57.000Z | 2022-03-31T11:19:17.000Z | ssseg/cfgs/apcnet/cfgs_cityscapes_resnet50os16.py | nianjiuhuiyi/sssegmentation | 4fc12ea7b80fe83170b6d3da0826e53a99ef5325 | [
"MIT"
] | 24 | 2020-12-21T03:53:54.000Z | 2022-03-17T06:50:00.000Z | ssseg/cfgs/apcnet/cfgs_cityscapes_resnet50os16.py | nianjiuhuiyi/sssegmentation | 4fc12ea7b80fe83170b6d3da0826e53a99ef5325 | [
"MIT"
] | 59 | 2020-12-04T03:40:12.000Z | 2022-03-30T09:12:47.000Z | '''define the config file for cityscapes and resnet50os16'''
import os
from .base_cfg import *
# modify dataset config
DATASET_CFG = DATASET_CFG.copy()
DATASET_CFG.update({
'type': 'cityscapes',
'rootdir': os.path.join(os.getcwd(), 'CityScapes'),
})
DATASET_CFG['train']['aug_opts'] = [
('Resize', {'output... | 29.986301 | 106 | 0.625857 |
20a05dfbde5452ca583c06d3e3e89645793744f8 | 4,337 | py | Python | keras/dtensor/optimizers_test.py | englert-m/keras | 7007cd0fd548032f1bb2c23b1defa4812628baec | [
"Apache-2.0"
] | null | null | null | keras/dtensor/optimizers_test.py | englert-m/keras | 7007cd0fd548032f1bb2c23b1defa4812628baec | [
"Apache-2.0"
] | null | null | null | keras/dtensor/optimizers_test.py | englert-m/keras | 7007cd0fd548032f1bb2c23b1defa4812628baec | [
"Apache-2.0"
] | null | null | null | # Copyright 2022 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 applica... | 41.701923 | 94 | 0.675582 |
5251476464b5ad56fb18ed56656c4e158c31ac51 | 2,026 | py | Python | features/steps/context-urlhelper.py | richardARPANET/behave-django | 10d401c3a9619d176e683b439ccac8b97f2f3e34 | [
"MIT"
] | null | null | null | features/steps/context-urlhelper.py | richardARPANET/behave-django | 10d401c3a9619d176e683b439ccac8b97f2f3e34 | [
"MIT"
] | null | null | null | features/steps/context-urlhelper.py | richardARPANET/behave-django | 10d401c3a9619d176e683b439ccac8b97f2f3e34 | [
"MIT"
] | null | null | null | from behave import when, then
from django.core.urlresolvers import reverse
from test_app.models import BehaveTestModel
@when(u'I call get_url() without arguments')
def without_args(context):
context.result = context.get_url()
@when(u'I call get_url("{url_path}") with an absolute path')
def path_arg(context, ur... | 32.677419 | 75 | 0.754689 |
f9daacec56dd26de5d9b2e90fbbc88933e922b65 | 549 | py | Python | apigateway/mission/resources.py | automation-liberation/api-gateway | 6c10f6a772ab578740e99a365e6b97e7761c5127 | [
"Apache-2.0"
] | null | null | null | apigateway/mission/resources.py | automation-liberation/api-gateway | 6c10f6a772ab578740e99a365e6b97e7761c5127 | [
"Apache-2.0"
] | null | null | null | apigateway/mission/resources.py | automation-liberation/api-gateway | 6c10f6a772ab578740e99a365e6b97e7761c5127 | [
"Apache-2.0"
] | null | null | null | from flask import request
from flask_restful import Resource
from apigateway.celery import celery
class StartMission(Resource):
def get(self, mission_id):
celery.send_task('missioncontrol.mission.start', (mission_id,))
return {"msg": f"Mission started"}
class CreateMission(Resource):
def ... | 22.875 | 87 | 0.721311 |
a539bb1f6ea807c748d672576d0f5b9d31b2d1cf | 3,963 | py | Python | profiles/permissions_test.py | mitodl/open-discussions | ab6e9fac70b8a1222a84e78ba778a7a065c20541 | [
"BSD-3-Clause"
] | 12 | 2017-09-27T21:23:27.000Z | 2020-12-25T04:31:30.000Z | profiles/permissions_test.py | mitodl/open-discussions | ab6e9fac70b8a1222a84e78ba778a7a065c20541 | [
"BSD-3-Clause"
] | 3,293 | 2017-06-30T18:16:01.000Z | 2022-03-31T18:01:34.000Z | profiles/permissions_test.py | mitodl/open-discussions | ab6e9fac70b8a1222a84e78ba778a7a065c20541 | [
"BSD-3-Clause"
] | 1 | 2020-04-13T12:19:57.000Z | 2020-04-13T12:19:57.000Z | # pylint: disable=too-many-arguments,redefined-outer-name
""" Tests for profile permissions """
import pytest
from open_discussions.factories import UserFactory
from profiles.permissions import (
HasEditPermission,
HasSiteEditPermission,
is_owner_or_privileged_user,
)
lazy = pytest.lazy_fixture
@pytest... | 31.959677 | 107 | 0.693162 |
162b476d31421d55f69586e39c3337113a1a15cc | 26,236 | py | Python | pyvoltha/common/tech_profile/tech_profile.py | nsharma70/pyvoltha | ea01eb85f45e3cd0bed12b4b446e5af7f66c16db | [
"Apache-2.0"
] | null | null | null | pyvoltha/common/tech_profile/tech_profile.py | nsharma70/pyvoltha | ea01eb85f45e3cd0bed12b4b446e5af7f66c16db | [
"Apache-2.0"
] | 1 | 2021-03-25T23:34:15.000Z | 2021-03-25T23:34:15.000Z | pyvoltha/common/tech_profile/tech_profile.py | rohan-agra/VOL-2311-pyvoltha | 54ac9266cf4fc27a7583ba08ada779ad107e9cfe | [
"Apache-2.0"
] | null | null | null | #
# Copyright 2018 the original author or 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 agre... | 44.543294 | 100 | 0.605809 |
6841e42176cff92d1b3d388da4318e1a0a7c62dc | 3,181 | py | Python | djangoplicity/blog/options.py | djangoplicity/blog | 2465b34228d794db9f746e314fa04657cbf18d38 | [
"BSD-3-Clause"
] | null | null | null | djangoplicity/blog/options.py | djangoplicity/blog | 2465b34228d794db9f746e314fa04657cbf18d38 | [
"BSD-3-Clause"
] | 1 | 2021-10-20T00:11:16.000Z | 2021-10-20T00:17:51.000Z | djangoplicity/blog/options.py | djangoplicity/djangoplicity-blog | 2465b34228d794db9f746e314fa04657cbf18d38 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
#
# eso-blog
# Copyright (c) 2007-2017, European Southern Observatory (ESO)
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must ret... | 43.575342 | 163 | 0.735932 |
5fb0a319f4e5206d0c120bcad50a91a63cfb22c6 | 2,716 | py | Python | pypy/objspace/fake/checkmodule.py | pymtl/pypy-pymtl3 | d2f66f87686e48aeb1eecabeaa3de1381a149f2c | [
"Apache-2.0",
"OpenSSL"
] | 1 | 2021-06-02T23:02:09.000Z | 2021-06-02T23:02:09.000Z | pypy/objspace/fake/checkmodule.py | pymtl/pypy-pymtl3 | d2f66f87686e48aeb1eecabeaa3de1381a149f2c | [
"Apache-2.0",
"OpenSSL"
] | 1 | 2021-03-30T18:08:41.000Z | 2021-03-30T18:08:41.000Z | pypy/objspace/fake/checkmodule.py | pymtl/pypy-pymtl3 | d2f66f87686e48aeb1eecabeaa3de1381a149f2c | [
"Apache-2.0",
"OpenSSL"
] | null | null | null | import sys
import traceback
from rpython.translator.tool.pdbplus import PdbPlusShow
from pypy.objspace.fake.objspace import FakeObjSpace, W_Root
from pypy.config.pypyoption import get_pypy_config
def checkmodule(modname, translate_startup=True, ignore=(),
c_compile=False, extra_func=None, rpython_opts... | 33.530864 | 79 | 0.624448 |
a94b98d1fe8084cab0f55c93d7522de9d218562c | 1,170 | py | Python | other/UF.py | misslibra/algorithms | 31648ee7a25710ff5340595222525721116f7e84 | [
"Apache-2.0"
] | 1 | 2021-12-19T14:17:46.000Z | 2021-12-19T14:17:46.000Z | other/UF.py | misslibra/algorithms | 31648ee7a25710ff5340595222525721116f7e84 | [
"Apache-2.0"
] | null | null | null | other/UF.py | misslibra/algorithms | 31648ee7a25710ff5340595222525721116f7e84 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# encoding: utf-8
# author: pyclearl
class Solution:
"""
字符串相似程度判断
转化为连通性问题
"""
def __init__(self, maps):
self.maps = maps
# 还没想清数据结构怎么处理
# self.count = None
# self._map = {}
def union(self, p, q):
p_map = self.find(p)
... | 21.272727 | 53 | 0.482051 |
b8eb548e2131ebb9f799a60f9816796bacb618a3 | 1,552 | py | Python | battleshipGame.py | adeelnasimsyed/Interview-Prep | 23ac6d2139df97cf3939c96b17c88e1345846c18 | [
"MIT"
] | null | null | null | battleshipGame.py | adeelnasimsyed/Interview-Prep | 23ac6d2139df97cf3939c96b17c88e1345846c18 | [
"MIT"
] | null | null | null | battleshipGame.py | adeelnasimsyed/Interview-Prep | 23ac6d2139df97cf3939c96b17c88e1345846c18 | [
"MIT"
] | null | null | null | from collections import defaultdict
def battleshipGame(board, moves):
directions = [[1,0] , [0,1]]
d = defaultdict(list)
ship = 0
shipFound = False
output = []
for i in range(len(board)):
for j in range(len(board[0])):
if board[i][j] == "#":
d[ship].append([i,j])
board[i][j] = ... | 18.258824 | 62 | 0.399485 |
256aedd339168e4122f80fc5dd91c890cafed495 | 14,892 | py | Python | model.py | smartsnake/chatbot-rnn | c8422e7dc7e507211158213df5e52588db624a5d | [
"MIT"
] | null | null | null | model.py | smartsnake/chatbot-rnn | c8422e7dc7e507211158213df5e52588db624a5d | [
"MIT"
] | null | null | null | model.py | smartsnake/chatbot-rnn | c8422e7dc7e507211158213df5e52588db624a5d | [
"MIT"
] | null | null | null | import tensorflow as tf
from tensorflow.python.ops import rnn_cell
from tensorflow.python.ops import nn_ops
from tensorflow.python.ops import variable_scope as vs
from tensorflow.python.framework import ops
from tensorflow.compat.v1.nn import rnn_cell as rnn
#from tensorflow.contrib import rnn
from tensorflow.python.u... | 55.155556 | 122 | 0.656796 |
10dc46c386e5b83b3d5e63f3774ca8ec9acddd9c | 2,961 | py | Python | cli-ui/client.py | Fede-26/argoscuolanext-client | f5c85e0ddc38aa5796fd7042075e61062e27fe70 | [
"MIT"
] | 1 | 2019-11-30T17:45:00.000Z | 2019-11-30T17:45:00.000Z | cli-ui/client.py | Fede-26/argoscuolanext-client | f5c85e0ddc38aa5796fd7042075e61062e27fe70 | [
"MIT"
] | null | null | null | cli-ui/client.py | Fede-26/argoscuolanext-client | f5c85e0ddc38aa5796fd7042075e61062e27fe70 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# applicazione principale (avviare questa)
import datetime
import os
import sys
import pprint
pp = pprint.PrettyPrinter(indent=4)
sys.path.append("../modules")
import gestdati as gsd
def voti(raw): #tutti i voti assegnati
for x in reversed(raw["dati"]):
if x["codVotoPratico"] == 'N':
... | 22.097015 | 132 | 0.636609 |
660054c5a92f648080fe4a312b4cfbca46791e75 | 970 | py | Python | part1.py | cewinharhar/BECS2_dataChallenge | da7088316149a800733366c0da6079e0558ad913 | [
"MIT"
] | null | null | null | part1.py | cewinharhar/BECS2_dataChallenge | da7088316149a800733366c0da6079e0558ad913 | [
"MIT"
] | null | null | null | part1.py | cewinharhar/BECS2_dataChallenge | da7088316149a800733366c0da6079e0558ad913 | [
"MIT"
] | null | null | null | #import necessary packages
import os
import random
import xgboost
import joblib
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
plt.style.use('ggplot')
from sklearn import metrics
from sklearn import preprocessing
from sklearn.pipeline import Pipeline
from sklearn.impute import SimpleImputer
fr... | 29.393939 | 68 | 0.846392 |
ef774bf625c8c02bb3b54560c0ff555c4ab3cee6 | 7,134 | py | Python | sdk/python/pulumi_azure_native/netapp/v20200501/get_snapshot_policy.py | sebtelko/pulumi-azure-native | 711ec021b5c73da05611c56c8a35adb0ce3244e4 | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_native/netapp/v20200501/get_snapshot_policy.py | sebtelko/pulumi-azure-native | 711ec021b5c73da05611c56c8a35adb0ce3244e4 | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_native/netapp/v20200501/get_snapshot_policy.py | sebtelko/pulumi-azure-native | 711ec021b5c73da05611c56c8a35adb0ce3244e4 | [
"Apache-2.0"
] | null | null | null | # 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, overload
from ... import _utilities
fro... | 35.67 | 211 | 0.650407 |
59f10c249f2514c8906f77b34ed888a865f51c3f | 669 | py | Python | api/migrations/0124_eventparticipation_account_owner_status.py | eiling/SchoolIdolAPI | a05980fdb33b143dbe2febfc1ad6cf723f025c8d | [
"Apache-2.0"
] | 65 | 2017-12-29T12:28:11.000Z | 2022-03-15T06:42:26.000Z | api/migrations/0124_eventparticipation_account_owner_status.py | eiling/SchoolIdolAPI | a05980fdb33b143dbe2febfc1ad6cf723f025c8d | [
"Apache-2.0"
] | 31 | 2017-12-18T02:03:09.000Z | 2022-01-13T00:43:35.000Z | api/migrations/0124_eventparticipation_account_owner_status.py | eiling/SchoolIdolAPI | a05980fdb33b143dbe2febfc1ad6cf723f025c8d | [
"Apache-2.0"
] | 7 | 2018-08-27T15:11:01.000Z | 2021-08-16T05:15:13.000Z | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('api', '0123_auto_20160401_0019'),
]
operations = [
migrations.AddField(
model_name='eventparticipation',
... | 31.857143 | 262 | 0.632287 |
355ccbe141f99ee9739154ad86b41dafaf9eb6b4 | 16,969 | py | Python | edgelm/examples/speech_recognition/new/infer.py | guotao0628/DeepNet | 1ae74d8b44d715bf67c7d64a8efafff4b7c7937a | [
"MIT"
] | 1 | 2021-11-07T00:30:05.000Z | 2021-11-07T00:30:05.000Z | edgelm/examples/speech_recognition/new/infer.py | guotao0628/DeepNet | 1ae74d8b44d715bf67c7d64a8efafff4b7c7937a | [
"MIT"
] | null | null | null | edgelm/examples/speech_recognition/new/infer.py | guotao0628/DeepNet | 1ae74d8b44d715bf67c7d64a8efafff4b7c7937a | [
"MIT"
] | null | null | null | #!/usr/bin/env python -u
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import ast
import hashlib
import logging
import os
import shutil
import sys
from dataclasses import datac... | 35.951271 | 104 | 0.611645 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.