hexsha stringlengths 40 40 | size int64 2 1.02M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 245 | max_stars_repo_name stringlengths 6 130 | max_stars_repo_head_hexsha stringlengths 40 40 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 245 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 245 | max_forks_repo_name stringlengths 6 130 | max_forks_repo_head_hexsha stringlengths 40 40 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 2 1.02M | avg_line_length float64 1 417k | max_line_length int64 1 987k | alphanum_fraction float64 0 1 | content_no_comment stringlengths 0 1.01M | is_comment_constant_removed bool 1
class | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1c3865b1827c97a761c449a50ba5bd9d5d47a5ae | 428 | py | Python | logger/logger.py | LalithAdhithya/HandWritten-Digit-Recognition-using-pytorch | b7e99f70a95996886dbdfbfe1d336eaf98eb0cf3 | [
"MIT"
] | 1 | 2021-11-20T03:10:09.000Z | 2021-11-20T03:10:09.000Z | logger/logger.py | ketangangal/HandWritten-Digit-Recognition-Pytorch | 622772c23a59dece9d758338ab4be35064e1c88f | [
"MIT"
] | null | null | null | logger/logger.py | ketangangal/HandWritten-Digit-Recognition-Pytorch | 622772c23a59dece9d758338ab4be35064e1c88f | [
"MIT"
] | null | null | null | from datetime import datetime
class Logger:
def __init__(self, file="logger/general/logs.log"):
self.file = file
def info(self, log_type, log_message):
now = datetime.now()
current_time = now.strftime("%d-%m-%Y %H:%M:%S")
with open(self.file,"a+") as file:
file.wri... | 32.923077 | 107 | 0.565421 | from datetime import datetime
class Logger:
def __init__(self, file="logger/general/logs.log"):
self.file = file
def info(self, log_type, log_message):
now = datetime.now()
current_time = now.strftime("%d-%m-%Y %H:%M:%S")
with open(self.file,"a+") as file:
file.wri... | true | true |
1c38667ce9ae88fa83fe5e9d1903cb559ab2f6b4 | 4,908 | py | Python | torchtime/transforms/functional.py | VincentSch4rf/torchtime | bebd006cd67b31c342e0658285c9771c27411df0 | [
"Apache-2.0"
] | 4 | 2022-02-21T21:23:16.000Z | 2022-03-28T09:06:14.000Z | torchtime/transforms/functional.py | VincentSch4rf/torchtime | bebd006cd67b31c342e0658285c9771c27411df0 | [
"Apache-2.0"
] | null | null | null | torchtime/transforms/functional.py | VincentSch4rf/torchtime | bebd006cd67b31c342e0658285c9771c27411df0 | [
"Apache-2.0"
] | null | null | null | import warnings
from typing import Any, List, Sequence, Tuple, Optional, Union, Set
import numpy as np
import torch
from torch import Tensor
import torch.nn.functional as F
from ..exceptions import DataConversionWarning
from ..utils import _check_unknown
@torch.jit.unused
def _is_numpy(ts: Any) -> bool:
return ... | 34.808511 | 116 | 0.639976 | import warnings
from typing import Any, List, Sequence, Tuple, Optional, Union, Set
import numpy as np
import torch
from torch import Tensor
import torch.nn.functional as F
from ..exceptions import DataConversionWarning
from ..utils import _check_unknown
@torch.jit.unused
def _is_numpy(ts: Any) -> bool:
return ... | true | true |
1c38670351f57dce763404bbccdc3ada447c883f | 24,105 | py | Python | reservoirpy/_base.py | neuronalX/reservoirpy | b150f097451edfa71dbfaee474149b628cd786d4 | [
"MIT"
] | 18 | 2019-03-01T17:15:17.000Z | 2020-12-08T13:12:49.000Z | reservoirpy/_base.py | neuronalX/FunkyReservoir | 37751e9a6be76298e1c14b3816f191f351bfb606 | [
"MIT"
] | 4 | 2019-02-19T09:25:50.000Z | 2020-06-04T16:01:54.000Z | reservoirpy/_base.py | neuronalX/FunkyReservoir | 37751e9a6be76298e1c14b3816f191f351bfb606 | [
"MIT"
] | 12 | 2019-02-08T08:03:42.000Z | 2020-12-16T09:35:47.000Z | # Author: Nathan Trouvain at 15/02/2022 <nathan.trouvain@inria.fr>
# Licence: MIT License
# Copyright: Xavier Hinaut (2018) <xavier.hinaut@inria.fr>
from abc import ABC, abstractmethod
from contextlib import contextmanager
from typing import Any, Dict, Iterator, Sequence, Union
from uuid import uuid4
import numpy as n... | 32.097204 | 88 | 0.541713 | from abc import ABC, abstractmethod
from contextlib import contextmanager
from typing import Any, Dict, Iterator, Sequence, Union
from uuid import uuid4
import numpy as np
from .type import MappedData, Shape
from .utils import progress
from .utils.validation import check_vector, is_mapping
def _distant_model_inputs... | true | true |
1c38676aebd896c554453761a10d47ee56f4f383 | 2,582 | py | Python | e3nn/nn/_fc.py | simonbatzner/e3nn | 9f5e336d5443d26a04d37162c10eb851beb0f5c5 | [
"MIT"
] | null | null | null | e3nn/nn/_fc.py | simonbatzner/e3nn | 9f5e336d5443d26a04d37162c10eb851beb0f5c5 | [
"MIT"
] | null | null | null | e3nn/nn/_fc.py | simonbatzner/e3nn | 9f5e336d5443d26a04d37162c10eb851beb0f5c5 | [
"MIT"
] | null | null | null | import torch
from e3nn.math import normalize2mom
from e3nn.util.jit import compile_mode
def _identity(x):
return x
# This is a static network that can be traced
@compile_mode('trace')
class FullyConnectedNet(torch.nn.Module):
r"""Fully-connected Neural Network
Parameters
----------
hs : list o... | 28.688889 | 107 | 0.524787 | import torch
from e3nn.math import normalize2mom
from e3nn.util.jit import compile_mode
def _identity(x):
return x
@compile_mode('trace')
class FullyConnectedNet(torch.nn.Module):
def __init__(self, hs, act=None, variance_in=1, variance_out=1, out_act=False):
super().__init__()
self.hs = tu... | true | true |
1c3868f4caf7e0f6a4337cab535f29ba1bfe9bbd | 5,414 | py | Python | tests/utils_tests/test_crypto.py | rushuifang/django | b94764e178056a2118eff3f53f567207219e737d | [
"CNRI-Python-GPL-Compatible",
"BSD-3-Clause"
] | 2 | 2020-01-17T17:35:21.000Z | 2020-01-17T17:35:27.000Z | tests/utils_tests/test_crypto.py | rushuifang/django | b94764e178056a2118eff3f53f567207219e737d | [
"CNRI-Python-GPL-Compatible",
"BSD-3-Clause"
] | null | null | null | tests/utils_tests/test_crypto.py | rushuifang/django | b94764e178056a2118eff3f53f567207219e737d | [
"CNRI-Python-GPL-Compatible",
"BSD-3-Clause"
] | 2 | 2021-05-13T13:56:12.000Z | 2021-06-13T19:56:44.000Z | import hashlib
import unittest
from django.utils.crypto import constant_time_compare, pbkdf2, salted_hmac
class TestUtilsCryptoMisc(unittest.TestCase):
def test_constant_time_compare(self):
# It's hard to test for constant time, just test the result.
self.assertTrue(constant_time_compare(b'spam'... | 33.214724 | 106 | 0.476912 | import hashlib
import unittest
from django.utils.crypto import constant_time_compare, pbkdf2, salted_hmac
class TestUtilsCryptoMisc(unittest.TestCase):
def test_constant_time_compare(self):
self.assertTrue(constant_time_compare(b'spam', b'spam'))
self.assertFalse(constant_time_compare(b'... | true | true |
1c386af021f88e573d27c874eebd300562f672b0 | 48,057 | py | Python | builder/frameworks/espidf.py | lkaino/platform-espressif32 | 7406e9efb90c4a5c11bb7e08fc4869a38cf42ea8 | [
"Apache-2.0"
] | 7 | 2021-08-13T09:14:35.000Z | 2022-01-31T20:24:41.000Z | builder/frameworks/espidf.py | lkaino/platform-espressif32 | 7406e9efb90c4a5c11bb7e08fc4869a38cf42ea8 | [
"Apache-2.0"
] | 4 | 2022-01-26T07:31:25.000Z | 2022-03-13T10:35:25.000Z | builder/frameworks/espidf.py | lkaino/platform-espressif32 | 7406e9efb90c4a5c11bb7e08fc4869a38cf42ea8 | [
"Apache-2.0"
] | 4 | 2021-11-18T07:10:30.000Z | 2022-03-24T13:44:10.000Z | # Copyright 2020-present PlatformIO <contact@platformio.org>
#
# 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 applicabl... | 32.781037 | 130 | 0.626652 |
import copy
import json
import subprocess
import sys
import os
import click
import semantic_version
from SCons.Script import (
ARGUMENTS,
COMMAND_LINE_TARGETS,
DefaultEnvironment,
)
from platformio import fs
from platformio.proc import exec_command
from platformio.util import get_systype
from platformi... | true | true |
1c386b015eef9e74ea213d83168770d90c057f18 | 83,694 | py | Python | build/android/gyp/write_build_config.py | gengleilei/wee8 | a7bff18685ddfc7f16de825c9d3a12432d4138d5 | [
"BSD-3-Clause"
] | null | null | null | build/android/gyp/write_build_config.py | gengleilei/wee8 | a7bff18685ddfc7f16de825c9d3a12432d4138d5 | [
"BSD-3-Clause"
] | null | null | null | build/android/gyp/write_build_config.py | gengleilei/wee8 | a7bff18685ddfc7f16de825c9d3a12432d4138d5 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
#
# Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Writes a build_config file.
The build_config file for a target is a json file containing information about
how to build that targ... | 41.784324 | 80 | 0.722824 |
from __future__ import print_function
import collections
import itertools
import json
import optparse
import os
import sys
import xml.dom.minidom
from util import build_utils
from util import resource_utils
_ROOT_TYPES = ('android_apk', 'java_binary', 'java_annotation_processor',
'junit_binary', 'an... | true | true |
1c386d25c75cabcae6810281f5a96424983e664d | 2,465 | py | Python | src/mbed_tools/cli/main.py | jainvikas8/mbed-tools | 55435a4c5a7184038e1fde8e7b1c4194fa75ab8a | [
"Apache-2.0"
] | null | null | null | src/mbed_tools/cli/main.py | jainvikas8/mbed-tools | 55435a4c5a7184038e1fde8e7b1c4194fa75ab8a | [
"Apache-2.0"
] | null | null | null | src/mbed_tools/cli/main.py | jainvikas8/mbed-tools | 55435a4c5a7184038e1fde8e7b1c4194fa75ab8a | [
"Apache-2.0"
] | null | null | null | #
# Copyright (C) 2020 Arm Mbed. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
#
"""Main cli entry point."""
import logging
from pkg_resources import get_distribution
from typing import Union, Any
import click
from mbed_tools.lib.logging import set_log_level, MbedToolsHandler
from mbed_tools.cli.configu... | 31.602564 | 117 | 0.726166 | import logging
from pkg_resources import get_distribution
from typing import Union, Any
import click
from mbed_tools.lib.logging import set_log_level, MbedToolsHandler
from mbed_tools.cli.configure import configure
from mbed_tools.cli.list_connected_devices import list_connected_devices
from mbed_tools.cli.env_cli i... | true | true |
1c386e6e932f1a3a526952a0150d184afbe6588e | 3,630 | py | Python | tests/test_utils.py | pynista/telegrambotapiwrapper | 4310882a1a7db94f5256b010ff8a3103b405dc0d | [
"MIT"
] | 1 | 2021-05-10T06:49:52.000Z | 2021-05-10T06:49:52.000Z | tests/test_utils.py | pynista/telegrambotapiwrapper | 4310882a1a7db94f5256b010ff8a3103b405dc0d | [
"MIT"
] | null | null | null | tests/test_utils.py | pynista/telegrambotapiwrapper | 4310882a1a7db94f5256b010ff8a3103b405dc0d | [
"MIT"
] | null | null | null | import unittest
from telegrambotapiwrapper.request import replace__from___to__from
from telegrambotapiwrapper.response import is_str_int_float_bool
from telegrambotapiwrapper.response import replace__from__by__from_
def is_ends_with_underscore(value: str):
"""Does value end with underscore."""
if value == ""... | 33.611111 | 72 | 0.50854 | import unittest
from telegrambotapiwrapper.request import replace__from___to__from
from telegrambotapiwrapper.response import is_str_int_float_bool
from telegrambotapiwrapper.response import replace__from__by__from_
def is_ends_with_underscore(value: str):
if value == "":
return False
else:
r... | true | true |
1c386ee9726c7ae77bf8398030c2377cee80db26 | 1,443 | py | Python | smtools/extract_tarfile.py | hrsma2i/smtools | d52394b17fa2870dd4a48f7d14db9bbbbb25b9f2 | [
"MIT"
] | null | null | null | smtools/extract_tarfile.py | hrsma2i/smtools | d52394b17fa2870dd4a48f7d14db9bbbbb25b9f2 | [
"MIT"
] | null | null | null | smtools/extract_tarfile.py | hrsma2i/smtools | d52394b17fa2870dd4a48f7d14db9bbbbb25b9f2 | [
"MIT"
] | null | null | null | import os
from glob import glob
import tarfile
import argparse
def extract_tarfile(inp_dir, remove=True):
try:
tar_file = sorted(glob(os.path.join(inp_dir, '*.tar.gz')))[0]
except IndexError as e:
print(e)
print('There is no tar file in {}'.format(inp_dir))
tar_file = concat(in... | 25.767857 | 70 | 0.605683 | import os
from glob import glob
import tarfile
import argparse
def extract_tarfile(inp_dir, remove=True):
try:
tar_file = sorted(glob(os.path.join(inp_dir, '*.tar.gz')))[0]
except IndexError as e:
print(e)
print('There is no tar file in {}'.format(inp_dir))
tar_file = concat(in... | true | true |
1c386ffc62e6cdddb2329450ddc928e7cd854dbb | 1,124 | py | Python | helper/tile.py | LHGames-2018/DCI4espaces | 0b5dfed8b99d07f3f13ef4b9861494155922bc8b | [
"MIT"
] | null | null | null | helper/tile.py | LHGames-2018/DCI4espaces | 0b5dfed8b99d07f3f13ef4b9861494155922bc8b | [
"MIT"
] | null | null | null | helper/tile.py | LHGames-2018/DCI4espaces | 0b5dfed8b99d07f3f13ef4b9861494155922bc8b | [
"MIT"
] | null | null | null | from helper.structs import Point
from enum import Enum
class Tile:
def __init__(self, tile_content, x, y):
self.TileContent = tile_content
self.Position = Point(x, y)
pass
def __repr__(self):
return "(%d, %d, %s)" % (self.Position.x, self.Position.y, TileContent.getName(se... | 24.434783 | 105 | 0.579181 | from helper.structs import Point
from enum import Enum
class Tile:
def __init__(self, tile_content, x, y):
self.TileContent = tile_content
self.Position = Point(x, y)
pass
def __repr__(self):
return "(%d, %d, %s)" % (self.Position.x, self.Position.y, TileContent.getName(se... | true | true |
1c38719c8678e05b32268f4953f347590b317c36 | 20,919 | py | Python | core/domain/blog_services.py | WebFlakyTest/oppia | 520e35490eae8171beb035fbafc2948983abec75 | [
"Apache-2.0"
] | 1 | 2021-08-17T20:33:12.000Z | 2021-08-17T20:33:12.000Z | core/domain/blog_services.py | WebFlakyTest/oppia | 520e35490eae8171beb035fbafc2948983abec75 | [
"Apache-2.0"
] | null | null | null | core/domain/blog_services.py | WebFlakyTest/oppia | 520e35490eae8171beb035fbafc2948983abec75 | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
#
# Copyright 2021 The Oppia 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 requi... | 33.849515 | 117 | 0.713849 |
from __future__ import absolute_import from __future__ import unicode_literals
import datetime
from constants import constants
from core.domain import blog_domain
from core.domain import html_cleaner
from core.domain import role_services
from core.platform import models
import feconf
import python_utils
import ut... | true | true |
1c3871e35a981db48c53da28b1aaaae1d572059f | 298 | py | Python | external/odds/__init__.py | dmartin35/pronosfoot | 861ae091fbb65684d00ae8c5ff3726eeaa306ed7 | [
"MIT"
] | 4 | 2017-07-09T21:18:18.000Z | 2022-02-16T13:05:10.000Z | external/odds/__init__.py | dmartin35/pronosfoot | 861ae091fbb65684d00ae8c5ff3726eeaa306ed7 | [
"MIT"
] | 2 | 2020-01-16T14:21:42.000Z | 2021-03-02T18:34:15.000Z | external/odds/__init__.py | dmartin35/pronosfoot | 861ae091fbb65684d00ae8c5ff3726eeaa306ed7 | [
"MIT"
] | null | null | null | from external.odds.betclic.api import get_odds
# FDJ parsing is broken - their UI has been refactored with JS framework &
# protected async JSON API usage (requires HEADERS) and more complex to isolate & group match odds
# hence move to another betting website - which is still full html rendered
| 49.666667 | 98 | 0.788591 | from external.odds.betclic.api import get_odds
| true | true |
1c3872127e305c1d6af42c66f910cbac6696d91c | 72,366 | py | Python | Python-Client/project/myService.py | d0d0d0/Persona | cbea1dfaae1d44b286d9b350ccba36bc7fca4a5a | [
"MIT"
] | null | null | null | Python-Client/project/myService.py | d0d0d0/Persona | cbea1dfaae1d44b286d9b350ccba36bc7fca4a5a | [
"MIT"
] | null | null | null | Python-Client/project/myService.py | d0d0d0/Persona | cbea1dfaae1d44b286d9b350ccba36bc7fca4a5a | [
"MIT"
] | null | null | null | #
# Autogenerated by Thrift Compiler (0.9.1)
#
# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
#
# options string: py
#
from thrift.Thrift import TType, TMessageType, TException, TApplicationException
from ttypes import *
from thrift.Thrift import TProcessor
from thrift.transport import TTransport
... | 29.890954 | 188 | 0.657118 |
from thrift.Thrift import TType, TMessageType, TException, TApplicationException
from ttypes import *
from thrift.Thrift import TProcessor
from thrift.transport import TTransport
from thrift.protocol import TBinaryProtocol, TProtocol
try:
from thrift.protocol import fastbinary
except:
fastbinary = None
class Ifa... | true | true |
1c387240f490f241b3ff3d21da0f3d7bafabda5d | 1,659 | py | Python | day15/day15.py | protocol114/AdventOfCode | eec7eed81cf9f096e2dce9a9a39f5e9890a3deaf | [
"MIT"
] | null | null | null | day15/day15.py | protocol114/AdventOfCode | eec7eed81cf9f096e2dce9a9a39f5e9890a3deaf | [
"MIT"
] | null | null | null | day15/day15.py | protocol114/AdventOfCode | eec7eed81cf9f096e2dce9a9a39f5e9890a3deaf | [
"MIT"
] | null | null | null | f = open("input.txt", "r")
ingredients = []
for line in f:
temp = []
_, _, capacity, _, durability, _, flavor, _, texture, _, calories = line.split()
temp.append(int(capacity.strip(',')))
temp.append(int(durability.strip(',')))
temp.append(int(flavor.strip(',')))
temp.append(int(texture.strip(... | 38.581395 | 124 | 0.537673 | f = open("input.txt", "r")
ingredients = []
for line in f:
temp = []
_, _, capacity, _, durability, _, flavor, _, texture, _, calories = line.split()
temp.append(int(capacity.strip(',')))
temp.append(int(durability.strip(',')))
temp.append(int(flavor.strip(',')))
temp.append(int(texture.strip(... | true | true |
1c38728a1651dbc1726420ff21bcd15bdfb63d88 | 1,070 | py | Python | images/models.py | lightguy875/Django_social_media | 11d9faf4dde4b1a3b74ad71c0d9f53d3e630c103 | [
"Apache-2.0"
] | 1 | 2020-08-10T13:03:13.000Z | 2020-08-10T13:03:13.000Z | images/models.py | lightguy875/Django_social_media | 11d9faf4dde4b1a3b74ad71c0d9f53d3e630c103 | [
"Apache-2.0"
] | 7 | 2021-06-04T23:50:18.000Z | 2022-03-12T00:45:48.000Z | images/models.py | lightguy875/Django_social_media | 11d9faf4dde4b1a3b74ad71c0d9f53d3e630c103 | [
"Apache-2.0"
] | null | null | null | from django.db import models
from django.conf import settings
from django.utils.text import slugify
from django.urls import reverse
# Create your models here.
class Image(models.Model):
users_like = models.ManyToManyField(settings.AUTH_USER_MODEL,related_name='images_liked',blank=True)
user = models.ForeignKey(... | 39.62963 | 110 | 0.723364 | from django.db import models
from django.conf import settings
from django.utils.text import slugify
from django.urls import reverse
class Image(models.Model):
users_like = models.ManyToManyField(settings.AUTH_USER_MODEL,related_name='images_liked',blank=True)
user = models.ForeignKey(settings.AUTH_USER_MODEL, r... | true | true |
1c38751248735d1b99301b3fdab6685abfcc16e0 | 15,654 | py | Python | experimental/language_structure/psl/psl_model_multiwoz_test.py | jaeikjeon9919/uncertainty-baselines | 15aad70bb585452d84c0afa74208338f5db5f70e | [
"Apache-2.0"
] | null | null | null | experimental/language_structure/psl/psl_model_multiwoz_test.py | jaeikjeon9919/uncertainty-baselines | 15aad70bb585452d84c0afa74208338f5db5f70e | [
"Apache-2.0"
] | null | null | null | experimental/language_structure/psl/psl_model_multiwoz_test.py | jaeikjeon9919/uncertainty-baselines | 15aad70bb585452d84c0afa74208338f5db5f70e | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# Copyright 2021 The Uncertainty Baselines Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by ap... | 41.855615 | 110 | 0.654401 |
import tensorflow as tf
import constrained_evaluation as eval_model import data import psl_model_multiwoz as model import psl_model_multiwoz_test_util as test_util
class PslRulesTest(tf.test.TestCase):
def setUp(self):
super(PslRulesTest, self).setUp()
self.config = test_util.TEST_MULTIWOZ_CONFIG
... | true | true |
1c3875240b88f854a299beba1c25846f720cfbcb | 6,041 | py | Python | Duelist_Algorithm.py | ebruyasar11/Duelist-Algorithm | d740e0a26a33a230434441b5bcf67b1e7a7c5fd2 | [
"MIT"
] | 1 | 2021-06-02T15:34:00.000Z | 2021-06-02T15:34:00.000Z | Duelist_Algorithm.py | ebruyasar11/Duelist-Algorithm | d740e0a26a33a230434441b5bcf67b1e7a7c5fd2 | [
"MIT"
] | null | null | null | Duelist_Algorithm.py | ebruyasar11/Duelist-Algorithm | d740e0a26a33a230434441b5bcf67b1e7a7c5fd2 | [
"MIT"
] | null | null | null | import numpy as np
import random
import time
import matplotlib.pyplot as mp
class Duelist_Algorithm():
def __init__(self,f,x,altdeger,ustdeger,pop=200,sans=0.01,mutasyon=0.1,ogren=0.8,iterasyon=500,nc=5,karistir=False):
#Sınıf değişkenlerinin tanımlamaları
self.f = f
self.x = x
self.altdeger = altdeger
self... | 33.375691 | 121 | 0.692766 | import numpy as np
import random
import time
import matplotlib.pyplot as mp
class Duelist_Algorithm():
def __init__(self,f,x,altdeger,ustdeger,pop=200,sans=0.01,mutasyon=0.1,ogren=0.8,iterasyon=500,nc=5,karistir=False):
self.f = f
self.x = x
self.altdeger = altdeger
self.ustdeger = ustdeger
self.populasyo... | true | true |
1c3875eec768725e04f838322599ca3ca2fc43f3 | 8,450 | py | Python | tools/test_crowdhuman.py | Ernstsen/Pedestron | 0c5aa35881561bcd0acf5de8939472efd6409256 | [
"Apache-2.0"
] | 594 | 2020-03-20T11:52:59.000Z | 2022-03-30T11:58:55.000Z | tools/test_crowdhuman.py | Ernstsen/Pedestron | 0c5aa35881561bcd0acf5de8939472efd6409256 | [
"Apache-2.0"
] | 131 | 2020-03-25T09:48:04.000Z | 2022-03-30T17:54:38.000Z | tools/test_crowdhuman.py | Ernstsen/Pedestron | 0c5aa35881561bcd0acf5de8939472efd6409256 | [
"Apache-2.0"
] | 128 | 2020-03-20T14:22:11.000Z | 2022-03-22T09:41:39.000Z | import argparse
import os
import os.path as osp
import shutil
import tempfile
import json
import time
import mmcv
import torch
import torch.distributed as dist
from mmcv.runner import load_checkpoint, get_dist_info
from mmcv.parallel import MMDataParallel, MMDistributedDataParallel
from mmdet.apis import init_dist
fr... | 37.22467 | 142 | 0.60213 | import argparse
import os
import os.path as osp
import shutil
import tempfile
import json
import time
import mmcv
import torch
import torch.distributed as dist
from mmcv.runner import load_checkpoint, get_dist_info
from mmcv.parallel import MMDataParallel, MMDistributedDataParallel
from mmdet.apis import init_dist
fr... | true | true |
1c38768a0bf2c6600f6129ebdcec86e801059f7a | 262 | py | Python | setup.py | MarcMarabou/02476_ml_ops_project | 0a46bca731271287f6ba00270e8b18e76323fcae | [
"FTL"
] | null | null | null | setup.py | MarcMarabou/02476_ml_ops_project | 0a46bca731271287f6ba00270e8b18e76323fcae | [
"FTL"
] | 1 | 2022-01-20T09:16:37.000Z | 2022-01-20T09:16:37.000Z | setup.py | MarcMarabou/02476_ml_ops_project | 0a46bca731271287f6ba00270e8b18e76323fcae | [
"FTL"
] | null | null | null | from setuptools import find_packages, setup
setup(
name="src",
packages=find_packages(),
version="0.1.0",
description="A short description of the project.",
author="Your name (or your organization/company/team)",
license="",
)
| 23.818182 | 60 | 0.652672 | from setuptools import find_packages, setup
setup(
name="src",
packages=find_packages(),
version="0.1.0",
description="A short description of the project.",
author="Your name (or your organization/company/team)",
license="",
)
| true | true |
1c387750188c0c363aa55562e890fe6e14eb7296 | 7,878 | py | Python | api/utils.py | josuelopes512/mastercode_films_api | ab8ea5ce55a1eeee90a1ec3c5447434ca37d83bb | [
"Apache-2.0"
] | null | null | null | api/utils.py | josuelopes512/mastercode_films_api | ab8ea5ce55a1eeee90a1ec3c5447434ca37d83bb | [
"Apache-2.0"
] | null | null | null | api/utils.py | josuelopes512/mastercode_films_api | ab8ea5ce55a1eeee90a1ec3c5447434ca37d83bb | [
"Apache-2.0"
] | null | null | null | from django.utils.text import slugify
from threading import Thread
from random import randint
from pathlib import Path
import environ, base64, requests as req
BASE_DIR = Path(__file__).resolve().parent.parent
env = environ.Env()
environ.Env.read_env(BASE_DIR / '.env')
API_KEY= env('API_KEY')
URL_DB = 'https://api... | 35.327354 | 123 | 0.627444 | from django.utils.text import slugify
from threading import Thread
from random import randint
from pathlib import Path
import environ, base64, requests as req
BASE_DIR = Path(__file__).resolve().parent.parent
env = environ.Env()
environ.Env.read_env(BASE_DIR / '.env')
API_KEY= env('API_KEY')
URL_DB = 'https://api... | true | true |
1c387750eed6826249cb679584ede439dce7288e | 1,592 | py | Python | likeapp/utils.py | verhovensky/likeapprestapi | 4a87690a37568041d5498c8b94259704af080af1 | [
"MIT"
] | null | null | null | likeapp/utils.py | verhovensky/likeapprestapi | 4a87690a37568041d5498c8b94259704af080af1 | [
"MIT"
] | null | null | null | likeapp/utils.py | verhovensky/likeapprestapi | 4a87690a37568041d5498c8b94259704af080af1 | [
"MIT"
] | null | null | null | from django.contrib.auth import get_user_model
from django.contrib.contenttypes.models import ContentType
from .models import Like
# import datetime
# Bishkek Time zone
# import pytz
# timezone = pytz.timezone("Asia/Bishkek")
User = get_user_model()
def add_like(obj, user):
"""Like `obj`.
"""
obj_type = ... | 26.533333 | 89 | 0.612437 | from django.contrib.auth import get_user_model
from django.contrib.contenttypes.models import ContentType
from .models import Like
User = get_user_model()
def add_like(obj, user):
obj_type = ContentType.objects.get_for_model(obj)
like, is_created = Like.objects.get_or_create(
content_type=obj_type, o... | true | true |
1c387a98241666d68205340ff5d7afecd591a0f2 | 576 | py | Python | unit 9/exc. 9.2.3.py | AviKalPython/self.py | 44f8de33797a9ea28bbd1e01006920ba7c818b97 | [
"MIT"
] | null | null | null | unit 9/exc. 9.2.3.py | AviKalPython/self.py | 44f8de33797a9ea28bbd1e01006920ba7c818b97 | [
"MIT"
] | null | null | null | unit 9/exc. 9.2.3.py | AviKalPython/self.py | 44f8de33797a9ea28bbd1e01006920ba7c818b97 | [
"MIT"
] | null | null | null | # exc. 9.2.3
def who_is_missing(file_name):
find_the_num = open(file_name, "r")
numbers = find_the_num.read()
number_list = [int(x) for x in numbers.split(",")]
number_list.sort()
#print(number_list)
i = number_list[0]
for num in number_list:
if i not in number_list:
found = i
i += 1
find_th... | 23.04 | 58 | 0.663194 | def who_is_missing(file_name):
find_the_num = open(file_name, "r")
numbers = find_the_num.read()
number_list = [int(x) for x in numbers.split(",")]
number_list.sort()
i = number_list[0]
for num in number_list:
if i not in number_list:
found = i
i += 1
find_the_num.close()
new_text = open(r... | true | true |
1c387ab39db476e5a6f23a51533f27992deec27c | 749 | py | Python | daoagent/log.py | Symantec/dao-agent | 601ac49d2512b539c58a7026b1f8fb76645ba9a6 | [
"Apache-2.0"
] | null | null | null | daoagent/log.py | Symantec/dao-agent | 601ac49d2512b539c58a7026b1f8fb76645ba9a6 | [
"Apache-2.0"
] | null | null | null | daoagent/log.py | Symantec/dao-agent | 601ac49d2512b539c58a7026b1f8fb76645ba9a6 | [
"Apache-2.0"
] | 2 | 2019-09-18T22:51:31.000Z | 2021-02-26T10:19:32.000Z | # Copyright 2016 Symantec, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writi... | 35.666667 | 75 | 0.757009 |
import logging
logging.basicConfig(filename='/tmp/validation.log', level=logging.DEBUG)
def get_logger(*args, **kwargs):
return logging.getLogger(*args, **kwargs) | true | true |
1c387b3d34a16ac37f56f4e5e23e7b8e09236e94 | 11,755 | py | Python | src/plugins/NextStep/NextStep/__init__.py | rpicard92/petri-net-webgme-app | 3ab1808cd4f1f5bb516be66b39daf7a74b8660c5 | [
"MIT"
] | 1 | 2020-09-09T01:23:04.000Z | 2020-09-09T01:23:04.000Z | src/plugins/NextStep/NextStep/__init__.py | rpicard92/petri-net-webgme-app | 3ab1808cd4f1f5bb516be66b39daf7a74b8660c5 | [
"MIT"
] | null | null | null | src/plugins/NextStep/NextStep/__init__.py | rpicard92/petri-net-webgme-app | 3ab1808cd4f1f5bb516be66b39daf7a74b8660c5 | [
"MIT"
] | null | null | null | """
This is where the implementation of the plugin code goes.
The NextStep-class is imported from both run_plugin.py and run_debug.py
"""
import sys
import logging
import random
from webgme_bindings import PluginBase
# Setup a logger
logger = logging.getLogger('NextStep')
logger.setLevel(logging.INFO)
hand... | 47.979592 | 335 | 0.527946 | import sys
import logging
import random
from webgme_bindings import PluginBase
logger = logging.getLogger('NextStep')
logger.setLevel(logging.INFO)
handler = logging.StreamHandler(sys.stdout) handler.setLevel(logging.INFO)
formatter = logging.Formatter('%(asctime)s - %(name)s - %(levelname)s - %(message)s')
... | true | true |
1c387b757cb81b71f694b90c41926c678de27943 | 1,656 | py | Python | import.py | hornetmadness/pfsence-voucher-printer | 5dd2a36f7f44480875131ca1724072d4a4444d4a | [
"MIT"
] | 2 | 2020-07-04T23:44:55.000Z | 2021-06-03T20:05:12.000Z | import.py | hornetmadness/pfsence-voucher-printer | 5dd2a36f7f44480875131ca1724072d4a4444d4a | [
"MIT"
] | null | null | null | import.py | hornetmadness/pfsence-voucher-printer | 5dd2a36f7f44480875131ca1724072d4a4444d4a | [
"MIT"
] | null | null | null | import config
import logging
import argparse
import sys
import csv
from db import Vouchers, connect_db
from sqlalchemy.orm import sessionmaker
db=connect_db() #establish connection
Session = sessionmaker(bind=db)
session = Session()
def importCSV(file, time):
bulkInsert=[]
keep={}
csv.register_dialect('myDialec... | 26.709677 | 95 | 0.694444 | import config
import logging
import argparse
import sys
import csv
from db import Vouchers, connect_db
from sqlalchemy.orm import sessionmaker
db=connect_db() Session = sessionmaker(bind=db)
session = Session()
def importCSV(file, time):
bulkInsert=[]
keep={}
csv.register_dialect('myDialect',
skipinitialspa... | true | true |
1c387b91c5689545d6a13dcbc60bb9934ed15e83 | 890 | py | Python | model.py | rahulkumar1112/Audio-Classification | 589fccae5eeb9feaf04073b1243c0004759e3255 | [
"MIT"
] | 1 | 2019-06-21T14:43:48.000Z | 2019-06-21T14:43:48.000Z | Example Audio and Deep Learning/model.py | felipegetulio/Artificial-Neural-Networks---Projects | 04d16703ccc2fb10cc1ba92850364ea49b9a5bfa | [
"MIT"
] | null | null | null | Example Audio and Deep Learning/model.py | felipegetulio/Artificial-Neural-Networks---Projects | 04d16703ccc2fb10cc1ba92850364ea49b9a5bfa | [
"MIT"
] | null | null | null | import os
from scipy.io import wavfile
import pandas as pd
import matplotlib.pyplot as plt
import numpy as np
from keras.layers import Conv2D, MaxPool2D, Flatten, LSTM
from keras.layers import Dropout, Dense, TimeDistributed
from keras.models import Sequential
from keras.utils import to_categorical
from sklearn.utils.c... | 29.666667 | 62 | 0.75618 | import os
from scipy.io import wavfile
import pandas as pd
import matplotlib.pyplot as plt
import numpy as np
from keras.layers import Conv2D, MaxPool2D, Flatten, LSTM
from keras.layers import Dropout, Dense, TimeDistributed
from keras.models import Sequential
from keras.utils import to_categorical
from sklearn.utils.c... | true | true |
1c387d96bc457f3a14396ce1eafbcba911ab775e | 2,317 | py | Python | chapter9-神经网络写诗(CharRNN)/utils.py | 1364354238/PYTORCH_LEARNING | d7ab877512ab41c80b37ab68bd1a42193916f31c | [
"MIT"
] | 137 | 2018-11-13T06:35:49.000Z | 2022-03-07T09:21:31.000Z | chapter9_CharRNN/utils.py | pythonProjectLearn/PytorchLearning | 835ce23656e5816f5fbc9018f85f8613bff8f24c | [
"MIT"
] | null | null | null | chapter9_CharRNN/utils.py | pythonProjectLearn/PytorchLearning | 835ce23656e5816f5fbc9018f85f8613bff8f24c | [
"MIT"
] | 54 | 2018-11-13T09:38:37.000Z | 2022-03-25T03:46:25.000Z | #coding:utf8
import visdom
import torch as t
import time
import torchvision as tv
import numpy as np
class Visualizer():
'''
封装了visdom的基本操作,但是你仍然可以通过`self.vis.function`
调用原生的visdom接口
'''
def __init__(self, env='default', **kwargs):
import visdom
self.vis = visdom.Visdom(env=env, *... | 25.184783 | 63 | 0.475615 | import visdom
import torch as t
import time
import torchvision as tv
import numpy as np
class Visualizer():
def __init__(self, env='default', **kwargs):
import visdom
self.vis = visdom.Visdom(env=env, **kwargs)
self.index = {}
self.log_text = ''
def r... | true | true |
1c387f54b5725f7f26862a550a12f20335f91984 | 2,542 | py | Python | Generate battery report/Generate battery report.py | xinxin2021/my-projects | e2a95dff404c131c9795deea04829514a770e94d | [
"MIT"
] | null | null | null | Generate battery report/Generate battery report.py | xinxin2021/my-projects | e2a95dff404c131c9795deea04829514a770e94d | [
"MIT"
] | null | null | null | Generate battery report/Generate battery report.py | xinxin2021/my-projects | e2a95dff404c131c9795deea04829514a770e94d | [
"MIT"
] | null | null | null | # coding=utf-8
import os
import wx
def isi(path,name):
file = os.listdir(path)
if name in file:
return True
else:
return False
def isib(l,dx):
for i in range(len(l)):
if l[i] in dx:
return False
return True
class MyFrame(wx.Frame):
def __init_... | 39.107692 | 192 | 0.560582 | import os
import wx
def isi(path,name):
file = os.listdir(path)
if name in file:
return True
else:
return False
def isib(l,dx):
for i in range(len(l)):
if l[i] in dx:
return False
return True
class MyFrame(wx.Frame):
def __init__(self):
... | true | true |
1c387f6af54f5ffd813b646aa95618c3133661bb | 13,234 | py | Python | mc/bookmarks/BookmarksTools.py | zy-sunshine/falkon-pyqt5 | bc2b60aa21c9b136439bd57a11f391d68c736f99 | [
"MIT"
] | 1 | 2021-04-29T05:36:44.000Z | 2021-04-29T05:36:44.000Z | mc/bookmarks/BookmarksTools.py | zy-sunshine/falkon-pyqt5 | bc2b60aa21c9b136439bd57a11f391d68c736f99 | [
"MIT"
] | 1 | 2020-03-28T17:43:18.000Z | 2020-03-28T17:43:18.000Z | mc/bookmarks/BookmarksTools.py | zy-sunshine/falkon-pyqt5 | bc2b60aa21c9b136439bd57a11f391d68c736f99 | [
"MIT"
] | 1 | 2021-01-15T20:09:24.000Z | 2021-01-15T20:09:24.000Z | from PyQt5.QtWidgets import QBoxLayout
from PyQt5.QtWidgets import QDialog
from PyQt5.QtWidgets import QDialogButtonBox
from PyQt5.QtWidgets import QLabel
from PyQt5.QtWidgets import QLineEdit
from PyQt5.QtWidgets import QMenu
from PyQt5.QtWidgets import QPushButton
from PyQt5.Qt import pyqtSignal
from PyQt5.Qt import ... | 29.540179 | 108 | 0.610473 | from PyQt5.QtWidgets import QBoxLayout
from PyQt5.QtWidgets import QDialog
from PyQt5.QtWidgets import QDialogButtonBox
from PyQt5.QtWidgets import QLabel
from PyQt5.QtWidgets import QLineEdit
from PyQt5.QtWidgets import QMenu
from PyQt5.QtWidgets import QPushButton
from PyQt5.Qt import pyqtSignal
from PyQt5.Qt import ... | true | true |
1c387f79fe2cfc8681e3cba4788cfe8bebea297d | 13,532 | py | Python | funfact/lang/interpreter/test_type_deduction.py | campsd/FunFact | 477bcf06794f09608240eba992823fae6fde8dad | [
"BSD-3-Clause-LBNL"
] | 37 | 2021-09-22T17:28:35.000Z | 2022-03-07T00:11:17.000Z | funfact/lang/interpreter/test_type_deduction.py | campsd/FunFact | 477bcf06794f09608240eba992823fae6fde8dad | [
"BSD-3-Clause-LBNL"
] | 125 | 2021-11-04T16:50:24.000Z | 2022-03-28T17:54:13.000Z | funfact/lang/interpreter/test_type_deduction.py | campsd/FunFact | 477bcf06794f09608240eba992823fae6fde8dad | [
"BSD-3-Clause-LBNL"
] | 2 | 2021-12-13T07:28:42.000Z | 2021-12-13T07:51:41.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import pytest # noqa: F401
from unittest.mock import MagicMock as M
from .._ast import Primitives as P
from ._type_deduction import TypeDeducer, _add_attr
@pytest.fixture
def intr():
return TypeDeducer()
def as_payload(live_indices, keep_indices, kron_indices, shap... | 25.726236 | 79 | 0.381392 | import pytest from unittest.mock import MagicMock as M
from .._ast import Primitives as P
from ._type_deduction import TypeDeducer, _add_attr
@pytest.fixture
def intr():
return TypeDeducer()
def as_payload(live_indices, keep_indices, kron_indices, shape):
return dict(
live_indices=live_indices,
... | true | true |
1c387fd94b6bfb20418bc9254eb731521eb4b65f | 10,660 | py | Python | vision/databunch.py | srujandeshpande/DashAI | 85581abc17ff3a8bf03a1e8b6aae7a06e5ab0dc8 | [
"Apache-2.0"
] | 7 | 2020-08-26T09:36:54.000Z | 2021-12-21T15:46:32.000Z | vision/databunch.py | JoeRishon/DashAI | 68d1b01088a65e2062d96b47b083fa8f5c82b27c | [
"Apache-2.0"
] | 16 | 2020-08-25T18:44:45.000Z | 2022-03-25T19:12:36.000Z | vision/databunch.py | JoeRishon/DashAI | 68d1b01088a65e2062d96b47b083fa8f5c82b27c | [
"Apache-2.0"
] | 10 | 2020-09-30T19:27:17.000Z | 2021-04-04T14:50:31.000Z | from fastai.vision import *
from fastai.vision.gan import GANItemList
from core.databunch import DashDatabunch
from pathlib import Path
class DashVisionDatabunch:
def create_vision_databunch(response):
path = Path('./')
src = DashVisionDatabunch.get_itemlist(response)
src = DashDatabunch.split_databunch(resp... | 47.802691 | 155 | 0.679081 | from fastai.vision import *
from fastai.vision.gan import GANItemList
from core.databunch import DashDatabunch
from pathlib import Path
class DashVisionDatabunch:
def create_vision_databunch(response):
path = Path('./')
src = DashVisionDatabunch.get_itemlist(response)
src = DashDatabunch.split_databunch(resp... | true | true |
1c387ffffca64bd1c952d2445da2b5c5569fbcfc | 2,406 | py | Python | data/p4VQE/R1/benchmark/startQiskit61.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | data/p4VQE/R1/benchmark/startQiskit61.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | data/p4VQE/R1/benchmark/startQiskit61.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | # qubit number=3
# total number=10
import numpy as np
from qiskit import QuantumCircuit, execute, Aer, QuantumRegister, ClassicalRegister, transpile, BasicAer, IBMQ
import networkx as nx
from qiskit.visualization import plot_histogram
from typing import *
from pprint import pprint
from math import log2
from collectio... | 27.033708 | 118 | 0.632585 |
import numpy as np
from qiskit import QuantumCircuit, execute, Aer, QuantumRegister, ClassicalRegister, transpile, BasicAer, IBMQ
import networkx as nx
from qiskit.visualization import plot_histogram
from typing import *
from pprint import pprint
from math import log2
from collections import Counter
from qiskit.test.... | true | true |
1c388050475bd1bdb984e23752da29323d62e673 | 57,210 | py | Python | test/engine/test_pool.py | hbusul/sqlalchemy | cd58836d3e19489d5203c02f7cc5f2f2d7c82a20 | [
"MIT"
] | null | null | null | test/engine/test_pool.py | hbusul/sqlalchemy | cd58836d3e19489d5203c02f7cc5f2f2d7c82a20 | [
"MIT"
] | null | null | null | test/engine/test_pool.py | hbusul/sqlalchemy | cd58836d3e19489d5203c02f7cc5f2f2d7c82a20 | [
"MIT"
] | null | null | null | import collections
import random
import threading
import time
import weakref
import sqlalchemy as tsa
from sqlalchemy import event
from sqlalchemy import pool
from sqlalchemy import select
from sqlalchemy import testing
from sqlalchemy.engine import default
from sqlalchemy.pool.impl import _AsyncConnDialect
from sqlal... | 28.251852 | 79 | 0.571474 | import collections
import random
import threading
import time
import weakref
import sqlalchemy as tsa
from sqlalchemy import event
from sqlalchemy import pool
from sqlalchemy import select
from sqlalchemy import testing
from sqlalchemy.engine import default
from sqlalchemy.pool.impl import _AsyncConnDialect
from sqlal... | true | true |
1c38810df10e266c92d99bb8419da6c328ffd0d1 | 948 | py | Python | examples/swat-s1/run.py | pgaulon/minicps | f3b873e00f477d8b5c36fcb7df3d1cfe27063822 | [
"MIT"
] | 119 | 2015-10-16T22:47:39.000Z | 2022-03-31T07:18:00.000Z | examples/swat-s1/run.py | DolphinWilly/minicps | 7400f85e47d09901bb702966abf557244cf11ce4 | [
"MIT"
] | 20 | 2016-09-30T06:18:39.000Z | 2022-03-11T10:51:33.000Z | examples/swat-s1/run.py | DolphinWilly/minicps | 7400f85e47d09901bb702966abf557244cf11ce4 | [
"MIT"
] | 65 | 2016-07-27T03:50:39.000Z | 2022-03-05T14:49:17.000Z | """
swat-s1 run.py
"""
from mininet.net import Mininet
from mininet.cli import CLI
from minicps.mcps import MiniCPS
from topo import SwatTopo
import sys
class SwatS1CPS(MiniCPS):
"""Main container used to run the simulation."""
def __init__(self, name, net):
self.name = name
self.net = n... | 18.96 | 57 | 0.580169 |
from mininet.net import Mininet
from mininet.cli import CLI
from minicps.mcps import MiniCPS
from topo import SwatTopo
import sys
class SwatS1CPS(MiniCPS):
def __init__(self, name, net):
self.name = name
self.net = net
net.start()
net.pingAll()
plc1, plc2, ... | true | true |
1c3881223c1ee0b542cb5cb12e20136c58a24464 | 6,582 | py | Python | pyOCD/target/target_MK22FN1M0Axxx12.py | orenc17/pyOCD | b5c9bc62b68323129aa258e128a8fc68aaa2527f | [
"Apache-2.0"
] | 1 | 2018-10-30T12:47:34.000Z | 2018-10-30T12:47:34.000Z | pyOCD/target/target_MK22FN1M0Axxx12.py | orenc17/pyOCD | b5c9bc62b68323129aa258e128a8fc68aaa2527f | [
"Apache-2.0"
] | null | null | null | pyOCD/target/target_MK22FN1M0Axxx12.py | orenc17/pyOCD | b5c9bc62b68323129aa258e128a8fc68aaa2527f | [
"Apache-2.0"
] | 1 | 2021-02-04T10:05:57.000Z | 2021-02-04T10:05:57.000Z | """
mbed CMSIS-DAP debugger
Copyright (c) 2006-2013 ARM Limited
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 ... | 56.25641 | 101 | 0.762078 |
from .family.target_kinetis import Kinetis
from .family.flash_kinetis import Flash_Kinetis
from ..core.memory_map import (FlashRegion, RamRegion, MemoryMap)
from ..debug.svd import SVDFile
import logging
SIM_FCFG1 = 0x4004804C
SIM_FCFG2 = 0x40048050
SIM_FCFG2_PFLSH = (1 << 23)
flash_algo = {
'load_address' : 0x2... | true | true |
1c38824e94a12bf48e5da200097fda8c47173733 | 4,662 | py | Python | pynmrstar/utils.py | bmrb-io/PyNMRSTAR | 55df5bf7de192e7a6c95f37e0756f09e3f504170 | [
"MIT"
] | 1 | 2022-03-07T16:10:56.000Z | 2022-03-07T16:10:56.000Z | pynmrstar/utils.py | bmrb-io/PyNMRSTAR | 55df5bf7de192e7a6c95f37e0756f09e3f504170 | [
"MIT"
] | 2 | 2021-10-29T19:25:56.000Z | 2022-02-28T11:05:44.000Z | pynmrstar/utils.py | bmrb-io/PyNMRSTAR | 55df5bf7de192e7a6c95f37e0756f09e3f504170 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
""" This file contains various helper functions."""
import functools
import json
import os
from typing import Iterable, Any, Dict
from urllib.error import HTTPError, URLError
from pynmrstar import definitions, cnmrstar, entry as entry_mod
from pynmrstar._internal import _interpret_file
from pyn... | 34.533333 | 112 | 0.682754 |
import functools
import json
import os
from typing import Iterable, Any, Dict
from urllib.error import HTTPError, URLError
from pynmrstar import definitions, cnmrstar, entry as entry_mod
from pynmrstar._internal import _interpret_file
from pynmrstar.schema import Schema
__all__ = ['diff', 'format_category', 'format_... | true | true |
1c38828042952d710c0ec220f1f9afaa869a649e | 867 | py | Python | src/east_coast_images/plot_ratios.py | slawler/SI_2019_Coastal | 4064d323bc62ce2f47a7af41b9a11ea5538ad181 | [
"MIT"
] | 1 | 2020-03-13T07:51:44.000Z | 2020-03-13T07:51:44.000Z | src/east_coast_images/plot_ratios.py | cheginit/SI_2019_Coastal | 4064d323bc62ce2f47a7af41b9a11ea5538ad181 | [
"MIT"
] | null | null | null | src/east_coast_images/plot_ratios.py | cheginit/SI_2019_Coastal | 4064d323bc62ce2f47a7af41b9a11ea5538ad181 | [
"MIT"
] | 1 | 2020-03-13T14:44:57.000Z | 2020-03-13T14:44:57.000Z | import pandas as pd
from pathlib import Path
from geopy import distance
import utils
data = pd.read_csv('shape_data.csv')
left = data.loc[data.Lon.idxmin(), ['Lat', 'Lon']]
data['Distance'] = data.apply(lambda x: distance.geodesic(left, (x['Lat'], x['Lon'])).km, axis=1)
trap = data.loc[data.Shape == 'trapezoid', ['L... | 39.409091 | 97 | 0.655133 | import pandas as pd
from pathlib import Path
from geopy import distance
import utils
data = pd.read_csv('shape_data.csv')
left = data.loc[data.Lon.idxmin(), ['Lat', 'Lon']]
data['Distance'] = data.apply(lambda x: distance.geodesic(left, (x['Lat'], x['Lon'])).km, axis=1)
trap = data.loc[data.Shape == 'trapezoid', ['L... | true | true |
1c388316514f753f1f2f8589d28db201efa18df7 | 5,330 | py | Python | test/IECoreImage/DisplayDriverServerTest.py | andrewkaufman/cortex | 23f893c3c0c92ec1842e3946f9654ff91f40aa67 | [
"BSD-3-Clause"
] | null | null | null | test/IECoreImage/DisplayDriverServerTest.py | andrewkaufman/cortex | 23f893c3c0c92ec1842e3946f9654ff91f40aa67 | [
"BSD-3-Clause"
] | null | null | null | test/IECoreImage/DisplayDriverServerTest.py | andrewkaufman/cortex | 23f893c3c0c92ec1842e3946f9654ff91f40aa67 | [
"BSD-3-Clause"
] | null | null | null | ##########################################################################
#
# Copyright (c) 2016, Image Engine Design Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistribu... | 44.789916 | 148 | 0.732645 | # IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
import six
import unittest
import IECore
import IECoreImage
class DisplayDriverServerTest( unittest.TestCase ) :
def testPortNumber( self ) :
s1 = IECoreImage.DisplayDriverServer( 1559 )
self.assertEqual( s1.portNumber(), 1559 )
s... | true | true |
1c38834865037be0126926c49cc1add3c763f20d | 3,852 | py | Python | ixnetwork_restpy/testplatform/sessions/ixnetwork/topology/dhcp6iana6_7939c0233bac17c3e3764bc9bc1a9571.py | OpenIxia/ixnetwork_restpy | f628db450573a104f327cf3c737ca25586e067ae | [
"MIT"
] | 20 | 2019-05-07T01:59:14.000Z | 2022-02-11T05:24:47.000Z | ixnetwork_restpy/testplatform/sessions/ixnetwork/topology/dhcp6iana6_7939c0233bac17c3e3764bc9bc1a9571.py | OpenIxia/ixnetwork_restpy | f628db450573a104f327cf3c737ca25586e067ae | [
"MIT"
] | 60 | 2019-04-03T18:59:35.000Z | 2022-02-22T12:05:05.000Z | ixnetwork_restpy/testplatform/sessions/ixnetwork/topology/dhcp6iana6_7939c0233bac17c3e3764bc9bc1a9571.py | OpenIxia/ixnetwork_restpy | f628db450573a104f327cf3c737ca25586e067ae | [
"MIT"
] | 13 | 2019-05-20T10:48:31.000Z | 2021-10-06T07:45:44.000Z | # MIT LICENSE
#
# Copyright 1997 - 2020 by IXIA Keysight
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"),
# to deal in the Software without restriction, including without limitation
# the rights to use, copy, modify,... | 35.33945 | 145 | 0.660696 | from ixnetwork_restpy.base import Base
from ixnetwork_restpy.files import Files
from typing import List, Any, Union
class Dhcp6Iana6(Base):
__slots__ = ()
_SDM_NAME = 'dhcp6Iana6'
_SDM_ATT_MAP = {
'Count': 'count',
'DescriptiveName': 'descriptiveName',
'Name': 'name',
}
_S... | true | true |
1c3883ecedd095bf376a4526f985caa975a29924 | 38,335 | py | Python | tests/test_tools.py | raidun99/regolith | ad4af42023d6133d18b0ef8aac7f3ef7aa5c1693 | [
"CC0-1.0"
] | null | null | null | tests/test_tools.py | raidun99/regolith | ad4af42023d6133d18b0ef8aac7f3ef7aa5c1693 | [
"CC0-1.0"
] | null | null | null | tests/test_tools.py | raidun99/regolith | ad4af42023d6133d18b0ef8aac7f3ef7aa5c1693 | [
"CC0-1.0"
] | null | null | null | import pytest
import datetime as dt
from regolith.tools import (
filter_publications,
fuzzy_retrieval,
fragment_retrieval,
number_suffix,
latex_safe,
update_schemas,
merge_collections,
group,
is_fully_appointed,
group_member_ids,
group_member_employment_start_end,
month_a... | 39.197342 | 150 | 0.481753 | import pytest
import datetime as dt
from regolith.tools import (
filter_publications,
fuzzy_retrieval,
fragment_retrieval,
number_suffix,
latex_safe,
update_schemas,
merge_collections,
group,
is_fully_appointed,
group_member_ids,
group_member_employment_start_end,
month_a... | true | true |
1c38840516f5d7445dc6d7a99403e818a10956dd | 2,932 | py | Python | osim-rl/examples/arm.py | lancerane/NIPS-2018-AI-for-Prosthetics | 7689646e2d079ffcbcde898ece25d2cf78c132c7 | [
"MIT"
] | 3 | 2019-04-01T10:14:04.000Z | 2022-02-16T07:15:49.000Z | osim-rl/examples/arm.py | lancerane/NIPS-2018-AI-for-Prosthetics | 7689646e2d079ffcbcde898ece25d2cf78c132c7 | [
"MIT"
] | 1 | 2019-07-10T07:57:48.000Z | 2019-07-11T07:41:43.000Z | osim-rl/examples/arm.py | lancerane/NIPS-2018-AI-for-Prosthetics | 7689646e2d079ffcbcde898ece25d2cf78c132c7 | [
"MIT"
] | 3 | 2019-05-12T09:41:00.000Z | 2021-11-03T20:54:36.000Z | import os
from osim.env import OsimEnv
import pprint
import numpy as np
class Arm3dEnv(OsimEnv):
model_path = os.path.join(os.path.dirname(__file__), '../osim/models/MoBL_ARMS_J_Simple_032118.osim')
time_limit = 200
current_objective = np.array([0,0,0])
def is_done(self):
# End ... | 35.756098 | 138 | 0.596862 | import os
from osim.env import OsimEnv
import pprint
import numpy as np
class Arm3dEnv(OsimEnv):
model_path = os.path.join(os.path.dirname(__file__), '../osim/models/MoBL_ARMS_J_Simple_032118.osim')
time_limit = 200
current_objective = np.array([0,0,0])
def is_done(self):
... | true | true |
1c38844a25ec5660e773058dc22758b3ba1914bf | 446 | py | Python | src/lolite/lib/hooks/Python3Script.py | NathanKewley/lolite | f3d6cd07e9893bbb6b923d49ecb8681cd218eace | [
"Apache-2.0"
] | 5 | 2021-05-04T06:07:43.000Z | 2021-12-11T15:08:01.000Z | src/lolite/lib/hooks/Python3Script.py | NathanKewley/lolite | f3d6cd07e9893bbb6b923d49ecb8681cd218eace | [
"Apache-2.0"
] | 4 | 2021-05-01T07:20:21.000Z | 2021-05-29T04:51:56.000Z | src/lolite/lib/hooks/Python3Script.py | NathanKewley/lolite | f3d6cd07e9893bbb6b923d49ecb8681cd218eace | [
"Apache-2.0"
] | null | null | null | from lolite.lib.hooks.hook_base import HookBase
class Hook(HookBase):
def __init__(self, logger, arguments):
super().__init__(logger, arguments)
def execute_hook(self):
self._logger.debug(f"Running Python3 Hook: {self._arguments}")
if not self._subproc.run_command_exit_co... | 31.857143 | 87 | 0.674888 | from lolite.lib.hooks.hook_base import HookBase
class Hook(HookBase):
def __init__(self, logger, arguments):
super().__init__(logger, arguments)
def execute_hook(self):
self._logger.debug(f"Running Python3 Hook: {self._arguments}")
if not self._subproc.run_command_exit_co... | true | true |
1c38844fce8820095626484dad3f69c9e1319288 | 24,888 | py | Python | cisco-ios-xr/ydk/models/cisco_ios_xr/Cisco_IOS_XR_mpls_vpn_oper.py | bopopescu/ACI | dd717bc74739eeed4747b3ea9e36b239580df5e1 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | cisco-ios-xr/ydk/models/cisco_ios_xr/Cisco_IOS_XR_mpls_vpn_oper.py | bopopescu/ACI | dd717bc74739eeed4747b3ea9e36b239580df5e1 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | cisco-ios-xr/ydk/models/cisco_ios_xr/Cisco_IOS_XR_mpls_vpn_oper.py | bopopescu/ACI | dd717bc74739eeed4747b3ea9e36b239580df5e1 | [
"ECL-2.0",
"Apache-2.0"
] | 1 | 2020-07-22T04:04:44.000Z | 2020-07-22T04:04:44.000Z | """ Cisco_IOS_XR_mpls_vpn_oper
This module contains a collection of YANG definitions
for Cisco IOS\-XR mpls\-vpn package operational data.
This module contains definitions
for the following management objects\:
l3vpn\: L3VPN operational data
Copyright (c) 2013\-2017 by Cisco Systems, Inc.
All rights reserved.
""... | 36.069565 | 175 | 0.499879 | from collections import OrderedDict
from ydk.types import Entity, EntityPath, Identity, Enum, YType, YLeaf, YLeafList, YList, LeafDataList, Bits, Empty, Decimal64
from ydk.filters import YFilter
from ydk.errors import YError, YModelError
from ydk.errors.error_handler import handle_type_error as _handle_type_error
cl... | true | true |
1c3884b2e21c9416d76a3ae7f7dfa9fe00146e26 | 4,127 | py | Python | application/aci/models.py | HyechurnJang/archon | 2cda56436ed6dea65d38774f7c9ed6c3315dbc03 | [
"Apache-2.0"
] | 1 | 2018-03-07T08:33:23.000Z | 2018-03-07T08:33:23.000Z | application/aci/models.py | HyechurnJang/archon | 2cda56436ed6dea65d38774f7c9ed6c3315dbc03 | [
"Apache-2.0"
] | 2 | 2017-03-14T01:02:55.000Z | 2017-03-14T01:07:29.000Z | application/aci/models.py | HyechurnJang/archon | 2cda56436ed6dea65d38774f7c9ed6c3315dbc03 | [
"Apache-2.0"
] | 4 | 2017-02-03T04:53:07.000Z | 2020-04-20T07:52:47.000Z | # -*- coding: utf-8 -*-
################################################################################
# _____ _ _____ _ #
# / ____(_) / ____| | | #
# | | _ ___ ___ ___ | (___ _ _ ___| |_... | 53.597403 | 80 | 0.388902 | # | |____| \__ \ (_| (_) | ____) | |_| \__ \ || __/ | | | | \__ \ #
# \_____|_|___/\___\___/ |_____/ \__, |___/\__\___|_| |_| |_|___/ #
# __/ | #
# |___/ ... | true | true |
1c3885a735d8c4e6f62f1bac47fb74426f809a4d | 1,141 | py | Python | lib/systems/d-arabinose.py | pulsar-chem/BPModule | f8e64e04fdb01947708f098e833600c459c2ff0e | [
"BSD-3-Clause"
] | null | null | null | lib/systems/d-arabinose.py | pulsar-chem/BPModule | f8e64e04fdb01947708f098e833600c459c2ff0e | [
"BSD-3-Clause"
] | null | null | null | lib/systems/d-arabinose.py | pulsar-chem/BPModule | f8e64e04fdb01947708f098e833600c459c2ff0e | [
"BSD-3-Clause"
] | null | null | null | import pulsar as psr
def load_ref_system():
""" Returns d-arabinose as found in the IQMol fragment library.
All credit to https://github.com/nutjunkie/IQmol
"""
return psr.make_system("""
C 2.3481 -0.9668 0.1807
C 1.2791 0.0840 -0.2072
C -0.161... | 40.75 | 67 | 0.405784 | import pulsar as psr
def load_ref_system():
return psr.make_system("""
C 2.3481 -0.9668 0.1807
C 1.2791 0.0840 -0.2072
C -0.1614 -0.4732 0.0020
C -1.2259 0.6349 -0.2676
C -2.5511 -0.0222 -0.6508
O ... | true | true |
1c38875a7a77a091f468124bf60e54b52c488fe7 | 19,102 | py | Python | train_180215_1_Dense_6th_training.py | OsciiArt/Cookpad | b2245f84db0650d6282c97c98600de825c6ed6e0 | [
"MIT"
] | null | null | null | train_180215_1_Dense_6th_training.py | OsciiArt/Cookpad | b2245f84db0650d6282c97c98600de825c6ed6e0 | [
"MIT"
] | null | null | null | train_180215_1_Dense_6th_training.py | OsciiArt/Cookpad | b2245f84db0650d6282c97c98600de825c6ed6e0 | [
"MIT"
] | null | null | null | import numpy as np # linear algebra
np.random.seed(42)
import pandas as pd # data processing, CSV file I/O (e.g. pd.read_csv)
from sklearn.model_selection import train_test_split
from matplotlib import pyplot
import time
import os, glob
import cv2
# parameters
format = "%H%M"
ts = time.strftime(format)
base_name = os.... | 34.418018 | 166 | 0.58753 | import numpy as np np.random.seed(42)
import pandas as pd from sklearn.model_selection import train_test_split
from matplotlib import pyplot
import time
import os, glob
import cv2
format = "%H%M"
ts = time.strftime(format)
base_name = os.path.splitext(__file__)[0] + "_ts" + ts
input_size = 221
from keras.preprocessi... | true | true |
1c388762cb270cccc694c3cc35eec77a5c2a4523 | 8,129 | py | Python | opencood/loss/fpvrcnn_loss.py | YuanYunshuang/OpenCOOD | 98e07eb45f7fdcd32518b2cf8f9052f73ca80bec | [
"Apache-2.0"
] | null | null | null | opencood/loss/fpvrcnn_loss.py | YuanYunshuang/OpenCOOD | 98e07eb45f7fdcd32518b2cf8f9052f73ca80bec | [
"Apache-2.0"
] | null | null | null | opencood/loss/fpvrcnn_loss.py | YuanYunshuang/OpenCOOD | 98e07eb45f7fdcd32518b2cf8f9052f73ca80bec | [
"Apache-2.0"
] | null | null | null | import torch
from torch import nn
import numpy as np
from opencood.loss.ciassd_loss import CiassdLoss, weighted_smooth_l1_loss
class FpvrcnnLoss(nn.Module):
def __init__(self, args):
super(FpvrcnnLoss, self).__init__()
self.ciassd_loss = CiassdLoss(args['stage1'])
self.cls = args['stage2']... | 41.47449 | 111 | 0.559847 | import torch
from torch import nn
import numpy as np
from opencood.loss.ciassd_loss import CiassdLoss, weighted_smooth_l1_loss
class FpvrcnnLoss(nn.Module):
def __init__(self, args):
super(FpvrcnnLoss, self).__init__()
self.ciassd_loss = CiassdLoss(args['stage1'])
self.cls = args['stage2']... | true | true |
1c38885b0dc3ff66a8b79b9298a5f9ff6c7bc340 | 48,337 | py | Python | pythoms/mzml.py | flowerah/PythoMS | 7d500f20219157657023c8c0a930f580d3768191 | [
"MIT"
] | null | null | null | pythoms/mzml.py | flowerah/PythoMS | 7d500f20219157657023c8c0a930f580d3768191 | [
"MIT"
] | null | null | null | pythoms/mzml.py | flowerah/PythoMS | 7d500f20219157657023c8c0a930f580d3768191 | [
"MIT"
] | null | null | null | """
IGNORE:
CHANGELOG:
-
---2.7 building
to add:
try to extract timepoints and tic from chromatogramList (x values are sorted, so this probably won't work)
IGNORE
"""
import sys
import os
import zlib
import gzip
import base64
import struct
import subprocess
import xml.dom.minidom
import scipy as sci
from random im... | 45.515066 | 175 | 0.596148 | import sys
import os
import zlib
import gzip
import base64
import struct
import subprocess
import xml.dom.minidom
import scipy as sci
from random import random
from .progress import Progress
from .spectrum import Spectrum
from .psims import CVParameterSet, stringtodigit
from .tome import resolution, locate_in_list, tri... | true | true |
1c3888f0cf285a3a0076e254a6838bcd4e5d38db | 451 | py | Python | src/posts/migrations/0002_post_section.py | kelchidoo/financezone | 0b16179b6028ef061a21b5003bbaffe18db8459e | [
"MIT"
] | null | null | null | src/posts/migrations/0002_post_section.py | kelchidoo/financezone | 0b16179b6028ef061a21b5003bbaffe18db8459e | [
"MIT"
] | null | null | null | src/posts/migrations/0002_post_section.py | kelchidoo/financezone | 0b16179b6028ef061a21b5003bbaffe18db8459e | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by Django 1.11.10 on 2018-08-05 19:13
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('posts', '0001_initial'),
]
operations = [
migrations.AddField(
... | 21.47619 | 65 | 0.609756 | from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('posts', '0001_initial'),
]
operations = [
migrations.AddField(
model_name='post',
name='section',
field=models.C... | true | true |
1c388a6c6859d6e68629d021830a224fc96d1d4f | 773 | py | Python | tests/test_font_size.py | ehtec/pdfminer.six | 5b1823f25ab998e904fc5d81687732580f23e3b9 | [
"MIT"
] | null | null | null | tests/test_font_size.py | ehtec/pdfminer.six | 5b1823f25ab998e904fc5d81687732580f23e3b9 | [
"MIT"
] | 1 | 2022-01-31T22:58:07.000Z | 2022-01-31T22:58:07.000Z | tests/test_font_size.py | phantomcyber/pdfminer.six | e35a9319a6ae5d310f08f07a5edf16aadc529c1e | [
"MIT"
] | null | null | null | from helpers import absolute_sample_path
from pdfminer.high_level import extract_pages
from pdfminer.layout import LTChar, LTTextBox
def test_font_size():
path = absolute_sample_path('font-size-test.pdf')
for page in extract_pages(path):
for text_box in page:
if isinstance(text_box, LTText... | 38.65 | 67 | 0.570505 | from helpers import absolute_sample_path
from pdfminer.high_level import extract_pages
from pdfminer.layout import LTChar, LTTextBox
def test_font_size():
path = absolute_sample_path('font-size-test.pdf')
for page in extract_pages(path):
for text_box in page:
if isinstance(text_box, LTText... | true | true |
1c388b2613d1ec6add292ddb344c67ba4bb59a48 | 256 | py | Python | configs/unet/fcn_unet_s5-d16_256x256_40k_hrf.py | Xlinford/mmsegmentation | 8b444de5e6db2af2538a73a93ac75204f5c3bb2f | [
"Apache-2.0"
] | null | null | null | configs/unet/fcn_unet_s5-d16_256x256_40k_hrf.py | Xlinford/mmsegmentation | 8b444de5e6db2af2538a73a93ac75204f5c3bb2f | [
"Apache-2.0"
] | null | null | null | configs/unet/fcn_unet_s5-d16_256x256_40k_hrf.py | Xlinford/mmsegmentation | 8b444de5e6db2af2538a73a93ac75204f5c3bb2f | [
"Apache-2.0"
] | null | null | null | _base_ = [
'../_base_/models/fcn_unet_s5-d16.py', '../_base_/datasets/hrf.py',
'../_base_/default_runtime.py', '../_base_/schedules/schedule_40k.py'
]
test_cfg = dict(crop_size=(256, 256), stride=(170, 170))
evaluation = dict(metric='mDice')
| 36.571429 | 74 | 0.660156 | _base_ = [
'../_base_/models/fcn_unet_s5-d16.py', '../_base_/datasets/hrf.py',
'../_base_/default_runtime.py', '../_base_/schedules/schedule_40k.py'
]
test_cfg = dict(crop_size=(256, 256), stride=(170, 170))
evaluation = dict(metric='mDice')
| true | true |
1c388b552035a4b9b2ec413e86da8a0c41e5beb0 | 3,731 | py | Python | bw2io/extractors/exiobase.py | mfastudillo/brightway2-io | dc383ddb6003a46e78259aeb7f87b9d80965d689 | [
"BSD-3-Clause"
] | null | null | null | bw2io/extractors/exiobase.py | mfastudillo/brightway2-io | dc383ddb6003a46e78259aeb7f87b9d80965d689 | [
"BSD-3-Clause"
] | null | null | null | bw2io/extractors/exiobase.py | mfastudillo/brightway2-io | dc383ddb6003a46e78259aeb7f87b9d80965d689 | [
"BSD-3-Clause"
] | null | null | null | from pathlib import Path
from tqdm import tqdm
import csv
import os
import re
def remove_numerics(string):
"""Transform names like 'Tobacco products (16)' into 'Tobacco products'"""
return re.sub(r" \(\d\d\)$", "", string)
class Exiobase3DataExtractor(object):
@classmethod
def _check_dir(cls, path):... | 33.918182 | 88 | 0.5197 | from pathlib import Path
from tqdm import tqdm
import csv
import os
import re
def remove_numerics(string):
return re.sub(r" \(\d\d\)$", "", string)
class Exiobase3DataExtractor(object):
@classmethod
def _check_dir(cls, path):
assert os.path.isdir(path), "Must supply path to EXIOBASE data... | true | true |
1c388bae3fb6fc165c920da9ecd9a70d511f6b52 | 1,188 | py | Python | src/gui/mixins.py | dynaryu/vaws | f6ed9b75408f7ce6100ed59b7754f745e59be152 | [
"BSD-3-Clause"
] | null | null | null | src/gui/mixins.py | dynaryu/vaws | f6ed9b75408f7ce6100ed59b7754f745e59be152 | [
"BSD-3-Clause"
] | null | null | null | src/gui/mixins.py | dynaryu/vaws | f6ed9b75408f7ce6100ed59b7754f745e59be152 | [
"BSD-3-Clause"
] | null | null | null |
from PyQt4.QtCore import QVariant, QSettings
from PyQt4.QtGui import QTableWidget
class PersistSizePosMixin(object):
def __init__(self, name):
self.name = name
def initSizePosFromSettings(self):
settings = QSettings()
key = self.name + "/Geometry"
if setting... | 33 | 82 | 0.632155 |
from PyQt4.QtCore import QVariant, QSettings
from PyQt4.QtGui import QTableWidget
class PersistSizePosMixin(object):
def __init__(self, name):
self.name = name
def initSizePosFromSettings(self):
settings = QSettings()
key = self.name + "/Geometry"
if setting... | true | true |
1c388c7ef1bcb9c97ba3d2d40f8d2d79a492e919 | 20,373 | py | Python | azure-mgmt-dns/azure/mgmt/dns/v2016_04_01/operations/zones_operations.py | alexeldeib/azure-sdk-for-python | eed1e228847d90d97ca55ded98e10a915b391b61 | [
"MIT"
] | 1 | 2018-07-23T08:59:24.000Z | 2018-07-23T08:59:24.000Z | azure-mgmt-dns/azure/mgmt/dns/v2016_04_01/operations/zones_operations.py | Vinaysaibhogela/azure-sdk-for-python | 3345c2b5ed2b750024f71331a68d7a087157e9a7 | [
"MIT"
] | null | null | null | azure-mgmt-dns/azure/mgmt/dns/v2016_04_01/operations/zones_operations.py | Vinaysaibhogela/azure-sdk-for-python | 3345c2b5ed2b750024f71331a68d7a087157e9a7 | [
"MIT"
] | null | null | null | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... | 46.407745 | 169 | 0.653659 |
import uuid
from msrest.pipeline import ClientRawResponse
from msrestazure.azure_exceptions import CloudError
from msrest.polling import LROPoller, NoPolling
from msrestazure.polling.arm_polling import ARMPolling
from .. import models
class ZonesOperations(object):
models = models
def __init__(self, clien... | true | true |
1c388e1b43dc8a50c0ebf84601ad29804106cc77 | 1,171 | py | Python | sktime/utils/seasonality.py | Mo-Saif/sktime | f3c71977c113d986276fca2bdedf70faaa33f040 | [
"BSD-3-Clause"
] | 1 | 2019-09-29T07:11:33.000Z | 2019-09-29T07:11:33.000Z | sktime/utils/seasonality.py | ClaudiaSanches/sktime | 63e7839e80ca6d5fe5fc4f33389ec3bcacd8aa59 | [
"BSD-3-Clause"
] | null | null | null | sktime/utils/seasonality.py | ClaudiaSanches/sktime | 63e7839e80ca6d5fe5fc4f33389ec3bcacd8aa59 | [
"BSD-3-Clause"
] | 1 | 2019-05-08T10:42:20.000Z | 2019-05-08T10:42:20.000Z | from statsmodels.tsa.stattools import acf
import numpy as np
def seasonality_test(x, freq):
"""Seasonality test used in M4 competition
# original implementation
# def seasonality_test(original_ts, ppy):
#
# Seasonality test
# :param original_ts: time series
# :param ppy: periods per year
... | 23.42 | 76 | 0.577284 | from statsmodels.tsa.stattools import acf
import numpy as np
def seasonality_test(x, freq):
x = np.asarray(x)
crit_val = 1.645
n = len(x)
r = acf(x, nlags=freq)
s = r[1] + np.sum(r[2:] ** 2)
limit = crit_val * np.sqrt((1 + 2 * s) / n)
return np.abs(r[freq]) > limit
| true | true |
1c388eed2ac49e4f17d0ea70be50fbca14318c10 | 17,392 | py | Python | pythonforandroid/bootstrap.py | mishk/python-for-android | 1b887bed09a7ec19bfa00c9fb69a54e3f60a2328 | [
"MIT"
] | 2 | 2020-09-18T17:14:12.000Z | 2021-03-24T11:39:12.000Z | pythonforandroid/bootstrap.py | mishk/python-for-android | 1b887bed09a7ec19bfa00c9fb69a54e3f60a2328 | [
"MIT"
] | null | null | null | pythonforandroid/bootstrap.py | mishk/python-for-android | 1b887bed09a7ec19bfa00c9fb69a54e3f60a2328 | [
"MIT"
] | 1 | 2020-07-23T02:40:40.000Z | 2020-07-23T02:40:40.000Z | import functools
import glob
import importlib
import os
from os.path import (join, dirname, isdir, normpath, splitext, basename)
from os import listdir, walk, sep
import sh
import shlex
import shutil
from pythonforandroid.logger import (shprint, info, logger, debug)
from pythonforandroid.util import (
current_dire... | 39.259594 | 110 | 0.594181 | import functools
import glob
import importlib
import os
from os.path import (join, dirname, isdir, normpath, splitext, basename)
from os import listdir, walk, sep
import sh
import shlex
import shutil
from pythonforandroid.logger import (shprint, info, logger, debug)
from pythonforandroid.util import (
current_dire... | true | true |
1c388f83b0135bdf4b3681bd6fab412577e4207e | 3,528 | py | Python | testsite/settings.py | deepaksingh1/testsite | a36737f49d6264c0c38f7b8c4b96de248e8e3f41 | [
"MIT"
] | null | null | null | testsite/settings.py | deepaksingh1/testsite | a36737f49d6264c0c38f7b8c4b96de248e8e3f41 | [
"MIT"
] | null | null | null | testsite/settings.py | deepaksingh1/testsite | a36737f49d6264c0c38f7b8c4b96de248e8e3f41 | [
"MIT"
] | null | null | null | """
Django settings for testsite project.
Generated by 'django-admin startproject' using Django 3.0.1.
For more information on this file, see
https://docs.djangoproject.com/en/3.0/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/3.0/ref/settings/
"""
import os
... | 24.5 | 91 | 0.694728 |
import os
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
SECRET_KEY = '_)@s9t+_-xj-0v&-@o1u8pzv53)idi&+jym4)9@g#42-oa(5il'
DEBUG = True
ALLOWED_HOSTS = ['http://deepaks135.pythonanywhere.com']
# Application definition
INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.a... | true | true |
1c38903631724b2f4bcc64d6a35b37d5295b7e23 | 1,576 | py | Python | pandas/tests/indexes/base_class/test_indexing.py | advatar/pandas | 14b84b45d6c891fd8954ba9bb0c493cd9ec2a662 | [
"PSF-2.0",
"Apache-2.0",
"BSD-3-Clause-No-Nuclear-License-2014",
"MIT",
"ECL-2.0",
"BSD-3-Clause"
] | 1 | 2021-01-14T15:16:34.000Z | 2021-01-14T15:16:34.000Z | pandas/tests/indexes/base_class/test_indexing.py | Tian-Jionglu/pandas | 6b3618de9c5deae3bcb4c7d5dfbd35e1f9eeaf15 | [
"PSF-2.0",
"Apache-2.0",
"BSD-3-Clause-No-Nuclear-License-2014",
"MIT",
"ECL-2.0",
"BSD-3-Clause"
] | null | null | null | pandas/tests/indexes/base_class/test_indexing.py | Tian-Jionglu/pandas | 6b3618de9c5deae3bcb4c7d5dfbd35e1f9eeaf15 | [
"PSF-2.0",
"Apache-2.0",
"BSD-3-Clause-No-Nuclear-License-2014",
"MIT",
"ECL-2.0",
"BSD-3-Clause"
] | null | null | null | import numpy as np
import pytest
from pandas.compat import is_numpy_dev
from pandas import Index
import pandas._testing as tm
class TestGetSliceBounds:
@pytest.mark.parametrize("kind", ["getitem", "loc", None])
@pytest.mark.parametrize("side, expected", [("left", 4), ("right", 5)])
def test_get_slice_bo... | 39.4 | 85 | 0.673223 | import numpy as np
import pytest
from pandas.compat import is_numpy_dev
from pandas import Index
import pandas._testing as tm
class TestGetSliceBounds:
@pytest.mark.parametrize("kind", ["getitem", "loc", None])
@pytest.mark.parametrize("side, expected", [("left", 4), ("right", 5)])
def test_get_slice_bo... | true | true |
1c3893b343a7fc290d6d36d72be638b7ffade06e | 1,943 | py | Python | astropy/sphinx/ext/tests/test_automodsumm.py | xiaomi1122/astropy | 8876e902f5efa02a3fc27d82fe15c16001d4df5e | [
"BSD-3-Clause"
] | null | null | null | astropy/sphinx/ext/tests/test_automodsumm.py | xiaomi1122/astropy | 8876e902f5efa02a3fc27d82fe15c16001d4df5e | [
"BSD-3-Clause"
] | null | null | null | astropy/sphinx/ext/tests/test_automodsumm.py | xiaomi1122/astropy | 8876e902f5efa02a3fc27d82fe15c16001d4df5e | [
"BSD-3-Clause"
] | null | null | null | # Licensed under a 3-clause BSD style license - see LICENSE.rst
from ....tests.helper import pytest
pytest.importorskip('sphinx') # skips these tests if sphinx not present
class FakeEnv(object):
"""
Mocks up a sphinx env setting construct for automodapi tests
"""
def __init__(self, **kwargs):
... | 26.986111 | 75 | 0.687597 | from ....tests.helper import pytest
pytest.importorskip('sphinx')
class FakeEnv(object):
def __init__(self, **kwargs):
for k, v in kwargs.iteritems():
setattr(self, k, v)
class FakeBuilder(object):
def __init__(self, **kwargs):
self.env = FakeEnv(**kwargs)
class FakeApp(object... | true | true |
1c3894096729807804f491952c37d47fec2bd279 | 3,209 | py | Python | stock/models.py | Singosgu/Elvis_WMS | e6911b7daae76be640ece8946104af24b6cf0fa6 | [
"MIT"
] | 3 | 2020-10-19T05:55:28.000Z | 2020-11-12T03:55:06.000Z | stock/models.py | Singosgu/Django_WMS | 8cf5f5282a5619d6f488372020f95441cf89f868 | [
"MIT"
] | 1 | 2020-07-24T07:34:36.000Z | 2020-07-24T07:34:36.000Z | stock/models.py | Singosgu/Elvis_WMS | e6911b7daae76be640ece8946104af24b6cf0fa6 | [
"MIT"
] | 4 | 2020-09-04T13:35:15.000Z | 2020-10-16T15:10:38.000Z | from django.db import models
class StockListModel(models.Model):
goods_code = models.CharField(max_length=32, verbose_name="Goods Code")
goods_desc = models.CharField(max_length=255, verbose_name="Goods Description")
goods_qty = models.BigIntegerField(default=0, verbose_name="Total Qty")
onhand_stock =... | 56.298246 | 104 | 0.747897 | from django.db import models
class StockListModel(models.Model):
goods_code = models.CharField(max_length=32, verbose_name="Goods Code")
goods_desc = models.CharField(max_length=255, verbose_name="Goods Description")
goods_qty = models.BigIntegerField(default=0, verbose_name="Total Qty")
onhand_stock =... | true | true |
1c38941befd420085bd5935ca9e675d2d2bbcea6 | 7,359 | py | Python | caserec/recommenders/item_recommendation/item_attribute_knn.py | eduardofressato/CaseRecommender | 0e5675f3afdb14111b14e02a511527647b66aa66 | [
"MIT"
] | 1 | 2019-01-05T02:14:47.000Z | 2019-01-05T02:14:47.000Z | caserec/recommenders/item_recommendation/item_attribute_knn.py | guedes-joaofelipe/CaseRecommender | 5606db93f0296d0b9b5eeaba2bd48787c5ff5625 | [
"MIT"
] | null | null | null | caserec/recommenders/item_recommendation/item_attribute_knn.py | guedes-joaofelipe/CaseRecommender | 5606db93f0296d0b9b5eeaba2bd48787c5ff5625 | [
"MIT"
] | null | null | null | # coding=utf-8
""""
Item Based Collaborative Filtering Recommender with Attributes (Item Attribute KNN)
[Item Recommendation (Ranking)]
Its philosophy is as follows: in order to determine the rating of User u on item m, we can find other movies that
are similar to item m, and based on User u’s ratings ... | 45.99375 | 120 | 0.655524 |
from collections import defaultdict
import numpy as np
from caserec.recommenders.item_recommendation.itemknn import ItemKNN
from caserec.utils.process_data import ReadFile
__author__ = 'Arthur Fortes <fortes.arthur@gmail.com>'
class ItemAttributeKNN(ItemKNN):
def __init__(self, train_file=None, test_file=None... | true | true |
1c38942cb70c69cf580c8bc3fbbe42ea9fe08095 | 302 | py | Python | test/test_kind_section.py | JianxingHuang/ecint | 4c41d9d7c77ee85dd3af69aa0999d093b6a8c7a3 | [
"MIT"
] | null | null | null | test/test_kind_section.py | JianxingHuang/ecint | 4c41d9d7c77ee85dd3af69aa0999d093b6a8c7a3 | [
"MIT"
] | null | null | null | test/test_kind_section.py | JianxingHuang/ecint | 4c41d9d7c77ee85dd3af69aa0999d093b6a8c7a3 | [
"MIT"
] | 1 | 2021-04-10T08:43:02.000Z | 2021-04-10T08:43:02.000Z | from aiida.orm import StructureData
from ase.io import read
from ecint.preprocessor.kind import SetsFromYaml
structure_path = './data/h2o.xyz'
atoms = read(structure_path)
structure = StructureData(ase=atoms)
sets = SetsFromYaml(structure, None)
kind_section = sets.kind_section
print(kind_section)
| 23.230769 | 48 | 0.807947 | from aiida.orm import StructureData
from ase.io import read
from ecint.preprocessor.kind import SetsFromYaml
structure_path = './data/h2o.xyz'
atoms = read(structure_path)
structure = StructureData(ase=atoms)
sets = SetsFromYaml(structure, None)
kind_section = sets.kind_section
print(kind_section)
| true | true |
1c3895135dfb43dda73ddd7725e49c81497da474 | 13,247 | py | Python | test/unit/models/test_proposals.py | RottenCoin/sentinel | baae290dae92f393db3f884180bf1f2a47a605ce | [
"MIT"
] | null | null | null | test/unit/models/test_proposals.py | RottenCoin/sentinel | baae290dae92f393db3f884180bf1f2a47a605ce | [
"MIT"
] | null | null | null | test/unit/models/test_proposals.py | RottenCoin/sentinel | baae290dae92f393db3f884180bf1f2a47a605ce | [
"MIT"
] | null | null | null | import pytest
import sys
import os
import time
os.environ['SENTINEL_ENV'] = 'test'
os.environ['SENTINEL_CONFIG'] = os.path.normpath(os.path.join(os.path.dirname(__file__), '../../test_sentinel.conf'))
sys.path.append(os.path.normpath(os.path.join(os.path.dirname(__file__), '../../../lib')))
import misc
import config
fr... | 52.988 | 3,633 | 0.780479 | import pytest
import sys
import os
import time
os.environ['SENTINEL_ENV'] = 'test'
os.environ['SENTINEL_CONFIG'] = os.path.normpath(os.path.join(os.path.dirname(__file__), '../../test_sentinel.conf'))
sys.path.append(os.path.normpath(os.path.join(os.path.dirname(__file__), '../../../lib')))
import misc
import config
fr... | true | true |
1c389685ff52c912f2612efea656ffd0b097758d | 7,565 | py | Python | model/deeplab.py | Shang-XH/BAFTT | 62392325342f48b8a89f0c2bf71e48026dd90629 | [
"MIT"
] | 4 | 2021-09-07T03:29:38.000Z | 2021-09-07T04:24:31.000Z | model/deeplab.py | Shang-XH/BAFTT | 62392325342f48b8a89f0c2bf71e48026dd90629 | [
"MIT"
] | null | null | null | model/deeplab.py | Shang-XH/BAFTT | 62392325342f48b8a89f0c2bf71e48026dd90629 | [
"MIT"
] | null | null | null | import torch.nn as nn
import math
import torch.utils.model_zoo as model_zoo
import torch
import numpy as np
affine_par = True
def outS(i):
i = int(i)
i = (i+1)/2
i = int(np.ceil((i+1)/2.0))
i = (i+1)/2
return i
def conv3x3(in_planes, out_planes, stride=1):
"3x3 convolution with padding"
r... | 33.325991 | 139 | 0.590482 | import torch.nn as nn
import math
import torch.utils.model_zoo as model_zoo
import torch
import numpy as np
affine_par = True
def outS(i):
i = int(i)
i = (i+1)/2
i = int(np.ceil((i+1)/2.0))
i = (i+1)/2
return i
def conv3x3(in_planes, out_planes, stride=1):
return nn.Conv2d(in_planes, out_plan... | true | true |
1c38968752d7f0fcd0cd4b1a3ffa0328cb1afaf8 | 1,374 | py | Python | poolink_backend/bases/models.py | jaethewiederholen/Poolink_backend | 3a1b28856bc8916aedb7735de8b64fef3269ef1b | [
"MIT"
] | null | null | null | poolink_backend/bases/models.py | jaethewiederholen/Poolink_backend | 3a1b28856bc8916aedb7735de8b64fef3269ef1b | [
"MIT"
] | null | null | null | poolink_backend/bases/models.py | jaethewiederholen/Poolink_backend | 3a1b28856bc8916aedb7735de8b64fef3269ef1b | [
"MIT"
] | null | null | null | import timeago
from annoying.fields import AutoOneToOneField as _AutoOneToOneField
from django.db import models
from django.utils import timezone
from django.utils.translation import ugettext_lazy as _
from model_utils.models import TimeStampedModel
class AutoOneToOneField(_AutoOneToOneField):
pass
class Manage... | 26.941176 | 82 | 0.69869 | import timeago
from annoying.fields import AutoOneToOneField as _AutoOneToOneField
from django.db import models
from django.utils import timezone
from django.utils.translation import ugettext_lazy as _
from model_utils.models import TimeStampedModel
class AutoOneToOneField(_AutoOneToOneField):
pass
class Manage... | true | true |
1c389742a4897a973a09502694d1595d5bc5011e | 1,727 | py | Python | pyobjc_framework_Quartz-3.3a0-py3.6-macosx-10.13-x86_64.egg/Quartz/__init__.py | EnjoyLifeFund/macHighSierra-py36-pkgs | 5668b5785296b314ea1321057420bcd077dba9ea | [
"BSD-3-Clause",
"BSD-2-Clause",
"MIT"
] | 4 | 2019-03-11T18:05:49.000Z | 2021-05-22T21:09:09.000Z | pyobjc_framework_Quartz-3.3a0-py3.6-macosx-10.13-x86_64.egg/Quartz/__init__.py | EnjoyLifeFund/macHighSierra-py36-pkgs | 5668b5785296b314ea1321057420bcd077dba9ea | [
"BSD-3-Clause",
"BSD-2-Clause",
"MIT"
] | null | null | null | pyobjc_framework_Quartz-3.3a0-py3.6-macosx-10.13-x86_64.egg/Quartz/__init__.py | EnjoyLifeFund/macHighSierra-py36-pkgs | 5668b5785296b314ea1321057420bcd077dba9ea | [
"BSD-3-Clause",
"BSD-2-Clause",
"MIT"
] | 1 | 2019-03-18T18:53:36.000Z | 2019-03-18T18:53:36.000Z | """
Helper module that makes it easier to import all of Quartz
"""
import sys
import objc
import Foundation
import AppKit
def _load():
submods = []
sys.modules['Quartz'] = mod = objc.ObjCLazyModule('Quartz',
None, None, {}, None, {
'__doc__': __doc__,
'objc': objc,
... | 20.559524 | 64 | 0.557035 | import sys
import objc
import Foundation
import AppKit
def _load():
submods = []
sys.modules['Quartz'] = mod = objc.ObjCLazyModule('Quartz',
None, None, {}, None, {
'__doc__': __doc__,
'objc': objc,
'__path__': __path__,
'__loader__': ... | true | true |
1c38977b569e372892bc6e1bb21a826b7739d05d | 2,373 | py | Python | example/custom_log_format.py | hoangvx/json-logging-python | 6c43871fce2659de88827a1f8b690be80e55c328 | [
"Apache-2.0"
] | null | null | null | example/custom_log_format.py | hoangvx/json-logging-python | 6c43871fce2659de88827a1f8b690be80e55c328 | [
"Apache-2.0"
] | null | null | null | example/custom_log_format.py | hoangvx/json-logging-python | 6c43871fce2659de88827a1f8b690be80e55c328 | [
"Apache-2.0"
] | null | null | null | # This example shows how the logger can be set up to use a custom JSON format.
import logging
import json
import traceback
from datetime import datetime
import copy
import json_logging
import sys
json_logging.ENABLE_JSON_LOGGING = True
def extra(**kw):
'''Add the required nested props layer'''
return {'extra... | 31.64 | 87 | 0.653182 | import logging
import json
import traceback
from datetime import datetime
import copy
import json_logging
import sys
json_logging.ENABLE_JSON_LOGGING = True
def extra(**kw):
return {'extra': {'props': kw}}
class CustomJSONLog(logging.Formatter):
python_log_prefix = 'python.'
def get_exc_fields(self, re... | true | true |
1c389798083410ad4a61a2080241e05412c16cb9 | 6,038 | py | Python | hubspot/crm/quotes/api/search_api.py | Ronfer/hubspot-api-python | 1c87274ecbba4aa3c7728f890ccc6e77b2b6d2e4 | [
"Apache-2.0"
] | 117 | 2020-04-06T08:22:53.000Z | 2022-03-18T03:41:29.000Z | hubspot/crm/quotes/api/search_api.py | Ronfer/hubspot-api-python | 1c87274ecbba4aa3c7728f890ccc6e77b2b6d2e4 | [
"Apache-2.0"
] | 62 | 2020-04-06T16:21:06.000Z | 2022-03-17T16:50:44.000Z | hubspot/crm/quotes/api/search_api.py | Ronfer/hubspot-api-python | 1c87274ecbba4aa3c7728f890ccc6e77b2b6d2e4 | [
"Apache-2.0"
] | 45 | 2020-04-06T16:13:52.000Z | 2022-03-30T21:33:17.000Z | # coding: utf-8
"""
Quotes
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501
The version of the OpenAPI document: v3
Generated by: https://openapi-generator.tech
"""
from __future__ import absolute_import
import re # noqa: F40... | 43.753623 | 199 | 0.649884 |
from __future__ import absolute_import
import re
import six
from hubspot.crm.quotes.api_client import ApiClient
from hubspot.crm.quotes.exceptions import ApiTypeError, ApiValueError
class SearchApi(object):
def __init__(self, api_client=None):
if api_client is None:
api_client = ApiCl... | true | true |
1c3897f1c9439d5c963e8334e6f36bff19799a70 | 2,234 | py | Python | alpafa/cli.py | timothybazalgette/alpafa | b11486719ff9b411ca4a405685302ab3f1155702 | [
"MIT"
] | 3 | 2017-07-14T15:10:34.000Z | 2018-10-01T03:28:15.000Z | alpafa/cli.py | timothybazalgette/alpafa | b11486719ff9b411ca4a405685302ab3f1155702 | [
"MIT"
] | null | null | null | alpafa/cli.py | timothybazalgette/alpafa | b11486719ff9b411ca4a405685302ab3f1155702 | [
"MIT"
] | null | null | null | '''Defines the command line interface for ALPALFA.'''
import argparse
from .alpafa import Lexicon
from .parse import parse_file, ParserError
def set_args():
'''Sets command line parameters, and runs ALPAFA.'''
parser = argparse.ArgumentParser(prog='alpafa',
description='A... | 40.618182 | 100 | 0.628021 |
import argparse
from .alpafa import Lexicon
from .parse import parse_file, ParserError
def set_args():
parser = argparse.ArgumentParser(prog='alpafa',
description='Applies the algorithm from AAFP to a correctly \
formatted input file.')
... | true | true |
1c38982d038dc6812349ad9b132b32e7a77b8f6d | 216 | py | Python | backend/utils/basefilters.py | zerlee/open-cmdb | e05eeab70bf2c2e14603597bf99c45b6c3330d1e | [
"BSD-3-Clause"
] | 126 | 2019-09-17T17:49:35.000Z | 2022-03-31T13:34:35.000Z | backend/utils/basefilters.py | tom2jack/open-cmdb | 68bc028d5d6162dbfa724d7bbf17363f65e44557 | [
"BSD-3-Clause"
] | 5 | 2020-01-19T08:43:38.000Z | 2021-06-10T21:58:30.000Z | backend/utils/basefilters.py | tom2jack/open-cmdb | 68bc028d5d6162dbfa724d7bbf17363f65e44557 | [
"BSD-3-Clause"
] | 52 | 2019-09-20T06:10:32.000Z | 2022-03-31T13:34:28.000Z | # -*- coding: utf-8 -*-
import django_filters
class BaseFilter(django_filters.FilterSet):
sort = django_filters.OrderingFilter(fields=('create_time',))
class Meta:
model = None
fields = {}
| 19.636364 | 65 | 0.652778 | import django_filters
class BaseFilter(django_filters.FilterSet):
sort = django_filters.OrderingFilter(fields=('create_time',))
class Meta:
model = None
fields = {}
| true | true |
1c389af6bf03ce9aac0253b5095c78e8a33575ef | 1,676 | py | Python | out/pulp/pulp_python/.github_workflows_scripts_stage-changelog-for-master.py | heyjoakim/munaiah-analyser | d76056cecd3b7f4a6cd72d7fd526cea18aa671d6 | [
"MIT"
] | 1 | 2022-01-03T17:47:20.000Z | 2022-01-03T17:47:20.000Z | out/pulp/pulp_python/.github_workflows_scripts_stage-changelog-for-master.py | heyjoakim/munaiah-analyser | d76056cecd3b7f4a6cd72d7fd526cea18aa671d6 | [
"MIT"
] | null | null | null | out/pulp/pulp_python/.github_workflows_scripts_stage-changelog-for-master.py | heyjoakim/munaiah-analyser | d76056cecd3b7f4a6cd72d7fd526cea18aa671d6 | [
"MIT"
] | 1 | 2021-12-22T13:59:34.000Z | 2021-12-22T13:59:34.000Z | # WARNING: DO NOT EDIT!
#
# This file was generated by plugin_template, and is managed by it. Please use
# './plugin-template --github pulp_python' to update this file.
#
# For more info visit https://github.com/pulp/plugin_template
import argparse
import os
import textwrap
from git import Repo
from git.exc import Gi... | 25.784615 | 99 | 0.727924 |
import argparse
import os
import textwrap
from git import Repo
from git.exc import GitCommandError
helper = textwrap.dedent(
"""\
Stage the changelog for a release on master branch.
Example:
$ python .github/workflows/scripts/stage-changelog-for-master.py 3.4.0
"""
)
parser = ... | true | true |
1c389b6847ff9e816da0201b051797f00f747eee | 3,547 | py | Python | config.py | 0xN1nja/Instagram-DM-Bot | 70ec33c3e64635bc5f9c20b841a6c6fe8bdb66b3 | [
"MIT"
] | 1 | 2022-02-12T12:00:41.000Z | 2022-02-12T12:00:41.000Z | config.py | N1nja0p/Instagram-DM-Bot | 70ec33c3e64635bc5f9c20b841a6c6fe8bdb66b3 | [
"MIT"
] | null | null | null | config.py | N1nja0p/Instagram-DM-Bot | 70ec33c3e64635bc5f9c20b841a6c6fe8bdb66b3 | [
"MIT"
] | null | null | null | # Run This Script Before Running bot.py
import getpass
import re
import os
# Constants
WELCOME_MESSAGE = '''
###
# # # #### ##### ## #### ##### ## # #
# ## # # # # # # # # # # # ## ##
# # # # #### # # # # # # # ... | 28.837398 | 118 | 0.540175 | import getpass
import re
import os
WELCOME_MESSAGE = '''
###
# # # #### ##### ## #### ##### ## # #
# ## # # # # # # # # # # # ## ##
# # # # #### # # # # # # # # # ## #
# # # # # # ###### ... | true | true |
1c389b74884a98f17aa63cfe4af08f81c6037768 | 11,506 | py | Python | pysteps/utils/transformation.py | tjniemi/pysteps | 76324d8f315f63c6723887f4c99d155749a31e83 | [
"BSD-3-Clause"
] | 285 | 2018-07-11T10:42:43.000Z | 2022-03-23T13:44:54.000Z | pysteps/utils/transformation.py | tjniemi/pysteps | 76324d8f315f63c6723887f4c99d155749a31e83 | [
"BSD-3-Clause"
] | 246 | 2018-07-16T06:17:12.000Z | 2022-03-22T15:45:08.000Z | pysteps/utils/transformation.py | tjniemi/pysteps | 76324d8f315f63c6723887f4c99d155749a31e83 | [
"BSD-3-Clause"
] | 97 | 2018-07-12T12:05:45.000Z | 2022-03-31T14:56:31.000Z | # -*- coding: utf-8 -*-
"""
pysteps.utils.transformation
============================
Methods for transforming data values.
.. autosummary::
:toctree: ../generated/
boxcox_transform
dB_transform
NQ_transform
sqrt_transform
"""
import numpy as np
import scipy.stats as scipy_stats... | 30.120419 | 89 | 0.578046 |
import numpy as np
import scipy.stats as scipy_stats
import warnings
from scipy.interpolate import interp1d
warnings.filterwarnings(
"ignore", category=RuntimeWarning
)
def boxcox_transform(
R, metadata=None, Lambda=None, threshold=None, zerovalue=None, inverse=False
):
R = R.copy()
... | true | true |
1c389cdc023786c1791a1386642881a485285220 | 4,197 | py | Python | SegNet_Mobile/train.py | Ice833/Semantic-Segmentation | 23d23f6da3b34884c044a2253d65a1e4097adb2d | [
"MIT"
] | 1 | 2020-12-16T08:29:13.000Z | 2020-12-16T08:29:13.000Z | SegNet_Mobile/train.py | Ice833/Semantic-Segmentation | 23d23f6da3b34884c044a2253d65a1e4097adb2d | [
"MIT"
] | null | null | null | SegNet_Mobile/train.py | Ice833/Semantic-Segmentation | 23d23f6da3b34884c044a2253d65a1e4097adb2d | [
"MIT"
] | null | null | null | from nets.segnet import mobilenet_segnet
from keras.optimizers import Adam
from keras.callbacks import TensorBoard, ModelCheckpoint, ReduceLROnPlateau, EarlyStopping
from PIL import Image
import keras
from keras import backend as K
import numpy as np
NCLASSES = 2
HEIGHT = 416
WIDTH = 416
def generate_arra... | 35.268908 | 112 | 0.533715 | from nets.segnet import mobilenet_segnet
from keras.optimizers import Adam
from keras.callbacks import TensorBoard, ModelCheckpoint, ReduceLROnPlateau, EarlyStopping
from PIL import Image
import keras
from keras import backend as K
import numpy as np
NCLASSES = 2
HEIGHT = 416
WIDTH = 416
def generate_arra... | true | true |
1c389df546c6534fdb305322dbcd914463587192 | 772 | py | Python | Module01/String/StringOp.py | fenglihanxiao/Python | 872baf3a3a5ee42740161152605ca2b1ddf4cd30 | [
"MIT"
] | null | null | null | Module01/String/StringOp.py | fenglihanxiao/Python | 872baf3a3a5ee42740161152605ca2b1ddf4cd30 | [
"MIT"
] | null | null | null | Module01/String/StringOp.py | fenglihanxiao/Python | 872baf3a3a5ee42740161152605ca2b1ddf4cd30 | [
"MIT"
] | null | null | null | """
1. String basic operations
2. Reference StringAPI.png
"""
str1 = "i have a family where have three amy people."
print(len(str1))
print(str1[5])
print(max(str1))
print(str1.index("amy"))
print("have" in str1)
print("feng" not in str1)
print(str1.islower())
"""
1. String operation isXXX method
2. Re... | 19.3 | 53 | 0.648964 |
str1 = "i have a family where have three amy people."
print(len(str1))
print(str1[5])
print(max(str1))
print(str1.index("amy"))
print("have" in str1)
print("feng" not in str1)
print(str1.islower())
str2 = "aaa"
print(str2.islower())
str3 = "Feng"
print(str3.startswith("Fe"))
files = []
filename = "test.jpg"
filenam... | true | true |
1c389dfcf00846c922740280931a38638ee8ddc2 | 67,237 | py | Python | stm32ral.py | adamgreig/stm32ral | d316aaad753fd427b1d9fe641ca9611f5f20053c | [
"Apache-2.0",
"MIT"
] | 24 | 2019-02-20T19:01:43.000Z | 2021-09-30T13:45:01.000Z | stm32ral.py | adamgreig/stm32ral | d316aaad753fd427b1d9fe641ca9611f5f20053c | [
"Apache-2.0",
"MIT"
] | 10 | 2019-02-27T22:41:42.000Z | 2021-02-27T11:38:20.000Z | stm32ral.py | adamgreig/stm32ral | d316aaad753fd427b1d9fe641ca9611f5f20053c | [
"Apache-2.0",
"MIT"
] | 4 | 2019-04-20T08:36:46.000Z | 2020-03-23T12:56:39.000Z | #!/usr/bin/env python3
"""
stm32ral.py
Copyright 2018 Adam Greig
Licensed under MIT and Apache 2.0, see LICENSE_MIT and LICENSE_APACHE.
"""
import os
import copy
import argparse
import itertools
import subprocess
import multiprocessing
import xml.etree.ElementTree as ET
from fnmatch import fnmatch
CRATE_LIB_PREAMBLE... | 35.5 | 93 | 0.560435 |
import os
import copy
import argparse
import itertools
import subprocess
import multiprocessing
import xml.etree.ElementTree as ET
from fnmatch import fnmatch
CRATE_LIB_PREAMBLE = """\
// Copyright 2018 Adam Greig
// See LICENSE-APACHE and LICENSE-MIT for license details.
//! This project provides a register access... | true | true |
1c389e6e09a465c0e3c1d8b9b5019040cd95e042 | 2,539 | py | Python | setup.py | cryptbytestech/pypassvault | fd9ab73b5bd9bfcb7f3941fa3b82dc3000b40d68 | [
"MIT"
] | 1 | 2018-09-22T22:13:01.000Z | 2018-09-22T22:13:01.000Z | setup.py | cryptbytestech/pypassvault | fd9ab73b5bd9bfcb7f3941fa3b82dc3000b40d68 | [
"MIT"
] | null | null | null | setup.py | cryptbytestech/pypassvault | fd9ab73b5bd9bfcb7f3941fa3b82dc3000b40d68 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Setup for pypassvault project
from setuptools import setup, find_packages
with open('README.md') as f:
readme = f.read()
with open('LICENSE.txt') as f:
license = f.read()
setup(
name='pypassvault',
version='0.1.4',
description='A simple commandline password vault writ... | 31.345679 | 79 | 0.639622 |
from setuptools import setup, find_packages
with open('README.md') as f:
readme = f.read()
with open('LICENSE.txt') as f:
license = f.read()
setup(
name='pypassvault',
version='0.1.4',
description='A simple commandline password vault written in python.',
long_description=readme,
long_d... | true | true |
1c38a0219266bb2a7ae22ff441e9711b2c97abde | 6,087 | py | Python | homework/hw03/construct_check.py | QinJiaHao1994/cs61a-sp20-solutions | 71a481bef5ce73a4c6ff746455ccc51dc65453ea | [
"MIT"
] | 8 | 2020-07-28T11:10:49.000Z | 2021-05-29T15:27:17.000Z | homework/hw02/construct_check.py | QinJiaHao1994/cs61a-sp20-solutions | 71a481bef5ce73a4c6ff746455ccc51dc65453ea | [
"MIT"
] | null | null | null | homework/hw02/construct_check.py | QinJiaHao1994/cs61a-sp20-solutions | 71a481bef5ce73a4c6ff746455ccc51dc65453ea | [
"MIT"
] | 1 | 2020-10-23T08:15:08.000Z | 2020-10-23T08:15:08.000Z | from ast import parse, NodeVisitor, Name
_NAMES = {
'Add': '+',
'And': 'and',
'Assert': 'assert',
'Assign': '=',
'AugAssign': 'op=',
'BitAnd': '&',
'BitOr': '|',
'BitXor': '^',
'Break': 'break',
'Recursion': 'recursive call',
'ClassDef': 'class',
'Continue': 'continue',
... | 34.196629 | 79 | 0.580746 | from ast import parse, NodeVisitor, Name
_NAMES = {
'Add': '+',
'And': 'and',
'Assert': 'assert',
'Assign': '=',
'AugAssign': 'op=',
'BitAnd': '&',
'BitOr': '|',
'BitXor': '^',
'Break': 'break',
'Recursion': 'recursive call',
'ClassDef': 'class',
'Continue': 'continue',
... | true | true |
1c38a07f1d438c871dd93a7df76d133bbf3990f8 | 72 | py | Python | plugins/jira/komand_jira/actions/assign_issue/__init__.py | lukaszlaszuk/insightconnect-plugins | 8c6ce323bfbb12c55f8b5a9c08975d25eb9f8892 | [
"MIT"
] | 46 | 2019-06-05T20:47:58.000Z | 2022-03-29T10:18:01.000Z | plugins/jira/komand_jira/actions/assign_issue/__init__.py | lukaszlaszuk/insightconnect-plugins | 8c6ce323bfbb12c55f8b5a9c08975d25eb9f8892 | [
"MIT"
] | 386 | 2019-06-07T20:20:39.000Z | 2022-03-30T17:35:01.000Z | plugins/jira/komand_jira/actions/assign_issue/__init__.py | lukaszlaszuk/insightconnect-plugins | 8c6ce323bfbb12c55f8b5a9c08975d25eb9f8892 | [
"MIT"
] | 43 | 2019-07-09T14:13:58.000Z | 2022-03-28T12:04:46.000Z | # GENERATED BY KOMAND SDK - DO NOT EDIT
from .action import AssignIssue
| 24 | 39 | 0.777778 | from .action import AssignIssue
| true | true |
1c38a1c55c3ead54b40a989169a6a4eabd456b52 | 806 | py | Python | nnuncert/app/uci/_naming.py | pjoachims/nnuncert | 45dede54fdb714926926d719be2c9b9b542b2601 | [
"MIT"
] | 2 | 2021-12-30T06:25:43.000Z | 2022-01-25T00:41:22.000Z | nnuncert/app/uci/_naming.py | pjoachims/nnuncert | 45dede54fdb714926926d719be2c9b9b542b2601 | [
"MIT"
] | 1 | 2022-01-25T00:35:28.000Z | 2022-03-28T15:23:16.000Z | nnuncert/app/uci/_naming.py | pjoachims/nnuncert | 45dede54fdb714926926d719be2c9b9b542b2601 | [
"MIT"
] | null | null | null | def type2name(model) -> str:
"""Get name of model."""
if isinstance(model, DNNCModel):
modelstr = "DNNC"
if hasattr(model, "dnnc"):
suffix = {"ridge": "-R",
"horseshoe": "-HS",}[model.dnnc.dnnc_type]
modelstr = modelstr + suffix
return models... | 31 | 64 | 0.573201 | def type2name(model) -> str:
if isinstance(model, DNNCModel):
modelstr = "DNNC"
if hasattr(model, "dnnc"):
suffix = {"ridge": "-R",
"horseshoe": "-HS",}[model.dnnc.dnnc_type]
modelstr = modelstr + suffix
return modelstr
elif isinstance(model,... | true | true |
1c38a25e8b17d5f873d08cc1d1a8173064984d5e | 456 | py | Python | provisioner/migrations/0003_subscription_in_process.py | uw-it-aca/msca-provisioner | 6edc5468da21bad0172787ca8fdab1d93d9d0127 | [
"Apache-2.0"
] | 1 | 2018-09-07T14:43:40.000Z | 2018-09-07T14:43:40.000Z | provisioner/migrations/0003_subscription_in_process.py | uw-it-aca/msca-provisioner | 6edc5468da21bad0172787ca8fdab1d93d9d0127 | [
"Apache-2.0"
] | null | null | null | provisioner/migrations/0003_subscription_in_process.py | uw-it-aca/msca-provisioner | 6edc5468da21bad0172787ca8fdab1d93d9d0127 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by Django 1.9.5 on 2016-05-13 21:31
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('provisioner', '0002_auto_20160504_2102'),
]
operations = [
migrations.AddFie... | 21.714286 | 51 | 0.622807 | from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('provisioner', '0002_auto_20160504_2102'),
]
operations = [
migrations.AddField(
model_name='subscription',
name='in_process'... | true | true |
1c38a2f6663c6d6e6a23b12415a725623b04db53 | 6,720 | py | Python | pangtreebuild/tests/tests_affinity_tree/tests_affinity.py | meoke/PangTreeBuild | 7cafb76df32c559a76ed1d269699dc0e52313312 | [
"MIT"
] | 2 | 2019-09-04T20:01:28.000Z | 2019-12-23T22:41:57.000Z | pangtreebuild/tests/tests_affinity_tree/tests_affinity.py | meoke/PangTreeBuild | 7cafb76df32c559a76ed1d269699dc0e52313312 | [
"MIT"
] | 2 | 2019-08-10T16:18:01.000Z | 2019-10-28T21:40:23.000Z | pangtreebuild/tests/tests_affinity_tree/tests_affinity.py | meoke/PangTreeBuild | 7cafb76df32c559a76ed1d269699dc0e52313312 | [
"MIT"
] | 2 | 2020-04-23T23:57:52.000Z | 2020-07-12T17:09:02.000Z | import unittest
from typing import List
from ddt import unpack, data, ddt
from pangtreebuild.affinity_tree import builders as at_builders
from pangtreebuild.affinity_tree import parameters as at_params
from pangtreebuild.pangenome import graph
from pangtreebuild.pangenome.parameters import msa
def sid(x): return m... | 45.405405 | 103 | 0.529464 | import unittest
from typing import List
from ddt import unpack, data, ddt
from pangtreebuild.affinity_tree import builders as at_builders
from pangtreebuild.affinity_tree import parameters as at_params
from pangtreebuild.pangenome import graph
from pangtreebuild.pangenome.parameters import msa
def sid(x): return m... | true | true |
1c38a55c25a9e9c64f3f209e10c39739dc9d7a92 | 1,784 | py | Python | tests/test_roles.py | kugiyasan/discordBot | 647fbcaa8686e99774eddeb57359730196a4f65f | [
"MIT"
] | 3 | 2020-07-05T21:37:07.000Z | 2021-09-21T11:11:45.000Z | tests/test_roles.py | kugiyasan/discordBot | 647fbcaa8686e99774eddeb57359730196a4f65f | [
"MIT"
] | null | null | null | tests/test_roles.py | kugiyasan/discordBot | 647fbcaa8686e99774eddeb57359730196a4f65f | [
"MIT"
] | null | null | null | import discord
from discord.ext import commands
import discord.ext.test as dpytest
import pytest
from typing import List
# TODO addrole, delrole, manageaddrole, managedelrole
# addrole:
# when len(roles) == 0
# when len(roles) == 1
# when len(roles) > 10
class State:
http = None
async def create_random_r... | 27.030303 | 80 | 0.662556 | import discord
from discord.ext import commands
import discord.ext.test as dpytest
import pytest
from typing import List
class State:
http = None
async def create_random_roles(guild: discord.Guild) -> List[discord.Role]:
names = (
"Red",
"Green",
"Blue",
"Orange",
"Y... | true | true |
1c38a57d15a68d2a9775967e932551dadd920d4f | 3,389 | py | Python | interlayer.py | AlExKrYt/Polyglot | 509a53ade5da7af07b1c33514cbd219c0b672fd5 | [
"MIT"
] | null | null | null | interlayer.py | AlExKrYt/Polyglot | 509a53ade5da7af07b1c33514cbd219c0b672fd5 | [
"MIT"
] | null | null | null | interlayer.py | AlExKrYt/Polyglot | 509a53ade5da7af07b1c33514cbd219c0b672fd5 | [
"MIT"
] | null | null | null | import json
import os
import sys
import traceback
from google.cloud import translate
import logger
json_key = ""
project_name = ""
translator: translate.TranslationServiceClient
lang_list = {}
class BadTrgLangException(Exception):
pass
class TooManyRequestException(Exception):
pass
class EqualLangsExce... | 28.965812 | 116 | 0.663913 | import json
import os
import sys
import traceback
from google.cloud import translate
import logger
json_key = ""
project_name = ""
translator: translate.TranslationServiceClient
lang_list = {}
class BadTrgLangException(Exception):
pass
class TooManyRequestException(Exception):
pass
class EqualLangsExce... | true | true |
1c38a5a2d01b93136809060cd6c7c78965f8875f | 427 | py | Python | vertica_python/vertica/messages/backend_messages/ready_for_query.py | jbfavre/vertica-python | c53ffc49a971e9a806679f95e8680847120f49e4 | [
"MIT"
] | 1 | 2016-10-01T20:28:31.000Z | 2016-10-01T20:28:31.000Z | vertica_python/vertica/messages/backend_messages/ready_for_query.py | jbfavre/vertica-python | c53ffc49a971e9a806679f95e8680847120f49e4 | [
"MIT"
] | null | null | null | vertica_python/vertica/messages/backend_messages/ready_for_query.py | jbfavre/vertica-python | c53ffc49a971e9a806679f95e8680847120f49e4 | [
"MIT"
] | null | null | null | from __future__ import absolute_import
from struct import unpack
from vertica_python.vertica.messages.message import BackendMessage
class ReadyForQuery(BackendMessage):
STATUSES = {
'I': 'no_transaction',
'T': 'in_transaction',
'E': 'failed_transaction'
}
def __init__(self, dat... | 20.333333 | 69 | 0.693208 | from __future__ import absolute_import
from struct import unpack
from vertica_python.vertica.messages.message import BackendMessage
class ReadyForQuery(BackendMessage):
STATUSES = {
'I': 'no_transaction',
'T': 'in_transaction',
'E': 'failed_transaction'
}
def __init__(self, dat... | true | true |
1c38a5f6bb31cfbfd3f0862ca82857e16497d1f9 | 795 | py | Python | app/core/admin.py | abidahmadq/recipe-app-api | 29bd29ade5bea6107745a8d620db6ce7a76bfc65 | [
"MIT"
] | null | null | null | app/core/admin.py | abidahmadq/recipe-app-api | 29bd29ade5bea6107745a8d620db6ce7a76bfc65 | [
"MIT"
] | null | null | null | app/core/admin.py | abidahmadq/recipe-app-api | 29bd29ade5bea6107745a8d620db6ce7a76bfc65 | [
"MIT"
] | null | null | null | from django.contrib import admin
from django.contrib.auth.admin import UserAdmin as BaseUserAdmin
from core import models
from django.utils.translation import gettext as _
# Register your models here.
class UserAdmin(BaseUserAdmin):
ordering = ['id']
list_display = ['email', 'name']
fieldsets = (
(... | 29.444444 | 65 | 0.568553 | from django.contrib import admin
from django.contrib.auth.admin import UserAdmin as BaseUserAdmin
from core import models
from django.utils.translation import gettext as _
class UserAdmin(BaseUserAdmin):
ordering = ['id']
list_display = ['email', 'name']
fieldsets = (
(None, {'fields': ('email', 'p... | true | true |
1c38a65740967a1e49c94a99e84549d3470de0b7 | 493 | py | Python | TwoPointers/Leetcode11.py | Rylie-W/LeetRecord | 623c4efe88b3af54b8a65f6ec23db850b8c6f46f | [
"Apache-2.0"
] | null | null | null | TwoPointers/Leetcode11.py | Rylie-W/LeetRecord | 623c4efe88b3af54b8a65f6ec23db850b8c6f46f | [
"Apache-2.0"
] | null | null | null | TwoPointers/Leetcode11.py | Rylie-W/LeetRecord | 623c4efe88b3af54b8a65f6ec23db850b8c6f46f | [
"Apache-2.0"
] | null | null | null | class Solution:
def maxArea(self, height) -> int:
left=0
right=len(height)-1
res=min(height[left],height[right])*(right-left)
while right>left:
res=max(res,(right-left)*min(height[right],height[left]))
if height[left]<height[right]:
left+=1
... | 25.947368 | 69 | 0.543611 | class Solution:
def maxArea(self, height) -> int:
left=0
right=len(height)-1
res=min(height[left],height[right])*(right-left)
while right>left:
res=max(res,(right-left)*min(height[right],height[left]))
if height[left]<height[right]:
left+=1
... | true | true |
1c38a73b8b293aebd84332a4186df1a089905b21 | 10,956 | py | Python | old_py2/controllers/ajax_controller.py | guineawheek/ftc-data-take-2 | 337bff2077eadb3bd6bbebd153cbb6181c99516f | [
"MIT"
] | 266 | 2015-01-04T00:10:48.000Z | 2022-03-28T18:42:05.000Z | old_py2/controllers/ajax_controller.py | guineawheek/ftc-data-take-2 | 337bff2077eadb3bd6bbebd153cbb6181c99516f | [
"MIT"
] | 2,673 | 2015-01-01T20:14:33.000Z | 2022-03-31T18:17:16.000Z | old_py2/controllers/ajax_controller.py | guineawheek/ftc-data-take-2 | 337bff2077eadb3bd6bbebd153cbb6181c99516f | [
"MIT"
] | 230 | 2015-01-04T00:10:48.000Z | 2022-03-26T18:12:04.000Z | import logging
import os
import json
import time
import datetime
from base_controller import CacheableHandler, LoggedInHandler
from consts.client_type import ClientType
from consts.playoff_type import PlayoffType
from google.appengine.api import memcache
from google.appengine.api import urlfetch
from google.appengine... | 33.710769 | 124 | 0.643574 | import logging
import os
import json
import time
import datetime
from base_controller import CacheableHandler, LoggedInHandler
from consts.client_type import ClientType
from consts.playoff_type import PlayoffType
from google.appengine.api import memcache
from google.appengine.api import urlfetch
from google.appengine... | true | true |
1c38a7ddaaefad4ecbb5c078dc05360fb3aca639 | 3,004 | py | Python | protoc_oneof_listing_plugin.py | sunaga-lab/protobuf-oneof-listing-plugin | ccb926c39130435182e6f0593d7fe26edd28bbb1 | [
"MIT"
] | null | null | null | protoc_oneof_listing_plugin.py | sunaga-lab/protobuf-oneof-listing-plugin | ccb926c39130435182e6f0593d7fe26edd28bbb1 | [
"MIT"
] | null | null | null | protoc_oneof_listing_plugin.py | sunaga-lab/protobuf-oneof-listing-plugin | ccb926c39130435182e6f0593d7fe26edd28bbb1 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
import sys, os, os.path
from google.protobuf.compiler import plugin_pb2 as plugin
import itertools
from jinja2 import Environment, FileSystemLoader
import inflection
import glob
TEMPLATE_DIR_PARAM_KEY = "templates"
DEFAULT_TEMPLATES_PATH = "templates/*"
class OneofCase:
def __init__(self, p... | 32.652174 | 117 | 0.675433 |
import sys, os, os.path
from google.protobuf.compiler import plugin_pb2 as plugin
import itertools
from jinja2 import Environment, FileSystemLoader
import inflection
import glob
TEMPLATE_DIR_PARAM_KEY = "templates"
DEFAULT_TEMPLATES_PATH = "templates/*"
class OneofCase:
def __init__(self, package, type_name, val... | true | true |
1c38aa00eda65281d3fb5a0dc4a4a97245553c9a | 11,436 | py | Python | src/openapi_client/model/id16_nullable.py | Nozbe/NTImporters | 12fa898efd41954b5c29bae383aba5ac56044e87 | [
"MIT"
] | 6 | 2022-01-03T07:07:18.000Z | 2022-03-21T08:13:49.000Z | src/openapi_client/model/id16_nullable.py | Nozbe/NTImporters | 12fa898efd41954b5c29bae383aba5ac56044e87 | [
"MIT"
] | 1 | 2022-02-02T13:01:05.000Z | 2022-02-10T12:01:17.000Z | src/openapi_client/model/id16_nullable.py | Nozbe/NTImporters | 12fa898efd41954b5c29bae383aba5ac56044e87 | [
"MIT"
] | 1 | 2022-02-10T11:53:55.000Z | 2022-02-10T11:53:55.000Z | """
Nozbe Teams API
Nozbe Teams API specification # noqa: E501
The version of the OpenAPI document: 0.0.1
Contact: support@nozbe.com
Generated by: https://openapi-generator.tech
"""
import re # noqa: F401
import sys # noqa: F401
from openapi_client.model_utils import ( # noqa: F401
ApiT... | 39.84669 | 110 | 0.551591 |
import re import sys
from openapi_client.model_utils import ( ApiTypeError,
ModelComposed,
ModelNormal,
ModelSimple,
cached_property,
change_keys_js_to_python,
convert_js_args_to_python_args,
date,
datetime,
file_type,
none_type,
validate_get_composed_info,
Open... | true | true |
1c38ac794000eeef8a8357e0403beb588408b24b | 2,842 | py | Python | services/main/src/devices.py | Para-chute/getaware | 469ccebca023d244152740e1d502ceb9db123194 | [
"MIT"
] | 1 | 2019-09-06T23:17:44.000Z | 2019-09-06T23:17:44.000Z | services/main/src/devices.py | Para-chute/getaware | 469ccebca023d244152740e1d502ceb9db123194 | [
"MIT"
] | 7 | 2020-09-07T04:37:32.000Z | 2022-02-26T17:28:15.000Z | services/main/src/devices.py | Para-chute/getaware | 469ccebca023d244152740e1d502ceb9db123194 | [
"MIT"
] | 1 | 2019-09-06T16:28:02.000Z | 2019-09-06T16:28:02.000Z | import cherrypy
import os
import json
import datetime
import influxdb
import src.schemas as schema
class Devices(object):
def __init__(self):
pass
exposed = True
@cherrypy.tools.json_out()
def GET(self, eventalias, intid, uuid):
try:
event = schema.Event.objects.get(alias... | 29.298969 | 82 | 0.508445 | import cherrypy
import os
import json
import datetime
import influxdb
import src.schemas as schema
class Devices(object):
def __init__(self):
pass
exposed = True
@cherrypy.tools.json_out()
def GET(self, eventalias, intid, uuid):
try:
event = schema.Event.objects.get(alias... | true | true |
1c38adb5b1c1296aac582774750f99d40b779ab0 | 741 | py | Python | ssddj/ssdfrontend/views.py | sachinkagarwal/saturnring | 8fc6d9e0525ea72536102a17b0b5febed63e22ae | [
"BSD-3-Clause"
] | 3 | 2016-01-24T14:44:06.000Z | 2017-10-10T15:26:15.000Z | ssddj/ssdfrontend/views.py | Acidburn0zzz/saturnring | 5dfb62480e6e8bbae1714274a58b07ac4303138f | [
"BSD-3-Clause"
] | 1 | 2015-04-16T17:27:24.000Z | 2015-04-16T17:27:24.000Z | ssddj/ssdfrontend/views.py | Acidburn0zzz/saturnring | 5dfb62480e6e8bbae1714274a58b07ac4303138f | [
"BSD-3-Clause"
] | 6 | 2015-04-17T19:06:15.000Z | 2019-02-15T19:08:34.000Z | #Copyright 2014 Blackberry Limited
#
#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,... | 35.285714 | 73 | 0.782726 |
from django.shortcuts import render
from django.views.generic import ListView
from ssdfrontend.models import Target
class TargetList(ListView):
model = Target
| true | true |
1c38ae29e28c04149ad2eb99228cb304e4228d61 | 12,547 | py | Python | sdk/python/pulumi_aws/cognito/identity_pool.py | sibuthomasmathew/pulumi-aws | 6351f2182eb6f693d4e09e4136c385adfa0ab674 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_aws/cognito/identity_pool.py | sibuthomasmathew/pulumi-aws | 6351f2182eb6f693d4e09e4136c385adfa0ab674 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_aws/cognito/identity_pool.py | sibuthomasmathew/pulumi-aws | 6351f2182eb6f693d4e09e4136c385adfa0ab674 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** 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 _utilitie... | 51.633745 | 209 | 0.679047 |
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union
from .. import _utilities, _tables
from . import outputs
from ._inputs import *
__all__ = ['IdentityPool']
class IdentityPool(pulumi.CustomResource):
def __init__(__self__,
resource_na... | true | true |
1c38ae3a2b9ed3a97e68b3292d750d92637ef04c | 13,191 | py | Python | test/unit/models/test_proposals.py | swatchie-1/sentinel | 954f76e93ed1422d885a4cb5e46fb8aa3e525899 | [
"MIT"
] | null | null | null | test/unit/models/test_proposals.py | swatchie-1/sentinel | 954f76e93ed1422d885a4cb5e46fb8aa3e525899 | [
"MIT"
] | null | null | null | test/unit/models/test_proposals.py | swatchie-1/sentinel | 954f76e93ed1422d885a4cb5e46fb8aa3e525899 | [
"MIT"
] | 2 | 2019-05-20T16:37:32.000Z | 2021-12-04T15:44:47.000Z | import pytest
import sys
import os
import time
os.environ['SENTINEL_ENV'] = 'test'
os.environ['SENTINEL_CONFIG'] = os.path.normpath(os.path.join(os.path.dirname(__file__), '../../test_sentinel.conf'))
sys.path.append(os.path.normpath(os.path.join(os.path.dirname(__file__), '../../../lib')))
import misc
import config
fr... | 52.764 | 3,629 | 0.779547 | import pytest
import sys
import os
import time
os.environ['SENTINEL_ENV'] = 'test'
os.environ['SENTINEL_CONFIG'] = os.path.normpath(os.path.join(os.path.dirname(__file__), '../../test_sentinel.conf'))
sys.path.append(os.path.normpath(os.path.join(os.path.dirname(__file__), '../../../lib')))
import misc
import config
fr... | true | true |
1c38ae6d57c9f55f638d14d8f5d57647b4c2ce3d | 9,786 | py | Python | example/ssd/symbol/inceptionv3.py | axbaretto/mxnet | 5f593885356ff6d14f5519fa18e79b944beb51cd | [
"Apache-2.0"
] | 866 | 2016-10-07T16:05:13.000Z | 2022-01-19T08:30:31.000Z | smd_hpi/examples/binary-imagenet1k/symbols/inception-v3.py | yanghaojin/BMXNet | 102f8d0ed59529bbd162c37bf07ae58ad6c4caa1 | [
"Apache-2.0"
] | 237 | 2016-10-06T21:19:45.000Z | 2021-07-20T03:52:45.000Z | smd_hpi/examples/binary-imagenet1k/symbols/inception-v3.py | yanghaojin/BMXNet | 102f8d0ed59529bbd162c37bf07ae58ad6c4caa1 | [
"Apache-2.0"
] | 431 | 2016-10-19T10:08:07.000Z | 2021-10-03T00:43:33.000Z | """
Inception V3, suitable for images with around 299 x 299
Reference:
Szegedy, Christian, et al. "Rethinking the Inception Architecture for Computer Vision." arXiv preprint arXiv:1512.00567 (2015).
"""
import mxnet as mx
def Conv(data, num_filter, kernel=(1, 1), stride=(1, 1), pad=(0, 0), name=None, suffix=''):
... | 57.905325 | 152 | 0.589822 | import mxnet as mx
def Conv(data, num_filter, kernel=(1, 1), stride=(1, 1), pad=(0, 0), name=None, suffix=''):
conv = mx.sym.Convolution(data=data, num_filter=num_filter, kernel=kernel, stride=stride, pad=pad, no_bias=True, name='%s%s_conv2d' %(name, suffix))
bn = mx.sym.BatchNorm(data=conv, name='%s%s_batchno... | true | true |
1c38aeb55160851cc8b3ddc7ceec5cf13ea97b20 | 4,113 | py | Python | wagtail/contrib/settings/models.py | sonnybaker/wagtail | 5522992c2923276fca40417401e8fb2c536b4b4f | [
"BSD-3-Clause"
] | 8,851 | 2016-12-09T19:01:45.000Z | 2022-03-31T04:45:06.000Z | wagtail/contrib/settings/models.py | sonnybaker/wagtail | 5522992c2923276fca40417401e8fb2c536b4b4f | [
"BSD-3-Clause"
] | 5,197 | 2016-12-09T19:24:37.000Z | 2022-03-31T22:17:55.000Z | wagtail/contrib/settings/models.py | sonnybaker/wagtail | 5522992c2923276fca40417401e8fb2c536b4b4f | [
"BSD-3-Clause"
] | 2,548 | 2016-12-09T18:16:55.000Z | 2022-03-31T21:34:38.000Z | from django.db import models
from wagtail.core.models import Site
from wagtail.core.utils import InvokeViaAttributeShortcut
from .registry import register_setting
__all__ = ['BaseSetting', 'register_setting']
class BaseSetting(models.Model):
"""
The abstract base model for settings. Subclasses must be reg... | 33.439024 | 83 | 0.641867 | from django.db import models
from wagtail.core.models import Site
from wagtail.core.utils import InvokeViaAttributeShortcut
from .registry import register_setting
__all__ = ['BaseSetting', 'register_setting']
class BaseSetting(models.Model):
select_related = None
site = models.OneToOneField(
... | true | true |
1c38aebe7d9526fdb385a5791f5598f850053201 | 10,223 | py | Python | pytext/data/sources/data_source.py | abhinavarora/pytext | d72f977d34c741712d20bd74418feb1e0b7a13f1 | [
"BSD-3-Clause"
] | null | null | null | pytext/data/sources/data_source.py | abhinavarora/pytext | d72f977d34c741712d20bd74418feb1e0b7a13f1 | [
"BSD-3-Clause"
] | null | null | null | pytext/data/sources/data_source.py | abhinavarora/pytext | d72f977d34c741712d20bd74418feb1e0b7a13f1 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved
import logging
from typing import Dict
from pytext.config.component import Component, ComponentType
class RawExample(dict):
"""A wrapper class for a single example row with a dict interface.
This is here for any lo... | 41.556911 | 88 | 0.706055 |
import logging
from typing import Dict
from pytext.config.component import Component, ComponentType
class RawExample(dict):
DATA_SOURCE_TYPES = {}
class SafeFileWrapper:
def __init__(self, *args, **kwargs):
self._file = open(*args, **kwargs)
def __del__(self):
self._file.close()
d... | true | true |
1c38afc6f50dc3226ca40bcc448b91df40033700 | 648 | py | Python | news/migrations/0007_auto_20191002_1638.py | josylad/Moringa-Tribune | 003895fb557b7454b4e3555df407aaf2f0ca58f8 | [
"MIT"
] | null | null | null | news/migrations/0007_auto_20191002_1638.py | josylad/Moringa-Tribune | 003895fb557b7454b4e3555df407aaf2f0ca58f8 | [
"MIT"
] | 2 | 2021-06-08T20:26:03.000Z | 2021-09-08T01:21:23.000Z | news/migrations/0007_auto_20191002_1638.py | josylad/Moringa-Tribune | 003895fb557b7454b4e3555df407aaf2f0ca58f8 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by Django 1.11 on 2019-10-02 13:38
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('news', '0006_auto_20191002_1637'),
]
operations = [
migrations.AlterField(
... | 24.923077 | 90 | 0.603395 | from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('news', '0006_auto_20191002_1637'),
]
operations = [
migrations.AlterField(
model_name='article',
name='article_image',
... | true | true |
1c38b0b32e7b6af2e0e0a0a43aac9c00f48ba75c | 97 | py | Python | PythonExercicios/ex024-primeiras-letras-do-texto.py | ArthurAlbuquerquee/exercicios-python-cev | ba64d3a025731aae5e238c7cb469917420b7901e | [
"MIT"
] | null | null | null | PythonExercicios/ex024-primeiras-letras-do-texto.py | ArthurAlbuquerquee/exercicios-python-cev | ba64d3a025731aae5e238c7cb469917420b7901e | [
"MIT"
] | null | null | null | PythonExercicios/ex024-primeiras-letras-do-texto.py | ArthurAlbuquerquee/exercicios-python-cev | ba64d3a025731aae5e238c7cb469917420b7901e | [
"MIT"
] | null | null | null | cidade = str(input('Digite o nome de uma cidade: ')).strip()
print(cidade[:5].upper() == 'SANTO') | 48.5 | 60 | 0.649485 | cidade = str(input('Digite o nome de uma cidade: ')).strip()
print(cidade[:5].upper() == 'SANTO') | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.