hexsha stringlengths 40 40 | size int64 10 805k | ext stringclasses 6
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 176 | max_stars_repo_name stringlengths 7 114 | 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 176 | max_issues_repo_name stringlengths 7 114 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 48.5k ⌀ | 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 176 | max_forks_repo_name stringlengths 7 114 | 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 10 805k | avg_line_length float64 5.53 11k | max_line_length int64 10 129k | alphanum_fraction float64 0.13 0.93 | content_no_comment stringlengths 0 449k | is_comment_constant_removed bool 2
classes | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f702dbc4b44a28bf194e2859e22aad59ea011f89 | 318 | py | Python | parser.py | kylelaker/cfn-joiner-parser | b154c0baaff7cc14f71b2ff5e2fe24d484641941 | [
"MIT"
] | 1 | 2021-03-22T15:19:34.000Z | 2021-03-22T15:19:34.000Z | parser.py | kylelaker/cfn-joiner-parser | b154c0baaff7cc14f71b2ff5e2fe24d484641941 | [
"MIT"
] | null | null | null | parser.py | kylelaker/cfn-joiner-parser | b154c0baaff7cc14f71b2ff5e2fe24d484641941 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import sys
import yaml
def main():
args = sys.argv[1:]
file = args[0] if args else sys.stdin
data = yaml.safe_load(file)
join_args = data['Fn::Join']
contents = join_args[0].join(join_args[1])
print(contents, end='')
if __name__ == '__main__':
sys.exit(main())
| 16.736842 | 46 | 0.622642 |
import sys
import yaml
def main():
args = sys.argv[1:]
file = args[0] if args else sys.stdin
data = yaml.safe_load(file)
join_args = data['Fn::Join']
contents = join_args[0].join(join_args[1])
print(contents, end='')
if __name__ == '__main__':
sys.exit(main())
| true | true |
f702dc9d1eb4f79c76d2aa25ecbf10919de5b2a2 | 387 | py | Python | take_single_user_input/c_windows_only.py | hafiz-kamilin/python_example_program | 78e84eff9e8c266b56c4e58cf2ba2d0f198f77fd | [
"MIT"
] | 1 | 2020-04-29T12:12:10.000Z | 2020-04-29T12:12:10.000Z | take_single_user_input/c_windows_only.py | hafiz-kamilin/miscellaneous_python_program | 78e84eff9e8c266b56c4e58cf2ba2d0f198f77fd | [
"MIT"
] | null | null | null | take_single_user_input/c_windows_only.py | hafiz-kamilin/miscellaneous_python_program | 78e84eff9e8c266b56c4e58cf2ba2d0f198f77fd | [
"MIT"
] | 1 | 2018-11-03T00:10:53.000Z | 2018-11-03T00:10:53.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# class for windows getch
class _GetchWindows:
def __init__(self):
import msvcrt
def __call__(self):
import msvcrt
return msvcrt.getch()
getch = _GetchWindows()
# print instruction
print ("Please enter something: ")
# read user input an... | 19.35 | 36 | 0.656331 |
class _GetchWindows:
def __init__(self):
import msvcrt
def __call__(self):
import msvcrt
return msvcrt.getch()
getch = _GetchWindows()
print ("Please enter something: ")
x = getch()
print(x) | true | true |
f702ddb6130de8cfc377c1f3f12d46bcdd929000 | 4,376 | py | Python | odk_viewer/tests/test_remongo.py | Ecotrust/formhub | 05033bb5aa152cc2cbcd7382c2c999d82b2c3276 | [
"BSD-2-Clause"
] | 123 | 2015-01-08T09:21:05.000Z | 2021-11-14T19:45:23.000Z | odk_viewer/tests/test_remongo.py | Ecotrust/formhub | 05033bb5aa152cc2cbcd7382c2c999d82b2c3276 | [
"BSD-2-Clause"
] | 16 | 2015-02-13T16:56:42.000Z | 2021-02-20T23:58:43.000Z | odk_viewer/tests/test_remongo.py | Ecotrust/formhub | 05033bb5aa152cc2cbcd7382c2c999d82b2c3276 | [
"BSD-2-Clause"
] | 110 | 2015-01-19T14:34:06.000Z | 2021-02-01T14:55:11.000Z | import os
from django.conf import settings
from main.tests.test_base import MainTestCase
from odk_viewer.models import ParsedInstance
from odk_viewer.management.commands.remongo import Command
from django.core.management import call_command
from common_tags import USERFORM_ID
class TestRemongo(MainTestCase):
def... | 43.76 | 144 | 0.649452 | import os
from django.conf import settings
from main.tests.test_base import MainTestCase
from odk_viewer.models import ParsedInstance
from odk_viewer.management.commands.remongo import Command
from django.core.management import call_command
from common_tags import USERFORM_ID
class TestRemongo(MainTestCase):
def... | true | true |
f702de434a6aa087fd1d679fab09a173f17cae3d | 1,278 | py | Python | lesson_3/test_fixture1.py | Ryne777/Stepik_auto_test | 7543c6616db9945fd56433877a292a9bfe80eb8d | [
"Apache-2.0"
] | null | null | null | lesson_3/test_fixture1.py | Ryne777/Stepik_auto_test | 7543c6616db9945fd56433877a292a9bfe80eb8d | [
"Apache-2.0"
] | null | null | null | lesson_3/test_fixture1.py | Ryne777/Stepik_auto_test | 7543c6616db9945fd56433877a292a9bfe80eb8d | [
"Apache-2.0"
] | null | null | null | from selenium import webdriver
link = "http://selenium1py.pythonanywhere.com/"
class TestMainPage1():
@classmethod
def setup_class(self):
print("\nstart browser for test suite..")
self.browser = webdriver.Chrome()
@classmethod
def teardown_class(self):
print("quit browser fo... | 27.782609 | 65 | 0.677621 | from selenium import webdriver
link = "http://selenium1py.pythonanywhere.com/"
class TestMainPage1():
@classmethod
def setup_class(self):
print("\nstart browser for test suite..")
self.browser = webdriver.Chrome()
@classmethod
def teardown_class(self):
print("quit browser fo... | true | true |
f702de58756cfee4caf31af038f6415d191aa875 | 7,895 | py | Python | himalaya/kernel_ridge/tests/test_random_search_kernel.py | mvdoc/himalaya | 7e3866287b835e2cc0a5c9848331e19c14896309 | [
"BSD-3-Clause"
] | null | null | null | himalaya/kernel_ridge/tests/test_random_search_kernel.py | mvdoc/himalaya | 7e3866287b835e2cc0a5c9848331e19c14896309 | [
"BSD-3-Clause"
] | null | null | null | himalaya/kernel_ridge/tests/test_random_search_kernel.py | mvdoc/himalaya | 7e3866287b835e2cc0a5c9848331e19c14896309 | [
"BSD-3-Clause"
] | null | null | null | import pytest
import numpy as np
import sklearn.linear_model
import sklearn.model_selection
import scipy.linalg
from himalaya.backend import set_backend
from himalaya.backend import ALL_BACKENDS
from himalaya.utils import assert_array_almost_equal
from himalaya.scoring import r2_score
from himalaya.kernel_ridge impo... | 39.873737 | 84 | 0.659658 | import pytest
import numpy as np
import sklearn.linear_model
import sklearn.model_selection
import scipy.linalg
from himalaya.backend import set_backend
from himalaya.backend import ALL_BACKENDS
from himalaya.utils import assert_array_almost_equal
from himalaya.scoring import r2_score
from himalaya.kernel_ridge impo... | true | true |
f702df62140e8d6bba1cd1a58b39f00070c3a064 | 5,343 | py | Python | src/drugrelink/download.py | lingling93/comparison | 9a9bbf57168b03c9097af22ecee660b3f432b1dd | [
"MIT"
] | 2 | 2019-04-11T14:06:00.000Z | 2019-07-03T21:50:58.000Z | src/drugrelink/download.py | lingling93/comparison | 9a9bbf57168b03c9097af22ecee660b3f432b1dd | [
"MIT"
] | 9 | 2019-04-19T19:33:54.000Z | 2019-05-23T09:59:13.000Z | src/drugrelink/download.py | lingling93/comparison | 9a9bbf57168b03c9097af22ecee660b3f432b1dd | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""Helper functions for getting resources."""
import logging
import os
from dataclasses import dataclass
from typing import List, Optional
from urllib.request import urlretrieve
logger = logging.getLogger(__name__)
HERE = os.path.abspath(os.path.dirname(__file__))
DEFAULT_DIRECTORY = os.pat... | 43.795082 | 125 | 0.764926 |
import logging
import os
from dataclasses import dataclass
from typing import List, Optional
from urllib.request import urlretrieve
logger = logging.getLogger(__name__)
HERE = os.path.abspath(os.path.dirname(__file__))
DEFAULT_DIRECTORY = os.path.abspath(os.path.join(HERE, os.pardir, os.pardir, 'data'))
DATA_DIRE... | true | true |
f702df7d8ff5a627e903de5c57770336a7b23d38 | 9,024 | py | Python | cinder/brick/initiator/linuxscsi.py | tmenjo/cinder-2015.1.1 | 1c83a5daa8041cb99bc85dd0301786d8ca43055a | [
"Apache-2.0"
] | null | null | null | cinder/brick/initiator/linuxscsi.py | tmenjo/cinder-2015.1.1 | 1c83a5daa8041cb99bc85dd0301786d8ca43055a | [
"Apache-2.0"
] | null | null | null | cinder/brick/initiator/linuxscsi.py | tmenjo/cinder-2015.1.1 | 1c83a5daa8041cb99bc85dd0301786d8ca43055a | [
"Apache-2.0"
] | null | null | null | # (c) Copyright 2013 Hewlett-Packard Development Company, L.P.
#
# 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 re... | 38.729614 | 79 | 0.542886 |
import os
import re
from oslo_concurrency import processutils as putils
from oslo_log import log as logging
from cinder.brick import exception
from cinder.brick import executor
from cinder.i18n import _, _LW, _LE
from cinder.openstack.common import loopingcall
LOG = logging.getLogger(__name__)
MULTIPA... | true | true |
f702e1901db433d3ed3c73f09a3ca0003e4a5499 | 4,869 | py | Python | src/proposals/tests/views/test_cancel.py | peihsuan/pycon.tw | 4d75e629295b3eef92eff78b3604ab034bd406b0 | [
"MIT"
] | null | null | null | src/proposals/tests/views/test_cancel.py | peihsuan/pycon.tw | 4d75e629295b3eef92eff78b3604ab034bd406b0 | [
"MIT"
] | null | null | null | src/proposals/tests/views/test_cancel.py | peihsuan/pycon.tw | 4d75e629295b3eef92eff78b3604ab034bd406b0 | [
"MIT"
] | null | null | null | import pytest
from django.conf import settings
from django.contrib import messages
from proposals.models import TalkProposal, TutorialProposal
pytestmark = pytest.mark.skipif(
not settings.PROPOSALS_WITHDRAWABLE,
reason='proposal withdrawal disabled',
)
def test_talk_proposal_cancel_login(client):
res... | 32.46 | 86 | 0.694804 | import pytest
from django.conf import settings
from django.contrib import messages
from proposals.models import TalkProposal, TutorialProposal
pytestmark = pytest.mark.skipif(
not settings.PROPOSALS_WITHDRAWABLE,
reason='proposal withdrawal disabled',
)
def test_talk_proposal_cancel_login(client):
res... | true | true |
f702e3fa5d22d565f73b30bff7f3d1d5d90b28ab | 10,523 | py | Python | moviepy/video/tools/drawing.py | andriyor/moviepy | 8eaf3f02c5cf812e89f03e925cb2fa5e05b8d29a | [
"MIT"
] | 8,558 | 2015-01-03T05:14:12.000Z | 2022-03-31T21:45:38.000Z | moviepy/video/tools/drawing.py | andriyor/moviepy | 8eaf3f02c5cf812e89f03e925cb2fa5e05b8d29a | [
"MIT"
] | 1,592 | 2015-01-02T22:12:54.000Z | 2022-03-30T13:10:40.000Z | moviepy/video/tools/drawing.py | andriyor/moviepy | 8eaf3f02c5cf812e89f03e925cb2fa5e05b8d29a | [
"MIT"
] | 1,332 | 2015-01-02T18:01:53.000Z | 2022-03-31T22:47:28.000Z | """Deals with making images (np arrays). It provides drawing
methods that are difficult to do with the existing Python libraries.
"""
import numpy as np
def blit(im1, im2, pos=None, mask=None):
"""Blit an image over another.
Blits ``im1`` on ``im2`` as position ``pos=(x,y)``, using the
``mask`` if provi... | 31.887879 | 88 | 0.5411 |
import numpy as np
def blit(im1, im2, pos=None, mask=None):
if pos is None:
pos = (0, 0)
else:
pos = tuple(pos)
im2.paste(im1, pos, mask)
return im2
def color_gradient(
size,
p1,
p2=None,
vector=None,
radius=None,
color_1=0.0,
color_2=1.0,
... | true | true |
f702e59535b5c977cc3845ab265467cf5b3c87b7 | 917 | py | Python | python/packages/pybind_nisar/products/readers/SLC/SLC.py | piyushrpt/isce3 | 1741af321470cb5939693459765d11a19c5c6fc2 | [
"Apache-2.0"
] | null | null | null | python/packages/pybind_nisar/products/readers/SLC/SLC.py | piyushrpt/isce3 | 1741af321470cb5939693459765d11a19c5c6fc2 | [
"Apache-2.0"
] | null | null | null | python/packages/pybind_nisar/products/readers/SLC/SLC.py | piyushrpt/isce3 | 1741af321470cb5939693459765d11a19c5c6fc2 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
import h5py
import pyre
from ..Base import Base
from .Identification import Identification
class SLC(Base, family='nisar.productreader.slc'):
'''
Class for parsing NISAR SLC products into isce structures.
'''
productValidationType = pyre.properties.str(default='SLC')
pr... | 28.65625 | 79 | 0.654308 |
import h5py
import pyre
from ..Base import Base
from .Identification import Identification
class SLC(Base, family='nisar.productreader.slc'):
productValidationType = pyre.properties.str(default='SLC')
productValidationType.doc = 'Validation tag to ensure correct product type'
def __init__(self, **kw... | true | true |
f702e79b9d3eac0b82b41061dc06802d153a2b1f | 2,550 | py | Python | doc/source/conf.py | mail2nsrajesh/tacker | dce6690659836c2885f1cf8227c19be234f8fe25 | [
"Apache-2.0"
] | null | null | null | doc/source/conf.py | mail2nsrajesh/tacker | dce6690659836c2885f1cf8227c19be234f8fe25 | [
"Apache-2.0"
] | null | null | null | doc/source/conf.py | mail2nsrajesh/tacker | dce6690659836c2885f1cf8227c19be234f8fe25 | [
"Apache-2.0"
] | null | null | null | # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the... | 32.278481 | 79 | 0.701176 |
import os
import sys
sys.path.insert(0, os.path.abspath('../..'))
extensions = [
'sphinx.ext.autodoc',
'stevedore.sphinxext',
'oslosphinx'
]
source_suffix = '.rst'
master_doc = 'index'
project = u'tacker'
copyright = u'2013, OpenStack Foundation'
add_function_parentheses =... | true | true |
f702e90920a76ea9d1371a858ef43b438a88eeac | 4,598 | py | Python | translate_json_to_yml.py | diffyintegry/Recipe-Grabber | cb0cd581baa2f31809b0144e37bd23153499a4d2 | [
"MIT"
] | null | null | null | translate_json_to_yml.py | diffyintegry/Recipe-Grabber | cb0cd581baa2f31809b0144e37bd23153499a4d2 | [
"MIT"
] | null | null | null | translate_json_to_yml.py | diffyintegry/Recipe-Grabber | cb0cd581baa2f31809b0144e37bd23153499a4d2 | [
"MIT"
] | null | null | null | #!/usr/bin/python
import json
import sys
from collections import defaultdict
from unidecode import unidecode
from HTMLParser import HTMLParser
h = HTMLParser()
_schema_keys_to_yml = {
'description' : 'notes',
'image' : 'photo',
'recipeCuisine' : 'notes',
... | 25.687151 | 116 | 0.512832 |
import json
import sys
from collections import defaultdict
from unidecode import unidecode
from HTMLParser import HTMLParser
h = HTMLParser()
_schema_keys_to_yml = {
'description' : 'notes',
'image' : 'photo',
'recipeCuisine' : 'notes',
'recipeInstructi... | false | true |
f702e920c7085107291c4505fefbd5abbfa57472 | 13,942 | py | Python | train_svdnet_xent.py | hsfzxjy/svdnet-pytorch | 8f485d0b162c23b20449f7ee80c955e0b20950ae | [
"MIT"
] | 12 | 2019-04-14T06:44:35.000Z | 2022-01-15T13:19:59.000Z | train_svdnet_xent.py | hsfzxjy/svdnet-pytorch | 8f485d0b162c23b20449f7ee80c955e0b20950ae | [
"MIT"
] | 2 | 2019-06-28T07:18:43.000Z | 2020-09-18T07:02:31.000Z | train_svdnet_xent.py | hsfzxjy/svdnet-pytorch | 8f485d0b162c23b20449f7ee80c955e0b20950ae | [
"MIT"
] | 1 | 2021-03-30T13:31:22.000Z | 2021-03-30T13:31:22.000Z | from __future__ import print_function
from __future__ import division
import os
import sys
import time
import datetime
import os.path as osp
import numpy as np
import warnings
import torch
import torch.nn as nn
import torch.backends.cudnn as cudnn
from args import argument_parser, image_dataset_kwargs, optimizer_kwa... | 30.641758 | 143 | 0.608378 | from __future__ import print_function
from __future__ import division
import os
import sys
import time
import datetime
import os.path as osp
import numpy as np
import warnings
import torch
import torch.nn as nn
import torch.backends.cudnn as cudnn
from args import argument_parser, image_dataset_kwargs, optimizer_kwa... | true | true |
f702e98b502f9918276dc6a5079495bd5c1a4194 | 4,527 | py | Python | saas/management/commands/renewals.py | gikoluo/djaodjin-saas | badd7894ac327191008a1b3a0ebd0d07b55908c3 | [
"BSD-2-Clause"
] | 383 | 2015-03-07T06:19:39.000Z | 2022-03-12T20:53:37.000Z | saas/management/commands/renewals.py | gikoluo/djaodjin-saas | badd7894ac327191008a1b3a0ebd0d07b55908c3 | [
"BSD-2-Clause"
] | 146 | 2015-03-25T22:45:44.000Z | 2022-02-22T08:49:35.000Z | saas/management/commands/renewals.py | gikoluo/djaodjin-saas | badd7894ac327191008a1b3a0ebd0d07b55908c3 | [
"BSD-2-Clause"
] | 111 | 2015-02-12T22:13:07.000Z | 2022-03-11T05:45:53.000Z | # Copyright (c) 2018, DjaoDjin inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice,
# this list of conditions and t... | 40.061947 | 78 | 0.69958 |
import logging, time
from django.core.management.base import BaseCommand
from ...models import get_broker
from ...renewals import (create_charges_for_balance, complete_charges,
extend_subscriptions, recognize_income, trigger_expiration_notices)
from ...utils import datetime_or_now
from ..... | true | true |
f702ea2613d3b67a2caf45adaefe4207ccb72a62 | 3,283 | py | Python | Django-apiTest/polls/quickstart.py | hsuyeemon/Testing | 3ff0e46baa9ce8db446d44cfc10b0cc8ef3a4ef0 | [
"Apache-2.0"
] | 1 | 2020-02-18T06:06:24.000Z | 2020-02-18T06:06:24.000Z | Django-apiTest/polls/quickstart.py | hsuyeemon/Testing | 3ff0e46baa9ce8db446d44cfc10b0cc8ef3a4ef0 | [
"Apache-2.0"
] | 4 | 2021-05-10T18:47:55.000Z | 2022-02-26T19:48:52.000Z | Django-apiTest/polls/quickstart.py | hsuyeemon/Testing | 3ff0e46baa9ce8db446d44cfc10b0cc8ef3a4ef0 | [
"Apache-2.0"
] | null | null | null | from __future__ import print_function
import datetime
import pickle
import os.path
from googleapiclient.discovery import build
from google_auth_oauthlib.flow import InstalledAppFlow
from google.auth.transport.requests import Request
# If modifying these scopes, delete the file token.pickle.
SCOPES = ['https://www.goog... | 35.301075 | 81 | 0.613463 | from __future__ import print_function
import datetime
import pickle
import os.path
from googleapiclient.discovery import build
from google_auth_oauthlib.flow import InstalledAppFlow
from google.auth.transport.requests import Request
SCOPES = ['https://www.googleapis.com/auth/calendar']
def main():
creds = None
... | true | true |
f702eaa1c80314a8254a6bb995b9a1193fd51d26 | 486 | py | Python | yama/shard.py | vitovitolo/yama | 1d96530ac0b2700838dd9c65e6245e35b7f639cd | [
"MIT"
] | 1 | 2021-10-30T00:54:34.000Z | 2021-10-30T00:54:34.000Z | yama/shard.py | vitovitolo/yama | 1d96530ac0b2700838dd9c65e6245e35b7f639cd | [
"MIT"
] | null | null | null | yama/shard.py | vitovitolo/yama | 1d96530ac0b2700838dd9c65e6245e35b7f639cd | [
"MIT"
] | null | null | null | import database
def load_shard_from_db(conf):
#TODO: load shard from cache if exists
shards = database.load_shard(conf)
return shards
def get_shard(shards, url):
"""
Hash function for shading scheme
returns a dict with hostname and table name
Eg: s = { 'hostname': 'node1', 'table_name'... | 22.090909 | 97 | 0.62963 | import database
def load_shard_from_db(conf):
shards = database.load_shard(conf)
return shards
def get_shard(shards, url):
if not shards:
return {}
else:
return shards[hash(str(url['hostname'])+str(url['port'])+str(url['path'])) % len(shards)]
| true | true |
f702ebe9e7c9ad39441f6932c5e3341872fd5138 | 298 | py | Python | dragon/plugins/help.py | sahuang/DragonBot-ReDive | 3efe51db42aa16f209077d082e9e148f2571c014 | [
"MIT"
] | 10 | 2020-06-30T07:31:52.000Z | 2022-02-22T01:43:17.000Z | dragon/plugins/help.py | sahuang/DragonBot | 3efe51db42aa16f209077d082e9e148f2571c014 | [
"MIT"
] | 1 | 2022-01-13T02:52:24.000Z | 2022-01-13T02:52:24.000Z | dragon/plugins/help.py | sahuang/DragonBot | 3efe51db42aa16f209077d082e9e148f2571c014 | [
"MIT"
] | 5 | 2020-07-30T08:16:32.000Z | 2021-09-08T03:16:50.000Z | from nonebot import on_command, CommandSession
@on_command('help', aliases=('h', '帮助'), only_to_me=False)
async def manual(session: CommandSession):
await session.send(f'[CQ:image,file=/admin/manual.png]')
@manual.args_parser
async def _(session: CommandSession):
# do nothing
return | 27.090909 | 60 | 0.734899 | from nonebot import on_command, CommandSession
@on_command('help', aliases=('h', '帮助'), only_to_me=False)
async def manual(session: CommandSession):
await session.send(f'[CQ:image,file=/admin/manual.png]')
@manual.args_parser
async def _(session: CommandSession):
return | true | true |
f702ed24451be873a3ad174d6df0e922afb0bb2f | 323 | py | Python | web/pipeline/migrations/0005_remove_hospital_sv_name.py | stevenstuber/CIT | 8c485e72084c06da6db45da1cb402bac26411ec2 | [
"Apache-2.0"
] | 10 | 2020-11-12T15:13:40.000Z | 2022-03-05T22:33:08.000Z | web/pipeline/migrations/0005_remove_hospital_sv_name.py | stevenstuber/CIT | 8c485e72084c06da6db45da1cb402bac26411ec2 | [
"Apache-2.0"
] | 28 | 2020-07-17T16:33:55.000Z | 2022-03-21T16:24:25.000Z | web/pipeline/migrations/0005_remove_hospital_sv_name.py | stevenstuber/CIT | 8c485e72084c06da6db45da1cb402bac26411ec2 | [
"Apache-2.0"
] | 5 | 2020-11-02T23:39:53.000Z | 2022-03-01T19:09:45.000Z | # Generated by Django 2.2.13 on 2020-06-30 06:51
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('pipeline', '0004_hospital'),
]
operations = [
migrations.RemoveField(
model_name='hospital',
name='sv_name',
),
... | 17.944444 | 48 | 0.585139 |
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('pipeline', '0004_hospital'),
]
operations = [
migrations.RemoveField(
model_name='hospital',
name='sv_name',
),
]
| true | true |
f702efe7fbf48cf708ca30d341f9b765475630f0 | 775 | py | Python | PollsDjango/app/urls.py | Bhaskers-Blu-Org2/PTVS-Samples | a82d0699bd2fd3f0f3a7a452fef930100776cfc7 | [
"Apache-2.0"
] | 27 | 2015-05-05T13:06:20.000Z | 2019-04-21T21:58:48.000Z | PollsDjango/app/urls.py | microsoft/PTVS-Samples | a82d0699bd2fd3f0f3a7a452fef930100776cfc7 | [
"Apache-2.0"
] | 5 | 2015-06-09T22:10:14.000Z | 2018-04-11T18:56:17.000Z | PollsDjango/app/urls.py | Microsoft/PTVS-Samples | a82d0699bd2fd3f0f3a7a452fef930100776cfc7 | [
"Apache-2.0"
] | 11 | 2015-04-24T19:11:52.000Z | 2017-09-13T03:46:22.000Z | """
Definition of urls for polls viewing and voting.
"""
from django.conf.urls import url
from app.models import Poll
import app.views
urlpatterns = [
url(r'^$',
app.views.PollListView.as_view(
queryset=Poll.objects.order_by('-pub_date')[:5],
context_object_name='late... | 28.703704 | 67 | 0.572903 |
from django.conf.urls import url
from app.models import Poll
import app.views
urlpatterns = [
url(r'^$',
app.views.PollListView.as_view(
queryset=Poll.objects.order_by('-pub_date')[:5],
context_object_name='latest_poll_list',
template_name='app/index.html',)... | true | true |
f702f19104a3c185b7314d4b033a56a62d07c064 | 2,770 | py | Python | tacker/api/validation/__init__.py | takahashi-tsc/tacker | a0ae01a13dcc51bb374060adcbb4fd484ab37156 | [
"Apache-2.0"
] | 116 | 2015-10-18T02:57:08.000Z | 2022-03-15T04:09:18.000Z | tacker/api/validation/__init__.py | takahashi-tsc/tacker | a0ae01a13dcc51bb374060adcbb4fd484ab37156 | [
"Apache-2.0"
] | 6 | 2016-11-07T22:15:54.000Z | 2021-05-09T06:13:08.000Z | tacker/api/validation/__init__.py | takahashi-tsc/tacker | a0ae01a13dcc51bb374060adcbb4fd484ab37156 | [
"Apache-2.0"
] | 166 | 2015-10-20T15:31:52.000Z | 2021-11-12T08:39:49.000Z | # Copyright (C) 2019 NTT DATA
# 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 ... | 30.108696 | 78 | 0.638267 |
import functools
import webob
from tacker.api.validation import validators
from tacker.common import exceptions
def schema(request_body_schema):
def add_validator(func):
@functools.wraps(func)
def wrapper(*args, **kwargs):
schema_validator = validators._SchemaValidato... | true | true |
f702f1f611d16ff3b225453713bd110e6a8457ef | 9,165 | py | Python | tests/scripts/thread-cert/Cert_5_5_02_LeaderReboot.py | BLUEGRioT/openthread | 04a6a9b925db13a52790cc1b12cb2d854f222799 | [
"BSD-3-Clause"
] | null | null | null | tests/scripts/thread-cert/Cert_5_5_02_LeaderReboot.py | BLUEGRioT/openthread | 04a6a9b925db13a52790cc1b12cb2d854f222799 | [
"BSD-3-Clause"
] | null | null | null | tests/scripts/thread-cert/Cert_5_5_02_LeaderReboot.py | BLUEGRioT/openthread | 04a6a9b925db13a52790cc1b12cb2d854f222799 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python3
#
# Copyright (c) 2016, The OpenThread Authors.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# 1. Redistributions of source code must retain the above copyright
# ... | 46.522843 | 536 | 0.687179 |
import unittest
import config
import thread_cert
from pktverify.consts import MLE_ADVERTISEMENT, MLE_PARENT_REQUEST, MLE_PARENT_RESPONSE, MLE_CHILD_UPDATE_RESPONSE, MLE_CHILD_ID_REQUEST, MLE_CHILD_ID_RESPONSE, MLE_LINK_REQUEST, MLE_LINK_ACCEPT_AND_REQUEST, ADDR_SOL_URI, SOURCE_ADDRESS_TLV,... | true | true |
f702f26251ff1e2e6cd0c0ea57344ea4624619b3 | 10,831 | py | Python | libaraboly/ArabolyFree.py | lalbornoz/araboly | fd463004426800e39800b4446f950abcbaececc9 | [
"MIT"
] | 4 | 2018-04-08T21:41:43.000Z | 2021-11-24T18:26:34.000Z | libaraboly/ArabolyFree.py | lalbornoz/araboly | fd463004426800e39800b4446f950abcbaececc9 | [
"MIT"
] | null | null | null | libaraboly/ArabolyFree.py | lalbornoz/araboly | fd463004426800e39800b4446f950abcbaececc9 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
#
# Araboly 2000 Advanced Server SP4 -- everyone's favourite board game... with IRC support and fancy colours!
# Copyright (c) 2018 Lucio Andrés Illanes Albornoz <lucio@lucioillanes.de>
# This project is licensed under the terms of the MIT licence.
#
from ArabolyGenerals import ArabolyGenerals
f... | 56.119171 | 301 | 0.627366 |
# Copyright (c) 2018 Lucio Andrés Illanes Albornoz <lucio@lucioillanes.de>
# This project is licensed under the terms of the MIT licence.
#
from ArabolyGenerals import ArabolyGenerals
from ArabolyMonad import ArabolyDecorator
from ArabolyTypeClass import ArabolyTypeClass
from ArabolyState import ArabolyGameState, A... | true | true |
f702f4845b651ab7fece7302dae0852bbdf157e9 | 528 | py | Python | setup.py | UnJavaScripter/video-to-ascii | f9b1fcafb55782195d36f4d77c4c20f3f08ee95b | [
"MIT"
] | null | null | null | setup.py | UnJavaScripter/video-to-ascii | f9b1fcafb55782195d36f4d77c4c20f3f08ee95b | [
"MIT"
] | null | null | null | setup.py | UnJavaScripter/video-to-ascii | f9b1fcafb55782195d36f4d77c4c20f3f08ee95b | [
"MIT"
] | null | null | null | import setuptools
setuptools.setup(
name="video_to_ascii",
version="1.0.6",
author="Joel Ibaceta",
author_email="mail@joelibaceta.com",
description="A simple tool to play a video using ascii characters",
url="https://github.com/joelibaceta/video-to-ascii",
packages=setuptools.find_packages(... | 31.058824 | 71 | 0.655303 | import setuptools
setuptools.setup(
name="video_to_ascii",
version="1.0.6",
author="Joel Ibaceta",
author_email="mail@joelibaceta.com",
description="A simple tool to play a video using ascii characters",
url="https://github.com/joelibaceta/video-to-ascii",
packages=setuptools.find_packages(... | true | true |
f702f4bd9851082af9d6bfb0a43ee691a1d3974f | 1,612 | py | Python | testsSDW__copy/agents/trade_agent_tests.py | jomyhuang/sdwle | 9b6e916567e09c7cba4a171fe0adf0f47009a8c3 | [
"MIT"
] | null | null | null | testsSDW__copy/agents/trade_agent_tests.py | jomyhuang/sdwle | 9b6e916567e09c7cba4a171fe0adf0f47009a8c3 | [
"MIT"
] | null | null | null | testsSDW__copy/agents/trade_agent_tests.py | jomyhuang/sdwle | 9b6e916567e09c7cba4a171fe0adf0f47009a8c3 | [
"MIT"
] | null | null | null | import unittest
from SDWLE.agents.trade.possible_play import PossiblePlays
from SDWLE.cards import Wisp, WarGolem, BloodfenRaptor, RiverCrocolisk, AbusiveSergeant, ArgentSquire
from testsSDW.agents.trade.test_helpers import TestHelpers
from testsSDW.agents.trade.test_case_mixin import TestCaseMixin
class TestTradeAge... | 35.043478 | 101 | 0.697891 | import unittest
from SDWLE.agents.trade.possible_play import PossiblePlays
from SDWLE.cards import Wisp, WarGolem, BloodfenRaptor, RiverCrocolisk, AbusiveSergeant, ArgentSquire
from testsSDW.agents.trade.test_helpers import TestHelpers
from testsSDW.agents.trade.test_case_mixin import TestCaseMixin
class TestTradeAge... | true | true |
f702f53a18087827a5f30cf07fb3cd0cba54fd1a | 6,256 | py | Python | src/poliastro/core/perturbations.py | kerel-fs/poliastro | 1ad2074aebb7cf18f507ac44931d1e18fec53dad | [
"MIT"
] | null | null | null | src/poliastro/core/perturbations.py | kerel-fs/poliastro | 1ad2074aebb7cf18f507ac44931d1e18fec53dad | [
"MIT"
] | null | null | null | src/poliastro/core/perturbations.py | kerel-fs/poliastro | 1ad2074aebb7cf18f507ac44931d1e18fec53dad | [
"MIT"
] | null | null | null | import numpy as np
from numpy.linalg import norm
from ._jit import jit
@jit
def J2_perturbation(t0, state, k, J2, R):
r"""Calculates J2_perturbation acceleration (km/s2)
.. math::
\vec{p} = \frac{3}{2}\frac{J_{2}\mu R^{2}}{r^{4}}\left [\frac{x}{r}\left ( 5\frac{z^{2}}{r^{2}}-1 \right )\vec{i} + \fr... | 27.438596 | 248 | 0.574329 | import numpy as np
from numpy.linalg import norm
from ._jit import jit
@jit
def J2_perturbation(t0, state, k, J2, R):
r_vec = state[:3]
r = norm(r_vec)
factor = (3.0 / 2.0) * k * J2 * (R ** 2) / (r ** 5)
a_x = 5.0 * r_vec[2] ** 2 / r ** 2 - 1
a_y = 5.0 * r_vec[2] ** 2 / r ** 2 - 1
a_z = 5.0... | true | true |
f702f5a02fde6d1e2a47314c1104f816697796f8 | 2,081 | py | Python | ask-smapi-model/ask_smapi_model/v1/isp/purchasable_state.py | alexa-labs/alexa-apis-for-python | 52838be4f57ee1a2479402ea78b1247b56017942 | [
"Apache-2.0"
] | 90 | 2018-09-19T21:56:42.000Z | 2022-03-30T11:25:21.000Z | ask-smapi-model/ask_smapi_model/v1/isp/purchasable_state.py | ishitaojha/alexa-apis-for-python | a68f94b7a0e41f819595d6fe56e800403e8a4194 | [
"Apache-2.0"
] | 11 | 2018-09-23T12:16:48.000Z | 2021-06-10T19:49:45.000Z | ask-smapi-model/ask_smapi_model/v1/isp/purchasable_state.py | ishitaojha/alexa-apis-for-python | a68f94b7a0e41f819595d6fe56e800403e8a4194 | [
"Apache-2.0"
] | 28 | 2018-09-19T22:30:38.000Z | 2022-02-22T22:57:07.000Z | # coding: utf-8
#
# Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file
# except in compliance with the License. A copy of the License is located at
#
# http://aws.amazon.com/apache2.0/
#
# or in the "lice... | 31.059701 | 284 | 0.672273 |
import pprint
import re
import six
import typing
from enum import Enum
if typing.TYPE_CHECKING:
from typing import Dict, List, Optional, Union, Any
from datetime import datetime
class PurchasableState(Enum):
PURCHASABLE = "PURCHASABLE"
NOT_PURCHASABLE = "NOT_PURCHASABLE"
def to... | true | true |
f702f6aa007a531bab63935e88b3d97af80e19c3 | 3,874 | py | Python | cohesity_management_sdk/models/application_server_info.py | nick6655/management-sdk-python | 88e792cb83e5c24a22af495b220c145d0c45841d | [
"Apache-2.0"
] | 18 | 2019-09-24T17:35:53.000Z | 2022-03-25T08:08:47.000Z | cohesity_management_sdk/models/application_server_info.py | nick6655/management-sdk-python | 88e792cb83e5c24a22af495b220c145d0c45841d | [
"Apache-2.0"
] | 18 | 2019-03-29T19:32:29.000Z | 2022-01-03T23:16:45.000Z | cohesity_management_sdk/models/application_server_info.py | nick6655/management-sdk-python | 88e792cb83e5c24a22af495b220c145d0c45841d | [
"Apache-2.0"
] | 16 | 2019-02-27T06:54:12.000Z | 2021-11-16T18:10:24.000Z | # -*- coding: utf-8 -*-
# Copyright 2021 Cohesity Inc.
import cohesity_management_sdk.models.exchange_database_copy_info
import cohesity_management_sdk.models.exchange_database_info
class ApplicationServerInfo(object):
"""Implementation of the 'ApplicationServerInfo' model.
Specifies the Information about t... | 38.74 | 158 | 0.648684 |
import cohesity_management_sdk.models.exchange_database_copy_info
import cohesity_management_sdk.models.exchange_database_info
class ApplicationServerInfo(object):
_names = {
"database_copy_info_list": 'databaseCopyInfoList',
"database_info_list":'databaseInfoList',
"fqdn": 'fqdn'... | true | true |
f702f759d6fd07e5788090253f85f8ef7d52ffbc | 2,669 | gyp | Python | chrome/browser/resources/settings/settings_page/compiled_resources2.gyp | google-ar/chromium | 2441c86a5fd975f09a6c30cddb57dfb7fc239699 | [
"Apache-2.0",
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | 777 | 2017-08-29T15:15:32.000Z | 2022-03-21T05:29:41.000Z | chrome/browser/resources/settings/settings_page/compiled_resources2.gyp | harrymarkovskiy/WebARonARCore | 2441c86a5fd975f09a6c30cddb57dfb7fc239699 | [
"Apache-2.0",
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | 66 | 2017-08-30T18:31:18.000Z | 2021-08-02T10:59:35.000Z | chrome/browser/resources/settings/settings_page/compiled_resources2.gyp | harrymarkovskiy/WebARonARCore | 2441c86a5fd975f09a6c30cddb57dfb7fc239699 | [
"Apache-2.0",
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | 123 | 2017-08-30T01:19:34.000Z | 2022-03-17T22:55:31.000Z | # Copyright 2016 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
{
'targets': [
{
'target_name': 'main_page_behavior',
'dependencies': [
'../animation/compiled_resources2.gyp:animation',
'.... | 43.754098 | 146 | 0.654927 |
{
'targets': [
{
'target_name': 'main_page_behavior',
'dependencies': [
'../animation/compiled_resources2.gyp:animation',
'../compiled_resources2.gyp:route',
'settings_section',
'<(DEPTH)/ui/webui/resources/js/compiled_resources2.gyp:assert',
'<(DEPTH)/ui/web... | true | true |
f702f882a18a8f31cd4aaa8b692e61a020b9c589 | 2,764 | py | Python | test/test_xlsx_model.py | TRANTANKHOA/pptx-template | 6f756359641278e1aecb7e04abcbed01cc20826c | [
"Apache-2.0"
] | 73 | 2017-06-23T08:58:37.000Z | 2022-03-30T05:01:03.000Z | test/test_xlsx_model.py | TRANTANKHOA/pptx-template | 6f756359641278e1aecb7e04abcbed01cc20826c | [
"Apache-2.0"
] | 26 | 2017-06-08T01:45:36.000Z | 2021-09-23T19:13:40.000Z | test/test_xlsx_model.py | TRANTANKHOA/pptx-template | 6f756359641278e1aecb7e04abcbed01cc20826c | [
"Apache-2.0"
] | 23 | 2017-07-05T02:29:21.000Z | 2022-01-18T00:50:30.000Z | #
# coding=utf-8
import unittest
import sys
import os
from io import open
import openpyxl as xl
from pptx_template.xlsx_model import _build_tsv, _format_cell_value, generate_whole_model
class Cell:
def __init__(self, value, number_format):
self.value = value
self.number_format = number_format
de... | 40.057971 | 112 | 0.599493 |
import unittest
import sys
import os
from io import open
import openpyxl as xl
from pptx_template.xlsx_model import _build_tsv, _format_cell_value, generate_whole_model
class Cell:
def __init__(self, value, number_format):
self.value = value
self.number_format = number_format
def _to_cells(lis... | true | true |
f702f88302df20baac1ae553afce919d1fdf2aa8 | 23,276 | py | Python | tests/lambdas/test_sdk_analysis.py | CuriBio/IaC | 86d39038c7035442778f13eb29f10bafb628c89a | [
"MIT"
] | 2 | 2021-09-15T07:34:57.000Z | 2021-09-15T07:35:48.000Z | tests/lambdas/test_sdk_analysis.py | CuriBio/IaC | 86d39038c7035442778f13eb29f10bafb628c89a | [
"MIT"
] | 339 | 2021-02-22T19:02:04.000Z | 2022-03-31T15:13:02.000Z | tests/lambdas/test_sdk_analysis.py | CuriBio/IaC | 86d39038c7035442778f13eb29f10bafb628c89a | [
"MIT"
] | null | null | null | import base64
import copy
import hashlib
import json
from botocore.exceptions import ClientError
import pytest
from ..test_utils import import_lambda
sdk_analysis = import_lambda(
"sdk_analysis",
mock_imports=[
"pulse3D.plate_recording",
"pulse3D.constants",
"pulse3D.excel_writer",
... | 43.02403 | 131 | 0.768216 | import base64
import copy
import hashlib
import json
from botocore.exceptions import ClientError
import pytest
from ..test_utils import import_lambda
sdk_analysis = import_lambda(
"sdk_analysis",
mock_imports=[
"pulse3D.plate_recording",
"pulse3D.constants",
"pulse3D.excel_writer",
... | true | true |
f702f8cb30c1d993d051deeb4a1219efe4d96cde | 1,676 | py | Python | chris/cube/client.py | FNNDSC/chrisomatic | 6eacc7716ed40c7fdac9b1fbfd467433ab0b2bec | [
"MIT"
] | null | null | null | chris/cube/client.py | FNNDSC/chrisomatic | 6eacc7716ed40c7fdac9b1fbfd467433ab0b2bec | [
"MIT"
] | 4 | 2022-02-24T22:38:16.000Z | 2022-02-25T22:50:01.000Z | chris/cube/client.py | FNNDSC/chrisomatic | 6eacc7716ed40c7fdac9b1fbfd467433ab0b2bec | [
"MIT"
] | null | null | null | from typing import TypeVar, AsyncIterator, Sequence
from chris.common.types import PluginUrl
from chris.common.client import AuthenticatedClient
from chris.common.search import get_paginated, to_sequence
import chris.common.decorator as http
from chris.cube.types import ComputeResourceName, PfconUrl
from chris.cube.des... | 34.204082 | 87 | 0.704654 | from typing import TypeVar, AsyncIterator, Sequence
from chris.common.types import PluginUrl
from chris.common.client import AuthenticatedClient
from chris.common.search import get_paginated, to_sequence
import chris.common.decorator as http
from chris.cube.types import ComputeResourceName, PfconUrl
from chris.cube.des... | true | true |
f702f9800fd73e3aeb9520829b92e3d60e774d55 | 438 | py | Python | habari/apps/crawl/migrations/0016_auto_20200407_2042.py | ppolle/habari | 671b98c361ce593f708bc15f69dd3aa6fe72b128 | [
"MIT"
] | 3 | 2020-06-08T08:39:06.000Z | 2020-07-30T10:46:22.000Z | habari/apps/crawl/migrations/0016_auto_20200407_2042.py | ppolle/habari | 671b98c361ce593f708bc15f69dd3aa6fe72b128 | [
"MIT"
] | 9 | 2021-03-19T11:18:58.000Z | 2022-02-10T15:48:35.000Z | habari/apps/crawl/migrations/0016_auto_20200407_2042.py | ppolle/habari | 671b98c361ce593f708bc15f69dd3aa6fe72b128 | [
"MIT"
] | 1 | 2021-09-22T07:23:03.000Z | 2021-09-22T07:23:03.000Z | # -*- coding: utf-8 -*-
# Generated by Django 1.11 on 2020-04-07 17:42
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('crawl', '0015_remove_article_news_source'),
]
operations = [
migrations.RenameField(
... | 20.857143 | 53 | 0.616438 |
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('crawl', '0015_remove_article_news_source'),
]
operations = [
migrations.RenameField(
model_name='article',
old_name='source',
... | true | true |
f702fa92c59e613696990e2cb10c7e8d331bd0f1 | 1,523 | bzl | Python | lib/dicts.bzl | laszlocsomor/bazel-skylib | f4a2bae427c4958af834c34624767b0144f7ab12 | [
"Apache-2.0"
] | 31 | 2020-08-05T23:27:36.000Z | 2022-02-09T18:53:57.000Z | lib/dicts.bzl | laszlocsomor/bazel-skylib | f4a2bae427c4958af834c34624767b0144f7ab12 | [
"Apache-2.0"
] | 2 | 2020-08-06T00:07:42.000Z | 2022-03-11T20:36:35.000Z | lib/dicts.bzl | laszlocsomor/bazel-skylib | f4a2bae427c4958af834c34624767b0144f7ab12 | [
"Apache-2.0"
] | 7 | 2020-08-06T00:06:50.000Z | 2022-03-11T20:35:19.000Z | # Copyright 2017 The Bazel Authors. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable la... | 36.261905 | 80 | 0.730794 |
def _add(*dictionaries):
result = {}
for d in dictionaries:
result.update(d)
return result
dicts = struct(
add = _add,
)
| true | true |
f702fa93839e273a82c26a78e2b344bd75c7baab | 7,542 | py | Python | pySpatialTools/utils/artificial_data/artificial_measure.py | tgquintela/pySpatialTools | e028008f9750521bf7d311f7cd3323c88d621ea4 | [
"MIT"
] | 8 | 2015-07-21T05:15:16.000Z | 2018-06-12T18:22:52.000Z | pySpatialTools/utils/artificial_data/artificial_measure.py | tgquintela/pySpatialTools | e028008f9750521bf7d311f7cd3323c88d621ea4 | [
"MIT"
] | 6 | 2016-01-11T22:25:28.000Z | 2016-01-28T16:17:46.000Z | pySpatialTools/utils/artificial_data/artificial_measure.py | tgquintela/pySpatialTools | e028008f9750521bf7d311f7cd3323c88d621ea4 | [
"MIT"
] | null | null | null |
"""
artificial measure
------------------
Creation of artificial measure
"""
import numpy as np
############################### Create measure ################################
###############################################################################
def create_artificial_measure_array(n_k, n_vals_i, n_feats):... | 26.006897 | 79 | 0.549589 |
import numpy as np
| true | true |
f702fb01b8cc397b472b0efaeea890401516c4ba | 384 | py | Python | pipenv/patched/prettytoml/test_prettifier.py | Enzime/pipenv | d4f710be4a39e09a82a5133b7b3a277ee9bfb13a | [
"MIT"
] | 11 | 2016-04-15T10:02:20.000Z | 2022-03-25T13:39:53.000Z | pipenv/patched/prettytoml/test_prettifier.py | Enzime/pipenv | d4f710be4a39e09a82a5133b7b3a277ee9bfb13a | [
"MIT"
] | 4 | 2020-03-24T16:06:51.000Z | 2021-06-10T20:48:41.000Z | pipenv/patched/prettytoml/test_prettifier.py | Enzime/pipenv | d4f710be4a39e09a82a5133b7b3a277ee9bfb13a | [
"MIT"
] | 6 | 2017-10-09T21:45:28.000Z | 2022-02-16T15:09:42.000Z |
from .prettifier import prettify
from .prettifier.common import assert_prettifier_works
import pytoml
def test_prettifying_against_humanly_verified_sample():
toml_source = open('sample.toml').read()
expected = open('sample-prettified.toml').read()
assert_prettifier_works(toml_source, expected, prettify)... | 29.538462 | 62 | 0.786458 |
from .prettifier import prettify
from .prettifier.common import assert_prettifier_works
import pytoml
def test_prettifying_against_humanly_verified_sample():
toml_source = open('sample.toml').read()
expected = open('sample-prettified.toml').read()
assert_prettifier_works(toml_source, expected, prettify)... | true | true |
f702fcbc8a7a2d562be1b856c7837695c9f46e8c | 3,759 | py | Python | mux_python/models/signal_live_stream_complete_response.py | gts-work/mux-python | 826e52730bad7acd08c31a3e1951a281521f1b4f | [
"MIT"
] | null | null | null | mux_python/models/signal_live_stream_complete_response.py | gts-work/mux-python | 826e52730bad7acd08c31a3e1951a281521f1b4f | [
"MIT"
] | null | null | null | mux_python/models/signal_live_stream_complete_response.py | gts-work/mux-python | 826e52730bad7acd08c31a3e1951a281521f1b4f | [
"MIT"
] | null | null | null | # coding: utf-8
"""
Mux API
Mux is how developers build online video. This API encompasses both Mux Video and Mux Data functionality to help you build your video-related projects better and faster than ever before. # noqa: E501
The version of the OpenAPI document: v1
Generated by: https://openapi-g... | 29.139535 | 205 | 0.586326 |
import inspect
import pprint
import re
import six
from mux_python.configuration import Configuration
class SignalLiveStreamCompleteResponse(object):
openapi_types = {
'data': 'object'
}
attribute_map = {
'data': 'data'
}
def __init__(self, data=None, local_vars_configurat... | true | true |
f702fdacc80239cb68f714c266ba5d5ed7d3b8b7 | 18,330 | py | Python | keras_ocr/_version.py | bayethiernodiop/keras-ocr | 73349ce88237e9b9dc7e1ac0754042f89fb4e13e | [
"MIT"
] | 8 | 2020-08-27T14:37:46.000Z | 2021-09-24T07:33:46.000Z | keras_ocr/_version.py | bayethiernodiop/keras-ocr | 73349ce88237e9b9dc7e1ac0754042f89fb4e13e | [
"MIT"
] | 4 | 2021-06-08T22:59:39.000Z | 2022-03-12T00:59:11.000Z | keras_ocr/_version.py | bayethiernodiop/keras-ocr | 73349ce88237e9b9dc7e1ac0754042f89fb4e13e | [
"MIT"
] | 5 | 2020-11-01T21:03:05.000Z | 2021-08-19T15:55:57.000Z | # This file helps to compute a version number in source trees obtained from
# git-archive tarball (such as those provided by githubs download-from-tag
# feature). Distribution tarballs (built by setup.py sdist) and build
# directories (produced by setup.py build) will contain a much shorter file
# that just contains th... | 34.070632 | 98 | 0.588598 |
import errno
import os
import re
import subprocess
import sys
def get_keywords():
git_refnames = "$Format:%d$"
git_full = "$Format:%H$"
git_date = "$Format:%ci$"
keywords = {"refnames": git_refnames, "full": git_full, "date": git_date}
return keywords
class Versionee... | true | true |
f702fe7bb0f5dd86a6d9b1e9444a99e6a59063b4 | 3,239 | py | Python | vistrails/db/versions/v0_5_0/persistence/xml/xml_dao.py | celiafish/VisTrails | d8cb575b8b121941de190fe608003ad1427ef9f6 | [
"BSD-3-Clause"
] | 1 | 2015-05-11T16:46:49.000Z | 2015-05-11T16:46:49.000Z | vistrails/db/versions/v0_5_0/persistence/xml/xml_dao.py | celiafish/VisTrails | d8cb575b8b121941de190fe608003ad1427ef9f6 | [
"BSD-3-Clause"
] | null | null | null | vistrails/db/versions/v0_5_0/persistence/xml/xml_dao.py | celiafish/VisTrails | d8cb575b8b121941de190fe608003ad1427ef9f6 | [
"BSD-3-Clause"
] | null | null | null | ###############################################################################
##
## Copyright (C) 2011-2014, NYU-Poly.
## Copyright (C) 2006-2011, University of Utah.
## All rights reserved.
## Contact: contact@vistrails.org
##
## This file is part of VisTrails.
##
## "Redistribution and use in source and binary for... | 41 | 84 | 0.600494 | true | true | |
f702fea9527715af2b456968c66f01b355926e39 | 50,389 | py | Python | pylib/gyp/msvs_emulation.py | xforce/gyp | a079e0aeab3470d14055657bba75adaa94e974e6 | [
"BSD-3-Clause"
] | null | null | null | pylib/gyp/msvs_emulation.py | xforce/gyp | a079e0aeab3470d14055657bba75adaa94e974e6 | [
"BSD-3-Clause"
] | null | null | null | pylib/gyp/msvs_emulation.py | xforce/gyp | a079e0aeab3470d14055657bba75adaa94e974e6 | [
"BSD-3-Clause"
] | null | null | null | # Copyright (c) 2012 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""
This module helps emulate Visual Studio 2008 behavior on top of other
build systems, primarily ninja.
"""
import collections
import os
import pickle
import re... | 42.702542 | 83 | 0.672806 |
import collections
import os
import pickle
import re
import subprocess
import sys
import time
import hashlib
from gyp.common import OrderedSet
import gyp.MSVSUtil
import gyp.MSVSVersion
from gyp import DebugOutput, DEBUG_GENERAL
try:
import sys
reload(sys)
sys.setdefaultencoding('utf8')
except:
pass
try... | true | true |
f702fee5a19306d06dfa47f23154ec7fca804920 | 7,915 | py | Python | keystone/common/tokenless_auth.py | rajivmucheli/keystone | d55099d4a17e3672d478aae8c367bcdf9af15fb9 | [
"Apache-2.0"
] | null | null | null | keystone/common/tokenless_auth.py | rajivmucheli/keystone | d55099d4a17e3672d478aae8c367bcdf9af15fb9 | [
"Apache-2.0"
] | 4 | 2020-02-10T12:02:37.000Z | 2021-07-14T15:16:57.000Z | keystone/common/tokenless_auth.py | rajivmucheli/keystone | d55099d4a17e3672d478aae8c367bcdf9af15fb9 | [
"Apache-2.0"
] | 5 | 2019-06-06T15:11:37.000Z | 2021-06-07T08:23:23.000Z | # Copyright 2015 Hewlett-Packard
# 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 ... | 41.439791 | 78 | 0.61175 |
import hashlib
from oslo_log import log
from keystone.auth import core
from keystone.common import provider_api
import keystone.conf
from keystone import exception
from keystone.federation import constants as federation_constants
from keystone.federation import utils
from keystone.i18n import _
CONF ... | true | true |
f702ff17b34fbd489d3cfceaa9c5286e6c4611ca | 1,058 | py | Python | FLAAT/ch6/algo_6_3.py | colddrizzle/FLACT | d23ec807be3f5ea21cfa9a7a1499198d14681262 | [
"MIT"
] | null | null | null | FLAAT/ch6/algo_6_3.py | colddrizzle/FLACT | d23ec807be3f5ea21cfa9a7a1499198d14681262 | [
"MIT"
] | null | null | null | FLAAT/ch6/algo_6_3.py | colddrizzle/FLACT | d23ec807be3f5ea21cfa9a7a1499198d14681262 | [
"MIT"
] | null | null | null | # coding=utf-8
from common.BNFParser import *
from common.Grammar import Grammar
# 求文法G的可空变量集
# 该算法只跟G的P有关系
def algo_6_3(P):
"""
测试数据来源于第6章习题12(2)
>>> from common.production import Production
>>> p1 = Production(['S'], [['A', 'B', 'D', 'C']])
>>> p2 = Production(['A'], [['B', 'D'], ['\\"a\\"', '\... | 27.128205 | 81 | 0.464083 |
from common.BNFParser import *
from common.Grammar import Grammar
def algo_6_3(P):
simple_plist = []
for p in P:
simple_plist.extend(Production.toSimpleProduction(p))
old_u = set()
new_u = set()
for p in simple_plist:
if Production.isDirectEmpty(p):
new_u.add(p.left... | true | true |
f702ff27609b10993b2ffa9f4f5f3c2f75bb82b0 | 1,270 | py | Python | pyvisdk/do/host_file_system_volume.py | Infinidat/pyvisdk | f2f4e5f50da16f659ccc1d84b6a00f397fa997f8 | [
"MIT"
] | null | null | null | pyvisdk/do/host_file_system_volume.py | Infinidat/pyvisdk | f2f4e5f50da16f659ccc1d84b6a00f397fa997f8 | [
"MIT"
] | null | null | null | pyvisdk/do/host_file_system_volume.py | Infinidat/pyvisdk | f2f4e5f50da16f659ccc1d84b6a00f397fa997f8 | [
"MIT"
] | null | null | null |
import logging
from pyvisdk.exceptions import InvalidArgumentError
########################################
# Automatically generated, do not edit.
########################################
log = logging.getLogger(__name__)
def HostFileSystemVolume(vim, *args, **kwargs):
'''Detailed information about a file syst... | 35.277778 | 124 | 0.649606 |
import logging
from pyvisdk.exceptions import InvalidArgumentError
| true | true |
f702ffed102d32e3915d2369681024fbb76b53f6 | 1,994 | py | Python | backend/builder/build_db_node_mode.py | blast-eu-com/blast.eu.com | 90f14c694c0cc523949b553623a631bc0b202bd0 | [
"Apache-2.0"
] | null | null | null | backend/builder/build_db_node_mode.py | blast-eu-com/blast.eu.com | 90f14c694c0cc523949b553623a631bc0b202bd0 | [
"Apache-2.0"
] | null | null | null | backend/builder/build_db_node_mode.py | blast-eu-com/blast.eu.com | 90f14c694c0cc523949b553623a631bc0b202bd0 | [
"Apache-2.0"
] | null | null | null | #!../bin/python3
# -*- coding:utf-8 -*-
"""
Copyright 2021 Jerome DE LUCCHI
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 ... | 30.212121 | 174 | 0.664493 |
import os
import sys
import json
from env import _SERVER_DIR
sys.path.insert(0, _SERVER_DIR)
from api import db
__DATAMODEL_DIR = os.path.join(os.path.abspath('..'), 'datamodel')
__DATAMODEL_NODE_MODE_FILE = os.path.join(__DATAMODEL_DIR, 'node_mode.template.mapping')
__ES_ADDR = db.ES_PROTOCOL + """://""" + str(db.... | true | true |
f703000bbea298bd87b433179d83258c0772e508 | 756 | py | Python | flask/lib/python3.4/site-packages/sqlalchemy/ext/declarative/__init__.py | ddayguerrero/blogme | e6ee6a47310c382648eefd96634630c3bceb864f | [
"MIT"
] | 2 | 2016-04-03T06:30:45.000Z | 2017-05-22T08:36:54.000Z | flask/lib/python3.4/site-packages/sqlalchemy/ext/declarative/__init__.py | ddayguerrero/blogme | e6ee6a47310c382648eefd96634630c3bceb864f | [
"MIT"
] | null | null | null | flask/lib/python3.4/site-packages/sqlalchemy/ext/declarative/__init__.py | ddayguerrero/blogme | e6ee6a47310c382648eefd96634630c3bceb864f | [
"MIT"
] | 1 | 2021-11-04T22:07:43.000Z | 2021-11-04T22:07:43.000Z | # ext/declarative/__init__.py
# Copyright (C) 2005-2015 the SQLAlchemy authors and contributors
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
from .api import declarative_base, synonym_for, comparable_using, \
... | 39.789474 | 73 | 0.744709 |
from .api import declarative_base, synonym_for, comparable_using, \
instrument_declarative, ConcreteBase, AbstractConcreteBase, \
DeclarativeMeta, DeferredReflection, has_inherited_table,\
declared_attr, as_declarative
__all__ = ['declarative_base', 'synonym_for', 'has_inherited_table',
... | true | true |
f70300779170cca42d3422649546d22ba7c9f52f | 1,594 | py | Python | eelbrain/_stats/tests/test_spm.py | reddigari/Eelbrain | 6c02b99955d4b5dc7e3054042c182e1a4629b13c | [
"BSD-3-Clause"
] | null | null | null | eelbrain/_stats/tests/test_spm.py | reddigari/Eelbrain | 6c02b99955d4b5dc7e3054042c182e1a4629b13c | [
"BSD-3-Clause"
] | null | null | null | eelbrain/_stats/tests/test_spm.py | reddigari/Eelbrain | 6c02b99955d4b5dc7e3054042c182e1a4629b13c | [
"BSD-3-Clause"
] | null | null | null | # Author: Christian Brodbeck <christianbrodbeck@nyu.edu>
import pickle
from nose.tools import eq_
import numpy as np
from numpy.testing import assert_array_equal
from eelbrain import datasets
from eelbrain._stats.spm import LM, LMGroup
def test_lm():
ds = datasets.get_uts()
model = ds.eval("A*B*Y")
coeff... | 30.075472 | 89 | 0.598494 |
import pickle
from nose.tools import eq_
import numpy as np
from numpy.testing import assert_array_equal
from eelbrain import datasets
from eelbrain._stats.spm import LM, LMGroup
def test_lm():
ds = datasets.get_uts()
model = ds.eval("A*B*Y")
coeffs = ds['uts'].ols(model)
lm = LM('uts', 'A*B*Y', ds... | true | true |
f70301afabd0286d6dde0df8be28927b57a173c6 | 1,728 | py | Python | armada/exceptions/lint_exceptions.py | sktelecom-oslab/armada | ebc71ff8eca7ecf0560493d5cdafc14e34c783c9 | [
"Apache-2.0"
] | null | null | null | armada/exceptions/lint_exceptions.py | sktelecom-oslab/armada | ebc71ff8eca7ecf0560493d5cdafc14e34c783c9 | [
"Apache-2.0"
] | null | null | null | armada/exceptions/lint_exceptions.py | sktelecom-oslab/armada | ebc71ff8eca7ecf0560493d5cdafc14e34c783c9 | [
"Apache-2.0"
] | 2 | 2018-05-28T13:00:42.000Z | 2021-09-02T07:28:59.000Z | # Copyright 2017 The Armada Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in w... | 27.870968 | 74 | 0.735532 |
from armada.exceptions import base_exception
class LintException(base_exception.ArmadaBaseException):
message = 'An unknown linting error occurred.'
class InvalidManifestException(LintException):
message = 'Armada manifest invalid.'
class InvalidChartNameException(LintException):
mess... | true | true |
f70301cabf33a749c00bb53322ef295333499300 | 4,467 | py | Python | code-tf2/encoders/message_gcns/gcn_basis.py | manas96/RelationPrediction | 06be62a55554971d1b523dc555f4c8616c21c664 | [
"MIT"
] | null | null | null | code-tf2/encoders/message_gcns/gcn_basis.py | manas96/RelationPrediction | 06be62a55554971d1b523dc555f4c8616c21c664 | [
"MIT"
] | null | null | null | code-tf2/encoders/message_gcns/gcn_basis.py | manas96/RelationPrediction | 06be62a55554971d1b523dc555f4c8616c21c664 | [
"MIT"
] | null | null | null | import numpy as np
import tensorflow as tf
from common.shared_functions import dot_or_lookup, glorot_variance, make_tf_variable, make_tf_bias
from encoders.message_gcns.message_gcn import MessageGcn
class BasisGcn(MessageGcn):
def parse_settings(self):
self.dropout_keep_probability = float(self.settings... | 47.021053 | 122 | 0.74681 | import numpy as np
import tensorflow as tf
from common.shared_functions import dot_or_lookup, glorot_variance, make_tf_variable, make_tf_bias
from encoders.message_gcns.message_gcn import MessageGcn
class BasisGcn(MessageGcn):
def parse_settings(self):
self.dropout_keep_probability = float(self.settings... | true | true |
f70303ae169cee1d118069e7b9e0609229c086e8 | 3,699 | py | Python | cli.py | bormiopoli/mix_blockchain_network | bfa9a2b5f6d954883ffb6c3542989bfc272c5c20 | [
"MIT"
] | 1 | 2021-03-11T16:57:42.000Z | 2021-03-11T16:57:42.000Z | cli.py | bormiopoli/mix_blockchain_network | bfa9a2b5f6d954883ffb6c3542989bfc272c5c20 | [
"MIT"
] | null | null | null | cli.py | bormiopoli/mix_blockchain_network | bfa9a2b5f6d954883ffb6c3542989bfc272c5c20 | [
"MIT"
] | null | null | null | import hashlib
import datetime
import json
import uuid
from hashlib import sha256
from sys import version_info as pyVersion
from binascii import hexlify, unhexlify
from wallet import *
from func.send_message import send_message
from func.send_coin import send_coin
from func.node_connection import *
from lib... | 29.592 | 290 | 0.656394 | import hashlib
import datetime
import json
import uuid
from hashlib import sha256
from sys import version_info as pyVersion
from binascii import hexlify, unhexlify
from wallet import *
from func.send_message import send_message
from func.send_coin import send_coin
from func.node_connection import *
from lib... | true | true |
f70303d3f564d36a16f59efccc0cc2b001f36690 | 5,839 | py | Python | utils/flow.py | Leo-xxx/Deep-Flow-Guided-Video-Inpainting | fe58b6d0eaa3f9d59e9aca197d166b677a6a6c6a | [
"MIT"
] | 2,072 | 2019-05-10T01:39:24.000Z | 2022-03-31T05:44:34.000Z | utils/flow.py | RexBarker/Deep-Flow | 6310007009d2bfe150f1e4b29c7588f720c4bba2 | [
"MIT"
] | 94 | 2019-05-31T08:54:32.000Z | 2022-03-11T23:53:00.000Z | utils/flow.py | RexBarker/Deep-Flow | 6310007009d2bfe150f1e4b29c7588f720c4bba2 | [
"MIT"
] | 412 | 2019-05-10T05:47:48.000Z | 2022-03-21T07:19:01.000Z | import numpy as np
import cv2
def make_colorwheel():
'''
Generates a color wheel for optical flow visualization as presented in:
Baker et al. "A Database and Evaluation Methodology for Optical Flow" (ICCV, 2007)
URL: http://vision.middlebury.edu/flow/flowEval-iccv07.pdf
According to the C... | 31.224599 | 90 | 0.554033 | import numpy as np
import cv2
def make_colorwheel():
RY = 15
YG = 6
GC = 4
CB = 11
BM = 13
MR = 6
ncols = RY + YG + GC + CB + BM + MR
colorwheel = np.zeros((ncols, 3))
col = 0
colorwheel[0:RY, 0] = 255
colorwheel[0:RY, 1] = np.floor(255 * np.arange(0, RY) / RY)
... | true | true |
f70309b3062804015197c248bb55f8798addb560 | 9,360 | py | Python | pytorch/torch/distributed/launch.py | raghavnauhria/whatmt | c20483a437c82936cb0fb8080925e37b9c4bba87 | [
"MIT"
] | null | null | null | pytorch/torch/distributed/launch.py | raghavnauhria/whatmt | c20483a437c82936cb0fb8080925e37b9c4bba87 | [
"MIT"
] | 1 | 2019-07-22T09:48:46.000Z | 2019-07-22T09:48:46.000Z | pytorch/torch/distributed/launch.py | raghavnauhria/whatmt | c20483a437c82936cb0fb8080925e37b9c4bba87 | [
"MIT"
] | null | null | null | r"""
`torch.distributed.launch` is a module that spawns up multiple distributed
training processes on each of the training nodes.
The utility can be used for single-node distributed training, in which one or
more processes per node will be spawned. The utility can be used for either
CPU training or GPU training. If th... | 39.661017 | 93 | 0.65 |
import sys
import subprocess
import os
from argparse import ArgumentParser, REMAINDER
def parse_args():
parser = ArgumentParser(description="PyTorch distributed training launch "
"helper utilty that will spawn up "
"multiple distrib... | true | true |
f7030a2548771cfe1fc406bf93ce331585a26470 | 1,615 | py | Python | runtime/bamboo-pipeline/test/eri_imp_test_use/tests/control/test_retry_subprocess.py | DomineCore/bamboo-engine | fb4583e70f9e1e87d9d48c2393db8d8104306f37 | [
"MIT"
] | 1 | 2022-01-06T15:44:43.000Z | 2022-01-06T15:44:43.000Z | runtime/bamboo-pipeline/test/eri_imp_test_use/tests/control/test_retry_subprocess.py | DomineCore/bamboo-engine | fb4583e70f9e1e87d9d48c2393db8d8104306f37 | [
"MIT"
] | null | null | null | runtime/bamboo-pipeline/test/eri_imp_test_use/tests/control/test_retry_subprocess.py | DomineCore/bamboo-engine | fb4583e70f9e1e87d9d48c2393db8d8104306f37 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from bamboo_engine.builder import * # noqa
from bamboo_engine.engine import Engine
from pipeline.eri.runtime import BambooDjangoRuntime
from ..utils import * # noqa
def test_retry_subprocess():
subproc_start = EmptyStartEvent()
subproc_act = ServiceActivity(component_code="debug_no... | 29.907407 | 97 | 0.713313 |
from bamboo_engine.builder import *
from bamboo_engine.engine import Engine
from pipeline.eri.runtime import BambooDjangoRuntime
from ..utils import *
def test_retry_subprocess():
subproc_start = EmptyStartEvent()
subproc_act = ServiceActivity(component_code="debug_node")
subproc_end = EmptyEndEven... | true | true |
f7030a2f06200602ce7f131372fa021f6a707ddc | 2,066 | py | Python | pylearn2/cross_validation/blocks.py | BouchardLab/pylearn2 | 4cab785b870d22cd9e85a5f536d4cac234b6bf60 | [
"BSD-3-Clause"
] | 3 | 2018-04-05T21:24:54.000Z | 2021-09-14T01:48:36.000Z | pylearn2/cross_validation/blocks.py | BouchardLab/pylearn2 | 4cab785b870d22cd9e85a5f536d4cac234b6bf60 | [
"BSD-3-Clause"
] | null | null | null | pylearn2/cross_validation/blocks.py | BouchardLab/pylearn2 | 4cab785b870d22cd9e85a5f536d4cac234b6bf60 | [
"BSD-3-Clause"
] | 2 | 2018-02-18T14:46:57.000Z | 2019-05-03T11:51:45.000Z | """
Cross-validation with blocks.
"""
__author__ = "Steven Kearnes"
__copyright__ = "Copyright 2014, Stanford University"
__license__ = "3-clause BSD"
__maintainer__ = "Steven Kearnes"
from theano.compat.six.moves import xrange
from pylearn2.blocks import StackedBlocks
class StackedBlocksCV(object):
"""
Mul... | 27.918919 | 74 | 0.601162 |
__author__ = "Steven Kearnes"
__copyright__ = "Copyright 2014, Stanford University"
__license__ = "3-clause BSD"
__maintainer__ = "Steven Kearnes"
from theano.compat.six.moves import xrange
from pylearn2.blocks import StackedBlocks
class StackedBlocksCV(object):
def __init__(self, layers):
stacked_block... | true | true |
f7030bd71130c2a93c0694be9d3f5c477bbc3082 | 560 | py | Python | boilerplate/leads/migrations/0005_auto_20190512_1153.py | imciflam/electronic-document-management-system | f4db6be1e93204a3d09f0ebc09b7ba8bbdd90f77 | [
"MIT"
] | 1 | 2019-08-11T21:23:59.000Z | 2019-08-11T21:23:59.000Z | boilerplate/leads/migrations/0005_auto_20190512_1153.py | imciflam/electronic-document-management-system | f4db6be1e93204a3d09f0ebc09b7ba8bbdd90f77 | [
"MIT"
] | 5 | 2020-06-05T21:28:14.000Z | 2021-06-10T18:21:18.000Z | boilerplate/leads/migrations/0005_auto_20190512_1153.py | imciflam/electronic-document-management-system | f4db6be1e93204a3d09f0ebc09b7ba8bbdd90f77 | [
"MIT"
] | null | null | null | # Generated by Django 2.2.1 on 2019-05-12 08:53
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('leads', '0004_lead_documentstagecode'),
]
operations = [
migrations.AlterField(
model_name='lead',
name='email',
... | 23.333333 | 63 | 0.578571 |
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('leads', '0004_lead_documentstagecode'),
]
operations = [
migrations.AlterField(
model_name='lead',
name='email',
field=models.CharField(blank=True, max... | true | true |
f7030c00749497a837fcb1e598f6a89804856653 | 46,146 | py | Python | chia/wallet/wallet_node.py | loueradun/silicoin-blockchain | a199dd86ffb84f214ccd6192ad42d150badc05e1 | [
"Apache-2.0"
] | null | null | null | chia/wallet/wallet_node.py | loueradun/silicoin-blockchain | a199dd86ffb84f214ccd6192ad42d150badc05e1 | [
"Apache-2.0"
] | 4 | 2021-11-16T08:18:39.000Z | 2022-03-29T08:12:41.000Z | chia/wallet/wallet_node.py | Devh4ox4d/silishitcoin | 4372d06aa4a54220f2bde29c8081410503679a82 | [
"Apache-2.0"
] | null | null | null | import asyncio
import json
import logging
import socket
import time
import traceback
from pathlib import Path
from typing import Callable, Dict, List, Optional, Set, Tuple, Union
from blspy import PrivateKey
from chia.consensus.block_record import BlockRecord
from chia.consensus.blockchain_interface import BlockchainI... | 45.241176 | 118 | 0.616543 | import asyncio
import json
import logging
import socket
import time
import traceback
from pathlib import Path
from typing import Callable, Dict, List, Optional, Set, Tuple, Union
from blspy import PrivateKey
from chia.consensus.block_record import BlockRecord
from chia.consensus.blockchain_interface import BlockchainI... | true | true |
f7030ca21baff3a44a1489d617f958c1a15717d5 | 1,175 | py | Python | src/phiqnet/bin/train_resnet50_mos_fpn_attention_imageaug_koniq_small_finetune.py | junyongyou/lagt_vqa | 11aeda111ec4d97980db1e60f7b66b481266d1f3 | [
"MIT"
] | 9 | 2021-11-01T06:06:33.000Z | 2022-02-07T12:21:18.000Z | src/phiqnet/bin/train_resnet50_mos_fpn_attention_imageaug_koniq_small_finetune.py | junyongyou/lagt_vqa | 11aeda111ec4d97980db1e60f7b66b481266d1f3 | [
"MIT"
] | null | null | null | src/phiqnet/bin/train_resnet50_mos_fpn_attention_imageaug_koniq_small_finetune.py | junyongyou/lagt_vqa | 11aeda111ec4d97980db1e60f7b66b481266d1f3 | [
"MIT"
] | 1 | 2022-03-06T07:38:32.000Z | 2022-03-06T07:38:32.000Z | from phiqnet.train.train import train_main
if __name__ == '__main__':
args = {}
args['multi_gpu'] = 0
args['gpu'] = 0
args['result_folder'] = r'..\databases\experiments\koniq_small'
args['n_quality_levels'] = 1
args['train_folders'] = [#r'..\databases\train\koniq_normal',
... | 32.638889 | 114 | 0.591489 | from phiqnet.train.train import train_main
if __name__ == '__main__':
args = {}
args['multi_gpu'] = 0
args['gpu'] = 0
args['result_folder'] = r'..\databases\experiments\koniq_small'
args['n_quality_levels'] = 1
args['train_folders'] = [
r'..\databases\train\koniq_... | true | true |
f7030d07bc7c0ce56ea130285e2eff935e0bf461 | 30 | py | Python | anchor/__init__.py | forest-snow/anchor-topic | ad947f2ff6aefc28394531fa74ba3e94e5a01fc2 | [
"MIT"
] | 13 | 2019-02-14T15:55:55.000Z | 2022-03-03T01:01:28.000Z | anchor/__init__.py | gkaramanolakis/anchor-topic | e1637fa3965bfe14d8a5241b070c675bcdf4df18 | [
"MIT"
] | 1 | 2020-11-12T22:49:16.000Z | 2020-11-12T22:49:16.000Z | anchor/__init__.py | gkaramanolakis/anchor-topic | e1637fa3965bfe14d8a5241b070c675bcdf4df18 | [
"MIT"
] | 2 | 2019-02-14T15:26:56.000Z | 2021-08-21T02:37:53.000Z | import anchor
name = 'anchor' | 10 | 15 | 0.733333 | import anchor
name = 'anchor' | true | true |
f7030d0c7cff4eb5186658c4505f06314d86506a | 964 | py | Python | web_app/__init__.py | medamer/twitoff-class-practice | c02bcd81d420233b8db12daf168353a7660f0030 | [
"MIT"
] | null | null | null | web_app/__init__.py | medamer/twitoff-class-practice | c02bcd81d420233b8db12daf168353a7660f0030 | [
"MIT"
] | null | null | null | web_app/__init__.py | medamer/twitoff-class-practice | c02bcd81d420233b8db12daf168353a7660f0030 | [
"MIT"
] | null | null | null | # web_app/__init__.py
from flask import Flask
from web_app.models import db, migrate
from web_app.routes.home_routes import home_routes
from web_app.routes.book_routes import book_routes
DATABASE_URI = "sqlite:///twitoff_class.db" # using relative filepath
#DATABASE_URI = "sqlite:////Users/Username/Desktop/your-repo... | 34.428571 | 187 | 0.756224 |
from flask import Flask
from web_app.models import db, migrate
from web_app.routes.home_routes import home_routes
from web_app.routes.book_routes import book_routes
DATABASE_URI = "sqlite:///twitoff_class.db"
ATIONS"] = False
db.init_app(app)
migrate.init_app(app, db)
app.register_blueprint(home_route... | true | true |
f7030d1fc7c80f90ced33769b5b823d7d16ebf1a | 2,958 | py | Python | app/api/users.py | s-titoo/bloggger | 9d25e4421ffdcf2c616d7948746bc544ee77b3bc | [
"MIT"
] | null | null | null | app/api/users.py | s-titoo/bloggger | 9d25e4421ffdcf2c616d7948746bc544ee77b3bc | [
"MIT"
] | 16 | 2020-12-31T20:02:12.000Z | 2021-01-03T08:32:56.000Z | app/api/users.py | s-titoo/bloggger | 9d25e4421ffdcf2c616d7948746bc544ee77b3bc | [
"MIT"
] | null | null | null | from flask import jsonify, request, url_for, abort
from app import db
from app.api import bp
from app.api.auth import token_auth
from app.api.errors import bad_request
from app.models import User
@bp.route('/users/<int:id>', methods=['GET'])
@token_auth.login_required
def get_user(id):
return jsonify(User.query.ge... | 38.921053 | 79 | 0.671738 | from flask import jsonify, request, url_for, abort
from app import db
from app.api import bp
from app.api.auth import token_auth
from app.api.errors import bad_request
from app.models import User
@bp.route('/users/<int:id>', methods=['GET'])
@token_auth.login_required
def get_user(id):
return jsonify(User.query.ge... | true | true |
f7030d57b6f7f41fc5ad8fdacb642095d4dd9445 | 3,242 | py | Python | src/py/breakpoint_splitter.py | marbl/VALET | d3a433690b70288f42e47d096dfcd5370ddf04ce | [
"MIT"
] | 12 | 2016-01-29T10:58:52.000Z | 2020-11-02T00:39:15.000Z | src/py/breakpoint_splitter.py | marbl/VALET | d3a433690b70288f42e47d096dfcd5370ddf04ce | [
"MIT"
] | 9 | 2016-01-29T12:04:00.000Z | 2021-12-06T12:30:12.000Z | src/py/breakpoint_splitter.py | marbl/VALET | d3a433690b70288f42e47d096dfcd5370ddf04ce | [
"MIT"
] | 5 | 2017-07-20T21:47:47.000Z | 2022-01-24T09:07:04.000Z | #!/usr/bin/env python
from __future__ import print_function
from optparse import OptionParser
import os
import sys
class ReadsSplitter:
def __init__(self):
self.options = None
self.files_to_split = []
self.getOptions()
def go(self):
for fn in self.files_to_split:
... | 27.474576 | 82 | 0.537631 |
from __future__ import print_function
from optparse import OptionParser
import os
import sys
class ReadsSplitter:
def __init__(self):
self.options = None
self.files_to_split = []
self.getOptions()
def go(self):
for fn in self.files_to_split:
self.splitFile(fn)
... | true | true |
f7030ff12b6ef50e1672d30b3059987601d2c469 | 6,435 | py | Python | qualcoder/GUI/information.py | qwertygc/QualCoder | 2a4820f4de7a2ddf1a629336c74e534c20bdb5d9 | [
"MIT"
] | null | null | null | qualcoder/GUI/information.py | qwertygc/QualCoder | 2a4820f4de7a2ddf1a629336c74e534c20bdb5d9 | [
"MIT"
] | null | null | null | qualcoder/GUI/information.py | qwertygc/QualCoder | 2a4820f4de7a2ddf1a629336c74e534c20bdb5d9 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
'''
Copyright (c) 2019 Colin Curtain
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, mer... | 45.316901 | 119 | 0.724476 |
from PyQt5 import QtWidgets, QtCore
import os
import sys
import logging
import traceback
from GUI.ui_dialog_information import Ui_Dialog_information
path = os.path.abspath(os.path.dirname(__file__))
logger = logging.getLogger(__name__)
def exception_handler(exception_type, value, tb_obj):
tb = '\n'.join(trace... | true | true |
f7030ff8aada85e06d45e7775f87f399f8143230 | 4,774 | py | Python | sdk/lusid/models/resource_list_of_portfolio.py | inwaves/lusid-sdk-python | 9ad2cfc71c998928bf23f54ce0821a8ea2db556b | [
"MIT"
] | null | null | null | sdk/lusid/models/resource_list_of_portfolio.py | inwaves/lusid-sdk-python | 9ad2cfc71c998928bf23f54ce0821a8ea2db556b | [
"MIT"
] | null | null | null | sdk/lusid/models/resource_list_of_portfolio.py | inwaves/lusid-sdk-python | 9ad2cfc71c998928bf23f54ce0821a8ea2db556b | [
"MIT"
] | null | null | null | # coding: utf-8
"""
LUSID API
FINBOURNE Technology # noqa: E501
The version of the OpenAPI document: 0.11.2342
Contact: info@finbourne.com
Generated by: https://openapi-generator.tech
"""
import pprint
import re # noqa: F401
import six
class ResourceListOfPortfolio(object):
"""NOTE: Thi... | 26.230769 | 92 | 0.55886 |
import pprint
import re
import six
class ResourceListOfPortfolio(object):
openapi_types = {
'values': 'list[Portfolio]',
'href': 'str',
'links': 'list[Link]'
}
attribute_map = {
'values': 'values',
'href': 'href',
'links': 'links'
}
required... | true | true |
f703111c2592fb6a5ff0565da71ea5e703eed890 | 2,449 | py | Python | env/lib/python3.5/site-packages/cartopy/tests/crs/test_utm.py | project-pantheon/pantheon_glob_planner | c0d50a53b36c4678192ec75ad7a4cd68c570daef | [
"BSD-3-Clause"
] | null | null | null | env/lib/python3.5/site-packages/cartopy/tests/crs/test_utm.py | project-pantheon/pantheon_glob_planner | c0d50a53b36c4678192ec75ad7a4cd68c570daef | [
"BSD-3-Clause"
] | null | null | null | env/lib/python3.5/site-packages/cartopy/tests/crs/test_utm.py | project-pantheon/pantheon_glob_planner | c0d50a53b36c4678192ec75ad7a4cd68c570daef | [
"BSD-3-Clause"
] | null | null | null | # (C) British Crown Copyright 2018, Met Office
#
# This file is part of cartopy.
#
# cartopy is free software: you can redistribute it and/or modify it under
# the terms of the GNU Lesser General Public License as published by the
# Free Software Foundation, either version 3 of the License, or
# (at your option) any la... | 34.013889 | 74 | 0.687219 |
from __future__ import (absolute_import, division, print_function)
import numpy as np
from numpy.testing import assert_almost_equal
import pytest
import cartopy.crs as ccrs
def check_proj4_params(crs, other_args):
expected = other_args | {'proj=utm', 'no_defs', 'units=m'}
pro4_params = set(... | true | true |
f70311994dbab78603982c61136ce7e7f1832098 | 87 | py | Python | .history/main_20210629130424.py | Aleff13/calculadora-tkinter | 01e169d3c1d128976eb3a41ea1f53f11d6157e44 | [
"MIT"
] | null | null | null | .history/main_20210629130424.py | Aleff13/calculadora-tkinter | 01e169d3c1d128976eb3a41ea1f53f11d6157e44 | [
"MIT"
] | null | null | null | .history/main_20210629130424.py | Aleff13/calculadora-tkinter | 01e169d3c1d128976eb3a41ea1f53f11d6157e44 | [
"MIT"
] | null | null | null | from Calculator import make_root
def main
if __name__ == '__main__':
main()
| 10.875 | 32 | 0.666667 | from Calculator import make_root
def main
if __name__ == '__main__':
main()
| false | true |
f70311ade7985cc89c566ef969d4f9af213d0e28 | 35,786 | py | Python | vnpy/app/cta_backtester/ui/widget.py | IcyCC/vnpy | 04f6ec013daddde2df36590625e0533e260b4bc1 | [
"MIT"
] | 2 | 2020-04-20T15:02:11.000Z | 2022-01-21T03:29:01.000Z | vnpy/app/cta_backtester/ui/widget.py | IcyCC/vnpy | 04f6ec013daddde2df36590625e0533e260b4bc1 | [
"MIT"
] | null | null | null | vnpy/app/cta_backtester/ui/widget.py | IcyCC/vnpy | 04f6ec013daddde2df36590625e0533e260b4bc1 | [
"MIT"
] | 5 | 2019-10-26T06:03:26.000Z | 2020-02-28T13:31:42.000Z | import numpy as np
import pyqtgraph as pg
from datetime import datetime, timedelta
from vnpy.trader.constant import Interval, Direction, Offset
from vnpy.trader.engine import MainEngine
from vnpy.trader.ui import QtCore, QtWidgets, QtGui
from vnpy.trader.ui.widget import BaseMonitor, BaseCell, DirectionCell, EnumCell
... | 31.118261 | 91 | 0.592494 | import numpy as np
import pyqtgraph as pg
from datetime import datetime, timedelta
from vnpy.trader.constant import Interval, Direction, Offset
from vnpy.trader.engine import MainEngine
from vnpy.trader.ui import QtCore, QtWidgets, QtGui
from vnpy.trader.ui.widget import BaseMonitor, BaseCell, DirectionCell, EnumCell
... | true | true |
f70311ba62056f0a9cdf1f81dd1ad123f6427c5a | 1,992 | py | Python | 677.map-sum-pairs.py | y1zhou/leetcode | 4c24952b0fa228027f81fdd28fad0e6e662193d2 | [
"MIT"
] | null | null | null | 677.map-sum-pairs.py | y1zhou/leetcode | 4c24952b0fa228027f81fdd28fad0e6e662193d2 | [
"MIT"
] | null | null | null | 677.map-sum-pairs.py | y1zhou/leetcode | 4c24952b0fa228027f81fdd28fad0e6e662193d2 | [
"MIT"
] | null | null | null | #
# @lc app=leetcode id=677 lang=python3
#
# [677] Map Sum Pairs
# https://leetcode.com/problems/map-sum-pairs/
# This problem is about the trie data structure. Each node keeps track of the sum of its children.
# A new key overrides the original values.
#
import unittest
from typing import Dict
# @lc code=s... | 26.918919 | 99 | 0.553213 |
import unittest
from typing import Dict
class Node:
def __init__(self, val: int = 0):
self.value = val
self.children: Dict[str, Node] = {}
class MapSum:
def __init__(self) -> None:
self.root_node = Node()
self.keys: Dict[str, int] = {}
def insert(se... | true | true |
f70311d0ab6c7fe8c230f261fb16c43b3d1544f1 | 4,658 | py | Python | sdk/python/pulumi_azure_nextgen/security/v20170801preview/get_security_contact.py | pulumi/pulumi-azure-nextgen | 452736b0a1cf584c2d4c04666e017af6e9b2c15c | [
"Apache-2.0"
] | 31 | 2020-09-21T09:41:01.000Z | 2021-02-26T13:21:59.000Z | sdk/python/pulumi_azure_nextgen/security/v20170801preview/get_security_contact.py | pulumi/pulumi-azure-nextgen | 452736b0a1cf584c2d4c04666e017af6e9b2c15c | [
"Apache-2.0"
] | 231 | 2020-09-21T09:38:45.000Z | 2021-03-01T11:16:03.000Z | sdk/python/pulumi_azure_nextgen/security/v20170801preview/get_security_contact.py | pulumi/pulumi-azure-nextgen | 452736b0a1cf584c2d4c04666e017af6e9b2c15c | [
"Apache-2.0"
] | 4 | 2020-09-29T14:14:59.000Z | 2021-02-10T20:38:16.000Z | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union
from ... import _utilities, _tables
__a... | 33.035461 | 154 | 0.644912 |
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union
from ... import _utilities, _tables
__all__ = [
'GetSecurityContactResult',
'AwaitableGetSecurityContactResult',
'get_security_contact',
]
@pulumi.output_type
class GetSecurityContactResult:
... | true | true |
f70311fcd044270860c9185e5d92b8e64abc2b05 | 11,544 | py | Python | src/localimport/__init__.py | NiklasRosenstein/python-localimport | a51722387cf03fa4c5ff859cc17419a25e280e35 | [
"MIT"
] | 5 | 2015-04-11T19:34:12.000Z | 2016-07-27T20:08:38.000Z | src/localimport/__init__.py | nrosenstein-stuff/py-localimport | a51722387cf03fa4c5ff859cc17419a25e280e35 | [
"MIT"
] | 15 | 2015-07-03T11:31:08.000Z | 2016-01-22T16:20:40.000Z | src/localimport/__init__.py | nrosenstein-stuff/py-localimport | a51722387cf03fa4c5ff859cc17419a25e280e35 | [
"MIT"
] | null | null | null |
__author__ = 'Niklas Rosenstein <rosensteinniklas@gmail.com>'
__version__ = '1.7.6'
import copy
import glob
import os
import pkgutil
import sys
import traceback
import typing as t
import zipfile
if t.TYPE_CHECKING:
from sys import _MetaPathFinder
def is_local(filename: str, pathlist: t.List[str]) -> bool:
''' ... | 33.754386 | 110 | 0.649948 |
__author__ = 'Niklas Rosenstein <rosensteinniklas@gmail.com>'
__version__ = '1.7.6'
import copy
import glob
import os
import pkgutil
import sys
import traceback
import typing as t
import zipfile
if t.TYPE_CHECKING:
from sys import _MetaPathFinder
def is_local(filename: str, pathlist: t.List[str]) -> bool:
fil... | true | true |
f7031222207e58ab6b118aabf23323dbda72761a | 1,391 | py | Python | svhn/evaluate_calibration.py | mvaldenegro/paper-subensembles-image-classification | cc3a6567b1de82b9bfb1612ad8d0e73cdd7ae09b | [
"BSD-3-Clause"
] | 5 | 2020-06-04T19:54:29.000Z | 2021-12-13T06:19:48.000Z | svhn/evaluate_calibration.py | mvaldenegro/paper-subensembles-image-classification | cc3a6567b1de82b9bfb1612ad8d0e73cdd7ae09b | [
"BSD-3-Clause"
] | null | null | null | svhn/evaluate_calibration.py | mvaldenegro/paper-subensembles-image-classification | cc3a6567b1de82b9bfb1612ad8d0e73cdd7ae09b | [
"BSD-3-Clause"
] | null | null | null | import numpy as np
import h5py
import pandas as pd
from svhn_io import load_svhn
from keras_uncertainty.utils import classifier_calibration_curve, classifier_calibration_error
EPSILON = 1e-10
def load_hdf5_data(filename):
inp = h5py.File(filename, "r")
preds = inp["preds"][...]
inp.close()
return p... | 33.119048 | 104 | 0.716751 | import numpy as np
import h5py
import pandas as pd
from svhn_io import load_svhn
from keras_uncertainty.utils import classifier_calibration_curve, classifier_calibration_error
EPSILON = 1e-10
def load_hdf5_data(filename):
inp = h5py.File(filename, "r")
preds = inp["preds"][...]
inp.close()
return p... | true | true |
f70312775afc4e4d6e8b475e09fdec40312d7ceb | 846 | py | Python | test/test_tracks.py | dpitch40/rockawayplayer | 534b5dc5ca709b6f46696d55e18631d4ffaed903 | [
"MIT"
] | null | null | null | test/test_tracks.py | dpitch40/rockawayplayer | 534b5dc5ca709b6f46696d55e18631d4ffaed903 | [
"MIT"
] | null | null | null | test/test_tracks.py | dpitch40/rockawayplayer | 534b5dc5ca709b6f46696d55e18631d4ffaed903 | [
"MIT"
] | null | null | null | from unittest import TestCase
from rockaway.models import Track
class TestTrackBasics(TestCase):
def test_track_create_no_args(self):
track = Track()
self.assertFalse(track.hasDbEntry())
self.assertFalse(track.hasFile())
def test_track_create(self):
args = {"Title": "Rockaw... | 30.214286 | 89 | 0.601655 | from unittest import TestCase
from rockaway.models import Track
class TestTrackBasics(TestCase):
def test_track_create_no_args(self):
track = Track()
self.assertFalse(track.hasDbEntry())
self.assertFalse(track.hasFile())
def test_track_create(self):
args = {"Title": "Rockaw... | true | true |
f70312c9886f2d7f39781658427518a8d2976831 | 24,253 | py | Python | numba/targets/npyimpl.py | tolysz/numba | d7953a18dbf5ea231dc16e967ce8e9b754578ea6 | [
"Apache-2.0",
"BSD-2-Clause"
] | null | null | null | numba/targets/npyimpl.py | tolysz/numba | d7953a18dbf5ea231dc16e967ce8e9b754578ea6 | [
"Apache-2.0",
"BSD-2-Clause"
] | 1 | 2019-02-11T13:46:30.000Z | 2019-02-11T13:46:30.000Z | numba/targets/npyimpl.py | asodeur/numba | d7953a18dbf5ea231dc16e967ce8e9b754578ea6 | [
"Apache-2.0",
"BSD-2-Clause"
] | null | null | null | """
Implementation of functions in the Numpy package.
"""
import math
import sys
import itertools
from collections import namedtuple
from llvmlite.llvmpy import core as lc
import numpy as np
import operator
from . import builtins, callconv, ufunc_db, arrayobj
from .imputils import Registry, impl_ret_new_ref, force... | 40.153974 | 92 | 0.641364 |
import math
import sys
import itertools
from collections import namedtuple
from llvmlite.llvmpy import core as lc
import numpy as np
import operator
from . import builtins, callconv, ufunc_db, arrayobj
from .imputils import Registry, impl_ret_new_ref, force_error_model
from .. import typing, types, cgutils, numpy_... | true | true |
f703131bb20bf6a376a2a9e06ef04e947ce3981c | 1,321 | py | Python | setup.py | anobi/django-oauth-api | 95bf9b500dab326553a5a8a17d5c6da1a34f6ac4 | [
"BSD-2-Clause"
] | null | null | null | setup.py | anobi/django-oauth-api | 95bf9b500dab326553a5a8a17d5c6da1a34f6ac4 | [
"BSD-2-Clause"
] | null | null | null | setup.py | anobi/django-oauth-api | 95bf9b500dab326553a5a8a17d5c6da1a34f6ac4 | [
"BSD-2-Clause"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from setuptools import setup, find_packages
import os
import re
def get_version(package):
"""
Return package version as listed in `__version__` in `init.py`.
"""
init_py = open(os.path.join(package, '__init__.py')).read()
return re.match("__version__ ... | 27.520833 | 74 | 0.623013 |
from setuptools import setup, find_packages
import os
import re
def get_version(package):
init_py = open(os.path.join(package, '__init__.py')).read()
return re.match("__version__ = ['\"]([^'\"]+)['\"]", init_py).group(1)
version = get_version('oauth_api')
setup(
name="django-oauth-api",
version... | true | true |
f70313ad1800d1fbedaa2338bc9ced0d636179d5 | 537 | py | Python | events/admin.py | the-mandarine/mypanamsquad | b34c1c6169a3b7496e171b9536472a1ede0bdc84 | [
"Beerware"
] | null | null | null | events/admin.py | the-mandarine/mypanamsquad | b34c1c6169a3b7496e171b9536472a1ede0bdc84 | [
"Beerware"
] | null | null | null | events/admin.py | the-mandarine/mypanamsquad | b34c1c6169a3b7496e171b9536472a1ede0bdc84 | [
"Beerware"
] | null | null | null | from django.contrib import admin
from events.models import Place, Event, Attendance
# Register your models here.
class EventAdmin(admin.ModelAdmin):
filter_horizontal = ('expected_members', )
class AttendanceAdmin(admin.ModelAdmin):
list_display = ('event__name', 'member', 'attendance', 'proxy_to', 'accepted'... | 29.833333 | 83 | 0.746741 | from django.contrib import admin
from events.models import Place, Event, Attendance
class EventAdmin(admin.ModelAdmin):
filter_horizontal = ('expected_members', )
class AttendanceAdmin(admin.ModelAdmin):
list_display = ('event__name', 'member', 'attendance', 'proxy_to', 'accepted',)
list_filter = ('event... | true | true |
f703143bb336a96fa5c3b2d5b48b35b68a8fb16a | 969 | py | Python | test_factorial_example.py | gaoshanyu/web_ui_test_sample | 8a6cc9b54b5f728af7ef0725dea42d759bd115d0 | [
"MIT"
] | null | null | null | test_factorial_example.py | gaoshanyu/web_ui_test_sample | 8a6cc9b54b5f728af7ef0725dea42d759bd115d0 | [
"MIT"
] | null | null | null | test_factorial_example.py | gaoshanyu/web_ui_test_sample | 8a6cc9b54b5f728af7ef0725dea42d759bd115d0 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Created at 03/09/2020
__author__ = 'raniys'
import math
import pytest
from factorial_example import factorial_function
@pytest.mark.sample
def test_factorial_functionality():
print("Inside test_factorial_functionality")
assert factorial_function(0) == 1
assert factorial_func... | 23.634146 | 59 | 0.716202 |
__author__ = 'raniys'
import math
import pytest
from factorial_example import factorial_function
@pytest.mark.sample
def test_factorial_functionality():
print("Inside test_factorial_functionality")
assert factorial_function(0) == 1
assert factorial_function(4) == 24
@pytest.mark.sample
def test_s... | true | true |
f70314d2b61bace541c7746ae96937b488fdab30 | 1,434 | py | Python | FlaskAPI/PullLoLDataAssets.py | ItsViridae/LoLApiWrapper | f84c2bbb8f3e2e42e7b0e17c137c561727f045a3 | [
"MIT"
] | null | null | null | FlaskAPI/PullLoLDataAssets.py | ItsViridae/LoLApiWrapper | f84c2bbb8f3e2e42e7b0e17c137c561727f045a3 | [
"MIT"
] | 3 | 2021-10-06T18:40:51.000Z | 2022-02-27T06:30:39.000Z | FlaskAPI/PullLoLDataAssets.py | ItsViridae/LoLApiWrapper | f84c2bbb8f3e2e42e7b0e17c137c561727f045a3 | [
"MIT"
] | null | null | null | import requests
import json
# Get Current Patch
def getCurrentVersion():
versionResponse = requests.get("https://ddragon.leagueoflegends.com/api/versions.json")
version_patch_RawData = versionResponse.json()
currentVersion = version_patch_RawData[0]
print(currentVersion)
return currentVersion
#cham... | 33.348837 | 106 | 0.739191 | import requests
import json
def getCurrentVersion():
versionResponse = requests.get("https://ddragon.leagueoflegends.com/api/versions.json")
version_patch_RawData = versionResponse.json()
currentVersion = version_patch_RawData[0]
print(currentVersion)
return currentVersion
def GetDDragonData_Cham... | true | true |
f7031633e36d301952c1bcfad443c0b4e0b34d97 | 2,839 | py | Python | neuro_scripts/manual_rigid_body/manual_rigid_body.py | NicoleEic/projects | 028a4bb4b49539fc98b442f0a2f9434e95c94561 | [
"MIT"
] | 9 | 2019-09-10T19:41:29.000Z | 2022-03-03T21:29:11.000Z | neuro_scripts/manual_rigid_body/manual_rigid_body.py | NicoleEic/projects | 028a4bb4b49539fc98b442f0a2f9434e95c94561 | [
"MIT"
] | null | null | null | neuro_scripts/manual_rigid_body/manual_rigid_body.py | NicoleEic/projects | 028a4bb4b49539fc98b442f0a2f9434e95c94561 | [
"MIT"
] | 4 | 2019-09-10T19:41:37.000Z | 2020-11-26T13:51:55.000Z | import numpy as np
import nibabel as nib
import os
import sys
sys.path.append(os.path.dirname(os.path.abspath(__file__)) + '/../../')
from my_functions.matrix_stuff import *
def manual_rigid_body(fname = 'example_brain.nii.gz',
outmat = 'transformation.mat',
outimg = 'example_... | 39.985915 | 118 | 0.641071 | import numpy as np
import nibabel as nib
import os
import sys
sys.path.append(os.path.dirname(os.path.abspath(__file__)) + '/../../')
from my_functions.matrix_stuff import *
def manual_rigid_body(fname = 'example_brain.nii.gz',
outmat = 'transformation.mat',
outimg = 'example_... | true | true |
f7031875b5b2ac17eb7490db6305e5cad29a4261 | 2,636 | py | Python | model/contact.py | agakax/qa-courses-python-training | d523d5543c947ed449cd2d1109cac2eeac390f7b | [
"Apache-2.0"
] | null | null | null | model/contact.py | agakax/qa-courses-python-training | d523d5543c947ed449cd2d1109cac2eeac390f7b | [
"Apache-2.0"
] | null | null | null | model/contact.py | agakax/qa-courses-python-training | d523d5543c947ed449cd2d1109cac2eeac390f7b | [
"Apache-2.0"
] | null | null | null | from sys import maxsize
class Contact:
def __init__(self, first_name=None, middle_name=None, last_name=None, nickname=None,
photo_path=None, photo_delete=False, title=None, company=None, address=None,
telephones_all=None, telephone_home=None,
telephone_mobile=No... | 42.516129 | 113 | 0.658194 | from sys import maxsize
class Contact:
def __init__(self, first_name=None, middle_name=None, last_name=None, nickname=None,
photo_path=None, photo_delete=False, title=None, company=None, address=None,
telephones_all=None, telephone_home=None,
telephone_mobile=No... | true | true |
f703195775c624f40961822a40021754ea2a5f14 | 1,037 | py | Python | api/insights/insights/infrastructure/mysql/orm/mapper_base.py | manisharmagarg/qymatix | 0dc240970359429ae5105db79f9aebf1a99ba6fd | [
"Apache-2.0"
] | null | null | null | api/insights/insights/infrastructure/mysql/orm/mapper_base.py | manisharmagarg/qymatix | 0dc240970359429ae5105db79f9aebf1a99ba6fd | [
"Apache-2.0"
] | null | null | null | api/insights/insights/infrastructure/mysql/orm/mapper_base.py | manisharmagarg/qymatix | 0dc240970359429ae5105db79f9aebf1a99ba6fd | [
"Apache-2.0"
] | null | null | null | import os
from sqlalchemy import create_engine
from sqlalchemy.orm import sessionmaker
from .base import Base
class MapperBase():
user = os.getenv("MYSQL_USER")
key = os.getenv("MYSQL_KEY")
host = os.getenv("MYSQL_HOST")
port = os.getenv("MYSQL_PORT")
def __init__(self, database):
self.... | 23.568182 | 63 | 0.518804 | import os
from sqlalchemy import create_engine
from sqlalchemy.orm import sessionmaker
from .base import Base
class MapperBase():
user = os.getenv("MYSQL_USER")
key = os.getenv("MYSQL_KEY")
host = os.getenv("MYSQL_HOST")
port = os.getenv("MYSQL_PORT")
def __init__(self, database):
self.... | true | true |
f70319818fe0c206bb6a70d962347496013770a1 | 8,525 | py | Python | microscopeimagequality/miq.py | finkbeiner-lab/microscopeimagequality | 4190ba36d7e672e7b430516b7c3a59c8294efe0b | [
"Apache-2.0"
] | null | null | null | microscopeimagequality/miq.py | finkbeiner-lab/microscopeimagequality | 4190ba36d7e672e7b430516b7c3a59c8294efe0b | [
"Apache-2.0"
] | null | null | null | microscopeimagequality/miq.py | finkbeiner-lab/microscopeimagequality | 4190ba36d7e672e7b430516b7c3a59c8294efe0b | [
"Apache-2.0"
] | null | null | null | """
Contains the Miq model definition. Based on MNIST.
The model in this file is a simple convolutional network with two
convolutional layers, two pooling layers, followed by two fully connected
layers. A single dropout layer is used between the two fully connected layers.
"""
import logging
import os
import pkg_reso... | 40.595238 | 109 | 0.715191 | """
Contains the Miq model definition. Based on MNIST.
The model in this file is a simple convolutional network with two
convolutional layers, two pooling layers, followed by two fully connected
layers. A single dropout layer is used between the two fully connected layers.
"""
import logging
import os
import pkg_reso... | false | true |
f7031a7684f35f0454e3dca92a763da2ae157341 | 1,774 | py | Python | homophily_structural_balance/plotting/plot_positive_edge_density.py | robertjankowski/reproducing-dl-papers | 01ad85eac333b87358b3d2e2276292333cacf0e0 | [
"Apache-2.0"
] | 2 | 2021-06-06T09:45:33.000Z | 2021-06-07T20:00:33.000Z | homophily_structural_balance/plotting/plot_positive_edge_density.py | robertjankowski/reproducing-dl-papers | 01ad85eac333b87358b3d2e2276292333cacf0e0 | [
"Apache-2.0"
] | null | null | null | homophily_structural_balance/plotting/plot_positive_edge_density.py | robertjankowski/reproducing-dl-papers | 01ad85eac333b87358b3d2e2276292333cacf0e0 | [
"Apache-2.0"
] | 2 | 2021-06-03T01:40:28.000Z | 2021-06-07T06:56:18.000Z | import numpy as np
import matplotlib.pyplot as plt
import argparse
def extract_name(word: str):
return word.split('=')[-1]
def extract_info(filename: str):
filename_splitted = filename.split('_')
assert len(filename_splitted) == 7
p = float(extract_name(filename_splitted[1]))
iterations = int(ex... | 31.678571 | 118 | 0.678692 | import numpy as np
import matplotlib.pyplot as plt
import argparse
def extract_name(word: str):
return word.split('=')[-1]
def extract_info(filename: str):
filename_splitted = filename.split('_')
assert len(filename_splitted) == 7
p = float(extract_name(filename_splitted[1]))
iterations = int(ex... | true | true |
f7031adca49813ee2cc217720e95574a56a10092 | 12,014 | py | Python | src/pretix/control/forms/organizer.py | inwwin/pretix | c3bfb57d3e46577f54c1a32c7a8b61df570c272e | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | src/pretix/control/forms/organizer.py | inwwin/pretix | c3bfb57d3e46577f54c1a32c7a8b61df570c272e | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | src/pretix/control/forms/organizer.py | inwwin/pretix | c3bfb57d3e46577f54c1a32c7a8b61df570c272e | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | from decimal import Decimal
from urllib.parse import urlparse
from django import forms
from django.conf import settings
from django.core.exceptions import ValidationError
from django.db.models import Q
from django.utils.safestring import mark_safe
from django.utils.translation import gettext_lazy as _, pgettext_lazy
f... | 35.128655 | 120 | 0.601049 | from decimal import Decimal
from urllib.parse import urlparse
from django import forms
from django.conf import settings
from django.core.exceptions import ValidationError
from django.db.models import Q
from django.utils.safestring import mark_safe
from django.utils.translation import gettext_lazy as _, pgettext_lazy
f... | true | true |
f7031ae29ebda06156f8cc75f97ef136dd445efa | 2,109 | py | Python | setup.py | alphamodel/yagmail | e9efc4a68eee00f76929e72c55fb00dda0c1a57f | [
"MIT"
] | null | null | null | setup.py | alphamodel/yagmail | e9efc4a68eee00f76929e72c55fb00dda0c1a57f | [
"MIT"
] | null | null | null | setup.py | alphamodel/yagmail | e9efc4a68eee00f76929e72c55fb00dda0c1a57f | [
"MIT"
] | null | null | null | from setuptools import setup
from setuptools import find_packages
with open('README.rst') as f:
LONG_DESCRIPTION = f.read()
MAJOR_VERSION = '0'
MINOR_VERSION = '11'
MICRO_VERSION = '214'
VERSION = "{}.{}.{}".format(MAJOR_VERSION, MINOR_VERSION, MICRO_VERSION)
setup(name='yagmail',
version=VERSION,
des... | 37.660714 | 73 | 0.593646 | from setuptools import setup
from setuptools import find_packages
with open('README.rst') as f:
LONG_DESCRIPTION = f.read()
MAJOR_VERSION = '0'
MINOR_VERSION = '11'
MICRO_VERSION = '214'
VERSION = "{}.{}.{}".format(MAJOR_VERSION, MINOR_VERSION, MICRO_VERSION)
setup(name='yagmail',
version=VERSION,
des... | true | true |
f7031bfec8253f6b020eb032f3bd13f778dd8ea5 | 3,454 | py | Python | orio-0.1.0/src/module/loop/submodule/pragma/pragma.py | nn4ip/pluto | 92ace2441b6b8d6b66d1bb7ef3e893df4ff23a4d | [
"MIT"
] | 183 | 2017-01-28T17:23:29.000Z | 2022-03-25T08:58:56.000Z | orio-0.1.0/src/module/loop/submodule/pragma/pragma.py | nn4ip/pluto | 92ace2441b6b8d6b66d1bb7ef3e893df4ff23a4d | [
"MIT"
] | 70 | 2017-03-29T09:51:04.000Z | 2021-12-28T07:00:44.000Z | orio-0.1.0/src/module/loop/submodule/pragma/pragma.py | nn4ip/pluto | 92ace2441b6b8d6b66d1bb7ef3e893df4ff23a4d | [
"MIT"
] | 57 | 2017-03-29T07:27:58.000Z | 2022-01-14T03:13:39.000Z | #
# Loop transformation submodule that enables pragma directive insertions.
#
import sys
import module.loop.submodule.submodule, transformator
#---------------------------------------------------------------------
class Pragma(module.loop.submodule.submodule.SubModule):
'''The pragma directive insertion submodul... | 33.211538 | 97 | 0.549218 |
import sys
import module.loop.submodule.submodule, transformator
class Pragma(module.loop.submodule.submodule.SubModule):
'''The pragma directive insertion submodule'''
def __init__(self, perf_params = None, transf_args = None, stmt = None):
'''To instantiate a pragma insertion submodule'''
... | false | true |
f7031c33be2f4d13a9a63447e0ba6d1507b76692 | 1,334 | py | Python | examples/csrf-protection/app.py | TheNcar/starlette-wtf | f96ab6f33a7ffcb576663f996dbb401ab44f3d78 | [
"MIT"
] | 48 | 2020-02-03T14:16:34.000Z | 2022-02-24T08:27:06.000Z | examples/csrf-protection/app.py | TheNcar/starlette-wtf | f96ab6f33a7ffcb576663f996dbb401ab44f3d78 | [
"MIT"
] | 10 | 2020-04-20T21:20:02.000Z | 2022-01-29T16:58:44.000Z | examples/csrf-protection/app.py | TheNcar/starlette-wtf | f96ab6f33a7ffcb576663f996dbb401ab44f3d78 | [
"MIT"
] | 5 | 2020-04-23T12:39:32.000Z | 2022-03-20T08:14:19.000Z | from jinja2 import Template
from starlette.applications import Starlette
from starlette.middleware import Middleware
from starlette.middleware.sessions import SessionMiddleware
from starlette.responses import PlainTextResponse, HTMLResponse
from starlette_wtf import StarletteForm, CSRFProtectMiddleware, csrf_protect
fr... | 26.156863 | 76 | 0.689655 | from jinja2 import Template
from starlette.applications import Starlette
from starlette.middleware import Middleware
from starlette.middleware.sessions import SessionMiddleware
from starlette.responses import PlainTextResponse, HTMLResponse
from starlette_wtf import StarletteForm, CSRFProtectMiddleware, csrf_protect
fr... | true | true |
f7031cafd7d51d240c36a866bfbb5dc4718e84d1 | 1,341 | py | Python | youtube_contest.py | all0ws/cryze-peple | efd2bd2bcfc9c22bac78234e9dc191a17ca9e19d | [
"CC0-1.0"
] | null | null | null | youtube_contest.py | all0ws/cryze-peple | efd2bd2bcfc9c22bac78234e9dc191a17ca9e19d | [
"CC0-1.0"
] | null | null | null | youtube_contest.py | all0ws/cryze-peple | efd2bd2bcfc9c22bac78234e9dc191a17ca9e19d | [
"CC0-1.0"
] | null | null | null | #подключение библиотек
from PyQt5.QtCore import Qt
from PyQt5.QtWidgets import QApplication, QWidget, QPushButton, QLabel,QVBoxLayout,QHBoxLayout, QMessageBox, QRadioButton
#создание приложения и главного окна
app=QApplication([])
main_win =QWidget()
main_win.setWindowTitle('Конкурс от Crazy People')
question =QLabel(... | 26.82 | 121 | 0.780015 |
from PyQt5.QtCore import Qt
from PyQt5.QtWidgets import QApplication, QWidget, QPushButton, QLabel,QVBoxLayout,QHBoxLayout, QMessageBox, QRadioButton
app=QApplication([])
main_win =QWidget()
main_win.setWindowTitle('Конкурс от Crazy People')
question =QLabel("В каком году канал получил золотую кнопку от YouTube?")
b... | true | true |
f7031d0fdca75854293606c9e859fc97fd60f20a | 2,764 | py | Python | Autoplay/action_scripts/collection_scripts/ouch_script.py | Randy-Hodges/BTD6-Autoplay | 6d2ac9685b5f55848decc285918f8ede465c3a63 | [
"MIT"
] | null | null | null | Autoplay/action_scripts/collection_scripts/ouch_script.py | Randy-Hodges/BTD6-Autoplay | 6d2ac9685b5f55848decc285918f8ede465c3a63 | [
"MIT"
] | null | null | null | Autoplay/action_scripts/collection_scripts/ouch_script.py | Randy-Hodges/BTD6-Autoplay | 6d2ac9685b5f55848decc285918f8ede465c3a63 | [
"MIT"
] | null | null | null | from action_class import Action
place = 'place'
upgrade = 'upgrade'
target = 'target'
top = 'upgrade 1'
middle = 'upgrade 2'
bottom = 'upgrade 3'
ouch_script = [
Action(place, name='sub1', action='sub', position=(708, 540)), # Sub
Action(place, name='sub2', action='sub', position=(984, 545)), # Sub2
Acti... | 37.351351 | 84 | 0.641823 | from action_class import Action
place = 'place'
upgrade = 'upgrade'
target = 'target'
top = 'upgrade 1'
middle = 'upgrade 2'
bottom = 'upgrade 3'
ouch_script = [
Action(place, name='sub1', action='sub', position=(708, 540)),
Action(place, name='sub2', action='sub', position=(984, 545)),
Action('start',... | true | true |
f7031df14237fdbfb39aadf27251e92115266ab0 | 737 | py | Python | Leccion 8 Listas y diccionarios anidados/listAndDicts.py | Meluiscruz/Notas-de-Curso-Intermedio-de-Python | 1def9edffd63f7283d133c393a80e61abb12b25d | [
"MIT"
] | 1 | 2021-06-06T01:40:16.000Z | 2021-06-06T01:40:16.000Z | Leccion 8 Listas y diccionarios anidados/listAndDicts.py | Meluiscruz/Notas-de-Curso-Intermedio-de-Python | 1def9edffd63f7283d133c393a80e61abb12b25d | [
"MIT"
] | null | null | null | Leccion 8 Listas y diccionarios anidados/listAndDicts.py | Meluiscruz/Notas-de-Curso-Intermedio-de-Python | 1def9edffd63f7283d133c393a80e61abb12b25d | [
"MIT"
] | null | null | null | def run():
my_list = [1, "Hello", True, 4.5]
my_dict = {"firstname":"Facundo", "lastname":"Garcia"}
superList = [
{"firstname":"Facundo", "lastname":"Garcia"},
{"firstname":"Miguel", "lastname":"Torres"},
{"firstname":"José", "lastname":"Rodelo"},
{"firstname":"Susana", "las... | 27.296296 | 58 | 0.506106 | def run():
my_list = [1, "Hello", True, 4.5]
my_dict = {"firstname":"Facundo", "lastname":"Garcia"}
superList = [
{"firstname":"Facundo", "lastname":"Garcia"},
{"firstname":"Miguel", "lastname":"Torres"},
{"firstname":"José", "lastname":"Rodelo"},
{"firstname":"Susana", "las... | true | true |
f7031e134039488bf08fe651cc6d095e677304a2 | 5,279 | py | Python | code/faciesplot.py | elephantscale/facies | ea78a4917ebb5dbbe478b9fc27200c67b6e5576f | [
"MIT"
] | null | null | null | code/faciesplot.py | elephantscale/facies | ea78a4917ebb5dbbe478b9fc27200c67b6e5576f | [
"MIT"
] | 3 | 2019-12-05T20:26:52.000Z | 2019-12-05T20:30:13.000Z | code/faciesplot.py | elephantscale/facies | ea78a4917ebb5dbbe478b9fc27200c67b6e5576f | [
"MIT"
] | 3 | 2019-12-09T04:36:47.000Z | 2019-12-09T15:26:04.000Z | import numpy as np
import matplotlib.pyplot as plt
import matplotlib.colors as colors
from mpl_toolkits.axes_grid1 import make_axes_locatable
#Key:
# 1=sandstone 2=c_siltstone 3=f_siltstone
# 4=marine_silt_shale 5=mudstone 6=wackestone 7=dolomite
# 8=packstone 9=bafflestone
facies_labels = ['SS', 'CSiS', 'FSiS',... | 37.978417 | 112 | 0.603523 | import numpy as np
import matplotlib.pyplot as plt
import matplotlib.colors as colors
from mpl_toolkits.axes_grid1 import make_axes_locatable
facies_labels = ['SS', 'CSiS', 'FSiS', 'SiSh', 'MS',
'WS', 'D','PS', 'BS']
facies_colors = ['#F4D03F', '#F5B041','#DC7633','#6E2C00', '#1B4F72','#2E86C1'... | true | true |
f70320a4c6f7f1a47efc6a6cec4230e45d3d82d5 | 5,597 | py | Python | imagepy/tools/Transform/scale_tol.py | siyemuxu888/imagepy | a933526483a15da282bacac54608d44d2173beb4 | [
"BSD-4-Clause"
] | null | null | null | imagepy/tools/Transform/scale_tol.py | siyemuxu888/imagepy | a933526483a15da282bacac54608d44d2173beb4 | [
"BSD-4-Clause"
] | null | null | null | imagepy/tools/Transform/scale_tol.py | siyemuxu888/imagepy | a933526483a15da282bacac54608d44d2173beb4 | [
"BSD-4-Clause"
] | null | null | null | import wx
import numpy as np
from imagepy.core.engine import Tool, Filter
import scipy.ndimage as nimg
class ScaleTool(Tool):
def __init__(self, plg):
self.plg = plg
self.para = plg.para
self.moving = False
def snap(self, x, y, lim):
plg = self.plg
if abs(x-plg.... | 39.13986 | 93 | 0.516348 | import wx
import numpy as np
from imagepy.core.engine import Tool, Filter
import scipy.ndimage as nimg
class ScaleTool(Tool):
def __init__(self, plg):
self.plg = plg
self.para = plg.para
self.moving = False
def snap(self, x, y, lim):
plg = self.plg
if abs(x-plg.... | true | true |
f7032136be940769cd29b8db7635b5bf9b375e79 | 10,735 | py | Python | py_std_logic_1164/std_logic.py | krcb197/py_std_logic_1164 | 66ae8b644db4d96b222132e92768d52ee1b98f7b | [
"MIT"
] | null | null | null | py_std_logic_1164/std_logic.py | krcb197/py_std_logic_1164 | 66ae8b644db4d96b222132e92768d52ee1b98f7b | [
"MIT"
] | null | null | null | py_std_logic_1164/std_logic.py | krcb197/py_std_logic_1164 | 66ae8b644db4d96b222132e92768d52ee1b98f7b | [
"MIT"
] | null | null | null |
class std_logic():
"""
class to represent a digital bit allowing for the same 9 values of a bit supported by IEEE 1164.
====== ===============
Value Interpreatation
------ ---------------
U Unitialized
X Unknown
0 Strong 0
1 ... | 39.036364 | 118 | 0.382301 |
class std_logic():
def __init__(self,initialvalue='U'):
self._value = 'U'
self.set(value=initialvalue)
def __str__(self):
return self._value
def __repr__(self):
base_repr = super().__repr__()
return base_repr[:-2] + ':%s>'%self._value
def __eq__(self, other)... | true | true |
f7032158e00462f1a6bfc96d5858e3f893dcb171 | 8,515 | py | Python | seisidd/tomo_plans.py | KedoKudo/jupyter-ht-hedm | b447202fb9800e7b2916b38470db1b9a83357130 | [
"MIT"
] | null | null | null | seisidd/tomo_plans.py | KedoKudo/jupyter-ht-hedm | b447202fb9800e7b2916b38470db1b9a83357130 | [
"MIT"
] | null | null | null | seisidd/tomo_plans.py | KedoKudo/jupyter-ht-hedm | b447202fb9800e7b2916b38470db1b9a83357130 | [
"MIT"
] | 1 | 2019-07-16T22:13:02.000Z | 2019-07-16T22:13:02.000Z | #!/usr/bin/env python
"""
Predefined bluesky scan plans
"""
import numpy as np
import bluesky.plans as bp
import bluesky.preprocessors as bpp
import bluesky.plan_stubs as bps
from .utility import load_config
#@bpp.run_decorator()
def collect_white_field(experiment, cfg_tomo, at... | 37.676991 | 107 | 0.640752 |
import numpy as np
import bluesky.plans as bp
import bluesky.preprocessors as bpp
import bluesky.plan_stubs as bps
from .utility import load_config
def collect_white_field(experiment, cfg_tomo, atfront=True):
det = experiment.det
tomostage = experiment.tomostage
... | true | true |
f70321ab9d1e17a3074d6de10d8dd3f2b2a4c4d5 | 502 | py | Python | server/__init__.py | Programmer-RD-AI/Chat-App | b9ff5f2d5f59cc37d4ef7040b9d59ae7c1ace9e2 | [
"Apache-2.0"
] | null | null | null | server/__init__.py | Programmer-RD-AI/Chat-App | b9ff5f2d5f59cc37d4ef7040b9d59ae7c1ace9e2 | [
"Apache-2.0"
] | 5 | 2021-09-16T17:42:31.000Z | 2021-10-30T13:57:12.000Z | server/__init__.py | Programmer-RD-AI/Chat-App | b9ff5f2d5f59cc37d4ef7040b9d59ae7c1ace9e2 | [
"Apache-2.0"
] | null | null | null | from pymongo import *
from flask import *
from flask_restful import *
import datetime
mongodb_url = "mongodb://Ranuga:ranuga2008@cluster0-shard-00-00.6n3dg.mongodb.net:27017,cluster0-shard-00-01.6n3dg.mongodb.net:27017,cluster0-shard-00-02.6n3dg.mongodb.net:27017/myFirstDatabase?ssl=true&replicaSet=atlas-uo9rgq-shard... | 38.615385 | 280 | 0.806773 | from pymongo import *
from flask import *
from flask_restful import *
import datetime
mongodb_url = "mongodb://Ranuga:ranuga2008@cluster0-shard-00-00.6n3dg.mongodb.net:27017,cluster0-shard-00-01.6n3dg.mongodb.net:27017,cluster0-shard-00-02.6n3dg.mongodb.net:27017/myFirstDatabase?ssl=true&replicaSet=atlas-uo9rgq-shard... | true | true |
f70321d163f2bb54c285dd61fcf2d529daa5b17b | 6,435 | py | Python | tuun/probo/models/gp_stan_transfer.py | petuum/tuun | 8eec472dbf0e5e695449b0fa2d98985469fd5b30 | [
"Apache-2.0"
] | 33 | 2020-08-30T16:22:35.000Z | 2022-02-26T13:48:32.000Z | tuun/probo/models/gp_stan_transfer.py | petuum/tuun | 8eec472dbf0e5e695449b0fa2d98985469fd5b30 | [
"Apache-2.0"
] | 2 | 2021-01-18T19:46:43.000Z | 2021-03-24T09:59:14.000Z | tuun/probo/models/gp_stan_transfer.py | petuum/tuun | 8eec472dbf0e5e695449b0fa2d98985469fd5b30 | [
"Apache-2.0"
] | 2 | 2020-08-25T17:02:15.000Z | 2021-04-21T16:40:44.000Z | """
Classes for GP models with Stan that perform transfer optimization.
"""
from argparse import Namespace
import numpy as np
import copy
from .gp_stan import StanGp
from .regression.transfer_regression import TransferRegression
from ..util.misc_util import dict_to_namespace
class StanTransferGp(StanGp):
"""
... | 31.856436 | 92 | 0.601399 |
from argparse import Namespace
import numpy as np
import copy
from .gp_stan import StanGp
from .regression.transfer_regression import TransferRegression
from ..util.misc_util import dict_to_namespace
class StanTransferGp(StanGp):
def __init__(self, params=None, data=None, verbose=None):
self.set_params(... | true | true |
f703223b3ac044df519437e64abc05bc1bd9973c | 5,865 | py | Python | sdk/python/pulumi_azure_native/authorization/latest/get_management_lock_at_resource_level.py | pulumi-bot/pulumi-azure-native | f7b9490b5211544318e455e5cceafe47b628e12c | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_native/authorization/latest/get_management_lock_at_resource_level.py | pulumi-bot/pulumi-azure-native | f7b9490b5211544318e455e5cceafe47b628e12c | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_native/authorization/latest/get_management_lock_at_resource_level.py | pulumi-bot/pulumi-azure-native | f7b9490b5211544318e455e5cceafe47b628e12c | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union
from ... import _utilities, _tables
from... | 39.628378 | 283 | 0.650298 |
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union
from ... import _utilities, _tables
from . import outputs
__all__ = [
'GetManagementLockAtResourceLevelResult',
'AwaitableGetManagementLockAtResourceLevelResult',
'get_management_lock_at_resou... | true | true |
f703224172490713b6ea5921d8e35e234816b5d6 | 8,418 | py | Python | mvn/utils/op.py | K4S4B4/learnable-triangulation-pytorch | 94f5121919785bf7c89dd973521a21c01104dbd5 | [
"MIT"
] | null | null | null | mvn/utils/op.py | K4S4B4/learnable-triangulation-pytorch | 94f5121919785bf7c89dd973521a21c01104dbd5 | [
"MIT"
] | null | null | null | mvn/utils/op.py | K4S4B4/learnable-triangulation-pytorch | 94f5121919785bf7c89dd973521a21c01104dbd5 | [
"MIT"
] | null | null | null | import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
from mvn.utils.img import to_numpy, to_torch
from mvn.utils import multiview
def integrate_tensor_2d(heatmaps, softmax=True):
"""Applies softmax to heatmaps and integrates them to get their's "center of masses"
Args:
... | 42.730964 | 162 | 0.68698 | import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
from mvn.utils.img import to_numpy, to_torch
from mvn.utils import multiview
def integrate_tensor_2d(heatmaps, softmax=True):
batch_size, n_heatmaps, h, w = heatmaps.shape
heatmaps = heatmaps.reshape((batch_size, n_heatma... | true | true |
f703225523b2675260fc0159bf5fae1de004c8d2 | 2,319 | py | Python | src/sas2sqlite3/adapters.py | ericgj/sas2sqlite | f404dc862886f5a052bfc2dc492b4d0ec0773b31 | [
"MIT"
] | null | null | null | src/sas2sqlite3/adapters.py | ericgj/sas2sqlite | f404dc862886f5a052bfc2dc492b4d0ec0773b31 | [
"MIT"
] | null | null | null | src/sas2sqlite3/adapters.py | ericgj/sas2sqlite | f404dc862886f5a052bfc2dc492b4d0ec0773b31 | [
"MIT"
] | null | null | null | from calendar import timegm
from datetime import date, datetime, time
import sqlite3
from typing import Callable
import julian # type: ignore
def store_time(time_type: str, time_format: str = "") -> None:
if time_type == "seconds":
sqlite3.register_adapter(time, time_to_seconds)
elif time_type == "t... | 29.35443 | 77 | 0.692109 | from calendar import timegm
from datetime import date, datetime, time
import sqlite3
from typing import Callable
import julian
def store_time(time_type: str, time_format: str = "") -> None:
if time_type == "seconds":
sqlite3.register_adapter(time, time_to_seconds)
elif time_type == "text":
... | true | true |
f7032289beb6682222976cb9462e8cd05bc9a850 | 506 | py | Python | origamid/main.py | Cloud-CV/origami-daemon | c4179352c8f8ed86193d1a04d340661a9f24ff6d | [
"BSD-3-Clause"
] | 4 | 2018-06-16T20:07:33.000Z | 2019-02-14T06:35:18.000Z | origamid/main.py | Cloud-CV/origami-daemon | c4179352c8f8ed86193d1a04d340661a9f24ff6d | [
"BSD-3-Clause"
] | 20 | 2018-06-13T13:35:50.000Z | 2019-06-01T22:12:53.000Z | origamid/main.py | Cloud-CV/origami-daemon | c4179352c8f8ed86193d1a04d340661a9f24ff6d | [
"BSD-3-Clause"
] | 7 | 2018-09-05T10:37:30.000Z | 2021-10-04T03:46:18.000Z | import click
import logging
from .constants import WELCOME_TEXT
from .api import run_server
from .logger import OrigamiLogger
logger = OrigamiLogger(
file_log_level=logging.DEBUG, console_log_level=logging.DEBUG)
@click.group(invoke_without_command=True)
@click.pass_context
def main(ctx):
"""
Origami da... | 21.083333 | 71 | 0.764822 | import click
import logging
from .constants import WELCOME_TEXT
from .api import run_server
from .logger import OrigamiLogger
logger = OrigamiLogger(
file_log_level=logging.DEBUG, console_log_level=logging.DEBUG)
@click.group(invoke_without_command=True)
@click.pass_context
def main(ctx):
if not ctx.invoked... | true | true |
f7032363fc14f699405a1f015afdc99f3377b608 | 11,524 | py | Python | python/day18.py | simmsb/advent-of-code-2021 | 6ba2a2a9a2ccf6f0ae0328eb1b1add00a655590a | [
"MIT"
] | null | null | null | python/day18.py | simmsb/advent-of-code-2021 | 6ba2a2a9a2ccf6f0ae0328eb1b1add00a655590a | [
"MIT"
] | null | null | null | python/day18.py | simmsb/advent-of-code-2021 | 6ba2a2a9a2ccf6f0ae0328eb1b1add00a655590a | [
"MIT"
] | null | null | null | from __future__ import annotations
import itertools
import math
from dataclasses import dataclass
from typing import Any
@dataclass
class TreeZipper:
inner: Any
path: list[int]
def up(self):
if self.path:
return TreeZipper(self.inner, self.path[:-1]), self.path[-1]
return Non... | 28.245098 | 102 | 0.345106 | from __future__ import annotations
import itertools
import math
from dataclasses import dataclass
from typing import Any
@dataclass
class TreeZipper:
inner: Any
path: list[int]
def up(self):
if self.path:
return TreeZipper(self.inner, self.path[:-1]), self.path[-1]
return Non... | true | true |
f703237c7b21dfe2701fe1fbdb4022c1eba0e043 | 4,805 | py | Python | tests/unit/test_protocols.py | ebi-ait/ingest-archiver | de0676fc3f750bc5abd3d42f140a142c3b972910 | [
"Apache-2.0"
] | 1 | 2020-09-15T10:29:18.000Z | 2020-09-15T10:29:18.000Z | tests/unit/test_protocols.py | ebi-ait/ingest-archiver | de0676fc3f750bc5abd3d42f140a142c3b972910 | [
"Apache-2.0"
] | 28 | 2020-01-17T15:37:21.000Z | 2022-02-21T15:18:46.000Z | tests/unit/test_protocols.py | ebi-ait/ingest-archiver | de0676fc3f750bc5abd3d42f140a142c3b972910 | [
"Apache-2.0"
] | 4 | 2020-05-31T11:49:56.000Z | 2020-11-01T06:05:12.000Z | import json
from unittest import TestCase
from unittest.mock import Mock
from utils import protocols
from api.ontology import OntologyAPI
from utils.protocols import ONTOLOGY_3PRIME_PARENT, ONTOLOGY_5PRIME_PARENT, ONTOLOGY_CITESEQ
class TestProtocols(TestCase):
def setUp(self) -> None:
self.ontology_api =... | 29.478528 | 115 | 0.57565 | import json
from unittest import TestCase
from unittest.mock import Mock
from utils import protocols
from api.ontology import OntologyAPI
from utils.protocols import ONTOLOGY_3PRIME_PARENT, ONTOLOGY_5PRIME_PARENT, ONTOLOGY_CITESEQ
class TestProtocols(TestCase):
def setUp(self) -> None:
self.ontology_api =... | true | true |
f703239ebe11327a7f5a7741cddd1a6aaacbbe07 | 711 | py | Python | homepage/summarizer.py | prats1997/Euphorum | 16bfee9c71ea5b1332c6263233c79a633ddfdd83 | [
"MIT"
] | 1 | 2020-03-01T17:39:04.000Z | 2020-03-01T17:39:04.000Z | homepage/summarizer.py | prats1997/Euphorum | 16bfee9c71ea5b1332c6263233c79a633ddfdd83 | [
"MIT"
] | null | null | null | homepage/summarizer.py | prats1997/Euphorum | 16bfee9c71ea5b1332c6263233c79a633ddfdd83 | [
"MIT"
] | null | null | null | from sumy.parsers.plaintext import PlaintextParser #We're choosing a plaintext parser here, other parsers available for HTML etc.
from sumy.nlp.tokenizers import Tokenizer
from sumy.summarizers.lex_rank import LexRankSummarizer #We're choosing Lexrank, other algorithms are also built in
def get_summary(text):
# ... | 35.55 | 129 | 0.759494 | from sumy.parsers.plaintext import PlaintextParser
from sumy.nlp.tokenizers import Tokenizer
from sumy.summarizers.lex_rank import LexRankSummarizer #We're choosing Lexrank, other algorithms are also built in
def get_summary(text):
arser.from_string(text,Tokenizer("English"))
summarizer = LexRankSummarizer(... | true | true |
f703249eb0707d1f33a73eb8c4811cfac1b4bc40 | 863 | py | Python | load_and_process.py | ctiger34/BASIC-EMOTION-DETECTION | 1c2be519c70408159ea6e1093d5f139c99ea6e27 | [
"MIT"
] | 18 | 2019-10-08T10:15:27.000Z | 2022-02-21T06:36:57.000Z | load_and_process.py | ctiger34/BASIC-EMOTION-DETECTION | 1c2be519c70408159ea6e1093d5f139c99ea6e27 | [
"MIT"
] | 3 | 2020-04-17T20:43:58.000Z | 2022-02-10T00:21:01.000Z | load_and_process.py | ctiger34/BASIC-EMOTION-DETECTION | 1c2be519c70408159ea6e1093d5f139c99ea6e27 | [
"MIT"
] | 8 | 2020-03-07T10:17:11.000Z | 2021-07-05T05:22:04.000Z | import pandas as pd
import cv2
import numpy as np
dataset_path = 'fer2013/fer2013/fer2013.csv'
image_size=(48,48)
def load_fer2013():
data = pd.read_csv(dataset_path)
pixels = data['pixels'].tolist()
width, height = 48, 48
faces = []
for pixel_sequence in pixels:
f... | 28.766667 | 70 | 0.589803 | import pandas as pd
import cv2
import numpy as np
dataset_path = 'fer2013/fer2013/fer2013.csv'
image_size=(48,48)
def load_fer2013():
data = pd.read_csv(dataset_path)
pixels = data['pixels'].tolist()
width, height = 48, 48
faces = []
for pixel_sequence in pixels:
f... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.