hexsha stringlengths 40 40 | size int64 4 996k | ext stringclasses 8
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 4 996k | avg_line_length float64 1.33 58.2k | max_line_length int64 2 323k | alphanum_fraction float64 0 0.97 | content_no_comment stringlengths 0 946k | is_comment_constant_removed bool 2
classes | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f7f1bb2afc9a4fdac0451790d096ea58c6b17f71 | 886 | py | Python | python/qitoolchain/test/test_qitoolchain_import_package.py | aldebaran/qibuild | efea6fa3744664348717fe5e8df708a3cf392072 | [
"BSD-3-Clause"
] | 51 | 2015-01-05T14:35:13.000Z | 2021-07-27T06:46:59.000Z | python/qitoolchain/test/test_qitoolchain_import_package.py | aldebaran/qibuild | efea6fa3744664348717fe5e8df708a3cf392072 | [
"BSD-3-Clause"
] | 104 | 2015-04-09T10:48:42.000Z | 2020-09-16T16:33:29.000Z | python/qitoolchain/test/test_qitoolchain_import_package.py | aldebaran/qibuild | efea6fa3744664348717fe5e8df708a3cf392072 | [
"BSD-3-Clause"
] | 46 | 2015-01-05T14:35:16.000Z | 2022-02-13T20:39:36.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2012-2021 SoftBank Robotics. All rights reserved.
# Use of this source code is governed by a BSD-style license (see the COPYING file).
""" Test QiToolchain Import Package """
from __future__ import absolute_import
from __future__ import unicode_literals
from... | 31.642857 | 84 | 0.700903 |
from __future__ import absolute_import
from __future__ import unicode_literals
from __future__ import print_function
import os
import qisys.sh
def test_simple(qitoolchain_action, tmpdir, toolchains):
toolchains.create("test")
this_dir = os.path.dirname(__file__)
json_c_bz2_path_src = os.path.join(th... | true | true |
f7f1bb58ae011913243b396db3bc2ab0c69e154f | 6,333 | py | Python | asclib/checkers/typific/factory.py | AdaCore/style_checker | 17108ebfc44375498063ecdad6c6e4430458e60a | [
"CNRI-Python"
] | 2 | 2017-10-22T18:04:26.000Z | 2020-03-06T11:07:41.000Z | asclib/checkers/typific/factory.py | AdaCore/style_checker | 17108ebfc44375498063ecdad6c6e4430458e60a | [
"CNRI-Python"
] | null | null | null | asclib/checkers/typific/factory.py | AdaCore/style_checker | 17108ebfc44375498063ecdad6c6e4430458e60a | [
"CNRI-Python"
] | 4 | 2018-05-22T12:08:54.000Z | 2020-12-14T15:25:27.000Z | """The typific file checker factory..."""
import os
from asclib.checkers import FileCheckerError
from asclib.ex import Run
def get_file_checker(filename, config):
"""Return the TypificChecker for the given filename.
:param filename: The name of the file to be checking.
:type filename: str
:param con... | 31.824121 | 87 | 0.688457 | import os
from asclib.checkers import FileCheckerError
from asclib.ex import Run
def get_file_checker(filename, config):
_, ext = os.path.splitext(filename)
if ext in (".ads", ".adb", ".ada"):
from asclib.checkers.typific.ada import AdaFileChecker
return AdaFileChecker(filename, config)
... | true | true |
f7f1bbfd169879ef9d9910065572d0eb8f3e3b5b | 1,028 | py | Python | serverdata/__init__.py | Doigyfu/Glass | 53c8f66a5d84c5784f0a8a31bb5726b7a40cd150 | [
"MIT"
] | 21 | 2018-06-22T19:29:16.000Z | 2021-12-15T19:47:31.000Z | serverdata/__init__.py | Doigyfu/Glass | 53c8f66a5d84c5784f0a8a31bb5726b7a40cd150 | [
"MIT"
] | 11 | 2016-09-01T18:20:55.000Z | 2017-03-09T17:37:00.000Z | serverdata/__init__.py | Doigyfu/Glass | 53c8f66a5d84c5784f0a8a31bb5726b7a40cd150 | [
"MIT"
] | 14 | 2018-11-19T16:00:52.000Z | 2021-02-02T20:13:08.000Z | # -*- coding: utf-8 -*-
def join_json(self):
return {
'text': "",
'extra': [{
'text': "**",
'obfuscated': True
}, {
'text': " "
}, {
'text': "Welcome, player",
'color': "gold",
'bold': True
}, {
... | 21.87234 | 38 | 0.272374 |
def join_json(self):
return {
'text': "",
'extra': [{
'text': "**",
'obfuscated': True
}, {
'text': " "
}, {
'text': "Welcome, player",
'color': "gold",
'bold': True
}, {
'text': " "
... | true | true |
f7f1bef41b7662fc767821bb6a4a9adb6ca17c4e | 30,650 | py | Python | sdk/python/pulumi_azure_native/network/v20180101/network_interface.py | polivbr/pulumi-azure-native | 09571f3bf6bdc4f3621aabefd1ba6c0d4ecfb0e7 | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_native/network/v20180101/network_interface.py | polivbr/pulumi-azure-native | 09571f3bf6bdc4f3621aabefd1ba6c0d4ecfb0e7 | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_native/network/v20180101/network_interface.py | polivbr/pulumi-azure-native | 09571f3bf6bdc4f3621aabefd1ba6c0d4ecfb0e7 | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from ... import _utilities
fro... | 55.125899 | 5,553 | 0.69217 |
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from ... import _utilities
from . import outputs
from ._enums import *
from ._inputs import *
__all__ = ['NetworkInterfaceArgs', 'NetworkInterface']
@pulumi.input_type
class NetworkInterfaceArg... | true | true |
f7f1bf4966b0223469d70f35438dba9479c33f40 | 17,014 | py | Python | src/network.py | BoPang1996/Semi-Coupled-Structure-for-visual-sequental-tasks | c6fe7c77d08928bb30cc8683123f978b0e877394 | [
"Apache-2.0"
] | 13 | 2020-02-22T11:55:33.000Z | 2021-07-02T02:05:20.000Z | src/network.py | BoPang1996/Semi-Coupled-Structure-for-visual-sequental-tasks | c6fe7c77d08928bb30cc8683123f978b0e877394 | [
"Apache-2.0"
] | null | null | null | src/network.py | BoPang1996/Semi-Coupled-Structure-for-visual-sequental-tasks | c6fe7c77d08928bb30cc8683123f978b0e877394 | [
"Apache-2.0"
] | 3 | 2020-05-11T14:48:21.000Z | 2021-01-12T12:12:43.000Z | import torch
import torch.nn as nn
import numpy as np
from torch.autograd import Variable
import torch.nn.functional as F
from sync_batchnorm import SynchronizedBatchNorm2d
import random
class SCS(nn.Module):
def __init__(self, batch_norm, num_action, dropout, q, test_scheme=1, img_size=112, syn_bn=False):
... | 49.0317 | 287 | 0.514106 | import torch
import torch.nn as nn
import numpy as np
from torch.autograd import Variable
import torch.nn.functional as F
from sync_batchnorm import SynchronizedBatchNorm2d
import random
class SCS(nn.Module):
def __init__(self, batch_norm, num_action, dropout, q, test_scheme=1, img_size=112, syn_bn=False):
... | true | true |
f7f1bfaae4df35ffd0361eb783472a09f9e37365 | 3,243 | py | Python | tests/schemas/test_schema.py | jvenant/dataclasses-avroschema | 175d670cc99119d60cb783cce79601e6acc2047f | [
"MIT"
] | null | null | null | tests/schemas/test_schema.py | jvenant/dataclasses-avroschema | 175d670cc99119d60cb783cce79601e6acc2047f | [
"MIT"
] | null | null | null | tests/schemas/test_schema.py | jvenant/dataclasses-avroschema | 175d670cc99119d60cb783cce79601e6acc2047f | [
"MIT"
] | null | null | null | import json
import pytest
from dataclasses_avroschema import AvroModel
from dataclasses_avroschema.schema_definition import BaseSchemaDefinition
encoded = "test".encode()
def test_total_schema_fields_from_class(user_dataclass):
assert len(user_dataclass.get_fields()) == 5
def test_total_schema_fields_from_in... | 29.481818 | 120 | 0.743139 | import json
import pytest
from dataclasses_avroschema import AvroModel
from dataclasses_avroschema.schema_definition import BaseSchemaDefinition
encoded = "test".encode()
def test_total_schema_fields_from_class(user_dataclass):
assert len(user_dataclass.get_fields()) == 5
def test_total_schema_fields_from_in... | true | true |
f7f1c0629500835f6d895302108fb1ee3c23ce47 | 5,038 | py | Python | zerver/views/upload.py | myii/zulip | 915d8013271f1823954dd8d4441842842857ab9f | [
"Apache-2.0"
] | 1 | 2020-03-19T00:52:48.000Z | 2020-03-19T00:52:48.000Z | zerver/views/upload.py | myii/zulip | 915d8013271f1823954dd8d4441842842857ab9f | [
"Apache-2.0"
] | null | null | null | zerver/views/upload.py | myii/zulip | 915d8013271f1823954dd8d4441842842857ab9f | [
"Apache-2.0"
] | 1 | 2020-04-21T01:26:54.000Z | 2020-04-21T01:26:54.000Z | from django.http import HttpRequest, HttpResponse, HttpResponseForbidden, \
HttpResponseNotFound
from django.shortcuts import redirect
from django.utils.cache import patch_cache_control
from django.utils.translation import ugettext as _
from zerver.lib.response import json_success, json_error
from zerver.lib.uploa... | 46.220183 | 95 | 0.731441 | from django.http import HttpRequest, HttpResponse, HttpResponseForbidden, \
HttpResponseNotFound
from django.shortcuts import redirect
from django.utils.cache import patch_cache_control
from django.utils.translation import ugettext as _
from zerver.lib.response import json_success, json_error
from zerver.lib.uploa... | true | true |
f7f1c190d62cb4a39567855f011b95ea14308519 | 376 | py | Python | parser.py | nikmedoed/YMparser | ff7a5acf6e9e5a2cc38c4522d49b0230f04fd82f | [
"Apache-2.0"
] | 3 | 2019-11-08T19:16:28.000Z | 2019-11-08T19:17:00.000Z | parser.py | nikmedoed/YMparser | ff7a5acf6e9e5a2cc38c4522d49b0230f04fd82f | [
"Apache-2.0"
] | null | null | null | parser.py | nikmedoed/YMparser | ff7a5acf6e9e5a2cc38c4522d49b0230f04fd82f | [
"Apache-2.0"
] | null | null | null | from datetime import datetime
from getData import getLinks
from getTable import getTab
with open("toParse.txt", "r", encoding="utf8") as f:
toParse = list(map(lambda x: x.split(), f.read().split('\n')))
for i in toParse:
print(datetime.now(), i[0], "- старт")
links = getLinks(i[0], i[1])
# getTab(i[0... | 26.857143 | 66 | 0.635638 | from datetime import datetime
from getData import getLinks
from getTable import getTab
with open("toParse.txt", "r", encoding="utf8") as f:
toParse = list(map(lambda x: x.split(), f.read().split('\n')))
for i in toParse:
print(datetime.now(), i[0], "- старт")
links = getLinks(i[0], i[1])
print(d... | true | true |
f7f1c2af131c8da72d32dee72bf9e94e8a6e3f70 | 3,067 | py | Python | sling/nlp/parser/trainer/corpora.py | JDzvonik/sling | 3000f6ff7ae5c2d5ddcae13ad3599e35bf375ec5 | [
"Apache-2.0"
] | 2,023 | 2017-10-13T01:39:21.000Z | 2022-03-27T14:24:09.000Z | sling/nlp/parser/trainer/corpora.py | JDzvonik/sling | 3000f6ff7ae5c2d5ddcae13ad3599e35bf375ec5 | [
"Apache-2.0"
] | 166 | 2017-10-26T00:36:03.000Z | 2021-10-08T13:32:32.000Z | sling/nlp/parser/trainer/corpora.py | JDzvonik/sling | 3000f6ff7ae5c2d5ddcae13ad3599e35bf375ec5 | [
"Apache-2.0"
] | 316 | 2017-10-12T20:34:28.000Z | 2022-02-02T16:03:45.000Z | # Copyright 2017 Google 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 writing, s... | 29.209524 | 78 | 0.71177 |
n_generator import TransitionGenerator
class AnnotatedDocument(sling.Document):
def __init__(self, commons, schema, encoded):
self._store = sling.Store(commons)
self.object = self._store.parse(encoded, binary=True)
super(AnnotatedDocument, self).__init__(frame=self.object, schema=schema)
self... | true | true |
f7f1c2c876e98ff47106172bf1932cbf9d2d4500 | 5,388 | py | Python | cloud_snitch/snitchers/git.py | bunchc/FleetDeploymentReporting | a93af06573f2715e14b4d18b7a394c26fc19a32d | [
"Apache-2.0"
] | 1 | 2018-07-11T20:20:21.000Z | 2018-07-11T20:20:21.000Z | cloud_snitch/snitchers/git.py | bunchc/FleetDeploymentReporting | a93af06573f2715e14b4d18b7a394c26fc19a32d | [
"Apache-2.0"
] | 46 | 2018-08-08T19:46:15.000Z | 2019-02-22T20:33:49.000Z | cloud_snitch/snitchers/git.py | dani4571/FleetDeploymentReporting | 8b132a20fa3e9c4e4215feade79f689be6e4b364 | [
"Apache-2.0"
] | 7 | 2018-06-26T15:27:55.000Z | 2018-12-05T19:41:25.000Z | import hashlib
import logging
from .base import BaseSnitcher
from cloud_snitch.models import EnvironmentEntity
from cloud_snitch.models import GitRepoEntity
from cloud_snitch.models import GitRemoteEntity
from cloud_snitch.models import GitUrlEntity
from cloud_snitch.models import GitUntrackedFileEntity
logger = logg... | 34.76129 | 77 | 0.629176 | import hashlib
import logging
from .base import BaseSnitcher
from cloud_snitch.models import EnvironmentEntity
from cloud_snitch.models import GitRepoEntity
from cloud_snitch.models import GitRemoteEntity
from cloud_snitch.models import GitUrlEntity
from cloud_snitch.models import GitUntrackedFileEntity
logger = logg... | true | true |
f7f1c2e8c31132cea9e680457a08defdaab2eb3a | 847 | py | Python | Fatih4.py | MhmddFth/Fatih | c6a51a5bbf814a66e5ea83a312963c1bc1ecf864 | [
"Apache-2.0"
] | null | null | null | Fatih4.py | MhmddFth/Fatih | c6a51a5bbf814a66e5ea83a312963c1bc1ecf864 | [
"Apache-2.0"
] | null | null | null | Fatih4.py | MhmddFth/Fatih | c6a51a5bbf814a66e5ea83a312963c1bc1ecf864 | [
"Apache-2.0"
] | null | null | null | import time
import socket
import random
import sys
def usage():
print "Contoh Penggunaan: " "python2 Fatih4.py " "<IP> <Port> <Threads>"
print "Jangan Abuse Ngentod. Ini Cuma Bahan Cobaan Tool Doang..!"
def flood(victim, vport, duration):
client = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
bytes =... | 26.46875 | 89 | 0.603306 | import time
import socket
import random
import sys
def usage():
print "Contoh Penggunaan: " "python2 Fatih4.py " "<IP> <Port> <Threads>"
print "Jangan Abuse Ngentod. Ini Cuma Bahan Cobaan Tool Doang..!"
def flood(victim, vport, duration):
client = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
bytes =... | false | true |
f7f1c31a40da25f3cf07ad1b8fd41573bdad826a | 13,730 | py | Python | tensorflow2/tf2cv/models/wrn.py | sahilparekh/imgclsmob | 74d52457b4bf00c82d063b3f4a1a73fb6ba3863a | [
"MIT"
] | 1 | 2020-12-04T11:58:50.000Z | 2020-12-04T11:58:50.000Z | tensorflow2/tf2cv/models/wrn.py | sahilparekh/imgclsmob | 74d52457b4bf00c82d063b3f4a1a73fb6ba3863a | [
"MIT"
] | null | null | null | tensorflow2/tf2cv/models/wrn.py | sahilparekh/imgclsmob | 74d52457b4bf00c82d063b3f4a1a73fb6ba3863a | [
"MIT"
] | null | null | null | """
WRN for ImageNet-1K, implemented in TensorFlow.
Original paper: 'Wide Residual Networks,' https://arxiv.org/abs/1605.07146.
"""
__all__ = ['WRN', 'wrn50_2']
import os
import tensorflow as tf
import tensorflow.keras.layers as nn
from .common import Conv2d, MaxPool2d, flatten, is_channels_first
class WRNC... | 29.912854 | 115 | 0.573562 |
__all__ = ['WRN', 'wrn50_2']
import os
import tensorflow as tf
import tensorflow.keras.layers as nn
from .common import Conv2d, MaxPool2d, flatten, is_channels_first
class WRNConv(nn.Layer):
def __init__(self,
in_channels,
out_channels,
kernel_size,
... | true | true |
f7f1c343e2c46298649ddf9fe556e96b2bec9514 | 3,871 | py | Python | ev_de.py | avinashmnit30/Electric-Vehicle-Optimal-Charging | 7f09bdbb9904285ddbbfeaa28cf402f7ef6f4cb4 | [
"BSD-3-Clause"
] | 7 | 2018-03-09T11:19:39.000Z | 2022-01-19T13:45:20.000Z | ev_de.py | avinashmnit30/Electric-Vehicle-Optimal-Charging | 7f09bdbb9904285ddbbfeaa28cf402f7ef6f4cb4 | [
"BSD-3-Clause"
] | null | null | null | ev_de.py | avinashmnit30/Electric-Vehicle-Optimal-Charging | 7f09bdbb9904285ddbbfeaa28cf402f7ef6f4cb4 | [
"BSD-3-Clause"
] | 1 | 2022-03-03T12:08:52.000Z | 2022-03-03T12:08:52.000Z | # -*- coding: utf-8 -*-
"""
Created on Wed Dec 16 18:01:24 2015
@author: Avinash
"""
import numpy as np
from numpy import *
import numpy
from math import *
import ev_charge_schedule_modification1 as ev
#import ev_charge_schedule.static as func1
#import ev_charge_schedule.dynamic as func2
import tim... | 29.105263 | 112 | 0.482046 |
"""
Created on Wed Dec 16 18:01:24 2015
@author: Avinash
"""
import numpy as np
from numpy import *
import numpy
from math import *
import ev_charge_schedule_modification1 as ev
import time
from numba.decorators import autojit
func1=ev.static
func=autojit(func1)
mode=1
runs=1
maxiter=2000... | false | true |
f7f1c347d1232560a3f58847be282629e8a3dcd5 | 365 | py | Python | test.py | naraB/research-seq2seq-HTR | 633ecd191460bb5d7e92960fd0b6dd6f098ad509 | [
"MIT"
] | 20 | 2018-10-15T09:10:38.000Z | 2022-01-07T23:34:23.000Z | test.py | naraB/research-seq2seq-HTR | 633ecd191460bb5d7e92960fd0b6dd6f098ad509 | [
"MIT"
] | 6 | 2019-06-29T04:41:00.000Z | 2020-10-28T19:00:35.000Z | test.py | naraB/research-seq2seq-HTR | 633ecd191460bb5d7e92960fd0b6dd6f098ad509 | [
"MIT"
] | 17 | 2018-10-15T09:11:10.000Z | 2022-02-18T08:46:57.000Z | from main_torch_latest import all_data_loader, test
import argparse
#import os
parser = argparse.ArgumentParser(description='test')
parser.add_argument('epoch', type=int, help='epoch that you want to evaluate')
args = parser.parse_args()
_, _, test_loader = all_data_loader()
test(test_loader, args.epoch, showAttn=Tru... | 28.076923 | 78 | 0.769863 | from main_torch_latest import all_data_loader, test
import argparse
parser = argparse.ArgumentParser(description='test')
parser.add_argument('epoch', type=int, help='epoch that you want to evaluate')
args = parser.parse_args()
_, _, test_loader = all_data_loader()
test(test_loader, args.epoch, showAttn=True)
| true | true |
f7f1c38edb3613db83bc6e11b77c28294000b6fb | 6,304 | py | Python | testplan/exporters/testing/json/__init__.py | chiragmatkar/testplan | 13ee4fdeaaa41d8eea118d77921531277ef90147 | [
"Apache-2.0"
] | null | null | null | testplan/exporters/testing/json/__init__.py | chiragmatkar/testplan | 13ee4fdeaaa41d8eea118d77921531277ef90147 | [
"Apache-2.0"
] | null | null | null | testplan/exporters/testing/json/__init__.py | chiragmatkar/testplan | 13ee4fdeaaa41d8eea118d77921531277ef90147 | [
"Apache-2.0"
] | null | null | null | """
JSON exporter for test reports, relies on `testplan.report.testing.schemas`
for `dict` serialization and JSON conversion.
"""
from __future__ import absolute_import
import os
import json
import copy
import hashlib
from testplan import defaults
from testplan.common.config import ConfigOption
from testplan... | 36.022857 | 79 | 0.586612 | from __future__ import absolute_import
import os
import json
import copy
import hashlib
from testplan import defaults
from testplan.common.config import ConfigOption
from testplan.common.exporters import ExporterConfig
from testplan.common.utils.path import makedirs
from testplan.report import ReportCategories
from... | true | true |
f7f1c4a46c2c6cfb87ade08a5452eda8a52f57f1 | 712 | py | Python | quiz-devpro/quiz/base/migrations/0001_initial.py | carlosromaro/Quiz-DevPro | 2638db12844cecf45038911a7c1df08d55f2fe66 | [
"MIT"
] | null | null | null | quiz-devpro/quiz/base/migrations/0001_initial.py | carlosromaro/Quiz-DevPro | 2638db12844cecf45038911a7c1df08d55f2fe66 | [
"MIT"
] | null | null | null | quiz-devpro/quiz/base/migrations/0001_initial.py | carlosromaro/Quiz-DevPro | 2638db12844cecf45038911a7c1df08d55f2fe66 | [
"MIT"
] | null | null | null | # Generated by Django 3.1.7 on 2021-03-23 18:20
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Pergunta',
fields=[
('id', models.AutoField... | 28.48 | 114 | 0.549157 |
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Pergunta',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize... | true | true |
f7f1c5d7723033235d9c26b307debe9d385b4ac6 | 11,035 | py | Python | eiseg/controller.py | GT-ZhangAcer/iann | b5640c4909ea7fbd3f88c4d4245c2b49d7ea0b89 | [
"Apache-2.0"
] | 2 | 2021-09-14T22:51:06.000Z | 2021-11-17T09:52:38.000Z | eiseg/controller.py | GT-ZhangAcer/iann | b5640c4909ea7fbd3f88c4d4245c2b49d7ea0b89 | [
"Apache-2.0"
] | null | null | null | eiseg/controller.py | GT-ZhangAcer/iann | b5640c4909ea7fbd3f88c4d4245c2b49d7ea0b89 | [
"Apache-2.0"
] | 1 | 2021-09-14T22:51:08.000Z | 2021-09-14T22:51:08.000Z | import time
import json
import paddle
import cv2
import numpy as np
import paddleseg.transforms as T
from skimage.measure import label
from inference import clicker
from inference.predictor import get_predictor
import util
from util.vis import draw_with_blend_and_clicks
from util import MODELS, LabelList
# TODO: 研究标... | 26.526442 | 81 | 0.543725 | import time
import json
import paddle
import cv2
import numpy as np
import paddleseg.transforms as T
from skimage.measure import label
from inference import clicker
from inference.predictor import get_predictor
import util
from util.vis import draw_with_blend_and_clicks
from util import MODELS, LabelList
class Inte... | true | true |
f7f1c6766bf2a7de85ca019268db15c936f2652d | 4,949 | py | Python | tensorflow_addons/seq2seq/tests/beam_search_ops_test.py | dkamotsky/addons | 56ff850785c6caa8c18c2859e32a32c8902defea | [
"Apache-2.0"
] | null | null | null | tensorflow_addons/seq2seq/tests/beam_search_ops_test.py | dkamotsky/addons | 56ff850785c6caa8c18c2859e32a32c8902defea | [
"Apache-2.0"
] | null | null | null | tensorflow_addons/seq2seq/tests/beam_search_ops_test.py | dkamotsky/addons | 56ff850785c6caa8c18c2859e32a32c8902defea | [
"Apache-2.0"
] | null | null | null | # Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 35.862319 | 87 | 0.599919 |
import itertools
import numpy as np
import pytest
import tensorflow as tf
from tensorflow_addons.seq2seq import gather_tree
def _transpose_batch_time(x):
return np.transpose(x, [1, 0, 2]).astype(np.int32)
def test_gather_tree_one():
end_token = 10
step_ids = _transpose_batch_time([... | true | true |
f7f1c6dbd02f5fdf13d12f7c8f2d115495d5e2a4 | 28,763 | py | Python | src/sage/homology/simplicial_set_examples.py | bopopescu/sage | 2d495be78e0bdc7a0a635454290b27bb4f5f70f0 | [
"BSL-1.0"
] | 3 | 2019-07-15T13:48:24.000Z | 2019-11-08T12:31:43.000Z | src/sage/homology/simplicial_set_examples.py | bopopescu/sage | 2d495be78e0bdc7a0a635454290b27bb4f5f70f0 | [
"BSL-1.0"
] | 2 | 2018-10-30T13:40:20.000Z | 2020-07-23T12:13:30.000Z | src/sage/homology/simplicial_set_examples.py | bopopescu/sage | 2d495be78e0bdc7a0a635454290b27bb4f5f70f0 | [
"BSL-1.0"
] | 1 | 2020-07-23T10:29:58.000Z | 2020-07-23T10:29:58.000Z | # -*- coding: utf-8 -*-
r"""
Examples of simplicial sets.
These are accessible via ``simplicial_sets.Sphere(3)``,
``simplicial_sets.Torus()``, etc. Type ``simplicial_sets.[TAB]`` to
see a complete list.
AUTHORS:
- John H. Palmieri (2016-07)
"""
#**********************************************************************... | 36.134422 | 102 | 0.537148 |
import re
import os
from pyparsing import OneOrMore, nestedExpr
from sage.env import SAGE_ENV
from sage.groups.abelian_gps.abelian_group import AbelianGroup
from sage.misc.cachefunc import cached_method, cached_function
from sage.misc.latex import latex
from sage.rings.infinity import Infinity
from s... | true | true |
f7f1c6f837b5e353ea2789d03bc9518867f49c2d | 10,315 | py | Python | compiler_gym/util/executor.py | thecoblack/CompilerGym | ade54e2f1829cf41722decb0942a4d6fd3102c2c | [
"MIT"
] | null | null | null | compiler_gym/util/executor.py | thecoblack/CompilerGym | ade54e2f1829cf41722decb0942a4d6fd3102c2c | [
"MIT"
] | null | null | null | compiler_gym/util/executor.py | thecoblack/CompilerGym | ade54e2f1829cf41722decb0942a4d6fd3102c2c | [
"MIT"
] | null | null | null | # Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import logging
import multiprocessing
from collections import deque
from contextlib import contextmanager
from enum import Enum
from itertools ... | 32.234375 | 88 | 0.605623 |
import logging
import multiprocessing
from collections import deque
from contextlib import contextmanager
from enum import Enum
from itertools import islice
from os import cpu_count
from pathlib import Path
from threading import Lock
from typing import Optional
from pydantic import BaseModel, Field, validator
from... | true | true |
f7f1c8a89f8c56bb92a546775a523482d3295dce | 14,728 | py | Python | src/App.py | Progitiel/Slideways | 64b8672860893eea6be245b5138f5ec48e97ed8c | [
"MIT"
] | null | null | null | src/App.py | Progitiel/Slideways | 64b8672860893eea6be245b5138f5ec48e97ed8c | [
"MIT"
] | null | null | null | src/App.py | Progitiel/Slideways | 64b8672860893eea6be245b5138f5ec48e97ed8c | [
"MIT"
] | null | null | null | import copy
import os
import random
import time
import numpy as np
from Config import *
from Record import Record
from AI import AI
def valid_input_case(board, currentPlayerNumber, last_play, prev_boards, line, column):
"""
Vérifie si les données sont correctes selon les règles du jeu pour les cases
Ent... | 28.992126 | 144 | 0.543047 | import copy
import os
import random
import time
import numpy as np
from Config import *
from Record import Record
from AI import AI
def valid_input_case(board, currentPlayerNumber, last_play, prev_boards, line, column):
valid = False
valid_playable = board[line][column] != -1
if valid_playable:
... | true | true |
f7f1c8e4df4cb391d6e0a02fcd5c2314379fadc0 | 1,376 | py | Python | app/auth/views.py | Dnmrk4/watchlist | 240aa695d5be0a585904f59b698bacb6b2c84889 | [
"MIT"
] | null | null | null | app/auth/views.py | Dnmrk4/watchlist | 240aa695d5be0a585904f59b698bacb6b2c84889 | [
"MIT"
] | null | null | null | app/auth/views.py | Dnmrk4/watchlist | 240aa695d5be0a585904f59b698bacb6b2c84889 | [
"MIT"
] | null | null | null | from flask import render_template,redirect,url_for, flash,request
from . import auth
from flask import render_template,redirect,url_for
from ..models import User
from .forms import RegistrationForm,LoginForm
from .. import db
from flask_login import login_user,logout_user,login_required
@auth.route('/login',methods=[... | 34.4 | 105 | 0.712209 | from flask import render_template,redirect,url_for, flash,request
from . import auth
from flask import render_template,redirect,url_for
from ..models import User
from .forms import RegistrationForm,LoginForm
from .. import db
from flask_login import login_user,logout_user,login_required
@auth.route('/login',methods=[... | true | true |
f7f1ca2598a3e679b24fa8d62c52e4f4de788fe2 | 15,226 | py | Python | python/paddle/fluid/io.py | missyliu/Paddle | 3fd33d4df9aa44f482bca8214cca8e6d90f06da2 | [
"Apache-2.0"
] | null | null | null | python/paddle/fluid/io.py | missyliu/Paddle | 3fd33d4df9aa44f482bca8214cca8e6d90f06da2 | [
"Apache-2.0"
] | null | null | null | python/paddle/fluid/io.py | missyliu/Paddle | 3fd33d4df9aa44f482bca8214cca8e6d90f06da2 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by app... | 33.611479 | 93 | 0.646132 |
import os
from paddle.fluid.evaluator import Evaluator
from paddle.fluid.framework import Program, Parameter, default_main_program, Variable
from . import core
__all__ = [
'save_vars',
'save_params',
'save_persistables',
'load_vars',
'load_params',
'load_persistables',
'save_... | true | true |
f7f1ca5e99201c1c5aa98307a89aec71f5c2ecb1 | 3,614 | py | Python | docs/source/conf.py | claws/adsb | 4a7d35880dece6baaf24370fab445e2571fc19e9 | [
"MIT"
] | 7 | 2018-07-11T00:50:47.000Z | 2021-09-29T10:36:44.000Z | docs/source/conf.py | claws/adsb | 4a7d35880dece6baaf24370fab445e2571fc19e9 | [
"MIT"
] | 3 | 2020-06-13T23:27:42.000Z | 2020-07-22T03:06:16.000Z | docs/source/conf.py | claws/adsb | 4a7d35880dece6baaf24370fab445e2571fc19e9 | [
"MIT"
] | 3 | 2020-01-08T19:05:42.000Z | 2022-02-11T02:22:23.000Z | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
import os
import re
import sys
from sphinx.ext import apidoc
# sys.path.insert(0, os.path.abspath('../../src'))
regexp = re.compile(r'.*__version__ = [\'\"](.*?)[\'\"]', re.S)
repo_root = os.path.dirname(os.path.dirname(os.path.dirname(__file__)))
pkg_root = os.path.jo... | 28.015504 | 78 | 0.682623 |
import os
import re
import sys
from sphinx.ext import apidoc
regexp = re.compile(r'.*__version__ = [\'\"](.*?)[\'\"]', re.S)
repo_root = os.path.dirname(os.path.dirname(os.path.dirname(__file__)))
pkg_root = os.path.join(repo_root, 'src', 'adsb')
init_file = os.path.join(pkg_root, '__init__.py')
with open(init_fi... | true | true |
f7f1cb4415b4964f0f52b495e1cb4c19e1c8adb4 | 511 | py | Python | env/lib/python3.8/site-packages/plotly/validators/scattermapbox/hoverlabel/_namelengthsrc.py | acrucetta/Chicago_COVI_WebApp | a37c9f492a20dcd625f8647067394617988de913 | [
"MIT",
"Unlicense"
] | 76 | 2020-07-06T14:44:05.000Z | 2022-02-14T15:30:21.000Z | env/lib/python3.8/site-packages/plotly/validators/scattermapbox/hoverlabel/_namelengthsrc.py | acrucetta/Chicago_COVI_WebApp | a37c9f492a20dcd625f8647067394617988de913 | [
"MIT",
"Unlicense"
] | 11 | 2020-08-09T02:30:14.000Z | 2022-03-12T00:50:14.000Z | env/lib/python3.8/site-packages/plotly/validators/scattermapbox/hoverlabel/_namelengthsrc.py | acrucetta/Chicago_COVI_WebApp | a37c9f492a20dcd625f8647067394617988de913 | [
"MIT",
"Unlicense"
] | 11 | 2020-07-12T16:18:07.000Z | 2022-02-05T16:48:35.000Z | import _plotly_utils.basevalidators
class NamelengthsrcValidator(_plotly_utils.basevalidators.SrcValidator):
def __init__(
self,
plotly_name="namelengthsrc",
parent_name="scattermapbox.hoverlabel",
**kwargs
):
super(NamelengthsrcValidator, self).__init__(
pl... | 28.388889 | 72 | 0.624266 | import _plotly_utils.basevalidators
class NamelengthsrcValidator(_plotly_utils.basevalidators.SrcValidator):
def __init__(
self,
plotly_name="namelengthsrc",
parent_name="scattermapbox.hoverlabel",
**kwargs
):
super(NamelengthsrcValidator, self).__init__(
pl... | true | true |
f7f1cc20dbd7f6ab175523430a00e7fddcf48c4e | 3,646 | py | Python | LinearRegressionWithSyntheticData.py | xvalad/ML | baf71a32fe5c5cf8e9f79a7ec46f59b878f87965 | [
"Apache-2.0"
] | null | null | null | LinearRegressionWithSyntheticData.py | xvalad/ML | baf71a32fe5c5cf8e9f79a7ec46f59b878f87965 | [
"Apache-2.0"
] | null | null | null | LinearRegressionWithSyntheticData.py | xvalad/ML | baf71a32fe5c5cf8e9f79a7ec46f59b878f87965 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python3
# LinearRegressionWIthSyntheticData by Google
# https://colab.research.google.com/github/google/eng-edu/blob/master/ml/cc/exercises/linear_regression_with_synthetic_data.ipynb
#
import pandas as pd
import tensorflow as tf
from matplotlib import pyplot as plt
#
## DEFINE FUNCTIONS THAT BUILD AND TRAI... | 33.145455 | 129 | 0.698025 |
import pandas as pd
import tensorflow as tf
from matplotlib import pyplot as plt
el = tf.keras.models.Sequential()
model.add(tf.keras.layers.Dense(units=1,
input_shape=(1,)))
model.compile(optimizer=tf.keras.optimizers.RMSprop(lr=my_learning_rate),
... | true | true |
f7f1cc8aec75d5e41720210fc5bb50dafe77c247 | 297 | py | Python | conan_build_tool/Configurators/ArchConfigurator.py | Av3m/conan_build_tools | f82fb4a87d4ce7eea49b2af62a2ed14e9ef4a123 | [
"MIT"
] | null | null | null | conan_build_tool/Configurators/ArchConfigurator.py | Av3m/conan_build_tools | f82fb4a87d4ce7eea49b2af62a2ed14e9ef4a123 | [
"MIT"
] | null | null | null | conan_build_tool/Configurators/ArchConfigurator.py | Av3m/conan_build_tools | f82fb4a87d4ce7eea49b2af62a2ed14e9ef4a123 | [
"MIT"
] | null | null | null | class ArchConfigurator(object):
def __init(self, arch_build, arch):
self.arch = arch
self.arch_build = arch_build
def configure(self, params):
params["settings"]["arch_build"] = self.arch_build
params["settings"]["arch"] = self.arch
return params
| 27 | 58 | 0.632997 | class ArchConfigurator(object):
def __init(self, arch_build, arch):
self.arch = arch
self.arch_build = arch_build
def configure(self, params):
params["settings"]["arch_build"] = self.arch_build
params["settings"]["arch"] = self.arch
return params
| true | true |
f7f1cdc4aff0cab642d917f2ba359e0d2deecf1c | 495 | py | Python | mcdp/exception.py | Ovizro/Mcdp | 0c94e199276412867af6d7a0350366a67c8db72c | [
"Apache-2.0"
] | 3 | 2021-10-05T04:13:35.000Z | 2021-11-10T11:52:33.000Z | mcdp/exception.py | Ovizro/Mcdp | 0c94e199276412867af6d7a0350366a67c8db72c | [
"Apache-2.0"
] | null | null | null | mcdp/exception.py | Ovizro/Mcdp | 0c94e199276412867af6d7a0350366a67c8db72c | [
"Apache-2.0"
] | 2 | 2021-10-05T04:13:59.000Z | 2021-10-05T04:14:59.000Z | from typing import Optional
from .typing import McdpError, __version__
class McdpVersionError(McdpError):
__slots__ = []
def __init__(self, msg: Optional[str] = None) -> None:
if msg:
super().__init__(
msg.format(mcdp_version=__version__))
else:
s... | 20.625 | 58 | 0.632323 | from typing import Optional
from .typing import McdpError, __version__
class McdpVersionError(McdpError):
__slots__ = []
def __init__(self, msg: Optional[str] = None) -> None:
if msg:
super().__init__(
msg.format(mcdp_version=__version__))
else:
s... | true | true |
f7f1cded95fdf8693361aedf58efad6cd7088a37 | 24,567 | py | Python | venv/Lib/site-packages/ibm_s3transfer/utils.py | luislucatero21/CJF-WebServices | 7b6ba931352bc959c16069c4b1d035d68d1494c8 | [
"Apache-2.0"
] | null | null | null | venv/Lib/site-packages/ibm_s3transfer/utils.py | luislucatero21/CJF-WebServices | 7b6ba931352bc959c16069c4b1d035d68d1494c8 | [
"Apache-2.0"
] | null | null | null | venv/Lib/site-packages/ibm_s3transfer/utils.py | luislucatero21/CJF-WebServices | 7b6ba931352bc959c16069c4b1d035d68d1494c8 | [
"Apache-2.0"
] | null | null | null | # Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"). You
# may not use this file except in compliance with the License. A copy of
# the License is located at
#
# http://aws.amazon.com/apache2.0/
#
# or in the "license" file accompa... | 35.864234 | 79 | 0.629177 |
import random
import time
import functools
import math
import os
import stat
import string
import logging
import threading
import io
from collections import defaultdict
from ibm_s3transfer.compat import rename_file
from ibm_s3transfer.compat import seekable
MAX_PARTS = 10000
MAX_SINGLE_UPLOAD_SIZE = 5... | true | true |
f7f1ce7281fa5b405458e0d0b92c143b51dc8a2d | 4,866 | py | Python | DockerBuildSystem/DockerImageTools.py | hansehe/DockerBuildSystem | 18cbb3ee2ce3a26d4a43ba6a6921e64781c664a4 | [
"MIT"
] | 8 | 2018-05-19T17:19:52.000Z | 2020-01-08T15:19:07.000Z | DockerBuildSystem/DockerImageTools.py | hansehe/DockerBuildSystem | 18cbb3ee2ce3a26d4a43ba6a6921e64781c664a4 | [
"MIT"
] | null | null | null | DockerBuildSystem/DockerImageTools.py | hansehe/DockerBuildSystem | 18cbb3ee2ce3a26d4a43ba6a6921e64781c664a4 | [
"MIT"
] | 2 | 2018-10-16T20:59:59.000Z | 2021-09-22T23:40:26.000Z | from DockerBuildSystem import TerminalTools
import re
import json
def BuildImage(imageName, dockerfile = 'Dockerfile', context = '.'):
dockerCommand = "docker build -f " + dockerfile + " -t " + imageName + " " + context
TerminalTools.ExecuteTerminalCommands([dockerCommand], True)
def RunImage(imageName, pro... | 34.757143 | 122 | 0.711673 | from DockerBuildSystem import TerminalTools
import re
import json
def BuildImage(imageName, dockerfile = 'Dockerfile', context = '.'):
dockerCommand = "docker build -f " + dockerfile + " -t " + imageName + " " + context
TerminalTools.ExecuteTerminalCommands([dockerCommand], True)
def RunImage(imageName, pro... | true | true |
f7f1d0eea4d6d3b24a4f1cb8e65ac0460d0586ce | 1,444 | py | Python | TTS/utils/data.py | vigilancetrent/chatbot-advanced | 2e0c72c4df2e1434da995b7105f8f0414aba6248 | [
"Apache-2.0"
] | 52 | 2020-02-06T06:18:52.000Z | 2022-02-23T07:21:46.000Z | TTS/utils/data.py | vigilancetrent/chatbot-advanced | 2e0c72c4df2e1434da995b7105f8f0414aba6248 | [
"Apache-2.0"
] | 5 | 2020-11-20T11:26:23.000Z | 2021-12-01T14:22:44.000Z | TTS/utils/data.py | vigilancetrent/chatbot-advanced | 2e0c72c4df2e1434da995b7105f8f0414aba6248 | [
"Apache-2.0"
] | 20 | 2020-01-14T05:01:39.000Z | 2021-12-02T23:28:02.000Z | import numpy as np
def _pad_data(x, length):
_pad = 0
assert x.ndim == 1
return np.pad(
x, (0, length - x.shape[0]), mode='constant', constant_values=_pad)
def prepare_data(inputs):
max_len = max((len(x) for x in inputs))
return np.stack([_pad_data(x, max_len) for x in inputs])
def _pa... | 27.245283 | 77 | 0.625346 | import numpy as np
def _pad_data(x, length):
_pad = 0
assert x.ndim == 1
return np.pad(
x, (0, length - x.shape[0]), mode='constant', constant_values=_pad)
def prepare_data(inputs):
max_len = max((len(x) for x in inputs))
return np.stack([_pad_data(x, max_len) for x in inputs])
def _pa... | true | true |
f7f1d129fde87b4652263fe87307893d87c74610 | 8,822 | py | Python | authentication/migrations/0001_initial.py | danielmicaletti/Procurement-Order-Management-App | 0066e08c8ea18f10216489abe9b892bb6eb78c0e | [
"MIT"
] | null | null | null | authentication/migrations/0001_initial.py | danielmicaletti/Procurement-Order-Management-App | 0066e08c8ea18f10216489abe9b892bb6eb78c0e | [
"MIT"
] | null | null | null | authentication/migrations/0001_initial.py | danielmicaletti/Procurement-Order-Management-App | 0066e08c8ea18f10216489abe9b892bb6eb78c0e | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import authentication.models
import django.utils.timezone
from django.conf import settings
class Migration(migrations.Migration):
dependencies = [
]
operations = [
migrations.CreateModel(
... | 56.191083 | 209 | 0.600998 |
from __future__ import unicode_literals
from django.db import models, migrations
import authentication.models
import django.utils.timezone
from django.conf import settings
class Migration(migrations.Migration):
dependencies = [
]
operations = [
migrations.CreateModel(
name='Account... | true | true |
f7f1d1bfcffe4b960b34bcb0e59be3ff8fa63f89 | 5,719 | py | Python | sdk/python/pulumi_azure_nextgen/batchai/latest/experiment.py | test-wiz-sec/pulumi-azure-nextgen | 20a695af0d020b34b0f1c336e1b69702755174cc | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_nextgen/batchai/latest/experiment.py | test-wiz-sec/pulumi-azure-nextgen | 20a695af0d020b34b0f1c336e1b69702755174cc | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_nextgen/batchai/latest/experiment.py | test-wiz-sec/pulumi-azure-nextgen | 20a695af0d020b34b0f1c336e1b69702755174cc | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union
from ... import _utilities, _tables
__a... | 42.051471 | 244 | 0.650114 |
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union
from ... import _utilities, _tables
__all__ = ['Experiment']
class Experiment(pulumi.CustomResource):
def __init__(__self__,
resource_name: str,
opts: Optional[pulu... | true | true |
f7f1d287d17e74951bfcb1133d9083cab563a87b | 23,738 | py | Python | mlrun/runtimes/sparkjob/abstract.py | Hedingber/mlrun | e2269718fcc7caa7e1aa379ac28495830b45f9da | [
"Apache-2.0"
] | null | null | null | mlrun/runtimes/sparkjob/abstract.py | Hedingber/mlrun | e2269718fcc7caa7e1aa379ac28495830b45f9da | [
"Apache-2.0"
] | null | null | null | mlrun/runtimes/sparkjob/abstract.py | Hedingber/mlrun | e2269718fcc7caa7e1aa379ac28495830b45f9da | [
"Apache-2.0"
] | null | null | null | # Copyright 2018 Iguazio
#
# 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, softwa... | 34.960236 | 110 | 0.588803 |
import typing
from copy import deepcopy
from datetime import datetime
from typing import Dict, Optional, Tuple
from kubernetes import client
from kubernetes.client.rest import ApiException
from sqlalchemy.orm import Session
import mlrun.errors
from mlrun.api.db.base import DBInterface
from mlrun.config ... | true | true |
f7f1d34b943d038efbaf58cfb5b2f1283b2725df | 20,031 | py | Python | wandb/sdk/launch/_project_spec.py | BearerPipelineTest/client-2 | 2fc881cd72f79a44258f61f1c75c452ee1ff463f | [
"MIT"
] | null | null | null | wandb/sdk/launch/_project_spec.py | BearerPipelineTest/client-2 | 2fc881cd72f79a44258f61f1c75c452ee1ff463f | [
"MIT"
] | null | null | null | wandb/sdk/launch/_project_spec.py | BearerPipelineTest/client-2 | 2fc881cd72f79a44258f61f1c75c452ee1ff463f | [
"MIT"
] | null | null | null | """
Internal utility for converting arguments from a launch spec or call to wandb launch
into a runnable wandb launch script
"""
import enum
import json
import logging
import os
from shlex import quote
import tempfile
from typing import Any, Dict, Optional, Tuple
import wandb
from wandb.apis.internal import Api
impor... | 39.982036 | 176 | 0.608607 |
import enum
import json
import logging
import os
from shlex import quote
import tempfile
from typing import Any, Dict, Optional, Tuple
import wandb
from wandb.apis.internal import Api
import wandb.docker as docker
from wandb.errors import Error as ExecutionError, LaunchError
from wandb.sdk.lib.runid import generate_i... | true | true |
f7f1d377d4e6d52d6bcbdfe2f1ceceafe8796c5c | 585 | py | Python | myapp/management/commands/lock_level.py | singlasahil221/HackOn | 56c11af6b7485c4212a4083068f4c969ed025a26 | [
"MIT"
] | null | null | null | myapp/management/commands/lock_level.py | singlasahil221/HackOn | 56c11af6b7485c4212a4083068f4c969ed025a26 | [
"MIT"
] | 3 | 2021-03-19T22:53:10.000Z | 2021-06-10T22:22:18.000Z | myapp/management/commands/lock_level.py | singlasahil221/HackOn | 56c11af6b7485c4212a4083068f4c969ed025a26 | [
"MIT"
] | null | null | null | from django.core.management.base import BaseCommand
from myapp.models import Question
class Command(BaseCommand):
help = 'Unlock the levels.'
def add_arguments(self, parser):
parser.add_argument('level', type=int, help='Indicates the level of the question to be locked')
def handle(self, *args, **kwargs):
lev... | 30.789474 | 97 | 0.731624 | from django.core.management.base import BaseCommand
from myapp.models import Question
class Command(BaseCommand):
help = 'Unlock the levels.'
def add_arguments(self, parser):
parser.add_argument('level', type=int, help='Indicates the level of the question to be locked')
def handle(self, *args, **kwargs):
lev... | true | true |
f7f1d3fe0f470ee71a38a98da9702d089a2a7c85 | 6,104 | py | Python | sa/profiles/NAG/SNR/get_interfaces.py | xUndero/noc | 9fb34627721149fcf7064860bd63887e38849131 | [
"BSD-3-Clause"
] | 1 | 2019-09-20T09:36:48.000Z | 2019-09-20T09:36:48.000Z | sa/profiles/NAG/SNR/get_interfaces.py | ewwwcha/noc | aba08dc328296bb0e8e181c2ac9a766e1ec2a0bb | [
"BSD-3-Clause"
] | null | null | null | sa/profiles/NAG/SNR/get_interfaces.py | ewwwcha/noc | aba08dc328296bb0e8e181c2ac9a766e1ec2a0bb | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
# ---------------------------------------------------------------------
# NAG.SNR.get_interfaces
# ---------------------------------------------------------------------
# Copyright (C) 2007-2019 The NOC Project
# See LICENSE for details
# ---------------------------------------------------------... | 43.6 | 106 | 0.506225 |
import re
from noc.core.script.base import BaseScript
from noc.sa.interfaces.igetinterfaces import IGetInterfaces
from noc.core.ip import IPv4
class Script(BaseScript):
name = "NAG.SNR.get_interfaces"
cache = True
interface = IGetInterfaces
rx_lldp_en = re.compile(r"LLDP has been enabled gl... | true | true |
f7f1d53b2524d2abd987f19ca44453374695bc89 | 3,843 | py | Python | azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/virtual_machine_scale_set_os_disk.py | JonathanGailliez/azure-sdk-for-python | f0f051bfd27f8ea512aea6fc0c3212ee9ee0029b | [
"MIT"
] | 1 | 2022-03-30T22:39:15.000Z | 2022-03-30T22:39:15.000Z | azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/virtual_machine_scale_set_os_disk.py | JonathanGailliez/azure-sdk-for-python | f0f051bfd27f8ea512aea6fc0c3212ee9ee0029b | [
"MIT"
] | 54 | 2016-03-25T17:25:01.000Z | 2018-10-22T17:27:54.000Z | azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/virtual_machine_scale_set_os_disk.py | JonathanGailliez/azure-sdk-for-python | f0f051bfd27f8ea512aea6fc0c3212ee9ee0029b | [
"MIT"
] | 2 | 2017-01-20T18:25:46.000Z | 2017-05-12T21:31:47.000Z | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... | 49.269231 | 102 | 0.669009 |
from msrest.serialization import Model
class VirtualMachineScaleSetOSDisk(Model):
_validation = {
'create_option': {'required': True},
}
_attribute_map = {
'name': {'key': 'name', 'type': 'str'},
'caching': {'key': 'caching', 'type': 'CachingTypes'},
'create_op... | true | true |
f7f1d5502f6fa8ac816bfdf812b1e4071180d58e | 1,164 | py | Python | features/steps/asserts.py | cloose/ray-tracer-challenge | 5e9dd56fb67c5cba47172986a963fc22a8cbcaa2 | [
"MIT"
] | null | null | null | features/steps/asserts.py | cloose/ray-tracer-challenge | 5e9dd56fb67c5cba47172986a963fc22a8cbcaa2 | [
"MIT"
] | null | null | null | features/steps/asserts.py | cloose/ray-tracer-challenge | 5e9dd56fb67c5cba47172986a963fc22a8cbcaa2 | [
"MIT"
] | null | null | null | _EPSILON = 0.00001
def assert_count(collection, count):
"""Asserts number of items in the collection."""
assert len(collection) == count, \
f"count {len(collection)} is not equal to {count}"
def assert_float(actual, expected):
"""Asserts that two floats are equal."""
assert equal(actual,... | 29.1 | 83 | 0.615979 | _EPSILON = 0.00001
def assert_count(collection, count):
assert len(collection) == count, \
f"count {len(collection)} is not equal to {count}"
def assert_float(actual, expected):
assert equal(actual, expected), \
f"{actual} is not {expected}"
def assert_tuple(actual, expected):
... | true | true |
f7f1d72a238abebb69cfe9e6339950e059e97ad2 | 624 | py | Python | cobrakbase/core/kbasefbatemplate.py | cshenry/cobrakbase | 9ab3db059171e7532082646302db22338ab61a55 | [
"MIT"
] | null | null | null | cobrakbase/core/kbasefbatemplate.py | cshenry/cobrakbase | 9ab3db059171e7532082646302db22338ab61a55 | [
"MIT"
] | null | null | null | cobrakbase/core/kbasefbatemplate.py | cshenry/cobrakbase | 9ab3db059171e7532082646302db22338ab61a55 | [
"MIT"
] | null | null | null | from cobrakbase.core.kbaseobject import KBaseObjectBase
from cobrakbase.core.utils import get_id_from_ref
class NewModelTemplate(KBaseObjectBase):
def new(id, name):
return {
'biochemistry_ref': "489/6/6",
'biomasses': [],
'compartments': [],
'comp... | 26 | 55 | 0.458333 | from cobrakbase.core.kbaseobject import KBaseObjectBase
from cobrakbase.core.utils import get_id_from_ref
class NewModelTemplate(KBaseObjectBase):
def new(id, name):
return {
'biochemistry_ref': "489/6/6",
'biomasses': [],
'compartments': [],
'comp... | true | true |
f7f1da069cc97e7b5c87df2d0d67d048201cb75d | 2,448 | py | Python | dizoo/box2d/lunarlander/config/lunarlander_dqn_config.py | konnase/DI-engine | f803499cad191e9277b10e194132d74757bcfc8e | [
"Apache-2.0"
] | null | null | null | dizoo/box2d/lunarlander/config/lunarlander_dqn_config.py | konnase/DI-engine | f803499cad191e9277b10e194132d74757bcfc8e | [
"Apache-2.0"
] | null | null | null | dizoo/box2d/lunarlander/config/lunarlander_dqn_config.py | konnase/DI-engine | f803499cad191e9277b10e194132d74757bcfc8e | [
"Apache-2.0"
] | null | null | null | from easydict import EasyDict
from ding.entry import serial_pipeline
nstep = 3
lunarlander_dqn_default_config = dict(
env=dict(
# Whether to use shared memory. Only effective if "env_manager_type" is 'subprocess'
manager=dict(shared_memory=True, ),
# Env number respectively for collector an... | 31.792208 | 92 | 0.604167 | from easydict import EasyDict
from ding.entry import serial_pipeline
nstep = 3
lunarlander_dqn_default_config = dict(
env=dict(
manager=dict(shared_memory=True, ),
collector_env_num=8,
evaluator_env_num=5,
n_evaluator_episode=5,
stop_value=200,
),
p... | true | true |
f7f1da41a1909260bbd83fee7efec53538a5f960 | 775 | py | Python | var/spack/repos/builtin/packages/memaxes/package.py | xiki-tempula/spack | 9d66c05e93ab8a933fc59915040c0e0c86a4aac4 | [
"ECL-2.0",
"Apache-2.0",
"MIT"
] | 9 | 2018-04-18T07:51:40.000Z | 2021-09-10T03:56:57.000Z | var/spack/repos/builtin/packages/memaxes/package.py | xiki-tempula/spack | 9d66c05e93ab8a933fc59915040c0e0c86a4aac4 | [
"ECL-2.0",
"Apache-2.0",
"MIT"
] | 907 | 2018-04-18T11:17:57.000Z | 2022-03-31T13:20:25.000Z | var/spack/repos/builtin/packages/memaxes/package.py | xiki-tempula/spack | 9d66c05e93ab8a933fc59915040c0e0c86a4aac4 | [
"ECL-2.0",
"Apache-2.0",
"MIT"
] | 29 | 2018-11-05T16:14:23.000Z | 2022-02-03T16:07:09.000Z | # Copyright 2013-2020 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class Memaxes(Package):
"""MemAxes is a visualizer for sampled memory trace data."""
homepa... | 31 | 93 | 0.672258 |
from spack import *
class Memaxes(Package):
homepage = "https://github.com/llnl/MemAxes"
version('0.5', sha256='9858f0f675b50e347d0b88545558e5d6b4333347c762b15d399b8d8004d7b68b',
url='https://github.com/llnl/MemAxes/archive/v0.5.tar.gz')
depends_on('cmake@2.8.9:', type='build')
dep... | true | true |
f7f1daaad689a8a86add1625c0046f62078cd564 | 339 | py | Python | test2.py | treischl/so-sal-calc | c5f23d9d5879a26c6ad622b05c31236e79bb9f05 | [
"MIT"
] | null | null | null | test2.py | treischl/so-sal-calc | c5f23d9d5879a26c6ad622b05c31236e79bb9f05 | [
"MIT"
] | null | null | null | test2.py | treischl/so-sal-calc | c5f23d9d5879a26c6ad622b05c31236e79bb9f05 | [
"MIT"
] | null | null | null | from data import Database
from stackoverflow import SalaryCalculator
salcalc = SalaryCalculator()
with Database('debug.db') as db:
unpulled_salaries = db.read_unpulled_salaries()
for sal in unpulled_salaries:
amt = salcalc.pull_salary(sal[1], sal[2], sal[3], sal[4], sal[5])
db.update_pulled_s... | 28.25 | 73 | 0.716814 | from data import Database
from stackoverflow import SalaryCalculator
salcalc = SalaryCalculator()
with Database('debug.db') as db:
unpulled_salaries = db.read_unpulled_salaries()
for sal in unpulled_salaries:
amt = salcalc.pull_salary(sal[1], sal[2], sal[3], sal[4], sal[5])
db.update_pulled_s... | true | true |
f7f1dabf6cbcb685f92b19eec3f71a0cb678ce25 | 810 | py | Python | mmdet/models/__init__.py | apulis/ApulisVision | d1f226f4bc769b03c5565b9d6e76dd9823771cc7 | [
"Apache-2.0"
] | 1 | 2020-09-09T05:10:39.000Z | 2020-09-09T05:10:39.000Z | mmdet/models/__init__.py | apulis/ApulisVision | d1f226f4bc769b03c5565b9d6e76dd9823771cc7 | [
"Apache-2.0"
] | null | null | null | mmdet/models/__init__.py | apulis/ApulisVision | d1f226f4bc769b03c5565b9d6e76dd9823771cc7 | [
"Apache-2.0"
] | 1 | 2021-03-31T02:00:13.000Z | 2021-03-31T02:00:13.000Z | from .backbones import * # noqa: F401,F403
from .builder import (BACKBONES, DETECTORS, HEADS, LOSSES, NECKS,
ROI_EXTRACTORS, SHARED_HEADS, build_backbone,
build_detector, build_head, build_loss, build_neck,
build_roi_extractor, build_shared_head)
from .... | 28.928571 | 73 | 0.633333 | from .backbones import *
from .builder import (BACKBONES, DETECTORS, HEADS, LOSSES, NECKS,
ROI_EXTRACTORS, SHARED_HEADS, build_backbone,
build_detector, build_head, build_loss, build_neck,
build_roi_extractor, build_shared_head)
from .dense_heads impor... | true | true |
f7f1db088a10030e5b57cb021b5dd81f99400f27 | 178 | py | Python | cloudfn/hooks/hook-google.cloud.dns.py | MartinSahlen/python-cloud-fn | 97f74f375485972e999d2ec6d8feabf61604a78e | [
"MIT"
] | 230 | 2017-05-02T10:25:13.000Z | 2021-12-25T18:02:26.000Z | cloudfn/hooks/hook-google.cloud.dns.py | MartinSahlen/python-cloud-fn | 97f74f375485972e999d2ec6d8feabf61604a78e | [
"MIT"
] | 50 | 2017-05-22T07:39:56.000Z | 2021-06-10T18:43:37.000Z | cloudfn/hooks/hook-google.cloud.dns.py | MartinSahlen/python-cloud-fn | 97f74f375485972e999d2ec6d8feabf61604a78e | [
"MIT"
] | 38 | 2017-05-28T21:53:17.000Z | 2021-06-03T12:18:22.000Z | from PyInstaller.utils.hooks import copy_metadata
datas = copy_metadata('google-cloud-dns')
datas += copy_metadata('google-cloud-core')
datas += copy_metadata('google-api-core') | 35.6 | 49 | 0.786517 | from PyInstaller.utils.hooks import copy_metadata
datas = copy_metadata('google-cloud-dns')
datas += copy_metadata('google-cloud-core')
datas += copy_metadata('google-api-core') | true | true |
f7f1dbd4ac3eaa44c0482496d00c07bc49f4079a | 1,884 | py | Python | package/spack-diffsplice/package.py | ctuning/ck-spack | 307934efce1be2d4f104251275c82fbc70127105 | [
"BSD-3-Clause"
] | 1 | 2018-07-17T07:45:09.000Z | 2018-07-17T07:45:09.000Z | package/spack-diffsplice/package.py | ctuning/ck-spack | 307934efce1be2d4f104251275c82fbc70127105 | [
"BSD-3-Clause"
] | null | null | null | package/spack-diffsplice/package.py | ctuning/ck-spack | 307934efce1be2d4f104251275c82fbc70127105 | [
"BSD-3-Clause"
] | null | null | null | ##############################################################################
# Copyright (c) 2013-2018, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
# This file is part of Spack.
# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
# LLNL-CODE-64... | 44.857143 | 94 | 0.687367 | true | true | |
f7f1dca7b1383d07a9383b44c289ab0346be43e2 | 55 | py | Python | Hello.py | Silvio622/pands-problems-2020 | 7a9c93b513c881eaf80f20ed4e6e7d2969883596 | [
"MIT"
] | null | null | null | Hello.py | Silvio622/pands-problems-2020 | 7a9c93b513c881eaf80f20ed4e6e7d2969883596 | [
"MIT"
] | null | null | null | Hello.py | Silvio622/pands-problems-2020 | 7a9c93b513c881eaf80f20ed4e6e7d2969883596 | [
"MIT"
] | null | null | null | print("Hello world")
print(1+2)
print(123567*674635)
| 9.166667 | 20 | 0.709091 | print("Hello world")
print(1+2)
print(123567*674635)
| true | true |
f7f1dd0487520c0431d0fc15c6a5c169995c2fcd | 3,413 | py | Python | app/app/settings.py | hellowin6076/recipe-app-api | bbc83577554199ca60dca266bda51b3ed5b2bb3c | [
"MIT"
] | null | null | null | app/app/settings.py | hellowin6076/recipe-app-api | bbc83577554199ca60dca266bda51b3ed5b2bb3c | [
"MIT"
] | null | null | null | app/app/settings.py | hellowin6076/recipe-app-api | bbc83577554199ca60dca266bda51b3ed5b2bb3c | [
"MIT"
] | null | null | null | """
Django settings for app project.
Generated by 'django-admin startproject' using Django 2.1.15.
For more information on this file, see
https://docs.djangoproject.com/en/2.1/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/2.1/ref/settings/
"""
import os
# Bu... | 25.281481 | 91 | 0.6862 |
import os
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
SECRET_KEY = '8c(x=#675c78g90$6ritywpv2_=kpza8lxkx))$l!ct+shb17*'
DEBUG = True
ALLOWED_HOSTS = []
# Application definition
INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.content... | true | true |
f7f1dd3010df6bfe96e8cb6a837e3260e952726e | 2,606 | py | Python | tests/test_basic.py | jacksontj/dagyr | 1ffbf209e741d74f8f84d3fb7bef2e1039ace7dc | [
"MIT"
] | null | null | null | tests/test_basic.py | jacksontj/dagyr | 1ffbf209e741d74f8f84d3fb7bef2e1039ace7dc | [
"MIT"
] | null | null | null | tests/test_basic.py | jacksontj/dagyr | 1ffbf209e741d74f8f84d3fb7bef2e1039ace7dc | [
"MIT"
] | null | null | null | import unittest
import dagyr.dag
class TestBasic(unittest.TestCase):
def setUp(self):
# TODO: helper method to load files
self.dagyr_config = dagyr.dag.Dagyr.from_file(
'/home/jacksontj/src/dagyr/tests/files/basic.yaml',
)
def _condense_path(self, path):
'''Conden... | 28.955556 | 165 | 0.52264 | import unittest
import dagyr.dag
class TestBasic(unittest.TestCase):
def setUp(self):
self.dagyr_config = dagyr.dag.Dagyr.from_file(
'/home/jacksontj/src/dagyr/tests/files/basic.yaml',
)
def _condense_path(self, path):
condensed_path = []
for node_map in ... | true | true |
f7f1df2c81c85592f472d11ff32ecba086338987 | 1,418 | py | Python | site_Fakku.py | Plurmp/license-checker | 1679f1513b7aac11c30ab56ea6d63b3b607b6254 | [
"FTL",
"CNRI-Python",
"Linux-OpenIB"
] | null | null | null | site_Fakku.py | Plurmp/license-checker | 1679f1513b7aac11c30ab56ea6d63b3b607b6254 | [
"FTL",
"CNRI-Python",
"Linux-OpenIB"
] | null | null | null | site_Fakku.py | Plurmp/license-checker | 1679f1513b7aac11c30ab56ea6d63b3b607b6254 | [
"FTL",
"CNRI-Python",
"Linux-OpenIB"
] | null | null | null | #!/usr/bin/env python3.7
import sys
import asyncio
import aiohttp
from bs4 import BeautifulSoup
name = "Fakku"
async def get_manga_by_author(author):
results = list()
page = 1
async with aiohttp.ClientSession() as session:
status, text = await fetch_page(session, author, page)
# It is noteworthy that FAKKU ... | 28.938776 | 99 | 0.720028 |
import sys
import asyncio
import aiohttp
from bs4 import BeautifulSoup
name = "Fakku"
async def get_manga_by_author(author):
results = list()
page = 1
async with aiohttp.ClientSession() as session:
status, text = await fetch_page(session, author, page)
while "There is no content available at th... | true | true |
f7f1df964196307fdbf4f3bac5dcbf843375e126 | 3,565 | py | Python | scripts/tf_broadcaster.py | Uthreloss/Master-Dissertation | 419faf97d72c762453a3df169d06ad8e7e3daf93 | [
"BSD-2-Clause"
] | null | null | null | scripts/tf_broadcaster.py | Uthreloss/Master-Dissertation | 419faf97d72c762453a3df169d06ad8e7e3daf93 | [
"BSD-2-Clause"
] | null | null | null | scripts/tf_broadcaster.py | Uthreloss/Master-Dissertation | 419faf97d72c762453a3df169d06ad8e7e3daf93 | [
"BSD-2-Clause"
] | null | null | null | #!/usr/bin/env python
import roslib #Ros libraries
import rospy #Python library
import tf #ROS Transform library
import body_tracker_msgs.msg #Astra Orbbec messages ALL OF THEM BodyTracker & Skeleton check: https://github.com/shinselrobots/body_tracker_msgs/tree/master/msg
class tf_broadcaster():
def __init__(se... | 45.705128 | 200 | 0.637868 |
import roslib
import rospy
import tf
import body_tracker_msgs.msg
class tf_broadcaster():
def __init__(self):
| true | true |
f7f1e05050dc7b03e7375c26f33d27bad2a40e13 | 211 | py | Python | WEEKS/CD_Sata-Structures/general/practice/PYTHON/removeDuplicateStrings.py | webdevhub42/Lambda | b04b84fb5b82fe7c8b12680149e25ae0d27a0960 | [
"MIT"
] | 11 | 2021-02-18T04:53:44.000Z | 2022-01-16T10:57:39.000Z | WEEKS/CD_Sata-Structures/general/practice/PYTHON/removeDuplicateStrings.py | webdevhub42/Lambda | b04b84fb5b82fe7c8b12680149e25ae0d27a0960 | [
"MIT"
] | 162 | 2021-03-09T01:52:11.000Z | 2022-03-12T01:09:07.000Z | WEEKS/CD_Sata-Structures/general/practice/PYTHON/removeDuplicateStrings.py | webdevhub42/Lambda | b04b84fb5b82fe7c8b12680149e25ae0d27a0960 | [
"MIT"
] | 8 | 2021-02-18T05:12:34.000Z | 2022-03-06T19:02:14.000Z | # def removeDuplicateStrings(a):
# return list(OrderedDict.fromkeys(a))
# 64
# removeDuplicateStrings = lambda a: list(OrderedDict.fromkeys(a))
# 60
return list(OrderedDict.fromkeys(*eval(dir()[0])))
# 49
| 21.1 | 66 | 0.720379 |
return list(OrderedDict.fromkeys(*eval(dir()[0])))
| true | true |
f7f1e08c53ef45269fd5719f6fc97420ba6189e5 | 1,499 | py | Python | clustergrammer/upload_pages/clustergrammer/load_data.py | delosrogers/clustergrammer-web | 14102cfca328214d3bc8285e8331663fe0e5fad4 | [
"MIT"
] | 5 | 2018-04-04T16:25:06.000Z | 2021-04-10T23:47:20.000Z | clustergrammer/upload_pages/clustergrammer/load_data.py | delosrogers/clustergrammer-web | 14102cfca328214d3bc8285e8331663fe0e5fad4 | [
"MIT"
] | 8 | 2016-07-16T02:55:12.000Z | 2022-02-02T16:42:17.000Z | clustergrammer/upload_pages/clustergrammer/load_data.py | delosrogers/clustergrammer-web | 14102cfca328214d3bc8285e8331663fe0e5fad4 | [
"MIT"
] | 4 | 2019-05-28T08:52:41.000Z | 2021-01-11T22:14:48.000Z | def load_file(net, filename):
import StringIO
f = open(filename, 'r')
buff = StringIO.StringIO(f.read())
f.close()
net.load_tsv_to_net(buff)
def load_tsv_to_net(net, file_buffer):
import pandas as pd
import categories
lines = file_buffer.getvalue().split('\n')
num_labels = categories.check_categorie... | 26.298246 | 70 | 0.668446 | def load_file(net, filename):
import StringIO
f = open(filename, 'r')
buff = StringIO.StringIO(f.read())
f.close()
net.load_tsv_to_net(buff)
def load_tsv_to_net(net, file_buffer):
import pandas as pd
import categories
lines = file_buffer.getvalue().split('\n')
num_labels = categories.check_categorie... | true | true |
f7f1e0ae04e481f1c6a6d5195f7e7209eccbbe40 | 9,734 | py | Python | pyvolume/manager.py | ronin13/pyvolume | 10a4d82faec42f33ccb8c91fbddf343a78e6dc3e | [
"MIT"
] | 2 | 2017-05-10T18:31:25.000Z | 2020-03-27T00:59:53.000Z | pyvolume/manager.py | ronin13/pyvolume | 10a4d82faec42f33ccb8c91fbddf343a78e6dc3e | [
"MIT"
] | 645 | 2016-12-05T08:19:05.000Z | 2022-03-31T02:50:33.000Z | pyvolume/manager.py | ronin13/pyvolume | 10a4d82faec42f33ccb8c91fbddf343a78e6dc3e | [
"MIT"
] | 3 | 2016-12-12T00:18:01.000Z | 2020-04-08T17:40:16.000Z | # -*- coding: utf-8 -*-
""" Module providing the MountMgr, VolumeManager and Flask methods.
Following Docker Volume endpoints are routed below:
'/Plugin.Activate'
'/VolumeDriver.Create'
'/VolumeDriver.Remove'
'/VolumeDriver.List'
'/VolumeDriver.Path'
'/VolumeDriver.Mount'
'/VolumeDriver.Unm... | 27.266106 | 96 | 0.599343 |
from __future__ import unicode_literals
from __future__ import absolute_import
import argparse
import logging
from flask import Flask
from flask import jsonify
from flask import request
from pyvolume.local import EphemeralFileSystem
from pyvolume.sshfs import SSHFileSystem
from pyvolume.zkfuse import ZKFileSystem
... | true | true |
f7f1e17ffe506c8937b99a27e8686c64e0e9634f | 345 | py | Python | molmodel/io/to_atom.py | uibcdf/MolModEl | b42139d648ec691889d3b4004cae10fcce723ca5 | [
"MIT"
] | null | null | null | molmodel/io/to_atom.py | uibcdf/MolModEl | b42139d648ec691889d3b4004cae10fcce723ca5 | [
"MIT"
] | null | null | null | molmodel/io/to_atom.py | uibcdf/MolModEl | b42139d648ec691889d3b4004cae10fcce723ca5 | [
"MIT"
] | null | null | null |
def from_bioassembly(bioassembly):
list_atoms = []
if type(bioassembly) in ['list','tuple']:
bioassemblies = bioassembly
else:
bioassemblies = list(bioassembly)
for tmp_bioassembly in bioassemblies:
for tmp_atom in tmp_bioassembly.atom:
list_atoms.append(tmp_atom)... | 20.294118 | 45 | 0.663768 |
def from_bioassembly(bioassembly):
list_atoms = []
if type(bioassembly) in ['list','tuple']:
bioassemblies = bioassembly
else:
bioassemblies = list(bioassembly)
for tmp_bioassembly in bioassemblies:
for tmp_atom in tmp_bioassembly.atom:
list_atoms.append(tmp_atom)... | true | true |
f7f1e31490d552ad6c8b335c1b33e35bf9246f61 | 21,937 | py | Python | bemoss_lib/databases/cassandraAPI/cassandraDB.py | ajfar-bem/wisebldg | 0cb8ef7c5984cbb5cc86e40780fdf4e14e5bda05 | [
"Unlicense"
] | null | null | null | bemoss_lib/databases/cassandraAPI/cassandraDB.py | ajfar-bem/wisebldg | 0cb8ef7c5984cbb5cc86e40780fdf4e14e5bda05 | [
"Unlicense"
] | null | null | null | bemoss_lib/databases/cassandraAPI/cassandraDB.py | ajfar-bem/wisebldg | 0cb8ef7c5984cbb5cc86e40780fdf4e14e5bda05 | [
"Unlicense"
] | null | null | null | # -*- coding: utf-8 -*-
'''
Copyright (c) 2016, Virginia Tech
All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the
following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this list of condi... | 42.186538 | 218 | 0.661531 |
'''
Copyright (c) 2016, Virginia Tech
All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the
following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following... | false | true |
f7f1e3714c4627c147ecd2f9edf58439a14dd818 | 1,105 | py | Python | tests/integration/api/routers/todo/conftest.py | GArmane/python-fastapi-hex-todo | f54fbe0ecd6e158c1ed54a9a7a8ed6bd9d96d39d | [
"MIT"
] | 60 | 2020-03-27T10:06:47.000Z | 2022-03-23T23:05:12.000Z | tests/integration/api/routers/todo/conftest.py | GArmane/python-fastapi-hex-todo | f54fbe0ecd6e158c1ed54a9a7a8ed6bd9d96d39d | [
"MIT"
] | null | null | null | tests/integration/api/routers/todo/conftest.py | GArmane/python-fastapi-hex-todo | f54fbe0ecd6e158c1ed54a9a7a8ed6bd9d96d39d | [
"MIT"
] | 11 | 2020-03-22T01:31:20.000Z | 2021-12-20T21:03:20.000Z | from functools import partial
import pytest
from pytest_factoryboy import register
from tests.factories.entity_factories import (
CreateTodoItemDtoFactory,
TodoItemFactory,
UpdateTodoItemDtoFactory,
)
from tests.factories.utils import make_many
FACTORIES = [
CreateTodoItemDtoFactory,
TodoItemFact... | 21.666667 | 59 | 0.809955 | from functools import partial
import pytest
from pytest_factoryboy import register
from tests.factories.entity_factories import (
CreateTodoItemDtoFactory,
TodoItemFactory,
UpdateTodoItemDtoFactory,
)
from tests.factories.utils import make_many
FACTORIES = [
CreateTodoItemDtoFactory,
TodoItemFact... | true | true |
f7f1e3cfbeeb59a17a79dd70a952e2005c0da58b | 102,338 | py | Python | tensorflow/lite/python/lite_test.py | seo-inyoung/tensorflow | e5dfc3bc38696060922b4d8a04d6e773467b9f08 | [
"Apache-2.0"
] | null | null | null | tensorflow/lite/python/lite_test.py | seo-inyoung/tensorflow | e5dfc3bc38696060922b4d8a04d6e773467b9f08 | [
"Apache-2.0"
] | null | null | null | tensorflow/lite/python/lite_test.py | seo-inyoung/tensorflow | e5dfc3bc38696060922b4d8a04d6e773467b9f08 | [
"Apache-2.0"
] | 1 | 2020-08-13T22:25:30.000Z | 2020-08-13T22:25:30.000Z | # Lint as: python2, python3
# Copyright 2018 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
... | 42.027926 | 105 | 0.692519 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import io
import logging
import os
import tempfile
from absl.testing import parameterized
import numpy as np
import six
from six.moves import range
from tensorflow.lite.python import lite
from... | true | true |
f7f1e4f1bbe194a5b8d6f653afaeebd931f7fbfd | 27,282 | py | Python | sympy/physics/mechanics/kane.py | gum3ng/sympy | e9414fafa976b26aa0b701a0217ab0f3b561989f | [
"BSD-3-Clause"
] | 1 | 2020-09-09T20:40:17.000Z | 2020-09-09T20:40:17.000Z | sympy/physics/mechanics/kane.py | gum3ng/sympy | e9414fafa976b26aa0b701a0217ab0f3b561989f | [
"BSD-3-Clause"
] | 14 | 2018-02-08T10:11:03.000Z | 2019-04-16T10:32:46.000Z | sympy/physics/mechanics/kane.py | gum3ng/sympy | e9414fafa976b26aa0b701a0217ab0f3b561989f | [
"BSD-3-Clause"
] | 1 | 2020-09-09T20:41:34.000Z | 2020-09-09T20:41:34.000Z | from sympy.core.backend import zeros, Matrix, diff, eye
from sympy.core.sorting import default_sort_key
from sympy.solvers.solvers import solve_linear_system_LU
from sympy.physics.vector import (ReferenceFrame, dynamicsymbols,
partial_velocity)
from sympy.physics.mechanics.method impor... | 40.53789 | 83 | 0.587787 | from sympy.core.backend import zeros, Matrix, diff, eye
from sympy.core.sorting import default_sort_key
from sympy.solvers.solvers import solve_linear_system_LU
from sympy.physics.vector import (ReferenceFrame, dynamicsymbols,
partial_velocity)
from sympy.physics.mechanics.method impor... | true | true |
f7f1e65621c19787e7f839a983249f98561c6fc3 | 1,326 | py | Python | app/core/tests/test_admin.py | baothi/recipe-app-api | c684e04585cb603587670bafbe07a29a6adc866b | [
"MIT"
] | null | null | null | app/core/tests/test_admin.py | baothi/recipe-app-api | c684e04585cb603587670bafbe07a29a6adc866b | [
"MIT"
] | null | null | null | app/core/tests/test_admin.py | baothi/recipe-app-api | c684e04585cb603587670bafbe07a29a6adc866b | [
"MIT"
] | null | null | null | from django.test import TestCase,Client
from django.contrib.auth import get_user_model
from django.urls import reverse
class AdminSiteTests(TestCase):
def setUp(self):
self.client = Client()
self.admin_user = get_user_model().objects.create_superuser(
email='admin@gmail.com',
... | 31.571429 | 68 | 0.636501 | from django.test import TestCase,Client
from django.contrib.auth import get_user_model
from django.urls import reverse
class AdminSiteTests(TestCase):
def setUp(self):
self.client = Client()
self.admin_user = get_user_model().objects.create_superuser(
email='admin@gmail.com',
... | true | true |
f7f1e6b77e91d2bc0075dbead0fdcb341a366910 | 7,846 | py | Python | stats/views.py | riklaunim/django-basic-stats | 3b9b66465193e0c685d054086d65fa1ecdbda15c | [
"MIT"
] | 3 | 2019-03-18T15:37:45.000Z | 2022-02-23T02:52:39.000Z | stats/views.py | Aakash007-ai/django-basic-stats | e5b8f08cef1e069be7b9d43077d081024332d25a | [
"MIT"
] | 3 | 2017-01-31T10:41:50.000Z | 2022-02-24T15:04:05.000Z | stats/views.py | Aakash007-ai/django-basic-stats | e5b8f08cef1e069be7b9d43077d081024332d25a | [
"MIT"
] | 6 | 2016-05-14T09:26:37.000Z | 2020-12-26T13:06:37.000Z | #!/usr/bin/python
import collections
from datetime import date
import urllib
from django.contrib.admin.views.decorators import staff_member_required
from django.contrib.sites.models import Site
from django.db.models import Q
from django.db.models import Count
from django.http import HttpResponse
from collections impor... | 39.034826 | 89 | 0.674866 |
import collections
from datetime import date
import urllib
from django.contrib.admin.views.decorators import staff_member_required
from django.contrib.sites.models import Site
from django.db.models import Q
from django.db.models import Count
from django.http import HttpResponse
from collections import OrderedDict
fro... | true | true |
f7f1e721fb0618403beececbf17236b7dd2ceac6 | 4,306 | py | Python | scripts/aave_borrow.py | FaberNovum/aave_brownie_py | 06e6b828a207cfc1555f2003df2343bc4861daca | [
"MIT"
] | 33 | 2021-06-04T22:03:36.000Z | 2022-03-12T06:16:44.000Z | scripts/aave_borrow.py | FaberNovum/aave_brownie_py | 06e6b828a207cfc1555f2003df2343bc4861daca | [
"MIT"
] | 15 | 2021-06-09T08:32:13.000Z | 2022-03-07T14:28:03.000Z | scripts/aave_borrow.py | FaberNovum/aave_brownie_py | 06e6b828a207cfc1555f2003df2343bc4861daca | [
"MIT"
] | 32 | 2021-05-07T01:35:16.000Z | 2022-03-20T23:43:08.000Z | from brownie import accounts, config, interface, network
from web3 import Web3
from scripts.get_weth import get_weth
amount = Web3.toWei(0.1, "ether")
def main():
account = get_account()
erc20_address = config["networks"][network.show_active()]["weth_token"]
if network.show_active() in ["mainnet-fork"]:
... | 34.174603 | 86 | 0.697399 | from brownie import accounts, config, interface, network
from web3 import Web3
from scripts.get_weth import get_weth
amount = Web3.toWei(0.1, "ether")
def main():
account = get_account()
erc20_address = config["networks"][network.show_active()]["weth_token"]
if network.show_active() in ["mainnet-fork"]:
... | true | true |
f7f1e77b4615008981a2e580d6d73fff9927e91f | 1,274 | py | Python | src/utils/utils.py | yDon96/pepper_assistant | cc079e9c6e93afae513625ee4803e3c5c75ce5b6 | [
"MIT"
] | null | null | null | src/utils/utils.py | yDon96/pepper_assistant | cc079e9c6e93afae513625ee4803e3c5c75ce5b6 | [
"MIT"
] | 4 | 2022-02-01T15:13:13.000Z | 2022-02-07T10:26:12.000Z | src/utils/utils.py | yDon96/pepper_assistant | cc079e9c6e93afae513625ee4803e3c5c75ce5b6 | [
"MIT"
] | null | null | null | import numpy as np
def batch_cosine_similarity(x1, x2):
'''
x1,x2 must be l2 normalized
'''
# https://en.wikipedia.org/wiki/Cosine_similarity
# 1 = equal direction ; -1 = opposite direction
mul = np.multiply(x1, x2)
s = np.sum(mul, axis=1)
# l1 = np.sum(np.multiply(x1, x1),axis=1)... | 24.980392 | 80 | 0.546311 | import numpy as np
def batch_cosine_similarity(x1, x2):
mul = np.multiply(x1, x2)
s = np.sum(mul, axis=1)
return s
def dist2id(distance, y, ths, norm=False, mode='avg', filter_under_th=True):
d = distance.copy()
ths = np.array([ths]*len(y))
y = np.array(y)
# re... | true | true |
f7f1e7866ca31bab267abd0ba05b38b12a4e0d80 | 18,705 | py | Python | selfdrive/manager.py | jeroenbbb/openpilot | 4a2ff784f85ac87a4aa9ba8a345c2403102f960a | [
"MIT"
] | null | null | null | selfdrive/manager.py | jeroenbbb/openpilot | 4a2ff784f85ac87a4aa9ba8a345c2403102f960a | [
"MIT"
] | null | null | null | selfdrive/manager.py | jeroenbbb/openpilot | 4a2ff784f85ac87a4aa9ba8a345c2403102f960a | [
"MIT"
] | null | null | null | #!/usr/bin/env python3.5
# manager will start all requird processes (Python, C, C++)
# for testing see also https://medium.com/@comma_ai/open-sourcing-openpilot-development-tools-a5bc427867b6
import os
import sys
import fcntl
import errno
import signal
import subprocess
#import logging
#instead of setting the PYTHO... | 30.316045 | 125 | 0.677038 |
import os
import sys
import fcntl
import errno
import signal
import subprocess
sys.path.append("/home/pi/openpilot")
from common.basedir import BASEDIR
sys.path.append(os.path.join(BASEDIR, "pyextra"))
os.environ['BASEDIR'] = BASEDIR
def unblock_stdout():
child_pid, child_pty = os.forkpty()
if child_p... | true | true |
f7f1e7fc5443f55b6b78ae3294575b9d98ef29be | 538 | py | Python | manage.py | leeSmall/mz_api | 70fc39960eb69ea0b6cef311a6b97c9e38527eb6 | [
"Apache-2.0"
] | 1 | 2019-11-21T14:47:45.000Z | 2019-11-21T14:47:45.000Z | manage.py | leeSmall/mz_api | 70fc39960eb69ea0b6cef311a6b97c9e38527eb6 | [
"Apache-2.0"
] | 1 | 2019-09-06T10:09:35.000Z | 2019-09-06T10:09:35.000Z | manage.py | leeSmall/mz_api | 70fc39960eb69ea0b6cef311a6b97c9e38527eb6 | [
"Apache-2.0"
] | 2 | 2019-07-21T04:03:51.000Z | 2019-08-21T16:02:14.000Z | #!/usr/bin/env python3
import os
import sys
if __name__ == '__main__':
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'mzweb.settings')
try:
from django.core.management import execute_from_command_line
except ImportError as exc:
raise ImportError(
"Couldn't import Django. Are y... | 33.625 | 73 | 0.685874 |
import os
import sys
if __name__ == '__main__':
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'mzweb.settings')
try:
from django.core.management import execute_from_command_line
except ImportError as exc:
raise ImportError(
"Couldn't import Django. Are you sure it's installed... | true | true |
f7f1e8287772a8a326b8dd664d2d7c80f1efa52c | 394 | py | Python | venv/Scripts/pip3.6-script.py | ololostapenko/Factoring | 821a0a3fb7463514774b30bbfe6d24c0467cb372 | [
"Apache-2.0"
] | null | null | null | venv/Scripts/pip3.6-script.py | ololostapenko/Factoring | 821a0a3fb7463514774b30bbfe6d24c0467cb372 | [
"Apache-2.0"
] | null | null | null | venv/Scripts/pip3.6-script.py | ololostapenko/Factoring | 821a0a3fb7463514774b30bbfe6d24c0467cb372 | [
"Apache-2.0"
] | null | null | null | #!C:\Devel\Factoring\venv\Scripts\python.exe
# EASY-INSTALL-ENTRY-SCRIPT: 'pip==9.0.1','console_scripts','pip3.6'
__requires__ = 'pip==9.0.1'
import re
import sys
from pkg_resources import load_entry_point
if __name__ == '__main__':
sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0])
sys.exit(
... | 30.307692 | 69 | 0.654822 |
__requires__ = 'pip==9.0.1'
import re
import sys
from pkg_resources import load_entry_point
if __name__ == '__main__':
sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0])
sys.exit(
load_entry_point('pip==9.0.1', 'console_scripts', 'pip3.6')()
)
| true | true |
f7f1e836bc069e04185c46523bf74dbdf23020a6 | 3,687 | py | Python | neutronclient/osc/v2/dynamic_routing/bgp_dragent.py | slawqo/python-neutronclient | ee08644c5f2424a40c70010dcf0fa2ad84809bfc | [
"Apache-2.0"
] | null | null | null | neutronclient/osc/v2/dynamic_routing/bgp_dragent.py | slawqo/python-neutronclient | ee08644c5f2424a40c70010dcf0fa2ad84809bfc | [
"Apache-2.0"
] | null | null | null | neutronclient/osc/v2/dynamic_routing/bgp_dragent.py | slawqo/python-neutronclient | ee08644c5f2424a40c70010dcf0fa2ad84809bfc | [
"Apache-2.0"
] | null | null | null | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# d... | 36.87 | 78 | 0.635476 |
from osc_lib.command import command
from osc_lib import utils
from neutronclient._i18n import _
from neutronclient.osc.v2.dynamic_routing import constants
def _format_alive_state(item):
return ':-)' if item else 'XXX'
_formatters = {
'alive': _format_alive_state
}
def add_common_args(parser)... | true | true |
f7f1e838d340da5eb4c48a6e732f36ce05febde0 | 5,505 | py | Python | tests/test_TestForMissingProperties.py | thommy-io/PyViCare | 6140ce5ceb038eb33e407f72dbbc5ec176fc8460 | [
"Apache-2.0"
] | null | null | null | tests/test_TestForMissingProperties.py | thommy-io/PyViCare | 6140ce5ceb038eb33e407f72dbbc5ec176fc8460 | [
"Apache-2.0"
] | null | null | null | tests/test_TestForMissingProperties.py | thommy-io/PyViCare | 6140ce5ceb038eb33e407f72dbbc5ec176fc8460 | [
"Apache-2.0"
] | null | null | null | import json
import re
import unittest
from os import listdir
from os.path import dirname, isfile, join
from tests.helper import readJson
class TestForMissingProperties(unittest.TestCase):
def test_missingProperties(self):
# with this test we want to check if new properties
# are added to the resp... | 42.346154 | 110 | 0.617075 | import json
import re
import unittest
from os import listdir
from os.path import dirname, isfile, join
from tests.helper import readJson
class TestForMissingProperties(unittest.TestCase):
def test_missingProperties(self):
ignore = [
'heating.operating.programs.holidayAtHome... | true | true |
f7f1e95c2d786401065e45b0cdd97094a2d4e515 | 8,519 | py | Python | plugins/modules/oci_opsi_sql_texts_facts.py | sohwaje/oci-ansible-collection | 9e6b8cf55e596a96560710a457a7df05886fc59c | [
"Apache-2.0"
] | null | null | null | plugins/modules/oci_opsi_sql_texts_facts.py | sohwaje/oci-ansible-collection | 9e6b8cf55e596a96560710a457a7df05886fc59c | [
"Apache-2.0"
] | null | null | null | plugins/modules/oci_opsi_sql_texts_facts.py | sohwaje/oci-ansible-collection | 9e6b8cf55e596a96560710a457a7df05886fc59c | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python
# Copyright (c) 2020, 2021 Oracle and/or its affiliates.
# This software is made available to you under the terms of the GPL 3.0 license or the Apache 2.0 license.
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# Apache License v2.0
# See LICENSE.TXT for d... | 37.528634 | 158 | 0.650663 |
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {
"metadata_version": "1.1",
"status": ["preview"],
"supported_by": "community",
}
DOCUMENTATION = """
---
module: oci_opsi_sql_texts_facts
short_description: Fetches details about one or mul... | true | true |
f7f1e977d87e51f730b24b8c11c319a4cd01c66b | 1,212 | py | Python | app/core/models.py | jonatan-parra/recipe-app-api | 2c61122c2b6433c5df174371c191536456fff9f9 | [
"MIT"
] | null | null | null | app/core/models.py | jonatan-parra/recipe-app-api | 2c61122c2b6433c5df174371c191536456fff9f9 | [
"MIT"
] | null | null | null | app/core/models.py | jonatan-parra/recipe-app-api | 2c61122c2b6433c5df174371c191536456fff9f9 | [
"MIT"
] | null | null | null | from django.db import models
from django.contrib.auth.models import (AbstractBaseUser, BaseUserManager,
PermissionsMixin)
class UserManager(BaseUserManager):
def create_user(self, email, password=None, **extra_fields):
"""Create and save a new user"""
if no... | 31.894737 | 76 | 0.666667 | from django.db import models
from django.contrib.auth.models import (AbstractBaseUser, BaseUserManager,
PermissionsMixin)
class UserManager(BaseUserManager):
def create_user(self, email, password=None, **extra_fields):
if not email:
raise ValueError("Us... | true | true |
f7f1e9985d36e8df9b17ce6975c329e466997f65 | 468 | py | Python | plotly/validators/layout/scene/zaxis/_showaxeslabels.py | faezs/plotly.py | 6009b5b9c746e5d2a2849ad255a4eb234b551ed7 | [
"MIT"
] | 2 | 2020-03-24T11:41:14.000Z | 2021-01-14T07:59:43.000Z | plotly/validators/layout/scene/zaxis/_showaxeslabels.py | faezs/plotly.py | 6009b5b9c746e5d2a2849ad255a4eb234b551ed7 | [
"MIT"
] | null | null | null | plotly/validators/layout/scene/zaxis/_showaxeslabels.py | faezs/plotly.py | 6009b5b9c746e5d2a2849ad255a4eb234b551ed7 | [
"MIT"
] | 4 | 2019-06-03T14:49:12.000Z | 2022-01-06T01:05:12.000Z | import _plotly_utils.basevalidators
class ShowaxeslabelsValidator(_plotly_utils.basevalidators.BooleanValidator):
def __init__(
self,
plotly_name='showaxeslabels',
parent_name='layout.scene.zaxis',
**kwargs
):
super(ShowaxeslabelsValidator, self).__init__(
... | 24.631579 | 77 | 0.615385 | import _plotly_utils.basevalidators
class ShowaxeslabelsValidator(_plotly_utils.basevalidators.BooleanValidator):
def __init__(
self,
plotly_name='showaxeslabels',
parent_name='layout.scene.zaxis',
**kwargs
):
super(ShowaxeslabelsValidator, self).__init__(
... | true | true |
f7f1ea019a3f025f987fa804cd5c9a95e23c1765 | 27,793 | py | Python | VENV/lib/python3.6/site-packages/pandas/tests/series/test_api.py | workingyifei/display-pattern-generator | b27be84c6221fa93833f283109870737b05bfbf6 | [
"MIT"
] | 69 | 2020-03-31T06:40:17.000Z | 2022-02-25T11:48:18.000Z | venv/lib/python3.7/site-packages/pandas/tests/series/test_api.py | John1001Song/Big-Data-Robo-Adviser | 9444dce96954c546333d5aecc92a06c3bfd19aa5 | [
"MIT"
] | 8 | 2019-12-04T23:44:11.000Z | 2022-02-10T08:31:40.000Z | venv/lib/python3.7/site-packages/pandas/tests/series/test_api.py | John1001Song/Big-Data-Robo-Adviser | 9444dce96954c546333d5aecc92a06c3bfd19aa5 | [
"MIT"
] | 28 | 2020-04-15T15:24:17.000Z | 2021-12-26T04:05:02.000Z | # coding=utf-8
# pylint: disable-msg=E1101,W0612
from collections import OrderedDict
import pydoc
import pytest
import numpy as np
import pandas as pd
from pandas import Index, Series, DataFrame, date_range
from pandas.core.indexes.datetimes import Timestamp
from pandas.compat import range, lzip, isidentifier, stri... | 36.714663 | 79 | 0.554312 |
from collections import OrderedDict
import pydoc
import pytest
import numpy as np
import pandas as pd
from pandas import Index, Series, DataFrame, date_range
from pandas.core.indexes.datetimes import Timestamp
from pandas.compat import range, lzip, isidentifier, string_types
from pandas import (compat, Categorica... | true | true |
f7f1eaad7ba18af7b2fc8f5cb0cd946401bcc2a7 | 531 | py | Python | storage/fase2/team02/storage/DictMode/modulo_carga.py | Alejandro5852/tytus | a8952b9c38377c6d0171eaa322b04f0adb6cc399 | [
"MIT"
] | 35 | 2020-12-07T03:11:43.000Z | 2021-04-15T17:38:16.000Z | storage/fase2/team02/storage/DictMode/modulo_carga.py | Alejandro5852/tytus | a8952b9c38377c6d0171eaa322b04f0adb6cc399 | [
"MIT"
] | 47 | 2020-12-09T01:29:09.000Z | 2021-01-13T05:37:50.000Z | storage/fase2/team02/storage/DictMode/modulo_carga.py | Alejandro5852/tytus | a8952b9c38377c6d0171eaa322b04f0adb6cc399 | [
"MIT"
] | 556 | 2020-12-07T03:13:31.000Z | 2021-06-17T17:41:10.000Z | # License: Released under MIT License
# Notice: Copyright (c) 2020 TytusDB Team
# Developer: Andree Avalos
from storage.DictMode.modulo_llaves import insert
import csv
def loadCSV(filepath: str, database: str, table: str):
try:
res = []
import csv
with open(filepath, '... | 31.235294 | 56 | 0.578154 |
from storage.DictMode.modulo_llaves import insert
import csv
def loadCSV(filepath: str, database: str, table: str):
try:
res = []
import csv
with open(filepath, 'r') as file:
reader = csv.reader(file, delimiter = ',')
for row in reader:
res... | true | true |
f7f1eab7653e20174e00e2cea70a733617aa5936 | 785 | py | Python | pandas_23/pandabear03.py | MandoGuardado/2022-01-04-Python | abceb619c1fad9c55e6023b57fbb35d9a8f0e640 | [
"MIT"
] | 1 | 2022-01-14T20:47:47.000Z | 2022-01-14T20:47:47.000Z | pandas_23/pandabear03.py | MandoGuardado/2022-01-04-Python | abceb619c1fad9c55e6023b57fbb35d9a8f0e640 | [
"MIT"
] | null | null | null | pandas_23/pandabear03.py | MandoGuardado/2022-01-04-Python | abceb619c1fad9c55e6023b57fbb35d9a8f0e640 | [
"MIT"
] | null | null | null | #!/usr/bin/python3
import pandas as pd
def main():
# create a dataframe ciscocsv
ciscocsv = pd.read_csv("ciscodata.csv")
# create a dataframe ciscojson
ciscojson = pd.read_json("ciscodata2.json")
# The line below concats and reapplies the index value
ciscodf = pd.concat([ciscocsv, ciscojson]... | 21.216216 | 77 | 0.671338 |
import pandas as pd
def main():
ciscocsv = pd.read_csv("ciscodata.csv")
ciscojson = pd.read_json("ciscodata2.json")
ciscodf = pd.concat([ciscocsv, ciscojson], ignore_index=True, sort=False)
ta.json")
_csv("combined_ciscodata.csv")
xcel("combined_ciscodata.xls")
pri... | true | true |
f7f1eaff27eb89b20ccb225d4e5f02bc6d6e5814 | 5,227 | py | Python | deploy/utils/lock.py | ljw23/ConvLab-2 | 13d48ea0e441701bd66100689b6c25b561f15525 | [
"Apache-2.0"
] | 339 | 2020-03-04T09:43:22.000Z | 2022-03-26T17:27:38.000Z | deploy/utils/lock.py | ljw23/ConvLab-2 | 13d48ea0e441701bd66100689b6c25b561f15525 | [
"Apache-2.0"
] | 122 | 2020-04-12T04:19:06.000Z | 2022-03-23T14:20:57.000Z | deploy/utils/lock.py | ljw23/ConvLab-2 | 13d48ea0e441701bd66100689b6c25b561f15525 | [
"Apache-2.0"
] | 138 | 2020-02-18T16:48:04.000Z | 2022-03-26T17:27:43.000Z | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
"""
import multiprocessing as mp
import threading as th
class LockBase(object):
def __init__(self):
self.locks = []
def enter(self):
for lock in self.locks:
lock.acquire()
def leave(self):
for lock in self.locks[::-... | 29.201117 | 100 | 0.553281 |
import multiprocessing as mp
import threading as th
class LockBase(object):
def __init__(self):
self.locks = []
def enter(self):
for lock in self.locks:
lock.acquire()
def leave(self):
for lock in self.locks[::-1]:
lock.release()
def __enter__(se... | true | true |
f7f1ec0cfadc1434b4a749723d939450ecb0ed11 | 33,675 | py | Python | keystone/api/users.py | bbc/keystone | dc68ee48160e8ad9b637f3d91b18a42dbfdf012b | [
"Apache-2.0"
] | null | null | null | keystone/api/users.py | bbc/keystone | dc68ee48160e8ad9b637f3d91b18a42dbfdf012b | [
"Apache-2.0"
] | null | null | null | keystone/api/users.py | bbc/keystone | dc68ee48160e8ad9b637f3d91b18a42dbfdf012b | [
"Apache-2.0"
] | null | null | null | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# d... | 39.294049 | 107 | 0.648315 |
import base64
import os
import uuid
import flask
import http.client
from oslo_serialization import jsonutils
from werkzeug import exceptions
from keystone.api._shared import json_home_relations
from keystone.application_credential import schema as app_cred_schema
from keystone.common import json_home
fr... | true | true |
f7f1ec11bb6bbb9a7d65fc3c0859a361ddfe9bf8 | 365 | py | Python | annotation/annotators/box_annotator.py | mtszkw/pointpicker | 0845bdbeb3d000ec577772f01a02bdb46e422350 | [
"MIT"
] | null | null | null | annotation/annotators/box_annotator.py | mtszkw/pointpicker | 0845bdbeb3d000ec577772f01a02bdb46e422350 | [
"MIT"
] | null | null | null | annotation/annotators/box_annotator.py | mtszkw/pointpicker | 0845bdbeb3d000ec577772f01a02bdb46e422350 | [
"MIT"
] | null | null | null | from PIL import Image
import matplotlib.pyplot as plt
from .annotator import Annotator
class BoxAnnotator(Annotator):
def __init__(self, annotations_limit=None, window_timeout=0):
super().__init__(annotations_limit, window_timeout)
def run(self, img_absolute_path : str):
raise NotImplemented... | 28.076923 | 72 | 0.764384 | from PIL import Image
import matplotlib.pyplot as plt
from .annotator import Annotator
class BoxAnnotator(Annotator):
def __init__(self, annotations_limit=None, window_timeout=0):
super().__init__(annotations_limit, window_timeout)
def run(self, img_absolute_path : str):
raise NotImplemented... | true | true |
f7f1ec59f67d6fa5d82bedf06c114c0d54b53114 | 1,164 | py | Python | backend/idea/viewset.py | www-norma-dev/idea-box-backend | 0457df8fc1b055620cef5a9000f579dda8723b60 | [
"MIT"
] | null | null | null | backend/idea/viewset.py | www-norma-dev/idea-box-backend | 0457df8fc1b055620cef5a9000f579dda8723b60 | [
"MIT"
] | 2 | 2021-04-28T16:15:49.000Z | 2021-04-28T16:15:59.000Z | backend/idea/viewset.py | www-norma-dev/idea-box-backend | 0457df8fc1b055620cef5a9000f579dda8723b60 | [
"MIT"
] | null | null | null | from rest_framework import viewsets
from . import models
from . import serializers
from rest_framework import generics
class IdeaViewset(viewsets.ModelViewSet):
queryset = models.Idea.objects.all()
serializer_class = serializers.IdeaSerializer
class BlogViewset(viewsets.ModelViewSet):
queryset = models.... | 28.390244 | 69 | 0.736254 | from rest_framework import viewsets
from . import models
from . import serializers
from rest_framework import generics
class IdeaViewset(viewsets.ModelViewSet):
queryset = models.Idea.objects.all()
serializer_class = serializers.IdeaSerializer
class BlogViewset(viewsets.ModelViewSet):
queryset = models.... | true | true |
f7f1ec7abd6fcd32a9a661a9898546e74e60166b | 558 | py | Python | deft/format_test.py | tobias-fyi/deft | 8dabc80dd681f7cd901cec8b182f607d7425ed83 | [
"MIT"
] | null | null | null | deft/format_test.py | tobias-fyi/deft | 8dabc80dd681f7cd901cec8b182f607d7425ed83 | [
"MIT"
] | 2 | 2020-03-24T18:13:54.000Z | 2020-03-31T09:14:00.000Z | deft/format_test.py | tobias-fyi/deft | 8dabc80dd681f7cd901cec8b182f607d7425ed83 | [
"MIT"
] | 1 | 2019-10-30T00:49:30.000Z | 2019-10-30T00:49:30.000Z | """
deft.format_test :: Unit Tests for Deft Formatting
"""
import unittest
from formatting import justify_center
class JustifyTest(unittest.TestCase):
"""Test cases for deft.formatting functions."""
def test_justify_center(self):
"""Tests if string is justified correctly."""
w = 16
... | 18 | 62 | 0.598566 |
import unittest
from formatting import justify_center
class JustifyTest(unittest.TestCase):
def test_justify_center(self):
w = 16
sym = "+"
unjust = """ahoy
there
mateys"""
just = """++++++ahoy++++++
+++++there++++++
+++++mateys+++++"""
self.assertEqual(justify_center... | true | true |
f7f1ece296246561ab7fc887e30f8625aa920a24 | 1,133 | py | Python | ctree/cpp/nodes.py | zanellia/ctree | d53d29d972ac06b60d8fc4fb81f5553d2ffbfda0 | [
"BSD-2-Clause"
] | 16 | 2015-01-11T21:10:26.000Z | 2021-09-28T11:39:56.000Z | ctree/cpp/nodes.py | zanellia/ctree | d53d29d972ac06b60d8fc4fb81f5553d2ffbfda0 | [
"BSD-2-Clause"
] | 12 | 2015-01-01T01:55:49.000Z | 2019-06-23T16:41:12.000Z | ctree/cpp/nodes.py | zanellia/ctree | d53d29d972ac06b60d8fc4fb81f5553d2ffbfda0 | [
"BSD-2-Clause"
] | 4 | 2015-07-23T20:48:36.000Z | 2021-08-02T12:17:37.000Z | """
C preprocessor nodes supported by ctree.
"""
from ctree.nodes import CtreeNode
class CppNode(CtreeNode):
"""Base class for all C Preprocessor nodes in ctree."""
def codegen(self, indent=0):
from ctree.cpp.codegen import CppCodeGen
return CppCodeGen(indent).visit(self)
def label(sel... | 22.215686 | 61 | 0.646955 |
from ctree.nodes import CtreeNode
class CppNode(CtreeNode):
def codegen(self, indent=0):
from ctree.cpp.codegen import CppCodeGen
return CppCodeGen(indent).visit(self)
def label(self):
from ctree.cpp.dotgen import CppDotLabeller
return CppDotLabeller().visit(self)
def... | true | true |
f7f1eceb50dc33df9fd71386e7df118390a6ad98 | 963 | py | Python | setup.py | fraglab/nameko-proxy | 674addb6e11a6a0d3e7998eb888592d46a536ab1 | [
"MIT"
] | 10 | 2018-05-19T01:51:35.000Z | 2021-03-02T19:59:44.000Z | setup.py | fraglab/nameko-proxy | 674addb6e11a6a0d3e7998eb888592d46a536ab1 | [
"MIT"
] | null | null | null | setup.py | fraglab/nameko-proxy | 674addb6e11a6a0d3e7998eb888592d46a536ab1 | [
"MIT"
] | 8 | 2017-10-13T07:09:36.000Z | 2020-12-25T05:58:28.000Z | from setuptools import setup, find_packages
from nameko_proxy import __version__
setup(
name='nameko-proxy',
version=__version__,
author='Sergey Suglobov',
author_email='s.suglobov@gmail.com',
packages=find_packages(),
keywords="nameko, standalone, proxy",
url='https://github.com/fraglab/... | 30.09375 | 83 | 0.627207 | from setuptools import setup, find_packages
from nameko_proxy import __version__
setup(
name='nameko-proxy',
version=__version__,
author='Sergey Suglobov',
author_email='s.suglobov@gmail.com',
packages=find_packages(),
keywords="nameko, standalone, proxy",
url='https://github.com/fraglab/... | true | true |
f7f1ed8db7844e8c4eb570264e9d8f3cef1d1a79 | 6,435 | py | Python | python/test.py | thabbott/RRTMG_SW | 1a3fb6a9aac3d602280e6979a1791a7e54cf3916 | [
"BSD-3-Clause"
] | null | null | null | python/test.py | thabbott/RRTMG_SW | 1a3fb6a9aac3d602280e6979a1791a7e54cf3916 | [
"BSD-3-Clause"
] | null | null | null | python/test.py | thabbott/RRTMG_SW | 1a3fb6a9aac3d602280e6979a1791a7e54cf3916 | [
"BSD-3-Clause"
] | null | null | null | import rrtmg_sw_wrapper as sw
import numpy as np
import matplotlib.pyplot as plt
# Constants
cp = 1e3
g = 9.80
Lv = 2.5e6
Rv = 460e0
Rd = 287e0
e0 = 610e0
T0 = 273e0
Mair = 29e0
Mh2o = 18e0
Mco2 = 44e0
h = 6.626e-34
kB = 1.381e-23
c = 3.00e8
NUM_BANDS = 14
NUM_AER = 6
# Atmospheric profiles
def calc_qsat(T, p):
... | 29.791667 | 74 | 0.581352 | import rrtmg_sw_wrapper as sw
import numpy as np
import matplotlib.pyplot as plt
cp = 1e3
g = 9.80
Lv = 2.5e6
Rv = 460e0
Rd = 287e0
e0 = 610e0
T0 = 273e0
Mair = 29e0
Mh2o = 18e0
Mco2 = 44e0
h = 6.626e-34
kB = 1.381e-23
c = 3.00e8
NUM_BANDS = 14
NUM_AER = 6
def calc_qsat(T, p):
esat = e0*np.exp(-Lv/Rv*(1/T - 1/... | true | true |
f7f1edd830082fa4e575a0d97de3bd265ce9d888 | 336 | py | Python | ptart/templatetags/split.py | Fisjkars/sh00t | 3cae9d7f2b68c62ff58655d46f73c7a4ce2f6ec7 | [
"MIT"
] | 17 | 2020-04-28T15:42:44.000Z | 2022-03-21T07:45:07.000Z | ptart/templatetags/split.py | Fisjkars/sh00t | 3cae9d7f2b68c62ff58655d46f73c7a4ce2f6ec7 | [
"MIT"
] | 34 | 2019-01-29T06:50:03.000Z | 2019-05-24T08:39:02.000Z | ptart/templatetags/split.py | Fisjkars/sh00t | 3cae9d7f2b68c62ff58655d46f73c7a4ce2f6ec7 | [
"MIT"
] | 5 | 2020-09-22T20:02:37.000Z | 2022-03-15T12:53:00.000Z | from django import template
from django.template.defaultfilters import stringfilter
register = template.Library()
@register.filter
@stringfilter
def split(s):
ret... | 37.333333 | 179 | 0.428571 | from django import template
from django.template.defaultfilters import stringfilter
register = template.Library()
@register.filter
@stringfilter
def split(s):
ret... | true | true |
f7f1ee0808e45ea8d6e57fa59bad72c9736d95eb | 886 | py | Python | NamedEntityRecognition/urls.py | beckswu/Named-Entity-Recognition | cdae2c89dd35ba8f180898446a24def78956da52 | [
"MIT"
] | null | null | null | NamedEntityRecognition/urls.py | beckswu/Named-Entity-Recognition | cdae2c89dd35ba8f180898446a24def78956da52 | [
"MIT"
] | null | null | null | NamedEntityRecognition/urls.py | beckswu/Named-Entity-Recognition | cdae2c89dd35ba8f180898446a24def78956da52 | [
"MIT"
] | null | null | null | """mysite URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/3.1/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, name='home')
Class-based ... | 35.44 | 77 | 0.697517 | from django.contrib import admin
from django.urls import path, include
from . import views
urlpatterns = [
path('', views.index, name = "index"),
path('train/',views.train, name="train"),
path('eval/', views.evaluation, name = "evaluation")
]
| true | true |
f7f1ee84ac28d4ea011589a13a64c00dfd240826 | 1,170 | py | Python | scripts/slave/recipe_modules/archive/tests/zip_and_upload_build.py | bopopescu/chromium-build | f8e42c70146c1b668421ee6358dc550a955770a3 | [
"BSD-3-Clause"
] | null | null | null | scripts/slave/recipe_modules/archive/tests/zip_and_upload_build.py | bopopescu/chromium-build | f8e42c70146c1b668421ee6358dc550a955770a3 | [
"BSD-3-Clause"
] | null | null | null | scripts/slave/recipe_modules/archive/tests/zip_and_upload_build.py | bopopescu/chromium-build | f8e42c70146c1b668421ee6358dc550a955770a3 | [
"BSD-3-Clause"
] | 1 | 2020-07-22T09:16:32.000Z | 2020-07-22T09:16:32.000Z | # Copyright 2017 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.
DEPS = [
'archive',
'depot_tools/bot_update',
'depot_tools/gclient',
'recipe_engine/path',
'recipe_engine/properties',
]
def RunSteps(api):
api... | 27.209302 | 72 | 0.678632 |
DEPS = [
'archive',
'depot_tools/bot_update',
'depot_tools/gclient',
'recipe_engine/path',
'recipe_engine/properties',
]
def RunSteps(api):
api.gclient.set_config('chromium')
bot_update_step = api.bot_update.ensure_checkout()
api.archive.zip_and_upload_build(
step_name='zip build',
t... | true | true |
f7f1f00db9597d176814ec56b4f2eca713a96687 | 3,907 | py | Python | code/utils/chamfer_evaluation.py | simon-donne/defusr | fa4275070af4024eea128e99d7c6df2358d129a5 | [
"MIT"
] | 65 | 2019-04-08T20:24:01.000Z | 2021-09-22T22:16:13.000Z | code/utils/chamfer_evaluation.py | simon-donne/defusr | fa4275070af4024eea128e99d7c6df2358d129a5 | [
"MIT"
] | 4 | 2019-07-22T05:30:27.000Z | 2020-05-27T05:36:52.000Z | code/utils/chamfer_evaluation.py | simon-donne/defusr | fa4275070af4024eea128e99d7c6df2358d129a5 | [
"MIT"
] | 13 | 2019-05-01T22:22:06.000Z | 2021-09-24T07:19:13.000Z | """
Creating the visibility masks for all of the scenes.
"""
import os
from datasets.DTU import DTUAdapter
from datasets.unreal_DTU import UnrealDTUAdapter
from datasets.flying_things import FlyingThingsAdapter
import numpy as np
from utils.ply import load_pointcloud_ply, save_pointcloud_ply, load_pointcloud_ply_gipum... | 35.198198 | 165 | 0.696698 |
import os
from datasets.DTU import DTUAdapter
from datasets.unreal_DTU import UnrealDTUAdapter
from datasets.flying_things import FlyingThingsAdapter
import numpy as np
from utils.ply import load_pointcloud_ply, save_pointcloud_ply, load_pointcloud_ply_gipuma
from utils.depth_maps import depth_map_to_point_cloud
from ... | true | true |
f7f1f16c183814f444f7817f637b3b6c5bd1a0c6 | 1,561 | py | Python | tests/dhcpv4/process/test_v4_stateless.py | shawnmullaney/forge | aaaef0a0645f73d24666aab6a400f3604e753aac | [
"0BSD"
] | null | null | null | tests/dhcpv4/process/test_v4_stateless.py | shawnmullaney/forge | aaaef0a0645f73d24666aab6a400f3604e753aac | [
"0BSD"
] | null | null | null | tests/dhcpv4/process/test_v4_stateless.py | shawnmullaney/forge | aaaef0a0645f73d24666aab6a400f3604e753aac | [
"0BSD"
] | null | null | null | """DHCPv4 Stateless clients"""
# pylint: disable=invalid-name,line-too-long
import pytest
import srv_control
import srv_msg
import misc
@pytest.mark.v4
@pytest.mark.stateless
def test_v4_stateless_with_subnet_empty_pool():
misc.test_setup()
srv_control.config_srv_subnet('192.168.50.0/24', '$(EMPTY)')
s... | 39.025 | 91 | 0.725817 |
import pytest
import srv_control
import srv_msg
import misc
@pytest.mark.v4
@pytest.mark.stateless
def test_v4_stateless_with_subnet_empty_pool():
misc.test_setup()
srv_control.config_srv_subnet('192.168.50.0/24', '$(EMPTY)')
srv_control.config_srv_opt('subnet-mask', '255.255.255.0')
srv_control.c... | true | true |
f7f1f40b4217ace6e86299cab7320d08f7c299e7 | 5,361 | py | Python | etc/find_messages.py | dralabeing/OpenROAD | fb3c084a7307399d97f9291f13da4c6f5c870704 | [
"BSD-3-Clause-Clear"
] | null | null | null | etc/find_messages.py | dralabeing/OpenROAD | fb3c084a7307399d97f9291f13da4c6f5c870704 | [
"BSD-3-Clause-Clear"
] | null | null | null | etc/find_messages.py | dralabeing/OpenROAD | fb3c084a7307399d97f9291f13da4c6f5c870704 | [
"BSD-3-Clause-Clear"
] | null | null | null | #!/usr/bin/env python3
############################################################################
##
## Copyright (c) 2021, The Regents of the University of California
## All rights reserved.
##
## BSD 3-Clause License
##
## Redistribution and use in source and binary forms, with or without
## modification, are perm... | 35.039216 | 80 | 0.570229 | true | true | |
f7f1f41c0725b6e57842e48af127c0f1d77a2715 | 490 | py | Python | env/Lib/site-packages/plotly/validators/layout/title/_xanchor.py | andresgreen-byte/Laboratorio-1--Inversion-de-Capital | 8a4707301d19c3826c31026c4077930bcd6a8182 | [
"MIT"
] | 11,750 | 2015-10-12T07:03:39.000Z | 2022-03-31T20:43:15.000Z | env/Lib/site-packages/plotly/validators/layout/title/_xanchor.py | andresgreen-byte/Laboratorio-1--Inversion-de-Capital | 8a4707301d19c3826c31026c4077930bcd6a8182 | [
"MIT"
] | 2,951 | 2015-10-12T00:41:25.000Z | 2022-03-31T22:19:26.000Z | env/Lib/site-packages/plotly/validators/layout/title/_xanchor.py | andresgreen-byte/Laboratorio-1--Inversion-de-Capital | 8a4707301d19c3826c31026c4077930bcd6a8182 | [
"MIT"
] | 2,623 | 2015-10-15T14:40:27.000Z | 2022-03-28T16:05:50.000Z | import _plotly_utils.basevalidators
class XanchorValidator(_plotly_utils.basevalidators.EnumeratedValidator):
def __init__(self, plotly_name="xanchor", parent_name="layout.title", **kwargs):
super(XanchorValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
... | 37.692308 | 84 | 0.657143 | import _plotly_utils.basevalidators
class XanchorValidator(_plotly_utils.basevalidators.EnumeratedValidator):
def __init__(self, plotly_name="xanchor", parent_name="layout.title", **kwargs):
super(XanchorValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
... | true | true |
f7f1f47dfeb7808533103a4f7a1a9f0c7f0f4a29 | 1,127 | py | Python | src/SnowNLPAPI/views.py | Superbsco/weibo-analysis-system | f49dea8d4e1c2587d8c533ebaaa107103a875f24 | [
"MIT"
] | 199 | 2019-05-05T04:35:25.000Z | 2022-03-27T03:02:44.000Z | src/SnowNLPAPI/views.py | Ghy0202/weibo-analysis-system | f49dea8d4e1c2587d8c533ebaaa107103a875f24 | [
"MIT"
] | 11 | 2019-05-27T14:25:01.000Z | 2021-01-28T13:08:36.000Z | src/SnowNLPAPI/views.py | Ghy0202/weibo-analysis-system | f49dea8d4e1c2587d8c533ebaaa107103a875f24 | [
"MIT"
] | 62 | 2019-05-05T04:35:32.000Z | 2022-03-28T09:28:19.000Z | from django.shortcuts import render
from django.http import HttpResponse, JsonResponse
# Create your views here.
from .snownlp import SnowNLP
from .snownlp import sentiment
import re
class SnowNLPWeibo:
def SnowNLPAPI(request):
if request.method == "GET":
text = request.GET.get("snownlp")
... | 28.175 | 74 | 0.502218 | from django.shortcuts import render
from django.http import HttpResponse, JsonResponse
from .snownlp import SnowNLP
from .snownlp import sentiment
import re
class SnowNLPWeibo:
def SnowNLPAPI(request):
if request.method == "GET":
text = request.GET.get("snownlp")
print(text)
... | true | true |
f7f1f4804c363ecc9299ac76bb900e2cc6eb04b8 | 7,622 | py | Python | sportsbet/datasets/_soccer/_dummy.py | ItzBraveNoob/sports-betting | 521d4ef6bd0e079d508f40609681124edc2c6805 | [
"MIT"
] | null | null | null | sportsbet/datasets/_soccer/_dummy.py | ItzBraveNoob/sports-betting | 521d4ef6bd0e079d508f40609681124edc2c6805 | [
"MIT"
] | null | null | null | sportsbet/datasets/_soccer/_dummy.py | ItzBraveNoob/sports-betting | 521d4ef6bd0e079d508f40609681124edc2c6805 | [
"MIT"
] | null | null | null | """
Dataloder for dummy data.
"""
# Author: Georgios Douzas <gdouzas@icloud.com>
# License: MIT
from datetime import datetime
import numpy as np
import pandas as pd
from sklearn.model_selection import ParameterGrid
from sportsbet.datasets._base import _BaseDataLoader
class DummySoccerDataLoader(_BaseDataLoader):
... | 25.837288 | 85 | 0.348859 |
from datetime import datetime
import numpy as np
import pandas as pd
from sklearn.model_selection import ParameterGrid
from sportsbet.datasets._base import _BaseDataLoader
class DummySoccerDataLoader(_BaseDataLoader):
DATE = pd.Timestamp(datetime.now()) + pd.to_timedelta(1, 'd')
PARAMS = [
{'le... | true | true |
f7f1f490de9bb81f41309763ae9e515737808429 | 1,515 | py | Python | MODELS/sih/models.py | mladenangel/myprojects | 89b8ddce97b22752a1da8054fc497ce29644fe5c | [
"MIT"
] | null | null | null | MODELS/sih/models.py | mladenangel/myprojects | 89b8ddce97b22752a1da8054fc497ce29644fe5c | [
"MIT"
] | null | null | null | MODELS/sih/models.py | mladenangel/myprojects | 89b8ddce97b22752a1da8054fc497ce29644fe5c | [
"MIT"
] | null | null | null | # delwin 2016
from __future__ import unicode_literals
from django.conf import settings
from django.db import models
from allauth.account.signals import user_logged_in, user_signed_up
import stripe
stripe.api_key = settings.STRIPE_SECRET_KEY
# Create your models here.
class profile(models.Model):
name = models.CharF... | 32.234043 | 81 | 0.780198 |
from __future__ import unicode_literals
from django.conf import settings
from django.db import models
from allauth.account.signals import user_logged_in, user_signed_up
import stripe
stripe.api_key = settings.STRIPE_SECRET_KEY
class profile(models.Model):
name = models.CharField(max_length=120)
user = models.One... | true | true |
f7f1f4dd2b44b5899fed6eb3109a7532fb0f4c50 | 402 | py | Python | maths/problems/compute_parity.py | hariharanragothaman/pymaster | b3d033b4d5c75c69f587c94d9d12cd4a349a6a69 | [
"Apache-2.0"
] | 10 | 2020-09-21T22:23:09.000Z | 2022-01-25T16:58:44.000Z | maths/problems/compute_parity.py | hariharanragothaman/pymaster | b3d033b4d5c75c69f587c94d9d12cd4a349a6a69 | [
"Apache-2.0"
] | null | null | null | maths/problems/compute_parity.py | hariharanragothaman/pymaster | b3d033b4d5c75c69f587c94d9d12cd4a349a6a69 | [
"Apache-2.0"
] | null | null | null | """
The parity of a binary word is:
1 - if number of 1's is odd
0 - if number of 1's is even
- How would you compute for very large binary strings?
"""
def find_parity_using_string(n: int) -> int:
str_n = str(n)
if str_n.count("1") % 2 == 0:
return 0
return 1
if __name__ == "__main__":
res... | 19.142857 | 54 | 0.624378 |
def find_parity_using_string(n: int) -> int:
str_n = str(n)
if str_n.count("1") % 2 == 0:
return 0
return 1
if __name__ == "__main__":
result = find_parity_using_string(10 ** 9 + 7)
print(f"The result is: {result}")
| true | true |
f7f1f51b66c3f7bef6e0d9e76d146e6319d1c8da | 214 | py | Python | 22_BinarySearch/Step01/wowo0709.py | StudyForCoding/BEAKJOON | 84e1c5e463255e919ccf6b6a782978c205420dbf | [
"MIT"
] | null | null | null | 22_BinarySearch/Step01/wowo0709.py | StudyForCoding/BEAKJOON | 84e1c5e463255e919ccf6b6a782978c205420dbf | [
"MIT"
] | 3 | 2020-11-04T05:38:53.000Z | 2021-03-02T02:15:19.000Z | 22_BinarySearch/Step01/wowo0709.py | StudyForCoding/BEAKJOON | 84e1c5e463255e919ccf6b6a782978c205420dbf | [
"MIT"
] | null | null | null | import sys
input = sys.stdin.readline
N = int(input())
A = list(map(int,input().split())) # 리스트 사용
M = int(input())
B = list(map(int,input().split()))
for b in B:
answer = 1 if b in A else 0
print(answer) | 19.454545 | 43 | 0.61215 | import sys
input = sys.stdin.readline
N = int(input())
A = list(map(int,input().split()))
M = int(input())
B = list(map(int,input().split()))
for b in B:
answer = 1 if b in A else 0
print(answer) | true | true |
f7f1f54cbb8cdc97b56b21e9d51111ec397c7ef6 | 1,113 | py | Python | python_examples/plot_simple_viz.py | karla-descartes/tutorials | 5e703f0a0c2bacf3ad018a4fcfd040d8937f62e8 | [
"MIT"
] | null | null | null | python_examples/plot_simple_viz.py | karla-descartes/tutorials | 5e703f0a0c2bacf3ad018a4fcfd040d8937f62e8 | [
"MIT"
] | null | null | null | python_examples/plot_simple_viz.py | karla-descartes/tutorials | 5e703f0a0c2bacf3ad018a4fcfd040d8937f62e8 | [
"MIT"
] | 1 | 2019-01-18T15:37:02.000Z | 2019-01-18T15:37:02.000Z | """
==================================================
Simple Image Visualization
==================================================
Visualize a true color Landsat 8 SceneCollection.
"""
import descarteslabs as dl
# Create a tile around Paris, France
tile = dl.scenes.DLTile.from_latlon(43.7230,
... | 29.289474 | 77 | 0.467206 |
import descarteslabs as dl
tile = dl.scenes.DLTile.from_latlon(43.7230,
10.3966,
resolution=20.0,
tilesize=5024,
pad=0)
scenes, ctx = dl.scenes.search(tile,
... | true | true |
f7f1f60eddd20a14d8fb20fa34dc1fb5ccfc9e5f | 5,807 | py | Python | DNN/ExampleDNN.py | xyzxinyizhang/H2H | 334fc10f63a4a56d861a2e048f1fbb49073e09ee | [
"MIT"
] | null | null | null | DNN/ExampleDNN.py | xyzxinyizhang/H2H | 334fc10f63a4a56d861a2e048f1fbb49073e09ee | [
"MIT"
] | null | null | null | DNN/ExampleDNN.py | xyzxinyizhang/H2H | 334fc10f63a4a56d861a2e048f1fbb49073e09ee | [
"MIT"
] | null | null | null | M1L1 = {'LayerType': 'CNN', 'LayerName': 'M1L1', 'M': 64, 'N': 3, 'R': 112, 'C': 112, 'K': 3, 'S': 1, 'P': 1}
M1L2 = {'LayerType': 'CNN', 'LayerName': 'M1L2', 'M': 64, 'N': 64, 'R': 112, 'C': 112, 'K': 3, 'S': 1, 'P': 1}
M1L3 = {'LayerType': 'CNN', 'LayerName': 'M1L3', 'M': 64, 'N': 64, 'R': 112, 'C': 112, 'K': 3, '... | 86.671642 | 113 | 0.447219 | M1L1 = {'LayerType': 'CNN', 'LayerName': 'M1L1', 'M': 64, 'N': 3, 'R': 112, 'C': 112, 'K': 3, 'S': 1, 'P': 1}
M1L2 = {'LayerType': 'CNN', 'LayerName': 'M1L2', 'M': 64, 'N': 64, 'R': 112, 'C': 112, 'K': 3, 'S': 1, 'P': 1}
M1L3 = {'LayerType': 'CNN', 'LayerName': 'M1L3', 'M': 64, 'N': 64, 'R': 112, 'C': 112, 'K': 3, '... | true | true |
f7f1f6336bf43ed955a8123198aaf91cfcccd8b8 | 404 | py | Python | Anchors/Delete Anchors.py | sergio391/Mekkablue-Glyphs-Scripts | aab8a00522dd90442d89b10fa1f560b215ce9c99 | [
"Apache-2.0"
] | 1 | 2021-09-04T18:41:30.000Z | 2021-09-04T18:41:30.000Z | Anchors/Delete Anchors.py | davidtahim/Glyphs-Scripts | 5ed28805b5fe03c63d904ad2f79117844c22aa44 | [
"Apache-2.0"
] | null | null | null | Anchors/Delete Anchors.py | davidtahim/Glyphs-Scripts | 5ed28805b5fe03c63d904ad2f79117844c22aa44 | [
"Apache-2.0"
] | 1 | 2021-06-09T19:16:47.000Z | 2021-06-09T19:16:47.000Z | #MenuTitle: Delete All Anchors
# -*- coding: utf-8 -*-
__doc__="""
Deletes all anchors in active layers of selected glyphs.
"""
import GlyphsApp
Font = Glyphs.font
selectedLayers = Font.selectedLayers
print "Deleting anchors in:"
for thisLayer in selectedLayers:
thisGlyph = thisLayer.parent
print "-- %s" % thisGl... | 20.2 | 56 | 0.74505 |
__doc__="""
Deletes all anchors in active layers of selected glyphs.
"""
import GlyphsApp
Font = Glyphs.font
selectedLayers = Font.selectedLayers
print "Deleting anchors in:"
for thisLayer in selectedLayers:
thisGlyph = thisLayer.parent
print "-- %s" % thisGlyph.name
thisGlyph.beginUndo()
thisLayer.setAnchors... | false | true |
f7f1f6709196d67551f0423c79617063198bd4a6 | 17,951 | py | Python | generator/models/networksHD.py | bruceli-rw0/edge2pic-generation | e9ee6f89361d1a12b044c0ab665a09fca4a47089 | [
"MIT"
] | null | null | null | generator/models/networksHD.py | bruceli-rw0/edge2pic-generation | e9ee6f89361d1a12b044c0ab665a09fca4a47089 | [
"MIT"
] | null | null | null | generator/models/networksHD.py | bruceli-rw0/edge2pic-generation | e9ee6f89361d1a12b044c0ab665a09fca4a47089 | [
"MIT"
] | null | null | null | import numpy as np
import torch
import torch.nn as nn
from torch.autograd import Variable
from .helper import *
###############################################################################
# Functions
###############################################################################
def define_G(
input_nc,
ou... | 36.634694 | 139 | 0.539859 | import numpy as np
import torch
import torch.nn as nn
from torch.autograd import Variable
from .helper import *
| true | true |
f7f1f857b61334072a7a46eefc31703461222dbc | 662 | py | Python | app.py | MrJonRoberts/DSO_flask_file_upload | 60808fc7569e36e347b7014babd7f62e8fd82f5f | [
"Unlicense"
] | null | null | null | app.py | MrJonRoberts/DSO_flask_file_upload | 60808fc7569e36e347b7014babd7f62e8fd82f5f | [
"Unlicense"
] | null | null | null | app.py | MrJonRoberts/DSO_flask_file_upload | 60808fc7569e36e347b7014babd7f62e8fd82f5f | [
"Unlicense"
] | null | null | null | from flask import Flask, abort, render_template, request, redirect, url_for
from werkzeug.utils import secure_filename
import os
app = Flask(__name__)
# set up the folders
UPLOAD_FOLDER = 'UPLOADS'
app.config['UPLOAD_FOLDER'] = UPLOAD_FOLDER
@app.route('/')
def home():
if request.method == 'POST':
file ... | 24.518519 | 75 | 0.660121 | from flask import Flask, abort, render_template, request, redirect, url_for
from werkzeug.utils import secure_filename
import os
app = Flask(__name__)
UPLOAD_FOLDER = 'UPLOADS'
app.config['UPLOAD_FOLDER'] = UPLOAD_FOLDER
@app.route('/')
def home():
if request.method == 'POST':
file = request.files['fil... | true | true |
f7f1f89c29001bb87416fa892978c85a4886cb29 | 183 | py | Python | registro/urls.py | jjmartinr01/gauss3 | 1c71c44430e0f15fb2f3f83d32ad66bb1b7e3e94 | [
"MIT"
] | null | null | null | registro/urls.py | jjmartinr01/gauss3 | 1c71c44430e0f15fb2f3f83d32ad66bb1b7e3e94 | [
"MIT"
] | null | null | null | registro/urls.py | jjmartinr01/gauss3 | 1c71c44430e0f15fb2f3f83d32ad66bb1b7e3e94 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from django.urls import path
from . import views
urlpatterns = [
path('registro/', views.registro),
path('ajax_registros/', views.ajax_registros),
]
| 18.3 | 50 | 0.666667 |
from django.urls import path
from . import views
urlpatterns = [
path('registro/', views.registro),
path('ajax_registros/', views.ajax_registros),
]
| true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.