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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
242ad54deaafa421feaf5076695f4627234fbf95 | 416 | py | Python | datapackage_pipelines_assembler/cli.py | datahq/assembler | c53a9d8e8567b3e5f2837308041b75160c931485 | [
"MIT"
] | 5 | 2017-07-09T09:40:24.000Z | 2017-08-29T07:15:29.000Z | datapackage_pipelines_assembler/cli.py | datahq/assembler | c53a9d8e8567b3e5f2837308041b75160c931485 | [
"MIT"
] | 73 | 2017-07-20T18:53:04.000Z | 2018-09-06T11:28:56.000Z | datapackage_pipelines_assembler/cli.py | datahq/assembler | c53a9d8e8567b3e5f2837308041b75160c931485 | [
"MIT"
] | null | null | null | import os
def main(*args, **kwargs):
original_directory = os.getcwd()
try:
base_path = os.path.join(os.path.dirname(__file__), '..')
os.chdir(os.path.join(base_path, 'sample-specs'))
# We import after setting env vars because these are read on import.
from datapackage_pipeline... | 27.733333 | 76 | 0.641827 |
bd2f2ff19e87ded67cf9e781e4a286edd80f00ce | 808 | py | Python | genFun.py | ShrohanMohapatra/SpecialityFunctions | 7af610ab21f0a61746687f3163989d9863b4b5d9 | [
"CC0-1.0"
] | 1 | 2021-03-13T17:18:43.000Z | 2021-03-13T17:18:43.000Z | genFun.py | ShrohanMohapatra/SpecialityFunctions | 7af610ab21f0a61746687f3163989d9863b4b5d9 | [
"CC0-1.0"
] | null | null | null | genFun.py | ShrohanMohapatra/SpecialityFunctions | 7af610ab21f0a61746687f3163989d9863b4b5d9 | [
"CC0-1.0"
] | null | null | null | # Exponential generating function
from sympy import *
from unittest import TestCase, main
from random import random
def genFunction(expr,x,n):
m = symbols('m')
try:
return Sum(
expr.subs(n,m)*(x**m)/factorial(m),(m,0,oo)
).doit()
except:
return nan
class testSuite(TestCas... | 26.064516 | 70 | 0.514851 |
22d223910931282b9df473a400563eba8cf2e133 | 2,155 | py | Python | epytope/Data/pssms/tepitopepan/mat/DRB1_1316_9.py | christopher-mohr/epytope | 8ac9fe52c0b263bdb03235a5a6dffcb72012a4fd | [
"BSD-3-Clause"
] | 7 | 2021-02-01T18:11:28.000Z | 2022-01-31T19:14:07.000Z | epytope/Data/pssms/tepitopepan/mat/DRB1_1316_9.py | christopher-mohr/epytope | 8ac9fe52c0b263bdb03235a5a6dffcb72012a4fd | [
"BSD-3-Clause"
] | 22 | 2021-01-02T15:25:23.000Z | 2022-03-14T11:32:53.000Z | epytope/Data/pssms/tepitopepan/mat/DRB1_1316_9.py | christopher-mohr/epytope | 8ac9fe52c0b263bdb03235a5a6dffcb72012a4fd | [
"BSD-3-Clause"
] | 4 | 2021-05-28T08:50:38.000Z | 2022-03-14T11:45:32.000Z | DRB1_1316_9 = {0: {'A': -999.0, 'E': -999.0, 'D': -999.0, 'G': -999.0, 'F': -0.18034, 'I': -0.81966, 'H': -999.0, 'K': -999.0, 'M': -0.81966, 'L': -0.81966, 'N': -999.0, 'Q': -999.0, 'P': -999.0, 'S': -999.0, 'R': -999.0, 'T': -999.0, 'W': -0.18034, 'V': -0.81966, 'Y': -0.18034}, 1: {'A': 0.0, 'E': 0.1, 'D': -1.3, 'G':... | 2,155 | 2,155 | 0.396288 |
bd7931fccbd2e6b2348e6e1f5696b84d1cbebba9 | 2,150 | py | Python | unscrapulous/scrapers/ncdex_suspended_defaulted_expelled_debarred_members.py | themousepotato/unscrapulous | 403ebc837c5998b78e55d10c6c95a96ada27e40d | [
"MIT"
] | 11 | 2021-02-24T13:25:45.000Z | 2022-01-25T09:05:31.000Z | unscrapulous/scrapers/ncdex_suspended_defaulted_expelled_debarred_members.py | themousepotato/unscrapulous | 403ebc837c5998b78e55d10c6c95a96ada27e40d | [
"MIT"
] | 6 | 2021-02-24T13:20:26.000Z | 2021-05-13T07:26:48.000Z | unscrapulous/scrapers/ncdex_suspended_defaulted_expelled_debarred_members.py | themousepotato/unscrapulous | 403ebc837c5998b78e55d10c6c95a96ada27e40d | [
"MIT"
] | 1 | 2021-04-11T07:49:17.000Z | 2021-04-11T07:49:17.000Z | #!/usr/bin/python
#-*- coding: utf-8 -*-
from unscrapulous.utils import *
SOURCE = 'https://ncdex.com/suspended_member/latest_info'
OUTPUT_DIR = '/tmp/unscrapulous/files'
OUTPUT_FILE = 'ncdex-suspended-defaulted-expelled-debarred-members.csv'
FORM_DATA = {
"draw":"2",
"columns[0][data]":"title",
"columns... | 40.566038 | 267 | 0.716279 |
94b86a4cb7744131570cb8c8a9f0c27cc11f43c2 | 5,298 | py | Python | bit_utils.py | mithro/tmds_encoding | 8a8c0cb718c7ae386af8793db09d289b839afb8d | [
"Apache-2.0"
] | 8 | 2016-12-15T08:36:10.000Z | 2022-01-20T22:10:56.000Z | bit_utils.py | mithro/tmds_encoding | 8a8c0cb718c7ae386af8793db09d289b839afb8d | [
"Apache-2.0"
] | null | null | null | bit_utils.py | mithro/tmds_encoding | 8a8c0cb718c7ae386af8793db09d289b839afb8d | [
"Apache-2.0"
] | null | null | null | # vim:set ts=4 sw=4 sts=4 expandtab:
"""
Utils for doing operations with bit sequences in Python.
"""
def bits(x, n=8):
"""Convert an int into a bit sequence.
0 1 2 3 4 5 6 7
>>> assert bits(0x00) == [0, 0, 0, 0, 0, 0, 0, 0]
>>> assert bits(0x01) == [1, 0, 0, 0, 0, 0, ... | 25.349282 | 70 | 0.478294 |
16d75e705d862f7f8a3d92dc85c13dfdc9828ef6 | 261 | py | Python | helloworld/translate/urls.py | jimmcslim/example-django | 0c05f9e7d4968e79f912d44cdc0b5a1ada29eeb3 | [
"Apache-2.0"
] | 8 | 2021-08-01T10:29:21.000Z | 2022-02-21T18:28:48.000Z | helloworld/translate/urls.py | g-cassie/example-django | b5957fa847b5ba29e9becf601e65db02ec6f2712 | [
"Apache-2.0"
] | 13 | 2021-05-13T14:54:04.000Z | 2022-03-29T17:45:44.000Z | helloworld/translate/urls.py | g-cassie/example-django | b5957fa847b5ba29e9becf601e65db02ec6f2712 | [
"Apache-2.0"
] | 6 | 2021-05-13T06:53:41.000Z | 2022-03-29T07:15:03.000Z | # Copyright 2021 Pants project contributors.
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from django.urls import path
from helloworld.translate import views
urlpatterns = [
path("<str:slug>/<str:lang>/", views.index, name="index"),
]
| 23.727273 | 63 | 0.731801 |
0ec902f094f51c91a0ed08c13e87e471c8d8f86f | 2,129 | py | Python | emodelrunner/recordings.py | BlueBrain/EModelRunner | 3d46e9ce20e76666288e84a300c329b46f0fa2c4 | [
"ECL-2.0",
"Apache-2.0"
] | 3 | 2021-12-03T15:28:26.000Z | 2022-02-01T11:44:29.000Z | emodelrunner/recordings.py | BlueBrain/EModelRunner | 3d46e9ce20e76666288e84a300c329b46f0fa2c4 | [
"ECL-2.0",
"Apache-2.0"
] | 27 | 2021-12-03T09:16:29.000Z | 2022-03-03T10:29:21.000Z | emodelrunner/recordings.py | BlueBrain/EModelRunner | 3d46e9ce20e76666288e84a300c329b46f0fa2c4 | [
"ECL-2.0",
"Apache-2.0"
] | 4 | 2021-12-07T08:16:29.000Z | 2022-02-22T17:55:58.000Z | """Custom Recording class."""
# Copyright 2020-2022 Blue Brain Project / EPFL
# 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 requi... | 34.901639 | 84 | 0.686707 |
ba19fc2f81159dca985d1823cc4563cf78c88ff8 | 1,258 | py | Python | fastai_do_not_use/docs.py | anhquan0412/fastai_v1 | 1f73d4a42dfbdbf1d9ce065b9cb97bb60fbbf957 | [
"Apache-2.0"
] | 115 | 2018-07-11T06:21:32.000Z | 2018-09-25T09:16:44.000Z | fastai_do_not_use/docs.py | anhquan0412/fastai_v1 | 1f73d4a42dfbdbf1d9ce065b9cb97bb60fbbf957 | [
"Apache-2.0"
] | 24 | 2018-07-10T22:18:05.000Z | 2018-09-22T00:26:54.000Z | fastai_do_not_use/docs.py | anhquan0412/fastai_v1 | 1f73d4a42dfbdbf1d9ce065b9cb97bb60fbbf957 | [
"Apache-2.0"
] | 45 | 2018-07-10T22:17:23.000Z | 2018-09-25T08:42:28.000Z | import tarfile
from fastai import *
from fastai.vision import *
from fastai.text import *
DATA_PATH = Path('..')/'data'
MNIST_PATH = DATA_PATH / 'mnist_sample'
IMDB_PATH = DATA_PATH / 'imdb_sample'
ADULT_PATH = DATA_PATH / 'adult_sample'
def untar_mnist():
if not MNIST_PATH.exists(): tarfile.open(MNIST_PATH.with_... | 37 | 106 | 0.747218 |
27cf8edc81c92f2aeac14cdfd807ad59cd80aae0 | 740 | py | Python | regenesis/core.py | crijke/regenesis | e53a0c6302aa458ff9ae95f573d5594351e5434c | [
"MIT"
] | 16 | 2015-04-09T14:40:53.000Z | 2021-07-13T15:03:35.000Z | regenesis/core.py | crijke/regenesis | e53a0c6302aa458ff9ae95f573d5594351e5434c | [
"MIT"
] | 1 | 2018-06-25T07:51:18.000Z | 2018-06-25T07:51:18.000Z | regenesis/core.py | crijke/regenesis | e53a0c6302aa458ff9ae95f573d5594351e5434c | [
"MIT"
] | 3 | 2015-12-20T18:24:21.000Z | 2018-06-24T16:57:25.000Z | import logging
import warnings;
warnings.filterwarnings('ignore', 'Unicode type received non-unicode bind param value.')
from sqlalchemy.exc import SAWarning
warnings.filterwarnings('ignore', category=SAWarning)
from flask import Flask
import dataset
from regenesis import default_settings
app = Flask(__name__)
app.c... | 27.407407 | 88 | 0.777027 |
3f6ba39c33b311ac99bfaf885deabb115f11a1fd | 16,398 | py | Python | fastNLP/io/data_bundle.py | johnson7788/fastNLP | c24471f73cfcaf8d997229fec231ba7d5e957128 | [
"Apache-2.0"
] | null | null | null | fastNLP/io/data_bundle.py | johnson7788/fastNLP | c24471f73cfcaf8d997229fec231ba7d5e957128 | [
"Apache-2.0"
] | null | null | null | fastNLP/io/data_bundle.py | johnson7788/fastNLP | c24471f73cfcaf8d997229fec231ba7d5e957128 | [
"Apache-2.0"
] | null | null | null | r"""
.. todo::
doc
"""
__all__ = [
'DataBundle',
]
from typing import Union, List
from ..core.dataset import DataSet
from ..core.vocabulary import Vocabulary
from ..core._logger import logger
class DataBundle:
r"""
经过处理的数据信息,包括一系列数据集(比如:分开的训练集、验证集和测试集)以及各个field对应的vocabulary。该对象一般由fastNLP中各种
Load... | 37.183673 | 125 | 0.631967 |
2f14c951e3cda706c0c8dc38cc6b5d2e0c5cf99c | 1,883 | py | Python | my_train_antibody_4.py | QianruZhou333/ArtificialImmuneSystem | e4c12b784ce76bd01f98eee9ad0949482cbce80a | [
"Apache-2.0"
] | null | null | null | my_train_antibody_4.py | QianruZhou333/ArtificialImmuneSystem | e4c12b784ce76bd01f98eee9ad0949482cbce80a | [
"Apache-2.0"
] | null | null | null | my_train_antibody_4.py | QianruZhou333/ArtificialImmuneSystem | e4c12b784ce76bd01f98eee9ad0949482cbce80a | [
"Apache-2.0"
] | null | null | null | # Qianru Zhou (zhouqr333@126.com)
import re
def get_longest_match(num1, num2):
""" Get the longest number of contiguous bits which the two strings have in common
"""
# an all 1s binary string with 96 bits long, in order to get reverse
all1s = 0b1111111111111111111111111111111111111111111111111111111111111111111... | 30.370968 | 107 | 0.715879 |
0bfce72419ca75e95c6d34bbf8ca1dfaecd2521a | 410 | py | Python | api/migrations/0004_user_role.py | thiagovinhote/api_vinhote | 75d116f5b80e96ce7e7f2c2a45f7ceb59d4d3c92 | [
"Apache-2.0"
] | null | null | null | api/migrations/0004_user_role.py | thiagovinhote/api_vinhote | 75d116f5b80e96ce7e7f2c2a45f7ceb59d4d3c92 | [
"Apache-2.0"
] | 3 | 2020-06-05T17:39:47.000Z | 2021-06-10T19:37:01.000Z | api/migrations/0004_user_role.py | thiagovinhote/api_vinhote | 75d116f5b80e96ce7e7f2c2a45f7ceb59d4d3c92 | [
"Apache-2.0"
] | null | null | null | # Generated by Django 2.0.2 on 2018-03-30 02:09
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('api', '0003_auto_20180320_1925'),
]
operations = [
migrations.AddField(
model_name='user',
name='role',
... | 21.578947 | 84 | 0.597561 |
0a6a6ac57a55aa09b30652149ccc17e4dfb319af | 2,757 | py | Python | patron/tests/unit/fake_notifier.py | casbin/openstack-patron | b41b1262f3a52c8cc9f6b6bdf87be5a1abcf6d25 | [
"Apache-2.0"
] | null | null | null | patron/tests/unit/fake_notifier.py | casbin/openstack-patron | b41b1262f3a52c8cc9f6b6bdf87be5a1abcf6d25 | [
"Apache-2.0"
] | null | null | null | patron/tests/unit/fake_notifier.py | casbin/openstack-patron | b41b1262f3a52c8cc9f6b6bdf87be5a1abcf6d25 | [
"Apache-2.0"
] | null | null | null | # Copyright 2013 Red Hat, 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 agre... | 36.76 | 78 | 0.630395 |
f83ee1b19a275e518d18a35268638550c2099d0c | 8,051 | py | Python | assignment1/cs231n/classifiers/k_nearest_neighbor.py | changshuaiwei/stanford-CS231n | c0201389c44818d45815be6a597614a3a043c5ae | [
"MIT"
] | null | null | null | assignment1/cs231n/classifiers/k_nearest_neighbor.py | changshuaiwei/stanford-CS231n | c0201389c44818d45815be6a597614a3a043c5ae | [
"MIT"
] | null | null | null | assignment1/cs231n/classifiers/k_nearest_neighbor.py | changshuaiwei/stanford-CS231n | c0201389c44818d45815be6a597614a3a043c5ae | [
"MIT"
] | null | null | null | import numpy as np
class KNearestNeighbor(object):
""" a kNN classifier with L2 distance """
def __init__(self):
pass
def train(self, X, y):
"""
Train the classifier. For k-nearest neighbors this is just
memorizing the training data.
Inputs:
- X: A numpy array of shape (num_train, D) ... | 46.005714 | 124 | 0.458452 |
4ec5a141d3a792747e537274e5977e4627760fdb | 25,871 | py | Python | salt/utils/master.py | dr4Ke/salt | 8ffa4903c9ed10c81e1a6c7b967dc9532f320c0b | [
"Apache-2.0"
] | 1 | 2018-09-18T05:45:43.000Z | 2018-09-18T05:45:43.000Z | salt/utils/master.py | dr4Ke/salt | 8ffa4903c9ed10c81e1a6c7b967dc9532f320c0b | [
"Apache-2.0"
] | null | null | null | salt/utils/master.py | dr4Ke/salt | 8ffa4903c9ed10c81e1a6c7b967dc9532f320c0b | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
'''
salt.utils.master
-----------------
Utilities that can only be used on a salt master.
'''
# Import python libs
import os
import logging
from threading import Thread, Event
import multiprocessing
import zmq
import signal
# Import salt libs
import salt.log
import salt.client
imp... | 41.19586 | 142 | 0.577133 |
943415b2300847cb56a275a0cf816117e6336242 | 2,207 | py | Python | tests/mockCallbacks.py | sarog/python-insteonplm | dd38b9781167b8fd0bf3d3bf36770aa36bc0275b | [
"MIT"
] | null | null | null | tests/mockCallbacks.py | sarog/python-insteonplm | dd38b9781167b8fd0bf3d3bf36770aa36bc0275b | [
"MIT"
] | null | null | null | tests/mockCallbacks.py | sarog/python-insteonplm | dd38b9781167b8fd0bf3d3bf36770aa36bc0275b | [
"MIT"
] | null | null | null | """Mock callback module to support device and state testing."""
import logging
class MockCallbacks(object):
"""Mock callback class to support device and state testing."""
def __init__(self):
"""Initialize the MockCallbacks Class."""
self.log = logging.getLogger(__name__)
self.callback... | 33.439394 | 76 | 0.625283 |
1b19c8b42c3a337c2409465930bf93da54626794 | 1,132 | py | Python | thresher/migrations/0017_auto_20171110_0608.py | normangilmore/TextThresher | b5919389dd6a2eb1ce084cb6262e9ff7a06cc751 | [
"Apache-2.0"
] | 21 | 2016-08-01T23:42:00.000Z | 2020-08-06T17:41:31.000Z | thresher/migrations/0017_auto_20171110_0608.py | normangilmore/TextThresher | b5919389dd6a2eb1ce084cb6262e9ff7a06cc751 | [
"Apache-2.0"
] | 38 | 2016-08-02T01:07:57.000Z | 2017-10-27T22:48:31.000Z | thresher/migrations/0017_auto_20171110_0608.py | normangilmore/TextThresher | b5919389dd6a2eb1ce084cb6262e9ff7a06cc751 | [
"Apache-2.0"
] | 11 | 2016-08-03T22:31:59.000Z | 2021-12-28T18:35:49.000Z | # -*- coding: utf-8 -*-
# Generated by Django 1.11.2 on 2017-11-10 06:08
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('thresher', '0016_answer_options'),
]
operations = [
migrations.RemoveField(... | 26.952381 | 63 | 0.560954 |
f15d4a129d0e4e53e43f908c8d7b4615b96b3412 | 1,347 | py | Python | ai_chan/grad.py | kagyuu/ai-chan | 1fa5c803ca9fefb1ccf6c9195c8f8015da56bda1 | [
"MIT"
] | null | null | null | ai_chan/grad.py | kagyuu/ai-chan | 1fa5c803ca9fefb1ccf6c9195c8f8015da56bda1 | [
"MIT"
] | null | null | null | ai_chan/grad.py | kagyuu/ai-chan | 1fa5c803ca9fefb1ccf6c9195c8f8015da56bda1 | [
"MIT"
] | null | null | null | import numpy as np
from abc import ABCMeta, abstractmethod
class Grad(metaclass=ABCMeta):
@abstractmethod
def eta(self, dEdW, dEdB, ap=np):
"""
学習係数η(イータ)を返します
:param dEdW: ∂E/∂W
:param dEdB: ∂E/∂b
:param ap: numpy or cupy
:return: 学習係数
"""
pass... | 21.046875 | 55 | 0.520416 |
0dbb0dac8697d7b90b0acec5abd70a6257ef18be | 753 | py | Python | young/apps/write/views.py | Aooyh/Young | 223671c05085f79a9f12513ccc16abbb4ca801d4 | [
"MIT"
] | 1 | 2019-04-20T07:54:21.000Z | 2019-04-20T07:54:21.000Z | young/apps/write/views.py | Aooyh/Young | 223671c05085f79a9f12513ccc16abbb4ca801d4 | [
"MIT"
] | null | null | null | young/apps/write/views.py | Aooyh/Young | 223671c05085f79a9f12513ccc16abbb4ca801d4 | [
"MIT"
] | null | null | null | from rest_framework.permissions import IsAuthenticated
from rest_framework.generics import CreateAPIView, UpdateAPIView
from apps.users.models import Article
from apps.write.serializers import ArticleSerializer
class ArticleAPIView(CreateAPIView, UpdateAPIView):
serializer_class = ArticleSerializer
queryset ... | 34.227273 | 64 | 0.714475 |
105e68081d7d42a165d745f4bcd4058f978807f0 | 3,453 | py | Python | src/aleph/services/ipfs/storage.py | aleph-im/py-aleph | a18beb8b4eba36887ca85054ed2471c3680bdfde | [
"MIT"
] | null | null | null | src/aleph/services/ipfs/storage.py | aleph-im/py-aleph | a18beb8b4eba36887ca85054ed2471c3680bdfde | [
"MIT"
] | null | null | null | src/aleph/services/ipfs/storage.py | aleph-im/py-aleph | a18beb8b4eba36887ca85054ed2471c3680bdfde | [
"MIT"
] | null | null | null | import asyncio
import concurrent
import json
import logging
from typing import IO, Optional
import aiohttp
import aioipfs
from aleph.config import get_config
from .common import get_ipfs_api, get_base_url
from ...utils import run_in_executor
LOGGER = logging.getLogger("IPFS.STORAGE")
MAX_LEN = 1024 * 1024 * 100
a... | 29.016807 | 91 | 0.607877 |
22bd5fba41d276317ae42ef254581479d0a19a58 | 1,512 | py | Python | menu/views.py | dominicneeraj/Technex_api | 1d60ecad212494ca1b93d7417c76ba0d843da336 | [
"MIT"
] | null | null | null | menu/views.py | dominicneeraj/Technex_api | 1d60ecad212494ca1b93d7417c76ba0d843da336 | [
"MIT"
] | null | null | null | menu/views.py | dominicneeraj/Technex_api | 1d60ecad212494ca1b93d7417c76ba0d843da336 | [
"MIT"
] | null | null | null | from django.shortcuts import render
from rest_framework import status
from rest_framework.decorators import api_view
from rest_framework.response import Response
from menu.models import *
from menu.serializers import MenuSerializer
@api_view(['GET', 'POST'])
def menu_list(request, format=None):
if request.method ... | 34.363636 | 78 | 0.688492 |
845950758f8ef0033e7e3b988485e5b387e845c6 | 1,694 | py | Python | lldb/packages/Python/lldbsuite/test/functionalities/multidebugger_commands/TestMultipleDebuggersCommands.py | medismailben/llvm-project | e334a839032fe500c3bba22bf976ab7af13ce1c1 | [
"Apache-2.0"
] | 2,338 | 2018-06-19T17:34:51.000Z | 2022-03-31T11:00:37.000Z | lldb/packages/Python/lldbsuite/test/functionalities/multidebugger_commands/TestMultipleDebuggersCommands.py | medismailben/llvm-project | e334a839032fe500c3bba22bf976ab7af13ce1c1 | [
"Apache-2.0"
] | 3,740 | 2019-01-23T15:36:48.000Z | 2022-03-31T22:01:13.000Z | lldb/packages/Python/lldbsuite/test/functionalities/multidebugger_commands/TestMultipleDebuggersCommands.py | medismailben/llvm-project | e334a839032fe500c3bba22bf976ab7af13ce1c1 | [
"Apache-2.0"
] | 500 | 2019-01-23T07:49:22.000Z | 2022-03-30T02:59:37.000Z | """
Test that commands do not try and hold on to stale CommandInterpreters in a multiple debuggers scenario
"""
from __future__ import print_function
import lldb
from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
from lldbsuite.test import lldbutil
class MultipleDebuggersCommandsTestCase... | 31.962264 | 117 | 0.697757 |
db106fd870bda5f44bd2a7e804236d48aa929e3b | 18,003 | py | Python | redis_server/networking.py | ruanima/redis-server-py | 5921ec0554237d6eb293fa53aabf0296772601ef | [
"Apache-2.0"
] | 1 | 2020-07-16T09:55:28.000Z | 2020-07-16T09:55:28.000Z | redis_server/networking.py | ruanima/redis-server-py | 5921ec0554237d6eb293fa53aabf0296772601ef | [
"Apache-2.0"
] | null | null | null | redis_server/networking.py | ruanima/redis-server-py | 5921ec0554237d6eb293fa53aabf0296772601ef | [
"Apache-2.0"
] | null | null | null | import socket
import errno
import typing
from logging import getLogger
from .ae import aeDeleteFileEvent, aeEventLoop, aeCreateFileEvent, AE_WRITABLE, AE_ERR
from .anet import anetTcpAccept
from .robject import (
redisObject, incrRefCount, equalStringObjects, createObject, createStringObject,
decrRefCount, dup... | 35.579051 | 113 | 0.61312 |
3e18ca43d66b7b8395e793d0020d148b96c924db | 9,676 | py | Python | sfaira/data/dataloaders/export_adaptors/cellxgene.py | johnmous/sfaira | c50240a74530e614ab7681bf9c63b04cb815b361 | [
"BSD-3-Clause"
] | null | null | null | sfaira/data/dataloaders/export_adaptors/cellxgene.py | johnmous/sfaira | c50240a74530e614ab7681bf9c63b04cb815b361 | [
"BSD-3-Clause"
] | null | null | null | sfaira/data/dataloaders/export_adaptors/cellxgene.py | johnmous/sfaira | c50240a74530e614ab7681bf9c63b04cb815b361 | [
"BSD-3-Clause"
] | null | null | null | import anndata
import numpy as np
import pandas as pd
import scanpy as sc
import scipy.sparse
from typing import Union
from sfaira.consts.adata_fields import AdataIdsCellxgene
DEFAULT_CELLXGENE_VERSION = "2_0_0"
def cellxgene_export_adaptor(adata: anndata.AnnData, adata_ids: AdataIdsCellxgene, version: Union[None, ... | 51.468085 | 120 | 0.667528 |
4cc6ae3ee4ac003400217f8e23fb92caf30f50e8 | 6,758 | py | Python | SVG.py | itamarcu/ItamarPADS | cf1d481b198241da9bf5dd8f797b4b2c1b6f49e8 | [
"MIT"
] | null | null | null | SVG.py | itamarcu/ItamarPADS | cf1d481b198241da9bf5dd8f797b4b2c1b6f49e8 | [
"MIT"
] | null | null | null | SVG.py | itamarcu/ItamarPADS | cf1d481b198241da9bf5dd8f797b4b2c1b6f49e8 | [
"MIT"
] | null | null | null | """SVG.py
Simple generation of SVG-format vector graphics files
D. Eppstein, November 2011.
"""
def _coord(x):
"""String representation for coordinate"""
return ("%.4f" % x).rstrip("0").rstrip(".")
class SVG:
def __init__(self, bbox, stream,
standalone=True, prefix=None, indentation=0):
... | 40.22619 | 80 | 0.56792 |
bfb76d4a9909caccb7910f8ec17cbc899499220e | 3,991 | py | Python | src/openfermion/ops/operators/quad_operator.py | Emieeel/OpenFermion | c19d9667c5970473893f9bc0183556c4cd354dd7 | [
"Apache-2.0"
] | 1,291 | 2017-09-27T22:00:26.000Z | 2022-03-25T14:34:50.000Z | src/openfermion/ops/operators/quad_operator.py | SamarthVadia/OpenFermion | 865d8591cad9b0681f6dd25a391a5292ed2de1d4 | [
"Apache-2.0"
] | 521 | 2017-09-27T21:36:17.000Z | 2022-03-02T12:45:56.000Z | src/openfermion/ops/operators/quad_operator.py | SamarthVadia/OpenFermion | 865d8591cad9b0681f6dd25a391a5292ed2de1d4 | [
"Apache-2.0"
] | 365 | 2017-09-27T21:25:38.000Z | 2022-03-29T19:28:46.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
# distribu... | 34.405172 | 79 | 0.626409 |
ed794c29d8b95b25380a1938aebfc7ce8a690bb4 | 80 | py | Python | earth_enterprise/src/server/wsgi/serve/snippets/__init__.py | ezeeyahoo/earthenterprise | b6cac9e6228946f2f17d1edb75e118aeb3e8e8c9 | [
"Apache-2.0"
] | 2,661 | 2017-03-20T22:12:50.000Z | 2022-03-30T09:43:19.000Z | earth_enterprise/src/server/wsgi/serve/snippets/__init__.py | ezeeyahoo/earthenterprise | b6cac9e6228946f2f17d1edb75e118aeb3e8e8c9 | [
"Apache-2.0"
] | 1,531 | 2017-03-24T17:20:32.000Z | 2022-03-16T18:11:14.000Z | earth_enterprise/src/server/wsgi/serve/snippets/__init__.py | ezeeyahoo/earthenterprise | b6cac9e6228946f2f17d1edb75e118aeb3e8e8c9 | [
"Apache-2.0"
] | 990 | 2017-03-24T11:54:28.000Z | 2022-03-22T11:51:47.000Z | """The package indicator for serve.snippets package (end snippets managing)."""
| 40 | 79 | 0.7625 |
e45e2728a7845778edf8e9617cccd331eeb9f874 | 872 | py | Python | tests/test_nltktagger.py | ljch2018/quepy | 564e4321b04a5761ca8188ba7d28802568c8218d | [
"BSD-3-Clause"
] | 951 | 2015-01-08T08:31:01.000Z | 2022-03-29T08:29:01.000Z | tests/test_nltktagger.py | ljch2018/quepy | 564e4321b04a5761ca8188ba7d28802568c8218d | [
"BSD-3-Clause"
] | 42 | 2015-02-12T07:25:02.000Z | 2020-06-10T08:16:27.000Z | tests/test_nltktagger.py | ljch2018/quepy | 564e4321b04a5761ca8188ba7d28802568c8218d | [
"BSD-3-Clause"
] | 286 | 2015-01-04T22:47:30.000Z | 2021-12-15T02:15:27.000Z | #!/usr/bin/env python
# coding: utf-8
# Copyright (c) 2012, Machinalis S.R.L.
# This file is part of quepy and is distributed under the Modified BSD License.
# You should have received a copy of license in the LICENSE file.
#
# Authors: Rafael Carrascosa <rcarrascosa@machinalis.com>
# Gonzalo Garcia Berrotara... | 28.129032 | 79 | 0.700688 |
5c05f84579ea0c1ec4128d5c20ece75400f9d761 | 4,750 | py | Python | products_and_services_client/models/personal_account_brand.py | pitzer42/opbk-br-quickstart | b3f86b2e5f82a6090aaefb563614e174a452383c | [
"MIT"
] | 2 | 2021-02-07T23:58:36.000Z | 2021-02-08T01:03:25.000Z | products_and_services_client/models/personal_account_brand.py | pitzer42/opbk-br-quickstart | b3f86b2e5f82a6090aaefb563614e174a452383c | [
"MIT"
] | null | null | null | products_and_services_client/models/personal_account_brand.py | pitzer42/opbk-br-quickstart | b3f86b2e5f82a6090aaefb563614e174a452383c | [
"MIT"
] | null | null | null | # coding: utf-8
"""
API's OpenData do Open Banking Brasil
As API's descritas neste documento são referentes as API's da fase OpenData do Open Banking Brasil. # noqa: E501
OpenAPI spec version: 1.0.0-rc5.2
Contact: apiteam@swagger.io
Generated by: https://github.com/swagger-api/swagger-codegen.gi... | 33.216783 | 247 | 0.602526 |
4f9b8698768c1291c85c83c4e30eea8d4a49e1df | 32,124 | py | Python | scripts/accountBootstrap.py | jnoennig/aws-account-bootstrap | 7018d14dd3859e27b57f7f2a78b264190b40ad65 | [
"Apache-2.0"
] | 1 | 2020-04-09T01:21:52.000Z | 2020-04-09T01:21:52.000Z | scripts/accountBootstrap.py | jnoennig/aws-account-bootstrap | 7018d14dd3859e27b57f7f2a78b264190b40ad65 | [
"Apache-2.0"
] | null | null | null | scripts/accountBootstrap.py | jnoennig/aws-account-bootstrap | 7018d14dd3859e27b57f7f2a78b264190b40ad65 | [
"Apache-2.0"
] | null | null | null | """
A Lambda function that is triggered by the Control Tower CloudWatch Event 'CreateManagedAccount'.
It automates configuration items that are not included in Control Tower.
The Amazon copyright covers the GuardDuty functions taken from:
https://github.com/aws-samples/amazon-guardduty-multiaccount-scripts
Copyright ... | 41.992157 | 321 | 0.609793 |
b0558d1e0f75a1d900d789a5baf7de8c39216d90 | 13,818 | py | Python | sfepy/discrete/evaluate.py | clazaro/sfepy | 78757a6989d6aaf85a3fb27957b9179c5e2aa2c7 | [
"BSD-3-Clause"
] | null | null | null | sfepy/discrete/evaluate.py | clazaro/sfepy | 78757a6989d6aaf85a3fb27957b9179c5e2aa2c7 | [
"BSD-3-Clause"
] | null | null | null | sfepy/discrete/evaluate.py | clazaro/sfepy | 78757a6989d6aaf85a3fb27957b9179c5e2aa2c7 | [
"BSD-3-Clause"
] | null | null | null | from __future__ import absolute_import
from copy import copy
import numpy as nm
from sfepy.base.base import output, get_default, OneTypeList, Struct, basestr
from sfepy.discrete import Equations, Variables, Region, Integral, Integrals
from sfepy.discrete.common.fields import setup_extra_data
import six
##
# 02.10.20... | 33.538835 | 81 | 0.612679 |
c3ea12c1541e7187a54fa65790c16d0cfb0c6431 | 2,652 | py | Python | slurk/views/api/logs.py | TimDiekmann/slurk | 6b597c9b75978ce4d191934b9e94185dd6fcb871 | [
"BSD-3-Clause"
] | 8 | 2019-06-30T19:09:45.000Z | 2022-02-22T08:30:25.000Z | slurk/views/api/logs.py | TimDiekmann/slurk | 6b597c9b75978ce4d191934b9e94185dd6fcb871 | [
"BSD-3-Clause"
] | 93 | 2019-04-08T09:50:26.000Z | 2022-01-31T17:37:39.000Z | slurk/views/api/logs.py | TimDiekmann/slurk | 6b597c9b75978ce4d191934b9e94185dd6fcb871 | [
"BSD-3-Clause"
] | 8 | 2018-09-30T21:16:14.000Z | 2018-12-13T14:50:40.000Z | from flask.views import MethodView
import marshmallow as ma
from slurk.extensions.api import Blueprint
from slurk.models import Log, User, Room
from slurk.views.api import CommonSchema, Id
blp = Blueprint(Log.__tablename__, __name__)
class LogSchema(CommonSchema):
class Meta:
model = Log
event = m... | 27.625 | 86 | 0.640271 |
62aaadc163247667e926a33ad5533c51569c8780 | 1,367 | py | Python | gpg_exchange.py | JakeRoggenbuck/GPGExchange | 8fd78016e7761b479e307f3424ffd311eb712576 | [
"MIT"
] | null | null | null | gpg_exchange.py | JakeRoggenbuck/GPGExchange | 8fd78016e7761b479e307f3424ffd311eb712576 | [
"MIT"
] | null | null | null | gpg_exchange.py | JakeRoggenbuck/GPGExchange | 8fd78016e7761b479e307f3424ffd311eb712576 | [
"MIT"
] | null | null | null | import os
from flask import Flask, flash, request, redirect, url_for, render_template
from werkzeug.utils import secure_filename
UPLOAD_FOLDER = 'files/'
ALLOWED_EXTENSIONS = {'asc', 'pgp', 'gpg'}
GPG_EXCHANGE = Flask(__name__)
GPG_EXCHANGE.config['UPLOAD_FOLDER'] = UPLOAD_FOLDER
def allowed_file(filen... | 32.547619 | 84 | 0.618873 |
553d7d4e5ffed420ee71b5402961a48fcbdd83dd | 399 | py | Python | Stg/asgi.py | Xdnh00p/Django-Moroccan-cardid-scanner | 332f2710b9e1c7f625d9a256a0aaca6e452acb7c | [
"MIT"
] | 1 | 2022-02-28T16:34:53.000Z | 2022-02-28T16:34:53.000Z | Stg/asgi.py | Xdnh00p/Django-Moroccan-cardid-scanner | 332f2710b9e1c7f625d9a256a0aaca6e452acb7c | [
"MIT"
] | null | null | null | Stg/asgi.py | Xdnh00p/Django-Moroccan-cardid-scanner | 332f2710b9e1c7f625d9a256a0aaca6e452acb7c | [
"MIT"
] | null | null | null | """
ASGI config for Stg project.
It exposes the ASGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/4.0/howto/deployment/asgi/
"""
import os
from django.core.asgi import get_asgi_application
os.environ.setdefault('DJA... | 23.470588 | 79 | 0.749373 |
4a3b926f62b0ff217d6bf24429ffad8b9694a427 | 3,617 | py | Python | qa/rpc-tests/cfund-paymentrequest-state-reorg.py | supertref/navcoin-core | cc6fd1c9661fcbd3b82c8f2506c0f863da43b392 | [
"MIT"
] | 1 | 2020-07-31T19:43:05.000Z | 2020-07-31T19:43:05.000Z | qa/rpc-tests/cfund-paymentrequest-state-reorg.py | supertref/navcoin-core | cc6fd1c9661fcbd3b82c8f2506c0f863da43b392 | [
"MIT"
] | 3 | 2019-07-18T02:10:02.000Z | 2019-08-28T22:09:31.000Z | qa/rpc-tests/cfund-paymentrequest-state-reorg.py | supertref/navcoin-core | cc6fd1c9661fcbd3b82c8f2506c0f863da43b392 | [
"MIT"
] | 1 | 2019-08-07T01:59:04.000Z | 2019-08-07T01:59:04.000Z | #!/usr/bin/env python3
# Copyright (c) 2019 The Navcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
from test_framework.test_framework import NavCoinTestFramework
from test_framework.cfund_util import *
import... | 33.183486 | 105 | 0.656898 |
a4ddf205a01d228e7e5f14d0f6ef7e7f1df80671 | 1,734 | py | Python | app/authentification/tests/test_signup.py | enzoampil/doccano | 5e6d706e198d3fba718f17d81453135fb4b1b8c0 | [
"MIT"
] | 3,989 | 2019-12-01T22:34:26.000Z | 2022-03-31T23:21:50.000Z | backend/authentification/tests/test_signup.py | FDlucifer/doccano | 34a8d83347235a2dd2d63149962a41b0229bb98d | [
"MIT"
] | 986 | 2019-12-02T06:31:29.000Z | 2022-03-31T16:38:59.000Z | backend/authentification/tests/test_signup.py | FDlucifer/doccano | 34a8d83347235a2dd2d63149962a41b0229bb98d | [
"MIT"
] | 993 | 2019-12-02T17:25:42.000Z | 2022-03-31T10:05:07.000Z | from django.test import TestCase
from ..forms import SignupForm
from ..tokens import account_activation_token
class TestSignUp(TestCase):
form_class = SignupForm
def test_signup(self):
form = self.form_class({
'username': 'i_am_a_test_username',
'email': 'i_am_a_test@email.co... | 34.68 | 77 | 0.61534 |
18dfc0bfbfa89cd6c4cfb0223c38955987c6b748 | 4,534 | py | Python | utils/data_dep/evaluation.py | yuliwu/instance_segmentation_with_pixel_embeddings | befaeb9e0a6e79213b4da3d5c5ce5a7c21b0b070 | [
"MIT"
] | 18 | 2019-10-21T06:34:13.000Z | 2022-03-09T05:52:01.000Z | utils/data_dep/evaluation.py | yuliwu/instance_segmentation_with_pixel_embeddings | befaeb9e0a6e79213b4da3d5c5ce5a7c21b0b070 | [
"MIT"
] | 1 | 2020-10-27T14:35:55.000Z | 2021-03-29T11:49:23.000Z | utils/data_dep/evaluation.py | yuliwu/instance_segmentation_with_pixel_embeddings | befaeb9e0a6e79213b4da3d5c5ce5a7c21b0b070 | [
"MIT"
] | 3 | 2019-12-11T10:39:59.000Z | 2020-08-03T08:24:19.000Z | import skimage as ski
import numpy as np
import os
from .visulize import visulize_mask
class Evaluator(object):
def __init__(self, thres=None):
# self.type = type
self.APs = []
self.mAP = None
if thres is None:
self.thres = np.arange(start=0.5, stop=0.95, step=0.05)
... | 32.156028 | 82 | 0.550948 |
dde5a49cf0df35c8196582c5c721cee0c8e2addf | 1,883 | py | Python | examples/gym_example.py | mrbermell/ffai | b035ccc1413744211c95bc85a33c084b6d75f92e | [
"Apache-2.0"
] | 2 | 2020-11-08T21:27:21.000Z | 2020-12-23T15:27:34.000Z | examples/gym_example.py | ctelloordonez/botbowl | 1289142264f1cc66d0071bf584d8e3f94589f1e4 | [
"Apache-2.0"
] | 12 | 2020-12-29T15:29:08.000Z | 2021-10-04T20:34:59.000Z | examples/gym_example.py | mrbermell/ffai | b035ccc1413744211c95bc85a33c084b6d75f92e | [
"Apache-2.0"
] | 1 | 2022-03-18T10:02:28.000Z | 2022-03-18T10:02:28.000Z | #!/usr/bin/env python3
import gym
import numpy as np
import botbowl
if __name__ == "__main__":
# Create environment
# env = gym.make("botbowl-v3")
# Smaller variants
# env = gym.make("botbowl-7-v3")
# env = gym.make("botbowl-5-v3")
# env = gym.make("botbowl-3-v3")
env = gym.make("botbow... | 25.106667 | 91 | 0.574615 |
d67057617d7008f708a03f9d0cb1424420d14576 | 697 | py | Python | blog/migrations/0007_auto_20190131_1250.py | John2013/portfolio | 5be3ab4070cff97e1958f168eb2abd7b97bf6ad7 | [
"MIT"
] | null | null | null | blog/migrations/0007_auto_20190131_1250.py | John2013/portfolio | 5be3ab4070cff97e1958f168eb2abd7b97bf6ad7 | [
"MIT"
] | null | null | null | blog/migrations/0007_auto_20190131_1250.py | John2013/portfolio | 5be3ab4070cff97e1958f168eb2abd7b97bf6ad7 | [
"MIT"
] | null | null | null | # Generated by Django 2.1.5 on 2019-01-31 09:50
from django.db import migrations, models
import django.utils.timezone
class Migration(migrations.Migration):
dependencies = [
('blog', '0006_auto_20190131_1237'),
]
operations = [
migrations.AlterField(
model_name='article',
... | 25.814815 | 83 | 0.604017 |
873b2d6ba460be6ee876512672f5bb136a25d820 | 1,330 | py | Python | python/kontiki/__init__.py | copark86/kontiki | 431349f9500c6ee954bc46c0643f49281163a7f3 | [
"MIT"
] | 94 | 2018-06-19T05:59:27.000Z | 2022-03-31T03:25:29.000Z | python/kontiki/__init__.py | copark86/kontiki | 431349f9500c6ee954bc46c0643f49281163a7f3 | [
"MIT"
] | 3 | 2019-10-23T06:52:50.000Z | 2020-09-01T15:27:11.000Z | python/kontiki/__init__.py | hovren/kontiki | 4c44edb7ef041c6abd549e1fe66fe3e9ca255399 | [
"MIT"
] | 31 | 2018-06-24T12:10:08.000Z | 2022-03-13T18:34:13.000Z | from .templatemeta import TemplateMeta
from . import _trajectory_estimator as __MODULE
from . import trajectories
# Load version from compiled module
from ._version import __version__
# Import Ceres-Solver classes into kontiki namespace
from ._ceres import Summary, IterationSummary, CallbackReturnType
class Meta(Tem... | 31.666667 | 95 | 0.732331 |
5894e9de70e62a901b10e13e26ba023cc00ba839 | 6,897 | py | Python | ReadLE.py | LawlietJH/ReadLE | ef04e3c79dea8c653483c2267dc46e56f6ad310c | [
"MIT"
] | null | null | null | ReadLE.py | LawlietJH/ReadLE | ef04e3c79dea8c653483c2267dc46e56f6ad310c | [
"MIT"
] | null | null | null | ReadLE.py | LawlietJH/ReadLE | ef04e3c79dea8c653483c2267dc46e56f6ad310c | [
"MIT"
] | null | null | null |
import json
import os
class RLE:
def __init__(self, coms=[], x=0, y=0, rule='', rle='', indent=4):
self.coms = coms
self.x = x
self.y = y
self.rule = rule
self.rle = rle
self.fname = ''
self.fcont = ''
self.indent = indent
@property
def data(self):
return {
'#': self.coms,
'x'... | 19.933526 | 72 | 0.493693 |
44c865e903da6ab6d0d7bbea613f6c52c6ad6b40 | 472 | py | Python | api/utils.py | bjorn/Paste-It | 458a5072a9f33343365586b4b028a134168fcdc0 | [
"MIT"
] | 1 | 2020-06-11T03:11:08.000Z | 2020-06-11T03:11:08.000Z | api/utils.py | bjorn/Paste-It | 458a5072a9f33343365586b4b028a134168fcdc0 | [
"MIT"
] | null | null | null | api/utils.py | bjorn/Paste-It | 458a5072a9f33343365586b4b028a134168fcdc0 | [
"MIT"
] | null | null | null | import os
def is_valid_api(dir):
""" What qualifies an API """
if dir.startswith('v') \
and os.path.exists('api/%s/__init__.py' % dir) \
and os.path.exists('api/%s/views.py' % dir) \
and os.path.exists('api/%s/templates/index.html' % dir):
return dir
def get_apis():
api... | 24.842105 | 64 | 0.59322 |
8f35bd7aad7db4ea28e4764eb798fa57ee46499e | 18,338 | py | Python | pybind/slxos/v16r_1_00b/isis_state/interface_detail/isis_intf/ldp_sync_info/__init__.py | shivharis/pybind | 4e1c6d54b9fd722ccec25546ba2413d79ce337e6 | [
"Apache-2.0"
] | null | null | null | pybind/slxos/v16r_1_00b/isis_state/interface_detail/isis_intf/ldp_sync_info/__init__.py | shivharis/pybind | 4e1c6d54b9fd722ccec25546ba2413d79ce337e6 | [
"Apache-2.0"
] | null | null | null | pybind/slxos/v16r_1_00b/isis_state/interface_detail/isis_intf/ldp_sync_info/__init__.py | shivharis/pybind | 4e1c6d54b9fd722ccec25546ba2413d79ce337e6 | [
"Apache-2.0"
] | 1 | 2021-11-05T22:15:42.000Z | 2021-11-05T22:15:42.000Z |
from operator import attrgetter
import pyangbind.lib.xpathhelper as xpathhelper
from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType, RestrictedClassType, TypedListType
from pyangbind.lib.yangtypes import YANGBool, YANGListType, YANGDynClass, ReferenceType
from pyangbind.lib.base import PybindBase
from d... | 64.34386 | 584 | 0.733995 |
7832fd5adf6c70b115158c14bda5d141fd684fc4 | 9,116 | py | Python | src/pano/model/inventory.py | vardis/pano | 7298ad0a437f0632ebd17101cc3a8b80bac2ccf0 | [
"MIT"
] | null | null | null | src/pano/model/inventory.py | vardis/pano | 7298ad0a437f0632ebd17101cc3a8b80bac2ccf0 | [
"MIT"
] | null | null | null | src/pano/model/inventory.py | vardis/pano | 7298ad0a437f0632ebd17101cc3a8b80bac2ccf0 | [
"MIT"
] | null | null | null | '''
Copyright (c) 2008 Georgios Giannoudovardis, <vardis.g@gmail.com>
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,... | 35.470817 | 107 | 0.591707 |
cac15d6cef3abce077fc798fceb44242fe5b69ce | 156 | py | Python | Mundo 2 - Estruturas de Controle/ex048.py | diegomcosta/Curso-em-Video-Python | 3f91b27390b90b686547931d4b1116d1a801cac6 | [
"MIT"
] | null | null | null | Mundo 2 - Estruturas de Controle/ex048.py | diegomcosta/Curso-em-Video-Python | 3f91b27390b90b686547931d4b1116d1a801cac6 | [
"MIT"
] | null | null | null | Mundo 2 - Estruturas de Controle/ex048.py | diegomcosta/Curso-em-Video-Python | 3f91b27390b90b686547931d4b1116d1a801cac6 | [
"MIT"
] | null | null | null | c = 0
s = 0
for i in range(1, 501):
if (i % 2 != 0) and (i % 3 == 0):
c += 1
s += i
print(f" A soma dos {c} valores solicitados é {s}")
| 19.5 | 51 | 0.442308 |
63b98c92222b86a2ff32222aba7e58701eada23e | 3,081 | py | Python | tests/test_block.py | donkirkby/four-letter-blocks | 634913ba276d872fadf4a9a29b5685f5da4d0d93 | [
"MIT"
] | 1 | 2021-08-21T00:57:35.000Z | 2021-08-21T00:57:35.000Z | tests/test_block.py | donkirkby/four-letter-blocks | 634913ba276d872fadf4a9a29b5685f5da4d0d93 | [
"MIT"
] | 8 | 2021-07-25T22:03:15.000Z | 2021-08-25T15:09:12.000Z | tests/test_block.py | donkirkby/four-letter-blocks | 634913ba276d872fadf4a9a29b5685f5da4d0d93 | [
"MIT"
] | null | null | null | from four_letter_blocks.grid import Grid
from four_letter_blocks.block import Block
from four_letter_blocks.square import Square
from tests.test_square import PixmapDiffer
def create_basic_block():
# (x, y) == (0, 50)
# ABC
# D
square1 = Square('A')
square2 = Square('B')
square3 = Square('C')
... | 17.308989 | 81 | 0.615385 |
ddfd940af90e102e4eec7feeb678217f6eb102e3 | 1,491 | py | Python | oslo_middleware/healthcheck/pluginbase.py | openstack/oslo.middleware | 2f72b30cbabef86be3ca91c45346f3d9ec92a75a | [
"Apache-2.0"
] | 30 | 2015-01-29T20:10:46.000Z | 2021-11-08T09:39:24.000Z | oslo_middleware/healthcheck/pluginbase.py | openstack/oslo.middleware | 2f72b30cbabef86be3ca91c45346f3d9ec92a75a | [
"Apache-2.0"
] | null | null | null | oslo_middleware/healthcheck/pluginbase.py | openstack/oslo.middleware | 2f72b30cbabef86be3ca91c45346f3d9ec92a75a | [
"Apache-2.0"
] | 24 | 2015-02-02T15:08:33.000Z | 2021-11-16T09:06:52.000Z | # Copyright 2011 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 req... | 32.413043 | 78 | 0.688799 |
f72274cbfa432897ee252cd78be990ef01cbf7ec | 21,593 | py | Python | virt/ansible-2.3.0/lib/python2.7/site-packages/ansible/modules/packaging/language/pip.py | lakhlaifi/RedHat-Ansible | 27c5077cced9d416081fcd5d69ea44bca0317fa4 | [
"Apache-2.0"
] | null | null | null | virt/ansible-2.3.0/lib/python2.7/site-packages/ansible/modules/packaging/language/pip.py | lakhlaifi/RedHat-Ansible | 27c5077cced9d416081fcd5d69ea44bca0317fa4 | [
"Apache-2.0"
] | null | null | null | virt/ansible-2.3.0/lib/python2.7/site-packages/ansible/modules/packaging/language/pip.py | lakhlaifi/RedHat-Ansible | 27c5077cced9d416081fcd5d69ea44bca0317fa4 | [
"Apache-2.0"
] | 1 | 2020-02-13T14:24:57.000Z | 2020-02-13T14:24:57.000Z | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2012, Matt Wright <matt@nobien.net>
#
# This file is part of Ansible
#
# Ansible 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... | 36.660441 | 142 | 0.608253 |
9f323eb602d8c33c18b5da4ecaf1bd23faf4b191 | 455 | py | Python | data/scripts/templates/object/weapon/ranged/rifle/shared_rifle_acid_beam.py | obi-two/GameServer | 7d37024e2291a97d49522610cd8f1dbe5666afc2 | [
"MIT"
] | 20 | 2015-02-23T15:11:56.000Z | 2022-03-18T20:56:48.000Z | data/scripts/templates/object/weapon/ranged/rifle/shared_rifle_acid_beam.py | apathyboy/swganh | 665128efe9154611dec4cb5efc61d246dd095984 | [
"MIT"
] | null | null | null | data/scripts/templates/object/weapon/ranged/rifle/shared_rifle_acid_beam.py | apathyboy/swganh | 665128efe9154611dec4cb5efc61d246dd095984 | [
"MIT"
] | 20 | 2015-04-04T16:35:59.000Z | 2022-03-24T14:54:37.000Z | #### NOTICE: THIS FILE IS AUTOGENERATED
#### MODIFICATIONS MAY BE LOST IF DONE IMPROPERLY
#### PLEASE SEE THE ONLINE DOCUMENTATION FOR EXAMPLES
from swgpy.object import *
def create(kernel):
result = Weapon()
result.template = "object/weapon/ranged/rifle/shared_rifle_acid_beam.iff"
result.attribute_template_id =... | 26.764706 | 74 | 0.731868 |
1da6394779620020d7b2a631e6885188f1b9dbca | 3,941 | py | Python | fastNLP/modules/encoder/char_embedding.py | 2017alan/fastNLP | 9733249b5eb93a80b62c6172e42748e363d51c54 | [
"Apache-2.0"
] | null | null | null | fastNLP/modules/encoder/char_embedding.py | 2017alan/fastNLP | 9733249b5eb93a80b62c6172e42748e363d51c54 | [
"Apache-2.0"
] | null | null | null | fastNLP/modules/encoder/char_embedding.py | 2017alan/fastNLP | 9733249b5eb93a80b62c6172e42748e363d51c54 | [
"Apache-2.0"
] | null | null | null | import torch
import torch.nn.functional as F
from torch import nn
# from torch.nn.init import xavier_uniform
from fastNLP.modules.utils import initial_parameter
class ConvCharEmbedding(nn.Module):
def __init__(self, char_emb_size=50, feature_maps=(40, 30, 30), kernels=(3, 4, 5),initial_method = None):
"""... | 39.808081 | 109 | 0.620147 |
fd5ad5653fd5ce0ee71ce3df3b6b98e374615127 | 519,379 | py | Python | venv/lib/python3.6/site-packages/tensorflow_core/python/ops/gen_nn_ops.py | databill86/HyperFoods | 9267937c8c70fd84017c0f153c241d2686a356dd | [
"MIT"
] | 2 | 2020-09-30T00:11:09.000Z | 2021-10-04T13:00:38.000Z | venv/lib/python3.6/site-packages/tensorflow_core/python/ops/gen_nn_ops.py | databill86/HyperFoods | 9267937c8c70fd84017c0f153c241d2686a356dd | [
"MIT"
] | null | null | null | venv/lib/python3.6/site-packages/tensorflow_core/python/ops/gen_nn_ops.py | databill86/HyperFoods | 9267937c8c70fd84017c0f153c241d2686a356dd | [
"MIT"
] | null | null | null | """Python wrappers around TensorFlow ops.
This file is MACHINE GENERATED! Do not edit.
Original C++ source file: nn_ops.cc
"""
import collections
from tensorflow.python import pywrap_tensorflow as _pywrap_tensorflow
from tensorflow.python.eager import context as _context
from tensorflow.python.eager import core as _... | 47.079315 | 303 | 0.682149 |
377996cf1e80e56ac4d2c60bd25b1d8c9212981e | 701 | py | Python | topcoder/640/numbergame.py | cripplet/practice | e79700aa29dfa8ad6f8f1c2073e06f9b5ae2dfa0 | [
"MIT"
] | null | null | null | topcoder/640/numbergame.py | cripplet/practice | e79700aa29dfa8ad6f8f1c2073e06f9b5ae2dfa0 | [
"MIT"
] | null | null | null | topcoder/640/numbergame.py | cripplet/practice | e79700aa29dfa8ad6f8f1c2073e06f9b5ae2dfa0 | [
"MIT"
] | null | null | null | import math
class NumberGameAgain(object):
def solve(self, k, forbid):
n_unreach = 0
for x in forbid:
i = x
proc = True
while i > 1:
i = i / 2
if i in forbid:
proc = False
if proc:
h_subtree = k - math.floor(math.log(x, 2))
n_subtree = 2 ** h_subtree - 1
n_unreach += n_subtree
... | 35.05 | 182 | 0.64622 |
f19886e6cfd60a847a1153f72976edd24971f4ce | 1,229 | py | Python | release/stubs.min/System/Security/AccessControl_parts/SemaphoreRights.py | htlcnn/ironpython-stubs | 780d829e2104b2789d5f4d6f32b0ec9f2930ca03 | [
"MIT"
] | 182 | 2017-06-27T02:26:15.000Z | 2022-03-30T18:53:43.000Z | release/stubs.min/System/Security/AccessControl_parts/SemaphoreRights.py | htlcnn/ironpython-stubs | 780d829e2104b2789d5f4d6f32b0ec9f2930ca03 | [
"MIT"
] | 28 | 2017-06-27T13:38:23.000Z | 2022-03-15T11:19:44.000Z | release/stubs.min/System/Security/AccessControl_parts/SemaphoreRights.py | htlcnn/ironpython-stubs | 780d829e2104b2789d5f4d6f32b0ec9f2930ca03 | [
"MIT"
] | 67 | 2017-06-28T09:43:59.000Z | 2022-03-20T21:17:10.000Z | class SemaphoreRights(Enum,IComparable,IFormattable,IConvertible):
"""
Specifies the access control rights that can be applied to named system semaphore objects.
enum (flags) SemaphoreRights,values: ChangePermissions (262144),Delete (65536),FullControl (2031619),Modify (2),ReadPermissions (131072),Synchron... | 29.97561 | 215 | 0.698129 |
295f6aafa2d44e6347a98f096f17439ad4215f8d | 824 | py | Python | zaldibazar_repo/users/migrations/0002_auto_20151225_1429.py | rpurwar24/zaldibazar_repo | 7c030710bedd9f7ab24817ad9ebe6acc59cbbf50 | [
"BSD-3-Clause"
] | null | null | null | zaldibazar_repo/users/migrations/0002_auto_20151225_1429.py | rpurwar24/zaldibazar_repo | 7c030710bedd9f7ab24817ad9ebe6acc59cbbf50 | [
"BSD-3-Clause"
] | null | null | null | zaldibazar_repo/users/migrations/0002_auto_20151225_1429.py | rpurwar24/zaldibazar_repo | 7c030710bedd9f7ab24817ad9ebe6acc59cbbf50 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by Django 1.9 on 2015-12-25 14:29
from __future__ import unicode_literals
import django.core.validators
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('users', '0001_initial'),
]
operations = [
migrat... | 37.454545 | 409 | 0.661408 |
e47a2b19959c5ed0e0dd5e0a883264f7d55e3c00 | 11,562 | py | Python | trellis_mpc/app_mpc.py | chme/trellis-mpc | 1d34bab7b665adea12b4bdc6e1992e95f2bdc369 | [
"BSD-2-Clause"
] | null | null | null | trellis_mpc/app_mpc.py | chme/trellis-mpc | 1d34bab7b665adea12b4bdc6e1992e95f2bdc369 | [
"BSD-2-Clause"
] | null | null | null | trellis_mpc/app_mpc.py | chme/trellis-mpc | 1d34bab7b665adea12b4bdc6e1992e95f2bdc369 | [
"BSD-2-Clause"
] | null | null | null | #!/usr/bin/env python
#
# Licensed under the BSD license. See full license in LICENSE file.
#
# Author: Christian Meffert
import config
import mpd
from select import select
class AppMpcError(Exception):
"""Fatal error"""
class AppMpc:
def __init__(self):
self.__connected = False
self.__retri... | 35.357798 | 122 | 0.544369 |
d84de399b05877a984bb0168fcaa98183730876f | 6,378 | py | Python | fhir/resources/DSTU2/allergyintolerance.py | cstoltze/fhir.resources | 52f99738935b7313089d89daf94d73ce7d167c9d | [
"BSD-3-Clause"
] | 144 | 2019-05-08T14:24:43.000Z | 2022-03-30T02:37:11.000Z | fhir/resources/DSTU2/allergyintolerance.py | cstoltze/fhir.resources | 52f99738935b7313089d89daf94d73ce7d167c9d | [
"BSD-3-Clause"
] | 82 | 2019-05-13T17:43:13.000Z | 2022-03-30T16:45:17.000Z | fhir/resources/DSTU2/allergyintolerance.py | cstoltze/fhir.resources | 52f99738935b7313089d89daf94d73ce7d167c9d | [
"BSD-3-Clause"
] | 48 | 2019-04-04T14:14:53.000Z | 2022-03-30T06:07:31.000Z | # -*- coding: utf-8 -*-
"""
Profile: http://hl7.org/fhir/StructureDefinition/AllergyIntolerance
Release: DSTU2
Version: 1.0.2
Revision: 7202
"""
from typing import List as ListType
from pydantic import Field
from . import fhirtypes
from .backboneelement import BackboneElement
from .domainresource import DomainResourc... | 31.264706 | 87 | 0.6201 |
4c37a1890c2448995a4e5e8b7ea2dddda040f518 | 20,763 | py | Python | sympy/physics/vector/tests/test_functions.py | utkarshdeorah/sympy | dcdf59bbc6b13ddbc329431adf72fcee294b6389 | [
"BSD-3-Clause"
] | 1 | 2020-09-09T20:40:17.000Z | 2020-09-09T20:40:17.000Z | sympy/physics/vector/tests/test_functions.py | utkarshdeorah/sympy | dcdf59bbc6b13ddbc329431adf72fcee294b6389 | [
"BSD-3-Clause"
] | 14 | 2018-02-08T10:11:03.000Z | 2019-04-16T10:32:46.000Z | sympy/physics/vector/tests/test_functions.py | utkarshdeorah/sympy | dcdf59bbc6b13ddbc329431adf72fcee294b6389 | [
"BSD-3-Clause"
] | 1 | 2022-02-04T13:50:29.000Z | 2022-02-04T13:50:29.000Z | from sympy.core.numbers import pi
from sympy.core.singleton import S
from sympy.core.symbol import symbols
from sympy.functions.elementary.miscellaneous import sqrt
from sympy.functions.elementary.trigonometric import (cos, sin)
from sympy.integrals.integrals import Integral
from sympy.physics.vector import Dyadic, Poi... | 40.791749 | 104 | 0.543997 |
14a32f4eff86cbaa75dc3422c85903e5d4792a9a | 427 | py | Python | crowdsourcing/migrations/0007_auto_20150707_1310.py | ramcn/sept20 | e6f6e238d0561ebf3353158161f1b20052e8b08b | [
"MIT"
] | 1 | 2016-02-29T01:26:42.000Z | 2016-02-29T01:26:42.000Z | crowdsourcing/migrations/0007_auto_20150707_1310.py | ramcn/sept20 | e6f6e238d0561ebf3353158161f1b20052e8b08b | [
"MIT"
] | 16 | 2015-08-10T18:28:18.000Z | 2022-03-11T23:12:48.000Z | crowdsourcing/migrations/0007_auto_20150707_1310.py | Milstein/crowdsource-platform | 60427e440373824c26c7daf8cf5f421b9c7ebbb5 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('crowdsourcing', '0006_auto_20150707_1259'),
]
operations = [
migrations.AlterField(
model_name='template',
... | 21.35 | 68 | 0.620609 |
e83ebddb75c2ea48dbd9e7676d5a05099aef0375 | 49,162 | py | Python | src/sage/graphs/graph_database.py | hsm207/sage | 020bd59ec28717bfab9af44d2231c53da1ff99f1 | [
"BSL-1.0"
] | 1 | 2021-10-18T01:24:04.000Z | 2021-10-18T01:24:04.000Z | src/sage/graphs/graph_database.py | hsm207/sage | 020bd59ec28717bfab9af44d2231c53da1ff99f1 | [
"BSL-1.0"
] | null | null | null | src/sage/graphs/graph_database.py | hsm207/sage | 020bd59ec28717bfab9af44d2231c53da1ff99f1 | [
"BSL-1.0"
] | null | null | null | """
Graph database
This module implements classes (:class:`~GraphDatabase`, :class:`~GraphQuery`,
:class:`~GenericGraphQuery`) for interfacing with the ``sqlite`` database
``graphs.db``.
The :class:`~GraphDatabase` class interfaces with the ``sqlite`` database
``graphs.db``. It is an immutable database that inherits ... | 44.051971 | 152 | 0.425735 |
f31fa4fb6938ba18e47f8a593038bbd02ba10cae | 135 | py | Python | getsitemap/config.py | hsiaofongw/watson | bd8939e198d747633db00582a9f5bb00bdc04acc | [
"MIT"
] | null | null | null | getsitemap/config.py | hsiaofongw/watson | bd8939e198d747633db00582a9f5bb00bdc04acc | [
"MIT"
] | null | null | null | getsitemap/config.py | hsiaofongw/watson | bd8939e198d747633db00582a9f5bb00bdc04acc | [
"MIT"
] | null | null | null | USER_AGENT = 'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.7) Gecko/2009021910 Firefox/3.0.7'
SITEMAP_PATH = '/sitemap.xml' | 67.5 | 105 | 0.703704 |
e92f90f38109b21b3657230d44ffc5ded3a97b62 | 5,548 | py | Python | _posts/thm-zeno/exploit.py | jagelit0/jagelit0.github.io | aafb1a0db3b22b21d0ebee5402f150199da76203 | [
"MIT"
] | null | null | null | _posts/thm-zeno/exploit.py | jagelit0/jagelit0.github.io | aafb1a0db3b22b21d0ebee5402f150199da76203 | [
"MIT"
] | null | null | null | _posts/thm-zeno/exploit.py | jagelit0/jagelit0.github.io | aafb1a0db3b22b21d0ebee5402f150199da76203 | [
"MIT"
] | null | null | null | # Exploit Title: Restaurant Management System 1.0 - Remote Code Execution
# Date: 2019-10-16
# Exploit Author: Ibad Shah
# Vendor Homepage: https://www.sourcecodester.com/users/lewa
# Software Link: https://www.sourcecodester.com/php/11815/restaurant-management-system.html
# Version: N/A
# Tested on: Apache 2.4.41
#!... | 27.063415 | 107 | 0.614275 |
0972e6b2f3c2b1f19039f4c0b72febb100a10c5e | 464 | py | Python | lib/mortar/templates/pigscript/python_udf.py | AsherBond/mortar | 5d88f6c6e3bf8db70556b50b094333db19e0048d | [
"Apache-2.0"
] | 1 | 2016-09-29T23:14:56.000Z | 2016-09-29T23:14:56.000Z | lib/mortar/templates/udf/python_udf.py | AsherBond/mortar | 5d88f6c6e3bf8db70556b50b094333db19e0048d | [
"Apache-2.0"
] | null | null | null | lib/mortar/templates/udf/python_udf.py | AsherBond/mortar | 5d88f6c6e3bf8db70556b50b094333db19e0048d | [
"Apache-2.0"
] | null | null | null | from pig_util import outputSchema
#
# This is where we write python UDFs (User-Defined Functions) that we can call from pig.
# Pig needs to know the schema of the data coming out of the function,
# which we specify using the @outputSchema decorator.
#
@outputSchema('example_udf:int')
def example_udf(input_str):
... | 35.692308 | 88 | 0.74569 |
832766aa24a2c5d696719babbc9132e135840a9b | 5,220 | py | Python | AutomatedTesting/Gem/PythonTests/Physics/tests/collider/Collider_MultipleSurfaceSlots.py | LB-KatarzynaDylska/o3de | d8d273697ea8e1beeb698f62b84904a192b0ab76 | [
"Apache-2.0",
"MIT"
] | 1 | 2022-03-28T08:06:58.000Z | 2022-03-28T08:06:58.000Z | AutomatedTesting/Gem/PythonTests/Physics/tests/collider/Collider_MultipleSurfaceSlots.py | LB-KatarzynaDylska/o3de | d8d273697ea8e1beeb698f62b84904a192b0ab76 | [
"Apache-2.0",
"MIT"
] | null | null | null | AutomatedTesting/Gem/PythonTests/Physics/tests/collider/Collider_MultipleSurfaceSlots.py | LB-KatarzynaDylska/o3de | d8d273697ea8e1beeb698f62b84904a192b0ab76 | [
"Apache-2.0",
"MIT"
] | null | null | null | """
Copyright (c) Contributors to the Open 3D Engine Project.
For complete copyright and license terms please see the LICENSE at the root of this distribution.
SPDX-License-Identifier: Apache-2.0 OR MIT
Test case ID : C4044695
Test Case Title : Verify that when you add a multiple surface fbx in PxMesh in PhysxCollide... | 47.027027 | 131 | 0.739272 |
e6172fc9d13fa5c60d6511f3c29c311141f3d4fe | 41,254 | py | Python | fhir/resources/STU3/conceptmap.py | cstoltze/fhir.resources | 52f99738935b7313089d89daf94d73ce7d167c9d | [
"BSD-3-Clause"
] | 144 | 2019-05-08T14:24:43.000Z | 2022-03-30T02:37:11.000Z | fhir/resources/STU3/conceptmap.py | cstoltze/fhir.resources | 52f99738935b7313089d89daf94d73ce7d167c9d | [
"BSD-3-Clause"
] | 82 | 2019-05-13T17:43:13.000Z | 2022-03-30T16:45:17.000Z | fhir/resources/STU3/conceptmap.py | cstoltze/fhir.resources | 52f99738935b7313089d89daf94d73ce7d167c9d | [
"BSD-3-Clause"
] | 48 | 2019-04-04T14:14:53.000Z | 2022-03-30T06:07:31.000Z | # -*- coding: utf-8 -*-
"""
Profile: http://hl7.org/fhir/StructureDefinition/ConceptMap
Release: STU3
Version: 3.0.2
Revision: 11917
Last updated: 2019-10-24T11:53:00+11:00
"""
import typing
from pydantic import Field, root_validator
from pydantic.error_wrappers import ErrorWrapper, ValidationError
from pydantic.error... | 38.092336 | 93 | 0.601954 |
fd352270f664ba749e580099c77d7674b3ccd704 | 649 | py | Python | Estrutura_Decisao/guilty.py | M3nin0/supreme-broccoli | 186c1ea3b839ba3139f9301660dec8fbd27a162e | [
"Apache-2.0"
] | null | null | null | Estrutura_Decisao/guilty.py | M3nin0/supreme-broccoli | 186c1ea3b839ba3139f9301660dec8fbd27a162e | [
"Apache-2.0"
] | null | null | null | Estrutura_Decisao/guilty.py | M3nin0/supreme-broccoli | 186c1ea3b839ba3139f9301660dec8fbd27a162e | [
"Apache-2.0"
] | null | null | null | print("Serão feitas algumas perguntas para você sobre o crime que ocorreu\nResponda apenas com 'Sim' ou 'Não'")
pA = input("Você telefonou para a vitima?\n: ")
pB = input("Esteve no local do crime?\n: ")
pC = input("Mora perto da vitima?\n: ")
pD = input("Devia para a vitima?\n: ")
pE = input("Já trabalhou com a vitima... | 22.37931 | 111 | 0.616333 |
3865566e67dbf1b42a81e184dcc4b8e1fd44ce63 | 1,517 | py | Python | codes/Lib/site-packages/openpyxl/tests/test_password_hash.py | charlescayno/automation | a4a34d87f372d49fd69740ad3ca46ae19bf2612d | [
"MIT"
] | null | null | null | codes/Lib/site-packages/openpyxl/tests/test_password_hash.py | charlescayno/automation | a4a34d87f372d49fd69740ad3ca46ae19bf2612d | [
"MIT"
] | null | null | null | codes/Lib/site-packages/openpyxl/tests/test_password_hash.py | charlescayno/automation | a4a34d87f372d49fd69740ad3ca46ae19bf2612d | [
"MIT"
] | null | null | null | # Copyright (c) 2010-2014 openpyxl
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distr... | 39.921053 | 79 | 0.771918 |
b7c8dbceae08c22a8d2f342782728a903e6cfd96 | 10,203 | py | Python | featuretools/variable_types/variable.py | zhxt95/featuretools | 4fd90031e2b525ddaacddf46ff06a58103dbca35 | [
"BSD-3-Clause"
] | null | null | null | featuretools/variable_types/variable.py | zhxt95/featuretools | 4fd90031e2b525ddaacddf46ff06a58103dbca35 | [
"BSD-3-Clause"
] | null | null | null | featuretools/variable_types/variable.py | zhxt95/featuretools | 4fd90031e2b525ddaacddf46ff06a58103dbca35 | [
"BSD-3-Clause"
] | null | null | null | from __future__ import division
from builtins import object
from past.builtins import basestring
import featuretools as ft
from featuretools.core.base import FTBase
COMMON_STATISTICS = ["count"]
NUMERIC_STATISTICS = ["mean", "max", "min", "std"]
DISCRETE_STATISTICS = ["nunique"]
DATETIME_STATISTICS = ["max", "min"]... | 30.63964 | 99 | 0.624326 |
8530792e8746949911dbafb9e9b500a36ebae742 | 1,729 | py | Python | 32.longest-valid-parentheses.py | leonhx/leetcode-practice | 35fabe5a1b98c05a5dd5d6a62201e9cb54be69ec | [
"MIT"
] | null | null | null | 32.longest-valid-parentheses.py | leonhx/leetcode-practice | 35fabe5a1b98c05a5dd5d6a62201e9cb54be69ec | [
"MIT"
] | null | null | null | 32.longest-valid-parentheses.py | leonhx/leetcode-practice | 35fabe5a1b98c05a5dd5d6a62201e9cb54be69ec | [
"MIT"
] | null | null | null | #
# @lc app=leetcode id=32 lang=python3
#
# [32] Longest Valid Parentheses
#
class Solution:
def __init__(self, debug=False):
self.debug = debug
def _check(self, s: str):
ln, rn = 0, 0
for c in s:
if c == '(':
ln += 1
else:
rn += 1... | 30.333333 | 59 | 0.424523 |
5e8310abd963514b3861442da9d77c646cbffc14 | 1,113 | py | Python | examples/plot_aggregated_map.py | khllkcm/templot | 9ba85f35c0e7a3a8c238071be4911c25c03a3883 | [
"MIT"
] | null | null | null | examples/plot_aggregated_map.py | khllkcm/templot | 9ba85f35c0e7a3a8c238071be4911c25c03a3883 | [
"MIT"
] | null | null | null | examples/plot_aggregated_map.py | khllkcm/templot | 9ba85f35c0e7a3a8c238071be4911c25c03a3883 | [
"MIT"
] | null | null | null | """
Plot Aggregated Map Example.
============================
"""
import os
import pandas as pd
from templot import plot_aggregated_map, add_regions, download_irep
filepath = os.path.join('..', 'templot', 'data', 'df.csv')
if not os.path.exists(filepath):
if not os.path.exists(os.path.join('..', 'templot', 'data'... | 25.883721 | 80 | 0.595687 |
f6b170bf24038dfd768951fecd3b67954bba918a | 7,901 | py | Python | dask/dataframe/io/tests/test_sql.py | migueltorrescosta/dask | 60f488cf7358d14c523f84de9afbb10022818367 | [
"BSD-3-Clause"
] | 1 | 2019-05-24T00:46:48.000Z | 2019-05-24T00:46:48.000Z | dask/dataframe/io/tests/test_sql.py | migueltorrescosta/dask | 60f488cf7358d14c523f84de9afbb10022818367 | [
"BSD-3-Clause"
] | null | null | null | dask/dataframe/io/tests/test_sql.py | migueltorrescosta/dask | 60f488cf7358d14c523f84de9afbb10022818367 | [
"BSD-3-Clause"
] | null | null | null | from __future__ import (print_function, division, absolute_import,
unicode_literals)
import io
import pytest
from dask.dataframe.io.sql import read_sql_table
from dask.utils import tmpfile
from dask.dataframe.utils import assert_eq
pd = pytest.importorskip('pandas')
dd = pytest.importorskip('... | 35.272321 | 102 | 0.596507 |
ce60770c2219f31b85ab2d467e64f33f829e16b0 | 3,586 | py | Python | chaosazure/vmss/fetcher.py | gary918/chaostoolkit-azure | ade9a3a1342dec8dce7333b71b86f3b8e124bcff | [
"Apache-2.0"
] | 23 | 2018-10-17T14:38:08.000Z | 2022-02-23T13:21:30.000Z | chaosazure/vmss/fetcher.py | gary918/chaostoolkit-azure | ade9a3a1342dec8dce7333b71b86f3b8e124bcff | [
"Apache-2.0"
] | 116 | 2018-06-19T13:48:28.000Z | 2022-03-24T08:59:19.000Z | chaosazure/vmss/fetcher.py | gary918/chaostoolkit-azure | ade9a3a1342dec8dce7333b71b86f3b8e124bcff | [
"Apache-2.0"
] | 31 | 2018-10-01T11:07:06.000Z | 2022-03-24T17:06:08.000Z | import random
from typing import Any, Dict, Iterable, Mapping, List
from chaoslib import Configuration, Secrets
from chaoslib.exceptions import FailedActivity
from logzero import logger
from chaosazure import init_compute_management_client
from chaosazure.common.resources.graph import fetch_resources
from chaosazure.... | 29.636364 | 77 | 0.631902 |
6cc41d541f0fd4968d7ae17867986f570d4a15ad | 153 | py | Python | aqueduct/__init__.py | artemcpp/aqueduct | 2fc177b9e533dbe900f5878b9cc7a9c0e9eed179 | [
"MIT"
] | null | null | null | aqueduct/__init__.py | artemcpp/aqueduct | 2fc177b9e533dbe900f5878b9cc7a9c0e9eed179 | [
"MIT"
] | null | null | null | aqueduct/__init__.py | artemcpp/aqueduct | 2fc177b9e533dbe900f5878b9cc7a9c0e9eed179 | [
"MIT"
] | null | null | null | from aqueduct.flow import Flow, FlowStep
from aqueduct.handler import BaseTaskHandler
from aqueduct.task import BaseTask
from aqueduct.logger import log
| 30.6 | 44 | 0.856209 |
5630f61b6b333906cb3e72203207fc974f108f55 | 743 | py | Python | python_modules/dagster/dagster_tests/core_tests/storage_tests/test_schema_compat.py | dbatten5/dagster | d76e50295054ffe5a72f9b292ef57febae499528 | [
"Apache-2.0"
] | 4,606 | 2018-06-21T17:45:20.000Z | 2022-03-31T23:39:42.000Z | python_modules/dagster/dagster_tests/core_tests/storage_tests/test_schema_compat.py | dbatten5/dagster | d76e50295054ffe5a72f9b292ef57febae499528 | [
"Apache-2.0"
] | 6,221 | 2018-06-12T04:36:01.000Z | 2022-03-31T21:43:05.000Z | python_modules/dagster/dagster_tests/core_tests/storage_tests/test_schema_compat.py | dbatten5/dagster | d76e50295054ffe5a72f9b292ef57febae499528 | [
"Apache-2.0"
] | 619 | 2018-08-22T22:43:09.000Z | 2022-03-31T22:48:06.000Z | from dagster.core.storage.event_log import schema as event_log_schema
from dagster.core.storage.runs import schema as run_schema
def assert_cols_equal(a_cols, b_cols, attr_name):
b_cols_by_name = {col.name: col for col in b_cols}
for a_col in a_cols:
assert a_col.name in b_cols_by_name
b_col =... | 37.15 | 90 | 0.710633 |
d4eb9846cee51c4df9077c25738bb51314b64afd | 1,851 | py | Python | utility/sprocket_utility.py | m95music/yukarin | 87e4e813e1b846720ef7a89162edf1c379700619 | [
"MIT"
] | 139 | 2018-02-24T21:33:47.000Z | 2022-03-19T03:59:05.000Z | utility/sprocket_utility.py | m95music/yukarin | 87e4e813e1b846720ef7a89162edf1c379700619 | [
"MIT"
] | 73 | 2018-02-17T14:27:11.000Z | 2021-06-05T18:11:09.000Z | utility/sprocket_utility.py | m95music/yukarin | 87e4e813e1b846720ef7a89162edf1c379700619 | [
"MIT"
] | 31 | 2018-03-05T18:08:18.000Z | 2022-03-28T05:23:16.000Z | import yaml
from scipy.signal import firwin, lfilter
class SpeakerYML(object):
def __init__(self, ymlf):
# open yml file
with open(ymlf) as yf:
conf = yaml.safe_load(yf)
# read parameter from yml file
self.wav_fs = conf['wav']['fs']
self.wav_bit = conf['wav']['... | 28.921875 | 83 | 0.591572 |
b65c482d543b92fd35cde2a2133cef21a7d5c46d | 10,482 | py | Python | slack/web/base_client.py | avanderm/python-slackclient | a5e1c83ad85cb46a6f14d21bcd8e5c16868e6a76 | [
"MIT"
] | 2 | 2019-11-12T03:51:02.000Z | 2020-12-24T22:15:34.000Z | slack/web/base_client.py | avanderm/python-slackclient | a5e1c83ad85cb46a6f14d21bcd8e5c16868e6a76 | [
"MIT"
] | null | null | null | slack/web/base_client.py | avanderm/python-slackclient | a5e1c83ad85cb46a6f14d21bcd8e5c16868e6a76 | [
"MIT"
] | 1 | 2020-12-24T22:15:36.000Z | 2020-12-24T22:15:36.000Z | """A Python module for iteracting with Slack's Web API."""
# Standard Imports
from urllib.parse import urljoin
import platform
import sys
import logging
import asyncio
from typing import Optional, Union
import inspect
import hashlib
import hmac
# ThirdParty Imports
import aiohttp
from aiohttp import FormData
# Inter... | 35.412162 | 125 | 0.571647 |
7a4b956c8c1dda5ce09c562a61745c64fae2a6f1 | 795 | py | Python | tests/wrap_object_test_helper.py | richmanbtc/ccxt_rate_limiter | c614cf3ded32528d694ed73fec33c7a2021b72ab | [
"CC0-1.0"
] | 5 | 2021-04-27T15:38:43.000Z | 2021-07-16T17:04:35.000Z | tests/wrap_object_test_helper.py | richmanbtc/ccxt_rate_limiter | c614cf3ded32528d694ed73fec33c7a2021b72ab | [
"CC0-1.0"
] | null | null | null | tests/wrap_object_test_helper.py | richmanbtc/ccxt_rate_limiter | c614cf3ded32528d694ed73fec33c7a2021b72ab | [
"CC0-1.0"
] | 2 | 2021-12-05T03:12:45.000Z | 2022-03-23T15:35:44.000Z | from ccxt_rate_limiter import _extract_matched_defs
from collections import defaultdict
def test_wrap_defs(limits=None, wrap_defs=None, test_case=None, cases=None):
# test tag match
limit_tags = set(map(lambda x: x['tag'], limits))
wrap_def_tags = set(sum(map(lambda x: x['tags'], wrap_defs), []))
test_... | 41.842105 | 84 | 0.671698 |
d308ef3835efb9a3f5724065b45e533648a23ee1 | 1,295 | py | Python | dpipe/im/tests/test_utils.py | neuro-ml/deep_pipe | fa559630c20548105884151e973dc40c88531891 | [
"MIT"
] | 38 | 2017-09-08T04:51:17.000Z | 2022-03-29T17:34:22.000Z | dpipe/im/tests/test_utils.py | neuro-ml/deep_pipe | fa559630c20548105884151e973dc40c88531891 | [
"MIT"
] | 41 | 2017-09-29T22:06:21.000Z | 2021-12-03T09:31:57.000Z | dpipe/im/tests/test_utils.py | neuro-ml/deep_pipe | fa559630c20548105884151e973dc40c88531891 | [
"MIT"
] | 12 | 2017-09-08T04:40:39.000Z | 2021-01-19T19:19:37.000Z | import numpy as np
from dpipe.layers import identity
from dpipe.im import min_max_scale, normalize
from dpipe.im.utils import apply_along_axes, get_mask_volume
almost_eq = np.testing.assert_array_almost_equal
def test_apply():
x = np.random.rand(3, 10, 10) * 2 + 3
almost_eq(
apply_along_axes(normali... | 30.833333 | 72 | 0.630116 |
885d881f84756d6495b420072697d933feab376c | 6,574 | py | Python | tools/prepro.py | soumye/dialog_without_dialog | 9f95d6fb457659f9007445d9036b94e639bddd8b | [
"MIT"
] | 3 | 2020-09-08T23:19:51.000Z | 2021-07-21T11:12:48.000Z | tools/prepro.py | soumye/dialog_without_dialog | 9f95d6fb457659f9007445d9036b94e639bddd8b | [
"MIT"
] | 2 | 2021-01-08T02:08:09.000Z | 2021-11-15T23:51:02.000Z | tools/prepro.py | soumye/dialog_without_dialog | 9f95d6fb457659f9007445d9036b94e639bddd8b | [
"MIT"
] | 2 | 2020-11-10T15:53:03.000Z | 2020-12-11T03:24:00.000Z | import json
import pdb
import nltk
from nltk.tokenize import word_tokenize
import re
import numpy as np
import h5py
def tokenize(sentence):
return [i for i in re.split(r"([-.\"',:? !\$#@~()*&\^%;\[\]/\\\+<>\n=])", sentence) if i!='' and i!=' ' and i!='\n'];
def build_vocab(vqa_ques, vqa_anno, imgs, build=True):
... | 36.522222 | 126 | 0.631731 |
6d89d782104ac451d7dfec9a3fbc1ab51cacd133 | 3,449 | py | Python | Strategy.py | irigi/SpaceCombat | 8edcee5d6eb3482d4a3fc03567631a6652056c43 | [
"MIT"
] | null | null | null | Strategy.py | irigi/SpaceCombat | 8edcee5d6eb3482d4a3fc03567631a6652056c43 | [
"MIT"
] | null | null | null | Strategy.py | irigi/SpaceCombat | 8edcee5d6eb3482d4a3fc03567631a6652056c43 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Sun May 20 13:05:03 2018
@author: irigi
"""
import math
import numpy as np
import abc
import pyximport; pyximport.install()
from Physics import ShipCtrl
class DNN(object):
def __init__(self):
self.w1 = np.random.rand(7,7)
self.w2 = np.random.rand(7,7)
... | 26.530769 | 66 | 0.521311 |
4d6aa965d5e54c2597e8349c6408d24585621c53 | 1,824 | py | Python | xlsxwriter/test/comparison/test_rich_string09.py | adgear/XlsxWriter | 79bcaad28d57ac29038b1c74bccc6d611b7a385e | [
"BSD-2-Clause-FreeBSD"
] | 2 | 2019-07-25T06:08:09.000Z | 2019-11-01T02:33:56.000Z | xlsxwriter/test/comparison/test_rich_string09.py | adgear/XlsxWriter | 79bcaad28d57ac29038b1c74bccc6d611b7a385e | [
"BSD-2-Clause-FreeBSD"
] | 13 | 2019-07-14T00:29:05.000Z | 2019-11-26T06:16:46.000Z | xlsxwriter/test/comparison/test_rich_string09.py | adgear/XlsxWriter | 79bcaad28d57ac29038b1c74bccc6d611b7a385e | [
"BSD-2-Clause-FreeBSD"
] | null | null | null | ###############################################################################
#
# Tests for XlsxWriter.
#
# Copyright (c), 2013-2019, John McNamara, jmcnamara@cpan.org
#
from ..excel_comparsion_test import ExcelComparisonTest
from ...workbook import Workbook
class TestCompareXLSXFiles(ExcelComparisonTest):
"""... | 30.915254 | 79 | 0.608553 |
c146753156ef4f6515e529929b08889845223d1f | 3,723 | py | Python | atari/repre/cpc.py | neevparikh/lwm | ec8d27f6c011a732aa58ae04cba66a5bac68f8f8 | [
"MIT"
] | 17 | 2020-10-07T08:15:46.000Z | 2022-01-10T02:47:53.000Z | atari/repre/cpc.py | neevparikh/lwm | ec8d27f6c011a732aa58ae04cba66a5bac68f8f8 | [
"MIT"
] | null | null | null | atari/repre/cpc.py | neevparikh/lwm | ec8d27f6c011a732aa58ae04cba66a5bac68f8f8 | [
"MIT"
] | 2 | 2021-02-19T17:47:17.000Z | 2021-03-07T16:41:54.000Z | import random
from dataclasses import dataclass
import torch
import torch.nn as nn
from torch.nn.functional import cross_entropy, one_hot, relu
from dqn.model import mnih_cnn
from dqn.prepare_obs import prepare_obs
from common.optim import ParamOptim
from dqn.buffer import Buffer
class CPCModel(nn.Module):
def _... | 32.946903 | 81 | 0.584475 |
06d4eb111a60e748c25b1bfe10cda47f4362f2a8 | 387 | py | Python | using-while-loop.py | BhargavKadali39/tips-to-decrease-executionTime-in-python | 287c37f48efc50eb346d86c5e76b47fd7d363d08 | [
"MIT"
] | null | null | null | using-while-loop.py | BhargavKadali39/tips-to-decrease-executionTime-in-python | 287c37f48efc50eb346d86c5e76b47fd7d363d08 | [
"MIT"
] | null | null | null | using-while-loop.py | BhargavKadali39/tips-to-decrease-executionTime-in-python | 287c37f48efc50eb346d86c5e76b47fd7d363d08 | [
"MIT"
] | null | null | null | import time
start_time = time.time()
#------------------------- code area -----------------------------------------
i=0
while True:
print(i)
i += 1
if i == 10:
print('over')
break
#------------------------- code area -----------------------------------------
end_time = time.time()
total_ti... | 22.764706 | 78 | 0.403101 |
5c3f0bf1deb5595f88f9667dd5bae65d06914bd5 | 4,216 | py | Python | TimingPoint/notes_updown.py | Fairy-Phy/Relium | 70ea037cea176f02e4768bde44dd5ee23af699b3 | [
"MIT"
] | null | null | null | TimingPoint/notes_updown.py | Fairy-Phy/Relium | 70ea037cea176f02e4768bde44dd5ee23af699b3 | [
"MIT"
] | null | null | null | TimingPoint/notes_updown.py | Fairy-Phy/Relium | 70ea037cea176f02e4768bde44dd5ee23af699b3 | [
"MIT"
] | null | null | null | from Relium import calcurate, classes, parser, constant
"""
1ラインづつ上下していきます(polyriddim的なあれ)
"""
source_file = r""
target_start_offset = 29730
target_end_offset = 31830
avgbpm = 200
# ノーツの高さの最大値(上げすぎると見えなくなります)
max_laneheight = 370
beat = 4
sample_set = 1
sample_index = 0
volume = 60
effects = 0
# 0 => 上に上げる, 1 =>... | 55.473684 | 238 | 0.79981 |
aaad771619dd1ab8110a49818b3d63297e635f06 | 42,735 | py | Python | arkouda/strings.py | reuster986/arkouda | f1781e8a51c0d3d78a4d1753a6a70e7a41db8e7b | [
"MIT"
] | null | null | null | arkouda/strings.py | reuster986/arkouda | f1781e8a51c0d3d78a4d1753a6a70e7a41db8e7b | [
"MIT"
] | null | null | null | arkouda/strings.py | reuster986/arkouda | f1781e8a51c0d3d78a4d1753a6a70e7a41db8e7b | [
"MIT"
] | null | null | null | from __future__ import annotations
from typing import cast, Tuple, Union
from typeguard import typechecked
from arkouda.client import generic_msg
from arkouda.pdarrayclass import pdarray, create_pdarray, parse_single_value,_parse_single_int_array_value
from arkouda.logger import getArkoudaLogger
import numpy as np # ty... | 38.991788 | 106 | 0.513935 |
4db22fb3ae1297551ceca7ad0653da76fba47b85 | 6,589 | py | Python | sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/operations/_virtual_machine_sizes_operations.py | dubiety/azure-sdk-for-python | 62ffa839f5d753594cf0fe63668f454a9d87a346 | [
"MIT"
] | 1 | 2022-02-01T18:50:12.000Z | 2022-02-01T18:50:12.000Z | sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/operations/_virtual_machine_sizes_operations.py | ellhe-blaster/azure-sdk-for-python | 82193ba5e81cc5e5e5a5239bba58abe62e86f469 | [
"MIT"
] | null | null | null | sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/operations/_virtual_machine_sizes_operations.py | ellhe-blaster/azure-sdk-for-python | 82193ba5e81cc5e5e5a5239bba58abe62e86f469 | [
"MIT"
] | null | null | null | # pylint: disable=too-many-lines
# 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) AutoRe... | 40.67284 | 162 | 0.65321 |
373b422721061509c08258ed0a455a31c8bc1182 | 1,095 | py | Python | deep_code/09_Wine_Checkpoint.py | 94JuHo/study_for_deeplearning | ababf482b6a24d94b5f860ea9a68e34fe324d182 | [
"MIT"
] | 2 | 2018-12-17T06:50:51.000Z | 2020-03-12T00:39:38.000Z | deep_code/09_Wine_Checkpoint.py | 94JuHo/study_for_deeplearning | ababf482b6a24d94b5f860ea9a68e34fe324d182 | [
"MIT"
] | null | null | null | deep_code/09_Wine_Checkpoint.py | 94JuHo/study_for_deeplearning | ababf482b6a24d94b5f860ea9a68e34fe324d182 | [
"MIT"
] | 1 | 2019-11-16T02:43:01.000Z | 2019-11-16T02:43:01.000Z | from keras.models import Sequential
from keras.layers import Dense
from keras.callbacks import ModelCheckpoint
import pandas as pd
import numpy
import os
import tensorflow as tf
# seed 값 설정
seed = 0
numpy.random.seed(seed)
tf.set_random_seed(seed)
df_pre = pd.read_csv('../dataset/wine.csv', header=None)
df = df_pre.... | 24.333333 | 102 | 0.724201 |
26c710e75d15bc46fd3d39be89c31ee4c280975f | 35,814 | py | Python | source/soca/cluster_web_ui/views/remote_desktop_windows.py | jhenweihuang/scale-out-computing-on-aws-china2.6-beijing | 5543a3b6d007b7cc87a9bdeb009caf6c0a5798ec | [
"Apache-2.0"
] | null | null | null | source/soca/cluster_web_ui/views/remote_desktop_windows.py | jhenweihuang/scale-out-computing-on-aws-china2.6-beijing | 5543a3b6d007b7cc87a9bdeb009caf6c0a5798ec | [
"Apache-2.0"
] | 1 | 2021-01-06T07:13:28.000Z | 2021-01-06T07:24:09.000Z | source/soca/cluster_web_ui/views/remote_desktop_windows.py | jhenweihuang/scale-out-computing-on-aws-china2.6-beijing | 5543a3b6d007b7cc87a9bdeb009caf6c0a5798ec | [
"Apache-2.0"
] | null | null | null | import logging
import config
from flask import render_template, Blueprint, request, redirect, session, flash, Response
from requests import get
from decorators import login_required
import boto3
from models import db, WindowsDCVSessions,AmiList
import uuid
import random
import string
import base64
from datetime import ... | 52.513196 | 275 | 0.604959 |
21743002ed5d61b161f2a754ba8eea22f3020d31 | 875 | py | Python | inversetoon/util/logger.py | tody411/InverseToon | bc5b922cae9bbf99ed1f020c93b1577c4747ff92 | [
"MIT"
] | 4 | 2015-10-01T16:00:39.000Z | 2016-06-08T13:24:34.000Z | inversetoon/util/logger.py | tody411/InverseToon | bc5b922cae9bbf99ed1f020c93b1577c4747ff92 | [
"MIT"
] | null | null | null | inversetoon/util/logger.py | tody411/InverseToon | bc5b922cae9bbf99ed1f020c93b1577c4747ff92 | [
"MIT"
] | null | null | null |
# -*- coding: utf-8 -*-
## @package inversetoon.util.logger
#
# Log utility package.
# @author tody
# @date 2015/07/29
import logging
def createFormatter():
formatter = createPackageFormatter()
return formatter
def createPackageFormatter():
formatter = logging.Formatter(fmt='%(name)s - ... | 23.026316 | 79 | 0.68 |
60cbac4346bae2e25cafe1eb9c9df29f75178039 | 4,005 | py | Python | facebook_hateful_memes_detector/models/external/phraser.py | faizanahemad/facebook-hateful-memes | 1f7febf65f5fc4ed4aeb476d5383437f677fbc19 | [
"MIT"
] | 9 | 2020-07-28T20:33:04.000Z | 2022-01-28T16:51:40.000Z | facebook_hateful_memes_detector/models/external/phraser.py | faizanahemad/facebook-hateful-memes | 1f7febf65f5fc4ed4aeb476d5383437f677fbc19 | [
"MIT"
] | 3 | 2021-06-08T21:36:37.000Z | 2021-09-08T02:03:07.000Z | facebook_hateful_memes_detector/models/external/phraser.py | faizanahemad/facebook-hateful-memes | 1f7febf65f5fc4ed4aeb476d5383437f677fbc19 | [
"MIT"
] | 1 | 2020-08-26T08:13:25.000Z | 2020-08-26T08:13:25.000Z | import spacy
import numpy as np
import pytextrank
from collections import defaultdict
import torch
from facebook_hateful_memes_detector.utils import stack_and_pad_tensors
from joblib import Parallel, delayed
def get_pytextrank_wc_keylen(spacy_doc):
tokens = [str(x) for x in spacy_doc]
phrases = [(p.text.spl... | 36.081081 | 419 | 0.646941 |
0495b6af6eb476311dbb891455a19ca3aeb92c43 | 218 | py | Python | sphttp/algorithm.py | johejo/sphttp | cc64d98ba144a550525eb81efcbebfccf4cadae7 | [
"MIT"
] | null | null | null | sphttp/algorithm.py | johejo/sphttp | cc64d98ba144a550525eb81efcbebfccf4cadae7 | [
"MIT"
] | null | null | null | sphttp/algorithm.py | johejo/sphttp | cc64d98ba144a550525eb81efcbebfccf4cadae7 | [
"MIT"
] | null | null | null | from enum import Enum, auto
class DelayRequestAlgorithm(Enum):
NORMAL = auto()
DIFF = auto()
INV = auto()
STATIC = auto()
class DuplicateRequestAlgorithm(Enum):
IBRC = auto()
NIBIB = auto()
| 15.571429 | 38 | 0.633028 |
bb3fb162d3c0c3d7ae2a2f4b159ffbd16dcd6759 | 850 | py | Python | common/xrd-ui-tests-qautomate/variables/errors.py | ria-ee/XTM | 6103f3f5bbba387b8b59b050c0c4f1fb2180fc37 | [
"MIT"
] | 3 | 2018-03-15T14:22:50.000Z | 2021-11-08T10:30:35.000Z | common/xrd-ui-tests-qautomate/variables/errors.py | ria-ee/XTM | 6103f3f5bbba387b8b59b050c0c4f1fb2180fc37 | [
"MIT"
] | 11 | 2017-04-06T09:25:41.000Z | 2018-06-04T09:08:48.000Z | common/xrd-ui-tests-qautomate/variables/errors.py | ria-ee/XTM | 6103f3f5bbba387b8b59b050c0c4f1fb2180fc37 | [
"MIT"
] | 20 | 2017-03-14T07:21:58.000Z | 2019-05-21T09:26:30.000Z | enviroment_type_not_valid = "enviroment type is not valid"
log_event_fail = "Newest log event is not {}".format
log_user_fail = "Newest log user is not {}".format
audit_log_is_empty = "Audit log file is empty"
jetty_log_is_empty = "Jetty log file is empty"
string_is_not_dict = "String is not dict"
member_code_not_fo... | 35.416667 | 80 | 0.808235 |
26974cebc026aedb07e5f27466374556955ac29f | 2,302 | py | Python | programming/python/matplotlib/data_browser.py | claremacrae/raspi_code | ee089b8eae29dd4ddf8d45e101affa1e8c5efca4 | [
"MIT"
] | null | null | null | programming/python/matplotlib/data_browser.py | claremacrae/raspi_code | ee089b8eae29dd4ddf8d45e101affa1e8c5efca4 | [
"MIT"
] | null | null | null | programming/python/matplotlib/data_browser.py | claremacrae/raspi_code | ee089b8eae29dd4ddf8d45e101affa1e8c5efca4 | [
"MIT"
] | null | null | null | import numpy as np
# From http://matplotlib.org/examples/event_handling/data_browser.html
class PointBrowser:
"""
Click on a point to select and highlight it -- the data that
generated the point will be shown in the lower axes. Use the 'n'
and 'p' keys to browse through the next and previous points
... | 27.73494 | 79 | 0.58384 |
52240c1143495c764743a4c98d2bd58e20e4257a | 1,995 | py | Python | DeepLearningExamples/TensorFlow2/Recommendation/WideAndDeep/data/outbrain/nvtabular/preproc.py | puririshi98/benchmark | 79f554f1e1cf36f62994c78e0e6e5b360f554022 | [
"BSD-3-Clause"
] | null | null | null | DeepLearningExamples/TensorFlow2/Recommendation/WideAndDeep/data/outbrain/nvtabular/preproc.py | puririshi98/benchmark | 79f554f1e1cf36f62994c78e0e6e5b360f554022 | [
"BSD-3-Clause"
] | null | null | null | DeepLearningExamples/TensorFlow2/Recommendation/WideAndDeep/data/outbrain/nvtabular/preproc.py | puririshi98/benchmark | 79f554f1e1cf36f62994c78e0e6e5b360f554022 | [
"BSD-3-Clause"
] | null | null | null | # Copyright (c) 2021, 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 applic... | 38.365385 | 103 | 0.732331 |
21ddc9e40e5a04f3e2a0facc1d073dba8fd72d6c | 347,131 | py | Python | sympy/solvers/ode.py | wate123/sympy | 0469e038cd4a210e767bee52a76dd5a6bbf3b0ba | [
"BSD-3-Clause"
] | 2 | 2017-06-06T04:18:31.000Z | 2019-04-02T15:57:35.000Z | sympy/solvers/ode.py | wate123/sympy | 0469e038cd4a210e767bee52a76dd5a6bbf3b0ba | [
"BSD-3-Clause"
] | 7 | 2015-03-23T23:33:02.000Z | 2019-02-09T00:19:41.000Z | sympy/solvers/ode.py | wate123/sympy | 0469e038cd4a210e767bee52a76dd5a6bbf3b0ba | [
"BSD-3-Clause"
] | null | null | null | r"""
This module contains :py:meth:`~sympy.solvers.ode.dsolve` and different helper
functions that it uses.
:py:meth:`~sympy.solvers.ode.dsolve` solves ordinary differential equations.
See the docstring on the various functions for their uses. Note that partial
differential equations support is in ``pde.py``. Note t... | 39.681184 | 279 | 0.547223 |
2e1d598a1c9f7dccb284a42677fd7a4ff0b77dae | 401 | py | Python | accounts/forms.py | luftdaten-at/sammler-app | 9d47dcbba4c51297f7ee9857660577d5a50663f6 | [
"MIT"
] | null | null | null | accounts/forms.py | luftdaten-at/sammler-app | 9d47dcbba4c51297f7ee9857660577d5a50663f6 | [
"MIT"
] | null | null | null | accounts/forms.py | luftdaten-at/sammler-app | 9d47dcbba4c51297f7ee9857660577d5a50663f6 | [
"MIT"
] | null | null | null | from django.contrib.auth import get_user_model
from django.contrib.auth.forms import UserCreationForm, UserChangeForm
class CustomUserCreationForm(UserCreationForm):
class Meta:
model = get_user_model()
fields = ('email', 'username',)
class CustomUserChangeForm(UserChangeForm):
cla... | 25.0625 | 70 | 0.695761 |
b7c33e973e019b104f2a370cc2eaa5e30ab70a61 | 840 | py | Python | api/team_directory/celeryapp.py | Hipo/team-directory | dfc999a6b464e88c020cfebe3b569b960b5d7e3d | [
"MIT"
] | null | null | null | api/team_directory/celeryapp.py | Hipo/team-directory | dfc999a6b464e88c020cfebe3b569b960b5d7e3d | [
"MIT"
] | 2 | 2020-06-05T23:54:21.000Z | 2020-09-30T12:50:16.000Z | api/team_directory/celeryapp.py | Hipo/team-directory | dfc999a6b464e88c020cfebe3b569b960b5d7e3d | [
"MIT"
] | null | null | null | """
Avoid naming this module as just `celery.py`, it will clash with the main celery package with Django 2.0's project structure.
Renaming to `celeryapp.py` is the most common approach. See https://www.google.es/search?q=%22celeryapp.py%22
"""
from __future__ import absolute_import, unicode_literals
from celery impor... | 30 | 125 | 0.682143 |
ffa61605acc153bcbc07e4361390a1c7ddde8c68 | 19,607 | py | Python | rasa/train.py | malhotra1432/rasa-1 | f24d05ebad3e69ca7c8075ea4a725754276b9f71 | [
"Apache-2.0"
] | 1 | 2020-09-12T17:27:21.000Z | 2020-09-12T17:27:21.000Z | rasa/train.py | malhotra1432/rasa-1 | f24d05ebad3e69ca7c8075ea4a725754276b9f71 | [
"Apache-2.0"
] | null | null | null | rasa/train.py | malhotra1432/rasa-1 | f24d05ebad3e69ca7c8075ea4a725754276b9f71 | [
"Apache-2.0"
] | null | null | null | import asyncio
import os
import tempfile
from contextlib import ExitStack
from typing import Text, Optional, List, Union, Dict
import rasa.core.interpreter
from rasa.shared.nlu.interpreter import NaturalLanguageInterpreter
from rasa.shared.importers.importer import TrainingDataImporter
from rasa import model
from rasa... | 35.137993 | 114 | 0.667415 |
05315b64eb229d0b867ed5ea6148547eeb1058e0 | 2,681 | py | Python | vimpy/vimpy_utils.py | bdwilliamson/npvipy | 681eb21e1ff1141dc9fbaa35261e24dd17296857 | [
"MIT"
] | 14 | 2017-05-04T08:04:59.000Z | 2022-02-01T07:43:55.000Z | vimpy/vimpy_utils.py | bdwilliamson/npvipy | 681eb21e1ff1141dc9fbaa35261e24dd17296857 | [
"MIT"
] | 2 | 2018-02-21T21:17:56.000Z | 2022-03-21T21:16:15.000Z | vimpy/vimpy_utils.py | bdwilliamson/npvipy | 681eb21e1ff1141dc9fbaa35261e24dd17296857 | [
"MIT"
] | 4 | 2021-02-23T09:14:38.000Z | 2022-02-24T23:46:36.000Z | ## utility functions
def deprecated(func):
'''This is a decorator which can be used to mark functions
as deprecated. It will result in a warning being emitted
when the function is used.'''
import warnings
def new_func(*args, **kwargs):
warnings.warn("Call to deprecated function {}.".forma... | 32.301205 | 142 | 0.657963 |
384d386f7565ad0ec82563f575e86526e26309c0 | 15,071 | py | Python | librosa/beat.py | AlexMetsai/librosa | 7ce63a4364b6a8733163b4eae98aa1ab41db931d | [
"ISC"
] | 1 | 2019-10-15T19:30:27.000Z | 2019-10-15T19:30:27.000Z | librosa/beat.py | AlexMetsai/librosa | 7ce63a4364b6a8733163b4eae98aa1ab41db931d | [
"ISC"
] | null | null | null | librosa/beat.py | AlexMetsai/librosa | 7ce63a4364b6a8733163b4eae98aa1ab41db931d | [
"ISC"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Beat and tempo
==============
.. autosummary::
:toctree: generated/
beat_track
tempo
"""
import numpy as np
import scipy
from ._cache import cache
from . import core
from . import onset
from . import util
from .feature import tempogram
from .util.exceptions ... | 30.820041 | 79 | 0.60069 |
c783b2dde7f7fdca4692adff506e2e22371dcd22 | 1,040 | py | Python | forms/nandiasgarden-project/pizza/forms.py | sashanksilwal/django-practice-projects | 2914ddc03b299b3ef55554424512ad69525ec4df | [
"MIT"
] | null | null | null | forms/nandiasgarden-project/pizza/forms.py | sashanksilwal/django-practice-projects | 2914ddc03b299b3ef55554424512ad69525ec4df | [
"MIT"
] | null | null | null | forms/nandiasgarden-project/pizza/forms.py | sashanksilwal/django-practice-projects | 2914ddc03b299b3ef55554424512ad69525ec4df | [
"MIT"
] | null | null | null | from django import forms
from .models import Pizza, Size
# class PizzaForm(forms.Form):
# toppings = forms.MultipleChoiceField(choices=[('pep','Pepperoni'),( 'cheese','Cheese'), ('olv','Olives')], widget=forms.CheckboxSelectMultiple)
# topping1 = forms.CharField(label= 'Topping1', max_length= 100,)
# widg... | 47.272727 | 149 | 0.678846 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.