hexsha stringlengths 40 40 | size int64 2 1.02M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 245 | max_stars_repo_name stringlengths 6 130 | max_stars_repo_head_hexsha stringlengths 40 40 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 245 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 245 | max_forks_repo_name stringlengths 6 130 | max_forks_repo_head_hexsha stringlengths 40 40 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 2 1.02M | avg_line_length float64 1 417k | max_line_length int64 1 987k | alphanum_fraction float64 0 1 | content_no_comment stringlengths 0 1.01M | is_comment_constant_removed bool 1
class | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f746e4352d6529cb4d4a7d4626cc9aa0499ca7d6 | 3,242 | py | Python | setup.py | adrianp/citeproc-py | c3d97e2969ecf13e896987cad1c6aeb00fb23abc | [
"BSD-2-Clause-FreeBSD"
] | null | null | null | setup.py | adrianp/citeproc-py | c3d97e2969ecf13e896987cad1c6aeb00fb23abc | [
"BSD-2-Clause-FreeBSD"
] | null | null | null | setup.py | adrianp/citeproc-py | c3d97e2969ecf13e896987cad1c6aeb00fb23abc | [
"BSD-2-Clause-FreeBSD"
] | 4 | 2018-03-18T21:02:24.000Z | 2020-01-14T14:50:51.000Z | #!/usr/bin/env python
"""
Setup script for citeproc-py
"""
import os
import re
import sys
from datetime import datetime
from subprocess import Popen, PIPE
from setuptools import setup, find_packages
from setuptools.command.build_py import build_py
from setuptools.command.develop import develop
PACKAGE = 'citeproc'... | 30.018519 | 71 | 0.631092 |
import os
import re
import sys
from datetime import datetime
from subprocess import Popen, PIPE
from setuptools import setup, find_packages
from setuptools.command.build_py import build_py
from setuptools.command.develop import develop
PACKAGE = 'citeproc'
BASE_PATH = os.path.dirname(os.path.abspath(__file__))
PA... | true | true |
f746e4bbb638722603086c16e55a41ba6db6ba62 | 5,976 | py | Python | sympy/functions/elementary/integers.py | shipci/sympy | 4b59927bed992b980c9b3faac01becb36feef26b | [
"BSD-3-Clause"
] | 1 | 2015-01-14T22:55:45.000Z | 2015-01-14T22:55:45.000Z | sympy/functions/elementary/integers.py | curzel-it/KiPyCalc | 909c783d5e6967ea58ca93f875106d8a8e3ca5db | [
"MIT"
] | null | null | null | sympy/functions/elementary/integers.py | curzel-it/KiPyCalc | 909c783d5e6967ea58ca93f875106d8a8e3ca5db | [
"MIT"
] | null | null | null | from __future__ import print_function, division
from sympy.core.basic import C
from sympy.core.singleton import S
from sympy.core.function import Function
from sympy.core import Add
from sympy.core.evalf import get_integer_part, PrecisionExhausted
from sympy.core.relational import Gt, Lt, Ge, Le, Eq
#################... | 29.009709 | 88 | 0.538487 | from __future__ import print_function, division
from sympy.core.basic import C
from sympy.core.singleton import S
from sympy.core.function import Function
from sympy.core import Add
from sympy.core.evalf import get_integer_part, PrecisionExhausted
from sympy.core.relational import Gt, Lt, Ge, Le, Eq
| true | true |
f746e526bdda90640b97fc58c0d453d2869ab5d8 | 5,174 | py | Python | tests/tangerine_whistle/vm/test_arithmetic_operations.py | petertdavies/execution-specs | fabda289c747f535f1d2851ec7ebd0caa89f423f | [
"CC0-1.0"
] | 102 | 2021-08-19T02:44:03.000Z | 2022-03-27T23:46:00.000Z | tests/tangerine_whistle/vm/test_arithmetic_operations.py | petertdavies/execution-specs | fabda289c747f535f1d2851ec7ebd0caa89f423f | [
"CC0-1.0"
] | 264 | 2021-08-18T14:15:26.000Z | 2022-03-31T12:24:23.000Z | tests/tangerine_whistle/vm/test_arithmetic_operations.py | ultratwo/execution-specs | 55d7fd716fc194b30e37a6e487c191445dfec9bc | [
"CC0-1.0"
] | 30 | 2021-08-20T05:38:34.000Z | 2022-01-19T06:49:29.000Z | from functools import partial
import pytest
from ..vm.vm_test_helpers import run_test
run_arithmetic_vm_test = partial(
run_test,
"tests/fixtures/LegacyTests/Constantinople/VMTests/vmArithmeticTest",
)
@pytest.mark.parametrize(
"test_file",
[
"add0.json",
"add1.json",
"add2.... | 22.111111 | 73 | 0.583301 | from functools import partial
import pytest
from ..vm.vm_test_helpers import run_test
run_arithmetic_vm_test = partial(
run_test,
"tests/fixtures/LegacyTests/Constantinople/VMTests/vmArithmeticTest",
)
@pytest.mark.parametrize(
"test_file",
[
"add0.json",
"add1.json",
"add2.... | true | true |
f746e7bc37e8f7227a9901af431dced8c8d78921 | 15,542 | py | Python | lib/dataset/coco.py | ducongju/HRNet | 8c6e1580d0410c439d16a9f220bf0ac48fb39e9a | [
"MIT"
] | null | null | null | lib/dataset/coco.py | ducongju/HRNet | 8c6e1580d0410c439d16a9f220bf0ac48fb39e9a | [
"MIT"
] | 1 | 2020-02-15T14:53:56.000Z | 2020-02-15T14:53:56.000Z | lib/dataset/coco.py | ducongju/HRNet | 8c6e1580d0410c439d16a9f220bf0ac48fb39e9a | [
"MIT"
] | null | null | null | # ------------------------------------------------------------------------------
# Copyright (c) Microsoft
# Licensed under the MIT License.
# Written by Bin Xiao (Bin.Xiao@microsoft.com)
# ------------------------------------------------------------------------------
from __future__ import absolute_import
from __futu... | 34.158242 | 112 | 0.520396 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from collections import defaultdict
from collections import OrderedDict
import logging
import os
from pycocotools.coco import COCO
from pycocotools.cocoeval import COCOeval
import json_tricks as json
imp... | true | true |
f746e88951e84fd295fa7583d914254545239826 | 18,171 | py | Python | test/test_path.py | bouke-nederstigt/scriptine | 01b17573efc9c96cbf4016ade657e945279aa075 | [
"MIT"
] | 2 | 2018-11-12T11:57:59.000Z | 2019-04-27T17:52:35.000Z | test/test_path.py | schlichtanders/scriptine | 8dbcd5540007676614eb972a77bea10f9e8c73ad | [
"MIT"
] | null | null | null | test/test_path.py | schlichtanders/scriptine | 8dbcd5540007676614eb972a77bea10f9e8c73ad | [
"MIT"
] | 4 | 2017-09-29T06:14:04.000Z | 2021-09-08T22:27:08.000Z | """ test_path.py - Test the path module.
This only runs on Posix and NT right now. I would like to have more
tests. You can help! Just add appropriate pathnames for your
platform (os.name) in each place where the p() function is called.
Then send me the result. If you can't get the test to run at all on
your... | 35.559687 | 102 | 0.515327 |
import unittest
import codecs, os, random, shutil, tempfile, time, stat, sys
from scriptine._path import path, __version__ as path_version
__version__ = '2.2'
if sys.platform in ('cygwin', 'win32'):
is_windows = True
else:
is_windows = False
def p(**choices):
return choices[os.name]
... | true | true |
f746ea3097b7b326f2fa01df7c61da4f5e6ea7f9 | 15,135 | py | Python | test/test_serialization.py | jkulhanek/torchdata | 2e8b9f613a13c74b424651649f317c7b322131d6 | [
"BSD-3-Clause"
] | null | null | null | test/test_serialization.py | jkulhanek/torchdata | 2e8b9f613a13c74b424651649f317c7b322131d6 | [
"BSD-3-Clause"
] | null | null | null | test/test_serialization.py | jkulhanek/torchdata | 2e8b9f613a13c74b424651649f317c7b322131d6 | [
"BSD-3-Clause"
] | null | null | null | # Copyright (c) Meta Platforms, Inc. and affiliates.
# All rights reserved.
#
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree.
import os
import pickle
import unittest
import warnings
from functools import partial
from io import StringIO
f... | 40.795148 | 119 | 0.557582 |
import os
import pickle
import unittest
import warnings
from functools import partial
from io import StringIO
from operator import itemgetter
from typing import List
import expecttest
import torchdata.datapipes.iter as iterdp
from _utils._common_utils_for_test import create_temp_dir, create_temp_files
from torch... | true | true |
f746ec87a58fa481e281d78f1fcd3a9255503fa2 | 4,011 | py | Python | scripts/extract_gps.py | frankdvd/curb-monitor | a5ad37a9dd0ca93477dffc647d2dfe7a8d9361e0 | [
"BSD-2-Clause"
] | null | null | null | scripts/extract_gps.py | frankdvd/curb-monitor | a5ad37a9dd0ca93477dffc647d2dfe7a8d9361e0 | [
"BSD-2-Clause"
] | null | null | null | scripts/extract_gps.py | frankdvd/curb-monitor | a5ad37a9dd0ca93477dffc647d2dfe7a8d9361e0 | [
"BSD-2-Clause"
] | null | null | null | from pathlib import Path
import os, sys, shutil
import subprocess
import pandas as pd
import string
if len(sys.argv) != 2:
print("Usage: ./extract_gps.py <video dir>")
sys.exit()
def convert_latlong(in_str):
split_latlong = in_str.split(' ')
return float(split_latlong[0]) + float(split_latlong[2][:-1]... | 40.928571 | 172 | 0.610571 | from pathlib import Path
import os, sys, shutil
import subprocess
import pandas as pd
import string
if len(sys.argv) != 2:
print("Usage: ./extract_gps.py <video dir>")
sys.exit()
def convert_latlong(in_str):
split_latlong = in_str.split(' ')
return float(split_latlong[0]) + float(split_latlong[2][:-1]... | true | true |
f746ee7608169372e1b47ec0ff891d88135d2d04 | 431 | py | Python | app/core/migrations/0005_recipe_image.py | Khande1n/recipe-app-api | 0b2f1f91d18ab51f73b957a92ba46287ce958867 | [
"MIT"
] | null | null | null | app/core/migrations/0005_recipe_image.py | Khande1n/recipe-app-api | 0b2f1f91d18ab51f73b957a92ba46287ce958867 | [
"MIT"
] | null | null | null | app/core/migrations/0005_recipe_image.py | Khande1n/recipe-app-api | 0b2f1f91d18ab51f73b957a92ba46287ce958867 | [
"MIT"
] | null | null | null | # Generated by Django 2.1.15 on 2020-09-04 07:14
import core.models
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('core', '0004_recipe'),
]
operations = [
migrations.AddField(
model_name='recipe',
name='image',
... | 21.55 | 93 | 0.62181 |
import core.models
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('core', '0004_recipe'),
]
operations = [
migrations.AddField(
model_name='recipe',
name='image',
field=models.ImageField(null=True, u... | true | true |
f746ee840db95d9b820396b2ce66219f50de535c | 15,296 | py | Python | text/src/autogluon/text/automm/optimization/utils.py | sgdread/autogluon | fa95c72a07066dc5380fccf8bbce04b5c031fc68 | [
"Apache-2.0"
] | null | null | null | text/src/autogluon/text/automm/optimization/utils.py | sgdread/autogluon | fa95c72a07066dc5380fccf8bbce04b5c031fc68 | [
"Apache-2.0"
] | null | null | null | text/src/autogluon/text/automm/optimization/utils.py | sgdread/autogluon | fa95c72a07066dc5380fccf8bbce04b5c031fc68 | [
"Apache-2.0"
] | null | null | null | from typing import Optional, Union, Tuple, List, Dict
import functools
from torch import nn
from torch import optim
from torch.nn import functional as F
from transformers.trainer_pt_utils import get_parameter_names
import torchmetrics
from .lr_scheduler import (
get_cosine_schedule_with_warmup,
get_polynomial_d... | 32.338266 | 119 | 0.623562 | from typing import Optional, Union, Tuple, List, Dict
import functools
from torch import nn
from torch import optim
from torch.nn import functional as F
from transformers.trainer_pt_utils import get_parameter_names
import torchmetrics
from .lr_scheduler import (
get_cosine_schedule_with_warmup,
get_polynomial_d... | true | true |
f746ef6951a392add78efe67132598b22a1b6e10 | 5,323 | py | Python | test/torchaudio_unittest/common_utils/data_utils.py | xiaohui-zhang/audio | 0ec482cedfe82b209d23769a286fcd7d3fd468d2 | [
"BSD-2-Clause"
] | null | null | null | test/torchaudio_unittest/common_utils/data_utils.py | xiaohui-zhang/audio | 0ec482cedfe82b209d23769a286fcd7d3fd468d2 | [
"BSD-2-Clause"
] | null | null | null | test/torchaudio_unittest/common_utils/data_utils.py | xiaohui-zhang/audio | 0ec482cedfe82b209d23769a286fcd7d3fd468d2 | [
"BSD-2-Clause"
] | null | null | null | import os.path
from typing import Union, Optional
import torch
_TEST_DIR_PATH = os.path.realpath(os.path.join(os.path.dirname(__file__), ".."))
def get_asset_path(*paths):
"""Return full path of a test asset"""
return os.path.join(_TEST_DIR_PATH, "assets", *paths)
def convert_tensor_encoding(
tensor:... | 33.26875 | 106 | 0.646816 | import os.path
from typing import Union, Optional
import torch
_TEST_DIR_PATH = os.path.realpath(os.path.join(os.path.dirname(__file__), ".."))
def get_asset_path(*paths):
return os.path.join(_TEST_DIR_PATH, "assets", *paths)
def convert_tensor_encoding(
tensor: torch.tensor,
dtype: torch.dtype,
):
... | true | true |
f746efa5ac00455c419f4ae7e98447c33c821127 | 716 | py | Python | src/genie/libs/parser/bigip/get_ltm_profileserver_ssl.py | balmasea/genieparser | d1e71a96dfb081e0a8591707b9d4872decd5d9d3 | [
"Apache-2.0"
] | 204 | 2018-06-27T00:55:27.000Z | 2022-03-06T21:12:18.000Z | src/genie/libs/parser/bigip/get_ltm_profileserver_ssl.py | balmasea/genieparser | d1e71a96dfb081e0a8591707b9d4872decd5d9d3 | [
"Apache-2.0"
] | 468 | 2018-06-19T00:33:18.000Z | 2022-03-31T23:23:35.000Z | src/genie/libs/parser/bigip/get_ltm_profileserver_ssl.py | balmasea/genieparser | d1e71a96dfb081e0a8591707b9d4872decd5d9d3 | [
"Apache-2.0"
] | 309 | 2019-01-16T20:21:07.000Z | 2022-03-30T12:56:41.000Z | # Global Imports
import json
from collections import defaultdict
# Metaparser
from genie.metaparser import MetaParser
# =============================================
# Collection for '/mgmt/tm/ltm/profile/server-ssl' resources
# =============================================
class LtmProfileServersslSchema(MetaParse... | 21.058824 | 60 | 0.604749 |
import json
from collections import defaultdict
from genie.metaparser import MetaParser
class LtmProfileServersslSchema(MetaParser):
schema = {}
class LtmProfileServerssl(LtmProfileServersslSchema):
cli_command = "/mgmt/tm/ltm/profile/server-ssl"
def rest(self):
response = self.device... | true | true |
f746f1ae51aadb8b04701033f1ace965902af4ed | 36,262 | py | Python | mesonbuild/cmake/interpreter.py | Simske/meson | 29a25266aa3c5723f4454b4bd9aa19dc3c952def | [
"Apache-2.0"
] | null | null | null | mesonbuild/cmake/interpreter.py | Simske/meson | 29a25266aa3c5723f4454b4bd9aa19dc3c952def | [
"Apache-2.0"
] | null | null | null | mesonbuild/cmake/interpreter.py | Simske/meson | 29a25266aa3c5723f4454b4bd9aa19dc3c952def | [
"Apache-2.0"
] | null | null | null | # Copyright 2019 The Meson development team
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agreed to ... | 41.020362 | 150 | 0.582125 |
from .common import CMakeException
from .client import CMakeClient, RequestCMakeInputs, RequestConfigure, RequestCompute, RequestCodeModel, CMakeTarget
from .executor import CMakeExecutor
from .traceparser import CMakeTraceParser, CMakeGeneratorTarget
from .. import mlog
from ..environment import Envir... | true | true |
f746f1fb7f9bde50ad55d41864e13d371dcfee52 | 1,595 | py | Python | fastapi_app/main.py | DanNduati/AT-USSD | 03036928f73414d36dd09ae7b32c3d9169df6c4d | [
"MIT"
] | 1 | 2022-02-26T19:40:49.000Z | 2022-02-26T19:40:49.000Z | fastapi_app/main.py | DanNduati/at-ussd | 03036928f73414d36dd09ae7b32c3d9169df6c4d | [
"MIT"
] | null | null | null | fastapi_app/main.py | DanNduati/at-ussd | 03036928f73414d36dd09ae7b32c3d9169df6c4d | [
"MIT"
] | null | null | null | from fastapi import FastAPI, Form
from fastapi.responses import HTMLResponse
from pydantic import BaseModel
from typing import Optional
app = FastAPI()
class UssdParams(BaseModel):
session_id: str
service_code: str
phone_number: str
text: str
# dummy acc. data
accounts = {
"A001": {
"bi... | 25.725806 | 144 | 0.587461 | from fastapi import FastAPI, Form
from fastapi.responses import HTMLResponse
from pydantic import BaseModel
from typing import Optional
app = FastAPI()
class UssdParams(BaseModel):
session_id: str
service_code: str
phone_number: str
text: str
accounts = {
"A001": {
"bill": "420"
},... | true | true |
f746f2479058ca4ff9f8b1c08a7ee8b05cb4d0a3 | 5,004 | py | Python | session/speaker-change/finetune-vggvox-v2.py | ishine/malaya-speech | fd34afc7107af1656dff4b3201fa51dda54fde18 | [
"MIT"
] | 111 | 2020-08-31T04:58:54.000Z | 2022-03-29T15:44:18.000Z | session/speaker-change/finetune-vggvox-v2.py | ishine/malaya-speech | fd34afc7107af1656dff4b3201fa51dda54fde18 | [
"MIT"
] | 14 | 2020-12-16T07:27:22.000Z | 2022-03-15T17:39:01.000Z | session/speaker-change/finetune-vggvox-v2.py | ishine/malaya-speech | fd34afc7107af1656dff4b3201fa51dda54fde18 | [
"MIT"
] | 29 | 2021-02-09T08:57:15.000Z | 2022-03-12T14:09:19.000Z | import os
os.environ['GOOGLE_APPLICATION_CREDENTIALS'] = '../gcs/mesolitica-storage.json'
os.environ['CUDA_VISIBLE_DEVICES'] = '1'
import tensorflow as tf
import malaya_speech.train as train
import malaya_speech.train.model.vggvox_v2 as vggvox_v2
import malaya_speech
from glob import glob
import librosa
import numpy ... | 26.903226 | 90 | 0.653477 | import os
os.environ['GOOGLE_APPLICATION_CREDENTIALS'] = '../gcs/mesolitica-storage.json'
os.environ['CUDA_VISIBLE_DEVICES'] = '1'
import tensorflow as tf
import malaya_speech.train as train
import malaya_speech.train.model.vggvox_v2 as vggvox_v2
import malaya_speech
from glob import glob
import librosa
import numpy ... | true | true |
f746f33e8660040cbfab363fcd1ee072a3a13503 | 3,859 | py | Python | test/unit/pulled_search/config_override.py | mjpernot/pulled-search | 2c8f4dee420f0c2fc12867b2a642e3a530d2f24c | [
"MIT"
] | null | null | null | test/unit/pulled_search/config_override.py | mjpernot/pulled-search | 2c8f4dee420f0c2fc12867b2a642e3a530d2f24c | [
"MIT"
] | null | null | null | test/unit/pulled_search/config_override.py | mjpernot/pulled-search | 2c8f4dee420f0c2fc12867b2a642e3a530d2f24c | [
"MIT"
] | null | null | null | #!/usr/bin/python
# Classification (U)
"""Program: config_override.py
Description: Unit testing of config_override in pulled_search.py.
Usage:
test/unit/pulled_search/config_override.py
Arguments:
"""
# Libraries and Global Variables
# Standard
import sys
import os
if sys.version_info < (2... | 24.424051 | 78 | 0.614926 |
import sys
import os
if sys.version_info < (2, 7):
import unittest2 as unittest
else:
import unittest
sys.path.append(os.getcwd())
import pulled_search
import version
__version__ = version.__version__
class UnitTest(unittest.TestCase):
def setUp(self):
class CfgTest(object):
... | true | true |
f746f3d2041b6c28eecb891511342788e67d7188 | 1,353 | py | Python | 1-50/13_roman-to-integer.py | ChenhaoJiang/LeetCode-Solution | b2119ad938c18f75948d0f5cf4ae3773820dcc93 | [
"MIT"
] | 16 | 2019-03-30T07:25:27.000Z | 2020-07-28T15:34:53.000Z | 1-50/13_roman-to-integer.py | ChenhaoJiang/LeetCode-Solution | b2119ad938c18f75948d0f5cf4ae3773820dcc93 | [
"MIT"
] | null | null | null | 1-50/13_roman-to-integer.py | ChenhaoJiang/LeetCode-Solution | b2119ad938c18f75948d0f5cf4ae3773820dcc93 | [
"MIT"
] | 2 | 2020-06-26T13:02:14.000Z | 2020-07-28T04:59:15.000Z | """
Given a roman numeral, convert it to an integer. Input is guaranteed to be within the range from 1 to 3999.
Symbol Value
I 1
V 5
X 10
L 50
C 100
D 500
M 1000
Note:There are six instances where subtraction is used:
I can be pla... | 24.6 | 107 | 0.501848 |
class Solution(object):
def romanToInt(self, s):
num=0
dict={'I':1,'V':5,'X':10,'L':50,'C':100,'D':500,'M':1000}
for i in range(len(s)):
num=num+dict[s[i]]
if i>0:
if (s[i]=='M' or s[i]=='D') and s[i-1]=='C':
num=num-200
... | true | true |
f746f427bba97aebd5f9a7a3e487a80eb93af046 | 1,141 | py | Python | Image Processing/11_Template_Matching.py | siddarthjha/Opencv | ccf26ade18a4a04da464acbbc15f074904fab208 | [
"MIT"
] | 2 | 2020-08-03T13:24:04.000Z | 2020-08-27T16:32:21.000Z | Image Processing/11_Template_Matching.py | siddarthjha/Opencv | ccf26ade18a4a04da464acbbc15f074904fab208 | [
"MIT"
] | null | null | null | Image Processing/11_Template_Matching.py | siddarthjha/Opencv | ccf26ade18a4a04da464acbbc15f074904fab208 | [
"MIT"
] | null | null | null | import cv2
import numpy as np
from matplotlib import pyplot as plt
img = cv2.imread('a.jpg',0)
img2 = img.copy()
template = cv2.imread('b.jpg',0)
w, h = template.shape[::-1]
# All the 6 methods for comparison in a list
methods = ['cv2.TM_CCOEFF', 'cv2.TM_CCOEFF_NORMED', 'cv2.TM_CCORR',
'cv2.TM_CCORR_NORME... | 30.026316 | 75 | 0.66433 | import cv2
import numpy as np
from matplotlib import pyplot as plt
img = cv2.imread('a.jpg',0)
img2 = img.copy()
template = cv2.imread('b.jpg',0)
w, h = template.shape[::-1]
methods = ['cv2.TM_CCOEFF', 'cv2.TM_CCOEFF_NORMED', 'cv2.TM_CCORR',
'cv2.TM_CCORR_NORMED', 'cv2.TM_SQDIFF', 'cv2.TM_SQDIFF_NORMED']... | true | true |
f746f495848266e9d529539941dfced8de42c923 | 1,060 | py | Python | app/backend/commands/commands.py | alexraileanu/yacms | e95f90416d91abf7e379149eaa5d1485eaa7657c | [
"MIT"
] | 2 | 2017-09-29T18:08:55.000Z | 2017-10-06T04:00:26.000Z | app/backend/commands/commands.py | alexraileanu/yacms | e95f90416d91abf7e379149eaa5d1485eaa7657c | [
"MIT"
] | 9 | 2017-10-02T07:31:23.000Z | 2019-10-24T08:05:45.000Z | app/backend/commands/commands.py | alexraileanu/yacms | e95f90416d91abf7e379149eaa5d1485eaa7657c | [
"MIT"
] | 2 | 2017-10-02T12:06:42.000Z | 2017-10-19T19:23:53.000Z | import click
from app import app, db
from app.backend.models.user import User
from app.backend.models.cms import CMS
from app.backend import user_manager
from sqlalchemy.exc import SQLAlchemyError
from redis.exceptions import RedisError
@app.cli.command()
def seed():
"""
Add initial users to the db.
"""
... | 26.5 | 77 | 0.663208 | import click
from app import app, db
from app.backend.models.user import User
from app.backend.models.cms import CMS
from app.backend import user_manager
from sqlalchemy.exc import SQLAlchemyError
from redis.exceptions import RedisError
@app.cli.command()
def seed():
user = User(username='demo', password=user_man... | true | true |
f746f503723de667eed901200ef02a87e39998d1 | 5,779 | py | Python | shopify/products/api_wrapper.py | alikhan126/python-shopify-api | 656cdf1af99485b25be545e2ed527bcb653076fd | [
"Unlicense"
] | 10 | 2016-12-29T06:53:21.000Z | 2022-03-01T10:35:32.000Z | shopify/products/api_wrapper.py | alikhan126/python-shopify-api | 656cdf1af99485b25be545e2ed527bcb653076fd | [
"Unlicense"
] | 4 | 2016-12-30T15:12:47.000Z | 2021-07-24T07:14:20.000Z | shopify/products/api_wrapper.py | alikhan126/python-shopify-api | 656cdf1af99485b25be545e2ed527bcb653076fd | [
"Unlicense"
] | 8 | 2016-12-29T19:13:39.000Z | 2022-03-22T18:02:58.000Z | import json
import requests
from .objects import Product
from ..base import ShopifyApiWrapper, ShopifyApiError, datetime_to_string
class ProductsApiWrapper(ShopifyApiWrapper):
valid_published_status_values = [
'published',
'unpublished',
'any'
]
max_results_limit = 250
def... | 35.89441 | 111 | 0.622426 | import json
import requests
from .objects import Product
from ..base import ShopifyApiWrapper, ShopifyApiError, datetime_to_string
class ProductsApiWrapper(ShopifyApiWrapper):
valid_published_status_values = [
'published',
'unpublished',
'any'
]
max_results_limit = 250
def... | true | true |
f746f6523423abe8f573f31eeaf9983aad86dca3 | 19,236 | py | Python | package/models.py | dmoney/djangopackages | 746cd47f8171229da3276b81d3c8454bdd887928 | [
"MIT"
] | null | null | null | package/models.py | dmoney/djangopackages | 746cd47f8171229da3276b81d3c8454bdd887928 | [
"MIT"
] | null | null | null | package/models.py | dmoney/djangopackages | 746cd47f8171229da3276b81d3c8454bdd887928 | [
"MIT"
] | null | null | null | from datetime import datetime, timedelta
import json
import re
import math
from dateutil import relativedelta
from django.core.cache import cache
from django.conf import settings
from django.contrib.auth.models import User
from django.contrib.postgres.fields import ArrayField
from django.core.exceptions import ObjectD... | 33.222798 | 136 | 0.617124 | from datetime import datetime, timedelta
import json
import re
import math
from dateutil import relativedelta
from django.core.cache import cache
from django.conf import settings
from django.contrib.auth.models import User
from django.contrib.postgres.fields import ArrayField
from django.core.exceptions import ObjectD... | true | true |
f746f723768c11ef7989faf5833fd13abfefb6e0 | 148 | py | Python | tests/test_example.py | Luzkan/MessengerNotifier | 462c6b1a9aa0a29a0dd6b5fc77d0677c61962d5d | [
"Linux-OpenIB"
] | 4 | 2020-06-01T09:01:47.000Z | 2021-04-16T20:07:29.000Z | tests/test_example.py | Luzkan/NotifAyy | 462c6b1a9aa0a29a0dd6b5fc77d0677c61962d5d | [
"Linux-OpenIB"
] | 20 | 2020-06-05T16:54:36.000Z | 2020-06-09T13:25:59.000Z | tests/test_example.py | Luzkan/MessengerNotifier | 462c6b1a9aa0a29a0dd6b5fc77d0677c61962d5d | [
"Linux-OpenIB"
] | 2 | 2020-05-07T04:51:00.000Z | 2020-05-08T17:52:55.000Z | from web.msnotifier.example import add
def test_add_correct():
assert add(5, 7) == 12
def test_add_incorrect():
assert add(15, 8) != 21
| 14.8 | 38 | 0.675676 | from web.msnotifier.example import add
def test_add_correct():
assert add(5, 7) == 12
def test_add_incorrect():
assert add(15, 8) != 21
| true | true |
f746f7dd89f0ea21772cf57a1d5fcb0095ad25f8 | 3,423 | py | Python | evaluate.py | terry97-guel/SMInet | e4c158fb03096a12723bb474c3e468044eca46a6 | [
"MIT"
] | 1 | 2022-02-24T06:57:55.000Z | 2022-02-24T06:57:55.000Z | evaluate.py | terry97-guel/SMInet | e4c158fb03096a12723bb474c3e468044eca46a6 | [
"MIT"
] | null | null | null | evaluate.py | terry97-guel/SMInet | e4c158fb03096a12723bb474c3e468044eca46a6 | [
"MIT"
] | null | null | null | import torch
from model import *
from dataloader import *
from utils.pyart import *
import argparse
import numpy as np
from pathlib import Path
def main(args):
print("Processing...")
# set device:
if torch.cuda.is_available():
device = torch.device('cuda:0')
else:
device = torch.device... | 35.65625 | 119 | 0.672509 | import torch
from model import *
from dataloader import *
from utils.pyart import *
import argparse
import numpy as np
from pathlib import Path
def main(args):
print("Processing...")
if torch.cuda.is_available():
device = torch.device('cuda:0')
else:
device = torch.device('cpu')
... | true | true |
f746f7f83960eb5c68fa83f73cc1db5a6aaa40df | 96 | py | Python | flask_app/run.py | nablabits/fareharbor-webhook | 70e415b9ccd45220693eecb6a668746a1282dd03 | [
"MIT"
] | null | null | null | flask_app/run.py | nablabits/fareharbor-webhook | 70e415b9ccd45220693eecb6a668746a1282dd03 | [
"MIT"
] | 1 | 2021-06-02T18:26:18.000Z | 2021-06-02T18:26:18.000Z | flask_app/run.py | nablabits/fareharbor-webhook | 70e415b9ccd45220693eecb6a668746a1282dd03 | [
"MIT"
] | null | null | null | from fh_webhook import create_app
app = create_app()
if __name__ == "__main__":
app.run()
| 13.714286 | 33 | 0.697917 | from fh_webhook import create_app
app = create_app()
if __name__ == "__main__":
app.run()
| true | true |
f746f8ec414a8056497ca226e519aa79ef26a968 | 925 | py | Python | django_lazifier2/utils/builtin_types/param.py | hotmit/-django-lazifier2 | b290e0423966db030ee01df7a65890ca36e10ba8 | [
"MIT"
] | 1 | 2017-04-27T19:25:34.000Z | 2017-04-27T19:25:34.000Z | django_lazifier2/utils/builtin_types/param.py | hotmit/-django-lazifier2 | b290e0423966db030ee01df7a65890ca36e10ba8 | [
"MIT"
] | 3 | 2021-03-19T00:25:53.000Z | 2021-09-22T18:40:00.000Z | django_lazifier2/utils/builtin_types/param.py | hotmit/-django-lazifier2 | b290e0423966db030ee01df7a65890ca36e10ba8 | [
"MIT"
] | null | null | null |
class Prm:
@classmethod
def get_prefix_kwargs(cls, kwargs: dict, prefix: str, default_param: dict, new_prefix=''):
"""
Remove param from kwargs and return the extracted result.
Eg. column_kwargs = Prm.get_prefix_kwargs(kwargs, 'col_', {'size': 10})
This will remove all the ... | 28.90625 | 94 | 0.563243 |
class Prm:
@classmethod
def get_prefix_kwargs(cls, kwargs: dict, prefix: str, default_param: dict, new_prefix=''):
result = default_param
prefix_length = len(prefix)
removed_keys = []
for k, v in kwargs.items():
key = str(k)
if key.startswith(prefix):
... | true | true |
f746f9287a2845c624d37539f21a0498c24c1707 | 281 | py | Python | test/test_inject.py | Bharat23/secret-manager-env-injector | 6915912557d66ddde8b5cb15487ced674c0555ea | [
"MIT"
] | null | null | null | test/test_inject.py | Bharat23/secret-manager-env-injector | 6915912557d66ddde8b5cb15487ced674c0555ea | [
"MIT"
] | null | null | null | test/test_inject.py | Bharat23/secret-manager-env-injector | 6915912557d66ddde8b5cb15487ced674c0555ea | [
"MIT"
] | null | null | null | import unittest
import os
from SecretManagerEnvInjector import inject
class InjectTest(unittest.TestCase):
@inject('arn:aws:secretsmanager:us-east-1:xxxxxxxxxxxxxx:secret:bogus-dj3g0R')
def test_inject(self):
self.assertEquals(os.getenv('bogus-dj3g0R'), 'test2') | 28.1 | 82 | 0.765125 | import unittest
import os
from SecretManagerEnvInjector import inject
class InjectTest(unittest.TestCase):
@inject('arn:aws:secretsmanager:us-east-1:xxxxxxxxxxxxxx:secret:bogus-dj3g0R')
def test_inject(self):
self.assertEquals(os.getenv('bogus-dj3g0R'), 'test2') | true | true |
f746fa05b74a528b441d4359b66fbd6cde78d545 | 18,733 | py | Python | tests/shared/nlu/training_data/test_training_data.py | pranavdurai10/rasa | b66909c34e53c07260a0f28e71ed8096ff7fb418 | [
"Apache-2.0"
] | null | null | null | tests/shared/nlu/training_data/test_training_data.py | pranavdurai10/rasa | b66909c34e53c07260a0f28e71ed8096ff7fb418 | [
"Apache-2.0"
] | null | null | null | tests/shared/nlu/training_data/test_training_data.py | pranavdurai10/rasa | b66909c34e53c07260a0f28e71ed8096ff7fb418 | [
"Apache-2.0"
] | null | null | null | import asyncio
from pathlib import Path
from typing import Text
import pytest
import rasa.shared.utils.io
from rasa.core.domain import Domain
from rasa.core.events import UserUttered, ActionExecuted
from rasa.core.training.structures import StoryStep, StoryGraph
from rasa.importers.importer import E2EImporter, Traini... | 31.27379 | 88 | 0.64389 | import asyncio
from pathlib import Path
from typing import Text
import pytest
import rasa.shared.utils.io
from rasa.core.domain import Domain
from rasa.core.events import UserUttered, ActionExecuted
from rasa.core.training.structures import StoryStep, StoryGraph
from rasa.importers.importer import E2EImporter, Traini... | true | true |
f746fade785d133f870c0bc36f32f09c3dca4ce3 | 9,937 | py | Python | mistral/workflow/data_flow.py | soda-research/mistral | 550a3de9c2defc7ce26336cb705d9c8d87bbaddd | [
"Apache-2.0"
] | null | null | null | mistral/workflow/data_flow.py | soda-research/mistral | 550a3de9c2defc7ce26336cb705d9c8d87bbaddd | [
"Apache-2.0"
] | null | null | null | mistral/workflow/data_flow.py | soda-research/mistral | 550a3de9c2defc7ce26336cb705d9c8d87bbaddd | [
"Apache-2.0"
] | null | null | null | # Copyright 2013 - Mirantis, Inc.
# Copyright 2015 - StackStorm, 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
#
# Unl... | 28.970845 | 78 | 0.674348 |
from oslo_config import cfg
from oslo_log import log as logging
from mistral import context as auth_ctx
from mistral.db.v2 import api as db_api
from mistral.db.v2.sqlalchemy import models
from mistral import exceptions as exc
from mistral import expressions as expr
from mistral.lang import parser as spe... | true | true |
f746fb2ce63a72a3b89e3d9f663f211378e4b507 | 1,042 | py | Python | papermerge/core/lib/mime.py | papermerge/papermerge-core | e377441a8e5ddb748fa3861f686fa22c00d407fe | [
"Apache-2.0"
] | 45 | 2021-01-10T14:33:52.000Z | 2022-03-27T14:02:56.000Z | papermerge/core/lib/mime.py | papermerge/papermerge-core | e377441a8e5ddb748fa3861f686fa22c00d407fe | [
"Apache-2.0"
] | 8 | 2021-01-08T20:02:21.000Z | 2022-02-01T13:12:24.000Z | papermerge/core/lib/mime.py | papermerge/papermerge-core | e377441a8e5ddb748fa3861f686fa22c00d407fe | [
"Apache-2.0"
] | 12 | 2021-01-07T20:03:07.000Z | 2022-03-24T04:07:51.000Z | import logging
from . import wrapper
from ..app_settings import settings
logger = logging.getLogger(__name__)
class Mime(wrapper.Wrapper):
def __init__(self, filepath):
super().__init__(exec_name=settings.BINARY_FILE)
self.filepath = filepath
def get_cmd(self):
cmd = super().get_cmd... | 22.170213 | 71 | 0.581574 | import logging
from . import wrapper
from ..app_settings import settings
logger = logging.getLogger(__name__)
class Mime(wrapper.Wrapper):
def __init__(self, filepath):
super().__init__(exec_name=settings.BINARY_FILE)
self.filepath = filepath
def get_cmd(self):
cmd = super().get_cmd... | true | true |
f746fb6113e2bc9fc7f6daa8706b6171808513f1 | 23,285 | py | Python | nbconvert/tests/test_nbconvertapp.py | agoose77/nbconvert | 3baec1068353fb7a589e2467f4a226e7af579f39 | [
"BSD-3-Clause-Clear"
] | 1 | 2021-03-18T17:06:06.000Z | 2021-03-18T17:06:06.000Z | nbconvert/tests/test_nbconvertapp.py | agoose77/nbconvert | 3baec1068353fb7a589e2467f4a226e7af579f39 | [
"BSD-3-Clause-Clear"
] | null | null | null | nbconvert/tests/test_nbconvertapp.py | agoose77/nbconvert | 3baec1068353fb7a589e2467f4a226e7af579f39 | [
"BSD-3-Clause-Clear"
] | null | null | null | # -*- coding: utf-8 -*-
"""Test NbConvertApp"""
# Copyright (c) IPython Development Team.
# Distributed under the terms of the Modified BSD License.
import os
import io
import nbformat
from .base import TestsBase
from ..postprocessors import PostProcessorBase
from ..tests.utils import onlyif_cmds_exist
from nbconver... | 42.182971 | 156 | 0.563324 |
import os
import io
import nbformat
from .base import TestsBase
from ..postprocessors import PostProcessorBase
from ..tests.utils import onlyif_cmds_exist
from nbconvert import nbconvertapp
from nbconvert.exporters import Exporter
from traitlets.tests.utils import check_help_all_output
from testpath import tempd... | true | true |
f746fc514b7f16980835c430db26d8fa34a04dda | 13,678 | py | Python | tests/dashboard/test_menu.py | dedhio/bellastore | 03cad4d11c039c6c33291021def812570c09fe36 | [
"BSD-3-Clause"
] | 3 | 2019-06-09T18:00:54.000Z | 2019-06-18T10:07:39.000Z | tests/dashboard/test_menu.py | dedhio/bellastore | 03cad4d11c039c6c33291021def812570c09fe36 | [
"BSD-3-Clause"
] | 2 | 2019-07-02T13:39:49.000Z | 2019-07-07T09:38:27.000Z | tests/dashboard/test_menu.py | dedhio/bellastore | 03cad4d11c039c6c33291021def812570c09fe36 | [
"BSD-3-Clause"
] | 1 | 2019-05-02T17:30:49.000Z | 2019-05-02T17:30:49.000Z | import json
from unittest import mock
import pytest
from django.urls import reverse
from django.utils import timezone
from django.utils.formats import localize
from saleor.dashboard.menu.forms import AssignMenuForm
from saleor.dashboard.menu.utils import (
get_menu_as_json,
get_menu_item_as_dict,
get_menu... | 33.118644 | 88 | 0.69981 | import json
from unittest import mock
import pytest
from django.urls import reverse
from django.utils import timezone
from django.utils.formats import localize
from saleor.dashboard.menu.forms import AssignMenuForm
from saleor.dashboard.menu.utils import (
get_menu_as_json,
get_menu_item_as_dict,
get_menu... | true | true |
f746fc67ef7153db450b43ce64dd35ec074e6390 | 21,329 | py | Python | octavia/common/jinja/haproxy/combined_listeners/jinja_cfg.py | spencerharmon/octavia | 92038b24b6480fe11ea80fc96c2d5f01c964763a | [
"Apache-2.0"
] | null | null | null | octavia/common/jinja/haproxy/combined_listeners/jinja_cfg.py | spencerharmon/octavia | 92038b24b6480fe11ea80fc96c2d5f01c964763a | [
"Apache-2.0"
] | null | null | null | octavia/common/jinja/haproxy/combined_listeners/jinja_cfg.py | spencerharmon/octavia | 92038b24b6480fe11ea80fc96c2d5f01c964763a | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2015 Rackspace
#
# 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... | 41.821569 | 79 | 0.615078 |
import os
import re
import jinja2
from octavia_lib.common import constants as lib_consts
from octavia.common.config import cfg
from octavia.common import constants
from octavia.common import utils as octavia_utils
PROTOCOL_MAP = {
constants.PROTOCOL_TCP: 'tcp',
constants.PROTOCOL_HTTP: 'http',
... | true | true |
f746fce398e52473f9e6e9a195a7bd0cf2dfad31 | 1,267 | py | Python | setup.py | zhengp0/regm | 0072af6de57331c76da4e467174185f83c1a17ec | [
"BSD-2-Clause"
] | 2 | 2022-03-02T21:48:11.000Z | 2022-03-02T21:48:15.000Z | setup.py | zhengp0/regm | 0072af6de57331c76da4e467174185f83c1a17ec | [
"BSD-2-Clause"
] | 2 | 2021-08-11T21:01:47.000Z | 2021-08-18T15:54:37.000Z | setup.py | zhengp0/regm | 0072af6de57331c76da4e467174185f83c1a17ec | [
"BSD-2-Clause"
] | 1 | 2021-01-20T18:43:49.000Z | 2021-01-20T18:43:49.000Z | import sys
from pathlib import Path
from setuptools import setup, find_packages
if __name__ == '__main__':
base_dir = Path(__file__).parent
src_dir = base_dir/'src'/'regmod'
sys.path.insert(0, src_dir.as_posix())
import __about__ as about
with (base_dir/'README.rst').open() as f:
long_de... | 23.90566 | 57 | 0.595896 | import sys
from pathlib import Path
from setuptools import setup, find_packages
if __name__ == '__main__':
base_dir = Path(__file__).parent
src_dir = base_dir/'src'/'regmod'
sys.path.insert(0, src_dir.as_posix())
import __about__ as about
with (base_dir/'README.rst').open() as f:
long_de... | true | true |
f746fcf4f254bb87758ee7b628aac64f092b7d48 | 429 | py | Python | waitlist/serializers.py | rodbv/kamu | f390d91f7d7755b49176cf5d504648e3fe572237 | [
"MIT"
] | 70 | 2018-05-23T16:44:44.000Z | 2021-12-05T21:48:10.000Z | waitlist/serializers.py | rodbv/kamu | f390d91f7d7755b49176cf5d504648e3fe572237 | [
"MIT"
] | 122 | 2018-10-06T21:31:24.000Z | 2020-11-09T15:04:56.000Z | waitlist/serializers.py | rodbv/kamu | f390d91f7d7755b49176cf5d504648e3fe572237 | [
"MIT"
] | 50 | 2018-05-23T05:49:10.000Z | 2021-11-22T07:53:42.000Z | from rest_framework import serializers
from books.serializers import UserSerializer, BookSerializer, LibrarySerializer
from waitlist.models import WaitlistItem
class WaitlistItemSerializer(serializers.ModelSerializer):
user = UserSerializer()
library = LibrarySerializer()
book = BookSerializer()
adde... | 28.6 | 79 | 0.764569 | from rest_framework import serializers
from books.serializers import UserSerializer, BookSerializer, LibrarySerializer
from waitlist.models import WaitlistItem
class WaitlistItemSerializer(serializers.ModelSerializer):
user = UserSerializer()
library = LibrarySerializer()
book = BookSerializer()
adde... | true | true |
f746fe2f93f05b8ef9d9235651134bd8e6f9838f | 745 | py | Python | config.py | IFB-ElixirFr/fair-checker | f762aef02cf3a43ba0ba20570eab842e75fc9d98 | [
"MIT"
] | 3 | 2020-06-11T15:44:15.000Z | 2021-06-04T09:25:33.000Z | config.py | IFB-ElixirFr/fair-checker | f762aef02cf3a43ba0ba20570eab842e75fc9d98 | [
"MIT"
] | 23 | 2020-11-25T11:33:51.000Z | 2022-01-31T15:43:39.000Z | config.py | IFB-ElixirFr/fair-checker | f762aef02cf3a43ba0ba20570eab842e75fc9d98 | [
"MIT"
] | 1 | 2022-02-02T10:04:37.000Z | 2022-02-02T10:04:37.000Z | from os import environ, path
from dotenv import load_dotenv
basedir = path.abspath(path.dirname(__file__))
load_dotenv(path.join(basedir, ".env"))
class Config(object):
# You have to config your apikey for bioportal in a separate .env file that must not be in git
# e.g. BIOPORTAL_APIKEY='xxxxxx-xxxxx-xxxx-x... | 24.833333 | 98 | 0.711409 | from os import environ, path
from dotenv import load_dotenv
basedir = path.abspath(path.dirname(__file__))
load_dotenv(path.join(basedir, ".env"))
class Config(object):
BIOPORTAL_APIKEY = environ.get("BIOPORTAL_APIKEY")
DEBUG = False
TESTING = False
SERVER_NAME = "0.0.0.0:5000"
class Pro... | true | true |
f74700aff34b2c3ec22739c1678ab10c892fe9b6 | 1,375 | py | Python | configs/cbis_ddsm_mass/faster_rcnn_r50_caffe_fpn_mstrain_1x_ddsm_extend_bbox_0.2_aug.py | Hung304-WBLEM/mmdetection | 6ac4d90c867cdd8b3cd2bc284a73205c7ce3c80e | [
"Apache-2.0"
] | null | null | null | configs/cbis_ddsm_mass/faster_rcnn_r50_caffe_fpn_mstrain_1x_ddsm_extend_bbox_0.2_aug.py | Hung304-WBLEM/mmdetection | 6ac4d90c867cdd8b3cd2bc284a73205c7ce3c80e | [
"Apache-2.0"
] | null | null | null | configs/cbis_ddsm_mass/faster_rcnn_r50_caffe_fpn_mstrain_1x_ddsm_extend_bbox_0.2_aug.py | Hung304-WBLEM/mmdetection | 6ac4d90c867cdd8b3cd2bc284a73205c7ce3c80e | [
"Apache-2.0"
] | null | null | null | _base_ = '../faster_rcnn/faster_rcnn_r50_caffe_fpn_mstrain_1x_coco.py'
model = dict(
roi_head=dict(bbox_head=dict(num_classes=2))
)
# Dataset path
DDSM_TRAIN_DATASET = '/home/hqvo2/Projects/Breast_Cancer/data/processed_data/mass/train'
DDSM_TRAIN_ANNOTATION = DDSM_TRAIN_DATASET + '/annotation_coco_with_classes_ex... | 39.285714 | 184 | 0.784727 | _base_ = '../faster_rcnn/faster_rcnn_r50_caffe_fpn_mstrain_1x_coco.py'
model = dict(
roi_head=dict(bbox_head=dict(num_classes=2))
)
DDSM_TRAIN_DATASET = '/home/hqvo2/Projects/Breast_Cancer/data/processed_data/mass/train'
DDSM_TRAIN_ANNOTATION = DDSM_TRAIN_DATASET + '/annotation_coco_with_classes_extend_bbox_0.2_... | true | true |
f74700b56454b7123c1ce8e494c30c4b8aec9669 | 645 | py | Python | tests/unit/more/debian/database/test_redis.py | timgates42/provy | ca3d5e96a2210daf3c1fd4b96e047efff152db14 | [
"MIT"
] | 15 | 2015-01-28T15:49:28.000Z | 2021-09-02T18:49:46.000Z | tests/unit/more/debian/database/test_redis.py | timgates42/provy | ca3d5e96a2210daf3c1fd4b96e047efff152db14 | [
"MIT"
] | null | null | null | tests/unit/more/debian/database/test_redis.py | timgates42/provy | ca3d5e96a2210daf3c1fd4b96e047efff152db14 | [
"MIT"
] | 3 | 2016-12-05T07:08:11.000Z | 2021-12-26T04:31:05.000Z | from mock import call
from nose.tools import istest
from provy.more.debian import AptitudeRole, RedisRole
from tests.unit.tools.helpers import ProvyTestCase
class RedisRoleTest(ProvyTestCase):
def setUp(self):
super(RedisRoleTest, self).setUp()
self.role = RedisRole(prov=None, context={})
@i... | 33.947368 | 89 | 0.725581 | from mock import call
from nose.tools import istest
from provy.more.debian import AptitudeRole, RedisRole
from tests.unit.tools.helpers import ProvyTestCase
class RedisRoleTest(ProvyTestCase):
def setUp(self):
super(RedisRoleTest, self).setUp()
self.role = RedisRole(prov=None, context={})
@i... | true | true |
f7470103f913d724eecff9cd63f99d09b3ca4ec0 | 96,153 | py | Python | trove/taskmanager/models.py | zh-f/trove | 4998becb4da14547798cece21858282761409052 | [
"Apache-2.0"
] | 1 | 2017-11-24T10:28:48.000Z | 2017-11-24T10:28:48.000Z | trove/taskmanager/models.py | 2020human/trove-new | 012da9a334bc4e9c7711dc918eea3f011463ec82 | [
"Apache-2.0"
] | null | null | null | trove/taskmanager/models.py | 2020human/trove-new | 012da9a334bc4e9c7711dc918eea3f011463ec82 | [
"Apache-2.0"
] | null | null | null | # Copyright 2012 OpenStack Foundation
#
# 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 l... | 44.127123 | 79 | 0.580585 |
import os.path
import time
import traceback
from cinderclient import exceptions as cinder_exceptions
from eventlet import greenthread
from eventlet.timeout import Timeout
from heatclient import exc as heat_exceptions
from novaclient import exceptions as nova_exceptions
from oslo_log import log as logging... | true | true |
f747016ef477946806c1d818d38cadb8c27e681e | 12,988 | py | Python | exchanges/virtualExchangeService.py | AshWorkshop/Trandash | a96b523fbd171ba2d43a6720ef2e2a496a0cf75a | [
"MIT"
] | 1 | 2018-07-25T03:43:35.000Z | 2018-07-25T03:43:35.000Z | exchanges/virtualExchangeService.py | AshWorkshop/Trandash | a96b523fbd171ba2d43a6720ef2e2a496a0cf75a | [
"MIT"
] | null | null | null | exchanges/virtualExchangeService.py | AshWorkshop/Trandash | a96b523fbd171ba2d43a6720ef2e2a496a0cf75a | [
"MIT"
] | null | null | null | from twisted.internet import defer, task
from twisted.python.failure import Failure
from exchanges.base import ExchangeService
from exchange import calcVirtualOrderBooks
import copy
import time
def defaultErrHandler(failure):
print(failure.getBriefTraceback())
return failure
def handleMultipleErr(data):
... | 34.542553 | 97 | 0.495303 | from twisted.internet import defer, task
from twisted.python.failure import Failure
from exchanges.base import ExchangeService
from exchange import calcVirtualOrderBooks
import copy
import time
def defaultErrHandler(failure):
print(failure.getBriefTraceback())
return failure
def handleMultipleErr(data):
... | true | true |
f74701fcc3657c0354a5ce167bcd47f614d819f5 | 1,741 | py | Python | pii-manager/test/unit/api/test_manager_ctx.py | ruinunca/data_tooling | 297e1f8c2898d00b523ccafb7bdd19c6d6aac9ff | [
"Apache-2.0"
] | 23 | 2021-10-21T14:23:40.000Z | 2022-03-27T01:06:13.000Z | pii-manager/test/unit/api/test_manager_ctx.py | ruinunca/data_tooling | 297e1f8c2898d00b523ccafb7bdd19c6d6aac9ff | [
"Apache-2.0"
] | 331 | 2021-11-02T00:30:56.000Z | 2022-03-08T16:48:13.000Z | pii-manager/test/unit/api/test_manager_ctx.py | ruinunca/data_tooling | 297e1f8c2898d00b523ccafb7bdd19c6d6aac9ff | [
"Apache-2.0"
] | 33 | 2021-08-07T18:53:38.000Z | 2022-02-11T13:38:11.000Z | """
Test base objects with context
"""
from pii_manager import PiiEnum, PiiEntity
from pii_manager.api import PiiManager
def _pii(pos):
return PiiEntity(PiiEnum.GOV_ID, pos, "3451-K", country="vo", name="vogonian ID")
TEST = [
("my Vogon ID is 3451-K", [_pii(15)]),
("the number 3451-K is my Vogonian ID... | 24.871429 | 85 | 0.532453 |
from pii_manager import PiiEnum, PiiEntity
from pii_manager.api import PiiManager
def _pii(pos):
return PiiEntity(PiiEnum.GOV_ID, pos, "3451-K", country="vo", name="vogonian ID")
TEST = [
("my Vogon ID is 3451-K", [_pii(15)]),
("the number 3451-K is my Vogonian ID", [_pii(11)]),
("the Vogon ID are ... | true | true |
f747020128784716762950af1d4d76dc0b286709 | 3,369 | py | Python | benchmark/startCirq3226.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | benchmark/startCirq3226.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | benchmark/startCirq3226.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time : 5/15/20 4:49 PM
# @File : grover.py
# qubit number=4
# total number=47
import cirq
import cirq.google as cg
from typing import Optional
import sys
from math import log2
import numpy as np
#thatsNoCode
from cirq.contrib.svg import SVGCircuit
# Symbols for... | 37.433333 | 77 | 0.678836 |
import cirq
import cirq.google as cg
from typing import Optional
import sys
from math import log2
import numpy as np
from cirq.contrib.svg import SVGCircuit
def make_circuit(n: int, input_qubit):
c = cirq.Circuit()
c.append(cirq.H.on(input_qubit[0]))
c.append(cirq.H.on(input_qubit[2]))
... | true | true |
f7470334cab69437b4ec62e4ac0a28475cccfa22 | 1,133 | py | Python | lib/galaxy/model/orm/__init__.py | blankenberg/galaxy-data-resource | ca32a1aafd64948f489a4e5cf88096f32391b1d9 | [
"CC-BY-3.0"
] | null | null | null | lib/galaxy/model/orm/__init__.py | blankenberg/galaxy-data-resource | ca32a1aafd64948f489a4e5cf88096f32391b1d9 | [
"CC-BY-3.0"
] | 1 | 2015-02-21T18:48:19.000Z | 2015-02-27T15:50:32.000Z | lib/galaxy/model/orm/__init__.py | blankenberg/galaxy-data-resource | ca32a1aafd64948f489a4e5cf88096f32391b1d9 | [
"CC-BY-3.0"
] | 3 | 2015-02-22T13:34:16.000Z | 2020-10-01T01:28:04.000Z | import pkg_resources
pkg_resources.require( "SQLAlchemy >= 0.4" )
from sqlalchemy import *
from sqlalchemy.orm import *
from sqlalchemy.interfaces import *
import logging
log = logging.getLogger( __name__ )
dialect_to_egg = {
"sqlite": "pysqlite>=2",
"postgres": "psycopg2",
"postgresql": "psycopg2",
... | 29.815789 | 110 | 0.649603 | import pkg_resources
pkg_resources.require( "SQLAlchemy >= 0.4" )
from sqlalchemy import *
from sqlalchemy.orm import *
from sqlalchemy.interfaces import *
import logging
log = logging.getLogger( __name__ )
dialect_to_egg = {
"sqlite": "pysqlite>=2",
"postgres": "psycopg2",
"postgresql": "psycopg2",
... | true | true |
f747043e30182d6e6e8d7145a5f8badfc24fe22d | 1,182 | py | Python | tests/test_data/impl_stubs.py | surevs/gauge-python | 2d91295c59d8cbbd3aec221cc1349805fbc01697 | [
"MIT"
] | null | null | null | tests/test_data/impl_stubs.py | surevs/gauge-python | 2d91295c59d8cbbd3aec221cc1349805fbc01697 | [
"MIT"
] | null | null | null | tests/test_data/impl_stubs.py | surevs/gauge-python | 2d91295c59d8cbbd3aec221cc1349805fbc01697 | [
"MIT"
] | null | null | null | from getgauge.python import (before_step, step, after_step, before_scenario,
after_scenario, before_spec, after_spec,
before_suite, after_suite, custom_screen_grabber,
continue_on_failure)
@step("Step 1")
def step1():
pass
@c... | 12.989011 | 78 | 0.652284 | from getgauge.python import (before_step, step, after_step, before_scenario,
after_scenario, before_spec, after_spec,
before_suite, after_suite, custom_screen_grabber,
continue_on_failure)
@step("Step 1")
def step1():
pass
@c... | true | true |
f7470513546ac52103f116b498ea7d1d0b08991b | 2,219 | py | Python | drf_admin/apps/system/serializers/permissions.py | guohaihan/myproject | 0ec105d0bd48477faddf93bd62a8ede800419ae6 | [
"MIT"
] | 228 | 2020-06-20T10:07:03.000Z | 2022-03-29T07:11:01.000Z | drf_admin/apps/system/serializers/permissions.py | guohaihan/myproject | 0ec105d0bd48477faddf93bd62a8ede800419ae6 | [
"MIT"
] | 25 | 2020-07-16T12:29:04.000Z | 2022-02-16T06:31:06.000Z | drf_admin/apps/system/serializers/permissions.py | guohaihan/myproject | 0ec105d0bd48477faddf93bd62a8ede800419ae6 | [
"MIT"
] | 82 | 2020-10-26T07:14:15.000Z | 2022-03-29T07:53:23.000Z | # -*- coding: utf-8 -*-
"""
@author : Wang Meng
@github : https://github.com/tianpangji
@software : PyCharm
@file : permissions.py
@create : 2020/7/22 21:44
"""
from rest_framework import serializers
from drf_admin.common.models import get_child_ids
from drf_admin.utils.views import TreeSerializer
from sys... | 34.671875 | 87 | 0.628211 |
from rest_framework import serializers
from drf_admin.common.models import get_child_ids
from drf_admin.utils.views import TreeSerializer
from system.models import Permissions
class PermissionsSerializer(serializers.ModelSerializer):
class Meta:
model = Permissions
fields = '__all__'
def v... | true | true |
f747059b81616fc5fa3ec56a6cb75e8901caa8eb | 65,942 | py | Python | tensor2tensor/layers/common_attention_test.py | levskaya/tensor2tensor | 4643800137f802693f880a1fab9e10de7ba32e66 | [
"Apache-2.0"
] | 34 | 2018-12-19T01:00:57.000Z | 2021-03-26T09:36:37.000Z | tensor2tensor/layers/common_attention_test.py | levskaya/tensor2tensor | 4643800137f802693f880a1fab9e10de7ba32e66 | [
"Apache-2.0"
] | 11 | 2018-12-25T03:37:59.000Z | 2021-08-25T14:43:58.000Z | tensor2tensor/layers/common_attention_test.py | levskaya/tensor2tensor | 4643800137f802693f880a1fab9e10de7ba32e66 | [
"Apache-2.0"
] | 9 | 2018-12-27T08:00:44.000Z | 2020-06-08T03:05:14.000Z | # coding=utf-8
# Copyright 2019 The Tensor2Tensor 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... | 42.216389 | 80 | 0.559052 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from absl.testing import parameterized
import kfac
import numpy as np
from tensor2tensor.layers import common_attention
from tensor2tensor.layers import common_layers
from tensor2tensor.utils i... | true | true |
f74705b7133baa5bdcfd4b0e97c7a61d2c354acb | 15,460 | py | Python | pymatgen/analysis/tests/test_reaction_calculator.py | mailhexu/pymatgen | 70da55dd860771eb9d38c306dbcd3f6b074b7a54 | [
"MIT"
] | 18 | 2019-06-15T18:08:21.000Z | 2022-01-30T05:01:29.000Z | ComRISB/pyextern/pymatgen/pymatgen/analysis/tests/test_reaction_calculator.py | comscope/Comsuite | b80ca9f34c519757d337487c489fb655f7598cc2 | [
"BSD-3-Clause"
] | null | null | null | ComRISB/pyextern/pymatgen/pymatgen/analysis/tests/test_reaction_calculator.py | comscope/Comsuite | b80ca9f34c519757d337487c489fb655f7598cc2 | [
"BSD-3-Clause"
] | 11 | 2019-06-05T02:57:55.000Z | 2021-12-29T02:54:25.000Z | # coding: utf-8
# Copyright (c) Pymatgen Development Team.
# Distributed under the terms of the MIT License.
from __future__ import unicode_literals
import unittest
from pymatgen import Composition
from pymatgen.analysis.reaction_calculator import Reaction, BalancedReaction, \
ReactionError, ComputedReaction
fro... | 42.356164 | 90 | 0.556662 |
from __future__ import unicode_literals
import unittest
from pymatgen import Composition
from pymatgen.analysis.reaction_calculator import Reaction, BalancedReaction, \
ReactionError, ComputedReaction
from pymatgen.entries.computed_entries import ComputedEntry
class ReactionTest(unittest.TestCase):
def ... | true | true |
f7470607a67b80300e215c86301fadd942f43f61 | 1,318 | py | Python | tests/gui/fracdim_isolated_test_e2e.py | demid5111/approximate-enthropy | 2ec331087a1af0279a429656890d44a04c734903 | [
"MIT"
] | null | null | null | tests/gui/fracdim_isolated_test_e2e.py | demid5111/approximate-enthropy | 2ec331087a1af0279a429656890d44a04c734903 | [
"MIT"
] | 7 | 2019-03-02T08:23:11.000Z | 2019-07-06T14:18:23.000Z | tests/gui/fracdim_isolated_test_e2e.py | demid5111/approximate-enthropy | 2ec331087a1af0279a429656890d44a04c734903 | [
"MIT"
] | null | null | null | from gui_version import App
from tests.gui.app_testing_bed import FracDimTestingBed
from tests.gui.common import check_report
def test_fracdim_wo_windows(qtbot):
window = App()
qtbot.addWidget(window)
test_app = FracDimTestingBed(qtbot=qtbot, window=window)
qtbot.waitForWindowShown(window)
tes... | 24.407407 | 60 | 0.759484 | from gui_version import App
from tests.gui.app_testing_bed import FracDimTestingBed
from tests.gui.common import check_report
def test_fracdim_wo_windows(qtbot):
window = App()
qtbot.addWidget(window)
test_app = FracDimTestingBed(qtbot=qtbot, window=window)
qtbot.waitForWindowShown(window)
tes... | true | true |
f74707f3f5c4d71f877b72f559c5a4d81c4e610e | 2,595 | py | Python | modules/dials/util/pprint.py | jorgediazjr/dials-dev20191018 | 77d66c719b5746f37af51ad593e2941ed6fbba17 | [
"BSD-3-Clause"
] | null | null | null | modules/dials/util/pprint.py | jorgediazjr/dials-dev20191018 | 77d66c719b5746f37af51ad593e2941ed6fbba17 | [
"BSD-3-Clause"
] | null | null | null | modules/dials/util/pprint.py | jorgediazjr/dials-dev20191018 | 77d66c719b5746f37af51ad593e2941ed6fbba17 | [
"BSD-3-Clause"
] | 1 | 2020-02-04T15:39:06.000Z | 2020-02-04T15:39:06.000Z | from __future__ import absolute_import, division, print_function
def profile2d(p, vmin=None, vmax=None):
from dials.array_family import flex
import string
if vmin is None:
vmin = flex.min(p)
if vmax is None:
vmax = flex.max(p)
assert vmax >= vmin
dv = vmax - vmin
if dv == ... | 22.37069 | 64 | 0.380347 | from __future__ import absolute_import, division, print_function
def profile2d(p, vmin=None, vmax=None):
from dials.array_family import flex
import string
if vmin is None:
vmin = flex.min(p)
if vmax is None:
vmax = flex.max(p)
assert vmax >= vmin
dv = vmax - vmin
if dv == ... | true | true |
f747085912a3c4705ebdba43269f0d403e76c4f4 | 607 | py | Python | test1/test2/test27.py | qwert-f/flask | 00c350f8190c2a6c0eee55031aca0873eb4c91ee | [
"MIT"
] | null | null | null | test1/test2/test27.py | qwert-f/flask | 00c350f8190c2a6c0eee55031aca0873eb4c91ee | [
"MIT"
] | 1 | 2022-01-18T02:54:04.000Z | 2022-01-18T02:54:44.000Z | test1/test2/test27.py | qwert-f/flask | 00c350f8190c2a6c0eee55031aca0873eb4c91ee | [
"MIT"
] | null | null | null | from flask import Flask, g
app = Flask(__name__)
# arg = 'i'
@app.before_request
def sd():
arg = 123
bf(arg)
def bf(arg):
# global arg
g.x = arg
return arg
@app.route("/index", methods=["POST", "GET"])
def index():
g.x = 123
return "index"
@app.route("/test", methods=["POST", "GET"]... | 13.488889 | 45 | 0.61285 | from flask import Flask, g
app = Flask(__name__)
@app.before_request
def sd():
arg = 123
bf(arg)
def bf(arg):
g.x = arg
return arg
@app.route("/index", methods=["POST", "GET"])
def index():
g.x = 123
return "index"
@app.route("/test", methods=["POST", "GET"])
def test():
... | true | true |
f747087b3ae00264af4707c86c0ebc25aa5ff397 | 4,824 | py | Python | python/fedml/cross_silo/hierarchical/trainer_dist_adapter.py | NCLPhD/FedML | ffa15262ee963b9c856f34f0b2202f4dfeb3a76b | [
"Apache-2.0"
] | null | null | null | python/fedml/cross_silo/hierarchical/trainer_dist_adapter.py | NCLPhD/FedML | ffa15262ee963b9c856f34f0b2202f4dfeb3a76b | [
"Apache-2.0"
] | null | null | null | python/fedml/cross_silo/hierarchical/trainer_dist_adapter.py | NCLPhD/FedML | ffa15262ee963b9c856f34f0b2202f4dfeb3a76b | [
"Apache-2.0"
] | null | null | null | from torch.nn.parallel import DistributedDataParallel as DDP
import torch.distributed as dist
from .fedml_trainer import FedMLTrainer
from .process_group_manager import ProcessGroupManager
from torch.nn.parallel import DistributedDataParallel as DDP
from .trainer.my_model_trainer_classification import MyModelTrainer a... | 34.956522 | 106 | 0.69631 | from torch.nn.parallel import DistributedDataParallel as DDP
import torch.distributed as dist
from .fedml_trainer import FedMLTrainer
from .process_group_manager import ProcessGroupManager
from torch.nn.parallel import DistributedDataParallel as DDP
from .trainer.my_model_trainer_classification import MyModelTrainer a... | true | true |
f74709a36f618b31556614f51648ea168bff70d3 | 2,307 | py | Python | jishaku/help_command.py | ExpertTutorials/Hishaku | fcdcd677cde0b580b41fe50b9df549e23eb0edc3 | [
"MIT"
] | null | null | null | jishaku/help_command.py | ExpertTutorials/Hishaku | fcdcd677cde0b580b41fe50b9df549e23eb0edc3 | [
"MIT"
] | null | null | null | jishaku/help_command.py | ExpertTutorials/Hishaku | fcdcd677cde0b580b41fe50b9df549e23eb0edc3 | [
"MIT"
] | 1 | 2021-09-14T16:50:28.000Z | 2021-09-14T16:50:28.000Z | # -*- coding: utf-8 -*-
"""
jishaku.help_command
~~~~~~~~~~~~~~~~~~~~
HelpCommand subclasses with jishaku features
:copyright: (c) 2021 Devon (Gorialis) R
:license: MIT, see LICENSE for more details.
"""
from hashcord.ext import commands
from jishaku.paginators import PaginatorEmbedInterface, PaginatorInterface
... | 30.76 | 105 | 0.721283 |
from hashcord.ext import commands
from jishaku.paginators import PaginatorEmbedInterface, PaginatorInterface
class DefaultPaginatorHelp(commands.DefaultHelpCommand):
def __init__(self, **options):
paginator = options.pop('paginator', commands.Paginator(max_size=1985))
super().__init__(pagina... | true | true |
f7470bd0387110d3a349147b26ffb6cb9c90b289 | 149 | py | Python | flask_react/config.py | ripitrust/flask_react | a77b8e6ce54d6f58c92863370c3767b9001cc19c | [
"MIT"
] | 2 | 2020-10-12T00:24:38.000Z | 2021-07-25T16:59:52.000Z | flask_react/config.py | ripitrust/flask_react | a77b8e6ce54d6f58c92863370c3767b9001cc19c | [
"MIT"
] | null | null | null | flask_react/config.py | ripitrust/flask_react | a77b8e6ce54d6f58c92863370c3767b9001cc19c | [
"MIT"
] | null | null | null | import os
class Config(object):
def __init__(self, name=None, path=None):
self.name = name
self.path = os.path.abspath(path)
| 14.9 | 45 | 0.624161 | import os
class Config(object):
def __init__(self, name=None, path=None):
self.name = name
self.path = os.path.abspath(path)
| true | true |
f7470bdbbe057c4ef657aa4bddda373025b88a37 | 2,339 | py | Python | aliyun-python-sdk-live/aliyunsdklive/request/v20161101/CreateMixStreamRequest.py | yndu13/aliyun-openapi-python-sdk | 12ace4fb39fe2fb0e3927a4b1b43ee4872da43f5 | [
"Apache-2.0"
] | 1,001 | 2015-07-24T01:32:41.000Z | 2022-03-25T01:28:18.000Z | aliyun-python-sdk-live/aliyunsdklive/request/v20161101/CreateMixStreamRequest.py | yndu13/aliyun-openapi-python-sdk | 12ace4fb39fe2fb0e3927a4b1b43ee4872da43f5 | [
"Apache-2.0"
] | 363 | 2015-10-20T03:15:00.000Z | 2022-03-08T12:26:19.000Z | aliyun-python-sdk-live/aliyunsdklive/request/v20161101/CreateMixStreamRequest.py | yndu13/aliyun-openapi-python-sdk | 12ace4fb39fe2fb0e3927a4b1b43ee4872da43f5 | [
"Apache-2.0"
] | 682 | 2015-09-22T07:19:02.000Z | 2022-03-22T09:51:46.000Z | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | 34.397059 | 76 | 0.767422 |
from aliyunsdkcore.request import RpcRequest
from aliyunsdklive.endpoint import endpoint_data
class CreateMixStreamRequest(RpcRequest):
def __init__(self):
RpcRequest.__init__(self, 'live', '2016-11-01', 'CreateMixStream','live')
self.set_method('POST')
if hasattr(self, "endpoint_map"):
... | true | true |
f7470bff190887ccf9bd0ff3eb570902e9594734 | 11,834 | py | Python | src/python/zquantum/core/circuits/conversions/qiskit_conversions.py | alexjuda2/z-quantum-core | c258100dbd091f0b22495b77b36399426ae9abac | [
"Apache-2.0"
] | null | null | null | src/python/zquantum/core/circuits/conversions/qiskit_conversions.py | alexjuda2/z-quantum-core | c258100dbd091f0b22495b77b36399426ae9abac | [
"Apache-2.0"
] | null | null | null | src/python/zquantum/core/circuits/conversions/qiskit_conversions.py | alexjuda2/z-quantum-core | c258100dbd091f0b22495b77b36399426ae9abac | [
"Apache-2.0"
] | null | null | null | import hashlib
from typing import Dict, Iterable, List, NamedTuple, Sequence, Tuple, Union
import numpy as np
import qiskit
import sympy
from .. import _builtin_gates, _circuit, _gates
from ..symbolic.qiskit_expressions import QISKIT_DIALECT, expression_from_qiskit
from ..symbolic.sympy_expressions import SYMPY_DIALE... | 34.703812 | 88 | 0.730522 | import hashlib
from typing import Dict, Iterable, List, NamedTuple, Sequence, Tuple, Union
import numpy as np
import qiskit
import sympy
from .. import _builtin_gates, _circuit, _gates
from ..symbolic.qiskit_expressions import QISKIT_DIALECT, expression_from_qiskit
from ..symbolic.sympy_expressions import SYMPY_DIALE... | true | true |
f7470c0641c7c582a71a487e316ddc405709a1ad | 18,129 | py | Python | code/final_rrl.py | aalaprana995/Turtlebot_Navigation_Non_Holonomic_Constrains- | 9978467def69080fcd4da7c856e54b6ebda98248 | [
"Unlicense"
] | null | null | null | code/final_rrl.py | aalaprana995/Turtlebot_Navigation_Non_Holonomic_Constrains- | 9978467def69080fcd4da7c856e54b6ebda98248 | [
"Unlicense"
] | null | null | null | code/final_rrl.py | aalaprana995/Turtlebot_Navigation_Non_Holonomic_Constrains- | 9978467def69080fcd4da7c856e54b6ebda98248 | [
"Unlicense"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Sun Apr 28 00:33:10 2019
@author: Aalap
"""
# -*- coding: utf-8 -*
"""
Created on Thu Mar 28 18:47:25 2019
@author: Aalap
"""
import numpy as np
import matplotlib.pyplot as plt
import math
class Node:
def __init__(self, nodex, nodey,nodetheta, cost, p... | 35.201942 | 140 | 0.529097 |
import numpy as np
import matplotlib.pyplot as plt
import math
class Node:
def __init__(self, nodex, nodey,nodetheta, cost, parentnode,vx,vy,vt):
self.nodex = nodex
self.nodey = nodey
self.nodetheta=nodetheta
self.cost = cost
self.parentnode = parentnode
... | true | true |
f7470c3e1cf06d51d9d088d5173d548c73dc2c0d | 1,561 | py | Python | flowvision/layers/regularization/droppath.py | ZiqiuChi/vision | b5ecf5431f7767d8920a69005e7822185ad31f81 | [
"BSD-3-Clause"
] | 40 | 2021-10-19T02:34:56.000Z | 2022-03-25T07:49:44.000Z | flowvision/layers/regularization/droppath.py | ZiqiuChi/vision | b5ecf5431f7767d8920a69005e7822185ad31f81 | [
"BSD-3-Clause"
] | 53 | 2021-10-22T02:24:44.000Z | 2022-03-31T04:20:47.000Z | flowvision/layers/regularization/droppath.py | ZiqiuChi/vision | b5ecf5431f7767d8920a69005e7822185ad31f81 | [
"BSD-3-Clause"
] | 11 | 2022-01-06T02:57:07.000Z | 2022-03-23T15:19:51.000Z | """
Modified from https://github.com/rwightman/pytorch-image-models/blob/master/timm/models/layers/drop.py
"""
import oneflow as flow
import oneflow.nn as nn
import oneflow.nn.functional as F
def drop_path(x, drop_prob: float = 0.5, training: bool = False):
"""Drop paths (Stochastic Depth) per sample (when appli... | 39.025 | 108 | 0.695708 |
import oneflow as flow
import oneflow.nn as nn
import oneflow.nn.functional as F
def drop_path(x, drop_prob: float = 0.5, training: bool = False):
if drop_prob == 0.0 or not training:
return x
keep_prob = 1 - drop_prob
shape = (x.shape[0],) + (1,) * (
x.ndim - 1
)
random_tensor ... | true | true |
f7470cbdec80026c46e3da86152a22f595f8aa0f | 4,971 | py | Python | ros/src/twist_controller/dbw_node.py | deepakzambre/SystemIntegration | 0449c73d5e141b170341eca835b9ca0e3ea282bd | [
"MIT"
] | null | null | null | ros/src/twist_controller/dbw_node.py | deepakzambre/SystemIntegration | 0449c73d5e141b170341eca835b9ca0e3ea282bd | [
"MIT"
] | null | null | null | ros/src/twist_controller/dbw_node.py | deepakzambre/SystemIntegration | 0449c73d5e141b170341eca835b9ca0e3ea282bd | [
"MIT"
] | null | null | null | #!/usr/bin/env python
import rospy
from std_msgs.msg import Bool
from dbw_mkz_msgs.msg import ThrottleCmd, SteeringCmd, BrakeCmd, SteeringReport
from geometry_msgs.msg import TwistStamped
import math
from twist_controller import Controller
'''
You can build this node only after you have built (or partially built) th... | 38.534884 | 101 | 0.665862 |
import rospy
from std_msgs.msg import Bool
from dbw_mkz_msgs.msg import ThrottleCmd, SteeringCmd, BrakeCmd, SteeringReport
from geometry_msgs.msg import TwistStamped
import math
from twist_controller import Controller
class DBWNode(object):
def __init__(self):
rospy.init_node('dbw_node')
vehic... | true | true |
f7470d2d3cfdfbe078ce683175c4bd4135846fc6 | 1,587 | py | Python | routemaster/gunicorn_application.py | thread/routemaster | 1fd997a3bcee5e6760e9f7a60cb54323c3dfdc41 | [
"MIT"
] | 13 | 2018-01-16T14:26:27.000Z | 2022-03-19T12:43:17.000Z | routemaster/gunicorn_application.py | thread/routemaster | 1fd997a3bcee5e6760e9f7a60cb54323c3dfdc41 | [
"MIT"
] | 86 | 2018-01-03T17:00:56.000Z | 2021-12-06T12:58:06.000Z | routemaster/gunicorn_application.py | thread/routemaster | 1fd997a3bcee5e6760e9f7a60cb54323c3dfdc41 | [
"MIT"
] | 3 | 2018-02-21T23:13:45.000Z | 2022-03-19T12:43:23.000Z | """Top-level gunicorn application for `routemaster serve`."""
from typing import Callable
import gunicorn.app.base
from routemaster.utils import WSGICallable
class GunicornWSGIApplication(gunicorn.app.base.BaseApplication):
"""gunicorn application for routemaster."""
def __init__(
self,
ap... | 27.362069 | 76 | 0.589792 |
from typing import Callable
import gunicorn.app.base
from routemaster.utils import WSGICallable
class GunicornWSGIApplication(gunicorn.app.base.BaseApplication):
def __init__(
self,
app: WSGICallable,
*,
bind: str,
debug: bool,
workers: int,
post_fork: C... | true | true |
f7470d3e9c259bf87df531070992f7d07655b318 | 3,660 | py | Python | salt/states/blockdev.py | aletourneau/salt | d7013a2f64eb4b79592220d76274bc5dde609e08 | [
"Apache-2.0"
] | null | null | null | salt/states/blockdev.py | aletourneau/salt | d7013a2f64eb4b79592220d76274bc5dde609e08 | [
"Apache-2.0"
] | null | null | null | salt/states/blockdev.py | aletourneau/salt | d7013a2f64eb4b79592220d76274bc5dde609e08 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
'''
Management of Block Devices
===================================
A state module to manage blockdevices
.. code-block:: yaml
/dev/sda:
blockdev.tuned:
- read-only: True
master-data:
blockdev:
- tuned:
- name : /dev/vg/master-data
- read-... | 24.4 | 78 | 0.531421 |
from __future__ import absolute_import
import os
import os.path
import salt.utils
def __virtual__():
if salt.utils.is_windows():
return False
return True
def tuned(name, **kwargs):
ret = {'changes': {},
'comment': '',
'name': name,
'result': True}
if n... | true | true |
f7470d8dd5a2e42d2b128b950c869f1ed56901b5 | 140 | py | Python | twitter_gen/db_migration/0002.addindex.py | liufuyang/twitter_tesla | 8a5c0a8e13d8a09aa24b609819ad3b4faf9f7542 | [
"MIT"
] | null | null | null | twitter_gen/db_migration/0002.addindex.py | liufuyang/twitter_tesla | 8a5c0a8e13d8a09aa24b609819ad3b4faf9f7542 | [
"MIT"
] | null | null | null | twitter_gen/db_migration/0002.addindex.py | liufuyang/twitter_tesla | 8a5c0a8e13d8a09aa24b609819ad3b4faf9f7542 | [
"MIT"
] | null | null | null |
__depends__ = ['0001.create']
step(
"""CREATE INDEX idx_created_at ON tweets(created_at DESC);""",
"DROP INDEX idx_created_at",
)
| 17.5 | 66 | 0.678571 |
__depends__ = ['0001.create']
step(
"""CREATE INDEX idx_created_at ON tweets(created_at DESC);""",
"DROP INDEX idx_created_at",
)
| true | true |
f7470f61bb4e99f373e4fbc19aa021a976d225ef | 1,211 | py | Python | check_brackets.py | mrcrnkovich/random_scripts | a77af23e985c0ceef799f886cb24982ab3f2e7db | [
"MIT"
] | null | null | null | check_brackets.py | mrcrnkovich/random_scripts | a77af23e985c0ceef799f886cb24982ab3f2e7db | [
"MIT"
] | null | null | null | check_brackets.py | mrcrnkovich/random_scripts | a77af23e985c0ceef799f886cb24982ab3f2e7db | [
"MIT"
] | null | null | null | # python3
from collections import namedtuple
Bracket = namedtuple("Bracket", ["char", "position"])
def are_matching(left, right):
return (left + right) in ["()", "[]", "{}"]
def find_mismatch(text):
opening_brackets_stack = []
mismatch = []
for i, next in enumerate(text):
# Process ... | 24.22 | 68 | 0.575557 |
from collections import namedtuple
Bracket = namedtuple("Bracket", ["char", "position"])
def are_matching(left, right):
return (left + right) in ["()", "[]", "{}"]
def find_mismatch(text):
opening_brackets_stack = []
mismatch = []
for i, next in enumerate(text):
if next in... | true | true |
f747101d66f0d799832bde2dc14cbc4b03a9207b | 514 | py | Python | webui/flaski/models.py | jphacks/NG_1703 | 0c0bec03d71f467f90d8fbe01b31ed4341f3e1a5 | [
"MIT"
] | 1 | 2017-10-31T10:18:08.000Z | 2017-10-31T10:18:08.000Z | webui/flaski/models.py | jphacks/NG_1703 | 0c0bec03d71f467f90d8fbe01b31ed4341f3e1a5 | [
"MIT"
] | null | null | null | webui/flaski/models.py | jphacks/NG_1703 | 0c0bec03d71f467f90d8fbe01b31ed4341f3e1a5 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from sqlalchemy import Column, Integer, String, Text, DateTime
from flaski.database import Base
from datetime import datetime
class WikiContent(Base):
__tablename__ = 'wikicontents'
id = Column(Integer, primary_key = True)
title = Column(String(128), unique = True)
body = Column(Text)
de... | 27.052632 | 97 | 0.70428 |
from sqlalchemy import Column, Integer, String, Text, DateTime
from flaski.database import Base
from datetime import datetime
class WikiContent(Base):
__tablename__ = 'wikicontents'
id = Column(Integer, primary_key = True)
title = Column(String(128), unique = True)
body = Column(Text)
def __init__(self, title... | true | true |
f74710349a3103b8f5e0f02169118a02160d0b43 | 3,437 | py | Python | MaixPy/tools/kconfig/Kconfiglib/examples/find_symbol.py | valerio-vaccaro/krux | a3718a4e12ef6f92ada98e02d0d286a971a56434 | [
"MIT"
] | 302 | 2015-03-21T06:36:29.000Z | 2022-03-27T06:41:04.000Z | MaixPy/tools/kconfig/Kconfiglib/examples/find_symbol.py | valerio-vaccaro/krux | a3718a4e12ef6f92ada98e02d0d286a971a56434 | [
"MIT"
] | 104 | 2015-02-16T20:05:48.000Z | 2022-03-15T23:50:57.000Z | MaixPy/tools/kconfig/Kconfiglib/examples/find_symbol.py | valerio-vaccaro/krux | a3718a4e12ef6f92ada98e02d0d286a971a56434 | [
"MIT"
] | 120 | 2015-02-16T18:05:09.000Z | 2022-03-17T02:28:29.000Z | # Prints all menu nodes that reference a given symbol any of their properties
# or property conditions, along with their parent menu nodes.
#
# Usage:
#
# $ make [ARCH=<arch>] scriptconfig SCRIPT=Kconfiglib/examples/find_symbol.py SCRIPT_ARG=<name>
#
# Example output for SCRIPT_ARG=X86:
#
# Found 470 locations that... | 30.415929 | 97 | 0.637184 |
import sys
import kconfiglib
if len(sys.argv) < 3:
sys.exit('Pass symbol name (without "CONFIG_" prefix) with SCRIPT_ARG=<name>')
kconf = kconfiglib.Kconfig(sys.argv[1])
sym_name = sys.argv[2]
if sym_name not in kconf.syms:
print("N... | true | true |
f747108e65957765e3704f97eb94e1b76555f7c8 | 2,297 | py | Python | src/main/views/comment.py | Karim-Valeev/django-pikabu | 8e152cfb9a34f23d21385851bc08ba34fe15d6f1 | [
"MIT"
] | 1 | 2021-11-24T13:44:56.000Z | 2021-11-24T13:44:56.000Z | src/main/views/comment.py | Karim-Valeev/django-pikabu | 8e152cfb9a34f23d21385851bc08ba34fe15d6f1 | [
"MIT"
] | 1 | 2021-11-23T11:32:44.000Z | 2021-11-27T22:31:41.000Z | src/main/views/comment.py | Karim-Valeev/django-pikabu | 8e152cfb9a34f23d21385851bc08ba34fe15d6f1 | [
"MIT"
] | null | null | null | from django.contrib.auth.mixins import LoginRequiredMixin
from django.http import HttpResponseRedirect
from django.shortcuts import get_object_or_404
from django.urls import reverse_lazy
from django.views.generic import CreateView
from django.views.generic import DeleteView
from django.views.generic import UpdateView
f... | 35.890625 | 80 | 0.709186 | from django.contrib.auth.mixins import LoginRequiredMixin
from django.http import HttpResponseRedirect
from django.shortcuts import get_object_or_404
from django.urls import reverse_lazy
from django.views.generic import CreateView
from django.views.generic import DeleteView
from django.views.generic import UpdateView
f... | true | true |
f74710bc2bc8a5f14bd94bf624569c968cdf4474 | 8,892 | py | Python | electrum_ltc/gui/kivy/uix/dialogs/addresses.py | cryptomountain/electrum-ltc | 67c080c0fc9e5fd698e47f51fa0664c7c05850af | [
"MIT"
] | null | null | null | electrum_ltc/gui/kivy/uix/dialogs/addresses.py | cryptomountain/electrum-ltc | 67c080c0fc9e5fd698e47f51fa0664c7c05850af | [
"MIT"
] | 1 | 2022-03-06T09:22:26.000Z | 2022-03-06T09:22:26.000Z | electrum_ltc/gui/kivy/uix/dialogs/addresses.py | isabella232/electrum-ltc | 8307e3978b12ae27fc3f750f47cda7f18d5fafe5 | [
"MIT"
] | 1 | 2022-03-06T09:16:48.000Z | 2022-03-06T09:16:48.000Z | from typing import TYPE_CHECKING
from kivy.app import App
from kivy.clock import Clock
from kivy.factory import Factory
from kivy.properties import ObjectProperty
from kivy.lang import Builder
from decimal import Decimal
from kivy.uix.popup import Popup
from electrum_ltc.gui.kivy.i18n import _
from ...util import add... | 32.691176 | 151 | 0.527103 | from typing import TYPE_CHECKING
from kivy.app import App
from kivy.clock import Clock
from kivy.factory import Factory
from kivy.properties import ObjectProperty
from kivy.lang import Builder
from decimal import Decimal
from kivy.uix.popup import Popup
from electrum_ltc.gui.kivy.i18n import _
from ...util import add... | true | true |
f747110f318718a46688524a6c0e2b265ad4f786 | 46,193 | py | Python | tensorflow/python/framework/func_graph.py | plopresti/tensorflow | 8b0c84d30d957596cbb3bcac9245e114c3f0b65b | [
"Apache-2.0"
] | 1 | 2019-07-17T17:37:50.000Z | 2019-07-17T17:37:50.000Z | tensorflow/python/framework/func_graph.py | plopresti/tensorflow | 8b0c84d30d957596cbb3bcac9245e114c3f0b65b | [
"Apache-2.0"
] | 3 | 2020-10-14T00:35:40.000Z | 2022-02-09T22:35:09.000Z | tensorflow/python/framework/func_graph.py | plopresti/tensorflow | 8b0c84d30d957596cbb3bcac9245e114c3f0b65b | [
"Apache-2.0"
] | null | null | null | # Copyright 2018 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 42.850649 | 97 | 0.695062 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import collections as py_collections
import itertools
import weakref
from tensorflow.core.framework import attr_value_pb2
from tensorflow.python.eager import context
from tensorflow.python.eager... | true | true |
f7471207e739d6b43f13d746c8edd27468934910 | 12,835 | py | Python | tests/test_sim.py | lydian/mrjob | 13028274296f5618d63ffc00301537fd385eef82 | [
"Apache-2.0"
] | null | null | null | tests/test_sim.py | lydian/mrjob | 13028274296f5618d63ffc00301537fd385eef82 | [
"Apache-2.0"
] | null | null | null | tests/test_sim.py | lydian/mrjob | 13028274296f5618d63ffc00301537fd385eef82 | [
"Apache-2.0"
] | null | null | null | # Copyright 2017 Yelp
# Copyright 2018 Yelp
#
# 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... | 33.337662 | 78 | 0.619945 |
from io import BytesIO
import gzip
import os
import os.path
import stat
from mrjob import conf
from mrjob.inline import InlineMRJobRunner
from mrjob.job import MRJob
from mrjob.protocol import JSONValueProtocol
from mrjob.step import MRStep
from tests.mr_group import MRGroup
from tests.mr_no_mapper impo... | true | true |
f7471237d7612679736c43ff17a0bce3f19bd112 | 1,965 | py | Python | lib/pymedphys/cli/dev.py | dg1an3/pymedphys | bdca9c783aae8b5e1f231e6cb0bc69895e4b9329 | [
"Apache-2.0"
] | 2 | 2020-02-04T03:21:20.000Z | 2020-04-11T14:17:53.000Z | lib/pymedphys/cli/dev.py | SimonBiggs/pymedphys | 83f02eac6549ac155c6963e0a8d1f9284359b652 | [
"Apache-2.0"
] | null | null | null | lib/pymedphys/cli/dev.py | SimonBiggs/pymedphys | 83f02eac6549ac155c6963e0a8d1f9284359b652 | [
"Apache-2.0"
] | null | null | null | from pymedphys._dev import docs, propagate, tests
def dev_cli(subparsers):
dev_parser = subparsers.add_parser("dev")
dev_subparsers = dev_parser.add_subparsers(dest="dev")
add_docs_parser(dev_subparsers)
add_test_parser(dev_subparsers)
add_lint_parser(dev_subparsers)
add_propagate_parser(dev_s... | 28.071429 | 87 | 0.74402 | from pymedphys._dev import docs, propagate, tests
def dev_cli(subparsers):
dev_parser = subparsers.add_parser("dev")
dev_subparsers = dev_parser.add_subparsers(dest="dev")
add_docs_parser(dev_subparsers)
add_test_parser(dev_subparsers)
add_lint_parser(dev_subparsers)
add_propagate_parser(dev_s... | true | true |
f74713ca198f5fbdfd91697317946d09507ab4b6 | 1,186 | py | Python | android/dynamicuniformbuffer/build.py | MNannig/Vulkan-Examples | 9d76cea05fadf3a6eefae3094c500f84020f706b | [
"MIT"
] | 2 | 2019-08-06T04:33:35.000Z | 2019-10-06T20:03:58.000Z | android/dynamicuniformbuffer/build.py | LiangYue1981816/GraphicsSamples-Vulkan | d15daabc582d4f8b198fdd6ec5651ec4298182a1 | [
"MIT"
] | null | null | null | android/dynamicuniformbuffer/build.py | LiangYue1981816/GraphicsSamples-Vulkan | d15daabc582d4f8b198fdd6ec5651ec4298182a1 | [
"MIT"
] | 1 | 2022-03-23T20:26:33.000Z | 2022-03-23T20:26:33.000Z | import os
import shutil
import subprocess
import sys
import glob
APK_NAME = "vulkanDynamicuniformbuffer"
SHADER_DIR = "dynamicuniformbuffer"
if subprocess.call("ndk-build", shell=True) == 0:
print("Build successful")
os.makedirs("./assets/shaders/base", exist_ok=True)
os.makedirs("./assets/shaders/%s"... | 33.885714 | 88 | 0.610455 | import os
import shutil
import subprocess
import sys
import glob
APK_NAME = "vulkanDynamicuniformbuffer"
SHADER_DIR = "dynamicuniformbuffer"
if subprocess.call("ndk-build", shell=True) == 0:
print("Build successful")
os.makedirs("./assets/shaders/base", exist_ok=True)
os.makedirs("./assets/shaders/%s"... | true | true |
f74713d046f0f74301aae8b800d900e161551d5f | 2,936 | py | Python | python/orp/orp/content_enrichment/test/test_deontic_language.py | UKGovernmentBEIS/open-regulation-platform-alpha | c1170fc7d9563cbdeda094df87c606ad622bfcf2 | [
"MIT"
] | null | null | null | python/orp/orp/content_enrichment/test/test_deontic_language.py | UKGovernmentBEIS/open-regulation-platform-alpha | c1170fc7d9563cbdeda094df87c606ad622bfcf2 | [
"MIT"
] | null | null | null | python/orp/orp/content_enrichment/test/test_deontic_language.py | UKGovernmentBEIS/open-regulation-platform-alpha | c1170fc7d9563cbdeda094df87c606ad622bfcf2 | [
"MIT"
] | null | null | null |
#
# Copyright (C) Analytics Engines 2021
# Lauren Stephens (l.stephens@analyticsengines.com)
#
from re import X
import sys
import pytest
import os
sys.path.append('python/orp')
from orp.content_enrichment.deontic_language import *
@pytest.fixture
def xml_doc():
with open('python/orp/orp/content_enrichment/test/... | 45.875 | 265 | 0.637262 |
from re import X
import sys
import pytest
import os
sys.path.append('python/orp')
from orp.content_enrichment.deontic_language import *
@pytest.fixture
def xml_doc():
with open('python/orp/orp/content_enrichment/test/data/test_akomaNtoso.xml','r') as f:
xml_doc = f.read()
return xml_doc
def te... | true | true |
f74714c1eece3a59a437c3b02cf361f5a6d2eb86 | 1,766 | py | Python | ticketflix/taskapp/celery.py | DSW-2018-2/Arquitetura-Desenho-2018-2 | d417895904c1a12ba2a9d761d7e60be77b7bcac2 | [
"MIT"
] | 3 | 2018-12-12T09:56:36.000Z | 2021-11-24T00:03:07.000Z | ticketflix/taskapp/celery.py | DSW-2018-2/Ticketflix | d417895904c1a12ba2a9d761d7e60be77b7bcac2 | [
"MIT"
] | 20 | 2018-08-23T11:31:11.000Z | 2018-11-22T20:44:09.000Z | ticketflix/taskapp/celery.py | DSW-2018-2/Arquitetura-Desenho-2018-2 | d417895904c1a12ba2a9d761d7e60be77b7bcac2 | [
"MIT"
] | 2 | 2018-12-14T09:11:05.000Z | 2020-08-06T22:45:12.000Z |
import os
from celery import Celery
from django.apps import apps, AppConfig
from django.conf import settings
if not settings.configured:
# set the default Django settings module for the 'celery' program.
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'config.settings.local') # pragma: no cover
app = Cele... | 36.040816 | 99 | 0.697055 |
import os
from celery import Celery
from django.apps import apps, AppConfig
from django.conf import settings
if not settings.configured:
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'config.settings.local')
app = Celery('ticketflix')
class CeleryAppConfig(AppConfig):
name = 'ticketflix.taskapp'... | true | true |
f747157d1477c6575daad71673afa8f4d1c93b12 | 503 | py | Python | velarium/color.py | holthe/velarium | c16f608f1f99b1fab6b3556b2da414ea41777f80 | [
"MIT"
] | 2 | 2018-04-07T21:38:24.000Z | 2020-01-22T19:14:01.000Z | velarium/color.py | holthe/velarium | c16f608f1f99b1fab6b3556b2da414ea41777f80 | [
"MIT"
] | null | null | null | velarium/color.py | holthe/velarium | c16f608f1f99b1fab6b3556b2da414ea41777f80 | [
"MIT"
] | null | null | null | class Color(object):
"""Class used for colouring terminal output."""
def __init__(self):
pass
PURPLE = '\033[95m'
CYAN = '\033[96m'
DARK_CYAN = '\033[36m'
BLUE = '\033[94m'
GREEN = '\033[92m'
YELLOW = '\033[93m'
RED = '\033[91m'
BOLD = '\033[1m'
UNDERLINE = '\033[4m... | 22.863636 | 60 | 0.544732 | class Color(object):
def __init__(self):
pass
PURPLE = '\033[95m'
CYAN = '\033[96m'
DARK_CYAN = '\033[36m'
BLUE = '\033[94m'
GREEN = '\033[92m'
YELLOW = '\033[93m'
RED = '\033[91m'
BOLD = '\033[1m'
UNDERLINE = '\033[4m'
END = '\033[0m'
@classmethod
def bold... | true | true |
f74715a7429c33b4923912c245fb8fbb9d35f168 | 3,655 | py | Python | test/geocoders/util.py | deliveryhero/geopy | 552c699dd8f65394b794275883866be1fd19c22a | [
"MIT"
] | null | null | null | test/geocoders/util.py | deliveryhero/geopy | 552c699dd8f65394b794275883866be1fd19c22a | [
"MIT"
] | null | null | null | test/geocoders/util.py | deliveryhero/geopy | 552c699dd8f65394b794275883866be1fd19c22a | [
"MIT"
] | null | null | null |
import os
import json
import unittest
from collections import defaultdict
from geopy.compat import string_compare, py3k
from geopy import exc
try:
env = defaultdict(lambda: None)
with open(".test_keys") as fp:
env.update(json.loads(fp.read()))
except IOError:
keys = (
'ARCGIS_USERNAME',
... | 27.689394 | 74 | 0.567168 |
import os
import json
import unittest
from collections import defaultdict
from geopy.compat import string_compare, py3k
from geopy import exc
try:
env = defaultdict(lambda: None)
with open(".test_keys") as fp:
env.update(json.loads(fp.read()))
except IOError:
keys = (
'ARCGIS_USERNAME',
... | true | true |
f74715a7857b10b5e63996aa67c5ad61f0cd2e4b | 40,300 | py | Python | pipeline/plot/unit_characteristic_plot.py | hanhou/map-ephys | f0c3b198e113a9caf40cf0e4d249f9ae6afb1555 | [
"MIT"
] | 7 | 2017-11-21T02:32:44.000Z | 2020-09-18T15:05:12.000Z | pipeline/plot/unit_characteristic_plot.py | mesoscale-activity-map/map-ephys | 4262e1ba68671b342a77f386e4ebabcce138c453 | [
"MIT"
] | 41 | 2017-11-28T05:04:14.000Z | 2022-03-03T17:51:58.000Z | pipeline/plot/unit_characteristic_plot.py | mesoscale-activity-map/map-ephys | 4262e1ba68671b342a77f386e4ebabcce138c453 | [
"MIT"
] | 15 | 2017-11-16T21:32:29.000Z | 2020-11-10T01:46:14.000Z | import numpy as np
import datajoint as dj
from PIL import ImageColor
from collections import Counter
import matplotlib as mpl
import matplotlib.pyplot as plt
import seaborn as sns
import itertools
import pandas as pd
from pipeline import experiment, ephys, psth, lab, histology, ccf, psth_foraging
from pipeline.plot.... | 42.331933 | 125 | 0.622382 | import numpy as np
import datajoint as dj
from PIL import ImageColor
from collections import Counter
import matplotlib as mpl
import matplotlib.pyplot as plt
import seaborn as sns
import itertools
import pandas as pd
from pipeline import experiment, ephys, psth, lab, histology, ccf, psth_foraging
from pipeline.plot.... | true | true |
f74716242b266964d6c5a8b8dde611fda7ca67b4 | 9,475 | py | Python | jumpcutter.py | Azarattum/Jumpcutter | f8439776689c7baecfc68516b2ef3afe743284db | [
"MIT"
] | 1 | 2019-07-10T08:06:44.000Z | 2019-07-10T08:06:44.000Z | jumpcutter.py | Azarattum/Jumpcutter | f8439776689c7baecfc68516b2ef3afe743284db | [
"MIT"
] | null | null | null | jumpcutter.py | Azarattum/Jumpcutter | f8439776689c7baecfc68516b2ef3afe743284db | [
"MIT"
] | null | null | null | from contextlib import closing
from PIL import Image
import subprocess
from audiotsm import phasevocoder
from audiotsm.io.wav import WavReader, WavWriter
from scipy.io import wavfile
import numpy as np
import re
import math
from shutil import copyfile, rmtree
import os
import argparse
from pytube import YouTube
def do... | 38.51626 | 234 | 0.707546 | from contextlib import closing
from PIL import Image
import subprocess
from audiotsm import phasevocoder
from audiotsm.io.wav import WavReader, WavWriter
from scipy.io import wavfile
import numpy as np
import re
import math
from shutil import copyfile, rmtree
import os
import argparse
from pytube import YouTube
def do... | true | true |
f74718efa836cfa9756e36ca6be0819658ed7db6 | 10,286 | py | Python | tensorforce/core/memories/queue.py | zysilence/tensorforce | 7539e5dde66f3a93b881006f9b7f38c926ced21b | [
"Apache-2.0"
] | 2 | 2021-11-14T12:28:24.000Z | 2022-02-14T19:23:51.000Z | tensorforce/core/memories/queue.py | zysilence/tensorforce | 7539e5dde66f3a93b881006f9b7f38c926ced21b | [
"Apache-2.0"
] | null | null | null | tensorforce/core/memories/queue.py | zysilence/tensorforce | 7539e5dde66f3a93b881006f9b7f38c926ced21b | [
"Apache-2.0"
] | 3 | 2021-03-04T17:26:43.000Z | 2021-03-04T17:27:10.000Z | # Copyright 2017 reinforce.io. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | 37.816176 | 118 | 0.594497 |
from __future__ import absolute_import
from __future__ import print_function
from __future__ import division
import tensorflow as tf
from tensorforce import util
from tensorforce.core.memories import Memory
class Queue(Memory):
def __init__(self, states, internals, actions, include_next_states, ... | true | true |
f7471a7b5f92a8e21d2df3783b77501c195c1410 | 2,108 | py | Python | .history/postImages/index_20201008165803.py | Lambda-School-Labs/Labs27-C-Bridges-To-Prosperity-BE | 9a8289d8550115362c46dea3ed8570b789c09a10 | [
"MIT"
] | 2 | 2020-10-21T22:14:15.000Z | 2020-10-21T22:14:16.000Z | .history/postImages/index_20201008165803.py | Lambda-School-Labs/Labs27-C-Bridges-To-Prosperity-BE | 9a8289d8550115362c46dea3ed8570b789c09a10 | [
"MIT"
] | null | null | null | .history/postImages/index_20201008165803.py | Lambda-School-Labs/Labs27-C-Bridges-To-Prosperity-BE | 9a8289d8550115362c46dea3ed8570b789c09a10 | [
"MIT"
] | null | null | null | import csv
import json
df = open("bridgeData3.csv",'r').readlines()
fin = open('final.csv','r').readlines()
# Skips the header of the csv
finCsv = fin[1:]
finalCsv = df[1:]
obj = {}
# loop through the csv with images
for i in finalCsv:
x = i.split(',')
obj[x[1]] = {'bridge_name':x[0],'proj_code':x[1],'before_i... | 29.277778 | 94 | 0.519924 | import csv
import json
df = open("bridgeData3.csv",'r').readlines()
fin = open('final.csv','r').readlines()
finCsv = fin[1:]
finalCsv = df[1:]
obj = {}
for i in finalCsv:
x = i.split(',')
obj[x[1]] = {'bridge_name':x[0],'proj_code':x[1],'before_img':x[2],'after_img':x[3][0:-1]}
finalObj = {}
for i in finCs... | true | true |
f7471b1aefbaf3b3b6de3b420d406d40e6994f59 | 443 | py | Python | selfdrive/debug/internal/mock_process/fake_liveMpc.py | wocsor-com/openpilot | d1372c4890fd45d785789d94d5ed39bc9c8b80b7 | [
"MIT"
] | 14 | 2019-05-20T13:20:12.000Z | 2020-10-10T07:55:20.000Z | selfdrive/debug/internal/mock_process/fake_liveMpc.py | wocsor-com/openpilot | d1372c4890fd45d785789d94d5ed39bc9c8b80b7 | [
"MIT"
] | 4 | 2020-04-12T21:34:03.000Z | 2020-04-15T22:22:15.000Z | selfdrive/debug/internal/mock_process/fake_liveMpc.py | wocsor-com/openpilot | d1372c4890fd45d785789d94d5ed39bc9c8b80b7 | [
"MIT"
] | 3 | 2019-03-06T20:58:50.000Z | 2019-05-21T01:01:37.000Z | #!/usr/bin/env python3
import zmq
import time
from hexdump import hexdump
import cereal.messaging as messaging
from cereal.services import service_list
from cereal import log
def mock_x():
liveMpc = messaging.pub_sock('liveMpc')
while 1:
m = messaging.new_message('liveMpc')
mx = []
for x in range(0, 10... | 20.136364 | 41 | 0.683973 |
import zmq
import time
from hexdump import hexdump
import cereal.messaging as messaging
from cereal.services import service_list
from cereal import log
def mock_x():
liveMpc = messaging.pub_sock('liveMpc')
while 1:
m = messaging.new_message('liveMpc')
mx = []
for x in range(0, 100):
mx.append(... | true | true |
f7471b6efca2868ad1b3290ccfc22121afc28c5f | 1,116 | py | Python | tooth.py | jposchel/trusty-brusher-python | 1ba4c70401f92afb767a0b7d2c213cce8760089e | [
"MIT"
] | null | null | null | tooth.py | jposchel/trusty-brusher-python | 1ba4c70401f92afb767a0b7d2c213cce8760089e | [
"MIT"
] | null | null | null | tooth.py | jposchel/trusty-brusher-python | 1ba4c70401f92afb767a0b7d2c213cce8760089e | [
"MIT"
] | null | null | null | #!/usr/bin/env python
"""Tooth.py: Public Tooth class representing tooth entities in the educational game Trusty Brusher."""
class Tooth:
"""
A Tooth in the Mouth of a Person.
self.location: int value indicating location of Tooth in the Mouth
self.has_cavity: bool value indicating whether or ... | 29.368421 | 102 | 0.702509 |
class Tooth:
def __init__(self, init_location, init_cavity_status, init_germ_count):
self.location = init_location
self.has_cavity = init_cavity_status
self.germ_count = init_germ_count
def get_location(self):
return self.location
def set_location(self, new_location... | true | true |
f7471c08736090265b66592b4a1cf8e331d53e66 | 193 | py | Python | decaptcha/__init__.py | youngershen/django-easy-captcha | bfcd13bbafface7048139e0bc49358e6628439df | [
"MIT"
] | 3 | 2019-03-02T03:48:35.000Z | 2021-11-09T11:06:25.000Z | decaptcha/__init__.py | youngershen/django-easy-captcha | bfcd13bbafface7048139e0bc49358e6628439df | [
"MIT"
] | null | null | null | decaptcha/__init__.py | youngershen/django-easy-captcha | bfcd13bbafface7048139e0bc49358e6628439df | [
"MIT"
] | null | null | null | # PROJECT : django-easy-captcha
# TIME : 2018/11/18 11:00
# AUTHOR : Younger Shen
# EMAIL : younger.x.shen@gmail.com
# CELL : 13811754531
# WECHAT : 13811754531
# WEB : https://youngershen.com
| 24.125 | 34 | 0.704663 | true | true | |
f7471cfddb8ec086d8c1599f5b661789ef071cf7 | 12,789 | py | Python | tensorflow_probability/python/distributions/zipf.py | nagachika/probability | 2a5609ceec01a388ec03b583b4f8e813cfbad981 | [
"Apache-2.0"
] | 1 | 2020-07-12T22:40:42.000Z | 2020-07-12T22:40:42.000Z | tensorflow_probability/python/distributions/zipf.py | nagachika/probability | 2a5609ceec01a388ec03b583b4f8e813cfbad981 | [
"Apache-2.0"
] | 2 | 2019-08-01T18:31:41.000Z | 2019-08-01T19:42:15.000Z | tensorflow_probability/python/distributions/zipf.py | nagachika/probability | 2a5609ceec01a388ec03b583b4f8e813cfbad981 | [
"Apache-2.0"
] | 1 | 2020-04-17T18:01:47.000Z | 2020-04-17T18:01:47.000Z | # Copyright 2018 The TensorFlow Probability 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 o... | 38.87234 | 81 | 0.659708 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import numpy as np
import tensorflow.compat.v2 as tf
from tensorflow_probability.python.distributions import distribution
from tensorflow_probability.python.distributions.seed_stream import Seed... | true | true |
f7471d139ca421eceea4cbe3b2c63d5e565d6dd8 | 19,235 | py | Python | stumpy/gpu_aamp.py | profintegra/stumpy | 66b3402d91820005b466e1da6fe353b61e6246c5 | [
"BSD-3-Clause"
] | 1 | 2021-07-27T11:14:01.000Z | 2021-07-27T11:14:01.000Z | stumpy/gpu_aamp.py | profintegra/stumpy | 66b3402d91820005b466e1da6fe353b61e6246c5 | [
"BSD-3-Clause"
] | null | null | null | stumpy/gpu_aamp.py | profintegra/stumpy | 66b3402d91820005b466e1da6fe353b61e6246c5 | [
"BSD-3-Clause"
] | null | null | null | # STUMPY
# Copyright 2019 TD Ameritrade. Released under the terms of the 3-Clause BSD license.
# STUMPY is a trademark of TD Ameritrade IP Company, Inc. All rights reserved.
import logging
import math
import multiprocessing as mp
import os
import numpy as np
from numba import cuda
from . import core, config
logger =... | 32.936644 | 88 | 0.621679 |
import logging
import math
import multiprocessing as mp
import os
import numpy as np
from numba import cuda
from . import core, config
logger = logging.getLogger(__name__)
@cuda.jit(
"(i8, f8[:], f8[:], i8, f8[:], f8[:], f8[:], b1[:], b1[:],"
"f8[:], f8[:], i8, b1, i8, f8[:, :], i8[:, :], b1)"
)
def _co... | true | true |
f7471d6b3b950b18a173e693b62b2283a3f2eeff | 118 | py | Python | boa3_test/test_sc/interop_test/policy/ImportInteropPolicy.py | hal0x2328/neo3-boa | 6825a3533384cb01660773050719402a9703065b | [
"Apache-2.0"
] | 25 | 2020-07-22T19:37:43.000Z | 2022-03-08T03:23:55.000Z | boa3_test/test_sc/interop_test/policy/ImportInteropPolicy.py | hal0x2328/neo3-boa | 6825a3533384cb01660773050719402a9703065b | [
"Apache-2.0"
] | 419 | 2020-04-23T17:48:14.000Z | 2022-03-31T13:17:45.000Z | boa3_test/test_sc/interop_test/policy/ImportInteropPolicy.py | hal0x2328/neo3-boa | 6825a3533384cb01660773050719402a9703065b | [
"Apache-2.0"
] | 15 | 2020-05-21T21:54:24.000Z | 2021-11-18T06:17:24.000Z | from boa3.builtin import interop, public
@public
def main() -> int:
return interop.policy.get_exec_fee_factor()
| 16.857143 | 47 | 0.745763 | from boa3.builtin import interop, public
@public
def main() -> int:
return interop.policy.get_exec_fee_factor()
| true | true |
f7471e682195f05bb93b896af0758f44a24a232e | 5,934 | py | Python | experiments/20200324-lod-study-1/station-C-qpcr-map.py | emilyjunkins/covid19 | ab57fa9e9d601eef25a12847ca868d86a4799ca2 | [
"Apache-2.0"
] | 11 | 2020-03-30T07:20:15.000Z | 2022-03-20T08:41:35.000Z | experiments/20200324-lod-study-1/station-C-qpcr-map.py | emilyjunkins/covid19 | ab57fa9e9d601eef25a12847ca868d86a4799ca2 | [
"Apache-2.0"
] | 4 | 2020-03-31T19:36:37.000Z | 2020-05-13T14:06:27.000Z | experiments/20200324-lod-study-1/station-C-qpcr-map.py | emilyjunkins/covid19 | ab57fa9e9d601eef25a12847ca868d86a4799ca2 | [
"Apache-2.0"
] | 7 | 2020-04-07T12:20:25.000Z | 2021-12-04T02:32:43.000Z | metadata = {
'protocolName': 'BP Genomics Station C: 20200324 LOD Study 1',
'author': 'Chaz <chaz@opentrons.com; Anton <acjs@stanford.edu>',
'source': 'COVID-19 Project',
'apiLevel': '2.2'
}
# Protocol constants
# Master mix locations on the eppendorf tube holder
REAGENT_LOCATIONS = {
'Endogenous'... | 39.039474 | 107 | 0.681159 | metadata = {
'protocolName': 'BP Genomics Station C: 20200324 LOD Study 1',
'author': 'Chaz <chaz@opentrons.com; Anton <acjs@stanford.edu>',
'source': 'COVID-19 Project',
'apiLevel': '2.2'
}
REAGENT_LOCATIONS = {
'Endogenous': 'A1',
'Reaction': 'A2',
'Standard': 'A3',
'Water': 'A4',
... | true | true |
f7471fc46882626596f22ece7bc56b0a73fdbe0f | 444 | py | Python | instagram/migrations/0002_user_last_login.py | adrianmurage/instagram-clone | 370f9fce104337dfd1cda392296048fd7b5f5c86 | [
"MIT"
] | 1 | 2020-01-28T17:08:54.000Z | 2020-01-28T17:08:54.000Z | instagram/migrations/0002_user_last_login.py | MainaMurage/instagram-clone | 370f9fce104337dfd1cda392296048fd7b5f5c86 | [
"MIT"
] | 2 | 2021-06-08T19:55:44.000Z | 2021-06-10T21:29:11.000Z | instagram/migrations/0002_user_last_login.py | MainaMurage/instagram-clone | 370f9fce104337dfd1cda392296048fd7b5f5c86 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by Django 1.11 on 2019-05-22 07:13
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('instagram', '0001_initial'),
]
operations = [
migrations.AddField(
... | 21.142857 | 54 | 0.612613 |
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('instagram', '0001_initial'),
]
operations = [
migrations.AddField(
model_name='user',
name='last_login',
field... | true | true |
f7472067d8665f851495b76a0245b0a9f95cad9e | 18,819 | py | Python | log_complete/model_437.py | LoLab-VU/Bayesian_Inference_of_Network_Dynamics | 54a5ef7e868be34289836bbbb024a2963c0c9c86 | [
"MIT"
] | null | null | null | log_complete/model_437.py | LoLab-VU/Bayesian_Inference_of_Network_Dynamics | 54a5ef7e868be34289836bbbb024a2963c0c9c86 | [
"MIT"
] | null | null | null | log_complete/model_437.py | LoLab-VU/Bayesian_Inference_of_Network_Dynamics | 54a5ef7e868be34289836bbbb024a2963c0c9c86 | [
"MIT"
] | null | null | null | # exported from PySB model 'model'
from pysb import Model, Monomer, Parameter, Expression, Compartment, Rule, Observable, Initial, MatchOnce, Annotation, ANY, WILD
Model()
Monomer('Ligand', ['Receptor'])
Monomer('ParpU', ['C3A'])
Monomer('C8A', ['BidU', 'C3pro'])
Monomer('SmacM', ['BaxA'])
Monomer('BaxM', ['BidM', '... | 91.354369 | 710 | 0.806525 |
from pysb import Model, Monomer, Parameter, Expression, Compartment, Rule, Observable, Initial, MatchOnce, Annotation, ANY, WILD
Model()
Monomer('Ligand', ['Receptor'])
Monomer('ParpU', ['C3A'])
Monomer('C8A', ['BidU', 'C3pro'])
Monomer('SmacM', ['BaxA'])
Monomer('BaxM', ['BidM', 'BaxA'])
Monomer('Apop', ['C3pro', ... | true | true |
f74721146713bf1f3d422620d5d94275d283df1f | 1,044 | py | Python | src/genui/utils/exceptions.py | Tontolda/genui | c5b7da7c5a99fc16d34878e2170145ac7c8e31c4 | [
"0BSD"
] | 15 | 2021-05-31T13:39:17.000Z | 2022-03-30T12:04:14.000Z | src/genui/utils/exceptions.py | martin-sicho/genui | ea7f1272030a13e8e253a7a9b6479ac6a78552d3 | [
"MIT"
] | 3 | 2021-04-08T22:02:22.000Z | 2022-03-16T09:10:20.000Z | src/genui/utils/exceptions.py | Tontolda/genui | c5b7da7c5a99fc16d34878e2170145ac7c8e31c4 | [
"0BSD"
] | 5 | 2021-03-04T11:00:54.000Z | 2021-12-18T22:59:22.000Z | """
exceptions
Created by: Martin Sicho
On: 7/23/20, 10:08 AM
"""
import json
import traceback
class GenUIException(Exception):
def __init__(self, original, *args, **kwargs):
super().__init__(*args)
self.original = original
def getData(self):
return ''
def __repr__(self):
... | 26.1 | 113 | 0.554598 | import json
import traceback
class GenUIException(Exception):
def __init__(self, original, *args, **kwargs):
super().__init__(*args)
self.original = original
def getData(self):
return ''
def __repr__(self):
return self.asJSON()
def asJSON(self):
return json.... | true | true |
f74721699c4c403658383b1e86c9e9cd9264a5a1 | 1,322 | py | Python | ch09_cnn/cifar_tools.py | susantamoh84/TensorFlow-Book | 905bd82e6e58c373b566f4813859c5dfc1fa1aa4 | [
"MIT"
] | 18 | 2017-02-18T09:22:42.000Z | 2021-08-29T15:44:58.000Z | ch09_cnn/cifar_tools.py | susantamoh84/TensorFlow-Book | 905bd82e6e58c373b566f4813859c5dfc1fa1aa4 | [
"MIT"
] | null | null | null | ch09_cnn/cifar_tools.py | susantamoh84/TensorFlow-Book | 905bd82e6e58c373b566f4813859c5dfc1fa1aa4 | [
"MIT"
] | 29 | 2016-12-19T12:01:41.000Z | 2020-07-05T16:55:56.000Z | import cPickle
import numpy as np
def unpickle(file):
fo = open(file, 'rb')
dict = cPickle.load(fo)
fo.close()
return dict
def clean(data):
imgs = data.reshape(data.shape[0], 3, 32, 32)
grayscale_imgs = imgs.mean(1)
cropped_imgs = grayscale_imgs[:, 4:28, 4:28]
img_data = cropped_imgs... | 28.12766 | 72 | 0.610439 | import cPickle
import numpy as np
def unpickle(file):
fo = open(file, 'rb')
dict = cPickle.load(fo)
fo.close()
return dict
def clean(data):
imgs = data.reshape(data.shape[0], 3, 32, 32)
grayscale_imgs = imgs.mean(1)
cropped_imgs = grayscale_imgs[:, 4:28, 4:28]
img_data = cropped_imgs... | true | true |
f74721fae1a89de30d271e1758736eceb0444307 | 2,943 | py | Python | tests/unit/modules/publish_test.py | preoctopus/salt | aceaaa0e2f2f2ff29a694393bd82bba0d88fa44d | [
"Apache-2.0"
] | 3 | 2015-04-16T18:42:35.000Z | 2017-10-30T16:57:49.000Z | tests/unit/modules/publish_test.py | preoctopus/salt | aceaaa0e2f2f2ff29a694393bd82bba0d88fa44d | [
"Apache-2.0"
] | 16 | 2015-11-18T00:44:03.000Z | 2018-10-29T20:48:27.000Z | tests/unit/modules/publish_test.py | preoctopus/salt | aceaaa0e2f2f2ff29a694393bd82bba0d88fa44d | [
"Apache-2.0"
] | 2 | 2017-01-05T16:14:59.000Z | 2019-01-31T23:15:25.000Z | # -*- coding: utf-8 -*-
'''
:codeauthor: :email:`Jayesh Kariya <jayeshk@saltstack.com>`
'''
# Import Python Libs
from __future__ import absolute_import
# Import Salt Testing Libs
from salttesting import TestCase, skipIf
from salttesting.mock import (
MagicMock,
patch,
NO_MOCK,
NO_MOCK_REASON
)
fr... | 23.733871 | 78 | 0.599728 |
from __future__ import absolute_import
from salttesting import TestCase, skipIf
from salttesting.mock import (
MagicMock,
patch,
NO_MOCK,
NO_MOCK_REASON
)
from salttesting.helpers import ensure_in_syspath
ensure_in_syspath('../../')
from salt.modules import publish
import salt.crypt
import salt... | true | true |
f74722dded4b701ea739cfeabcf1fc83a44f0203 | 9,770 | py | Python | mdrsl/rule_generation/association_rule_mining/apyori_impl/mine_mt_rules_from_dataframe_with_apyori.py | joschout/Multi-Directional-Rule-Set-Learning | ef0620b115f4e0fd7fba3e752d238a8020c1ca6b | [
"Apache-2.0"
] | 3 | 2020-08-03T19:25:44.000Z | 2021-06-27T22:25:55.000Z | mdrsl/rule_generation/association_rule_mining/apyori_impl/mine_mt_rules_from_dataframe_with_apyori.py | joschout/Multi-Directional-Rule-Set-Learning | ef0620b115f4e0fd7fba3e752d238a8020c1ca6b | [
"Apache-2.0"
] | null | null | null | mdrsl/rule_generation/association_rule_mining/apyori_impl/mine_mt_rules_from_dataframe_with_apyori.py | joschout/Multi-Directional-Rule-Set-Learning | ef0620b115f4e0fd7fba3e752d238a8020c1ca6b | [
"Apache-2.0"
] | 2 | 2020-08-07T22:54:28.000Z | 2021-02-18T06:11:01.000Z | import random
import numpy as np
from typing import List, Optional, Dict
import pandas as pd
import time
from mdrsl.rule_generation.association_rule_mining.apyori_impl.mine_mt_rules_from_transactions_with_apyori import (
mine_MCARs_from_transactions_using_apyori)
from mdrsl.rule_generation.association_rule_mining... | 37.722008 | 138 | 0.621085 | import random
import numpy as np
from typing import List, Optional, Dict
import pandas as pd
import time
from mdrsl.rule_generation.association_rule_mining.apyori_impl.mine_mt_rules_from_transactions_with_apyori import (
mine_MCARs_from_transactions_using_apyori)
from mdrsl.rule_generation.association_rule_mining... | true | true |
f747232d507ac2546560667d6f1a6d03447631b0 | 1,850 | py | Python | NLP/LSTM RNN/WSDM - Fake News Classification/Berd generate embeddings/3_bert_encode_ch_test.py | ashishpatel26/ML-DL-scripts | 25f930630f6e546955ad13863d6e728c8c702d43 | [
"Apache-2.0"
] | 2 | 2020-07-17T10:33:42.000Z | 2021-11-08T09:31:27.000Z | NLP/LSTM RNN/WSDM - Fake News Classification/Berd generate embeddings/3_bert_encode_ch_test.py | ashishpatel26/ML-DL-scripts | 25f930630f6e546955ad13863d6e728c8c702d43 | [
"Apache-2.0"
] | null | null | null | NLP/LSTM RNN/WSDM - Fake News Classification/Berd generate embeddings/3_bert_encode_ch_test.py | ashishpatel26/ML-DL-scripts | 25f930630f6e546955ad13863d6e728c8c702d43 | [
"Apache-2.0"
] | 1 | 2020-10-15T11:24:52.000Z | 2020-10-15T11:24:52.000Z | # Please run bert-serving-start before running this notebook
# Setup: https://github.com/hanxiao/bert-as-service
# Examples (change folders to your locals)
# english cased: bert-serving-start -model_dir /bert-as-service/cased_L-24_H-1024_A-16/ -num_worker=4
# multi cased: bert-serving-start -model_dir /bert-as-service/... | 42.045455 | 136 | 0.714054 |
import pandas as pd
import torch
import os
from time import time
from tqdm import tqdm
from bert_serving.client import BertClient
data_folder = os.path.dirname(os.getcwd())+'/data'
test = pd.read_csv(data_folder+'/raw/test.csv')
bc = BertClient()
def gen_encodings(df, column):
t0 = time()
_list = ... | true | true |
f747246cc7b374f413d64c8392d1debce51180be | 317 | py | Python | implementation/spcTornadoCounts.py | sburgholzer/MSDS-Capstone-Project | 4f22149c7ebff5c3dc129bb785d56f161ab138a8 | [
"MIT"
] | null | null | null | implementation/spcTornadoCounts.py | sburgholzer/MSDS-Capstone-Project | 4f22149c7ebff5c3dc129bb785d56f161ab138a8 | [
"MIT"
] | null | null | null | implementation/spcTornadoCounts.py | sburgholzer/MSDS-Capstone-Project | 4f22149c7ebff5c3dc129bb785d56f161ab138a8 | [
"MIT"
] | null | null | null | import pandas as pd
df = pd.read_csv('/mnt/data3/scott/1950-2018_actual_tornadoes.csv')
df['date'] = pd.to_datetime(df['date'])
mask = (df['date'] >= '1979-1-1') & (df['date'] <= '2013-12-31')
df = df.loc[mask]
df.groupby('date').size()
df.groupby('date').size().to_csv('/mnt/data3/scott/tornadoCounts.csv') | 35.222222 | 70 | 0.643533 | import pandas as pd
df = pd.read_csv('/mnt/data3/scott/1950-2018_actual_tornadoes.csv')
df['date'] = pd.to_datetime(df['date'])
mask = (df['date'] >= '1979-1-1') & (df['date'] <= '2013-12-31')
df = df.loc[mask]
df.groupby('date').size()
df.groupby('date').size().to_csv('/mnt/data3/scott/tornadoCounts.csv') | true | true |
f747251d43b780ad696ef02d9349531217718609 | 4,237 | py | Python | examples/text_classification/rnn/predict.py | tangzhiyi11/PaddleNLP | c58a1c6c90e146178276cccb122fae8fdafa0143 | [
"Apache-2.0"
] | 2 | 2021-06-19T07:27:10.000Z | 2021-06-23T06:22:57.000Z | examples/text_classification/rnn/predict.py | xiemoyuan/PaddleNLP | e73a02d09dbc249dcd3aa721c507a81cc905210c | [
"Apache-2.0"
] | 1 | 2021-11-22T08:11:08.000Z | 2021-11-22T08:11:08.000Z | examples/text_classification/rnn/predict.py | xiemoyuan/PaddleNLP | e73a02d09dbc249dcd3aa721c507a81cc905210c | [
"Apache-2.0"
] | 1 | 2021-04-28T09:01:37.000Z | 2021-04-28T09:01:37.000Z | # Copyright (c) 2020 PaddlePaddle 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... | 38.87156 | 138 | 0.680906 |
import argparse
import paddle
import paddle.nn.functional as F
import paddlenlp as ppnlp
from paddlenlp.data import JiebaTokenizer, Stack, Tuple, Pad, Vocab
from utils import preprocess_prediction_data
parser = argparse.ArgumentParser(__doc__)
parser.add_argument('--device', choices=['cpu', 'gpu', 'xpu... | true | true |
f747258ba52e4861a7e9694ddb35effeb51d531c | 1,546 | py | Python | app/auth/views.py | Kihara-tony/one-minute-pitch | 48a090c46e03257aa8ffacb89767f40b6856c18f | [
"Unlicense"
] | null | null | null | app/auth/views.py | Kihara-tony/one-minute-pitch | 48a090c46e03257aa8ffacb89767f40b6856c18f | [
"Unlicense"
] | null | null | null | app/auth/views.py | Kihara-tony/one-minute-pitch | 48a090c46e03257aa8ffacb89767f40b6856c18f | [
"Unlicense"
] | 1 | 2019-09-23T11:00:22.000Z | 2019-09-23T11:00:22.000Z | from flask import render_template,redirect,url_for, flash,request
from flask_login import login_user,logout_user,login_required
from . import auth
from ..models import User
from .forms import LoginForm,RegistrationForm
from .. import db
from ..email import mail_message
@auth.route('/login',methods=['GET','POST'])
def ... | 38.65 | 165 | 0.711514 | from flask import render_template,redirect,url_for, flash,request
from flask_login import login_user,logout_user,login_required
from . import auth
from ..models import User
from .forms import LoginForm,RegistrationForm
from .. import db
from ..email import mail_message
@auth.route('/login',methods=['GET','POST'])
def ... | true | true |
f74726314a347037852df136101879ca9471d7c8 | 7,676 | py | Python | src/datahub/disclosure/models.py | project-origin/datahub-service | 0c3f27ee4fa0381ce3147f1fffef1108f13dc2c2 | [
"MIT"
] | 1 | 2021-04-23T08:19:49.000Z | 2021-04-23T08:19:49.000Z | src/datahub/disclosure/models.py | project-origin/datahub-service | 0c3f27ee4fa0381ce3147f1fffef1108f13dc2c2 | [
"MIT"
] | 1 | 2021-02-10T02:28:52.000Z | 2021-02-10T02:28:52.000Z | src/datahub/disclosure/models.py | project-origin/datahub-service | 0c3f27ee4fa0381ce3147f1fffef1108f13dc2c2 | [
"MIT"
] | null | null | null | import sqlalchemy as sa
from enum import Enum
from sqlalchemy.orm import relationship, backref
from typing import List
from datetime import date
from dataclasses import dataclass, field
from marshmallow import validate
from datahub.db import ModelBase, Session
from datahub.measurements import MeasurementQuery
from dat... | 33.086207 | 138 | 0.689291 | import sqlalchemy as sa
from enum import Enum
from sqlalchemy.orm import relationship, backref
from typing import List
from datetime import date
from dataclasses import dataclass, field
from marshmallow import validate
from datahub.db import ModelBase, Session
from datahub.measurements import MeasurementQuery
from dat... | true | true |
f74726abce95aaa55b2d37394f26b9a051db8b8c | 3,272 | py | Python | tensorflow_datasets/core/__init__.py | harsh020/datasets | b4ad3617b279ec65356e696c4c860458621976f6 | [
"Apache-2.0"
] | 1 | 2020-12-10T06:37:27.000Z | 2020-12-10T06:37:27.000Z | tensorflow_datasets/core/__init__.py | Jinwook-shim/datasets | 815037e87150e3c8a557d91a68b07e8ffb6a2a86 | [
"Apache-2.0"
] | null | null | null | tensorflow_datasets/core/__init__.py | Jinwook-shim/datasets | 815037e87150e3c8a557d91a68b07e8ffb6a2a86 | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# Copyright 2020 The TensorFlow Datasets 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 appl... | 35.565217 | 89 | 0.811736 |
from tensorflow_datasets.core import tf_compat
tf_compat.ensure_tf_install()
from tensorflow_datasets.core import community
from tensorflow_datasets.core.constants import add_data_dir
from tensorflow_datasets.core.dataset_builder import BeamBasedBuilder
from tensorflow_datasets.core.dataset_bui... | true | true |
f74726dba0ca3e3b52dc8e78584e136f0570d52f | 125 | py | Python | Problems/Poetry/main.py | TataSatyaPratheek/Tic-Tac-Toe | fa3da80f9ec9ffa3c8c9aaa34a5bb1e88553fecd | [
"MIT"
] | null | null | null | Problems/Poetry/main.py | TataSatyaPratheek/Tic-Tac-Toe | fa3da80f9ec9ffa3c8c9aaa34a5bb1e88553fecd | [
"MIT"
] | null | null | null | Problems/Poetry/main.py | TataSatyaPratheek/Tic-Tac-Toe | fa3da80f9ec9ffa3c8c9aaa34a5bb1e88553fecd | [
"MIT"
] | null | null | null | print("""
Did that stop the old Grinch?
No! The Grinch simply said,
"If I can't find a reindeer,
I'll make one instead!"
""") | 20.833333 | 29 | 0.688 | print("""
Did that stop the old Grinch?
No! The Grinch simply said,
"If I can't find a reindeer,
I'll make one instead!"
""") | true | true |
f747275eb5c3aecfc0cadd1b024940aa12e99332 | 10,347 | py | Python | code/cloudmanager/sshclient.py | Hybrid-Cloud/cloud_manager | 5f4087ef8753dcb4f542e930b5d8642fe5591c1a | [
"Apache-2.0"
] | null | null | null | code/cloudmanager/sshclient.py | Hybrid-Cloud/cloud_manager | 5f4087ef8753dcb4f542e930b5d8642fe5591c1a | [
"Apache-2.0"
] | 3 | 2016-03-16T03:26:44.000Z | 2016-03-16T03:46:22.000Z | code/cloudmanager/sshclient.py | Hybrid-Cloud/orchard | 5f4087ef8753dcb4f542e930b5d8642fe5591c1a | [
"Apache-2.0"
] | null | null | null | # Copyright 2013: Mirantis Inc.
# 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 b... | 34.956081 | 79 | 0.563255 |
import os
import select
import socket
import time
import paramiko
import six
from heat.openstack.common import log as logging
LOG = logging.getLogger(__name__)
class SSHError(Exception):
pass
class SSHTimeout(SSHError):
pass
class SSH(object):
def __init__(self, user, host, port=22... | true | true |
f7472826977f917a91915213388d4e8d7b157112 | 28,918 | py | Python | src/bgraph/parsers/soong_parser.py | pistach3/bgraph | 186461b3af7e865f17457e85421e995b10a75010 | [
"Apache-2.0"
] | 8 | 2021-06-03T08:13:23.000Z | 2022-03-07T04:28:24.000Z | src/bgraph/parsers/soong_parser.py | pistach3/bgraph | 186461b3af7e865f17457e85421e995b10a75010 | [
"Apache-2.0"
] | 2 | 2021-07-29T09:30:27.000Z | 2021-12-14T09:24:05.000Z | src/bgraph/parsers/soong_parser.py | pistach3/bgraph | 186461b3af7e865f17457e85421e995b10a75010 | [
"Apache-2.0"
] | 3 | 2021-07-28T10:41:07.000Z | 2021-11-14T02:54:45.000Z | import collections
import base64
import copy
import enum
import logging
import os
import pathlib
import xml.sax
import pyparsing # type: ignore
# Improve performance by caching
pyparsing.ParserElement.enablePackrat()
import untangle # type: ignore
import bgraph.exc
import bgraph.utils
from bgraph.types import (
... | 34.632335 | 132 | 0.607615 | import collections
import base64
import copy
import enum
import logging
import os
import pathlib
import xml.sax
import pyparsing
pyparsing.ParserElement.enablePackrat()
import untangle
import bgraph.exc
import bgraph.utils
from bgraph.types import (
Any,
cast,
Dict,
Final,
List,
Literal,... | true | true |
f74728cf26a7d1a0690982df93978d8354109551 | 2,639 | py | Python | cesnet_openid_remote/identity.py | oarepo/cesnet-openid-remote | 4ca46fc94801e51267b7676e0c212a024e3af3a1 | [
"MIT"
] | null | null | null | cesnet_openid_remote/identity.py | oarepo/cesnet-openid-remote | 4ca46fc94801e51267b7676e0c212a024e3af3a1 | [
"MIT"
] | 4 | 2021-02-19T10:53:28.000Z | 2021-04-09T17:15:56.000Z | cesnet_openid_remote/identity.py | oarepo/cesnet-openid-remote | 4ca46fc94801e51267b7676e0c212a024e3af3a1 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
#
# Copyright (C) 2021 CESNET.
#
# CESNET-OpenID-Remote is free software; you can redistribute it and/or
# modify it under the terms of the MIT License; see LICENSE file for more
# details.
"""CESNET OIDC Auth backend for OARepo"""
from datetime import timedelta
from flask import current_app, ... | 36.150685 | 100 | 0.740053 |
from datetime import timedelta
from flask import current_app, session, g
from flask_login import current_user, user_logged_out
from flask_principal import identity_loaded, AnonymousIdentity, identity_changed, RoleNeed, UserNeed
from invenio_oauthclient.models import RemoteAccount
from invenio_oauthclient.utils... | true | true |
f747292e183708e1ca62fdead2a43cddabafdd57 | 414 | py | Python | lib/resource/config.py | hisyamuddin-jamirun/tests | 2a07197ccfa41f99fe73dac82cebe3a0f019615c | [
"Apache-2.0"
] | null | null | null | lib/resource/config.py | hisyamuddin-jamirun/tests | 2a07197ccfa41f99fe73dac82cebe3a0f019615c | [
"Apache-2.0"
] | null | null | null | lib/resource/config.py | hisyamuddin-jamirun/tests | 2a07197ccfa41f99fe73dac82cebe3a0f019615c | [
"Apache-2.0"
] | null | null | null | from configparser import SafeConfigParser
import os
def get_config():
config = SafeConfigParser()
config_filename = "config_resource.conf"
config_filepath = os.path.join(os.path.dirname(os.path.realpath(__file__)), config_filename)
if os.path.exists(config_filepath) == False:
config_filepath = os.path.join(os.g... | 27.6 | 93 | 0.780193 | from configparser import SafeConfigParser
import os
def get_config():
config = SafeConfigParser()
config_filename = "config_resource.conf"
config_filepath = os.path.join(os.path.dirname(os.path.realpath(__file__)), config_filename)
if os.path.exists(config_filepath) == False:
config_filepath = os.path.join(os.g... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.