hexsha stringlengths 40 40 | size int64 2 1.02M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 245 | max_stars_repo_name stringlengths 6 130 | max_stars_repo_head_hexsha stringlengths 40 40 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 245 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 245 | max_forks_repo_name stringlengths 6 130 | max_forks_repo_head_hexsha stringlengths 40 40 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 2 1.02M | avg_line_length float64 1 958k | max_line_length int64 1 987k | alphanum_fraction float64 0 1 | content_no_comment stringlengths 0 1.01M | is_comment_constant_removed bool 2
classes | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1c2ff5b0c279d00d3c1a682c519050f56c123082 | 2,232 | py | Python | demo/tutorial_TMD.py | aravindhk/Vides | 65d9ea9764ddf5f6ef40e869bd31387d0e3e378f | [
"BSD-4-Clause"
] | 2 | 2021-11-03T17:24:24.000Z | 2021-12-02T06:06:50.000Z | demo/tutorial_TMD.py | aravindhk/Vides | 65d9ea9764ddf5f6ef40e869bd31387d0e3e378f | [
"BSD-4-Clause"
] | null | null | null | demo/tutorial_TMD.py | aravindhk/Vides | 65d9ea9764ddf5f6ef40e869bd31387d0e3e378f | [
"BSD-4-Clause"
] | null | null | null | from NanoTCAD_ViDES import *
import sys
from module_TMD import *
rank = 0
# I create the grid
xg = nonuniformgrid(array([-2.0, 1, 0, 0.05, 2.0, 1]))
FLAKE = TMD(30.0, "n");
acc = FLAKE.acc;
kF = 2 * pi / (3 * sqrt(3) * acc);
kymax = pi / FLAKE.delta;
Nky = 32.0;
dk = kymax / Nky;
FLAKE.kmax = pi / FLAKE.delta;
FLAK... | 24.527473 | 81 | 0.611111 | from NanoTCAD_ViDES import *
import sys
from module_TMD import *
rank = 0
xg = nonuniformgrid(array([-2.0, 1, 0, 0.05, 2.0, 1]))
FLAKE = TMD(30.0, "n");
acc = FLAKE.acc;
kF = 2 * pi / (3 * sqrt(3) * acc);
kymax = pi / FLAKE.delta;
Nky = 32.0;
dk = kymax / Nky;
FLAKE.kmax = pi / FLAKE.delta;
FLAKE.kmin = 0;
FLAKE.d... | true | true |
1c2ff604819a2df5c8840a388bb0d80ce8a53246 | 2,074 | py | Python | Applications/ParaView/Testing/Python/CTHAMRContour.py | mathstuf/ParaView | e867e280545ada10c4ed137f6a966d9d2f3db4cb | [
"Apache-2.0"
] | 2 | 2019-09-27T08:04:34.000Z | 2019-10-16T22:30:54.000Z | Applications/ParaView/Testing/Python/CTHAMRContour.py | mathstuf/ParaView | e867e280545ada10c4ed137f6a966d9d2f3db4cb | [
"Apache-2.0"
] | null | null | null | Applications/ParaView/Testing/Python/CTHAMRContour.py | mathstuf/ParaView | e867e280545ada10c4ed137f6a966d9d2f3db4cb | [
"Apache-2.0"
] | 5 | 2016-04-14T13:42:37.000Z | 2021-05-22T04:59:42.000Z | #/usr/bin/env python
import QtTesting
import QtTestingImage
object1 = 'pqClientMainWindow/MainControlsToolbar/actionOpenData'
QtTesting.playCommand(object1, 'activate', '')
object2 = 'pqClientMainWindow/FileOpenDialog'
QtTesting.playCommand(object2, 'filesSelected', '$PARAVIEW_DATA_ROOT/SPCTH/Dave_Karelitz_Small/spct... | 61 | 188 | 0.831244 |
import QtTesting
import QtTestingImage
object1 = 'pqClientMainWindow/MainControlsToolbar/actionOpenData'
QtTesting.playCommand(object1, 'activate', '')
object2 = 'pqClientMainWindow/FileOpenDialog'
QtTesting.playCommand(object2, 'filesSelected', '$PARAVIEW_DATA_ROOT/SPCTH/Dave_Karelitz_Small/spcth_a')
object3 = 'pqC... | true | true |
1c2ff621565308394041ea1c9e09a28937a17c49 | 12,515 | py | Python | jacket/tests/compute/unit/api/openstack/compute/test_tenant_networks.py | bopopescu/jacket | d7ad3147fcb43131098c2a5210847634ff5fb325 | [
"Apache-2.0"
] | null | null | null | jacket/tests/compute/unit/api/openstack/compute/test_tenant_networks.py | bopopescu/jacket | d7ad3147fcb43131098c2a5210847634ff5fb325 | [
"Apache-2.0"
] | null | null | null | jacket/tests/compute/unit/api/openstack/compute/test_tenant_networks.py | bopopescu/jacket | d7ad3147fcb43131098c2a5210847634ff5fb325 | [
"Apache-2.0"
] | 2 | 2016-08-10T02:21:49.000Z | 2020-07-24T01:57:21.000Z | # Copyright 2014 IBM Corp.
#
# 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 t... | 38.389571 | 87 | 0.665521 |
import copy
import mock
from oslo_config import cfg
import webob
from jacket.api.compute.openstack.compute.legacy_v2.contrib import os_tenant_networks \
as networks
from jacket.api.compute.openstack.compute import tenant_networks \
as networks_v21
from jacket.compute import exception
fro... | true | true |
1c2ff63af1be2d0cda330784b4e1026fce04aee2 | 3,381 | py | Python | domain_trainer.py | wiatrak2/BScThesis | e5dd012fd9052e7088d8464b409dc055dbfcf840 | [
"MIT"
] | null | null | null | domain_trainer.py | wiatrak2/BScThesis | e5dd012fd9052e7088d8464b409dc055dbfcf840 | [
"MIT"
] | null | null | null | domain_trainer.py | wiatrak2/BScThesis | e5dd012fd9052e7088d8464b409dc055dbfcf840 | [
"MIT"
] | null | null | null | import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
from collections import defaultdict, namedtuple
class DomainTrainer:
def __init__(self, models, optims, criterions, device, **kwargs):
self.models = models
self.optims = optims
self.criterions = cr... | 39.313953 | 138 | 0.724933 | import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
from collections import defaultdict, namedtuple
class DomainTrainer:
def __init__(self, models, optims, criterions, device, **kwargs):
self.models = models
self.optims = optims
self.criterions = cr... | true | true |
1c2ff6667032bf51186ac6754942e176dc8d0b6c | 4,355 | py | Python | a10_neutron_lbaas/v1/handler_hm.py | hthompson6/a10-neutron-lbaas | f1639758cd3abcc6c86c8e6b64dcb0397c359621 | [
"Apache-2.0"
] | 10 | 2015-09-15T05:16:15.000Z | 2020-03-18T02:34:39.000Z | a10_neutron_lbaas/v1/handler_hm.py | hthompson6/a10-neutron-lbaas | f1639758cd3abcc6c86c8e6b64dcb0397c359621 | [
"Apache-2.0"
] | 334 | 2015-02-11T23:45:00.000Z | 2020-02-28T08:58:51.000Z | a10_neutron_lbaas/v1/handler_hm.py | hthompson6/a10-neutron-lbaas | f1639758cd3abcc6c86c8e6b64dcb0397c359621 | [
"Apache-2.0"
] | 24 | 2015-01-13T21:14:45.000Z | 2021-06-02T17:22:14.000Z | # Copyright 2014, Doug Wiegley (dougwig), A10 Networks
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required b... | 35.991736 | 82 | 0.60023 |
import acos_client.errors as acos_errors
import logging
from a10_neutron_lbaas.acos import openstack_mappings
from a10_neutron_lbaas.v1 import handler_base_v1
from a10_neutron_lbaas.v1 import v1_context as a10
LOG = logging.getLogger(__name__)
class HealthMonitorHandler(handler_base_v1.HandlerBaseV1)... | true | true |
1c2ff740a6516ce48791949ac6dad97d7a9e429f | 5,737 | py | Python | mixcoatl/platform/relational_database_product.py | zomGreg/mixcoatl | dd8d7e206682955b251d7f858fffee56b11df8c6 | [
"Apache-2.0"
] | null | null | null | mixcoatl/platform/relational_database_product.py | zomGreg/mixcoatl | dd8d7e206682955b251d7f858fffee56b11df8c6 | [
"Apache-2.0"
] | null | null | null | mixcoatl/platform/relational_database_product.py | zomGreg/mixcoatl | dd8d7e206682955b251d7f858fffee56b11df8c6 | [
"Apache-2.0"
] | null | null | null | from mixcoatl.resource import Resource
from mixcoatl.admin.job import Job
from mixcoatl.decorators.lazy import lazy_property
from mixcoatl.utils import uncamel, camelize, camel_keys, uncamel_keys
class RelationalDatabaseProduct(Resource):
"""Represents a product with costs from a cloud relational database vendor.... | 34.14881 | 120 | 0.644413 | from mixcoatl.resource import Resource
from mixcoatl.admin.job import Job
from mixcoatl.decorators.lazy import lazy_property
from mixcoatl.utils import uncamel, camelize, camel_keys, uncamel_keys
class RelationalDatabaseProduct(Resource):
PATH = 'platform/RelationalDatabaseProduct'
COLLECTION_NAME = 'rdbmsPr... | true | true |
1c2ff87a59fc0949bd18ae26bc290ba7f4c77632 | 62 | py | Python | neoepiscope/version.py | jxshi/neoepiscope | 4e9b7de2f355bf1de270e17eda22d176f0bff627 | [
"MIT"
] | 18 | 2018-09-14T23:38:10.000Z | 2022-01-25T22:32:26.000Z | neoepiscope/version.py | jxshi/neoepiscope | 4e9b7de2f355bf1de270e17eda22d176f0bff627 | [
"MIT"
] | 14 | 2018-10-09T17:03:52.000Z | 2021-05-07T07:26:27.000Z | neoepiscope/version.py | jxshi/neoepiscope | 4e9b7de2f355bf1de270e17eda22d176f0bff627 | [
"MIT"
] | 18 | 2018-09-13T21:00:21.000Z | 2022-02-11T07:39:36.000Z | #!/usr/bin/env python
# coding=utf-8
version_number = "0.5.0"
| 15.5 | 24 | 0.677419 |
version_number = "0.5.0"
| true | true |
1c2ff9917e9a0fcc17fee39c454701dcfa689355 | 53,055 | py | Python | netbox/netbox/views/generic.py | mtinberg/netbox | e8d6281007a70553b044f59a3ff6ed6f9d22ea10 | [
"Apache-2.0"
] | 1 | 2022-01-20T11:33:29.000Z | 2022-01-20T11:33:29.000Z | netbox/netbox/views/generic.py | mtinberg/netbox | e8d6281007a70553b044f59a3ff6ed6f9d22ea10 | [
"Apache-2.0"
] | null | null | null | netbox/netbox/views/generic.py | mtinberg/netbox | e8d6281007a70553b044f59a3ff6ed6f9d22ea10 | [
"Apache-2.0"
] | null | null | null | import logging
import re
from copy import deepcopy
from django.contrib import messages
from django.contrib.contenttypes.models import ContentType
from django.core.exceptions import FieldDoesNotExist, ObjectDoesNotExist, ValidationError
from django.db import transaction, IntegrityError
from django.db.models import Many... | 40.592961 | 125 | 0.570276 | import logging
import re
from copy import deepcopy
from django.contrib import messages
from django.contrib.contenttypes.models import ContentType
from django.core.exceptions import FieldDoesNotExist, ObjectDoesNotExist, ValidationError
from django.db import transaction, IntegrityError
from django.db.models import Many... | true | true |
1c2ff9b1862ba7075c4b45778d02b951166dc9c9 | 7,084 | py | Python | chaingreen/cmds/configure.py | todortron/chaingreen-test | 9054bfd79812ebd7fb3a3d341c03dbadea990fd0 | [
"Apache-2.0"
] | null | null | null | chaingreen/cmds/configure.py | todortron/chaingreen-test | 9054bfd79812ebd7fb3a3d341c03dbadea990fd0 | [
"Apache-2.0"
] | null | null | null | chaingreen/cmds/configure.py | todortron/chaingreen-test | 9054bfd79812ebd7fb3a3d341c03dbadea990fd0 | [
"Apache-2.0"
] | null | null | null | from pathlib import Path
from typing import Dict
import click
from chaingreen.util.config import load_config, save_config, str2bool
from chaingreen.util.default_root import DEFAULT_ROOT_PATH
def configure(
root_path: Path,
set_farmer_peer: str,
set_node_introducer: str,
set_fullnode_port: str,
s... | 38.291892 | 100 | 0.621118 | from pathlib import Path
from typing import Dict
import click
from chaingreen.util.config import load_config, save_config, str2bool
from chaingreen.util.default_root import DEFAULT_ROOT_PATH
def configure(
root_path: Path,
set_farmer_peer: str,
set_node_introducer: str,
set_fullnode_port: str,
s... | true | true |
1c2ff9f8f2ebf0991614c3a3a089c07f0b618eb9 | 9,702 | py | Python | benchmarks/f3_wrong_hints/scaling_ltl_infinite_state/16-extending_bound_1.py | EnricoMagnago/F3 | c863215c318d7d5f258eb9be38c6962cf6863b52 | [
"MIT"
] | 3 | 2021-04-23T23:29:26.000Z | 2022-03-23T10:00:30.000Z | benchmarks/f3_wrong_hints/scaling_ltl_infinite_state/16-extending_bound_1.py | EnricoMagnago/F3 | c863215c318d7d5f258eb9be38c6962cf6863b52 | [
"MIT"
] | null | null | null | benchmarks/f3_wrong_hints/scaling_ltl_infinite_state/16-extending_bound_1.py | EnricoMagnago/F3 | c863215c318d7d5f258eb9be38c6962cf6863b52 | [
"MIT"
] | 1 | 2021-11-17T22:02:56.000Z | 2021-11-17T22:02:56.000Z | from typing import Tuple, FrozenSet
from collections import Iterable
from mathsat import msat_term, msat_env
from mathsat import msat_make_constant, msat_declare_function
from mathsat import msat_get_integer_type, msat_get_rational_type, msat_get_bool_type
from mathsat import msat_make_and, msat_make_not, msat_mak... | 35.408759 | 89 | 0.625335 | from typing import Tuple, FrozenSet
from collections import Iterable
from mathsat import msat_term, msat_env
from mathsat import msat_make_constant, msat_declare_function
from mathsat import msat_get_integer_type, msat_get_rational_type, msat_get_bool_type
from mathsat import msat_make_and, msat_make_not, msat_mak... | true | true |
1c2ffaeb75554bbb8fc96f57950559d0ff84f295 | 28,917 | py | Python | electrum_dash/gui/qt/util.py | thephez/electrum-dash | bbf0ba1cc22feebc26d78b5d3b338251a41ca323 | [
"MIT"
] | null | null | null | electrum_dash/gui/qt/util.py | thephez/electrum-dash | bbf0ba1cc22feebc26d78b5d3b338251a41ca323 | [
"MIT"
] | null | null | null | electrum_dash/gui/qt/util.py | thephez/electrum-dash | bbf0ba1cc22feebc26d78b5d3b338251a41ca323 | [
"MIT"
] | null | null | null | import asyncio
import os.path
import time
import sys
import platform
import queue
import traceback
from functools import partial, lru_cache
from typing import NamedTuple, Callable, Optional, TYPE_CHECKING, Union, List, Dict
from PyQt5.QtGui import (QFont, QColor, QCursor, QPixmap, QStandardItem,
... | 34.180851 | 124 | 0.63869 | import asyncio
import os.path
import time
import sys
import platform
import queue
import traceback
from functools import partial, lru_cache
from typing import NamedTuple, Callable, Optional, TYPE_CHECKING, Union, List, Dict
from PyQt5.QtGui import (QFont, QColor, QCursor, QPixmap, QStandardItem,
... | true | true |
1c2ffc104a4e49aee23eb6a73b5f88a7f6995938 | 414 | py | Python | ontask/migrations/0018_auto_20180428_1425.py | pinheiroo27/ontask_b | 23fee8caf4e1c5694a710a77f3004ca5d9effeac | [
"MIT"
] | 33 | 2017-12-02T04:09:24.000Z | 2021-11-07T08:41:57.000Z | ontask/migrations/0018_auto_20180428_1425.py | pinheiroo27/ontask_b | 23fee8caf4e1c5694a710a77f3004ca5d9effeac | [
"MIT"
] | 189 | 2017-11-16T04:06:29.000Z | 2022-03-11T23:35:59.000Z | ontask/migrations/0018_auto_20180428_1425.py | pinheiroo27/ontask_b | 23fee8caf4e1c5694a710a77f3004ca5d9effeac | [
"MIT"
] | 30 | 2017-11-30T03:35:44.000Z | 2022-01-31T03:08:08.000Z | # -*- coding: utf-8 -*-
# Generated by Django 1.11.12 on 2018-04-28 04:25
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('ontask', '0017_auto_20180417_1557'),
]
operations = [
migrations.AlterModelOptions... | 20.7 | 49 | 0.608696 |
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('ontask', '0017_auto_20180417_1557'),
]
operations = [
migrations.AlterModelOptions(
name='column',
options={'ordering': ('-is_key'... | true | true |
1c2ffc8083c9d545f112d5983231edff751831f7 | 3,172 | py | Python | tests/test_record.py | cyemeng/python-little_r | 13aa985c9fd89106acc6260e6c4eeb4eb99111af | [
"BSD-3-Clause"
] | 7 | 2018-03-19T01:39:37.000Z | 2022-01-09T09:19:30.000Z | tests/test_record.py | cyemeng/python-little_r | 13aa985c9fd89106acc6260e6c4eeb4eb99111af | [
"BSD-3-Clause"
] | null | null | null | tests/test_record.py | cyemeng/python-little_r | 13aa985c9fd89106acc6260e6c4eeb4eb99111af | [
"BSD-3-Clause"
] | 4 | 2020-03-20T09:19:59.000Z | 2022-01-09T07:49:50.000Z | import unittest
from datetime import datetime
from little_r import Record
class TestRecord(unittest.TestCase):
def create_sample_record(self, **kwargs):
'''
Creates a toy record.abs
'''
return Record('TestName', 100, 50, None, datetime(2017, 1, 1, 18, 30, 0), **kwargs)
def te... | 38.216867 | 630 | 0.613178 | import unittest
from datetime import datetime
from little_r import Record
class TestRecord(unittest.TestCase):
def create_sample_record(self, **kwargs):
return Record('TestName', 100, 50, None, datetime(2017, 1, 1, 18, 30, 0), **kwargs)
def test_getitem(self):
r = self.create_sample_record(t... | true | true |
1c2ffd8667949f55ea8e8b7327d6c14a76c3d52e | 3,425 | py | Python | gtts/utils.py | scottgigante/gTTS | f17c6d5affc68464f2fc4498cc51b61e8cb704d1 | [
"MIT"
] | null | null | null | gtts/utils.py | scottgigante/gTTS | f17c6d5affc68464f2fc4498cc51b61e8cb704d1 | [
"MIT"
] | null | null | null | gtts/utils.py | scottgigante/gTTS | f17c6d5affc68464f2fc4498cc51b61e8cb704d1 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from .tokenizer.symbols import ALL_PUNC as punc
from string import whitespace as ws
import re
_ALL_PUNC_OR_SPACE = re.compile(u"^[{}]*$".format(re.escape(punc + ws)))
"""Regex that matches if an entire line is only comprised
of whitespace and punctuation
"""
def _minimize(the_string, delim, ... | 33.578431 | 77 | 0.633577 |
from .tokenizer.symbols import ALL_PUNC as punc
from string import whitespace as ws
import re
_ALL_PUNC_OR_SPACE = re.compile(u"^[{}]*$".format(re.escape(punc + ws)))
def _minimize(the_string, delim, max_size):
if the_string.startswith(delim):
the_string = the_string[_len(delim):]
if... | true | true |
1c2ffe7d14d648ccda0d61bed0666a3e5eefeaf2 | 191 | py | Python | streaming/urls.py | joelsegoviacrespo/control_aforo_migrado | be90d1d45a20f735e7ef20449c4ab91ca05b5d85 | [
"MIT"
] | null | null | null | streaming/urls.py | joelsegoviacrespo/control_aforo_migrado | be90d1d45a20f735e7ef20449c4ab91ca05b5d85 | [
"MIT"
] | null | null | null | streaming/urls.py | joelsegoviacrespo/control_aforo_migrado | be90d1d45a20f735e7ef20449c4ab91ca05b5d85 | [
"MIT"
] | null | null | null | # -*- encoding: utf-8 -*-
from django.urls import path
from django.conf.urls import url
from streaming import views
urlpatterns = [
path('', views.streaming, name='streaming'),
] | 23.875 | 56 | 0.675393 |
from django.urls import path
from django.conf.urls import url
from streaming import views
urlpatterns = [
path('', views.streaming, name='streaming'),
] | true | true |
1c2fff320c8eda3af4138c91c695d6aa49179dc9 | 5,681 | py | Python | tests/djinn_regression_example.py | LLNL/DJINN | 3dd40a7f3bd179e1e51f7f7a9991faa457b9546a | [
"BSD-Source-Code"
] | 32 | 2018-07-20T00:00:31.000Z | 2022-02-18T15:35:04.000Z | tests/djinn_regression_example.py | LLNL/DJINN | 3dd40a7f3bd179e1e51f7f7a9991faa457b9546a | [
"BSD-Source-Code"
] | 3 | 2019-09-15T04:34:19.000Z | 2021-06-01T16:41:23.000Z | tests/djinn_regression_example.py | LLNL/DJINN | 3dd40a7f3bd179e1e51f7f7a9991faa457b9546a | [
"BSD-Source-Code"
] | 9 | 2018-07-22T21:02:25.000Z | 2021-04-04T04:57:37.000Z | ###############################################################################
# Copyright (c) 2018, Lawrence Livermore National Security, LLC.
#
# Produced at the Lawrence Livermore National Laboratory
#
# Written by K. Humbird (humbird1@llnl.gov), L. Peterson (peterson76@llnl.gov).
#
# LLNL-CODE-754815
#
# All righ... | 36.416667 | 86 | 0.718007 | true | true | |
1c2fffe06ce7975caa39d9f22dfdacf3c33a8984 | 596 | py | Python | examples/chat/server/wsgi.py | maxmzd/django-eventstream | 20c5bf68263505f3a4ae4abdc5df71e9790b992c | [
"MIT"
] | null | null | null | examples/chat/server/wsgi.py | maxmzd/django-eventstream | 20c5bf68263505f3a4ae4abdc5df71e9790b992c | [
"MIT"
] | null | null | null | examples/chat/server/wsgi.py | maxmzd/django-eventstream | 20c5bf68263505f3a4ae4abdc5df71e9790b992c | [
"MIT"
] | null | null | null | """
WSGI config for server project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/1.11/howto/deployment/wsgi/
"""
import os
import sys
sys.path.append(os.path.dirname(os.path.dirname(os.path.dirname(os.path.dir... | 25.913043 | 93 | 0.778523 |
import os
import sys
sys.path.append(os.path.dirname(os.path.dirname(os.path.dirname(os.path.dirname(__file__)))))
import dotenv
from django.core.wsgi import get_wsgi_application
dotenv.read_dotenv(os.path.join(os.path.dirname(os.path.dirname(__file__)), '.env'))
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "se... | true | true |
1c300254f128afd98e51a0416faca1fd3b346d12 | 1,315 | py | Python | tests/integration/fixtures/__init__.py | ghga-de/datameta-client | f7900027af9d7d1eff23594de79e90e75baa123a | [
"Apache-2.0"
] | 1 | 2021-07-20T12:59:09.000Z | 2021-07-20T12:59:09.000Z | tests/integration/fixtures/__init__.py | ghga-de/datameta-client | f7900027af9d7d1eff23594de79e90e75baa123a | [
"Apache-2.0"
] | 11 | 2021-03-17T20:27:27.000Z | 2021-04-07T16:22:55.000Z | tests/integration/fixtures/__init__.py | ghga-de/datameta-client | f7900027af9d7d1eff23594de79e90e75baa123a | [
"Apache-2.0"
] | null | null | null | import os
import json
from random import choice
from string import ascii_letters, digits
from copy import deepcopy
base_dir = os.path.dirname(os.path.abspath(__file__))
# metadataset fixtures:
metadataset_record_json_path = os.path.join(
base_dir,
"test_metadataset_record.json"
)
with open(metadataset_record... | 24.351852 | 66 | 0.674525 | import os
import json
from random import choice
from string import ascii_letters, digits
from copy import deepcopy
base_dir = os.path.dirname(os.path.abspath(__file__))
metadataset_record_json_path = os.path.join(
base_dir,
"test_metadataset_record.json"
)
with open(metadataset_record_json_path, "r") as jso... | true | true |
1c30030b10dc952c82faa3f440dd0221a612d20e | 90 | py | Python | py-flask/handlers.py | boscoh/rpcseed | 4b9040c57f3d273a96f62cb1db931f2105fe0945 | [
"MIT"
] | 1 | 2021-05-08T12:38:03.000Z | 2021-05-08T12:38:03.000Z | py-flask/handlers.py | boscoh/rpcseed | 4b9040c57f3d273a96f62cb1db931f2105fe0945 | [
"MIT"
] | null | null | null | py-flask/handlers.py | boscoh/rpcseed | 4b9040c57f3d273a96f62cb1db931f2105fe0945 | [
"MIT"
] | null | null | null | config = {}
def setConfig(k, v):
config[k] = v
def getConfig():
return config
| 9 | 20 | 0.577778 | config = {}
def setConfig(k, v):
config[k] = v
def getConfig():
return config
| true | true |
1c30049f639b04b25fc3ecb5c6ec0973f6e2a51a | 1,687 | py | Python | donkeycar/tests/test_tub.py | walzimmer/donkey | b73596400040ce881c0a319b0a4cc3cbd05226da | [
"MIT"
] | null | null | null | donkeycar/tests/test_tub.py | walzimmer/donkey | b73596400040ce881c0a319b0a4cc3cbd05226da | [
"MIT"
] | null | null | null | donkeycar/tests/test_tub.py | walzimmer/donkey | b73596400040ce881c0a319b0a4cc3cbd05226da | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import tempfile
import unittest
from donkeycar.parts.datastore import TubWriter, Tub
import os
import pytest
#fixtures
from .setup import tub, tub_path
def test_tub_load(tub, tub_path):
"""Tub loads from existing tub path."""
t = Tub(tub_path)
assert t is not None
def test_tub_... | 27.209677 | 85 | 0.656194 |
import tempfile
import unittest
from donkeycar.parts.datastore import TubWriter, Tub
import os
import pytest
from .setup import tub, tub_path
def test_tub_load(tub, tub_path):
t = Tub(tub_path)
assert t is not None
def test_tub_update_df(tub):
tub.update_df()
assert len(tub.df) == 128
def test... | true | true |
1c3004d1094d9967cccd10a343c6ff1e02fc35ab | 401 | py | Python | main_project/wsgi.py | rohithb/oneeightyone | c626ae1a8d91ac5650a9af7b9050c3522f0cde71 | [
"MIT"
] | null | null | null | main_project/wsgi.py | rohithb/oneeightyone | c626ae1a8d91ac5650a9af7b9050c3522f0cde71 | [
"MIT"
] | null | null | null | main_project/wsgi.py | rohithb/oneeightyone | c626ae1a8d91ac5650a9af7b9050c3522f0cde71 | [
"MIT"
] | null | null | null | """
WSGI config for main_project project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/1.8/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault("DJANGO_... | 23.588235 | 78 | 0.790524 |
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "main_project.settings")
application = get_wsgi_application()
| true | true |
1c3006d83d52a83c9deb255edfa04d5bb5aa7d84 | 8,148 | py | Python | src/saml2/authn.py | HaToHo/pysaml2 | be15a1e9c5f28cddb28b095f8da720a9f029c5c7 | [
"Apache-2.0"
] | null | null | null | src/saml2/authn.py | HaToHo/pysaml2 | be15a1e9c5f28cddb28b095f8da720a9f029c5c7 | [
"Apache-2.0"
] | null | null | null | src/saml2/authn.py | HaToHo/pysaml2 | be15a1e9c5f28cddb28b095f8da720a9f029c5c7 | [
"Apache-2.0"
] | null | null | null | import logging
import six
import time
import ldap
from saml2 import SAMLError
from saml2.aes import AESCipher
from saml2.httputil import Response
from saml2.httputil import make_cookie
from saml2.httputil import Redirect
from saml2.httputil import Unauthorized
from saml2.httputil import parse_cookie
from six.moves.url... | 30.863636 | 80 | 0.592415 | import logging
import six
import time
import ldap
from saml2 import SAMLError
from saml2.aes import AESCipher
from saml2.httputil import Response
from saml2.httputil import make_cookie
from saml2.httputil import Redirect
from saml2.httputil import Unauthorized
from saml2.httputil import parse_cookie
from six.moves.url... | true | true |
1c3006de92a94f2615760f2a4b6c4585a5947d34 | 54,344 | py | Python | cinder/volume/storwize_svc.py | alexpilotti/cinder | df2f070604dad61738ccd3113016f76f2af20cae | [
"Apache-2.0"
] | null | null | null | cinder/volume/storwize_svc.py | alexpilotti/cinder | df2f070604dad61738ccd3113016f76f2af20cae | [
"Apache-2.0"
] | null | null | null | cinder/volume/storwize_svc.py | alexpilotti/cinder | df2f070604dad61738ccd3113016f76f2af20cae | [
"Apache-2.0"
] | null | null | null | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright (c) 2012 IBM, Inc.
# Copyright (c) 2012 OpenStack LLC.
# 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... | 44.146223 | 79 | 0.533159 |
import random
import re
import string
import time
from cinder import exception
from cinder import flags
from cinder.openstack.common import cfg
from cinder.openstack.common import excutils
from cinder.openstack.common import log as logging
from cinder.volume import san
LOG = logging.getLogger(_... | true | true |
1c3006ed4c173fcdda961ab21b61e392548c69c5 | 8,547 | py | Python | homework_08/teste_diversidade.py | ufpa-organization-repositories/evolutionary-computing | e16786f9619e2b357b94ab91ff3a7b352e6a0d92 | [
"MIT"
] | null | null | null | homework_08/teste_diversidade.py | ufpa-organization-repositories/evolutionary-computing | e16786f9619e2b357b94ab91ff3a7b352e6a0d92 | [
"MIT"
] | null | null | null | homework_08/teste_diversidade.py | ufpa-organization-repositories/evolutionary-computing | e16786f9619e2b357b94ab91ff3a7b352e6a0d92 | [
"MIT"
] | null | null | null | populacao = [[0.7187463206122816, ['011101001110001100100110', '100101001111000000001110']], [0.68102618759073, ['100101111000011110111011', '100101100010100110100100']], [0.6342542148451269, ['100111110001101100101110', '011011100011000111001000']], [0.6241986174388695, ['010111001001101001111110', '100001010010000101... | 474.833333 | 8,020 | 0.803323 | populacao = [[0.7187463206122816, ['011101001110001100100110', '100101001111000000001110']], [0.68102618759073, ['100101111000011110111011', '100101100010100110100100']], [0.6342542148451269, ['100111110001101100101110', '011011100011000111001000']], [0.6241986174388695, ['010111001001101001111110', '100001010010000101... | true | true |
1c300766ce7df5c0b0d884a7c65d71f8177fd028 | 4,172 | py | Python | nfr_badge/src/nfr_badge.py | rrajj/gha-checklist-badges | 77785b93eadf6dc833d30b0e41f04f9b1e31aad8 | [
"MIT"
] | null | null | null | nfr_badge/src/nfr_badge.py | rrajj/gha-checklist-badges | 77785b93eadf6dc833d30b0e41f04f9b1e31aad8 | [
"MIT"
] | null | null | null | nfr_badge/src/nfr_badge.py | rrajj/gha-checklist-badges | 77785b93eadf6dc833d30b0e41f04f9b1e31aad8 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import typing
import re
import os
import argparse
import urllib.parse
class Checklist:
def __init__(self, fname: str):
self.fname = fname
self.content = self.get_file_content()
def get_name(self) -> str:
return Checklist.get_name_from_fname(self.fname)
de... | 29.8 | 113 | 0.575024 |
import typing
import re
import os
import argparse
import urllib.parse
class Checklist:
def __init__(self, fname: str):
self.fname = fname
self.content = self.get_file_content()
def get_name(self) -> str:
return Checklist.get_name_from_fname(self.fname)
def get_file_content(sel... | true | true |
1c3007fd1cfdf2397111890fc42efd0a2462af0b | 8,732 | py | Python | easyreg/seg_unet.py | norveclibalikci/easyreg-mirror | a16254733fe957cc4024923f8dce91412966a189 | [
"Apache-2.0"
] | null | null | null | easyreg/seg_unet.py | norveclibalikci/easyreg-mirror | a16254733fe957cc4024923f8dce91412966a189 | [
"Apache-2.0"
] | null | null | null | easyreg/seg_unet.py | norveclibalikci/easyreg-mirror | a16254733fe957cc4024923f8dce91412966a189 | [
"Apache-2.0"
] | null | null | null | from .modules import Seg_resid
from .utils import *
import torch.nn as nn
from data_pre.partition import partition
class SegUnet(nn.Module):
def __init__(self, opt=None):
super(SegUnet, self).__init__()
self.opt = opt
seg_opt = opt['tsk_set'][('seg',{},"settings for seg task")]
sel... | 46.946237 | 181 | 0.636853 | from .modules import Seg_resid
from .utils import *
import torch.nn as nn
from data_pre.partition import partition
class SegUnet(nn.Module):
def __init__(self, opt=None):
super(SegUnet, self).__init__()
self.opt = opt
seg_opt = opt['tsk_set'][('seg',{},"settings for seg task")]
sel... | true | true |
1c30094813589d02854b0a9a96e186cc2ccb5a7f | 554 | py | Python | sendpdf/templatetags/pdftags.py | kutakitu/django-sendpdf | 9acf779a0ff476020926802c8615ece2932c98fc | [
"MIT"
] | 1 | 2021-02-03T02:53:49.000Z | 2021-02-03T02:53:49.000Z | sendpdf/templatetags/pdftags.py | kutakitu/django-sendpdf | 9acf779a0ff476020926802c8615ece2932c98fc | [
"MIT"
] | 7 | 2020-06-05T16:50:49.000Z | 2021-09-22T17:38:26.000Z | sendpdf/templatetags/pdftags.py | kutakitu/django-sendpdf | 9acf779a0ff476020926802c8615ece2932c98fc | [
"MIT"
] | null | null | null | """Template tags for the app"""
# pylint: disable=invalid-name
import os
from django import template
register = template.Library()
_DIR = os.path.abspath(os.path.dirname(__file__))
@register.simple_tag
def pdf_static(static_url, pdf=None):
"""Static files access
Ensure they are accessed when rendering page ... | 23.083333 | 70 | 0.629964 |
import os
from django import template
register = template.Library()
_DIR = os.path.abspath(os.path.dirname(__file__))
@register.simple_tag
def pdf_static(static_url, pdf=None):
if pdf is not None:
file = os.path.join(
_DIR,
os.pardir,
"static",
static_url
... | true | true |
1c300b0716c3271a0bbfefb3bb87eee655696e0d | 13,947 | py | Python | idaes/apps/caprese/util.py | carldlaird/idaes-pse | cc7a32ca9fa788f483fa8ef85f3d1186ef4a596f | [
"RSA-MD"
] | 112 | 2019-02-11T23:16:36.000Z | 2022-03-23T20:59:57.000Z | idaes/apps/caprese/util.py | carldlaird/idaes-pse | cc7a32ca9fa788f483fa8ef85f3d1186ef4a596f | [
"RSA-MD"
] | 621 | 2019-03-01T14:44:12.000Z | 2022-03-31T19:49:25.000Z | idaes/apps/caprese/util.py | carldlaird/idaes-pse | cc7a32ca9fa788f483fa8ef85f3d1186ef4a596f | [
"RSA-MD"
] | 154 | 2019-02-01T23:46:33.000Z | 2022-03-23T15:07:10.000Z | # -*- coding: utf-8 -*-
#################################################################################
# The Institute for the Design of Advanced Energy Systems Integrated Platform
# Framework (IDAES IP) was produced under the DOE Institute for the
# Design of Advanced Energy Systems (IDAES), and is copyright (c) 20... | 38.210959 | 81 | 0.617839 |
d(var)]:
var.unfix()
for t in time:
for comp in deactivated[t]:
if was_originally_active[id(comp)]:
comp.activate()
def get_violated_bounds(val, bounds):
lower = bounds[0]
upper = bounds[1]
if upper is not None:
if val > upper:
r... | true | true |
1c300b9e48fb395b37683f0bf7739d58f7492cb3 | 107 | py | Python | lab15/account/admin.py | alejo8591/angular-labs | 5c55b966e832e5261554da3f41fc8786bab8dce6 | [
"MIT"
] | null | null | null | lab15/account/admin.py | alejo8591/angular-labs | 5c55b966e832e5261554da3f41fc8786bab8dce6 | [
"MIT"
] | null | null | null | lab15/account/admin.py | alejo8591/angular-labs | 5c55b966e832e5261554da3f41fc8786bab8dce6 | [
"MIT"
] | null | null | null | from django.contrib import admin
from account.models import UserProfile
admin.site.register(UserProfile)
| 17.833333 | 38 | 0.841121 | from django.contrib import admin
from account.models import UserProfile
admin.site.register(UserProfile)
| true | true |
1c300e7efc701415f13755440d3397697b343528 | 11,622 | py | Python | plugin/plugins/generic/src/check_ftp_function.py | crazy-canux/xPlugin_Monitoring | 4a66d26f9d2982609489eaa0f57d6afb16aca37c | [
"Apache-2.0"
] | 2 | 2015-12-17T04:00:30.000Z | 2015-12-22T11:49:01.000Z | plugin/plugins/generic/src/check_ftp_function.py | crazy-canux/xPlugin_Monitoring | 4a66d26f9d2982609489eaa0f57d6afb16aca37c | [
"Apache-2.0"
] | null | null | null | plugin/plugins/generic/src/check_ftp_function.py | crazy-canux/xPlugin_Monitoring | 4a66d26f9d2982609489eaa0f57d6afb16aca37c | [
"Apache-2.0"
] | 1 | 2017-02-20T22:57:17.000Z | 2017-02-20T22:57:17.000Z | #!/usr/bin/env python2.7
# -*- coding: utf-8 -*-
# Copyright (C) Canux CHENG <canuxcheng@gmail.com>
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the "Software"),
# to deal in the Software without restriction, including without li... | 37.980392 | 83 | 0.502925 |
import os
import sys
import logging
import argparse
import ftplib
class Nagios(object):
"""Basic class for nagios."""
def __init__(self, name=None, version='1.0.0', description='For Ftp'):
"""Init class Nagios."""
self._name = os.path.basename(sys.argv[0]) if not nam... | false | true |
1c300ea645b005cc85266fe54fb45e174b556b13 | 2,900 | py | Python | tests/utils/tqdm_test.py | medecau/sciencebeam-utils | 0253139f17c4208ccacdedf6d2c4eb2b062b7721 | [
"MIT"
] | 2 | 2019-07-17T14:53:07.000Z | 2021-09-15T04:47:47.000Z | tests/utils/tqdm_test.py | medecau/sciencebeam-utils | 0253139f17c4208ccacdedf6d2c4eb2b062b7721 | [
"MIT"
] | 108 | 2018-07-24T15:20:54.000Z | 2022-03-28T16:57:39.000Z | tests/utils/tqdm_test.py | medecau/sciencebeam-utils | 0253139f17c4208ccacdedf6d2c4eb2b062b7721 | [
"MIT"
] | 2 | 2020-02-07T10:58:48.000Z | 2021-09-01T10:15:32.000Z | from __future__ import absolute_import
import logging
import sys
from io import StringIO
from sciencebeam_utils.utils.tqdm import (
redirect_logging_to_tqdm,
tqdm_with_logging_redirect,
TqdmLoggingHandler
)
LOGGER = logging.getLogger(__name__)
class TestRedirectLoggingToTqdm:
def test_should_add_a... | 40.277778 | 82 | 0.713793 | from __future__ import absolute_import
import logging
import sys
from io import StringIO
from sciencebeam_utils.utils.tqdm import (
redirect_logging_to_tqdm,
tqdm_with_logging_redirect,
TqdmLoggingHandler
)
LOGGER = logging.getLogger(__name__)
class TestRedirectLoggingToTqdm:
def test_should_add_a... | true | true |
1c300eaca3c75f0dc625939b862d2b27551f5399 | 717 | py | Python | src/twoSumII/search.py | rajitbanerjee/leetcode | 720fcdd88d371e2d6592ceec8370a6760a77bb89 | [
"CC0-1.0"
] | null | null | null | src/twoSumII/search.py | rajitbanerjee/leetcode | 720fcdd88d371e2d6592ceec8370a6760a77bb89 | [
"CC0-1.0"
] | null | null | null | src/twoSumII/search.py | rajitbanerjee/leetcode | 720fcdd88d371e2d6592ceec8370a6760a77bb89 | [
"CC0-1.0"
] | 1 | 2021-04-28T18:17:55.000Z | 2021-04-28T18:17:55.000Z | from typing import List
class Solution:
def twoSum(self, numbers: List[int], target: int) -> List[int]:
for i, n in enumerate(numbers):
left, right = i + 1, len(numbers) - 1
while left <= right:
mid = left + (right - left) // 2
if numbers[mid] == tar... | 29.875 | 67 | 0.470014 | from typing import List
class Solution:
def twoSum(self, numbers: List[int], target: int) -> List[int]:
for i, n in enumerate(numbers):
left, right = i + 1, len(numbers) - 1
while left <= right:
mid = left + (right - left) // 2
if numbers[mid] == tar... | true | true |
1c3010de71681acb956f98ba650a1d48f13db2b5 | 136 | py | Python | app/tools/__init__.py | staneyffer/my_blog | db6220eddb591da5e6368744c9b86eca2cd9696e | [
"MIT"
] | null | null | null | app/tools/__init__.py | staneyffer/my_blog | db6220eddb591da5e6368744c9b86eca2cd9696e | [
"MIT"
] | 3 | 2020-03-24T15:41:12.000Z | 2021-02-02T21:43:38.000Z | app/tools/__init__.py | staneyffer/my_blog | db6220eddb591da5e6368744c9b86eca2cd9696e | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from flask import Blueprint
tools = Blueprint('tools', __name__)
from . import views, jinja_keys, pagination
| 17 | 43 | 0.705882 |
from flask import Blueprint
tools = Blueprint('tools', __name__)
from . import views, jinja_keys, pagination
| true | true |
1c3010f1d6e8270f52a5282e388f1f5fc39129db | 1,728 | py | Python | solum/api/handlers/service_handler.py | devdattakulkarni/test-solum | 4e9ddb82d217116aa2c30a6f2581080cbdfae325 | [
"Apache-2.0"
] | null | null | null | solum/api/handlers/service_handler.py | devdattakulkarni/test-solum | 4e9ddb82d217116aa2c30a6f2581080cbdfae325 | [
"Apache-2.0"
] | null | null | null | solum/api/handlers/service_handler.py | devdattakulkarni/test-solum | 4e9ddb82d217116aa2c30a6f2581080cbdfae325 | [
"Apache-2.0"
] | null | null | null | # Copyright 2014 - Rackspace
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,... | 33.230769 | 75 | 0.66088 |
import uuid
from solum.api.handlers import handler
from solum import objects
class ServiceHandler(handler.Handler):
def get(self, id):
return objects.registry.Service.get_by_uuid(self.context, id)
def update(self, id, data):
updated = objects.registry.Service.update_and_save(s... | true | true |
1c3010ff357f572a4fba07a968d31746208dc1e6 | 3,463 | py | Python | codechef_competition/nov_2020_long_challenge/ADADISH.py | souvikb07/DS-Algo-and-CP | 6333e8f409fb7e6e7a0c42a91d5cf98c7a4d29a2 | [
"MIT"
] | null | null | null | codechef_competition/nov_2020_long_challenge/ADADISH.py | souvikb07/DS-Algo-and-CP | 6333e8f409fb7e6e7a0c42a91d5cf98c7a4d29a2 | [
"MIT"
] | null | null | null | codechef_competition/nov_2020_long_challenge/ADADISH.py | souvikb07/DS-Algo-and-CP | 6333e8f409fb7e6e7a0c42a91d5cf98c7a4d29a2 | [
"MIT"
] | null | null | null | """
Ada and Dishes
Chef Ada is preparing N dishes (numbered 1 through N). For each valid i, it takes Ci minutes to prepare the i-th dish. The dishes can be prepared in any order.
Ada has a kitchen with two identical burners. For each valid i, to prepare the i-th dish, she puts it on one of the burners and after Ci min... | 33.95098 | 159 | 0.663298 |
num_dishes=5
time_dishes=[2,3,4,5,1]
if num_dishes == 1:
print(time_dishes[0])
else:
time_dishes.sort(reverse=True)
burners=[]
i=0
time = 0
while i<=num_dishes:
if i==0 and len(burners)==0:
burners.extend(time_dishes[:2])
print(burners)
min_time = min(... | true | true |
1c3011732b84a4b6984e1fbbcbbc0b70fadf6693 | 1,571 | py | Python | utils/exceptions.py | whateverfw/Fixtures-Builder | 39fa1631f2822eb08059047c1aa56016b79ce670 | [
"MIT"
] | 2 | 2020-07-03T12:25:53.000Z | 2020-07-08T20:42:49.000Z | utils/exceptions.py | whateverfw/Fixtures-Builder | 39fa1631f2822eb08059047c1aa56016b79ce670 | [
"MIT"
] | null | null | null | utils/exceptions.py | whateverfw/Fixtures-Builder | 39fa1631f2822eb08059047c1aa56016b79ce670 | [
"MIT"
] | null | null | null | class InputError(Exception):
def __init__(self) -> None:
self.message = f'''
Expected 2 arguments, got 1
You should run script via: <script_name> <file_name>
e.g. >> main.py somename.csv
'''
def __str__(self) -> str:
return self.message
class Fi... | 28.563636 | 87 | 0.605983 | class InputError(Exception):
def __init__(self) -> None:
self.message = f'''
Expected 2 arguments, got 1
You should run script via: <script_name> <file_name>
e.g. >> main.py somename.csv
'''
def __str__(self) -> str:
return self.message
class Fi... | true | true |
1c30117d7ec4fe8e22b3743475611d1c2b53cd5f | 1,669 | py | Python | odoons/utils/config.py | jiksaa/odoons | 6845b5cd1ad73a1d44f04772b63431c5a54cfca7 | [
"MIT"
] | null | null | null | odoons/utils/config.py | jiksaa/odoons | 6845b5cd1ad73a1d44f04772b63431c5a54cfca7 | [
"MIT"
] | 3 | 2021-10-05T14:29:51.000Z | 2021-10-17T21:52:41.000Z | odoons/utils/config.py | jiksaa/odoons | 6845b5cd1ad73a1d44f04772b63431c5a54cfca7 | [
"MIT"
] | null | null | null | import os
from configparser import ConfigParser, ExtendedInterpolation
from ruamel.yaml import YAML
ADDONS_REQ_INSTALL_CONFIG = "install-requirements"
OPT_APPLY_REQS = "apply-requirements"
OPT_INSTALL_ODOO = "install-odoo-command"
OPT_CONF_TEMPLATE = "config-template"
OPT_CONF_DIR = "config-directory"
OPT_BIN_DIR = ... | 29.280702 | 86 | 0.705812 | import os
from configparser import ConfigParser, ExtendedInterpolation
from ruamel.yaml import YAML
ADDONS_REQ_INSTALL_CONFIG = "install-requirements"
OPT_APPLY_REQS = "apply-requirements"
OPT_INSTALL_ODOO = "install-odoo-command"
OPT_CONF_TEMPLATE = "config-template"
OPT_CONF_DIR = "config-directory"
OPT_BIN_DIR = ... | true | true |
1c3011a1aef962c0d178f92f5ead1609884ae9b8 | 6,176 | py | Python | embedded_gremlin/predicate/base.py | CODAIT/embedded-gremlin | cdeb3b21204fee257b3e53f1afbd3efdca20a29b | [
"Apache-2.0"
] | null | null | null | embedded_gremlin/predicate/base.py | CODAIT/embedded-gremlin | cdeb3b21204fee257b3e53f1afbd3efdca20a29b | [
"Apache-2.0"
] | 1 | 2020-08-18T20:51:13.000Z | 2020-08-18T21:56:33.000Z | embedded_gremlin/predicate/base.py | CODAIT/embedded-gremlin | cdeb3b21204fee257b3e53f1afbd3efdca20a29b | [
"Apache-2.0"
] | 1 | 2020-08-18T21:57:21.000Z | 2020-08-18T21:57:21.000Z | #
# Copyright (c) 2020 IBM Corp.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writi... | 35.291429 | 86 | 0.655602 |
from abc import ABC
from typing import Iterator
import pandas as pd
import numpy as np
from typing import *
from embedded_gremlin.traversal.base import GraphTraversal
class VertexPredicate:
def __init__(self, *children: "VertexPredicate"):
self._children = children
def __call__(s... | true | true |
1c3011a5b4d5c4eb50c3cd4b0799bbb5202d5c1f | 2,029 | py | Python | api/tests/test_elections.py | gsbevilaqua/elections | 3675cbac34bdc691cb9530a05c857cf7bbdd6bb3 | [
"BSD-3-Clause"
] | null | null | null | api/tests/test_elections.py | gsbevilaqua/elections | 3675cbac34bdc691cb9530a05c857cf7bbdd6bb3 | [
"BSD-3-Clause"
] | null | null | null | api/tests/test_elections.py | gsbevilaqua/elections | 3675cbac34bdc691cb9530a05c857cf7bbdd6bb3 | [
"BSD-3-Clause"
] | null | null | null | import os,sys,inspect
current_dir = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe())))
parent_dir = os.path.dirname(current_dir)
sys.path.insert(0, parent_dir)
from Elections import Elections
from nose.tools import assert_equals
elec = None
elec2 = None
def setup_module(module):
global ele... | 31.215385 | 163 | 0.678167 | import os,sys,inspect
current_dir = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe())))
parent_dir = os.path.dirname(current_dir)
sys.path.insert(0, parent_dir)
from Elections import Elections
from nose.tools import assert_equals
elec = None
elec2 = None
def setup_module(module):
global ele... | true | true |
1c3012c4521b2052ec93c1b4ceba47deebfcdad3 | 5,646 | py | Python | common/bin/db_connections/influxdb.py | frankovacevich/aleph | 9b01dcabf3c074e8617e50fffd35c9ee1960eab6 | [
"MIT"
] | null | null | null | common/bin/db_connections/influxdb.py | frankovacevich/aleph | 9b01dcabf3c074e8617e50fffd35c9ee1960eab6 | [
"MIT"
] | null | null | null | common/bin/db_connections/influxdb.py | frankovacevich/aleph | 9b01dcabf3c074e8617e50fffd35c9ee1960eab6 | [
"MIT"
] | null | null | null | """
"""
from influxdb import InfluxDBClient
import datetime
import math
from dateutil.tz import tzutc
class InfluxDBConnection:
def __init__(self, username, password, database, server="localhost", port=8086):
self.server = server
self.port = port
self.username = username
self.pa... | 32.448276 | 175 | 0.481049 |
from influxdb import InfluxDBClient
import datetime
import math
from dateutil.tz import tzutc
class InfluxDBConnection:
def __init__(self, username, password, database, server="localhost", port=8086):
self.server = server
self.port = port
self.username = username
self.password = ... | true | true |
1c3013983f195866dba486e32c2df98ef07bea20 | 6,474 | py | Python | sunpy/visualization/wcsaxes_compat.py | Naman9639/sunpy | 24c0cfbd9b03d7f9554bc86036fac2b78a5fcc56 | [
"BSD-2-Clause"
] | null | null | null | sunpy/visualization/wcsaxes_compat.py | Naman9639/sunpy | 24c0cfbd9b03d7f9554bc86036fac2b78a5fcc56 | [
"BSD-2-Clause"
] | null | null | null | sunpy/visualization/wcsaxes_compat.py | Naman9639/sunpy | 24c0cfbd9b03d7f9554bc86036fac2b78a5fcc56 | [
"BSD-2-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Helpers and Functions to make WCSAxes work in SunPy
"""
import matplotlib.pyplot as plt
import astropy.units as u
try:
from astropy.visualization import wcsaxes
except ImportError:
raise ImportError("Astropy >= 1.3 is required to use SunPy")
# Force is put here to enable disablin... | 25.690476 | 96 | 0.637319 |
import matplotlib.pyplot as plt
import astropy.units as u
try:
from astropy.visualization import wcsaxes
except ImportError:
raise ImportError("Astropy >= 1.3 is required to use SunPy")
_FORCE_NO_WCSAXES = False
__all__ = ['is_wcsaxes']
def is_wcsaxes(axes):
if not _FORCE_NO_WCSAXES:
retur... | true | true |
1c3013bd2cebdebd315d8f3d429bbca5d0355513 | 2,852 | py | Python | tests/components/demo/test_geo_location.py | OpenPeerPower/openpeerpower | 940a04a88e8f78e2d010dc912ad6905ae363503c | [
"Apache-2.0"
] | null | null | null | tests/components/demo/test_geo_location.py | OpenPeerPower/openpeerpower | 940a04a88e8f78e2d010dc912ad6905ae363503c | [
"Apache-2.0"
] | null | null | null | tests/components/demo/test_geo_location.py | OpenPeerPower/openpeerpower | 940a04a88e8f78e2d010dc912ad6905ae363503c | [
"Apache-2.0"
] | 1 | 2019-04-24T14:10:08.000Z | 2019-04-24T14:10:08.000Z | """The tests for the demo platform."""
import unittest
from unittest.mock import patch
from openpeerpower.components import geo_location
from openpeerpower.components.demo.geo_location import (
DEFAULT_UNIT_OF_MEASUREMENT,
DEFAULT_UPDATE_INTERVAL,
NUMBER_OF_DEMO_DEVICES,
)
from openpeerpower.setup import s... | 36.564103 | 88 | 0.615007 | import unittest
from unittest.mock import patch
from openpeerpower.components import geo_location
from openpeerpower.components.demo.geo_location import (
DEFAULT_UNIT_OF_MEASUREMENT,
DEFAULT_UPDATE_INTERVAL,
NUMBER_OF_DEMO_DEVICES,
)
from openpeerpower.setup import setup_component
import openpeerpower.uti... | true | true |
1c30141ccdd08330d522e5467a59ee6418280bb7 | 35,375 | py | Python | bindings/python/crocoddyl/utils/quadruped.py | pFernbach/crocoddyl | cbf81a329e3abaf4ce1b4a8fab1431f93cd9a5c8 | [
"BSD-3-Clause"
] | null | null | null | bindings/python/crocoddyl/utils/quadruped.py | pFernbach/crocoddyl | cbf81a329e3abaf4ce1b4a8fab1431f93cd9a5c8 | [
"BSD-3-Clause"
] | null | null | null | bindings/python/crocoddyl/utils/quadruped.py | pFernbach/crocoddyl | cbf81a329e3abaf4ce1b4a8fab1431f93cd9a5c8 | [
"BSD-3-Clause"
] | null | null | null | import crocoddyl
import pinocchio
import numpy as np
class SimpleQuadrupedalGaitProblem:
def __init__(self, rmodel, lfFoot, rfFoot, lhFoot, rhFoot):
self.rmodel = rmodel
self.rdata = rmodel.createData()
self.state = crocoddyl.StateMultibody(self.rmodel)
self.actuation = crocoddyl.A... | 48.860497 | 119 | 0.607322 | import crocoddyl
import pinocchio
import numpy as np
class SimpleQuadrupedalGaitProblem:
def __init__(self, rmodel, lfFoot, rfFoot, lhFoot, rhFoot):
self.rmodel = rmodel
self.rdata = rmodel.createData()
self.state = crocoddyl.StateMultibody(self.rmodel)
self.actuation = crocoddyl.A... | true | true |
1c3014f133ce0417cca626cf3e8e7c76faf83681 | 455 | py | Python | plotly/validators/histogram2dcontour/_zsrc.py | gnestor/plotly.py | a8ae062795ddbf9867b8578fe6d9e244948c15ff | [
"MIT"
] | 12 | 2020-04-18T18:10:22.000Z | 2021-12-06T10:11:15.000Z | plotly/validators/histogram2dcontour/_zsrc.py | Vesauza/plotly.py | e53e626d59495d440341751f60aeff73ff365c28 | [
"MIT"
] | 27 | 2020-04-28T21:23:12.000Z | 2021-06-25T15:36:38.000Z | plotly/validators/histogram2dcontour/_zsrc.py | Vesauza/plotly.py | e53e626d59495d440341751f60aeff73ff365c28 | [
"MIT"
] | 6 | 2020-04-18T23:07:08.000Z | 2021-11-18T07:53:06.000Z | import _plotly_utils.basevalidators
class ZsrcValidator(_plotly_utils.basevalidators.SrcValidator):
def __init__(
self, plotly_name='zsrc', parent_name='histogram2dcontour', **kwargs
):
super(ZsrcValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_na... | 28.4375 | 76 | 0.630769 | import _plotly_utils.basevalidators
class ZsrcValidator(_plotly_utils.basevalidators.SrcValidator):
def __init__(
self, plotly_name='zsrc', parent_name='histogram2dcontour', **kwargs
):
super(ZsrcValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_na... | true | true |
1c3016aefbeb82d751c16adfb3029bb4fb855ea9 | 665 | py | Python | tests/src/metrics/recall_vs_loc.py | bellwethers-in-se/issueCloseTime | e5e00c9625da0793dc8e7985fd88b0ca0b35f7d3 | [
"MIT"
] | 9 | 2017-07-27T10:32:48.000Z | 2021-07-01T11:51:51.000Z | tests/src/metrics/recall_vs_loc.py | bellwethers-in-se/issueCloseTime | e5e00c9625da0793dc8e7985fd88b0ca0b35f7d3 | [
"MIT"
] | 11 | 2016-03-15T16:27:47.000Z | 2019-09-05T02:25:08.000Z | tests/src/metrics/recall_vs_loc.py | bellwethers-in-se/issueCloseTime | e5e00c9625da0793dc8e7985fd88b0ca0b35f7d3 | [
"MIT"
] | 5 | 2017-01-28T22:45:34.000Z | 2019-12-04T13:15:10.000Z | from __future__ import print_function, division
import numpy as np
from pdb import set_trace
def get_curve(loc, actual, predicted):
sorted_loc = np.array(loc)[np.argsort(loc)]
sorted_act = np.array(actual)[np.argsort(loc)]
sorted_prd = np.array(predicted)[np.argsort(loc)]
recall, loc = [], []
tp,... | 30.227273 | 59 | 0.598496 | from __future__ import print_function, division
import numpy as np
from pdb import set_trace
def get_curve(loc, actual, predicted):
sorted_loc = np.array(loc)[np.argsort(loc)]
sorted_act = np.array(actual)[np.argsort(loc)]
sorted_prd = np.array(predicted)[np.argsort(loc)]
recall, loc = [], []
tp,... | true | true |
1c3016bf5a6af05377f952d07ae5fcdd8087d536 | 1,357 | py | Python | dash_docs/reusable_components/WorkspaceBlurb.py | jbampton/dash-docs | 33348057877ebd33622b514fc6073038c431976a | [
"MIT"
] | null | null | null | dash_docs/reusable_components/WorkspaceBlurb.py | jbampton/dash-docs | 33348057877ebd33622b514fc6073038c431976a | [
"MIT"
] | null | null | null | dash_docs/reusable_components/WorkspaceBlurb.py | jbampton/dash-docs | 33348057877ebd33622b514fc6073038c431976a | [
"MIT"
] | null | null | null | import dash_core_components as dcc
import dash_html_components as html
def image(vendor):
return html.A(
[
html.Img(
src='/assets/images/dds/{}-logo.png'.format(vendor)
),
html.Div(
'Install Dash Enterprise on {}'.format(vendor),
... | 31.55814 | 150 | 0.582903 | import dash_core_components as dcc
import dash_html_components as html
def image(vendor):
return html.A(
[
html.Img(
src='/assets/images/dds/{}-logo.png'.format(vendor)
),
html.Div(
'Install Dash Enterprise on {}'.format(vendor),
... | true | true |
1c3018d33d41f38ee26f5532c311979cf53838ae | 554 | py | Python | waffle/migrations/0004_update_everyone_nullbooleanfield.py | DavidCain/django-waffle | 006626cac66af6034b88d60712e87509b792cc97 | [
"BSD-3-Clause"
] | 313 | 2015-01-04T11:47:41.000Z | 2018-10-31T09:47:28.000Z | waffle/migrations/0004_update_everyone_nullbooleanfield.py | DavidCain/django-waffle | 006626cac66af6034b88d60712e87509b792cc97 | [
"BSD-3-Clause"
] | 167 | 2015-01-02T18:10:17.000Z | 2018-11-03T18:11:06.000Z | waffle/migrations/0004_update_everyone_nullbooleanfield.py | DavidCain/django-waffle | 006626cac66af6034b88d60712e87509b792cc97 | [
"BSD-3-Clause"
] | 138 | 2015-01-06T21:10:04.000Z | 2018-10-11T12:44:57.000Z | # Generated by Django 3.0.9 on 2020-08-18 04:55
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('waffle', '0003_update_strings_for_i18n'),
]
operations = [
migrations.AlterField(
model_name='flag',
name='everyone'... | 29.157895 | 214 | 0.649819 |
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('waffle', '0003_update_strings_for_i18n'),
]
operations = [
migrations.AlterField(
model_name='flag',
name='everyone',
field=models.BooleanField(blank=T... | true | true |
1c30192485317796fd46fb75d6de82b58e94da2a | 4,717 | py | Python | src/rogerthat/bizz/debugging.py | goubertbrent/oca-backend | b9f59cc02568aecb55d4b54aec05245790ea25fd | [
"Apache-2.0"
] | null | null | null | src/rogerthat/bizz/debugging.py | goubertbrent/oca-backend | b9f59cc02568aecb55d4b54aec05245790ea25fd | [
"Apache-2.0"
] | null | null | null | src/rogerthat/bizz/debugging.py | goubertbrent/oca-backend | b9f59cc02568aecb55d4b54aec05245790ea25fd | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright 2020 Green Valley Belgium NV
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appl... | 44.084112 | 112 | 0.744541 |
import base64
from google.appengine.ext import deferred, db
from mcfw.properties import azzert
from mcfw.rpc import returns, arguments
from rogerthat.bizz.system import start_log_forwarding, delete_xmpp_account
from rogerthat.consts import SCHEDULED_QUEUE
from rogerthat.dal.mobile import get_mobile_b... | true | true |
1c301ba946adcd8381d52d5601d669c6459a142b | 405 | py | Python | rand_param_envs/gym/envs/classic_control/__init__.py | erinaldi/MetaRL | 6dfb8d2e63a1802ca7ef9c28f6ab1a758d07f871 | [
"MIT"
] | 24 | 2021-03-24T07:14:52.000Z | 2022-03-17T08:15:44.000Z | rand_param_envs/gym/envs/classic_control/__init__.py | erinaldi/MetaRL | 6dfb8d2e63a1802ca7ef9c28f6ab1a758d07f871 | [
"MIT"
] | 12 | 2021-02-02T22:53:59.000Z | 2022-03-12T00:41:30.000Z | rand_param_envs/gym/envs/classic_control/__init__.py | erinaldi/MetaRL | 6dfb8d2e63a1802ca7ef9c28f6ab1a758d07f871 | [
"MIT"
] | 6 | 2021-04-12T18:49:47.000Z | 2021-09-07T05:33:22.000Z | from rand_param_envs.gym.envs.classic_control.cartpole import CartPoleEnv
from rand_param_envs.gym.envs.classic_control.mountain_car import MountainCarEnv
from rand_param_envs.gym.envs.classic_control.continuous_mountain_car import Continuous_MountainCarEnv
from rand_param_envs.gym.envs.classic_control.pendulum import ... | 57.857143 | 102 | 0.898765 | from rand_param_envs.gym.envs.classic_control.cartpole import CartPoleEnv
from rand_param_envs.gym.envs.classic_control.mountain_car import MountainCarEnv
from rand_param_envs.gym.envs.classic_control.continuous_mountain_car import Continuous_MountainCarEnv
from rand_param_envs.gym.envs.classic_control.pendulum import ... | true | true |
1c301c0af1297402d729bdd00ef91beeec46e0f8 | 1,294 | py | Python | doc/source/cookbook/halo_profiler.py | cphyc/yt_astro_analysis | 68fbf5370d716734fcd31a95cbd108efff46980a | [
"BSD-3-Clause-Clear"
] | null | null | null | doc/source/cookbook/halo_profiler.py | cphyc/yt_astro_analysis | 68fbf5370d716734fcd31a95cbd108efff46980a | [
"BSD-3-Clause-Clear"
] | null | null | null | doc/source/cookbook/halo_profiler.py | cphyc/yt_astro_analysis | 68fbf5370d716734fcd31a95cbd108efff46980a | [
"BSD-3-Clause-Clear"
] | null | null | null | import yt
from yt.extensions.astro_analysis.halo_analysis.api import HaloCatalog
# Load the data set with the full simulation information
# and rockstar halos
data_ds = yt.load('Enzo_64/RD0006/RedshiftOutput0006')
halos_ds = yt.load('rockstar_halos/halos_0.0.bin')
# Instantiate a catalog using those two parameter fil... | 35.944444 | 71 | 0.722566 | import yt
from yt.extensions.astro_analysis.halo_analysis.api import HaloCatalog
data_ds = yt.load('Enzo_64/RD0006/RedshiftOutput0006')
halos_ds = yt.load('rockstar_halos/halos_0.0.bin')
hc = HaloCatalog(data_ds=data_ds, halos_ds=halos_ds)
hc.add_filter("quantity_value", "particle_mass", ">", 1e14, "Msun")
hc... | true | true |
1c301ce7b9000ab96cc831f7a72d44f6394b3e08 | 10,714 | py | Python | plugins/Channel/test.py | atr000/Limnoria | 1f60a9487ca4114f040135fb14cabc155a041918 | [
"BSD-3-Clause"
] | null | null | null | plugins/Channel/test.py | atr000/Limnoria | 1f60a9487ca4114f040135fb14cabc155a041918 | [
"BSD-3-Clause"
] | null | null | null | plugins/Channel/test.py | atr000/Limnoria | 1f60a9487ca4114f040135fb14cabc155a041918 | [
"BSD-3-Clause"
] | 1 | 2021-01-23T21:20:57.000Z | 2021-01-23T21:20:57.000Z | ###
# Copyright (c) 2002-2005, Jeremiah Fincher
# Copyright (c) 2009, James Vega
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyri... | 46.380952 | 82 | 0.617416 |
rom supybot.test import *
import supybot.conf as conf
import supybot.ircdb as ircdb
import supybot.ircmsgs as ircmsgs
class ChannelTestCase(ChannelPluginTestCase):
plugins = ('Channel', 'User')
def setUp(self):
super(ChannelTestCase, self).setUp()
self.irc.state.chann... | true | true |
1c301d0241b470c8b887c9d429844e8d2f0f4a77 | 5,954 | py | Python | cloud/cdk/baseline_cdk/resources/cfnres_iot_fleet.py | MartinMReed/aws-iot-baseline | 61bdc51708e6f4480d0117a43f0adde5f6a63506 | [
"MIT"
] | 1 | 2021-12-31T05:05:30.000Z | 2021-12-31T05:05:30.000Z | cloud/cdk/baseline_cdk/resources/cfnres_iot_fleet.py | nelsestu/thing-expert | 2e105d718c386258d8efdb329ea60da1072ffbe8 | [
"MIT"
] | null | null | null | cloud/cdk/baseline_cdk/resources/cfnres_iot_fleet.py | nelsestu/thing-expert | 2e105d718c386258d8efdb329ea60da1072ffbe8 | [
"MIT"
] | 1 | 2021-04-05T23:44:12.000Z | 2021-04-05T23:44:12.000Z | import os
import zipfile
from aws_cdk import aws_cloudformation
from aws_cdk import aws_iam
from aws_cdk import aws_lambda
from aws_cdk import core
from aws_cdk.core import RemovalPolicy
from baseline_cdk.resources import cfnres_log_group
from baseline_cdk.util import cdk
from baseline_cdk.util.hash import file_sha1
... | 34.416185 | 103 | 0.620591 | import os
import zipfile
from aws_cdk import aws_cloudformation
from aws_cdk import aws_iam
from aws_cdk import aws_lambda
from aws_cdk import core
from aws_cdk.core import RemovalPolicy
from baseline_cdk.resources import cfnres_log_group
from baseline_cdk.util import cdk
from baseline_cdk.util.hash import file_sha1
... | true | true |
1c301e36e501a99e2df8a590d3a6447d4a83d534 | 422 | py | Python | cadastros/migrations/0006_pcvaga_data_criacao.py | lhggomes/vagas | 84b429d642f1703d067ce12735875a8b95769b3f | [
"Unlicense"
] | null | null | null | cadastros/migrations/0006_pcvaga_data_criacao.py | lhggomes/vagas | 84b429d642f1703d067ce12735875a8b95769b3f | [
"Unlicense"
] | null | null | null | cadastros/migrations/0006_pcvaga_data_criacao.py | lhggomes/vagas | 84b429d642f1703d067ce12735875a8b95769b3f | [
"Unlicense"
] | null | null | null | # Generated by Django 3.1.4 on 2020-12-20 02:30
import datetime
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('cadastros', '0005_auto_20201208_2339'),
]
operations = [
migrations.AddField(
model_name='pcvaga',
n... | 21.1 | 64 | 0.623223 |
import datetime
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('cadastros', '0005_auto_20201208_2339'),
]
operations = [
migrations.AddField(
model_name='pcvaga',
name='data_criacao',
field=models.Da... | true | true |
1c301f3501a192ccb0b9ef84509c69d14ee42689 | 68 | py | Python | psi/data/api.py | bburan/psiexperiment | 9b70f7f0b4a4379d8c3fc463e1df272153afd247 | [
"MIT"
] | 5 | 2016-05-26T13:46:00.000Z | 2020-03-03T13:07:47.000Z | psi/data/api.py | bburan/psiexperiment | 9b70f7f0b4a4379d8c3fc463e1df272153afd247 | [
"MIT"
] | 2 | 2018-04-17T15:06:35.000Z | 2019-03-25T18:13:10.000Z | psi/data/api.py | psiexperiment/psiexperiment | 2701558e1d0637b8a5d6762912dfb5c183f3be87 | [
"MIT"
] | 3 | 2020-04-17T15:03:36.000Z | 2022-01-14T23:19:29.000Z | from .plots import FFTContainer, PlotContainer, ResultPlot, ViewBox
| 34 | 67 | 0.838235 | from .plots import FFTContainer, PlotContainer, ResultPlot, ViewBox
| true | true |
1c301f6cb8cae54e2b472abd80d09c9c70abf531 | 13,322 | py | Python | ctapipe/reco/HillasReconstructor.py | mpecimotika/ctapipe | ffd7930921f7139b761fbf1208da16dd302e97a6 | [
"BSD-3-Clause"
] | null | null | null | ctapipe/reco/HillasReconstructor.py | mpecimotika/ctapipe | ffd7930921f7139b761fbf1208da16dd302e97a6 | [
"BSD-3-Clause"
] | null | null | null | ctapipe/reco/HillasReconstructor.py | mpecimotika/ctapipe | ffd7930921f7139b761fbf1208da16dd302e97a6 | [
"BSD-3-Clause"
] | null | null | null | """
Line-intersection-based fitting.
Contact: Tino Michael <Tino.Michael@cea.fr>
"""
from ctapipe.reco.reco_algorithms import Reconstructor
from ctapipe.io.containers import ReconstructedShowerContainer
from ctapipe.coordinates import HorizonFrame, CameraFrame, GroundFrame, TiltedGroundFrame, project_to_ground
from ... | 33.388471 | 108 | 0.617325 |
from ctapipe.reco.reco_algorithms import Reconstructor
from ctapipe.io.containers import ReconstructedShowerContainer
from ctapipe.coordinates import HorizonFrame, CameraFrame, GroundFrame, TiltedGroundFrame, project_to_ground
from astropy.coordinates import SkyCoord, spherical_to_cartesian, cartesian_to_spherical
fr... | true | true |
1c301fc86aa3e71ef49092f8fcb7561db23b5210 | 91 | py | Python | plugins/googleanalytics/kpireport_googleanalytics/__init__.py | diurnalist/kpireporter | b3ce9ca52567405557ea12f45c1a7fda076d746a | [
"BlueOak-1.0.0",
"Apache-2.0"
] | 9 | 2021-05-17T05:32:46.000Z | 2022-03-16T22:49:26.000Z | plugins/googleanalytics/kpireport_googleanalytics/__init__.py | diurnalist/kpireporter | b3ce9ca52567405557ea12f45c1a7fda076d746a | [
"BlueOak-1.0.0",
"Apache-2.0"
] | 4 | 2020-10-10T23:38:20.000Z | 2020-11-08T22:41:24.000Z | plugins/googleanalytics/kpireport_googleanalytics/__init__.py | diurnalist/kpireporter | b3ce9ca52567405557ea12f45c1a7fda076d746a | [
"BlueOak-1.0.0",
"Apache-2.0"
] | 1 | 2021-01-12T02:49:04.000Z | 2021-01-12T02:49:04.000Z | from .datasource import GoogleAnalyticsDatasource
__all__ = ["GoogleAnalyticsDatasource"]
| 22.75 | 49 | 0.846154 | from .datasource import GoogleAnalyticsDatasource
__all__ = ["GoogleAnalyticsDatasource"]
| true | true |
1c302026c6f18a359f53fe88062140ac1d30261b | 890 | py | Python | tests/test_table_metadata.py | Synicix/DJ-GUI-API | 9afcf242f5f62c7d03c219380bf8490b46257f58 | [
"MIT"
] | null | null | null | tests/test_table_metadata.py | Synicix/DJ-GUI-API | 9afcf242f5f62c7d03c219380bf8490b46257f58 | [
"MIT"
] | null | null | null | tests/test_table_metadata.py | Synicix/DJ-GUI-API | 9afcf242f5f62c7d03c219380bf8490b46257f58 | [
"MIT"
] | null | null | null | from . import SCHEMA_PREFIX, client, token, connection, schemas_simple
def test_definition(token, client, schemas_simple):
simple1, simple2 = schemas_simple
REST_definition = client.post('/get_table_definition',
headers=dict(Authorization=f'Bearer {token}'),
... | 52.352941 | 80 | 0.573034 | from . import SCHEMA_PREFIX, client, token, connection, schemas_simple
def test_definition(token, client, schemas_simple):
simple1, simple2 = schemas_simple
REST_definition = client.post('/get_table_definition',
headers=dict(Authorization=f'Bearer {token}'),
... | true | true |
1c3022538e0d8a8157a20448e2808121b074799c | 4,841 | py | Python | app.py | parzibyte/camara_vigilancia_flask_python_opencv | ef4e186066128fbf4aac7bf9b5073443c1a432ea | [
"MIT"
] | 2 | 2021-03-04T11:39:13.000Z | 2021-10-09T00:25:01.000Z | app.py | parzibyte/camara_vigilancia_flask_python_opencv | ef4e186066128fbf4aac7bf9b5073443c1a432ea | [
"MIT"
] | null | null | null | app.py | parzibyte/camara_vigilancia_flask_python_opencv | ef4e186066128fbf4aac7bf9b5073443c1a432ea | [
"MIT"
] | null | null | null | """
____ _____ _ _ _
| _ \ | __ \ (_) | | |
| |_) |_ _ | |__) |_ _ _ __ _____| |__ _ _| |_ ___
| _ <| | | | | ___/ _` | '__|_ / | '_ \| | | | __/ _ \
| |_) | |_| | | | | (_| | | / /| | |_) | |_| | || __/
|____/ \__, | |_| ... | 29.882716 | 107 | 0.606899 |
import cv2
import utiles
from flask import Flask, render_template, Response, jsonify
app = Flask(__name__)
camara = cv2.VideoCapture(0)
FRAMES_VIDEO = 20.0
RESOLUCION_VIDEO = (640, 480)
NTE_FECHA_Y_HORA = cv2.FONT_HERSHEY_PLAIN
ESCALA_FUENTE = 1
COLOR_FECHA_HORA = (255, 255, 255)
GROSOR_TEXTO = 1
TIPO_LINEA_TEXTO... | true | true |
1c3023b6c0572515d2d8db0cd59ac6cbd42856ee | 728 | py | Python | memex-datawake-stream/src/datawakeio/data_connector.py | fritojay/Datawake-Legacy | 67fe147ee20a540ebe32d5d7a4fdb97708c0bb2e | [
"Apache-2.0"
] | 5 | 2015-11-11T18:54:21.000Z | 2018-03-03T22:25:12.000Z | memex-datawake-stream/src/datawakeio/data_connector.py | fritojay/Datawake-Legacy | 67fe147ee20a540ebe32d5d7a4fdb97708c0bb2e | [
"Apache-2.0"
] | null | null | null | memex-datawake-stream/src/datawakeio/data_connector.py | fritojay/Datawake-Legacy | 67fe147ee20a540ebe32d5d7a4fdb97708c0bb2e | [
"Apache-2.0"
] | 3 | 2015-10-29T10:22:52.000Z | 2017-09-01T19:34:21.000Z | class ExtractedDataConnector:
def __init__(self):
pass
def open(self):
raise NotImplementedError("Implement open()")
def close(self):
raise NotImplementedError("Implement close()")
def _check_conn(self):
raise NotImplementedError("Implement _checkConn()")
de... | 20.8 | 77 | 0.70467 | class ExtractedDataConnector:
def __init__(self):
pass
def open(self):
raise NotImplementedError("Implement open()")
def close(self):
raise NotImplementedError("Implement close()")
def _check_conn(self):
raise NotImplementedError("Implement _checkConn()")
de... | true | true |
1c3023eb4b1e14ac3f341041f735ae9f153653cd | 20,551 | py | Python | v0.5/classification_and_detection/python/main.py | goldgeisser/inference | 42c68883f6f60bf6e0d0253c1bb797a285e2d5f2 | [
"Apache-2.0"
] | null | null | null | v0.5/classification_and_detection/python/main.py | goldgeisser/inference | 42c68883f6f60bf6e0d0253c1bb797a285e2d5f2 | [
"Apache-2.0"
] | null | null | null | v0.5/classification_and_detection/python/main.py | goldgeisser/inference | 42c68883f6f60bf6e0d0253c1bb797a285e2d5f2 | [
"Apache-2.0"
] | 1 | 2018-11-20T16:59:07.000Z | 2018-11-20T16:59:07.000Z | """
mlperf inference benchmarking tool
"""
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import argparse
import array
import collections
import json
import logging
import os
import threading
import time
from queue import Queue
import mlperf_loadgen as l... | 36.895871 | 117 | 0.618753 |
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import argparse
import array
import collections
import json
import logging
import os
import threading
import time
from queue import Queue
import mlperf_loadgen as lg
import numpy as np
import dataset
import... | true | true |
1c302425028a7aa9aebab9f105a5f7dcc50bb75b | 65 | py | Python | hobo/__main__.py | mikewaters/hobo | d3a5376b55a99096488f3f2ad8e42b533de73114 | [
"MIT"
] | null | null | null | hobo/__main__.py | mikewaters/hobo | d3a5376b55a99096488f3f2ad8e42b533de73114 | [
"MIT"
] | 4 | 2015-05-07T14:06:44.000Z | 2015-05-08T17:03:27.000Z | hobo/__main__.py | mikewaters/hobo | d3a5376b55a99096488f3f2ad8e42b533de73114 | [
"MIT"
] | null | null | null | import sys
from hobo.cli import main
sys.exit(0 if main() else 1) | 21.666667 | 28 | 0.753846 | import sys
from hobo.cli import main
sys.exit(0 if main() else 1) | true | true |
1c302609075c3022a8f0051bb2399c8416c54fdc | 7,961 | py | Python | FClip/postprocess.py | Delay-Xili/F-Clip | ea5a7b2ddba8f4baf57e62962b479d8f0447bd65 | [
"MIT"
] | 93 | 2021-04-22T03:20:27.000Z | 2022-03-27T02:21:49.000Z | FClip/postprocess.py | Delay-Xili/F-Clip | ea5a7b2ddba8f4baf57e62962b479d8f0447bd65 | [
"MIT"
] | 10 | 2021-04-23T09:30:37.000Z | 2022-02-28T10:24:41.000Z | FClip/postprocess.py | Delay-Xili/F-Clip | ea5a7b2ddba8f4baf57e62962b479d8f0447bd65 | [
"MIT"
] | 9 | 2021-04-22T05:21:26.000Z | 2022-03-17T07:57:45.000Z | import numpy as np
import torch
def pline(x1, y1, x2, y2, x, y):
"""the L2 distance from n(x,y) to line n1 n2"""
px = x2 - x1
py = y2 - y1
dd = px * px + py * py
u = ((x - x1) * px + (y - y1) * py) / max(1e-9, float(dd))
dx = x1 + u * px - x
dy = y1 + u * py - y
return dx * dx + dy * d... | 32.361789 | 115 | 0.495415 | import numpy as np
import torch
def pline(x1, y1, x2, y2, x, y):
px = x2 - x1
py = y2 - y1
dd = px * px + py * py
u = ((x - x1) * px + (y - y1) * py) / max(1e-9, float(dd))
dx = x1 + u * px - x
dy = y1 + u * py - y
return dx * dx + dy * dy
def psegment(x1, y1, x2, y2, x, y):
px = x2 ... | true | true |
1c3026900b6f2bd8aa4de380eff71a596a25b011 | 950 | py | Python | forms.py | HarrySng/itoi | b2b23dea542299c3c0156b5e32994a154323b881 | [
"MIT"
] | null | null | null | forms.py | HarrySng/itoi | b2b23dea542299c3c0156b5e32994a154323b881 | [
"MIT"
] | null | null | null | forms.py | HarrySng/itoi | b2b23dea542299c3c0156b5e32994a154323b881 | [
"MIT"
] | null | null | null | from flask_wtf import FlaskForm, Form
from flask_wtf.file import FileField, FileRequired
from wtforms import StringField, IntegerField, TextAreaField, DateTimeField, BooleanField, SelectField, PasswordField, SubmitField
from wtforms.validators import DataRequired, Optional
class loginForm(FlaskForm):
mngrID = StringF... | 52.777778 | 130 | 0.776842 | from flask_wtf import FlaskForm, Form
from flask_wtf.file import FileField, FileRequired
from wtforms import StringField, IntegerField, TextAreaField, DateTimeField, BooleanField, SelectField, PasswordField, SubmitField
from wtforms.validators import DataRequired, Optional
class loginForm(FlaskForm):
mngrID = StringF... | true | true |
1c30272f6c0631c8d6b19553eea6f9d98f4e42c1 | 1,635 | py | Python | data_loader.py | Deepika1108/Facial-Expression-Recognition | 7e37c0a5e69d1e8d5af429af4a43c70371c9cecf | [
"MIT"
] | 87 | 2019-12-02T03:21:08.000Z | 2022-02-28T05:15:33.000Z | data_loader.py | Deepika1108/Facial-Expression-Recognition | 7e37c0a5e69d1e8d5af429af4a43c70371c9cecf | [
"MIT"
] | 12 | 2019-12-14T05:56:01.000Z | 2021-11-29T02:51:32.000Z | data_loader.py | Deepika1108/Facial-Expression-Recognition | 7e37c0a5e69d1e8d5af429af4a43c70371c9cecf | [
"MIT"
] | 23 | 2019-12-16T04:56:39.000Z | 2022-03-14T03:15:52.000Z | import torch
import os
from PIL import Image
import random
import numpy as np
import pickle
import torchvision.transforms as transforms
from .ckplus_res import CKPlusResDataset
from .mmi_res import MMIResDataset
from .affectnet import AffectNetDataset
from .base_dataset import BaseDataset
def create_da... | 29.196429 | 73 | 0.628746 | import torch
import os
from PIL import Image
import random
import numpy as np
import pickle
import torchvision.transforms as transforms
from .ckplus_res import CKPlusResDataset
from .mmi_res import MMIResDataset
from .affectnet import AffectNetDataset
from .base_dataset import BaseDataset
def create_da... | true | true |
1c30273cd6a8c1868c1f8b91a8863bd016068a59 | 1,130 | py | Python | backend/storage.py | lakshbhasin/VoterValidation | 2249f387046b5039b650e3b5c63b9d3d3b7aea8f | [
"Apache-2.0"
] | 6 | 2018-11-02T14:10:54.000Z | 2020-07-14T02:38:03.000Z | backend/storage.py | lakshbhasin/VoterValidation | 2249f387046b5039b650e3b5c63b9d3d3b7aea8f | [
"Apache-2.0"
] | 2 | 2021-06-10T20:56:46.000Z | 2021-06-10T20:58:54.000Z | backend/storage.py | lakshbhasin/VoterValidation | 2249f387046b5039b650e3b5c63b9d3d3b7aea8f | [
"Apache-2.0"
] | null | null | null | """
Adapted from
http://condopilot.com/blog/web/how-setup-gzip-compressor-and-aws-s3-django/
"""
from django.core.files.storage import get_storage_class
from storages.backends.s3boto import S3BotoStorage
from backend.settings import STATICFILES_LOCATION
class CachedS3BotoStorage(S3BotoStorage):
"""
S3 storag... | 34.242424 | 75 | 0.709735 |
from django.core.files.storage import get_storage_class
from storages.backends.s3boto import S3BotoStorage
from backend.settings import STATICFILES_LOCATION
class CachedS3BotoStorage(S3BotoStorage):
location = STATICFILES_LOCATION
def __init__(self, *args, **kwargs):
super(CachedS3BotoStorage, self)... | true | true |
1c3028185d8c41fdc39aa16889e8966955df26ad | 730 | py | Python | anees/migrations/0038_auto_20200928_0507.py | ashish2020kashyap/cessini | 9713fd76d2e31a95266ec69da2abc98424a46e52 | [
"MIT"
] | null | null | null | anees/migrations/0038_auto_20200928_0507.py | ashish2020kashyap/cessini | 9713fd76d2e31a95266ec69da2abc98424a46e52 | [
"MIT"
] | null | null | null | anees/migrations/0038_auto_20200928_0507.py | ashish2020kashyap/cessini | 9713fd76d2e31a95266ec69da2abc98424a46e52 | [
"MIT"
] | null | null | null | # Generated by Django 3.1.1 on 2020-09-28 05:07
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('anees', '0037_auto_20200928_0504'),
]
operations = [
migrations.AlterField(
model_name='campmai... | 29.2 | 143 | 0.634247 |
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('anees', '0037_auto_20200928_0504'),
]
operations = [
migrations.AlterField(
model_name='campmail',
name='camp',
field=... | true | true |
1c3028b675a02c0d60e802724ad657e807832f03 | 11,058 | py | Python | msgraph/cli/command_modules/groups/azext_groups/vendored_sdks/groups/operations/_groups_onenote_section_groups_sections_pages_parent_notebook_sections_operations.py | microsoftgraph/msgraph-cli-archived | 489f70bf4ede1ce67b84bfb31e66da3e4db76062 | [
"MIT"
] | null | null | null | msgraph/cli/command_modules/groups/azext_groups/vendored_sdks/groups/operations/_groups_onenote_section_groups_sections_pages_parent_notebook_sections_operations.py | microsoftgraph/msgraph-cli-archived | 489f70bf4ede1ce67b84bfb31e66da3e4db76062 | [
"MIT"
] | 22 | 2022-03-29T22:54:37.000Z | 2022-03-29T22:55:27.000Z | msgraph/cli/command_modules/groups/azext_groups/vendored_sdks/groups/operations/_groups_onenote_section_groups_sections_pages_parent_notebook_sections_operations.py | microsoftgraph/msgraph-cli-archived | 489f70bf4ede1ce67b84bfb31e66da3e4db76062 | [
"MIT"
] | null | null | null | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... | 54.205882 | 268 | 0.714324 |
from typing import TYPE_CHECKING
import warnings
from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error
from azure.core.pipeline import PipelineResponse
from azure.core.pipeline.transport import HttpRequest, HttpResponse
from azure.m... | true | true |
1c3028bb8bd3f560b3d10a49db839605d65b5e44 | 4,631 | py | Python | aptl3/tests/test_am.py | matteoterruzzi/aptl3 | 680ab58ffa79d0eee293729d36f677a588350519 | [
"MIT"
] | null | null | null | aptl3/tests/test_am.py | matteoterruzzi/aptl3 | 680ab58ffa79d0eee293729d36f677a588350519 | [
"MIT"
] | null | null | null | aptl3/tests/test_am.py | matteoterruzzi/aptl3 | 680ab58ffa79d0eee293729d36f677a588350519 | [
"MIT"
] | null | null | null | import itertools
import time
from typing import Any
from ..am import ActorSystem, MapActor, Actor
def double(x):
return 2 * x
def test_empty_system():
with ActorSystem(maxsize=0, use_multiprocessing=False) as s:
s.start()
print(s.status)
print(s.status)
def test_simple_actor():
wi... | 30.267974 | 119 | 0.585403 | import itertools
import time
from typing import Any
from ..am import ActorSystem, MapActor, Actor
def double(x):
return 2 * x
def test_empty_system():
with ActorSystem(maxsize=0, use_multiprocessing=False) as s:
s.start()
print(s.status)
print(s.status)
def test_simple_actor():
wi... | true | true |
1c3029102b8a50c6094ed7e50625d167e115f7b7 | 467 | py | Python | omtool/visualizer/draw_parameters.py | Kraysent/OMTool | abb293ee359720d622ed0c4ecdf90967171007c8 | [
"Apache-2.0"
] | null | null | null | omtool/visualizer/draw_parameters.py | Kraysent/OMTool | abb293ee359720d622ed0c4ecdf90967171007c8 | [
"Apache-2.0"
] | 51 | 2021-12-05T13:31:51.000Z | 2022-03-27T16:05:04.000Z | omtool/visualizer/draw_parameters.py | Kraysent/OMTool | abb293ee359720d622ed0c4ecdf90967171007c8 | [
"Apache-2.0"
] | null | null | null | from dataclasses import dataclass
from typing import Any, Tuple
import matplotlib as mpl
@dataclass
class DrawParameters:
id: str
markersize: float = 0.1
linestyle: str = 'None'
color: str = 'b'
marker: str = 'o'
is_density_plot: bool = False
resolution: int = 100
extent: Tuple[int,... | 22.238095 | 56 | 0.631692 | from dataclasses import dataclass
from typing import Any, Tuple
import matplotlib as mpl
@dataclass
class DrawParameters:
id: str
markersize: float = 0.1
linestyle: str = 'None'
color: str = 'b'
marker: str = 'o'
is_density_plot: bool = False
resolution: int = 100
extent: Tuple[int,... | true | true |
1c30295399e59dfc6f9d4cba1970aea2e3d81c57 | 1,422 | py | Python | data_analysis.py | PatriceC/MLProjectISDP2020 | 64e83824690ccde2714d915c70fb00b20aa66a42 | [
"MIT"
] | 1 | 2021-01-23T01:04:00.000Z | 2021-01-23T01:04:00.000Z | data_analysis.py | cor3ntino/Time-Series-Prediction-with-Deep-Learning-for-Road-Trafic-Data | e8eefdf2e630a53e09f88550357b67732f2bccd0 | [
"MIT"
] | null | null | null | data_analysis.py | cor3ntino/Time-Series-Prediction-with-Deep-Learning-for-Road-Trafic-Data | e8eefdf2e630a53e09f88550357b67732f2bccd0 | [
"MIT"
] | 1 | 2021-01-19T16:57:27.000Z | 2021-01-19T16:57:27.000Z | # -*- coding: utf-8 -*-
"""
Created on Fri Nov 27 19:19:45 2020
@author: Patrice CHANOL & Corentin MORVAN--CHAUMEIL
"""
import pandas as pd
import matplotlib.pyplot as plt
# %% Load Data
data_load = pd.read_csv('./Radar_Traffic_Counts.csv')
data_load = data_load.drop(columns=['Time Bin', 'location_name'])
data_load... | 36.461538 | 195 | 0.668776 |
import pandas as pd
import matplotlib.pyplot as plt
data_load = pd.read_csv('./Radar_Traffic_Counts.csv')
data_load = data_load.drop(columns=['Time Bin', 'location_name'])
data_load['Direction'] = data_load['Direction'].astype('category').cat.codes
col = ['Direction', 'location_latitude', 'location_longitude',... | true | true |
1c3029a9d34293ddf7ec3cf7a9c97844a4285f5f | 22,629 | py | Python | homeassistant/const.py | SergioBPereira/core | 4501906da369e23b304857b8a3512798696f26a0 | [
"Apache-2.0"
] | null | null | null | homeassistant/const.py | SergioBPereira/core | 4501906da369e23b304857b8a3512798696f26a0 | [
"Apache-2.0"
] | 62 | 2020-11-17T06:56:37.000Z | 2022-03-23T18:24:45.000Z | homeassistant/const.py | SergioBPereira/core | 4501906da369e23b304857b8a3512798696f26a0 | [
"Apache-2.0"
] | 2 | 2021-01-26T07:41:33.000Z | 2021-01-26T07:45:11.000Z | """Constants used by Home Assistant components."""
from __future__ import annotations
from typing import Final
MAJOR_VERSION: Final = 2021
MINOR_VERSION: Final = 11
PATCH_VERSION: Final = "0.dev0"
__short_version__: Final = f"{MAJOR_VERSION}.{MINOR_VERSION}"
__version__: Final = f"{__short_version__}.{PATCH_VERSION}"... | 31.827004 | 87 | 0.776526 | from __future__ import annotations
from typing import Final
MAJOR_VERSION: Final = 2021
MINOR_VERSION: Final = 11
PATCH_VERSION: Final = "0.dev0"
__short_version__: Final = f"{MAJOR_VERSION}.{MINOR_VERSION}"
__version__: Final = f"{__short_version__}.{PATCH_VERSION}"
REQUIRED_PYTHON_VER: Final[tuple[int, int, int]] =... | true | true |
1c302afc00f8455b99cd49949b9ddea989f339e9 | 12,495 | py | Python | cinder/backup/drivers/swift.py | alexpilotti/cinder-ci-fixes | c0ed2ab8cc6b1197e426cd6c58c3b582624d1cfd | [
"Apache-2.0"
] | null | null | null | cinder/backup/drivers/swift.py | alexpilotti/cinder-ci-fixes | c0ed2ab8cc6b1197e426cd6c58c3b582624d1cfd | [
"Apache-2.0"
] | null | null | null | cinder/backup/drivers/swift.py | alexpilotti/cinder-ci-fixes | c0ed2ab8cc6b1197e426cd6c58c3b582624d1cfd | [
"Apache-2.0"
] | null | null | null | # Copyright (C) 2012 Hewlett-Packard Development Company, L.P.
# Copyright (c) 2014 TrilioData, Inc
# Copyright (c) 2015 EMC Corporation
# Copyright (C) 2015 Kevin Fox <kevin@efox.cc>
# Copyright (C) 2015 Tom Barron <tpb@dyncloud.net>
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "Li... | 43.842105 | 82 | 0.595118 |
import hashlib
import socket
from oslo_config import cfg
from oslo_log import log as logging
from oslo_utils import timeutils
import six
from swiftclient import client as swift
from cinder.backup import chunkeddriver
from cinder import exception
from cinder.i18n import _
from cinder.i18n import _L... | true | true |
1c302b36a64e07516c35eec3aeae4bd8e31bf0eb | 14,805 | py | Python | sdk/python/pulumi_azure_native/redhatopenshift/v20200430/_inputs.py | sebtelko/pulumi-azure-native | 711ec021b5c73da05611c56c8a35adb0ce3244e4 | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_native/redhatopenshift/v20200430/_inputs.py | sebtelko/pulumi-azure-native | 711ec021b5c73da05611c56c8a35adb0ce3244e4 | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_native/redhatopenshift/v20200430/_inputs.py | sebtelko/pulumi-azure-native | 711ec021b5c73da05611c56c8a35adb0ce3244e4 | [
"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
__... | 33.80137 | 116 | 0.614725 |
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from ... import _utilities
__all__ = [
'APIServerProfileArgs',
'ClusterProfileArgs',
'ConsoleProfileArgs',
'IngressProfileArgs',
'MasterProfileArgs',
'NetworkProfileArgs'... | true | true |
1c302b5bad3090eca8357dc6c7bb7abb57c6c22b | 471 | py | Python | terminator/display.py | radarsh/terminator | 4979d9f57d4d2206114e401c4b7013db5f187f70 | [
"Apache-2.0"
] | 9 | 2015-02-27T16:21:26.000Z | 2020-03-19T07:47:18.000Z | terminator/display.py | radarsh/bashmon | 4979d9f57d4d2206114e401c4b7013db5f187f70 | [
"Apache-2.0"
] | 9 | 2015-03-02T09:46:09.000Z | 2017-09-29T18:03:41.000Z | terminator/display.py | radarsh/bashmon | 4979d9f57d4d2206114e401c4b7013db5f187f70 | [
"Apache-2.0"
] | 5 | 2015-03-13T14:14:34.000Z | 2019-09-12T07:11:52.000Z | import os
from platform import system
import terminator.formatter as formatter
import terminator.arguments as arguments
def term_width():
return arguments.terminal_width or os.get_terminal_size().columns
def clear_screen():
if system() == 'Windows':
os.system('cls')
else:
os.system('cle... | 20.478261 | 69 | 0.694268 | import os
from platform import system
import terminator.formatter as formatter
import terminator.arguments as arguments
def term_width():
return arguments.terminal_width or os.get_terminal_size().columns
def clear_screen():
if system() == 'Windows':
os.system('cls')
else:
os.system('cle... | true | true |
1c302bc8c309a1d8c1b579797a0a5f35ea31626b | 351 | py | Python | test/linkage-agent/manual/time_test_manual_test_10k-x-6.py | greshje/linkage-agent-tools | bc3a041c74cfe96950a0e3c011dd6a0185ad912d | [
"Apache-2.0"
] | 1 | 2020-06-25T19:57:56.000Z | 2020-06-25T19:57:56.000Z | test/linkage-agent/manual/time_test_manual_test_10k-x-6.py | greshje/linkage-agent-tools | bc3a041c74cfe96950a0e3c011dd6a0185ad912d | [
"Apache-2.0"
] | 1 | 2021-10-01T15:13:15.000Z | 2021-10-01T15:13:15.000Z | test/linkage-agent/manual/time_test_manual_test_10k-x-6.py | greshje/linkage-agent-tools | bc3a041c74cfe96950a0e3c011dd6a0185ad912d | [
"Apache-2.0"
] | null | null | null | # ------
#
# This test is not part of the automated test suite. It is intended to be
# run manually after the data folder has been copied to C:\test.
#
# This module exists primarily to enable debugging of the process called by the cmd line
#
# ------
import time_test as tt
if __name__ == "__main__":
tt.run_test... | 25.071429 | 88 | 0.68661 |
import time_test as tt
if __name__ == "__main__":
tt.run_test("C:\\test\\test-set-10k-x-6")
| true | true |
1c302bf040036bd5a89e90813fd96cc42d886097 | 5,141 | py | Python | peeringdb_server/templatetags/util.py | WEBZCC/peeringdb | 9f74fb8a1148eb613179f9fb16bb5d17b86f9c04 | [
"BSD-2-Clause"
] | null | null | null | peeringdb_server/templatetags/util.py | WEBZCC/peeringdb | 9f74fb8a1148eb613179f9fb16bb5d17b86f9c04 | [
"BSD-2-Clause"
] | null | null | null | peeringdb_server/templatetags/util.py | WEBZCC/peeringdb | 9f74fb8a1148eb613179f9fb16bb5d17b86f9c04 | [
"BSD-2-Clause"
] | null | null | null | from django import template
from django.utils.translation import ugettext_lazy as _
from django.utils.safestring import mark_safe
import datetime
from peeringdb_server.models import (
InternetExchange,
Network,
Facility,
Organization,
PARTNERSHIP_LEVELS,
format_speed,
)
from peeringdb_server.vi... | 21.876596 | 117 | 0.60922 | from django import template
from django.utils.translation import ugettext_lazy as _
from django.utils.safestring import mark_safe
import datetime
from peeringdb_server.models import (
InternetExchange,
Network,
Facility,
Organization,
PARTNERSHIP_LEVELS,
format_speed,
)
from peeringdb_server.vi... | true | true |
1c302c7b2dd41ddcf61c38ff298d35f5958f5fbe | 1,663 | py | Python | setup.py | massarom/pypackinit | c5860e60b6eaa5d66fab53e3795fd524618ca9da | [
"MIT"
] | null | null | null | setup.py | massarom/pypackinit | c5860e60b6eaa5d66fab53e3795fd524618ca9da | [
"MIT"
] | null | null | null | setup.py | massarom/pypackinit | c5860e60b6eaa5d66fab53e3795fd524618ca9da | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""Example setup.py file
This example setup file is adapted from https://github.com/pypa/sampleproject
and is not supposed to be and exahustive list of options accepted by the
setuptools' function `setup`. You should read the respective documentation,
which can be found at https://setuptools.re... | 44.945946 | 81 | 0.790138 |
from setuptools import setup, find_packages
setup(
py_modules=["pypackinit"],
entry_points={"console_scripts": ["ppinit = pypackinit:main"]},
)
| true | true |
1c302dc39798038ca1e819bf63f1a0d88093d9b5 | 2,279 | py | Python | test_service.py | michhar/azureml-keras-yolov3-custom | 3f52a48bf865a221e70432cfcb6e6afa73c3b001 | [
"MIT"
] | 12 | 2019-11-20T21:19:22.000Z | 2021-11-09T11:32:35.000Z | test_service.py | michhar/azureml-keras-yolov3-custom | 3f52a48bf865a221e70432cfcb6e6afa73c3b001 | [
"MIT"
] | 9 | 2019-11-16T21:07:07.000Z | 2022-02-10T02:14:16.000Z | test_service.py | michhar/azureml-keras-yolov3-custom | 3f52a48bf865a221e70432cfcb6e6afa73c3b001 | [
"MIT"
] | 6 | 2019-11-22T03:42:58.000Z | 2021-08-28T03:51:21.000Z | """
Use Python requests to call web service
Set an environment variable SCORING_URI to the scoring URL before running and
set environment variable WEBSERVICE_KEY to the webservice key if in the cloud (omit
if testing a local service).
"""
import requests
from requests.exceptions import HTTPError
import numpy as np
imp... | 29.597403 | 111 | 0.66301 | import requests
from requests.exceptions import HTTPError
import numpy as np
import matplotlib.pyplot as plt
import argparse
import os
import json
from PIL import Image
from io import BytesIO
import base64
def arg_parse():
parser = argparse.ArgumentParser(
description='This script is for calling the HTTP ... | true | true |
1c302e6be5a1a45bc57efd3bec3653f92d393f2b | 654 | py | Python | p9.py | JasonD1997/Machine-Learning-Programs | 81e54ccaf2ca4bd7e2d79ed0e538f13cb355c0bf | [
"MIT"
] | null | null | null | p9.py | JasonD1997/Machine-Learning-Programs | 81e54ccaf2ca4bd7e2d79ed0e538f13cb355c0bf | [
"MIT"
] | null | null | null | p9.py | JasonD1997/Machine-Learning-Programs | 81e54ccaf2ca4bd7e2d79ed0e538f13cb355c0bf | [
"MIT"
] | null | null | null | from sklearn.model_selection import train_test_split
from sklearn.neighbors import KNeighborsClassifier
from sklearn.metrics import classification_report,confusion_matrix
from sklearn import datasets
iris=datasets.load_iris()
iris_data=iris.data
iris_labels=iris.target
print(iris_data)
print(iris_labels)
x_train,x_tes... | 34.421053 | 84 | 0.860856 | from sklearn.model_selection import train_test_split
from sklearn.neighbors import KNeighborsClassifier
from sklearn.metrics import classification_report,confusion_matrix
from sklearn import datasets
iris=datasets.load_iris()
iris_data=iris.data
iris_labels=iris.target
print(iris_data)
print(iris_labels)
x_train,x_tes... | true | true |
1c30304757f5dcc3fcbb4ba2ba9ecb42d0cd0d8d | 1,922 | py | Python | gpfit/xfoil/constraint_set.py | appliedopt/gpfit | 3c8025f12ba5360fdeb71c270e55d4c93e1676fd | [
"MIT"
] | 6 | 2017-12-10T11:27:03.000Z | 2021-12-28T18:12:32.000Z | gpfit/xfoil/constraint_set.py | appliedopt/gpfit | 3c8025f12ba5360fdeb71c270e55d4c93e1676fd | [
"MIT"
] | 49 | 2017-10-16T17:15:55.000Z | 2021-10-19T06:32:27.000Z | gpfit/xfoil/constraint_set.py | appliedopt/gpfit | 3c8025f12ba5360fdeb71c270e55d4c93e1676fd | [
"MIT"
] | 1 | 2017-12-10T08:47:26.000Z | 2017-12-10T08:47:26.000Z | """xfoil constraint set"""
import numpy as np
from gpfit.constraint_set import FitConstraintSet
from .wrapper import xfoil_comparison
# pylint: disable=too-many-arguments
class XfoilFit(FitConstraintSet):
"""Special FitConstraintSet that can post-solve compare result to XFOIL
Arguments (in addition to the ar... | 32.576271 | 85 | 0.540583 | import numpy as np
from gpfit.constraint_set import FitConstraintSet
from .wrapper import xfoil_comparison
class XfoilFit(FitConstraintSet):
def __init__(
self, fitdata, ivar=None, dvars=None, name="", err_margin=None, airfoil=False
):
super().__init__(
fitdata, ivar=ivar, dvars... | true | true |
1c30319c69766804d9361859d13d841c20dbd931 | 2,816 | py | Python | src/sn7_baseline_prep_funcs.py | ordinaryname/CosmiQ_SN7_Baseline | db486f834b5f4a0a917098c63c1bbfe432350789 | [
"Apache-2.0"
] | null | null | null | src/sn7_baseline_prep_funcs.py | ordinaryname/CosmiQ_SN7_Baseline | db486f834b5f4a0a917098c63c1bbfe432350789 | [
"Apache-2.0"
] | null | null | null | src/sn7_baseline_prep_funcs.py | ordinaryname/CosmiQ_SN7_Baseline | db486f834b5f4a0a917098c63c1bbfe432350789 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Tue Aug 25 14:11:02 2020
@author: avanetten
"""
import multiprocessing
import pandas as pd
import numpy as np
import skimage
import gdal
import os
import solaris as sol
from solaris.raster.image import create_multiband_geotiff
from solaris.utils.core impo... | 34.341463 | 101 | 0.610085 |
import multiprocessing
import pandas as pd
import numpy as np
import skimage
import gdal
import os
import solaris as sol
from solaris.raster.image import create_multiband_geotiff
from solaris.utils.core import _check_gdf_load
def map_wrapper(x):
return x[0](*(x[1:]))
def make_geojsons_and_masks(name_root, i... | true | true |
1c303396e9863a9c89da3336cb44e63eaf8e0bf8 | 1,526 | py | Python | comment/models.py | abdukhashimov/django-rest-blog-2 | ae12c24f95b3a8f216c85a8f32c47e215118ce07 | [
"MIT"
] | null | null | null | comment/models.py | abdukhashimov/django-rest-blog-2 | ae12c24f95b3a8f216c85a8f32c47e215118ce07 | [
"MIT"
] | null | null | null | comment/models.py | abdukhashimov/django-rest-blog-2 | ae12c24f95b3a8f216c85a8f32c47e215118ce07 | [
"MIT"
] | null | null | null | from django.db import models
from post.models import Post
from django.contrib.auth import get_user_model
from django.contrib.admin.utils import NestedObjects
class CommentManager(models.Manager):
def get_parent_comment(self, id):
return super(
CommentManager, self
).get_queryset().filt... | 31.142857 | 72 | 0.680865 | from django.db import models
from post.models import Post
from django.contrib.auth import get_user_model
from django.contrib.admin.utils import NestedObjects
class CommentManager(models.Manager):
def get_parent_comment(self, id):
return super(
CommentManager, self
).get_queryset().filt... | true | true |
1c303427d85e89b55d8a992ea275e68e7213ab06 | 1,532 | py | Python | src/dictionaries/cuhk/setup_data.py | aaronhktan/jyut-dict | d1a3f22af224f35cde312b7e664d3e392c8af3db | [
"MIT"
] | 52 | 2019-01-20T20:40:15.000Z | 2022-03-11T01:29:34.000Z | src/dictionaries/cuhk/setup_data.py | aaronhktan/jyut-dict | d1a3f22af224f35cde312b7e664d3e392c8af3db | [
"MIT"
] | 58 | 2019-01-30T06:35:53.000Z | 2022-02-20T03:33:18.000Z | src/dictionaries/cuhk/setup_data.py | aaronhktan/jyut-dict | d1a3f22af224f35cde312b7e664d3e392c8af3db | [
"MIT"
] | 1 | 2021-08-03T03:46:36.000Z | 2021-08-03T03:46:36.000Z | from bs4 import BeautifulSoup
import requests
import sys
if len(sys.argv) != 2:
print("Usage: python3 script.py output_filename.txt")
sys.exit(1)
r = requests.get("https://apps.itsc.cuhk.edu.hk/hanyu/Page/Terms.aspx")
soup = BeautifulSoup(r.text, "html.parser")
# Extract links to each category
main_panel = ... | 30.64 | 87 | 0.650783 | from bs4 import BeautifulSoup
import requests
import sys
if len(sys.argv) != 2:
print("Usage: python3 script.py output_filename.txt")
sys.exit(1)
r = requests.get("https://apps.itsc.cuhk.edu.hk/hanyu/Page/Terms.aspx")
soup = BeautifulSoup(r.text, "html.parser")
main_panel = soup.find("div", id="MainContent... | true | true |
1c3034837475e5316df55c05060f253699b61e3a | 207,999 | py | Python | ryu/ofproto/ofproto_v1_4_parser.py | alanquillin/ryu | 5552348c7c0a425313e2d5085d40d9729c8cc95e | [
"Apache-2.0"
] | null | null | null | ryu/ofproto/ofproto_v1_4_parser.py | alanquillin/ryu | 5552348c7c0a425313e2d5085d40d9729c8cc95e | [
"Apache-2.0"
] | null | null | null | ryu/ofproto/ofproto_v1_4_parser.py | alanquillin/ryu | 5552348c7c0a425313e2d5085d40d9729c8cc95e | [
"Apache-2.0"
] | null | null | null | # Copyright (C) 2012, 2013, 2014 Nippon Telegraph and Telephone Corporation.
# Copyright (C) 2012, 2013 Isaku Yamahata <yamahata at valinux co jp>
#
# 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... | 36.74894 | 90 | 0.568157 |
import six
import struct
from ryu.lib import addrconv
from ryu.lib.pack_utils import msg_pack_into
from ryu import utils
from ryu.ofproto.ofproto_parser import StringifyMixin, MsgBase, MsgInMsgBase, msg_str_attr
from ryu.ofproto import ether
from ryu.ofproto import nx_actions
from ryu.ofproto import o... | true | true |
1c3034e026a4b7927b1b22737c8e3921a53b0a31 | 9,812 | py | Python | ymir/backend/src/ymir_app/app/api/api_v1/endpoints/projects.py | Zhang-SJ930104/ymir | dd6481be6f229ade4cf8fba64ef44a15357430c4 | [
"Apache-2.0"
] | null | null | null | ymir/backend/src/ymir_app/app/api/api_v1/endpoints/projects.py | Zhang-SJ930104/ymir | dd6481be6f229ade4cf8fba64ef44a15357430c4 | [
"Apache-2.0"
] | 1 | 2022-01-18T09:28:29.000Z | 2022-01-18T09:28:29.000Z | ymir/backend/src/ymir_app/app/api/api_v1/endpoints/projects.py | Aryalfrat/ymir | d4617ed00ef67a77ab4e1944763f608bface4be6 | [
"Apache-2.0"
] | null | null | null | import enum
import json
import time
from typing import Any
from fastapi import APIRouter, Depends, Path, Query, BackgroundTasks
from fastapi.logger import logger
from sqlalchemy.orm import Session
from app import crud, models, schemas
from app.api import deps
from app.api.errors.errors import (
ProjectNotFound,
... | 33.037037 | 113 | 0.698227 | import enum
import json
import time
from typing import Any
from fastapi import APIRouter, Depends, Path, Query, BackgroundTasks
from fastapi.logger import logger
from sqlalchemy.orm import Session
from app import crud, models, schemas
from app.api import deps
from app.api.errors.errors import (
ProjectNotFound,
... | true | true |
1c30375076d1a9e4b146b86d5824aa4268b2444f | 3,190 | py | Python | code/ReID_net/scripts/postproc/crf/crf_davis.py | MTonyM/PReMVOS | 3d01f0c6156628083a4c8441b4b57622c500e04e | [
"MIT"
] | 140 | 2018-10-25T11:58:34.000Z | 2022-01-18T15:29:38.000Z | code/ReID_net/scripts/postproc/crf/crf_davis.py | MTonyM/PReMVOS | 3d01f0c6156628083a4c8441b4b57622c500e04e | [
"MIT"
] | 18 | 2018-11-21T04:48:03.000Z | 2020-09-14T09:30:56.000Z | code/ReID_net/scripts/postproc/crf/crf_davis.py | MTonyM/PReMVOS | 3d01f0c6156628083a4c8441b4b57622c500e04e | [
"MIT"
] | 32 | 2018-10-25T11:58:57.000Z | 2021-12-27T06:13:45.000Z | #!/usr/bin/env python
import pydensecrf.densecrf as dcrf
from pydensecrf.utils import unary_from_softmax
from scipy.ndimage import imread
from scipy.misc import imsave
import pickle
import numpy
import glob
import os
import matplotlib.pyplot as plt
from joblib import Parallel, delayed
import sys
imgs_path = "/work/ma... | 26.806723 | 118 | 0.658307 |
import pydensecrf.densecrf as dcrf
from pydensecrf.utils import unary_from_softmax
from scipy.ndimage import imread
from scipy.misc import imsave
import pickle
import numpy
import glob
import os
import matplotlib.pyplot as plt
from joblib import Parallel, delayed
import sys
imgs_path = "/work/mahadevan/data/DAVIS/JP... | true | true |
1c303789cdfa7d805d94bd2375e54edd6c496f22 | 33,233 | py | Python | mvpa2/tests/test_surfing_voxelselection.py | andycon/PyMVPA | 67f7ee68012e3a1128168c583d6c83303b7a2c27 | [
"MIT"
] | null | null | null | mvpa2/tests/test_surfing_voxelselection.py | andycon/PyMVPA | 67f7ee68012e3a1128168c583d6c83303b7a2c27 | [
"MIT"
] | null | null | null | mvpa2/tests/test_surfing_voxelselection.py | andycon/PyMVPA | 67f7ee68012e3a1128168c583d6c83303b7a2c27 | [
"MIT"
] | null | null | null | # emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ##
#
# See COPYING file distributed along with the PyMVPA package for the
# copyright and license terms.
#
### ### ### ### ###... | 37.593891 | 79 | 0.536274 |
he volume analysis
'''
element_sizes = tuple(map(abs, (aff[0, 0], aff[1, 1], aff[2, 2])))
sph = Sphere(radius, element_sizes=element_sizes)
kwa = {'voxel_indices': sph}
vol_qe = IndexQueryEngine(**kwa)
vol_sl = Searchlight(meas, queryengine=vol_qe, postproc=postproc)
... | false | true |
1c30385f9a3584b953548dfaf122c9c827e4f11e | 85 | py | Python | yuri/exceptions.py | kanade0404/yuri | dcea86566a176be96fac0a5db19d59595e234269 | [
"MIT"
] | null | null | null | yuri/exceptions.py | kanade0404/yuri | dcea86566a176be96fac0a5db19d59595e234269 | [
"MIT"
] | null | null | null | yuri/exceptions.py | kanade0404/yuri | dcea86566a176be96fac0a5db19d59595e234269 | [
"MIT"
] | null | null | null | class YuriException(Exception):
pass
class RouteError(YuriException):
pass
| 12.142857 | 32 | 0.741176 | class YuriException(Exception):
pass
class RouteError(YuriException):
pass
| true | true |
1c3038e5ab80989a97904ddbf9925efa252264be | 15,485 | py | Python | salt/modules/boto_cloudtrail.py | ahammond/salt | 945b21b70dbe708716d7b009a2005ef0acf76e6b | [
"Apache-2.0"
] | null | null | null | salt/modules/boto_cloudtrail.py | ahammond/salt | 945b21b70dbe708716d7b009a2005ef0acf76e6b | [
"Apache-2.0"
] | null | null | null | salt/modules/boto_cloudtrail.py | ahammond/salt | 945b21b70dbe708716d7b009a2005ef0acf76e6b | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
'''
Connection module for Amazon CloudTrail
.. versionadded:: 2016.3.0
:configuration: This module accepts explicit Lambda credentials but can also
utilize IAM roles assigned to the instance through Instance Profiles.
Dynamic credentials are then automatically obtained from AWS API and... | 30.846614 | 109 | 0.614982 |
from __future__ import absolute_import
import logging
from distutils.version import LooseVersion as _LooseVersion
import salt.utils.boto3
import salt.utils.compat
import salt.utils
log = logging.getLogger(__name__)
try:
import boto
import boto3
from botocore.exceptions import ClientE... | true | true |
1c3039638c64ad046537ebe5a2c3abd3d2dd9cc1 | 5,342 | py | Python | scripts/makebrainstools.py | reckbo/ppl | 916d96188a43bbc5915020edfa12f14895b5f66c | [
"BSD-3-Clause"
] | null | null | null | scripts/makebrainstools.py | reckbo/ppl | 916d96188a43bbc5915020edfa12f14895b5f66c | [
"BSD-3-Clause"
] | null | null | null | scripts/makebrainstools.py | reckbo/ppl | 916d96188a43bbc5915020edfa12f14895b5f66c | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
from __future__ import print_function
from plumbum import local, FG, cli
from plumbum.cmd import git, cmake, make
import logging
from util import logfmt
import sys
logger = logging.getLogger()
logging.basicConfig(level=logging.DEBUG, format=logfmt(__file__))
class App(cli.Application):
DES... | 41.734375 | 142 | 0.610446 |
from __future__ import print_function
from plumbum import local, FG, cli
from plumbum.cmd import git, cmake, make
import logging
from util import logfmt
import sys
logger = logging.getLogger()
logging.basicConfig(level=logging.DEBUG, format=logfmt(__file__))
class App(cli.Application):
DESCRIPTION = "Downloads... | true | true |
1c303b78b6ae5eca8c6ab383c7d16e87f6f3ecf0 | 1,367 | py | Python | src/probnum/utils/argutils.py | ralfrost/probnum | 6b0988009a9dd7ecda87ba28c9d5c0b8019981b6 | [
"MIT"
] | null | null | null | src/probnum/utils/argutils.py | ralfrost/probnum | 6b0988009a9dd7ecda87ba28c9d5c0b8019981b6 | [
"MIT"
] | 2 | 2020-12-28T19:37:16.000Z | 2020-12-28T19:37:31.000Z | src/probnum/utils/argutils.py | admdev8/probnum | 792b6299bac247cf8b1b5056756f0f078855d83a | [
"MIT"
] | null | null | null | import numbers
import numpy as np
import scipy._lib._util
from probnum.type import (
DTypeArgType,
RandomStateArgType,
RandomStateType,
ScalarArgType,
ShapeArgType,
ShapeType,
)
__all__ = ["as_shape", "as_random_state", "as_numpy_scalar"]
def as_random_state(x: RandomStateArgType) -> Random... | 27.897959 | 88 | 0.65545 | import numbers
import numpy as np
import scipy._lib._util
from probnum.type import (
DTypeArgType,
RandomStateArgType,
RandomStateType,
ScalarArgType,
ShapeArgType,
ShapeType,
)
__all__ = ["as_shape", "as_random_state", "as_numpy_scalar"]
def as_random_state(x: RandomStateArgType) -> Random... | true | true |
1c303bbfaf52d7094a4e084d26dd73eef9daf45f | 1,242 | py | Python | src/rf_all/daal_rf_training.py | tapojyotipaul/xgboost-benchmarks | 789b99acbf401617a45a8c82dbae1210378527d8 | [
"Apache-2.0"
] | null | null | null | src/rf_all/daal_rf_training.py | tapojyotipaul/xgboost-benchmarks | 789b99acbf401617a45a8c82dbae1210378527d8 | [
"Apache-2.0"
] | null | null | null | src/rf_all/daal_rf_training.py | tapojyotipaul/xgboost-benchmarks | 789b99acbf401617a45a8c82dbae1210378527d8 | [
"Apache-2.0"
] | null | null | null | from timeit import default_timer as timer
import xgboost as xgb
from sklearn.metrics import mean_squared_error
import daal4py as d4p
import numpy as np
import pandas as pd
import common
d4p.daalinit()
NUM_LOOPS = 100
def run_inference(num_observations:int = 1000):
"""Run xgboost for specified number of observati... | 31.846154 | 79 | 0.710145 | from timeit import default_timer as timer
import xgboost as xgb
from sklearn.metrics import mean_squared_error
import daal4py as d4p
import numpy as np
import pandas as pd
import common
d4p.daalinit()
NUM_LOOPS = 100
def run_inference(num_observations:int = 1000):
train_x_df = common.get_test_data_df(X=comm... | true | true |
1c303ca7ab0ce9e52fc5302458ecdf3a2e444354 | 926 | py | Python | xlkj/kaoshi/pwn/pwn1/exp.py | haysengithub/ctf | c2cefed8470f40d0cb6bc4d1ae941a70936ea497 | [
"MIT"
] | null | null | null | xlkj/kaoshi/pwn/pwn1/exp.py | haysengithub/ctf | c2cefed8470f40d0cb6bc4d1ae941a70936ea497 | [
"MIT"
] | null | null | null | xlkj/kaoshi/pwn/pwn1/exp.py | haysengithub/ctf | c2cefed8470f40d0cb6bc4d1ae941a70936ea497 | [
"MIT"
] | null | null | null | from pwn import *
from LibcSearcher import *
context(arch="amd64",os="linux",log_level="debug")
GDB=args["GDB"]
context.terminal=["tmux","splitw","-h"]
pop_rdi=0x0000000000400823
ret=0x0000000000400576
main_addr=0x00000000004006c7
p=remote("152.136.44.97",20003)
#p=process("./pwn1")
if GDB=="1":
gdb.attach(p,"b *0... | 24.368421 | 113 | 0.706263 | from pwn import *
from LibcSearcher import *
context(arch="amd64",os="linux",log_level="debug")
GDB=args["GDB"]
context.terminal=["tmux","splitw","-h"]
pop_rdi=0x0000000000400823
ret=0x0000000000400576
main_addr=0x00000000004006c7
p=remote("152.136.44.97",20003)
if GDB=="1":
gdb.attach(p,"b *0x4007b5")
elf=ELF(".... | true | true |
1c303e019a9c09f96c42761d9f78868ee266b4b8 | 911 | py | Python | clients/python-aiohttp/generated/tests/test_pokedex_controller.py | cliffano/pokeapi-clients | 92af296c68c3e94afac52642ae22057faaf071ee | [
"MIT"
] | null | null | null | clients/python-aiohttp/generated/tests/test_pokedex_controller.py | cliffano/pokeapi-clients | 92af296c68c3e94afac52642ae22057faaf071ee | [
"MIT"
] | null | null | null | clients/python-aiohttp/generated/tests/test_pokedex_controller.py | cliffano/pokeapi-clients | 92af296c68c3e94afac52642ae22057faaf071ee | [
"MIT"
] | null | null | null | # coding: utf-8
import pytest
import json
from aiohttp import web
async def test_pokedex_list(client):
"""Test case for pokedex_list
"""
params = [('limit', 56),
('offset', 56)]
headers = {
'Accept': 'text/plain',
}
response = await client.request(
... | 21.186047 | 98 | 0.556531 |
import pytest
import json
from aiohttp import web
async def test_pokedex_list(client):
params = [('limit', 56),
('offset', 56)]
headers = {
'Accept': 'text/plain',
}
response = await client.request(
method='GET',
path='/api/v2/pokedex/',
headers=... | true | true |
1c303e0665ded3b0c3bd5a41f5245167a180cf79 | 1,462 | py | Python | trove/tests/unittests/common/test_stream_codecs.py | sapcc/trove | c03ec0827687fba202f72f4d264ab70158604857 | [
"Apache-2.0"
] | 244 | 2015-01-01T12:04:44.000Z | 2022-03-25T23:38:39.000Z | trove/tests/unittests/common/test_stream_codecs.py | sapcc/trove | c03ec0827687fba202f72f4d264ab70158604857 | [
"Apache-2.0"
] | 6 | 2015-08-18T08:19:10.000Z | 2022-03-05T02:32:36.000Z | trove/tests/unittests/common/test_stream_codecs.py | sapcc/trove | c03ec0827687fba202f72f4d264ab70158604857 | [
"Apache-2.0"
] | 178 | 2015-01-02T15:16:58.000Z | 2022-03-23T03:30:20.000Z | # Copyright 2016 Tesora, Inc.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by ... | 33.227273 | 78 | 0.674419 |
import os
from trove.common import stream_codecs
from trove.tests.unittests import trove_testtools
class TestStreamCodecs(trove_testtools.TestCase):
def setUp(self):
super(TestStreamCodecs, self).setUp()
def tearDown(self):
super(TestStreamCodecs, self).tearDown()
def t... | true | true |
1c303eb256f57ba792c46d3cf5344ec0037aefbb | 1,826 | py | Python | QuickDemos/PygameTutorial/platformer.py | Crocster/CMPT-120L-201-22S | 7de05b152dba9975b7a5e56f1f1432cdb325d74e | [
"MIT"
] | 1 | 2022-02-19T17:57:57.000Z | 2022-02-19T17:57:57.000Z | QuickDemos/PygameTutorial/platformer.py | Crocster/CMPT-120L-201-22S | 7de05b152dba9975b7a5e56f1f1432cdb325d74e | [
"MIT"
] | null | null | null | QuickDemos/PygameTutorial/platformer.py | Crocster/CMPT-120L-201-22S | 7de05b152dba9975b7a5e56f1f1432cdb325d74e | [
"MIT"
] | 24 | 2022-02-03T01:37:44.000Z | 2022-02-17T00:00:10.000Z | import pygame
import sys
from pygame.locals import *
pygame.init()
vec = pygame.math.Vector2 # 2 for two dimensional
HEIGHT = 450
WIDTH = 400
ACC = 0.5
FRIC = -0.12
FPS = 60
FramePerSec = pygame.time.Clock()
displaysurface = pygame.display.set_mode((WIDTH, HEIGHT))
pygame.display.set_caption("Marist Platformer")
... | 23.113924 | 71 | 0.586528 | import pygame
import sys
from pygame.locals import *
pygame.init()
vec = pygame.math.Vector2
HEIGHT = 450
WIDTH = 400
ACC = 0.5
FRIC = -0.12
FPS = 60
FramePerSec = pygame.time.Clock()
displaysurface = pygame.display.set_mode((WIDTH, HEIGHT))
pygame.display.set_caption("Marist Platformer")
class Player(pygame.spr... | true | true |
1c303ed5063c2386e4bfac776b7b7e5f21c6f757 | 1,377 | py | Python | var/spack/repos/builtin/packages/fl/package.py | kkauder/spack | 6ae8d5c380c1f42094b05d38be26b03650aafb39 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 2 | 2019-02-10T13:47:48.000Z | 2019-04-17T13:05:17.000Z | var/spack/repos/builtin/packages/fl/package.py | kkauder/spack | 6ae8d5c380c1f42094b05d38be26b03650aafb39 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 17 | 2019-03-21T15:54:00.000Z | 2022-03-29T19:34:28.000Z | var/spack/repos/builtin/packages/fl/package.py | kkauder/spack | 6ae8d5c380c1f42094b05d38be26b03650aafb39 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 2 | 2018-04-06T09:04:11.000Z | 2020-01-24T12:52:12.000Z | # Copyright 2013-2021 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 *
import platform
_versions = {
'0.79.47': {
'Linux-x86_64': ('b8a4a74118c1a024313bf912261f... | 37.216216 | 153 | 0.659405 |
from spack import *
import platform
_versions = {
'0.79.47': {
'Linux-x86_64': ('b8a4a74118c1a024313bf912261fbc016a53f2d15adb1226217f2a10a9f7ca9a', 'https://www.flxpert.hu/fl/fl_0.79.47-amd64-linux.tar.gz'),
'Linux-aarch64': ('3ff052013daf319927d04ba83b8f90c12575983911faf6c1559437062032b669', ... | true | true |
1c303eea0533e7776a120588819a11955b42166d | 44,135 | py | Python | homeassistant/components/zwave_js/api.py | sebcaps/core | 4a058503ca49fa861124fa3bb6abbcd5e8dd0798 | [
"Apache-2.0"
] | null | null | null | homeassistant/components/zwave_js/api.py | sebcaps/core | 4a058503ca49fa861124fa3bb6abbcd5e8dd0798 | [
"Apache-2.0"
] | null | null | null | homeassistant/components/zwave_js/api.py | sebcaps/core | 4a058503ca49fa861124fa3bb6abbcd5e8dd0798 | [
"Apache-2.0"
] | null | null | null | """Websocket API for Z-Wave JS."""
from __future__ import annotations
import dataclasses
from functools import partial, wraps
import json
from typing import Any, Callable
from aiohttp import hdrs, web, web_exceptions, web_request
import voluptuous as vol
from zwave_js_server import dump
from zwave_js_server.client im... | 29.640698 | 98 | 0.658344 | from __future__ import annotations
import dataclasses
from functools import partial, wraps
import json
from typing import Any, Callable
from aiohttp import hdrs, web, web_exceptions, web_request
import voluptuous as vol
from zwave_js_server import dump
from zwave_js_server.client import Client
from zwave_js_server.co... | true | true |
1c303f3a46d81485b23495f71918a4a72f230c12 | 27,316 | py | Python | synapse/replication/tcp/handler.py | Erethon/synapse | d13863d6eb4b3a1ce1ca4a702ae30d4f8808e51f | [
"Apache-2.0"
] | 1 | 2020-10-10T13:23:05.000Z | 2020-10-10T13:23:05.000Z | synapse/replication/tcp/handler.py | Erethon/synapse | d13863d6eb4b3a1ce1ca4a702ae30d4f8808e51f | [
"Apache-2.0"
] | null | null | null | synapse/replication/tcp/handler.py | Erethon/synapse | d13863d6eb4b3a1ce1ca4a702ae30d4f8808e51f | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright 2017 Vector Creations Ltd
# Copyright 2020 The Matrix.org Foundation C.I.C.
#
# 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/l... | 36.814016 | 93 | 0.633145 |
import logging
from typing import (
Any,
Awaitable,
Dict,
Iterable,
Iterator,
List,
Optional,
Set,
Tuple,
TypeVar,
Union,
)
from prometheus_client import Counter
from typing_extensions import Deque
from twisted.internet.protocol import ReconnectingClientFacto... | true | true |
1c303f70e9a7325250f4f9ef21e32dd6200a33f3 | 545 | py | Python | Courses/YandexAlgo/1/triangle_point.py | searayeah/sublime-snippets | deff53a06948691cd5e5d7dcfa85515ddd8fab0b | [
"MIT"
] | null | null | null | Courses/YandexAlgo/1/triangle_point.py | searayeah/sublime-snippets | deff53a06948691cd5e5d7dcfa85515ddd8fab0b | [
"MIT"
] | null | null | null | Courses/YandexAlgo/1/triangle_point.py | searayeah/sublime-snippets | deff53a06948691cd5e5d7dcfa85515ddd8fab0b | [
"MIT"
] | null | null | null | def dist(x1, y1, x2, y2):
return ((x1 - x2) ** 2 + (y1 - y2) ** 2) ** 0.5
def solve():
d = int(input())
x, y = map(int, input().split())
if (y <= -x + d) and (x >= 0) and (y >= 0):
return 0
else:
a = dist(0, 0, x, y)
b = dist(d, 0, x, y)
c = dist(0, d, x, y)
... | 20.185185 | 51 | 0.33578 | def dist(x1, y1, x2, y2):
return ((x1 - x2) ** 2 + (y1 - y2) ** 2) ** 0.5
def solve():
d = int(input())
x, y = map(int, input().split())
if (y <= -x + d) and (x >= 0) and (y >= 0):
return 0
else:
a = dist(0, 0, x, y)
b = dist(d, 0, x, y)
c = dist(0, d, x, y)
... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.