hexsha stringlengths 40 40 | size int64 2 1.02M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 245 | max_stars_repo_name stringlengths 6 130 | max_stars_repo_head_hexsha stringlengths 40 40 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 245 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 245 | max_forks_repo_name stringlengths 6 130 | max_forks_repo_head_hexsha stringlengths 40 40 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 2 1.02M | avg_line_length float64 1 958k | max_line_length int64 1 987k | alphanum_fraction float64 0 1 | content_no_comment stringlengths 0 1.01M | is_comment_constant_removed bool 2
classes | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1c3c793af2a546c2660b89498cfa597007dc82f5 | 3,406 | py | Python | portfolio_api/settings.py | rafsaf/rest_api_for_portfolio | 2b07aca65cbe2d81f3f862fd024a2e0c5f20c83f | [
"MIT"
] | null | null | null | portfolio_api/settings.py | rafsaf/rest_api_for_portfolio | 2b07aca65cbe2d81f3f862fd024a2e0c5f20c83f | [
"MIT"
] | null | null | null | portfolio_api/settings.py | rafsaf/rest_api_for_portfolio | 2b07aca65cbe2d81f3f862fd024a2e0c5f20c83f | [
"MIT"
] | null | null | null | """
Django settings for portfolio_api project.
Generated by 'django-admin startproject' using Django 3.1.1.
For more information on this file, see
https://docs.djangoproject.com/en/3.1/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/3.1/ref/settings/
"""
from p... | 25.609023 | 99 | 0.701116 |
from pathlib import Path
BASE_DIR = Path(__file__).resolve().parent.parent
SECRET_KEY = '1+&12121212ttt5SSASda232fd8s8ad7sda8*l_5)mmnz*m7lak_gj345u2svsu+jw)mf)tf^8%oei_o=)8k'
DEBUG = False
ALLOWED_HOSTS = ['rafsaf1.eu.pythonanywhere.com']
# Application definition
INSTALLED_APPS = [
'projects',
'r... | true | true |
1c3c7ae12764bbeb2b2498e4516c89ae1557bf09 | 17,526 | py | Python | sktime/forecasting/base/_fh.py | bilal-196/sktime | 87e92e51f9c4cd399d9438c5c06e1364ec409134 | [
"BSD-3-Clause"
] | null | null | null | sktime/forecasting/base/_fh.py | bilal-196/sktime | 87e92e51f9c4cd399d9438c5c06e1364ec409134 | [
"BSD-3-Clause"
] | null | null | null | sktime/forecasting/base/_fh.py | bilal-196/sktime | 87e92e51f9c4cd399d9438c5c06e1364ec409134 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
# copyright: sktime developers, BSD-3-Clause License (see LICENSE file)
__author__ = ["mloning", "fkiraly"]
__all__ = ["ForecastingHorizon"]
from functools import lru_cache
import numpy as np
import pandas as pd
from sktime.utils.datetime import _coerce_duration_to_int
from sktime.utils.date... | 34.097276 | 87 | 0.618966 |
__author__ = ["mloning", "fkiraly"]
__all__ = ["ForecastingHorizon"]
from functools import lru_cache
import numpy as np
import pandas as pd
from sktime.utils.datetime import _coerce_duration_to_int
from sktime.utils.datetime import _get_freq
from sktime.utils.validation.series import VALID_INDEX_TYPES
RELATIVE_T... | true | true |
1c3c7bb344aae3a98a185fc2c2dd8d5249cc62d9 | 17,483 | py | Python | src/trparser.py | traildb/trck | 64304f00f352fc023ef092c6c5332dfd3963fda7 | [
"MIT"
] | 53 | 2017-03-21T02:59:31.000Z | 2021-07-26T10:05:00.000Z | src/trparser.py | traildb/trck | 64304f00f352fc023ef092c6c5332dfd3963fda7 | [
"MIT"
] | 16 | 2017-04-10T19:29:56.000Z | 2018-06-28T17:07:18.000Z | src/trparser.py | traildb/trck | 64304f00f352fc023ef092c6c5332dfd3963fda7 | [
"MIT"
] | 14 | 2017-03-21T18:03:21.000Z | 2019-02-08T11:51:21.000Z | from __future__ import print_function
import ply.lex as lex
from itertools import groupby
from datetime import datetime
import re
class ParseError(Exception):
def __init__(self, message, **kwargs):
super(Exception, self).__init__(message)
self.info = kwargs
reserved = set(['after', 'receive', 'yi... | 26.773354 | 142 | 0.517531 | from __future__ import print_function
import ply.lex as lex
from itertools import groupby
from datetime import datetime
import re
class ParseError(Exception):
def __init__(self, message, **kwargs):
super(Exception, self).__init__(message)
self.info = kwargs
reserved = set(['after', 'receive', 'yi... | true | true |
1c3c7c14e4175d4c1eea50ac615d458cd27cbcdb | 1,011 | py | Python | loss/distill.py | SinterCVer/pytorch-keypoints-det | 9ec271d37a98740998d4b146634747520a0b9f43 | [
"MIT"
] | 1 | 2021-09-20T07:03:18.000Z | 2021-09-20T07:03:18.000Z | loss/distill.py | sinterwong/pytorch-keypoints-det | 9ec271d37a98740998d4b146634747520a0b9f43 | [
"MIT"
] | null | null | null | loss/distill.py | sinterwong/pytorch-keypoints-det | 9ec271d37a98740998d4b146634747520a0b9f43 | [
"MIT"
] | null | null | null | import torch
import torch.nn as nn
import torch.nn.functional as F
class KLDivLoss():
def __init__(self, alpha, T):
super(KLDivLoss).__init__()
self.alpha = alpha
self.T = T
self.KDLoss = nn.KLDivLoss()
def __call__(self, outputs, t_outputs, labels):
return self.KDLoss... | 36.107143 | 117 | 0.642928 | import torch
import torch.nn as nn
import torch.nn.functional as F
class KLDivLoss():
def __init__(self, alpha, T):
super(KLDivLoss).__init__()
self.alpha = alpha
self.T = T
self.KDLoss = nn.KLDivLoss()
def __call__(self, outputs, t_outputs, labels):
return self.KDLoss... | true | true |
1c3c7c6ddb41c8e4400d1cc180167d9c5a39ff0d | 103,009 | py | Python | google/cloud/dialogflow/cx/v3beta1/dialogflow-cx-v3beta1-py/tests/unit/gapic/dialogflowcx_v3beta1/test_security_settings_service.py | googleapis/googleapis-gen | d84824c78563d59b0e58d5664bfaa430e9ad7e7a | [
"Apache-2.0"
] | 7 | 2021-02-21T10:39:41.000Z | 2021-12-07T07:31:28.000Z | google/cloud/dialogflow/cx/v3beta1/dialogflow-cx-v3beta1-py/tests/unit/gapic/dialogflowcx_v3beta1/test_security_settings_service.py | googleapis/googleapis-gen | d84824c78563d59b0e58d5664bfaa430e9ad7e7a | [
"Apache-2.0"
] | 6 | 2021-02-02T23:46:11.000Z | 2021-11-15T01:46:02.000Z | google/cloud/dialogflow/cx/v3beta1/dialogflow-cx-v3beta1-py/tests/unit/gapic/dialogflowcx_v3beta1/test_security_settings_service.py | googleapis/googleapis-gen | d84824c78563d59b0e58d5664bfaa430e9ad7e7a | [
"Apache-2.0"
] | 4 | 2021-01-28T23:25:45.000Z | 2021-08-30T01:55:16.000Z | # -*- coding: utf-8 -*-
# Copyright 2020 Google LLC
#
# 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... | 41.890606 | 263 | 0.706317 |
import os
import mock
import packaging.version
import grpc
from grpc.experimental import aio
import math
import pytest
from proto.marshal.rules.dates import DurationRule, TimestampRule
from google.api_core import client_options
from google.api_core import exceptions as core_exceptions
from google.api_... | true | true |
1c3c7daceee235a0960c9e3e1d5f8a436e75eeeb | 6,587 | py | Python | release/stubs.min/System/ComponentModel/__init___parts/MemberDescriptor.py | htlcnn/ironpython-stubs | 780d829e2104b2789d5f4d6f32b0ec9f2930ca03 | [
"MIT"
] | 182 | 2017-06-27T02:26:15.000Z | 2022-03-30T18:53:43.000Z | release/stubs.min/System/ComponentModel/__init___parts/MemberDescriptor.py | htlcnn/ironpython-stubs | 780d829e2104b2789d5f4d6f32b0ec9f2930ca03 | [
"MIT"
] | 28 | 2017-06-27T13:38:23.000Z | 2022-03-15T11:19:44.000Z | release/stubs.min/System/ComponentModel/__init___parts/MemberDescriptor.py | htlcnn/ironpython-stubs | 780d829e2104b2789d5f4d6f32b0ec9f2930ca03 | [
"MIT"
] | 67 | 2017-06-28T09:43:59.000Z | 2022-03-20T21:17:10.000Z | class MemberDescriptor(object):
""" Represents a class member,such as a property or event. This is an abstract base class. """
def CreateAttributeCollection(self,*args):
"""
CreateAttributeCollection(self: MemberDescriptor) -> AttributeCollection
Creates a collection of attributes using the array ... | 24.763158 | 126 | 0.705329 | class MemberDescriptor(object):
def CreateAttributeCollection(self,*args):
pass
def Equals(self,obj):
pass
def FillAttributes(self,*args):
pass
def FindMethod(self,*args):
pass
def GetHashCode(self):
pass
def GetInvocationTarget(self,*args):
pass
def GetInvokee(self,*args):
pass
def... | true | true |
1c3c7dc962d6b6cba742e9ed1e8000ba84bde9d9 | 1,357 | py | Python | src/intergalactic/peer/subscriber.py | robmoorman/intergalactic | a4ac6a6def61139435d6694c363896efee9f117c | [
"Apache-2.0"
] | 1 | 2021-02-15T15:22:08.000Z | 2021-02-15T15:22:08.000Z | src/intergalactic/peer/subscriber.py | robmoorman/intergalactic | a4ac6a6def61139435d6694c363896efee9f117c | [
"Apache-2.0"
] | null | null | null | src/intergalactic/peer/subscriber.py | robmoorman/intergalactic | a4ac6a6def61139435d6694c363896efee9f117c | [
"Apache-2.0"
] | null | null | null | # Copyright 2018 Rob Moorman
#
# 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, ... | 28.87234 | 75 | 0.745763 |
import json
import websockets
from intergalactic import settings
from intergalactic.peer.handlers import message_handler
from intergalactic.peer.manager import manager
from intergalactic.types import MessageType
from intergalactic.utils import logging
logger = logging.get_logger(__name__)
async def su... | true | true |
1c3c7dd4209dc5d0e2e30918d7471e401c1e4c48 | 1,005 | py | Python | components/iscesys/DateTimeUtil/test/test_datetimeutil.py | vincentschut/isce2 | 1557a05b7b6a3e65abcfc32f89c982ccc9b65e3c | [
"ECL-2.0",
"Apache-2.0"
] | 1,133 | 2022-01-07T21:24:57.000Z | 2022-01-07T21:33:08.000Z | components/iscesys/DateTimeUtil/test/test_datetimeutil.py | vincentschut/isce2 | 1557a05b7b6a3e65abcfc32f89c982ccc9b65e3c | [
"ECL-2.0",
"Apache-2.0"
] | 276 | 2019-02-10T07:18:28.000Z | 2022-03-31T21:45:55.000Z | components/iscesys/DateTimeUtil/test/test_datetimeutil.py | vincentschut/isce2 | 1557a05b7b6a3e65abcfc32f89c982ccc9b65e3c | [
"ECL-2.0",
"Apache-2.0"
] | 235 | 2019-02-10T05:00:53.000Z | 2022-03-18T07:37:24.000Z | import datetime
import unittest
from iscesys.DateTimeUtil.DateTimeUtil import DateTimeUtil
class DateTimeUtilTest(unittest.TestCase):
def setUp(self):
self.dt1 = datetime.datetime(year=2004,month=3,day=15,hour=12,minute=30,second=0)
self.dt2 = datetime.datetime(year=2004,month=3,day=15,hour=12,min... | 29.558824 | 90 | 0.700498 | import datetime
import unittest
from iscesys.DateTimeUtil.DateTimeUtil import DateTimeUtil
class DateTimeUtilTest(unittest.TestCase):
def setUp(self):
self.dt1 = datetime.datetime(year=2004,month=3,day=15,hour=12,minute=30,second=0)
self.dt2 = datetime.datetime(year=2004,month=3,day=15,hour=12,min... | true | true |
1c3c7e621677eba074969705f82fa8e2ede0d5b9 | 8,757 | py | Python | sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/operations/_load_balancer_frontend_ip_configurations_operations.py | LianwMS/azure-sdk-for-python | 612d7bca9de86ee1bd1fa59291d7bf897ba9213f | [
"MIT"
] | 2 | 2019-05-17T21:24:53.000Z | 2020-02-12T11:13:42.000Z | sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/operations/_load_balancer_frontend_ip_configurations_operations.py | LianwMS/azure-sdk-for-python | 612d7bca9de86ee1bd1fa59291d7bf897ba9213f | [
"MIT"
] | 15 | 2019-07-12T18:18:04.000Z | 2019-07-25T20:55:51.000Z | sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/operations/_load_balancer_frontend_ip_configurations_operations.py | LianwMS/azure-sdk-for-python | 612d7bca9de86ee1bd1fa59291d7bf897ba9213f | [
"MIT"
] | 2 | 2020-05-21T22:51:22.000Z | 2020-05-26T20:53:01.000Z | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... | 48.65 | 228 | 0.676716 |
from typing import TYPE_CHECKING
import warnings
from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error
from azure.core.paging import ItemPaged
from azure.core.pipeline import PipelineResponse
from azure.core.pipeline.transport import HttpRequest, HttpResponse... | true | true |
1c3c7ec61534821e17a751ca0f96fbb881982387 | 631 | py | Python | backend/manage.py | crowdbotics-apps/dookh-28435 | 61989e90fda5d3b05e98748f15d42e7c852d07ba | [
"FTL",
"AML",
"RSA-MD"
] | null | null | null | backend/manage.py | crowdbotics-apps/dookh-28435 | 61989e90fda5d3b05e98748f15d42e7c852d07ba | [
"FTL",
"AML",
"RSA-MD"
] | null | null | null | backend/manage.py | crowdbotics-apps/dookh-28435 | 61989e90fda5d3b05e98748f15d42e7c852d07ba | [
"FTL",
"AML",
"RSA-MD"
] | null | null | null | #!/usr/bin/env python
"""Django's command-line utility for administrative tasks."""
import os
import sys
def main():
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'dookh_28435.settings')
try:
from django.core.management import execute_from_command_line
except ImportError as exc:
raise Im... | 28.681818 | 75 | 0.684628 |
import os
import sys
def main():
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'dookh_28435.settings')
try:
from django.core.management import execute_from_command_line
except ImportError as exc:
raise ImportError(
"Couldn't import Django. Are you sure it's installed and "
... | true | true |
1c3c7f0543309cbb6edf91512c6c20ad1c6ee911 | 11,079 | py | Python | tools/debugging/replay_wal.py | JamieSlome/raiden | ccd11e59c1259fdd661b31df706e511dd6e6bc9f | [
"MIT"
] | null | null | null | tools/debugging/replay_wal.py | JamieSlome/raiden | ccd11e59c1259fdd661b31df706e511dd6e6bc9f | [
"MIT"
] | null | null | null | tools/debugging/replay_wal.py | JamieSlome/raiden | ccd11e59c1259fdd661b31df706e511dd6e6bc9f | [
"MIT"
] | null | null | null | #!/usr/bin/env python
"""
This script is meant to be used as a template to step through a provided DB file
for debugging a specific issue.
It constructs the chain_state through the _state_manager and uses the WAL
to replay all state changes through the state machines until all state changes are consumed.
The parameter... | 36.205882 | 99 | 0.678401 |
import json
import re
from contextlib import closing
from pathlib import Path
from typing import NoReturn, TextIO
import click
from eth_utils import encode_hex, is_address, to_canonical_address, to_checksum_address
from raiden.storage.serialization import JSONSerializer
from raiden.storage.sqlite import (
LOW_S... | true | true |
1c3c7f55377f7b300bbda40d7779e8a3d87fb58e | 199 | py | Python | 32.3/test_testing_fail.py | vinigofr/computer-science-exercises | b60ef1c5e3be09ff4c4241afc4279250c1e7129a | [
"MIT"
] | null | null | null | 32.3/test_testing_fail.py | vinigofr/computer-science-exercises | b60ef1c5e3be09ff4c4241afc4279250c1e7129a | [
"MIT"
] | null | null | null | 32.3/test_testing_fail.py | vinigofr/computer-science-exercises | b60ef1c5e3be09ff4c4241afc4279250c1e7129a | [
"MIT"
] | null | null | null | from testing_fail import divide
import pytest
def test_divide_when_other_number_is_zero_raises_an_exception():
with pytest.raises(ZeroDivisionError, match="division by zero"):
divide(2, 0) | 33.166667 | 68 | 0.80402 | from testing_fail import divide
import pytest
def test_divide_when_other_number_is_zero_raises_an_exception():
with pytest.raises(ZeroDivisionError, match="division by zero"):
divide(2, 0) | true | true |
1c3c7fa160c023eb462f4d6b93557b293d6c71bc | 774 | py | Python | PenBlog/urls.py | quanix/PenBlog | 6d017b847115bba595215d6cfc9a1ca9f84807bb | [
"Apache-2.0"
] | 3 | 2015-01-27T01:05:01.000Z | 2018-09-23T03:05:55.000Z | PenBlog/urls.py | quanix/PenBlog | 6d017b847115bba595215d6cfc9a1ca9f84807bb | [
"Apache-2.0"
] | null | null | null | PenBlog/urls.py | quanix/PenBlog | 6d017b847115bba595215d6cfc9a1ca9f84807bb | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding:utf-8 -*-
from django.conf.urls import patterns, include, url
# from django.contrib import admin
# admin.autodiscover()
from PenBlog import views
urlpatterns = patterns('',
#首页
url(r'^$', views.show_homepage, {'page': 1}),
url( r'^page/(\d+?)/$', views.show_homepage),
... | 25.8 | 65 | 0.603359 |
from django.conf.urls import patterns, include, url
from PenBlog import views
urlpatterns = patterns('',
url(r'^$', views.show_homepage, {'page': 1}),
url( r'^page/(\d+?)/$', views.show_homepage),
url(r'\.(css|js|png|jpg|gif|xml|swf|html)$', views.get_file),
url(r'^install/$', vie... | true | true |
1c3c7fba409c4819576e4f1f3a92ff3597ce9484 | 494 | py | Python | sdk/batch/azure-batch/azure/batch/_version.py | moovy2/azure-sdk-for-python | 6b0495dc9917d47a7264f26cbd3221d43461a537 | [
"MIT"
] | 2,728 | 2015-01-09T10:19:32.000Z | 2022-03-31T14:50:33.000Z | sdk/batch/azure-batch/azure/batch/_version.py | v-xuto/azure-sdk-for-python | 9c6296d22094c5ede410bc83749e8df8694ccacc | [
"MIT"
] | 17,773 | 2015-01-05T15:57:17.000Z | 2022-03-31T23:50:25.000Z | sdk/batch/azure-batch/azure/batch/_version.py | v-xuto/azure-sdk-for-python | 9c6296d22094c5ede410bc83749e8df8694ccacc | [
"MIT"
] | 1,916 | 2015-01-19T05:05:41.000Z | 2022-03-31T19:36:44.000Z | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... | 35.285714 | 76 | 0.520243 |
VERSION = "11.0.1"
| true | true |
1c3c81a1792f488fe2e3c6317ed7f0974f6c7a4b | 3,520 | py | Python | cloudmesh/sys/command/sys.py | cloudmesh/cloudmesh-sys | c65e717caa5533c6eb3bb32cb6e480dc8a004646 | [
"Apache-2.0"
] | null | null | null | cloudmesh/sys/command/sys.py | cloudmesh/cloudmesh-sys | c65e717caa5533c6eb3bb32cb6e480dc8a004646 | [
"Apache-2.0"
] | null | null | null | cloudmesh/sys/command/sys.py | cloudmesh/cloudmesh-sys | c65e717caa5533c6eb3bb32cb6e480dc8a004646 | [
"Apache-2.0"
] | 1 | 2020-03-23T03:03:30.000Z | 2020-03-23T03:03:30.000Z | """
The sys command to manage the cmd5 distribution
"""
from cloudmesh.shell.command import PluginCommand
from cloudmesh.shell.command import command
from cloudmesh.sys.manage import Command, Git, Version
import shutil
import glob
from cloudmesh.common.util import path_expand
import os
class SysCommand(PluginCommand... | 27.5 | 80 | 0.52642 | from cloudmesh.shell.command import PluginCommand
from cloudmesh.shell.command import command
from cloudmesh.sys.manage import Command, Git, Version
import shutil
import glob
from cloudmesh.common.util import path_expand
import os
class SysCommand(PluginCommand):
@command
def do_sys(self, args, argumen... | true | true |
1c3c823675ef391f2f5882e9796ce320b343f4c1 | 1,523 | py | Python | recipe_modules/resultdb/examples/include.py | Acidburn0zzz/luci | d8993f4684839b58f5f966dd6273d1d8fd001eae | [
"Apache-2.0"
] | 1 | 2021-04-24T04:03:01.000Z | 2021-04-24T04:03:01.000Z | recipe_modules/resultdb/examples/include.py | Acidburn0zzz/luci | d8993f4684839b58f5f966dd6273d1d8fd001eae | [
"Apache-2.0"
] | null | null | null | recipe_modules/resultdb/examples/include.py | Acidburn0zzz/luci | d8993f4684839b58f5f966dd6273d1d8fd001eae | [
"Apache-2.0"
] | null | null | null | # Copyright 2020 The LUCI Authors. All rights reserved.
# Use of this source code is governed under the Apache License, Version 2.0
# that can be found in the LICENSE file.
from recipe_engine.post_process import (DropExpectation, StepSuccess,
DoesNotRunRE)
from PB.go.chromium.org.luci.buildbucket.proto import build... | 27.690909 | 82 | 0.693368 |
from recipe_engine.post_process import (DropExpectation, StepSuccess,
DoesNotRunRE)
from PB.go.chromium.org.luci.buildbucket.proto import build as build_pb2
from PB.go.chromium.org.luci.resultdb.proto.v1 import invocation as invocation_pb2
DEPS = [
'buildbucket',
'resultdb',
]
def RunSteps(api):
inv_bun... | true | true |
1c3c828fa327c8f7bb69e82337a322cd7761fe1b | 2,862 | py | Python | djangocms_baseplugins/cms_form_designer/cms_plugins.py | benzkji/djangocms-baseplugins | 7f041a030ed93dcdec70e4ca777b841846b8f2f2 | [
"MIT"
] | 2 | 2019-04-14T01:31:22.000Z | 2020-03-05T13:06:57.000Z | djangocms_baseplugins/cms_form_designer/cms_plugins.py | benzkji/djangocms-baseplugins | 7f041a030ed93dcdec70e4ca777b841846b8f2f2 | [
"MIT"
] | 32 | 2017-04-04T09:28:06.000Z | 2021-08-18T16:23:02.000Z | djangocms_baseplugins/cms_form_designer/cms_plugins.py | bnzk/djangocms-baseplugins | 7f041a030ed93dcdec70e4ca777b841846b8f2f2 | [
"MIT"
] | null | null | null | # coding: utf-8
import uuid
from cms.plugin_base import CMSPluginBase
from cms.plugin_pool import plugin_pool
from django import forms
from django.contrib import admin
from django.utils.text import slugify
from django.utils.translation import ugettext_lazy as _
from djangocms_baseplugins.baseplugin.cms_plugins import ... | 36.692308 | 107 | 0.701607 |
import uuid
from cms.plugin_base import CMSPluginBase
from cms.plugin_pool import plugin_pool
from django import forms
from django.contrib import admin
from django.utils.text import slugify
from django.utils.translation import ugettext_lazy as _
from djangocms_baseplugins.baseplugin.cms_plugins import BasePluginMixin... | true | true |
1c3c83626908ec5b7a167858c74ebdcf9cf8167b | 522 | py | Python | RecoBTag/Skimming/python/btagMC_QCD_380_470OutputModule_cfi.py | ckamtsikis/cmssw | ea19fe642bb7537cbf58451dcf73aa5fd1b66250 | [
"Apache-2.0"
] | 852 | 2015-01-11T21:03:51.000Z | 2022-03-25T21:14:00.000Z | RecoBTag/Skimming/python/btagMC_QCD_380_470OutputModule_cfi.py | ckamtsikis/cmssw | ea19fe642bb7537cbf58451dcf73aa5fd1b66250 | [
"Apache-2.0"
] | 30,371 | 2015-01-02T00:14:40.000Z | 2022-03-31T23:26:05.000Z | RecoBTag/Skimming/python/btagMC_QCD_380_470OutputModule_cfi.py | ckamtsikis/cmssw | ea19fe642bb7537cbf58451dcf73aa5fd1b66250 | [
"Apache-2.0"
] | 3,240 | 2015-01-02T05:53:18.000Z | 2022-03-31T17:24:21.000Z | import FWCore.ParameterSet.Config as cms
from Configuration.EventContent.EventContent_cff import *
from RecoBTag.Skimming.btagMC_QCD_380_470_EventContent_cff import *
btagMC_QCD_380_470OutputModule = cms.OutputModule("PoolOutputModule",
btagMC_QCD_380_470EventSelection,
FEVTSIMEventContent,
dataset = cms.u... | 32.625 | 69 | 0.777778 | import FWCore.ParameterSet.Config as cms
from Configuration.EventContent.EventContent_cff import *
from RecoBTag.Skimming.btagMC_QCD_380_470_EventContent_cff import *
btagMC_QCD_380_470OutputModule = cms.OutputModule("PoolOutputModule",
btagMC_QCD_380_470EventSelection,
FEVTSIMEventContent,
dataset = cms.u... | true | true |
1c3c83caf0e0f96a864074a2ce45955ef49e3112 | 267 | py | Python | Python/100Excersises/76 to 100/85/.history/85_20201119145048.py | magusikrak/NAMI-TERM-I-GroupWork | f0a9a5f219ccbec024eb5316361db3fca46e171c | [
"MIT"
] | null | null | null | Python/100Excersises/76 to 100/85/.history/85_20201119145048.py | magusikrak/NAMI-TERM-I-GroupWork | f0a9a5f219ccbec024eb5316361db3fca46e171c | [
"MIT"
] | 1 | 2021-07-24T03:18:30.000Z | 2021-07-24T12:45:07.000Z | Python/100Excersises/76 to 100/85/.history/85_20201119145048.py | sugamkarki/NAMI-Year-II-TERM-I-Group_Project | f0a9a5f219ccbec024eb5316361db3fca46e171c | [
"MIT"
] | null | null | null | # str="hi i m adon"
#
myFile=open("c.txt","r")
countriesRaw=myFile.read()
countriesNeat=''
countriesRaw= countriesRaw.split(" ")
for country in countriesRaw:
# print(country)
if(len(country)>1):
countriesNeat =countriesNeat+'\n'+country
print | 24.272727 | 49 | 0.666667 |
myFile=open("c.txt","r")
countriesRaw=myFile.read()
countriesNeat=''
countriesRaw= countriesRaw.split(" ")
for country in countriesRaw:
if(len(country)>1):
countriesNeat =countriesNeat+'\n'+country
print | true | true |
1c3c83dfa812ecc2f3f7ce8b8c18dca085ae6f24 | 9,126 | py | Python | tests/test_inverses.py | TannerRogalsky/pennylane-qiskit | 4d1646d17d36cc28bfd61c03d32f130e3e14e278 | [
"Apache-2.0"
] | 75 | 2020-08-07T14:21:15.000Z | 2022-03-23T15:19:28.000Z | tests/test_inverses.py | TannerRogalsky/pennylane-qiskit | 4d1646d17d36cc28bfd61c03d32f130e3e14e278 | [
"Apache-2.0"
] | 110 | 2020-07-28T07:02:17.000Z | 2022-03-28T20:47:27.000Z | tests/test_inverses.py | TannerRogalsky/pennylane-qiskit | 4d1646d17d36cc28bfd61c03d32f130e3e14e278 | [
"Apache-2.0"
] | 23 | 2020-08-06T08:07:18.000Z | 2022-03-03T01:28:26.000Z | import pytest
import pennylane as qml
import math
import cmath
import numpy as np
# defaults
tol = 1e-5
class TestInverses:
"""Tests that the inverse of the operations are applied."""
# This test is ran against the state |0> with one Z expval
@pytest.mark.parametrize(
"name,expected_output",
... | 33.306569 | 101 | 0.483783 | import pytest
import pennylane as qml
import math
import cmath
import numpy as np
tol = 1e-5
class TestInverses:
@pytest.mark.parametrize(
"name,expected_output",
[
("Identity", 1),
("PauliX", -1),
("PauliY", -1),
("PauliZ", 1),
... | true | true |
1c3c83f5e994692e0b4ca45b088cf657453bd348 | 257 | py | Python | admin.py | klml/frieda | 52d4b393108e3ee34f6671689ee565c7876cf93c | [
"MIT"
] | null | null | null | admin.py | klml/frieda | 52d4b393108e3ee34f6671689ee565c7876cf93c | [
"MIT"
] | null | null | null | admin.py | klml/frieda | 52d4b393108e3ee34f6671689ee565c7876cf93c | [
"MIT"
] | null | null | null | from django.contrib import admin
from .models import *
admin.site.register(Organisation)
admin.site.register(Internship)
admin.site.register(SchoolYear)
admin.site.register(InternshipAssignment)
admin.site.register(School)
admin.site.register(Metacontent)
| 25.7 | 41 | 0.836576 | from django.contrib import admin
from .models import *
admin.site.register(Organisation)
admin.site.register(Internship)
admin.site.register(SchoolYear)
admin.site.register(InternshipAssignment)
admin.site.register(School)
admin.site.register(Metacontent)
| true | true |
1c3c84c2bcf237ec22e42098df98128eb44cf3ec | 771 | py | Python | api/urls.py | ebar0n/palermo-coin | 63dc14fce31fbeae50ec7ebf5ea97efbb1ec18fd | [
"MIT"
] | null | null | null | api/urls.py | ebar0n/palermo-coin | 63dc14fce31fbeae50ec7ebf5ea97efbb1ec18fd | [
"MIT"
] | 15 | 2019-05-13T23:40:06.000Z | 2022-03-11T23:39:57.000Z | api/urls.py | ebar0n/leviatan-backend | 63dc14fce31fbeae50ec7ebf5ea97efbb1ec18fd | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import django
from django.conf import settings
from django.conf.urls import include, url
from django.contrib import admin
from django.urls import path, re_path
urlapi = [
path('api/social/', include('social_django.urls')),
path('api/v1/', include('accounts.urls')),
]
urlpatterns = urlap... | 32.125 | 96 | 0.693904 |
import django
from django.conf import settings
from django.conf.urls import include, url
from django.contrib import admin
from django.urls import path, re_path
urlapi = [
path('api/social/', include('social_django.urls')),
path('api/v1/', include('accounts.urls')),
]
urlpatterns = urlapi + [
path('admin/'... | true | true |
1c3c84f01638ab8da76b3c0047c0ecaef5bd4cea | 514 | py | Python | src/dynamic_programming/boj_9095.py | joeyworld/algo | 03e733f8f0dafe8b5cfe85eb9f7d72f370a67c61 | [
"MIT"
] | 1 | 2019-02-11T09:18:14.000Z | 2019-02-11T09:18:14.000Z | src/dynamic_programming/boj_9095.py | gyukebox/algo | 03e733f8f0dafe8b5cfe85eb9f7d72f370a67c61 | [
"MIT"
] | null | null | null | src/dynamic_programming/boj_9095.py | gyukebox/algo | 03e733f8f0dafe8b5cfe85eb9f7d72f370a67c61 | [
"MIT"
] | null | null | null | previous_answers = [None] * 12
previous_answers[0] = 1
previous_answers[1] = 1
previous_answers[2] = 2
def solve(n):
for i in range(3, n + 1):
previous_answers[i] = previous_answers[i - 1] + \
previous_answers[i - 2] + previous_answers[i - 3]
if __name__ == '__main__':
input_case = int(i... | 27.052632 | 61 | 0.655642 | previous_answers = [None] * 12
previous_answers[0] = 1
previous_answers[1] = 1
previous_answers[2] = 2
def solve(n):
for i in range(3, n + 1):
previous_answers[i] = previous_answers[i - 1] + \
previous_answers[i - 2] + previous_answers[i - 3]
if __name__ == '__main__':
input_case = int(i... | true | true |
1c3c8538f6866ad436f11ca1f85faa77a06bcf75 | 3,293 | py | Python | tests/main/helpers/test_framework_helpers.py | uk-gov-mirror/alphagov.digitalmarketplace-buyer-frontend | ec3751b6d24842cc53febb20391ae340c0fea756 | [
"MIT"
] | 4 | 2017-10-12T16:15:01.000Z | 2020-11-28T03:41:15.000Z | tests/main/helpers/test_framework_helpers.py | uk-gov-mirror/alphagov.digitalmarketplace-buyer-frontend | ec3751b6d24842cc53febb20391ae340c0fea756 | [
"MIT"
] | 615 | 2015-02-27T15:45:43.000Z | 2021-07-01T10:09:55.000Z | tests/main/helpers/test_framework_helpers.py | uk-gov-mirror/alphagov.digitalmarketplace-buyer-frontend | ec3751b6d24842cc53febb20391ae340c0fea756 | [
"MIT"
] | 15 | 2015-06-30T14:35:20.000Z | 2021-04-10T18:06:36.000Z | import mock
import pytest
from dmapiclient import HTTPError
from dmtestutils.api_model_stubs import FrameworkStub
from app.main.helpers.framework_helpers import get_framework_or_500, get_latest_live_framework, get_lots_by_slug
from ...helpers import BaseApplicationTest, CustomAbortException
class TestBuildSearchQue... | 43.906667 | 119 | 0.722138 | import mock
import pytest
from dmapiclient import HTTPError
from dmtestutils.api_model_stubs import FrameworkStub
from app.main.helpers.framework_helpers import get_framework_or_500, get_latest_live_framework, get_lots_by_slug
from ...helpers import BaseApplicationTest, CustomAbortException
class TestBuildSearchQue... | true | true |
1c3c86051e26cdba0af4cc1b6ba464e9e0254444 | 21,785 | py | Python | train.py | aki34/learnable-triangulation-pytorch | e2a37b30ff7f0cfff474841f8033d37a9dab9926 | [
"MIT"
] | 1 | 2021-02-01T09:07:10.000Z | 2021-02-01T09:07:10.000Z | train.py | sg47/learnable-triangulation-pytorch | 4ada88f871078c8d27ea92d422d16c7104818169 | [
"MIT"
] | null | null | null | train.py | sg47/learnable-triangulation-pytorch | 4ada88f871078c8d27ea92d422d16c7104818169 | [
"MIT"
] | 1 | 2020-03-18T01:25:00.000Z | 2020-03-18T01:25:00.000Z | import os
import shutil
import argparse
import time
import json
from datetime import datetime
from collections import defaultdict
from itertools import islice
import pickle
import copy
import numpy as np
import cv2
import torch
from torch import nn
from torch import autograd
import torch.nn.functional as F
import tor... | 45.010331 | 218 | 0.626853 | import os
import shutil
import argparse
import time
import json
from datetime import datetime
from collections import defaultdict
from itertools import islice
import pickle
import copy
import numpy as np
import cv2
import torch
from torch import nn
from torch import autograd
import torch.nn.functional as F
import tor... | true | true |
1c3c863f8dbfa12aebedfc5f04b59e1dd98d9fe3 | 1,849 | py | Python | python_tests/test_input.py | cherryc/dynet | 54bf3fa04f55f0730a9a21b5708e94dc153394da | [
"Apache-2.0"
] | 1 | 2021-03-10T17:40:09.000Z | 2021-03-10T17:40:09.000Z | python_tests/test_input.py | cherryc/dynet | 54bf3fa04f55f0730a9a21b5708e94dc153394da | [
"Apache-2.0"
] | null | null | null | python_tests/test_input.py | cherryc/dynet | 54bf3fa04f55f0730a9a21b5708e94dc153394da | [
"Apache-2.0"
] | null | null | null | from __future__ import print_function
import dynet as dy
import numpy as np
input_vals = np.arange(81)
squared_norm = (input_vals**2).sum()
shapes = [(81,), (3, 27), (3, 3, 9), (3, 3, 3, 3)]
for i in range(4):
# Not batched
dy.renew_cg()
input_tensor = input_vals.reshape(shapes[i])
x = dy.inputTensor(i... | 49.972973 | 212 | 0.646836 | from __future__ import print_function
import dynet as dy
import numpy as np
input_vals = np.arange(81)
squared_norm = (input_vals**2).sum()
shapes = [(81,), (3, 27), (3, 3, 9), (3, 3, 3, 3)]
for i in range(4):
dy.renew_cg()
input_tensor = input_vals.reshape(shapes[i])
x = dy.inputTensor(input_tensor)
... | true | true |
1c3c86d0383a877e5a99c2cda9404c7dd72f8140 | 936 | py | Python | setup.py | penafieljlm/PyCVESearch2.7 | 75a9f3f64bd497538363b0079ca8b88d4971bc92 | [
"Apache-2.0"
] | null | null | null | setup.py | penafieljlm/PyCVESearch2.7 | 75a9f3f64bd497538363b0079ca8b88d4971bc92 | [
"Apache-2.0"
] | null | null | null | setup.py | penafieljlm/PyCVESearch2.7 | 75a9f3f64bd497538363b0079ca8b88d4971bc92 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from setuptools import setup
setup(
name='pycvesearch',
version='0.5',
url='https://github.com/cve-search/PyCVESearch',
author='Raphaël Vinot',
author_email='raphael.vinot@circl.lu',
license='Apache v2.0 License',
packages=['pycvesearch'],
... | 30.193548 | 59 | 0.621795 |
from setuptools import setup
setup(
name='pycvesearch',
version='0.5',
url='https://github.com/cve-search/PyCVESearch',
author='Raphaël Vinot',
author_email='raphael.vinot@circl.lu',
license='Apache v2.0 License',
packages=['pycvesearch'],
description='A python wrapper around cve.cir... | true | true |
1c3c86f7601284851cba9d90b8b26aebf236f7f5 | 4,036 | py | Python | flaterra/__init__.py | cleanunicorn/flaterra | 757fdf072cb80dde945eda19b789009b6fedf6e7 | [
"MIT"
] | 15 | 2019-02-11T20:13:49.000Z | 2022-01-10T08:01:53.000Z | flaterra/__init__.py | cleanunicorn/flaterra | 757fdf072cb80dde945eda19b789009b6fedf6e7 | [
"MIT"
] | 2 | 2019-04-08T13:43:53.000Z | 2020-11-11T14:14:48.000Z | flaterra/__init__.py | cleanunicorn/flaterra | 757fdf072cb80dde945eda19b789009b6fedf6e7 | [
"MIT"
] | 2 | 2019-04-08T13:20:05.000Z | 2020-07-22T16:55:54.000Z | import re
import argparse
import logging
import sys
import os
# Save what files were already imported
imported_files = {}
pragma_dict = {}
def flat_file(path, file, level=0):
# Normalize path
file = os.path.realpath("{path}/{file}".format(path=path, file=file))
path = os.path.dirname(file)
# Flatten... | 30.575758 | 106 | 0.595639 | import re
import argparse
import logging
import sys
import os
imported_files = {}
pragma_dict = {}
def flat_file(path, file, level=0):
file = os.path.realpath("{path}/{file}".format(path=path, file=file))
path = os.path.dirname(file)
flat_source = ""
global imported_files
if (fi... | true | true |
1c3c88770fdcab653e777c79aeedf0ce84d5c4a1 | 43,226 | py | Python | orangecontrib/aps/shadow/widgets/_not_used/hybrid_screen_error_analysis.py | oasys-aps-kit/OASYS1-APS-ShadowOui | c8f1f5490baf9903d68c4830a770ed4a455a35b7 | [
"Unlicense"
] | 1 | 2019-08-22T01:04:39.000Z | 2019-08-22T01:04:39.000Z | orangecontrib/aps/shadow/widgets/_not_used/hybrid_screen_error_analysis.py | oasys-aps-kit/OASYS1-APS-Extensions | c8f1f5490baf9903d68c4830a770ed4a455a35b7 | [
"Unlicense"
] | null | null | null | orangecontrib/aps/shadow/widgets/_not_used/hybrid_screen_error_analysis.py | oasys-aps-kit/OASYS1-APS-Extensions | c8f1f5490baf9903d68c4830a770ed4a455a35b7 | [
"Unlicense"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# #########################################################################
# Copyright (c) 2018, UChicago Argonne, LLC. All rights reserved. #
# #
# Copyright 2018. UChicago Argonne, LLC. This ... | 49.628014 | 174 | 0.556933 |
ontal")
self.le_nbins_z = oasysgui.lineEdit(box_2, self, "ghy_nbins_z", "Number of bins for I(Tangential) histogram", labelWidth=260, valueType=int, orientation="horizontal")
self.le_npeak = oasysgui.lineEdit(box_2, self, "ghy_npeak", "Number of diffraction peaks", labelWidth=260, valueType=int, o... | true | true |
1c3c89eef599aed04fda4f871c9ab8f8c5f9eedc | 8,653 | py | Python | privex/db/query/postgres.py | Privex/python-db | 3b46b34b4310973e2e2a30a66adaa853fd10340d | [
"X11"
] | 1 | 2019-12-19T13:12:53.000Z | 2019-12-19T13:12:53.000Z | privex/db/query/postgres.py | Privex/python-db | 3b46b34b4310973e2e2a30a66adaa853fd10340d | [
"X11"
] | 9 | 2020-02-24T20:14:53.000Z | 2021-04-30T21:51:04.000Z | privex/db/query/postgres.py | Privex/python-db | 3b46b34b4310973e2e2a30a66adaa853fd10340d | [
"X11"
] | null | null | null | from typing import Iterable, Union
import psycopg2.extras
import psycopg2.extensions
import logging
from privex.db.base import CursorManager
from privex.db.types import GenericCursor
from privex.db.query.base import BaseQueryBuilder, QueryMode
log = logging.getLogger(__name__)
class PostgresQueryBuilder(BaseQueryBu... | 42.209756 | 117 | 0.602912 | from typing import Iterable, Union
import psycopg2.extras
import psycopg2.extensions
import logging
from privex.db.base import CursorManager
from privex.db.types import GenericCursor
from privex.db.query.base import BaseQueryBuilder, QueryMode
log = logging.getLogger(__name__)
class PostgresQueryBuilder(BaseQueryBu... | true | true |
1c3c8a7b692e56e9ce68e06c8731bc55d8172f00 | 1,565 | py | Python | Beginers/Functions/solution/Functions.py | arunkgupta/PythonTrainingExercises | d260cf71298e34b2a18bd11a76f1764ef28677c7 | [
"BSD-3-Clause"
] | 150 | 2015-11-27T14:19:15.000Z | 2019-11-03T18:34:21.000Z | Beginners/Functions/solution/Functions.py | prmohanty/PythonTrainingExercises | 00a2435649fcf53fdafede2d10b40f08463728fe | [
"BSD-3-Clause"
] | 1 | 2015-12-30T11:41:30.000Z | 2015-12-30T11:41:30.000Z | Beginners/Functions/solution/Functions.py | prmohanty/PythonTrainingExercises | 00a2435649fcf53fdafede2d10b40f08463728fe | [
"BSD-3-Clause"
] | 95 | 2015-12-01T18:44:13.000Z | 2019-10-28T16:25:08.000Z | #!/usr/bin/env python
"""Write an equivalent function to the build in filter() function that takes
a function and a single list and returns a new list of elements where the
function evaluates to true.
Call your function _filter().
For example: _filter(lambda x: x > 0, [1,-2, 3,-4])
(the lambda returns True if x is pos... | 24.453125 | 77 | 0.67476 |
import sys
import pytest
__author__ = 'Paul Ross'
__date__ = '2011-08-03'
__version__ = '0.1.0'
__rights__ = 'Copyright (c) 2011 Paul Ross. Copyright (c) 2015 AHL.'
def _filter(fn, iterable):
if fn is None:
return [v for v in iterable if v]
return [v for v in iterable if fn(v)]
def _map(fn, i... | true | true |
1c3c8acd35a39ee109554ab964e43ce7d532077b | 7,824 | py | Python | siammot/engine/inferencer.py | mondrasovic/siam-mot | f06ce0ba6c80fcfbc3830a38f69c93674d3c74ac | [
"Apache-2.0"
] | null | null | null | siammot/engine/inferencer.py | mondrasovic/siam-mot | f06ce0ba6c80fcfbc3830a38f69c93674d3c74ac | [
"Apache-2.0"
] | null | null | null | siammot/engine/inferencer.py | mondrasovic/siam-mot | f06ce0ba6c80fcfbc3830a38f69c93674d3c74ac | [
"Apache-2.0"
] | null | null | null | import logging
import os
import time
import numpy as np
import torch
from gluoncv.torch.data.gluoncv_motion_dataset.dataset import DataSample
from tqdm import tqdm
from ..data.adapters.augmentation.build_augmentation import \
build_siam_augmentation
from ..data.build_inference_data_loader import build_... | 36.90566 | 81 | 0.595859 | import logging
import os
import time
import numpy as np
import torch
from gluoncv.torch.data.gluoncv_motion_dataset.dataset import DataSample
from tqdm import tqdm
from ..data.adapters.augmentation.build_augmentation import \
build_siam_augmentation
from ..data.build_inference_data_loader import build_... | true | true |
1c3c8ad81850ae5b4a7fa1ea214bcf1635f63d1c | 422 | py | Python | src/homescraper/db.py | asabellico/homescraper | 2c350f359bdd21eaef56fc3809d4373adde1ca2d | [
"MIT"
] | null | null | null | src/homescraper/db.py | asabellico/homescraper | 2c350f359bdd21eaef56fc3809d4373adde1ca2d | [
"MIT"
] | null | null | null | src/homescraper/db.py | asabellico/homescraper | 2c350f359bdd21eaef56fc3809d4373adde1ca2d | [
"MIT"
] | null | null | null | import sqlalchemy
import dataclasses_sql
from homescraper.datatypes import Apartment
class ApartmentDb:
def __init__(self, db_path):
self.engine = sqlalchemy.create_engine(f'sqlite:///{db_path}')
self.metadata = sqlalchemy.MetaData(self.engine)
self.metadata.reflect()
def add_apartmen... | 32.461538 | 82 | 0.741706 | import sqlalchemy
import dataclasses_sql
from homescraper.datatypes import Apartment
class ApartmentDb:
def __init__(self, db_path):
self.engine = sqlalchemy.create_engine(f'sqlite:///{db_path}')
self.metadata = sqlalchemy.MetaData(self.engine)
self.metadata.reflect()
def add_apartmen... | true | true |
1c3c8b6014ce0b4984adf84fafe8468335b88fa8 | 269 | py | Python | jurisdictions/__init__.py | mapto/CashWash | d10281f88ad881a7d01022a66faff09b9fcc49e6 | [
"MIT"
] | 7 | 2019-01-22T11:13:43.000Z | 2019-02-25T13:12:58.000Z | jurisdictions/__init__.py | mapto/CashWash | d10281f88ad881a7d01022a66faff09b9fcc49e6 | [
"MIT"
] | null | null | null | jurisdictions/__init__.py | mapto/CashWash | d10281f88ad881a7d01022a66faff09b9fcc49e6 | [
"MIT"
] | null | null | null | __all__ = ['statements', 'persistence']
from settings import data_path
from settings import debug
from .statements import get_jurisdictions_statement
from .persistence import get_jurisdiction_code, jurisdiction_by_code
from .persistence import cached_jurisdictions
| 24.454545 | 68 | 0.847584 | __all__ = ['statements', 'persistence']
from settings import data_path
from settings import debug
from .statements import get_jurisdictions_statement
from .persistence import get_jurisdiction_code, jurisdiction_by_code
from .persistence import cached_jurisdictions
| true | true |
1c3c8ba12856c5752722acfb7f7f48a3e460dd5a | 561 | py | Python | app/models.py | xamaan585/News-Bulleting | 3ff0ab545a94c6eef8b536342bd47bc37f70e448 | [
"Unlicense"
] | null | null | null | app/models.py | xamaan585/News-Bulleting | 3ff0ab545a94c6eef8b536342bd47bc37f70e448 | [
"Unlicense"
] | null | null | null | app/models.py | xamaan585/News-Bulleting | 3ff0ab545a94c6eef8b536342bd47bc37f70e448 | [
"Unlicense"
] | null | null | null | class Source:
'''
Source class to define source objects
'''
def __init__(self,id,name,url,description):
self.id = id
self.name = name
self.url = url
self.description = description
class Article:
'''
Article class to define article objects
'''
def __init__... | 26.714286 | 71 | 0.614973 | class Source:
def __init__(self,id,name,url,description):
self.id = id
self.name = name
self.url = url
self.description = description
class Article:
def __init__(self,image,title,author,description,publicshedAt,url):
self.image = image
self.title = title
... | true | true |
1c3c8bd10751f52f27ffb09b2e9937aacc9e0a85 | 21,610 | py | Python | scripts/train_s3dis.py | PointCloudYC/PointNet-modern.pytorch | 1a0b373fcb21f24b667a0bb4831211da5b92f98d | [
"Apache-2.0"
] | 2 | 2021-05-20T14:36:23.000Z | 2022-02-01T11:33:56.000Z | scripts/train_s3dis.py | PointCloudYC/PointNet-modern.pytorch | 1a0b373fcb21f24b667a0bb4831211da5b92f98d | [
"Apache-2.0"
] | null | null | null | scripts/train_s3dis.py | PointCloudYC/PointNet-modern.pytorch | 1a0b373fcb21f24b667a0bb4831211da5b92f98d | [
"Apache-2.0"
] | null | null | null | """
Distributed training script for semantic segmentation on S3DIS dataset
"""
import os
import sys
import time
from datetime import datetime
import json
import random
import numpy as np
# pytorch
import torch
import torch.nn as nn
from torchvision import transforms
import torch.distributed as dist
from torch.utils.te... | 44.64876 | 160 | 0.617955 | import os
import sys
import time
from datetime import datetime
import json
import random
import numpy as np
import torch
import torch.nn as nn
from torchvision import transforms
import torch.distributed as dist
from torch.utils.tensorboard import SummaryWriter
from torch.nn.parallel import DistributedDataParallel
BA... | true | true |
1c3c8d34fbb6e1c16f04f4c9f1b01e65a09d95d8 | 53,065 | py | Python | Ansible-AWS-Provisioning/collections/ansible_collections/amazon/aws/plugins/modules/ec2_elb_lb.py | ginigangadharan/ansible-real-life | 897c2fc0d05babbb540768b336b6ad399dad5bfa | [
"MIT"
] | 22 | 2021-07-16T08:11:22.000Z | 2022-03-31T07:15:34.000Z | Ansible-AWS-Provisioning/collections/ansible_collections/amazon/aws/plugins/modules/ec2_elb_lb.py | premsagar0228/ansible-real-life | 1a51193b833ab6ad320100472333b9ffb0da39d4 | [
"MIT"
] | null | null | null | Ansible-AWS-Provisioning/collections/ansible_collections/amazon/aws/plugins/modules/ec2_elb_lb.py | premsagar0228/ansible-real-life | 1a51193b833ab6ad320100472333b9ffb0da39d4 | [
"MIT"
] | 39 | 2021-07-05T02:31:42.000Z | 2022-03-31T02:46:03.000Z | #!/usr/bin/python
# Copyright: Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
DOCUMENTATION = '''
---
module: ec2_elb_lb
version_added: 1.0.0
description:
- Returns in... | 39.65994 | 152 | 0.616678 |
from __future__ import absolute_import, division, print_function
__metaclass__ = type
DOCUMENTATION = '''
---
module: ec2_elb_lb
version_added: 1.0.0
description:
- Returns information about the load balancer.
- Will be marked changed when called only if state is changed.
short_description: Creates, updates o... | true | true |
1c3c8d3daec588738c0d7cd5687b65688f07c05a | 3,306 | py | Python | tensorflow/lite/testing/op_tests/sparse_to_dense.py | EricRemmerswaal/tensorflow | 141ff27877579c81a213fa113bd1b474c1749aca | [
"Apache-2.0"
] | 190,993 | 2015-11-09T13:17:30.000Z | 2022-03-31T23:05:27.000Z | tensorflow/lite/testing/op_tests/sparse_to_dense.py | EricRemmerswaal/tensorflow | 141ff27877579c81a213fa113bd1b474c1749aca | [
"Apache-2.0"
] | 48,461 | 2015-11-09T14:21:11.000Z | 2022-03-31T23:17:33.000Z | tensorflow/lite/testing/op_tests/sparse_to_dense.py | EricRemmerswaal/tensorflow | 141ff27877579c81a213fa113bd1b474c1749aca | [
"Apache-2.0"
] | 104,981 | 2015-11-09T13:40:17.000Z | 2022-03-31T19:51:54.000Z | # Copyright 2019 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 38.894118 | 80 | 0.676346 |
import numpy as np
import tensorflow.compat.v1 as tf
from tensorflow.lite.testing.zip_test_utils import create_scalar_data
from tensorflow.lite.testing.zip_test_utils import create_tensor_data
from tensorflow.lite.testing.zip_test_utils import make_zip_of_tests
from tensorflow.lite.testing.zip_test_utils ... | true | true |
1c3c8d952ab700f4ba2649d2330ad77bae914afb | 280 | py | Python | python-programming/unit34.py | s05252/course-2018-2 | 4695bf1556603fc2549464512afc96765f45132e | [
"Apache-2.0"
] | 1 | 2018-12-13T02:43:25.000Z | 2018-12-13T02:43:25.000Z | python-programming/unit34.py | s05252/course-2018-2 | 4695bf1556603fc2549464512afc96765f45132e | [
"Apache-2.0"
] | null | null | null | python-programming/unit34.py | s05252/course-2018-2 | 4695bf1556603fc2549464512afc96765f45132e | [
"Apache-2.0"
] | null | null | null | import pandas as pd
import numpy as np
alco2009 = pd.read_csv("niaaa-report2009.csv", index_col="State")
alco2009
population = pd.read_csv("population.csv", index_col="State")
population.head()
df = pd.merge(alco2009, population, left_index=True,
right_index=True)
df.head()
| 18.666667 | 65 | 0.757143 | import pandas as pd
import numpy as np
alco2009 = pd.read_csv("niaaa-report2009.csv", index_col="State")
alco2009
population = pd.read_csv("population.csv", index_col="State")
population.head()
df = pd.merge(alco2009, population, left_index=True,
right_index=True)
df.head()
| true | true |
1c3c8fa84a75a5fa6d2a28f5ef2b070cfbacecf2 | 551 | py | Python | redundant100/ncpus.py | luispedro/Coelho2021_GMGCv1_analysis | 5f1a62844631121cc11f8ac5a776d25baca56ff7 | [
"MIT"
] | 6 | 2021-12-16T09:20:28.000Z | 2022-03-29T03:21:48.000Z | redundant100/ncpus.py | luispedro/Coelho2021_GMGCv1_analysis | 5f1a62844631121cc11f8ac5a776d25baca56ff7 | [
"MIT"
] | 1 | 2022-02-18T01:56:56.000Z | 2022-02-22T14:39:48.000Z | redundant100/ncpus.py | luispedro/Coelho2021_GMGCv1_analysis | 5f1a62844631121cc11f8ac5a776d25baca56ff7 | [
"MIT"
] | 8 | 2021-12-17T02:14:50.000Z | 2022-03-21T06:40:59.000Z | def get_ncpus():
from os import environ
for ev in ['OMP_NUM_THREADS', 'Q_CORES', 'Q_CORE']:
if ev in environ:
return int(environ[ev].strip())
for ev in ['LSB_MCPU_HOSTS']:
if ev in environ:
break
else:
return 1
tokens = environ[ev].strip().split()
... | 30.611111 | 101 | 0.588022 | def get_ncpus():
from os import environ
for ev in ['OMP_NUM_THREADS', 'Q_CORES', 'Q_CORE']:
if ev in environ:
return int(environ[ev].strip())
for ev in ['LSB_MCPU_HOSTS']:
if ev in environ:
break
else:
return 1
tokens = environ[ev].strip().split()
... | true | true |
1c3c902c27fd52765d86d6f2fa245ea707da6cba | 1,239 | py | Python | code/server.py | cyberbeast/gRPC-learn | d46f7a8ab917df1d2469945a94f421e7406dd211 | [
"MIT"
] | null | null | null | code/server.py | cyberbeast/gRPC-learn | d46f7a8ab917df1d2469945a94f421e7406dd211 | [
"MIT"
] | null | null | null | code/server.py | cyberbeast/gRPC-learn | d46f7a8ab917df1d2469945a94f421e7406dd211 | [
"MIT"
] | null | null | null | import grpc
from concurrent import futures
import time
# import the generated classes
import calculator_pb2
import calculator_pb2_grpc
# import the original calculator.py
import calculator
# create a class to define the server functions, derived from calculator_pb2_grpc.CalculatorServicer
class CalculatorServicer(ca... | 29.5 | 100 | 0.775626 | import grpc
from concurrent import futures
import time
import calculator_pb2
import calculator_pb2_grpc
import calculator
class CalculatorServicer(calculator_pb2_grpc.CalculatorServicer):
def SquareRoot(self, request, context):
response = calculator_pb2.Number()
response.value ... | true | true |
1c3c9034397d6200c1350af9bdba91cc9ca01849 | 1,382 | py | Python | troposphere/helpers/userdata.py | compose-x/troposphere | 9a94a8fafd8b4da1cd1f4239be0e7aa0681fd8d4 | [
"BSD-2-Clause"
] | 4,573 | 2015-01-02T20:31:04.000Z | 2022-03-31T17:15:32.000Z | troposphere/helpers/userdata.py | compose-x/troposphere | 9a94a8fafd8b4da1cd1f4239be0e7aa0681fd8d4 | [
"BSD-2-Clause"
] | 1,730 | 2015-01-02T19:24:47.000Z | 2022-03-31T23:22:52.000Z | troposphere/helpers/userdata.py | compose-x/troposphere | 9a94a8fafd8b4da1cd1f4239be0e7aa0681fd8d4 | [
"BSD-2-Clause"
] | 1,753 | 2015-01-01T01:24:12.000Z | 2022-03-27T05:36:17.000Z | #!/usr/bin/python
from troposphere import Base64, Join, Sub
def from_file(filepath, delimiter="", blanklines=False):
"""Imports userdata from a file.
:type filepath: string
:param filepath The absolute path to the file.
:type delimiter: string
:param: delimiter Delimiter to use with the tro... | 24.678571 | 100 | 0.628075 |
from troposphere import Base64, Join, Sub
def from_file(filepath, delimiter="", blanklines=False):
data = []
try:
with open(filepath, "r") as f:
for line in f:
if blanklines and line.strip("\n\r ") == "":
continue
data.append(line)
... | true | true |
1c3c90536e7effb422604fe8132e92c579d6b003 | 7,213 | py | Python | avionics/light/light_client.py | leozz37/makani | c94d5c2b600b98002f932e80a313a06b9285cc1b | [
"Apache-2.0"
] | 1,178 | 2020-09-10T17:15:42.000Z | 2022-03-31T14:59:35.000Z | avionics/light/light_client.py | leozz37/makani | c94d5c2b600b98002f932e80a313a06b9285cc1b | [
"Apache-2.0"
] | 1 | 2020-05-22T05:22:35.000Z | 2020-05-22T05:22:35.000Z | avionics/light/light_client.py | leozz37/makani | c94d5c2b600b98002f932e80a313a06b9285cc1b | [
"Apache-2.0"
] | 107 | 2020-09-10T17:29:30.000Z | 2022-03-18T09:00:14.000Z | #!/usr/bin/python
# Copyright 2020 Makani Technologies LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicabl... | 34.347619 | 89 | 0.689866 |
"""Command line client for controlling anti-collision lights."""
import os
import re
import socket
import makani
from makani.avionics.common import aio
from makani.avionics.common import cmd_client
from makani.avionics.common import pack_avionics_messages
from makani.avionics.network import aio_node
fr... | false | true |
1c3c90bd1e2e00a79b73dd931d49e343660c67de | 482 | py | Python | corehq/apps/export/migrations/0004_datafile_delete_after.py | kkrampa/commcare-hq | d64d7cad98b240325ad669ccc7effb07721b4d44 | [
"BSD-3-Clause"
] | 1 | 2020-05-05T13:10:01.000Z | 2020-05-05T13:10:01.000Z | corehq/apps/export/migrations/0004_datafile_delete_after.py | kkrampa/commcare-hq | d64d7cad98b240325ad669ccc7effb07721b4d44 | [
"BSD-3-Clause"
] | 1 | 2019-12-09T14:00:14.000Z | 2019-12-09T14:00:14.000Z | corehq/apps/export/migrations/0004_datafile_delete_after.py | MaciejChoromanski/commcare-hq | fd7f65362d56d73b75a2c20d2afeabbc70876867 | [
"BSD-3-Clause"
] | 5 | 2015-11-30T13:12:45.000Z | 2019-07-01T19:27:07.000Z | # -*- coding: utf-8 -*-
# Generated by Django 1.11.14 on 2018-08-15 19:57
from __future__ import absolute_import, unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('export', '0003_emailexportwhendonerequest'),
]
operations = [
... | 22.952381 | 56 | 0.636929 |
from __future__ import absolute_import, unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('export', '0003_emailexportwhendonerequest'),
]
operations = [
migrations.AddField(
model_name='datafile',
... | true | true |
1c3c90cd1655328d4f508a455455fe9f552e4551 | 2,765 | py | Python | mockutils/fs.py | jhedev/mockutils | 643928ab135be233e1c16f8501d550b966e71089 | [
"MIT"
] | null | null | null | mockutils/fs.py | jhedev/mockutils | 643928ab135be233e1c16f8501d550b966e71089 | [
"MIT"
] | 1 | 2015-01-22T16:43:58.000Z | 2015-01-22T16:43:58.000Z | mockutils/fs.py | jhedev/mockutils | 643928ab135be233e1c16f8501d550b966e71089 | [
"MIT"
] | null | null | null | import os
class VirtualFile(object):
def __init__(self, name, content=None):
self.name = name
self.content = content
def __str__(self):
return self.name
class VirtualDir(object):
def __init__(self, name, content={}):
self.name = name
self.content = content
de... | 24.469027 | 75 | 0.577939 | import os
class VirtualFile(object):
def __init__(self, name, content=None):
self.name = name
self.content = content
def __str__(self):
return self.name
class VirtualDir(object):
def __init__(self, name, content={}):
self.name = name
self.content = content
de... | true | true |
1c3c91793e2535732d729bf77f497a54a5caf490 | 8,665 | py | Python | model/dec_rep.py | chenyangh/DialogueGenerationWithEmotion | 88433fa3ad32da5eab7923aef11fe34105a3e1f9 | [
"MIT"
] | 61 | 2018-02-19T06:21:44.000Z | 2022-02-14T09:17:46.000Z | model/dec_rep.py | chenyangh/DialogueGenerationWithEmotion | 88433fa3ad32da5eab7923aef11fe34105a3e1f9 | [
"MIT"
] | 9 | 2019-03-20T13:23:00.000Z | 2022-01-26T15:19:51.000Z | model/dec_rep.py | chenyangh/DialogueGenerationWithEmotion | 88433fa3ad32da5eab7923aef11fe34105a3e1f9 | [
"MIT"
] | 20 | 2018-04-08T15:37:55.000Z | 2021-11-12T08:13:05.000Z | import torch
import torch.nn as nn
from torch.autograd import Variable
import torch.nn.functional as F
import numpy as np
USE_CUDA = True
NUM_EMO = 9
class SoftDotAttention(nn.Module):
"""Soft Dot Attention.
Ref: http://www.aclweb.org/anthology/D15-1166
Adapted from PyTorch OPEN NMT.
"""
def __ini... | 31.856618 | 79 | 0.586959 | import torch
import torch.nn as nn
from torch.autograd import Variable
import torch.nn.functional as F
import numpy as np
USE_CUDA = True
NUM_EMO = 9
class SoftDotAttention(nn.Module):
def __init__(self, dim):
super(SoftDotAttention, self).__init__()
self.linear_in = nn.Linear(dim, dim, bias=False... | true | true |
1c3c9190e82fbad0ab082a919e7b7efda37b87a8 | 2,442 | py | Python | supervisor/resolution/fixup.py | wschoot/supervisor | 58f803cc9bf27f7f8873cb7667b687b839fd2d2a | [
"Apache-2.0"
] | null | null | null | supervisor/resolution/fixup.py | wschoot/supervisor | 58f803cc9bf27f7f8873cb7667b687b839fd2d2a | [
"Apache-2.0"
] | 200 | 2020-10-13T06:35:51.000Z | 2022-03-31T06:03:35.000Z | supervisor/resolution/fixup.py | sanyatuning/supervisor | 34f64b0ed00ccb4fcd4a60f903f7c8934c553a1c | [
"Apache-2.0"
] | null | null | null | """Helpers to fixup the system."""
import logging
from typing import List
from ..coresys import CoreSys, CoreSysAttributes
from ..jobs.const import JobCondition
from ..jobs.decorator import Job
from .data import Suggestion
from .fixups.base import FixupBase
from .fixups.clear_full_snapshot import FixupClearFullSnapsho... | 35.911765 | 86 | 0.685504 | import logging
from typing import List
from ..coresys import CoreSys, CoreSysAttributes
from ..jobs.const import JobCondition
from ..jobs.decorator import Job
from .data import Suggestion
from .fixups.base import FixupBase
from .fixups.clear_full_snapshot import FixupClearFullSnapshot
from .fixups.create_full_snapshot... | true | true |
1c3c9412efdc3bd4cb9ab2242cb6c81707718094 | 415 | py | Python | backend/long_darkness_29195/wsgi.py | crowdbotics-apps/long-darkness-29195 | 98f34a3ee9a7656f19a26b7c865e5de78839518c | [
"FTL",
"AML",
"RSA-MD"
] | null | null | null | backend/long_darkness_29195/wsgi.py | crowdbotics-apps/long-darkness-29195 | 98f34a3ee9a7656f19a26b7c865e5de78839518c | [
"FTL",
"AML",
"RSA-MD"
] | 49 | 2021-07-26T17:04:51.000Z | 2021-07-26T17:07:44.000Z | backend/long_darkness_29195/wsgi.py | crowdbotics-apps/long-darkness-29195 | 98f34a3ee9a7656f19a26b7c865e5de78839518c | [
"FTL",
"AML",
"RSA-MD"
] | null | null | null | """
WSGI config for long_darkness_29195 project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/2.2/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault('... | 24.411765 | 79 | 0.79759 |
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'long_darkness_29195.settings')
application = get_wsgi_application()
| true | true |
1c3c943c63d83e4a71845752358be989ec75ad82 | 2,513 | py | Python | api/ml/model.py | ghacupha/fastapi-ml-quickstart | 866068eb2b2ea7f08003947e80f57bdacb24db81 | [
"MIT"
] | null | null | null | api/ml/model.py | ghacupha/fastapi-ml-quickstart | 866068eb2b2ea7f08003947e80f57bdacb24db81 | [
"MIT"
] | null | null | null | api/ml/model.py | ghacupha/fastapi-ml-quickstart | 866068eb2b2ea7f08003947e80f57bdacb24db81 | [
"MIT"
] | null | null | null | import joblib
import numpy as np
from pathlib import Path
from sklearn.ensemble import RandomForestRegressor
from sklearn.datasets import load_boston
class Model:
"""
Models Definition.
This is a general representation of what we do with a model that we are serving, henceforth
applie... | 28.556818 | 109 | 0.645444 | import joblib
import numpy as np
from pathlib import Path
from sklearn.ensemble import RandomForestRegressor
from sklearn.datasets import load_boston
class Model:
def __init__(self, model_path: str = None):
self._model = None
self._model_path = model_path
self.load()
def train(self,... | true | true |
1c3c94f3fa15114d5deef225333bf840a40813b0 | 13,896 | py | Python | go/scripts/tests/test_jsbox_send.py | lynnUg/vumi-go | 852f906c46d5d26940bd6699f11488b73bbc3742 | [
"BSD-3-Clause"
] | null | null | null | go/scripts/tests/test_jsbox_send.py | lynnUg/vumi-go | 852f906c46d5d26940bd6699f11488b73bbc3742 | [
"BSD-3-Clause"
] | null | null | null | go/scripts/tests/test_jsbox_send.py | lynnUg/vumi-go | 852f906c46d5d26940bd6699f11488b73bbc3742 | [
"BSD-3-Clause"
] | null | null | null | import json
from StringIO import StringIO
from tempfile import NamedTemporaryFile
from twisted.internet.defer import inlineCallbacks, returnValue
from twisted.internet.task import Clock
from twisted.python import usage
from vumi.tests.helpers import VumiTestCase
from go.scripts.jsbox_send import (
JsBoxSendWorker... | 38.38674 | 79 | 0.636874 | import json
from StringIO import StringIO
from tempfile import NamedTemporaryFile
from twisted.internet.defer import inlineCallbacks, returnValue
from twisted.internet.task import Clock
from twisted.python import usage
from vumi.tests.helpers import VumiTestCase
from go.scripts.jsbox_send import (
JsBoxSendWorker... | true | true |
1c3c971c42ddcc733dc1be76b59663b71a00c80c | 948 | py | Python | tests/gold_tests/post_error/create_post_body.py | zhangzhongkui/http-over-http | 18e27573e3338ee797648c44d7e01114e1d3321c | [
"Apache-2.0"
] | null | null | null | tests/gold_tests/post_error/create_post_body.py | zhangzhongkui/http-over-http | 18e27573e3338ee797648c44d7e01114e1d3321c | [
"Apache-2.0"
] | 2 | 2017-03-14T02:29:31.000Z | 2017-09-22T22:11:35.000Z | tests/gold_tests/post_error/create_post_body.py | zhangzhongkui/http-over-http | 18e27573e3338ee797648c44d7e01114e1d3321c | [
"Apache-2.0"
] | 1 | 2021-02-15T08:09:17.000Z | 2021-02-15T08:09:17.000Z | '''
'''
# 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
# "License");... | 37.92 | 75 | 0.744726 |
post_body = str(123456).zfill(1024)
postfile = open("postbody", "w")
for x in range(0, 3000):
postfile.write(post_body)
postfile.close()
| true | true |
1c3c9765d3a2070ba96ffc8effcb94d0d13baea5 | 4,400 | py | Python | rc/utils/argsParser.py | RowitZou/Q-Net | d1637c8164f807d51f2185c4f06515b7ac2e029c | [
"MIT"
] | 6 | 2019-02-13T07:00:25.000Z | 2020-12-04T06:28:41.000Z | rc/utils/argsParser.py | RowitZou/RNet-PGNet | d1637c8164f807d51f2185c4f06515b7ac2e029c | [
"MIT"
] | 1 | 2018-11-25T12:33:28.000Z | 2018-11-25T12:33:28.000Z | rc/utils/argsParser.py | RowitZou/Q-Net | d1637c8164f807d51f2185c4f06515b7ac2e029c | [
"MIT"
] | 1 | 2021-06-22T13:27:27.000Z | 2021-06-22T13:27:27.000Z | # -*- coding: utf8 -*-
import argparse
################################################################################
# ArgParse and Helper Functions #
################################################################################
def str2bool(v):
if v.lower() in ('yes', 'true', 't', 'y', '1'):
retu... | 61.971831 | 119 | 0.68 |
import argparse
| true | true |
1c3c9776a6c83a3518b671e96a3eb80080067a5a | 10,282 | py | Python | joystickDemo/controlProgram.py | MarsRobotics/Experiments | 0ada1599766c8ad27fb04398b21042267895c54b | [
"BSD-3-Clause"
] | null | null | null | joystickDemo/controlProgram.py | MarsRobotics/Experiments | 0ada1599766c8ad27fb04398b21042267895c54b | [
"BSD-3-Clause"
] | null | null | null | joystickDemo/controlProgram.py | MarsRobotics/Experiments | 0ada1599766c8ad27fb04398b21042267895c54b | [
"BSD-3-Clause"
] | 2 | 2019-03-28T04:31:05.000Z | 2019-07-03T10:16:20.000Z | from robotparser import RobotFileParser
import pygame
from pygame.locals import *
import socket
import time
class control:
# if the joystick value is +/- this value from 50 then ignore the value
JOYSTICK_PERCENT_IGNORE = 5
JOYSTICK_DISPLAY_HEIGHT = 250
JOYSTICK_DISPLAY_WIDTH = 120
BUTTON_DISPLA... | 34.619529 | 121 | 0.613402 | from robotparser import RobotFileParser
import pygame
from pygame.locals import *
import socket
import time
class control:
JOYSTICK_PERCENT_IGNORE = 5
JOYSTICK_DISPLAY_HEIGHT = 250
JOYSTICK_DISPLAY_WIDTH = 120
BUTTON_DISPLAY_WIDTH = 60
BUTTON_DISPLAY_HEIGHT = 20
COLOR_OUTLINE = (190, ... | false | true |
1c3c9783b1a7b7ea4fe1f04b17ec8c19a6fe0284 | 498 | py | Python | exercise/Exercism/python/allergies/allergies.py | orca-j35/python-notes | 950e78f53c5eebe8a4ba0396d5470383cfa77e48 | [
"CNRI-Python"
] | 1 | 2021-05-08T16:04:09.000Z | 2021-05-08T16:04:09.000Z | exercise/Exercism/python/allergies/allergies.py | orca-j35/python-notes | 950e78f53c5eebe8a4ba0396d5470383cfa77e48 | [
"CNRI-Python"
] | null | null | null | exercise/Exercism/python/allergies/allergies.py | orca-j35/python-notes | 950e78f53c5eebe8a4ba0396d5470383cfa77e48 | [
"CNRI-Python"
] | 2 | 2021-03-04T18:10:48.000Z | 2021-05-08T16:05:33.000Z | class Allergies(object):
items = {
'eggs': 1,
'peanuts': 2,
'shellfish': 4,
'strawberries': 8,
'tomatoes': 16,
'chocolate': 32,
'pollen': 64,
'cats': 128,
}
def __init__(self, score):
self._score = score
def is_allergic_to(self, i... | 22.636364 | 73 | 0.528112 | class Allergies(object):
items = {
'eggs': 1,
'peanuts': 2,
'shellfish': 4,
'strawberries': 8,
'tomatoes': 16,
'chocolate': 32,
'pollen': 64,
'cats': 128,
}
def __init__(self, score):
self._score = score
def is_allergic_to(self, i... | true | true |
1c3c987ff18f75bc78d577a2387d1cd2e1da6e79 | 574 | py | Python | logistica/commands/despacho_incluir_pendente.py | epiresdasilva/ecommerce-eventbridge | 33ec335ee2e946da7101a60746b6c3aa75f2a984 | [
"Apache-2.0"
] | 2 | 2021-10-30T01:32:04.000Z | 2021-11-06T20:22:39.000Z | logistica/commands/despacho_incluir_pendente.py | epiresdasilva/ecommerce-eventbridge | 33ec335ee2e946da7101a60746b6c3aa75f2a984 | [
"Apache-2.0"
] | null | null | null | logistica/commands/despacho_incluir_pendente.py | epiresdasilva/ecommerce-eventbridge | 33ec335ee2e946da7101a60746b6c3aa75f2a984 | [
"Apache-2.0"
] | null | null | null | import json
import boto3
client = boto3.client('events')
def main(event, context):
print("Despacho Incluir Pendencia: ", str(event["detail"]))
event_response = client.put_events(
Entries=[
{
'Source': 'DespachoIncluido',
'DetailType': 'Despacho Incluido',... | 20.5 | 63 | 0.533101 | import json
import boto3
client = boto3.client('events')
def main(event, context):
print("Despacho Incluir Pendencia: ", str(event["detail"]))
event_response = client.put_events(
Entries=[
{
'Source': 'DespachoIncluido',
'DetailType': 'Despacho Incluido',... | true | true |
1c3c98f9b4e64eb252bfe2dc0f227ef565664c46 | 633 | py | Python | database/order_history.py | rirwin/stock-analysis | d13b9be86265ad87c10847422a04f93409b0bf51 | [
"Apache-2.0"
] | null | null | null | database/order_history.py | rirwin/stock-analysis | d13b9be86265ad87c10847422a04f93409b0bf51 | [
"Apache-2.0"
] | 1 | 2020-06-24T04:41:59.000Z | 2020-06-24T04:41:59.000Z | database/order_history.py | rirwin/stock_analysis | d13b9be86265ad87c10847422a04f93409b0bf51 | [
"Apache-2.0"
] | null | null | null | from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy import Column
from sqlalchemy import Float
from sqlalchemy import Integer
from sqlalchemy import String
Base = declarative_base()
class OrderHistory(Base):
__tablename__ = 'order_history'
user_id = Column(Integer, primary_key=True)
... | 24.346154 | 55 | 0.758294 | from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy import Column
from sqlalchemy import Float
from sqlalchemy import Integer
from sqlalchemy import String
Base = declarative_base()
class OrderHistory(Base):
__tablename__ = 'order_history'
user_id = Column(Integer, primary_key=True)
... | true | true |
1c3c99725a0eeee266934c4830273f321e9b9aec | 4,857 | py | Python | day22/day22.py | lukasHD/adventOfCode2020 | fa171f3ad8232a0542d544d3de9b2b9d8fdf8ccd | [
"MIT"
] | null | null | null | day22/day22.py | lukasHD/adventOfCode2020 | fa171f3ad8232a0542d544d3de9b2b9d8fdf8ccd | [
"MIT"
] | null | null | null | day22/day22.py | lukasHD/adventOfCode2020 | fa171f3ad8232a0542d544d3de9b2b9d8fdf8ccd | [
"MIT"
] | null | null | null | import sys
import inspect
from codetiming import Timer
sys.path.insert(0, 'D:\\projects\\aoc2020\\')
from helper import loadingUtils, pretty
DAY = 22
def get_path():
return "day{:02d}".format(DAY)
def parse(in_arr):
p1 = []
p2 = []
player1 = True
for line in in_arr[1:]:
if line == "":
... | 30.936306 | 95 | 0.560222 | import sys
import inspect
from codetiming import Timer
sys.path.insert(0, 'D:\\projects\\aoc2020\\')
from helper import loadingUtils, pretty
DAY = 22
def get_path():
return "day{:02d}".format(DAY)
def parse(in_arr):
p1 = []
p2 = []
player1 = True
for line in in_arr[1:]:
if line == "":
... | true | true |
1c3c99d4efde7cd5f8c65c16cfd8ad83ccc59284 | 486 | py | Python | cpab/cpaNd/model/_ScaleDependentLogPrior.py | freifeld/cpabDiffeo | 22df6cdbd7111b9ae3e7f1c0e31ff85e92d281a6 | [
"MIT"
] | 17 | 2016-03-16T21:35:36.000Z | 2021-11-11T04:16:21.000Z | cpab/cpaNd/model/_ScaleDependentLogPrior.py | freifeld/cpabDiffeo | 22df6cdbd7111b9ae3e7f1c0e31ff85e92d281a6 | [
"MIT"
] | null | null | null | cpab/cpaNd/model/_ScaleDependentLogPrior.py | freifeld/cpabDiffeo | 22df6cdbd7111b9ae3e7f1c0e31ff85e92d281a6 | [
"MIT"
] | 4 | 2016-08-12T23:02:09.000Z | 2019-03-14T18:20:36.000Z | #!/usr/bin/env python
"""
Created on Wed May 7 11:30:31 2014
Author: Oren Freifeld
Email: freifeld@csail.mit.edu
"""
from _ScaleDependentLogPriorGeneral import ScaleDependentLogPriorGeneral
#from of.utils import ipshell
#eps = 1e-16
class ScaleDependentLogPrior(ScaleDependentLogPriorGeneral):
def calc_lp(se... | 25.578947 | 72 | 0.674897 |
from _ScaleDependentLogPriorGeneral import ScaleDependentLogPriorGeneral
class ScaleDependentLogPrior(ScaleDependentLogPriorGeneral):
def calc_lp(self,theta):
J = self.cpa_cov_inv
mu = self.mu
return -0.5 * (theta-mu).dot(J).dot(theta-mu) | true | true |
1c3c9a1afd3f1280ce4b40416f23daa9e9bc7e3e | 382 | py | Python | packages/PIPS/validation/Gpu/scalar_passed_by_reference01.py | DVSR1966/par4all | 86b33ca9da736e832b568c5637a2381f360f1996 | [
"MIT"
] | 51 | 2015-01-31T01:51:39.000Z | 2022-02-18T02:01:50.000Z | packages/PIPS/validation/Gpu/scalar_passed_by_reference01.py | DVSR1966/par4all | 86b33ca9da736e832b568c5637a2381f360f1996 | [
"MIT"
] | 7 | 2017-05-29T09:29:00.000Z | 2019-03-11T16:01:39.000Z | packages/PIPS/validation/Gpu/scalar_passed_by_reference01.py | DVSR1966/par4all | 86b33ca9da736e832b568c5637a2381f360f1996 | [
"MIT"
] | 12 | 2015-03-26T08:05:38.000Z | 2022-02-18T02:01:51.000Z | from validation import vworkspace
with vworkspace() as w:
w.props.memory_effects_only = False
w.fun.main.scalarization()
w.fun.main.privatize_module()
w.fun.main.internalize_parallel_code()
w.fun.main.coarse_grain_parallelization()
w.fun.main.internalize_parallel_code()
w.fun.main.coarse_grain_parallel... | 25.466667 | 43 | 0.774869 | from validation import vworkspace
with vworkspace() as w:
w.props.memory_effects_only = False
w.fun.main.scalarization()
w.fun.main.privatize_module()
w.fun.main.internalize_parallel_code()
w.fun.main.coarse_grain_parallelization()
w.fun.main.internalize_parallel_code()
w.fun.main.coarse_grain_parallel... | true | true |
1c3c9b72ba406771030272645ee21c69e5951ecd | 2,899 | py | Python | test/jpypetest/test_classhints.py | pitmanst/jpype | 7256261e435b5c9309941c668258bebd1bcdff2d | [
"Apache-2.0"
] | 531 | 2018-07-19T03:30:04.000Z | 2022-03-29T16:52:44.000Z | test/jpypetest/test_classhints.py | pitmanst/jpype | 7256261e435b5c9309941c668258bebd1bcdff2d | [
"Apache-2.0"
] | 715 | 2018-07-18T09:21:01.000Z | 2022-03-24T17:45:49.000Z | test/jpypetest/test_classhints.py | pitmanst/jpype | 7256261e435b5c9309941c668258bebd1bcdff2d | [
"Apache-2.0"
] | 80 | 2018-07-18T13:10:55.000Z | 2022-03-31T19:47: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
#
# ... | 32.943182 | 79 | 0.617109 |
import jpype
import common
class MyImpl(object):
def blah(self):
pass
class ClassHintsTestCase(common.JPypeTestCase):
def setUp(self):
common.JPypeTestCase.setUp(self)
self.Custom = jpype.JClass("jpype.classhints.Custom")
self.ClassHintsTest = jpype.JClass("... | true | true |
1c3c9b8fe0389b22672e4547b2a753df434c33c8 | 12,791 | py | Python | dame_flame/flame_algorithm.py | thowell332/DAME-FLAME-Python-Package | 860e7b0443903c0b79f3b214c359fdddb9718caf | [
"MIT"
] | null | null | null | dame_flame/flame_algorithm.py | thowell332/DAME-FLAME-Python-Package | 860e7b0443903c0b79f3b214c359fdddb9718caf | [
"MIT"
] | null | null | null | dame_flame/flame_algorithm.py | thowell332/DAME-FLAME-Python-Package | 860e7b0443903c0b79f3b214c359fdddb9718caf | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""The main file for the FLAME algorithm"""
# author: Neha Gupta, Duke University
# Copyright Duke University 2020
# License: MIT
import pandas as pd
import numpy as np
from . import grouped_mr
from . import dame_algorithm
from . import flame_dame_helpers
def decide_drop(all_covs, consider_d... | 40.865815 | 99 | 0.633258 |
import pandas as pd
import numpy as np
from . import grouped_mr
from . import dame_algorithm
from . import flame_dame_helpers
def decide_drop(all_covs, consider_dropping, prev_drop, df_all,
treatment_column_name, outcome_column_name, df_holdout_array,
adaptive_weights, alpha_give... | true | true |
1c3c9ce7ce9d4d8460fe55292648d43120afe501 | 133 | py | Python | 001146StepikPyBegin/Stepik001146PyBeginсh07p01st04С03_symbols_20200420.py | SafonovMikhail/python_000577 | 739f764e80f1ca354386f00b8e9db1df8c96531d | [
"Apache-2.0"
] | null | null | null | 001146StepikPyBegin/Stepik001146PyBeginсh07p01st04С03_symbols_20200420.py | SafonovMikhail/python_000577 | 739f764e80f1ca354386f00b8e9db1df8c96531d | [
"Apache-2.0"
] | null | null | null | 001146StepikPyBegin/Stepik001146PyBeginсh07p01st04С03_symbols_20200420.py | SafonovMikhail/python_000577 | 739f764e80f1ca354386f00b8e9db1df8c96531d | [
"Apache-2.0"
] | null | null | null | for i in range(6):
print("AAA")
for i in range(5):
print("BBBB")
print("E")
for i in range(9):
print("TTTTT")
print("G")
| 14.777778 | 18 | 0.56391 | for i in range(6):
print("AAA")
for i in range(5):
print("BBBB")
print("E")
for i in range(9):
print("TTTTT")
print("G")
| true | true |
1c3c9eb7ebc2fd35b322c1552efa50e1610c3bf1 | 2,937 | py | Python | peptidereactor/iFeature/codes/NMBroto.py | spaenigs/peptidereactor | 17efcb993505934f5b9c2d63f5cc040bb244dde9 | [
"MIT"
] | 3 | 2021-02-03T12:30:37.000Z | 2021-06-07T07:03:38.000Z | peptidereactor/iFeature/codes/NMBroto.py | spaenigs/peptidereactor | 17efcb993505934f5b9c2d63f5cc040bb244dde9 | [
"MIT"
] | 1 | 2021-01-04T14:52:27.000Z | 2021-01-04T14:52:27.000Z | peptidereactor/iFeature/codes/NMBroto.py | spaenigs/peptidereactor | 17efcb993505934f5b9c2d63f5cc040bb244dde9 | [
"MIT"
] | 1 | 2021-06-09T16:16:16.000Z | 2021-06-09T16:16:16.000Z | #!/usr/bin/env python
#_*_coding:utf-8_*_
import sys, platform, os, re
import argparse
import numpy as np
pPath = os.path.split(os.path.realpath(__file__))[0]
sys.path.append(pPath)
import checkFasta
import readFasta
import saveCode
def NMBroto(fastas, props=['CIDH920105', 'BHAR880101', 'CHAM820101', 'CHAM820102',
... | 33 | 180 | 0.653388 |
import sys, platform, os, re
import argparse
import numpy as np
pPath = os.path.split(os.path.realpath(__file__))[0]
sys.path.append(pPath)
import checkFasta
import readFasta
import saveCode
def NMBroto(fastas, props=['CIDH920105', 'BHAR880101', 'CHAM820101', 'CHAM820102',
'CHOC760101', 'BIGC670101', 'CH... | true | true |
1c3c9f9d6def9ec236cb8b6045ae02325cbe876a | 1,882 | py | Python | mamba/symbol_table.py | laggycomputer/mamba-lang | f3223a23a0051ca06e5c330d204c09372a3dd9cb | [
"MIT"
] | 11 | 2018-11-11T14:13:53.000Z | 2021-12-22T14:37:54.000Z | mamba/symbol_table.py | laggycomputer/mamba-lang | f3223a23a0051ca06e5c330d204c09372a3dd9cb | [
"MIT"
] | 5 | 2018-12-08T20:19:20.000Z | 2020-04-29T12:26:47.000Z | mamba/symbol_table.py | laggycomputer/mamba-lang | f3223a23a0051ca06e5c330d204c09372a3dd9cb | [
"MIT"
] | 4 | 2018-12-08T17:34:34.000Z | 2021-12-22T16:17:44.000Z | from mamba.exceptions import *
class SymbolTable:
__func = "functions"
__sym = "symbols"
__local = "local"
__table = {__func: {}, __sym: {}, __local: []}
def __is_local(self):
"""
Returns true if symbol table is being called from inside
a function rather than the global s... | 27.275362 | 77 | 0.575452 | from mamba.exceptions import *
class SymbolTable:
__func = "functions"
__sym = "symbols"
__local = "local"
__table = {__func: {}, __sym: {}, __local: []}
def __is_local(self):
return len(self.__table[self.__local]) > 0
def table(self):
return self.__table
def get_local_... | true | true |
1c3ca0a1143a1916ef7cbeb4266c385ea0c07641 | 229 | py | Python | prettyqt/charts/percentbarseries.py | phil65/PrettyQt | 26327670c46caa039c9bd15cb17a35ef5ad72e6c | [
"MIT"
] | 7 | 2019-05-01T01:34:36.000Z | 2022-03-08T02:24:14.000Z | prettyqt/charts/percentbarseries.py | phil65/PrettyQt | 26327670c46caa039c9bd15cb17a35ef5ad72e6c | [
"MIT"
] | 141 | 2019-04-16T11:22:01.000Z | 2021-04-14T15:12:36.000Z | prettyqt/charts/percentbarseries.py | phil65/PrettyQt | 26327670c46caa039c9bd15cb17a35ef5ad72e6c | [
"MIT"
] | 5 | 2019-04-17T11:48:19.000Z | 2021-11-21T10:30:19.000Z | from __future__ import annotations
from prettyqt import charts
from prettyqt.qt import QtCharts
QtCharts.QPercentBarSeries.__bases__ = (charts.AbstractBarSeries,)
class PercentBarSeries(QtCharts.QPercentBarSeries):
pass
| 19.083333 | 66 | 0.829694 | from __future__ import annotations
from prettyqt import charts
from prettyqt.qt import QtCharts
QtCharts.QPercentBarSeries.__bases__ = (charts.AbstractBarSeries,)
class PercentBarSeries(QtCharts.QPercentBarSeries):
pass
| true | true |
1c3ca0d145d0d7bb16b0dbfbb70bbf79a88b8932 | 2,937 | py | Python | src/basic_bcrypt_auth.py | krayzpipes/squid-bcrypt | 09f7c255865aa5102e9a657c53101dde85db2414 | [
"Apache-2.0"
] | null | null | null | src/basic_bcrypt_auth.py | krayzpipes/squid-bcrypt | 09f7c255865aa5102e9a657c53101dde85db2414 | [
"Apache-2.0"
] | null | null | null | src/basic_bcrypt_auth.py | krayzpipes/squid-bcrypt | 09f7c255865aa5102e9a657c53101dde85db2414 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
"""Squid helper for authenticating basic auth against bcrypt hashes.
See Authenticator > Basic Scheme here:
https://wiki.squid-cache.org/Features/AddonHelpers
Designed to work with bcrypt hash files created with htpasswd:
EXAMPLE: htpasswd -cbB -C 10 /path/to/password_file username password
T... | 28.514563 | 114 | 0.617297 |
import sys
import bcrypt
def load_hashes_to_memory(filename: str) -> dict:
password_kv = {}
with open(filename, 'r') as f:
for line in f:
sections = line.strip().split(':')
try:
user = sections[0].strip().lower()
hash = sections[1].strip()
... | true | true |
1c3ca12a5a8495d2fe270c4c214a1f489ee9a871 | 2,015 | py | Python | lintreview/tools/ktlint.py | josemanimala/lint-review | a0abdf2ec29fb63855b5caca36eea6bc2693cc92 | [
"MIT"
] | null | null | null | lintreview/tools/ktlint.py | josemanimala/lint-review | a0abdf2ec29fb63855b5caca36eea6bc2693cc92 | [
"MIT"
] | null | null | null | lintreview/tools/ktlint.py | josemanimala/lint-review | a0abdf2ec29fb63855b5caca36eea6bc2693cc92 | [
"MIT"
] | null | null | null | from __future__ import absolute_import
import logging
import os
import lintreview.docker as docker
from lintreview.tools import Tool, process_checkstyle
log = logging.getLogger(__name__)
class Ktlint(Tool):
name = 'ktlint'
def check_dependencies(self):
"""
See if ktlint is on the system pat... | 29.632353 | 70 | 0.601489 | from __future__ import absolute_import
import logging
import os
import lintreview.docker as docker
from lintreview.tools import Tool, process_checkstyle
log = logging.getLogger(__name__)
class Ktlint(Tool):
name = 'ktlint'
def check_dependencies(self):
return docker.image_exists('ktlint')
def ... | true | true |
1c3ca22b1c2e1804997daa4351a616d3fd087936 | 4,422 | py | Python | src/DataPrep.py | BZ-2453/DeepBass | a0f4ab8613994a8cfcf732fa2b2b2840313264d4 | [
"MIT"
] | 1 | 2019-06-05T23:47:32.000Z | 2019-06-05T23:47:32.000Z | src/DataPrep.py | BZ-2453/DeepBass | a0f4ab8613994a8cfcf732fa2b2b2840313264d4 | [
"MIT"
] | null | null | null | src/DataPrep.py | BZ-2453/DeepBass | a0f4ab8613994a8cfcf732fa2b2b2840313264d4 | [
"MIT"
] | 1 | 2018-11-14T02:58:35.000Z | 2018-11-14T02:58:35.000Z | import os
import argparse
from ingestion.IO_utils import Load
import numpy as np
import errno
from preprocess.SilenceRemoval import SR
from preprocess.np_to_tfrecords import np_to_tfrecords
from preprocess.get_time import get_time
from os import listdir
from os.path import isfile, join
from joblib import Parallel, dela... | 42.932039 | 82 | 0.60493 | import os
import argparse
from ingestion.IO_utils import Load
import numpy as np
import errno
from preprocess.SilenceRemoval import SR
from preprocess.np_to_tfrecords import np_to_tfrecords
from preprocess.get_time import get_time
from os import listdir
from os.path import isfile, join
from joblib import Parallel, dela... | true | true |
1c3ca320e711d55930e495327ed5ac5f2359cf78 | 1,587 | py | Python | trb.py | WalderlanSena/toolsrouterbrute | 8ca08c99162000de6428ee70cd3e0bdc847fc55c | [
"MIT"
] | 7 | 2018-09-12T17:12:39.000Z | 2021-07-02T16:56:18.000Z | trb.py | WalderlanSena/toolsrouterbrute | 8ca08c99162000de6428ee70cd3e0bdc847fc55c | [
"MIT"
] | null | null | null | trb.py | WalderlanSena/toolsrouterbrute | 8ca08c99162000de6428ee70cd3e0bdc847fc55c | [
"MIT"
] | 4 | 2018-06-25T17:54:26.000Z | 2021-04-07T06:11:09.000Z | #!/usr/bin/python
# TOOLS ROUTER BRUTE - V1.0.0
# Developement: Walderlan Sena <senawalderlan@gmail.com>
#
import requests as r
import base64
import sys
import os
def splash():
print(
"""
TOOLS ROUTER BRUTE - v1.0.0
Site: https://www.github.com/WalderlanSena/toolsrouterbrute
Developem... | 23.338235 | 76 | 0.555766 |
import requests as r
import base64
import sys
import os
def splash():
print(
"""
TOOLS ROUTER BRUTE - v1.0.0
Site: https://www.github.com/WalderlanSena/toolsrouterbrute
Developement: Walderlan Sena <senwalderlan@gmail.com>
"""
)
if len(sys.argv) < 2:
splash()
prin... | true | true |
1c3ca35bcab506e0d9e128e8f0a6d9db17c9822f | 23,409 | py | Python | click/_compat.py | pravarag/click | fa925c9b0994b62486d1963c54d97c9a08cb9862 | [
"BSD-3-Clause"
] | null | null | null | click/_compat.py | pravarag/click | fa925c9b0994b62486d1963c54d97c9a08cb9862 | [
"BSD-3-Clause"
] | null | null | null | click/_compat.py | pravarag/click | fa925c9b0994b62486d1963c54d97c9a08cb9862 | [
"BSD-3-Clause"
] | null | null | null | import re
import io
import os
import sys
import codecs
from weakref import WeakKeyDictionary
PY2 = sys.version_info[0] == 2
CYGWIN = sys.platform.startswith('cygwin')
# Determine local App Engine environment, per Google's own suggestion
APP_ENGINE = ('APPENGINE_RUNTIME' in os.environ and
'Development/' ... | 33.25142 | 80 | 0.610065 | import re
import io
import os
import sys
import codecs
from weakref import WeakKeyDictionary
PY2 = sys.version_info[0] == 2
CYGWIN = sys.platform.startswith('cygwin')
APP_ENGINE = ('APPENGINE_RUNTIME' in os.environ and
'Development/' in os.environ['SERVER_SOFTWARE'])
WIN = sys.platform.startswith('win'... | true | true |
1c3ca4830af7c2131448f1698e9701a6a38724d0 | 5,913 | py | Python | api/tests/opentrons/protocols/context/simulator/test_instrument_context.py | Opentrons/protocol_framework | ebbd6b2fe984edd6ecfcbf1dbe040db7f7356b9f | [
"Apache-2.0"
] | 2 | 2015-11-10T17:49:51.000Z | 2016-01-15T04:43:37.000Z | api/tests/opentrons/protocols/context/simulator/test_instrument_context.py | Opentrons/labware | e21d8db51eac5818477264a45ef12c0a2d15fb72 | [
"Apache-2.0"
] | null | null | null | api/tests/opentrons/protocols/context/simulator/test_instrument_context.py | Opentrons/labware | e21d8db51eac5818477264a45ef12c0a2d15fb72 | [
"Apache-2.0"
] | null | null | null | """Test instrument context simulation."""
from typing import Callable
import pytest
from pytest_lazyfixture import lazy_fixture
from opentrons.hardware_control import NoTipAttachedError
from opentrons.hardware_control.types import TipAttachedError
from opentrons.protocols.context.labware import AbstractLabware
from o... | 32.311475 | 87 | 0.718079 | from typing import Callable
import pytest
from pytest_lazyfixture import lazy_fixture
from opentrons.hardware_control import NoTipAttachedError
from opentrons.hardware_control.types import TipAttachedError
from opentrons.protocols.context.labware import AbstractLabware
from opentrons.protocols.context.instrument impo... | true | true |
1c3ca4e2960d97005dc4bd4214d06bd624d57dd8 | 673 | py | Python | cleanSearch.py | newnativeabq/mendeley-search | a9d7514deb57c34d72e06b1f33b0e8e9bb9fb090 | [
"MIT"
] | null | null | null | cleanSearch.py | newnativeabq/mendeley-search | a9d7514deb57c34d72e06b1f33b0e8e9bb9fb090 | [
"MIT"
] | null | null | null | cleanSearch.py | newnativeabq/mendeley-search | a9d7514deb57c34d72e06b1f33b0e8e9bb9fb090 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Mon Jul 22 10:57:39 2019
todo pull this directly from google API
@author: vince
"""
slist = []
# Clean the text
with open('search_list.txt') as f:
slist = f.readlines()
for i, row in enumerate(slist):
slist[i] = ' '.join(row.split(' ')[3:])
for i, row in enumerate(sli... | 19.228571 | 43 | 0.59584 |
slist = []
with open('search_list.txt') as f:
slist = f.readlines()
for i, row in enumerate(slist):
slist[i] = ' '.join(row.split(' ')[3:])
for i, row in enumerate(slist):
if row.find(' ') == 1:
slist[i] = row[2:]
slist[7] = "HIV/AIDS"
for i, row in enumerate(slist):
slist[i] = ro... | true | true |
1c3ca5321c7dda2b3c987b3d02c18c62d4f35d39 | 1,102 | py | Python | setup.py | Van1us/EasyOCR | a1a88441192beb9f9299d5d78abe54b1a7f7b662 | [
"Apache-2.0"
] | 1 | 2021-08-24T17:46:26.000Z | 2021-08-24T17:46:26.000Z | setup.py | Van1us/EasyOCR | a1a88441192beb9f9299d5d78abe54b1a7f7b662 | [
"Apache-2.0"
] | null | null | null | setup.py | Van1us/EasyOCR | a1a88441192beb9f9299d5d78abe54b1a7f7b662 | [
"Apache-2.0"
] | 1 | 2022-01-04T07:00:12.000Z | 2022-01-04T07:00:12.000Z | """
End-to-End Multi-Lingual Optical Character Recognition (OCR) Solution
"""
from setuptools import setup
from io import open
with open('requirements.txt', encoding="utf-8-sig") as f:
requirements = f.readlines()
def readme():
with open('README.md', encoding="utf-8-sig") as f:
README = f.read()
... | 30.611111 | 88 | 0.696915 |
from setuptools import setup
from io import open
with open('requirements.txt', encoding="utf-8-sig") as f:
requirements = f.readlines()
def readme():
with open('README.md', encoding="utf-8-sig") as f:
README = f.read()
return README
setup(
name='easyocr',
packages=['easyocr'],
includ... | true | true |
1c3ca5e731a0a1f524fc4c9e63a4b5cac3875b51 | 8,217 | py | Python | objects/CSCG/_3d/forms/standard/base/dofs/dof/visualize/matplot/_2sf.py | mathischeap/mifem | 3242e253fb01ca205a76568eaac7bbdb99e3f059 | [
"MIT"
] | 1 | 2020-10-14T12:48:35.000Z | 2020-10-14T12:48:35.000Z | objects/CSCG/_3d/forms/standard/base/dofs/dof/visualize/matplot/_2sf.py | mathischeap/mifem | 3242e253fb01ca205a76568eaac7bbdb99e3f059 | [
"MIT"
] | null | null | null | objects/CSCG/_3d/forms/standard/base/dofs/dof/visualize/matplot/_2sf.py | mathischeap/mifem | 3242e253fb01ca205a76568eaac7bbdb99e3f059 | [
"MIT"
] | null | null | null |
from root.config.main import *
import matplotlib.pyplot as plt
from screws.freeze.main import FrozenOnly
class _3dCSCG_SF_DOF_VISUALIZE_matplot_2SF(FrozenOnly):
""""""
def __init__(self, dof):
""""""
self._dof_ = dof
self._mesh_ = dof._sf_.mesh
self._sf_ = dof._sf_
sel... | 41.71066 | 116 | 0.458196 |
from root.config.main import *
import matplotlib.pyplot as plt
from screws.freeze.main import FrozenOnly
class _3dCSCG_SF_DOF_VISUALIZE_matplot_2SF(FrozenOnly):
def __init__(self, dof):
self._dof_ = dof
self._mesh_ = dof._sf_.mesh
self._sf_ = dof._sf_
self._freeze_self_()
def... | true | true |
1c3ca62019c75650299eb6536f4bfeab59e4ff4d | 5,160 | py | Python | code_replacement.py | laundmo/manim-code | 2758a092f95b0b3ebfabf049668310ecfef8238c | [
"MIT"
] | null | null | null | code_replacement.py | laundmo/manim-code | 2758a092f95b0b3ebfabf049668310ecfef8238c | [
"MIT"
] | null | null | null | code_replacement.py | laundmo/manim-code | 2758a092f95b0b3ebfabf049668310ecfef8238c | [
"MIT"
] | null | null | null | import re
from textwrap import dedent
from string_editor import LineColEditor
from manim import (
DOWN,
LEFT,
RIGHT,
UP,
Code,
Create,
CurvedArrow,
CyclicReplace,
FadeOut,
Scene,
SurroundingRectangle,
Uncreate,
)
def regex_line_span(regex, string, group=1):
m = re.... | 30.898204 | 88 | 0.588953 | import re
from textwrap import dedent
from string_editor import LineColEditor
from manim import (
DOWN,
LEFT,
RIGHT,
UP,
Code,
Create,
CurvedArrow,
CyclicReplace,
FadeOut,
Scene,
SurroundingRectangle,
Uncreate,
)
def regex_line_span(regex, string, group=1):
m = re.... | true | true |
1c3ca63b598327033ec30a57a8658b4017381c90 | 816 | py | Python | CS01_SprintChallenge/csCheckPalindrome.py | JeffreyAsuncion/CSPT15_ComputerScienceFundamentals | 6b8b847af6658125fa548b0133626333f255e2da | [
"MIT"
] | null | null | null | CS01_SprintChallenge/csCheckPalindrome.py | JeffreyAsuncion/CSPT15_ComputerScienceFundamentals | 6b8b847af6658125fa548b0133626333f255e2da | [
"MIT"
] | null | null | null | CS01_SprintChallenge/csCheckPalindrome.py | JeffreyAsuncion/CSPT15_ComputerScienceFundamentals | 6b8b847af6658125fa548b0133626333f255e2da | [
"MIT"
] | null | null | null | """
A palindrome is a word, phrase, number, or another sequence of characters
that reads the same backward or forward.
This includes capital letters, punctuation, and other special characters.
Given a string, write a function that checks if the input is a valid palindrome.
Examples:
csCheckPalindrome("racecar") ->... | 24.727273 | 80 | 0.738971 |
def csCheckPalindrome(input_str):
return input_str == input_str[::-1]
print(csCheckPalindrome("racecar"))
print(csCheckPalindrome("anna"))
print(csCheckPalindrome("12345"))
print(csCheckPalindrome("12321"))
| true | true |
1c3ca6606ef472e02ecb76519c6d63d47341f19d | 1,097 | py | Python | pip_services3_facade/services/PartitionFacadeService.py | pip-services3-python/pip-services3-facade-python | dfe7db79f525a1d823637c1e1d030a6333e19aa8 | [
"MIT"
] | null | null | null | pip_services3_facade/services/PartitionFacadeService.py | pip-services3-python/pip-services3-facade-python | dfe7db79f525a1d823637c1e1d030a6333e19aa8 | [
"MIT"
] | null | null | null | pip_services3_facade/services/PartitionFacadeService.py | pip-services3-python/pip-services3-facade-python | dfe7db79f525a1d823637c1e1d030a6333e19aa8 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from abc import abstractmethod
from pip_services3_commons.config import ConfigParams
from pip_services3_commons.refer import IReferences, Descriptor
from .IFacadeService import IFacadeService
from .FacadeService import FacadeService
class PartitionFacadeService(FacadeService):
_parent: ... | 30.472222 | 114 | 0.7165 |
from abc import abstractmethod
from pip_services3_commons.config import ConfigParams
from pip_services3_commons.refer import IReferences, Descriptor
from .IFacadeService import IFacadeService
from .FacadeService import FacadeService
class PartitionFacadeService(FacadeService):
_parent: IFacadeService
def... | true | true |
1c3ca6c3897643e98271b6be85be2e7bae3b2591 | 10,077 | py | Python | raw_ted.py | deshwalmahesh/CURL---cpu-gpu | f4e87275b6cce556b9e04a188cf7ae13d810d82a | [
"BSD-3-Clause"
] | 125 | 2020-10-16T12:25:59.000Z | 2022-03-22T06:04:57.000Z | raw_ted.py | deshwalmahesh/CURL---cpu-gpu | f4e87275b6cce556b9e04a188cf7ae13d810d82a | [
"BSD-3-Clause"
] | 22 | 2020-10-19T10:40:05.000Z | 2022-02-14T12:01:46.000Z | raw_ted.py | deshwalmahesh/CURL---cpu-gpu | f4e87275b6cce556b9e04a188cf7ae13d810d82a | [
"BSD-3-Clause"
] | 23 | 2020-11-05T09:23:52.000Z | 2022-03-24T08:00:50.000Z | # -*- coding: utf-8 -*-
'''
This is a PyTorch implementation of CURL: Neural Curve Layers for Global Image Enhancement
https://arxiv.org/pdf/1911.13175.pdf
Please cite paper if you use this code.
Tested with Pytorch 1.7.1, Python 3.7.9
Authors: Sean Moran (sean.j.moran@gmail.com), 2020
'''
import numpy ... | 28.873926 | 95 | 0.545103 |
import numpy as np
import torch
import torch.nn as nn
from math import sqrt
from torch.nn import init
from torch.autograd import Variable
import torch.nn.functional as F
class Flatten(nn.Module):
def forward(self, x):
return x.view(x.size()[0], -1)
class TED(nn.Module):
def __ini... | true | true |
1c3ca89898254300ae55bd6dd429dc7076b83741 | 11,070 | py | Python | selfdrive/controls/lib/lateral_planner.py | keijikage/openpilot | 4ed31ab245bdfc8a38566ed24e275b6bd8a06c23 | [
"MIT"
] | 1 | 2021-08-15T18:21:45.000Z | 2021-08-15T18:21:45.000Z | selfdrive/controls/lib/lateral_planner.py | keijikage/openpilot | 4ed31ab245bdfc8a38566ed24e275b6bd8a06c23 | [
"MIT"
] | null | null | null | selfdrive/controls/lib/lateral_planner.py | keijikage/openpilot | 4ed31ab245bdfc8a38566ed24e275b6bd8a06c23 | [
"MIT"
] | 6 | 2021-06-25T04:56:29.000Z | 2022-01-11T00:37:15.000Z | import os
import math
import numpy as np
from common.realtime import sec_since_boot, DT_MDL
from common.numpy_fast import interp
from selfdrive.swaglog import cloudlog
from selfdrive.controls.lib.lateral_mpc import libmpc_py
from selfdrive.controls.lib.drive_helpers import CONTROL_N, MPC_COST_LAT, LAT_MPC_N, CAR_ROTATI... | 44.457831 | 133 | 0.725474 | import os
import math
import numpy as np
from common.realtime import sec_since_boot, DT_MDL
from common.numpy_fast import interp
from selfdrive.swaglog import cloudlog
from selfdrive.controls.lib.lateral_mpc import libmpc_py
from selfdrive.controls.lib.drive_helpers import CONTROL_N, MPC_COST_LAT, LAT_MPC_N, CAR_ROTATI... | true | true |
1c3ca96a8752bea73f340ee28894ea1bdab8af22 | 215 | py | Python | Python 3/19.prac_no2.py | ByeonUi-Hyeok/practice | 6f55ddcb662e2bf8e0c3fb4c4af0beb77a1c7d2d | [
"MIT"
] | 1 | 2021-06-11T08:55:03.000Z | 2021-06-11T08:55:03.000Z | Python 3/19.prac_no2.py | ByeonUi-Hyeok/practice | 6f55ddcb662e2bf8e0c3fb4c4af0beb77a1c7d2d | [
"MIT"
] | null | null | null | Python 3/19.prac_no2.py | ByeonUi-Hyeok/practice | 6f55ddcb662e2bf8e0c3fb4c4af0beb77a1c7d2d | [
"MIT"
] | null | null | null | import funcvote as vote
votes = input("투표내용 >>>")
# print(votes)
# print(type(votes))
result = vote.str2int(votes)
print(vote.countvotes(result))
result = vote.countvotes(result)
vote.printvote(result)
# 투표 초안 | 14.333333 | 32 | 0.716279 | import funcvote as vote
votes = input("투표내용 >>>")
result = vote.str2int(votes)
print(vote.countvotes(result))
result = vote.countvotes(result)
vote.printvote(result)
| true | true |
1c3ca9e71817ee5fcb844a158df98afd6ab0e6c3 | 287 | py | Python | app/main/views/digital_services_framework.py | pebblecode/cirrus-buyer-frontend | 506c45eab09fa9538c0eb05643e24feecdcca56f | [
"MIT"
] | null | null | null | app/main/views/digital_services_framework.py | pebblecode/cirrus-buyer-frontend | 506c45eab09fa9538c0eb05643e24feecdcca56f | [
"MIT"
] | null | null | null | app/main/views/digital_services_framework.py | pebblecode/cirrus-buyer-frontend | 506c45eab09fa9538c0eb05643e24feecdcca56f | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from flask import render_template
from ...main import main
@main.route('/digital-services/framework')
def framework_digital_services():
return render_template(
'content/framework-digital-services.html'
)
| 22.076923 | 49 | 0.738676 |
from __future__ import unicode_literals
from flask import render_template
from ...main import main
@main.route('/digital-services/framework')
def framework_digital_services():
return render_template(
'content/framework-digital-services.html'
)
| true | true |
1c3ca9fe0ba39643af17fbe0c380891ae5a61c42 | 723 | py | Python | Audio/OpenTransformer/egs/aishell/local/generate_vocab.py | mls1999725/models | 77b3a9d727cb7cf3a14a75d8fdb0d17bb411bd02 | [
"Apache-2.0"
] | 43 | 2021-06-03T09:07:08.000Z | 2022-03-31T15:21:48.000Z | Audio/OpenTransformer/egs/aishell/local/generate_vocab.py | mls1999725/models | 77b3a9d727cb7cf3a14a75d8fdb0d17bb411bd02 | [
"Apache-2.0"
] | 64 | 2021-05-31T10:34:06.000Z | 2022-01-17T03:44:58.000Z | Audio/OpenTransformer/egs/aishell/local/generate_vocab.py | mls1999725/models | 77b3a9d727cb7cf3a14a75d8fdb0d17bb411bd02 | [
"Apache-2.0"
] | 37 | 2021-07-04T03:13:18.000Z | 2022-03-25T07:30:47.000Z | import os
import sys
text_in = sys.argv[1]
vocab_out = sys.argv[2]
lexicon = {}
with open(text_in, "r", encoding="utf-8") as f:
for line in f:
parts = line.strip().split()
idx = parts[0]
phones = parts[1:]
for p in phones:
if p not in lexicon:
lexicon[... | 20.657143 | 65 | 0.514523 | import os
import sys
text_in = sys.argv[1]
vocab_out = sys.argv[2]
lexicon = {}
with open(text_in, "r", encoding="utf-8") as f:
for line in f:
parts = line.strip().split()
idx = parts[0]
phones = parts[1:]
for p in phones:
if p not in lexicon:
lexicon[... | true | true |
1c3caa05b79ab822072c9a3ba8a1575fcab9bfd3 | 2,212 | py | Python | solution/model2.py | LoveThinkinghard/MCM-2019-Problem-C-drug-spread-maps | 2fe2a6eaaa6c5fdbeab972ffd82a71b60259737e | [
"MIT"
] | 14 | 2019-03-16T02:18:13.000Z | 2022-01-28T14:31:11.000Z | solution/model2.py | LoveThinkinghard/MCM-2019-Problem-C-Solution | 2fe2a6eaaa6c5fdbeab972ffd82a71b60259737e | [
"MIT"
] | 1 | 2019-01-28T14:48:19.000Z | 2019-01-28T14:48:19.000Z | solution/model2.py | LoveThinkinghard/MCM-2019-Problem-C-drug-spread-maps | 2fe2a6eaaa6c5fdbeab972ffd82a71b60259737e | [
"MIT"
] | 2 | 2019-12-20T12:38:44.000Z | 2020-01-16T08:18:54.000Z | # -*- coding: utf-8 -*-
# if you run 'model1.py' just now, you need to restart your kernel.
# or you might have some trouble when you fit the model
import keras.layers as kl
from keras import Model
import numpy as np
import matplotlib.pyplot as plt
#%%
dis_mat = np.load('./data/distance_matrix.npy')
drug_use = np.loa... | 32.529412 | 85 | 0.701175 |
import keras.layers as kl
from keras import Model
import numpy as np
import matplotlib.pyplot as plt
dis_mat = np.load('./data/distance_matrix.npy')
drug_use = np.load('./data/drug_use.npy')
all_s_use = np.load('./data/all_s_use.npy')
x_eco_data = np.load('./data/eco_data.npy')
X = []
Y = []
for i in range(7... | true | true |
1c3caa2c1dee461acb382207574a2741ec964c98 | 1,249 | py | Python | epibox/common/write_file.py | PIA-Group/epibox | 9b12ae27e73c69845d2418b2a2ba00c10e2c99f5 | [
"MIT"
] | null | null | null | epibox/common/write_file.py | PIA-Group/epibox | 9b12ae27e73c69845d2418b2a2ba00c10e2c99f5 | [
"MIT"
] | null | null | null | epibox/common/write_file.py | PIA-Group/epibox | 9b12ae27e73c69845d2418b2a2ba00c10e2c99f5 | [
"MIT"
] | null | null | null | # built-in
from datetime import datetime
import os
# third-party
import numpy as np
def write_file(t, a_file, sync_param, time, fmt):
write_acq_file(a_file, t, time, fmt)
def write_acq_file(a_file, t, time, fmt):
np.savetxt(a_file, t, fmt=fmt, delimiter=' ', newline='\n', header='', footer='', comments ='')
... | 29.046512 | 110 | 0.630905 |
from datetime import datetime
import os
import numpy as np
def write_file(t, a_file, sync_param, time, fmt):
write_acq_file(a_file, t, time, fmt)
def write_acq_file(a_file, t, time, fmt):
np.savetxt(a_file, t, fmt=fmt, delimiter=' ', newline='\n', header='', footer='', comments ='')
def write_drift_log(fi... | true | true |
1c3caab177ba19266092b993ec7f6d18af0990f9 | 10,534 | py | Python | src/models/pretraining.py | shahid313/embedding-propagation | f3da33939ddd3eba195c9c8e0f433944a8b02ef6 | [
"Apache-2.0"
] | null | null | null | src/models/pretraining.py | shahid313/embedding-propagation | f3da33939ddd3eba195c9c8e0f433944a8b02ef6 | [
"Apache-2.0"
] | null | null | null | src/models/pretraining.py | shahid313/embedding-propagation | f3da33939ddd3eba195c9c8e0f433944a8b02ef6 | [
"Apache-2.0"
] | null | null | null | import numpy as np
import os
import torch
import torch.nn.functional as F
from src.tools.meters import BasicMeter
from src.modules.embedding_propagation import EmbeddingPropagation, LabelPropagation
from .base_wrapper import BaseWrapper
from src.modules.distances import prototype_distance
class PretrainWrapper(BaseWra... | 41.636364 | 160 | 0.599677 | import numpy as np
import os
import torch
import torch.nn.functional as F
from src.tools.meters import BasicMeter
from src.modules.embedding_propagation import EmbeddingPropagation, LabelPropagation
from .base_wrapper import BaseWrapper
from src.modules.distances import prototype_distance
class PretrainWrapper(BaseWra... | true | true |
1c3cad6489686e71d6b612bcf98fda2ef987c325 | 685 | py | Python | setup.py | kcphysics/ATSAPI | 4a14133d9143d5cb1ecfc434dc49e37a72f94db4 | [
"MIT"
] | null | null | null | setup.py | kcphysics/ATSAPI | 4a14133d9143d5cb1ecfc434dc49e37a72f94db4 | [
"MIT"
] | 4 | 2020-08-30T03:52:50.000Z | 2020-09-03T02:51:01.000Z | setup.py | kcphysics/ATSAPI | 4a14133d9143d5cb1ecfc434dc49e37a72f94db4 | [
"MIT"
] | null | null | null | from setuptools import setup, find_packages
setup(
name="atsapi",
description="An API to make some game utilites for TrekMUSH: Among The Stars available via HTTP",
url="https://github.com/kcphysics/ATSAPI",
author="KCPhysics",
packages=find_packages(),
classifiers=[
"Programmin Language... | 24.464286 | 101 | 0.586861 | from setuptools import setup, find_packages
setup(
name="atsapi",
description="An API to make some game utilites for TrekMUSH: Among The Stars available via HTTP",
url="https://github.com/kcphysics/ATSAPI",
author="KCPhysics",
packages=find_packages(),
classifiers=[
"Programmin Language... | true | true |
1c3cad9d933bf2cb75ef6f8e0df67f4f37153be8 | 471 | py | Python | abc064/abc064_d.py | Vermee81/practice-coding-contests | 78aada60fa75f208ee0eef337b33b27b1c260d18 | [
"MIT"
] | null | null | null | abc064/abc064_d.py | Vermee81/practice-coding-contests | 78aada60fa75f208ee0eef337b33b27b1c260d18 | [
"MIT"
] | null | null | null | abc064/abc064_d.py | Vermee81/practice-coding-contests | 78aada60fa75f208ee0eef337b33b27b1c260d18 | [
"MIT"
] | null | null | null | # https://atcoder.jp/contests/abc064/tasks/abc064_d
from collections import deque
N = int(input())
S = [s for s in input()]
deqS = deque(S)
left = 0
right = 0
for i, s in enumerate(S):
if s == '(':
left += 1
else:
right += 1
if right > left:
deqS.appendleft('(')
left += 1
... | 19.625 | 51 | 0.535032 |
from collections import deque
N = int(input())
S = [s for s in input()]
deqS = deque(S)
left = 0
right = 0
for i, s in enumerate(S):
if s == '(':
left += 1
else:
right += 1
if right > left:
deqS.appendleft('(')
left += 1
continue
if i == N - 1 and left > right:... | true | true |
1c3cadc1558b288943a4faced43eca5c4e162225 | 1,888 | py | Python | tests/contract_tests/KT1GbWiFga8U9ikdxNMeXWoTrx65sCg9MNaU/test_gbwifg_setWhiteListing.py | konchunas/pytezos | 65576d18bdf1956fae8ea21241b6c43a38921b83 | [
"MIT"
] | 98 | 2019-02-07T16:33:38.000Z | 2022-03-31T15:53:41.000Z | tests/contract_tests/KT1GbWiFga8U9ikdxNMeXWoTrx65sCg9MNaU/test_gbwifg_setWhiteListing.py | konchunas/pytezos | 65576d18bdf1956fae8ea21241b6c43a38921b83 | [
"MIT"
] | 152 | 2019-05-20T16:38:56.000Z | 2022-03-30T14:24:38.000Z | tests/contract_tests/KT1GbWiFga8U9ikdxNMeXWoTrx65sCg9MNaU/test_gbwifg_setWhiteListing.py | konchunas/pytezos | 65576d18bdf1956fae8ea21241b6c43a38921b83 | [
"MIT"
] | 34 | 2019-07-25T12:03:51.000Z | 2021-11-11T22:23:38.000Z | from unittest import TestCase
from os.path import dirname, join
import json
from pytezos.michelson.program import MichelsonProgram
from pytezos.michelson.types.big_map import big_map_diff_to_lazy_diff
from pytezos.michelson.forge import forge_micheline, unforge_micheline
folder = 'dexter_usdtz_xtz'
entrypoint = 'remo... | 39.333333 | 112 | 0.724047 | from unittest import TestCase
from os.path import dirname, join
import json
from pytezos.michelson.program import MichelsonProgram
from pytezos.michelson.types.big_map import big_map_diff_to_lazy_diff
from pytezos.michelson.forge import forge_micheline, unforge_micheline
folder = 'dexter_usdtz_xtz'
entrypoint = 'remo... | true | true |
1c3cae4502ee75c7b7c37cdf55564728c019dcec | 518 | py | Python | espresso/data/__init__.py | dendisuhubdy/espresso | 7085f757e984e2d1ea93807991c1a46479bfc618 | [
"MIT"
] | null | null | null | espresso/data/__init__.py | dendisuhubdy/espresso | 7085f757e984e2d1ea93807991c1a46479bfc618 | [
"MIT"
] | null | null | null | espresso/data/__init__.py | dendisuhubdy/espresso | 7085f757e984e2d1ea93807991c1a46479bfc618 | [
"MIT"
] | null | null | null | # Copyright (c) Yiming Wang
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
from .asr_dataset import AsrDataset
from .asr_dictionary import AsrDictionary
from .feat_text_dataset import (
AsrTextDataset,
FeatScpCachedDataset,
Feat... | 22.521739 | 65 | 0.737452 |
from .asr_dataset import AsrDataset
from .asr_dictionary import AsrDictionary
from .feat_text_dataset import (
AsrTextDataset,
FeatScpCachedDataset,
FeatScpDataset,
FeatScpInMemoryDataset,
)
__all__ = [
'AsrDataset',
'AsrDictionary',
'AsrTextDataset',
'FeatScpCachedDataset',
'F... | true | true |
1c3cae7a04ed48a7722897ae9024e5eca9692bd2 | 9,726 | py | Python | python/ccxt/coinmarketcap.py | voBits/ccxt | edd2dd92053bd06232769a63465a43912b21eda0 | [
"MIT"
] | 73 | 2018-05-15T00:53:50.000Z | 2022-03-07T14:45:11.000Z | python/ccxt/coinmarketcap.py | voBits/ccxt | edd2dd92053bd06232769a63465a43912b21eda0 | [
"MIT"
] | 20 | 2018-05-15T08:46:45.000Z | 2018-06-19T08:49:27.000Z | python/ccxt/coinmarketcap.py | voBits/ccxt | edd2dd92053bd06232769a63465a43912b21eda0 | [
"MIT"
] | 11 | 2018-05-15T00:09:30.000Z | 2022-03-07T14:45:27.000Z | # -*- coding: utf-8 -*-
# PLEASE DO NOT EDIT THIS FILE, IT IS GENERATED AND WILL BE OVERWRITTEN:
# https://github.com/ccxt/ccxt/blob/master/CONTRIBUTING.md#how-to-contribute-code
from ccxt.base.exchange import Exchange
import math
from ccxt.base.errors import ExchangeError
class coinmarketcap (Exchange):
def d... | 35.111913 | 151 | 0.451676 |
ge import Exchange
import math
from ccxt.base.errors import ExchangeError
class coinmarketcap (Exchange):
def describe(self):
return self.deep_extend(super(coinmarketcap, self).describe(), {
'id': 'coinmarketcap',
'name': 'CoinMarketCap',
'rateLimit': 10000,
... | true | true |
1c3caf08ced27c0e5cd877306734982c58b8fdb5 | 239 | py | Python | HLTrigger/Configuration/python/HLT_75e33/modules/hltAK4PFPuppiJetCorrectorL2_cfi.py | PKUfudawei/cmssw | 8fbb5ce74398269c8a32956d7c7943766770c093 | [
"Apache-2.0"
] | 1 | 2021-11-30T16:24:46.000Z | 2021-11-30T16:24:46.000Z | HLTrigger/Configuration/python/HLT_75e33/modules/hltAK4PFPuppiJetCorrectorL2_cfi.py | PKUfudawei/cmssw | 8fbb5ce74398269c8a32956d7c7943766770c093 | [
"Apache-2.0"
] | 4 | 2021-11-29T13:57:56.000Z | 2022-03-29T06:28:36.000Z | HLTrigger/Configuration/python/HLT_75e33/modules/hltAK4PFPuppiJetCorrectorL2_cfi.py | PKUfudawei/cmssw | 8fbb5ce74398269c8a32956d7c7943766770c093 | [
"Apache-2.0"
] | 1 | 2021-11-30T16:16:05.000Z | 2021-11-30T16:16:05.000Z | import FWCore.ParameterSet.Config as cms
hltAK4PFPuppiJetCorrectorL2 = cms.EDProducer("LXXXCorrectorProducer",
#algorithm = cms.string('AK4PFPuppiHLT'),
algorithm = cms.string('AK4PFPuppi'),
level = cms.string('L2Relative')
)
| 29.875 | 69 | 0.748954 | import FWCore.ParameterSet.Config as cms
hltAK4PFPuppiJetCorrectorL2 = cms.EDProducer("LXXXCorrectorProducer",
algorithm = cms.string('AK4PFPuppi'),
level = cms.string('L2Relative')
)
| true | true |
1c3caf13a1646674626907addf5a607e3d1ada06 | 4,408 | py | Python | benchmark/startQiskit_QC2807.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | benchmark/startQiskit_QC2807.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | benchmark/startQiskit_QC2807.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | # qubit number=4
# total number=40
import cirq
import qiskit
from qiskit import IBMQ
from qiskit.providers.ibmq import least_busy
from qiskit import QuantumCircuit, QuantumRegister, ClassicalRegister
from qiskit import BasicAer, execute, transpile
from pprint import pprint
from qiskit.test.mock import FakeVigo
from ma... | 35.264 | 165 | 0.655172 |
import cirq
import qiskit
from qiskit import IBMQ
from qiskit.providers.ibmq import least_busy
from qiskit import QuantumCircuit, QuantumRegister, ClassicalRegister
from qiskit import BasicAer, execute, transpile
from pprint import pprint
from qiskit.test.mock import FakeVigo
from math import log2
import numpy as np... | true | true |
1c3cb0095cb31ff4dd18af04d18443ae107f4042 | 528 | py | Python | chapter_2/2.3.py | frbaroni/ctci | ff2f308aae76ab0e3dde09c7f88f37b86073cb38 | [
"MIT"
] | null | null | null | chapter_2/2.3.py | frbaroni/ctci | ff2f308aae76ab0e3dde09c7f88f37b86073cb38 | [
"MIT"
] | null | null | null | chapter_2/2.3.py | frbaroni/ctci | ff2f308aae76ab0e3dde09c7f88f37b86073cb38 | [
"MIT"
] | null | null | null | import unittest
from mylist import LinkedList
def deleteElement(node):
node.data = node.next.data
node.next = node.next.next
class Playground(unittest.TestCase):
def test_1(self):
A = LinkedList.create([1, 2, 3])
E = [1, 3]
deleteElement(A.next)
self.assertEqual(A.t... | 22.956522 | 40 | 0.589015 | import unittest
from mylist import LinkedList
def deleteElement(node):
node.data = node.next.data
node.next = node.next.next
class Playground(unittest.TestCase):
def test_1(self):
A = LinkedList.create([1, 2, 3])
E = [1, 3]
deleteElement(A.next)
self.assertEqual(A.t... | true | true |
1c3cb2063e2e13d9df8c308ae92078bda0ec502e | 9,826 | py | Python | allocation/tests/test_allocation_model.py | SuviVappula/tilavarauspalvelu-core | ad7dec36e392a7b2927e2f825c3b0eb29b700793 | [
"MIT"
] | null | null | null | allocation/tests/test_allocation_model.py | SuviVappula/tilavarauspalvelu-core | ad7dec36e392a7b2927e2f825c3b0eb29b700793 | [
"MIT"
] | 90 | 2020-11-13T07:42:32.000Z | 2022-03-29T08:54:20.000Z | allocation/tests/test_allocation_model.py | SuviVappula/tilavarauspalvelu-core | ad7dec36e392a7b2927e2f825c3b0eb29b700793 | [
"MIT"
] | 8 | 2021-02-10T11:31:22.000Z | 2022-01-28T14:33:47.000Z | import datetime
from unittest import mock
import pytest
from assertpy import assert_that
from django.conf import settings
from django.utils import timezone
from allocation.allocation_data_builder import AllocationDataBuilder
from allocation.allocation_models import ALLOCATION_PRECISION
from allocation.tests.conftest ... | 30.233846 | 86 | 0.736821 | import datetime
from unittest import mock
import pytest
from assertpy import assert_that
from django.conf import settings
from django.utils import timezone
from allocation.allocation_data_builder import AllocationDataBuilder
from allocation.allocation_models import ALLOCATION_PRECISION
from allocation.tests.conftest ... | true | true |
1c3cb2ef93da1d4961633ca0dadd632f8ceb0772 | 3,491 | py | Python | pyfos/utils/fru/powersupply_show.py | madhavinaiduprathap/pyfosbrocade | ec100e77c441761c3e688f1d8e5d18ad38cc83f4 | [
"Apache-2.0"
] | 44 | 2017-11-17T12:03:11.000Z | 2022-02-03T20:57:56.000Z | pyfos/utils/fru/powersupply_show.py | madhavinaiduprathap/pyfosbrocade | ec100e77c441761c3e688f1d8e5d18ad38cc83f4 | [
"Apache-2.0"
] | 13 | 2018-10-09T15:34:15.000Z | 2022-02-24T20:03:17.000Z | pyfos/utils/fru/powersupply_show.py | madhavinaiduprathap/pyfosbrocade | ec100e77c441761c3e688f1d8e5d18ad38cc83f4 | [
"Apache-2.0"
] | 23 | 2017-12-14T18:08:33.000Z | 2022-02-03T15:33:40.000Z | #!/usr/bin/env python3
# Copyright 2018 Brocade Communications Systems LLC. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may also obtain a copy of the License at
# http://www.apache.org/licenses/LICENS... | 30.094828 | 82 | 0.640504 |
import sys
from pyfos import pyfos_auth
from pyfos import pyfos_util
from pyfos.pyfos_brocade_fru import power_supply
from pyfos.utils import brcd_util
def show_ps_unit(session, unit):
ps_obj = power_supply()
if unit is None:
result = ps_obj.get(session, None)
else:
result ... | true | true |
1c3cb458d650dff443765834895564fca43cb0f9 | 12,526 | py | Python | eip.py | karthiksedoc/Ansible-EfficientIP | 48f68cc2311ebdb3bb4743b5f805277c3de7f589 | [
"BSD-2-Clause"
] | 18 | 2016-11-18T07:57:47.000Z | 2020-02-08T15:25:12.000Z | eip.py | karthiksedoc/Ansible-EfficientIP | 48f68cc2311ebdb3bb4743b5f805277c3de7f589 | [
"BSD-2-Clause"
] | 2 | 2020-03-04T16:29:40.000Z | 2020-09-08T13:00:17.000Z | eip.py | karthiksedoc/Ansible-EfficientIP | 48f68cc2311ebdb3bb4743b5f805277c3de7f589 | [
"BSD-2-Clause"
] | 10 | 2018-08-10T12:49:21.000Z | 2020-09-01T07:10:31.000Z | #!/usr/bin/python
# ==============================================================
# WIP WIP WIP WIP WIP WIP WIP WIP WIP WIP WIP WIP WIP WIP
# WIP WIP WIP WIP WIP WIP WIP WIP WIP WIP WIP WIP WIP WIP
# ==============================================================
DOCUMENTATION = '''
---
module: EfficientIP
ver... | 41.892977 | 189 | 0.568338 |
DOCUMENTATION = '''
---
module: EfficientIP
version_added: "0.8"
short_description: Ansible interface to the REST/RPC EfficientIP SOLIDServer API
description:
- works with SOLIDserver 6.0.x (don't even try on earlier version, please upgrade)
- works with Ansible 2.4 and Ansible 2.5 (python2.7)
- support... | false | true |
1c3cb466a02a1e0c4d40fecb679fd01dc878271d | 702 | py | Python | hook.py | leonardogavaudan/emu | df263a9143c801028a7593895be8e647b8227617 | [
"Apache-2.0"
] | null | null | null | hook.py | leonardogavaudan/emu | df263a9143c801028a7593895be8e647b8227617 | [
"Apache-2.0"
] | null | null | null | hook.py | leonardogavaudan/emu | df263a9143c801028a7593895be8e647b8227617 | [
"Apache-2.0"
] | null | null | null | import os
import shutil
from app.utility.base_world import BaseWorld
from plugins.emu.app.emu_svc import EmuService
name = 'Emu'
description = 'The collection of abilities from the CTID Adversary Emulation Plans'
address = None
access = BaseWorld.Access.RED
data_dir = os.path.join('plugins', name.lower(), 'data')
a... | 27 | 83 | 0.722222 | import os
import shutil
from app.utility.base_world import BaseWorld
from plugins.emu.app.emu_svc import EmuService
name = 'Emu'
description = 'The collection of abilities from the CTID Adversary Emulation Plans'
address = None
access = BaseWorld.Access.RED
data_dir = os.path.join('plugins', name.lower(), 'data')
a... | true | true |
1c3cb5a8ffd9fbacef60a0be301fe4f5ae217ce2 | 3,610 | py | Python | tests/test_0013-rntuple-anchor.py | eic/uproot4 | deb8d88c2643521f372bf5005c51af8926016c7e | [
"BSD-3-Clause"
] | 133 | 2020-05-08T21:34:11.000Z | 2022-03-07T18:12:58.000Z | tests/test_0013-rntuple-anchor.py | eic/uproot4 | deb8d88c2643521f372bf5005c51af8926016c7e | [
"BSD-3-Clause"
] | 269 | 2020-05-13T02:42:24.000Z | 2022-03-24T20:24:16.000Z | tests/test_0013-rntuple-anchor.py | eic/uproot4 | deb8d88c2643521f372bf5005c51af8926016c7e | [
"BSD-3-Clause"
] | 45 | 2020-05-15T17:48:04.000Z | 2022-03-18T19:23:07.000Z | # BSD 3-Clause License; see https://github.com/scikit-hep/uproot4/blob/main/LICENSE
from __future__ import absolute_import
import json
import sys
try:
import queue
except ImportError:
import Queue as queue
import numpy
import pytest
import skhep_testdata
import uproot
def test():
filename = skhep_tes... | 42.470588 | 83 | 0.380332 |
from __future__ import absolute_import
import json
import sys
try:
import queue
except ImportError:
import Queue as queue
import numpy
import pytest
import skhep_testdata
import uproot
def test():
filename = skhep_testdata.data_path("uproot-ntpl001_staff.root")
with uproot.open(filename) as f:
... | true | true |
1c3cb5e2b33c7d4bedf3b9036ac977eecc09181b | 794 | py | Python | examples/structured_configs_tutorial/2_node_path/my_app.py | dylanturpin/hydra | 6478511aee837491aab34a1e62c43c1c6ef730b9 | [
"MIT"
] | 2 | 2019-06-12T17:22:38.000Z | 2020-06-10T07:58:37.000Z | examples/structured_configs_tutorial/2_node_path/my_app.py | dylanturpin/hydra | 6478511aee837491aab34a1e62c43c1c6ef730b9 | [
"MIT"
] | null | null | null | examples/structured_configs_tutorial/2_node_path/my_app.py | dylanturpin/hydra | 6478511aee837491aab34a1e62c43c1c6ef730b9 | [
"MIT"
] | 2 | 2019-01-16T05:31:35.000Z | 2020-04-10T22:00:01.000Z | # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved
from dataclasses import dataclass
from omegaconf import DictConfig
import hydra
from hydra.core.config_store import ConfigStore
@dataclass
class MySQLConfig:
driver: str = "mysql"
host: str = "localhost"
port: int = 3306
user: st... | 24.060606 | 99 | 0.691436 |
from dataclasses import dataclass
from omegaconf import DictConfig
import hydra
from hydra.core.config_store import ConfigStore
@dataclass
class MySQLConfig:
driver: str = "mysql"
host: str = "localhost"
port: int = 3306
user: str = "omry"
password: str = "secret"
ConfigStore.instance().store... | true | true |
1c3cb69cc713ba2f6020e79a4c0b2869a86d2cf2 | 3,149 | py | Python | test/functional/mempool_limit.py | sirgreyhat/verge | 3181a2658e01d2d8dceed6f57dca356d94c92be1 | [
"MIT"
] | 1,787 | 2016-02-20T23:38:23.000Z | 2020-02-11T14:10:01.000Z | test/functional/mempool_limit.py | sirgreyhat/verge | 3181a2658e01d2d8dceed6f57dca356d94c92be1 | [
"MIT"
] | 824 | 2016-03-09T22:08:06.000Z | 2020-01-24T12:01:15.000Z | test/functional/mempool_limit.py | sirgreyhat/verge | 3181a2658e01d2d8dceed6f57dca356d94c92be1 | [
"MIT"
] | 577 | 2016-02-10T20:26:47.000Z | 2020-01-13T09:22:44.000Z | #!/usr/bin/env python3
# Copyright (c) 2014-2017 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test mempool limiting together/eviction with the wallet."""
from test_framework.test_framework import ... | 48.446154 | 118 | 0.667196 |
from test_framework.test_framework import VergeTestFramework
from test_framework.util import *
class MempoolLimitTest(VergeTestFramework):
def set_test_params(self):
self.setup_clean_chain = True
self.num_nodes = 1
self.extra_args = [["-maxmempool=5", "-spendzeroconfchange=0"]]
de... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.