hexsha stringlengths 40 40 | size int64 2 1.02M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 245 | max_stars_repo_name stringlengths 6 130 | max_stars_repo_head_hexsha stringlengths 40 40 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 245 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 245 | max_forks_repo_name stringlengths 6 130 | max_forks_repo_head_hexsha stringlengths 40 40 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 2 1.02M | avg_line_length float64 1 958k | max_line_length int64 1 987k | alphanum_fraction float64 0 1 | content_no_comment stringlengths 0 1.01M | is_comment_constant_removed bool 2
classes | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1c49cc9c62f8a2e1acc97ec88014ca7f54dbd2f8 | 861 | py | Python | tests/test_settings.py | ibqn/django-graphql-jwt | dd92319071092bb517187904f3ac0610e8443edf | [
"MIT"
] | 1 | 2019-06-19T12:05:08.000Z | 2019-06-19T12:05:08.000Z | tests/test_settings.py | ibqn/django-graphql-jwt | dd92319071092bb517187904f3ac0610e8443edf | [
"MIT"
] | 1 | 2018-11-01T05:12:50.000Z | 2018-11-01T05:12:50.000Z | tests/test_settings.py | ibqn/django-graphql-jwt | dd92319071092bb517187904f3ac0610e8443edf | [
"MIT"
] | 1 | 2021-03-10T17:53:41.000Z | 2021-03-10T17:53:41.000Z | from datetime import timedelta
from django.test import TestCase
from graphql_jwt import settings
class SettingsTests(TestCase):
def test_perform_import(self):
f = settings.perform_import(id, '')
self.assertEqual(f, id)
f = settings.perform_import('datetime.timedelta', '')
self.... | 27.774194 | 61 | 0.70964 | from datetime import timedelta
from django.test import TestCase
from graphql_jwt import settings
class SettingsTests(TestCase):
def test_perform_import(self):
f = settings.perform_import(id, '')
self.assertEqual(f, id)
f = settings.perform_import('datetime.timedelta', '')
self.... | true | true |
1c49cd273a7d8c3849364cca03ddab157ababced | 196 | py | Python | _modules/_site/week_5.py | CoffeePoweredComputers/489-data-structures | e2a56f3cecde42bf1520030e24750cbe17e1b704 | [
"MIT"
] | null | null | null | _modules/_site/week_5.py | CoffeePoweredComputers/489-data-structures | e2a56f3cecde42bf1520030e24750cbe17e1b704 | [
"MIT"
] | null | null | null | _modules/_site/week_5.py | CoffeePoweredComputers/489-data-structures | e2a56f3cecde42bf1520030e24750cbe17e1b704 | [
"MIT"
] | null | null | null | Sep 19
:
Sep 20
:
**Lecture**{: .label .label-light-blue} X
Sep 21
:
Sep 22
: **Lecture**
Sep 23
: **zyBooks**{: .label .label-orange}
Sep 24
: **Nothing Due**
Sep 25
: **Nothing Due**
| 8.521739 | 41 | 0.571429 | Sep 19
:
Sep 20
:
**Lecture**{: .label .label-light-blue} X
Sep 21
:
Sep 22
: **Lecture**
Sep 23
: **zyBooks**{: .label .label-orange}
Sep 24
: **Nothing Due**
Sep 25
: **Nothing Due**
| false | true |
1c49cd379a153b4789e7d9393eb5505762cb9e05 | 576 | py | Python | services/models/mnemosyne.py | life-game-player/Hephaestus | 0c695193d8d2d8c70061e2e26ec8c718544342c6 | [
"MIT"
] | null | null | null | services/models/mnemosyne.py | life-game-player/Hephaestus | 0c695193d8d2d8c70061e2e26ec8c718544342c6 | [
"MIT"
] | null | null | null | services/models/mnemosyne.py | life-game-player/Hephaestus | 0c695193d8d2d8c70061e2e26ec8c718544342c6 | [
"MIT"
] | null | null | null | import torch
def create(
host, user, passwd,
module, operator, operation, result
):
"""
Operation:
1: Create
2: Modify
3: Query
4: Delete
Result:
0: Succeeded
1: Failed
"""
conn = torch.connect(host, user, pas... | 22.153846 | 78 | 0.53125 | import torch
def create(
host, user, passwd,
module, operator, operation, result
):
conn = torch.connect(host, user, passwd, 'hephaestus')
list_sql = list()
list_sql.append(
"INSERT INTO mnemosyne(module, operator, operation, result) "
"VALUES('{}', {}, {}, {})".format(module, oper... | true | true |
1c49ce60fe551913416a74e91ae623292230edb4 | 2,260 | py | Python | bclearer_boson_1_1_source/b_code/configurations/getters/boson_1_2e_k_configuration_getter_separate_names_and_instances.py | boro-alpha/bclearer_boson_1_1 | 15207d240fd3144b155922dc5c5d14822023026a | [
"MIT"
] | 1 | 2021-07-20T15:48:58.000Z | 2021-07-20T15:48:58.000Z | bclearer_boson_1_1_source/b_code/configurations/getters/boson_1_2e_k_configuration_getter_separate_names_and_instances.py | boro-alpha/bclearer_boson_1_1 | 15207d240fd3144b155922dc5c5d14822023026a | [
"MIT"
] | null | null | null | bclearer_boson_1_1_source/b_code/configurations/getters/boson_1_2e_k_configuration_getter_separate_names_and_instances.py | boro-alpha/bclearer_boson_1_1 | 15207d240fd3144b155922dc5c5d14822023026a | [
"MIT"
] | null | null | null | from bclearer_boson_1_1_source.b_code.common_knowledge.inspire_matched_ea_objects import InspireMatchedEaObjects
from bclearer_source.b_code.common_knowledge.convention_shift_operation_types import ConventionShiftOperationTypes
from bclearer_source.b_code.configurations.bespoke_name_to_instance_configuration_objects im... | 55.121951 | 138 | 0.815044 | from bclearer_boson_1_1_source.b_code.common_knowledge.inspire_matched_ea_objects import InspireMatchedEaObjects
from bclearer_source.b_code.common_knowledge.convention_shift_operation_types import ConventionShiftOperationTypes
from bclearer_source.b_code.configurations.bespoke_name_to_instance_configuration_objects im... | true | true |
1c49cebb0a5ba4d641d71c1a1b47be7267c38f1c | 13,667 | py | Python | LPIPSmodels/dist_model.py | HERMINDERSINGH1234/ML_Extra_Resolution_Increases | 1fefceeab83f03fa8194cb63f78c5dbf7e90aeae | [
"Apache-2.0"
] | 1 | 2021-07-17T10:13:10.000Z | 2021-07-17T10:13:10.000Z | LPIPSmodels/dist_model.py | HERMINDERSINGH1234/ML_Extra_Resolution_Increases | 1fefceeab83f03fa8194cb63f78c5dbf7e90aeae | [
"Apache-2.0"
] | null | null | null | LPIPSmodels/dist_model.py | HERMINDERSINGH1234/ML_Extra_Resolution_Increases | 1fefceeab83f03fa8194cb63f78c5dbf7e90aeae | [
"Apache-2.0"
] | null | null | null |
from __future__ import absolute_import
import sys
sys.path.append('..')
sys.path.append('.')
import numpy as np
import torch
from torch import nn
import os
from collections import OrderedDict
from torch.autograd import Variable
import itertools
from .base_model import BaseModel
from scipy.ndimage import... | 41.795107 | 279 | 0.599693 |
from __future__ import absolute_import
import sys
sys.path.append('..')
sys.path.append('.')
import numpy as np
import torch
from torch import nn
import os
from collections import OrderedDict
from torch.autograd import Variable
import itertools
from .base_model import BaseModel
from scipy.ndimage import... | true | true |
1c49cf543130427f0a2e98a414b5ce3c3321b3df | 6,004 | py | Python | sdk/python/pulumi_azure_nextgen/azurestack/latest/customer_subscription.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/azurestack/latest/customer_subscription.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/azurestack/latest/customer_subscription.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... | 44.474074 | 287 | 0.659893 |
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union
from ... import _utilities, _tables
__all__ = ['CustomerSubscription']
warnings.warn("""The 'latest' version is deprecated. Please migrate to the resource in the top-level module: 'azure-nextgen:azuresta... | true | true |
1c49cfd95d576b090d11ac58239cd27ff7c71312 | 553 | py | Python | scripts/RunServer.py | ekg/shasta | e2fd3c3d79fb4cafe77c62f6af2fef46f7a04b01 | [
"BSD-3-Clause"
] | null | null | null | scripts/RunServer.py | ekg/shasta | e2fd3c3d79fb4cafe77c62f6af2fef46f7a04b01 | [
"BSD-3-Clause"
] | null | null | null | scripts/RunServer.py | ekg/shasta | e2fd3c3d79fb4cafe77c62f6af2fef46f7a04b01 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/python3
import os
import shasta
import GetConfig
# Find the path to the docs directory.
thisScriptPath = os.path.realpath(__file__)
thisScriptDirectory = os.path.dirname(thisScriptPath)
thisScriptParentDirectory = os.path.dirname(thisScriptDirectory)
docsDirectory = thisScriptParentDirectory + '/docs'
# R... | 22.12 | 64 | 0.793852 |
import os
import shasta
import GetConfig
thisScriptPath = os.path.realpath(__file__)
thisScriptDirectory = os.path.dirname(thisScriptPath)
thisScriptParentDirectory = os.path.dirname(thisScriptDirectory)
docsDirectory = thisScriptParentDirectory + '/docs'
config = GetConfig.getConfig()
a = shasta.Assembler()
a.... | true | true |
1c49d18f431832a15fe255123e31a03b0a805e27 | 5,159 | py | Python | settings.py | garyp/djwed | a3cecfa77f55574fecc05621a33d0cdd20a85fb2 | [
"MIT"
] | 1 | 2021-01-27T09:56:00.000Z | 2021-01-27T09:56:00.000Z | settings.py | garyp/djwed | a3cecfa77f55574fecc05621a33d0cdd20a85fb2 | [
"MIT"
] | null | null | null | settings.py | garyp/djwed | a3cecfa77f55574fecc05621a33d0cdd20a85fb2 | [
"MIT"
] | null | null | null | # Django settings for djwed project.
import logging
from socket import gethostname
production = False
# This is the production hostname (as I'd develop on a desktop and then run
# the system on a colo server.)
if 'my-colo-server' == gethostname().split(".")[0]:
production = True
if not production:
DEBUG = Tr... | 32.043478 | 101 | 0.724559 |
import logging
from socket import gethostname
production = False
# the system on a colo server.)
if 'my-colo-server' == gethostname().split(".")[0]:
production = True
if not production:
DEBUG = True
else:
DEBUG = False
TEMPLATE_DEBUG = DEBUG
logging.basicConfig(level=logging.INFO)
ADMINS = (
('B... | true | true |
1c49d22b406a20082fc4ddf2a42ae03c8ebb4cf3 | 1,325 | py | Python | spanner/google/cloud/spanner.py | bomboradata/bombora-google-cloud-python | 255bbebe6c50490f40fcc3eed40bae1e77e03859 | [
"Apache-2.0"
] | null | null | null | spanner/google/cloud/spanner.py | bomboradata/bombora-google-cloud-python | 255bbebe6c50490f40fcc3eed40bae1e77e03859 | [
"Apache-2.0"
] | null | null | null | spanner/google/cloud/spanner.py | bomboradata/bombora-google-cloud-python | 255bbebe6c50490f40fcc3eed40bae1e77e03859 | [
"Apache-2.0"
] | null | null | null | # Copyright 2016 Google Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | 30.813953 | 74 | 0.767547 |
from __future__ import absolute_import
from google.cloud.spanner_v1 import __version__
from google.cloud.spanner_v1 import AbstractSessionPool
from google.cloud.spanner_v1 import BurstyPool
from google.cloud.spanner_v1 import Client
from google.cloud.spanner_v1 import enums
from google.cloud.spanner_v1 ... | true | true |
1c49d2430b558f5439579e9257bf1022eef95d92 | 583 | py | Python | script.plexodus/service.py | MR-Unknown-Cm/addons | 8df1ebe58c95620bb02a05dbae7bf37954915cbd | [
"Apache-2.0"
] | 1 | 2020-03-03T10:01:21.000Z | 2020-03-03T10:01:21.000Z | script.plexodus/service.py | MR-Unknown-Cm/addons | 8df1ebe58c95620bb02a05dbae7bf37954915cbd | [
"Apache-2.0"
] | null | null | null | script.plexodus/service.py | MR-Unknown-Cm/addons | 8df1ebe58c95620bb02a05dbae7bf37954915cbd | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
import xbmc
import xbmcgui
import xbmcaddon
def main():
if xbmc.getInfoLabel('Window(10000).Property(script.plexodus.service.started)'):
# Prevent add-on updates from starting a new version of the addon
return
xbmcgui.Window(10000).setProperty('script.plexodus.service.... | 27.761905 | 87 | 0.686106 |
import xbmc
import xbmcgui
import xbmcaddon
def main():
if xbmc.getInfoLabel('Window(10000).Property(script.plexodus.service.started)'):
return
xbmcgui.Window(10000).setProperty('script.plexodus.service.started', '1')
if xbmcaddon.Addon().getSetting('kiosk.mode') == 'true':
xbm... | true | true |
1c49d2ea6b5f5d7265c638d9c946745c6efc2c2a | 1,696 | py | Python | examples/p3/Ball.py | djpeach/pygamer | 77a0cdab58bc29d06cc88c8cc823850794fe0bf0 | [
"MIT"
] | null | null | null | examples/p3/Ball.py | djpeach/pygamer | 77a0cdab58bc29d06cc88c8cc823850794fe0bf0 | [
"MIT"
] | null | null | null | examples/p3/Ball.py | djpeach/pygamer | 77a0cdab58bc29d06cc88c8cc823850794fe0bf0 | [
"MIT"
] | null | null | null | import pygame
import pygamer
import time
class Ball(pygamer.Object):
def __init__(self, speed, color, radius, center_position):
rect = pygame.rect.Rect(center_position[0] - radius, center_position[1] - radius, radius * 2, radius * 2)
super().__init__(rect, speed)
self.color = color
... | 39.44186 | 127 | 0.598467 | import pygame
import pygamer
import time
class Ball(pygamer.Object):
def __init__(self, speed, color, radius, center_position):
rect = pygame.rect.Rect(center_position[0] - radius, center_position[1] - radius, radius * 2, radius * 2)
super().__init__(rect, speed)
self.color = color
... | true | true |
1c49d35a318a1a44c92df86786fbdadfd07a7a15 | 196 | py | Python | detectron/lib/python3.6/site-packages/torchvision/version.py | JustinBear99/Mask_RCNN | d43eaf7c6ebf29d4d6da796a0f7ff5561e21acff | [
"Apache-2.0"
] | null | null | null | detectron/lib/python3.6/site-packages/torchvision/version.py | JustinBear99/Mask_RCNN | d43eaf7c6ebf29d4d6da796a0f7ff5561e21acff | [
"Apache-2.0"
] | null | null | null | detectron/lib/python3.6/site-packages/torchvision/version.py | JustinBear99/Mask_RCNN | d43eaf7c6ebf29d4d6da796a0f7ff5561e21acff | [
"Apache-2.0"
] | null | null | null | __version__ = '0.6.1'
git_version = '35d732ac53aebbed917993523d685b4cb09ef6ea'
from torchvision.extension import _check_cuda_version
if _check_cuda_version() > 0:
cuda = _check_cuda_version()
| 32.666667 | 56 | 0.811224 | __version__ = '0.6.1'
git_version = '35d732ac53aebbed917993523d685b4cb09ef6ea'
from torchvision.extension import _check_cuda_version
if _check_cuda_version() > 0:
cuda = _check_cuda_version()
| true | true |
1c49d3ed3d448eb8beffb819f40560927ff5b27b | 12,269 | py | Python | testtools/tests/test_run.py | sparkiegeek/testtools | f86658ac18521db4254e7292c4a4dda6017d930e | [
"MIT"
] | null | null | null | testtools/tests/test_run.py | sparkiegeek/testtools | f86658ac18521db4254e7292c4a4dda6017d930e | [
"MIT"
] | null | null | null | testtools/tests/test_run.py | sparkiegeek/testtools | f86658ac18521db4254e7292c4a4dda6017d930e | [
"MIT"
] | null | null | null | # Copyright (c) 2010 testtools developers. See LICENSE for details.
"""Tests for the test runner logic."""
import doctest
import io
from unittest import TestSuite
import sys
from textwrap import dedent
from extras import try_import
fixtures = try_import('fixtures')
testresources = try_import('testresources')
import ... | 34.175487 | 83 | 0.615454 |
import doctest
import io
from unittest import TestSuite
import sys
from textwrap import dedent
from extras import try_import
fixtures = try_import('fixtures')
testresources = try_import('testresources')
import unittest
import testtools
from testtools import TestCase, run, skipUnless
from testtools.compat import (
... | true | true |
1c49d5612454adebb23817577e69371c43f1abab | 17,792 | py | Python | coap/coapTransmitter.py | TimothyClaeys/coap | 02487f06980c5c434fcf7efc0f04a97a081e1f13 | [
"BSD-3-Clause"
] | 53 | 2015-03-04T19:41:29.000Z | 2021-09-27T18:39:52.000Z | coap/coapTransmitter.py | TimothyClaeys/coap | 02487f06980c5c434fcf7efc0f04a97a081e1f13 | [
"BSD-3-Clause"
] | 7 | 2016-05-18T15:49:43.000Z | 2019-06-12T15:06:30.000Z | coap/coapTransmitter.py | TimothyClaeys/coap | 02487f06980c5c434fcf7efc0f04a97a081e1f13 | [
"BSD-3-Clause"
] | 57 | 2015-01-07T08:54:54.000Z | 2021-09-27T18:39:55.000Z | import logging
class NullHandler(logging.Handler):
def emit(self, record):
pass
log = logging.getLogger('coapTransmitter')
log.setLevel(logging.ERROR)
log.addHandler(NullHandler())
import time
import threading
import random
from . import coapDefines as d
from . import coapException ... | 34.48062 | 176 | 0.519054 | import logging
class NullHandler(logging.Handler):
def emit(self, record):
pass
log = logging.getLogger('coapTransmitter')
log.setLevel(logging.ERROR)
log.addHandler(NullHandler())
import time
import threading
import random
from . import coapDefines as d
from . import coapException ... | true | true |
1c49d5f237a286b2bb5c13f14cb28491327c2343 | 3,576 | py | Python | funboost/factories/publisher_factotry.py | DJMIN/funboost | 7570ca2909bb0b44a1080f5f98aa96c86d3da9d4 | [
"Apache-2.0"
] | null | null | null | funboost/factories/publisher_factotry.py | DJMIN/funboost | 7570ca2909bb0b44a1080f5f98aa96c86d3da9d4 | [
"Apache-2.0"
] | null | null | null | funboost/factories/publisher_factotry.py | DJMIN/funboost | 7570ca2909bb0b44a1080f5f98aa96c86d3da9d4 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# @Author : ydf
# @Time : 2019/8/8 0008 13:16
import copy
from typing import Callable
from funboost.publishers.confluent_kafka_publisher import ConfluentKafkaPublisher
from funboost.publishers.http_publisher import HTTPPublisher
from funboost.publishers.kombu_publisher import KombuPublisher... | 43.609756 | 111 | 0.782438 |
import copy
from typing import Callable
from funboost.publishers.confluent_kafka_publisher import ConfluentKafkaPublisher
from funboost.publishers.http_publisher import HTTPPublisher
from funboost.publishers.kombu_publisher import KombuPublisher
from funboost.publishers.nats_publisher import NatsPublisher
from funb... | true | true |
1c49d63275e5e8dd3611c5fba177eb143551df99 | 15,890 | py | Python | docs/source/conf.py | crusaderky/distributed | d1cf1d452aece30b75adaf7f73f7cfdc69a63c4a | [
"BSD-3-Clause"
] | 1,358 | 2016-02-09T21:25:27.000Z | 2022-03-30T08:06:36.000Z | docs/source/conf.py | crusaderky/distributed | d1cf1d452aece30b75adaf7f73f7cfdc69a63c4a | [
"BSD-3-Clause"
] | 4,789 | 2016-02-10T00:13:43.000Z | 2022-03-31T23:56:27.000Z | docs/source/conf.py | crusaderky/distributed | d1cf1d452aece30b75adaf7f73f7cfdc69a63c4a | [
"BSD-3-Clause"
] | 791 | 2016-02-19T04:34:38.000Z | 2022-03-31T16:26:38.000Z | from __future__ import annotations
#
# Dask.distributed documentation build configuration file, created by
# sphinx-quickstart on Tue Oct 6 14:42:44 2015.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# auto... | 32.428571 | 117 | 0.685903 | from __future__ import annotations
extensions = [
"sphinx.ext.autodoc",
"sphinx.ext.todo",
"sphinx.ext.ifconfig",
"sphinx.ext.viewcode",
"sphinx.ext.autosummary",
"sphinx.ext.extlinks",
"sphinx.ext.intersphinx",
"numpydoc",
"sphinx_click.ext",
]
numpydoc_s... | true | true |
1c49d6af950d52fdab2916b0e3bb2e50b50c6d22 | 6,893 | py | Python | python/paddle/incubate/operators/graph_reindex.py | L-Net-1992/Paddle | 4d0ca02ba56760b456f3d4b42a538555b9b6c307 | [
"Apache-2.0"
] | 11 | 2016-08-29T07:43:26.000Z | 2016-08-29T07:51:24.000Z | python/paddle/incubate/operators/graph_reindex.py | L-Net-1992/Paddle | 4d0ca02ba56760b456f3d4b42a538555b9b6c307 | [
"Apache-2.0"
] | null | null | null | python/paddle/incubate/operators/graph_reindex.py | L-Net-1992/Paddle | 4d0ca02ba56760b456f3d4b42a538555b9b6c307 | [
"Apache-2.0"
] | 1 | 2021-12-09T08:59:17.000Z | 2021-12-09T08:59:17.000Z | # Copyright (c) 2022 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by app... | 45.649007 | 94 | 0.596402 |
import paddle
from paddle.fluid.layer_helper import LayerHelper
from paddle.fluid.framework import _non_static_mode
from paddle.fluid.data_feeder import check_variable_and_dtype
from paddle.fluid import core
from paddle import _C_ops
def graph_reindex(x,
neighbors,
co... | true | true |
1c49d6baa6cc4f1e16d6a5132cb65e2120088470 | 1,158 | py | Python | Advent of Code/2020/3/3.py | dimitrov-dimitar/competitive-programming | f2b022377baf6d4beff213fc513907b774c12352 | [
"MIT"
] | null | null | null | Advent of Code/2020/3/3.py | dimitrov-dimitar/competitive-programming | f2b022377baf6d4beff213fc513907b774c12352 | [
"MIT"
] | null | null | null | Advent of Code/2020/3/3.py | dimitrov-dimitar/competitive-programming | f2b022377baf6d4beff213fc513907b774c12352 | [
"MIT"
] | null | null | null | matrix = []
with open('input') as f:
for row in f:
row_matrix = [x for x in row if x != '\n']
row_matrix *= 1000
matrix.append(row_matrix)
# print(matrix[0])
i, j = 0, 0
counter_1 = counter_2 = counter_3 = counter_4 = counter_5 = 0
# Part One
# 3, 1
while True:
if i >= len(matrix):
... | 13.623529 | 64 | 0.486183 | matrix = []
with open('input') as f:
for row in f:
row_matrix = [x for x in row if x != '\n']
row_matrix *= 1000
matrix.append(row_matrix)
i, j = 0, 0
counter_1 = counter_2 = counter_3 = counter_4 = counter_5 = 0
while True:
if i >= len(matrix):
break
if matrix[i][j] ... | true | true |
1c49d6e03e4aa9f496a950a08e7afb8664ce56e7 | 4,752 | py | Python | Simple Text classifiers/Text Classification on 20Newsgroup using NN/20ng_classifier - Conv1d.py | tejasurya/Text_Classification_using_Neural_Networks | d4852780e6c86843aee768d306d19428c8cb9c7f | [
"MIT"
] | 1 | 2020-04-30T16:15:42.000Z | 2020-04-30T16:15:42.000Z | Simple Text classifiers/Text Classification on 20Newsgroup using NN/20ng_classifier - Conv1d.py | tejasurya/Text_Classification_using_Neural_Networks | d4852780e6c86843aee768d306d19428c8cb9c7f | [
"MIT"
] | null | null | null | Simple Text classifiers/Text Classification on 20Newsgroup using NN/20ng_classifier - Conv1d.py | tejasurya/Text_Classification_using_Neural_Networks | d4852780e6c86843aee768d306d19428c8cb9c7f | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Tue Feb 6 15:55:01 2018
@author: HP
"""
# -*- coding: utf-8 -*-
"""
Created on Mon Feb 5 14:31:43 2018
@author: HP
"""
import os
import pandas as pd
import nltk
import gensim
from gensim import corpora, models, similarities
from nltk.corpus import stopwords
from nltk.tokeniz... | 23.180488 | 100 | 0.742635 |
import os
import pandas as pd
import nltk
import gensim
from gensim import corpora, models, similarities
from nltk.corpus import stopwords
from nltk.tokenize import word_tokenize
from gensim.models.keyedvectors import KeyedVectors as KV
from numpy import asarray
from numpy import zeros
import numpy as np
from keras... | true | true |
1c49d71f05cafc9fa6e61f1005654be4254a0bd8 | 1,339 | py | Python | transcribe/scribe_modules/yum_repos.py | aakarshg/scribe | 0ae48546f9d461f9421305d0902ed73b81c0f112 | [
"Apache-2.0"
] | null | null | null | transcribe/scribe_modules/yum_repos.py | aakarshg/scribe | 0ae48546f9d461f9421305d0902ed73b81c0f112 | [
"Apache-2.0"
] | null | null | null | transcribe/scribe_modules/yum_repos.py | aakarshg/scribe | 0ae48546f9d461f9421305d0902ed73b81c0f112 | [
"Apache-2.0"
] | null | null | null | from . import ScribeModuleBaseClass
from . lib.util import format_url
base_url = "http://mirror.centos.org/centos/$releasever/{}/$basearch/"
# object_dict = {}
class Yum_repos(ScribeModuleBaseClass):
def __init__(self, input_dict=None, module_name=None, host_name=None,
input_type=None, scribe_... | 38.257143 | 76 | 0.589246 | from . import ScribeModuleBaseClass
from . lib.util import format_url
base_url = "http://mirror.centos.org/centos/$releasever/{}/$basearch/"
class Yum_repos(ScribeModuleBaseClass):
def __init__(self, input_dict=None, module_name=None, host_name=None,
input_type=None, scribe_uuid=None):
... | true | true |
1c49d7dd71ba7d729f7fdaf9ace0f3e50bc1f6c4 | 4,730 | py | Python | src/v5.3/resources/swagger_client/models/tpdm_credential_student_academic_record.py | xmarcosx/edfi-notebook | 0564ebdf1d0f45a9d25056e7e61369f0a837534d | [
"Apache-2.0"
] | 2 | 2021-04-27T17:18:17.000Z | 2021-04-27T19:14:39.000Z | src/v5.1/resources/swagger_client/models/tpdm_credential_student_academic_record.py | xmarcosx/edfi-notebook | 0564ebdf1d0f45a9d25056e7e61369f0a837534d | [
"Apache-2.0"
] | null | null | null | src/v5.1/resources/swagger_client/models/tpdm_credential_student_academic_record.py | xmarcosx/edfi-notebook | 0564ebdf1d0f45a9d25056e7e61369f0a837534d | [
"Apache-2.0"
] | 1 | 2022-01-06T09:43:11.000Z | 2022-01-06T09:43:11.000Z | # coding: utf-8
"""
Ed-Fi Operational Data Store API
The Ed-Fi ODS / API enables applications to read and write education data stored in an Ed-Fi ODS through a secure REST interface. *** > *Note: Consumers of ODS / API information should sanitize all data for display and storage. The ODS / API provides reas... | 37.84 | 482 | 0.664482 |
import pprint
import re
import six
from swagger_client.configuration import Configuration
class TpdmCredentialStudentAcademicRecord(object):
swagger_types = {
'student_academic_record_reference': 'EdFiStudentAcademicRecordReference'
}
attribute_map = {
'student_academic_record_re... | true | true |
1c49d846d74671fb13187159a9661e0807baa518 | 4,859 | py | Python | SecML/src/secml/ml/kernels/c_kernel_poly.py | dsolanno/Poisoning-Attacks-on-Algorithmic-Fairness | 77698340906fd0ec68d857315283d849e236ebd7 | [
"MIT"
] | 5 | 2020-07-09T13:03:34.000Z | 2021-02-16T17:15:26.000Z | SecML/src/secml/ml/kernels/c_kernel_poly.py | dsolanno/Poisoning-Attacks-on-Algorithmic-Fairness | 77698340906fd0ec68d857315283d849e236ebd7 | [
"MIT"
] | 1 | 2021-12-30T21:11:50.000Z | 2021-12-30T21:11:50.000Z | SecML/src/secml/ml/kernels/c_kernel_poly.py | dsolanno/Poisoning-Attacks-on-Algorithmic-Fairness | 77698340906fd0ec68d857315283d849e236ebd7 | [
"MIT"
] | 2 | 2021-03-22T19:22:56.000Z | 2021-09-19T20:07:10.000Z | """
.. module:: CKernelPoly
:synopsis: Polynomial kernel
.. moduleauthor:: Battista Biggio <battista.biggio@unica.it>
.. moduleauthor:: Marco Melis <marco.melis@unica.it>
"""
from sklearn import metrics
from secml.array import CArray
from secml.ml.kernels import CKernel
class CKernelPoly(CKernel):
"""Polyno... | 27.297753 | 110 | 0.570076 | from sklearn import metrics
from secml.array import CArray
from secml.ml.kernels import CKernel
class CKernelPoly(CKernel):
__class_type = 'poly'
def __init__(self, degree=2, gamma=1.0, coef0=1.0):
self.degree = degree
self.gamma = gamma
self.coef0 = coef0
super(CKe... | true | true |
1c49d916365ec2c44186d26762ebf015bff76d09 | 246 | py | Python | setup.py | dartmouthrobotics/gds_tools | 35b26b32b0d59fccf08050014bd60fd8b97fd5aa | [
"MIT"
] | null | null | null | setup.py | dartmouthrobotics/gds_tools | 35b26b32b0d59fccf08050014bd60fd8b97fd5aa | [
"MIT"
] | null | null | null | setup.py | dartmouthrobotics/gds_tools | 35b26b32b0d59fccf08050014bd60fd8b97fd5aa | [
"MIT"
] | null | null | null | from distutils.core import setup
from catkin_pkg.python_setup import generate_distutils_setup
# fetch values from package.xml
setup_args = generate_distutils_setup(
packages=['gds_tools'],
package_dir={'': 'src'},
)
setup(**setup_args)
| 22.363636 | 60 | 0.768293 | from distutils.core import setup
from catkin_pkg.python_setup import generate_distutils_setup
setup_args = generate_distutils_setup(
packages=['gds_tools'],
package_dir={'': 'src'},
)
setup(**setup_args)
| true | true |
1c49da5e3caa5cc5693ed524f38852b909517aba | 19,014 | py | Python | nova/network/security_group/quantum_driver.py | bopopescu/Nova-31 | cabc3f7a905ea982cf9d2832a3990ae8e061d963 | [
"Apache-2.0"
] | 1 | 2021-04-08T10:13:03.000Z | 2021-04-08T10:13:03.000Z | nova/network/security_group/quantum_driver.py | bopopescu/Nova-31 | cabc3f7a905ea982cf9d2832a3990ae8e061d963 | [
"Apache-2.0"
] | null | null | null | nova/network/security_group/quantum_driver.py | bopopescu/Nova-31 | cabc3f7a905ea982cf9d2832a3990ae8e061d963 | [
"Apache-2.0"
] | 1 | 2020-07-24T08:19:18.000Z | 2020-07-24T08:19:18.000Z | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2013 Nicira, Inc.
# All Rights Reserved
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/lic... | 43.610092 | 79 | 0.592879 |
from oslo.config import cfg
from quantumclient.common import exceptions as q_exc
from quantumclient.quantum import v2_0 as quantumv20
from webob import exc
from nova.compute import api as compute_api
from nova import exception
from nova.network import quantumv2
from nova.network.security_group impor... | true | true |
1c49db13db2a6633c33e03c70a86b0802f23aadc | 734 | py | Python | dashboard/migrations/0003_auto_20210922_0014.py | scholarsportal/sp_ask_admin_dashboard | 0aa99197a74d30f6b2634ce4d4e9a4654828e2ba | [
"MIT"
] | 1 | 2021-06-30T09:23:07.000Z | 2021-06-30T09:23:07.000Z | dashboard/migrations/0003_auto_20210922_0014.py | scholarsportal/sp_ask_admin_dashboard | 0aa99197a74d30f6b2634ce4d4e9a4654828e2ba | [
"MIT"
] | 9 | 2021-07-02T04:09:23.000Z | 2021-07-06T07:06:38.000Z | dashboard/migrations/0003_auto_20210922_0014.py | scholarsportal/sp_ask_admin_dashboard | 0aa99197a74d30f6b2634ce4d4e9a4654828e2ba | [
"MIT"
] | 1 | 2021-11-30T20:47:56.000Z | 2021-11-30T20:47:56.000Z | # Generated by Django 2.2.19 on 2021-09-22 04:14
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('dashboard', '0002_auto_20210922_0012'),
]
operations = [
migrations.RenameModel(
old_name='Chat',
new_name='ChatLig... | 28.230769 | 103 | 0.621253 |
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('dashboard', '0002_auto_20210922_0012'),
]
operations = [
migrations.RenameModel(
old_name='Chat',
new_name='ChatLightAssessment',
),
migrations.Add... | true | true |
1c49ddc3493976e66b9bc28cf93b54ccaa8092da | 1,496 | py | Python | person_sim_shr/turtle_tf_3d/scripts/turtle_tf_broadcaster.py | AssistiveRoboticsUNH/smart-home | 0ace1c619a4a2760640ba80866c5ae96a552243f | [
"MIT"
] | 1 | 2021-09-09T21:24:53.000Z | 2021-09-09T21:24:53.000Z | person_sim_shr/turtle_tf_3d/scripts/turtle_tf_broadcaster.py | AssistiveRoboticsUNH/smart-home | 0ace1c619a4a2760640ba80866c5ae96a552243f | [
"MIT"
] | 2 | 2020-06-25T06:44:59.000Z | 2020-06-25T13:54:36.000Z | person_sim_shr/turtle_tf_3d/scripts/turtle_tf_broadcaster.py | AssistiveRoboticsUNH/smart-home | 0ace1c619a4a2760640ba80866c5ae96a552243f | [
"MIT"
] | 2 | 2020-07-01T02:36:20.000Z | 2020-09-01T07:34:14.000Z | #!/usr/bin/env python
import rospy
import tf
from turtle_tf_3d.get_model_gazebo_pose import GazeboModel
import time
def handle_turtle_pose(pose_msg, robot_name):
br = tf.TransformBroadcaster()
br.sendTransform((pose_msg.position.x,pose_msg.position.y,pose_msg.position.z),
(pose_msg.... | 32.521739 | 115 | 0.653075 |
import rospy
import tf
from turtle_tf_3d.get_model_gazebo_pose import GazeboModel
import time
def handle_turtle_pose(pose_msg, robot_name):
br = tf.TransformBroadcaster()
br.sendTransform((pose_msg.position.x,pose_msg.position.y,pose_msg.position.z),
(pose_msg.orientation.x,pose_msg.... | false | true |
1c49e00453cdcd61b12b653597c4d0488629ad01 | 14,791 | py | Python | tests/tests/test_compressor.py | karlwnw/django-pipeline | eeb92660c18d969b955e0115ab909a64fb16d92e | [
"MIT"
] | 598 | 2015-12-18T01:25:23.000Z | 2022-03-31T13:57:01.000Z | tests/tests/test_compressor.py | karlwnw/django-pipeline | eeb92660c18d969b955e0115ab909a64fb16d92e | [
"MIT"
] | 288 | 2015-12-18T01:30:20.000Z | 2022-02-22T16:02:12.000Z | tests/tests/test_compressor.py | karlwnw/django-pipeline | eeb92660c18d969b955e0115ab909a64fb16d92e | [
"MIT"
] | 178 | 2015-12-20T06:58:57.000Z | 2022-03-04T21:53:43.000Z | import base64
import io
import os
import sys
try:
from mock import patch
except ImportError:
from unittest.mock import patch # noqa
from unittest import skipIf, skipUnless
from django.conf import settings
from django.test import TestCase
from django.test.client import RequestFactory
from pipeline.compresso... | 51.898246 | 1,213 | 0.685687 | import base64
import io
import os
import sys
try:
from mock import patch
except ImportError:
from unittest.mock import patch
from unittest import skipIf, skipUnless
from django.conf import settings
from django.test import TestCase
from django.test.client import RequestFactory
from pipeline.compressors imp... | true | true |
1c49e18ac0e8dba6da218abdc4c6d3a737ca47f4 | 34,988 | py | Python | flask_backend/anime_env/Lib/site-packages/gevent/tests/test__socket_dns.py | shafqatshad/AnmieRecommenderSystem | f58d6ab2b3614aa81208ec844ef99963c988c69d | [
"Apache-2.0"
] | null | null | null | flask_backend/anime_env/Lib/site-packages/gevent/tests/test__socket_dns.py | shafqatshad/AnmieRecommenderSystem | f58d6ab2b3614aa81208ec844ef99963c988c69d | [
"Apache-2.0"
] | null | null | null | flask_backend/anime_env/Lib/site-packages/gevent/tests/test__socket_dns.py | shafqatshad/AnmieRecommenderSystem | f58d6ab2b3614aa81208ec844ef99963c988c69d | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python
# -*- coding: utf-8 -*-
from __future__ import print_function
from __future__ import absolute_import
from __future__ import division
import gevent
from gevent import monkey
import os
import re
import unittest
import socket
from time import time
import traceback
import gevent.socket as gevent_socket... | 37.865801 | 110 | 0.636933 |
from __future__ import print_function
from __future__ import absolute_import
from __future__ import division
import gevent
from gevent import monkey
import os
import re
import unittest
import socket
from time import time
import traceback
import gevent.socket as gevent_socket
import gevent.testing as greentest
fro... | true | true |
1c49e25c6e75fd9b0b06b279779a858490d11a7e | 9,520 | py | Python | nova/api/openstack/placement/microversion.py | viveknandavanam/nova | 556377b6915936467436c9d5bb33bc0e22244e1e | [
"Apache-2.0"
] | 1 | 2015-11-30T19:44:00.000Z | 2015-11-30T19:44:00.000Z | nova/api/openstack/placement/microversion.py | viveknandavanam/nova | 556377b6915936467436c9d5bb33bc0e22244e1e | [
"Apache-2.0"
] | 5 | 2018-04-12T16:44:34.000Z | 2018-05-08T13:33:05.000Z | nova/api/openstack/placement/microversion.py | viveknandavanam/nova | 556377b6915936467436c9d5bb33bc0e22244e1e | [
"Apache-2.0"
] | 3 | 2018-04-04T15:15:01.000Z | 2018-04-19T18:14:25.000Z | # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the... | 35.522388 | 78 | 0.67542 |
import collections
import inspect
import microversion_parse
import webob
import nova.api.openstack.placement.util
from nova.i18n import _
SERVICE_TYPE = 'placement'
MICROVERSION_ENVIRON = '%s.microversion' % SERVICE_TYPE
VERSIONED_METHODS = collections.defaultdict(list)
VERSIONS = [
'1.0',
... | true | true |
1c49e3447e6cad31e2cefda415baed1335d3fa12 | 16,213 | py | Python | homeassistant/const.py | 84KaliPleXon3/home-assistant-core | 7194b74580535395b5f100de98643e029bd0f1b6 | [
"Apache-2.0"
] | 2 | 2021-09-13T21:44:02.000Z | 2021-12-17T21:20:51.000Z | homeassistant/const.py | 84KaliPleXon3/home-assistant-core | 7194b74580535395b5f100de98643e029bd0f1b6 | [
"Apache-2.0"
] | 4 | 2021-02-08T20:47:39.000Z | 2022-03-12T00:33:22.000Z | homeassistant/const.py | 84KaliPleXon3/home-assistant-core | 7194b74580535395b5f100de98643e029bd0f1b6 | [
"Apache-2.0"
] | 2 | 2020-11-04T07:40:01.000Z | 2021-09-13T21:44:03.000Z | """Constants used by Home Assistant components."""
MAJOR_VERSION = 0
MINOR_VERSION = 110
PATCH_VERSION = "4"
__short_version__ = f"{MAJOR_VERSION}.{MINOR_VERSION}"
__version__ = f"{__short_version__}.{PATCH_VERSION}"
REQUIRED_PYTHON_VER = (3, 7, 0)
# Truthy date string triggers showing related deprecation warning messa... | 27.479661 | 85 | 0.784247 | MAJOR_VERSION = 0
MINOR_VERSION = 110
PATCH_VERSION = "4"
__short_version__ = f"{MAJOR_VERSION}.{MINOR_VERSION}"
__version__ = f"{__short_version__}.{PATCH_VERSION}"
REQUIRED_PYTHON_VER = (3, 7, 0)
REQUIRED_NEXT_PYTHON_VER = (3, 8, 0)
REQUIRED_NEXT_PYTHON_DATE = ""
PLATFORM_FORMAT = "{platform}.{domain}"
MATCH_ALL... | true | true |
1c49e547ddbba557b3ea3778bdb44456db6149f8 | 10,716 | py | Python | astromodels/sources/extended_source.py | abtinshahidi/astromodels | 580e972ccc69f4fad57e22030923ee27f9d59ee3 | [
"BSD-3-Clause"
] | 1 | 2019-07-05T18:36:59.000Z | 2019-07-05T18:36:59.000Z | astromodels/sources/extended_source.py | abtinshahidi/astromodels | 580e972ccc69f4fad57e22030923ee27f9d59ee3 | [
"BSD-3-Clause"
] | null | null | null | astromodels/sources/extended_source.py | abtinshahidi/astromodels | 580e972ccc69f4fad57e22030923ee27f9d59ee3 | [
"BSD-3-Clause"
] | null | null | null | import collections
import astropy.units as u
import numpy as np
from astromodels.core.spectral_component import SpectralComponent
from astromodels.core.tree import Node
from astromodels.core.units import get_units
from astromodels.functions.functions import Constant
from astromodels.sources.source import Source, EXTE... | 32.871166 | 145 | 0.60713 | import collections
import astropy.units as u
import numpy as np
from astromodels.core.spectral_component import SpectralComponent
from astromodels.core.tree import Node
from astromodels.core.units import get_units
from astromodels.functions.functions import Constant
from astromodels.sources.source import Source, EXTE... | true | true |
1c49e550917e878195d1309e7b174aba630d18ef | 714 | py | Python | setup.py | M69k65y/endpoint-logger | 96aa2513271ad984bf015c959300f31f6c2acd52 | [
"MIT"
] | null | null | null | setup.py | M69k65y/endpoint-logger | 96aa2513271ad984bf015c959300f31f6c2acd52 | [
"MIT"
] | null | null | null | setup.py | M69k65y/endpoint-logger | 96aa2513271ad984bf015c959300f31f6c2acd52 | [
"MIT"
] | null | null | null | from setuptools import setup
def readme():
with open("readme.md") as f:
return f.read()
setup(
name = "endpoint-logger",
version = "1.0.1",
description = "A Python package used to track Flask API endpoint access. (Built in Python 3)",
url = "https://github.com/M69k65y/endpoint-logger",
author = "M69k65y",
... | 23.8 | 95 | 0.680672 | from setuptools import setup
def readme():
with open("readme.md") as f:
return f.read()
setup(
name = "endpoint-logger",
version = "1.0.1",
description = "A Python package used to track Flask API endpoint access. (Built in Python 3)",
url = "https://github.com/M69k65y/endpoint-logger",
author = "M69k65y",
... | true | true |
1c49e68ee19ec34fdae4c2bd75976597c975284e | 1,683 | py | Python | pype/modules/deadline/plugins/publish/validate_deadline_connection.py | simonebarbieri/pype | a6dc83aa1300738749cbe8e5e2e6d2d1794e0289 | [
"MIT"
] | null | null | null | pype/modules/deadline/plugins/publish/validate_deadline_connection.py | simonebarbieri/pype | a6dc83aa1300738749cbe8e5e2e6d2d1794e0289 | [
"MIT"
] | null | null | null | pype/modules/deadline/plugins/publish/validate_deadline_connection.py | simonebarbieri/pype | a6dc83aa1300738749cbe8e5e2e6d2d1794e0289 | [
"MIT"
] | null | null | null | import pyblish.api
from avalon.vendor import requests
from pype.plugin import contextplugin_should_run
import os
class ValidateDeadlineConnection(pyblish.api.ContextPlugin):
"""Validate Deadline Web Service is running"""
label = "Validate Deadline Web Service"
order = pyblish.api.ValidatorOrder
host... | 34.346939 | 97 | 0.648247 | import pyblish.api
from avalon.vendor import requests
from pype.plugin import contextplugin_should_run
import os
class ValidateDeadlineConnection(pyblish.api.ContextPlugin):
label = "Validate Deadline Web Service"
order = pyblish.api.ValidatorOrder
hosts = ["maya", "nuke"]
families = ["renderlayer"]... | true | true |
1c49e6c1969a6fefd977839e22d2106128182e9a | 1,684 | py | Python | waipawama/dag/taxdoo.py | elcolumbio/waipawama | 6ca23c3a2f35ba07762fb68d6ce115ff8f826903 | [
"MIT"
] | null | null | null | waipawama/dag/taxdoo.py | elcolumbio/waipawama | 6ca23c3a2f35ba07762fb68d6ce115ff8f826903 | [
"MIT"
] | null | null | null | waipawama/dag/taxdoo.py | elcolumbio/waipawama | 6ca23c3a2f35ba07762fb68d6ce115ff8f826903 | [
"MIT"
] | null | null | null | from airflow.decorators import dag, task
from airflow.operators.python import get_current_context
from airflow.operators.bash_operator import BashOperator
import datetime
from waipawama.models.taxdoo import TaxdooMeta
def get_timespan() -> str:
"""This is our main parameter in our monthly pipeline."""
context... | 30.071429 | 73 | 0.665677 | from airflow.decorators import dag, task
from airflow.operators.python import get_current_context
from airflow.operators.bash_operator import BashOperator
import datetime
from waipawama.models.taxdoo import TaxdooMeta
def get_timespan() -> str:
context = get_current_context()
year_month = '-'.join(context['ds... | true | true |
1c49e712be10de6dccb1f07fa13fd2281c8ef4d7 | 29,322 | py | Python | pytorch/pytorchcv/models/resnet.py | oliviaweng/imgclsmob | 80fffbb46f986614b162c725b21f3d208597ac77 | [
"MIT"
] | null | null | null | pytorch/pytorchcv/models/resnet.py | oliviaweng/imgclsmob | 80fffbb46f986614b162c725b21f3d208597ac77 | [
"MIT"
] | null | null | null | pytorch/pytorchcv/models/resnet.py | oliviaweng/imgclsmob | 80fffbb46f986614b162c725b21f3d208597ac77 | [
"MIT"
] | null | null | null | """
ResNet for ImageNet-1K, implemented in PyTorch.
Original paper: 'Deep Residual Learning for Image Recognition,' https://arxiv.org/abs/1512.03385.
"""
__all__ = ['ResNet', 'resnet10', 'resnet12', 'resnet14', 'resnetbc14b', 'resnet16', 'resnet18_wd4', 'resnet18_wd2',
'resnet18_w3d4', 'resnet18', '... | 32.4 | 120 | 0.606405 |
__all__ = ['ResNet', 'resnet10', 'resnet12', 'resnet14', 'resnetbc14b', 'resnet16', 'resnet18_wd4', 'resnet18_wd2',
'resnet18_w3d4', 'resnet18', 'resnet26', 'resnetbc26b', 'resnet34', 'resnetbc38b', 'resnet50', 'resnet50b',
'resnet101', 'resnet101b', 'resnet152', 'resnet152b', 'resnet200', 'resne... | true | true |
1c49e72eda40b3456987582ab05a77a3b7b4b840 | 318 | py | Python | pajbot/tests/modules/test_two_word_variations.py | UVClay/SkookumBot | 69679c78475662e2b7948fe63d529a755c47fc80 | [
"MIT"
] | 1 | 2021-10-02T10:19:38.000Z | 2021-10-02T10:19:38.000Z | pajbot/tests/modules/test_two_word_variations.py | UVClay/SkookumBot | 69679c78475662e2b7948fe63d529a755c47fc80 | [
"MIT"
] | 64 | 2021-01-09T21:28:05.000Z | 2022-03-31T10:07:05.000Z | pajbot/tests/modules/test_two_word_variations.py | UVClay/SkookumBot | 69679c78475662e2b7948fe63d529a755c47fc80 | [
"MIT"
] | 1 | 2020-03-11T19:37:10.000Z | 2020-03-11T19:37:10.000Z | from pajbot.modules.bingo import two_word_variations
def test_two_word_variations():
assert two_word_variations("abc", "def", "KKona") == {
"abc-def": "KKona",
"abc_def": "KKona",
"abcdef": "KKona",
"def-abc": "KKona",
"def_abc": "KKona",
"defabc": "KKona",
}
| 24.461538 | 58 | 0.559748 | from pajbot.modules.bingo import two_word_variations
def test_two_word_variations():
assert two_word_variations("abc", "def", "KKona") == {
"abc-def": "KKona",
"abc_def": "KKona",
"abcdef": "KKona",
"def-abc": "KKona",
"def_abc": "KKona",
"defabc": "KKona",
}
| true | true |
1c49e7d519f97f97ba1df092341baac9cd9535c8 | 61,625 | py | Python | nltk/parse/chart.py | addisonblanda/Plato | cebd522dfe4b21f8c965f0e56637c15744817474 | [
"MIT"
] | 6 | 2017-01-22T03:15:01.000Z | 2019-12-01T16:19:36.000Z | nltk/parse/chart.py | addisonblanda/Plato | cebd522dfe4b21f8c965f0e56637c15744817474 | [
"MIT"
] | 3 | 2020-03-24T15:38:23.000Z | 2021-02-02T21:44:18.000Z | nltk/parse/chart.py | addisonblanda/Plato | cebd522dfe4b21f8c965f0e56637c15744817474 | [
"MIT"
] | 6 | 2017-01-19T21:49:55.000Z | 2021-04-14T09:57:17.000Z | # -*- coding: utf-8 -*-
# Natural Language Toolkit: A Chart Parser
#
# Copyright (C) 2001-2017 NLTK Project
# Author: Edward Loper <edloper@gmail.com>
# Steven Bird <stevenbird1@gmail.com>
# Jean Mark Gawron <gawron@mail.sdsu.edu>
# Peter Ljunglöf <peter.ljunglof@heatherleaf.se>
# URL: <http://n... | 36.637931 | 90 | 0.567675 |
from __future__ import print_function, division, unicode_literals
import itertools
import re
import warnings
from nltk import compat
from nltk.tree import Tree
from nltk.grammar import PCFG, is_nonterminal, is_terminal
from nltk.util import OrderedDict
from nltk.internals import raise_unorderable_types
fro... | true | true |
1c49e8c673c464665b7013997bb5ecdb23c0b915 | 642 | py | Python | tests/objects/message/__init__.py | mjneff2/Pincer | a11bc3e4bad319fdf927d913c58c933576ec7c99 | [
"MIT"
] | null | null | null | tests/objects/message/__init__.py | mjneff2/Pincer | a11bc3e4bad319fdf927d913c58c933576ec7c99 | [
"MIT"
] | null | null | null | tests/objects/message/__init__.py | mjneff2/Pincer | a11bc3e4bad319fdf927d913c58c933576ec7c99 | [
"MIT"
] | null | null | null | from pincer.objects import Embed
print(Embed(
title="Pincer - 0.6.4",
description=(
"🚀 An asynchronous python API wrapper meant to replace"
" discord.py\n> Snappy discord api wrapper written "
"with aiohttp & websockets"
)
).add_field(
name="**Gi... | 32.1 | 67 | 0.579439 | from pincer.objects import Embed
print(Embed(
title="Pincer - 0.6.4",
description=(
"🚀 An asynchronous python API wrapper meant to replace"
" discord.py\n> Snappy discord api wrapper written "
"with aiohttp & websockets"
)
).add_field(
name="**Gi... | true | true |
1c49e8d16ca5be1232c4449dc3a9df00edfe575b | 1,186 | py | Python | setup.py | deone/requestor | 9af13ebc90861d37dc2db4e1b1375aa445655868 | [
"MIT"
] | null | null | null | setup.py | deone/requestor | 9af13ebc90861d37dc2db4e1b1375aa445655868 | [
"MIT"
] | null | null | null | setup.py | deone/requestor | 9af13ebc90861d37dc2db4e1b1375aa445655868 | [
"MIT"
] | null | null | null | # Always prefer setuptools over distutils
from setuptools import setup
# To use a consistent encoding
from codecs import open
from os import path
here = path.abspath(path.dirname(__file__))
# Get the long description from the README file
with open(path.join(here, 'README.rst'), encoding='utf-8') as f:
long_descri... | 33.885714 | 122 | 0.676223 |
from setuptools import setup
from codecs import open
from os import path
here = path.abspath(path.dirname(__file__))
with open(path.join(here, 'README.rst'), encoding='utf-8') as f:
long_description = f.read()
setup(
name='requestor',
version='0.1.1',
description='Use this package to make HTTP pos... | true | true |
1c49e9bafda8707fe36fdbba4d19f3bf3c46ee9e | 43,586 | py | Python | codalab/apps/web/migrations/0063_CompetitionDump.py | AIMultimediaLab/AI4Media-EaaS-prototype-Py2-public | 64cd6ac9a56a4e2d40d93608d4289b1a0e50cce7 | [
"Apache-2.0"
] | 333 | 2015-12-29T22:49:40.000Z | 2022-03-27T12:01:57.000Z | codalab/apps/web/migrations/0063_CompetitionDump.py | AIMultimediaLab/AI4Media-EaaS-prototype-Py2-public | 64cd6ac9a56a4e2d40d93608d4289b1a0e50cce7 | [
"Apache-2.0"
] | 1,572 | 2015-12-28T21:54:00.000Z | 2022-03-31T13:00:32.000Z | codalab/apps/web/migrations/0063_CompetitionDump.py | AIMultimediaLab/AI4Media-EaaS-prototype-Py2-public | 64cd6ac9a56a4e2d40d93608d4289b1a0e50cce7 | [
"Apache-2.0"
] | 107 | 2016-01-08T03:46:07.000Z | 2022-03-16T08:43:57.000Z | # -*- coding: utf-8 -*-
from south.utils import datetime_utils as datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding model 'CompetitionDump'
db.create_table(u'web_competitiondump', ... | 91.76 | 260 | 0.576079 |
from south.utils import datetime_utils as datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
db.create_table(u'web_competitiondump', (
(u'id', self.gf('django.db.models.fields.... | true | true |
1c49ea49846f00cd469bd4230329f98ec6de0734 | 3,872 | py | Python | tensorflow/python/autograph/tests/basic_list_test.py | Stevanus-Christian/tensorflow | d44afcf5ca16c5d704c66f891b99eac804e7cd14 | [
"Apache-2.0"
] | 3 | 2022-03-09T01:39:56.000Z | 2022-03-30T23:17:58.000Z | tensorflow/python/autograph/tests/basic_list_test.py | Stevanus-Christian/tensorflow | d44afcf5ca16c5d704c66f891b99eac804e7cd14 | [
"Apache-2.0"
] | 1 | 2020-08-01T05:40:12.000Z | 2020-08-01T05:40:12.000Z | tensorflow/python/autograph/tests/basic_list_test.py | Stevanus-Christian/tensorflow | d44afcf5ca16c5d704c66f891b99eac804e7cd14 | [
"Apache-2.0"
] | 1 | 2022-03-22T00:45:15.000Z | 2022-03-22T00:45:15.000Z | # Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 27.267606 | 80 | 0.685692 |
import tensorflow as tf
from tensorflow.python import autograph as ag
from tensorflow.python.autograph.tests import reference_test_base
def type_not_annotated(n):
l = []
for i in range(n):
l.append(i)
return ag.stack(l, strict=False)
def element_access():
l = []
l.append(1)
l.appe... | true | true |
1c49ea6e4d435b59d0f0cb4c10b9268eb44ceb65 | 2,196 | py | Python | python_example/python_example.py | markbentzjr/TroyBot | 3be3afa6ae05b889c505f7ab2cc140cc368d1c05 | [
"MIT"
] | 1 | 2018-11-24T12:50:51.000Z | 2018-11-24T12:50:51.000Z | python_example/python_example.py | markbentzjr/TroyBot | 3be3afa6ae05b889c505f7ab2cc140cc368d1c05 | [
"MIT"
] | null | null | null | python_example/python_example.py | markbentzjr/TroyBot | 3be3afa6ae05b889c505f7ab2cc140cc368d1c05 | [
"MIT"
] | null | null | null | import math
from rlbot.agents.base_agent import BaseAgent, SimpleControllerState
from rlbot.utils.structures.game_data_struct import GameTickPacket
class PythonExample(BaseAgent):
def initialize_agent(self):
#This runs once before the bot starts up
self.controller_state = SimpleControllerState()... | 30.929577 | 105 | 0.656193 | import math
from rlbot.agents.base_agent import BaseAgent, SimpleControllerState
from rlbot.utils.structures.game_data_struct import GameTickPacket
class PythonExample(BaseAgent):
def initialize_agent(self):
self.controller_state = SimpleControllerState()
def get_output(self, packet: GameT... | true | true |
1c49eae527f808a327985c9ccfa493755d812372 | 2,038 | py | Python | util/log.py | brunomateus/open_source_android_apps | 143deea78ff125b4dd5e88b89f48dc3a9e8bcdfa | [
"MIT"
] | 2 | 2019-11-18T18:01:27.000Z | 2021-05-13T18:16:17.000Z | util/log.py | brunomateus/open_source_android_apps | 143deea78ff125b4dd5e88b89f48dc3a9e8bcdfa | [
"MIT"
] | null | null | null | util/log.py | brunomateus/open_source_android_apps | 143deea78ff125b4dd5e88b89f48dc3a9e8bcdfa | [
"MIT"
] | 3 | 2019-07-18T19:33:04.000Z | 2021-01-13T21:13:29.000Z | """Maintain a global logger instance."""
import logging
from typing import IO, Text
import github3
import urllib3
import neo4j
LOG_LEVEL = logging.WARNING
LOG_FORMAT = '%(asctime)s | [%(levelname)s] %(name)s: %(message)s'
LEVELS = [
logging.NOTSET, logging.DEBUG, logging.INFO, logging.WARNING,
logging.ERROR, ... | 30.41791 | 79 | 0.683023 | import logging
from typing import IO, Text
import github3
import urllib3
import neo4j
LOG_LEVEL = logging.WARNING
LOG_FORMAT = '%(asctime)s | [%(levelname)s] %(name)s: %(message)s'
LEVELS = [
logging.NOTSET, logging.DEBUG, logging.INFO, logging.WARNING,
logging.ERROR, logging.CRITICAL]
def compute_level(ver... | true | true |
1c49eb59478315cee1ec4654e6fbc849582a0094 | 1,528 | py | Python | caldavclientlibrary/admin/xmlaccounts/manage.py | LaudateCorpus1/ccs-caldavclientlibrary | 5b1db7f3b49f03ba715f7286f71ddb9f54ddddac | [
"Apache-2.0"
] | 49 | 2016-08-22T17:34:34.000Z | 2021-11-08T09:47:45.000Z | caldavclientlibrary/admin/xmlaccounts/manage.py | DalavanCloud/ccs-caldavclientlibrary | ce8d554b8a0bcb13468f2dc87eef77da2302d6b3 | [
"Apache-2.0"
] | null | null | null | caldavclientlibrary/admin/xmlaccounts/manage.py | DalavanCloud/ccs-caldavclientlibrary | ce8d554b8a0bcb13468f2dc87eef77da2302d6b3 | [
"Apache-2.0"
] | 18 | 2017-01-21T22:28:04.000Z | 2022-03-26T11:57:30.000Z | ##
# Copyright (c) 2007-2016 Apple Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable l... | 26.344828 | 74 | 0.674084 |
from caldavclientlibrary.admin.xmlaccounts.commands import registered
import sys
def usage():
"""
Print out the command line usage.
"""
cmds = registered.keys()
cmds.sort()
print """USAGE: manage CMD [OPTIONS]
CMD: one of:
%s
OPTIONS: specific to each command, use --help with... | false | true |
1c49eb7bdb4418c37bc8952b6d14fa22f15819b6 | 1,033 | py | Python | authen/views.py | ozcanyarimdunya/django_authen | fdb48a65d6f4ac4bb2fc09e3b7f024b3a41dd71b | [
"MIT"
] | null | null | null | authen/views.py | ozcanyarimdunya/django_authen | fdb48a65d6f4ac4bb2fc09e3b7f024b3a41dd71b | [
"MIT"
] | 2 | 2020-02-11T23:05:32.000Z | 2020-06-05T18:43:16.000Z | authen/views.py | ozcanyarimdunya/django_authen | fdb48a65d6f4ac4bb2fc09e3b7f024b3a41dd71b | [
"MIT"
] | null | null | null | from django.contrib.auth.mixins import LoginRequiredMixin
from django.contrib.auth.views import LoginView, LogoutView
from django.conf import settings
class Login(LoginView):
template_name = "authen/login.html"
def get_success_url(self):
return "/"
def get_context_data(self, **kwargs):
c... | 32.28125 | 81 | 0.684414 | from django.contrib.auth.mixins import LoginRequiredMixin
from django.contrib.auth.views import LoginView, LogoutView
from django.conf import settings
class Login(LoginView):
template_name = "authen/login.html"
def get_success_url(self):
return "/"
def get_context_data(self, **kwargs):
c... | true | true |
1c49ecb6fa75797648420f768e466984724c7b7a | 782 | py | Python | scripts/beam_pairs.py | RolT/ZRTools | 47aa156b660224fd123582c832bb5e5525c262d8 | [
"BSD-3-Clause"
] | 25 | 2015-08-06T20:15:30.000Z | 2021-08-30T15:12:42.000Z | scripts/beam_pairs.py | RolT/ZRTools | 47aa156b660224fd123582c832bb5e5525c262d8 | [
"BSD-3-Clause"
] | 2 | 2017-07-21T11:06:35.000Z | 2020-02-27T13:20:34.000Z | scripts/beam_pairs.py | RolT/ZRTools | 47aa156b660224fd123582c832bb5e5525c262d8 | [
"BSD-3-Clause"
] | 16 | 2015-08-06T21:16:55.000Z | 2020-07-09T08:05:50.000Z | #!/usr/bin/env python
#
# Copyright 2011-2012 Johns Hopkins University (Author: Aren Jansen)
#
from __future__ import division
import sys
import os
import re
import string
import random
beamwidth = int(sys.argv[1])
baselist = []
for line in sys.stdin:
base = line.strip()
baselist.append(base)
if beamwidt... | 21.135135 | 69 | 0.621483 |
from __future__ import division
import sys
import os
import re
import string
import random
beamwidth = int(sys.argv[1])
baselist = []
for line in sys.stdin:
base = line.strip()
baselist.append(base)
if beamwidth == 0:
random.shuffle(baselist)
for n in range(len(baselist)):
for m in ran... | true | true |
1c49ed056770080f895f299b51a9ce278a83c276 | 309 | py | Python | oommfc/tests/test_stt.py | gamdow/oommfc | de33ae2a8348ca78d9e16fe18bc562393703c215 | [
"BSD-3-Clause"
] | null | null | null | oommfc/tests/test_stt.py | gamdow/oommfc | de33ae2a8348ca78d9e16fe18bc562393703c215 | [
"BSD-3-Clause"
] | null | null | null | oommfc/tests/test_stt.py | gamdow/oommfc | de33ae2a8348ca78d9e16fe18bc562393703c215 | [
"BSD-3-Clause"
] | null | null | null | import pytest
import oommfc as oc
import micromagneticmodel.tests as mmt
class TestSTT(mmt.TestSTT):
def test_script(self):
for arg in self.valid_args:
u, beta = arg
stt = oc.STT(u, beta)
with pytest.raises(NotImplementedError):
stt._script()
| 23.769231 | 52 | 0.614887 | import pytest
import oommfc as oc
import micromagneticmodel.tests as mmt
class TestSTT(mmt.TestSTT):
def test_script(self):
for arg in self.valid_args:
u, beta = arg
stt = oc.STT(u, beta)
with pytest.raises(NotImplementedError):
stt._script()
| true | true |
1c49ede342e3b5381a8d05e606d45887e3cb7caf | 569 | py | Python | src/Lexer/token_types.py | Sword-And-Rose/Simple-Interpreter | 471b962e385ade5b18e1b1b785cd0d7529011144 | [
"MIT"
] | 1 | 2019-07-19T16:27:31.000Z | 2019-07-19T16:27:31.000Z | src/Lexer/token_types.py | HorizonFTT/Simple-Interpreter | 471b962e385ade5b18e1b1b785cd0d7529011144 | [
"MIT"
] | null | null | null | src/Lexer/token_types.py | HorizonFTT/Simple-Interpreter | 471b962e385ade5b18e1b1b785cd0d7529011144 | [
"MIT"
] | null | null | null | INTEGER = 'INTEGER'
REAL = 'REAL'
INTEGER_CONST = 'INTEGER_CONST'
REAL_CONST = 'REAL_CONST'
STRING = 'STRING'
STRING_CONST = 'STRING_CONST'
PLUS = '+'
MINUS = '-'
MUL = '*'
INTEGER_DIV = 'DIV'
FLOAT_DIV = '/'
LESS_THAN = '<'
GREATER_THAN = '>'
EQUAL = '='
LPAREN = '('
RPAREN = ')'
ID = 'ID'
ASSIGN = ':='
BEGIN = 'BEGIN... | 14.973684 | 31 | 0.58348 | INTEGER = 'INTEGER'
REAL = 'REAL'
INTEGER_CONST = 'INTEGER_CONST'
REAL_CONST = 'REAL_CONST'
STRING = 'STRING'
STRING_CONST = 'STRING_CONST'
PLUS = '+'
MINUS = '-'
MUL = '*'
INTEGER_DIV = 'DIV'
FLOAT_DIV = '/'
LESS_THAN = '<'
GREATER_THAN = '>'
EQUAL = '='
LPAREN = '('
RPAREN = ')'
ID = 'ID'
ASSIGN = ':='
BEGIN = 'BEGIN... | true | true |
1c49eea08a2dfc05dfb02ffb03ad6b610d781514 | 248 | py | Python | idm/commands/bind_chat.py | Ruslan21473/IDM2 | 27adc319e753173e63b1d790caec993b920f2823 | [
"MIT"
] | null | null | null | idm/commands/bind_chat.py | Ruslan21473/IDM2 | 27adc319e753173e63b1d790caec993b920f2823 | [
"MIT"
] | null | null | null | idm/commands/bind_chat.py | Ruslan21473/IDM2 | 27adc319e753173e63b1d790caec993b920f2823 | [
"MIT"
] | null | null | null | from ..objects import dp, Event
from ..utils import new_message
@dp.event_handle(dp.Methods.BIND_CHAT)
def bind_chat(event: Event) -> str:
new_message(event.api, event.chat.peer_id,
message=f"✅ Беседа распознана.")
return "ok" | 31 | 47 | 0.701613 | from ..objects import dp, Event
from ..utils import new_message
@dp.event_handle(dp.Methods.BIND_CHAT)
def bind_chat(event: Event) -> str:
new_message(event.api, event.chat.peer_id,
message=f"✅ Беседа распознана.")
return "ok" | true | true |
1c49efc05a3a126007cf12dd6346fb8bbdb8cd2f | 898 | py | Python | simanalysis.py | EndyLab/spaceballs | 331ce388674a4b01b56b36dfb3dda26729b107e6 | [
"MIT"
] | 1 | 2017-10-19T07:41:26.000Z | 2017-10-19T07:41:26.000Z | simanalysis.py | EndyLab/spaceballs | 331ce388674a4b01b56b36dfb3dda26729b107e6 | [
"MIT"
] | 1 | 2017-10-19T07:42:12.000Z | 2017-10-19T07:42:12.000Z | simanalysis.py | EndyLab/spaceballs | 331ce388674a4b01b56b36dfb3dda26729b107e6 | [
"MIT"
] | null | null | null | """
Created by Akshay Maheshwari
09/05/2017
Produces analysis figures from experiment data
"""
from simanalysis_methods import *
import matplotlib.pyplot as plt
import time;
start_time=time.time()
expt_name = "171018_2219"
outputlist = loadOutputList(expt_name,'molpos')
histlistpklpath = combinePkls(expt_name,outputl... | 44.9 | 214 | 0.752784 | from simanalysis_methods import *
import matplotlib.pyplot as plt
import time;
start_time=time.time()
expt_name = "171018_2219"
outputlist = loadOutputList(expt_name,'molpos')
histlistpklpath = combinePkls(expt_name,outputlist,covertime=True)
fig = plotHist(histlistpklpath,expt_name,diameter=0.1, graphs="all", logsca... | true | true |
1c49f0117ce0749903b3f36e283ae1b91cd3b22f | 825 | py | Python | GameMenu.py | KRHS-GameProgramming-2015/King-of-the-Pile | 1368c97ba8124e27f74c6f8aae8e1f8362126934 | [
"BSD-2-Clause"
] | 1 | 2015-12-15T17:39:08.000Z | 2015-12-15T17:39:08.000Z | GameMenu.py | KRHS-GameProgramming-2015/King-of-the-Pile | 1368c97ba8124e27f74c6f8aae8e1f8362126934 | [
"BSD-2-Clause"
] | 4 | 2015-12-21T17:06:51.000Z | 2016-02-10T16:50:57.000Z | GameMenu.py | KRHS-GameProgramming-2015/King-of-the-Pile | 1368c97ba8124e27f74c6f8aae8e1f8362126934 | [
"BSD-2-Clause"
] | null | null | null | import sys, pygame, math, random
from Button import *
class Menu():
def __init__(self, images):
self.images = []
for image in images:
#print image
self.images += [pygame.image.load(image)]
self.image = self.images[0]
self.rect = self.image.get_rect()
... | 21.153846 | 56 | 0.466667 | import sys, pygame, math, random
from Button import *
class Menu():
def __init__(self, images):
self.images = []
for image in images:
self.images += [pygame.image.load(image)]
self.image = self.images[0]
self.rect = self.image.get_rect()
self.origi... | true | true |
1c49f01f22cbc23cfecb70fb36d3a72ff0991e5f | 8,685 | py | Python | python/paddle_serving_app/local_predict.py | hysunflower/Serving | 50d0c2900f3385b049f76b91e38cc69d8e8a102d | [
"Apache-2.0"
] | null | null | null | python/paddle_serving_app/local_predict.py | hysunflower/Serving | 50d0c2900f3385b049f76b91e38cc69d8e8a102d | [
"Apache-2.0"
] | null | null | null | python/paddle_serving_app/local_predict.py | hysunflower/Serving | 50d0c2900f3385b049f76b91e38cc69d8e8a102d | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
"""
# Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
... | 38.092105 | 81 | 0.595855 |
import os
import google.protobuf.text_format
import numpy as np
import argparse
import paddle.fluid as fluid
import paddle.inference as inference
from .proto import general_model_config_pb2 as m_config
from paddle.fluid.core import PaddleTensor
from paddle.fluid.core import AnalysisConfig
from paddle.fluid.core impor... | true | true |
1c49f06dffa7d3da20a9bd4b1507a6abb441f68a | 98 | py | Python | src/sports_halls/apps.py | codacy-badger/hbscorez | 215e4d2617ac9be91bb9d561bbfc552349cd4781 | [
"MIT"
] | 12 | 2018-03-20T21:38:53.000Z | 2021-10-31T10:00:12.000Z | src/sports_halls/apps.py | codacy-badger/hbscorez | 215e4d2617ac9be91bb9d561bbfc552349cd4781 | [
"MIT"
] | 79 | 2018-03-18T14:26:47.000Z | 2022-03-01T15:51:40.000Z | src/sports_halls/apps.py | codacy-badger/hbscorez | 215e4d2617ac9be91bb9d561bbfc552349cd4781 | [
"MIT"
] | 4 | 2018-05-18T15:39:56.000Z | 2020-10-29T09:28:41.000Z | from django.apps import AppConfig
class SportsHallsConfig(AppConfig):
name = 'sports_halls'
| 16.333333 | 35 | 0.77551 | from django.apps import AppConfig
class SportsHallsConfig(AppConfig):
name = 'sports_halls'
| true | true |
1c49f0af27c73266029ce93f22052346da2d9b95 | 5,439 | py | Python | zerver/lib/bugdown/api_code_examples.py | fearless0307/zulip | 378d14af7ea73a9a83c7245706cd918bec5a37bf | [
"Apache-2.0"
] | 4 | 2019-06-04T09:06:53.000Z | 2019-06-04T09:07:47.000Z | zerver/lib/bugdown/api_code_examples.py | fearless0307/zulip | 378d14af7ea73a9a83c7245706cd918bec5a37bf | [
"Apache-2.0"
] | 10 | 2019-02-26T11:10:42.000Z | 2019-02-26T14:30:24.000Z | zerver/lib/bugdown/api_code_examples.py | fearless0307/zulip | 378d14af7ea73a9a83c7245706cd918bec5a37bf | [
"Apache-2.0"
] | 1 | 2020-01-07T15:49:54.000Z | 2020-01-07T15:49:54.000Z | import re
import json
import inspect
from markdown.extensions import Extension
from markdown.preprocessors import Preprocessor
from typing import Any, Dict, Optional, List
import markdown
import zerver.lib.api_test_helpers
from zerver.lib.openapi import get_openapi_fixture
MACRO_REGEXP = re.compile(r'\{generate_code... | 33.99375 | 116 | 0.596249 | import re
import json
import inspect
from markdown.extensions import Extension
from markdown.preprocessors import Preprocessor
from typing import Any, Dict, Optional, List
import markdown
import zerver.lib.api_test_helpers
from zerver.lib.openapi import get_openapi_fixture
MACRO_REGEXP = re.compile(r'\{generate_code... | true | true |
1c49f0b92cb9d9dcfa236360b7e8067165742279 | 15,373 | py | Python | tests/test_absorption_spectrum.py | foggie-sims/trident | c5902a066ed87dc760f620d502c3e644bf93d450 | [
"BSD-3-Clause-Clear"
] | null | null | null | tests/test_absorption_spectrum.py | foggie-sims/trident | c5902a066ed87dc760f620d502c3e644bf93d450 | [
"BSD-3-Clause-Clear"
] | 5 | 2020-11-18T11:58:08.000Z | 2022-02-24T10:40:50.000Z | tests/test_absorption_spectrum.py | foggie-sims/trident | c5902a066ed87dc760f620d502c3e644bf93d450 | [
"BSD-3-Clause-Clear"
] | 1 | 2022-03-29T17:44:56.000Z | 2022-03-29T17:44:56.000Z | """
Unit test for the AbsorptionSpectrum analysis module
"""
#-----------------------------------------------------------------------------
# Copyright (c) 2014-2017, yt Development Team.
# Copyright (c) 2017, Trident Development Team.
#
# Distributed under the terms of the Modified BSD License.
#
# The full license i... | 36.34279 | 83 | 0.564366 |
import numpy as np
import os
from yt.loaders import load
from yt.testing import \
assert_allclose_units, \
assert_almost_equal
from trident.absorption_spectrum.absorption_line import \
voigt
from trident.absorption_spectrum.absorption_spectrum import \
AbsorptionSpectrum
from trident.light_ra... | true | true |
1c49f0f3bf54c9438b56d4e5b82e5dc16b9dd8e7 | 4,982 | py | Python | tests/unit/test_models/test_full_battery_models/test_lithium_ion/test_dfn.py | NunoEdgarGFlowHub/PyBaMM | 4e4e1ab8c488b0c0a6efdb9934c5ac59e947a190 | [
"BSD-3-Clause"
] | null | null | null | tests/unit/test_models/test_full_battery_models/test_lithium_ion/test_dfn.py | NunoEdgarGFlowHub/PyBaMM | 4e4e1ab8c488b0c0a6efdb9934c5ac59e947a190 | [
"BSD-3-Clause"
] | null | null | null | tests/unit/test_models/test_full_battery_models/test_lithium_ion/test_dfn.py | NunoEdgarGFlowHub/PyBaMM | 4e4e1ab8c488b0c0a6efdb9934c5ac59e947a190 | [
"BSD-3-Clause"
] | null | null | null | #
# Tests for the lithium-ion DFN model
#
import pybamm
import unittest
class TestDFN(unittest.TestCase):
def test_well_posed(self):
options = {"thermal": "isothermal"}
model = pybamm.lithium_ion.DFN(options)
model.check_well_posedness()
def test_well_posed_2plus1D(self):
opti... | 32.776316 | 79 | 0.633681 |
import pybamm
import unittest
class TestDFN(unittest.TestCase):
def test_well_posed(self):
options = {"thermal": "isothermal"}
model = pybamm.lithium_ion.DFN(options)
model.check_well_posedness()
def test_well_posed_2plus1D(self):
options = {"current collector": "potential ... | true | true |
1c49f156253c1ee5a0762a2795736557c9bddbfb | 3,641 | py | Python | engine/account/forms.py | NamoxLabs/BlogEngine | 741549e78b58bbc857e9dcecd88034de49d73304 | [
"BSD-3-Clause"
] | 1 | 2018-12-28T04:57:41.000Z | 2018-12-28T04:57:41.000Z | engine/account/forms.py | NamoxLabs/BlogEngine | 741549e78b58bbc857e9dcecd88034de49d73304 | [
"BSD-3-Clause"
] | null | null | null | engine/account/forms.py | NamoxLabs/BlogEngine | 741549e78b58bbc857e9dcecd88034de49d73304 | [
"BSD-3-Clause"
] | 2 | 2019-01-25T04:34:55.000Z | 2020-04-11T09:01:24.000Z | #from captcha.fields import ReCaptchaField
from django import forms
from django.conf import settings
from django.contrib.auth import forms as django_forms, update_session_auth_hash
from django.utils.translation import pgettext, pgettext_lazy
#from . import models(User)
from . import models
"""
class FormWithReCaptcha... | 36.777778 | 86 | 0.675639 |
from django import forms
from django.conf import settings
from django.contrib.auth import forms as django_forms, update_session_auth_hash
from django.utils.translation import pgettext, pgettext_lazy
from . import models
class ChangePasswordForm(django_forms.PasswordChangeForm):
def __init__(self, *args, **kwar... | true | true |
1c49f162a350f2ebbca239c540dffc96e43e2bae | 2,574 | py | Python | src/pages/gallery/awesome_panel_express_tests/test_markdown.py | jlstevens/awesome-panel | c67b0f4529a3ce6a8517648f49fef8358e2e2c8b | [
"Apache-2.0"
] | null | null | null | src/pages/gallery/awesome_panel_express_tests/test_markdown.py | jlstevens/awesome-panel | c67b0f4529a3ce6a8517648f49fef8358e2e2c8b | [
"Apache-2.0"
] | null | null | null | src/pages/gallery/awesome_panel_express_tests/test_markdown.py | jlstevens/awesome-panel | c67b0f4529a3ce6a8517648f49fef8358e2e2c8b | [
"Apache-2.0"
] | null | null | null | """In this module we test the `Markdown` functionality of `awesome_panel.express`
The `Markdown` functionality of Panel is limited as it does not support
- One liners for using Markdown from files
- Code blocks
- Indented Markdown text as is often what is used in Editors like VS Code.
Please note you need to run `Co... | 25.74 | 97 | 0.688423 | import pathlib
import panel as pn
import awesome_panel.express as pnx
from awesome_panel.express.testing import TestApp
TEST_MD_FILE = pathlib.Path(__file__).parent / "data" / "test.md"
pnx.Code.extend()
def test_markdown():
return TestApp(
test_markdown,
pnx.Markdown("# Header", name="basic",... | true | true |
1c49f2142861df2d045a482002a519a24cbcd848 | 2,022 | py | Python | tests/nuodb_crypt_test.py | jgetto/nuodb-python | 3a22260e801d8f9d9bd33f911a694e8caeba7282 | [
"BSD-3-Clause"
] | null | null | null | tests/nuodb_crypt_test.py | jgetto/nuodb-python | 3a22260e801d8f9d9bd33f911a694e8caeba7282 | [
"BSD-3-Clause"
] | null | null | null | tests/nuodb_crypt_test.py | jgetto/nuodb-python | 3a22260e801d8f9d9bd33f911a694e8caeba7282 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
import pynuodb
import unittest
from nuodb_base import NuoBase
class NuoDBBasicTest(unittest.TestCase):
def test_toByteString(self):
self.assertEqual(pynuodb.crypt.toSignedByteString(1), '01'.decode('hex'))
self.assertEqual(pynuodb.crypt.toSignedByteString(127), '7F'.dec... | 54.648649 | 106 | 0.720574 |
import pynuodb
import unittest
from nuodb_base import NuoBase
class NuoDBBasicTest(unittest.TestCase):
def test_toByteString(self):
self.assertEqual(pynuodb.crypt.toSignedByteString(1), '01'.decode('hex'))
self.assertEqual(pynuodb.crypt.toSignedByteString(127), '7F'.decode('hex'))
s... | true | true |
1c49f2b7d071ce1ebf896fca28a137a5869de6d1 | 4,909 | py | Python | DQMOffline/Configuration/python/DQMOfflineCosmics_SecondStep_cff.py | vjmastra/cmssw | de96df37dbaf3543daef67339179e074bde9e858 | [
"Apache-2.0"
] | 1 | 2019-02-06T13:19:54.000Z | 2019-02-06T13:19:54.000Z | DQMOffline/Configuration/python/DQMOfflineCosmics_SecondStep_cff.py | dellaric/cmssw | cd7470dc554972076740dde7523f311c43f248d3 | [
"Apache-2.0"
] | null | null | null | DQMOffline/Configuration/python/DQMOfflineCosmics_SecondStep_cff.py | dellaric/cmssw | cd7470dc554972076740dde7523f311c43f248d3 | [
"Apache-2.0"
] | null | null | null | import FWCore.ParameterSet.Config as cms
from DQMServices.Components.DQMMessageLoggerClient_cff import *
from DQMServices.Components.DQMFastTimerServiceClient_cfi import *
from DQMOffline.Ecal.ecal_dqm_client_offline_cosmic_cff import *
from DQM.EcalPreshowerMonitorClient.es_dqm_client_offline_cosmic_cff import *
fro... | 52.223404 | 107 | 0.695457 | import FWCore.ParameterSet.Config as cms
from DQMServices.Components.DQMMessageLoggerClient_cff import *
from DQMServices.Components.DQMFastTimerServiceClient_cfi import *
from DQMOffline.Ecal.ecal_dqm_client_offline_cosmic_cff import *
from DQM.EcalPreshowerMonitorClient.es_dqm_client_offline_cosmic_cff import *
fro... | true | true |
1c49f324acb2a047c20500c33a13ef6f0f53f559 | 73 | py | Python | pvpc/__init__.py | David-Lor/python-pvpc | a5aac6f32a6eaf464ee374fd7da32a79fbbd18ba | [
"ISC"
] | null | null | null | pvpc/__init__.py | David-Lor/python-pvpc | a5aac6f32a6eaf464ee374fd7da32a79fbbd18ba | [
"ISC"
] | null | null | null | pvpc/__init__.py | David-Lor/python-pvpc | a5aac6f32a6eaf464ee374fd7da32a79fbbd18ba | [
"ISC"
] | null | null | null | from .models import *
from .requester import *
from .exceptions import *
| 18.25 | 25 | 0.753425 | from .models import *
from .requester import *
from .exceptions import *
| true | true |
1c49f39ec3628b8aaf020ff4bb77d86834de746f | 1,407 | py | Python | kicad_cicd/plotter.py | sillevl/pcbops_template | 68107607412245df168acdab978447ab82da33f7 | [
"MIT"
] | 10 | 2019-04-30T22:14:20.000Z | 2021-02-24T13:51:57.000Z | kicad_cicd/plotter.py | sillevl/pcbops_template | 68107607412245df168acdab978447ab82da33f7 | [
"MIT"
] | 2 | 2019-05-09T13:59:39.000Z | 2019-09-25T14:07:25.000Z | kicad_cicd/plotter.py | sillevl/pcbops_template | 68107607412245df168acdab978447ab82da33f7 | [
"MIT"
] | 3 | 2019-04-29T10:01:48.000Z | 2020-06-04T10:14:26.000Z | import sys
import os
import pcbnew
from pcbnew import *
file_name = os.path.abspath(sys.argv[1])
output_dir = os.path.abspath(sys.argv[2])
print("Running KiCAD Plotter CI/CD Script on %s output to %s"%(file_name, output_dir,))
try:
os.makedirs(output_dir)
except OSError:
pass
board = pcbnew.LoadBoard(file... | 24.684211 | 87 | 0.721393 | import sys
import os
import pcbnew
from pcbnew import *
file_name = os.path.abspath(sys.argv[1])
output_dir = os.path.abspath(sys.argv[2])
print("Running KiCAD Plotter CI/CD Script on %s output to %s"%(file_name, output_dir,))
try:
os.makedirs(output_dir)
except OSError:
pass
board = pcbnew.LoadBoard(file... | true | true |
1c49f3bd8d21302a83182466fe1ef519c82625f3 | 49,318 | py | Python | python_modules/dagster/dagster_tests/core_tests/storage_tests/utils/run_storage.py | cvb/dagster | 6c735708790febe79ffe727225a4445c033ab79d | [
"Apache-2.0"
] | null | null | null | python_modules/dagster/dagster_tests/core_tests/storage_tests/utils/run_storage.py | cvb/dagster | 6c735708790febe79ffe727225a4445c033ab79d | [
"Apache-2.0"
] | null | null | null | python_modules/dagster/dagster_tests/core_tests/storage_tests/utils/run_storage.py | cvb/dagster | 6c735708790febe79ffe727225a4445c033ab79d | [
"Apache-2.0"
] | null | null | null | import sys
import tempfile
from datetime import datetime
import pendulum
import pytest
from dagster import job, op, seven
from dagster.core.definitions import PipelineDefinition
from dagster.core.errors import (
DagsterRunAlreadyExists,
DagsterRunNotFoundError,
DagsterSnapshotDoesNotExist,
)
from dagster.c... | 36.209985 | 100 | 0.611278 | import sys
import tempfile
from datetime import datetime
import pendulum
import pytest
from dagster import job, op, seven
from dagster.core.definitions import PipelineDefinition
from dagster.core.errors import (
DagsterRunAlreadyExists,
DagsterRunNotFoundError,
DagsterSnapshotDoesNotExist,
)
from dagster.c... | true | true |
1c49f411229f1de6a15db374752a524ef0e0ee0b | 12,639 | py | Python | rnn/train_search.py | cclauss/darts | b6d4fe1692a67d81adaa3d4bfd7c13e3dcb1d443 | [
"Apache-2.0"
] | 1 | 2018-07-26T01:16:31.000Z | 2018-07-26T01:16:31.000Z | rnn/train_search.py | wangxinchina/darts | 77a461b62edb232406891028645b2331a24a8b4d | [
"Apache-2.0"
] | null | null | null | rnn/train_search.py | wangxinchina/darts | 77a461b62edb232406891028645b2331a24a8b4d | [
"Apache-2.0"
] | 1 | 2019-06-18T05:53:16.000Z | 2019-06-18T05:53:16.000Z | import argparse
import os, sys, glob
import time
import math
import numpy as np
import torch
import logging
import torch.nn as nn
import torch.nn.functional as F
import torch.backends.cudnn as cudnn
from architect import Architect
import gc
import data
import model_search as model
from utils import batchify, get_bat... | 44.038328 | 132 | 0.652742 | import argparse
import os, sys, glob
import time
import math
import numpy as np
import torch
import logging
import torch.nn as nn
import torch.nn.functional as F
import torch.backends.cudnn as cudnn
from architect import Architect
import gc
import data
import model_search as model
from utils import batchify, get_bat... | true | true |
1c49f5c305ab49c62a991b94780ce7e3479571cc | 4,046 | py | Python | codejobs/settings.py | amanfojnr/open-jobs-api | e70aa2c0d5031981cd571c50753fa5b28f5dce07 | [
"MIT"
] | null | null | null | codejobs/settings.py | amanfojnr/open-jobs-api | e70aa2c0d5031981cd571c50753fa5b28f5dce07 | [
"MIT"
] | null | null | null | codejobs/settings.py | amanfojnr/open-jobs-api | e70aa2c0d5031981cd571c50753fa5b28f5dce07 | [
"MIT"
] | null | null | null | """
Django settings for codejobs project.
Generated by 'django-admin startproject' using Django 1.11.7.
For more information on this file, see
https://docs.djangoproject.com/en/1.11/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.11/ref/settings/
"""
import o... | 24.227545 | 91 | 0.674246 |
import os
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
SECRET_KEY = 'b(=fum!6g93&xfvwmd^8#bz-2t8nqxbuum!9_ke!t$d&f@hztp'
DEBUG = True
ALLOWED_HOSTS = []
# Application definition
INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.content... | true | true |
1c49f7108d5c141fdd81026bb117e58efba5174b | 1,394 | py | Python | AutomationFramework/tests/network_instance/test_ni_protocol_instances.py | sbarguil/Testing-framework | f3ef69f1c4f0aeafd02e222d846162c711783b15 | [
"Apache-2.0"
] | 1 | 2020-04-23T15:22:16.000Z | 2020-04-23T15:22:16.000Z | AutomationFramework/tests/network_instance/test_ni_protocol_instances.py | sbarguil/Testing-framework | f3ef69f1c4f0aeafd02e222d846162c711783b15 | [
"Apache-2.0"
] | 44 | 2020-08-13T19:35:41.000Z | 2021-03-01T09:08:00.000Z | AutomationFramework/tests/network_instance/test_ni_protocol_instances.py | sbarguil/Testing-framework | f3ef69f1c4f0aeafd02e222d846162c711783b15 | [
"Apache-2.0"
] | 6 | 2020-04-23T15:29:38.000Z | 2022-03-03T14:23:38.000Z | import pytest
from AutomationFramework.page_objects.network_instance.network_intance import NetworkInstance
from AutomationFramework.tests.base_test import BaseTest
class TestNetworkInstanceProtocolInstances(BaseTest):
test_case_file = 'ni_protocol_instances.yml'
@pytest.mark.parametrize('create_page_object_... | 63.363636 | 117 | 0.700861 | import pytest
from AutomationFramework.page_objects.network_instance.network_intance import NetworkInstance
from AutomationFramework.tests.base_test import BaseTest
class TestNetworkInstanceProtocolInstances(BaseTest):
test_case_file = 'ni_protocol_instances.yml'
@pytest.mark.parametrize('create_page_object_... | true | true |
1c49f76aea09c7aaa661dfbbe91e896bbb4e690a | 844 | py | Python | Python/AWS_Scripts/moveFile.py | CharvyJain/Rotten-Scripts | c9b8f7dde378620e4a82eae7aacec53f1eeea3c5 | [
"MIT"
] | 3 | 2021-02-06T16:16:46.000Z | 2021-08-20T03:19:01.000Z | Python/Aws/moveFile.py | SKAUL05/Rotten-Scripts | c44e69754bbecb8a547fe2cc3a29be5acf97c46a | [
"MIT"
] | null | null | null | Python/Aws/moveFile.py | SKAUL05/Rotten-Scripts | c44e69754bbecb8a547fe2cc3a29be5acf97c46a | [
"MIT"
] | 1 | 2021-08-08T16:03:40.000Z | 2021-08-08T16:03:40.000Z | import boto3
awsAccessKeyId = ""
awsSecretAccessKey = ""
bucketName= ""
directoryName = ""
s3 = boto3.resource(
's3',
aws_access_key_id=awsAccessKeyId,
aws_secret_access_key=awsSecretAccessKey
)
myBucket = s3.Bucket(bucketName)
def moveFile():
try:
for objectSummary in myBucket.objects... | 30.142857 | 79 | 0.631517 | import boto3
awsAccessKeyId = ""
awsSecretAccessKey = ""
bucketName= ""
directoryName = ""
s3 = boto3.resource(
's3',
aws_access_key_id=awsAccessKeyId,
aws_secret_access_key=awsSecretAccessKey
)
myBucket = s3.Bucket(bucketName)
def moveFile():
try:
for objectSummary in myBucket.objects... | true | true |
1c49f7929e2a520d2bfeebebc3d0b9896156a77e | 2,768 | py | Python | starfish/image/_filter/scale_by_percentile.py | vipulsinghal02/starfish | c3d347954ad40a7a4be9a50d89974f5fbbc2919d | [
"MIT"
] | null | null | null | starfish/image/_filter/scale_by_percentile.py | vipulsinghal02/starfish | c3d347954ad40a7a4be9a50d89974f5fbbc2919d | [
"MIT"
] | null | null | null | starfish/image/_filter/scale_by_percentile.py | vipulsinghal02/starfish | c3d347954ad40a7a4be9a50d89974f5fbbc2919d | [
"MIT"
] | null | null | null | from functools import partial
from typing import Optional
import numpy as np
from starfish.imagestack.imagestack import ImageStack
from ._base import FilterAlgorithmBase
from .util import preserve_float_range
class ScaleByPercentile(FilterAlgorithmBase):
def __init__(self, p: int=0, is_volume: bool=False, **kw... | 29.136842 | 100 | 0.595737 | from functools import partial
from typing import Optional
import numpy as np
from starfish.imagestack.imagestack import ImageStack
from ._base import FilterAlgorithmBase
from .util import preserve_float_range
class ScaleByPercentile(FilterAlgorithmBase):
def __init__(self, p: int=0, is_volume: bool=False, **kw... | true | true |
1c49f7f555a1957609cf19ef4517fb9da15f2e1a | 688 | py | Python | mogan/image/__init__.py | GURUIFENG9139/rocky-mogan | 6008c1d12b00e70d2cc651f7bd5d47968fc3aec7 | [
"Apache-2.0"
] | null | null | null | mogan/image/__init__.py | GURUIFENG9139/rocky-mogan | 6008c1d12b00e70d2cc651f7bd5d47968fc3aec7 | [
"Apache-2.0"
] | null | null | null | mogan/image/__init__.py | GURUIFENG9139/rocky-mogan | 6008c1d12b00e70d2cc651f7bd5d47968fc3aec7 | [
"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
# d... | 38.222222 | 78 | 0.715116 |
def API():
import mogan.image.api
return mogan.image.api.API()
| true | true |
1c49fa29619138af962a51bbcd48f42a98d3cb02 | 1,274 | py | Python | perfkitbenchmarker/linux_packages/nfs_server.py | msidana/PerfKitBenchmarker | 2784642d3e6b20b3f474c4e27edb1ef163804f66 | [
"Apache-2.0"
] | 2 | 2021-01-15T09:40:28.000Z | 2021-01-15T09:40:36.000Z | perfkitbenchmarker/linux_packages/nfs_server.py | msidana/PerfKitBenchmarker | 2784642d3e6b20b3f474c4e27edb1ef163804f66 | [
"Apache-2.0"
] | 1 | 2021-02-23T12:07:44.000Z | 2021-02-23T12:07:44.000Z | perfkitbenchmarker/linux_packages/nfs_server.py | msidana/PerfKitBenchmarker | 2784642d3e6b20b3f474c4e27edb1ef163804f66 | [
"Apache-2.0"
] | null | null | null | # Copyright 2019 PerfKitBenchmarker 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 appli... | 32.666667 | 79 | 0.787284 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
PACKAGE_NAME = 'nfs_server'
def YumInstall(vm):
vm.InstallPackages('nfs-utils')
def AptInstall(vm):
vm.InstallPackages('nfs-kernel-server')
| true | true |
1c49fa7a717d7e4d70535ca92cd54ab0fc3c3e50 | 19,387 | py | Python | speech/utils/textgrid.py | dzubke/speech-lite | 65f83ac2b7551650820f079ce5152741f2a6fdb8 | [
"Apache-2.0"
] | null | null | null | speech/utils/textgrid.py | dzubke/speech-lite | 65f83ac2b7551650820f079ce5152741f2a6fdb8 | [
"Apache-2.0"
] | null | null | null | speech/utils/textgrid.py | dzubke/speech-lite | 65f83ac2b7551650820f079ce5152741f2a6fdb8 | [
"Apache-2.0"
] | null | null | null | # Natural Language Toolkit: TextGrid analysis
#
# Copyright (C) 2001-2011 NLTK Project
# Author: Margaret Mitchell <itallow@gmail.com>
# Steven Bird <sb@csse.unimelb.edu.au> (revisions)
# URL: <http://www.nltk.org>
# For license information, see LICENSE.TXT
#
"""
Tools for reading TextGrid files, the format us... | 30.104037 | 129 | 0.516429 |
import sys
import re
TEXTTIER = "TextTier"
INTERVALTIER = "IntervalTier"
OOTEXTFILE = re.compile(r"""(?x)
xmin\ =\ (.*)[\r\n]+
xmax\ =\ (.*)[\r\n]+
[\s\S]+?size\ =\ (.*)[\r\n]+
""")
CHRONTEXTFILE = re.compile(r"""(?x)
[\r\n]+(\S+)\
(\S+)\ +!\ ... | true | true |
1c49fb41d87bacb2885b8521921dc64905ec5e5d | 25,423 | py | Python | utils/data_generator.py | qiuqiangkong/dcase2019_task2 | 62575c8cdd4723cfdf497b290b6dddcce316c60b | [
"MIT"
] | 36 | 2019-04-13T02:04:04.000Z | 2020-10-27T15:54:24.000Z | utils/data_generator.py | qiuqiangkong/dcase2019_task2 | 62575c8cdd4723cfdf497b290b6dddcce316c60b | [
"MIT"
] | 2 | 2019-04-14T08:08:26.000Z | 2019-04-18T19:29:38.000Z | utils/data_generator.py | qiuqiangkong/dcase2019_task2 | 62575c8cdd4723cfdf497b290b6dddcce316c60b | [
"MIT"
] | 16 | 2019-04-13T23:01:32.000Z | 2021-01-10T05:20:15.000Z | import numpy as np
import h5py
import csv
import time
import logging
import os
import glob
import matplotlib.pyplot as plt
import logging
import pandas as pd
from utilities import scale
import config
class Base(object):
def __init__(self):
'''Base class for train, validate and test data generator.
... | 39.476708 | 84 | 0.556858 | import numpy as np
import h5py
import csv
import time
import logging
import os
import glob
import matplotlib.pyplot as plt
import logging
import pandas as pd
from utilities import scale
import config
class Base(object):
def __init__(self):
pass
def load_hdf5(self, hdf5_path, cross_validation... | true | true |
1c49fb45dc43ea2b8aafb011957f27effda703a7 | 1,190 | py | Python | all_tests/it10.py | shushantkumar/ci_edit_final | 3b13c7a39b2112ed8daaa70bc4f0f50d67909494 | [
"Apache-2.0"
] | null | null | null | all_tests/it10.py | shushantkumar/ci_edit_final | 3b13c7a39b2112ed8daaa70bc4f0f50d67909494 | [
"Apache-2.0"
] | null | null | null | all_tests/it10.py | shushantkumar/ci_edit_final | 3b13c7a39b2112ed8daaa70bc4f0f50d67909494 | [
"Apache-2.0"
] | null | null | null | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import unittest
from app.curses_util import *
import app.fake_curses_testing
class it10(app.fake_curses_testing.FakeCursesTestCase):
def setUp(self):
app.fake_curses_testing.FakeCursesTestCase.se... | 38.387097 | 74 | 0.653782 | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import unittest
from app.curses_util import *
import app.fake_curses_testing
class it10(app.fake_curses_testing.FakeCursesTestCase):
def setUp(self):
app.fake_curses_testing.FakeCursesTestCase.se... | true | true |
1c49fb62426836b9756f2971c833979c6b552fae | 2,657 | py | Python | tests/test_cdtw.py | dizcza/cdtw-python | a83fffd6fc222a1691f07421fd4dbf46dc19e0aa | [
"MIT"
] | null | null | null | tests/test_cdtw.py | dizcza/cdtw-python | a83fffd6fc222a1691f07421fd4dbf46dc19e0aa | [
"MIT"
] | null | null | null | tests/test_cdtw.py | dizcza/cdtw-python | a83fffd6fc222a1691f07421fd4dbf46dc19e0aa | [
"MIT"
] | null | null | null | import unittest
import math
import numpy as np
from cdtw.dtw import *
from numpy.testing import assert_array_equal, assert_array_almost_equal
try:
import dtaidistance
DTAIDISTANCE_INSTALLED = True
except ImportError:
DTAIDISTANCE_INSTALLED = False
class TestCDTW(unittest.TestCase):
def test_empty(s... | 33.2125 | 78 | 0.596161 | import unittest
import math
import numpy as np
from cdtw.dtw import *
from numpy.testing import assert_array_equal, assert_array_almost_equal
try:
import dtaidistance
DTAIDISTANCE_INSTALLED = True
except ImportError:
DTAIDISTANCE_INSTALLED = False
class TestCDTW(unittest.TestCase):
def test_empty(s... | true | true |
1c49fd605d161c98160f7a93f5883987a5cf6858 | 2,476 | py | Python | samsungctl/interactive.py | jakubpas/samsungctl | adda11c55038e2a3d057edf515ee44a2fd950949 | [
"MIT"
] | 4 | 2021-03-01T01:49:23.000Z | 2022-02-08T16:18:37.000Z | samsungctl/interactive.py | jakubpas/samsungctl | adda11c55038e2a3d057edf515ee44a2fd950949 | [
"MIT"
] | null | null | null | samsungctl/interactive.py | jakubpas/samsungctl | adda11c55038e2a3d057edf515ee44a2fd950949 | [
"MIT"
] | 1 | 2021-06-23T20:42:05.000Z | 2021-06-23T20:42:05.000Z | import curses
_wake_on_lan = '44:5C:E9:51:C8:29'
_mappings = [
["p", "KEY_POWER", "P", "Power off"],
["h", "KEY_HOME", "H", "Home"],
["KEY_UP", "KEY_UP", "Up", "Up"],
["KEY_DOWN", "KEY_DOWN", "Down", "D... | 37.515152 | 74 | 0.421648 | import curses
_wake_on_lan = '44:5C:E9:51:C8:29'
_mappings = [
["p", "KEY_POWER", "P", "Power off"],
["h", "KEY_HOME", "H", "Home"],
["KEY_UP", "KEY_UP", "Up", "Up"],
["KEY_DOWN", "KEY_DOWN", "Down", "D... | true | true |
1c49fd615acaec331d8b1875e666820618016ac8 | 4,988 | py | Python | attention.py | huajianjiu/ANSMESC | 76323a46f638c717e23388cf529734081a70eeee | [
"Apache-2.0"
] | 1 | 2021-08-09T03:45:36.000Z | 2021-08-09T03:45:36.000Z | attention.py | huajianjiu/ANSMESC | 76323a46f638c717e23388cf529734081a70eeee | [
"Apache-2.0"
] | 2 | 2021-08-09T07:40:19.000Z | 2021-08-10T12:34:04.000Z | attention.py | yuanzhiKe/ANSMESC | 76323a46f638c717e23388cf529734081a70eeee | [
"Apache-2.0"
] | null | null | null | # author - Richard Liao
# Dec 26 2016
# Attention GRU network
from keras import backend as K
from keras.engine.topology import Layer
from keras import initializers, regularizers, constraints
class AttentionWithContext(Layer):
"""
Attention operation, with a context/query vector, for temporal data.
... | 39.587302 | 102 | 0.594226 |
from keras import backend as K
from keras.engine.topology import Layer
from keras import initializers, regularizers, constraints
class AttentionWithContext(Layer):
def __init__(self,
W_regularizer=None, u_regularizer=None, b_regularizer=None,
W_constraint=None, u_constraint=... | true | true |
1c49fdbc6de8e0fa0905400b281525d8cbffcdac | 2,739 | py | Python | tests/test_client.py | nicolaskenner/jira | 5c27f6ddafffc6110be1db4749fa67025852bcb6 | [
"BSD-2-Clause"
] | 1 | 2021-03-04T08:06:37.000Z | 2021-03-04T08:06:37.000Z | tests/test_client.py | nicolaskenner/jira | 5c27f6ddafffc6110be1db4749fa67025852bcb6 | [
"BSD-2-Clause"
] | 1 | 2020-08-25T15:50:27.000Z | 2020-08-25T15:50:27.000Z | tests/test_client.py | nicolaskenner/jira | 5c27f6ddafffc6110be1db4749fa67025852bcb6 | [
"BSD-2-Clause"
] | 1 | 2022-01-18T20:17:48.000Z | 2022-01-18T20:17:48.000Z | # -*- coding: utf-8 -*-
import getpass
import pytest
# from tenacity import retry
# from tenacity import wait_incrementing
from tests import get_unique_project_name
from tests import JiraTestManager
from jira import Role, Issue, JIRA, JIRAError, Project # noqa
import jira.client
@pytest.fixture()
def prep():
p... | 20.75 | 80 | 0.68054 |
import getpass
import pytest
from tests import get_unique_project_name
from tests import JiraTestManager
from jira import Role, Issue, JIRA, JIRAError, Project
import jira.client
@pytest.fixture()
def prep():
pass
@pytest.fixture(scope="module")
def test_manager():
return JiraTestManager()
@pytest.... | true | true |
1c49fdc0256ccd65c716e03f0e803a5cd3cf8ffb | 2,151 | py | Python | google_oauth/__init__.py | martialo12/flask-google-login | 592043ed8cf8fddcaab7536c1911d654013b5e4f | [
"MIT"
] | null | null | null | google_oauth/__init__.py | martialo12/flask-google-login | 592043ed8cf8fddcaab7536c1911d654013b5e4f | [
"MIT"
] | null | null | null | google_oauth/__init__.py | martialo12/flask-google-login | 592043ed8cf8fddcaab7536c1911d654013b5e4f | [
"MIT"
] | null | null | null | # python standard libraries
from pathlib import Path
import logging.config
# third party libraries
from flask import Flask
from flask_login import LoginManager
from oauthlib.oauth2 import WebApplicationClient
from flask_bootstrap import Bootstrap
from flask_sqlalchemy import SQLAlchemy
import yaml
# logging
path_to_c... | 22.40625 | 78 | 0.76662 |
from pathlib import Path
import logging.config
from flask import Flask
from flask_login import LoginManager
from oauthlib.oauth2 import WebApplicationClient
from flask_bootstrap import Bootstrap
from flask_sqlalchemy import SQLAlchemy
import yaml
path_to_config_file = Path(__file__).parent / "config/config.yaml"
l... | true | true |
1c49fe277718b141c1da5f42a448b8e3c088d5a0 | 3,987 | py | Python | python/basics/chapter_6_dictionaries/exercises_6.py | gabriel-miglioranza/python_crash_course | 57db9d6b17b225a6aaa5451c3a3b567ffc426b37 | [
"MIT"
] | null | null | null | python/basics/chapter_6_dictionaries/exercises_6.py | gabriel-miglioranza/python_crash_course | 57db9d6b17b225a6aaa5451c3a3b567ffc426b37 | [
"MIT"
] | null | null | null | python/basics/chapter_6_dictionaries/exercises_6.py | gabriel-miglioranza/python_crash_course | 57db9d6b17b225a6aaa5451c3a3b567ffc426b37 | [
"MIT"
] | null | null | null | # Chapter 6 exercises from the book Python Crash Course: A Hands-On, Project-Based Introduction to Programming.
# 6-1. Person
person = {
'first_name': 'sean',
'last_name': 'carroll',
'city': 'los angeles'
}
print(person)
# 6-2. Favorite Numbers
favorite_numbers = {
'cris': 23,
'bian... | 24.163636 | 112 | 0.562328 |
person = {
'first_name': 'sean',
'last_name': 'carroll',
'city': 'los angeles'
}
print(person)
favorite_numbers = {
'cris': 23,
'bianca': 133,
'monica': 42
}
print("Monica's favorite number is " + str(favorite_numbers['monica']) + ".")
print("Cris' favorite number is " + s... | true | true |
1c49ffe311feb2c993cc12b7b475ef5d345533e4 | 222,005 | py | Python | SigProfilerTopography/source/plotting/TranscriptionReplicationStrandBiasFigures.py | AlexandrovLab/SigProfilerTopography | 34c7cf24392bc77953370038a520ffc8d0bdee50 | [
"BSD-2-Clause"
] | 5 | 2021-04-02T14:03:45.000Z | 2022-02-21T12:54:52.000Z | SigProfilerTopography/source/plotting/TranscriptionReplicationStrandBiasFigures.py | AlexandrovLab/SigProfilerTopography | 34c7cf24392bc77953370038a520ffc8d0bdee50 | [
"BSD-2-Clause"
] | null | null | null | SigProfilerTopography/source/plotting/TranscriptionReplicationStrandBiasFigures.py | AlexandrovLab/SigProfilerTopography | 34c7cf24392bc77953370038a520ffc8d0bdee50 | [
"BSD-2-Clause"
] | 1 | 2022-01-22T06:27:49.000Z | 2022-01-22T06:27:49.000Z | # This source code file is a part of SigProfilerTopography
# SigProfilerTopography is a tool included as part of the SigProfiler
# computational framework for comprehensive analysis of mutational
# signatures from next-generation sequencing of cancer genomes.
# SigProfilerTopography provides the downstream data analysi... | 64.015283 | 398 | 0.615946 |
import os
import numpy as np
import statsmodels.stats.multitest
import Line2D
from matplotlib import gridspec
import pandas as pd
from SigProfilerTopography.source.commons.TopographyCommons import natural_key
from SigProfilerTopography.source.commons.TopographyCommons import TRANSCRIBED_STRAND
from Sig... | true | true |
1c4a0071eef9fbd124ada34ed39dfb7abd9d10cb | 5,376 | py | Python | models/face_parsing/modules/bn.py | soumik12345/Barbershop | 971be31afca55499287e97a7034a59a66b871ba8 | [
"MIT"
] | null | null | null | models/face_parsing/modules/bn.py | soumik12345/Barbershop | 971be31afca55499287e97a7034a59a66b871ba8 | [
"MIT"
] | 2 | 2022-03-30T17:49:03.000Z | 2022-03-30T19:20:28.000Z | models/face_parsing/modules/bn.py | soumik12345/Barbershop | 971be31afca55499287e97a7034a59a66b871ba8 | [
"MIT"
] | null | null | null | import torch
import torch.nn as nn
import torch.nn.functional as functional
try:
from queue import Queue
except ImportError:
from Queue import Queue
from .functions import *
class ABN(nn.Module):
"""Activated Batch Normalization
This gathers a `BatchNorm2d` and an activation function in a single mo... | 30.03352 | 116 | 0.570499 | import torch
import torch.nn as nn
import torch.nn.functional as functional
try:
from queue import Queue
except ImportError:
from Queue import Queue
from .functions import *
class ABN(nn.Module):
def __init__(
self,
num_features,
eps=1e-5,
momentum=0.1,
affine=Tr... | true | true |
1c4a00a6ef4dd2fe7cdd0c9ca505b8fd1ccc0977 | 14,574 | py | Python | QEBATangentAttack/utils.py | machanic/TangentAttack | 17c1a8e93f9bbd03e209e8650631af744a0ff6b8 | [
"Apache-2.0"
] | 4 | 2021-11-12T04:06:32.000Z | 2022-01-27T09:01:41.000Z | QEBATangentAttack/utils.py | machanic/TangentAttack | 17c1a8e93f9bbd03e209e8650631af744a0ff6b8 | [
"Apache-2.0"
] | 1 | 2022-02-22T14:00:59.000Z | 2022-02-25T08:57:29.000Z | QEBATangentAttack/utils.py | machanic/TangentAttack | 17c1a8e93f9bbd03e209e8650631af744a0ff6b8 | [
"Apache-2.0"
] | null | null | null | """
Provides classes to measure the distance between inputs.
Distances
---------
.. autosummary::
:nosignatures:
MeanSquaredDistance
MeanAbsoluteDistance
Linfinity
L0
Aliases
-------
.. autosummary::
:nosignatures:
MSE
MAE
Linf
Base class
----------
To implement a new distance, simply... | 25.97861 | 93 | 0.645327 | from __future__ import division
import sys
import abc
import torch
abstractmethod = abc.abstractmethod
if sys.version_info >= (3, 4):
ABC = abc.ABC
else:
ABC = abc.ABCMeta('ABC', (), {})
import functools
from numbers import Number
from torch.nn import functional as F
import numpy as np
@functools.total_... | true | true |
1c4a01f57bcc1a7f20369f01c8316e7174a4aa93 | 2,789 | py | Python | src/data_upload/batch.py | yourtrading-ai/py_yourtrading_ai | b69424f2afc40fe258c7ddae2fb47acc383ecbe5 | [
"MIT"
] | null | null | null | src/data_upload/batch.py | yourtrading-ai/py_yourtrading_ai | b69424f2afc40fe258c7ddae2fb47acc383ecbe5 | [
"MIT"
] | null | null | null | src/data_upload/batch.py | yourtrading-ai/py_yourtrading_ai | b69424f2afc40fe258c7ddae2fb47acc383ecbe5 | [
"MIT"
] | null | null | null | import asyncio
import io
import ssl
import aiohttp
import aleph_client.asynchronous
import certifi
import pandas as pd
from data_upload.data_utils import clean_time_duplicates
def get_download_url(symbol, interval="hourly"):
if interval == "daily":
interval = "d"
elif interval == "hourly":
i... | 39.842857 | 113 | 0.627106 | import asyncio
import io
import ssl
import aiohttp
import aleph_client.asynchronous
import certifi
import pandas as pd
from data_upload.data_utils import clean_time_duplicates
def get_download_url(symbol, interval="hourly"):
if interval == "daily":
interval = "d"
elif interval == "hourly":
i... | true | true |
1c4a02071d1bd4dc5a2bf4caa5a4ce0f0c07ce3f | 3,426 | py | Python | ansible/venv/lib/python2.7/site-packages/ansible/module_utils/facts/virtual/sysctl.py | gvashchenkolineate/gvashchenkolineate_infra_trytravis | 0fb18850afe0d8609693ba4b23f29c7cda17d97f | [
"MIT"
] | 17 | 2017-06-07T23:15:01.000Z | 2021-08-30T14:32:36.000Z | ansible/venv/lib/python2.7/site-packages/ansible/module_utils/facts/virtual/sysctl.py | gvashchenkolineate/gvashchenkolineate_infra_trytravis | 0fb18850afe0d8609693ba4b23f29c7cda17d97f | [
"MIT"
] | 9 | 2017-06-25T03:31:52.000Z | 2021-05-17T23:43:12.000Z | ansible/venv/lib/python2.7/site-packages/ansible/module_utils/facts/virtual/sysctl.py | gvashchenkolineate/gvashchenkolineate_infra_trytravis | 0fb18850afe0d8609693ba4b23f29c7cda17d97f | [
"MIT"
] | 3 | 2018-05-26T21:31:22.000Z | 2019-09-28T17:00:45.000Z | # This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is distributed in the hope that ... | 47.583333 | 88 | 0.620257 |
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import re
class VirtualSysctlDetectionMixin(object):
def detect_sysctl(self):
self.sysctl_path = self.module.get_bin_path('sysctl')
def detect_virt_product(self, key):
virtual_product_facts... | true | true |
1c4a02c8305edf5419beb0b9ec01a9f4757b6f61 | 728 | py | Python | app/test/test4.py | saint816/fishbook | 80a4b563a05086c85eb347286d28bb0e6258ff1c | [
"MIT"
] | null | null | null | app/test/test4.py | saint816/fishbook | 80a4b563a05086c85eb347286d28bb0e6258ff1c | [
"MIT"
] | null | null | null | app/test/test4.py | saint816/fishbook | 80a4b563a05086c85eb347286d28bb0e6258ff1c | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
-------------------------------------------------
File Name: test4
Description : LocalStack线程隔离特性
Author : pengsheng
date: 2019-04-21
-------------------------------------------------
"""
import threading
import time
from werkzeug.local import LocalStack
my... | 23.483871 | 67 | 0.582418 |
import threading
import time
from werkzeug.local import LocalStack
my_stack = LocalStack()
my_stack.push(1)
print('main after push: ' + str(my_stack.top))
def worker():
print('child thread before push: ' + str(my_stack.top))
my_stack.push(2)
print('child thread after push: ' + str(my_stack.top))
chil... | true | true |
1c4a03d70ff26f631a6d41a2c5e4ca7dcb12136c | 3,778 | py | Python | generate_cloth_img.py | otsubo/CIFAR-ConvolutionalAutoEncoder-Chainer | bbda81dc7b52f42e07e9daaff38ce7453b24e008 | [
"MIT"
] | null | null | null | generate_cloth_img.py | otsubo/CIFAR-ConvolutionalAutoEncoder-Chainer | bbda81dc7b52f42e07e9daaff38ce7453b24e008 | [
"MIT"
] | null | null | null | generate_cloth_img.py | otsubo/CIFAR-ConvolutionalAutoEncoder-Chainer | bbda81dc7b52f42e07e9daaff38ce7453b24e008 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Sat Jul 21 08:51:18 2018
@author: user
"""
import argparse
import os
import os.path as osp
import numpy as np
import matplotlib.pyplot as plt
from tqdm import tqdm
import chainer
from chainer import cuda
from chainer.datasets import get_cifar10
from chainer import dataset
fro... | 28.839695 | 83 | 0.588936 |
import argparse
import os
import os.path as osp
import numpy as np
import matplotlib.pyplot as plt
from tqdm import tqdm
import chainer
from chainer import cuda
from chainer.datasets import get_cifar10
from chainer import dataset
from chainer import Variable
from chainer import serializers
import chainer.functions... | true | true |
1c4a0522b17523bfaff0ea4d0aee5f56a95b355e | 496 | py | Python | bookmarks/models.py | justinborek/djorg | f6aa9cb23f0476c032ac5250045879962cc11072 | [
"MIT"
] | null | null | null | bookmarks/models.py | justinborek/djorg | f6aa9cb23f0476c032ac5250045879962cc11072 | [
"MIT"
] | null | null | null | bookmarks/models.py | justinborek/djorg | f6aa9cb23f0476c032ac5250045879962cc11072 | [
"MIT"
] | null | null | null | from uuid import uuid4
from datetime import datetime
from django.db import models
class Bookmark(models.Model):
id = models.UUIDField(primary_key=True, default=uuid4, editable=False)
url = models.URLField('URL', unique=True)
name = models.CharField(max_length=200)
notes = models.TextField(blank=True)
... | 33.066667 | 74 | 0.743952 | from uuid import uuid4
from datetime import datetime
from django.db import models
class Bookmark(models.Model):
id = models.UUIDField(primary_key=True, default=uuid4, editable=False)
url = models.URLField('URL', unique=True)
name = models.CharField(max_length=200)
notes = models.TextField(blank=True)
... | true | true |
1c4a0541e9c6f3dabd3305439a3287d532a147dd | 1,361 | py | Python | app/core/tests/test_admin.py | kim-sun/recipe-app-api | c0c598f2188c42c820178ea7910c34ccdf641393 | [
"MIT"
] | null | null | null | app/core/tests/test_admin.py | kim-sun/recipe-app-api | c0c598f2188c42c820178ea7910c34ccdf641393 | [
"MIT"
] | null | null | null | app/core/tests/test_admin.py | kim-sun/recipe-app-api | c0c598f2188c42c820178ea7910c34ccdf641393 | [
"MIT"
] | null | null | null | from django.test import TestCase, Client
from django.contrib.auth import get_user_model
from django.urls import reverse
class AdminSiteTests(TestCase):
def setUp(self):
self.client = Client()
self.admin_user = get_user_model().objects.create_superuser(
email='admin@gmail.com',
... | 31.651163 | 68 | 0.635562 | from django.test import TestCase, Client
from django.contrib.auth import get_user_model
from django.urls import reverse
class AdminSiteTests(TestCase):
def setUp(self):
self.client = Client()
self.admin_user = get_user_model().objects.create_superuser(
email='admin@gmail.com',
... | true | true |
1c4a0676208607006d811b2a23a60b460dd13518 | 2,403 | py | Python | tests/api_tests/abstrac_api_test.py | kirillskor/dedoc | 7793a1be2220a26e7520521306351dfc0a9c8d98 | [
"Apache-2.0"
] | null | null | null | tests/api_tests/abstrac_api_test.py | kirillskor/dedoc | 7793a1be2220a26e7520521306351dfc0a9c8d98 | [
"Apache-2.0"
] | null | null | null | tests/api_tests/abstrac_api_test.py | kirillskor/dedoc | 7793a1be2220a26e7520521306351dfc0a9c8d98 | [
"Apache-2.0"
] | null | null | null | import json
import os
import requests
import unittest
class AbstractTestApiDocReader(unittest.TestCase):
data_directory_path = os.path.abspath(os.path.join(os.path.dirname(__file__), "..", "data"))
def _check_metainfo(self, metainfo, actual_type: str, actual_name: str):
self.assertEqual(metainfo['fi... | 34.826087 | 113 | 0.62422 | import json
import os
import requests
import unittest
class AbstractTestApiDocReader(unittest.TestCase):
data_directory_path = os.path.abspath(os.path.join(os.path.dirname(__file__), "..", "data"))
def _check_metainfo(self, metainfo, actual_type: str, actual_name: str):
self.assertEqual(metainfo['fi... | true | true |
1c4a074100935fa59bbb9f0995aad8db11245ba3 | 6,180 | py | Python | mne/io/array/tests/test_array.py | fmamashli/mne-python | 52f064415e7c9fa8fe243d22108dcdf3d86505b9 | [
"BSD-3-Clause"
] | 1 | 2019-12-11T05:07:08.000Z | 2019-12-11T05:07:08.000Z | mne/io/array/tests/test_array.py | fmamashli/mne-python | 52f064415e7c9fa8fe243d22108dcdf3d86505b9 | [
"BSD-3-Clause"
] | 23 | 2017-09-12T11:08:26.000Z | 2019-10-04T11:11:29.000Z | mne/io/array/tests/test_array.py | fmamashli/mne-python | 52f064415e7c9fa8fe243d22108dcdf3d86505b9 | [
"BSD-3-Clause"
] | 3 | 2019-01-28T13:48:00.000Z | 2019-07-10T16:02:11.000Z | # Author: Eric Larson <larson.eric.d@gmail.com>
#
# License: BSD (3-clause)
import os.path as op
import numpy as np
from numpy.testing import (assert_array_almost_equal, assert_allclose,
assert_equal)
import pytest
import matplotlib.pyplot as plt
from mne import find_events, Epochs, pick_t... | 34.719101 | 79 | 0.637379 |
import os.path as op
import numpy as np
from numpy.testing import (assert_array_almost_equal, assert_allclose,
assert_equal)
import pytest
import matplotlib.pyplot as plt
from mne import find_events, Epochs, pick_types
from mne.io import read_raw_fif
from mne.io.array import RawArray
fr... | true | true |
1c4a0802008b790d1c97611c1cf3739497f6082d | 1,992 | py | Python | scraping/norcleanser1.py | Asyikin98/SkinFerm | 72fd1ad6339c96adf5ec154bde566de9eb1472c3 | [
"MIT"
] | null | null | null | scraping/norcleanser1.py | Asyikin98/SkinFerm | 72fd1ad6339c96adf5ec154bde566de9eb1472c3 | [
"MIT"
] | 2 | 2021-02-03T01:55:13.000Z | 2021-04-30T12:46:33.000Z | scraping/norcleanser1.py | Asyikin98/SkinFerm | 72fd1ad6339c96adf5ec154bde566de9eb1472c3 | [
"MIT"
] | null | null | null | import urllib.request
import random
from bs4 import BeautifulSoup
from requests import get
import mysql.connector
conn = mysql.connector.connect(user="root", passwd="",host="localhost", database="product")
cursor = conn.cursor()
sql = """INSERT INTO norcleanser (image, name, price, rating) VALUES (%s, %s, %s, %s)"""... | 43.304348 | 370 | 0.681727 | import urllib.request
import random
from bs4 import BeautifulSoup
from requests import get
import mysql.connector
conn = mysql.connector.connect(user="root", passwd="",host="localhost", database="product")
cursor = conn.cursor()
sql = """INSERT INTO norcleanser (image, name, price, rating) VALUES (%s, %s, %s, %s)"""... | true | true |
1c4a085e1b8dce8dacaca64ca275241b95642545 | 396 | py | Python | Easy/1475 Final Prices With a Special Discount in a Shop.py | raj713335/LeetCode | e60e145d90f45d37e148e8307a3d97f5f0741de0 | [
"Apache-2.0"
] | null | null | null | Easy/1475 Final Prices With a Special Discount in a Shop.py | raj713335/LeetCode | e60e145d90f45d37e148e8307a3d97f5f0741de0 | [
"Apache-2.0"
] | null | null | null | Easy/1475 Final Prices With a Special Discount in a Shop.py | raj713335/LeetCode | e60e145d90f45d37e148e8307a3d97f5f0741de0 | [
"Apache-2.0"
] | null | null | null | # https://leetcode.com/problems/final-prices-with-a-special-discount-in-a-shop/
class Solution:
def finalPrices(self, prices: List[int]) -> List[int]:
for i in range(0, len(prices)-1):
for j in range(i+1, len(prices)):
if prices[i] >= prices[j]:
pric... | 30.461538 | 79 | 0.515152 |
class Solution:
def finalPrices(self, prices: List[int]) -> List[int]:
for i in range(0, len(prices)-1):
for j in range(i+1, len(prices)):
if prices[i] >= prices[j]:
prices[i] -= prices[j]
break
return prices
| true | true |
1c4a08a1665f5f9ea06e9064cfd4079c18d6dbd6 | 4,417 | py | Python | src/tracker/tracker.py | prashkr/BitTorrent-Protocol | 66eec7be82ed97d3315f07c072971380ac1106fb | [
"MIT"
] | null | null | null | src/tracker/tracker.py | prashkr/BitTorrent-Protocol | 66eec7be82ed97d3315f07c072971380ac1106fb | [
"MIT"
] | null | null | null | src/tracker/tracker.py | prashkr/BitTorrent-Protocol | 66eec7be82ed97d3315f07c072971380ac1106fb | [
"MIT"
] | null | null | null | import Queue
import select
import socket
import sys
def process_msg(input_msg):
"""
:param input_msg:
:return:
"""
flag = True
peer_list_reply = "TRACKER_RESPONSE-"
input_msg = input_msg.strip('\n')
input_msg = input_msg.strip(' ')
inputs = input_msg.split('-')
if inputs[0] =... | 30.462069 | 91 | 0.530224 | import Queue
import select
import socket
import sys
def process_msg(input_msg):
"""
:param input_msg:
:return:
"""
flag = True
peer_list_reply = "TRACKER_RESPONSE-"
input_msg = input_msg.strip('\n')
input_msg = input_msg.strip(' ')
inputs = input_msg.split('-')
if inputs[0] =... | false | true |
1c4a08af26630f0f1eb8dd09eb2a7c42527d7a98 | 994 | py | Python | azure-mgmt-devtestlabs/azure/mgmt/devtestlabs/models/apply_artifacts_request.py | SUSE/azure-sdk-for-python | 324f99d26dd6f4ee9793b9bf1d4d5f928e4b6c2f | [
"MIT"
] | 2 | 2020-07-29T14:22:17.000Z | 2020-11-06T18:47:40.000Z | azure-mgmt-devtestlabs/azure/mgmt/devtestlabs/models/apply_artifacts_request.py | SUSE/azure-sdk-for-python | 324f99d26dd6f4ee9793b9bf1d4d5f928e4b6c2f | [
"MIT"
] | 1 | 2016-08-01T07:37:04.000Z | 2016-08-01T07:37:04.000Z | azure-mgmt-devtestlabs/azure/mgmt/devtestlabs/models/apply_artifacts_request.py | SUSE/azure-sdk-for-python | 324f99d26dd6f4ee9793b9bf1d4d5f928e4b6c2f | [
"MIT"
] | 1 | 2020-12-12T21:04:41.000Z | 2020-12-12T21:04:41.000Z | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... | 34.275862 | 81 | 0.615694 |
from msrest.serialization import Model
class ApplyArtifactsRequest(Model):
_attribute_map = {
'artifacts': {'key': 'artifacts', 'type': '[ArtifactInstallProperties]'},
}
def __init__(self, artifacts=None):
self.artifacts = artifacts
| true | true |
1c4a08b855151a6840c0b86aa222ceed3a904014 | 4,712 | py | Python | SVS/model/archive/preprocessing/ch_asr/local/data_prep.py | Kirinel/SVS_system | 261b80d69578bc3c407bc927750d64858c42a24c | [
"Apache-2.0"
] | null | null | null | SVS/model/archive/preprocessing/ch_asr/local/data_prep.py | Kirinel/SVS_system | 261b80d69578bc3c407bc927750d64858c42a24c | [
"Apache-2.0"
] | null | null | null | SVS/model/archive/preprocessing/ch_asr/local/data_prep.py | Kirinel/SVS_system | 261b80d69578bc3c407bc927750d64858c42a24c | [
"Apache-2.0"
] | null | null | null | """Copyright [2020] [Jiatong Shi & Shuai Guo].
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 writ... | 26.772727 | 79 | 0.503608 |
import argparse
import os
import re
def add_zero(number, size):
out = str(number)
for i in range(size - len(out)):
out = "0" + out
return out
single_pron = [
"a",
"ai",
"ao",
"an",
"ang",
"o",
"ou",
"ong",
"e",
"ei",
"er",
"en",
"eng",
]
doubl... | true | true |
1c4a0a16894c5126858c0aa112f30b01f145fbcf | 4,964 | py | Python | src/tstoolbox/functions/expanding_window.py | timcera/tstoolbox | a32fa399d96082f01b7eedfd6c8893bdb881845c | [
"BSD-3-Clause"
] | 5 | 2016-10-13T18:06:41.000Z | 2021-06-29T19:47:36.000Z | src/tstoolbox/functions/expanding_window.py | timcera/tstoolbox | a32fa399d96082f01b7eedfd6c8893bdb881845c | [
"BSD-3-Clause"
] | 21 | 2016-04-28T16:48:03.000Z | 2021-12-16T18:07:07.000Z | src/tstoolbox/functions/expanding_window.py | timcera/tstoolbox | a32fa399d96082f01b7eedfd6c8893bdb881845c | [
"BSD-3-Clause"
] | 3 | 2018-03-21T21:07:52.000Z | 2021-01-22T20:07:49.000Z | # -*- coding: utf-8 -*-
"""Collection of functions for the manipulation of time series."""
from __future__ import absolute_import, division, print_function
from typing import List, Optional
import mando
import pandas as pd
import typic
from mando.rst_text_formatter import RSTHelpFormatter
from .. import tsutils
tr... | 24.453202 | 85 | 0.471394 |
from __future__ import absolute_import, division, print_function
from typing import List, Optional
import mando
import pandas as pd
import typic
from mando.rst_text_formatter import RSTHelpFormatter
from .. import tsutils
try:
from typing import Literal
except ImportError:
from typing_extensions import Li... | true | true |
1c4a0c8f83c03c4ee8d31d036c9293db10cf3d62 | 1,215 | bzl | Python | deps.bzl | abrisco/cargo-bazel | 1bb0b7f295e89441b5b7e90898c8b9abdab38402 | [
"MIT"
] | 4 | 2021-11-08T14:53:23.000Z | 2022-02-25T03:32:32.000Z | deps.bzl | abrisco/cargo-bazel | 1bb0b7f295e89441b5b7e90898c8b9abdab38402 | [
"MIT"
] | 23 | 2021-10-13T18:53:05.000Z | 2022-03-07T00:57:25.000Z | deps.bzl | abrisco/cargo-bazel | 1bb0b7f295e89441b5b7e90898c8b9abdab38402 | [
"MIT"
] | 1 | 2021-12-09T17:11:39.000Z | 2021-12-09T17:11:39.000Z | """Dependencies required by the `cargo-bazel` rules"""
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
load("@bazel_tools//tools/build_defs/repo:utils.bzl", "maybe")
load("//3rdparty:third_party_deps.bzl", "third_party_deps")
load("//private:vendor_utils.bzl", "crates_vendor_deps")
def cargo_baze... | 36.818182 | 126 | 0.681481 |
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
load("@bazel_tools//tools/build_defs/repo:utils.bzl", "maybe")
load("//3rdparty:third_party_deps.bzl", "third_party_deps")
load("//private:vendor_utils.bzl", "crates_vendor_deps")
def cargo_bazel_deps():
maybe(
http_archive,
name... | true | true |
1c4a0cbe390bf014cfe06f318b4c150143ca2c65 | 8,847 | py | Python | ezblog/blog/views.py | zeropol2/ezblog | a43d231d454b32be35f5811a6ca63d17d654f59d | [
"Apache-2.0"
] | 4 | 2016-08-04T04:30:53.000Z | 2016-08-31T08:51:30.000Z | ezblog/blog/views.py | zeropol2/ezblog | a43d231d454b32be35f5811a6ca63d17d654f59d | [
"Apache-2.0"
] | null | null | null | ezblog/blog/views.py | zeropol2/ezblog | a43d231d454b32be35f5811a6ca63d17d654f59d | [
"Apache-2.0"
] | null | null | null | from django.contrib.auth.decorators import login_required
from django.core.paginator import Paginator, PageNotAnInteger, EmptyPage
from django.core.urlresolvers import reverse
from django.db.models import Q
from django.http import Http404, HttpResponse
from django.shortcuts import render, redirect, get_object_or_404
f... | 27.646875 | 111 | 0.61648 | from django.contrib.auth.decorators import login_required
from django.core.paginator import Paginator, PageNotAnInteger, EmptyPage
from django.core.urlresolvers import reverse
from django.db.models import Q
from django.http import Http404, HttpResponse
from django.shortcuts import render, redirect, get_object_or_404
f... | true | true |
1c4a0cde0a499635d87048fe9f94b9177b5680fc | 5,529 | py | Python | cms/utils/i18n.py | 360youlun/django-cms | bc1240fd46de4c04f3b5402be99a81728a4a324c | [
"BSD-3-Clause"
] | 1 | 2019-04-15T10:28:46.000Z | 2019-04-15T10:28:46.000Z | cms/utils/i18n.py | damianmoore/django-cms | 2d3e10a01e792ec7da5c1418811c1be5ac84e5e2 | [
"BSD-3-Clause"
] | 5 | 2021-03-19T15:39:27.000Z | 2021-09-08T02:47:21.000Z | cms/utils/i18n.py | Acidburn0zzz/django-cms | 5a105a1c75eeb4c8a4c1c34301d93855e6724407 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
from contextlib import contextmanager
from django.core.urlresolvers import get_resolver, LocaleRegexURLResolver
from django.conf import settings
from django.utils import translation
from django.utils.translation import ugettext_lazy as _
from cms.exceptions import LanguageError
from cms.utils.... | 28.647668 | 121 | 0.691988 |
from contextlib import contextmanager
from django.core.urlresolvers import get_resolver, LocaleRegexURLResolver
from django.conf import settings
from django.utils import translation
from django.utils.translation import ugettext_lazy as _
from cms.exceptions import LanguageError
from cms.utils.conf import get_cms_set... | true | true |
1c4a0d26b1b1f83eea8c7a0005822c6d1ced6f53 | 36,374 | py | Python | adafruit_minimqtt/adafruit_minimqtt.py | Eason010212/Adafruit_CircuitPython_MiniMQTT | eccc36f41c973c3155bd633716670e1925d51bae | [
"MIT",
"Unlicense"
] | null | null | null | adafruit_minimqtt/adafruit_minimqtt.py | Eason010212/Adafruit_CircuitPython_MiniMQTT | eccc36f41c973c3155bd633716670e1925d51bae | [
"MIT",
"Unlicense"
] | null | null | null | adafruit_minimqtt/adafruit_minimqtt.py | Eason010212/Adafruit_CircuitPython_MiniMQTT | eccc36f41c973c3155bd633716670e1925d51bae | [
"MIT",
"Unlicense"
] | null | null | null | # SPDX-FileCopyrightText: 2019-2021 Brent Rubell for Adafruit Industries
#
# SPDX-License-Identifier: MIT
# Original Work Copyright (c) 2016 Paul Sokolovsky, uMQTT
# Modified Work Copyright (c) 2019 Bradley Beach, esp32spi_mqtt
# Modified Work Copyright (c) 2012-2019 Roger Light and others, Paho MQTT Python
"""
`adaf... | 37.38335 | 108 | 0.583274 |
import errno
import struct
import time
from random import randint
from micropython import const
from .matcher import MQTTMatcher
__version__ = "0.0.0-auto.0"
__repo__ = "https://github.com/adafruit/Adafruit_CircuitPython_MiniMQTT.git"
MQTT_MSG_MAX_SZ = const(268435455)
MQTT_MSG_SZ_LIM = const(10000000)
MQTT_... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.