hexsha stringlengths 40 40 | size int64 2 1.02M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 245 | max_stars_repo_name stringlengths 6 130 | max_stars_repo_head_hexsha stringlengths 40 40 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 245 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 245 | max_forks_repo_name stringlengths 6 130 | max_forks_repo_head_hexsha stringlengths 40 40 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 2 1.02M | avg_line_length float64 1 417k | max_line_length int64 1 987k | alphanum_fraction float64 0 1 | content_no_comment stringlengths 0 1.01M | is_comment_constant_removed bool 1
class | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f7161a30a649ebcfed2157ecee02dcc94672948b | 4,221 | py | Python | mighty/trainer/autoencoder.py | dizcza/pytorch-mighty | 942c53b529377c9100bffc2f7f20ec740763e6ae | [
"BSD-3-Clause"
] | 1 | 2020-11-14T20:15:07.000Z | 2020-11-14T20:15:07.000Z | mighty/trainer/autoencoder.py | dizcza/pytorch-mighty | 942c53b529377c9100bffc2f7f20ec740763e6ae | [
"BSD-3-Clause"
] | null | null | null | mighty/trainer/autoencoder.py | dizcza/pytorch-mighty | 942c53b529377c9100bffc2f7f20ec740763e6ae | [
"BSD-3-Clause"
] | 2 | 2021-01-15T05:52:53.000Z | 2021-03-26T17:41:17.000Z | from typing import Union
import torch
import torch.nn as nn
import torch.utils.data
from torch.optim.lr_scheduler import _LRScheduler, ReduceLROnPlateau
from torch.optim.optimizer import Optimizer
from mighty.loss import LossPenalty
from mighty.models import AutoencoderLinear
from mighty.monitor.monitor import Monito... | 34.317073 | 77 | 0.662876 | from typing import Union
import torch
import torch.nn as nn
import torch.utils.data
from torch.optim.lr_scheduler import _LRScheduler, ReduceLROnPlateau
from torch.optim.optimizer import Optimizer
from mighty.loss import LossPenalty
from mighty.models import AutoencoderLinear
from mighty.monitor.monitor import Monito... | true | true |
f7161b6e4e31964b3a9005f00d17ab5c36f84872 | 119 | py | Python | managePHP/apps.py | uzairAK/serverom-panel | 3dcde05ad618e6bef280db7d3180f926fe2ab1db | [
"MIT"
] | null | null | null | managePHP/apps.py | uzairAK/serverom-panel | 3dcde05ad618e6bef280db7d3180f926fe2ab1db | [
"MIT"
] | null | null | null | managePHP/apps.py | uzairAK/serverom-panel | 3dcde05ad618e6bef280db7d3180f926fe2ab1db | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from django.apps import AppConfig
class ManagephpConfig(AppConfig):
name = 'managePHP'
| 13.222222 | 33 | 0.680672 |
from django.apps import AppConfig
class ManagephpConfig(AppConfig):
name = 'managePHP'
| true | true |
f7161b7902bab32f86e6014239d17115293e71f9 | 472 | py | Python | home/migrations/0009_userprofile_image.py | VSevagen/ProctOS | a34124b0a5d152e30c064c8ed801e7af894eb04a | [
"MIT"
] | null | null | null | home/migrations/0009_userprofile_image.py | VSevagen/ProctOS | a34124b0a5d152e30c064c8ed801e7af894eb04a | [
"MIT"
] | null | null | null | home/migrations/0009_userprofile_image.py | VSevagen/ProctOS | a34124b0a5d152e30c064c8ed801e7af894eb04a | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by Django 1.11.8 on 2019-04-29 17:15
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('home', '0008_userprofile_job'),
]
operations = [
migrations.AddField(
... | 22.47619 | 75 | 0.622881 |
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('home', '0008_userprofile_job'),
]
operations = [
migrations.AddField(
model_name='userprofile',
name='image',
... | true | true |
f7161c240b0c336a9c97d362b4c36a3bed371c38 | 741 | py | Python | leetcode/26.remove-duplicates-from-sorted-array.py | geemaple/algorithm | 68bc5032e1ee52c22ef2f2e608053484c487af54 | [
"MIT"
] | 177 | 2017-08-21T08:57:43.000Z | 2020-06-22T03:44:22.000Z | leetcode/26.remove-duplicates-from-sorted-array.py | geemaple/algorithm | 68bc5032e1ee52c22ef2f2e608053484c487af54 | [
"MIT"
] | 2 | 2018-09-06T13:39:12.000Z | 2019-06-03T02:54:45.000Z | leetcode/26.remove-duplicates-from-sorted-array.py | geemaple/algorithm | 68bc5032e1ee52c22ef2f2e608053484c487af54 | [
"MIT"
] | 23 | 2017-08-23T06:01:28.000Z | 2020-04-20T03:17:36.000Z | class Solution(object):
def removeDuplicates(self, nums: List[int]) -> int:
i = 0
for j in range(len(nums)):
if (i == 0 or nums[i - 1] < nums[j]):
nums[i] = nums[j]
i += 1
return i
class Solution2:
def removeDuplicates(self, nums: Li... | 26.464286 | 72 | 0.404858 | class Solution(object):
def removeDuplicates(self, nums: List[int]) -> int:
i = 0
for j in range(len(nums)):
if (i == 0 or nums[i - 1] < nums[j]):
nums[i] = nums[j]
i += 1
return i
class Solution2:
def removeDuplicates(self, nums: Li... | true | true |
f7161cda1bfd467e4b31401b02eeb1c3116488de | 490 | py | Python | UnitsOfWork/ConfusionMatrixUnitOfWork.py | tzouvanas/bio-informatics | f21d1786759fcdd03481f8ee8044130cf354ad7c | [
"MIT"
] | null | null | null | UnitsOfWork/ConfusionMatrixUnitOfWork.py | tzouvanas/bio-informatics | f21d1786759fcdd03481f8ee8044130cf354ad7c | [
"MIT"
] | 1 | 2020-06-18T08:56:54.000Z | 2020-06-24T22:50:25.000Z | UnitsOfWork/ConfusionMatrixUnitOfWork.py | tzouvanas/bio-informatics | f21d1786759fcdd03481f8ee8044130cf354ad7c | [
"MIT"
] | 1 | 2022-02-25T05:36:55.000Z | 2022-02-25T05:36:55.000Z | import numpy as np
from matrices.ConfusionMatrix import ConfusionMatrix
class ConfusionMatrixUnitOfWork:
def go(self):
cm = ConfusionMatrix(4)
cm.loadRow([70, 10, 15, 5])
cm.loadRow([8, 67, 20, 5])
cm.loadRow([0, 11, 88, 1])
cm.loadRow([4, 10, 14, 72])
cm.p... | 25.789474 | 53 | 0.587755 | import numpy as np
from matrices.ConfusionMatrix import ConfusionMatrix
class ConfusionMatrixUnitOfWork:
def go(self):
cm = ConfusionMatrix(4)
cm.loadRow([70, 10, 15, 5])
cm.loadRow([8, 67, 20, 5])
cm.loadRow([0, 11, 88, 1])
cm.loadRow([4, 10, 14, 72])
cm.p... | true | true |
f7161f0450fc301397ce147c5b5b2aada8108f6e | 1,450 | py | Python | apps/sushi/tests/conftest.py | techlib/czechelib-stats | ca132e326af0924740a525710474870b1fb5fd37 | [
"MIT"
] | 1 | 2019-12-12T15:38:42.000Z | 2019-12-12T15:38:42.000Z | apps/sushi/tests/conftest.py | techlib/czechelib-stats | ca132e326af0924740a525710474870b1fb5fd37 | [
"MIT"
] | null | null | null | apps/sushi/tests/conftest.py | techlib/czechelib-stats | ca132e326af0924740a525710474870b1fb5fd37 | [
"MIT"
] | null | null | null | import pytest
from core.models import UL_ORG_ADMIN
from sushi.models import CounterReportType, SushiCredentials
from organizations.tests.conftest import organizations # noqa
from publications.tests.conftest import platforms # noqa
from logs.tests.conftest import report_type_nd # noqa
@pytest.fixture()
def counter... | 29.591837 | 90 | 0.722069 | import pytest
from core.models import UL_ORG_ADMIN
from sushi.models import CounterReportType, SushiCredentials
from organizations.tests.conftest import organizations
from publications.tests.conftest import platforms
from logs.tests.conftest import report_type_nd
@pytest.fixture()
def counter_report_type_named... | true | true |
f7161f4dccd9eaa9ca79cf77012d48452c1d866f | 11,252 | py | Python | chalice/deploy/swagger.py | devangmehta123/chalice | 9cba1bff604871c03c179e0b4be94d59a93ba198 | [
"Apache-2.0"
] | null | null | null | chalice/deploy/swagger.py | devangmehta123/chalice | 9cba1bff604871c03c179e0b4be94d59a93ba198 | [
"Apache-2.0"
] | null | null | null | chalice/deploy/swagger.py | devangmehta123/chalice | 9cba1bff604871c03c179e0b4be94d59a93ba198 | [
"Apache-2.0"
] | null | null | null | import copy
import inspect
from typing import Any, List, Dict, Optional, Union # noqa
from chalice.app import Chalice, RouteEntry, Authorizer, CORSConfig # noqa
from chalice.app import ChaliceAuthorizer
from chalice.deploy.planner import StringFormat
from chalice.deploy.models import RestAPI # noqa
from chalice.ut... | 36.891803 | 79 | 0.546481 | import copy
import inspect
from typing import Any, List, Dict, Optional, Union
from chalice.app import Chalice, RouteEntry, Authorizer, CORSConfig
from chalice.app import ChaliceAuthorizer
from chalice.deploy.planner import StringFormat
from chalice.deploy.models import RestAPI
from chalice.utils import to_cfn_... | true | true |
f7161f67b3ae378daf9562eda41ea0921d60fa10 | 1,605 | py | Python | opentutorials_python2/opentutorials_python2/19_Override/2_Override_deepen.py | dongrami0425/Python_OpenCV-Study | c7faee4f63720659280c3222ba5abfe27740d1f4 | [
"MIT"
] | null | null | null | opentutorials_python2/opentutorials_python2/19_Override/2_Override_deepen.py | dongrami0425/Python_OpenCV-Study | c7faee4f63720659280c3222ba5abfe27740d1f4 | [
"MIT"
] | null | null | null | opentutorials_python2/opentutorials_python2/19_Override/2_Override_deepen.py | dongrami0425/Python_OpenCV-Study | c7faee4f63720659280c3222ba5abfe27740d1f4 | [
"MIT"
] | null | null | null | # 계산기 예제. 오버라이드의 활용.
class Cal(object):
_history = []
def __init__(self, v1, v2):
if isinstance(v1, int):
self.v1 = v1
if isinstance(v2, int):
self.v2 = v2
def add(self):
result = self.v1+self.v2
Cal._history.append("add : %d+%d=%d" % (self.v1, sel... | 24.318182 | 84 | 0.560125 |
class Cal(object):
_history = []
def __init__(self, v1, v2):
if isinstance(v1, int):
self.v1 = v1
if isinstance(v2, int):
self.v2 = v2
def add(self):
result = self.v1+self.v2
Cal._history.append("add : %d+%d=%d" % (self.v1, self.v2, result))
... | true | true |
f7161fc6e8dcba67239d796b5f8323d0d179af8d | 850 | py | Python | scripts/filter_top.py | isabella232/azure-signalr-bench | 99a5af8ac350282b78a3a06b7aadd786e7150244 | [
"MIT"
] | null | null | null | scripts/filter_top.py | isabella232/azure-signalr-bench | 99a5af8ac350282b78a3a06b7aadd786e7150244 | [
"MIT"
] | 1 | 2021-02-23T23:13:09.000Z | 2021-02-23T23:13:09.000Z | scripts/filter_top.py | isabella232/azure-signalr-bench | 99a5af8ac350282b78a3a06b7aadd786e7150244 | [
"MIT"
] | null | null | null | import argparse
import datetime
import glob, os, re
from filter_utils import *
if __name__=="__main__":
parser = argparse.ArgumentParser()
parser.add_argument("-s", "--startDate",
default=aWeekAgo(),
help="specify the starting date to check, default is a week ago")
parser.add_argument("-e... | 34 | 91 | 0.621176 | import argparse
import datetime
import glob, os, re
from filter_utils import *
if __name__=="__main__":
parser = argparse.ArgumentParser()
parser.add_argument("-s", "--startDate",
default=aWeekAgo(),
help="specify the starting date to check, default is a week ago")
parser.add_argument("-e... | true | true |
f71620ef373fd3749805cb5e901e1f1cc8895aef | 159 | py | Python | frimcla/StatisticalAnalysis/__init__.py | ManuGar/ObjectClassificationByTransferLearning | fc009fc5a71668355a94ea1a8f506fdde8e7bde0 | [
"MIT"
] | 3 | 2021-04-22T09:15:34.000Z | 2022-01-05T09:50:18.000Z | frimcla/StatisticalAnalysis/__init__.py | ManuGar/ObjectClassificationByTransferLearning | fc009fc5a71668355a94ea1a8f506fdde8e7bde0 | [
"MIT"
] | 4 | 2020-09-25T22:46:39.000Z | 2021-08-25T15:01:14.000Z | frimcla/StatisticalAnalysis/__init__.py | ManuGar/ObjectClassificationByTransferLearning | fc009fc5a71668355a94ea1a8f506fdde8e7bde0 | [
"MIT"
] | 3 | 2020-07-31T14:11:26.000Z | 2021-11-24T01:53:01.000Z | """A pypi demonstration vehicle.
.. moduleauthor:: Andrew Carter <andrew@invalid.com>
"""
from .statisticalAnalysis import *
__all__ = ['compare_methods']
| 15.9 | 52 | 0.72956 |
from .statisticalAnalysis import *
__all__ = ['compare_methods']
| true | true |
f71622aea7d6b89a7c4742971cb49b5011e7e9cd | 6,024 | py | Python | src/oci/log_analytics/models/parser_test_result.py | Manny27nyc/oci-python-sdk | de60b04e07a99826254f7255e992f41772902df7 | [
"Apache-2.0",
"BSD-3-Clause"
] | 249 | 2017-09-11T22:06:05.000Z | 2022-03-04T17:09:29.000Z | src/oci/log_analytics/models/parser_test_result.py | Manny27nyc/oci-python-sdk | de60b04e07a99826254f7255e992f41772902df7 | [
"Apache-2.0",
"BSD-3-Clause"
] | 228 | 2017-09-11T23:07:26.000Z | 2022-03-23T10:58:50.000Z | src/oci/log_analytics/models/parser_test_result.py | Manny27nyc/oci-python-sdk | de60b04e07a99826254f7255e992f41772902df7 | [
"Apache-2.0",
"BSD-3-Clause"
] | 224 | 2017-09-27T07:32:43.000Z | 2022-03-25T16:55:42.000Z | # coding: utf-8
# Copyright (c) 2016, 2021, Oracle and/or its affiliates. All rights reserved.
# This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may c... | 30.892308 | 245 | 0.65488 |
from oci.util import formatted_flat_dict, NONE_SENTINEL, value_allowed_none_or_none_sentinel
from oci.decorators import init_model_state_from_kwargs
@init_model_state_from_kwargs
class ParserTestResult(object):
def __init__(self, **kwargs):
self.swagger_types = {
'additional_info': 'di... | true | true |
f71622f18cba8cd47f00c885daecfb96114e8221 | 806 | py | Python | tests/utils.py | thiagopena/python-mcollective | 77cac3e23e6a61542662be3b8f94ee54bbfea942 | [
"BSD-3-Clause"
] | 1 | 2015-07-29T00:35:51.000Z | 2015-07-29T00:35:51.000Z | tests/utils.py | jantman/python-mcollective | ceb8f362bc8a1981b42696889250bed1cce07fea | [
"BSD-3-Clause"
] | null | null | null | tests/utils.py | jantman/python-mcollective | ceb8f362bc8a1981b42696889250bed1cce07fea | [
"BSD-3-Clause"
] | 1 | 2019-01-02T18:40:24.000Z | 2019-01-02T18:40:24.000Z | # coding: utf-8
import os
import jinja2
ROOT = os.path.abspath(os.path.join(__file__, '..'))
DEFAULT_CTXT = {
'topic': 'topic',
'collectives': ['mcollective', 'sub1'],
'maincollective': 'mcollective',
'root': ROOT,
'loglevel': 'debug',
'daemonize': 0,
'identity': 'mco1',
'securityprovi... | 24.424242 | 79 | 0.550868 |
import os
import jinja2
ROOT = os.path.abspath(os.path.join(__file__, '..'))
DEFAULT_CTXT = {
'topic': 'topic',
'collectives': ['mcollective', 'sub1'],
'maincollective': 'mcollective',
'root': ROOT,
'loglevel': 'debug',
'daemonize': 0,
'identity': 'mco1',
'securityprovider': 'none',
... | true | true |
f71623279ac09811be88393ace0f3f65306bffca | 3,425 | py | Python | scripts/ancora.py | crscardellino/dnnvsd | 2de14f05b71199be1b0ee601287243ea25f92cba | [
"BSD-3-Clause"
] | 3 | 2016-03-10T21:03:28.000Z | 2018-04-09T03:53:58.000Z | scripts/ancora.py | crscardellino/dnnvsd | 2de14f05b71199be1b0ee601287243ea25f92cba | [
"BSD-3-Clause"
] | null | null | null | scripts/ancora.py | crscardellino/dnnvsd | 2de14f05b71199be1b0ee601287243ea25f92cba | [
"BSD-3-Clause"
] | null | null | null | from nltk.corpus.reader.api import SyntaxCorpusReader
from nltk.corpus.reader import xmldocs
from nltk import tree
from nltk.util import LazyMap, LazyConcatenation
from nltk.corpus.reader.util import concat
def parsed(element):
"""Converts a 'sentence' XML element (xml.etree.ElementTree.Element) to
an NLTK tr... | 33.578431 | 80 | 0.640584 | from nltk.corpus.reader.api import SyntaxCorpusReader
from nltk.corpus.reader import xmldocs
from nltk import tree
from nltk.util import LazyMap, LazyConcatenation
from nltk.corpus.reader.util import concat
def parsed(element):
if element:
subtrees = map(parsed, element)
subtrees = [t for... | true | true |
f71624b25629b5f413869a0e9a164584fb6bbe16 | 54,615 | py | Python | rllab/misc/instrument.py | RussellM2020/RoboticTasks | c7157c986cdbbf08cc0ea296205ef2dbcf6fc487 | [
"MIT"
] | null | null | null | rllab/misc/instrument.py | RussellM2020/RoboticTasks | c7157c986cdbbf08cc0ea296205ef2dbcf6fc487 | [
"MIT"
] | null | null | null | rllab/misc/instrument.py | RussellM2020/RoboticTasks | c7157c986cdbbf08cc0ea296205ef2dbcf6fc487 | [
"MIT"
] | null | null | null | import os
import re
import subprocess
import base64
import os.path as osp
import pickle as pickle
import inspect
import hashlib
import sys
from contextlib import contextmanager
import errno
from rllab.core.serializable import Serializable
from rllab import config
from rllab.misc.console import mkdir_p
from rllab.misc... | 39.576087 | 174 | 0.567555 | import os
import re
import subprocess
import base64
import os.path as osp
import pickle as pickle
import inspect
import hashlib
import sys
from contextlib import contextmanager
import errno
from rllab.core.serializable import Serializable
from rllab import config
from rllab.misc.console import mkdir_p
from rllab.misc... | true | true |
f716261ac483bcf478965800be894dea21a24632 | 4,700 | py | Python | openstates/openstates-master/openstates/ky/legislators.py | Jgorsick/Advocacy_Angular | 8906af3ba729b2303880f319d52bce0d6595764c | [
"CC-BY-4.0"
] | null | null | null | openstates/openstates-master/openstates/ky/legislators.py | Jgorsick/Advocacy_Angular | 8906af3ba729b2303880f319d52bce0d6595764c | [
"CC-BY-4.0"
] | null | null | null | openstates/openstates-master/openstates/ky/legislators.py | Jgorsick/Advocacy_Angular | 8906af3ba729b2303880f319d52bce0d6595764c | [
"CC-BY-4.0"
] | null | null | null | from collections import defaultdict
from billy.scrape.legislators import Legislator, LegislatorScraper
import lxml.html
class KYLegislatorScraper(LegislatorScraper):
jurisdiction = 'ky'
latest_only = True
def scrape(self, chamber, year):
if chamber == 'upper':
leg_list_url = 'http:... | 33.098592 | 104 | 0.491702 | from collections import defaultdict
from billy.scrape.legislators import Legislator, LegislatorScraper
import lxml.html
class KYLegislatorScraper(LegislatorScraper):
jurisdiction = 'ky'
latest_only = True
def scrape(self, chamber, year):
if chamber == 'upper':
leg_list_url = 'http:... | true | true |
f7162748180db3d0c6d31d12bd970036ad3500b1 | 1,747 | py | Python | python/training/ami2text.py | bmilde/ambientsearch | 74bf83a313e19da54a4e44158063041f981424c9 | [
"Apache-2.0"
] | 20 | 2016-04-30T11:24:45.000Z | 2021-11-09T10:39:25.000Z | python/training/ami2text.py | bmilde/ambientsearch | 74bf83a313e19da54a4e44158063041f981424c9 | [
"Apache-2.0"
] | 1 | 2020-09-23T13:36:58.000Z | 2020-09-23T13:36:58.000Z | python/training/ami2text.py | bmilde/ambientsearch | 74bf83a313e19da54a4e44158063041f981424c9 | [
"Apache-2.0"
] | 8 | 2015-10-07T13:40:36.000Z | 2019-08-07T06:45:24.000Z | import xml.etree.ElementTree as ET
import os
import codecs
import logging
import sys
import argparse
logging.basicConfig(format='%(asctime)s : %(levelname)s : %(message)s', level=logging.INFO)
program = os.path.basename(sys.argv[0])
logger = logging.getLogger(program)
def convert_ami(ami_root_dir, txt_output_dir):
... | 41.595238 | 176 | 0.651975 | import xml.etree.ElementTree as ET
import os
import codecs
import logging
import sys
import argparse
logging.basicConfig(format='%(asctime)s : %(levelname)s : %(message)s', level=logging.INFO)
program = os.path.basename(sys.argv[0])
logger = logging.getLogger(program)
def convert_ami(ami_root_dir, txt_output_dir):
... | true | true |
f71628d61972f5279f3ebaa39213c9541c466954 | 2,296 | py | Python | nc/binders/epub.py | masroore/novel_crawler | 7c3c7affc4a177e7a5a308af5b48685ebb55ec9d | [
"Apache-2.0"
] | null | null | null | nc/binders/epub.py | masroore/novel_crawler | 7c3c7affc4a177e7a5a308af5b48685ebb55ec9d | [
"Apache-2.0"
] | null | null | null | nc/binders/epub.py | masroore/novel_crawler | 7c3c7affc4a177e7a5a308af5b48685ebb55ec9d | [
"Apache-2.0"
] | null | null | null | import logging
import os
from ebooklib import epub
logger = logging.getLogger('EPUB_BINDER')
def make_intro_page(crawler):
html = '<div style="padding-top: 25%; text-align: center;">'
html += '<h1>%s</h1>' % (crawler.novel_title or 'N/A')
html += '<h3>%s</h3>' % (crawler.novel_author or 'N/A').replace('... | 28 | 78 | 0.616725 | import logging
import os
from ebooklib import epub
logger = logging.getLogger('EPUB_BINDER')
def make_intro_page(crawler):
html = '<div style="padding-top: 25%; text-align: center;">'
html += '<h1>%s</h1>' % (crawler.novel_title or 'N/A')
html += '<h3>%s</h3>' % (crawler.novel_author or 'N/A').replace('... | true | true |
f71628d715ee90235618f6ae675b83c05225b297 | 1,284 | py | Python | Q2.py | jlo118/DLlab2 | 01978907f48cfeb5cc406564a64454dc6b4f8485 | [
"MIT"
] | null | null | null | Q2.py | jlo118/DLlab2 | 01978907f48cfeb5cc406564a64454dc6b4f8485 | [
"MIT"
] | null | null | null | Q2.py | jlo118/DLlab2 | 01978907f48cfeb5cc406564a64454dc6b4f8485 | [
"MIT"
] | null | null | null | import pandas
from keras.models import Sequential
from keras.layers.core import Dense, Activation
from keras.callbacks import TensorBoard
# load dataset
from sklearn.model_selection import train_test_split
import pandas as pd
dataset = pd.read_csv("framingham.csv", header=None).values
import numpy as np
X_... | 37.764706 | 85 | 0.690031 | import pandas
from keras.models import Sequential
from keras.layers.core import Dense, Activation
from keras.callbacks import TensorBoard
from sklearn.model_selection import train_test_split
import pandas as pd
dataset = pd.read_csv("framingham.csv", header=None).values
import numpy as np
X_train, X_test, ... | true | true |
f71628db5d9203bb58bae7d94aa015efbb6d6e01 | 13,115 | py | Python | saleor/graphql/account/mutations/staff.py | lov3stor3/lov3stor3 | 1a0d94da1ce61d35ba5efbadbe737b039fedfe87 | [
"CC-BY-4.0"
] | 1 | 2020-09-30T19:33:43.000Z | 2020-09-30T19:33:43.000Z | saleor/graphql/account/mutations/staff.py | lov3stor3/lov3stor3 | 1a0d94da1ce61d35ba5efbadbe737b039fedfe87 | [
"CC-BY-4.0"
] | 2 | 2021-03-09T17:15:05.000Z | 2022-02-10T19:15:11.000Z | saleor/graphql/account/mutations/staff.py | lov3stor3/lov3stor3 | 1a0d94da1ce61d35ba5efbadbe737b039fedfe87 | [
"CC-BY-4.0"
] | 1 | 2019-12-04T22:24:13.000Z | 2019-12-04T22:24:13.000Z | from copy import copy
import graphene
from django.core.exceptions import ValidationError
from graphql_jwt.decorators import staff_member_required
from graphql_jwt.exceptions import PermissionDenied
from ....account import events as account_events, models, utils
from ....account.thumbnails import create_user_avatar_th... | 33.118687 | 85 | 0.658025 | from copy import copy
import graphene
from django.core.exceptions import ValidationError
from graphql_jwt.decorators import staff_member_required
from graphql_jwt.exceptions import PermissionDenied
from ....account import events as account_events, models, utils
from ....account.thumbnails import create_user_avatar_th... | true | true |
f7162a0290f40dedd34ce67aa72eb82899a6ccca | 1,107 | py | Python | Modules/tobii/eye_tracking_io/utils/events.py | ATUAV/ATUAV_Experiment | d0c1c3e1ff790bffa37d404ec1f4d70b537cd7fb | [
"BSD-2-Clause"
] | 7 | 2019-04-20T05:38:05.000Z | 2022-01-17T14:48:43.000Z | Modules/tobii/eye_tracking_io/utils/events.py | ATUAV/ATUAV_Experiment | d0c1c3e1ff790bffa37d404ec1f4d70b537cd7fb | [
"BSD-2-Clause"
] | 1 | 2021-04-04T01:50:09.000Z | 2021-04-04T01:50:09.000Z | Modules/tobii/eye_tracking_io/utils/events.py | ATUAV/ATUAV_Experiment | d0c1c3e1ff790bffa37d404ec1f4d70b537cd7fb | [
"BSD-2-Clause"
] | 2 | 2020-06-22T03:04:26.000Z | 2021-07-10T20:14:55.000Z |
class Events:
def __getattr__(self, name):
if hasattr(self.__class__, '__events__'):
assert name in self.__class__.__events__, \
"Event '%s' is not declared" % name
self.__dict__[name] = ev = _EventSlot(name)
return ev
def __repr__(self):
retu... | 24.065217 | 56 | 0.551942 |
class Events:
def __getattr__(self, name):
if hasattr(self.__class__, '__events__'):
assert name in self.__class__.__events__, \
"Event '%s' is not declared" % name
self.__dict__[name] = ev = _EventSlot(name)
return ev
def __repr__(self):
retu... | true | true |
f7162a3a84cc9137e9125489d2dc95fb668b61c3 | 6,972 | py | Python | lib/spack/spack/mixins.py | xiki-tempula/spack | 9d66c05e93ab8a933fc59915040c0e0c86a4aac4 | [
"ECL-2.0",
"Apache-2.0",
"MIT"
] | 1 | 2020-05-24T15:23:12.000Z | 2020-05-24T15:23:12.000Z | lib/spack/spack/mixins.py | xiki-tempula/spack | 9d66c05e93ab8a933fc59915040c0e0c86a4aac4 | [
"ECL-2.0",
"Apache-2.0",
"MIT"
] | 6 | 2022-02-26T11:44:34.000Z | 2022-03-12T12:14:50.000Z | lib/spack/spack/mixins.py | xiki-tempula/spack | 9d66c05e93ab8a933fc59915040c0e0c86a4aac4 | [
"ECL-2.0",
"Apache-2.0",
"MIT"
] | 2 | 2020-09-15T02:37:59.000Z | 2020-09-21T04:34:38.000Z | # Copyright 2013-2020 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
"""This module contains additional behavior that can be attached to any given
package.
"""
import collections
import os
i... | 35.753846 | 78 | 0.647017 |
import collections
import os
import llnl.util.filesystem
__all__ = [
'filter_compiler_wrappers'
]
class PackageMixinsMeta(type):
_methods_to_be_added = {}
_add_method_before = collections.defaultdict(list)
_add_method_after = collections.defaultdict(list)
@staticmethod
def register_me... | true | true |
f7162a97b20d3185af1c91ee93a27ee014a8082c | 9,122 | py | Python | tests/utils/test_requirements_utils.py | ericgosno91/mlflow | 8d1a9e354b22919423e5295afd650e39191f701a | [
"Apache-2.0"
] | 2 | 2020-06-23T03:58:12.000Z | 2020-11-26T13:59:10.000Z | tests/utils/test_requirements_utils.py | ericgosno91/mlflow | 8d1a9e354b22919423e5295afd650e39191f701a | [
"Apache-2.0"
] | null | null | null | tests/utils/test_requirements_utils.py | ericgosno91/mlflow | 8d1a9e354b22919423e5295afd650e39191f701a | [
"Apache-2.0"
] | 1 | 2021-08-17T17:53:12.000Z | 2021-08-17T17:53:12.000Z | import os
import sys
import importlib
from unittest import mock
import importlib_metadata
import pytest
import mlflow
from mlflow.utils.requirements_utils import (
_is_comment,
_is_empty,
_is_requirements_file,
_strip_inline_comment,
_join_continued_lines,
_parse_requirements,
_prune_packa... | 33.413919 | 99 | 0.662684 | import os
import sys
import importlib
from unittest import mock
import importlib_metadata
import pytest
import mlflow
from mlflow.utils.requirements_utils import (
_is_comment,
_is_empty,
_is_requirements_file,
_strip_inline_comment,
_join_continued_lines,
_parse_requirements,
_prune_packa... | true | true |
f7162cd39631cdb90524c08f6d65d11f9c020727 | 9,440 | py | Python | reid/modeling/baseline.py | raoyongming/CAL | 76475ff56e399b276630d8bf3a4f5594803609a6 | [
"MIT"
] | 58 | 2021-08-19T16:18:41.000Z | 2022-03-30T13:00:15.000Z | reid/modeling/baseline.py | raoyongming/CAL | 76475ff56e399b276630d8bf3a4f5594803609a6 | [
"MIT"
] | 9 | 2021-09-07T03:46:13.000Z | 2022-03-24T07:22:41.000Z | reid/modeling/baseline.py | raoyongming/CAL | 76475ff56e399b276630d8bf3a4f5594803609a6 | [
"MIT"
] | 13 | 2021-08-20T05:08:09.000Z | 2022-03-07T13:12:29.000Z | import torch
from torch import nn
import torch.nn.functional as F
import sys
from .backbones.resnet import ResNet
sys.path.append('.')
EPSILON = 1e-12
def weights_init_kaiming(m):
classname = m.__class__.__name__
if classname.find('Linear') != -1:
nn.init.kaiming_normal_(m.weight, a=0, mode='fan_ou... | 33.835125 | 129 | 0.606144 | import torch
from torch import nn
import torch.nn.functional as F
import sys
from .backbones.resnet import ResNet
sys.path.append('.')
EPSILON = 1e-12
def weights_init_kaiming(m):
classname = m.__class__.__name__
if classname.find('Linear') != -1:
nn.init.kaiming_normal_(m.weight, a=0, mode='fan_ou... | true | true |
f7162d7130bd56f5b174a8b6dfb6e67c7c002e00 | 1,034 | py | Python | tests/test_runner.py | hwmrocker/boerewors | 2e9b901debb105d9c10e78c8d6f33929aa743daa | [
"Apache-2.0"
] | 10 | 2017-10-16T10:59:17.000Z | 2019-11-28T03:04:16.000Z | tests/test_runner.py | hwmrocker/boerewors | 2e9b901debb105d9c10e78c8d6f33929aa743daa | [
"Apache-2.0"
] | 1 | 2017-10-27T02:32:59.000Z | 2017-11-02T03:37:49.000Z | tests/test_runner.py | hwmrocker/boerewors | 2e9b901debb105d9c10e78c8d6f33929aa743daa | [
"Apache-2.0"
] | 5 | 2017-10-16T11:08:20.000Z | 2019-11-07T09:02:41.000Z | # Copyright 2017 trivago N.V.
#
# 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,... | 27.210526 | 74 | 0.713733 |
from context import runners
try:
from unittest.mock import Mock
except ImportError:
from mock import Mock
class MyRunner(runners.Runner):
def get_stages(self):
return [1, 2, 3]
def test_stages():
runner = MyRunner()
assert list(runner.get_stages()) == [1, 2, 3]
assert l... | true | true |
f7162d7be06b9aa23574e675f52177aea117cc8e | 401 | py | Python | reddit_backend/reddit/migrations/0003_alter_userprofile_name.py | cursedclock/reddit-backend | fb5989c758f5459e510f6599c9b9798424c17ba9 | [
"MIT"
] | 1 | 2022-01-30T17:27:44.000Z | 2022-01-30T17:27:44.000Z | reddit_backend/reddit/migrations/0003_alter_userprofile_name.py | cursedclock/reddit-backend | fb5989c758f5459e510f6599c9b9798424c17ba9 | [
"MIT"
] | null | null | null | reddit_backend/reddit/migrations/0003_alter_userprofile_name.py | cursedclock/reddit-backend | fb5989c758f5459e510f6599c9b9798424c17ba9 | [
"MIT"
] | null | null | null | # Generated by Django 3.2.8 on 2022-01-25 18:44
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('reddit', '0002_auto_20220125_1727'),
]
operations = [
migrations.AlterField(
model_name='userprofile',
name='name',
... | 21.105263 | 63 | 0.605985 |
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('reddit', '0002_auto_20220125_1727'),
]
operations = [
migrations.AlterField(
model_name='userprofile',
name='name',
field=models.CharField(max_length=5... | true | true |
f7162de5e6c0ff9b0b6fde9307f43c043b924a3c | 570 | py | Python | void/serve.py | claymation/void | 38055975a624dd9050f7604a73068c58f1185d01 | [
"MIT"
] | null | null | null | void/serve.py | claymation/void | 38055975a624dd9050f7604a73068c58f1185d01 | [
"MIT"
] | null | null | null | void/serve.py | claymation/void | 38055975a624dd9050f7604a73068c58f1185d01 | [
"MIT"
] | null | null | null | import http.server
import socketserver
class TCPServer(socketserver.TCPServer):
allow_reuse_address = True
def serve(root, port):
class Handler(http.server.SimpleHTTPRequestHandler):
def __init__(self, *args, **kwargs):
super().__init__(*args, directory=root, **kwargs)
print("Listen... | 25.909091 | 72 | 0.649123 | import http.server
import socketserver
class TCPServer(socketserver.TCPServer):
allow_reuse_address = True
def serve(root, port):
class Handler(http.server.SimpleHTTPRequestHandler):
def __init__(self, *args, **kwargs):
super().__init__(*args, directory=root, **kwargs)
print("Listen... | true | true |
f7162e0882fce0df624513ea516d61c4ad04a16b | 1,510 | py | Python | conntestd/speed_test.py | robputt796/ConTestD | e9e0f6377520e699afb4e038f79b2bc3b5bbbf64 | [
"Apache-2.0"
] | 5 | 2018-03-18T21:16:24.000Z | 2019-05-23T16:30:18.000Z | conntestd/speed_test.py | robputt796/ConTestD | e9e0f6377520e699afb4e038f79b2bc3b5bbbf64 | [
"Apache-2.0"
] | null | null | null | conntestd/speed_test.py | robputt796/ConTestD | e9e0f6377520e699afb4e038f79b2bc3b5bbbf64 | [
"Apache-2.0"
] | 1 | 2021-12-01T16:30:07.000Z | 2021-12-01T16:30:07.000Z | import datetime
import logging
import sys
from speedtest import Speedtest
from conntestd.db import get_db_session
from conntestd.db import SpeedTestResult
from conntestd.config import DB_CONN
logging.basicConfig(format='%(asctime)s %(levelname)s: %(message)s',
level=logging.INFO,
... | 28.490566 | 89 | 0.613245 | import datetime
import logging
import sys
from speedtest import Speedtest
from conntestd.db import get_db_session
from conntestd.db import SpeedTestResult
from conntestd.config import DB_CONN
logging.basicConfig(format='%(asctime)s %(levelname)s: %(message)s',
level=logging.INFO,
... | true | true |
f7162ec5ccfdab45c868e7d4895b0d5b40c0f2d9 | 33,222 | py | Python | openstack_controller/tests/test_simple_api.py | brentm5/integrations-core | 5cac8788c95d8820435ef9c5d32d6a5463cf491d | [
"BSD-3-Clause"
] | null | null | null | openstack_controller/tests/test_simple_api.py | brentm5/integrations-core | 5cac8788c95d8820435ef9c5d32d6a5463cf491d | [
"BSD-3-Clause"
] | null | null | null | openstack_controller/tests/test_simple_api.py | brentm5/integrations-core | 5cac8788c95d8820435ef9c5d32d6a5463cf491d | [
"BSD-3-Clause"
] | null | null | null | # (C) Datadog, Inc. 2018
# All rights reserved
# Licensed under Simplified BSD License (see LICENSE)
import mock
import logging
import copy
import pytest
import simplejson as json
import requests
from datadog_checks.openstack_controller.api import ApiFactory, SimpleApi, Authenticator, Credential
from datadog_checks.o... | 36.913333 | 164 | 0.498796 |
import mock
import logging
import copy
import pytest
import simplejson as json
import requests
from datadog_checks.openstack_controller.api import ApiFactory, SimpleApi, Authenticator, Credential
from datadog_checks.openstack_controller.exceptions import (
IncompleteIdentity,
MissingNovaEndpoint,
Missi... | true | true |
f716302a4a1b0faf4eeecb2c309b0e786e32105d | 14,220 | py | Python | sample_application/__init__.py | cheewoei1997/sentiment-analysis | e936824de57a8cd40586a1a19145c6205b6c0843 | [
"MIT"
] | null | null | null | sample_application/__init__.py | cheewoei1997/sentiment-analysis | e936824de57a8cd40586a1a19145c6205b6c0843 | [
"MIT"
] | null | null | null | sample_application/__init__.py | cheewoei1997/sentiment-analysis | e936824de57a8cd40586a1a19145c6205b6c0843 | [
"MIT"
] | null | null | null | from flask import Flask, render_template, flash, request
from flask_bootstrap import Bootstrap
from flask_appconfig import AppConfig
from flask_wtf import Form, RecaptchaField
from flask_wtf.file import FileField
from wtforms import TextField, HiddenField, ValidationError, RadioField,\
BooleanField, SubmitField, In... | 34.019139 | 94 | 0.600563 | from flask import Flask, render_template, flash, request
from flask_bootstrap import Bootstrap
from flask_appconfig import AppConfig
from flask_wtf import Form, RecaptchaField
from flask_wtf.file import FileField
from wtforms import TextField, HiddenField, ValidationError, RadioField,\
BooleanField, SubmitField, In... | true | true |
f71630796ef66bcc8f7e0ca2c0d9cde2f3b48935 | 20,454 | py | Python | zerver/lib/test_runner.py | N-Shar-ma/zulip | 95303a9929424b55a1f7c7cce9313c4619a9533b | [
"Apache-2.0"
] | 4 | 2021-09-16T16:46:55.000Z | 2022-02-06T13:00:21.000Z | zerver/lib/test_runner.py | jai2201/zulip | 95303a9929424b55a1f7c7cce9313c4619a9533b | [
"Apache-2.0"
] | null | null | null | zerver/lib/test_runner.py | jai2201/zulip | 95303a9929424b55a1f7c7cce9313c4619a9533b | [
"Apache-2.0"
] | null | null | null | import multiprocessing
import os
import random
import shutil
from functools import partial
from typing import Any, Callable, Dict, List, Optional, Set, Tuple, Type, Union, cast
from unittest import TestLoader, TestSuite, mock, runner
from unittest.result import TestResult
from django.conf import settings
from django.d... | 41.321212 | 130 | 0.669453 | import multiprocessing
import os
import random
import shutil
from functools import partial
from typing import Any, Callable, Dict, List, Optional, Set, Tuple, Type, Union, cast
from unittest import TestLoader, TestSuite, mock, runner
from unittest.result import TestResult
from django.conf import settings
from django.d... | true | true |
f71631e249536be2614c39b0ec54682cd0027c08 | 1,177 | py | Python | setup.py | d-nery/nyuki | f185fababee380660930243515652093855acfe7 | [
"Apache-2.0"
] | null | null | null | setup.py | d-nery/nyuki | f185fababee380660930243515652093855acfe7 | [
"Apache-2.0"
] | null | null | null | setup.py | d-nery/nyuki | f185fababee380660930243515652093855acfe7 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
from pip.req import parse_requirements
from setuptools import setup, find_packages
try:
with open('VERSION.txt', 'r') as v:
version = v.read().strip()
except FileNotFoundError:
version = '0.0.0.dev0'
with open('DESCRIPTION', 'r') as d:
long_description = d.read()
# Require... | 29.425 | 128 | 0.6661 |
from pip.req import parse_requirements
from setuptools import setup, find_packages
try:
with open('VERSION.txt', 'r') as v:
version = v.read().strip()
except FileNotFoundError:
version = '0.0.0.dev0'
with open('DESCRIPTION', 'r') as d:
long_description = d.read()
install_reqs = parse_requirem... | true | true |
f716332bfa3e033470b3ce76020eb7c792a7ea54 | 8,579 | py | Python | doc/source/conf.py | josh-friedlander-kando/arviz | 8bd1de30cbea184c1493f3272fdca8ec1e6bcc8e | [
"Apache-2.0"
] | null | null | null | doc/source/conf.py | josh-friedlander-kando/arviz | 8bd1de30cbea184c1493f3272fdca8ec1e6bcc8e | [
"Apache-2.0"
] | 1 | 2021-07-23T19:32:21.000Z | 2021-07-23T19:32:21.000Z | doc/source/conf.py | josh-friedlander-kando/arviz | 8bd1de30cbea184c1493f3272fdca8ec1e6bcc8e | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# ArviZ documentation build configuration file, created by
# sphinx-quickstart on Wed Apr 11 18:33:59 2018.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# auto... | 30.530249 | 96 | 0.681198 |
import os
import re
import sys
from typing import Dict
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))))
import arviz
arviz.rcParams["data.load"] = "eager"
arviz.Numba.disable_numba()
sys.path.insert(0, os.path.abspath("../sphinxext"))
thumb... | true | true |
f716336d6299fcdb7bed0490151a1ca232af284a | 290 | py | Python | sklift/datasets/__init__.py | rishawsingh/scikit-uplift | a46f11d24025f8489577640271abfc4d847d0334 | [
"MIT"
] | 403 | 2019-12-21T09:36:57.000Z | 2022-03-30T09:36:56.000Z | sklift/datasets/__init__.py | fspofficial/scikit-uplift | c9dd56aa0277e81ef7c4be62bf2fd33432e46f36 | [
"MIT"
] | 100 | 2020-02-29T11:52:21.000Z | 2022-03-29T23:14:33.000Z | sklift/datasets/__init__.py | fspofficial/scikit-uplift | c9dd56aa0277e81ef7c4be62bf2fd33432e46f36 | [
"MIT"
] | 81 | 2019-12-26T08:28:44.000Z | 2022-03-22T09:08:54.000Z | from .datasets import (
get_data_dir,
clear_data_dir,
fetch_x5, fetch_lenta,
fetch_criteo, fetch_hillstrom,
fetch_megafon
)
__all__ = [
'get_data_dir',
'clear_data_dir',
'fetch_x5', 'fetch_lenta',
'fetch_criteo', 'fetch_hillstrom',
'fetch_megafon'
] | 19.333333 | 38 | 0.672414 | from .datasets import (
get_data_dir,
clear_data_dir,
fetch_x5, fetch_lenta,
fetch_criteo, fetch_hillstrom,
fetch_megafon
)
__all__ = [
'get_data_dir',
'clear_data_dir',
'fetch_x5', 'fetch_lenta',
'fetch_criteo', 'fetch_hillstrom',
'fetch_megafon'
] | true | true |
f71633d94eec3d43c9c771dca70dfe474a05d300 | 491 | py | Python | build/sensor_actuator/catkin_generated/pkg.installspace.context.pc.py | kaiodt/kaio_ros_ws | d9ee0edb97d16cf2a0a6074fecd049db7367a032 | [
"BSD-2-Clause"
] | null | null | null | build/sensor_actuator/catkin_generated/pkg.installspace.context.pc.py | kaiodt/kaio_ros_ws | d9ee0edb97d16cf2a0a6074fecd049db7367a032 | [
"BSD-2-Clause"
] | null | null | null | build/sensor_actuator/catkin_generated/pkg.installspace.context.pc.py | kaiodt/kaio_ros_ws | d9ee0edb97d16cf2a0a6074fecd049db7367a032 | [
"BSD-2-Clause"
] | null | null | null | # generated from catkin/cmake/template/pkg.context.pc.in
CATKIN_PACKAGE_PREFIX = ""
PROJECT_PKG_CONFIG_INCLUDE_DIRS = "/home/kaiodt/kaio_ros_ws/install/include".split(';') if "/home/kaiodt/kaio_ros_ws/install/include" != "" else []
PROJECT_CATKIN_DEPENDS = "message_runtime;actionlib_msgs".replace(';', ' ')
PKG_CONFIG_L... | 54.555556 | 147 | 0.753564 |
CATKIN_PACKAGE_PREFIX = ""
PROJECT_PKG_CONFIG_INCLUDE_DIRS = "/home/kaiodt/kaio_ros_ws/install/include".split(';') if "/home/kaiodt/kaio_ros_ws/install/include" != "" else []
PROJECT_CATKIN_DEPENDS = "message_runtime;actionlib_msgs".replace(';', ' ')
PKG_CONFIG_LIBRARIES_WITH_PREFIX = "".split(';') if "" != "" else []... | true | true |
f71633e76aaac65d45ee61243fd61709c015ce9a | 2,671 | py | Python | download.py | HYUNMIN-HWANG/image-gpt | 457bbb212d8435d4bb20a416120301359cb3686b | [
"MIT"
] | 1,641 | 2020-06-17T18:25:14.000Z | 2022-03-29T08:04:07.000Z | download.py | HYUNMIN-HWANG/image-gpt | 457bbb212d8435d4bb20a416120301359cb3686b | [
"MIT"
] | 16 | 2020-06-17T20:08:03.000Z | 2021-12-06T03:18:33.000Z | download.py | HYUNMIN-HWANG/image-gpt | 457bbb212d8435d4bb20a416120301359cb3686b | [
"MIT"
] | 263 | 2020-06-17T18:53:24.000Z | 2022-03-27T11:39:04.000Z | import argparse
import json
import os
import sys
import requests
from tqdm import tqdm
def parse_arguments():
parser = argparse.ArgumentParser()
parser.add_argument("--download_dir", type=str, default="/root/downloads/")
parser.add_argument("--bert", action="store_true", help="download a bert model (defa... | 39.865672 | 146 | 0.639835 | import argparse
import json
import os
import sys
import requests
from tqdm import tqdm
def parse_arguments():
parser = argparse.ArgumentParser()
parser.add_argument("--download_dir", type=str, default="/root/downloads/")
parser.add_argument("--bert", action="store_true", help="download a bert model (defa... | true | true |
f716363d3776ba3009c25f34e002fe11df367a34 | 9,600 | py | Python | openstack/tests/unit/test_connection.py | IamFive/sdk-python | 223b04f90477f7de0f00b3e652d8672ba73271c8 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | openstack/tests/unit/test_connection.py | IamFive/sdk-python | 223b04f90477f7de0f00b3e652d8672ba73271c8 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | openstack/tests/unit/test_connection.py | IamFive/sdk-python | 223b04f90477f7de0f00b3e652d8672ba73271c8 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under t... | 39.183673 | 79 | 0.655729 |
import os
import fixtures
from keystoneauth1 import session as ksa_session
import mock
import os_client_config
from openstack import connection
from openstack import exceptions
from openstack import profile
from openstack import session
from openstack.tests.unit import base
CONFIG_AUTH_URL = "http://127... | true | true |
f71636a88b0788c3dada5a4ba2b8c2dd70710a74 | 334 | py | Python | projects/forms.py | 18F/projects | e8c6bef7f3a6308dbad8c772cc45ddb6d0f50dec | [
"CC0-1.0"
] | 9 | 2016-05-10T21:33:09.000Z | 2019-12-07T05:49:08.000Z | projects/forms.py | 18F/projects | e8c6bef7f3a6308dbad8c772cc45ddb6d0f50dec | [
"CC0-1.0"
] | 38 | 2016-05-10T19:15:36.000Z | 2016-07-13T15:04:37.000Z | projects/forms.py | 18F/projects | e8c6bef7f3a6308dbad8c772cc45ddb6d0f50dec | [
"CC0-1.0"
] | 4 | 2016-06-03T20:12:21.000Z | 2021-02-15T10:19:36.000Z | from dal import autocomplete
from django import forms
from .models import Project
class ProjectForm(forms.ModelForm):
class Meta:
model = Project
fields = ('__all__')
widgets = {
'client': autocomplete.ModelSelect2(
url='projects:client-autocomplete'
... | 18.555556 | 48 | 0.595808 | from dal import autocomplete
from django import forms
from .models import Project
class ProjectForm(forms.ModelForm):
class Meta:
model = Project
fields = ('__all__')
widgets = {
'client': autocomplete.ModelSelect2(
url='projects:client-autocomplete'
... | true | true |
f716376a1e682052bb9b284fd666fd0f58de3a38 | 1,994 | py | Python | php/python/DatabaseManager.py | the16bitgamer/YourflixMkII | 3be2407b214b8553e0a83af04b463cd99c04cf32 | [
"MIT"
] | null | null | null | php/python/DatabaseManager.py | the16bitgamer/YourflixMkII | 3be2407b214b8553e0a83af04b463cd99c04cf32 | [
"MIT"
] | null | null | null | php/python/DatabaseManager.py | the16bitgamer/YourflixMkII | 3be2407b214b8553e0a83af04b463cd99c04cf32 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import MySQLdb
_connectedDb = None
_dbCursor = None
def ConnectToDb(self, userID, userPassword):
if self._connectedDb is not None:
DisconnectDb(self)
self._connectedDb = MySQLdb.connect(host="localhost", user = userID, passwd=userPassword)
self._dbCursor = self._co... | 33.233333 | 114 | 0.604313 |
import MySQLdb
_connectedDb = None
_dbCursor = None
def ConnectToDb(self, userID, userPassword):
if self._connectedDb is not None:
DisconnectDb(self)
self._connectedDb = MySQLdb.connect(host="localhost", user = userID, passwd=userPassword)
self._dbCursor = self._connectedDb.cursor()
return "Connected to Dat... | true | true |
f716384515c52a1f9ca6af89058c342de1fc5533 | 4,424 | py | Python | symphony/cli/tests/pyinventory_tests/test_service_type.py | omnicate/magma | e1e6c244f9e8bd000587a3dad3c54f4e64ada222 | [
"BSD-3-Clause"
] | null | null | null | symphony/cli/tests/pyinventory_tests/test_service_type.py | omnicate/magma | e1e6c244f9e8bd000587a3dad3c54f4e64ada222 | [
"BSD-3-Clause"
] | null | null | null | symphony/cli/tests/pyinventory_tests/test_service_type.py | omnicate/magma | e1e6c244f9e8bd000587a3dad3c54f4e64ada222 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) 2004-present Facebook All rights reserved.
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file.
from pyinventory.api.equipment_type import add_equipment_type
from pyinventory.api.service import add_service
from pyinventory.api.serv... | 36.262295 | 88 | 0.631103 |
from pyinventory.api.equipment_type import add_equipment_type
from pyinventory.api.service import add_service
from pyinventory.api.service_type import (
_populate_service_types,
add_service_type,
delete_service_type,
delete_service_type_with_services,
edit_service_type,
get_service_type,
)
... | true | true |
f71639222fd2734617fde428e4935406b4096eab | 2,925 | py | Python | photoslib/fields.py | ivan-sysoi/django-photoslib | ffab2a7c238bcfec709a2db31fdd3b40757cf730 | [
"MIT"
] | null | null | null | photoslib/fields.py | ivan-sysoi/django-photoslib | ffab2a7c238bcfec709a2db31fdd3b40757cf730 | [
"MIT"
] | 11 | 2020-04-05T17:46:46.000Z | 2022-02-12T05:11:38.000Z | photoslib/fields.py | ivan-sysoi/django-photoslib | ffab2a7c238bcfec709a2db31fdd3b40757cf730 | [
"MIT"
] | null | null | null | from io import BytesIO
from PIL import Image
from django.conf import settings
from django.db import models
from pilkit.processors import ProcessorPipeline
from pilkit.utils import save_image
from sortedm2m.fields import SortedManyToManyField
from .forms import PhotoFieldWidget
__all__ = ('PhotoField', 'ManyPhotosFie... | 41.785714 | 120 | 0.704274 | from io import BytesIO
from PIL import Image
from django.conf import settings
from django.db import models
from pilkit.processors import ProcessorPipeline
from pilkit.utils import save_image
from sortedm2m.fields import SortedManyToManyField
from .forms import PhotoFieldWidget
__all__ = ('PhotoField', 'ManyPhotosFie... | true | true |
f7163953b4e98f271c1d184f936ad3281be2de7f | 13,990 | py | Python | src/olympia/amo/sitemap.py | snifhex/addons-server | 2b9dee65c10c0dca700ff2d25f3694c7cf769816 | [
"BSD-3-Clause"
] | null | null | null | src/olympia/amo/sitemap.py | snifhex/addons-server | 2b9dee65c10c0dca700ff2d25f3694c7cf769816 | [
"BSD-3-Clause"
] | null | null | null | src/olympia/amo/sitemap.py | snifhex/addons-server | 2b9dee65c10c0dca700ff2d25f3694c7cf769816 | [
"BSD-3-Clause"
] | null | null | null | import datetime
import math
import os
from collections import namedtuple
from urllib.parse import urlparse
from django.conf import settings
from django.contrib.sitemaps import Sitemap as DjangoSitemap
from django.db.models import Count, Max, Q
from django.template import loader
from django.utils.functional import cach... | 32.917647 | 92 | 0.59757 | import datetime
import math
import os
from collections import namedtuple
from urllib.parse import urlparse
from django.conf import settings
from django.contrib.sitemaps import Sitemap as DjangoSitemap
from django.db.models import Count, Max, Q
from django.template import loader
from django.utils.functional import cach... | true | true |
f71639dc7301c19e856134c3182b0033b000fd73 | 9,078 | py | Python | app.py | andrius-siup/recipe-book | e08b4bd00bf2e79d65623e6a62d865535695afb2 | [
"W3C"
] | null | null | null | app.py | andrius-siup/recipe-book | e08b4bd00bf2e79d65623e6a62d865535695afb2 | [
"W3C"
] | null | null | null | app.py | andrius-siup/recipe-book | e08b4bd00bf2e79d65623e6a62d865535695afb2 | [
"W3C"
] | 1 | 2021-06-06T19:21:07.000Z | 2021-06-06T19:21:07.000Z | import os
from flask import (
Flask, flash, render_template, redirect, request, session, url_for)
from flask_pymongo import PyMongo
from bson.objectid import ObjectId
from werkzeug.security import generate_password_hash, check_password_hash
if os.path.exists("env.py"):
import env
app = Flask(__name__)
app.c... | 33.498155 | 79 | 0.630205 | import os
from flask import (
Flask, flash, render_template, redirect, request, session, url_for)
from flask_pymongo import PyMongo
from bson.objectid import ObjectId
from werkzeug.security import generate_password_hash, check_password_hash
if os.path.exists("env.py"):
import env
app = Flask(__name__)
app.c... | true | true |
f7163ae8d9b4b8ad1f3485dbb15b35d439655fb7 | 7,944 | py | Python | Algo and DSA/LeetCode-Solutions-master/Python/maximum-students-taking-exam.py | Sourav692/FAANG-Interview-Preparation | f523e5c94d582328b3edc449ea16ac6ab28cdc81 | [
"Unlicense"
] | 3,269 | 2018-10-12T01:29:40.000Z | 2022-03-31T17:58:41.000Z | Algo and DSA/LeetCode-Solutions-master/Python/maximum-students-taking-exam.py | Sourav692/FAANG-Interview-Preparation | f523e5c94d582328b3edc449ea16ac6ab28cdc81 | [
"Unlicense"
] | 53 | 2018-12-16T22:54:20.000Z | 2022-02-25T08:31:20.000Z | Algo and DSA/LeetCode-Solutions-master/Python/maximum-students-taking-exam.py | Sourav692/FAANG-Interview-Preparation | f523e5c94d582328b3edc449ea16ac6ab28cdc81 | [
"Unlicense"
] | 1,236 | 2018-10-12T02:51:40.000Z | 2022-03-30T13:30:37.000Z | # Time: O(m * n * sqrt(m * n))
# Space: O(m * n)
# the problem is the same as google codejam 2008 round 3 problem C
# https://github.com/kamyu104/GoogleCodeJam-2008/blob/master/Round%203/no_cheating.py
import collections
from functools import partial
# Time: O(E * sqrt(V))
# Space: O(V)
# Source code from http:/... | 35.783784 | 96 | 0.463746 |
import collections
from functools import partial
def bipartiteMatch(graph):
matching = {}
for u in graph:
for v in graph[u]:
if v not in matching:
matching[v] = u
break
while 1:
... | true | true |
f7163b255379b5cf9193461da5b080f53d6d16ab | 3,775 | py | Python | tests/settings.py | ShreeshaRelysys/openwisp-utils | 7c0b5f249b0e8e1f3af7bf1942b6543c9375dd75 | [
"BSD-3-Clause"
] | null | null | null | tests/settings.py | ShreeshaRelysys/openwisp-utils | 7c0b5f249b0e8e1f3af7bf1942b6543c9375dd75 | [
"BSD-3-Clause"
] | 1 | 2022-01-25T17:46:52.000Z | 2022-01-25T17:46:52.000Z | tests/settings.py | ShreeshaRelysys/openwisp-utils | 7c0b5f249b0e8e1f3af7bf1942b6543c9375dd75 | [
"BSD-3-Clause"
] | null | null | null | import os
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
SECRET_KEY = '@s8$swhj9du^aglt5+@ut^)wepr+un1m7r*+ixcq(-5i^st=y^'
SELENIUM_HEADLESS = True if os.environ.get('SELENIUM_HEADLESS', False) else False
DEBUG = True
ALLOWED_HOSTS = []
INSTALLED_APPS = [
'django.contrib.auth',
'dj... | 28.816794 | 84 | 0.668344 | import os
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
SECRET_KEY = '@s8$swhj9du^aglt5+@ut^)wepr+un1m7r*+ixcq(-5i^st=y^'
SELENIUM_HEADLESS = True if os.environ.get('SELENIUM_HEADLESS', False) else False
DEBUG = True
ALLOWED_HOSTS = []
INSTALLED_APPS = [
'django.contrib.auth',
'dj... | true | true |
f7163cfff64ff8625e0a556e900a1ef0e9f60f52 | 13,630 | py | Python | mpe/environment.py | semitable/multiagent-particle-envs | 2cef12f72a9192a819ef289646526801c39fb909 | [
"MIT"
] | null | null | null | mpe/environment.py | semitable/multiagent-particle-envs | 2cef12f72a9192a819ef289646526801c39fb909 | [
"MIT"
] | null | null | null | mpe/environment.py | semitable/multiagent-particle-envs | 2cef12f72a9192a819ef289646526801c39fb909 | [
"MIT"
] | 2 | 2022-01-12T17:51:03.000Z | 2022-03-31T07:31:31.000Z | import gym
from gym import spaces
from gym.envs.registration import EnvSpec
import numpy as np
from mpe.multi_discrete import MultiDiscrete
import copy
# environment for all agents in the multiagent world
# currently code assumes that no agents will be created/destroyed at runtime!
class MultiAgentEnv(gym.Env):
me... | 37.651934 | 124 | 0.574101 | import gym
from gym import spaces
from gym.envs.registration import EnvSpec
import numpy as np
from mpe.multi_discrete import MultiDiscrete
import copy
class MultiAgentEnv(gym.Env):
metadata = {
'render.modes' : ['human', 'rgb_array']
}
def __init__(self, world, reset_callback=None, reward_callb... | true | true |
f7163d24a95dcc2a6bddc0e3154afb84cd313c70 | 53 | py | Python | python/tevreden/__init__.py | lhengstmengel/tevreden-sdk | 704b575b264f72954a7bb3afc57a9db94f1e273b | [
"MIT"
] | null | null | null | python/tevreden/__init__.py | lhengstmengel/tevreden-sdk | 704b575b264f72954a7bb3afc57a9db94f1e273b | [
"MIT"
] | null | null | null | python/tevreden/__init__.py | lhengstmengel/tevreden-sdk | 704b575b264f72954a7bb3afc57a9db94f1e273b | [
"MIT"
] | null | null | null | from tevreden.apiclient import APIClient
| 8.833333 | 40 | 0.679245 | from tevreden.apiclient import APIClient
| true | true |
f7163d55c4d7ee055eddf4948ff15e01024bdcbf | 2,574 | py | Python | wstools/scan_download.py | inductiveload/wstools | b354a642b10a8d1bfa2a7683d2270c42512cb25d | [
"MIT"
] | null | null | null | wstools/scan_download.py | inductiveload/wstools | b354a642b10a8d1bfa2a7683d2270c42512cb25d | [
"MIT"
] | null | null | null | wstools/scan_download.py | inductiveload/wstools | b354a642b10a8d1bfa2a7683d2270c42512cb25d | [
"MIT"
] | null | null | null | #! /usr/bin/env python3
import argparse
import logging
from xlsx2csv import Xlsx2csv
from io import StringIO
import csv
import os
import subprocess
import utils.ht_source
def parse_header_row(hr):
mapping = {}
for i, col in enumerate(hr):
mapping[col.lower()] = i
return mapping
def handle_r... | 26 | 83 | 0.612665 |
import argparse
import logging
from xlsx2csv import Xlsx2csv
from io import StringIO
import csv
import os
import subprocess
import utils.ht_source
def parse_header_row(hr):
mapping = {}
for i, col in enumerate(hr):
mapping[col.lower()] = i
return mapping
def handle_row(r, args):
print... | true | true |
f7163da8393455426f9f86eb28054d4db2ae3791 | 657 | py | Python | tests/test_vt100_output.py | gousaiyang/python-prompt-toolkit | 6237764658214af4c24633795d2571d2bd03375d | [
"BSD-3-Clause"
] | 6,989 | 2017-07-18T06:23:18.000Z | 2022-03-31T15:58:36.000Z | tests/test_vt100_output.py | gousaiyang/python-prompt-toolkit | 6237764658214af4c24633795d2571d2bd03375d | [
"BSD-3-Clause"
] | 1,978 | 2017-07-18T09:17:58.000Z | 2022-03-31T14:28:43.000Z | tests/test_vt100_output.py | gousaiyang/python-prompt-toolkit | 6237764658214af4c24633795d2571d2bd03375d | [
"BSD-3-Clause"
] | 1,228 | 2017-07-18T09:03:13.000Z | 2022-03-29T05:57:40.000Z | from prompt_toolkit.output.vt100 import _get_closest_ansi_color
def test_get_closest_ansi_color():
# White
assert _get_closest_ansi_color(255, 255, 255) == "ansiwhite"
assert _get_closest_ansi_color(250, 250, 250) == "ansiwhite"
# Black
assert _get_closest_ansi_color(0, 0, 0) == "ansiblack"
a... | 34.578947 | 67 | 0.724505 | from prompt_toolkit.output.vt100 import _get_closest_ansi_color
def test_get_closest_ansi_color():
assert _get_closest_ansi_color(255, 255, 255) == "ansiwhite"
assert _get_closest_ansi_color(250, 250, 250) == "ansiwhite"
assert _get_closest_ansi_color(0, 0, 0) == "ansiblack"
assert _get_clo... | true | true |
f7163dec326b34497f296ba51ed9239979207054 | 27,795 | py | Python | decompiler/magic.py | Gouvernathor/unrpyc | 25f4470ea1612ecacec578efcecc3054a59098c8 | [
"MIT"
] | 490 | 2015-01-02T19:37:41.000Z | 2022-03-27T09:26:53.000Z | decompiler/magic.py | Gouvernathor/unrpyc | 25f4470ea1612ecacec578efcecc3054a59098c8 | [
"MIT"
] | 114 | 2015-01-02T06:14:15.000Z | 2022-03-31T23:24:39.000Z | decompiler/magic.py | Gouvernathor/unrpyc | 25f4470ea1612ecacec578efcecc3054a59098c8 | [
"MIT"
] | 123 | 2015-01-02T18:17:53.000Z | 2022-03-29T13:25:17.000Z | # Copyright (c) 2015 CensoredUsername
# This module provides tools for safely analyizing pickle files programmatically
import sys
PY3 = sys.version_info >= (3, 0)
PY2 = not PY3
import types
import pickle
import struct
if PY3:
from io import BytesIO as StringIO
else:
from cStringIO import StringIO
__all__ ... | 41.177778 | 122 | 0.673862 |
import sys
PY3 = sys.version_info >= (3, 0)
PY2 = not PY3
import types
import pickle
import struct
if PY3:
from io import BytesIO as StringIO
else:
from cStringIO import StringIO
__all__ = [
"load", "loads", "safe_load", "safe_loads", "safe_dump", "safe_dumps",
"fake_package", "remove_fake_packa... | true | true |
f7163f09627011e16f710ab47f0b28e594f76ff4 | 466 | py | Python | livebot/migrations/0012_auto_20170731_2013.py | bsquidwrd/Live-Bot | f28f028ddc371b86e19df6f603aa3b14bab93533 | [
"MIT"
] | 1 | 2019-02-27T10:38:46.000Z | 2019-02-27T10:38:46.000Z | livebot/migrations/0012_auto_20170731_2013.py | bsquidwrd/Live-Bot | f28f028ddc371b86e19df6f603aa3b14bab93533 | [
"MIT"
] | 21 | 2017-08-03T01:01:31.000Z | 2020-06-05T18:02:20.000Z | livebot/migrations/0012_auto_20170731_2013.py | bsquidwrd/Live-Bot | f28f028ddc371b86e19df6f603aa3b14bab93533 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by Django 1.11.3 on 2017-08-01 03:13
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('livebot', '0011_auto_20170731_2011'),
]
operations = [
migrations.AlterModelOptions... | 23.3 | 93 | 0.643777 |
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('livebot', '0011_auto_20170731_2011'),
]
operations = [
migrations.AlterModelOptions(
name='notification',
options={'verbose_name':... | true | true |
f7163fa0dee4221d901279b0ac5dae6527bc823c | 4,872 | py | Python | model_zoo/official/nlp/lstm/eval.py | taroxd/mindspore | 9bb620ff2caaac7f1c53c4b104935f22352cb88f | [
"Apache-2.0"
] | null | null | null | model_zoo/official/nlp/lstm/eval.py | taroxd/mindspore | 9bb620ff2caaac7f1c53c4b104935f22352cb88f | [
"Apache-2.0"
] | null | null | null | model_zoo/official/nlp/lstm/eval.py | taroxd/mindspore | 9bb620ff2caaac7f1c53c4b104935f22352cb88f | [
"Apache-2.0"
] | null | null | null | # Copyright 2020 Huawei Technologies Co., Ltd
#
# 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... | 46.4 | 107 | 0.631773 |
import argparse
import os
import numpy as np
from src.config import lstm_cfg as cfg, lstm_cfg_ascend
from src.dataset import lstm_create_dataset, convert_to_mindrecord
from src.lr_schedule import get_lr
from src.lstm import SentimentNet
from mindspore import Tensor, nn, Model, context
from mindspore.nn ... | true | true |
f71640025ffae92102ad3de901450b81ff6e14af | 2,741 | py | Python | examples/charts/file/hover_span.py | pyjsdev/googlemap_flask | 9d0dd899a9cbf756b3d83c33e3d8a47e7db40cc5 | [
"BSD-3-Clause"
] | 2 | 2019-05-24T14:07:33.000Z | 2019-05-24T14:36:19.000Z | examples/charts/file/hover_span.py | pyjsdev/googlemap_flask | 9d0dd899a9cbf756b3d83c33e3d8a47e7db40cc5 | [
"BSD-3-Clause"
] | null | null | null | examples/charts/file/hover_span.py | pyjsdev/googlemap_flask | 9d0dd899a9cbf756b3d83c33e3d8a47e7db40cc5 | [
"BSD-3-Clause"
] | 1 | 2021-09-09T03:33:04.000Z | 2021-09-09T03:33:04.000Z | import pandas as pd
from bokeh.charts import Line, Scatter, show, output_file, defaults
from bokeh.layouts import gridplot
from bokeh.models import HoverTool
from bokeh.sampledata.degrees import data
defaults.width = 500
defaults.height = 300
TOOLS='box_zoom,box_select,hover,crosshair,reset'
TOOLTIPS = [ ("y", "$~y... | 31.872093 | 86 | 0.676395 | import pandas as pd
from bokeh.charts import Line, Scatter, show, output_file, defaults
from bokeh.layouts import gridplot
from bokeh.models import HoverTool
from bokeh.sampledata.degrees import data
defaults.width = 500
defaults.height = 300
TOOLS='box_zoom,box_select,hover,crosshair,reset'
TOOLTIPS = [ ("y", "$~y... | true | true |
f716411cdba7b9542f41d46f5963695af627aed2 | 732 | py | Python | integrationtest/vm/vm_offering/test_hotplugin_memory_c7.py | bgerxx/woodpecker | fdc51245945cc9be4d1f028988079213eb99b2ad | [
"Apache-2.0"
] | null | null | null | integrationtest/vm/vm_offering/test_hotplugin_memory_c7.py | bgerxx/woodpecker | fdc51245945cc9be4d1f028988079213eb99b2ad | [
"Apache-2.0"
] | null | null | null | integrationtest/vm/vm_offering/test_hotplugin_memory_c7.py | bgerxx/woodpecker | fdc51245945cc9be4d1f028988079213eb99b2ad | [
"Apache-2.0"
] | null | null | null | '''
@author: FangSun
'''
import zstackwoodpecker.test_lib as test_lib
import zstackwoodpecker.test_state as test_state
import functools
_config_ = {
'timeout' : 1000,
'noparallel' : True
}
test_stub = test_lib.lib_get_test_stub()
test_obj_dict = test_state.TestStateDict()
'''
def test()
This ... | 23.612903 | 58 | 0.625683 | import zstackwoodpecker.test_lib as test_lib
import zstackwoodpecker.test_state as test_state
import functools
_config_ = {
'timeout' : 1000,
'noparallel' : True
}
test_stub = test_lib.lib_get_test_stub()
test_obj_dict = test_state.TestStateDict()
test = functools.partial(test_stub.vm_offeri... | true | true |
f716454730d5c1602c8d8bf63c6dfeaee57d2e2c | 5,725 | py | Python | evepraisal/views.py | fucema/evepraisal | 9e35803118928696e17bd82510a1331724b3a00e | [
"Unlicense"
] | null | null | null | evepraisal/views.py | fucema/evepraisal | 9e35803118928696e17bd82510a1331724b3a00e | [
"Unlicense"
] | null | null | null | evepraisal/views.py | fucema/evepraisal | 9e35803118928696e17bd82510a1331724b3a00e | [
"Unlicense"
] | null | null | null | # -*- coding: utf-8 -*-
"""
An Eve Online Cargo Scanner
"""
import time
import json
from flask import (
g, flash, request, render_template, url_for, redirect, session,
send_from_directory, abort)
from sqlalchemy import desc
import evepaste
from helpers import login_required
from estimate import get_market... | 29.663212 | 78 | 0.608559 |
import time
import json
from flask import (
g, flash, request, render_template, url_for, redirect, session,
send_from_directory, abort)
from sqlalchemy import desc
import evepaste
from helpers import login_required
from estimate import get_market_prices
from models import Appraisals, Users, appraisal_count
f... | true | true |
f71645634067780989b528d6dbd814017009be67 | 1,620 | py | Python | Toolkits/Discovery/meta/searx/searx/engines/blekko_images.py | roscopecoltran/SniperKit-Core | 4600dffe1cddff438b948b6c22f586d052971e04 | [
"MIT"
] | null | null | null | Toolkits/Discovery/meta/searx/searx/engines/blekko_images.py | roscopecoltran/SniperKit-Core | 4600dffe1cddff438b948b6c22f586d052971e04 | [
"MIT"
] | null | null | null | Toolkits/Discovery/meta/searx/searx/engines/blekko_images.py | roscopecoltran/SniperKit-Core | 4600dffe1cddff438b948b6c22f586d052971e04 | [
"MIT"
] | null | null | null | """
Blekko (Images)
@website https://blekko.com
@provide-api yes (inofficial)
@using-api yes
@results JSON
@stable yes
@parse url, title, img_src
"""
from json import loads
from searx.url_utils import urlencode
# engine dependent config
categories = ['images']
paging = True
safesearch = ... | 22.816901 | 84 | 0.571605 |
from json import loads
from searx.url_utils import urlencode
categories = ['images']
paging = True
safesearch = True
base_url = 'https://blekko.com'
search_url = '/api/images?{query}&c={c}'
safesearch_types = {2: '1',
1: '',
0: '0'}
def request(query, params):
c = (... | true | true |
f71645c0c0fb267e3a9d8d27f97d0ec8b8f3d710 | 22,819 | py | Python | py/observer/ObserverData.py | nwfsc-fram/pyFieldSoftware | 477ba162b66ede2263693cda8c5a51d27eaa3b89 | [
"MIT"
] | null | null | null | py/observer/ObserverData.py | nwfsc-fram/pyFieldSoftware | 477ba162b66ede2263693cda8c5a51d27eaa3b89 | [
"MIT"
] | 176 | 2019-11-22T17:44:55.000Z | 2021-10-20T23:40:03.000Z | py/observer/ObserverData.py | nwfsc-fram/pyFieldSoftware | 477ba162b66ede2263693cda8c5a51d27eaa3b89 | [
"MIT"
] | 1 | 2021-05-07T01:06:32.000Z | 2021-05-07T01:06:32.000Z | # -----------------------------------------------------------------------------
# Name: ObserverData.py
# Purpose: Observer Database routines
#
# Author: Will Smith <will.smith@noaa.gov>
#
# Created: Jan - July, 2016
# License: MIT
# --------------------------------------------------------------... | 36.686495 | 117 | 0.640168 |
from operator import itemgetter
from PyQt5.QtCore import pyqtProperty, QObject, QVariant
from py.observer.ObserverDBUtil import ObserverDBUtil
from py.observer.ObserverDBModels import Lookups, Users, Vessels, \
Programs, Contacts, VesselContacts, Ports, CatchCategories, IfqDealers, Species
from py.ob... | true | true |
f716461f33bb89db290e03f930670a8c2c58abd5 | 4,917 | py | Python | test/functional/p2p_node_network_limited.py | The-Bitcoin-Phantom/The-bitcoin-Phantom | c914b51924932f07026eb6ba057c6e375e4dcdac | [
"MIT"
] | null | null | null | test/functional/p2p_node_network_limited.py | The-Bitcoin-Phantom/The-bitcoin-Phantom | c914b51924932f07026eb6ba057c6e375e4dcdac | [
"MIT"
] | null | null | null | test/functional/p2p_node_network_limited.py | The-Bitcoin-Phantom/The-bitcoin-Phantom | c914b51924932f07026eb6ba057c6e375e4dcdac | [
"MIT"
] | 1 | 2020-11-04T06:59:19.000Z | 2020-11-04T06:59:19.000Z | #!/usr/bin/env python3
# Copyright (c) 2017-2019 The bitphantom Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Tests NODE_NETWORK_LIMITED.
Tests that a node configured with -prune=550 signals NODE_NETWORK_LIMIT... | 40.636364 | 121 | 0.693512 |
from test_framework.messages import CInv, msg_getdata, msg_verack, NODE_NETWORK_LIMITED, NODE_WITNESS
from test_framework.mininode import P2PInterface, mininode_lock
from test_framework.test_framework import bitphantomTestFramework
from test_framework.util import (
assert_equal,
disconnect_nodes,
connec... | true | true |
f7164659386641171d3bd75324ad46792423c6e2 | 818 | py | Python | evidently/analyzers/test_utils.py | jim-fun/evidently | eb3479b8ce39e43601fb2d1ffbf61e0624541865 | [
"Apache-2.0"
] | null | null | null | evidently/analyzers/test_utils.py | jim-fun/evidently | eb3479b8ce39e43601fb2d1ffbf61e0624541865 | [
"Apache-2.0"
] | null | null | null | evidently/analyzers/test_utils.py | jim-fun/evidently | eb3479b8ce39e43601fb2d1ffbf61e0624541865 | [
"Apache-2.0"
] | null | null | null | import datetime
import unittest
import pandas
from evidently.analyzers.utils import process_columns
from evidently.pipeline.column_mapping import ColumnMapping
class TestUtils(unittest.TestCase):
def test_process_columns(self):
dataset = pandas.DataFrame.from_dict([
dict(datetime=datetime.da... | 32.72 | 90 | 0.660147 | import datetime
import unittest
import pandas
from evidently.analyzers.utils import process_columns
from evidently.pipeline.column_mapping import ColumnMapping
class TestUtils(unittest.TestCase):
def test_process_columns(self):
dataset = pandas.DataFrame.from_dict([
dict(datetime=datetime.da... | true | true |
f716469fc9aafa94a0b15694c9c6e42ee3698e48 | 1,311 | py | Python | tests/components/yeelight/test_binary_sensor.py | tbarbette/core | 8e58c3aa7bc8d2c2b09b6bd329daa1c092d52d3c | [
"Apache-2.0"
] | 11 | 2018-02-16T15:35:47.000Z | 2020-01-14T15:20:00.000Z | tests/components/yeelight/test_binary_sensor.py | jagadeeshvenkatesh/core | 1bd982668449815fee2105478569f8e4b5670add | [
"Apache-2.0"
] | 79 | 2020-07-23T07:13:37.000Z | 2022-03-22T06:02:37.000Z | tests/components/yeelight/test_binary_sensor.py | jagadeeshvenkatesh/core | 1bd982668449815fee2105478569f8e4b5670add | [
"Apache-2.0"
] | 14 | 2018-08-19T16:28:26.000Z | 2021-09-02T18:26:53.000Z | """Test the Yeelight binary sensor."""
from unittest.mock import patch
from homeassistant.components.yeelight import DOMAIN
from homeassistant.core import HomeAssistant
from homeassistant.helpers import entity_component
from homeassistant.setup import async_setup_component
from . import MODULE, NAME, PROPERTIES, YAML... | 35.432432 | 74 | 0.764302 | from unittest.mock import patch
from homeassistant.components.yeelight import DOMAIN
from homeassistant.core import HomeAssistant
from homeassistant.helpers import entity_component
from homeassistant.setup import async_setup_component
from . import MODULE, NAME, PROPERTIES, YAML_CONFIGURATION, _mocked_bulb
ENTITY_BI... | true | true |
f7164704b1c192777023ed6248ee9dad022d4284 | 26,727 | py | Python | project4/util.py | Plastix/CSC-320 | 4c8802d0ceeffbea77bd1ef5f21d27d4de80dbb6 | [
"MIT"
] | null | null | null | project4/util.py | Plastix/CSC-320 | 4c8802d0ceeffbea77bd1ef5f21d27d4de80dbb6 | [
"MIT"
] | null | null | null | project4/util.py | Plastix/CSC-320 | 4c8802d0ceeffbea77bd1ef5f21d27d4de80dbb6 | [
"MIT"
] | null | null | null | # util.py
# -------
# Licensing Information: You are free to use or extend these projects for
# educational purposes provided that (1) you do not distribute or publish
# solutions, (2) you retain this notice, and (3) you provide clear
# attribution to UC Berkeley, including a link to http://ai.berkeley.edu.
#
# Attri... | 38.5671 | 111 | 0.596176 |
import heapq
import random
import sys
import types
import inspect
class FixedRandom:
def __init__(self):
fixedState = (3, (2147483648, 507801126, 683453281, 310439348, 2597246090, \
2209084787, 2267831527, 979920060, 3098657677, 37650879, 807947081, 3974896263, \
... | true | true |
f716476a8f9925dfffc1e7bbbe2678c6a6fa7d50 | 11,978 | py | Python | tools/accuracy_checker/accuracy_checker/metrics/coco_orig_metrics.py | apankratovantonp/open_model_zoo | e372d4173e50741a6828cda415d55c37320f89cd | [
"Apache-2.0"
] | 5 | 2020-03-09T07:39:04.000Z | 2021-08-16T07:17:28.000Z | tools/accuracy_checker/accuracy_checker/metrics/coco_orig_metrics.py | ananda89/open_model_zoo | e372d4173e50741a6828cda415d55c37320f89cd | [
"Apache-2.0"
] | 6 | 2020-09-26T01:24:39.000Z | 2022-02-10T02:16:03.000Z | tools/accuracy_checker/accuracy_checker/metrics/coco_orig_metrics.py | ananda89/open_model_zoo | e372d4173e50741a6828cda415d55c37320f89cd | [
"Apache-2.0"
] | 3 | 2020-07-06T08:45:26.000Z | 2020-11-12T10:14:45.000Z | """
Copyright (c) 2019 Intel Corporation
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,... | 38.514469 | 120 | 0.671648 |
import os
import tempfile
import json
from ..representation import (
DetectionPrediction,
DetectionAnnotation,
CoCoInstanceSegmentationAnnotation,
CoCocInstanceSegmentationPrediction,
PoseEstimationAnnotation,
PoseEstimationPrediction
)
from ..logging import print_info
from ..config import Bas... | true | true |
f71647c44c7230a055bc69532f2238510db71164 | 6,897 | py | Python | torch_geometric/nn/conv/han_conv.py | itamblyn/pytorch_geometric | 67ed16492863378b8434b03713a75924f0cc5df1 | [
"MIT"
] | 2 | 2020-08-06T16:14:15.000Z | 2021-11-08T07:33:21.000Z | torch_geometric/nn/conv/han_conv.py | itamblyn/pytorch_geometric | 67ed16492863378b8434b03713a75924f0cc5df1 | [
"MIT"
] | 1 | 2021-06-05T10:32:22.000Z | 2021-06-05T10:32:22.000Z | torch_geometric/nn/conv/han_conv.py | itamblyn/pytorch_geometric | 67ed16492863378b8434b03713a75924f0cc5df1 | [
"MIT"
] | null | null | null | from typing import Union, Dict, Optional, List
import torch
from torch import Tensor, nn
import torch.nn.functional as F
from torch_geometric.typing import NodeType, EdgeType, Metadata, Adj
from torch_geometric.nn.dense import Linear
from torch_geometric.utils import softmax
from torch_geometric.nn.conv impo... | 39.637931 | 80 | 0.591562 | from typing import Union, Dict, Optional, List
import torch
from torch import Tensor, nn
import torch.nn.functional as F
from torch_geometric.typing import NodeType, EdgeType, Metadata, Adj
from torch_geometric.nn.dense import Linear
from torch_geometric.utils import softmax
from torch_geometric.nn.conv impo... | true | true |
f716483a992293a75bd70369f62a18d9e69ac6ee | 522 | py | Python | ex0076.py | GantzLorran/Python | ce6073754318443345973471589cceb4a24ed832 | [
"Apache-2.0"
] | 1 | 2020-03-26T13:23:17.000Z | 2020-03-26T13:23:17.000Z | ex0076.py | GantzLorran/Python | ce6073754318443345973471589cceb4a24ed832 | [
"Apache-2.0"
] | null | null | null | ex0076.py | GantzLorran/Python | ce6073754318443345973471589cceb4a24ed832 | [
"Apache-2.0"
] | null | null | null | '''Crie um programa que tenha uma tupla única com nomes de produtos e seus respectivos preços na sequência.
No final, mostre uma listagem de preços, organizando os dados de forma tabular.'''
produtos = ('Lápis', 0.50, 'Suco', 5.00, 'Playstation', 1500.00, 'TV-led', 1200.00, 'Xbox ONE', 1400.00, 'Forza Horizon 4', 200... | 58 | 193 | 0.666667 | produtos = ('Lápis', 0.50, 'Suco', 5.00, 'Playstation', 1500.00, 'TV-led', 1200.00, 'Xbox ONE', 1400.00, 'Forza Horizon 4', 200.00, 'The Last Of Us Part II', 250.00, 'Forza Horizon 3', 150.00)
print('====' * 10)
print('LOJAS RODRIGUES')
for c in range(0,( len(produtos)), 2):
print(produtos[c],f'R$: {produtos[c+... | true | true |
f71648cbb0f2b7ac15a1c95480a65cfcdb389ca6 | 237 | py | Python | kapre/__init__.py | postpop/kapre | 9cf7c3214aae87082f786b7b2d6e5aee64ce6d8f | [
"MIT"
] | 1 | 2019-04-07T00:19:19.000Z | 2019-04-07T00:19:19.000Z | kapre/__init__.py | postpop/kapre | 9cf7c3214aae87082f786b7b2d6e5aee64ce6d8f | [
"MIT"
] | null | null | null | kapre/__init__.py | postpop/kapre | 9cf7c3214aae87082f786b7b2d6e5aee64ce6d8f | [
"MIT"
] | null | null | null | from __future__ import absolute_import
__version__ = '0.1.4'
VERSION = __version__
from . import time_frequency
from . import backend
from . import backend_keras
from . import augmentation
from . import filterbank
from . import utils
| 18.230769 | 38 | 0.793249 | from __future__ import absolute_import
__version__ = '0.1.4'
VERSION = __version__
from . import time_frequency
from . import backend
from . import backend_keras
from . import augmentation
from . import filterbank
from . import utils
| true | true |
f71648e767d8118878ec23a67b998d4c9d7a819c | 1,105 | py | Python | app.py | CA-CODE-Works/cert-issuer-dev | 51f01d8b8e51f046898592c8e6afcfa9d942c08b | [
"MIT"
] | null | null | null | app.py | CA-CODE-Works/cert-issuer-dev | 51f01d8b8e51f046898592c8e6afcfa9d942c08b | [
"MIT"
] | null | null | null | app.py | CA-CODE-Works/cert-issuer-dev | 51f01d8b8e51f046898592c8e6afcfa9d942c08b | [
"MIT"
] | null | null | null | #!/usr/bin/python3
import json
from flask import Flask, jsonify, request, abort
from subprocess import call
#import cert_issuer.config
#from cert_issuer.blockchain_handlers import bitcoin
#import cert_issuer.issue_certificates
app = Flask(__name__)
config = None
# def get_config():
# global config
# if config ... | 26.309524 | 97 | 0.714027 |
import json
from flask import Flask, jsonify, request, abort
from subprocess import call
app = Flask(__name__)
config = None
@app.route('/')
def hello_world():
call(["/bin/bash", "test.sh"])
return ""
@app.route('/wallet')
def wallet():
call(["/bin/bash", "wallet.sh"])
return ""
... | true | true |
f71649ac4568e4c1a38f99c707fd42b1af856b73 | 1,511 | py | Python | src/tests/dataclass_bakery/generators/test_random_int_generator.py | miguelFLG13/dataclass-bakery | 413b5b88ced200e4208e9a25edf520bfc7c31ca5 | [
"Apache-2.0"
] | 1 | 2021-10-10T04:52:31.000Z | 2021-10-10T04:52:31.000Z | src/tests/dataclass_bakery/generators/test_random_int_generator.py | miguelFLG13/dataclass-bakery | 413b5b88ced200e4208e9a25edf520bfc7c31ca5 | [
"Apache-2.0"
] | null | null | null | src/tests/dataclass_bakery/generators/test_random_int_generator.py | miguelFLG13/dataclass-bakery | 413b5b88ced200e4208e9a25edf520bfc7c31ca5 | [
"Apache-2.0"
] | 2 | 2021-06-05T18:41:50.000Z | 2022-03-28T02:05:11.000Z | from unittest import TestCase
from dataclass_bakery.generators import defaults
from dataclass_bakery.generators.random_int_generator import RandomIntGenerator
class TestRandomIntGenerator(TestCase):
def setUp(self):
self.random_int_generator = RandomIntGenerator()
def test_generate_int_ok(self):
... | 37.775 | 88 | 0.734613 | from unittest import TestCase
from dataclass_bakery.generators import defaults
from dataclass_bakery.generators.random_int_generator import RandomIntGenerator
class TestRandomIntGenerator(TestCase):
def setUp(self):
self.random_int_generator = RandomIntGenerator()
def test_generate_int_ok(self):
... | true | true |
f7164a2fdb4f8686098822d51365dede98c4aa16 | 2,547 | py | Python | cli/polyaxon/schemas/polyflow/container/__init__.py | hackerwins/polyaxon | ff56a098283ca872abfbaae6ba8abba479ffa394 | [
"Apache-2.0"
] | null | null | null | cli/polyaxon/schemas/polyflow/container/__init__.py | hackerwins/polyaxon | ff56a098283ca872abfbaae6ba8abba479ffa394 | [
"Apache-2.0"
] | null | null | null | cli/polyaxon/schemas/polyflow/container/__init__.py | hackerwins/polyaxon | ff56a098283ca872abfbaae6ba8abba479ffa394 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python
#
# Copyright 2019 Polyaxon, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... | 33.077922 | 84 | 0.712603 |
from __future__ import absolute_import, division, print_function
from hestia.list_utils import to_list
from hestia.string_utils import strip_spaces
from marshmallow import ValidationError, fields, validates_schema
from polyaxon.schemas.base import BaseConfig, BaseSchema
from polyaxon.schemas.fields i... | true | true |
f7164a91212b4b092d71dea1f6b264a0d0d7d96d | 4,288 | py | Python | neutron/tests/unit/plugins/ml2/drivers/openvswitch/agent/openflow/native/test_ofswitch.py | banhr/neutron | 4b3e73648327ce9f4d3437986a8663372f577f1b | [
"Apache-2.0"
] | 1 | 2018-10-19T01:48:37.000Z | 2018-10-19T01:48:37.000Z | neutron/tests/unit/plugins/ml2/drivers/openvswitch/agent/openflow/native/test_ofswitch.py | weiqiLee/neutron | ddc72ebd41a0e7804b33a21583d3add008191229 | [
"Apache-2.0"
] | null | null | null | neutron/tests/unit/plugins/ml2/drivers/openvswitch/agent/openflow/native/test_ofswitch.py | weiqiLee/neutron | ddc72ebd41a0e7804b33a21583d3add008191229 | [
"Apache-2.0"
] | 1 | 2018-08-28T17:13:16.000Z | 2018-08-28T17:13:16.000Z | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# d... | 40.074766 | 78 | 0.660448 |
import mock
from ryu.ofproto import ofproto_v1_3
from ryu.ofproto import ofproto_v1_3_parser
from neutron.plugins.ml2.drivers.openvswitch.agent.openflow.native \
import ofswitch
from neutron.tests import base
class FakeReply(object):
def __init__(self, type):
self.type = type
class Test... | true | true |
f7164b30ca62a217c7eede4b93e61cd343280927 | 25,782 | py | Python | Orio/orio/main/tuner/skeleton_code.py | HPCL/nametbd | 1b588cd6ce94ab39a8ba6f89d9eb64e1d3726af5 | [
"MIT"
] | null | null | null | Orio/orio/main/tuner/skeleton_code.py | HPCL/nametbd | 1b588cd6ce94ab39a8ba6f89d9eb64e1d3726af5 | [
"MIT"
] | null | null | null | Orio/orio/main/tuner/skeleton_code.py | HPCL/nametbd | 1b588cd6ce94ab39a8ba6f89d9eb64e1d3726af5 | [
"MIT"
] | null | null | null | #
# The skeleton code used for performance testing
#
import re, sys
from orio.main.util.globals import *
#-----------------------------------------------------
SEQ_TIMER = '''
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <math.h>
#include <sys/time.h>
#ifdef BGP_COUNTER
#define SPRN_TBRL 0x10C /... | 33.614081 | 123 | 0.59526 |
import re, sys
from orio.main.util.globals import *
SEQ_TIMER = '''
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <math.h>
#include <sys/time.h>
#ifdef BGP_COUNTER
#define SPRN_TBRL 0x10C // Time Base Read Lower Register (user & sup R/O)
#define SPRN_TBRU 0x10D // Time Base Read Upper Registe... | true | true |
f7164c3b3d1d6ac0d4796def751849537a7f15bf | 2,893 | py | Python | examples/asyncio/wamp/beginner/server.py | luhn/AutobahnPython | 7d519052ab42dc029598ab9e2dbdd7af8e08341f | [
"Apache-2.0"
] | null | null | null | examples/asyncio/wamp/beginner/server.py | luhn/AutobahnPython | 7d519052ab42dc029598ab9e2dbdd7af8e08341f | [
"Apache-2.0"
] | null | null | null | examples/asyncio/wamp/beginner/server.py | luhn/AutobahnPython | 7d519052ab42dc029598ab9e2dbdd7af8e08341f | [
"Apache-2.0"
] | null | null | null | ###############################################################################
##
## Copyright (C) 2014 Tavendo GmbH
##
## 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:/... | 31.107527 | 79 | 0.620809 | true | true | |
f7164e06d9beb5789eb0b2833a37640e21b54097 | 1,057 | py | Python | unit_tests/host/checks/test_securetty.py | ChrisMacNaughton/charms.hardening | 0d98669d4be0a50c2027b0479217c288a61048dd | [
"Apache-2.0"
] | 1 | 2016-05-27T14:49:14.000Z | 2016-05-27T14:49:14.000Z | unit_tests/host/checks/test_securetty.py | ChrisMacNaughton/charms.hardening | 0d98669d4be0a50c2027b0479217c288a61048dd | [
"Apache-2.0"
] | null | null | null | unit_tests/host/checks/test_securetty.py | ChrisMacNaughton/charms.hardening | 0d98669d4be0a50c2027b0479217c288a61048dd | [
"Apache-2.0"
] | null | null | null | # Copyright 2016 Canonical Limited.
#
# This file is part of charm-helpers.
#
# charm-helpers is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License version 3 as
# published by the Free Software Foundation.
#
# charm-helpers is distributed in the hope that ... | 35.233333 | 74 | 0.747398 |
from unittest import TestCase
from charms_hardening.host.checks import securetty
class SecureTTYTestCase(TestCase):
def test_securetty(self):
audits = securetty.get_audits()
self.assertEqual(1, len(audits))
audit = audits[0]
self.assertTrue(isinstance(audit, secur... | true | true |
f7164e23a262378cdac37fd86983d9cf906e662f | 914 | py | Python | python/Validate-Binary-Search-Tree/recursion.py | yutong-xie/Leetcode-with-python | 6578f288a757bf76213030b73ec3319a7baa2661 | [
"MIT"
] | null | null | null | python/Validate-Binary-Search-Tree/recursion.py | yutong-xie/Leetcode-with-python | 6578f288a757bf76213030b73ec3319a7baa2661 | [
"MIT"
] | null | null | null | python/Validate-Binary-Search-Tree/recursion.py | yutong-xie/Leetcode-with-python | 6578f288a757bf76213030b73ec3319a7baa2661 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
'''
Copyright 2020, Yutong Xie, UIUC.
Using recursion to validate BST
'''
# Definition for a binary tree node.
# class TreeNode(object):
# def __init__(self, val=0, left=None, right=None):
# self.val = val
# self.left = left
# self.rig... | 24.052632 | 70 | 0.507659 |
class Solution(object):
def isValidBST(self, root):
def helper(node, lower = float('-inf'), upper = float('inf')):
if not node:
return True
val = node.val
if val <= lower or val >= upper:
return False
if not helper(n... | true | true |
f7164ea55e84788c9420c4d16ae5720e198d41c9 | 540 | py | Python | hackerearth/Algorithms/XOR subsequences/test.py | ATrain951/01.python-com_Qproject | c164dd093954d006538020bdf2e59e716b24d67c | [
"MIT"
] | 4 | 2020-07-24T01:59:50.000Z | 2021-07-24T15:14:08.000Z | hackerearth/Algorithms/XOR subsequences/test.py | ATrain951/01.python-com_Qproject | c164dd093954d006538020bdf2e59e716b24d67c | [
"MIT"
] | null | null | null | hackerearth/Algorithms/XOR subsequences/test.py | ATrain951/01.python-com_Qproject | c164dd093954d006538020bdf2e59e716b24d67c | [
"MIT"
] | null | null | null | import io
import unittest
from contextlib import redirect_stdout
from unittest.mock import patch
class TestQ(unittest.TestCase):
@patch('builtins.input', side_effect=[
'1',
'5',
'3 2 3 1 2',
])
def test_case_0(self, input_mock=None):
text_trap = io.StringIO()
with r... | 22.5 | 46 | 0.568519 | import io
import unittest
from contextlib import redirect_stdout
from unittest.mock import patch
class TestQ(unittest.TestCase):
@patch('builtins.input', side_effect=[
'1',
'5',
'3 2 3 1 2',
])
def test_case_0(self, input_mock=None):
text_trap = io.StringIO()
with r... | true | true |
f7164fa5560ca4b44abd3c1dee0041be6cea10e5 | 1,682 | py | Python | venv/Lib/site-packages/plotnine/scales/scale_stroke.py | EkremBayar/bayar | aad1a32044da671d0b4f11908416044753360b39 | [
"MIT"
] | null | null | null | venv/Lib/site-packages/plotnine/scales/scale_stroke.py | EkremBayar/bayar | aad1a32044da671d0b4f11908416044753360b39 | [
"MIT"
] | 1 | 2020-10-02T21:43:06.000Z | 2020-10-15T22:52:39.000Z | venv/Lib/site-packages/plotnine/scales/scale_stroke.py | EkremBayar/bayar | aad1a32044da671d0b4f11908416044753360b39 | [
"MIT"
] | null | null | null | from warnings import warn
import numpy as np
from mizani.palettes import rescale_pal
from ..doctools import document
from ..exceptions import PlotnineWarning
from ..utils import alias
from .scale import scale_discrete, scale_continuous
@document
class scale_stroke_continuous(scale_continuous):
"""
Continuou... | 23.041096 | 66 | 0.639715 | from warnings import warn
import numpy as np
from mizani.palettes import rescale_pal
from ..doctools import document
from ..exceptions import PlotnineWarning
from ..utils import alias
from .scale import scale_discrete, scale_continuous
@document
class scale_stroke_continuous(scale_continuous):
_aesthetics = ['s... | true | true |
f7164ff9b4c3431a3e2f15fb85cf546bac7adf85 | 154 | py | Python | bot.py | radimbig/Rouneford | 9803ffdbc406d122a02db00d7dd73e70c7c1b4aa | [
"MIT"
] | 10 | 2019-02-21T20:02:18.000Z | 2022-03-21T13:45:59.000Z | bot.py | radimbig/Rouneford | 9803ffdbc406d122a02db00d7dd73e70c7c1b4aa | [
"MIT"
] | null | null | null | bot.py | radimbig/Rouneford | 9803ffdbc406d122a02db00d7dd73e70c7c1b4aa | [
"MIT"
] | 4 | 2021-04-05T14:55:15.000Z | 2022-03-21T12:54:57.000Z | # | Created by Ar4ikov
# | Время: 04.02.2019 - 20:19
from core.core import RounefordBot
bot = RounefordBot(access_token="Ваш-Access-Token")
bot.run()
| 15.4 | 51 | 0.714286 |
from core.core import RounefordBot
bot = RounefordBot(access_token="Ваш-Access-Token")
bot.run()
| true | true |
f716502c208f4354a8f11badd10567d680d691b0 | 1,626 | py | Python | populate_projects.py | anibalsolon/brainhack-donostia.github.io | ad4f30f938923af7ff85fed542972f94f2032d13 | [
"MIT"
] | null | null | null | populate_projects.py | anibalsolon/brainhack-donostia.github.io | ad4f30f938923af7ff85fed542972f94f2032d13 | [
"MIT"
] | 4 | 2020-10-08T13:55:23.000Z | 2020-10-28T13:03:49.000Z | populate_projects.py | anibalsolon/brainhack-donostia.github.io | ad4f30f938923af7ff85fed542972f94f2032d13 | [
"MIT"
] | 9 | 2020-10-08T14:02:55.000Z | 2021-12-02T19:00:36.000Z | import os
import pandas as pd
from string import Template
import wget
csv_file_path = "https://docs.google.com/spreadsheets/d/1AlflVlTg1KmajQrWBOUBT2XeoAUqfjB9SCQfDIPvSXo/export?format=csv&gid=565678921"
project_card_path = "assets/templates/project_card.html"
projects_page_path = "assets/templates/template_projects.m... | 29.563636 | 133 | 0.652522 | import os
import pandas as pd
from string import Template
import wget
csv_file_path = "https://docs.google.com/spreadsheets/d/1AlflVlTg1KmajQrWBOUBT2XeoAUqfjB9SCQfDIPvSXo/export?format=csv&gid=565678921"
project_card_path = "assets/templates/project_card.html"
projects_page_path = "assets/templates/template_projects.m... | true | true |
f7165078f05b4c42f6ab63c51dd0975bdc58bb20 | 1,905 | py | Python | tests/test_allocator.py | genged/serverallocator | 39c58ab96d451fc237e055d7b9c6a446d0074877 | [
"Apache-2.0"
] | null | null | null | tests/test_allocator.py | genged/serverallocator | 39c58ab96d451fc237e055d7b9c6a446d0074877 | [
"Apache-2.0"
] | null | null | null | tests/test_allocator.py | genged/serverallocator | 39c58ab96d451fc237e055d7b9c6a446d0074877 | [
"Apache-2.0"
] | 1 | 2019-06-26T13:50:04.000Z | 2019-06-26T13:50:04.000Z | from allocation.allocator import Server, App, Allocator
s1 = Server(32, 16, 1000, name="s1")
s2 = Server(32, 16, 1000, name="s2")
def test_allocate_tasks_servers_single_server_task():
_a = App(12, 12, 500)
alloc = Allocator([s1], [_a])
res = alloc.allocate()
expected = [
{
"node"... | 23.8125 | 117 | 0.549606 | from allocation.allocator import Server, App, Allocator
s1 = Server(32, 16, 1000, name="s1")
s2 = Server(32, 16, 1000, name="s2")
def test_allocate_tasks_servers_single_server_task():
_a = App(12, 12, 500)
alloc = Allocator([s1], [_a])
res = alloc.allocate()
expected = [
{
"node"... | true | true |
f71650e79d12d7042562e07291e570fa83922710 | 2,081 | py | Python | heart_app/views.py | kylepgr/heart-disease-pred | d128cc815dde4839ba18e887113bb47387499ce1 | [
"MIT"
] | null | null | null | heart_app/views.py | kylepgr/heart-disease-pred | d128cc815dde4839ba18e887113bb47387499ce1 | [
"MIT"
] | null | null | null | heart_app/views.py | kylepgr/heart-disease-pred | d128cc815dde4839ba18e887113bb47387499ce1 | [
"MIT"
] | null | null | null | from typing_extensions import SupportsIndex
from django.shortcuts import render
# Create your views here.
from django.http import HttpResponse
from .forms import InputForm
import pandas as pd
import numpy as np
import pickle
from pymongo import MongoClient
client = MongoClient('localhost', 27017)
db = cli... | 28.902778 | 92 | 0.600192 | from typing_extensions import SupportsIndex
from django.shortcuts import render
from django.http import HttpResponse
from .forms import InputForm
import pandas as pd
import numpy as np
import pickle
from pymongo import MongoClient
client = MongoClient('localhost', 27017)
db = client['PatientDB']
load... | true | true |
f71652cd4034f334dbe9ad941342313344d3ebb5 | 338 | py | Python | src/logger.py | matthiasBT/task_queue | a117c28da0c0150d6f9d8e3e56222e39e9020294 | [
"MIT"
] | null | null | null | src/logger.py | matthiasBT/task_queue | a117c28da0c0150d6f9d8e3e56222e39e9020294 | [
"MIT"
] | null | null | null | src/logger.py | matthiasBT/task_queue | a117c28da0c0150d6f9d8e3e56222e39e9020294 | [
"MIT"
] | null | null | null | import logging
FORMATTER = logging.Formatter('%(asctime)-15s %(name)-12s: %(levelname)-8s %(message)s')
def get_logger(logger_name):
logger = logging.getLogger(logger_name)
handler = logging.StreamHandler()
handler.setFormatter(FORMATTER)
logger.addHandler(handler)
logger.setLevel(logging.DEBUG)
... | 26 | 88 | 0.730769 | import logging
FORMATTER = logging.Formatter('%(asctime)-15s %(name)-12s: %(levelname)-8s %(message)s')
def get_logger(logger_name):
logger = logging.getLogger(logger_name)
handler = logging.StreamHandler()
handler.setFormatter(FORMATTER)
logger.addHandler(handler)
logger.setLevel(logging.DEBUG)
... | true | true |
f7165385a558d6bcdd2f949ec3ae80308ee14e61 | 1,382 | py | Python | app/schemas/users_schema.py | nubilfi/fastapi-starter-kit | 99a326099c3446584dd0ef18b123c42ba360d364 | [
"MIT"
] | null | null | null | app/schemas/users_schema.py | nubilfi/fastapi-starter-kit | 99a326099c3446584dd0ef18b123c42ba360d364 | [
"MIT"
] | 1 | 2021-03-17T08:24:12.000Z | 2021-03-17T08:24:12.000Z | app/schemas/users_schema.py | nubilfi/fastapi-starter-kit | 99a326099c3446584dd0ef18b123c42ba360d364 | [
"MIT"
] | null | null | null | """
It is a Pydantic model for Users
"""
from typing import Optional
from pydantic import BaseModel, EmailStr
class UsersBase(BaseModel):
"""
A schema class used to represent Users table column values
"""
Username: Optional[str] = None
Fullname: Optional[str] = None
Email: Optional[EmailStr] =... | 20.028986 | 64 | 0.62301 | from typing import Optional
from pydantic import BaseModel, EmailStr
class UsersBase(BaseModel):
Username: Optional[str] = None
Fullname: Optional[str] = None
Email: Optional[EmailStr] = None
Status: bool = None
class Config:
orm_mode = True
class UsersCreate(UsersBase):
Username: s... | true | true |
f71654c0cce099e4833874597c1371fa21b320d7 | 4,188 | py | Python | kubernetes_asyncio/client/api/apiregistration_api.py | dineshsonachalam/kubernetes_asyncio | d57e9e9be11f6789e1ce8d5b161acb64d29acf35 | [
"Apache-2.0"
] | 1 | 2021-02-25T04:36:18.000Z | 2021-02-25T04:36:18.000Z | kubernetes_asyncio/client/api/apiregistration_api.py | hubo1016/kubernetes_asyncio | d57e9e9be11f6789e1ce8d5b161acb64d29acf35 | [
"Apache-2.0"
] | null | null | null | kubernetes_asyncio/client/api/apiregistration_api.py | hubo1016/kubernetes_asyncio | d57e9e9be11f6789e1ce8d5b161acb64d29acf35 | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
"""
Kubernetes
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501
OpenAPI spec version: v1.12.4
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from __future__ import absolute_import
import r... | 33.238095 | 119 | 0.620105 |
from __future__ import absolute_import
import re
import six
from kubernetes_asyncio.client.api_client import ApiClient
class ApiregistrationApi(object):
def __init__(self, api_client=None):
if api_client is None:
api_client = ApiClient()
self.api_client = api_client
def... | true | true |
f7165577ff3dd7cd5788b42cf832946dcd47c7cc | 512 | py | Python | mainapp/migrations/0056_auto_20180819_1420.py | reyasmohammed/rescuekerala | 68ee6cd4ea7b94e04fd32c4d488bcd7a8f2d371c | [
"MIT"
] | 1 | 2021-12-09T17:59:01.000Z | 2021-12-09T17:59:01.000Z | mainapp/migrations/0056_auto_20180819_1420.py | reyasmohammed/rescuekerala | 68ee6cd4ea7b94e04fd32c4d488bcd7a8f2d371c | [
"MIT"
] | 1 | 2018-08-18T12:00:29.000Z | 2018-08-18T12:00:29.000Z | mainapp/migrations/0056_auto_20180819_1420.py | reyasmohammed/rescuekerala | 68ee6cd4ea7b94e04fd32c4d488bcd7a8f2d371c | [
"MIT"
] | 5 | 2019-11-07T11:34:56.000Z | 2019-11-07T11:36:00.000Z | # Generated by Django 2.1 on 2018-08-19 08:50
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('mainapp', '0055_rescuecamp_facilities_available'),
]
operations = [
migrations.AlterField(
model_name='rescuecamp',
na... | 26.947368 | 147 | 0.646484 |
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('mainapp', '0055_rescuecamp_facilities_available'),
]
operations = [
migrations.AlterField(
model_name='rescuecamp',
name='facilities_available',
field=... | true | true |
f71655cb97a9c639ac16beca73e658af16c9bb94 | 1,003 | py | Python | __init__.py | Pratik2587/Medical-Cost-Predictor- | 69e23300e24edd121c6c26e1f3ba71adf8c779ad | [
"MIT"
] | 1 | 2020-07-17T23:16:21.000Z | 2020-07-17T23:16:21.000Z | __init__.py | Pratik2587/Medical-Cost-Predictor- | 69e23300e24edd121c6c26e1f3ba71adf8c779ad | [
"MIT"
] | null | null | null | __init__.py | Pratik2587/Medical-Cost-Predictor- | 69e23300e24edd121c6c26e1f3ba71adf8c779ad | [
"MIT"
] | null | null | null | # init.py
from flask import Flask
from flask_sqlalchemy import SQLAlchemy
from flask_login import LoginManager
# init SQLAlchemy so we can use it later in our models
db = SQLAlchemy()
def create_app():
app = Flask(__name__)
app.config['SECRET_KEY'] = '9OLWxND4o83j4K4iuopO'
app.config['SQLALCHEMY_DATABA... | 27.108108 | 103 | 0.724826 |
from flask import Flask
from flask_sqlalchemy import SQLAlchemy
from flask_login import LoginManager
db = SQLAlchemy()
def create_app():
app = Flask(__name__)
app.config['SECRET_KEY'] = '9OLWxND4o83j4K4iuopO'
app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:///db.sqlite'
db.init_app(app)
log... | true | true |
f71655d23318261e91879bbd7165b323acf8dd52 | 51,690 | py | Python | src/scseirx/model_SEIRX.py | JanaLasser/agent_based_COVID_SEIRX | c4e28d472a0484fe1a125ba6974683973141c09e | [
"MIT"
] | 7 | 2020-11-16T12:34:18.000Z | 2022-01-28T15:09:09.000Z | src/scseirx/model_SEIRX.py | JanaLasser/agent_based_COVID_SEIRX | c4e28d472a0484fe1a125ba6974683973141c09e | [
"MIT"
] | 62 | 2020-11-23T07:51:44.000Z | 2022-03-18T12:56:37.000Z | src/scseirx/model_SEIRX.py | JanaLasser/agent_based_COVID_SEIRX | c4e28d472a0484fe1a125ba6974683973141c09e | [
"MIT"
] | 8 | 2020-11-30T09:45:55.000Z | 2022-03-18T11:20:23.000Z | import numpy as np
import networkx as nx
from math import gamma
from scipy.optimize import root_scalar
from mesa import Model
from mesa.time import RandomActivation, SimultaneousActivation
from mesa.datacollection import DataCollector
from scseirx.testing_strategy import Testing
## data collection functions ##
def g... | 44.869792 | 98 | 0.634862 | import numpy as np
import networkx as nx
from math import gamma
from scipy.optimize import root_scalar
from mesa import Model
from mesa.time import RandomActivation, SimultaneousActivation
from mesa.datacollection import DataCollector
from scseirx.testing_strategy import Testing
):
return model.number_of_diagnos... | true | true |
f7165682eb5afce41035f2bdfef80e240f373985 | 4,901 | py | Python | configs/gdrn/lmoPbrSO/resnest50d_online_AugCosyAAEGray_mlBCE_DoubleMask_lmo_pbr_100e_bop_test/resnest50d_online_AugCosyAAEGray_mlBCE_DoubleMask_lmo_pbr_100e_driller_bop_test.py | THU-DA-6D-Pose-Group/self6dpp | c267cfa55e440e212136a5e9940598720fa21d16 | [
"Apache-2.0"
] | 33 | 2021-12-15T07:11:47.000Z | 2022-03-29T08:58:32.000Z | configs/gdrn/lmoPbrSO/resnest50d_online_AugCosyAAEGray_mlBCE_DoubleMask_lmo_pbr_100e_bop_test/resnest50d_online_AugCosyAAEGray_mlBCE_DoubleMask_lmo_pbr_100e_driller_bop_test.py | THU-DA-6D-Pose-Group/self6dpp | c267cfa55e440e212136a5e9940598720fa21d16 | [
"Apache-2.0"
] | 3 | 2021-12-15T11:39:54.000Z | 2022-03-29T07:24:23.000Z | configs/gdrn/lmoPbrSO/resnest50d_online_AugCosyAAEGray_mlBCE_DoubleMask_lmo_pbr_100e_bop_test/resnest50d_online_AugCosyAAEGray_mlBCE_DoubleMask_lmo_pbr_100e_driller_bop_test.py | THU-DA-6D-Pose-Group/self6dpp | c267cfa55e440e212136a5e9940598720fa21d16 | [
"Apache-2.0"
] | null | null | null | _base_ = ["../../../_base_/gdrn_base.py"]
OUTPUT_DIR = "output/gdrn/lmoPbrSO/resnest50d_online_AugCosyAAEGray_mlBCE_DoubleMask_lmo_pbr_100e/driller"
INPUT = dict(
DZI_PAD_SCALE=1.5,
TRUNCATE_FG=False,
CHANGE_BG_PROB=0.5,
COLOR_AUG_PROB=0.8,
COLOR_AUG_TYPE="code",
COLOR_AUG_CODE=(
"Seque... | 35.773723 | 125 | 0.556417 | _base_ = ["../../../_base_/gdrn_base.py"]
OUTPUT_DIR = "output/gdrn/lmoPbrSO/resnest50d_online_AugCosyAAEGray_mlBCE_DoubleMask_lmo_pbr_100e/driller"
INPUT = dict(
DZI_PAD_SCALE=1.5,
TRUNCATE_FG=False,
CHANGE_BG_PROB=0.5,
COLOR_AUG_PROB=0.8,
COLOR_AUG_TYPE="code",
COLOR_AUG_CODE=(
"Seque... | true | true |
f71656b1d13b7744997e72f449279218a8aca12b | 2,466 | py | Python | L1Trigger/L1CaloTrigger/python/Phase1L1TJets_sincosLUT_cff.py | Purva-Chaudhari/cmssw | 32e5cbfe54c4d809d60022586cf200b7c3020bcf | [
"Apache-2.0"
] | 852 | 2015-01-11T21:03:51.000Z | 2022-03-25T21:14:00.000Z | L1Trigger/L1CaloTrigger/python/Phase1L1TJets_sincosLUT_cff.py | Purva-Chaudhari/cmssw | 32e5cbfe54c4d809d60022586cf200b7c3020bcf | [
"Apache-2.0"
] | 30,371 | 2015-01-02T00:14:40.000Z | 2022-03-31T23:26:05.000Z | L1Trigger/L1CaloTrigger/python/Phase1L1TJets_sincosLUT_cff.py | Purva-Chaudhari/cmssw | 32e5cbfe54c4d809d60022586cf200b7c3020bcf | [
"Apache-2.0"
] | 3,240 | 2015-01-02T05:53:18.000Z | 2022-03-31T17:24:21.000Z | import FWCore.ParameterSet.Config as cms
sinPhi = cms.vdouble(
-0.0353352962792, -0.122533930843, -0.208795013406, -0.293458528818, -0.375876685504, -0.455418871948, -0.531476481737, -0.603467570232, -0.670841307236, -0.733082191603, -0.789713995522, -0.840303408309, -0.884463351833, -0.921855942186, -0.952195074957... | 411 | 1,208 | 0.786294 | import FWCore.ParameterSet.Config as cms
sinPhi = cms.vdouble(
-0.0353352962792, -0.122533930843, -0.208795013406, -0.293458528818, -0.375876685504, -0.455418871948, -0.531476481737, -0.603467570232, -0.670841307236, -0.733082191603, -0.789713995522, -0.840303408309, -0.884463351833, -0.921855942186, -0.952195074957... | true | true |
f71658adc475a0a5c279f34a5b5c93dc79f0e389 | 4,279 | py | Python | examples/models/file/calendars.py | g-parki/bokeh | 664ead5306bba64609e734d4105c8aa8cfb76d81 | [
"BSD-3-Clause"
] | 1 | 2020-05-26T15:21:22.000Z | 2020-05-26T15:21:22.000Z | examples/models/file/calendars.py | g-parki/bokeh | 664ead5306bba64609e734d4105c8aa8cfb76d81 | [
"BSD-3-Clause"
] | 1 | 2021-12-15T17:32:31.000Z | 2021-12-21T18:11:05.000Z | examples/models/file/calendars.py | g-parki/bokeh | 664ead5306bba64609e734d4105c8aa8cfb76d81 | [
"BSD-3-Clause"
] | 1 | 2021-12-20T05:50:00.000Z | 2021-12-20T05:50:00.000Z | ''' A rendering of the 2014 monthly calendar.
This example demonstrates the usage of plotting several
plots together using ``gridplot``.
A hover tooltip displays the US holidays on the significant dates.
.. bokeh-example-metadata::
:sampledata: us_holidays
:apis: bokeh.layouts.gridplot, bokeh.models.tools.Ho... | 39.256881 | 187 | 0.694087 | from calendar import Calendar, day_abbr as day_abbrs, month_name as month_names
from bokeh.document import Document
from bokeh.embed import file_html
from bokeh.layouts import gridplot
from bokeh.models import (CategoricalAxis, CategoricalScale, ColumnDataSource,
FactorRange, HoverTool, Plot,... | true | true |
f7165983d502ba88a113831abb4c27b5654b1d3e | 34,532 | py | Python | release/stubs.min/System/ComponentModel/__init___parts/MaskedTextProvider.py | YKato521/ironpython-stubs | b1f7c580de48528490b3ee5791b04898be95a9ae | [
"MIT"
] | null | null | null | release/stubs.min/System/ComponentModel/__init___parts/MaskedTextProvider.py | YKato521/ironpython-stubs | b1f7c580de48528490b3ee5791b04898be95a9ae | [
"MIT"
] | null | null | null | release/stubs.min/System/ComponentModel/__init___parts/MaskedTextProvider.py | YKato521/ironpython-stubs | b1f7c580de48528490b3ee5791b04898be95a9ae | [
"MIT"
] | null | null | null | class MaskedTextProvider(object, ICloneable):
"""
Represents a mask-parsing service that can be used by any number of controls that support masking,such as the System.Windows.Forms.MaskedTextBox control.
MaskedTextProvider(mask: str)
MaskedTextProvider(mask: str,restrictToAscii: bool)
MaskedText... | 26.894081 | 221 | 0.707923 | class MaskedTextProvider(object, ICloneable):
def Add(self, input, testPosition=None, resultHint=None):
pass
def Clear(self, resultHint=None):
pass
def Clone(self):
pass
def FindAssignedEditPositionFrom(self, position, direction):
pass
def FindAssig... | true | true |
f7165ac139d7e4ef2705bd723ef20fccdeaff95e | 39,822 | py | Python | task4_crnn.py | sankar-mukherjee/DCASE-2018---Task-4- | f8034641efef6e60ea721abc5569d9c1aa8ee56d | [
"Apache-2.0"
] | null | null | null | task4_crnn.py | sankar-mukherjee/DCASE-2018---Task-4- | f8034641efef6e60ea721abc5569d9c1aa8ee56d | [
"Apache-2.0"
] | null | null | null | task4_crnn.py | sankar-mukherjee/DCASE-2018---Task-4- | f8034641efef6e60ea721abc5569d9c1aa8ee56d | [
"Apache-2.0"
] | null | null | null | # !/usr/bin/env python
# -*- coding: utf-8 -*-
#########################################################################
# This code is an adaptation from Toni Heittola's code [task1 baseline dcase 2018](https://github.com/DCASE-REPO/dcase2018_baseline/tree/master/task1/)
# Copyright Nicolas Turpault, Romain Serizel, H... | 42.681672 | 151 | 0.540405 |
data_path=param.get_path('path.dataset'),
audio_paths=[
os.path.join("dataset", "audio", "train", "weak"),
os.path.join("dataset", "audio", "train", "unlabel_in_domain"),
... | true | true |
f7165bea9e7574fc50217998b978a4d5e0e583bd | 29,649 | py | Python | tests/contrib/hooks/test_spark_submit_hook.py | robobario/airflow | 702005fe35dc5b996a5c5b8d349ed36036472f00 | [
"Apache-2.0"
] | null | null | null | tests/contrib/hooks/test_spark_submit_hook.py | robobario/airflow | 702005fe35dc5b996a5c5b8d349ed36036472f00 | [
"Apache-2.0"
] | 3 | 2021-03-10T02:58:18.000Z | 2021-09-29T17:34:48.000Z | tests/contrib/hooks/test_spark_submit_hook.py | robobario/airflow | 702005fe35dc5b996a5c5b8d349ed36036472f00 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
#... | 42.235043 | 90 | 0.588013 |
import io
import unittest
from unittest.mock import call, patch
from airflow import AirflowException
from airflow.contrib.hooks.spark_submit_hook import SparkSubmitHook
from airflow.models import Connection
from airflow.utils import db
class TestSparkSubmitHook(unittest.TestCase):
_spark_job_... | true | true |
f7165cf1f7fa7343d3026963a9b227304d4ef57f | 2,956 | py | Python | account_keeping/forms.py | bitlabstudio/django-account-keeping | 9f579a5fd912442a2948e2da858a5720de072568 | [
"MIT"
] | 14 | 2017-03-29T03:14:16.000Z | 2022-03-28T14:11:58.000Z | account_keeping/forms.py | bitlabstudio/django-account-keeping | 9f579a5fd912442a2948e2da858a5720de072568 | [
"MIT"
] | 1 | 2016-11-08T08:35:49.000Z | 2016-11-08T08:35:49.000Z | account_keeping/forms.py | bitmazk/django-account-keeping | 9f579a5fd912442a2948e2da858a5720de072568 | [
"MIT"
] | 4 | 2017-09-06T00:16:53.000Z | 2018-11-25T21:58:39.000Z | """Forms of the account_keeping app."""
from django import forms
from django.core.urlresolvers import reverse
from django.utils.translation import ugettext_lazy as _
from . import models
class InvoiceForm(forms.ModelForm):
class Meta:
model = models.Invoice
fields = '__all__'
try:
... | 33.977011 | 79 | 0.589648 | from django import forms
from django.core.urlresolvers import reverse
from django.utils.translation import ugettext_lazy as _
from . import models
class InvoiceForm(forms.ModelForm):
class Meta:
model = models.Invoice
fields = '__all__'
try:
widgets = {
'invoic... | true | true |
f7165ee6a7c8a5acb376a2fe2456d8037e0db352 | 11,305 | py | Python | Autocoders/Python/src/fprime_ac/parsers/XmlPortsParser.py | LeStarch/lgtm-fprime | 904b0311fe647745b29075d44259d1dc1f4284ae | [
"Apache-2.0"
] | null | null | null | Autocoders/Python/src/fprime_ac/parsers/XmlPortsParser.py | LeStarch/lgtm-fprime | 904b0311fe647745b29075d44259d1dc1f4284ae | [
"Apache-2.0"
] | null | null | null | Autocoders/Python/src/fprime_ac/parsers/XmlPortsParser.py | LeStarch/lgtm-fprime | 904b0311fe647745b29075d44259d1dc1f4284ae | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
# ===============================================================================
# NAME: XmlPortsParser.py
#
# DESCRIPTION: This class parses the XML port types files.
#
# USAGE:
#
# AUTHOR: reder
# EMAIL: reder@jpl.nasa.gov
# DATE CREATED : Feb. 4, 2013
#
# Copyright 2007, California Institu... | 33.545994 | 85 | 0.508271 |
import logging
import os
import sys
from lxml import etree
from fprime_ac.utils import ConfigManager
from fprime_ac.utils.exceptions import FprimeRngXmlValidationException
PRINT = logging.getLogger("output")
DEBUG = logging.getLogger("debug")
ROOTDIR = os.path.join(os.path.dirname(__file__... | true | true |
f7165f0360ddc3c4689659445e5f15cdeeb70bab | 3,059 | py | Python | dockerdb/mongo_pytest.py | includeamin/dockerdb | cb9aca0ae6be1112b04ef9d843751c355005b47d | [
"Apache-2.0"
] | null | null | null | dockerdb/mongo_pytest.py | includeamin/dockerdb | cb9aca0ae6be1112b04ef9d843751c355005b47d | [
"Apache-2.0"
] | null | null | null | dockerdb/mongo_pytest.py | includeamin/dockerdb | cb9aca0ae6be1112b04ef9d843751c355005b47d | [
"Apache-2.0"
] | null | null | null | from __future__ import absolute_import
import os
import shutil
import subprocess
import logging
import pytest
import dockerdb.mongo
CONTAINER_CACHE = {}
LOG = logging.getLogger(__name__)
def insert_data(client, data):
for db in data:
for collection in data[db]:
entries = data[db][collectio... | 28.324074 | 76 | 0.601831 | from __future__ import absolute_import
import os
import shutil
import subprocess
import logging
import pytest
import dockerdb.mongo
CONTAINER_CACHE = {}
LOG = logging.getLogger(__name__)
def insert_data(client, data):
for db in data:
for collection in data[db]:
entries = data[db][collectio... | true | true |
f7166010add7d50b95bbe3bc7c86172c2b3ad3fa | 876 | py | Python | tests/test_instruments_request.py | rockscie/async_blp | acb8777ccf2499681bde87d76ca780b61219699c | [
"MIT"
] | 12 | 2019-08-05T16:56:54.000Z | 2021-02-02T11:09:37.000Z | tests/test_instruments_request.py | lightning-like/async_blp | acb8777ccf2499681bde87d76ca780b61219699c | [
"MIT"
] | null | null | null | tests/test_instruments_request.py | lightning-like/async_blp | acb8777ccf2499681bde87d76ca780b61219699c | [
"MIT"
] | 5 | 2019-12-08T15:43:13.000Z | 2021-11-14T08:38:07.000Z | import pandas as pd
import pytest
from async_blp.instruments_requests import InstrumentRequestBase
@pytest.mark.asyncio
class TestInstrumentRequestBase:
def test__weight(self):
request = InstrumentRequestBase('query', max_results=5)
request.response_fields = ['field_1', 'field_2']
asser... | 30.206897 | 73 | 0.682648 | import pandas as pd
import pytest
from async_blp.instruments_requests import InstrumentRequestBase
@pytest.mark.asyncio
class TestInstrumentRequestBase:
def test__weight(self):
request = InstrumentRequestBase('query', max_results=5)
request.response_fields = ['field_1', 'field_2']
asser... | true | true |
f71662f015d69cc4a3e8904bd18134ab9e12e9e2 | 1,649 | py | Python | test/mitmproxy/addons/test_clientplayback.py | nikofil/mitmproxy | 439c113989feb193972b83ffcd0823ea4d2218df | [
"MIT"
] | null | null | null | test/mitmproxy/addons/test_clientplayback.py | nikofil/mitmproxy | 439c113989feb193972b83ffcd0823ea4d2218df | [
"MIT"
] | null | null | null | test/mitmproxy/addons/test_clientplayback.py | nikofil/mitmproxy | 439c113989feb193972b83ffcd0823ea4d2218df | [
"MIT"
] | null | null | null | import pytest
from unittest import mock
from mitmproxy.test import tflow
from mitmproxy import io
from mitmproxy import exceptions
from mitmproxy.addons import clientplayback
from mitmproxy.test import taddons
def tdump(path, flows):
w = io.FlowWriter(open(path, "wb"))
for i in flows:
w.add(i)
cla... | 28.929825 | 75 | 0.596725 | import pytest
from unittest import mock
from mitmproxy.test import tflow
from mitmproxy import io
from mitmproxy import exceptions
from mitmproxy.addons import clientplayback
from mitmproxy.test import taddons
def tdump(path, flows):
w = io.FlowWriter(open(path, "wb"))
for i in flows:
w.add(i)
cla... | true | true |
f71664184c07162070c1ae4bdafc1b009fa3b980 | 5,121 | py | Python | run_quickquasars.py | olegs22/Quickquasar_QA | df74994780216846501710b79b4dce7d025809c9 | [
"MIT"
] | null | null | null | run_quickquasars.py | olegs22/Quickquasar_QA | df74994780216846501710b79b4dce7d025809c9 | [
"MIT"
] | null | null | null | run_quickquasars.py | olegs22/Quickquasar_QA | df74994780216846501710b79b4dce7d025809c9 | [
"MIT"
] | null | null | null | import numpy as np
import os
import shutil
import glob as glob
def get_slurm_script(script_name,command,outdir,idir,mail,log,part,nodes,threads,time,job_name):
if os.path.isdir(outdir+'/run') == False:
os.mkdir(outdir+'/run')
file_name = outdir + '/run/' + script_name
f = open(file_name,'w')
... | 48.311321 | 151 | 0.610623 | import numpy as np
import os
import shutil
import glob as glob
def get_slurm_script(script_name,command,outdir,idir,mail,log,part,nodes,threads,time,job_name):
if os.path.isdir(outdir+'/run') == False:
os.mkdir(outdir+'/run')
file_name = outdir + '/run/' + script_name
f = open(file_name,'w')
... | true | true |
f716651b671438a36da3dbcc61e463c30cf5bc75 | 432 | py | Python | client.py | colinhartigan/valorant-web-auth-server | 6a12c41ef42d234afbbd6870925c29207428c8ce | [
"MIT"
] | 1 | 2022-01-27T07:49:59.000Z | 2022-01-27T07:49:59.000Z | client.py | colinhartigan/valorant-web-auth-server | 6a12c41ef42d234afbbd6870925c29207428c8ce | [
"MIT"
] | null | null | null | client.py | colinhartigan/valorant-web-auth-server | 6a12c41ef42d234afbbd6870925c29207428c8ce | [
"MIT"
] | null | null | null | from valclient import Client
def join_party(username,password,region,party_id):
client = Client(region=region,auth={'username':username,'password':password})
client.activate()
return client.party_join(party_id)
def request_party(username,password,region,party_id):
client = Client(region=region,aut... | 39.272727 | 81 | 0.752315 | from valclient import Client
def join_party(username,password,region,party_id):
client = Client(region=region,auth={'username':username,'password':password})
client.activate()
return client.party_join(party_id)
def request_party(username,password,region,party_id):
client = Client(region=region,aut... | true | true |
f71665745e05e263180049a3a63e0c9795c76a64 | 1,867 | py | Python | google/ads/google_ads/v5/services/campaign_experiment_service_client_config.py | arammaliachi/google-ads-python | a4fe89567bd43eb784410523a6306b5d1dd9ee67 | [
"Apache-2.0"
] | 1 | 2021-04-09T04:28:47.000Z | 2021-04-09T04:28:47.000Z | google/ads/google_ads/v5/services/campaign_experiment_service_client_config.py | arammaliachi/google-ads-python | a4fe89567bd43eb784410523a6306b5d1dd9ee67 | [
"Apache-2.0"
] | null | null | null | google/ads/google_ads/v5/services/campaign_experiment_service_client_config.py | arammaliachi/google-ads-python | a4fe89567bd43eb784410523a6306b5d1dd9ee67 | [
"Apache-2.0"
] | null | null | null | config = {
"interfaces": {
"google.ads.googleads.v5.services.CampaignExperimentService": {
"retry_codes": {
"idempotent": [
"DEADLINE_EXCEEDED",
"UNAVAILABLE"
],
"non_idempotent": []
},
"retry_params": {
"default": {
"initial_retry_de... | 30.112903 | 67 | 0.551687 | config = {
"interfaces": {
"google.ads.googleads.v5.services.CampaignExperimentService": {
"retry_codes": {
"idempotent": [
"DEADLINE_EXCEEDED",
"UNAVAILABLE"
],
"non_idempotent": []
},
"retry_params": {
"default": {
"initial_retry_de... | true | true |
f71665d4d7a7d68df501099943ae56592dc092fb | 278 | py | Python | data_etl/__main__.py | VBamgbaye/M_Challenge | 310f9b8ee3b6c9534a6dfd3f4ca0c8b56f889fdb | [
"MIT"
] | null | null | null | data_etl/__main__.py | VBamgbaye/M_Challenge | 310f9b8ee3b6c9534a6dfd3f4ca0c8b56f889fdb | [
"MIT"
] | null | null | null | data_etl/__main__.py | VBamgbaye/M_Challenge | 310f9b8ee3b6c9534a6dfd3f4ca0c8b56f889fdb | [
"MIT"
] | null | null | null | from .stage_data import StageData
print('please input the following information:)')
password = (input('Database password: '))
host = (input('Host: '))
upload_data = StageData(password, host)
data = upload_data.save_to_database()
print(f"Data extracted, processed and staged!")
| 30.888889 | 49 | 0.755396 | from .stage_data import StageData
print('please input the following information:)')
password = (input('Database password: '))
host = (input('Host: '))
upload_data = StageData(password, host)
data = upload_data.save_to_database()
print(f"Data extracted, processed and staged!")
| true | true |
f7166751991c71ec27687881d5732fe52e4a624f | 1,379 | py | Python | light_famd/mca.py | marlon27/Light_FAMD | fe4328f15f6145798869908fa126eabe75e85391 | [
"BSD-2-Clause"
] | 11 | 2019-11-13T21:46:32.000Z | 2021-08-02T13:41:31.000Z | light_famd/mca.py | marlon27/Light_FAMD | fe4328f15f6145798869908fa126eabe75e85391 | [
"BSD-2-Clause"
] | 5 | 2019-11-28T10:07:04.000Z | 2021-03-11T17:21:43.000Z | light_famd/mca.py | marlon27/Light_FAMD | fe4328f15f6145798869908fa126eabe75e85391 | [
"BSD-2-Clause"
] | 2 | 2021-01-29T02:57:26.000Z | 2021-06-03T14:20:26.000Z | """Multiple Correspondence Analysis (MCA)"""
import numpy as np
from sklearn import utils
from . import ca
from . import one_hot
class MCA(ca.CA):
def fit(self, X, y=None):
if self.check_input:
utils.check_array(X, dtype=[str, np.number])
n_initial_columns = X.shape[1]... | 28.729167 | 127 | 0.625091 |
import numpy as np
from sklearn import utils
from . import ca
from . import one_hot
class MCA(ca.CA):
def fit(self, X, y=None):
if self.check_input:
utils.check_array(X, dtype=[str, np.number])
n_initial_columns = X.shape[1]
self.one_hot_ = one_hot.On... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.